@jacshuo/onyx 1.4.1 → 2.0.0

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 (71) hide show
  1. package/dist/Chart/BarChart.cjs +1 -0
  2. package/dist/Chart/BarChart.css +1 -0
  3. package/dist/Chart/BarChart.d.cts +2 -0
  4. package/dist/Chart/BarChart.d.ts +2 -0
  5. package/dist/Chart/BarChart.js +1 -0
  6. package/dist/Chart/LineChart.cjs +1 -0
  7. package/dist/Chart/LineChart.css +1 -0
  8. package/dist/Chart/LineChart.d.cts +2 -0
  9. package/dist/Chart/LineChart.d.ts +2 -0
  10. package/dist/Chart/LineChart.js +1 -0
  11. package/dist/Chart/PieChart.cjs +1 -0
  12. package/dist/Chart/PieChart.css +1 -0
  13. package/dist/Chart/PieChart.d.cts +2 -0
  14. package/dist/Chart/PieChart.d.ts +2 -0
  15. package/dist/Chart/PieChart.js +1 -0
  16. package/dist/Chart/ScatterChart.cjs +1 -0
  17. package/dist/Chart/ScatterChart.css +1 -0
  18. package/dist/Chart/ScatterChart.d.cts +2 -0
  19. package/dist/Chart/ScatterChart.d.ts +2 -0
  20. package/dist/Chart/ScatterChart.js +1 -0
  21. package/dist/Chart/index.cjs +1 -0
  22. package/dist/Chart/index.css +1 -0
  23. package/dist/Chart/index.d.cts +12 -0
  24. package/dist/Chart/index.d.ts +12 -0
  25. package/dist/Chart/index.js +1 -0
  26. package/dist/DataDisplay/index.d.cts +1 -1
  27. package/dist/DataDisplay/index.d.ts +1 -1
  28. package/dist/Disclosure/index.d.cts +1 -1
  29. package/dist/Disclosure/index.d.ts +1 -1
  30. package/dist/Extras/TypewriterText.cjs +1 -0
  31. package/dist/Extras/TypewriterText.css +1 -0
  32. package/dist/Extras/TypewriterText.d.cts +2 -0
  33. package/dist/Extras/TypewriterText.d.ts +2 -0
  34. package/dist/Extras/TypewriterText.js +1 -0
  35. package/dist/Extras/index.cjs +4 -4
  36. package/dist/Extras/index.css +1 -0
  37. package/dist/Extras/index.d.cts +3 -1
  38. package/dist/Extras/index.d.ts +3 -1
  39. package/dist/Extras/index.js +4 -4
  40. package/dist/Feedback/index.d.cts +1 -1
  41. package/dist/Feedback/index.d.ts +1 -1
  42. package/dist/Forms/index.d.cts +1 -1
  43. package/dist/Forms/index.d.ts +1 -1
  44. package/dist/Layout/index.d.cts +1 -1
  45. package/dist/Layout/index.d.ts +1 -1
  46. package/dist/Navigation/index.d.cts +1 -1
  47. package/dist/Navigation/index.d.ts +1 -1
  48. package/dist/Overlay/index.d.cts +1 -1
  49. package/dist/Overlay/index.d.ts +1 -1
  50. package/dist/Primitives/index.d.cts +1 -1
  51. package/dist/Primitives/index.d.ts +1 -1
  52. package/dist/_tsup-dts-rollup.d.cts +481 -11
  53. package/dist/_tsup-dts-rollup.d.ts +481 -11
  54. package/dist/index.cjs +5 -5
  55. package/dist/index.css +1 -0
  56. package/dist/index.d.cts +20 -0
  57. package/dist/index.d.ts +20 -0
  58. package/dist/index.js +5 -5
  59. package/dist/styles/Chart/BarChart.css +44 -0
  60. package/dist/styles/Chart/LineChart.css +72 -0
  61. package/dist/styles/Chart/PieChart.css +56 -0
  62. package/dist/styles/Chart/ScatterChart.css +45 -0
  63. package/dist/styles/Extras/TypewriterText.css +55 -0
  64. package/dist/styles/base.css +140 -0
  65. package/dist/styles/tokens/core.css +10 -0
  66. package/dist/styles.css +344 -0
  67. package/dist/theme.cjs +1 -1
  68. package/dist/theme.d.cts +3 -0
  69. package/dist/theme.d.ts +3 -0
  70. package/dist/theme.js +1 -1
  71. package/package.json +1 -1
@@ -4,4 +4,4 @@ export { Tree_alias_1 as Tree } from '../_tsup-dts-rollup.cjs';
4
4
  export { Chat_alias_1 as Chat } from '../_tsup-dts-rollup.cjs';
5
5
  export { CodeBlock_alias_1 as CodeBlock } from '../_tsup-dts-rollup.cjs';
6
6
  export { DataDisplay_alias_1 as DataDisplay } from '../_tsup-dts-rollup.cjs';
7
- export { default_alias_1 as default } from '../_tsup-dts-rollup.cjs';
7
+ export { default_alias_2 as default } from '../_tsup-dts-rollup.cjs';
@@ -4,4 +4,4 @@ export { Tree_alias_1 as Tree } from '../_tsup-dts-rollup.js';
4
4
  export { Chat_alias_1 as Chat } from '../_tsup-dts-rollup.js';
5
5
  export { CodeBlock_alias_1 as CodeBlock } from '../_tsup-dts-rollup.js';
6
6
  export { DataDisplay_alias_1 as DataDisplay } from '../_tsup-dts-rollup.js';
7
- export { default_alias_1 as default } from '../_tsup-dts-rollup.js';
7
+ export { default_alias_2 as default } from '../_tsup-dts-rollup.js';
@@ -1,4 +1,4 @@
1
1
  export { Accordion_alias_1 as Accordion } from '../_tsup-dts-rollup.cjs';
2
2
  export { Tabs_alias_1 as Tabs } from '../_tsup-dts-rollup.cjs';
3
3
  export { Disclosure_alias_1 as Disclosure } from '../_tsup-dts-rollup.cjs';
4
- export { default_alias_2 as default } from '../_tsup-dts-rollup.cjs';
4
+ export { default_alias_3 as default } from '../_tsup-dts-rollup.cjs';
@@ -1,4 +1,4 @@
1
1
  export { Accordion_alias_1 as Accordion } from '../_tsup-dts-rollup.js';
2
2
  export { Tabs_alias_1 as Tabs } from '../_tsup-dts-rollup.js';
3
3
  export { Disclosure_alias_1 as Disclosure } from '../_tsup-dts-rollup.js';
