1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[97697,265,76373,41143,77340,90882,60496,4593,48662,31887,43621],{26651:function(e,t,a){"use strict";var r=a(57437),s=a(2265),l=a(47907),i=a(73107),o=a(51448),n=a(8792),d=a(64848),c=a(6128),u=a(52840),x=a(71709),h=a(60102),m=a(58641),p=a(70784),b=a(61975),g=a(71399),f=a(55647),v=a(80812),w=a(29908),k=a(70997),y=a(26173);a(20703);var j=a(85682);t.Z=()=>{var e,t,a,N;let{isSidebarExpanded:z,toggleSidebar:_,mounted:S}=(0,j.useSidebar)(),{isLoggedin:C,serverDetails:I}=(0,o.useUser)(),L=null==I?void 0:null===(e=I.user_details)||void 0===e?void 0:e.name,P=null==I?void 0:null===(t=I.user_details)||void 0===t?void 0:t.profile,E=null==I?void 0:null===(a=I.user_details)||void 0===a?void 0:a.email;null==I||I.user_subscription_details;let A=null==I?void 0:null===(N=I.user_details)||void 0===N?void 0:N.user_tier,{theme:M,setTheme:q}=(0,d.useTheme)(),D=(0,l.usePathname)(),T=(0,l.useRouter)(),U=(0,s.useRef)(null),[F,R]=(0,s.useState)(!1),[Z,V]=(0,s.useState)(!1),[W,B]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=e=>{U.current&&!U.current.contains(e.target)&&B(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);let O=()=>{i.Z.get("/api/logout?all_devices=".concat(Z)).then(e=>{R(!1),T.push("/login")}).catch(e=>{console.error(e),R(!1)})},G=e=>{let{label:t,path:a,icon:s,isExpanded:l}=e,i="/"===a?"/"===D:D.startsWith(a);return(0,r.jsxs)("div",{className:"w-full flex items-center group relative px-1",children:[(0,r.jsxs)(n.default,{href:a,"aria-label":t,className:"relative flex items-center gap-4 font-medium whitespace-nowrap px-3 py-2.5 min-h-[44px] transition-all duration-300 ease-out\n ".concat(l?"rounded-lg":"rounded-full"," \n w-full overflow-hidden hover:scale-[1.02] active:scale-[0.98]\n ").concat(i?"bg-gradient-to-r from-blue-600 to-indigo-600 text-white shadow-[0_4px_15px_rgba(59,130,246,0.3)] dark:shadow-[0_4px_20px_rgba(59,130,246,0.2)]":"text-zinc-900 dark:text-zinc-100 visited:text-zinc-900 dark:visited:text-zinc-100 hover:bg-indigo-500/5 dark:hover:bg-indigo-500/10 border border-100 dark:border-divider hover:border-indigo-500/10"),children:[(0,r.jsx)("div",{className:"flex-shrink-0 transition-all duration-300 group-hover:scale-110 ".concat(i?"text-white":"group-hover:text-indigo-500"),children:(0,r.jsx)(s,{size:20})}),(0,r.jsx)("span",{className:"".concat(l?"opacity-100 visible":"opacity-0 invisible"," transition-all duration-300 font-semibold tracking-tight text-zinc-900 dark:text-zinc-100 group-hover:translate-x-1"),children:t}),i&&l&&(0,r.jsx)("div",{className:"absolute right-3 w-1.5 h-1.5 rounded-full bg-white shadow-[0_0_8px_rgba(255,255,255,0.8)] animate-pulse"})]}),!l&&(0,r.jsxs)("span",{className:"absolute left-16 transform text-xs bg-indigo-600 text-white px-3 py-1.5 font-bold rounded-lg opacity-0 invisible scale-90 group-hover:opacity-100 group-hover:visible transition-all duration-300 ease-in-out group-hover:scale-100 pointer-events-none shadow-[0_4px_12px_rgba(79,70,229,0.3)] z-50",children:[t,(0,r.jsx)("span",{className:"absolute left-[-6px] top-1/2 transform -translate-y-1/2 w-0 h-0 border-t-6 border-t-transparent border-b-6 border-b-transparent border-r-6 border-r-indigo-600"})]})]})},K=e=>{let{variant:t}=e,a="desktop"===t,s=!!a||z,l=a?"text-indigo-600/70 dark:text-indigo-400/70 font-bold text-[10px] uppercase tracking-[0.15em] self-start px-4 mt-6 mb-1":"text-indigo-600/70 dark:text-indigo-400/70 font-bold text-[10px] uppercase tracking-[0.15em] self-start px-4 mt-6 mb-1 ".concat(!z&&"opacity-0");return(0,r.jsxs)("div",{className:"w-full h-full flex flex-col",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 flex-1 justify-center pt-2 px-1 overflow-y-auto scrollbar-hide",children:[(0,r.jsx)("h3",{className:l,children:"Main Menu"}),(0,r.jsx)(G,{label:"Create",path:"/",icon:c.iqr,isExpanded:s}),(0,r.jsx)(G,{label:"My Projects",path:"/my-content",icon:v.lTi,isExpanded:s}),(0,r.jsx)(G,{label:"Calendar",path:"/calendar",icon:u.qKA,isExpanded:s}),(0,r.jsx)(G,{label:"AI Apps",path:"/ai-tools",icon:f.Tw$,isExpanded:s}),(0,r.jsx)(G,{label:"AI Agents",path:"/agents",icon:k.$Oz,isExpanded:s}),(0,r.jsx)(G,{label:"Assistant",path:"/assistant",icon:w.Moc,isExpanded:s}),(0,r.jsx)(G,{label:"Auto Mode",path:"/automate",icon:p.TJX,isExpanded:s}),(0,r.jsx)(G,{label:"Video Editor",path:"/video-editor",icon:m.mau,isExpanded:s}),(0,r.jsx)("h3",{className:l,children:"Account"}),(0,r.jsx)(G,{label:"Activity",path:"/activity",icon:p.H$C,isExpanded:s}),(0,r.jsx)(G,{label:"Support",path:"/support",icon:m.LVi,isExpanded:s}),(0,r.jsx)(G,{label:"Subscription",path:"/subscription",icon:x.khu,isExpanded:s}),(null==I?void 0:I.workspace)&&(0,r.jsx)(G,{label:"Workspace",path:"/workspace",icon:y.WY8,isExpanded:s})]}),(0,r.jsx)("div",{className:"mt-auto border-t border-indigo-500/10 dark:border-white/5 relative py-2",children:C?(0,r.jsxs)(r.Fragment,{children:[W&&(0,r.jsxs)("div",{className:"absolute bottom-[calc(100%+8px)] left-0 w-64 dark:bg-zinc-900 bg-white border dark:border-white/5 border-black/5 shadow-2xl rounded-lg overflow-hidden z-[100] transition-all duration-300 animate-in fade-in slide-in-from-bottom-2",children:[(0,r.jsx)(n.default,{href:"/profile",className:"flex items-center w-full p-4 border-b border-white/5 hover:bg-gray-100 dark:hover:bg-secondary-bg cursor-pointer",children:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,r.jsx)("div",{className:"absolute -inset-0.5 bg-gradient-to-tr from-blue-500 to-indigo-600 rounded-full blur-[1px] opacity-70"}),P?(0,r.jsx)("img",{src:P,className:"relative rounded-full w-10 h-10 object-cover border-2 border-zinc-900",alt:"profile"}):(0,r.jsx)("div",{className:"relative rounded-full w-10 h-10 bg-blue-600 flex items-center justify-center text-white font-bold text-sm border-2 border-zinc-900",children:(null==L?void 0:L.charAt(0))||"U"})]}),(0,r.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,r.jsx)("span",{className:"text-[15px] font-bold text-black dark:text-white truncate capitalize",children:L||"User"}),(0,r.jsx)("span",{className:"text-[11px] text-zinc-600 dark:text-zinc-400 truncate",children:E||"@user"})]})]})}),(0,r.jsx)("div",{className:"px-2 pt-1 pb-2 flex flex-col gap-0.5",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2 justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)("button",{type:"button","aria-label":"Switch to dark theme",className:"flex items-center gap-3 w-full p-2 rounded-lg text-black dark:text-white hover:text-indigo-400 hover:bg-gray-100 transition-all flex dark:hidden",onClick:()=>q("dark"),children:[(0,r.jsx)(g.TLr,{size:15})," Light Mode"]}),(0,r.jsxs)("button",{type:"button","aria-label":"Switch to light theme",className:"flex items-center gap-3 w-full p-2 rounded-lg text-black dark:text-white hover:text-yellow-500 hover:bg-white/5 transition-all hidden dark:flex",onClick:()=>q("light"),children:[(0,r.jsx)(b.aQ_,{size:15,className:"text-yellow-400"})," Dark Mode"]})]}),(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-3 flex-1 p-2 rounded-lg dark:hover:bg-white/5 hover:bg-gray-100 transition-colors group text-black dark:text-white hover:text-red-500 dark:hover:text-red-500",onClick:()=>{B(!1),R(!0)},children:[(0,r.jsx)(h.VUx,{size:18}),(0,r.jsx)("span",{className:"text-sm font-medium",children:"Log out"})]})]})})]}),(0,r.jsxs)("div",{onClick:()=>B(!W),className:"flex items-center ".concat(s?"gap-3":"flex-col gap-3"," w-full cursor-pointer rounded-lg transition-all duration-300 hover:bg-zinc-100 dark:hover:bg-white/5 p-1"),children:[(0,r.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,r.jsx)("div",{className:"absolute -inset-0.5 bg-gradient-to-tr from-blue-500 to-indigo-600 rounded-full blur-[1px] opacity-50 group-hover:opacity-100 transition-opacity duration-300"}),P?(0,r.jsx)("img",{src:P,className:"relative rounded-full w-9 h-9 object-cover border-2 border-white dark:border-zinc-900",alt:"profile"}):(0,r.jsx)("div",{className:"relative rounded-full w-9 h-9 bg-blue-600 flex items-center justify-center text-white font-bold text-xs border-2 border-white dark:border-zinc-900",children:(null==L?void 0:L.charAt(0))||"U"})]}),s&&(0,r.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"text-sm font-bold text-zinc-800 dark:text-white truncate capitalize",children:L||"User"}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 font-bold",children:A||"Free"})]}),s&&(0,r.jsx)("div",{className:"flex-shrink-0 text-zinc-400",children:(0,r.jsx)(u.mzm,{size:14,className:"transform transition-all duration-300 ".concat(W?"-rotate-90":"")})})]})]}):(0,r.jsx)(n.default,{className:"flex items-center justify-center gap-2 font-bold whitespace-nowrap bg-gradient-to-tr from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white transition-all duration-300 shadow-[0_4px_15px_rgba(79,70,229,0.25)] hover:shadow-[0_8px_25px_rgba(79,70,229,0.35)] rounded-xl p-3 min-h-[44px] w-full overflow-hidden text-sm hover:scale-[1.02] active:scale-[0.98]",href:"/login?redirect=".concat(D),"aria-label":s?void 0:"Sign In / Login",children:s?"Sign In / Login":(0,r.jsx)(h.V5F,{size:22})})})]})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(()=>F?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-primary-bg rounded-lg shadow-xl p-6 w-96 relative border dark:border-divider",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold mb-4 text-gray-900 dark:text-white",children:"Confirm Logout"}),(0,r.jsx)("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:"Are you sure you want to log out?"}),(0,r.jsxs)("div",{className:"flex items-center mb-6",children:[(0,r.jsx)("input",{type:"checkbox",id:"logoutAll",checked:Z,onChange:e=>V(e.target.checked),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dar
1k:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),(0,r.jsx)("label",{htmlFor:"logoutAll",className:"ml-2 text-sm font-medium text-gray-900 dark:text-gray-300",children:"Logout from all devices"})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,r.jsx)("button",{onClick:()=>R(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600",children:"Cancel"}),(0,r.jsx)("button",{onClick:O,className:"px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-md hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500",children:"Log Out"})]})]})}):null,{}),(0,r.jsxs)("aside",{ref:U,"aria-label":"Sidebar navigation",className:"fixed ".concat(z?"bg-black/20 backdrop-blur-sm w-full lg:w-min":"w-0 pointer-events-none lg:pointer-events-auto"," lg:static z-50 flex justify-start h-dvh transition-all duration-500 ease-in-out"),children:[(0,r.jsxs)("div",{className:"h-full flex flex-col justify-center premium-bg transition-all duration-500 ease-in-out relative py-2 ".concat(S?z?"w-64 px-2 lg:w-60":"w-0 overflow-hidden lg:w-0":"lg:w-60 lg:px-2"," border-r border-black/5 dark:border-white/10 hidden lg:flex"),children:[(0,r.jsx)("button",{title:z?"Collapse":"Expand","aria-label":z?"Collapse sidebar":"Expand sidebar",className:"absolute top-4 right-[-14px] z-50 bg-white dark:bg-zinc-900 border border-black/10 dark:border-white/20 p-2 rounded-full shadow-lg hover:scale-110 transition-transform focus:outline-none hidden lg:block",onClick:_,children:(0,r.jsx)(x.Mit,{size:14,className:"transform transition-transform duration-500 ".concat(z?"rotate-180":"")})}),(0,r.jsx)("div",{className:"flex flex-col gap-2 w-full h-full",children:(0,r.jsx)(K,{variant:"desktop"})})]}),z&&(0,r.jsx)("div",{className:"absolute w-full h-full lg:hidden",onClick:_}),(0,r.jsxs)("div",{className:"h-full z-10 flex flex-col items-center justify-center gap-2 premium-bg transition-all duration-500 ease-in-out relative py-2 lg:hidden ".concat(z?"w-64 px-4":"hidden"),children:[(0,r.jsx)("button",{title:z?"Collapse":"Expand","aria-label":z?"Collapse sidebar":"Expand sidebar",className:"absolute top-6 right-4 z-10 text-zinc-500 dark:text-zinc-400 premium-glass p-2 rounded-full focus:outline-none lg:hidden",onClick:_,children:(0,r.jsx)(x.Mit,{size:18,className:"transform transition duration-500 ".concat(z?"rotate-180":"")})}),(0,r.jsx)("div",{className:"flex flex-col gap-2 w-full h-full",children:(0,r.jsx)(K,{variant:"mobile"})})]})]})]})}},265:function(e,t,a){"use strict";a.r(t);var r=a(57437),s=a(2265),l=a(71752),i=a(26173);t.default=e=>{let{setShowLanguages:t,selectedLanguage:a,setLanguage:o,popupRef:n}=e,[d,c]=(0,s.useState)(a);return(0,r.jsx)("div",{className:"fixed inset-0 flex items-center justify-center z-[150] bg-black/60 backdrop-blur-md animate-in fade-in duration-300",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2 w-full max-w-[90%] lg:max-w-[60%] h-full max-h-[90%] bg-white dark:bg-zinc-900 rounded-xl border border-zinc-200 dark:border-white/5 shadow-2xl overflow-hidden",ref:n,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-zinc-200 dark:border-white/10",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("h3",{className:"text-xl font-bold text-zinc-900 dark:text-white",children:"Select a Language"}),(0,r.jsxs)("p",{className:"text-xs font-bold text-zinc-400",children:[l.Mj.length," Languages Available"]})]}),(0,r.jsx)("button",{onClick:()=>t(!1),className:"w-10 h-10 rounded-full flex items-center justify-center text-zinc-400 hover:bg-zinc-100 dark:hover:bg-white/5 hover:text-zinc-900 dark:hover:text-white transition-all",children:(0,r.jsx)(i.q5L,{size:24})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-6 no-scrollbar bg-zinc-50/30 dark:bg-zinc-900/30",children:(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2",children:l.Mj.map((e,t)=>(0,r.jsxs)("div",{className:"group relative flex items-center justify-between p-2 rounded-lg cursor-pointer transition-all duration-300 border-2 ".concat(d===e.value?"bg-blue-600 border-blue-600 text-white shadow-lg shadow-blue-500/20":"bg-white dark:bg-zinc-800/50 border-zinc-200 dark:border-white/5 text-zinc-600 dark:text-zinc-300 hover:border-blue-500/50 hover:bg-zinc-50 dark:hover:bg-zinc-800"),onClick:()=>c(e.value),children:[(0,r.jsx)("p",{className:"text-sm font-semibold",children:e.label}),d===e.value&&(0,r.jsx)(i.UgA,{size:18,className:"text-white"})]},t))})}),(0,r.jsxs)("div",{className:"p-2 bg-zinc-50/50 dark:bg-zinc-800/30 border-t border-zinc-100 dark:border-white/5 flex items-center justify-end gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>t(!1),className:"px-6 py-2 rounded-xl bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-white/10 text-sm text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-all",children:"Cancel"}),(0,r.jsx)("button",{type:"button",onClick:()=>{t(!1),o(d)},className:"px-6 py-2 rounded-xl bg-blue-600 text-white shadow-xl shadow-blue-500/20 text-sm transition-all hover:bg-blue-700 hover:scale-[1.02] active:scale-[0.98]",children:"Apply Language"})]})]})})}},4593:function(e,t,a){"use strict";a.d(t,{Z:function(){return f}});var r=a(57437),s=a(2265),l=a(47907),i=a(20703),o=a(51448),n=a(8792);a(64848);var d=a(42362),c=a(71399),u=a(71709),x=a(73107),h=a(52840),m=a(71752),p=a(90882),b=a(85682),g=a(48796),f=e=>{var t,a,f,v;let{searchQuery:w="",setSearchQuery:k=()=>{}}=e,{isSidebarExpanded:y,toggleSidebar:j}=(0,b.useSidebar)(),N=(0,l.useRouter)(),z=(0,l.usePathname)(),[_,S]=(0,s.use
1State)(!1),[C,I]=(0,s.useState)(!1),{isLoggedin:L,serverDetails:P,setServerDetails:E,isComplianceRestricted:A}=(0,o.useUser)(),[M,q]=(0,s.useState)([]),[D,T]=(0,s.useState)(!1),U=(0,s.useRef)(null),F=(0,s.useRef)(null),R=(null===(t=P.user_subscription_details)||void 0===t?void 0:t.is_onetime_user)||(null===(a=P.user_subscription_details)||void 0===a?void 0:a.is_appsumo_user),Z=(0,s.useMemo)(()=>{let e=(0,m.l3)();return A?e.filter(e=>!["Image Face Swap","Video Face Swap","Celebrity Image","Clone Voice"].includes(e.name)):e},[A]);(0,s.useEffect)(()=>{if(w&&""!==w.trim()){let e=w.toLowerCase();q(Z.filter(t=>t.name.toLowerCase().includes(e)))}else q([])},[w,Z]),(0,s.useEffect)(()=>{let e=e=>{U.current&&!U.current.contains(e.target)&&T(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,s.useEffect)(()=>{S("0"!==localStorage.getItem("discount_banner_closed"))},[]),["/","/ai-image","/ai-video","/ai-music"].includes(z)||z.startsWith("/help")||z.startsWith("/folder/")||z.startsWith("/social_feed/")||z.startsWith("/ai-influencer/")||z.startsWith("/explore")||z.startsWith("/profile")||z.startsWith("/workflow")||z.startsWith("/ai-storyboard")||z.startsWith("/agents");let V=async()=>{if(!C){I(!0);try{let e=await x.Z.get("/api/get_server_details");E(e.data)}catch(e){console.error("Failed to refresh credits:",e)}finally{I(!1)}}},W={"/ai-influencer":"https://docs.vadoo.tv/docs/guide/ai-character/create-character-image","/ai-influencer/[id]":"https://docs.vadoo.tv/docs/guide/ai-character/create-character-image","/ai-story":"https://docs.vadoo.tv/docs/guide/ai-story/create-an-ai-video","/generate-podcast":"https://docs.vadoo.tv/docs/guide/create-an-ai-podcast","/ai-cut":"https://docs.vadoo.tv/docs/guide/create-ai-clips","/ai-tools/image-upscaler":"https://muapi.ai/playground/ai-image-upscaler","/ai-tools/image-face-swap":"https://muapi.ai/playground/ai-image-face-swap","/ai-tools/video-face-swap":"https://muapi.ai/playground/ai-video-face-swap","/ai-tools/ai-dress-change":"https://muapi.ai/playground/ai-dress-change","/ai-tools/ai-sound-effect":"https://muapi.ai/playground/mmaudio-v2-text-to-audio","/ai-tools/ai-background-remover":"https://muapi.ai/playground/ai-background-remover","/ai-tools/ai-product-sh
1ot":"https://muapi.ai/playground/ai-product-shot","/ai-tools/ai-skin-enhancer":"https://muapi.ai/playground/ai-skin-enhancer","/ai-tools/product-photography":"https://muapi.ai/playground/ai-product-photography","/ai-tools/ai-color-photo":"https://muapi.ai/playground/ai-color-photo","/ai-tools/ai-image-extension":"https://muapi.ai/playground/ai-image-extension","/ai-tools/ai-ghibli-style":"https://muapi.ai/playground/ai-ghibli-style","/ai-tools/ai-anime-generator":"https://muapi.ai/playground/ai-anime-generator","/ai-tools/ai-object-eraser":"https://muapi.ai/playground/ai-object-eraser","/ai-image":"https://muapi.ai/playground/group/image","/ai-video":"https://muapi.ai/playground/group/video","/ai-music":"https://muapi.ai/playground/group/music"},B=Object.keys(W).find(e=>e.includes("[id]")?z.startsWith(e.split("/[")[0]):z===e),O=B?W[B]:null;return(0,r.jsxs)("div",{className:"w-full sticky top-0 z-40 border-b dark:border-white/5 bg-white/80 dark:bg-[#09090b]/80 backdrop-blur-xl flex flex-col",children:[R&&_&&(0,r.jsxs)("div",{className:"w-full bg-zinc-950 text-white py-1 relative overflow-hidden border-b border-white/5",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-600/20 via-purple-600/20 to-pink-500/20 opacity-50"}),(0,r.jsxs)("div",{className:"flex flex-col md:flex-row items-center justify-center gap-x-6 gap-y-1 text-center max-w-7xl mx-auto relative z-10 pr-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"p-1 rounded-full bg-blue-500/20 border border-blue-500/30",children:(0,r.jsx)(c.QJe,{className:"text-blue-400 w-2.5 h-2.5"})}),(0,r.jsx)("p",{className:"text-[10px] md:text-xs font-bold tracking-widest uppercase text-blue-100",children:"Exclusive Bonus"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center flex-wrap gap-3",children:[(0,r.jsx)("span",{className:"text-[10px] text-zinc-400 font-medium",children:"Review & Get 500 Credits:"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("a",{href:"https://theresanaiforthat.com/ai/vadoo-ai/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-bold bg-white/5 hover:bg-white/10 px-2.5 py-1 rounded-lg transition-all border border-white/10",children:"TAAFT"}),(0,r.jsx)("a",{href:"https://www.producthunt.com/products/vadootv-2-0/reviews/new",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-bold bg-[#ea532a]/20 hover:bg-[#ea532a]/40 text-[#ea532a] px-2.5 py-1 rounded-lg transition-all border border-[#ea532a]/30",children:"PH"}),(0,r.jsx)("a",{href:"https://appsumo.com/products/vadoo-ai",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-bold bg-[#30d5c8]/10 hover:bg-[#30d5c8]/20 text-[#30d5c8] px-2.5 py-1 rounded-lg transition-all border border-[#30d5c8]/30",children:"AppSumo"})]})]}),(0,r.jsx)("p",{className:"text-[10px] font-bold text-zinc-500 italic",children:"*First 50 users only"})]}),(0,r.jsx)("button",{onClick:()=>{S(!_),localStorage.setItem("discount_banner_closed","0")},type:"button",className:"absolute right-2 top-1/2 z-20 hover:font-bold -translate-y-1/2 text-white/80 hover:text-white p-1 rounded-full transition-colors","aria-label":"Close",children:(0,r.jsx)("span",{className:"text-sm leading-none",children:"â"})})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 w-full px-4 py-3 md:py-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:["/"!==z&&(0,r.jsx)("button",{onClick:()=>N.back(),className:"p-2 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-white/10 rounded-lg transition-all active:scale-95 flex items-center justify-center group",title:"Go Back","aria-label":"Go back",children:(0,r.jsx)(g.u1R,{size:16,className:"group-hover:-translate-x-0.5 transition-transform"})}),(0,r.jsx)("button",{onClick:j,"aria-label":"Toggle navigation menu",className:"p-2 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-white/10 rounded-lg transition-colors ".concat(y?"lg:hidden":"flex"),children:(0,r.jsx)(h.pLT,{size:24})}),(0,r.jsx)("div",{className:"flex items-center",children:(0,r.jsxs)(n.default,{href:"/",className:"self-start flex-shrink-0 ".concat(D?"hidden sm:block":""),children:[(0,r.jsx)(i.default,{alt:"Logo",src:"/vadoo-logo-white.png",height:40,width:156,className:"hidden dark:block",loader:p.default,priority:!0}),(0,r.jsx)(i.default,{alt:"Logo",src:"/vadoo-logo.png",height:40,width:156,className:"block dark:hidden",loader:p.default,priority:!0})]})})]}),(0,r.jsxs)("div",{className:"flex justify-end pr-4",ref:U,children:["/"===z&&(0,r.jsxs)("div",{className:"premium-glass flex items-center transition-all duration-500 ease-out h-10 overflow-hidden ".concat(D?"w-full md:w-[320px] border-blue-500/50 shadow-lg shadow-blue-500/10":"w-10 border-zinc-200 dark:border-white/10 hover:border-blue-500/30"," relative rounded-full cursor-pointer"),onClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.focus()},children:[(0,r.jsx)("div",{className:"flex items-center justify-center h-10 w-10 flex-shrink-0 text-zinc-400",children:(0,r.jsx)(h.eaK,{size:20,className:D?"text-blue-500 transition-colors":""})}),(0,r.jsx)("input",{ref:F,type:"text",id:"navbar-search","aria-label":"Search tools and apps",className:"w-full py-2 pr-4 leading-5 bg-transparent focus:outline-none text-sm dark:text-white transition-opacity duration-300 font-medium ".concat(D?"opacity-100":"opacity-0"),placeholder:"Search tools & apps...",value:w,onChange:e=>k(e.target.value),onFocus:()=>T(!0),onBlur:()=>T(!1)})]}),D&&M.length>0&&(0,r.jsx)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-white dark:bg-[#1a1a1a] shadow-xl max-h-[400px] rounded-xl py-2 overflow-auto focus:outline-none z-50 border border-gray-100 dark:border-zinc-800 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-zinc-600",children:M.map((e,t)=>(0,r.jsxs)("div",{className:"cursor-pointer select-none relative py-2.5 px-4 hover:bg-blue-50 dark:hover:bg-zinc-800 flex items-center gap-3 transition-colors duration-150 border-b border-dashed border-gray-100 dark:border-zinc-800 last:border-b-0",onMouseDown:e=>e.preventDefault(),onClick:t=>{t.stopPropagation(),N.push(e.url),k(""),T(!1)},children:[(0,r.jsx)("div",{className:"relative w-12 h-9 flex-shrink-0 overflow-hidden rounded-md border border-gray-200 dark:border-zinc-700",children:e.image?(0,r.jsx)("img",{src:e.image,alt:e.name,className:"w-full h-full object-cover",loading:"lazy"}):(0,r.jsx)("div",{className:"w-full h-full bg-gray-100 dark:bg-zinc-800 flex items-center justify-center text-xs text-gray-400",children:"AI"})}),(0,r.jsx)("div",{className:"flex flex-col flex-1 min-w-0",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"truncate font-medium text-gray-900 dark:text-gray-100 text-sm",children:e.name}),(0,r.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded border ".concat("App"===e.type?"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-800":"bg-gray-100 text-gray-600 border-gray-200 dark:bg-zinc-800 dark:text-gray-400 dark:border-zinc-700"),children:e.type})]})})]},t))})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[L?(0,r.jsxs)("div",{onClick:V,title:"Click to refresh credits",className:"group cursor-pointer text-xs relative flex items-center gap-2.5 px-4 py-2 bg-gradient-to-r from-zinc-100 to-zinc-200 dark:from-white/5 dark:to-white/10 border border-black/5 dark:border-white/10 rounded-full font-bold tracking-tight dark:text-white shadow-sm hover:shadow-md hover:scale-105 transition-all duration-300",children:[(0,r.jsx)(d.vAr,{size:14,className:"hidden md:block text-blue-500 transition-transform duration-700 ".concat(C?"animate-spin":"group-hover:rotate-12")}),(0,r.jsx)("span",{className:"tabular-numbers",children:null==P?void 0:null===(f=P.user_subscription_details)||void 0===f?void 0:f.remaining_credits}),(0,r.jsxs)("span",{className:"absolute left-1/2 transform -translate-x-1/2 top-12 z-50 premium-glass px-4 py-2 rounded-xl invisible group-hover:visible opacity-0 scale-90 transition-all duration-300 pointer-events-none shadow-2xl border border-white/10 whitespace-nowrap min-w-max",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-0.5",children:[(0,r.jsx)("span",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 font-bold uppercase tracking-wider",children:"Balance"}),(0,r.jsxs)("span",{className:"text-blue-500 font-extrabold text-sm",children:[null==P?void 0:null===(v=P.user_subscription_details)||void 0===v?void 0:v.remaining_credits," Credits"]})]}),(0,r.jsx)("div",{className:"absolute left-1/2 transform -translate-x-1/2 bottom-full w-0 h-0 border-b-6 border-b-zinc-200 dark:border-b-zinc-800 border-l-6 border-l-transparent border-r-6 border-r-transparent"})]})]}):(0,r.jsx)(n.default,{href:"/login?redirect=".concat(z),className:"text-xs font-bold text-center text-white bg-gradient-to-tr from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 px-4 py-2 rounded-xl flex items-center gap-1 shadow-[0_4px_15px_rgba(79,70,229,0.25)] transition-all duration-300 active:scale-95",children:"Sign In / Login"}),O&&(0,r.jsxs)(n.default,{href:O,className:"flex items-center gap-1 whitespace-nowrap font-bold text-gray-600 dark:text-secondary-text hover:text-blue-600 hover:dark:text-blue-400 hover:underline text-xs hover:text-blue-800",target:"_blank",children:[(0,r.jsx)("span",{className:"hidden md:block",children:"API Docs "}),(0,r.jsx)(u.$OI,{size:14})]})]})]})]})}},72506:function(e,t,a){"use strict";a.d(t,{Z:function(){return v}});var r=a(57437),s=a(47907),l=a(2265),i=a(42362),o=a(20703),n=a(90882),d=e=>{let{folder:t,setFolderName:a,handleDeleteFolder:i,gridView:d}=e,[c,u]=(0,l.useState)(t.name),[x,h]=(0,l.useState)(!1),[m,p]=(0,l.useState)(!1),[b,g]=(0,l.useState)(!1),f=(0,l.useRef)(null),v=(0,l.useRef)(null),w=(0,s.useRouter)();(0,l.useEffect)(()=>
1{if(b){var e;null===(e=f.current)||void 0===e||e.focus()}function t(e){v.current&&!v.current.contains(e.target)&&(h(!1),p(!1))}return window.addEventListener("click",t),()=>{window.removeEventListener("click",t)}},[b]);let k=e=>{"Enter"===e.key&&""!==c.trim()&&(a(c),g(!1))},y=()=>{""!==c.trim()&&(a(c),g(!1))};return(0,r.jsxs)("div",{className:"flex flex-col",children:[d?(0,r.jsxs)("div",{className:"premium-card premium-glass group cursor-pointer transition-all duration-300 ".concat(x?"z-50 ring-2 ring-blue-500/20":"z-auto"),onClick:()=>w.push("/folder/".concat(t.id)),children:[(0,r.jsx)("div",{className:"w-full aspect-[4/3] bg-blue-50/30 dark:bg-blue-900/10 flex justify-center items-center relative overflow-hidden border-b border-black/5 dark:border-white/5 transition-colors duration-500 group-hover:bg-blue-100/40 dark:group-hover:bg-blue-800/20",children:(0,r.jsxs)("div",{className:"relative transform transition-all duration-500 group-hover:scale-110 group-hover:-rotate-2",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-blue-500/20 blur-2xl rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,r.jsx)(o.default,{src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/blue-folder.svg",alt:"folder",width:80,height:80,className:"relative z-10 drop-shadow-xl"})]})}),(0,r.jsxs)("div",{className:"p-4 flex flex-col gap-1",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("div",{className:"w-full max-w-[85%]",children:b?(0,r.jsx)("input",{ref:f,type:"text",value:c,onChange:e=>u(e.target.value),onKeyDown:k,onBlur:y,onClick:e=>e.stopPropagation(),className:"w-full bg-transparent border-b border-blue-500/50 outline-none text-sm font-medium dark:text-white",autoFocus:!0}):(0,r.jsx)("h6",{className:"truncate font-semibold text-zinc-900 dark:text-zinc-100 text-sm group-hover:text-blue-500 transition-colors duration-300",children:t.name})}),(0,r.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,r.jsx)("button",{type:"button",className:"p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/10 transition-all active:scale-95 text-zinc-400 hover:text-blue-500",onClick:e=>{e.stopPropagation(),h(!x)},children:(0,r.jsx)(o.default,{loader:n.default,alt:"options",src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/options.svg",height:12,width:12,className:"dark:invert opacity-60 hover:opacity-100 transition-opacity"})}),x&&(0,r.jsxs)("div",{ref:v,className:"absolute z-20 w-32 top-8 right-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-xl border border-black/5 dark:border-white/10 rounded-xl shadow-2xl py-1 animate-in fade-in zoom-in duration-200",children:[(0,r.jsxs)("button",{className:"flex items-center gap-2.5 px-3 py-2 text-xs font-medium text-zinc-600 dark:text-zinc-400 hover:bg-black/5 dark:hover:bg-white/5 w-full text-left transition-colors",onClick:e=>{e.stopPropagation(),g(!0),h(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/pencil.svg",alt:"rename",width:14,height:14,className:"dark:invert opacity-60"})," Rename"]}),(0,r.jsxs)("button",{className:"flex items-center gap-2.5 px-3 py-2 text-xs font-medium text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 w-full text-left transition-colors",onClick:e=>{e.stopPropagation(),p(!0),h(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/delete.svg",alt:"delete",width:14,height:14,className:"opacity-80",style:{filter:"invert(37%) sepia(93%) saturate(7470%) hue-rotate(354deg) brightness(91%) contrast(100%)"}})," Delete"]})]})]})]}),(0,r.jsx)("p",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wider",children:t.created_at?new Date(t.created_at).toLocaleDateString():new Date().toLocaleDateString()})]})]}):(0,r.jsxs)("div",{className:"relative premium-glass group cursor-pointer p-3 flex items-center gap-4 roun
1ded-2xl border border-black/5 dark:border-white/10 hover:shadow-xl hover:bg-white/90 dark:hover:bg-zinc-800/90 transition-all duration-300 w-full ".concat(x?"z-50 border-blue-500/30":"z-auto"),onClick:()=>w.push("/folder/".concat(t.id)),children:[(0,r.jsxs)("div",{className:"relative h-24 w-32 flex-shrink-0 bg-blue-50/50 dark:bg-blue-900/20 rounded-xl overflow-hidden flex items-center justify-center border border-black/5 dark:border-white/5",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-blue-500/10 blur-xl rounded-full opacity-0 group-hover:opacity-100 transition-opacity"}),(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/blue-folder.svg",alt:"folder",width:48,height:48,className:"relative z-10"})]}),(0,r.jsxs)("div",{className:"flex-grow min-w-0",children:[b?(0,r.jsx)("input",{ref:f,type:"text",value:c,onChange:e=>u(e.target.value),onKeyDown:k,onBlur:y,onClick:e=>e.stopPropagation(),className:"w-full bg-transparent border-b border-blue-500/50 outline-none text-sm font-semibold dark:text-white",autoFocus:!0}):(0,r.jsx)("h6",{className:"truncate font-semibold text-zinc-900 dark:text-zinc-100 group-hover:text-blue-500 transition-colors duration-300",children:t.name}),(0,r.jsx)("p",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wider mt-1",children:t.created_at?new Date(t.created_at).toLocaleDateString():new Date().toLocaleDateString()})]}),(0,r.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,r.jsx)("button",{type:"button",className:"p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/10 transition-all active:scale-95 text-zinc-400 hover:text-blue-500",onClick:e=>{e.stopPropagation(),h(!x)},children:(0,r.jsx)(o.default,{loader:n.default,alt:"options",src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/options.svg",height:12,width:12,className:"dark:invert opacity-60 hover:opacity-100 transition-opacity"})}),x&&(0,r.jsxs)("div",{ref:v,className:"absolute z-20 w-32 top-8 right-0 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-xl border border-black/5 dark:border-white/10 rounded-xl shadow-2xl py-1 animate-in fade-in zoom-in duration-200",children:[(0,r.jsxs)("button",{className:"flex items-center gap-2.5 px-3 py-2 text-xs font-medium text-zinc-600 dark:text-zinc-400 hover:bg-black/5 dark:hover:bg-white/5 w-full text-left transition-colors",onClick:e=>{e.stopPropagation(),g(!0),h(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/pencil.svg",alt:"rename",width:14,height:14,className:"dark:invert opacity-60"})," Rename"]}),(0,r.jsxs)("button",{className:"flex items-center gap-2.5 px-3 py-2 text-xs font-medium text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 w-full text-left transition-colors",onClick:e=>{e.stopPropagation(),p(!0),h(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/delete.svg",alt:"delete",width:14,height:14,className:"opacity-80",style:{filter:"invert(37%) sepia(93%) saturate(7470%) hue-rotate(354deg) brightness(91%) contrast(100%)"}})," Delete"]})]})]})]}),m&&(0,r.jsxs)("div",{className:"fixed inset-0 flex items-center justify-center z-50 p-4 transition-all duration-300",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm animate-in fade-in duration-300"}),(0,r.jsx)("div",{className:"relative premium-glass bg-white dark:bg-zinc-900 w-full max-w-md rounded-2xl p-6 shadow-2xl animate-in fade-in zoom-in slide-in-from-bottom-4 duration-300",ref:v,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-3 rounded-full bg-red-500/10 text-red-500",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"M3 6h18m-2 0v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6m3 0V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2M10 11v6M14 11v6"})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-lg font-bold text-zinc-900 dark:text-white",children:"Delete folder?"}),(0,r.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400",children:"This action cannot be undone."})]})]}),(0,r.jsxs)("p",{className:"text-sm text-zinc-600 dark:text-zinc-300 leading-relaxed",children:["You're about to delete ",(0,r.jsxs)("span",{className:"font-bold text-zinc-900 dark:text-white",children:['"',t.name,'"']})," and all its content. All projects inside this folder will be permanently removed."]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 mt-2",children:[(0,r.jsx)("button",{type:"button",className:"flex-1 py-2.5 px-4 roun
1ded-xl font-semibold text-sm text-zinc-600 dark:text-zinc-400 hover:bg-black/5 dark:hover:bg-white/5 transition-colors border border-black/5 dark:border-white/10",onClick:()=>p(!1),children:"Keep Folder"}),(0,r.jsx)("button",{type:"button",className:"flex-1 py-2.5 px-4 rounded-xl font-semibold text-sm bg-red-500 text-white hover:bg-red-600 transition-all shadow-lg shadow-red-500/20 active:scale-[0.98]",onClick:()=>i(t.id),children:"Delete Forever"})]})]})})]})]})},c=a(73107),u=a(76373);a(88062);var x=a(8792),h=a(71709),m=a(74244),p=a(53218),b=a(70784),g=e=>{let{gridView:t,item:a,renameItem:i,deleteItem:d,setMoveItem:c,setSelectedItem:x,isSelected:m,toggleSelectItem:p,selection:g,currentUserId:f,workspaceRole:v}=e,w=!a.owner_id||a.owner_id===f||["owner","admin"].includes(v),k=(0,s.useRouter)(),[y,j]=(0,l.useState)(!1),[N,z]=(0,l.useState)(null),[_,S]=(0,l.useState)(!1),[C,I]=(0,l.useState)(!1),L=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){L.current&&!L.current.contains(e.target)&&(j(!1),S(!1),I(!1))}return window.addEventListener("click",e),()=>{window.removeEventListener("click",e)}},[]);let P=e=>{let t=String(Math.floor(e/60)).padStart(2,"0"),a=String(e%60).padStart(2,"0");return"".concat(t,":").concat(a)},E=e=>{let t="music"===e.item_type?"ai-music":"object"===e.item_type?"ai-3d-object":e.item_type;if(g){p(e.id);return}if(""!==e.error_msg.trim()||2===e.is_completed){u.Am.error(e.error_msg||"Generation failed. Please try again or contact support if the problem persists.");return}if(0===e.is_completed){u.Am.info("".concat(e.item_type," is in progress. Please wait."));return}k.push("/".concat(t,"/")+e.id)};return(0,r.jsxs)("div",{className:"flex flex-col",children:[t?(0,r.jsxs)("div",{className:"premium-card premium-glass group cursor-pointer transition-all duration-300 ".concat(y?"z-50 ring-2 ring-blue-500/20":"z-auto"),onClick:()=>E(a),children:[(0,r.jsxs)("div",{className:"bg-zinc-100 dark:bg-zinc-800/30 flex justify-center relative aspect-[4/3] rounded-t-lg overflow-hidden border-b border-black/5 dark:border-white/5",children:[a.thumbnail?(0,r.jsx)("img",{src:a.thumbnail,alt:"Thumbnail",className:"h-full w-full object-contain transition-transform duration-700 group-hover:scale-110",onError:e=>{e.target.style.display="none"}}):(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-full text-zinc-400",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,r.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,r.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}),(0,r.jsx)("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-300"}),""!==a.error_msg||2===a.is_completed?(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-red-500/5 backdrop-blur-[2px] gap-1 p-2",title:a.error_msg||"Generation failed",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("div",{className:"bg-white/90 dark:bg-zinc-900/90 text-red-500 text-[10px] font-bold uppercase tracking-wider flex items-center gap-1 px-2.5 py-1 rounded-full shadow-xl",children:[(0,r.jsx)(b.wr$,{size:12}),"Failed"]}),(0,r.jsx)("div",{className:"bg-white/90 dark:bg-zinc-900/90 text-green-600 text-[9px] font-semibold px-2 py-1 rounded-full shadow-lg",children:"\uD83D\uDCB0 Refunded"})]}),a.error_msg&&(0,r.jsx)("div",{className:"bg-white/90 dark:bg-zinc-900/90 text-red-500 text-[9px] font-semibold px-2.5 py-1 rounded-lg shadow-md max-w-[95%] text-center truncate",children:a.error_msg.length>50?a.error_msg.substring(0,50)+"â¦":a.error_msg}),(0,r.jsx)("div",{className:"bg-white/90 dark:bg-zinc-900/90 text-zinc-500 dark:text-zinc-400 text-[8px] font-semibold px-2 py-0.5 rounded-full shadow-sm",children:"Click for details"})]}):0===a.is_completed&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-yellow-500/5 backdrop-blur-[2px]",children:(0,r.jsxs)("div",{className:"bg-white/90 dark:bg-zinc-900/90 text-yellow-600 dark:text-yellow-500 text-[10px] font-bold uppercase tracking-wider flex items-center gap-1.5 px-3 py-1.5 rounded-full shadow-xl animate-pulse",children:[(0,r.jsx)(h.IGZ,{size:14}),"In Queue"]})}),g&&(0,r.jsx)("div",{className:"absolute top-3 left-3 z-20",children:(0,r.jsx)("input",{type:"checkbox",checked:m,onClick:e=>e.stopPropagation(),onChange:()=>p(a.id),className:"h-6 w-6 rounded-full border-2 border-white bg-white/20 backdrop-blur-md appearance-none checked:bg-blue-500 checked:border-blue-500 transition-all cursor-pointer relative after:content-[''] after:absolute after:inset-0 after:flex after:items-center after:justify-center after:text-white after:text-xs checked:after:content-['â']"})}),(0,r.jsxs)("div",{className:"absolute bottom-3 right-3 flex items-center gap-2",children:["video"===a.item_type&&(0,r.jsx)("div",{className:"px-2 py-1 rounded-lg bg-black/60 backdrop-blur-md text-white text-[10px] font-bold",children:P(Math.floor(a.duration))}),1==a.is_published&&(0,r.jsx)("div",{className:"px-2 py-1 rounded-lg bg-green-500 text-white text-[10px] font-bold shadow-lg shadow-green-500/20",children:"Published"})]})]}),(0,r.jsxs)("div",{className:"p-4 flex flex-col gap-1",onClick:e=>e.stopPropagation(),children:[a.owner_name&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-0.5",children:[(0,r.jsx)("img",{src:a.owner_profile||"/user_profile.png",alt:a.owner_name,className:"w-4 h-4 rounded-full object-cover flex-shrink-0 ring-1 ring-black/10 dark:ring-white/10",onError:e=>{e.target.src="/user_profile.png"}}),(0,r.jsx)("span",{className:"text-[10px] font-semibold text-indigo-600 dark:text-indigo-400 truncate",children:a.owner_name})]}),(0,r.jsxs)("div",{className:"flex justify-between items-start gap-2",children:[(0,r.jsx)("div",{className:"flex-grow min-w-0",children:!1===_?(0,r.jsx)("h6",{className:"truncate font-semibold text-zinc-900 dark:text-zinc-100 text-sm group-hover:text-blue-500 transition-colors duration-300",children:a.name}):(0,r.jsx)("input",{autoFocus:!0,value:N,onChange:e=>z(e.target.value),onClick:e=>e.stopPropagation(),onKeyDown:e=>"Enter"==e.key&&i(a.id,N,S,a.item_type),className:"w-full bg-transparent border-b border-blue-500/50 outline-none text-sm font-semibold dark:text-white"})}),w&&(0,r.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,r.jsx)("button",{className:"p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/5 transition-all active:scale-95 text-zinc-400 hover:text-blue-500",onClick:e=>{e.stopPropagation(),j(!y)},children:(0,r.jsx)(o.default,{loader:n.default,alt:"options",src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/options.svg",height:12,width:12,className:"dark:invert opacity-60 group-hover:opacity-100 transition-opacity"})}),y&&(0,r.jsxs)("div",{ref:L,className:"absolute z-[100] w-36 top-10 right-0 bg-white dark:bg-zinc-900 border border-black/10 dark:border-white/10 rounded-2xl shadow-2xl py-2 animate-in fade-in zoom-in duration-200 backdrop-blur-3xl",children:[(0,r.jsxs)("button",{className:"flex items-center gap-3 px-4 py-2.5 text-xs font-bold text-zinc-600 dark:text-zinc-300 hover:bg-blue-50 dark:hover:bg-blue-900/20 hover:text-blue-600 dar
1k:hover:text-blue-400 w-full text-left transition-all",onClick:e=>{e.stopPropagation(),z(a.name),S(!0),j(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/pencil.svg",alt:"rename",width:16,height:16,className:"dark:invert opacity-60"})," Rename"]}),(0,r.jsxs)("button",{className:"flex items-center gap-3 px-4 py-2.5 text-xs font-bold text-zinc-600 dark:text-zinc-300 hover:bg-blue-50 dark:hover:bg-blue-900/20 hover:text-blue-600 dark:hover:text-blue-400 w-full text-left transition-all",onClick:e=>{e.stopPropagation(),c(!0),x(a.id),j(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/move-to-folder.svg",alt:"move",width:16,height:16,className:"dark:invert opacity-60"})," Move"]}),(0,r.jsx)("div",{className:"mx-2 my-1 border-t border-black/5 dark:border-white/5"}),(0,r.jsxs)("button",{className:"flex items-center gap-3 px-4 py-2.5 text-xs font-bold text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 w-full text-left transition-all",onClick:e=>{e.stopPropagation(),I(!0),j(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/delete.svg",alt:"delete",width:16,height:16,style:{filter:"invert(37%) sepia(93%) saturate(7470%) hue-rotate(354deg) brightness(91%) contrast(100%)"}})," Delete"]})]})]})]}),(0,r.jsx)("p",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wider",children:new Date(a.createdAt).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})})]})]}):(0,r.jsxs)("div",{className:"relative premium-glass group cursor-pointer p-3 flex items-center gap-4 roun
1ded-2xl border border-black/5 dark:border-white/10 hover:shadow-xl hover:bg-white/90 dark:hover:bg-zinc-800/90 transition-all duration-300 w-full ".concat(y?"z-50 border-blue-500/30":"z-auto"),onClick:()=>E(a),children:[(0,r.jsxs)("div",{className:"relative h-24 w-32 flex-shrink-0 bg-zinc-100 dark:bg-zinc-800/50 rounded-xl overflow-hidden border border-black/5 dark:border-white/5",children:[a.thumbnail?(0,r.jsx)("img",{src:a.thumbnail,alt:"Thumbnail",className:"object-contain w-full h-full transition-transform duration-500 group-hover:scale-110",onError:e=>{e.target.style.display="none"}}):(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-full text-zinc-400",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,r.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,r.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}),(0,r.jsx)("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-300"}),""!==a.error_msg||2===a.is_completed?(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-red-500/10 backdrop-blur-[1px] gap-1",title:a.error_msg||"Generation failed",children:[(0,r.jsx)("div",{className:"bg-white/90 dark:bg-zinc-900/90 text-red-500 p-1.5 rounded-full shadow-lg",children:(0,r.jsx)(b.wr$,{size:14})}),(0,r.jsx)("div",{className:"bg-white/90 dark:bg-zinc-900/90 text-green-600 text-[8px] font-semibold px-1.5 py-0.5 rounded-full shadow-sm",children:"Refunded"}),(0,r.jsx)("p",{className:"text-[7px] text-zinc-400 dark:text-zinc-500 font-medium",children:"Click for details"})]}):0===a.is_completed&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-yellow-500/10 backdrop-blur-[1px]",children:(0,r.jsx)("div",{className:"bg-white/90 dark:bg-zinc-900/90 text-yellow-600 dark:text-yellow-500 p-1.5 rounded-full shadow-lg animate-pulse",children:(0,r.jsx)(h.IGZ,{size:14})})}),g&&(0,r.jsx)("div",{className:"absolute top-1.5 left-1.5",children:(0,r.jsx)("input",{type:"checkbox",checked:m,onClick:e=>e.stopPropagation(),onChange:()=>p(a.id),className:"h-5 w-5 rounded-full border-2 border-white bg-white/20 backdrop-blur-md appearance-none checked:bg-blue-500 checked:border-blue-500 transition-all cursor-pointer relative checked:after:content-['â'] after:absolute after:inset-0 after:flex after:items-center after:justify-center after:text-white after:text-[10px]"})})]}),(0,r.jsxs)("div",{className:"flex-grow min-w-0",children:[a.owner_name&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-0.5",children:[(0,r.jsx)("img",{src:a.owner_profile||"/user_profile.png",alt:a.owner_name,className:"w-4 h-4 rounded-full object-cover flex-shrink-0 ring-1 ring-black/10 dark:ring-white/10",onError:e=>{e.target.src="/user_profile.png"}}),(0,r.jsx)("span",{className:"text-[10px] font-semibold text-indigo-600 dark:text-indigo-400 truncate",children:a.owner_name})]}),!1===_?(0,r.jsx)("h6",{className:"truncate font-semibold text-zinc-900 dark:text-zinc-100 group-hover:text-blue-500 transition-colors duration-300",children:a.name}):(0,r.jsx)("input",{autoFocus:!0,value:N,onChange:e=>z(e.target.value),onClick:e=>e.stopPropagation(),onKeyDown:e=>"Enter"==e.key&&i(a.id,N,S,a.item_type),className:"w-full bg-transparent border-b border-blue-500/50 outline-none text-sm font-semibold dark:text-white"}),(0,r.jsx)("p",{className:"text-[10px] font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wider mt-1",children:new Date(a.createdAt).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:["video"===a.item_type&&(0,r.jsx)("span",{className:"text-[10px] font-bold text-zinc-400 bg-zinc-100 dark:bg-zinc-800 px-2 py-1 rounded-lg",children:P(Math.floor(a.duration))}),w&&(0,r.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,r.jsx)("button",{className:"p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/5 transition-all active:scale-95 text-zinc-400 hover:text-blue-500",onClick:e=>{e.stopPropagation(),j(!y)},children:(0,r.jsx)(o.default,{loader:n.default,alt:"options",src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/options.svg",height:12,width:12,className:"dark:invert opacity-60 hover:opacity-100 transition-opacity"})}),y&&(0,r.jsxs)("div",{ref:L,className:"absolute z-[100] w-36 top-10 right-0 bg-white dark:bg-zinc-900 border border-black/10 dark:border-white/10 rounded-2xl shadow-2xl py-2 animate-in fade-in zoom-in duration-200 backdrop-blur-3xl",children:[(0,r.jsxs)("button",{className:"flex items-center gap-3 px-4 py-2.5 text-xs font-bold text-zinc-600 dark:text-zinc-300 hover:bg-blue-50 dark:hover:bg-blue-900/20 hover:text-blue-600 dar
1k:hover:text-blue-400 w-full text-left transition-all",onClick:e=>{e.stopPropagation(),z(a.name),S(!0),j(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/pencil.svg",alt:"rename",width:16,height:16,className:"dark:invert opacity-60"})," Rename"]}),(0,r.jsxs)("button",{className:"flex items-center gap-3 px-4 py-2.5 text-xs font-bold text-zinc-600 dark:text-zinc-300 hover:bg-blue-50 dark:hover:bg-blue-900/20 hover:text-blue-600 dark:hover:text-blue-400 w-full text-left transition-all",onClick:e=>{e.stopPropagation(),c(!0),x(a.id),j(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/move-to-folder.svg",alt:"move",width:16,height:16,className:"dark:invert opacity-60"})," Move"]}),(0,r.jsx)("div",{className:"mx-2 my-1 border-t border-black/5 dark:border-white/5"}),(0,r.jsxs)("button",{className:"flex items-center gap-3 px-4 py-2.5 text-xs font-bold text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 w-full text-left transition-all",onClick:e=>{e.stopPropagation(),I(!0),j(!1)},children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/delete.svg",alt:"delete",width:16,height:16,style:{filter:"invert(37%)_sepia(93%)_saturate(7470%)_hue-rotate(354deg)_brightness(91%)_contrast(100%)"}})," Delete"]})]})]})]})]}),C&&(0,r.jsxs)("div",{className:"fixed inset-0 flex items-center justify-center z-50 p-4 transition-all duration-300",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm animate-in fade-in duration-300"}),(0,r.jsx)("div",{className:"relative premium-glass bg-white dark:bg-zinc-900 w-full max-w-md rounded-2xl p-6 shadow-2xl animate-in fade-in zoom-in slide-in-from-bottom-4 duration-300",ref:L,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-3 rounded-full bg-red-500/10 text-red-500",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"M3 6h18m-2 0v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6m3 0V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2M10 11v6M14 11v6"})})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"text-lg font-bold text-zinc-900 dark:text-white",children:["Delete ",a.item_type,"?"]}),(0,r.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400",children:"This action cannot be undone."})]})]}),(0,r.jsxs)("p",{className:"text-sm text-zinc-600 dark:text-zinc-300 leading-relaxed",children:["You're about to delete ",(0,r.jsxs)("span",{className:"font-bold text-zinc-900 dark:text-white",children:['"',a.name,'"']}),". This file will be permanently removed from your storage."]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 mt-2",children:[(0,r.jsx)("button",{type:"button",className:"flex-1 py-2.5 px-4 rounded-xl font-semibold text-sm text-zinc-600 dark:text-zinc-400 hover:bg-black/5 dark:hover:bg-white/5 transition-colors border border-black/5 dark:border-white/10",onClick:()=>I(!1),children:"Keep File"}),(0,r.jsx)("button",{type:"button",className:"flex-1 py-2.5 px-4 rounded-xl font-semibold text-sm bg-red-500 text-white hover:bg-red-600 transition-all shadow-lg shadow-red-500/20 active:scale-[0.98]",onClick:()=>d(a.id,I,a.item_type),children:"Delete Forever"})]})]})})]})]})},f=a(51448),v=e=>{var t,a,b,v;let{fid:w}=e,k=(0,s.useSearchParams)(),[y,j]=(0,l.useState)([]),[N,z]=(0,l.useState)(!1),[_,S]=(0,l.useState)(!1),[C,I]=(0,l.useState)("Newest"),[L,P]=(0,l.useState)([]),[E,A]=(0,l.useState)([]),[M,q]=(0,l.useState)([]),[D,T]=(0,l.useState)([]),[U,F]=(0,l.useState)(""),[R,Z]=(0,l.useState)(!0),[V,W]=(0,l.useState)(k.get("videos_page")||1),[B,O]=(0,l.useState)(k.get("images_page")||1),[G,K]=(0,l.useState)(k.get("musics_page")||1),[H,$]=(0,l.useState)(k.get("objects_page")||1),[J,Y]=(0,l.useState)(0),[Q,X]=(0,l.useState)(0),[ee,et]=(0,l.useState)(0),[ea,er]=(0,l.useState)(0),[es,el]=(0,l.useState)("videos"),[ei,eo]=(0,l.useState)(!1),[en,ed]=(0,l.useState)(!1),[ec,eu]=(0,l.useState)(null),[ex,eh]=(0,l.useState)(!1),[em,ep]=(0,l.useState)(null),[eb,eg]=(0,l.useState)(!0),[ef,ev]=(0,l.useState)([]),[ew,ek]=(0,l.useState)(!1),[ey,ej]=(0,l.useState)(!1),{isLoggedin:eN,serverDetails:ez,isProAdvancedUser:e_,isUltimateUser:eS,isAdvancedUser:eC}=(0,f.useUser)(),eI=(null==ez?void 0:null===(t=ez.user_subscription_details)||void 0===t?void 0:t.allow_generation)||!1,eL=(null==ez?void 0:null===(a=ez.user_subscription_details)||void 0===a?void 0:a.limits)||{},eP=(null==ez?void 0:null===(b=ez.user_subscription_details)||void 0===b?void 0:b.remaining_credits)||0,eE=(null==ez?void 0:ez.user_id)||null,eA=(null==ez?void 0:null===(v=ez.workspace)||void 0===v?void 0:v.role)||null,eM=(0,l.useRef)(null),eq=(0,s.useRouter)(),eD=async()=>{let e="videos"===es?V:"images"===es?B:"musics"===es?G:H,t=0===w?"null":w;localStorage.setItem("folderId",w);let a="user_content_cache_".concat(t,"_").concat(es,"_").concat(e);{let e=sessionStorage.getItem(a);if(e)try{let t=JSON.parse(e);Y(t.total_video_pages||0),X(t.total_image_pages||0),et(t.total_music_pages||0),er(t.total_object_pages||0),P(t.videos||[]),A(t.images||[]),q(t.musics||[]),T(t.objects||[]),t.folders&&j(t.folders)}catch(e){console.error("Cache parse error",e)}else eo(!0)}try{let r=k.get("series_id"),s=await c.Z.get("/api/get_user_generated_items?folder_id=".concat(t,"&page=").concat(e,"&item_type=").concat(es,"&include_folders=").concat(!r).concat(r?"&schedule_id=".concat(r):""));Y(s.data.total_video_pages),X(s.data.total_image_pages),et(s.data.total_music_pages),er(s.data.total_object_pages),P(s.data.videos),A(s.data.images),q(s.data.musics),T(s.data.objects),s.data.folders&&j(s.data.folders),sessionStorage.setItem(a,JSON.stringify(s.data)),eo(!1)}catch(e){console.error("Error fetching media:",e),eo(!1)}};(0,l.useEffect)(()=>{eN&&eD()},[es,V,B,G,H]),(0,l.useEffect)(()=>
1{if(!eN)return;{var e;window.twq&&(null==ez?void 0:null===(e=ez.user_details)||void 0===e?void 0:e.email)&&window.twq("event","tw-pdp7o-pdp7p",{email_address:ez.user_details.email});let t=new URLSearchParams(window.location.search),a=t.get("stripe_success"),r=t.get("stripe_credits_success"),s=t.get("stripe_upgrade_success");null!==a&&eH(),null!==r&&e$(),null!==s&&eJ()}let t=localStorage.getItem("gridView");null!==t&&Z("true"===t);let a=e=>{eM.current&&!eM.current.contains(e.target)&&S(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),(0,l.useEffect)(()=>{k&&(el(k.get("tab")||"videos"),k.get("videos_page")&&W(parseInt(k.get("videos_page"))||1),k.get("images_page")&&O(parseInt(k.get("images_page"))||1),k.get("musics_page")&&K(parseInt(k.get("musics_page"))||1),k.get("objects_page")&&$(parseInt(k.get("objects_page"))||1))},[k]);let eT=e=>{let t=new URL(window.location);t.searchParams.set("tab",e),ev([]),"videos"===e?(t.searchParams.set("videos_page",V),t.searchParams.delete("images_page"),t.searchParams.delete("musics_page"),t.searchParams.delete("objects_page")):"images"===e?(t.searchParams.set("images_page",B),t.searchParams.delete("videos_page"),t.searchParams.delete("musics_page"),t.searchParams.delete("objects_page")):"musics"===e?(t.searchParams.set("musics_page",G),t.searchParams.delete("videos_page"),t.searchParams.delete("images_page"),t.searchParams.delete("objects_page")):(t.searchParams.set("objects_page",G),t.searchParams.delete("videos_page"),t.searchParams.delete("images_page"),t.searchParams.delete("musics_page")),eq.push(t.toString())},eU=()=>"videos"===es?L.filter(e=>e.name&&e.name.toLowerCase().includes(U.toLowerCase())):"images"===es?E.filter(e=>e.name&&e.name.toLowerCase().includes(U.toLowerCase())):"musics"===es?M.filter(e=>e.name&&e.name.toLowerCase().includes(U.toLowerCase())):D.filter(e=>e.name&&e.name.toLowerCase().includes(U.toLowerCase())),eF=(e,t)=>{if(y.some(a=>a.name.trim()===t.trim()&&a.id!==e)){u.Am.error("Folder name already exists. Please choose a different name.");return}j(y.map(a=>a.id===e?{...a,name:t}:a)),c.Z.post("/api/create_folder",{folder:{id:e,name:t}}).then(e=>{}).catch(e=>{u.Am.error("Failed to change Folder name")})},eR=e=>{c.Z.post("/api/delete_folder",{id:e}).then(t=>{j(y.filter(t=>t.id!==e)),u.Am.success(t.data.message)}).catch(e=>{u.Am.error("Failed to delete Folder")})},eZ=()=>{if(ed(!1),ep(null),!ec){u.Am.error("Error selecting item");return}c.Z.post("/api/move_item_to_folder",{item_id:ec,folder_id:em,type:es}).then(e=>{"Item moved successfully"===e.data.message&&("videos"===es?P(L.filter(e=>e.id!==ec)):"images"===es?A(E.filter(e=>e.id!==ec)):"musics"===es?q(M.filter(e=>e.id!==ec)):T(D.filter(e=>e.id!==ec)))}).catch(e=>{u.Am.error(e.message)})},eV=(e,t)=>{let a=new URL(window.location);a.searchParams.set("tab",t),a.searchParams.set("".concat(t,"_page"),e),eq.push(a.toString())},eW=(e,t)=>e.slice().sort((e,a)=>{switch(t){case"Newest":return new Date(a.createdAt)-new Date(e.createdAt);case"Oldest":return new Date(e.createdAt)-new Date(a.createdAt);case"A-Z":return e.name.localeCompare(a.name);case"Z-A":return a.name.localeCompare(e.name);default:return 0}}),eB=e=>{I(e),P(eW(L,e)),S(!_)},eO=(e,t,a)=>{c.Z.post("/api/delete_item",{id:e,type:a}).then(r=>{"video"===a?P(L.filter(t=>t.id!==e)):"image"===a?A(E.filter(t=>t.id!==e)):"music"===a?q(M.filter(t=>t.id!==e)):"object"===a&&T(D.filter(t=>t.id!==e)),t(!1)}).catch(e=>{console.error(e)})},eG=()=>{if(0===ef.length){u.Am.error("Please select items to move");return}c.Z.post("/api/move_bulk_items",{ids:ef,type:es,folder_id:em}).then(e=>{"videos"===es?P(e=>e.filter(e=>!ef.includes(e.id))):"images"===es?A(e=>e.filter(e=>!ef.includes(e.id))):"musics"===es?q(e=>e.filter(e=>!ef.includes(e.id))):"objects"===es&&T(e=>e.filter(e=>!ef.includes(e.id))),ev([]),ek(!1),ed(!1),ej(!1),u.Am.success("Moved seleted items successfully")}).catch(e=>{ed(!1),ej(!1),u.Am.error("Error Move Selected Items")})},eK=(e,t,a,r)=>{c.Z.post("/api/rename_video",{id:e,name:t,type:r}).then(s=>{"video"===r?P(L.map(a=>(a.id==e&&(a.name=t),a))):"image"===r?A(E.map(a=>(a.id==e&&(a.name=t),a))):"music"===r?q(M.map(a=>(a.id==e&&(a.name=t),a))):"object"===r&&T(D.map(a=>(a.id==e&&(a.name=t),a))),a(!1)}).catch(e=>{console.error(e)})},eH=()=>{c.Z.get("/api/verify_payment").then(e=>{"free"!=e.data.tier&&(z(!1),e.data.order_id&&e.data.subtotal&&(setOrderId(e.data.order_id),setSubtotal(e.data.subtotal),window.fbq&&window.fbq("track","Purchase",{value:e.data.subtotal,currency:"USD"},{eventID:e.data.event_id})))}).catch(e=>{})},e$=()=>{c.Z.get("/api/verify_credits_payment").then(e=>{}).catch(e=>{})},eJ=()=>{c.Z.get("/api/verify_appsumo_upgrade_payment").then(e=>{}).catch(e=>{})},eY=e=>{ev(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,r.jsxs)("div",{className:"flex flex-col w-full h-full gap-4 items-center relative",children:[ex?(0,r.jsxs)("div",{className:"w-full h-full flex flex-col gap-5 relative",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 p-4",children:[(0,r.jsx)("h3",{className:"text-2xl font-semibold dark:text-primary-text",children:"Upload a new video"}),(0,r.jsxs)(x.default,{href:"https://docs.vadoo.tv/docs/guide/create-ai-captions",className:"flex items-center gap-1 whitespace-nowrap font-bold text-gray-600 dark:text-secondary-text hover:text-blue-600 hover:dark:text-blue-400 hover:underline text-xs hover:text-blue-800",target:"_blank",children:["API Docs ",(0,r.jsx)(h.$OI,{})]})]}),(0,r.jsx)("button",{className:"absolute top-0 right-3 text-lg font-semibold dark:text-secondary-text",onClick:()=>eh(!1),children:"â"}),(0,r.jsx)(m.default,{limits:eL,fid:w,userCredits:eP,allowGeneration:eI})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-2 w-full h-full",children:[(0,r.jsxs)("div",{className:"flex flex-col w-full gap-2 md:gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,r.jsx)("div",{className:"flex items-center gap-6",children:0===w?(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-zinc-900 dark:text-white",children:"Projects"}),(0,r.jsxs)("button",{type:"button",className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-semibold text-zinc-700 dark:text-zinc-200 bg-zinc-100 dark:bg-zinc-800/50 hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-all rounded-xl border border-black/5 dark:border-white/5 active:scale-95 shadow-sm",onClick:()=>{let e=new Date().toDateString(),t="New Folder",a=t,r=1;for(;y.some(e=>
1e.name===a);)r++,a="".concat(t," ").concat(r);let s={id:Math.floor(9e11*Math.random())+1e11,name:a,date:e};c.Z.post("/api/create_folder",{folder:s}).then(e=>{j([s,...y])}).catch(e=>{u.Am.error("Failed to create Folder")})},children:[(0,r.jsx)(i.IEK,{className:"text-blue-500"}),(0,r.jsx)("span",{children:"New Folder"})]})]}):(0,r.jsxs)("div",{className:"flex items-center gap-4 group cursor-pointer",onClick:()=>eq.push("/my-content"),children:[(0,r.jsx)("div",{className:"p-2 rounded-xl bg-zinc-100 dark:bg-zinc-800 group-hover:bg-blue-500/10 group-hover:text-blue-500 transition-all",children:(0,r.jsx)(o.default,{src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/back.svg",alt:"back",width:16,height:16,className:"dark:invert group-hover:invert-0",loader:n.default})}),(0,r.jsx)("h1",{className:"text-2xl font-bold capitalize tracking-tight dark:text-white",children:(()=>{let e=y.find(e=>e.id===parseInt(w));return e?e.name:""})()})]})}),!(e_||eS||eC)&&(0,r.jsxs)("button",{type:"button",className:"relative group px-6 py-2.5 rounded-xl bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 text-sm font-bold transition-all hover:scale-[1.02] hover:shadow-xl hover:shadow-blue-500/20 active:scale-[0.98] overflow-hidden",onClick:()=>z(!0),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-600 to-indigo-600 opacity-0 group-hover:opacity-10 transition-opacity"}),"Upgrade to Pro"]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 flex-grow",children:[(0,r.jsxs)("div",{className:"relative group flex-grow max-w-md",children:[(0,r.jsx)("div",{className:"absolute inset-y-0 left-4 flex items-center pointer-events-none text-zinc-400",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,r.jsx)("path",{d:"m21 21-4.3-4.3"})]})}),(0,r.jsx)("input",{type:"search",placeholder:"Search your creations...",value:U,onChange:e=>F(e.target.value),className:"w-full pl-12 pr-4 py-2.5 bg-zinc-100 dark:bg-zinc-800/50 border-transparent focus:bg-white dark:focus:bg-zinc-800 border-2 focus:border-blue-500/20 rounded-2xl text-sm transition-all outline-none"})]}),(0,r.jsxs)("div",{className:"relative",ref:eM,children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-2.5 px-4 py-2.5 text-sm font-semibold text-zinc-700 dark:text-zinc-200 bg-white dark:bg-zinc-800/50 border border-black/5 dark:border-white/10 rounded-2xl hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-all shadow-sm",onClick:()=>S(!_),children:[(0,r.jsx)("span",{className:"text-zinc-400 font-medium hidden md:inline",children:"Sort by:"})," ",C,(0,r.jsx)(i.iUH,{className:"transition-transform duration-300 ".concat(_?"rotate-180":"")})]}),_&&(0,r.jsx)("div",{className:"absolute top-full mt-2 left-0 z-30 w-40 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-xl border border-black/5 dark:border-white/10 rounded-2xl shadow-2xl py-2 overflow-hidden animate-in fade-in zoom-in duration-200",children:["Newest","Oldest","A-Z","Z-A"].map(e=>(0,r.jsx)("button",{className:"w-full px-4 py-2 text-left text-sm font-medium transition-colors ".concat(C===e?"text-blue-500 bg-blue-500/5":"text-zinc-600 dark:text-zinc-300 hover:bg-black/5 dark:hover:bg-white/5"),onClick:()=>eB(e),children:e},e))})]}),(0,r.jsx)("button",{onClick:()=>{Z(!R),localStorage.setItem("gridView",!R)},className:"p-2.5 rounded-2xl bg-white dark:bg-zinc-800/50 border border-black/5 dark:border-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-all text-zinc-500 hover:text-blue-500",children:(0,r.jsx)(o.default,{loader:n.default,src:R?"https://d3adwkbyhxyrtq.cloudfront.net/static/public/list-view.svg":"https://d3adwkbyhxyrtq.cloudfront.net/static/public/grid-view.svg",width:20,height:20,alt:"view",className:"dark:invert"})})]}),(0,r.jsx)("div",{className:"flex items-center gap-3",children:ew?(0,r.jsxs)("div",{className:"flex items-center gap-3 bg-blue-500/10 dark:bg-blue-500/5 px-3 py-1.5 rounded-2xl border border-blue-500/20 animate-in slide-in-from-right-4",children:[(0,r.jsxs)("span",{className:"text-sm font-bold text-blue-600 dar
1k:text-blue-400 px-1",children:[ef.length," Selected"]}),(0,r.jsx)("button",{type:"button",disabled:0===ef.length,onClick:()=>{ed(!0),ej(!0)},className:"px-4 py-2 bg-blue-500 text-white rounded-xl text-sm font-bold shadow-lg shadow-blue-500/20 hover:scale-105 active:scale-95 disabled:opacity-50 transition-all",children:"Move"}),(0,r.jsx)("button",{type:"button",disabled:0===ef.length,onClick:()=>{if(0===ef.length){u.Am.error("Please select items to delete");return}c.Z.post("/api/delete_bulk_items",{ids:ef,type:es}).then(e=>{"videos"===es?P(e=>e.filter(e=>!ef.includes(e.id))):"images"===es?A(e=>e.filter(e=>!ef.includes(e.id))):"musics"===es?q(e=>e.filter(e=>!ef.includes(e.id))):"objects"===es&&T(e=>e.filter(e=>!ef.includes(e.id))),ev([]),ek(!1),u.Am.success("Deleted seleted items successfully")}).catch(e=>{u.Am.error("Error Delete Selected Items")})},className:"px-4 py-2 bg-red-500 text-white rounded-xl text-sm font-bold shadow-lg shadow-red-500/20 hover:scale-105 active:scale-95 disabled:opacity-50 transition-all",children:"Delete"}),(0,r.jsx)("button",{type:"button",onClick:()=>ek(!1),className:"p-2 rounded-xl hover:bg-red-500/10 text-red-500 transition-colors",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}):(0,r.jsx)("button",{type:"button",onClick:()=>ek(!0),className:"px-4 py-2.5 bg-zinc-100 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-200 rounded-2xl text-sm font-bold hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-all active:scale-95 border border-black/5 dark:border-white/5",children:"Select Items"})})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 sm:flex items-center gap-2 bg-zinc-100/80 dark:bg-zinc-900/40 backdrop-blur-md p-1 rounded-2xl w-full sm:w-fit border border-black/5 dark:border-white/5",children:["videos","images","musics","objects"].map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>eT(e),className:"flex items-center justify-center gap-2 px-4 sm:px-6 py-2 text-sm font-bold transition-all duration-300 rounded-xl relative group flex-shrink-0 ".concat(es===e?"text-blue-600 dark:text-blue-400 bg-white dark:bg-zinc-800 shadow-md shadow-blue-500/5":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-black/5 dark:hover:bg-white/5"),children:[(0,r.jsx)("div",{className:"transition-transform duration-300 group-hover:scale-110 ".concat(es===e?"scale-110":""),children:"musics"===e?(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M9 18V5l12-2v13"}),(0,r.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,r.jsx)("circle",{cx:"18",cy:"16",r:"3"})]}):"objects"===e?(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"m21 8-9-4-9 4 9 4 9-4z"}),(0,r.jsx)("path",{d:"m21 12-9 4-9-4"}),(0,r.jsx)("path",{d:"m21 16-9 4-9-4"})]}):"videos"===e?(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"m9 8 6 4-6 4Z"})]}):(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,r.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,r.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}),(0,r.jsx)("span",{children:"musics"===e?"Music":"objects"===e?"3D":e.charAt(0).toUpperCase()+e.slice(1)}),es===e&&(0,r.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-blue-500 shadow-[0_0_8px_rgba(59,130,246,1
1)]"})]},e))}),(0,r.jsx)("div",{className:"flex-grow w-full h-full p-1",children:ei?(0,r.jsx)("div",{className:"flex justify-center items-center h-full",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-4 border-t-transparent border-blue-500"})}):0===w?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"".concat(R?"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4 my-2":"flex flex-col gap-3 my-2"),children:[y.length>0&&y.map(e=>(0,r.jsx)(d,{folder:e,setFolderName:t=>eF(e.id,t),handleDeleteFolder:eR,gridView:R},e.id)),"videos"===es?(0,r.jsxs)(r.Fragment,{children:[eU().length>0&&eU().map((e,t)=>(0,r.jsx)(g,{gridView:R,item:e,renameItem:eK,deleteItem:eO,setMoveItem:ed,setSelectedItem:eu,isSelected:ef.includes(e.id),toggleSelectItem:eY,selection:ew,currentUserId:eE,workspaceRole:eA},t)),L.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 pb-2 col-span-full",children:[(0,r.jsx)("button",{type:"button",className:"".concat(1===V&&"opacity-70"),disabled:1===V,onClick:()=>eV(V-1,"videos"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/left.svg",width:25,height:25,alt:"left",className:"dark:invert"})}),(0,r.jsxs)("span",{className:"text-sm font-medium dark:text-secondary-text",children:["Page ",V," of ",J]}),(0,r.jsx)("button",{type:"button",className:"".concat(V===J&&"opacity-70"),disabled:V===J,onClick:()=>eV(V+1,"videos"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/right.svg",width:25,height:25,alt:"right",className:"dark:invert"})})]})]}):"images"===es?(0,r.jsxs)(r.Fragment,{children:[eU().length>0&&eU().map((e,t)=>(0,r.jsx)(g,{gridView:R,item:e,renameItem:eK,deleteItem:eO,setMoveItem:ed,setSelectedItem:eu,isSelected:ef.includes(e.id),toggleSelectItem:eY,selection:ew,currentUserId:eE,workspaceRole:eA},t)),E.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 pb-2 col-span-full",children:[(0,r.jsx)("button",{type:"button",className:"".concat(1===B&&"opacity-70"),disabled:1===B,onClick:()=>eV(B-1,"images"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/left.svg",width:25,height:25,alt:"left",className:"dark:invert"})}),(0,r.jsxs)("span",{className:"text-sm font-medium dark:text-secondary-text",children:["Page ",B," of ",Q]}),(0,r.jsx)("button",{type:"button",className:"".concat(B===Q&&"opacity-70"),disabled:B===Q,onClick:()=>eV(B+1,"images"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/right.svg",width:25,height:25,alt:"right",className:"dark:invert"})})]})]}):"musics"===es?(0,r.jsxs)(r.Fragment,{children:[eU().length>0&&eU().map((e,t)=>(0,r.jsx)(g,{gridView:R,item:e,renameItem:eK,deleteItem:eO,setMoveItem:ed,setSelectedItem:eu,isSelected:ef.includes(e.id),toggleSelectItem:eY,selection:ew,currentUserId:eE,workspaceRole:eA},t)),M.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 pb-2 col-span-full",children:[(0,r.jsx)("button",{type:"button",className:"".concat(1===G&&"opacity-70"),disabled:1===G,onClick:()=>eV(G-1,"musics"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/left.svg",width:25,height:25,alt:"left",className:"dark:invert"})}),(0,r.jsxs)("span",{className:"text-sm font-medium dark:text-secondary-text",children:["Page ",B," of ",ee]}),(0,r.jsx)("button",{type:"button",className:"".concat(G===ee&&"opacity-70"),disabled:G===ee,onClick:()=>eV(G+1,"musics"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/right.svg",width:25,height:25,alt:"right",className:"dark:invert"})})]})]}):(0,r.jsxs)(r.Fragment,{children:[eU().length>0&&eU().map((e,t)=>(0,r.jsx)(g,{gridView:R,item:e,renameItem:eK,deleteItem:eO,setMoveItem:ed,setSelectedItem:eu,isSelected:ef.includes(e.id),toggleSelectItem:eY,selection:ew,currentUserId:eE,workspaceRole:eA},t)),D.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 pb-2 col-span-full",children:[(0,r.jsx)("button",{type:"button",className:"".concat(1===H&&"opacity-70"),disabled:1===H,onClick:()=>eV(H-1,"objects"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/left.svg",width:25,height:25,alt:"left",className:"dark:invert"})}),(0,r.jsxs)("span",{className:"text-sm font-medium dark:text-secondary-text",children:["Page ",H," of ",ea]}),(0,r.jsx)("button",{type:"button",className:"".concat(H===ea&&"opacity-70"),disabled:H===ea,onClick:()=>eV(H+1,"objects"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/right.svg",width:25,height:25,alt:"right",className:"dark:invert"})})]})]})]}),0===y.length&&0===eU().length&&0===E.length&&(0,r.jsx)("div",{className:"flex justify-center my-10",children:(0,r.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/S0HDNnjAego?si=VVk1fefgZWeWIAzV",title:"Vadoo AI Tutorial",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0})})]}):"videos"===es?eU().length>0?(0,r.jsxs)("div",{className:"".concat(R?"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-4 xl:grid-cols-6 gap-4 my-2":"flex flex-col"),children:[eU().map((e,t)=>(0,r.jsx)(g,{gridView:R,item:e,renameItem:eK,deleteItem:eO,setMoveItem:ed,setSelectedItem:eu,isSelected:ef.includes(e.id),toggleSelectItem:eY,selection:ew,currentUserId:eE,workspaceRole:eA},t)),L.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 pb-2 col-span-full",children:[(0,r.jsx)("button",{type:"button",className:"".concat(1===V&&"opacity-70"),disabled:1===V,onClick:()=>eV(V-1,"videos"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/left.svg",width:25,height:25,alt:"left",className:"dark:invert"})}),(0,r.jsxs)("span",{className:"text-sm font-medium dark:text-secondary-text",children:["Page ",V," of ",J]}),(0,r.jsx)("button",{type:"button",className:"".concat(V===J&&"opacity-70"),disabled:V===J,onClick:()=>eV(V+1,"videos"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/right.svg",width:25,height:25,alt:"right",className:"dark:invert"})})]})]}):(0,r.jsx)("p",{className:"text-center my-10 italic text-gray-500 text-xs md:text-base font-medium",children:"There are no videos matching your search"}):"images"===es?eU().length>0?(0,r.jsxs)("div",{className:"".concat(R?"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-4 xl:grid-cols-6 gap-4 my-2":"flex flex-col"),children:[eU().map((e,t)=>(0,r.jsx)(g,{gridView:R,item:e,renameItem:eK,deleteItem:eO,setMoveItem:ed,setSelectedItem:eu,isSelected:ef.includes(e.id),toggleSelectItem:eY,selection:ew,currentUserId:eE,workspaceRole:eA},t)),E.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 pb-2 col-span-full",children:[(0,r.jsx)("button",{type:"button",className:"".concat(1===B&&"opacity-70"),disabled:1===B,onClick:()=>eV(B-1,"images"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/left.svg",width:25,height:25,alt:"left",className:"dark:invert"})}),(0,r.jsxs)("span",{className:"text-sm font-medium dark:text-secondary-text",children:["Page ",B," of ",Q]}),(0,r.jsx)("button",{type:"button",className:"".concat(B===Q&&"opacity-70"),disabled:B===Q,onClick:()=>eV(B+1,"images"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/right.svg",width:25,height:25,alt:"right",className:"dark:invert"})})]})]}):(0,r.jsx)("p",{className:"text-center my-10 italic text-gray-500 text-xs md:text-base font-medium",children:"There are no images matching your search"}):"musics"===es?eU().length>0?(0,r.jsxs)("div",{className:"".concat(R?"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-4 xl:grid-cols-6 gap-4 my-2":"flex flex-col"),children:[eU().map((e,t)=>(0,r.jsx)(g,{gridView:R,item:e,renameItem:eK,deleteItem:eO,setMoveItem:ed,setSelectedItem:eu,isSelected:ef.includes(e.id),toggleSelectItem:eY,selection:ew,currentUserId:eE,workspaceRole:eA},t)),M.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 pb-2 col-span-full",children:[(0,r.jsx)("button",{type:"button",className:"".concat(1===G&&"opacity-70"),disabled:1===G,onClick:()=>eV(G-1,"musics"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/left.svg",width:25,height:25,alt:"left",className:"dark:invert"})}),(0,r.jsxs)("span",{className:"text-sm font-medium dark:text-secondary-text",children:["Page ",G," of ",ee]}),(0,r.jsx)("button",{type:"button",className:"".concat(G===ee&&"opacity-70"),disabled:G===ee,onClick:()=>eV(G+1,"musics"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/right.svg",width:25,height:25,alt:"right",className:"dark:invert"})})]})]}):(0,r.jsx)("p",{className:"text-center my-10 italic text-gray-500 text-xs md:text-base font-medium",children:"There are no musics matching your search"}):eU().length>0?(0,r.jsxs)("div",{className:"".concat(R?"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-4 xl:grid-cols-6 gap-4 my-2":"flex flex-col"),children:[eU().map((e,t)=>(0,r.jsx)(g,{gridView:R,item:e,renameItem:eK,deleteItem:eO,setMoveItem:ed,setSelectedItem:eu,isSelected:ef.includes(e.id),toggleSelectItem:eY,selection:ew,currentUserId:eE,workspaceRole:eA},t)),D.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 pb-2 col-span-full",children:[(0,r.jsx)("button",{type:"button",className:"".concat(1===H&&"opacity-70"),disabled:1===H,onClick:()=>eV(H-1,"objects"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/left.svg",width:25,height:25,alt:"left",className:"dark:invert"})}),(0,r.jsxs)("span",{className:"text-sm font-medium dark:text-secondary-text",children:["Page ",H," of ",ea]}),(0,r.jsx)("button",{type:"button",className:"".concat(H===ea&&"opacity-70"),disabled:H===ea,onClick:()=>eV(H+1,"objects"),children:(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/right.svg",width:25,height:25,alt:"right",className:"dark:invert"})})]})]}):(0,r.jsx)("p",{className:"text-center my-10 italic text-gray-500 text-xs md:text-base font-medium",children:"There are no 3d objects matching your search"})})]}),en&&(0,r.jsx)("div",{className:"fixed inset-0 flex items-center justify-center z-50 overflow-auto bg-black bg-opacity-30 dark:bg-white dark:bg-opacity-10",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2 h-full max-h-[90%] w-[500px] max-w-[90%] bg-white dark:bg-primary-bg rounded-md p-4 overflow-y-auto scroll",children:[(0,r.jsx)("h6",{className:"font-bold text-lg dark:text-primary-text",children:"Move your item to..."}),(0,r.jsx)("hr",{className:"dark:border-divider"}),(0,r.jsxs)("div",{className:"flex flex-col overflow-y-auto scroll flex-1",children:[(0,r.jsxs)("button",{type:"button",disabled:0===w,className:"flex items-center gap-2 hover:bg-blue-200 p-1 rounded border dark:border-divider dark:hover:text-black ".concat(0===w&&"opacity-50 cursor-not-allowed"," ").concat(0===em?"bg-blue-200 dark:text-black":"dark:text-primary-text"),onClick:()=>ep(0),children:[(0,r.jsx)(i.iUH,{size:15,className:"transform transition duration-400 ".concat(eb&&"rotate-180"),onClick:e=>{e.stopPropagation(),eg(!eb)}}),(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/blue-folder.svg",alt:"folder",width:50,height:50}),(0,r.jsx)("small",{className:"font-semibold text-sm",children:"Projects"})]}),eb&&y.map(e=>(0,r.jsxs)("button",{type:"button",disabled:w===e.id,className:"flex items-center self-end w-full max-w-[95%] gap-2 p-1 rounded border dark:border-divider dark:hover:text-black hover:bg-blue-200 ".concat(w===e.id&&"opacity-50 cursor-not-allowed"," ").concat(em===e.id?"bg-blue-200 dark:text-black":"dark:text-primary-text"),onClick:()=>ep(e.id),children:[(0,r.jsx)(o.default,{loader:n.default,src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/blue-folder.svg",alt:"folder",width:50,height:50}),(0,r.jsx)("small",{className:"font-semibold text-sm",children:e.name})]},e.id))]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",className:"text-sm py-1 px-2 rounded border border-gray-500 dark:text-primary-text dark:bg-secondary-bg dark:hover:bg-primary-bg hover:bg-gray-100 hover:text-blue-500 active:border-blue-500",onClick:()=>{ed(!1),ej(!1)},children:"Cancel"}),(0,r.jsx)("button",{type:"button",className:"text-sm py-1 px-2 rounded bg-blue-500 text-white hover:bg-blue-400 ".concat(null===em||0===y.length?"cursor-not-allowed":""),disabled:null===em||0===y.length,onClick:()=>ey?eG():eZ(),children:"Move"})]})]})}),N&&(0,r.jsx)("div",{className:"fixed inset-0 flex flex-col items-center justify-center z-50 overflow-auto bg-black bg-opacity-30 dark:bg-white dark:bg-opacity-10",children:(0,r.jsxs)("div",{className:"relative flex items-center justify-center h-full md:max-h-[90%] w-full md:max-w-[90%] lg:max-w-[80%] bg-white md:rounded-lg overflow-y-auto scroll",children:[(0,r.jsx)("button",{type:"button",onClick:()=>z(!1),className:"absolute top-3 right-4 font-bold dark:text-secondary-text",children:"â"}),(0,r.jsx)(p.default,{})]})})]})}},74244:function(e,t,a){"use strict";a.r(t);var r=a(57437),s=a(2265),l=a(35352),i=a(47907),o=a(73107),n=a(12406);a(88062);var d=a(71752),c=a(53218),u=a(42362),x=a(20703);a(51448);var h=a(265),m=a(41143),p=a(49079);t.default=e=>{var t;let{limits:a,userCredits:b,allowGeneration:g}=e,{uploadFile:f,isUploading:v,progress:w}
1=(0,m.Z)(),[k,y]=(0,s.useState)(0),[j,N]=(0,s.useState)(null),[z,_]=(0,s.useState)("en-US"),[S,C]=(0,s.useState)(!1),[I,L]=(0,s.useState)(25),[P,E]=(0,s.useState)(!1),A=(0,s.useRef)(null),M=(0,i.useRouter)();(0,s.useEffect)(()=>{let e=e=>{A.current&&!A.current.contains(e.target)&&E(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);let q=(e,t)=>{let a=0,r=setInterval(()=>{(a+=e/100)>e&&(a=e);let s=Math.round(a/e*100);y(e=>s),o.Z.post("/api/get_video_transcript",{id:t}).then(e=>{""!=e.data.transcript&&(clearInterval(r),M.push("/video/"+t),(0,d._P)("uploadvideo_success"),(0,d.h6)("uploadvideo_success"))}).catch(e=>{console.error(e)})},3e3)},D=(e,t,a,r)=>{o.Z.post("/api/add_video",{url:t,fid:0,duration:a,width:r.width,height:r.height,language:z,credits:I}).then(t=>{"true"==p.env.NEXT_PUBLIC_TESTING?M.push("/video/"+t.data.id):q(e.size,t.data.id)}).catch(e=>{console.error(e)})},T=async e=>{(0,d._P)("uploadnewvideo_uploadclick_video"),(0,d.h6)("uploadnewvideo_uploadclick_video");let t=1048576*parseInt(a.upload),r=parseInt(a.duration),s=e.size,l=0;if(b>=a.credits){n.Am.error("Credits limit reached, upgrade to access more");return}let i=document.createElement("video");i.onloadedmetadata=async()=>{l=i.duration;let o={width:i.videoWidth,height:i.videoHeight};if(s>t){n.Am.error("File size exceeds limit");return}if(l>r){n.Am.error("Video duration exceeds limit");return}let d=await f(e,"video",{endpoint:"/api/get_video_upload_url",maxSizeMB:parseInt(a.upload)});d&&d.key&&D(e,d.key,l,o)},i.src=URL.createObjectURL(e)},U=null===(t=d.Mj.find(e=>e.value===z))||void 0===t?void 0:t.label;return(0,r.jsxs)("div",{className:"flex items-center justify-center h-full w-full video-upload",children:[(0,r.jsx)(n.Ix,{}),v||0!==k?0==k?(0,r.jsxs)("div",{className:" p-10 flex flex-col items-center w-full h-full gap-3",children:[(0,r.jsx)("h3",{className:" text-2xl font-semibold dark:text-primary-text",children:"Uploading your video"}),(0,r.jsx)("div",{className:"w-full xl:max-w-[60%] bg-gray-200 dark:bg-gray-800 rounded-full h-3",children:(0,r.jsx)("div",{className:"bg-gray-800 dark:bg-gray-200 h-3 rounded-full",style:{width:w+"%"}})})]}):(0,r.jsxs)("div",{className:" p-10 flex flex-col items-center w-full h-full gap-3",children:[(0,r.jsx)("h3",{className:" text-2xl font-semibold dark:text-primary-text",children:"Transcribing your video"}),(0,r.jsx)("div",{className:"w-full xl:max-w-[60%] bg-gray-200 dark:bg-gray-800 rounded-full h-3",children:(0,r.jsx)("div",{className:"bg-gray-800 dark:bg-gray-200 h-3 rounded-full",style:{width:k+"%"}})})]}):(0,r.jsx)("div",{className:"w-full max-w-md",children:(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"10px"},children:j?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full h-full",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center justify-between gap-2 rounded px-3 py-1.5 text-sm font-medium border border-gray-500 whitespace-nowrap dark:bg-secondary-bg dark:text-primary-text dark:border-divider",onClick:()=>E(!P),children:[U,(0,r.jsx)(u.iUH,{size:14,className:"transform transition duration-400 flex-shrink-0 ".concat(P&&"rotate-180")})]}),(0,r.jsxs)("button",{className:"flex items-center gap-2 py-1.5 px-3 font-medium rounded shadow-md border border-gray-500 dark:bg-secondary-bg dark:text-primary-text dark:border-divider",onClick:()=>{if(!g){n.Am.error("Upgrade or buy credits to upload"),C(!0);return}j?T(j):n.Am.error("Please select a video file.")},children:[(0,r.jsx)(x.default,{src:"https://d3adwkbyhxyrtq.cloudfront.net/static/public/upload.svg",alt:"",width:18,height:18,className:"invert dark:invert-0"}),"Upload"]})]}),(0,r.jsxs)("p",{className:"text-xs text-gray-600 font-medium dark:text-secondary-text",children:["Estimated cost: ",(0,r.jsxs)("span",{className:"text-black dark:text-primary-text",children:[I," credits"]})]}),(0,r.jsxs)("video",{controls:!0,style:{width:"60%",marginBottom:"20px"},className:"rounded-md dark:border",children:[(0,r.jsx)("source",{src:URL.createObjectURL(j),type:j.type}),"Your browser does not support the video tag."]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.b,{handleChange:e=>{N(e),(0,d._P)("uploadnewvideo_uploadclick"),(0,d.h6)("uploadnewvideo_uploadclick");let t=document.createElement("video");t.onloadedmetadata=()=>{L(25*Math.ceil(t.duration/60))},t.src=URL.createObjectURL(e)},name:"file",types:["MP4","WAV","MP3"],style:{marginBottom:"20px"}}),(0,r.jsxs)("div",{className:"text-sm text-gray-500 dark:text-secondary-text",children:["Max
1Upload : ",a.upload," MB"]}),(0,r.jsxs)("div",{className:"text-sm text-gray-500 dark:text-secondary-text",children:["Max duration : ",a.duration," seconds"]}),(0,r.jsxs)("div",{className:"text-sm text-gray-500 dark:text-secondary-text",children:["Try with a ",(0,r.jsx)("span",{className:"text-blue-500 hover:underline cursor-pointer",onClick:()=>{window.location.href="https://ai.vadoo.tv/video/811399967132",(0,d._P)("uploadnewvideo_samplevideo_click"),(0,d.h6)("uploadnewvideo_samplevideo_click")},children:"sample video"})," instead"]})]})})}),S&&(0,r.jsx)("div",{className:"fixed inset-0 flex flex-col items-center justify-center z-50 overflow-auto bg-black bg-opacity-30 dark:bg-white dark:bg-opacity-10",children:(0,r.jsxs)("div",{className:"relative flex items-center justify-center h-full md:max-h-[90%] w-full md:max-w-[90%] lg:max-w-[80%] bg-white md:rounded-lg overflow-y-auto scroll",children:[(0,r.jsx)("button",{type:"button",onClick:()=>C(!1),className:"absolute top-3 right-4 font-bold dark:text-secondary-text",children:"â"}),(0,r.jsx)(c.default,{})]})}),P&&(0,r.jsx)(h.default,{setShowLanguages:E,selectedLanguage:z,setLanguage:_,popupRef:A})]})}},41143:function(e,t,a){"use strict";var r=a(2265),s=a(73107),l=a(76373),i=a(49079);t.Z=()=>{let[e,t]=(0,r.useState)(!1),[a,o]=(0,r.useState)(0),[n,d]=(0,r.useState)(null),[c,u]=(0,r.useState)(null),[x,h]=(0,r.useState)(null);return{uploadFile:async function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{maxSizeMB:n=50,endpoint:c="/api/get_ai_media_upload_url",method:x="GET"}=r;if(!e)return null;if(e.size>1048576*n)return l.Am.error("File size exceeds limit (".concat(n,"MB)")),null;t(!0),o(0),d(null),u(null),h(null);try{let r;if("true"===i.env.NEXT_PUBLIC_TESTING){for(let e=0;e<=100;e+=10)o(e),await new Promise(e=>setTimeout(e,100));t(!1);let e="video"===a?"https://d3adwkbyhxyrtq.cloudfront.net/static/public/demo.mp4":"audio"===a||"music"===a?"https://d3adwkbyhxyrtq.cloudfront.net/static/public/demo.mp3":"pdf"===a?"https://d3adwkbyhxyrtq.cloudfront.net/static/public/sample.pdf":"https://d3adwkbyhxyrtq.cloudfront.net/static/public/demo.png";return u(e),h(e),{url:e,key:e}}r="POST"===x.toUpperCase()?(await s.Z.post(c,{filename:e.name})).data:(await s.Z.get(c,{params:{filename:e.name}})).data;let l=new FormData;Object.entries(r.fields).forEach(e=>{let[t,a]=e;l.append(t,a)}),l.append("file",e),await s.Z.post(r.url,l,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:e=>{let t=Math.round(100*e.loaded/e.total);o(t)}});let n=l.get("key");return h(n),t(!1),{key:n}}catch(e){return console.error(e),d(e),t(!1),l.Am.error("Upload failed. Please try again."),null}},isUploading:e,progress:a,error:n,uploadedUrl:c,uploadKey:x,reset:()=>{t(!1),o(0),d(null),u(null),h(null)}}}},85682:function(e,t,a){"use strict";a.r(t),a.d(t,{SidebarProvider:function(){return i},useSidebar:function(){return o}});var r=a(57437),s=a(2265);let l=(0,s.createContext)(),i=e=>{let{children:t}=e,[a,i]=(0,s.useState)(!1),[o,n]=(0,s.useState)(!1);return(0,s.useLayoutEffect)(()=>{let e=()=>{i(window.innerWidth>=1024)};return e(),n(!0),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,r.jsx)(l.Provider,{value:{isSidebarExpanded:a,toggleSidebar:()=>{i(e=>!e)},closeSidebar:()=>{i(!1)},openSidebar:()=>{i(!0)},setIsSidebarExpanded:i,mounted:o},children:t})},o=()=>(0,s.useContext)(l)},51448:function(e,t,a){"use strict";a.r(t),a.d(t,{UserProvider:function(){return i},useUser:function(){return o}});var r=a(57437),s=a(2265);let l=(0,s.createContext)(),i=e=>{let{children:t,values:a}=e,[i,o]=(0,s.useState)(a),n=null==a?void 0:a.isLoggedIn,[d,c]=(0,s.useState)(null),[u,x]=(0,s.use
1State)(""),[h,m]=(0,s.useState)(null),[p,b]=(0,s.useState)(null),[g,f]=(0,s.useState)(null),[v,w]=(0,s.useState)(null),k=(null==i?void 0:i.user_subscription_details)||{},y=k.is_pro_advanced_user||!1,j=k.is_unlimited_ultimate_user||0,N=k.is_unlimited_advance_user||0,z=(null==k?void 0:k.compliance_restricted)||!1,_=(0,s.useMemo)(()=>({isLoggedin:n,serverDetails:i,setServerDetails:o,isProAdvancedUser:y,isUltimateUser:j,isAdvancedUser:N,isComplianceRestricted:z,aiImageUrl:d,setAiImageUrl:c,aiPrompt:u,setAiPrompt:x,aiModel:h,setAiModel:m,selectedLoraName:p,setSelectedLoraName:b,videoUrl:g,setVideoUrl:f,charId:v,setCharId:w}),[n,i,y,j,N,z,d,u,h,p,g,v]);return(0,r.jsx)(l.Provider,{value:_,children:t})},o=()=>(0,s.useContext)(l)},90882:function(e,t,a){"use strict";function r(e){let{src:t,width:a,quality:r}=e;return t&&"string"==typeof t?t.includes("cloudfront.net")?"".concat(t).concat(t.includes("?")?"&":"?","w=").concat(a).concat(r?"&q=".concat(r):""):"".concat(t).concat(t.includes("?")?"&":"?","w=").concat(a):""}a.r(t),a.d(t,{default:function(){return r}})},47907:function(e,t,a){"use strict";a.r(t);var r=a(15313),s={};for(var l in r)"default"!==l&&(s[l]=(function(e){return r[e]}).bind(0,l));a.d(t,s)},12406:function(e,t,a){"use strict";a.d(t,{Am:function(){return r.Am},Ix:function(){return r.Ix}});var r=a(86123)},76373:function(e,t,a){"use strict";a.d(t,{Am:function(){return r.Am}});var r=a(86123)},88062:function(){},64848:function(e,t,a){"use strict";a.r(t),a.d(t,{ThemeProvider:function(){return u},useTheme:function(){return c}});var r=a(2265),s=(e,t,a,r,s,l,i,o)=>{let n=document.documentElement,d=["light","dark"];function c(t){(Array.isArray(e)?e:[e]).forEach(e=>{let a="class"===e,r=a&&l?s.map(e=>l[e]||e):s;a?(n.classList.remove(...r),n.classList.add(l&&l[t]?l[t]:t)):n.setAttribute(e,t)}),o&&d.includes(t)&&(n.style.colorScheme=t)}if(r)c(r);else try{let e=localStorage.getItem(t)||a,r=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(r)}catch(e){}},l=["light","dark"],i="(prefers-color-scheme: dark)",o="undefined"==typeof window,n=r.createContext(void 0),d={setTheme:e=>{},themes:[]},c=()=>{var e;return null!=(e=r.useContext(n))?e:d},u=e=>r.useContext(n)?r.createElement(r.Fragment,null,e.children):r.createElement(h,{...e}),x=["light","dark"],h=e=>{let{forcedTheme:t,disableTransitionOnChange:a=!1,enableSystem:s=!0,enableColorScheme:o=!0,storageKey:d="theme",themes:c=x,defaultTheme:u=s?"system":"light",attribute:h="data-theme",value:f,children:v,nonce:w,scriptProps:k}=e,[y,j]=r.useState(()=>p(d,u)),[N,z]=r.useState(()=>"system"===y?g():y),_=f?Object.values(f):c,S=r.useCallback(e=>{let t=e;if(!t)return;"system"===e&&s&&(t=g());let r=f?f[t]:t,i=a?b(w):null,n=document.documentElement,d=e=>{"class"===e?(n.classList.remove(..._),r&&n.classList.add(r)):e.startsWith("data-")&&(r?n.setAttribute(e,r):n.removeAttribute(e))};if(Array.isArray(h)?h.forEach(d):d(h),o){let e=l.includes(u)?u:null,a=l.includes(t)?t:e;n.style.colorScheme=a}null==i||i()},[w]),C=r.useCallback(e=>{let t="function"==typeof e?e(y):e;j(t);try{localStorage.setItem(d,t)}catch(e){}},[y]),I=r.useCallback(e=>{z(g(e)),"system"===y&&s&&!t&&S("system")},[y,t]);r.useEffect(()=>{let e=window.matchMedia(i);return e.addListener(I),I(e),()=>e.removeListener(I)},[I]),r.useEffect(()=>{let e=e=>{e.key===d&&(e.newValue?j(e.newValue):C(u))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[C]),r.useEffect(()=>{S(null!=t?t:y)},[t,y]);let L=r.useMemo(()=>({theme:y,setTheme:C,forcedTheme:t,resolvedTheme:"system"===y?N:y,themes:s?[...c,"system"]:c,systemTheme:s?N:void 0}),[y,C,t,N,s,c]);return r.createElement(n.Provider,{value:L},r.createElement(m,{forcedTheme:t,storageKey:d,attribute:h,enableSystem:s,enableColorScheme:o,defaultTheme:u,value:f,themes:c,nonce:w,scriptProps:k}),v)},m=r.memo(e=>{let{forcedTheme:t,storageKey:a,attribute:l,enableSystem:i,enableColorScheme:o,defaultTheme:n,value:d,themes:c,nonce:u,scriptProps:x}=e,h=JSON.stringify([l,a,n,t,c,d,i,o]).slice(1,-1);return r.createElement("script",{...x,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?u:"",dangerouslySetInnerHTML:{__html:"(".concat(s.toString(),")(").concat(h,")")}})}),p=(e,t)=>{let a;if(!o){try{a=localStorage.getItem(e)||void 0}catch(e){}return a||t}},b=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},g=e=>
1(e||(e=window.matchMedia(i)),e.matches?"dark":"light")}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.