@therealtinhtute/baroiplayer 1.1.0 → 1.2.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 (78) hide show
  1. package/dist/core-plugins-By-4-kGs.cjs +2 -0
  2. package/dist/core-plugins-By-4-kGs.cjs.map +1 -0
  3. package/dist/{core-plugins-CROGvQUy.js → core-plugins-DSBWcTuX.js} +444 -309
  4. package/dist/core-plugins-DSBWcTuX.js.map +1 -0
  5. package/dist/core.js +2 -2
  6. package/dist/core.mjs +19 -19
  7. package/dist/{enhanced-components-DUw2KrmQ.js → enhanced-components-B_l3cist.js} +2 -2
  8. package/dist/{enhanced-components-DUw2KrmQ.js.map → enhanced-components-B_l3cist.js.map} +1 -1
  9. package/dist/{enhanced-components-DXBCHU0v.cjs → enhanced-components-BspFs9OO.cjs} +2 -2
  10. package/dist/{enhanced-components-DXBCHU0v.cjs.map → enhanced-components-BspFs9OO.cjs.map} +1 -1
  11. package/dist/hooks-BXwI8QG6.cjs +4 -0
  12. package/dist/hooks-BXwI8QG6.cjs.map +1 -0
  13. package/dist/hooks-Bpi-jDiO.js +1816 -0
  14. package/dist/hooks-Bpi-jDiO.js.map +1 -0
  15. package/dist/index.js +2 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +18 -20
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/{minimal-components-DlRK7Qu_.js → minimal-components-C4z900Ro.js} +297 -298
  20. package/dist/minimal-components-C4z900Ro.js.map +1 -0
  21. package/dist/minimal-components-v4qBp6jv.cjs +2 -0
  22. package/dist/minimal-components-v4qBp6jv.cjs.map +1 -0
  23. package/package.json +1 -1
  24. package/src/components/accessibility/keyboard-help-overlay.tsx +2 -0
  25. package/src/components/enhanced/debug-panel.tsx +1 -1
  26. package/src/components/enhanced/enhanced-media-player.tsx +68 -25
  27. package/src/components/legacy.tsx +6 -6
  28. package/src/components/media-player-video.tsx +5 -12
  29. package/src/components/media-player.tsx +2 -2
  30. package/src/components/ui/enhanced-seek-bar.tsx +2 -2
  31. package/src/components/ui/media-resource-preloader.tsx +21 -23
  32. package/src/components/unified/base-media-player.tsx +22 -10
  33. package/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +58 -38
  34. package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +6 -6
  35. package/src/core/optimization/bundle-optimizer.tsx +26 -27
  36. package/src/core/plugins/__tests__/registry.test.ts +1 -1
  37. package/src/core/plugins/enhanced-plugin-system.ts +26 -8
  38. package/src/core/plugins/registry.ts +319 -92
  39. package/src/core/plugins/types.ts +21 -3
  40. package/src/core/providers/enhanced-hls-provider.ts +11 -40
  41. package/src/core/providers/lazy-provider.tsx +5 -42
  42. package/src/features/media-session/media-session-manager.ts +4 -26
  43. package/src/features/picture-in-picture/pip-manager.ts +2 -2
  44. package/src/features/playlist/playlist-manager.ts +26 -18
  45. package/src/features/subtitles/subtitle-manager.ts +1 -1
  46. package/src/features/subtitles/subtitle-parser.ts +19 -16
  47. package/src/features/thumbnails/thumbnail-generator.ts +12 -5
  48. package/src/hooks/__tests__/currentTime-fix.test.ts +149 -0
  49. package/src/hooks/accessibility/use-accessibility-preferences.ts +1 -1
  50. package/src/hooks/accessibility/use-focus-management.ts +2 -2
  51. package/src/hooks/accessibility/use-keyboard-shortcuts.ts +2 -2
  52. package/src/hooks/accessibility/use-screen-reader.ts +1 -1
  53. package/src/hooks/core/index.ts +1 -1
  54. package/src/hooks/use-buffer-health.ts +1 -1
  55. package/src/hooks/use-enhanced-media-player.ts +107 -9
  56. package/src/hooks/use-focus-trap.tsx +2 -2
  57. package/src/hooks/use-intelligent-preloading.ts +23 -3
  58. package/src/hooks/use-keyboard-shortcuts.ts +2 -2
  59. package/src/hooks/use-media-player.ts +74 -43
  60. package/src/hooks/use-memory-optimization.ts +15 -15
  61. package/src/hooks/use-smart-preload.ts +1 -2
  62. package/src/hooks/useKeyboardShortcuts.ts +34 -2
  63. package/src/hooks/useVideoPlayer.ts +50 -4
  64. package/src/index-legacy.ts +3 -5
  65. package/src/test/accessibility-utils.ts +7 -7
  66. package/src/test/media-mocks.ts +41 -28
  67. package/src/test/setup.ts +22 -4
  68. package/src/types/index.ts +13 -0
  69. package/dist/core-plugins-CROGvQUy.js.map +0 -1
  70. package/dist/core-plugins-DtsHBOtF.cjs +0 -2
  71. package/dist/core-plugins-DtsHBOtF.cjs.map +0 -1
  72. package/dist/hooks-BW-JjVgP.cjs +0 -4
  73. package/dist/hooks-BW-JjVgP.cjs.map +0 -1
  74. package/dist/hooks-CyX6De5M.js +0 -1693
  75. package/dist/hooks-CyX6De5M.js.map +0 -1
  76. package/dist/minimal-components-Bdcpxav5.cjs +0 -2
  77. package/dist/minimal-components-Bdcpxav5.cjs.map +0 -1
  78. package/dist/minimal-components-DlRK7Qu_.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Ss=Object.create;var zt=Object.defineProperty;var Ps=Object.getOwnPropertyDescriptor;var Ns=Object.getOwnPropertyNames;var As=Object.getPrototypeOf,Ts=Object.prototype.hasOwnProperty;var ks=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ds=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ns(t))!Ts.call(e,s)&&s!==n&&zt(e,s,{get:()=>t[s],enumerable:!(r=Ps(t,s))||r.enumerable});return e};var De=(e,t,n)=>(n=e!=null?Ss(As(e)):{},Ds(t||!e||!e.__esModule?zt(n,"default",{value:e,enumerable:!0}):n,e));var de=(e,t,n)=>ks(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./context-eNS62_ac.cjs"),E=require("react"),U=require("./hooks-BW-JjVgP.cjs"),C=require("./utils-CFOue_9K.cjs"),we=require("./minimal-components-Bdcpxav5.cjs"),re=require("./enhanced-components-DXBCHU0v.cjs"),_s=require("@radix-ui/react-tooltip"),Is=require("@radix-ui/react-slider"),_e=require("react-dom"),Os=require("./performance-monitor-lJmuUjQQ.cjs");function Ct(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=Ct(E),V=Ct(_s),te=Ct(Is),gr=Ct(_e);function Qe({children:e,className:t,size:n="md",variant:r="spinner"}){const s={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12"};return r==="spinner"?o.jsxRuntimeExports.jsxs("div",{className:C.cn("flex items-center justify-center",t),children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-spin rounded-full border-2 border-current border-t-transparent",s[n])}),e&&o.jsxRuntimeExports.jsx("span",{className:"ml-2 text-muted-foreground text-sm",children:e})]}):r==="skeleton"?o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-pulse rounded bg-muted",s[n],t)}):o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-pulse bg-gradient-to-r bg-pos-0 bg-size-200 from-muted via-muted/50 to-muted","animate-shimmer rounded",s[n],t)})}function yr({children:e,fallback:t=o.jsxRuntimeExports.jsx(Qe,{}),className:n}){return o.jsxRuntimeExports.jsx("div",{className:n,children:o.jsxRuntimeExports.jsx(E.Suspense,{fallback:t,children:e})})}function Ls({error:e,resetError:t}){return o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-destructive/20 bg-destructive/10 p-6",children:[o.jsxRuntimeExports.jsx("div",{className:"mb-2 font-semibold text-destructive text-lg",children:"Media Player Error"}),o.jsxRuntimeExports.jsx("div",{className:"mb-4 text-center text-muted-foreground text-sm",children:e.message}),o.jsxRuntimeExports.jsx("button",{onClick:t,className:"rounded bg-primary px-4 py-2 text-primary-foreground transition-colors hover:bg-primary/90",children:"Try Again"})]})}class br extends E.Component{constructor(n){super(n);de(this,"resetError",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){this.props.onError?.(n,r),console.error("MediaErrorBoundary caught an error:",n,r)}render(){if(this.state.hasError&&this.state.error){const n=this.props.fallback||Ls;return o.jsxRuntimeExports.jsx(n,{error:this.state.error,resetError:this.resetError})}return this.props.children}}function Er({children:e,priority:t="normal",deferredMs:n=0}){const[r,s]=E.useState(n>0),i=E.useDeferredValue(e);return E.useEffect(()=>{if(n>0){const a=setTimeout(()=>{s(!1)},n);return()=>clearTimeout(a)}},[n]),r?o.jsxRuntimeExports.jsx(Qe,{variant:"skeleton"}):t==="high"?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):t==="low"?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:i}):o.jsxRuntimeExports.jsx(E.Suspense,{fallback:o.jsxRuntimeExports.jsx(Qe,{}),children:e})}function Fs(e=100){const[t,n]=E.useState(!1),r=E.useDeferredValue(t);return E.useEffect(()=>{const s=setTimeout(()=>{n(!0)},e);return()=>clearTimeout(s)},[e]),{isReady:r,actualIsReady:t}}function zs({children:e,className:t,loadingFallback:n=o.jsxRuntimeExports.jsx(Qe,{}),errorFallback:r,priority:s="normal",deferredMs:i=0,onError:a}){return o.jsxRuntimeExports.jsx("div",{className:t,children:o.jsxRuntimeExports.jsx(br,{fallback:r,onError:a,children:o.jsxRuntimeExports.jsx(yr,{fallback:n,children:o.jsxRuntimeExports.jsx(Er,{priority:s,deferredMs:i,children:e})})})})}const wr=E.forwardRef(({src:e,className:t,children:n,keyboardControls:r=!0,showControls:s=!0,customControls:i=!1,crossOrigin:a,enablePerformanceMonitoring:c=!0,bufferingStrategy:m="adaptive",preloadStrategy:l="progressive",enableOptimizations:d=!0,...u},p)=>{E.useTransition();const{state:x,controls:y,mediaRef:h,containerRef:v,performanceMetrics:w,isEnhanced:j}=U.useEnhancedMediaPlayer({src:e,crossOrigin:a,enablePerformanceMonitoring:c,bufferingStrategy:m,preloadStrategy:l,enableTimeUpdateThrottling:!0,timeUpdateThrottleMs:100,enableSeekPreview:!0,...u}),{memoryStats:b}=U.useMemoryOptimization({maxMemoryUsage:50,cleanupInterval:15e3,enableGC:!0,monitorMemory:d});U.useKeyboardControls({enabled:r,state:x,controls:y});const g=E.useMemo(()=>Array.isArray(e)?e.some(M=>/\.(mp4|webm|ogv|mov|avi)$/i.test(M)):/\.(mp4|webm|ogv|mov|avi)$/i.test(e),[e]),R=E.useMemo(()=>Array.isArray(e)?e.map((M,S)=>o.jsxRuntimeExports.jsx("source",{src:M},`${M}-${S}`)):null,[e]),P=E.useMemo(()=>({controls:s&&!i,className:C.cn("w-full transition-all duration-300",g&&"aspect-video","bg-[color:var(--media-bg)] rounded-lg",x.isTransitioning&&"opacity-90"),preload:l==="eager"?"auto":"metadata",crossOrigin:a,...Array.isArray(e)?{}:{src:e}}),[s,i,g,x.isTransitioning,l,a,e]);return o.jsxRuntimeExports.jsx(zs,{priority:"high",errorFallback:({error:M,resetError:S})=>o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass-strong animate-enter rounded-lg","bg-[color:var(--color-error)]/10 backdrop-blur-md"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-2 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsx("div",{className:"mx-auto w-fit rounded-full bg-[color:var(--color-error)]/20 p-3",children:o.jsxRuntimeExports.jsx("svg",{className:"size-6 text-[color:var(--color-error)]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Playback Error"}),o.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-[color:var(--media-text-secondary)] text-sm",children:M.message||x.error}),o.jsxRuntimeExports.jsx("button",{onClick:S,className:"mt-2 rounded bg-[color:var(--color-brand-primary)] px-4 py-2 text-sm text-white transition-colors hover:bg-[color:var(--color-brand-accent)]",children:"Try Again"})]})}),loadingFallback:o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass animate-enter rounded-lg","bg-[color:var(--media-bg)]/20 backdrop-blur-sm"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-4 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("size-12 animate-spin rounded-full border-2","border-[color:var(--color-brand-accent)]/30","border-t-[color:var(--color-brand-accent)]")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 size-12 rounded-full","bg-gradient-to-r from-[color:var(--color-brand-primary)] to-[color:var(--color-brand-accent)]","animate-pulse opacity-20 blur-sm")})]}),o.jsxRuntimeExports.jsx("p",{className:"font-medium text-[color:var(--media-text-secondary)] text-sm",children:"Loading media..."})]})}),children:o.jsxRuntimeExports.jsxs("div",{ref:p||v,className:C.cn("media-container relative overflow-hidden contain-strict","bg-[color:var(--media-bg)] focus-within:outline-none","rounded-xl border border-[color:var(--media-border)]/30","shadow-2xl shadow-[color:var(--media-bg)]/50","transition-all duration-300 ease-out","hover:border-[color:var(--media-border)]/50","hover:shadow-3xl hover:shadow-[color:var(--media-bg)]/60","will-change-transform",x.isTransitioning&&"cursor-wait",t),tabIndex:0,role:"application","aria-label":g?"Video player":"Audio player","aria-busy":x.isLoading||x.isBuffering,children:[g?o.jsxRuntimeExports.jsxs("video",{ref:h,...P,disablePictureInPicture:!1,playsInline:!0,"x-webkit-airplay":"allow",style:{willChange:"transform"},children:[R(),"Your browser does not support the video element."]}):o.jsxRuntimeExports.jsxs("audio",{ref:h,...P,preload:l==="eager"?"auto":"metadata",children:[R(),"Your browser does not support the audio element."]}),x.error&&o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass-strong animate-enter rounded-lg","bg-[color:var(--color-error)]/10 backdrop-blur-md"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-2 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsx("div",{className:"mx-auto w-fit rounded-full bg-[color:var(--color-error)]/20 p-3",children:o.jsxRuntimeExports.jsx("svg",{className:"size-6 text-[color:var(--color-error)]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Playback Error"}),o.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-[color:var(--media-text-secondary)] text-sm",children:x.error})]})}),x.isLoading&&o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass animate-enter rounded-lg","bg-[color:var(--media-bg)]/20 backdrop-blur-sm"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-4 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("size-12 animate-spin rounded-full border-2","border-[color:var(--color-brand-accent)]/30","border-t-[color:var(--color-brand-accent)]")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 size-12 rounded-full","bg-gradient-to-r from-[color:var(--color-brand-primary)] to-[color:var(--color-brand-accent)]","animate-pulse opacity-20 blur-sm")})]}),o.jsxRuntimeExports.jsx("p",{className:"font-medium text-[color:var(--media-text-secondary)] text-sm",children:x.isBuffering?"Buffering...":"Loading media..."})]})}),i&&typeof n=="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto absolute inset-0 z-50",children:n({state:x,controls:y})}),i&&typeof n!="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto absolute inset-0 z-50",children:n}),process.env.NODE_ENV==="development"&&c&&o.jsxRuntimeExports.jsxs("div",{className:"absolute bottom-2 left-2 rounded bg-black/50 px-2 py-1 text-white text-xs",children:[o.jsxRuntimeExports.jsxs("div",{children:["FPS: ",w.frameRate||0]}),o.jsxRuntimeExports.jsxs("div",{children:["Memory: ",b.usage.toFixed(1),"MB"]}),j&&o.jsxRuntimeExports.jsx("div",{children:"Enhanced ✓"})]})]})})});wr.displayName="MediaPlayer";const jr=E.forwardRef(({src:e,poster:t,width:n="100%",height:r="auto",aspectRatio:s="16/9",className:i,children:a,keyboardControls:c=!0,showControls:m=!0,customControls:l=!1,crossOrigin:d,...u},p)=>{const{state:x,controls:y,mediaRef:h,containerRef:v}=U.useMediaPlayer({src:e,crossOrigin:d,...u});U.useKeyboardControls({enabled:c,state:x,controls:y});const w=()=>Array.isArray(e)?e.map((g,R)=>o.jsxRuntimeExports.jsx("source",{src:g},R)):null,j={width:n,height:r,aspectRatio:r==="auto"?s:void 0},b={ref:h,controls:m&&!l,poster:t,className:"w-full h-full object-contain bg-black",...Array.isArray(e)?{}:{src:e}};return o.jsxRuntimeExports.jsxs("div",{ref:p||v,style:j,className:C.cn("relative overflow-hidden bg-black","focus-within:outline-none",i),tabIndex:0,children:[o.jsxRuntimeExports.jsxs("video",{...b,children:[Array.isArray(e)&&w(),"Your browser does not support the video element."]}),x.error&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80",children:o.jsxRuntimeExports.jsxs("div",{className:"text-center text-white",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm opacity-80",children:x.error})]})}),x.isLoading&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx("div",{className:"text-white",children:o.jsxRuntimeExports.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-white border-b-2"})})}),l&&typeof a=="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute inset-0",children:o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto",children:a({state:x,controls:y})})}),l&&typeof a!="function"&&a]})});jr.displayName="VideoPlayer";const Rr=E.forwardRef(({src:e,className:t,children:n,keyboardControls:r=!0,showControls:s=!0,customControls:i=!1,...a},c)=>{const{state:m,controls:l,mediaRef:d,containerRef:u}=U.useMediaPlayer({src:e,...a});U.useKeyboardControls({enabled:r,state:m,controls:l});const p=()=>Array.isArray(e)?e.map((y,h)=>o.jsxRuntimeExports.jsx("source",{src:y},h)):null,x={ref:d,controls:s&&!i,className:"w-full",...Array.isArray(e)?{}:{src:e}};return o.jsxRuntimeExports.jsxs("div",{ref:c||u,className:C.cn("relative","focus-within:outline-none",t),tabIndex:0,children:[o.jsxRuntimeExports.jsxs("audio",{...x,children:[Array.isArray(e)&&p(),"Your browser does not support the audio element."]}),m.error&&o.jsxRuntimeExports.jsx("div",{className:"mt-2 rounded-md border border-red-300 bg-red-100 p-3",children:o.jsxRuntimeExports.jsxs("div",{className:"text-red-800",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm",children:m.error})]})}),m.isLoading&&o.jsxRuntimeExports.jsx("div",{className:"mt-2 rounded-md border border-gray-300 bg-gray-100 p-3",children:o.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2 text-gray-600",children:[o.jsxRuntimeExports.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-gray-600 border-b-2"}),o.jsxRuntimeExports.jsx("span",{className:"text-sm",children:"Loading..."})]})}),i&&typeof n=="function"&&o.jsxRuntimeExports.jsx("div",{className:"mt-2",children:n({state:m,controls:l})}),i&&typeof n!="function"&&o.jsxRuntimeExports.jsx("div",{className:"mt-2",children:n})]})});Rr.displayName="AudioPlayer";let $t=null,$n=null;async function $s(){if(!$t){const[e,t]=await Promise.all([import("video.js"),import("hls.js")]);$t=e.default,$n=t.default,await Promise.all([import("@videojs/http-streaming"),import("videojs-contrib-quality-levels"),import("videojs-hls-quality-selector")])}return{videojs:$t,Hls:$n}}function Mr({sources:e,poster:t,textTracks:n=[],autoplay:r=!1,muted:s=!1,controls:i=!1,preload:a="metadata",fluid:c=!0,responsive:m=!0,playbackRates:l=[.5,.75,1,1.25,1.5,2],className:d,onReady:u,onError:p,hlsConfig:x={},enableQualitySelector:y=!0,enableSubtitles:h=!0}){const v=E.useRef(null),w=E.useRef(null),j=E.useRef(null),[b,g]=E.useState(!0),[R,P]=E.useState(null),M=o.useMediaContext(),S=o.useMediaDispatch(),F=async()=>{if(!(!v.current||w.current))try{g(!0);const{videojs:D,Hls:_}=await $s(),B=e.some(O=>O.type==="application/x-mpegURL")&&!v.current.canPlayType("application/vnd.apple.mpegurl"),$={autoplay:r,muted:s,controls:i,preload:a,fluid:c,responsive:m,playbackRates:l,sources:B?[]:e,poster:t,html5:{vhs:{overrideNative:!v.current.canPlayType("application/vnd.apple.mpegurl"),enableLowInitialPlaylist:!0,fastQualityChange:!0,handleManifestRedirects:!0}}},T=D(v.current,$,function(){console.log("Video.js player ready")});if(w.current=T,n.forEach(O=>{T.addRemoteTextTrack({kind:O.kind,src:O.src,srclang:O.srclang,label:O.label,default:O.default},!1)}),B){const O=e.find(k=>k.type==="application/x-mpegURL");if(O){const k=new _({debug:!1,enableWorker:!0,lowLatencyMode:!1,backBufferLength:30,maxBufferLength:30,maxMaxBufferLength:600,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,capLevelToPlayerSize:!0,capLevelOnFPSDrop:!0,renderTextTracksNatively:!1,subtitlePreference:{lang:navigator.language.split("-")[0],forced:!1},...x});j.current=k,k.loadSource(O.src),k.attachMedia(v.current),k.on(_.Events.MANIFEST_PARSED,()=>{if(console.log("HLS manifest parsed",{levels:k.levels.map(I=>({height:I.height,bitrate:I.bitrate,codec:I.codecSet}))}),y&&T.qualityLevels){const I=T.qualityLevels();k.levels.forEach((N,A)=>{I.addQualityLevel({id:A.toString(),label:`${N.height}p`,width:N.width,height:N.height,bitrate:N.bitrate,enabled:!0})})}}),k.on(_.Events.LEVEL_SWITCHED,(I,N)=>{console.log(`HLS quality switched to level ${N.level}`),S({type:o.MediaActionTypes.SET_QUALITY_LEVEL,detail:N.level})}),k.on(_.Events.ERROR,(I,N)=>{if(N.fatal)switch(N.type){case _.ErrorTypes.NETWORK_ERROR:console.error("Fatal network error encountered, try to recover"),k.startLoad();break;case _.ErrorTypes.MEDIA_ERROR:console.error("Fatal media error encountered, try to recover"),k.recoverMediaError();break;default:console.error("Fatal error, cannot recover"),P("Streaming error occurred"),p?.(N),k.destroy();break}}),k.on(_.Events.FRAG_LOADED,()=>{const I=k.bandwidthEstimate;I&&S({type:o.MediaActionTypes.SET_BANDWIDTH_ESTIMATE,detail:I})})}}y&&T.qualityLevels&&T.hlsQualitySelector({displayCurrentQuality:!0}),T.on("play",()=>{S({type:o.MediaActionTypes.PLAY})}),T.on("pause",()=>{S({type:o.MediaActionTypes.PAUSE})}),T.on("timeupdate",()=>{S({type:o.MediaActionTypes.SET_CURRENT_TIME,detail:T.currentTime()||0})}),T.on("durationchange",()=>{S({type:o.MediaActionTypes.SET_DURATION,detail:T.duration()||0})}),T.on("volumechange",()=>{S({type:o.MediaActionTypes.SET_VOLUME,detail:T.volume()||0}),S({type:T.muted()?o.MediaActionTypes.MUTE:o.MediaActionTypes.UNMUTE})}),T.on("ended",()=>{S({type:o.MediaActionTypes.PAUSE})}),T.on("error",O=>{const k=T.error();P(k?.message||"An error occurred"),S({type:o.MediaActionTypes.SET_ERROR,detail:k?.message||"Playback error"}),p?.(k)}),T.on("loadstart",()=>{S({type:o.MediaActionTypes.SET_LOADING,detail:!0})}),T.on("loadeddata",()=>{g(!1),S({type:o.MediaActionTypes.SET_LOADING,detail:!1})}),T.on("waiting",()=>{S({type:o.MediaActionTypes.SET_BUFFERING,detail:!0})}),T.on("playing",()=>{S({type:o.MediaActionTypes.SET_BUFFERING,detail:!1})}),T.on("texttrackchange",()=>{const O=T.textTracks(),k=[];if(O&&O.length)for(let I=0;I<O.length;I++){const N=O[I];N.mode==="showing"&&k.push({id:N.id,label:N.label,language:N.language,kind:N.kind})}S({type:o.MediaActionTypes.SET_ACTIVE_TEXT_TRACKS,detail:k})}),M.mediaRef&&(M.mediaRef.current=v.current),u?.(T),g(!1)}catch(D){console.error("Failed to initialize Video.js player:",D),P("Failed to initialize player"),g(!1),p?.(D)}};return E.useEffect(()=>(F(),()=>{j.current&&(j.current.destroy(),j.current=null),w.current&&(w.current.dispose(),w.current=null)}),[F]),E.useEffect(()=>{if(!w.current||!M.mediaRef)return;const D={play:()=>w.current?.play(),pause:()=>w.current?.pause(),seekTo:_=>{w.current&&w.current.currentTime(_)},setVolume:_=>{w.current&&w.current.volume(_)},setMuted:_=>{w.current&&w.current.muted(_)},setQualityLevel:_=>{j.current&&(j.current.currentLevel=_)},getQualityLevels:()=>j.current?j.current.levels:[],getCurrentQualityLevel:()=>j.current?j.current.currentLevel:-1,getBandwidthEstimate:()=>j.current?j.current.bandwidthEstimate:0};v.current&&Object.assign(v.current,D)},[M.mediaRef]),o.jsxRuntimeExports.jsxs("div",{className:C.cn("relative h-full w-full",d),children:[o.jsxRuntimeExports.jsx("video",{ref:v,className:"video-js vjs-default-skin vjs-big-play-centered h-full w-full",playsInline:!0}),b&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx("div",{className:"text-white",children:o.jsxRuntimeExports.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-white border-b-2"})})}),R&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80",children:o.jsxRuntimeExports.jsxs("div",{className:"text-center text-white",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm opacity-80",children:R})]})})]})}Mr.displayName="VideoJSAdapter";function Bn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function St(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Bn(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Bn(e[s],null)}}}}function X(...e){return f.useCallback(St(...e),e)}function Ze(e){const t=Vs(e),n=f.forwardRef((r,s)=>{const{children:i,...a}=r,c=f.Children.toArray(i),m=c.find(Us);if(m){const l=m.props.children,d=c.map(u=>u===m?f.Children.count(l)>1?f.Children.only(null):f.isValidElement(l)?l.props.children:null:u);return o.jsxRuntimeExports.jsx(t,{...a,ref:s,children:f.isValidElement(l)?f.cloneElement(l,void 0,d):null})}return o.jsxRuntimeExports.jsx(t,{...a,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var Bs=Ze("Slot");function Vs(e){const t=f.forwardRef((n,r)=>{const{children:s,...i}=n;if(f.isValidElement(s)){const a=Ks(s),c=Ws(i,s.props);return s.type!==f.Fragment&&(c.ref=r?St(r,a):a),f.cloneElement(s,c)}return f.Children.count(s)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hs=Symbol("radix.slottable");function Us(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hs}function Ws(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const m=i(...c);return s(...c),m}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Ks(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Vn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hn=C.clsx,Gs=(e,t)=>n=>{var r;if(t?.variants==null)return Hn(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,a=Object.keys(s).map(l=>{const d=n?.[l],u=i?.[l];if(d===null)return null;const p=Vn(d)||Vn(u);return s[l][p]}),c=n&&Object.entries(n).reduce((l,d)=>{let[u,p]=d;return p===void 0||(l[u]=p),l},{}),m=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,d)=>{let{class:u,className:p,...x}=d;return Object.entries(x).every(y=>{let[h,v]=y;return Array.isArray(v)?v.includes({...i,...c}[h]):{...i,...c}[h]===v})?[...l,u,p]:l},[]);return Hn(e,a,m,n?.class,n?.className)},Ys=Gs("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function q({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?Bs:"button";return o.jsxRuntimeExports.jsx(i,{"data-slot":"button",className:C.cn$1(Ys({variant:t,size:n,className:e})),...s})}/**
1
+ "use strict";var Ss=Object.create;var zt=Object.defineProperty;var Ps=Object.getOwnPropertyDescriptor;var Ns=Object.getOwnPropertyNames;var As=Object.getPrototypeOf,Ts=Object.prototype.hasOwnProperty;var ks=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ds=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ns(t))!Ts.call(e,s)&&s!==n&&zt(e,s,{get:()=>t[s],enumerable:!(r=Ps(t,s))||r.enumerable});return e};var De=(e,t,n)=>(n=e!=null?Ss(As(e)):{},Ds(t||!e||!e.__esModule?zt(n,"default",{value:e,enumerable:!0}):n,e));var de=(e,t,n)=>ks(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./context-eNS62_ac.cjs"),E=require("react"),U=require("./hooks-BXwI8QG6.cjs"),C=require("./utils-CFOue_9K.cjs"),we=require("./minimal-components-v4qBp6jv.cjs"),re=require("./enhanced-components-BspFs9OO.cjs"),_s=require("@radix-ui/react-tooltip"),Is=require("@radix-ui/react-slider"),_e=require("react-dom"),Os=require("./performance-monitor-lJmuUjQQ.cjs");function Ct(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=Ct(E),V=Ct(_s),te=Ct(Is),gr=Ct(_e);function Qe({children:e,className:t,size:n="md",variant:r="spinner"}){const s={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12"};return r==="spinner"?o.jsxRuntimeExports.jsxs("div",{className:C.cn("flex items-center justify-center",t),children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-spin rounded-full border-2 border-current border-t-transparent",s[n])}),e&&o.jsxRuntimeExports.jsx("span",{className:"ml-2 text-muted-foreground text-sm",children:e})]}):r==="skeleton"?o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-pulse rounded bg-muted",s[n],t)}):o.jsxRuntimeExports.jsx("div",{className:C.cn("animate-pulse bg-gradient-to-r bg-pos-0 bg-size-200 from-muted via-muted/50 to-muted","animate-shimmer rounded",s[n],t)})}function yr({children:e,fallback:t=o.jsxRuntimeExports.jsx(Qe,{}),className:n}){return o.jsxRuntimeExports.jsx("div",{className:n,children:o.jsxRuntimeExports.jsx(E.Suspense,{fallback:t,children:e})})}function Ls({error:e,resetError:t}){return o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-destructive/20 bg-destructive/10 p-6",children:[o.jsxRuntimeExports.jsx("div",{className:"mb-2 font-semibold text-destructive text-lg",children:"Media Player Error"}),o.jsxRuntimeExports.jsx("div",{className:"mb-4 text-center text-muted-foreground text-sm",children:e.message}),o.jsxRuntimeExports.jsx("button",{onClick:t,className:"rounded bg-primary px-4 py-2 text-primary-foreground transition-colors hover:bg-primary/90",children:"Try Again"})]})}class br extends E.Component{constructor(n){super(n);de(this,"resetError",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){this.props.onError?.(n,r),console.error("MediaErrorBoundary caught an error:",n,r)}render(){if(this.state.hasError&&this.state.error){const n=this.props.fallback||Ls;return o.jsxRuntimeExports.jsx(n,{error:this.state.error,resetError:this.resetError})}return this.props.children}}function Er({children:e,priority:t="normal",deferredMs:n=0}){const[r,s]=E.useState(n>0),i=E.useDeferredValue(e);return E.useEffect(()=>{if(n>0){const a=setTimeout(()=>{s(!1)},n);return()=>clearTimeout(a)}},[n]),r?o.jsxRuntimeExports.jsx(Qe,{variant:"skeleton"}):t==="high"?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):t==="low"?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:i}):o.jsxRuntimeExports.jsx(E.Suspense,{fallback:o.jsxRuntimeExports.jsx(Qe,{}),children:e})}function Fs(e=100){const[t,n]=E.useState(!1),r=E.useDeferredValue(t);return E.useEffect(()=>{const s=setTimeout(()=>{n(!0)},e);return()=>clearTimeout(s)},[e]),{isReady:r,actualIsReady:t}}function zs({children:e,className:t,loadingFallback:n=o.jsxRuntimeExports.jsx(Qe,{}),errorFallback:r,priority:s="normal",deferredMs:i=0,onError:a}){return o.jsxRuntimeExports.jsx("div",{className:t,children:o.jsxRuntimeExports.jsx(br,{fallback:r,onError:a,children:o.jsxRuntimeExports.jsx(yr,{fallback:n,children:o.jsxRuntimeExports.jsx(Er,{priority:s,deferredMs:i,children:e})})})})}const wr=E.forwardRef(({src:e,className:t,children:n,keyboardControls:r=!0,showControls:s=!0,customControls:i=!1,crossOrigin:a,enablePerformanceMonitoring:c=!0,bufferingStrategy:m="adaptive",preloadStrategy:l="progressive",enableOptimizations:d=!0,...u},p)=>{E.useTransition();const{state:x,controls:y,mediaRef:h,containerRef:v,performanceMetrics:w,isEnhanced:j}=U.useEnhancedMediaPlayer({src:e,crossOrigin:a,enablePerformanceMonitoring:c,bufferingStrategy:m,preloadStrategy:l,enableTimeUpdateThrottling:!0,timeUpdateThrottleMs:100,enableSeekPreview:!0,...u}),{memoryStats:b}=U.useMemoryOptimization({maxMemoryUsage:50,cleanupInterval:15e3,enableGC:!0,monitorMemory:d});U.useKeyboardControls({enabled:r,state:x,controls:y});const g=E.useMemo(()=>Array.isArray(e)?e.some(M=>/\.(mp4|webm|ogv|mov|avi)$/i.test(M)):/\.(mp4|webm|ogv|mov|avi)$/i.test(e),[e]),R=E.useMemo(()=>Array.isArray(e)?e.map((M,S)=>o.jsxRuntimeExports.jsx("source",{src:M},`${M}-${S}`)):null,[e]),P=E.useMemo(()=>({controls:s&&!i,className:C.cn("w-full transition-all duration-300",g&&"aspect-video","bg-[color:var(--media-bg)] rounded-lg",x.isTransitioning&&"opacity-90"),preload:l==="eager"?"auto":"metadata",crossOrigin:a,...Array.isArray(e)?{}:{src:e}}),[s,i,g,x.isTransitioning,l,a,e]);return o.jsxRuntimeExports.jsx(zs,{priority:"high",errorFallback:({error:M,resetError:S})=>o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass-strong animate-enter rounded-lg","bg-[color:var(--color-error)]/10 backdrop-blur-md"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-2 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsx("div",{className:"mx-auto w-fit rounded-full bg-[color:var(--color-error)]/20 p-3",children:o.jsxRuntimeExports.jsx("svg",{className:"size-6 text-[color:var(--color-error)]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Playback Error"}),o.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-[color:var(--media-text-secondary)] text-sm",children:M.message||x.error}),o.jsxRuntimeExports.jsx("button",{onClick:S,className:"mt-2 rounded bg-[color:var(--color-brand-primary)] px-4 py-2 text-sm text-white transition-colors hover:bg-[color:var(--color-brand-accent)]",children:"Try Again"})]})}),loadingFallback:o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass animate-enter rounded-lg","bg-[color:var(--media-bg)]/20 backdrop-blur-sm"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-4 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("size-12 animate-spin rounded-full border-2","border-[color:var(--color-brand-accent)]/30","border-t-[color:var(--color-brand-accent)]")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 size-12 rounded-full","bg-gradient-to-r from-[color:var(--color-brand-primary)] to-[color:var(--color-brand-accent)]","animate-pulse opacity-20 blur-sm")})]}),o.jsxRuntimeExports.jsx("p",{className:"font-medium text-[color:var(--media-text-secondary)] text-sm",children:"Loading media..."})]})}),children:o.jsxRuntimeExports.jsxs("div",{ref:p||v,className:C.cn("media-container relative overflow-hidden contain-strict","bg-[color:var(--media-bg)] focus-within:outline-none","rounded-xl border border-[color:var(--media-border)]/30","shadow-2xl shadow-[color:var(--media-bg)]/50","transition-all duration-300 ease-out","hover:border-[color:var(--media-border)]/50","hover:shadow-3xl hover:shadow-[color:var(--media-bg)]/60","will-change-transform",x.isTransitioning&&"cursor-wait",t),tabIndex:0,role:"application","aria-label":g?"Video player":"Audio player","aria-busy":x.isLoading||x.isBuffering,children:[g?o.jsxRuntimeExports.jsxs("video",{ref:h,...P,disablePictureInPicture:!1,playsInline:!0,"x-webkit-airplay":"allow",style:{willChange:"transform"},children:[R,"Your browser does not support the video element."]}):o.jsxRuntimeExports.jsxs("audio",{ref:h,...P,preload:l==="eager"?"auto":"metadata",children:[R,"Your browser does not support the audio element."]}),x.error&&o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass-strong animate-enter rounded-lg","bg-[color:var(--color-error)]/10 backdrop-blur-md"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-2 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsx("div",{className:"mx-auto w-fit rounded-full bg-[color:var(--color-error)]/20 p-3",children:o.jsxRuntimeExports.jsx("svg",{className:"size-6 text-[color:var(--color-error)]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Playback Error"}),o.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-[color:var(--media-text-secondary)] text-sm",children:x.error})]})}),x.isLoading&&o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 flex items-center justify-center","glass animate-enter rounded-lg","bg-[color:var(--media-bg)]/20 backdrop-blur-sm"),children:o.jsxRuntimeExports.jsxs("div",{className:"space-y-4 text-center text-[color:var(--media-text)]",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("size-12 animate-spin rounded-full border-2","border-[color:var(--color-brand-accent)]/30","border-t-[color:var(--color-brand-accent)]")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 size-12 rounded-full","bg-gradient-to-r from-[color:var(--color-brand-primary)] to-[color:var(--color-brand-accent)]","animate-pulse opacity-20 blur-sm")})]}),o.jsxRuntimeExports.jsx("p",{className:"font-medium text-[color:var(--media-text-secondary)] text-sm",children:x.isBuffering?"Buffering...":"Loading media..."})]})}),i&&typeof n=="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto absolute inset-0 z-50",children:n({state:x,controls:y})}),i&&typeof n!="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto absolute inset-0 z-50",children:n}),process.env.NODE_ENV==="development"&&c&&o.jsxRuntimeExports.jsxs("div",{className:"absolute bottom-2 left-2 rounded bg-black/50 px-2 py-1 text-white text-xs",children:[o.jsxRuntimeExports.jsxs("div",{children:["FPS: ",w.frameRate||0]}),o.jsxRuntimeExports.jsxs("div",{children:["Memory: ",b.usage.toFixed(1),"MB"]}),j&&o.jsxRuntimeExports.jsx("div",{children:"Enhanced ✓"})]})]})})});wr.displayName="MediaPlayer";const jr=E.forwardRef(({src:e,poster:t,width:n="100%",height:r="auto",aspectRatio:s="16/9",className:i,children:a,keyboardControls:c=!0,showControls:m=!0,customControls:l=!1,crossOrigin:d,...u},p)=>{const{state:x,controls:y,mediaRef:h,containerRef:v}=U.useMediaPlayer({src:e,crossOrigin:d,...u});U.useKeyboardControls({enabled:c,state:x,controls:y});const w=()=>Array.isArray(e)?e.map((g,R)=>o.jsxRuntimeExports.jsx("source",{src:g},R)):null,j={width:n,height:r,aspectRatio:r==="auto"?s:void 0},b={ref:h,controls:m&&!l,poster:t,className:"w-full h-full object-contain bg-black",...Array.isArray(e)?{}:{src:e}};return o.jsxRuntimeExports.jsxs("div",{ref:p||v,style:j,className:C.cn("relative overflow-hidden bg-black","focus-within:outline-none",i),tabIndex:0,children:[o.jsxRuntimeExports.jsxs("video",{...b,children:[Array.isArray(e)&&w(),"Your browser does not support the video element."]}),x.error&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80",children:o.jsxRuntimeExports.jsxs("div",{className:"text-center text-white",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm opacity-80",children:x.error})]})}),x.isLoading&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx("div",{className:"text-white",children:o.jsxRuntimeExports.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-white border-b-2"})})}),l&&typeof a=="function"&&o.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute inset-0",children:o.jsxRuntimeExports.jsx("div",{className:"pointer-events-auto",children:a({state:x,controls:y})})}),l&&typeof a!="function"&&a]})});jr.displayName="VideoPlayer";const Rr=E.forwardRef(({src:e,className:t,children:n,keyboardControls:r=!0,showControls:s=!0,customControls:i=!1,...a},c)=>{const{state:m,controls:l,mediaRef:d,containerRef:u}=U.useMediaPlayer({src:e,...a});U.useKeyboardControls({enabled:r,state:m,controls:l});const p=()=>Array.isArray(e)?e.map((y,h)=>o.jsxRuntimeExports.jsx("source",{src:y},h)):null,x={ref:d,controls:s&&!i,className:"w-full",...Array.isArray(e)?{}:{src:e}};return o.jsxRuntimeExports.jsxs("div",{ref:c||u,className:C.cn("relative","focus-within:outline-none",t),tabIndex:0,children:[o.jsxRuntimeExports.jsxs("audio",{...x,children:[Array.isArray(e)&&p(),"Your browser does not support the audio element."]}),m.error&&o.jsxRuntimeExports.jsx("div",{className:"mt-2 rounded-md border border-red-300 bg-red-100 p-3",children:o.jsxRuntimeExports.jsxs("div",{className:"text-red-800",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm",children:m.error})]})}),m.isLoading&&o.jsxRuntimeExports.jsx("div",{className:"mt-2 rounded-md border border-gray-300 bg-gray-100 p-3",children:o.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2 text-gray-600",children:[o.jsxRuntimeExports.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-gray-600 border-b-2"}),o.jsxRuntimeExports.jsx("span",{className:"text-sm",children:"Loading..."})]})}),i&&typeof n=="function"&&o.jsxRuntimeExports.jsx("div",{className:"mt-2",children:n({state:m,controls:l})}),i&&typeof n!="function"&&o.jsxRuntimeExports.jsx("div",{className:"mt-2",children:n})]})});Rr.displayName="AudioPlayer";let $t=null,$n=null;async function $s(){if(!$t){const[e,t]=await Promise.all([import("video.js"),import("hls.js")]);$t=e.default,$n=t.default,await Promise.all([import("@videojs/http-streaming"),import("videojs-contrib-quality-levels"),import("videojs-hls-quality-selector")])}return{videojs:$t,Hls:$n}}function Mr({sources:e,poster:t,textTracks:n=[],autoplay:r=!1,muted:s=!1,controls:i=!1,preload:a="metadata",fluid:c=!0,responsive:m=!0,playbackRates:l=[.5,.75,1,1.25,1.5,2],className:d,onReady:u,onError:p,hlsConfig:x={},enableQualitySelector:y=!0,enableSubtitles:h=!0}){const v=E.useRef(null),w=E.useRef(null),j=E.useRef(null),[b,g]=E.useState(!0),[R,P]=E.useState(null),M=o.useMediaContext(),S=o.useMediaDispatch(),F=async()=>{if(!(!v.current||w.current))try{g(!0);const{videojs:D,Hls:_}=await $s(),B=e.some(O=>O.type==="application/x-mpegURL")&&!v.current.canPlayType("application/vnd.apple.mpegurl"),$={autoplay:r,muted:s,controls:i,preload:a,fluid:c,responsive:m,playbackRates:l,sources:B?[]:e,poster:t,html5:{vhs:{overrideNative:!v.current.canPlayType("application/vnd.apple.mpegurl"),enableLowInitialPlaylist:!0,fastQualityChange:!0,handleManifestRedirects:!0}}},T=D(v.current,$,function(){console.log("Video.js player ready")});if(w.current=T,n.forEach(O=>{T.addRemoteTextTrack({kind:O.kind,src:O.src,srclang:O.srclang,label:O.label,default:O.default},!1)}),B){const O=e.find(k=>k.type==="application/x-mpegURL");if(O){const k=new _({debug:!1,enableWorker:!0,lowLatencyMode:!1,backBufferLength:30,maxBufferLength:30,maxMaxBufferLength:600,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,capLevelToPlayerSize:!0,capLevelOnFPSDrop:!0,renderTextTracksNatively:!1,subtitlePreference:{lang:navigator.language.split("-")[0],forced:!1},...x});j.current=k,k.loadSource(O.src),k.attachMedia(v.current),k.on(_.Events.MANIFEST_PARSED,()=>{if(console.log("HLS manifest parsed",{levels:k.levels.map(I=>({height:I.height,bitrate:I.bitrate,codec:I.codecSet}))}),y&&T.qualityLevels){const I=T.qualityLevels();k.levels.forEach((N,A)=>{I.addQualityLevel({id:A.toString(),label:`${N.height}p`,width:N.width,height:N.height,bitrate:N.bitrate,enabled:!0})})}}),k.on(_.Events.LEVEL_SWITCHED,(I,N)=>{console.log(`HLS quality switched to level ${N.level}`),S({type:o.MediaActionTypes.SET_QUALITY_LEVEL,detail:N.level})}),k.on(_.Events.ERROR,(I,N)=>{if(N.fatal)switch(N.type){case _.ErrorTypes.NETWORK_ERROR:console.error("Fatal network error encountered, try to recover"),k.startLoad();break;case _.ErrorTypes.MEDIA_ERROR:console.error("Fatal media error encountered, try to recover"),k.recoverMediaError();break;default:console.error("Fatal error, cannot recover"),P("Streaming error occurred"),p?.(N),k.destroy();break}}),k.on(_.Events.FRAG_LOADED,()=>{const I=k.bandwidthEstimate;I&&S({type:o.MediaActionTypes.SET_BANDWIDTH_ESTIMATE,detail:I})})}}y&&T.qualityLevels&&T.hlsQualitySelector({displayCurrentQuality:!0}),T.on("play",()=>{S({type:o.MediaActionTypes.PLAY})}),T.on("pause",()=>{S({type:o.MediaActionTypes.PAUSE})}),T.on("timeupdate",()=>{S({type:o.MediaActionTypes.SET_CURRENT_TIME,detail:T.currentTime()||0})}),T.on("durationchange",()=>{S({type:o.MediaActionTypes.SET_DURATION,detail:T.duration()||0})}),T.on("volumechange",()=>{S({type:o.MediaActionTypes.SET_VOLUME,detail:T.volume()||0}),S({type:T.muted()?o.MediaActionTypes.MUTE:o.MediaActionTypes.UNMUTE})}),T.on("ended",()=>{S({type:o.MediaActionTypes.PAUSE})}),T.on("error",O=>{const k=T.error();P(k?.message||"An error occurred"),S({type:o.MediaActionTypes.SET_ERROR,detail:k?.message||"Playback error"}),p?.(k)}),T.on("loadstart",()=>{S({type:o.MediaActionTypes.SET_LOADING,detail:!0})}),T.on("loadeddata",()=>{g(!1),S({type:o.MediaActionTypes.SET_LOADING,detail:!1})}),T.on("waiting",()=>{S({type:o.MediaActionTypes.SET_BUFFERING,detail:!0})}),T.on("playing",()=>{S({type:o.MediaActionTypes.SET_BUFFERING,detail:!1})}),T.on("texttrackchange",()=>{const O=T.textTracks(),k=[];if(O&&O.length)for(let I=0;I<O.length;I++){const N=O[I];N.mode==="showing"&&k.push({id:N.id,label:N.label,language:N.language,kind:N.kind})}S({type:o.MediaActionTypes.SET_ACTIVE_TEXT_TRACKS,detail:k})}),M.mediaRef&&(M.mediaRef.current=v.current),u?.(T),g(!1)}catch(D){console.error("Failed to initialize Video.js player:",D),P("Failed to initialize player"),g(!1),p?.(D)}};return E.useEffect(()=>(F(),()=>{j.current&&(j.current.destroy(),j.current=null),w.current&&(w.current.dispose(),w.current=null)}),[F]),E.useEffect(()=>{if(!w.current||!M.mediaRef)return;const D={play:()=>w.current?.play(),pause:()=>w.current?.pause(),seekTo:_=>{w.current&&w.current.currentTime(_)},setVolume:_=>{w.current&&w.current.volume(_)},setMuted:_=>{w.current&&w.current.muted(_)},setQualityLevel:_=>{j.current&&(j.current.currentLevel=_)},getQualityLevels:()=>j.current?j.current.levels:[],getCurrentQualityLevel:()=>j.current?j.current.currentLevel:-1,getBandwidthEstimate:()=>j.current?j.current.bandwidthEstimate:0};v.current&&Object.assign(v.current,D)},[M.mediaRef]),o.jsxRuntimeExports.jsxs("div",{className:C.cn("relative h-full w-full",d),children:[o.jsxRuntimeExports.jsx("video",{ref:v,className:"video-js vjs-default-skin vjs-big-play-centered h-full w-full",playsInline:!0}),b&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx("div",{className:"text-white",children:o.jsxRuntimeExports.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-white border-b-2"})})}),R&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80",children:o.jsxRuntimeExports.jsxs("div",{className:"text-center text-white",children:[o.jsxRuntimeExports.jsx("p",{className:"font-semibold text-lg",children:"Error"}),o.jsxRuntimeExports.jsx("p",{className:"text-sm opacity-80",children:R})]})})]})}Mr.displayName="VideoJSAdapter";function Bn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function St(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Bn(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Bn(e[s],null)}}}}function X(...e){return f.useCallback(St(...e),e)}function Ze(e){const t=Vs(e),n=f.forwardRef((r,s)=>{const{children:i,...a}=r,c=f.Children.toArray(i),m=c.find(Us);if(m){const l=m.props.children,d=c.map(u=>u===m?f.Children.count(l)>1?f.Children.only(null):f.isValidElement(l)?l.props.children:null:u);return o.jsxRuntimeExports.jsx(t,{...a,ref:s,children:f.isValidElement(l)?f.cloneElement(l,void 0,d):null})}return o.jsxRuntimeExports.jsx(t,{...a,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var Bs=Ze("Slot");function Vs(e){const t=f.forwardRef((n,r)=>{const{children:s,...i}=n;if(f.isValidElement(s)){const a=Ks(s),c=Ws(i,s.props);return s.type!==f.Fragment&&(c.ref=r?St(r,a):a),f.cloneElement(s,c)}return f.Children.count(s)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hs=Symbol("radix.slottable");function Us(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hs}function Ws(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{const m=i(...c);return s(...c),m}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Ks(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Vn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hn=C.clsx,Gs=(e,t)=>n=>{var r;if(t?.variants==null)return Hn(e,n?.class,n?.className);const{variants:s,defaultVariants:i}=t,a=Object.keys(s).map(l=>{const d=n?.[l],u=i?.[l];if(d===null)return null;const p=Vn(d)||Vn(u);return s[l][p]}),c=n&&Object.entries(n).reduce((l,d)=>{let[u,p]=d;return p===void 0||(l[u]=p),l},{}),m=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,d)=>{let{class:u,className:p,...x}=d;return Object.entries(x).every(y=>{let[h,v]=y;return Array.isArray(v)?v.includes({...i,...c}[h]):{...i,...c}[h]===v})?[...l,u,p]:l},[]);return Hn(e,a,m,n?.class,n?.className)},Ys=Gs("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function q({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?Bs:"button";return o.jsxRuntimeExports.jsx(i,{"data-slot":"button",className:C.cn$1(Ys({variant:t,size:n,className:e})),...s})}/**
2
2
  * @license lucide-react v0.511.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -108,5 +108,5 @@
108
108
  `)},er=function(){var e=parseInt(document.body.getAttribute(He)||"0",10);return isFinite(e)?e:0},xa=function(){f.useEffect(function(){return document.body.setAttribute(He,(er()+1).toString()),function(){var e=er()-1;e<=0?document.body.removeAttribute(He):document.body.setAttribute(He,e.toString())}},[])},ha=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;xa();var i=f.useMemo(function(){return fa(s)},[s]);return f.createElement(ma,{styles:pa(i,!t,s,n?"":"!important")})},an=!1;if(typeof window<"u")try{var dt=Object.defineProperty({},"passive",{get:function(){return an=!0,!0}});window.addEventListener("test",dt,dt),window.removeEventListener("test",dt,dt)}catch{an=!1}var $e=an?{passive:!1}:!1,va=function(e){return e.tagName==="TEXTAREA"},Wr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!va(e)&&n[t]==="visible")},ga=function(e){return Wr(e,"overflowY")},ya=function(e){return Wr(e,"overflowX")},tr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Kr(e,r);if(s){var i=Gr(e,r),a=i[1],c=i[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ba=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ea=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Kr=function(e,t){return e==="v"?ga(t):ya(t)},Gr=function(e,t){return e==="v"?ba(t):Ea(t)},wa=function(e,t){return e==="h"&&t==="rtl"?-1:1},ja=function(e,t,n,r,s){var i=wa(e,window.getComputedStyle(t).direction),a=i*r,c=n.target,m=t.contains(c),l=!1,d=a>0,u=0,p=0;do{if(!c)break;var x=Gr(e,c),y=x[0],h=x[1],v=x[2],w=h-v-i*y;(y||w)&&Kr(e,c)&&(u+=w,p+=y);var j=c.parentNode;c=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!m&&c!==document.body||m&&(t.contains(c)||t===c));return(d&&Math.abs(u)<1||!d&&Math.abs(p)<1)&&(l=!0),l},ft=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nr=function(e){return[e.deltaX,e.deltaY]},rr=function(e){return e&&"current"in e?e.current:e},Ra=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ma=function(e){return`
109
109
  .block-interactivity-`.concat(e,` {pointer-events: none;}
110
110
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
111
- `)},Ca=0,Be=[];function Sa(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),s=f.useState(Ca++)[0],i=f.useState(Ur)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var h=Yi([e.lockRef.current],(e.shards||[]).map(rr),!0).filter(Boolean);return h.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=f.useCallback(function(h,v){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var w=ft(h),j=n.current,b="deltaX"in h?h.deltaX:j[0]-w[0],g="deltaY"in h?h.deltaY:j[1]-w[1],R,P=h.target,M=Math.abs(b)>Math.abs(g)?"h":"v";if("touches"in h&&M==="h"&&P.type==="range")return!1;var S=tr(M,P);if(!S)return!0;if(S?R=M:(R=M==="v"?"h":"v",S=tr(M,P)),!S)return!1;if(!r.current&&"changedTouches"in h&&(b||g)&&(r.current=R),!R)return!0;var F=r.current||R;return ja(F,v,h,F==="h"?b:g)},[]),m=f.useCallback(function(h){var v=h;if(!(!Be.length||Be[Be.length-1]!==i)){var w="deltaY"in v?nr(v):ft(v),j=t.current.filter(function(R){return R.name===v.type&&(R.target===v.target||v.target===R.shadowParent)&&Ra(R.delta,w)})[0];if(j&&j.should){v.cancelable&&v.preventDefault();return}if(!j){var b=(a.current.shards||[]).map(rr).filter(Boolean).filter(function(R){return R.contains(v.target)}),g=b.length>0?c(v,b[0]):!a.current.noIsolation;g&&v.cancelable&&v.preventDefault()}}},[]),l=f.useCallback(function(h,v,w,j){var b={name:h,delta:v,target:w,should:j,shadowParent:Pa(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(g){return g!==b})},1)},[]),d=f.useCallback(function(h){n.current=ft(h),r.current=void 0},[]),u=f.useCallback(function(h){l(h.type,nr(h),h.target,c(h,e.lockRef.current))},[]),p=f.useCallback(function(h){l(h.type,ft(h),h.target,c(h,e.lockRef.current))},[]);f.useEffect(function(){return Be.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",m,$e),document.addEventListener("touchmove",m,$e),document.addEventListener("touchstart",d,$e),function(){Be=Be.filter(function(h){return h!==i}),document.removeEventListener("wheel",m,$e),document.removeEventListener("touchmove",m,$e),document.removeEventListener("touchstart",d,$e)}},[]);var x=e.removeScrollBar,y=e.inert;return f.createElement(f.Fragment,null,y?f.createElement(i,{styles:Ma(s)}):null,x?f.createElement(ha,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pa(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Na=ra(Hr,Sa);var Yr=f.forwardRef(function(e,t){return f.createElement(Pt,fe({},e,{ref:t,sideCar:Na}))});Yr.classNames=Pt.classNames;var Aa=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ve=new WeakMap,mt=new WeakMap,pt={},Gt=0,qr=function(e){return e&&(e.host||qr(e.parentNode))},Ta=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ka=function(e,t,n,r){var s=Ta(t,Array.isArray(e)?e:[e]);pt[n]||(pt[n]=new WeakMap);var i=pt[n],a=[],c=new Set,m=new Set(s),l=function(u){!u||c.has(u)||(c.add(u),l(u.parentNode))};s.forEach(l);var d=function(u){!u||m.has(u)||Array.prototype.forEach.call(u.children,function(p){if(c.has(p))d(p);else try{var x=p.getAttribute(r),y=x!==null&&x!=="false",h=(Ve.get(p)||0)+1,v=(i.get(p)||0)+1;Ve.set(p,h),i.set(p,v),a.push(p),h===1&&y&&mt.set(p,!0),v===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return d(t),c.clear(),Gt++,function(){a.forEach(function(u){var p=Ve.get(u)-1,x=i.get(u)-1;Ve.set(u,p),i.set(u,x),p||(mt.has(u)||u.removeAttribute(r),mt.delete(u)),x||u.removeAttribute(n)}),Gt--,Gt||(Ve=new WeakMap,Ve=new WeakMap,mt=new WeakMap,pt={})}},Da=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Aa(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),ka(r,s,n,"aria-hidden")):function(){return null}};function _a(e){const[t,n]=f.useState(void 0);return Ce(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,c;if("borderBoxSize"in i){const m=i.borderBoxSize,l=Array.isArray(m)?m[0]:m;a=l.inlineSize,c=l.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Ia=["top","right","bottom","left"],Se=Math.min,Q=Math.max,bt=Math.round,xt=Math.floor,pe=e=>({x:e,y:e}),Oa={left:"right",right:"left",bottom:"top",top:"bottom"},La={start:"end",end:"start"};function cn(e,t,n){return Q(e,Se(t,n))}function be(e,t){return typeof e=="function"?e(t):e}function Ee(e){return e.split("-")[0]}function Ke(e){return e.split("-")[1]}function mn(e){return e==="x"?"y":"x"}function pn(e){return e==="y"?"height":"width"}function me(e){return["top","bottom"].includes(Ee(e))?"y":"x"}function xn(e){return mn(me(e))}function Fa(e,t,n){n===void 0&&(n=!1);const r=Ke(e),s=xn(e),i=pn(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Et(a)),[a,Et(a)]}function za(e){const t=Et(e);return[ln(e),t,ln(t)]}function ln(e){return e.replace(/start|end/g,t=>La[t])}function $a(e,t,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?i:a;default:return[]}}function Ba(e,t,n,r){const s=Ke(e);let i=$a(Ee(e),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(ln)))),i}function Et(e){return e.replace(/left|right|bottom|top/g,t=>Oa[t])}function Va(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xr(e){return typeof e!="number"?Va(e):{top:e,right:e,bottom:e,left:e}}function wt(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function or(e,t,n){let{reference:r,floating:s}=e;const i=me(t),a=xn(t),c=pn(a),m=Ee(t),l=i==="y",d=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,p=r[c]/2-s[c]/2;let x;switch(m){case"top":x={x:d,y:r.y-s.height};break;case"bottom":x={x:d,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:u};break;case"left":x={x:r.x-s.width,y:u};break;default:x={x:r.x,y:r.y}}switch(Ke(t)){case"start":x[a]-=p*(n&&l?-1:1);break;case"end":x[a]+=p*(n&&l?-1:1);break}return x}const Ha=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),m=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:u}=or(l,r,m),p=r,x={},y=0;for(let h=0;h<c.length;h++){const{name:v,fn:w}=c[h],{x:j,y:b,data:g,reset:R}=await w({x:d,y:u,initialPlacement:r,placement:p,strategy:s,middlewareData:x,rects:l,platform:a,elements:{reference:e,floating:t}});d=j??d,u=b??u,x={...x,[v]:{...x[v],...g}},R&&y<=50&&(y++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(l=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):R.rects),{x:d,y:u}=or(l,p,m)),h=-1)}return{x:d,y:u,placement:p,strategy:s,middlewareData:x}};async function Je(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:a,elements:c,strategy:m}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:x=0}=be(t,e),y=Xr(x),v=c[p?u==="floating"?"reference":"floating":u],w=wt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:m})),j=u==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),g=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},R=wt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:j,offsetParent:b,strategy:m}):j);return{top:(w.top-R.top+y.top)/g.y,bottom:(R.bottom-w.bottom+y.bottom)/g.y,left:(w.left-R.left+y.left)/g.x,right:(R.right-w.right+y.right)/g.x}}const Ua=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:a,elements:c,middlewareData:m}=t,{element:l,padding:d=0}=be(e,t)||{};if(l==null)return{};const u=Xr(d),p={x:n,y:r},x=xn(s),y=pn(x),h=await a.getDimensions(l),v=x==="y",w=v?"top":"left",j=v?"bottom":"right",b=v?"clientHeight":"clientWidth",g=i.reference[y]+i.reference[x]-p[x]-i.floating[y],R=p[x]-i.reference[x],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let M=P?P[b]:0;(!M||!await(a.isElement==null?void 0:a.isElement(P)))&&(M=c.floating[b]||i.floating[y]);const S=g/2-R/2,F=M/2-h[y]/2-1,D=Se(u[w],F),_=Se(u[j],F),B=D,$=M-h[y]-_,T=M/2-h[y]/2+S,O=cn(B,T,$),k=!m.arrow&&Ke(s)!=null&&T!==O&&i.reference[y]/2-(T<B?D:_)-h[y]/2<0,I=k?T<B?T-B:T-$:0;return{[x]:p[x]+I,data:{[x]:O,centerOffset:T-O-I,...k&&{alignmentOffset:I}},reset:k}}}),Wa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:c,platform:m,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:h=!0,...v}=be(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Ee(s),j=me(c),b=Ee(c)===c,g=await(m.isRTL==null?void 0:m.isRTL(l.floating)),R=p||(b||!h?[Et(c)]:za(c)),P=y!=="none";!p&&P&&R.push(...Ba(c,h,y,g));const M=[c,...R],S=await Je(t,v),F=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&F.push(S[w]),u){const T=Fa(s,a,g);F.push(S[T[0]],S[T[1]])}if(D=[...D,{placement:s,overflows:F}],!F.every(T=>T<=0)){var _,B;const T=(((_=i.flip)==null?void 0:_.index)||0)+1,O=M[T];if(O&&(!(u==="alignment"?j!==me(O):!1)||D.every(N=>N.overflows[0]>0&&me(N.placement)===j)))return{data:{index:T,overflows:D},reset:{placement:O}};let k=(B=D.filter(I=>I.overflows[0]<=0).sort((I,N)=>I.overflows[1]-N.overflows[1])[0])==null?void 0:B.placement;if(!k)switch(x){case"bestFit":{var $;const I=($=D.filter(N=>{if(P){const A=me(N.placement);return A===j||A==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(A=>A>0).reduce((A,W)=>A+W,0)]).sort((N,A)=>N[1]-A[1])[0])==null?void 0:$[0];I&&(k=I);break}case"initialPlacement":k=c;break}if(s!==k)return{reset:{placement:k}}}return{}}}};function sr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ir(e){return Ia.some(t=>e[t]>=0)}const Ka=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=be(e,t);switch(r){case"referenceHidden":{const i=await Je(t,{...s,elementContext:"reference"}),a=sr(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ir(a)}}}case"escaped":{const i=await Je(t,{...s,altBoundary:!0}),a=sr(i,n.floating);return{data:{escapedOffsets:a,escaped:ir(a)}}}default:return{}}}}};async function Ga(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Ee(n),c=Ke(n),m=me(n)==="y",l=["left","top"].includes(a)?-1:1,d=i&&m?-1:1,u=be(t,e);let{mainAxis:p,crossAxis:x,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof y=="number"&&(x=c==="end"?y*-1:y),m?{x:x*d,y:p*l}:{x:p*l,y:x*d}}const Ya=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:a,middlewareData:c}=t,m=await Ga(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+m.x,y:i+m.y,data:{...m,placement:a}}}}},qa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:w,y:j}=v;return{x:w,y:j}}},...m}=be(e,t),l={x:n,y:r},d=await Je(t,m),u=me(Ee(s)),p=mn(u);let x=l[p],y=l[u];if(i){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",j=x+d[v],b=x-d[w];x=cn(j,x,b)}if(a){const v=u==="y"?"top":"left",w=u==="y"?"bottom":"right",j=y+d[v],b=y-d[w];y=cn(j,y,b)}const h=c.fn({...t,[p]:x,[u]:y});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:i,[u]:a}}}}}},Xa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:m=!0,crossAxis:l=!0}=be(e,t),d={x:n,y:r},u=me(s),p=mn(u);let x=d[p],y=d[u];const h=be(c,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(m){const b=p==="y"?"height":"width",g=i.reference[p]-i.floating[b]+v.mainAxis,R=i.reference[p]+i.reference[b]-v.mainAxis;x<g?x=g:x>R&&(x=R)}if(l){var w,j;const b=p==="y"?"width":"height",g=["top","left"].includes(Ee(s)),R=i.reference[u]-i.floating[b]+(g&&((w=a.offset)==null?void 0:w[u])||0)+(g?0:v.crossAxis),P=i.reference[u]+i.reference[b]+(g?0:((j=a.offset)==null?void 0:j[u])||0)-(g?v.crossAxis:0);y<R?y=R:y>P&&(y=P)}return{[p]:x,[u]:y}}}},Qa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:a,elements:c}=t,{apply:m=()=>{},...l}=be(e,t),d=await Je(t,l),u=Ee(s),p=Ke(s),x=me(s)==="y",{width:y,height:h}=i.floating;let v,w;u==="top"||u==="bottom"?(v=u,w=p===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(w=u,v=p==="end"?"top":"bottom");const j=h-d.top-d.bottom,b=y-d.left-d.right,g=Se(h-d[v],j),R=Se(y-d[w],b),P=!t.middlewareData.shift;let M=g,S=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=j),P&&!p){const D=Q(d.left,0),_=Q(d.right,0),B=Q(d.top,0),$=Q(d.bottom,0);x?S=y-2*(D!==0||_!==0?D+_:Q(d.left,d.right)):M=h-2*(B!==0||$!==0?B+$:Q(d.top,d.bottom))}await m({...t,availableWidth:S,availableHeight:M});const F=await a.getDimensions(c.floating);return y!==F.width||h!==F.height?{reset:{rects:!0}}:{}}}};function Nt(){return typeof window<"u"}function Ge(e){return Qr(e)?(e.nodeName||"").toLowerCase():"#document"}function Z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function he(e){var t;return(t=(Qr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qr(e){return Nt()?e instanceof Node||e instanceof Z(e).Node:!1}function ae(e){return Nt()?e instanceof Element||e instanceof Z(e).Element:!1}function xe(e){return Nt()?e instanceof HTMLElement||e instanceof Z(e).HTMLElement:!1}function ar(e){return!Nt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot}function st(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Za(e){return["table","td","th"].includes(Ge(e))}function At(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function hn(e){const t=vn(),n=ae(e)?ce(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ja(e){let t=Pe(e);for(;xe(t)&&!We(t);){if(hn(t))return t;if(At(t))return null;t=Pe(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function We(e){return["html","body","#document"].includes(Ge(e))}function ce(e){return Z(e).getComputedStyle(e)}function Tt(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pe(e){if(Ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ar(e)&&e.host||he(e);return ar(t)?t.host:t}function Zr(e){const t=Pe(e);return We(t)?e.ownerDocument?e.ownerDocument.body:e.body:xe(t)&&st(t)?t:Zr(t)}function et(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Zr(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),a=Z(s);if(i){const c=un(a);return t.concat(a,a.visualViewport||[],st(s)?s:[],c&&n?et(c):[])}return t.concat(s,et(s,[],n))}function un(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jr(e){const t=ce(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=xe(e),i=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=bt(n)!==i||bt(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function gn(e){return ae(e)?e:e.contextElement}function Ue(e){const t=gn(e);if(!xe(t))return pe(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=Jr(t);let a=(i?bt(n.width):n.width)/r,c=(i?bt(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const ec=pe(0);function eo(e){const t=Z(e);return!vn()||!t.visualViewport?ec:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Z(e)?!1:t}function Ie(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=gn(e);let a=pe(1);t&&(r?ae(r)&&(a=Ue(r)):a=Ue(e));const c=tc(i,n,r)?eo(i):pe(0);let m=(s.left+c.x)/a.x,l=(s.top+c.y)/a.y,d=s.width/a.x,u=s.height/a.y;if(i){const p=Z(i),x=r&&ae(r)?Z(r):r;let y=p,h=un(y);for(;h&&r&&x!==y;){const v=Ue(h),w=h.getBoundingClientRect(),j=ce(h),b=w.left+(h.clientLeft+parseFloat(j.paddingLeft))*v.x,g=w.top+(h.clientTop+parseFloat(j.paddingTop))*v.y;m*=v.x,l*=v.y,d*=v.x,u*=v.y,m+=b,l+=g,y=Z(h),h=un(y)}}return wt({width:d,height:u,x:m,y:l})}function yn(e,t){const n=Tt(e).scrollLeft;return t?t.left+n:Ie(he(e)).left+n}function to(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:yn(e,r)),i=r.top+t.scrollTop;return{x:s,y:i}}function nc(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",a=he(r),c=t?At(t.floating):!1;if(r===a||c&&i)return n;let m={scrollLeft:0,scrollTop:0},l=pe(1);const d=pe(0),u=xe(r);if((u||!u&&!i)&&((Ge(r)!=="body"||st(a))&&(m=Tt(r)),xe(r))){const x=Ie(r);l=Ue(r),d.x=x.x+r.clientLeft,d.y=x.y+r.clientTop}const p=a&&!u&&!i?to(a,m,!0):pe(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-m.scrollLeft*l.x+d.x+p.x,y:n.y*l.y-m.scrollTop*l.y+d.y+p.y}}function rc(e){return Array.from(e.getClientRects())}function oc(e){const t=he(e),n=Tt(e),r=e.ownerDocument.body,s=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+yn(e);const c=-n.scrollTop;return ce(r).direction==="rtl"&&(a+=Q(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:c}}function sc(e,t){const n=Z(e),r=he(e),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,c=0,m=0;if(s){i=s.width,a=s.height;const l=vn();(!l||l&&t==="fixed")&&(c=s.offsetLeft,m=s.offsetTop)}return{width:i,height:a,x:c,y:m}}function ic(e,t){const n=Ie(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=xe(e)?Ue(e):pe(1),a=e.clientWidth*i.x,c=e.clientHeight*i.y,m=s*i.x,l=r*i.y;return{width:a,height:c,x:m,y:l}}function cr(e,t,n){let r;if(t==="viewport")r=sc(e,n);else if(t==="document")r=oc(he(e));else if(ae(t))r=ic(t,n);else{const s=eo(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return wt(r)}function no(e,t){const n=Pe(e);return n===t||!ae(n)||We(n)?!1:ce(n).position==="fixed"||no(n,t)}function ac(e,t){const n=t.get(e);if(n)return n;let r=et(e,[],!1).filter(c=>ae(c)&&Ge(c)!=="body"),s=null;const i=ce(e).position==="fixed";let a=i?Pe(e):e;for(;ae(a)&&!We(a);){const c=ce(a),m=hn(a);!m&&c.position==="fixed"&&(s=null),(i?!m&&!s:!m&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||st(a)&&!m&&no(e,a))?r=r.filter(d=>d!==a):s=c,a=Pe(a)}return t.set(e,r),r}function cc(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?At(t)?[]:ac(t,this._c):[].concat(n),r],c=a[0],m=a.reduce((l,d)=>{const u=cr(t,d,s);return l.top=Q(u.top,l.top),l.right=Se(u.right,l.right),l.bottom=Se(u.bottom,l.bottom),l.left=Q(u.left,l.left),l},cr(t,c,s));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function lc(e){const{width:t,height:n}=Jr(e);return{width:t,height:n}}function uc(e,t,n){const r=xe(t),s=he(t),i=n==="fixed",a=Ie(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const m=pe(0);function l(){m.x=yn(s)}if(r||!r&&!i)if((Ge(t)!=="body"||st(s))&&(c=Tt(t)),r){const x=Ie(t,!0,i,t);m.x=x.x+t.clientLeft,m.y=x.y+t.clientTop}else s&&l();i&&!r&&s&&l();const d=s&&!r&&!i?to(s,c):pe(0),u=a.left+c.scrollLeft-m.x-d.x,p=a.top+c.scrollTop-m.y-d.y;return{x:u,y:p,width:a.width,height:a.height}}function Yt(e){return ce(e).position==="static"}function lr(e,t){if(!xe(e)||ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return he(e)===n&&(n=n.ownerDocument.body),n}function ro(e,t){const n=Z(e);if(At(e))return n;if(!xe(e)){let s=Pe(e);for(;s&&!We(s);){if(ae(s)&&!Yt(s))return s;s=Pe(s)}return n}let r=lr(e,t);for(;r&&Za(r)&&Yt(r);)r=lr(r,t);return r&&We(r)&&Yt(r)&&!hn(r)?n:r||Ja(e)||n}const dc=async function(e){const t=this.getOffsetParent||ro,n=this.getDimensions,r=await n(e.floating);return{reference:uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fc(e){return ce(e).direction==="rtl"}const mc={convertOffsetParentRelativeRectToViewportRelativeRect:nc,getDocumentElement:he,getClippingRect:cc,getOffsetParent:ro,getElementRects:dc,getClientRects:rc,getDimensions:lc,getScale:Ue,isElement:ae,isRTL:fc};function oo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pc(e,t){let n=null,r;const s=he(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),i();const l=e.getBoundingClientRect(),{left:d,top:u,width:p,height:x}=l;if(c||t(),!p||!x)return;const y=xt(u),h=xt(s.clientWidth-(d+p)),v=xt(s.clientHeight-(u+x)),w=xt(d),b={rootMargin:-y+"px "+-h+"px "+-v+"px "+-w+"px",threshold:Q(0,Se(1,m))||1};let g=!0;function R(P){const M=P[0].intersectionRatio;if(M!==m){if(!g)return a();M?a(!1,M):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!oo(l,e.getBoundingClientRect())&&a(),g=!1}try{n=new IntersectionObserver(R,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(R,b)}n.observe(e)}return a(!0),i}function xc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=r,l=gn(e),d=s||i?[...l?et(l):[],...et(t)]:[];d.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const u=l&&c?pc(l,n):null;let p=-1,x=null;a&&(x=new ResizeObserver(w=>{let[j]=w;j&&j.target===l&&x&&(x.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=x)==null||b.observe(t)})),n()}),l&&!m&&x.observe(l),x.observe(t));let y,h=m?Ie(e):null;m&&v();function v(){const w=Ie(e);h&&!oo(h,w)&&n(),h=w,y=requestAnimationFrame(v)}return n(),()=>{var w;d.forEach(j=>{s&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),u?.(),(w=x)==null||w.disconnect(),x=null,m&&cancelAnimationFrame(y)}}const hc=Ya,vc=qa,gc=Wa,yc=Qa,bc=Ka,ur=Ua,Ec=Xa,wc=(e,t,n)=>{const r=new Map,s={platform:mc,...n},i={...s.platform,_c:r};return Ha(e,t,{...s,platform:i})};var jc=typeof document<"u",Rc=function(){},yt=jc?E.useLayoutEffect:Rc;function jt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!jt(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!jt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function so(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dr(e,t){const n=so(e);return Math.round(t*n)/n}function qt(e){const t=f.useRef(e);return yt(()=>{t.current=e}),t}function Mc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:m,open:l}=e,[d,u]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,x]=f.useState(r);jt(p,r)||x(r);const[y,h]=f.useState(null),[v,w]=f.useState(null),j=f.useCallback(N=>{N!==P.current&&(P.current=N,h(N))},[]),b=f.useCallback(N=>{N!==M.current&&(M.current=N,w(N))},[]),g=i||y,R=a||v,P=f.useRef(null),M=f.useRef(null),S=f.useRef(d),F=m!=null,D=qt(m),_=qt(s),B=qt(l),$=f.useCallback(()=>{if(!P.current||!M.current)return;const N={placement:t,strategy:n,middleware:p};_.current&&(N.platform=_.current),wc(P.current,M.current,N).then(A=>{const W={...A,isPositioned:B.current!==!1};T.current&&!jt(S.current,W)&&(S.current=W,gr.flushSync(()=>{u(W)}))})},[p,t,n,_,B]);yt(()=>{l===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[l]);const T=f.useRef(!1);yt(()=>(T.current=!0,()=>{T.current=!1}),[]),yt(()=>{if(g&&(P.current=g),R&&(M.current=R),g&&R){if(D.current)return D.current(g,R,$);$()}},[g,R,$,D,F]);const O=f.useMemo(()=>({reference:P,floating:M,setReference:j,setFloating:b}),[j,b]),k=f.useMemo(()=>({reference:g,floating:R}),[g,R]),I=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!k.floating)return N;const A=dr(k.floating,d.x),W=dr(k.floating,d.y);return c?{...N,transform:"translate("+A+"px, "+W+"px)",...so(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:W}},[n,c,k.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:$,refs:O,elements:k,floatingStyles:I}),[d,$,O,k,I])}const Cc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ur({element:r.current,padding:s}).fn(n):{}:r?ur({element:r,padding:s}).fn(n):{}}}},Sc=(e,t)=>({...hc(e),options:[e,t]}),Pc=(e,t)=>({...vc(e),options:[e,t]}),Nc=(e,t)=>({...Ec(e),options:[e,t]}),Ac=(e,t)=>({...gc(e),options:[e,t]}),Tc=(e,t)=>({...yc(e),options:[e,t]}),kc=(e,t)=>({...bc(e),options:[e,t]}),Dc=(e,t)=>({...Cc(e),options:[e,t]});var _c="Arrow",io=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return o.jsxRuntimeExports.jsx(G.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsxRuntimeExports.jsx("polygon",{points:"0,0 30,0 15,10"})})});io.displayName=_c;var Ic=io,bn="Popper",[ao,co]=rt(bn),[Oc,lo]=ao(bn),uo=e=>{const{__scopePopper:t,children:n}=e,[r,s]=f.useState(null);return o.jsxRuntimeExports.jsx(Oc,{scope:t,anchor:r,onAnchorChange:s,children:n})};uo.displayName=bn;var fo="PopperAnchor",mo=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=lo(fo,n),a=f.useRef(null),c=X(t,a);return f.useEffect(()=>{i.onAnchorChange(r?.current||a.current)}),r?null:o.jsxRuntimeExports.jsx(G.div,{...s,ref:c})});mo.displayName=fo;var En="PopperContent",[Lc,Fc]=ao(En),po=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:m=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:x="optimized",onPlaced:y,...h}=e,v=lo(En,n),[w,j]=f.useState(null),b=X(t,H=>j(H)),[g,R]=f.useState(null),P=_a(g),M=P?.width??0,S=P?.height??0,F=r+(i!=="center"?"-"+i:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},_=Array.isArray(l)?l:[l],B=_.length>0,$={padding:D,boundary:_.filter($c),altBoundary:B},{refs:T,floatingStyles:O,placement:k,isPositioned:I,middlewareData:N}=Mc({strategy:"fixed",placement:F,whileElementsMounted:(...H)=>xc(...H,{animationFrame:x==="always"}),elements:{reference:v.anchor},middleware:[Sc({mainAxis:s+S,alignmentAxis:a}),m&&Pc({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Nc():void 0,...$}),m&&Ac({...$}),Tc({...$,apply:({elements:H,rects:K,availableWidth:Te,availableHeight:je})=>{const{width:Ye,height:ue}=K.reference,Re=H.floating.style;Re.setProperty("--radix-popper-available-width",`${Te}px`),Re.setProperty("--radix-popper-available-height",`${je}px`),Re.setProperty("--radix-popper-anchor-width",`${Ye}px`),Re.setProperty("--radix-popper-anchor-height",`${ue}px`)}}),g&&Dc({element:g,padding:c}),Bc({arrowWidth:M,arrowHeight:S}),p&&kc({strategy:"referenceHidden",...$})]}),[A,W]=vo(k),J=ye(y);Ce(()=>{I&&J?.()},[I,J]);const ve=N.arrow?.x,Ne=N.arrow?.y,Ae=N.arrow?.centerOffset!==0,[Fe,ge]=f.useState();return Ce(()=>{w&&ge(window.getComputedStyle(w).zIndex)},[w]),o.jsxRuntimeExports.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:I?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Fe,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsxRuntimeExports.jsx(Lc,{scope:n,placedSide:A,onArrowChange:R,arrowX:ve,arrowY:Ne,shouldHideArrow:Ae,children:o.jsxRuntimeExports.jsx(G.div,{"data-side":A,"data-align":W,...h,ref:b,style:{...h.style,animation:I?void 0:"none"}})})})});po.displayName=En;var xo="PopperArrow",zc={top:"bottom",right:"left",bottom:"top",left:"right"},ho=f.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=Fc(xo,r),a=zc[i.placedSide];return o.jsxRuntimeExports.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsxRuntimeExports.jsx(Ic,{...s,ref:n,style:{...s.style,display:"block"}})})});ho.displayName=xo;function $c(e){return e!==null}var Bc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,a=s.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,m=a?0:e.arrowHeight,[l,d]=vo(n),u={start:"0%",center:"50%",end:"100%"}[d],p=(s.arrow?.x??0)+c/2,x=(s.arrow?.y??0)+m/2;let y="",h="";return l==="bottom"?(y=a?u:`${p}px`,h=`${-m}px`):l==="top"?(y=a?u:`${p}px`,h=`${r.floating.height+m}px`):l==="right"?(y=`${-m}px`,h=a?u:`${x}px`):l==="left"&&(y=`${r.floating.width+m}px`,h=a?u:`${x}px`),{data:{x:y,y:h}}}});function vo(e){const[t,n="center"]=e.split("-");return[t,n]}var Vc=uo,Hc=mo,Uc=po,Wc=ho,Xt="rovingFocusGroup.onEntryFocus",Kc={bubbles:!1,cancelable:!0},it="RovingFocusGroup",[dn,go,Gc]=Tr(it),[Yc,yo]=rt(it,[Gc]),[qc,Xc]=Yc(it),bo=f.forwardRef((e,t)=>o.jsxRuntimeExports.jsx(dn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsxRuntimeExports.jsx(dn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsxRuntimeExports.jsx(Qc,{...e,ref:t})})}));bo.displayName=it;var Qc=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:m,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...u}=e,p=f.useRef(null),x=X(t,p),y=_r(i),[h,v]=kr({prop:a,defaultProp:c??null,onChange:m,caller:it}),[w,j]=f.useState(!1),b=ye(l),g=go(n),R=f.useRef(!1),[P,M]=f.useState(0);return f.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(Xt,b),()=>S.removeEventListener(Xt,b)},[b]),o.jsxRuntimeExports.jsx(qc,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:h,onItemFocus:f.useCallback(S=>v(S),[v]),onItemShiftTab:f.useCallback(()=>j(!0),[]),onFocusableItemAdd:f.useCallback(()=>M(S=>S+1),[]),onFocusableItemRemove:f.useCallback(()=>M(S=>S-1),[]),children:o.jsxRuntimeExports.jsx(G.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...u,ref:x,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{R.current=!0}),onFocus:z(e.onFocus,S=>{const F=!R.current;if(S.target===S.currentTarget&&F&&!w){const D=new CustomEvent(Xt,Kc);if(S.currentTarget.dispatchEvent(D),!D.defaultPrevented){const _=g().filter(k=>k.focusable),B=_.find(k=>k.active),$=_.find(k=>k.id===h),O=[B,$,..._].filter(Boolean).map(k=>k.ref.current);jo(O,d)}}R.current=!1}),onBlur:z(e.onBlur,()=>j(!1))})})}),Eo="RovingFocusGroupItem",wo=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...c}=e,m=on(),l=i||m,d=Xc(Eo,n),u=d.currentTabStopId===l,p=go(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:h}=d;return f.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),o.jsxRuntimeExports.jsx(dn.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:o.jsxRuntimeExports.jsx(G.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:z(e.onMouseDown,v=>{r?d.onItemFocus(l):v.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:z(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const w=el(v,d.orientation,d.dir);if(w!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=p().filter(g=>g.focusable).map(g=>g.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const g=b.indexOf(v.currentTarget);b=d.loop?tl(b,g+1):b.slice(g+1)}setTimeout(()=>jo(b))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:h!=null}):a})})});wo.displayName=Eo;var Zc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jc(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function el(e,t,n){const r=Jc(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Zc[r]}function jo(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nl=bo,rl=wo,fn=["Enter"," "],ol=["ArrowDown","PageUp","Home"],Ro=["ArrowUp","PageDown","End"],sl=[...ol,...Ro],il={ltr:[...fn,"ArrowRight"],rtl:[...fn,"ArrowLeft"]},al={ltr:["ArrowLeft"],rtl:["ArrowRight"]},at="Menu",[tt,cl,ll]=Tr(at),[Oe,Mo]=rt(at,[ll,co,yo]),kt=co(),Co=yo(),[ul,Le]=Oe(at),[dl,ct]=Oe(at),So=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=e,c=kt(t),[m,l]=f.useState(null),d=f.useRef(!1),u=ye(i),p=_r(s);return f.useEffect(()=>{const x=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsxRuntimeExports.jsx(Vc,{...c,children:o.jsxRuntimeExports.jsx(ul,{scope:t,open:n,onOpenChange:u,content:m,onContentChange:l,children:o.jsxRuntimeExports.jsx(dl,{scope:t,onClose:f.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:a,children:r})})})};So.displayName=at;var fl="MenuAnchor",wn=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=kt(n);return o.jsxRuntimeExports.jsx(Hc,{...s,...r,ref:t})});wn.displayName=fl;var jn="MenuPortal",[ml,Po]=Oe(jn,{forceMount:void 0}),No=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=Le(jn,t);return o.jsxRuntimeExports.jsx(ml,{scope:t,forceMount:n,children:o.jsxRuntimeExports.jsx(ot,{present:n||i.open,children:o.jsxRuntimeExports.jsx($r,{asChild:!0,container:s,children:r})})})};No.displayName=jn;var ne="MenuContent",[pl,Rn]=Oe(ne),Ao=f.forwardRef((e,t)=>{const n=Po(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Le(ne,e.__scopeMenu),a=ct(ne,e.__scopeMenu);return o.jsxRuntimeExports.jsx(tt.Provider,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(ot,{present:r||i.open,children:o.jsxRuntimeExports.jsx(tt.Slot,{scope:e.__scopeMenu,children:a.modal?o.jsxRuntimeExports.jsx(xl,{...s,ref:t}):o.jsxRuntimeExports.jsx(hl,{...s,ref:t})})})})}),xl=f.forwardRef((e,t)=>{const n=Le(ne,e.__scopeMenu),r=f.useRef(null),s=X(t,r);return f.useEffect(()=>{const i=r.current;if(i)return Da(i)},[]),o.jsxRuntimeExports.jsx(Mn,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hl=f.forwardRef((e,t)=>{const n=Le(ne,e.__scopeMenu);return o.jsxRuntimeExports.jsx(Mn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),vl=Ze("MenuContent.ScrollLock"),Mn=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:m,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:x,disableOutsideScroll:y,...h}=e,v=Le(ne,n),w=ct(ne,n),j=kt(n),b=Co(n),g=cl(n),[R,P]=f.useState(null),M=f.useRef(null),S=X(t,M,v.onContentChange),F=f.useRef(0),D=f.useRef(""),_=f.useRef(0),B=f.useRef(null),$=f.useRef("right"),T=f.useRef(0),O=y?Yr:f.Fragment,k=y?{as:vl,allowPinchZoom:!0}:void 0,I=A=>{const W=D.current+A,J=g().filter(H=>!H.disabled),ve=document.activeElement,Ne=J.find(H=>H.ref.current===ve)?.textValue,Ae=J.map(H=>H.textValue),Fe=Nl(Ae,W,Ne),ge=J.find(H=>H.textValue===Fe)?.ref.current;(function H(K){D.current=K,window.clearTimeout(F.current),K!==""&&(F.current=window.setTimeout(()=>H(""),1e3))})(W),ge&&setTimeout(()=>ge.focus())};f.useEffect(()=>()=>window.clearTimeout(F.current),[]),Gi();const N=f.useCallback(A=>$.current===B.current?.side&&Tl(A,B.current?.area),[]);return o.jsxRuntimeExports.jsx(pl,{scope:n,searchRef:D,onItemEnter:f.useCallback(A=>{N(A)&&A.preventDefault()},[N]),onItemLeave:f.useCallback(A=>{N(A)||(M.current?.focus(),P(null))},[N]),onTriggerLeave:f.useCallback(A=>{N(A)&&A.preventDefault()},[N]),pointerGraceTimerRef:_,onPointerGraceIntentChange:f.useCallback(A=>{B.current=A},[]),children:o.jsxRuntimeExports.jsx(O,{...k,children:o.jsxRuntimeExports.jsx(Fr,{asChild:!0,trapped:s,onMountAutoFocus:z(i,A=>{A.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:o.jsxRuntimeExports.jsx(Or,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:x,children:o.jsxRuntimeExports.jsx(nl,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:P,onEntryFocus:z(m,A=>{w.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsxRuntimeExports.jsx(Uc,{role:"menu","aria-orientation":"vertical","data-state":Ko(v.open),"data-radix-menu-content":"",dir:w.dir,...j,...h,ref:S,style:{outline:"none",...h.style},onKeyDown:z(h.onKeyDown,A=>{const J=A.target.closest("[data-radix-menu-content]")===A.currentTarget,ve=A.ctrlKey||A.altKey||A.metaKey,Ne=A.key.length===1;J&&(A.key==="Tab"&&A.preventDefault(),!ve&&Ne&&I(A.key));const Ae=M.current;if(A.target!==Ae||!sl.includes(A.key))return;A.preventDefault();const ge=g().filter(H=>!H.disabled).map(H=>H.ref.current);Ro.includes(A.key)&&ge.reverse(),Sl(ge)}),onBlur:z(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(F.current),D.current="")}),onPointerMove:z(e.onPointerMove,nt(A=>{const W=A.target,J=T.current!==A.clientX;if(A.currentTarget.contains(W)&&J){const ve=A.clientX>T.current?"right":"left";$.current=ve,T.current=A.clientX}}))})})})})})})});Ao.displayName=ne;var gl="MenuGroup",Cn=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{role:"group",...r,ref:t})});Cn.displayName=gl;var yl="MenuLabel",To=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{...r,ref:t})});To.displayName=yl;var Rt="MenuItem",fr="menu.itemSelect",Dt=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=f.useRef(null),a=ct(Rt,e.__scopeMenu),c=Rn(Rt,e.__scopeMenu),m=X(t,i),l=f.useRef(!1),d=()=>{const u=i.current;if(!n&&u){const p=new CustomEvent(fr,{bubbles:!0,cancelable:!0});u.addEventListener(fr,x=>r?.(x),{once:!0}),Dr(u,p),p.defaultPrevented?l.current=!1:a.onClose()}};return o.jsxRuntimeExports.jsx(ko,{...s,ref:m,disabled:n,onClick:z(e.onClick,d),onPointerDown:u=>{e.onPointerDown?.(u),l.current=!0},onPointerUp:z(e.onPointerUp,u=>{l.current||u.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,u=>{const p=c.searchRef.current!=="";n||p&&u.key===" "||fn.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Dt.displayName=Rt;var ko=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,a=Rn(Rt,n),c=Co(n),m=f.useRef(null),l=X(t,m),[d,u]=f.useState(!1),[p,x]=f.useState("");return f.useEffect(()=>{const y=m.current;y&&x((y.textContent??"").trim())},[i.children]),o.jsxRuntimeExports.jsx(tt.ItemSlot,{scope:n,disabled:r,textValue:s??p,children:o.jsxRuntimeExports.jsx(rl,{asChild:!0,...c,focusable:!r,children:o.jsxRuntimeExports.jsx(G.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:l,onPointerMove:z(e.onPointerMove,nt(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,nt(y=>a.onItemLeave(y))),onFocus:z(e.onFocus,()=>u(!0)),onBlur:z(e.onBlur,()=>u(!1))})})})}),bl="MenuCheckboxItem",Do=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsxRuntimeExports.jsx(Fo,{scope:e.__scopeMenu,checked:n,children:o.jsxRuntimeExports.jsx(Dt,{role:"menuitemcheckbox","aria-checked":Mt(n)?"mixed":n,...s,ref:t,"data-state":Pn(n),onSelect:z(s.onSelect,()=>r?.(Mt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Do.displayName=bl;var _o="MenuRadioGroup",[El,wl]=Oe(_o,{value:void 0,onValueChange:()=>{}}),Io=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=ye(r);return o.jsxRuntimeExports.jsx(El,{scope:e.__scopeMenu,value:n,onValueChange:i,children:o.jsxRuntimeExports.jsx(Cn,{...s,ref:t})})});Io.displayName=_o;var Oo="MenuRadioItem",Lo=f.forwardRef((e,t)=>{const{value:n,...r}=e,s=wl(Oo,e.__scopeMenu),i=n===s.value;return o.jsxRuntimeExports.jsx(Fo,{scope:e.__scopeMenu,checked:i,children:o.jsxRuntimeExports.jsx(Dt,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Pn(i),onSelect:z(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Lo.displayName=Oo;var Sn="MenuItemIndicator",[Fo,jl]=Oe(Sn,{checked:!1}),zo=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=jl(Sn,n);return o.jsxRuntimeExports.jsx(ot,{present:r||Mt(i.checked)||i.checked===!0,children:o.jsxRuntimeExports.jsx(G.span,{...s,ref:t,"data-state":Pn(i.checked)})})});zo.displayName=Sn;var Rl="MenuSeparator",$o=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});$o.displayName=Rl;var Ml="MenuArrow",Bo=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=kt(n);return o.jsxRuntimeExports.jsx(Wc,{...s,...r,ref:t})});Bo.displayName=Ml;var Cl="MenuSub",[Wu,Vo]=Oe(Cl),Xe="MenuSubTrigger",Ho=f.forwardRef((e,t)=>{const n=Le(Xe,e.__scopeMenu),r=ct(Xe,e.__scopeMenu),s=Vo(Xe,e.__scopeMenu),i=Rn(Xe,e.__scopeMenu),a=f.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:m}=i,l={__scopeMenu:e.__scopeMenu},d=f.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return f.useEffect(()=>d,[d]),f.useEffect(()=>{const u=c.current;return()=>{window.clearTimeout(u),m(null)}},[c,m]),o.jsxRuntimeExports.jsx(wn,{asChild:!0,...l,children:o.jsxRuntimeExports.jsx(ko,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":Ko(n.open),...e,ref:St(t,s.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,nt(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:z(e.onPointerLeave,nt(u=>{d();const p=n.content?.getBoundingClientRect();if(p){const x=n.content?.dataset.side,y=x==="right",h=y?-5:5,v=p[y?"left":"right"],w=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+h,y:u.clientY},{x:v,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:v,y:p.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,u=>{const p=i.searchRef.current!=="";e.disabled||p&&u.key===" "||il[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});Ho.displayName=Xe;var Uo="MenuSubContent",Wo=f.forwardRef((e,t)=>{const n=Po(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Le(ne,e.__scopeMenu),a=ct(ne,e.__scopeMenu),c=Vo(Uo,e.__scopeMenu),m=f.useRef(null),l=X(t,m);return o.jsxRuntimeExports.jsx(tt.Provider,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(ot,{present:r||i.open,children:o.jsxRuntimeExports.jsx(tt.Slot,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(Mn,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{a.isUsingKeyboardRef.current&&m.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:z(e.onFocusOutside,d=>{d.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:z(e.onKeyDown,d=>{const u=d.currentTarget.contains(d.target),p=al[a.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),c.trigger?.focus(),d.preventDefault())})})})})})});Wo.displayName=Uo;function Ko(e){return e?"open":"closed"}function Mt(e){return e==="indeterminate"}function Pn(e){return Mt(e)?"indeterminate":e?"checked":"unchecked"}function Sl(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Pl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nl(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Pl(e,Math.max(i,0));s.length===1&&(a=a.filter(l=>l!==n));const m=a.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return m!==n?m:void 0}function Al(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],m=t[a],l=c.x,d=c.y,u=m.x,p=m.y;d>r!=p>r&&n<(u-l)*(r-d)/(p-d)+l&&(s=!s)}return s}function Tl(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Al(n,t)}function nt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var kl=So,Dl=wn,_l=No,Il=Ao,Ol=Cn,Ll=To,Fl=Dt,zl=Do,$l=Io,Bl=Lo,Vl=zo,Hl=$o,Ul=Bo,Wl=Ho,Kl=Wo,_t="DropdownMenu",[Gl,Ku]=rt(_t,[Mo]),Y=Mo(),[Yl,Go]=Gl(_t),Yo=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:c=!0}=e,m=Y(t),l=f.useRef(null),[d,u]=kr({prop:s,defaultProp:i??!1,onChange:a,caller:_t});return o.jsxRuntimeExports.jsx(Yl,{scope:t,triggerId:on(),triggerRef:l,contentId:on(),open:d,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(p=>!p),[u]),modal:c,children:o.jsxRuntimeExports.jsx(kl,{...m,open:d,onOpenChange:u,dir:r,modal:c,children:n})})};Yo.displayName=_t;var qo="DropdownMenuTrigger",Xo=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=Go(qo,n),a=Y(n);return o.jsxRuntimeExports.jsx(Dl,{asChild:!0,...a,children:o.jsxRuntimeExports.jsx(G.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:St(t,i.triggerRef),onPointerDown:z(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:z(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Xo.displayName=qo;var ql="DropdownMenuPortal",Qo=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Y(t);return o.jsxRuntimeExports.jsx(_l,{...r,...n})};Qo.displayName=ql;var Zo="DropdownMenuContent",Jo=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Go(Zo,n),i=Y(n),a=f.useRef(!1);return o.jsxRuntimeExports.jsx(Il,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,c=>{a.current||s.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:z(e.onInteractOutside,c=>{const m=c.detail.originalEvent,l=m.button===0&&m.ctrlKey===!0,d=m.button===2||l;(!s.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Jo.displayName=Zo;var Xl="DropdownMenuGroup",Ql=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ol,{...s,...r,ref:t})});Ql.displayName=Xl;var Zl="DropdownMenuLabel",es=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ll,{...s,...r,ref:t})});es.displayName=Zl;var Jl="DropdownMenuItem",ts=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Fl,{...s,...r,ref:t})});ts.displayName=Jl;var eu="DropdownMenuCheckboxItem",tu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(zl,{...s,...r,ref:t})});tu.displayName=eu;var nu="DropdownMenuRadioGroup",ru=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx($l,{...s,...r,ref:t})});ru.displayName=nu;var ou="DropdownMenuRadioItem",su=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Bl,{...s,...r,ref:t})});su.displayName=ou;var iu="DropdownMenuItemIndicator",au=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Vl,{...s,...r,ref:t})});au.displayName=iu;var cu="DropdownMenuSeparator",ns=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Hl,{...s,...r,ref:t})});ns.displayName=cu;var lu="DropdownMenuArrow",uu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ul,{...s,...r,ref:t})});uu.displayName=lu;var du="DropdownMenuSubTrigger",fu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Wl,{...s,...r,ref:t})});fu.displayName=du;var mu="DropdownMenuSubContent",pu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Kl,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pu.displayName=mu;var xu=Yo,hu=Xo,vu=Qo,gu=Jo,yu=es,bu=ts,Eu=ns;function Qt({...e}){return o.jsxRuntimeExports.jsx(xu,{"data-slot":"dropdown-menu",...e})}function Zt({...e}){return o.jsxRuntimeExports.jsx(hu,{"data-slot":"dropdown-menu-trigger",...e})}function Jt({className:e,sideOffset:t=4,...n}){return o.jsxRuntimeExports.jsx(vu,{children:o.jsxRuntimeExports.jsx(gu,{"data-slot":"dropdown-menu-content",sideOffset:t,className:C.cn$1("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n})})}function ht({className:e,inset:t,variant:n="default",...r}){return o.jsxRuntimeExports.jsx(bu,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:C.cn$1("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function en({className:e,inset:t,...n}){return o.jsxRuntimeExports.jsx(yu,{"data-slot":"dropdown-menu-label","data-inset":t,className:C.cn$1("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",e),...n})}function tn({className:e,...t}){return o.jsxRuntimeExports.jsx(Eu,{"data-slot":"dropdown-menu-separator",className:C.cn$1("-mx-1 my-1 h-px bg-border",e),...t})}function rs({delayDuration:e=0,...t}){return o.jsxRuntimeExports.jsx(V.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function oe({...e}){return o.jsxRuntimeExports.jsx(rs,{children:o.jsxRuntimeExports.jsx(V.Root,{"data-slot":"tooltip",...e})})}function se({...e}){return o.jsxRuntimeExports.jsx(V.Trigger,{"data-slot":"tooltip-trigger",...e})}function ie({className:e,sideOffset:t=0,children:n,...r}){return o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{"data-slot":"tooltip-content",sideOffset:t,className:C.cn$1("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-primary px-3 py-1.5 text-primary-foreground text-xs data-[state=closed]:animate-out",e),...r,children:[n,o.jsxRuntimeExports.jsx(V.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary"})]})})}function mr({className:e,defaultValue:t,value:n,min:r=0,max:s=100,...i}){const a=f.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,s],[n,t,r,s]);return o.jsxRuntimeExports.jsxs(te.Root,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:s,className:C.cn$1("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",e),...i,children:[o.jsxRuntimeExports.jsx(te.Track,{"data-slot":"slider-track",className:C.cn$1("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"),children:o.jsxRuntimeExports.jsx(te.Range,{"data-slot":"slider-range",className:C.cn$1("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(c,m)=>o.jsxRuntimeExports.jsx(te.Thumb,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-background shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"},m))]})}const pr=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M8 5.14v13.72c0 .45.54.67.85.35l8.56-8.86a.5.5 0 0 0 0-.7L8.85 4.79c-.31-.32-.85-.1-.85.35z"})}),xr=({className:e,...t})=>o.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:[o.jsxRuntimeExports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),o.jsxRuntimeExports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]}),wu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})}),ju=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"})}),Ru=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})}),Mu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})}),Cu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z"})}),Su=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsxs("g",{children:[o.jsxRuntimeExports.jsx("path",{d:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6v4l5-5-5-5v4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8h-2z"}),o.jsxRuntimeExports.jsx("path",{d:"M10.86 15v-2.5h-1.5V15h1.5zm2.49-2.62c.24-.23.39-.5.39-.81 0-.32-.15-.59-.39-.82s-.53-.35-.88-.35c-.34 0-.64.12-.87.35s-.35.51-.35.82v.23c0 .16.02.3.06.41l.99-.28c-.02-.08-.03-.19-.03-.34 0-.14.05-.25.14-.34.09-.08.21-.13.35-.13s.26.05.35.13c.09.09.14.2.14.34s-.05.25-.14.34l-1.08 1.08c-.07.07-.12.14-.17.22s-.08.16-.1.24-.04.18-.04.28v.21h1.85v-.66h-.92l.59-.59z"})]})}),Pu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsxs("g",{children:[o.jsxRuntimeExports.jsx("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}),o.jsxRuntimeExports.jsx("path",{d:"M10.89 16h-1.5v-2.5h-2v-1h3.5V16zm2.5-4.5V16h-1.5v-4.5h1.5z"})]})}),Nu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z"})}),Au=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12.5v-7c0-.55.45-1 1-1s1 .45 1 1v7c0 .55-.45 1-1 1s-1-.45-1-1zM7 11h1.5v3.5h1v-3.5H11v-1H7v1zm8.5 4.5H17v-1h-1.5v-1H17v-1h-1.5v-1H17v-1h-2.5c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1z"})}),Tu=({className:e,...t})=>o.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:[o.jsxRuntimeExports.jsx("path",{d:"M15.96 10.29l-2.75 3.08c-.31.34-.81.34-1.12 0-.31-.34-.31-.89 0-1.23l2.75-3.08c1.31-1.46 3.58-.21 3.58 1.75 0 .89-.36 1.79-1.07 2.5l-6.88 6.88c-.71.71-1.61 1.07-2.5 1.07-1.96 0-3.21-2.27-1.75-3.58l3.08-2.75c.34-.31.89-.31 1.23 0 .34.31.34.81 0 1.12l-3.08 2.75c-.35.39.07 1.04.58.79l6.88-6.88c.36-.36.52-.82.52-1.25 0-.51-.65-.93-1.04-.58z"}),o.jsxRuntimeExports.jsx("text",{x:"12",y:"10",fontSize:"8",textAnchor:"middle",fill:"currentColor",fontWeight:"bold",children:"1x"})]}),ku=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})}),Du=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"})}),hr=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:C.cn$1("size-6 animate-spin",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M12 2a10 10 0 1 0 10 10"})}),_u=E.lazy(()=>import("react-player"));function Iu({className:e,containerClassName:t,url:n,playing:r=!1,volume:s=1,muted:i=!1,controls:a=!1,light:c=!1,loop:m=!1,playbackRate:l=1,width:d="100%",height:u="100%",style:p,progressInterval:x=1e3,playsinline:y=!0,pip:h=!1,stopOnUnmount:v=!0,fallback:w=o.jsxRuntimeExports.jsx(hr,{className:"size-12 text-white"}),wrapper:j="div",config:b,showDownload:g=!1,showShare:R=!1,showSubtitles:P=!1,showQuality:M=!1,onDownload:S,onShare:F,qualityOptions:D=[{label:"1080p",value:"1080"},{label:"720p",value:"720"},{label:"480p",value:"480"},{label:"360p",value:"360"}],subtitleTracks:_=[],onReady:B,onStart:$,onPlay:T,onProgress:O,onDuration:k,onPause:I,onBuffer:N,onBufferEnd:A,onSeek:W,onPlaybackRateChange:J,onEnded:ve,onError:Ne,onClickPreview:Ae,onEnablePIP:Fe,onDisablePIP:ge,...H}){const[K,Te]=E.useState(r),[je,Ye]=E.useState(s),[ue,Re]=E.useState(i),[Nn,vs]=E.useState(0),[ke,gs]=E.useState(0),[ys,bs]=E.useState(0),[An,Tn]=E.useState(!1),[kn,It]=E.useState(h),[Dn,_n]=E.useState(l),[Es,Ot]=E.useState(!0),[ws,lt]=E.useState(!0),[js,Rs]=E.useState(D[0]?.value||"720"),[Hu,In]=E.useState(null),ze=E.useRef(null),Lt=E.useRef(null),qe=E.useRef(null),On=L=>{const ee=new Date(L*1e3),Ln=ee.getUTCHours(),Fn=ee.getUTCMinutes(),zn=ee.getUTCSeconds().toString().padStart(2,"0");return Ln?`${Ln}:${Fn.toString().padStart(2,"0")}:${zn}`:`${Fn}:${zn}`},Ms=()=>{Ot(!0),qe.current&&clearTimeout(qe.current),K&&(qe.current=setTimeout(()=>{Ot(!1)},3e3))};E.useEffect(()=>()=>{qe.current&&clearTimeout(qe.current)},[]);const Ft=()=>{document.fullscreenElement?(document.exitFullscreen(),Tn(!1)):(Lt.current?.requestFullscreen(),Tn(!0))};E.useEffect(()=>{const L=ee=>{if(Lt.current?.contains(document.activeElement))switch(ee.key.toLowerCase()){case" ":case"k":ee.preventDefault(),Te(!K);break;case"f":ee.preventDefault(),Ft();break;case"m":ee.preventDefault(),Re(!ue);break;case"arrowleft":ee.preventDefault(),ze.current?.seekTo(ke-10);break;case"arrowright":ee.preventDefault(),ze.current?.seekTo(ke+10);break;case"arrowup":ee.preventDefault(),Ye(Math.min(1,je+.1));break;case"arrowdown":ee.preventDefault(),Ye(Math.max(0,je-.1));break}};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[K,ue,ke,je,Ft]);const Cs=[.5,.75,1,1.25,1.5,2];return o.jsxRuntimeExports.jsx(rs,{children:o.jsxRuntimeExports.jsxs("div",{ref:Lt,className:C.cn("relative overflow-hidden rounded-lg bg-black","focus-within:outline-none",t),onMouseMove:Ms,onMouseLeave:()=>K&&Ot(!1),tabIndex:0,children:[o.jsxRuntimeExports.jsx(E.Suspense,{fallback:w,children:o.jsxRuntimeExports.jsx(_u,{ref:ze,url:n,playing:K,volume:ue?0:je,muted:ue,controls:!1,light:c,loop:m,playbackRate:Dn,width:d,height:u,style:{...p,aspectRatio:"16/9"},progressInterval:x,playsinline:y,pip:kn,stopOnUnmount:v,fallback:w,wrapper:j,config:b,className:C.cn("aspect-video",e),onReady:()=>{lt(!1),B?.()},onStart:()=>{lt(!1),$?.()},onPlay:()=>{Te(!0),T?.()},onPause:()=>{Te(!1),I?.()},onProgress:L=>{gs(L.playedSeconds),bs(L.loaded),O?.(L)},onDuration:L=>{vs(L),k?.(L)},onBuffer:()=>{lt(!0),N?.()},onBufferEnd:()=>{lt(!1),A?.()},onSeek:W,onPlaybackRateChange:L=>{_n(L),J?.(L)},onEnded:ve,onError:Ne,onClickPreview:Ae,onEnablePIP:()=>{It(!0),Fe?.()},onDisablePIP:()=>{It(!1),ge?.()},...H})}),ws&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx(hr,{className:"size-12 text-white"})}),o.jsxRuntimeExports.jsxs("div",{className:C.cn("absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-black/20","transition-opacity duration-300",Es?"opacity-100":"pointer-events-none opacity-0"),children:[o.jsxRuntimeExports.jsxs("div",{className:"absolute top-0 right-0 left-0 flex items-center justify-between p-4",children:[o.jsxRuntimeExports.jsx("h3",{className:"font-medium text-lg text-white",children:"Media Player"}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[R&&o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:F,children:o.jsxRuntimeExports.jsx(Du,{className:"size-5"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Share"})]}),g&&o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:S,children:o.jsxRuntimeExports.jsx(ku,{className:"size-5"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Download"})]})]})]}),o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button size-20 rounded-none border-2 border-gray-600 bg-gray-800/90 text-white shadow-xl transition-all duration-200 hover:scale-105 hover:border-gray-500 hover:bg-gray-700/90 active:scale-95",onClick:()=>Te(!K),children:K?o.jsxRuntimeExports.jsx(xr,{className:"size-10"}):o.jsxRuntimeExports.jsx(pr,{className:"size-10"})})}),o.jsxRuntimeExports.jsxs("div",{className:"absolute right-0 bottom-0 left-0 space-y-2 p-4",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(mr,{value:[ke],max:Nn,step:1,onValueChange:([L])=>{typeof L=="number"&&ze.current?.seekTo(L)},className:"pixel-progress cursor-pointer [&>span]:rounded-none [&>span]:border [&>span]:border-gray-600 [&>span]:bg-gray-800 [&>span]:shadow-lg [&_[role=slider]]:size-4 [&_[role=slider]]:rounded-none [&_[role=slider]]:border-2 [&_[role=slider]]:border-gray-400 [&_[role=slider]]:bg-white [&_[role=slider]]:shadow-md"}),o.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute top-0 left-0 h-full rounded-none border border-gray-500/30 bg-white/20",style:{width:`${ys*100}%`}})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>Te(!K),children:K?o.jsxRuntimeExports.jsx(xr,{className:"size-6"}):o.jsxRuntimeExports.jsx(pr,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:K?"Pause (k)":"Play (k)"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>ze.current?.seekTo(ke-10),children:o.jsxRuntimeExports.jsx(Pu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Back 10s (←)"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>ze.current?.seekTo(ke+10),children:o.jsxRuntimeExports.jsx(Su,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Forward 10s (→)"})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>Re(!ue),children:ue||je===0?o.jsxRuntimeExports.jsx(ju,{className:"size-6"}):o.jsxRuntimeExports.jsx(wu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:ue?"Unmute (m)":"Mute (m)"})]}),o.jsxRuntimeExports.jsx(mr,{value:[ue?0:je],max:1,step:.05,onValueChange:([L])=>{typeof L=="number"&&(Ye(L),Re(L===0))},className:"pixel-progress w-20 cursor-pointer [&>span]:rounded-none [&>span]:border [&>span]:border-gray-600 [&>span]:bg-gray-800 [&>span]:shadow-lg [&_[role=slider]]:size-3 [&_[role=slider]]:rounded-none [&_[role=slider]]:border-2 [&_[role=slider]]:border-gray-400 [&_[role=slider]]:bg-white [&_[role=slider]]:shadow-md"})]}),o.jsxRuntimeExports.jsxs("span",{className:"pixel-time-display rounded-none border border-gray-600/50 bg-gray-900/80 px-2 py-1 font-mono text-sm text-white shadow-lg",children:[On(ke)," / ",On(Nn)]})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[P&&_.length>0&&o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Nu,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Subtitles"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Subtitles"}),o.jsxRuntimeExports.jsx(tn,{}),o.jsxRuntimeExports.jsx(ht,{onClick:()=>In(null),children:"Off"}),_.map(L=>o.jsxRuntimeExports.jsx(ht,{onClick:()=>In(L.value),children:L.label},L.value))]})]}),M&&o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Au,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Quality"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Quality"}),o.jsxRuntimeExports.jsx(tn,{}),D.map(L=>o.jsxRuntimeExports.jsxs(ht,{onClick:()=>Rs(L.value),children:[L.label," ",js===L.value&&"✓"]},L.value))]})]}),o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Tu,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Playback Speed"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Speed"}),o.jsxRuntimeExports.jsx(tn,{}),Cs.map(L=>o.jsxRuntimeExports.jsxs(ht,{onClick:()=>_n(L),children:[L,"x ",Dn===L&&"✓"]},L))]})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>It(!kn),children:o.jsxRuntimeExports.jsx(Cu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Picture in Picture"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:Ft,children:An?o.jsxRuntimeExports.jsx(Mu,{className:"size-6"}):o.jsxRuntimeExports.jsx(Ru,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:An?"Exit Fullscreen (f)":"Fullscreen (f)"})]})]})]})]})]})]})})}function os({src:e,type:t="video/mp4"}){const n=E.useRef(null),r=E.useRef(null);return E.useEffect(()=>((async()=>{if(!n.current||r.current)return;const i=(await import("video.js")).default,a=i(n.current,{controls:!0,autoplay:!1,preload:"auto",fluid:!0,sources:[{src:e,type:t}]});r.current=a,a.ready(()=>{console.log("Player is ready!")})})(),()=>{r.current&&(r.current.dispose(),r.current=null)}),[e,t]),o.jsxRuntimeExports.jsx("div",{className:"w-full",children:o.jsxRuntimeExports.jsx("div",{"data-vjs-player":!0,children:o.jsxRuntimeExports.jsx("video",{ref:n,className:"video-js vjs-big-play-centered vjs-default-skin w-full",playsInline:!0})})})}os.displayName="SimpleVideoPlayer";const ss=E.memo(E.forwardRef(({isFullscreen:e,onToggle:t,disabled:n=!1,size:r="lg",className:s},i)=>{const a={md:"h-11 w-11",lg:"h-12 w-12",xl:"h-14 w-14"},c={md:20,lg:24,xl:28},m=E.useMemo(()=>({button:a[r]||a.lg,icon:c[r]||c.lg}),[r]),l=E.useMemo(()=>e?ni:ei,[e]),d=E.useMemo(()=>e?"Exit fullscreen":"Enter fullscreen",[e]),u=E.useMemo(()=>e?"Exit fullscreen":"Enter fullscreen",[e]);return o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("button",{ref:i,type:"button",onClick:t,disabled:n,className:C.cn("inline-flex items-center justify-center rounded-lg bg-transparent p-0 text-white transition-all hover:text-cyan-700 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20","disabled:cursor-not-allowed disabled:opacity-50",m.button,s),"aria-label":d,children:o.jsxRuntimeExports.jsx(l,{size:m.icon})})}),o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:5,children:[u,o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})})}));ss.displayName="FullscreenButton";const Ou=ss,vr={sm:{button:"size-8",icon:16},md:{button:"size-10",icon:20},lg:{button:"size-12",icon:24},xl:{button:"size-16",icon:32}},is=E.memo(E.forwardRef(({isPlaying:e,onToggle:t,disabled:n=!1,size:r="lg",className:s},i)=>{const a=E.useMemo(()=>vr[r]||vr.lg,[r]),c=E.useMemo(()=>e?"Pause media":"Play media",[e]);return o.jsxRuntimeExports.jsxs("button",{ref:i,type:"button",onClick:t,disabled:n,"data-state":e?"playing":"paused",className:C.cn("group relative inline-flex items-center justify-center","glass-strong media-control rounded-full contain-layout","focus-ring touch-manipulation",a.button,"text-[color:var(--media-text)] transition-all duration-300","bg-[color:var(--media-control-bg)] backdrop-blur-sm","border border-[color:var(--media-border)]/30","hover:bg-[color:var(--media-control-hover)]","hover:border-[color:var(--media-border)]/50","hover:shadow-[color:var(--media-bg)]/20 hover:shadow-lg","hover:-translate-y-0.5 hover:scale-105","active:bg-[color:var(--media-control-active)]","active:translate-y-0 active:scale-100","focus-visible:ring-2 focus-visible:ring-[color:var(--media-focus)]","focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--media-bg)]","disabled:cursor-not-allowed disabled:opacity-50","disabled:hover:translate-y-0 disabled:hover:scale-100","disabled:hover:bg-[color:var(--media-control-bg)]",s),"aria-label":c,"aria-pressed":e,children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 rounded-full opacity-0 transition-opacity duration-300","bg-gradient-to-br from-[color:var(--color-media-play)] to-[color:var(--color-media-pause)]","blur-sm group-hover:opacity-20",e&&"opacity-10")}),e?o.jsxRuntimeExports.jsx(oi,{size:a.icon,className:C.cn("relative z-10 fill-current transition-all duration-200","text-[color:var(--color-media-pause)]","group-hover:scale-110 group-active:scale-95","drop-shadow-sm")}):o.jsxRuntimeExports.jsx(ii,{size:a.icon,className:C.cn("relative z-10 fill-current transition-all duration-200","ml-0.5 text-[color:var(--color-media-play)]","group-hover:scale-110 group-active:scale-95","drop-shadow-sm")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 rounded-full opacity-0","scale-75 bg-[color:var(--media-text)]/10","group-active:scale-100 group-active:opacity-100","transition-all duration-150 ease-out")})]})}));is.displayName="PlayButton";const Lu=is,as=E.memo(E.forwardRef(({currentTime:e,duration:t,buffered:n,onSeek:r,size:s="sm",className:i},a)=>{const[c,m]=E.useState(!1),[l,d]=E.useState(0),[u,p]=E.useState(!1);E.useDeferredValue(l);const x=E.useMemo(()=>({trackHeight:s==="sm"?"h-1":s==="md"?"h-1.5":"h-2",thumbSize:s==="sm"?"size-3":s==="md"?"size-4":"size-5",trackHoverHeight:"h-1.5"}),[s]),y=E.useMemo(()=>t>0?e/t*100:0,[e,t]),h=E.useMemo(()=>{const M=[];if(n&&t>0)for(let S=0;S<n.length;S++){const F=n.start(S)/t*100,D=n.end(S)/t*100;M.push({start:F,end:D})}return M},[n,t]),v=E.useCallback(([M])=>{const S=(M??0)/100*t;d(S),c&&r(S)},[t,c,r]),w=E.useCallback(([M])=>{const S=(M??0)/100*t;r(S),m(!1)},[t,r]),j=E.useCallback(()=>{m(!0)},[]),b=E.useCallback(()=>p(!0),[]),g=E.useCallback(()=>p(!1),[]),R=E.useMemo(()=>C.formatTime(e),[e]),P=E.useMemo(()=>C.formatTime(t),[t]);return o.jsxRuntimeExports.jsx("div",{ref:a,className:C.cn("media-container relative w-full text-[color:var(--media-text)]","touch-manipulation contain-layout",i),onMouseEnter:b,onMouseLeave:g,role:"group","aria-label":"Seek bar",children:o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("div",{className:"relative animate-enter",children:o.jsxRuntimeExports.jsxs(te.Root,{className:C.cn("group relative flex w-full touch-none select-none items-center","focus-ring cursor-pointer",x.trackHeight),value:[y],max:100,step:.1,onValueChange:v,onValueCommit:w,onPointerDown:j,"aria-label":"Seek to position","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(y),"aria-valuetext":`${R} of ${P}`,"aria-orientation":"horizontal",children:[o.jsxRuntimeExports.jsxs(te.Track,{className:C.cn("relative grow overflow-hidden rounded-full","bg-[color:var(--media-control-bg)]/40 backdrop-blur-sm","border border-[color:var(--media-border)]/20","shadow-inner transition-all duration-300 ease-out",x.trackHoverHeight,"group-hover:bg-[color:var(--media-control-bg)]/60","group-hover:border-[color:var(--media-border)]/40"),children:[h.map((M,S)=>o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute h-full rounded-full transition-all duration-500","bg-[color:var(--color-media-buffered)] shadow-inner","opacity-60 group-hover:opacity-80"),style:{left:`${M.start}%`,width:`${M.end-M.start}%`}},S)),o.jsxRuntimeExports.jsx(te.Range,{className:C.cn("absolute h-full rounded-full transition-all duration-300","bg-gradient-to-r from-[color:var(--color-media-progress)] to-[color:var(--color-brand-accent)]","shadow-[color:var(--color-brand-primary)]/20 shadow-lg","group-hover:shadow-xl")})]}),o.jsxRuntimeExports.jsx(te.Thumb,{className:C.cn("block rounded-full border-white/20 bg-white","shadow-lg hover:shadow-xl",x.thumbSize,"opacity-0 group-hover:opacity-100","hover:scale-110 hover:bg-white/95 active:scale-95","focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-white/50","focus:ring-offset-2 focus:ring-offset-black/20","transition-all duration-300 ease-out",c&&"opacity-100"),"aria-label":"Seek slider","aria-valuetext":`${R} of ${P}`})]})})}),c&&o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:10,children:[C.formatTime(l),o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})})})}));as.displayName="SeekBar";const Fu=as,cs=E.memo(E.forwardRef(function({currentTime:t,duration:n,showRemaining:r=!1,size:s="sm",className:i},a){const c=E.useMemo(()=>C.formatTime(t),[t]),m=E.useMemo(()=>C.formatTime(n),[n]),l=E.useMemo(()=>C.formatTime(n-t),[n,t]),d={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},u=E.useMemo(()=>r?`-${l}`:m,[r,l,m]);return o.jsxRuntimeExports.jsxs("div",{ref:a,className:C.cn("flex items-center font-mono text-white text-xs","rounded-lg backdrop-blur-sm","px-3 py-1.5",d[s],"select-none",i),role:"timer","aria-label":`${r?"Time remaining":"Duration"}: ${u}`,"aria-live":"off",children:[o.jsxRuntimeExports.jsx("span",{className:"tabular-nums","aria-label":"Current time",children:c}),o.jsxRuntimeExports.jsx("span",{className:"mx-1 text-white","aria-hidden":"true",children:"/"}),o.jsxRuntimeExports.jsx("span",{className:"tabular-nums","aria-label":r?"Time remaining":"Total duration",children:u})]})}));cs.displayName="TimeDisplay";const zu=cs,ls=E.memo(E.forwardRef(function({volume:t,isMuted:n,onVolumeChange:r,onToggleMute:s,size:i="lg",className:a},c){const m=E.useMemo(()=>n||t===0?hi:t<.5?fi:pi,[n,t]),l=E.useMemo(()=>({md:"h-11 w-11",lg:"h-12 w-12",xl:"h-14 w-14"}),[]),d=E.useMemo(()=>({md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"}),[]),u=E.useMemo(()=>({md:"h-6",lg:"h-7",xl:"h-8"}),[]),p=E.useMemo(()=>({md:"h-4 w-4",lg:"h-4 w-4",xl:"h-5 w-5"}),[]),x=E.useMemo(()=>({md:"h-1.5",lg:"h-2",xl:"h-2.5"}),[]),y=E.useMemo(()=>[n?0:t],[n,t]),h=E.useMemo(()=>Math.round((n?0:t)*100),[n,t]),v=E.useCallback(()=>{s()},[s]),w=E.useCallback(([g])=>{r(g??0)},[r]),j=n?"Unmute":"Mute",b=j;return o.jsxRuntimeExports.jsxs("div",{ref:c,className:C.cn("flex items-center space-x-3 text-white",a),children:[o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("button",{type:"button",onClick:v,className:C.cn("inline-flex items-center justify-center rounded-lg bg-transparent p-0 text-white transition-all hover:text-cyan-700 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20",l[i]),"aria-label":j,"aria-pressed":n,children:o.jsxRuntimeExports.jsx(m,{className:C.cn(d[i])})})}),o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:5,children:[b,o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})}),o.jsxRuntimeExports.jsx("div",{className:"w-32",children:o.jsxRuntimeExports.jsxs(te.Root,{className:C.cn("group relative flex w-full touch-none select-none items-center",u[i]),value:y,max:1,step:.01,onValueChange:w,"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":t,"aria-valuetext":`${h} percent`,children:[o.jsxRuntimeExports.jsx(te.Track,{className:C.cn("relative grow rounded-full bg-white/20 shadow-inner transition-all duration-300 group-hover:bg-white/30","border border-white/10",x[i]),children:o.jsxRuntimeExports.jsx(te.Range,{className:"absolute h-full rounded-full bg-white shadow-sm"})}),o.jsxRuntimeExports.jsx(te.Thumb,{className:C.cn("block rounded-full border-2 border-white/20 bg-white shadow-lg","transition-all duration-300 ease-out hover:scale-110 hover:bg-white/95 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20",p[i]),"aria-label":"Volume"})]})}),o.jsxRuntimeExports.jsx("span",{className:"w-10 text-right text-sm text-white","aria-hidden":"true",children:h})]})}));ls.displayName="VolumeControl";const $u=ls,us=E.forwardRef((e,t)=>(C.showDeprecationWarning("ModernMediaPlayer","MediaPlayer (the primary media player component)"),o.jsxRuntimeExports.jsx(Iu,{...e,ref:t})));us.displayName="DeprecatedModernMediaPlayer";const ds=E.forwardRef((e,t)=>(C.showDeprecationWarning("SimpleVideoPlayer","VideoPlayer (the primary video player component)"),o.jsxRuntimeExports.jsx(os,{...e,ref:t})));ds.displayName="DeprecatedSimpleVideoPlayer";const fs=E.forwardRef((e,t)=>(C.showDeprecationWarning("PlayButton","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Lu,{...e,ref:t})));fs.displayName="DeprecatedPlayButton";const ms=E.forwardRef((e,t)=>(C.showDeprecationWarning("SeekBar","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Fu,{...e,ref:t})));ms.displayName="DeprecatedSeekBar";const ps=E.forwardRef((e,t)=>(C.showDeprecationWarning("TimeDisplay","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(zu,{...e,ref:t})));ps.displayName="DeprecatedTimeDisplay";const xs=E.forwardRef((e,t)=>(C.showDeprecationWarning("VolumeControl","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx($u,{...e,ref:t})));xs.displayName="DeprecatedVolumeControl";const hs=E.forwardRef((e,t)=>(C.showDeprecationWarning("FullscreenButton","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Ou,{...e,ref:t})));hs.displayName="DeprecatedFullscreenButton";const Bu=({sources:e,enableIntelligentPreloading:t=!0,adaptToNetworkConditions:n=!0,priority:r="auto",strategy:s="adaptive"})=>{const i=E.useRef(null),a=E.useRef(null),c=E.useRef(new Map);function m(b){return!b.includes(window.location.origin)}function l(b){}function d(b){b.forEach(g=>{c.current.set(g,Date.now()),_e.preload(g,{as:"fetch",crossOrigin:"anonymous",priority:"high"})})}const u=E.useMemo(()=>{const b={dnsPrefetch:[],preconnect:[],preload:[],preinit:[]};return e.forEach(g=>{const P=new URL(g.src).origin;y(P)&&b.dnsPrefetch.push(P),h(g.type,s)&&b.preconnect.push(P),v(g,r,s)&&b.preload.push({url:g.src,type:j(g.type)}),w(g,s)&&b.preinit.push({url:g.src,type:"script"})}),b},[e,r,s]),[p,x]=E.useState(u);E.useEffect(()=>{const b={...u};b.preload=u.preload.filter(({url:g})=>{const R=e.find(M=>M.src===g);if(!R)return!1;const P=c.current.get(R.src);if(P&&Date.now()-P<3e5)return!1;if(s==="conservative")return r==="high"&&R.type==="hls";if(s==="aggressive")return!0;if(i.current){const{effectiveType:M,saveData:S}=i.current;if(S)return!1;if(M==="slow-2g"||M==="2g")return r==="high"&&R.type==="hls";if(M==="3g")return["hls","m3u8"].includes(R.type)}return r!=="low"}),x(b)},[u,e,r,s]),E.useEffect(()=>{if(n&&"connection"in navigator){i.current=navigator.connection;const b=()=>{};return i.current.addEventListener("change",b),()=>{i.current?.removeEventListener("change",b)}}},[n]),E.useEffect(()=>{if(t)return a.current=new Vu,a.current.startTracking(),()=>{a.current?.stopTracking()}},[t]),E.useEffect(()=>{p.dnsPrefetch.forEach(b=>{_e.prefetchDNS(b)})},[p.dnsPrefetch]),E.useEffect(()=>{p.preconnect.forEach(b=>{_e.preconnect(b,{crossOrigin:"anonymous"})})},[p.preconnect]),E.useEffect(()=>{p.preload.forEach(({url:b,type:g})=>{const R=m(b)?"anonymous":void 0;_e.preload(b,{as:g,crossOrigin:R,integrity:void 0,priority:r})})},[p.preload,r]),E.useEffect(()=>{p.preinit.forEach(({url:b,type:g})=>{const R=m(b)?"anonymous":void 0;_e.preinit(b,{as:g,crossOrigin:R})})},[p.preinit]),E.useEffect(()=>{if(!t||!a.current)return;const b=g=>{g.isLikelyToInteract&&d(g.predictedSources)};a.current.onBehaviorChange(b)},[t]);function y(b){return["cdn.jsdelivr.net","cdnjs.cloudflare.com","unpkg.com","cloudflare.com","fastly.net","akamaized.net"].some(R=>b.includes(R))}function h(b,g){return g==="aggressive"?!0:g==="conservative"?["hls","m3u8"].includes(b):["hls","m3u8","mp4"].includes(b)}function v(b,g,R){return R==="conservative"?g==="high"&&b.type==="hls":R==="aggressive"?!0:g!=="low"}function w(b,g){return g==="aggressive"&&b.type==="hls"}function j(b){switch(b){case"hls":case"m3u8":return"fetch";case"mp4":case"webm":return"video";case"mp3":case"wav":return"audio";default:return"fetch"}}return null};class Vu{constructor(){de(this,"behaviorData",{isLikelyToInteract:!1,engagementScore:0,predictedSources:[],interactionHistory:[]});de(this,"listeners",[]);de(this,"mouseMoveTimer",null);de(this,"handleMouseMove",()=>{this.mouseMoveTimer||(this.mouseMoveTimer=window.setTimeout(()=>{this.updateEngagementScore(.1),this.mouseMoveTimer=null},100))});de(this,"handleScroll",()=>{this.updateEngagementScore(.2)});de(this,"handleKeydown",()=>{this.updateEngagementScore(.3),this.behaviorData.isLikelyToInteract=!0});de(this,"handleFocus",()=>{this.updateEngagementScore(.4),this.behaviorData.isLikelyToInteract=!0});de(this,"handleVisibilityChange",()=>{document.hidden||(this.updateEngagementScore(.5),this.behaviorData.isLikelyToInteract=!0)})}startTracking(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("scroll",this.handleScroll),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("focusin",this.handleFocus),document.addEventListener("visibilitychange",this.handleVisibilityChange)}stopTracking(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("focusin",this.handleFocus),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.mouseMoveTimer&&clearTimeout(this.mouseMoveTimer)}onBehaviorChange(t){this.listeners.push(t)}getCurrentBehavior(){return this.behaviorData}updateEngagementScore(t){this.behaviorData.engagementScore=Math.min(1,this.behaviorData.engagementScore+t),setTimeout(()=>{this.behaviorData.engagementScore=Math.max(0,this.behaviorData.engagementScore-t*.5),this.notifyListeners()},3e4),this.notifyListeners()}notifyListeners(){this.listeners.forEach(t=>t(this.behaviorData))}}exports.MediaProvider=o.MediaProvider;exports.createEnhancedMediaStore=o.createEnhancedMediaStore;exports.useMediaContext=o.useMediaContext;exports.useMediaDispatch=o.useMediaDispatch;exports.useMediaSelector=o.useMediaSelector;exports.useOptimisticMediaSelector=o.useOptimisticMediaSelector;exports.useEnhancedMediaPlayer=U.useEnhancedMediaPlayer;exports.useEnhancedSubtitles=U.useEnhancedSubtitles$1;exports.useIntelligentPreloading=U.useIntelligentPreloading;exports.useKeyboardControls=U.useKeyboardControls;exports.useMediaActionState=U.useMediaActionState;exports.useMediaActions=U.useMediaActions;exports.useMediaControls=U.useMediaControls;exports.useMediaPlayer=U.useMediaPlayer;exports.useMediaState=U.useMediaState;exports.useScreenshot=U.useScreenshot;exports.useSubtitles=U.useSubtitles;exports.useTouchGestures=U.useTouchGestures;exports.useVideoPlayer=U.useVideoPlayer$1;exports.cn=C.cn;exports.formatTime=C.formatTime;exports.parseTime=C.parseTime;exports.MediaPlayerRoot=we.MediaPlayerRoot;exports.MinimalFullscreenIcon=we.MinimalFullscreenIcon;exports.MinimalMediaPlayer=we.MinimalMediaPlayer;exports.MinimalPauseIcon=we.MinimalPauseIcon;exports.MinimalPlayIcon=we.MinimalPlayIcon;exports.MinimalVolumeIcon=we.MinimalVolumeIcon;exports.SimpleMinimalPlayer=we.SimpleMinimalPlayer;exports.defaultMinimalIcons=we.defaultMinimalIcons;exports.ChaptersPanel=re.ChaptersPanel;exports.DebugPanel=re.DebugPanel;exports.EnhancedControlBar=re.EnhancedControlBar;exports.EnhancedMediaPlayer=re.EnhancedMediaPlayer;exports.EnhancedPlayButton=re.EnhancedPlayButton;exports.EnhancedSeekBar=re.EnhancedSeekBar;exports.EnhancedTimeDisplay=re.EnhancedTimeDisplay;exports.EnhancedVolumeControl=re.EnhancedVolumeControl;exports.PictureInPictureButton=re.PictureInPictureButton;exports.PlaybackSpeedSelector=re.PlaybackSpeedSelector;exports.QualitySelector=re.QualitySelector;exports.SubtitleSelector=re.SubtitleSelector;exports.PerformanceMonitor=Os.PerformanceMonitor;exports.AUDIO_MIME_TYPES=rn;exports.AudioPlayer=Rr;exports.ConcurrentMedia=Er;exports.FullscreenButton=hs;exports.MediaErrorBoundary=br;exports.MediaLoading=Qe;exports.MediaPlayer=wr;exports.MediaPlayerHLS=Pr;exports.MediaResourcePreloader=Bu;exports.MediaSuspense=yr;exports.ModernMediaPlayer=us;exports.PlayButton=fs;exports.SUPPORTED_AUDIO_FORMATS=Ar;exports.SUPPORTED_VIDEO_FORMATS=Nr;exports.SeekBar=ms;exports.SimpleVideoPlayer=ds;exports.TimeDisplay=ps;exports.VIDEO_MIME_TYPES=nn;exports.VideoPlayer=jr;exports.VolumeControl=xs;exports.getMediaTypeFromUrl=gi;exports.getMimeTypeFromUrl=yi;exports.useDeferredMediaLoading=Fs;
111
+ `)},Ca=0,Be=[];function Sa(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),s=f.useState(Ca++)[0],i=f.useState(Ur)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var h=Yi([e.lockRef.current],(e.shards||[]).map(rr),!0).filter(Boolean);return h.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=f.useCallback(function(h,v){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var w=ft(h),j=n.current,b="deltaX"in h?h.deltaX:j[0]-w[0],g="deltaY"in h?h.deltaY:j[1]-w[1],R,P=h.target,M=Math.abs(b)>Math.abs(g)?"h":"v";if("touches"in h&&M==="h"&&P.type==="range")return!1;var S=tr(M,P);if(!S)return!0;if(S?R=M:(R=M==="v"?"h":"v",S=tr(M,P)),!S)return!1;if(!r.current&&"changedTouches"in h&&(b||g)&&(r.current=R),!R)return!0;var F=r.current||R;return ja(F,v,h,F==="h"?b:g)},[]),m=f.useCallback(function(h){var v=h;if(!(!Be.length||Be[Be.length-1]!==i)){var w="deltaY"in v?nr(v):ft(v),j=t.current.filter(function(R){return R.name===v.type&&(R.target===v.target||v.target===R.shadowParent)&&Ra(R.delta,w)})[0];if(j&&j.should){v.cancelable&&v.preventDefault();return}if(!j){var b=(a.current.shards||[]).map(rr).filter(Boolean).filter(function(R){return R.contains(v.target)}),g=b.length>0?c(v,b[0]):!a.current.noIsolation;g&&v.cancelable&&v.preventDefault()}}},[]),l=f.useCallback(function(h,v,w,j){var b={name:h,delta:v,target:w,should:j,shadowParent:Pa(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(g){return g!==b})},1)},[]),d=f.useCallback(function(h){n.current=ft(h),r.current=void 0},[]),u=f.useCallback(function(h){l(h.type,nr(h),h.target,c(h,e.lockRef.current))},[]),p=f.useCallback(function(h){l(h.type,ft(h),h.target,c(h,e.lockRef.current))},[]);f.useEffect(function(){return Be.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",m,$e),document.addEventListener("touchmove",m,$e),document.addEventListener("touchstart",d,$e),function(){Be=Be.filter(function(h){return h!==i}),document.removeEventListener("wheel",m,$e),document.removeEventListener("touchmove",m,$e),document.removeEventListener("touchstart",d,$e)}},[]);var x=e.removeScrollBar,y=e.inert;return f.createElement(f.Fragment,null,y?f.createElement(i,{styles:Ma(s)}):null,x?f.createElement(ha,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pa(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Na=ra(Hr,Sa);var Yr=f.forwardRef(function(e,t){return f.createElement(Pt,fe({},e,{ref:t,sideCar:Na}))});Yr.classNames=Pt.classNames;var Aa=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ve=new WeakMap,mt=new WeakMap,pt={},Gt=0,qr=function(e){return e&&(e.host||qr(e.parentNode))},Ta=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ka=function(e,t,n,r){var s=Ta(t,Array.isArray(e)?e:[e]);pt[n]||(pt[n]=new WeakMap);var i=pt[n],a=[],c=new Set,m=new Set(s),l=function(u){!u||c.has(u)||(c.add(u),l(u.parentNode))};s.forEach(l);var d=function(u){!u||m.has(u)||Array.prototype.forEach.call(u.children,function(p){if(c.has(p))d(p);else try{var x=p.getAttribute(r),y=x!==null&&x!=="false",h=(Ve.get(p)||0)+1,v=(i.get(p)||0)+1;Ve.set(p,h),i.set(p,v),a.push(p),h===1&&y&&mt.set(p,!0),v===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return d(t),c.clear(),Gt++,function(){a.forEach(function(u){var p=Ve.get(u)-1,x=i.get(u)-1;Ve.set(u,p),i.set(u,x),p||(mt.has(u)||u.removeAttribute(r),mt.delete(u)),x||u.removeAttribute(n)}),Gt--,Gt||(Ve=new WeakMap,Ve=new WeakMap,mt=new WeakMap,pt={})}},Da=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Aa(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),ka(r,s,n,"aria-hidden")):function(){return null}};function _a(e){const[t,n]=f.useState(void 0);return Ce(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,c;if("borderBoxSize"in i){const m=i.borderBoxSize,l=Array.isArray(m)?m[0]:m;a=l.inlineSize,c=l.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Ia=["top","right","bottom","left"],Se=Math.min,Q=Math.max,bt=Math.round,xt=Math.floor,pe=e=>({x:e,y:e}),Oa={left:"right",right:"left",bottom:"top",top:"bottom"},La={start:"end",end:"start"};function cn(e,t,n){return Q(e,Se(t,n))}function be(e,t){return typeof e=="function"?e(t):e}function Ee(e){return e.split("-")[0]}function Ke(e){return e.split("-")[1]}function mn(e){return e==="x"?"y":"x"}function pn(e){return e==="y"?"height":"width"}function me(e){return["top","bottom"].includes(Ee(e))?"y":"x"}function xn(e){return mn(me(e))}function Fa(e,t,n){n===void 0&&(n=!1);const r=Ke(e),s=xn(e),i=pn(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Et(a)),[a,Et(a)]}function za(e){const t=Et(e);return[ln(e),t,ln(t)]}function ln(e){return e.replace(/start|end/g,t=>La[t])}function $a(e,t,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?i:a;default:return[]}}function Ba(e,t,n,r){const s=Ke(e);let i=$a(Ee(e),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(ln)))),i}function Et(e){return e.replace(/left|right|bottom|top/g,t=>Oa[t])}function Va(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xr(e){return typeof e!="number"?Va(e):{top:e,right:e,bottom:e,left:e}}function wt(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function or(e,t,n){let{reference:r,floating:s}=e;const i=me(t),a=xn(t),c=pn(a),m=Ee(t),l=i==="y",d=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,p=r[c]/2-s[c]/2;let x;switch(m){case"top":x={x:d,y:r.y-s.height};break;case"bottom":x={x:d,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:u};break;case"left":x={x:r.x-s.width,y:u};break;default:x={x:r.x,y:r.y}}switch(Ke(t)){case"start":x[a]-=p*(n&&l?-1:1);break;case"end":x[a]+=p*(n&&l?-1:1);break}return x}const Ha=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,c=i.filter(Boolean),m=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:u}=or(l,r,m),p=r,x={},y=0;for(let h=0;h<c.length;h++){const{name:v,fn:w}=c[h],{x:j,y:b,data:g,reset:R}=await w({x:d,y:u,initialPlacement:r,placement:p,strategy:s,middlewareData:x,rects:l,platform:a,elements:{reference:e,floating:t}});d=j??d,u=b??u,x={...x,[v]:{...x[v],...g}},R&&y<=50&&(y++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(l=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):R.rects),{x:d,y:u}=or(l,p,m)),h=-1)}return{x:d,y:u,placement:p,strategy:s,middlewareData:x}};async function Je(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:a,elements:c,strategy:m}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:x=0}=be(t,e),y=Xr(x),v=c[p?u==="floating"?"reference":"floating":u],w=wt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:m})),j=u==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),g=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},R=wt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:j,offsetParent:b,strategy:m}):j);return{top:(w.top-R.top+y.top)/g.y,bottom:(R.bottom-w.bottom+y.bottom)/g.y,left:(w.left-R.left+y.left)/g.x,right:(R.right-w.right+y.right)/g.x}}const Ua=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:a,elements:c,middlewareData:m}=t,{element:l,padding:d=0}=be(e,t)||{};if(l==null)return{};const u=Xr(d),p={x:n,y:r},x=xn(s),y=pn(x),h=await a.getDimensions(l),v=x==="y",w=v?"top":"left",j=v?"bottom":"right",b=v?"clientHeight":"clientWidth",g=i.reference[y]+i.reference[x]-p[x]-i.floating[y],R=p[x]-i.reference[x],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let M=P?P[b]:0;(!M||!await(a.isElement==null?void 0:a.isElement(P)))&&(M=c.floating[b]||i.floating[y]);const S=g/2-R/2,F=M/2-h[y]/2-1,D=Se(u[w],F),_=Se(u[j],F),B=D,$=M-h[y]-_,T=M/2-h[y]/2+S,O=cn(B,T,$),k=!m.arrow&&Ke(s)!=null&&T!==O&&i.reference[y]/2-(T<B?D:_)-h[y]/2<0,I=k?T<B?T-B:T-$:0;return{[x]:p[x]+I,data:{[x]:O,centerOffset:T-O-I,...k&&{alignmentOffset:I}},reset:k}}}),Wa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:c,platform:m,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:h=!0,...v}=be(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Ee(s),j=me(c),b=Ee(c)===c,g=await(m.isRTL==null?void 0:m.isRTL(l.floating)),R=p||(b||!h?[Et(c)]:za(c)),P=y!=="none";!p&&P&&R.push(...Ba(c,h,y,g));const M=[c,...R],S=await Je(t,v),F=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&F.push(S[w]),u){const T=Fa(s,a,g);F.push(S[T[0]],S[T[1]])}if(D=[...D,{placement:s,overflows:F}],!F.every(T=>T<=0)){var _,B;const T=(((_=i.flip)==null?void 0:_.index)||0)+1,O=M[T];if(O&&(!(u==="alignment"?j!==me(O):!1)||D.every(N=>N.overflows[0]>0&&me(N.placement)===j)))return{data:{index:T,overflows:D},reset:{placement:O}};let k=(B=D.filter(I=>I.overflows[0]<=0).sort((I,N)=>I.overflows[1]-N.overflows[1])[0])==null?void 0:B.placement;if(!k)switch(x){case"bestFit":{var $;const I=($=D.filter(N=>{if(P){const A=me(N.placement);return A===j||A==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(A=>A>0).reduce((A,W)=>A+W,0)]).sort((N,A)=>N[1]-A[1])[0])==null?void 0:$[0];I&&(k=I);break}case"initialPlacement":k=c;break}if(s!==k)return{reset:{placement:k}}}return{}}}};function sr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ir(e){return Ia.some(t=>e[t]>=0)}const Ka=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=be(e,t);switch(r){case"referenceHidden":{const i=await Je(t,{...s,elementContext:"reference"}),a=sr(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ir(a)}}}case"escaped":{const i=await Je(t,{...s,altBoundary:!0}),a=sr(i,n.floating);return{data:{escapedOffsets:a,escaped:ir(a)}}}default:return{}}}}};async function Ga(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Ee(n),c=Ke(n),m=me(n)==="y",l=["left","top"].includes(a)?-1:1,d=i&&m?-1:1,u=be(t,e);let{mainAxis:p,crossAxis:x,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof y=="number"&&(x=c==="end"?y*-1:y),m?{x:x*d,y:p*l}:{x:p*l,y:x*d}}const Ya=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:a,middlewareData:c}=t,m=await Ga(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+m.x,y:i+m.y,data:{...m,placement:a}}}}},qa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:w,y:j}=v;return{x:w,y:j}}},...m}=be(e,t),l={x:n,y:r},d=await Je(t,m),u=me(Ee(s)),p=mn(u);let x=l[p],y=l[u];if(i){const v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",j=x+d[v],b=x-d[w];x=cn(j,x,b)}if(a){const v=u==="y"?"top":"left",w=u==="y"?"bottom":"right",j=y+d[v],b=y-d[w];y=cn(j,y,b)}const h=c.fn({...t,[p]:x,[u]:y});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:i,[u]:a}}}}}},Xa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=t,{offset:c=0,mainAxis:m=!0,crossAxis:l=!0}=be(e,t),d={x:n,y:r},u=me(s),p=mn(u);let x=d[p],y=d[u];const h=be(c,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(m){const b=p==="y"?"height":"width",g=i.reference[p]-i.floating[b]+v.mainAxis,R=i.reference[p]+i.reference[b]-v.mainAxis;x<g?x=g:x>R&&(x=R)}if(l){var w,j;const b=p==="y"?"width":"height",g=["top","left"].includes(Ee(s)),R=i.reference[u]-i.floating[b]+(g&&((w=a.offset)==null?void 0:w[u])||0)+(g?0:v.crossAxis),P=i.reference[u]+i.reference[b]+(g?0:((j=a.offset)==null?void 0:j[u])||0)-(g?v.crossAxis:0);y<R?y=R:y>P&&(y=P)}return{[p]:x,[u]:y}}}},Qa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:a,elements:c}=t,{apply:m=()=>{},...l}=be(e,t),d=await Je(t,l),u=Ee(s),p=Ke(s),x=me(s)==="y",{width:y,height:h}=i.floating;let v,w;u==="top"||u==="bottom"?(v=u,w=p===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(w=u,v=p==="end"?"top":"bottom");const j=h-d.top-d.bottom,b=y-d.left-d.right,g=Se(h-d[v],j),R=Se(y-d[w],b),P=!t.middlewareData.shift;let M=g,S=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=j),P&&!p){const D=Q(d.left,0),_=Q(d.right,0),B=Q(d.top,0),$=Q(d.bottom,0);x?S=y-2*(D!==0||_!==0?D+_:Q(d.left,d.right)):M=h-2*(B!==0||$!==0?B+$:Q(d.top,d.bottom))}await m({...t,availableWidth:S,availableHeight:M});const F=await a.getDimensions(c.floating);return y!==F.width||h!==F.height?{reset:{rects:!0}}:{}}}};function Nt(){return typeof window<"u"}function Ge(e){return Qr(e)?(e.nodeName||"").toLowerCase():"#document"}function Z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function he(e){var t;return(t=(Qr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qr(e){return Nt()?e instanceof Node||e instanceof Z(e).Node:!1}function ae(e){return Nt()?e instanceof Element||e instanceof Z(e).Element:!1}function xe(e){return Nt()?e instanceof HTMLElement||e instanceof Z(e).HTMLElement:!1}function ar(e){return!Nt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot}function st(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Za(e){return["table","td","th"].includes(Ge(e))}function At(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function hn(e){const t=vn(),n=ae(e)?ce(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ja(e){let t=Pe(e);for(;xe(t)&&!We(t);){if(hn(t))return t;if(At(t))return null;t=Pe(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function We(e){return["html","body","#document"].includes(Ge(e))}function ce(e){return Z(e).getComputedStyle(e)}function Tt(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pe(e){if(Ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ar(e)&&e.host||he(e);return ar(t)?t.host:t}function Zr(e){const t=Pe(e);return We(t)?e.ownerDocument?e.ownerDocument.body:e.body:xe(t)&&st(t)?t:Zr(t)}function et(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Zr(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),a=Z(s);if(i){const c=un(a);return t.concat(a,a.visualViewport||[],st(s)?s:[],c&&n?et(c):[])}return t.concat(s,et(s,[],n))}function un(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jr(e){const t=ce(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=xe(e),i=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=bt(n)!==i||bt(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function gn(e){return ae(e)?e:e.contextElement}function Ue(e){const t=gn(e);if(!xe(t))return pe(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=Jr(t);let a=(i?bt(n.width):n.width)/r,c=(i?bt(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const ec=pe(0);function eo(e){const t=Z(e);return!vn()||!t.visualViewport?ec:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Z(e)?!1:t}function Ie(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=gn(e);let a=pe(1);t&&(r?ae(r)&&(a=Ue(r)):a=Ue(e));const c=tc(i,n,r)?eo(i):pe(0);let m=(s.left+c.x)/a.x,l=(s.top+c.y)/a.y,d=s.width/a.x,u=s.height/a.y;if(i){const p=Z(i),x=r&&ae(r)?Z(r):r;let y=p,h=un(y);for(;h&&r&&x!==y;){const v=Ue(h),w=h.getBoundingClientRect(),j=ce(h),b=w.left+(h.clientLeft+parseFloat(j.paddingLeft))*v.x,g=w.top+(h.clientTop+parseFloat(j.paddingTop))*v.y;m*=v.x,l*=v.y,d*=v.x,u*=v.y,m+=b,l+=g,y=Z(h),h=un(y)}}return wt({width:d,height:u,x:m,y:l})}function yn(e,t){const n=Tt(e).scrollLeft;return t?t.left+n:Ie(he(e)).left+n}function to(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:yn(e,r)),i=r.top+t.scrollTop;return{x:s,y:i}}function nc(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",a=he(r),c=t?At(t.floating):!1;if(r===a||c&&i)return n;let m={scrollLeft:0,scrollTop:0},l=pe(1);const d=pe(0),u=xe(r);if((u||!u&&!i)&&((Ge(r)!=="body"||st(a))&&(m=Tt(r)),xe(r))){const x=Ie(r);l=Ue(r),d.x=x.x+r.clientLeft,d.y=x.y+r.clientTop}const p=a&&!u&&!i?to(a,m,!0):pe(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-m.scrollLeft*l.x+d.x+p.x,y:n.y*l.y-m.scrollTop*l.y+d.y+p.y}}function rc(e){return Array.from(e.getClientRects())}function oc(e){const t=he(e),n=Tt(e),r=e.ownerDocument.body,s=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+yn(e);const c=-n.scrollTop;return ce(r).direction==="rtl"&&(a+=Q(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:c}}function sc(e,t){const n=Z(e),r=he(e),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,c=0,m=0;if(s){i=s.width,a=s.height;const l=vn();(!l||l&&t==="fixed")&&(c=s.offsetLeft,m=s.offsetTop)}return{width:i,height:a,x:c,y:m}}function ic(e,t){const n=Ie(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=xe(e)?Ue(e):pe(1),a=e.clientWidth*i.x,c=e.clientHeight*i.y,m=s*i.x,l=r*i.y;return{width:a,height:c,x:m,y:l}}function cr(e,t,n){let r;if(t==="viewport")r=sc(e,n);else if(t==="document")r=oc(he(e));else if(ae(t))r=ic(t,n);else{const s=eo(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return wt(r)}function no(e,t){const n=Pe(e);return n===t||!ae(n)||We(n)?!1:ce(n).position==="fixed"||no(n,t)}function ac(e,t){const n=t.get(e);if(n)return n;let r=et(e,[],!1).filter(c=>ae(c)&&Ge(c)!=="body"),s=null;const i=ce(e).position==="fixed";let a=i?Pe(e):e;for(;ae(a)&&!We(a);){const c=ce(a),m=hn(a);!m&&c.position==="fixed"&&(s=null),(i?!m&&!s:!m&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||st(a)&&!m&&no(e,a))?r=r.filter(d=>d!==a):s=c,a=Pe(a)}return t.set(e,r),r}function cc(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?At(t)?[]:ac(t,this._c):[].concat(n),r],c=a[0],m=a.reduce((l,d)=>{const u=cr(t,d,s);return l.top=Q(u.top,l.top),l.right=Se(u.right,l.right),l.bottom=Se(u.bottom,l.bottom),l.left=Q(u.left,l.left),l},cr(t,c,s));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function lc(e){const{width:t,height:n}=Jr(e);return{width:t,height:n}}function uc(e,t,n){const r=xe(t),s=he(t),i=n==="fixed",a=Ie(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const m=pe(0);function l(){m.x=yn(s)}if(r||!r&&!i)if((Ge(t)!=="body"||st(s))&&(c=Tt(t)),r){const x=Ie(t,!0,i,t);m.x=x.x+t.clientLeft,m.y=x.y+t.clientTop}else s&&l();i&&!r&&s&&l();const d=s&&!r&&!i?to(s,c):pe(0),u=a.left+c.scrollLeft-m.x-d.x,p=a.top+c.scrollTop-m.y-d.y;return{x:u,y:p,width:a.width,height:a.height}}function Yt(e){return ce(e).position==="static"}function lr(e,t){if(!xe(e)||ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return he(e)===n&&(n=n.ownerDocument.body),n}function ro(e,t){const n=Z(e);if(At(e))return n;if(!xe(e)){let s=Pe(e);for(;s&&!We(s);){if(ae(s)&&!Yt(s))return s;s=Pe(s)}return n}let r=lr(e,t);for(;r&&Za(r)&&Yt(r);)r=lr(r,t);return r&&We(r)&&Yt(r)&&!hn(r)?n:r||Ja(e)||n}const dc=async function(e){const t=this.getOffsetParent||ro,n=this.getDimensions,r=await n(e.floating);return{reference:uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fc(e){return ce(e).direction==="rtl"}const mc={convertOffsetParentRelativeRectToViewportRelativeRect:nc,getDocumentElement:he,getClippingRect:cc,getOffsetParent:ro,getElementRects:dc,getClientRects:rc,getDimensions:lc,getScale:Ue,isElement:ae,isRTL:fc};function oo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pc(e,t){let n=null,r;const s=he(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),i();const l=e.getBoundingClientRect(),{left:d,top:u,width:p,height:x}=l;if(c||t(),!p||!x)return;const y=xt(u),h=xt(s.clientWidth-(d+p)),v=xt(s.clientHeight-(u+x)),w=xt(d),b={rootMargin:-y+"px "+-h+"px "+-v+"px "+-w+"px",threshold:Q(0,Se(1,m))||1};let g=!0;function R(P){const M=P[0].intersectionRatio;if(M!==m){if(!g)return a();M?a(!1,M):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!oo(l,e.getBoundingClientRect())&&a(),g=!1}try{n=new IntersectionObserver(R,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(R,b)}n.observe(e)}return a(!0),i}function xc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=r,l=gn(e),d=s||i?[...l?et(l):[],...et(t)]:[];d.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const u=l&&c?pc(l,n):null;let p=-1,x=null;a&&(x=new ResizeObserver(w=>{let[j]=w;j&&j.target===l&&x&&(x.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=x)==null||b.observe(t)})),n()}),l&&!m&&x.observe(l),x.observe(t));let y,h=m?Ie(e):null;m&&v();function v(){const w=Ie(e);h&&!oo(h,w)&&n(),h=w,y=requestAnimationFrame(v)}return n(),()=>{var w;d.forEach(j=>{s&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),u?.(),(w=x)==null||w.disconnect(),x=null,m&&cancelAnimationFrame(y)}}const hc=Ya,vc=qa,gc=Wa,yc=Qa,bc=Ka,ur=Ua,Ec=Xa,wc=(e,t,n)=>{const r=new Map,s={platform:mc,...n},i={...s.platform,_c:r};return Ha(e,t,{...s,platform:i})};var jc=typeof document<"u",Rc=function(){},yt=jc?E.useLayoutEffect:Rc;function jt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!jt(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!jt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function so(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dr(e,t){const n=so(e);return Math.round(t*n)/n}function qt(e){const t=f.useRef(e);return yt(()=>{t.current=e}),t}function Mc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:m,open:l}=e,[d,u]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,x]=f.useState(r);jt(p,r)||x(r);const[y,h]=f.useState(null),[v,w]=f.useState(null),j=f.useCallback(N=>{N!==P.current&&(P.current=N,h(N))},[]),b=f.useCallback(N=>{N!==M.current&&(M.current=N,w(N))},[]),g=i||y,R=a||v,P=f.useRef(null),M=f.useRef(null),S=f.useRef(d),F=m!=null,D=qt(m),_=qt(s),B=qt(l),$=f.useCallback(()=>{if(!P.current||!M.current)return;const N={placement:t,strategy:n,middleware:p};_.current&&(N.platform=_.current),wc(P.current,M.current,N).then(A=>{const W={...A,isPositioned:B.current!==!1};T.current&&!jt(S.current,W)&&(S.current=W,gr.flushSync(()=>{u(W)}))})},[p,t,n,_,B]);yt(()=>{l===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[l]);const T=f.useRef(!1);yt(()=>(T.current=!0,()=>{T.current=!1}),[]),yt(()=>{if(g&&(P.current=g),R&&(M.current=R),g&&R){if(D.current)return D.current(g,R,$);$()}},[g,R,$,D,F]);const O=f.useMemo(()=>({reference:P,floating:M,setReference:j,setFloating:b}),[j,b]),k=f.useMemo(()=>({reference:g,floating:R}),[g,R]),I=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!k.floating)return N;const A=dr(k.floating,d.x),W=dr(k.floating,d.y);return c?{...N,transform:"translate("+A+"px, "+W+"px)",...so(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:W}},[n,c,k.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:$,refs:O,elements:k,floatingStyles:I}),[d,$,O,k,I])}const Cc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ur({element:r.current,padding:s}).fn(n):{}:r?ur({element:r,padding:s}).fn(n):{}}}},Sc=(e,t)=>({...hc(e),options:[e,t]}),Pc=(e,t)=>({...vc(e),options:[e,t]}),Nc=(e,t)=>({...Ec(e),options:[e,t]}),Ac=(e,t)=>({...gc(e),options:[e,t]}),Tc=(e,t)=>({...yc(e),options:[e,t]}),kc=(e,t)=>({...bc(e),options:[e,t]}),Dc=(e,t)=>({...Cc(e),options:[e,t]});var _c="Arrow",io=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return o.jsxRuntimeExports.jsx(G.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsxRuntimeExports.jsx("polygon",{points:"0,0 30,0 15,10"})})});io.displayName=_c;var Ic=io,bn="Popper",[ao,co]=rt(bn),[Oc,lo]=ao(bn),uo=e=>{const{__scopePopper:t,children:n}=e,[r,s]=f.useState(null);return o.jsxRuntimeExports.jsx(Oc,{scope:t,anchor:r,onAnchorChange:s,children:n})};uo.displayName=bn;var fo="PopperAnchor",mo=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=lo(fo,n),a=f.useRef(null),c=X(t,a);return f.useEffect(()=>{i.onAnchorChange(r?.current||a.current)}),r?null:o.jsxRuntimeExports.jsx(G.div,{...s,ref:c})});mo.displayName=fo;var En="PopperContent",[Lc,Fc]=ao(En),po=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:m=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:x="optimized",onPlaced:y,...h}=e,v=lo(En,n),[w,j]=f.useState(null),b=X(t,H=>j(H)),[g,R]=f.useState(null),P=_a(g),M=P?.width??0,S=P?.height??0,F=r+(i!=="center"?"-"+i:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},_=Array.isArray(l)?l:[l],B=_.length>0,$={padding:D,boundary:_.filter($c),altBoundary:B},{refs:T,floatingStyles:O,placement:k,isPositioned:I,middlewareData:N}=Mc({strategy:"fixed",placement:F,whileElementsMounted:(...H)=>xc(...H,{animationFrame:x==="always"}),elements:{reference:v.anchor},middleware:[Sc({mainAxis:s+S,alignmentAxis:a}),m&&Pc({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Nc():void 0,...$}),m&&Ac({...$}),Tc({...$,apply:({elements:H,rects:K,availableWidth:Te,availableHeight:je})=>{const{width:Ye,height:ue}=K.reference,Re=H.floating.style;Re.setProperty("--radix-popper-available-width",`${Te}px`),Re.setProperty("--radix-popper-available-height",`${je}px`),Re.setProperty("--radix-popper-anchor-width",`${Ye}px`),Re.setProperty("--radix-popper-anchor-height",`${ue}px`)}}),g&&Dc({element:g,padding:c}),Bc({arrowWidth:M,arrowHeight:S}),p&&kc({strategy:"referenceHidden",...$})]}),[A,W]=vo(k),J=ye(y);Ce(()=>{I&&J?.()},[I,J]);const ve=N.arrow?.x,Ne=N.arrow?.y,Ae=N.arrow?.centerOffset!==0,[Fe,ge]=f.useState();return Ce(()=>{w&&ge(window.getComputedStyle(w).zIndex)},[w]),o.jsxRuntimeExports.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:I?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Fe,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsxRuntimeExports.jsx(Lc,{scope:n,placedSide:A,onArrowChange:R,arrowX:ve,arrowY:Ne,shouldHideArrow:Ae,children:o.jsxRuntimeExports.jsx(G.div,{"data-side":A,"data-align":W,...h,ref:b,style:{...h.style,animation:I?void 0:"none"}})})})});po.displayName=En;var xo="PopperArrow",zc={top:"bottom",right:"left",bottom:"top",left:"right"},ho=f.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=Fc(xo,r),a=zc[i.placedSide];return o.jsxRuntimeExports.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsxRuntimeExports.jsx(Ic,{...s,ref:n,style:{...s.style,display:"block"}})})});ho.displayName=xo;function $c(e){return e!==null}var Bc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,a=s.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,m=a?0:e.arrowHeight,[l,d]=vo(n),u={start:"0%",center:"50%",end:"100%"}[d],p=(s.arrow?.x??0)+c/2,x=(s.arrow?.y??0)+m/2;let y="",h="";return l==="bottom"?(y=a?u:`${p}px`,h=`${-m}px`):l==="top"?(y=a?u:`${p}px`,h=`${r.floating.height+m}px`):l==="right"?(y=`${-m}px`,h=a?u:`${x}px`):l==="left"&&(y=`${r.floating.width+m}px`,h=a?u:`${x}px`),{data:{x:y,y:h}}}});function vo(e){const[t,n="center"]=e.split("-");return[t,n]}var Vc=uo,Hc=mo,Uc=po,Wc=ho,Xt="rovingFocusGroup.onEntryFocus",Kc={bubbles:!1,cancelable:!0},it="RovingFocusGroup",[dn,go,Gc]=Tr(it),[Yc,yo]=rt(it,[Gc]),[qc,Xc]=Yc(it),bo=f.forwardRef((e,t)=>o.jsxRuntimeExports.jsx(dn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsxRuntimeExports.jsx(dn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsxRuntimeExports.jsx(Qc,{...e,ref:t})})}));bo.displayName=it;var Qc=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:m,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...u}=e,p=f.useRef(null),x=X(t,p),y=_r(i),[h,v]=kr({prop:a,defaultProp:c??null,onChange:m,caller:it}),[w,j]=f.useState(!1),b=ye(l),g=go(n),R=f.useRef(!1),[P,M]=f.useState(0);return f.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(Xt,b),()=>S.removeEventListener(Xt,b)},[b]),o.jsxRuntimeExports.jsx(qc,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:h,onItemFocus:f.useCallback(S=>v(S),[v]),onItemShiftTab:f.useCallback(()=>j(!0),[]),onFocusableItemAdd:f.useCallback(()=>M(S=>S+1),[]),onFocusableItemRemove:f.useCallback(()=>M(S=>S-1),[]),children:o.jsxRuntimeExports.jsx(G.div,{tabIndex:w||P===0?-1:0,"data-orientation":r,...u,ref:x,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{R.current=!0}),onFocus:z(e.onFocus,S=>{const F=!R.current;if(S.target===S.currentTarget&&F&&!w){const D=new CustomEvent(Xt,Kc);if(S.currentTarget.dispatchEvent(D),!D.defaultPrevented){const _=g().filter(k=>k.focusable),B=_.find(k=>k.active),$=_.find(k=>k.id===h),O=[B,$,..._].filter(Boolean).map(k=>k.ref.current);jo(O,d)}}R.current=!1}),onBlur:z(e.onBlur,()=>j(!1))})})}),Eo="RovingFocusGroupItem",wo=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...c}=e,m=on(),l=i||m,d=Xc(Eo,n),u=d.currentTabStopId===l,p=go(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:h}=d;return f.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),o.jsxRuntimeExports.jsx(dn.ItemSlot,{scope:n,id:l,focusable:r,active:s,children:o.jsxRuntimeExports.jsx(G.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:z(e.onMouseDown,v=>{r?d.onItemFocus(l):v.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:z(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const w=el(v,d.orientation,d.dir);if(w!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=p().filter(g=>g.focusable).map(g=>g.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const g=b.indexOf(v.currentTarget);b=d.loop?tl(b,g+1):b.slice(g+1)}setTimeout(()=>jo(b))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:h!=null}):a})})});wo.displayName=Eo;var Zc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jc(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function el(e,t,n){const r=Jc(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Zc[r]}function jo(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function tl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var nl=bo,rl=wo,fn=["Enter"," "],ol=["ArrowDown","PageUp","Home"],Ro=["ArrowUp","PageDown","End"],sl=[...ol,...Ro],il={ltr:[...fn,"ArrowRight"],rtl:[...fn,"ArrowLeft"]},al={ltr:["ArrowLeft"],rtl:["ArrowRight"]},at="Menu",[tt,cl,ll]=Tr(at),[Oe,Mo]=rt(at,[ll,co,yo]),kt=co(),Co=yo(),[ul,Le]=Oe(at),[dl,ct]=Oe(at),So=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=e,c=kt(t),[m,l]=f.useState(null),d=f.useRef(!1),u=ye(i),p=_r(s);return f.useEffect(()=>{const x=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsxRuntimeExports.jsx(Vc,{...c,children:o.jsxRuntimeExports.jsx(ul,{scope:t,open:n,onOpenChange:u,content:m,onContentChange:l,children:o.jsxRuntimeExports.jsx(dl,{scope:t,onClose:f.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:a,children:r})})})};So.displayName=at;var fl="MenuAnchor",wn=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=kt(n);return o.jsxRuntimeExports.jsx(Hc,{...s,...r,ref:t})});wn.displayName=fl;var jn="MenuPortal",[ml,Po]=Oe(jn,{forceMount:void 0}),No=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=Le(jn,t);return o.jsxRuntimeExports.jsx(ml,{scope:t,forceMount:n,children:o.jsxRuntimeExports.jsx(ot,{present:n||i.open,children:o.jsxRuntimeExports.jsx($r,{asChild:!0,container:s,children:r})})})};No.displayName=jn;var ne="MenuContent",[pl,Rn]=Oe(ne),Ao=f.forwardRef((e,t)=>{const n=Po(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Le(ne,e.__scopeMenu),a=ct(ne,e.__scopeMenu);return o.jsxRuntimeExports.jsx(tt.Provider,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(ot,{present:r||i.open,children:o.jsxRuntimeExports.jsx(tt.Slot,{scope:e.__scopeMenu,children:a.modal?o.jsxRuntimeExports.jsx(xl,{...s,ref:t}):o.jsxRuntimeExports.jsx(hl,{...s,ref:t})})})})}),xl=f.forwardRef((e,t)=>{const n=Le(ne,e.__scopeMenu),r=f.useRef(null),s=X(t,r);return f.useEffect(()=>{const i=r.current;if(i)return Da(i)},[]),o.jsxRuntimeExports.jsx(Mn,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hl=f.forwardRef((e,t)=>{const n=Le(ne,e.__scopeMenu);return o.jsxRuntimeExports.jsx(Mn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),vl=Ze("MenuContent.ScrollLock"),Mn=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:m,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:x,disableOutsideScroll:y,...h}=e,v=Le(ne,n),w=ct(ne,n),j=kt(n),b=Co(n),g=cl(n),[R,P]=f.useState(null),M=f.useRef(null),S=X(t,M,v.onContentChange),F=f.useRef(0),D=f.useRef(""),_=f.useRef(0),B=f.useRef(null),$=f.useRef("right"),T=f.useRef(0),O=y?Yr:f.Fragment,k=y?{as:vl,allowPinchZoom:!0}:void 0,I=A=>{const W=D.current+A,J=g().filter(H=>!H.disabled),ve=document.activeElement,Ne=J.find(H=>H.ref.current===ve)?.textValue,Ae=J.map(H=>H.textValue),Fe=Nl(Ae,W,Ne),ge=J.find(H=>H.textValue===Fe)?.ref.current;(function H(K){D.current=K,window.clearTimeout(F.current),K!==""&&(F.current=window.setTimeout(()=>H(""),1e3))})(W),ge&&setTimeout(()=>ge.focus())};f.useEffect(()=>()=>window.clearTimeout(F.current),[]),Gi();const N=f.useCallback(A=>$.current===B.current?.side&&Tl(A,B.current?.area),[]);return o.jsxRuntimeExports.jsx(pl,{scope:n,searchRef:D,onItemEnter:f.useCallback(A=>{N(A)&&A.preventDefault()},[N]),onItemLeave:f.useCallback(A=>{N(A)||(M.current?.focus(),P(null))},[N]),onTriggerLeave:f.useCallback(A=>{N(A)&&A.preventDefault()},[N]),pointerGraceTimerRef:_,onPointerGraceIntentChange:f.useCallback(A=>{B.current=A},[]),children:o.jsxRuntimeExports.jsx(O,{...k,children:o.jsxRuntimeExports.jsx(Fr,{asChild:!0,trapped:s,onMountAutoFocus:z(i,A=>{A.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:o.jsxRuntimeExports.jsx(Or,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:x,children:o.jsxRuntimeExports.jsx(nl,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:P,onEntryFocus:z(m,A=>{w.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsxRuntimeExports.jsx(Uc,{role:"menu","aria-orientation":"vertical","data-state":Ko(v.open),"data-radix-menu-content":"",dir:w.dir,...j,...h,ref:S,style:{outline:"none",...h.style},onKeyDown:z(h.onKeyDown,A=>{const J=A.target.closest("[data-radix-menu-content]")===A.currentTarget,ve=A.ctrlKey||A.altKey||A.metaKey,Ne=A.key.length===1;J&&(A.key==="Tab"&&A.preventDefault(),!ve&&Ne&&I(A.key));const Ae=M.current;if(A.target!==Ae||!sl.includes(A.key))return;A.preventDefault();const ge=g().filter(H=>!H.disabled).map(H=>H.ref.current);Ro.includes(A.key)&&ge.reverse(),Sl(ge)}),onBlur:z(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(F.current),D.current="")}),onPointerMove:z(e.onPointerMove,nt(A=>{const W=A.target,J=T.current!==A.clientX;if(A.currentTarget.contains(W)&&J){const ve=A.clientX>T.current?"right":"left";$.current=ve,T.current=A.clientX}}))})})})})})})});Ao.displayName=ne;var gl="MenuGroup",Cn=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{role:"group",...r,ref:t})});Cn.displayName=gl;var yl="MenuLabel",To=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{...r,ref:t})});To.displayName=yl;var Rt="MenuItem",fr="menu.itemSelect",Dt=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=f.useRef(null),a=ct(Rt,e.__scopeMenu),c=Rn(Rt,e.__scopeMenu),m=X(t,i),l=f.useRef(!1),d=()=>{const u=i.current;if(!n&&u){const p=new CustomEvent(fr,{bubbles:!0,cancelable:!0});u.addEventListener(fr,x=>r?.(x),{once:!0}),Dr(u,p),p.defaultPrevented?l.current=!1:a.onClose()}};return o.jsxRuntimeExports.jsx(ko,{...s,ref:m,disabled:n,onClick:z(e.onClick,d),onPointerDown:u=>{e.onPointerDown?.(u),l.current=!0},onPointerUp:z(e.onPointerUp,u=>{l.current||u.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,u=>{const p=c.searchRef.current!=="";n||p&&u.key===" "||fn.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Dt.displayName=Rt;var ko=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,a=Rn(Rt,n),c=Co(n),m=f.useRef(null),l=X(t,m),[d,u]=f.useState(!1),[p,x]=f.useState("");return f.useEffect(()=>{const y=m.current;y&&x((y.textContent??"").trim())},[i.children]),o.jsxRuntimeExports.jsx(tt.ItemSlot,{scope:n,disabled:r,textValue:s??p,children:o.jsxRuntimeExports.jsx(rl,{asChild:!0,...c,focusable:!r,children:o.jsxRuntimeExports.jsx(G.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:l,onPointerMove:z(e.onPointerMove,nt(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,nt(y=>a.onItemLeave(y))),onFocus:z(e.onFocus,()=>u(!0)),onBlur:z(e.onBlur,()=>u(!1))})})})}),bl="MenuCheckboxItem",Do=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsxRuntimeExports.jsx(Fo,{scope:e.__scopeMenu,checked:n,children:o.jsxRuntimeExports.jsx(Dt,{role:"menuitemcheckbox","aria-checked":Mt(n)?"mixed":n,...s,ref:t,"data-state":Pn(n),onSelect:z(s.onSelect,()=>r?.(Mt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Do.displayName=bl;var _o="MenuRadioGroup",[El,wl]=Oe(_o,{value:void 0,onValueChange:()=>{}}),Io=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=ye(r);return o.jsxRuntimeExports.jsx(El,{scope:e.__scopeMenu,value:n,onValueChange:i,children:o.jsxRuntimeExports.jsx(Cn,{...s,ref:t})})});Io.displayName=_o;var Oo="MenuRadioItem",Lo=f.forwardRef((e,t)=>{const{value:n,...r}=e,s=wl(Oo,e.__scopeMenu),i=n===s.value;return o.jsxRuntimeExports.jsx(Fo,{scope:e.__scopeMenu,checked:i,children:o.jsxRuntimeExports.jsx(Dt,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Pn(i),onSelect:z(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Lo.displayName=Oo;var Sn="MenuItemIndicator",[Fo,jl]=Oe(Sn,{checked:!1}),zo=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=jl(Sn,n);return o.jsxRuntimeExports.jsx(ot,{present:r||Mt(i.checked)||i.checked===!0,children:o.jsxRuntimeExports.jsx(G.span,{...s,ref:t,"data-state":Pn(i.checked)})})});zo.displayName=Sn;var Rl="MenuSeparator",$o=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsxRuntimeExports.jsx(G.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});$o.displayName=Rl;var Ml="MenuArrow",Bo=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=kt(n);return o.jsxRuntimeExports.jsx(Wc,{...s,...r,ref:t})});Bo.displayName=Ml;var Cl="MenuSub",[Wu,Vo]=Oe(Cl),Xe="MenuSubTrigger",Ho=f.forwardRef((e,t)=>{const n=Le(Xe,e.__scopeMenu),r=ct(Xe,e.__scopeMenu),s=Vo(Xe,e.__scopeMenu),i=Rn(Xe,e.__scopeMenu),a=f.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:m}=i,l={__scopeMenu:e.__scopeMenu},d=f.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return f.useEffect(()=>d,[d]),f.useEffect(()=>{const u=c.current;return()=>{window.clearTimeout(u),m(null)}},[c,m]),o.jsxRuntimeExports.jsx(wn,{asChild:!0,...l,children:o.jsxRuntimeExports.jsx(ko,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":Ko(n.open),...e,ref:St(t,s.onTriggerChange),onClick:u=>{e.onClick?.(u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,nt(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:z(e.onPointerLeave,nt(u=>{d();const p=n.content?.getBoundingClientRect();if(p){const x=n.content?.dataset.side,y=x==="right",h=y?-5:5,v=p[y?"left":"right"],w=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+h,y:u.clientY},{x:v,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:v,y:p.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,u=>{const p=i.searchRef.current!=="";e.disabled||p&&u.key===" "||il[r.dir].includes(u.key)&&(n.onOpenChange(!0),n.content?.focus(),u.preventDefault())})})})});Ho.displayName=Xe;var Uo="MenuSubContent",Wo=f.forwardRef((e,t)=>{const n=Po(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Le(ne,e.__scopeMenu),a=ct(ne,e.__scopeMenu),c=Vo(Uo,e.__scopeMenu),m=f.useRef(null),l=X(t,m);return o.jsxRuntimeExports.jsx(tt.Provider,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(ot,{present:r||i.open,children:o.jsxRuntimeExports.jsx(tt.Slot,{scope:e.__scopeMenu,children:o.jsxRuntimeExports.jsx(Mn,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{a.isUsingKeyboardRef.current&&m.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:z(e.onFocusOutside,d=>{d.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:z(e.onKeyDown,d=>{const u=d.currentTarget.contains(d.target),p=al[a.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),c.trigger?.focus(),d.preventDefault())})})})})})});Wo.displayName=Uo;function Ko(e){return e?"open":"closed"}function Mt(e){return e==="indeterminate"}function Pn(e){return Mt(e)?"indeterminate":e?"checked":"unchecked"}function Sl(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Pl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nl(e,t,n){const s=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Pl(e,Math.max(i,0));s.length===1&&(a=a.filter(l=>l!==n));const m=a.find(l=>l.toLowerCase().startsWith(s.toLowerCase()));return m!==n?m:void 0}function Al(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const c=t[i],m=t[a],l=c.x,d=c.y,u=m.x,p=m.y;d>r!=p>r&&n<(u-l)*(r-d)/(p-d)+l&&(s=!s)}return s}function Tl(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Al(n,t)}function nt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var kl=So,Dl=wn,_l=No,Il=Ao,Ol=Cn,Ll=To,Fl=Dt,zl=Do,$l=Io,Bl=Lo,Vl=zo,Hl=$o,Ul=Bo,Wl=Ho,Kl=Wo,_t="DropdownMenu",[Gl,Ku]=rt(_t,[Mo]),Y=Mo(),[Yl,Go]=Gl(_t),Yo=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:c=!0}=e,m=Y(t),l=f.useRef(null),[d,u]=kr({prop:s,defaultProp:i??!1,onChange:a,caller:_t});return o.jsxRuntimeExports.jsx(Yl,{scope:t,triggerId:on(),triggerRef:l,contentId:on(),open:d,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(p=>!p),[u]),modal:c,children:o.jsxRuntimeExports.jsx(kl,{...m,open:d,onOpenChange:u,dir:r,modal:c,children:n})})};Yo.displayName=_t;var qo="DropdownMenuTrigger",Xo=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=Go(qo,n),a=Y(n);return o.jsxRuntimeExports.jsx(Dl,{asChild:!0,...a,children:o.jsxRuntimeExports.jsx(G.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:St(t,i.triggerRef),onPointerDown:z(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:z(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Xo.displayName=qo;var ql="DropdownMenuPortal",Qo=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Y(t);return o.jsxRuntimeExports.jsx(_l,{...r,...n})};Qo.displayName=ql;var Zo="DropdownMenuContent",Jo=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Go(Zo,n),i=Y(n),a=f.useRef(!1);return o.jsxRuntimeExports.jsx(Il,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,c=>{a.current||s.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:z(e.onInteractOutside,c=>{const m=c.detail.originalEvent,l=m.button===0&&m.ctrlKey===!0,d=m.button===2||l;(!s.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Jo.displayName=Zo;var Xl="DropdownMenuGroup",Ql=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ol,{...s,...r,ref:t})});Ql.displayName=Xl;var Zl="DropdownMenuLabel",es=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ll,{...s,...r,ref:t})});es.displayName=Zl;var Jl="DropdownMenuItem",ts=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Fl,{...s,...r,ref:t})});ts.displayName=Jl;var eu="DropdownMenuCheckboxItem",tu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(zl,{...s,...r,ref:t})});tu.displayName=eu;var nu="DropdownMenuRadioGroup",ru=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx($l,{...s,...r,ref:t})});ru.displayName=nu;var ou="DropdownMenuRadioItem",su=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Bl,{...s,...r,ref:t})});su.displayName=ou;var iu="DropdownMenuItemIndicator",au=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Vl,{...s,...r,ref:t})});au.displayName=iu;var cu="DropdownMenuSeparator",ns=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Hl,{...s,...r,ref:t})});ns.displayName=cu;var lu="DropdownMenuArrow",uu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Ul,{...s,...r,ref:t})});uu.displayName=lu;var du="DropdownMenuSubTrigger",fu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Wl,{...s,...r,ref:t})});fu.displayName=du;var mu="DropdownMenuSubContent",pu=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Y(n);return o.jsxRuntimeExports.jsx(Kl,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pu.displayName=mu;var xu=Yo,hu=Xo,vu=Qo,gu=Jo,yu=es,bu=ts,Eu=ns;function Qt({...e}){return o.jsxRuntimeExports.jsx(xu,{"data-slot":"dropdown-menu",...e})}function Zt({...e}){return o.jsxRuntimeExports.jsx(hu,{"data-slot":"dropdown-menu-trigger",...e})}function Jt({className:e,sideOffset:t=4,...n}){return o.jsxRuntimeExports.jsx(vu,{children:o.jsxRuntimeExports.jsx(gu,{"data-slot":"dropdown-menu-content",sideOffset:t,className:C.cn$1("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n})})}function ht({className:e,inset:t,variant:n="default",...r}){return o.jsxRuntimeExports.jsx(bu,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:C.cn$1("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function en({className:e,inset:t,...n}){return o.jsxRuntimeExports.jsx(yu,{"data-slot":"dropdown-menu-label","data-inset":t,className:C.cn$1("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",e),...n})}function tn({className:e,...t}){return o.jsxRuntimeExports.jsx(Eu,{"data-slot":"dropdown-menu-separator",className:C.cn$1("-mx-1 my-1 h-px bg-border",e),...t})}function rs({delayDuration:e=0,...t}){return o.jsxRuntimeExports.jsx(V.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function oe({...e}){return o.jsxRuntimeExports.jsx(rs,{children:o.jsxRuntimeExports.jsx(V.Root,{"data-slot":"tooltip",...e})})}function se({...e}){return o.jsxRuntimeExports.jsx(V.Trigger,{"data-slot":"tooltip-trigger",...e})}function ie({className:e,sideOffset:t=0,children:n,...r}){return o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{"data-slot":"tooltip-content",sideOffset:t,className:C.cn$1("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-primary px-3 py-1.5 text-primary-foreground text-xs data-[state=closed]:animate-out",e),...r,children:[n,o.jsxRuntimeExports.jsx(V.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-primary fill-primary"})]})})}function mr({className:e,defaultValue:t,value:n,min:r=0,max:s=100,...i}){const a=f.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,s],[n,t,r,s]);return o.jsxRuntimeExports.jsxs(te.Root,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:s,className:C.cn$1("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",e),...i,children:[o.jsxRuntimeExports.jsx(te.Track,{"data-slot":"slider-track",className:C.cn$1("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"),children:o.jsxRuntimeExports.jsx(te.Range,{"data-slot":"slider-range",className:C.cn$1("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(c,m)=>o.jsxRuntimeExports.jsx(te.Thumb,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-background shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"},m))]})}const pr=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M8 5.14v13.72c0 .45.54.67.85.35l8.56-8.86a.5.5 0 0 0 0-.7L8.85 4.79c-.31-.32-.85-.1-.85.35z"})}),xr=({className:e,...t})=>o.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:[o.jsxRuntimeExports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),o.jsxRuntimeExports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]}),wu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})}),ju=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"})}),Ru=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})}),Mu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})}),Cu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z"})}),Su=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsxs("g",{children:[o.jsxRuntimeExports.jsx("path",{d:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6v4l5-5-5-5v4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8h-2z"}),o.jsxRuntimeExports.jsx("path",{d:"M10.86 15v-2.5h-1.5V15h1.5zm2.49-2.62c.24-.23.39-.5.39-.81 0-.32-.15-.59-.39-.82s-.53-.35-.88-.35c-.34 0-.64.12-.87.35s-.35.51-.35.82v.23c0 .16.02.3.06.41l.99-.28c-.02-.08-.03-.19-.03-.34 0-.14.05-.25.14-.34.09-.08.21-.13.35-.13s.26.05.35.13c.09.09.14.2.14.34s-.05.25-.14.34l-1.08 1.08c-.07.07-.12.14-.17.22s-.08.16-.1.24-.04.18-.04.28v.21h1.85v-.66h-.92l.59-.59z"})]})}),Pu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsxs("g",{children:[o.jsxRuntimeExports.jsx("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}),o.jsxRuntimeExports.jsx("path",{d:"M10.89 16h-1.5v-2.5h-2v-1h3.5V16zm2.5-4.5V16h-1.5v-4.5h1.5z"})]})}),Nu=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z"})}),Au=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12.5v-7c0-.55.45-1 1-1s1 .45 1 1v7c0 .55-.45 1-1 1s-1-.45-1-1zM7 11h1.5v3.5h1v-3.5H11v-1H7v1zm8.5 4.5H17v-1h-1.5v-1H17v-1h-1.5v-1H17v-1h-2.5c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1z"})}),Tu=({className:e,...t})=>o.jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:[o.jsxRuntimeExports.jsx("path",{d:"M15.96 10.29l-2.75 3.08c-.31.34-.81.34-1.12 0-.31-.34-.31-.89 0-1.23l2.75-3.08c1.31-1.46 3.58-.21 3.58 1.75 0 .89-.36 1.79-1.07 2.5l-6.88 6.88c-.71.71-1.61 1.07-2.5 1.07-1.96 0-3.21-2.27-1.75-3.58l3.08-2.75c.34-.31.89-.31 1.23 0 .34.31.34.81 0 1.12l-3.08 2.75c-.35.39.07 1.04.58.79l6.88-6.88c.36-.36.52-.82.52-1.25 0-.51-.65-.93-1.04-.58z"}),o.jsxRuntimeExports.jsx("text",{x:"12",y:"10",fontSize:"8",textAnchor:"middle",fill:"currentColor",fontWeight:"bold",children:"1x"})]}),ku=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})}),Du=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:C.cn$1("size-6",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"})}),hr=({className:e,...t})=>o.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:C.cn$1("size-6 animate-spin",e),...t,children:o.jsxRuntimeExports.jsx("path",{d:"M12 2a10 10 0 1 0 10 10"})}),_u=E.lazy(()=>import("react-player"));function Iu({className:e,containerClassName:t,url:n,playing:r=!1,volume:s=1,muted:i=!1,controls:a=!1,light:c=!1,loop:m=!1,playbackRate:l=1,width:d="100%",height:u="100%",style:p,progressInterval:x=1e3,playsinline:y=!0,pip:h=!1,stopOnUnmount:v=!0,fallback:w=o.jsxRuntimeExports.jsx(hr,{className:"size-12 text-white"}),wrapper:j="div",config:b,showDownload:g=!1,showShare:R=!1,showSubtitles:P=!1,showQuality:M=!1,onDownload:S,onShare:F,qualityOptions:D=[{label:"1080p",value:"1080"},{label:"720p",value:"720"},{label:"480p",value:"480"},{label:"360p",value:"360"}],subtitleTracks:_=[],onReady:B,onStart:$,onPlay:T,onProgress:O,onDuration:k,onPause:I,onBuffer:N,onBufferEnd:A,onSeek:W,onPlaybackRateChange:J,onEnded:ve,onError:Ne,onClickPreview:Ae,onEnablePIP:Fe,onDisablePIP:ge,...H}){const[K,Te]=E.useState(r),[je,Ye]=E.useState(s),[ue,Re]=E.useState(i),[Nn,vs]=E.useState(0),[ke,gs]=E.useState(0),[ys,bs]=E.useState(0),[An,Tn]=E.useState(!1),[kn,It]=E.useState(h),[Dn,_n]=E.useState(l),[Es,Ot]=E.useState(!0),[ws,lt]=E.useState(!0),[js,Rs]=E.useState(D[0]?.value||"720"),[Hu,In]=E.useState(null),ze=E.useRef(null),Lt=E.useRef(null),qe=E.useRef(null),On=L=>{const ee=new Date(L*1e3),Ln=ee.getUTCHours(),Fn=ee.getUTCMinutes(),zn=ee.getUTCSeconds().toString().padStart(2,"0");return Ln?`${Ln}:${Fn.toString().padStart(2,"0")}:${zn}`:`${Fn}:${zn}`},Ms=()=>{Ot(!0),qe.current&&clearTimeout(qe.current),K&&(qe.current=setTimeout(()=>{Ot(!1)},3e3))};E.useEffect(()=>()=>{qe.current&&clearTimeout(qe.current)},[]);const Ft=()=>{document.fullscreenElement?(document.exitFullscreen(),Tn(!1)):(Lt.current?.requestFullscreen(),Tn(!0))};E.useEffect(()=>{const L=ee=>{if(Lt.current?.contains(document.activeElement))switch(ee.key.toLowerCase()){case" ":case"k":ee.preventDefault(),Te(!K);break;case"f":ee.preventDefault(),Ft();break;case"m":ee.preventDefault(),Re(!ue);break;case"arrowleft":ee.preventDefault(),ze.current?.seekTo(ke-10);break;case"arrowright":ee.preventDefault(),ze.current?.seekTo(ke+10);break;case"arrowup":ee.preventDefault(),Ye(Math.min(1,je+.1));break;case"arrowdown":ee.preventDefault(),Ye(Math.max(0,je-.1));break}};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[K,ue,ke,je,Ft]);const Cs=[.5,.75,1,1.25,1.5,2];return o.jsxRuntimeExports.jsx(rs,{children:o.jsxRuntimeExports.jsxs("div",{ref:Lt,className:C.cn("relative overflow-hidden rounded-lg bg-black","focus-within:outline-none",t),onMouseMove:Ms,onMouseLeave:()=>K&&Ot(!1),tabIndex:0,children:[o.jsxRuntimeExports.jsx(E.Suspense,{fallback:w,children:o.jsxRuntimeExports.jsx(_u,{ref:ze,url:n,playing:K,volume:ue?0:je,muted:ue,controls:!1,light:c,loop:m,playbackRate:Dn,width:d,height:u,style:{...p,aspectRatio:"16/9"},progressInterval:x,playsinline:y,pip:kn,stopOnUnmount:v,fallback:w,wrapper:j,config:b,className:C.cn("aspect-video",e),onReady:()=>{lt(!1),B?.()},onStart:()=>{lt(!1),$?.()},onPlay:()=>{Te(!0),T?.()},onPause:()=>{Te(!1),I?.()},onProgress:L=>{gs(L.playedSeconds),bs(L.loaded),O?.(L)},onDuration:L=>{vs(L),k?.(L)},onBuffer:()=>{lt(!0),N?.()},onBufferEnd:()=>{lt(!1),A?.()},onSeek:W,onPlaybackRateChange:L=>{_n(L),J?.(L)},onEnded:ve,onError:Ne,onClickPreview:Ae,onEnablePIP:()=>{It(!0),Fe?.()},onDisablePIP:()=>{It(!1),ge?.()},...H})}),ws&&o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:o.jsxRuntimeExports.jsx(hr,{className:"size-12 text-white"})}),o.jsxRuntimeExports.jsxs("div",{className:C.cn("absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-black/20","transition-opacity duration-300",Es?"opacity-100":"pointer-events-none opacity-0"),children:[o.jsxRuntimeExports.jsxs("div",{className:"absolute top-0 right-0 left-0 flex items-center justify-between p-4",children:[o.jsxRuntimeExports.jsx("h3",{className:"font-medium text-lg text-white",children:"Media Player"}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[R&&o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:F,children:o.jsxRuntimeExports.jsx(Du,{className:"size-5"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Share"})]}),g&&o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:S,children:o.jsxRuntimeExports.jsx(ku,{className:"size-5"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Download"})]})]})]}),o.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button size-20 rounded-none border-2 border-gray-600 bg-gray-800/90 text-white shadow-xl transition-all duration-200 hover:scale-105 hover:border-gray-500 hover:bg-gray-700/90 active:scale-95",onClick:()=>Te(!K),children:K?o.jsxRuntimeExports.jsx(xr,{className:"size-10"}):o.jsxRuntimeExports.jsx(pr,{className:"size-10"})})}),o.jsxRuntimeExports.jsxs("div",{className:"absolute right-0 bottom-0 left-0 space-y-2 p-4",children:[o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(mr,{value:[ke],max:Nn,step:1,onValueChange:([L])=>{typeof L=="number"&&ze.current?.seekTo(L)},className:"pixel-progress cursor-pointer [&>span]:rounded-none [&>span]:border [&>span]:border-gray-600 [&>span]:bg-gray-800 [&>span]:shadow-lg [&_[role=slider]]:size-4 [&_[role=slider]]:rounded-none [&_[role=slider]]:border-2 [&_[role=slider]]:border-gray-400 [&_[role=slider]]:bg-white [&_[role=slider]]:shadow-md"}),o.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute top-0 left-0 h-full rounded-none border border-gray-500/30 bg-white/20",style:{width:`${ys*100}%`}})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>Te(!K),children:K?o.jsxRuntimeExports.jsx(xr,{className:"size-6"}):o.jsxRuntimeExports.jsx(pr,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:K?"Pause (k)":"Play (k)"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>ze.current?.seekTo(ke-10),children:o.jsxRuntimeExports.jsx(Pu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Back 10s (←)"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>ze.current?.seekTo(ke+10),children:o.jsxRuntimeExports.jsx(Su,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Forward 10s (→)"})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>Re(!ue),children:ue||je===0?o.jsxRuntimeExports.jsx(ju,{className:"size-6"}):o.jsxRuntimeExports.jsx(wu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:ue?"Unmute (m)":"Mute (m)"})]}),o.jsxRuntimeExports.jsx(mr,{value:[ue?0:je],max:1,step:.05,onValueChange:([L])=>{typeof L=="number"&&(Ye(L),Re(L===0))},className:"pixel-progress w-20 cursor-pointer [&>span]:rounded-none [&>span]:border [&>span]:border-gray-600 [&>span]:bg-gray-800 [&>span]:shadow-lg [&_[role=slider]]:size-3 [&_[role=slider]]:rounded-none [&_[role=slider]]:border-2 [&_[role=slider]]:border-gray-400 [&_[role=slider]]:bg-white [&_[role=slider]]:shadow-md"})]}),o.jsxRuntimeExports.jsxs("span",{className:"pixel-time-display rounded-none border border-gray-600/50 bg-gray-900/80 px-2 py-1 font-mono text-sm text-white shadow-lg",children:[On(ke)," / ",On(Nn)]})]}),o.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[P&&_.length>0&&o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Nu,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Subtitles"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Subtitles"}),o.jsxRuntimeExports.jsx(tn,{}),o.jsxRuntimeExports.jsx(ht,{onClick:()=>In(null),children:"Off"}),_.map(L=>o.jsxRuntimeExports.jsx(ht,{onClick:()=>In(L.value),children:L.label},L.value))]})]}),M&&o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Au,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Quality"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Quality"}),o.jsxRuntimeExports.jsx(tn,{}),D.map(L=>o.jsxRuntimeExports.jsxs(ht,{onClick:()=>Rs(L.value),children:[L.label," ",js===L.value&&"✓"]},L.value))]})]}),o.jsxRuntimeExports.jsxs(Qt,{children:[o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(Zt,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",children:o.jsxRuntimeExports.jsx(Tu,{className:"size-6"})})})}),o.jsxRuntimeExports.jsx(ie,{children:"Playback Speed"})]}),o.jsxRuntimeExports.jsxs(Jt,{children:[o.jsxRuntimeExports.jsx(en,{children:"Speed"}),o.jsxRuntimeExports.jsx(tn,{}),Cs.map(L=>o.jsxRuntimeExports.jsxs(ht,{onClick:()=>_n(L),children:[L,"x ",Dn===L&&"✓"]},L))]})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:()=>It(!kn),children:o.jsxRuntimeExports.jsx(Cu,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:"Picture in Picture"})]}),o.jsxRuntimeExports.jsxs(oe,{children:[o.jsxRuntimeExports.jsx(se,{asChild:!0,children:o.jsxRuntimeExports.jsx(q,{variant:"ghost",size:"icon",className:"pixel-button rounded-none border border-gray-600/50 bg-gray-800/80 text-white shadow-lg transition-all duration-150 hover:border-gray-500 hover:bg-gray-700/80 active:scale-95",onClick:Ft,children:An?o.jsxRuntimeExports.jsx(Mu,{className:"size-6"}):o.jsxRuntimeExports.jsx(Ru,{className:"size-6"})})}),o.jsxRuntimeExports.jsx(ie,{children:An?"Exit Fullscreen (f)":"Fullscreen (f)"})]})]})]})]})]})]})})}function os({src:e,type:t="video/mp4"}){const n=E.useRef(null),r=E.useRef(null);return E.useEffect(()=>((async()=>{if(!n.current||r.current)return;const i=(await import("video.js")).default,a=i(n.current,{controls:!0,autoplay:!1,preload:"auto",fluid:!0,sources:[{src:e,type:t}]});r.current=a,a.ready(()=>{console.log("Player is ready!")})})(),()=>{r.current&&(r.current.dispose(),r.current=null)}),[e,t]),o.jsxRuntimeExports.jsx("div",{className:"w-full",children:o.jsxRuntimeExports.jsx("div",{"data-vjs-player":!0,children:o.jsxRuntimeExports.jsx("video",{ref:n,className:"video-js vjs-big-play-centered vjs-default-skin w-full",playsInline:!0})})})}os.displayName="SimpleVideoPlayer";const ss=E.memo(E.forwardRef(({isFullscreen:e,onToggle:t,disabled:n=!1,size:r="lg",className:s},i)=>{const a={md:"h-11 w-11",lg:"h-12 w-12",xl:"h-14 w-14"},c={md:20,lg:24,xl:28},m=E.useMemo(()=>({button:a[r]||a.lg,icon:c[r]||c.lg}),[r]),l=E.useMemo(()=>e?ni:ei,[e]),d=E.useMemo(()=>e?"Exit fullscreen":"Enter fullscreen",[e]),u=E.useMemo(()=>e?"Exit fullscreen":"Enter fullscreen",[e]);return o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("button",{ref:i,type:"button",onClick:t,disabled:n,className:C.cn("inline-flex items-center justify-center rounded-lg bg-transparent p-0 text-white transition-all hover:text-cyan-700 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20","disabled:cursor-not-allowed disabled:opacity-50",m.button,s),"aria-label":d,children:o.jsxRuntimeExports.jsx(l,{size:m.icon})})}),o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:5,children:[u,o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})})}));ss.displayName="FullscreenButton";const Ou=ss,vr={sm:{button:"size-8",icon:16},md:{button:"size-10",icon:20},lg:{button:"size-12",icon:24},xl:{button:"size-16",icon:32}},is=E.memo(E.forwardRef(({isPlaying:e,onToggle:t,disabled:n=!1,size:r="lg",className:s},i)=>{const a=E.useMemo(()=>vr[r]||vr.lg,[r]),c=E.useMemo(()=>e?"Pause media":"Play media",[e]);return o.jsxRuntimeExports.jsxs("button",{ref:i,type:"button",onClick:t,disabled:n,"data-state":e?"playing":"paused",className:C.cn("group relative inline-flex items-center justify-center","glass-strong media-control rounded-full contain-layout","focus-ring touch-manipulation",a.button,"text-[color:var(--media-text)] transition-all duration-300","bg-[color:var(--media-control-bg)] backdrop-blur-sm","border border-[color:var(--media-border)]/30","hover:bg-[color:var(--media-control-hover)]","hover:border-[color:var(--media-border)]/50","hover:shadow-[color:var(--media-bg)]/20 hover:shadow-lg","hover:-translate-y-0.5 hover:scale-105","active:bg-[color:var(--media-control-active)]","active:translate-y-0 active:scale-100","focus-visible:ring-2 focus-visible:ring-[color:var(--media-focus)]","focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--media-bg)]","disabled:cursor-not-allowed disabled:opacity-50","disabled:hover:translate-y-0 disabled:hover:scale-100","disabled:hover:bg-[color:var(--media-control-bg)]",s),"aria-label":c,"aria-pressed":e,children:[o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 rounded-full opacity-0 transition-opacity duration-300","bg-gradient-to-br from-[color:var(--color-media-play)] to-[color:var(--color-media-pause)]","blur-sm group-hover:opacity-20",e&&"opacity-10")}),e?o.jsxRuntimeExports.jsx(oi,{size:a.icon,className:C.cn("relative z-10 fill-current transition-all duration-200","text-[color:var(--color-media-pause)]","group-hover:scale-110 group-active:scale-95","drop-shadow-sm")}):o.jsxRuntimeExports.jsx(ii,{size:a.icon,className:C.cn("relative z-10 fill-current transition-all duration-200","ml-0.5 text-[color:var(--color-media-play)]","group-hover:scale-110 group-active:scale-95","drop-shadow-sm")}),o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute inset-0 rounded-full opacity-0","scale-75 bg-[color:var(--media-text)]/10","group-active:scale-100 group-active:opacity-100","transition-all duration-150 ease-out")})]})}));is.displayName="PlayButton";const Lu=is,as=E.memo(E.forwardRef(({currentTime:e,duration:t,buffered:n,onSeek:r,size:s="sm",className:i},a)=>{const[c,m]=E.useState(!1),[l,d]=E.useState(0),[u,p]=E.useState(!1);E.useDeferredValue(l);const x=E.useMemo(()=>({trackHeight:s==="sm"?"h-1":s==="md"?"h-1.5":"h-2",thumbSize:s==="sm"?"size-3":s==="md"?"size-4":"size-5",trackHoverHeight:"h-1.5"}),[s]),y=E.useMemo(()=>t>0?e/t*100:0,[e,t]),h=E.useMemo(()=>{const M=[];if(n&&t>0)for(let S=0;S<n.length;S++){const F=n.start(S)/t*100,D=n.end(S)/t*100;M.push({start:F,end:D})}return M},[n,t]),v=E.useCallback(([M])=>{const S=(M??0)/100*t;d(S),c&&r(S)},[t,c,r]),w=E.useCallback(([M])=>{const S=(M??0)/100*t;r(S),m(!1)},[t,r]),j=E.useCallback(()=>{m(!0)},[]),b=E.useCallback(()=>p(!0),[]),g=E.useCallback(()=>p(!1),[]),R=E.useMemo(()=>C.formatTime(e),[e]),P=E.useMemo(()=>C.formatTime(t),[t]);return o.jsxRuntimeExports.jsx("div",{ref:a,className:C.cn("media-container relative w-full text-[color:var(--media-text)]","touch-manipulation contain-layout",i),onMouseEnter:b,onMouseLeave:g,role:"group","aria-label":"Seek bar",children:o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("div",{className:"relative animate-enter",children:o.jsxRuntimeExports.jsxs(te.Root,{className:C.cn("group relative flex w-full touch-none select-none items-center","focus-ring cursor-pointer",x.trackHeight),value:[y],max:100,step:.1,onValueChange:v,onValueCommit:w,onPointerDown:j,"aria-label":"Seek to position","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(y),"aria-valuetext":`${R} of ${P}`,"aria-orientation":"horizontal",children:[o.jsxRuntimeExports.jsxs(te.Track,{className:C.cn("relative grow overflow-hidden rounded-full","bg-[color:var(--media-control-bg)]/40 backdrop-blur-sm","border border-[color:var(--media-border)]/20","shadow-inner transition-all duration-300 ease-out",x.trackHoverHeight,"group-hover:bg-[color:var(--media-control-bg)]/60","group-hover:border-[color:var(--media-border)]/40"),children:[h.map((M,S)=>o.jsxRuntimeExports.jsx("div",{className:C.cn("absolute h-full rounded-full transition-all duration-500","bg-[color:var(--color-media-buffered)] shadow-inner","opacity-60 group-hover:opacity-80"),style:{left:`${M.start}%`,width:`${M.end-M.start}%`}},S)),o.jsxRuntimeExports.jsx(te.Range,{className:C.cn("absolute h-full rounded-full transition-all duration-300","bg-gradient-to-r from-[color:var(--color-media-progress)] to-[color:var(--color-brand-accent)]","shadow-[color:var(--color-brand-primary)]/20 shadow-lg","group-hover:shadow-xl")})]}),o.jsxRuntimeExports.jsx(te.Thumb,{className:C.cn("block rounded-full border-white/20 bg-white","shadow-lg hover:shadow-xl",x.thumbSize,"opacity-0 group-hover:opacity-100","hover:scale-110 hover:bg-white/95 active:scale-95","focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-white/50","focus:ring-offset-2 focus:ring-offset-black/20","transition-all duration-300 ease-out",c&&"opacity-100"),"aria-label":"Seek slider","aria-valuetext":`${R} of ${P}`})]})})}),c&&o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:10,children:[C.formatTime(l),o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})})})}));as.displayName="SeekBar";const Fu=as,cs=E.memo(E.forwardRef(function({currentTime:t,duration:n,showRemaining:r=!1,size:s="sm",className:i},a){const c=E.useMemo(()=>C.formatTime(t),[t]),m=E.useMemo(()=>C.formatTime(n),[n]),l=E.useMemo(()=>C.formatTime(n-t),[n,t]),d={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},u=E.useMemo(()=>r?`-${l}`:m,[r,l,m]);return o.jsxRuntimeExports.jsxs("div",{ref:a,className:C.cn("flex items-center font-mono text-white text-xs","rounded-lg backdrop-blur-sm","px-3 py-1.5",d[s],"select-none",i),role:"timer","aria-label":`${r?"Time remaining":"Duration"}: ${u}`,"aria-live":"off",children:[o.jsxRuntimeExports.jsx("span",{className:"tabular-nums","aria-label":"Current time",children:c}),o.jsxRuntimeExports.jsx("span",{className:"mx-1 text-white","aria-hidden":"true",children:"/"}),o.jsxRuntimeExports.jsx("span",{className:"tabular-nums","aria-label":r?"Time remaining":"Total duration",children:u})]})}));cs.displayName="TimeDisplay";const zu=cs,ls=E.memo(E.forwardRef(function({volume:t,isMuted:n,onVolumeChange:r,onToggleMute:s,size:i="lg",className:a},c){const m=E.useMemo(()=>n||t===0?hi:t<.5?fi:pi,[n,t]),l=E.useMemo(()=>({md:"h-11 w-11",lg:"h-12 w-12",xl:"h-14 w-14"}),[]),d=E.useMemo(()=>({md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"}),[]),u=E.useMemo(()=>({md:"h-6",lg:"h-7",xl:"h-8"}),[]),p=E.useMemo(()=>({md:"h-4 w-4",lg:"h-4 w-4",xl:"h-5 w-5"}),[]),x=E.useMemo(()=>({md:"h-1.5",lg:"h-2",xl:"h-2.5"}),[]),y=E.useMemo(()=>[n?0:t],[n,t]),h=E.useMemo(()=>Math.round((n?0:t)*100),[n,t]),v=E.useCallback(()=>{s()},[s]),w=E.useCallback(([g])=>{r(g??0)},[r]),j=n?"Unmute":"Mute",b=j;return o.jsxRuntimeExports.jsxs("div",{ref:c,className:C.cn("flex items-center space-x-3 text-white",a),children:[o.jsxRuntimeExports.jsx(V.Provider,{children:o.jsxRuntimeExports.jsxs(V.Root,{children:[o.jsxRuntimeExports.jsx(V.Trigger,{asChild:!0,children:o.jsxRuntimeExports.jsx("button",{type:"button",onClick:v,className:C.cn("inline-flex items-center justify-center rounded-lg bg-transparent p-0 text-white transition-all hover:text-cyan-700 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20",l[i]),"aria-label":j,"aria-pressed":n,children:o.jsxRuntimeExports.jsx(m,{className:C.cn(d[i])})})}),o.jsxRuntimeExports.jsx(V.Portal,{children:o.jsxRuntimeExports.jsxs(V.Content,{className:C.cn("rounded bg-black/80 px-2 py-1 text-sm text-white","fade-in-0 zoom-in-95 animate-in"),sideOffset:5,children:[b,o.jsxRuntimeExports.jsx(V.Arrow,{className:"fill-black/80"})]})})]})}),o.jsxRuntimeExports.jsx("div",{className:"w-32",children:o.jsxRuntimeExports.jsxs(te.Root,{className:C.cn("group relative flex w-full touch-none select-none items-center",u[i]),value:y,max:1,step:.01,onValueChange:w,"aria-label":"Volume","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":t,"aria-valuetext":`${h} percent`,children:[o.jsxRuntimeExports.jsx(te.Track,{className:C.cn("relative grow rounded-full bg-white/20 shadow-inner transition-all duration-300 group-hover:bg-white/30","border border-white/10",x[i]),children:o.jsxRuntimeExports.jsx(te.Range,{className:"absolute h-full rounded-full bg-white shadow-sm"})}),o.jsxRuntimeExports.jsx(te.Thumb,{className:C.cn("block rounded-full border-2 border-white/20 bg-white shadow-lg","transition-all duration-300 ease-out hover:scale-110 hover:bg-white/95 active:scale-95","focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black/20",p[i]),"aria-label":"Volume"})]})}),o.jsxRuntimeExports.jsx("span",{className:"w-10 text-right text-sm text-white","aria-hidden":"true",children:h})]})}));ls.displayName="VolumeControl";const $u=ls,us=E.forwardRef((e,t)=>(C.showDeprecationWarning("ModernMediaPlayer","MediaPlayer (the primary media player component)"),o.jsxRuntimeExports.jsx(Iu,{...e,ref:t})));us.displayName="DeprecatedModernMediaPlayer";const ds=E.forwardRef((e,t)=>(C.showDeprecationWarning("SimpleVideoPlayer","VideoPlayer (the primary video player component)"),o.jsxRuntimeExports.jsx(os,{...e})));ds.displayName="DeprecatedSimpleVideoPlayer";const fs=E.forwardRef((e,t)=>(C.showDeprecationWarning("PlayButton","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Lu,{...e})));fs.displayName="DeprecatedPlayButton";const ms=E.forwardRef((e,t)=>(C.showDeprecationWarning("SeekBar","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Fu,{...e})));ms.displayName="DeprecatedSeekBar";const ps=E.forwardRef((e,t)=>(C.showDeprecationWarning("TimeDisplay","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(zu,{...e})));ps.displayName="DeprecatedTimeDisplay";const xs=E.forwardRef((e,t)=>(C.showDeprecationWarning("VolumeControl","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx($u,{...e})));xs.displayName="DeprecatedVolumeControl";const hs=E.forwardRef((e,t)=>(C.showDeprecationWarning("FullscreenButton","Use MediaPlayer compound components or MediaPlayer (all-in-one)"),o.jsxRuntimeExports.jsx(Ou,{...e})));hs.displayName="DeprecatedFullscreenButton";const Bu=({sources:e,enableIntelligentPreloading:t=!0,adaptToNetworkConditions:n=!0,priority:r="auto",strategy:s="adaptive"})=>{const i=E.useRef(null),a=E.useRef(null),c=E.useRef(new Map);function m(b){return!b.includes(window.location.origin)}function l(b){}function d(b){b.forEach(g=>{c.current.set(g,Date.now()),_e.preload(g,{as:"fetch",crossOrigin:"anonymous"})})}const u=E.useMemo(()=>{const b={dnsPrefetch:[],preconnect:[],preload:[],preinit:[]};return e.forEach(g=>{const P=new URL(g.src).origin;y(P)&&b.dnsPrefetch.push(P),h(g.type||"",s)&&b.preconnect.push(P),v(g,r,s)&&b.preload.push({url:g.src,type:j(g.type||"")}),w(g,s)&&b.preinit.push({url:g.src,type:"script"})}),b},[e,r,s]),[p,x]=E.useState(u);E.useEffect(()=>{const b={...u};b.preload=u.preload.filter(({url:g})=>{const R=e.find(M=>M.src===g);if(!R)return!1;const P=c.current.get(R.src);if(P&&Date.now()-P<3e5)return!1;if(s==="conservative")return r==="high"&&R.type==="hls";if(s==="aggressive")return!0;if(i.current){const{effectiveType:M,saveData:S}=i.current;if(S)return!1;if(M==="slow-2g"||M==="2g")return r==="high"&&R.type==="hls";if(M==="3g")return["hls","m3u8"].includes(R.type||"")}return r!=="low"}),x(b)},[u,e,r,s]),E.useEffect(()=>{if(n&&"connection"in navigator){i.current=navigator.connection;const b=()=>{};return i.current.addEventListener("change",b),()=>{i.current?.removeEventListener("change",b)}}},[n]),E.useEffect(()=>{if(t)return a.current=new Vu,a.current.startTracking(),()=>{a.current?.stopTracking()}},[t]),E.useEffect(()=>{p.dnsPrefetch.forEach(b=>{_e.prefetchDNS(b)})},[p.dnsPrefetch]),E.useEffect(()=>{p.preconnect.forEach(b=>{_e.preconnect(b,{crossOrigin:"anonymous"})})},[p.preconnect]),E.useEffect(()=>{p.preload.forEach(({url:b,type:g})=>{const R=m(b)?"anonymous":void 0;_e.preload(b,{as:g,crossOrigin:R,integrity:void 0})})},[p.preload,r]),E.useEffect(()=>{p.preinit.forEach(({url:b,type:g})=>{const R=m(b)?"anonymous":void 0;_e.preinit(b,{as:g,crossOrigin:R})})},[p.preinit]),E.useEffect(()=>{if(!t||!a.current)return;const b=g=>{g.isLikelyToInteract&&d(g.predictedSources)};a.current.onBehaviorChange(b)},[t]);function y(b){return["cdn.jsdelivr.net","cdnjs.cloudflare.com","unpkg.com","cloudflare.com","fastly.net","akamaized.net"].some(R=>b.includes(R))}function h(b,g){return g==="aggressive"?!0:g==="conservative"?["hls","m3u8"].includes(b):["hls","m3u8","mp4"].includes(b)}function v(b,g,R){return R==="conservative"?g==="high"&&b.type==="hls":R==="aggressive"?!0:g!=="low"}function w(b,g){return g==="aggressive"&&b.type==="hls"}function j(b){switch(b){case"hls":case"m3u8":return"fetch";case"mp4":case"webm":return"video";case"mp3":case"wav":return"audio";default:return"fetch"}}return null};class Vu{constructor(){de(this,"behaviorData",{isLikelyToInteract:!1,engagementScore:0,predictedSources:[],interactionHistory:[]});de(this,"listeners",[]);de(this,"mouseMoveTimer",null);de(this,"handleMouseMove",()=>{this.mouseMoveTimer||(this.mouseMoveTimer=window.setTimeout(()=>{this.updateEngagementScore(.1),this.mouseMoveTimer=null},100))});de(this,"handleScroll",()=>{this.updateEngagementScore(.2)});de(this,"handleKeydown",()=>{this.updateEngagementScore(.3),this.behaviorData.isLikelyToInteract=!0});de(this,"handleFocus",()=>{this.updateEngagementScore(.4),this.behaviorData.isLikelyToInteract=!0});de(this,"handleVisibilityChange",()=>{document.hidden||(this.updateEngagementScore(.5),this.behaviorData.isLikelyToInteract=!0)})}startTracking(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("scroll",this.handleScroll),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("focusin",this.handleFocus),document.addEventListener("visibilitychange",this.handleVisibilityChange)}stopTracking(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("focusin",this.handleFocus),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.mouseMoveTimer&&clearTimeout(this.mouseMoveTimer)}onBehaviorChange(t){this.listeners.push(t)}getCurrentBehavior(){return this.behaviorData}updateEngagementScore(t){this.behaviorData.engagementScore=Math.min(1,this.behaviorData.engagementScore+t),setTimeout(()=>{this.behaviorData.engagementScore=Math.max(0,this.behaviorData.engagementScore-t*.5),this.notifyListeners()},3e4),this.notifyListeners()}notifyListeners(){this.listeners.forEach(t=>t(this.behaviorData))}}exports.MediaProvider=o.MediaProvider;exports.createEnhancedMediaStore=o.createEnhancedMediaStore;exports.useMediaContext=o.useMediaContext;exports.useMediaDispatch=o.useMediaDispatch;exports.useMediaSelector=o.useMediaSelector;exports.useOptimisticMediaSelector=o.useOptimisticMediaSelector;exports.useEnhancedMediaPlayer=U.useEnhancedMediaPlayer;exports.useEnhancedSubtitles=U.useEnhancedSubtitles$1;exports.useIntelligentPreloading=U.useIntelligentPreloading;exports.useKeyboardControls=U.useKeyboardControls;exports.useMediaActionState=U.useMediaActionState;exports.useMediaActions=U.useMediaActions;exports.useMediaControls=U.useMediaControls;exports.useMediaPlayer=U.useMediaPlayer;exports.useMediaState=U.useMediaState;exports.useScreenshot=U.useScreenshot;exports.useSubtitles=U.useSubtitles;exports.useTouchGestures=U.useTouchGestures;exports.useVideoPlayer=U.useVideoPlayer$1;exports.cn=C.cn;exports.formatTime=C.formatTime;exports.parseTime=C.parseTime;exports.MediaPlayerRoot=we.MediaPlayerRoot;exports.MinimalFullscreenIcon=we.MinimalFullscreenIcon;exports.MinimalMediaPlayer=we.MinimalMediaPlayer;exports.MinimalPauseIcon=we.MinimalPauseIcon;exports.MinimalPlayIcon=we.MinimalPlayIcon;exports.MinimalVolumeIcon=we.MinimalVolumeIcon;exports.SimpleMinimalPlayer=we.SimpleMinimalPlayer;exports.defaultMinimalIcons=we.defaultMinimalIcons;exports.ChaptersPanel=re.ChaptersPanel;exports.DebugPanel=re.DebugPanel;exports.EnhancedControlBar=re.EnhancedControlBar;exports.EnhancedMediaPlayer=re.EnhancedMediaPlayer;exports.EnhancedPlayButton=re.EnhancedPlayButton;exports.EnhancedSeekBar=re.EnhancedSeekBar;exports.EnhancedTimeDisplay=re.EnhancedTimeDisplay;exports.EnhancedVolumeControl=re.EnhancedVolumeControl;exports.PictureInPictureButton=re.PictureInPictureButton;exports.PlaybackSpeedSelector=re.PlaybackSpeedSelector;exports.QualitySelector=re.QualitySelector;exports.SubtitleSelector=re.SubtitleSelector;exports.PerformanceMonitor=Os.PerformanceMonitor;exports.AUDIO_MIME_TYPES=rn;exports.AudioPlayer=Rr;exports.ConcurrentMedia=Er;exports.FullscreenButton=hs;exports.MediaErrorBoundary=br;exports.MediaLoading=Qe;exports.MediaPlayer=wr;exports.MediaPlayerHLS=Pr;exports.MediaResourcePreloader=Bu;exports.MediaSuspense=yr;exports.ModernMediaPlayer=us;exports.PlayButton=fs;exports.SUPPORTED_AUDIO_FORMATS=Ar;exports.SUPPORTED_VIDEO_FORMATS=Nr;exports.SeekBar=ms;exports.SimpleVideoPlayer=ds;exports.TimeDisplay=ps;exports.VIDEO_MIME_TYPES=nn;exports.VideoPlayer=jr;exports.VolumeControl=xs;exports.getMediaTypeFromUrl=gi;exports.getMimeTypeFromUrl=yi;exports.useDeferredMediaLoading=Fs;
112
112
  //# sourceMappingURL=index.js.map