4
- export { default_alias_2 as default } from '../_tsup-dts-rollup.js';
4
+ export { default_alias_3 as default } from '../_tsup-dts-rollup.js';
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime');function g(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function Y({text:e="",mode:t="typewriter",speed:k=40,cursor:D=true,cursorChar:M="\u258B",thinking:T=false,streaming:o=false,delay:v=0,onComplete:d,as:A="span",className:B}){let[b,i]=react.useState(t==="instant"?e:""),[u,n]=react.useState(false),[I,s]=react.useState(t==="instant"),[R,l]=react.useState(false),p=react.useRef(0),h=react.useRef(d);h.current=d;let f=react.useRef(e);f.current=e,react.useEffect(()=>{if(t!=="typewriter")return;if(i(""),s(false),l(false),n(false),!e){s(true);return}let c=Math.max(10,1e3/k),r=0,a,C=()=>{n(true),a=setInterval(()=>{let P=f.current;r++,i(P.slice(0,r)),r>=P.length&&(clearInterval(a),n(false),s(true),h.current?.());},c);},E;return v>0?E=setTimeout(C,v):C(),()=>{clearTimeout(E),clearInterval(a);}},[e,t]),react.useEffect(()=>{if(t!=="stream")return;if(e.length===0){p.current=0,i(""),n(false),s(false),l(false);return}if(e.length<=p.current)return;let c=Math.max(10,1e3/k),r=p.current;n(true),s(false),l(false);let a=setInterval(()=>{r++,p.current=r,i(f.current.slice(0,r)),r>=f.current.length&&(clearInterval(a),n(false),h.current?.());},c);return ()=>clearInterval(a)},[e,t]),react.useEffect(()=>{t==="instant"&&(i(e),n(false),s(true));},[e,t]);let x=react.useRef(o);react.useEffect(()=>{let c=x.current;if(x.current=o,c&&!o&&!u&&t==="stream"){l(true);let r=setTimeout(()=>{l(false),s(true);},650);return ()=>clearTimeout(r)}},[o,u,t]);let N=D&&(T||u||R||t==="stream"&&o&&!I||t==="typewriter"&&!I),V=T?"tw-cursor--blink":u?"tw-cursor--solid":R?"tw-cursor--out":"tw-cursor--blink";return jsxRuntime.jsxs(A,{className:g(B),children:[T&&!b&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:"\u200B"}),b,N&&jsxRuntime.jsx("span",{className:g("tw-cursor",V),"aria-hidden":"true",children:M})]})}exports.TypewriterText=Y;
@@ -0,0 +1 @@
1
+ @keyframes tw-blink{0%,to{opacity:1}50%{opacity:0}}@keyframes tw-cursor-out{0%{opacity:1}80%{opacity:1}to{opacity:0}}.tw-cursor{display:inline-block;line-height:1;vertical-align:baseline;user-select:none;transform:scaleY(.88);transform-origin:50% 90%;color:currentColor}.tw-cursor--blink{animation:tw-blink 1s step-end infinite}.tw-cursor--solid{opacity:1;animation:none}.tw-cursor--out{animation:tw-cursor-out .6s ease-out forwards;pointer-events:none}
@@ -0,0 +1,2 @@
1
+ export { TypewriterText_alias_3 as TypewriterText } from '../_tsup-dts-rollup.cjs';
2
+ export { TypewriterTextProps_alias_2 as TypewriterTextProps } from '../_tsup-dts-rollup.cjs';
@@ -0,0 +1,2 @@
1
+ export { TypewriterText_alias_3 as TypewriterText } from '../_tsup-dts-rollup.js';
2
+ export { TypewriterTextProps_alias_2 as TypewriterTextProps } from '../_tsup-dts-rollup.js';
@@ -0,0 +1 @@
1
+ import {useState,useRef,useEffect}from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';function g(...e){return twMerge(clsx(e))}function Y({text:e="",mode:t="typewriter",speed:k=40,cursor:D=true,cursorChar:M="\u258B",thinking:T=false,streaming:o=false,delay:v=0,onComplete:d,as:A="span",className:B}){let[b,i]=useState(t==="instant"?e:""),[u,n]=useState(false),[I,s]=useState(t==="instant"),[R,l]=useState(false),p=useRef(0),h=useRef(d);h.current=d;let f=useRef(e);f.current=e,useEffect(()=>{if(t!=="typewriter")return;if(i(""),s(false),l(false),n(false),!e){s(true);return}let c=Math.max(10,1e3/k),r=0,a,C=()=>{n(true),a=setInterval(()=>{let P=f.current;r++,i(P.slice(0,r)),r>=P.length&&(clearInterval(a),n(false),s(true),h.current?.());},c);},E;return v>0?E=setTimeout(C,v):C(),()=>{clearTimeout(E),clearInterval(a);}},[e,t]),useEffect(()=>{if(t!=="stream")return;if(e.length===0){p.current=0,i(""),n(false),s(false),l(false);return}if(e.length<=p.current)return;let c=Math.max(10,1e3/k),r=p.current;n(true),s(false),l(false);let a=setInterval(()=>{r++,p.current=r,i(f.current.slice(0,r)),r>=f.current.length&&(clearInterval(a),n(false),h.current?.());},c);return ()=>clearInterval(a)},[e,t]),useEffect(()=>{t==="instant"&&(i(e),n(false),s(true));},[e,t]);let x=useRef(o);useEffect(()=>{let c=x.current;if(x.current=o,c&&!o&&!u&&t==="stream"){l(true);let r=setTimeout(()=>{l(false),s(true);},650);return ()=>clearTimeout(r)}},[o,u,t]);let N=D&&(T||u||R||t==="stream"&&o&&!I||t==="typewriter"&&!I),V=T?"tw-cursor--blink":u?"tw-cursor--solid":R?"tw-cursor--out":"tw-cursor--blink";return jsxs(A,{className:g(B),children:[T&&!b&&jsx("span",{"aria-hidden":"true",children:"\u200B"}),b,N&&jsx("span",{className:g("tw-cursor",V),"aria-hidden":"true",children:M})]})}export{Y as TypewriterText};
@@ -1,9 +1,9 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var rn=require('react'),reactDom=require('react-dom'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime'),classVarianceAuthority=require('class-variance-authority');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var rn__default=/*#__PURE__*/_interopDefault(rn);function s(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Bt="#1c1914",Xt="#130f0b",Tn="#2e261e",xt="#504638",qe="#6b5d4d",ct=`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")`,Rn=[{key:"like",icon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:true},{key:"dislike",icon:jsxRuntime.jsx(lucideReact.ThumbsDown,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:true},{key:"share",icon:jsxRuntime.jsx(lucideReact.Share2,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:jsxRuntime.jsx(lucideReact.Download,{className:"h-5 w-5"}),label:"Download"}];function vt({photos:e,layout:o="strip",actions:l=Rn,onAction:g,className:w,showGrain:f=true,sheetTitle:v,sheetLabel:z}){let[F,x]=rn.useState(null),[_,D]=rn.useState(new Set),L=rn.useCallback(ee=>x(ee),[]),k=rn.useCallback(()=>x(null),[]),G=rn.useCallback((ee,A)=>{if(l.find($=>$.key===ee)?.toggle){let $=`${A}-${ee}`;D(K=>{let j=new Set(K);return j.has($)?j.delete($):j.add($),j});}g?.(ee,e[A],A);},[l,g,e]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(o==="strip"?zn:o==="sheet"?Fn:An,{photos:e,onPhotoClick:L,showGrain:f,className:w,sheetTitle:v,sheetLabel:z}),F!==null&&reactDom.createPortal(jsxRuntime.jsx(In,{photos:e,currentIndex:F,onIndexChange:x,onClose:k,actions:l,activeActions:_,onAction:G,showGrain:f}),document.body)]})}function jt({count:e=30}){return jsxRuntime.jsx("div",{className:"flex shrink-0 items-center justify-between px-3",style:{height:22,background:Bt},children:Array.from({length:e}).map((o,l)=>jsxRuntime.jsx("div",{className:"rounded-xs",style:{width:12,height:8,background:Tn}},l))})}function zn({photos:e,onPhotoClick:o,showGrain:l,className:g}){let w=rn.useRef(null);return jsxRuntime.jsxs("div",{className:s("select-none rounded-lg overflow-hidden",g),style:{background:Xt},children:[jsxRuntime.jsx(jt,{count:Math.max(30,e.length*6)}),jsxRuntime.jsx("div",{ref:w,className:"flex gap-1 overflow-x-auto scroll-smooth px-1 py-1",style:{background:Bt,scrollSnapType:"x mandatory"},children:e.map((f,v)=>jsxRuntime.jsxs("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>o(v),children:[jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:xt,width:280,height:187},children:[jsxRuntime.jsx("img",{src:f.src,alt:f.alt??f.title??"",className:"h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",draggable:false}),jsxRuntime.jsx("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)"}}),l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-[0.06]",style:{backgroundImage:ct,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsx("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%)"}})]}),jsxRuntime.jsxs("div",{className:"mt-0.5 text-center font-mono text-[9px] tracking-widest",style:{color:qe},children:[String(v+1).padStart(2,"0"),v%2===0?"":"A"]})]},v))}),jsxRuntime.jsx(jt,{count:Math.max(30,e.length*6)})]})}function Fn({photos:e,onPhotoClick:o,showGrain:l,className:g,sheetTitle:w,sheetLabel:f}){return jsxRuntime.jsxs("div",{className:s("rounded-lg p-5",g),style:{background:Xt},children:[jsxRuntime.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:qe},children:w??`JAC\xB7Film 35mm \xB7 ${e.length} exposures`}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:qe},children:f??"Contact Sheet"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",children:e.map((v,z)=>jsxRuntime.jsxs("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${z*50}ms both`},onClick:()=>o(z),children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:qe},children:String(z+1).padStart(2,"0")}),jsxRuntime.jsxs("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:xt,aspectRatio:"3/2"},children:[jsxRuntime.jsx("img",{src:v.src,alt:v.alt??"",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",draggable:false}),l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:ct}}),jsxRuntime.jsx("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:jsxRuntime.jsx("span",{className:"text-xs font-medium text-white/90",children:v.title})})]})]},z))})]})}function An({photos:e,onPhotoClick:o,showGrain:l,className:g}){let[w,f]=rn.useState(false),[v,z]=rn.useState(null),F=Math.min(e.length,8),x=e.slice(0,F),_=L=>{let k=Math.sin(L*137.508+1)*1e4,G=(k%12-6).toFixed(1),y=(k/7%8-4).toFixed(1),ee=(k/13%6-3).toFixed(1);return `rotate(${G}deg) translate(${y}px, ${ee}px)`},D=(L,k)=>{let G=(k-1)/2,y=((L-G)*7).toFixed(1),ee=((L-G)*110).toFixed(0),A=(-Math.abs(L-G)*10+(v===L?-18:0)).toFixed(0);return `translateX(${ee}px) translateY(${A}px) rotate(${y}deg)`};return jsxRuntime.jsxs("div",{className:s("flex flex-col items-center gap-4",g),children:[jsxRuntime.jsx("div",{className:"relative flex h-85 w-full items-center justify-center",onMouseEnter:()=>f(true),onMouseLeave:()=>{f(false),z(null);},children:x.map((L,k)=>jsxRuntime.jsx("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:w?`${k*35}ms`:`${(F-k)*25}ms`,transform:w?D(k,x.length):_(k),zIndex:w?k+1:x.length-k,width:220,height:147},onClick:()=>o(k),onMouseEnter:()=>w&&z(k),onMouseLeave:()=>z(null),children:jsxRuntime.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg border transition-shadow duration-300",style:{borderColor:w&&v===k?"rgba(217,171,89,0.5)":xt,boxShadow:w&&v===k?"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:[jsxRuntime.jsx("img",{src:L.src,alt:L.alt??"",className:"h-full w-full object-cover",draggable:false}),l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:ct}}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%)"}}),w&&v===k&&jsxRuntime.jsx("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:jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90",children:L.title})})]})},k))}),e.length>F&&jsxRuntime.jsxs("span",{className:"font-mono text-xs",style:{color:qe},children:["+ ",e.length-F," more"]}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] transition-opacity duration-300",style:{color:qe,opacity:w?0:.7},children:"Hover to explore"})]})}function In({photos:e,currentIndex:o,onIndexChange:l,onClose:g,actions:w,activeActions:f,onAction:v,showGrain:z}){let F=e[o],[x,_]=rn.useState(1),[D,L]=rn.useState({x:0,y:0}),[k,G]=rn.useState(false),[y,ee]=rn.useState(false),A=rn.useRef(false),ne=rn.useRef({x:0,y:0}),$=rn.useRef(null);rn.useLayoutEffect(()=>{requestAnimationFrame(()=>ee(true));},[]),rn.useEffect(()=>{let a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a;}},[]),rn.useEffect(()=>{let a=O=>{switch(O.key){case "Escape":g();break;case "ArrowLeft":K(-1);break;case "ArrowRight":K(1);break;case "i":case "I":G(Y=>!Y);break}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)}),rn.useEffect(()=>{let a=$.current;if(!a)return;let O=Y=>{Y.preventDefault();let ie=Y.deltaY<0?1.12:.89;_(q=>{let ge=Math.min(8,Math.max(1,q*ie));return ge<=1&&L({x:0,y:0}),ge});};return a.addEventListener("wheel",O,{passive:false}),()=>a.removeEventListener("wheel",O)},[]);let K=rn.useCallback(a=>{let O=o+a;O>=0&&O<e.length&&(l(O),_(1),L({x:0,y:0}));},[o,e.length,l]),j=rn.useCallback(a=>{x<=1||(A.current=true,ne.current={x:a.clientX,y:a.clientY},a.target.setPointerCapture(a.pointerId));},[x]),Me=rn.useCallback(a=>{if(!A.current)return;let O=a.clientX-ne.current.x,Y=a.clientY-ne.current.y;ne.current={x:a.clientX,y:a.clientY},L(ie=>({x:ie.x+O/x,y:ie.y+Y/x}));},[x]),u=rn.useCallback(()=>{A.current=false;},[]),b=rn.useCallback(()=>{x>1?(_(1),L({x:0,y:0})):_(2.5);},[x]),C=a=>f.has(`${o}-${a}`),S=F.metadata;return jsxRuntime.jsxs("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/95",onClick:g}),z&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:ct,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsxs("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[jsxRuntime.jsxs("span",{className:"font-mono text-sm text-white/50",children:[o+1," / ",e.length]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"mr-2 font-mono text-xs text-white/40",children:[x.toFixed(1),"x"]}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>_(a=>Math.min(8,a*1.3)),title:"Zoom in",children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>{_(a=>{let O=Math.max(1,a*.7);return O<=1&&L({x:0,y:0}),O});},title:"Zoom out",children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:g,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5"})})]})]}),jsxRuntime.jsxs("div",{ref:$,className:"relative flex flex-1 items-center justify-center overflow-hidden",style:{cursor:x>1?"grab":"default"},onPointerDown:j,onPointerMove:Me,onPointerUp:u,onDoubleClick:b,children:[jsxRuntime.jsx("img",{src:F.src,alt:F.alt??F.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(${x}) translate(${D.x}px, ${D.y}px)`,transition:A.current?"none":"transform 0.15s ease-out"},draggable:false},o),o>0&&jsxRuntime.jsx("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:a=>{a.stopPropagation(),K(-1);},children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-6 w-6"})}),o<e.length-1&&jsxRuntime.jsx("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:a=>{a.stopPropagation(),K(1);},children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-6 w-6"})})]}),jsxRuntime.jsx("div",{className:s("absolute inset-x-0 bottom-0 z-20 transition-all duration-400",k?"translate-y-0 opacity-100":"pointer-events-none translate-y-full opacity-0"),children:jsxRuntime.jsxs("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[F.title&&jsxRuntime.jsx("h3",{className:"mb-3 text-xl font-semibold text-white",children:F.title}),F.description&&jsxRuntime.jsx("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:F.description}),S&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[S.camera&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Camera,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",S.camera,S.lens&&jsxRuntime.jsx("span",{className:"text-white/40",children:"\xB7"}),S.lens&&S.lens]}),(S.aperture||S.shutter||S.iso)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Aperture,{className:"h-3.5 w-3.5 text-amber-400/80"}),[S.aperture,S.shutter,S.iso&&`ISO ${S.iso}`].filter(Boolean).join(" \xB7 ")]}),S.date&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",S.date]}),S.location&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",S.location]})]})]})}),jsxRuntime.jsx("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 rounded-full bg-white/6 px-2 py-1.5 backdrop-blur-xl",children:[w.map(a=>{let O=a.toggle&&C(a.key);return jsxRuntime.jsx("button",{className:s("rounded-full p-2.5 transition-all duration-200",O?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>v(a.key,o),title:a.label,children:O&&a.activeIcon?a.activeIcon:a.icon},a.key)}),jsxRuntime.jsx("div",{className:"mx-1 h-5 w-px bg-white/10"}),jsxRuntime.jsx("button",{className:s("rounded-full p-2.5 transition-all duration-200",k?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>G(a=>!a),title:"Photo info (I)",children:jsxRuntime.jsx(lucideReact.Info,{className:"h-5 w-5"})})]})})]})}var yt="data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var ln=require('react'),reactDom=require('react-dom'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime'),classVarianceAuthority=require('class-variance-authority');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ln__default=/*#__PURE__*/_interopDefault(ln);function s(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Wt="#1c1914",Gt="#130f0b",In="#2e261e",kt="#504638",qe="#6b5d4d",ct=`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")`,Hn=[{key:"like",icon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:true},{key:"dislike",icon:jsxRuntime.jsx(lucideReact.ThumbsDown,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:true},{key:"share",icon:jsxRuntime.jsx(lucideReact.Share2,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:jsxRuntime.jsx(lucideReact.Download,{className:"h-5 w-5"}),label:"Download"}];function Nt({photos:e,layout:n="strip",actions:i=Hn,onAction:g,className:k,showGrain:m=true,sheetTitle:h,sheetLabel:D}){let[S,x]=ln.useState(null),[j,T]=ln.useState(new Set),N=ln.useCallback(B=>x(B),[]),w=ln.useCallback(()=>x(null),[]),_=ln.useCallback((B,z)=>{if(i.find(A=>A.key===B)?.toggle){let A=`${z}-${B}`;T(X=>{let I=new Set(X);return I.has(A)?I.delete(A):I.add(A),I});}g?.(B,e[z],z);},[i,g,e]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(n==="strip"?On:n==="sheet"?_n:Vn,{photos:e,onPhotoClick:N,showGrain:m,className:k,sheetTitle:h,sheetLabel:D}),S!==null&&reactDom.createPortal(jsxRuntime.jsx($n,{photos:e,currentIndex:S,onIndexChange:x,onClose:w,actions:i,activeActions:j,onAction:_,showGrain:m}),document.body)]})}function Yt({count:e=30}){return jsxRuntime.jsx("div",{className:"flex shrink-0 items-center justify-between px-3",style:{height:22,background:Wt},children:Array.from({length:e}).map((n,i)=>jsxRuntime.jsx("div",{className:"rounded-xs",style:{width:12,height:8,background:In}},i))})}function On({photos:e,onPhotoClick:n,showGrain:i,className:g}){let k=ln.useRef(null);return jsxRuntime.jsxs("div",{className:s("select-none rounded-lg overflow-hidden",g),style:{background:Gt},children:[jsxRuntime.jsx(Yt,{count:Math.max(30,e.length*6)}),jsxRuntime.jsx("div",{ref:k,className:"flex gap-1 overflow-x-auto scroll-smooth px-1 py-1",style:{background:Wt,scrollSnapType:"x mandatory"},children:e.map((m,h)=>jsxRuntime.jsxs("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>n(h),children:[jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:kt,width:280,height:187},children:[jsxRuntime.jsx("img",{src:m.src,alt:m.alt??m.title??"",className:"h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",draggable:false}),jsxRuntime.jsx("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)"}}),i&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-[0.06]",style:{backgroundImage:ct,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsx("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%)"}})]}),jsxRuntime.jsxs("div",{className:"mt-0.5 text-center font-mono text-[9px] tracking-widest",style:{color:qe},children:[String(h+1).padStart(2,"0"),h%2===0?"":"A"]})]},h))}),jsxRuntime.jsx(Yt,{count:Math.max(30,e.length*6)})]})}function _n({photos:e,onPhotoClick:n,showGrain:i,className:g,sheetTitle:k,sheetLabel:m}){return jsxRuntime.jsxs("div",{className:s("rounded-lg p-5",g),style:{background:Gt},children:[jsxRuntime.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:qe},children:k??`JAC\xB7Film 35mm \xB7 ${e.length} exposures`}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:qe},children:m??"Contact Sheet"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",children:e.map((h,D)=>jsxRuntime.jsxs("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${D*50}ms both`},onClick:()=>n(D),children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:qe},children:String(D+1).padStart(2,"0")}),jsxRuntime.jsxs("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:kt,aspectRatio:"3/2"},children:[jsxRuntime.jsx("img",{src:h.src,alt:h.alt??"",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",draggable:false}),i&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:ct}}),jsxRuntime.jsx("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:jsxRuntime.jsx("span",{className:"text-xs font-medium text-white/90",children:h.title})})]})]},D))})]})}function Vn({photos:e,onPhotoClick:n,showGrain:i,className:g}){let[k,m]=ln.useState(false),[h,D]=ln.useState(null),S=Math.min(e.length,8),x=e.slice(0,S),j=N=>{let w=Math.sin(N*137.508+1)*1e4,_=(w%12-6).toFixed(1),y=(w/7%8-4).toFixed(1),B=(w/13%6-3).toFixed(1);return `rotate(${_}deg) translate(${y}px, ${B}px)`},T=(N,w)=>{let _=(w-1)/2,y=((N-_)*7).toFixed(1),B=((N-_)*110).toFixed(0),z=(-Math.abs(N-_)*10+(h===N?-18:0)).toFixed(0);return `translateX(${B}px) translateY(${z}px) rotate(${y}deg)`};return jsxRuntime.jsxs("div",{className:s("flex flex-col items-center gap-4",g),children:[jsxRuntime.jsx("div",{className:"relative flex h-85 w-full items-center justify-center",onMouseEnter:()=>m(true),onMouseLeave:()=>{m(false),D(null);},children:x.map((N,w)=>jsxRuntime.jsx("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:k?`${w*35}ms`:`${(S-w)*25}ms`,transform:k?T(w,x.length):j(w),zIndex:k?w+1:x.length-w,width:220,height:147},onClick:()=>n(w),onMouseEnter:()=>k&&D(w),onMouseLeave:()=>D(null),children:jsxRuntime.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg border transition-shadow duration-300",style:{borderColor:k&&h===w?"rgba(217,171,89,0.5)":kt,boxShadow:k&&h===w?"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:[jsxRuntime.jsx("img",{src:N.src,alt:N.alt??"",className:"h-full w-full object-cover",draggable:false}),i&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:ct}}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%)"}}),k&&h===w&&jsxRuntime.jsx("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:jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90",children:N.title})})]})},w))}),e.length>S&&jsxRuntime.jsxs("span",{className:"font-mono text-xs",style:{color:qe},children:["+ ",e.length-S," more"]}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] transition-opacity duration-300",style:{color:qe,opacity:k?0:.7},children:"Hover to explore"})]})}function $n({photos:e,currentIndex:n,onIndexChange:i,onClose:g,actions:k,activeActions:m,onAction:h,showGrain:D}){let S=e[n],[x,j]=ln.useState(1),[T,N]=ln.useState({x:0,y:0}),[w,_]=ln.useState(false),[y,B]=ln.useState(false),z=ln.useRef(false),G=ln.useRef({x:0,y:0}),A=ln.useRef(null);ln.useLayoutEffect(()=>{requestAnimationFrame(()=>B(true));},[]),ln.useEffect(()=>{let o=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=o;}},[]),ln.useEffect(()=>{let o=L=>{switch(L.key){case "Escape":g();break;case "ArrowLeft":X(-1);break;case "ArrowRight":X(1);break;case "i":case "I":_(K=>!K);break}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)}),ln.useEffect(()=>{let o=A.current;if(!o)return;let L=K=>{K.preventDefault();let ne=K.deltaY<0?1.12:.89;j(U=>{let be=Math.min(8,Math.max(1,U*ne));return be<=1&&N({x:0,y:0}),be});};return o.addEventListener("wheel",L,{passive:false}),()=>o.removeEventListener("wheel",L)},[]);let X=ln.useCallback(o=>{let L=n+o;L>=0&&L<e.length&&(i(L),j(1),N({x:0,y:0}));},[n,e.length,i]),I=ln.useCallback(o=>{x<=1||(z.current=true,G.current={x:o.clientX,y:o.clientY},o.target.setPointerCapture(o.pointerId));},[x]),ge=ln.useCallback(o=>{if(!z.current)return;let L=o.clientX-G.current.x,K=o.clientY-G.current.y;G.current={x:o.clientX,y:o.clientY},N(ne=>({x:ne.x+L/x,y:ne.y+K/x}));},[x]),d=ln.useCallback(()=>{z.current=false;},[]),b=ln.useCallback(()=>{x>1?(j(1),N({x:0,y:0})):j(2.5);},[x]),E=o=>m.has(`${n}-${o}`),C=S.metadata;return jsxRuntime.jsxs("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/95",onClick:g}),D&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:ct,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsxs("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[jsxRuntime.jsxs("span",{className:"font-mono text-sm text-white/50",children:[n+1," / ",e.length]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"mr-2 font-mono text-xs text-white/40",children:[x.toFixed(1),"x"]}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>j(o=>Math.min(8,o*1.3)),title:"Zoom in",children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>{j(o=>{let L=Math.max(1,o*.7);return L<=1&&N({x:0,y:0}),L});},title:"Zoom out",children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:g,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5"})})]})]}),jsxRuntime.jsxs("div",{ref:A,className:"relative flex flex-1 items-center justify-center overflow-hidden",style:{cursor:x>1?"grab":"default"},onPointerDown:I,onPointerMove:ge,onPointerUp:d,onDoubleClick:b,children:[jsxRuntime.jsx("img",{src:S.src,alt:S.alt??S.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(${x}) translate(${T.x}px, ${T.y}px)`,transition:z.current?"none":"transform 0.15s ease-out"},draggable:false},n),n>0&&jsxRuntime.jsx("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:o=>{o.stopPropagation(),X(-1);},children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-6 w-6"})}),n<e.length-1&&jsxRuntime.jsx("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:o=>{o.stopPropagation(),X(1);},children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-6 w-6"})})]}),jsxRuntime.jsx("div",{className:s("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:jsxRuntime.jsxs("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[S.title&&jsxRuntime.jsx("h3",{className:"mb-3 text-xl font-semibold text-white",children:S.title}),S.description&&jsxRuntime.jsx("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:S.description}),C&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[C.camera&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Camera,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",C.camera,C.lens&&jsxRuntime.jsx("span",{className:"text-white/40",children:"\xB7"}),C.lens&&C.lens]}),(C.aperture||C.shutter||C.iso)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Aperture,{className:"h-3.5 w-3.5 text-amber-400/80"}),[C.aperture,C.shutter,C.iso&&`ISO ${C.iso}`].filter(Boolean).join(" \xB7 ")]}),C.date&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",C.date]}),C.location&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",C.location]})]})]})}),jsxRuntime.jsx("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 rounded-full bg-white/6 px-2 py-1.5 backdrop-blur-xl",children:[k.map(o=>{let L=o.toggle&&E(o.key);return jsxRuntime.jsx("button",{className:s("rounded-full p-2.5 transition-all duration-200",L?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>h(o.key,n),title:o.label,children:L&&o.activeIcon?o.activeIcon:o.icon},o.key)}),jsxRuntime.jsx("div",{className:"mx-1 h-5 w-px bg-white/10"}),jsxRuntime.jsx("button",{className:s("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:()=>_(o=>!o),title:"Photo info (I)",children:jsxRuntime.jsx(lucideReact.Info,{className:"h-5 w-5"})})]})})]})}var Ct="data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
2
2
  <rect width="200" height="200" fill="#1e1b2e"/>
3
3
  <circle cx="100" cy="100" r="60" fill="none" stroke="#6366f1" stroke-width="1.5" opacity="0.3"/>
4
4
  <circle cx="100" cy="100" r="20" fill="none" stroke="#6366f1" stroke-width="1" opacity="0.4"/>
5
5
  <text x="100" y="108" text-anchor="middle" font-family="monospace" font-size="18" fill="#6366f1" opacity="0.6">\u266A</text>
6
- </svg>`);function Yt(e){if(!isFinite(e)||e<0)return "0:00";let o=Math.floor(e/60),l=Math.floor(e%60);return `${o}:${l.toString().padStart(2,"0")}`}function Gn(e){return e.startsWith("bottom")?"bottom":e.startsWith("top")?"top":"right"}var qn={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},Zn={"bottom-right":"bottom-4 right-0","bottom-left":"bottom-4 left-0","top-right":"top-4 right-0","top-left":"top-4 left-0"},Qn={"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 wt({playlist:e,initialTrack:o=0,position:l="bottom-right",entrance:g,theme:w,docked:f=false,visible:v,onVisibleChange:z,onTrackChange:F,onLike:x,autoPlay:_=true,shuffle:D=false,loop:L=false,accent:k="#8b5cf6",className:G}){let [y,ee]=rn.useState(o),[A,ne]=rn.useState(false),[$,K]=rn.useState(0),[j,Me]=rn.useState(0),[u,b]=rn.useState(.8),[C,S]=rn.useState(false),[a,O]=rn.useState(new Set),[Y,ie]=rn.useState(false),[q,ge]=rn.useState(v??!f),[I,be]=rn.useState(false),[$e,Re]=rn.useState(false),[ce,ze]=rn.useState(D),[me,Fe]=rn.useState(L),De=rn.useRef(false),P=rn.useRef(null),ve=rn.useRef(null),Q=rn.useRef(void 0),W=rn.useRef(null),J=rn.useRef(null),pe=v??q,ke=g??Gn(l),M=e[y],U=f,de=w==="dark"?"dark":w==="light"?"light":"",ye="bg-(--mp-bg)",Ne="text-(--mp-text)",te="text-(--mp-text-muted)",Ee="text-(--accent)",Z="border-(--mp-border)";rn.useEffect(()=>{let r=P.current;r&&(r.src=M.src,r.load(),A&&r.play().catch(()=>{}));},[y,M.src]),rn.useEffect(()=>{if(!_||De.current)return;let r=P.current;if(!r)return;let E=()=>{De.current=true,ne(true),r.play().catch(()=>{});};return r.addEventListener("canplaythrough",E,{once:true}),()=>r.removeEventListener("canplaythrough",E)},[_]),rn.useEffect(()=>{let r=P.current;r&&(A?r.play().catch(()=>{}):r.pause());},[A]),rn.useEffect(()=>{let r=P.current;r&&(r.muted=C,J.current?J.current.gain.value=C?0:u:r.volume=u);},[u,C]),rn.useEffect(()=>{let r=P.current;if(!r)return;let E=()=>K(r.currentTime),re=()=>Me(r.duration),Ce=()=>{me?(r.currentTime=0,r.play().catch(()=>{})):Le();};return r.addEventListener("timeupdate",E),r.addEventListener("loadedmetadata",re),r.addEventListener("ended",Ce),()=>{r.removeEventListener("timeupdate",E),r.removeEventListener("loadedmetadata",re),r.removeEventListener("ended",Ce);}},[y,e.length]);let N=rn.useCallback(r=>{let E=(r%e.length+e.length)%e.length;ee(E),K(0),F?.(E,e[E]),pe||(ge(true),z?.(true));},[e,pe,F,z]),Le=rn.useCallback(()=>{if(ce){let r;do r=Math.floor(Math.random()*e.length);while(r===y&&e.length>1);N(r);}else N(y+1);},[N,y,ce,e.length]),Ye=rn.useCallback(()=>{if(ce){let r;do r=Math.floor(Math.random()*e.length);while(r===y&&e.length>1);N(r);}else N(y-1);},[N,y,ce,e.length]),We=rn.useCallback(()=>{let r=a.has(y);O(E=>{let re=new Set(E);return r?re.delete(y):re.add(y),re}),x?.(y,M,!r);},[y,a,x,M]),at=rn.useCallback(r=>{let E=r.currentTarget.getBoundingClientRect(),Ce=Math.max(0,Math.min(1,(r.clientX-E.left)/E.width))*j;P.current&&(P.current.currentTime=Ce),K(Ce);},[j]),le=rn.useCallback(()=>{be(true);let r=U?200:400;Q.current=setTimeout(()=>{be(false),ge(false),z?.(false);},r);},[U,z]);rn.useEffect(()=>()=>{Q.current&&clearTimeout(Q.current);},[]),rn.useEffect(()=>()=>{W.current?.close();},[]);function fe(){if(W.current||!P.current){W.current?.resume();return}try{let r=window.AudioContext??window.webkitAudioContext;if(!r)return;let E=new r,re=E.createGain();re.gain.value=C?0:u,E.createMediaElementSource(P.current).connect(re).connect(E.destination),W.current=E,J.current=re,E.resume();}catch{}}let n=$e?"fade-in 0.2s ease-out both":`mp-enter-${ke} 0.45s cubic-bezier(0.16, 1, 0.3, 1) both`,h=$e?"fade-in 0.2s ease-in reverse both":`mp-exit-${ke} 0.4s cubic-bezier(0.7, 0, 0.84, 0) both`,V=j>0?$/j*100:0;return U&&!pe&&!I?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:P,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsxs("div",{className:s("fixed z-100 cursor-pointer transition-all duration-300",Qn[l]),style:{"--accent":k},onMouseEnter:()=>{Re(true),ge(true),z?.(true);},children:[jsxRuntime.jsx("div",{className:s("h-full w-full rounded-full",A?"bg-(--accent)":"bg-(--mp-dock-strip)"),style:A?{animation:"mp-progress-glow 2s ease-in-out infinite",boxShadow:"0 0 12px color-mix(in srgb, var(--accent) 50%, transparent)"}:void 0}),A&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]}):!pe&&!I?jsxRuntime.jsx("audio",{ref:P,preload:"metadata",crossOrigin:"anonymous"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:P,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsx("div",{className:s("fixed z-100",U?Zn[l]:qn[l],de),style:{"--accent":k,...I?{animation:h}:{animation:n}},onMouseEnter:()=>{U&&(Q.current&&(clearTimeout(Q.current),Q.current=void 0),I&&be(false),Re(true));},onMouseLeave:()=>{U&&(Re(false),le());},children:jsxRuntime.jsxs("div",{className:s("w-[320px] overflow-hidden rounded-2xl border shadow-2xl backdrop-blur-xl",ye,Z,U&&"rounded-none",l.endsWith("right")&&U&&"rounded-l-2xl",l.endsWith("left")&&U&&"rounded-r-2xl",G),children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 overflow-hidden",children:jsxRuntime.jsx("img",{src:M.cover||yt,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:false})}),jsxRuntime.jsxs("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[jsxRuntime.jsxs("div",{className:"relative h-14 w-14 shrink-0",children:[jsxRuntime.jsxs("div",{className:"h-14 w-14 overflow-hidden rounded-full border-2 border-white/10 shadow-lg",style:A?{animation:"mp-vinyl-spin 4s linear infinite"}:void 0,children:[jsxRuntime.jsx("img",{src:M.cover||yt,alt:M.album??M.title,className:"h-full w-full object-cover",draggable:false}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),A&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:s("truncate text-sm font-semibold",Ne),children:M.title}),M.artist&&jsxRuntime.jsx("div",{className:s("truncate text-xs",te),children:M.artist}),M.album&&jsxRuntime.jsx("div",{className:s("mt-0.5 truncate text-[10px] tracking-wide",te,"opacity-60"),children:M.album})]}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-all duration-200",a.has(y)?"text-rose-500 hover:text-rose-400":s(te,"hover:text-rose-500")),onClick:We,title:"Like",children:jsxRuntime.jsx(lucideReact.Heart,{className:"h-4 w-4",fill:a.has(y)?"currentColor":"none"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",te,"hover:"+Ne.split(" ")[0]),onClick:()=>ie(r=>!r),title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListMusic,{className:"h-4 w-4"})}),!U&&jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",te,"hover:"+Ne.split(" ")[0]),onClick:le,title:"Dismiss",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]})]}),jsxRuntime.jsxs("div",{className:"px-4",children:[jsxRuntime.jsxs("div",{ref:ve,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:at,children:[jsxRuntime.jsx("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${V}%`}}),jsxRuntime.jsx("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(${V}% - 6px)`}})]}),jsxRuntime.jsxs("div",{className:s("mt-1 flex justify-between text-[10px] font-mono",te),children:[jsxRuntime.jsx("span",{children:Yt($)}),jsxRuntime.jsx("span",{children:Yt(j)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",ce?Ee:te,"hover:text-(--mp-text)"),onClick:()=>ze(r=>!r),title:ce?"Shuffle On":"Shuffle Off",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",me?Ee:te,"hover:text-(--mp-text)"),onClick:()=>Fe(r=>!r),title:me?"Loop On":"Loop Off",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-2 transition-colors",te,"hover:text-(--mp-text)"),onClick:Ye,title:"Previous",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:s("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:()=>{fe(),ne(r=>!r);},title:A?"Pause":"Play",children:A?jsxRuntime.jsx(lucideReact.Pause,{className:"h-4.5 w-4.5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-2 transition-colors",te,"hover:text-(--mp-text)"),onClick:Le,title:"Next",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"ml-2 flex items-center gap-1.5",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1 transition-colors",te,"hover:text-(--mp-text)"),onClick:()=>{fe();let r=!C;S(r),J.current&&(J.current.gain.value=r?0:u);},title:C?"Unmute":"Mute",children:C||u===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:C?0:u,onChange:r=>{fe();let E=Number(r.target.value);b(E),C&&S(false),J.current&&(J.current.gain.value=E);},className:"mp-volume-slider h-1 w-14 cursor-pointer appearance-none rounded-full bg-(--mp-surface) accent-(--accent)"})]})]}),jsxRuntime.jsx("div",{className:s("overflow-hidden transition-all duration-300 ease-in-out",Y?"max-h-60":"max-h-0"),children:jsxRuntime.jsx("div",{className:s("border-t px-2 py-2",Z),children:jsxRuntime.jsx("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((r,E)=>{let re=E===y;return jsxRuntime.jsxs("button",{className:s("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-all duration-200",re?"bg-(--accent)/10 dark:bg-(--accent)/15":"hover:bg-(--mp-surface-hover)"),onClick:()=>{N(E),ne(true);},children:[jsxRuntime.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:re&&A?jsxRuntime.jsx("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(Ce=>jsxRuntime.jsx("div",{className:"w-0.75 rounded-full bg-(--accent)",style:{height:`${8+Ce*4}px`,animation:`mp-eq-bar ${.4+Ce*.15}s ease-in-out infinite alternate`}},Ce))}):re?jsxRuntime.jsx(lucideReact.Disc3,{className:s("h-4 w-4",Ee)}):jsxRuntime.jsx("span",{className:s("text-xs font-mono",te),children:E+1})}),jsxRuntime.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:jsxRuntime.jsx("img",{src:r.cover||yt,alt:"",className:"h-full w-full object-cover",draggable:false})}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:s("truncate text-xs font-medium",re?Ee:Ne),children:r.title}),r.artist&&jsxRuntime.jsx("div",{className:s("truncate text-[10px]",te),children:r.artist})]}),a.has(E)&&jsxRuntime.jsx(lucideReact.Heart,{className:"h-3 w-3 shrink-0 text-rose-500",fill:"currentColor"})]},E)})})})})]})})]})}function ut(e){if(!isFinite(e)||e<0)return "0:00";let o=Math.floor(e/3600),l=Math.floor(e%3600/60),g=Math.floor(e%60);return o>0?`${o}:${l.toString().padStart(2,"0")}:${g.toString().padStart(2,"0")}`:`${l}:${g.toString().padStart(2,"0")}`}var fr={title:(e,o)=>e.title.localeCompare(o.title),type:(e,o)=>(e.type??"").localeCompare(o.type??""),duration:(e,o)=>(e.duration??0)-(o.duration??0)};function Nt({playlist:e,initialTrack:o=0,autoPlay:l=false,shuffle:g=false,loop:w=false,onTrackChange:f,onPlayChange:v,accent:z="#8b5cf6",className:F}){let[x,_]=rn.useState(o),[D,L]=rn.useState(false),[k,G]=rn.useState(0),[y,ee]=rn.useState(0),[A,ne]=rn.useState(0),[$,K]=rn.useState(.8),[j,Me]=rn.useState(false),[u,b]=rn.useState(g),[C,S]=rn.useState(w),[a,O]=rn.useState(false),[Y,ie]=rn.useState("title"),[q,ge]=rn.useState(true),[I,be]=rn.useState(false),[$e,Re]=rn.useState(false),[ce,ze]=rn.useState(false),[me,Fe]=rn.useState(true),[De,P]=rn.useState(false),[ve,Q]=rn.useState(null),W=rn.useRef(null),J=rn.useRef(null),pe=rn.useRef(void 0),ke=rn.useRef(false),M=e[x],Ke=rn__default.default.useMemo(()=>{let n=e.map((h,V)=>({media:h,originalIndex:V}));return n.sort((h,V)=>{let r=fr[Y](h.media,V.media);return q?r:-r}),n},[e,Y,q]);rn.useEffect(()=>{let n=W.current;if(!n)return;P(true),n.src=M.src,M.poster&&(n.poster=M.poster),n.load();let h=()=>{P(false),D&&n.play().catch(()=>{});};return n.addEventListener("loadeddata",h,{once:true}),()=>n.removeEventListener("loadeddata",h)},[x,M.src]),rn.useEffect(()=>{if(!l||ke.current)return;let n=W.current;if(!n)return;let h=()=>{ke.current=true,L(true),n.play().catch(()=>{});};return n.addEventListener("canplaythrough",h,{once:true}),()=>n.removeEventListener("canplaythrough",h)},[l]),rn.useEffect(()=>{let n=W.current;n&&(D?n.play().catch(()=>{}):n.pause(),v?.(D));},[D]),rn.useEffect(()=>{let n=W.current;n&&(n.volume=j?0:$);},[$,j]),rn.useEffect(()=>{let n=W.current;if(!n)return;let h=()=>G(n.currentTime),V=()=>ee(n.duration),r=()=>{n.buffered.length>0&&ne(n.buffered.end(n.buffered.length-1));},E=()=>{C?(n.currentTime=0,n.play().catch(()=>{})):ye();};return n.addEventListener("timeupdate",h),n.addEventListener("loadedmetadata",V),n.addEventListener("progress",r),n.addEventListener("ended",E),()=>{n.removeEventListener("timeupdate",h),n.removeEventListener("loadedmetadata",V),n.removeEventListener("progress",r),n.removeEventListener("ended",E);}},[x,e.length,C]);let U=rn.useCallback(()=>{Fe(true),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{D&&Fe(false);},3e3);},[D]);rn.useEffect(()=>{D?U():(Fe(true),pe.current&&clearTimeout(pe.current));},[D,U]),rn.useEffect(()=>()=>{pe.current&&clearTimeout(pe.current);},[]);let de=rn.useCallback(n=>{let h=(n%e.length+e.length)%e.length;_(h),G(0),L(true),f?.(h,e[h]);},[e,f]),ye=rn.useCallback(()=>{if(u){let n;do n=Math.floor(Math.random()*e.length);while(n===x&&e.length>1);de(n);}else de(x+1);},[de,x,u,e.length]),Ne=rn.useCallback(()=>{if(u){let n;do n=Math.floor(Math.random()*e.length);while(n===x&&e.length>1);de(n);}else de(x-1);},[de,x,u,e.length]),te=rn.useCallback(n=>{let h=n.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(n.clientX-h.left)/h.width))*y;W.current&&(W.current.currentTime=r),G(r);},[y]),Ee=rn.useCallback(n=>{let h=n.currentTarget.getBoundingClientRect(),V=Math.max(0,Math.min(1,(n.clientX-h.left)/h.width));Q(V*y);},[y]),Z=rn.useCallback(()=>{J.current&&(document.fullscreenElement?document.exitFullscreen():J.current.requestFullscreen());},[]);rn.useEffect(()=>{let n=()=>ze(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let N=rn.useCallback(()=>{I?(Re(true),setTimeout(()=>{be(false),Re(false);},500)):be(true);},[I]),Le=rn.useCallback(()=>{O(n=>!n);},[]),Ye=rn.useCallback(()=>{let n=["title","type","duration"],h=n.indexOf(Y);q?ge(false):(ge(true),ie(n[(h+1)%n.length]));},[Y,q]);rn.useEffect(()=>{let n=h=>{if(!(h.target instanceof HTMLInputElement||h.target instanceof HTMLTextAreaElement))switch(h.key){case " ":case "k":h.preventDefault(),L(V=>!V);break;case "f":h.preventDefault(),Z();break;case "t":h.preventDefault(),N();break;case "ArrowLeft":h.preventDefault(),W.current&&(W.current.currentTime=Math.max(0,k-5));break;case "ArrowRight":h.preventDefault(),W.current&&(W.current.currentTime=Math.min(y,k+5));break;case "ArrowUp":h.preventDefault(),K(V=>Math.min(1,V+.05));break;case "ArrowDown":h.preventDefault(),K(V=>Math.max(0,V-.05));break;case "Escape":I&&N();break;case "n":h.preventDefault(),ye();break;case "p":h.preventDefault(),Ne();break;case "l":h.preventDefault(),Le();break}};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[Z,N,Le,ye,Ne,k,y,I]);let We=y>0?k/y*100:0,at=y>0?A/y*100:0,le="text-(--accent)",fe=jsxRuntime.jsxs("div",{ref:J,className:s("group flex overflow-hidden",ce?"h-full w-full":"aspect-video w-full",!ce&&"rounded-xl",!ce&&D&&"shadow-2xl",!ce&&!D&&"animate-[cp-glow-pulse_4s_ease-in-out_infinite] will-change-[box-shadow]",F),style:{"--accent":z,background:"var(--cp-bg)"},tabIndex:0,children:[jsxRuntime.jsxs("div",{className:s("relative flex-1 min-w-0 h-full overflow-hidden",De&&"animate-[cp-track-transition_0.6s_ease-out]"),onMouseMove:U,onMouseLeave:()=>{D&&Fe(false);},children:[jsxRuntime.jsx("video",{ref:W,className:"h-full w-full object-contain",poster:M.poster,playsInline:true,preload:"metadata",onClick:()=>L(n=>!n)}),!D&&!De&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>L(true),children:jsxRuntime.jsx("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:jsxRuntime.jsx(lucideReact.Play,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),De&&!me&&jsxRuntime.jsx("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:jsxRuntime.jsxs("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:M.title}),M.subtitle&&jsxRuntime.jsx("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:M.subtitle})]})}),jsxRuntime.jsx("div",{className:s("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",me?"opacity-100":"pointer-events-none opacity-0"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:M.title}),M.subtitle&&jsxRuntime.jsx("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:M.subtitle})]}),M.type&&jsxRuntime.jsx("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:M.type})]})}),jsxRuntime.jsxs("div",{className:s("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",me?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:[jsxRuntime.jsxs("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:te,onMouseMove:Ee,onMouseLeave:()=>Q(null),children:[jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${at}%`,background:"var(--cp-seek-buffer)"}}),jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${We}%`}}),ve!==null&&jsxRuntime.jsx("div",{className:"absolute -top-8 -translate-x-1/2 rounded px-2 py-0.5 text-[10px] font-mono",style:{left:`${ve/y*100}%`,background:"var(--cp-panel-bg)",color:"var(--cp-text-strong)"},children:ut(ve)}),jsxRuntime.jsx("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(${We}% - 7px)`}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>L(n=>!n),title:D?"Pause (k)":"Play (k)",children:D?jsxRuntime.jsx(lucideReact.Pause,{className:"h-5 w-5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:Ne,title:"Previous (p)",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:ye,title:"Next (n)",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"group/vol ml-1 flex items-center",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>Me(n=>!n),title:j?"Unmute":"Mute",children:j||$===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:j?0:$,onChange:n=>{K(Number(n.target.value)),j&&Me(false);},className:"h-1 w-full cursor-pointer appearance-none rounded-full accent-(--accent)",style:{background:"var(--cp-seek-track)"}})})]}),jsxRuntime.jsxs("span",{className:"ml-2 min-w-0 shrink-0 font-mono text-xs",style:{color:"var(--cp-text-muted)"},children:[ut(k)," / ",ut(y)]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:s("cp-btn",u&&le),onClick:()=>b(n=>!n),title:"Shuffle",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",C&&le),onClick:()=>S(n=>!n),title:"Loop",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",a&&le),onClick:Le,title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListVideo,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",I&&le),onClick:N,title:"Cinema mode (t)",children:jsxRuntime.jsx(lucideReact.Theater,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:Z,title:"Fullscreen (f)",children:ce?jsxRuntime.jsx(lucideReact.Minimize,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Maximize,{className:"h-4 w-4"})})]})]})]}),jsxRuntime.jsx("div",{className:s("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",a?"w-72":"w-0"),children:jsxRuntime.jsxs("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:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("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:Ye,title:`Sort: ${Y} ${q?"\u2191":"\u2193"}`,children:[jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3 w-3"}),Y,q?" \u2191":" \u2193"]}),jsxRuntime.jsx("button",{className:"cp-btn p-1!",onClick:Le,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:Ke.map(({media:n,originalIndex:h})=>{let V=h===x;return jsxRuntime.jsxs("button",{className:s("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-all duration-200",V?"bg-(--accent)/20 text-(--accent)":"hover:text-(--cp-text-strong)"),style:V?void 0:{color:"var(--cp-text)"},onClick:()=>{de(h);},children:[jsxRuntime.jsxs("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[n.poster?jsxRuntime.jsx("img",{src:n.poster,alt:"",className:"h-full w-full object-cover",draggable:false}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center",children:jsxRuntime.jsx(lucideReact.Play,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),V&&D&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:jsxRuntime.jsx("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(r=>jsxRuntime.jsx("div",{className:"w-0.5 rounded-full bg-(--accent)",style:{height:`${6+r*3}px`,animation:`mp-eq-bar ${.3+r*.12}s ease-in-out infinite alternate`}},r))})})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-xs font-medium",children:n.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[n.type&&jsxRuntime.jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:n.type}),n.duration!=null&&jsxRuntime.jsx("span",{className:"font-mono text-[10px] opacity-40",children:ut(n.duration)})]})]}),V&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},h)})})]})}),jsxRuntime.jsx("style",{children:`
6
+ </svg>`);function qt(e){if(!isFinite(e)||e<0)return "0:00";let n=Math.floor(e/60),i=Math.floor(e%60);return `${n}:${i.toString().padStart(2,"0")}`}function er(e){return e.startsWith("bottom")?"bottom":e.startsWith("top")?"top":"right"}var tr={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},nr={"bottom-right":"bottom-4 right-0","bottom-left":"bottom-4 left-0","top-right":"top-4 right-0","top-left":"top-4 left-0"},rr={"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 Mt({playlist:e,initialTrack:n=0,position:i="bottom-right",entrance:g,theme:k,docked:m=false,visible:h,onVisibleChange:D,onTrackChange:S,onLike:x,autoPlay:j=true,shuffle:T=false,loop:N=false,accent:w="#8b5cf6",className:_}){let [y,B]=ln.useState(n),[z,G]=ln.useState(false),[A,X]=ln.useState(0),[I,ge]=ln.useState(0),[d,b]=ln.useState(.8),[E,C]=ln.useState(false),[o,L]=ln.useState(new Set),[K,ne]=ln.useState(false),[U,be]=ln.useState(h??!m),[V,he]=ln.useState(false),[$e,Se]=ln.useState(false),[ce,ze]=ln.useState(T),[me,Fe]=ln.useState(N),Pe=ln.useRef(false),F=ln.useRef(null),ye=ln.useRef(null),ee=ln.useRef(void 0),Z=ln.useRef(null),te=ln.useRef(null),pe=h??U,Ne=g??er(i),P=e[y],Q=m,de=k==="dark"?"dark":k==="light"?"light":"",we="bg-(--mp-bg)",Ce="text-(--mp-text)",re="text-(--mp-text-muted)",Ee="text-(--accent)",J="border-(--mp-border)";ln.useEffect(()=>{let a=F.current;a&&(a.src=P.src,a.load(),z&&a.play().catch(()=>{}));},[y,P.src]),ln.useEffect(()=>{if(!j||Pe.current)return;let a=F.current;if(!a)return;let R=()=>{Pe.current=true,G(true),a.play().catch(()=>{});};return a.addEventListener("canplaythrough",R,{once:true}),()=>a.removeEventListener("canplaythrough",R)},[j]),ln.useEffect(()=>{let a=F.current;a&&(z?a.play().catch(()=>{}):a.pause());},[z]),ln.useEffect(()=>{let a=F.current;a&&(a.muted=E,te.current?te.current.gain.value=E?0:d:a.volume=d);},[d,E]),ln.useEffect(()=>{let a=F.current;if(!a)return;let R=()=>X(a.currentTime),oe=()=>ge(a.duration),Me=()=>{me?(a.currentTime=0,a.play().catch(()=>{})):Te();};return a.addEventListener("timeupdate",R),a.addEventListener("loadedmetadata",oe),a.addEventListener("ended",Me),()=>{a.removeEventListener("timeupdate",R),a.removeEventListener("loadedmetadata",oe),a.removeEventListener("ended",Me);}},[y,e.length]);let M=ln.useCallback(a=>{let R=(a%e.length+e.length)%e.length;B(R),X(0),S?.(R,e[R]),pe||(be(true),D?.(true));},[e,pe,S,D]),Te=ln.useCallback(()=>{if(ce){let a;do a=Math.floor(Math.random()*e.length);while(a===y&&e.length>1);M(a);}else M(y+1);},[M,y,ce,e.length]),Ye=ln.useCallback(()=>{if(ce){let a;do a=Math.floor(Math.random()*e.length);while(a===y&&e.length>1);M(a);}else M(y-1);},[M,y,ce,e.length]),We=ln.useCallback(()=>{let a=o.has(y);L(R=>{let oe=new Set(R);return a?oe.delete(y):oe.add(y),oe}),x?.(y,P,!a);},[y,o,x,P]),at=ln.useCallback(a=>{let R=a.currentTarget.getBoundingClientRect(),Me=Math.max(0,Math.min(1,(a.clientX-R.left)/R.width))*I;F.current&&(F.current.currentTime=Me),X(Me);},[I]),le=ln.useCallback(()=>{he(true);let a=Q?200:400;ee.current=setTimeout(()=>{he(false),be(false),D?.(false);},a);},[Q,D]);ln.useEffect(()=>()=>{ee.current&&clearTimeout(ee.current);},[]),ln.useEffect(()=>()=>{Z.current?.close();},[]);function fe(){if(Z.current||!F.current){Z.current?.resume();return}try{let a=window.AudioContext??window.webkitAudioContext;if(!a)return;let R=new a,oe=R.createGain();oe.gain.value=E?0:d,R.createMediaElementSource(F.current).connect(oe).connect(R.destination),Z.current=R,te.current=oe,R.resume();}catch{}}let r=$e?"fade-in 0.2s ease-out both":`mp-enter-${Ne} 0.45s cubic-bezier(0.16, 1, 0.3, 1) both`,v=$e?"fade-in 0.2s ease-in reverse both":`mp-exit-${Ne} 0.4s cubic-bezier(0.7, 0, 0.84, 0) both`,Y=I>0?A/I*100:0;return Q&&!pe&&!V?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:F,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsxs("div",{className:s("fixed z-100 cursor-pointer transition-all duration-300",rr[i]),style:{"--accent":w},onMouseEnter:()=>{Se(true),be(true),D?.(true);},children:[jsxRuntime.jsx("div",{className:s("h-full w-full rounded-full",z?"bg-(--accent)":"bg-(--mp-dock-strip)"),style:z?{animation:"mp-progress-glow 2s ease-in-out infinite",boxShadow:"0 0 12px color-mix(in srgb, var(--accent) 50%, transparent)"}:void 0}),z&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]}):!pe&&!V?jsxRuntime.jsx("audio",{ref:F,preload:"metadata",crossOrigin:"anonymous"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:F,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsx("div",{className:s("fixed z-100",Q?nr[i]:tr[i],de),style:{"--accent":w,...V?{animation:v}:{animation:r}},onMouseEnter:()=>{Q&&(ee.current&&(clearTimeout(ee.current),ee.current=void 0),V&&he(false),Se(true));},onMouseLeave:()=>{Q&&(Se(false),le());},children:jsxRuntime.jsxs("div",{className:s("w-[320px] overflow-hidden rounded-2xl border shadow-2xl backdrop-blur-xl",we,J,Q&&"rounded-none",i.endsWith("right")&&Q&&"rounded-l-2xl",i.endsWith("left")&&Q&&"rounded-r-2xl",_),children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 overflow-hidden",children:jsxRuntime.jsx("img",{src:P.cover||Ct,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:false})}),jsxRuntime.jsxs("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[jsxRuntime.jsxs("div",{className:"relative h-14 w-14 shrink-0",children:[jsxRuntime.jsxs("div",{className:"h-14 w-14 overflow-hidden rounded-full border-2 border-white/10 shadow-lg",style:z?{animation:"mp-vinyl-spin 4s linear infinite"}:void 0,children:[jsxRuntime.jsx("img",{src:P.cover||Ct,alt:P.album??P.title,className:"h-full w-full object-cover",draggable:false}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),z&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:s("truncate text-sm font-semibold",Ce),children:P.title}),P.artist&&jsxRuntime.jsx("div",{className:s("truncate text-xs",re),children:P.artist}),P.album&&jsxRuntime.jsx("div",{className:s("mt-0.5 truncate text-[10px] tracking-wide",re,"opacity-60"),children:P.album})]}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-all duration-200",o.has(y)?"text-rose-500 hover:text-rose-400":s(re,"hover:text-rose-500")),onClick:We,title:"Like",children:jsxRuntime.jsx(lucideReact.Heart,{className:"h-4 w-4",fill:o.has(y)?"currentColor":"none"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",re,"hover:"+Ce.split(" ")[0]),onClick:()=>ne(a=>!a),title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListMusic,{className:"h-4 w-4"})}),!Q&&jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",re,"hover:"+Ce.split(" ")[0]),onClick:le,title:"Dismiss",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]})]}),jsxRuntime.jsxs("div",{className:"px-4",children:[jsxRuntime.jsxs("div",{ref:ye,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:at,children:[jsxRuntime.jsx("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${Y}%`}}),jsxRuntime.jsx("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(${Y}% - 6px)`}})]}),jsxRuntime.jsxs("div",{className:s("mt-1 flex justify-between text-[10px] font-mono",re),children:[jsxRuntime.jsx("span",{children:qt(A)}),jsxRuntime.jsx("span",{children:qt(I)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",ce?Ee:re,"hover:text-(--mp-text)"),onClick:()=>ze(a=>!a),title:ce?"Shuffle On":"Shuffle Off",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-1.5 transition-colors",me?Ee:re,"hover:text-(--mp-text)"),onClick:()=>Fe(a=>!a),title:me?"Loop On":"Loop Off",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-2 transition-colors",re,"hover:text-(--mp-text)"),onClick:Ye,title:"Previous",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:s("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:()=>{fe(),G(a=>!a);},title:z?"Pause":"Play",children:z?jsxRuntime.jsx(lucideReact.Pause,{className:"h-4.5 w-4.5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:s("rounded-full p-2 transition-colors",re,"hover:text-(--mp-text)"),onClick:Te,title:"Next",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"ml-2 flex items-center gap-1.5",children:[jsxRuntime.jsx("button",{className:s("rounded-full p-1 transition-colors",re,"hover:text-(--mp-text)"),onClick:()=>{fe();let a=!E;C(a),te.current&&(te.current.gain.value=a?0:d);},title:E?"Unmute":"Mute",children:E||d===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:E?0:d,onChange:a=>{fe();let R=Number(a.target.value);b(R),E&&C(false),te.current&&(te.current.gain.value=R);},className:"mp-volume-slider h-1 w-14 cursor-pointer appearance-none rounded-full bg-(--mp-surface) accent-(--accent)"})]})]}),jsxRuntime.jsx("div",{className:s("overflow-hidden transition-all duration-300 ease-in-out",K?"max-h-60":"max-h-0"),children:jsxRuntime.jsx("div",{className:s("border-t px-2 py-2",J),children:jsxRuntime.jsx("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((a,R)=>{let oe=R===y;return jsxRuntime.jsxs("button",{className:s("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-all duration-200",oe?"bg-(--accent)/10 dark:bg-(--accent)/15":"hover:bg-(--mp-surface-hover)"),onClick:()=>{M(R),G(true);},children:[jsxRuntime.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:oe&&z?jsxRuntime.jsx("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(Me=>jsxRuntime.jsx("div",{className:"w-0.75 rounded-full bg-(--accent)",style:{height:`${8+Me*4}px`,animation:`mp-eq-bar ${.4+Me*.15}s ease-in-out infinite alternate`}},Me))}):oe?jsxRuntime.jsx(lucideReact.Disc3,{className:s("h-4 w-4",Ee)}):jsxRuntime.jsx("span",{className:s("text-xs font-mono",re),children:R+1})}),jsxRuntime.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:jsxRuntime.jsx("img",{src:a.cover||Ct,alt:"",className:"h-full w-full object-cover",draggable:false})}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:s("truncate text-xs font-medium",oe?Ee:Ce),children:a.title}),a.artist&&jsxRuntime.jsx("div",{className:s("truncate text-[10px]",re),children:a.artist})]}),o.has(R)&&jsxRuntime.jsx(lucideReact.Heart,{className:"h-3 w-3 shrink-0 text-rose-500",fill:"currentColor"})]},R)})})})})]})})]})}function ut(e){if(!isFinite(e)||e<0)return "0:00";let n=Math.floor(e/3600),i=Math.floor(e%3600/60),g=Math.floor(e%60);return n>0?`${n}:${i.toString().padStart(2,"0")}:${g.toString().padStart(2,"0")}`:`${i}:${g.toString().padStart(2,"0")}`}var vr={title:(e,n)=>e.title.localeCompare(n.title),type:(e,n)=>(e.type??"").localeCompare(n.type??""),duration:(e,n)=>(e.duration??0)-(n.duration??0)};function Tt({playlist:e,initialTrack:n=0,autoPlay:i=false,shuffle:g=false,loop:k=false,onTrackChange:m,onPlayChange:h,accent:D="#8b5cf6",className:S}){let[x,j]=ln.useState(n),[T,N]=ln.useState(false),[w,_]=ln.useState(0),[y,B]=ln.useState(0),[z,G]=ln.useState(0),[A,X]=ln.useState(.8),[I,ge]=ln.useState(false),[d,b]=ln.useState(g),[E,C]=ln.useState(k),[o,L]=ln.useState(false),[K,ne]=ln.useState("title"),[U,be]=ln.useState(true),[V,he]=ln.useState(false),[$e,Se]=ln.useState(false),[ce,ze]=ln.useState(false),[me,Fe]=ln.useState(true),[Pe,F]=ln.useState(false),[ye,ee]=ln.useState(null),Z=ln.useRef(null),te=ln.useRef(null),pe=ln.useRef(void 0),Ne=ln.useRef(false),P=e[x],Ke=ln__default.default.useMemo(()=>{let r=e.map((v,Y)=>({media:v,originalIndex:Y}));return r.sort((v,Y)=>{let a=vr[K](v.media,Y.media);return U?a:-a}),r},[e,K,U]);ln.useEffect(()=>{let r=Z.current;if(!r)return;F(true),r.src=P.src,P.poster&&(r.poster=P.poster),r.load();let v=()=>{F(false),T&&r.play().catch(()=>{});};return r.addEventListener("loadeddata",v,{once:true}),()=>r.removeEventListener("loadeddata",v)},[x,P.src]),ln.useEffect(()=>{if(!i||Ne.current)return;let r=Z.current;if(!r)return;let v=()=>{Ne.current=true,N(true),r.play().catch(()=>{});};return r.addEventListener("canplaythrough",v,{once:true}),()=>r.removeEventListener("canplaythrough",v)},[i]),ln.useEffect(()=>{let r=Z.current;r&&(T?r.play().catch(()=>{}):r.pause(),h?.(T));},[T]),ln.useEffect(()=>{let r=Z.current;r&&(r.volume=I?0:A);},[A,I]),ln.useEffect(()=>{let r=Z.current;if(!r)return;let v=()=>_(r.currentTime),Y=()=>B(r.duration),a=()=>{r.buffered.length>0&&G(r.buffered.end(r.buffered.length-1));},R=()=>{E?(r.currentTime=0,r.play().catch(()=>{})):we();};return r.addEventListener("timeupdate",v),r.addEventListener("loadedmetadata",Y),r.addEventListener("progress",a),r.addEventListener("ended",R),()=>{r.removeEventListener("timeupdate",v),r.removeEventListener("loadedmetadata",Y),r.removeEventListener("progress",a),r.removeEventListener("ended",R);}},[x,e.length,E]);let Q=ln.useCallback(()=>{Fe(true),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{T&&Fe(false);},3e3);},[T]);ln.useEffect(()=>{T?Q():(Fe(true),pe.current&&clearTimeout(pe.current));},[T,Q]),ln.useEffect(()=>()=>{pe.current&&clearTimeout(pe.current);},[]);let de=ln.useCallback(r=>{let v=(r%e.length+e.length)%e.length;j(v),_(0),N(true),m?.(v,e[v]);},[e,m]),we=ln.useCallback(()=>{if(d){let r;do r=Math.floor(Math.random()*e.length);while(r===x&&e.length>1);de(r);}else de(x+1);},[de,x,d,e.length]),Ce=ln.useCallback(()=>{if(d){let r;do r=Math.floor(Math.random()*e.length);while(r===x&&e.length>1);de(r);}else de(x-1);},[de,x,d,e.length]),re=ln.useCallback(r=>{let v=r.currentTarget.getBoundingClientRect(),a=Math.max(0,Math.min(1,(r.clientX-v.left)/v.width))*y;Z.current&&(Z.current.currentTime=a),_(a);},[y]),Ee=ln.useCallback(r=>{let v=r.currentTarget.getBoundingClientRect(),Y=Math.max(0,Math.min(1,(r.clientX-v.left)/v.width));ee(Y*y);},[y]),J=ln.useCallback(()=>{te.current&&(document.fullscreenElement?document.exitFullscreen():te.current.requestFullscreen());},[]);ln.useEffect(()=>{let r=()=>ze(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",r),()=>document.removeEventListener("fullscreenchange",r)},[]);let M=ln.useCallback(()=>{V?(Se(true),setTimeout(()=>{he(false),Se(false);},500)):he(true);},[V]),Te=ln.useCallback(()=>{L(r=>!r);},[]),Ye=ln.useCallback(()=>{let r=["title","type","duration"],v=r.indexOf(K);U?be(false):(be(true),ne(r[(v+1)%r.length]));},[K,U]);ln.useEffect(()=>{let r=v=>{if(!(v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement))switch(v.key){case " ":case "k":v.preventDefault(),N(Y=>!Y);break;case "f":v.preventDefault(),J();break;case "t":v.preventDefault(),M();break;case "ArrowLeft":v.preventDefault(),Z.current&&(Z.current.currentTime=Math.max(0,w-5));break;case "ArrowRight":v.preventDefault(),Z.current&&(Z.current.currentTime=Math.min(y,w+5));break;case "ArrowUp":v.preventDefault(),X(Y=>Math.min(1,Y+.05));break;case "ArrowDown":v.preventDefault(),X(Y=>Math.max(0,Y-.05));break;case "Escape":V&&M();break;case "n":v.preventDefault(),we();break;case "p":v.preventDefault(),Ce();break;case "l":v.preventDefault(),Te();break}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[J,M,Te,we,Ce,w,y,V]);let We=y>0?w/y*100:0,at=y>0?z/y*100:0,le="text-(--accent)",fe=jsxRuntime.jsxs("div",{ref:te,className:s("group flex overflow-hidden",ce?"h-full w-full":"aspect-video w-full",!ce&&"rounded-xl",!ce&&T&&"shadow-2xl",!ce&&!T&&"animate-[cp-glow-pulse_4s_ease-in-out_infinite] will-change-[box-shadow]",S),style:{"--accent":D,background:"var(--cp-bg)"},tabIndex:0,children:[jsxRuntime.jsxs("div",{className:s("relative flex-1 min-w-0 h-full overflow-hidden",Pe&&"animate-[cp-track-transition_0.6s_ease-out]"),onMouseMove:Q,onMouseLeave:()=>{T&&Fe(false);},children:[jsxRuntime.jsx("video",{ref:Z,className:"h-full w-full object-contain",poster:P.poster,playsInline:true,preload:"metadata",onClick:()=>N(r=>!r)}),!T&&!Pe&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>N(true),children:jsxRuntime.jsx("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:jsxRuntime.jsx(lucideReact.Play,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),Pe&&!me&&jsxRuntime.jsx("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:jsxRuntime.jsxs("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:P.title}),P.subtitle&&jsxRuntime.jsx("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:P.subtitle})]})}),jsxRuntime.jsx("div",{className:s("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",me?"opacity-100":"pointer-events-none opacity-0"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:P.title}),P.subtitle&&jsxRuntime.jsx("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:P.subtitle})]}),P.type&&jsxRuntime.jsx("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:P.type})]})}),jsxRuntime.jsxs("div",{className:s("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",me?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:[jsxRuntime.jsxs("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:re,onMouseMove:Ee,onMouseLeave:()=>ee(null),children:[jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${at}%`,background:"var(--cp-seek-buffer)"}}),jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${We}%`}}),ye!==null&&jsxRuntime.jsx("div",{className:"absolute -top-8 -translate-x-1/2 rounded px-2 py-0.5 text-[10px] font-mono",style:{left:`${ye/y*100}%`,background:"var(--cp-panel-bg)",color:"var(--cp-text-strong)"},children:ut(ye)}),jsxRuntime.jsx("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(${We}% - 7px)`}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>N(r=>!r),title:T?"Pause (k)":"Play (k)",children:T?jsxRuntime.jsx(lucideReact.Pause,{className:"h-5 w-5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:Ce,title:"Previous (p)",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:we,title:"Next (n)",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"group/vol ml-1 flex items-center",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>ge(r=>!r),title:I?"Unmute":"Mute",children:I||A===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:I?0:A,onChange:r=>{X(Number(r.target.value)),I&&ge(false);},className:"h-1 w-full cursor-pointer appearance-none rounded-full accent-(--accent)",style:{background:"var(--cp-seek-track)"}})})]}),jsxRuntime.jsxs("span",{className:"ml-2 min-w-0 shrink-0 font-mono text-xs",style:{color:"var(--cp-text-muted)"},children:[ut(w)," / ",ut(y)]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:s("cp-btn",d&&le),onClick:()=>b(r=>!r),title:"Shuffle",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",E&&le),onClick:()=>C(r=>!r),title:"Loop",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",o&&le),onClick:Te,title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListVideo,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:s("cp-btn",V&&le),onClick:M,title:"Cinema mode (t)",children:jsxRuntime.jsx(lucideReact.Theater,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:J,title:"Fullscreen (f)",children:ce?jsxRuntime.jsx(lucideReact.Minimize,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Maximize,{className:"h-4 w-4"})})]})]})]}),jsxRuntime.jsx("div",{className:s("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",o?"w-72":"w-0"),children:jsxRuntime.jsxs("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:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("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:Ye,title:`Sort: ${K} ${U?"\u2191":"\u2193"}`,children:[jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3 w-3"}),K,U?" \u2191":" \u2193"]}),jsxRuntime.jsx("button",{className:"cp-btn p-1!",onClick:Te,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:Ke.map(({media:r,originalIndex:v})=>{let Y=v===x;return jsxRuntime.jsxs("button",{className:s("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-all duration-200",Y?"bg-(--accent)/20 text-(--accent)":"hover:text-(--cp-text-strong)"),style:Y?void 0:{color:"var(--cp-text)"},onClick:()=>{de(v);},children:[jsxRuntime.jsxs("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[r.poster?jsxRuntime.jsx("img",{src:r.poster,alt:"",className:"h-full w-full object-cover",draggable:false}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center",children:jsxRuntime.jsx(lucideReact.Play,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),Y&&T&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:jsxRuntime.jsx("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(a=>jsxRuntime.jsx("div",{className:"w-0.5 rounded-full bg-(--accent)",style:{height:`${6+a*3}px`,animation:`mp-eq-bar ${.3+a*.12}s ease-in-out infinite alternate`}},a))})})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-xs font-medium",children:r.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[r.type&&jsxRuntime.jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:r.type}),r.duration!=null&&jsxRuntime.jsx("span",{className:"font-mono text-[10px] opacity-40",children:ut(r.duration)})]})]}),Y&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},v)})})]})}),jsxRuntime.jsx("style",{children:`
7
7
  .cp-btn {
8
8
  display: flex;
9
9
  align-items: center;
@@ -19,7 +19,7 @@
19
19
  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); }
20
20
  50% { box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 55%, transparent), 0 25px 50px -12px rgba(0,0,0,0.25); }
