strataplayer 1.2.0 → 1.2.1

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.
@@ -1,222 +1,222 @@
1
- "use strict";var Lt=Object.defineProperty;var $t=(o,t,s)=>t in o?Lt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[t]=s;var w=(o,t,s)=>$t(o,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),Et=require("react-dom/client"),e=require("react/jsx-runtime");class Pt{constructor(){w(this,"events");this.events=new Map}on(t,s){var r;return this.events.has(t)||this.events.set(t,[]),(r=this.events.get(t))==null||r.push(s),()=>this.off(t,s)}off(t,s){const r=this.events.get(t);r&&this.events.set(t,r.filter(n=>n!==s))}emit(t,s){const r=this.events.get(t);r&&r.forEach(n=>n(s))}destroy(){this.events.clear()}}class At{constructor(t){w(this,"state");w(this,"listeners");this.state=t,this.listeners=new Set}get(){return this.state}setState(t){const s=this.state,r=typeof t=="function"?t(s):t;this.state={...s,...r},this.listeners.forEach(n=>n(this.state,s))}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}destroy(){this.listeners.clear()}}class Ft{constructor(t){w(this,"context",null);w(this,"source",null);w(this,"gainNode",null);w(this,"video");w(this,"isInitialized",!1);this.video=t}init(){if(!(this.isInitialized||!(window.AudioContext||window.webkitAudioContext))){this.context=new AudioContext,this.gainNode=this.context.createGain();try{this.source=this.context.createMediaElementSource(this.video),this.source.connect(this.gainNode),this.gainNode.connect(this.context.destination),this.isInitialized=!0}catch(s){console.warn("StrataPlayer: Failed to initialize AudioEngine",s)}}}setGain(t){this.isInitialized||this.init(),this.gainNode&&this.context&&(this.gainNode.gain.value=t,this.context.state==="suspended"&&this.context.resume())}destroy(){this.context&&this.context.close(),this.isInitialized=!1}}const be={useNative:!1,fixCapitalization:!1,backgroundOpacity:50,backgroundBlur:!1,backgroundBlurAmount:4,textSize:100,textStyle:"shadow",isBold:!1,textColor:"#ffffff",verticalOffset:40},at="strata-settings-v3",E={isPlaying:!1,isBuffering:!1,isLive:!1,currentTime:0,duration:0,buffered:[],volume:1,isMuted:!1,audioGain:1,playbackRate:1,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,error:null,isFullscreen:!1,isPip:!1,subtitleTracks:[],currentSubtitle:-1,subtitleOffset:0,subtitleSettings:be,activeCues:[],viewMode:"normal",notifications:[],iconSize:"medium",themeColor:"#6366f1",theme:"default",sources:[],currentSourceIndex:-1,isLocked:!1,flipState:{horizontal:!1,vertical:!1},aspectRatio:"default",isAutoSized:!1,isLooping:!1,controlsVisible:!0},ot=(o={})=>{let t={};if(!o.disablePersistence&&typeof window<"u")try{const r=localStorage.getItem(at);r&&(t=JSON.parse(r))}catch{}const s={...be,...t.subtitleSettings||{},...o.subtitleSettings||{}};return{...E,...t,volume:o.volume??t.volume??E.volume,isMuted:o.muted??t.isMuted??E.isMuted,playbackRate:o.playbackRate??t.playbackRate??E.playbackRate,audioGain:o.audioGain??t.audioGain??E.audioGain,theme:o.theme??t.theme??E.theme,themeColor:o.themeColor??t.themeColor??E.themeColor,iconSize:o.iconSize??t.iconSize??E.iconSize,subtitleSettings:s,isAutoSized:o.autoSize??E.isAutoSized,isLive:o.isLive??t.isLive??E.isLive,isLooping:o.loop??t.isLooping??E.isLooping}};class lt{constructor(t={},s){w(this,"video");w(this,"container",null);w(this,"events");w(this,"store");w(this,"plugins",new Map);w(this,"audioEngine");w(this,"config");w(this,"resizeObserver",null);w(this,"retryCount",0);w(this,"maxRetries",5);w(this,"retryTimer",null);w(this,"currentSource",null);w(this,"currentSrc","");w(this,"currentTracks",[]);w(this,"castInitialized",!1);w(this,"boundCueChange");w(this,"boundFullscreenChange");this.config=t,this.video=s||document.createElement("video"),this.video.crossOrigin="anonymous",t.playsInline!==!1&&(this.video.playsInline=!0),this.events=new Pt;const r=ot(t);this.store=new At(r),this.audioEngine=new Ft(this.video),this.boundCueChange=this.handleCueChange.bind(this),this.boundFullscreenChange=()=>{const n=!!document.fullscreenElement;if(this.store.setState({isFullscreen:n}),this.emit("resize"),this.emit(n?"fullscreen":"fullscreen_exit"),n&&this.config.autoOrientation&&screen.orientation&&"lock"in screen.orientation){const m=this.video.videoWidth>this.video.videoHeight?"landscape":"portrait";try{screen.orientation.lock(m).catch(()=>{})}catch{}}else!n&&screen.orientation&&"unlock"in screen.orientation&&screen.orientation.unlock()},this.video.volume=r.volume,this.video.muted=r.isMuted,this.video.playbackRate=r.playbackRate,this.video.loop=r.isLooping,r.audioGain>1&&this.audioEngine.setGain(r.audioGain),r.isAutoSized&&(this.video.style.objectFit="cover"),this.initVideoListeners(),this.initCast(),t.disablePersistence||this.store.subscribe(n=>{const d={volume:n.volume,isMuted:n.isMuted,playbackRate:n.playbackRate,subtitleSettings:n.subtitleSettings,iconSize:n.iconSize,themeColor:n.themeColor,theme:n.theme,isLive:n.isLive,isLooping:n.isLooping};localStorage.setItem(at,JSON.stringify(d))})}get playing(){return!this.video.paused&&!this.video.ended&&this.video.readyState>2}get currentTime(){return this.video.currentTime}set currentTime(t){this.seek(t)}get duration(){return this.video.duration||0}get paused(){return this.video.paused}get volume(){return this.video.volume}set volume(t){this.setVolume(t)}get muted(){return this.video.muted}set muted(t){this.video.muted=t,this.store.setState({isMuted:t})}get playbackRate(){return this.video.playbackRate}set playbackRate(t){this.video.playbackRate=t}get loop(){return this.video.loop}set loop(t){this.video.loop=t,this.store.setState({isLooping:t})}forward(t=10){this.skip(t)}backward(t=10){this.skip(-t)}on(t,s){return this.events.on(t,s)}off(t,s){return this.events.off(t,s)}emit(t,s){return this.events.emit(t,s)}initVideoListeners(){const t=r=>this.store.setState(r);["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"].forEach(r=>{this.video.addEventListener(r,n=>{switch(this.emit(`video:${r}`,n),r==="play"&&this.emit("play"),r==="pause"&&this.emit("pause"),r==="ended"&&this.emit("ended"),r==="error"&&this.emit("error",this.video.error),r==="seeked"&&this.emit("seek"),r){case"play":t({isPlaying:!0});break;case"pause":t({isPlaying:!1});break;case"ended":t({isPlaying:!1});break;case"waiting":t({isBuffering:!0}),this.emit("loading",!0);break;case"playing":t({isBuffering:!1}),this.emit("loading",!1);break;case"canplay":t({isBuffering:!1}),this.emit("loading",!1);break;case"loadeddata":t({isBuffering:!1}),this.retryCount=0,this.removeNotification("retry"),this.store.get().error&&t({error:null});break;case"timeupdate":this.video.seeking||t({currentTime:this.video.currentTime});break;case"seeked":t({currentTime:this.video.currentTime});break;case"durationchange":t({duration:this.video.duration});break;case"volumechange":t({volume:this.video.volume,isMuted:this.video.muted});break;case"ratechange":t({playbackRate:this.video.playbackRate});break;case"error":this.handleError();break;case"progress":this.updateBuffer();break;case"enterpictureinpicture":t({isPip:!0});break;case"leavepictureinpicture":t({isPip:!1});break}})}),this.video.addEventListener("enterpictureinpicture",()=>{t({isPip:!0}),this.emit("pip",!0)}),this.video.addEventListener("leavepictureinpicture",()=>{t({isPip:!1}),this.emit("pip",!1)}),document.addEventListener("fullscreenchange",this.boundFullscreenChange),this.video.textTracks.addEventListener("addtrack",this.updateSubtitles.bind(this)),this.video.textTracks.addEventListener("removetrack",this.updateSubtitles.bind(this))}triggerError(t,s=!1){s?this.handleError(t):this.notify({type:"warning",message:`Warning: ${t}`,duration:5e3})}handleError(t){const s=this.video.error,r=t||(s==null?void 0:s.message)||(s?`Code ${s.code}`:"Unknown Error");if(this.removeNotification("retry"),this.emit("video:error",s),this.retryCount<this.maxRetries){this.retryCount++;const n=Math.pow(2,this.retryCount-1)*1500;this.notify({id:"retry",type:"loading",message:`Error: ${r}. Retrying (${this.retryCount}/${this.maxRetries})...`}),console.warn(`[StrataPlayer] Error: ${r}. Retrying in ${n}ms...`),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{if(this.currentSource){this.load(this.currentSource,this.currentTracks,!0);const d=this.store.get().currentTime;if(d>0){const m=()=>{this.video.currentTime=d,this.video.removeEventListener("canplay",m)};this.video.addEventListener("canplay",m)}}},n)}else{this.removeNotification("retry");const n=`Failed to play after ${this.maxRetries} attempts: ${r}`;this.store.setState({error:n}),this.emit("error",n)}}updateBuffer(){const t=[];for(let s=0;s<this.video.buffered.length;s++)t.push({start:this.video.buffered.start(s),end:this.video.buffered.end(s)});this.store.setState({buffered:t})}updateSubtitles(){setTimeout(()=>{const t=Array.from(this.video.textTracks).filter(r=>r.kind==="subtitles"||r.kind==="captions").map((r,n)=>({label:r.label||r.language||`Track ${n+1}`,language:r.language,index:n}));this.store.setState({subtitleTracks:t});const s=this.store.get();s.currentSubtitle!==-1&&t.length>0&&s.currentSubtitle<t.length&&this.setSubtitle(s.currentSubtitle)},50)}async fetchWithRetry(t,s=3){for(let r=0;r<s;r++)try{const n=await fetch(t);if(!n.ok)throw new Error(`HTTP ${n.status}`);return n}catch(n){if(r===s-1)throw n;await new Promise(d=>setTimeout(d,1e3*Math.pow(2,r)))}throw new Error("Fetch failed")}attach(t){this.container=t,this.container.contains(this.video)||(this.video.style.width="100%",this.video.style.height="100%",this.video.style.objectFit=this.store.get().isAutoSized?"cover":"contain",this.video.style.backgroundColor="black",this.container.appendChild(this.video)),this.resizeObserver=new ResizeObserver(s=>{for(const r of s)this.emit("resize",{width:r.contentRect.width,height:r.contentRect.height})}),this.resizeObserver.observe(this.container),this.emit("ready")}use(t){this.plugins.has(t.name)||(t.init(this),this.plugins.set(t.name,t))}setSources(t,s=[]){this.store.setState({sources:t}),this.currentTracks=s,t.length>0&&this.load(t[0],s)}switchSource(t){const s=this.store.get().sources;if(t>=0&&t<s.length){const r=this.video.currentTime,n=!this.video.paused;this.load(s[t],this.currentTracks);const d=()=>{this.video.currentTime=r,n&&this.video.play(),this.video.removeEventListener("canplay",d)};this.video.addEventListener("canplay",d)}}load(t,s=[],r=!1){this.retryTimer&&clearTimeout(this.retryTimer);const n=typeof t=="string"?{url:t,type:"auto"}:t;r||(this.retryCount=0,this.store.setState({error:null}),this.removeNotification("retry")),this.currentSrc=n.url,this.currentSource=n,this.currentTracks=s;const m=this.store.get().sources.findIndex(l=>l.url===n.url);this.store.setState({isBuffering:!0,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,currentSourceIndex:m});let x=n.type||"auto";x==="auto"&&(n.url.includes(".m3u8")?x="hls":n.url.includes(".mpd")?x="dash":n.url.includes(".flv")||n.url.includes(".ts")?x="mpegts":n.url.startsWith("magnet:")||n.url.includes(".torrent")?x="webtorrent":x="mp4"),this.events.emit("load",{url:n.url,type:x});const y=this.video.getElementsByTagName("track");for(;y.length>0;)y[0].remove();s.length>0&&s.forEach(l=>{this.fetchWithRetry(l.src).then(()=>{this.addTextTrackInternal(l.src,l.label,l.srcLang,l.default)}).catch(b=>{this.notify({type:"warning",message:`Failed to load subtitle: ${l.label}`,duration:4e3})})}),(x==="mp4"||x==="webm"||x==="ogg")&&(this.video.src=n.url)}loadSubtitle(t,s="Subtitle"){this.addTextTrackInternal(t,s,void 0,!0)}addTextTrack(t,s){const r=new FileReader;r.onload=n=>{var y;if(!((y=n.target)!=null&&y.result))return;let d=n.target.result;(t.name.toLowerCase().endsWith(".srt")||!d.trim().startsWith("WEBVTT"))&&(d=d.replace(/(\d{2}:\d{2}:\d{2}),(\d{3})/g,"$1.$2"),d.trim().startsWith("WEBVTT")||(d=`WEBVTT
1
+ "use strict";var $t=Object.defineProperty;var Et=(o,t,s)=>t in o?$t(o,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[t]=s;var w=(o,t,s)=>Et(o,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),Pt=require("react-dom/client"),e=require("react/jsx-runtime");class At{constructor(){w(this,"events");this.events=new Map}on(t,s){var r;return this.events.has(t)||this.events.set(t,[]),(r=this.events.get(t))==null||r.push(s),()=>this.off(t,s)}off(t,s){const r=this.events.get(t);r&&this.events.set(t,r.filter(n=>n!==s))}emit(t,s){const r=this.events.get(t);r&&r.forEach(n=>n(s))}destroy(){this.events.clear()}}class Ft{constructor(t){w(this,"state");w(this,"listeners");this.state=t,this.listeners=new Set}get(){return this.state}setState(t){const s=this.state,r=typeof t=="function"?t(s):t;this.state={...s,...r},this.listeners.forEach(n=>n(this.state,s))}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}destroy(){this.listeners.clear()}}class Bt{constructor(t){w(this,"context",null);w(this,"source",null);w(this,"gainNode",null);w(this,"video");w(this,"isInitialized",!1);this.video=t}init(){if(!(this.isInitialized||!(window.AudioContext||window.webkitAudioContext))){this.context=new AudioContext,this.gainNode=this.context.createGain();try{this.source=this.context.createMediaElementSource(this.video),this.source.connect(this.gainNode),this.gainNode.connect(this.context.destination),this.isInitialized=!0}catch(s){console.warn("StrataPlayer: Failed to initialize AudioEngine",s)}}}setGain(t){this.isInitialized||this.init(),this.gainNode&&this.context&&(this.gainNode.gain.value=t,this.context.state==="suspended"&&this.context.resume())}destroy(){this.context&&this.context.close(),this.isInitialized=!1}}const be={useNative:!1,fixCapitalization:!1,backgroundOpacity:50,backgroundBlur:!1,backgroundBlurAmount:4,textSize:100,textStyle:"shadow",isBold:!1,textColor:"#ffffff",verticalOffset:40},ot="strata-settings-v3",$={isPlaying:!1,isBuffering:!1,isLive:!1,currentTime:0,duration:0,buffered:[],volume:1,isMuted:!1,audioGain:1,playbackRate:1,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,error:null,isFullscreen:!1,isPip:!1,subtitleTracks:[],currentSubtitle:-1,subtitleOffset:0,subtitleSettings:be,activeCues:[],viewMode:"normal",notifications:[],iconSize:"medium",themeColor:"#6366f1",theme:"default",sources:[],currentSourceIndex:-1,isLocked:!1,flipState:{horizontal:!1,vertical:!1},aspectRatio:"default",isAutoSized:!1,isLooping:!1,controlsVisible:!0},lt=(o={})=>{let t={};if(!o.disablePersistence&&typeof window<"u")try{const r=localStorage.getItem(ot);r&&(t=JSON.parse(r))}catch{}const s={...be,...t.subtitleSettings||{},...o.subtitleSettings||{}};return{...$,...t,volume:o.volume??t.volume??$.volume,isMuted:o.muted??t.isMuted??$.isMuted,playbackRate:o.playbackRate??t.playbackRate??$.playbackRate,audioGain:o.audioGain??t.audioGain??$.audioGain,theme:o.theme??t.theme??$.theme,themeColor:o.themeColor??t.themeColor??$.themeColor,iconSize:o.iconSize??t.iconSize??$.iconSize,subtitleSettings:s,isAutoSized:o.autoSize??$.isAutoSized,isLive:o.isLive??t.isLive??$.isLive,isLooping:o.loop??t.isLooping??$.isLooping}};class ct{constructor(t={},s){w(this,"video");w(this,"container",null);w(this,"events");w(this,"store");w(this,"plugins",new Map);w(this,"audioEngine");w(this,"config");w(this,"resizeObserver",null);w(this,"retryCount",0);w(this,"maxRetries",5);w(this,"retryTimer",null);w(this,"currentSource",null);w(this,"currentSrc","");w(this,"currentTracks",[]);w(this,"castInitialized",!1);w(this,"boundCueChange");w(this,"boundFullscreenChange");this.config=t,this.video=s||document.createElement("video"),this.video.crossOrigin="anonymous",t.playsInline!==!1&&(this.video.playsInline=!0),this.events=new At;const r=lt(t);this.store=new Ft(r),this.audioEngine=new Bt(this.video),this.boundCueChange=this.handleCueChange.bind(this),this.boundFullscreenChange=()=>{const n=!!document.fullscreenElement;if(this.store.setState({isFullscreen:n}),this.emit("resize"),this.emit(n?"fullscreen":"fullscreen_exit"),n&&this.config.autoOrientation&&screen.orientation&&"lock"in screen.orientation){const m=this.video.videoWidth>this.video.videoHeight?"landscape":"portrait";try{screen.orientation.lock(m).catch(()=>{})}catch{}}else!n&&screen.orientation&&"unlock"in screen.orientation&&screen.orientation.unlock()},this.video.volume=r.volume,this.video.muted=r.isMuted,this.video.playbackRate=r.playbackRate,this.video.loop=r.isLooping,r.audioGain>1&&this.audioEngine.setGain(r.audioGain),r.isAutoSized&&(this.video.style.objectFit="cover"),this.initVideoListeners(),this.initCast(),t.disablePersistence||this.store.subscribe(n=>{const c={volume:n.volume,isMuted:n.isMuted,playbackRate:n.playbackRate,subtitleSettings:n.subtitleSettings,iconSize:n.iconSize,themeColor:n.themeColor,theme:n.theme,isLive:n.isLive,isLooping:n.isLooping};localStorage.setItem(ot,JSON.stringify(c))})}get playing(){return!this.video.paused&&!this.video.ended&&this.video.readyState>2}get currentTime(){return this.video.currentTime}set currentTime(t){this.seek(t)}get duration(){return this.video.duration||0}get paused(){return this.video.paused}get volume(){return this.video.volume}set volume(t){this.setVolume(t)}get muted(){return this.video.muted}set muted(t){this.video.muted=t,this.store.setState({isMuted:t})}get playbackRate(){return this.video.playbackRate}set playbackRate(t){this.video.playbackRate=t}get loop(){return this.video.loop}set loop(t){this.video.loop=t,this.store.setState({isLooping:t})}forward(t=10){this.skip(t)}backward(t=10){this.skip(-t)}on(t,s){return this.events.on(t,s)}off(t,s){return this.events.off(t,s)}emit(t,s){return this.events.emit(t,s)}initVideoListeners(){const t=r=>this.store.setState(r);["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"].forEach(r=>{this.video.addEventListener(r,n=>{switch(this.emit(`video:${r}`,n),r==="play"&&this.emit("play"),r==="pause"&&this.emit("pause"),r==="ended"&&this.emit("ended"),r==="error"&&this.emit("error",this.video.error),r==="seeked"&&this.emit("seek"),r){case"play":t({isPlaying:!0});break;case"pause":t({isPlaying:!1});break;case"ended":t({isPlaying:!1});break;case"waiting":t({isBuffering:!0}),this.emit("loading",!0);break;case"playing":t({isBuffering:!1}),this.emit("loading",!1);break;case"canplay":t({isBuffering:!1}),this.emit("loading",!1);break;case"loadeddata":t({isBuffering:!1}),this.retryCount=0,this.removeNotification("retry"),this.store.get().error&&t({error:null});break;case"timeupdate":this.video.seeking||t({currentTime:this.video.currentTime});break;case"seeked":t({currentTime:this.video.currentTime});break;case"durationchange":t({duration:this.video.duration});break;case"volumechange":t({volume:this.video.volume,isMuted:this.video.muted});break;case"ratechange":t({playbackRate:this.video.playbackRate});break;case"error":this.handleError();break;case"progress":this.updateBuffer();break;case"enterpictureinpicture":t({isPip:!0});break;case"leavepictureinpicture":t({isPip:!1});break}})}),this.video.addEventListener("enterpictureinpicture",()=>{t({isPip:!0}),this.emit("pip",!0)}),this.video.addEventListener("leavepictureinpicture",()=>{t({isPip:!1}),this.emit("pip",!1)}),document.addEventListener("fullscreenchange",this.boundFullscreenChange),this.video.textTracks.addEventListener("addtrack",this.updateSubtitles.bind(this)),this.video.textTracks.addEventListener("removetrack",this.updateSubtitles.bind(this))}triggerError(t,s=!1){s?this.handleError(t):this.notify({type:"warning",message:`Warning: ${t}`,duration:5e3})}handleError(t){const s=this.video.error,r=t||(s==null?void 0:s.message)||(s?`Code ${s.code}`:"Unknown Error");if(this.removeNotification("retry"),this.emit("video:error",s),this.retryCount<this.maxRetries){this.retryCount++;const n=Math.pow(2,this.retryCount-1)*1500;this.notify({id:"retry",type:"loading",message:`Error: ${r}. Retrying (${this.retryCount}/${this.maxRetries})...`}),console.warn(`[StrataPlayer] Error: ${r}. Retrying in ${n}ms...`),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{if(this.currentSource){this.load(this.currentSource,this.currentTracks,!0);const c=this.store.get().currentTime;if(c>0){const m=()=>{this.video.currentTime=c,this.video.removeEventListener("canplay",m)};this.video.addEventListener("canplay",m)}}},n)}else{this.removeNotification("retry");const n=`Failed to play after ${this.maxRetries} attempts: ${r}`;this.store.setState({error:n}),this.emit("error",n)}}updateBuffer(){const t=[];for(let s=0;s<this.video.buffered.length;s++)t.push({start:this.video.buffered.start(s),end:this.video.buffered.end(s)});this.store.setState({buffered:t})}updateSubtitles(){setTimeout(()=>{const t=Array.from(this.video.textTracks).filter(r=>r.kind==="subtitles"||r.kind==="captions").map((r,n)=>({label:r.label||r.language||`Track ${n+1}`,language:r.language,index:n}));this.store.setState({subtitleTracks:t});const s=this.store.get();s.currentSubtitle!==-1&&t.length>0&&s.currentSubtitle<t.length&&this.setSubtitle(s.currentSubtitle)},50)}async fetchWithRetry(t,s=3){for(let r=0;r<s;r++)try{const n=await fetch(t);if(!n.ok)throw new Error(`HTTP ${n.status}`);return n}catch(n){if(r===s-1)throw n;await new Promise(c=>setTimeout(c,1e3*Math.pow(2,r)))}throw new Error("Fetch failed")}attach(t){this.container=t,this.container.contains(this.video)||(this.video.style.width="100%",this.video.style.height="100%",this.video.style.objectFit=this.store.get().isAutoSized?"cover":"contain",this.video.style.backgroundColor="black",this.container.appendChild(this.video)),this.resizeObserver=new ResizeObserver(s=>{for(const r of s)this.emit("resize",{width:r.contentRect.width,height:r.contentRect.height})}),this.resizeObserver.observe(this.container),this.emit("ready")}use(t){this.plugins.has(t.name)||(t.init(this),this.plugins.set(t.name,t))}setSources(t,s=[]){this.store.setState({sources:t}),this.currentTracks=s,t.length>0&&this.load(t[0],s)}switchSource(t){const s=this.store.get().sources;if(t>=0&&t<s.length){const r=this.video.currentTime,n=!this.video.paused;this.load(s[t],this.currentTracks);const c=()=>{this.video.currentTime=r,n&&this.video.play(),this.video.removeEventListener("canplay",c)};this.video.addEventListener("canplay",c)}}load(t,s=[],r=!1){this.retryTimer&&clearTimeout(this.retryTimer);const n=typeof t=="string"?{url:t,type:"auto"}:t;r||(this.retryCount=0,this.store.setState({error:null}),this.removeNotification("retry")),this.currentSrc=n.url,this.currentSource=n,this.currentTracks=s;const m=this.store.get().sources.findIndex(x=>x.url===n.url);this.store.setState({isBuffering:!0,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,currentSourceIndex:m});let b=n.type||"auto";b==="auto"&&(n.url.includes(".m3u8")?b="hls":n.url.includes(".mpd")?b="dash":n.url.includes(".flv")||n.url.includes(".ts")?b="mpegts":n.url.startsWith("magnet:")||n.url.includes(".torrent")?b="webtorrent":b="mp4"),this.events.emit("load",{url:n.url,type:b});const y=this.video.getElementsByTagName("track");for(;y.length>0;)y[0].remove();s.length>0&&s.forEach(x=>{this.fetchWithRetry(x.src).then(()=>{this.addTextTrackInternal(x.src,x.label,x.srcLang,x.default)}).catch(d=>{this.notify({type:"warning",message:`Failed to load subtitle: ${x.label}`,duration:4e3})})}),(b==="mp4"||b==="webm"||b==="ogg")&&(this.video.src=n.url)}loadSubtitle(t,s="Subtitle"){this.addTextTrackInternal(t,s,void 0,!0)}addTextTrack(t,s){const r=new FileReader;r.onload=n=>{var y;if(!((y=n.target)!=null&&y.result))return;let c=n.target.result;(t.name.toLowerCase().endsWith(".srt")||!c.trim().startsWith("WEBVTT"))&&(c=c.replace(/(\d{2}:\d{2}:\d{2}),(\d{3})/g,"$1.$2"),c.trim().startsWith("WEBVTT")||(c=`WEBVTT
2
2
 
3
- `+d));const m=new Blob([d],{type:"text/vtt"}),x=URL.createObjectURL(m);this.addTextTrackInternal(x,s,"user",!0),setTimeout(()=>{const b=this.store.get().subtitleTracks.findIndex(k=>k.label===s);b!==-1&&(this.setSubtitle(b),this.notify({type:"success",message:"Subtitle uploaded",duration:3e3}))},200)},r.onerror=()=>{this.notify({type:"error",message:"Failed to read file",duration:3e3})},r.readAsText(t)}addTextTrackInternal(t,s,r="",n=!1){const d=document.createElement("track");d.kind="subtitles",d.label=s,d.src=t,d.srclang=r,n&&(d.default=!0),this.video.appendChild(d),this.updateSubtitles()}play(){return this.video.play()}pause(){return this.video.pause()}togglePlay(){this.video.paused?this.play():this.pause()}seek(t){if(isNaN(t))return;const s=Math.max(0,Math.min(t,this.video.duration));this.store.setState({currentTime:s}),this.video.currentTime=s}skip(t){this.seek(this.video.currentTime+t)}setVolume(t){const s=Math.max(0,Math.min(t,1));this.video.volume=s,s>0&&this.video.muted&&(this.video.muted=!1),s===0&&(this.video.muted=!0)}toggleMute(){this.video.muted=!this.video.muted}setAudioGain(t){this.store.setState({audioGain:t}),this.audioEngine.setGain(t)}setQuality(t){this.store.setState({currentQuality:t}),this.events.emit("quality-request",t)}setAudioTrack(t){this.store.setState({currentAudioTrack:t}),this.events.emit("audio-track-request",t)}setControlsVisible(t){this.store.get().controlsVisible!==t&&(this.store.setState({controlsVisible:t}),this.emit("control",t))}async toggleFullscreen(){if(this.container)try{document.fullscreenElement?await document.exitFullscreen():await this.container.requestFullscreen()}catch(t){console.error("Fullscreen toggle failed",t)}}togglePip(){document.pictureInPictureElement?document.exitPictureInPicture():this.video!==document.pictureInPictureElement&&this.video.requestPictureInPicture&&this.video.requestPictureInPicture()}screenshot(){const t=document.createElement("canvas");t.width=this.video.videoWidth,t.height=this.video.videoHeight;const s=t.getContext("2d");if(s){s.drawImage(this.video,0,0,t.width,t.height);try{const r=t.toDataURL("image/png"),n=document.createElement("a");n.download=`screenshot-${new Date().toISOString()}.png`,n.href=r,n.click(),this.notify({type:"success",message:"Screenshot saved",duration:2e3})}catch{this.notify({type:"error",message:"Failed to take screenshot",duration:3e3})}}}toggleLock(){this.store.setState(t=>({isLocked:!t.isLocked}))}toggleLoop(){this.video.loop=!this.video.loop,this.store.setState({isLooping:this.video.loop}),this.notify({type:"info",message:`Loop: ${this.video.loop?"On":"Off"}`,duration:1500})}setFlip(t){const s=this.store.get().flipState,r={...s,[t]:!s[t]};this.store.setState({flipState:r});const n=r.horizontal?-1:1,d=r.vertical?-1:1;this.video.style.transform=`scale(${n}, ${d})`}setAspectRatio(t){if(this.store.setState({aspectRatio:t}),t==="default"){this.video.style.objectFit=this.store.get().isAutoSized?"cover":"contain",this.video.style.width="100%",this.video.style.height="100%";return}this.video.style.objectFit="contain",this.notify({type:"info",message:`Aspect Ratio: ${t} (CSS support limited)`,duration:2e3})}initCast(){const t=window,s=()=>{if(!this.castInitialized)try{t.cast&&t.cast.framework&&t.chrome&&t.chrome.cast&&(t.cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:t.chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:t.chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),this.castInitialized=!0)}catch(r){console.warn("Cast Init Error or already initialized",r)}};t.cast&&t.cast.framework?s():t.__onGCastApiAvailable=r=>{r&&s()}}requestCast(){const t=window;if(t.cast&&t.cast.framework)try{this.castInitialized||this.initCast(),t.cast.framework.CastContext.getInstance().requestSession().then(()=>{this.loadMediaToCast()}).catch(s=>{s!=="cancel"&&this.notify({type:"error",message:"Cast failed: "+s,duration:3e3})})}catch{this.notify({type:"warning",message:"Cast not available yet",duration:3e3})}else this.notify({type:"warning",message:"Cast API not loaded",duration:3e3})}loadMediaToCast(){const t=window;try{const s=t.cast.framework.CastContext.getInstance().getCurrentSession();if(!s)return;const r=new t.chrome.cast.media.MediaInfo(this.currentSrc,this.currentSrc.includes(".m3u8")?"application/x-mpegurl":"video/mp4"),n=new t.chrome.cast.media.LoadRequest(r);s.loadMedia(n).then(()=>{this.notify({type:"success",message:"Casting...",duration:3e3})}).catch(d=>console.error("Cast load error",d))}catch(s){console.error("Failed to load media into Cast session",s)}}handleCueChange(){const t=this.store.get();if(t.currentSubtitle===-1){this.store.setState({activeCues:[]});return}const r=Array.from(this.video.textTracks).filter(n=>n.kind==="subtitles"||n.kind==="captions")[t.currentSubtitle];if(r&&r.activeCues){const n=Array.from(r.activeCues).map(d=>d.text);this.store.setState({activeCues:n})}else this.store.setState({activeCues:[]})}setSubtitle(t){if(Array.from(this.video.textTracks).forEach(s=>{s.removeEventListener("cuechange",this.boundCueChange),s.mode="hidden"}),this.store.setState({currentSubtitle:t,subtitleOffset:0,activeCues:[]}),t!==-1){const r=Array.from(this.video.textTracks).filter(n=>n.kind==="subtitles"||n.kind==="captions")[t];if(r){const n=this.store.get().subtitleSettings;r.mode=n.useNative?"showing":"hidden",r.addEventListener("cuechange",this.boundCueChange),this.handleCueChange()}}}updateSubtitleSettings(t){const r={...this.store.get().subtitleSettings,...t};this.store.setState({subtitleSettings:r}),t.useNative!==void 0&&this.setSubtitle(this.store.get().currentSubtitle)}resetSubtitleSettings(){this.store.setState({subtitleSettings:be}),this.setSubtitle(this.store.get().currentSubtitle)}setSubtitleOffset(t){const s=this.store.get().subtitleOffset,r=t-s;Math.abs(r)<.001||(Array.from(this.video.textTracks).forEach(n=>{(n.mode==="showing"||n.mode==="hidden")&&n.cues&&Array.from(n.cues).forEach(d=>{d.startTime+=r,d.endTime+=r})}),this.store.setState({subtitleOffset:t}),this.notify({type:"info",message:`Subtitle Offset: ${t>0?"+":""}${t.toFixed(1)}s`,duration:1500}))}async download(){var r;if(!this.video.src)return;const t=this.video.src;if(t.includes("blob:")||t.includes(".m3u8")){this.notify({type:"warning",message:"Stream download not supported in browser.",duration:4e3});return}const s=this.notify({type:"loading",message:"Preparing download...",progress:0});try{const n=await this.fetchWithRetry(t);if(!n.body)throw new Error("No body");const d=n.body.getReader(),m=n.headers.get("Content-Length"),x=m?parseInt(m,10):0;let y=0;const l=[];for(;;){const{done:z,value:M}=await d.read();if(z)break;if(l.push(M),y+=M.length,x){const p=Math.round(y/x*100);this.notify({id:s,type:"loading",message:`Downloading... ${p}%`,progress:p})}}const b=new Blob(l),k=window.URL.createObjectURL(b),j=document.createElement("a");j.style.display="none",j.href=k,j.download=((r=t.split("/").pop())==null?void 0:r.split("?")[0])||"video.mp4",document.body.appendChild(j),j.click(),window.URL.revokeObjectURL(k),document.body.removeChild(j),this.notify({id:s,type:"success",message:"Saved!",duration:3e3})}catch{this.notify({id:s,type:"error",message:"Download failed.",duration:4e3}),window.open(t,"_blank")}}notify(t){const s=t.id||Math.random().toString(36).substr(2,9),r={...t,id:s};return this.store.setState({notifications:[r]}),t.duration&&setTimeout(()=>this.removeNotification(s),t.duration),s}removeNotification(t){const s=this.store.get().notifications;this.store.setState({notifications:s.filter(r=>r.id!==t)})}setAppearance(t){this.store.setState(s=>({...s,...t}))}destroy(){this.retryTimer&&clearTimeout(this.retryTimer),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),document.removeEventListener("fullscreenchange",this.boundFullscreenChange),this.video.pause(),this.video.src="";const t=this.video.getElementsByTagName("track");for(;t.length>0;)t[0].remove();this.emit("destroy"),this.events.destroy(),this.store.destroy(),this.plugins.forEach(s=>s.destroy&&s.destroy()),this.plugins.clear(),this.video.remove(),this.audioEngine.destroy()}}const me=o=>{if(isNaN(o))return"00:00";const t=Math.floor(o/3600),s=Math.floor(o%3600/60),r=Math.floor(o%60);return t>0?`${t}:${s.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${s}:${r.toString().padStart(2,"0")}`},Bt=async(o,t=3)=>{for(let s=0;s<t;s++)try{const r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);return await r.text()}catch(r){if(s===t-1)throw r;await new Promise(n=>setTimeout(n,1e3))}throw new Error("Failed")},Vt=async(o,t)=>{try{const r=(await Bt(o)).split(`
4
- `),n=[];let d=null,m=null;const x=o.substring(0,o.lastIndexOf("/")+1),y=l=>{const b=l.split(":");let k=0;return b.length===3?(k+=parseFloat(b[0])*3600,k+=parseFloat(b[1])*60,k+=parseFloat(b[2])):(k+=parseFloat(b[0])*60,k+=parseFloat(b[1])),k};for(let l of r)if(l=l.trim(),l.includes("-->")){const b=l.split("-->");d=y(b[0].trim()),m=y(b[1].trim())}else if(d!==null&&m!==null&&l.length>0){let[b,k]=l.split("#");!b.match(/^https?:\/\//)&&!b.startsWith("data:")&&(b=x+b);let j=0,z=0,M=0,p=0;if(k&&k.startsWith("xywh=")){const I=k.replace("xywh=","").split(",");I.length===4&&(j=parseInt(I[0]),z=parseInt(I[1]),M=parseInt(I[2]),p=parseInt(I[3]))}M>0&&p>0&&n.push({start:d,end:m,url:b,x:j,y:z,w:M,h:p}),d=null,m=null}return n}catch{return t({type:"warning",message:"Failed to load thumbnails",duration:4e3}),[]}},Ye=(o,t=200)=>{const[s,r]=h.useState(o),[n,d]=h.useState(!1);return h.useEffect(()=>{if(o)r(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{d(!0)})});else{d(!1);const m=setTimeout(()=>{r(!1)},t);return()=>clearTimeout(m)}},[o,t]),{isMounted:s,isVisible:n}};/**
3
+ `+c));const m=new Blob([c],{type:"text/vtt"}),b=URL.createObjectURL(m);this.addTextTrackInternal(b,s,"user",!0),setTimeout(()=>{const d=this.store.get().subtitleTracks.findIndex(k=>k.label===s);d!==-1&&(this.setSubtitle(d),this.notify({type:"success",message:"Subtitle uploaded",duration:3e3}))},200)},r.onerror=()=>{this.notify({type:"error",message:"Failed to read file",duration:3e3})},r.readAsText(t)}addTextTrackInternal(t,s,r="",n=!1){const c=document.createElement("track");c.kind="subtitles",c.label=s,c.src=t,c.srclang=r,n&&(c.default=!0),this.video.appendChild(c),this.updateSubtitles()}play(){return this.video.play()}pause(){return this.video.pause()}togglePlay(){this.video.paused?this.play():this.pause()}seek(t){if(isNaN(t))return;const s=Math.max(0,Math.min(t,this.video.duration));this.store.setState({currentTime:s}),this.video.currentTime=s}skip(t){this.seek(this.video.currentTime+t)}setVolume(t){const s=Math.max(0,Math.min(t,1));this.video.volume=s,s>0&&this.video.muted&&(this.video.muted=!1),s===0&&(this.video.muted=!0)}toggleMute(){this.video.muted=!this.video.muted}setAudioGain(t){this.store.setState({audioGain:t}),this.audioEngine.setGain(t)}setQuality(t){this.store.setState({currentQuality:t}),this.events.emit("quality-request",t)}setAudioTrack(t){this.store.setState({currentAudioTrack:t}),this.events.emit("audio-track-request",t)}setControlsVisible(t){this.store.get().controlsVisible!==t&&(this.store.setState({controlsVisible:t}),this.emit("control",t))}async toggleFullscreen(){if(this.container)try{document.fullscreenElement?await document.exitFullscreen():await this.container.requestFullscreen()}catch(t){console.error("Fullscreen toggle failed",t)}}togglePip(){document.pictureInPictureElement?document.exitPictureInPicture():this.video!==document.pictureInPictureElement&&this.video.requestPictureInPicture&&this.video.requestPictureInPicture()}screenshot(){const t=document.createElement("canvas");t.width=this.video.videoWidth,t.height=this.video.videoHeight;const s=t.getContext("2d");if(s){s.drawImage(this.video,0,0,t.width,t.height);try{const r=t.toDataURL("image/png"),n=document.createElement("a");n.download=`screenshot-${new Date().toISOString()}.png`,n.href=r,n.click(),this.notify({type:"success",message:"Screenshot saved",duration:2e3})}catch{this.notify({type:"error",message:"Failed to take screenshot",duration:3e3})}}}toggleLock(){this.store.setState(t=>({isLocked:!t.isLocked}))}toggleLoop(){this.video.loop=!this.video.loop,this.store.setState({isLooping:this.video.loop}),this.notify({type:"info",message:`Loop: ${this.video.loop?"On":"Off"}`,duration:1500})}setFlip(t){const s=this.store.get().flipState,r={...s,[t]:!s[t]};this.store.setState({flipState:r});const n=r.horizontal?-1:1,c=r.vertical?-1:1;this.video.style.transform=`scale(${n}, ${c})`}setAspectRatio(t){if(this.store.setState({aspectRatio:t}),t==="default"){this.video.style.objectFit=this.store.get().isAutoSized?"cover":"contain",this.video.style.width="100%",this.video.style.height="100%";return}this.video.style.objectFit="contain",this.notify({type:"info",message:`Aspect Ratio: ${t} (CSS support limited)`,duration:2e3})}initCast(){const t=window,s=()=>{if(!this.castInitialized)try{t.cast&&t.cast.framework&&t.chrome&&t.chrome.cast&&(t.cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:t.chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:t.chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),this.castInitialized=!0)}catch(r){console.warn("Cast Init Error or already initialized",r)}};t.cast&&t.cast.framework?s():t.__onGCastApiAvailable=r=>{r&&s()}}requestCast(){const t=window;if(t.cast&&t.cast.framework)try{this.castInitialized||this.initCast(),t.cast.framework.CastContext.getInstance().requestSession().then(()=>{this.loadMediaToCast()}).catch(s=>{s!=="cancel"&&this.notify({type:"error",message:"Cast failed: "+s,duration:3e3})})}catch{this.notify({type:"warning",message:"Cast not available yet",duration:3e3})}else this.notify({type:"warning",message:"Cast API not loaded",duration:3e3})}loadMediaToCast(){const t=window;try{const s=t.cast.framework.CastContext.getInstance().getCurrentSession();if(!s)return;const r=new t.chrome.cast.media.MediaInfo(this.currentSrc,this.currentSrc.includes(".m3u8")?"application/x-mpegurl":"video/mp4"),n=new t.chrome.cast.media.LoadRequest(r);s.loadMedia(n).then(()=>{this.notify({type:"success",message:"Casting...",duration:3e3})}).catch(c=>console.error("Cast load error",c))}catch(s){console.error("Failed to load media into Cast session",s)}}handleCueChange(){const t=this.store.get();if(t.currentSubtitle===-1){this.store.setState({activeCues:[]});return}const r=Array.from(this.video.textTracks).filter(n=>n.kind==="subtitles"||n.kind==="captions")[t.currentSubtitle];if(r&&r.activeCues){const n=Array.from(r.activeCues).map(c=>c.text);this.store.setState({activeCues:n})}else this.store.setState({activeCues:[]})}setSubtitle(t){if(Array.from(this.video.textTracks).forEach(s=>{s.removeEventListener("cuechange",this.boundCueChange),s.mode="hidden"}),this.store.setState({currentSubtitle:t,subtitleOffset:0,activeCues:[]}),t!==-1){const r=Array.from(this.video.textTracks).filter(n=>n.kind==="subtitles"||n.kind==="captions")[t];if(r){const n=this.store.get().subtitleSettings;r.mode=n.useNative?"showing":"hidden",r.addEventListener("cuechange",this.boundCueChange),this.handleCueChange()}}}updateSubtitleSettings(t){const r={...this.store.get().subtitleSettings,...t};this.store.setState({subtitleSettings:r}),t.useNative!==void 0&&this.setSubtitle(this.store.get().currentSubtitle)}resetSubtitleSettings(){this.store.setState({subtitleSettings:be}),this.setSubtitle(this.store.get().currentSubtitle)}setSubtitleOffset(t){const s=this.store.get().subtitleOffset,r=t-s;Math.abs(r)<.001||(Array.from(this.video.textTracks).forEach(n=>{(n.mode==="showing"||n.mode==="hidden")&&n.cues&&Array.from(n.cues).forEach(c=>{c.startTime+=r,c.endTime+=r})}),this.store.setState({subtitleOffset:t}),this.notify({type:"info",message:`Subtitle Offset: ${t>0?"+":""}${t.toFixed(1)}s`,duration:1500}))}async download(){var r;if(!this.video.src)return;const t=this.video.src;if(t.includes("blob:")||t.includes(".m3u8")){this.notify({type:"warning",message:"Stream download not supported in browser.",duration:4e3});return}const s=this.notify({type:"loading",message:"Preparing download...",progress:0});try{const n=await this.fetchWithRetry(t);if(!n.body)throw new Error("No body");const c=n.body.getReader(),m=n.headers.get("Content-Length"),b=m?parseInt(m,10):0;let y=0;const x=[];for(;;){const{done:z,value:M}=await c.read();if(z)break;if(x.push(M),y+=M.length,b){const p=Math.round(y/b*100);this.notify({id:s,type:"loading",message:`Downloading... ${p}%`,progress:p})}}const d=new Blob(x),k=window.URL.createObjectURL(d),j=document.createElement("a");j.style.display="none",j.href=k,j.download=((r=t.split("/").pop())==null?void 0:r.split("?")[0])||"video.mp4",document.body.appendChild(j),j.click(),window.URL.revokeObjectURL(k),document.body.removeChild(j),this.notify({id:s,type:"success",message:"Saved!",duration:3e3})}catch{this.notify({id:s,type:"error",message:"Download failed.",duration:4e3}),window.open(t,"_blank")}}notify(t){const s=t.id||Math.random().toString(36).substr(2,9),r={...t,id:s};return this.store.setState({notifications:[r]}),t.duration&&setTimeout(()=>this.removeNotification(s),t.duration),s}removeNotification(t){const s=this.store.get().notifications;this.store.setState({notifications:s.filter(r=>r.id!==t)})}setAppearance(t){this.store.setState(s=>({...s,...t}))}destroy(){this.retryTimer&&clearTimeout(this.retryTimer),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),document.removeEventListener("fullscreenchange",this.boundFullscreenChange),this.video.pause(),this.video.src="";const t=this.video.getElementsByTagName("track");for(;t.length>0;)t[0].remove();this.emit("destroy"),this.events.destroy(),this.store.destroy(),this.plugins.forEach(s=>s.destroy&&s.destroy()),this.plugins.clear(),this.video.remove(),this.audioEngine.destroy()}}const me=o=>{if(isNaN(o))return"00:00";const t=Math.floor(o/3600),s=Math.floor(o%3600/60),r=Math.floor(o%60);return t>0?`${t}:${s.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${s}:${r.toString().padStart(2,"0")}`},Vt=async(o,t=3)=>{for(let s=0;s<t;s++)try{const r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);return await r.text()}catch(r){if(s===t-1)throw r;await new Promise(n=>setTimeout(n,1e3))}throw new Error("Failed")},Ot=async(o,t)=>{try{const r=(await Vt(o)).split(`
4
+ `),n=[];let c=null,m=null;const b=o.substring(0,o.lastIndexOf("/")+1),y=x=>{const d=x.split(":");let k=0;return d.length===3?(k+=parseFloat(d[0])*3600,k+=parseFloat(d[1])*60,k+=parseFloat(d[2])):(k+=parseFloat(d[0])*60,k+=parseFloat(d[1])),k};for(let x of r)if(x=x.trim(),x.includes("-->")){const d=x.split("-->");c=y(d[0].trim()),m=y(d[1].trim())}else if(c!==null&&m!==null&&x.length>0){let[d,k]=x.split("#");!d.match(/^https?:\/\//)&&!d.startsWith("data:")&&(d=b+d);let j=0,z=0,M=0,p=0;if(k&&k.startsWith("xywh=")){const E=k.replace("xywh=","").split(",");E.length===4&&(j=parseInt(E[0]),z=parseInt(E[1]),M=parseInt(E[2]),p=parseInt(E[3]))}M>0&&p>0&&n.push({start:c,end:m,url:d,x:j,y:z,w:M,h:p}),c=null,m=null}return n}catch{return t({type:"warning",message:"Failed to load thumbnails",duration:4e3}),[]}},Ze=(o,t=200)=>{const[s,r]=h.useState(o),[n,c]=h.useState(!1);return h.useEffect(()=>{if(o)r(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c(!0)})});else{c(!1);const m=setTimeout(()=>{r(!1)},t);return()=>clearTimeout(m)}},[o,t]),{isMounted:s,isVisible:n}};/**
5
5
  * @license lucide-react v0.462.0 - ISC
6
6
  *
7
7
  * This source code is licensed under the ISC license.
8
8
  * See the LICENSE file in the root directory of this source tree.
9
- */const Ot=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ct=(...o)=>o.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim();/**
9
+ */const Ht=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dt=(...o)=>o.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim();/**
10
10
  * @license lucide-react v0.462.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */var Ht={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
14
+ */var qt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
15
15
  * @license lucide-react v0.462.0 - ISC
16
16
  *
17
17
  * This source code is licensed under the ISC license.
18
18
  * See the LICENSE file in the root directory of this source tree.
19
- */const qt=h.forwardRef(({color:o="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:n="",children:d,iconNode:m,...x},y)=>h.createElement("svg",{ref:y,...Ht,width:t,height:t,stroke:o,strokeWidth:r?Number(s)*24/Number(t):s,className:ct("lucide",n),...x},[...m.map(([l,b])=>h.createElement(l,b)),...Array.isArray(d)?d:[d]]));/**
19
+ */const Wt=h.forwardRef(({color:o="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:n="",children:c,iconNode:m,...b},y)=>h.createElement("svg",{ref:y,...qt,width:t,height:t,stroke:o,strokeWidth:r?Number(s)*24/Number(t):s,className:dt("lucide",n),...b},[...m.map(([x,d])=>h.createElement(x,d)),...Array.isArray(c)?c:[c]]));/**
20
20
  * @license lucide-react v0.462.0 - ISC
21
21
  *
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
- */const g=(o,t)=>{const s=h.forwardRef(({className:r,...n},d)=>h.createElement(qt,{ref:d,iconNode:t,className:ct(`lucide-${Ot(o)}`,r),...n}));return s.displayName=`${o}`,s};/**
24
+ */const g=(o,t)=>{const s=h.forwardRef(({className:r,...n},c)=>h.createElement(Wt,{ref:c,iconNode:t,className:dt(`lucide-${Ht(o)}`,r),...n}));return s.displayName=`${o}`,s};/**
25
25
  * @license lucide-react v0.462.0 - ISC
26
26
  *
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
- */const Wt=g("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
29
+ */const Dt=g("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
30
30
  * @license lucide-react v0.462.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
- */const Dt=g("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
34
+ */const Ut=g("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
35
35
  * @license lucide-react v0.462.0 - ISC
36
36
  *
37
37
  * This source code is licensed under the ISC license.
38
38
  * See the LICENSE file in the root directory of this source tree.
39
- */const Ut=g("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
39
+ */const _t=g("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
40
40
  * @license lucide-react v0.462.0 - ISC
41
41
  *
42
42
  * This source code is licensed under the ISC license.
43
43
  * See the LICENSE file in the root directory of this source tree.
44
- */const _t=g("Captions",[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]]);/**
44
+ */const Gt=g("Captions",[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]]);/**
45
45
  * @license lucide-react v0.462.0 - ISC
46
46
  *
47
47
  * This source code is licensed under the ISC license.
48
48
  * See the LICENSE file in the root directory of this source tree.
49
- */const Gt=g("CaseUpper",[["path",{d:"m3 15 4-8 4 8",key:"1vwr6u"}],["path",{d:"M4 13h6",key:"1r9ots"}],["path",{d:"M15 11h4.5a2 2 0 0 1 0 4H15V7h4a2 2 0 0 1 0 4",key:"1sqfas"}]]);/**
49
+ */const Qt=g("CaseUpper",[["path",{d:"m3 15 4-8 4 8",key:"1vwr6u"}],["path",{d:"M4 13h6",key:"1r9ots"}],["path",{d:"M15 11h4.5a2 2 0 0 1 0 4H15V7h4a2 2 0 0 1 0 4",key:"1sqfas"}]]);/**
50
50
  * @license lucide-react v0.462.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
53
53
  * See the LICENSE file in the root directory of this source tree.
54
- */const Qt=g("Cast",[["path",{d:"M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",key:"3zrzxg"}],["path",{d:"M2 12a9 9 0 0 1 8 8",key:"g6cvee"}],["path",{d:"M2 16a5 5 0 0 1 4 4",key:"1y1dii"}],["line",{x1:"2",x2:"2.01",y1:"20",y2:"20",key:"xu2jvo"}]]);/**
54
+ */const Xt=g("Cast",[["path",{d:"M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",key:"3zrzxg"}],["path",{d:"M2 12a9 9 0 0 1 8 8",key:"g6cvee"}],["path",{d:"M2 16a5 5 0 0 1 4 4",key:"1y1dii"}],["line",{x1:"2",x2:"2.01",y1:"20",y2:"20",key:"xu2jvo"}]]);/**
55
55
  * @license lucide-react v0.462.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
- */const Xt=g("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
59
+ */const Jt=g("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
60
60
  * @license lucide-react v0.462.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */const Jt=g("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
64
+ */const Kt=g("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
65
65
  * @license lucide-react v0.462.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const Kt=g("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
69
+ */const Yt=g("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
70
70
  * @license lucide-react v0.462.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
- */const Yt=g("Droplet",[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]]);/**
74
+ */const Zt=g("Droplet",[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]]);/**
75
75
  * @license lucide-react v0.462.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const Zt=g("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
79
+ */const es=g("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
80
80
  * @license lucide-react v0.462.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const es=g("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
84
+ */const ts=g("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
85
85
  * @license lucide-react v0.462.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const ts=g("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
89
+ */const ss=g("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
90
90
  * @license lucide-react v0.462.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const ss=g("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
94
+ */const is=g("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
95
95
  * @license lucide-react v0.462.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const is=g("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
99
+ */const rs=g("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
100
100
  * @license lucide-react v0.462.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const rs=g("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
104
+ */const ns=g("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
105
105
  * @license lucide-react v0.462.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const ns=g("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
109
+ */const as=g("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
110
110
  * @license lucide-react v0.462.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const as=g("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
114
+ */const os=g("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
115
115
  * @license lucide-react v0.462.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const os=g("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
119
+ */const ls=g("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
120
120
  * @license lucide-react v0.462.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const ls=g("MoveVertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]);/**
124
+ */const cs=g("MoveVertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]);/**
125
125
  * @license lucide-react v0.462.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const cs=g("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
129
+ */const ds=g("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
130
130
  * @license lucide-react v0.462.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const ds=g("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
134
+ */const us=g("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
135
135
  * @license lucide-react v0.462.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const us=g("PictureInPicture",[["path",{d:"M8 4.5v5H3m-1-6 6 6m13 0v-3c0-1.16-.84-2-2-2h-7m-9 9v2c0 1.05.95 2 2 2h3",key:"bcd8fb"}],["rect",{width:"10",height:"7",x:"12",y:"13.5",ry:"2",key:"136fx3"}]]);/**
139
+ */const hs=g("PictureInPicture",[["path",{d:"M8 4.5v5H3m-1-6 6 6m13 0v-3c0-1.16-.84-2-2-2h-7m-9 9v2c0 1.05.95 2 2 2h3",key:"bcd8fb"}],["rect",{width:"10",height:"7",x:"12",y:"13.5",ry:"2",key:"136fx3"}]]);/**
140
140
  * @license lucide-react v0.462.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const hs=g("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
144
+ */const ms=g("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
145
145
  * @license lucide-react v0.462.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const ms=g("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
149
+ */const fs=g("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
150
150
  * @license lucide-react v0.462.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const fs=g("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
154
+ */const ps=g("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
155
155
  * @license lucide-react v0.462.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
- */const ps=g("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
159
+ */const xs=g("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
160
160
  * @license lucide-react v0.462.0 - ISC
161
161
  *
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
- */const xs=g("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
164
+ */const bs=g("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
165
165
  * @license lucide-react v0.462.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
- */const bs=g("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
169
+ */const vs=g("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
170
170
  * @license lucide-react v0.462.0 - ISC
171
171
  *
172
172
  * This source code is licensed under the ISC license.
173
173
  * See the LICENSE file in the root directory of this source tree.
174
- */const vs=g("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
174
+ */const gs=g("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
175
175
  * @license lucide-react v0.462.0 - ISC
176
176
  *
177
177
  * This source code is licensed under the ISC license.
178
178
  * See the LICENSE file in the root directory of this source tree.
179
- */const gs=g("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
179
+ */const ys=g("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
180
180
  * @license lucide-react v0.462.0 - ISC
181
181
  *
182
182
  * This source code is licensed under the ISC license.
183
183
  * See the LICENSE file in the root directory of this source tree.
184
- */const ys=g("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
184
+ */const ws=g("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
185
185
  * @license lucide-react v0.462.0 - ISC
186
186
  *
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
- */const ws=g("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
189
+ */const ks=g("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
190
190
  * @license lucide-react v0.462.0 - ISC
191
191
  *
192
192
  * This source code is licensed under the ISC license.
193
193
  * See the LICENSE file in the root directory of this source tree.
194
- */const ks=g("Volume1",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]]);/**
194
+ */const js=g("Volume1",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]]);/**
195
195
  * @license lucide-react v0.462.0 - ISC
196
196
  *
197
197
  * This source code is licensed under the ISC license.
198
198
  * See the LICENSE file in the root directory of this source tree.
199
- */const js=g("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
199
+ */const Cs=g("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
200
200
  * @license lucide-react v0.462.0 - ISC
201
201
  *
202
202
  * This source code is licensed under the ISC license.
203
203
  * See the LICENSE file in the root directory of this source tree.
204
- */const Cs=g("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
204
+ */const Ss=g("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
205
205
  * @license lucide-react v0.462.0 - ISC
206
206
  *
207
207
  * This source code is licensed under the ISC license.
208
208
  * See the LICENSE file in the root directory of this source tree.
209
- */const Ss=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
209
+ */const Ns=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
210
210
  * @license lucide-react v0.462.0 - ISC
211
211
  *
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
- */const Ns=g("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Ze=hs,et=ds,zs=js,Ms=ks,Ts=Cs,Rs=rs,Is=ns,Ls=bs,ve=Xt,$s=us,Es=_t,Ps=Kt,As=ys,Fs=Wt,pe=ts,Bs=Qt,Vs=ws,Os=Jt,Hs=as,qs=ms,Ws=vs,Ds=gs,dt=cs,Us=Zt,_s=ls,Gs=fs,Qs=Dt,Xs=Gt,Js=Yt,Ks=Ut,Ys=is,Zs=ss,ei=os,ti=Ns,si=Ss,ii=es,tt=({className:o})=>e.jsxs("div",{className:`relative flex items-center justify-center ${o}`,children:[e.jsx(ps,{className:"w-full h-full",strokeWidth:2}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]",children:"10"})]}),st=({className:o})=>e.jsxs("div",{className:`relative flex items-center justify-center ${o}`,children:[e.jsx(xs,{className:"w-full h-full",strokeWidth:2}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]",children:"10"})]}),ri=({notifications:o})=>e.jsx("div",{className:"absolute top-4 left-4 z-50 flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[400px]",children:o.map(t=>e.jsxs("div",{className:`
214
+ */const zs=g("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),et=ms,tt=us,Ms=Cs,Ts=js,Rs=Ss,Is=ns,Ls=as,$s=vs,ve=Jt,Es=hs,Ps=Gt,As=Yt,Fs=ws,Bs=Dt,pe=ss,Vs=Xt,Os=ks,Hs=Kt,qs=os,Ws=fs,Ds=gs,Us=ys,ut=ds,_s=es,Gs=cs,Qs=ps,Xs=Ut,Js=Qt,Ks=Zt,Ys=_t,Zs=rs,ei=is,ti=ls,si=zs,ii=Ns,ri=ts,st=({className:o})=>e.jsxs("div",{className:`relative flex items-center justify-center ${o}`,children:[e.jsx(xs,{className:"w-full h-full",strokeWidth:2}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]",children:"10"})]}),it=({className:o})=>e.jsxs("div",{className:`relative flex items-center justify-center ${o}`,children:[e.jsx(bs,{className:"w-full h-full",strokeWidth:2}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]",children:"10"})]}),ni=({notifications:o})=>e.jsx("div",{className:"absolute top-4 left-4 z-50 flex flex-col gap-2 pointer-events-none font-sans max-w-[85%] md:max-w-[400px]",children:o.map(t=>e.jsxs("div",{className:`
215
215
  bg-zinc-950/90 backdrop-blur-md border border-white/10 text-white px-4 py-3 rounded-lg shadow-xl text-sm font-medium flex items-start gap-3 animate-in slide-in-from-left-2 fade-in duration-300 pointer-events-auto
216
216
  w-fit max-w-full
217
217
  ${t.type==="error"?"border-red-500/50 text-red-100":""}
218
218
  ${t.type==="warning"?"border-amber-500/50 text-amber-100":""}
219
- `,children:[t.type==="loading"&&e.jsx(pe,{className:"w-4 h-4 animate-spin text-[var(--accent)] shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[e.jsx("span",{className:"break-words line-clamp-4 leading-relaxed whitespace-pre-wrap",children:t.message}),typeof t.progress=="number"&&e.jsx("div",{className:"h-1 w-full bg-white/10 rounded-full overflow-hidden mt-1.5",children:e.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-300",style:{width:`${t.progress}%`}})})]})]},t.id))}),ni=({cues:o,settings:t})=>{if(t.useNative||o.length===0)return null;const s=()=>{switch(t.textStyle){case"outline":return"0px 0px 4px black, 0px 0px 4px black";case"raised":return"0 -1px 1px black, 0 -2px 2px black";case"depressed":return"0 1px 1px white, 0 2px 2px black";case"shadow":return"2px 2px 2px rgba(0,0,0,0.8)";default:return"none"}};return e.jsx("div",{className:"absolute inset-x-0 flex flex-col items-center justify-end text-center z-10 pointer-events-none transition-all duration-200",style:{bottom:`${t.verticalOffset}px`},children:o.map((r,n)=>e.jsx("div",{className:"mb-1 inline-block max-w-[80%]",style:{fontSize:`${t.textSize}%`,color:t.textColor,fontWeight:t.isBold?"bold":"normal",textTransform:t.fixCapitalization?"capitalize":"none",textShadow:s(),lineHeight:1.4},children:e.jsx("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`rgba(0, 0, 0, ${t.backgroundOpacity/100})`,backdropFilter:t.backgroundBlur?`blur(${t.backgroundBlurAmount}px)`:"none"},dangerouslySetInnerHTML:{__html:r}})},n))})},ut=({children:o,onClose:t,align:s="right",maxHeight:r,className:n})=>{const d=h.useRef(null),m=s==="center"?"left-1/2 -translate-x-1/2 origin-bottom":"right-0 origin-bottom-right",x=r?{maxHeight:`${r}px`}:{};return e.jsx("div",{className:`absolute bottom-full mb-4 ${m} bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl overflow-hidden w-[300px] max-w-[calc(100vw-32px)] text-sm z-50 ring-1 ring-white/5 font-[family-name:var(--font-main)] flex flex-col p-1.5 transition-all duration-300 ease-out ${n}`,style:{...x,borderRadius:"var(--radius-lg)"},onClick:y=>y.stopPropagation(),children:e.jsx("div",{className:"overflow-y-auto hide-scrollbar flex-1",style:{borderRadius:"var(--radius)"},children:e.jsx("div",{ref:d,children:o})})})},it=({content:o,className:t})=>typeof o=="string"?o.trim().startsWith("<")?e.jsx("span",{className:t,dangerouslySetInnerHTML:{__html:o}}):e.jsx("span",{className:t,children:o}):e.jsx("span",{className:t,children:o}),C=({label:o,value:t,active:s,onClick:r,hasSubmenu:n,icon:d})=>e.jsxs("button",{onClick:r,className:"w-full flex items-center justify-between px-3 py-2.5 hover:bg-white/10 transition-colors text-left text-zinc-200 active:bg-white/5 focus:outline-none focus:bg-white/10 group overflow-hidden my-0.5",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[d&&e.jsx("span",{className:"text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4",children:e.jsx(it,{content:d})}),e.jsx("span",{className:`font-medium truncate text-sm flex items-center ${s?"text-[var(--accent)]":""}`,title:typeof o=="string"?o:void 0,children:e.jsx(it,{content:o})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-zinc-400 shrink-0",children:[t&&e.jsx("span",{className:"text-xs font-medium truncate max-w-[60px]",title:t,children:t}),s&&e.jsx(ve,{className:"w-4 h-4 text-[var(--accent)] shrink-0"}),n&&e.jsx("span",{className:"text-xs group-hover:translate-x-0.5 transition-transform text-zinc-500 shrink-0",children:"›"})]})]}),F=({label:o,onBack:t,rightAction:s})=>e.jsxs("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",style:{borderRadius:"var(--radius)"},children:[e.jsxs("button",{className:"flex items-center gap-2 hover:text-white transition-colors focus:outline-none",onClick:t,children:[e.jsx(Fs,{className:"w-3 h-3"}),e.jsx("span",{children:o})]}),s]}),rt=()=>e.jsx("div",{className:"h-px bg-white/5 mx-2 my-1"}),te=({content:o})=>typeof o=="string"?o.trim().startsWith("<")?e.jsx("span",{dangerouslySetInnerHTML:{__html:o}}):e.jsx("span",{children:o}):e.jsx(e.Fragment,{children:o}),U=({label:o,checked:t,onChange:s,icon:r,tooltip:n})=>e.jsxs("div",{className:"flex items-center justify-between py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r&&e.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4",children:e.jsx(te,{content:r})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center",children:e.jsx(te,{content:o})}),n&&e.jsx("span",{className:"text-[10px] text-zinc-500",children:n})]})]}),e.jsx("button",{onClick:()=>s(!t),className:`w-11 h-6 shrink-0 transition-colors relative focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-zinc-900 ${t?"bg-[var(--accent)]":"bg-zinc-700"}`,style:{"--tw-ring-color":"var(--accent)",borderRadius:"var(--radius-full)",borderWidth:"var(--border-width)",borderColor:"rgba(255,255,255,0.1)"},children:e.jsx("div",{className:`absolute top-1/2 -translate-y-1/2 left-0.5 bg-white w-4 h-4 transition-transform shadow-sm ${t?"translate-x-5":"translate-x-0"}`,style:{borderRadius:"var(--radius-full)"}})})]}),ee=({label:o,value:t,min:s,max:r,step:n,onChange:d,formatValue:m,icon:x})=>e.jsxs("div",{className:"py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[x&&e.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4",children:e.jsx(te,{content:x})}),e.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:o})]}),e.jsx("span",{className:"text-[10px] font-mono font-medium text-zinc-300 bg-white/10 px-1.5 py-0.5 tabular-nums",style:{borderRadius:"var(--radius-sm)"},children:m?m(t):t})]}),e.jsxs("div",{className:"relative h-4 flex items-center px-1",children:[e.jsx("input",{type:"range",min:s,max:r,step:n,value:t,onChange:y=>d(parseFloat(y.target.value)),className:"w-full h-1.5 appearance-none cursor-pointer focus:outline-none focus:ring-2 strata-range-input",style:{borderRadius:"var(--radius-full)",background:`linear-gradient(to right, var(--accent) 0%, var(--accent) ${(t-s)/(r-s)*100}%, #3f3f46 ${(t-s)/(r-s)*100}%, #3f3f46 100%)`,"--tw-ring-color":"var(--accent)"}}),e.jsx("style",{children:`
219
+ `,children:[t.type==="loading"&&e.jsx(pe,{className:"w-4 h-4 animate-spin text-[var(--accent)] shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[e.jsx("span",{className:"break-words line-clamp-4 leading-relaxed whitespace-pre-wrap",children:t.message}),typeof t.progress=="number"&&e.jsx("div",{className:"h-1 w-full bg-white/10 rounded-full overflow-hidden mt-1.5",children:e.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-300",style:{width:`${t.progress}%`}})})]})]},t.id))}),ai=({cues:o,settings:t})=>{if(t.useNative||o.length===0)return null;const s=()=>{switch(t.textStyle){case"outline":return"0px 0px 4px black, 0px 0px 4px black";case"raised":return"0 -1px 1px black, 0 -2px 2px black";case"depressed":return"0 1px 1px white, 0 2px 2px black";case"shadow":return"2px 2px 2px rgba(0,0,0,0.8)";default:return"none"}};return e.jsx("div",{className:"absolute inset-x-0 flex flex-col items-center justify-end text-center z-10 pointer-events-none transition-all duration-200",style:{bottom:`${t.verticalOffset}px`},children:o.map((r,n)=>e.jsx("div",{className:"mb-1 inline-block max-w-[80%]",style:{fontSize:`${t.textSize}%`,color:t.textColor,fontWeight:t.isBold?"bold":"normal",textTransform:t.fixCapitalization?"capitalize":"none",textShadow:s(),lineHeight:1.4},children:e.jsx("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`rgba(0, 0, 0, ${t.backgroundOpacity/100})`,backdropFilter:t.backgroundBlur?`blur(${t.backgroundBlurAmount}px)`:"none"},dangerouslySetInnerHTML:{__html:r}})},n))})},ht=({children:o,onClose:t,align:s="right",maxHeight:r,className:n})=>{const c=h.useRef(null),m=s==="center"?"left-1/2 -translate-x-1/2 origin-bottom":"right-0 origin-bottom-right",b=r?{maxHeight:`${r}px`}:{};return e.jsx("div",{className:`absolute bottom-full mb-4 ${m} bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl overflow-hidden w-[300px] max-w-[calc(100vw-32px)] text-sm z-50 ring-1 ring-white/5 font-[family-name:var(--font-main)] flex flex-col p-1.5 transition-all duration-300 ease-out ${n}`,style:{...b,borderRadius:"var(--radius-lg)"},onClick:y=>y.stopPropagation(),children:e.jsx("div",{className:"overflow-y-auto hide-scrollbar flex-1",style:{borderRadius:"var(--radius)"},children:e.jsx("div",{ref:c,children:o})})})},rt=({content:o,className:t})=>typeof o=="string"?o.trim().startsWith("<")?e.jsx("span",{className:t,dangerouslySetInnerHTML:{__html:o}}):e.jsx("span",{className:t,children:o}):e.jsx("span",{className:t,children:o}),C=({label:o,value:t,active:s,onClick:r,hasSubmenu:n,icon:c})=>e.jsxs("button",{onClick:r,className:"w-full flex items-center justify-between px-3 py-2.5 hover:bg-white/10 transition-colors text-left text-zinc-200 active:bg-white/5 focus:outline-none focus:bg-white/10 group overflow-hidden my-0.5",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[c&&e.jsx("span",{className:"text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors flex items-center justify-center w-4 h-4",children:e.jsx(rt,{content:c})}),e.jsx("span",{className:`font-medium truncate text-sm flex items-center ${s?"text-[var(--accent)]":""}`,title:typeof o=="string"?o:void 0,children:e.jsx(rt,{content:o})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-zinc-400 shrink-0",children:[t&&e.jsx("span",{className:"text-xs font-medium truncate max-w-[60px]",title:t,children:t}),s&&e.jsx(ve,{className:"w-4 h-4 text-[var(--accent)] shrink-0"}),n&&e.jsx("span",{className:"text-xs group-hover:translate-x-0.5 transition-transform text-zinc-500 shrink-0",children:"›"})]})]}),F=({label:o,onBack:t,rightAction:s})=>e.jsxs("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",style:{borderRadius:"var(--radius)"},children:[e.jsxs("button",{className:"flex items-center gap-2 hover:text-white transition-colors focus:outline-none",onClick:t,children:[e.jsx(Bs,{className:"w-3 h-3"}),e.jsx("span",{children:o})]}),s]}),nt=()=>e.jsx("div",{className:"h-px bg-white/5 mx-2 my-1"}),te=({content:o})=>typeof o=="string"?o.trim().startsWith("<")?e.jsx("span",{dangerouslySetInnerHTML:{__html:o}}):e.jsx("span",{children:o}):e.jsx(e.Fragment,{children:o}),U=({label:o,checked:t,onChange:s,icon:r,tooltip:n})=>e.jsxs("div",{className:"flex items-center justify-between py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r&&e.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4",children:e.jsx(te,{content:r})}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm text-zinc-300 font-medium group-hover:text-white transition-colors flex items-center",children:e.jsx(te,{content:o})}),n&&e.jsx("span",{className:"text-[10px] text-zinc-500",children:n})]})]}),e.jsx("button",{onClick:()=>s(!t),className:`w-11 h-6 shrink-0 transition-colors relative focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-zinc-900 ${t?"bg-[var(--accent)]":"bg-zinc-700"}`,style:{"--tw-ring-color":"var(--accent)",borderRadius:"var(--radius-full)",borderWidth:"var(--border-width)",borderColor:"rgba(255,255,255,0.1)"},children:e.jsx("div",{className:`absolute top-1/2 -translate-y-1/2 left-0.5 bg-white w-4 h-4 transition-transform shadow-sm ${t?"translate-x-5":"translate-x-0"}`,style:{borderRadius:"var(--radius-full)"}})})]}),ee=({label:o,value:t,min:s,max:r,step:n,onChange:c,formatValue:m,icon:b})=>e.jsxs("div",{className:"py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[b&&e.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4",children:e.jsx(te,{content:b})}),e.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:o})]}),e.jsx("span",{className:"text-[10px] font-mono font-medium text-zinc-300 bg-white/10 px-1.5 py-0.5 tabular-nums",style:{borderRadius:"var(--radius-sm)"},children:m?m(t):t})]}),e.jsxs("div",{className:"relative h-4 flex items-center px-1",children:[e.jsx("input",{type:"range",min:s,max:r,step:n,value:t,onChange:y=>c(parseFloat(y.target.value)),className:"w-full h-1.5 appearance-none cursor-pointer focus:outline-none focus:ring-2 strata-range-input",style:{borderRadius:"var(--radius-full)",background:`linear-gradient(to right, var(--accent) 0%, var(--accent) ${(t-s)/(r-s)*100}%, #3f3f46 ${(t-s)/(r-s)*100}%, #3f3f46 100%)`,"--tw-ring-color":"var(--accent)"}}),e.jsx("style",{children:`
220
220
  .strata-range-input::-webkit-slider-thumb {
221
221
  -webkit-appearance: none;
222
222
  height: 14px;
@@ -232,7 +232,7 @@
232
232
  transform: scale(1.1);
233
233
  }
234
234
  /* Pixel theme specific overrides are handled by global css */
235
- `})]})]}),ai=({label:o,value:t,options:s,onChange:r,icon:n})=>e.jsxs("div",{className:"py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n&&e.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4",children:e.jsx(te,{content:n})}),e.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:o})]}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:t,onChange:d=>r(d.target.value),className:"w-full bg-zinc-800 border-[length:var(--border-width)] border-white/10 px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:ring-2 appearance-none hover:bg-zinc-700 transition-colors cursor-pointer",style:{"--tw-ring-color":"var(--accent)",borderRadius:"var(--radius)"},children:s.map(d=>e.jsx("option",{value:d.value,children:d.label},d.value))}),e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-400",children:e.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),_=({title:o,children:t})=>e.jsxs("div",{className:"py-2",children:[o&&e.jsx("h4",{className:"px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2",children:o}),e.jsx("div",{className:"space-y-0.5",children:t})]}),oi=({tracks:o,current:t,onSelect:s,onUpload:r,onClose:n,settings:d,onSettingsChange:m,onReset:x,offset:y,onOffsetChange:l,maxHeight:b,animationClass:k})=>{const[j,z]=h.useState("main"),M=h.useRef(null);return e.jsxs(ut,{onClose:n,align:"right",maxHeight:b,className:k,children:[j==="main"&&e.jsxs("div",{className:"animate-in slide-in-from-left-4 fade-in duration-200",children:[e.jsx("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",style:{borderRadius:"var(--radius)"},children:e.jsx("span",{children:"Subtitles"})}),e.jsxs("div",{children:[e.jsx(C,{label:"Upload Subtitle",icon:e.jsx(As,{className:"w-4 h-4"}),onClick:()=>{var p;return(p=M.current)==null?void 0:p.click()}}),e.jsx("input",{type:"file",accept:".vtt,.srt",ref:M,className:"hidden",onChange:p=>{var I;(I=p.target.files)!=null&&I[0]&&r(p.target.files[0])}}),e.jsx(C,{label:"Customize",icon:e.jsx(Ws,{className:"w-4 h-4"}),onClick:()=>z("customize"),hasSubmenu:!0}),e.jsx("div",{className:"h-px bg-white/5 mx-2 my-1"}),e.jsx(C,{label:"Off",active:t===-1,onClick:()=>{s(-1),n()}}),o.map(p=>e.jsx(C,{label:p.label,value:p.language,active:t===p.index,onClick:()=>{s(p.index),n()}},p.index))]})]}),j==="customize"&&e.jsxs("div",{className:"animate-in slide-in-from-right-4 fade-in duration-200",children:[e.jsx(F,{label:"Customize",onBack:()=>z("main"),rightAction:e.jsx("button",{onClick:x,className:"p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10",title:"Reset All",children:e.jsx(Gs,{className:"w-4 h-4"})})}),e.jsxs("div",{className:"pb-1",children:[e.jsx(_,{children:e.jsx(U,{label:"Native Video Subtitle",checked:d.useNative,onChange:p=>m({useNative:p})})}),!d.useNative&&e.jsxs(e.Fragment,{children:[e.jsxs(_,{title:"Sync & Position",children:[e.jsxs("div",{className:"py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors",children:[e.jsx("div",{className:"flex justify-between items-center mb-2",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Os,{className:"w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors"}),e.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:"Sync Offset"})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>l(Math.round((y-.1)*10)/10),className:"w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",children:e.jsx(Hs,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 bg-zinc-900 border border-white/5 rounded-lg h-8 flex items-center justify-center text-xs font-mono font-medium text-[var(--accent)]",children:[y>0?"+":"",(y==null?void 0:y.toFixed(1))||"0.0","s"]}),e.jsx("button",{onClick:()=>l(Math.round((y+.1)*10)/10),className:"w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",children:e.jsx(qs,{className:"w-4 h-4"})})]})]}),e.jsx(ee,{label:"Vertical Position",icon:e.jsx(_s,{className:"w-4 h-4"}),value:d.verticalOffset,min:0,max:200,step:5,onChange:p=>m({verticalOffset:p}),formatValue:p=>`${p}px`})]}),e.jsxs(_,{title:"Appearance",children:[e.jsx(ee,{label:"Text Size",icon:e.jsx(Ds,{className:"w-4 h-4"}),value:d.textSize,min:50,max:200,step:10,onChange:p=>m({textSize:p}),formatValue:p=>`${p}%`}),e.jsxs("div",{className:"py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(dt,{className:"w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors"}),e.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:"Text Color"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg",children:[["#ffffff","#ffff00","#00ffff","#ff00ff","#ff0000","#00ff00"].map(p=>e.jsx("button",{onClick:()=>m({textColor:p}),className:`w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${d.textColor===p?"ring-2 scale-110":""}`,style:{backgroundColor:p,"--tw-ring-color":"var(--accent)"}},p)),e.jsx("div",{className:"w-px h-6 bg-white/10 mx-1"}),e.jsx("div",{className:"relative w-6 h-6 rounded-full overflow-hidden ring-1 ring-white/20 cursor-pointer",children:e.jsx("input",{type:"color",value:d.textColor,onChange:p=>m({textColor:p.target.value}),className:"absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"})})]})]}),e.jsx(ai,{label:"Text Style",value:d.textStyle,options:[{label:"None",value:"none"},{label:"Outline",value:"outline"},{label:"Raised",value:"raised"},{label:"Depressed",value:"depressed"},{label:"Drop Shadow",value:"shadow"}],onChange:p=>m({textStyle:p})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1 px-1",children:[e.jsx(U,{label:"Bold",icon:e.jsx(Qs,{className:"w-4 h-4"}),checked:d.isBold,onChange:p=>m({isBold:p})}),e.jsx(U,{label:"Fix Caps",icon:e.jsx(Xs,{className:"w-4 h-4"}),checked:d.fixCapitalization,onChange:p=>m({fixCapitalization:p})})]})]}),e.jsxs(_,{title:"Background",children:[e.jsx(ee,{label:"Opacity",icon:e.jsx(Us,{className:"w-4 h-4"}),value:d.backgroundOpacity,min:0,max:100,step:5,onChange:p=>m({backgroundOpacity:p}),formatValue:p=>`${p}%`}),e.jsx(U,{label:"Blur Background",icon:e.jsx(Js,{className:"w-4 h-4"}),checked:d.backgroundBlur,onChange:p=>m({backgroundBlur:p})}),d.backgroundBlur&&e.jsx(ee,{label:"Blur Intensity",value:d.backgroundBlurAmount,min:0,max:20,step:1,onChange:p=>m({backgroundBlurAmount:p}),formatValue:p=>`${p}px`})]})]})]})]})]})},fe=({content:o})=>typeof o=="string"?o.trim().startsWith("<")?e.jsx("span",{dangerouslySetInnerHTML:{__html:o}}):e.jsx("span",{children:o}):e.jsx(e.Fragment,{children:o}),li=({x:o,y:t,items:s,onClose:r,containerWidth:n,containerHeight:d})=>{const m=h.useRef(null),[x,y]=h.useState({top:t,left:o,opacity:0});return h.useLayoutEffect(()=>{if(!m.current)return;const l=m.current.getBoundingClientRect(),b=l.width,k=l.height;let j=o,z=t;o+b>n-10&&(j=o-b),j<10&&(j=10),j+b>n&&(j=Math.max(10,n-b-10)),t+k>d-10&&(z=t-k);let M=d-20;z<10&&(z=10),z+k>d-10&&(z=Math.max(10,d-k-10)),y({top:z,left:j,maxHeight:M,opacity:1})},[o,t,s,n,d]),h.useEffect(()=>{const l=b=>{m.current&&!m.current.contains(b.target)&&r()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),e.jsx("div",{ref:m,className:"absolute z-50 min-w-[200px] bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl p-1.5 font-[family-name:var(--font-main)] overflow-y-auto hide-scrollbar flex flex-col",style:{top:x.top,left:x.left,maxHeight:x.maxHeight,opacity:x.opacity,borderRadius:"var(--radius-lg)"},onClick:l=>l.stopPropagation(),children:s.map((l,b)=>l.separator?e.jsx("div",{className:"h-0 border-t border-white/10 mx-2 my-1.5"},b):l.isLabel?e.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none",children:e.jsx(fe,{content:l.html||""})},b):e.jsxs(h.Fragment,{children:[e.jsxs("button",{onClick:()=>{l.disabled||(l.click?l.click(r):l.onClick&&l.onClick(r))},disabled:l.disabled,className:"w-full text-left px-3 py-2.5 flex items-center justify-between hover:bg-white/10 focus:bg-white/10 focus:outline-none transition-colors text-sm text-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed group my-0.5",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[l.icon&&e.jsx("span",{className:"text-zinc-400 w-4 h-4 flex items-center justify-center shrink-0 group-hover:text-zinc-300 transition-colors",children:e.jsx(fe,{content:l.icon})}),e.jsx("span",{className:`flex items-center font-medium truncate ${l.checked?"text-[var(--accent)]":""}`,children:e.jsx(fe,{content:l.html||""})})]}),l.checked&&e.jsx(ve,{className:"w-4 h-4 text-[var(--accent)] shrink-0 ml-2"})]}),l.showBorder&&e.jsx("div",{className:"h-0 border-t border-white/10 mx-2 my-1"})]},b))})},ci=({player:o,onClose:t})=>{const[s,r]=h.useState({});return h.useEffect(()=>{const n=()=>{var y;if(!o.video)return;const m=o.video,x=m.getVideoPlaybackQuality?m.getVideoPlaybackQuality():null;r({"Player Size":`${m.offsetWidth} x ${m.offsetHeight}`,"Video Resolution":`${m.videoWidth} x ${m.videoHeight}`,"Current Time":`${m.currentTime.toFixed(3)}s`,Duration:`${m.duration.toFixed(3)}s`,Volume:`${Math.round(m.volume*100)}%`,"Dropped Frames":x?x.droppedVideoFrames:"N/A",Buffer:m.buffered.length>0?`${(m.buffered.end(m.buffered.length-1)-m.currentTime).toFixed(2)}s`:"0s",Engine:((y=o.store.get().sources[o.store.get().currentSourceIndex])==null?void 0:y.type)||"native",URL:m.currentSrc})};n();const d=setInterval(n,1e3);return()=>clearInterval(d)},[o]),e.jsx("div",{className:"absolute inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200",children:e.jsxs("div",{className:"bg-[var(--bg-panel)] border border-white/10 rounded-xl w-full max-w-md shadow-2xl relative font-mono text-xs text-zinc-300 flex flex-col",style:{borderRadius:"var(--radius)",maxHeight:"90%"},children:[e.jsxs("div",{className:"p-5 pb-0 flex-shrink-0 relative",children:[e.jsx("button",{onClick:n=>{n.stopPropagation(),t()},className:"absolute top-3 right-3 p-1.5 text-zinc-400 hover:text-white hover:bg-white/10 rounded-full transition-colors",children:e.jsx(si,{className:"w-4 h-4"})}),e.jsx("h3",{className:"text-sm font-bold text-white mb-4 uppercase tracking-wider border-b border-white/10 pb-2",children:"Video Statistics"})]}),e.jsx("div",{className:"overflow-y-auto hide-scrollbar p-5 pt-0 space-y-2.5 flex-1 min-h-0",children:Object.entries(s).map(([n,d])=>e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-1",children:[e.jsx("span",{className:"text-zinc-500 font-bold shrink-0",children:n}),e.jsx("span",{className:"text-zinc-200 truncate select-all font-medium bg-white/5 px-1.5 py-0.5 rounded break-all text-right",title:String(d),children:String(d)})]},n))})]})})},di=[{label:"Strata",value:"#6366f1"},{label:"Emerald",value:"#10b981"},{label:"Rose",value:"#f43f5e"},{label:"Amber",value:"#f59e0b"},{label:"Sky",value:"#0ea5e9"},{label:"Violet",value:"#8b5cf6"}],ui=[{label:"Default",value:"default",color:"#6366f1"},{label:"Pixel",value:"pixel",color:"#ef4444"},{label:"Game",value:"game",color:"#eab308"},{label:"Hacker",value:"hacker",color:"#22c55e"}],nt=({content:o,className:t,style:s})=>typeof o=="string"?o.trim().startsWith("<")?e.jsx("div",{className:t,style:s,dangerouslySetInnerHTML:{__html:o}}):e.jsx("div",{className:t,style:s,children:o}):e.jsx("div",{className:t,style:s,children:o}),xe=o=>{var Xe,Je;const{src:t,type:s,sources:r,poster:n,autoPlay:d,thumbnails:m,textTracks:x,plugins:y,...l}=o,b=l.screenshot??!1,k=l.pip??!0,j=l.setting??!0,z=l.fullscreen??!0,M=l.fullscreenWeb??!1,p=l.lock??!1,I=l.fastForward??!0,ht=l.flip??!0,mt=l.aspectRatio??!0,ge=l.hotKey??!0,ft=l.backdrop??!0,Q=h.useRef(null),[i,ye]=h.useState(null),[se,ie]=h.useState(!1),[we,pt]=h.useState(0),[xt,bt]=h.useState(0),ke=h.useMemo(()=>ot(l),[]),a=h.useSyncExternalStore(h.useCallback(c=>i?i.store.subscribe(c):()=>{},[i]),()=>i?i.store.get():ke,()=>ke),[T,P]=h.useState(!1),[R,B]=h.useState(!1),[L,N]=h.useState("main"),[G,re]=h.useState({x:0,y:0,visible:!1}),[vt,je]=h.useState(!1),Ce=Ye(T,200),Se=Ye(R,200),[ne,Ne]=h.useState(!1),[ae,ze]=h.useState(0),[gt,Me]=h.useState(!1),[yt,Te]=h.useState(!1),[oe,K]=h.useState(!1),[Re,Ie]=h.useState([]),[Le,$e]=h.useState(null),[wt,kt]=h.useState(0),[V,Ee]=h.useState(null),[q,Y]=h.useState(null),[mi,Pe]=h.useState(null),[le,Ae]=h.useState(!1),ce=h.useRef(null),Fe=h.useRef(1),X=h.useRef(null),O=h.useRef(null),de=h.useRef(null),ue=h.useRef(null),J=h.useRef(null);h.useEffect(()=>{if(!Q.current)return;const c=new lt(l);y&&y.length>0&&y.forEach(v=>c.use(v)),c.attach(Q.current),ye(c);const f=new ResizeObserver(v=>{for(const S of v)pt(S.contentRect.height),bt(S.contentRect.width)});return f.observe(Q.current),()=>{f.disconnect(),c.destroy(),ye(null)}},[]),h.useEffect(()=>{if(!i)return;const c={};l.theme!==void 0&&l.theme!==a.theme&&(c.theme=l.theme),l.themeColor!==void 0&&l.themeColor!==a.themeColor&&(c.themeColor=l.themeColor),l.iconSize!==void 0&&l.iconSize!==a.iconSize&&(c.iconSize=l.iconSize),Object.keys(c).length>0&&i.setAppearance(c),l.volume!==void 0&&Math.abs(l.volume-a.volume)>.01&&i.setVolume(l.volume),l.muted!==void 0&&l.muted!==a.isMuted&&(l.muted?i.video.muted=!0:i.video.muted=!1)},[i,l.theme,l.themeColor,l.iconSize,l.volume,l.muted]),h.useEffect(()=>{if(!i)return;const c=x||[];r&&r.length>0?(ie(!1),i.setSources(r,c)):t&&(ie(!1),i.setSources([{url:t,type:s||"auto"}],c))},[t,s,r,x,i]),h.useEffect(()=>{i&&d&&(i.video.muted=!0,i.store.setState({isMuted:!0}),i.play().catch(()=>{}))},[i,d]),h.useEffect(()=>{a.isPlaying&&!se&&ie(!0)},[a.isPlaying,se]),h.useEffect(()=>{m&&i?Vt(m,i.notify.bind(i)).then(c=>Ie(c)):Ie([])},[m,i]),h.useEffect(()=>(q&&(J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{Y(null)},600)),()=>{J.current&&clearTimeout(J.current)}),[q]),h.useEffect(()=>{const c=f=>{var v;if(!(!i||!ge)&&((v=document.activeElement)==null?void 0:v.tagName)!=="INPUT")switch(f.key.toLowerCase()){case" ":case"k":f.preventDefault(),i.togglePlay();break;case"arrowright":f.preventDefault(),i.skip(5);break;case"arrowleft":f.preventDefault(),i.skip(-5);break;case"arrowup":f.preventDefault(),i.setVolume(i.video.volume+.1);break;case"arrowdown":f.preventDefault(),i.setVolume(i.video.volume-.1);break;case"f":f.preventDefault(),i.toggleFullscreen();break;case"m":f.preventDefault(),i.toggleMute();break}};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[i,ge]);const Be=()=>{i&&(i.setControlsVisible(!0),O.current&&clearTimeout(O.current),!(T||R)&&(O.current=setTimeout(()=>{!a.isPlaying||T||R||i.setControlsVisible(!1)},2500)))};h.useEffect(()=>{i&&(!T&&!R&&a.isPlaying?Be():(T||R)&&(i.setControlsVisible(!0),O.current&&clearTimeout(O.current)))},[T,R,a.isPlaying,i]);const Ve=h.useCallback(()=>{!I||!i||!a.isPlaying||a.isLocked||(Fe.current=i.video.playbackRate,ce.current=setTimeout(()=>{i.video.playbackRate=2,Ae(!0)},500))},[I,i,a.isPlaying,a.isLocked]),Oe=h.useCallback(()=>{ce.current&&clearTimeout(ce.current),le&&i&&(i.video.playbackRate=Fe.current,Ae(!1))},[le,i]),he=c=>{if(!de.current||!a.duration)return 0;const f=de.current.getBoundingClientRect(),v="touches"in c?c.touches[0].clientX:c.clientX;return Math.max(0,Math.min(1,(v-f.left)/f.width))*a.duration},He=c=>{if(a.isLocked)return;Ne(!0),ze(he(c));const f=S=>ze(he(S)),v=S=>{i==null||i.seek(he(S)),Ne(!1),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",v),document.removeEventListener("touchend",v)};document.addEventListener("mousemove",f),document.addEventListener("touchmove",f),document.addEventListener("mouseup",v),document.addEventListener("touchend",v)},qe=c=>{if(!ue.current)return 0;const f=ue.current.getBoundingClientRect(),v="touches"in c?c.touches[0].clientX:c.clientX;return Math.max(0,Math.min(1,(v-f.left)/f.width))},We=c=>{if(!i||a.isLocked)return;Me(!0),i.setVolume(qe(c));const f=S=>i.setVolume(qe(S)),v=()=>{Me(!1),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",v),document.removeEventListener("touchend",v)};document.addEventListener("mousemove",f),document.addEventListener("touchmove",f),document.addEventListener("mouseup",v),document.addEventListener("touchend",v)},jt=c=>{if(!a.duration||a.isLive)return;const f=c.currentTarget.getBoundingClientRect(),v=(c.clientX-f.left)/f.width,S=v*a.duration;kt(v*100),$e(S),Re.length>0&&Ee(Re.find(H=>S>=H.start&&S<H.end)||null)},Z=c=>{!i||a.isLocked||(i.skip(c==="forward"?10:-10),Pe(c),setTimeout(()=>Pe(null),300))},Ct=c=>{if(!i||(T&&P(!1),R&&B(!1),oe&&K(!1),G.visible&&re({...G,visible:!1}),i.setControlsVisible(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{!a.isPlaying||T||R||i.setControlsVisible(!1)},2500),a.isLocked))return;const f=c.currentTarget.getBoundingClientRect(),v=c.clientX-f.left,S=f.width,H=Date.now();X.current?(clearTimeout(X.current),X.current=null,v<S*.35?(Z("rewind"),Y({type:"rewind",id:H})):v>S*.65?(Z("forward"),Y({type:"forward",id:H})):i.toggleFullscreen()):X.current=setTimeout(()=>{i.togglePlay(),X.current=null},250)},St=c=>{var v;if(c.preventDefault(),a.isLocked)return;const f=(v=Q.current)==null?void 0:v.getBoundingClientRect();f&&re({visible:!0,x:c.clientX-f.left,y:c.clientY-f.top})},Nt=c=>{c.stopPropagation();const f="ontouchstart"in window||navigator.maxTouchPoints>0,v=window.matchMedia("(hover: none)").matches||f;if(oe){K(!1);return}v?K(!0):i==null||i.toggleMute()},zt=a.isMuted||a.volume===0?Ts:a.volume<.5?Ms:zs,De=Math.max(100,we-120),Mt=()=>{switch(a.iconSize){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}},Tt=()=>{switch(a.iconSize){case"small":return"p-2 min-w-[32px] min-h-[32px]";case"large":return"p-3 min-w-[44px] min-h-[44px]";default:return"p-2.5 min-w-[36px] min-h-[36px]"}},$=Mt(),A=Tt(),W=(()=>{switch(a.iconSize){case"small":return{playBtn:"w-14 h-14",playIcon:"w-6 h-6",skipBtn:"w-10 h-10",skipIcon:"w-5 h-5"};case"large":return{playBtn:"w-24 h-24",playIcon:"w-12 h-12",skipBtn:"w-16 h-16",skipIcon:"w-8 h-8"};default:return{playBtn:"w-20 h-20",playIcon:"w-9 h-9",skipBtn:"w-12 h-12",skipIcon:"w-6 h-6"}}})(),Rt=!a.isLocked&&(a.controlsVisible||!a.isPlaying||T||R),Ue=yt||gt||oe,_e=ft?"backdrop-blur-xl bg-black/80":"bg-black/95",Ge=h.useMemo(()=>{const c=[{id:"play",position:"left",index:10,isBuiltIn:!0},{id:"volume",position:"left",index:20,isBuiltIn:!0},{id:"time",position:"left",index:30,isBuiltIn:!0},{id:"subtitle",position:"right",index:80,isBuiltIn:!0},{id:"screenshot",position:"right",index:85,isBuiltIn:!0},{id:"pip",position:"right",index:90,isBuiltIn:!0},{id:"download",position:"right",index:95,isBuiltIn:!0},{id:"settings",position:"right",index:100,isBuiltIn:!0},{id:"fullscreenWeb",position:"right",index:110,isBuiltIn:!0},{id:"fullscreen",position:"right",index:120,isBuiltIn:!0}];return l.controls&&l.controls.forEach(f=>{const v=c.find(S=>S.id===f.id);v?Object.assign(v,f):c.push(f)}),c.filter(f=>!(f.id==="screenshot"&&!b||f.id==="pip"&&!k||f.id==="settings"&&!j||f.id==="fullscreen"&&!z||f.id==="fullscreenWeb"&&!M)).sort((f,v)=>f.index-v.index)},[l.controls,b,k,j,z,M]),Qe=c=>{var f,v,S,H,Ke;if(!c.isBuiltIn)return e.jsx("button",{onClick:()=>{c.click?c.click(i):c.onClick&&c.onClick(i)},className:`strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none flex items-center justify-center ${A} ${c.className||""}`,style:{borderRadius:"var(--radius)",...c.style},title:c.tooltip,children:e.jsx(nt,{content:c.html||""})},c.index);switch(c.id){case"play":return e.jsx("button",{onClick:()=>i==null?void 0:i.togglePlay(),className:`strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:a.isPlaying?e.jsx(et,{className:`${$} fill-current`}):e.jsx(Ze,{className:`${$} fill-current`})},"play");case"volume":return e.jsxs("div",{className:"flex items-center gap-2 group/vol relative",onMouseEnter:()=>{window.matchMedia("(hover: hover)").matches&&Te(!0)},onMouseLeave:()=>{window.matchMedia("(hover: hover)").matches&&Te(!1)},children:[e.jsx("button",{onClick:Nt,className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:e.jsx(zt,{className:$})}),e.jsx("div",{className:`relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${Ue?"w-28 opacity-100 ml-1":"w-0 opacity-0"}`,children:e.jsxs("div",{ref:ue,className:"relative w-full h-full flex items-center cursor-pointer px-2",onMouseDown:We,onTouchStart:We,children:[e.jsx("div",{className:"w-full h-1 bg-white/20 overflow-hidden",style:{borderRadius:"var(--radius-full)"},children:e.jsx("div",{className:"h-full bg-white",style:{width:`${(a.isMuted?0:a.volume)*100}%`,borderRadius:"var(--radius-full)"}})}),e.jsx("div",{className:"absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none",style:{left:`calc(${(a.isMuted?0:a.volume)*100}% * 0.85 + 4px)`,borderRadius:"var(--radius-full)"}})]})}),Ue&&e.jsx("div",{className:"strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2",style:{left:`calc(52px + ${(a.isMuted?0:a.volume)*80}px)`},children:a.isMuted?"0%":`${Math.round(a.volume*100)}%`})]},"volume");case"time":return l.isLive?e.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 bg-red-500/10 border border-red-500/20 rounded-md",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),e.jsx("span",{className:"text-[10px] font-bold text-red-500 tracking-wider",children:"LIVE"})]},"live"):e.jsxs("div",{className:"text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums",children:[me(ne?ae:a.currentTime)," ",e.jsx("span",{className:"text-zinc-600",children:"/"})," ",me(a.duration)]},"time");case"subtitle":return e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:u=>{u.stopPropagation(),B(!R),P(!1)},className:`strata-control-btn transition-colors focus:outline-none ${A} ${R?"text-[var(--accent)] bg-white/10":"text-zinc-300 hover:text-white hover:bg-white/10"}`,style:{borderRadius:"var(--radius)"},children:e.jsx(Es,{className:$})}),Se.isMounted&&e.jsx(oi,{tracks:a.subtitleTracks,current:a.currentSubtitle,onSelect:u=>i==null?void 0:i.setSubtitle(u),onUpload:u=>i==null?void 0:i.addTextTrack(u,u.name),onClose:()=>B(!1),settings:a.subtitleSettings,onSettingsChange:u=>i==null?void 0:i.updateSubtitleSettings(u),onReset:()=>i==null?void 0:i.resetSubtitleSettings(),offset:a.subtitleOffset,onOffsetChange:u=>i==null?void 0:i.setSubtitleOffset(u),maxHeight:De,animationClass:`strata-backdrop ${_e} ${Se.isVisible?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-2 scale-95"}`})]},"subtitle");case"screenshot":return e.jsx("button",{onClick:()=>i==null?void 0:i.screenshot(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},title:"Screenshot",children:e.jsx(Ks,{className:$})},"ss");case"pip":return e.jsx("button",{onClick:()=>i==null?void 0:i.togglePip(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:e.jsx($s,{className:$})},"pip");case"download":return e.jsx("button",{onClick:()=>i==null?void 0:i.download(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:e.jsx(Ps,{className:$})},"dl");case"fullscreen":return e.jsx("button",{onClick:()=>i==null?void 0:i.toggleFullscreen(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform hover:scale-110 focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:a.isFullscreen?e.jsx(Is,{className:$}):e.jsx(Rs,{className:$})},"fs");case"fullscreenWeb":return e.jsx("button",{className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},title:"Web Fullscreen",children:e.jsx(ei,{className:$})},"fsw");case"settings":return e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:u=>{u.stopPropagation(),P(!T),B(!1),N("main")},className:`strata-control-btn transition-all duration-300 focus:outline-none ${A} ${T?"rotate-90 text-[var(--accent)] bg-white/10":"text-zinc-300 hover:text-white hover:bg-white/10"}`,style:{borderRadius:"var(--radius)"},children:e.jsx(Ls,{className:$})}),Ce.isMounted&&e.jsx(ut,{onClose:()=>P(!1),align:"right",maxHeight:De,className:`strata-backdrop ${_e} ${Ce.isVisible?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-2 scale-95"}`,children:e.jsxs("div",{className:"w-full",children:[L==="main"&&e.jsxs("div",{className:"animate-in slide-in-from-left-4 fade-in duration-200",children:[e.jsx("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",style:{borderRadius:"var(--radius)"},children:e.jsx("span",{children:"Settings"})}),a.sources.length>1&&e.jsx(C,{label:"Source",value:((f=a.sources[a.currentSourceIndex])==null?void 0:f.name)||`Source ${a.currentSourceIndex+1}`,onClick:()=>N("sources"),hasSubmenu:!0}),e.jsx(C,{label:"Speed",value:`${a.playbackRate}x`,onClick:()=>N("speed"),hasSubmenu:!0}),e.jsx(C,{label:"Quality",value:a.currentQuality===-1?"Auto":`${(v=a.qualityLevels[a.currentQuality])==null?void 0:v.height}p`,onClick:()=>N("quality"),hasSubmenu:!0}),e.jsx(C,{label:"Audio",value:((S=a.audioTracks[a.currentAudioTrack])==null?void 0:S.label)||"Default",onClick:()=>N("audio"),hasSubmenu:!0}),ht&&e.jsx(C,{label:"Flip",value:a.flipState.horizontal?"H":a.flipState.vertical?"V":"Normal",onClick:()=>N("flip"),hasSubmenu:!0}),mt&&e.jsx(C,{label:"Aspect Ratio",value:a.aspectRatio,onClick:()=>N("ratio"),hasSubmenu:!0}),e.jsx(rt,{}),e.jsx(C,{label:"Audio Boost",value:a.audioGain>1?`${a.audioGain}x`:"Off",onClick:()=>N("boost"),hasSubmenu:!0}),e.jsx(C,{label:"Watch Party",icon:e.jsx(Vs,{className:"w-4 h-4"}),onClick:()=>N("party"),hasSubmenu:!0}),e.jsx(C,{label:"Cast to Device",icon:e.jsx(Bs,{className:"w-4 h-4"}),onClick:()=>{i==null||i.requestCast(),P(!1)}}),(H=l.settings)==null?void 0:H.map((u,D)=>u.switch!==void 0?e.jsx("div",{className:"px-1",children:e.jsx(U,{label:u.html,icon:u.icon,checked:u.switch,tooltip:u.tooltip,onChange:pi=>{u.onSwitch&&u.onSwitch(u)}})},`cust-${D}`):e.jsx(C,{label:u.html,icon:u.icon,onClick:()=>{u.click?u.click():u.onClick&&u.onClick(),P(!1)}},`cust-${D}`)),e.jsx(rt,{}),e.jsx(C,{label:"Appearance",icon:e.jsx(dt,{className:"w-4 h-4"}),onClick:()=>N("appearance"),hasSubmenu:!0})]}),["speed","quality","audio","boost","party","appearance","sources","flip","ratio"].includes(L)&&e.jsxs("div",{className:"animate-in slide-in-from-right-4 fade-in duration-200",children:[L==="sources"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Select Source",onBack:()=>N("main")}),a.sources.map((u,D)=>e.jsx(C,{label:u.name||`Source ${D+1}`,value:u.type,active:a.currentSourceIndex===D,onClick:()=>i==null?void 0:i.switchSource(D)},D))]}),L==="speed"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Speed",onBack:()=>N("main")}),[.5,1,1.5,2].map(u=>e.jsx(C,{label:`${u}x`,active:a.playbackRate===u,onClick:()=>i.video.playbackRate=u},u))]}),L==="quality"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Quality",onBack:()=>N("main")}),e.jsx(C,{label:"Auto",active:a.currentQuality===-1,onClick:()=>i==null?void 0:i.setQuality(-1)}),a.qualityLevels.map(u=>e.jsx(C,{label:`${u.height}p`,value:`${Math.round(u.bitrate/1e3)}k`,active:a.currentQuality===u.index,onClick:()=>i==null?void 0:i.setQuality(u.index)},u.index))]}),L==="audio"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Audio Track",onBack:()=>N("main")}),a.audioTracks.length===0&&e.jsx("div",{className:"px-4 py-3 text-zinc-500 text-xs text-center",children:"No tracks available"}),a.audioTracks.map(u=>e.jsx(C,{label:u.label,value:u.language,active:a.currentAudioTrack===u.index,onClick:()=>i==null?void 0:i.setAudioTrack(u.index)},u.index))]}),L==="boost"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Audio Boost",onBack:()=>N("main")}),[1,1.5,2,3].map(u=>e.jsx(C,{label:u===1?"Off":`${u}x`,active:a.audioGain===u,onClick:()=>i==null?void 0:i.setAudioGain(u)},u))]}),L==="flip"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Video Flip",onBack:()=>N("main")}),e.jsxs("div",{className:"p-2 space-y-1",children:[e.jsx(U,{label:"Horizontal Flip",checked:a.flipState.horizontal,onChange:()=>i==null?void 0:i.setFlip("horizontal")}),e.jsx(U,{label:"Vertical Flip",checked:a.flipState.vertical,onChange:()=>i==null?void 0:i.setFlip("vertical")})]})]}),L==="ratio"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Aspect Ratio",onBack:()=>N("main")}),["default","16:9","4:3"].map(u=>e.jsx(C,{label:u==="default"?"Default":u,active:a.aspectRatio===u,onClick:()=>i==null?void 0:i.setAspectRatio(u)},u))]}),L==="party"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Watch Party",onBack:()=>N("main")}),e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-zinc-400 leading-relaxed",children:"Create a synchronized room on WatchParty.me to watch together."}),e.jsx("a",{href:`https://www.watchparty.me/create?video=${encodeURIComponent(((Ke=a.sources[a.currentSourceIndex])==null?void 0:Ke.url)||t||"")}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs",style:{borderRadius:"var(--radius)"},children:"Create Room"})]})]}),L==="appearance"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Appearance",onBack:()=>N("main")}),e.jsxs("div",{className:"pb-1",children:[e.jsx(_,{title:"Theme",children:e.jsx("div",{className:"grid grid-cols-2 gap-2 px-3",children:ui.map(u=>e.jsx("button",{onClick:()=>i==null?void 0:i.setAppearance({theme:u.value,themeColor:u.color}),className:`py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${a.theme===u.value?"bg-[var(--accent)] text-white":"bg-white/5 text-zinc-400 hover:text-white"}`,style:{borderRadius:"var(--radius)"},children:u.label},u.value))})}),e.jsx(_,{title:"Icon Size",children:e.jsx("div",{className:"grid grid-cols-3 gap-1 px-3",children:["small","medium","large"].map(u=>e.jsx("button",{onClick:()=>i==null?void 0:i.setAppearance({iconSize:u}),className:`py-1.5 text-xs font-medium transition-colors ${a.iconSize===u?"bg-white text-black":"bg-white/5 text-zinc-400 hover:text-zinc-200"}`,style:{borderRadius:"var(--radius)"},children:u.charAt(0).toUpperCase()+u.slice(1)},u))})}),e.jsxs(_,{title:"Theme Color",children:[e.jsx("div",{className:"grid grid-cols-6 gap-2 px-3",children:di.map(u=>e.jsx("button",{title:u.label,onClick:()=>i==null?void 0:i.setAppearance({themeColor:u.value}),className:`w-6 h-6 transition-transform hover:scale-110 ${a.themeColor===u.value?"ring-2 ring-white scale-110":"ring-1 ring-white/10"}`,style:{backgroundColor:u.value,borderRadius:"var(--radius-full)"},children:a.themeColor===u.value&&e.jsx(ve,{className:"w-3 h-3 text-white mx-auto stroke-[3]"})},u.value))}),e.jsx("div",{className:"px-3 pt-4",children:e.jsxs("div",{className:"flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group",style:{borderRadius:"var(--radius)"},children:[e.jsx("div",{className:"relative w-6 h-6 overflow-hidden ring-1 ring-white/20",style:{borderRadius:"var(--radius-full)"},children:e.jsx("input",{type:"color",value:a.themeColor,onChange:u=>i==null?void 0:i.setAppearance({themeColor:u.target.value}),className:"absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"})}),e.jsx("span",{className:"text-xs text-zinc-400 font-medium group-hover:text-zinc-200",children:"Custom Color"}),e.jsx("span",{className:"text-[10px] font-mono text-zinc-500 ml-auto uppercase",children:a.themeColor})]})})]})]})]})]})]})})]},"settings");default:return null}},It=h.useMemo(()=>{const c=[{html:"Playback",isLabel:!0},{html:"Loop",checked:a.isLooping,onClick:()=>i==null?void 0:i.toggleLoop()},{separator:!0},{html:"Transform",isLabel:!0},{html:"Flip Horizontal",onClick:()=>i==null?void 0:i.setFlip("horizontal")},{html:"Flip Vertical",onClick:()=>i==null?void 0:i.setFlip("vertical")},{separator:!0},{html:"Aspect Ratio",isLabel:!0},{html:"Default",checked:a.aspectRatio==="default",onClick:()=>i==null?void 0:i.setAspectRatio("default")},{html:"16:9",checked:a.aspectRatio==="16:9",onClick:()=>i==null?void 0:i.setAspectRatio("16:9")},{html:"4:3",checked:a.aspectRatio==="4:3",onClick:()=>i==null?void 0:i.setAspectRatio("4:3")},{separator:!0},{html:"Video Info",icon:e.jsx(ii,{className:"w-3.5 h-3.5"}),onClick:()=>je(!0)},{separator:!0}];return l.contextmenu&&c.push(...l.contextmenu),c.push({html:e.jsx("span",{className:"text-zinc-500 text-xs font-semibold tracking-wide",children:"StrataPlayer"}),disabled:!0}),c.push({html:"Close",onClick:f=>f(),icon:e.jsx("div",{className:"text-red-400",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})})}),c},[l.contextmenu,a.aspectRatio,a.isLooping,i]);return e.jsxs("div",{id:l.id,ref:Q,className:`group relative w-full h-full bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none rounded-[var(--radius)] text-zinc-100 strata-player-reset ${l.container||""}`,style:{touchAction:"manipulation","--accent":a.themeColor},onMouseMove:Be,onMouseLeave:()=>{a.isPlaying&&!T&&!R&&i&&i.setControlsVisible(!1)},onMouseDown:Ve,onMouseUp:Oe,onTouchStart:Ve,onTouchEnd:Oe,onContextMenu:St,tabIndex:0,role:"region","aria-label":"Video Player","data-theme":a.theme,children:[e.jsx("style",{children:`
235
+ `})]})]}),oi=({label:o,value:t,options:s,onChange:r,icon:n})=>e.jsxs("div",{className:"py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n&&e.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors flex items-center justify-center w-4 h-4",children:e.jsx(te,{content:n})}),e.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:o})]}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:t,onChange:c=>r(c.target.value),className:"w-full bg-zinc-800 border-[length:var(--border-width)] border-white/10 px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:ring-2 appearance-none hover:bg-zinc-700 transition-colors cursor-pointer",style:{"--tw-ring-color":"var(--accent)",borderRadius:"var(--radius)"},children:s.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))}),e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-400",children:e.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),_=({title:o,children:t})=>e.jsxs("div",{className:"py-2",children:[o&&e.jsx("h4",{className:"px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2",children:o}),e.jsx("div",{className:"space-y-0.5",children:t})]}),li=({tracks:o,current:t,onSelect:s,onUpload:r,onClose:n,settings:c,onSettingsChange:m,onReset:b,offset:y,onOffsetChange:x,maxHeight:d,animationClass:k})=>{const[j,z]=h.useState("main"),M=h.useRef(null);return e.jsxs(ht,{onClose:n,align:"right",maxHeight:d,className:k,children:[j==="main"&&e.jsxs("div",{className:"animate-in slide-in-from-left-4 fade-in duration-200",children:[e.jsx("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",style:{borderRadius:"var(--radius)"},children:e.jsx("span",{children:"Subtitles"})}),e.jsxs("div",{children:[e.jsx(C,{label:"Upload Subtitle",icon:e.jsx(Fs,{className:"w-4 h-4"}),onClick:()=>{var p;return(p=M.current)==null?void 0:p.click()}}),e.jsx("input",{type:"file",accept:".vtt,.srt",ref:M,className:"hidden",onChange:p=>{var E;(E=p.target.files)!=null&&E[0]&&r(p.target.files[0])}}),e.jsx(C,{label:"Customize",icon:e.jsx(Ds,{className:"w-4 h-4"}),onClick:()=>z("customize"),hasSubmenu:!0}),e.jsx("div",{className:"h-px bg-white/5 mx-2 my-1"}),e.jsx(C,{label:"Off",active:t===-1,onClick:()=>{s(-1),n()}}),o.map(p=>e.jsx(C,{label:p.label,value:p.language,active:t===p.index,onClick:()=>{s(p.index),n()}},p.index))]})]}),j==="customize"&&e.jsxs("div",{className:"animate-in slide-in-from-right-4 fade-in duration-200",children:[e.jsx(F,{label:"Customize",onBack:()=>z("main"),rightAction:e.jsx("button",{onClick:b,className:"p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10",title:"Reset All",children:e.jsx(Qs,{className:"w-4 h-4"})})}),e.jsxs("div",{className:"pb-1",children:[e.jsx(_,{children:e.jsx(U,{label:"Native Video Subtitle",checked:c.useNative,onChange:p=>m({useNative:p})})}),!c.useNative&&e.jsxs(e.Fragment,{children:[e.jsxs(_,{title:"Sync & Position",children:[e.jsxs("div",{className:"py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors",children:[e.jsx("div",{className:"flex justify-between items-center mb-2",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Hs,{className:"w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors"}),e.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:"Sync Offset"})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>x(Math.round((y-.1)*10)/10),className:"w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",children:e.jsx(qs,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 bg-zinc-900 border border-white/5 rounded-lg h-8 flex items-center justify-center text-xs font-mono font-medium text-[var(--accent)]",children:[y>0?"+":"",(y==null?void 0:y.toFixed(1))||"0.0","s"]}),e.jsx("button",{onClick:()=>x(Math.round((y+.1)*10)/10),className:"w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",children:e.jsx(Ws,{className:"w-4 h-4"})})]})]}),e.jsx(ee,{label:"Vertical Position",icon:e.jsx(Gs,{className:"w-4 h-4"}),value:c.verticalOffset,min:0,max:200,step:5,onChange:p=>m({verticalOffset:p}),formatValue:p=>`${p}px`})]}),e.jsxs(_,{title:"Appearance",children:[e.jsx(ee,{label:"Text Size",icon:e.jsx(Us,{className:"w-4 h-4"}),value:c.textSize,min:50,max:200,step:10,onChange:p=>m({textSize:p}),formatValue:p=>`${p}%`}),e.jsxs("div",{className:"py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(ut,{className:"w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors"}),e.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:"Text Color"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg",children:[["#ffffff","#ffff00","#00ffff","#ff00ff","#ff0000","#00ff00"].map(p=>e.jsx("button",{onClick:()=>m({textColor:p}),className:`w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${c.textColor===p?"ring-2 scale-110":""}`,style:{backgroundColor:p,"--tw-ring-color":"var(--accent)"}},p)),e.jsx("div",{className:"w-px h-6 bg-white/10 mx-1"}),e.jsx("div",{className:"relative w-6 h-6 rounded-full overflow-hidden ring-1 ring-white/20 cursor-pointer",children:e.jsx("input",{type:"color",value:c.textColor,onChange:p=>m({textColor:p.target.value}),className:"absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"})})]})]}),e.jsx(oi,{label:"Text Style",value:c.textStyle,options:[{label:"None",value:"none"},{label:"Outline",value:"outline"},{label:"Raised",value:"raised"},{label:"Depressed",value:"depressed"},{label:"Drop Shadow",value:"shadow"}],onChange:p=>m({textStyle:p})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1 px-1",children:[e.jsx(U,{label:"Bold",icon:e.jsx(Xs,{className:"w-4 h-4"}),checked:c.isBold,onChange:p=>m({isBold:p})}),e.jsx(U,{label:"Fix Caps",icon:e.jsx(Js,{className:"w-4 h-4"}),checked:c.fixCapitalization,onChange:p=>m({fixCapitalization:p})})]})]}),e.jsxs(_,{title:"Background",children:[e.jsx(ee,{label:"Opacity",icon:e.jsx(_s,{className:"w-4 h-4"}),value:c.backgroundOpacity,min:0,max:100,step:5,onChange:p=>m({backgroundOpacity:p}),formatValue:p=>`${p}%`}),e.jsx(U,{label:"Blur Background",icon:e.jsx(Ks,{className:"w-4 h-4"}),checked:c.backgroundBlur,onChange:p=>m({backgroundBlur:p})}),c.backgroundBlur&&e.jsx(ee,{label:"Blur Intensity",value:c.backgroundBlurAmount,min:0,max:20,step:1,onChange:p=>m({backgroundBlurAmount:p}),formatValue:p=>`${p}px`})]})]})]})]})]})},fe=({content:o})=>typeof o=="string"?o.trim().startsWith("<")?e.jsx("span",{dangerouslySetInnerHTML:{__html:o}}):e.jsx("span",{children:o}):e.jsx(e.Fragment,{children:o}),ci=({x:o,y:t,items:s,onClose:r,containerWidth:n,containerHeight:c})=>{const m=h.useRef(null),[b,y]=h.useState({top:t,left:o,opacity:0});return h.useLayoutEffect(()=>{if(!m.current)return;const x=m.current.getBoundingClientRect(),d=x.width,k=x.height;let j=o,z=t;o+d>n-10&&(j=o-d),j<10&&(j=10),j+d>n&&(j=Math.max(10,n-d-10)),t+k>c-10&&(z=t-k);let M=c-20;z<10&&(z=10),z+k>c-10&&(z=Math.max(10,c-k-10)),y({top:z,left:j,maxHeight:M,opacity:1})},[o,t,s,n,c]),h.useEffect(()=>{const x=d=>{m.current&&!m.current.contains(d.target)&&r()};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[r]),e.jsx("div",{ref:m,className:"absolute z-50 min-w-[200px] bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl p-1.5 font-[family-name:var(--font-main)] overflow-y-auto hide-scrollbar flex flex-col",style:{top:b.top,left:b.left,maxHeight:b.maxHeight,opacity:b.opacity,borderRadius:"var(--radius-lg)"},onClick:x=>x.stopPropagation(),children:s.map((x,d)=>x.separator?e.jsx("div",{className:"h-0 border-t border-white/10 mx-2 my-1.5"},d):x.isLabel?e.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold text-zinc-500 uppercase tracking-wider select-none",children:e.jsx(fe,{content:x.html||""})},d):e.jsxs(h.Fragment,{children:[e.jsxs("button",{onClick:()=>{x.disabled||(x.click?x.click(r):x.onClick&&x.onClick(r))},disabled:x.disabled,className:"w-full text-left px-3 py-2.5 flex items-center justify-between hover:bg-white/10 focus:bg-white/10 focus:outline-none transition-colors text-sm text-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed group my-0.5",style:{borderRadius:"var(--radius)"},children:[e.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[x.icon&&e.jsx("span",{className:"text-zinc-400 w-4 h-4 flex items-center justify-center shrink-0 group-hover:text-zinc-300 transition-colors",children:e.jsx(fe,{content:x.icon})}),e.jsx("span",{className:`flex items-center font-medium truncate ${x.checked?"text-[var(--accent)]":""}`,children:e.jsx(fe,{content:x.html||""})})]}),x.checked&&e.jsx(ve,{className:"w-4 h-4 text-[var(--accent)] shrink-0 ml-2"})]}),x.showBorder&&e.jsx("div",{className:"h-0 border-t border-white/10 mx-2 my-1"})]},d))})},di=({player:o,onClose:t})=>{const[s,r]=h.useState({});return h.useEffect(()=>{const n=()=>{var y;if(!o.video)return;const m=o.video,b=m.getVideoPlaybackQuality?m.getVideoPlaybackQuality():null;r({"Player Size":`${m.offsetWidth} x ${m.offsetHeight}`,"Video Resolution":`${m.videoWidth} x ${m.videoHeight}`,"Current Time":`${m.currentTime.toFixed(3)}s`,Duration:`${m.duration.toFixed(3)}s`,Volume:`${Math.round(m.volume*100)}%`,"Dropped Frames":b?b.droppedVideoFrames:"N/A",Buffer:m.buffered.length>0?`${(m.buffered.end(m.buffered.length-1)-m.currentTime).toFixed(2)}s`:"0s",Engine:((y=o.store.get().sources[o.store.get().currentSourceIndex])==null?void 0:y.type)||"native",URL:m.currentSrc})};n();const c=setInterval(n,1e3);return()=>clearInterval(c)},[o]),e.jsx("div",{className:"absolute inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200",children:e.jsxs("div",{className:"bg-[var(--bg-panel)] border border-white/10 rounded-xl w-full max-w-md shadow-2xl relative font-mono text-xs text-zinc-300 flex flex-col",style:{borderRadius:"var(--radius)",maxHeight:"90%"},children:[e.jsxs("div",{className:"p-5 pb-0 flex-shrink-0 relative",children:[e.jsx("button",{onClick:n=>{n.stopPropagation(),t()},className:"absolute top-3 right-3 p-1.5 text-zinc-400 hover:text-white hover:bg-white/10 rounded-full transition-colors",children:e.jsx(ii,{className:"w-4 h-4"})}),e.jsx("h3",{className:"text-sm font-bold text-white mb-4 uppercase tracking-wider border-b border-white/10 pb-2",children:"Video Statistics"})]}),e.jsx("div",{className:"overflow-y-auto hide-scrollbar p-5 pt-0 space-y-2.5 flex-1 min-h-0",children:Object.entries(s).map(([n,c])=>e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-1",children:[e.jsx("span",{className:"text-zinc-500 font-bold shrink-0",children:n}),e.jsx("span",{className:"text-zinc-200 truncate select-all font-medium bg-white/5 px-1.5 py-0.5 rounded break-all text-right",title:String(c),children:String(c)})]},n))})]})})},ui=[{label:"Strata",value:"#6366f1"},{label:"Emerald",value:"#10b981"},{label:"Rose",value:"#f43f5e"},{label:"Amber",value:"#f59e0b"},{label:"Sky",value:"#0ea5e9"},{label:"Violet",value:"#8b5cf6"}],hi=[{label:"Default",value:"default",color:"#6366f1"},{label:"Pixel",value:"pixel",color:"#ef4444"},{label:"Game",value:"game",color:"#eab308"},{label:"Hacker",value:"hacker",color:"#22c55e"}],at=({content:o,className:t,style:s})=>typeof o=="string"?o.trim().startsWith("<")?e.jsx("div",{className:t,style:s,dangerouslySetInnerHTML:{__html:o}}):e.jsx("div",{className:t,style:s,children:o}):e.jsx("div",{className:t,style:s,children:o}),xe=o=>{var Je,Ke;const{src:t,type:s,sources:r,poster:n,autoPlay:c,thumbnails:m,textTracks:b,plugins:y,onGetInstance:x,...d}=o,k=d.screenshot??!1,j=d.pip??!0,z=d.setting??!0,M=d.fullscreen??!0,p=d.fullscreenWeb??!1,E=d.lock??!1,ge=d.fastForward??!0,mt=d.flip??!0,ft=d.aspectRatio??!0,ye=d.hotKey??!0,pt=d.backdrop??!0,Q=h.useRef(null),[i,we]=h.useState(null),[se,ie]=h.useState(!1),[ke,xt]=h.useState(0),[bt,vt]=h.useState(0),je=h.useMemo(()=>lt(d),[]),a=h.useSyncExternalStore(h.useCallback(l=>i?i.store.subscribe(l):()=>{},[i]),()=>i?i.store.get():je,()=>je),[T,P]=h.useState(!1),[R,B]=h.useState(!1),[I,N]=h.useState("main"),[G,re]=h.useState({x:0,y:0,visible:!1}),[gt,Ce]=h.useState(!1),Se=Ze(T,200),Ne=Ze(R,200),[ne,ze]=h.useState(!1),[ae,Me]=h.useState(0),[yt,Te]=h.useState(!1),[wt,Re]=h.useState(!1),[oe,K]=h.useState(!1),[Ie,Le]=h.useState([]),[$e,Ee]=h.useState(null),[kt,jt]=h.useState(0),[V,Pe]=h.useState(null),[q,Y]=h.useState(null),[fi,Ae]=h.useState(null),[le,Fe]=h.useState(!1),ce=h.useRef(null),Be=h.useRef(1),X=h.useRef(null),O=h.useRef(null),de=h.useRef(null),ue=h.useRef(null),J=h.useRef(null);h.useEffect(()=>{if(!Q.current)return;const l=new ct(d);y&&y.length>0&&y.forEach(v=>l.use(v)),l.attach(Q.current),we(l),x&&x(l);const f=new ResizeObserver(v=>{for(const S of v)xt(S.contentRect.height),vt(S.contentRect.width)});return f.observe(Q.current),()=>{f.disconnect(),l.destroy(),we(null)}},[]),h.useEffect(()=>{if(!i)return;const l={};d.theme!==void 0&&d.theme!==a.theme&&(l.theme=d.theme),d.themeColor!==void 0&&d.themeColor!==a.themeColor&&(l.themeColor=d.themeColor),d.iconSize!==void 0&&d.iconSize!==a.iconSize&&(l.iconSize=d.iconSize),Object.keys(l).length>0&&i.setAppearance(l),d.volume!==void 0&&Math.abs(d.volume-a.volume)>.01&&i.setVolume(d.volume),d.muted!==void 0&&d.muted!==a.isMuted&&(d.muted?i.video.muted=!0:i.video.muted=!1)},[i,d.theme,d.themeColor,d.iconSize,d.volume,d.muted]),h.useEffect(()=>{if(!i)return;const l=b||[];r&&r.length>0?(ie(!1),i.setSources(r,l)):t&&(ie(!1),i.setSources([{url:t,type:s||"auto"}],l))},[t,s,r,b,i]),h.useEffect(()=>{i&&c&&(i.video.muted=!0,i.store.setState({isMuted:!0}),i.play().catch(()=>{}))},[i,c]),h.useEffect(()=>{a.isPlaying&&!se&&ie(!0)},[a.isPlaying,se]),h.useEffect(()=>{m&&i?Ot(m,i.notify.bind(i)).then(l=>Le(l)):Le([])},[m,i]),h.useEffect(()=>(q&&(J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{Y(null)},600)),()=>{J.current&&clearTimeout(J.current)}),[q]),h.useEffect(()=>{const l=f=>{var v;if(!(!i||!ye)&&((v=document.activeElement)==null?void 0:v.tagName)!=="INPUT")switch(f.key.toLowerCase()){case" ":case"k":f.preventDefault(),i.togglePlay();break;case"arrowright":f.preventDefault(),i.skip(5);break;case"arrowleft":f.preventDefault(),i.skip(-5);break;case"arrowup":f.preventDefault(),i.setVolume(i.video.volume+.1);break;case"arrowdown":f.preventDefault(),i.setVolume(i.video.volume-.1);break;case"f":f.preventDefault(),i.toggleFullscreen();break;case"m":f.preventDefault(),i.toggleMute();break}};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i,ye]);const Ve=()=>{i&&(i.setControlsVisible(!0),O.current&&clearTimeout(O.current),!(T||R)&&(O.current=setTimeout(()=>{!a.isPlaying||T||R||i.setControlsVisible(!1)},2500)))};h.useEffect(()=>{i&&(!T&&!R&&a.isPlaying?Ve():(T||R)&&(i.setControlsVisible(!0),O.current&&clearTimeout(O.current)))},[T,R,a.isPlaying,i]);const Oe=h.useCallback(()=>{!ge||!i||!a.isPlaying||a.isLocked||(Be.current=i.video.playbackRate,ce.current=setTimeout(()=>{i.video.playbackRate=2,Fe(!0)},500))},[ge,i,a.isPlaying,a.isLocked]),He=h.useCallback(()=>{ce.current&&clearTimeout(ce.current),le&&i&&(i.video.playbackRate=Be.current,Fe(!1))},[le,i]),he=l=>{if(!de.current||!a.duration)return 0;const f=de.current.getBoundingClientRect(),v="touches"in l?l.touches[0].clientX:l.clientX;return Math.max(0,Math.min(1,(v-f.left)/f.width))*a.duration},qe=l=>{if(a.isLocked)return;ze(!0),Me(he(l));const f=S=>Me(he(S)),v=S=>{i==null||i.seek(he(S)),ze(!1),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",v),document.removeEventListener("touchend",v)};document.addEventListener("mousemove",f),document.addEventListener("touchmove",f),document.addEventListener("mouseup",v),document.addEventListener("touchend",v)},We=l=>{if(!ue.current)return 0;const f=ue.current.getBoundingClientRect(),v="touches"in l?l.touches[0].clientX:l.clientX;return Math.max(0,Math.min(1,(v-f.left)/f.width))},De=l=>{if(!i||a.isLocked)return;Te(!0),i.setVolume(We(l));const f=S=>i.setVolume(We(S)),v=()=>{Te(!1),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",v),document.removeEventListener("touchend",v)};document.addEventListener("mousemove",f),document.addEventListener("touchmove",f),document.addEventListener("mouseup",v),document.addEventListener("touchend",v)},Ct=l=>{if(!a.duration||a.isLive)return;const f=l.currentTarget.getBoundingClientRect(),v=(l.clientX-f.left)/f.width,S=v*a.duration;jt(v*100),Ee(S),Ie.length>0&&Pe(Ie.find(H=>S>=H.start&&S<H.end)||null)},Z=l=>{!i||a.isLocked||(i.skip(l==="forward"?10:-10),Ae(l),setTimeout(()=>Ae(null),300))},St=l=>{if(!i||(T&&P(!1),R&&B(!1),oe&&K(!1),G.visible&&re({...G,visible:!1}),i.setControlsVisible(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{!a.isPlaying||T||R||i.setControlsVisible(!1)},2500),a.isLocked))return;const f=l.currentTarget.getBoundingClientRect(),v=l.clientX-f.left,S=f.width,H=Date.now();X.current?(clearTimeout(X.current),X.current=null,v<S*.35?(Z("rewind"),Y({type:"rewind",id:H})):v>S*.65?(Z("forward"),Y({type:"forward",id:H})):i.toggleFullscreen()):X.current=setTimeout(()=>{i.togglePlay(),X.current=null},250)},Nt=l=>{var v;if(l.preventDefault(),a.isLocked)return;const f=(v=Q.current)==null?void 0:v.getBoundingClientRect();f&&re({visible:!0,x:l.clientX-f.left,y:l.clientY-f.top})},zt=l=>{l.stopPropagation();const f="ontouchstart"in window||navigator.maxTouchPoints>0,v=window.matchMedia("(hover: none)").matches||f;if(oe){K(!1);return}v?K(!0):i==null||i.toggleMute()},Mt=a.isMuted||a.volume===0?Rs:a.volume<.5?Ts:Ms,Ue=Math.max(100,ke-120),Tt=()=>{switch(a.iconSize){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}},Rt=()=>{switch(a.iconSize){case"small":return"p-2 min-w-[32px] min-h-[32px]";case"large":return"p-3 min-w-[44px] min-h-[44px]";default:return"p-2.5 min-w-[36px] min-h-[36px]"}},L=Tt(),A=Rt(),W=(()=>{switch(a.iconSize){case"small":return{playBtn:"w-14 h-14",playIcon:"w-6 h-6",skipBtn:"w-10 h-10",skipIcon:"w-5 h-5"};case"large":return{playBtn:"w-24 h-24",playIcon:"w-12 h-12",skipBtn:"w-16 h-16",skipIcon:"w-8 h-8"};default:return{playBtn:"w-20 h-20",playIcon:"w-9 h-9",skipBtn:"w-12 h-12",skipIcon:"w-6 h-6"}}})(),It=!a.isLocked&&(a.controlsVisible||!a.isPlaying||T||R),_e=wt||yt||oe,Ge=pt?"backdrop-blur-xl bg-black/80":"bg-black/95",Qe=h.useMemo(()=>{const l=[{id:"play",position:"left",index:10,isBuiltIn:!0},{id:"volume",position:"left",index:20,isBuiltIn:!0},{id:"time",position:"left",index:30,isBuiltIn:!0},{id:"subtitle",position:"right",index:80,isBuiltIn:!0},{id:"screenshot",position:"right",index:85,isBuiltIn:!0},{id:"pip",position:"right",index:90,isBuiltIn:!0},{id:"download",position:"right",index:95,isBuiltIn:!0},{id:"settings",position:"right",index:100,isBuiltIn:!0},{id:"fullscreenWeb",position:"right",index:110,isBuiltIn:!0},{id:"fullscreen",position:"right",index:120,isBuiltIn:!0}];return d.controls&&d.controls.forEach(f=>{const v=l.find(S=>S.id===f.id);v?Object.assign(v,f):l.push(f)}),l.filter(f=>!(f.id==="screenshot"&&!k||f.id==="pip"&&!j||f.id==="settings"&&!z||f.id==="fullscreen"&&!M||f.id==="fullscreenWeb"&&!p)).sort((f,v)=>f.index-v.index)},[d.controls,k,j,z,M,p]),Xe=l=>{var f,v,S,H,Ye;if(!l.isBuiltIn)return e.jsx("button",{onClick:()=>{l.click?l.click(i):l.onClick&&l.onClick(i)},className:`strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none flex items-center justify-center ${A} ${l.className||""}`,style:{borderRadius:"var(--radius)",...l.style},title:l.tooltip,children:e.jsx(at,{content:l.html||""})},l.index);switch(l.id){case"play":return e.jsx("button",{onClick:()=>i==null?void 0:i.togglePlay(),className:`strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:a.isPlaying?e.jsx(tt,{className:`${L} fill-current`}):e.jsx(et,{className:`${L} fill-current`})},"play");case"volume":return e.jsxs("div",{className:"flex items-center gap-2 group/vol relative",onMouseEnter:()=>{window.matchMedia("(hover: hover)").matches&&Re(!0)},onMouseLeave:()=>{window.matchMedia("(hover: hover)").matches&&Re(!1)},children:[e.jsx("button",{onClick:zt,className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:e.jsx(Mt,{className:L})}),e.jsx("div",{className:`relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${_e?"w-28 opacity-100 ml-1":"w-0 opacity-0"}`,children:e.jsxs("div",{ref:ue,className:"relative w-full h-full flex items-center cursor-pointer px-2",onMouseDown:De,onTouchStart:De,children:[e.jsx("div",{className:"w-full h-1 bg-white/20 overflow-hidden",style:{borderRadius:"var(--radius-full)"},children:e.jsx("div",{className:"h-full bg-white",style:{width:`${(a.isMuted?0:a.volume)*100}%`,borderRadius:"var(--radius-full)"}})}),e.jsx("div",{className:"absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none",style:{left:`calc(${(a.isMuted?0:a.volume)*100}% * 0.85 + 4px)`,borderRadius:"var(--radius-full)"}})]})}),_e&&e.jsx("div",{className:"strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2",style:{left:`calc(52px + ${(a.isMuted?0:a.volume)*80}px)`},children:a.isMuted?"0%":`${Math.round(a.volume*100)}%`})]},"volume");case"time":return d.isLive?e.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 bg-red-500/10 border border-red-500/20 rounded-md",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),e.jsx("span",{className:"text-[10px] font-bold text-red-500 tracking-wider",children:"LIVE"})]},"live"):e.jsxs("div",{className:"text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums",children:[me(ne?ae:a.currentTime)," ",e.jsx("span",{className:"text-zinc-600",children:"/"})," ",me(a.duration)]},"time");case"subtitle":return e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:u=>{u.stopPropagation(),B(!R),P(!1)},className:`strata-control-btn transition-colors focus:outline-none ${A} ${R?"text-[var(--accent)] bg-white/10":"text-zinc-300 hover:text-white hover:bg-white/10"}`,style:{borderRadius:"var(--radius)"},children:e.jsx(Ps,{className:L})}),Ne.isMounted&&e.jsx(li,{tracks:a.subtitleTracks,current:a.currentSubtitle,onSelect:u=>i==null?void 0:i.setSubtitle(u),onUpload:u=>i==null?void 0:i.addTextTrack(u,u.name),onClose:()=>B(!1),settings:a.subtitleSettings,onSettingsChange:u=>i==null?void 0:i.updateSubtitleSettings(u),onReset:()=>i==null?void 0:i.resetSubtitleSettings(),offset:a.subtitleOffset,onOffsetChange:u=>i==null?void 0:i.setSubtitleOffset(u),maxHeight:Ue,animationClass:`strata-backdrop ${Ge} ${Ne.isVisible?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-2 scale-95"}`})]},"subtitle");case"screenshot":return e.jsx("button",{onClick:()=>i==null?void 0:i.screenshot(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},title:"Screenshot",children:e.jsx(Ys,{className:L})},"ss");case"pip":return e.jsx("button",{onClick:()=>i==null?void 0:i.togglePip(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:e.jsx(Es,{className:L})},"pip");case"download":return e.jsx("button",{onClick:()=>i==null?void 0:i.download(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:e.jsx(As,{className:L})},"dl");case"fullscreen":return e.jsx("button",{onClick:()=>i==null?void 0:i.toggleFullscreen(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform hover:scale-110 focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},children:a.isFullscreen?e.jsx(Ls,{className:L}):e.jsx(Is,{className:L})},"fs");case"fullscreenWeb":return e.jsx("button",{className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 hidden sm:block focus:outline-none ${A}`,style:{borderRadius:"var(--radius)"},title:"Web Fullscreen",children:e.jsx(ti,{className:L})},"fsw");case"settings":return e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:u=>{u.stopPropagation(),P(!T),B(!1),N("main")},className:`strata-control-btn transition-all duration-300 focus:outline-none ${A} ${T?"rotate-90 text-[var(--accent)] bg-white/10":"text-zinc-300 hover:text-white hover:bg-white/10"}`,style:{borderRadius:"var(--radius)"},children:e.jsx($s,{className:L})}),Se.isMounted&&e.jsx(ht,{onClose:()=>P(!1),align:"right",maxHeight:Ue,className:`strata-backdrop ${Ge} ${Se.isVisible?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-2 scale-95"}`,children:e.jsxs("div",{className:"w-full",children:[I==="main"&&e.jsxs("div",{className:"animate-in slide-in-from-left-4 fade-in duration-200",children:[e.jsx("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",style:{borderRadius:"var(--radius)"},children:e.jsx("span",{children:"Settings"})}),a.sources.length>1&&e.jsx(C,{label:"Source",value:((f=a.sources[a.currentSourceIndex])==null?void 0:f.name)||`Source ${a.currentSourceIndex+1}`,onClick:()=>N("sources"),hasSubmenu:!0}),e.jsx(C,{label:"Speed",value:`${a.playbackRate}x`,onClick:()=>N("speed"),hasSubmenu:!0}),e.jsx(C,{label:"Quality",value:a.currentQuality===-1?"Auto":`${(v=a.qualityLevels[a.currentQuality])==null?void 0:v.height}p`,onClick:()=>N("quality"),hasSubmenu:!0}),e.jsx(C,{label:"Audio",value:((S=a.audioTracks[a.currentAudioTrack])==null?void 0:S.label)||"Default",onClick:()=>N("audio"),hasSubmenu:!0}),mt&&e.jsx(C,{label:"Flip",value:a.flipState.horizontal?"H":a.flipState.vertical?"V":"Normal",onClick:()=>N("flip"),hasSubmenu:!0}),ft&&e.jsx(C,{label:"Aspect Ratio",value:a.aspectRatio,onClick:()=>N("ratio"),hasSubmenu:!0}),e.jsx(nt,{}),e.jsx(C,{label:"Audio Boost",value:a.audioGain>1?`${a.audioGain}x`:"Off",onClick:()=>N("boost"),hasSubmenu:!0}),e.jsx(C,{label:"Watch Party",icon:e.jsx(Os,{className:"w-4 h-4"}),onClick:()=>N("party"),hasSubmenu:!0}),e.jsx(C,{label:"Cast to Device",icon:e.jsx(Vs,{className:"w-4 h-4"}),onClick:()=>{i==null||i.requestCast(),P(!1)}}),(H=d.settings)==null?void 0:H.map((u,D)=>u.switch!==void 0?e.jsx("div",{className:"px-1",children:e.jsx(U,{label:u.html,icon:u.icon,checked:u.switch,tooltip:u.tooltip,onChange:xi=>{u.onSwitch&&u.onSwitch(u)}})},`cust-${D}`):e.jsx(C,{label:u.html,icon:u.icon,onClick:()=>{u.click?u.click():u.onClick&&u.onClick(),P(!1)}},`cust-${D}`)),e.jsx(nt,{}),e.jsx(C,{label:"Appearance",icon:e.jsx(ut,{className:"w-4 h-4"}),onClick:()=>N("appearance"),hasSubmenu:!0})]}),["speed","quality","audio","boost","party","appearance","sources","flip","ratio"].includes(I)&&e.jsxs("div",{className:"animate-in slide-in-from-right-4 fade-in duration-200",children:[I==="sources"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Select Source",onBack:()=>N("main")}),a.sources.map((u,D)=>e.jsx(C,{label:u.name||`Source ${D+1}`,value:u.type,active:a.currentSourceIndex===D,onClick:()=>i==null?void 0:i.switchSource(D)},D))]}),I==="speed"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Speed",onBack:()=>N("main")}),[.5,1,1.5,2].map(u=>e.jsx(C,{label:`${u}x`,active:a.playbackRate===u,onClick:()=>i.video.playbackRate=u},u))]}),I==="quality"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Quality",onBack:()=>N("main")}),e.jsx(C,{label:"Auto",active:a.currentQuality===-1,onClick:()=>i==null?void 0:i.setQuality(-1)}),a.qualityLevels.map(u=>e.jsx(C,{label:`${u.height}p`,value:`${Math.round(u.bitrate/1e3)}k`,active:a.currentQuality===u.index,onClick:()=>i==null?void 0:i.setQuality(u.index)},u.index))]}),I==="audio"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Audio Track",onBack:()=>N("main")}),a.audioTracks.length===0&&e.jsx("div",{className:"px-4 py-3 text-zinc-500 text-xs text-center",children:"No tracks available"}),a.audioTracks.map(u=>e.jsx(C,{label:u.label,value:u.language,active:a.currentAudioTrack===u.index,onClick:()=>i==null?void 0:i.setAudioTrack(u.index)},u.index))]}),I==="boost"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Audio Boost",onBack:()=>N("main")}),[1,1.5,2,3].map(u=>e.jsx(C,{label:u===1?"Off":`${u}x`,active:a.audioGain===u,onClick:()=>i==null?void 0:i.setAudioGain(u)},u))]}),I==="flip"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Video Flip",onBack:()=>N("main")}),e.jsxs("div",{className:"p-2 space-y-1",children:[e.jsx(U,{label:"Horizontal Flip",checked:a.flipState.horizontal,onChange:()=>i==null?void 0:i.setFlip("horizontal")}),e.jsx(U,{label:"Vertical Flip",checked:a.flipState.vertical,onChange:()=>i==null?void 0:i.setFlip("vertical")})]})]}),I==="ratio"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Aspect Ratio",onBack:()=>N("main")}),["default","16:9","4:3"].map(u=>e.jsx(C,{label:u==="default"?"Default":u,active:a.aspectRatio===u,onClick:()=>i==null?void 0:i.setAspectRatio(u)},u))]}),I==="party"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Watch Party",onBack:()=>N("main")}),e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-zinc-400 leading-relaxed",children:"Create a synchronized room on WatchParty.me to watch together."}),e.jsx("a",{href:`https://www.watchparty.me/create?video=${encodeURIComponent(((Ye=a.sources[a.currentSourceIndex])==null?void 0:Ye.url)||t||"")}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs",style:{borderRadius:"var(--radius)"},children:"Create Room"})]})]}),I==="appearance"&&e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Appearance",onBack:()=>N("main")}),e.jsxs("div",{className:"pb-1",children:[e.jsx(_,{title:"Theme",children:e.jsx("div",{className:"grid grid-cols-2 gap-2 px-3",children:hi.map(u=>e.jsx("button",{onClick:()=>i==null?void 0:i.setAppearance({theme:u.value,themeColor:u.color}),className:`py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${a.theme===u.value?"bg-[var(--accent)] text-white":"bg-white/5 text-zinc-400 hover:text-white"}`,style:{borderRadius:"var(--radius)"},children:u.label},u.value))})}),e.jsx(_,{title:"Icon Size",children:e.jsx("div",{className:"grid grid-cols-3 gap-1 px-3",children:["small","medium","large"].map(u=>e.jsx("button",{onClick:()=>i==null?void 0:i.setAppearance({iconSize:u}),className:`py-1.5 text-xs font-medium transition-colors ${a.iconSize===u?"bg-white text-black":"bg-white/5 text-zinc-400 hover:text-zinc-200"}`,style:{borderRadius:"var(--radius)"},children:u.charAt(0).toUpperCase()+u.slice(1)},u))})}),e.jsxs(_,{title:"Theme Color",children:[e.jsx("div",{className:"grid grid-cols-6 gap-2 px-3",children:ui.map(u=>e.jsx("button",{title:u.label,onClick:()=>i==null?void 0:i.setAppearance({themeColor:u.value}),className:`w-6 h-6 transition-transform hover:scale-110 ${a.themeColor===u.value?"ring-2 ring-white scale-110":"ring-1 ring-white/10"}`,style:{backgroundColor:u.value,borderRadius:"var(--radius-full)"},children:a.themeColor===u.value&&e.jsx(ve,{className:"w-3 h-3 text-white mx-auto stroke-[3]"})},u.value))}),e.jsx("div",{className:"px-3 pt-4",children:e.jsxs("div",{className:"flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group",style:{borderRadius:"var(--radius)"},children:[e.jsx("div",{className:"relative w-6 h-6 overflow-hidden ring-1 ring-white/20",style:{borderRadius:"var(--radius-full)"},children:e.jsx("input",{type:"color",value:a.themeColor,onChange:u=>i==null?void 0:i.setAppearance({themeColor:u.target.value}),className:"absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"})}),e.jsx("span",{className:"text-xs text-zinc-400 font-medium group-hover:text-zinc-200",children:"Custom Color"}),e.jsx("span",{className:"text-[10px] font-mono text-zinc-500 ml-auto uppercase",children:a.themeColor})]})})]})]})]})]})]})})]},"settings");default:return null}},Lt=h.useMemo(()=>{const l=[{html:"Playback",isLabel:!0},{html:"Loop",checked:a.isLooping,onClick:()=>i==null?void 0:i.toggleLoop()},{separator:!0},{html:"Transform",isLabel:!0},{html:"Flip Horizontal",onClick:()=>i==null?void 0:i.setFlip("horizontal")},{html:"Flip Vertical",onClick:()=>i==null?void 0:i.setFlip("vertical")},{separator:!0},{html:"Aspect Ratio",isLabel:!0},{html:"Default",checked:a.aspectRatio==="default",onClick:()=>i==null?void 0:i.setAspectRatio("default")},{html:"16:9",checked:a.aspectRatio==="16:9",onClick:()=>i==null?void 0:i.setAspectRatio("16:9")},{html:"4:3",checked:a.aspectRatio==="4:3",onClick:()=>i==null?void 0:i.setAspectRatio("4:3")},{separator:!0},{html:"Video Info",icon:e.jsx(ri,{className:"w-3.5 h-3.5"}),onClick:()=>Ce(!0)},{separator:!0}];return d.contextmenu&&l.push(...d.contextmenu),l.push({html:e.jsx("span",{className:"text-zinc-500 text-xs font-semibold tracking-wide",children:"StrataPlayer"}),disabled:!0}),l.push({html:"Close",onClick:f=>f(),icon:e.jsx("div",{className:"text-red-400",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})})}),l},[d.contextmenu,a.aspectRatio,a.isLooping,i]);return e.jsxs("div",{id:d.id,ref:Q,className:`group relative w-full h-full bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none rounded-[var(--radius)] text-zinc-100 strata-player-reset ${d.container||""}`,style:{touchAction:"manipulation","--accent":a.themeColor},onMouseMove:Ve,onMouseLeave:()=>{a.isPlaying&&!T&&!R&&i&&i.setControlsVisible(!1)},onMouseDown:Oe,onMouseUp:He,onTouchStart:Oe,onTouchEnd:He,onContextMenu:Nt,tabIndex:0,role:"region","aria-label":"Video Player","data-theme":a.theme,children:[e.jsx("style",{children:`
236
236
  [data-theme="default"] {
237
237
  --radius: 0.75rem;
238
238
  --radius-lg: 0.75rem;
@@ -325,5 +325,5 @@
325
325
  /* Override Backdrop for specific themes if needed */
326
326
  [data-theme="pixel"] .strata-backdrop { backdrop-filter: none; background: #000; }
327
327
  [data-theme="hacker"] .strata-backdrop { backdrop-filter: none; background: #000; }
328
- `}),a.theme==="hacker"&&e.jsx("div",{className:"strata-scanlines"}),!i&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-zinc-950 z-50",children:e.jsx(pe,{className:"w-10 h-10 text-[var(--accent)] animate-spin"})}),i&&e.jsxs(e.Fragment,{children:[(Xe=l.layers)==null?void 0:Xe.map((c,f)=>e.jsx("div",{className:`absolute inset-0 pointer-events-none z-10 ${c.className||""}`,style:c.style,children:e.jsx(nt,{content:c.html||"",className:"w-full h-full"})},f)),e.jsx(ri,{notifications:a.notifications}),e.jsx(ni,{cues:a.activeCues,settings:a.subtitleSettings}),e.jsx("div",{className:"absolute inset-0 z-0",onClick:Ct,"aria-hidden":"true"}),n&&!se&&e.jsx("div",{className:"absolute inset-0 bg-cover bg-center z-[5] pointer-events-none",style:{backgroundImage:`url(${n})`}}),G.visible&&e.jsx(li,{x:G.x,y:G.y,items:It,onClose:()=>re({...G,visible:!1}),containerWidth:xt,containerHeight:we}),vt&&i&&e.jsx(ci,{player:i,onClose:()=>je(!1)}),le&&e.jsxs("div",{className:"absolute top-8 left-1/2 -translate-x-1/2 bg-black/50 backdrop-blur-md px-4 py-2 rounded-full flex items-center gap-2 z-40 animate-in fade-in zoom-in duration-200",children:[e.jsx(ti,{className:"w-4 h-4 text-[var(--accent)] fill-current"}),e.jsx("span",{className:"text-xs font-bold tracking-wider",children:"2x Speed"})]}),p&&a.controlsVisible&&e.jsx("button",{onClick:c=>{c.stopPropagation(),i.toggleLock()},className:`absolute left-4 md:left-6 bottom-24 md:bottom-28 z-50 p-3 rounded-full bg-black/50 backdrop-blur-md border border-white/10 text-white transition-all active:scale-95 ${a.isLocked?"text-[var(--accent)] bg-white/10":"hover:bg-white/10"}`,children:a.isLocked?e.jsx(Ys,{className:"w-5 h-5"}):e.jsx(Zs,{className:"w-5 h-5"})}),q&&e.jsx("div",{className:`absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 fill-mode-forwards ${q.type==="rewind"?"left-0 rounded-r-[4rem]":"right-0 rounded-l-[4rem]"}`,onAnimationEnd:()=>Y(null),children:e.jsxs("div",{className:"flex flex-col items-center text-white drop-shadow-lg",children:[q.type==="rewind"?e.jsx(tt,{className:"w-12 h-12 animate-pulse"}):e.jsx(st,{className:"w-12 h-12 animate-pulse"}),e.jsx("span",{className:"font-bold text-sm mt-2 font-mono",children:q.type==="rewind"?"-10s":"+10s"})]})},q.id),a.isBuffering&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:e.jsx(pe,{className:"w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg"})}),a.error&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-30 bg-black/90 backdrop-blur-md animate-in fade-in",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-red-500 p-8 max-w-md text-center",children:[e.jsx("span",{className:"text-5xl mb-2",children:"⚠️"}),e.jsx("h3",{className:"text-xl font-bold text-white",children:"Playback Error"}),e.jsx("p",{className:"text-zinc-400 text-sm",children:a.error}),e.jsx("button",{onClick:()=>i.load(i.store.get().sources[i.store.get().currentSourceIndex]||{url:t||""},x),className:"px-6 py-2 bg-[var(--accent)] text-white font-medium rounded-full hover:opacity-90 transition-opacity mt-4 shadow-lg",children:"Try Again"})]})}),!a.isLocked&&(!a.isPlaying&&!a.isBuffering&&!a.error||a.controlsVisible)&&!a.isBuffering?e.jsx("div",{className:`absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${a.controlsVisible||!a.isPlaying?"opacity-100":"opacity-0"}`,children:e.jsxs("div",{className:"flex items-center gap-8 md:gap-16 pointer-events-auto",children:[e.jsx("button",{onClick:c=>{c.stopPropagation(),P(!1),B(!1),Z("rewind")},className:`group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-110 text-white/90 focus:outline-none backdrop-blur-sm ${W.skipBtn}`,children:e.jsx(tt,{className:W.skipIcon})}),e.jsx("button",{onClick:c=>{c.stopPropagation(),P(!1),B(!1),i.togglePlay()},className:`group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all hover:scale-105 active:scale-110 duration-75 focus:outline-none backdrop-blur-md ${W.playBtn}`,children:a.isPlaying?e.jsx(et,{className:`${W.playIcon} text-white fill-current`}):e.jsx(Ze,{className:`${W.playIcon} text-white ml-1 fill-current`})}),e.jsx("button",{onClick:c=>{c.stopPropagation(),P(!1),B(!1),Z("forward")},className:`group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-110 text-white/90 focus:outline-none backdrop-blur-sm ${W.skipBtn}`,children:e.jsx(st,{className:W.skipIcon})})]})}):null,e.jsxs("div",{className:`absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 pb-4 md:pb-6 pt-24 bg-gradient-to-t from-black/95 via-black/70 to-transparent ${Rt?"opacity-100 translate-y-0":"opacity-0 translate-y-4 pointer-events-none"}`,onClick:c=>{c.target===c.currentTarget&&(P(!1),B(!1),K(!1)),c.stopPropagation()},children:[!l.isLive&&e.jsxs("div",{ref:de,className:"relative w-full h-3 group/slider mb-3 cursor-pointer touch-none flex items-center",onMouseMove:jt,onMouseLeave:()=>{$e(null),Ee(null)},onMouseDown:He,onTouchStart:He,children:[(Je=l.highlight)==null?void 0:Je.map((c,f)=>e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 w-1.5 h-1.5 bg-yellow-400 rounded-full z-10 pointer-events-none",style:{left:`${c.time/a.duration*100}%`},title:c.text},f)),Le!==null&&e.jsxs("div",{className:"absolute bottom-full mb-1.5 flex flex-col items-center transform -translate-x-1/2 z-40 pointer-events-none transition-opacity duration-150",style:{left:`clamp(70px, ${wt}%, calc(100% - 70px))`},children:[V&&e.jsx("div",{className:"bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm",style:{width:`${V.w*.5}px`,height:`${V.h*.5}px`,borderRadius:"var(--radius)"},children:e.jsx("div",{style:{backgroundImage:`url("${V.url}")`,width:`${V.w}px`,height:`${V.h}px`,backgroundPosition:`-${V.x}px -${V.y}px`,backgroundRepeat:"no-repeat",transform:"scale(0.5)",transformOrigin:"top left"}})}),e.jsx("div",{className:"strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1",children:me(Le)})]}),e.jsxs("div",{className:"w-full h-1 bg-white/20 overflow-hidden relative backdrop-blur-sm border-[length:var(--border-width)] border-white/10",style:{borderRadius:"var(--radius-full)"},children:[a.duration>0&&a.buffered.map((c,f)=>e.jsx("div",{className:"absolute top-0 bottom-0 bg-white/20",style:{left:`${c.start/a.duration*100}%`,width:`${(c.end-c.start)/a.duration*100}%`}},f)),e.jsx("div",{className:"absolute left-0 top-0 bottom-0 bg-[var(--accent)]",style:{width:`${(ne?ae:a.currentTime)/a.duration*100}%`}})]}),e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3.5 h-3.5 bg-white shadow-md scale-0 group-hover/slider:scale-100 transition-transform duration-100 z-10",style:{left:`${(ne?ae:a.currentTime)/a.duration*100}%`,borderRadius:"var(--radius-full)"}})]}),e.jsxs("div",{className:"flex items-center justify-between pointer-events-auto",children:[e.jsx("div",{className:"flex items-center gap-3",children:Ge.filter(c=>c.position==="left"||c.position==="center").map(Qe)}),e.jsx("div",{className:"flex items-center gap-1",children:Ge.filter(c=>c.position==="right").map(Qe)})]})]})]})]})},hi=(o,t)=>{const s=Et.createRoot(o);return s.render(h.createElement(xe,t)),{unmount:()=>{s.unmount()},update:r=>{s.render(h.createElement(xe,{...t,...r}))}}};exports.StrataCore=lt;exports.StrataPlayer=xe;exports.mountStrataPlayer=hi;
328
+ `}),a.theme==="hacker"&&e.jsx("div",{className:"strata-scanlines"}),!i&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-zinc-950 z-50",children:e.jsx(pe,{className:"w-10 h-10 text-[var(--accent)] animate-spin"})}),i&&e.jsxs(e.Fragment,{children:[(Je=d.layers)==null?void 0:Je.map((l,f)=>e.jsx("div",{className:`absolute inset-0 pointer-events-none z-10 ${l.className||""}`,style:l.style,children:e.jsx(at,{content:l.html||"",className:"w-full h-full"})},f)),e.jsx(ni,{notifications:a.notifications}),e.jsx(ai,{cues:a.activeCues,settings:a.subtitleSettings}),e.jsx("div",{className:"absolute inset-0 z-0",onClick:St,"aria-hidden":"true"}),n&&!se&&e.jsx("div",{className:"absolute inset-0 bg-cover bg-center z-[5] pointer-events-none",style:{backgroundImage:`url(${n})`}}),G.visible&&e.jsx(ci,{x:G.x,y:G.y,items:Lt,onClose:()=>re({...G,visible:!1}),containerWidth:bt,containerHeight:ke}),gt&&i&&e.jsx(di,{player:i,onClose:()=>Ce(!1)}),le&&e.jsxs("div",{className:"absolute top-8 left-1/2 -translate-x-1/2 bg-black/50 backdrop-blur-md px-4 py-2 rounded-full flex items-center gap-2 z-40 animate-in fade-in zoom-in duration-200",children:[e.jsx(si,{className:"w-4 h-4 text-[var(--accent)] fill-current"}),e.jsx("span",{className:"text-xs font-bold tracking-wider",children:"2x Speed"})]}),E&&a.controlsVisible&&e.jsx("button",{onClick:l=>{l.stopPropagation(),i.toggleLock()},className:`absolute left-4 md:left-6 bottom-24 md:bottom-28 z-50 p-3 rounded-full bg-black/50 backdrop-blur-md border border-white/10 text-white transition-all active:scale-95 ${a.isLocked?"text-[var(--accent)] bg-white/10":"hover:bg-white/10"}`,children:a.isLocked?e.jsx(Zs,{className:"w-5 h-5"}):e.jsx(ei,{className:"w-5 h-5"})}),q&&e.jsx("div",{className:`absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 fill-mode-forwards ${q.type==="rewind"?"left-0 rounded-r-[4rem]":"right-0 rounded-l-[4rem]"}`,onAnimationEnd:()=>Y(null),children:e.jsxs("div",{className:"flex flex-col items-center text-white drop-shadow-lg",children:[q.type==="rewind"?e.jsx(st,{className:"w-12 h-12 animate-pulse"}):e.jsx(it,{className:"w-12 h-12 animate-pulse"}),e.jsx("span",{className:"font-bold text-sm mt-2 font-mono",children:q.type==="rewind"?"-10s":"+10s"})]})},q.id),a.isBuffering&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:e.jsx(pe,{className:"w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg"})}),a.error&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-30 bg-black/90 backdrop-blur-md animate-in fade-in",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-red-500 p-8 max-w-md text-center",children:[e.jsx("span",{className:"text-5xl mb-2",children:"⚠️"}),e.jsx("h3",{className:"text-xl font-bold text-white",children:"Playback Error"}),e.jsx("p",{className:"text-zinc-400 text-sm",children:a.error}),e.jsx("button",{onClick:()=>i.load(i.store.get().sources[i.store.get().currentSourceIndex]||{url:t||""},b),className:"px-6 py-2 bg-[var(--accent)] text-white font-medium rounded-full hover:opacity-90 transition-opacity mt-4 shadow-lg",children:"Try Again"})]})}),!a.isLocked&&(!a.isPlaying&&!a.isBuffering&&!a.error||a.controlsVisible)&&!a.isBuffering?e.jsx("div",{className:`absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${a.controlsVisible||!a.isPlaying?"opacity-100":"opacity-0"}`,children:e.jsxs("div",{className:"flex items-center gap-8 md:gap-16 pointer-events-auto",children:[e.jsx("button",{onClick:l=>{l.stopPropagation(),P(!1),B(!1),Z("rewind")},className:`group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-110 text-white/90 focus:outline-none backdrop-blur-sm ${W.skipBtn}`,children:e.jsx(st,{className:W.skipIcon})}),e.jsx("button",{onClick:l=>{l.stopPropagation(),P(!1),B(!1),i.togglePlay()},className:`group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all hover:scale-105 active:scale-110 duration-75 focus:outline-none backdrop-blur-md ${W.playBtn}`,children:a.isPlaying?e.jsx(tt,{className:`${W.playIcon} text-white fill-current`}):e.jsx(et,{className:`${W.playIcon} text-white ml-1 fill-current`})}),e.jsx("button",{onClick:l=>{l.stopPropagation(),P(!1),B(!1),Z("forward")},className:`group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-110 text-white/90 focus:outline-none backdrop-blur-sm ${W.skipBtn}`,children:e.jsx(it,{className:W.skipIcon})})]})}):null,e.jsxs("div",{className:`absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 pb-4 md:pb-6 pt-24 bg-gradient-to-t from-black/95 via-black/70 to-transparent ${It?"opacity-100 translate-y-0":"opacity-0 translate-y-4 pointer-events-none"}`,onClick:l=>{l.target===l.currentTarget&&(P(!1),B(!1),K(!1)),l.stopPropagation()},children:[!d.isLive&&e.jsxs("div",{ref:de,className:"relative w-full h-3 group/slider mb-3 cursor-pointer touch-none flex items-center",onMouseMove:Ct,onMouseLeave:()=>{Ee(null),Pe(null)},onMouseDown:qe,onTouchStart:qe,children:[(Ke=d.highlight)==null?void 0:Ke.map((l,f)=>e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 w-1.5 h-1.5 bg-yellow-400 rounded-full z-10 pointer-events-none",style:{left:`${l.time/a.duration*100}%`},title:l.text},f)),$e!==null&&e.jsxs("div",{className:"absolute bottom-full mb-1.5 flex flex-col items-center transform -translate-x-1/2 z-40 pointer-events-none transition-opacity duration-150",style:{left:`clamp(70px, ${kt}%, calc(100% - 70px))`},children:[V&&e.jsx("div",{className:"bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm",style:{width:`${V.w*.5}px`,height:`${V.h*.5}px`,borderRadius:"var(--radius)"},children:e.jsx("div",{style:{backgroundImage:`url("${V.url}")`,width:`${V.w}px`,height:`${V.h}px`,backgroundPosition:`-${V.x}px -${V.y}px`,backgroundRepeat:"no-repeat",transform:"scale(0.5)",transformOrigin:"top left"}})}),e.jsx("div",{className:"strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1",children:me($e)})]}),e.jsxs("div",{className:"w-full h-1 bg-white/20 overflow-hidden relative backdrop-blur-sm border-[length:var(--border-width)] border-white/10",style:{borderRadius:"var(--radius-full)"},children:[a.duration>0&&a.buffered.map((l,f)=>e.jsx("div",{className:"absolute top-0 bottom-0 bg-white/20",style:{left:`${l.start/a.duration*100}%`,width:`${(l.end-l.start)/a.duration*100}%`}},f)),e.jsx("div",{className:"absolute left-0 top-0 bottom-0 bg-[var(--accent)]",style:{width:`${(ne?ae:a.currentTime)/a.duration*100}%`}})]}),e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3.5 h-3.5 bg-white shadow-md scale-0 group-hover/slider:scale-100 transition-transform duration-100 z-10",style:{left:`${(ne?ae:a.currentTime)/a.duration*100}%`,borderRadius:"var(--radius-full)"}})]}),e.jsxs("div",{className:"flex items-center justify-between pointer-events-auto",children:[e.jsx("div",{className:"flex items-center gap-3",children:Qe.filter(l=>l.position==="left"||l.position==="center").map(Xe)}),e.jsx("div",{className:"flex items-center gap-1",children:Qe.filter(l=>l.position==="right").map(Xe)})]})]})]})]})},mi=(o,t)=>{const s=Pt.createRoot(o);return s.render(h.createElement(xe,t)),{unmount:()=>{s.unmount()},update:r=>{s.render(h.createElement(xe,{...t,...r}))}}};exports.StrataCore=ct;exports.StrataPlayer=xe;exports.mountStrataPlayer=mi;
329
329
  //# sourceMappingURL=strataplayer.cjs.js.map