@jacshuo/onyx 0.1.4

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.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +497 -0
  3. package/dist/components/Accordion.d.ts +20 -0
  4. package/dist/components/Accordion.d.ts.map +1 -0
  5. package/dist/components/Alert.d.ts +25 -0
  6. package/dist/components/Alert.d.ts.map +1 -0
  7. package/dist/components/Badge.d.ts +7 -0
  8. package/dist/components/Badge.d.ts.map +1 -0
  9. package/dist/components/Button.d.ts +7 -0
  10. package/dist/components/Button.d.ts.map +1 -0
  11. package/dist/components/Card.d.ts +30 -0
  12. package/dist/components/Card.d.ts.map +1 -0
  13. package/dist/components/Chat.d.ts +29 -0
  14. package/dist/components/Chat.d.ts.map +1 -0
  15. package/dist/components/CinePlayer.d.ts +37 -0
  16. package/dist/components/CinePlayer.d.ts.map +1 -0
  17. package/dist/components/Dialog.d.ts +21 -0
  18. package/dist/components/Dialog.d.ts.map +1 -0
  19. package/dist/components/Dropdown.d.ts +57 -0
  20. package/dist/components/Dropdown.d.ts.map +1 -0
  21. package/dist/components/DropdownButton.d.ts +33 -0
  22. package/dist/components/DropdownButton.d.ts.map +1 -0
  23. package/dist/components/FileExplorer.d.ts +93 -0
  24. package/dist/components/FileExplorer.d.ts.map +1 -0
  25. package/dist/components/FilmReel.d.ts +40 -0
  26. package/dist/components/FilmReel.d.ts.map +1 -0
  27. package/dist/components/Header.d.ts +50 -0
  28. package/dist/components/Header.d.ts.map +1 -0
  29. package/dist/components/ImageCard.d.ts +23 -0
  30. package/dist/components/ImageCard.d.ts.map +1 -0
  31. package/dist/components/Input.d.ts +21 -0
  32. package/dist/components/Input.d.ts.map +1 -0
  33. package/dist/components/Label.d.ts +7 -0
  34. package/dist/components/Label.d.ts.map +1 -0
  35. package/dist/components/List.d.ts +8 -0
  36. package/dist/components/List.d.ts.map +1 -0
  37. package/dist/components/MiniPlayer.d.ts +50 -0
  38. package/dist/components/MiniPlayer.d.ts.map +1 -0
  39. package/dist/components/Panel.d.ts +9 -0
  40. package/dist/components/Panel.d.ts.map +1 -0
  41. package/dist/components/SideNav.d.ts +64 -0
  42. package/dist/components/SideNav.d.ts.map +1 -0
  43. package/dist/components/Table.d.ts +79 -0
  44. package/dist/components/Table.d.ts.map +1 -0
  45. package/dist/components/Tabs.d.ts +25 -0
  46. package/dist/components/Tabs.d.ts.map +1 -0
  47. package/dist/components/Tooltip.d.ts +14 -0
  48. package/dist/components/Tooltip.d.ts.map +1 -0
  49. package/dist/components/Tree.d.ts +31 -0
  50. package/dist/components/Tree.d.ts.map +1 -0
  51. package/dist/index.cjs +1 -0
  52. package/dist/index.d.ts +27 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +1 -0
  55. package/dist/lib/utils.d.ts +3 -0
  56. package/dist/lib/utils.d.ts.map +1 -0
  57. package/dist/styles/theme.d.ts +48 -0
  58. package/dist/styles/theme.d.ts.map +1 -0
  59. package/dist/styles.css +4086 -0
  60. package/package.json +108 -0
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{clsx as e}from"clsx";import{twMerge as t}from"tailwind-merge";import{cva as r}from"class-variance-authority";import{Fragment as n,jsx as a,jsxs as i}from"react/jsx-runtime";import{createContext as l,default as s,useCallback as o,useContext as c,useEffect as d,useId as m,useLayoutEffect as u,useMemo as p,useRef as h,useState as f,useSyncExternalStore as b}from"react";import{AlertTriangle as x,Aperture as g,ArrowDown as v,ArrowUp as y,ArrowUpDown as w,Bookmark as k,Calendar as N,Camera as C,Check as L,ChevronDown as E,ChevronLeft as M,ChevronRight as z,ChevronsLeft as S,CircleCheck as _,CircleX as j,CornerRightDown as T,Database as A,Disc3 as D,Download as P,File as I,FileArchive as $,FileCode as O,FileSpreadsheet as F,FileText as V,Folder as K,FolderUp as R,HardDrive as B,Heart as X,Image as U,Info as q,LayoutGrid as G,LayoutList as Y,ListMusic as H,ListVideo as W,MapPin as Z,Maximize as J,Maximize2 as Q,Menu as ee,Minimize as te,Minimize2 as re,Minus as ne,Music as ae,Pause as ie,Pencil as le,Play as se,Plus as oe,Repeat1 as ce,Search as de,Share2 as me,Shuffle as ue,SkipBack as pe,SkipForward as he,Terminal as fe,Theater as be,ThumbsDown as xe,Trash2 as ge,TriangleAlert as ve,Video as ye,Volume2 as we,VolumeX as ke,X as Ne,ZoomIn as Ce,ZoomOut as Le}from"lucide-react";import{createPortal as Ee}from"react-dom";import{createRoot as Me}from"react-dom/client";var ze={};function Se(...r){return t(e(r))}ze.d=(e,t)=>{for(var r in t)ze.o(t,r)&&!ze.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},ze.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const _e=r("inline-flex cursor-pointer items-center justify-center gap-1.5 rounded font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0",{variants:{intent:{primary:"bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-white hover:bg-secondary-600 active:bg-secondary-700",danger:"bg-danger-500 text-white hover:bg-danger-600 active:bg-danger-700",warning:"bg-warning-500 text-white hover:bg-warning-600 active:bg-warning-700",ghost:"bg-transparent text-primary-700 hover:bg-primary-100 active:bg-primary-200 dark:text-primary-300 dark:hover:bg-primary-800",outline:"border border-primary-300 bg-transparent text-primary-700 hover:bg-primary-50 dark:border-primary-600 dark:text-primary-300 dark:hover:bg-primary-800"},size:{sm:"h-7 px-3 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 px-4 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 px-6 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{intent:"primary",size:"md"}}),je=r("inline-flex items-center gap-1 rounded border px-2.5 py-0.5 text-xs font-semibold [&_svg]:h-3 [&_svg]:w-3 [&_svg]:shrink-0",{variants:{intent:{success:"border-green-200 bg-green-100 text-green-800 dark:border-green-800 dark:bg-green-900/30 dark:text-green-400",warning:"border-amber-200 bg-amber-100 text-amber-800 dark:border-amber-800 dark:bg-amber-900/30 dark:text-amber-400",error:"border-red-200 bg-red-100 text-red-800 dark:border-red-800 dark:bg-red-900/30 dark:text-red-400",info:"border-blue-200 bg-blue-100 text-blue-800 dark:border-blue-800 dark:bg-blue-900/30 dark:text-blue-400",primary:"border-gray-200 bg-gray-100 text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{intent:"primary"}}),Te=r("w-full rounded-md border bg-white text-gray-900 transition-colors placeholder:text-gray-400 focus:outline-none focus:ring-2 dark:bg-gray-900 dark:text-gray-100 dark:placeholder:text-gray-600",{variants:{state:{default:"border-gray-300 focus:border-blue-500 focus:ring-blue-500/20 dark:border-gray-600",error:"border-red-400 focus:border-red-500 focus:ring-red-500/20"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"}},defaultVariants:{state:"default",size:"md"}}),Ae=r("inline-flex items-center gap-1 font-medium [&_svg]:shrink-0",{variants:{size:{sm:"text-xs [&_svg]:h-3 [&_svg]:w-3",md:"text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"text-base [&_svg]:h-4 [&_svg]:w-4"},intent:{default:"text-primary-700 dark:text-primary-300",muted:"text-primary-400 dark:text-primary-500",required:"text-primary-700 dark:text-primary-300 after:ml-0.5 after:text-danger-500 after:content-['*']"}},defaultVariants:{size:"md",intent:"default"}}),De=r("rounded-lg transition-shadow",{variants:{intent:{default:"border border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",elevated:"bg-white shadow-md hover:shadow-lg dark:bg-primary-900",outlined:"border-2 border-primary-300 bg-transparent dark:border-primary-600",ghost:"bg-primary-50 dark:bg-primary-800/50"},size:{sm:"p-3",md:"p-5",lg:"p-7"}},defaultVariants:{intent:"default",size:"md"}}),Pe=r("rounded-md",{variants:{intent:{default:"border border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",inset:"bg-primary-50 dark:bg-primary-800/50",elevated:"bg-white shadow-lg dark:bg-primary-900"},size:{sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{intent:"default",size:"md"}}),Ie=r("w-full text-left text-sm",{variants:{intent:{default:"",striped:"[&_tbody_tr:nth-child(even)]:bg-primary-50 dark:[&_tbody_tr:nth-child(even)]:bg-primary-800/30",bordered:"[&_th]:border [&_td]:border [&_th]:border-primary-200 [&_td]:border-primary-200 dark:[&_th]:border-primary-700 dark:[&_td]:border-primary-700"}},defaultVariants:{intent:"default"}}),$e=r("text-sm text-primary-700 dark:text-primary-300",{variants:{intent:{default:"space-y-1",bordered:"divide-y divide-primary-200 rounded-lg border border-primary-200 dark:divide-primary-700 dark:border-primary-700 [&>li]:px-4 [&>li]:py-2",hover:"[&>li]:rounded-md [&>li]:px-3 [&>li]:py-2 [&>li]:transition-colors [&>li:hover]:bg-primary-50 dark:[&>li:hover]:bg-primary-800/50"}},defaultVariants:{intent:"default"}}),Oe=r("divide-y",{variants:{intent:{default:"divide-primary-300 dark:divide-primary-700",bordered:"divide-primary-300 rounded-lg border border-primary-300 bg-white px-3 shadow-sm dark:divide-primary-700 dark:border-primary-700 dark:bg-primary-800/50",ghost:"divide-transparent"}},defaultVariants:{intent:"default"}}),Fe=r("flex",{variants:{intent:{line:"border-b border-primary-200 dark:border-primary-700",pills:"gap-1 rounded-lg bg-primary-100 p-1 dark:bg-primary-800",underline:"gap-4"}},defaultVariants:{intent:"line"}}),Ve=r("inline-flex cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",{variants:{intent:{line:"text-primary-500 hover:text-primary-700 data-[active=true]:text-primary-900 dark:text-primary-400 dark:hover:text-primary-200 dark:data-[active=true]:text-primary-100",pills:"rounded-md text-primary-600 hover:text-primary-900 data-[active=true]:bg-white data-[active=true]:text-primary-900 data-[active=true]:shadow-sm dark:text-primary-400 dark:hover:text-primary-100 dark:data-[active=true]:bg-primary-700 dark:data-[active=true]:text-primary-100",underline:"text-primary-500 hover:text-primary-700 data-[active=true]:text-primary-900 dark:text-primary-400 dark:data-[active=true]:text-primary-100"}},defaultVariants:{intent:"line"}}),Ke=r("rounded-lg bg-white p-6 shadow-xl dark:bg-primary-900",{variants:{size:{sm:"w-full max-w-sm",md:"w-full max-w-lg",lg:"w-full max-w-2xl",xl:"w-full max-w-4xl",full:"h-[calc(100vh-4rem)] w-[calc(100vw-4rem)]"}},defaultVariants:{size:"md"}}),Re=r("absolute z-50 rounded px-2 py-1 text-xs shadow-md animate-fade-in",{variants:{intent:{default:"bg-primary-900 text-white dark:bg-primary-100 dark:text-primary-900",light:"border border-primary-200 bg-white text-primary-700 dark:border-primary-600 dark:bg-primary-800 dark:text-primary-200"}},defaultVariants:{intent:"default"}}),Be=r("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-900/80 dark:text-green-200",warning:"border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-900/80 dark:text-amber-200",error:"border-red-200 bg-red-50 text-red-800 dark:border-red-800 dark:bg-red-900/80 dark:text-red-200",info:"border-blue-200 bg-blue-50 text-blue-800 dark:border-blue-800 dark:bg-blue-900/80 dark:text-blue-200"}},defaultVariants:{intent:"info"}});function Xe({intent:e,size:t,className:r,...n}){return a("button",{className:Se(_e({intent:e,size:t}),r),...n})}function Ue(e,t){for(const r of e){if(r.value===t)return r;if(r.children){const e=Ue(r.children,t);if(e)return e}}}function qe(e){const t=[];for(const r of e)r.children?.length||t.push(r),r.children&&t.push(...qe(r.children));return t}function Ge({options:e,onSelect:t,depth:r=0}){const[n,l]=f(null),s=h(void 0),o=()=>{s.current=setTimeout(()=>l(null),150)};return d(()=>()=>{s.current&&clearTimeout(s.current)},[]),a("div",{className:Se("absolute z-50 min-w-44 rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white","animate-fade-in",0===r?"mt-1 w-full":"top-0 ml-0.5"),style:r>0?{left:"100%"}:void 0,role:"listbox",children:e.map(e=>{const c=!!e.children?.length,d=n===e.value;return i("div",{className:"relative",onMouseEnter:()=>{return t=e.value,s.current&&clearTimeout(s.current),void l(t);var t},onMouseLeave:o,children:[i("div",{role:"option","aria-selected":!1,"aria-disabled":e.disabled,className:Se("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",e.disabled&&"pointer-events-none opacity-50"),onClick:()=>{e.disabled||c||t(e.value,e)},children:[e.icon&&a("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:e.icon}),a("span",{className:"flex-1 truncate",children:e.label??e.value}),c&&a(z,{className:"text-primary-400 h-3.5 w-3.5 shrink-0"})]}),c&&d&&a(Ge,{options:e.children,onSelect:t,depth:r+1})]},e.value)})})}function Ye({options:e,filter:t,multiple:r,selected:n,canAdd:l,onSelect:s,onToggle:o,onAdd:c}){const d=p(()=>qe(e),[e]),m=t.toLowerCase(),u=t?d.filter(e=>(e.label??e.value).toLowerCase().includes(m)||e.value.toLowerCase().includes(m)):d;return i("div",{className:Se("absolute z-50 mt-1 w-full max-h-60 min-w-44 overflow-y-auto rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white","animate-fade-in"),role:"listbox","aria-multiselectable":r||void 0,children:[u.map(e=>{const t=r&&n.includes(e.value);return i("div",{role:"option","aria-selected":!!r&&t,"aria-disabled":e.disabled,className:Se("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",e.disabled&&"pointer-events-none opacity-50"),onClick:()=>{e.disabled||(r?o(e.value):s(e.value,e))},children:[r&&a("span",{className:Se("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",t?"border-blue-600 bg-blue-600 text-white dark:border-blue-500 dark:bg-blue-500":"border-gray-300 bg-white dark:border-gray-600 dark:bg-gray-800"),children:t&&a(L,{className:"h-3 w-3"})}),e.icon&&a("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:e.icon}),a("span",{className:"truncate",children:e.label??e.value})]},e.value)}),0===u.length&&!l&&a("div",{className:"text-primary-400 px-3 py-2 text-center text-sm",children:"No matches"}),l&&i("div",{className:Se("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-900/30"),onClick:c,children:[a("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-lg leading-none",children:"+"}),i("span",{className:"truncate",children:["Add “",t.trim(),"”"]})]})]})}function He(e){const{options:t,placeholder:r="Select…",editable:n=!1,onAddItem:l,disabled:s=!1,align:c="left",className:m}=e,u=!0===e.multiple,b=u?e.selected??[]:[],[x,g]=f(!1),[v,y]=f(""),w=h(null),k=h(null),N=u?void 0:e.value,C=p(()=>N?Ue(t,N):void 0,[t,N]);d(()=>{if(!x)return;const e=e=>{w.current&&!w.current.contains(e.target)&&(g(!1),y(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]),d(()=>{if(!x)return;const e=e=>{"Escape"===e.key&&(g(!1),y(""))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[x]);const L=o((t,r)=>{u||e.onChange?.(t,r),g(!1),y("")},[u,e]),M=o(t=>{if(!u)return;const r=b.includes(t)?b.filter(e=>e!==t):[...b,t];e.onSelectionChange?.(r)},[u,b,e]),z=v.toLowerCase(),S=p(()=>!(!n||!v.trim())&&!qe(t).some(e=>e.value.toLowerCase()===z||(e.label??e.value).toLowerCase()===z),[n,z,t]),_=o(()=>{const e=v.trim();e&&(l?.(e),y(""))},[v,l]),j=o(e=>{"Enter"===e.key&&S&&(e.preventDefault(),_())},[S,_]),T=o(()=>{s||(g(e=>{const t=!e;return t&&n&&requestAnimationFrame(()=>k.current?.focus()),t}),y(""))},[s,n]);let A;if(u){const e=b.length;A=0===e?"":e<=2?b.map(e=>Ue(t,e)).map(e=>e?e.label??e.value:"").filter(Boolean).join(", "):`${e} selected`}else A=C?C.label??C.value:"";const D=u||n;return i("div",{ref:w,className:Se("relative inline-block min-w-44",m),children:[i("div",{className:Se(Te({state:"default",size:"md"}),"flex cursor-pointer items-center gap-1",s&&"pointer-events-none opacity-50"),onClick:T,role:"combobox","aria-expanded":x,"aria-haspopup":"listbox",children:[n?a("input",{ref:k,className:"min-w-0 flex-1 bg-transparent outline-none placeholder:text-gray-400 dark:placeholder:text-gray-600",value:x?v:A,placeholder:r,disabled:s,onChange:e=>{y(e.target.value),x||g(!0)},onKeyDown:j,onClick:e=>{e.stopPropagation(),x||g(!0)}}):a("span",{className:Se("flex-1 truncate",!A&&"text-gray-400 dark:text-gray-600"),children:A||r}),C?.icon&&!n&&!u&&a("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:C.icon}),u&&b.length>0&&a("span",{className:"rounded-full bg-blue-100 px-1.5 text-xs font-semibold text-blue-700 dark:bg-blue-900 dark:text-blue-300",children:b.length}),a(E,{className:Se("text-primary-400 h-4 w-4 shrink-0 transition-transform",x&&"rotate-180")})]}),x&&a("div",{className:Se("right"===c?"right-0":"left-0","absolute w-full"),children:D?a(Ye,{options:t,filter:v,multiple:u,selected:b,canAdd:S,onSelect:L,onToggle:M,onAdd:_}):a(Ge,{options:t,onSelect:L})})]})}function We({label:e,items:t,intent:r,size:l,align:c="left",className:m,disabled:u,editable:b=!1,onAddItem:x,multiple:g=!1,selected:v=[],onSelectionChange:y,...w}){const[k,N]=f(!1),[C,M]=f(""),z=h(null),S=h(null),_=o(()=>{u||N(e=>{const t=!e;return t&&b&&requestAnimationFrame(()=>S.current?.focus()),t||M(""),t})},[u,b]);d(()=>{if(!k)return;const e=e=>{z.current&&!z.current.contains(e.target)&&(N(!1),M(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[k]),d(()=>{if(!k)return;const e=e=>{"Escape"===e.key&&(N(!1),M(""))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[k]);const j=C.toLowerCase(),T=p(()=>C?t.filter(e=>("string"==typeof e.label?e.label:e.key??"").toLowerCase().includes(j)):t,[t,j]),A=p(()=>!(!b||!C.trim()||t.some(e=>("string"==typeof e.label?e.label:e.key??"").toLowerCase()===j)),[b,j,t]),D=o(()=>{const e=C.trim();e&&(x?.(e),M(""))},[C,x]),P=o(e=>{"Enter"===e.key&&A&&(e.preventDefault(),D())},[A,D]),I=o(e=>{const t=v.includes(e)?v.filter(t=>t!==e):[...v,e];y?.(t)},[v,y]),$=g&&v.length>0?i(n,{children:[e," ",a("span",{className:"ml-1 rounded-full bg-white/20 px-1.5 text-xs font-semibold",children:v.length})]}):e;return i("div",{ref:z,className:"relative inline-block",children:[i("button",{type:"button",onClick:_,disabled:u,className:Se(_e({intent:r,size:l}),"inline-flex items-center gap-1",m),"aria-haspopup":g?"listbox":"true","aria-expanded":k?"true":"false",...w,children:[$,a(E,{className:Se("h-3.5 w-3.5 transition-transform",k&&"rotate-180")})]}),k&&i("div",{className:Se("absolute z-50 mt-1 min-w-44 rounded-md border py-1 shadow-lg","border-primary-200 dark:border-primary-700 dark:bg-primary-800 bg-white","animate-fade-in","right"===c?"right-0":"left-0"),role:g?"listbox":"menu","aria-multiselectable":g||void 0,children:[b&&a("div",{className:"border-primary-200 dark:border-primary-700 border-b px-2 pb-1.5 pt-1",children:a("input",{ref:S,type:"text",value:C,onChange:e=>M(e.target.value),onKeyDown:P,placeholder:"Type to filter or add…",className:"w-full bg-transparent text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none dark:text-gray-100 dark:placeholder:text-gray-600"})}),i("div",{className:"max-h-60 overflow-y-auto",children:[T.map((e,t)=>{const r=function(e,t){return e.key??("string"==typeof e.label?e.label:String(t))}(e,t),n=g&&v.includes(r);return i(s.Fragment,{children:[e.divider&&a("div",{className:"border-primary-200 dark:border-primary-700 my-1 border-t"}),i("button",{type:"button",role:g?"option":"menuitem","aria-selected":g?n:void 0,disabled:e.disabled,className:Se("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-primary-700 hover:bg-primary-100 dark:text-primary-300 dark:hover:bg-primary-700/50",e.disabled&&"pointer-events-none opacity-50"),onClick:()=>{g?I(r):(e.onClick?.(),N(!1),M(""))},children:[g&&a("span",{className:Se("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",n?"border-blue-600 bg-blue-600 text-white dark:border-blue-500 dark:bg-blue-500":"border-gray-300 bg-white dark:border-gray-600 dark:bg-gray-800"),children:n&&a(L,{className:"h-3 w-3"})}),a("span",{className:"flex-1 truncate",children:e.label})]})]},r)}),0===T.length&&!A&&a("div",{className:"text-primary-400 px-3 py-2 text-center text-sm",children:"No matches"}),A&&i("button",{type:"button",className:Se("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-left text-sm transition-colors","text-blue-600 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-900/30"),onClick:D,children:[a("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-lg leading-none",children:"+"}),i("span",{className:"truncate",children:["Add “",C.trim(),"”"]})]})]})]})]})}function Ze({intent:e,className:t,...r}){return a("span",{className:Se(je({intent:e}),t),...r})}function Je({intent:e,size:t,className:r,...n}){return a("label",{className:Se(Ae({intent:e,size:t}),r),...n})}const Qe={sm:{wrapper:"h-7 text-xs",prefix:"px-2 text-xs [&_svg]:h-3 [&_svg]:w-3",input:"px-2 text-xs",icon:"px-1.5 [&_svg]:h-3 [&_svg]:w-3"},md:{wrapper:"h-9 text-sm",prefix:"px-3 text-sm [&_svg]:h-4 [&_svg]:w-4",input:"px-3 py-2 text-sm",icon:"px-2 [&_svg]:h-4 [&_svg]:w-4"},lg:{wrapper:"h-11 text-base",prefix:"px-4 text-base [&_svg]:h-5 [&_svg]:w-5",input:"px-4 py-2.5 text-base",icon:"px-2.5 [&_svg]:h-5 [&_svg]:w-5"}},et={default:"border-gray-300 focus-within:border-blue-500 focus-within:ring-2 focus-within:ring-blue-500/20 dark:border-gray-600",error:"border-red-400 focus-within:border-red-500 focus-within:ring-2 focus-within:ring-red-500/20"};function tt({state:e="default",inputSize:t="md",className:r,prefix:n,suffix:l,action:s,...o}){if(!n&&!l&&!s)return a("input",{className:Se(Te({state:e,size:t}),r),...o});const c=Qe[t??"md"],d=et[e??"default"];return i("div",{className:Se("flex w-full items-center overflow-hidden rounded-md border bg-white transition-colors dark:bg-gray-900",c.wrapper,d,r),children:[n&&a("span",{className:Se("flex shrink-0 items-center gap-1.5 self-stretch border-r border-gray-300 bg-gray-50 font-medium text-gray-600 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300",c.prefix),children:n}),a("input",{className:Se("min-w-0 flex-1 bg-transparent text-gray-900 placeholder:text-gray-400 focus:outline-none dark:text-gray-100 dark:placeholder:text-gray-600",c.input,n&&"pl-2"),...o}),l&&a("span",{className:Se("pointer-events-none flex shrink-0 items-center text-gray-400 dark:text-gray-500",c.icon),children:l}),s&&a("button",{type:"button",onClick:s.onClick,"aria-label":s["aria-label"]??"Action",className:Se("flex shrink-0 items-center text-gray-500 transition-colors hover:text-blue-600 dark:text-gray-400 dark:hover:text-blue-400",c.icon),children:s.icon})]})}function rt({intent:e,size:t,className:r,...n}){return a("div",{className:Se(De({intent:e,size:t}),r),...n})}function nt({className:e,...t}){return a("div",{className:Se("mb-4 space-y-1",e),...t})}function at({className:e,...t}){return a("h3",{className:Se("text-primary-900 dark:text-primary-100 text-lg font-semibold",e),...t})}function it({className:e,...t}){return a("p",{className:Se("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function lt({className:e,...t}){return a("div",{className:Se("text-primary-700 dark:text-primary-300 text-sm",e),...t})}function st({className:e,...t}){return a("div",{className:Se("border-primary-100 dark:border-primary-800 mt-4 flex items-center gap-2 border-t pt-4",e),...t})}function ot({intent:e,media:t,mediaPosition:r="left",className:n,children:l,...s}){const o=a("div",{className:Se("relative shrink-0 overflow-hidden","left"===r?"rounded-l-lg":"rounded-r-lg"),style:{width:t.width??"10rem"},children:t.src?a("img",{src:t.src,alt:t.alt??"",className:"h-full w-full object-cover",draggable:!1}):t.icon?a("div",{className:"bg-primary-100 text-primary-500 dark:bg-primary-800 dark:text-primary-400 flex h-full w-full items-center justify-center",children:t.icon}):null});return i("div",{className:Se(De({intent:e}),"flex overflow-hidden p-0","right"===r&&"flex-row-reverse",n),...s,children:[o,a("div",{className:"flex min-w-0 flex-1 flex-col p-4",children:l})]})}function ct({src:e,alt:t="",aspectRatio:r="16/9",className:n,children:l,...s}){return i("div",{className:Se("group overflow-hidden rounded-xl border transition-shadow duration-300","border-primary-200 dark:border-primary-700 dark:bg-primary-900 bg-white","dark:hover:shadow-primary-900/60 hover:shadow-lg",n),...s,children:[i("div",{className:"relative overflow-hidden",style:{aspectRatio:r},children:[a("img",{src:e,alt:t,className:"h-full w-full object-cover transition-transform duration-500 ease-out group-hover:scale-110",draggable:!1}),a("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100","aria-hidden":!0,children:a("div",{className:"animate-light-sweep absolute inset-0"})})]}),l]})}function dt({className:e,...t}){return a("div",{className:Se("space-y-2 p-4",e),...t})}function mt({className:e,...t}){return a("h3",{className:Se("text-primary-900 dark:text-primary-100 text-base font-semibold",e),...t})}function ut({className:e,...t}){return a("p",{className:Se("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function pt({className:e,...t}){return a("div",{className:Se("border-primary-100 dark:border-primary-800 flex items-center gap-2 border-t px-4 py-3",e),...t})}function ht({intent:e,size:t,className:r,...n}){return a("div",{className:Se(Pe({intent:e,size:t}),r),...n})}function ft({className:e,...t}){return a("div",{className:Se("border-primary-200 text-primary-900 dark:border-primary-700 dark:text-primary-100 mb-3 flex items-center gap-1.5 border-b pb-3 text-sm font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",e),...t})}function bt({className:e,...t}){return a("div",{className:Se("text-primary-700 dark:text-primary-300 text-sm",e),...t})}function xt({intent:e,className:t,...r}){return a("div",{className:"w-full overflow-auto",children:a("table",{className:Se(Ie({intent:e}),t),...r})})}function gt({className:e,...t}){return a("thead",{className:Se("bg-primary-50 text-primary-600 dark:bg-primary-800/50 dark:text-primary-400",e),...t})}function vt({className:e,...t}){return a("tbody",{className:Se("[&_tr:last-child]:border-0",e),...t})}function yt({className:e,...t}){return a("tr",{className:Se("border-primary-200 hover:bg-primary-50/50 dark:border-primary-700 dark:hover:bg-primary-800/30 border-b transition-colors",e),...t})}function wt({className:e,...t}){return a("th",{className:Se("px-4 py-3 text-left text-xs font-semibold tracking-wider uppercase",e),...t})}function kt({className:e,...t}){return a("td",{className:Se("text-primary-700 dark:text-primary-300 px-4 py-3",e),...t})}function Nt({columns:e,data:t,sort:r,onSortChange:n,defaultSort:l=null,rowKey:s,intent:c,className:d}){const[m,u]=f(l),h=r??m,b=o(e=>{const t=h?.column===e?"asc"===h.direction?{column:e,direction:"desc"}:null:{column:e,direction:"asc"};n?n(t):u(t)},[h,n]),x=p(()=>{if(!h)return t;const r=e.find(e=>e.key===h.column);if(!r)return t;const n=r.compareFn??((e,t)=>{const n=r.cell(e),a=r.cell(t);return null==n&&null==a?0:null==n?-1:null==a?1:"number"==typeof n&&"number"==typeof a?n-a:String(n).localeCompare(String(a))}),a=[...t].sort(n);return"desc"===h.direction?a.reverse():a},[t,h,e]);return i(xt,{intent:c,className:d,children:[a(gt,{children:a(yt,{children:e.map(e=>{const t=!1!==e.sortable,r=h?.column===e.key;return a(wt,{className:Se(t&&"cursor-pointer select-none",e.headerClassName),onClick:t?()=>b(e.key):void 0,"aria-sort":r?"asc"===h.direction?"ascending":"descending":void 0,children:i("span",{className:"inline-flex items-center gap-1",children:[e.header,t&&a(Et,{active:r,direction:r?h.direction:null})]})},e.key)})})}),a(vt,{children:x.map((t,r)=>a(yt,{children:e.map(e=>a(kt,{className:e.cellClassName,children:e.cell(t)},e.key))},s?s(t,r):r))})]})}function Ct({value:e,onCommit:t,onCancel:r}){const[n,l]=f(e),s=h(null);d(()=>{s.current?.focus(),s.current?.select()},[]);const o=()=>t(n);return i("span",{className:"flex items-center gap-1",children:[a("input",{ref:s,type:"text",value:n,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&o(),"Escape"===e.key&&r()},"aria-label":"Edit cell",className:"min-w-0 flex-1 rounded border border-blue-400 bg-white px-1.5 py-0.5 text-sm outline-none focus:ring-1 focus:ring-blue-400 dark:border-blue-600 dark:bg-gray-800"}),a("button",{type:"button",onClick:o,className:"text-green-600 hover:text-green-700 dark:text-green-400","aria-label":"Confirm",children:a(L,{className:"h-3.5 w-3.5"})}),a("button",{type:"button",onClick:r,className:"text-red-500 hover:text-red-600 dark:text-red-400","aria-label":"Cancel",children:a(Ne,{className:"h-3.5 w-3.5"})})]})}function Lt({columns:e,data:t,rowKey:r,sort:n,onSortChange:l,defaultSort:s=null,selectionMode:c="none",selected:d,onSelectionChange:m,editable:u=!1,onCellEdit:h,toolbar:b=!1,onAdd:x,onDelete:g,intent:v,className:y}){const[w,k]=f(s),N=n??w,C=o(e=>{const t=N?.column===e?"asc"===N.direction?{column:e,direction:"desc"}:null:{column:e,direction:"asc"};l?l(t):k(t)},[N,l]),L=p(()=>{if(!N)return t;const r=e.find(e=>e.key===N.column);if(!r)return t;const n=r.compareFn??((e,t)=>{const n=r.cell(e),a=r.cell(t);return null==n&&null==a?0:null==n?-1:null==a?1:"number"==typeof n&&"number"==typeof a?n-a:String(n).localeCompare(String(a))}),a=[...t].sort(n);return"desc"===N.direction?a.reverse():a},[t,N,e]),[E,M]=f([]),z=d??E,S=m??M,_=p(()=>L.map((e,t)=>r(e,t)),[L,r]),j="multiple"===c&&_.length>0&&_.every(e=>z.includes(e)),T="multiple"===c&&z.length>0&&!j,A=o(e=>{"single"===c?S(z.includes(e)?[]:[e]):"multiple"===c&&S(z.includes(e)?z.filter(t=>t!==e):[...z,e])},[c,z,S]),D=o(()=>{S(j?[]:_)},[j,_,S]),[P,I]=f(null),$=o((e,t,r)=>{u&&!1!==r&&I({rowKey:e,colKey:t})},[u]),O=o((e,t,r)=>{h?.(e,t,r),I(null)},[h]);return i("div",{className:"space-y-2",children:[b&&i("div",{className:"flex items-center gap-2",children:[x&&i("button",{type:"button",onClick:x,className:"inline-flex items-center gap-1.5 rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700",children:[a(oe,{className:"h-3.5 w-3.5"})," Add"]}),g&&i("button",{type:"button",onClick:()=>g(z),disabled:0===z.length,className:"inline-flex items-center gap-1.5 rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-red-600 transition-colors hover:bg-red-50 disabled:opacity-40 disabled:pointer-events-none dark:border-gray-600 dark:bg-gray-800 dark:text-red-400 dark:hover:bg-red-900/20",children:[a(ge,{className:"h-3.5 w-3.5"})," Delete",z.length>0&&` (${z.length})`]}),u&&1===z.length&&i("button",{type:"button",onClick:()=>{const t=e.find(e=>!1!==e.editable);t&&I({rowKey:z[0],colKey:t.key})},className:"inline-flex items-center gap-1.5 rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700",children:[a(le,{className:"h-3.5 w-3.5"})," Edit"]}),z.length>0&&i("span",{className:"ml-auto text-sm text-gray-500 dark:text-gray-400",children:[z.length," row",z.length>1?"s":""," selected"]})]}),i(xt,{intent:v,className:y,children:[a(gt,{children:i(yt,{children:["multiple"===c&&a(wt,{className:"w-10",children:a("input",{type:"checkbox",checked:j,ref:e=>{e&&(e.indeterminate=T)},onChange:D,className:"h-4 w-4 cursor-pointer rounded border-gray-300 accent-blue-600","aria-label":"Select all"})}),"single"===c&&a(wt,{className:"w-10"}),e.map(e=>{const t=!1!==e.sortable,r=N?.column===e.key;return a(wt,{className:Se(t&&"cursor-pointer select-none",e.headerClassName),onClick:t?()=>C(e.key):void 0,"aria-sort":r?"asc"===N.direction?"ascending":"descending":void 0,children:i("span",{className:"inline-flex items-center gap-1",children:[e.header,t&&a(Et,{active:r,direction:r?N.direction:null})]})},e.key)})]})}),a(vt,{children:L.map((t,n)=>{const l=r(t,n),s=z.includes(l);return i(yt,{className:Se(s&&"bg-blue-50/60 dark:bg-blue-900/20"),onClick:()=>{"none"!==c&&A(l)},children:["multiple"===c&&a(kt,{className:"w-10",children:a("input",{type:"checkbox",checked:s,onChange:()=>A(l),onClick:e=>e.stopPropagation(),className:"h-4 w-4 cursor-pointer rounded border-gray-300 accent-blue-600","aria-label":"Select row"})}),"single"===c&&a(kt,{className:"w-10",children:a("input",{type:"radio",checked:s,onChange:()=>A(l),onClick:e=>e.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-blue-600","aria-label":"Select row"})}),e.map(e=>{const r=P?.rowKey===l&&P?.colKey===e.key,n=e.editValue?.(t)??(()=>{const r=e.cell(t);return"string"==typeof r||"number"==typeof r?String(r):""})();return a(kt,{className:Se(e.cellClassName,u&&!1!==e.editable&&"cursor-text"),onDoubleClick:t=>{t.stopPropagation(),$(l,e.key,e.editable)},children:r?a(Ct,{value:n,onCommit:t=>O(l,e.key,t),onCancel:()=>I(null)}):e.cell(t)},e.key)})]},l)})})]})]})}function Et({active:e,direction:t}){const r="h-3.5 w-3.5 shrink-0";return e&&t?a("asc"===t?y:v,{className:Se(r,"opacity-70")}):a(w,{className:Se(r,"opacity-30")})}function Mt({intent:e,className:t,...r}){return a("ul",{className:Se($e({intent:e}),t),...r})}function zt({className:e,...t}){return a("li",{className:Se("flex items-center gap-1.5 [&_svg]:h-3.5 [&_svg]:w-3.5 [&_svg]:shrink-0",e),...t})}const St=l({showLines:!0,expandedKeys:null,onToggleKey:()=>{}});function _t({showLines:e=!0,showRoot:t=!0,expandedKeys:r,defaultExpandedKeys:n="all",onExpandedKeysChange:i,className:l,children:s,...c}){const[d,m]=f(()=>n),u=o(e=>{if(r){const t=new Set(r);t.has(e)?t.delete(e):t.add(e),i?.(t)}else m(t=>{if("all"===t)return new Set(["__ALL_MINUS__",e]);const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[r,i]),p=r??("all"===d?null:d);return a(St.Provider,{value:{showLines:e,expandedKeys:p,onToggleKey:u},children:a("ul",t?{className:Se("text-sm",l),role:"tree",...c,children:s}:{className:Se("text-sm",l),role:"tree",...c,children:a(jt,{children:s})})})}function jt({children:e}){const t=Tt(e);return a(n,{children:t.map(e=>s.isValidElement(e)&&e.props.children?e.props.children:null)})}function Tt(e){const t=[];return s.Children.forEach(e,e=>{s.isValidElement(e)&&e.type===s.Fragment?t.push(...Tt(e.props.children)):t.push(e)}),t}function At({nodeKey:e,label:t,icon:r,defaultExpanded:n=!1,expanded:l,onToggle:o,children:d,className:m}){const{showLines:u,expandedKeys:p,onToggleKey:h}=c(St),[b,x]=f(n),g=s.Children.count(d)>0,v=e??("string"==typeof t?t:"");let y;return y=null!=l?l:null!=p&&v?p.has("__ALL_MINUS__")?!p.has(v):p.has(v):b,i("li",{className:Se("select-none",m),role:"treeitem","aria-expanded":g?y:void 0,children:[i("div",{className:Se("hover:bg-primary-50 dark:hover:bg-primary-800/50 flex items-center gap-1 rounded-md px-1 py-1",g?"cursor-pointer":"cursor-default"),onClick:g?()=>{const e=!y;o?o(e):null!=p&&v?h(v):x(e)}:void 0,children:[g?a(z,{className:Se("text-primary-400 h-4 w-4 shrink-0 transition-transform duration-200",y&&"rotate-90")}):a("span",{className:"w-4 shrink-0"}),r&&a("span",{className:"shrink-0",children:r}),a("span",{className:"text-primary-700 dark:text-primary-300 truncate",children:t})]}),g&&a("div",{className:Se("grid transition-[grid-template-rows] duration-200 ease-out",y?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:a("div",{className:"overflow-hidden",children:a("ul",{className:Se("ml-4 pl-2",u&&"border-primary-200 dark:border-primary-700 border-l"),role:"group",children:d})})})]})}function Dt({avatar:e,sender:t}){return e?"string"==typeof e?/^(?:https?|data|blob):/.test(e)?a("img",{src:e,alt:t,className:"h-8 w-8 shrink-0 rounded-full object-cover",draggable:!1}):a("div",{className:"bg-primary-200 text-primary-600 dark:bg-primary-700 dark:text-primary-300 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-lg select-none",children:e}):a("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full",children:e}):a("div",{className:"bg-primary-200 text-primary-600 dark:bg-primary-700 dark:text-primary-300 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-semibold select-none",children:t.charAt(0).toUpperCase()})}function Pt({msg:e,alignRight:t}){return i("div",{className:Se("flex gap-2.5",t?"flex-row-reverse":"flex-row"),children:[a(Dt,{avatar:e.avatar,sender:e.sender}),i("div",{className:Se("flex max-w-[75%] flex-col gap-0.5",t?"items-end":"items-start"),children:[a("span",{className:"text-primary-500 dark:text-primary-400 text-xs",children:e.sender}),a("div",{className:Se("rounded-xl px-3 py-2 text-sm leading-relaxed",t?"rounded-tr-sm bg-blue-500 text-white dark:bg-blue-600":"bg-primary-100 text-primary-800 dark:bg-primary-800 dark:text-primary-200 rounded-tl-sm"),children:e.content}),e.time&&a("span",{className:"text-primary-400 dark:text-primary-500 text-[10px]",children:e.time})]})]})}function It({messages:e,mode:t="split",autoScroll:r=!0,className:n,...l}){const s=h(null);return d(()=>{r&&s.current?.scrollIntoView({behavior:"smooth"})},[e,r]),i("div",{className:Se("flex flex-col gap-4 overflow-y-auto rounded-lg border p-4","border-primary-200 dark:border-primary-700 dark:bg-primary-900 bg-white",n),...l,children:[e.map(e=>{const r="split"===t&&!!e.self;return a(Pt,{msg:e,alignRight:r},e.id)}),a("div",{ref:s})]})}const $t="flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors cursor-pointer",Ot="bg-primary-200 dark:bg-primary-700/50 text-primary-900 dark:text-primary-100 font-medium",Ft="text-primary-600 dark:text-primary-400 hover:bg-primary-100 dark:hover:bg-primary-800/50 hover:text-primary-900 dark:hover:text-primary-200",Vt="flex items-center justify-center rounded-md p-2 transition-colors cursor-pointer text-primary-600 dark:text-primary-400 hover:bg-primary-100 dark:hover:bg-primary-800/50 hover:text-primary-900 dark:hover:text-primary-200";function Kt({to:e,className:t,style:r,children:n}){const i="function"==typeof t?t({isActive:!1}):t;return a("a",{href:e,className:i,style:r,children:n})}const Rt=["expanded","icons","mini"];function Bt(e){const t=new Set;for(const r of e)if(r.children&&r.children.length>0){t.add(r.key??r.label);for(const e of Bt(r.children))t.add(e)}return t}function Xt({item:e,basePath:t,depth:r,onItemClick:n,LinkComponent:l,showLines:s,expandedKeys:c,onToggle:d}){const m=e.key??e.label,u=e.children&&e.children.length>0,[p,h]=f(e.defaultOpen??!0),b=c?c.has(m):p,x=o(()=>{c?d(m):h(e=>!e)},[c,d,m]),g=r>0?1.25*r+"rem":void 0;if(u)return i("div",{children:[i("button",{type:"button",onClick:x,className:Se($t,Ft,"justify-between"),style:{paddingLeft:g},children:[i("span",{className:"flex items-center gap-2",children:[e.icon,e.label]}),a(z,{className:Se("h-3.5 w-3.5 transition-transform",b&&"rotate-90")})]}),b&&a("div",{className:Se("flex flex-col gap-0.5 pt-0.5",s?"ml-2.5 border-l border-primary-200 dark:border-primary-700":"ml-2"),children:e.children.map(e=>a(Xt,{item:e,basePath:t,depth:r+1,onItemClick:n,LinkComponent:l,showLines:s,expandedKeys:c,onToggle:d},e.key??e.path??e.label))})]});if(null!=e.path){const r=t+e.path;return n?i("button",{type:"button",onClick:()=>n(e,r),className:Se($t,Ft),style:{paddingLeft:g},children:[e.icon,e.label]}):i(l,{to:r,className:({isActive:e})=>Se($t,e?Ot:Ft),style:{paddingLeft:g},children:[e.icon,e.label]})}return i("span",{className:Se($t,Ft,"cursor-default"),style:{paddingLeft:g},children:[e.icon,e.label]})}function Ut({item:e,basePath:t,onItemClick:r,LinkComponent:n}){const[l,s]=f(!1),o=h(null),c=h(void 0),[d,m]=f({top:0,left:0}),p=()=>{clearTimeout(c.current),s(!0)},b=()=>{c.current=setTimeout(()=>s(!1),200)};u(()=>{if(l&&o.current){const e=o.current.getBoundingClientRect();m({top:e.top,left:e.right+4})}},[l]);const x=e.icon||a("span",{className:"text-xs font-bold leading-none",children:e.label.charAt(0).toUpperCase()});return i("div",{onMouseEnter:p,onMouseLeave:b,children:[a("button",{ref:o,type:"button",className:Se(Vt,"w-full"),title:e.label,onClick:()=>s(e=>!e),children:x}),l&&Ee(i("div",{className:"fixed z-50 min-w-44 rounded-md border border-primary-200 bg-white p-1 shadow-lg dark:border-primary-700 dark:bg-primary-900",style:{top:d.top,left:d.left},onMouseEnter:p,onMouseLeave:b,children:[a("div",{className:"px-2.5 py-1.5 text-xs font-semibold uppercase text-primary-500 dark:text-primary-400",children:e.label}),a("div",{className:"flex flex-col gap-0.5",children:e.children?.map(e=>{const a=e.key??e.path??e.label;if(null!=e.path){const l=t+e.path;return r?i("button",{type:"button",onClick:()=>{r(e,l),s(!1)},className:Se($t,Ft),children:[e.icon,e.label]},a):i(n,{to:l,className:({isActive:e})=>Se($t,e?Ot:Ft),children:[e.icon,e.label]},a)}return i("span",{className:Se($t,"cursor-default text-primary-400"),children:[e.icon,e.label]},a)})})]}),document.body)]})}function qt({item:e,basePath:t,onItemClick:r,LinkComponent:n}){const i=e.icon||a("span",{className:"text-xs font-bold leading-none",children:e.label.charAt(0).toUpperCase()});if(null!=e.path){const l=t+e.path;return r?a("button",{type:"button",onClick:()=>r(e,l),className:Se(Vt,"w-full"),title:e.label,children:i}):a(n,{to:l,className:({isActive:e})=>Se(Vt,"w-full",e&&"bg-primary-200 dark:bg-primary-700/50 text-primary-900 dark:text-primary-100"),children:a("span",{title:e.label,children:i})})}return a("span",{className:Se(Vt,"w-full cursor-default"),title:e.label,children:i})}function Gt({items:e,title:t,basePath:r="/",onItemClick:l,LinkComponent:c=Kt,collapsible:d,collapseMode:m,defaultCollapseMode:u="expanded",onCollapseModeChange:p,showLines:h=!0,expandedKeys:b,defaultExpandedKeys:x="all",onExpandedKeysChange:g,className:v,...y}){const[w,k]=f(u),N=m??w,C=s.useMemo(()=>Bt(e),[e]),[L,E]=f(()=>"all"===x?new Set(C):new Set(x)),M=b??null,z=M??L,_=o(e=>{const t=new Set(z);t.has(e)?t.delete(e):t.add(e),E(t),g?.(t)},[z,g]),j=o(()=>{const e=function(e){const t=Rt.indexOf(e);return Rt[(t+1)%Rt.length]}(N);k(e),p?.(e)},[N,p]);return i("nav",{className:Se("flex flex-col gap-0.5","mini"===N&&"items-center",v),...y,children:[d&&a("div",{className:Se("flex shrink-0 mb-1","expanded"===N?"justify-end":"justify-center"),children:a("button",{type:"button",onClick:j,className:Vt,"aria-label":"mini"===N?"Expand sidebar":"Collapse sidebar",title:"mini"===N?"Expand sidebar":"Collapse sidebar",children:"mini"===N?a(ee,{className:"h-5 w-5"}):a(S,{className:"h-4 w-4"})})}),"expanded"===N&&i(n,{children:[t&&a("h2",{className:"text-primary-500 dark:text-primary-400 mb-3 text-sm font-semibold uppercase",children:t}),e.map(e=>a(Xt,{item:e,basePath:r,depth:0,onItemClick:l,LinkComponent:c,showLines:h,expandedKeys:M,onToggle:_},e.key??e.path??e.label))]}),"icons"===N&&e.map(e=>{const t=e.key??e.path??e.label;return e.children&&e.children.length>0?a(Ut,{item:e,basePath:r,onItemClick:l,LinkComponent:c},t):a(qt,{item:e,basePath:r,onItemClick:l,LinkComponent:c},t)})]})}function Yt({href:e,className:t,onClick:r,children:n}){return a("a",{href:e,className:t,onClick:r,children:n})}function Ht({brand:e,onBrandClick:t,navItems:r=[],actions:n=[],linkComponent:l=Yt,height:s="h-12",className:o,children:c}){return i("header",{className:Se("flex shrink-0 items-center justify-between border-b px-5","border-primary-200 bg-white dark:border-primary-700 dark:bg-primary-900",s,o),children:[i("div",{className:"flex items-center gap-6",children:[e&&a("div",{className:Se("text-lg font-bold text-primary-800 dark:text-primary-100",t&&"cursor-pointer"),onClick:t,role:t?"button":void 0,tabIndex:t?0:void 0,onKeyDown:t?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(e))}:void 0,children:e}),r.length>0&&a("nav",{className:"flex items-center gap-4 text-sm",children:r.map((e,t)=>{const r="string"==typeof e.label?e.label:t,n=e.active?"text-primary-900 font-medium dark:text-primary-100":"text-primary-500 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-200 transition-colors";return e.href?a(l,{href:e.href,className:n,onClick:e.onClick,children:e.label},r):a("button",{type:"button",className:Se(n,"cursor-pointer"),onClick:e.onClick,children:e.label},r)})})]}),c&&a("div",{className:"flex items-center",children:c}),n.length>0&&a("div",{className:"flex items-center gap-1",children:n.map((e,t)=>{const r="rounded-md p-1.5 text-primary-500 hover:bg-primary-100 hover:text-primary-700 dark:text-primary-400 dark:hover:bg-primary-800 dark:hover:text-primary-200 transition-colors [&_svg]:h-5 [&_svg]:w-5";return e.href?a("a",{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,className:r,"aria-label":e["aria-label"],onClick:e.onClick,children:e.icon},e.key??t):a("button",{type:"button",className:r,"aria-label":e["aria-label"],onClick:e.onClick,children:e.icon},e.key??t)})})]})}const Wt=l(null),Zt=l(null);function Jt({type:e="single",defaultValue:t=[],value:r,onValueChange:n,intent:i,className:l,children:s,...c}){const[d,m]=f(t),u=r??d,p=o(t=>{const r=r=>r.includes(t)?r.filter(e=>e!==t):"single"===e?[t]:[...r,t];n?n(r(u)):m(r)},[e,u,n]);return a(Wt.Provider,{value:{expandedItems:u,toggleItem:p},children:a("div",{className:Se(Oe({intent:i}),l),...c,children:s})})}function Qt({value:e,className:t,children:r,...n}){const i=c(Wt),l=i?.expandedItems.includes(e)??!1;return a(Zt.Provider,{value:{value:e,isExpanded:l},children:a("div",{className:Se("",t),...n,children:r})})}function er({className:e,children:t,...r}){const n=c(Wt),l=c(Zt);return i("button",{className:Se("text-primary-800 hover:text-primary-600 dark:text-primary-100 dark:hover:text-primary-300 flex w-full cursor-pointer items-center justify-between gap-2 py-3 text-sm font-medium transition-colors [&>svg]:shrink-0",e),onClick:()=>l&&n?.toggleItem(l.value),"aria-expanded":l?.isExpanded?"true":"false",...r,children:[a("span",{className:"flex items-center gap-1.5 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",children:t}),a(E,{className:Se("h-4 w-4 shrink-0 transition-transform duration-200",l?.isExpanded&&"rotate-180")})]})}function tr({className:e,children:t,...r}){const n=c(Zt);return a("div",{className:Se("grid transition-[grid-template-rows] duration-200 ease-out",n?.isExpanded?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:a("div",{className:"overflow-hidden",children:a("div",{className:Se("text-primary-500 dark:text-primary-400 pb-3 text-sm",e),...r,children:t})})})}const rr=l(null),nr=l(!1);function ar({defaultValue:e="",value:t,onValueChange:r,intent:n,children:i,className:l}){const[s,c]=f(e),d=t??s,m=h(new Map),u=o(e=>{r?r(e):c(e)},[r]),p=o((e,t)=>{t?m.current.set(e,t):m.current.delete(e)},[]);return a(rr.Provider,{value:{activeValue:d,setActiveValue:u,intent:n,registerTrigger:p},children:a("div",{className:l,children:i})})}function ir({className:e,...t}){const r=c(rr),n=h(null),[l,s]=f(null),m=o(()=>{if(!r||!n.current)return;const e=n.current.querySelectorAll('[role="tab"][data-active="true"]')[0];if(!e)return void s(null);const t=n.current.getBoundingClientRect(),a=e.getBoundingClientRect();s({left:a.left-t.left,width:a.width})},[r]);u(m,[r?.activeValue,m]),d(()=>{const e=new ResizeObserver(m);return n.current&&e.observe(n.current),()=>e.disconnect()},[m]);const p=r?.intent??"line",b=l&&("line"===p||"underline"===p);return i("div",{ref:n,className:Se(Fe({intent:r?.intent}),"relative",e),role:"tablist",...t,children:[t.children,b&&a("span",{className:"absolute bottom-0 h-0.5 rounded-full bg-primary-600 dark:bg-primary-400 transition-all duration-300 ease-in-out",style:{left:l.left,width:l.width},"aria-hidden":!0})]})}function lr({value:e,className:t,children:r,...n}){const i=c(rr),l=i?.activeValue===e,s=o(t=>i?.registerTrigger(e,t),[i,e]);return a("button",{ref:s,className:Se(Ve({intent:i?.intent}),t),role:"tab","data-active":l,"aria-selected":l,onClick:()=>i?.setActiveValue(e),...n,children:r})}function sr({className:e,children:t,...r}){const n=c(rr);if(!n)return null;const i=s.Children.toArray(t).filter(e=>s.isValidElement(e)),l=Math.max(0,i.findIndex(e=>e.props.value===n.activeValue));return a("div",{className:Se("overflow-hidden",e),...r,children:a(nr.Provider,{value:!0,children:a("div",{className:"flex transition-transform duration-300 ease-in-out",style:{transform:`translateX(-${100*l}%)`},children:i.map((e,t)=>a("div",{className:"w-full shrink-0","aria-hidden":t!==l,children:e},e.props.value??t))})})})}function or({value:e,className:t,children:r,...n}){const i=c(rr);return c(nr)?a("div",{className:Se("pt-4",t),role:"tabpanel",...n,children:r}):i?.activeValue!==e?null:a("div",{className:Se("pt-4",t),role:"tabpanel",...n,children:r})}const cr=[];function dr(e){return cr.length>0&&cr[cr.length-1]===e}const mr=l(null);function ur({open:e,onOpenChange:t,modal:r=!0,closeOnOutsideClick:n=!1,children:i}){const l=m();return d(()=>{if(e)return function(e){cr.push(e)}(l),()=>function(e){const t=cr.indexOf(e);-1!==t&&cr.splice(t,1)}(l)},[e,l]),d(()=>{if(!e||!r)return;const n=e=>{"Escape"===e.key&&dr(l)&&t(!1)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,r,t,l]),d(()=>{if(!e||!r)return;const t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e,r]),e?a(mr.Provider,{value:{id:l,onOpenChange:t,modal:r,closeOnOutsideClick:n},children:Ee(i,document.body)}):null}function pr({size:e,className:t,children:r,...n}){const i=c(mr);if(!i)return null;const l=200+10*function(e){const t=cr.indexOf(e);return-1!==t?t:cr.length}(i.id);return i.modal?a("div",{className:"animate-fade-in fixed inset-0 flex items-center justify-center bg-black/50 p-4",style:{zIndex:l},onClick:()=>{i.closeOnOutsideClick&&dr(i.id)&&i.onOpenChange(!1)},children:a("div",{className:Se(Ke({size:e}),"animate-scale-in",t),role:"dialog","aria-modal":"true",onClick:e=>e.stopPropagation(),...n,children:r})}):a("div",{className:Se("fixed inset-0 flex items-center justify-center p-4",i.closeOnOutsideClick?"pointer-events-auto":"pointer-events-none"),style:{zIndex:l},onClick:i.closeOnOutsideClick&&dr(i.id)?()=>i.onOpenChange(!1):void 0,children:a("div",{className:Se(Ke({size:e}),"animate-scale-in pointer-events-auto shadow-2xl",t),role:"dialog",onClick:i.closeOnOutsideClick?e=>e.stopPropagation():void 0,...n,children:r})})}function hr({className:e,...t}){return a("div",{className:Se("mb-4 space-y-1",e),...t})}function fr({className:e,...t}){return a("h2",{className:Se("text-primary-900 dark:text-primary-100 flex items-center gap-1.5 text-lg font-semibold [&_svg]:h-5 [&_svg]:w-5 [&_svg]:shrink-0",e),...t})}function br({className:e,...t}){return a("p",{className:Se("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function xr({className:e,...t}){return a("div",{className:Se("mt-6 flex justify-end gap-2",e),...t})}function gr({className:e,...t}){const r=c(mr);return a("button",{className:Se("text-primary-400 hover:text-primary-600 dark:hover:text-primary-200 absolute top-4 right-4 rounded-md p-1 transition-colors",e),onClick:()=>r?.onOpenChange(!1),"aria-label":"Close",...t,children:a(Ne,{className:"h-4 w-4"})})}const vr={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};function yr({content:e,position:t="top",intent:r,delay:n=200,children:l,className:s}){const[o,c]=f(!1),[d,m]=f();return i("span",{className:"relative inline-flex",onMouseEnter:()=>{const e=setTimeout(()=>c(!0),n);m(e)},onMouseLeave:()=>{clearTimeout(d),c(!1)},children:[l,o&&a("span",{className:Se(Re({intent:r}),vr[t],"pointer-events-none whitespace-nowrap",s),role:"tooltip",children:e})]})}function wr({intent:e,className:t,children:r,...n}){return a("div",{className:Se(Be({intent:e}),t),role:"alert",...n,children:r})}function kr({className:e,...t}){return a("h5",{className:Se("flex items-center gap-1.5 font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",e),...t})}function Nr({className:e,...t}){return a("p",{className:Se("text-sm opacity-90",e),...t})}let Cr=0,Lr=[];const Er=new Map,Mr=new Set;function zr(){return Lr}function Sr(){Mr.forEach(e=>e())}function _r(e){const t=Er.get(e);t&&(clearTimeout(t),Er.delete(e)),Lr=Lr.map(t=>t.id===e?{...t,exiting:!0}:t),Sr(),setTimeout(()=>{Lr=Lr.filter(t=>t.id!==e),Sr()},200)}function jr(e){const t="alert-"+ ++Cr;Lr=[...Lr,{...e,id:t}],Sr();const r=e.duration??5e3;if(r>0){const e=setTimeout(()=>{Er.delete(t),_r(t)},r);Er.set(t,e)}return t}let Tr=16;function Ar(e){Tr=e}const Dr={"top-right":"right-4 items-end","top-left":"left-4 items-start","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","top-center":"left-1/2 -translate-x-1/2 items-center","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},Pr={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-center":"animate-slide-in-bottom"},Ir={success:_,warning:ve,error:j,info:q};function $r({alert:e,onClose:t}){const r=e.intent??"info",n=Ir[r],l=e.position??"top-right";return i("div",{className:Se(Be({intent:r}),Pr[l],e.exiting&&"opacity-0 transition-opacity duration-200","w-80"),role:"alert",children:[a(n,{className:"mt-0.5 h-5 w-5 shrink-0"}),i("div",{className:"flex-1",children:[e.title&&a("p",{className:"font-semibold",children:e.title}),a("p",{className:Se(e.title&&"text-sm opacity-90"),children:e.message})]}),a("button",{onClick:t,"aria-label":"Close notification",className:"shrink-0 cursor-pointer opacity-50 transition-opacity hover:opacity-100",children:a(Ne,{className:"h-4 w-4"})})]})}function Or(){const e=b(e=>(Mr.add(e),()=>Mr.delete(e)),zr),t=h(Tr);if(d(()=>{t.current=Tr},[]),0===e.length)return null;const r=e.reduce((e,t)=>{const r=t.position??"top-right";return(e[r]??(e[r]=[])).push(t),e},{});return Ee(a(n,{children:Object.entries(r).map(([e,r])=>{return a("div",{style:(n=e,n.startsWith("top")?{top:`${t.current}px`}:void 0),className:Se("pointer-events-none fixed z-100 flex flex-col gap-2",Dr[e]),children:r.map(e=>a($r,{alert:e,onClose:()=>_r(e.id)},e.id))},e);var n})}),document.body)}let Fr=!1;function Vr(){return d(()=>{!function(){if(Fr)return;Fr=!0;const e=document.createElement("div");e.id="alert-toast-root",document.body.appendChild(e),Me(e).render(a(Or,{}))}()},[]),{addAlert:jr,removeAlert:_r}}const Kr="#1c1914",Rr="#130f0b",Br="#504638",Xr="#6b5d4d",Ur="url(\"data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\")",qr=[{key:"like",icon:a(X,{className:"h-5 w-5"}),activeIcon:a(X,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:!0},{key:"dislike",icon:a(xe,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:a(k,{className:"h-5 w-5"}),activeIcon:a(k,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:!0},{key:"share",icon:a(me,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:a(P,{className:"h-5 w-5"}),label:"Download"}];function Gr({photos:e,layout:t="strip",actions:r=qr,onAction:l,className:s,showGrain:c=!0,sheetTitle:d,sheetLabel:m}){const[u,p]=f(null),[h,b]=f(new Set),x=o(e=>p(e),[]),g=o(()=>p(null),[]),v=o((t,n)=>{const a=r.find(e=>e.key===t);if(a?.toggle){const e=`${n}-${t}`;b(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})}l?.(t,e[n],n)},[r,l,e]);return i(n,{children:[a("strip"===t?Hr:"sheet"===t?Wr:Zr,{photos:e,onPhotoClick:x,showGrain:c,className:s,sheetTitle:d,sheetLabel:m}),null!==u&&Ee(a(Jr,{photos:e,currentIndex:u,onIndexChange:p,onClose:g,actions:r,activeActions:h,onAction:v,showGrain:c}),document.body)]})}function Yr({count:e=30}){return a("div",{className:"flex shrink-0 items-center justify-between px-3",style:{height:22,background:Kr},children:Array.from({length:e}).map((e,t)=>a("div",{className:"rounded-xs",style:{width:12,height:8,background:"#2e261e"}},t))})}function Hr({photos:e,onPhotoClick:t,showGrain:r,className:n}){const l=h(null);return i("div",{className:Se("select-none rounded-lg overflow-hidden",n),style:{background:Rr},children:[a(Yr,{count:Math.max(30,6*e.length)}),a("div",{ref:l,className:"flex gap-1 overflow-x-auto scroll-smooth px-1 py-1",style:{background:Kr,scrollSnapType:"x mandatory"},children:e.map((e,n)=>i("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>t(n),children:[i("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:Br,width:280,height:187},children:[a("img",{src:e.src,alt:e.alt??e.title??"",className:"h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",draggable:!1}),a("div",{className:"pointer-events-none absolute inset-0 mix-blend-multiply opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"rgba(255, 175, 60, 0.06)"}}),r&&a("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-[0.06]",style:{backgroundImage:Ur,animation:"film-grain-shift 0.6s steps(5) infinite"}}),a("div",{className:"pointer-events-none absolute inset-0 opacity-30 transition-opacity duration-300 group-hover:opacity-50",style:{background:"radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%)"}})]}),i("div",{className:"mt-0.5 text-center font-mono text-[9px] tracking-widest",style:{color:Xr},children:[String(n+1).padStart(2,"0"),n%2==0?"":"A"]})]},n))}),a(Yr,{count:Math.max(30,6*e.length)})]})}function Wr({photos:e,onPhotoClick:t,showGrain:r,className:n,sheetTitle:l,sheetLabel:s}){return i("div",{className:Se("rounded-lg p-5",n),style:{background:Rr},children:[i("div",{className:"mb-4 flex items-center justify-between",children:[a("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:Xr},children:l??`JAC·Film 35mm · ${e.length} exposures`}),a("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:Xr},children:s??"Contact Sheet"})]}),a("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",children:e.map((e,n)=>i("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${50*n}ms both`},onClick:()=>t(n),children:[a("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:Xr},children:String(n+1).padStart(2,"0")}),i("div",{className:"relative overflow-hidden rounded-[1px] border transition-all duration-300 group-hover:border-amber-600/50 group-hover:shadow-[0_0_20px_rgba(217,171,89,0.15)]",style:{borderColor:Br,aspectRatio:"3/2"},children:[a("img",{src:e.src,alt:e.alt??"",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",draggable:!1}),r&&a("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:Ur}}),a("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 translate-y-full bg-linear-to-t from-black/70 to-transparent p-2 pt-6 transition-transform duration-300 group-hover:translate-y-0",children:a("span",{className:"text-xs font-medium text-white/90",children:e.title})})]})]},n))})]})}function Zr({photos:e,onPhotoClick:t,showGrain:r,className:n}){const[l,s]=f(!1),[o,c]=f(null),d=Math.min(e.length,8),m=e.slice(0,d),u=e=>{const t=1e4*Math.sin(137.508*e+1);return`rotate(${(t%12-6).toFixed(1)}deg) translate(${(t/7%8-4).toFixed(1)}px, ${(t/13%6-3).toFixed(1)}px)`},p=(e,t)=>{const r=(t-1)/2,n=(7*(e-r)).toFixed(1);return`translateX(${(110*(e-r)).toFixed(0)}px) translateY(${(10*-Math.abs(e-r)+(o===e?-18:0)).toFixed(0)}px) rotate(${n}deg)`};return i("div",{className:Se("flex flex-col items-center gap-4",n),children:[a("div",{className:"relative flex h-85 w-full items-center justify-center",onMouseEnter:()=>s(!0),onMouseLeave:()=>{s(!1),c(null)},children:m.map((e,n)=>a("div",{className:"absolute cursor-pointer rounded-lg shadow-xl transition-all duration-500",style:{transitionTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1)",transitionDelay:l?35*n+"ms":25*(d-n)+"ms",transform:l?p(n,m.length):u(n),zIndex:l?n+1:m.length-n,width:220,height:147},onClick:()=>t(n),onMouseEnter:()=>l&&c(n),onMouseLeave:()=>c(null),children:i("div",{className:"relative h-full w-full overflow-hidden rounded-lg border transition-shadow duration-300",style:{borderColor:l&&o===n?"rgba(217,171,89,0.5)":Br,boxShadow:l&&o===n?"0 25px 50px rgba(0,0,0,0.5), 0 0 30px rgba(217,171,89,0.1)":"0 10px 30px rgba(0,0,0,0.4)"},children:[a("img",{src:e.src,alt:e.alt??"",className:"h-full w-full object-cover",draggable:!1}),r&&a("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:Ur}}),a("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%)"}}),l&&o===n&&a("div",{className:"absolute inset-x-0 bottom-0 bg-linear-to-t from-black/80 to-transparent p-3 pt-8",style:{animation:"reveal-up 0.25s ease-out"},children:a("span",{className:"text-sm font-medium text-white/90",children:e.title})})]})},n))}),e.length>d&&i("span",{className:"font-mono text-xs",style:{color:Xr},children:["+ ",e.length-d," more"]}),a("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] transition-opacity duration-300",style:{color:Xr,opacity:l?0:.7},children:"Hover to explore"})]})}function Jr({photos:e,currentIndex:t,onIndexChange:r,onClose:n,actions:l,activeActions:s,onAction:c,showGrain:m}){const p=e[t],[b,x]=f(1),[v,y]=f({x:0,y:0}),[w,k]=f(!1),[L,E]=f(!1),S=h(!1),_=h({x:0,y:0}),j=h(null);u(()=>{requestAnimationFrame(()=>E(!0))},[]),d(()=>{const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[]),d(()=>{const e=e=>{switch(e.key){case"Escape":n();break;case"ArrowLeft":T(-1);break;case"ArrowRight":T(1);break;case"i":case"I":k(e=>!e)}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),d(()=>{const e=j.current;if(!e)return;const t=e=>{e.preventDefault();const t=e.deltaY<0?1.12:.89;x(e=>{const r=Math.min(8,Math.max(1,e*t));return r<=1&&y({x:0,y:0}),r})};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[]);const T=o(n=>{const a=t+n;a>=0&&a<e.length&&(r(a),x(1),y({x:0,y:0}))},[t,e.length,r]),A=o(e=>{b<=1||(S.current=!0,_.current={x:e.clientX,y:e.clientY},e.target.setPointerCapture(e.pointerId))},[b]),D=o(e=>{if(!S.current)return;const t=e.clientX-_.current.x,r=e.clientY-_.current.y;_.current={x:e.clientX,y:e.clientY},y(e=>({x:e.x+t/b,y:e.y+r/b}))},[b]),P=o(()=>{S.current=!1},[]),I=o(()=>{b>1?(x(1),y({x:0,y:0})):x(2.5)},[b]),$=p.metadata;return i("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[a("div",{className:"absolute inset-0 bg-black/95",onClick:n}),m&&a("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:Ur,animation:"film-grain-shift 0.6s steps(5) infinite"}}),i("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[i("span",{className:"font-mono text-sm text-white/50",children:[t+1," / ",e.length]}),i("div",{className:"flex items-center gap-1",children:[i("span",{className:"mr-2 font-mono text-xs text-white/40",children:[b.toFixed(1),"x"]}),a("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>x(e=>Math.min(8,1.3*e)),title:"Zoom in",children:a(Ce,{className:"h-4 w-4"})}),a("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>{x(e=>{const t=Math.max(1,.7*e);return t<=1&&y({x:0,y:0}),t})},title:"Zoom out",children:a(Le,{className:"h-4 w-4"})}),a("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:n,title:"Close",children:a(Ne,{className:"h-5 w-5"})})]})]}),i("div",{ref:j,className:"relative flex flex-1 items-center justify-center overflow-hidden",style:{cursor:b>1?"grab":"default"},onPointerDown:A,onPointerMove:D,onPointerUp:P,onDoubleClick:I,children:[a("img",{src:p.src,alt:p.alt??p.title??"",className:"max-h-full max-w-full select-none object-contain",style:{animation:"lightbox-photo-in 0.35s cubic-bezier(0.16, 1, 0.3, 1)",transform:`scale(${b}) translate(${v.x}px, ${v.y}px)`,transition:S.current?"none":"transform 0.15s ease-out"},draggable:!1},t),t>0&&a("button",{className:"absolute left-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:e=>{e.stopPropagation(),T(-1)},children:a(M,{className:"h-6 w-6"})}),t<e.length-1&&a("button",{className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:e=>{e.stopPropagation(),T(1)},children:a(z,{className:"h-6 w-6"})})]}),a("div",{className:Se("absolute inset-x-0 bottom-0 z-20 transition-all duration-400",w?"translate-y-0 opacity-100":"pointer-events-none translate-y-full opacity-0"),children:i("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[p.title&&a("h3",{className:"mb-3 text-xl font-semibold text-white",children:p.title}),p.description&&a("p",{className:"mb-4 max-w-xl border-l-2 border-amber-500/40 pl-4 text-sm leading-relaxed text-white/60 italic",style:{animation:"reveal-up 0.4s ease-out 0.1s both"},children:p.description}),$&&i("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[$.camera&&i("span",{className:"flex items-center gap-1.5",children:[a(C,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",$.camera,$.lens&&a("span",{className:"text-white/40",children:"·"}),$.lens&&$.lens]}),($.aperture||$.shutter||$.iso)&&i("span",{className:"flex items-center gap-1.5",children:[a(g,{className:"h-3.5 w-3.5 text-amber-400/80"}),[$.aperture,$.shutter,$.iso&&`ISO ${$.iso}`].filter(Boolean).join(" · ")]}),$.date&&i("span",{className:"flex items-center gap-1.5",children:[a(N,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",$.date]}),$.location&&i("span",{className:"flex items-center gap-1.5",children:[a(Z,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",$.location]})]})]})}),a("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:i("div",{className:"flex items-center gap-0.5 rounded-full bg-white/6 px-2 py-1.5 backdrop-blur-xl",children:[l.map(e=>{const r=e.toggle&&(n=e.key,s.has(`${t}-${n}`));var n;return a("button",{className:Se("rounded-full p-2.5 transition-all duration-200",r?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>c(e.key,t),title:e.label,children:r&&e.activeIcon?e.activeIcon:e.icon},e.key)}),a("div",{className:"mx-1 h-5 w-px bg-white/10"}),a("button",{className:Se("rounded-full p-2.5 transition-all duration-200",w?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>k(e=>!e),title:"Photo info (I)",children:a(q,{className:"h-5 w-5"})})]})})]})}const Qr="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">\n <rect width="200" height="200" fill="#1e1b2e"/>\n <circle cx="100" cy="100" r="60" fill="none" stroke="#6366f1" stroke-width="1.5" opacity="0.3"/>\n <circle cx="100" cy="100" r="20" fill="none" stroke="#6366f1" stroke-width="1" opacity="0.4"/>\n <text x="100" y="108" text-anchor="middle" font-family="monospace" font-size="18" fill="#6366f1" opacity="0.6">♪</text>\n </svg>');function en(e){return!isFinite(e)||e<0?"0:00":`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}const tn={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},rn={"bottom-right":"bottom-4 right-0","bottom-left":"bottom-4 left-0","top-right":"top-4 right-0","top-left":"top-4 left-0"},nn={"bottom-right":"bottom-8 right-0 w-1.5 h-16 rounded-l-full","bottom-left":"bottom-8 left-0 w-1.5 h-16 rounded-r-full","top-right":"top-8 right-0 w-1.5 h-16 rounded-l-full","top-left":"top-8 left-0 w-1.5 h-16 rounded-r-full"};function an({playlist:e,initialTrack:t=0,position:r="bottom-right",entrance:l,theme:s,docked:c=!1,visible:m,onVisibleChange:u,onTrackChange:p,onLike:b,autoPlay:x=!0,shuffle:g=!1,loop:v=!1,accent:y="#8b5cf6",className:w}){const[k,N]=f(t),[C,L]=f(!1),[E,M]=f(0),[z,S]=f(0),[_,j]=f(.8),[T,A]=f(!1),[P,I]=f(new Set),[$,O]=f(!1),[F,V]=f(m??!c),[K,R]=f(!1),[B,U]=f(!1),[q,G]=f(g),[Y,W]=f(v),Z=h(!1),J=h(null),Q=h(null),ee=h(void 0),te=m??F,re=l??((ne=r).startsWith("bottom")?"bottom":ne.startsWith("top")?"top":"right");var ne;const ae=e[k],le=c,oe="dark"===s?"dark":"light"===s?"light":"",de="text-(--mp-text)",me="text-(--mp-text-muted)",fe="text-(--accent)",be="border-(--mp-border)";d(()=>{const e=J.current;e&&(e.src=ae.src,e.load(),C&&e.play().catch(()=>{}))},[k,ae.src]),d(()=>{if(!x||Z.current)return;const e=J.current;if(!e)return;const t=()=>{Z.current=!0,L(!0),e.play().catch(()=>{})};return e.addEventListener("canplaythrough",t,{once:!0}),()=>e.removeEventListener("canplaythrough",t)},[x]),d(()=>{const e=J.current;e&&(C?e.play().catch(()=>{}):e.pause())},[C]),d(()=>{const e=J.current;e&&(e.volume=T?0:_)},[_,T]),d(()=>{const e=J.current;if(!e)return;const t=()=>M(e.currentTime),r=()=>S(e.duration),n=()=>{Y?(e.currentTime=0,e.play().catch(()=>{})):ge()};return e.addEventListener("timeupdate",t),e.addEventListener("loadedmetadata",r),e.addEventListener("ended",n),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("loadedmetadata",r),e.removeEventListener("ended",n)}},[k,e.length]);const xe=o(t=>{const r=(t%e.length+e.length)%e.length;N(r),M(0),p?.(r,e[r]),te||(V(!0),u?.(!0))},[e,te,p,u]),ge=o(()=>{if(q){let t;do{t=Math.floor(Math.random()*e.length)}while(t===k&&e.length>1);xe(t)}else xe(k+1)},[xe,k,q,e.length]),ve=o(()=>{if(q){let t;do{t=Math.floor(Math.random()*e.length)}while(t===k&&e.length>1);xe(t)}else xe(k-1)},[xe,k,q,e.length]),ye=o(()=>{const e=P.has(k);I(t=>{const r=new Set(t);return e?r.delete(k):r.add(k),r}),b?.(k,ae,!e)},[k,P,b,ae]),Ce=o(e=>{const t=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width))*z;J.current&&(J.current.currentTime=r),M(r)},[z]),Le=o(()=>{R(!0);const e=le?200:400;ee.current=setTimeout(()=>{R(!1),V(!1),u?.(!1)},e)},[le,u]);d(()=>()=>{ee.current&&clearTimeout(ee.current)},[]);const Ee=B?"fade-in 0.2s ease-out both":`mp-enter-${re} 0.45s cubic-bezier(0.16, 1, 0.3, 1) both`,Me=B?"fade-in 0.2s ease-in reverse both":`mp-exit-${re} 0.4s cubic-bezier(0.7, 0, 0.84, 0) both`,ze=z>0?E/z*100:0;return!le||te||K?te||K?i(n,{children:[a("audio",{ref:J,preload:"metadata"}),a("div",{className:Se("fixed z-100",le?rn[r]:tn[r],oe),style:{"--accent":y,...K?{animation:Me}:{animation:Ee}},onMouseEnter:()=>{le&&(ee.current&&(clearTimeout(ee.current),ee.current=void 0),K&&R(!1),U(!0))},onMouseLeave:()=>{le&&(U(!1),Le())},children:i("div",{className:Se("w-[320px] overflow-hidden rounded-2xl border shadow-2xl backdrop-blur-xl","bg-(--mp-bg)",be,le&&"rounded-none",r.endsWith("right")&&le&&"rounded-l-2xl",r.endsWith("left")&&le&&"rounded-r-2xl",w),children:[i("div",{className:"relative",children:[a("div",{className:"absolute inset-0 overflow-hidden",children:a("img",{src:ae.cover||Qr,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:!1})}),i("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[i("div",{className:"relative h-14 w-14 shrink-0",children:[i("div",{className:"h-14 w-14 overflow-hidden rounded-full border-2 border-white/10 shadow-lg",style:C?{animation:"mp-vinyl-spin 4s linear infinite"}:void 0,children:[a("img",{src:ae.cover||Qr,alt:ae.album??ae.title,className:"h-full w-full object-cover",draggable:!1}),a("div",{className:"absolute inset-0 flex items-center justify-center",children:a("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),C&&a("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),i("div",{className:"min-w-0 flex-1",children:[a("div",{className:Se("truncate text-sm font-semibold",de),children:ae.title}),ae.artist&&a("div",{className:Se("truncate text-xs",me),children:ae.artist}),ae.album&&a("div",{className:Se("mt-0.5 truncate text-[10px] tracking-wide",me,"opacity-60"),children:ae.album})]}),i("div",{className:"flex shrink-0 items-center gap-0.5",children:[a("button",{className:Se("rounded-full p-1.5 transition-all duration-200",P.has(k)?"text-rose-500 hover:text-rose-400":Se(me,"hover:text-rose-500")),onClick:ye,title:"Like",children:a(X,{className:"h-4 w-4",fill:P.has(k)?"currentColor":"none"})}),a("button",{className:Se("rounded-full p-1.5 transition-colors",me,"hover:"+de.split(" ")[0]),onClick:()=>O(e=>!e),title:"Playlist",children:a(H,{className:"h-4 w-4"})}),!le&&a("button",{className:Se("rounded-full p-1.5 transition-colors",me,"hover:"+de.split(" ")[0]),onClick:Le,title:"Dismiss",children:a(Ne,{className:"h-3.5 w-3.5"})})]})]})]}),i("div",{className:"px-4",children:[i("div",{ref:Q,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:Ce,children:[a("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${ze}%`}}),a("div",{className:"absolute top-1/2 h-3 w-3 -translate-y-1/2 rounded-full bg-(--accent) opacity-0 shadow-md transition-opacity group-hover:opacity-100",style:{left:`calc(${ze}% - 6px)`}})]}),i("div",{className:Se("mt-1 flex justify-between text-[10px] font-mono",me),children:[a("span",{children:en(E)}),a("span",{children:en(z)})]})]}),i("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[a("button",{className:Se("rounded-full p-1.5 transition-colors",q?fe:me,"hover:text-(--mp-text)"),onClick:()=>G(e=>!e),title:q?"Shuffle On":"Shuffle Off",children:a(ue,{className:"h-3.5 w-3.5"})}),a("button",{className:Se("rounded-full p-1.5 transition-colors",Y?fe:me,"hover:text-(--mp-text)"),onClick:()=>W(e=>!e),title:Y?"Loop On":"Loop Off",children:a(ce,{className:"h-3.5 w-3.5"})}),a("button",{className:Se("rounded-full p-2 transition-colors",me,"hover:text-(--mp-text)"),onClick:ve,title:"Previous",children:a(pe,{className:"h-4 w-4",fill:"currentColor"})}),a("button",{className:Se("flex h-10 w-10 items-center justify-center rounded-full transition-all duration-200","bg-(--accent) text-white shadow-lg active:scale-95"),style:{boxShadow:"0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent)"},onClick:()=>L(e=>!e),title:C?"Pause":"Play",children:C?a(ie,{className:"h-4.5 w-4.5",fill:"currentColor"}):a(se,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),a("button",{className:Se("rounded-full p-2 transition-colors",me,"hover:text-(--mp-text)"),onClick:ge,title:"Next",children:a(he,{className:"h-4 w-4",fill:"currentColor"})}),i("div",{className:"ml-2 flex items-center gap-1.5",children:[a("button",{className:Se("rounded-full p-1 transition-colors",me,"hover:text-(--mp-text)"),onClick:()=>A(e=>!e),title:T?"Unmute":"Mute",children:a(T||0===_?ke:we,{className:"h-3.5 w-3.5"})}),a("input",{type:"range",min:0,max:1,step:.01,value:T?0:_,onChange:e=>{j(Number(e.target.value)),T&&A(!1)},className:"mp-volume-slider h-1 w-14 cursor-pointer appearance-none rounded-full bg-(--mp-surface) accent-(--accent)"})]})]}),a("div",{className:Se("overflow-hidden transition-all duration-300 ease-in-out",$?"max-h-60":"max-h-0"),children:a("div",{className:Se("border-t px-2 py-2",be),children:a("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((e,t)=>{const r=t===k;return i("button",{className:Se("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-all duration-200",r?"bg-(--accent)/10 dark:bg-(--accent)/15":"hover:bg-(--mp-surface-hover)"),onClick:()=>{xe(t),L(!0)},children:[a("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:r&&C?a("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(e=>a("div",{className:"w-0.75 rounded-full bg-(--accent)",style:{height:8+4*e+"px",animation:`mp-eq-bar ${.4+.15*e}s ease-in-out infinite alternate`}},e))}):r?a(D,{className:Se("h-4 w-4",fe)}):a("span",{className:Se("text-xs font-mono",me),children:t+1})}),a("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:a("img",{src:e.cover||Qr,alt:"",className:"h-full w-full object-cover",draggable:!1})}),i("div",{className:"min-w-0 flex-1",children:[a("div",{className:Se("truncate text-xs font-medium",r?fe:de),children:e.title}),e.artist&&a("div",{className:Se("truncate text-[10px]",me),children:e.artist})]}),P.has(t)&&a(X,{className:"h-3 w-3 shrink-0 text-rose-500",fill:"currentColor"})]},t)})})})})]})})]}):a("audio",{ref:J,preload:"metadata"}):i(n,{children:[a("audio",{ref:J,preload:"metadata"}),i("div",{className:Se("fixed z-100 cursor-pointer transition-all duration-300",nn[r]),style:{"--accent":y},onMouseEnter:()=>{U(!0),V(!0),u?.(!0)},children:[a("div",{className:Se("h-full w-full rounded-full",C?"bg-(--accent)":"bg-(--mp-dock-strip)"),style:C?{animation:"mp-progress-glow 2s ease-in-out infinite",boxShadow:"0 0 12px color-mix(in srgb, var(--accent) 50%, transparent)"}:void 0}),C&&a("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]})}function ln(e){if(!isFinite(e)||e<0)return"0:00";const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${r}:${n.toString().padStart(2,"0")}`}const sn={title:(e,t)=>e.title.localeCompare(t.title),type:(e,t)=>(e.type??"").localeCompare(t.type??""),duration:(e,t)=>(e.duration??0)-(t.duration??0)};function on({playlist:e,initialTrack:t=0,autoPlay:r=!1,shuffle:n=!1,loop:l=!1,onTrackChange:c,onPlayChange:m,accent:u="#8b5cf6",className:p}){const[b,x]=f(t),[g,v]=f(!1),[y,k]=f(0),[N,C]=f(0),[L,E]=f(0),[M,S]=f(.8),[_,j]=f(!1),[T,A]=f(n),[D,P]=f(l),[I,$]=f(!1),[O,F]=f("title"),[V,K]=f(!0),[R,B]=f(!1),[X,U]=f(!1),[q,G]=f(!1),[Y,H]=f(!0),[Z,Q]=f(!1),[ee,re]=f(null),ne=h(null),ae=h(null),le=h(void 0),oe=h(!1),de=e[b],me=s.useMemo(()=>{const t=e.map((e,t)=>({media:e,originalIndex:t}));return t.sort((e,t)=>{const r=sn[O](e.media,t.media);return V?r:-r}),t},[e,O,V]);d(()=>{const e=ne.current;if(!e)return;Q(!0),e.src=de.src,de.poster&&(e.poster=de.poster),e.load();const t=()=>{Q(!1),g&&e.play().catch(()=>{})};return e.addEventListener("loadeddata",t,{once:!0}),()=>e.removeEventListener("loadeddata",t)},[b,de.src]),d(()=>{if(!r||oe.current)return;const e=ne.current;if(!e)return;const t=()=>{oe.current=!0,v(!0),e.play().catch(()=>{})};return e.addEventListener("canplaythrough",t,{once:!0}),()=>e.removeEventListener("canplaythrough",t)},[r]),d(()=>{const e=ne.current;e&&(g?e.play().catch(()=>{}):e.pause(),m?.(g))},[g]),d(()=>{const e=ne.current;e&&(e.volume=_?0:M)},[M,_]),d(()=>{const e=ne.current;if(!e)return;const t=()=>k(e.currentTime),r=()=>C(e.duration),n=()=>{e.buffered.length>0&&E(e.buffered.end(e.buffered.length-1))},a=()=>{D?(e.currentTime=0,e.play().catch(()=>{})):ge()};return e.addEventListener("timeupdate",t),e.addEventListener("loadedmetadata",r),e.addEventListener("progress",n),e.addEventListener("ended",a),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("loadedmetadata",r),e.removeEventListener("progress",n),e.removeEventListener("ended",a)}},[b,e.length,D]);const fe=o(()=>{H(!0),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{g&&H(!1)},3e3)},[g]);d(()=>{g?fe():(H(!0),le.current&&clearTimeout(le.current))},[g,fe]),d(()=>()=>{le.current&&clearTimeout(le.current)},[]);const xe=o(t=>{const r=(t%e.length+e.length)%e.length;x(r),k(0),v(!0),c?.(r,e[r])},[e,c]),ge=o(()=>{if(T){let t;do{t=Math.floor(Math.random()*e.length)}while(t===b&&e.length>1);xe(t)}else xe(b+1)},[xe,b,T,e.length]),ve=o(()=>{if(T){let t;do{t=Math.floor(Math.random()*e.length)}while(t===b&&e.length>1);xe(t)}else xe(b-1)},[xe,b,T,e.length]),ye=o(e=>{const t=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width))*N;ne.current&&(ne.current.currentTime=r),k(r)},[N]),Ce=o(e=>{const t=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));re(r*N)},[N]),Le=o(()=>{ae.current&&(document.fullscreenElement?document.exitFullscreen():ae.current.requestFullscreen())},[]);d(()=>{const e=()=>G(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]);const Ee=o(()=>{R?(U(!0),setTimeout(()=>{B(!1),U(!1)},500)):B(!0)},[R]),Me=o(()=>{$(e=>!e)},[]),ze=o(()=>{const e=["title","type","duration"],t=e.indexOf(O);V?K(!1):(K(!0),F(e[(t+1)%e.length]))},[O,V]);d(()=>{const e=e=>{if(!(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement))switch(e.key){case" ":case"k":e.preventDefault(),v(e=>!e);break;case"f":e.preventDefault(),Le();break;case"t":e.preventDefault(),Ee();break;case"ArrowLeft":e.preventDefault(),ne.current&&(ne.current.currentTime=Math.max(0,y-5));break;case"ArrowRight":e.preventDefault(),ne.current&&(ne.current.currentTime=Math.min(N,y+5));break;case"ArrowUp":e.preventDefault(),S(e=>Math.min(1,e+.05));break;case"ArrowDown":e.preventDefault(),S(e=>Math.max(0,e-.05));break;case"Escape":R&&Ee();break;case"n":e.preventDefault(),ge();break;case"p":e.preventDefault(),ve();break;case"l":e.preventDefault(),Me()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Le,Ee,Me,ge,ve,y,N,R]);const _e=N>0?y/N*100:0,je=N>0?L/N*100:0,Te="text-(--accent)",Ae=i("div",{ref:ae,className:Se("group flex overflow-hidden",q?"h-full w-full":"aspect-video w-full",!q&&"rounded-xl",!q&&g&&"shadow-2xl",!q&&!g&&"animate-[cp-glow-pulse_4s_ease-in-out_infinite] will-change-[box-shadow]",p),style:{"--accent":u,background:"var(--cp-bg)"},tabIndex:0,children:[i("div",{className:Se("relative flex-1 min-w-0 h-full overflow-hidden",Z&&"animate-[cp-track-transition_0.6s_ease-out]"),onMouseMove:fe,onMouseLeave:()=>{g&&H(!1)},children:[a("video",{ref:ne,className:"h-full w-full object-contain",poster:de.poster,playsInline:!0,preload:"metadata",onClick:()=>v(e=>!e)}),!g&&!Z&&a("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>v(!0),children:a("div",{className:"flex h-20 w-20 items-center justify-center rounded-full backdrop-blur-md transition-transform hover:scale-110 active:scale-95",style:{background:"var(--cp-surface-hover)"},children:a(se,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),Z&&a("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:i("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[a("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:de.title}),de.subtitle&&a("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:de.subtitle})]})}),a("div",{className:Se("absolute inset-x-0 top-0 z-10 bg-linear-to-b from-black/70 to-transparent px-5 pb-8 pt-4 transition-opacity duration-500",Y?"opacity-100":"pointer-events-none opacity-0"),children:i("div",{className:"flex items-center justify-between",children:[i("div",{children:[a("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:de.title}),de.subtitle&&a("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:de.subtitle})]}),de.type&&a("span",{className:"rounded-full bg-(--accent)/70 px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider backdrop-blur-sm",style:{color:"var(--cp-text-strong)"},children:de.type})]})}),i("div",{className:Se("absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/80 via-black/40 to-transparent px-4 pb-3 pt-10 transition-all duration-500",Y?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:[i("div",{className:"group/seek relative mb-3 h-1 cursor-pointer rounded-full transition-[height] duration-200 hover:h-1.5",style:{background:"var(--cp-seek-track)"},onClick:ye,onMouseMove:Ce,onMouseLeave:()=>re(null),children:[a("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${je}%`,background:"var(--cp-seek-buffer)"}}),a("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${_e}%`}}),null!==ee&&a("div",{className:"absolute -top-8 -translate-x-1/2 rounded px-2 py-0.5 text-[10px] font-mono",style:{left:ee/N*100+"%",background:"var(--cp-panel-bg)",color:"var(--cp-text-strong)"},children:ln(ee)}),a("div",{className:"absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full border-2 border-(--accent) bg-white opacity-0 shadow-lg transition-opacity group-hover/seek:opacity-100",style:{left:`calc(${_e}% - 7px)`}})]}),i("div",{className:"flex items-center gap-1",children:[a("button",{className:"cp-btn",onClick:()=>v(e=>!e),title:g?"Pause (k)":"Play (k)",children:g?a(ie,{className:"h-5 w-5",fill:"currentColor"}):a(se,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),a("button",{className:"cp-btn",onClick:ve,title:"Previous (p)",children:a(pe,{className:"h-4 w-4",fill:"currentColor"})}),a("button",{className:"cp-btn",onClick:ge,title:"Next (n)",children:a(he,{className:"h-4 w-4",fill:"currentColor"})}),i("div",{className:"group/vol ml-1 flex items-center",children:[a("button",{className:"cp-btn",onClick:()=>j(e=>!e),title:_?"Unmute":"Mute",children:a(_||0===M?ke:we,{className:"h-4 w-4"})}),a("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:a("input",{type:"range",min:0,max:1,step:.01,value:_?0:M,onChange:e=>{S(Number(e.target.value)),_&&j(!1)},className:"h-1 w-full cursor-pointer appearance-none rounded-full accent-(--accent)",style:{background:"var(--cp-seek-track)"}})})]}),i("span",{className:"ml-2 min-w-0 shrink-0 font-mono text-xs",style:{color:"var(--cp-text-muted)"},children:[ln(y)," / ",ln(N)]}),a("div",{className:"flex-1"}),a("button",{className:Se("cp-btn",T&&Te),onClick:()=>A(e=>!e),title:"Shuffle",children:a(ue,{className:"h-4 w-4"})}),a("button",{className:Se("cp-btn",D&&Te),onClick:()=>P(e=>!e),title:"Loop",children:a(ce,{className:"h-4 w-4"})}),a("button",{className:Se("cp-btn",I&&Te),onClick:Me,title:"Playlist",children:a(W,{className:"h-4 w-4"})}),a("button",{className:Se("cp-btn",R&&Te),onClick:Ee,title:"Cinema mode (t)",children:a(be,{className:"h-4 w-4"})}),a("button",{className:"cp-btn",onClick:Le,title:"Fullscreen (f)",children:a(q?te:J,{className:"h-4 w-4"})})]})]})]}),a("div",{className:Se("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",I?"w-72":"w-0"),children:i("div",{className:"flex h-full w-72 flex-col backdrop-blur-xl",style:{borderLeft:"1px solid var(--cp-border)",background:"var(--cp-panel-bg)"},children:[i("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[a("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),i("div",{className:"flex items-center gap-1",children:[i("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium transition-colors",style:{color:"var(--cp-text-muted)"},onClick:ze,title:`Sort: ${O} ${V?"↑":"↓"}`,children:[a(w,{className:"h-3 w-3"}),O,V?" ↑":" ↓"]}),a("button",{className:"cp-btn p-1!",onClick:Me,title:"Close",children:a(Ne,{className:"h-3.5 w-3.5"})})]})]}),a("div",{className:"flex-1 overflow-y-auto",children:me.map(({media:e,originalIndex:t})=>{const r=t===b;return i("button",{className:Se("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-all duration-200",r?"bg-(--accent)/20 text-(--accent)":"hover:text-(--cp-text-strong)"),style:r?void 0:{color:"var(--cp-text)"},onClick:()=>{xe(t)},children:[i("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[e.poster?a("img",{src:e.poster,alt:"",className:"h-full w-full object-cover",draggable:!1}):a("div",{className:"flex h-full w-full items-center justify-center",children:a(se,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),r&&g&&a("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:a("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(e=>a("div",{className:"w-0.5 rounded-full bg-(--accent)",style:{height:6+3*e+"px",animation:`mp-eq-bar ${.3+.12*e}s ease-in-out infinite alternate`}},e))})})]}),i("div",{className:"min-w-0 flex-1",children:[a("div",{className:"truncate text-xs font-medium",children:e.title}),i("div",{className:"flex items-center gap-2",children:[e.type&&a("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:e.type}),null!=e.duration&&a("span",{className:"font-mono text-[10px] opacity-40",children:ln(e.duration)})]})]}),r&&a(z,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},t)})})]})}),a("style",{children:"\n .cp-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 6px;\n border-radius: 9999px;\n color: var(--cp-text);\n transition: color 0.15s, background 0.15s, transform 0.15s;\n }\n .cp-btn:hover { color: var(--cp-text-strong); background: var(--cp-surface-hover); }\n .cp-btn:active { transform: scale(0.9); }\n @keyframes cp-glow-pulse {\n 0%, 100% { box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 25%, transparent), 0 25px 50px -12px rgba(0,0,0,0.25); }\n 50% { box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 55%, transparent), 0 25px 50px -12px rgba(0,0,0,0.25); }\n }\n "})]});return a("div",{className:Se(R&&"fixed inset-0 z-100 flex items-center justify-center p-8",R&&(X?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:R?e=>{e.target===e.currentTarget&&Ee()}:void 0,children:a("div",{className:Se(R&&"w-full",R&&!q&&"max-w-5xl"),children:Ae})})}function cn(e){const t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function dn(e){return null==e?"—":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(2)} GB`}function mn(e){return e?("string"==typeof e?new Date(e):e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}const un={".png":U,".jpg":U,".jpeg":U,".gif":U,".svg":U,".webp":U,".ico":U,".bmp":U,".mp3":ae,".wav":ae,".flac":ae,".ogg":ae,".aac":ae,".m4a":ae,".mp4":ye,".mkv":ye,".avi":ye,".mov":ye,".wmv":ye,".webm":ye,".ts":O,".tsx":O,".js":O,".jsx":O,".json":O,".html":O,".css":O,".scss":O,".py":O,".rs":O,".go":O,".java":O,".c":O,".cpp":O,".h":O,".sh":fe,".bat":fe,".ps1":fe,".md":V,".txt":V,".pdf":V,".doc":V,".docx":V,".rtf":V,".csv":F,".xls":F,".xlsx":F,".db":A,".sqlite":A,".sql":A,".zip":$,".tar":$,".gz":$,".rar":$,".7z":$};function pn(e){if("directory"===e.type)return K;const t=e.extension||cn(e.name);return un[t]||I}function hn(e,t,r){return Math.max(t,Math.min(r,e))}function fn({files:e,title:t="File Explorer",accent:r="#8b5cf6",defaultView:l="list",initialPosition:c,initialSize:m,dockable:u=!1,dockSide:b="right",visible:g=!0,onFileOpen:v,onSelectionChange:w,onNavigate:k,onDelete:N,onClose:C,onMinimize:L,onPathSubmit:E,defaultInputMode:M="search",actions:z,resizable:S=!0,minSize:_={width:400,height:300},className:j}){const[A,D]=f(l),[P,I]=f(new Set),[$,O]=f(null),[F,V]=f(!1),[X,U]=f(!1),[q,H]=f(""),[W,Z]=f(M),[J,ee]=f(g),[te,ae]=f(!1),ie=m??{width:720,height:520},[le,se]=f(c??{x:Math.max(0,Math.round((window.innerWidth-ie.width)/2)),y:Math.max(0,Math.round((window.innerHeight-ie.height)/2))}),[oe,ce]=f(ie),[me,ue]=f(null),pe=h(!1),he=h({x:0,y:0}),fe=h(null),be=h(!1),xe=h({x:0,y:0,w:0,h:0,px:0,py:0}),ve=void 0!==g?g:J,ye=p(()=>{const t=e.filter(e=>"directory"===e.type),r=e.filter(e=>"file"===e.type);return t.sort((e,t)=>e.name.localeCompare(t.name)),r.sort((e,t)=>e.name.localeCompare(t.name)),[...t,...r]},[e]),we=p(()=>{if("search"!==W||!q.trim())return ye;const e=q.toLowerCase();return ye.filter(t=>t.name.toLowerCase().includes(e))},[ye,q,W]),ke=null!=$?we[$]:null,Ce=o((e,t)=>{I(r=>{const n=new Set(r);return t.ctrlKey||t.metaKey?n.has(e)?n.delete(e):n.add(e):(n.clear(),n.add(e)),n}),O(e)},[]);d(()=>{if(!w)return;const e=Array.from(P).map(e=>we[e]).filter(Boolean);w(e)},[P]);const Le=o(e=>{const t=we[e];t&&("directory"===t.type?k?.(t.path):v?.(t))},[we,v,k]),Ee=o(e=>{F||e.target.closest("button")||(pe.current=!0,he.current={x:e.clientX-le.x,y:e.clientY-le.y},e.preventDefault())},[le,F]);d(()=>{const e=e=>{if(!pe.current)return;const t=window.innerWidth-100,r=window.innerHeight-40;se({x:hn(e.clientX-he.current.x,0,t),y:hn(e.clientY-he.current.y,0,r)})},t=()=>{pe.current=!1,be.current=!1,document.body.style.cursor="",document.body.style.userSelect=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const Me=o((e,t)=>{F||(t.preventDefault(),t.stopPropagation(),be.current=e,xe.current={x:t.clientX,y:t.clientY,w:oe.width,h:oe.height,px:le.x,py:le.y},document.body.style.cursor="e"===e||"w"===e?"ew-resize":"n"===e||"s"===e?"ns-resize":"nw"===e||"se"===e?"nwse-resize":"nesw-resize",document.body.style.userSelect="none")},[F,oe,le]);d(()=>{const e=e=>{if(!be.current)return;const t=be.current,r=e.clientX-xe.current.x,n=e.clientY-xe.current.y;let{w:a,h:i,px:l,py:s}=xe.current;if(t.includes("e")&&(a=Math.max(_.width,a+r)),t.includes("w")){const e=Math.max(_.width,a-r);l+=a-e,a=e}if(t.includes("s")&&(i=Math.max(_.height,i+n)),t.includes("n")){const e=Math.max(_.height,i-n);s+=i-e,i=e}ce({width:a,height:i}),se({x:l,y:s})},t=()=>{be.current=!1,document.body.style.cursor="",document.body.style.userSelect=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[_]);const ze=o(()=>{F?(me&&(se(me.pos),ce(me.size)),V(!1)):(ue({pos:le,size:oe}),V(!0))},[F,le,oe,me]),_e=o(()=>{X?U(!1):(F&&(V(!1),me&&(se(me.pos),ce(me.size))),U(!0),L?.())},[X,F,me,L]);d(()=>{if(!ve||X)return;const e=e=>{if(fe.current?.contains(document.activeElement)||document.activeElement===fe.current){if("Escape"===e.key&&(O(null),I(new Set)),e.ctrlKey&&"a"===e.key){e.preventDefault();const t=new Set(we.map((e,t)=>t));I(t)}"Delete"===e.key&&P.size>0&&N&&(e.preventDefault(),ae(!0))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ve,X,we,P,N]);const je={"--fe-accent":r};return X?a("div",{className:Se("fixed z-100 cursor-pointer transition-all duration-300","right"===b?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:je,onClick:()=>U(!1),title:`Restore ${t}`,children:i("div",{className:"fe-dock flex items-center gap-1.5 rounded-l-lg px-2 py-3 backdrop-blur-md",style:{writingMode:"vertical-rl",textOrientation:"mixed"},children:[a(B,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),a("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:t})]})}):ve?i("div",{ref:fe,className:Se("fe-window fixed z-100 flex flex-col overflow-hidden","rounded-xl border border-(--fe-border)","animate-[fe-window-in_0.35s_cubic-bezier(0.16,1,0.3,1)_both]",F&&"rounded-none",j),style:{...je,left:F?0:le.x,top:F?0:le.y,width:F?"100vw":oe.width,height:F?"100vh":oe.height,transition:F?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[i("div",{className:"fe-titlebar group/titlebar flex h-10 shrink-0 cursor-grab items-center justify-between px-3 select-none active:cursor-grabbing",onMouseDown:Ee,onDoubleClick:ze,children:[i("div",{className:"flex items-center gap-2",children:[a("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:a(B,{className:"h-3 w-3 text-(--fe-accent)"})}),a("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:t}),a("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),i("div",{className:"flex items-center gap-0.5",children:[a("button",{className:"fe-btn mr-1",onClick:()=>D(e=>"list"===e?"grid":"list"),title:"list"===A?"Grid view":"List view",children:a("list"===A?G:Y,{className:"h-3.5 w-3.5"})}),u&&a("button",{className:"fe-btn",onClick:_e,title:"Dock to edge",children:a(ne,{className:"h-3.5 w-3.5"})}),a("button",{className:"fe-btn",onClick:ze,title:F?"Restore":"Maximize",children:a(F?re:Q,{className:"h-3.5 w-3.5"})}),a("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{C?.(),ee(!1)},title:"Close",children:a(Ne,{className:"h-3.5 w-3.5"})})]})]}),i("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[a("button",{className:"fe-btn p-1",onClick:()=>k?.(".."),title:"Go up",children:a(R,{className:"h-3.5 w-3.5"})}),a("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:"navigate"===W?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>Z(e=>"search"===e?"navigate":"search"),title:"search"===W?"Switch to path navigation":"Switch to file search",children:a("search"===W?de:T,{className:"h-3 w-3"})}),a("div",{className:"relative flex-1",children:a("input",{type:"text",value:q,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key&&q.trim()&&"navigate"===W&&(E?.(q.trim())??k?.(q.trim()))},placeholder:"search"===W?"Search files…":"Enter path and press Enter…",className:"h-6 w-full rounded border border-(--fe-input-border) bg-(--fe-input-bg) px-2 text-[11px] text-(--fe-text-strong) placeholder:text-(--fe-text-muted) outline-none transition-colors focus:border-(--fe-accent)/40 focus:bg-(--fe-input-bg)"})}),i("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[we.length," item",1!==we.length?"s":"",P.size>0&&` · ${P.size} selected`]})]}),i("div",{className:"flex flex-1 min-h-0",children:[a("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:e=>{e.target===e.currentTarget&&(I(new Set),O(null))},children:0===we.length?i("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[a(K,{className:"mb-2 h-10 w-10"}),a("span",{className:"text-xs",children:"No files found"})]}):a("div","list"===A?{className:"space-y-px",children:we.map((e,t)=>{const r=pn(e),n=P.has(t),l=e.extension||cn(e.name);return i("div",{className:Se("fe-item group/item flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-(--fe-text) transition-all duration-150 cursor-pointer",n?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:n?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:e=>Ce(t,e),onDoubleClick:()=>Le(t),children:[a(r,{className:Se("h-4 w-4 shrink-0","directory"===e.type?"text-(--fe-accent)":"text-(--fe-text-muted)")}),a("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),l&&"file"===e.type&&a("span",{className:"shrink-0 rounded bg-(--fe-badge-bg) px-1.5 py-0.5 font-mono text-[9px] uppercase text-(--fe-text-muted)",children:l}),null!=e.size&&a("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:dn(e.size)}),e.modifiedAt&&a("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:mn(e.modifiedAt)})]},e.path+t)})}:{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:we.map((e,t)=>{const r=pn(e),n=P.has(t),l=e.extension||cn(e.name);return i("div",{className:Se("fe-item group/item flex cursor-pointer flex-col items-center gap-1 rounded-lg px-2 py-2.5 text-center transition-all duration-150",n?"bg-(--fe-accent)/15 text-(--fe-text-strong) ring-1 ring-(--fe-accent)/30":"text-(--fe-text) hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),onClick:e=>Ce(t,e),onDoubleClick:()=>Le(t),children:[a(r,{className:Se("h-7 w-7","directory"===e.type?"text-(--fe-accent)":"text-(--fe-text-muted)")}),a("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:e.name}),l&&"file"===e.type&&a("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:l})]},e.path+t)})})}),a("div",{className:Se("shrink-0 overflow-hidden transition-[width] duration-300 ease-out",ke?"w-56":"w-0"),children:ke&&i("div",{className:"fe-panel flex h-full w-56 flex-col border-l border-(--fe-border) p-4",children:[i("div",{className:"mb-3 flex flex-col items-center",children:[s.createElement(pn(ke),{className:Se("h-10 w-10 mb-2","directory"===ke.type?"text-(--fe-accent)":"text-(--fe-text-muted)")}),a("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:ke.name})]}),i("div",{className:"space-y-2.5 text-[10px]",children:[a(bn,{label:"Type",value:"directory"===ke.type?"Directory":ke.mimeType||ke.extension||cn(ke.name)||"File"}),null!=ke.size&&a(bn,{label:"Size",value:dn(ke.size)}),a(bn,{label:"Path",value:ke.path,mono:!0}),ke.extension&&a(bn,{label:"Extension",value:ke.extension}),ke.modifiedAt&&a(bn,{label:"Modified",value:mn(ke.modifiedAt)}),ke.createdAt&&a(bn,{label:"Created",value:mn(ke.createdAt)})]}),i("div",{className:"mt-auto flex flex-col gap-1.5",children:["file"===ke.type&&v&&i("button",{className:"flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text-strong) transition-colors",style:{background:"color-mix(in srgb, var(--fe-accent) 20%, transparent)",border:"1px solid color-mix(in srgb, var(--fe-accent) 30%, transparent)"},onClick:()=>v(ke),children:[a(y,{className:"h-3 w-3 rotate-45"}),"Open"]}),z?.map(e=>i("button",{className:"fe-action flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text) transition-colors hover:text-(--fe-text-strong)",onClick:()=>e.onClick(ke),children:[e.icon&&s.createElement(e.icon,{className:"h-3 w-3"}),e.label]},e.key))]})]})})]}),i("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[i("span",{children:[we.length," items"]}),i("div",{className:"flex items-center gap-2",children:[P.size>0&&i("span",{className:"text-(--fe-accent)/70",children:[P.size," selected"]}),a("span",{className:"opacity-50",children:"Ctrl+Click multi-select · Esc clear"})]})]}),S&&!F&&i(n,{children:[a("div",{className:"absolute top-0 left-2 right-2 h-1.5 cursor-ns-resize",onMouseDown:e=>Me("n",e)}),a("div",{className:"absolute bottom-0 left-2 right-2 h-1.5 cursor-ns-resize",onMouseDown:e=>Me("s",e)}),a("div",{className:"absolute top-2 left-0 bottom-2 w-1.5 cursor-ew-resize",onMouseDown:e=>Me("w",e)}),a("div",{className:"absolute top-2 right-0 bottom-2 w-1.5 cursor-ew-resize",onMouseDown:e=>Me("e",e)}),a("div",{className:"absolute top-0 left-0 h-3 w-3 cursor-nwse-resize",onMouseDown:e=>Me("nw",e)}),a("div",{className:"absolute top-0 right-0 h-3 w-3 cursor-nesw-resize",onMouseDown:e=>Me("ne",e)}),a("div",{className:"absolute bottom-0 left-0 h-3 w-3 cursor-nesw-resize",onMouseDown:e=>Me("sw",e)}),a("div",{className:"absolute bottom-0 right-0 h-3 w-3 cursor-nwse-resize",onMouseDown:e=>Me("se",e)})]}),a("style",{children:"\n .fe-window {\n background: var(--fe-bg);\n box-shadow: var(--fe-shadow);\n }\n .fe-titlebar {\n background: linear-gradient(90deg, color-mix(in srgb, var(--fe-accent) 6%, transparent), transparent 60%);\n border-bottom: 1px solid var(--fe-border);\n }\n .fe-toolbar {\n border-bottom: 1px solid var(--fe-border);\n background: var(--fe-surface);\n }\n .fe-panel {\n background: var(--fe-surface);\n }\n .fe-statusbar {\n border-top: 1px solid var(--fe-border);\n background: var(--fe-surface);\n }\n .fe-dock {\n background: var(--fe-dock-bg);\n border-left: 2px solid var(--fe-accent);\n box-shadow: var(--fe-dock-shadow);\n }\n .fe-action {\n background: var(--fe-surface-hover);\n border: 1px solid var(--fe-border);\n }\n .fe-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 5px;\n border-radius: 6px;\n color: var(--fe-btn-color);\n transition: color 0.15s, background 0.15s, transform 0.1s;\n }\n .fe-btn:hover {\n color: var(--fe-btn-hover);\n background: var(--fe-btn-hover-bg);\n }\n .fe-btn:active { transform: scale(0.9); }\n .fe-item {\n animation: fe-item-in 0.25s ease-out both;\n }\n @keyframes fe-window-in {\n from { opacity: 0; transform: scale(0.95) translateY(10px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n }\n @keyframes fe-item-in {\n from { opacity: 0; transform: translateX(-4px); }\n to { opacity: 1; transform: translateX(0); }\n }\n "}),a(ur,{open:te,onOpenChange:ae,children:i(pr,{size:"sm",children:[i(hr,{children:[i(fr,{children:[a(x,{className:"text-danger-500"}),"Confirm Deletion"]}),i(br,{children:[1===P.size?`Are you sure you want to delete "${we[Array.from(P)[0]]?.name}"?`:`Are you sure you want to delete ${P.size} selected items?`," ","This action cannot be undone."]})]}),i(xr,{children:[a(Xe,{intent:"ghost",onClick:()=>ae(!1),children:"Cancel"}),i(Xe,{intent:"danger",onClick:()=>{const e=Array.from(P).map(e=>we[e]).filter(Boolean);N?.(e),I(new Set),O(null),ae(!1)},children:[a(ge,{className:"h-4 w-4"}),"Delete"]})]})]})})]}):null}function bn({label:e,value:t,mono:r}){return i("div",{children:[a("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),a("div",{className:Se("text-(--fe-text) break-all leading-snug",r&&"font-mono text-[9px]"),children:t})]})}export{Jt as Accordion,tr as AccordionContent,Qt as AccordionItem,er as AccordionTrigger,wr as Alert,Nr as AlertDescription,kr as AlertTitle,Ze as Badge,Xe as Button,rt as Card,lt as CardContent,it as CardDescription,st as CardFooter,nt as CardHeader,at as CardTitle,It as Chat,on as CinePlayer,Lt as DataTable,ur as Dialog,gr as DialogClose,pr as DialogContent,br as DialogDescription,xr as DialogFooter,hr as DialogHeader,fr as DialogTitle,He as Dropdown,We as DropdownButton,fn as FileExplorer,Gr as FilmReel,Ht as Header,ot as HorizontalCard,ct as ImageCard,pt as ImageCardActions,dt as ImageCardBody,ut as ImageCardDescription,mt as ImageCardTitle,tt as Input,Je as Label,Mt as List,zt as ListItem,an as MiniPlayer,ht as Panel,bt as PanelContent,ft as PanelHeader,Gt as SideNav,Nt as SortableTable,or as TabContent,ir as TabList,sr as TabPanels,lr as TabTrigger,xt as Table,vt as TableBody,kt as TableCell,wt as TableHead,gt as TableHeader,yt as TableRow,ar as Tabs,yr as Tooltip,_t as Tree,At as TreeItem,Oe as accordionVariants,Be as alertVariants,je as badgeVariants,_e as buttonVariants,De as cardVariants,Se as cn,Ar as configureAlertTopOffset,Ke as dialogContentVariants,Te as inputVariants,Ae as labelVariants,$e as listVariants,Pe as panelVariants,Fe as tabListVariants,Ve as tabTriggerVariants,Ie as tableVariants,Re as tooltipVariants,Vr as useAlert};
@@ -0,0 +1,3 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
@@ -0,0 +1,48 @@
1
+ export declare const buttonVariants: (props?: ({
2
+ intent?: "primary" | "secondary" | "danger" | "warning" | "ghost" | "outline" | null | undefined;
3
+ size?: "sm" | "md" | "lg" | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ export declare const badgeVariants: (props?: ({
6
+ intent?: "primary" | "warning" | "success" | "error" | "info" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export declare const inputVariants: (props?: ({
9
+ state?: "error" | "default" | null | undefined;
10
+ size?: "sm" | "md" | "lg" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ export declare const labelVariants: (props?: ({
13
+ size?: "sm" | "md" | "lg" | null | undefined;
14
+ intent?: "default" | "muted" | "required" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ export declare const cardVariants: (props?: ({
17
+ intent?: "ghost" | "default" | "elevated" | "outlined" | null | undefined;
18
+ size?: "sm" | "md" | "lg" | null | undefined;
19
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
20
+ export declare const panelVariants: (props?: ({
21
+ intent?: "default" | "elevated" | "inset" | null | undefined;
22
+ size?: "sm" | "md" | "lg" | null | undefined;
23
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
24
+ export declare const tableVariants: (props?: ({
25
+ intent?: "default" | "striped" | "bordered" | null | undefined;
26
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
27
+ export declare const listVariants: (props?: ({
28
+ intent?: "default" | "bordered" | "hover" | null | undefined;
29
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
30
+ export declare const accordionVariants: (props?: ({
31
+ intent?: "ghost" | "default" | "bordered" | null | undefined;
32
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
33
+ export declare const tabListVariants: (props?: ({
34
+ intent?: "line" | "pills" | "underline" | null | undefined;
35
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
36
+ export declare const tabTriggerVariants: (props?: ({
37
+ intent?: "line" | "pills" | "underline" | null | undefined;
38
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
39
+ export declare const dialogContentVariants: (props?: ({
40
+ size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
41
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
42
+ export declare const tooltipVariants: (props?: ({
43
+ intent?: "default" | "light" | null | undefined;
44
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
45
+ export declare const alertVariants: (props?: ({
46
+ intent?: "warning" | "success" | "error" | "info" | null | undefined;
47
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
48
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/styles/theme.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;;;8EAsB1B,CAAC;AAGF,eAAO,MAAM,aAAa;;8EAkBzB,CAAC;AAGF,eAAO,MAAM,aAAa;;;8EAiBzB,CAAC;AAGF,eAAO,MAAM,aAAa;;;8EAexB,CAAC;AAGH,eAAO,MAAM,YAAY;;;8EAevB,CAAC;AAGH,eAAO,MAAM,aAAa;;;8EAcxB,CAAC;AAGH,eAAO,MAAM,aAAa;;8EAWxB,CAAC;AAGH,eAAO,MAAM,YAAY;;8EAWvB,CAAC;AAGH,eAAO,MAAM,iBAAiB;;8EAU5B,CAAC;AAGH,eAAO,MAAM,eAAe;;8EAS1B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;8EAc9B,CAAC;AAGF,eAAO,MAAM,qBAAqB;;8EAWhC,CAAC;AAGH,eAAO,MAAM,eAAe;;8EAY3B,CAAC;AAGF,eAAO,MAAM,aAAa;;8EAgBzB,CAAC"}