21
21
  }
22
- `})]});return jsxRuntime.jsx("div",{className:s(I&&"fixed inset-0 z-100 flex items-center justify-center p-8",I&&($e?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:I?n=>{n.target===n.currentTarget&&N();}:void 0,children:jsxRuntime.jsx("div",{className:s(I&&"w-full",I&&!ce&&"max-w-5xl"),children:fe})})}var Ct=classVarianceAuthority.cva("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"}});classVarianceAuthority.cva("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"}});var He=[];function vr(e){He.push(e);}function yr(e){let o=He.indexOf(e);o!==-1&&He.splice(o,1);}function Et(e){return He.length>0&&He[He.length-1]===e}function wr(e){let o=He.indexOf(e);return o!==-1?o:He.length}var Gt=rn.createContext(null);function qt({open:e,onOpenChange:o,modal:l=true,closeOnOutsideClick:g=false,children:w}){let f=rn.useId();return rn.useEffect(()=>{if(e)return vr(f),()=>yr(f)},[e,f]),rn.useEffect(()=>{if(!e||!l)return;let v=z=>{z.key==="Escape"&&Et(f)&&o(false);};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,l,o,f]),rn.useEffect(()=>{if(!e||!l)return;let v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=v;}},[e,l]),e?jsxRuntime.jsx(Gt.Provider,{value:{id:f,onOpenChange:o,modal:l,closeOnOutsideClick:g},children:reactDom.createPortal(w,document.body)}):null}function Zt({size:e,position:o="center",className:l,children:g,...w}){let f=rn.useContext(Gt);if(!f)return null;let z=200+wr(f.id)*10,F=()=>{f.closeOnOutsideClick&&Et(f.id)&&f.onOpenChange(false);},x=o==="bottom";return f.modal?jsxRuntime.jsx("div",{className:s("animate-fade-in fixed inset-0 bg-black/50",x?"flex items-end justify-center":"flex items-center justify-center p-4"),style:{zIndex:z},onClick:F,children:jsxRuntime.jsx("div",{className:s(Ct({size:e}),x?"animate-slide-in-bottom w-full rounded-b-none rounded-t-(--dialog-sheet-radius) max-h-[85vh] overflow-y-auto":"animate-scale-in",l),role:"dialog","aria-modal":"true",onClick:_=>_.stopPropagation(),...w,children:g})}):jsxRuntime.jsx("div",{className:s("fixed inset-0 flex items-center justify-center p-4",f.closeOnOutsideClick?"pointer-events-auto":"pointer-events-none"),style:{zIndex:z},onClick:f.closeOnOutsideClick&&Et(f.id)?()=>f.onOpenChange(false):void 0,children:jsxRuntime.jsx("div",{className:s(Ct({size:e}),"animate-scale-in pointer-events-auto shadow-2xl",l),role:"dialog",onClick:f.closeOnOutsideClick?_=>_.stopPropagation():void 0,...w,children:g})})}function Qt({className:e,...o}){return jsxRuntime.jsx("div",{className:s("mb-4 space-y-1",e),...o})}function Jt({className:e,...o}){return jsxRuntime.jsx("h2",{className:s("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),...o})}function en({className:e,...o}){return jsxRuntime.jsx("p",{className:s("text-primary-500 dark:text-primary-400 text-sm",e),...o})}function tn({className:e,...o}){return jsxRuntime.jsx("div",{className:s("mt-6 flex justify-end gap-2",e),...o})}var nn=classVarianceAuthority.cva("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"}});classVarianceAuthority.cva("inline-flex items-center gap-1 rounded border font-semibold [&_svg]:shrink-0",{variants:{intent:{success:"border-success-200 bg-success-100 text-success-800 dark:border-success-800 dark:bg-success-900/30 dark:text-success-400",warning:"border-warning-200 bg-warning-100 text-warning-800 dark:border-warning-800 dark:bg-warning-900/30 dark:text-warning-400",error:"border-danger-200 bg-danger-100 text-danger-800 dark:border-danger-800 dark:bg-danger-900/30 dark:text-danger-400",info:"border-primary-200 bg-primary-100 text-primary-800 dark:border-primary-800 dark:bg-primary-900/30 dark:text-primary-400",primary:"border-secondary-200 bg-secondary-100 text-secondary-700 dark:border-secondary-700 dark:bg-secondary-800 dark:text-secondary-300"},size:{sm:"px-1.5 py-0 text-[0.625rem] [&_svg]:h-2.5 [&_svg]:w-2.5",md:"px-2.5 py-0.5 text-xs [&_svg]:h-3 [&_svg]:w-3",lg:"px-3 py-1 text-sm [&_svg]:h-3.5 [&_svg]:w-3.5"}},defaultVariants:{intent:"primary",size:"md"}});classVarianceAuthority.cva("absolute flex items-center justify-center rounded-full font-bold leading-none ring-2 ring-white select-none pointer-events-none z-10 dark:ring-primary-900",{variants:{intent:{danger:"bg-danger-500 text-white",success:"bg-success-500 text-white",warning:"bg-warning-500 text-white",info:"bg-primary-500 text-white",primary:"bg-secondary-500 text-white"},size:{sm:"text-[0.5rem]",md:"text-[0.625rem]",lg:"text-xs"},dot:{true:"",false:""},placement:{"top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2","top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2"}},compoundVariants:[{dot:true,size:"sm",class:"h-1.5 w-1.5 min-w-0 ring-1"},{dot:true,size:"md",class:"h-2 w-2 min-w-0"},{dot:true,size:"lg",class:"h-2.5 w-2.5 min-w-0"},{dot:false,size:"sm",class:"h-4 min-w-4 px-1"},{dot:false,size:"md",class:"h-5 min-w-5 px-1.5"},{dot:false,size:"lg",class:"h-6 min-w-6 px-2"}],defaultVariants:{intent:"danger",size:"md",dot:false,placement:"top-right"}});classVarianceAuthority.cva("w-full rounded-md border bg-white text-secondary-900 transition-colors placeholder:text-secondary-400 focus:outline-none focus:ring-2 dark:bg-secondary-900 dark:text-secondary-100 dark:placeholder:text-secondary-600",{variants:{state:{default:"border-secondary-300 focus:border-primary-500 focus:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus:border-danger-500 focus:ring-danger-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"}});classVarianceAuthority.cva("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"}});classVarianceAuthority.cva("relative inline-flex shrink-0 items-center justify-center rounded border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4 rounded-[3px]",md:"h-5 w-5 rounded",lg:"h-6 w-6 rounded-[5px]"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});classVarianceAuthority.cva("relative inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});classVarianceAuthority.cva("",{variants:{intent:{primary:"",secondary:"",danger:"",warning:"",success:""},size:{sm:"",md:"",lg:""},checked:{on:"",off:"bg-primary-300 dark:bg-primary-800"}},compoundVariants:[{intent:"primary",checked:"on",class:"bg-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"bg-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"bg-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"bg-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"bg-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});function Lt({intent:e,size:o,className:l,...g}){return jsxRuntime.jsx("button",{className:s(nn({intent:e,size:o}),l),...g})}function mt(e){let o=e.lastIndexOf(".");return o>0?e.slice(o).toLowerCase():""}function ln(e){return e==null?"\u2014":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function Tt(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}var Ar={".png":lucideReact.Image,".jpg":lucideReact.Image,".jpeg":lucideReact.Image,".gif":lucideReact.Image,".svg":lucideReact.Image,".webp":lucideReact.Image,".ico":lucideReact.Image,".bmp":lucideReact.Image,".mp3":lucideReact.Music,".wav":lucideReact.Music,".flac":lucideReact.Music,".ogg":lucideReact.Music,".aac":lucideReact.Music,".m4a":lucideReact.Music,".mp4":lucideReact.Video,".mkv":lucideReact.Video,".avi":lucideReact.Video,".mov":lucideReact.Video,".wmv":lucideReact.Video,".webm":lucideReact.Video,".ts":lucideReact.FileCode,".tsx":lucideReact.FileCode,".js":lucideReact.FileCode,".jsx":lucideReact.FileCode,".json":lucideReact.FileCode,".html":lucideReact.FileCode,".css":lucideReact.FileCode,".scss":lucideReact.FileCode,".py":lucideReact.FileCode,".rs":lucideReact.FileCode,".go":lucideReact.FileCode,".java":lucideReact.FileCode,".c":lucideReact.FileCode,".cpp":lucideReact.FileCode,".h":lucideReact.FileCode,".sh":lucideReact.Terminal,".bat":lucideReact.Terminal,".ps1":lucideReact.Terminal,".md":lucideReact.FileText,".txt":lucideReact.FileText,".pdf":lucideReact.FileText,".doc":lucideReact.FileText,".docx":lucideReact.FileText,".rtf":lucideReact.FileText,".csv":lucideReact.FileSpreadsheet,".xls":lucideReact.FileSpreadsheet,".xlsx":lucideReact.FileSpreadsheet,".db":lucideReact.Database,".sqlite":lucideReact.Database,".sql":lucideReact.Database,".zip":lucideReact.FileArchive,".tar":lucideReact.FileArchive,".gz":lucideReact.FileArchive,".rar":lucideReact.FileArchive,".7z":lucideReact.FileArchive};function Rt(e){if(e.type==="directory")return lucideReact.Folder;let o=e.extension||mt(e.name);return Ar[o]||lucideReact.File}function rt(e,o,l){return Math.max(o,Math.min(l,e))}function cn(e){return e<480?"xs":e<640?"sm":e<1024?"md":"lg"}function dn(e,o){if(e<480)return {size:{width:e-16,height:o-48},pos:{x:8,y:24}};if(e<640){let w=e-24,f=Math.min(o-64,540);return {size:{width:w,height:f},pos:{x:12,y:32}}}if(e<1024){let w=Math.min(640,e-32),f=Math.min(480,o-64);return {size:{width:w,height:f},pos:{x:Math.max(0,Math.round((e-w)/2)),y:Math.max(0,Math.round((o-f)/2))}}}let l=720,g=520;return {size:{width:l,height:g},pos:{x:Math.max(0,Math.round((e-l)/2)),y:Math.max(0,Math.round((o-g)/2))}}}function zt({files:e,title:o="File Explorer",accent:l="#8b5cf6",defaultView:g="list",initialPosition:w,initialSize:f,dockable:v=false,dockSide:z="right",visible:F=true,onFileOpen:x,onSelectionChange:_,onNavigate:D,onDelete:L,onClose:k,onMinimize:G,onPathSubmit:y,defaultInputMode:ee="search",actions:A,resizable:ne=true,minSize:$={width:400,height:300},className:K}){let[j,Me]=rn.useState(g),[u,b]=rn.useState(new Set),[C,S]=rn.useState(null),[a,O]=rn.useState(false),[Y,ie]=rn.useState(false),[q,ge]=rn.useState(""),[I,be]=rn.useState(ee),[$e,Re]=rn.useState(F),[ce,ze]=rn.useState(false),[me,Fe]=rn.useState({w:window.innerWidth,h:window.innerHeight}),De=dn(window.innerWidth,window.innerHeight),[P,ve]=rn.useState(w??De.pos),[Q,W]=rn.useState(f??De.size),[J,pe]=rn.useState(null),ke=rn.useRef(false),M=rn.useRef({x:0,y:0}),Ke=rn.useRef(null),U=rn.useRef(false),de=rn.useRef({x:0,y:0,w:0,h:0,px:0,py:0}),ye=rn.useRef(false),Ne=rn.useRef(a);rn.useEffect(()=>{Ne.current=a;},[a]);let te=F!==void 0?F:$e,Ee=rn.useMemo(()=>{let t=e.filter(T=>T.type==="directory"),m=e.filter(T=>T.type==="file");return t.sort((T,R)=>T.name.localeCompare(R.name)),m.sort((T,R)=>T.name.localeCompare(R.name)),[...t,...m]},[e]),Z=rn.useMemo(()=>{if(I!=="search"||!q.trim())return Ee;let t=q.toLowerCase();return Ee.filter(m=>m.name.toLowerCase().includes(t))},[Ee,q,I]),N=C!=null?Z[C]:null;rn.useEffect(()=>{let t=cn(window.innerWidth),m=()=>{let T=window.innerWidth,R=window.innerHeight;if(Fe({w:T,h:R}),Ne.current)return;let X=cn(T);if(X!==t&&!ye.current&&!f){let we=dn(T,R);W(we.size),ve(we.pos);}t=X;};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[f]);let Le=rn.useCallback((t,m)=>{b(T=>{let R=new Set(T);return m.ctrlKey||m.metaKey?R.has(t)?R.delete(t):R.add(t):(R.clear(),R.add(t)),R}),S(t);},[]);rn.useEffect(()=>{if(!_)return;let t=Array.from(u).map(m=>Z[m]).filter(Boolean);_(t);},[u]);let Ye=rn.useCallback(t=>{let m=Z[t];m&&(m.type==="directory"?D?.(m.path):x?.(m));},[Z,x,D]),We=rn.useCallback(t=>{a||t.target.closest("button")||(ye.current=true,ke.current=true,M.current={x:t.clientX-P.x,y:t.clientY-P.y},t.preventDefault());},[P,a]),at=rn.useCallback(t=>{if(a||t.target.closest("button"))return;ye.current=true;let m=t.touches[0];ke.current=true,M.current={x:m.clientX-P.x,y:m.clientY-P.y};},[P,a]);rn.useEffect(()=>{let t=R=>{if(!ke.current)return;let X=window.innerWidth-100,we=window.innerHeight-40;ve({x:rt(R.clientX-M.current.x,0,X),y:rt(R.clientY-M.current.y,0,we)});},m=R=>{if(!ke.current)return;R.preventDefault();let X=R.touches[0],we=window.innerWidth-100,je=window.innerHeight-40;ve({x:rt(X.clientX-M.current.x,0,we),y:rt(X.clientY-M.current.y,0,je)});},T=()=>{ke.current=false,U.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",T),window.addEventListener("touchmove",m,{passive:false}),window.addEventListener("touchend",T),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",T),window.removeEventListener("touchmove",m),window.removeEventListener("touchend",T);}},[]);let le=rn.useCallback((t,m)=>{a||(m.preventDefault(),m.stopPropagation(),ye.current=true,U.current=t,de.current={x:m.clientX,y:m.clientY,w:Q.width,h:Q.height,px:P.x,py:P.y},document.body.style.cursor=t==="e"||t==="w"?"ew-resize":t==="n"||t==="s"?"ns-resize":t==="nw"||t==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[a,Q,P]),fe=rn.useCallback((t,m)=>{if(a)return;m.preventDefault(),m.stopPropagation(),ye.current=true;let T=m.touches[0];U.current=t,de.current={x:T.clientX,y:T.clientY,w:Q.width,h:Q.height,px:P.x,py:P.y},document.body.style.userSelect="none";},[a,Q,P]);rn.useEffect(()=>{let t=(X,we)=>{let je=U.current;if(!je)return;let Ot=X-de.current.x,_t=we-de.current.y,{w:Ue,h:Ge,px:gt,py:bt}=de.current;if(je.includes("e")&&(Ue=Math.max($.width,Ue+Ot)),je.includes("w")){let st=Math.max($.width,Ue-Ot);gt=gt+(Ue-st),Ue=st;}if(je.includes("s")&&(Ge=Math.max($.height,Ge+_t)),je.includes("n")){let st=Math.max($.height,Ge-_t);bt=bt+(Ge-st),Ge=st;}W({width:Ue,height:Ge}),ve({x:gt,y:bt});},m=X=>{U.current&&t(X.clientX,X.clientY);},T=X=>{U.current&&(X.preventDefault(),t(X.touches[0].clientX,X.touches[0].clientY));},R=()=>{U.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",m),window.addEventListener("mouseup",R),window.addEventListener("touchmove",T,{passive:false}),window.addEventListener("touchend",R),()=>{window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",R),window.removeEventListener("touchmove",T),window.removeEventListener("touchend",R);}},[$]);let n=rn.useCallback(()=>{a?(J&&(ve(J.pos),W(J.size)),O(false)):(pe({pos:P,size:Q}),O(true));},[a,P,Q,J]),h=rn.useCallback(()=>{Y?ie(false):(a&&(O(false),J&&(ve(J.pos),W(J.size))),ie(true),G?.());},[Y,a,J,G]);rn.useEffect(()=>{if(!te||Y)return;let t=m=>{if(!(!Ke.current?.contains(document.activeElement)&&document.activeElement!==Ke.current)){if(m.key==="Escape"&&(S(null),b(new Set)),m.ctrlKey&&m.key==="a"){m.preventDefault();let T=new Set(Z.map((R,X)=>X));b(T);}m.key==="Delete"&&u.size>0&&L&&(m.preventDefault(),ze(true));}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[te,Y,Z,u,L]);let V={"--fe-accent":l};if(Y)return jsxRuntime.jsx("div",{className:s("fixed z-100 cursor-pointer transition-all duration-300",z==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:V,onClick:()=>ie(false),title:`Restore ${o}`,children:jsxRuntime.jsxs("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:[jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:o})]})});if(!te)return null;let r=a?me.w:Math.min(Q.width,me.w-8),E=a?me.h:Math.min(Q.height,me.h-8),re=a?0:rt(P.x,0,Math.max(0,me.w-r)),Ce=a?0:rt(P.y,0,Math.max(0,me.h-40)),ft=r<500;return jsxRuntime.jsxs("div",{ref:Ke,className:s("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]",a&&"rounded-none",K),style:{...V,left:re,top:Ce,width:r,height:E,transition:a?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxRuntime.jsxs("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:We,onTouchStart:at,onDoubleClick:n,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:o}),jsxRuntime.jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:"fe-btn mr-1",onClick:()=>Me(t=>t==="list"?"grid":"list"),title:j==="list"?"Grid view":"List view",children:j==="list"?jsxRuntime.jsx(lucideReact.LayoutGrid,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.LayoutList,{className:"h-3.5 w-3.5"})}),v&&jsxRuntime.jsx("button",{className:"fe-btn",onClick:h,title:"Dock to edge",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn",onClick:n,title:a?"Restore":"Maximize",children:a?jsxRuntime.jsx(lucideReact.Minimize2,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{k?.(),Re(false);},title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsxRuntime.jsx("button",{className:"fe-btn p-1",onClick:()=>D?.(".."),title:"Go up",children:jsxRuntime.jsx(lucideReact.FolderUp,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:I==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>be(t=>t==="search"?"navigate":"search"),title:I==="search"?"Switch to path navigation":"Switch to file search",children:I==="search"?jsxRuntime.jsx(lucideReact.Search,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.CornerRightDown,{className:"h-3 w-3"})}),jsxRuntime.jsx("div",{className:"relative flex-1",children:jsxRuntime.jsx("input",{type:"text",value:q,onChange:t=>ge(t.target.value),onKeyDown:t=>{t.key==="Enter"&&q.trim()&&I==="navigate"&&(y?y(q.trim()):D?.(q.trim()));},placeholder:I==="search"?"Search files\u2026":"Enter path and press Enter\u2026",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)"})}),jsxRuntime.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[Z.length," item",Z.length!==1?"s":"",u.size>0&&` \xB7 ${u.size} selected`]})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-1 min-h-0",children:[jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:t=>{t.target===t.currentTarget&&(b(new Set),S(null));},children:Z.length===0?jsxRuntime.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsxRuntime.jsx(lucideReact.Folder,{className:"mb-2 h-10 w-10"}),jsxRuntime.jsx("span",{className:"text-xs",children:"No files found"})]}):j==="list"?jsxRuntime.jsx("div",{className:"space-y-px",children:Z.map((t,m)=>{let T=Rt(t),R=u.has(m),X=t.extension||mt(t.name);return jsxRuntime.jsxs("div",{className:s("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",R?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:R?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:we=>Le(m,we),onDoubleClick:()=>Ye(m),children:[jsxRuntime.jsx(T,{className:s("h-4 w-4 shrink-0",t.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:t.name}),X&&t.type==="file"&&jsxRuntime.jsx("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:X}),t.size!=null&&jsxRuntime.jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:ln(t.size)}),t.modifiedAt&&jsxRuntime.jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:Tt(t.modifiedAt)})]},t.path+m)})}):jsxRuntime.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:Z.map((t,m)=>{let T=Rt(t),R=u.has(m),X=t.extension||mt(t.name);return jsxRuntime.jsxs("div",{className:s("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",R?"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:we=>Le(m,we),onDoubleClick:()=>Ye(m),children:[jsxRuntime.jsx(T,{className:s("h-7 w-7",t.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:t.name}),X&&t.type==="file"&&jsxRuntime.jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:X})]},t.path+m)})})}),jsxRuntime.jsx("div",{className:s("overflow-hidden transition-[width,opacity] duration-300 ease-out",ft?s("absolute right-0 top-0 bottom-0 z-10",N?"w-44 opacity-100":"w-0 opacity-0 pointer-events-none"):s("shrink-0",N?"w-56":"w-0")),children:N&&jsxRuntime.jsxs("div",{className:s("flex h-full flex-col p-4",ft?"fe-panel-narrow w-44":"fe-panel w-56 border-l border-(--fe-border)"),children:[ft&&jsxRuntime.jsx("button",{className:"fe-btn mb-2 self-end",onClick:()=>{S(null),b(new Set);},title:"Close panel",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsxs("div",{className:"mb-3 flex flex-col items-center",children:[rn__default.default.createElement(Rt(N),{className:s("h-10 w-10 mb-2",N.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:N.name})]}),jsxRuntime.jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsxRuntime.jsx(ot,{label:"Type",value:N.type==="directory"?"Directory":N.mimeType||N.extension||mt(N.name)||"File"}),N.size!=null&&jsxRuntime.jsx(ot,{label:"Size",value:ln(N.size)}),jsxRuntime.jsx(ot,{label:"Path",value:N.path,mono:true}),N.extension&&jsxRuntime.jsx(ot,{label:"Extension",value:N.extension}),N.modifiedAt&&jsxRuntime.jsx(ot,{label:"Modified",value:Tt(N.modifiedAt)}),N.createdAt&&jsxRuntime.jsx(ot,{label:"Created",value:Tt(N.createdAt)})]}),jsxRuntime.jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[N.type==="file"&&x&&jsxRuntime.jsxs("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:()=>x(N),children:[jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),A?.map(t=>jsxRuntime.jsxs("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:()=>t.onClick(N),children:[t.icon&&rn__default.default.createElement(t.icon,{className:"h-3 w-3"}),t.label]},t.key))]})]})})]}),jsxRuntime.jsxs("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[jsxRuntime.jsxs("span",{children:[Z.length," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[u.size>0&&jsxRuntime.jsxs("span",{className:"text-(--fe-accent)/70",children:[u.size," selected"]}),jsxRuntime.jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),ne&&!a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:t=>le("n",t),onTouchStart:t=>fe("n",t)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:t=>le("s",t),onTouchStart:t=>fe("s",t)}),jsxRuntime.jsx("div",{className:"absolute top-4 left-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:t=>le("w",t),onTouchStart:t=>fe("w",t)}),jsxRuntime.jsx("div",{className:"absolute top-4 right-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:t=>le("e",t),onTouchStart:t=>fe("e",t)}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 h-6 w-6 cursor-nwse-resize",onMouseDown:t=>le("nw",t),onTouchStart:t=>fe("nw",t)}),jsxRuntime.jsx("div",{className:"absolute top-0 right-0 h-6 w-6 cursor-nesw-resize",onMouseDown:t=>le("ne",t),onTouchStart:t=>fe("ne",t)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-6 w-6 cursor-nesw-resize",onMouseDown:t=>le("sw",t),onTouchStart:t=>fe("sw",t)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 right-0 h-6 w-6 cursor-nwse-resize",onMouseDown:t=>le("se",t),onTouchStart:t=>fe("se",t)})]}),jsxRuntime.jsx("style",{children:`
22
+ `})]});return jsxRuntime.jsx("div",{className:s(V&&"fixed inset-0 z-100 flex items-center justify-center p-8",V&&($e?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:V?r=>{r.target===r.currentTarget&&M();}:void 0,children:jsxRuntime.jsx("div",{className:s(V&&"w-full",V&&!ce&&"max-w-5xl"),children:fe})})}var Lt=classVarianceAuthority.cva("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"}});classVarianceAuthority.cva("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"}});var He=[];function Cr(e){He.push(e);}function Mr(e){let n=He.indexOf(e);n!==-1&&He.splice(n,1);}function Rt(e){return He.length>0&&He[He.length-1]===e}function Er(e){let n=He.indexOf(e);return n!==-1?n:He.length}var Jt=ln.createContext(null);function en({open:e,onOpenChange:n,modal:i=true,closeOnOutsideClick:g=false,children:k}){let m=ln.useId();return ln.useEffect(()=>{if(e)return Cr(m),()=>Mr(m)},[e,m]),ln.useEffect(()=>{if(!e||!i)return;let h=D=>{D.key==="Escape"&&Rt(m)&&n(false);};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,i,n,m]),ln.useEffect(()=>{if(!e||!i)return;let h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h;}},[e,i]),e?jsxRuntime.jsx(Jt.Provider,{value:{id:m,onOpenChange:n,modal:i,closeOnOutsideClick:g},children:reactDom.createPortal(k,document.body)}):null}function tn({size:e,position:n="center",className:i,children:g,...k}){let m=ln.useContext(Jt);if(!m)return null;let D=200+Er(m.id)*10,S=()=>{m.closeOnOutsideClick&&Rt(m.id)&&m.onOpenChange(false);},x=n==="bottom";return m.modal?jsxRuntime.jsx("div",{className:s("animate-fade-in fixed inset-0 bg-black/50",x?"flex items-end justify-center":"flex items-center justify-center p-4"),style:{zIndex:D},onClick:S,children:jsxRuntime.jsx("div",{className:s(Lt({size:e}),x?"animate-slide-in-bottom w-full rounded-b-none rounded-t-(--dialog-sheet-radius) max-h-[85vh] overflow-y-auto":"animate-scale-in",i),role:"dialog","aria-modal":"true",onClick:j=>j.stopPropagation(),...k,children:g})}):jsxRuntime.jsx("div",{className:s("fixed inset-0 flex items-center justify-center p-4",m.closeOnOutsideClick?"pointer-events-auto":"pointer-events-none"),style:{zIndex:D},onClick:m.closeOnOutsideClick&&Rt(m.id)?()=>m.onOpenChange(false):void 0,children:jsxRuntime.jsx("div",{className:s(Lt({size:e}),"animate-scale-in pointer-events-auto shadow-2xl",i),role:"dialog",onClick:m.closeOnOutsideClick?j=>j.stopPropagation():void 0,...k,children:g})})}function nn({className:e,...n}){return jsxRuntime.jsx("div",{className:s("mb-4 space-y-1",e),...n})}function rn({className:e,...n}){return jsxRuntime.jsx("h2",{className:s("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),...n})}function on({className:e,...n}){return jsxRuntime.jsx("p",{className:s("text-primary-500 dark:text-primary-400 text-sm",e),...n})}function an({className:e,...n}){return jsxRuntime.jsx("div",{className:s("mt-6 flex justify-end gap-2",e),...n})}var sn=classVarianceAuthority.cva("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"}});classVarianceAuthority.cva("inline-flex items-center gap-1 rounded border font-semibold [&_svg]:shrink-0",{variants:{intent:{success:"border-success-200 bg-success-100 text-success-800 dark:border-success-800 dark:bg-success-900/30 dark:text-success-400",warning:"border-warning-200 bg-warning-100 text-warning-800 dark:border-warning-800 dark:bg-warning-900/30 dark:text-warning-400",error:"border-danger-200 bg-danger-100 text-danger-800 dark:border-danger-800 dark:bg-danger-900/30 dark:text-danger-400",info:"border-primary-200 bg-primary-100 text-primary-800 dark:border-primary-800 dark:bg-primary-900/30 dark:text-primary-400",primary:"border-secondary-200 bg-secondary-100 text-secondary-700 dark:border-secondary-700 dark:bg-secondary-800 dark:text-secondary-300"},size:{sm:"px-1.5 py-0 text-[0.625rem] [&_svg]:h-2.5 [&_svg]:w-2.5",md:"px-2.5 py-0.5 text-xs [&_svg]:h-3 [&_svg]:w-3",lg:"px-3 py-1 text-sm [&_svg]:h-3.5 [&_svg]:w-3.5"}},defaultVariants:{intent:"primary",size:"md"}});classVarianceAuthority.cva("absolute flex items-center justify-center rounded-full font-bold leading-none ring-2 ring-white select-none pointer-events-none z-10 dark:ring-primary-900",{variants:{intent:{danger:"bg-danger-500 text-white",success:"bg-success-500 text-white",warning:"bg-warning-500 text-white",info:"bg-primary-500 text-white",primary:"bg-secondary-500 text-white"},size:{sm:"text-[0.5rem]",md:"text-[0.625rem]",lg:"text-xs"},dot:{true:"",false:""},placement:{"top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2","top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2"}},compoundVariants:[{dot:true,size:"sm",class:"h-1.5 w-1.5 min-w-0 ring-1"},{dot:true,size:"md",class:"h-2 w-2 min-w-0"},{dot:true,size:"lg",class:"h-2.5 w-2.5 min-w-0"},{dot:false,size:"sm",class:"h-4 min-w-4 px-1"},{dot:false,size:"md",class:"h-5 min-w-5 px-1.5"},{dot:false,size:"lg",class:"h-6 min-w-6 px-2"}],defaultVariants:{intent:"danger",size:"md",dot:false,placement:"top-right"}});classVarianceAuthority.cva("w-full rounded-md border bg-white text-secondary-900 transition-colors placeholder:text-secondary-400 focus:outline-none focus:ring-2 dark:bg-secondary-900 dark:text-secondary-100 dark:placeholder:text-secondary-600",{variants:{state:{default:"border-secondary-300 focus:border-primary-500 focus:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus:border-danger-500 focus:ring-danger-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"}});classVarianceAuthority.cva("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"}});classVarianceAuthority.cva("relative inline-flex shrink-0 items-center justify-center rounded border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4 rounded-[3px]",md:"h-5 w-5 rounded",lg:"h-6 w-6 rounded-[5px]"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});classVarianceAuthority.cva("relative inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});classVarianceAuthority.cva("",{variants:{intent:{primary:"",secondary:"",danger:"",warning:"",success:""},size:{sm:"",md:"",lg:""},checked:{on:"",off:"bg-primary-300 dark:bg-primary-800"}},compoundVariants:[{intent:"primary",checked:"on",class:"bg-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"bg-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"bg-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"bg-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"bg-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});function Dt({intent:e,size:n,className:i,...g}){return jsxRuntime.jsx("button",{className:s(sn({intent:e,size:n}),i),...g})}function mt(e){let n=e.lastIndexOf(".");return n>0?e.slice(n).toLowerCase():""}function mn(e){return e==null?"\u2014":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function At(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}var Vr={".png":lucideReact.Image,".jpg":lucideReact.Image,".jpeg":lucideReact.Image,".gif":lucideReact.Image,".svg":lucideReact.Image,".webp":lucideReact.Image,".ico":lucideReact.Image,".bmp":lucideReact.Image,".mp3":lucideReact.Music,".wav":lucideReact.Music,".flac":lucideReact.Music,".ogg":lucideReact.Music,".aac":lucideReact.Music,".m4a":lucideReact.Music,".mp4":lucideReact.Video,".mkv":lucideReact.Video,".avi":lucideReact.Video,".mov":lucideReact.Video,".wmv":lucideReact.Video,".webm":lucideReact.Video,".ts":lucideReact.FileCode,".tsx":lucideReact.FileCode,".js":lucideReact.FileCode,".jsx":lucideReact.FileCode,".json":lucideReact.FileCode,".html":lucideReact.FileCode,".css":lucideReact.FileCode,".scss":lucideReact.FileCode,".py":lucideReact.FileCode,".rs":lucideReact.FileCode,".go":lucideReact.FileCode,".java":lucideReact.FileCode,".c":lucideReact.FileCode,".cpp":lucideReact.FileCode,".h":lucideReact.FileCode,".sh":lucideReact.Terminal,".bat":lucideReact.Terminal,".ps1":lucideReact.Terminal,".md":lucideReact.FileText,".txt":lucideReact.FileText,".pdf":lucideReact.FileText,".doc":lucideReact.FileText,".docx":lucideReact.FileText,".rtf":lucideReact.FileText,".csv":lucideReact.FileSpreadsheet,".xls":lucideReact.FileSpreadsheet,".xlsx":lucideReact.FileSpreadsheet,".db":lucideReact.Database,".sqlite":lucideReact.Database,".sql":lucideReact.Database,".zip":lucideReact.FileArchive,".tar":lucideReact.FileArchive,".gz":lucideReact.FileArchive,".rar":lucideReact.FileArchive,".7z":lucideReact.FileArchive};function It(e){if(e.type==="directory")return lucideReact.Folder;let n=e.extension||mt(e.name);return Vr[n]||lucideReact.File}function rt(e,n,i){return Math.max(n,Math.min(i,e))}function pn(e){return e<480?"xs":e<640?"sm":e<1024?"md":"lg"}function fn(e,n){if(e<480)return {size:{width:e-16,height:n-48},pos:{x:8,y:24}};if(e<640){let k=e-24,m=Math.min(n-64,540);return {size:{width:k,height:m},pos:{x:12,y:32}}}if(e<1024){let k=Math.min(640,e-32),m=Math.min(480,n-64);return {size:{width:k,height:m},pos:{x:Math.max(0,Math.round((e-k)/2)),y:Math.max(0,Math.round((n-m)/2))}}}let i=720,g=520;return {size:{width:i,height:g},pos:{x:Math.max(0,Math.round((e-i)/2)),y:Math.max(0,Math.round((n-g)/2))}}}function Ht({files:e,title:n="File Explorer",accent:i="#8b5cf6",defaultView:g="list",initialPosition:k,initialSize:m,dockable:h=false,dockSide:D="right",visible:S=true,onFileOpen:x,onSelectionChange:j,onNavigate:T,onDelete:N,onClose:w,onMinimize:_,onPathSubmit:y,defaultInputMode:B="search",actions:z,resizable:G=true,minSize:A={width:400,height:300},className:X}){let[I,ge]=ln.useState(g),[d,b]=ln.useState(new Set),[E,C]=ln.useState(null),[o,L]=ln.useState(false),[K,ne]=ln.useState(false),[U,be]=ln.useState(""),[V,he]=ln.useState(B),[$e,Se]=ln.useState(S),[ce,ze]=ln.useState(false),[me,Fe]=ln.useState({w:window.innerWidth,h:window.innerHeight}),Pe=fn(window.innerWidth,window.innerHeight),[F,ye]=ln.useState(k??Pe.pos),[ee,Z]=ln.useState(m??Pe.size),[te,pe]=ln.useState(null),Ne=ln.useRef(false),P=ln.useRef({x:0,y:0}),Ke=ln.useRef(null),Q=ln.useRef(false),de=ln.useRef({x:0,y:0,w:0,h:0,px:0,py:0}),we=ln.useRef(false),Ce=ln.useRef(o);ln.useEffect(()=>{Ce.current=o;},[o]);let re=S!==void 0?S:$e,Ee=ln.useMemo(()=>{let t=e.filter(H=>H.type==="directory"),p=e.filter(H=>H.type==="file");return t.sort((H,O)=>H.name.localeCompare(O.name)),p.sort((H,O)=>H.name.localeCompare(O.name)),[...t,...p]},[e]),J=ln.useMemo(()=>{if(V!=="search"||!U.trim())return Ee;let t=U.toLowerCase();return Ee.filter(p=>p.name.toLowerCase().includes(t))},[Ee,U,V]),M=E!=null?J[E]:null;ln.useEffect(()=>{let t=pn(window.innerWidth),p=()=>{let H=window.innerWidth,O=window.innerHeight;if(Fe({w:H,h:O}),Ce.current)return;let q=pn(H);if(q!==t&&!we.current&&!m){let ke=fn(H,O);Z(ke.size),ye(ke.pos);}t=q;};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[m]);let Te=ln.useCallback((t,p)=>{b(H=>{let O=new Set(H);return p.ctrlKey||p.metaKey?O.has(t)?O.delete(t):O.add(t):(O.clear(),O.add(t)),O}),C(t);},[]);ln.useEffect(()=>{if(!j)return;let t=Array.from(d).map(p=>J[p]).filter(Boolean);j(t);},[d]);let Ye=ln.useCallback(t=>{let p=J[t];p&&(p.type==="directory"?T?.(p.path):x?.(p));},[J,x,T]),We=ln.useCallback(t=>{o||t.target.closest("button")||(we.current=true,Ne.current=true,P.current={x:t.clientX-F.x,y:t.clientY-F.y},t.preventDefault());},[F,o]),at=ln.useCallback(t=>{if(o||t.target.closest("button"))return;we.current=true;let p=t.touches[0];Ne.current=true,P.current={x:p.clientX-F.x,y:p.clientY-F.y};},[F,o]);ln.useEffect(()=>{let t=O=>{if(!Ne.current)return;let q=window.innerWidth-100,ke=window.innerHeight-40;ye({x:rt(O.clientX-P.current.x,0,q),y:rt(O.clientY-P.current.y,0,ke)});},p=O=>{if(!Ne.current)return;O.preventDefault();let q=O.touches[0],ke=window.innerWidth-100,je=window.innerHeight-40;ye({x:rt(q.clientX-P.current.x,0,ke),y:rt(q.clientY-P.current.y,0,je)});},H=()=>{Ne.current=false,Q.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",H),window.addEventListener("touchmove",p,{passive:false}),window.addEventListener("touchend",H),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",H),window.removeEventListener("touchmove",p),window.removeEventListener("touchend",H);}},[]);let le=ln.useCallback((t,p)=>{o||(p.preventDefault(),p.stopPropagation(),we.current=true,Q.current=t,de.current={x:p.clientX,y:p.clientY,w:ee.width,h:ee.height,px:F.x,py:F.y},document.body.style.cursor=t==="e"||t==="w"?"ew-resize":t==="n"||t==="s"?"ns-resize":t==="nw"||t==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[o,ee,F]),fe=ln.useCallback((t,p)=>{if(o)return;p.preventDefault(),p.stopPropagation(),we.current=true;let H=p.touches[0];Q.current=t,de.current={x:H.clientX,y:H.clientY,w:ee.width,h:ee.height,px:F.x,py:F.y},document.body.style.userSelect="none";},[o,ee,F]);ln.useEffect(()=>{let t=(q,ke)=>{let je=Q.current;if(!je)return;let jt=q-de.current.x,Bt=ke-de.current.y,{w:Ge,h:Ue,px:vt,py:yt}=de.current;if(je.includes("e")&&(Ge=Math.max(A.width,Ge+jt)),je.includes("w")){let st=Math.max(A.width,Ge-jt);vt=vt+(Ge-st),Ge=st;}if(je.includes("s")&&(Ue=Math.max(A.height,Ue+Bt)),je.includes("n")){let st=Math.max(A.height,Ue-Bt);yt=yt+(Ue-st),Ue=st;}Z({width:Ge,height:Ue}),ye({x:vt,y:yt});},p=q=>{Q.current&&t(q.clientX,q.clientY);},H=q=>{Q.current&&(q.preventDefault(),t(q.touches[0].clientX,q.touches[0].clientY));},O=()=>{Q.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",p),window.addEventListener("mouseup",O),window.addEventListener("touchmove",H,{passive:false}),window.addEventListener("touchend",O),()=>{window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",O),window.removeEventListener("touchmove",H),window.removeEventListener("touchend",O);}},[A]);let r=ln.useCallback(()=>{o?(te&&(ye(te.pos),Z(te.size)),L(false)):(pe({pos:F,size:ee}),L(true));},[o,F,ee,te]),v=ln.useCallback(()=>{K?ne(false):(o&&(L(false),te&&(ye(te.pos),Z(te.size))),ne(true),_?.());},[K,o,te,_]);ln.useEffect(()=>{if(!re||K)return;let t=p=>{if(!(!Ke.current?.contains(document.activeElement)&&document.activeElement!==Ke.current)){if(p.key==="Escape"&&(C(null),b(new Set)),p.ctrlKey&&p.key==="a"){p.preventDefault();let H=new Set(J.map((O,q)=>q));b(H);}p.key==="Delete"&&d.size>0&&N&&(p.preventDefault(),ze(true));}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[re,K,J,d,N]);let Y={"--fe-accent":i};if(K)return jsxRuntime.jsx("div",{className:s("fixed z-100 cursor-pointer transition-all duration-300",D==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:Y,onClick:()=>ne(false),title:`Restore ${n}`,children:jsxRuntime.jsxs("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:[jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:n})]})});if(!re)return null;let a=o?me.w:Math.min(ee.width,me.w-8),R=o?me.h:Math.min(ee.height,me.h-8),oe=o?0:rt(F.x,0,Math.max(0,me.w-a)),Me=o?0:rt(F.y,0,Math.max(0,me.h-40)),xt=a<500;return jsxRuntime.jsxs("div",{ref:Ke,className:s("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]",o&&"rounded-none",X),style:{...Y,left:oe,top:Me,width:a,height:R,transition:o?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxRuntime.jsxs("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:We,onTouchStart:at,onDoubleClick:r,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:n}),jsxRuntime.jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:"fe-btn mr-1",onClick:()=>ge(t=>t==="list"?"grid":"list"),title:I==="list"?"Grid view":"List view",children:I==="list"?jsxRuntime.jsx(lucideReact.LayoutGrid,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.LayoutList,{className:"h-3.5 w-3.5"})}),h&&jsxRuntime.jsx("button",{className:"fe-btn",onClick:v,title:"Dock to edge",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn",onClick:r,title:o?"Restore":"Maximize",children:o?jsxRuntime.jsx(lucideReact.Minimize2,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{w?.(),Se(false);},title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsxRuntime.jsx("button",{className:"fe-btn p-1",onClick:()=>T?.(".."),title:"Go up",children:jsxRuntime.jsx(lucideReact.FolderUp,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:V==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>he(t=>t==="search"?"navigate":"search"),title:V==="search"?"Switch to path navigation":"Switch to file search",children:V==="search"?jsxRuntime.jsx(lucideReact.Search,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.CornerRightDown,{className:"h-3 w-3"})}),jsxRuntime.jsx("div",{className:"relative flex-1",children:jsxRuntime.jsx("input",{type:"text",value:U,onChange:t=>be(t.target.value),onKeyDown:t=>{t.key==="Enter"&&U.trim()&&V==="navigate"&&(y?y(U.trim()):T?.(U.trim()));},placeholder:V==="search"?"Search files\u2026":"Enter path and press Enter\u2026",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)"})}),jsxRuntime.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[J.length," item",J.length!==1?"s":"",d.size>0&&` \xB7 ${d.size} selected`]})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-1 min-h-0",children:[jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:t=>{t.target===t.currentTarget&&(b(new Set),C(null));},children:J.length===0?jsxRuntime.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsxRuntime.jsx(lucideReact.Folder,{className:"mb-2 h-10 w-10"}),jsxRuntime.jsx("span",{className:"text-xs",children:"No files found"})]}):I==="list"?jsxRuntime.jsx("div",{className:"space-y-px",children:J.map((t,p)=>{let H=It(t),O=d.has(p),q=t.extension||mt(t.name);return jsxRuntime.jsxs("div",{className:s("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",O?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:O?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:ke=>Te(p,ke),onDoubleClick:()=>Ye(p),children:[jsxRuntime.jsx(H,{className:s("h-4 w-4 shrink-0",t.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:t.name}),q&&t.type==="file"&&jsxRuntime.jsx("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:q}),t.size!=null&&jsxRuntime.jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:mn(t.size)}),t.modifiedAt&&jsxRuntime.jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:At(t.modifiedAt)})]},t.path+p)})}):jsxRuntime.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:J.map((t,p)=>{let H=It(t),O=d.has(p),q=t.extension||mt(t.name);return jsxRuntime.jsxs("div",{className:s("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",O?"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:ke=>Te(p,ke),onDoubleClick:()=>Ye(p),children:[jsxRuntime.jsx(H,{className:s("h-7 w-7",t.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:t.name}),q&&t.type==="file"&&jsxRuntime.jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:q})]},t.path+p)})})}),jsxRuntime.jsx("div",{className:s("overflow-hidden transition-[width,opacity] duration-300 ease-out",xt?s("absolute right-0 top-0 bottom-0 z-10",M?"w-44 opacity-100":"w-0 opacity-0 pointer-events-none"):s("shrink-0",M?"w-56":"w-0")),children:M&&jsxRuntime.jsxs("div",{className:s("flex h-full flex-col p-4",xt?"fe-panel-narrow w-44":"fe-panel w-56 border-l border-(--fe-border)"),children:[xt&&jsxRuntime.jsx("button",{className:"fe-btn mb-2 self-end",onClick:()=>{C(null),b(new Set);},title:"Close panel",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsxs("div",{className:"mb-3 flex flex-col items-center",children:[ln__default.default.createElement(It(M),{className:s("h-10 w-10 mb-2",M.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:M.name})]}),jsxRuntime.jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsxRuntime.jsx(ot,{label:"Type",value:M.type==="directory"?"Directory":M.mimeType||M.extension||mt(M.name)||"File"}),M.size!=null&&jsxRuntime.jsx(ot,{label:"Size",value:mn(M.size)}),jsxRuntime.jsx(ot,{label:"Path",value:M.path,mono:true}),M.extension&&jsxRuntime.jsx(ot,{label:"Extension",value:M.extension}),M.modifiedAt&&jsxRuntime.jsx(ot,{label:"Modified",value:At(M.modifiedAt)}),M.createdAt&&jsxRuntime.jsx(ot,{label:"Created",value:At(M.createdAt)})]}),jsxRuntime.jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[M.type==="file"&&x&&jsxRuntime.jsxs("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:()=>x(M),children:[jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),z?.map(t=>jsxRuntime.jsxs("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:()=>t.onClick(M),children:[t.icon&&ln__default.default.createElement(t.icon,{className:"h-3 w-3"}),t.label]},t.key))]})]})})]}),jsxRuntime.jsxs("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[jsxRuntime.jsxs("span",{children:[J.length," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[d.size>0&&jsxRuntime.jsxs("span",{className:"text-(--fe-accent)/70",children:[d.size," selected"]}),jsxRuntime.jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),G&&!o&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:t=>le("n",t),onTouchStart:t=>fe("n",t)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:t=>le("s",t),onTouchStart:t=>fe("s",t)}),jsxRuntime.jsx("div",{className:"absolute top-4 left-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:t=>le("w",t),onTouchStart:t=>fe("w",t)}),jsxRuntime.jsx("div",{className:"absolute top-4 right-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:t=>le("e",t),onTouchStart:t=>fe("e",t)}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 h-6 w-6 cursor-nwse-resize",onMouseDown:t=>le("nw",t),onTouchStart:t=>fe("nw",t)}),jsxRuntime.jsx("div",{className:"absolute top-0 right-0 h-6 w-6 cursor-nesw-resize",onMouseDown:t=>le("ne",t),onTouchStart:t=>fe("ne",t)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-6 w-6 cursor-nesw-resize",onMouseDown:t=>le("sw",t),onTouchStart:t=>fe("sw",t)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 right-0 h-6 w-6 cursor-nwse-resize",onMouseDown:t=>le("se",t),onTouchStart:t=>fe("se",t)})]}),jsxRuntime.jsx("style",{children:`
23
23
  .fe-window {
24
24
  background: var(--fe-bg);
25
25
  box-shadow: var(--fe-shadow);
@@ -80,4 +80,4 @@
80
80
  from { opacity: 0; transform: translateX(-4px); }
81
81
  to { opacity: 1; transform: translateX(0); }
82
82
  }
