@unciatech/file-manager 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-4DQRTTKI.mjs +18 -0
- package/dist/chunk-S4HRPNKF.js +18 -0
- package/dist/cli.js +20 -20
- package/dist/cli.mjs +14 -14
- package/dist/file-manager-4KJI2OA3.d.mts +194 -0
- package/dist/file-manager-4KJI2OA3.d.ts +194 -0
- package/dist/index.d.mts +3 -229
- package/dist/index.d.ts +3 -229
- package/dist/index.js +21 -38
- package/dist/index.mjs +21 -38
- package/dist/mock.d.mts +38 -0
- package/dist/mock.d.ts +38 -0
- package/dist/mock.js +2 -0
- package/dist/mock.mjs +2 -0
- package/package.json +9 -4
package/dist/index.js
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
"use strict";var vi=Object.create;var wo=Object.defineProperty,xi=Object.defineProperties,bi=Object.getOwnPropertyDescriptor,wi=Object.getOwnPropertyDescriptors,Ci=Object.getOwnPropertyNames,Ho=Object.getOwnPropertySymbols,yi=Object.getPrototypeOf,Sa=Object.prototype.hasOwnProperty,nr=Object.prototype.propertyIsEnumerable;var rr=(e,t,o)=>t in e?wo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,r=(e,t)=>{for(var o in t||(t={}))Sa.call(t,o)&&rr(e,o,t[o]);if(Ho)for(var o of Ho(t))nr.call(t,o)&&rr(e,o,t[o]);return e},s=(e,t)=>xi(e,wi(t));var f=(e,t)=>{var o={};for(var a in e)Sa.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&Ho)for(var a of Ho(e))t.indexOf(a)<0&&nr.call(e,a)&&(o[a]=e[a]);return o};var Fi=(e,t)=>{for(var o in t)wo(e,o,{get:t[o],enumerable:!0})},ir=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ci(t))!Sa.call(e,n)&&n!==o&&wo(e,n,{get:()=>t[n],enumerable:!(a=bi(t,n))||a.enumerable});return e};var Zo=(e,t,o)=>(o=e!=null?vi(yi(e)):{},ir(t||!e||!e.__esModule?wo(o,"default",{value:e,enumerable:!0}):o,e)),Mi=e=>ir(wo({},"__esModule",{value:!0}),e);var Ji={};Fi(Ji,{FileManager:()=>Kn,FileManagerModal:()=>Yn,FileManagerProvider:()=>Co,MockProvider:()=>Pa,useFileManager:()=>G});module.exports=Mi(Ji);var ze=require("react");var oe={PAGE:"page",MODAL:"modal"},el=Object.values(oe),X={IMAGE:"images",VIDEO:"videos",AUDIO:"audios",FILE:"files"},tl=Object.values(X),Ve={SINGLE:"single",MULTIPLE:"multiple"},ol=Object.values(Ve),ki={GRID:"grid",LIST:"list"},al=Object.values(ki),za={LOCAL:"local",REMOTE:"remote",YOUTUBE:"youtube",VIMEO:"vimeo"},rl=Object.values(za);var sr=require("next/navigation"),Re=require("sonner");var Ra=(e,t)=>{let o=[...e];return t.forEach(a=>{o.some(i=>i.id===a.id)?o=o.filter(i=>i.id!==a.id):o.push(a)}),o},lr=(e,t)=>{let o=[...e];return t.forEach(a=>{o.some(i=>i.id===a.id)?o=o.filter(i=>i.id!==a.id):o.push(a)}),o};function dr(e){let{mode:t,selectionMode:o,files:a,folders:n,selectedFiles:i,selectedFolders:l,currentFolder:c,setSelectedFiles:d,setSelectedFolders:g,setCurrentFolder:u,setFiles:b,setFolders:p,setPagination:C,loadData:w,isInSelectionMode:D,provider:y,onFilesSelected:k,onClose:z,basePath:R,setIsLoading:h,setFileDetailsModalFile:I}=e,Y=(0,sr.useRouter)(),te=(0,ze.useCallback)((A,V,W=!1)=>{let K=[A];if(W||V&&(V.metaKey||V.ctrlKey)){d(q=>Ra(q,K));return}if(D()&&t!==oe.MODAL){d(q=>Ra(q,K));return}if(t===oe.MODAL){o==="single"?(d([A]),k==null||k([A]),z==null||z()):d(q=>Ra(q,K));return}I(A)},[t,o,D,d,k,z,I]),se=(0,ze.useCallback)((A,V,W=!1)=>{let K=A?A.id:null;if((W||V&&(V.metaKey||V.ctrlKey))&&A){g(q=>lr(q,[A]));return}if(D()&&A){g(q=>lr(q,[A]));return}if(t===oe.PAGE){h(!0);let q=R!=null?R:"/media",Se=K===null?q:`${q}/${K}`;Y.push(Se)}else{h(!0),d([]),g([]);let q=new URLSearchParams(window.location.search);K===null?q.delete("folderId"):q.set("folderId",String(K)),q.set("page","1");let Se=`${window.location.pathname}?${q.toString()}`;Y.push(Se,{scroll:!1})}},[D,t,Y,g,d,R,h]),De=(0,ze.useCallback)(()=>{d([]),g([])},[d,g]),m=(0,ze.useCallback)(A=>{A?(d(a),g(t===oe.PAGE?n:[])):(d([]),g([]))},[a,n,t,d,g]),_=(0,ze.useCallback)(async(A=!1)=>{await w(A)},[w]),x=(0,ze.useCallback)(async A=>{var V;try{await y.uploadFiles(A,(V=c==null?void 0:c.id)!=null?V:null),await _(!0),d([]),Re.toast.success("Upload Successful",{description:`${A.length} file(s) uploaded successfully`})}catch(W){let K=W instanceof Error?W.message:"Failed to upload files";Re.toast.error("Upload Failed",{description:K}),console.error("Upload failed:",W)}},[c,y,_,d]),O=(0,ze.useCallback)(async A=>{var V;try{await y.createFolder(A,(V=c==null?void 0:c.id)!=null?V:null),await _(!0),d([]),Re.toast.success("Folder Created",{description:`Folder "${A}" created successfully`})}catch(W){let K=W instanceof Error?W.message:"Failed to create folder";Re.toast.error("Create Folder Failed",{description:K}),console.error("Failed to create folder:",W)}},[c,y,_,d]),B=(0,ze.useCallback)(async A=>{try{i.length>0&&await y.moveFiles(i.map(W=>W.id),A),l.length>0&&await y.moveFolders(l.map(W=>W.id),A),await _(!0),d([]),g([]);let V=i.length+l.length;Re.toast.success("Move Successful",{description:`${V} item(s) moved successfully`})}catch(V){let W=V instanceof Error?V.message:"Failed to move items";Re.toast.error("Move Failed",{description:W}),console.error("Failed to move items:",V)}},[i,l,y,_,d,g]),j=(0,ze.useCallback)(async(A,V)=>{try{p(W=>W.map(K=>K.id===A?s(r({},K),{name:V}):K)),await y.renameFolder(A,V),await _(!0),Re.toast.success("Folder Renamed",{description:`Folder renamed to "${V}"`})}catch(W){let K=W instanceof Error?W.message:"Failed to rename folder";Re.toast.error("Rename Failed",{description:K}),console.error("Failed to rename folder:",W)}},[y,_]),be=(0,ze.useCallback)(async(A,V)=>{try{b(W=>W.map(K=>{if(K.id===A){let Je=V,{metaData:q}=Je,Se=f(Je,["metaData"]);return s(r(r({},K),Se),{metaData:q?r(r({},K.metaData),q):K.metaData})}return K})),await y.updateFileMetaData(A,V),await _(!0)}catch(W){let K=W instanceof Error?W.message:"Failed to update metadata";Re.toast.error("Update Failed",{description:K}),console.error("Failed to update metadata:",W)}},[y,_]),$t=(0,ze.useCallback)(async()=>{try{i.length>0&&await y.deleteFiles(i.map(V=>V.id)),l.length>0&&await y.deleteFolders(l.map(V=>V.id)),await _(!0),d([]),g([]);let A=i.length+l.length;Re.toast.success("Delete Successful",{description:`${A} item(s) deleted successfully`})}catch(A){let V=A instanceof Error?A.message:"Failed to delete items";Re.toast.error("Delete Failed",{description:V}),console.error("Failed to delete items:",A)}},[i,l,y,_,d,g]);return{handleFileClick:te,handleFolderClick:se,handleClearSelection:De,handleSelectAllGlobal:m,uploadFiles:x,createFolder:O,bulkMove:B,renameFolder:j,updateFileMetadata:be,bulkDelete:$t,refreshData:_}}var dt=require("next/navigation"),Z=require("react"),Uo=require("sonner");function cr(e){let{mode:t,selectionMode:o,initialFolderId:a,acceptedFileTypesForModal:n,allowedFileTypes:i,provider:l,onFilesSelected:c,onClose:d,basePath:g}=e,u=(0,dt.useParams)(),b=(0,dt.useSearchParams)(),p=(0,dt.useRouter)(),C=(0,dt.usePathname)(),w=Math.max(1,parseInt(b.get("page")||"1",10)),D=Math.max(1,parseInt(b.get("limit")||"24",10)),y=b.get("query")||"",k=(0,Z.useMemo)(()=>{if(t===oe.PAGE&&(u!=null&&u.path)){let U=Array.isArray(u.path)?u.path[0]:u.path;return typeof U=="string"&&/^\d+$/.test(U)?Number(U):null}if(t===oe.MODAL){let U=b.get("folderId");if(U&&/^\d+$/.test(U))return Number(U)}return a!=null?a:null},[t,u,b,a]),[z,R]=(0,Z.useState)([]),[h,I]=(0,Z.useState)([]),[Y,te]=(0,Z.useState)([]),[se,De]=(0,Z.useState)([]),[m,_]=(0,Z.useState)(null),[x,O]=(0,Z.useState)(!0),[B,j]=(0,Z.useState)({currentPage:w,totalPages:1,totalFiles:0,filesPerPage:D}),be=(0,Z.useRef)(null);be.current=m;let[$t,A]=(0,Z.useState)(y),[V,W]=(0,Z.useState)(y);(0,Z.useEffect)(()=>{let U=setTimeout(()=>{W($t)},300);return()=>clearTimeout(U)},[$t]);let K=(0,Z.useRef)(k),Je=(0,Z.useCallback)((U,ue)=>{let me=new URLSearchParams(b.toString());me.set("page",U.toString()),me.set("limit",ue.toString()),p.push(`${C}?${me.toString()}`,{scroll:!1})},[p,C]);(0,Z.useEffect)(()=>{j(U=>s(r({},U),{currentPage:w,filesPerPage:D})),A(y)},[w,D,y]),(0,Z.useEffect)(()=>{k!==K.current&&(t===oe.PAGE&&Je(1,D),K.current=k)},[k,D,Je,t]);let q=B.currentPage,Se=B.filesPerPage;(0,Z.useEffect)(()=>{let U=!1,ue=async()=>{if(k&&(!be.current||be.current.id!==k))try{O(!0);let fe=await l.getFolder(k);if(U)return;_(fe),await me(fe)}catch(fe){let Bo=fe instanceof Error?fe.message:"Failed to load folder";if(Uo.toast.error("Load Folder Failed",{description:Bo}),console.error("Failed to fetch current folder",fe),U)return;_(null),U||O(!1)}else k===null&&be.current!==null?(_(null),await me(null)):be.current?await me(be.current):await me(null)},me=async fe=>{var Bo;if(!U){O(!0);try{let Tt=[];t===oe.MODAL?Tt=n:Tt=i;let bo=await l.getItems((Bo=fe==null?void 0:fe.id)!=null?Bo:null,Tt,q,Se,V);if(U)return;I(bo.folders),R(bo.files),j(bo.pagination)}catch(Tt){let bo=Tt instanceof Error?Tt.message:"Failed to load data";Uo.toast.error("Load Data Failed",{description:bo}),console.error("Failed to load data:",Tt)}finally{U||O(!1)}}};return ue(),()=>{U=!0}},[k,l,t,n,i,q,Se,V]),(0,Z.useEffect)(()=>{De([]),te([])},[m]);let[Qn,Jn]=(0,Z.useState)(!1),[Xn,ei]=(0,Z.useState)(!1),[ti,oi]=(0,Z.useState)(!1),[ai,ri]=(0,Z.useState)(!1),[ni,ii]=(0,Z.useState)(!1),[li,si]=(0,Z.useState)(null),[di,ci]=(0,Z.useState)(null),pi=(0,Z.useCallback)(async(U=!1)=>{var ue;U||O(!0);try{let me=[];t===oe.MODAL?me=n:me=i;let fe=await l.getItems((ue=m==null?void 0:m.id)!=null?ue:null,me,q,Se,V);I(fe.folders),R(fe.files),j(fe.pagination)}catch(me){let fe=me instanceof Error?me.message:"Failed to load data";Uo.toast.error("Load Data Failed",{description:fe}),console.error("Failed to load data:",me)}finally{U||O(!1)}},[m,t,n,i,l,q,Se,V]),ui=()=>Y.length>0||se.length>0,mi=()=>m,fi=(0,Z.useMemo)(()=>()=>{let U=z.length+(t===oe.PAGE?h.length:0),ue=Y.length+se.length;return ue===0?!1:ue===U?!0:"indeterminate"},[z.length,h.length,Y.length,se.length,t]),gi=(0,Z.useCallback)(U=>{j(ue=>s(r({},ue),{currentPage:U})),t===oe.PAGE&&Je(U,Se)},[Je,Se,t]),hi=(0,Z.useCallback)(U=>{A(U);let ue=new URLSearchParams(b.toString());U.trim()?(ue.set("query",U),ue.set("page","1")):ue.delete("query"),p.push(`${C}?${ue.toString()}`,{scroll:!1})},[p,C,b]);return{files:z,folders:h,selectedFiles:Y,selectedFolders:se,currentFolder:m,isLoading:x,pagination:B,isUploadModalOpen:Qn,isCreateFolderModalOpen:Xn,isSearchModalOpen:ti,isMoveFileModalOpen:ai,isRenameFolderModalOpen:ni,fileDetailsModalFile:di,folderToRename:li,setFiles:R,setFolders:I,setSelectedFiles:te,setSelectedFolders:De,setCurrentFolder:_,setPagination:j,setIsUploadModalOpen:Jn,setIsCreateFolderModalOpen:ei,setIsSearchModalOpen:oi,setIsMoveFileModalOpen:ri,setIsRenameFolderModalOpen:ii,setFileDetailsModalFile:ci,setFolderToRename:si,loadData:pi,setIsLoading:O,isInSelectionMode:ui,getCurrentFolder:mi,getSelectionState:fi,handlePageChange:gi,searchQuery:$t,updateSearchQuery:hi,mode:t,selectionMode:o,acceptedFileTypesForModal:n,provider:l,onFilesSelected:c,onClose:d,basePath:g}}var Kt=require("react"),ur=require("react/jsx-runtime"),pr=(0,Kt.createContext)(void 0);function Co({children:e,mode:t=oe.PAGE,selectionMode:o=Ve.SINGLE,allowedFileTypes:a,onFilesSelected:n,onClose:i,acceptedFileTypesForModal:l,initialFolderId:c=null,provider:d,basePath:g="/media",maxUploadFiles:u=50,maxUploadSize:b=100*1024*1024}){let p=cr({mode:t,selectionMode:o,initialFolderId:c,acceptedFileTypesForModal:l,allowedFileTypes:a,provider:d,onFilesSelected:n,onClose:i,basePath:g}),C=dr(p),w=(0,Kt.useMemo)(()=>({files:p.files,folders:p.folders,selectedFiles:p.selectedFiles,selectedFolders:p.selectedFolders,currentFolder:p.currentFolder,isLoading:p.isLoading,pagination:p.pagination,isUploadModalOpen:p.isUploadModalOpen,isCreateFolderModalOpen:p.isCreateFolderModalOpen,isSearchModalOpen:p.isSearchModalOpen,isMoveFileModalOpen:p.isMoveFileModalOpen,isRenameFolderModalOpen:p.isRenameFolderModalOpen,fileDetailsModalFile:p.fileDetailsModalFile,folderToRename:p.folderToRename,mode:p.mode,selectionMode:p.selectionMode,allowedFileTypes:a,acceptedFileTypesForModal:p.acceptedFileTypesForModal,maxUploadFiles:u,maxUploadSize:b,setIsUploadModalOpen:p.setIsUploadModalOpen,setIsCreateFolderModalOpen:p.setIsCreateFolderModalOpen,setIsSearchModalOpen:p.setIsSearchModalOpen,setIsMoveFileModalOpen:p.setIsMoveFileModalOpen,setSelectedFiles:p.setSelectedFiles,setSelectedFolders:p.setSelectedFolders,setIsRenameFolderModalOpen:p.setIsRenameFolderModalOpen,setFileDetailsModalFile:p.setFileDetailsModalFile,setFolderToRename:p.setFolderToRename,handleFileClick:C.handleFileClick,handleFolderClick:C.handleFolderClick,handleClearSelection:C.handleClearSelection,handleSelectAllGlobal:C.handleSelectAllGlobal,handlePageChange:p.handlePageChange,searchQuery:p.searchQuery,updateSearchQuery:p.updateSearchQuery,uploadFiles:C.uploadFiles,createFolder:C.createFolder,bulkMove:C.bulkMove,renameFolder:C.renameFolder,updateFileMetadata:C.updateFileMetadata,bulkDelete:C.bulkDelete,refreshData:C.refreshData,isInSelectionMode:p.isInSelectionMode,getCurrentFolder:p.getCurrentFolder,getSelectionState:p.getSelectionState,onClose:p.onClose,onFilesSelected:p.onFilesSelected,provider:d,basePath:p.basePath}),[p,C,d,a,u,b]);return(0,ur.jsx)(pr.Provider,{value:w,children:e})}function G(){let e=(0,Kt.useContext)(pr);if(e===void 0)throw new Error("useFileManager must be used within a FileManagerProvider");return e}var mr=require("clsx"),fr=require("tailwind-merge");function v(...e){return(0,fr.twMerge)((0,mr.clsx)(e))}var Yt=require("react/jsx-runtime");function jo(e){return(0,Yt.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 29.93 40.02",width:"100",height:"100"},e),{children:[(0,Yt.jsx)("path",{fill:"#e5252a",d:"M5.21 0l13.38 0 11.34 11.82 0 22.99c0,2.88 -2.33,5.21 -5.2,5.21l-19.52 0c-2.88,0 -5.21,-2.33 -5.21,-5.21l0 -29.6c0,-2.88 2.33,-5.21 5.21,-5.21z"}),(0,Yt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"18.58 0 18.58 11.73 29.93 11.73"}),(0,Yt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M5.79 29.86l0 -7.31 3.11 0c0.77,0 1.38,0.21 1.84,0.64 0.46,0.42 0.69,0.99 0.69,1.7 0,0.71 -0.23,1.28 -0.69,1.7 -0.46,0.43 -1.07,0.64 -1.84,0.64l-1.24 0 0 2.63 -1.87 0zm1.87 -4.22l1.03 0c0.28,0 0.5,-0.06 0.65,-0.2 0.15,-0.13 0.23,-0.31 0.23,-0.55 0,-0.24 -0.08,-0.42 -0.23,-0.55 -0.15,-0.14 -0.37,-0.2 -0.65,-0.2l-1.03 0 0 1.5zm4.54 4.22l0 -7.31 2.59 0c0.51,0 0.99,0.07 1.44,0.22 0.45,0.15 0.86,0.36 1.22,0.65 0.36,0.28 0.65,0.66 0.86,1.14 0.2,0.48 0.31,1.03 0.31,1.65 0,0.61 -0.11,1.16 -0.31,1.64 -0.21,0.48 -0.5,0.86 -0.86,1.14 -0.36,0.29 -0.77,0.5 -1.22,0.65 -0.45,0.15 -0.93,0.22 -1.44,0.22l-2.59 0zm1.83 -1.59l0.54 0c0.29,0 0.56,-0.03 0.81,-0.1 0.24,-0.07 0.47,-0.18 0.69,-0.33 0.21,-0.15 0.38,-0.36 0.5,-0.64 0.12,-0.28 0.18,-0.61 0.18,-0.99 0,-0.39 -0.06,-0.72 -0.18,-1 -0.12,-0.28 -0.29,-0.49 -0.5,-0.64 -0.22,-0.15 -0.45,-0.26 -0.69,-0.33 -0.25,-0.07 -0.52,-0.1 -0.81,-0.1l-0.54 0 0 4.13zm5.53 1.59l0 -7.31 5.2 0 0 1.59 -3.33 0 0 1.17 2.66 0 0 1.58 -2.66 0 0 2.97 -1.87 0z"})]}))}var qt=require("react/jsx-runtime");function Wo(e){return(0,qt.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 17.69 23.65",width:"100",height:"100"},e),{children:[(0,qt.jsx)("path",{fill:"#00733b",d:"M3.08 0l7.91 0 6.7 6.99 0 13.58c0,1.7 -1.38,3.08 -3.08,3.08l-11.53 0c-1.7,0 -3.08,-1.38 -3.08,-3.08l0 -17.49c0,-1.7 1.38,-3.08 3.08,-3.08z"}),(0,qt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"10.98 0 10.98 6.93 17.69 6.93"}),(0,qt.jsx)("path",{fill:"#fff",d:"M5.21 17.35l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 -6.08l3.15 0 0 1.18 -3.15 0 0 -1.18zm-4.12 0l3.14 0 0 1.18 -3.14 0 0 -1.18zm4.12 2l3.15 0 0 1.19 -3.15 0 0 -1.19zm-4.12 0l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 2.08l3.15 0 0 1.19 -3.15 0 0 -1.19zm-4.12 0l3.14 0 0 1.19 -3.14 0 0 -1.19zm4.12 2l3.15 0 0 1.19 -3.15 0 0 -1.19z"})]}))}var Qt=require("react/jsx-runtime");function $o(e){return(0,Qt.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,Qt.jsx)("path",{fill:"#e03303",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,Qt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,Qt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M11.76 16.13c-2.44,0.12 -4.38,2.15 -4.35,4.62 0.04,2.46 2.04,4.47 4.5,4.5 2.48,0.04 4.51,-1.9 4.62,-4.34 0.01,-0.12 -0.09,-0.22 -0.21,-0.22l-4.13 0c-0.12,0 -0.22,-0.1 -0.22,-0.21l0 -4.14c0,-0.12 -0.09,-0.21 -0.21,-0.21zm1.1 -0.67l0 4.13c0,0.12 0.09,0.21 0.21,0.21l4.14 0c0.12,0 0.21,-0.1 0.21,-0.22 -0.11,-2.34 -1.99,-4.22 -4.34,-4.33 -0.12,-0.01 -0.22,0.09 -0.22,0.21z"})]}))}var Jt=require("react/jsx-runtime");function Ko(e){return(0,Jt.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 38.89 51.99",width:"100",height:"100"},e),{children:[(0,Jt.jsx)("path",{fill:"#0263d1",fillRule:"nonzero",d:"M6.76 0l17.4 0 14.73 15.36 0 29.87c0,3.73 -3.03,6.76 -6.77,6.76l-25.36 0c-3.73,0 -6.76,-3.03 -6.76,-6.76l0 -38.47c0,-3.73 3.03,-6.76 6.76,-6.76z"}),(0,Jt.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"24.14 0 24.14 15.24 38.89 15.24"}),(0,Jt.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M26.3 27.05l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm-4.57 13.71l-9.14 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l9.14 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm4.57 -4.57l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0zm0 -4.57l-13.71 0c-0.63,0 -1.15,-0.51 -1.15,-1.14 0,-0.63 0.52,-1.14 1.15,-1.14l13.71 0c0.63,0 1.14,0.51 1.14,1.14 0,0.63 -0.51,1.14 -1.14,1.14l0 0z"})]}))}var Xt=require("react/jsx-runtime");function Yo(e){return(0,Xt.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,Xt.jsx)("path",{fill:"#ffc000",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,Xt.jsx)("polygon",{fill:"#ffffff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,Xt.jsx)("path",{fill:"#ffffff",fillRule:"nonzero",d:"M16.45 21.21l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0zm0 2.86l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0zm-4.36 -8.57l-4.21 0c-0.4,0 -0.72,0.31 -0.72,0.71 0,0.4 0.32,0.71 0.72,0.71l4.21 0c0.4,0 0.72,-0.31 0.72,-0.71 0,-0.4 -0.32,-0.71 -0.72,-0.71l0 0zm4.36 2.85l-8.57 0c-0.4,0 -0.72,0.32 -0.72,0.72 0,0.39 0.32,0.71 0.72,0.71l8.57 0c0.4,0 0.72,-0.32 0.72,-0.71 0,-0.4 -0.32,-0.72 -0.72,-0.72l0 0z"})]}))}var Ge=require("react/jsx-runtime");function qo(e){return(0,Ge.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"100",height:"100",viewBox:"0 0 48 48","aria-hidden":"true"},e),{children:[(0,Ge.jsxs)("linearGradient",{id:"X-uD4Bgl9JIhUIufrZZzja_Pjo0BrMdm974_gr1",x1:"37.127",x2:"25.868",y1:"6.873",y2:"18.132",gradientUnits:"userSpaceOnUse",children:[(0,Ge.jsx)("stop",{offset:"0",stopColor:"#262626",stopOpacity:"0"}),(0,Ge.jsx)("stop",{offset:".913",stopColor:"#262626",stopOpacity:".8"})]}),(0,Ge.jsx)("path",{fill:"url(#X-uD4Bgl9JIhUIufrZZzja_Pjo0BrMdm974_gr1)",d:"M28,4v8c0,2.209,1.791,4,4,4h8L28,4z",children:" "}),(0,Ge.jsxs)("linearGradient",{id:"X-uD4Bgl9JIhUIufrZZzjb_Pjo0BrMdm974_gr2",x1:"-8.398",x2:"74.731",y1:"51.185",y2:"-18.568",gradientUnits:"userSpaceOnUse",children:[(0,Ge.jsx)("stop",{offset:"0",stopColor:"#262626",stopOpacity:"0"}),(0,Ge.jsx)("stop",{offset:"1",stopColor:"#262626",stopOpacity:".8"})]}),(0,Ge.jsx)("path",{fill:"url(#X-uD4Bgl9JIhUIufrZZzjb_Pjo0BrMdm974_gr2)",d:"M40,16v23c0,2.761-2.239,5-5,5H8V9c0-2.761,2.239-5,5-5h15L40,16z"})]}))}var eo=require("react/jsx-runtime");function Qo(e){return(0,eo.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100","aria-hidden":"true"},e),{children:[(0,eo.jsx)("path",{fill:"#ffb11f",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,eo.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,eo.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M8.96 16.9l0 -2.22c0,-0.24 -0.19,-0.43 -0.43,-0.43l-1.2 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 2.22 -0.67 1.96c-0.19,0.55 -0.1,1.16 0.24,1.63 0.33,0.47 0.88,0.75 1.46,0.75 0.58,0 1.12,-0.28 1.46,-0.75 0.34,-0.47 0.43,-1.08 0.24,-1.63l-0.67 -1.96zm-0.28 3.08c-0.34,0.49 -1.16,0.49 -1.51,0 -0.17,-0.24 -0.22,-0.56 -0.12,-0.84l0.22 -0.66 1.31 0 0.23 0.66c0.09,0.28 0.05,0.6 -0.13,0.84zm-3.41 -17.65l0 1.22c0,0.24 0.19,0.43 0.43,0.43l1.63 0 0 1.82 -1.63 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 0.94c0,0.24 0.19,0.44 0.43,0.44l1.63 0 0 1.81 -1.63 0c-0.24,0 -0.43,0.19 -0.43,0.43l0 0.95c0,0.24 0.19,0.43 0.43,0.43l1.63 0 0 1.38c0,0.24 0.2,0.43 0.44,0.43l2.39 0c0.23,0 0.43,-0.19 0.43,-0.43l0 -0.95c0,-0.23 -0.2,-0.43 -0.43,-0.43l-1.64 0 0 -1.81 1.64 0c0.23,0 0.43,-0.19 0.43,-0.43l0 -0.95c0,-0.24 -0.2,-0.43 -0.43,-0.43l-1.64 0 0 -1.81 1.64 0c0.23,0 0.43,-0.2 0.43,-0.44l0 -0.94c0,-0.24 -0.2,-0.44 -0.43,-0.44l-1.64 0 0 -1.66c0,0 -3.25,0.01 -3.25,0.01z"})]}))}var to=require("react/jsx-runtime");function Jo(e){return(0,to.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 20.49 27.4",width:"100",height:"100","aria-hidden":"true"},e),{children:[(0,to.jsx)("path",{fill:"#00a1e0",d:"M3.56 0l9.17 0 7.76 8.1 0 15.73c0,1.97 -1.59,3.57 -3.56,3.57l-13.37 0c-1.96,0 -3.56,-1.6 -3.56,-3.57l0 -20.27c0,-1.96 1.6,-3.56 3.56,-3.56z"}),(0,to.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"12.72 0 12.72 8.03 20.49 8.03"}),(0,to.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M12.07 20.44l-0.52 0 0 -0.99 0.11 0c0.26,0 0.39,-0.14 0.39,-0.42l0 -1.45c0,-0.23 0.06,-0.41 0.16,-0.53 0.11,-0.11 0.27,-0.21 0.48,-0.3 -0.2,-0.08 -0.36,-0.18 -0.47,-0.3 -0.11,-0.12 -0.17,-0.29 -0.17,-0.52l0 -1.45c0,-0.28 -0.13,-0.42 -0.39,-0.42l-0.11 0 0 -0.99 0.52 0c0.31,0 0.56,0.1 0.76,0.3 0.2,0.2 0.3,0.45 0.3,0.75l0 1.55c0,0.38 0.21,0.57 0.63,0.57l0 1.03c-0.42,0 -0.63,0.19 -0.63,0.58l0 1.54c0,0.3 -0.1,0.55 -0.3,0.75 -0.2,0.2 -0.45,0.3 -0.76,0.3zm-3.65 0c-0.3,0 -0.56,-0.1 -0.76,-0.3 -0.2,-0.2 -0.3,-0.45 -0.3,-0.75l0 -1.54c0,-0.39 -0.21,-0.58 -0.63,-0.58l0 -1.03c0.42,0 0.63,-0.19 0.63,-0.57l0 -1.55c0,-0.3 0.1,-0.55 0.3,-0.75 0.2,-0.2 0.46,-0.3 0.76,-0.3l0.53 0 0 0.99 -0.12 0c-0.26,0 -0.39,0.14 -0.39,0.42l0 1.45c0,0.23 -0.05,0.4 -0.16,0.52 -0.11,0.12 -0.27,0.22 -0.48,0.3 0.21,0.09 0.37,0.19 0.48,0.3 0.11,0.12 0.16,0.3 0.16,0.53l0 1.45c0,0.28 0.13,0.42 0.39,0.42l0.12 0 0 0.99 -0.53 0z"})]}))}var oo=require("react/jsx-runtime");function ao(e){return(0,oo.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 24.33 32.53",width:"100",height:"100"},e),{children:[(0,oo.jsx)("path",{fill:"#90c",d:"M4.23 0l10.88 0 9.22 9.61 0 18.69c0,2.33 -1.9,4.23 -4.23,4.23l-15.87 0c-2.34,0 -4.23,-1.9 -4.23,-4.23l0 -24.07c0,-2.34 1.89,-4.23 4.23,-4.23z"}),(0,oo.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"15.1 0 15.1 9.53 24.33 9.53"}),(0,oo.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M15.07 21.38c0.31,-0.52 0.52,-1.18 0.56,-1.83 0.02,-0.42 -0.07,-0.86 -0.27,-1.27 -0.32,-0.65 -0.86,-1.01 -1.39,-1.37 -0.39,-0.26 -0.76,-0.51 -1.02,-0.86l-0.05 -0.06c-0.15,-0.21 -0.33,-0.45 -0.36,-0.65 -0.02,-0.2 -0.21,-0.34 -0.4,-0.33 -0.21,0.02 -0.36,0.18 -0.36,0.39l0 6.86c-0.32,-0.2 -0.72,-0.32 -1.16,-0.32 -1.06,0 -1.92,0.69 -1.92,1.54 0,0.85 0.86,1.54 1.92,1.54 1.06,0 1.93,-0.69 1.93,-1.54l0 -4.49c0.58,0.23 1.52,0.79 1.78,2.1 -0.05,0.07 -0.09,0.15 -0.15,0.21 -0.14,0.16 -0.12,0.4 0.04,0.55 0.16,0.14 0.4,0.12 0.54,-0.04 0.1,-0.12 0.2,-0.25 0.28,-0.4 0.01,-0.01 0.02,-0.02 0.03,-0.03z"})]}))}var J=require("react/jsx-runtime");function Xo(e){return(0,J.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:"100",height:"100"},e),{children:[(0,J.jsx)("path",{fill:"#188a32",d:"M56,35v8c0,1.66-1.34,3-3,3H11c-1.66,0-3-1.34-3-3v-8c0-1.66,1.34-3,3-3h42C54.66,32,56,33.34,56,35z"}),(0,J.jsx)("path",{fill:"#0082AA",d:"M44,29v5c0,1.66-1.34,3-3,3H23c-1.66,0-3-1.34-3-3v-5h4v4h16v-4H44z"}),(0,J.jsx)("path",{fill:"#4d50c6",d:`M53,32H11c-1.657,0-3-1.343-3-3v-8c0-1.657,1.343-3,3-3h42c1.657,0,3,1.343,3,3v8
|
|
2
|
-
C56,30.657,54.657,32,53,32z`}),(0,J.jsx)("path",{fill:"#e6275e",d:`M53,18H11c-1.657,0-3-1.343-3-3V7c0-1.657,1.343-3,3-3h42c1.657,0,3,1.343,3,3v8
|
|
3
|
-
C56,16.657,54.657,18,53,18z`}),(0,J.jsx)("rect",{width:"16",height:"42",x:"24",y:"4",fill:"#FAB400"}),(0,J.jsx)("path",{fill:"#DC9600",d:"M32,46L32,46c-4.418,0-8-3.582-8-8v-4h16v4C40,42.418,36.418,46,32,46z"}),(0,J.jsx)("path",{fill:"#FAB400",d:"M32,44L32,44c-4.418,0-8-3.582-8-8v-4h16v4C40,40.418,36.418,44,32,44z"}),(0,J.jsx)("rect",{width:"16",height:"4",x:"24",y:"33",fill:"#DC9600"}),(0,J.jsx)("path",{fill:"#F0F0F0",d:`M44,17v16c0,1.66-1.34,3-3,3H23c-1.66,0-3-1.34-3-3V17c0-1.66,1.34-3,3-3h1v18h16V14h1
|
|
4
|
-
C42.66,14,44,15.34,44,17z`}),(0,J.jsx)("path",{fill:"#D2D2D2",d:"M34,31v2c0,1.1-0.9,2-2,2s-2-0.9-2-2v-2H34z"}),(0,J.jsx)("path",{fill:"#F0F0F0",d:`M32,34L32,34c-1.105,0-2-0.895-2-2v-8c0-1.105,0.895-2,2-2h0c1.105,0,2,0.895,2,2v8
|
|
5
|
-
C34,33.105,33.105,34,32,34z`}),(0,J.jsx)("circle",{cx:"32",cy:"18",r:"2",fill:"#C80A50"}),(0,J.jsx)("circle",{cx:"32",cy:"10",r:"2",fill:"#00A0C8"}),(0,J.jsx)("path",{fill:"#F0F0F0",d:"M34,18h-4c0-1.1,0.9-2,2-2S34,16.9,34,18z"}),(0,J.jsx)("path",{fill:"#0A5078",d:`M47,60H17c-1.105,0-2-0.895-2-2V44c0-1.105,0.895-2,2-2h30c1.105,0,2,0.895,2,2v14
|
|
6
|
-
C49,59.105,48.105,60,47,60z`}),(0,J.jsx)("path",{fill:"#F0F0F0",d:`M35,53h-6c-0.552,0-1-0.448-1-1v-3c0-2.206,1.794-4,4-4s4,1.794,4,4v3C36,52.552,35.552,53,35,53z
|
|
7
|
-
M30,51h4v-2c0-1.103-0.897-2-2-2s-2,0.897-2,2V51z`}),(0,J.jsx)("path",{fill:"#F0F0F0",d:"M29 57c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1s1 .448 1 1v4C30 56.552 29.552 57 29 57zM35 57c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1s1 .448 1 1v4C36 56.552 35.552 57 35 57zM42 53h-3c-.552 0-1-.448-1-1v-6c0-.552.448-1 1-1h3c2.206 0 4 1.794 4 4S44.206 53 42 53zM40 51h2c1.103 0 2-.897 2-2s-.897-2-2-2h-2V51z"}),(0,J.jsx)("path",{fill:"#F0F0F0",d:"M39 57c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1s1 .448 1 1v4C40 56.552 39.552 57 39 57zM45.001 57c-.367 0-.72-.202-.896-.553l-2-4c-.247-.494-.047-1.095.447-1.342.495-.248 1.095-.047 1.342.447l2 4c.247.494.047 1.095-.447 1.342C45.304 56.966 45.151 57 45.001 57z"}),(0,J.jsxs)("g",{children:[(0,J.jsx)("path",{fill:"#F0F0F0",d:`M22,53h-3c-0.552,0-1-0.448-1-1v-6c0-0.552,0.448-1,1-1h3c2.206,0,4,1.794,4,4S24.206,53,22,53z
|
|
8
|
-
M20,51h2c1.103,0,2-0.897,2-2s-0.897-2-2-2h-2V51z`}),(0,J.jsx)("path",{fill:"#F0F0F0",d:"M19 57c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1s1 .448 1 1v4C20 56.552 19.552 57 19 57zM25.001 57c-.367 0-.72-.202-.896-.553l-2-4c-.247-.494-.047-1.095.447-1.342.495-.248 1.095-.047 1.342.447l2 4c.247.494.047 1.095-.447 1.342C25.304 56.966 25.151 57 25.001 57z"})]})]}))}var yo=require("react/jsx-runtime");function ea(e){return(0,yo.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"100",height:"100"},e),{children:[(0,yo.jsx)("path",{fill:"#e8e9ea",d:`M8.16,17.51V3.74c0-1.79,1.45-3.24,3.24-3.24h20.53l12.79,12.8v30.96c0,1.79-1.45,3.24-3.24,3.24H11.4
|
|
9
|
-
c-1.79,0-3.24-1.45-3.24-3.24v-1.62`}),(0,yo.jsx)("path",{fill:"#697d7f",d:"M44.72 13.3h-9.93c-1.58 0-2.86-1.28-2.86-2.86V.5M11.53 25.42c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5H4.78c-.83 0-1.5.67-1.5 1.5v11.53c0 .83.67 1.5 1.5 1.5h6.75c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5H6.28v-2.76h3.98c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5H6.28v-2.76H11.53zM36.33 25.42c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5h-6.75c-.83 0-1.5.67-1.5 1.5v11.53c0 .83.67 1.5 1.5 1.5h6.75c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5h-5.25v-2.76h3.98c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5h-3.98v-2.76H36.33zM15.55 36.67c.26.19.57.28.87.28.47 0 .93-.22 1.22-.63l2.92-4.07 2.92 4.07c.29.41.75.63 1.22.63.3 0 .61-.09.87-.28.67-.48.83-1.42.34-2.09l-3.51-4.89 3.51-4.89c.48-.67.33-1.61-.34-2.09-.67-.48-1.61-.33-2.09.34l-2.92 4.07-2.92-4.07c-.48-.67-1.42-.83-2.09-.34-.67.48-.83 1.42-.34 2.09l3.51 4.89-3.51 4.89C14.72 35.25 14.87 36.19 15.55 36.67z"})]}))}var ro=require("react/jsx-runtime");function no(e){return(0,ro.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 17.69 23.65",width:"100",height:"100"},e),{children:[(0,ro.jsx)("path",{fill:"#0ac963",d:"M3.08 0l7.91 0 6.7 6.99 0 13.58c0,1.7 -1.38,3.08 -3.08,3.08l-11.53 0c-1.7,0 -3.08,-1.38 -3.08,-3.08l0 -17.49c0,-1.7 1.38,-3.08 3.08,-3.08z"}),(0,ro.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"10.98 0 10.98 6.93 17.69 6.93"}),(0,ro.jsx)("path",{fill:"#fff",d:"M11.85 11.82l-6.01 0c-0.45,0 -0.82,0.37 -0.82,0.82l0 3.82c0,0.45 0.37,0.82 0.82,0.82l6.01 0c0.45,0 0.81,-0.37 0.81,-0.82l0 -3.82c0,-0.45 -0.36,-0.82 -0.81,-0.82zm-4.37 1.03c0.49,0 0.88,0.4 0.88,0.88 0,0.49 -0.39,0.89 -0.88,0.89 -0.49,0 -0.89,-0.4 -0.89,-0.89 0,-0.48 0.4,-0.88 0.89,-0.88zm4.64 3.61c0,0.15 -0.12,0.28 -0.27,0.28l-6.01 0c-0.15,0 -0.27,-0.13 -0.27,-0.28l0 -0.16 1.09 -1.09 0.9 0.9c0.11,0.11 0.28,0.11 0.39,0l2.26 -2.26 1.91 1.91 0 0.7 0 0z"})]}))}var io=require("react/jsx-runtime");function ta(e){return(0,io.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 29.93 40.02",width:"100",height:"100"},e),{children:[(0,io.jsx)("path",{fill:"#fa0000",d:"M5.21 0l13.38 0 11.34 11.82 0 22.99c0,2.88 -2.33,5.21 -5.2,5.21l-19.52 0c-2.88,0 -5.21,-2.33 -5.21,-5.21l0 -29.6c0,-2.88 2.33,-5.21 5.21,-5.21z"}),(0,io.jsx)("polygon",{fill:"#fff",fillOpacity:".302",points:"18.58 0 18.58 11.73 29.93 11.73"}),(0,io.jsx)("path",{fill:"#fff",fillRule:"nonzero",d:"M14.97 18.16c-3.57,0 -6.47,2.9 -6.47,6.47 0,3.57 2.9,6.46 6.47,6.46 3.57,0 6.46,-2.89 6.46,-6.46 0,-3.57 -2.9,-6.46 -6.46,-6.47zm2.72 6.67c-0.05,0.09 -0.12,0.16 -0.21,0.21l0 0 -3.69 1.85c-0.23,0.11 -0.51,0.02 -0.62,-0.21 -0.04,-0.06 -0.05,-0.13 -0.05,-0.21l0 -3.69c0,-0.26 0.21,-0.46 0.46,-0.46 0.07,0 0.14,0.01 0.21,0.05l3.69 1.84c0.23,0.12 0.32,0.39 0.21,0.62z"})]}))}var Ze=require("react/jsx-runtime");function oa(e){return(0,Ze.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:"100",height:"100"},e),{children:[(0,Ze.jsx)("path",{fill:"#5a5959",d:`M2.1,57.4h57.7c1.1,0,2.1-0.9,2.1-2.1V13.4c0-1.1-0.9-2.1-2.1-2.1H31c-0.8,0-1.5-0.4-1.8-1.1l-1.7-3.4
|
|
10
|
-
c-0.4-0.7-1.1-1.1-1.8-1.1H2.1C0.9,5.7,0,6.6,0,7.8v47.5C0,56.4,0.9,57.4,2.1,57.4z`}),(0,Ze.jsx)("path",{fill:"#504e4e",d:`M3,58.3h56.7c1.1,0,2.1-0.9,2.1-2.1V14.3c0-1.1-0.9-2.1-2.1-2.1H31c-0.8,0-1.5-0.4-1.8-1.1l-1.7-3.4
|
|
11
|
-
c-0.4-0.7-1.1-1.1-1.8-1.1H2.1C0.9,6.6,0,7.6,0,8.7v46.6C0,56.9,1.3,58.3,3,58.3z`}),(0,Ze.jsx)("rect",{width:"58.6",height:"21.1",x:"1.6",y:"14.7",fill:"#ffffff"}),(0,Ze.jsx)("rect",{width:".8",height:"21.1",x:"1.6",y:"14.7",fill:"#f3f3f3"}),(0,Ze.jsx)("rect",{width:"58.6",height:".9",x:"1.6",y:"14.7",fill:"#f3f1f1"}),(0,Ze.jsx)("path",{fill:"#676666",d:`M64,18.6v35.8c0,1.7-1.3,3-3,3H3c-1.7,0-3-1.3-3-3v-31c0-1.7,1.3-3,3-3h29.2c0.8,0,1.6-0.3,2.1-0.9l3-3
|
|
12
|
-
c0.6-0.6,1.3-0.9,2.1-0.9H61C62.7,15.6,64,17,64,18.6z`}),(0,Ze.jsx)("path",{fill:"#6f6d6d",d:`M64,19.5v35.8c0,1.7-1.3,3-3,3H3c-1.7,0-3-1.3-3-3v-31c0-1.7,1.3-3,3-3h29.2c0.8,0,1.6-0.3,2.1-0.9l3-3
|
|
13
|
-
c0.6-0.6,1.3-0.9,2.1-0.9H61C62.7,16.5,64,17.9,64,19.5z`})]}))}var Et=require("react/jsx-runtime");function aa(e){return(0,Et.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:"100",height:"100"},e),{children:[(0,Et.jsx)("path",{fill:"#5a5959",d:`M2.1,57.4h57.7c1.1,0,2.1-0.9,2.1-2.1V13.4c0-1.1-0.9-2.1-2.1-2.1H31c-0.8,0-1.5-0.4-1.8-1.1l-1.7-3.4
|
|
14
|
-
c-0.4-0.7-1.1-1.1-1.8-1.1H2.1C0.9,5.7,0,6.6,0,7.8v47.5C0,56.4,0.9,57.4,2.1,57.4z`}),(0,Et.jsx)("path",{fill:"#504e4e",d:`M3,58.3h56.7c1.1,0,2.1-0.9,2.1-2.1V14.3c0-1.1-0.9-2.1-2.1-2.1H31c-0.8,0-1.5-0.4-1.8-1.1l-1.7-3.4
|
|
15
|
-
c-0.4-0.7-1.1-1.1-1.8-1.1H2.1C0.9,6.6,0,7.6,0,8.7v46.6C0,56.9,1.3,58.3,3,58.3z`}),(0,Et.jsx)("path",{fill:"#676666",d:`M64,18.6v35.8c0,1.7-1.3,3-3,3H3c-1.7,0-3-1.3-3-3v-31c0-1.7,1.3-3,3-3h29.2c0.8,0,1.6-0.3,2.1-0.9l3-3
|
|
16
|
-
c0.6-0.6,1.3-0.9,2.1-0.9H61C62.7,15.6,64,17,64,18.6z`}),(0,Et.jsx)("path",{fill:"#6f6d6d",d:`M64,19.5v35.8c0,1.7-1.3,3-3,3H3c-1.7,0-3-1.3-3-3v-31c0-1.7,1.3-3,3-3h29.2c0.8,0,1.6-0.3,2.1-0.9l3-3
|
|
17
|
-
c0.6-0.6,1.3-0.9,2.1-0.9H61C62.7,16.5,64,17.9,64,19.5z`})]}))}var Q=require("react/jsx-runtime");function Xe(e){return(0,Q.jsx)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true"},e),{children:(0,Q.jsxs)("g",{fill:"none",children:[(0,Q.jsx)("path",{d:"M16.2 5C17.8802 5 18.7202 5 19.362 5.32698C19.9265 5.6146 20.3854 6.07354 20.673 6.63803C21 7.27976 21 8.11984 21 9.8V11.2C21 12.8802 21 13.7202 20.673 14.362C20.3854 14.9265 19.9265 15.3854 19.362 15.673C18.7202 16 17.8802 16 16.2 16H7.8C6.11984 16 5.27976 16 4.63803 15.673C4.07354 15.3854 3.6146 14.9265 3.32698 14.362C3 13.7202 3 12.8802 3 11.2L3 6.8C3 5.11984 3 4.27976 3.32698 3.63803C3.6146 3.07354 4.07354 2.6146 4.63803 2.32698C5.27976 2 6.11984 2 7.8 2L9.28741 2C9.91355 2 10.2266 2 10.5108 2.0863C10.7624 2.1627 10.9964 2.28796 11.1996 2.45491C11.429 2.64349 11.6027 2.90398 11.95 3.42496L13 5H16.2Z",fill:"url(#1752500502786-6297956_folder_existing_0_ekojck6b3)","data-glass":"origin",mask:"url(#1752500502786-6297956_folder_mask_2iow0yqdp)"}),(0,Q.jsx)("path",{d:"M16.2 5C17.8802 5 18.7202 5 19.362 5.32698C19.9265 5.6146 20.3854 6.07354 20.673 6.63803C21 7.27976 21 8.11984 21 9.8V11.2C21 12.8802 21 13.7202 20.673 14.362C20.3854 14.9265 19.9265 15.3854 19.362 15.673C18.7202 16 17.8802 16 16.2 16H7.8C6.11984 16 5.27976 16 4.63803 15.673C4.07354 15.3854 3.6146 14.9265 3.32698 14.362C3 13.7202 3 12.8802 3 11.2L3 6.8C3 5.11984 3 4.27976 3.32698 3.63803C3.6146 3.07354 4.07354 2.6146 4.63803 2.32698C5.27976 2 6.11984 2 7.8 2L9.28741 2C9.91355 2 10.2266 2 10.5108 2.0863C10.7624 2.1627 10.9964 2.28796 11.1996 2.45491C11.429 2.64349 11.6027 2.90398 11.95 3.42496L13 5H16.2Z",fill:"url(#1752500502786-6297956_folder_existing_0_ekojck6b3)","data-glass":"clone",filter:"url(#1752500502786-6297956_folder_filter_56qas2ark)",clipPath:"url(#1752500502786-6297956_folder_clipPath_gygn8e14a)"}),(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"url(#1752500502786-6297956_folder_existing_1_v5o9796uz)","data-glass":"blur"}),(0,Q.jsx)("path",{d:"M18.6807 9.00586C19.7975 9.02423 20.4692 9.09846 20.9864 9.39258C21.5915 9.73676 22.0586 10.2802 22.3067 10.9307C22.5894 11.6719 22.4426 12.6251 22.1495 14.5303L21.626 17.9297C21.4038 19.3742 21.2926 20.097 20.9385 20.6396L20.8155 20.8135C20.5147 21.2098 20.1193 21.5262 19.6641 21.7324C19.074 21.9997 18.3431 22 16.8819 22V21.25C17.624 21.25 18.1389 21.2495 18.543 21.2188C18.9374 21.1887 19.1709 21.133 19.3546 21.0498C19.7447 20.873 20.0766 20.5882 20.3106 20.2295C20.4208 20.0606 20.5119 19.8385 20.6016 19.4531C20.6935 19.0584 20.772 18.5489 20.8848 17.8154L21.4083 14.416C21.5568 13.4504 21.6601 12.7732 21.6954 12.2441C21.7302 11.7223 21.6913 11.4231 21.6055 11.1982C21.4194 10.7103 21.0693 10.3021 20.6153 10.0439C20.4061 9.92506 20.1166 9.84086 19.5958 9.7959C19.0675 9.75031 18.3823 9.75 17.4053 9.75H6.59479C5.61785 9.75 4.93266 9.75032 4.40436 9.7959C3.88353 9.84086 3.59399 9.92504 3.38483 10.0439C2.93088 10.3021 2.5807 10.7103 2.3946 11.1982C2.30885 11.4231 2.26996 11.7223 2.30475 12.2441C2.34005 12.7732 2.44331 13.4504 2.59186 14.416L3.1153 17.8154C3.22814 18.5489 3.30665 19.0584 3.3985 19.4531C3.4882 19.8385 3.5793 20.0606 3.68952 20.2295C3.92357 20.5882 4.25545 20.873 4.64558 21.0498C4.82929 21.133 5.06268 21.1887 5.4571 21.2188C5.86121 21.2495 6.37613 21.25 7.11823 21.25V22L6.14948 21.9961C5.44148 21.9856 4.96108 21.9493 4.56452 21.8213L4.336 21.7324C3.88079 21.5262 3.48544 21.2098 3.18464 20.8135L3.06159 20.6396C2.79608 20.2327 2.66703 19.7244 2.52546 18.8867L2.37409 17.9297L1.85065 14.5303C1.57585 12.744 1.42974 11.7947 1.64558 11.0723L1.6944 10.9307C1.91158 10.3615 2.29578 9.8738 2.79401 9.53027L3.01374 9.39258C3.70332 9.00046 4.66737 9 6.59479 9H17.4053L18.6807 9.00586ZM16.8819 21.25V22H7.11823V21.25H16.8819Z",fill:"url(#1752500502786-6297956_folder_existing_2_vhap9347d)"}),(0,Q.jsxs)("defs",{children:[(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_0_ekojck6b3",x1:"12",y1:"2",x2:"12",y2:"16",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#575757"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#151515"})]}),(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_1_v5o9796uz",x1:"23",y1:"15.5",x2:"1",y2:"15.5",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#E3E3E5",stopOpacity:".6"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#BBBBC0",stopOpacity:".6"})]}),(0,Q.jsxs)("linearGradient",{id:"1752500502786-6297956_folder_existing_2_vhap9347d",x1:"12",y1:"9",x2:"12",y2:"16.528",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#fff"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:"0"})]}),(0,Q.jsx)("filter",{id:"1752500502786-6297956_folder_filter_56qas2ark",x:"-100%",y:"-100%",width:"400%",height:"400%",filterUnits:"objectBoundingBox",primitiveUnits:"userSpaceOnUse",children:(0,Q.jsx)("feGaussianBlur",{stdDeviation:"2",x:"0%",y:"0%",width:"100%",height:"100%",in:"SourceGraphic",edgeMode:"none",result:"blur"})}),(0,Q.jsx)("clipPath",{id:"1752500502786-6297956_folder_clipPath_gygn8e14a",children:(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"url(#1752500502786-6297956_folder_existing_1_v5o9796uz)"})}),(0,Q.jsxs)("mask",{id:"1752500502786-6297956_folder_mask_2iow0yqdp",children:[(0,Q.jsx)("rect",{width:"100%",height:"100%",fill:"#FFF"}),(0,Q.jsx)("path",{d:"M17.4051 9C19.3327 9 20.2965 9 20.9861 9.39213C21.5914 9.73631 22.0581 10.2803 22.3062 10.9309C22.5889 11.6721 22.4424 12.6247 22.1492 14.5299L21.6262 17.9299C21.4039 19.3744 21.2928 20.0966 20.9388 20.6393C20.6267 21.1176 20.1846 21.4969 19.6644 21.7326C19.0742 22 18.3435 22 16.882 22L7.11801 22C5.65653 22 4.92579 22 4.33558 21.7326C3.8154 21.4969 3.3733 21.1176 3.06124 20.6393C2.70717 20.0966 2.59606 19.3744 2.37383 17.9299L1.85075 14.5299C1.55764 12.6247 1.41109 11.6721 1.6938 10.9309C1.94194 10.2803 2.40865 9.73631 3.01392 9.39213C3.70353 9 4.66733 9 6.59493 9L17.4051 9Z",fill:"#000"})]})]})]})}))}var Fo=require("react/jsx-runtime");function ra(e){return(0,Fo.jsxs)("svg",s(r({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,Fo.jsx)("path",{opacity:"0.4",d:"M13.4919 2.29395C13.0743 1.94268 12.5457 1.75 11.9997 1.75C11.5221 1.75 11.058 1.89775 10.6697 2.16992L10.5085 2.29395L1.5974 9.78906C1.18491 10.1364 1.13178 10.7528 1.47924 11.165C1.78946 11.5327 2.31307 11.6121 2.71557 11.3789V15.9531V15.955C2.71555 17.0543 2.71553 17.9612 2.7976 18.6885C2.88313 19.4463 3.06823 20.1292 3.52318 20.7217L3.68627 20.9199C3.85487 21.1119 4.04268 21.2876 4.24584 21.4434L4.47143 21.6016C5.01004 21.9427 5.61706 22.0932 6.281 22.168C7.00121 22.2491 7.89724 22.249 8.98176 22.249H8.99975H14.9997H15.0178C16.1023 22.249 16.9983 22.2491 17.7185 22.168C18.4771 22.0825 19.1606 21.8977 19.7537 21.4434L19.9529 21.2803C20.145 21.1119 20.3205 20.9245 20.4763 20.7217L20.6345 20.4961C20.976 19.9581 21.127 19.3517 21.2019 18.6885C21.284 17.9612 21.2839 17.0543 21.2839 15.955V15.9531V11.3789C21.6864 11.6121 22.21 11.5327 22.5203 11.165C22.846 10.7785 22.8199 10.2127 22.4753 9.85742L13.4919 2.29395Z",fill:"#141B34"}),(0,Fo.jsx)("path",{d:"M14.9998 17V22.249H8.99979V17C8.99979 15.5859 9.00002 14.8788 9.43924 14.4395C9.87855 14.0001 10.5857 14 11.9998 14C13.4139 14 14.121 14.0002 14.5603 14.4395C14.9997 14.8788 14.9998 15.5858 14.9998 17Z",fill:"#141B34"})]}))}var Ta=require("react/jsx-runtime");function Fe(e){return(0,Ta.jsx)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 48 48","aria-hidden":"true"},e),{children:(0,Ta.jsx)("path",{fill:"currentColor",d:"M46.599 46.599a4.498 4.498 0 0 1-6.363 0l-7.941-7.941C29.028 40.749 25.167 42 21 42 9.402 42 0 32.598 0 21S9.402 0 21 0s21 9.402 21 21c0 4.167-1.251 8.028-3.342 11.295l7.941 7.941a4.498 4.498 0 0 1 0 6.363zM21 6C12.717 6 6 12.714 6 21s6.717 15 15 15c8.286 0 15-6.714 15-15S29.286 6 21 6z"})}))}var Mo=require("react/jsx-runtime");function et(e){return(0,Mo.jsxs)("svg",s(r({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,Mo.jsx)("path",{fill:"currentColor",opacity:"0.4",d:"M20.4155 3.66085C22.3012 5.52939 19.2842 20.7253 16.1883 20.9931C13.5911 21.2177 12.7819 16.0954 12.2348 14.4719C11.695 12.8696 11.0943 12.2927 9.50513 11.767C5.46811 10.4315 3.4496 9.76374 3.04996 8.70639C1.99171 5.90649 18.0071 1.27438 20.4155 3.66085Z"}),(0,Mo.jsx)("path",{fill:"currentColor",d:"M3.04996 8.70639C3.4496 9.76374 5.46811 10.4315 9.50513 11.767C10.3308 12.0402 10.8897 12.3271 11.3118 12.7646L20.4155 3.66085C18.0071 1.27438 1.99171 5.90649 3.04996 8.70639Z"})]}))}var gr=require("react/jsx-runtime");var ko=require("react/jsx-runtime");function Lt(e){return(0,ko.jsxs)("svg",s(r({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),{children:[(0,ko.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.75 11.7499C18.3023 11.7499 18.75 12.1977 18.75 12.7499V15.7499H21.75C22.3023 15.7499 22.75 16.1977 22.75 16.7499C22.75 17.3022 22.3023 17.7499 21.75 17.7499H18.75V20.7499C18.75 21.3022 18.3023 21.7499 17.75 21.7499C17.1977 21.7499 16.75 21.3022 16.75 20.7499V17.7499H13.75C13.1977 17.7499 12.75 17.3022 12.75 16.7499C12.75 16.1977 13.1977 15.7499 13.75 15.7499H16.75V12.7499C16.75 12.1977 17.1977 11.7499 17.75 11.7499Z",fill:"currentColor"}),(0,ko.jsx)("path",{opacity:"0.4",d:"M9.4626 2.48876C8.82373 2.24919 8.11205 2.24951 7.08264 2.24996C6.2039 2.24995 5.32205 2.24999 4.7497 2.30044C4.15996 2.35243 3.64388 2.46238 3.17258 2.7254C2.56533 3.06428 2.06428 3.56534 1.7254 4.17258C1.46238 4.64388 1.35242 5.15996 1.30044 5.7497C1.24999 6.32205 1.24999 7.03077 1.25 7.9095V11.0574C1.24999 13.3658 1.24998 15.1748 1.43975 16.5863C1.63399 18.031 2.03933 19.1711 2.93414 20.0659C3.82895 20.9607 4.96897 21.366 6.41371 21.5603C7.82519 21.75 9.63423 21.75 11.9426 21.75H13.2923C14.1084 21.75 14.8409 21.75 15.5 21.7383V18.9999H13.75C12.5074 18.9999 11.5 17.9926 11.5 16.7499C11.5 15.5073 12.5074 14.4999 13.75 14.4999H15.5V12.7499C15.5 11.5073 16.5074 10.4999 17.75 10.4999C18.9926 10.4999 20 11.5073 20 12.7499V14.4999H22.7383C22.75 13.8408 22.75 13.1084 22.75 12.2923C22.75 11.2733 22.75 10.3688 22.683 9.70949C22.6137 9.02893 22.4669 8.43872 22.118 7.91661C21.8444 7.50715 21.4929 7.15559 21.0834 6.88199C20.5613 6.53313 19.9711 6.38628 19.2905 6.31705C18.6312 6.24998 17.8095 6.24999 16.7905 6.25L13.2361 6.25C12.92 6.25 12.7396 6.24908 12.6064 6.23531C12.5044 6.22817 12.4348 6.15255 12.4128 6.11563C12.3409 6.0027 12.0838 5.48909 11.9425 5.20636C11.4704 4.25121 10.8581 3.01205 9.4626 2.48876Z",fill:"currentColor"})]}))}var Ea=require("react/jsx-runtime");function ct(e){return(0,Ea.jsx)("svg",s(r({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,Ea.jsx)("path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"#141B34",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))}var La=require("react/jsx-runtime");function lo(e){return(0,La.jsx)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),{children:(0,La.jsx)("path",{fill:"currentColor",d:"M16.62 2.99c-.49-.49-1.28-.49-1.77 0L6.54 11.3c-.39.39-.39 1.02 0 1.41l8.31 8.31c.49.49 1.28.49 1.77 0s.49-1.28 0-1.77L9.38 12l7.25-7.25c.48-.48.48-1.28-.01-1.76z"})}))}var Aa=require("react/jsx-runtime");function At(e){return(0,Aa.jsx)("svg",s(r({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:(0,Aa.jsx)("path",{fill:"currentColor",d:"M19,11H13V5a1,1,0,0,0-2,0v6H5a1,1,0,0,0,0,2h6v6a1,1,0,0,0,2,0V13h6a1,1,0,0,0,0-2Z"})}))}var so=require("react/jsx-runtime");function Ue(e){return(0,so.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),{children:[(0,so.jsx)("path",{fill:"currentColor",d:"M3 6.386c0-.484.345-.877.771-.877h2.665c.529-.016.996-.399 1.176-.965l.03-.1l.115-.391c.07-.24.131-.45.217-.637c.338-.739.964-1.252 1.687-1.383c.184-.033.378-.033.6-.033h3.478c.223 0 .417 0 .6.033c.723.131 1.35.644 1.687 1.383c.086.187.147.396.218.637l.114.391l.03.1c.18.566.74.95 1.27.965h2.57c.427 0 .772.393.772.877s-.345.877-.771.877H3.77c-.425 0-.77-.393-.77-.877"}),(0,so.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.425 11.482c.413-.044.78.273.821.707l.5 5.263c.041.433-.26.82-.671.864c-.412.043-.78-.273-.821-.707l-.5-5.263c-.041-.434.26-.821.671-.864m5.15 0c.412.043.713.43.671.864l-.5 5.263c-.04.434-.408.75-.82.707c-.413-.044-.713-.43-.672-.864l.5-5.264c.041-.433.409-.75.82-.707",clipRule:"evenodd"}),(0,so.jsx)("path",{fill:"currentColor",d:"M11.596 22h.808c2.783 0 4.174 0 5.08-.886c.904-.886.996-2.339 1.181-5.245l.267-4.188c.1-1.577.15-2.366-.303-2.865c-.454-.5-1.22-.5-2.753-.5H8.124c-1.533 0-2.3 0-2.753.5s-.404 1.288-.303 2.865l.267 4.188c.185 2.906.277 4.36 1.182 5.245c.905.886 2.296.886 5.079.886",opacity:"0.5"})]}))}var Do=require("react/jsx-runtime");function je(e){return(0,Do.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:3.5,strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[(0,Do.jsx)("path",{d:"M18 6L6 18"}),(0,Do.jsx)("path",{d:"M6 6L18 18"})]}))}var _t=require("react/jsx-runtime");function na(e){return(0,_t.jsxs)("svg",s(r({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"},e),{children:[(0,_t.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,_t.jsx)("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),(0,_t.jsx)("path",{d:"M7 11l5 5l5 -5"}),(0,_t.jsx)("path",{d:"M12 4l0 12"})]}))}var Vt=require("react/jsx-runtime");function ia(e){return(0,Vt.jsxs)("svg",s(r({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"},e),{children:[(0,Vt.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Vt.jsx)("path",{d:"M9 15l6 -6"}),(0,Vt.jsx)("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),(0,Vt.jsx)("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"})]}))}var _a=require("react/jsx-runtime");function la(e){return(0,_a.jsx)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:(0,_a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.944 1.25H10a.75.75 0 0 1 0 1.5c-1.907 0-3.261.002-4.29.14c-1.005.135-1.585.389-2.008.812S3.025 4.705 2.89 5.71c-.138 1.029-.14 2.383-.14 4.29a.75.75 0 0 1-1.5 0v-.056c0-1.838 0-3.294.153-4.433c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c1.14-.153 2.595-.153 4.433-.153m8.345 1.64c-1.027-.138-2.382-.14-4.289-.14a.75.75 0 0 1 0-1.5h.056c1.838 0 3.294 0 4.433.153c1.172.158 2.121.49 2.87 1.238c.748.749 1.08 1.698 1.238 2.87c.153 1.14.153 2.595.153 4.433V10a.75.75 0 0 1-1.5 0c0-1.907-.002-3.261-.14-4.29c-.135-1.005-.389-1.585-.812-2.008s-1.003-.677-2.009-.812M2 13.25a.75.75 0 0 1 .75.75c0 1.907.002 3.262.14 4.29c.135 1.005.389 1.585.812 2.008s1.003.677 2.009.812c1.028.138 2.382.14 4.289.14a.75.75 0 0 1 0 1.5h-.056c-1.838 0-3.294 0-4.433-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433V14a.75.75 0 0 1 .75-.75m20 0a.75.75 0 0 1 .75.75v.056c0 1.838 0 3.294-.153 4.433c-.158 1.172-.49 2.121-1.238 2.87c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153H14a.75.75 0 0 1 0-1.5c1.907 0 3.262-.002 4.29-.14c1.005-.135 1.585-.389 2.008-.812s.677-1.003.812-2.009c.138-1.027.14-2.382.14-4.289a.75.75 0 0 1 .75-.75",clipRule:"evenodd"})}))}var Io=require("react/jsx-runtime");function tt(e){return(0,Io.jsxs)("svg",s(r({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"},e),{children:[(0,Io.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,Io.jsx)("path",{d:"M5 12l5 5l10 -10"})]}))}var Va=require("react/jsx-runtime");function co(e){return(0,Va.jsx)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),{children:(0,Va.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10m-5.97-3.03a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l1.47 1.47l2.235-2.235L14.97 8.97a.75.75 0 0 1 1.06 0",clipRule:"evenodd"})}))}var Ga=require("react/jsx-runtime");function po(e){return(0,Ga.jsx)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"100",height:"100",viewBox:"0 0 72 72",fill:"currentColor"},e),{children:(0,Ga.jsx)("path",{d:"M38.406 22.234l11.36 11.36L28.784 54.576l-12.876 4.307c-1.725.577-3.367-1.065-2.791-2.79l4.307-12.876L38.406 22.234zM41.234 19.406l5.234-5.234c1.562-1.562 4.095-1.562 5.657 0l5.703 5.703c1.562 1.562 1.562 4.095 0 5.657l-5.234 5.234L41.234 19.406z"})}))}var uo=require("react/jsx-runtime");function Gt(e){return(0,uo.jsxs)("svg",s(r({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"},e),{children:[(0,uo.jsx)("circle",{cx:"12",cy:"12",r:"1"}),(0,uo.jsx)("circle",{cx:"19",cy:"12",r:"1"}),(0,uo.jsx)("circle",{cx:"5",cy:"12",r:"1"})]}))}var Oa=require("react/jsx-runtime");function sa(e){return(0,Oa.jsx)("svg",s(r({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"},e),{children:(0,Oa.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 6.75a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zm0 14a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM13.75 12a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0z",fill:"#000000"})}))}var Ba=require("react/jsx-runtime");function da(e){return(0,Ba.jsx)("svg",s(r({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"},e),{children:(0,Ba.jsx)("path",{d:"M18 11h-12c-1.104 0-2 .896-2 2s.896 2 2 2h12c1.104 0 2-.896 2-2s-.896-2-2-2z"})}))}var Oe=require("react/jsx-runtime");function ge(e){return(0,Oe.jsxs)("svg",s(r({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"},e),{children:[(0,Oe.jsx)("path",{d:"M12 3L12 6",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Oe.jsx)("path",{d:"M21 12L18 12",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Oe.jsx)("path",{d:"M12 21L12 18",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Oe.jsx)("path",{d:"M3 12L6 12",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Oe.jsx)("path",{d:"M5.63586 5.63605L7.75718 7.75737",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Oe.jsx)("path",{d:"M18.3639 5.63605L16.2426 7.75737",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Oe.jsx)("path",{d:"M18.3641 18.3639L16.2428 16.2426",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Oe.jsx)("path",{d:"M5.63623 18.3639L7.75755 16.2426",stroke:"#000000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))}var Ha=require("react/jsx-runtime");function No(e){return(0,Ha.jsx)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},e),{children:(0,Ha.jsx)("path",{d:"M21.4086 9.35258C23.5305 10.5065 23.5305 13.4935 21.4086 14.6474L8.59662 21.6145C6.53435 22.736 4 21.2763 4 18.9671V5.0329C4 2.72368 6.53435 1.26402 8.59661 2.38548L21.4086 9.35258Z"})}))}var Za=require("react/jsx-runtime");function ca(e){return(0,Za.jsx)("svg",s(r({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"},e),{children:(0,Za.jsx)("path",{clipRule:"evenodd",d:"M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16ZM7 9V3H9V9H7ZM7 13V11H9V13H7Z",fill:"#030708",fillRule:"evenodd"})}))}var Ot=require("react/jsx-runtime");function mo(e){return(0,Ot.jsxs)("svg",s(r({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"},e),{children:[(0,Ot.jsx)("path",{id:"primary",d:"M14,18H9A6,6,0,0,1,5.54,7.11",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),(0,Ot.jsx)("path",{id:"primary-2","data-name":"primary",d:"M10,6h5a6,6,0,0,1,3.46,10.89",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),(0,Ot.jsx)("polyline",{id:"primary-3","data-name":"primary",points:"12 16 14 18 12 20",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),(0,Ot.jsx)("polyline",{id:"primary-4","data-name":"primary",points:"12 8 10 6 12 4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]}))}var Di=require("react/jsx-runtime");var Ua=require("react/jsx-runtime");function pa(e){return(0,Ua.jsx)("svg",s(r({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"},e),{children:(0,Ua.jsx)("path",{d:"M9.821,118.048h104.4c7.3,0,12-7.7,8.7-14.2l-52.2-92.5c-3.601-7.199-13.9-7.199-17.5,0l-52.2,92.5 C-2.179,110.348,2.521,118.048,9.821,118.048z M70.222,96.548c0,4.8-3.5,8.5-8.5,8.5s-8.5-3.7-8.5-8.5v-0.2c0-4.8,3.5-8.5,8.5-8.5 s8.5,3.7,8.5,8.5V96.548z M57.121,34.048h9.801c2.699,0,4.3,2.3,4,5.2l-4.301,37.6c-0.3,2.7-2.1,4.4-4.6,4.4s-4.3-1.7-4.6-4.4 l-4.301-37.6C52.821,36.348,54.422,34.048,57.121,34.048z"})}))}var pt=require("react/jsx-runtime"),hr=o=>{var a=o,{className:e}=a,t=f(a,["className"]);return(0,pt.jsx)("nav",r({"data-slot":"pagination",role:"navigation","aria-label":"pagination",className:v("mx-auto flex w-full justify-center",e)},t))};function vr(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,pt.jsx)("ul",r({"data-slot":"pagination-content",className:v("flex flex-row items-center gap-1",e)},t))}function Po(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,pt.jsx)("li",r({"data-slot":"pagination-item",className:v("",e)},t))}var xr=o=>{var a=o,{className:e}=a,t=f(a,["className"]);return(0,pt.jsxs)("span",s(r({"data-slot":"pagination-ellipsis","aria-hidden":!0,className:v("flex h-9 w-9 items-center justify-center",e)},t),{children:[(0,pt.jsx)(Gt,{className:"h-4 w-4"}),(0,pt.jsx)("span",{className:"sr-only",children:"More pages"})]}))};var br=require("class-variance-authority");var wr=require("radix-ui");var Cr=require("react/jsx-runtime"),Ni=(0,br.cva)("cursor-pointer group whitespace-nowrap focus-visible:outline-hidden inline-flex items-center justify-center has-data-[arrow=true]:justify-between whitespace-nowrap text-sm font-medium ring-offset-background transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-60 [&_svg]:shrink-0",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90 data-[state=open]:bg-primary/90",mono:"bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black hover:bg-zinc-950/90 dark:hover:bg-zinc-300/90 data-[state=open]:bg-zinc-950/90 dark:data-[state=open]:bg-zinc-300/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 data-[state=open]:bg-destructive/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/90 data-[state=open]:bg-secondary/90",outline:"bg-background text-accent-foreground border border-input hover:bg-accent data-[state=open]:bg-accent",dashed:"text-accent-foreground border border-input border-dashed bg-background hover:bg-accent hover:text-accent-foreground data-[state=open]:text-accent-foreground",ghost:"text-accent-foreground hover:bg-accent hover:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",dim:"text-muted-foreground hover:text-foreground data-[state=open]:text-foreground",foreground:"",inverse:""},appearance:{default:"",ghost:""},underline:{solid:"",dashed:""},underlined:{solid:"",dashed:""},size:{lg:"h-10 px-4 text-sm gap-1.5 [&_svg:not([class*=size-])]:size-4",md:"h-9 px-3 gap-1.5 text-sm [&_svg:not([class*=size-])]:size-4",sm:"h-8 px-2.5 gap-1.25 text-xs [&_svg:not([class*=size-])]:size-3.5",xs:"h-7 px-2 gap-1 text-xs [&_svg:not([class*=size-])]:size-3.5",icon:"size-9 [&_svg:not([class*=size-])]:size-4 shrink-0"},autoHeight:{true:"",false:""},radius:{md:"rounded-md",full:"rounded-full"},mode:{default:"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",icon:"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 shrink-0",link:"text-primary h-auto p-0 bg-transparent rounded-none hover:bg-transparent data-[state=open]:bg-transparent",input:`
|
|
1
|
+
'use strict';var chunkS4HRPNKF_js=require('./chunk-S4HRPNKF.js'),Fi=require('react'),navigation=require('next/navigation'),sonner=require('sonner'),jsxRuntime=require('react/jsx-runtime'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),radixUi=require('radix-ui'),Me=require('@radix-ui/react-tooltip'),cmdk=require('cmdk'),q=require('@radix-ui/react-context-menu');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Fi__default=/*#__PURE__*/_interopDefault(Fi);var Me__namespace=/*#__PURE__*/_interopNamespace(Me);var q__namespace=/*#__PURE__*/_interopNamespace(q);var Mo=(e,t)=>{let a=[...e];return t.forEach(o=>{a.some(n=>n.id===o.id)?a=a.filter(n=>n.id!==o.id):a.push(o);}),a},sa=(e,t)=>{let a=[...e];return t.forEach(o=>{a.some(n=>n.id===o.id)?a=a.filter(n=>n.id!==o.id):a.push(o);}),a};function la(e){let{mode:t,selectionMode:a,files:o,folders:r,selectedFiles:n,selectedFolders:s,currentFolder:m,setSelectedFiles:l,setSelectedFolders:v,setCurrentFolder:u,setFiles:x,setFolders:c,setPagination:w,loadData:F,isInSelectionMode:M,provider:C,onFilesSelected:N,onClose:D,basePath:k,setIsLoading:b,setFileDetailsModalFile:S}=e,j=navigation.useRouter(),J=Fi.useCallback((P,z,O=false)=>{let V=[P];if(O||z&&(z.metaKey||z.ctrlKey)){l(K=>Mo(K,V));return}if(M()&&t!==chunkS4HRPNKF_js.d.MODAL){l(K=>Mo(K,V));return}if(t===chunkS4HRPNKF_js.d.MODAL){a==="single"?(l([P]),N==null||N([P]),D==null||D()):l(K=>Mo(K,V));return}S(P);},[t,a,M,l,N,D,S]),te=Fi.useCallback((P,z,O=false)=>{let V=P?P.id:null;if((O||z&&(z.metaKey||z.ctrlKey))&&P){v(K=>sa(K,[P]));return}if(M()&&P){v(K=>sa(K,[P]));return}if(t===chunkS4HRPNKF_js.d.PAGE){b(true);let K=k!=null?k:"/media",he=V===null?K:`${K}/${V}`;j.push(he);}else {b(true),l([]),v([]);let K=new URLSearchParams(window.location.search);V===null?K.delete("folderId"):K.set("folderId",String(V)),K.set("page","1");let he=`${window.location.pathname}?${K.toString()}`;j.push(he,{scroll:false});}},[M,t,j,v,l,k,b]),ve=Fi.useCallback(()=>{l([]),v([]);},[l,v]),d=Fi.useCallback(P=>{P?(l(o),v(t===chunkS4HRPNKF_js.d.PAGE?r:[])):(l([]),v([]));},[o,r,t,l,v]),I=Fi.useCallback(async(P=false)=>{await F(P);},[F]),g=Fi.useCallback(async P=>{var z;try{await C.uploadFiles(P,(z=m==null?void 0:m.id)!=null?z:null),await I(!0),l([]),sonner.toast.success("Upload Successful",{description:`${P.length} file(s) uploaded successfully`});}catch(O){let V=O instanceof Error?O.message:"Failed to upload files";sonner.toast.error("Upload Failed",{description:V}),console.error("Upload failed:",O);}},[m,C,I,l]),R=Fi.useCallback(async P=>{var z;try{await C.createFolder(P,(z=m==null?void 0:m.id)!=null?z:null),await I(!0),l([]),sonner.toast.success("Folder Created",{description:`Folder "${P}" created successfully`});}catch(O){let V=O instanceof Error?O.message:"Failed to create folder";sonner.toast.error("Create Folder Failed",{description:V}),console.error("Failed to create folder:",O);}},[m,C,I,l]),T=Fi.useCallback(async P=>{try{n.length>0&&await C.moveFiles(n.map(O=>O.id),P),s.length>0&&await C.moveFolders(s.map(O=>O.id),P),await I(!0),l([]),v([]);let z=n.length+s.length;sonner.toast.success("Move Successful",{description:`${z} item(s) moved successfully`});}catch(z){let O=z instanceof Error?z.message:"Failed to move items";sonner.toast.error("Move Failed",{description:O}),console.error("Failed to move items:",z);}},[n,s,C,I,l,v]),A=Fi.useCallback(async(P,z)=>{try{c(O=>O.map(V=>V.id===P?chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},V),{name:z}):V)),await C.renameFolder(P,z),await I(!0),sonner.toast.success("Folder Renamed",{description:`Folder renamed to "${z}"`});}catch(O){let V=O instanceof Error?O.message:"Failed to rename folder";sonner.toast.error("Rename Failed",{description:V}),console.error("Failed to rename folder:",O);}},[C,I]),de=Fi.useCallback(async(P,z)=>{try{x(O=>O.map(V=>{if(V.id===P){let Ve=z,{metaData:K}=Ve,he=chunkS4HRPNKF_js.c(Ve,["metaData"]);return chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a(chunkS4HRPNKF_js.a({},V),he),{metaData:K?chunkS4HRPNKF_js.a(chunkS4HRPNKF_js.a({},V.metaData),K):V.metaData})}return V})),await C.updateFileMetaData(P,z),await I(!0);}catch(O){let V=O instanceof Error?O.message:"Failed to update metadata";sonner.toast.error("Update Failed",{description:V}),console.error("Failed to update metadata:",O);}},[C,I]),yt=Fi.useCallback(async()=>{try{n.length>0&&await C.deleteFiles(n.map(z=>z.id)),s.length>0&&await C.deleteFolders(s.map(z=>z.id)),await I(!0),l([]),v([]);let P=n.length+s.length;sonner.toast.success("Delete Successful",{description:`${P} item(s) deleted successfully`});}catch(P){let z=P instanceof Error?P.message:"Failed to delete items";sonner.toast.error("Delete Failed",{description:z}),console.error("Failed to delete items:",P);}},[n,s,C,I,l,v]);return {handleFileClick:J,handleFolderClick:te,handleClearSelection:ve,handleSelectAllGlobal:d,uploadFiles:g,createFolder:R,bulkMove:T,renameFolder:A,updateFileMetadata:de,bulkDelete:yt,refreshData:I}}function ma(e){let{mode:t,selectionMode:a,initialFolderId:o,acceptedFileTypesForModal:r,allowedFileTypes:n,provider:s,onFilesSelected:m,onClose:l,basePath:v}=e,u=navigation.useParams(),x=navigation.useSearchParams(),c=navigation.useRouter(),w=navigation.usePathname(),F=Math.max(1,parseInt(x.get("page")||"1",10)),M=Math.max(1,parseInt(x.get("limit")||"24",10)),C=x.get("query")||"",N=Fi.useMemo(()=>{if(t===chunkS4HRPNKF_js.d.PAGE&&(u!=null&&u.path)){let L=Array.isArray(u.path)?u.path[0]:u.path;return typeof L=="string"&&/^\d+$/.test(L)?Number(L):null}if(t===chunkS4HRPNKF_js.d.MODAL){let L=x.get("folderId");if(L&&/^\d+$/.test(L))return Number(L)}return o!=null?o:null},[t,u,x,o]),[D,k]=Fi.useState([]),[b,S]=Fi.useState([]),[j,J]=Fi.useState([]),[te,ve]=Fi.useState([]),[d,I]=Fi.useState(null),[g,R]=Fi.useState(true),[T,A]=Fi.useState({currentPage:F,totalPages:1,totalFiles:0,filesPerPage:M}),de=Fi.useRef(null);de.current=d;let[yt,P]=Fi.useState(C),[z,O]=Fi.useState(C);Fi.useEffect(()=>{let L=setTimeout(()=>{O(yt);},300);return ()=>clearTimeout(L)},[yt]);let V=Fi.useRef(N),Ve=Fi.useCallback((L,ae)=>{let re=new URLSearchParams(x.toString());re.set("page",L.toString()),re.set("limit",ae.toString()),c.push(`${w}?${re.toString()}`,{scroll:false});},[c,w]);Fi.useEffect(()=>{A(L=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},L),{currentPage:F,filesPerPage:M})),P(C);},[F,M,C]),Fi.useEffect(()=>{N!==V.current&&(t===chunkS4HRPNKF_js.d.PAGE&&Ve(1,M),V.current=N);},[N,M,Ve,t]);let K=T.currentPage,he=T.filesPerPage;Fi.useEffect(()=>{let L=false,ae=async()=>{if(N&&(!de.current||de.current.id!==N))try{R(!0);let ne=await s.getFolder(N);if(L)return;I(ne),await re(ne);}catch(ne){let Jt=ne instanceof Error?ne.message:"Failed to load folder";if(sonner.toast.error("Load Folder Failed",{description:Jt}),console.error("Failed to fetch current folder",ne),L)return;I(null),L||R(false);}else N===null&&de.current!==null?(I(null),await re(null)):de.current?await re(de.current):await re(null);},re=async ne=>{var Jt;if(!L){R(true);try{let ut=[];t===chunkS4HRPNKF_js.d.MODAL?ut=r:ut=n;let Lt=await s.getItems((Jt=ne==null?void 0:ne.id)!=null?Jt:null,ut,K,he,z);if(L)return;S(Lt.folders),k(Lt.files),A(Lt.pagination);}catch(ut){let Lt=ut instanceof Error?ut.message:"Failed to load data";sonner.toast.error("Load Data Failed",{description:Lt}),console.error("Failed to load data:",ut);}finally{L||R(false);}}};return ae(),()=>{L=true;}},[N,s,t,r,n,K,he,z]),Fi.useEffect(()=>{ve([]),J([]);},[d]);let[zr,Rr]=Fi.useState(false),[Tr,Er]=Fi.useState(false),[Lr,_r]=Fi.useState(false),[Ar,Or]=Fi.useState(false),[Br,Vr]=Fi.useState(false),[Gr,Ur]=Fi.useState(null),[Hr,$r]=Fi.useState(null),Kr=Fi.useCallback(async(L=false)=>{var ae;L||R(true);try{let re=[];t===chunkS4HRPNKF_js.d.MODAL?re=r:re=n;let ne=await s.getItems((ae=d==null?void 0:d.id)!=null?ae:null,re,K,he,z);S(ne.folders),k(ne.files),A(ne.pagination);}catch(re){let ne=re instanceof Error?re.message:"Failed to load data";sonner.toast.error("Load Data Failed",{description:ne}),console.error("Failed to load data:",re);}finally{L||R(false);}},[d,t,r,n,s,K,he,z]),Wr=()=>j.length>0||te.length>0,jr=()=>d,Qr=Fi.useMemo(()=>()=>{let L=D.length+(t===chunkS4HRPNKF_js.d.PAGE?b.length:0),ae=j.length+te.length;return ae===0?false:ae===L?true:"indeterminate"},[D.length,b.length,j.length,te.length,t]),Yr=Fi.useCallback(L=>{A(ae=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},ae),{currentPage:L})),t===chunkS4HRPNKF_js.d.PAGE&&Ve(L,he);},[Ve,he,t]),qr=Fi.useCallback(L=>{P(L);let ae=new URLSearchParams(x.toString());L.trim()?(ae.set("query",L),ae.set("page","1")):ae.delete("query"),c.push(`${w}?${ae.toString()}`,{scroll:false});},[c,w,x]);return {files:D,folders:b,selectedFiles:j,selectedFolders:te,currentFolder:d,isLoading:g,pagination:T,isUploadModalOpen:zr,isCreateFolderModalOpen:Tr,isSearchModalOpen:Lr,isMoveFileModalOpen:Ar,isRenameFolderModalOpen:Br,fileDetailsModalFile:Hr,folderToRename:Gr,setFiles:k,setFolders:S,setSelectedFiles:J,setSelectedFolders:ve,setCurrentFolder:I,setPagination:A,setIsUploadModalOpen:Rr,setIsCreateFolderModalOpen:Er,setIsSearchModalOpen:_r,setIsMoveFileModalOpen:Or,setIsRenameFolderModalOpen:Vr,setFileDetailsModalFile:$r,setFolderToRename:Ur,loadData:Kr,setIsLoading:R,isInSelectionMode:Wr,getCurrentFolder:jr,getSelectionState:Qr,handlePageChange:Yr,searchQuery:yt,updateSearchQuery:qr,mode:t,selectionMode:a,acceptedFileTypesForModal:r,provider:s,onFilesSelected:m,onClose:l,basePath:v}}var ua=Fi.createContext(void 0);function no({children:e,mode:t=chunkS4HRPNKF_js.d.PAGE,selectionMode:a=chunkS4HRPNKF_js.f.SINGLE,allowedFileTypes:o,onFilesSelected:r,onClose:n,acceptedFileTypesForModal:s,initialFolderId:m=null,provider:l,basePath:v="/media",maxUploadFiles:u=50,maxUploadSize:x=100*1024*1024}){let c=ma({mode:t,selectionMode:a,initialFolderId:m,acceptedFileTypesForModal:s,allowedFileTypes:o,provider:l,onFilesSelected:r,onClose:n,basePath:v}),w=la(c),F=Fi.useMemo(()=>({files:c.files,folders:c.folders,selectedFiles:c.selectedFiles,selectedFolders:c.selectedFolders,currentFolder:c.currentFolder,isLoading:c.isLoading,pagination:c.pagination,isUploadModalOpen:c.isUploadModalOpen,isCreateFolderModalOpen:c.isCreateFolderModalOpen,isSearchModalOpen:c.isSearchModalOpen,isMoveFileModalOpen:c.isMoveFileModalOpen,isRenameFolderModalOpen:c.isRenameFolderModalOpen,fileDetailsModalFile:c.fileDetailsModalFile,folderToRename:c.folderToRename,mode:c.mode,selectionMode:c.selectionMode,allowedFileTypes:o,acceptedFileTypesForModal:c.acceptedFileTypesForModal,maxUploadFiles:u,maxUploadSize:x,setIsUploadModalOpen:c.setIsUploadModalOpen,setIsCreateFolderModalOpen:c.setIsCreateFolderModalOpen,setIsSearchModalOpen:c.setIsSearchModalOpen,setIsMoveFileModalOpen:c.setIsMoveFileModalOpen,setSelectedFiles:c.setSelectedFiles,setSelectedFolders:c.setSelectedFolders,setIsRenameFolderModalOpen:c.setIsRenameFolderModalOpen,setFileDetailsModalFile:c.setFileDetailsModalFile,setFolderToRename:c.setFolderToRename,handleFileClick:w.handleFileClick,handleFolderClick:w.handleFolderClick,handleClearSelection:w.handleClearSelection,handleSelectAllGlobal:w.handleSelectAllGlobal,handlePageChange:c.handlePageChange,searchQuery:c.searchQuery,updateSearchQuery:c.updateSearchQuery,uploadFiles:w.uploadFiles,createFolder:w.createFolder,bulkMove:w.bulkMove,renameFolder:w.renameFolder,updateFileMetadata:w.updateFileMetadata,bulkDelete:w.bulkDelete,refreshData:w.refreshData,isInSelectionMode:c.isInSelectionMode,getCurrentFolder:c.getCurrentFolder,getSelectionState:c.getSelectionState,onClose:c.onClose,onFilesSelected:c.onFilesSelected,provider:l,basePath:c.basePath}),[c,w,l,o,u,x]);return jsxRuntime.jsx(ua.Provider,{value:F,children:e})}function E(){let e=Fi.useContext(ua);if(e===void 0)throw new Error("useFileManager must be used within a FileManagerProvider");return e}function f(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var pa=a=>{var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("nav",chunkS4HRPNKF_js.a({"data-slot":"pagination",role:"navigation","aria-label":"pagination",className:f("mx-auto flex w-full justify-center",e)},t))};function fa(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("ul",chunkS4HRPNKF_js.a({"data-slot":"pagination-content",className:f("flex flex-row items-center gap-1",e)},t))}function Ut(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("li",chunkS4HRPNKF_js.a({"data-slot":"pagination-item",className:f("",e)},t))}var ga=a=>{var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsxs("span",chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({"data-slot":"pagination-ellipsis","aria-hidden":true,className:f("flex h-9 w-9 items-center justify-center",e)},t),{children:[jsxRuntime.jsx(chunkS4HRPNKF_js.z,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"More pages"})]}))};var un=classVarianceAuthority.cva("cursor-pointer group whitespace-nowrap focus-visible:outline-hidden inline-flex items-center justify-center has-data-[arrow=true]:justify-between whitespace-nowrap text-sm font-medium ring-offset-background transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-60 [&_svg]:shrink-0",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90 data-[state=open]:bg-primary/90",mono:"bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black hover:bg-zinc-950/90 dark:hover:bg-zinc-300/90 data-[state=open]:bg-zinc-950/90 dark:data-[state=open]:bg-zinc-300/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 data-[state=open]:bg-destructive/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/90 data-[state=open]:bg-secondary/90",outline:"bg-background text-accent-foreground border border-input hover:bg-accent data-[state=open]:bg-accent",dashed:"text-accent-foreground border border-input border-dashed bg-background hover:bg-accent hover:text-accent-foreground data-[state=open]:text-accent-foreground",ghost:"text-accent-foreground hover:bg-accent hover:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",dim:"text-muted-foreground hover:text-foreground data-[state=open]:text-foreground",foreground:"",inverse:""},appearance:{default:"",ghost:""},underline:{solid:"",dashed:""},underlined:{solid:"",dashed:""},size:{lg:"h-10 px-4 text-sm gap-1.5 [&_svg:not([class*=size-])]:size-4",md:"h-9 px-3 gap-1.5 text-sm [&_svg:not([class*=size-])]:size-4",sm:"h-8 px-2.5 gap-1.25 text-xs [&_svg:not([class*=size-])]:size-3.5",xs:"h-7 px-2 gap-1 text-xs [&_svg:not([class*=size-])]:size-3.5",icon:"size-9 [&_svg:not([class*=size-])]:size-4 shrink-0"},autoHeight:{true:"",false:""},radius:{md:"rounded-md",full:"rounded-full"},mode:{default:"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",icon:"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 shrink-0",link:"text-primary h-auto p-0 bg-transparent rounded-none hover:bg-transparent data-[state=open]:bg-transparent",input:`
|
|
18
2
|
justify-start font-normal hover:bg-background [&_svg]:transition-colors [&_svg]:hover:text-foreground data-[state=open]:bg-background
|
|
19
3
|
focus-visible:border-ring focus-visible:outline-hidden focus-visible:ring-[3px] focus-visible:ring-ring/30
|
|
20
4
|
[[data-state=open]>&]:border-ring [[data-state=open]>&]:outline-hidden [[data-state=open]>&]:ring-[3px]
|
|
21
5
|
[[data-state=open]>&]:ring-ring/30
|
|
22
6
|
aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
|
|
23
7
|
in-data-[invalid=true]:border-destructive/60 in-data-[invalid=true]:ring-destructive/10 dark:in-data-[invalid=true]:border-destructive dark:in-data-[invalid=true]:ring-destructive/20
|
|
24
|
-
`},placeholder:{true:"text-muted-foreground",false:""}},compoundVariants:[{variant:"ghost",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"dashed",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"secondary",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"input",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"icon",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{size:"xs",autoHeight:!0,className:"h-auto min-h-7"},{size:"md",autoHeight:!0,className:"h-auto min-h-9"},{size:"sm",autoHeight:!0,className:"h-auto min-h-8"},{size:"lg",autoHeight:!0,className:"h-auto min-h-10"},{variant:"primary",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"mono",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"secondary",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"outline",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"dashed",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"destructive",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"primary",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"mono",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"secondary",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"outline",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"dashed",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"destructive",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"primary",mode:"link",underline:"solid",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"primary",mode:"link",underline:"dashed",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"primary",mode:"link",underlined:"solid",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"primary",mode:"link",underlined:"dashed",className:"font-medium text-primary hover:text-primary/90 [&_svg]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"inverse",mode:"link",underline:"solid",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"inverse",mode:"link",underline:"dashed",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"inverse",mode:"link",underlined:"solid",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"inverse",mode:"link",underlined:"dashed",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"foreground",mode:"link",underline:"solid",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"foreground",mode:"link",underline:"dashed",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"foreground",mode:"link",underlined:"solid",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"foreground",mode:"link",underlined:"dashed",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"primary",appearance:"ghost",className:"bg-transparent text-primary/90 hover:bg-primary/5 data-[state=open]:bg-primary/5"},{variant:"destructive",appearance:"ghost",className:"bg-transparent text-destructive/90 hover:bg-destructive/5 data-[state=open]:bg-destructive/5"},{variant:"ghost",mode:"icon",className:"text-muted-foreground"},{size:"xs",mode:"icon",className:"w-7 h-7 p-0 [[&_svg:not([class*=size-])]:size-3.5"},{size:"sm",mode:"icon",className:"w-8 h-8 p-0 [[&_svg:not([class*=size-])]:size-3.5"},{size:"md",mode:"icon",className:"w-9 h-9 p-0 [&_svg:not([class*=size-])]:size-4"},{size:"icon",className:"w-9 h-9 p-0 [&_svg:not([class*=size-])]:size-4"},{size:"lg",mode:"icon",className:"w-10 h-10 p-0 [&_svg:not([class*=size-])]:size-4"},{mode:"input",placeholder:!0,variant:"outline",className:"font-normal text-muted-foreground"},{mode:"input",variant:"outline",size:"sm",className:"gap-1.25"},{mode:"input",variant:"outline",size:"md",className:"gap-1.5"},{mode:"input",variant:"outline",size:"lg",className:"gap-1.5"}],defaultVariants:{variant:"primary",mode:"default",size:"md",radius:"md",appearance:"default"}});function F(C){var w=C,{className:e,selected:t,variant:o,radius:a,appearance:n,mode:i,size:l,autoHeight:c,underlined:d,underline:g,asChild:u=!1,placeholder:b=!1}=w,p=f(w,["className","selected","variant","radius","appearance","mode","size","autoHeight","underlined","underline","asChild","placeholder"]);let D=u?wr.Slot.Slot:"button";return(0,Cr.jsx)(D,r(r({"data-slot":"button",className:v(Ni({variant:o,size:l,radius:a,appearance:n,mode:i,autoHeight:c,placeholder:b,underlined:d,underline:g,className:e}),u&&p.disabled&&"pointer-events-none opacity-50")},t&&{"data-state":"open"}),p))}var de=require("react/jsx-runtime");function Pi(e,t){let o=[];if(t<=7)for(let a=1;a<=t;a++)o.push(a);else e<=4?o.push(1,2,3,4,5,"ellipsis",t):e>=t-3?o.push(1,"ellipsis",t-4,t-3,t-2,t-1,t):o.push(1,"ellipsis",e-1,e,e+1,"ellipsis",t);return o}function yr({className:e}){let{pagination:t,handlePageChange:o,files:a,folders:n}=G(),{currentPage:i,totalPages:l}=t,c=((a==null?void 0:a.length)||0)+((n==null?void 0:n.length)||0);if(l<=1||c===0)return null;let d=Pi(i,l);return(0,de.jsx)(hr,{className:e,children:(0,de.jsxs)(vr,{children:[(0,de.jsx)(Po,{children:(0,de.jsx)(F,{variant:"ghost",radius:"full",asChild:!0,disabled:i===1,onClick:()=>i>1&&o(i-1),children:(0,de.jsxs)("span",{children:[(0,de.jsx)(lo,{className:"rtl:rotate-180"})," Previous"]})})}),d.map((g,u)=>g==="ellipsis"?(0,de.jsx)(Po,{children:(0,de.jsx)(xr,{})},`ellipsis-${i}-${l}-${u}`):(0,de.jsx)(Po,{children:(0,de.jsx)(F,{variant:g===i?"outline":"ghost",mode:"icon",size:"icon",radius:"full",asChild:!0,onClick:()=>o(g),disabled:g===i,children:(0,de.jsx)("span",{children:g})})},g)),(0,de.jsx)(Po,{children:(0,de.jsx)(F,{variant:"ghost",radius:"full",asChild:!0,disabled:i===l,onClick:()=>i<l&&o(i+1),children:(0,de.jsxs)("span",{children:["Next ",(0,de.jsx)(ct,{className:"rtl:rotate-180"})]})})})]})})}var Mr=require("react/jsx-runtime");function Fr({children:e,className:t}){return(0,Mr.jsx)("div",{className:v("p-4 flex md:flex-row gap-2",t),children:e})}var Jr=require("react");var kr=require("class-variance-authority");var ut=require("radix-ui");var he=require("react/jsx-runtime"),Si=(0,kr.cva)("flex flex-col fixed outline-0 z-50 border border-border bg-background shadow-lg shadow-black/5 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-2xl",{variants:{variant:{default:"left-[50%] top-[50%] max-w-lg translate-x-[-50%] translate-y-[-50%] w-full p-6 max-h-[90dvh]",fullscreen:"top-5 left-5 right-5 bottom-5"}},defaultVariants:{variant:"default"}});function Te(t){var e=f(t,[]);return(0,he.jsx)(ut.Dialog.Root,r({"data-slot":"dialog"},e))}function zi(t){var e=f(t,[]);return(0,he.jsx)(ut.Dialog.Portal,r({"data-slot":"dialog-portal"},e))}function ot(t){var e=f(t,[]);return(0,he.jsx)(ut.Dialog.Close,r({"data-slot":"dialog-close"},e))}function Ri(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,he.jsx)(ut.Dialog.Overlay,r({"data-slot":"dialog-overlay",className:v("fixed inset-0 z-50 bg-black/30 [backdrop-filter:blur(4px)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)},t))}function Ee(l){var c=l,{className:e,children:t,showCloseButton:o=!0,overlay:a=!0,variant:n}=c,i=f(c,["className","children","showCloseButton","overlay","variant"]);return(0,he.jsxs)(zi,{children:[a&&(0,he.jsx)(Ri,{}),(0,he.jsxs)(ut.Dialog.Content,s(r({"data-slot":"dialog-content",className:v(Si({variant:n}),e)},i),{children:[t,o&&(0,he.jsxs)(ot,{className:"cursor-pointer outline-0 absolute end-5 top-5 rounded-full opacity-60 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,he.jsx)(je,{className:"size-4 text-gray-600 dark:text-zinc-400"}),(0,he.jsx)("span",{className:"sr-only",children:"Close"})]})]}))]})}var We=o=>{var a=o,{className:e}=a,t=f(a,["className"]);return(0,he.jsx)("div",r({"data-slot":"dialog-header",className:v("flex flex-col space-y-1 text-center sm:text-start mb-5",e)},t))},$e=o=>{var a=o,{className:e}=a,t=f(a,["className"]);return(0,he.jsx)("div",r({"data-slot":"dialog-footer",className:v("flex flex-col-reverse sm:flex-row sm:justify-end pt-5 sm:space-x-2.5",e)},t))};function Le(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,he.jsx)(ut.Dialog.Title,r({"data-slot":"dialog-title",className:v("text-lg font-semibold leading-none tracking-tight",e)},t))}function mt(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,he.jsx)(ut.Dialog.Description,r({"data-slot":"dialog-description",className:v("text-sm text-muted-foreground",e)},t))}var Dr=require("class-variance-authority");var at=require("react/jsx-runtime"),Ti=(0,Dr.cva)("flex items-stretch w-full gap-2 group-[.toaster]:w-(--width)",{variants:{variant:{secondary:"",primary:"",destructive:"",success:"",info:"",mono:"",warning:""},icon:{primary:"",destructive:"",success:"",info:"",warning:""},appearance:{solid:"",outline:"",light:"",stroke:"text-foreground"},size:{lg:"rounded-lg p-4 gap-3 text-base [&>[data-slot=alert-icon]>svg]:size-6 *:data-slot=alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-1",md:"rounded-lg p-3.5 gap-2.5 text-sm [&>[data-slot=alert-icon]>svg]:size-5 *:data-slot=alert-icon:mt-0 [&_[data-slot=alert-close]]:mt-0.5",sm:"rounded-md px-3 py-2.5 gap-2 text-xs [&>[data-slot=alert-icon]>svg]:size-4 *:data-alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-0.25 [&_[data-slot=alert-close]_svg]:size-3.5"}},compoundVariants:[{variant:"secondary",appearance:"solid",className:"bg-muted text-foreground"},{variant:"primary",appearance:"solid",className:"bg-primary text-primary-foreground"},{variant:"destructive",appearance:"solid",className:"bg-destructive text-destructive-foreground"},{variant:"success",appearance:"solid",className:"bg-[var(--color-success,var(--color-green-500))] text-[var(--color-success-foreground,var(--color-white))]"},{variant:"info",appearance:"solid",className:"bg-[var(--color-info,var(--color-violet-600))] text-[var(--color-info-foreground,var(--color-white))]"},{variant:"warning",appearance:"solid",className:"bg-[var(--color-warning,var(--color-yellow-500))] text-[var(--color-warning-foreground,var(--color-white))]"},{variant:"mono",appearance:"solid",className:"bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black *:data-slot-[alert=close]:text-white"},{variant:"secondary",appearance:"outline",className:"border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"},{variant:"primary",appearance:"outline",className:"border border-border bg-background text-primary [&_[data-slot=alert-close]]:text-foreground"},{variant:"destructive",appearance:"outline",className:"border border-border bg-background text-destructive [&_[data-slot=alert-close]]:text-foreground"},{variant:"success",appearance:"outline",className:"border border-border bg-background text-[var(--color-success,var(--color-green-500))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"info",appearance:"outline",className:"border border-border bg-background text-[var(--color-info,var(--color-violet-600))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"warning",appearance:"outline",className:"border border-border bg-background text-[var(--color-warning,var(--color-yellow-500))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"mono",appearance:"outline",className:"border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"},{variant:"secondary",appearance:"light",className:"bg-muted border border-border text-foreground"},{variant:"primary",appearance:"light",className:"text-foreground bg-[var(--color-primary-soft,var(--color-blue-50))] border border-[var(--color-primary-alpha,var(--color-blue-100))] [&_[data-slot=alert-icon]]:text-primary dark:bg-[var(--color-primary-soft,var(--color-blue-950))] dark:border-[var(--color-primary-alpha,var(--color-blue-900))]"},{variant:"destructive",appearance:"light",className:"bg-[var(--color-destructive-soft,var(--color-red-50))] border border-[var(--color-destructive-alpha,var(--color-red-100))] text-foreground [&_[data-slot=alert-icon]]:text-destructive dark:bg-[var(--color-destructive-soft,var(--color-red-950))] dark:border-[var(--color-destructive-alpha,var(--color-red-900))] "},{variant:"success",appearance:"light",className:"bg-[var(--color-success-soft,var(--color-green-50))] border border-[var(--color-success-alpha,var(--color-green-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))] dark:bg-[var(--color-success-soft,var(--color-green-950))] dark:border-[var(--color-success-alpha,var(--color-green-900))]"},{variant:"info",appearance:"light",className:"bg-[var(--color-info-soft,var(--color-violet-50))] border border-[var(--color-info-alpha,var(--color-violet-100))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))] dark:bg-[var(--color-info-soft,var(--color-violet-950))] dark:border-[var(--color-info-alpha,var(--color-violet-900))]"},{variant:"warning",appearance:"light",className:"bg-[var(--color-warning-soft,var(--color-yellow-50))] border border-[var(--color-warning-alpha,var(--color-yellow-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))] dark:bg-[var(--color-warning-soft,var(--color-yellow-950))] dark:border-[var(--color-warning-alpha,var(--color-yellow-900))]"},{variant:"mono",icon:"primary",className:"[&_[data-slot=alert-icon]]:text-primary"},{variant:"mono",icon:"warning",className:"[&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))]"},{variant:"mono",icon:"success",className:"[&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))]"},{variant:"mono",icon:"destructive",className:"[&_[data-slot=alert-icon]]:text-destructive"},{variant:"mono",icon:"info",className:"[&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))]"}],defaultVariants:{variant:"secondary",appearance:"solid",size:"md"}});function Ir(g){var u=g,{className:e,variant:t,size:o,icon:a,appearance:n,close:i=!1,onClose:l,children:c}=u,d=f(u,["className","variant","size","icon","appearance","close","onClose","children"]);return(0,at.jsxs)("div",s(r({"data-slot":"alert",role:"alert",className:v(Ti({variant:t,size:o,icon:a,appearance:n}),e)},d),{children:[c,i&&(0,at.jsx)("button",{onClick:l,"aria-label":"Dismiss","data-slot":"alert-close",className:v("group shrink-0 size-4 cursor-pointer"),children:(0,at.jsx)(je,{className:"opacity-60 group-hover:opacity-100 size-4"})})]}))}function Nr(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,at.jsx)("div",r({"data-slot":"alert-title",className:v("grow tracking-tight",e)},t))}function Pr(a){var n=a,{children:e,className:t}=n,o=f(n,["children","className"]);return(0,at.jsx)("div",s(r({"data-slot":"alert-icon",className:v("shrink-0",t)},o),{children:e}))}function Sr(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,at.jsx)("div",r({"data-slot":"alert-description",className:v("text-sm [&_p]:leading-relaxed [&_p]:mb-2",e)},t))}function zr(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,at.jsx)("div",r({"data-slot":"alert-content",className:v("space-y-2 [&_[data-slot=alert-title]]:font-semibold",e)},t))}var Ae=Zo(require("@radix-ui/react-tooltip"));var rt=require("react/jsx-runtime");function Ei(o){var a=o,{delayDuration:e=0}=a,t=f(a,["delayDuration"]);return(0,rt.jsx)(Ae.Provider,r({"data-slot":"tooltip-provider",delayDuration:e},t))}function Rr(t){var e=f(t,[]);return(0,rt.jsx)(Ei,{children:(0,rt.jsx)(Ae.Root,r({"data-slot":"tooltip"},e))})}function Tr(t){var e=f(t,[]);return(0,rt.jsx)(Ae.Trigger,r({"data-slot":"tooltip-trigger"},e))}function Er(n){var i=n,{className:e,sideOffset:t=0,children:o}=i,a=f(i,["className","sideOffset","children"]);return(0,rt.jsx)(Ae.Portal,{children:(0,rt.jsxs)(Ae.Content,s(r({"data-slot":"tooltip-content",sideOffset:t,className:v("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e)},a),{children:[o,(0,rt.jsx)(Ae.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]}))})}function le(e){if(e===0)return"0 Bytes";let t=1024,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],a=Math.floor(Math.log(e)/Math.log(t));return Number.parseFloat((e/Math.pow(t,a)).toFixed(2))+" "+o[a]}var ae=require("react");var Lr=(e={})=>{let{maxFiles:t=Number.POSITIVE_INFINITY,maxSize:o=Number.POSITIVE_INFINITY,accept:a="*",multiple:n=!1,initialFiles:i=[],onFilesChange:l,onFilesAdded:c,onError:d}=e,[g,u]=(0,ae.useState)({files:i.map(m=>({file:m,id:m.id,preview:m.url})),isDragging:!1,errors:[]}),b=(0,ae.useRef)(null);(0,ae.useEffect)(()=>()=>{g.files.forEach(m=>{m.preview&&m.file instanceof File&&URL.revokeObjectURL(m.preview)})},[g.files]);let p=(0,ae.useCallback)(m=>{if(m instanceof File){if(m.size>o)return`File "${m.name}" exceeds the maximum size of ${le(o)}.`}else if(m.size>o)return`File "${m.name}" exceeds the maximum size of ${le(o)}.`;if(a!=="*"){let _=a.split(",").map(j=>j.trim()),x=m instanceof File?m.type||"":m.type,O=`.${m instanceof File,m.name.split(".").pop()}`;if(!_.some(j=>{if(j.startsWith("."))return O.toLowerCase()===j.toLowerCase();if(j.endsWith("/*")){let be=j.split("/")[0];return x.startsWith(`${be}/`)}return x===j}))return`File "${m instanceof File,m.name}" is not an accepted file type.`}return null},[a,o]),C=(0,ae.useCallback)(m=>m instanceof File?URL.createObjectURL(m):m.url,[]),w=(0,ae.useCallback)(m=>m instanceof File?`${m.name}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`:m.id.toString(),[]),D=(0,ae.useCallback)(()=>{u(m=>{for(let x of m.files)x.preview&&x.file instanceof File&&x.file.type.startsWith("image/")&&URL.revokeObjectURL(x.preview);b.current&&(b.current.value="");let _=s(r({},m),{files:[],errors:[]});return l==null||l(_.files),_})},[l]),y=(0,ae.useCallback)(m=>{if(!m||m.length===0)return;let _=Array.from(m),x=[];u(O=>s(r({},O),{errors:[]})),n||D(),u(O=>{if(n&&t!==Number.POSITIVE_INFINITY&&O.files.length+_.length>t)return x.push(`You can only upload a maximum of ${t} files.`),d==null||d(x),s(r({},O),{errors:x});let B=[];for(let j of _){if(n&&O.files.some(A=>A.file.name===j.name&&A.file.size===j.size))continue;if(j.size>o){x.push(n?`Some files exceed the maximum size of ${le(o)}.`:`File exceeds the maximum size of ${le(o)}.`);continue}let be=p(j);be?x.push(be):B.push({file:j,id:w(j),preview:C(j)})}if(B.length>0){c==null||c(B);let j=n?[...O.files,...B]:B;return l==null||l(j),s(r({},O),{files:j,errors:x})}else if(x.length>0)return d==null||d(x),s(r({},O),{errors:x});return O}),b.current&&(b.current.value="")},[t,n,o,p,C,w,D,l,c,d]),k=(0,ae.useCallback)(m=>{u(_=>{let x=_.files.find(B=>B.id===m);x&&x.preview&&x.file instanceof File&&x.file.type.startsWith("image/")&&URL.revokeObjectURL(x.preview);let O=_.files.filter(B=>B.id!==m);return l==null||l(O),s(r({},_),{files:O,errors:[]})})},[l]),z=(0,ae.useCallback)(()=>{u(m=>s(r({},m),{errors:[]}))},[]),R=(0,ae.useCallback)(m=>{m.preventDefault(),m.stopPropagation(),u(_=>s(r({},_),{isDragging:!0}))},[]),h=(0,ae.useCallback)(m=>{m.preventDefault(),m.stopPropagation(),!m.currentTarget.contains(m.relatedTarget)&&u(_=>s(r({},_),{isDragging:!1}))},[]),I=(0,ae.useCallback)(m=>{m.preventDefault(),m.stopPropagation()},[]),Y=(0,ae.useCallback)(m=>{var _;if(m.preventDefault(),m.stopPropagation(),u(x=>s(r({},x),{isDragging:!1})),!((_=b.current)!=null&&_.disabled)&&m.dataTransfer.files&&m.dataTransfer.files.length>0)if(n)y(m.dataTransfer.files);else{let x=m.dataTransfer.files[0];y([x])}},[y,n]),te=(0,ae.useCallback)(m=>{m.target.files&&m.target.files.length>0&&y(m.target.files)},[y]),se=(0,ae.useCallback)(()=>{b.current&&b.current.click()},[]),De=(0,ae.useCallback)((m={})=>s(r({},m),{type:"file",onChange:te,accept:m.accept||a,multiple:m.multiple!==void 0?m.multiple:n,ref:b}),[a,n,te]);return[g,{addFiles:y,removeFile:k,clearFiles:D,clearErrors:z,handleDragEnter:R,handleDragLeave:h,handleDragOver:I,handleDrop:Y,handleFileChange:te,openFileDialog:se,getInputProps:De}]};var ja=Zo(require("mime"));var ve=require("react/jsx-runtime");function Ke(e,t){if(typeof e!="string")return console.warn("getFileTypeFromMime: mimeType is not a string:",e),X.FILE;let o=e;if(t){let a=t.toLowerCase().replace(/^\./,""),n=ja.default.getType(a);n&&(o=n)}return o.startsWith("image/")?X.IMAGE:o.startsWith("video/")?X.VIDEO:o.startsWith("audio/")?X.AUDIO:X.FILE}function ua(e,t){let o=e;if(t){let a=t.toLowerCase().replace(/^\./,""),n=ja.default.getType(a);n&&(o=n)}if(o.startsWith("image/"))return"image";if(o.startsWith("video/"))return"video";if(o.startsWith("audio/"))return"audio";switch(o){case"application/pdf":return"pdf";case"application/json":return"json";case"application/zip":case"application/x-zip-compressed":return"zip";case"application/x-rar-compressed":case"application/vnd.rar":return"rar";case"application/x-msdownload":case"application/x-executable":return"exe";case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":case"application/vnd.ms-excel":case"text/csv":return"excel";case"application/vnd.openxmlformats-officedocument.presentationml.presentation":case"application/vnd.ms-powerpoint":return"powerpoint";case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":case"application/msword":return"document"}if(o.startsWith("text/"))return"txt";if(t)switch(t.toLowerCase().replace(/^\./,"")){case"exe":case"msi":return"exe";case"zip":return"zip";case"rar":return"rar";case"pdf":return"pdf";case"csv":return"excel"}return"file"}var ft=a=>{var n=a,{type:e,className:t}=n,o=f(n,["type","className"]);switch(e){case"folder-with-files":return(0,ve.jsx)(oa,r({className:t},o));case"folder":return(0,ve.jsx)(aa,r({className:t},o));case"image":return(0,ve.jsx)(no,r({className:t},o));case"video":return(0,ve.jsx)(ta,r({className:t},o));case"audio":return(0,ve.jsx)(ao,r({className:t},o));case"pdf":return(0,ve.jsx)(jo,r({className:t},o));case"excel":case"xlsx":return(0,ve.jsx)(Wo,r({className:t},o));case"powerpoint":case"pptx":return(0,ve.jsx)($o,r({className:t},o));case"document":case"docx":case"doc":return(0,ve.jsx)(Ko,r({className:t},o));case"txt":return(0,ve.jsx)(Yo,r({className:t},o));case"json":return(0,ve.jsx)(Jo,r({className:t},o));case"zip":return(0,ve.jsx)(Qo,r({className:t},o));case"rar":return(0,ve.jsx)(Xo,r({className:t},o));case"exe":return(0,ve.jsx)(ea,r({className:t},o));default:return(0,ve.jsx)(qo,r({className:t},o))}};function Ar(e){if(!e||e.length===0)return"*/*";let t=[];for(let o of e)switch(o){case X.IMAGE:t.push("image/*");break;case X.VIDEO:t.push("video/*");break;case X.AUDIO:t.push("audio/*");break;case X.FILE:t.push("application/*","text/*");break}return t.join(",")}function _r(e){if(!e||e.length===0)return"All files";let t=[];for(let o of e)switch(o){case X.IMAGE:t.push("Images");break;case X.VIDEO:t.push("Videos");break;case X.AUDIO:t.push("Audio");break;case X.FILE:t.push("Files");break}return t.join(", ")}var So=require("react/jsx-runtime");function Wa(e){return(0,So.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",color:"currentColor"},e),{children:[(0,So.jsx)("path",{d:"M13.0059 21.25C13.0059 21.8023 12.5581 22.25 12.0059 22.25C11.4536 22.25 11.0059 21.8023 11.0059 21.25L11.0059 16.75L10.4116 16.75C10.236 16.7501 10.0203 16.7503 9.84387 16.7282L9.84053 16.7278C9.71408 16.712 9.13804 16.6402 8.86368 16.0746C8.58872 15.5078 8.89065 15.0076 8.95597 14.8994L8.95841 14.8954C9.05062 14.7424 9.18477 14.5715 9.29511 14.4309L9.31885 14.4007C9.61348 14.0249 9.99545 13.5406 10.3759 13.1496C10.5657 12.9545 10.783 12.7533 11.0139 12.5944C11.2191 12.4532 11.5693 12.25 12 12.25C12.4307 12.25 12.7809 12.4532 12.9861 12.5944C13.217 12.7533 13.4343 12.9545 13.6241 13.1496C14.0046 13.5406 14.3865 14.0249 14.6812 14.4007L14.7049 14.4309C14.8152 14.5715 14.9494 14.7424 15.0416 14.8954L15.044 14.8994C15.1093 15.0076 15.4113 15.5078 15.1363 16.0746C14.862 16.6402 14.2859 16.712 14.1595 16.7278L14.1561 16.7282C13.9797 16.7503 13.764 16.7501 13.5884 16.75L13.0059 16.75L13.0059 21.25Z",fill:"currentColor",fillRule:"evenodd"}),(0,So.jsx)("path",{d:"M1.25 12.5C1.25 9.85827 3.03106 7.63322 5.45825 6.9592C5.65424 6.90478 5.75224 6.87756 5.80872 6.81971C5.8652 6.76186 5.88991 6.66386 5.93931 6.46785C6.62272 3.75655 9.07671 1.75002 12 1.75002C15.2149 1.75002 17.8628 4.17733 18.2112 7.29925C18.2385 7.54461 18.2522 7.66731 18.3147 7.7383C18.3772 7.80929 18.4989 7.83881 18.7423 7.89787C21.0422 8.4559 22.75 10.5285 22.75 13C22.75 15.8995 20.3995 18.25 17.5 18.25H16.4006C15.942 18.25 15.7126 18.25 15.6826 18.2119C15.6679 18.1933 15.6641 18.1839 15.6617 18.1604C15.6567 18.1121 15.8519 17.9223 16.2425 17.5427C17.2326 16.5804 17.255 14.9976 16.2927 14.0075C15.6442 13.1982 15.0315 12.3422 14.2379 11.6663C13.6086 11.1303 12.8426 10.75 12 10.75C11.1574 10.75 10.3914 11.1303 9.76209 11.6663C8.96846 12.3422 8.35575 13.1982 7.7073 14.0075C6.74496 14.9976 6.76745 16.5804 7.75753 17.5427C8.14807 17.9223 8.34334 18.1121 8.33832 18.1604C8.33587 18.1839 8.33206 18.1933 8.31739 18.2119C8.28737 18.25 8.05801 18.25 7.59942 18.25H7C3.82436 18.25 1.25 15.6757 1.25 12.5Z",fill:"currentColor"})]}))}var Vr=require("react");var zo=require("react/jsx-runtime"),Ie=(0,Vr.forwardRef)((i,n)=>{var l=i,{className:e,iconClassName:t,label:o="Close"}=l,a=f(l,["className","iconClassName","label"]);return(0,zo.jsxs)(F,s(r({ref:n,variant:"outline",size:"icon",radius:"full",type:"button",className:v("border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 text-gray-500 dark:text-zinc-400","hover:text-red-600 hover:border-red-300 hover:bg-red-50","dark:hover:text-red-400 dark:hover:border-red-700 dark:hover:bg-red-900/40","active:scale-95 transition-all duration-200",e)},a),{children:[(0,zo.jsx)(je,{className:v("size-5 transition-colors text-inherit",t)}),(0,zo.jsx)("span",{className:"sr-only",children:o})]}))});Ie.displayName="CloseButton";var Gr=require("react"),Ro=require("react/jsx-runtime");function Or({file:e}){var n;let[t,o]=(0,Gr.useState)(!1),a=e.previewUrl||e.url;return a&&!t?(0,Ro.jsx)("img",{src:a,alt:((n=e==null?void 0:e.name)==null?void 0:n.substring(0,10))||"image",className:"w-full h-full object-contain rounded-md drop-shadow-md",onError:()=>o(!0)}):(0,Ro.jsx)(no,{})}function Br({file:e}){return e.caption?(0,Ro.jsxs)("p",{className:"text-xs text-blue-600 dark:text-blue-400 line-clamp-2 mb-2",children:[e.height," x ",e.width]}):null}var Hr=require("react"),ce=require("react/jsx-runtime");function Zr({file:e,className:t}){let[o,a]=(0,Hr.useState)(!1);return e.previewUrl&&!o?(0,ce.jsxs)("div",{className:"relative w-full h-full",children:[(0,ce.jsx)("img",{src:e.previewUrl,className:"w-full h-full object-contain rounded-md",alt:e.name,onError:()=>a(!0)}),(0,ce.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,ce.jsx)("div",{className:"bg-black/60 rounded-full p-2 backdrop-blur-xs",children:(0,ce.jsx)(No,{className:"size-5 text-white fill-white"})})})]}):e.url&&!o?(0,ce.jsxs)("div",{className:"relative w-full h-full",children:[(0,ce.jsx)("video",{src:`${e.url}#t=0.001`,className:"w-full h-full object-contain rounded-md",preload:"metadata",muted:!0,playsInline:!0,onError:()=>a(!0)}),(0,ce.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,ce.jsx)("div",{className:"bg-black/60 rounded-full p-2 backdrop-blur-xs",children:(0,ce.jsx)(No,{className:"size-5 text-white fill-white"})})})]}):(0,ce.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent",children:(0,ce.jsx)("div",{className:"text-center",children:(0,ce.jsx)("div",{className:"text-4xl",children:(0,ce.jsx)(ft,{type:"video",className:t})})})})}function Ur({file:e}){var t;return(t=e.metaData)!=null&&t.duration?(0,ce.jsxs)("p",{className:"text-xs text-blue-600 dark:text-blue-400 mb-2",children:["Duration: ",Math.floor(e.metaData.duration/60),":",(e.metaData.duration%60).toString().padStart(2,"0")]}):null}var Bt=require("react/jsx-runtime");function jr({file:e,className:t}){return(0,Bt.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent",children:(0,Bt.jsx)("div",{className:"text-center",children:(0,Bt.jsx)("div",{className:"text-4xl",children:(0,Bt.jsx)(ft,{type:"audio",className:t})})})})}function Wr({file:e}){var t;return(t=e.metaData)!=null&&t.duration?(0,Bt.jsxs)("p",{className:"text-xs text-blue-600 dark:text-blue-400 mb-2",children:["Duration: ",Math.floor(e.metaData.duration/60),":",(e.metaData.duration%60).toString().padStart(2,"0")]}):null}var gt=require("react/jsx-runtime");function $r({file:e,className:t}){let o=ua(e.mime,e.ext);return(0,gt.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-transparent relative",children:e.previewUrl?(0,gt.jsx)("img",{src:e.previewUrl,alt:e.name,className:"w-full h-full object-contain rounded-md drop-shadow-md"}):(0,gt.jsx)("div",{className:"text-center",children:(0,gt.jsx)("div",{className:"text-4xl",children:(0,gt.jsx)(ft,{type:o,className:t})})})})}function Kr({file:e}){var t;return(t=e.metaData)!=null&&t.pageCount?(0,gt.jsxs)("p",{className:"text-xs text-blue-600 dark:text-blue-400 mb-2",children:["Pages: ",e.metaData.pageCount]}):null}var qr=require("react/jsx-runtime");function Yr({file:e}){let t=ua(e.mime,e.ext);return(0,qr.jsx)(ft,{type:t})}var Qr={images:{component:Or,metadataComponent:Br},videos:{component:Zr,metadataComponent:Ur},files:{component:$r,metadataComponent:Kr},audios:{component:jr,metadataComponent:Wr},default:{component:Yr}};function ht(e){let t=Ke(e.mime,e.ext);return Qr[t]||Qr.default}var $a=require("react/jsx-runtime");function fo(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,$a.jsx)("kbd",r({"data-slot":"kbd",className:v("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e)},t))}function go(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,$a.jsx)("kbd",r({"data-slot":"kbd-group",className:v("inline-flex items-center gap-1",e)},t))}var M=require("react/jsx-runtime");function Xr(){let{isUploadModalOpen:e,setIsUploadModalOpen:t,uploadFiles:o,allowedFileTypes:a,maxUploadFiles:n,maxUploadSize:i}=G(),l=Ar(a),c=_r(a),[d,g]=(0,Jr.useState)([]),[{isDragging:u,errors:b},{removeFile:p,clearFiles:C,handleDragEnter:w,handleDragLeave:D,handleDragOver:y,handleDrop:k,openFileDialog:z,getInputProps:R}]=Lr({maxFiles:n,maxSize:i,accept:l,multiple:!0,onFilesChange:x=>{let O=x.map(B=>{let j=d.find(be=>be.id===B.id);return j?r(r({},j),B):s(r({},B),{progress:100,status:"completed"})});g(O)}}),h=x=>{p(x)},I=x=>{g(O=>O.map(B=>B.id===x?s(r({},B),{progress:0,status:"uploading",error:void 0}):B))},Y=()=>{let x=d.filter(O=>O.status==="completed");if(x.length>0){let O=x.map(B=>({name:B.file.name,size:B.file.size,type:Ke(B.file.type,B.file.name.split(".").pop()),lastModified:B.file instanceof File?B.file.lastModified:Date.now(),file:B.file,metadata:{}}));o(O),te()}},te=()=>{t(!1),C(),g([])},se=(x,O)=>{let B={id:"temp",name:x.name,size:x.size,mime:x.type,ext:x.name.split(".").pop()||"",url:O||"",createdAt:new Date(x.lastModified),updatedAt:new Date(x.lastModified),folderId:null,metaData:{}},{component:j}=ht(B);return(0,M.jsx)(j,{file:B,metaData:B.metaData})},De=d.filter(x=>x.status==="completed").length,m=d.filter(x=>x.status==="uploading").length,_=De>0&&m===0;return(0,M.jsx)(Te,{open:e,onOpenChange:t,children:(0,M.jsxs)(Ee,{className:"p-0 max-w-4xl max-h-[80vh] flex flex-col",variant:"default",showCloseButton:!1,children:[(0,M.jsxs)(We,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,M.jsx)(Le,{className:"px-6 text-base",children:(0,M.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,M.jsxs)("span",{children:["Upload Files",(0,M.jsx)(go,{className:"ml-2",children:(0,M.jsxs)(fo,{children:[(0,M.jsx)("span",{className:"text-lg",children:"\u2318"})," + U"]})})]}),(0,M.jsx)(Ie,{onClick:()=>t(!1)})]})}),(0,M.jsx)(mt,{})]}),(0,M.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[(0,M.jsxs)("div",{className:v("relative rounded-lg border-dashed border-[2.5px] bg-gray-100 dark:bg-zinc-800 border-gray-300 dark:border-zinc-600 px-6 py-16 text-center transition-colors mb-4",u?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-muted-foreground/50"),onDragEnter:w,onDragLeave:D,onDragOver:y,onDrop:k,children:[(0,M.jsx)("input",s(r({},R()),{className:"sr-only"})),(0,M.jsxs)("div",{className:"flex flex-col items-center",children:[(0,M.jsx)("div",{className:v("flex h-12 w-12 items-center justify-center rounded-full transition-colors",u?"border-primary bg-primary/10":"border-muted-foreground/25"),children:(0,M.jsx)(Wa,{className:"mb-3 text-zinc-400 dark:text-zinc-500"})}),(0,M.jsxs)("div",{className:"space-y-2",children:[(0,M.jsxs)("p",{className:"text-sm font-medium",children:["Drop files here or"," ",(0,M.jsx)("button",{type:"button",onClick:z,className:"cursor-pointer text-blue-600 dark:text-blue-400 underline-offset-4 underline",children:"browse files"})]}),(0,M.jsxs)("p",{className:"text-xs text-muted-foreground",children:[c," \u2022 Max size: ",le(i)," \u2022 Max files: ",n]})]})]})]}),d.length>0&&(0,M.jsx)("div",{className:"space-y-4",children:(0,M.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:d.map(x=>(0,M.jsxs)("div",{className:"relative group",children:[(0,M.jsx)(Ie,{onClick:()=>h(x.id),className:"absolute -inset-e-2 -top-2 z-10 size-6 rounded-full opacity-0 transition-opacity group-hover:opacity-100",iconClassName:"size-3"}),(0,M.jsxs)("div",{className:"relative overflow-hidden rounded-lg border bg-card transition-colors",children:[(0,M.jsx)("div",{className:"relative aspect-square bg-muted border-b border-slate-200 dark:border-zinc-800",children:(0,M.jsx)("div",{className:"flex h-full items-center justify-center p-4",children:(0,M.jsx)("div",{className:"w-[75%] h-[75%] flex items-center justify-center",children:x.status==="uploading"?(0,M.jsxs)("div",{className:"relative w-full h-full flex items-center justify-center",children:[(0,M.jsxs)("svg",{className:"size-12 -rotate-90 absolute",viewBox:"0 0 48 48",children:[(0,M.jsx)("circle",{cx:"24",cy:"24",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"3",className:"text-muted-foreground/20"}),(0,M.jsx)("circle",{cx:"24",cy:"24",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:`${2*Math.PI*20}`,strokeDashoffset:`${2*Math.PI*20*(1-x.progress/100)}`,className:"text-primary transition-all duration-300",strokeLinecap:"round"})]}),x.file instanceof File&&se(x.file,x.preview)]}):x.file instanceof File&&se(x.file,x.preview)})})}),(0,M.jsx)("div",{className:"p-3",children:(0,M.jsxs)("div",{className:"space-y-1",children:[(0,M.jsx)("p",{className:"truncate text-xs font-medium",children:x.file.name}),(0,M.jsxs)("div",{className:"relative flex items-center justify-between gap-2",children:[(0,M.jsx)("span",{className:"text-[11px] text-blue-600 dark:text-blue-400 font-semibold tracking-tight",children:le(x.file.size)}),x.status==="error"&&x.error&&(0,M.jsxs)(Rr,{children:[(0,M.jsx)(Tr,{asChild:!0,children:(0,M.jsx)(F,{onClick:()=>I(x.id),variant:"ghost",size:"icon",className:"absolute end-0 -top-1.25 size-6 text-destructive hover:bg-destructive/10 hover:text-destructive",children:(0,M.jsx)(mo,{className:"size-3 opacity-100"})})}),(0,M.jsx)(Er,{children:"Upload failed. Retry"})]})]})]})})]})]},x.id))})}),b.length>0&&(0,M.jsxs)(Ir,{variant:"destructive",appearance:"light",className:"mt-5",children:[(0,M.jsx)(Pr,{children:(0,M.jsx)(pa,{})}),(0,M.jsxs)(zr,{children:[(0,M.jsx)(Nr,{children:"File upload error(s)"}),(0,M.jsx)(Sr,{children:b.map((x,O)=>(0,M.jsx)("p",{className:"last:mb-0",children:x},O))})]})]})]}),(0,M.jsxs)($e,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,M.jsx)(ot,{asChild:!0,children:(0,M.jsx)(F,{type:"button",radius:"full",variant:"outline",onClick:te,className:"w-full md:w-auto",children:"Cancel"})}),(0,M.jsxs)(F,{type:"button",radius:"full",onClick:Y,disabled:!_,className:"w-full md:w-auto",children:["Upload ",De>0&&`(${De})`]})]})]})})}var ma=require("react");var To=require("class-variance-authority");var en=require("react/jsx-runtime"),Li=(0,To.cva)(`
|
|
8
|
+
`},placeholder:{true:"text-muted-foreground",false:""}},compoundVariants:[{variant:"ghost",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"dashed",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"secondary",mode:"default",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"input",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{variant:"outline",mode:"icon",className:"[&_svg:not([role=img]):not([class*=text-]):not([class*=opacity-])]:opacity-60"},{size:"xs",autoHeight:true,className:"h-auto min-h-7"},{size:"md",autoHeight:true,className:"h-auto min-h-9"},{size:"sm",autoHeight:true,className:"h-auto min-h-8"},{size:"lg",autoHeight:true,className:"h-auto min-h-10"},{variant:"primary",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"mono",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"secondary",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"outline",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"dashed",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"destructive",mode:"default",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"primary",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"mono",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"secondary",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"outline",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"dashed",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"destructive",mode:"icon",appearance:"default",className:"shadow-xs shadow-black/5"},{variant:"primary",mode:"link",underline:"solid",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"primary",mode:"link",underline:"dashed",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"primary",mode:"link",underlined:"solid",className:"font-medium text-primary hover:text-primary/90 [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"primary",mode:"link",underlined:"dashed",className:"font-medium text-primary hover:text-primary/90 [&_svg]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"inverse",mode:"link",underline:"solid",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"inverse",mode:"link",underline:"dashed",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"inverse",mode:"link",underlined:"solid",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"inverse",mode:"link",underlined:"dashed",className:"font-medium text-inherit [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"foreground",mode:"link",underline:"solid",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-solid"},{variant:"foreground",mode:"link",underline:"dashed",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 hover:underline hover:underline-offset-4 hover:decoration-dashed decoration-1"},{variant:"foreground",mode:"link",underlined:"solid",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-solid"},{variant:"foreground",mode:"link",underlined:"dashed",className:"font-medium text-foreground [&_svg:not([role=img]):not([class*=text-])]:opacity-60 underline underline-offset-4 decoration-dashed decoration-1"},{variant:"primary",appearance:"ghost",className:"bg-transparent text-primary/90 hover:bg-primary/5 data-[state=open]:bg-primary/5"},{variant:"destructive",appearance:"ghost",className:"bg-transparent text-destructive/90 hover:bg-destructive/5 data-[state=open]:bg-destructive/5"},{variant:"ghost",mode:"icon",className:"text-muted-foreground"},{size:"xs",mode:"icon",className:"w-7 h-7 p-0 [[&_svg:not([class*=size-])]:size-3.5"},{size:"sm",mode:"icon",className:"w-8 h-8 p-0 [[&_svg:not([class*=size-])]:size-3.5"},{size:"md",mode:"icon",className:"w-9 h-9 p-0 [&_svg:not([class*=size-])]:size-4"},{size:"icon",className:"w-9 h-9 p-0 [&_svg:not([class*=size-])]:size-4"},{size:"lg",mode:"icon",className:"w-10 h-10 p-0 [&_svg:not([class*=size-])]:size-4"},{mode:"input",placeholder:true,variant:"outline",className:"font-normal text-muted-foreground"},{mode:"input",variant:"outline",size:"sm",className:"gap-1.25"},{mode:"input",variant:"outline",size:"md",className:"gap-1.5"},{mode:"input",variant:"outline",size:"lg",className:"gap-1.5"}],defaultVariants:{variant:"primary",mode:"default",size:"md",radius:"md",appearance:"default"}});function y(w){var F=w,{className:e,selected:t,variant:a,radius:o,appearance:r,mode:n,size:s,autoHeight:m,underlined:l,underline:v,asChild:u=false,placeholder:x=false}=F,c=chunkS4HRPNKF_js.c(F,["className","selected","variant","radius","appearance","mode","size","autoHeight","underlined","underline","asChild","placeholder"]);let M=u?radixUi.Slot.Slot:"button";return jsxRuntime.jsx(M,chunkS4HRPNKF_js.a(chunkS4HRPNKF_js.a({"data-slot":"button",className:f(un({variant:a,size:s,radius:o,appearance:r,mode:n,autoHeight:m,placeholder:x,underlined:l,underline:v,className:e}),u&&c.disabled&&"pointer-events-none opacity-50")},t&&{"data-state":"open"}),c))}function fn(e,t){let a=[];if(t<=7)for(let o=1;o<=t;o++)a.push(o);else e<=4?a.push(1,2,3,4,5,"ellipsis",t):e>=t-3?a.push(1,"ellipsis",t-4,t-3,t-2,t-1,t):a.push(1,"ellipsis",e-1,e,e+1,"ellipsis",t);return a}function va({className:e}){let{pagination:t,handlePageChange:a,files:o,folders:r}=E(),{currentPage:n,totalPages:s}=t,m=((o==null?void 0:o.length)||0)+((r==null?void 0:r.length)||0);if(s<=1||m===0)return null;let l=fn(n,s);return jsxRuntime.jsx(pa,{className:e,children:jsxRuntime.jsxs(fa,{children:[jsxRuntime.jsx(Ut,{children:jsxRuntime.jsx(y,{variant:"ghost",radius:"full",asChild:true,disabled:n===1,onClick:()=>n>1&&a(n-1),children:jsxRuntime.jsxs("span",{children:[jsxRuntime.jsx(chunkS4HRPNKF_js.p,{className:"rtl:rotate-180"})," Previous"]})})}),l.map((v,u)=>v==="ellipsis"?jsxRuntime.jsx(Ut,{children:jsxRuntime.jsx(ga,{})},`ellipsis-${n}-${s}-${u}`):jsxRuntime.jsx(Ut,{children:jsxRuntime.jsx(y,{variant:v===n?"outline":"ghost",mode:"icon",size:"icon",radius:"full",asChild:true,onClick:()=>a(v),disabled:v===n,children:jsxRuntime.jsx("span",{children:v})})},v)),jsxRuntime.jsx(Ut,{children:jsxRuntime.jsx(y,{variant:"ghost",radius:"full",asChild:true,disabled:n===s,onClick:()=>n<s&&a(n+1),children:jsxRuntime.jsxs("span",{children:["Next ",jsxRuntime.jsx(chunkS4HRPNKF_js.o,{className:"rtl:rotate-180"})]})})})]})})}function xa({children:e,className:t}){return jsxRuntime.jsx("div",{className:f("p-4 flex md:flex-row gap-2",t),children:e})}var xn=classVarianceAuthority.cva("flex flex-col fixed outline-0 z-50 border border-border bg-background shadow-lg shadow-black/5 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-2xl",{variants:{variant:{default:"left-[50%] top-[50%] max-w-lg translate-x-[-50%] translate-y-[-50%] w-full p-6 max-h-[90dvh]",fullscreen:"top-5 left-5 right-5 bottom-5"}},defaultVariants:{variant:"default"}});function Fe(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(radixUi.Dialog.Root,chunkS4HRPNKF_js.a({"data-slot":"dialog"},e))}function bn(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(radixUi.Dialog.Portal,chunkS4HRPNKF_js.a({"data-slot":"dialog-portal"},e))}function Ge(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(radixUi.Dialog.Close,chunkS4HRPNKF_js.a({"data-slot":"dialog-close"},e))}function hn(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(radixUi.Dialog.Overlay,chunkS4HRPNKF_js.a({"data-slot":"dialog-overlay",className:f("fixed inset-0 z-50 bg-black/30 [backdrop-filter:blur(4px)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)},t))}function we(s){var m=s,{className:e,children:t,showCloseButton:a=true,overlay:o=true,variant:r}=m,n=chunkS4HRPNKF_js.c(m,["className","children","showCloseButton","overlay","variant"]);return jsxRuntime.jsxs(bn,{children:[o&&jsxRuntime.jsx(hn,{}),jsxRuntime.jsxs(radixUi.Dialog.Content,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({"data-slot":"dialog-content",className:f(xn({variant:r}),e)},n),{children:[t,a&&jsxRuntime.jsxs(Ge,{className:"cursor-pointer outline-0 absolute end-5 top-5 rounded-full opacity-60 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.s,{className:"size-4 text-gray-600 dark:text-zinc-400"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]}))]})}var Le=a=>{var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({"data-slot":"dialog-header",className:f("flex flex-col space-y-1 text-center sm:text-start mb-5",e)},t))},_e=a=>{var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({"data-slot":"dialog-footer",className:f("flex flex-col-reverse sm:flex-row sm:justify-end pt-5 sm:space-x-2.5",e)},t))};function Ne(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(radixUi.Dialog.Title,chunkS4HRPNKF_js.a({"data-slot":"dialog-title",className:f("text-lg font-semibold leading-none tracking-tight",e)},t))}function Je(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(radixUi.Dialog.Description,chunkS4HRPNKF_js.a({"data-slot":"dialog-description",className:f("text-sm text-muted-foreground",e)},t))}var Cn=classVarianceAuthority.cva("flex items-stretch w-full gap-2 group-[.toaster]:w-(--width)",{variants:{variant:{secondary:"",primary:"",destructive:"",success:"",info:"",mono:"",warning:""},icon:{primary:"",destructive:"",success:"",info:"",warning:""},appearance:{solid:"",outline:"",light:"",stroke:"text-foreground"},size:{lg:"rounded-lg p-4 gap-3 text-base [&>[data-slot=alert-icon]>svg]:size-6 *:data-slot=alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-1",md:"rounded-lg p-3.5 gap-2.5 text-sm [&>[data-slot=alert-icon]>svg]:size-5 *:data-slot=alert-icon:mt-0 [&_[data-slot=alert-close]]:mt-0.5",sm:"rounded-md px-3 py-2.5 gap-2 text-xs [&>[data-slot=alert-icon]>svg]:size-4 *:data-alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-0.25 [&_[data-slot=alert-close]_svg]:size-3.5"}},compoundVariants:[{variant:"secondary",appearance:"solid",className:"bg-muted text-foreground"},{variant:"primary",appearance:"solid",className:"bg-primary text-primary-foreground"},{variant:"destructive",appearance:"solid",className:"bg-destructive text-destructive-foreground"},{variant:"success",appearance:"solid",className:"bg-[var(--color-success,var(--color-green-500))] text-[var(--color-success-foreground,var(--color-white))]"},{variant:"info",appearance:"solid",className:"bg-[var(--color-info,var(--color-violet-600))] text-[var(--color-info-foreground,var(--color-white))]"},{variant:"warning",appearance:"solid",className:"bg-[var(--color-warning,var(--color-yellow-500))] text-[var(--color-warning-foreground,var(--color-white))]"},{variant:"mono",appearance:"solid",className:"bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black *:data-slot-[alert=close]:text-white"},{variant:"secondary",appearance:"outline",className:"border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"},{variant:"primary",appearance:"outline",className:"border border-border bg-background text-primary [&_[data-slot=alert-close]]:text-foreground"},{variant:"destructive",appearance:"outline",className:"border border-border bg-background text-destructive [&_[data-slot=alert-close]]:text-foreground"},{variant:"success",appearance:"outline",className:"border border-border bg-background text-[var(--color-success,var(--color-green-500))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"info",appearance:"outline",className:"border border-border bg-background text-[var(--color-info,var(--color-violet-600))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"warning",appearance:"outline",className:"border border-border bg-background text-[var(--color-warning,var(--color-yellow-500))] [&_[data-slot=alert-close]]:text-foreground"},{variant:"mono",appearance:"outline",className:"border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"},{variant:"secondary",appearance:"light",className:"bg-muted border border-border text-foreground"},{variant:"primary",appearance:"light",className:"text-foreground bg-[var(--color-primary-soft,var(--color-blue-50))] border border-[var(--color-primary-alpha,var(--color-blue-100))] [&_[data-slot=alert-icon]]:text-primary dark:bg-[var(--color-primary-soft,var(--color-blue-950))] dark:border-[var(--color-primary-alpha,var(--color-blue-900))]"},{variant:"destructive",appearance:"light",className:"bg-[var(--color-destructive-soft,var(--color-red-50))] border border-[var(--color-destructive-alpha,var(--color-red-100))] text-foreground [&_[data-slot=alert-icon]]:text-destructive dark:bg-[var(--color-destructive-soft,var(--color-red-950))] dark:border-[var(--color-destructive-alpha,var(--color-red-900))] "},{variant:"success",appearance:"light",className:"bg-[var(--color-success-soft,var(--color-green-50))] border border-[var(--color-success-alpha,var(--color-green-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))] dark:bg-[var(--color-success-soft,var(--color-green-950))] dark:border-[var(--color-success-alpha,var(--color-green-900))]"},{variant:"info",appearance:"light",className:"bg-[var(--color-info-soft,var(--color-violet-50))] border border-[var(--color-info-alpha,var(--color-violet-100))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))] dark:bg-[var(--color-info-soft,var(--color-violet-950))] dark:border-[var(--color-info-alpha,var(--color-violet-900))]"},{variant:"warning",appearance:"light",className:"bg-[var(--color-warning-soft,var(--color-yellow-50))] border border-[var(--color-warning-alpha,var(--color-yellow-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))] dark:bg-[var(--color-warning-soft,var(--color-yellow-950))] dark:border-[var(--color-warning-alpha,var(--color-yellow-900))]"},{variant:"mono",icon:"primary",className:"[&_[data-slot=alert-icon]]:text-primary"},{variant:"mono",icon:"warning",className:"[&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))]"},{variant:"mono",icon:"success",className:"[&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))]"},{variant:"mono",icon:"destructive",className:"[&_[data-slot=alert-icon]]:text-destructive"},{variant:"mono",icon:"info",className:"[&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))]"}],defaultVariants:{variant:"secondary",appearance:"solid",size:"md"}});function ba(v){var u=v,{className:e,variant:t,size:a,icon:o,appearance:r,close:n=false,onClose:s,children:m}=u,l=chunkS4HRPNKF_js.c(u,["className","variant","size","icon","appearance","close","onClose","children"]);return jsxRuntime.jsxs("div",chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({"data-slot":"alert",role:"alert",className:f(Cn({variant:t,size:a,icon:o,appearance:r}),e)},l),{children:[m,n&&jsxRuntime.jsx("button",{onClick:s,"aria-label":"Dismiss","data-slot":"alert-close",className:f("group shrink-0 size-4 cursor-pointer"),children:jsxRuntime.jsx(chunkS4HRPNKF_js.s,{className:"opacity-60 group-hover:opacity-100 size-4"})})]}))}function ha(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({"data-slot":"alert-title",className:f("grow tracking-tight",e)},t))}function ya(o){var r=o,{children:e,className:t}=r,a=chunkS4HRPNKF_js.c(r,["children","className"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({"data-slot":"alert-icon",className:f("shrink-0",t)},a),{children:e}))}function Ca(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({"data-slot":"alert-description",className:f("text-sm [&_p]:leading-relaxed [&_p]:mb-2",e)},t))}function Fa(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({"data-slot":"alert-content",className:f("space-y-2 [&_[data-slot=alert-title]]:font-semibold",e)},t))}function wn(a){var o=a,{delayDuration:e=0}=o,t=chunkS4HRPNKF_js.c(o,["delayDuration"]);return jsxRuntime.jsx(Me__namespace.Provider,chunkS4HRPNKF_js.a({"data-slot":"tooltip-provider",delayDuration:e},t))}function wa(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(wn,{children:jsxRuntime.jsx(Me__namespace.Root,chunkS4HRPNKF_js.a({"data-slot":"tooltip"},e))})}function Na(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(Me__namespace.Trigger,chunkS4HRPNKF_js.a({"data-slot":"tooltip-trigger"},e))}function Ma(r){var n=r,{className:e,sideOffset:t=0,children:a}=n,o=chunkS4HRPNKF_js.c(n,["className","sideOffset","children"]);return jsxRuntime.jsx(Me__namespace.Portal,{children:jsxRuntime.jsxs(Me__namespace.Content,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({"data-slot":"tooltip-content",sideOffset:t,className:f("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e)},o),{children:[a,jsxRuntime.jsx(Me__namespace.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]}))})}function ee(e){if(e===0)return "0 Bytes";let t=1024,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(e)/Math.log(t));return Number.parseFloat((e/Math.pow(t,o)).toFixed(2))+" "+a[o]}var ka=(e={})=>{let{maxFiles:t=Number.POSITIVE_INFINITY,maxSize:a=Number.POSITIVE_INFINITY,accept:o="*",multiple:r=false,initialFiles:n=[],onFilesChange:s,onFilesAdded:m,onError:l}=e,[v,u]=Fi.useState({files:n.map(d=>({file:d,id:d.id,preview:d.url})),isDragging:false,errors:[]}),x=Fi.useRef(null);Fi.useEffect(()=>()=>{v.files.forEach(d=>{d.preview&&d.file instanceof File&&URL.revokeObjectURL(d.preview);});},[v.files]);let c=Fi.useCallback(d=>{if(d instanceof File){if(d.size>a)return `File "${d.name}" exceeds the maximum size of ${ee(a)}.`}else if(d.size>a)return `File "${d.name}" exceeds the maximum size of ${ee(a)}.`;if(o!=="*"){let I=o.split(",").map(A=>A.trim()),g=d instanceof File?d.type||"":d.type,R=`.${d.name.split(".").pop()}`;if(!I.some(A=>{if(A.startsWith("."))return R.toLowerCase()===A.toLowerCase();if(A.endsWith("/*")){let de=A.split("/")[0];return g.startsWith(`${de}/`)}return g===A}))return `File "${d.name}" is not an accepted file type.`}return null},[o,a]),w=Fi.useCallback(d=>d instanceof File?URL.createObjectURL(d):d.url,[]),F=Fi.useCallback(d=>d instanceof File?`${d.name}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`:d.id.toString(),[]),M=Fi.useCallback(()=>{u(d=>{for(let g of d.files)g.preview&&g.file instanceof File&&g.file.type.startsWith("image/")&&URL.revokeObjectURL(g.preview);x.current&&(x.current.value="");let I=chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},d),{files:[],errors:[]});return s==null||s(I.files),I});},[s]),C=Fi.useCallback(d=>{if(!d||d.length===0)return;let I=Array.from(d),g=[];u(R=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},R),{errors:[]})),r||M(),u(R=>{if(r&&t!==Number.POSITIVE_INFINITY&&R.files.length+I.length>t)return g.push(`You can only upload a maximum of ${t} files.`),l==null||l(g),chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},R),{errors:g});let T=[];for(let A of I){if(r&&R.files.some(P=>P.file.name===A.name&&P.file.size===A.size))continue;if(A.size>a){g.push(r?`Some files exceed the maximum size of ${ee(a)}.`:`File exceeds the maximum size of ${ee(a)}.`);continue}let de=c(A);de?g.push(de):T.push({file:A,id:F(A),preview:w(A)});}if(T.length>0){m==null||m(T);let A=r?[...R.files,...T]:T;return s==null||s(A),chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},R),{files:A,errors:g})}else if(g.length>0)return l==null||l(g),chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},R),{errors:g});return R}),x.current&&(x.current.value="");},[t,r,a,c,w,F,M,s,m,l]),N=Fi.useCallback(d=>{u(I=>{let g=I.files.find(T=>T.id===d);g&&g.preview&&g.file instanceof File&&g.file.type.startsWith("image/")&&URL.revokeObjectURL(g.preview);let R=I.files.filter(T=>T.id!==d);return s==null||s(R),chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},I),{files:R,errors:[]})});},[s]),D=Fi.useCallback(()=>{u(d=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},d),{errors:[]}));},[]),k=Fi.useCallback(d=>{d.preventDefault(),d.stopPropagation(),u(I=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},I),{isDragging:true}));},[]),b=Fi.useCallback(d=>{d.preventDefault(),d.stopPropagation(),!d.currentTarget.contains(d.relatedTarget)&&u(I=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},I),{isDragging:false}));},[]),S=Fi.useCallback(d=>{d.preventDefault(),d.stopPropagation();},[]),j=Fi.useCallback(d=>{var I;if(d.preventDefault(),d.stopPropagation(),u(g=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},g),{isDragging:false})),!((I=x.current)!=null&&I.disabled)&&d.dataTransfer.files&&d.dataTransfer.files.length>0)if(r)C(d.dataTransfer.files);else {let g=d.dataTransfer.files[0];C([g]);}},[C,r]),J=Fi.useCallback(d=>{d.target.files&&d.target.files.length>0&&C(d.target.files);},[C]),te=Fi.useCallback(()=>{x.current&&x.current.click();},[]),ve=Fi.useCallback((d={})=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},d),{type:"file",onChange:J,accept:d.accept||o,multiple:d.multiple!==void 0?d.multiple:r,ref:x}),[o,r,J]);return [v,{addFiles:C,removeFile:N,clearFiles:M,clearErrors:D,handleDragEnter:k,handleDragLeave:b,handleDragOver:S,handleDrop:j,handleFileChange:J,openFileDialog:te,getInputProps:ve}]};function Io(e){return jsxRuntime.jsxs("svg",chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",color:"currentColor"},e),{children:[jsxRuntime.jsx("path",{d:"M13.0059 21.25C13.0059 21.8023 12.5581 22.25 12.0059 22.25C11.4536 22.25 11.0059 21.8023 11.0059 21.25L11.0059 16.75L10.4116 16.75C10.236 16.7501 10.0203 16.7503 9.84387 16.7282L9.84053 16.7278C9.71408 16.712 9.13804 16.6402 8.86368 16.0746C8.58872 15.5078 8.89065 15.0076 8.95597 14.8994L8.95841 14.8954C9.05062 14.7424 9.18477 14.5715 9.29511 14.4309L9.31885 14.4007C9.61348 14.0249 9.99545 13.5406 10.3759 13.1496C10.5657 12.9545 10.783 12.7533 11.0139 12.5944C11.2191 12.4532 11.5693 12.25 12 12.25C12.4307 12.25 12.7809 12.4532 12.9861 12.5944C13.217 12.7533 13.4343 12.9545 13.6241 13.1496C14.0046 13.5406 14.3865 14.0249 14.6812 14.4007L14.7049 14.4309C14.8152 14.5715 14.9494 14.7424 15.0416 14.8954L15.044 14.8994C15.1093 15.0076 15.4113 15.5078 15.1363 16.0746C14.862 16.6402 14.2859 16.712 14.1595 16.7278L14.1561 16.7282C13.9797 16.7503 13.764 16.7501 13.5884 16.75L13.0059 16.75L13.0059 21.25Z",fill:"currentColor",fillRule:"evenodd"}),jsxRuntime.jsx("path",{d:"M1.25 12.5C1.25 9.85827 3.03106 7.63322 5.45825 6.9592C5.65424 6.90478 5.75224 6.87756 5.80872 6.81971C5.8652 6.76186 5.88991 6.66386 5.93931 6.46785C6.62272 3.75655 9.07671 1.75002 12 1.75002C15.2149 1.75002 17.8628 4.17733 18.2112 7.29925C18.2385 7.54461 18.2522 7.66731 18.3147 7.7383C18.3772 7.80929 18.4989 7.83881 18.7423 7.89787C21.0422 8.4559 22.75 10.5285 22.75 13C22.75 15.8995 20.3995 18.25 17.5 18.25H16.4006C15.942 18.25 15.7126 18.25 15.6826 18.2119C15.6679 18.1933 15.6641 18.1839 15.6617 18.1604C15.6567 18.1121 15.8519 17.9223 16.2425 17.5427C17.2326 16.5804 17.255 14.9976 16.2927 14.0075C15.6442 13.1982 15.0315 12.3422 14.2379 11.6663C13.6086 11.1303 12.8426 10.75 12 10.75C11.1574 10.75 10.3914 11.1303 9.76209 11.6663C8.96846 12.3422 8.35575 13.1982 7.7073 14.0075C6.74496 14.9976 6.76745 16.5804 7.75753 17.5427C8.14807 17.9223 8.34334 18.1121 8.33832 18.1604C8.33587 18.1839 8.33206 18.1933 8.31739 18.2119C8.28737 18.25 8.05801 18.25 7.59942 18.25H7C3.82436 18.25 1.25 15.6757 1.25 12.5Z",fill:"currentColor"})]}))}var xe=Fi.forwardRef((n,r)=>{var s=n,{className:e,iconClassName:t,label:a="Close"}=s,o=chunkS4HRPNKF_js.c(s,["className","iconClassName","label"]);return jsxRuntime.jsxs(y,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({ref:r,variant:"outline",size:"icon",radius:"full",type:"button",className:f("border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 text-gray-500 dark:text-zinc-400","hover:text-red-600 hover:border-red-300 hover:bg-red-50","dark:hover:text-red-400 dark:hover:border-red-700 dark:hover:bg-red-900/40","active:scale-95 transition-all duration-200",e)},o),{children:[jsxRuntime.jsx(chunkS4HRPNKF_js.s,{className:f("size-5 transition-colors text-inherit",t)}),jsxRuntime.jsx("span",{className:"sr-only",children:a})]}))});xe.displayName="CloseButton";function Sa({file:e}){var r;let[t,a]=Fi.useState(false),o=e.previewUrl||e.url;return o&&!t?jsxRuntime.jsx("img",{src:o,alt:((r=e==null?void 0:e.name)==null?void 0:r.substring(0,10))||"image",className:"w-full h-full object-contain rounded-md drop-shadow-md",onError:()=>a(true)}):jsxRuntime.jsx(chunkS4HRPNKF_js.i,{})}function za({file:e}){return e.caption?jsxRuntime.jsxs("p",{className:"text-xs text-primary line-clamp-2 mb-2",children:[e.height," x ",e.width]}):null}function Ra({file:e,className:t}){let[a,o]=Fi.useState(false);return e.previewUrl&&!a?jsxRuntime.jsxs("div",{className:"relative w-full h-full",children:[jsxRuntime.jsx("img",{src:e.previewUrl,className:"w-full h-full object-contain rounded-md",alt:e.name,onError:()=>o(true)}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsx("div",{className:"bg-black/60 rounded-full p-2 backdrop-blur-xs",children:jsxRuntime.jsx(chunkS4HRPNKF_js.D,{className:"size-5 text-white fill-white"})})})]}):e.url&&!a?jsxRuntime.jsxs("div",{className:"relative w-full h-full",children:[jsxRuntime.jsx("video",{src:`${e.url}#t=0.001`,className:"w-full h-full object-contain rounded-md",preload:"metadata",muted:true,playsInline:true,onError:()=>o(true)}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsx("div",{className:"bg-black/60 rounded-full p-2 backdrop-blur-xs",children:jsxRuntime.jsx(chunkS4HRPNKF_js.D,{className:"size-5 text-white fill-white"})})})]}):jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center bg-transparent",children:jsxRuntime.jsx("div",{className:"text-center",children:jsxRuntime.jsx("div",{className:"text-4xl",children:jsxRuntime.jsx(chunkS4HRPNKF_js.J,{type:"video",className:t})})})})}function Ta({file:e}){var t;return (t=e.metaData)!=null&&t.duration?jsxRuntime.jsxs("p",{className:"text-xs text-primary mb-2",children:["Duration: ",Math.floor(e.metaData.duration/60),":",(e.metaData.duration%60).toString().padStart(2,"0")]}):null}function Ea({file:e,className:t}){return jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center bg-transparent",children:jsxRuntime.jsx("div",{className:"text-center",children:jsxRuntime.jsx("div",{className:"text-4xl",children:jsxRuntime.jsx(chunkS4HRPNKF_js.J,{type:"audio",className:t})})})})}function La({file:e}){var t;return (t=e.metaData)!=null&&t.duration?jsxRuntime.jsxs("p",{className:"text-xs text-primary mb-2",children:["Duration: ",Math.floor(e.metaData.duration/60),":",(e.metaData.duration%60).toString().padStart(2,"0")]}):null}function _a({file:e,className:t}){let a=chunkS4HRPNKF_js.I(e.mime,e.ext);return jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center bg-transparent relative",children:e.previewUrl?jsxRuntime.jsx("img",{src:e.previewUrl,alt:e.name,className:"w-full h-full object-contain rounded-md drop-shadow-md"}):jsxRuntime.jsx("div",{className:"text-center",children:jsxRuntime.jsx("div",{className:"text-4xl",children:jsxRuntime.jsx(chunkS4HRPNKF_js.J,{type:a,className:t})})})})}function Aa({file:e}){var t;return (t=e.metaData)!=null&&t.pageCount?jsxRuntime.jsxs("p",{className:"text-xs text-primary mb-2",children:["Pages: ",e.metaData.pageCount]}):null}function Oa({file:e}){let t=chunkS4HRPNKF_js.I(e.mime,e.ext);return jsxRuntime.jsx(chunkS4HRPNKF_js.J,{type:t})}var Ba={images:{component:Sa,metadataComponent:za},videos:{component:Ra,metadataComponent:Ta},files:{component:_a,metadataComponent:Aa},audios:{component:Ea,metadataComponent:La},default:{component:Oa}};function Xe(e){let t=chunkS4HRPNKF_js.H(e.mime,e.ext);return Ba[t]||Ba.default}function Mt(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("kbd",chunkS4HRPNKF_js.a({"data-slot":"kbd",className:f("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e)},t))}function kt(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("kbd",chunkS4HRPNKF_js.a({"data-slot":"kbd-group",className:f("inline-flex items-center gap-1",e)},t))}function Ga(){let{isUploadModalOpen:e,setIsUploadModalOpen:t,uploadFiles:a,allowedFileTypes:o,maxUploadFiles:r,maxUploadSize:n}=E(),s=chunkS4HRPNKF_js.K(o),m=chunkS4HRPNKF_js.L(o),[l,v]=Fi.useState([]),[{isDragging:u,errors:x},{removeFile:c,clearFiles:w,handleDragEnter:F,handleDragLeave:M,handleDragOver:C,handleDrop:N,openFileDialog:D,getInputProps:k}]=ka({maxFiles:r,maxSize:n,accept:s,multiple:true,onFilesChange:g=>{let R=g.map(T=>{let A=l.find(de=>de.id===T.id);return A?chunkS4HRPNKF_js.a(chunkS4HRPNKF_js.a({},A),T):chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},T),{progress:100,status:"completed"})});v(R);}}),b=g=>{c(g);},S=g=>{v(R=>R.map(T=>T.id===g?chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},T),{progress:0,status:"uploading",error:void 0}):T));},j=()=>{let g=l.filter(R=>R.status==="completed");if(g.length>0){let R=g.map(T=>({name:T.file.name,size:T.file.size,type:chunkS4HRPNKF_js.H(T.file.type,T.file.name.split(".").pop()),lastModified:T.file instanceof File?T.file.lastModified:Date.now(),file:T.file,metadata:{}}));a(R),J();}},J=()=>{t(false),w(),v([]);},te=(g,R)=>{let T={id:"temp",name:g.name,size:g.size,mime:g.type,ext:g.name.split(".").pop()||"",url:R||"",createdAt:new Date(g.lastModified),updatedAt:new Date(g.lastModified),folderId:null,metaData:{}},{component:A}=Xe(T);return jsxRuntime.jsx(A,{file:T,metaData:T.metaData})},ve=l.filter(g=>g.status==="completed").length,d=l.filter(g=>g.status==="uploading").length,I=ve>0&&d===0;return jsxRuntime.jsx(Fe,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(we,{className:"p-0 max-w-4xl max-h-[80vh] flex flex-col",variant:"default",showCloseButton:false,children:[jsxRuntime.jsxs(Le,{className:"pt-5 pb-3 m-0 border-b border-border",children:[jsxRuntime.jsx(Ne,{className:"px-6 text-base",children:jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[jsxRuntime.jsxs("span",{children:["Upload Files",jsxRuntime.jsx(kt,{className:"ml-2",children:jsxRuntime.jsxs(Mt,{children:[jsxRuntime.jsx("span",{className:"text-lg",children:"\u2318"})," + U"]})})]}),jsxRuntime.jsx(xe,{onClick:()=>t(false)})]})}),jsxRuntime.jsx(Je,{})]}),jsxRuntime.jsxs("div",{className:"p-6 overflow-y-auto flex-1",children:[jsxRuntime.jsxs("div",{className:f("relative rounded-lg border-dashed border-[2.5px] bg-muted border-border px-6 py-16 text-center transition-colors mb-4",u?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-muted-foreground/50"),onDragEnter:F,onDragLeave:M,onDragOver:C,onDrop:N,children:[jsxRuntime.jsx("input",chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},k()),{className:"sr-only"})),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("div",{className:f("flex h-12 w-12 items-center justify-center rounded-full transition-colors",u?"border-primary bg-primary/10":"border-muted-foreground/25"),children:jsxRuntime.jsx(Io,{className:"mb-3 text-muted-foreground"})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("p",{className:"text-sm font-medium",children:["Drop files here or"," ",jsxRuntime.jsx("button",{type:"button",onClick:D,className:"cursor-pointer text-primary underline-offset-4 underline",children:"browse files"})]}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[m," \u2022 Max size: ",ee(n)," \u2022 Max files: ",r]})]})]})]}),l.length>0&&jsxRuntime.jsx("div",{className:"space-y-4",children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:l.map(g=>jsxRuntime.jsxs("div",{className:"relative group",children:[jsxRuntime.jsx(xe,{onClick:()=>b(g.id),className:"absolute -inset-e-2 -top-2 z-10 size-6 rounded-full opacity-0 transition-opacity group-hover:opacity-100",iconClassName:"size-3"}),jsxRuntime.jsxs("div",{className:"relative overflow-hidden rounded-lg border bg-card transition-colors",children:[jsxRuntime.jsx("div",{className:"relative aspect-square bg-muted border-b border-border",children:jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center p-4",children:jsxRuntime.jsx("div",{className:"w-[75%] h-[75%] flex items-center justify-center",children:g.status==="uploading"?jsxRuntime.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",children:[jsxRuntime.jsxs("svg",{className:"size-12 -rotate-90 absolute",viewBox:"0 0 48 48",children:[jsxRuntime.jsx("circle",{cx:"24",cy:"24",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"3",className:"text-muted-foreground/20"}),jsxRuntime.jsx("circle",{cx:"24",cy:"24",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:`${2*Math.PI*20}`,strokeDashoffset:`${2*Math.PI*20*(1-g.progress/100)}`,className:"text-primary transition-all duration-300",strokeLinecap:"round"})]}),g.file instanceof File&&te(g.file,g.preview)]}):g.file instanceof File&&te(g.file,g.preview)})})}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("p",{className:"truncate text-xs font-medium",children:g.file.name}),jsxRuntime.jsxs("div",{className:"relative flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-[11px] text-primary font-semibold tracking-tight",children:ee(g.file.size)}),g.status==="error"&&g.error&&jsxRuntime.jsxs(wa,{children:[jsxRuntime.jsx(Na,{asChild:true,children:jsxRuntime.jsx(y,{onClick:()=>S(g.id),variant:"ghost",size:"icon",className:"absolute end-0 -top-1.25 size-6 text-destructive hover:bg-destructive/10 hover:text-destructive",children:jsxRuntime.jsx(chunkS4HRPNKF_js.F,{className:"size-3 opacity-100"})})}),jsxRuntime.jsx(Ma,{children:"Upload failed. Retry"})]})]})]})})]})]},g.id))})}),x.length>0&&jsxRuntime.jsxs(ba,{variant:"destructive",appearance:"light",className:"mt-5",children:[jsxRuntime.jsx(ya,{children:jsxRuntime.jsx(chunkS4HRPNKF_js.G,{})}),jsxRuntime.jsxs(Fa,{children:[jsxRuntime.jsx(ha,{children:"File upload error(s)"}),jsxRuntime.jsx(Ca,{children:x.map((g,R)=>jsxRuntime.jsx("p",{className:"last:mb-0",children:g},R))})]})]})]}),jsxRuntime.jsxs(_e,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[jsxRuntime.jsx(Ge,{asChild:true,children:jsxRuntime.jsx(y,{type:"button",radius:"full",variant:"outline",onClick:J,className:"w-full md:w-auto",children:"Cancel"})}),jsxRuntime.jsxs(y,{type:"button",radius:"full",onClick:j,disabled:!I,className:"w-full md:w-auto",children:["Upload ",ve>0&&`(${ve})`]})]})]})})}var On=classVarianceAuthority.cva(`
|
|
25
9
|
flex w-full bg-background border border-input shadow-xs shadow-black/5 transition-[color,box-shadow] text-foreground placeholder:text-muted-foreground/80
|
|
26
10
|
focus-visible:ring-ring/30 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-[3px]
|
|
27
11
|
disabled:cursor-not-allowed disabled:opacity-60
|
|
@@ -29,7 +13,7 @@
|
|
|
29
13
|
file:h-full [&[type=file]]:py-0 file:border-solid file:border-input file:bg-transparent
|
|
30
14
|
file:font-medium file:not-italic file:text-foreground file:p-0 file:border-0 file:border-e
|
|
31
15
|
aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
|
|
32
|
-
`,{variants:{variant:{lg:"h-10 px-4 text-sm rounded-md file:pe-4 file:me-4",md:"h-9 px-3 text-sm rounded-md file:pe-3 file:me-3",sm:"h-8 px-2.5 text-xs rounded-md file:pe-2.5 file:me-2.5"}},defaultVariants:{variant:"md"}})
|
|
16
|
+
`,{variants:{variant:{lg:"h-10 px-4 text-sm rounded-md file:pe-4 file:me-4",md:"h-9 px-3 text-sm rounded-md file:pe-3 file:me-3",sm:"h-8 px-2.5 text-xs rounded-md file:pe-2.5 file:me-2.5"}},defaultVariants:{variant:"md"}});classVarianceAuthority.cva("flex items-center shrink-0 justify-center bg-muted border border-input shadow-xs shadow-[rgba(0,0,0,0.05)] text-secondary-foreground [&_svg]:text-secondary-foreground/60",{variants:{variant:{lg:"rounded-md h-10 min-w-10 px-4 text-sm [&_svg:not([class*=size-])]:size-4.5",md:"rounded-md h-9 min-w-9 px-3 text-sm [&_svg:not([class*=size-])]:size-4.5",sm:"rounded-md h-8 min-w-7 text-xs px-2.5 [&_svg:not([class*=size-])]:size-3.5"},mode:{default:"",icon:"px-0 justify-center"}},defaultVariants:{variant:"md",mode:"default"}});classVarianceAuthority.cva(`
|
|
33
17
|
flex items-stretch
|
|
34
18
|
[&_[data-slot=input]]:grow
|
|
35
19
|
[&_[data-slot=input-addon]:has(+[data-slot=input])]:rounded-e-none [&_[data-slot=input-addon]:has(+[data-slot=input])]:border-e-0
|
|
@@ -48,7 +32,7 @@
|
|
|
48
32
|
[&_[data-slot=datefield]+[data-slot=input-addon]]:border-s-0
|
|
49
33
|
[&_[data-slot=datefield]:has(~[data-slot=input-addon])]:[&_[data-slot=input]]:rounded-e-none
|
|
50
34
|
[&_[data-slot=datefield]~[data-slot=input-addon]]:rounded-s-none
|
|
51
|
-
`,{variants:{},defaultVariants:{}})
|
|
35
|
+
`,{variants:{},defaultVariants:{}});classVarianceAuthority.cva(`
|
|
52
36
|
flex items-center gap-1.5
|
|
53
37
|
has-[:focus-visible]:ring-ring/30
|
|
54
38
|
has-[:focus-visible]:border-ring
|
|
@@ -81,36 +65,35 @@
|
|
|
81
65
|
has-[[aria-invalid=true]]:ring-destructive/10
|
|
82
66
|
dark:has-[[aria-invalid=true]]:border-destructive
|
|
83
67
|
dark:has-[[aria-invalid=true]]:ring-destructive/20
|
|
84
|
-
`,{variants:{variant:{sm:"gap-1.25 [&_svg:not([class*=size-])]:size-3.5",md:"gap-1.5 [&_svg:not([class*=size-])]:size-4",lg:"gap-1.5 [&_svg:not([class*=size-])]:size-4"}},defaultVariants:{variant:"md"}});function ho(n){var i=n,{className:e,type:t,variant:o}=i,a=f(i,["className","type","variant"]);return(0,en.jsx)("input",r({"data-slot":"input",type:t,className:v(Li({variant:o}),e)},a))}var ne=require("react/jsx-runtime");function tn(){let{isCreateFolderModalOpen:e,setIsCreateFolderModalOpen:t,isRenameFolderModalOpen:o,setIsRenameFolderModalOpen:a,createFolder:n,renameFolder:i,folderToRename:l,setFolderToRename:c}=G(),[d,g]=(0,ma.useState)(""),u=o,b=e||o;(0,ma.useEffect)(()=>{o&&l?g(l.name):e||g("")},[o,e,l]);let p=async()=>{if(d.trim()!==""){if(u&&l){let w=l.id;w!==null&&await i(w,d.trim()),a(!1),c(null)}else n(d.trim()),t(!1);g("")}},C=()=>{u?(a(!1),c(null)):t(!1),g("")};return b?(0,ne.jsx)(Te,{open:b,onOpenChange:C,children:(0,ne.jsxs)(Ee,{className:"p-0 max-w-xl m-auto max-h-[32vh] flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,ne.jsx)(We,{className:"pt-5 pb-3 m-0 border-b border-border flex w-full justify-between",children:(0,ne.jsx)(Le,{className:"px-6 text-base",children:(0,ne.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,ne.jsxs)("span",{children:[u?"Rename Folder":"Create New Folder",!u&&(0,ne.jsx)("span",{className:"ml-4",children:(0,ne.jsx)(go,{children:(0,ne.jsxs)(fo,{children:[(0,ne.jsx)("span",{className:"text-lg",children:"\u2318"})," + F"]})})})]}),(0,ne.jsx)(Ie,{onClick:C})]})})}),(0,ne.jsxs)("div",{className:"p-6",children:[(0,ne.jsx)("label",{htmlFor:"folder-name",className:"hidden mb-2",children:"Folder Name:"}),(0,ne.jsx)(ho,{id:"folder-name",name:"folder-name",value:d,onChange:w=>g(w.target.value),placeholder:"Enter folder name",autoFocus:!0,onKeyDown:w=>{w.key==="Enter"&&d.trim()!==""&&p()}})]}),(0,ne.jsxs)($e,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,ne.jsx)(ot,{asChild:!0,children:(0,ne.jsx)(F,{type:"button",variant:"outline",onClick:C,radius:"full",className:"w-full md:w-auto",children:"Cancel"})}),(0,ne.jsx)(F,{type:"button",disabled:d.trim()==="",onClick:p,radius:"full",className:"w-full md:w-auto",children:u?"Rename":"Create"})]})]})}):null}var vt=require("react");function Ye(e,t=30){if(e.length<=t)return e;let o=e.slice(0,Math.ceil(t/2)),a=e.slice(-Math.floor(t/2));return`${o}...${a}`}var Ht=require("react");function Ka({threshold:e=0,root:t=null,rootMargin:o="0%"}={}){let[a,n]=(0,Ht.useState)(),[i,l]=(0,Ht.useState)(null),c=(0,Ht.useRef)(null);return(0,Ht.useEffect)(()=>(c.current&&c.current.disconnect(),i&&typeof window!="undefined"&&"IntersectionObserver"in window&&(c.current=new IntersectionObserver(([d])=>{n(d)},{threshold:e,root:t,rootMargin:o}),c.current.observe(i)),()=>{c.current&&c.current.disconnect()}),[i,e,t,o]),{ref:l,entry:a}}var N=require("react/jsx-runtime");function on({folder:e,selectedFolderId:t,onSelect:o,onLoadChildren:a,disabledFolderIds:n=[],treeState:i}){var h;let[l,c]=(0,vt.useState)(!1),d=((h=e.folderCount)!=null?h:0)>0,g=t===e.id,u=n.includes(e.id),b=i.loading.has(e.id),p=i.loaded.has(e.id),C=i.folders.get(e.id)||[],w=i.pagination.get(e.id),{ref:D,entry:y}=Ka({threshold:.1,rootMargin:"100px"}),k=w&&w.currentPage<w.totalPages;return(0,vt.useEffect)(()=>{if(l&&(y!=null&&y.isIntersecting)&&k&&!b){let I=((w==null?void 0:w.currentPage)||1)+1;a(e.id,I)}},[y==null?void 0:y.isIntersecting,k,b,l,w,e.id,a]),(0,N.jsxs)("li",{children:[(0,N.jsxs)("div",{className:"flex items-center gap-1.5 py-1",children:[d?(0,N.jsx)("button",{onClick:async()=>{if(!d)return;let I=!l;c(I),I&&!p&&!b&&await a(e.id,1)},className:"p-1 -m-1 hover:bg-gray-100 dark:hover:bg-zinc-700 rounded transition-colors","aria-label":l?"Collapse folder":"Expand folder",children:(0,N.jsx)(ct,{className:`size-4 text-gray-500 dark:text-zinc-400 transition-transform ${!u&&l?"rotate-90":""}`})}):(0,N.jsx)("div",{className:"w-4"}),(0,N.jsxs)("button",{onClick:()=>{u||o(e.id)},disabled:u,title:e.name,className:`flex items-center gap-1.5 px-2 py-1 rounded-xl flex-1 text-left transition-colors min-w-0 ${g?"bg-blue-100 text-blue-600 dark:text-blue-400 font-semibold":u?"opacity-50 cursor-not-allowed":"hover:bg-gray-100 dark:hover:bg-zinc-700"}`,children:[(0,N.jsx)(Xe,{className:"size-8 text-white shrink-0",strokeWidth:1.5}),(0,N.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,N.jsx)("span",{className:"truncate min-w-0",children:Ye(e.name,15)}),u?(0,N.jsx)("span",{className:"text-[0.6rem] text-left font-medium text-gray-900 dark:text-zinc-300",children:"(Already selected)"}):""]})]})]}),!u&&l&&(0,N.jsxs)("ul",{className:"pl-6",children:[C.map(I=>(0,N.jsx)(on,{folder:I,selectedFolderId:t,onSelect:o,onLoadChildren:a,disabledFolderIds:n,treeState:i},I.id)),(b||k)&&(0,N.jsx)("li",{ref:D,className:"py-2 pl-6 flex justify-start",children:(0,N.jsx)(ge,{className:"h-4 w-4 animate-spin text-blue-500"})}),b&&C.length===0&&(0,N.jsx)("li",{className:"py-1",children:(0,N.jsx)("div",{className:"flex items-center gap-1.5 px-2",children:(0,N.jsx)("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:"Loading..."})})})]})]})}function an(){let{isMoveFileModalOpen:e,setIsMoveFileModalOpen:t,selectedFiles:o,selectedFolders:a,bulkMove:n,provider:i}=G(),[l,c]=(0,vt.useState)(void 0),[d,g]=(0,vt.useState)({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}),{ref:u,entry:b}=Ka({threshold:.1,rootMargin:"100px"}),p=d.pagination.get(null),C=p&&p.currentPage<p.totalPages,w=d.loading.has(null),D=a.map(h=>h.id),y=d.folders.get(null)||[];(0,vt.useEffect)(()=>{e&&!d.loaded.has(null)&&!d.loading.has(null)&&k(null,1)},[e]),(0,vt.useEffect)(()=>{if(e&&(b!=null&&b.isIntersecting)&&C&&!w){let h=((p==null?void 0:p.currentPage)||1)+1;k(null,h)}},[b==null?void 0:b.isIntersecting,C,w,p,e]);let k=async(h,I=1)=>{if(!d.loading.has(h)){g(Y=>s(r({},Y),{loading:new Set(Y.loading).add(h)}));try{let Y=await i.getFolders(h,I,20);g(te=>{let se=new Set(te.loading);se.delete(h);let De=new Set(te.loaded);De.add(h);let m=new Map(te.folders),_=m.get(h)||[];I>1?m.set(h,[..._,...Y.folders]):m.set(h,Y.folders);let x=new Map(te.pagination);return x.set(h,Y.pagination),{folders:m,loading:se,loaded:De,pagination:x}})}catch(Y){console.error(`Failed to load folders for ${h}:`,Y),g(te=>{let se=new Set(te.loading);return se.delete(h),s(r({},te),{loading:se})})}}},z=()=>{l!==void 0&&(n(l),t(!1),c(void 0),g({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}))},R=h=>{t(h),h?k(null,1):(c(void 0),g({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}))};return e?(0,N.jsx)(Te,{open:e,onOpenChange:R,children:(0,N.jsxs)(Ee,{className:"p-0 max-w-3xl max-h-full m-auto md:max-h-[80vh] flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,N.jsxs)(We,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,N.jsx)(Le,{className:"px-6 text-base",children:(0,N.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,N.jsxs)("span",{className:"w-full text-left",children:["Move Items",(0,N.jsxs)("p",{className:"text-gray-400 text-xs",children:["Moving ",o.length," file",o.length===1?"":"s"," and"," ",a.length," folder",a.length===1?"":"s","."]})]}),(0,N.jsx)(Ie,{onClick:()=>R(!1)})]})}),(0,N.jsx)(mt,{})]}),(0,N.jsx)("div",{className:"text-sm my-3 px-6 flex-1 flex flex-col min-h-0",children:(0,N.jsx)("div",{className:"space-y-4 flex flex-col flex-1 min-h-0",children:(0,N.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,N.jsx)("label",{className:"block mb-2 font-medium text-gray-900 dark:text-zinc-100",children:"Select destination folder:"}),(0,N.jsxs)("ul",{className:"border rounded-xl p-2 shadow-inner overflow-y-auto flex-1 min-h-0",children:[(0,N.jsx)("li",{children:(0,N.jsxs)("div",{className:"flex items-center gap-1.5 py-1",children:[(0,N.jsx)("div",{className:"w-4"}),(0,N.jsxs)("button",{onClick:()=>c(null),className:`flex items-center gap-1.5 px-2 py-1 rounded-xl flex-1 text-left transition-colors min-w-0 ${l===null?"bg-blue-100 text-blue-600 dark:text-blue-400 font-semibold":"hover:bg-gray-100 dark:hover:bg-zinc-700"}`,children:[(0,N.jsx)(Xe,{className:"size-8 text-white shrink-0",strokeWidth:1.5}),(0,N.jsx)("div",{className:"flex flex-col gap-1",children:(0,N.jsx)("span",{className:"truncate min-w-0",children:"Root Directory"})})]})]})}),y.map(h=>(0,N.jsx)(on,{folder:h,selectedFolderId:l,onSelect:I=>c(I),onLoadChildren:k,disabledFolderIds:D,treeState:d},h.id)),(w||C)&&(0,N.jsx)("li",{ref:u,className:"py-2 pl-6 flex justify-start",children:(0,N.jsx)(ge,{className:"h-5 w-5 animate-spin text-blue-500"})}),y.length===0&&!w&&!C&&(0,N.jsx)("li",{className:"text-gray-500 dark:text-zinc-400 text-sm text-center py-4",children:"No nested folders available"})]})]})})}),(0,N.jsxs)($e,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,N.jsx)(ot,{asChild:!0,children:(0,N.jsx)(F,{type:"button",variant:"outline",radius:"full",className:"w-full md:w-auto",children:"Cancel"})}),(0,N.jsx)(F,{type:"button",onClick:z,disabled:l===void 0,radius:"full",className:"w-full md:w-auto",children:"Move"})]})]})}):null}var Lo=require("react");var vo=require("radix-ui");var xt=require("react/jsx-runtime");function rn(i){var l=i,{className:e,viewportClassName:t,children:o,viewportRef:a}=l,n=f(l,["className","viewportClassName","children","viewportRef"]);return(0,xt.jsxs)(vo.ScrollArea.Root,s(r({"data-slot":"scroll-area",className:v("relative overflow-hidden",e)},n),{children:[(0,xt.jsx)(vo.ScrollArea.Viewport,{ref:a,className:v("h-full w-full rounded-[inherit]",t),children:o}),(0,xt.jsx)(Ai,{}),(0,xt.jsx)(vo.ScrollArea.Corner,{})]}))}function Ai(a){var n=a,{className:e,orientation:t="vertical"}=n,o=f(n,["className","orientation"]);return(0,xt.jsx)(vo.ScrollArea.ScrollAreaScrollbar,s(r({"data-slot":"scroll-area-scrollbar",orientation:t,className:v("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-[1px]",e)},o),{children:(0,xt.jsx)(vo.ScrollArea.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}))}var we=require("react/jsx-runtime");function bt({title:e,open:t,onClose:o,previewSection:a,metadataSection:n,footer:i}){return(0,we.jsx)(Te,{open:t,onOpenChange:l=>!l&&o(),children:(0,we.jsxs)(Ee,{className:"p-0 max-w-6xl w-full mx-auto flex flex-col",variant:"fullscreen",showCloseButton:!1,children:[(0,we.jsxs)(We,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,we.jsx)(Le,{className:"px-6 text-base",children:(0,we.jsxs)("div",{className:"flex w-full justify-between gap-2",children:[(0,we.jsx)("span",{children:e}),(0,we.jsx)(Ie,{onClick:()=>o()})]})}),(0,we.jsx)(mt,{})]}),(0,we.jsx)(rn,{className:"flex-1 h-0",children:(0,we.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 min-h-full",children:[(0,we.jsx)("div",{className:"p-6 border-b lg:border-b-0 lg:border-r border-slate-200 dark:border-zinc-700",children:a}),(0,we.jsx)("div",{className:"p-6 overflow-y-auto ",children:n})]})}),(0,we.jsx)($e,{className:"px-6 py-4 border-t border-border",children:i})]})})}var Zt=require("sonner");var fa=require("react");var _e=require("react/jsx-runtime");function wt({file:e}){let{provider:t,setFileDetailsModalFile:o,refreshData:a}=G(),[n,i]=(0,fa.useState)(!1);return(0,_e.jsx)(F,{variant:"outline",size:"icon",radius:"full",title:"Delete",className:"border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:text-red-600 dark:hover:text-red-400 hover:border-red-300 dark:hover:border-red-700 hover:bg-red-50 dark:hover:bg-red-900/40 active:scale-95 transition-all duration-200",onClick:async()=>{i(!0);try{await t.deleteFiles([e.id]),await a(),o(null),Zt.toast.success("File Deleted",{description:`${Ye(e.name,20)} has been deleted`})}catch(c){Zt.toast.error("Delete failed"),i(!1)}},disabled:n,children:n?(0,_e.jsx)(ge,{className:"size-5 animate-spin"}):(0,_e.jsx)(Ue,{className:"size-5"})})}function Ct({file:e}){let[t,o]=(0,fa.useState)(!1);return(0,_e.jsx)(F,{variant:"outline",size:"icon",radius:"full",onClick:async()=>{o(!0);try{let n=document.createElement("a");n.href=e.url,n.download=e.name,n.click(),Zt.toast.success("Download Started",{description:`Downloading ${Ye(e.name,20)}`})}catch(n){Zt.toast.error("Download failed")}finally{o(!1)}},className:"border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:text-blue-600 dark:hover:text-blue-400 hover:border-blue-300 dark:hover:border-blue-700 hover:bg-blue-50 dark:hover:bg-blue-900/40 active:scale-95 transition-all duration-200",title:"Download",disabled:t,children:t?(0,_e.jsx)(ge,{className:"size-5 animate-spin"}):(0,_e.jsx)(na,{className:"size-5",strokeWidth:2.5})})}function yt({file:e}){let[t,o]=(0,fa.useState)(!1);return(0,_e.jsx)(F,{variant:"outline",size:"icon",radius:"full",onClick:async()=>{try{await navigator.clipboard.writeText(e.url),o(!0),Zt.toast.success("Link Copied",{description:"File URL copied to clipboard"}),setTimeout(()=>o(!1),2e3)}catch(n){Zt.toast.error("Failed to copy link")}},className:`border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 active:scale-95 transition-all duration-200
|
|
85
|
-
${t?"text-green-700 dark:text-green-400 border-green-400 dark:border-green-700 bg-green-100 dark:bg-green-900/40 font-bold":"hover:text-orange-600 dark:hover:text-orange-400 hover:border-orange-300 dark:hover:border-orange-700 hover:bg-orange-50 dark:hover:bg-orange-900/40"}`,title:"Copy Link",disabled:t,children:t?
|
|
68
|
+
`,{variants:{variant:{sm:"gap-1.25 [&_svg:not([class*=size-])]:size-3.5",md:"gap-1.5 [&_svg:not([class*=size-])]:size-4",lg:"gap-1.5 [&_svg:not([class*=size-])]:size-4"}},defaultVariants:{variant:"md"}});function Dt(r){var n=r,{className:e,type:t,variant:a}=n,o=chunkS4HRPNKF_js.c(n,["className","type","variant"]);return jsxRuntime.jsx("input",chunkS4HRPNKF_js.a({"data-slot":"input",type:t,className:f(On({variant:a}),e)},o))}function Ua(){let{isCreateFolderModalOpen:e,setIsCreateFolderModalOpen:t,isRenameFolderModalOpen:a,setIsRenameFolderModalOpen:o,createFolder:r,renameFolder:n,folderToRename:s,setFolderToRename:m}=E(),[l,v]=Fi.useState(""),u=a,x=e||a;Fi.useEffect(()=>{a&&s?v(s.name):e||v("");},[a,e,s]);let c=async()=>{if(l.trim()!==""){if(u&&s){let F=s.id;F!==null&&await n(F,l.trim()),o(false),m(null);}else r(l.trim()),t(false);v("");}},w=()=>{u?(o(false),m(null)):t(false),v("");};return x?jsxRuntime.jsx(Fe,{open:x,onOpenChange:w,children:jsxRuntime.jsxs(we,{className:"p-0 max-w-xl m-auto max-h-[32vh] flex flex-col",variant:"fullscreen",showCloseButton:false,children:[jsxRuntime.jsx(Le,{className:"pt-5 pb-3 m-0 border-b border-border flex w-full justify-between",children:jsxRuntime.jsx(Ne,{className:"px-6 text-base",children:jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[jsxRuntime.jsxs("span",{children:[u?"Rename Folder":"Create New Folder",!u&&jsxRuntime.jsx("span",{className:"ml-4",children:jsxRuntime.jsx(kt,{children:jsxRuntime.jsxs(Mt,{children:[jsxRuntime.jsx("span",{className:"text-lg",children:"\u2318"})," + F"]})})})]}),jsxRuntime.jsx(xe,{onClick:w})]})})}),jsxRuntime.jsxs("div",{className:"p-6",children:[jsxRuntime.jsx("label",{htmlFor:"folder-name",className:"hidden mb-2",children:"Folder Name:"}),jsxRuntime.jsx(Dt,{id:"folder-name",name:"folder-name",value:l,onChange:F=>v(F.target.value),placeholder:"Enter folder name",autoFocus:true,onKeyDown:F=>{F.key==="Enter"&&l.trim()!==""&&c();}})]}),jsxRuntime.jsxs(_e,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[jsxRuntime.jsx(Ge,{asChild:true,children:jsxRuntime.jsx(y,{type:"button",variant:"outline",onClick:w,radius:"full",className:"w-full md:w-auto",children:"Cancel"})}),jsxRuntime.jsx(y,{type:"button",disabled:l.trim()==="",onClick:c,radius:"full",className:"w-full md:w-auto",children:u?"Rename":"Create"})]})]})}):null}function Ae(e,t=30){if(e.length<=t)return e;let a=e.slice(0,Math.ceil(t/2)),o=e.slice(-Math.floor(t/2));return `${a}...${o}`}function zo({threshold:e=0,root:t=null,rootMargin:a="0%"}={}){let[o,r]=Fi.useState(),[n,s]=Fi.useState(null),m=Fi.useRef(null);return Fi.useEffect(()=>(m.current&&m.current.disconnect(),n&&typeof window!="undefined"&&"IntersectionObserver"in window&&(m.current=new IntersectionObserver(([l])=>{r(l);},{threshold:e,root:t,rootMargin:a}),m.current.observe(n)),()=>{m.current&&m.current.disconnect();}),[n,e,t,a]),{ref:s,entry:o}}function $a({folder:e,selectedFolderId:t,onSelect:a,onLoadChildren:o,disabledFolderIds:r=[],treeState:n}){var b;let[s,m]=Fi.useState(false),l=((b=e.folderCount)!=null?b:0)>0,v=t===e.id,u=r.includes(e.id),x=n.loading.has(e.id),c=n.loaded.has(e.id),w=n.folders.get(e.id)||[],F=n.pagination.get(e.id),{ref:M,entry:C}=zo({threshold:.1,rootMargin:"100px"}),N=F&&F.currentPage<F.totalPages;return Fi.useEffect(()=>{if(s&&(C!=null&&C.isIntersecting)&&N&&!x){let S=((F==null?void 0:F.currentPage)||1)+1;o(e.id,S);}},[C==null?void 0:C.isIntersecting,N,x,s,F,e.id,o]),jsxRuntime.jsxs("li",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 py-1",children:[l?jsxRuntime.jsx("button",{onClick:async()=>{if(!l)return;let S=!s;m(S),S&&!c&&!x&&await o(e.id,1);},className:"p-1 -m-1 hover:bg-gray-100 dark:hover:bg-zinc-700 rounded transition-colors","aria-label":s?"Collapse folder":"Expand folder",children:jsxRuntime.jsx(chunkS4HRPNKF_js.o,{className:`size-4 text-gray-500 dark:text-zinc-400 transition-transform ${!u&&s?"rotate-90":""}`})}):jsxRuntime.jsx("div",{className:"w-4"}),jsxRuntime.jsxs("button",{onClick:()=>{u||a(e.id);},disabled:u,title:e.name,className:`flex items-center gap-1.5 px-2 py-1 rounded-xl flex-1 text-left transition-colors min-w-0 ${v?"bg-blue-100 text-blue-600 dark:text-blue-400 font-semibold":u?"opacity-50 cursor-not-allowed":"hover:bg-gray-100 dark:hover:bg-zinc-700"}`,children:[jsxRuntime.jsx(chunkS4HRPNKF_js.j,{className:"size-8 text-white shrink-0",strokeWidth:1.5}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx("span",{className:"truncate min-w-0",children:Ae(e.name,15)}),u?jsxRuntime.jsx("span",{className:"text-[0.6rem] text-left font-medium text-gray-900 dark:text-zinc-300",children:"(Already selected)"}):""]})]})]}),!u&&s&&jsxRuntime.jsxs("ul",{className:"pl-6",children:[w.map(S=>jsxRuntime.jsx($a,{folder:S,selectedFolderId:t,onSelect:a,onLoadChildren:o,disabledFolderIds:r,treeState:n},S.id)),(x||N)&&jsxRuntime.jsx("li",{ref:M,className:"py-2 pl-6 flex justify-start",children:jsxRuntime.jsx(chunkS4HRPNKF_js.C,{className:"h-4 w-4 animate-spin text-blue-500"})}),x&&w.length===0&&jsxRuntime.jsx("li",{className:"py-1",children:jsxRuntime.jsx("div",{className:"flex items-center gap-1.5 px-2",children:jsxRuntime.jsx("span",{className:"text-sm text-gray-500 dark:text-zinc-400",children:"Loading..."})})})]})]})}function Ka(){let{isMoveFileModalOpen:e,setIsMoveFileModalOpen:t,selectedFiles:a,selectedFolders:o,bulkMove:r,provider:n}=E(),[s,m]=Fi.useState(void 0),[l,v]=Fi.useState({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}),{ref:u,entry:x}=zo({threshold:.1,rootMargin:"100px"}),c=l.pagination.get(null),w=c&&c.currentPage<c.totalPages,F=l.loading.has(null),M=o.map(b=>b.id),C=l.folders.get(null)||[];Fi.useEffect(()=>{e&&!l.loaded.has(null)&&!l.loading.has(null)&&N(null,1);},[e]),Fi.useEffect(()=>{if(e&&(x!=null&&x.isIntersecting)&&w&&!F){let b=((c==null?void 0:c.currentPage)||1)+1;N(null,b);}},[x==null?void 0:x.isIntersecting,w,F,c,e]);let N=async(b,S=1)=>{if(!l.loading.has(b)){v(j=>chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},j),{loading:new Set(j.loading).add(b)}));try{let j=await n.getFolders(b,S,20);v(J=>{let te=new Set(J.loading);te.delete(b);let ve=new Set(J.loaded);ve.add(b);let d=new Map(J.folders),I=d.get(b)||[];S>1?d.set(b,[...I,...j.folders]):d.set(b,j.folders);let g=new Map(J.pagination);return g.set(b,j.pagination),{folders:d,loading:te,loaded:ve,pagination:g}});}catch(j){console.error(`Failed to load folders for ${b}:`,j),v(J=>{let te=new Set(J.loading);return te.delete(b),chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},J),{loading:te})});}}},D=()=>{s!==void 0&&(r(s),t(false),m(void 0),v({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}));},k=b=>{t(b),b?N(null,1):(m(void 0),v({folders:new Map,loading:new Set,loaded:new Set,pagination:new Map}));};return e?jsxRuntime.jsx(Fe,{open:e,onOpenChange:k,children:jsxRuntime.jsxs(we,{className:"p-0 max-w-3xl max-h-full m-auto md:max-h-[80vh] flex flex-col",variant:"fullscreen",showCloseButton:false,children:[jsxRuntime.jsxs(Le,{className:"pt-5 pb-3 m-0 border-b border-border",children:[jsxRuntime.jsx(Ne,{className:"px-6 text-base",children:jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[jsxRuntime.jsxs("span",{className:"w-full text-left",children:["Move Items",jsxRuntime.jsxs("p",{className:"text-gray-400 text-xs",children:["Moving ",a.length," file",a.length===1?"":"s"," and"," ",o.length," folder",o.length===1?"":"s","."]})]}),jsxRuntime.jsx(xe,{onClick:()=>k(false)})]})}),jsxRuntime.jsx(Je,{})]}),jsxRuntime.jsx("div",{className:"text-sm my-3 px-6 flex-1 flex flex-col min-h-0",children:jsxRuntime.jsx("div",{className:"space-y-4 flex flex-col flex-1 min-h-0",children:jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[jsxRuntime.jsx("label",{className:"block mb-2 font-medium text-gray-900 dark:text-zinc-100",children:"Select destination folder:"}),jsxRuntime.jsxs("ul",{className:"border rounded-xl p-2 shadow-inner overflow-y-auto flex-1 min-h-0",children:[jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 py-1",children:[jsxRuntime.jsx("div",{className:"w-4"}),jsxRuntime.jsxs("button",{onClick:()=>m(null),className:`flex items-center gap-1.5 px-2 py-1 rounded-xl flex-1 text-left transition-colors min-w-0 ${s===null?"bg-blue-100 text-blue-600 dark:text-blue-400 font-semibold":"hover:bg-gray-100 dark:hover:bg-zinc-700"}`,children:[jsxRuntime.jsx(chunkS4HRPNKF_js.j,{className:"size-8 text-white shrink-0",strokeWidth:1.5}),jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:jsxRuntime.jsx("span",{className:"truncate min-w-0",children:"Root Directory"})})]})]})}),C.map(b=>jsxRuntime.jsx($a,{folder:b,selectedFolderId:s,onSelect:S=>m(S),onLoadChildren:N,disabledFolderIds:M,treeState:l},b.id)),(F||w)&&jsxRuntime.jsx("li",{ref:u,className:"py-2 pl-6 flex justify-start",children:jsxRuntime.jsx(chunkS4HRPNKF_js.C,{className:"h-5 w-5 animate-spin text-blue-500"})}),C.length===0&&!F&&!w&&jsxRuntime.jsx("li",{className:"text-gray-500 dark:text-zinc-400 text-sm text-center py-4",children:"No nested folders available"})]})]})})}),jsxRuntime.jsxs(_e,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[jsxRuntime.jsx(Ge,{asChild:true,children:jsxRuntime.jsx(y,{type:"button",variant:"outline",radius:"full",className:"w-full md:w-auto",children:"Cancel"})}),jsxRuntime.jsx(y,{type:"button",onClick:D,disabled:s===void 0,radius:"full",className:"w-full md:w-auto",children:"Move"})]})]})}):null}function Wa(n){var s=n,{className:e,viewportClassName:t,children:a,viewportRef:o}=s,r=chunkS4HRPNKF_js.c(s,["className","viewportClassName","children","viewportRef"]);return jsxRuntime.jsxs(radixUi.ScrollArea.Root,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({"data-slot":"scroll-area",className:f("relative overflow-hidden",e)},r),{children:[jsxRuntime.jsx(radixUi.ScrollArea.Viewport,{ref:o,className:f("h-full w-full rounded-[inherit]",t),children:a}),jsxRuntime.jsx($n,{}),jsxRuntime.jsx(radixUi.ScrollArea.Corner,{})]}))}function $n(o){var r=o,{className:e,orientation:t="vertical"}=r,a=chunkS4HRPNKF_js.c(r,["className","orientation"]);return jsxRuntime.jsx(radixUi.ScrollArea.ScrollAreaScrollbar,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({"data-slot":"scroll-area-scrollbar",orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-[1px]",e)},a),{children:jsxRuntime.jsx(radixUi.ScrollArea.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}))}function et({title:e,open:t,onClose:a,previewSection:o,metadataSection:r,footer:n}){return jsxRuntime.jsx(Fe,{open:t,onOpenChange:s=>!s&&a(),children:jsxRuntime.jsxs(we,{className:"p-0 max-w-6xl w-full mx-auto flex flex-col",variant:"fullscreen",showCloseButton:false,children:[jsxRuntime.jsxs(Le,{className:"pt-5 pb-3 m-0 border-b border-border",children:[jsxRuntime.jsx(Ne,{className:"px-6 text-base",children:jsxRuntime.jsxs("div",{className:"flex w-full justify-between gap-2",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx(xe,{onClick:()=>a()})]})}),jsxRuntime.jsx(Je,{})]}),jsxRuntime.jsx(Wa,{className:"flex-1 h-0",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 min-h-full",children:[jsxRuntime.jsx("div",{className:"p-6 border-b lg:border-b-0 lg:border-r border-slate-200 dark:border-zinc-700",children:o}),jsxRuntime.jsx("div",{className:"p-6 overflow-y-auto ",children:r})]})}),jsxRuntime.jsx(_e,{className:"px-6 py-4 border-t border-border",children:n})]})})}function tt({file:e}){let{provider:t,setFileDetailsModalFile:a,refreshData:o}=E(),[r,n]=Fi.useState(false);return jsxRuntime.jsx(y,{variant:"outline",size:"icon",radius:"full",title:"Delete",className:"border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:text-red-600 dark:hover:text-red-400 hover:border-red-300 dark:hover:border-red-700 hover:bg-red-50 dark:hover:bg-red-900/40 active:scale-95 transition-all duration-200",onClick:async()=>{n(true);try{await t.deleteFiles([e.id]),await o(),a(null),sonner.toast.success("File Deleted",{description:`${Ae(e.name,20)} has been deleted`});}catch(m){sonner.toast.error("Delete failed"),n(false);}},disabled:r,children:r?jsxRuntime.jsx(chunkS4HRPNKF_js.C,{className:"size-5 animate-spin"}):jsxRuntime.jsx(chunkS4HRPNKF_js.r,{className:"size-5"})})}function ot({file:e}){let[t,a]=Fi.useState(false);return jsxRuntime.jsx(y,{variant:"outline",size:"icon",radius:"full",onClick:async()=>{a(true);try{let r=document.createElement("a");r.href=e.url,r.download=e.name,r.click(),sonner.toast.success("Download Started",{description:`Downloading ${Ae(e.name,20)}`});}catch(r){sonner.toast.error("Download failed");}finally{a(false);}},className:"border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:text-blue-600 dark:hover:text-blue-400 hover:border-blue-300 dark:hover:border-blue-700 hover:bg-blue-50 dark:hover:bg-blue-900/40 active:scale-95 transition-all duration-200",title:"Download",disabled:t,children:t?jsxRuntime.jsx(chunkS4HRPNKF_js.C,{className:"size-5 animate-spin"}):jsxRuntime.jsx(chunkS4HRPNKF_js.t,{className:"size-5",strokeWidth:2.5})})}function at({file:e}){let[t,a]=Fi.useState(false);return jsxRuntime.jsx(y,{variant:"outline",size:"icon",radius:"full",onClick:async()=>{try{await navigator.clipboard.writeText(e.url),a(!0),sonner.toast.success("Link Copied",{description:"File URL copied to clipboard"}),setTimeout(()=>a(!1),2e3);}catch(r){sonner.toast.error("Failed to copy link");}},className:`border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 active:scale-95 transition-all duration-200
|
|
69
|
+
${t?"text-green-700 dark:text-green-400 border-green-400 dark:border-green-700 bg-green-100 dark:bg-green-900/40 font-bold":"hover:text-orange-600 dark:hover:text-orange-400 hover:border-orange-300 dark:hover:border-orange-700 hover:bg-orange-50 dark:hover:bg-orange-900/40"}`,title:"Copy Link",disabled:t,children:t?jsxRuntime.jsx(chunkS4HRPNKF_js.w,{className:"size-5 animate-in zoom-in duration-200",strokeWidth:3}):jsxRuntime.jsx(chunkS4HRPNKF_js.u,{className:"size-5",strokeWidth:2.5})})}function ja({file:e,onFullscreen:t}){return jsxRuntime.jsx(y,{variant:"outline",size:"icon",radius:"full",onClick:t,className:"border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:text-purple-600 dark:hover:text-purple-400 hover:border-purple-300 dark:hover:border-purple-700 hover:bg-purple-50 dark:hover:bg-purple-900/40 active:scale-95 transition-all duration-200",title:"Fullscreen",children:jsxRuntime.jsx(chunkS4HRPNKF_js.v,{className:"size-5",strokeWidth:1})})}var jn=classVarianceAuthority.cva(`
|
|
86
70
|
w-full bg-background border border-input bg-background text-foreground shadow-xs shadow-black/5 transition-[color,box-shadow]
|
|
87
71
|
text-foreground placeholder:text-muted-foreground/80 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-[3px]
|
|
88
72
|
focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 [&[readonly]]:opacity-70
|
|
89
73
|
aria-invalid:border-destructive aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
|
|
90
|
-
`,{variants:{variant:{sm:"px-2.5 py-2.5 text-xs rounded-md",md:"px-3 py-3 text-sm rounded-md",lg:"px-4 py-4 text-sm rounded-md"}},defaultVariants:{variant:"md"}});function
|
|
74
|
+
`,{variants:{variant:{sm:"px-2.5 py-2.5 text-xs rounded-md",md:"px-3 py-3 text-sm rounded-md",lg:"px-4 py-4 text-sm rounded-md"}},defaultVariants:{variant:"md"}});function Oe(o){var r=o,{className:e,variant:t}=r,a=chunkS4HRPNKF_js.c(r,["className","variant"]);return jsxRuntime.jsx("textarea",chunkS4HRPNKF_js.a({"data-slot":"textarea",className:f(jn({variant:t}),e)},a))}var Zn=classVarianceAuthority.cva("text-sm leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-50",{variants:{variant:{primary:"font-medium",secondary:"font-normal"}},defaultVariants:{variant:"primary"}});function Re(o){var r=o,{className:e,variant:t}=r,a=chunkS4HRPNKF_js.c(r,["className","variant"]);return jsxRuntime.jsx(radixUi.Label.Root,chunkS4HRPNKF_js.a({"data-slot":"label",className:f(Zn({variant:t}),e)},a))}function rt(e){let t=typeof e=="string"?new Date(e):e,a=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),r=t.getFullYear();return `${a}/${o}/${r}`}function co(e){let t=Math.floor(e/60),a=e%60;return `${t}:${a.toString().padStart(2,"0")}`}var ei=classVarianceAuthority.cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function nt(o){var r=o,{className:e,orientation:t="vertical"}=r,a=chunkS4HRPNKF_js.c(r,["className","orientation"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({role:"group","data-slot":"field","data-orientation":t,className:f(ei({orientation:t}),e)},a))}function it(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(Re,chunkS4HRPNKF_js.a({"data-slot":"field-label",className:f("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",e)},t))}function st(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({"data-slot":"input-group",role:"group",className:f("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e)},t))}var ti=classVarianceAuthority.cva("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5","block-end":"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function lt(o){var r=o,{className:e,align:t="inline-start"}=r,a=chunkS4HRPNKF_js.c(r,["className","align"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({role:"group","data-slot":"input-group-addon","data-align":t,className:f(ti({align:t}),e),onClick:n=>{var s,m;n.target.closest("button")||(m=(s=n.currentTarget.parentElement)==null?void 0:s.querySelector("input"))==null||m.focus();}},a))}classVarianceAuthority.cva("text-sm shadow-none flex gap-2 items-center",{variants:{size:{xs:"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",sm:"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function dt(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("span",chunkS4HRPNKF_js.a({className:f("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",e)},t))}function ct(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(Dt,chunkS4HRPNKF_js.a({"data-slot":"input-group-control",className:f("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e)},t))}function qa({file:e,onClose:t,onSave:a,onDelete:o}){var C;let[r,n]=Fi.useState(false),[s,m]=Fi.useState(e.name),[l,v]=Fi.useState(e.alternativeText||""),[u,x]=Fi.useState(e.caption||""),c=async()=>{n(true);try{await(a==null?void 0:a({name:s,alternativeText:l,caption:u})),t();}finally{n(false);}},w=jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsxs("div",{className:"flex gap-2 mb-4",children:[jsxRuntime.jsx(tt,{file:e}),jsxRuntime.jsx(ot,{file:e}),jsxRuntime.jsx(at,{file:e}),jsxRuntime.jsx(ja,{file:e,onFullscreen:()=>window.open(e.url,"_blank")})]}),jsxRuntime.jsx("div",{className:"flex-1 flex items-center justify-center bg-gray-50 rounded-lg overflow-hidden",style:{backgroundImage:`
|
|
91
75
|
linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
|
|
92
76
|
linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
|
|
93
77
|
linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
|
|
94
78
|
linear-gradient(-45deg, transparent 75%, #e5e7eb 75%)
|
|
95
|
-
`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px"},children:(0,E.jsx)("img",{src:e.previewUrl||e.url,alt:e.alternativeText||e.name,className:"max-w-full max-h-full object-contain"})})]}),w=(0,E.jsxs)("div",{className:"space-y-6",children:[(0,E.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Size"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:le(e.size)})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Dimensions"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:e.width&&e.height?`${e.width}\xD7${e.height}`:"N/A"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Date"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:Ft(e.createdAt)})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Extension"}),(0,E.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:((y=e.ext)==null?void 0:y.replace(".",""))||"N/A"})]})]}),(0,E.jsxs)("div",{className:"space-y-4 pt-4 border-t border-slate-200 dark:border-zinc-700",children:[(0,E.jsx)("div",{className:"space-y-2",children:(0,E.jsxs)(Mt,{className:"gap-0",children:[(0,E.jsx)(kt,{htmlFor:"fileName",children:"File name"}),(0,E.jsxs)(Dt,{children:[(0,E.jsx)(Pt,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:k=>c(k.target.value)}),(0,E.jsx)(It,{align:"inline-end",className:"pr-1",children:(0,E.jsx)(Nt,{className:"font-bold bg-gray-200 dark:bg-zinc-700 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,E.jsxs)("div",{className:"space-y-2",children:[(0,E.jsx)(Be,{htmlFor:"altText",children:"Alternative text"}),(0,E.jsx)(qe,{id:"altText",value:d,onChange:k=>g(k.target.value),placeholder:"Describe the image for accessibility",rows:3}),(0,E.jsx)("p",{className:"text-xs text-muted-foreground",children:"This text will be displayed if the asset can't be shown."})]}),(0,E.jsxs)("div",{className:"space-y-2",children:[(0,E.jsx)(Be,{htmlFor:"caption",children:"Caption"}),(0,E.jsx)(qe,{id:"caption",value:u,onChange:k=>b(k.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,E.jsx)(bt,{title:"Details",open:!0,onClose:t,previewSection:C,metadataSection:w,footer:(0,E.jsxs)("div",{className:"flex w-full justify-between items-center flex-col sm:flex-row gap-2 ",children:[(0,E.jsx)(F,{className:"w-full md:w-auto",variant:"outline",onClick:t,radius:"full",disabled:n,children:"Cancel"}),(0,E.jsxs)(F,{className:"w-full md:w-auto",onClick:p,radius:"full",disabled:n,children:[n&&(0,E.jsx)(ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var va=require("react");var T=require("react/jsx-runtime");function fn({file:e,onClose:t,onSave:o,onDelete:a}){var w,D,y;let[n,i]=(0,va.useState)(!1),[l,c]=(0,va.useState)(e.name),[d,g]=(0,va.useState)(e.caption||""),u=async()=>{i(!0);try{await(o==null?void 0:o({name:l,caption:d})),t()}finally{i(!1)}},b=(0,T.jsxs)("div",{className:"flex flex-col h-full",children:[(0,T.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,T.jsx)(wt,{file:e}),(0,T.jsx)(Ct,{file:e}),(0,T.jsx)(yt,{file:e})]}),(0,T.jsx)("div",{className:"flex-1 flex items-center justify-center bg-black rounded-lg overflow-hidden",children:(0,T.jsx)("video",{src:e.url,controls:!0,className:"max-w-full max-h-full",style:{maxHeight:"500px"},children:"Your browser does not support the video tag."})})]}),p=(0,T.jsxs)("div",{className:"space-y-6",children:[(0,T.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Size"}),(0,T.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:le(e.size)})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Dimensions"}),(0,T.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:e.width&&e.height?`${e.width}\xD7${e.height}`:"N/A"})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),(0,T.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:(w=e.metaData)!=null&&w.duration?ga(e.metaData.duration):"N/A"})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Date"}),(0,T.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:Ft(e.createdAt)})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Extension"}),(0,T.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:((D=e.ext)==null?void 0:D.replace(".",""))||"N/A"})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Video Source"}),(0,T.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400 capitalize",children:((y=e.metaData)==null?void 0:y.videoSource)||"local"})]})]}),(0,T.jsxs)("div",{className:"space-y-4 pt-4 border-t border-slate-200",children:[(0,T.jsx)("div",{className:"space-y-2",children:(0,T.jsxs)(Mt,{className:"gap-0",children:[(0,T.jsx)(kt,{htmlFor:"fileName",children:"File name"}),(0,T.jsxs)(Dt,{children:[(0,T.jsx)(Pt,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:k=>c(k.target.value)}),(0,T.jsx)(It,{align:"inline-end",className:"pr-1",children:(0,T.jsx)(Nt,{className:"font-bold bg-gray-200 dark:bg-zinc-700 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)(Be,{htmlFor:"caption",children:"Caption"}),(0,T.jsx)(qe,{id:"caption",value:d,onChange:k=>g(k.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,T.jsx)(bt,{title:"Details",open:!0,onClose:t,previewSection:b,metadataSection:p,footer:(0,T.jsxs)("div",{className:"flex w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[(0,T.jsx)(F,{variant:"outline",onClick:t,radius:"full",className:"w-full md:w-auto",disabled:n,children:"Cancel"}),(0,T.jsxs)(F,{onClick:u,radius:"full",className:"w-full md:w-auto",disabled:n,children:[n&&(0,T.jsx)(ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var xa=require("react");var S=require("react/jsx-runtime");function gn({file:e,onClose:t,onSave:o,onDelete:a}){var w,D,y;let[n,i]=(0,xa.useState)(!1),[l,c]=(0,xa.useState)(e.name),[d,g]=(0,xa.useState)(e.caption||""),u=async()=>{i(!0);try{await(o==null?void 0:o({name:l,caption:d})),t()}finally{i(!1)}},b=(0,S.jsxs)("div",{className:"flex flex-col h-full",children:[(0,S.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,S.jsx)(wt,{file:e}),(0,S.jsx)(Ct,{file:e}),(0,S.jsx)(yt,{file:e})]}),(0,S.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center bg-linear-to-br from-purple-50 to-blue-50 dark:from-purple-950 dark:to-blue-950 rounded-lg p-8",children:[(0,S.jsx)("div",{className:"mb-8",children:(0,S.jsx)("div",{className:"w-32 h-32 rounded-full bg-white dark:bg-gray-800 shadow-lg flex items-center justify-center",children:(0,S.jsx)(ao,{className:"w-16 h-16 text-purple-600 dark:text-purple-400"})})}),(0,S.jsx)("div",{className:"w-full max-w-md",children:(0,S.jsx)("audio",{src:e.url,controls:!0,className:"w-full",children:"Your browser does not support the audio tag."})})]})]}),p=(0,S.jsxs)("div",{className:"space-y-6",children:[(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Size"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:le(e.size)})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:(w=e.metaData)!=null&&w.duration?ga(e.metaData.duration):"N/A"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Bitrate"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:(D=e.metaData)!=null&&D.bitrate?`${e.metaData.bitrate} kbps`:"N/A"})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Date"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:Ft(e.createdAt)})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Extension"}),(0,S.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:((y=e.ext)==null?void 0:y.replace(".",""))||"N/A"})]})]}),(0,S.jsxs)("div",{className:"space-y-4 pt-4 border-t border-slate-200 dark:border-zinc-700",children:[(0,S.jsx)("div",{className:"space-y-2",children:(0,S.jsxs)(Mt,{className:"gap-0",children:[(0,S.jsx)(kt,{htmlFor:"fileName",children:"File name"}),(0,S.jsxs)(Dt,{children:[(0,S.jsx)(Pt,{id:"fileName",placeholder:"Enter file name",value:l.replace(e.ext||"",""),onChange:k=>c(k.target.value)}),(0,S.jsx)(It,{align:"inline-end",className:"pr-1",children:(0,S.jsx)(Nt,{className:"font-bold bg-gray-200 dark:bg-zinc-700 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)(Be,{htmlFor:"caption",children:"Caption"}),(0,S.jsx)(qe,{id:"caption",value:d,onChange:k=>g(k.target.value),placeholder:"Add a caption",rows:3})]})]})]});return(0,S.jsx)(bt,{title:"Details",open:!0,onClose:t,previewSection:b,metadataSection:p,footer:(0,S.jsxs)("div",{className:"flex gap-2 w-full sm:justify-between justify-center items-center flex-col sm:flex-row ",children:[(0,S.jsx)(F,{variant:"outline",onClick:t,radius:"full",className:"w-full md:w-auto",disabled:n,children:"Cancel"}),(0,S.jsxs)(F,{onClick:u,radius:"full",className:"w-full md:w-auto",disabled:n,children:[n&&(0,S.jsx)(ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}var ba=require("react");var L=require("react/jsx-runtime");function hn({file:e,onClose:t,onSave:o}){var D,y,k,z;let[a,n]=(0,ba.useState)(!1),[i,l]=(0,ba.useState)(e.name),[c,d]=(0,ba.useState)(((D=e.metaData)==null?void 0:D.description)||""),g=async()=>{n(!0);try{await(o==null?void 0:o({name:i,metaData:s(r({},e.metaData),{description:c})})),t()}finally{n(!1)}},u=((y=e.ext)==null?void 0:y.replace(".",""))||"file",{component:b}=ht(e),p=(0,L.jsxs)("div",{className:"flex flex-col h-full",children:[(0,L.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,L.jsx)(wt,{file:e}),(0,L.jsx)(Ct,{file:e}),(0,L.jsx)(yt,{file:e})]}),(0,L.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center bg-linear-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800 rounded-lg p-8",children:[(0,L.jsx)("div",{className:"mb-4 w-32 h-32 flex items-center justify-center",children:(0,L.jsx)(b,{file:e,metaData:e.metaData})}),(0,L.jsxs)("p",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:[u," File"]})]})]}),C=(0,L.jsxs)("div",{className:"space-y-6",children:[(0,L.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Size"}),(0,L.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:le(e.size)})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Date"}),(0,L.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:Ft(e.createdAt)})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Extension"}),(0,L.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:u})]}),((k=e.metaData)==null?void 0:k.pageCount)&&(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Page Count"}),(0,L.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:e.metaData.pageCount})]}),((z=e.metaData)==null?void 0:z.author)&&(0,L.jsxs)("div",{children:[(0,L.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Author"}),(0,L.jsx)("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:e.metaData.author})]})]}),(0,L.jsxs)("div",{className:"space-y-4 pt-4 border-t border-slate-200",children:[(0,L.jsx)("div",{className:"space-y-2",children:(0,L.jsxs)(Mt,{className:"gap-0",children:[(0,L.jsx)(kt,{htmlFor:"fileName",children:"File name"}),(0,L.jsxs)(Dt,{children:[(0,L.jsx)(Pt,{id:"fileName",placeholder:"Enter file name",value:i.replace(e.ext||"",""),onChange:R=>l(R.target.value)}),(0,L.jsx)(It,{align:"inline-end",className:"pr-1",children:(0,L.jsx)(Nt,{className:"font-bold bg-gray-200 dark:bg-zinc-700 rounded-lg py-1 px-3",children:e.ext})})]})]})}),(0,L.jsxs)("div",{className:"space-y-2",children:[(0,L.jsx)(Be,{htmlFor:"description",children:"Description"}),(0,L.jsx)(qe,{id:"description",value:c,onChange:R=>d(R.target.value),placeholder:"Add a description",rows:3})]})]})]});return(0,L.jsx)(bt,{title:"Details",open:!0,onClose:t,previewSection:p,metadataSection:C,footer:(0,L.jsxs)("div",{className:"flex w-full justify-between items-center flex-col sm:flex-row gap-2 ",children:[(0,L.jsx)(F,{className:"w-full md:w-auto",variant:"outline",onClick:t,radius:"full",disabled:a,children:"Cancel"}),(0,L.jsxs)(F,{className:"w-full md:w-auto",onClick:g,radius:"full",disabled:a,children:[a&&(0,L.jsx)(ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]})]})})}var Qe=require("react/jsx-runtime");function vn({className:e}){let{fileDetailsModalFile:t,setFileDetailsModalFile:o,updateFileMetadata:a}=G(),n=()=>{o(null)},i=async c=>{t&&await a(t.id,c)},l=()=>{if(!t)return null;switch(Ke(t.mime,t.ext)){case X.IMAGE:return(0,Qe.jsx)(mn,{file:t,onClose:n,onSave:i});case X.VIDEO:return(0,Qe.jsx)(fn,{file:t,onClose:n,onSave:i});case X.AUDIO:return(0,Qe.jsx)(gn,{file:t,onClose:n,onSave:i});case X.FILE:default:return(0,Qe.jsx)(hn,{file:t,onClose:n,onSave:i})}};return(0,Qe.jsxs)("div",{className:v("",e),children:[(0,Qe.jsx)(Xr,{}),(0,Qe.jsx)(tn,{}),(0,Qe.jsx)(an,{}),l()]})}var qa=require("react/jsx-runtime");function Ui(o){var a=o,{children:e}=a,t=f(a,["children"]);return(0,qa.jsx)(Co,s(r({mode:oe.PAGE,selectionMode:Ve.MULTIPLE},t),{children:e}))}function ji(c){var d=c,{children:e,fileSelectionMode:t=Ve.SINGLE,acceptedFileTypes:o,viewMode:a="grid",onFilesSelected:n,onClose:i}=d,l=f(d,["children","fileSelectionMode","acceptedFileTypes","viewMode","onFilesSelected","onClose"]);return(0,qa.jsx)(Co,s(r({mode:oe.MODAL,selectionMode:t,acceptedFileTypesForModal:o||l.allowedFileTypes,viewMode:a,onFilesSelected:n,onClose:i},l),{children:e}))}var nt={Page:Ui,Modal:ji,Header:Fr,Footer:yr,Overlays:vn};var ee=require("react/jsx-runtime");function xn(){let{setIsMoveFileModalOpen:e}=G();return(0,ee.jsxs)(F,{variant:"outline",size:"lg",radius:"full",onClick:()=>e(!0),className:"text-md font-medium border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:bg-blue-50 dark:hover:bg-blue-900/40 hover:text-blue-600 dark:hover:text-blue-400 hover:border-blue-300 dark:hover:border-blue-700 shadow-sm transition-all duration-200",children:[(0,ee.jsx)(et,{className:"size-5"}),(0,ee.jsx)("span",{className:"hidden sm:inline",children:"Move"})]})}function bn(){let{bulkDelete:e}=G();return(0,ee.jsxs)(F,{variant:"outline",size:"lg",radius:"full",onClick:e,className:"text-md font-medium border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:bg-red-50 dark:hover:bg-red-900/40 hover:text-red-600 dark:hover:text-red-400 hover:border-red-300 dark:hover:border-red-700 shadow-sm transition-all duration-200",children:[(0,ee.jsx)(Ue,{className:"size-5"}),(0,ee.jsx)("span",{className:"hidden",children:"Delete"})]})}function wn(){let{handleClearSelection:e}=G();return(0,ee.jsxs)(F,{variant:"outline",size:"lg",onClick:e,className:"rounded-full text-md font-medium border border-transparent text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:bg-blue-50 dark:hover:bg-blue-900/40 hover:border-blue-300 dark:hover:border-blue-700 hover:font-semibold transition-all duration-200",children:[(0,ee.jsx)(je,{className:"size-5 transition-colors"}),"Clear"]})}function Cn(){let{selectedFiles:e,selectedFolders:t}=G();return e.length+t.length===0?null:(0,ee.jsx)("div",{className:"w-full",children:(0,ee.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,ee.jsxs)("div",{className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[(0,ee.jsx)(xn,{}),(0,ee.jsx)(bn,{})]}),(0,ee.jsx)(wn,{})]})})}function yn({className:e}){let{selectedFiles:t,selectedFolders:o}=G();return t.length+o.length===0?null:(0,ee.jsx)("div",{className:`fixed bottom-0 left-0 right-0 z-50 bg-white/80 dark:bg-zinc-900/80 backdrop-blur-sm border-t border-gray-200 dark:border-zinc-700 shadow-lg ${e||""}`,children:(0,ee.jsx)("div",{className:"px-4 sm:px-6 py-3 mx-auto",children:(0,ee.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,ee.jsxs)("div",{className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[(0,ee.jsx)(xn,{}),(0,ee.jsx)(bn,{})]}),(0,ee.jsx)(wn,{})]})})})}var Fn=require("react/jsx-runtime");function Qa(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,Fn.jsx)("div",r({"data-slot":"skeleton",className:v("animate-pulse rounded-md bg-accent",e)},t))}var Mn=require("next/navigation"),xe=require("react/jsx-runtime");function wa(){let{currentFolder:e,handleFolderClick:t,isLoading:o}=G(),a=(0,Mn.useRouter)(),n=()=>{a.back()};return o?(0,xe.jsxs)("div",{className:"flex item-center w-full",children:[(0,xe.jsx)(Qa,{className:"rounded-full size-10 mr-2 shrink-0"}),(0,xe.jsx)(Qa,{className:"min-w-32 rounded-md h-full"})]}):(0,xe.jsx)(xe.Fragment,{children:e?(0,xe.jsxs)("div",{className:"flex items-center flex-1 min-w-0 max-w-[calc(100%-40px)]",children:[(0,xe.jsx)(F,{variant:"outline",size:"icon",radius:"full",disabled:o,className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 mr-2",onClick:n,children:(0,xe.jsx)(lo,{className:"size-5 text-gray-900 dark:text-zinc-100",strokeWidth:"1.5"})}),(0,xe.jsx)("h1",{className:"text-lg flex-1 min-w-0 align-middle font-semibold",children:Ye(e.name,20)})]}):(0,xe.jsxs)("div",{className:"flex items-center flex-1 min-w-0 max-w-[calc(100%-40px)]",children:[(0,xe.jsx)(F,{className:"mr-2 shrink-0",radius:"full",variant:"ghost",mode:"icon",size:"icon",onClick:()=>t(null),children:(0,xe.jsx)(ra,{className:"size-6 text-gray-900 dark:text-zinc-100"})}),(0,xe.jsx)("h1",{className:"text-lg flex-1 min-w-0 align-middle font-semibold",children:"Home"})]})})}var Wi=require("lucide-react");var Ut=require("radix-ui");var St=require("react/jsx-runtime");function Ao(t){var e=f(t,[]);return(0,St.jsx)(Ut.DropdownMenu.Root,r({"data-slot":"dropdown-menu"},e))}function _o(t){var e=f(t,[]);return(0,St.jsx)(Ut.DropdownMenu.Trigger,r({className:"select-none","data-slot":"dropdown-menu-trigger"},e))}function Vo(a){var n=a,{className:e,sideOffset:t=4}=n,o=f(n,["className","sideOffset"]);return(0,St.jsx)(Ut.DropdownMenu.Portal,{children:(0,St.jsx)(Ut.DropdownMenu.Content,r({"data-slot":"dropdown-menu-content",sideOffset:t,className:v("space-y-0.5 z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-md shadow-black/5 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e)},o))})}function it(n){var i=n,{className:e,inset:t,variant:o}=i,a=f(i,["className","inset","variant"]);return(0,St.jsx)(Ut.DropdownMenu.Item,r({"data-slot":"dropdown-menu-item",className:v("text-foreground relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([role=img]):not([class*=text-])]:opacity-60 [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0","focus:bg-accent focus:text-foreground","data-[active=true]:bg-accent data-[active=true]:text-accent-foreground",t&&"ps-8",o==="destructive"&&"text-destructive hover:text-destructive focus:text-destructive hover:bg-destructive/5 focus:bg-destructive/5 data-[active=true]:bg-destructive/5",e)},a))}function kn(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,St.jsx)(Ut.DropdownMenu.Separator,r({"data-slot":"dropdown-menu-separator",className:v("-mx-2 my-1.5 h-px bg-muted",e)},t))}var lt=require("react");var jt=require("cmdk");var Me=require("react/jsx-runtime");function $i(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,Me.jsx)(jt.Command,r({className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e)},t))}var Dn=n=>{var i=n,{children:e,className:t,shouldFilter:o}=i,a=f(i,["children","className","shouldFilter"]);return(0,Me.jsx)(Te,s(r({},a),{children:(0,Me.jsxs)(Ee,{className:v("overflow-hidden p-0 shadow-lg",t),children:[(0,Me.jsx)(Le,{className:"hidden"}),(0,Me.jsx)($i,{shouldFilter:o,className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})]})}))};function In(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,Me.jsxs)("div",{className:"flex items-center border-border border-b px-3","cmdk-input-wrapper":"","data-slot":"command-input",children:[(0,Me.jsx)(Fe,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,Me.jsx)(jt.Command.Input,r({className:v("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e)},t))]})}function Nn(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,Me.jsx)(jt.Command.List,r({"data-slot":"command-list",className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",e)},t))}function Ca(t){var e=f(t,[]);return(0,Me.jsx)(jt.Command.Empty,r({"data-slot":"command-empty",className:"py-6 text-center text-sm"},e))}function Ja(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,Me.jsx)(jt.Command.Group,r({"data-slot":"command-group",className:v("overflow-hidden p-1.5 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e)},t))}function Xa(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,Me.jsx)(jt.Command.Item,r({"data-slot":"command-item",className:v("relative flex text-foreground cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0","[&_svg:not([role=img]):not([class*=text-])]:opacity-60",e)},t))}var ya=require("react");function Fa(e,t=500){let[o,a]=(0,ya.useState)(e);return(0,ya.useEffect)(()=>{let n=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(n)}},[e,t]),o}var Pn=require("sonner");var H=require("react/jsx-runtime");function er(){let[e,t]=(0,lt.useState)(""),[o,a]=(0,lt.useState)([]),[n,i]=(0,lt.useState)([]),[l,c]=(0,lt.useState)(!1),{provider:d,handleFolderClick:g,handleClearSelection:u,isSearchModalOpen:b,setIsSearchModalOpen:p,setFileDetailsModalFile:C}=G(),w=Fa(e,300),D=(0,lt.useCallback)(async z=>{c(!0);try{let[R,h]=await Promise.all([d.findFiles(z),d.findFolders(z)]);a(R),i(h)}catch(R){let h=R instanceof Error?R.message:"Search failed";Pn.toast.error("Search Failed",{description:h}),a([]),i([])}finally{c(!1)}},[d]);return(0,lt.useEffect)(()=>{b&&w.length>0?D(w):(a([]),i([]))},[w,b,D]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(F,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",onClick:()=>p(!0),children:[(0,H.jsx)(Fe,{className:"size-4 text-gray-700 dark:text-zinc-300"}),(0,H.jsx)("span",{className:"hidden",children:"Search"})]}),(0,H.jsxs)(Dn,{className:"max-w-4xl w-full",open:b,onOpenChange:z=>{p(z),z||(t(""),a([]),i([]))},shouldFilter:!1,children:[(0,H.jsx)(In,{placeholder:"Type to search files or folders...",value:e,onValueChange:z=>{t(z)}}),(0,H.jsxs)(Nn,{children:[l&&(0,H.jsx)(Ca,{children:"Searching..."}),!l&&o.length===0&&n.length===0&&!e&&(0,H.jsx)(Ca,{children:(0,H.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[(0,H.jsx)(Fe,{className:"size-12 text-gray-300 dark:text-zinc-600 mb-3"}),(0,H.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100 mb-1",children:"Search your files and folders"}),(0,H.jsx)("p",{className:"text-xs text-gray-500 dark:text-zinc-400",children:"Start typing to find what you're looking for"}),(0,H.jsx)("p",{className:"text-xs text-gray-500 dark:text-zinc-400 mt-2",children:(0,H.jsx)(go,{children:(0,H.jsxs)(fo,{children:[(0,H.jsx)("span",{className:"text-lg",children:"\u2318"})," + K"]})})})]})}),!l&&o.length===0&&n.length===0&&e&&(0,H.jsx)(Ca,{children:(0,H.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[(0,H.jsx)(Fe,{className:"size-12 text-gray-300 dark:text-zinc-600 mb-3"}),(0,H.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100 mb-1",children:"No results found"}),(0,H.jsx)("p",{className:"text-xs text-gray-500 dark:text-zinc-400",children:"Try searching with different keywords"})]})}),n.length>0&&(0,H.jsx)(Ja,{heading:"Folders",children:n.map(z=>(0,H.jsxs)(Xa,{onSelect:()=>{u(),p(!1),g(z)},children:[(0,H.jsx)(Xe,{className:"size-4 mr-2 shrink-0",strokeWidth:1.5}),(0,H.jsx)("span",{children:Ye(z.name,60)})]},z.id))}),o.length>0&&(0,H.jsx)(Ja,{heading:"Files",children:o.map(z=>{let{component:R}=ht(z);return(0,H.jsxs)(Xa,{onSelect:()=>{u(),C(z)},children:[(0,H.jsx)("div",{className:"size-6 mr-2 shrink-0 flex items-center justify-center",children:(0,H.jsx)(R,{file:z,metaData:z.metaData})}),(0,H.jsx)("span",{children:Ye(z.name,60)})]},z.id)})})]})]})]})}var Sn=require("class-variance-authority");var tr=require("radix-ui");var xo=require("react/jsx-runtime"),Ki=(0,Sn.cva)(`
|
|
79
|
+
`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px"},children:jsxRuntime.jsx("img",{src:e.previewUrl||e.url,alt:e.alternativeText||e.name,className:"max-w-full max-h-full object-contain"})})]}),F=jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Size"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:ee(e.size)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Dimensions"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:e.width&&e.height?`${e.width}\xD7${e.height}`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Date"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:rt(e.createdAt)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Extension"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:((C=e.ext)==null?void 0:C.replace(".",""))||"N/A"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4 pt-4 border-t border-border",children:[jsxRuntime.jsx("div",{className:"space-y-2",children:jsxRuntime.jsxs(nt,{className:"gap-0",children:[jsxRuntime.jsx(it,{htmlFor:"fileName",children:"File name"}),jsxRuntime.jsxs(st,{children:[jsxRuntime.jsx(ct,{id:"fileName",placeholder:"Enter file name",value:s.replace(e.ext||"",""),onChange:N=>m(N.target.value)}),jsxRuntime.jsx(lt,{align:"inline-end",className:"pr-1",children:jsxRuntime.jsx(dt,{className:"font-bold bg-accent rounded-lg py-1 px-3",children:e.ext})})]})]})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Re,{htmlFor:"altText",children:"Alternative text"}),jsxRuntime.jsx(Oe,{id:"altText",value:l,onChange:N=>v(N.target.value),placeholder:"Describe the image for accessibility",rows:3}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"This text will be displayed if the asset can't be shown."})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Re,{htmlFor:"caption",children:"Caption"}),jsxRuntime.jsx(Oe,{id:"caption",value:u,onChange:N=>x(N.target.value),placeholder:"Add a caption",rows:3})]})]})]});return jsxRuntime.jsx(et,{title:"Details",open:true,onClose:t,previewSection:w,metadataSection:F,footer:jsxRuntime.jsxs("div",{className:"flex w-full justify-between items-center flex-col sm:flex-row gap-2 ",children:[jsxRuntime.jsx(y,{className:"w-full md:w-auto",variant:"outline",onClick:t,radius:"full",disabled:r,children:"Cancel"}),jsxRuntime.jsxs(y,{className:"w-full md:w-auto",onClick:c,radius:"full",disabled:r,children:[r&&jsxRuntime.jsx(chunkS4HRPNKF_js.C,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}function Za({file:e,onClose:t,onSave:a,onDelete:o}){var F,M,C;let[r,n]=Fi.useState(false),[s,m]=Fi.useState(e.name),[l,v]=Fi.useState(e.caption||""),u=async()=>{n(true);try{await(a==null?void 0:a({name:s,caption:l})),t();}finally{n(false);}},x=jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsxs("div",{className:"flex gap-2 mb-4",children:[jsxRuntime.jsx(tt,{file:e}),jsxRuntime.jsx(ot,{file:e}),jsxRuntime.jsx(at,{file:e})]}),jsxRuntime.jsx("div",{className:"flex-1 flex items-center justify-center bg-black rounded-lg overflow-hidden",children:jsxRuntime.jsx("video",{src:e.url,controls:true,className:"max-w-full max-h-full",style:{maxHeight:"500px"},children:"Your browser does not support the video tag."})})]}),c=jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Size"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:ee(e.size)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Dimensions"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:e.width&&e.height?`${e.width}\xD7${e.height}`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:(F=e.metaData)!=null&&F.duration?co(e.metaData.duration):"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Date"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:rt(e.createdAt)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Extension"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:((M=e.ext)==null?void 0:M.replace(".",""))||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Video Source"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary capitalize",children:((C=e.metaData)==null?void 0:C.videoSource)||"local"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4 pt-4 border-t border-border",children:[jsxRuntime.jsx("div",{className:"space-y-2",children:jsxRuntime.jsxs(nt,{className:"gap-0",children:[jsxRuntime.jsx(it,{htmlFor:"fileName",children:"File name"}),jsxRuntime.jsxs(st,{children:[jsxRuntime.jsx(ct,{id:"fileName",placeholder:"Enter file name",value:s.replace(e.ext||"",""),onChange:N=>m(N.target.value)}),jsxRuntime.jsx(lt,{align:"inline-end",className:"pr-1",children:jsxRuntime.jsx(dt,{className:"font-bold bg-accent rounded-lg py-1 px-3",children:e.ext})})]})]})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Re,{htmlFor:"caption",children:"Caption"}),jsxRuntime.jsx(Oe,{id:"caption",value:l,onChange:N=>v(N.target.value),placeholder:"Add a caption",rows:3})]})]})]});return jsxRuntime.jsx(et,{title:"Details",open:true,onClose:t,previewSection:x,metadataSection:c,footer:jsxRuntime.jsxs("div",{className:"flex w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2 ",children:[jsxRuntime.jsx(y,{variant:"outline",onClick:t,radius:"full",className:"w-full md:w-auto",disabled:r,children:"Cancel"}),jsxRuntime.jsxs(y,{onClick:u,radius:"full",className:"w-full md:w-auto",disabled:r,children:[r&&jsxRuntime.jsx(chunkS4HRPNKF_js.C,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}function Ja({file:e,onClose:t,onSave:a,onDelete:o}){var F,M,C;let[r,n]=Fi.useState(false),[s,m]=Fi.useState(e.name),[l,v]=Fi.useState(e.caption||""),u=async()=>{n(true);try{await(a==null?void 0:a({name:s,caption:l})),t();}finally{n(false);}},x=jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsxs("div",{className:"flex gap-2 mb-4",children:[jsxRuntime.jsx(tt,{file:e}),jsxRuntime.jsx(ot,{file:e}),jsxRuntime.jsx(at,{file:e})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-linear-to-br from-purple-50 to-blue-50 dark:from-purple-950 dark:to-blue-950 rounded-lg p-8",children:[jsxRuntime.jsx("div",{className:"mb-8",children:jsxRuntime.jsx("div",{className:"w-32 h-32 rounded-full bg-white dark:bg-gray-800 shadow-lg flex items-center justify-center",children:jsxRuntime.jsx(chunkS4HRPNKF_js.h,{className:"w-16 h-16 text-purple-600 dark:text-purple-400"})})}),jsxRuntime.jsx("div",{className:"w-full max-w-md",children:jsxRuntime.jsx("audio",{src:e.url,controls:true,className:"w-full",children:"Your browser does not support the audio tag."})})]})]}),c=jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Size"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:ee(e.size)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Duration"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:(F=e.metaData)!=null&&F.duration?co(e.metaData.duration):"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Bitrate"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:(M=e.metaData)!=null&&M.bitrate?`${e.metaData.bitrate} kbps`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Date"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:rt(e.createdAt)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Extension"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-primary",children:((C=e.ext)==null?void 0:C.replace(".",""))||"N/A"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4 pt-4 border-t border-border",children:[jsxRuntime.jsx("div",{className:"space-y-2",children:jsxRuntime.jsxs(nt,{className:"gap-0",children:[jsxRuntime.jsx(it,{htmlFor:"fileName",children:"File name"}),jsxRuntime.jsxs(st,{children:[jsxRuntime.jsx(ct,{id:"fileName",placeholder:"Enter file name",value:s.replace(e.ext||"",""),onChange:N=>m(N.target.value)}),jsxRuntime.jsx(lt,{align:"inline-end",className:"pr-1",children:jsxRuntime.jsx(dt,{className:"font-bold bg-accent rounded-lg py-1 px-3",children:e.ext})})]})]})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Re,{htmlFor:"caption",children:"Caption"}),jsxRuntime.jsx(Oe,{id:"caption",value:l,onChange:N=>v(N.target.value),placeholder:"Add a caption",rows:3})]})]})]});return jsxRuntime.jsx(et,{title:"Details",open:true,onClose:t,previewSection:x,metadataSection:c,footer:jsxRuntime.jsxs("div",{className:"flex gap-2 w-full sm:justify-between justify-center items-center flex-col sm:flex-row ",children:[jsxRuntime.jsx(y,{variant:"outline",onClick:t,radius:"full",className:"w-full md:w-auto",disabled:r,children:"Cancel"}),jsxRuntime.jsxs(y,{onClick:u,radius:"full",className:"w-full md:w-auto",disabled:r,children:[r&&jsxRuntime.jsx(chunkS4HRPNKF_js.C,{className:"mr-2 h-4 w-4 animate-spin"}),"Finish"]})]})})}function Xa({file:e,onClose:t,onSave:a}){var M,C,N,D;let[o,r]=Fi.useState(false),[n,s]=Fi.useState(e.name),[m,l]=Fi.useState(((M=e.metaData)==null?void 0:M.description)||""),v=async()=>{r(true);try{await(a==null?void 0:a({name:n,metaData:chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},e.metaData),{description:m})})),t();}finally{r(false);}},u=((C=e.ext)==null?void 0:C.replace(".",""))||"file",{component:x}=Xe(e),c=jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsxs("div",{className:"flex gap-2 mb-4",children:[jsxRuntime.jsx(tt,{file:e}),jsxRuntime.jsx(ot,{file:e}),jsxRuntime.jsx(at,{file:e})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-linear-to-br from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800 rounded-lg p-8",children:[jsxRuntime.jsx("div",{className:"mb-4 w-32 h-32 flex items-center justify-center",children:jsxRuntime.jsx(x,{file:e,metaData:e.metaData})}),jsxRuntime.jsxs("p",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:[u," File"]})]})]}),w=jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Size"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:ee(e.size)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Date"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:rt(e.createdAt)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide mb-1",children:"Extension"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:u})]}),((N=e.metaData)==null?void 0:N.pageCount)&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Page Count"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:e.metaData.pageCount})]}),((D=e.metaData)==null?void 0:D.author)&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Author"}),jsxRuntime.jsx("p",{className:"text-xs font-bold text-blue-600 dark:text-blue-400",children:e.metaData.author})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4 pt-4 border-t border-slate-200",children:[jsxRuntime.jsx("div",{className:"space-y-2",children:jsxRuntime.jsxs(nt,{className:"gap-0",children:[jsxRuntime.jsx(it,{htmlFor:"fileName",children:"File name"}),jsxRuntime.jsxs(st,{children:[jsxRuntime.jsx(ct,{id:"fileName",placeholder:"Enter file name",value:n.replace(e.ext||"",""),onChange:k=>s(k.target.value)}),jsxRuntime.jsx(lt,{align:"inline-end",className:"pr-1",children:jsxRuntime.jsx(dt,{className:"font-bold bg-gray-200 dark:bg-zinc-700 rounded-lg py-1 px-3",children:e.ext})})]})]})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Re,{htmlFor:"description",children:"Description"}),jsxRuntime.jsx(Oe,{id:"description",value:m,onChange:k=>l(k.target.value),placeholder:"Add a description",rows:3})]})]})]});return jsxRuntime.jsx(et,{title:"Details",open:true,onClose:t,previewSection:c,metadataSection:w,footer:jsxRuntime.jsxs("div",{className:"flex w-full justify-between items-center flex-col sm:flex-row gap-2 ",children:[jsxRuntime.jsx(y,{className:"w-full md:w-auto",variant:"outline",onClick:t,radius:"full",disabled:o,children:"Cancel"}),jsxRuntime.jsxs(y,{className:"w-full md:w-auto",onClick:v,radius:"full",disabled:o,children:[o&&jsxRuntime.jsx(chunkS4HRPNKF_js.C,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]})]})})}function er({className:e}){let{fileDetailsModalFile:t,setFileDetailsModalFile:a,updateFileMetadata:o}=E(),r=()=>{a(null);},n=async m=>{t&&await o(t.id,m);},s=()=>{if(!t)return null;switch(chunkS4HRPNKF_js.H(t.mime,t.ext)){case chunkS4HRPNKF_js.e.IMAGE:return jsxRuntime.jsx(qa,{file:t,onClose:r,onSave:n});case chunkS4HRPNKF_js.e.VIDEO:return jsxRuntime.jsx(Za,{file:t,onClose:r,onSave:n});case chunkS4HRPNKF_js.e.AUDIO:return jsxRuntime.jsx(Ja,{file:t,onClose:r,onSave:n});case chunkS4HRPNKF_js.e.FILE:default:return jsxRuntime.jsx(Xa,{file:t,onClose:r,onSave:n})}};return jsxRuntime.jsxs("div",{className:f("",e),children:[jsxRuntime.jsx(Ga,{}),jsxRuntime.jsx(Ua,{}),jsxRuntime.jsx(Ka,{}),s()]})}function ai(a){var o=a,{children:e}=o,t=chunkS4HRPNKF_js.c(o,["children"]);return jsxRuntime.jsx(no,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({mode:chunkS4HRPNKF_js.d.PAGE,selectionMode:chunkS4HRPNKF_js.f.MULTIPLE},t),{children:e}))}function ri(m){var l=m,{children:e,fileSelectionMode:t=chunkS4HRPNKF_js.f.SINGLE,acceptedFileTypes:a,viewMode:o="grid",onFilesSelected:r,onClose:n}=l,s=chunkS4HRPNKF_js.c(l,["children","fileSelectionMode","acceptedFileTypes","viewMode","onFilesSelected","onClose"]);return jsxRuntime.jsx(no,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({mode:chunkS4HRPNKF_js.d.MODAL,selectionMode:t,acceptedFileTypesForModal:a||s.allowedFileTypes,viewMode:o,onFilesSelected:r,onClose:n},s),{children:e}))}var He={Page:ai,Modal:ri,Header:xa,Footer:va,Overlays:er};function or(){let{setIsMoveFileModalOpen:e}=E();return jsxRuntime.jsxs(y,{variant:"outline",size:"lg",radius:"full",onClick:()=>e(true),className:"text-md font-medium border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:bg-blue-50 dark:hover:bg-blue-900/40 hover:text-blue-600 dark:hover:text-blue-400 hover:border-blue-300 dark:hover:border-blue-700 shadow-sm transition-all duration-200",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.m,{className:"size-5"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Move"})]})}function ar(){let{bulkDelete:e}=E();return jsxRuntime.jsxs(y,{variant:"outline",size:"lg",radius:"full",onClick:e,className:"text-md font-medium border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 hover:bg-red-50 dark:hover:bg-red-900/40 hover:text-red-600 dark:hover:text-red-400 hover:border-red-300 dark:hover:border-red-700 shadow-sm transition-all duration-200",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.r,{className:"size-5"}),jsxRuntime.jsx("span",{className:"hidden",children:"Delete"})]})}function rr(){let{handleClearSelection:e}=E();return jsxRuntime.jsxs(y,{variant:"outline",size:"lg",onClick:e,className:"rounded-full text-md font-medium border border-transparent text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:bg-blue-50 dark:hover:bg-blue-900/40 hover:border-blue-300 dark:hover:border-blue-700 hover:font-semibold transition-all duration-200",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.s,{className:"size-5 transition-colors"}),"Clear"]})}function nr(){let{selectedFiles:e,selectedFolders:t}=E();return e.length+t.length===0?null:jsxRuntime.jsx("div",{className:"w-full",children:jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[jsxRuntime.jsx(or,{}),jsxRuntime.jsx(ar,{})]}),jsxRuntime.jsx(rr,{})]})})}function ir({className:e}){let{selectedFiles:t,selectedFolders:a}=E();return t.length+a.length===0?null:jsxRuntime.jsx("div",{className:`fixed bottom-0 left-0 right-0 z-50 bg-white/80 dark:bg-zinc-900/80 backdrop-blur-sm border-t border-gray-200 dark:border-zinc-700 shadow-lg ${e||""}`,children:jsxRuntime.jsx("div",{className:"px-4 sm:px-6 py-3 mx-auto",children:jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[jsxRuntime.jsx(or,{}),jsxRuntime.jsx(ar,{})]}),jsxRuntime.jsx(rr,{})]})})})}function Oo(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx("div",chunkS4HRPNKF_js.a({"data-slot":"skeleton",className:f("animate-pulse rounded-md bg-accent",e)},t))}function po(){let{currentFolder:e,handleFolderClick:t,isLoading:a}=E(),o=navigation.useRouter(),r=()=>{o.back();};return a?jsxRuntime.jsxs("div",{className:"flex item-center w-full",children:[jsxRuntime.jsx(Oo,{className:"rounded-full size-10 mr-2 shrink-0"}),jsxRuntime.jsx(Oo,{className:"min-w-32 rounded-md h-full"})]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e?jsxRuntime.jsxs("div",{className:"flex items-center flex-1 min-w-0 max-w-[calc(100%-40px)]",children:[jsxRuntime.jsx(y,{variant:"outline",size:"icon",radius:"full",disabled:a,className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 mr-2",onClick:r,children:jsxRuntime.jsx(chunkS4HRPNKF_js.p,{className:"size-5 text-gray-900 dark:text-zinc-100",strokeWidth:"1.5"})}),jsxRuntime.jsx("h1",{className:"text-lg flex-1 min-w-0 align-middle font-semibold",children:Ae(e.name,20)})]}):jsxRuntime.jsxs("div",{className:"flex items-center flex-1 min-w-0 max-w-[calc(100%-40px)]",children:[jsxRuntime.jsx(y,{className:"mr-2 shrink-0",radius:"full",variant:"ghost",mode:"icon",size:"icon",onClick:()=>t(null),children:jsxRuntime.jsx(chunkS4HRPNKF_js.k,{className:"size-6 text-gray-900 dark:text-zinc-100"})}),jsxRuntime.jsx("h1",{className:"text-lg flex-1 min-w-0 align-middle font-semibold",children:"Home"})]})})}function Wt(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(radixUi.DropdownMenu.Root,chunkS4HRPNKF_js.a({"data-slot":"dropdown-menu"},e))}function jt(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(radixUi.DropdownMenu.Trigger,chunkS4HRPNKF_js.a({className:"select-none","data-slot":"dropdown-menu-trigger"},e))}function Qt(o){var r=o,{className:e,sideOffset:t=4}=r,a=chunkS4HRPNKF_js.c(r,["className","sideOffset"]);return jsxRuntime.jsx(radixUi.DropdownMenu.Portal,{children:jsxRuntime.jsx(radixUi.DropdownMenu.Content,chunkS4HRPNKF_js.a({"data-slot":"dropdown-menu-content",sideOffset:t,className:f("space-y-0.5 z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-md shadow-black/5 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e)},a))})}function Ke(r){var n=r,{className:e,inset:t,variant:a}=n,o=chunkS4HRPNKF_js.c(n,["className","inset","variant"]);return jsxRuntime.jsx(radixUi.DropdownMenu.Item,chunkS4HRPNKF_js.a({"data-slot":"dropdown-menu-item",className:f("text-foreground relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([role=img]):not([class*=text-])]:opacity-60 [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0","focus:bg-accent focus:text-foreground","data-[active=true]:bg-accent data-[active=true]:text-accent-foreground",t&&"ps-8",a==="destructive"&&"text-destructive hover:text-destructive focus:text-destructive hover:bg-destructive/5 focus:bg-destructive/5 data-[active=true]:bg-destructive/5",e)},o))}function sr(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(radixUi.DropdownMenu.Separator,chunkS4HRPNKF_js.a({"data-slot":"dropdown-menu-separator",className:f("-mx-2 my-1.5 h-px bg-muted",e)},t))}function di(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(cmdk.Command,chunkS4HRPNKF_js.a({className:f("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e)},t))}var lr=r=>{var n=r,{children:e,className:t,shouldFilter:a}=n,o=chunkS4HRPNKF_js.c(n,["children","className","shouldFilter"]);return jsxRuntime.jsx(Fe,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},o),{children:jsxRuntime.jsxs(we,{className:f("overflow-hidden p-0 shadow-lg",t),children:[jsxRuntime.jsx(Ne,{className:"hidden"}),jsxRuntime.jsx(di,{shouldFilter:a,className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})]})}))};function dr(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsxs("div",{className:"flex items-center border-border border-b px-3","cmdk-input-wrapper":"","data-slot":"command-input",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.l,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),jsxRuntime.jsx(cmdk.Command.Input,chunkS4HRPNKF_js.a({className:f("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e)},t))]})}function cr(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(cmdk.Command.List,chunkS4HRPNKF_js.a({"data-slot":"command-list",className:f("max-h-[300px] overflow-y-auto overflow-x-hidden",e)},t))}function fo(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(cmdk.Command.Empty,chunkS4HRPNKF_js.a({"data-slot":"command-empty",className:"py-6 text-center text-sm"},e))}function Vo(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(cmdk.Command.Group,chunkS4HRPNKF_js.a({"data-slot":"command-group",className:f("overflow-hidden p-1.5 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e)},t))}function Go(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(cmdk.Command.Item,chunkS4HRPNKF_js.a({"data-slot":"command-item",className:f("relative flex text-foreground cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0","[&_svg:not([role=img]):not([class*=text-])]:opacity-60",e)},t))}function go(e,t=500){let[a,o]=Fi.useState(e);return Fi.useEffect(()=>{let r=setTimeout(()=>{o(e);},t);return ()=>{clearTimeout(r);}},[e,t]),a}function Uo(){let[e,t]=Fi.useState(""),[a,o]=Fi.useState([]),[r,n]=Fi.useState([]),[s,m]=Fi.useState(false),{provider:l,handleFolderClick:v,handleClearSelection:u,isSearchModalOpen:x,setIsSearchModalOpen:c,setFileDetailsModalFile:w}=E(),F=go(e,300),M=Fi.useCallback(async D=>{m(true);try{let[k,b]=await Promise.all([l.findFiles(D),l.findFolders(D)]);o(k),n(b);}catch(k){let b=k instanceof Error?k.message:"Search failed";sonner.toast.error("Search Failed",{description:b}),o([]),n([]);}finally{m(false);}},[l]);return Fi.useEffect(()=>{x&&F.length>0?M(F):(o([]),n([]));},[F,x,M]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(y,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",onClick:()=>c(true),children:[jsxRuntime.jsx(chunkS4HRPNKF_js.l,{className:"size-4 text-gray-700 dark:text-zinc-300"}),jsxRuntime.jsx("span",{className:"hidden",children:"Search"})]}),jsxRuntime.jsxs(lr,{className:"max-w-4xl w-full",open:x,onOpenChange:D=>{c(D),D||(t(""),o([]),n([]));},shouldFilter:false,children:[jsxRuntime.jsx(dr,{placeholder:"Type to search files or folders...",value:e,onValueChange:D=>{t(D);}}),jsxRuntime.jsxs(cr,{children:[s&&jsxRuntime.jsx(fo,{children:"Searching..."}),!s&&a.length===0&&r.length===0&&!e&&jsxRuntime.jsx(fo,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.l,{className:"size-12 text-gray-300 dark:text-zinc-600 mb-3"}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100 mb-1",children:"Search your files and folders"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-zinc-400",children:"Start typing to find what you're looking for"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-zinc-400 mt-2",children:jsxRuntime.jsx(kt,{children:jsxRuntime.jsxs(Mt,{children:[jsxRuntime.jsx("span",{className:"text-lg",children:"\u2318"})," + K"]})})})]})}),!s&&a.length===0&&r.length===0&&e&&jsxRuntime.jsx(fo,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4 text-center",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.l,{className:"size-12 text-gray-300 dark:text-zinc-600 mb-3"}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-zinc-100 mb-1",children:"No results found"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-zinc-400",children:"Try searching with different keywords"})]})}),r.length>0&&jsxRuntime.jsx(Vo,{heading:"Folders",children:r.map(D=>jsxRuntime.jsxs(Go,{onSelect:()=>{u(),c(false),v(D);},children:[jsxRuntime.jsx(chunkS4HRPNKF_js.j,{className:"size-4 mr-2 shrink-0",strokeWidth:1.5}),jsxRuntime.jsx("span",{children:Ae(D.name,60)})]},D.id))}),a.length>0&&jsxRuntime.jsx(Vo,{heading:"Files",children:a.map(D=>{let{component:k}=Xe(D);return jsxRuntime.jsxs(Go,{onSelect:()=>{u(),w(D);},children:[jsxRuntime.jsx("div",{className:"size-6 mr-2 shrink-0 flex items-center justify-center",children:jsxRuntime.jsx(k,{file:D,metaData:D.metaData})}),jsxRuntime.jsx("span",{children:Ae(D.name,60)})]},D.id)})})]})]})]})}var xi=classVarianceAuthority.cva(`
|
|
96
80
|
group peer bg-background shrink-0 rounded-md border border-input ring-offset-background focus-visible:outline-none
|
|
97
81
|
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50
|
|
98
82
|
aria-invalid:border-destructive/60 aria-invalid:ring-destructive/10 dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/20
|
|
99
83
|
[[data-invalid=true]_&]:border-destructive/60 [[data-invalid=true]_&]:ring-destructive/10 dark:[[data-invalid=true]_&]:border-destructive dark:[[data-invalid=true]_&]:ring-destructive/20,
|
|
100
84
|
data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:text-primary-foreground
|
|
101
|
-
`,{variants:{size:{sm:"size-4.5 [&_svg]:size-3",md:"size-5 [&_svg]:size-3.5",lg:"size-5.5 [&_svg]:size-4"}},defaultVariants:{size:"md"}});function Go(a){var n=a,{className:e,size:t}=n,o=f(n,["className","size"]);return(0,xo.jsx)(tr.Checkbox.Root,s(r({"data-slot":"checkbox",className:v(Ki({size:t}),e)},o),{children:(0,xo.jsxs)(tr.Checkbox.Indicator,{className:v("flex items-center justify-center text-current"),children:[(0,xo.jsx)(tt,{className:"group-data-[state=indeterminate]:hidden"}),(0,xo.jsx)(da,{className:"hidden group-data-[state=indeterminate]:block"})]})}))}var st=require("react/jsx-runtime");function zn(){return(0,st.jsx)(er,{})}function or(){let{setIsUploadModalOpen:e}=G();return(0,st.jsxs)(F,{variant:"outline",size:"md",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 text-md font-medium",onClick:()=>e(!0),children:[(0,st.jsx)(At,{strokeWidth:2,className:"size-5 text-gray-900 dark:text-zinc-100"}),(0,st.jsx)("span",{className:"hidden sm:inline",children:"Upload File"})]})}function ar(){let{setIsCreateFolderModalOpen:e}=G();return(0,st.jsxs)(F,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",onClick:()=>e(!0),children:[(0,st.jsx)(Lt,{className:"size-5 text-gray-900 dark:text-zinc-100"}),(0,st.jsx)("span",{className:"hidden",children:"Create Folder"})]})}var ka=require("react");var Wt=require("react/jsx-runtime");function Rn(e){return(0,Wt.jsxs)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[(0,Wt.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,Wt.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"})]}))}function Tn(e){return(0,Wt.jsx)("svg",s(r({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:(0,Wt.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}))}var Ma=require("react/jsx-runtime");function En(){let[e,t]=(0,ka.useState)(!1);return(0,ka.useEffect)(()=>{let n=localStorage.getItem("theme")==="dark";t(n),document.documentElement.classList.toggle("dark",n)},[]),(0,Ma.jsx)(F,{variant:"outline",size:"icon",radius:"full",onClick:()=>{let a=!e;t(a),document.documentElement.classList.toggle("dark",a),localStorage.setItem("theme",a?"dark":"light")},className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900","aria-label":e?"Switch to light mode":"Switch to dark mode",children:e?(0,Ma.jsx)(Rn,{className:"size-4 text-yellow-500"}):(0,Ma.jsx)(Tn,{className:"size-4 text-gray-700 dark:text-zinc-300"})})}var P=require("react/jsx-runtime");function Ln(){let{setIsUploadModalOpen:e,setIsCreateFolderModalOpen:t,setIsSearchModalOpen:o}=G();return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("div",{className:"hidden md:flex gap-2",children:[(0,P.jsx)(or,{}),(0,P.jsx)(ar,{}),(0,P.jsx)(zn,{}),(0,P.jsx)(En,{})]}),(0,P.jsx)("div",{className:"flex md:hidden",children:(0,P.jsxs)(Ao,{children:[(0,P.jsx)(_o,{asChild:!0,children:(0,P.jsx)(F,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",children:(0,P.jsx)(Gt,{className:"size-5"})})}),(0,P.jsxs)(Vo,{align:"end",className:"w-56 rounded-2xl shadow-xl bg-white/50 dark:bg-zinc-900/80 backdrop-blur-2xl border-gray-200 dark:border-zinc-700",children:[(0,P.jsxs)(it,{onClick:()=>e(!0),className:"cursor-pointer",children:[(0,P.jsx)(At,{className:"size-5 text-gray-900 dark:text-zinc-100"}),(0,P.jsx)("span",{className:"inline",children:"Upload File"})]}),(0,P.jsxs)(it,{onClick:()=>t(!0),className:"cursor-pointer",children:[(0,P.jsx)(Lt,{className:"size-5 text-gray-900 dark:text-zinc-100"}),(0,P.jsx)("span",{className:"inline",children:"Create Folder"})]}),(0,P.jsxs)(it,{onClick:()=>o(!0),className:"cursor-pointer",children:[(0,P.jsx)(Fe,{className:"size-5 text-gray-700 dark:text-zinc-300"}),(0,P.jsx)("span",{className:"inline",children:"Search"})]})]})]})})]})}function An({onSearchClick:e}){let{setIsUploadModalOpen:t,setIsCreateFolderModalOpen:o}=G();return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("div",{className:"hidden md:flex gap-2",children:[(0,P.jsx)(or,{}),(0,P.jsx)(ar,{}),e?(0,P.jsxs)(F,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",onClick:e,children:[(0,P.jsx)(Fe,{className:"size-5 text-gray-900 dark:text-zinc-100"}),(0,P.jsx)("span",{className:"hidden",children:"Search"})]}):null]}),(0,P.jsx)("div",{className:"flex md:hidden",children:(0,P.jsxs)(Ao,{children:[(0,P.jsx)(_o,{asChild:!0,children:(0,P.jsx)(F,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",children:(0,P.jsx)(Gt,{className:"size-5"})})}),(0,P.jsxs)(Vo,{align:"end",className:"w-48",children:[(0,P.jsxs)(it,{onClick:()=>t(!0),className:"cursor-pointer",children:[(0,P.jsx)(At,{className:"size-5 text-gray-900 dark:text-zinc-100"}),(0,P.jsx)("span",{className:"inline",children:"Upload File"})]}),(0,P.jsxs)(it,{onClick:()=>o(!0),className:"cursor-pointer",children:[(0,P.jsx)(Lt,{className:"size-5 text-gray-900 dark:text-zinc-100"}),(0,P.jsx)("span",{className:"inline",children:"Create Folder"})]}),e?(0,P.jsxs)(it,{onClick:e,className:"cursor-pointer",children:[(0,P.jsx)(Fe,{className:"size-5 text-gray-700 dark:text-zinc-300"}),(0,P.jsx)("span",{className:"inline",children:"Search"})]}):null]})]})})]})}var Hn=Zo(require("react"));var re=Zo(require("@radix-ui/react-context-menu")),Yi=require("lucide-react");var zt=require("react/jsx-runtime");function _n(t){var e=f(t,[]);return(0,zt.jsx)(re.Root,r({"data-slot":"context-menu"},e))}function Vn(t){var e=f(t,[]);return(0,zt.jsx)(re.Trigger,r({"data-slot":"context-menu-trigger"},e))}function Gn(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,zt.jsx)(re.Portal,{children:(0,zt.jsx)(re.Content,r({"data-slot":"context-menu-content",className:v("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e)},t))})}function On(n){var i=n,{className:e,inset:t,variant:o="default"}=i,a=f(i,["className","inset","variant"]);return(0,zt.jsx)(re.Item,r({"data-slot":"context-menu-item","data-inset":t,"data-variant":o,className:v("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e)},a))}function Bn(o){var a=o,{className:e}=a,t=f(a,["className"]);return(0,zt.jsx)(re.Separator,r({"data-slot":"context-menu-separator",className:v("bg-border -mx-1 my-1 h-px",e)},t))}var Ce=require("react/jsx-runtime");function Da({children:e,menuItems:t,isInSelectionMode:o=!1,mode:a}){let n=!o&&a!=="modal",i=(l=!1)=>t.map((c,d)=>{let g=d===t.length-1,u=c.variant==="destructive",b=l?it:On,p=l?kn:Bn,C=d<t.length-1&&t[d+1].variant==="destructive";return(0,Ce.jsxs)(Hn.default.Fragment,{children:[(0,Ce.jsxs)(b,{onClick:c.onClick,className:c.className||`text-sm font-medium ${u?"text-red-600 focus:text-red-700 focus:bg-red-50":""} ${d===0?"rounded-t-xl":""} ${g?"rounded-b-xl":""}`,children:[c.icon,c.label]}),C&&!g&&(0,Ce.jsx)(p,{className:"bg-gray-200 dark:bg-zinc-700"})]},d)});return(0,Ce.jsxs)(_n,{children:[(0,Ce.jsx)(Vn,{children:(0,Ce.jsxs)("div",{className:"relative w-full h-full",children:[e,n&&(0,Ce.jsx)("div",{className:"absolute top-0 right-0 z-10 md:hidden",onClick:l=>l.stopPropagation(),children:(0,Ce.jsxs)(Ao,{children:[(0,Ce.jsx)(_o,{asChild:!0,children:(0,Ce.jsx)(F,{variant:"ghost",size:"icon",radius:"full",className:"focus-visible:ring-0 focus-visible:ring-offset-0",children:(0,Ce.jsx)(sa,{className:"size-4 text-gray-700 dark:text-zinc-300"})})}),(0,Ce.jsx)(Vo,{className:"w-56 rounded-2xl shadow-xl bg-white/50 dark:bg-zinc-900/80 backdrop-blur-2xl border-gray-200 dark:border-zinc-700",children:i(!0)})]})})]})}),n&&(0,Ce.jsx)(Gn,{className:"w-56 rounded-2xl shadow-xl bg-white/50 dark:bg-zinc-900/80 backdrop-blur-2xl border-gray-200 dark:border-zinc-700",children:i(!1)})]})}var ie=require("react/jsx-runtime");function Zn({file:e,isSelected:t,onSelect:o,onDelete:a,onEdit:n,onMove:i,selectionMode:l,showCheckbox:c=!1,mode:d=oe.PAGE,isInSelectionMode:g=!1}){let u=h=>{h.stopPropagation(),confirm(`Are you sure you want to delete "${e.name}"?`)&&a(e.id)},b=h=>{h.stopPropagation(),n(e)},p=h=>{h.stopPropagation(),o(e,void 0,!0)},C=h=>{h.stopPropagation(),i(e)},w=h=>{o(e,h,!1)},D=h=>{o(e,void 0,!0)},y=h=>{h.stopPropagation()},{component:k,metadataComponent:z}=ht(e);return(0,ie.jsx)(Da,{menuItems:[{label:"Edit",icon:(0,ie.jsx)(po,{className:"size-6"}),onClick:b},{label:"Select File",icon:(0,ie.jsx)(co,{className:"size-6"}),onClick:p},{label:"Move to...",icon:(0,ie.jsx)(et,{className:"size-6"}),onClick:C},{label:"Delete",icon:(0,ie.jsx)(Ue,{className:"size-6 text-red-600"}),onClick:u,variant:"destructive"}],isInSelectionMode:g,mode:d,children:(0,ie.jsxs)("div",{className:"group relative flex flex-col items-center justify-start transition-all duration-200 cursor-pointer w-full select-none",onDoubleClick:w,onClick:w,children:[(0,ie.jsxs)("div",{className:`
|
|
102
|
-
relative w-full aspect-square flex items-center justify-center mb-1 overflow-hidden rounded-2xl hover:bg-
|
|
103
|
-
${t?"bg-
|
|
104
|
-
`,children:[
|
|
85
|
+
`,{variants:{size:{sm:"size-4.5 [&_svg]:size-3",md:"size-5 [&_svg]:size-3.5",lg:"size-5.5 [&_svg]:size-4"}},defaultVariants:{size:"md"}});function Yt(o){var r=o,{className:e,size:t}=r,a=chunkS4HRPNKF_js.c(r,["className","size"]);return jsxRuntime.jsx(radixUi.Checkbox.Root,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({"data-slot":"checkbox",className:f(xi({size:t}),e)},a),{children:jsxRuntime.jsxs(radixUi.Checkbox.Indicator,{className:f("flex items-center justify-center text-current"),children:[jsxRuntime.jsx(chunkS4HRPNKF_js.w,{className:"group-data-[state=indeterminate]:hidden"}),jsxRuntime.jsx(chunkS4HRPNKF_js.B,{className:"hidden group-data-[state=indeterminate]:block"})]})}))}function pr(){return jsxRuntime.jsx(Uo,{})}function $o(){let{setIsUploadModalOpen:e}=E();return jsxRuntime.jsxs(y,{variant:"outline",size:"md",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 text-md font-medium",onClick:()=>e(true),children:[jsxRuntime.jsx(chunkS4HRPNKF_js.q,{strokeWidth:2,className:"size-5 text-gray-900 dark:text-zinc-100"}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Upload File"})]})}function Ko(){let{setIsCreateFolderModalOpen:e}=E();return jsxRuntime.jsxs(y,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",onClick:()=>e(true),children:[jsxRuntime.jsx(chunkS4HRPNKF_js.n,{className:"size-5 text-gray-900 dark:text-zinc-100"}),jsxRuntime.jsx("span",{className:"hidden",children:"Create Folder"})]})}function gr(e){return jsxRuntime.jsxs("svg",chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"4"}),jsxRuntime.jsx("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"})]}))}function vr(e){return jsxRuntime.jsx("svg",chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},e),{children:jsxRuntime.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}))}function xr(){let[e,t]=Fi.useState(false);return Fi.useEffect(()=>{let r=localStorage.getItem("theme")==="dark";t(r),document.documentElement.classList.toggle("dark",r);},[]),jsxRuntime.jsx(y,{variant:"outline",size:"icon",radius:"full",onClick:()=>{let o=!e;t(o),document.documentElement.classList.toggle("dark",o),localStorage.setItem("theme",o?"dark":"light");},className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900","aria-label":e?"Switch to light mode":"Switch to dark mode",children:e?jsxRuntime.jsx(gr,{className:"size-4 text-yellow-500"}):jsxRuntime.jsx(vr,{className:"size-4 text-gray-700 dark:text-zinc-300"})})}function br(){let{setIsUploadModalOpen:e,setIsCreateFolderModalOpen:t,setIsSearchModalOpen:a}=E();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"hidden md:flex gap-2",children:[jsxRuntime.jsx($o,{}),jsxRuntime.jsx(Ko,{}),jsxRuntime.jsx(pr,{}),jsxRuntime.jsx(xr,{})]}),jsxRuntime.jsx("div",{className:"flex md:hidden",children:jsxRuntime.jsxs(Wt,{children:[jsxRuntime.jsx(jt,{asChild:true,children:jsxRuntime.jsx(y,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",children:jsxRuntime.jsx(chunkS4HRPNKF_js.z,{className:"size-5"})})}),jsxRuntime.jsxs(Qt,{align:"end",className:"w-56 rounded-2xl shadow-xl bg-white/50 dark:bg-zinc-900/80 backdrop-blur-2xl border-gray-200 dark:border-zinc-700",children:[jsxRuntime.jsxs(Ke,{onClick:()=>e(true),className:"cursor-pointer",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.q,{className:"size-5 text-gray-900 dark:text-zinc-100"}),jsxRuntime.jsx("span",{className:"inline",children:"Upload File"})]}),jsxRuntime.jsxs(Ke,{onClick:()=>t(true),className:"cursor-pointer",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.n,{className:"size-5 text-gray-900 dark:text-zinc-100"}),jsxRuntime.jsx("span",{className:"inline",children:"Create Folder"})]}),jsxRuntime.jsxs(Ke,{onClick:()=>a(true),className:"cursor-pointer",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.l,{className:"size-5 text-gray-700 dark:text-zinc-300"}),jsxRuntime.jsx("span",{className:"inline",children:"Search"})]})]})]})})]})}function hr({onSearchClick:e}){let{setIsUploadModalOpen:t,setIsCreateFolderModalOpen:a}=E();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"hidden md:flex gap-2",children:[jsxRuntime.jsx($o,{}),jsxRuntime.jsx(Ko,{}),e?jsxRuntime.jsxs(y,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",onClick:e,children:[jsxRuntime.jsx(chunkS4HRPNKF_js.l,{className:"size-5 text-gray-900 dark:text-zinc-100"}),jsxRuntime.jsx("span",{className:"hidden",children:"Search"})]}):null]}),jsxRuntime.jsx("div",{className:"flex md:hidden",children:jsxRuntime.jsxs(Wt,{children:[jsxRuntime.jsx(jt,{asChild:true,children:jsxRuntime.jsx(y,{variant:"outline",size:"icon",radius:"full",className:"border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",children:jsxRuntime.jsx(chunkS4HRPNKF_js.z,{className:"size-5"})})}),jsxRuntime.jsxs(Qt,{align:"end",className:"w-48",children:[jsxRuntime.jsxs(Ke,{onClick:()=>t(true),className:"cursor-pointer",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.q,{className:"size-5 text-gray-900 dark:text-zinc-100"}),jsxRuntime.jsx("span",{className:"inline",children:"Upload File"})]}),jsxRuntime.jsxs(Ke,{onClick:()=>a(true),className:"cursor-pointer",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.n,{className:"size-5 text-gray-900 dark:text-zinc-100"}),jsxRuntime.jsx("span",{className:"inline",children:"Create Folder"})]}),e?jsxRuntime.jsxs(Ke,{onClick:e,className:"cursor-pointer",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.l,{className:"size-5 text-gray-700 dark:text-zinc-300"}),jsxRuntime.jsx("span",{className:"inline",children:"Search"})]}):null]})]})})]})}function Cr(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(q__namespace.Root,chunkS4HRPNKF_js.a({"data-slot":"context-menu"},e))}function Fr(t){var e=chunkS4HRPNKF_js.c(t,[]);return jsxRuntime.jsx(q__namespace.Trigger,chunkS4HRPNKF_js.a({"data-slot":"context-menu-trigger"},e))}function wr(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(q__namespace.Portal,{children:jsxRuntime.jsx(q__namespace.Content,chunkS4HRPNKF_js.a({"data-slot":"context-menu-content",className:f("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e)},t))})}function Nr(r){var n=r,{className:e,inset:t,variant:a="default"}=n,o=chunkS4HRPNKF_js.c(n,["className","inset","variant"]);return jsxRuntime.jsx(q__namespace.Item,chunkS4HRPNKF_js.a({"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:f("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e)},o))}function Mr(a){var o=a,{className:e}=o,t=chunkS4HRPNKF_js.c(o,["className"]);return jsxRuntime.jsx(q__namespace.Separator,chunkS4HRPNKF_js.a({"data-slot":"context-menu-separator",className:f("bg-border -mx-1 my-1 h-px",e)},t))}function bo({children:e,menuItems:t,isInSelectionMode:a=false,mode:o}){let r=!a&&o!=="modal",n=(s=false)=>t.map((m,l)=>{let v=l===t.length-1,u=m.variant==="destructive",x=s?Ke:Nr,c=s?sr:Mr,w=l<t.length-1&&t[l+1].variant==="destructive";return jsxRuntime.jsxs(Fi__default.default.Fragment,{children:[jsxRuntime.jsxs(x,{onClick:m.onClick,className:m.className||`text-sm font-medium ${u?"text-red-600 focus:text-red-700 focus:bg-red-50":""} ${l===0?"rounded-t-xl":""} ${v?"rounded-b-xl":""}`,children:[m.icon,m.label]}),w&&!v&&jsxRuntime.jsx(c,{className:"bg-gray-200 dark:bg-zinc-700"})]},l)});return jsxRuntime.jsxs(Cr,{children:[jsxRuntime.jsx(Fr,{children:jsxRuntime.jsxs("div",{className:"relative w-full h-full",children:[e,r&&jsxRuntime.jsx("div",{className:"absolute top-0 right-0 z-10 md:hidden",onClick:s=>s.stopPropagation(),children:jsxRuntime.jsxs(Wt,{children:[jsxRuntime.jsx(jt,{asChild:true,children:jsxRuntime.jsx(y,{variant:"ghost",size:"icon",radius:"full",className:"focus-visible:ring-0 focus-visible:ring-offset-0",children:jsxRuntime.jsx(chunkS4HRPNKF_js.A,{className:"size-4 text-gray-700 dark:text-zinc-300"})})}),jsxRuntime.jsx(Qt,{className:"w-56 rounded-2xl shadow-xl bg-white/50 dark:bg-zinc-900/80 backdrop-blur-2xl border-gray-200 dark:border-zinc-700",children:n(true)})]})})]})}),r&&jsxRuntime.jsx(wr,{className:"w-56 rounded-2xl shadow-xl bg-white/50 dark:bg-zinc-900/80 backdrop-blur-2xl border-gray-200 dark:border-zinc-700",children:n(false)})]})}function kr({file:e,isSelected:t,onSelect:a,onDelete:o,onEdit:r,onMove:n,selectionMode:s,showCheckbox:m=false,mode:l=chunkS4HRPNKF_js.d.PAGE,isInSelectionMode:v=false}){let u=b=>{b.stopPropagation(),confirm(`Are you sure you want to delete "${e.name}"?`)&&o(e.id);},x=b=>{b.stopPropagation(),r(e);},c=b=>{b.stopPropagation(),a(e,void 0,true);},w=b=>{b.stopPropagation(),n(e);},F=b=>{a(e,b,false);},M=b=>{a(e,void 0,true);},C=b=>{b.stopPropagation();},{component:N,metadataComponent:D}=Xe(e);return jsxRuntime.jsx(bo,{menuItems:[{label:"Edit",icon:jsxRuntime.jsx(chunkS4HRPNKF_js.y,{className:"size-6"}),onClick:x},{label:"Select File",icon:jsxRuntime.jsx(chunkS4HRPNKF_js.x,{className:"size-6"}),onClick:c},{label:"Move to...",icon:jsxRuntime.jsx(chunkS4HRPNKF_js.m,{className:"size-6"}),onClick:w},{label:"Delete",icon:jsxRuntime.jsx(chunkS4HRPNKF_js.r,{className:"size-6 text-red-600"}),onClick:u,variant:"destructive"}],isInSelectionMode:v,mode:l,children:jsxRuntime.jsxs("div",{className:"group relative flex flex-col items-center justify-start transition-all duration-200 cursor-pointer w-full select-none",onDoubleClick:F,onClick:F,children:[jsxRuntime.jsxs("div",{className:`
|
|
86
|
+
relative w-full aspect-square flex items-center justify-center mb-1 overflow-hidden rounded-2xl hover:bg-accent/60
|
|
87
|
+
${t?"bg-accent/60":""}
|
|
88
|
+
`,children:[jsxRuntime.jsx("div",{className:"w-[75%] h-[75%] flex items-center justify-center",children:jsxRuntime.jsx(N,{file:e,metaData:e.metaData})}),(s===chunkS4HRPNKF_js.f.MULTIPLE||m)&&jsxRuntime.jsx("div",{className:`absolute top-2 left-2 z-10 ${t?"opacity-100":"opacity-0 group-hover:opacity-100"} transition-opacity duration-200`,onClick:C,children:jsxRuntime.jsx(Yt,{checked:t,onCheckedChange:M,className:"bg-background/90 border-border shadow-sm data-[state=checked]:bg-primary data-[state=checked]:border-primary rounded-full h-5 w-5"})})]}),jsxRuntime.jsxs("div",{className:"w-full text-center px-0.5 flex flex-col items-center",children:[jsxRuntime.jsx("span",{className:`
|
|
105
89
|
text-[13px] font-semibold leading-[1.3] tracking-tight line-clamp-2 px-2.5 py-[2px] rounded-[6px] transition-colors duration-100 wrap-break-word max-w-full
|
|
106
|
-
${t?"bg-
|
|
107
|
-
`,children:e.name}),
|
|
90
|
+
${t?"bg-primary text-primary-foreground antialiased shadow-sm":"text-foreground group-hover:text-foreground/80"}
|
|
91
|
+
`,children:e.name}),jsxRuntime.jsxs("div",{className:`flex flex-col items-center justify-center gap-0.5 mt-1 transition-opacity duration-200 ${t?"opacity-60":"opacity-100"}`,children:[jsxRuntime.jsx("span",{className:"text-[11px] text-primary font-medium tracking-tight",children:ee(e.size)}),D?jsxRuntime.jsx("div",{className:"text-[11px] text-muted-foreground flex items-center scale-95",children:jsxRuntime.jsx(D,{file:e})}):null]})]})]})})}function Dr({folder:e,isSelected:t,onSelect:a,onRightClick:o,onDelete:r,onRename:n,onMove:s,selectionMode:m,showCheckbox:l,mode:v,isInSelectionMode:u}){let x=k=>{k.stopPropagation(),confirm(`Are you sure you want to delete "${e.name}"?
|
|
108
92
|
|
|
109
|
-
\u26A0\uFE0F Warning: This will also delete all ${e.fileCount} file(s) inside this folder.`)&&
|
|
110
|
-
relative w-full aspect-square flex items-center justify-center mb-1 overflow-hidden rounded-2xl hover:bg-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
`,children:e.name}),(0,pe.jsx)("div",{className:`flex items-center justify-center gap-1 mt-1 transition-opacity duration-200 ${t?"opacity-60":"opacity-100"}`,children:(0,pe.jsxs)("span",{className:"text-[11px] text-blue-600 dark:text-blue-400 font-medium tracking-tight px-1.5 rounded-full",children:[e.fileCount," items"]})})]})]})})}var He=require("react/jsx-runtime");function Ia(){let{files:e,folders:t,isLoading:o,handleFileClick:a,handleFolderClick:n,bulkDelete:i,mode:l,selectionMode:c,isInSelectionMode:d,selectedFiles:g,selectedFolders:u,currentFolder:b,setSelectedFiles:p,setSelectedFolders:C,setIsRenameFolderModalOpen:w,setIsMoveFileModalOpen:D,setFileDetailsModalFile:y,setFolderToRename:k}=G(),R=(()=>{if(!b)return 18;let h=b.folderCount||0,I=b.fileCount||0,Y=h+I;return Y>0?Y:18})();return o?(0,He.jsx)("div",{className:"p-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8 content-start",children:Array.from({length:R}).map((h,I)=>(0,He.jsxs)("div",{className:"flex flex-col items-center justify-start w-full gap-2",children:[(0,He.jsx)("div",{className:"w-full aspect-square bg-gray-100 dark:bg-zinc-800 rounded-2xl animate-pulse"}),(0,He.jsxs)("div",{className:"flex flex-col items-center gap-1 w-full",children:[(0,He.jsx)("div",{className:"h-4 w-20 bg-gray-100 dark:bg-zinc-800 rounded animate-pulse"}),(0,He.jsx)("div",{className:"h-3 w-12 bg-gray-100 dark:bg-zinc-800 rounded animate-pulse"})]})]},I))}):(0,He.jsxs)("div",{className:"p-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8 content-start",children:[t.map(h=>(0,He.jsx)(Un,{folder:h,isSelected:u.some(I=>I.id===h.id),onSelect:n,onDelete:()=>i(),onRename:I=>{k(I),w(!0)},onMove:I=>{C([I]),p([]),D(!0)},selectionMode:c,mode:l,isInSelectionMode:d()},h.id)),e.map(h=>(0,He.jsx)(Zn,{file:h,isSelected:g.some(I=>I.id===h.id),onSelect:a,onDelete:()=>i(),onEdit:I=>{y(I)},onMove:I=>{p([I]),C([]),D(!0)},selectionMode:c,mode:l,isInSelectionMode:d()},h.id))]})}var jn=require("react");var ke=require("react/jsx-runtime"),Na=class extends jn.Component{constructor(o){super(o);this.handleReset=()=>{window.location.reload()};this.state={hasError:!1,error:null}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}componentDidCatch(o,a){console.error("FileManager Error Boundary caught an error:",o,a)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,ke.jsx)("div",{className:"flex items-center justify-center min-h-[400px] p-8 w-full h-full bg-slate-50/50 rounded-lg border border-dashed border-slate-200",children:(0,ke.jsxs)("div",{className:"text-center max-w-md flex flex-col items-center",children:[(0,ke.jsx)("div",{className:"bg-red-100 p-3 rounded-full mb-4",children:(0,ke.jsx)(ca,{className:"size-8 text-red-600"})}),(0,ke.jsx)("h2",{className:"text-xl font-semibold text-slate-900 mb-2",children:"Something went wrong"}),(0,ke.jsx)("p",{className:"text-sm text-slate-500 mb-6",children:"The file manager encountered an unexpected error. Refreshing the page usually resolves this issue."}),this.state.error&&(0,ke.jsxs)("details",{className:"mb-6 text-left w-full border border-slate-200 rounded-lg overflow-hidden flex-col group",children:[(0,ke.jsx)("summary",{className:"cursor-pointer text-xs font-mono bg-slate-100 p-2 text-slate-600 hover:bg-slate-200 transition-colors",children:"View Technical Details"}),(0,ke.jsx)("div",{className:"p-3 bg-white dark:bg-zinc-900",children:(0,ke.jsx)("pre",{className:"text-[10px] text-slate-600 font-mono whitespace-pre-wrap word-break-all max-h-40 overflow-auto",children:this.state.error.toString()})})]}),(0,ke.jsxs)(F,{onClick:this.handleReset,radius:"full",className:"gap-2",children:[(0,ke.jsx)(mo,{className:"size-4"}),"Reload Application"]})]})}):this.props.children}};var Wn=require("react");function $n(){let{handleSelectAllGlobal:e,handleClearSelection:t,getSelectionState:o,isCreateFolderModalOpen:a,setIsCreateFolderModalOpen:n,isUploadModalOpen:i,setIsUploadModalOpen:l,isSearchModalOpen:c,setIsSearchModalOpen:d}=G();return(0,Wn.useEffect)(()=>{let g=u=>{u.key==="k"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),d(!c)),u.key==="a"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),o()===!0?t():e(!0)),u.key==="f"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),n(!a)),u.key==="u"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),l(!i))};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,t,o,a,n,i,l,c,d]),null}var ye=require("react/jsx-runtime");function Kn(e){return(0,ye.jsx)(Na,{children:(0,ye.jsxs)(nt.Page,s(r({},e),{children:[(0,ye.jsx)($n,{}),(0,ye.jsxs)("div",{className:"flex h-full relative pb-12 overflow-hidden",children:[(0,ye.jsxs)("div",{className:"flex-1 flex w-full flex-col",children:[(0,ye.jsx)(nt.Header,{children:(0,ye.jsxs)("div",{className:"flex w-full justify-between gap-2",children:[(0,ye.jsx)(wa,{}),(0,ye.jsx)(Ln,{})]})}),(0,ye.jsx)(yn,{className:"-mb-1"}),(0,ye.jsx)(Ia,{}),(0,ye.jsx)(nt.Footer,{className:"pt-6 pb-10"})]}),(0,ye.jsx)(nt.Overlays,{})]})]}))})}var Rt=require("react");var $=require("react/jsx-runtime");function Yn(a){var n=a,{open:e,onClose:t}=n,o=f(n,["open","onClose"]);return(0,$.jsx)(nt.Modal,s(r({},o),{onClose:t,children:(0,$.jsx)(Te,{open:e,onOpenChange:t,children:(0,$.jsx)(qi,{onClose:t})})}))}function qi({onClose:e}){let{updateSearchQuery:t}=G(),[o,a]=(0,Rt.useState)(!1),[n,i]=(0,Rt.useState)(""),l=(0,Rt.useRef)(null),c=Fa(n,300);return(0,Rt.useEffect)(()=>{t(c)},[c,t]),(0,Rt.useEffect)(()=>{o&&l.current&&l.current.focus()},[o]),(0,$.jsxs)(Ee,{className:"p-0",variant:"fullscreen",showCloseButton:!1,children:[(0,$.jsxs)(We,{className:"pt-5 pb-3 m-0 border-b border-border",children:[(0,$.jsx)(Le,{className:"px-6 text-base",children:(0,$.jsx)("div",{className:"flex w-full justify-between gap-2",children:o?(0,$.jsxs)("div",{className:"flex items-center gap-4 flex-1",children:[(0,$.jsx)(Fe,{className:"size-5 text-gray-500 shrink-0"}),(0,$.jsx)(ho,{ref:l,type:"text",placeholder:"Search files and folders...",className:"border-none shadow-none focus-visible:ring-0 h-auto p-0 text-base font-semibold",value:n,onChange:d=>i(d.target.value),onKeyDown:d=>{d.key==="Escape"&&(i(""),t(""),a(!1))}}),(0,$.jsx)(Ie,{onClick:()=>{i(""),t(""),a(!1)},className:"shrink-0",label:"Cancel Search"})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(wa,{}),(0,$.jsx)(An,{onSearchClick:()=>a(!0)}),(0,$.jsx)(Ie,{onClick:e})]})})}),(0,$.jsx)(mt,{className:"sr-only",children:"Browse and select files from your media library"})]}),(0,$.jsxs)("div",{className:"overflow-y-auto flex-1 pb-4",children:[(0,$.jsx)(Ia,{}),(0,$.jsx)(nt.Footer,{className:"my-4"}),(0,$.jsx)(nt.Overlays,{})]}),(0,$.jsx)(Qi,{onClose:e})]})}function Qi({onClose:e}){let{selectedFiles:t,onFilesSelected:o,setSelectedFiles:a,setSelectedFolders:n,updateSearchQuery:i,handlePageChange:l}=G();return(0,$.jsxs)($e,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2",children:[(0,$.jsx)(Cn,{}),(0,$.jsx)(ot,{asChild:!0,children:(0,$.jsx)(F,{type:"button",variant:"outline",onClick:e,radius:"full",className:"w-full md:w-auto mr-0",children:"Cancel"})}),(0,$.jsxs)(F,{type:"button",onClick:()=>{o&&t.length>0&&(o(t),a([]),n([]),i(""),l(1),e())},disabled:t.length===0,radius:"full",className:"w-full md:w-auto",children:["Select ",t.length>0?`(${t.length})`:""]})]})}var Ne=[{id:1,name:"Documents",pathId:1,path:"/1",parentId:null,fileCount:20,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:2,name:"Images",pathId:2,path:"/2",parentId:null,fileCount:10,folderCount:3,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:3,name:"Videos",pathId:3,path:"/3",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:4,name:"Music Some Long Name Streched also so long to fit in the card Music Some Long Name Streched also so long to fit in the card",pathId:4,path:"/4",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:5,name:"Archives",pathId:5,path:"/5",parentId:null,fileCount:5,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:6,name:"Album 01",pathId:6,path:"/2/6",parentId:2,fileCount:0,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:7,name:"Album 02",pathId:7,path:"/2/7",parentId:2,fileCount:0,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")},{id:8,name:"Squirrels",pathId:8,path:"/2/8",parentId:2,fileCount:1,folderCount:0,createdAt:new Date("2024-01-01"),updatedAt:new Date("2024-01-01")}],qn=[{id:1,name:"Important",color:"#ef4444"},{id:2,name:"Work",color:"#3b82f6"},{id:3,name:"Personal",color:"#10b981"},{id:4,name:"Project",color:"#8b5cf6"},{id:5,name:"Archive",color:"#6b7280"}],Pe=[{id:101,name:"welcome.pdf",url:"/placeholder.svg?height=400&width=300",size:245e3,createdAt:new Date("2024-05-15T10:00:00Z"),updatedAt:new Date("2024-05-15T10:00:00Z"),folderId:null,tags:["important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:2,author:"Admin"}},{id:102,name:"desktop_wallpaper.jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926",size:42e5,createdAt:new Date("2024-05-14T15:30:00Z"),updatedAt:new Date("2024-05-14T15:30:00Z"),folderId:null,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:5e3,height:3333,formats:{thumbnail:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=156",hash:"thumbnail_desktop_wallpaper_abc123",mime:"image/jpeg",name:"thumbnail_desktop_wallpaper.jpg",path:null,size:5.57,width:156,height:104},small:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=500",hash:"small_desktop_wallpaper_abc123",mime:"image/jpeg",name:"small_desktop_wallpaper.jpg",path:null,size:47.27,width:500,height:333},medium:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=750",hash:"medium_desktop_wallpaper_abc123",mime:"image/jpeg",name:"medium_desktop_wallpaper.jpg",path:null,size:97.89,width:750,height:500},large:{ext:".jpg",url:"https://images.unsplash.com/photo-1557683316-973673baf926?w=1000",hash:"large_desktop_wallpaper_abc123",mime:"image/jpeg",name:"large_desktop_wallpaper.jpg",path:null,size:159.48,width:1e3,height:667}},metaData:{}},{id:103,name:"quick_notes.txt",url:"/placeholder.svg?height=400&width=300",size:3500,createdAt:new Date("2024-05-13T09:45:00Z"),updatedAt:new Date("2024-05-13T09:45:00Z"),folderId:null,tags:[],mime:"text/plain",ext:".txt",metaData:{}},{id:104,name:"intro_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:12e6,createdAt:new Date("2024-05-12T14:00:00Z"),updatedAt:new Date("2024-05-12T14:00:00Z"),folderId:null,tags:[],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:90,videoSource:"local"}},{id:105,name:"profile_photo.png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde",size:85e4,createdAt:new Date("2024-05-11T11:20:00Z"),updatedAt:new Date("2024-05-11T11:20:00Z"),folderId:null,tags:["personal"],mime:"image/png",ext:".png",width:2e3,height:2e3,formats:{thumbnail:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=156",hash:"thumbnail_profile_photo_def456",mime:"image/png",name:"thumbnail_profile_photo.png",path:null,size:8.2,width:156,height:156},small:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=500",hash:"small_profile_photo_def456",mime:"image/png",name:"small_profile_photo.png",path:null,size:52.3,width:500,height:500},medium:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=750",hash:"medium_profile_photo_def456",mime:"image/png",name:"medium_profile_photo.png",path:null,size:110.5,width:750,height:750},large:{ext:".png",url:"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=1000",hash:"large_profile_photo_def456",mime:"image/png",name:"large_profile_photo.png",path:null,size:185.7,width:1e3,height:1e3}},metaData:{}},{id:106,name:"todo_list.md",url:"/placeholder.svg?height=400&width=300",size:6200,createdAt:new Date("2024-05-10T08:30:00Z"),updatedAt:new Date("2024-05-10T08:30:00Z"),folderId:null,tags:["important"],mime:"text/markdown",ext:".md",metaData:{}},{id:107,name:"app_settings.json",url:"/placeholder.svg?height=400&width=300",size:4800,createdAt:new Date("2024-05-09T16:15:00Z"),updatedAt:new Date("2024-05-09T16:15:00Z"),folderId:null,tags:[],mime:"application/json",ext:".json",metaData:{}},{id:108,name:"mountain_landscape.webp",url:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4",size:12e5,createdAt:new Date("2024-05-08T13:00:00Z"),updatedAt:new Date("2024-05-08T13:00:00Z"),folderId:null,tags:["personal"],mime:"image/webp",ext:".webp",width:4e3,height:2667,metaData:{}},{id:1,name:"Key-Monastery-img.avif",url:"https://unciatrails.com/wp-content/uploads/2024/07/Key-Monastery-img.avif",size:2621440,createdAt:new Date("2023-10-26T10:30:00Z"),updatedAt:new Date("2023-10-26T10:30:00Z"),folderId:8,tags:["personal","important"],mime:"image/avif",ext:".avif",caption:"A cute squirrel in the park",alternativeText:"Gray squirrel sitting on wooden fence",width:3024,height:4032,metaData:{}},{id:2,name:"project_proposal thoda sa.pdf",url:"/placeholder.svg?height=400&width=300",size:1048576,createdAt:new Date("2024-05-10T14:20:00Z"),updatedAt:new Date("2024-05-10T14:20:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:15,author:"John Doe"}},{id:3,name:"quarterly_report.xlsx",url:"/placeholder.svg?height=400&width=300",size:524288,createdAt:new Date("2024-05-08T09:15:00Z"),updatedAt:new Date("2024-05-08T09:15:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:10}},{id:4,name:"presentation.pptx",url:"/placeholder.svg?height=400&width=300",size:2097152,createdAt:new Date("2024-05-05T16:45:00Z"),updatedAt:new Date("2024-05-05T16:45:00Z"),folderId:1,tags:["work","project"],mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ext:".pptx",metaData:{pageCount:20}},{id:8,name:"documnet.doc",url:"/placeholder.svg?height=400&width=300",size:2097152,createdAt:new Date("2024-05-05T16:45:00Z"),updatedAt:new Date("2024-05-05T16:45:00Z"),folderId:1,tags:["work","project"],mime:"application/msword",ext:".doc",metaData:{pageCount:20}},{id:5,name:"demo_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:10485760,createdAt:new Date("2024-05-03T11:30:00Z"),updatedAt:new Date("2024-05-03T11:30:00Z"),folderId:3,tags:["project"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:120,videoSource:"remote"}},{id:6,name:"podcast_episode.mp3",url:"/placeholder.svg?height=400&width=300",size:5242880,createdAt:new Date("2024-05-02T10:00:00Z"),updatedAt:new Date("2024-05-02T10:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:3600}},{id:7,name:"notes.txt",url:"/placeholder.svg?height=400&width=300",size:1024,createdAt:new Date("2024-05-01T09:00:00Z"),updatedAt:new Date("2024-05-01T09:00:00Z"),folderId:1,tags:["work"],mime:"text/plain",ext:".txt",metaData:{}},{id:9,name:"data.json",url:"/placeholder.svg?height=400&width=300",size:2048,createdAt:new Date("2024-04-30T15:00:00Z"),updatedAt:new Date("2024-04-30T15:00:00Z"),folderId:1,tags:["project"],mime:"application/json",ext:".json",metaData:{}},{id:10,name:"archive.zip",url:"/placeholder.svg?height=400&width=300",size:104857600,createdAt:new Date("2024-04-29T12:00:00Z"),updatedAt:new Date("2024-04-29T12:00:00Z"),folderId:5,tags:["archive"],mime:"application/zip",ext:".zip",metaData:{description:"Project backup"}},{id:11,name:"setup.exe",url:"/placeholder.svg?height=400&width=300",size:52428800,createdAt:new Date("2024-04-28T11:00:00Z"),updatedAt:new Date("2024-04-28T11:00:00Z"),folderId:5,tags:["software"],mime:"application/x-msdownload",ext:".exe",metaData:{description:"Installer"}},{id:12,name:"old_stuff.rar",url:"/placeholder.svg?height=400&width=300",size:20971520,createdAt:new Date("2024-04-27T10:00:00Z"),updatedAt:new Date("2024-04-27T10:00:00Z"),folderId:5,tags:["archive"],mime:"application/x-rar-compressed",ext:".rar",metaData:{description:"Old files"}},{id:13,name:"meeting_notes_q1.pdf",url:"/placeholder.svg?height=400&width=300",size:856e3,createdAt:new Date("2024-03-15T09:00:00Z"),updatedAt:new Date("2024-03-15T09:00:00Z"),folderId:1,tags:["work"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:8,author:"Sarah Johnson"}},{id:14,name:"budget_2024.xlsx",url:"/placeholder.svg?height=400&width=300",size:425e3,createdAt:new Date("2024-03-10T14:30:00Z"),updatedAt:new Date("2024-03-10T14:30:00Z"),folderId:1,tags:["work","important"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:5}},{id:15,name:"team_photo.jpg",url:"https://images.unsplash.com/photo-1522071820081-009f0129c71c",size:32e5,createdAt:new Date("2024-02-28T11:00:00Z"),updatedAt:new Date("2024-02-28T11:00:00Z"),folderId:2,tags:["work"],mime:"image/jpeg",ext:".jpg",width:4e3,height:3e3,metaData:{}},{id:16,name:"logo_design.png",url:"https://images.unsplash.com/photo-1611162617474-5b21e879e113",size:15e5,createdAt:new Date("2024-02-20T10:00:00Z"),updatedAt:new Date("2024-02-20T10:00:00Z"),folderId:2,tags:["project"],mime:"image/png",ext:".png",width:2e3,height:2e3,metaData:{}},{id:17,name:"product_demo.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:15e6,createdAt:new Date("2024-02-15T16:00:00Z"),updatedAt:new Date("2024-02-15T16:00:00Z"),folderId:3,tags:["project"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:180,videoSource:"local"}},{id:18,name:"training_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:25e6,createdAt:new Date("2024-02-10T09:30:00Z"),updatedAt:new Date("2024-02-10T09:30:00Z"),folderId:3,tags:["work"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:300,videoSource:"local"}},{id:19,name:"background_music.mp3",url:"/placeholder.svg?height=400&width=300",size:45e5,createdAt:new Date("2024-02-05T14:00:00Z"),updatedAt:new Date("2024-02-05T14:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:240}},{id:20,name:"contract_template.docx",url:"/placeholder.svg?height=400&width=300",size:65e4,createdAt:new Date("2024-01-30T11:00:00Z"),updatedAt:new Date("2024-01-30T11:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",ext:".docx",metaData:{pageCount:12}},{id:21,name:"invoice_jan.pdf",url:"/placeholder.svg?height=400&width=300",size:32e4,createdAt:new Date("2024-01-25T10:00:00Z"),updatedAt:new Date("2024-01-25T10:00:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:3}},{id:22,name:"vacation_photo1.jpg",url:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4",size:28e5,createdAt:new Date("2024-01-20T15:00:00Z"),updatedAt:new Date("2024-01-20T15:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:3500,height:2500,metaData:{}},{id:23,name:"vacation_photo2.jpg",url:"https://images.unsplash.com/photo-1469474968028-56623f02e42e",size:31e5,createdAt:new Date("2024-01-20T15:05:00Z"),updatedAt:new Date("2024-01-20T15:05:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4e3,height:2800,metaData:{}},{id:24,name:"project_backup.zip",url:"/placeholder.svg?height=400&width=300",size:85e6,createdAt:new Date("2024-01-15T12:00:00Z"),updatedAt:new Date("2024-01-15T12:00:00Z"),folderId:5,tags:["archive","project"],mime:"application/zip",ext:".zip",metaData:{description:"Full project backup"}},{id:25,name:"presentation_final.pptx",url:"/placeholder.svg?height=400&width=300",size:35e5,createdAt:new Date("2024-01-10T16:00:00Z"),updatedAt:new Date("2024-01-10T16:00:00Z"),folderId:1,tags:["work","important"],mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation",ext:".pptx",metaData:{pageCount:35}},{id:26,name:"screenshot_001.png",url:"https://images.unsplash.com/photo-1517694712202-14dd9538aa97",size:12e5,createdAt:new Date("2024-01-05T09:00:00Z"),updatedAt:new Date("2024-01-05T09:00:00Z"),folderId:2,tags:["work"],mime:"image/png",ext:".png",width:1920,height:1080,metaData:{}},{id:27,name:"config.json",url:"/placeholder.svg?height=400&width=300",size:5e3,createdAt:new Date("2023-12-28T14:00:00Z"),updatedAt:new Date("2023-12-28T14:00:00Z"),folderId:1,tags:["project"],mime:"application/json",ext:".json",metaData:{}},{id:28,name:"readme.md",url:"/placeholder.svg?height=400&width=300",size:8500,createdAt:new Date("2023-12-20T10:00:00Z"),updatedAt:new Date("2023-12-20T10:00:00Z"),folderId:1,tags:["project"],mime:"text/markdown",ext:".md",metaData:{}},{id:29,name:"database_backup.sql",url:"/placeholder.svg?height=400&width=300",size:12e6,createdAt:new Date("2023-12-15T11:00:00Z"),updatedAt:new Date("2023-12-15T11:00:00Z"),folderId:5,tags:["archive","important"],mime:"application/sql",ext:".sql",metaData:{description:"Database backup"}},{id:30,name:"tutorial_video.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:18e6,createdAt:new Date("2023-12-10T13:00:00Z"),updatedAt:new Date("2023-12-10T13:00:00Z"),folderId:3,tags:["personal"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:420,videoSource:"local"}},{id:31,name:"company_logo.svg",url:"/placeholder.svg?height=400&width=300",size:45e3,createdAt:new Date("2023-12-05T09:00:00Z"),updatedAt:new Date("2023-12-05T09:00:00Z"),folderId:2,tags:["work"],mime:"image/svg+xml",ext:".svg",metaData:{}},{id:32,name:"report_q4.pdf",url:"/placeholder.svg?height=400&width=300",size:18e5,createdAt:new Date("2023-12-01T15:00:00Z"),updatedAt:new Date("2023-12-01T15:00:00Z"),folderId:1,tags:["work","important"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:25,author:"Finance Team"}},{id:33,name:"nature_photo.webp",url:"https://images.unsplash.com/photo-1441974231531-c6227db76b6e",size:95e4,createdAt:new Date("2023-11-25T12:00:00Z"),updatedAt:new Date("2023-11-25T12:00:00Z"),folderId:2,tags:["personal"],mime:"image/webp",ext:".webp",width:3e3,height:2e3,metaData:{}},{id:34,name:"podcast_intro.mp3",url:"/placeholder.svg?height=400&width=300",size:25e5,createdAt:new Date("2023-11-20T10:00:00Z"),updatedAt:new Date("2023-11-20T10:00:00Z"),folderId:4,tags:["personal"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:180}},{id:35,name:"data_export.csv",url:"/placeholder.svg?height=400&width=300",size:85e4,createdAt:new Date("2023-11-15T14:00:00Z"),updatedAt:new Date("2023-11-15T14:00:00Z"),folderId:1,tags:["work"],mime:"text/csv",ext:".csv",metaData:{}},{id:36,name:"wireframes.pdf",url:"/placeholder.svg?height=400&width=300",size:42e5,createdAt:new Date("2023-11-10T11:00:00Z"),updatedAt:new Date("2023-11-10T11:00:00Z"),folderId:1,tags:["project"],mime:"application/pdf",ext:".pdf",metaData:{pageCount:45}},{id:37,name:"cityscape.jpg",url:"https://images.unsplash.com/photo-1449824913935-59a10b8d2000",size:38e5,createdAt:new Date("2023-11-05T16:00:00Z"),updatedAt:new Date("2023-11-05T16:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4500,height:3e3,metaData:{}},{id:38,name:"interview_recording.mp3",url:"/placeholder.svg?height=400&width=300",size:85e5,createdAt:new Date("2023-11-01T09:00:00Z"),updatedAt:new Date("2023-11-01T09:00:00Z"),folderId:4,tags:["work"],mime:"audio/mpeg",ext:".mp3",metaData:{duration:1800}},{id:39,name:"client_files.rar",url:"/placeholder.svg?height=400&width=300",size:45e6,createdAt:new Date("2023-10-25T13:00:00Z"),updatedAt:new Date("2023-10-25T13:00:00Z"),folderId:5,tags:["archive","work"],mime:"application/x-rar-compressed",ext:".rar",metaData:{description:"Client deliverables"}},{id:40,name:"marketing_plan.docx",url:"/placeholder.svg?height=400&width=300",size:12e5,createdAt:new Date("2023-10-20T10:00:00Z"),updatedAt:new Date("2023-10-20T10:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",ext:".docx",metaData:{pageCount:18}},{id:41,name:"analytics_data.xlsx",url:"/placeholder.svg?height=400&width=300",size:21e5,createdAt:new Date("2023-10-15T15:00:00Z"),updatedAt:new Date("2023-10-15T15:00:00Z"),folderId:1,tags:["work"],mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ext:".xlsx",metaData:{pageCount:8}},{id:42,name:"sunset_beach.jpg",url:"https://images.unsplash.com/photo-1507525428034-b723cf961d3e",size:32e5,createdAt:new Date("2023-10-10T17:00:00Z"),updatedAt:new Date("2023-10-10T17:00:00Z"),folderId:2,tags:["personal"],mime:"image/jpeg",ext:".jpg",width:4e3,height:2700,metaData:{}},{id:43,name:"webinar_recording.mp4",url:"https://docs.material-tailwind.com/demo.mp4",size:35e6,createdAt:new Date("2023-10-05T14:00:00Z"),updatedAt:new Date("2023-10-05T14:00:00Z"),folderId:3,tags:["work"],mime:"video/mp4",ext:".mp4",width:1920,height:1080,metaData:{duration:600,videoSource:"local"}},{id:44,name:"sound_effects.wav",url:"/placeholder.svg?height=400&width=300",size:15e6,createdAt:new Date("2023-10-01T11:00:00Z"),updatedAt:new Date("2023-10-01T11:00:00Z"),folderId:4,tags:["project"],mime:"audio/wav",ext:".wav",metaData:{duration:120}},{id:45,name:"legacy_system.zip",url:"/placeholder.svg?height=400&width=300",size:125e6,createdAt:new Date("2023-09-25T09:00:00Z"),updatedAt:new Date("2023-09-25T09:00:00Z"),folderId:5,tags:["archive"],mime:"application/zip",ext:".zip",metaData:{description:"Old system files"}}];var Oo=e=>new Promise(t=>setTimeout(t,e)),Pa=class{getFolder(t){if(t===null)return Promise.resolve(null);let o=Ne.find(i=>i.id===t);if(!o)return Promise.resolve(null);let a=r({},o),n=a;for(;n.parentId!==null;){let i=Ne.find(l=>l.id===n.parentId);if(i)n.parent=r({},i),n=n.parent;else break}return Promise.resolve(a)}async getFolders(t,o=1,a=20,n=""){await Oo(300);let i=t!==null?Ne.filter(p=>p.parentId===t):Ne.filter(p=>p.parentId===null),l=i;if(n&&n.trim()){let p=n.toLowerCase().trim();l=i.filter(C=>C.name.toLowerCase().includes(p))}let c=l.sort((p,C)=>new Date(p.createdAt).getTime()-new Date(C.createdAt).getTime()),d=c.length,g=Math.ceil(d/a),u=(o-1)*a;return{folders:c.slice(u,u+a),pagination:{currentPage:o,totalPages:g,totalFiles:d,filesPerPage:a}}}getTags(){return Promise.resolve(qn.map(t=>t.name))}async getFiles(t,o,a,n,i){await Oo(500);let l=[...Pe];if(t!==null&&(l=l.filter(w=>w.folderId===t)),o&&o.length>0&&(l=l.filter(w=>{let D=Ke(w.mime,w.ext);return o.includes(D)})),i){let w=i==null?void 0:i.toLowerCase();l=l.filter(D=>D.name.toLowerCase().includes(w))}let c=l.sort((w,D)=>new Date(w.createdAt).getTime()-new Date(D.createdAt).getTime()),d=a!=null?a:1,g=n!=null?n:10,u=c.length,b=Math.ceil(u/g),p=(d-1)*g,C=c.slice(p,p+g);return Promise.resolve({files:C,pagination:{currentPage:d,totalPages:b,totalFiles:u,filesPerPage:g}})}async getItems(t,o,a=1,n=24,i=""){await Oo(300);let l=t!==null?Ne.filter(h=>h.parentId===t):Ne.filter(h=>h.parentId===null),c=t!==null?Pe.filter(h=>h.folderId===t):Pe.filter(h=>h.folderId===null);if(o&&o.length>0&&(c=c.filter(h=>{let I=Ke(h.mime,h.ext);return o.includes(I)})),i&&i.trim()){let h=i.toLowerCase().trim();l=l.filter(I=>I.name.toLowerCase().includes(h)),c=c.filter(I=>{var Y,te;return I.name.toLowerCase().includes(h)||((te=(Y=I.ext)==null?void 0:Y.toLowerCase().includes(h))!=null?te:!1)})}let d=l.sort((h,I)=>new Date(h.createdAt).getTime()-new Date(I.createdAt).getTime()),g=c.sort((h,I)=>new Date(h.createdAt).getTime()-new Date(I.createdAt).getTime()),u=d.length+g.length,b=Math.ceil(u/n)||1,p=(a-1)*n,C=p+n,w=d.slice(Math.max(0,p),Math.min(d.length,C)),D=w.length,y=n-D,k=Math.min(d.length,p),z=Math.max(0,p-d.length),R=g.slice(z,z+y);return{folders:w,files:R,pagination:{currentPage:a,totalPages:b,totalFiles:u,filesPerPage:n}}}async createFolder(t,o){await Oo(300);let a={id:Date.now(),name:t,parentId:o!=null?o:null,pathId:typeof o=="number"?o:0,path:"",fileCount:0,folderCount:0,createdAt:new Date,updatedAt:new Date};return Ne.push(a),a}getMetaDataType(t,o){return t.type.startsWith("image/")?{}:t.type.startsWith("video/")?{duration:0,videoSource:o!=null?o:za.LOCAL}:t.type.startsWith("audio/")?{duration:0}:{description:""}}getFileType(t){var a;let o="."+((a=t.name.split(".").pop())==null?void 0:a.toLowerCase());return Ke(t.type,o)}async uploadFiles(t,o){var n;await Oo(500);let a=[];for(let{file:i,videoSource:l}of t){let c=this.getFileType(i),d="."+((n=i.name.split(".").pop())==null?void 0:n.toLowerCase()),g={id:Date.now()+Math.random(),name:i.name,folderId:o!=null?o:null,size:i.size,url:URL.createObjectURL(i),mime:i.type||"application/octet-stream",ext:d,metaData:this.getMetaDataType(i,l),createdAt:new Date,updatedAt:new Date,tags:[],width:c===X.IMAGE?800:void 0,height:c===X.IMAGE?600:void 0};Pe.push(g),a.push(g)}return a}renameFolder(t,o){let a=Ne.find(n=>n.id===t);return a?(a.name=o,a.updatedAt=new Date,Promise.resolve(a)):Promise.reject(new Error("Folder not found"))}updateFileMetaData(t,o){let a=Pe.find(c=>c.id===t);if(!a)return Promise.reject(new Error("File not found"));let l=o,{metaData:n}=l,i=f(l,["metaData"]);return Object.assign(a,i),n&&(a.metaData=r(r({},a.metaData),n)),a.updatedAt=new Date,Promise.resolve(a)}deleteFiles(t){for(let o of t){let a=Pe.findIndex(n=>n.id===o);a!==-1&&Pe.splice(a,1)}return Promise.resolve()}deleteFolders(t){for(let o of t){let a=Ne.findIndex(n=>n.id===o);if(a!==-1){Ne.splice(a,1);for(let n=Pe.length-1;n>=0;n--)Pe[n].folderId===o&&Pe.splice(n,1)}}return Promise.resolve()}findFiles(t){let o=t==null?void 0:t.toLowerCase(),a=Pe.filter(n=>{var i;return n.name.toLowerCase().includes(o)||((i=n.tags)==null?void 0:i.some(l=>l.toLowerCase().includes(o)))});return Promise.resolve(a)}findFolders(t){let o=t==null?void 0:t.toLowerCase(),a=Ne.filter(n=>n.name.toLowerCase().includes(o));return Promise.resolve(a)}moveFiles(t,o){let a=[];for(let n of t){let i=Pe.find(l=>l.id===n);i&&(i.folderId=o,i.updatedAt=new Date,a.push(i))}return Promise.resolve(a)}moveFolders(t,o){let a=[];for(let n of t){let i=Ne.find(l=>l.id===n);i&&(i.parentId=o,i.updatedAt=new Date,a.push(i))}return Promise.resolve(a)}};0&&(module.exports={FileManager,FileManagerModal,FileManagerProvider,MockProvider,useFileManager});
|
|
93
|
+
\u26A0\uFE0F Warning: This will also delete all ${e.fileCount} file(s) inside this folder.`)&&r(e.id);},c=k=>{k.stopPropagation(),n(e);},w=k=>{k.stopPropagation(),s(e);},F=k=>{k.stopPropagation(),a(e,void 0,true);},M=k=>{a(e,k,false);},C=k=>{a(e,void 0,true);},N=k=>{k.stopPropagation();};return jsxRuntime.jsx(bo,{menuItems:[{label:"Rename",icon:jsxRuntime.jsx(chunkS4HRPNKF_js.y,{className:"size-6"}),onClick:c},{label:"Select Folder",icon:jsxRuntime.jsx(chunkS4HRPNKF_js.x,{className:"size-6"}),onClick:F},{label:"Move to...",icon:jsxRuntime.jsx(chunkS4HRPNKF_js.m,{className:"size-5 mr-1"}),onClick:w},{label:"Delete",icon:jsxRuntime.jsx(chunkS4HRPNKF_js.r,{className:"size-5 mr-1 text-red-600"}),onClick:x,variant:"destructive"}],isInSelectionMode:u,mode:v,children:jsxRuntime.jsxs("div",{className:"group relative flex flex-col items-center justify-start transition-all duration-200 cursor-pointer w-full select-none",onDoubleClick:M,onClick:M,children:[jsxRuntime.jsxs("div",{className:`
|
|
94
|
+
relative w-full aspect-square flex items-center justify-center mb-1 overflow-hidden rounded-2xl hover:bg-accent/60
|
|
95
|
+
${t?"bg-accent/60":""}
|
|
96
|
+
`,children:[jsxRuntime.jsx("div",{className:"w-[75%] h-[75%] flex items-center justify-center transform dark:brightness-[2]",children:jsxRuntime.jsx(chunkS4HRPNKF_js.j,{className:"w-full h-full text-blue-400 fill-blue-400/20 drop-shadow-sm",strokeWidth:1.5})}),(m===chunkS4HRPNKF_js.f.MULTIPLE||l)&&jsxRuntime.jsx("div",{className:`absolute top-2 left-2 z-10 ${t?"opacity-100":"opacity-0 group-hover:opacity-100"} transition-opacity duration-200`,onClick:N,children:jsxRuntime.jsx(Yt,{checked:t,onCheckedChange:C,className:"bg-background/90 border-border shadow-sm data-[state=checked]:bg-primary data-[state=checked]:border-primary rounded-full h-5 w-5"})})]}),jsxRuntime.jsxs("div",{className:"w-full text-center px-0.5 flex flex-col items-center",children:[jsxRuntime.jsx("span",{className:`
|
|
97
|
+
text-[13px] font-semibold leading-[1.3] tracking-tight line-clamp-2 px-2.5 pb-[2px] rounded-[6px] transition-colors duration-100 wrap-break-word max-w-full
|
|
98
|
+
${t?"bg-primary text-primary-foreground antialiased shadow-sm":"text-foreground group-hover:text-foreground/80"}
|
|
99
|
+
`,children:e.name}),jsxRuntime.jsx("div",{className:`flex items-center justify-center gap-1 mt-1 transition-opacity duration-200 ${t?"opacity-60":"opacity-100"}`,children:jsxRuntime.jsxs("span",{className:"text-[11px] text-primary font-medium tracking-tight px-1.5 rounded-full",children:[e.fileCount," items"]})})]})]})})}function Co(){let{files:e,folders:t,isLoading:a,handleFileClick:o,handleFolderClick:r,bulkDelete:n,mode:s,selectionMode:m,isInSelectionMode:l,selectedFiles:v,selectedFolders:u,currentFolder:x,setSelectedFiles:c,setSelectedFolders:w,setIsRenameFolderModalOpen:F,setIsMoveFileModalOpen:M,setFileDetailsModalFile:C,setFolderToRename:N}=E(),k=(()=>{if(!x)return 18;let b=x.folderCount||0,S=x.fileCount||0,j=b+S;return j>0?j:18})();return a?jsxRuntime.jsx("div",{className:"p-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8 content-start",children:Array.from({length:k}).map((b,S)=>jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-start w-full gap-2",children:[jsxRuntime.jsx("div",{className:"w-full aspect-square bg-muted rounded-2xl animate-pulse"}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-1 w-full",children:[jsxRuntime.jsx("div",{className:"h-4 w-20 bg-muted rounded animate-pulse"}),jsxRuntime.jsx("div",{className:"h-3 w-12 bg-muted rounded animate-pulse"})]})]},S))}):jsxRuntime.jsxs("div",{className:"p-4 grid grid-cols-2 gap-x-4 gap-y-8 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8 content-start",children:[t.map(b=>jsxRuntime.jsx(Dr,{folder:b,isSelected:u.some(S=>S.id===b.id),onSelect:r,onDelete:()=>n(),onRename:S=>{N(S),F(true);},onMove:S=>{w([S]),c([]),M(true);},selectionMode:m,mode:s,isInSelectionMode:l()},b.id)),e.map(b=>jsxRuntime.jsx(kr,{file:b,isSelected:v.some(S=>S.id===b.id),onSelect:o,onDelete:()=>n(),onEdit:S=>{C(S);},onMove:S=>{c([S]),w([]),M(true);},selectionMode:m,mode:s,isInSelectionMode:l()},b.id))]})}var Fo=class extends Fi.Component{constructor(a){super(a);this.handleReset=()=>{window.location.reload();};this.state={hasError:false,error:null};}static getDerivedStateFromError(a){return {hasError:true,error:a}}componentDidCatch(a,o){console.error("FileManager Error Boundary caught an error:",a,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsx("div",{className:"flex items-center justify-center min-h-[400px] p-8 w-full h-full bg-slate-50/50 rounded-lg border border-dashed border-slate-200",children:jsxRuntime.jsxs("div",{className:"text-center max-w-md flex flex-col items-center",children:[jsxRuntime.jsx("div",{className:"bg-red-100 p-3 rounded-full mb-4",children:jsxRuntime.jsx(chunkS4HRPNKF_js.E,{className:"size-8 text-red-600"})}),jsxRuntime.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-2",children:"Something went wrong"}),jsxRuntime.jsx("p",{className:"text-sm text-slate-500 mb-6",children:"The file manager encountered an unexpected error. Refreshing the page usually resolves this issue."}),this.state.error&&jsxRuntime.jsxs("details",{className:"mb-6 text-left w-full border border-slate-200 rounded-lg overflow-hidden flex-col group",children:[jsxRuntime.jsx("summary",{className:"cursor-pointer text-xs font-mono bg-slate-100 p-2 text-slate-600 hover:bg-slate-200 transition-colors",children:"View Technical Details"}),jsxRuntime.jsx("div",{className:"p-3 bg-white dark:bg-zinc-900",children:jsxRuntime.jsx("pre",{className:"text-[10px] text-slate-600 font-mono whitespace-pre-wrap word-break-all max-h-40 overflow-auto",children:this.state.error.toString()})})]}),jsxRuntime.jsxs(y,{onClick:this.handleReset,radius:"full",className:"gap-2",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.F,{className:"size-4"}),"Reload Application"]})]})}):this.props.children}};function Pr(){let{handleSelectAllGlobal:e,handleClearSelection:t,getSelectionState:a,isCreateFolderModalOpen:o,setIsCreateFolderModalOpen:r,isUploadModalOpen:n,setIsUploadModalOpen:s,isSearchModalOpen:m,setIsSearchModalOpen:l}=E();return Fi.useEffect(()=>{let v=u=>{u.key==="k"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),l(!m)),u.key==="a"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),a()===true?t():e(true)),u.key==="f"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),r(!o)),u.key==="u"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),s(!n));};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,t,a,o,r,n,s,m,l]),null}function Mi(e){return jsxRuntime.jsx(Fo,{children:jsxRuntime.jsxs(He.Page,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},e),{children:[jsxRuntime.jsx(Pr,{}),jsxRuntime.jsxs("div",{className:"flex h-full relative pb-12 overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"flex-1 flex w-full flex-col",children:[jsxRuntime.jsx(He.Header,{children:jsxRuntime.jsxs("div",{className:"flex w-full justify-between gap-2",children:[jsxRuntime.jsx(po,{}),jsxRuntime.jsx(br,{})]})}),jsxRuntime.jsx(ir,{className:"-mb-1"}),jsxRuntime.jsx(Co,{}),jsxRuntime.jsx(He.Footer,{className:"pt-6 pb-10"})]}),jsxRuntime.jsx(He.Overlays,{})]})]}))})}function Di(o){var r=o,{open:e,onClose:t}=r,a=chunkS4HRPNKF_js.c(r,["open","onClose"]);return jsxRuntime.jsx(He.Modal,chunkS4HRPNKF_js.b(chunkS4HRPNKF_js.a({},a),{onClose:t,children:jsxRuntime.jsx(Fe,{open:e,onOpenChange:t,children:jsxRuntime.jsx(Pi,{onClose:t})})}))}function Pi({onClose:e}){let{updateSearchQuery:t}=E(),[a,o]=Fi.useState(false),[r,n]=Fi.useState(""),s=Fi.useRef(null),m=go(r,300);return Fi.useEffect(()=>{t(m);},[m,t]),Fi.useEffect(()=>{a&&s.current&&s.current.focus();},[a]),jsxRuntime.jsxs(we,{className:"p-0",variant:"fullscreen",showCloseButton:false,children:[jsxRuntime.jsxs(Le,{className:"pt-5 pb-3 m-0 border-b border-border",children:[jsxRuntime.jsx(Ne,{className:"px-6 text-base",children:jsxRuntime.jsx("div",{className:"flex w-full justify-between gap-2",children:a?jsxRuntime.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[jsxRuntime.jsx(chunkS4HRPNKF_js.l,{className:"size-5 text-gray-500 shrink-0"}),jsxRuntime.jsx(Dt,{ref:s,type:"text",placeholder:"Search files and folders...",className:"border-none shadow-none focus-visible:ring-0 h-auto p-0 text-base font-semibold",value:r,onChange:l=>n(l.target.value),onKeyDown:l=>{l.key==="Escape"&&(n(""),t(""),o(false));}}),jsxRuntime.jsx(xe,{onClick:()=>{n(""),t(""),o(false);},className:"shrink-0",label:"Cancel Search"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(po,{}),jsxRuntime.jsx(hr,{onSearchClick:()=>o(true)}),jsxRuntime.jsx(xe,{onClick:e})]})})}),jsxRuntime.jsx(Je,{className:"sr-only",children:"Browse and select files from your media library"})]}),jsxRuntime.jsxs("div",{className:"overflow-y-auto flex-1 pb-4",children:[jsxRuntime.jsx(Co,{}),jsxRuntime.jsx(He.Footer,{className:"my-4"}),jsxRuntime.jsx(He.Overlays,{})]}),jsxRuntime.jsx(Ii,{onClose:e})]})}function Ii({onClose:e}){let{selectedFiles:t,onFilesSelected:a,setSelectedFiles:o,setSelectedFolders:r,updateSearchQuery:n,handlePageChange:s}=E();return jsxRuntime.jsxs(_e,{className:"px-6 py-4 border-t border-border w-full sm:justify-between justify-center items-center flex-col sm:flex-row gap-2",children:[jsxRuntime.jsx(nr,{}),jsxRuntime.jsx(Ge,{asChild:true,children:jsxRuntime.jsx(y,{type:"button",variant:"outline",onClick:e,radius:"full",className:"w-full md:w-auto mr-0",children:"Cancel"})}),jsxRuntime.jsxs(y,{type:"button",onClick:()=>{a&&t.length>0&&(a(t),o([]),r([]),n(""),s(1),e());},disabled:t.length===0,radius:"full",className:"w-full md:w-auto",children:["Select ",t.length>0?`(${t.length})`:""]})]})}exports.FileManager=Mi;exports.FileManagerModal=Di;exports.FileManagerProvider=no;exports.useFileManager=E;
|