83
- `}),jsxRuntime.jsx(qt,{open:ce,onOpenChange:ze,children:jsxRuntime.jsxs(Zt,{size:"sm",children:[jsxRuntime.jsxs(Qt,{children:[jsxRuntime.jsxs(Jt,{children:[jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"text-danger-500"}),"Confirm Deletion"]}),jsxRuntime.jsxs(en,{children:[u.size===1?`Are you sure you want to delete "${Z[Array.from(u)[0]]?.name}"?`:`Are you sure you want to delete ${u.size} selected items?`," ","This action cannot be undone."]})]}),jsxRuntime.jsxs(tn,{children:[jsxRuntime.jsx(Lt,{intent:"ghost",onClick:()=>ze(false),children:"Cancel"}),jsxRuntime.jsxs(Lt,{intent:"danger",onClick:()=>{let t=Array.from(u).map(m=>Z[m]).filter(Boolean);L?.(t),b(new Set),S(null),ze(false);},children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),"Delete"]})]})]})})]})}function ot({label:e,value:o,mono:l}){return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),jsxRuntime.jsx("div",{className:s("text-(--fe-text) break-all leading-snug",l&&"font-mono text-[9px]"),children:o})]})}function Or(e,o){let l=o.getBoundingClientRect(),g=Math.max(l.width,l.height)*1.2,w=e.clientX-l.left,f=e.clientY-l.top,v=document.createElement("span");v.className="masonry-ripple",v.style.width=`${g}px`,v.style.height=`${g}px`,v.style.left=`${w}px`,v.style.top=`${f}px`,o.appendChild(v),v.addEventListener("animationend",()=>v.remove());}function Ht({columns:e,columnWidth:o=240,gap:l=16,items:g,onItemClick:w,className:f,style:v,children:z,...F}){let x=rn.useRef(null),_=rn.useRef([]),[D,L]=rn.useState(()=>e??1),[k,G]=rn.useState([]),[y,ee]=rn.useState(0),A=g?g.map((u,b)=>({key:u.key??b,node:u.content})):rn__default.default.Children.toArray(z).map((u,b)=>({key:u.key??b,node:u})),ne=A.length,$=rn.useCallback(u=>e??Math.max(1,Math.floor((u+l)/(o+l))),[e,o,l]),K=rn.useCallback(()=>{let u=x.current;if(!u)return;let b=u.clientWidth,C=$(b);L(C);let S=(b-(C-1)*l)/C,a=new Array(C).fill(0),O=[];for(let ie=0;ie<ne;ie++){let q=_.current[ie],ge=q?q.offsetHeight:0,I=0;for(let be=1;be<C;be++)a[be]<a[I]&&(I=be);O.push({top:a[I],left:I*(S+l),width:S}),a[I]+=ge+l;}let Y=Math.max(0,...a)-(ne?l:0);G(O),ee(Y);},[ne,$,l]);rn.useEffect(()=>{let u=x.current;if(!u)return;let b=new ResizeObserver(()=>K());return b.observe(u),()=>b.disconnect()},[K]),rn.useEffect(()=>{let u=requestAnimationFrame(K);return ()=>cancelAnimationFrame(u)},[K]),rn.useEffect(()=>{let u=new ResizeObserver(()=>K());return _.current.forEach(b=>{b&&u.observe(b);}),()=>u.disconnect()},[ne,D,K]);let j=rn.useCallback((u,b)=>{let C=u.currentTarget;Or(u,C),w?.(g?.[b],b);},[w,g]),Me=u=>{if(!g)return false;let b=g[u];return !!(b.title||b.description||b.actions)};return jsxRuntime.jsx("div",{ref:x,className:s("relative",f),style:{...v,height:y},...F,children:A.map((u,b)=>jsxRuntime.jsxs("div",{ref:C=>{_.current[b]=C;},className:"masonry-item",role:"button",tabIndex:0,onClick:C=>j(C,b),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),w?.(g?.[b],b));},style:{position:"absolute",top:k[b]?.top??0,left:k[b]?.left??0,width:k[b]?.width??"100%"},children:[u.node,Me(b)&&jsxRuntime.jsxs("div",{className:"masonry-item-overlay",children:[g[b].title&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-title",children:g[b].title}),g[b].description&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-desc",children:g[b].description}),g[b].actions&&jsxRuntime.jsx("div",{className:"masonry-item-overlay-actions",children:g[b].actions})]})]},u.key))})}var _r={FilmReel:vt,MiniPlayer:wt,CinePlayer:Nt,FileExplorer:zt,Masonry:Ht},ra=_r;exports.CinePlayer=Nt;exports.Extras=_r;exports.FileExplorer=zt;exports.FilmReel=vt;exports.Masonry=Ht;exports.MiniPlayer=wt;exports.default=ra;
83
+ `}),jsxRuntime.jsx(en,{open:ce,onOpenChange:ze,children:jsxRuntime.jsxs(tn,{size:"sm",children:[jsxRuntime.jsxs(nn,{children:[jsxRuntime.jsxs(rn,{children:[jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"text-danger-500"}),"Confirm Deletion"]}),jsxRuntime.jsxs(on,{children:[d.size===1?`Are you sure you want to delete "${J[Array.from(d)[0]]?.name}"?`:`Are you sure you want to delete ${d.size} selected items?`," ","This action cannot be undone."]})]}),jsxRuntime.jsxs(an,{children:[jsxRuntime.jsx(Dt,{intent:"ghost",onClick:()=>ze(false),children:"Cancel"}),jsxRuntime.jsxs(Dt,{intent:"danger",onClick:()=>{let t=Array.from(d).map(p=>J[p]).filter(Boolean);N?.(t),b(new Set),C(null),ze(false);},children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),"Delete"]})]})]})})]})}function ot({label:e,value:n,mono:i}){return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),jsxRuntime.jsx("div",{className:s("text-(--fe-text) break-all leading-snug",i&&"font-mono text-[9px]"),children:n})]})}function Br(e,n){let i=n.getBoundingClientRect(),g=Math.max(i.width,i.height)*1.2,k=e.clientX-i.left,m=e.clientY-i.top,h=document.createElement("span");h.className="masonry-ripple",h.style.width=`${g}px`,h.style.height=`${g}px`,h.style.left=`${k}px`,h.style.top=`${m}px`,n.appendChild(h),h.addEventListener("animationend",()=>h.remove());}function $t({columns:e,columnWidth:n=240,gap:i=16,items:g,onItemClick:k,className:m,style:h,children:D,...S}){let x=ln.useRef(null),j=ln.useRef([]),[T,N]=ln.useState(()=>e??1),[w,_]=ln.useState([]),[y,B]=ln.useState(0),z=g?g.map((d,b)=>({key:d.key??b,node:d.content})):ln__default.default.Children.toArray(D).map((d,b)=>({key:d.key??b,node:d})),G=z.length,A=ln.useCallback(d=>e??Math.max(1,Math.floor((d+i)/(n+i))),[e,n,i]),X=ln.useCallback(()=>{let d=x.current;if(!d)return;let b=d.clientWidth,E=A(b);N(E);let C=(b-(E-1)*i)/E,o=new Array(E).fill(0),L=[];for(let ne=0;ne<G;ne++){let U=j.current[ne],be=U?U.offsetHeight:0,V=0;for(let he=1;he<E;he++)o[he]<o[V]&&(V=he);L.push({top:o[V],left:V*(C+i),width:C}),o[V]+=be+i;}let K=Math.max(0,...o)-(G?i:0);_(L),B(K);},[G,A,i]);ln.useEffect(()=>{let d=x.current;if(!d)return;let b=new ResizeObserver(()=>X());return b.observe(d),()=>b.disconnect()},[X]),ln.useEffect(()=>{let d=requestAnimationFrame(X);return ()=>cancelAnimationFrame(d)},[X]),ln.useEffect(()=>{let d=new ResizeObserver(()=>X());return j.current.forEach(b=>{b&&d.observe(b);}),()=>d.disconnect()},[G,T,X]);let I=ln.useCallback((d,b)=>{let E=d.currentTarget;Br(d,E),k?.(g?.[b],b);},[k,g]),ge=d=>{if(!g)return false;let b=g[d];return !!(b.title||b.description||b.actions)};return jsxRuntime.jsx("div",{ref:x,className:s("relative",m),style:{...h,height:y},...S,children:z.map((d,b)=>jsxRuntime.jsxs("div",{ref:E=>{j.current[b]=E;},className:"masonry-item",role:"button",tabIndex:0,onClick:E=>I(E,b),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),k?.(g?.[b],b));},style:{position:"absolute",top:w[b]?.top??0,left:w[b]?.left??0,width:w[b]?.width??"100%"},children:[d.node,ge(b)&&jsxRuntime.jsxs("div",{className:"masonry-item-overlay",children:[g[b].title&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-title",children:g[b].title}),g[b].description&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-desc",children:g[b].description}),g[b].actions&&jsxRuntime.jsx("div",{className:"masonry-item-overlay-actions",children:g[b].actions})]})]},d.key))})}function ht({text:e="",mode:n="typewriter",speed:i=40,cursor:g=true,cursorChar:k="\u258B",thinking:m=false,streaming:h=false,delay:D=0,onComplete:S,as:x="span",className:j}){let[T,N]=ln.useState(n==="instant"?e:""),[w,_]=ln.useState(false),[y,B]=ln.useState(n==="instant"),[z,G]=ln.useState(false),A=ln.useRef(0),X=ln.useRef(S);X.current=S;let I=ln.useRef(e);I.current=e,ln.useEffect(()=>{if(n!=="typewriter")return;if(N(""),B(false),G(false),_(false),!e){B(true);return}let C=Math.max(10,1e3/i),o=0,L,K=()=>{_(true),L=setInterval(()=>{let U=I.current;o++,N(U.slice(0,o)),o>=U.length&&(clearInterval(L),_(false),B(true),X.current?.());},C);},ne;return D>0?ne=setTimeout(K,D):K(),()=>{clearTimeout(ne),clearInterval(L);}},[e,n]),ln.useEffect(()=>{if(n!=="stream")return;if(e.length===0){A.current=0,N(""),_(false),B(false),G(false);return}if(e.length<=A.current)return;let C=Math.max(10,1e3/i),o=A.current;_(true),B(false),G(false);let L=setInterval(()=>{o++,A.current=o,N(I.current.slice(0,o)),o>=I.current.length&&(clearInterval(L),_(false),X.current?.());},C);return ()=>clearInterval(L)},[e,n]),ln.useEffect(()=>{n==="instant"&&(N(e),_(false),B(true));},[e,n]);let ge=ln.useRef(h);ln.useEffect(()=>{let C=ge.current;if(ge.current=h,C&&!h&&!w&&n==="stream"){G(true);let o=setTimeout(()=>{G(false),B(true);},650);return ()=>clearTimeout(o)}},[h,w,n]);let d=g&&(m||w||z||n==="stream"&&h&&!y||n==="typewriter"&&!y),b=m?"tw-cursor--blink":w?"tw-cursor--solid":z?"tw-cursor--out":"tw-cursor--blink";return jsxRuntime.jsxs(x,{className:s(j),children:[m&&!T&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:"\u200B"}),T,d&&jsxRuntime.jsx("span",{className:s("tw-cursor",b),"aria-hidden":"true",children:k})]})}var Kr={FilmReel:Nt,MiniPlayer:Mt,CinePlayer:Tt,FileExplorer:Ht,Masonry:$t,TypewriterText:ht},va=Kr;exports.CinePlayer=Tt;exports.Extras=Kr;exports.FileExplorer=Ht;exports.FilmReel=Nt;exports.Masonry=$t;exports.MiniPlayer=Mt;exports.TypewriterText=ht;exports.default=va;
@@ -0,0 +1 @@
1
+ @keyframes tw-blink{0%,to{opacity:1}50%{opacity:0}}@keyframes tw-cursor-out{0%{opacity:1}80%{opacity:1}to{opacity:0}}.tw-cursor{display:inline-block;line-height:1;vertical-align:baseline;user-select:none;transform:scaleY(.88);transform-origin:50% 90%;color:currentColor}.tw-cursor--blink{animation:tw-blink 1s step-end infinite}.tw-cursor--solid{opacity:1;animation:none}.tw-cursor--out{animation:tw-cursor-out .6s ease-out forwards;pointer-events:none}
@@ -3,5 +3,7 @@ export { MiniPlayer_alias_1 as MiniPlayer } from '../_tsup-dts-rollup.cjs';
3
3
  export { CinePlayer_alias_1 as CinePlayer } from '../_tsup-dts-rollup.cjs';
4
4
  export { FileExplorer_alias_1 as FileExplorer } from '../_tsup-dts-rollup.cjs';
5
5
  export { Masonry_alias_1 as Masonry } from '../_tsup-dts-rollup.cjs';
6
+ export { TypewriterText_alias_1 as TypewriterText } from '../_tsup-dts-rollup.cjs';
7
+ export { TypewriterTextProps_alias_1 as TypewriterTextProps } from '../_tsup-dts-rollup.cjs';
6
8
  export { Extras_alias_1 as Extras } from '../_tsup-dts-rollup.cjs';
7
- export { default_alias_3 as default } from '../_tsup-dts-rollup.cjs';
9
+ export { default_alias_4 as default } from '../_tsup-dts-rollup.cjs';
@@ -3,5 +3,7 @@ export { MiniPlayer_alias_1 as MiniPlayer } from '../_tsup-dts-rollup.js';
3
3
  export { CinePlayer_alias_1 as CinePlayer } from '../_tsup-dts-rollup.js';
4
4
  export { FileExplorer_alias_1 as FileExplorer } from '../_tsup-dts-rollup.js';
5
5
  export { Masonry_alias_1 as Masonry } from '../_tsup-dts-rollup.js';
6
+ export { TypewriterText_alias_1 as TypewriterText } from '../_tsup-dts-rollup.js';
7
+ export { TypewriterTextProps_alias_1 as TypewriterTextProps } from '../_tsup-dts-rollup.js';
6
8
  export { Extras_alias_1 as Extras } from '../_tsup-dts-rollup.js';
7
- export { default_alias_3 as default } from '../_tsup-dts-rollup.js';
9
+ export { default_alias_4 as default } from '../_tsup-dts-rollup.js';