diff --git a/build/assets/ClipLoader-e049ef5e.js b/build/assets/ClipLoader-83661b90.js similarity index 97% rename from build/assets/ClipLoader-e049ef5e.js rename to build/assets/ClipLoader-83661b90.js index 6a5f626ba..f3bd9c3cf 100644 --- a/build/assets/ClipLoader-e049ef5e.js +++ b/build/assets/ClipLoader-83661b90.js @@ -1,4 +1,4 @@ -import{r as m}from"./index-69dca385.js";var g={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function h(e){if(typeof e=="number")return{value:e,unit:"px"};var t,a=(e.match(/^[0-9.]*/)||"").toString();a.includes(".")?t=parseFloat(a):t=parseInt(a,10);var r=(e.match(/[^0-9]*$/)||"").toString();return g[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function d(e){var t=h(e);return"".concat(t.value).concat(t.unit)}var b=function(e,t,a){var r="react-spinners-".concat(e,"-").concat(a);if(typeof window>"u"||!window.document)return r;var n=document.createElement("style");document.head.appendChild(n);var o=n.sheet,l=` +import{r as m}from"./index-b856be88.js";var g={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function h(e){if(typeof e=="number")return{value:e,unit:"px"};var t,a=(e.match(/^[0-9.]*/)||"").toString();a.includes(".")?t=parseFloat(a):t=parseInt(a,10);var r=(e.match(/[^0-9]*$/)||"").toString();return g[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function d(e){var t=h(e);return"".concat(t.value).concat(t.unit)}var b=function(e,t,a){var r="react-spinners-".concat(e,"-").concat(a);if(typeof window>"u"||!window.document)return r;var n=document.createElement("style");document.head.appendChild(n);var o=n.sheet,l=` @keyframes `.concat(r,` { `).concat(t,` } diff --git a/build/assets/DailyMotion-542adefd.js b/build/assets/DailyMotion-89acab1f.js similarity index 95% rename from build/assets/DailyMotion-542adefd.js rename to build/assets/DailyMotion-89acab1f.js index fc864ee15..f24320e69 100644 --- a/build/assets/DailyMotion-542adefd.js +++ b/build/assets/DailyMotion-89acab1f.js @@ -1 +1 @@ -import{g as P,r as v}from"./index-69dca385.js";import{u as D,p as O}from"./index-4cad102d.js";function b(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?M(j(t)):{},h(e||!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};A(d,{default:()=>p});var _=C(d),c=L(v),l=D,f=O;const x="https://api.dmcdn.net/all.js",N="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(x,N,K,u=>u.player).then(u=>{if(!this.container)return;const g=u.player;this.player=new g(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:m=>a(m)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),k=b({__proto__:null,default:R},[_]);export{k as D}; +import{g as P,r as v}from"./index-b856be88.js";import{u as D,p as O}from"./index-bd90392c.js";function b(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?M(j(t)):{},h(e||!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};A(d,{default:()=>p});var _=C(d),c=L(v),l=D,f=O;const x="https://api.dmcdn.net/all.js",N="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(x,N,K,u=>u.player).then(u=>{if(!this.container)return;const g=u.player;this.player=new g(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:m=>a(m)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),k=b({__proto__:null,default:R},[_]);export{k as D}; diff --git a/build/assets/Facebook-3300d9ca.js b/build/assets/Facebook-75d34c3c.js similarity index 96% rename from build/assets/Facebook-3300d9ca.js rename to build/assets/Facebook-75d34c3c.js index e67a9e692..f774cd34e 100644 --- a/build/assets/Facebook-3300d9ca.js +++ b/build/assets/Facebook-75d34c3c.js @@ -1 +1 @@ -import{g as _,r as g}from"./index-69dca385.js";import{u as P,p as m}from"./index-4cad102d.js";function v(t,e){for(var r=0;ra[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",f="FB",y="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,f,y).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,f,y).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",x.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),N=v({__proto__:null,default:M},[d]);export{N as F}; +import{g as _,r as g}from"./index-b856be88.js";import{u as P,p as m}from"./index-bd90392c.js";function v(t,e){for(var r=0;ra[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",f="FB",y="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,f,y).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,f,y).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",x.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),N=v({__proto__:null,default:M},[d]);export{N as F}; diff --git a/build/assets/FilePlayer-60739ed0.js b/build/assets/FilePlayer-b166e543.js similarity index 98% rename from build/assets/FilePlayer-60739ed0.js rename to build/assets/FilePlayer-b166e543.js index 18b09b98a..c5bbb1de1 100644 --- a/build/assets/FilePlayer-60739ed0.js +++ b/build/assets/FilePlayer-b166e543.js @@ -1 +1 @@ -import{g as b,r as _}from"./index-69dca385.js";import{u as O,p as A}from"./index-4cad102d.js";function R(s,e){for(var t=0;ti[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(e||!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),c=j(_),a=O,d=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends c.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?c.default.createElement("source",{key:t,src:e}):c.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>c.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:d.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:d.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return d.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return d.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return c.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",d.canPlay.file);const z=b(g),Q=R({__proto__:null,default:z},[g]);export{Q as F}; +import{g as b,r as _}from"./index-b856be88.js";import{u as O,p as A}from"./index-bd90392c.js";function R(s,e){for(var t=0;ti[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(e||!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),c=j(_),a=O,d=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends c.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?c.default.createElement("source",{key:t,src:e}):c.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>c.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:d.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:d.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return d.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return d.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return c.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",d.canPlay.file);const z=b(g),Q=R({__proto__:null,default:z},[g]);export{Q as F}; diff --git a/build/assets/Kaltura-bc0b2095.js b/build/assets/Kaltura-b610b718.js similarity index 95% rename from build/assets/Kaltura-bc0b2095.js rename to build/assets/Kaltura-b610b718.js index 66d66b781..b7a9b124c 100644 --- a/build/assets/Kaltura-bc0b2095.js +++ b/build/assets/Kaltura-b610b718.js @@ -1 +1 @@ -import{g as y,r as f}from"./index-69dca385.js";import{u as _,p as m}from"./index-4cad102d.js";function P(r,e){for(var t=0;to[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(o=b(e,a))||o.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(e||!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),s=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),h={};L(h,{default:()=>i});var d=D(h),u=K(f),p=_,S=m;const T="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs";class i extends u.Component{constructor(){super(...arguments),s(this,"callPlayer",p.callPlayer),s(this,"duration",null),s(this,"currentTime",null),s(this,"secondsLoaded",null),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unmute")}),s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(T,E).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:o,seconds:a})=>{this.duration=o,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}s(i,"displayName","Kaltura");s(i,"canPlay",S.canPlay.kaltura);const M=y(d),N=P({__proto__:null,default:M},[d]);export{N as K}; +import{g as y,r as f}from"./index-b856be88.js";import{u as _,p as m}from"./index-bd90392c.js";function P(r,e){for(var t=0;to[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(o=b(e,a))||o.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(e||!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),s=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),h={};L(h,{default:()=>i});var d=D(h),u=K(f),p=_,S=m;const T="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs";class i extends u.Component{constructor(){super(...arguments),s(this,"callPlayer",p.callPlayer),s(this,"duration",null),s(this,"currentTime",null),s(this,"secondsLoaded",null),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unmute")}),s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(T,E).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:o,seconds:a})=>{this.duration=o,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}s(i,"displayName","Kaltura");s(i,"canPlay",S.canPlay.kaltura);const M=y(d),N=P({__proto__:null,default:M},[d]);export{N as K}; diff --git a/build/assets/Mixcloud-ca20574f.js b/build/assets/Mixcloud-254c3596.js similarity index 95% rename from build/assets/Mixcloud-ca20574f.js rename to build/assets/Mixcloud-254c3596.js index 6256f0ce3..1078ff8ea 100644 --- a/build/assets/Mixcloud-ca20574f.js +++ b/build/assets/Mixcloud-254c3596.js @@ -1 +1 @@ -import{g as _,r as f}from"./index-69dca385.js";import{u as m,p as g}from"./index-4cad102d.js";function v(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),u=D(f),p=m,y=g;const E="https://widget.mixcloud.com/media/js/widgetApi.js",L="Mixcloud";class l extends u.Component{constructor(){super(...arguments),a(this,"callPlayer",p.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(E,L).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,p.queryString)({...r.options,feed:`/${s}/`});return u.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),N=v({__proto__:null,default:T},[h]);export{N as M}; +import{g as _,r as f}from"./index-b856be88.js";import{u as m,p as g}from"./index-bd90392c.js";function v(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),u=D(f),p=m,y=g;const E="https://widget.mixcloud.com/media/js/widgetApi.js",L="Mixcloud";class l extends u.Component{constructor(){super(...arguments),a(this,"callPlayer",p.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(E,L).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,p.queryString)({...r.options,feed:`/${s}/`});return u.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),N=v({__proto__:null,default:T},[h]);export{N as M}; diff --git a/build/assets/Preview-2ad6d0ea.js b/build/assets/Preview-7a3dbc32.js similarity index 97% rename from build/assets/Preview-2ad6d0ea.js rename to build/assets/Preview-7a3dbc32.js index a969a4245..296d3f021 100644 --- a/build/assets/Preview-2ad6d0ea.js +++ b/build/assets/Preview-7a3dbc32.js @@ -1 +1 @@ -import{g as y,r as b}from"./index-69dca385.js";function v(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var w=Object.create,i=Object.defineProperty,P=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,x=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?i(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},h=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!I.call(r,a)&&a!==t&&i(r,a,{get:()=>e[a],enumerable:!(n=P(e,a))||n.enumerable});return r},S=(r,e,t)=>(t=r!=null?w(x(r)):{},h(e||!r||!r.__esModule?i(t,"default",{value:r,enumerable:!0}):t,r)),C=r=>h(i({},"__esModule",{value:!0}),r),p=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),_={};E(_,{default:()=>N});var g=C(_),s=S(b);const u="64px",d={};class N extends s.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!s.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a}=this.props,{image:o}=this.state,l=s.default.isValidElement(e),f={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:o&&!l?`url(${o})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...f},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...f},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},m=s.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},s.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return s.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress},l?e:null,n||m)}}const k=y(g),M=v({__proto__:null,default:k},[g]);export{M as P}; +import{g as y,r as b}from"./index-b856be88.js";function v(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var w=Object.create,i=Object.defineProperty,P=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,x=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?i(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},h=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!I.call(r,a)&&a!==t&&i(r,a,{get:()=>e[a],enumerable:!(n=P(e,a))||n.enumerable});return r},S=(r,e,t)=>(t=r!=null?w(x(r)):{},h(e||!r||!r.__esModule?i(t,"default",{value:r,enumerable:!0}):t,r)),C=r=>h(i({},"__esModule",{value:!0}),r),p=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),_={};E(_,{default:()=>N});var g=C(_),s=S(b);const u="64px",d={};class N extends s.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!s.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a}=this.props,{image:o}=this.state,l=s.default.isValidElement(e),f={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:o&&!l?`url(${o})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...f},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...f},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},m=s.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},s.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return s.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress},l?e:null,n||m)}}const k=y(g),M=v({__proto__:null,default:k},[g]);export{M as P}; diff --git a/build/assets/Skeleton-224a4953.js b/build/assets/Skeleton-bddda4d0.js similarity index 97% rename from build/assets/Skeleton-224a4953.js rename to build/assets/Skeleton-bddda4d0.js index 71dc2c939..a07743901 100644 --- a/build/assets/Skeleton-224a4953.js +++ b/build/assets/Skeleton-bddda4d0.js @@ -1,4 +1,4 @@ -import{c as x,d as y,k as b,s as R,b as o,e as _,b0 as u,r as S,u as $,_ as U,j as M,f as j,h as A}from"./index-69dca385.js";function X(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function N(t){return parseFloat(t)}function B(t){return x("MuiSkeleton",t)}y("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const E=["animation","className","component","height","style","variant","width"];let r=t=>t,p,g,m,f;const F=t=>{const{classes:a,variant:e,animation:i,hasChildren:n,width:l,height:s}=t;return A({root:["root",e,i,n&&"withChildren",n&&!l&&"fitContent",n&&!s&&"heightAuto"]},B,a)},K=b(p||(p=r` +import{c as x,d as y,k as b,s as R,b as o,e as _,b0 as u,r as S,u as $,_ as U,j as M,f as j,h as A}from"./index-b856be88.js";function X(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function N(t){return parseFloat(t)}function B(t){return x("MuiSkeleton",t)}y("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const E=["animation","className","component","height","style","variant","width"];let r=t=>t,p,g,m,f;const F=t=>{const{classes:a,variant:e,animation:i,hasChildren:n,width:l,height:s}=t;return A({root:["root",e,i,n&&"withChildren",n&&!l&&"fitContent",n&&!s&&"heightAuto"]},B,a)},K=b(p||(p=r` 0% { opacity: 1; } diff --git a/build/assets/SoundCloud-a32ad7b2.js b/build/assets/SoundCloud-ce204774.js similarity index 95% rename from build/assets/SoundCloud-a32ad7b2.js rename to build/assets/SoundCloud-ce204774.js index c3235b6f6..c8dde2eca 100644 --- a/build/assets/SoundCloud-a32ad7b2.js +++ b/build/assets/SoundCloud-ce204774.js @@ -1 +1 @@ -import{g as P,r as g}from"./index-69dca385.js";import{u as b,p as v}from"./index-4cad102d.js";function O(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},R=(t,e,r)=>(r=t!=null?S(C(t)):{},d(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),T=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=T(h),p=R(g),c=b,M=v;const x="https://w.soundcloud.com/player/api.js",A="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(x,A).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",M.canPlay.soundcloud);a(u,"loopOnEnded",!0);const N=P(f),I=O({__proto__:null,default:N},[f]);export{I as S}; +import{g as P,r as g}from"./index-b856be88.js";import{u as b,p as v}from"./index-bd90392c.js";function O(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},R=(t,e,r)=>(r=t!=null?S(C(t)):{},d(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),T=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=T(h),p=R(g),c=b,M=v;const x="https://w.soundcloud.com/player/api.js",A="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(x,A).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",M.canPlay.soundcloud);a(u,"loopOnEnded",!0);const N=P(f),I=O({__proto__:null,default:N},[f]);export{I as S}; diff --git a/build/assets/Stack-57ab9e76.js b/build/assets/Stack-e0f879a7.js similarity index 99% rename from build/assets/Stack-57ab9e76.js rename to build/assets/Stack-e0f879a7.js index f1a4d086e..8d31f024e 100644 --- a/build/assets/Stack-57ab9e76.js +++ b/build/assets/Stack-e0f879a7.js @@ -1 +1 @@ -import{r as E,$ as Mt,_ as ae,b as T,bw as Ft,bx as Wt,by as Vt,bz as Lt,bA as Nt,b3 as Qe,b2 as Ae,bB as Ht,bv as It,bC as Ut,j as Q,bD as Ze,h as ke,c as Te,d as ht,s as Be,bE as qt,u as Me,i as gt,f as zt}from"./index-69dca385.js";import{J as et,b9 as Xt,y as tt,z as rt,X as Yt}from"./index-94c3c981.js";function Se(e,t){var r,o;return E.isValidElement(e)&&t.indexOf((r=e.type.muiName)!=null?r:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}let ot=0;function Gt(e){const[t,r]=E.useState(e),o=e||t;return E.useEffect(()=>{t==null&&(ot+=1,r(`mui-${ot}`))},[t]),o}const nt=Mt["useId".toString()];function Ho(e){if(nt!==void 0){const t=nt();return e??t}return Gt(e)}function Io({controlled:e,default:t,name:r,state:o="value"}){const{current:n}=E.useRef(e!==void 0),[a,c]=E.useState(t),s=n?e:a,i=E.useCallback(f=>{n||c(f)},[]);return[s,i]}const _t=["sx"],Jt=e=>{var t,r;const o={systemProps:{},otherProps:{}},n=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Ft;return Object.keys(e).forEach(a=>{n[a]?o.systemProps[a]=e[a]:o.otherProps[a]=e[a]}),o};function Kt(e){const{sx:t}=e,r=ae(e,_t),{systemProps:o,otherProps:n}=Jt(r);let a;return Array.isArray(t)?a=[o,...t]:typeof t=="function"?a=(...c)=>{const s=t(...c);return Wt(s)?T({},o,s):o}:a=T({},o,t),T({},n,{sx:a})}function yt(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tt.root});function nr(e){return Nt({props:e,name:"MuiStack",defaultTheme:rr})}function ar(e,t){const r=E.Children.toArray(e).filter(Boolean);return r.reduce((o,n,a)=>(o.push(n),a({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],sr=({ownerState:e,theme:t})=>{let r=T({display:"flex",flexDirection:"column"},Qe({theme:t},Ae({values:e.direction,breakpoints:t.breakpoints.values}),o=>({flexDirection:o})));if(e.spacing){const o=Ht(t),n=Object.keys(t.breakpoints.values).reduce((i,f)=>((typeof e.spacing=="object"&&e.spacing[f]!=null||typeof e.direction=="object"&&e.direction[f]!=null)&&(i[f]=!0),i),{}),a=Ae({values:e.direction,base:n}),c=Ae({values:e.spacing,base:n});typeof a=="object"&&Object.keys(a).forEach((i,f,l)=>{if(!a[i]){const h=f>0?a[l[f-1]]:"column";a[i]=h}}),r=It(r,Qe({theme:t},c,(i,f)=>e.useFlexGap?{gap:Ze(o,i)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${ir(f?a[f]:e.direction)}`]:Ze(o,i)}}))}return r=Ut(t.breakpoints,r),r};function lr(e={}){const{createStyledComponent:t=or,useThemeProps:r=nr,componentName:o="MuiStack"}=e,n=()=>ke({root:["root"]},i=>Te(o,i),{}),a=t(sr);return E.forwardRef(function(i,f){const l=r(i),v=Kt(l),{component:h="div",direction:p="column",spacing:x=0,divider:d,children:m,className:w,useFlexGap:O=!1}=v,b=ae(v,tr),u={direction:p,spacing:x,useFlexGap:O},g=n();return Q.jsx(a,T({as:h,ownerState:u,ref:f,className:Qt(g.root,w)},b,{children:d?ar(m,d):m}))})}const cr={disableDefaultClasses:!1},fr=E.createContext(cr);function ur(e){const{disableDefaultClasses:t}=E.useContext(fr);return r=>t?"":e(r)}var M="top",N="bottom",H="right",F="left",Fe="auto",de=[M,N,H,F],te="start",ue="end",pr="clippingParents",bt="viewport",le="popper",dr="reference",at=de.reduce(function(e,t){return e.concat([t+"-"+te,t+"-"+ue])},[]),xt=[].concat(de,[Fe]).reduce(function(e,t){return e.concat([t,t+"-"+te,t+"-"+ue])},[]),vr="beforeRead",mr="read",hr="afterRead",gr="beforeMain",yr="main",br="afterMain",xr="beforeWrite",wr="write",Pr="afterWrite",Or=[vr,mr,hr,gr,yr,br,xr,wr,Pr];function U(e){return e?(e.nodeName||"").toLowerCase():null}function W(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Z(e){var t=W(e).Element;return e instanceof t||e instanceof Element}function L(e){var t=W(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function We(e){if(typeof ShadowRoot>"u")return!1;var t=W(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Er(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var o=t.styles[r]||{},n=t.attributes[r]||{},a=t.elements[r];!L(a)||!U(a)||(Object.assign(a.style,o),Object.keys(n).forEach(function(c){var s=n[c];s===!1?a.removeAttribute(c):a.setAttribute(c,s===!0?"":s)}))})}function Cr(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(o){var n=t.elements[o],a=t.attributes[o]||{},c=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:r[o]),s=c.reduce(function(i,f){return i[f]="",i},{});!L(n)||!U(n)||(Object.assign(n.style,s),Object.keys(a).forEach(function(i){n.removeAttribute(i)}))})}}const Rr={name:"applyStyles",enabled:!0,phase:"write",fn:Er,effect:Cr,requires:["computeStyles"]};function I(e){return e.split("-")[0]}var K=Math.max,we=Math.min,re=Math.round;function $e(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function wt(){return!/^((?!chrome|android).)*safari/i.test($e())}function oe(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var o=e.getBoundingClientRect(),n=1,a=1;t&&L(e)&&(n=e.offsetWidth>0&&re(o.width)/e.offsetWidth||1,a=e.offsetHeight>0&&re(o.height)/e.offsetHeight||1);var c=Z(e)?W(e):window,s=c.visualViewport,i=!wt()&&r,f=(o.left+(i&&s?s.offsetLeft:0))/n,l=(o.top+(i&&s?s.offsetTop:0))/a,v=o.width/n,h=o.height/a;return{width:v,height:h,top:l,right:f+v,bottom:l+h,left:f,x:f,y:l}}function Ve(e){var t=oe(e),r=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:o}}function Pt(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&We(r)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function q(e){return W(e).getComputedStyle(e)}function Ar(e){return["table","td","th"].indexOf(U(e))>=0}function Y(e){return((Z(e)?e.ownerDocument:e.document)||window.document).documentElement}function Pe(e){return U(e)==="html"?e:e.assignedSlot||e.parentNode||(We(e)?e.host:null)||Y(e)}function it(e){return!L(e)||q(e).position==="fixed"?null:e.offsetParent}function Sr(e){var t=/firefox/i.test($e()),r=/Trident/i.test($e());if(r&&L(e)){var o=q(e);if(o.position==="fixed")return null}var n=Pe(e);for(We(n)&&(n=n.host);L(n)&&["html","body"].indexOf(U(n))<0;){var a=q(n);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return n;n=n.parentNode}return null}function ve(e){for(var t=W(e),r=it(e);r&&Ar(r)&&q(r).position==="static";)r=it(r);return r&&(U(r)==="html"||U(r)==="body"&&q(r).position==="static")?t:r||Sr(e)||t}function Le(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ce(e,t,r){return K(e,we(t,r))}function $r(e,t,r){var o=ce(e,t,r);return o>r?r:o}function Ot(){return{top:0,right:0,bottom:0,left:0}}function Et(e){return Object.assign({},Ot(),e)}function Ct(e,t){return t.reduce(function(r,o){return r[o]=e,r},{})}var Dr=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Et(typeof t!="number"?t:Ct(t,de))};function jr(e){var t,r=e.state,o=e.name,n=e.options,a=r.elements.arrow,c=r.modifiersData.popperOffsets,s=I(r.placement),i=Le(s),f=[F,H].indexOf(s)>=0,l=f?"height":"width";if(!(!a||!c)){var v=Dr(n.padding,r),h=Ve(a),p=i==="y"?M:F,x=i==="y"?N:H,d=r.rects.reference[l]+r.rects.reference[i]-c[i]-r.rects.popper[l],m=c[i]-r.rects.reference[i],w=ve(a),O=w?i==="y"?w.clientHeight||0:w.clientWidth||0:0,b=d/2-m/2,u=v[p],g=O-h[l]-v[x],y=O/2-h[l]/2+b,P=ce(u,y,g),A=i;r.modifiersData[o]=(t={},t[A]=P,t.centerOffset=P-y,t)}}function kr(e){var t=e.state,r=e.options,o=r.element,n=o===void 0?"[data-popper-arrow]":o;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||Pt(t.elements.popper,n)&&(t.elements.arrow=n))}const Tr={name:"arrow",enabled:!0,phase:"main",fn:jr,effect:kr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ne(e){return e.split("-")[1]}var Br={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mr(e,t){var r=e.x,o=e.y,n=t.devicePixelRatio||1;return{x:re(r*n)/n||0,y:re(o*n)/n||0}}function st(e){var t,r=e.popper,o=e.popperRect,n=e.placement,a=e.variation,c=e.offsets,s=e.position,i=e.gpuAcceleration,f=e.adaptive,l=e.roundOffsets,v=e.isFixed,h=c.x,p=h===void 0?0:h,x=c.y,d=x===void 0?0:x,m=typeof l=="function"?l({x:p,y:d}):{x:p,y:d};p=m.x,d=m.y;var w=c.hasOwnProperty("x"),O=c.hasOwnProperty("y"),b=F,u=M,g=window;if(f){var y=ve(r),P="clientHeight",A="clientWidth";if(y===W(r)&&(y=Y(r),q(y).position!=="static"&&s==="absolute"&&(P="scrollHeight",A="scrollWidth")),y=y,n===M||(n===F||n===H)&&a===ue){u=N;var C=v&&y===g&&g.visualViewport?g.visualViewport.height:y[P];d-=C-o.height,d*=i?1:-1}if(n===F||(n===M||n===N)&&a===ue){b=H;var R=v&&y===g&&g.visualViewport?g.visualViewport.width:y[A];p-=R-o.width,p*=i?1:-1}}var $=Object.assign({position:s},f&&Br),k=l===!0?Mr({x:p,y:d},W(r)):{x:p,y:d};if(p=k.x,d=k.y,i){var S;return Object.assign({},$,(S={},S[u]=O?"0":"",S[b]=w?"0":"",S.transform=(g.devicePixelRatio||1)<=1?"translate("+p+"px, "+d+"px)":"translate3d("+p+"px, "+d+"px, 0)",S))}return Object.assign({},$,(t={},t[u]=O?d+"px":"",t[b]=w?p+"px":"",t.transform="",t))}function Fr(e){var t=e.state,r=e.options,o=r.gpuAcceleration,n=o===void 0?!0:o,a=r.adaptive,c=a===void 0?!0:a,s=r.roundOffsets,i=s===void 0?!0:s,f={placement:I(t.placement),variation:ne(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,st(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:i})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,st(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Wr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fr,data:{}};var be={passive:!0};function Vr(e){var t=e.state,r=e.instance,o=e.options,n=o.scroll,a=n===void 0?!0:n,c=o.resize,s=c===void 0?!0:c,i=W(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(l){l.addEventListener("scroll",r.update,be)}),s&&i.addEventListener("resize",r.update,be),function(){a&&f.forEach(function(l){l.removeEventListener("scroll",r.update,be)}),s&&i.removeEventListener("resize",r.update,be)}}const Lr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Vr,data:{}};var Nr={left:"right",right:"left",bottom:"top",top:"bottom"};function xe(e){return e.replace(/left|right|bottom|top/g,function(t){return Nr[t]})}var Hr={start:"end",end:"start"};function lt(e){return e.replace(/start|end/g,function(t){return Hr[t]})}function Ne(e){var t=W(e),r=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:r,scrollTop:o}}function He(e){return oe(Y(e)).left+Ne(e).scrollLeft}function Ir(e,t){var r=W(e),o=Y(e),n=r.visualViewport,a=o.clientWidth,c=o.clientHeight,s=0,i=0;if(n){a=n.width,c=n.height;var f=wt();(f||!f&&t==="fixed")&&(s=n.offsetLeft,i=n.offsetTop)}return{width:a,height:c,x:s+He(e),y:i}}function Ur(e){var t,r=Y(e),o=Ne(e),n=(t=e.ownerDocument)==null?void 0:t.body,a=K(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),c=K(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-o.scrollLeft+He(e),i=-o.scrollTop;return q(n||r).direction==="rtl"&&(s+=K(r.clientWidth,n?n.clientWidth:0)-a),{width:a,height:c,x:s,y:i}}function Ie(e){var t=q(e),r=t.overflow,o=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+o)}function Rt(e){return["html","body","#document"].indexOf(U(e))>=0?e.ownerDocument.body:L(e)&&Ie(e)?e:Rt(Pe(e))}function fe(e,t){var r;t===void 0&&(t=[]);var o=Rt(e),n=o===((r=e.ownerDocument)==null?void 0:r.body),a=W(o),c=n?[a].concat(a.visualViewport||[],Ie(o)?o:[]):o,s=t.concat(c);return n?s:s.concat(fe(Pe(c)))}function De(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function qr(e,t){var r=oe(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function ct(e,t,r){return t===bt?De(Ir(e,r)):Z(t)?qr(t,r):De(Ur(Y(e)))}function zr(e){var t=fe(Pe(e)),r=["absolute","fixed"].indexOf(q(e).position)>=0,o=r&&L(e)?ve(e):e;return Z(o)?t.filter(function(n){return Z(n)&&Pt(n,o)&&U(n)!=="body"}):[]}function Xr(e,t,r,o){var n=t==="clippingParents"?zr(e):[].concat(t),a=[].concat(n,[r]),c=a[0],s=a.reduce(function(i,f){var l=ct(e,f,o);return i.top=K(l.top,i.top),i.right=we(l.right,i.right),i.bottom=we(l.bottom,i.bottom),i.left=K(l.left,i.left),i},ct(e,c,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function At(e){var t=e.reference,r=e.element,o=e.placement,n=o?I(o):null,a=o?ne(o):null,c=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,i;switch(n){case M:i={x:c,y:t.y-r.height};break;case N:i={x:c,y:t.y+t.height};break;case H:i={x:t.x+t.width,y:s};break;case F:i={x:t.x-r.width,y:s};break;default:i={x:t.x,y:t.y}}var f=n?Le(n):null;if(f!=null){var l=f==="y"?"height":"width";switch(a){case te:i[f]=i[f]-(t[l]/2-r[l]/2);break;case ue:i[f]=i[f]+(t[l]/2-r[l]/2);break}}return i}function pe(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=o===void 0?e.placement:o,a=r.strategy,c=a===void 0?e.strategy:a,s=r.boundary,i=s===void 0?pr:s,f=r.rootBoundary,l=f===void 0?bt:f,v=r.elementContext,h=v===void 0?le:v,p=r.altBoundary,x=p===void 0?!1:p,d=r.padding,m=d===void 0?0:d,w=Et(typeof m!="number"?m:Ct(m,de)),O=h===le?dr:le,b=e.rects.popper,u=e.elements[x?O:h],g=Xr(Z(u)?u:u.contextElement||Y(e.elements.popper),i,l,c),y=oe(e.elements.reference),P=At({reference:y,element:b,strategy:"absolute",placement:n}),A=De(Object.assign({},b,P)),C=h===le?A:y,R={top:g.top-C.top+w.top,bottom:C.bottom-g.bottom+w.bottom,left:g.left-C.left+w.left,right:C.right-g.right+w.right},$=e.modifiersData.offset;if(h===le&&$){var k=$[n];Object.keys(R).forEach(function(S){var j=[H,N].indexOf(S)>=0?1:-1,V=[M,N].indexOf(S)>=0?"y":"x";R[S]+=k[V]*j})}return R}function Yr(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=r.boundary,a=r.rootBoundary,c=r.padding,s=r.flipVariations,i=r.allowedAutoPlacements,f=i===void 0?xt:i,l=ne(o),v=l?s?at:at.filter(function(x){return ne(x)===l}):de,h=v.filter(function(x){return f.indexOf(x)>=0});h.length===0&&(h=v);var p=h.reduce(function(x,d){return x[d]=pe(e,{placement:d,boundary:n,rootBoundary:a,padding:c})[I(d)],x},{});return Object.keys(p).sort(function(x,d){return p[x]-p[d]})}function Gr(e){if(I(e)===Fe)return[];var t=xe(e);return[lt(e),t,lt(t)]}function _r(e){var t=e.state,r=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var n=r.mainAxis,a=n===void 0?!0:n,c=r.altAxis,s=c===void 0?!0:c,i=r.fallbackPlacements,f=r.padding,l=r.boundary,v=r.rootBoundary,h=r.altBoundary,p=r.flipVariations,x=p===void 0?!0:p,d=r.allowedAutoPlacements,m=t.options.placement,w=I(m),O=w===m,b=i||(O||!x?[xe(m)]:Gr(m)),u=[m].concat(b).reduce(function(ee,X){return ee.concat(I(X)===Fe?Yr(t,{placement:X,boundary:l,rootBoundary:v,padding:f,flipVariations:x,allowedAutoPlacements:d}):X)},[]),g=t.rects.reference,y=t.rects.popper,P=new Map,A=!0,C=u[0],R=0;R=0,V=j?"width":"height",D=pe(t,{placement:$,boundary:l,rootBoundary:v,altBoundary:h,padding:f}),B=j?S?H:F:S?N:M;g[V]>y[V]&&(B=xe(B));var z=xe(B),G=[];if(a&&G.push(D[k]<=0),s&&G.push(D[B]<=0,D[z]<=0),G.every(function(ee){return ee})){C=$,A=!1;break}P.set($,G)}if(A)for(var me=x?3:1,Oe=function(X){var se=u.find(function(ge){var _=P.get(ge);if(_)return _.slice(0,X).every(function(Ee){return Ee})});if(se)return C=se,"break"},ie=me;ie>0;ie--){var he=Oe(ie);if(he==="break")break}t.placement!==C&&(t.modifiersData[o]._skip=!0,t.placement=C,t.reset=!0)}}const Jr={name:"flip",enabled:!0,phase:"main",fn:_r,requiresIfExists:["offset"],data:{_skip:!1}};function ft(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ut(e){return[M,H,N,F].some(function(t){return e[t]>=0})}function Kr(e){var t=e.state,r=e.name,o=t.rects.reference,n=t.rects.popper,a=t.modifiersData.preventOverflow,c=pe(t,{elementContext:"reference"}),s=pe(t,{altBoundary:!0}),i=ft(c,o),f=ft(s,n,a),l=ut(i),v=ut(f);t.modifiersData[r]={referenceClippingOffsets:i,popperEscapeOffsets:f,isReferenceHidden:l,hasPopperEscaped:v},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":v})}const Qr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kr};function Zr(e,t,r){var o=I(e),n=[F,M].indexOf(o)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,c=a[0],s=a[1];return c=c||0,s=(s||0)*n,[F,H].indexOf(o)>=0?{x:s,y:c}:{x:c,y:s}}function eo(e){var t=e.state,r=e.options,o=e.name,n=r.offset,a=n===void 0?[0,0]:n,c=xt.reduce(function(l,v){return l[v]=Zr(v,t.rects,a),l},{}),s=c[t.placement],i=s.x,f=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=f),t.modifiersData[o]=c}const to={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:eo};function ro(e){var t=e.state,r=e.name;t.modifiersData[r]=At({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const oo={name:"popperOffsets",enabled:!0,phase:"read",fn:ro,data:{}};function no(e){return e==="x"?"y":"x"}function ao(e){var t=e.state,r=e.options,o=e.name,n=r.mainAxis,a=n===void 0?!0:n,c=r.altAxis,s=c===void 0?!1:c,i=r.boundary,f=r.rootBoundary,l=r.altBoundary,v=r.padding,h=r.tether,p=h===void 0?!0:h,x=r.tetherOffset,d=x===void 0?0:x,m=pe(t,{boundary:i,rootBoundary:f,padding:v,altBoundary:l}),w=I(t.placement),O=ne(t.placement),b=!O,u=Le(w),g=no(u),y=t.modifiersData.popperOffsets,P=t.rects.reference,A=t.rects.popper,C=typeof d=="function"?d(Object.assign({},t.rects,{placement:t.placement})):d,R=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(y){if(a){var S,j=u==="y"?M:F,V=u==="y"?N:H,D=u==="y"?"height":"width",B=y[u],z=B+m[j],G=B-m[V],me=p?-A[D]/2:0,Oe=O===te?P[D]:A[D],ie=O===te?-A[D]:-P[D],he=t.elements.arrow,ee=p&&he?Ve(he):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ot(),se=X[j],ge=X[V],_=ce(0,P[D],ee[D]),Ee=b?P[D]/2-me-_-se-R.mainAxis:Oe-_-se-R.mainAxis,$t=b?-P[D]/2+me+_+ge+R.mainAxis:ie+_+ge+R.mainAxis,Ce=t.elements.arrow&&ve(t.elements.arrow),Dt=Ce?u==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,Ue=(S=$==null?void 0:$[u])!=null?S:0,jt=B+Ee-Ue-Dt,kt=B+$t-Ue,qe=ce(p?we(z,jt):z,B,p?K(G,kt):G);y[u]=qe,k[u]=qe-B}if(s){var ze,Tt=u==="x"?M:F,Bt=u==="x"?N:H,J=y[g],ye=g==="y"?"height":"width",Xe=J+m[Tt],Ye=J-m[Bt],Re=[M,F].indexOf(w)!==-1,Ge=(ze=$==null?void 0:$[g])!=null?ze:0,_e=Re?Xe:J-P[ye]-A[ye]-Ge+R.altAxis,Je=Re?J+P[ye]+A[ye]-Ge-R.altAxis:Ye,Ke=p&&Re?$r(_e,J,Je):ce(p?_e:Xe,J,p?Je:Ye);y[g]=Ke,k[g]=Ke-J}t.modifiersData[o]=k}}const io={name:"preventOverflow",enabled:!0,phase:"main",fn:ao,requiresIfExists:["offset"]};function so(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lo(e){return e===W(e)||!L(e)?Ne(e):so(e)}function co(e){var t=e.getBoundingClientRect(),r=re(t.width)/e.offsetWidth||1,o=re(t.height)/e.offsetHeight||1;return r!==1||o!==1}function fo(e,t,r){r===void 0&&(r=!1);var o=L(t),n=L(t)&&co(t),a=Y(t),c=oe(e,n,r),s={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(o||!o&&!r)&&((U(t)!=="body"||Ie(a))&&(s=lo(t)),L(t)?(i=oe(t,!0),i.x+=t.clientLeft,i.y+=t.clientTop):a&&(i.x=He(a))),{x:c.left+s.scrollLeft-i.x,y:c.top+s.scrollTop-i.y,width:c.width,height:c.height}}function uo(e){var t=new Map,r=new Set,o=[];e.forEach(function(a){t.set(a.name,a)});function n(a){r.add(a.name);var c=[].concat(a.requires||[],a.requiresIfExists||[]);c.forEach(function(s){if(!r.has(s)){var i=t.get(s);i&&n(i)}}),o.push(a)}return e.forEach(function(a){r.has(a.name)||n(a)}),o}function po(e){var t=uo(e);return Or.reduce(function(r,o){return r.concat(t.filter(function(n){return n.phase===o}))},[])}function vo(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function mo(e){var t=e.reduce(function(r,o){var n=r[o.name];return r[o.name]=n?Object.assign({},n,o,{options:Object.assign({},n.options,o.options),data:Object.assign({},n.data,o.data)}):o,r},{});return Object.keys(t).map(function(r){return t[r]})}var pt={placement:"bottom",modifiers:[],strategy:"absolute"};function dt(){for(var e=arguments.length,t=new Array(e),r=0;rke({root:["root"]},ur(bo)),Co={},Ro=E.forwardRef(function(t,r){var o;const{anchorEl:n,children:a,direction:c,disablePortal:s,modifiers:i,open:f,placement:l,popperOptions:v,popperRef:h,slotProps:p={},slots:x={},TransitionProps:d}=t,m=ae(t,xo),w=E.useRef(null),O=tt(w,r),b=E.useRef(null),u=tt(b,h),g=E.useRef(u);rt(()=>{g.current=u},[u]),E.useImperativeHandle(h,()=>b.current,[]);const y=Po(l,c),[P,A]=E.useState(y),[C,R]=E.useState(je(n));E.useEffect(()=>{b.current&&b.current.forceUpdate()}),E.useEffect(()=>{n&&R(je(n))},[n]),rt(()=>{if(!C||!f)return;const V=z=>{A(z.placement)};let D=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:z})=>{V(z)}}];i!=null&&(D=D.concat(i)),v&&v.modifiers!=null&&(D=D.concat(v.modifiers));const B=yo(C,w.current,T({placement:y},v,{modifiers:D}));return g.current(B),()=>{B.destroy(),g.current(null)}},[C,s,i,f,v,y]);const $={placement:P};d!==null&&($.TransitionProps=d);const k=Eo(),S=(o=x.root)!=null?o:"div",j=Yt({elementType:S,externalSlotProps:p.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:O},ownerState:t,className:k.root});return Q.jsx(S,T({},j,{children:typeof a=="function"?a($):a}))}),Ao=E.forwardRef(function(t,r){const{anchorEl:o,children:n,container:a,direction:c="ltr",disablePortal:s=!1,keepMounted:i=!1,modifiers:f,open:l,placement:v="bottom",popperOptions:h=Co,popperRef:p,style:x,transition:d=!1,slotProps:m={},slots:w={}}=t,O=ae(t,wo),[b,u]=E.useState(!0),g=()=>{u(!1)},y=()=>{u(!0)};if(!i&&!l&&(!d||b))return null;let P;if(a)P=a;else if(o){const R=je(o);P=R&&Oo(R)?et(R).body:et(null).body}const A=!l&&i&&(!d||b)?"none":void 0,C=d?{in:l,onEnter:g,onExited:y}:void 0;return Q.jsx(Xt,{disablePortal:s,container:P,children:Q.jsx(Ro,T({anchorEl:o,direction:c,disablePortal:s,modifiers:f,ref:r,open:d?!b:l,placement:v,popperOptions:h,popperRef:p,slotProps:m,slots:w},O,{style:T({position:"fixed",top:0,left:0,display:A},x),TransitionProps:C,children:n}))})}),So=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],$o=Be(Ao,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Do=E.forwardRef(function(t,r){var o;const n=qt(),a=Me({props:t,name:"MuiPopper"}),{anchorEl:c,component:s,components:i,componentsProps:f,container:l,disablePortal:v,keepMounted:h,modifiers:p,open:x,placement:d,popperOptions:m,popperRef:w,transition:O,slots:b,slotProps:u}=a,g=ae(a,So),y=(o=b==null?void 0:b.root)!=null?o:i==null?void 0:i.Root,P=T({anchorEl:c,container:l,disablePortal:v,keepMounted:h,modifiers:p,open:x,placement:d,popperOptions:m,popperRef:w,transition:O},g);return Q.jsx($o,T({as:s,direction:n==null?void 0:n.direction,slots:{root:y},slotProps:u??f},P,{ref:r}))}),Uo=Do;function qo({props:e,states:t,muiFormControl:r}){return t.reduce((o,n)=>(o[n]=e[n],r&&typeof e[n]>"u"&&(o[n]=r[n]),o),{})}const jo=E.createContext(void 0),St=jo;function zo(){return E.useContext(St)}function vt(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function mt(e,t=!1){return e&&(vt(e.value)&&e.value!==""||t&&vt(e.defaultValue)&&e.defaultValue!=="")}function ko(e){return e.startAdornment}function To(e){return Te("MuiFormControl",e)}ht("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Bo=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Mo=e=>{const{classes:t,margin:r,fullWidth:o}=e,n={root:["root",r!=="none"&&`margin${gt(r)}`,o&&"fullWidth"]};return ke(n,To,t)},Fo=Be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>T({},t.root,t[`margin${gt(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>T({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),Wo=E.forwardRef(function(t,r){const o=Me({props:t,name:"MuiFormControl"}),{children:n,className:a,color:c="primary",component:s="div",disabled:i=!1,error:f=!1,focused:l,fullWidth:v=!1,hiddenLabel:h=!1,margin:p="none",required:x=!1,size:d="medium",variant:m="outlined"}=o,w=ae(o,Bo),O=T({},o,{color:c,component:s,disabled:i,error:f,fullWidth:v,hiddenLabel:h,margin:p,required:x,size:d,variant:m}),b=Mo(O),[u,g]=E.useState(()=>{let S=!1;return n&&E.Children.forEach(n,j=>{if(!Se(j,["Input","Select"]))return;const V=Se(j,["Select"])?j.props.input:j;V&&ko(V.props)&&(S=!0)}),S}),[y,P]=E.useState(()=>{let S=!1;return n&&E.Children.forEach(n,j=>{Se(j,["Input","Select"])&&(mt(j.props,!0)||mt(j.props.inputProps,!0))&&(S=!0)}),S}),[A,C]=E.useState(!1);i&&A&&C(!1);const R=l!==void 0&&!i?l:A;let $;const k=E.useMemo(()=>({adornedStart:u,setAdornedStart:g,color:c,disabled:i,error:f,filled:y,focused:R,fullWidth:v,hiddenLabel:h,size:d,onBlur:()=>{C(!1)},onEmpty:()=>{P(!1)},onFilled:()=>{P(!0)},onFocus:()=>{C(!0)},registerEffect:$,required:x,variant:m}),[u,c,i,f,y,R,v,h,$,x,d,m]);return Q.jsx(St.Provider,{value:k,children:Q.jsx(Fo,T({as:s,ownerState:O,className:zt(b.root,a),ref:r},w,{children:n}))})}),Xo=Wo,Vo=lr({createStyledComponent:Be("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Me({props:e,name:"MuiStack"})}),Yo=Vo;export{Xo as F,Uo as P,Yo as S,Ho as a,zo as b,St as c,Kt as e,qo as f,mt as i,Io as u}; +import{r as E,$ as Mt,_ as ae,b as T,bw as Ft,bx as Wt,by as Vt,bz as Lt,bA as Nt,b3 as Qe,b2 as Ae,bB as Ht,bv as It,bC as Ut,j as Q,bD as Ze,h as ke,c as Te,d as ht,s as Be,bE as qt,u as Me,i as gt,f as zt}from"./index-b856be88.js";import{J as et,b9 as Xt,y as tt,z as rt,X as Yt}from"./index-c59af388.js";function Se(e,t){var r,o;return E.isValidElement(e)&&t.indexOf((r=e.type.muiName)!=null?r:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}let ot=0;function Gt(e){const[t,r]=E.useState(e),o=e||t;return E.useEffect(()=>{t==null&&(ot+=1,r(`mui-${ot}`))},[t]),o}const nt=Mt["useId".toString()];function Ho(e){if(nt!==void 0){const t=nt();return e??t}return Gt(e)}function Io({controlled:e,default:t,name:r,state:o="value"}){const{current:n}=E.useRef(e!==void 0),[a,c]=E.useState(t),s=n?e:a,i=E.useCallback(f=>{n||c(f)},[]);return[s,i]}const _t=["sx"],Jt=e=>{var t,r;const o={systemProps:{},otherProps:{}},n=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Ft;return Object.keys(e).forEach(a=>{n[a]?o.systemProps[a]=e[a]:o.otherProps[a]=e[a]}),o};function Kt(e){const{sx:t}=e,r=ae(e,_t),{systemProps:o,otherProps:n}=Jt(r);let a;return Array.isArray(t)?a=[o,...t]:typeof t=="function"?a=(...c)=>{const s=t(...c);return Wt(s)?T({},o,s):o}:a=T({},o,t),T({},n,{sx:a})}function yt(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tt.root});function nr(e){return Nt({props:e,name:"MuiStack",defaultTheme:rr})}function ar(e,t){const r=E.Children.toArray(e).filter(Boolean);return r.reduce((o,n,a)=>(o.push(n),a({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],sr=({ownerState:e,theme:t})=>{let r=T({display:"flex",flexDirection:"column"},Qe({theme:t},Ae({values:e.direction,breakpoints:t.breakpoints.values}),o=>({flexDirection:o})));if(e.spacing){const o=Ht(t),n=Object.keys(t.breakpoints.values).reduce((i,f)=>((typeof e.spacing=="object"&&e.spacing[f]!=null||typeof e.direction=="object"&&e.direction[f]!=null)&&(i[f]=!0),i),{}),a=Ae({values:e.direction,base:n}),c=Ae({values:e.spacing,base:n});typeof a=="object"&&Object.keys(a).forEach((i,f,l)=>{if(!a[i]){const h=f>0?a[l[f-1]]:"column";a[i]=h}}),r=It(r,Qe({theme:t},c,(i,f)=>e.useFlexGap?{gap:Ze(o,i)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${ir(f?a[f]:e.direction)}`]:Ze(o,i)}}))}return r=Ut(t.breakpoints,r),r};function lr(e={}){const{createStyledComponent:t=or,useThemeProps:r=nr,componentName:o="MuiStack"}=e,n=()=>ke({root:["root"]},i=>Te(o,i),{}),a=t(sr);return E.forwardRef(function(i,f){const l=r(i),v=Kt(l),{component:h="div",direction:p="column",spacing:x=0,divider:d,children:m,className:w,useFlexGap:O=!1}=v,b=ae(v,tr),u={direction:p,spacing:x,useFlexGap:O},g=n();return Q.jsx(a,T({as:h,ownerState:u,ref:f,className:Qt(g.root,w)},b,{children:d?ar(m,d):m}))})}const cr={disableDefaultClasses:!1},fr=E.createContext(cr);function ur(e){const{disableDefaultClasses:t}=E.useContext(fr);return r=>t?"":e(r)}var M="top",N="bottom",H="right",F="left",Fe="auto",de=[M,N,H,F],te="start",ue="end",pr="clippingParents",bt="viewport",le="popper",dr="reference",at=de.reduce(function(e,t){return e.concat([t+"-"+te,t+"-"+ue])},[]),xt=[].concat(de,[Fe]).reduce(function(e,t){return e.concat([t,t+"-"+te,t+"-"+ue])},[]),vr="beforeRead",mr="read",hr="afterRead",gr="beforeMain",yr="main",br="afterMain",xr="beforeWrite",wr="write",Pr="afterWrite",Or=[vr,mr,hr,gr,yr,br,xr,wr,Pr];function U(e){return e?(e.nodeName||"").toLowerCase():null}function W(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Z(e){var t=W(e).Element;return e instanceof t||e instanceof Element}function L(e){var t=W(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function We(e){if(typeof ShadowRoot>"u")return!1;var t=W(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Er(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var o=t.styles[r]||{},n=t.attributes[r]||{},a=t.elements[r];!L(a)||!U(a)||(Object.assign(a.style,o),Object.keys(n).forEach(function(c){var s=n[c];s===!1?a.removeAttribute(c):a.setAttribute(c,s===!0?"":s)}))})}function Cr(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(o){var n=t.elements[o],a=t.attributes[o]||{},c=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:r[o]),s=c.reduce(function(i,f){return i[f]="",i},{});!L(n)||!U(n)||(Object.assign(n.style,s),Object.keys(a).forEach(function(i){n.removeAttribute(i)}))})}}const Rr={name:"applyStyles",enabled:!0,phase:"write",fn:Er,effect:Cr,requires:["computeStyles"]};function I(e){return e.split("-")[0]}var K=Math.max,we=Math.min,re=Math.round;function $e(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function wt(){return!/^((?!chrome|android).)*safari/i.test($e())}function oe(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var o=e.getBoundingClientRect(),n=1,a=1;t&&L(e)&&(n=e.offsetWidth>0&&re(o.width)/e.offsetWidth||1,a=e.offsetHeight>0&&re(o.height)/e.offsetHeight||1);var c=Z(e)?W(e):window,s=c.visualViewport,i=!wt()&&r,f=(o.left+(i&&s?s.offsetLeft:0))/n,l=(o.top+(i&&s?s.offsetTop:0))/a,v=o.width/n,h=o.height/a;return{width:v,height:h,top:l,right:f+v,bottom:l+h,left:f,x:f,y:l}}function Ve(e){var t=oe(e),r=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:o}}function Pt(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&We(r)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function q(e){return W(e).getComputedStyle(e)}function Ar(e){return["table","td","th"].indexOf(U(e))>=0}function Y(e){return((Z(e)?e.ownerDocument:e.document)||window.document).documentElement}function Pe(e){return U(e)==="html"?e:e.assignedSlot||e.parentNode||(We(e)?e.host:null)||Y(e)}function it(e){return!L(e)||q(e).position==="fixed"?null:e.offsetParent}function Sr(e){var t=/firefox/i.test($e()),r=/Trident/i.test($e());if(r&&L(e)){var o=q(e);if(o.position==="fixed")return null}var n=Pe(e);for(We(n)&&(n=n.host);L(n)&&["html","body"].indexOf(U(n))<0;){var a=q(n);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return n;n=n.parentNode}return null}function ve(e){for(var t=W(e),r=it(e);r&&Ar(r)&&q(r).position==="static";)r=it(r);return r&&(U(r)==="html"||U(r)==="body"&&q(r).position==="static")?t:r||Sr(e)||t}function Le(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ce(e,t,r){return K(e,we(t,r))}function $r(e,t,r){var o=ce(e,t,r);return o>r?r:o}function Ot(){return{top:0,right:0,bottom:0,left:0}}function Et(e){return Object.assign({},Ot(),e)}function Ct(e,t){return t.reduce(function(r,o){return r[o]=e,r},{})}var Dr=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Et(typeof t!="number"?t:Ct(t,de))};function jr(e){var t,r=e.state,o=e.name,n=e.options,a=r.elements.arrow,c=r.modifiersData.popperOffsets,s=I(r.placement),i=Le(s),f=[F,H].indexOf(s)>=0,l=f?"height":"width";if(!(!a||!c)){var v=Dr(n.padding,r),h=Ve(a),p=i==="y"?M:F,x=i==="y"?N:H,d=r.rects.reference[l]+r.rects.reference[i]-c[i]-r.rects.popper[l],m=c[i]-r.rects.reference[i],w=ve(a),O=w?i==="y"?w.clientHeight||0:w.clientWidth||0:0,b=d/2-m/2,u=v[p],g=O-h[l]-v[x],y=O/2-h[l]/2+b,P=ce(u,y,g),A=i;r.modifiersData[o]=(t={},t[A]=P,t.centerOffset=P-y,t)}}function kr(e){var t=e.state,r=e.options,o=r.element,n=o===void 0?"[data-popper-arrow]":o;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||Pt(t.elements.popper,n)&&(t.elements.arrow=n))}const Tr={name:"arrow",enabled:!0,phase:"main",fn:jr,effect:kr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ne(e){return e.split("-")[1]}var Br={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mr(e,t){var r=e.x,o=e.y,n=t.devicePixelRatio||1;return{x:re(r*n)/n||0,y:re(o*n)/n||0}}function st(e){var t,r=e.popper,o=e.popperRect,n=e.placement,a=e.variation,c=e.offsets,s=e.position,i=e.gpuAcceleration,f=e.adaptive,l=e.roundOffsets,v=e.isFixed,h=c.x,p=h===void 0?0:h,x=c.y,d=x===void 0?0:x,m=typeof l=="function"?l({x:p,y:d}):{x:p,y:d};p=m.x,d=m.y;var w=c.hasOwnProperty("x"),O=c.hasOwnProperty("y"),b=F,u=M,g=window;if(f){var y=ve(r),P="clientHeight",A="clientWidth";if(y===W(r)&&(y=Y(r),q(y).position!=="static"&&s==="absolute"&&(P="scrollHeight",A="scrollWidth")),y=y,n===M||(n===F||n===H)&&a===ue){u=N;var C=v&&y===g&&g.visualViewport?g.visualViewport.height:y[P];d-=C-o.height,d*=i?1:-1}if(n===F||(n===M||n===N)&&a===ue){b=H;var R=v&&y===g&&g.visualViewport?g.visualViewport.width:y[A];p-=R-o.width,p*=i?1:-1}}var $=Object.assign({position:s},f&&Br),k=l===!0?Mr({x:p,y:d},W(r)):{x:p,y:d};if(p=k.x,d=k.y,i){var S;return Object.assign({},$,(S={},S[u]=O?"0":"",S[b]=w?"0":"",S.transform=(g.devicePixelRatio||1)<=1?"translate("+p+"px, "+d+"px)":"translate3d("+p+"px, "+d+"px, 0)",S))}return Object.assign({},$,(t={},t[u]=O?d+"px":"",t[b]=w?p+"px":"",t.transform="",t))}function Fr(e){var t=e.state,r=e.options,o=r.gpuAcceleration,n=o===void 0?!0:o,a=r.adaptive,c=a===void 0?!0:a,s=r.roundOffsets,i=s===void 0?!0:s,f={placement:I(t.placement),variation:ne(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,st(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:i})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,st(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Wr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fr,data:{}};var be={passive:!0};function Vr(e){var t=e.state,r=e.instance,o=e.options,n=o.scroll,a=n===void 0?!0:n,c=o.resize,s=c===void 0?!0:c,i=W(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(l){l.addEventListener("scroll",r.update,be)}),s&&i.addEventListener("resize",r.update,be),function(){a&&f.forEach(function(l){l.removeEventListener("scroll",r.update,be)}),s&&i.removeEventListener("resize",r.update,be)}}const Lr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Vr,data:{}};var Nr={left:"right",right:"left",bottom:"top",top:"bottom"};function xe(e){return e.replace(/left|right|bottom|top/g,function(t){return Nr[t]})}var Hr={start:"end",end:"start"};function lt(e){return e.replace(/start|end/g,function(t){return Hr[t]})}function Ne(e){var t=W(e),r=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:r,scrollTop:o}}function He(e){return oe(Y(e)).left+Ne(e).scrollLeft}function Ir(e,t){var r=W(e),o=Y(e),n=r.visualViewport,a=o.clientWidth,c=o.clientHeight,s=0,i=0;if(n){a=n.width,c=n.height;var f=wt();(f||!f&&t==="fixed")&&(s=n.offsetLeft,i=n.offsetTop)}return{width:a,height:c,x:s+He(e),y:i}}function Ur(e){var t,r=Y(e),o=Ne(e),n=(t=e.ownerDocument)==null?void 0:t.body,a=K(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),c=K(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-o.scrollLeft+He(e),i=-o.scrollTop;return q(n||r).direction==="rtl"&&(s+=K(r.clientWidth,n?n.clientWidth:0)-a),{width:a,height:c,x:s,y:i}}function Ie(e){var t=q(e),r=t.overflow,o=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+o)}function Rt(e){return["html","body","#document"].indexOf(U(e))>=0?e.ownerDocument.body:L(e)&&Ie(e)?e:Rt(Pe(e))}function fe(e,t){var r;t===void 0&&(t=[]);var o=Rt(e),n=o===((r=e.ownerDocument)==null?void 0:r.body),a=W(o),c=n?[a].concat(a.visualViewport||[],Ie(o)?o:[]):o,s=t.concat(c);return n?s:s.concat(fe(Pe(c)))}function De(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function qr(e,t){var r=oe(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function ct(e,t,r){return t===bt?De(Ir(e,r)):Z(t)?qr(t,r):De(Ur(Y(e)))}function zr(e){var t=fe(Pe(e)),r=["absolute","fixed"].indexOf(q(e).position)>=0,o=r&&L(e)?ve(e):e;return Z(o)?t.filter(function(n){return Z(n)&&Pt(n,o)&&U(n)!=="body"}):[]}function Xr(e,t,r,o){var n=t==="clippingParents"?zr(e):[].concat(t),a=[].concat(n,[r]),c=a[0],s=a.reduce(function(i,f){var l=ct(e,f,o);return i.top=K(l.top,i.top),i.right=we(l.right,i.right),i.bottom=we(l.bottom,i.bottom),i.left=K(l.left,i.left),i},ct(e,c,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function At(e){var t=e.reference,r=e.element,o=e.placement,n=o?I(o):null,a=o?ne(o):null,c=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,i;switch(n){case M:i={x:c,y:t.y-r.height};break;case N:i={x:c,y:t.y+t.height};break;case H:i={x:t.x+t.width,y:s};break;case F:i={x:t.x-r.width,y:s};break;default:i={x:t.x,y:t.y}}var f=n?Le(n):null;if(f!=null){var l=f==="y"?"height":"width";switch(a){case te:i[f]=i[f]-(t[l]/2-r[l]/2);break;case ue:i[f]=i[f]+(t[l]/2-r[l]/2);break}}return i}function pe(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=o===void 0?e.placement:o,a=r.strategy,c=a===void 0?e.strategy:a,s=r.boundary,i=s===void 0?pr:s,f=r.rootBoundary,l=f===void 0?bt:f,v=r.elementContext,h=v===void 0?le:v,p=r.altBoundary,x=p===void 0?!1:p,d=r.padding,m=d===void 0?0:d,w=Et(typeof m!="number"?m:Ct(m,de)),O=h===le?dr:le,b=e.rects.popper,u=e.elements[x?O:h],g=Xr(Z(u)?u:u.contextElement||Y(e.elements.popper),i,l,c),y=oe(e.elements.reference),P=At({reference:y,element:b,strategy:"absolute",placement:n}),A=De(Object.assign({},b,P)),C=h===le?A:y,R={top:g.top-C.top+w.top,bottom:C.bottom-g.bottom+w.bottom,left:g.left-C.left+w.left,right:C.right-g.right+w.right},$=e.modifiersData.offset;if(h===le&&$){var k=$[n];Object.keys(R).forEach(function(S){var j=[H,N].indexOf(S)>=0?1:-1,V=[M,N].indexOf(S)>=0?"y":"x";R[S]+=k[V]*j})}return R}function Yr(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=r.boundary,a=r.rootBoundary,c=r.padding,s=r.flipVariations,i=r.allowedAutoPlacements,f=i===void 0?xt:i,l=ne(o),v=l?s?at:at.filter(function(x){return ne(x)===l}):de,h=v.filter(function(x){return f.indexOf(x)>=0});h.length===0&&(h=v);var p=h.reduce(function(x,d){return x[d]=pe(e,{placement:d,boundary:n,rootBoundary:a,padding:c})[I(d)],x},{});return Object.keys(p).sort(function(x,d){return p[x]-p[d]})}function Gr(e){if(I(e)===Fe)return[];var t=xe(e);return[lt(e),t,lt(t)]}function _r(e){var t=e.state,r=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var n=r.mainAxis,a=n===void 0?!0:n,c=r.altAxis,s=c===void 0?!0:c,i=r.fallbackPlacements,f=r.padding,l=r.boundary,v=r.rootBoundary,h=r.altBoundary,p=r.flipVariations,x=p===void 0?!0:p,d=r.allowedAutoPlacements,m=t.options.placement,w=I(m),O=w===m,b=i||(O||!x?[xe(m)]:Gr(m)),u=[m].concat(b).reduce(function(ee,X){return ee.concat(I(X)===Fe?Yr(t,{placement:X,boundary:l,rootBoundary:v,padding:f,flipVariations:x,allowedAutoPlacements:d}):X)},[]),g=t.rects.reference,y=t.rects.popper,P=new Map,A=!0,C=u[0],R=0;R=0,V=j?"width":"height",D=pe(t,{placement:$,boundary:l,rootBoundary:v,altBoundary:h,padding:f}),B=j?S?H:F:S?N:M;g[V]>y[V]&&(B=xe(B));var z=xe(B),G=[];if(a&&G.push(D[k]<=0),s&&G.push(D[B]<=0,D[z]<=0),G.every(function(ee){return ee})){C=$,A=!1;break}P.set($,G)}if(A)for(var me=x?3:1,Oe=function(X){var se=u.find(function(ge){var _=P.get(ge);if(_)return _.slice(0,X).every(function(Ee){return Ee})});if(se)return C=se,"break"},ie=me;ie>0;ie--){var he=Oe(ie);if(he==="break")break}t.placement!==C&&(t.modifiersData[o]._skip=!0,t.placement=C,t.reset=!0)}}const Jr={name:"flip",enabled:!0,phase:"main",fn:_r,requiresIfExists:["offset"],data:{_skip:!1}};function ft(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ut(e){return[M,H,N,F].some(function(t){return e[t]>=0})}function Kr(e){var t=e.state,r=e.name,o=t.rects.reference,n=t.rects.popper,a=t.modifiersData.preventOverflow,c=pe(t,{elementContext:"reference"}),s=pe(t,{altBoundary:!0}),i=ft(c,o),f=ft(s,n,a),l=ut(i),v=ut(f);t.modifiersData[r]={referenceClippingOffsets:i,popperEscapeOffsets:f,isReferenceHidden:l,hasPopperEscaped:v},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":v})}const Qr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kr};function Zr(e,t,r){var o=I(e),n=[F,M].indexOf(o)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,c=a[0],s=a[1];return c=c||0,s=(s||0)*n,[F,H].indexOf(o)>=0?{x:s,y:c}:{x:c,y:s}}function eo(e){var t=e.state,r=e.options,o=e.name,n=r.offset,a=n===void 0?[0,0]:n,c=xt.reduce(function(l,v){return l[v]=Zr(v,t.rects,a),l},{}),s=c[t.placement],i=s.x,f=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=f),t.modifiersData[o]=c}const to={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:eo};function ro(e){var t=e.state,r=e.name;t.modifiersData[r]=At({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const oo={name:"popperOffsets",enabled:!0,phase:"read",fn:ro,data:{}};function no(e){return e==="x"?"y":"x"}function ao(e){var t=e.state,r=e.options,o=e.name,n=r.mainAxis,a=n===void 0?!0:n,c=r.altAxis,s=c===void 0?!1:c,i=r.boundary,f=r.rootBoundary,l=r.altBoundary,v=r.padding,h=r.tether,p=h===void 0?!0:h,x=r.tetherOffset,d=x===void 0?0:x,m=pe(t,{boundary:i,rootBoundary:f,padding:v,altBoundary:l}),w=I(t.placement),O=ne(t.placement),b=!O,u=Le(w),g=no(u),y=t.modifiersData.popperOffsets,P=t.rects.reference,A=t.rects.popper,C=typeof d=="function"?d(Object.assign({},t.rects,{placement:t.placement})):d,R=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(y){if(a){var S,j=u==="y"?M:F,V=u==="y"?N:H,D=u==="y"?"height":"width",B=y[u],z=B+m[j],G=B-m[V],me=p?-A[D]/2:0,Oe=O===te?P[D]:A[D],ie=O===te?-A[D]:-P[D],he=t.elements.arrow,ee=p&&he?Ve(he):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ot(),se=X[j],ge=X[V],_=ce(0,P[D],ee[D]),Ee=b?P[D]/2-me-_-se-R.mainAxis:Oe-_-se-R.mainAxis,$t=b?-P[D]/2+me+_+ge+R.mainAxis:ie+_+ge+R.mainAxis,Ce=t.elements.arrow&&ve(t.elements.arrow),Dt=Ce?u==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,Ue=(S=$==null?void 0:$[u])!=null?S:0,jt=B+Ee-Ue-Dt,kt=B+$t-Ue,qe=ce(p?we(z,jt):z,B,p?K(G,kt):G);y[u]=qe,k[u]=qe-B}if(s){var ze,Tt=u==="x"?M:F,Bt=u==="x"?N:H,J=y[g],ye=g==="y"?"height":"width",Xe=J+m[Tt],Ye=J-m[Bt],Re=[M,F].indexOf(w)!==-1,Ge=(ze=$==null?void 0:$[g])!=null?ze:0,_e=Re?Xe:J-P[ye]-A[ye]-Ge+R.altAxis,Je=Re?J+P[ye]+A[ye]-Ge-R.altAxis:Ye,Ke=p&&Re?$r(_e,J,Je):ce(p?_e:Xe,J,p?Je:Ye);y[g]=Ke,k[g]=Ke-J}t.modifiersData[o]=k}}const io={name:"preventOverflow",enabled:!0,phase:"main",fn:ao,requiresIfExists:["offset"]};function so(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lo(e){return e===W(e)||!L(e)?Ne(e):so(e)}function co(e){var t=e.getBoundingClientRect(),r=re(t.width)/e.offsetWidth||1,o=re(t.height)/e.offsetHeight||1;return r!==1||o!==1}function fo(e,t,r){r===void 0&&(r=!1);var o=L(t),n=L(t)&&co(t),a=Y(t),c=oe(e,n,r),s={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(o||!o&&!r)&&((U(t)!=="body"||Ie(a))&&(s=lo(t)),L(t)?(i=oe(t,!0),i.x+=t.clientLeft,i.y+=t.clientTop):a&&(i.x=He(a))),{x:c.left+s.scrollLeft-i.x,y:c.top+s.scrollTop-i.y,width:c.width,height:c.height}}function uo(e){var t=new Map,r=new Set,o=[];e.forEach(function(a){t.set(a.name,a)});function n(a){r.add(a.name);var c=[].concat(a.requires||[],a.requiresIfExists||[]);c.forEach(function(s){if(!r.has(s)){var i=t.get(s);i&&n(i)}}),o.push(a)}return e.forEach(function(a){r.has(a.name)||n(a)}),o}function po(e){var t=uo(e);return Or.reduce(function(r,o){return r.concat(t.filter(function(n){return n.phase===o}))},[])}function vo(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function mo(e){var t=e.reduce(function(r,o){var n=r[o.name];return r[o.name]=n?Object.assign({},n,o,{options:Object.assign({},n.options,o.options),data:Object.assign({},n.data,o.data)}):o,r},{});return Object.keys(t).map(function(r){return t[r]})}var pt={placement:"bottom",modifiers:[],strategy:"absolute"};function dt(){for(var e=arguments.length,t=new Array(e),r=0;rke({root:["root"]},ur(bo)),Co={},Ro=E.forwardRef(function(t,r){var o;const{anchorEl:n,children:a,direction:c,disablePortal:s,modifiers:i,open:f,placement:l,popperOptions:v,popperRef:h,slotProps:p={},slots:x={},TransitionProps:d}=t,m=ae(t,xo),w=E.useRef(null),O=tt(w,r),b=E.useRef(null),u=tt(b,h),g=E.useRef(u);rt(()=>{g.current=u},[u]),E.useImperativeHandle(h,()=>b.current,[]);const y=Po(l,c),[P,A]=E.useState(y),[C,R]=E.useState(je(n));E.useEffect(()=>{b.current&&b.current.forceUpdate()}),E.useEffect(()=>{n&&R(je(n))},[n]),rt(()=>{if(!C||!f)return;const V=z=>{A(z.placement)};let D=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:z})=>{V(z)}}];i!=null&&(D=D.concat(i)),v&&v.modifiers!=null&&(D=D.concat(v.modifiers));const B=yo(C,w.current,T({placement:y},v,{modifiers:D}));return g.current(B),()=>{B.destroy(),g.current(null)}},[C,s,i,f,v,y]);const $={placement:P};d!==null&&($.TransitionProps=d);const k=Eo(),S=(o=x.root)!=null?o:"div",j=Yt({elementType:S,externalSlotProps:p.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:O},ownerState:t,className:k.root});return Q.jsx(S,T({},j,{children:typeof a=="function"?a($):a}))}),Ao=E.forwardRef(function(t,r){const{anchorEl:o,children:n,container:a,direction:c="ltr",disablePortal:s=!1,keepMounted:i=!1,modifiers:f,open:l,placement:v="bottom",popperOptions:h=Co,popperRef:p,style:x,transition:d=!1,slotProps:m={},slots:w={}}=t,O=ae(t,wo),[b,u]=E.useState(!0),g=()=>{u(!1)},y=()=>{u(!0)};if(!i&&!l&&(!d||b))return null;let P;if(a)P=a;else if(o){const R=je(o);P=R&&Oo(R)?et(R).body:et(null).body}const A=!l&&i&&(!d||b)?"none":void 0,C=d?{in:l,onEnter:g,onExited:y}:void 0;return Q.jsx(Xt,{disablePortal:s,container:P,children:Q.jsx(Ro,T({anchorEl:o,direction:c,disablePortal:s,modifiers:f,ref:r,open:d?!b:l,placement:v,popperOptions:h,popperRef:p,slotProps:m,slots:w},O,{style:T({position:"fixed",top:0,left:0,display:A},x),TransitionProps:C,children:n}))})}),So=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],$o=Be(Ao,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Do=E.forwardRef(function(t,r){var o;const n=qt(),a=Me({props:t,name:"MuiPopper"}),{anchorEl:c,component:s,components:i,componentsProps:f,container:l,disablePortal:v,keepMounted:h,modifiers:p,open:x,placement:d,popperOptions:m,popperRef:w,transition:O,slots:b,slotProps:u}=a,g=ae(a,So),y=(o=b==null?void 0:b.root)!=null?o:i==null?void 0:i.Root,P=T({anchorEl:c,container:l,disablePortal:v,keepMounted:h,modifiers:p,open:x,placement:d,popperOptions:m,popperRef:w,transition:O},g);return Q.jsx($o,T({as:s,direction:n==null?void 0:n.direction,slots:{root:y},slotProps:u??f},P,{ref:r}))}),Uo=Do;function qo({props:e,states:t,muiFormControl:r}){return t.reduce((o,n)=>(o[n]=e[n],r&&typeof e[n]>"u"&&(o[n]=r[n]),o),{})}const jo=E.createContext(void 0),St=jo;function zo(){return E.useContext(St)}function vt(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function mt(e,t=!1){return e&&(vt(e.value)&&e.value!==""||t&&vt(e.defaultValue)&&e.defaultValue!=="")}function ko(e){return e.startAdornment}function To(e){return Te("MuiFormControl",e)}ht("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Bo=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Mo=e=>{const{classes:t,margin:r,fullWidth:o}=e,n={root:["root",r!=="none"&&`margin${gt(r)}`,o&&"fullWidth"]};return ke(n,To,t)},Fo=Be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>T({},t.root,t[`margin${gt(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>T({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),Wo=E.forwardRef(function(t,r){const o=Me({props:t,name:"MuiFormControl"}),{children:n,className:a,color:c="primary",component:s="div",disabled:i=!1,error:f=!1,focused:l,fullWidth:v=!1,hiddenLabel:h=!1,margin:p="none",required:x=!1,size:d="medium",variant:m="outlined"}=o,w=ae(o,Bo),O=T({},o,{color:c,component:s,disabled:i,error:f,fullWidth:v,hiddenLabel:h,margin:p,required:x,size:d,variant:m}),b=Mo(O),[u,g]=E.useState(()=>{let S=!1;return n&&E.Children.forEach(n,j=>{if(!Se(j,["Input","Select"]))return;const V=Se(j,["Select"])?j.props.input:j;V&&ko(V.props)&&(S=!0)}),S}),[y,P]=E.useState(()=>{let S=!1;return n&&E.Children.forEach(n,j=>{Se(j,["Input","Select"])&&(mt(j.props,!0)||mt(j.props.inputProps,!0))&&(S=!0)}),S}),[A,C]=E.useState(!1);i&&A&&C(!1);const R=l!==void 0&&!i?l:A;let $;const k=E.useMemo(()=>({adornedStart:u,setAdornedStart:g,color:c,disabled:i,error:f,filled:y,focused:R,fullWidth:v,hiddenLabel:h,size:d,onBlur:()=>{C(!1)},onEmpty:()=>{P(!1)},onFilled:()=>{P(!0)},onFocus:()=>{C(!0)},registerEffect:$,required:x,variant:m}),[u,c,i,f,y,R,v,h,$,x,d,m]);return Q.jsx(St.Provider,{value:k,children:Q.jsx(Fo,T({as:s,ownerState:O,className:zt(b.root,a),ref:r},w,{children:n}))})}),Xo=Wo,Vo=lr({createStyledComponent:Be("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Me({props:e,name:"MuiStack"})}),Yo=Vo;export{Xo as F,Uo as P,Yo as S,Ho as a,zo as b,St as c,Kt as e,qo as f,mt as i,Io as u}; diff --git a/build/assets/Streamable-1d987e98.js b/build/assets/Streamable-dee96b3f.js similarity index 95% rename from build/assets/Streamable-1d987e98.js rename to build/assets/Streamable-dee96b3f.js index 79ee60937..f61a5acfb 100644 --- a/build/assets/Streamable-1d987e98.js +++ b/build/assets/Streamable-dee96b3f.js @@ -1 +1 @@ -import{g as m,r as f}from"./index-69dca385.js";import{u as _,p as b}from"./index-4cad102d.js";function P(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,L=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!j.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?g(S(t)):{},c(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(L(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=E(h),p=D(f),u=_,d=b;const M="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(M,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),N=P({__proto__:null,default:x},[y]);export{N as S}; +import{g as m,r as f}from"./index-b856be88.js";import{u as _,p as b}from"./index-bd90392c.js";function P(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,L=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!j.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?g(S(t)):{},c(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(L(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=E(h),p=D(f),u=_,d=b;const M="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(M,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),N=P({__proto__:null,default:x},[y]);export{N as S}; diff --git a/build/assets/Tabs-b82c05ad.js b/build/assets/Tabs-88a6cc23.js similarity index 99% rename from build/assets/Tabs-b82c05ad.js rename to build/assets/Tabs-88a6cc23.js index a02e611eb..90cabd756 100644 --- a/build/assets/Tabs-b82c05ad.js +++ b/build/assets/Tabs-88a6cc23.js @@ -1 +1 @@ -import{d as ft,c as pt,s as O,i as Pt,b,r as c,u as ht,_ as rt,f as L,j as S,h as St,m as Lt}from"./index-69dca385.js";import{b4 as Nt,z as Zt,R as $t,L as kt,X as lt,G as ut,J as te}from"./index-94c3c981.js";import{c as Ft}from"./createSvgIcon-7c6eee06.js";let U;function At(){if(U)return U;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),U="reverse",t.scrollLeft>0?U="default":(t.scrollLeft=1,t.scrollLeft===0&&(U="negative")),document.body.removeChild(t),U}function ee(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch(At()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function oe(t){return pt("MuiTab",t)}const le=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),A=le,re=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ne=t=>{const{classes:e,textColor:r,fullWidth:i,wrapped:n,icon:d,label:h,selected:p,disabled:u}=t,m={root:["root",d&&h&&"labelIcon",`textColor${Pt(r)}`,i&&"fullWidth",n&&"wrapped",p&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return St(m,oe,e)},se=O(Nt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Pt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>b({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${A.iconWrapper}`]:b({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${A.selected}`]:{opacity:1},[`&.${A.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),ie=c.forwardRef(function(e,r){const i=ht({props:e,name:"MuiTab"}),{className:n,disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p,icon:u,iconPosition:m="top",indicator:w,label:T,onChange:y,onClick:x,onFocus:j,selected:I,selectionFollowsFocus:g,textColor:H="inherit",value:C,wrapped:nt=!1}=i,X=rt(i,re),Y=b({},i,{disabled:d,disableFocusRipple:h,selected:I,icon:!!u,iconPosition:m,label:!!T,fullWidth:p,textColor:H,wrapped:nt}),D=ne(Y),N=u&&T&&c.isValidElement(u)?c.cloneElement(u,{className:L(D.iconWrapper,u.props.className)}):u,J=R=>{!I&&y&&y(R,C),x&&x(R)},_=R=>{g&&!I&&y&&y(R,C),j&&j(R)};return S.jsxs(se,b({focusRipple:!h,className:L(D.root,n),ref:r,role:"tab","aria-selected":I,disabled:d,onClick:J,onFocus:_,ownerState:Y,tabIndex:I?0:-1},X,{children:[m==="top"||m==="start"?S.jsxs(c.Fragment,{children:[N,T]}):S.jsxs(c.Fragment,{children:[T,N]}),w]}))}),ke=ie,ae=Ft(S.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ce=Ft(S.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function de(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function ue(t,e,r,i={},n=()=>{}){const{ease:d=de,duration:h=300}=i;let p=null;const u=e[t];let m=!1;const w=()=>{m=!0},T=y=>{if(m){n(new Error("Animation cancelled"));return}p===null&&(p=y);const x=Math.min(1,(y-p)/h);if(e[t]=d(x)*(r-u)+u,x>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(T)};return u===r?(n(new Error("Element already at target position")),w):(requestAnimationFrame(T),w)}const be=["onChange"],fe={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function pe(t){const{onChange:e}=t,r=rt(t,be),i=c.useRef(),n=c.useRef(null),d=()=>{i.current=n.current.offsetHeight-n.current.clientHeight};return Zt(()=>{const h=$t(()=>{const u=i.current;d(),u!==i.current&&e(i.current)}),p=kt(n.current);return p.addEventListener("resize",h),()=>{h.clear(),p.removeEventListener("resize",h)}},[e]),c.useEffect(()=>{d(),e(i.current)},[e]),S.jsx("div",b({style:fe,ref:n},r))}function he(t){return pt("MuiTabScrollButton",t)}const Se=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ve=Se,me=["className","slots","slotProps","direction","orientation","disabled"],xe=t=>{const{classes:e,orientation:r,disabled:i}=t;return St({root:["root",r,i&&"disabled"]},he,e)},ge=O(Nt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>b({width:40,flexShrink:0,opacity:.8,[`&.${ve.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),ye=c.forwardRef(function(e,r){var i,n;const d=ht({props:e,name:"MuiTabScrollButton"}),{className:h,slots:p={},slotProps:u={},direction:m}=d,w=rt(d,me),y=Lt().direction==="rtl",x=b({isRtl:y},d),j=xe(x),I=(i=p.StartScrollButtonIcon)!=null?i:ae,g=(n=p.EndScrollButtonIcon)!=null?n:ce,H=lt({elementType:I,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x}),C=lt({elementType:g,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x});return S.jsx(ge,b({component:"div",className:L(j.root,h),ref:r,role:null,ownerState:x,tabIndex:null},w,{children:m==="left"?S.jsx(I,b({},H)):S.jsx(g,b({},C))}))}),Ce=ye;function Be(t){return pt("MuiTabs",t)}const we=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),bt=we,Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Rt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,zt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let i=!1,n=r(t,e);for(;n;){if(n===t.firstChild){if(i)return;i=!0}const d=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||d)n=r(t,n);else{n.focus();return}}},Ie=t=>{const{vertical:e,fixed:r,hideScrollbar:i,scrollableX:n,scrollableY:d,centered:h,scrollButtonsHideMobile:p,classes:u}=t;return St({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",i&&"hideScrollbar",n&&"scrollableX",d&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",p&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[i&&"hideScrollbar"]},Be,u)},Ee=O("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Me=O("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Re=O("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>b({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),ze=O("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),We=O(pe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Wt={},Pe=c.forwardRef(function(e,r){const i=ht({props:e,name:"MuiTabs"}),n=Lt(),d=n.direction==="rtl",{"aria-label":h,"aria-labelledby":p,action:u,centered:m=!1,children:w,className:T,component:y="div",allowScrollButtonsMobile:x=!1,indicatorColor:j="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:H=Ce,scrollButtons:C="auto",selectionFollowsFocus:nt,slots:X={},slotProps:Y={},TabIndicatorProps:D={},TabScrollButtonProps:N={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:st=!1}=i,Ot=rt(i,Te),E=R==="scrollable",B=g==="vertical",K=B?"scrollTop":"scrollLeft",Q=B?"top":"left",Z=B?"bottom":"right",it=B?"clientHeight":"clientWidth",V=B?"height":"width",$=b({},i,{component:y,allowScrollButtonsMobile:x,indicatorColor:j,orientation:g,vertical:B,scrollButtons:C,textColor:J,variant:R,visibleScrollbar:st,fixed:!E,hideScrollbar:E&&!st,scrollableX:E&&!B,scrollableY:E&&B,centered:m&&!E,scrollButtonsHideMobile:!x}),W=Ie($),jt=lt({elementType:X.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:$}),Ht=lt({elementType:X.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:$}),[vt,Xt]=c.useState(!1),[k,mt]=c.useState(Wt),[xt,Dt]=c.useState(!1),[gt,_t]=c.useState(!1),[yt,Ut]=c.useState(!1),[Ct,Yt]=c.useState({overflow:"hidden",scrollbarWidth:0}),Bt=new Map,z=c.useRef(null),F=c.useRef(null),wt=()=>{const o=z.current;let l;if(o){const s=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ee(o,n.direction),scrollWidth:o.scrollWidth,top:s.top,bottom:s.bottom,left:s.left,right:s.right}}let a;if(o&&_!==!1){const s=F.current.children;if(s.length>0){const f=s[Bt.get(_)];a=f?f.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:a}},q=ut(()=>{const{tabsMeta:o,tabMeta:l}=wt();let a=0,s;if(B)s="top",l&&o&&(a=l.top-o.top+o.scrollTop);else if(s=d?"right":"left",l&&o){const v=d?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;a=(d?-1:1)*(l[s]-o[s]+v)}const f={[s]:a,[V]:l?l[V]:0};if(isNaN(k[s])||isNaN(k[V]))mt(f);else{const v=Math.abs(k[s]-f[s]),M=Math.abs(k[V]-f[V]);(v>=1||M>=1)&&mt(f)}}),at=(o,{animation:l=!0}={})=>{l?ue(K,z.current,o,{duration:n.transitions.duration.standard}):z.current[K]=o},Tt=o=>{let l=z.current[K];B?l+=o:(l+=o*(d?-1:1),l*=d&&At()==="reverse"?-1:1),at(l)},It=()=>{const o=z.current[it];let l=0;const a=Array.from(F.current.children);for(let s=0;so){s===0&&(l=o);break}l+=f[it]}return l},Kt=()=>{Tt(-1*It())},Vt=()=>{Tt(It())},qt=c.useCallback(o=>{Yt({overflow:null,scrollbarWidth:o})},[]),Gt=()=>{const o={};o.scrollbarSizeListener=E?S.jsx(We,{onChange:qt,className:L(W.scrollableX,W.hideScrollbar)}):null;const a=E&&(C==="auto"&&(xt||gt)||C===!0);return o.scrollButtonStart=a?S.jsx(H,b({slots:{StartScrollButtonIcon:X.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:jt},orientation:g,direction:d?"right":"left",onClick:Kt,disabled:!xt},N,{className:L(W.scrollButtons,N.className)})):null,o.scrollButtonEnd=a?S.jsx(H,b({slots:{EndScrollButtonIcon:X.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:g,direction:d?"left":"right",onClick:Vt,disabled:!gt},N,{className:L(W.scrollButtons,N.className)})):null,o},Et=ut(o=>{const{tabsMeta:l,tabMeta:a}=wt();if(!(!a||!l)){if(a[Q]l[Z]){const s=l[K]+(a[Z]-l[Z]);at(s,{animation:o})}}}),tt=ut(()=>{E&&C!==!1&&Ut(!yt)});c.useEffect(()=>{const o=$t(()=>{z.current&&q()});let l;const a=v=>{v.forEach(M=>{M.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),M.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},s=kt(z.current);s.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from(F.current.children).forEach(v=>{l.observe(v)})),typeof MutationObserver<"u"&&(f=new MutationObserver(a),f.observe(F.current,{childList:!0})),()=>{var v,M;o.clear(),s.removeEventListener("resize",o),(v=f)==null||v.disconnect(),(M=l)==null||M.disconnect()}},[q,tt]),c.useEffect(()=>{const o=Array.from(F.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&E&&C!==!1){const a=o[0],s=o[l-1],f={root:z.current,threshold:.99},v=dt=>{Dt(!dt[0].isIntersecting)},M=new IntersectionObserver(v,f);M.observe(a);const G=dt=>{_t(!dt[0].isIntersecting)},P=new IntersectionObserver(G,f);return P.observe(s),()=>{M.disconnect(),P.disconnect()}}},[E,C,yt,w==null?void 0:w.length]),c.useEffect(()=>{Xt(!0)},[]),c.useEffect(()=>{q()}),c.useEffect(()=>{Et(Wt!==k)},[Et,k]),c.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const Mt=S.jsx(ze,b({},D,{className:L(W.indicator,D.className),ownerState:$,style:b({},k,D.style)}));let et=0;const Jt=c.Children.map(w,o=>{if(!c.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;Bt.set(l,et);const a=l===_;return et+=1,c.cloneElement(o,b({fullWidth:R==="fullWidth",indicator:a&&!vt&&Mt,selected:a,selectionFollowsFocus:nt,onChange:I,textColor:J,value:l},et===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Qt=o=>{const l=F.current,a=te(l).activeElement;if(a.getAttribute("role")!=="tab")return;let f=g==="horizontal"?"ArrowLeft":"ArrowUp",v=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&d&&(f="ArrowRight",v="ArrowLeft"),o.key){case f:o.preventDefault(),ot(l,a,zt);break;case v:o.preventDefault(),ot(l,a,Rt);break;case"Home":o.preventDefault(),ot(l,null,Rt);break;case"End":o.preventDefault(),ot(l,null,zt);break}},ct=Gt();return S.jsxs(Ee,b({className:L(W.root,T),ownerState:$,ref:r,as:y},Ot,{children:[ct.scrollButtonStart,ct.scrollbarSizeListener,S.jsxs(Me,{className:W.scroller,ownerState:$,style:{overflow:Ct.overflow,[B?`margin${d?"Left":"Right"}`:"marginBottom"]:st?void 0:-Ct.scrollbarWidth},ref:z,children:[S.jsx(Re,{"aria-label":h,"aria-labelledby":p,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:$,onKeyDown:Qt,ref:F,role:"tablist",children:Jt}),vt&&Mt]}),ct.scrollButtonEnd]}))}),Fe=Pe;export{Fe as T,ke as a}; +import{d as ft,c as pt,s as O,i as Pt,b,r as c,u as ht,_ as rt,f as L,j as S,h as St,m as Lt}from"./index-b856be88.js";import{b4 as Nt,z as Zt,R as $t,L as kt,X as lt,G as ut,J as te}from"./index-c59af388.js";import{c as Ft}from"./createSvgIcon-ed559792.js";let U;function At(){if(U)return U;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),U="reverse",t.scrollLeft>0?U="default":(t.scrollLeft=1,t.scrollLeft===0&&(U="negative")),document.body.removeChild(t),U}function ee(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch(At()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function oe(t){return pt("MuiTab",t)}const le=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),A=le,re=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ne=t=>{const{classes:e,textColor:r,fullWidth:i,wrapped:n,icon:d,label:h,selected:p,disabled:u}=t,m={root:["root",d&&h&&"labelIcon",`textColor${Pt(r)}`,i&&"fullWidth",n&&"wrapped",p&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return St(m,oe,e)},se=O(Nt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Pt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>b({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${A.iconWrapper}`]:b({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${A.selected}`]:{opacity:1},[`&.${A.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),ie=c.forwardRef(function(e,r){const i=ht({props:e,name:"MuiTab"}),{className:n,disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p,icon:u,iconPosition:m="top",indicator:w,label:T,onChange:y,onClick:x,onFocus:j,selected:I,selectionFollowsFocus:g,textColor:H="inherit",value:C,wrapped:nt=!1}=i,X=rt(i,re),Y=b({},i,{disabled:d,disableFocusRipple:h,selected:I,icon:!!u,iconPosition:m,label:!!T,fullWidth:p,textColor:H,wrapped:nt}),D=ne(Y),N=u&&T&&c.isValidElement(u)?c.cloneElement(u,{className:L(D.iconWrapper,u.props.className)}):u,J=R=>{!I&&y&&y(R,C),x&&x(R)},_=R=>{g&&!I&&y&&y(R,C),j&&j(R)};return S.jsxs(se,b({focusRipple:!h,className:L(D.root,n),ref:r,role:"tab","aria-selected":I,disabled:d,onClick:J,onFocus:_,ownerState:Y,tabIndex:I?0:-1},X,{children:[m==="top"||m==="start"?S.jsxs(c.Fragment,{children:[N,T]}):S.jsxs(c.Fragment,{children:[T,N]}),w]}))}),ke=ie,ae=Ft(S.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ce=Ft(S.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function de(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function ue(t,e,r,i={},n=()=>{}){const{ease:d=de,duration:h=300}=i;let p=null;const u=e[t];let m=!1;const w=()=>{m=!0},T=y=>{if(m){n(new Error("Animation cancelled"));return}p===null&&(p=y);const x=Math.min(1,(y-p)/h);if(e[t]=d(x)*(r-u)+u,x>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(T)};return u===r?(n(new Error("Element already at target position")),w):(requestAnimationFrame(T),w)}const be=["onChange"],fe={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function pe(t){const{onChange:e}=t,r=rt(t,be),i=c.useRef(),n=c.useRef(null),d=()=>{i.current=n.current.offsetHeight-n.current.clientHeight};return Zt(()=>{const h=$t(()=>{const u=i.current;d(),u!==i.current&&e(i.current)}),p=kt(n.current);return p.addEventListener("resize",h),()=>{h.clear(),p.removeEventListener("resize",h)}},[e]),c.useEffect(()=>{d(),e(i.current)},[e]),S.jsx("div",b({style:fe,ref:n},r))}function he(t){return pt("MuiTabScrollButton",t)}const Se=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ve=Se,me=["className","slots","slotProps","direction","orientation","disabled"],xe=t=>{const{classes:e,orientation:r,disabled:i}=t;return St({root:["root",r,i&&"disabled"]},he,e)},ge=O(Nt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>b({width:40,flexShrink:0,opacity:.8,[`&.${ve.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),ye=c.forwardRef(function(e,r){var i,n;const d=ht({props:e,name:"MuiTabScrollButton"}),{className:h,slots:p={},slotProps:u={},direction:m}=d,w=rt(d,me),y=Lt().direction==="rtl",x=b({isRtl:y},d),j=xe(x),I=(i=p.StartScrollButtonIcon)!=null?i:ae,g=(n=p.EndScrollButtonIcon)!=null?n:ce,H=lt({elementType:I,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x}),C=lt({elementType:g,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x});return S.jsx(ge,b({component:"div",className:L(j.root,h),ref:r,role:null,ownerState:x,tabIndex:null},w,{children:m==="left"?S.jsx(I,b({},H)):S.jsx(g,b({},C))}))}),Ce=ye;function Be(t){return pt("MuiTabs",t)}const we=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),bt=we,Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Rt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,zt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let i=!1,n=r(t,e);for(;n;){if(n===t.firstChild){if(i)return;i=!0}const d=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||d)n=r(t,n);else{n.focus();return}}},Ie=t=>{const{vertical:e,fixed:r,hideScrollbar:i,scrollableX:n,scrollableY:d,centered:h,scrollButtonsHideMobile:p,classes:u}=t;return St({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",i&&"hideScrollbar",n&&"scrollableX",d&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",p&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[i&&"hideScrollbar"]},Be,u)},Ee=O("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Me=O("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Re=O("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>b({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),ze=O("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),We=O(pe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Wt={},Pe=c.forwardRef(function(e,r){const i=ht({props:e,name:"MuiTabs"}),n=Lt(),d=n.direction==="rtl",{"aria-label":h,"aria-labelledby":p,action:u,centered:m=!1,children:w,className:T,component:y="div",allowScrollButtonsMobile:x=!1,indicatorColor:j="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:H=Ce,scrollButtons:C="auto",selectionFollowsFocus:nt,slots:X={},slotProps:Y={},TabIndicatorProps:D={},TabScrollButtonProps:N={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:st=!1}=i,Ot=rt(i,Te),E=R==="scrollable",B=g==="vertical",K=B?"scrollTop":"scrollLeft",Q=B?"top":"left",Z=B?"bottom":"right",it=B?"clientHeight":"clientWidth",V=B?"height":"width",$=b({},i,{component:y,allowScrollButtonsMobile:x,indicatorColor:j,orientation:g,vertical:B,scrollButtons:C,textColor:J,variant:R,visibleScrollbar:st,fixed:!E,hideScrollbar:E&&!st,scrollableX:E&&!B,scrollableY:E&&B,centered:m&&!E,scrollButtonsHideMobile:!x}),W=Ie($),jt=lt({elementType:X.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:$}),Ht=lt({elementType:X.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:$}),[vt,Xt]=c.useState(!1),[k,mt]=c.useState(Wt),[xt,Dt]=c.useState(!1),[gt,_t]=c.useState(!1),[yt,Ut]=c.useState(!1),[Ct,Yt]=c.useState({overflow:"hidden",scrollbarWidth:0}),Bt=new Map,z=c.useRef(null),F=c.useRef(null),wt=()=>{const o=z.current;let l;if(o){const s=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ee(o,n.direction),scrollWidth:o.scrollWidth,top:s.top,bottom:s.bottom,left:s.left,right:s.right}}let a;if(o&&_!==!1){const s=F.current.children;if(s.length>0){const f=s[Bt.get(_)];a=f?f.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:a}},q=ut(()=>{const{tabsMeta:o,tabMeta:l}=wt();let a=0,s;if(B)s="top",l&&o&&(a=l.top-o.top+o.scrollTop);else if(s=d?"right":"left",l&&o){const v=d?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;a=(d?-1:1)*(l[s]-o[s]+v)}const f={[s]:a,[V]:l?l[V]:0};if(isNaN(k[s])||isNaN(k[V]))mt(f);else{const v=Math.abs(k[s]-f[s]),M=Math.abs(k[V]-f[V]);(v>=1||M>=1)&&mt(f)}}),at=(o,{animation:l=!0}={})=>{l?ue(K,z.current,o,{duration:n.transitions.duration.standard}):z.current[K]=o},Tt=o=>{let l=z.current[K];B?l+=o:(l+=o*(d?-1:1),l*=d&&At()==="reverse"?-1:1),at(l)},It=()=>{const o=z.current[it];let l=0;const a=Array.from(F.current.children);for(let s=0;so){s===0&&(l=o);break}l+=f[it]}return l},Kt=()=>{Tt(-1*It())},Vt=()=>{Tt(It())},qt=c.useCallback(o=>{Yt({overflow:null,scrollbarWidth:o})},[]),Gt=()=>{const o={};o.scrollbarSizeListener=E?S.jsx(We,{onChange:qt,className:L(W.scrollableX,W.hideScrollbar)}):null;const a=E&&(C==="auto"&&(xt||gt)||C===!0);return o.scrollButtonStart=a?S.jsx(H,b({slots:{StartScrollButtonIcon:X.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:jt},orientation:g,direction:d?"right":"left",onClick:Kt,disabled:!xt},N,{className:L(W.scrollButtons,N.className)})):null,o.scrollButtonEnd=a?S.jsx(H,b({slots:{EndScrollButtonIcon:X.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:g,direction:d?"left":"right",onClick:Vt,disabled:!gt},N,{className:L(W.scrollButtons,N.className)})):null,o},Et=ut(o=>{const{tabsMeta:l,tabMeta:a}=wt();if(!(!a||!l)){if(a[Q]l[Z]){const s=l[K]+(a[Z]-l[Z]);at(s,{animation:o})}}}),tt=ut(()=>{E&&C!==!1&&Ut(!yt)});c.useEffect(()=>{const o=$t(()=>{z.current&&q()});let l;const a=v=>{v.forEach(M=>{M.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),M.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},s=kt(z.current);s.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from(F.current.children).forEach(v=>{l.observe(v)})),typeof MutationObserver<"u"&&(f=new MutationObserver(a),f.observe(F.current,{childList:!0})),()=>{var v,M;o.clear(),s.removeEventListener("resize",o),(v=f)==null||v.disconnect(),(M=l)==null||M.disconnect()}},[q,tt]),c.useEffect(()=>{const o=Array.from(F.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&E&&C!==!1){const a=o[0],s=o[l-1],f={root:z.current,threshold:.99},v=dt=>{Dt(!dt[0].isIntersecting)},M=new IntersectionObserver(v,f);M.observe(a);const G=dt=>{_t(!dt[0].isIntersecting)},P=new IntersectionObserver(G,f);return P.observe(s),()=>{M.disconnect(),P.disconnect()}}},[E,C,yt,w==null?void 0:w.length]),c.useEffect(()=>{Xt(!0)},[]),c.useEffect(()=>{q()}),c.useEffect(()=>{Et(Wt!==k)},[Et,k]),c.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const Mt=S.jsx(ze,b({},D,{className:L(W.indicator,D.className),ownerState:$,style:b({},k,D.style)}));let et=0;const Jt=c.Children.map(w,o=>{if(!c.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;Bt.set(l,et);const a=l===_;return et+=1,c.cloneElement(o,b({fullWidth:R==="fullWidth",indicator:a&&!vt&&Mt,selected:a,selectionFollowsFocus:nt,onChange:I,textColor:J,value:l},et===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Qt=o=>{const l=F.current,a=te(l).activeElement;if(a.getAttribute("role")!=="tab")return;let f=g==="horizontal"?"ArrowLeft":"ArrowUp",v=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&d&&(f="ArrowRight",v="ArrowLeft"),o.key){case f:o.preventDefault(),ot(l,a,zt);break;case v:o.preventDefault(),ot(l,a,Rt);break;case"Home":o.preventDefault(),ot(l,null,Rt);break;case"End":o.preventDefault(),ot(l,null,zt);break}},ct=Gt();return S.jsxs(Ee,b({className:L(W.root,T),ownerState:$,ref:r,as:y},Ot,{children:[ct.scrollButtonStart,ct.scrollbarSizeListener,S.jsxs(Me,{className:W.scroller,ownerState:$,style:{overflow:Ct.overflow,[B?`margin${d?"Left":"Right"}`:"marginBottom"]:st?void 0:-Ct.scrollbarWidth},ref:z,children:[S.jsx(Re,{"aria-label":h,"aria-labelledby":p,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:$,onKeyDown:Qt,ref:F,role:"tablist",children:Jt}),vt&&Mt]}),ct.scrollButtonEnd]}))}),Fe=Pe;export{Fe as T,ke as a}; diff --git a/build/assets/TextareaAutosize-6f8daf3f.js b/build/assets/TextareaAutosize-981375ed.js similarity index 94% rename from build/assets/TextareaAutosize-6f8daf3f.js rename to build/assets/TextareaAutosize-981375ed.js index 7c5581d32..e72d622a2 100644 --- a/build/assets/TextareaAutosize-6f8daf3f.js +++ b/build/assets/TextareaAutosize-981375ed.js @@ -1,2 +1,2 @@ -import{r as o,_ as B,j as p,b as v,l as I}from"./index-69dca385.js";import{y as D,L as T,z as F,R as P}from"./index-94c3c981.js";const U=["onChange","maxRows","minRows","style","value"];function m(r){return parseInt(r,10)||0}const V={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function M(r){return r==null||Object.keys(r).length===0||r.outerHeightStyle===0&&!r.overflow}const G=o.forwardRef(function(l,O){const{onChange:R,maxRows:y,minRows:h=1,style:S,value:x}=l,k=B(l,U),{current:A}=o.useRef(x!=null),b=o.useRef(null),L=D(O,b),H=o.useRef(null),c=o.useRef(0),[z,E]=o.useState({outerHeightStyle:0}),f=o.useCallback(()=>{const e=b.current,n=T(e).getComputedStyle(e);if(n.width==="0px")return{outerHeightStyle:0};const t=H.current;t.style.width=n.width,t.value=e.value||l.placeholder||"x",t.value.slice(-1)===` +import{r as o,_ as B,j as p,b as v,l as I}from"./index-b856be88.js";import{y as D,L as T,z as F,R as P}from"./index-c59af388.js";const U=["onChange","maxRows","minRows","style","value"];function m(r){return parseInt(r,10)||0}const V={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function M(r){return r==null||Object.keys(r).length===0||r.outerHeightStyle===0&&!r.overflow}const G=o.forwardRef(function(l,O){const{onChange:R,maxRows:y,minRows:h=1,style:S,value:x}=l,k=B(l,U),{current:A}=o.useRef(x!=null),b=o.useRef(null),L=D(O,b),H=o.useRef(null),c=o.useRef(0),[z,E]=o.useState({outerHeightStyle:0}),f=o.useCallback(()=>{const e=b.current,n=T(e).getComputedStyle(e);if(n.width==="0px")return{outerHeightStyle:0};const t=H.current;t.style.width=n.width,t.value=e.value||l.placeholder||"x",t.value.slice(-1)===` `&&(t.value+=" ");const g=n.boxSizing,w=m(n.paddingBottom)+m(n.paddingTop),a=m(n.borderBottomWidth)+m(n.borderTopWidth),u=t.scrollHeight;t.value="x";const d=t.scrollHeight;let s=u;h&&(s=Math.max(Number(h)*d,s)),y&&(s=Math.min(Number(y)*d,s)),s=Math.max(s,d);const _=s+(g==="border-box"?w+a:0),j=Math.abs(s-u)<=1;return{outerHeightStyle:_,overflow:j}},[y,h,l.placeholder]),C=(e,i)=>{const{outerHeightStyle:n,overflow:t}=i;return c.current<20&&(n>0&&Math.abs((e.outerHeightStyle||0)-n)>1||e.overflow!==t)?(c.current+=1,{overflow:t,outerHeightStyle:n}):e},W=o.useCallback(()=>{const e=f();M(e)||E(i=>C(i,e))},[f]);F(()=>{const e=()=>{const u=f();M(u)||I.flushSync(()=>{E(d=>C(d,u))})},i=()=>{c.current=0,e()};let n;const t=P(i),g=b.current,w=T(g);w.addEventListener("resize",t);let a;return typeof ResizeObserver<"u"&&(a=new ResizeObserver(i),a.observe(g)),()=>{t.clear(),cancelAnimationFrame(n),w.removeEventListener("resize",t),a&&a.disconnect()}},[f]),F(()=>{W()}),o.useEffect(()=>{c.current=0},[x]);const N=e=>{c.current=0,A||W(),R&&R(e)};return p.jsxs(o.Fragment,{children:[p.jsx("textarea",v({value:x,onChange:N,ref:L,rows:h,style:v({height:z.outerHeightStyle,overflow:z.overflow?"hidden":void 0},S)},k)),p.jsx("textarea",{"aria-hidden":!0,className:l.className,readOnly:!0,ref:H,tabIndex:-1,style:v({},V.shadow,S,{paddingTop:0,paddingBottom:0})})]})});export{G as T}; diff --git a/build/assets/Twitch-d246f176.js b/build/assets/Twitch-1acf7e0c.js similarity index 95% rename from build/assets/Twitch-d246f176.js rename to build/assets/Twitch-1acf7e0c.js index 3e2df69c5..714857f2e 100644 --- a/build/assets/Twitch-d246f176.js +++ b/build/assets/Twitch-1acf7e0c.js @@ -1 +1 @@ -import{g as w,r as D}from"./index-69dca385.js";import{u as C,p as N}from"./index-4cad102d.js";function I(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,j=Object.getOwnPropertyDescriptor,A=Object.getOwnPropertyNames,M=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of A(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?S(M(t)):{},_(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),d=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends d.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),o(this,"mute",()=>{this.callPlayer("setMuted",!0)}),o(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:n,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(y=>{this.player=new y.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...n.options});const{READY:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=y.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return d.default.createElement("div",{style:e,id:this.playerID})}}o(h,"displayName","Twitch");o(h,"canPlay",u.canPlay.twitch);o(h,"loopOnEnded",!0);const W=w(f),k=I({__proto__:null,default:W},[f]);export{k as T}; +import{g as w,r as D}from"./index-b856be88.js";import{u as C,p as N}from"./index-bd90392c.js";function I(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,j=Object.getOwnPropertyDescriptor,A=Object.getOwnPropertyNames,M=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of A(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?S(M(t)):{},_(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),d=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends d.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),o(this,"mute",()=>{this.callPlayer("setMuted",!0)}),o(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:n,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(y=>{this.player=new y.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...n.options});const{READY:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=y.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return d.default.createElement("div",{style:e,id:this.playerID})}}o(h,"displayName","Twitch");o(h,"canPlay",u.canPlay.twitch);o(h,"loopOnEnded",!0);const W=w(f),k=I({__proto__:null,default:W},[f]);export{k as T}; diff --git a/build/assets/Typography-543ae8c6.js b/build/assets/Typography-69404db2.js similarity index 93% rename from build/assets/Typography-543ae8c6.js rename to build/assets/Typography-69404db2.js index a29216207..0b09674e3 100644 --- a/build/assets/Typography-543ae8c6.js +++ b/build/assets/Typography-69404db2.js @@ -1 +1 @@ -import{c as T,d as B,s as W,i as u,b as s,r as C,u as M,_ as R,j as P,f as j,h as U}from"./index-69dca385.js";import{e as _}from"./Stack-57ab9e76.js";function N(a){return T("MuiTypography",a)}B("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const $=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],E=a=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:i,variant:o,classes:p}=a,e={root:["root",o,a.align!=="inherit"&&`align${u(t)}`,r&&"gutterBottom",n&&"noWrap",i&&"paragraph"]};return U(e,N,p)},L=W("span",{name:"MuiTypography",slot:"Root",overridesResolver:(a,t)=>{const{ownerState:r}=a;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${u(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:a,ownerState:t})=>s({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&a.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),y={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},z={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},A=a=>z[a]||a,D=C.forwardRef(function(t,r){const n=M({props:t,name:"MuiTypography"}),i=A(n.color),o=_(s({},n,{color:i})),{align:p="inherit",className:e,component:g,gutterBottom:d=!1,noWrap:f=!1,paragraph:l=!1,variant:h="body1",variantMapping:c=y}=o,x=R(o,$),m=s({},o,{align:p,color:i,className:e,component:g,gutterBottom:d,noWrap:f,paragraph:l,variant:h,variantMapping:c}),v=g||(l?"p":c[h]||y[h])||"span",b=E(m);return P.jsx(L,s({as:v,ref:r,ownerState:m,className:j(b.root,e)},x))}),V=D;export{V as T}; +import{c as T,d as B,s as W,i as u,b as s,r as C,u as M,_ as R,j as P,f as j,h as U}from"./index-b856be88.js";import{e as _}from"./Stack-e0f879a7.js";function N(a){return T("MuiTypography",a)}B("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const $=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],E=a=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:i,variant:o,classes:p}=a,e={root:["root",o,a.align!=="inherit"&&`align${u(t)}`,r&&"gutterBottom",n&&"noWrap",i&&"paragraph"]};return U(e,N,p)},L=W("span",{name:"MuiTypography",slot:"Root",overridesResolver:(a,t)=>{const{ownerState:r}=a;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${u(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:a,ownerState:t})=>s({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&a.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),y={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},z={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},A=a=>z[a]||a,D=C.forwardRef(function(t,r){const n=M({props:t,name:"MuiTypography"}),i=A(n.color),o=_(s({},n,{color:i})),{align:p="inherit",className:e,component:g,gutterBottom:d=!1,noWrap:f=!1,paragraph:l=!1,variant:h="body1",variantMapping:c=y}=o,x=R(o,$),m=s({},o,{align:p,color:i,className:e,component:g,gutterBottom:d,noWrap:f,paragraph:l,variant:h,variantMapping:c}),v=g||(l?"p":c[h]||y[h])||"span",b=E(m);return P.jsx(L,s({as:v,ref:r,ownerState:m,className:j(b.root,e)},x))}),V=D;export{V as T}; diff --git a/build/assets/Vidyard-4e893f64.js b/build/assets/Vidyard-aa66148d.js similarity index 95% rename from build/assets/Vidyard-4e893f64.js rename to build/assets/Vidyard-aa66148d.js index bfa8c93d6..2068b9aa7 100644 --- a/build/assets/Vidyard-4e893f64.js +++ b/build/assets/Vidyard-aa66148d.js @@ -1 +1 @@ -import{g,r as v}from"./index-69dca385.js";import{u as b,p as O}from"./index-4cad102d.js";function V(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(o=j(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?D(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),s=(t,e,r)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),s(this,"callPlayer",d.callPlayer),s(this,"mute",()=>{this.setVolume(0)}),s(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:o,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,m)=>{this.player||(this.player=m,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...o.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}s(y,"displayName","Vidyard");s(y,"canPlay",P.canPlay.vidyard);const T=g(f),B=V({__proto__:null,default:T},[f]);export{B as V}; +import{g,r as v}from"./index-b856be88.js";import{u as b,p as O}from"./index-bd90392c.js";function V(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(o=j(e,a))||o.enumerable});return t},L=(t,e,r)=>(r=t!=null?D(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),s=(t,e,r)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),s(this,"callPlayer",d.callPlayer),s(this,"mute",()=>{this.setVolume(0)}),s(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:o,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,m)=>{this.player||(this.player=m,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...o.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}s(y,"displayName","Vidyard");s(y,"canPlay",P.canPlay.vidyard);const T=g(f),B=V({__proto__:null,default:T},[f]);export{B as V}; diff --git a/build/assets/Vimeo-797d4bed.js b/build/assets/Vimeo-a97267b2.js similarity index 96% rename from build/assets/Vimeo-797d4bed.js rename to build/assets/Vimeo-a97267b2.js index 07b588066..5abf68918 100644 --- a/build/assets/Vimeo-797d4bed.js +++ b/build/assets/Vimeo-a97267b2.js @@ -1 +1 @@ -import{g as d,r as f}from"./index-69dca385.js";import{u as m,p as _}from"./index-4cad102d.js";function P(t,e){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},M=(t,e,r)=>(r=t!=null?g(O(t)):{},h(e||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};j(c,{default:()=>l});var y=E(c),p=M(f),u=m,L=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",L.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),R=P({__proto__:null,default:T},[y]);export{R as V}; +import{g as d,r as f}from"./index-b856be88.js";import{u as m,p as _}from"./index-bd90392c.js";function P(t,e){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},M=(t,e,r)=>(r=t!=null?g(O(t)):{},h(e||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};j(c,{default:()=>l});var y=E(c),p=M(f),u=m,L=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",L.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),R=P({__proto__:null,default:T},[y]);export{R as V}; diff --git a/build/assets/Wistia-8fb3c44b.js b/build/assets/Wistia-ed034142.js similarity index 96% rename from build/assets/Wistia-8fb3c44b.js rename to build/assets/Wistia-ed034142.js index ed399d8df..45bf34cdf 100644 --- a/build/assets/Wistia-8fb3c44b.js +++ b/build/assets/Wistia-ed034142.js @@ -1 +1 @@ -import{g as m,r as g}from"./index-69dca385.js";import{u as v,p as w}from"./index-4cad102d.js";function O(t,e){for(var a=0;as[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(e||!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),W=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=W(d),y=I(g),c=v,P=w;const M="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(M,x).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const L=m(_),$=O({__proto__:null,default:L},[_]);export{$ as W}; +import{g as m,r as g}from"./index-b856be88.js";import{u as v,p as w}from"./index-bd90392c.js";function O(t,e){for(var a=0;as[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(e||!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),W=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=W(d),y=I(g),c=v,P=w;const M="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(M,x).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const L=m(_),$=O({__proto__:null,default:L},[_]);export{$ as W}; diff --git a/build/assets/YouTube-c46c3d3c.js b/build/assets/YouTube-3fc59bb4.js similarity index 97% rename from build/assets/YouTube-c46c3d3c.js rename to build/assets/YouTube-3fc59bb4.js index d0fbf4747..27485d6cf 100644 --- a/build/assets/YouTube-c46c3d3c.js +++ b/build/assets/YouTube-3fc59bb4.js @@ -1 +1 @@ -import{g as U,r as I}from"./index-69dca385.js";import{u as L,p as Y}from"./index-4cad102d.js";function k(a,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,u=Object.defineProperty,j=Object.getOwnPropertyDescriptor,N=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=j(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?M(V(a)):{},v(e||!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),m=F(I),p=L,D=Y;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,b=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends m.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(b.test(e)){const[,t]=e.match(b);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:c,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===c&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const R=!!this.callPlayer("getPlaylist");y&&!R&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||b.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||l.start,endSeconds:(0,p.parseEndTime)(e)||l.end});return}(0,p.getSDK)(G,T,z,c=>c.loaded).then(c=>{this.container&&(this.player=new c.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return m.default.createElement("div",{style:t},m.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),W=k({__proto__:null,default:$},[S]);export{W as Y}; +import{g as U,r as I}from"./index-b856be88.js";import{u as L,p as Y}from"./index-bd90392c.js";function k(a,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,u=Object.defineProperty,j=Object.getOwnPropertyDescriptor,N=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=j(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?M(V(a)):{},v(e||!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),m=F(I),p=L,D=Y;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,b=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends m.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(b.test(e)){const[,t]=e.match(b);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:c,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===c&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const R=!!this.callPlayer("getPlaylist");y&&!R&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||b.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||l.start,endSeconds:(0,p.parseEndTime)(e)||l.end});return}(0,p.getSDK)(G,T,z,c=>c.loaded).then(c=>{this.container&&(this.player=new c.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return m.default.createElement("div",{style:t},m.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),W=k({__proto__:null,default:$},[S]);export{W as Y}; diff --git a/build/assets/constants-a86c243d.js b/build/assets/constants-011d5486.js similarity index 79% rename from build/assets/constants-a86c243d.js rename to build/assets/constants-011d5486.js index d4cd351c3..8df49bd0d 100644 --- a/build/assets/constants-a86c243d.js +++ b/build/assets/constants-011d5486.js @@ -1,4 +1,4 @@ -import{t,aD as s,aB as a,aC as o}from"./index-69dca385.js";import{aw as n}from"./index-94c3c981.js";const T={[s]:"RSS link",[a]:"Twitter Handle",[o]:"Youtube channel"},r="Sources Table",E="Queued Sources",i="Topics",S="View Content",I="date",u="edge_count",l="alphabetically",p="https://twitter.com",A="IS_ALIAS",_="https://www.twitter.com/anyuser/status/",d=t(n)` +import{t,aD as s,aB as a,aC as o}from"./index-b856be88.js";import{aw as n}from"./index-c59af388.js";const T={[s]:"RSS link",[a]:"Twitter Handle",[o]:"Youtube channel"},r="Sources Table",E="Queued Sources",i="Topics",S="View Content",I="date",u="edge_count",l="alphabetically",p="https://twitter.com",A="IS_ALIAS",_="https://www.twitter.com/anyuser/status/",d=t(n)` && { vertical-align: middle; margin: 5px 0 0 4px; diff --git a/build/assets/createSvgIcon-7c6eee06.js b/build/assets/createSvgIcon-ed559792.js similarity index 97% rename from build/assets/createSvgIcon-7c6eee06.js rename to build/assets/createSvgIcon-ed559792.js index 94873f5c7..56c6783f8 100644 --- a/build/assets/createSvgIcon-7c6eee06.js +++ b/build/assets/createSvgIcon-ed559792.js @@ -1 +1 @@ -import{c as I,d as C,s as w,i as f,r as v,u as R,_ as b,b as g,j as S,f as j,h as N}from"./index-69dca385.js";function A(o){return I("MuiSvgIcon",o)}C("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const B=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],M=o=>{const{color:e,fontSize:t,classes:i}=o,n={root:["root",e!=="inherit"&&`color${f(e)}`,`fontSize${f(t)}`]};return N(n,A,i)},T=w("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,t.color!=="inherit"&&e[`color${f(t.color)}`],e[`fontSize${f(t.fontSize)}`]]}})(({theme:o,ownerState:e})=>{var t,i,n,u,m,a,h,p,d,r,s,c,l;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(t=o.transitions)==null||(i=t.create)==null?void 0:i.call(t,"fill",{duration:(n=o.transitions)==null||(n=n.duration)==null?void 0:n.shorter}),fontSize:{inherit:"inherit",small:((u=o.typography)==null||(m=u.pxToRem)==null?void 0:m.call(u,20))||"1.25rem",medium:((a=o.typography)==null||(h=a.pxToRem)==null?void 0:h.call(a,24))||"1.5rem",large:((p=o.typography)==null||(d=p.pxToRem)==null?void 0:d.call(p,35))||"2.1875rem"}[e.fontSize],color:(r=(s=(o.vars||o).palette)==null||(s=s[e.color])==null?void 0:s.main)!=null?r:{action:(c=(o.vars||o).palette)==null||(c=c.action)==null?void 0:c.active,disabled:(l=(o.vars||o).palette)==null||(l=l.action)==null?void 0:l.disabled,inherit:void 0}[e.color]}}),_=v.forwardRef(function(e,t){const i=R({props:e,name:"MuiSvgIcon"}),{children:n,className:u,color:m="inherit",component:a="svg",fontSize:h="medium",htmlColor:p,inheritViewBox:d=!1,titleAccess:r,viewBox:s="0 0 24 24"}=i,c=b(i,B),l=v.isValidElement(n)&&n.type==="svg",y=g({},i,{color:m,component:a,fontSize:h,instanceFontSize:e.fontSize,inheritViewBox:d,viewBox:s,hasSvgAsChild:l}),x={};d||(x.viewBox=s);const z=M(y);return S.jsxs(T,g({as:a,className:j(z.root,u),focusable:"false",color:p,"aria-hidden":r?void 0:!0,role:r?"img":void 0,ref:t},x,c,l&&n.props,{ownerState:y,children:[l?n.props.children:n,r?S.jsx("title",{children:r}):null]}))});_.muiName="SvgIcon";const $=_;function U(o,e){function t(i,n){return S.jsx($,g({"data-testid":`${e}Icon`,ref:n},i,{children:o}))}return t.muiName=$.muiName,v.memo(v.forwardRef(t))}export{U as c}; +import{c as I,d as C,s as w,i as f,r as v,u as R,_ as b,b as g,j as S,f as j,h as N}from"./index-b856be88.js";function A(o){return I("MuiSvgIcon",o)}C("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const B=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],M=o=>{const{color:e,fontSize:t,classes:i}=o,n={root:["root",e!=="inherit"&&`color${f(e)}`,`fontSize${f(t)}`]};return N(n,A,i)},T=w("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,t.color!=="inherit"&&e[`color${f(t.color)}`],e[`fontSize${f(t.fontSize)}`]]}})(({theme:o,ownerState:e})=>{var t,i,n,u,m,a,h,p,d,r,s,c,l;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(t=o.transitions)==null||(i=t.create)==null?void 0:i.call(t,"fill",{duration:(n=o.transitions)==null||(n=n.duration)==null?void 0:n.shorter}),fontSize:{inherit:"inherit",small:((u=o.typography)==null||(m=u.pxToRem)==null?void 0:m.call(u,20))||"1.25rem",medium:((a=o.typography)==null||(h=a.pxToRem)==null?void 0:h.call(a,24))||"1.5rem",large:((p=o.typography)==null||(d=p.pxToRem)==null?void 0:d.call(p,35))||"2.1875rem"}[e.fontSize],color:(r=(s=(o.vars||o).palette)==null||(s=s[e.color])==null?void 0:s.main)!=null?r:{action:(c=(o.vars||o).palette)==null||(c=c.action)==null?void 0:c.active,disabled:(l=(o.vars||o).palette)==null||(l=l.action)==null?void 0:l.disabled,inherit:void 0}[e.color]}}),_=v.forwardRef(function(e,t){const i=R({props:e,name:"MuiSvgIcon"}),{children:n,className:u,color:m="inherit",component:a="svg",fontSize:h="medium",htmlColor:p,inheritViewBox:d=!1,titleAccess:r,viewBox:s="0 0 24 24"}=i,c=b(i,B),l=v.isValidElement(n)&&n.type==="svg",y=g({},i,{color:m,component:a,fontSize:h,instanceFontSize:e.fontSize,inheritViewBox:d,viewBox:s,hasSvgAsChild:l}),x={};d||(x.viewBox=s);const z=M(y);return S.jsxs(T,g({as:a,className:j(z.root,u),focusable:"false",color:p,"aria-hidden":r?void 0:!0,role:r?"img":void 0,ref:t},x,c,l&&n.props,{ownerState:y,children:[l?n.props.children:n,r?S.jsx("title",{children:r}):null]}))});_.muiName="SvgIcon";const $=_;function U(o,e){function t(i,n){return S.jsx($,g({"data-testid":`${e}Icon`,ref:n},i,{children:o}))}return t.muiName=$.muiName,v.memo(v.forwardRef(t))}export{U as c}; diff --git a/build/assets/index-f27ea18e.js b/build/assets/index-08b74e7f.js similarity index 96% rename from build/assets/index-f27ea18e.js rename to build/assets/index-08b74e7f.js index 7640262c5..2ecb63f0e 100644 --- a/build/assets/index-f27ea18e.js +++ b/build/assets/index-08b74e7f.js @@ -1,4 +1,4 @@ -import{aB as j,aC as E,aD as b,aE as R,aF as $,aG as D,aH as U,aI as G,t as p,v as u,z as O,r as f,j as e,F as r,T as C,aJ as J,aA as K,q as Q,az as m,aK as X,a0 as ee,aL as te,aM as se,Z as ne,P as oe,aN as re}from"./index-69dca385.js";import{aL as ae,B as z,ah as ie,u as ce,a0 as le,a1 as de}from"./index-94c3c981.js";import{B as ue}from"./index-23519643.js";import{S as pe}from"./index-d70b7e8e.js";import{e as xe}from"./index.esm-86c83cdb.js";import{C as he}from"./ClipLoader-e049ef5e.js";import{T as fe}from"./index-e780f823.js";const A=/\b(?:twitter\.com|x\.com)\/(?:@)?([\w_]+)(?:$|\?[^/]*$)/,we=/(https?:\/\/)?(www\.)?youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/,ge=/(https?:\/\/)?(www\.)?youtube\.com\/live\/([A-Za-z0-9_-]+)/,me=/(https?:\/\/)?(www\.)?youtu\.be\/([A-Za-z0-9_-]+)/,ye=/https:\/\/twitter\.com\/i\/spaces\/([A-Za-z0-9_-]+)/,be=/https:\/\/(twitter\.com|x\.com)\/[^/]+\/status\/(\d+)/,je=/(https?:\/\/)?([A-Za-z0-9_-]+)\.mp3/,Se=/(https?:\/\/)?(.*\.)?.+\/(feed|rss|rss.xml|.*.rss|.*\?(feed|format)=rss)$/,ve=/https?:\/\/(www\.)?youtube\.com\/(user\/)?(@)?([\w-]+)/,_e=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,Ee=/https:\/\/twitter\.com\/i\/broadcasts\/([A-Za-z0-9_-]+)/,Re=/https:\/\/github\.com\/[\w-]+\/[\w-]+/;async function Ce(t){try{const n=(await fetch(t,{method:"HEAD"})).headers.get("Content-Type");return(n==null?void 0:n.includes("application/rss+xml"))??!1}catch{return!1}}async function ze(t){return[ge,Ee,we,me,ye,je].some(n=>n.test(t))?$:ve.test(t)?E:A.test(t)?j:be.test(t)?D:Se.test(t)?b:Re.test(t)?R:_e.test(t)?await Ce(t)?b:U:G}const Be=(t,s="")=>{const o=(s===j?A:/@(\w+)/).exec(t);return o?o[1]:null},_=t=>!!t&&[j,E,b,R].includes(t),Te=({onClick:t,loading:s,type:n,error:o})=>{const y=O(i=>i.budget),[a,x]=f.useState(10),d=_(n)?"radar":"add_node";return f.useEffect(()=>{(async()=>{try{const c=await J(d);x(c.data.price)}catch(c){console.error("cannot fetch",c)}})()},[d]),e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(ke,{children:"Approve Cost"})})}),e.jsxs(r,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs($e,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[a," sats"]})]}),e.jsxs(Ae,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[ae(y)," sats"]})]})]}),e.jsx(r,{children:e.jsx(z,{color:"secondary","data-testid":"check-icon",disabled:s||!!o,onClick:t,size:"large",startIcon:s?e.jsx(L,{children:e.jsx(he,{color:u.lightGray,size:12})}):e.jsxs(L,{children:[" ",e.jsx(ie,{})]}),type:"submit",variant:"contained",children:"Approve"})}),o?e.jsx(Pe,{children:e.jsxs(Ne,{children:[e.jsx(xe,{className:"errorIcon"}),e.jsx("span",{children:o})]})}):null]})},$e=p(r).attrs({direction:"column",align:"space-between",justify:"flex-start"})` +import{aB as j,aC as E,aD as b,aE as R,aF as $,aG as D,aH as U,aI as G,t as p,v as u,z as O,r as f,j as e,F as r,T as C,aJ as J,aA as K,q as Q,az as m,aK as X,a0 as ee,aL as te,aM as se,Z as ne,P as oe,aN as re}from"./index-b856be88.js";import{aL as ae,B as z,ah as ie,u as ce,a0 as le,a1 as de}from"./index-c59af388.js";import{B as ue}from"./index-8264b104.js";import{S as pe}from"./index-fabd940a.js";import{e as xe}from"./index.esm-c2a09dd4.js";import{C as he}from"./ClipLoader-83661b90.js";import{T as fe}from"./index-37507caf.js";const A=/\b(?:twitter\.com|x\.com)\/(?:@)?([\w_]+)(?:$|\?[^/]*$)/,we=/(https?:\/\/)?(www\.)?youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/,ge=/(https?:\/\/)?(www\.)?youtube\.com\/live\/([A-Za-z0-9_-]+)/,me=/(https?:\/\/)?(www\.)?youtu\.be\/([A-Za-z0-9_-]+)/,ye=/https:\/\/twitter\.com\/i\/spaces\/([A-Za-z0-9_-]+)/,be=/https:\/\/(twitter\.com|x\.com)\/[^/]+\/status\/(\d+)/,je=/(https?:\/\/)?([A-Za-z0-9_-]+)\.mp3/,Se=/(https?:\/\/)?(.*\.)?.+\/(feed|rss|rss.xml|.*.rss|.*\?(feed|format)=rss)$/,ve=/https?:\/\/(www\.)?youtube\.com\/(user\/)?(@)?([\w-]+)/,_e=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,Ee=/https:\/\/twitter\.com\/i\/broadcasts\/([A-Za-z0-9_-]+)/,Re=/https:\/\/github\.com\/[\w-]+\/[\w-]+/;async function Ce(t){try{const n=(await fetch(t,{method:"HEAD"})).headers.get("Content-Type");return(n==null?void 0:n.includes("application/rss+xml"))??!1}catch{return!1}}async function ze(t){return[ge,Ee,we,me,ye,je].some(n=>n.test(t))?$:ve.test(t)?E:A.test(t)?j:be.test(t)?D:Se.test(t)?b:Re.test(t)?R:_e.test(t)?await Ce(t)?b:U:G}const Be=(t,s="")=>{const o=(s===j?A:/@(\w+)/).exec(t);return o?o[1]:null},_=t=>!!t&&[j,E,b,R].includes(t),Te=({onClick:t,loading:s,type:n,error:o})=>{const y=O(i=>i.budget),[a,x]=f.useState(10),d=_(n)?"radar":"add_node";return f.useEffect(()=>{(async()=>{try{const c=await J(d);x(c.data.price)}catch(c){console.error("cannot fetch",c)}})()},[d]),e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(ke,{children:"Approve Cost"})})}),e.jsxs(r,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs($e,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[a," sats"]})]}),e.jsxs(Ae,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[ae(y)," sats"]})]})]}),e.jsx(r,{children:e.jsx(z,{color:"secondary","data-testid":"check-icon",disabled:s||!!o,onClick:t,size:"large",startIcon:s?e.jsx(L,{children:e.jsx(he,{color:u.lightGray,size:12})}):e.jsxs(L,{children:[" ",e.jsx(ie,{})]}),type:"submit",variant:"contained",children:"Approve"})}),o?e.jsx(Pe,{children:e.jsxs(Ne,{children:[e.jsx(xe,{className:"errorIcon"}),e.jsx("span",{children:o})]})}):null]})},$e=p(r).attrs({direction:"column",align:"space-between",justify:"flex-start"})` width: 141px; height: 61px; border: 1px solid ${u.GRAY7}; diff --git a/build/assets/index-b853c371.js b/build/assets/index-13864691.js similarity index 90% rename from build/assets/index-b853c371.js rename to build/assets/index-13864691.js index 8a7a617e3..80391df5a 100644 --- a/build/assets/index-b853c371.js +++ b/build/assets/index-13864691.js @@ -1,4 +1,4 @@ -import{t as i,v as N,T as E,F as s,N as U,r as c,j as e,aA as W,a_ as P,aY as V,q as k}from"./index-69dca385.js";import{B as q}from"./index-23519643.js";import{u as h,e as F,T as G,aZ as Y,a0 as H,a1 as Z,B as I}from"./index-94c3c981.js";import{T as J}from"./index-e780f823.js";import{S as K}from"./Skeleton-224a4953.js";import{C as Q}from"./ClipLoader-e049ef5e.js";import"./index.esm-86c83cdb.js";const X=/^https:\/\/\S+\.(png|jpe?g|svg)$/;function ee(l){return!!X.test(l)}const te=()=>{const{open:l}=h("changeNodeType"),{close:x}=h("editNodeName"),{changeNodeTypeFeatureFlag:f}=U(o=>({changeNodeTypeFeatureFlag:o.changeNodeTypeFeatureFlag})),a=F(),j=a==null?void 0:a.node_type,[p,m]=c.useState({});c.useEffect(()=>{a!=null&&a.properties&&m(a.properties)},[a]);const y=()=>{x(),l()},g=(o,n)=>{m(T=>({...T,[o]:n}))};return e.jsxs(s,{children:[e.jsx(s,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsxs(s,{align:"center",direction:"row",children:[e.jsx(ae,{children:"Edit Node"}),e.jsxs(ne,{children:[e.jsx(G,{type:j}),f&&e.jsx(se,{onClick:y,children:e.jsx(Y,{})})]})]})}),e.jsx(re,{children:Object.keys(p).map(o=>e.jsxs(s,{mb:18,children:[e.jsx(oe,{style:{marginBottom:8},children:o}),e.jsx(J,{id:`cy-${o}`,maxLength:50,name:`properties.${o}`,onChange:n=>g(o,n),placeholder:`Please Enter the ${o}`,rules:o==="name"?{...W}:{}})]},o))})]})},ae=i(E)` +import{t as i,v as N,T as E,F as s,N as U,r as c,j as e,aA as W,a_ as P,aY as V,q as k}from"./index-b856be88.js";import{B as q}from"./index-8264b104.js";import{u as h,e as F,T as G,aZ as Y,a0 as H,a1 as Z,B as I}from"./index-c59af388.js";import{T as J}from"./index-37507caf.js";import{S as K}from"./Skeleton-bddda4d0.js";import{C as Q}from"./ClipLoader-83661b90.js";import"./index.esm-c2a09dd4.js";const X=/^https:\/\/\S+\.(png|jpe?g|svg)$/;function ee(l){return!!X.test(l)}const te=()=>{const{open:l}=h("changeNodeType"),{close:x}=h("editNodeName"),{changeNodeTypeFeatureFlag:f}=U(o=>({changeNodeTypeFeatureFlag:o.changeNodeTypeFeatureFlag})),a=F(),j=a==null?void 0:a.node_type,[p,m]=c.useState({});c.useEffect(()=>{a!=null&&a.properties&&m(a.properties)},[a]);const y=()=>{x(),l()},g=(o,n)=>{m(T=>({...T,[o]:n}))};return e.jsxs(s,{children:[e.jsx(s,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsxs(s,{align:"center",direction:"row",children:[e.jsx(ae,{children:"Edit Node"}),e.jsxs(ne,{children:[e.jsx(G,{type:j}),f&&e.jsx(se,{onClick:y,children:e.jsx(Y,{})})]})]})}),e.jsx(re,{children:Object.keys(p).map(o=>e.jsxs(s,{mb:18,children:[e.jsx(oe,{style:{marginBottom:8},children:o}),e.jsx(J,{id:`cy-${o}`,maxLength:50,name:`properties.${o}`,onChange:n=>g(o,n),placeholder:`Please Enter the ${o}`,rules:o==="name"?{...W}:{}})]},o))})]})},ae=i(E)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; diff --git a/build/assets/index-e780f823.js b/build/assets/index-37507caf.js similarity index 98% rename from build/assets/index-e780f823.js rename to build/assets/index-37507caf.js index 423d2820c..73c078d62 100644 --- a/build/assets/index-e780f823.js +++ b/build/assets/index-37507caf.js @@ -1,4 +1,4 @@ -import{r as I,l as fe,g as de,t as N,v as S,j as E,F as L,T as pe}from"./index-69dca385.js";import{$ as he,bb as ge,ay as ve,bc as me}from"./index-94c3c981.js";import{e as be}from"./index.esm-86c83cdb.js";var ee={exports:{}},te={exports:{}},xe=function(e,r,t,n,o,i,s,u){if(!e){var f;if(r===void 0)f=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[t,n,o,i,s,u],l=0;f=new Error(r.replace(/%s/g,function(){return p[l++]})),f.name="Invariant Violation"}throw f.framesToPop=1,f}},ke=xe;function ne(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var k=I,_=ne(k),Pe=fe,K=ne(ke);function B(){return(B=Object.assign||function(e){for(var r=1;r=0||(o[t]=e[t]);return o}function oe(e){return requestAnimationFrame(e)}function Q(e){cancelAnimationFrame(e)}function R(e){var r=e.ownerDocument;return r.hasFocus()&&r.activeElement===e}function ie(e){return e==null?void 0:e.ownerDocument}function we(e){var r=function(t){var n;return(n=ie(t))==null?void 0:n.defaultView}(e);return!!r&&e instanceof r.HTMLElement}function W(e){return k.useCallback(function(){var r=e.current,t=typeof window<"u"&&we(r);if(!r||!t)return null;if(r.nodeName!=="INPUT"&&(r=r.querySelector("input")),!r)throw new Error("react-input-mask: inputComponent doesn't contain input node");return r},[e])}function ye(e,r){var t,n,o,i,s=k.useRef({start:null,end:null}),u=W(e),f=k.useCallback(function(){return function(g){var d=g.selectionStart,P=g.selectionEnd;return{start:d,end:P,length:P-d}}(u())},[u]),p=k.useCallback(function(){return s.current},[]),l=k.useCallback(function(g){var d=u();d&&R(d)&&(function(P,y,C){C===void 0&&(C=y),P.setSelectionRange(y,C)}(d,g.start,g.end),s.current=f())},[u,f]),a=k.useCallback(function(){s.current=f()},[f]),c=(t=a,n=k.useRef(null),o=k.useCallback(function(){n.current===null&&function g(){t(),n.current=oe(g)}()},[t]),i=k.useCallback(function(){Q(n.current),n.current=null},[]),k.useEffect(function(){n.current&&(i(),o())},[o,i]),k.useEffect(Q,[]),[o,i]),h=c[0],w=c[1];return k.useLayoutEffect(function(){if(r){var g=u();return g.addEventListener("focus",h),g.addEventListener("blur",w),R(g)&&h(),function(){g.removeEventListener("focus",h),g.removeEventListener("blur",w),w()}}}),{getSelection:f,getLastSelection:p,setSelection:l}}function Ce(e,r){var t=k.useRef(),n=ye(t,r),o=n.getSelection,i=n.getLastSelection,s=n.setSelection,u=function(a,c){var h=W(a),w=k.useRef(c);return{getValue:k.useCallback(function(){return h().value},[h]),getLastValue:k.useCallback(function(){return w.current},[]),setValue:k.useCallback(function(g){w.current=g;var d=h();d&&(d.value=g)},[h])}}(t,e),f=u.getValue,p=u.getLastValue,l=u.setValue;return{inputRef:t,getInputState:function(){return{value:f(),selection:o()}},getLastInputState:function(){return{value:p(),selection:i()}},setInputState:function(a){var c=a.value,h=a.selection;l(c),s(h)}}}var Se=["disabled","onBlur","onChange","onFocus","onMouseDown","readOnly","value"],J={9:/[0-9]/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/},Fe=function(e){var r=this;this.isCharacterAllowedAtPosition=function(t,n){var o=r.maskOptions.maskPlaceholder;return!!r.isCharacterFillingPosition(t,n)||!!o&&o[n]===t},this.isCharacterFillingPosition=function(t,n){var o=r.maskOptions.mask;if(!t||n>=o.length)return!1;if(!r.isPositionEditable(n))return o[n]===t;var i=o[n];return new RegExp(i).test(t)},this.isPositionEditable=function(t){var n=r.maskOptions,o=n.mask,i=n.permanents;return t=0;i--)if(o(n[i],i))return i;return-1}(t.split(""),function(n,o){return r.isPositionEditable(o)&&r.isCharacterFillingPosition(n,o)})+1},this.getStringFillingLengthAtPosition=function(t,n){return t.split("").reduce(function(o,i){return r.insertCharacterAtPosition(o,i,o.length)},function(o,i){i===void 0&&(i=1);for(var s="",u=0;u=0;n--)if(r.isPositionEditable(n))return n;return null},this.getRightEditablePosition=function(t){for(var n=r.maskOptions.mask,o=t;o=i&&!c?"":a=i?l:c?u?u[a]:"":f[a]}).join("");return r.formatValue(p)},this.insertCharacterAtPosition=function(t,n,o){var i=r.maskOptions,s=i.mask,u=i.maskPlaceholder;if(o>=s.length)return t;var f=r.isCharacterAllowedAtPosition(n,o),p=r.isPositionEditable(o),l=r.getRightEditablePosition(o),a=u&&l?n===u[l]:null,c=t.slice(0,o);return!f&&p||(t=c+(f?n:s[o])),f||p||a||(t=r.insertCharacterAtPosition(t,n,o+1)),t},this.insertStringAtPosition=function(t,n,o){var i=r.maskOptions,s=i.mask,u=i.maskPlaceholder;if(!n||o>=s.length)return t;var f=n.split(""),p=r.isValueFilled(t)||!!u,l=t.slice(o);return t=f.reduce(function(a,c){return r.insertCharacterAtPosition(a,c,a.length)},t.slice(0,o)),p?t+=l.slice(t.length-o):r.isValueFilled(t)?t+=s.slice(t.length).join(""):t=l.split("").filter(function(a,c){return r.isPositionEditable(o+c)}).reduce(function(a,c){var h=r.getRightEditablePosition(a.length);return h===null?a:(r.isPositionEditable(a.length)||(a+=s.slice(a.length,h).join("")),r.insertCharacterAtPosition(a,c,a.length))},t),t},this.processChange=function(t,n){var o=r.maskOptions,i=o.mask,s=o.prefix,u=o.lastEditablePosition,f=t.value,p=t.selection,l=n.value,a=n.selection,c=f,h="",w=0,g=0,d=Math.min(a.start,p.start);return p.end>a.start?(h=c.slice(a.start,p.end),g=(w=r.getStringFillingLengthAtPosition(h,d))?a.length:0):c.length=i.length?d=i.length:d=s.length&&d=0||(o[t]=e[t]);return o}function oe(e){return requestAnimationFrame(e)}function Q(e){cancelAnimationFrame(e)}function R(e){var r=e.ownerDocument;return r.hasFocus()&&r.activeElement===e}function ie(e){return e==null?void 0:e.ownerDocument}function we(e){var r=function(t){var n;return(n=ie(t))==null?void 0:n.defaultView}(e);return!!r&&e instanceof r.HTMLElement}function W(e){return k.useCallback(function(){var r=e.current,t=typeof window<"u"&&we(r);if(!r||!t)return null;if(r.nodeName!=="INPUT"&&(r=r.querySelector("input")),!r)throw new Error("react-input-mask: inputComponent doesn't contain input node");return r},[e])}function ye(e,r){var t,n,o,i,s=k.useRef({start:null,end:null}),u=W(e),f=k.useCallback(function(){return function(g){var d=g.selectionStart,P=g.selectionEnd;return{start:d,end:P,length:P-d}}(u())},[u]),p=k.useCallback(function(){return s.current},[]),l=k.useCallback(function(g){var d=u();d&&R(d)&&(function(P,y,C){C===void 0&&(C=y),P.setSelectionRange(y,C)}(d,g.start,g.end),s.current=f())},[u,f]),a=k.useCallback(function(){s.current=f()},[f]),c=(t=a,n=k.useRef(null),o=k.useCallback(function(){n.current===null&&function g(){t(),n.current=oe(g)}()},[t]),i=k.useCallback(function(){Q(n.current),n.current=null},[]),k.useEffect(function(){n.current&&(i(),o())},[o,i]),k.useEffect(Q,[]),[o,i]),h=c[0],w=c[1];return k.useLayoutEffect(function(){if(r){var g=u();return g.addEventListener("focus",h),g.addEventListener("blur",w),R(g)&&h(),function(){g.removeEventListener("focus",h),g.removeEventListener("blur",w),w()}}}),{getSelection:f,getLastSelection:p,setSelection:l}}function Ce(e,r){var t=k.useRef(),n=ye(t,r),o=n.getSelection,i=n.getLastSelection,s=n.setSelection,u=function(a,c){var h=W(a),w=k.useRef(c);return{getValue:k.useCallback(function(){return h().value},[h]),getLastValue:k.useCallback(function(){return w.current},[]),setValue:k.useCallback(function(g){w.current=g;var d=h();d&&(d.value=g)},[h])}}(t,e),f=u.getValue,p=u.getLastValue,l=u.setValue;return{inputRef:t,getInputState:function(){return{value:f(),selection:o()}},getLastInputState:function(){return{value:p(),selection:i()}},setInputState:function(a){var c=a.value,h=a.selection;l(c),s(h)}}}var Se=["disabled","onBlur","onChange","onFocus","onMouseDown","readOnly","value"],J={9:/[0-9]/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/},Fe=function(e){var r=this;this.isCharacterAllowedAtPosition=function(t,n){var o=r.maskOptions.maskPlaceholder;return!!r.isCharacterFillingPosition(t,n)||!!o&&o[n]===t},this.isCharacterFillingPosition=function(t,n){var o=r.maskOptions.mask;if(!t||n>=o.length)return!1;if(!r.isPositionEditable(n))return o[n]===t;var i=o[n];return new RegExp(i).test(t)},this.isPositionEditable=function(t){var n=r.maskOptions,o=n.mask,i=n.permanents;return t=0;i--)if(o(n[i],i))return i;return-1}(t.split(""),function(n,o){return r.isPositionEditable(o)&&r.isCharacterFillingPosition(n,o)})+1},this.getStringFillingLengthAtPosition=function(t,n){return t.split("").reduce(function(o,i){return r.insertCharacterAtPosition(o,i,o.length)},function(o,i){i===void 0&&(i=1);for(var s="",u=0;u=0;n--)if(r.isPositionEditable(n))return n;return null},this.getRightEditablePosition=function(t){for(var n=r.maskOptions.mask,o=t;o=i&&!c?"":a=i?l:c?u?u[a]:"":f[a]}).join("");return r.formatValue(p)},this.insertCharacterAtPosition=function(t,n,o){var i=r.maskOptions,s=i.mask,u=i.maskPlaceholder;if(o>=s.length)return t;var f=r.isCharacterAllowedAtPosition(n,o),p=r.isPositionEditable(o),l=r.getRightEditablePosition(o),a=u&&l?n===u[l]:null,c=t.slice(0,o);return!f&&p||(t=c+(f?n:s[o])),f||p||a||(t=r.insertCharacterAtPosition(t,n,o+1)),t},this.insertStringAtPosition=function(t,n,o){var i=r.maskOptions,s=i.mask,u=i.maskPlaceholder;if(!n||o>=s.length)return t;var f=n.split(""),p=r.isValueFilled(t)||!!u,l=t.slice(o);return t=f.reduce(function(a,c){return r.insertCharacterAtPosition(a,c,a.length)},t.slice(0,o)),p?t+=l.slice(t.length-o):r.isValueFilled(t)?t+=s.slice(t.length).join(""):t=l.split("").filter(function(a,c){return r.isPositionEditable(o+c)}).reduce(function(a,c){var h=r.getRightEditablePosition(a.length);return h===null?a:(r.isPositionEditable(a.length)||(a+=s.slice(a.length,h).join("")),r.insertCharacterAtPosition(a,c,a.length))},t),t},this.processChange=function(t,n){var o=r.maskOptions,i=o.mask,s=o.prefix,u=o.lastEditablePosition,f=t.value,p=t.selection,l=n.value,a=n.selection,c=f,h="",w=0,g=0,d=Math.min(a.start,p.start);return p.end>a.start?(h=c.slice(a.start,p.end),g=(w=r.getStringFillingLengthAtPosition(h,d))?a.length:0):c.length=i.length?d=i.length:d=s.length&&dS[e]}; background: transparent; diff --git a/build/assets/index-ff6c14e9.js b/build/assets/index-3c28967c.js similarity index 95% rename from build/assets/index-ff6c14e9.js rename to build/assets/index-3c28967c.js index 4c3f2c09e..8f4ebeeb3 100644 --- a/build/assets/index-ff6c14e9.js +++ b/build/assets/index-3c28967c.js @@ -1,4 +1,4 @@ -import{Z as X,t as g,v as b,F as t,T,z as V,r as y,j as e,aJ as ee,aA as L,aO as te,N as se,aP as ne,q as oe,az as I,a1 as re,a0 as ie,aM as ae}from"./index-69dca385.js";import{aL as ce,B as C,ah as le,$ as de,u as D,a0 as pe,f as me,a1 as xe}from"./index-94c3c981.js";import{B as ue}from"./index-23519643.js";import{S as he}from"./index-d70b7e8e.js";import{e as fe}from"./index.esm-86c83cdb.js";import{C as J}from"./ClipLoader-e049ef5e.js";import{n as B,O as ye,i as ge}from"./constants-b2a2fa82.js";import{p as q}from"./index-28e22657.js";import{T as F}from"./index-e780f823.js";import{A as je}from"./index-49403f56.js";import{c as we}from"./index-64f1c910.js";import"./three.module-52004ab8.js";import"./Stack-57ab9e76.js";import"./createSvgIcon-7c6eee06.js";import"./TextareaAutosize-6f8daf3f.js";const be=async(o,a,c="")=>await X.post(`/${o}`,JSON.stringify(a),{Authorization:c}),Se=async(o,a,c,x,d,r)=>{const m=o==="Create custom type"?"schema":"node",l={node_data:{...a,...o==="Image"&&{source_link:c}},node_type:o,name:x,pubkey:r};return be(m,l,d)},Ne=({onClick:o,loading:a,error:c})=>{const x=V(l=>l.budget),[d,r]=y.useState(10),m="node";return y.useEffect(()=>{(async()=>{try{const h=await ee(m);r(h.data.price)}catch(h){console.error("cannot fetch",h)}})()},[m]),e.jsxs(t,{children:[e.jsx(t,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(t,{align:"center",direction:"row",children:e.jsx(ke,{children:"Approve Cost"})})}),e.jsxs(t,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs(Te,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[d," sats"]})]}),e.jsxs(Ce,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[ce(x)," sats"]})]})]}),e.jsx(t,{children:e.jsx(C,{color:"secondary","data-testid":"check-icon",disabled:a||!!c,onClick:o,size:"large",startIcon:a?e.jsx(R,{children:e.jsx(J,{color:b.lightGray,size:12})}):e.jsxs(R,{children:[" ",e.jsx(le,{})]}),type:"submit",variant:"contained",children:"Approve"})}),c?e.jsx(ze,{children:e.jsxs(ve,{children:[e.jsx(fe,{className:"errorIcon"}),e.jsx("span",{children:c})]})}):null]})},Te=g(t).attrs({direction:"column",align:"space-between",justify:"flex-start"})` +import{Z as X,t as g,v as b,F as t,T,z as V,r as y,j as e,aJ as ee,aA as L,aO as te,N as se,aP as ne,q as oe,az as I,a1 as re,a0 as ie,aM as ae}from"./index-b856be88.js";import{aL as ce,B as C,ah as le,$ as de,u as D,a0 as pe,f as me,a1 as xe}from"./index-c59af388.js";import{B as ue}from"./index-8264b104.js";import{S as he}from"./index-fabd940a.js";import{e as fe}from"./index.esm-c2a09dd4.js";import{C as J}from"./ClipLoader-83661b90.js";import{n as B,O as ye,i as ge}from"./constants-b2a2fa82.js";import{p as q}from"./index-28e22657.js";import{T as F}from"./index-37507caf.js";import{A as je}from"./index-c61dca86.js";import{c as we}from"./index-64f1c910.js";import"./three.module-52004ab8.js";import"./Stack-e0f879a7.js";import"./createSvgIcon-ed559792.js";import"./TextareaAutosize-981375ed.js";const be=async(o,a,c="")=>await X.post(`/${o}`,JSON.stringify(a),{Authorization:c}),Se=async(o,a,c,x,d,r)=>{const m=o==="Create custom type"?"schema":"node",l={node_data:{...a,...o==="Image"&&{source_link:c}},node_type:o,name:x,pubkey:r};return be(m,l,d)},Ne=({onClick:o,loading:a,error:c})=>{const x=V(l=>l.budget),[d,r]=y.useState(10),m="node";return y.useEffect(()=>{(async()=>{try{const h=await ee(m);r(h.data.price)}catch(h){console.error("cannot fetch",h)}})()},[m]),e.jsxs(t,{children:[e.jsx(t,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(t,{align:"center",direction:"row",children:e.jsx(ke,{children:"Approve Cost"})})}),e.jsxs(t,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs(Te,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[d," sats"]})]}),e.jsxs(Ce,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[ce(x)," sats"]})]})]}),e.jsx(t,{children:e.jsx(C,{color:"secondary","data-testid":"check-icon",disabled:a||!!c,onClick:o,size:"large",startIcon:a?e.jsx(R,{children:e.jsx(J,{color:b.lightGray,size:12})}):e.jsxs(R,{children:[" ",e.jsx(le,{})]}),type:"submit",variant:"contained",children:"Approve"})}),c?e.jsx(ze,{children:e.jsxs(ve,{children:[e.jsx(fe,{className:"errorIcon"}),e.jsx("span",{children:c})]})}):null]})},Te=g(t).attrs({direction:"column",align:"space-between",justify:"flex-start"})` width: 141px; height: 61px; border: 1px solid ${b.GRAY7}; diff --git a/build/assets/index-6c23b30f.js b/build/assets/index-3cc1f890.js similarity index 90% rename from build/assets/index-6c23b30f.js rename to build/assets/index-3cc1f890.js index 524329240..eae49058c 100644 --- a/build/assets/index-6c23b30f.js +++ b/build/assets/index-3cc1f890.js @@ -1,4 +1,4 @@ -import{t as i,v as t,F as c,j as e,r as l,q as k,a_ as C,a$ as R}from"./index-69dca385.js";import{B as I}from"./index-23519643.js";import{a_ as z,u as j,f as D,e as E,B as w}from"./index-94c3c981.js";import{S as L}from"./Skeleton-224a4953.js";import{C as T}from"./ClipLoader-e049ef5e.js";const _=({nodeName:p})=>e.jsx(c,{children:e.jsxs(c,{align:"center",direction:"column",justify:"space-between",children:[e.jsx(M,{children:e.jsx(z,{})}),e.jsxs(G,{children:["Are you sure you want to delete ",p||"this item","?"]})]})}),G=i(c)` +import{t as i,v as t,F as c,j as e,r as l,q as k,a_ as C,a$ as R}from"./index-b856be88.js";import{B as I}from"./index-8264b104.js";import{a_ as z,u as j,f as D,e as E,B as w}from"./index-c59af388.js";import{S as L}from"./Skeleton-bddda4d0.js";import{C as T}from"./ClipLoader-83661b90.js";const _=({nodeName:p})=>e.jsx(c,{children:e.jsxs(c,{align:"center",direction:"column",justify:"space-between",children:[e.jsx(M,{children:e.jsx(z,{})}),e.jsxs(G,{children:["Are you sure you want to delete ",p||"this item","?"]})]})}),G=i(c)` color: ${t.white}; font-family: 'Barlow'; font-size: 20px; diff --git a/build/assets/index-bd732748.js b/build/assets/index-3da7ddbb.js similarity index 93% rename from build/assets/index-bd732748.js rename to build/assets/index-3da7ddbb.js index 0b809edd8..2b7c06570 100644 --- a/build/assets/index-bd732748.js +++ b/build/assets/index-3da7ddbb.js @@ -1,4 +1,4 @@ -import{t as a,v as r,F as i,j as e,w as I,T as S,r as b,y as v,z as $,ay as B,az as y,aA as z}from"./index-69dca385.js";import{B as A}from"./index-23519643.js";import{f as T,g as k,aI as M,aJ as D,C as R,an as E,aK as L,B as C,a0 as P,a1 as W,u as w}from"./index-94c3c981.js";import{C as G}from"./ClipLoader-e049ef5e.js";import{e as F}from"./index.esm-86c83cdb.js";import{S as V}from"./index-d70b7e8e.js";import{T as j}from"./index-e780f823.js";import{T as U,a as N}from"./Tabs-b82c05ad.js";import"./createSvgIcon-7c6eee06.js";const Y={split:e.jsx(D,{}),force:e.jsx(R,{}),sphere:e.jsx(E,{}),earth:e.jsx(L,{})},O=()=>{const[n,p]=T(k(t=>[t.graphStyle,t.setGraphStyle])),l=t=>{p(t)};return e.jsx(_,{direction:"column",children:M.map(t=>e.jsx(i,{className:I("icon",{active:n===t}),onClick:()=>l(t),children:Y[t]},t))})},_=a(i).attrs({direction:"row",align:"center",justify:"space-between"})` +import{t as a,v as r,F as i,j as e,w as I,T as S,r as b,y as v,z as $,ay as B,az as y,aA as z}from"./index-b856be88.js";import{B as A}from"./index-8264b104.js";import{f as T,g as k,aI as M,aJ as D,C as R,an as E,aK as L,B as C,a0 as P,a1 as W,u as w}from"./index-c59af388.js";import{C as G}from"./ClipLoader-83661b90.js";import{e as F}from"./index.esm-c2a09dd4.js";import{S as V}from"./index-fabd940a.js";import{T as j}from"./index-37507caf.js";import{T as U,a as N}from"./Tabs-88a6cc23.js";import"./createSvgIcon-ed559792.js";const Y={split:e.jsx(D,{}),force:e.jsx(R,{}),sphere:e.jsx(E,{}),earth:e.jsx(L,{})},O=()=>{const[n,p]=T(k(t=>[t.graphStyle,t.setGraphStyle])),l=t=>{p(t)};return e.jsx(_,{direction:"column",children:M.map(t=>e.jsx(i,{className:I("icon",{active:n===t}),onClick:()=>l(t),children:Y[t]},t))})},_=a(i).attrs({direction:"row",align:"center",justify:"space-between"})` width: 447px; height: 48px; background: ${r.appearanceBg}; diff --git a/build/assets/index-a579da74.js b/build/assets/index-3e02ddf4.js similarity index 94% rename from build/assets/index-a579da74.js rename to build/assets/index-3e02ddf4.js index c80fe8bc7..0781fa760 100644 --- a/build/assets/index-a579da74.js +++ b/build/assets/index-3e02ddf4.js @@ -1,4 +1,4 @@ -import{t as v,v as q,T as z,F as n,r as m,j as e,aA as J,aO as $,N as K,aP as Q,az as O,a_ as X,b1 as Z}from"./index-69dca385.js";import{$ as U,B as P,e as V,u as D,a0 as N,a1 as ee}from"./index-94c3c981.js";import{B as te}from"./index-23519643.js";import{T as re}from"./index-e780f823.js";import{p as G}from"./index-28e22657.js";import{n as ne}from"./constants-b2a2fa82.js";import{C as W}from"./ClipLoader-e049ef5e.js";import{A as Y}from"./index-49403f56.js";import{c as oe}from"./index-64f1c910.js";import"./index.esm-86c83cdb.js";import"./three.module-52004ab8.js";import"./Stack-57ab9e76.js";import"./createSvgIcon-7c6eee06.js";import"./TextareaAutosize-6f8daf3f.js";const M=a=>a.charAt(0).toUpperCase()+a.slice(1).replace(/_/g," "),k=a=>a?[...a].sort((l,x)=>Number(x.required)-Number(l.required)):[],H=a=>a?a.filter(l=>l.key!=="node_key"):[],ae=({handleSelectType:a,skipToStep:l,nodeType:x,selectedValues:r})=>{const[f,b]=m.useState(!1),[h,C]=m.useState(),{watch:j,formState:{isValid:t}}=U();m.useEffect(()=>{(async()=>{b(!0);const o=await $(x),T=G(o),A=H(T);C(A),b(!1)})()},[x,j]);const s=c=>c.charAt(0).toUpperCase()+c.slice(1).replace(/_/g," "),p=(h?[...h].sort((c,o)=>c.required&&!o.required?-1:!c.required&&o.required?1:0):[]).filter(c=>!!(c.required&&!Object.values(r).includes(c.key))),S=()=>{a(""),l("sourceType")},w=!t||f||p.some(c=>{var o;return c.required&&!((o=j(c.key))!=null&&o.trim())});return e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(se,{children:"Required Properties"})})}),e.jsx(ie,{children:f?e.jsx(n,{style:{margin:"auto"},children:e.jsx(W,{color:q.SECONDARY_BLUE})}):e.jsx(n,{className:"input__wrapper",children:p==null?void 0:p.map(({key:c,required:o})=>e.jsx(e.Fragment,{children:e.jsxs(ce,{children:[e.jsx(z,{children:s(c)}),e.jsx(re,{id:"item-name",maxLength:50,name:c,placeholder:o?"Required":"Optional",rules:{...o?{...J,pattern:{message:"No leading whitespace allowed",value:ne}}:{}}})]})}))})}),e.jsxs(n,{direction:"row",children:[e.jsx(n,{grow:1,children:e.jsx(P,{color:"secondary",onClick:S,size:"large",variant:"contained",children:"Prev"})}),e.jsx(n,{grow:1,ml:20,children:e.jsx(P,{color:"secondary",disabled:w,onClick:()=>l("createConfirmation"),size:"large",variant:"contained",children:"Next"})})]})]})},se=v(z)` +import{t as v,v as q,T as z,F as n,r as m,j as e,aA as J,aO as $,N as K,aP as Q,az as O,a_ as X,b1 as Z}from"./index-b856be88.js";import{$ as U,B as P,e as V,u as D,a0 as N,a1 as ee}from"./index-c59af388.js";import{B as te}from"./index-8264b104.js";import{T as re}from"./index-37507caf.js";import{p as G}from"./index-28e22657.js";import{n as ne}from"./constants-b2a2fa82.js";import{C as W}from"./ClipLoader-83661b90.js";import{A as Y}from"./index-c61dca86.js";import{c as oe}from"./index-64f1c910.js";import"./index.esm-c2a09dd4.js";import"./three.module-52004ab8.js";import"./Stack-e0f879a7.js";import"./createSvgIcon-ed559792.js";import"./TextareaAutosize-981375ed.js";const M=a=>a.charAt(0).toUpperCase()+a.slice(1).replace(/_/g," "),k=a=>a?[...a].sort((l,x)=>Number(x.required)-Number(l.required)):[],H=a=>a?a.filter(l=>l.key!=="node_key"):[],ae=({handleSelectType:a,skipToStep:l,nodeType:x,selectedValues:r})=>{const[f,b]=m.useState(!1),[h,C]=m.useState(),{watch:j,formState:{isValid:t}}=U();m.useEffect(()=>{(async()=>{b(!0);const o=await $(x),T=G(o),A=H(T);C(A),b(!1)})()},[x,j]);const s=c=>c.charAt(0).toUpperCase()+c.slice(1).replace(/_/g," "),p=(h?[...h].sort((c,o)=>c.required&&!o.required?-1:!c.required&&o.required?1:0):[]).filter(c=>!!(c.required&&!Object.values(r).includes(c.key))),S=()=>{a(""),l("sourceType")},w=!t||f||p.some(c=>{var o;return c.required&&!((o=j(c.key))!=null&&o.trim())});return e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(se,{children:"Required Properties"})})}),e.jsx(ie,{children:f?e.jsx(n,{style:{margin:"auto"},children:e.jsx(W,{color:q.SECONDARY_BLUE})}):e.jsx(n,{className:"input__wrapper",children:p==null?void 0:p.map(({key:c,required:o})=>e.jsx(e.Fragment,{children:e.jsxs(ce,{children:[e.jsx(z,{children:s(c)}),e.jsx(re,{id:"item-name",maxLength:50,name:c,placeholder:o?"Required":"Optional",rules:{...o?{...J,pattern:{message:"No leading whitespace allowed",value:ne}}:{}}})]})}))})}),e.jsxs(n,{direction:"row",children:[e.jsx(n,{grow:1,children:e.jsx(P,{color:"secondary",onClick:S,size:"large",variant:"contained",children:"Prev"})}),e.jsx(n,{grow:1,ml:20,children:e.jsx(P,{color:"secondary",disabled:w,onClick:()=>l("createConfirmation"),size:"large",variant:"contained",children:"Next"})})]})]})},se=v(z)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; diff --git a/build/assets/index-a7628b9d.js b/build/assets/index-4cf4c70d.js similarity index 98% rename from build/assets/index-a7628b9d.js rename to build/assets/index-4cf4c70d.js index c1d79d5d0..af3a0862e 100644 --- a/build/assets/index-a7628b9d.js +++ b/build/assets/index-4cf4c70d.js @@ -1,4 +1,4 @@ -import{r as h,c as Q,d as q,s as O,b as B,u as X,_ as K,j as e,f as Z,h as J,i as P,a2 as ut,e as oe,a3 as gt,t as d,v as x,T as N,F as g,aQ as ft,a5 as te,R as ne,q as ie,a0 as mt,aR as bt,aS as Ye,w as re,aT as Ve,H as ye,aB as ke,aC as _e,aD as Ne,aU as jt,z as Qe,aV as yt,aW as qe,aX as wt,aA as Ct,aY as le,aZ as vt,y as Tt,N as St,Q as $t}from"./index-69dca385.js";import{B as ce}from"./index-23519643.js";import{B as H,u as M,aM as kt,r as _t,t as we,aN as be,aw as V,aO as Nt,D as zt,s as Bt,ai as ee,a2 as Xe,aP as Ke,aQ as Ze,aR as Je,a0 as Ce,a1 as ve,ah as et,aS as Rt,aT as It,aU as Lt,aV as ze,aW as Be,p as Re,aX as ue,aY as Et,q as Mt}from"./index-94c3c981.js";import{T as Ie,s as D,a as tt,S as st,A as Te,E as At,D as Ft,b as ot,Q as nt,V as rt,c as Ot}from"./constants-a86c243d.js";import{C as z}from"./ClipLoader-e049ef5e.js";import{f as Wt,g as Ht,h as Pt,a as Dt}from"./index.esm-86c83cdb.js";import{I as Ut,A as Se,T as at}from"./index-49403f56.js";import{B as Gt,T as Yt}from"./index-e780f823.js";import{u as L}from"./index-e0a45087.js";import{O as it}from"./constants-b2a2fa82.js";import{T as Le}from"./Typography-543ae8c6.js";import{T as Vt,a as Qt}from"./Tabs-b82c05ad.js";import"./Stack-57ab9e76.js";import"./createSvgIcon-7c6eee06.js";import"./TextareaAutosize-6f8daf3f.js";const qt=h.createContext(),lt=qt;function Xt(t){return Q("MuiTable",t)}q("MuiTable",["root","stickyHeader"]);const Kt=["className","component","padding","size","stickyHeader"],Zt=t=>{const{classes:s,stickyHeader:n}=t;return J({root:["root",n&&"stickyHeader"]},Xt,s)},Jt=O("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.stickyHeader&&s.stickyHeader]}})(({theme:t,ownerState:s})=>B({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":B({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},s.stickyHeader&&{borderCollapse:"separate"})),Ee="table",es=h.forwardRef(function(s,n){const r=X({props:s,name:"MuiTable"}),{className:i,component:l=Ee,padding:a="normal",size:o="medium",stickyHeader:c=!1}=r,u=K(r,Kt),m=B({},r,{component:l,padding:a,size:o,stickyHeader:c}),p=Zt(m),j=h.useMemo(()=>({padding:a,size:o,stickyHeader:c}),[a,o,c]);return e.jsx(lt.Provider,{value:j,children:e.jsx(Jt,B({as:l,role:l===Ee?null:"table",ref:n,className:Z(p.root,i),ownerState:m},u))})}),de=es,ts=h.createContext(),pe=ts;function ss(t){return Q("MuiTableBody",t)}q("MuiTableBody",["root"]);const os=["className","component"],ns=t=>{const{classes:s}=t;return J({root:["root"]},ss,s)},rs=O("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,s)=>s.root})({display:"table-row-group"}),as={variant:"body"},Me="tbody",is=h.forwardRef(function(s,n){const r=X({props:s,name:"MuiTableBody"}),{className:i,component:l=Me}=r,a=K(r,os),o=B({},r,{component:l}),c=ns(o);return e.jsx(pe.Provider,{value:as,children:e.jsx(rs,B({className:Z(c.root,i),as:l,ref:n,role:l===Me?null:"rowgroup",ownerState:o},a))})}),ls=is;function cs(t){return Q("MuiTableCell",t)}const ds=q("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),ps=ds,xs=["align","className","component","padding","scope","size","sortDirection","variant"],hs=t=>{const{classes:s,variant:n,align:r,padding:i,size:l,stickyHeader:a}=t,o={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${P(r)}`,i!=="normal"&&`padding${P(i)}`,`size${P(l)}`]};return J(o,cs,s)},us=O("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,s[n.variant],s[`size${P(n.size)}`],n.padding!=="normal"&&s[`padding${P(n.padding)}`],n.align!=="inherit"&&s[`align${P(n.align)}`],n.stickyHeader&&s.stickyHeader]}})(({theme:t,ownerState:s})=>B({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid +import{r as h,c as Q,d as q,s as O,b as B,u as X,_ as K,j as e,f as Z,h as J,i as P,a2 as ut,e as oe,a3 as gt,t as d,v as x,T as N,F as g,aQ as ft,a5 as te,R as ne,q as ie,a0 as mt,aR as bt,aS as Ye,w as re,aT as Ve,H as ye,aB as ke,aC as _e,aD as Ne,aU as jt,z as Qe,aV as yt,aW as qe,aX as wt,aA as Ct,aY as le,aZ as vt,y as Tt,N as St,Q as $t}from"./index-b856be88.js";import{B as ce}from"./index-8264b104.js";import{B as H,u as M,aM as kt,r as _t,t as we,aN as be,aw as V,aO as Nt,D as zt,s as Bt,ai as ee,a2 as Xe,aP as Ke,aQ as Ze,aR as Je,a0 as Ce,a1 as ve,ah as et,aS as Rt,aT as It,aU as Lt,aV as ze,aW as Be,p as Re,aX as ue,aY as Et,q as Mt}from"./index-c59af388.js";import{T as Ie,s as D,a as tt,S as st,A as Te,E as At,D as Ft,b as ot,Q as nt,V as rt,c as Ot}from"./constants-011d5486.js";import{C as z}from"./ClipLoader-83661b90.js";import{f as Wt,g as Ht,h as Pt,a as Dt}from"./index.esm-c2a09dd4.js";import{I as Ut,A as Se,T as at}from"./index-c61dca86.js";import{B as Gt,T as Yt}from"./index-37507caf.js";import{u as L}from"./index-deba249f.js";import{O as it}from"./constants-b2a2fa82.js";import{T as Le}from"./Typography-69404db2.js";import{T as Vt,a as Qt}from"./Tabs-88a6cc23.js";import"./Stack-e0f879a7.js";import"./createSvgIcon-ed559792.js";import"./TextareaAutosize-981375ed.js";const qt=h.createContext(),lt=qt;function Xt(t){return Q("MuiTable",t)}q("MuiTable",["root","stickyHeader"]);const Kt=["className","component","padding","size","stickyHeader"],Zt=t=>{const{classes:s,stickyHeader:n}=t;return J({root:["root",n&&"stickyHeader"]},Xt,s)},Jt=O("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.stickyHeader&&s.stickyHeader]}})(({theme:t,ownerState:s})=>B({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":B({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},s.stickyHeader&&{borderCollapse:"separate"})),Ee="table",es=h.forwardRef(function(s,n){const r=X({props:s,name:"MuiTable"}),{className:i,component:l=Ee,padding:a="normal",size:o="medium",stickyHeader:c=!1}=r,u=K(r,Kt),m=B({},r,{component:l,padding:a,size:o,stickyHeader:c}),p=Zt(m),j=h.useMemo(()=>({padding:a,size:o,stickyHeader:c}),[a,o,c]);return e.jsx(lt.Provider,{value:j,children:e.jsx(Jt,B({as:l,role:l===Ee?null:"table",ref:n,className:Z(p.root,i),ownerState:m},u))})}),de=es,ts=h.createContext(),pe=ts;function ss(t){return Q("MuiTableBody",t)}q("MuiTableBody",["root"]);const os=["className","component"],ns=t=>{const{classes:s}=t;return J({root:["root"]},ss,s)},rs=O("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,s)=>s.root})({display:"table-row-group"}),as={variant:"body"},Me="tbody",is=h.forwardRef(function(s,n){const r=X({props:s,name:"MuiTableBody"}),{className:i,component:l=Me}=r,a=K(r,os),o=B({},r,{component:l}),c=ns(o);return e.jsx(pe.Provider,{value:as,children:e.jsx(rs,B({className:Z(c.root,i),as:l,ref:n,role:l===Me?null:"rowgroup",ownerState:o},a))})}),ls=is;function cs(t){return Q("MuiTableCell",t)}const ds=q("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),ps=ds,xs=["align","className","component","padding","scope","size","sortDirection","variant"],hs=t=>{const{classes:s,variant:n,align:r,padding:i,size:l,stickyHeader:a}=t,o={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${P(r)}`,i!=="normal"&&`padding${P(i)}`,`size${P(l)}`]};return J(o,cs,s)},us=O("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,s[n.variant],s[`size${P(n.size)}`],n.padding!=="normal"&&s[`padding${P(n.padding)}`],n.align!=="inherit"&&s[`align${P(n.align)}`],n.stickyHeader&&s.stickyHeader]}})(({theme:t,ownerState:s})=>B({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid ${t.palette.mode==="light"?ut(oe(t.palette.divider,1),.88):gt(oe(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},s.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},s.variant==="body"&&{color:(t.vars||t).palette.text.primary},s.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},s.size==="small"&&{padding:"6px 16px",[`&.${ps.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},s.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},s.padding==="none"&&{padding:0},s.align==="left"&&{textAlign:"left"},s.align==="center"&&{textAlign:"center"},s.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},s.align==="justify"&&{textAlign:"justify"},s.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),gs=h.forwardRef(function(s,n){const r=X({props:s,name:"MuiTableCell"}),{align:i="inherit",className:l,component:a,padding:o,scope:c,size:u,sortDirection:m,variant:p}=r,j=K(r,xs),b=h.useContext(lt),y=h.useContext(pe),C=y&&y.variant==="head";let w;a?w=a:w=C?"th":"td";let S=c;w==="td"?S=void 0:!S&&C&&(S="col");const $=p||y&&y.variant,A=B({},r,{align:i,component:w,padding:o||(b&&b.padding?b.padding:"normal"),size:u||(b&&b.size?b.size:"medium"),sortDirection:m,stickyHeader:$==="head"&&b&&b.stickyHeader,variant:$}),F=hs(A);let R=null;return m&&(R=m==="asc"?"ascending":"descending"),e.jsx(us,B({as:w,ref:n,className:Z(F.root,l),"aria-sort":R,scope:S,ownerState:A},j))}),fs=gs;function ms(t){return Q("MuiTableHead",t)}q("MuiTableHead",["root"]);const bs=["className","component"],js=t=>{const{classes:s}=t;return J({root:["root"]},ms,s)},ys=O("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,s)=>s.root})({display:"table-header-group"}),ws={variant:"head"},Ae="thead",Cs=h.forwardRef(function(s,n){const r=X({props:s,name:"MuiTableHead"}),{className:i,component:l=Ae}=r,a=K(r,bs),o=B({},r,{component:l}),c=js(o);return e.jsx(pe.Provider,{value:ws,children:e.jsx(ys,B({as:l,className:Z(c.root,i),ref:n,role:l===Ae?null:"rowgroup",ownerState:o},a))})}),ct=Cs;function vs(t){return Q("MuiTableRow",t)}const Ts=q("MuiTableRow",["root","selected","hover","head","footer"]),Fe=Ts,Ss=["className","component","hover","selected"],$s=t=>{const{classes:s,selected:n,hover:r,head:i,footer:l}=t;return J({root:["root",n&&"selected",r&&"hover",i&&"head",l&&"footer"]},vs,s)},ks=O("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.head&&s.head,n.footer&&s.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Fe.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Fe.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:oe(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:oe(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),Oe="tr",_s=h.forwardRef(function(s,n){const r=X({props:s,name:"MuiTableRow"}),{className:i,component:l=Oe,hover:a=!1,selected:o=!1}=r,c=K(r,Ss),u=h.useContext(pe),m=B({},r,{component:l,hover:a,selected:o,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),p=$s(m);return e.jsx(ks,B({as:l,ref:n,className:Z(p.root,i),role:l===Oe?null:"row",ownerState:m},c))}),U=_s;function je(t){const s=new Date(Number(t)*1e3),n=s.getFullYear(),r=(1+s.getMonth()).toString().padStart(2,"0");return`${s.getDate().toString().padStart(2,"0")}/${r}/${n}`}const f=d(fs)` && { color: ${x.white}; diff --git a/build/assets/index-f19bc108.js b/build/assets/index-5d2fab8a.js similarity index 90% rename from build/assets/index-f19bc108.js rename to build/assets/index-5d2fab8a.js index 30c8e4a1c..2087750fe 100644 --- a/build/assets/index-f19bc108.js +++ b/build/assets/index-5d2fab8a.js @@ -1,4 +1,4 @@ -import{r as p,H as T,j as e,F as x,aW as I,t as n,T as v,v as _,aZ as L}from"./index-69dca385.js";import{ai as A,aP as B,aQ as E,aR as F,u as M,a0 as N,e as k,a1 as O,B as z}from"./index-94c3c981.js";import{B as D}from"./index-23519643.js";import{u as w}from"./index-e0a45087.js";import{S as P,A as R,I as Y}from"./constants-a86c243d.js";import{O as H}from"./constants-b2a2fa82.js";import{A as W,T as X}from"./index-49403f56.js";import{C as Q}from"./ClipLoader-e049ef5e.js";import"./Stack-57ab9e76.js";import"./createSvgIcon-7c6eee06.js";import"./TextareaAutosize-6f8daf3f.js";const U=({topicId:s,onSelect:a,selectedValue:d,dataId:c})=>{const[u,f]=p.useState([]),[g,h]=p.useState(!1),j=p.useMemo(()=>{const o=async i=>{const m={is_muted:"False",sort_by:R,search:i,skip:"0",limit:"1000"};h(!0);try{const C=(await I(m.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==s);f(C)}catch{f([])}finally{h(!1)}};return T.debounce(o,300)},[s]),r=o=>{const i=o.trim();if(!i){f([]);return}i.length>2&&j(o)},b=o=>{const i=o?u.find(m=>m.ref_id===o.value):null;a(i||null)},t=o=>({label:o.search_value,value:o.ref_id,type:o.node_type}),S=o=>o.map(t);return d?e.jsxs(x,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:d.search_value}),e.jsx(P,{onClick:()=>a(null),size:"medium",children:e.jsx(A,{})})]}):e.jsx(W,{dataId:c,handleInputChange:r,isLoading:g,onSelect:b,options:S(u)||H,selectedValue:d?t(d):null})},Z=({from:s,onSelect:a,selectedToNode:d,isSwapped:c,setIsSwapped:u})=>e.jsxs(x,{mb:20,children:[e.jsx(x,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(x,{align:"center",direction:"row",children:e.jsx($,{children:"Merge topic"})})}),e.jsxs(J,{swap:c,children:[e.jsx(q,{children:e.jsx(K,{disabled:!0,label:c?"To":"From",swap:c,value:s==null?void 0:s.name})}),e.jsxs(x,{my:16,children:[e.jsx(ee,{children:"Type"}),e.jsx(v,{children:"IS ALIAS"})]}),e.jsx(x,{"data-testid":"to-section-container",children:e.jsxs(V,{children:[e.jsx(te,{children:c?"From":"To"}),e.jsx(U,{dataId:"to-node",onSelect:a,selectedValue:d,topicId:s==null?void 0:s.ref_id})]})}),e.jsxs(G,{children:[e.jsx(oe,{children:e.jsx(B,{})}),e.jsx(se,{"data-testid":"swap-icon",onClick:u,children:e.jsx(E,{})}),e.jsx(ne,{children:e.jsx(F,{})})]})]})]}),$=n(v)` +import{r as p,H as T,j as e,F as x,aW as I,t as n,T as v,v as _,aZ as L}from"./index-b856be88.js";import{ai as A,aP as B,aQ as E,aR as F,u as M,a0 as N,e as k,a1 as O,B as z}from"./index-c59af388.js";import{B as D}from"./index-8264b104.js";import{u as w}from"./index-deba249f.js";import{S as P,A as R,I as Y}from"./constants-011d5486.js";import{O as H}from"./constants-b2a2fa82.js";import{A as W,T as X}from"./index-c61dca86.js";import{C as Q}from"./ClipLoader-83661b90.js";import"./Stack-e0f879a7.js";import"./createSvgIcon-ed559792.js";import"./TextareaAutosize-981375ed.js";const U=({topicId:s,onSelect:a,selectedValue:d,dataId:c})=>{const[u,f]=p.useState([]),[g,h]=p.useState(!1),j=p.useMemo(()=>{const o=async i=>{const m={is_muted:"False",sort_by:R,search:i,skip:"0",limit:"1000"};h(!0);try{const C=(await I(m.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==s);f(C)}catch{f([])}finally{h(!1)}};return T.debounce(o,300)},[s]),r=o=>{const i=o.trim();if(!i){f([]);return}i.length>2&&j(o)},b=o=>{const i=o?u.find(m=>m.ref_id===o.value):null;a(i||null)},t=o=>({label:o.search_value,value:o.ref_id,type:o.node_type}),S=o=>o.map(t);return d?e.jsxs(x,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:d.search_value}),e.jsx(P,{onClick:()=>a(null),size:"medium",children:e.jsx(A,{})})]}):e.jsx(W,{dataId:c,handleInputChange:r,isLoading:g,onSelect:b,options:S(u)||H,selectedValue:d?t(d):null})},Z=({from:s,onSelect:a,selectedToNode:d,isSwapped:c,setIsSwapped:u})=>e.jsxs(x,{mb:20,children:[e.jsx(x,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(x,{align:"center",direction:"row",children:e.jsx($,{children:"Merge topic"})})}),e.jsxs(J,{swap:c,children:[e.jsx(q,{children:e.jsx(K,{disabled:!0,label:c?"To":"From",swap:c,value:s==null?void 0:s.name})}),e.jsxs(x,{my:16,children:[e.jsx(ee,{children:"Type"}),e.jsx(v,{children:"IS ALIAS"})]}),e.jsx(x,{"data-testid":"to-section-container",children:e.jsxs(V,{children:[e.jsx(te,{children:c?"From":"To"}),e.jsx(U,{dataId:"to-node",onSelect:a,selectedValue:d,topicId:s==null?void 0:s.ref_id})]})}),e.jsxs(G,{children:[e.jsx(oe,{children:e.jsx(B,{})}),e.jsx(se,{"data-testid":"swap-icon",onClick:u,children:e.jsx(E,{})}),e.jsx(ne,{children:e.jsx(F,{})})]})]})]}),$=n(v)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; diff --git a/build/assets/index-47786f03.js b/build/assets/index-680a4e6b.js similarity index 99% rename from build/assets/index-47786f03.js rename to build/assets/index-680a4e6b.js index 9022401ee..465388ebf 100644 --- a/build/assets/index-47786f03.js +++ b/build/assets/index-680a4e6b.js @@ -1,4 +1,4 @@ -import{r as P,g as Cc,b as yi,b9 as _c,ba as ed,j as L,R as td,v as Ji,bb as nd,bc as rd,bd as id}from"./index-69dca385.js";import{A as fl,H as Vl,I as od,U as ad,d as Ec,k as ld,C as ro,J as sd,O as Zl,x as Ql,K as da,N as dl,X as ud,Y as cd,Z as fd,_ as dd,$ as hd,a0 as pd,a1 as vd,V as st,b as Nr,a2 as md,h as gd,g as Xl,r as pa,a3 as Tc,e as Ul,a4 as Rl,a5 as pi,a6 as yd,s as Yl,a7 as xd,a8 as Fl,a9 as Fu,aa as wd,j as Mc,ab as Sd,l as io,ac as xi,o as kc,ad as Cd,ae as _d,af as Ed,ag as Td,ah as Md,ai as Au,aj as kd,ak as Pd,M as Ld,al as Ud,am as Jl,an as Du,ao as Ir,ap as Rd,i as hl}from"./three.module-52004ab8.js";import{b3 as _t,v as Fd,f as Ad}from"./index-94c3c981.js";var Pc={exports:{}},Gr={};/** +import{r as P,g as Cc,b as yi,b9 as _c,ba as ed,j as L,R as td,v as Ji,bb as nd,bc as rd,bd as id}from"./index-b856be88.js";import{A as fl,H as Vl,I as od,U as ad,d as Ec,k as ld,C as ro,J as sd,O as Zl,x as Ql,K as da,N as dl,X as ud,Y as cd,Z as fd,_ as dd,$ as hd,a0 as pd,a1 as vd,V as st,b as Nr,a2 as md,h as gd,g as Xl,r as pa,a3 as Tc,e as Ul,a4 as Rl,a5 as pi,a6 as yd,s as Yl,a7 as xd,a8 as Fl,a9 as Fu,aa as wd,j as Mc,ab as Sd,l as io,ac as xi,o as kc,ad as Cd,ae as _d,af as Ed,ag as Td,ah as Md,ai as Au,aj as kd,ak as Pd,M as Ld,al as Ud,am as Jl,an as Du,ao as Ir,ap as Rd,i as hl}from"./three.module-52004ab8.js";import{b3 as _t,v as Fd,f as Ad}from"./index-c59af388.js";var Pc={exports:{}},Gr={};/** * @license React * react-reconciler-constants.production.min.js * diff --git a/build/assets/index-6f865e1f.js b/build/assets/index-795f4525.js similarity index 89% rename from build/assets/index-6f865e1f.js rename to build/assets/index-795f4525.js index ce8a87a1b..b55241794 100644 --- a/build/assets/index-6f865e1f.js +++ b/build/assets/index-795f4525.js @@ -1,4 +1,4 @@ -import{t as a,j as e,F as s,aA as g,T as n,v as i,r as m,Z as j}from"./index-69dca385.js";import{B as S,b5 as w,u as y,a0 as k,a1 as v}from"./index-94c3c981.js";import{B as F}from"./index-23519643.js";import{S as B}from"./index-d70b7e8e.js";import{T}from"./index-e780f823.js";import"./index.esm-86c83cdb.js";const E=({allowNextStep:r})=>e.jsxs(s,{p:12,children:[e.jsx(s,{align:"center",direction:"row",justify:"space-between",mb:25,children:e.jsx(s,{align:"center",direction:"row",children:e.jsx(z,{children:"Feedback"})})}),e.jsx(s,{mb:30,children:e.jsx(T,{id:"feedback-message",isTextArea:!0,maxLength:500,name:"message",placeholder:"Leave your feedback here ...",rules:g})}),e.jsx(s,{children:e.jsx(S,{color:"secondary","data-testid":"submit-feedback-btn",disabled:!r,size:"large",type:"submit",variant:"contained",children:"Submit"})})]}),z=a(n)` +import{t as a,j as e,F as s,aA as g,T as n,v as i,r as m,Z as j}from"./index-b856be88.js";import{B as S,b5 as w,u as y,a0 as k,a1 as v}from"./index-c59af388.js";import{B as F}from"./index-8264b104.js";import{S as B}from"./index-fabd940a.js";import{T}from"./index-37507caf.js";import"./index.esm-c2a09dd4.js";const E=({allowNextStep:r})=>e.jsxs(s,{p:12,children:[e.jsx(s,{align:"center",direction:"row",justify:"space-between",mb:25,children:e.jsx(s,{align:"center",direction:"row",children:e.jsx(z,{children:"Feedback"})})}),e.jsx(s,{mb:30,children:e.jsx(T,{id:"feedback-message",isTextArea:!0,maxLength:500,name:"message",placeholder:"Leave your feedback here ...",rules:g})}),e.jsx(s,{children:e.jsx(S,{color:"secondary","data-testid":"submit-feedback-btn",disabled:!r,size:"large",type:"submit",variant:"contained",children:"Submit"})})]}),z=a(n)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; diff --git a/build/assets/index-8bf7fe7b.js b/build/assets/index-7ec3eb9b.js similarity index 89% rename from build/assets/index-8bf7fe7b.js rename to build/assets/index-7ec3eb9b.js index b92de0d06..7e57372ee 100644 --- a/build/assets/index-8bf7fe7b.js +++ b/build/assets/index-7ec3eb9b.js @@ -1,4 +1,4 @@ -import{Z as F,bn as C,bo as m,bp as $,t as B,T as k,F as d,r as x,z,j as n,aA as M}from"./index-69dca385.js";import{$ as V,B as S,u as E,e as A,a0 as _,a1 as R}from"./index-94c3c981.js";import{B as G}from"./index-23519643.js";import{S as I}from"./index-d70b7e8e.js";import{A as K}from"./index-49403f56.js";import{T as N}from"./index-e780f823.js";import"./index.esm-86c83cdb.js";import"./Stack-57ab9e76.js";import"./createSvgIcon-7c6eee06.js";import"./TextareaAutosize-6f8daf3f.js";const U="https://community.sphinx.chat",O=async e=>await F.post("/bounty",JSON.stringify(e)),P=async e=>await C(`${U}/person/${e}`,{headers:{"Content-Type":"application/json"},method:"GET"}),W=async e=>await C(`${U}/workspaces/user/${e}`,{headers:{"Content-Type":"application/json"},method:"GET"});async function q(){try{const e=Math.floor(Date.now()/1e3),t=m.Buffer.from(e.toString(16),"hex"),r=m.Buffer.from(t).toString("base64"),s=await $.signMessage(r),a=L(s.signature),l=m.Buffer.concat([t,a],a.length+t.length);return v(l)}catch(e){return console.log("error from signing more message: ",e),""}}function L(e){const t=e.replace(/_/g,"/").replace(/-/g,"+"),r=t.padEnd(t.length+(4-t.length%4)%4,"=");return m.Buffer.from(r,"base64")}function v(e){let t="";const r=e.byteLength;for(let a=0;a{const t=e.trim();return!!(t&&D.test(t))},J=({errMessage:e,handleClose:t})=>{const{setValue:r,watch:s}=V(),[a,l]=x.useState([]),{pubKey:c}=z();x.useEffect(()=>{async function o(){try{const i=await P(c);if(!i.id){l([{label:"SecondBrain",value:"SecondBrain"}]);return}const p=await W(i.id);if(p.length>0){const w=[];for(let b=0;b{const i=(o==null?void 0:o.label)||"SecondBrain",p=(o==null?void 0:o.value)||"ck9drb84nncjnaefo090";r("nodeType",i,{shouldValidate:!0}),r("workspaceUuid",p)},y=H(u)&&!!g,h=o=>{o.key===" "&&o.preventDefault()};return n.jsxs(d,{children:[n.jsx(d,{align:"center",direction:"row",justify:"space-between",mb:18,children:n.jsx(Z,{children:"Create Bounty"})}),n.jsxs(d,{mb:20,children:[n.jsx(T,{children:"Select Workspace"}),n.jsx(K,{autoFocus:!0,onSelect:f,options:a})]}),n.jsxs(d,{mb:20,children:[n.jsx(T,{children:"Set Budget"}),n.jsx(N,{id:"budget",name:"budget",onKeyDown:h,placeholder:"Enter budget",rules:{...M,pattern:{value:D,message:"Please enter a valid number"}},value:u})]}),n.jsxs(d,{direction:"row",children:[n.jsx(d,{grow:1,children:n.jsx(S,{color:"secondary",onClick:()=>t(),size:"large",variant:"contained",children:"Cancel"})}),n.jsx(d,{grow:1,ml:20,children:n.jsx(S,{color:"secondary",disabled:!y,size:"large",type:"submit",variant:"contained",children:"Confirm"})})]}),e&&n.jsx(Q,{children:e})]})},T=B(k)` +import{Z as F,bn as C,bo as m,bp as $,t as B,T as k,F as d,r as x,z,j as n,aA as M}from"./index-b856be88.js";import{$ as V,B as S,u as E,e as A,a0 as _,a1 as R}from"./index-c59af388.js";import{B as G}from"./index-8264b104.js";import{S as I}from"./index-fabd940a.js";import{A as K}from"./index-c61dca86.js";import{T as N}from"./index-37507caf.js";import"./index.esm-c2a09dd4.js";import"./Stack-e0f879a7.js";import"./createSvgIcon-ed559792.js";import"./TextareaAutosize-981375ed.js";const U="https://community.sphinx.chat",O=async e=>await F.post("/bounty",JSON.stringify(e)),P=async e=>await C(`${U}/person/${e}`,{headers:{"Content-Type":"application/json"},method:"GET"}),W=async e=>await C(`${U}/workspaces/user/${e}`,{headers:{"Content-Type":"application/json"},method:"GET"});async function q(){try{const e=Math.floor(Date.now()/1e3),t=m.Buffer.from(e.toString(16),"hex"),r=m.Buffer.from(t).toString("base64"),s=await $.signMessage(r),a=L(s.signature),l=m.Buffer.concat([t,a],a.length+t.length);return v(l)}catch(e){return console.log("error from signing more message: ",e),""}}function L(e){const t=e.replace(/_/g,"/").replace(/-/g,"+"),r=t.padEnd(t.length+(4-t.length%4)%4,"=");return m.Buffer.from(r,"base64")}function v(e){let t="";const r=e.byteLength;for(let a=0;a{const t=e.trim();return!!(t&&D.test(t))},J=({errMessage:e,handleClose:t})=>{const{setValue:r,watch:s}=V(),[a,l]=x.useState([]),{pubKey:c}=z();x.useEffect(()=>{async function o(){try{const i=await P(c);if(!i.id){l([{label:"SecondBrain",value:"SecondBrain"}]);return}const p=await W(i.id);if(p.length>0){const w=[];for(let b=0;b{const i=(o==null?void 0:o.label)||"SecondBrain",p=(o==null?void 0:o.value)||"ck9drb84nncjnaefo090";r("nodeType",i,{shouldValidate:!0}),r("workspaceUuid",p)},y=H(u)&&!!g,h=o=>{o.key===" "&&o.preventDefault()};return n.jsxs(d,{children:[n.jsx(d,{align:"center",direction:"row",justify:"space-between",mb:18,children:n.jsx(Z,{children:"Create Bounty"})}),n.jsxs(d,{mb:20,children:[n.jsx(T,{children:"Select Workspace"}),n.jsx(K,{autoFocus:!0,onSelect:f,options:a})]}),n.jsxs(d,{mb:20,children:[n.jsx(T,{children:"Set Budget"}),n.jsx(N,{id:"budget",name:"budget",onKeyDown:h,placeholder:"Enter budget",rules:{...M,pattern:{value:D,message:"Please enter a valid number"}},value:u})]}),n.jsxs(d,{direction:"row",children:[n.jsx(d,{grow:1,children:n.jsx(S,{color:"secondary",onClick:()=>t(),size:"large",variant:"contained",children:"Cancel"})}),n.jsx(d,{grow:1,ml:20,children:n.jsx(S,{color:"secondary",disabled:!y,size:"large",type:"submit",variant:"contained",children:"Confirm"})})]}),e&&n.jsx(Q,{children:e})]})},T=B(k)` font-size: 14px; font-weight: 600; font-family: 'Barlow'; diff --git a/build/assets/index-1a6ba924.js b/build/assets/index-80f4a8b1.js similarity index 96% rename from build/assets/index-1a6ba924.js rename to build/assets/index-80f4a8b1.js index 90eb97812..635fb05a5 100644 --- a/build/assets/index-1a6ba924.js +++ b/build/assets/index-80f4a8b1.js @@ -1,4 +1,4 @@ -import{K as M,J as B,q as T,y as z,N as G,z as N,Q as L,j as e,T as t,t as c,v as n,F as l}from"./index-69dca385.js";import{u as a,M as O,A as D,a as E,S as Q,C as R,b as U,F as W}from"./index-94c3c981.js";const H=()=>{const{open:r}=a("sourcesTable"),{open:p}=a("addItem"),{open:u}=a("addContent"),{open:h}=a("settings"),{open:x}=a("blueprintGraph"),{open:b}=a("feedback"),g=M(),{resetAiSummaryAnswer:j,setNewLoading:m}=B(),{abortFetchData:k,resetGraph:f}=T(o=>o),{setUniverseQuestionIsOpen:y,setSidebarOpen:w,setShowCollapseButton:S}=z(o=>o),{customSchemaFeatureFlag:C,userFeedbackFeatureFlag:F,chatInterfaceFeatureFlag:v}=G(o=>o),{isAdmin:d}=N(o=>o),I=L(),A=()=>{m(null),k(),j(),f(),g("/")},$=()=>{y(),w(!0),S(!0)};return e.jsxs(Y,{children:[e.jsx(q,{onClick:A,children:e.jsx("img",{alt:"Second brain",src:"logo.svg"})}),v?e.jsxs(i,{onClick:$,children:[e.jsx(s,{children:e.jsx(O,{})}),e.jsx(t,{children:"New Chat"})]}):null,d?e.jsxs(i,{"data-testid":"add-item-modal",onClick:p,children:[e.jsx(s,{children:e.jsx(D,{})}),e.jsx(t,{children:"Add Item"})]}):null,e.jsxs(i,{"data-testid":"add-content-modal",onClick:u,children:[e.jsx(s,{children:e.jsx(E,{})}),e.jsx(t,{children:"Add Content"})]}),e.jsxs(i,{id:"cy-open-soure-table",onClick:r,children:[e.jsx(s,{children:e.jsx(Q,{})}),e.jsx(t,{children:"Source Table"})]}),C&&d?e.jsxs(i,{"data-testid":"add-blueprint-modal",id:"cy-open-soure-table",onClick:x,children:[e.jsx(s,{children:e.jsx(R,{})}),e.jsx(t,{children:"Blueprint"})]}):null,e.jsxs(i,{"data-testid":"settings-modal",onClick:h,children:[e.jsx(s,{children:e.jsx(U,{})}),e.jsx(t,{children:"Settings"})]}),F&&I?e.jsxs(J,{"data-testid":"feedback-modal",onClick:b,children:[e.jsx(s,{children:e.jsx(W,{})}),e.jsx(t,{children:"Send Feedback"})]}):null]})},Y=c(l).attrs({align:"flex-start",direction:"column",justify:"flex-start"})` +import{K as M,J as B,q as T,y as z,N as G,z as N,Q as L,j as e,T as t,t as c,v as n,F as l}from"./index-b856be88.js";import{u as a,M as O,A as D,a as E,S as Q,C as R,b as U,F as W}from"./index-c59af388.js";const H=()=>{const{open:r}=a("sourcesTable"),{open:p}=a("addItem"),{open:u}=a("addContent"),{open:h}=a("settings"),{open:x}=a("blueprintGraph"),{open:b}=a("feedback"),g=M(),{resetAiSummaryAnswer:j,setNewLoading:m}=B(),{abortFetchData:k,resetGraph:f}=T(o=>o),{setUniverseQuestionIsOpen:y,setSidebarOpen:w,setShowCollapseButton:S}=z(o=>o),{customSchemaFeatureFlag:C,userFeedbackFeatureFlag:F,chatInterfaceFeatureFlag:v}=G(o=>o),{isAdmin:d}=N(o=>o),I=L(),A=()=>{m(null),k(),j(),f(),g("/")},$=()=>{y(),w(!0),S(!0)};return e.jsxs(Y,{children:[e.jsx(q,{onClick:A,children:e.jsx("img",{alt:"Second brain",src:"logo.svg"})}),v?e.jsxs(i,{onClick:$,children:[e.jsx(s,{children:e.jsx(O,{})}),e.jsx(t,{children:"New Chat"})]}):null,d?e.jsxs(i,{"data-testid":"add-item-modal",onClick:p,children:[e.jsx(s,{children:e.jsx(D,{})}),e.jsx(t,{children:"Add Item"})]}):null,e.jsxs(i,{"data-testid":"add-content-modal",onClick:u,children:[e.jsx(s,{children:e.jsx(E,{})}),e.jsx(t,{children:"Add Content"})]}),e.jsxs(i,{id:"cy-open-soure-table",onClick:r,children:[e.jsx(s,{children:e.jsx(Q,{})}),e.jsx(t,{children:"Source Table"})]}),C&&d?e.jsxs(i,{"data-testid":"add-blueprint-modal",id:"cy-open-soure-table",onClick:x,children:[e.jsx(s,{children:e.jsx(R,{})}),e.jsx(t,{children:"Blueprint"})]}):null,e.jsxs(i,{"data-testid":"settings-modal",onClick:h,children:[e.jsx(s,{children:e.jsx(U,{})}),e.jsx(t,{children:"Settings"})]}),F&&I?e.jsxs(J,{"data-testid":"feedback-modal",onClick:b,children:[e.jsx(s,{children:e.jsx(W,{})}),e.jsx(t,{children:"Send Feedback"})]}):null]})},Y=c(l).attrs({align:"flex-start",direction:"column",justify:"flex-start"})` flex: 0 0 64px; z-index: 31; transition: opacity 1s; diff --git a/build/assets/index-23519643.js b/build/assets/index-8264b104.js similarity index 96% rename from build/assets/index-23519643.js rename to build/assets/index-8264b104.js index 46fc6f781..9e247ea89 100644 --- a/build/assets/index-23519643.js +++ b/build/assets/index-8264b104.js @@ -1,4 +1,4 @@ -import{a7 as m,t as s,v as r,a5 as o,F as d,r as w,j as e}from"./index-69dca385.js";import{u as v,ai as y}from"./index-94c3c981.js";const j=m` +import{a7 as m,t as s,v as r,a5 as o,F as d,r as w,j as e}from"./index-b856be88.js";import{u as v,ai as y}from"./index-c59af388.js";const j=m` 0% { transform: scale(0.8); } diff --git a/build/assets/index-0614cd43.js b/build/assets/index-9cbc5f11.js similarity index 99% rename from build/assets/index-0614cd43.js rename to build/assets/index-9cbc5f11.js index 5c1ec9f1c..a4067133b 100644 --- a/build/assets/index-0614cd43.js +++ b/build/assets/index-9cbc5f11.js @@ -1,4 +1,4 @@ -import{r as y,c as _o,d as jo,s as Wt,b as te,u as Oo,m as Ci,_ as Po,j as p,f as To,b2 as Sn,b3 as xr,h as $o,i as gt,e as Jr,a2 as Si,a3 as _i,t as O,v as j,aP as mr,T as Ce,F as T,aA as bn,b4 as ji,b5 as Hn,b6 as Oi,b7 as Pi,R as c,y as vr,a5 as ea,aO as Ao,b8 as Ti,az as ht,Z as ir,A as yr,O as $i,ab as ta}from"./index-69dca385.js";import{B as Ai}from"./index-23519643.js";import{a0 as wr,B as _n,a1 as Mo,ai as Er,P as E,I as sr,a$ as Mi,$ as ki,aw as Ri,D as ko,r as Ro,u as Bo,b0 as Bi,n as na,m as ra,l as aa,k as oa,j as Fi,b1 as Ni,b2 as Ii}from"./index-94c3c981.js";import{O as Di,n as Hi,a as ia,N as Fo}from"./constants-b2a2fa82.js";import{T as xn}from"./index-e780f823.js";import{A as Dt}from"./index-49403f56.js";import{C as Ne}from"./ClipLoader-e049ef5e.js";import{S as zi,j as Li,p as Gi,q as Wi,r as Ui,m as Vi,F as Yi}from"./map-85d405d6.js";import{T as Xi,a as Ki}from"./Tabs-b82c05ad.js";import{p as lr,c as qi,g as Zi}from"./index-28e22657.js";import{e as Qi}from"./Stack-57ab9e76.js";import{f as Ji,m as es,u as xe,a as jn,t as cr,T as No,h as Io,H as ts,i as sa,C as ns,P as rs,j as as}from"./index-47786f03.js";import{R as os,t as is,u as ss,V as L,v as Ke,w as qe,Q as la,x as un,O as pn,y as ca,b as pe,z as ls,n as cs,C as us}from"./three.module-52004ab8.js";import"./index.esm-86c83cdb.js";import"./createSvgIcon-7c6eee06.js";import"./TextareaAutosize-6f8daf3f.js";import"./Typography-543ae8c6.js";const ps=y.createContext(),ua=ps;function ds(t){return _o("MuiGrid",t)}const fs=[0,1,2,3,4,5,6,7,8,9,10],hs=["column-reverse","column","row-reverse","row"],gs=["nowrap","wrap-reverse","wrap"],Mt=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],bs=jo("MuiGrid",["root","container","item","zeroMinWidth",...fs.map(t=>`spacing-xs-${t}`),...hs.map(t=>`direction-xs-${t}`),...gs.map(t=>`wrap-xs-${t}`),...Mt.map(t=>`grid-xs-${t}`),...Mt.map(t=>`grid-sm-${t}`),...Mt.map(t=>`grid-md-${t}`),...Mt.map(t=>`grid-lg-${t}`),...Mt.map(t=>`grid-xl-${t}`)]),zt=bs,xs=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function bt(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function ms({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,a)=>{let o={};if(e[a]&&(n=e[a]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=Sn({values:e.columns,breakpoints:t.breakpoints.values}),i=typeof s=="object"?s[a]:s;if(i==null)return r;const l=`${Math.round(n/i*1e8)/1e6}%`;let u={};if(e.container&&e.item&&e.columnSpacing!==0){const d=t.spacing(e.columnSpacing);if(d!=="0px"){const f=`calc(${l} + ${bt(d)})`;u={flexBasis:f,maxWidth:f}}}o=te({flexBasis:l,flexGrow:0,maxWidth:l},u)}return t.breakpoints.values[a]===0?Object.assign(r,o):r[t.breakpoints.up(a)]=o,r},{})}function vs({theme:t,ownerState:e}){const n=Sn({values:e.direction,breakpoints:t.breakpoints.values});return xr({theme:t},n,r=>{const a={flexDirection:r};return r.indexOf("column")===0&&(a[`& > .${zt.item}`]={maxWidth:"none"}),a})}function Do({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(a=>{n===""&&e[a]!==0&&(n=a)});const r=Object.keys(t).sort((a,o)=>t[a]-t[o]);return r.slice(0,r.indexOf(n))}function ys({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let a={};if(n&&r!==0){const o=Sn({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=Do({breakpoints:t.breakpoints.values,values:o})),a=xr({theme:t},o,(i,l)=>{var u;const d=t.spacing(i);return d!=="0px"?{marginTop:`-${bt(d)}`,[`& > .${zt.item}`]:{paddingTop:bt(d)}}:(u=s)!=null&&u.includes(l)?{}:{marginTop:0,[`& > .${zt.item}`]:{paddingTop:0}}})}return a}function ws({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let a={};if(n&&r!==0){const o=Sn({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=Do({breakpoints:t.breakpoints.values,values:o})),a=xr({theme:t},o,(i,l)=>{var u;const d=t.spacing(i);return d!=="0px"?{width:`calc(100% + ${bt(d)})`,marginLeft:`-${bt(d)}`,[`& > .${zt.item}`]:{paddingLeft:bt(d)}}:(u=s)!=null&&u.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${zt.item}`]:{paddingLeft:0}}})}return a}function Es(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(a=>{const o=t[a];Number(o)>0&&r.push(n[`spacing-${a}-${String(o)}`])}),r}const Cs=Wt("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:a,item:o,spacing:s,wrap:i,zeroMinWidth:l,breakpoints:u}=n;let d=[];r&&(d=Es(s,u,e));const f=[];return u.forEach(h=>{const g=n[h];g&&f.push(e[`grid-${h}-${String(g)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...d,a!=="row"&&e[`direction-xs-${String(a)}`],i!=="wrap"&&e[`wrap-xs-${String(i)}`],...f]}})(({ownerState:t})=>te({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),vs,ys,ws,ms);function Ss(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const a=t[r];if(Number(a)>0){const o=`spacing-${r}-${String(a)}`;n.push(o)}}),n}const _s=t=>{const{classes:e,container:n,direction:r,item:a,spacing:o,wrap:s,zeroMinWidth:i,breakpoints:l}=t;let u=[];n&&(u=Ss(o,l));const d=[];l.forEach(h=>{const g=t[h];g&&d.push(`grid-${h}-${String(g)}`)});const f={root:["root",n&&"container",a&&"item",i&&"zeroMinWidth",...u,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...d]};return $o(f,ds,e)},js=y.forwardRef(function(e,n){const r=Oo({props:e,name:"MuiGrid"}),{breakpoints:a}=Ci(),o=Qi(r),{className:s,columns:i,columnSpacing:l,component:u="div",container:d=!1,direction:f="row",item:h=!1,rowSpacing:g,spacing:x=0,wrap:m="wrap",zeroMinWidth:v=!1}=o,w=Po(o,xs),_=g||x,B=l||x,P=y.useContext(ua),A=d?i||12:P,M={},W=te({},w);a.keys.forEach(S=>{w[S]!=null&&(M[S]=w[S],delete W[S])});const H=te({},o,{columns:A,container:d,direction:f,item:h,rowSpacing:_,columnSpacing:B,wrap:m,zeroMinWidth:v,spacing:x},M,{breakpoints:a.keys}),V=_s(H);return p.jsx(ua.Provider,{value:A,children:p.jsx(Cs,te({ownerState:H,className:To(V.root,s),as:u,ref:n},W))})}),Se=js;function Os(t){return _o("MuiSwitch",t)}const Ps=jo("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),J=Ps,Ts=["className","color","edge","size","sx"],$s=t=>{const{classes:e,edge:n,size:r,color:a,checked:o,disabled:s}=t,i={root:["root",n&&`edge${gt(n)}`,`size${gt(r)}`],switchBase:["switchBase",`color${gt(a)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=$o(i,Os,e);return te({},e,l)},As=Wt("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${gt(n.edge)}`],e[`size${gt(n.size)}`]]}})(({ownerState:t})=>te({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},t.edge==="start"&&{marginLeft:-8},t.edge==="end"&&{marginRight:-8},t.size==="small"&&{width:40,height:24,padding:7,[`& .${J.thumb}`]:{width:16,height:16},[`& .${J.switchBase}`]:{padding:4,[`&.${J.checked}`]:{transform:"translateX(16px)"}}})),Ms=Wt(zi,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${J.input}`]:e.input},n.color!=="default"&&e[`color${gt(n.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${J.checked}`]:{transform:"translateX(20px)"},[`&.${J.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${J.checked} + .${J.track}`]:{opacity:.5},[`&.${J.disabled} + .${J.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${J.input}`]:{left:"-100%",width:"300%"}}),({theme:t,ownerState:e})=>te({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Jr(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${J.checked}`]:{color:(t.vars||t).palette[e.color].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jr(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${J.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e.color}DisabledColor`]:`${t.palette.mode==="light"?Si(t.palette[e.color].main,.62):_i(t.palette[e.color].main,.55)}`}},[`&.${J.checked} + .${J.track}`]:{backgroundColor:(t.vars||t).palette[e.color].main}})),ks=Wt("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),Rs=Wt("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),Bs=y.forwardRef(function(e,n){const r=Oo({props:e,name:"MuiSwitch"}),{className:a,color:o="primary",edge:s=!1,size:i="medium",sx:l}=r,u=Po(r,Ts),d=te({},r,{color:o,edge:s,size:i}),f=$s(d),h=p.jsx(Rs,{className:f.thumb,ownerState:d});return p.jsxs(As,{className:To(f.root,a),sx:l,ownerState:d,children:[p.jsx(Ms,te({type:"checkbox",icon:h,checkedIcon:h,ref:n,ownerState:d},u,{classes:te({},f,{root:f.switchBase})})),p.jsx(ks,{className:f.track,ownerState:d})]})}),Ho=Bs,Fs={type:"",parent:""},pa=({onSelect:t,dataTestId:e,edgeLink:n,hideSelectAll:r,placeholder:a})=>{const o=wr({mode:"onChange",defaultValues:Fs}),{watch:s,setValue:i}=o,[l,u]=y.useState([]),[d,f]=y.useState(!1),h=v=>{i("parent",(v==null?void 0:v.value)||""),t(v==null?void 0:v.value)},g=v=>v.charAt(0).toUpperCase()+v.slice(1);y.useEffect(()=>{(async()=>{f(!0);try{const _=(await mr()).schemas.filter(P=>!P.is_deleted&&P.type).map(P=>(P==null?void 0:P.type)==="thing"?{label:"No Parent",value:P.type}:{label:g(P.type),value:P.type});u(r?_:[{label:"Select all",value:"all"},..._]),n&&i("parent",n)}catch(w){console.warn(w)}finally{f(!1)}})()},[n,i,r]);const x=s("parent"),m=()=>{const v=l==null?void 0:l.find(w=>w.value===x);if(v)return v;if(n)return{label:n,value:n}};return p.jsx(Ns,{dataTestId:e,disabled:!!n,isLoading:d,onSelect:h,options:l||Di,placeholder:a,selectedValue:m()})},Ns=O(Dt)` +import{r as y,c as _o,d as jo,s as Wt,b as te,u as Oo,m as Ci,_ as Po,j as p,f as To,b2 as Sn,b3 as xr,h as $o,i as gt,e as Jr,a2 as Si,a3 as _i,t as O,v as j,aP as mr,T as Ce,F as T,aA as bn,b4 as ji,b5 as Hn,b6 as Oi,b7 as Pi,R as c,y as vr,a5 as ea,aO as Ao,b8 as Ti,az as ht,Z as ir,A as yr,O as $i,ab as ta}from"./index-b856be88.js";import{B as Ai}from"./index-8264b104.js";import{a0 as wr,B as _n,a1 as Mo,ai as Er,P as E,I as sr,a$ as Mi,$ as ki,aw as Ri,D as ko,r as Ro,u as Bo,b0 as Bi,n as na,m as ra,l as aa,k as oa,j as Fi,b1 as Ni,b2 as Ii}from"./index-c59af388.js";import{O as Di,n as Hi,a as ia,N as Fo}from"./constants-b2a2fa82.js";import{T as xn}from"./index-37507caf.js";import{A as Dt}from"./index-c61dca86.js";import{C as Ne}from"./ClipLoader-83661b90.js";import{S as zi,j as Li,p as Gi,q as Wi,r as Ui,m as Vi,F as Yi}from"./map-e077fe83.js";import{T as Xi,a as Ki}from"./Tabs-88a6cc23.js";import{p as lr,c as qi,g as Zi}from"./index-28e22657.js";import{e as Qi}from"./Stack-e0f879a7.js";import{f as Ji,m as es,u as xe,a as jn,t as cr,T as No,h as Io,H as ts,i as sa,C as ns,P as rs,j as as}from"./index-680a4e6b.js";import{R as os,t as is,u as ss,V as L,v as Ke,w as qe,Q as la,x as un,O as pn,y as ca,b as pe,z as ls,n as cs,C as us}from"./three.module-52004ab8.js";import"./index.esm-c2a09dd4.js";import"./createSvgIcon-ed559792.js";import"./TextareaAutosize-981375ed.js";import"./Typography-69404db2.js";const ps=y.createContext(),ua=ps;function ds(t){return _o("MuiGrid",t)}const fs=[0,1,2,3,4,5,6,7,8,9,10],hs=["column-reverse","column","row-reverse","row"],gs=["nowrap","wrap-reverse","wrap"],Mt=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],bs=jo("MuiGrid",["root","container","item","zeroMinWidth",...fs.map(t=>`spacing-xs-${t}`),...hs.map(t=>`direction-xs-${t}`),...gs.map(t=>`wrap-xs-${t}`),...Mt.map(t=>`grid-xs-${t}`),...Mt.map(t=>`grid-sm-${t}`),...Mt.map(t=>`grid-md-${t}`),...Mt.map(t=>`grid-lg-${t}`),...Mt.map(t=>`grid-xl-${t}`)]),zt=bs,xs=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function bt(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function ms({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,a)=>{let o={};if(e[a]&&(n=e[a]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=Sn({values:e.columns,breakpoints:t.breakpoints.values}),i=typeof s=="object"?s[a]:s;if(i==null)return r;const l=`${Math.round(n/i*1e8)/1e6}%`;let u={};if(e.container&&e.item&&e.columnSpacing!==0){const d=t.spacing(e.columnSpacing);if(d!=="0px"){const f=`calc(${l} + ${bt(d)})`;u={flexBasis:f,maxWidth:f}}}o=te({flexBasis:l,flexGrow:0,maxWidth:l},u)}return t.breakpoints.values[a]===0?Object.assign(r,o):r[t.breakpoints.up(a)]=o,r},{})}function vs({theme:t,ownerState:e}){const n=Sn({values:e.direction,breakpoints:t.breakpoints.values});return xr({theme:t},n,r=>{const a={flexDirection:r};return r.indexOf("column")===0&&(a[`& > .${zt.item}`]={maxWidth:"none"}),a})}function Do({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(a=>{n===""&&e[a]!==0&&(n=a)});const r=Object.keys(t).sort((a,o)=>t[a]-t[o]);return r.slice(0,r.indexOf(n))}function ys({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let a={};if(n&&r!==0){const o=Sn({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=Do({breakpoints:t.breakpoints.values,values:o})),a=xr({theme:t},o,(i,l)=>{var u;const d=t.spacing(i);return d!=="0px"?{marginTop:`-${bt(d)}`,[`& > .${zt.item}`]:{paddingTop:bt(d)}}:(u=s)!=null&&u.includes(l)?{}:{marginTop:0,[`& > .${zt.item}`]:{paddingTop:0}}})}return a}function ws({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let a={};if(n&&r!==0){const o=Sn({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=Do({breakpoints:t.breakpoints.values,values:o})),a=xr({theme:t},o,(i,l)=>{var u;const d=t.spacing(i);return d!=="0px"?{width:`calc(100% + ${bt(d)})`,marginLeft:`-${bt(d)}`,[`& > .${zt.item}`]:{paddingLeft:bt(d)}}:(u=s)!=null&&u.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${zt.item}`]:{paddingLeft:0}}})}return a}function Es(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(a=>{const o=t[a];Number(o)>0&&r.push(n[`spacing-${a}-${String(o)}`])}),r}const Cs=Wt("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:a,item:o,spacing:s,wrap:i,zeroMinWidth:l,breakpoints:u}=n;let d=[];r&&(d=Es(s,u,e));const f=[];return u.forEach(h=>{const g=n[h];g&&f.push(e[`grid-${h}-${String(g)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...d,a!=="row"&&e[`direction-xs-${String(a)}`],i!=="wrap"&&e[`wrap-xs-${String(i)}`],...f]}})(({ownerState:t})=>te({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),vs,ys,ws,ms);function Ss(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const a=t[r];if(Number(a)>0){const o=`spacing-${r}-${String(a)}`;n.push(o)}}),n}const _s=t=>{const{classes:e,container:n,direction:r,item:a,spacing:o,wrap:s,zeroMinWidth:i,breakpoints:l}=t;let u=[];n&&(u=Ss(o,l));const d=[];l.forEach(h=>{const g=t[h];g&&d.push(`grid-${h}-${String(g)}`)});const f={root:["root",n&&"container",a&&"item",i&&"zeroMinWidth",...u,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...d]};return $o(f,ds,e)},js=y.forwardRef(function(e,n){const r=Oo({props:e,name:"MuiGrid"}),{breakpoints:a}=Ci(),o=Qi(r),{className:s,columns:i,columnSpacing:l,component:u="div",container:d=!1,direction:f="row",item:h=!1,rowSpacing:g,spacing:x=0,wrap:m="wrap",zeroMinWidth:v=!1}=o,w=Po(o,xs),_=g||x,B=l||x,P=y.useContext(ua),A=d?i||12:P,M={},W=te({},w);a.keys.forEach(S=>{w[S]!=null&&(M[S]=w[S],delete W[S])});const H=te({},o,{columns:A,container:d,direction:f,item:h,rowSpacing:_,columnSpacing:B,wrap:m,zeroMinWidth:v,spacing:x},M,{breakpoints:a.keys}),V=_s(H);return p.jsx(ua.Provider,{value:A,children:p.jsx(Cs,te({ownerState:H,className:To(V.root,s),as:u,ref:n},W))})}),Se=js;function Os(t){return _o("MuiSwitch",t)}const Ps=jo("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),J=Ps,Ts=["className","color","edge","size","sx"],$s=t=>{const{classes:e,edge:n,size:r,color:a,checked:o,disabled:s}=t,i={root:["root",n&&`edge${gt(n)}`,`size${gt(r)}`],switchBase:["switchBase",`color${gt(a)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=$o(i,Os,e);return te({},e,l)},As=Wt("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${gt(n.edge)}`],e[`size${gt(n.size)}`]]}})(({ownerState:t})=>te({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},t.edge==="start"&&{marginLeft:-8},t.edge==="end"&&{marginRight:-8},t.size==="small"&&{width:40,height:24,padding:7,[`& .${J.thumb}`]:{width:16,height:16},[`& .${J.switchBase}`]:{padding:4,[`&.${J.checked}`]:{transform:"translateX(16px)"}}})),Ms=Wt(zi,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${J.input}`]:e.input},n.color!=="default"&&e[`color${gt(n.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${J.checked}`]:{transform:"translateX(20px)"},[`&.${J.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${J.checked} + .${J.track}`]:{opacity:.5},[`&.${J.disabled} + .${J.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${J.input}`]:{left:"-100%",width:"300%"}}),({theme:t,ownerState:e})=>te({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Jr(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${J.checked}`]:{color:(t.vars||t).palette[e.color].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Jr(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${J.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e.color}DisabledColor`]:`${t.palette.mode==="light"?Si(t.palette[e.color].main,.62):_i(t.palette[e.color].main,.55)}`}},[`&.${J.checked} + .${J.track}`]:{backgroundColor:(t.vars||t).palette[e.color].main}})),ks=Wt("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),Rs=Wt("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),Bs=y.forwardRef(function(e,n){const r=Oo({props:e,name:"MuiSwitch"}),{className:a,color:o="primary",edge:s=!1,size:i="medium",sx:l}=r,u=Po(r,Ts),d=te({},r,{color:o,edge:s,size:i}),f=$s(d),h=p.jsx(Rs,{className:f.thumb,ownerState:d});return p.jsxs(As,{className:To(f.root,a),sx:l,ownerState:d,children:[p.jsx(Ms,te({type:"checkbox",icon:h,checkedIcon:h,ref:n,ownerState:d},u,{classes:te({},f,{root:f.switchBase})})),p.jsx(ks,{className:f.track,ownerState:d})]})}),Ho=Bs,Fs={type:"",parent:""},pa=({onSelect:t,dataTestId:e,edgeLink:n,hideSelectAll:r,placeholder:a})=>{const o=wr({mode:"onChange",defaultValues:Fs}),{watch:s,setValue:i}=o,[l,u]=y.useState([]),[d,f]=y.useState(!1),h=v=>{i("parent",(v==null?void 0:v.value)||""),t(v==null?void 0:v.value)},g=v=>v.charAt(0).toUpperCase()+v.slice(1);y.useEffect(()=>{(async()=>{f(!0);try{const _=(await mr()).schemas.filter(P=>!P.is_deleted&&P.type).map(P=>(P==null?void 0:P.type)==="thing"?{label:"No Parent",value:P.type}:{label:g(P.type),value:P.type});u(r?_:[{label:"Select all",value:"all"},..._]),n&&i("parent",n)}catch(w){console.warn(w)}finally{f(!1)}})()},[n,i,r]);const x=s("parent"),m=()=>{const v=l==null?void 0:l.find(w=>w.value===x);if(v)return v;if(n)return{label:n,value:n}};return p.jsx(Ns,{dataTestId:e,disabled:!!n,isLoading:d,onSelect:h,options:l||Di,placeholder:a,selectedValue:m()})},Ns=O(Dt)` .MuiInputBase-input { font-family: Barlow; font-size: 14px; diff --git a/build/assets/index-6eefb34c.js b/build/assets/index-9de094c9.js similarity index 91% rename from build/assets/index-6eefb34c.js rename to build/assets/index-9de094c9.js index 6ac90a20b..ff0371aaa 100644 --- a/build/assets/index-6eefb34c.js +++ b/build/assets/index-9de094c9.js @@ -1,4 +1,4 @@ -import{r,j as e,aV as O,H as k,F as h,aW as E,t as l,T as A,v as T,aX as F}from"./index-69dca385.js";import{B as z}from"./index-23519643.js";import{ai as N,aP as D,aQ as M,aR as P,u as I,a0 as X,e as Y,a1 as H,B as R}from"./index-94c3c981.js";import{A as L,T as G}from"./index-49403f56.js";import{O as V}from"./constants-b2a2fa82.js";import{S as W,A as Q}from"./constants-a86c243d.js";import{C as _}from"./ClipLoader-e049ef5e.js";import"./Stack-57ab9e76.js";import"./createSvgIcon-7c6eee06.js";import"./TextareaAutosize-6f8daf3f.js";const $=({selectedType:t,setSelectedType:c})=>{const[p,d]=r.useState([]);r.useEffect(()=>{(async()=>{try{const{data:x}=await O();d(x.edge_types)}catch(x){console.warn(x)}})()},[d]);const a=o=>({label:o,value:o}),f=o=>{c((o==null?void 0:o.value)||"")};return e.jsx(L,{onSelect:f,options:p.map(a),selectedValue:t?a(t):null})},q=({onSelect:t,selectedValue:c,topicId:p})=>{const[d,a]=r.useState([]),[f,o]=r.useState(!1),x=r.useMemo(()=>{const s=async u=>{const i={is_muted:"False",sort_by:Q,search:u,skip:"0",limit:"1000"};o(!0);try{const w=(await E(i.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==p);a(w)}catch{a([])}finally{o(!1)}};return k.debounce(s,300)},[p]),b=s=>{const u=s.trim();if(!u){a([]);return}u.length>2&&x(s)},j=s=>{const u=s?d.find(i=>i.ref_id===s.value):null;t(u||null)},n=s=>({label:s.search_value,value:s.ref_id,type:s.node_type}),v=s=>s.map(n);return c?e.jsxs(h,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:c.search_value}),e.jsx(W,{onClick:()=>t(null),size:"medium",children:e.jsx(N,{})})]}):e.jsx(L,{handleInputChange:b,isLoading:f,onSelect:j,options:v(d)||V,selectedValue:c?n(c):null})},J=({from:t,onSelect:c,selectedType:p,setSelectedType:d,selectedToNode:a,setIsSwapped:f,isSwapped:o})=>{const x=()=>{f()},b=t&&("search_value"in t?t.search_value:t.name);return e.jsxs(h,{mb:20,children:[e.jsx(h,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(h,{align:"center",direction:"row",children:e.jsx(U,{children:"Add Edge"})})}),e.jsxs(Z,{swap:o,children:[e.jsx(h,{children:e.jsx(ee,{disabled:!0,label:o?"To":"From",swap:o,value:b})}),e.jsxs(h,{my:16,children:[e.jsx(oe,{children:"Type"}),e.jsx($,{selectedType:p,setSelectedType:d})]}),e.jsx(h,{children:e.jsxs(te,{children:[e.jsx(se,{children:o?"From":"To"}),e.jsx(q,{onSelect:c,selectedValue:a,topicId:t==null?void 0:t.ref_id})]})}),e.jsxs(K,{children:[e.jsx(ne,{children:e.jsx(D,{})}),e.jsx(ae,{onClick:x,children:e.jsx(M,{})}),e.jsx(ie,{children:e.jsx(P,{})})]})]})]})},K=l.div` +import{r,j as e,aV as O,H as k,F as h,aW as E,t as l,T as A,v as T,aX as F}from"./index-b856be88.js";import{B as z}from"./index-8264b104.js";import{ai as N,aP as D,aQ as M,aR as P,u as I,a0 as X,e as Y,a1 as H,B as R}from"./index-c59af388.js";import{A as L,T as G}from"./index-c61dca86.js";import{O as V}from"./constants-b2a2fa82.js";import{S as W,A as Q}from"./constants-011d5486.js";import{C as _}from"./ClipLoader-83661b90.js";import"./Stack-e0f879a7.js";import"./createSvgIcon-ed559792.js";import"./TextareaAutosize-981375ed.js";const $=({selectedType:t,setSelectedType:c})=>{const[p,d]=r.useState([]);r.useEffect(()=>{(async()=>{try{const{data:x}=await O();d(x.edge_types)}catch(x){console.warn(x)}})()},[d]);const a=o=>({label:o,value:o}),f=o=>{c((o==null?void 0:o.value)||"")};return e.jsx(L,{onSelect:f,options:p.map(a),selectedValue:t?a(t):null})},q=({onSelect:t,selectedValue:c,topicId:p})=>{const[d,a]=r.useState([]),[f,o]=r.useState(!1),x=r.useMemo(()=>{const s=async u=>{const i={is_muted:"False",sort_by:Q,search:u,skip:"0",limit:"1000"};o(!0);try{const w=(await E(i.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==p);a(w)}catch{a([])}finally{o(!1)}};return k.debounce(s,300)},[p]),b=s=>{const u=s.trim();if(!u){a([]);return}u.length>2&&x(s)},j=s=>{const u=s?d.find(i=>i.ref_id===s.value):null;t(u||null)},n=s=>({label:s.search_value,value:s.ref_id,type:s.node_type}),v=s=>s.map(n);return c?e.jsxs(h,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:c.search_value}),e.jsx(W,{onClick:()=>t(null),size:"medium",children:e.jsx(N,{})})]}):e.jsx(L,{handleInputChange:b,isLoading:f,onSelect:j,options:v(d)||V,selectedValue:c?n(c):null})},J=({from:t,onSelect:c,selectedType:p,setSelectedType:d,selectedToNode:a,setIsSwapped:f,isSwapped:o})=>{const x=()=>{f()},b=t&&("search_value"in t?t.search_value:t.name);return e.jsxs(h,{mb:20,children:[e.jsx(h,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(h,{align:"center",direction:"row",children:e.jsx(U,{children:"Add Edge"})})}),e.jsxs(Z,{swap:o,children:[e.jsx(h,{children:e.jsx(ee,{disabled:!0,label:o?"To":"From",swap:o,value:b})}),e.jsxs(h,{my:16,children:[e.jsx(oe,{children:"Type"}),e.jsx($,{selectedType:p,setSelectedType:d})]}),e.jsx(h,{children:e.jsxs(te,{children:[e.jsx(se,{children:o?"From":"To"}),e.jsx(q,{onSelect:c,selectedValue:a,topicId:t==null?void 0:t.ref_id})]})}),e.jsxs(K,{children:[e.jsx(ne,{children:e.jsx(D,{})}),e.jsx(ae,{onClick:x,children:e.jsx(M,{})}),e.jsx(ie,{children:e.jsx(P,{})})]})]})]})},K=l.div` position: absolute; top: 26px; bottom: 26px; diff --git a/build/assets/index-69dca385.js b/build/assets/index-b856be88.js similarity index 99% rename from build/assets/index-69dca385.js rename to build/assets/index-b856be88.js index 0a26e3eb8..6760c46f5 100644 --- a/build/assets/index-69dca385.js +++ b/build/assets/index-b856be88.js @@ -529,4 +529,4 @@ PROCEED WITH CAUTION! align-items: center; width: 100%; height: 100%; -`,LazyApp=reactExports.lazy(()=>__vitePreload(()=>import("./index-94c3c981.js").then(a=>a.bd),["assets/index-94c3c981.js","assets/index-b60658ac.css"]).then(({App:a})=>({default:a}))),AppContainer=()=>{const a=jsxRuntimeExports.jsx(LazyApp,{});return jsxRuntimeExports.jsxs(AppProviders,{children:[jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:jsxRuntimeExports.jsx(AuthGuard,{children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{element:a,path:"/"}),jsxRuntimeExports.jsx(Route,{element:a,path:"/search"}),jsxRuntimeExports.jsx(Route,{element:a,path:"*"})]})})}),jsxRuntimeExports.jsx(E2ETests,{})]})},index="",root=client$1.createRoot(document.getElementById("root"));root.render(isE2E?jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(AppContainer,{})}):jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(AppContainer,{})})}));reportWebVitals();overrideConsole();export{$2AODx$react as $,useSchemaStore as A,__vitePreload as B,lottie as C,getTotalProcessing as D,getStats as E,Flex as F,formatStatsResponse as G,lodashExports as H,media as I,useAiSummaryStore as J,useNavigate as K,LinearProgress$1 as L,useSearchParams as M,useFeatureFlagStore as N,isDevelopment as O,updateBudget as P,isSphinx as Q,React as R,SocketContext as S,Text as T,useNodeTypes as U,NODE_RELATIVE_HIGHLIGHT_COLORS as V,We as W,fetchNodeEdges as X,addToGlobalForE2e as Y,api$1 as Z,_objectWithoutPropertiesLoose as _,ReactDOM as a,deleteNode as a$,distExports$1 as a0,executeIfProd as a1,lighten as a2,darken as a3,slotShouldForwardProp as a4,Ce as a5,useHasAiChatsResponseLoading as a6,Ue as a7,hooks as a8,commonjsGlobal as a9,requiredRule as aA,TWITTER_HANDLE as aB,YOUTUBE_CHANNEL as aC,RSS as aD,GITHUB_REPOSITORY as aE,LINK as aF,TWITTER_SOURCE as aG,WEB_PAGE as aH,DOCUMENT as aI,getPriceData as aJ,isE2E as aK,sphinxBridge as aL,getLSat as aM,payLsat as aN,getNodeType as aO,getNodeSchemaTypes as aP,getNodeContent as aQ,approveRadarData as aR,deleteRadarData as aS,getRadarData as aT,putRadarData as aU,getEdgeTypes as aV,getEdges as aW,postEdgeType as aX,putNodeData as aY,postMergeTopics as aZ,getTopicsData as a_,commonjsRequire as aa,getSchemaAll as ab,useFilteredNodes as ac,_baseGetTag as ad,isObjectLike_1 as ae,isObject$7 as af,isFunction$3 as ag,_Set as ah,_Symbol as ai,isArguments_1 as aj,isArray_1 as ak,_arrayPush as al,_baseUnary as am,_defineProperty as an,eq_1 as ao,isArrayLike_1 as ap,_isIndex as aq,isObject_1 as ar,_root as as,_baseAssignValue as at,keys_1 as au,getFullTranscript as av,getAugmentedNamespace as aw,useHasAiChats as ax,postAboutData as ay,NODE_ADD_ERROR as az,_extends as b,css as b0,changeNodeType as b1,resolveBreakpointValues as b2,handleBreakpoints as b3,updateEdgeType as b4,postBluePrintType as b5,deleteEdgeType as b6,cloneDeep_1 as b7,editNodeSchemaUpdate as b8,createRoot as b9,useThemeProps$1 as bA,createUnarySpacing as bB,mergeBreakpointsInOrder as bC,getValue as bD,useTheme$3 as bE,react as ba,GRAPH_GROUND_COLOR as bb,GRAPH_LIGHT_INTENSITY as bc,GRAPH_FOG_COLOR as bd,_getPrototype as be,_MapCache as bf,_Uint8Array as bg,_getAllKeys as bh,_Stack as bi,_getTag as bj,isBufferExports as bk,isTypedArray_1 as bl,isLength_1 as bm,request as bn,buffer$2 as bo,sphinx$1 as bp,Global as bq,useTheme$2 as br,defaultTheme$1 as bs,THEME_ID as bt,formatMuiErrorMessage as bu,deepmerge as bv,defaultSxConfig$1 as bw,isPlainObject as bx,createStyled as by,createTheme$1 as bz,generateUtilityClass as c,generateUtilityClasses as d,alpha as e,clsx$1 as f,getDefaultExportFromCjs as g,composeClasses as h,capitalize as i,jsxRuntimeExports as j,keyframes as k,reactDomExports as l,useTheme as m,rootShouldForwardProp as n,resolveProps as o,create as p,useDataStore as q,reactExports as r,styled$1 as s,styled$3 as t,useThemeProps as u,colors as v,clsx as w,devtools as x,useAppStore as y,useUserStore as z}; +`,LazyApp=reactExports.lazy(()=>__vitePreload(()=>import("./index-c59af388.js").then(a=>a.bd),["assets/index-c59af388.js","assets/index-b60658ac.css"]).then(({App:a})=>({default:a}))),AppContainer=()=>{const a=jsxRuntimeExports.jsx(LazyApp,{});return jsxRuntimeExports.jsxs(AppProviders,{children:[jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:jsxRuntimeExports.jsx(AuthGuard,{children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{element:a,path:"/"}),jsxRuntimeExports.jsx(Route,{element:a,path:"/search"}),jsxRuntimeExports.jsx(Route,{element:a,path:"*"})]})})}),jsxRuntimeExports.jsx(E2ETests,{})]})},index="",root=client$1.createRoot(document.getElementById("root"));root.render(isE2E?jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(AppContainer,{})}):jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(AppContainer,{})})}));reportWebVitals();overrideConsole();export{$2AODx$react as $,useSchemaStore as A,__vitePreload as B,lottie as C,getTotalProcessing as D,getStats as E,Flex as F,formatStatsResponse as G,lodashExports as H,media as I,useAiSummaryStore as J,useNavigate as K,LinearProgress$1 as L,useSearchParams as M,useFeatureFlagStore as N,isDevelopment as O,updateBudget as P,isSphinx as Q,React as R,SocketContext as S,Text as T,useNodeTypes as U,NODE_RELATIVE_HIGHLIGHT_COLORS as V,We as W,fetchNodeEdges as X,addToGlobalForE2e as Y,api$1 as Z,_objectWithoutPropertiesLoose as _,ReactDOM as a,deleteNode as a$,distExports$1 as a0,executeIfProd as a1,lighten as a2,darken as a3,slotShouldForwardProp as a4,Ce as a5,useHasAiChatsResponseLoading as a6,Ue as a7,hooks as a8,commonjsGlobal as a9,requiredRule as aA,TWITTER_HANDLE as aB,YOUTUBE_CHANNEL as aC,RSS as aD,GITHUB_REPOSITORY as aE,LINK as aF,TWITTER_SOURCE as aG,WEB_PAGE as aH,DOCUMENT as aI,getPriceData as aJ,isE2E as aK,sphinxBridge as aL,getLSat as aM,payLsat as aN,getNodeType as aO,getNodeSchemaTypes as aP,getNodeContent as aQ,approveRadarData as aR,deleteRadarData as aS,getRadarData as aT,putRadarData as aU,getEdgeTypes as aV,getEdges as aW,postEdgeType as aX,putNodeData as aY,postMergeTopics as aZ,getTopicsData as a_,commonjsRequire as aa,getSchemaAll as ab,useFilteredNodes as ac,_baseGetTag as ad,isObjectLike_1 as ae,isObject$7 as af,isFunction$3 as ag,_Set as ah,_Symbol as ai,isArguments_1 as aj,isArray_1 as ak,_arrayPush as al,_baseUnary as am,_defineProperty as an,eq_1 as ao,isArrayLike_1 as ap,_isIndex as aq,isObject_1 as ar,_root as as,_baseAssignValue as at,keys_1 as au,getFullTranscript as av,getAugmentedNamespace as aw,useHasAiChats as ax,postAboutData as ay,NODE_ADD_ERROR as az,_extends as b,css as b0,changeNodeType as b1,resolveBreakpointValues as b2,handleBreakpoints as b3,updateEdgeType as b4,postBluePrintType as b5,deleteEdgeType as b6,cloneDeep_1 as b7,editNodeSchemaUpdate as b8,createRoot as b9,useThemeProps$1 as bA,createUnarySpacing as bB,mergeBreakpointsInOrder as bC,getValue as bD,useTheme$3 as bE,react as ba,GRAPH_GROUND_COLOR as bb,GRAPH_LIGHT_INTENSITY as bc,GRAPH_FOG_COLOR as bd,_getPrototype as be,_MapCache as bf,_Uint8Array as bg,_getAllKeys as bh,_Stack as bi,_getTag as bj,isBufferExports as bk,isTypedArray_1 as bl,isLength_1 as bm,request as bn,buffer$2 as bo,sphinx$1 as bp,Global as bq,useTheme$2 as br,defaultTheme$1 as bs,THEME_ID as bt,formatMuiErrorMessage as bu,deepmerge as bv,defaultSxConfig$1 as bw,isPlainObject as bx,createStyled as by,createTheme$1 as bz,generateUtilityClass as c,generateUtilityClasses as d,alpha as e,clsx$1 as f,getDefaultExportFromCjs as g,composeClasses as h,capitalize as i,jsxRuntimeExports as j,keyframes as k,reactDomExports as l,useTheme as m,rootShouldForwardProp as n,resolveProps as o,create as p,useDataStore as q,reactExports as r,styled$1 as s,styled$3 as t,useThemeProps as u,colors as v,clsx as w,devtools as x,useAppStore as y,useUserStore as z}; diff --git a/build/assets/index-4cad102d.js b/build/assets/index-bd90392c.js similarity index 99% rename from build/assets/index-4cad102d.js rename to build/assets/index-bd90392c.js index dc646134d..327776d2a 100644 --- a/build/assets/index-4cad102d.js +++ b/build/assets/index-bd90392c.js @@ -1,4 +1,4 @@ -import{Z as rI,a0 as qa,H as rx,a1 as B$,r as F,b as ge,j as y,d as Ey,c as wy,s as Qn,n as U$,i as dn,e as xo,u as _y,_ as _u,f as Kn,h as Ty,m as Tu,a2 as z$,a3 as G$,a4 as aI,t as H,v as j,a5 as iI,K as Au,F as q,q as Mn,z as ds,a6 as oI,T as vt,a7 as q$,w as lr,y as Pt,A as sI,a8 as _i,a9 as At,aa as H$,g as St,J as lI,N as uI,ab as W$,ac as cI,ad as dI,ae as pI,af as Ti,ag as Fe,R as Y,ah as V$,ai as Y$,aj as K$,ak as ku,al as X$,am as Z$,an as Q$,ao as J$,ap as fI,aq as ej,ar as Ou,as as tj,at as nj,au as rj,av as ax,C as aj,B as bn,aw as ij,ax as oj}from"./index-69dca385.js";import{w as wa,x as hI,y as Al,z as sj,G as bl,J as yl,K as Vc,L as gI,Q as lj,R as uj,U as cj,V as ix,W as vl,X as zr,Y as ox,Z as Hs,$ as Ay,a0 as dj,a1 as pj,a2 as mI,a3 as fj,r as ky,a4 as bI,i as Jn,T as Ai,a5 as Pr,a6 as yI,a7 as hj,a8 as ps,a9 as gj,aa as Oy,ab as Iu,ac as Iy,B as qt,ad as mj,ae as vI,af as SI,ag as bj,t as yj,ah as xI,ai as EI,aj as vj,ak as Sj,u as Vm,al as Ru,am as xj,an as Ej,ao as wj,ap as _j,aq as Ry,ar as Tj,as as Aj,at as kj,P as Re,e as Kt,au as wI,av as Oj,aw as _I,ax as Ij,ay as Rj,az as Cu,aA as Cj,aB as Nj,aC as Dj,aD as Lj,aE as Mj,f as Pj,aF as $j,aG as TI,aH as jj}from"./index-94c3c981.js";import{c as Fj,a as Yc,C as Nu}from"./ClipLoader-e049ef5e.js";import{S as AI}from"./Skeleton-224a4953.js";import{u as kI,P as Cy,a as Bj,F as Uj}from"./Stack-57ab9e76.js";import{S as zj,F as sx,i as fs,g as Dn,t as Gj,_ as OI,a as qj,b as Hj,c as Ta,d as Ny,e as Wj,f as Vj,h as Yj,j as hs,m as Kj,k as Xj,l as Zj,n as II,o as Qj,p as Jj}from"./map-85d405d6.js";import{c as Dy}from"./createSvgIcon-7c6eee06.js";import{B as eF}from"./index-23519643.js";import{u as RI}from"./index-f0d2a829.js";import{b as tF,a as nF,c as rF,d as aF}from"./index.esm-86c83cdb.js";const lx="023d8eb306f0027b902fbdc81d33b49b6558b3434d374626f8c324979c92d47c21",iF=async e=>{let t=await qa.enable(!0);if(t||console.warn("Sphinx enable failed, means no pubkey and no budget (including budget of 0)"),t=await qa.keysend(lx,e),!(t!=null&&t.success)){if(t=await qa.topup(),t||(t=await qa.authorize()),!(t!=null&&t.budget)||(t==null?void 0:t.budget){const n=await iF(t),r={amount:t,refid:e};return await rI.post("/boost",JSON.stringify(r)),n},sF=e=>{const[t,n]=e.split("-")||["",""];return parseInt(n,10)!==0?`${t} - ${n}`:t},CI=(e,t)=>{if(!t)return null;const n=e.filter(i=>i.show_title&&i.link&&i.show_title===t.show_title&&i.episode_title===t.episode_title),r=rx.groupBy(n,i=>i.timestamp),a=rx.values(r).reduce((i,o)=>(o[0]&&i.push(o[0]),i),[]);return a.sort((i,o)=>{var p,f;const[s]=((p=i.timestamp)==null?void 0:p.split("-"))||[""],[l]=((f=o.timestamp)==null?void 0:f.split("-"))||[""],u=wa(s),c=wa(l);return u-c}),a},lF=async e=>{await B$(async()=>{try{await qa.saveGraphData({metaData:{date:Math.floor(new Date().getTime()/1e3),...e},type:"second_brain_consumed_content"})}catch(t){console.warn(t)}})},uF=e=>{const t=/((http|https):\/\/[^\s]+)/g,n=/@(\w+)/g;let r=e.replace(/\\/g,"");return r=r.replace(/'/g,"’"),r=r.replace(/\n/g,"
"),r=r.replace(t,'$1'),r=r.replace(n,'@$1'),r},cF={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},dF=cF;function pF(e,t,n=(r,a)=>r===a){return e.length===t.length&&e.every((r,a)=>n(r,t[a]))}const fF=2;function NI(e,t){return e-t}function Ui(e,t,n){return e==null?t:Math.min(Math.max(t,e),n)}function ux(e,t){var n;const{index:r}=(n=e.reduce((a,i,o)=>{const s=Math.abs(t-i);return a===null||s({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},yF=e=>e;let Ks;function Kc(){return Ks===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ks=CSS.supports("touch-action","none"):Ks=!0),Ks}function vF(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:a=!1,isRtl:i=!1,marks:o=!1,max:s=100,min:l=0,name:u,onChange:c,onChangeCommitted:p,orientation:f="horizontal",rootRef:h,scale:m=yF,step:b=1,tabIndex:v,value:T}=e,_=F.useRef(),[w,A]=F.useState(-1),[x,S]=F.useState(-1),[O,R]=F.useState(!1),C=F.useRef(0),[$,N]=kI({controlled:T,default:n??l,name:"Slider"}),P=c&&((B,Q,oe)=>{const pe=B.nativeEvent||B,ue=new pe.constructor(pe.type,pe);Object.defineProperty(ue,"target",{writable:!0,value:{value:Q,name:u}}),c(ue,Q,oe)}),z=Array.isArray($);let V=z?$.slice().sort(NI):[$];V=V.map(B=>Ui(B,l,s));const G=o===!0&&b!==null?[...Array(Math.floor((s-l)/b)+1)].map((B,Q)=>({value:l+b*Q})):o||[],K=G.map(B=>B.value),{isFocusVisibleRef:X,onBlur:W,onFocus:Z,ref:D}=hI(),[ie,ne]=F.useState(-1),M=F.useRef(),ye=Al(D,M),re=Al(h,ye),Se=B=>Q=>{var oe;const pe=Number(Q.currentTarget.getAttribute("data-index"));Z(Q),X.current===!0&&ne(pe),S(pe),B==null||(oe=B.onFocus)==null||oe.call(B,Q)},je=B=>Q=>{var oe;W(Q),X.current===!1&&ne(-1),S(-1),B==null||(oe=B.onBlur)==null||oe.call(B,Q)};sj(()=>{if(r&&M.current.contains(document.activeElement)){var B;(B=document.activeElement)==null||B.blur()}},[r]),r&&w!==-1&&A(-1),r&&ie!==-1&&ne(-1);const we=B=>Q=>{var oe;(oe=B.onChange)==null||oe.call(B,Q);const pe=Number(Q.currentTarget.getAttribute("data-index")),ue=V[pe],ke=K.indexOf(ue);let Ae=Q.target.valueAsNumber;if(G&&b==null){const Ie=K[K.length-1];Ae>Ie?Ae=Ie:Ae{const{current:oe}=M,{width:pe,height:ue,bottom:ke,left:Ae}=oe.getBoundingClientRect();let Ie;de.indexOf("vertical")===0?Ie=(ke-B.y)/ue:Ie=(B.x-Ae)/pe,de.indexOf("-reverse")!==-1&&(Ie=1-Ie);let We;if(We=hF(Ie,l,s),b)We=mF(We,b,l);else{const it=ux(K,We);We=K[it]}We=Ui(We,l,s);let xt=0;if(z){Q?xt=ae.current:xt=ux(V,We),a&&(We=Ui(We,V[xt-1]||-1/0,V[xt+1]||1/0));const it=We;We=cx({values:V,newValue:We,index:xt}),a&&Q||(xt=We.indexOf(it),ae.current=xt)}return{newValue:We,activeIndex:xt}},ee=bl(B=>{const Q=Ws(B,_);if(!Q)return;if(C.current+=1,B.type==="mousemove"&&B.buttons===0){_e(B);return}const{newValue:oe,activeIndex:pe}=ce({finger:Q,move:!0});Vs({sliderRef:M,activeIndex:pe,setActive:A}),N(oe),!O&&C.current>fF&&R(!0),P&&!Ys(oe,$)&&P(B,oe,pe)}),_e=bl(B=>{const Q=Ws(B,_);if(R(!1),!Q)return;const{newValue:oe}=ce({finger:Q,move:!0});A(-1),B.type==="touchend"&&S(-1),p&&p(B,oe),_.current=void 0,ve()}),me=bl(B=>{if(r)return;Kc()||B.preventDefault();const Q=B.changedTouches[0];Q!=null&&(_.current=Q.identifier);const oe=Ws(B,_);if(oe!==!1){const{newValue:ue,activeIndex:ke}=ce({finger:oe});Vs({sliderRef:M,activeIndex:ke,setActive:A}),N(ue),P&&!Ys(ue,$)&&P(B,ue,ke)}C.current=0;const pe=yl(M.current);pe.addEventListener("touchmove",ee),pe.addEventListener("touchend",_e)}),ve=F.useCallback(()=>{const B=yl(M.current);B.removeEventListener("mousemove",ee),B.removeEventListener("mouseup",_e),B.removeEventListener("touchmove",ee),B.removeEventListener("touchend",_e)},[_e,ee]);F.useEffect(()=>{const{current:B}=M;return B.addEventListener("touchstart",me,{passive:Kc()}),()=>{B.removeEventListener("touchstart",me,{passive:Kc()}),ve()}},[ve,me]),F.useEffect(()=>{r&&ve()},[r,ve]);const Ue=B=>Q=>{var oe;if((oe=B.onMouseDown)==null||oe.call(B,Q),r||Q.defaultPrevented||Q.button!==0)return;Q.preventDefault();const pe=Ws(Q,_);if(pe!==!1){const{newValue:ke,activeIndex:Ae}=ce({finger:pe});Vs({sliderRef:M,activeIndex:Ae,setActive:A}),N(ke),P&&!Ys(ke,$)&&P(Q,ke,Ae)}C.current=0;const ue=yl(M.current);ue.addEventListener("mousemove",ee),ue.addEventListener("mouseup",_e)},at=kl(z?V[0]:l,l,s),Je=kl(V[V.length-1],l,s)-at,Ht=(B={})=>{const Q=Vc(B),oe={onMouseDown:Ue(Q||{})},pe=ge({},Q,oe);return ge({},B,{ref:re},pe)},ze=B=>Q=>{var oe;(oe=B.onMouseOver)==null||oe.call(B,Q);const pe=Number(Q.currentTarget.getAttribute("data-index"));S(pe)},Ge=B=>Q=>{var oe;(oe=B.onMouseLeave)==null||oe.call(B,Q),S(-1)};return{active:w,axis:de,axisProps:bF,dragging:O,focusedThumbIndex:ie,getHiddenInputProps:(B={})=>{var Q;const oe=Vc(B),pe={onChange:we(oe||{}),onFocus:Se(oe||{}),onBlur:je(oe||{})},ue=ge({},oe,pe);return ge({tabIndex:v,"aria-labelledby":t,"aria-orientation":f,"aria-valuemax":m(s),"aria-valuemin":m(l),name:u,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":(Q=e.step)!=null?Q:void 0,disabled:r},B,ue,{style:ge({},dF,{direction:i?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:Ht,getThumbProps:(B={})=>{const Q=Vc(B),oe={onMouseOver:ze(Q||{}),onMouseLeave:Ge(Q||{})};return ge({},B,Q,oe)},marks:G,open:x,range:z,rootRef:re,trackLeap:Je,trackOffset:at,values:V,getThumbStyle:B=>({pointerEvents:w!==-1&&w!==B?"none":void 0})}}const SF=Dy(y.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),xF=Dy(y.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),EF=Dy(y.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function wF(e){return wy("MuiCheckbox",e)}const _F=Ey("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Xc=_F,TF=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],AF=e=>{const{classes:t,indeterminate:n,color:r,size:a}=e,i={root:["root",n&&"indeterminate",`color${dn(r)}`,`size${dn(a)}`]},o=Ty(i,wF,t);return ge({},t,o)},kF=Qn(zj,{shouldForwardProp:e=>U$(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${dn(n.size)}`],n.color!=="default"&&t[`color${dn(n.color)}`]]}})(({theme:e,ownerState:t})=>ge({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:xo(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${Xc.checked}, &.${Xc.indeterminate}`]:{color:(e.vars||e).palette[t.color].main},[`&.${Xc.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),OF=y.jsx(xF,{}),IF=y.jsx(SF,{}),RF=y.jsx(EF,{}),CF=F.forwardRef(function(t,n){var r,a;const i=_y({props:t,name:"MuiCheckbox"}),{checkedIcon:o=OF,color:s="primary",icon:l=IF,indeterminate:u=!1,indeterminateIcon:c=RF,inputProps:p,size:f="medium",className:h}=i,m=_u(i,TF),b=u?c:l,v=u?c:o,T=ge({},i,{color:s,indeterminate:u,size:f}),_=AF(T);return y.jsx(kF,ge({type:"checkbox",inputProps:ge({"data-indeterminate":u},p),icon:F.cloneElement(b,{fontSize:(r=b.props.fontSize)!=null?r:f}),checkedIcon:F.cloneElement(v,{fontSize:(a=v.props.fontSize)!=null?a:f}),ownerState:T,ref:n,className:Kn(_.root,h)},m,{classes:_}))}),NF=CF,DF=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function LF(e,t,n){const r=t.getBoundingClientRect(),a=n&&n.getBoundingClientRect(),i=gI(t);let o;if(t.fakeTransform)o=t.fakeTransform;else{const u=i.getComputedStyle(t);o=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("transform")}let s=0,l=0;if(o&&o!=="none"&&typeof o=="string"){const u=o.split("(")[1].split(")")[0].split(",");s=parseInt(u[4],10),l=parseInt(u[5],10)}return e==="left"?a?`translateX(${a.right+s-r.left}px)`:`translateX(${i.innerWidth+s-r.left}px)`:e==="right"?a?`translateX(-${r.right-a.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:e==="up"?a?`translateY(${a.bottom+l-r.top}px)`:`translateY(${i.innerHeight+l-r.top}px)`:a?`translateY(-${r.top-a.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function MF(e){return typeof e=="function"?e():e}function Xs(e,t,n){const r=MF(n),a=LF(e,t,r);a&&(t.style.webkitTransform=a,t.style.transform=a)}const PF=F.forwardRef(function(t,n){const r=Tu(),a={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:l,container:u,direction:c="down",easing:p=a,in:f,onEnter:h,onEntered:m,onEntering:b,onExit:v,onExited:T,onExiting:_,style:w,timeout:A=i,TransitionComponent:x=lj}=t,S=_u(t,DF),O=F.useRef(null),R=Al(l.ref,O,n),C=W=>Z=>{W&&(Z===void 0?W(O.current):W(O.current,Z))},$=C((W,Z)=>{Xs(c,W,u),cj(W),h&&h(W,Z)}),N=C((W,Z)=>{const D=ix({timeout:A,style:w,easing:p},{mode:"enter"});W.style.webkitTransition=r.transitions.create("-webkit-transform",ge({},D)),W.style.transition=r.transitions.create("transform",ge({},D)),W.style.webkitTransform="none",W.style.transform="none",b&&b(W,Z)}),P=C(m),z=C(_),V=C(W=>{const Z=ix({timeout:A,style:w,easing:p},{mode:"exit"});W.style.webkitTransition=r.transitions.create("-webkit-transform",Z),W.style.transition=r.transitions.create("transform",Z),Xs(c,W,u),v&&v(W)}),G=C(W=>{W.style.webkitTransition="",W.style.transition="",T&&T(W)}),K=W=>{o&&o(O.current,W)},X=F.useCallback(()=>{O.current&&Xs(c,O.current,u)},[c,u]);return F.useEffect(()=>{if(f||c==="down"||c==="right")return;const W=uj(()=>{O.current&&Xs(c,O.current,u)}),Z=gI(O.current);return Z.addEventListener("resize",W),()=>{W.clear(),Z.removeEventListener("resize",W)}},[c,f,u]),F.useEffect(()=>{f||X()},[f,X]),y.jsx(x,ge({nodeRef:O,onEnter:$,onEntered:P,onEntering:N,onExit:V,onExited:G,onExiting:z,addEndListener:K,appear:s,in:f,timeout:A},S,{children:(W,Z)=>F.cloneElement(l,ge({ref:R,style:ge({visibility:W==="exited"&&!f?"hidden":void 0},w,l.props.style)},Z))}))}),ni=PF,$F=e=>!e||!vl(e),jF=$F;function FF(e){return wy("MuiSlider",e)}const BF=Ey("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Xn=BF,UF=e=>{const{open:t}=e;return{offset:Kn(t&&Xn.valueLabelOpen),circle:Xn.valueLabelCircle,label:Xn.valueLabelLabel}};function zF(e){const{children:t,className:n,value:r}=e,a=UF(e);return t?F.cloneElement(t,{className:Kn(t.props.className)},y.jsxs(F.Fragment,{children:[t.props.children,y.jsx("span",{className:Kn(a.offset,n),"aria-hidden":!0,children:y.jsx("span",{className:a.circle,children:y.jsx("span",{className:a.label,children:r})})})]})):null}const GF=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function dx(e){return e}const qF=Qn("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${dn(n.color)}`],n.size!=="medium"&&t[`size${dn(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(({theme:e,ownerState:t})=>ge({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(e.vars||e).palette[t.color].main,WebkitTapHighlightColor:"transparent"},t.orientation==="horizontal"&&ge({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},t.size==="small"&&{height:2},t.marked&&{marginBottom:20}),t.orientation==="vertical"&&ge({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},t.size==="small"&&{width:2},t.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${Xn.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Xn.dragging}`]:{[`& .${Xn.thumb}, & .${Xn.track}`]:{transition:"none"}}})),HF=Qn("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})(({ownerState:e})=>ge({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},e.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},e.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},e.track==="inverted"&&{opacity:1})),WF=Qn("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?z$(e.palette[t.color].main,.62):G$(e.palette[t.color].main,.5);return ge({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{border:"none"},t.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},t.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},t.track===!1&&{display:"none"},t.track==="inverted"&&{backgroundColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n,borderColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n})}),VF=Qn("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${dn(n.color)}`],n.size!=="medium"&&t[`thumbSize${dn(n.size)}`]]}})(({theme:e,ownerState:t})=>ge({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{width:12,height:12},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&:before":ge({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},t.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${Xn.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:xo(e.palette[t.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Xn.active}`]:{boxShadow:`0px 0px 0px 14px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:xo(e.palette[t.color].main,.16)}`},[`&.${Xn.disabled}`]:{"&:hover":{boxShadow:"none"}}})),YF=Qn(zF,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e,ownerState:t})=>ge({[`&.${Xn.valueLabelOpen}`]:{transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},e.typography.body2,{fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},t.orientation==="horizontal"&&{top:"-10px",transformOrigin:"bottom center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"}},t.orientation==="vertical"&&{right:t.size==="small"?"20px":"30px",top:"50%",transformOrigin:"right center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"}},t.size==="small"&&{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),KF=Qn("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>aI(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(({theme:e,ownerState:t,markActive:n})=>ge({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},n&&{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8})),XF=Qn("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>aI(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(({theme:e,ownerState:t,markLabelActive:n})=>ge({},e.typography.body2,{color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},t.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},t.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},n&&{color:(e.vars||e).palette.text.primary})),ZF=e=>{const{disabled:t,dragging:n,marked:r,orientation:a,track:i,classes:o,color:s,size:l}=e,u={root:["root",t&&"disabled",n&&"dragging",r&&"marked",a==="vertical"&&"vertical",i==="inverted"&&"trackInverted",i===!1&&"trackFalse",s&&`color${dn(s)}`,l&&`size${dn(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${dn(l)}`,s&&`thumbColor${dn(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Ty(u,FF,o)},QF=({children:e})=>e,JF=F.forwardRef(function(t,n){var r,a,i,o,s,l,u,c,p,f,h,m,b,v,T,_,w,A,x,S,O,R,C,$;const N=_y({props:t,name:"MuiSlider"}),z=Tu().direction==="rtl",{"aria-label":V,"aria-valuetext":G,"aria-labelledby":K,component:X="span",components:W={},componentsProps:Z={},color:D="primary",classes:ie,className:ne,disableSwap:M=!1,disabled:ye=!1,getAriaLabel:re,getAriaValueText:Se,marks:je=!1,max:we=100,min:ae=0,orientation:de="horizontal",size:ce="medium",step:ee=1,scale:_e=dx,slotProps:me,slots:ve,track:Ue="normal",valueLabelDisplay:at="off",valueLabelFormat:Je=dx}=N,Ht=_u(N,GF),ze=ge({},N,{isRtl:z,max:we,min:ae,classes:ie,disabled:ye,disableSwap:M,orientation:de,marks:je,color:D,size:ce,step:ee,scale:_e,track:Ue,valueLabelDisplay:at,valueLabelFormat:Je}),{axisProps:Ge,getRootProps:Xe,getHiddenInputProps:Ft,getThumbProps:Wt,open:B,active:Q,axis:oe,focusedThumbIndex:pe,range:ue,dragging:ke,marks:Ae,values:Ie,trackOffset:We,trackLeap:xt,getThumbStyle:it}=vF(ge({},ze,{rootRef:n}));ze.marked=Ae.length>0&&Ae.some(Ce=>Ce.label),ze.dragging=ke,ze.focusedThumbIndex=pe;const Le=ZF(ze),It=(r=(a=ve==null?void 0:ve.root)!=null?a:W.Root)!=null?r:qF,gr=(i=(o=ve==null?void 0:ve.rail)!=null?o:W.Rail)!=null?i:HF,mr=(s=(l=ve==null?void 0:ve.track)!=null?l:W.Track)!=null?s:WF,Ze=(u=(c=ve==null?void 0:ve.thumb)!=null?c:W.Thumb)!=null?u:VF,ia=(p=(f=ve==null?void 0:ve.valueLabel)!=null?f:W.ValueLabel)!=null?p:YF,br=(h=(m=ve==null?void 0:ve.mark)!=null?m:W.Mark)!=null?h:KF,Fn=(b=(v=ve==null?void 0:ve.markLabel)!=null?v:W.MarkLabel)!=null?b:XF,yr=(T=(_=ve==null?void 0:ve.input)!=null?_:W.Input)!=null?T:"input",Bn=(w=me==null?void 0:me.root)!=null?w:Z.root,Un=(A=me==null?void 0:me.rail)!=null?A:Z.rail,zn=(x=me==null?void 0:me.track)!=null?x:Z.track,oa=(S=me==null?void 0:me.thumb)!=null?S:Z.thumb,tr=(O=me==null?void 0:me.valueLabel)!=null?O:Z.valueLabel,Li=(R=me==null?void 0:me.mark)!=null?R:Z.mark,Gn=(C=me==null?void 0:me.markLabel)!=null?C:Z.markLabel,jr=($=me==null?void 0:me.input)!=null?$:Z.input,he=zr({elementType:It,getSlotProps:Xe,externalSlotProps:Bn,externalForwardedProps:Ht,additionalProps:ge({},jF(It)&&{as:X}),ownerState:ge({},ze,Bn==null?void 0:Bn.ownerState),className:[Le.root,ne]}),sa=zr({elementType:gr,externalSlotProps:Un,ownerState:ze,className:Le.rail}),Zt=zr({elementType:mr,externalSlotProps:zn,additionalProps:{style:ge({},Ge[oe].offset(We),Ge[oe].leap(xt))},ownerState:ge({},ze,zn==null?void 0:zn.ownerState),className:Le.track}),mt=zr({elementType:Ze,getSlotProps:Wt,externalSlotProps:oa,ownerState:ge({},ze,oa==null?void 0:oa.ownerState),className:Le.thumb}),la=zr({elementType:ia,externalSlotProps:tr,ownerState:ge({},ze,tr==null?void 0:tr.ownerState),className:Le.valueLabel}),Me=zr({elementType:br,externalSlotProps:Li,ownerState:ze,className:Le.mark}),gn=zr({elementType:Fn,externalSlotProps:Gn,ownerState:ze,className:Le.markLabel}),Na=zr({elementType:yr,getSlotProps:Ft,externalSlotProps:jr,ownerState:ze});return y.jsxs(It,ge({},he,{children:[y.jsx(gr,ge({},sa)),y.jsx(mr,ge({},Zt)),Ae.filter(Ce=>Ce.value>=ae&&Ce.value<=we).map((Ce,Qe)=>{const Bt=kl(Ce.value,ae,we),st=Ge[oe].offset(Bt);let bt;return Ue===!1?bt=Ie.indexOf(Ce.value)!==-1:bt=Ue==="normal"&&(ue?Ce.value>=Ie[0]&&Ce.value<=Ie[Ie.length-1]:Ce.value<=Ie[0])||Ue==="inverted"&&(ue?Ce.value<=Ie[0]||Ce.value>=Ie[Ie.length-1]:Ce.value>=Ie[0]),y.jsxs(F.Fragment,{children:[y.jsx(br,ge({"data-index":Qe},Me,!vl(br)&&{markActive:bt},{style:ge({},st,Me.style),className:Kn(Me.className,bt&&Le.markActive)})),Ce.label!=null?y.jsx(Fn,ge({"aria-hidden":!0,"data-index":Qe},gn,!vl(Fn)&&{markLabelActive:bt},{style:ge({},st,gn.style),className:Kn(Le.markLabel,gn.className,bt&&Le.markLabelActive),children:Ce.label})):null]},Qe)}),Ie.map((Ce,Qe)=>{const Bt=kl(Ce,ae,we),st=Ge[oe].offset(Bt),bt=at==="off"?QF:ia;return y.jsx(bt,ge({},!vl(bt)&&{valueLabelFormat:Je,valueLabelDisplay:at,value:typeof Je=="function"?Je(_e(Ce),Qe):Je,index:Qe,open:B===Qe||Q===Qe||at==="on",disabled:ye},la,{children:y.jsx(Ze,ge({"data-index":Qe},mt,{className:Kn(Le.thumb,mt.className,Q===Qe&&Le.active,pe===Qe&&Le.focusVisible),style:ge({},st,it(Qe),mt.style),children:y.jsx(yr,ge({"data-index":Qe,"aria-label":re?re(Qe):V,"aria-valuenow":_e(Ce),"aria-labelledby":K,"aria-valuetext":Se?Se(_e(Ce),Qe):G,value:Ie[Qe]},Na))}))}),Qe)})]}))}),Du=JF;function e2(e){return wy("MuiTooltip",e)}const t2=Ey("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Kr=t2,n2=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function r2(e){return Math.round(e*1e5)/1e5}const a2=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:a,placement:i}=e,o={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",a&&"touch",`tooltipPlacement${dn(i.split("-")[0])}`],arrow:["arrow"]};return Ty(o,e2,t)},i2=Qn(Cy,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(({theme:e,ownerState:t,open:n})=>ge({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Kr.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Kr.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Kr.arrow}`]:ge({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Kr.arrow}`]:ge({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),o2=Qn("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${dn(n.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>ge({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:xo(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${r2(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Kr.popper}[data-popper-placement*="left"] &`]:ge({transformOrigin:"right center"},t.isRtl?ge({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):ge({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Kr.popper}[data-popper-placement*="right"] &`]:ge({transformOrigin:"left center"},t.isRtl?ge({marginRight:"14px"},t.touch&&{marginRight:"24px"}):ge({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Kr.popper}[data-popper-placement*="top"] &`]:ge({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Kr.popper}[data-popper-placement*="bottom"] &`]:ge({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),s2=Qn("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:xo(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Zs=!1,Zc=null,zi={x:0,y:0};function Qs(e,t){return n=>{t&&t(n),e(n)}}const l2=F.forwardRef(function(t,n){var r,a,i,o,s,l,u,c,p,f,h,m,b,v,T,_,w,A,x;const S=_y({props:t,name:"MuiTooltip"}),{arrow:O=!1,children:R,components:C={},componentsProps:$={},describeChild:N=!1,disableFocusListener:P=!1,disableHoverListener:z=!1,disableInteractive:V=!1,disableTouchListener:G=!1,enterDelay:K=100,enterNextDelay:X=0,enterTouchDelay:W=700,followCursor:Z=!1,id:D,leaveDelay:ie=0,leaveTouchDelay:ne=1500,onClose:M,onOpen:ye,open:re,placement:Se="bottom",PopperComponent:je,PopperProps:we={},slotProps:ae={},slots:de={},title:ce,TransitionComponent:ee=ox,TransitionProps:_e}=S,me=_u(S,n2),ve=F.isValidElement(R)?R:y.jsx("span",{children:R}),Ue=Tu(),at=Ue.direction==="rtl",[Je,Ht]=F.useState(),[ze,Ge]=F.useState(null),Xe=F.useRef(!1),Ft=V||Z,Wt=F.useRef(),B=F.useRef(),Q=F.useRef(),oe=F.useRef(),[pe,ue]=kI({controlled:re,default:!1,name:"Tooltip",state:"open"});let ke=pe;const Ae=Bj(D),Ie=F.useRef(),We=F.useCallback(()=>{Ie.current!==void 0&&(document.body.style.WebkitUserSelect=Ie.current,Ie.current=void 0),clearTimeout(oe.current)},[]);F.useEffect(()=>()=>{clearTimeout(Wt.current),clearTimeout(B.current),clearTimeout(Q.current),We()},[We]);const xt=Pe=>{clearTimeout(Zc),Zs=!0,ue(!0),ye&&!ke&&ye(Pe)},it=bl(Pe=>{clearTimeout(Zc),Zc=setTimeout(()=>{Zs=!1},800+ie),ue(!1),M&&ke&&M(Pe),clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Xe.current=!1},Ue.transitions.duration.shortest)}),Le=Pe=>{Xe.current&&Pe.type!=="touchstart"||(Je&&Je.removeAttribute("title"),clearTimeout(B.current),clearTimeout(Q.current),K||Zs&&X?B.current=setTimeout(()=>{xt(Pe)},Zs?X:K):xt(Pe))},It=Pe=>{clearTimeout(B.current),clearTimeout(Q.current),Q.current=setTimeout(()=>{it(Pe)},ie)},{isFocusVisibleRef:gr,onBlur:mr,onFocus:Ze,ref:ia}=hI(),[,br]=F.useState(!1),Fn=Pe=>{mr(Pe),gr.current===!1&&(br(!1),It(Pe))},yr=Pe=>{Je||Ht(Pe.currentTarget),Ze(Pe),gr.current===!0&&(br(!0),Le(Pe))},Bn=Pe=>{Xe.current=!0;const Qt=ve.props;Qt.onTouchStart&&Qt.onTouchStart(Pe)},Un=Le,zn=It,oa=Pe=>{Bn(Pe),clearTimeout(Q.current),clearTimeout(Wt.current),We(),Ie.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",oe.current=setTimeout(()=>{document.body.style.WebkitUserSelect=Ie.current,Le(Pe)},W)},tr=Pe=>{ve.props.onTouchEnd&&ve.props.onTouchEnd(Pe),We(),clearTimeout(Q.current),Q.current=setTimeout(()=>{it(Pe)},ne)};F.useEffect(()=>{if(!ke)return;function Pe(Qt){(Qt.key==="Escape"||Qt.key==="Esc")&&it(Qt)}return document.addEventListener("keydown",Pe),()=>{document.removeEventListener("keydown",Pe)}},[it,ke]);const Li=Al(ve.ref,ia,Ht,n);!ce&&ce!==0&&(ke=!1);const Gn=F.useRef(),jr=Pe=>{const Qt=ve.props;Qt.onMouseMove&&Qt.onMouseMove(Pe),zi={x:Pe.clientX,y:Pe.clientY},Gn.current&&Gn.current.update()},he={},sa=typeof ce=="string";N?(he.title=!ke&&sa&&!z?ce:null,he["aria-describedby"]=ke?Ae:null):(he["aria-label"]=sa?ce:null,he["aria-labelledby"]=ke&&!sa?Ae:null);const Zt=ge({},he,me,ve.props,{className:Kn(me.className,ve.props.className),onTouchStart:Bn,ref:Li},Z?{onMouseMove:jr}:{}),mt={};G||(Zt.onTouchStart=oa,Zt.onTouchEnd=tr),z||(Zt.onMouseOver=Qs(Un,Zt.onMouseOver),Zt.onMouseLeave=Qs(zn,Zt.onMouseLeave),Ft||(mt.onMouseOver=Un,mt.onMouseLeave=zn)),P||(Zt.onFocus=Qs(yr,Zt.onFocus),Zt.onBlur=Qs(Fn,Zt.onBlur),Ft||(mt.onFocus=yr,mt.onBlur=Fn));const la=F.useMemo(()=>{var Pe;let Qt=[{name:"arrow",enabled:!!ze,options:{element:ze,padding:4}}];return(Pe=we.popperOptions)!=null&&Pe.modifiers&&(Qt=Qt.concat(we.popperOptions.modifiers)),ge({},we.popperOptions,{modifiers:Qt})},[ze,we]),Me=ge({},S,{isRtl:at,arrow:O,disableInteractive:Ft,placement:Se,PopperComponentProp:je,touch:Xe.current}),gn=a2(Me),Na=(r=(a=de.popper)!=null?a:C.Popper)!=null?r:i2,Ce=(i=(o=(s=de.transition)!=null?s:C.Transition)!=null?o:ee)!=null?i:ox,Qe=(l=(u=de.tooltip)!=null?u:C.Tooltip)!=null?l:o2,Bt=(c=(p=de.arrow)!=null?p:C.Arrow)!=null?c:s2,st=Hs(Na,ge({},we,(f=ae.popper)!=null?f:$.popper,{className:Kn(gn.popper,we==null?void 0:we.className,(h=(m=ae.popper)!=null?m:$.popper)==null?void 0:h.className)}),Me),bt=Hs(Ce,ge({},_e,(b=ae.transition)!=null?b:$.transition),Me),qn=Hs(Qe,ge({},(v=ae.tooltip)!=null?v:$.tooltip,{className:Kn(gn.tooltip,(T=(_=ae.tooltip)!=null?_:$.tooltip)==null?void 0:T.className)}),Me),vr=Hs(Bt,ge({},(w=ae.arrow)!=null?w:$.arrow,{className:Kn(gn.arrow,(A=(x=ae.arrow)!=null?x:$.arrow)==null?void 0:A.className)}),Me);return y.jsxs(F.Fragment,{children:[F.cloneElement(ve,Zt),y.jsx(Na,ge({as:je??Cy,placement:Se,anchorEl:Z?{getBoundingClientRect:()=>({top:zi.y,left:zi.x,right:zi.x,bottom:zi.y,width:0,height:0})}:Je,popperRef:Gn,open:Je?ke:!1,id:Ae,transition:!0},mt,st,{popperOptions:la,children:({TransitionProps:Pe})=>y.jsx(Ce,ge({timeout:Ue.transitions.duration.shorter},Pe,bt,{children:y.jsxs(Qe,ge({},qn,{children:[ce,O?y.jsx(Bt,ge({},vr,{ref:Ge})):null]}))}))}))]})}),u2=l2,c2=(e,t="down")=>{const n=Tu(),[r,a]=F.useState(!1),i=n.breakpoints[t](e).split("@media")[1].trim();return F.useEffect(()=>{const o=()=>{const{matches:s}=window.matchMedia(i);a(s)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[i]),r},d2=e=>e.filter(t=>t.tldr).length>=2&&e.some(t=>t.audio_EN);function p2(e){return e.tldr_topic??e.name}var Ol=globalThis&&globalThis.__assign||function(){return Ol=Object.assign||function(e){for(var t,n=1,r=arguments.length;n({autoCorrect:"off",autoComplete:"off"}))` +import{Z as rI,a0 as qa,H as rx,a1 as B$,r as F,b as ge,j as y,d as Ey,c as wy,s as Qn,n as U$,i as dn,e as xo,u as _y,_ as _u,f as Kn,h as Ty,m as Tu,a2 as z$,a3 as G$,a4 as aI,t as H,v as j,a5 as iI,K as Au,F as q,q as Mn,z as ds,a6 as oI,T as vt,a7 as q$,w as lr,y as Pt,A as sI,a8 as _i,a9 as At,aa as H$,g as St,J as lI,N as uI,ab as W$,ac as cI,ad as dI,ae as pI,af as Ti,ag as Fe,R as Y,ah as V$,ai as Y$,aj as K$,ak as ku,al as X$,am as Z$,an as Q$,ao as J$,ap as fI,aq as ej,ar as Ou,as as tj,at as nj,au as rj,av as ax,C as aj,B as bn,aw as ij,ax as oj}from"./index-b856be88.js";import{w as wa,x as hI,y as Al,z as sj,G as bl,J as yl,K as Vc,L as gI,Q as lj,R as uj,U as cj,V as ix,W as vl,X as zr,Y as ox,Z as Hs,$ as Ay,a0 as dj,a1 as pj,a2 as mI,a3 as fj,r as ky,a4 as bI,i as Jn,T as Ai,a5 as Pr,a6 as yI,a7 as hj,a8 as ps,a9 as gj,aa as Oy,ab as Iu,ac as Iy,B as qt,ad as mj,ae as vI,af as SI,ag as bj,t as yj,ah as xI,ai as EI,aj as vj,ak as Sj,u as Vm,al as Ru,am as xj,an as Ej,ao as wj,ap as _j,aq as Ry,ar as Tj,as as Aj,at as kj,P as Re,e as Kt,au as wI,av as Oj,aw as _I,ax as Ij,ay as Rj,az as Cu,aA as Cj,aB as Nj,aC as Dj,aD as Lj,aE as Mj,f as Pj,aF as $j,aG as TI,aH as jj}from"./index-c59af388.js";import{c as Fj,a as Yc,C as Nu}from"./ClipLoader-83661b90.js";import{S as AI}from"./Skeleton-bddda4d0.js";import{u as kI,P as Cy,a as Bj,F as Uj}from"./Stack-e0f879a7.js";import{S as zj,F as sx,i as fs,g as Dn,t as Gj,_ as OI,a as qj,b as Hj,c as Ta,d as Ny,e as Wj,f as Vj,h as Yj,j as hs,m as Kj,k as Xj,l as Zj,n as II,o as Qj,p as Jj}from"./map-e077fe83.js";import{c as Dy}from"./createSvgIcon-ed559792.js";import{B as eF}from"./index-8264b104.js";import{u as RI}from"./index-bf6ce8a9.js";import{b as tF,a as nF,c as rF,d as aF}from"./index.esm-c2a09dd4.js";const lx="023d8eb306f0027b902fbdc81d33b49b6558b3434d374626f8c324979c92d47c21",iF=async e=>{let t=await qa.enable(!0);if(t||console.warn("Sphinx enable failed, means no pubkey and no budget (including budget of 0)"),t=await qa.keysend(lx,e),!(t!=null&&t.success)){if(t=await qa.topup(),t||(t=await qa.authorize()),!(t!=null&&t.budget)||(t==null?void 0:t.budget){const n=await iF(t),r={amount:t,refid:e};return await rI.post("/boost",JSON.stringify(r)),n},sF=e=>{const[t,n]=e.split("-")||["",""];return parseInt(n,10)!==0?`${t} - ${n}`:t},CI=(e,t)=>{if(!t)return null;const n=e.filter(i=>i.show_title&&i.link&&i.show_title===t.show_title&&i.episode_title===t.episode_title),r=rx.groupBy(n,i=>i.timestamp),a=rx.values(r).reduce((i,o)=>(o[0]&&i.push(o[0]),i),[]);return a.sort((i,o)=>{var p,f;const[s]=((p=i.timestamp)==null?void 0:p.split("-"))||[""],[l]=((f=o.timestamp)==null?void 0:f.split("-"))||[""],u=wa(s),c=wa(l);return u-c}),a},lF=async e=>{await B$(async()=>{try{await qa.saveGraphData({metaData:{date:Math.floor(new Date().getTime()/1e3),...e},type:"second_brain_consumed_content"})}catch(t){console.warn(t)}})},uF=e=>{const t=/((http|https):\/\/[^\s]+)/g,n=/@(\w+)/g;let r=e.replace(/\\/g,"");return r=r.replace(/'/g,"’"),r=r.replace(/\n/g,"
"),r=r.replace(t,'$1'),r=r.replace(n,'@$1'),r},cF={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},dF=cF;function pF(e,t,n=(r,a)=>r===a){return e.length===t.length&&e.every((r,a)=>n(r,t[a]))}const fF=2;function NI(e,t){return e-t}function Ui(e,t,n){return e==null?t:Math.min(Math.max(t,e),n)}function ux(e,t){var n;const{index:r}=(n=e.reduce((a,i,o)=>{const s=Math.abs(t-i);return a===null||s({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},yF=e=>e;let Ks;function Kc(){return Ks===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ks=CSS.supports("touch-action","none"):Ks=!0),Ks}function vF(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:a=!1,isRtl:i=!1,marks:o=!1,max:s=100,min:l=0,name:u,onChange:c,onChangeCommitted:p,orientation:f="horizontal",rootRef:h,scale:m=yF,step:b=1,tabIndex:v,value:T}=e,_=F.useRef(),[w,A]=F.useState(-1),[x,S]=F.useState(-1),[O,R]=F.useState(!1),C=F.useRef(0),[$,N]=kI({controlled:T,default:n??l,name:"Slider"}),P=c&&((B,Q,oe)=>{const pe=B.nativeEvent||B,ue=new pe.constructor(pe.type,pe);Object.defineProperty(ue,"target",{writable:!0,value:{value:Q,name:u}}),c(ue,Q,oe)}),z=Array.isArray($);let V=z?$.slice().sort(NI):[$];V=V.map(B=>Ui(B,l,s));const G=o===!0&&b!==null?[...Array(Math.floor((s-l)/b)+1)].map((B,Q)=>({value:l+b*Q})):o||[],K=G.map(B=>B.value),{isFocusVisibleRef:X,onBlur:W,onFocus:Z,ref:D}=hI(),[ie,ne]=F.useState(-1),M=F.useRef(),ye=Al(D,M),re=Al(h,ye),Se=B=>Q=>{var oe;const pe=Number(Q.currentTarget.getAttribute("data-index"));Z(Q),X.current===!0&&ne(pe),S(pe),B==null||(oe=B.onFocus)==null||oe.call(B,Q)},je=B=>Q=>{var oe;W(Q),X.current===!1&&ne(-1),S(-1),B==null||(oe=B.onBlur)==null||oe.call(B,Q)};sj(()=>{if(r&&M.current.contains(document.activeElement)){var B;(B=document.activeElement)==null||B.blur()}},[r]),r&&w!==-1&&A(-1),r&&ie!==-1&&ne(-1);const we=B=>Q=>{var oe;(oe=B.onChange)==null||oe.call(B,Q);const pe=Number(Q.currentTarget.getAttribute("data-index")),ue=V[pe],ke=K.indexOf(ue);let Ae=Q.target.valueAsNumber;if(G&&b==null){const Ie=K[K.length-1];Ae>Ie?Ae=Ie:Ae{const{current:oe}=M,{width:pe,height:ue,bottom:ke,left:Ae}=oe.getBoundingClientRect();let Ie;de.indexOf("vertical")===0?Ie=(ke-B.y)/ue:Ie=(B.x-Ae)/pe,de.indexOf("-reverse")!==-1&&(Ie=1-Ie);let We;if(We=hF(Ie,l,s),b)We=mF(We,b,l);else{const it=ux(K,We);We=K[it]}We=Ui(We,l,s);let xt=0;if(z){Q?xt=ae.current:xt=ux(V,We),a&&(We=Ui(We,V[xt-1]||-1/0,V[xt+1]||1/0));const it=We;We=cx({values:V,newValue:We,index:xt}),a&&Q||(xt=We.indexOf(it),ae.current=xt)}return{newValue:We,activeIndex:xt}},ee=bl(B=>{const Q=Ws(B,_);if(!Q)return;if(C.current+=1,B.type==="mousemove"&&B.buttons===0){_e(B);return}const{newValue:oe,activeIndex:pe}=ce({finger:Q,move:!0});Vs({sliderRef:M,activeIndex:pe,setActive:A}),N(oe),!O&&C.current>fF&&R(!0),P&&!Ys(oe,$)&&P(B,oe,pe)}),_e=bl(B=>{const Q=Ws(B,_);if(R(!1),!Q)return;const{newValue:oe}=ce({finger:Q,move:!0});A(-1),B.type==="touchend"&&S(-1),p&&p(B,oe),_.current=void 0,ve()}),me=bl(B=>{if(r)return;Kc()||B.preventDefault();const Q=B.changedTouches[0];Q!=null&&(_.current=Q.identifier);const oe=Ws(B,_);if(oe!==!1){const{newValue:ue,activeIndex:ke}=ce({finger:oe});Vs({sliderRef:M,activeIndex:ke,setActive:A}),N(ue),P&&!Ys(ue,$)&&P(B,ue,ke)}C.current=0;const pe=yl(M.current);pe.addEventListener("touchmove",ee),pe.addEventListener("touchend",_e)}),ve=F.useCallback(()=>{const B=yl(M.current);B.removeEventListener("mousemove",ee),B.removeEventListener("mouseup",_e),B.removeEventListener("touchmove",ee),B.removeEventListener("touchend",_e)},[_e,ee]);F.useEffect(()=>{const{current:B}=M;return B.addEventListener("touchstart",me,{passive:Kc()}),()=>{B.removeEventListener("touchstart",me,{passive:Kc()}),ve()}},[ve,me]),F.useEffect(()=>{r&&ve()},[r,ve]);const Ue=B=>Q=>{var oe;if((oe=B.onMouseDown)==null||oe.call(B,Q),r||Q.defaultPrevented||Q.button!==0)return;Q.preventDefault();const pe=Ws(Q,_);if(pe!==!1){const{newValue:ke,activeIndex:Ae}=ce({finger:pe});Vs({sliderRef:M,activeIndex:Ae,setActive:A}),N(ke),P&&!Ys(ke,$)&&P(Q,ke,Ae)}C.current=0;const ue=yl(M.current);ue.addEventListener("mousemove",ee),ue.addEventListener("mouseup",_e)},at=kl(z?V[0]:l,l,s),Je=kl(V[V.length-1],l,s)-at,Ht=(B={})=>{const Q=Vc(B),oe={onMouseDown:Ue(Q||{})},pe=ge({},Q,oe);return ge({},B,{ref:re},pe)},ze=B=>Q=>{var oe;(oe=B.onMouseOver)==null||oe.call(B,Q);const pe=Number(Q.currentTarget.getAttribute("data-index"));S(pe)},Ge=B=>Q=>{var oe;(oe=B.onMouseLeave)==null||oe.call(B,Q),S(-1)};return{active:w,axis:de,axisProps:bF,dragging:O,focusedThumbIndex:ie,getHiddenInputProps:(B={})=>{var Q;const oe=Vc(B),pe={onChange:we(oe||{}),onFocus:Se(oe||{}),onBlur:je(oe||{})},ue=ge({},oe,pe);return ge({tabIndex:v,"aria-labelledby":t,"aria-orientation":f,"aria-valuemax":m(s),"aria-valuemin":m(l),name:u,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":(Q=e.step)!=null?Q:void 0,disabled:r},B,ue,{style:ge({},dF,{direction:i?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:Ht,getThumbProps:(B={})=>{const Q=Vc(B),oe={onMouseOver:ze(Q||{}),onMouseLeave:Ge(Q||{})};return ge({},B,Q,oe)},marks:G,open:x,range:z,rootRef:re,trackLeap:Je,trackOffset:at,values:V,getThumbStyle:B=>({pointerEvents:w!==-1&&w!==B?"none":void 0})}}const SF=Dy(y.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),xF=Dy(y.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),EF=Dy(y.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function wF(e){return wy("MuiCheckbox",e)}const _F=Ey("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Xc=_F,TF=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],AF=e=>{const{classes:t,indeterminate:n,color:r,size:a}=e,i={root:["root",n&&"indeterminate",`color${dn(r)}`,`size${dn(a)}`]},o=Ty(i,wF,t);return ge({},t,o)},kF=Qn(zj,{shouldForwardProp:e=>U$(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${dn(n.size)}`],n.color!=="default"&&t[`color${dn(n.color)}`]]}})(({theme:e,ownerState:t})=>ge({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:xo(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${Xc.checked}, &.${Xc.indeterminate}`]:{color:(e.vars||e).palette[t.color].main},[`&.${Xc.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),OF=y.jsx(xF,{}),IF=y.jsx(SF,{}),RF=y.jsx(EF,{}),CF=F.forwardRef(function(t,n){var r,a;const i=_y({props:t,name:"MuiCheckbox"}),{checkedIcon:o=OF,color:s="primary",icon:l=IF,indeterminate:u=!1,indeterminateIcon:c=RF,inputProps:p,size:f="medium",className:h}=i,m=_u(i,TF),b=u?c:l,v=u?c:o,T=ge({},i,{color:s,indeterminate:u,size:f}),_=AF(T);return y.jsx(kF,ge({type:"checkbox",inputProps:ge({"data-indeterminate":u},p),icon:F.cloneElement(b,{fontSize:(r=b.props.fontSize)!=null?r:f}),checkedIcon:F.cloneElement(v,{fontSize:(a=v.props.fontSize)!=null?a:f}),ownerState:T,ref:n,className:Kn(_.root,h)},m,{classes:_}))}),NF=CF,DF=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function LF(e,t,n){const r=t.getBoundingClientRect(),a=n&&n.getBoundingClientRect(),i=gI(t);let o;if(t.fakeTransform)o=t.fakeTransform;else{const u=i.getComputedStyle(t);o=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("transform")}let s=0,l=0;if(o&&o!=="none"&&typeof o=="string"){const u=o.split("(")[1].split(")")[0].split(",");s=parseInt(u[4],10),l=parseInt(u[5],10)}return e==="left"?a?`translateX(${a.right+s-r.left}px)`:`translateX(${i.innerWidth+s-r.left}px)`:e==="right"?a?`translateX(-${r.right-a.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:e==="up"?a?`translateY(${a.bottom+l-r.top}px)`:`translateY(${i.innerHeight+l-r.top}px)`:a?`translateY(-${r.top-a.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function MF(e){return typeof e=="function"?e():e}function Xs(e,t,n){const r=MF(n),a=LF(e,t,r);a&&(t.style.webkitTransform=a,t.style.transform=a)}const PF=F.forwardRef(function(t,n){const r=Tu(),a={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:l,container:u,direction:c="down",easing:p=a,in:f,onEnter:h,onEntered:m,onEntering:b,onExit:v,onExited:T,onExiting:_,style:w,timeout:A=i,TransitionComponent:x=lj}=t,S=_u(t,DF),O=F.useRef(null),R=Al(l.ref,O,n),C=W=>Z=>{W&&(Z===void 0?W(O.current):W(O.current,Z))},$=C((W,Z)=>{Xs(c,W,u),cj(W),h&&h(W,Z)}),N=C((W,Z)=>{const D=ix({timeout:A,style:w,easing:p},{mode:"enter"});W.style.webkitTransition=r.transitions.create("-webkit-transform",ge({},D)),W.style.transition=r.transitions.create("transform",ge({},D)),W.style.webkitTransform="none",W.style.transform="none",b&&b(W,Z)}),P=C(m),z=C(_),V=C(W=>{const Z=ix({timeout:A,style:w,easing:p},{mode:"exit"});W.style.webkitTransition=r.transitions.create("-webkit-transform",Z),W.style.transition=r.transitions.create("transform",Z),Xs(c,W,u),v&&v(W)}),G=C(W=>{W.style.webkitTransition="",W.style.transition="",T&&T(W)}),K=W=>{o&&o(O.current,W)},X=F.useCallback(()=>{O.current&&Xs(c,O.current,u)},[c,u]);return F.useEffect(()=>{if(f||c==="down"||c==="right")return;const W=uj(()=>{O.current&&Xs(c,O.current,u)}),Z=gI(O.current);return Z.addEventListener("resize",W),()=>{W.clear(),Z.removeEventListener("resize",W)}},[c,f,u]),F.useEffect(()=>{f||X()},[f,X]),y.jsx(x,ge({nodeRef:O,onEnter:$,onEntered:P,onEntering:N,onExit:V,onExited:G,onExiting:z,addEndListener:K,appear:s,in:f,timeout:A},S,{children:(W,Z)=>F.cloneElement(l,ge({ref:R,style:ge({visibility:W==="exited"&&!f?"hidden":void 0},w,l.props.style)},Z))}))}),ni=PF,$F=e=>!e||!vl(e),jF=$F;function FF(e){return wy("MuiSlider",e)}const BF=Ey("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Xn=BF,UF=e=>{const{open:t}=e;return{offset:Kn(t&&Xn.valueLabelOpen),circle:Xn.valueLabelCircle,label:Xn.valueLabelLabel}};function zF(e){const{children:t,className:n,value:r}=e,a=UF(e);return t?F.cloneElement(t,{className:Kn(t.props.className)},y.jsxs(F.Fragment,{children:[t.props.children,y.jsx("span",{className:Kn(a.offset,n),"aria-hidden":!0,children:y.jsx("span",{className:a.circle,children:y.jsx("span",{className:a.label,children:r})})})]})):null}const GF=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function dx(e){return e}const qF=Qn("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${dn(n.color)}`],n.size!=="medium"&&t[`size${dn(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(({theme:e,ownerState:t})=>ge({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(e.vars||e).palette[t.color].main,WebkitTapHighlightColor:"transparent"},t.orientation==="horizontal"&&ge({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},t.size==="small"&&{height:2},t.marked&&{marginBottom:20}),t.orientation==="vertical"&&ge({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},t.size==="small"&&{width:2},t.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${Xn.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Xn.dragging}`]:{[`& .${Xn.thumb}, & .${Xn.track}`]:{transition:"none"}}})),HF=Qn("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})(({ownerState:e})=>ge({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},e.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},e.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},e.track==="inverted"&&{opacity:1})),WF=Qn("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?z$(e.palette[t.color].main,.62):G$(e.palette[t.color].main,.5);return ge({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{border:"none"},t.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},t.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},t.track===!1&&{display:"none"},t.track==="inverted"&&{backgroundColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n,borderColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n})}),VF=Qn("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${dn(n.color)}`],n.size!=="medium"&&t[`thumbSize${dn(n.size)}`]]}})(({theme:e,ownerState:t})=>ge({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{width:12,height:12},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&:before":ge({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},t.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${Xn.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:xo(e.palette[t.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Xn.active}`]:{boxShadow:`0px 0px 0px 14px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:xo(e.palette[t.color].main,.16)}`},[`&.${Xn.disabled}`]:{"&:hover":{boxShadow:"none"}}})),YF=Qn(zF,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e,ownerState:t})=>ge({[`&.${Xn.valueLabelOpen}`]:{transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},e.typography.body2,{fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},t.orientation==="horizontal"&&{top:"-10px",transformOrigin:"bottom center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"}},t.orientation==="vertical"&&{right:t.size==="small"?"20px":"30px",top:"50%",transformOrigin:"right center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"}},t.size==="small"&&{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),KF=Qn("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>aI(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(({theme:e,ownerState:t,markActive:n})=>ge({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},n&&{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8})),XF=Qn("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>aI(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(({theme:e,ownerState:t,markLabelActive:n})=>ge({},e.typography.body2,{color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},t.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},t.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},n&&{color:(e.vars||e).palette.text.primary})),ZF=e=>{const{disabled:t,dragging:n,marked:r,orientation:a,track:i,classes:o,color:s,size:l}=e,u={root:["root",t&&"disabled",n&&"dragging",r&&"marked",a==="vertical"&&"vertical",i==="inverted"&&"trackInverted",i===!1&&"trackFalse",s&&`color${dn(s)}`,l&&`size${dn(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${dn(l)}`,s&&`thumbColor${dn(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Ty(u,FF,o)},QF=({children:e})=>e,JF=F.forwardRef(function(t,n){var r,a,i,o,s,l,u,c,p,f,h,m,b,v,T,_,w,A,x,S,O,R,C,$;const N=_y({props:t,name:"MuiSlider"}),z=Tu().direction==="rtl",{"aria-label":V,"aria-valuetext":G,"aria-labelledby":K,component:X="span",components:W={},componentsProps:Z={},color:D="primary",classes:ie,className:ne,disableSwap:M=!1,disabled:ye=!1,getAriaLabel:re,getAriaValueText:Se,marks:je=!1,max:we=100,min:ae=0,orientation:de="horizontal",size:ce="medium",step:ee=1,scale:_e=dx,slotProps:me,slots:ve,track:Ue="normal",valueLabelDisplay:at="off",valueLabelFormat:Je=dx}=N,Ht=_u(N,GF),ze=ge({},N,{isRtl:z,max:we,min:ae,classes:ie,disabled:ye,disableSwap:M,orientation:de,marks:je,color:D,size:ce,step:ee,scale:_e,track:Ue,valueLabelDisplay:at,valueLabelFormat:Je}),{axisProps:Ge,getRootProps:Xe,getHiddenInputProps:Ft,getThumbProps:Wt,open:B,active:Q,axis:oe,focusedThumbIndex:pe,range:ue,dragging:ke,marks:Ae,values:Ie,trackOffset:We,trackLeap:xt,getThumbStyle:it}=vF(ge({},ze,{rootRef:n}));ze.marked=Ae.length>0&&Ae.some(Ce=>Ce.label),ze.dragging=ke,ze.focusedThumbIndex=pe;const Le=ZF(ze),It=(r=(a=ve==null?void 0:ve.root)!=null?a:W.Root)!=null?r:qF,gr=(i=(o=ve==null?void 0:ve.rail)!=null?o:W.Rail)!=null?i:HF,mr=(s=(l=ve==null?void 0:ve.track)!=null?l:W.Track)!=null?s:WF,Ze=(u=(c=ve==null?void 0:ve.thumb)!=null?c:W.Thumb)!=null?u:VF,ia=(p=(f=ve==null?void 0:ve.valueLabel)!=null?f:W.ValueLabel)!=null?p:YF,br=(h=(m=ve==null?void 0:ve.mark)!=null?m:W.Mark)!=null?h:KF,Fn=(b=(v=ve==null?void 0:ve.markLabel)!=null?v:W.MarkLabel)!=null?b:XF,yr=(T=(_=ve==null?void 0:ve.input)!=null?_:W.Input)!=null?T:"input",Bn=(w=me==null?void 0:me.root)!=null?w:Z.root,Un=(A=me==null?void 0:me.rail)!=null?A:Z.rail,zn=(x=me==null?void 0:me.track)!=null?x:Z.track,oa=(S=me==null?void 0:me.thumb)!=null?S:Z.thumb,tr=(O=me==null?void 0:me.valueLabel)!=null?O:Z.valueLabel,Li=(R=me==null?void 0:me.mark)!=null?R:Z.mark,Gn=(C=me==null?void 0:me.markLabel)!=null?C:Z.markLabel,jr=($=me==null?void 0:me.input)!=null?$:Z.input,he=zr({elementType:It,getSlotProps:Xe,externalSlotProps:Bn,externalForwardedProps:Ht,additionalProps:ge({},jF(It)&&{as:X}),ownerState:ge({},ze,Bn==null?void 0:Bn.ownerState),className:[Le.root,ne]}),sa=zr({elementType:gr,externalSlotProps:Un,ownerState:ze,className:Le.rail}),Zt=zr({elementType:mr,externalSlotProps:zn,additionalProps:{style:ge({},Ge[oe].offset(We),Ge[oe].leap(xt))},ownerState:ge({},ze,zn==null?void 0:zn.ownerState),className:Le.track}),mt=zr({elementType:Ze,getSlotProps:Wt,externalSlotProps:oa,ownerState:ge({},ze,oa==null?void 0:oa.ownerState),className:Le.thumb}),la=zr({elementType:ia,externalSlotProps:tr,ownerState:ge({},ze,tr==null?void 0:tr.ownerState),className:Le.valueLabel}),Me=zr({elementType:br,externalSlotProps:Li,ownerState:ze,className:Le.mark}),gn=zr({elementType:Fn,externalSlotProps:Gn,ownerState:ze,className:Le.markLabel}),Na=zr({elementType:yr,getSlotProps:Ft,externalSlotProps:jr,ownerState:ze});return y.jsxs(It,ge({},he,{children:[y.jsx(gr,ge({},sa)),y.jsx(mr,ge({},Zt)),Ae.filter(Ce=>Ce.value>=ae&&Ce.value<=we).map((Ce,Qe)=>{const Bt=kl(Ce.value,ae,we),st=Ge[oe].offset(Bt);let bt;return Ue===!1?bt=Ie.indexOf(Ce.value)!==-1:bt=Ue==="normal"&&(ue?Ce.value>=Ie[0]&&Ce.value<=Ie[Ie.length-1]:Ce.value<=Ie[0])||Ue==="inverted"&&(ue?Ce.value<=Ie[0]||Ce.value>=Ie[Ie.length-1]:Ce.value>=Ie[0]),y.jsxs(F.Fragment,{children:[y.jsx(br,ge({"data-index":Qe},Me,!vl(br)&&{markActive:bt},{style:ge({},st,Me.style),className:Kn(Me.className,bt&&Le.markActive)})),Ce.label!=null?y.jsx(Fn,ge({"aria-hidden":!0,"data-index":Qe},gn,!vl(Fn)&&{markLabelActive:bt},{style:ge({},st,gn.style),className:Kn(Le.markLabel,gn.className,bt&&Le.markLabelActive),children:Ce.label})):null]},Qe)}),Ie.map((Ce,Qe)=>{const Bt=kl(Ce,ae,we),st=Ge[oe].offset(Bt),bt=at==="off"?QF:ia;return y.jsx(bt,ge({},!vl(bt)&&{valueLabelFormat:Je,valueLabelDisplay:at,value:typeof Je=="function"?Je(_e(Ce),Qe):Je,index:Qe,open:B===Qe||Q===Qe||at==="on",disabled:ye},la,{children:y.jsx(Ze,ge({"data-index":Qe},mt,{className:Kn(Le.thumb,mt.className,Q===Qe&&Le.active,pe===Qe&&Le.focusVisible),style:ge({},st,it(Qe),mt.style),children:y.jsx(yr,ge({"data-index":Qe,"aria-label":re?re(Qe):V,"aria-valuenow":_e(Ce),"aria-labelledby":K,"aria-valuetext":Se?Se(_e(Ce),Qe):G,value:Ie[Qe]},Na))}))}),Qe)})]}))}),Du=JF;function e2(e){return wy("MuiTooltip",e)}const t2=Ey("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Kr=t2,n2=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function r2(e){return Math.round(e*1e5)/1e5}const a2=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:a,placement:i}=e,o={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",a&&"touch",`tooltipPlacement${dn(i.split("-")[0])}`],arrow:["arrow"]};return Ty(o,e2,t)},i2=Qn(Cy,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(({theme:e,ownerState:t,open:n})=>ge({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Kr.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Kr.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Kr.arrow}`]:ge({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Kr.arrow}`]:ge({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),o2=Qn("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${dn(n.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>ge({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:xo(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${r2(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Kr.popper}[data-popper-placement*="left"] &`]:ge({transformOrigin:"right center"},t.isRtl?ge({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):ge({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Kr.popper}[data-popper-placement*="right"] &`]:ge({transformOrigin:"left center"},t.isRtl?ge({marginRight:"14px"},t.touch&&{marginRight:"24px"}):ge({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Kr.popper}[data-popper-placement*="top"] &`]:ge({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Kr.popper}[data-popper-placement*="bottom"] &`]:ge({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),s2=Qn("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:xo(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Zs=!1,Zc=null,zi={x:0,y:0};function Qs(e,t){return n=>{t&&t(n),e(n)}}const l2=F.forwardRef(function(t,n){var r,a,i,o,s,l,u,c,p,f,h,m,b,v,T,_,w,A,x;const S=_y({props:t,name:"MuiTooltip"}),{arrow:O=!1,children:R,components:C={},componentsProps:$={},describeChild:N=!1,disableFocusListener:P=!1,disableHoverListener:z=!1,disableInteractive:V=!1,disableTouchListener:G=!1,enterDelay:K=100,enterNextDelay:X=0,enterTouchDelay:W=700,followCursor:Z=!1,id:D,leaveDelay:ie=0,leaveTouchDelay:ne=1500,onClose:M,onOpen:ye,open:re,placement:Se="bottom",PopperComponent:je,PopperProps:we={},slotProps:ae={},slots:de={},title:ce,TransitionComponent:ee=ox,TransitionProps:_e}=S,me=_u(S,n2),ve=F.isValidElement(R)?R:y.jsx("span",{children:R}),Ue=Tu(),at=Ue.direction==="rtl",[Je,Ht]=F.useState(),[ze,Ge]=F.useState(null),Xe=F.useRef(!1),Ft=V||Z,Wt=F.useRef(),B=F.useRef(),Q=F.useRef(),oe=F.useRef(),[pe,ue]=kI({controlled:re,default:!1,name:"Tooltip",state:"open"});let ke=pe;const Ae=Bj(D),Ie=F.useRef(),We=F.useCallback(()=>{Ie.current!==void 0&&(document.body.style.WebkitUserSelect=Ie.current,Ie.current=void 0),clearTimeout(oe.current)},[]);F.useEffect(()=>()=>{clearTimeout(Wt.current),clearTimeout(B.current),clearTimeout(Q.current),We()},[We]);const xt=Pe=>{clearTimeout(Zc),Zs=!0,ue(!0),ye&&!ke&&ye(Pe)},it=bl(Pe=>{clearTimeout(Zc),Zc=setTimeout(()=>{Zs=!1},800+ie),ue(!1),M&&ke&&M(Pe),clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Xe.current=!1},Ue.transitions.duration.shortest)}),Le=Pe=>{Xe.current&&Pe.type!=="touchstart"||(Je&&Je.removeAttribute("title"),clearTimeout(B.current),clearTimeout(Q.current),K||Zs&&X?B.current=setTimeout(()=>{xt(Pe)},Zs?X:K):xt(Pe))},It=Pe=>{clearTimeout(B.current),clearTimeout(Q.current),Q.current=setTimeout(()=>{it(Pe)},ie)},{isFocusVisibleRef:gr,onBlur:mr,onFocus:Ze,ref:ia}=hI(),[,br]=F.useState(!1),Fn=Pe=>{mr(Pe),gr.current===!1&&(br(!1),It(Pe))},yr=Pe=>{Je||Ht(Pe.currentTarget),Ze(Pe),gr.current===!0&&(br(!0),Le(Pe))},Bn=Pe=>{Xe.current=!0;const Qt=ve.props;Qt.onTouchStart&&Qt.onTouchStart(Pe)},Un=Le,zn=It,oa=Pe=>{Bn(Pe),clearTimeout(Q.current),clearTimeout(Wt.current),We(),Ie.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",oe.current=setTimeout(()=>{document.body.style.WebkitUserSelect=Ie.current,Le(Pe)},W)},tr=Pe=>{ve.props.onTouchEnd&&ve.props.onTouchEnd(Pe),We(),clearTimeout(Q.current),Q.current=setTimeout(()=>{it(Pe)},ne)};F.useEffect(()=>{if(!ke)return;function Pe(Qt){(Qt.key==="Escape"||Qt.key==="Esc")&&it(Qt)}return document.addEventListener("keydown",Pe),()=>{document.removeEventListener("keydown",Pe)}},[it,ke]);const Li=Al(ve.ref,ia,Ht,n);!ce&&ce!==0&&(ke=!1);const Gn=F.useRef(),jr=Pe=>{const Qt=ve.props;Qt.onMouseMove&&Qt.onMouseMove(Pe),zi={x:Pe.clientX,y:Pe.clientY},Gn.current&&Gn.current.update()},he={},sa=typeof ce=="string";N?(he.title=!ke&&sa&&!z?ce:null,he["aria-describedby"]=ke?Ae:null):(he["aria-label"]=sa?ce:null,he["aria-labelledby"]=ke&&!sa?Ae:null);const Zt=ge({},he,me,ve.props,{className:Kn(me.className,ve.props.className),onTouchStart:Bn,ref:Li},Z?{onMouseMove:jr}:{}),mt={};G||(Zt.onTouchStart=oa,Zt.onTouchEnd=tr),z||(Zt.onMouseOver=Qs(Un,Zt.onMouseOver),Zt.onMouseLeave=Qs(zn,Zt.onMouseLeave),Ft||(mt.onMouseOver=Un,mt.onMouseLeave=zn)),P||(Zt.onFocus=Qs(yr,Zt.onFocus),Zt.onBlur=Qs(Fn,Zt.onBlur),Ft||(mt.onFocus=yr,mt.onBlur=Fn));const la=F.useMemo(()=>{var Pe;let Qt=[{name:"arrow",enabled:!!ze,options:{element:ze,padding:4}}];return(Pe=we.popperOptions)!=null&&Pe.modifiers&&(Qt=Qt.concat(we.popperOptions.modifiers)),ge({},we.popperOptions,{modifiers:Qt})},[ze,we]),Me=ge({},S,{isRtl:at,arrow:O,disableInteractive:Ft,placement:Se,PopperComponentProp:je,touch:Xe.current}),gn=a2(Me),Na=(r=(a=de.popper)!=null?a:C.Popper)!=null?r:i2,Ce=(i=(o=(s=de.transition)!=null?s:C.Transition)!=null?o:ee)!=null?i:ox,Qe=(l=(u=de.tooltip)!=null?u:C.Tooltip)!=null?l:o2,Bt=(c=(p=de.arrow)!=null?p:C.Arrow)!=null?c:s2,st=Hs(Na,ge({},we,(f=ae.popper)!=null?f:$.popper,{className:Kn(gn.popper,we==null?void 0:we.className,(h=(m=ae.popper)!=null?m:$.popper)==null?void 0:h.className)}),Me),bt=Hs(Ce,ge({},_e,(b=ae.transition)!=null?b:$.transition),Me),qn=Hs(Qe,ge({},(v=ae.tooltip)!=null?v:$.tooltip,{className:Kn(gn.tooltip,(T=(_=ae.tooltip)!=null?_:$.tooltip)==null?void 0:T.className)}),Me),vr=Hs(Bt,ge({},(w=ae.arrow)!=null?w:$.arrow,{className:Kn(gn.arrow,(A=(x=ae.arrow)!=null?x:$.arrow)==null?void 0:A.className)}),Me);return y.jsxs(F.Fragment,{children:[F.cloneElement(ve,Zt),y.jsx(Na,ge({as:je??Cy,placement:Se,anchorEl:Z?{getBoundingClientRect:()=>({top:zi.y,left:zi.x,right:zi.x,bottom:zi.y,width:0,height:0})}:Je,popperRef:Gn,open:Je?ke:!1,id:Ae,transition:!0},mt,st,{popperOptions:la,children:({TransitionProps:Pe})=>y.jsx(Ce,ge({timeout:Ue.transitions.duration.shorter},Pe,bt,{children:y.jsxs(Qe,ge({},qn,{children:[ce,O?y.jsx(Bt,ge({},vr,{ref:Ge})):null]}))}))}))]})}),u2=l2,c2=(e,t="down")=>{const n=Tu(),[r,a]=F.useState(!1),i=n.breakpoints[t](e).split("@media")[1].trim();return F.useEffect(()=>{const o=()=>{const{matches:s}=window.matchMedia(i);a(s)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[i]),r},d2=e=>e.filter(t=>t.tldr).length>=2&&e.some(t=>t.audio_EN);function p2(e){return e.tldr_topic??e.name}var Ol=globalThis&&globalThis.__assign||function(){return Ol=Object.assign||function(e){for(var t,n=1,r=arguments.length;n({autoCorrect:"off",autoComplete:"off"}))` pointer-events: auto; height: 48px; padding: 0 40px 0 18px; @@ -1957,7 +1957,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `,Xfe=H.audio` height: 0; width: 0; -`,Zfe=()=>{const e=Kt(),{setPlayingNode:t}=Cu(n=>n);switch(F.useEffect(()=>{var r,a;if(!e)return;(e.media_url||e.link||((r=e.properties)==null?void 0:r.link)||((a=e.properties)==null?void 0:a.media_url))&&t(e)},[t,e]),e==null?void 0:e.node_type){case"guest":case"person":return y.jsx(Bre,{});case"data_series":return y.jsx(Fne,{});case"tribe_message":return y.jsx(Pre,{});case"Tweet":return y.jsx(Xre,{});case"topic":return y.jsx(Kre,{});case"show":return y.jsx(Yre,{});case"video":case"podcast":case"clip":case"twitter_space":return y.jsx(YN,{});case"document":return y.jsx(Hfe,{});case"episode":return y.jsx(Cre,{},e.ref_id);case"image":return y.jsx(Mre,{});default:return y.jsx(Dfe,{})}},Qfe=F.memo(Zfe);var Jfe=function(t,n,r){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&ehe(i,n.attrs),n.text&&(i.text=""+n.text);var o="onload"in i?KO:the;o(i,r),i.onload||KO(i,r),a.appendChild(i)};function ehe(e,t){for(var n in t)e.setAttribute(n,t[n])}function KO(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function the(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var nhe=function(t){return rhe(t)&&!ahe(t)};function rhe(e){return!!e&&typeof e=="object"}function ahe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||she(e)}var ihe=typeof Symbol=="function"&&Symbol.for,ohe=ihe?Symbol.for("react.element"):60103;function she(e){return e.$$typeof===ohe}function lhe(e){return Array.isArray(e)?[]:{}}function cs(e,t){return t.clone!==!1&&t.isMergeableObject(e)?wi(lhe(e),e,t):e}function uhe(e,t,n){return e.concat(t).map(function(r){return cs(r,n)})}function che(e,t){if(!t.customMerge)return wi;var n=t.customMerge(e);return typeof n=="function"?n:wi}function dhe(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function XO(e){return Object.keys(e).concat(dhe(e))}function CD(e,t){try{return t in e}catch{return!1}}function phe(e,t){return CD(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function fhe(e,t,n){var r={};return n.isMergeableObject(e)&&XO(e).forEach(function(a){r[a]=cs(e[a],n)}),XO(t).forEach(function(a){phe(e,a)||(CD(e,a)&&n.isMergeableObject(t[a])?r[a]=che(a,n)(e[a],t[a],n):r[a]=cs(t[a],n))}),r}function wi(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||uhe,n.isMergeableObject=n.isMergeableObject||nhe,n.cloneUnlessOtherwiseSpecified=cs;var r=Array.isArray(t),a=Array.isArray(e),i=r===a;return i?r?n.arrayMerge(e,t,n):fhe(e,t,n):cs(t,n)}wi.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,a){return wi(r,a,n)},{})};var hhe=wi,ND=hhe,ghe=Object.create,Tc=Object.defineProperty,mhe=Object.getOwnPropertyDescriptor,bhe=Object.getOwnPropertyNames,yhe=Object.getPrototypeOf,vhe=Object.prototype.hasOwnProperty,She=(e,t)=>{for(var n in t)Tc(e,n,{get:t[n],enumerable:!0})},DD=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of bhe(t))!vhe.call(e,a)&&a!==n&&Tc(e,a,{get:()=>t[a],enumerable:!(r=mhe(t,a))||r.enumerable});return e},hS=(e,t,n)=>(n=e!=null?ghe(yhe(e)):{},DD(t||!e||!e.__esModule?Tc(n,"default",{value:e,enumerable:!0}):n,e)),xhe=e=>DD(Tc({},"__esModule",{value:!0}),e),LD={};She(LD,{callPlayer:()=>$he,getConfig:()=>Mhe,getSDK:()=>Lhe,isBlobUrl:()=>Fhe,isMediaStream:()=>jhe,lazy:()=>The,omit:()=>Phe,parseEndTime:()=>Che,parseStartTime:()=>Rhe,queryString:()=>Dhe,randomString:()=>Nhe,supportsWebKitPresentationMode:()=>Bhe});var Ac=xhe(LD),Ehe=hS(F),whe=hS(Jfe),_he=hS(ND);const The=e=>Ehe.default.lazy(async()=>{const t=await e();return typeof t.default=="function"?t:t.default}),Ahe=/[?&#](?:start|t)=([0-9hms]+)/,khe=/[?&#]end=([0-9hms]+)/,yy=/(\d+)(h|m|s)/g,Ohe=/^\d+$/;function MD(e,t){if(e instanceof Array)return;const n=e.match(t);if(n){const r=n[1];if(r.match(yy))return Ihe(r);if(Ohe.test(r))return parseInt(r)}}function Ihe(e){let t=0,n=yy.exec(e);for(;n!==null;){const[,r,a]=n;a==="h"&&(t+=parseInt(r,10)*60*60),a==="m"&&(t+=parseInt(r,10)*60),a==="s"&&(t+=parseInt(r,10)),n=yy.exec(e)}return t}function Rhe(e){return MD(e,Ahe)}function Che(e){return MD(e,khe)}function Nhe(){return Math.random().toString(36).substr(2,5)}function Dhe(e){return Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}function qm(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}const za={},Lhe=function(t,n,r=null,a=()=>!0,i=whe.default){const o=qm(n);return o&&a(o)?Promise.resolve(o):new Promise((s,l)=>{if(za[t]){za[t].push({resolve:s,reject:l});return}za[t]=[{resolve:s,reject:l}];const u=c=>{za[t].forEach(p=>p.resolve(c))};if(r){const c=window[r];window[r]=function(){c&&c(),u(qm(n))}}i(t,c=>{c?(za[t].forEach(p=>p.reject(c)),za[t]=null):r||u(qm(n))})})};function Mhe(e,t){return(0,_he.default)(t.config,e.config)}function Phe(e,...t){const n=[].concat(...t),r={},a=Object.keys(e);for(const i of a)n.indexOf(i)===-1&&(r[i]=e[i]);return r}function $he(e,...t){if(!this.player||!this.player[e]){let n=`ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}return this.player[e](...t)}function jhe(e){return typeof window<"u"&&typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function Fhe(e){return/^blob:/.test(e)}function Bhe(e=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var gS=Object.defineProperty,Uhe=Object.getOwnPropertyDescriptor,zhe=Object.getOwnPropertyNames,Ghe=Object.prototype.hasOwnProperty,qhe=(e,t)=>{for(var n in t)gS(e,n,{get:t[n],enumerable:!0})},Hhe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of zhe(t))!Ghe.call(e,a)&&a!==n&&gS(e,a,{get:()=>t[a],enumerable:!(r=Uhe(t,a))||r.enumerable});return e},Whe=e=>Hhe(gS({},"__esModule",{value:!0}),e),PD={};qhe(PD,{AUDIO_EXTENSIONS:()=>mS,DASH_EXTENSIONS:()=>KD,FLV_EXTENSIONS:()=>XD,HLS_EXTENSIONS:()=>yS,MATCH_URL_DAILYMOTION:()=>HD,MATCH_URL_FACEBOOK:()=>FD,MATCH_URL_FACEBOOK_WATCH:()=>BD,MATCH_URL_KALTURA:()=>YD,MATCH_URL_MIXCLOUD:()=>WD,MATCH_URL_SOUNDCLOUD:()=>$D,MATCH_URL_STREAMABLE:()=>UD,MATCH_URL_TWITCH_CHANNEL:()=>qD,MATCH_URL_TWITCH_VIDEO:()=>GD,MATCH_URL_VIDYARD:()=>VD,MATCH_URL_VIMEO:()=>jD,MATCH_URL_WISTIA:()=>zD,MATCH_URL_YOUTUBE:()=>vy,VIDEO_EXTENSIONS:()=>bS,canPlay:()=>Yhe});var Vhe=Whe(PD),ZO=Ac;const vy=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,$D=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,jD=/vimeo\.com\/(?!progressive_redirect).+/,FD=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,BD=/^https?:\/\/fb\.watch\/.+$/,UD=/streamable\.com\/([a-z0-9]+)$/,zD=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,GD=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,qD=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,HD=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,WD=/mixcloud\.com\/([^/]+\/[^/]+)/,VD=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,YD=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,mS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,bS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,yS=/\.(m3u8)($|\?)/i,KD=/\.(mpd)($|\?)/i,XD=/\.(flv)($|\?)/i,Sy=e=>{if(e instanceof Array){for(const t of e)if(typeof t=="string"&&Sy(t)||Sy(t.src))return!0;return!1}return(0,ZO.isMediaStream)(e)||(0,ZO.isBlobUrl)(e)?!0:mS.test(e)||bS.test(e)||yS.test(e)||KD.test(e)||XD.test(e)},Yhe={youtube:e=>e instanceof Array?e.every(t=>vy.test(t)):vy.test(e),soundcloud:e=>$D.test(e)&&!mS.test(e),vimeo:e=>jD.test(e)&&!bS.test(e)&&!yS.test(e),facebook:e=>FD.test(e)||BD.test(e),streamable:e=>UD.test(e),wistia:e=>zD.test(e),twitch:e=>GD.test(e)||qD.test(e),dailymotion:e=>HD.test(e),mixcloud:e=>WD.test(e),vidyard:e=>VD.test(e),kaltura:e=>YD.test(e),file:Sy};var vS=Object.defineProperty,Khe=Object.getOwnPropertyDescriptor,Xhe=Object.getOwnPropertyNames,Zhe=Object.prototype.hasOwnProperty,Qhe=(e,t)=>{for(var n in t)vS(e,n,{get:t[n],enumerable:!0})},Jhe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Xhe(t))!Zhe.call(e,a)&&a!==n&&vS(e,a,{get:()=>t[a],enumerable:!(r=Khe(t,a))||r.enumerable});return e},ege=e=>Jhe(vS({},"__esModule",{value:!0}),e),ZD={};Qhe(ZD,{default:()=>nge});var tge=ege(ZD),mn=Ac,un=Vhe,nge=[{key:"youtube",name:"YouTube",canPlay:un.canPlay.youtube,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./YouTube-c46c3d3c.js").then(e=>e.Y),["assets/YouTube-c46c3d3c.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"soundcloud",name:"SoundCloud",canPlay:un.canPlay.soundcloud,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./SoundCloud-a32ad7b2.js").then(e=>e.S),["assets/SoundCloud-a32ad7b2.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"vimeo",name:"Vimeo",canPlay:un.canPlay.vimeo,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Vimeo-797d4bed.js").then(e=>e.V),["assets/Vimeo-797d4bed.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"facebook",name:"Facebook",canPlay:un.canPlay.facebook,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Facebook-3300d9ca.js").then(e=>e.F),["assets/Facebook-3300d9ca.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"streamable",name:"Streamable",canPlay:un.canPlay.streamable,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Streamable-1d987e98.js").then(e=>e.S),["assets/Streamable-1d987e98.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"wistia",name:"Wistia",canPlay:un.canPlay.wistia,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Wistia-8fb3c44b.js").then(e=>e.W),["assets/Wistia-8fb3c44b.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"twitch",name:"Twitch",canPlay:un.canPlay.twitch,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Twitch-d246f176.js").then(e=>e.T),["assets/Twitch-d246f176.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"dailymotion",name:"DailyMotion",canPlay:un.canPlay.dailymotion,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./DailyMotion-542adefd.js").then(e=>e.D),["assets/DailyMotion-542adefd.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"mixcloud",name:"Mixcloud",canPlay:un.canPlay.mixcloud,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Mixcloud-ca20574f.js").then(e=>e.M),["assets/Mixcloud-ca20574f.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"vidyard",name:"Vidyard",canPlay:un.canPlay.vidyard,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Vidyard-4e893f64.js").then(e=>e.V),["assets/Vidyard-4e893f64.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"kaltura",name:"Kaltura",canPlay:un.canPlay.kaltura,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Kaltura-bc0b2095.js").then(e=>e.K),["assets/Kaltura-bc0b2095.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))},{key:"file",name:"FilePlayer",canPlay:un.canPlay.file,canEnablePIP:e=>un.canPlay.file(e)&&(document.pictureInPictureEnabled||(0,mn.supportsWebKitPresentationMode)())&&!un.AUDIO_EXTENSIONS.test(e),lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./FilePlayer-60739ed0.js").then(e=>e.F),["assets/FilePlayer-60739ed0.js","assets/index-69dca385.js","assets/index-a2878e02.css"]))}],QO=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function rge(e,t){return!!(e===t||QO(e)&&QO(t))}function age(e,t){if(e.length!==t.length)return!1;for(var n=0;n{for(var n in t)kc(e,n,{get:t[n],enumerable:!0})},JD=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of hge(t))!mge.call(e,a)&&a!==n&&kc(e,a,{get:()=>t[a],enumerable:!(r=fge(t,a))||r.enumerable});return e},yge=(e,t,n)=>(n=e!=null?pge(gge(e)):{},JD(t||!e||!e.__esModule?kc(n,"default",{value:e,enumerable:!0}):n,e)),vge=e=>JD(kc({},"__esModule",{value:!0}),e),eL={};bge(eL,{defaultProps:()=>Ege,propTypes:()=>xge});var tL=vge(eL),Sge=yge(Cj);const{string:nn,bool:rn,number:Ga,array:Hm,oneOfType:ro,shape:On,object:an,func:Rt,node:JO}=Sge.default,xge={url:ro([nn,Hm,an]),playing:rn,loop:rn,controls:rn,volume:Ga,muted:rn,playbackRate:Ga,width:ro([nn,Ga]),height:ro([nn,Ga]),style:an,progressInterval:Ga,playsinline:rn,pip:rn,stopOnUnmount:rn,light:ro([rn,nn,an]),playIcon:JO,previewTabIndex:Ga,fallback:JO,oEmbedUrl:nn,wrapper:ro([nn,Rt,On({render:Rt.isRequired})]),config:On({soundcloud:On({options:an}),youtube:On({playerVars:an,embedOptions:an,onUnstarted:Rt}),facebook:On({appId:nn,version:nn,playerId:nn,attributes:an}),dailymotion:On({params:an}),vimeo:On({playerOptions:an,title:nn}),file:On({attributes:an,tracks:Hm,forceVideo:rn,forceAudio:rn,forceHLS:rn,forceSafariHLS:rn,forceDisableHls:rn,forceDASH:rn,forceFLV:rn,hlsOptions:an,hlsVersion:nn,dashVersion:nn,flvVersion:nn}),wistia:On({options:an,playerId:nn,customControls:Hm}),mixcloud:On({options:an}),twitch:On({options:an,playerId:nn}),vidyard:On({options:an})}),onReady:Rt,onStart:Rt,onPlay:Rt,onPause:Rt,onBuffer:Rt,onBufferEnd:Rt,onEnded:Rt,onError:Rt,onDuration:Rt,onSeek:Rt,onPlaybackRateChange:Rt,onPlaybackQualityChange:Rt,onProgress:Rt,onClickPreview:Rt,onEnablePIP:Rt,onDisablePIP:Rt},Ut=()=>{},Ege={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:Ut},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:Ut,onStart:Ut,onPlay:Ut,onPause:Ut,onBuffer:Ut,onBufferEnd:Ut,onEnded:Ut,onError:Ut,onDuration:Ut,onSeek:Ut,onPlaybackRateChange:Ut,onPlaybackQualityChange:Ut,onProgress:Ut,onClickPreview:Ut,onEnablePIP:Ut,onDisablePIP:Ut};var wge=Object.create,Rs=Object.defineProperty,_ge=Object.getOwnPropertyDescriptor,Tge=Object.getOwnPropertyNames,Age=Object.getPrototypeOf,kge=Object.prototype.hasOwnProperty,Oge=(e,t,n)=>t in e?Rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ige=(e,t)=>{for(var n in t)Rs(e,n,{get:t[n],enumerable:!0})},nL=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tge(t))!kge.call(e,a)&&a!==n&&Rs(e,a,{get:()=>t[a],enumerable:!(r=_ge(t,a))||r.enumerable});return e},rL=(e,t,n)=>(n=e!=null?wge(Age(e)):{},nL(t||!e||!e.__esModule?Rs(n,"default",{value:e,enumerable:!0}):n,e)),Rge=e=>nL(Rs({},"__esModule",{value:!0}),e),_t=(e,t,n)=>(Oge(e,typeof t!="symbol"?t+"":t,n),n),aL={};Ige(aL,{default:()=>Oc});var Cge=Rge(aL),eI=rL(F),Nge=rL(QD),iL=tL,Dge=Ac;const Lge=5e3;class Oc extends eI.Component{constructor(){super(...arguments),_t(this,"mounted",!1),_t(this,"isReady",!1),_t(this,"isPlaying",!1),_t(this,"isLoading",!0),_t(this,"loadOnReady",null),_t(this,"startOnPlay",!0),_t(this,"seekOnPlay",null),_t(this,"onDurationCalled",!1),_t(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),_t(this,"getInternalPlayer",t=>this.player?this.player[t]:null),_t(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,n=this.getSecondsLoaded(),r=this.getDuration();if(r){const a={playedSeconds:t,played:t/r};n!==null&&(a.loadedSeconds=n,a.loaded=n/r),(a.playedSeconds!==this.prevPlayed||a.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(a),this.prevPlayed=a.playedSeconds,this.prevLoaded=a.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),_t(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:n,volume:r,muted:a}=this.props;t(),!a&&r!==null&&this.player.setVolume(r),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):n&&this.player.play(),this.handleDurationCheck()}),_t(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:n,playbackRate:r}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&r!==1&&this.player.setPlaybackRate(r),t(),this.startOnPlay=!1),n(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),_t(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),_t(this,"handleEnded",()=>{const{activePlayer:t,loop:n,onEnded:r}=this.props;t.loopOnEnded&&n&&this.seekTo(0),n||(this.isPlaying=!1,r())}),_t(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),_t(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),_t(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:n,playing:r,volume:a,muted:i,playbackRate:o,pip:s,loop:l,activePlayer:u,disableDeferredLoading:c}=this.props;if(!(0,Nge.default)(t.url,n)){if(this.isLoading&&!u.forceLoad&&!c&&!(0,Dge.isMediaStream)(n)){console.warn(`ReactPlayer: the attempt to load ${n} is being deferred until the player has loaded`),this.loadOnReady=n;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(n,this.isReady)}!t.playing&&r&&!this.isPlaying&&this.player.play(),t.playing&&!r&&this.isPlaying&&this.player.pause(),!t.pip&&s&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!s&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==a&&a!==null&&this.player.setVolume(a),t.muted!==i&&(i?this.player.mute():(this.player.unmute(),a!==null&&setTimeout(()=>this.player.setVolume(a)))),t.playbackRate!==o&&this.player.setPlaybackRate&&this.player.setPlaybackRate(o),t.loop!==l&&this.player.setLoop&&this.player.setLoop(l)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,n,r){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},Lge));return}if(n?n==="fraction":t>0&&t<1){const i=this.player.getDuration();if(!i){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(i*t,r);return}this.player.seekTo(t,r)}render(){const t=this.props.activePlayer;return t?eI.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}_t(Oc,"displayName","Player");_t(Oc,"propTypes",iL.propTypes);_t(Oc,"defaultProps",iL.defaultProps);var Mge=Object.create,Cs=Object.defineProperty,Pge=Object.getOwnPropertyDescriptor,$ge=Object.getOwnPropertyNames,jge=Object.getPrototypeOf,Fge=Object.prototype.hasOwnProperty,Bge=(e,t,n)=>t in e?Cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uge=(e,t)=>{for(var n in t)Cs(e,n,{get:t[n],enumerable:!0})},oL=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of $ge(t))!Fge.call(e,a)&&a!==n&&Cs(e,a,{get:()=>t[a],enumerable:!(r=Pge(t,a))||r.enumerable});return e},Ns=(e,t,n)=>(n=e!=null?Mge(jge(e)):{},oL(t||!e||!e.__esModule?Cs(n,"default",{value:e,enumerable:!0}):n,e)),zge=e=>oL(Cs({},"__esModule",{value:!0}),e),wt=(e,t,n)=>(Bge(e,typeof t!="symbol"?t+"":t,n),n),sL={};Uge(sL,{createReactPlayer:()=>Zge});var Gge=zge(sL),Wa=Ns(F),qge=Ns(ND),Wm=Ns(sge),tI=Ns(QD),co=tL,lL=Ac,Hge=Ns(Cge);const Wge=(0,lL.lazy)(()=>bn(()=>import("./Preview-2ad6d0ea.js").then(e=>e.P),["assets/Preview-2ad6d0ea.js","assets/index-69dca385.js","assets/index-a2878e02.css"])),Vge=typeof window<"u"&&window.document,Yge=typeof At<"u"&&At.window&&At.window.document,Kge=Object.keys(co.propTypes),Xge=Vge||Yge?Wa.Suspense:()=>null,ao=[],Zge=(e,t)=>{var n;return n=class extends Wa.Component{constructor(){super(...arguments),wt(this,"state",{showPreview:!!this.props.light}),wt(this,"references",{wrapper:r=>{this.wrapper=r},player:r=>{this.player=r}}),wt(this,"handleClickPreview",r=>{this.setState({showPreview:!1}),this.props.onClickPreview(r)}),wt(this,"showPreview",()=>{this.setState({showPreview:!0})}),wt(this,"getDuration",()=>this.player?this.player.getDuration():null),wt(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),wt(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),wt(this,"getInternalPlayer",(r="player")=>this.player?this.player.getInternalPlayer(r):null),wt(this,"seekTo",(r,a,i)=>{if(!this.player)return null;this.player.seekTo(r,a,i)}),wt(this,"handleReady",()=>{this.props.onReady(this)}),wt(this,"getActivePlayer",(0,Wm.default)(r=>{for(const a of[...ao,...e])if(a.canPlay(r))return a;return t||null})),wt(this,"getConfig",(0,Wm.default)((r,a)=>{const{config:i}=this.props;return qge.default.all([co.defaultProps.config,co.defaultProps.config[a]||{},i,i[a]||{}])})),wt(this,"getAttributes",(0,Wm.default)(r=>(0,lL.omit)(this.props,Kge))),wt(this,"renderActivePlayer",r=>{if(!r)return null;const a=this.getActivePlayer(r);if(!a)return null;const i=this.getConfig(r,a.key);return Wa.default.createElement(Hge.default,{...this.props,key:a.key,ref:this.references.player,config:i,activePlayer:a.lazyPlayer||a,onReady:this.handleReady})})}shouldComponentUpdate(r,a){return!(0,tI.default)(this.props,r)||!(0,tI.default)(this.state,a)}componentDidUpdate(r){const{light:a}=this.props;!r.light&&a&&this.setState({showPreview:!0}),r.light&&!a&&this.setState({showPreview:!1})}renderPreview(r){if(!r)return null;const{light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s}=this.props;return Wa.default.createElement(Wge,{url:r,light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s,onClick:this.handleClickPreview})}render(){const{url:r,style:a,width:i,height:o,fallback:s,wrapper:l}=this.props,{showPreview:u}=this.state,c=this.getAttributes(r),p=typeof l=="string"?this.references.wrapper:void 0;return Wa.default.createElement(l,{ref:p,style:{...a,width:i,height:o},...c},Wa.default.createElement(Xge,{fallback:s},u?this.renderPreview(r):this.renderActivePlayer(r)))}},wt(n,"displayName","ReactPlayer"),wt(n,"propTypes",co.propTypes),wt(n,"defaultProps",co.defaultProps),wt(n,"addCustomPlayer",r=>{ao.push(r)}),wt(n,"removeCustomPlayers",()=>{ao.length=0}),wt(n,"canPlay",r=>{for(const a of[...ao,...e])if(a.canPlay(r))return!0;return!1}),wt(n,"canEnablePIP",r=>{for(const a of[...ao,...e])if(a.canEnablePIP&&a.canEnablePIP(r))return!0;return!1}),n};var Qge=Object.create,Ic=Object.defineProperty,Jge=Object.getOwnPropertyDescriptor,eme=Object.getOwnPropertyNames,tme=Object.getPrototypeOf,nme=Object.prototype.hasOwnProperty,rme=(e,t)=>{for(var n in t)Ic(e,n,{get:t[n],enumerable:!0})},uL=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of eme(t))!nme.call(e,a)&&a!==n&&Ic(e,a,{get:()=>t[a],enumerable:!(r=Jge(t,a))||r.enumerable});return e},ame=(e,t,n)=>(n=e!=null?Qge(tme(e)):{},uL(t||!e||!e.__esModule?Ic(n,"default",{value:e,enumerable:!0}):n,e)),ime=e=>uL(Ic({},"__esModule",{value:!0}),e),cL={};rme(cL,{default:()=>ume});var ome=ime(cL),xy=ame(tge),sme=Gge;const lme=xy.default[xy.default.length-1];var ume=(0,sme.createReactPlayer)(xy.default,lme);const cme=St(ome),nI=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),a=t>0?`${t}:`:"",i=t>0?n.toString().padStart(2,"0"):n.toString(),o=r.toString().padStart(2,"0");return`${a}${i}:${o}`},dme=({isPlaying:e,isFullScreen:t,setIsPlaying:n,playingTime:r,duration:a,handleProgressChange:i,handleVolumeChange:o,onFullScreenClick:s,showToolbar:l})=>{const[u,c]=F.useState(.5),[p,f]=F.useState(!1),[h,m]=F.useState(.5),b=(T,_)=>{const w=Array.isArray(_)?_[0]:_;c(w),o(T,w),p&&f(!1)},v=()=>{p?(c(h),o(new Event("input"),h)):(m(u),c(0),o(new Event("input"),0)),f(!p)};return y.jsxs(q,{children:[(!l||t)&&y.jsx(yme,{"aria-label":"Small","data-testid":"progress-bar",isFullScreen:t,max:a,onChange:i,size:"small",value:r}),y.jsxs(pme,{align:"center",direction:"row",showToolbar:l||t,children:[y.jsx(gme,{onClick:n,size:"small",children:e?y.jsx(Ru,{}):y.jsx(Ry,{})}),y.jsxs(vme,{direction:"row",children:[y.jsx("span",{children:nI(r)}),y.jsx("span",{className:"separator",children:"/"}),y.jsx("span",{className:"duration",children:nI(a)})]}),y.jsxs(mme,{direction:"row",px:9,children:[y.jsx(Du,{className:"volume-slider",max:1,min:0,onChange:b,size:"small",step:.1,value:u}),y.jsx(fme,{onClick:v,children:p?y.jsx(hme,{children:y.jsx(Nj,{})}):y.jsx(Dj,{})})]}),y.jsx(bme,{"data-testid":"fullscreen-button",onClick:s,children:t?y.jsx(Mj,{}):y.jsx(Lj,{})})]})]})},pme=H(q)` +`,Zfe=()=>{const e=Kt(),{setPlayingNode:t}=Cu(n=>n);switch(F.useEffect(()=>{var r,a;if(!e)return;(e.media_url||e.link||((r=e.properties)==null?void 0:r.link)||((a=e.properties)==null?void 0:a.media_url))&&t(e)},[t,e]),e==null?void 0:e.node_type){case"guest":case"person":return y.jsx(Bre,{});case"data_series":return y.jsx(Fne,{});case"tribe_message":return y.jsx(Pre,{});case"Tweet":return y.jsx(Xre,{});case"topic":return y.jsx(Kre,{});case"show":return y.jsx(Yre,{});case"video":case"podcast":case"clip":case"twitter_space":return y.jsx(YN,{});case"document":return y.jsx(Hfe,{});case"episode":return y.jsx(Cre,{},e.ref_id);case"image":return y.jsx(Mre,{});default:return y.jsx(Dfe,{})}},Qfe=F.memo(Zfe);var Jfe=function(t,n,r){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&ehe(i,n.attrs),n.text&&(i.text=""+n.text);var o="onload"in i?KO:the;o(i,r),i.onload||KO(i,r),a.appendChild(i)};function ehe(e,t){for(var n in t)e.setAttribute(n,t[n])}function KO(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function the(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var nhe=function(t){return rhe(t)&&!ahe(t)};function rhe(e){return!!e&&typeof e=="object"}function ahe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||she(e)}var ihe=typeof Symbol=="function"&&Symbol.for,ohe=ihe?Symbol.for("react.element"):60103;function she(e){return e.$$typeof===ohe}function lhe(e){return Array.isArray(e)?[]:{}}function cs(e,t){return t.clone!==!1&&t.isMergeableObject(e)?wi(lhe(e),e,t):e}function uhe(e,t,n){return e.concat(t).map(function(r){return cs(r,n)})}function che(e,t){if(!t.customMerge)return wi;var n=t.customMerge(e);return typeof n=="function"?n:wi}function dhe(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function XO(e){return Object.keys(e).concat(dhe(e))}function CD(e,t){try{return t in e}catch{return!1}}function phe(e,t){return CD(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function fhe(e,t,n){var r={};return n.isMergeableObject(e)&&XO(e).forEach(function(a){r[a]=cs(e[a],n)}),XO(t).forEach(function(a){phe(e,a)||(CD(e,a)&&n.isMergeableObject(t[a])?r[a]=che(a,n)(e[a],t[a],n):r[a]=cs(t[a],n))}),r}function wi(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||uhe,n.isMergeableObject=n.isMergeableObject||nhe,n.cloneUnlessOtherwiseSpecified=cs;var r=Array.isArray(t),a=Array.isArray(e),i=r===a;return i?r?n.arrayMerge(e,t,n):fhe(e,t,n):cs(t,n)}wi.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,a){return wi(r,a,n)},{})};var hhe=wi,ND=hhe,ghe=Object.create,Tc=Object.defineProperty,mhe=Object.getOwnPropertyDescriptor,bhe=Object.getOwnPropertyNames,yhe=Object.getPrototypeOf,vhe=Object.prototype.hasOwnProperty,She=(e,t)=>{for(var n in t)Tc(e,n,{get:t[n],enumerable:!0})},DD=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of bhe(t))!vhe.call(e,a)&&a!==n&&Tc(e,a,{get:()=>t[a],enumerable:!(r=mhe(t,a))||r.enumerable});return e},hS=(e,t,n)=>(n=e!=null?ghe(yhe(e)):{},DD(t||!e||!e.__esModule?Tc(n,"default",{value:e,enumerable:!0}):n,e)),xhe=e=>DD(Tc({},"__esModule",{value:!0}),e),LD={};She(LD,{callPlayer:()=>$he,getConfig:()=>Mhe,getSDK:()=>Lhe,isBlobUrl:()=>Fhe,isMediaStream:()=>jhe,lazy:()=>The,omit:()=>Phe,parseEndTime:()=>Che,parseStartTime:()=>Rhe,queryString:()=>Dhe,randomString:()=>Nhe,supportsWebKitPresentationMode:()=>Bhe});var Ac=xhe(LD),Ehe=hS(F),whe=hS(Jfe),_he=hS(ND);const The=e=>Ehe.default.lazy(async()=>{const t=await e();return typeof t.default=="function"?t:t.default}),Ahe=/[?&#](?:start|t)=([0-9hms]+)/,khe=/[?&#]end=([0-9hms]+)/,yy=/(\d+)(h|m|s)/g,Ohe=/^\d+$/;function MD(e,t){if(e instanceof Array)return;const n=e.match(t);if(n){const r=n[1];if(r.match(yy))return Ihe(r);if(Ohe.test(r))return parseInt(r)}}function Ihe(e){let t=0,n=yy.exec(e);for(;n!==null;){const[,r,a]=n;a==="h"&&(t+=parseInt(r,10)*60*60),a==="m"&&(t+=parseInt(r,10)*60),a==="s"&&(t+=parseInt(r,10)),n=yy.exec(e)}return t}function Rhe(e){return MD(e,Ahe)}function Che(e){return MD(e,khe)}function Nhe(){return Math.random().toString(36).substr(2,5)}function Dhe(e){return Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}function qm(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}const za={},Lhe=function(t,n,r=null,a=()=>!0,i=whe.default){const o=qm(n);return o&&a(o)?Promise.resolve(o):new Promise((s,l)=>{if(za[t]){za[t].push({resolve:s,reject:l});return}za[t]=[{resolve:s,reject:l}];const u=c=>{za[t].forEach(p=>p.resolve(c))};if(r){const c=window[r];window[r]=function(){c&&c(),u(qm(n))}}i(t,c=>{c?(za[t].forEach(p=>p.reject(c)),za[t]=null):r||u(qm(n))})})};function Mhe(e,t){return(0,_he.default)(t.config,e.config)}function Phe(e,...t){const n=[].concat(...t),r={},a=Object.keys(e);for(const i of a)n.indexOf(i)===-1&&(r[i]=e[i]);return r}function $he(e,...t){if(!this.player||!this.player[e]){let n=`ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}return this.player[e](...t)}function jhe(e){return typeof window<"u"&&typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function Fhe(e){return/^blob:/.test(e)}function Bhe(e=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var gS=Object.defineProperty,Uhe=Object.getOwnPropertyDescriptor,zhe=Object.getOwnPropertyNames,Ghe=Object.prototype.hasOwnProperty,qhe=(e,t)=>{for(var n in t)gS(e,n,{get:t[n],enumerable:!0})},Hhe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of zhe(t))!Ghe.call(e,a)&&a!==n&&gS(e,a,{get:()=>t[a],enumerable:!(r=Uhe(t,a))||r.enumerable});return e},Whe=e=>Hhe(gS({},"__esModule",{value:!0}),e),PD={};qhe(PD,{AUDIO_EXTENSIONS:()=>mS,DASH_EXTENSIONS:()=>KD,FLV_EXTENSIONS:()=>XD,HLS_EXTENSIONS:()=>yS,MATCH_URL_DAILYMOTION:()=>HD,MATCH_URL_FACEBOOK:()=>FD,MATCH_URL_FACEBOOK_WATCH:()=>BD,MATCH_URL_KALTURA:()=>YD,MATCH_URL_MIXCLOUD:()=>WD,MATCH_URL_SOUNDCLOUD:()=>$D,MATCH_URL_STREAMABLE:()=>UD,MATCH_URL_TWITCH_CHANNEL:()=>qD,MATCH_URL_TWITCH_VIDEO:()=>GD,MATCH_URL_VIDYARD:()=>VD,MATCH_URL_VIMEO:()=>jD,MATCH_URL_WISTIA:()=>zD,MATCH_URL_YOUTUBE:()=>vy,VIDEO_EXTENSIONS:()=>bS,canPlay:()=>Yhe});var Vhe=Whe(PD),ZO=Ac;const vy=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,$D=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,jD=/vimeo\.com\/(?!progressive_redirect).+/,FD=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,BD=/^https?:\/\/fb\.watch\/.+$/,UD=/streamable\.com\/([a-z0-9]+)$/,zD=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,GD=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,qD=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,HD=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,WD=/mixcloud\.com\/([^/]+\/[^/]+)/,VD=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,YD=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,mS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,bS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,yS=/\.(m3u8)($|\?)/i,KD=/\.(mpd)($|\?)/i,XD=/\.(flv)($|\?)/i,Sy=e=>{if(e instanceof Array){for(const t of e)if(typeof t=="string"&&Sy(t)||Sy(t.src))return!0;return!1}return(0,ZO.isMediaStream)(e)||(0,ZO.isBlobUrl)(e)?!0:mS.test(e)||bS.test(e)||yS.test(e)||KD.test(e)||XD.test(e)},Yhe={youtube:e=>e instanceof Array?e.every(t=>vy.test(t)):vy.test(e),soundcloud:e=>$D.test(e)&&!mS.test(e),vimeo:e=>jD.test(e)&&!bS.test(e)&&!yS.test(e),facebook:e=>FD.test(e)||BD.test(e),streamable:e=>UD.test(e),wistia:e=>zD.test(e),twitch:e=>GD.test(e)||qD.test(e),dailymotion:e=>HD.test(e),mixcloud:e=>WD.test(e),vidyard:e=>VD.test(e),kaltura:e=>YD.test(e),file:Sy};var vS=Object.defineProperty,Khe=Object.getOwnPropertyDescriptor,Xhe=Object.getOwnPropertyNames,Zhe=Object.prototype.hasOwnProperty,Qhe=(e,t)=>{for(var n in t)vS(e,n,{get:t[n],enumerable:!0})},Jhe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Xhe(t))!Zhe.call(e,a)&&a!==n&&vS(e,a,{get:()=>t[a],enumerable:!(r=Khe(t,a))||r.enumerable});return e},ege=e=>Jhe(vS({},"__esModule",{value:!0}),e),ZD={};Qhe(ZD,{default:()=>nge});var tge=ege(ZD),mn=Ac,un=Vhe,nge=[{key:"youtube",name:"YouTube",canPlay:un.canPlay.youtube,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./YouTube-3fc59bb4.js").then(e=>e.Y),["assets/YouTube-3fc59bb4.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"soundcloud",name:"SoundCloud",canPlay:un.canPlay.soundcloud,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./SoundCloud-ce204774.js").then(e=>e.S),["assets/SoundCloud-ce204774.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"vimeo",name:"Vimeo",canPlay:un.canPlay.vimeo,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Vimeo-a97267b2.js").then(e=>e.V),["assets/Vimeo-a97267b2.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"facebook",name:"Facebook",canPlay:un.canPlay.facebook,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Facebook-75d34c3c.js").then(e=>e.F),["assets/Facebook-75d34c3c.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"streamable",name:"Streamable",canPlay:un.canPlay.streamable,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Streamable-dee96b3f.js").then(e=>e.S),["assets/Streamable-dee96b3f.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"wistia",name:"Wistia",canPlay:un.canPlay.wistia,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Wistia-ed034142.js").then(e=>e.W),["assets/Wistia-ed034142.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"twitch",name:"Twitch",canPlay:un.canPlay.twitch,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Twitch-1acf7e0c.js").then(e=>e.T),["assets/Twitch-1acf7e0c.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"dailymotion",name:"DailyMotion",canPlay:un.canPlay.dailymotion,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./DailyMotion-89acab1f.js").then(e=>e.D),["assets/DailyMotion-89acab1f.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"mixcloud",name:"Mixcloud",canPlay:un.canPlay.mixcloud,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Mixcloud-254c3596.js").then(e=>e.M),["assets/Mixcloud-254c3596.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"vidyard",name:"Vidyard",canPlay:un.canPlay.vidyard,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Vidyard-aa66148d.js").then(e=>e.V),["assets/Vidyard-aa66148d.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"kaltura",name:"Kaltura",canPlay:un.canPlay.kaltura,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Kaltura-b610b718.js").then(e=>e.K),["assets/Kaltura-b610b718.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))},{key:"file",name:"FilePlayer",canPlay:un.canPlay.file,canEnablePIP:e=>un.canPlay.file(e)&&(document.pictureInPictureEnabled||(0,mn.supportsWebKitPresentationMode)())&&!un.AUDIO_EXTENSIONS.test(e),lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./FilePlayer-b166e543.js").then(e=>e.F),["assets/FilePlayer-b166e543.js","assets/index-b856be88.js","assets/index-a2878e02.css"]))}],QO=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function rge(e,t){return!!(e===t||QO(e)&&QO(t))}function age(e,t){if(e.length!==t.length)return!1;for(var n=0;n{for(var n in t)kc(e,n,{get:t[n],enumerable:!0})},JD=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of hge(t))!mge.call(e,a)&&a!==n&&kc(e,a,{get:()=>t[a],enumerable:!(r=fge(t,a))||r.enumerable});return e},yge=(e,t,n)=>(n=e!=null?pge(gge(e)):{},JD(t||!e||!e.__esModule?kc(n,"default",{value:e,enumerable:!0}):n,e)),vge=e=>JD(kc({},"__esModule",{value:!0}),e),eL={};bge(eL,{defaultProps:()=>Ege,propTypes:()=>xge});var tL=vge(eL),Sge=yge(Cj);const{string:nn,bool:rn,number:Ga,array:Hm,oneOfType:ro,shape:On,object:an,func:Rt,node:JO}=Sge.default,xge={url:ro([nn,Hm,an]),playing:rn,loop:rn,controls:rn,volume:Ga,muted:rn,playbackRate:Ga,width:ro([nn,Ga]),height:ro([nn,Ga]),style:an,progressInterval:Ga,playsinline:rn,pip:rn,stopOnUnmount:rn,light:ro([rn,nn,an]),playIcon:JO,previewTabIndex:Ga,fallback:JO,oEmbedUrl:nn,wrapper:ro([nn,Rt,On({render:Rt.isRequired})]),config:On({soundcloud:On({options:an}),youtube:On({playerVars:an,embedOptions:an,onUnstarted:Rt}),facebook:On({appId:nn,version:nn,playerId:nn,attributes:an}),dailymotion:On({params:an}),vimeo:On({playerOptions:an,title:nn}),file:On({attributes:an,tracks:Hm,forceVideo:rn,forceAudio:rn,forceHLS:rn,forceSafariHLS:rn,forceDisableHls:rn,forceDASH:rn,forceFLV:rn,hlsOptions:an,hlsVersion:nn,dashVersion:nn,flvVersion:nn}),wistia:On({options:an,playerId:nn,customControls:Hm}),mixcloud:On({options:an}),twitch:On({options:an,playerId:nn}),vidyard:On({options:an})}),onReady:Rt,onStart:Rt,onPlay:Rt,onPause:Rt,onBuffer:Rt,onBufferEnd:Rt,onEnded:Rt,onError:Rt,onDuration:Rt,onSeek:Rt,onPlaybackRateChange:Rt,onPlaybackQualityChange:Rt,onProgress:Rt,onClickPreview:Rt,onEnablePIP:Rt,onDisablePIP:Rt},Ut=()=>{},Ege={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:Ut},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:Ut,onStart:Ut,onPlay:Ut,onPause:Ut,onBuffer:Ut,onBufferEnd:Ut,onEnded:Ut,onError:Ut,onDuration:Ut,onSeek:Ut,onPlaybackRateChange:Ut,onPlaybackQualityChange:Ut,onProgress:Ut,onClickPreview:Ut,onEnablePIP:Ut,onDisablePIP:Ut};var wge=Object.create,Rs=Object.defineProperty,_ge=Object.getOwnPropertyDescriptor,Tge=Object.getOwnPropertyNames,Age=Object.getPrototypeOf,kge=Object.prototype.hasOwnProperty,Oge=(e,t,n)=>t in e?Rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ige=(e,t)=>{for(var n in t)Rs(e,n,{get:t[n],enumerable:!0})},nL=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tge(t))!kge.call(e,a)&&a!==n&&Rs(e,a,{get:()=>t[a],enumerable:!(r=_ge(t,a))||r.enumerable});return e},rL=(e,t,n)=>(n=e!=null?wge(Age(e)):{},nL(t||!e||!e.__esModule?Rs(n,"default",{value:e,enumerable:!0}):n,e)),Rge=e=>nL(Rs({},"__esModule",{value:!0}),e),_t=(e,t,n)=>(Oge(e,typeof t!="symbol"?t+"":t,n),n),aL={};Ige(aL,{default:()=>Oc});var Cge=Rge(aL),eI=rL(F),Nge=rL(QD),iL=tL,Dge=Ac;const Lge=5e3;class Oc extends eI.Component{constructor(){super(...arguments),_t(this,"mounted",!1),_t(this,"isReady",!1),_t(this,"isPlaying",!1),_t(this,"isLoading",!0),_t(this,"loadOnReady",null),_t(this,"startOnPlay",!0),_t(this,"seekOnPlay",null),_t(this,"onDurationCalled",!1),_t(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),_t(this,"getInternalPlayer",t=>this.player?this.player[t]:null),_t(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,n=this.getSecondsLoaded(),r=this.getDuration();if(r){const a={playedSeconds:t,played:t/r};n!==null&&(a.loadedSeconds=n,a.loaded=n/r),(a.playedSeconds!==this.prevPlayed||a.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(a),this.prevPlayed=a.playedSeconds,this.prevLoaded=a.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),_t(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:n,volume:r,muted:a}=this.props;t(),!a&&r!==null&&this.player.setVolume(r),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):n&&this.player.play(),this.handleDurationCheck()}),_t(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:n,playbackRate:r}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&r!==1&&this.player.setPlaybackRate(r),t(),this.startOnPlay=!1),n(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),_t(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),_t(this,"handleEnded",()=>{const{activePlayer:t,loop:n,onEnded:r}=this.props;t.loopOnEnded&&n&&this.seekTo(0),n||(this.isPlaying=!1,r())}),_t(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),_t(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),_t(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:n,playing:r,volume:a,muted:i,playbackRate:o,pip:s,loop:l,activePlayer:u,disableDeferredLoading:c}=this.props;if(!(0,Nge.default)(t.url,n)){if(this.isLoading&&!u.forceLoad&&!c&&!(0,Dge.isMediaStream)(n)){console.warn(`ReactPlayer: the attempt to load ${n} is being deferred until the player has loaded`),this.loadOnReady=n;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(n,this.isReady)}!t.playing&&r&&!this.isPlaying&&this.player.play(),t.playing&&!r&&this.isPlaying&&this.player.pause(),!t.pip&&s&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!s&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==a&&a!==null&&this.player.setVolume(a),t.muted!==i&&(i?this.player.mute():(this.player.unmute(),a!==null&&setTimeout(()=>this.player.setVolume(a)))),t.playbackRate!==o&&this.player.setPlaybackRate&&this.player.setPlaybackRate(o),t.loop!==l&&this.player.setLoop&&this.player.setLoop(l)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,n,r){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},Lge));return}if(n?n==="fraction":t>0&&t<1){const i=this.player.getDuration();if(!i){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(i*t,r);return}this.player.seekTo(t,r)}render(){const t=this.props.activePlayer;return t?eI.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}_t(Oc,"displayName","Player");_t(Oc,"propTypes",iL.propTypes);_t(Oc,"defaultProps",iL.defaultProps);var Mge=Object.create,Cs=Object.defineProperty,Pge=Object.getOwnPropertyDescriptor,$ge=Object.getOwnPropertyNames,jge=Object.getPrototypeOf,Fge=Object.prototype.hasOwnProperty,Bge=(e,t,n)=>t in e?Cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uge=(e,t)=>{for(var n in t)Cs(e,n,{get:t[n],enumerable:!0})},oL=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of $ge(t))!Fge.call(e,a)&&a!==n&&Cs(e,a,{get:()=>t[a],enumerable:!(r=Pge(t,a))||r.enumerable});return e},Ns=(e,t,n)=>(n=e!=null?Mge(jge(e)):{},oL(t||!e||!e.__esModule?Cs(n,"default",{value:e,enumerable:!0}):n,e)),zge=e=>oL(Cs({},"__esModule",{value:!0}),e),wt=(e,t,n)=>(Bge(e,typeof t!="symbol"?t+"":t,n),n),sL={};Uge(sL,{createReactPlayer:()=>Zge});var Gge=zge(sL),Wa=Ns(F),qge=Ns(ND),Wm=Ns(sge),tI=Ns(QD),co=tL,lL=Ac,Hge=Ns(Cge);const Wge=(0,lL.lazy)(()=>bn(()=>import("./Preview-7a3dbc32.js").then(e=>e.P),["assets/Preview-7a3dbc32.js","assets/index-b856be88.js","assets/index-a2878e02.css"])),Vge=typeof window<"u"&&window.document,Yge=typeof At<"u"&&At.window&&At.window.document,Kge=Object.keys(co.propTypes),Xge=Vge||Yge?Wa.Suspense:()=>null,ao=[],Zge=(e,t)=>{var n;return n=class extends Wa.Component{constructor(){super(...arguments),wt(this,"state",{showPreview:!!this.props.light}),wt(this,"references",{wrapper:r=>{this.wrapper=r},player:r=>{this.player=r}}),wt(this,"handleClickPreview",r=>{this.setState({showPreview:!1}),this.props.onClickPreview(r)}),wt(this,"showPreview",()=>{this.setState({showPreview:!0})}),wt(this,"getDuration",()=>this.player?this.player.getDuration():null),wt(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),wt(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),wt(this,"getInternalPlayer",(r="player")=>this.player?this.player.getInternalPlayer(r):null),wt(this,"seekTo",(r,a,i)=>{if(!this.player)return null;this.player.seekTo(r,a,i)}),wt(this,"handleReady",()=>{this.props.onReady(this)}),wt(this,"getActivePlayer",(0,Wm.default)(r=>{for(const a of[...ao,...e])if(a.canPlay(r))return a;return t||null})),wt(this,"getConfig",(0,Wm.default)((r,a)=>{const{config:i}=this.props;return qge.default.all([co.defaultProps.config,co.defaultProps.config[a]||{},i,i[a]||{}])})),wt(this,"getAttributes",(0,Wm.default)(r=>(0,lL.omit)(this.props,Kge))),wt(this,"renderActivePlayer",r=>{if(!r)return null;const a=this.getActivePlayer(r);if(!a)return null;const i=this.getConfig(r,a.key);return Wa.default.createElement(Hge.default,{...this.props,key:a.key,ref:this.references.player,config:i,activePlayer:a.lazyPlayer||a,onReady:this.handleReady})})}shouldComponentUpdate(r,a){return!(0,tI.default)(this.props,r)||!(0,tI.default)(this.state,a)}componentDidUpdate(r){const{light:a}=this.props;!r.light&&a&&this.setState({showPreview:!0}),r.light&&!a&&this.setState({showPreview:!1})}renderPreview(r){if(!r)return null;const{light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s}=this.props;return Wa.default.createElement(Wge,{url:r,light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s,onClick:this.handleClickPreview})}render(){const{url:r,style:a,width:i,height:o,fallback:s,wrapper:l}=this.props,{showPreview:u}=this.state,c=this.getAttributes(r),p=typeof l=="string"?this.references.wrapper:void 0;return Wa.default.createElement(l,{ref:p,style:{...a,width:i,height:o},...c},Wa.default.createElement(Xge,{fallback:s},u?this.renderPreview(r):this.renderActivePlayer(r)))}},wt(n,"displayName","ReactPlayer"),wt(n,"propTypes",co.propTypes),wt(n,"defaultProps",co.defaultProps),wt(n,"addCustomPlayer",r=>{ao.push(r)}),wt(n,"removeCustomPlayers",()=>{ao.length=0}),wt(n,"canPlay",r=>{for(const a of[...ao,...e])if(a.canPlay(r))return!0;return!1}),wt(n,"canEnablePIP",r=>{for(const a of[...ao,...e])if(a.canEnablePIP&&a.canEnablePIP(r))return!0;return!1}),n};var Qge=Object.create,Ic=Object.defineProperty,Jge=Object.getOwnPropertyDescriptor,eme=Object.getOwnPropertyNames,tme=Object.getPrototypeOf,nme=Object.prototype.hasOwnProperty,rme=(e,t)=>{for(var n in t)Ic(e,n,{get:t[n],enumerable:!0})},uL=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of eme(t))!nme.call(e,a)&&a!==n&&Ic(e,a,{get:()=>t[a],enumerable:!(r=Jge(t,a))||r.enumerable});return e},ame=(e,t,n)=>(n=e!=null?Qge(tme(e)):{},uL(t||!e||!e.__esModule?Ic(n,"default",{value:e,enumerable:!0}):n,e)),ime=e=>uL(Ic({},"__esModule",{value:!0}),e),cL={};rme(cL,{default:()=>ume});var ome=ime(cL),xy=ame(tge),sme=Gge;const lme=xy.default[xy.default.length-1];var ume=(0,sme.createReactPlayer)(xy.default,lme);const cme=St(ome),nI=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),a=t>0?`${t}:`:"",i=t>0?n.toString().padStart(2,"0"):n.toString(),o=r.toString().padStart(2,"0");return`${a}${i}:${o}`},dme=({isPlaying:e,isFullScreen:t,setIsPlaying:n,playingTime:r,duration:a,handleProgressChange:i,handleVolumeChange:o,onFullScreenClick:s,showToolbar:l})=>{const[u,c]=F.useState(.5),[p,f]=F.useState(!1),[h,m]=F.useState(.5),b=(T,_)=>{const w=Array.isArray(_)?_[0]:_;c(w),o(T,w),p&&f(!1)},v=()=>{p?(c(h),o(new Event("input"),h)):(m(u),c(0),o(new Event("input"),0)),f(!p)};return y.jsxs(q,{children:[(!l||t)&&y.jsx(yme,{"aria-label":"Small","data-testid":"progress-bar",isFullScreen:t,max:a,onChange:i,size:"small",value:r}),y.jsxs(pme,{align:"center",direction:"row",showToolbar:l||t,children:[y.jsx(gme,{onClick:n,size:"small",children:e?y.jsx(Ru,{}):y.jsx(Ry,{})}),y.jsxs(vme,{direction:"row",children:[y.jsx("span",{children:nI(r)}),y.jsx("span",{className:"separator",children:"/"}),y.jsx("span",{className:"duration",children:nI(a)})]}),y.jsxs(mme,{direction:"row",px:9,children:[y.jsx(Du,{className:"volume-slider",max:1,min:0,onChange:b,size:"small",step:.1,value:u}),y.jsx(fme,{onClick:v,children:p?y.jsx(hme,{children:y.jsx(Nj,{})}):y.jsx(Dj,{})})]}),y.jsx(bme,{"data-testid":"fullscreen-button",onClick:s,children:t?y.jsx(Mj,{}):y.jsx(Lj,{})})]})]})},pme=H(q)` height: 60px; padding: 12px 16px; ${e=>e.showToolbar&&` diff --git a/build/assets/index-f0d2a829.js b/build/assets/index-bf6ce8a9.js similarity index 69% rename from build/assets/index-f0d2a829.js rename to build/assets/index-bf6ce8a9.js index 84e5fe16a..aa16c3d7c 100644 --- a/build/assets/index-f0d2a829.js +++ b/build/assets/index-bf6ce8a9.js @@ -1 +1 @@ -import"./index-69dca385.js";import{f as o}from"./index-94c3c981.js";const a=()=>{const{simulation:s,simulationHelpers:e}=o(r=>r);return{nodes:(s==null?void 0:s.nodes())||[],links:e.getLinks()}};export{a as u}; +import"./index-b856be88.js";import{f as o}from"./index-c59af388.js";const a=()=>{const{simulation:s,simulationHelpers:e}=o(r=>r);return{nodes:(s==null?void 0:s.nodes())||[],links:e.getLinks()}};export{a as u}; diff --git a/build/assets/index-94c3c981.js b/build/assets/index-c59af388.js similarity index 99% rename from build/assets/index-94c3c981.js rename to build/assets/index-c59af388.js index 249d0a460..b46da97cc 100644 --- a/build/assets/index-94c3c981.js +++ b/build/assets/index-c59af388.js @@ -1,4 +1,4 @@ -import{g as La,r as p,R as v,a as E0,_ as Z1,b as U,c as f0,d as Xe,s as se,e as ze,u as Qe,j as u,f as A1,h as h0,k as Kr,i as G1,l as pn,m as Ra,n as G3,o as P3,$ as M3,W as T3,p as mn,q as Je,t as l1,v as X,F as s1,w as L3,x as R3,L as F3,y as xn,z as qr,A as Fa,T as F1,S as O3,B as W1,C as I3,D as H3,E as N3,G as z3,H as U3,I as Z3,J as Oa,K as W3,M as K3,N as q3,O as Y3,P as X3}from"./index-69dca385.js";function Q3(e){return e===null?"?":e.toLocaleString("en-US").split(",").join(" ")}function J3(e){return e?String(e).replace(/[[]{2}/g,"").replace(/[\]]{2}/g,""):""}const el=e=>{const[t,n,r]=e.split(":"),i=parseInt(t,10),o=parseInt(n,10),a=parseInt(r,10);return i*3600+o*60+a};var Ia={exports:{}},tl="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",nl=tl,rl=nl;function Ha(){}function Na(){}Na.resetWarningCache=Ha;var il=function(){function e(r,i,o,a,s,l){if(l!==rl){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Na,resetWarningCache:Ha};return n.PropTypes=n,n};Ia.exports=il();var ol=Ia.exports;const g1=La(ol);function ji(...e){return e.reduce((t,n)=>n==null?t:function(...i){t.apply(this,i),n.apply(this,i)},()=>{})}function al(e,t=166){let n;function r(...i){const o=()=>{e.apply(this,i)};clearTimeout(n),n=setTimeout(o,t)}return r.clear=()=>{clearTimeout(n)},r}function we(e){return e&&e.ownerDocument||document}function st(e){return we(e).defaultView||window}function ur(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const sl=typeof window<"u"?p.useLayoutEffect:p.useEffect,dr=sl;function S0(e){const t=p.useRef(e);return dr(()=>{t.current=e}),p.useRef((...n)=>(0,t.current)(...n)).current}function Pe(...e){return p.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{ur(n,t)})},e)}let kn=!0,fr=!1,Gi;const ll={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function cl(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&ll[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function ul(e){e.metaKey||e.altKey||e.ctrlKey||(kn=!0)}function jn(){kn=!1}function dl(){this.visibilityState==="hidden"&&fr&&(kn=!0)}function fl(e){e.addEventListener("keydown",ul,!0),e.addEventListener("mousedown",jn,!0),e.addEventListener("pointerdown",jn,!0),e.addEventListener("touchstart",jn,!0),e.addEventListener("visibilitychange",dl,!0)}function hl(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return kn||cl(t)}function pl(){const e=p.useCallback(i=>{i!=null&&fl(i.ownerDocument)},[]),t=p.useRef(!1);function n(){return t.current?(fr=!0,window.clearTimeout(Gi),Gi=window.setTimeout(()=>{fr=!1},100),t.current=!1,!0):!1}function r(i){return hl(i)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function ml(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const xl=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},Pi=xl;function hr(e,t){return hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},hr(e,t)}function za(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,hr(e,t)}const Mi={disabled:!1},Ot=v.createContext(null);var kl=function(t){return t.scrollTop},Q0="unmounted",t0="exited",n0="entering",w0="entered",pr="exiting",Fe=function(e){za(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=t0,o.appearStatus=n0):l=w0:r.unmountOnExit||r.mountOnEnter?l=Q0:l=t0,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Q0?{status:t0}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==n0&&a!==w0&&(o=n0):(a===n0||a===w0)&&(o=pr)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===n0){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:E0.findDOMNode(this);a&&kl(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===t0&&this.setState({status:Q0})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[E0.findDOMNode(this),s],c=l[0],d=l[1],f=this.getTimeouts(),h=s?f.appear:f.enter;if(!i&&!a||Mi.disabled){this.safeSetState({status:w0},function(){o.props.onEntered(c)});return}this.props.onEnter(c,d),this.safeSetState({status:n0},function(){o.props.onEntering(c,d),o.onTransitionEnd(h,function(){o.safeSetState({status:w0},function(){o.props.onEntered(c,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:E0.findDOMNode(this);if(!o||Mi.disabled){this.safeSetState({status:t0},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:pr},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:t0},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:E0.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],d=l[1];this.props.addEndListener(c,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Q0)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=Z1(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(Ot.Provider,{value:null},typeof a=="function"?a(i,s):v.cloneElement(v.Children.only(a),s))},t}(v.Component);Fe.contextType=Ot;Fe.propTypes={};function g0(){}Fe.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:g0,onEntering:g0,onEntered:g0,onExit:g0,onExiting:g0,onExited:g0};Fe.UNMOUNTED=Q0;Fe.EXITED=t0;Fe.ENTERING=n0;Fe.ENTERED=w0;Fe.EXITING=pr;const Ua=Fe;function gl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yr(e,t){var n=function(o){return t&&p.isValidElement(o)?t(o):o},r=Object.create(null);return e&&p.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Cl(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),i=[];for(var o in e)o in t?i.length&&(r[o]=i,i=[]):i.push(o);var a,s={};for(var l in t){if(r[l])for(a=0;ae.scrollTop;function It(e,t){var n,r;const{timeout:i,easing:o,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof o=="object"?o[t.mode]:o,delay:a.transitionDelay}}function Sl(e){return f0("MuiPaper",e)}Xe("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const _l=["className","component","elevation","square","variant"],Al=e=>{const{square:t,elevation:n,variant:r,classes:i}=e,o={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return h0(o,Sl,i)},Vl=se("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return U({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&U({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${ze("#fff",Pi(t.elevation))}, ${ze("#fff",Pi(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),Dl=p.forwardRef(function(t,n){const r=Qe({props:t,name:"MuiPaper"}),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,c=Z1(r,_l),d=U({},r,{component:o,elevation:a,square:s,variant:l}),f=Al(d);return u.jsx(Vl,U({as:o,ownerState:d,className:A1(f.root,i),ref:n},c))}),Bl=Dl;function $l(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=e,[d,f]=p.useState(!1),h=A1(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),k={width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},m=A1(n.child,d&&n.childLeaving,r&&n.childPulsate);return!s&&!d&&f(!0),p.useEffect(()=>{if(!s&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,s,c]),u.jsx("span",{className:h,style:k,children:u.jsx("span",{className:m})})}const jl=Xe("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),ce=jl,Gl=["center","classes","className"];let gn=e=>e,Ti,Li,Ri,Fi;const mr=550,Pl=80,Ml=Kr(Ti||(Ti=gn` +import{g as La,r as p,R as v,a as E0,_ as Z1,b as U,c as f0,d as Xe,s as se,e as ze,u as Qe,j as u,f as A1,h as h0,k as Kr,i as G1,l as pn,m as Ra,n as G3,o as P3,$ as M3,W as T3,p as mn,q as Je,t as l1,v as X,F as s1,w as L3,x as R3,L as F3,y as xn,z as qr,A as Fa,T as F1,S as O3,B as W1,C as I3,D as H3,E as N3,G as z3,H as U3,I as Z3,J as Oa,K as W3,M as K3,N as q3,O as Y3,P as X3}from"./index-b856be88.js";function Q3(e){return e===null?"?":e.toLocaleString("en-US").split(",").join(" ")}function J3(e){return e?String(e).replace(/[[]{2}/g,"").replace(/[\]]{2}/g,""):""}const el=e=>{const[t,n,r]=e.split(":"),i=parseInt(t,10),o=parseInt(n,10),a=parseInt(r,10);return i*3600+o*60+a};var Ia={exports:{}},tl="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",nl=tl,rl=nl;function Ha(){}function Na(){}Na.resetWarningCache=Ha;var il=function(){function e(r,i,o,a,s,l){if(l!==rl){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Na,resetWarningCache:Ha};return n.PropTypes=n,n};Ia.exports=il();var ol=Ia.exports;const g1=La(ol);function ji(...e){return e.reduce((t,n)=>n==null?t:function(...i){t.apply(this,i),n.apply(this,i)},()=>{})}function al(e,t=166){let n;function r(...i){const o=()=>{e.apply(this,i)};clearTimeout(n),n=setTimeout(o,t)}return r.clear=()=>{clearTimeout(n)},r}function we(e){return e&&e.ownerDocument||document}function st(e){return we(e).defaultView||window}function ur(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const sl=typeof window<"u"?p.useLayoutEffect:p.useEffect,dr=sl;function S0(e){const t=p.useRef(e);return dr(()=>{t.current=e}),p.useRef((...n)=>(0,t.current)(...n)).current}function Pe(...e){return p.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{ur(n,t)})},e)}let kn=!0,fr=!1,Gi;const ll={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function cl(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&ll[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function ul(e){e.metaKey||e.altKey||e.ctrlKey||(kn=!0)}function jn(){kn=!1}function dl(){this.visibilityState==="hidden"&&fr&&(kn=!0)}function fl(e){e.addEventListener("keydown",ul,!0),e.addEventListener("mousedown",jn,!0),e.addEventListener("pointerdown",jn,!0),e.addEventListener("touchstart",jn,!0),e.addEventListener("visibilitychange",dl,!0)}function hl(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return kn||cl(t)}function pl(){const e=p.useCallback(i=>{i!=null&&fl(i.ownerDocument)},[]),t=p.useRef(!1);function n(){return t.current?(fr=!0,window.clearTimeout(Gi),Gi=window.setTimeout(()=>{fr=!1},100),t.current=!1,!0):!1}function r(i){return hl(i)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function ml(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const xl=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},Pi=xl;function hr(e,t){return hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},hr(e,t)}function za(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,hr(e,t)}const Mi={disabled:!1},Ot=v.createContext(null);var kl=function(t){return t.scrollTop},Q0="unmounted",t0="exited",n0="entering",w0="entered",pr="exiting",Fe=function(e){za(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=t0,o.appearStatus=n0):l=w0:r.unmountOnExit||r.mountOnEnter?l=Q0:l=t0,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Q0?{status:t0}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==n0&&a!==w0&&(o=n0):(a===n0||a===w0)&&(o=pr)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===n0){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:E0.findDOMNode(this);a&&kl(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===t0&&this.setState({status:Q0})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[E0.findDOMNode(this),s],c=l[0],d=l[1],f=this.getTimeouts(),h=s?f.appear:f.enter;if(!i&&!a||Mi.disabled){this.safeSetState({status:w0},function(){o.props.onEntered(c)});return}this.props.onEnter(c,d),this.safeSetState({status:n0},function(){o.props.onEntering(c,d),o.onTransitionEnd(h,function(){o.safeSetState({status:w0},function(){o.props.onEntered(c,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:E0.findDOMNode(this);if(!o||Mi.disabled){this.safeSetState({status:t0},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:pr},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:t0},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:E0.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],d=l[1];this.props.addEndListener(c,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Q0)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=Z1(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(Ot.Provider,{value:null},typeof a=="function"?a(i,s):v.cloneElement(v.Children.only(a),s))},t}(v.Component);Fe.contextType=Ot;Fe.propTypes={};function g0(){}Fe.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:g0,onEntering:g0,onEntered:g0,onExit:g0,onExiting:g0,onExited:g0};Fe.UNMOUNTED=Q0;Fe.EXITED=t0;Fe.ENTERING=n0;Fe.ENTERED=w0;Fe.EXITING=pr;const Ua=Fe;function gl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yr(e,t){var n=function(o){return t&&p.isValidElement(o)?t(o):o},r=Object.create(null);return e&&p.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Cl(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),i=[];for(var o in e)o in t?i.length&&(r[o]=i,i=[]):i.push(o);var a,s={};for(var l in t){if(r[l])for(a=0;ae.scrollTop;function It(e,t){var n,r;const{timeout:i,easing:o,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof o=="object"?o[t.mode]:o,delay:a.transitionDelay}}function Sl(e){return f0("MuiPaper",e)}Xe("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const _l=["className","component","elevation","square","variant"],Al=e=>{const{square:t,elevation:n,variant:r,classes:i}=e,o={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return h0(o,Sl,i)},Vl=se("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return U({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&U({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${ze("#fff",Pi(t.elevation))}, ${ze("#fff",Pi(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),Dl=p.forwardRef(function(t,n){const r=Qe({props:t,name:"MuiPaper"}),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,c=Z1(r,_l),d=U({},r,{component:o,elevation:a,square:s,variant:l}),f=Al(d);return u.jsx(Vl,U({as:o,ownerState:d,className:A1(f.root,i),ref:n},c))}),Bl=Dl;function $l(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=e,[d,f]=p.useState(!1),h=A1(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),k={width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},m=A1(n.child,d&&n.childLeaving,r&&n.childPulsate);return!s&&!d&&f(!0),p.useEffect(()=>{if(!s&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,s,c]),u.jsx("span",{className:h,style:k,children:u.jsx("span",{className:m})})}const jl=Xe("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),ce=jl,Gl=["center","classes","className"];let gn=e=>e,Ti,Li,Ri,Fi;const mr=550,Pl=80,Ml=Kr(Ti||(Ti=gn` 0% { transform: scale(0); opacity: 0.1; @@ -386,7 +386,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: 65px; right: 55px; z-index: 100; -`,sm=()=>{const e=p.useContext(O3);return e==null?void 0:e.socket},lm={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},cm=mn(e=>({...lm,setAskedQuestion:t=>e(n=>({askedQuestions:[...n.askedQuestions||[],t],hasQuestionInProgress:!0})),setAskedQuestionAnswer:t=>e(n=>({askedQuestionsAnswers:[...n.askedQuestionsAnswers||[],t],hasQuestionInProgress:!1})),setHasQuestionInProgress:t=>e({hasQuestionInProgress:t}),setHasTeachingInProgress:t=>e({hasTeachingInProgress:t}),setHasInstagraphInProgress:t=>e({hasInstagraphInProgress:t}),setTeachMeAnswer:t=>e({hasTeachingInProgress:!1,teachMeAnswer:t}),setInstagraphAnswer:t=>{var n,r,i,o;(n=t==null?void 0:t.instagraph)!=null&&n.edges&&((r=t==null?void 0:t.instagraph)!=null&&r.nodes)&&e({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(i=t==null?void 0:t.instagraph)==null?void 0:i.edges,nodes:(o=t==null?void 0:t.instagraph)==null?void 0:o.nodes}})}})),um="0.1.106",dm=p.lazy(()=>W1(()=>import("./index-bd732748.js"),["assets/index-bd732748.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/ClipLoader-e049ef5e.js","assets/index.esm-86c83cdb.js","assets/index-d70b7e8e.js","assets/index-e780f823.js","assets/Tabs-b82c05ad.js","assets/createSvgIcon-7c6eee06.js"]).then(({SettingsModal:e})=>({default:e}))),fm=p.lazy(()=>W1(()=>import("./index-f27ea18e.js"),["assets/index-f27ea18e.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/index-d70b7e8e.js","assets/index.esm-86c83cdb.js","assets/ClipLoader-e049ef5e.js","assets/index-e780f823.js"]).then(({AddContentModal:e})=>({default:e}))),hm=p.lazy(()=>W1(()=>import("./index-ff6c14e9.js"),["assets/index-ff6c14e9.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/index-d70b7e8e.js","assets/index.esm-86c83cdb.js","assets/ClipLoader-e049ef5e.js","assets/constants-b2a2fa82.js","assets/index-28e22657.js","assets/three.module-52004ab8.js","assets/index-e780f823.js","assets/index-49403f56.js","assets/Stack-57ab9e76.js","assets/createSvgIcon-7c6eee06.js","assets/TextareaAutosize-6f8daf3f.js","assets/index-64f1c910.js"]).then(({AddItemModal:e})=>({default:e}))),pm=p.lazy(()=>W1(()=>import("./index-a7628b9d.js"),["assets/index-a7628b9d.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/constants-a86c243d.js","assets/ClipLoader-e049ef5e.js","assets/index.esm-86c83cdb.js","assets/index-49403f56.js","assets/Stack-57ab9e76.js","assets/createSvgIcon-7c6eee06.js","assets/TextareaAutosize-6f8daf3f.js","assets/index-e780f823.js","assets/index-e0a45087.js","assets/constants-b2a2fa82.js","assets/Typography-543ae8c6.js","assets/Tabs-b82c05ad.js"]).then(({SourcesTableModal:e})=>({default:e}))),mm=p.lazy(()=>W1(()=>import("./index-b853c371.js"),["assets/index-b853c371.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/index-e780f823.js","assets/index.esm-86c83cdb.js","assets/Skeleton-224a4953.js","assets/ClipLoader-e049ef5e.js"]).then(({EditNodeNameModal:e})=>({default:e}))),xm=p.lazy(()=>W1(()=>import("./index-6c23b30f.js"),["assets/index-6c23b30f.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/Skeleton-224a4953.js","assets/ClipLoader-e049ef5e.js"]).then(({RemoveNodeModal:e})=>({default:e}))),km=p.lazy(()=>W1(()=>import("./index-6eefb34c.js"),["assets/index-6eefb34c.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/index-49403f56.js","assets/Stack-57ab9e76.js","assets/createSvgIcon-7c6eee06.js","assets/TextareaAutosize-6f8daf3f.js","assets/constants-b2a2fa82.js","assets/constants-a86c243d.js","assets/ClipLoader-e049ef5e.js"]).then(({AddNodeEdgeModal:e})=>({default:e}))),gm=p.lazy(()=>W1(()=>import("./index-f19bc108.js"),["assets/index-f19bc108.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/index-e0a45087.js","assets/constants-a86c243d.js","assets/constants-b2a2fa82.js","assets/index-49403f56.js","assets/Stack-57ab9e76.js","assets/createSvgIcon-7c6eee06.js","assets/TextareaAutosize-6f8daf3f.js","assets/ClipLoader-e049ef5e.js"]).then(({MergeNodeModal:e})=>({default:e}))),Cm=p.lazy(()=>W1(()=>import("./index-a579da74.js"),["assets/index-a579da74.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/index-e780f823.js","assets/index.esm-86c83cdb.js","assets/index-28e22657.js","assets/three.module-52004ab8.js","assets/constants-b2a2fa82.js","assets/ClipLoader-e049ef5e.js","assets/index-49403f56.js","assets/Stack-57ab9e76.js","assets/createSvgIcon-7c6eee06.js","assets/TextareaAutosize-6f8daf3f.js","assets/index-64f1c910.js"]).then(({ChangeNodeTypeModal:e})=>({default:e}))),ym=p.lazy(()=>W1(()=>import("./index-0614cd43.js"),["assets/index-0614cd43.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/constants-b2a2fa82.js","assets/index-e780f823.js","assets/index.esm-86c83cdb.js","assets/index-49403f56.js","assets/Stack-57ab9e76.js","assets/createSvgIcon-7c6eee06.js","assets/TextareaAutosize-6f8daf3f.js","assets/ClipLoader-e049ef5e.js","assets/map-85d405d6.js","assets/Typography-543ae8c6.js","assets/Tabs-b82c05ad.js","assets/index-28e22657.js","assets/three.module-52004ab8.js","assets/index-47786f03.js"]).then(({BlueprintModal:e})=>({default:e}))),bm=p.lazy(()=>W1(()=>import("./index-6f865e1f.js"),["assets/index-6f865e1f.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/index-d70b7e8e.js","assets/index.esm-86c83cdb.js","assets/index-e780f823.js"]).then(({UserFeedBackModal:e})=>({default:e}))),vm=p.lazy(()=>W1(()=>import("./index-8bf7fe7b.js"),["assets/index-8bf7fe7b.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-23519643.js","assets/index-d70b7e8e.js","assets/index.esm-86c83cdb.js","assets/index-49403f56.js","assets/Stack-57ab9e76.js","assets/createSvgIcon-7c6eee06.js","assets/TextareaAutosize-6f8daf3f.js","assets/index-e780f823.js"]).then(({CreateBountyModal:e})=>({default:e}))),wm=()=>u.jsxs(u.Fragment,{children:[u.jsx(hm,{}),u.jsx(fm,{}),u.jsx(dm,{}),u.jsx(mm,{}),u.jsx(xm,{}),u.jsx(pm,{}),u.jsx(km,{}),u.jsx(Cm,{}),u.jsx(ym,{}),u.jsx(gm,{}),u.jsx(bm,{}),u.jsx(vm,{})]}),w3=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"info",children:[u.jsx("mask",{id:"mask0_2682_970",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_2682_970)",children:u.jsx("path",{id:"info_2",d:"M7.99992 11.3334C8.18881 11.3334 8.34714 11.2695 8.47492 11.1417C8.6027 11.0139 8.66658 10.8556 8.66658 10.6667V8.00004C8.66658 7.81115 8.6027 7.65282 8.47492 7.52504C8.34714 7.39726 8.18881 7.33337 7.99992 7.33337C7.81103 7.33337 7.6527 7.39726 7.52492 7.52504C7.39714 7.65282 7.33325 7.81115 7.33325 8.00004V10.6667C7.33325 10.8556 7.39714 11.0139 7.52492 11.1417C7.6527 11.2695 7.81103 11.3334 7.99992 11.3334ZM7.99992 6.00004C8.18881 6.00004 8.34714 5.93615 8.47492 5.80837C8.6027 5.6806 8.66658 5.52226 8.66658 5.33337C8.66658 5.14448 8.6027 4.98615 8.47492 4.85837C8.34714 4.7306 8.18881 4.66671 7.99992 4.66671C7.81103 4.66671 7.6527 4.7306 7.52492 4.85837C7.39714 4.98615 7.33325 5.14448 7.33325 5.33337C7.33325 5.52226 7.39714 5.6806 7.52492 5.80837C7.6527 5.93615 7.81103 6.00004 7.99992 6.00004ZM7.99992 14.6667C7.0777 14.6667 6.21103 14.4917 5.39992 14.1417C4.58881 13.7917 3.88325 13.3167 3.28325 12.7167C2.68325 12.1167 2.20825 11.4112 1.85825 10.6C1.50825 9.78893 1.33325 8.92226 1.33325 8.00004C1.33325 7.07782 1.50825 6.21115 1.85825 5.40004C2.20825 4.58893 2.68325 3.88337 3.28325 3.28337C3.88325 2.68337 4.58881 2.20837 5.39992 1.85837C6.21103 1.50837 7.0777 1.33337 7.99992 1.33337C8.92214 1.33337 9.78881 1.50837 10.5999 1.85837C11.411 2.20837 12.1166 2.68337 12.7166 3.28337C13.3166 3.88337 13.7916 4.58893 14.1416 5.40004C14.4916 6.21115 14.6666 7.07782 14.6666 8.00004C14.6666 8.92226 14.4916 9.78893 14.1416 10.6C13.7916 11.4112 13.3166 12.1167 12.7166 12.7167C12.1166 13.3167 11.411 13.7917 10.5999 14.1417C9.78881 14.4917 8.92214 14.6667 7.99992 14.6667ZM7.99992 13.3334C9.48881 13.3334 10.7499 12.8167 11.7833 11.7834C12.8166 10.75 13.3333 9.48893 13.3333 8.00004C13.3333 6.51115 12.8166 5.25004 11.7833 4.21671C10.7499 3.18337 9.48881 2.66671 7.99992 2.66671C6.51103 2.66671 5.24992 3.18337 4.21659 4.21671C3.18325 5.25004 2.66659 6.51115 2.66659 8.00004C2.66659 9.48893 3.18325 10.75 4.21659 11.7834C5.24992 12.8167 6.51103 13.3334 7.99992 13.3334Z",fill:"currentColor"})})]})}),Em=()=>{const[e,t]=p.useState(null),{runningProjectMessages:n}=Je(s=>s),r=s=>{t(s.currentTarget)},i=()=>{t(null)},o=!!e,a=o?"simple-popover":void 0;return n.length?u.jsxs(Sm,{ml:8,children:[u.jsx(Am,{onClick:r,children:u.jsxs(fn,{content:"Messages",margin:"18px",children:[u.jsx("div",{className:"icon",children:u.jsx(w3,{})}),u.jsx("div",{className:"text",children:u.jsx("p",{children:n.length})})]})}),u.jsxs(Vm,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:a,onClose:i,open:o,children:[u.jsx(E3,{onClick:i,children:u.jsx(Dn,{})}),u.jsx(_m,{p:16,children:n.map(s=>u.jsx("p",{className:"item",children:s},s))})]})]}):null},Sm=l1(s1).attrs({align:"center",direction:"row",grow:0,justify:"flex-start"})``,_m=l1(s1)` +`,sm=()=>{const e=p.useContext(O3);return e==null?void 0:e.socket},lm={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},cm=mn(e=>({...lm,setAskedQuestion:t=>e(n=>({askedQuestions:[...n.askedQuestions||[],t],hasQuestionInProgress:!0})),setAskedQuestionAnswer:t=>e(n=>({askedQuestionsAnswers:[...n.askedQuestionsAnswers||[],t],hasQuestionInProgress:!1})),setHasQuestionInProgress:t=>e({hasQuestionInProgress:t}),setHasTeachingInProgress:t=>e({hasTeachingInProgress:t}),setHasInstagraphInProgress:t=>e({hasInstagraphInProgress:t}),setTeachMeAnswer:t=>e({hasTeachingInProgress:!1,teachMeAnswer:t}),setInstagraphAnswer:t=>{var n,r,i,o;(n=t==null?void 0:t.instagraph)!=null&&n.edges&&((r=t==null?void 0:t.instagraph)!=null&&r.nodes)&&e({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(i=t==null?void 0:t.instagraph)==null?void 0:i.edges,nodes:(o=t==null?void 0:t.instagraph)==null?void 0:o.nodes}})}})),um="0.1.106",dm=p.lazy(()=>W1(()=>import("./index-3da7ddbb.js"),["assets/index-3da7ddbb.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/ClipLoader-83661b90.js","assets/index.esm-c2a09dd4.js","assets/index-fabd940a.js","assets/index-37507caf.js","assets/Tabs-88a6cc23.js","assets/createSvgIcon-ed559792.js"]).then(({SettingsModal:e})=>({default:e}))),fm=p.lazy(()=>W1(()=>import("./index-08b74e7f.js"),["assets/index-08b74e7f.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/index-fabd940a.js","assets/index.esm-c2a09dd4.js","assets/ClipLoader-83661b90.js","assets/index-37507caf.js"]).then(({AddContentModal:e})=>({default:e}))),hm=p.lazy(()=>W1(()=>import("./index-3c28967c.js"),["assets/index-3c28967c.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/index-fabd940a.js","assets/index.esm-c2a09dd4.js","assets/ClipLoader-83661b90.js","assets/constants-b2a2fa82.js","assets/index-28e22657.js","assets/three.module-52004ab8.js","assets/index-37507caf.js","assets/index-c61dca86.js","assets/Stack-e0f879a7.js","assets/createSvgIcon-ed559792.js","assets/TextareaAutosize-981375ed.js","assets/index-64f1c910.js"]).then(({AddItemModal:e})=>({default:e}))),pm=p.lazy(()=>W1(()=>import("./index-4cf4c70d.js"),["assets/index-4cf4c70d.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/constants-011d5486.js","assets/ClipLoader-83661b90.js","assets/index.esm-c2a09dd4.js","assets/index-c61dca86.js","assets/Stack-e0f879a7.js","assets/createSvgIcon-ed559792.js","assets/TextareaAutosize-981375ed.js","assets/index-37507caf.js","assets/index-deba249f.js","assets/constants-b2a2fa82.js","assets/Typography-69404db2.js","assets/Tabs-88a6cc23.js"]).then(({SourcesTableModal:e})=>({default:e}))),mm=p.lazy(()=>W1(()=>import("./index-13864691.js"),["assets/index-13864691.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/index-37507caf.js","assets/index.esm-c2a09dd4.js","assets/Skeleton-bddda4d0.js","assets/ClipLoader-83661b90.js"]).then(({EditNodeNameModal:e})=>({default:e}))),xm=p.lazy(()=>W1(()=>import("./index-3cc1f890.js"),["assets/index-3cc1f890.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/Skeleton-bddda4d0.js","assets/ClipLoader-83661b90.js"]).then(({RemoveNodeModal:e})=>({default:e}))),km=p.lazy(()=>W1(()=>import("./index-9de094c9.js"),["assets/index-9de094c9.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/index-c61dca86.js","assets/Stack-e0f879a7.js","assets/createSvgIcon-ed559792.js","assets/TextareaAutosize-981375ed.js","assets/constants-b2a2fa82.js","assets/constants-011d5486.js","assets/ClipLoader-83661b90.js"]).then(({AddNodeEdgeModal:e})=>({default:e}))),gm=p.lazy(()=>W1(()=>import("./index-5d2fab8a.js"),["assets/index-5d2fab8a.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/index-deba249f.js","assets/constants-011d5486.js","assets/constants-b2a2fa82.js","assets/index-c61dca86.js","assets/Stack-e0f879a7.js","assets/createSvgIcon-ed559792.js","assets/TextareaAutosize-981375ed.js","assets/ClipLoader-83661b90.js"]).then(({MergeNodeModal:e})=>({default:e}))),Cm=p.lazy(()=>W1(()=>import("./index-3e02ddf4.js"),["assets/index-3e02ddf4.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/index-37507caf.js","assets/index.esm-c2a09dd4.js","assets/index-28e22657.js","assets/three.module-52004ab8.js","assets/constants-b2a2fa82.js","assets/ClipLoader-83661b90.js","assets/index-c61dca86.js","assets/Stack-e0f879a7.js","assets/createSvgIcon-ed559792.js","assets/TextareaAutosize-981375ed.js","assets/index-64f1c910.js"]).then(({ChangeNodeTypeModal:e})=>({default:e}))),ym=p.lazy(()=>W1(()=>import("./index-9cbc5f11.js"),["assets/index-9cbc5f11.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/constants-b2a2fa82.js","assets/index-37507caf.js","assets/index.esm-c2a09dd4.js","assets/index-c61dca86.js","assets/Stack-e0f879a7.js","assets/createSvgIcon-ed559792.js","assets/TextareaAutosize-981375ed.js","assets/ClipLoader-83661b90.js","assets/map-e077fe83.js","assets/Typography-69404db2.js","assets/Tabs-88a6cc23.js","assets/index-28e22657.js","assets/three.module-52004ab8.js","assets/index-680a4e6b.js"]).then(({BlueprintModal:e})=>({default:e}))),bm=p.lazy(()=>W1(()=>import("./index-795f4525.js"),["assets/index-795f4525.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/index-fabd940a.js","assets/index.esm-c2a09dd4.js","assets/index-37507caf.js"]).then(({UserFeedBackModal:e})=>({default:e}))),vm=p.lazy(()=>W1(()=>import("./index-7ec3eb9b.js"),["assets/index-7ec3eb9b.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-8264b104.js","assets/index-fabd940a.js","assets/index.esm-c2a09dd4.js","assets/index-c61dca86.js","assets/Stack-e0f879a7.js","assets/createSvgIcon-ed559792.js","assets/TextareaAutosize-981375ed.js","assets/index-37507caf.js"]).then(({CreateBountyModal:e})=>({default:e}))),wm=()=>u.jsxs(u.Fragment,{children:[u.jsx(hm,{}),u.jsx(fm,{}),u.jsx(dm,{}),u.jsx(mm,{}),u.jsx(xm,{}),u.jsx(pm,{}),u.jsx(km,{}),u.jsx(Cm,{}),u.jsx(ym,{}),u.jsx(gm,{}),u.jsx(bm,{}),u.jsx(vm,{})]}),w3=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"info",children:[u.jsx("mask",{id:"mask0_2682_970",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_2682_970)",children:u.jsx("path",{id:"info_2",d:"M7.99992 11.3334C8.18881 11.3334 8.34714 11.2695 8.47492 11.1417C8.6027 11.0139 8.66658 10.8556 8.66658 10.6667V8.00004C8.66658 7.81115 8.6027 7.65282 8.47492 7.52504C8.34714 7.39726 8.18881 7.33337 7.99992 7.33337C7.81103 7.33337 7.6527 7.39726 7.52492 7.52504C7.39714 7.65282 7.33325 7.81115 7.33325 8.00004V10.6667C7.33325 10.8556 7.39714 11.0139 7.52492 11.1417C7.6527 11.2695 7.81103 11.3334 7.99992 11.3334ZM7.99992 6.00004C8.18881 6.00004 8.34714 5.93615 8.47492 5.80837C8.6027 5.6806 8.66658 5.52226 8.66658 5.33337C8.66658 5.14448 8.6027 4.98615 8.47492 4.85837C8.34714 4.7306 8.18881 4.66671 7.99992 4.66671C7.81103 4.66671 7.6527 4.7306 7.52492 4.85837C7.39714 4.98615 7.33325 5.14448 7.33325 5.33337C7.33325 5.52226 7.39714 5.6806 7.52492 5.80837C7.6527 5.93615 7.81103 6.00004 7.99992 6.00004ZM7.99992 14.6667C7.0777 14.6667 6.21103 14.4917 5.39992 14.1417C4.58881 13.7917 3.88325 13.3167 3.28325 12.7167C2.68325 12.1167 2.20825 11.4112 1.85825 10.6C1.50825 9.78893 1.33325 8.92226 1.33325 8.00004C1.33325 7.07782 1.50825 6.21115 1.85825 5.40004C2.20825 4.58893 2.68325 3.88337 3.28325 3.28337C3.88325 2.68337 4.58881 2.20837 5.39992 1.85837C6.21103 1.50837 7.0777 1.33337 7.99992 1.33337C8.92214 1.33337 9.78881 1.50837 10.5999 1.85837C11.411 2.20837 12.1166 2.68337 12.7166 3.28337C13.3166 3.88337 13.7916 4.58893 14.1416 5.40004C14.4916 6.21115 14.6666 7.07782 14.6666 8.00004C14.6666 8.92226 14.4916 9.78893 14.1416 10.6C13.7916 11.4112 13.3166 12.1167 12.7166 12.7167C12.1166 13.3167 11.411 13.7917 10.5999 14.1417C9.78881 14.4917 8.92214 14.6667 7.99992 14.6667ZM7.99992 13.3334C9.48881 13.3334 10.7499 12.8167 11.7833 11.7834C12.8166 10.75 13.3333 9.48893 13.3333 8.00004C13.3333 6.51115 12.8166 5.25004 11.7833 4.21671C10.7499 3.18337 9.48881 2.66671 7.99992 2.66671C6.51103 2.66671 5.24992 3.18337 4.21659 4.21671C3.18325 5.25004 2.66659 6.51115 2.66659 8.00004C2.66659 9.48893 3.18325 10.75 4.21659 11.7834C5.24992 12.8167 6.51103 13.3334 7.99992 13.3334Z",fill:"currentColor"})})]})}),Em=()=>{const[e,t]=p.useState(null),{runningProjectMessages:n}=Je(s=>s),r=s=>{t(s.currentTarget)},i=()=>{t(null)},o=!!e,a=o?"simple-popover":void 0;return n.length?u.jsxs(Sm,{ml:8,children:[u.jsx(Am,{onClick:r,children:u.jsxs(fn,{content:"Messages",margin:"18px",children:[u.jsx("div",{className:"icon",children:u.jsx(w3,{})}),u.jsx("div",{className:"text",children:u.jsx("p",{children:n.length})})]})}),u.jsxs(Vm,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:a,onClose:i,open:o,children:[u.jsx(E3,{onClick:i,children:u.jsx(Dn,{})}),u.jsx(_m,{p:16,children:n.map(s=>u.jsx("p",{className:"item",children:s},s))})]})]}):null},Sm=l1(s1).attrs({align:"center",direction:"row",grow:0,justify:"flex-start"})``,_m=l1(s1)` max-height: 50vh; max-width: 30vw; background: transparent; @@ -696,4 +696,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho color: ${X.white}; font-size: 12px; opacity: 0.5; -`,kg=p.lazy(()=>W1(()=>import("./index-1a6ba924.js"),["assets/index-1a6ba924.js","assets/index-69dca385.js","assets/index-a2878e02.css"]).then(({MainToolbar:e})=>({default:e}))),gg=p.lazy(()=>W1(()=>import("./index-7d2b0c32.js"),["assets/index-7d2b0c32.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/index-47786f03.js","assets/three.module-52004ab8.js","assets/TextareaAutosize-6f8daf3f.js","assets/index.esm-86c83cdb.js","assets/index-f0d2a829.js","assets/ClipLoader-e049ef5e.js"]).then(({Universe:e})=>({default:e}))),Cg=p.lazy(()=>W1(()=>import("./index-4cad102d.js").then(e=>e.i),["assets/index-4cad102d.js","assets/index-69dca385.js","assets/index-a2878e02.css","assets/ClipLoader-e049ef5e.js","assets/Skeleton-224a4953.js","assets/Stack-57ab9e76.js","assets/map-85d405d6.js","assets/Typography-543ae8c6.js","assets/createSvgIcon-7c6eee06.js","assets/index-23519643.js","assets/index-f0d2a829.js","assets/index.esm-86c83cdb.js"]).then(({SideBar:e})=>({default:e}))),yg=()=>{const[e]=K3(),t=e.get("q"),{setBudget:n,setNodeCount:r}=qr(N=>N),i=p.useRef(null),o=p.useRef(null),{setSidebarOpen:a,currentSearch:s,setCurrentSearch:l,setRelevanceSelected:c,setTranscriptOpen:d,universeQuestionIsOpen:f,setUniverseQuestionIsOpen:h}=xn(N=>N),k=cm(N=>N.setTeachMeAnswer),{fetchData:m,setCategoryFilter:g,setAbortRequests:y,addNewNode:x,splashDataLoading:C,runningProjectId:b,setRunningProjectMessages:S,isFetching:w}=Je(N=>N),{setAiSummaryAnswer:E,getKeyExist:_,aiRefId:V}=Oa(N=>N),P=$i(),[$,T]=q3(N=>[N.realtimeGraphFeatureFlag,N.chatInterfaceFeatureFlag]),D=sm(),O=lh({mode:"onChange"}),{setValue:M}=O;p.useEffect(()=>{M("search",t??""),d(!1),P(null),c(!1),l(t??""),k(""),g(null)},[t,g,l,c,P,k,d,M]),p.useEffect(()=>{(async()=>{await m(n,y),a(!0),s?await X3(n):P(null)})()},[s,m,n,y,a,P]);const R=p.useCallback(()=>{r("INCREMENT")},[r]),F=p.useCallback(N=>{w||(i.current||(i.current={nodes:[],edges:[]}),N.edges&&i.current.edges.push(...N.edges),N.nodes&&i.current.nodes.push(...N.nodes),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{const e1={...i.current};i.current={nodes:[],edges:[]},x(e1)},3e3))},[x,w]),H=p.useCallback(N=>{N.ref_id&&E(N.ref_id,{answer:N.answer,answerLoading:!1})},[E]),Z=p.useCallback(N=>{N.ref_id&&E(N.ref_id,{audio_en:N.audio_EN})},[E]),q=p.useCallback(N=>{N.ref_id&&E(N.ref_id,{questions:N.relevant_questions.map(e1=>e1.question),questionsLoading:!1})},[E]),i1=p.useCallback(N=>{N.ref_id&&E(N.ref_id,{sources:N.sources.map(e1=>e1.ref_id),sourcesLoading:!1})},[E]),Q=p.useCallback(N=>{N.question&&_(V)&&E(V,{answerLoading:!1,entities:N.entities})},[E,_,V]);return p.useEffect(()=>(D&&(D.connect(),D.on("connect_error",N=>{console.error("Socket connection error:",N)}),D.on("newnode",R),T&&D.on("extractedentitieshook",Q),T&&D.on("askquestionhook",H),T&&D.on("relevantquestionshook",q),T&&D.on("answersourceshook",i1),$&&D.on("new_node_created",F),T&&D.on("answeraudiohook",Z)),()=>{D&&D.off()}),[D,R,F,$,H,T,q,i1,Q,Z]),p.useEffect(()=>{if(!b)return;const N=new WebSocket("wss://jobs.stakwork.com/cable?channel=ProjectLogChannel");N.onopen=()=>{let e1="a";e1=b;const t1={command:"subscribe",identifier:JSON.stringify({channel:"ProjectLogChannel",id:e1})};N.send(JSON.stringify(t1))},N.onmessage=e1=>{var c1;console.log("Message from server:",e1.data);const t1=JSON.parse(e1.data);if(t1.type==="ping")return;const n1=(c1=t1==null?void 0:t1.message)==null?void 0:c1.message;n1&&S(n1)},N.onerror=e1=>{console.error("WebSocket error:",e1)},N.onclose=()=>{console.log("WebSocket connection closed")}},[b,S]),p.useEffect(()=>{C||h()},[h,C]),u.jsxs(u.Fragment,{children:[u.jsx(ch,{}),u.jsx(eg,{}),u.jsx(I2,{hidden:!Y3||!0,isRoot:!0}),u.jsx(p.Suspense,{fallback:u.jsx("div",{children:"Loading..."}),children:C?null:u.jsxs(mg,{direction:"row",children:[u.jsxs(Wf,{...O,children:[u.jsx(kg,{}),!f&&u.jsx(Cg,{}),u.jsx(gg,{}),u.jsx(im,{}),u.jsx(qk,{}),u.jsxs(xg,{children:["v",um]}),u.jsx(v3,{})]}),u.jsx(wm,{}),u.jsx(pg,{})]})})]})},Mg=Object.freeze(Object.defineProperty({__proto__:null,App:yg},Symbol.toStringTag,{value:"Module"}));export{_n as $,Km as A,ii as B,o3 as C,Sx as D,Tx as E,Rx as F,S0 as G,Yx as H,Ik as I,we as J,Ya as K,st as L,ek as M,_3 as N,im as O,g1 as P,Ua as Q,al as R,Bk as S,Xp as T,Za as U,It as V,qa as W,Ht as X,R5 as Y,nc as Z,I0 as _,Zm as a,jg as a$,lh as a0,Wf as a1,vk as a2,$k as a3,ix as a4,Jx as a5,Ux as a6,qx as a7,$i as a8,Dk as a9,ol as aA,rk as aB,Ok as aC,Nx as aD,Mx as aE,xx as aF,fx as aG,hx as aH,Vp as aI,a3 as aJ,s3 as aK,Q3 as aL,yx as aM,Fx as aN,Bl as aO,ik as aP,Ix as aQ,tx as aR,hk as aS,fk as aT,Mk as aU,Fk as aV,Rk as aW,Ak as aX,jx as aY,$x as aZ,_x as a_,px as aa,dx as ab,J3 as ac,Xm as ad,qm as ae,Ym as af,Jm as ag,cx as ah,Dn as ai,ox as aj,Dx as ak,C3 as al,Vk as am,i3 as an,mk as ao,Ek as ap,y3 as aq,Kx as ar,yk as as,bk as at,ok as au,bx as av,Ka as aw,gk as ax,w3 as ay,Fp as az,Sk as b,S4 as b0,Lx as b1,wx as b2,vg as b3,Wa as b4,Gk as b5,ur as b6,ml as b7,U5 as b8,pc as b9,y1 as ba,z as bb,$g as bc,Mg as bd,ex as c,Dg as d,x3 as e,m0 as f,fh as g,Pg as h,b3 as i,Ep as j,or as k,wa as l,Sp as m,cp as n,Gg as o,tk as p,Um as q,dk as r,Bx as s,W5 as t,$m as u,Bg as v,el as w,pl as x,Pe as y,dr as z}; +`,kg=p.lazy(()=>W1(()=>import("./index-80f4a8b1.js"),["assets/index-80f4a8b1.js","assets/index-b856be88.js","assets/index-a2878e02.css"]).then(({MainToolbar:e})=>({default:e}))),gg=p.lazy(()=>W1(()=>import("./index-f7131056.js"),["assets/index-f7131056.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/index-680a4e6b.js","assets/three.module-52004ab8.js","assets/TextareaAutosize-981375ed.js","assets/index.esm-c2a09dd4.js","assets/index-bf6ce8a9.js","assets/ClipLoader-83661b90.js"]).then(({Universe:e})=>({default:e}))),Cg=p.lazy(()=>W1(()=>import("./index-bd90392c.js").then(e=>e.i),["assets/index-bd90392c.js","assets/index-b856be88.js","assets/index-a2878e02.css","assets/ClipLoader-83661b90.js","assets/Skeleton-bddda4d0.js","assets/Stack-e0f879a7.js","assets/map-e077fe83.js","assets/Typography-69404db2.js","assets/createSvgIcon-ed559792.js","assets/index-8264b104.js","assets/index-bf6ce8a9.js","assets/index.esm-c2a09dd4.js"]).then(({SideBar:e})=>({default:e}))),yg=()=>{const[e]=K3(),t=e.get("q"),{setBudget:n,setNodeCount:r}=qr(N=>N),i=p.useRef(null),o=p.useRef(null),{setSidebarOpen:a,currentSearch:s,setCurrentSearch:l,setRelevanceSelected:c,setTranscriptOpen:d,universeQuestionIsOpen:f,setUniverseQuestionIsOpen:h}=xn(N=>N),k=cm(N=>N.setTeachMeAnswer),{fetchData:m,setCategoryFilter:g,setAbortRequests:y,addNewNode:x,splashDataLoading:C,runningProjectId:b,setRunningProjectMessages:S,isFetching:w}=Je(N=>N),{setAiSummaryAnswer:E,getKeyExist:_,aiRefId:V}=Oa(N=>N),P=$i(),[$,T]=q3(N=>[N.realtimeGraphFeatureFlag,N.chatInterfaceFeatureFlag]),D=sm(),O=lh({mode:"onChange"}),{setValue:M}=O;p.useEffect(()=>{M("search",t??""),d(!1),P(null),c(!1),l(t??""),k(""),g(null)},[t,g,l,c,P,k,d,M]),p.useEffect(()=>{(async()=>{await m(n,y),a(!0),s?await X3(n):P(null)})()},[s,m,n,y,a,P]);const R=p.useCallback(()=>{r("INCREMENT")},[r]),F=p.useCallback(N=>{w||(i.current||(i.current={nodes:[],edges:[]}),N.edges&&i.current.edges.push(...N.edges),N.nodes&&i.current.nodes.push(...N.nodes),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{const e1={...i.current};i.current={nodes:[],edges:[]},x(e1)},3e3))},[x,w]),H=p.useCallback(N=>{N.ref_id&&E(N.ref_id,{answer:N.answer,answerLoading:!1})},[E]),Z=p.useCallback(N=>{N.ref_id&&E(N.ref_id,{audio_en:N.audio_EN})},[E]),q=p.useCallback(N=>{N.ref_id&&E(N.ref_id,{questions:N.relevant_questions.map(e1=>e1.question),questionsLoading:!1})},[E]),i1=p.useCallback(N=>{N.ref_id&&E(N.ref_id,{sources:N.sources.map(e1=>e1.ref_id),sourcesLoading:!1})},[E]),Q=p.useCallback(N=>{N.question&&_(V)&&E(V,{answerLoading:!1,entities:N.entities})},[E,_,V]);return p.useEffect(()=>(D&&(D.connect(),D.on("connect_error",N=>{console.error("Socket connection error:",N)}),D.on("newnode",R),T&&D.on("extractedentitieshook",Q),T&&D.on("askquestionhook",H),T&&D.on("relevantquestionshook",q),T&&D.on("answersourceshook",i1),$&&D.on("new_node_created",F),T&&D.on("answeraudiohook",Z)),()=>{D&&D.off()}),[D,R,F,$,H,T,q,i1,Q,Z]),p.useEffect(()=>{if(!b)return;const N=new WebSocket("wss://jobs.stakwork.com/cable?channel=ProjectLogChannel");N.onopen=()=>{let e1="a";e1=b;const t1={command:"subscribe",identifier:JSON.stringify({channel:"ProjectLogChannel",id:e1})};N.send(JSON.stringify(t1))},N.onmessage=e1=>{var c1;console.log("Message from server:",e1.data);const t1=JSON.parse(e1.data);if(t1.type==="ping")return;const n1=(c1=t1==null?void 0:t1.message)==null?void 0:c1.message;n1&&S(n1)},N.onerror=e1=>{console.error("WebSocket error:",e1)},N.onclose=()=>{console.log("WebSocket connection closed")}},[b,S]),p.useEffect(()=>{C||h()},[h,C]),u.jsxs(u.Fragment,{children:[u.jsx(ch,{}),u.jsx(eg,{}),u.jsx(I2,{hidden:!Y3||!0,isRoot:!0}),u.jsx(p.Suspense,{fallback:u.jsx("div",{children:"Loading..."}),children:C?null:u.jsxs(mg,{direction:"row",children:[u.jsxs(Wf,{...O,children:[u.jsx(kg,{}),!f&&u.jsx(Cg,{}),u.jsx(gg,{}),u.jsx(im,{}),u.jsx(qk,{}),u.jsxs(xg,{children:["v",um]}),u.jsx(v3,{})]}),u.jsx(wm,{}),u.jsx(pg,{})]})})]})},Mg=Object.freeze(Object.defineProperty({__proto__:null,App:yg},Symbol.toStringTag,{value:"Module"}));export{_n as $,Km as A,ii as B,o3 as C,Sx as D,Tx as E,Rx as F,S0 as G,Yx as H,Ik as I,we as J,Ya as K,st as L,ek as M,_3 as N,im as O,g1 as P,Ua as Q,al as R,Bk as S,Xp as T,Za as U,It as V,qa as W,Ht as X,R5 as Y,nc as Z,I0 as _,Zm as a,jg as a$,lh as a0,Wf as a1,vk as a2,$k as a3,ix as a4,Jx as a5,Ux as a6,qx as a7,$i as a8,Dk as a9,ol as aA,rk as aB,Ok as aC,Nx as aD,Mx as aE,xx as aF,fx as aG,hx as aH,Vp as aI,a3 as aJ,s3 as aK,Q3 as aL,yx as aM,Fx as aN,Bl as aO,ik as aP,Ix as aQ,tx as aR,hk as aS,fk as aT,Mk as aU,Fk as aV,Rk as aW,Ak as aX,jx as aY,$x as aZ,_x as a_,px as aa,dx as ab,J3 as ac,Xm as ad,qm as ae,Ym as af,Jm as ag,cx as ah,Dn as ai,ox as aj,Dx as ak,C3 as al,Vk as am,i3 as an,mk as ao,Ek as ap,y3 as aq,Kx as ar,yk as as,bk as at,ok as au,bx as av,Ka as aw,gk as ax,w3 as ay,Fp as az,Sk as b,S4 as b0,Lx as b1,wx as b2,vg as b3,Wa as b4,Gk as b5,ur as b6,ml as b7,U5 as b8,pc as b9,y1 as ba,z as bb,$g as bc,Mg as bd,ex as c,Dg as d,x3 as e,m0 as f,fh as g,Pg as h,b3 as i,Ep as j,or as k,wa as l,Sp as m,cp as n,Gg as o,tk as p,Um as q,dk as r,Bx as s,W5 as t,$m as u,Bg as v,el as w,pl as x,Pe as y,dr as z}; diff --git a/build/assets/index-49403f56.js b/build/assets/index-c61dca86.js similarity index 99% rename from build/assets/index-49403f56.js rename to build/assets/index-c61dca86.js index d70e66938..d4cc5a69c 100644 --- a/build/assets/index-49403f56.js +++ b/build/assets/index-c61dca86.js @@ -1,4 +1,4 @@ -import{r as u,j as f,bq as kt,br as Rt,b as a,c as ye,d as $e,s as L,i as w,u as Pe,_ as ae,f as ne,h as Ie,e as Re,bs as Ot,bt as wt,bu as st,k as it,b0 as ct,n as Xe,bv as To,m as Lt,a4 as Mt,t as Ft,v as je,F as Tt}from"./index-69dca385.js";import{G as xo,b6 as At,y as lo,b4 as Uo,z as dt,W as Ho,aw as ut,aO as pt,b7 as Nt,J as Fo,t as zt,b8 as Dt,X as Vo,T as Et}from"./index-94c3c981.js";import{a as Ao,u as fo,b as so,f as io,i as ft,c as Bt,P as No,F as jt,S as Wt}from"./Stack-57ab9e76.js";import{c as zo}from"./createSvgIcon-7c6eee06.js";import{T as _t}from"./TextareaAutosize-6f8daf3f.js";const Ut=e=>{const o=u.useRef({});return u.useEffect(()=>{o.current=e}),o.current},Ht=Ut;function Vt(e){return e==null||Object.keys(e).length===0}function Kt(e){const{styles:o,defaultTheme:t={}}=e,r=typeof o=="function"?s=>o(Vt(s)?t:s):o;return f.jsx(kt,{styles:r})}function qt({styles:e,themeId:o,defaultTheme:t={}}){const r=Rt(t),s=typeof e=="function"?e(o&&r[o]||r):e;return f.jsx(Kt,{styles:s})}const Gt=zo(f.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function Ko(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function Xt(e={}){const{ignoreAccents:o=!0,ignoreCase:t=!0,limit:r,matchFrom:s="any",stringify:c,trim:d=!1}=e;return(i,{inputValue:b,getOptionLabel:p})=>{let m=d?b.trim():b;t&&(m=m.toLowerCase()),o&&(m=Ko(m));const h=m?i.filter($=>{let v=(c||p)($);return t&&(v=v.toLowerCase()),o&&(v=Ko(v)),s==="start"?v.indexOf(m)===0:v.indexOf(m)>-1}):i;return typeof r=="number"?h.slice(0,r):h}}function Lo(e,o){for(let t=0;t{var o;return e.current!==null&&((o=e.current.parentElement)==null?void 0:o.contains(document.activeElement))};function Zt(e){const{unstable_isActiveElementInListbox:o=Yt,unstable_classNamePrefix:t="Mui",autoComplete:r=!1,autoHighlight:s=!1,autoSelect:c=!1,blurOnSelect:d=!1,clearOnBlur:i=!e.freeSolo,clearOnEscape:b=!1,componentName:p="useAutocomplete",defaultValue:m=e.multiple?[]:null,disableClearable:h=!1,disableCloseOnSelect:$=!1,disabled:v,disabledItemsFocusable:R=!1,disableListWrap:M=!1,filterOptions:P=Jt,filterSelectedOptions:O=!1,freeSolo:k=!1,getOptionDisabled:C,getOptionKey:I,getOptionLabel:E=l=>{var n;return(n=l.label)!=null?n:l},groupBy:N,handleHomeEndKeys:F=!e.freeSolo,id:q,includeInputInList:le=!1,inputValue:de,isOptionEqualToValue:oe=(l,n)=>l===n,multiple:T=!1,onChange:Z,onClose:G,onHighlightChange:se,onInputChange:Q,onOpen:re,open:U,openOnFocus:A=!1,options:ie,readOnly:Se=!1,selectOnFocus:Le=!e.freeSolo,value:ue}=e,W=Ao(q);let ee=E;ee=l=>{const n=E(l);return typeof n!="string"?String(n):n};const fe=u.useRef(!1),We=u.useRef(!0),Y=u.useRef(null),be=u.useRef(null),[Me,J]=u.useState(null),[H,ze]=u.useState(-1),_e=s?0:-1,te=u.useRef(_e),[S,to]=fo({controlled:ue,default:m,name:p}),[_,xe]=fo({controlled:de,default:"",name:p,state:"inputValue"}),[Fe,ce]=u.useState(!1),Te=u.useCallback((l,n)=>{if(!(T?S.length!(O&&(T?S:[S]).some(n=>n!==null&&oe(l,n)))),{inputValue:Ee&&Je?"":_,getOptionLabel:ee}):[],he=Ht({filteredOptions:j,value:S,inputValue:_});u.useEffect(()=>{const l=S!==he.value;Fe&&!l||k&&!l||Te(null,S)},[S,Te,Fe,he.value,k]);const Ke=me&&j.length>0&&!Se,qe=xo(l=>{l===-1?Y.current.focus():Me.querySelector(`[data-tag-index="${l}"]`).focus()});u.useEffect(()=>{T&&H>S.length-1&&(ze(-1),qe(-1))},[S,T,H,qe]);function y(l,n){if(!be.current||l<0||l>=j.length)return-1;let g=l;for(;;){const x=be.current.querySelector(`[data-option-index="${g}"]`),K=R?!1:!x||x.disabled||x.getAttribute("aria-disabled")==="true";if(x&&x.hasAttribute("tabindex")&&!K)return g;if(n==="next"?g=(g+1)%j.length:g=(g-1+j.length)%j.length,g===l)return-1}}const B=xo(({event:l,index:n,reason:g="auto"})=>{if(te.current=n,n===-1?Y.current.removeAttribute("aria-activedescendant"):Y.current.setAttribute("aria-activedescendant",`${W}-option-${n}`),se&&se(l,n===-1?null:j[n],g),!be.current)return;const x=be.current.querySelector(`[role="option"].${t}-focused`);x&&(x.classList.remove(`${t}-focused`),x.classList.remove(`${t}-focusVisible`));let K=be.current;if(be.current.getAttribute("role")!=="listbox"&&(K=be.current.parentElement.querySelector('[role="listbox"]')),!K)return;if(n===-1){K.scrollTop=0;return}const pe=be.current.querySelector(`[data-option-index="${n}"]`);if(pe&&(pe.classList.add(`${t}-focused`),g==="keyboard"&&pe.classList.add(`${t}-focusVisible`),K.scrollHeight>K.clientHeight&&g!=="mouse"&&g!=="touch")){const ge=pe,He=K.clientHeight+K.scrollTop,_o=ge.offsetTop+ge.offsetHeight;_o>He?K.scrollTop=_o-K.clientHeight:ge.offsetTop-ge.offsetHeight*(N?1.3:0){if(!z)return;const pe=y((()=>{const ge=j.length-1;if(n==="reset")return _e;if(n==="start")return 0;if(n==="end")return ge;const He=te.current+n;return He<0?He===-1&&le?-1:M&&te.current!==-1||Math.abs(n)>1?0:ge:He>ge?He===ge+1&&le?-1:M||Math.abs(n)>1?ge:0:He})(),g);if(B({index:pe,reason:x,event:l}),r&&n!=="reset")if(pe===-1)Y.current.value=_;else{const ge=ee(j[pe]);Y.current.value=ge,ge.toLowerCase().indexOf(_.toLowerCase())===0&&_.length>0&&Y.current.setSelectionRange(_.length,ge.length)}}),ke=()=>{const l=(n,g)=>{const x=n?ee(n):"",K=g?ee(g):"";return x===K};if(te.current!==-1&&he.filteredOptions&&he.filteredOptions.length!==j.length&&he.inputValue===_&&(T?S.length===he.value.length&&he.value.every((n,g)=>ee(S[g])===ee(n)):l(he.value,S))){const n=he.filteredOptions[te.current];if(n&&j.some(x=>ee(x)===ee(n)))return!0}return!1},Ye=u.useCallback(()=>{if(!z||ke())return;const l=T?S[0]:S;if(j.length===0||l==null){X({diff:"reset"});return}if(be.current){if(l!=null){const n=j[te.current];if(T&&n&&Lo(S,x=>oe(n,x))!==-1)return;const g=Lo(j,x=>oe(x,l));g===-1?X({diff:"reset"}):B({index:g});return}if(te.current>=j.length-1){B({index:j.length-1});return}B({index:te.current})}},[j.length,T?!1:S,O,X,B,z,_,T]),Po=xo(l=>{At(be,l),l&&Ye()});u.useEffect(()=>{Ye()},[Ye]);const Ne=l=>{me||(Ae(!0),De(!0),re&&re(l))},Ge=(l,n)=>{me&&(Ae(!1),G&&G(l,n))},Ue=(l,n,g,x)=>{if(T){if(S.length===n.length&&S.every((K,pe)=>K===n[pe]))return}else if(S===n)return;Z&&Z(l,n,g,x),to(n)},no=u.useRef(!1),eo=(l,n,g="selectOption",x="options")=>{let K=g,pe=n;if(T){pe=Array.isArray(S)?S.slice():[];const ge=Lo(pe,He=>oe(n,He));ge===-1?pe.push(n):x!=="freeSolo"&&(pe.splice(ge,1),K="removeOption")}Te(l,pe),Ue(l,pe,K,{option:n}),!$&&(!l||!l.ctrlKey&&!l.metaKey)&&Ge(l,K),(d===!0||d==="touch"&&no.current||d==="mouse"&&!no.current)&&Y.current.blur()};function go(l,n){if(l===-1)return-1;let g=l;for(;;){if(n==="next"&&g===S.length||n==="previous"&&g===-1)return-1;const x=Me.querySelector(`[data-tag-index="${g}"]`);if(!x||!x.hasAttribute("tabindex")||x.disabled||x.getAttribute("aria-disabled")==="true")g+=n==="next"?1:-1;else return g}}const mo=(l,n)=>{if(!T)return;_===""&&Ge(l,"toggleInput");let g=H;H===-1?_===""&&n==="previous"&&(g=S.length-1):(g+=n==="next"?1:-1,g<0&&(g=0),g===S.length&&(g=-1)),g=go(g,n),ze(g),qe(g)},ho=l=>{fe.current=!0,xe(""),Q&&Q(l,"","clear"),Ue(l,T?[]:null,"clear")},ko=l=>n=>{if(l.onKeyDown&&l.onKeyDown(n),!n.defaultMuiPrevented&&(H!==-1&&["ArrowLeft","ArrowRight"].indexOf(n.key)===-1&&(ze(-1),qe(-1)),n.which!==229))switch(n.key){case"Home":z&&F&&(n.preventDefault(),X({diff:"start",direction:"next",reason:"keyboard",event:n}));break;case"End":z&&F&&(n.preventDefault(),X({diff:"end",direction:"previous",reason:"keyboard",event:n}));break;case"PageUp":n.preventDefault(),X({diff:-qo,direction:"previous",reason:"keyboard",event:n}),Ne(n);break;case"PageDown":n.preventDefault(),X({diff:qo,direction:"next",reason:"keyboard",event:n}),Ne(n);break;case"ArrowDown":n.preventDefault(),X({diff:1,direction:"next",reason:"keyboard",event:n}),Ne(n);break;case"ArrowUp":n.preventDefault(),X({diff:-1,direction:"previous",reason:"keyboard",event:n}),Ne(n);break;case"ArrowLeft":mo(n,"previous");break;case"ArrowRight":mo(n,"next");break;case"Enter":if(te.current!==-1&&z){const g=j[te.current],x=C?C(g):!1;if(n.preventDefault(),x)return;eo(n,g,"selectOption"),r&&Y.current.setSelectionRange(Y.current.value.length,Y.current.value.length)}else k&&_!==""&&Ee===!1&&(T&&n.preventDefault(),eo(n,_,"createOption","freeSolo"));break;case"Escape":z?(n.preventDefault(),n.stopPropagation(),Ge(n,"escape")):b&&(_!==""||T&&S.length>0)&&(n.preventDefault(),n.stopPropagation(),ho(n));break;case"Backspace":if(T&&!Se&&_===""&&S.length>0){const g=H===-1?S.length-1:H,x=S.slice();x.splice(g,1),Ue(n,x,"removeOption",{option:S[g]})}break;case"Delete":if(T&&!Se&&_===""&&S.length>0&&H!==-1){const g=H,x=S.slice();x.splice(g,1),Ue(n,x,"removeOption",{option:S[g]})}break}},jo=l=>{ce(!0),A&&!fe.current&&Ne(l)},ro=l=>{if(o(be)){Y.current.focus();return}ce(!1),We.current=!0,fe.current=!1,c&&te.current!==-1&&z?eo(l,j[te.current],"blur"):c&&k&&_!==""?eo(l,_,"blur","freeSolo"):i&&Te(l,S),Ge(l,"blur")},Ce=l=>{const n=l.target.value;_!==n&&(xe(n),De(!1),Q&&Q(l,n,"input")),n===""?!h&&!T&&Ue(l,null,"clear"):Ne(l)},ve=l=>{const n=Number(l.currentTarget.getAttribute("data-option-index"));te.current!==n&&B({event:l,index:n,reason:"mouse"})},Be=l=>{B({event:l,index:Number(l.currentTarget.getAttribute("data-option-index")),reason:"touch"}),no.current=!0},Wo=l=>{const n=Number(l.currentTarget.getAttribute("data-option-index"));eo(l,j[n],"selectOption"),no.current=!1},Ro=l=>n=>{const g=S.slice();g.splice(l,1),Ue(n,g,"removeOption",{option:S[l]})},Oo=l=>{me?Ge(l,"toggleInput"):Ne(l)},wo=l=>{l.currentTarget.contains(l.target)&&l.target.getAttribute("id")!==W&&l.preventDefault()},vo=l=>{l.currentTarget.contains(l.target)&&(Y.current.focus(),Le&&We.current&&Y.current.selectionEnd-Y.current.selectionStart===0&&Y.current.select(),We.current=!1)},co=l=>{!v&&(_===""||!me)&&Oo(l)};let oo=k&&_.length>0;oo=oo||(T?S.length>0:S!==null);let ao=j;return N&&(ao=j.reduce((l,n,g)=>{const x=N(n);return l.length>0&&l[l.length-1].group===x?l[l.length-1].options.push(n):l.push({key:g,index:g,group:x,options:[n]}),l},[])),v&&Fe&&ro(),{getRootProps:(l={})=>a({"aria-owns":Ke?`${W}-listbox`:null},l,{onKeyDown:ko(l),onMouseDown:wo,onClick:vo}),getInputLabelProps:()=>({id:`${W}-label`,htmlFor:W}),getInputProps:()=>({id:W,value:_,onBlur:ro,onFocus:jo,onChange:Ce,onMouseDown:co,"aria-activedescendant":z?"":null,"aria-autocomplete":r?"both":"list","aria-controls":Ke?`${W}-listbox`:void 0,"aria-expanded":Ke,autoComplete:"off",ref:Y,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:v}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:ho}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Oo}),getTagProps:({index:l})=>a({key:l,"data-tag-index":l,tabIndex:-1},!Se&&{onDelete:Ro(l)}),getListboxProps:()=>({role:"listbox",id:`${W}-listbox`,"aria-labelledby":`${W}-label`,ref:Po,onMouseDown:l=>{l.preventDefault()}}),getOptionProps:({index:l,option:n})=>{var g;const x=(T?S:[S]).some(pe=>pe!=null&&oe(n,pe)),K=C?C(n):!1;return{key:(g=I==null?void 0:I(n))!=null?g:ee(n),tabIndex:-1,role:"option",id:`${W}-option-${l}`,onMouseMove:ve,onClick:Wo,onTouchStart:Be,"data-option-index":l,"aria-disabled":K,"aria-selected":x}},id:W,inputValue:_,value:S,dirty:oo,expanded:z&&Me,popupOpen:z,focused:Fe||H!==-1,anchorEl:Me,setAnchorEl:J,focusedTag:H,groupedOptions:ao}}function Qt(e){return ye("MuiListSubheader",e)}$e("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const en=["className","color","component","disableGutters","disableSticky","inset"],on=e=>{const{classes:o,color:t,disableGutters:r,inset:s,disableSticky:c}=e,d={root:["root",t!=="default"&&`color${w(t)}`,!r&&"gutters",s&&"inset",!c&&"sticky"]};return Ie(d,Qt,o)},tn=L("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.color!=="default"&&o[`color${w(t.color)}`],!t.disableGutters&&o.gutters,t.inset&&o.inset,!t.disableSticky&&o.sticky]}})(({theme:e,ownerState:o})=>a({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},o.color==="primary"&&{color:(e.vars||e).palette.primary.main},o.color==="inherit"&&{color:"inherit"},!o.disableGutters&&{paddingLeft:16,paddingRight:16},o.inset&&{paddingLeft:72},!o.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})),bt=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiListSubheader"}),{className:s,color:c="default",component:d="li",disableGutters:i=!1,disableSticky:b=!1,inset:p=!1}=r,m=ae(r,en),h=a({},r,{color:c,component:d,disableGutters:i,disableSticky:b,inset:p}),$=on(h);return f.jsx(tn,a({as:d,className:ne($.root,s),ref:t,ownerState:h},m))});bt.muiSkipListHighlight=!0;const nn=bt,rn=zo(f.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function an(e){return ye("MuiChip",e)}const ln=$e("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),V=ln,sn=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],cn=e=>{const{classes:o,disabled:t,size:r,color:s,iconColor:c,onDelete:d,clickable:i,variant:b}=e,p={root:["root",b,t&&"disabled",`size${w(r)}`,`color${w(s)}`,i&&"clickable",i&&`clickableColor${w(s)}`,d&&"deletable",d&&`deletableColor${w(s)}`,`${b}${w(s)}`],label:["label",`label${w(r)}`],avatar:["avatar",`avatar${w(r)}`,`avatarColor${w(s)}`],icon:["icon",`icon${w(r)}`,`iconColor${w(c)}`],deleteIcon:["deleteIcon",`deleteIcon${w(r)}`,`deleteIconColor${w(s)}`,`deleteIcon${w(b)}Color${w(s)}`]};return Ie(p,an,o)},dn=L("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e,{color:r,iconColor:s,clickable:c,onDelete:d,size:i,variant:b}=t;return[{[`& .${V.avatar}`]:o.avatar},{[`& .${V.avatar}`]:o[`avatar${w(i)}`]},{[`& .${V.avatar}`]:o[`avatarColor${w(r)}`]},{[`& .${V.icon}`]:o.icon},{[`& .${V.icon}`]:o[`icon${w(i)}`]},{[`& .${V.icon}`]:o[`iconColor${w(s)}`]},{[`& .${V.deleteIcon}`]:o.deleteIcon},{[`& .${V.deleteIcon}`]:o[`deleteIcon${w(i)}`]},{[`& .${V.deleteIcon}`]:o[`deleteIconColor${w(r)}`]},{[`& .${V.deleteIcon}`]:o[`deleteIcon${w(b)}Color${w(r)}`]},o.root,o[`size${w(i)}`],o[`color${w(r)}`],c&&o.clickable,c&&r!=="default"&&o[`clickableColor${w(r)})`],d&&o.deletable,d&&r!=="default"&&o[`deletableColor${w(r)}`],o[b],o[`${b}${w(r)}`]]}})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return a({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${V.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${V.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${V.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${V.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${V.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${V.icon}`]:a({marginLeft:5,marginRight:-6},o.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},o.iconColor===o.color&&a({color:e.vars?e.vars.palette.Chip.defaultIconColor:t},o.color!=="default"&&{color:"inherit"})),[`& .${V.deleteIcon}`]:a({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Re(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Re(e.palette.text.primary,.4)}},o.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},o.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[o.color].contrastTextChannel} / 0.7)`:Re(e.palette[o.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[o.color].contrastText}})},o.size==="small"&&{height:24},o.color!=="default"&&{backgroundColor:(e.vars||e).palette[o.color].main,color:(e.vars||e).palette[o.color].contrastText},o.onDelete&&{[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},o.onDelete&&o.color!=="default"&&{[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette[o.color].dark}})},({theme:e,ownerState:o})=>a({},o.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},o.clickable&&o.color!=="default"&&{[`&:hover, &.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette[o.color].dark}}),({theme:e,ownerState:o})=>a({},o.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${V.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${V.avatar}`]:{marginLeft:4},[`& .${V.avatarSmall}`]:{marginLeft:2},[`& .${V.icon}`]:{marginLeft:4},[`& .${V.iconSmall}`]:{marginLeft:2},[`& .${V.deleteIcon}`]:{marginRight:5},[`& .${V.deleteIconSmall}`]:{marginRight:3}},o.variant==="outlined"&&o.color!=="default"&&{color:(e.vars||e).palette[o.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / 0.7)`:Re(e.palette[o.color].main,.7)}`,[`&.${V.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(e.palette[o.color].main,e.palette.action.hoverOpacity)},[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Re(e.palette[o.color].main,e.palette.action.focusOpacity)},[`& .${V.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / 0.7)`:Re(e.palette[o.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[o.color].main}}})),un=L("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,o)=>{const{ownerState:t}=e,{size:r}=t;return[o.label,o[`label${w(r)}`]]}})(({ownerState:e})=>a({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.variant==="outlined"&&{paddingLeft:11,paddingRight:11},e.size==="small"&&{paddingLeft:8,paddingRight:8},e.size==="small"&&e.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function Go(e){return e.key==="Backspace"||e.key==="Delete"}const pn=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiChip"}),{avatar:s,className:c,clickable:d,color:i="default",component:b,deleteIcon:p,disabled:m=!1,icon:h,label:$,onClick:v,onDelete:R,onKeyDown:M,onKeyUp:P,size:O="medium",variant:k="filled",tabIndex:C,skipFocusWhenDisabled:I=!1}=r,E=ae(r,sn),N=u.useRef(null),F=lo(N,t),q=A=>{A.stopPropagation(),R&&R(A)},le=A=>{A.currentTarget===A.target&&Go(A)&&A.preventDefault(),M&&M(A)},de=A=>{A.currentTarget===A.target&&(R&&Go(A)?R(A):A.key==="Escape"&&N.current&&N.current.blur()),P&&P(A)},oe=d!==!1&&v?!0:d,T=oe||R?Uo:b||"div",Z=a({},r,{component:T,disabled:m,size:O,color:i,iconColor:u.isValidElement(h)&&h.props.color||i,onDelete:!!R,clickable:oe,variant:k}),G=cn(Z),se=T===Uo?a({component:b||"div",focusVisibleClassName:G.focusVisible},R&&{disableRipple:!0}):{};let Q=null;R&&(Q=p&&u.isValidElement(p)?u.cloneElement(p,{className:ne(p.props.className,G.deleteIcon),onClick:q}):f.jsx(rn,{className:ne(G.deleteIcon),onClick:q}));let re=null;s&&u.isValidElement(s)&&(re=u.cloneElement(s,{className:ne(G.avatar,s.props.className)}));let U=null;return h&&u.isValidElement(h)&&(U=u.cloneElement(h,{className:ne(G.icon,h.props.className)})),f.jsxs(dn,a({as:T,className:ne(G.root,c),disabled:oe&&m?!0:void 0,onClick:v,onKeyDown:le,onKeyUp:de,ref:F,tabIndex:I&&m?-1:C,ownerState:Z},se,E,{children:[re||U,f.jsx(un,{className:ne(G.label),ownerState:Z,children:$}),Q]}))}),fn=pn;function bn(e){return f.jsx(qt,a({},e,{defaultTheme:Ot,themeId:wt}))}function gn(e){return ye("MuiInputBase",e)}const mn=$e("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Oe=mn,hn=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Co=(e,o)=>{const{ownerState:t}=e;return[o.root,t.formControl&&o.formControl,t.startAdornment&&o.adornedStart,t.endAdornment&&o.adornedEnd,t.error&&o.error,t.size==="small"&&o.sizeSmall,t.multiline&&o.multiline,t.color&&o[`color${w(t.color)}`],t.fullWidth&&o.fullWidth,t.hiddenLabel&&o.hiddenLabel]},yo=(e,o)=>{const{ownerState:t}=e;return[o.input,t.size==="small"&&o.inputSizeSmall,t.multiline&&o.inputMultiline,t.type==="search"&&o.inputTypeSearch,t.startAdornment&&o.inputAdornedStart,t.endAdornment&&o.inputAdornedEnd,t.hiddenLabel&&o.inputHiddenLabel]},vn=e=>{const{classes:o,color:t,disabled:r,error:s,endAdornment:c,focused:d,formControl:i,fullWidth:b,hiddenLabel:p,multiline:m,readOnly:h,size:$,startAdornment:v,type:R}=e,M={root:["root",`color${w(t)}`,r&&"disabled",s&&"error",b&&"fullWidth",d&&"focused",i&&"formControl",$&&$!=="medium"&&`size${w($)}`,m&&"multiline",v&&"adornedStart",c&&"adornedEnd",p&&"hiddenLabel",h&&"readOnly"],input:["input",r&&"disabled",R==="search"&&"inputTypeSearch",m&&"inputMultiline",$==="small"&&"inputSizeSmall",p&&"inputHiddenLabel",v&&"inputAdornedStart",c&&"inputAdornedEnd",h&&"readOnly"]};return Ie(M,gn,o)},$o=L("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:o})=>a({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Oe.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},o.multiline&&a({padding:"4px 0 5px"},o.size==="small"&&{paddingTop:1}),o.fullWidth&&{width:"100%"})),Io=L("input",{name:"MuiInputBase",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light",r=a({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),s={opacity:"0 !important"},c=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return a({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Oe.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":c,"&:focus::-moz-placeholder":c,"&:focus:-ms-input-placeholder":c,"&:focus::-ms-input-placeholder":c},[`&.${Oe.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},o.size==="small"&&{paddingTop:1},o.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},o.type==="search"&&{MozAppearance:"textfield"})}),xn=f.jsx(bn,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),Cn=u.forwardRef(function(o,t){var r;const s=Pe({props:o,name:"MuiInputBase"}),{"aria-describedby":c,autoComplete:d,autoFocus:i,className:b,components:p={},componentsProps:m={},defaultValue:h,disabled:$,disableInjectingGlobalStyles:v,endAdornment:R,fullWidth:M=!1,id:P,inputComponent:O="input",inputProps:k={},inputRef:C,maxRows:I,minRows:E,multiline:N=!1,name:F,onBlur:q,onChange:le,onClick:de,onFocus:oe,onKeyDown:T,onKeyUp:Z,placeholder:G,readOnly:se,renderSuffix:Q,rows:re,slotProps:U={},slots:A={},startAdornment:ie,type:Se="text",value:Le}=s,ue=ae(s,hn),W=k.value!=null?k.value:Le,{current:ee}=u.useRef(W!=null),fe=u.useRef(),We=u.useCallback(z=>{},[]),Y=lo(fe,C,k.ref,We),[be,Me]=u.useState(!1),J=so(),H=io({props:s,muiFormControl:J,states:["color","disabled","error","hiddenLabel","size","required","filled"]});H.focused=J?J.focused:be,u.useEffect(()=>{!J&&$&&be&&(Me(!1),q&&q())},[J,$,be,q]);const ze=J&&J.onFilled,_e=J&&J.onEmpty,te=u.useCallback(z=>{ft(z)?ze&&ze():_e&&_e()},[ze,_e]);dt(()=>{ee&&te({value:W})},[W,te,ee]);const S=z=>{if(H.disabled){z.stopPropagation();return}oe&&oe(z),k.onFocus&&k.onFocus(z),J&&J.onFocus?J.onFocus(z):Me(!0)},to=z=>{q&&q(z),k.onBlur&&k.onBlur(z),J&&J.onBlur?J.onBlur(z):Me(!1)},_=(z,...j)=>{if(!ee){const he=z.target||fe.current;if(he==null)throw new Error(st(1));te({value:he.value})}k.onChange&&k.onChange(z,...j),le&&le(z,...j)};u.useEffect(()=>{te(fe.current)},[]);const xe=z=>{fe.current&&z.currentTarget===z.target&&fe.current.focus(),de&&de(z)};let Fe=O,ce=k;N&&Fe==="input"&&(re?ce=a({type:void 0,minRows:re,maxRows:re},ce):ce=a({type:void 0,maxRows:I,minRows:E},ce),Fe=_t);const Te=z=>{te(z.animationName==="mui-auto-fill-cancel"?fe.current:{value:"x"})};u.useEffect(()=>{J&&J.setAdornedStart(!!ie)},[J,ie]);const me=a({},s,{color:H.color||"primary",disabled:H.disabled,endAdornment:R,error:H.error,focused:H.focused,formControl:J,fullWidth:M,hiddenLabel:H.hiddenLabel,multiline:N,size:H.size,startAdornment:ie,type:Se}),Ae=vn(me),Je=A.root||p.Root||$o,De=U.root||m.root||{},Ee=A.input||p.Input||Io;return ce=a({},ce,(r=U.input)!=null?r:m.input),f.jsxs(u.Fragment,{children:[!v&&xn,f.jsxs(Je,a({},De,!Ho(Je)&&{ownerState:a({},me,De.ownerState)},{ref:t,onClick:xe},ue,{className:ne(Ae.root,De.className,b,se&&"MuiInputBase-readOnly"),children:[ie,f.jsx(Bt.Provider,{value:null,children:f.jsx(Ee,a({ownerState:me,"aria-invalid":H.error,"aria-describedby":c,autoComplete:d,autoFocus:i,defaultValue:h,disabled:H.disabled,id:P,onAnimationStart:Te,name:F,placeholder:G,readOnly:se,required:H.required,rows:re,value:W,onKeyDown:T,onKeyUp:Z,type:Se},ce,!Ho(Ee)&&{as:Fe,ownerState:a({},me,ce.ownerState)},{ref:Y,className:ne(Ae.input,ce.className,se&&"MuiInputBase-readOnly"),onBlur:to,onChange:_,onFocus:S}))}),R,Q?Q(a({},H,{startAdornment:ie})):null]}))]})}),Do=Cn;function yn(e){return ye("MuiInput",e)}const $n=a({},Oe,$e("MuiInput",["root","underline","input"])),Qe=$n;function In(e){return ye("MuiOutlinedInput",e)}const Sn=a({},Oe,$e("MuiOutlinedInput",["root","notchedOutline","input"])),Ve=Sn;function Pn(e){return ye("MuiFilledInput",e)}const kn=a({},Oe,$e("MuiFilledInput",["root","underline","input"])),we=kn,gt=zo(f.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Rn(e){return ye("MuiAutocomplete",e)}const On=$e("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),D=On;var Xo,Jo;const wn=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],Ln=["ref"],Mn=["key"],Fn=e=>{const{classes:o,disablePortal:t,expanded:r,focused:s,fullWidth:c,hasClearIcon:d,hasPopupIcon:i,inputFocused:b,popupOpen:p,size:m}=e,h={root:["root",r&&"expanded",s&&"focused",c&&"fullWidth",d&&"hasClearIcon",i&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",b&&"inputFocused"],tag:["tag",`tagSize${w(m)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",p&&"popupIndicatorOpen"],popper:["popper",t&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ie(h,Rn,o)},Tn=L("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e,{fullWidth:r,hasClearIcon:s,hasPopupIcon:c,inputFocused:d,size:i}=t;return[{[`& .${D.tag}`]:o.tag},{[`& .${D.tag}`]:o[`tagSize${w(i)}`]},{[`& .${D.inputRoot}`]:o.inputRoot},{[`& .${D.input}`]:o.input},{[`& .${D.input}`]:d&&o.inputFocused},o.root,r&&o.fullWidth,c&&o.hasPopupIcon,s&&o.hasClearIcon]}})(({ownerState:e})=>a({[`&.${D.focused} .${D.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${D.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${D.tag}`]:a({margin:3,maxWidth:"calc(100% - 6px)"},e.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${D.inputRoot}`]:{flexWrap:"wrap",[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4},[`& .${D.input}`]:{width:0,minWidth:30}},[`& .${Qe.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Qe.root}.${Oe.sizeSmall}`]:{[`& .${Qe.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ve.root}`]:{padding:9,[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${D.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${D.endAdornment}`]:{right:9}},[`& .${Ve.root}.${Oe.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${D.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${we.root}`]:{paddingTop:19,paddingLeft:8,[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${we.input}`]:{padding:"7px 4px"},[`& .${D.endAdornment}`]:{right:9}},[`& .${we.root}.${Oe.sizeSmall}`]:{paddingBottom:1,[`& .${we.input}`]:{padding:"2.5px 4px"}},[`& .${Oe.hiddenLabel}`]:{paddingTop:8},[`& .${we.root}.${Oe.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${D.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${we.root}.${Oe.hiddenLabel}.${Oe.sizeSmall}`]:{[`& .${D.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${D.input}`]:a({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),An=L("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,o)=>o.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),Nn=L(ut,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,o)=>o.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),zn=L(ut,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},o)=>a({},o.popupIndicator,e.popupOpen&&o.popupIndicatorOpen)})(({ownerState:e})=>a({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),Dn=L(No,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${D.option}`]:o.option},o.popper,t.disablePortal&&o.popperDisablePortal]}})(({theme:e,ownerState:o})=>a({zIndex:(e.vars||e).zIndex.modal},o.disablePortal&&{position:"absolute"})),En=L(pt,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,o)=>o.paper})(({theme:e})=>a({},e.typography.body1,{overflow:"auto"})),Bn=L("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,o)=>o.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),jn=L("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,o)=>o.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),Wn=L("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,o)=>o.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${D.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${D.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${D.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Re(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${D.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Re(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${D.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),_n=L(nn,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,o)=>o.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),Un=L("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,o)=>o.groupUl})({padding:0,[`& .${D.option}`]:{paddingLeft:24}}),Hn=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiAutocomplete"}),{autoComplete:b=!1,autoHighlight:p=!1,autoSelect:m=!1,blurOnSelect:h=!1,ChipProps:$,className:v,clearIcon:R=Xo||(Xo=f.jsx(Gt,{fontSize:"small"})),clearOnBlur:M=!i.freeSolo,clearOnEscape:P=!1,clearText:O="Clear",closeText:k="Close",componentsProps:C={},defaultValue:I=i.multiple?[]:null,disableClearable:E=!1,disableCloseOnSelect:N=!1,disabled:F=!1,disabledItemsFocusable:q=!1,disableListWrap:le=!1,disablePortal:de=!1,filterSelectedOptions:oe=!1,forcePopupIcon:T="auto",freeSolo:Z=!1,fullWidth:G=!1,getLimitTagsText:se=n=>`+${n}`,getOptionLabel:Q,groupBy:re,handleHomeEndKeys:U=!i.freeSolo,includeInputInList:A=!1,limitTags:ie=-1,ListboxComponent:Se="ul",ListboxProps:Le,loading:ue=!1,loadingText:W="Loading…",multiple:ee=!1,noOptionsText:fe="No options",openOnFocus:We=!1,openText:Y="Open",PaperComponent:be=pt,PopperComponent:Me=No,popupIcon:J=Jo||(Jo=f.jsx(gt,{})),readOnly:H=!1,renderGroup:ze,renderInput:_e,renderOption:te,renderTags:S,selectOnFocus:to=!i.freeSolo,size:_="medium",slotProps:xe={}}=i,Fe=ae(i,wn),{getRootProps:ce,getInputProps:Te,getInputLabelProps:me,getPopupIndicatorProps:Ae,getClearProps:Je,getTagProps:De,getListboxProps:Ee,getOptionProps:z,value:j,dirty:he,expanded:Ke,id:qe,popupOpen:y,focused:B,focusedTag:X,anchorEl:ke,setAnchorEl:Ye,inputValue:Po,groupedOptions:Ne}=Zt(a({},i,{componentName:"Autocomplete"})),Ge=!E&&!F&&he&&!H,Ue=(!Z||T===!0)&&T!==!1,{onMouseDown:no}=Te(),{ref:eo}=Le??{},go=Ee(),{ref:mo}=go,ho=ae(go,Ln),ko=lo(mo,eo),ro=Q||(n=>{var g;return(g=n.label)!=null?g:n}),Ce=a({},i,{disablePortal:de,expanded:Ke,focused:B,fullWidth:G,getOptionLabel:ro,hasClearIcon:Ge,hasPopupIcon:Ue,inputFocused:X===-1,popupOpen:y,size:_}),ve=Fn(Ce);let Be;if(ee&&j.length>0){const n=g=>a({className:ve.tag,disabled:F},De(g));S?Be=S(j,n,Ce):Be=j.map((g,x)=>f.jsx(fn,a({label:ro(g),size:_},n({index:x}),$)))}if(ie>-1&&Array.isArray(Be)){const n=Be.length-ie;!B&&n>0&&(Be=Be.splice(0,ie),Be.push(f.jsx("span",{className:ve.tag,children:se(n)},Be.length)))}const Ro=ze||(n=>f.jsxs("li",{children:[f.jsx(_n,{className:ve.groupLabel,ownerState:Ce,component:"div",children:n.group}),f.jsx(Un,{className:ve.groupUl,ownerState:Ce,children:n.children})]},n.key)),wo=te||((n,g)=>{const{key:x}=n,K=ae(n,Mn);return f.jsx("li",a({},K,{children:ro(g)}),x)}),vo=(n,g)=>{const x=z({option:n,index:g});return wo(a({},x,{className:ve.option}),n,{selected:x["aria-selected"],index:g,inputValue:Po},Ce)},co=(r=xe.clearIndicator)!=null?r:C.clearIndicator,oo=(s=xe.paper)!=null?s:C.paper,ao=(c=xe.popper)!=null?c:C.popper,l=(d=xe.popupIndicator)!=null?d:C.popupIndicator;return f.jsxs(u.Fragment,{children:[f.jsx(Tn,a({ref:t,className:ne(ve.root,v),ownerState:Ce},ce(Fe),{children:_e({id:qe,disabled:F,fullWidth:!0,size:_==="small"?"small":void 0,InputLabelProps:me(),InputProps:a({ref:Ye,className:ve.inputRoot,startAdornment:Be,onClick:n=>{n.target===n.currentTarget&&no(n)}},(Ge||Ue)&&{endAdornment:f.jsxs(An,{className:ve.endAdornment,ownerState:Ce,children:[Ge?f.jsx(Nn,a({},Je(),{"aria-label":O,title:O,ownerState:Ce},co,{className:ne(ve.clearIndicator,co==null?void 0:co.className),children:R})):null,Ue?f.jsx(zn,a({},Ae(),{disabled:F,"aria-label":y?k:Y,title:y?k:Y,ownerState:Ce},l,{className:ne(ve.popupIndicator,l==null?void 0:l.className),children:J})):null]})}),inputProps:a({className:ve.input,disabled:F,readOnly:H},Te())})})),ke?f.jsx(Dn,a({as:Me,disablePortal:de,style:{width:ke?ke.clientWidth:null},ownerState:Ce,role:"presentation",anchorEl:ke,open:y},ao,{className:ne(ve.popper,ao==null?void 0:ao.className),children:f.jsxs(En,a({ownerState:Ce,as:be},oo,{className:ne(ve.paper,oo==null?void 0:oo.className),children:[ue&&Ne.length===0?f.jsx(Bn,{className:ve.loading,ownerState:Ce,children:W}):null,Ne.length===0&&!Z&&!ue?f.jsx(jn,{className:ve.noOptions,ownerState:Ce,role:"presentation",onMouseDown:n=>{n.preventDefault()},children:fe}):null,Ne.length>0?f.jsx(Wn,a({as:Se,className:ve.listbox,ownerState:Ce},ho,Le,{ref:ko,children:Ne.map((n,g)=>re?Ro({key:n.key,group:n.group,children:n.options.map((x,K)=>vo(x,n.index+K))}):vo(n,g))})):null]}))})):null]})}),Vn=Hn;function Kn(e){return ye("MuiCircularProgress",e)}$e("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const qn=["className","color","disableShrink","size","style","thickness","value","variant"];let So=e=>e,Yo,Zo,Qo,et;const Ze=44,Gn=it(Yo||(Yo=So` +import{r as u,j as f,bq as kt,br as Rt,b as a,c as ye,d as $e,s as L,i as w,u as Pe,_ as ae,f as ne,h as Ie,e as Re,bs as Ot,bt as wt,bu as st,k as it,b0 as ct,n as Xe,bv as To,m as Lt,a4 as Mt,t as Ft,v as je,F as Tt}from"./index-b856be88.js";import{G as xo,b6 as At,y as lo,b4 as Uo,z as dt,W as Ho,aw as ut,aO as pt,b7 as Nt,J as Fo,t as zt,b8 as Dt,X as Vo,T as Et}from"./index-c59af388.js";import{a as Ao,u as fo,b as so,f as io,i as ft,c as Bt,P as No,F as jt,S as Wt}from"./Stack-e0f879a7.js";import{c as zo}from"./createSvgIcon-ed559792.js";import{T as _t}from"./TextareaAutosize-981375ed.js";const Ut=e=>{const o=u.useRef({});return u.useEffect(()=>{o.current=e}),o.current},Ht=Ut;function Vt(e){return e==null||Object.keys(e).length===0}function Kt(e){const{styles:o,defaultTheme:t={}}=e,r=typeof o=="function"?s=>o(Vt(s)?t:s):o;return f.jsx(kt,{styles:r})}function qt({styles:e,themeId:o,defaultTheme:t={}}){const r=Rt(t),s=typeof e=="function"?e(o&&r[o]||r):e;return f.jsx(Kt,{styles:s})}const Gt=zo(f.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function Ko(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function Xt(e={}){const{ignoreAccents:o=!0,ignoreCase:t=!0,limit:r,matchFrom:s="any",stringify:c,trim:d=!1}=e;return(i,{inputValue:b,getOptionLabel:p})=>{let m=d?b.trim():b;t&&(m=m.toLowerCase()),o&&(m=Ko(m));const h=m?i.filter($=>{let v=(c||p)($);return t&&(v=v.toLowerCase()),o&&(v=Ko(v)),s==="start"?v.indexOf(m)===0:v.indexOf(m)>-1}):i;return typeof r=="number"?h.slice(0,r):h}}function Lo(e,o){for(let t=0;t{var o;return e.current!==null&&((o=e.current.parentElement)==null?void 0:o.contains(document.activeElement))};function Zt(e){const{unstable_isActiveElementInListbox:o=Yt,unstable_classNamePrefix:t="Mui",autoComplete:r=!1,autoHighlight:s=!1,autoSelect:c=!1,blurOnSelect:d=!1,clearOnBlur:i=!e.freeSolo,clearOnEscape:b=!1,componentName:p="useAutocomplete",defaultValue:m=e.multiple?[]:null,disableClearable:h=!1,disableCloseOnSelect:$=!1,disabled:v,disabledItemsFocusable:R=!1,disableListWrap:M=!1,filterOptions:P=Jt,filterSelectedOptions:O=!1,freeSolo:k=!1,getOptionDisabled:C,getOptionKey:I,getOptionLabel:E=l=>{var n;return(n=l.label)!=null?n:l},groupBy:N,handleHomeEndKeys:F=!e.freeSolo,id:q,includeInputInList:le=!1,inputValue:de,isOptionEqualToValue:oe=(l,n)=>l===n,multiple:T=!1,onChange:Z,onClose:G,onHighlightChange:se,onInputChange:Q,onOpen:re,open:U,openOnFocus:A=!1,options:ie,readOnly:Se=!1,selectOnFocus:Le=!e.freeSolo,value:ue}=e,W=Ao(q);let ee=E;ee=l=>{const n=E(l);return typeof n!="string"?String(n):n};const fe=u.useRef(!1),We=u.useRef(!0),Y=u.useRef(null),be=u.useRef(null),[Me,J]=u.useState(null),[H,ze]=u.useState(-1),_e=s?0:-1,te=u.useRef(_e),[S,to]=fo({controlled:ue,default:m,name:p}),[_,xe]=fo({controlled:de,default:"",name:p,state:"inputValue"}),[Fe,ce]=u.useState(!1),Te=u.useCallback((l,n)=>{if(!(T?S.length!(O&&(T?S:[S]).some(n=>n!==null&&oe(l,n)))),{inputValue:Ee&&Je?"":_,getOptionLabel:ee}):[],he=Ht({filteredOptions:j,value:S,inputValue:_});u.useEffect(()=>{const l=S!==he.value;Fe&&!l||k&&!l||Te(null,S)},[S,Te,Fe,he.value,k]);const Ke=me&&j.length>0&&!Se,qe=xo(l=>{l===-1?Y.current.focus():Me.querySelector(`[data-tag-index="${l}"]`).focus()});u.useEffect(()=>{T&&H>S.length-1&&(ze(-1),qe(-1))},[S,T,H,qe]);function y(l,n){if(!be.current||l<0||l>=j.length)return-1;let g=l;for(;;){const x=be.current.querySelector(`[data-option-index="${g}"]`),K=R?!1:!x||x.disabled||x.getAttribute("aria-disabled")==="true";if(x&&x.hasAttribute("tabindex")&&!K)return g;if(n==="next"?g=(g+1)%j.length:g=(g-1+j.length)%j.length,g===l)return-1}}const B=xo(({event:l,index:n,reason:g="auto"})=>{if(te.current=n,n===-1?Y.current.removeAttribute("aria-activedescendant"):Y.current.setAttribute("aria-activedescendant",`${W}-option-${n}`),se&&se(l,n===-1?null:j[n],g),!be.current)return;const x=be.current.querySelector(`[role="option"].${t}-focused`);x&&(x.classList.remove(`${t}-focused`),x.classList.remove(`${t}-focusVisible`));let K=be.current;if(be.current.getAttribute("role")!=="listbox"&&(K=be.current.parentElement.querySelector('[role="listbox"]')),!K)return;if(n===-1){K.scrollTop=0;return}const pe=be.current.querySelector(`[data-option-index="${n}"]`);if(pe&&(pe.classList.add(`${t}-focused`),g==="keyboard"&&pe.classList.add(`${t}-focusVisible`),K.scrollHeight>K.clientHeight&&g!=="mouse"&&g!=="touch")){const ge=pe,He=K.clientHeight+K.scrollTop,_o=ge.offsetTop+ge.offsetHeight;_o>He?K.scrollTop=_o-K.clientHeight:ge.offsetTop-ge.offsetHeight*(N?1.3:0){if(!z)return;const pe=y((()=>{const ge=j.length-1;if(n==="reset")return _e;if(n==="start")return 0;if(n==="end")return ge;const He=te.current+n;return He<0?He===-1&&le?-1:M&&te.current!==-1||Math.abs(n)>1?0:ge:He>ge?He===ge+1&&le?-1:M||Math.abs(n)>1?ge:0:He})(),g);if(B({index:pe,reason:x,event:l}),r&&n!=="reset")if(pe===-1)Y.current.value=_;else{const ge=ee(j[pe]);Y.current.value=ge,ge.toLowerCase().indexOf(_.toLowerCase())===0&&_.length>0&&Y.current.setSelectionRange(_.length,ge.length)}}),ke=()=>{const l=(n,g)=>{const x=n?ee(n):"",K=g?ee(g):"";return x===K};if(te.current!==-1&&he.filteredOptions&&he.filteredOptions.length!==j.length&&he.inputValue===_&&(T?S.length===he.value.length&&he.value.every((n,g)=>ee(S[g])===ee(n)):l(he.value,S))){const n=he.filteredOptions[te.current];if(n&&j.some(x=>ee(x)===ee(n)))return!0}return!1},Ye=u.useCallback(()=>{if(!z||ke())return;const l=T?S[0]:S;if(j.length===0||l==null){X({diff:"reset"});return}if(be.current){if(l!=null){const n=j[te.current];if(T&&n&&Lo(S,x=>oe(n,x))!==-1)return;const g=Lo(j,x=>oe(x,l));g===-1?X({diff:"reset"}):B({index:g});return}if(te.current>=j.length-1){B({index:j.length-1});return}B({index:te.current})}},[j.length,T?!1:S,O,X,B,z,_,T]),Po=xo(l=>{At(be,l),l&&Ye()});u.useEffect(()=>{Ye()},[Ye]);const Ne=l=>{me||(Ae(!0),De(!0),re&&re(l))},Ge=(l,n)=>{me&&(Ae(!1),G&&G(l,n))},Ue=(l,n,g,x)=>{if(T){if(S.length===n.length&&S.every((K,pe)=>K===n[pe]))return}else if(S===n)return;Z&&Z(l,n,g,x),to(n)},no=u.useRef(!1),eo=(l,n,g="selectOption",x="options")=>{let K=g,pe=n;if(T){pe=Array.isArray(S)?S.slice():[];const ge=Lo(pe,He=>oe(n,He));ge===-1?pe.push(n):x!=="freeSolo"&&(pe.splice(ge,1),K="removeOption")}Te(l,pe),Ue(l,pe,K,{option:n}),!$&&(!l||!l.ctrlKey&&!l.metaKey)&&Ge(l,K),(d===!0||d==="touch"&&no.current||d==="mouse"&&!no.current)&&Y.current.blur()};function go(l,n){if(l===-1)return-1;let g=l;for(;;){if(n==="next"&&g===S.length||n==="previous"&&g===-1)return-1;const x=Me.querySelector(`[data-tag-index="${g}"]`);if(!x||!x.hasAttribute("tabindex")||x.disabled||x.getAttribute("aria-disabled")==="true")g+=n==="next"?1:-1;else return g}}const mo=(l,n)=>{if(!T)return;_===""&&Ge(l,"toggleInput");let g=H;H===-1?_===""&&n==="previous"&&(g=S.length-1):(g+=n==="next"?1:-1,g<0&&(g=0),g===S.length&&(g=-1)),g=go(g,n),ze(g),qe(g)},ho=l=>{fe.current=!0,xe(""),Q&&Q(l,"","clear"),Ue(l,T?[]:null,"clear")},ko=l=>n=>{if(l.onKeyDown&&l.onKeyDown(n),!n.defaultMuiPrevented&&(H!==-1&&["ArrowLeft","ArrowRight"].indexOf(n.key)===-1&&(ze(-1),qe(-1)),n.which!==229))switch(n.key){case"Home":z&&F&&(n.preventDefault(),X({diff:"start",direction:"next",reason:"keyboard",event:n}));break;case"End":z&&F&&(n.preventDefault(),X({diff:"end",direction:"previous",reason:"keyboard",event:n}));break;case"PageUp":n.preventDefault(),X({diff:-qo,direction:"previous",reason:"keyboard",event:n}),Ne(n);break;case"PageDown":n.preventDefault(),X({diff:qo,direction:"next",reason:"keyboard",event:n}),Ne(n);break;case"ArrowDown":n.preventDefault(),X({diff:1,direction:"next",reason:"keyboard",event:n}),Ne(n);break;case"ArrowUp":n.preventDefault(),X({diff:-1,direction:"previous",reason:"keyboard",event:n}),Ne(n);break;case"ArrowLeft":mo(n,"previous");break;case"ArrowRight":mo(n,"next");break;case"Enter":if(te.current!==-1&&z){const g=j[te.current],x=C?C(g):!1;if(n.preventDefault(),x)return;eo(n,g,"selectOption"),r&&Y.current.setSelectionRange(Y.current.value.length,Y.current.value.length)}else k&&_!==""&&Ee===!1&&(T&&n.preventDefault(),eo(n,_,"createOption","freeSolo"));break;case"Escape":z?(n.preventDefault(),n.stopPropagation(),Ge(n,"escape")):b&&(_!==""||T&&S.length>0)&&(n.preventDefault(),n.stopPropagation(),ho(n));break;case"Backspace":if(T&&!Se&&_===""&&S.length>0){const g=H===-1?S.length-1:H,x=S.slice();x.splice(g,1),Ue(n,x,"removeOption",{option:S[g]})}break;case"Delete":if(T&&!Se&&_===""&&S.length>0&&H!==-1){const g=H,x=S.slice();x.splice(g,1),Ue(n,x,"removeOption",{option:S[g]})}break}},jo=l=>{ce(!0),A&&!fe.current&&Ne(l)},ro=l=>{if(o(be)){Y.current.focus();return}ce(!1),We.current=!0,fe.current=!1,c&&te.current!==-1&&z?eo(l,j[te.current],"blur"):c&&k&&_!==""?eo(l,_,"blur","freeSolo"):i&&Te(l,S),Ge(l,"blur")},Ce=l=>{const n=l.target.value;_!==n&&(xe(n),De(!1),Q&&Q(l,n,"input")),n===""?!h&&!T&&Ue(l,null,"clear"):Ne(l)},ve=l=>{const n=Number(l.currentTarget.getAttribute("data-option-index"));te.current!==n&&B({event:l,index:n,reason:"mouse"})},Be=l=>{B({event:l,index:Number(l.currentTarget.getAttribute("data-option-index")),reason:"touch"}),no.current=!0},Wo=l=>{const n=Number(l.currentTarget.getAttribute("data-option-index"));eo(l,j[n],"selectOption"),no.current=!1},Ro=l=>n=>{const g=S.slice();g.splice(l,1),Ue(n,g,"removeOption",{option:S[l]})},Oo=l=>{me?Ge(l,"toggleInput"):Ne(l)},wo=l=>{l.currentTarget.contains(l.target)&&l.target.getAttribute("id")!==W&&l.preventDefault()},vo=l=>{l.currentTarget.contains(l.target)&&(Y.current.focus(),Le&&We.current&&Y.current.selectionEnd-Y.current.selectionStart===0&&Y.current.select(),We.current=!1)},co=l=>{!v&&(_===""||!me)&&Oo(l)};let oo=k&&_.length>0;oo=oo||(T?S.length>0:S!==null);let ao=j;return N&&(ao=j.reduce((l,n,g)=>{const x=N(n);return l.length>0&&l[l.length-1].group===x?l[l.length-1].options.push(n):l.push({key:g,index:g,group:x,options:[n]}),l},[])),v&&Fe&&ro(),{getRootProps:(l={})=>a({"aria-owns":Ke?`${W}-listbox`:null},l,{onKeyDown:ko(l),onMouseDown:wo,onClick:vo}),getInputLabelProps:()=>({id:`${W}-label`,htmlFor:W}),getInputProps:()=>({id:W,value:_,onBlur:ro,onFocus:jo,onChange:Ce,onMouseDown:co,"aria-activedescendant":z?"":null,"aria-autocomplete":r?"both":"list","aria-controls":Ke?`${W}-listbox`:void 0,"aria-expanded":Ke,autoComplete:"off",ref:Y,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:v}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:ho}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Oo}),getTagProps:({index:l})=>a({key:l,"data-tag-index":l,tabIndex:-1},!Se&&{onDelete:Ro(l)}),getListboxProps:()=>({role:"listbox",id:`${W}-listbox`,"aria-labelledby":`${W}-label`,ref:Po,onMouseDown:l=>{l.preventDefault()}}),getOptionProps:({index:l,option:n})=>{var g;const x=(T?S:[S]).some(pe=>pe!=null&&oe(n,pe)),K=C?C(n):!1;return{key:(g=I==null?void 0:I(n))!=null?g:ee(n),tabIndex:-1,role:"option",id:`${W}-option-${l}`,onMouseMove:ve,onClick:Wo,onTouchStart:Be,"data-option-index":l,"aria-disabled":K,"aria-selected":x}},id:W,inputValue:_,value:S,dirty:oo,expanded:z&&Me,popupOpen:z,focused:Fe||H!==-1,anchorEl:Me,setAnchorEl:J,focusedTag:H,groupedOptions:ao}}function Qt(e){return ye("MuiListSubheader",e)}$e("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const en=["className","color","component","disableGutters","disableSticky","inset"],on=e=>{const{classes:o,color:t,disableGutters:r,inset:s,disableSticky:c}=e,d={root:["root",t!=="default"&&`color${w(t)}`,!r&&"gutters",s&&"inset",!c&&"sticky"]};return Ie(d,Qt,o)},tn=L("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.color!=="default"&&o[`color${w(t.color)}`],!t.disableGutters&&o.gutters,t.inset&&o.inset,!t.disableSticky&&o.sticky]}})(({theme:e,ownerState:o})=>a({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},o.color==="primary"&&{color:(e.vars||e).palette.primary.main},o.color==="inherit"&&{color:"inherit"},!o.disableGutters&&{paddingLeft:16,paddingRight:16},o.inset&&{paddingLeft:72},!o.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})),bt=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiListSubheader"}),{className:s,color:c="default",component:d="li",disableGutters:i=!1,disableSticky:b=!1,inset:p=!1}=r,m=ae(r,en),h=a({},r,{color:c,component:d,disableGutters:i,disableSticky:b,inset:p}),$=on(h);return f.jsx(tn,a({as:d,className:ne($.root,s),ref:t,ownerState:h},m))});bt.muiSkipListHighlight=!0;const nn=bt,rn=zo(f.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function an(e){return ye("MuiChip",e)}const ln=$e("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),V=ln,sn=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],cn=e=>{const{classes:o,disabled:t,size:r,color:s,iconColor:c,onDelete:d,clickable:i,variant:b}=e,p={root:["root",b,t&&"disabled",`size${w(r)}`,`color${w(s)}`,i&&"clickable",i&&`clickableColor${w(s)}`,d&&"deletable",d&&`deletableColor${w(s)}`,`${b}${w(s)}`],label:["label",`label${w(r)}`],avatar:["avatar",`avatar${w(r)}`,`avatarColor${w(s)}`],icon:["icon",`icon${w(r)}`,`iconColor${w(c)}`],deleteIcon:["deleteIcon",`deleteIcon${w(r)}`,`deleteIconColor${w(s)}`,`deleteIcon${w(b)}Color${w(s)}`]};return Ie(p,an,o)},dn=L("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e,{color:r,iconColor:s,clickable:c,onDelete:d,size:i,variant:b}=t;return[{[`& .${V.avatar}`]:o.avatar},{[`& .${V.avatar}`]:o[`avatar${w(i)}`]},{[`& .${V.avatar}`]:o[`avatarColor${w(r)}`]},{[`& .${V.icon}`]:o.icon},{[`& .${V.icon}`]:o[`icon${w(i)}`]},{[`& .${V.icon}`]:o[`iconColor${w(s)}`]},{[`& .${V.deleteIcon}`]:o.deleteIcon},{[`& .${V.deleteIcon}`]:o[`deleteIcon${w(i)}`]},{[`& .${V.deleteIcon}`]:o[`deleteIconColor${w(r)}`]},{[`& .${V.deleteIcon}`]:o[`deleteIcon${w(b)}Color${w(r)}`]},o.root,o[`size${w(i)}`],o[`color${w(r)}`],c&&o.clickable,c&&r!=="default"&&o[`clickableColor${w(r)})`],d&&o.deletable,d&&r!=="default"&&o[`deletableColor${w(r)}`],o[b],o[`${b}${w(r)}`]]}})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return a({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${V.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${V.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${V.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${V.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${V.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${V.icon}`]:a({marginLeft:5,marginRight:-6},o.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},o.iconColor===o.color&&a({color:e.vars?e.vars.palette.Chip.defaultIconColor:t},o.color!=="default"&&{color:"inherit"})),[`& .${V.deleteIcon}`]:a({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Re(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Re(e.palette.text.primary,.4)}},o.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},o.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[o.color].contrastTextChannel} / 0.7)`:Re(e.palette[o.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[o.color].contrastText}})},o.size==="small"&&{height:24},o.color!=="default"&&{backgroundColor:(e.vars||e).palette[o.color].main,color:(e.vars||e).palette[o.color].contrastText},o.onDelete&&{[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},o.onDelete&&o.color!=="default"&&{[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette[o.color].dark}})},({theme:e,ownerState:o})=>a({},o.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},o.clickable&&o.color!=="default"&&{[`&:hover, &.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette[o.color].dark}}),({theme:e,ownerState:o})=>a({},o.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${V.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${V.avatar}`]:{marginLeft:4},[`& .${V.avatarSmall}`]:{marginLeft:2},[`& .${V.icon}`]:{marginLeft:4},[`& .${V.iconSmall}`]:{marginLeft:2},[`& .${V.deleteIcon}`]:{marginRight:5},[`& .${V.deleteIconSmall}`]:{marginRight:3}},o.variant==="outlined"&&o.color!=="default"&&{color:(e.vars||e).palette[o.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / 0.7)`:Re(e.palette[o.color].main,.7)}`,[`&.${V.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(e.palette[o.color].main,e.palette.action.hoverOpacity)},[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Re(e.palette[o.color].main,e.palette.action.focusOpacity)},[`& .${V.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / 0.7)`:Re(e.palette[o.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[o.color].main}}})),un=L("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,o)=>{const{ownerState:t}=e,{size:r}=t;return[o.label,o[`label${w(r)}`]]}})(({ownerState:e})=>a({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.variant==="outlined"&&{paddingLeft:11,paddingRight:11},e.size==="small"&&{paddingLeft:8,paddingRight:8},e.size==="small"&&e.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function Go(e){return e.key==="Backspace"||e.key==="Delete"}const pn=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiChip"}),{avatar:s,className:c,clickable:d,color:i="default",component:b,deleteIcon:p,disabled:m=!1,icon:h,label:$,onClick:v,onDelete:R,onKeyDown:M,onKeyUp:P,size:O="medium",variant:k="filled",tabIndex:C,skipFocusWhenDisabled:I=!1}=r,E=ae(r,sn),N=u.useRef(null),F=lo(N,t),q=A=>{A.stopPropagation(),R&&R(A)},le=A=>{A.currentTarget===A.target&&Go(A)&&A.preventDefault(),M&&M(A)},de=A=>{A.currentTarget===A.target&&(R&&Go(A)?R(A):A.key==="Escape"&&N.current&&N.current.blur()),P&&P(A)},oe=d!==!1&&v?!0:d,T=oe||R?Uo:b||"div",Z=a({},r,{component:T,disabled:m,size:O,color:i,iconColor:u.isValidElement(h)&&h.props.color||i,onDelete:!!R,clickable:oe,variant:k}),G=cn(Z),se=T===Uo?a({component:b||"div",focusVisibleClassName:G.focusVisible},R&&{disableRipple:!0}):{};let Q=null;R&&(Q=p&&u.isValidElement(p)?u.cloneElement(p,{className:ne(p.props.className,G.deleteIcon),onClick:q}):f.jsx(rn,{className:ne(G.deleteIcon),onClick:q}));let re=null;s&&u.isValidElement(s)&&(re=u.cloneElement(s,{className:ne(G.avatar,s.props.className)}));let U=null;return h&&u.isValidElement(h)&&(U=u.cloneElement(h,{className:ne(G.icon,h.props.className)})),f.jsxs(dn,a({as:T,className:ne(G.root,c),disabled:oe&&m?!0:void 0,onClick:v,onKeyDown:le,onKeyUp:de,ref:F,tabIndex:I&&m?-1:C,ownerState:Z},se,E,{children:[re||U,f.jsx(un,{className:ne(G.label),ownerState:Z,children:$}),Q]}))}),fn=pn;function bn(e){return f.jsx(qt,a({},e,{defaultTheme:Ot,themeId:wt}))}function gn(e){return ye("MuiInputBase",e)}const mn=$e("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Oe=mn,hn=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Co=(e,o)=>{const{ownerState:t}=e;return[o.root,t.formControl&&o.formControl,t.startAdornment&&o.adornedStart,t.endAdornment&&o.adornedEnd,t.error&&o.error,t.size==="small"&&o.sizeSmall,t.multiline&&o.multiline,t.color&&o[`color${w(t.color)}`],t.fullWidth&&o.fullWidth,t.hiddenLabel&&o.hiddenLabel]},yo=(e,o)=>{const{ownerState:t}=e;return[o.input,t.size==="small"&&o.inputSizeSmall,t.multiline&&o.inputMultiline,t.type==="search"&&o.inputTypeSearch,t.startAdornment&&o.inputAdornedStart,t.endAdornment&&o.inputAdornedEnd,t.hiddenLabel&&o.inputHiddenLabel]},vn=e=>{const{classes:o,color:t,disabled:r,error:s,endAdornment:c,focused:d,formControl:i,fullWidth:b,hiddenLabel:p,multiline:m,readOnly:h,size:$,startAdornment:v,type:R}=e,M={root:["root",`color${w(t)}`,r&&"disabled",s&&"error",b&&"fullWidth",d&&"focused",i&&"formControl",$&&$!=="medium"&&`size${w($)}`,m&&"multiline",v&&"adornedStart",c&&"adornedEnd",p&&"hiddenLabel",h&&"readOnly"],input:["input",r&&"disabled",R==="search"&&"inputTypeSearch",m&&"inputMultiline",$==="small"&&"inputSizeSmall",p&&"inputHiddenLabel",v&&"inputAdornedStart",c&&"inputAdornedEnd",h&&"readOnly"]};return Ie(M,gn,o)},$o=L("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:o})=>a({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Oe.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},o.multiline&&a({padding:"4px 0 5px"},o.size==="small"&&{paddingTop:1}),o.fullWidth&&{width:"100%"})),Io=L("input",{name:"MuiInputBase",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light",r=a({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),s={opacity:"0 !important"},c=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return a({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Oe.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":c,"&:focus::-moz-placeholder":c,"&:focus:-ms-input-placeholder":c,"&:focus::-ms-input-placeholder":c},[`&.${Oe.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},o.size==="small"&&{paddingTop:1},o.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},o.type==="search"&&{MozAppearance:"textfield"})}),xn=f.jsx(bn,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),Cn=u.forwardRef(function(o,t){var r;const s=Pe({props:o,name:"MuiInputBase"}),{"aria-describedby":c,autoComplete:d,autoFocus:i,className:b,components:p={},componentsProps:m={},defaultValue:h,disabled:$,disableInjectingGlobalStyles:v,endAdornment:R,fullWidth:M=!1,id:P,inputComponent:O="input",inputProps:k={},inputRef:C,maxRows:I,minRows:E,multiline:N=!1,name:F,onBlur:q,onChange:le,onClick:de,onFocus:oe,onKeyDown:T,onKeyUp:Z,placeholder:G,readOnly:se,renderSuffix:Q,rows:re,slotProps:U={},slots:A={},startAdornment:ie,type:Se="text",value:Le}=s,ue=ae(s,hn),W=k.value!=null?k.value:Le,{current:ee}=u.useRef(W!=null),fe=u.useRef(),We=u.useCallback(z=>{},[]),Y=lo(fe,C,k.ref,We),[be,Me]=u.useState(!1),J=so(),H=io({props:s,muiFormControl:J,states:["color","disabled","error","hiddenLabel","size","required","filled"]});H.focused=J?J.focused:be,u.useEffect(()=>{!J&&$&&be&&(Me(!1),q&&q())},[J,$,be,q]);const ze=J&&J.onFilled,_e=J&&J.onEmpty,te=u.useCallback(z=>{ft(z)?ze&&ze():_e&&_e()},[ze,_e]);dt(()=>{ee&&te({value:W})},[W,te,ee]);const S=z=>{if(H.disabled){z.stopPropagation();return}oe&&oe(z),k.onFocus&&k.onFocus(z),J&&J.onFocus?J.onFocus(z):Me(!0)},to=z=>{q&&q(z),k.onBlur&&k.onBlur(z),J&&J.onBlur?J.onBlur(z):Me(!1)},_=(z,...j)=>{if(!ee){const he=z.target||fe.current;if(he==null)throw new Error(st(1));te({value:he.value})}k.onChange&&k.onChange(z,...j),le&&le(z,...j)};u.useEffect(()=>{te(fe.current)},[]);const xe=z=>{fe.current&&z.currentTarget===z.target&&fe.current.focus(),de&&de(z)};let Fe=O,ce=k;N&&Fe==="input"&&(re?ce=a({type:void 0,minRows:re,maxRows:re},ce):ce=a({type:void 0,maxRows:I,minRows:E},ce),Fe=_t);const Te=z=>{te(z.animationName==="mui-auto-fill-cancel"?fe.current:{value:"x"})};u.useEffect(()=>{J&&J.setAdornedStart(!!ie)},[J,ie]);const me=a({},s,{color:H.color||"primary",disabled:H.disabled,endAdornment:R,error:H.error,focused:H.focused,formControl:J,fullWidth:M,hiddenLabel:H.hiddenLabel,multiline:N,size:H.size,startAdornment:ie,type:Se}),Ae=vn(me),Je=A.root||p.Root||$o,De=U.root||m.root||{},Ee=A.input||p.Input||Io;return ce=a({},ce,(r=U.input)!=null?r:m.input),f.jsxs(u.Fragment,{children:[!v&&xn,f.jsxs(Je,a({},De,!Ho(Je)&&{ownerState:a({},me,De.ownerState)},{ref:t,onClick:xe},ue,{className:ne(Ae.root,De.className,b,se&&"MuiInputBase-readOnly"),children:[ie,f.jsx(Bt.Provider,{value:null,children:f.jsx(Ee,a({ownerState:me,"aria-invalid":H.error,"aria-describedby":c,autoComplete:d,autoFocus:i,defaultValue:h,disabled:H.disabled,id:P,onAnimationStart:Te,name:F,placeholder:G,readOnly:se,required:H.required,rows:re,value:W,onKeyDown:T,onKeyUp:Z,type:Se},ce,!Ho(Ee)&&{as:Fe,ownerState:a({},me,ce.ownerState)},{ref:Y,className:ne(Ae.input,ce.className,se&&"MuiInputBase-readOnly"),onBlur:to,onChange:_,onFocus:S}))}),R,Q?Q(a({},H,{startAdornment:ie})):null]}))]})}),Do=Cn;function yn(e){return ye("MuiInput",e)}const $n=a({},Oe,$e("MuiInput",["root","underline","input"])),Qe=$n;function In(e){return ye("MuiOutlinedInput",e)}const Sn=a({},Oe,$e("MuiOutlinedInput",["root","notchedOutline","input"])),Ve=Sn;function Pn(e){return ye("MuiFilledInput",e)}const kn=a({},Oe,$e("MuiFilledInput",["root","underline","input"])),we=kn,gt=zo(f.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Rn(e){return ye("MuiAutocomplete",e)}const On=$e("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),D=On;var Xo,Jo;const wn=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],Ln=["ref"],Mn=["key"],Fn=e=>{const{classes:o,disablePortal:t,expanded:r,focused:s,fullWidth:c,hasClearIcon:d,hasPopupIcon:i,inputFocused:b,popupOpen:p,size:m}=e,h={root:["root",r&&"expanded",s&&"focused",c&&"fullWidth",d&&"hasClearIcon",i&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",b&&"inputFocused"],tag:["tag",`tagSize${w(m)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",p&&"popupIndicatorOpen"],popper:["popper",t&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ie(h,Rn,o)},Tn=L("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e,{fullWidth:r,hasClearIcon:s,hasPopupIcon:c,inputFocused:d,size:i}=t;return[{[`& .${D.tag}`]:o.tag},{[`& .${D.tag}`]:o[`tagSize${w(i)}`]},{[`& .${D.inputRoot}`]:o.inputRoot},{[`& .${D.input}`]:o.input},{[`& .${D.input}`]:d&&o.inputFocused},o.root,r&&o.fullWidth,c&&o.hasPopupIcon,s&&o.hasClearIcon]}})(({ownerState:e})=>a({[`&.${D.focused} .${D.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${D.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${D.tag}`]:a({margin:3,maxWidth:"calc(100% - 6px)"},e.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${D.inputRoot}`]:{flexWrap:"wrap",[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4},[`& .${D.input}`]:{width:0,minWidth:30}},[`& .${Qe.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Qe.root}.${Oe.sizeSmall}`]:{[`& .${Qe.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ve.root}`]:{padding:9,[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${D.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${D.endAdornment}`]:{right:9}},[`& .${Ve.root}.${Oe.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${D.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${we.root}`]:{paddingTop:19,paddingLeft:8,[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${we.input}`]:{padding:"7px 4px"},[`& .${D.endAdornment}`]:{right:9}},[`& .${we.root}.${Oe.sizeSmall}`]:{paddingBottom:1,[`& .${we.input}`]:{padding:"2.5px 4px"}},[`& .${Oe.hiddenLabel}`]:{paddingTop:8},[`& .${we.root}.${Oe.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${D.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${we.root}.${Oe.hiddenLabel}.${Oe.sizeSmall}`]:{[`& .${D.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${D.input}`]:a({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),An=L("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,o)=>o.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),Nn=L(ut,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,o)=>o.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),zn=L(ut,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},o)=>a({},o.popupIndicator,e.popupOpen&&o.popupIndicatorOpen)})(({ownerState:e})=>a({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),Dn=L(No,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${D.option}`]:o.option},o.popper,t.disablePortal&&o.popperDisablePortal]}})(({theme:e,ownerState:o})=>a({zIndex:(e.vars||e).zIndex.modal},o.disablePortal&&{position:"absolute"})),En=L(pt,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,o)=>o.paper})(({theme:e})=>a({},e.typography.body1,{overflow:"auto"})),Bn=L("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,o)=>o.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),jn=L("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,o)=>o.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),Wn=L("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,o)=>o.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${D.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${D.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${D.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Re(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${D.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Re(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${D.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),_n=L(nn,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,o)=>o.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),Un=L("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,o)=>o.groupUl})({padding:0,[`& .${D.option}`]:{paddingLeft:24}}),Hn=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiAutocomplete"}),{autoComplete:b=!1,autoHighlight:p=!1,autoSelect:m=!1,blurOnSelect:h=!1,ChipProps:$,className:v,clearIcon:R=Xo||(Xo=f.jsx(Gt,{fontSize:"small"})),clearOnBlur:M=!i.freeSolo,clearOnEscape:P=!1,clearText:O="Clear",closeText:k="Close",componentsProps:C={},defaultValue:I=i.multiple?[]:null,disableClearable:E=!1,disableCloseOnSelect:N=!1,disabled:F=!1,disabledItemsFocusable:q=!1,disableListWrap:le=!1,disablePortal:de=!1,filterSelectedOptions:oe=!1,forcePopupIcon:T="auto",freeSolo:Z=!1,fullWidth:G=!1,getLimitTagsText:se=n=>`+${n}`,getOptionLabel:Q,groupBy:re,handleHomeEndKeys:U=!i.freeSolo,includeInputInList:A=!1,limitTags:ie=-1,ListboxComponent:Se="ul",ListboxProps:Le,loading:ue=!1,loadingText:W="Loading…",multiple:ee=!1,noOptionsText:fe="No options",openOnFocus:We=!1,openText:Y="Open",PaperComponent:be=pt,PopperComponent:Me=No,popupIcon:J=Jo||(Jo=f.jsx(gt,{})),readOnly:H=!1,renderGroup:ze,renderInput:_e,renderOption:te,renderTags:S,selectOnFocus:to=!i.freeSolo,size:_="medium",slotProps:xe={}}=i,Fe=ae(i,wn),{getRootProps:ce,getInputProps:Te,getInputLabelProps:me,getPopupIndicatorProps:Ae,getClearProps:Je,getTagProps:De,getListboxProps:Ee,getOptionProps:z,value:j,dirty:he,expanded:Ke,id:qe,popupOpen:y,focused:B,focusedTag:X,anchorEl:ke,setAnchorEl:Ye,inputValue:Po,groupedOptions:Ne}=Zt(a({},i,{componentName:"Autocomplete"})),Ge=!E&&!F&&he&&!H,Ue=(!Z||T===!0)&&T!==!1,{onMouseDown:no}=Te(),{ref:eo}=Le??{},go=Ee(),{ref:mo}=go,ho=ae(go,Ln),ko=lo(mo,eo),ro=Q||(n=>{var g;return(g=n.label)!=null?g:n}),Ce=a({},i,{disablePortal:de,expanded:Ke,focused:B,fullWidth:G,getOptionLabel:ro,hasClearIcon:Ge,hasPopupIcon:Ue,inputFocused:X===-1,popupOpen:y,size:_}),ve=Fn(Ce);let Be;if(ee&&j.length>0){const n=g=>a({className:ve.tag,disabled:F},De(g));S?Be=S(j,n,Ce):Be=j.map((g,x)=>f.jsx(fn,a({label:ro(g),size:_},n({index:x}),$)))}if(ie>-1&&Array.isArray(Be)){const n=Be.length-ie;!B&&n>0&&(Be=Be.splice(0,ie),Be.push(f.jsx("span",{className:ve.tag,children:se(n)},Be.length)))}const Ro=ze||(n=>f.jsxs("li",{children:[f.jsx(_n,{className:ve.groupLabel,ownerState:Ce,component:"div",children:n.group}),f.jsx(Un,{className:ve.groupUl,ownerState:Ce,children:n.children})]},n.key)),wo=te||((n,g)=>{const{key:x}=n,K=ae(n,Mn);return f.jsx("li",a({},K,{children:ro(g)}),x)}),vo=(n,g)=>{const x=z({option:n,index:g});return wo(a({},x,{className:ve.option}),n,{selected:x["aria-selected"],index:g,inputValue:Po},Ce)},co=(r=xe.clearIndicator)!=null?r:C.clearIndicator,oo=(s=xe.paper)!=null?s:C.paper,ao=(c=xe.popper)!=null?c:C.popper,l=(d=xe.popupIndicator)!=null?d:C.popupIndicator;return f.jsxs(u.Fragment,{children:[f.jsx(Tn,a({ref:t,className:ne(ve.root,v),ownerState:Ce},ce(Fe),{children:_e({id:qe,disabled:F,fullWidth:!0,size:_==="small"?"small":void 0,InputLabelProps:me(),InputProps:a({ref:Ye,className:ve.inputRoot,startAdornment:Be,onClick:n=>{n.target===n.currentTarget&&no(n)}},(Ge||Ue)&&{endAdornment:f.jsxs(An,{className:ve.endAdornment,ownerState:Ce,children:[Ge?f.jsx(Nn,a({},Je(),{"aria-label":O,title:O,ownerState:Ce},co,{className:ne(ve.clearIndicator,co==null?void 0:co.className),children:R})):null,Ue?f.jsx(zn,a({},Ae(),{disabled:F,"aria-label":y?k:Y,title:y?k:Y,ownerState:Ce},l,{className:ne(ve.popupIndicator,l==null?void 0:l.className),children:J})):null]})}),inputProps:a({className:ve.input,disabled:F,readOnly:H},Te())})})),ke?f.jsx(Dn,a({as:Me,disablePortal:de,style:{width:ke?ke.clientWidth:null},ownerState:Ce,role:"presentation",anchorEl:ke,open:y},ao,{className:ne(ve.popper,ao==null?void 0:ao.className),children:f.jsxs(En,a({ownerState:Ce,as:be},oo,{className:ne(ve.paper,oo==null?void 0:oo.className),children:[ue&&Ne.length===0?f.jsx(Bn,{className:ve.loading,ownerState:Ce,children:W}):null,Ne.length===0&&!Z&&!ue?f.jsx(jn,{className:ve.noOptions,ownerState:Ce,role:"presentation",onMouseDown:n=>{n.preventDefault()},children:fe}):null,Ne.length>0?f.jsx(Wn,a({as:Se,className:ve.listbox,ownerState:Ce},ho,Le,{ref:ko,children:Ne.map((n,g)=>re?Ro({key:n.key,group:n.group,children:n.options.map((x,K)=>vo(x,n.index+K))}):vo(n,g))})):null]}))})):null]})}),Vn=Hn;function Kn(e){return ye("MuiCircularProgress",e)}$e("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const qn=["className","color","disableShrink","size","style","thickness","value","variant"];let So=e=>e,Yo,Zo,Qo,et;const Ze=44,Gn=it(Yo||(Yo=So` 0% { transform: rotate(0deg); } diff --git a/build/assets/index-e0a45087.js b/build/assets/index-deba249f.js similarity index 85% rename from build/assets/index-e0a45087.js rename to build/assets/index-deba249f.js index f4ab8199e..4b685ea61 100644 --- a/build/assets/index-e0a45087.js +++ b/build/assets/index-deba249f.js @@ -1 +1 @@ -import{p as f,a_ as m}from"./index-69dca385.js";import{D as y}from"./constants-a86c243d.js";const c={data:null,ids:[],loading:!1,total:0,filters:{is_muted:!1,sortBy:y,page:0,pageSize:50}};let r=null;const D=f((a,n)=>({...c,setTopics:async()=>{a({loading:!0}),r&&r.abort();const t=new AbortController,{signal:p}=t;r=t;const{data:d,ids:g,filters:o}=n(),u=T(o);o.page===0&&a({data:null,ids:[],total:0});try{const e=await m(u,p),l=o.page===0?{}:{...d||{}},i=o.page===0?[]:[...g];e.data.forEach(s=>{l[s.ref_id]=s,i.push(s.ref_id)}),a({data:l,ids:i,total:e.totalCount}),a({loading:!1})}catch(e){console.log(e)}},setFilters:t=>a({filters:{...n().filters,page:0,...t}}),terminate:()=>a(c)})),T=a=>({muted:a.is_muted?"True":"False",skip:String(a.page*a.pageSize),limit:String(a.pageSize),sort_by:a.sortBy,...a.search?{search:a.search}:{node_type:"Topic"}});export{D as u}; +import{p as f,a_ as m}from"./index-b856be88.js";import{D as y}from"./constants-011d5486.js";const c={data:null,ids:[],loading:!1,total:0,filters:{is_muted:!1,sortBy:y,page:0,pageSize:50}};let r=null;const D=f((a,n)=>({...c,setTopics:async()=>{a({loading:!0}),r&&r.abort();const t=new AbortController,{signal:p}=t;r=t;const{data:d,ids:g,filters:o}=n(),u=T(o);o.page===0&&a({data:null,ids:[],total:0});try{const e=await m(u,p),l=o.page===0?{}:{...d||{}},i=o.page===0?[]:[...g];e.data.forEach(s=>{l[s.ref_id]=s,i.push(s.ref_id)}),a({data:l,ids:i,total:e.totalCount}),a({loading:!1})}catch(e){console.log(e)}},setFilters:t=>a({filters:{...n().filters,page:0,...t}}),terminate:()=>a(c)})),T=a=>({muted:a.is_muted?"True":"False",skip:String(a.page*a.pageSize),limit:String(a.pageSize),sort_by:a.sortBy,...a.search?{search:a.search}:{node_type:"Topic"}});export{D as u}; diff --git a/build/assets/index-7d2b0c32.js b/build/assets/index-f7131056.js similarity index 79% rename from build/assets/index-7d2b0c32.js rename to build/assets/index-f7131056.js index 0bea4b919..d876ecdc2 100644 --- a/build/assets/index-7d2b0c32.js +++ b/build/assets/index-f7131056.js @@ -1,9 +1,9 @@ -import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y as Ji,J as Od,A as Gl,U as $l,w as Xl,V as Ad,C as Md,R as Dd,X as Pd,H as Nd,Y as Id,O as Rd}from"./index-69dca385.js";import{u as Nt,a as be,m as fo,b as po,e as Na,L as Fd,c as Ld,d as Vd,f as Ud,g as Zl,H as tr,t as Ql,T as zd,h as jd,i as Bd,C as qd,P as Wd,j as Hd}from"./index-47786f03.js";import{P as ei,B as Kl,c as Pc,H as Yd,E as Gd,_ as Bt,d as qe,e as We,f as oe,g as Ia,h as mo,T as Nc,i as $d,j as Xd,k as Zd,l as Qd,m as Kd,n as Jd,D as tf,I as ef,o as sf,u as pr,p as nf,q as rf,r as of,s as af,N as cf,t as lf,O as uf,v as hf}from"./index-94c3c981.js";import{T as df}from"./TextareaAutosize-6f8daf3f.js";import{D as mr,F as ff,V as rt,L as pf,a as mf,M as gn,b as _t,S as _f,B as gf,c as Jl,P as Ro,d as yf,e as Dr,f as qs,T as _o,g as ra,h as vf,i as Ic,j as er,Q as kf,G as xf,C as go,k as Tf,l as tu,W as wf,m as bf,n as Cf,E as Sf,o as Ef,p as Of,q as sr,r as Rc,s as Fc}from"./three.module-52004ab8.js";import{M as Af,a as Mf}from"./index.esm-86c83cdb.js";import{u as Df}from"./index-f0d2a829.js";import{C as Pf}from"./ClipLoader-e049ef5e.js";function Nf(i){let t;const e=new Set,s=(l,u)=>{const h=typeof l=="function"?l(t):l;if(h!==t){const d=t;t=u?h:Object.assign({},t,h),e.forEach(f=>f(t,d))}},n=()=>t,r=(l,u=n,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(t);function f(){const _=u(t);if(!h(d,_)){const p=d;l(d=_,p)}}return e.add(f),()=>e.delete(f)},c={setState:s,getState:n,subscribe:(l,u,h)=>u||h?r(l,u,h):(e.add(l),()=>e.delete(l)),destroy:()=>e.clear()};return t=i(s,n,c),c}const If=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Lc=If?A.useEffect:A.useLayoutEffect;function Rf(i){const t=typeof i=="function"?Nf(i):i,e=(s=t.getState,n=Object.is)=>{const[,r]=A.useReducer(m=>m+1,0),o=t.getState(),a=A.useRef(o),c=A.useRef(s),l=A.useRef(n),u=A.useRef(!1),h=A.useRef();h.current===void 0&&(h.current=s(o));let d,f=!1;(a.current!==o||c.current!==s||l.current!==n||u.current)&&(d=s(o),f=!n(h.current,d)),Lc(()=>{f&&(h.current=d),a.current=o,c.current=s,l.current=n,u.current=!1});const _=A.useRef(o);Lc(()=>{const m=()=>{try{const w=t.getState(),b=c.current(w);l.current(h.current,b)||(a.current=w,h.current=b,r())}catch{u.current=!0,r()}},y=t.subscribe(m);return t.getState()!==_.current&&m(),y},[]);const p=f?d:h.current;return A.useDebugValue(p),p};return Object.assign(e,t),e[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const s=[e,t];return{next(){const n=s.length<=0;return{value:s.shift(),done:n}}}},e}let si=0;const Ff=Rf(i=>(mr.onStart=(t,e,s)=>{i({active:!0,item:t,loaded:e,total:s,progress:(e-si)/(s-si)*100})},mr.onLoad=()=>{i({active:!1})},mr.onError=t=>i(e=>({errors:[...e.errors,t]})),mr.onProgress=(t,e,s)=>{e===s&&(si=s),i({active:!0,item:t,loaded:e,total:s,progress:(e-si)/(s-si)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),Lf=i=>`Loading ${i.toFixed(2)}%`;function Vf({containerStyles:i,innerStyles:t,barStyles:e,dataStyles:s,dataInterpolation:n=Lf,initialState:r=o=>o}){const{active:o,progress:a}=Ff(),c=A.useRef(0),l=A.useRef(0),u=A.useRef(null),[h,d]=A.useState(r(o));A.useEffect(()=>{let _;return o!==h&&(_=setTimeout(()=>d(o),300)),()=>clearTimeout(_)},[h,o]);const f=A.useCallback(()=>{u.current&&(c.current+=(a-c.current)/2,(c.current>.95*a||a===100)&&(c.current=a),u.current.innerText=n(c.current),c.current(f(),()=>cancelAnimationFrame(l.current)),[f]),h?A.createElement("div",{style:{..._r.container,opacity:o?1:0,...i}},A.createElement("div",null,A.createElement("div",{style:{..._r.inner,...t}},A.createElement("div",{style:{..._r.bar,transform:`scaleX(${a/100})`,...e}}),A.createElement("span",{ref:u,style:{..._r.data,...s}})))):null}const _r={container:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"#171717",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 300ms ease",zIndex:1e3},inner:{width:100,height:3,background:"#272727",textAlign:"center"},bar:{height:3,width:"100%",background:"white",transition:"transform 200ms",transformOrigin:"left center"},data:{display:"inline-block",position:"relative",fontVariantNumeric:"tabular-nums",marginTop:"0.8em",color:"#f0f0f0",fontSize:"0.6em",fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Helvetica, Arial, Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',whiteSpace:"nowrap"}},Fo=new ff,Lo=new rt,yn=new rt,Re=new rt,rs=new rt,Ge=new rt,os=new rt,as=new rt,ni=new rt,ii=new rt,ri=new rt,gr=new rt,oi=new rt,ai=new rt,ci=new rt;class Uf{constructor(t,e,s){this.camera=t,this.scene=e,this.startPoint=new rt,this.endPoint=new rt,this.collection=[],this.deep=s||Number.MAX_VALUE}select(t,e){return this.startPoint=t||this.startPoint,this.endPoint=e||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(Fo,this.scene),this.collection}updateFrustum(t,e){if(t=t||this.startPoint,e=e||this.endPoint,t.x===e.x&&(e.x+=Number.EPSILON),t.y===e.y&&(e.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){yn.copy(t),yn.x=Math.min(t.x,e.x),yn.y=Math.max(t.y,e.y),e.x=Math.max(t.x,e.x),e.y=Math.min(t.y,e.y),Re.setFromMatrixPosition(this.camera.matrixWorld),rs.copy(yn),Ge.set(e.x,yn.y,0),os.copy(e),as.set(yn.x,e.y,0),rs.unproject(this.camera),Ge.unproject(this.camera),os.unproject(this.camera),as.unproject(this.camera),oi.copy(rs).sub(Re),ai.copy(Ge).sub(Re),ci.copy(os).sub(Re),oi.normalize(),ai.normalize(),ci.normalize(),oi.multiplyScalar(this.deep),ai.multiplyScalar(this.deep),ci.multiplyScalar(this.deep),oi.add(Re),ai.add(Re),ci.add(Re);var s=Fo.planes;s[0].setFromCoplanarPoints(Re,rs,Ge),s[1].setFromCoplanarPoints(Re,Ge,os),s[2].setFromCoplanarPoints(os,as,Re),s[3].setFromCoplanarPoints(as,rs,Re),s[4].setFromCoplanarPoints(Ge,os,as),s[5].setFromCoplanarPoints(ci,ai,oi),s[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const n=Math.min(t.x,e.x),r=Math.max(t.y,e.y),o=Math.max(t.x,e.x),a=Math.min(t.y,e.y);rs.set(n,r,-1),Ge.set(o,r,-1),os.set(o,a,-1),as.set(n,a,-1),ni.set(n,r,1),ii.set(o,r,1),ri.set(o,a,1),gr.set(n,a,1),rs.unproject(this.camera),Ge.unproject(this.camera),os.unproject(this.camera),as.unproject(this.camera),ni.unproject(this.camera),ii.unproject(this.camera),ri.unproject(this.camera),gr.unproject(this.camera);var s=Fo.planes;s[0].setFromCoplanarPoints(rs,ni,ii),s[1].setFromCoplanarPoints(Ge,ii,ri),s[2].setFromCoplanarPoints(ri,gr,as),s[3].setFromCoplanarPoints(gr,ni,rs),s[4].setFromCoplanarPoints(Ge,os,as),s[5].setFromCoplanarPoints(ri,ii,ni),s[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(t,e){if((e.isMesh||e.isLine||e.isPoints)&&e.material!==void 0&&(e.geometry.boundingSphere===null&&e.geometry.computeBoundingSphere(),Lo.copy(e.geometry.boundingSphere.center),Lo.applyMatrix4(e.matrixWorld),t.containsPoint(Lo)&&this.collection.push(e)),e.children.length>0)for(let s=0;s0?X.copy(P[P.length-1]):X.identity())}function n(I){const F=new qs,S=new _t,D=new _t,H=new _t;let N=!0,V=!1;const st=I.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi);for(let nt=0,J=st.length;nt0&&(S.copy(H),F.currentPath.currentPoint.copy(S),N=!0);break;default:console.warn(pt)}V=!1}return F}function r(I){if(!(!I.sheet||!I.sheet.cssRules||!I.sheet.cssRules.length))for(let F=0;FH.trim());for(let H=0;H1){const Dc=Math.sqrt(Z);F=Dc*F,S=Dc*S,K=F*F,B=S*S}const tt=K*E+B*O,lt=(K*B-tt)/tt;let vt=Math.sqrt(Math.max(0,lt));H===N&&(vt=-vt);const Yt=vt*F*pt/S,Ie=-vt*S*J/F,ti=Math.cos(D)*Yt-Math.sin(D)*Ie+(V.x+it.x)/2,Io=Math.sin(D)*Yt+Math.cos(D)*Ie+(V.y+it.y)/2,fr=a(1,0,(J-Yt)/F,(pt-Ie)/S),Ed=a((J-Yt)/F,(pt-Ie)/S,(-J-Yt)/F,(-pt-Ie)/S)%(Math.PI*2);I.currentPath.absellipse(ti,Io,F,S,fr,fr+Ed,N===0,D)}function a(I,F,S,D){const H=I*S+F*D,N=Math.sqrt(I*I+F*F)*Math.sqrt(S*S+D*D);let V=Math.acos(Math.max(-1,Math.min(1,H/N)));return I*D-F*S<0&&(V=-V),V}function c(I){const F=b(I.getAttribute("x")||0),S=b(I.getAttribute("y")||0),D=b(I.getAttribute("rx")||I.getAttribute("ry")||0),H=b(I.getAttribute("ry")||I.getAttribute("rx")||0),N=b(I.getAttribute("width")),V=b(I.getAttribute("height")),it=1-.551915024494,st=new qs;return st.moveTo(F+D,S),st.lineTo(F+N-D,S),(D!==0||H!==0)&&st.bezierCurveTo(F+N-D*it,S,F+N,S+H*it,F+N,S+H),st.lineTo(F+N,S+V-H),(D!==0||H!==0)&&st.bezierCurveTo(F+N,S+V-H*it,F+N-D*it,S+V,F+N-D,S+V),st.lineTo(F+D,S+V),(D!==0||H!==0)&&st.bezierCurveTo(F+D*it,S+V,F,S+V-H*it,F,S+V-H),st.lineTo(F,S+H),(D!==0||H!==0)&&st.bezierCurveTo(F,S+H*it,F+D*it,S,F+D,S),st}function l(I){function F(N,V,it){const st=b(V),nt=b(it);H===0?D.moveTo(st,nt):D.lineTo(st,nt),H++}const S=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,D=new qs;let H=0;return I.getAttribute("points").replace(S,F),D.currentPath.autoClose=!0,D}function u(I){function F(N,V,it){const st=b(V),nt=b(it);H===0?D.moveTo(st,nt):D.lineTo(st,nt),H++}const S=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,D=new qs;let H=0;return I.getAttribute("points").replace(S,F),D.currentPath.autoClose=!1,D}function h(I){const F=b(I.getAttribute("cx")||0),S=b(I.getAttribute("cy")||0),D=b(I.getAttribute("r")||0),H=new Ro;H.absarc(F,S,D,0,Math.PI*2);const N=new qs;return N.subPaths.push(H),N}function d(I){const F=b(I.getAttribute("cx")||0),S=b(I.getAttribute("cy")||0),D=b(I.getAttribute("rx")||0),H=b(I.getAttribute("ry")||0),N=new Ro;N.absellipse(F,S,D,H,0,Math.PI*2);const V=new qs;return V.subPaths.push(N),V}function f(I){const F=b(I.getAttribute("x1")||0),S=b(I.getAttribute("y1")||0),D=b(I.getAttribute("x2")||0),H=b(I.getAttribute("y2")||0),N=new qs;return N.moveTo(F,S),N.lineTo(D,H),N.currentPath.autoClose=!1,N}function _(I,F){F=Object.assign({},F);let S={};if(I.hasAttribute("class")){const V=I.getAttribute("class").split(/\s/).filter(Boolean).map(it=>it.trim());for(let it=0;it0&&F.premultiply(P[P.length-1]),X.copy(F),P.push(F),F}function g(I){const F=new gn,S=U;if(I.nodeName==="use"&&(I.hasAttribute("x")||I.hasAttribute("y"))){const D=b(I.getAttribute("x")),H=b(I.getAttribute("y"));F.translate(D,H)}if(I.hasAttribute("transform")){const D=I.getAttribute("transform").split(")");for(let H=D.length-1;H>=0;H--){const N=D[H].trim();if(N==="")continue;const V=N.indexOf("("),it=N.length;if(V>0&&V=1){const J=nt[0];let pt=J;nt.length>=2&&(pt=nt[1]),S.translate(J,pt)}break;case"rotate":if(nt.length>=1){let J=0,pt=0,K=0;J=-nt[0]*Math.PI/180,nt.length>=3&&(pt=nt[1],K=nt[2]),W.identity().translate(-pt,-K),G.identity().rotate(J),Y.multiplyMatrices(G,W),W.identity().translate(pt,K),S.multiplyMatrices(W,Y)}break;case"scale":if(nt.length>=1){const J=nt[0];let pt=J;nt.length>=2&&(pt=nt[1]),S.scale(J,pt)}break;case"skewX":nt.length===1&&S.set(1,Math.tan(nt[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":nt.length===1&&S.set(1,0,0,Math.tan(nt[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":nt.length===6&&S.set(nt[0],nt[2],nt[4],nt[1],nt[3],nt[5],0,0,1);break}}F.premultiply(S)}}return F}function T(I,F){function S(N){z.set(N.x,N.y,1).applyMatrix3(F),N.set(z.x,z.y)}const D=x(F),H=I.subPaths;for(let N=0,V=H.length;N=1||Y<0||Y>1)return null;if(P===0&&W===0){for(let j=0;j<2;j++)if(o(j===0?w:b,m,y),n.loc==s.ORIGIN){const z=j===0?w:b;return{x:z.x,y:z.y,t:n.t}}else if(n.loc==s.BETWEEN){const z=+(v+n.t*(g-v)).toPrecision(10),X=+(k+n.t*(C-k)).toPrecision(10);return{x:z,y:X,t:n.t}}return null}else{for(let X=0;X<2;X++)if(o(X===0?w:b,m,y),n.loc==s.ORIGIN){const Q=X===0?w:b;return{x:Q.x,y:Q.y,t:n.t}}const j=+(v+G*(g-v)).toPrecision(10),z=+(k+G*(C-k)).toPrecision(10);return{x:j,y:z,t:G}}}function o(m,y,w){const b=w.x-y.x,v=w.y-y.y,g=m.x-y.x,T=m.y-y.y,x=b*T-g*v;if(m.x===y.x&&m.y===y.y){n.loc=s.ORIGIN,n.t=0;return}if(m.x===w.x&&m.y===w.y){n.loc=s.DESTINATION,n.t=1;return}if(x<-Number.EPSILON){n.loc=s.LEFT;return}if(x>Number.EPSILON){n.loc=s.RIGHT;return}if(b*g<0||v*T<0){n.loc=s.BEHIND;return}if(Math.sqrt(b*b+v*v)R.t<=M.t+Number.EPSILON&&R.t>=M.t-Number.EPSILON)===void 0&&(w.push(M),b.push(new _t(M.x,M.y)))}}return b}function c(m,y,w){const b=new _t;y.getCenter(b);const v=[];return w.forEach(g=>{g.boundingBox.containsPoint(b)&&a(m,g.points).forEach(x=>{v.push({identifier:g.identifier,isCW:g.isCW,point:x})})}),v.sort((g,T)=>g.point.x-T.point.x),v}function l(m,y,w,b,v){(v==null||v==="")&&(v="nonzero");const g=new _t;m.boundingBox.getCenter(g);const T=[new _t(w,g.y),new _t(b,g.y)],x=c(T,m.boundingBox,y);x.sort((U,W)=>U.point.x-W.point.x);const k=[],C=[];x.forEach(U=>{U.identifier===m.identifier?k.push(U):C.push(U)});const M=k[0].point.x,R=[];let P=0;for(;P0&&R[R.length-1]===C[P].identifier?R.pop():R.push(C[P].identifier),P++;if(R.push(m.identifier),v==="evenodd"){const U=R.length%2===0,W=R[R.length-2];return{identifier:m.identifier,isHole:U,for:W}}else if(v==="nonzero"){let U=!0,W=null,G=null;for(let Y=0;Y{const y=m.getPoints();let w=-999999999,b=999999999,v=-999999999,g=999999999;for(let T=0;Tw&&(w=x.y),x.yv&&(v=x.x),x.x=g&&(h=g-1),{curves:m.curves,points:y,isCW:_f.isClockWise(y),identifier:u++,boundingBox:new gf(new _t(g,b),new _t(v,w))}});f=f.filter(m=>m.points.length>1);const _=f.map(m=>l(m,f,h,d,t.userData.style.fillRule)),p=[];return f.forEach(m=>{if(!_[m.identifier].isHole){const w=new Jl;w.curves=m.curves,_.filter(v=>v.isHole&&v.for===m.identifier).forEach(v=>{const g=f[v.identifier],T=new Ro;T.curves=g.curves,w.holes.push(T)}),p.push(w)}}),p}static getStrokeStyle(t,e,s,n,r){return t=t!==void 0?t:1,e=e!==void 0?e:"#000",s=s!==void 0?s:"miter",n=n!==void 0?n:"butt",r=r!==void 0?r:4,{strokeColor:e,strokeWidth:t,strokeLineJoin:s,strokeLineCap:n,strokeMiterLimit:r}}static pointsToStroke(t,e,s,n){const r=[],o=[],a=[];if(xi.pointsToStrokeWithBuffers(t,e,s,n,r,o,a)===0)return null;const c=new yf;return c.setAttribute("position",new Dr(r,3)),c.setAttribute("normal",new Dr(o,3)),c.setAttribute("uv",new Dr(a,2)),c}static pointsToStrokeWithBuffers(t,e,s,n,r,o,a,c){const l=new _t,u=new _t,h=new _t,d=new _t,f=new _t,_=new _t,p=new _t,m=new _t,y=new _t,w=new _t,b=new _t,v=new _t,g=new _t,T=new _t,x=new _t,k=new _t,C=new _t;s=s!==void 0?s:12,n=n!==void 0?n:.001,c=c!==void 0?c:0,t=pt(t);const M=t.length;if(M<2)return 0;const R=t[0].equals(t[M-1]);let P,U=t[0],W;const G=e.strokeWidth/2,Y=1/(M-1);let j=0,z,X,Q,et,I=!1,F=0,S=c*3,D=c*2;H(t[0],t[1],l).multiplyScalar(G),m.copy(t[0]).sub(l),y.copy(t[0]).add(l),w.copy(m),b.copy(y);for(let K=1;K=n&&O.push(K[E]);return O.push(K[K.length-1]),O}}}function zf(i,t){if(Object.is(i,t))return!0;if(typeof i!="object"||i===null||typeof t!="object"||t===null)return!1;const e=Object.keys(i);if(e.length!==Object.keys(t).length)return!1;for(let s=0;sc,...a}){const{setEvents:c,camera:l,raycaster:u,gl:h,controls:d,size:f,get:_}=Nt(),[p,m]=A.useState(!1),[y,w]=A.useReducer((T,{object:x,shift:k})=>x===void 0?[]:Array.isArray(x)?x:k?T.includes(x)?T.filter(C=>C!==x):[x,...T]:T[0]===x?[]:[x],[]);A.useEffect(()=>void(s==null?void 0:s(y)),[y]);const b=A.useCallback(T=>{T.stopPropagation(),w({object:o([T.object])[0],shift:t&&T.shiftKey})},[]),v=A.useCallback(T=>!p&&w({}),[p]),g=A.useRef(null);return A.useEffect(()=>{if(!i||!t)return;const T=new Uf(l,g.current),x=document.createElement("div");x.style.pointerEvents="none",x.style.border=n,x.style.backgroundColor=r,x.style.position="fixed";const k=new _t,C=new _t,M=new _t,R=_().events.enabled,P=d==null?void 0:d.enabled;let U=!1;function W(I,F){const{offsetX:S,offsetY:D}=I,{width:H,height:N}=f;F.set(S/H*2-1,-(D/N)*2+1)}function G(I){var F;d&&(d.enabled=!1),c({enabled:!1}),U=!0,(F=h.domElement.parentElement)==null||F.appendChild(x),x.style.left=`${I.clientX}px`,x.style.top=`${I.clientY}px`,x.style.width="0px",x.style.height="0px",k.x=I.clientX,k.y=I.clientY}function Y(I){M.x=Math.max(k.x,I.clientX),M.y=Math.max(k.y,I.clientY),C.x=Math.min(k.x,I.clientX),C.y=Math.min(k.y,I.clientY),x.style.left=`${C.x}px`,x.style.top=`${C.y}px`,x.style.width=`${M.x-C.x}px`,x.style.height=`${M.y-C.y}px`}function j(){if(U){var I;d&&(d.enabled=P),c({enabled:R}),U=!1,(I=x.parentElement)==null||I.removeChild(x)}}function z(I){I.shiftKey&&(G(I),W(I,T.startPoint))}let X=[];function Q(I){if(U){Y(I),W(I,T.endPoint);const F=T.select().sort(S=>S.uuid).filter(S=>S.isMesh);zf(F,X)||(X=F,w({object:o(F)}))}}function et(I){U&&j()}return document.addEventListener("pointerdown",z,{passive:!0}),document.addEventListener("pointermove",Q,{passive:!0,capture:!0}),document.addEventListener("pointerup",et,{passive:!0}),()=>{document.removeEventListener("pointerdown",z),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",et)}},[f.width,f.height,u,l,d,h]),A.createElement("group",Oe({ref:g,onClick:b,onPointerOver:()=>m(!0),onPointerOut:()=>m(!1),onPointerMissed:v},a),A.createElement(jf.Provider,{value:y},e))}const eu=A.forwardRef(function({follow:t=!0,lockX:e=!1,lockY:s=!1,lockZ:n=!1,...r},o){const a=A.useRef();return be(({camera:c})=>{if(!t||!a.current)return;const l=a.current.rotation.clone();c.getWorldQuaternion(a.current.quaternion),e&&(a.current.rotation.x=l.x),s&&(a.current.rotation.y=l.y),n&&(a.current.rotation.z=l.z)}),A.createElement("group",Oe({ref:fo([a,o])},r))}),Vc=i=>i===Object(i)&&!Array.isArray(i)&&typeof i!="function";function Ks(i,t){const e=Nt(n=>n.gl),s=po(_o,Vc(i)?Object.values(i):i);if(A.useLayoutEffect(()=>{t==null||t(s)},[t]),A.useEffect(()=>{(Array.isArray(s)?s:[s]).forEach(e.initTexture)},[e,s]),Vc(i)){const n=Object.keys(i),r={};return n.forEach(o=>Object.assign(r,{[o]:s[n.indexOf(o)]})),r}else return s}Ks.preload=i=>po.preload(_o,i);Ks.clear=i=>po.clear(_o,i);const qf=A.forwardRef(function({src:t,skipFill:e,skipStrokes:s,fillMaterial:n,strokeMaterial:r,fillMeshProps:o,strokeMeshProps:a,...c},l){const u=po(xi,t.startsWith("s?[]:u.paths.map(d=>{var f;return((f=d.userData)==null?void 0:f.style.stroke)===void 0||d.userData.style.stroke==="none"?null:d.subPaths.map(_=>xi.pointsToStroke(_.getPoints(),d.userData.style))}),[u,s]);return A.useEffect(()=>()=>h.forEach(d=>d&&d.map(f=>f.dispose())),[h]),A.createElement("object3D",Oe({ref:l},c),A.createElement("object3D",{scale:[1,-1,1]},u.paths.map((d,f)=>{var _,p;return A.createElement(A.Fragment,{key:f},!e&&((_=d.userData)==null?void 0:_.style.fill)!==void 0&&d.userData.style.fill!=="none"&&xi.createShapes(d).map((m,y)=>A.createElement("mesh",Oe({key:y},o),A.createElement("shapeGeometry",{args:[m]}),A.createElement("meshBasicMaterial",Oe({color:d.userData.style.fill,opacity:d.userData.style.fillOpacity,transparent:!0,side:ra,depthWrite:!1},n)))),!s&&((p=d.userData)==null?void 0:p.style.stroke)!==void 0&&d.userData.style.stroke!=="none"&&d.subPaths.map((m,y)=>A.createElement("mesh",Oe({key:y,geometry:h[f][y]},a),A.createElement("meshBasicMaterial",Oe({color:d.userData.style.stroke,opacity:d.userData.style.strokeOpacity,transparent:!0,side:ra,depthWrite:!1},r)))))})))});/*! +import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y as Ji,J as Od,A as Gl,U as $l,w as Xl,V as Ad,C as Md,R as Dd,X as Pd,H as Nd,Y as Id,O as Rd}from"./index-b856be88.js";import{u as Nt,a as be,m as fo,b as po,e as Na,L as Fd,c as Ld,d as Vd,f as Ud,g as Zl,H as tr,t as Ql,T as zd,h as jd,i as Bd,C as qd,P as Wd,j as Hd}from"./index-680a4e6b.js";import{P as ei,B as Kl,c as Pc,H as Yd,E as Gd,_ as Bt,d as qe,e as We,f as oe,g as Ia,h as mo,T as Nc,i as $d,j as Xd,k as Zd,l as Qd,m as Kd,n as Jd,D as tf,I as ef,o as sf,u as pr,p as nf,q as rf,r as of,s as af,N as cf,t as lf,O as uf,v as hf}from"./index-c59af388.js";import{T as df}from"./TextareaAutosize-981375ed.js";import{D as mr,F as ff,V as rt,L as pf,a as mf,M as gn,b as _t,S as _f,B as gf,c as Jl,P as Ro,d as yf,e as Dr,f as qs,T as _o,g as ra,h as vf,i as Ic,j as er,Q as kf,G as xf,C as go,k as Tf,l as tu,W as wf,m as bf,n as Cf,E as Sf,o as Ef,p as Of,q as sr,r as Rc,s as Fc}from"./three.module-52004ab8.js";import{M as Af,a as Mf}from"./index.esm-c2a09dd4.js";import{u as Df}from"./index-bf6ce8a9.js";import{C as Pf}from"./ClipLoader-83661b90.js";function Nf(i){let t;const e=new Set,s=(l,u)=>{const h=typeof l=="function"?l(t):l;if(h!==t){const d=t;t=u?h:Object.assign({},t,h),e.forEach(p=>p(t,d))}},n=()=>t,r=(l,u=n,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(t);function p(){const m=u(t);if(!h(d,m)){const f=d;l(d=m,f)}}return e.add(p),()=>e.delete(p)},c={setState:s,getState:n,subscribe:(l,u,h)=>u||h?r(l,u,h):(e.add(l),()=>e.delete(l)),destroy:()=>e.clear()};return t=i(s,n,c),c}const If=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Lc=If?A.useEffect:A.useLayoutEffect;function Rf(i){const t=typeof i=="function"?Nf(i):i,e=(s=t.getState,n=Object.is)=>{const[,r]=A.useReducer(_=>_+1,0),o=t.getState(),a=A.useRef(o),c=A.useRef(s),l=A.useRef(n),u=A.useRef(!1),h=A.useRef();h.current===void 0&&(h.current=s(o));let d,p=!1;(a.current!==o||c.current!==s||l.current!==n||u.current)&&(d=s(o),p=!n(h.current,d)),Lc(()=>{p&&(h.current=d),a.current=o,c.current=s,l.current=n,u.current=!1});const m=A.useRef(o);Lc(()=>{const _=()=>{try{const w=t.getState(),b=c.current(w);l.current(h.current,b)||(a.current=w,h.current=b,r())}catch{u.current=!0,r()}},y=t.subscribe(_);return t.getState()!==m.current&&_(),y},[]);const f=p?d:h.current;return A.useDebugValue(f),f};return Object.assign(e,t),e[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const s=[e,t];return{next(){const n=s.length<=0;return{value:s.shift(),done:n}}}},e}let si=0;const Ff=Rf(i=>(mr.onStart=(t,e,s)=>{i({active:!0,item:t,loaded:e,total:s,progress:(e-si)/(s-si)*100})},mr.onLoad=()=>{i({active:!1})},mr.onError=t=>i(e=>({errors:[...e.errors,t]})),mr.onProgress=(t,e,s)=>{e===s&&(si=s),i({active:!0,item:t,loaded:e,total:s,progress:(e-si)/(s-si)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),Lf=i=>`Loading ${i.toFixed(2)}%`;function Vf({containerStyles:i,innerStyles:t,barStyles:e,dataStyles:s,dataInterpolation:n=Lf,initialState:r=o=>o}){const{active:o,progress:a}=Ff(),c=A.useRef(0),l=A.useRef(0),u=A.useRef(null),[h,d]=A.useState(r(o));A.useEffect(()=>{let m;return o!==h&&(m=setTimeout(()=>d(o),300)),()=>clearTimeout(m)},[h,o]);const p=A.useCallback(()=>{u.current&&(c.current+=(a-c.current)/2,(c.current>.95*a||a===100)&&(c.current=a),u.current.innerText=n(c.current),c.current(p(),()=>cancelAnimationFrame(l.current)),[p]),h?A.createElement("div",{style:{..._r.container,opacity:o?1:0,...i}},A.createElement("div",null,A.createElement("div",{style:{..._r.inner,...t}},A.createElement("div",{style:{..._r.bar,transform:`scaleX(${a/100})`,...e}}),A.createElement("span",{ref:u,style:{..._r.data,...s}})))):null}const _r={container:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"#171717",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 300ms ease",zIndex:1e3},inner:{width:100,height:3,background:"#272727",textAlign:"center"},bar:{height:3,width:"100%",background:"white",transition:"transform 200ms",transformOrigin:"left center"},data:{display:"inline-block",position:"relative",fontVariantNumeric:"tabular-nums",marginTop:"0.8em",color:"#f0f0f0",fontSize:"0.6em",fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Helvetica, Arial, Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',whiteSpace:"nowrap"}},Fo=new ff,Lo=new rt,yn=new rt,Re=new rt,rs=new rt,Ge=new rt,os=new rt,as=new rt,ni=new rt,ii=new rt,ri=new rt,gr=new rt,oi=new rt,ai=new rt,ci=new rt;class Uf{constructor(t,e,s){this.camera=t,this.scene=e,this.startPoint=new rt,this.endPoint=new rt,this.collection=[],this.deep=s||Number.MAX_VALUE}select(t,e){return this.startPoint=t||this.startPoint,this.endPoint=e||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(Fo,this.scene),this.collection}updateFrustum(t,e){if(t=t||this.startPoint,e=e||this.endPoint,t.x===e.x&&(e.x+=Number.EPSILON),t.y===e.y&&(e.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){yn.copy(t),yn.x=Math.min(t.x,e.x),yn.y=Math.max(t.y,e.y),e.x=Math.max(t.x,e.x),e.y=Math.min(t.y,e.y),Re.setFromMatrixPosition(this.camera.matrixWorld),rs.copy(yn),Ge.set(e.x,yn.y,0),os.copy(e),as.set(yn.x,e.y,0),rs.unproject(this.camera),Ge.unproject(this.camera),os.unproject(this.camera),as.unproject(this.camera),oi.copy(rs).sub(Re),ai.copy(Ge).sub(Re),ci.copy(os).sub(Re),oi.normalize(),ai.normalize(),ci.normalize(),oi.multiplyScalar(this.deep),ai.multiplyScalar(this.deep),ci.multiplyScalar(this.deep),oi.add(Re),ai.add(Re),ci.add(Re);var s=Fo.planes;s[0].setFromCoplanarPoints(Re,rs,Ge),s[1].setFromCoplanarPoints(Re,Ge,os),s[2].setFromCoplanarPoints(os,as,Re),s[3].setFromCoplanarPoints(as,rs,Re),s[4].setFromCoplanarPoints(Ge,os,as),s[5].setFromCoplanarPoints(ci,ai,oi),s[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const n=Math.min(t.x,e.x),r=Math.max(t.y,e.y),o=Math.max(t.x,e.x),a=Math.min(t.y,e.y);rs.set(n,r,-1),Ge.set(o,r,-1),os.set(o,a,-1),as.set(n,a,-1),ni.set(n,r,1),ii.set(o,r,1),ri.set(o,a,1),gr.set(n,a,1),rs.unproject(this.camera),Ge.unproject(this.camera),os.unproject(this.camera),as.unproject(this.camera),ni.unproject(this.camera),ii.unproject(this.camera),ri.unproject(this.camera),gr.unproject(this.camera);var s=Fo.planes;s[0].setFromCoplanarPoints(rs,ni,ii),s[1].setFromCoplanarPoints(Ge,ii,ri),s[2].setFromCoplanarPoints(ri,gr,as),s[3].setFromCoplanarPoints(gr,ni,rs),s[4].setFromCoplanarPoints(Ge,os,as),s[5].setFromCoplanarPoints(ri,ii,ni),s[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(t,e){if((e.isMesh||e.isLine||e.isPoints)&&e.material!==void 0&&(e.geometry.boundingSphere===null&&e.geometry.computeBoundingSphere(),Lo.copy(e.geometry.boundingSphere.center),Lo.applyMatrix4(e.matrixWorld),t.containsPoint(Lo)&&this.collection.push(e)),e.children.length>0)for(let s=0;s0?X.copy(P[P.length-1]):X.identity())}function n(I){const F=new qs,S=new _t,D=new _t,H=new _t;let N=!0,V=!1;const st=I.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi);for(let nt=0,J=st.length;nt0&&(S.copy(H),F.currentPath.currentPoint.copy(S),N=!0);break;default:console.warn(pt)}V=!1}return F}function r(I){if(!(!I.sheet||!I.sheet.cssRules||!I.sheet.cssRules.length))for(let F=0;FH.trim());for(let H=0;H1){const Dc=Math.sqrt(Z);F=Dc*F,S=Dc*S,K=F*F,B=S*S}const tt=K*E+B*O,lt=(K*B-tt)/tt;let vt=Math.sqrt(Math.max(0,lt));H===N&&(vt=-vt);const Yt=vt*F*pt/S,Ie=-vt*S*J/F,ti=Math.cos(D)*Yt-Math.sin(D)*Ie+(V.x+it.x)/2,Io=Math.sin(D)*Yt+Math.cos(D)*Ie+(V.y+it.y)/2,fr=a(1,0,(J-Yt)/F,(pt-Ie)/S),Ed=a((J-Yt)/F,(pt-Ie)/S,(-J-Yt)/F,(-pt-Ie)/S)%(Math.PI*2);I.currentPath.absellipse(ti,Io,F,S,fr,fr+Ed,N===0,D)}function a(I,F,S,D){const H=I*S+F*D,N=Math.sqrt(I*I+F*F)*Math.sqrt(S*S+D*D);let V=Math.acos(Math.max(-1,Math.min(1,H/N)));return I*D-F*S<0&&(V=-V),V}function c(I){const F=b(I.getAttribute("x")||0),S=b(I.getAttribute("y")||0),D=b(I.getAttribute("rx")||I.getAttribute("ry")||0),H=b(I.getAttribute("ry")||I.getAttribute("rx")||0),N=b(I.getAttribute("width")),V=b(I.getAttribute("height")),it=1-.551915024494,st=new qs;return st.moveTo(F+D,S),st.lineTo(F+N-D,S),(D!==0||H!==0)&&st.bezierCurveTo(F+N-D*it,S,F+N,S+H*it,F+N,S+H),st.lineTo(F+N,S+V-H),(D!==0||H!==0)&&st.bezierCurveTo(F+N,S+V-H*it,F+N-D*it,S+V,F+N-D,S+V),st.lineTo(F+D,S+V),(D!==0||H!==0)&&st.bezierCurveTo(F+D*it,S+V,F,S+V-H*it,F,S+V-H),st.lineTo(F,S+H),(D!==0||H!==0)&&st.bezierCurveTo(F,S+H*it,F+D*it,S,F+D,S),st}function l(I){function F(N,V,it){const st=b(V),nt=b(it);H===0?D.moveTo(st,nt):D.lineTo(st,nt),H++}const S=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,D=new qs;let H=0;return I.getAttribute("points").replace(S,F),D.currentPath.autoClose=!0,D}function u(I){function F(N,V,it){const st=b(V),nt=b(it);H===0?D.moveTo(st,nt):D.lineTo(st,nt),H++}const S=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,D=new qs;let H=0;return I.getAttribute("points").replace(S,F),D.currentPath.autoClose=!1,D}function h(I){const F=b(I.getAttribute("cx")||0),S=b(I.getAttribute("cy")||0),D=b(I.getAttribute("r")||0),H=new Ro;H.absarc(F,S,D,0,Math.PI*2);const N=new qs;return N.subPaths.push(H),N}function d(I){const F=b(I.getAttribute("cx")||0),S=b(I.getAttribute("cy")||0),D=b(I.getAttribute("rx")||0),H=b(I.getAttribute("ry")||0),N=new Ro;N.absellipse(F,S,D,H,0,Math.PI*2);const V=new qs;return V.subPaths.push(N),V}function p(I){const F=b(I.getAttribute("x1")||0),S=b(I.getAttribute("y1")||0),D=b(I.getAttribute("x2")||0),H=b(I.getAttribute("y2")||0),N=new qs;return N.moveTo(F,S),N.lineTo(D,H),N.currentPath.autoClose=!1,N}function m(I,F){F=Object.assign({},F);let S={};if(I.hasAttribute("class")){const V=I.getAttribute("class").split(/\s/).filter(Boolean).map(it=>it.trim());for(let it=0;it0&&F.premultiply(P[P.length-1]),X.copy(F),P.push(F),F}function g(I){const F=new gn,S=U;if(I.nodeName==="use"&&(I.hasAttribute("x")||I.hasAttribute("y"))){const D=b(I.getAttribute("x")),H=b(I.getAttribute("y"));F.translate(D,H)}if(I.hasAttribute("transform")){const D=I.getAttribute("transform").split(")");for(let H=D.length-1;H>=0;H--){const N=D[H].trim();if(N==="")continue;const V=N.indexOf("("),it=N.length;if(V>0&&V=1){const J=nt[0];let pt=J;nt.length>=2&&(pt=nt[1]),S.translate(J,pt)}break;case"rotate":if(nt.length>=1){let J=0,pt=0,K=0;J=-nt[0]*Math.PI/180,nt.length>=3&&(pt=nt[1],K=nt[2]),W.identity().translate(-pt,-K),G.identity().rotate(J),Y.multiplyMatrices(G,W),W.identity().translate(pt,K),S.multiplyMatrices(W,Y)}break;case"scale":if(nt.length>=1){const J=nt[0];let pt=J;nt.length>=2&&(pt=nt[1]),S.scale(J,pt)}break;case"skewX":nt.length===1&&S.set(1,Math.tan(nt[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":nt.length===1&&S.set(1,0,0,Math.tan(nt[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":nt.length===6&&S.set(nt[0],nt[2],nt[4],nt[1],nt[3],nt[5],0,0,1);break}}F.premultiply(S)}}return F}function x(I,F){function S(N){z.set(N.x,N.y,1).applyMatrix3(F),N.set(z.x,z.y)}const D=T(F),H=I.subPaths;for(let N=0,V=H.length;N=1||Y<0||Y>1)return null;if(P===0&&W===0){for(let j=0;j<2;j++)if(o(j===0?w:b,_,y),n.loc==s.ORIGIN){const z=j===0?w:b;return{x:z.x,y:z.y,t:n.t}}else if(n.loc==s.BETWEEN){const z=+(v+n.t*(g-v)).toPrecision(10),X=+(k+n.t*(C-k)).toPrecision(10);return{x:z,y:X,t:n.t}}return null}else{for(let X=0;X<2;X++)if(o(X===0?w:b,_,y),n.loc==s.ORIGIN){const Q=X===0?w:b;return{x:Q.x,y:Q.y,t:n.t}}const j=+(v+G*(g-v)).toPrecision(10),z=+(k+G*(C-k)).toPrecision(10);return{x:j,y:z,t:G}}}function o(_,y,w){const b=w.x-y.x,v=w.y-y.y,g=_.x-y.x,x=_.y-y.y,T=b*x-g*v;if(_.x===y.x&&_.y===y.y){n.loc=s.ORIGIN,n.t=0;return}if(_.x===w.x&&_.y===w.y){n.loc=s.DESTINATION,n.t=1;return}if(T<-Number.EPSILON){n.loc=s.LEFT;return}if(T>Number.EPSILON){n.loc=s.RIGHT;return}if(b*g<0||v*x<0){n.loc=s.BEHIND;return}if(Math.sqrt(b*b+v*v)R.t<=M.t+Number.EPSILON&&R.t>=M.t-Number.EPSILON)===void 0&&(w.push(M),b.push(new _t(M.x,M.y)))}}return b}function c(_,y,w){const b=new _t;y.getCenter(b);const v=[];return w.forEach(g=>{g.boundingBox.containsPoint(b)&&a(_,g.points).forEach(T=>{v.push({identifier:g.identifier,isCW:g.isCW,point:T})})}),v.sort((g,x)=>g.point.x-x.point.x),v}function l(_,y,w,b,v){(v==null||v==="")&&(v="nonzero");const g=new _t;_.boundingBox.getCenter(g);const x=[new _t(w,g.y),new _t(b,g.y)],T=c(x,_.boundingBox,y);T.sort((U,W)=>U.point.x-W.point.x);const k=[],C=[];T.forEach(U=>{U.identifier===_.identifier?k.push(U):C.push(U)});const M=k[0].point.x,R=[];let P=0;for(;P0&&R[R.length-1]===C[P].identifier?R.pop():R.push(C[P].identifier),P++;if(R.push(_.identifier),v==="evenodd"){const U=R.length%2===0,W=R[R.length-2];return{identifier:_.identifier,isHole:U,for:W}}else if(v==="nonzero"){let U=!0,W=null,G=null;for(let Y=0;Y{const y=_.getPoints();let w=-999999999,b=999999999,v=-999999999,g=999999999;for(let x=0;xw&&(w=T.y),T.yv&&(v=T.x),T.x=g&&(h=g-1),{curves:_.curves,points:y,isCW:_f.isClockWise(y),identifier:u++,boundingBox:new gf(new _t(g,b),new _t(v,w))}});p=p.filter(_=>_.points.length>1);const m=p.map(_=>l(_,p,h,d,t.userData.style.fillRule)),f=[];return p.forEach(_=>{if(!m[_.identifier].isHole){const w=new Jl;w.curves=_.curves,m.filter(v=>v.isHole&&v.for===_.identifier).forEach(v=>{const g=p[v.identifier],x=new Ro;x.curves=g.curves,w.holes.push(x)}),f.push(w)}}),f}static getStrokeStyle(t,e,s,n,r){return t=t!==void 0?t:1,e=e!==void 0?e:"#000",s=s!==void 0?s:"miter",n=n!==void 0?n:"butt",r=r!==void 0?r:4,{strokeColor:e,strokeWidth:t,strokeLineJoin:s,strokeLineCap:n,strokeMiterLimit:r}}static pointsToStroke(t,e,s,n){const r=[],o=[],a=[];if(xi.pointsToStrokeWithBuffers(t,e,s,n,r,o,a)===0)return null;const c=new yf;return c.setAttribute("position",new Dr(r,3)),c.setAttribute("normal",new Dr(o,3)),c.setAttribute("uv",new Dr(a,2)),c}static pointsToStrokeWithBuffers(t,e,s,n,r,o,a,c){const l=new _t,u=new _t,h=new _t,d=new _t,p=new _t,m=new _t,f=new _t,_=new _t,y=new _t,w=new _t,b=new _t,v=new _t,g=new _t,x=new _t,T=new _t,k=new _t,C=new _t;s=s!==void 0?s:12,n=n!==void 0?n:.001,c=c!==void 0?c:0,t=pt(t);const M=t.length;if(M<2)return 0;const R=t[0].equals(t[M-1]);let P,U=t[0],W;const G=e.strokeWidth/2,Y=1/(M-1);let j=0,z,X,Q,et,I=!1,F=0,S=c*3,D=c*2;H(t[0],t[1],l).multiplyScalar(G),_.copy(t[0]).sub(l),y.copy(t[0]).add(l),w.copy(_),b.copy(y);for(let K=1;K=n&&O.push(K[E]);return O.push(K[K.length-1]),O}}}function zf(i,t){if(Object.is(i,t))return!0;if(typeof i!="object"||i===null||typeof t!="object"||t===null)return!1;const e=Object.keys(i);if(e.length!==Object.keys(t).length)return!1;for(let s=0;sc,...a}){const{setEvents:c,camera:l,raycaster:u,gl:h,controls:d,size:p,get:m}=Nt(),[f,_]=A.useState(!1),[y,w]=A.useReducer((x,{object:T,shift:k})=>T===void 0?[]:Array.isArray(T)?T:k?x.includes(T)?x.filter(C=>C!==T):[T,...x]:x[0]===T?[]:[T],[]);A.useEffect(()=>void(s==null?void 0:s(y)),[y]);const b=A.useCallback(x=>{x.stopPropagation(),w({object:o([x.object])[0],shift:t&&x.shiftKey})},[]),v=A.useCallback(x=>!f&&w({}),[f]),g=A.useRef(null);return A.useEffect(()=>{if(!i||!t)return;const x=new Uf(l,g.current),T=document.createElement("div");T.style.pointerEvents="none",T.style.border=n,T.style.backgroundColor=r,T.style.position="fixed";const k=new _t,C=new _t,M=new _t,R=m().events.enabled,P=d==null?void 0:d.enabled;let U=!1;function W(I,F){const{offsetX:S,offsetY:D}=I,{width:H,height:N}=p;F.set(S/H*2-1,-(D/N)*2+1)}function G(I){var F;d&&(d.enabled=!1),c({enabled:!1}),U=!0,(F=h.domElement.parentElement)==null||F.appendChild(T),T.style.left=`${I.clientX}px`,T.style.top=`${I.clientY}px`,T.style.width="0px",T.style.height="0px",k.x=I.clientX,k.y=I.clientY}function Y(I){M.x=Math.max(k.x,I.clientX),M.y=Math.max(k.y,I.clientY),C.x=Math.min(k.x,I.clientX),C.y=Math.min(k.y,I.clientY),T.style.left=`${C.x}px`,T.style.top=`${C.y}px`,T.style.width=`${M.x-C.x}px`,T.style.height=`${M.y-C.y}px`}function j(){if(U){var I;d&&(d.enabled=P),c({enabled:R}),U=!1,(I=T.parentElement)==null||I.removeChild(T)}}function z(I){I.shiftKey&&(G(I),W(I,x.startPoint))}let X=[];function Q(I){if(U){Y(I),W(I,x.endPoint);const F=x.select().sort(S=>S.uuid).filter(S=>S.isMesh);zf(F,X)||(X=F,w({object:o(F)}))}}function et(I){U&&j()}return document.addEventListener("pointerdown",z,{passive:!0}),document.addEventListener("pointermove",Q,{passive:!0,capture:!0}),document.addEventListener("pointerup",et,{passive:!0}),()=>{document.removeEventListener("pointerdown",z),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",et)}},[p.width,p.height,u,l,d,h]),A.createElement("group",Oe({ref:g,onClick:b,onPointerOver:()=>_(!0),onPointerOut:()=>_(!1),onPointerMissed:v},a),A.createElement(jf.Provider,{value:y},e))}const eu=A.forwardRef(function({follow:t=!0,lockX:e=!1,lockY:s=!1,lockZ:n=!1,...r},o){const a=A.useRef();return be(({camera:c})=>{if(!t||!a.current)return;const l=a.current.rotation.clone();c.getWorldQuaternion(a.current.quaternion),e&&(a.current.rotation.x=l.x),s&&(a.current.rotation.y=l.y),n&&(a.current.rotation.z=l.z)}),A.createElement("group",Oe({ref:fo([a,o])},r))}),Vc=i=>i===Object(i)&&!Array.isArray(i)&&typeof i!="function";function Ks(i,t){const e=Nt(n=>n.gl),s=po(_o,Vc(i)?Object.values(i):i);if(A.useLayoutEffect(()=>{t==null||t(s)},[t]),A.useEffect(()=>{(Array.isArray(s)?s:[s]).forEach(e.initTexture)},[e,s]),Vc(i)){const n=Object.keys(i),r={};return n.forEach(o=>Object.assign(r,{[o]:s[n.indexOf(o)]})),r}else return s}Ks.preload=i=>po.preload(_o,i);Ks.clear=i=>po.clear(_o,i);const qf=A.forwardRef(function({src:t,skipFill:e,skipStrokes:s,fillMaterial:n,strokeMaterial:r,fillMeshProps:o,strokeMeshProps:a,...c},l){const u=po(xi,t.startsWith("s?[]:u.paths.map(d=>{var p;return((p=d.userData)==null?void 0:p.style.stroke)===void 0||d.userData.style.stroke==="none"?null:d.subPaths.map(m=>xi.pointsToStroke(m.getPoints(),d.userData.style))}),[u,s]);return A.useEffect(()=>()=>h.forEach(d=>d&&d.map(p=>p.dispose())),[h]),A.createElement("object3D",Oe({ref:l},c),A.createElement("object3D",{scale:[1,-1,1]},u.paths.map((d,p)=>{var m,f;return A.createElement(A.Fragment,{key:p},!e&&((m=d.userData)==null?void 0:m.style.fill)!==void 0&&d.userData.style.fill!=="none"&&xi.createShapes(d).map((_,y)=>A.createElement("mesh",Oe({key:y},o),A.createElement("shapeGeometry",{args:[_]}),A.createElement("meshBasicMaterial",Oe({color:d.userData.style.fill,opacity:d.userData.style.fillOpacity,transparent:!0,side:ra,depthWrite:!1},n)))),!s&&((f=d.userData)==null?void 0:f.style.stroke)!==void 0&&d.userData.style.stroke!=="none"&&d.subPaths.map((_,y)=>A.createElement("mesh",Oe({key:y,geometry:h[p][y]},a),A.createElement("meshBasicMaterial",Oe({color:d.userData.style.stroke,opacity:d.userData.style.strokeOpacity,transparent:!0,side:ra,depthWrite:!1},r)))))})))});/*! * camera-controls * https://github.com/yomotsu/camera-controls * (c) 2017 @yomotsu * Released under the MIT License. - */const ct={LEFT:1,RIGHT:2,MIDDLE:4},q=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),vn={NONE:0,IN:1,OUT:-1};function Ws(i){return i.isPerspectiveCamera}function ws(i){return i.isOrthographicCamera}const kn=Math.PI*2,Uc=Math.PI/2,su=1e-5,li=Math.PI/180;function Fe(i,t,e){return Math.max(t,Math.min(e,i))}function Et(i,t=su){return Math.abs(i)0==f>u&&(f=u,e.value=(f-u)/r),f}function jc(i,t,e,s,n=1/0,r,o){s=Math.max(1e-4,s);const a=2/s,c=a*r,l=1/(1+c+.48*c*c+.235*c*c*c);let u=t.x,h=t.y,d=t.z,f=i.x-u,_=i.y-h,p=i.z-d;const m=u,y=h,w=d,b=n*s,v=b*b,g=f*f+_*_+p*p;if(g>v){const G=Math.sqrt(g);f=f/G*b,_=_/G*b,p=p/G*b}u=i.x-f,h=i.y-_,d=i.z-p;const T=(e.x+a*f)*r,x=(e.y+a*_)*r,k=(e.z+a*p)*r;e.x=(e.x-a*T)*l,e.y=(e.y-a*x)*l,e.z=(e.z-a*k)*l,o.x=u+(f+T)*l,o.y=h+(_+x)*l,o.z=d+(p+k)*l;const C=m-i.x,M=y-i.y,R=w-i.z,P=o.x-m,U=o.y-y,W=o.z-w;return C*P+M*U+R*W>0&&(o.x=m,o.y=y,o.z=w,e.x=(o.x-m)/r,e.y=(o.y-y)/r,e.z=(o.z-w)/r),o}function Vo(i,t){t.set(0,0),i.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=i.length,t.y/=i.length}function Uo(i,t){return ws(i)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}class Wf{constructor(){this._listeners={}}addEventListener(t,e){const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const n=this._listeners[t];if(n!==void 0){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}removeAllEventListeners(t){if(!t){this._listeners={};return}Array.isArray(this._listeners[t])&&(this._listeners[t].length=0)}dispatchEvent(t){const s=this._listeners[t.type];if(s!==void 0){t.target=this;const n=s.slice(0);for(let r=0,o=n.length;r{},this._enabled=!0,this._state=q.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=vn.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new at.Vector3,this._focalOffsetVelocity=new at.Vector3,this._zoomVelocity={value:0},this._truckInternal=(v,g,T)=>{let x,k;if(Ws(this._camera)){const C=ht.copy(this._camera.position).sub(this._target),M=this._camera.getEffectiveFOV()*li,R=C.length()*Math.tan(M*.5);x=this.truckSpeed*v*R/this._elementRect.height,k=this.truckSpeed*g*R/this._elementRect.height}else if(ws(this._camera)){const C=this._camera;x=v*(C.right-C.left)/C.zoom/this._elementRect.width,k=g*(C.top-C.bottom)/C.zoom/this._elementRect.height}else return;this.verticalDragToForward?(T?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(x,0,!0),this.forward(-k,!0)):T?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y+k,this._focalOffsetEnd.z,!0):this.truck(x,k,!0)},this._rotateInternal=(v,g)=>{const T=kn*this.azimuthRotateSpeed*v/this._elementRect.height,x=kn*this.polarRotateSpeed*g/this._elementRect.height;this.rotate(T,x,!0)},this._dollyInternal=(v,g,T)=>{const x=Math.pow(.95,-v*this.dollySpeed),k=this._sphericalEnd.radius,C=this._sphericalEnd.radius*x,M=Fe(C,this.minDistance,this.maxDistance),R=M-C;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(C,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(R,!0),this._dollyToNoClamp(M,!0)):this._dollyToNoClamp(M,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?C:M)-k,this._dollyControlCoord.set(g,T)),this._lastDollyDirection=Math.sign(-v)},this._zoomInternal=(v,g,T)=>{const x=Math.pow(.95,v*this.dollySpeed),k=this._zoom,C=this._zoom*x;this.zoomTo(C,!0),this.dollyToCursor&&(this._changedZoom+=C-k,this._dollyControlCoord.set(g,T))},typeof at>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new at.Quaternion().setFromUnitVectors(this._camera.up,kr),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=q.NONE,this._target=new at.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new at.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new at.Spherical().setFromVector3(ht.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new at.Vector3,new at.Vector3,new at.Vector3,new at.Vector3],this._updateNearPlaneCorners(),this._boundary=new at.Box3(new at.Vector3(-1/0,-1/0,-1/0),new at.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new at.Vector2,this.mouseButtons={left:q.ROTATE,middle:q.DOLLY,right:q.TRUCK,wheel:Ws(this._camera)?q.DOLLY:ws(this._camera)?q.ZOOM:q.NONE},this.touches={one:q.TOUCH_ROTATE,two:Ws(this._camera)?q.TOUCH_DOLLY_TRUCK:ws(this._camera)?q.TOUCH_ZOOM_TRUCK:q.NONE,three:q.TOUCH_TRUCK};const s=new at.Vector2,n=new at.Vector2,r=new at.Vector2,o=v=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),k=v.clientX/x.width,C=v.clientY/x.height;if(kthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const g=v.pointerType!=="mouse"?null:(v.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(v.buttons&ct.MIDDLE)===ct.MIDDLE?ct.MIDDLE:(v.buttons&ct.RIGHT)===ct.RIGHT?ct.RIGHT:null;if(g!==null){const x=this._findPointerByMouseButton(g);x&&this._disposePointer(x)}if((v.buttons&ct.LEFT)===ct.LEFT&&this._lockedPointer)return;const T={pointerId:v.pointerId,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:g};this._activePointers.push(T),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),this._isDragging=!0,p(v)},a=v=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),k=v.clientX/x.width,C=v.clientY/x.height;if(kthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const g=(v.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(v.buttons&ct.MIDDLE)===ct.MIDDLE?ct.MIDDLE:(v.buttons&ct.RIGHT)===ct.RIGHT?ct.RIGHT:null;if(g!==null){const x=this._findPointerByMouseButton(g);x&&this._disposePointer(x)}const T={pointerId:1,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:(v.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(v.buttons&ct.MIDDLE)===ct.LEFT?ct.MIDDLE:(v.buttons&ct.RIGHT)===ct.LEFT?ct.RIGHT:null};this._activePointers.push(T),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",h),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",h),this._isDragging=!0,p(v)},c=v=>{v.cancelable&&v.preventDefault();const g=v.pointerId,T=this._lockedPointer||this._findPointerById(g);if(T){if(T.clientX=v.clientX,T.clientY=v.clientY,T.deltaX=v.movementX,T.deltaY=v.movementY,this._state=0,v.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(v.buttons&ct.LEFT)===ct.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(v.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(v.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=v=>{const g=this._lockedPointer||this._findPointerById(1);g&&(g.clientX=v.clientX,g.clientY=v.clientY,g.deltaX=v.movementX,g.deltaY=v.movementY,this._state=0,(this._lockedPointer||(v.buttons&ct.LEFT)===ct.LEFT)&&(this._state=this._state|this.mouseButtons.left),(v.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},u=v=>{const g=this._findPointerById(v.pointerId);if(!(g&&g===this._lockedPointer)){if(g&&this._disposePointer(g),v.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=q.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=q.NONE;y()}},h=()=>{const v=this._findPointerById(1);v&&v===this._lockedPointer||(v&&this._disposePointer(v),this._state=q.NONE,y())};let d=-1;const f=v=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===q.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const C=this._domElement.getBoundingClientRect(),M=v.clientX/C.width,R=v.clientY/C.height;if(Mthis._interactiveArea.right||Rthis._interactiveArea.bottom)return}if(v.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===q.ROTATE||this.mouseButtons.wheel===q.TRUCK){const C=performance.now();d-C<1e3&&this._getClientRect(this._elementRect),d=C}const g=Yf?-1:-3,T=v.deltaMode===1?v.deltaY/g:v.deltaY/(g*10),x=this.dollyToCursor?(v.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,k=this.dollyToCursor?(v.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case q.ROTATE:{this._rotateInternal(v.deltaX,v.deltaY),this._isUserControllingRotate=!0;break}case q.TRUCK:{this._truckInternal(v.deltaX,v.deltaY,!1),this._isUserControllingTruck=!0;break}case q.OFFSET:{this._truckInternal(v.deltaX,v.deltaY,!0),this._isUserControllingOffset=!0;break}case q.DOLLY:{this._dollyInternal(-T,x,k),this._isUserControllingDolly=!0;break}case q.ZOOM:{this._zoomInternal(-T,x,k),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},_=v=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===oa.ACTION.NONE){const g=v instanceof PointerEvent?v.pointerId:(v instanceof MouseEvent,0),T=this._findPointerById(g);T&&this._disposePointer(T),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",h);return}v.preventDefault()}},p=v=>{if(!this._enabled)return;if(Vo(this._activePointers,ce),this._getClientRect(this._elementRect),s.copy(ce),n.copy(ce),this._activePointers.length>=2){const T=ce.x-this._activePointers[1].clientX,x=ce.y-this._activePointers[1].clientY,k=Math.sqrt(T*T+x*x);r.set(0,k);const C=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,M=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;n.set(C,M)}if(this._state=0,!v)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in v&&v.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(v.buttons&ct.LEFT)===ct.LEFT&&(this._state=this._state|this.mouseButtons.left),(v.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&q.ROTATE)===q.ROTATE||(this._state&q.TOUCH_ROTATE)===q.TOUCH_ROTATE||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&q.TRUCK)===q.TRUCK||(this._state&q.TOUCH_TRUCK)===q.TOUCH_TRUCK||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&q.DOLLY)===q.DOLLY||(this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&q.ZOOM)===q.ZOOM||(this._state&q.TOUCH_ZOOM)===q.TOUCH_ZOOM||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&q.OFFSET)===q.OFFSET||(this._state&q.TOUCH_OFFSET)===q.TOUCH_OFFSET||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Vo(this._activePointers,ce);const g=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,T=g?-g.deltaX:n.x-ce.x,x=g?-g.deltaY:n.y-ce.y;if(n.copy(ce),((this._state&q.ROTATE)===q.ROTATE||(this._state&q.TOUCH_ROTATE)===q.TOUCH_ROTATE||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(T,x),this._isUserControllingRotate=!0),(this._state&q.DOLLY)===q.DOLLY||(this._state&q.ZOOM)===q.ZOOM){const k=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,C=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,M=this.dollyDragInverted?-1:1;(this._state&q.DOLLY)===q.DOLLY?(this._dollyInternal(M*x*vr,k,C),this._isUserControllingDolly=!0):(this._zoomInternal(M*x*vr,k,C),this._isUserControllingZoom=!0)}if((this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_ZOOM)===q.TOUCH_ZOOM||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE){const k=ce.x-this._activePointers[1].clientX,C=ce.y-this._activePointers[1].clientY,M=Math.sqrt(k*k+C*C),R=r.y-M;r.set(0,M);const P=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,U=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET?(this._dollyInternal(R*vr,P,U),this._isUserControllingDolly=!0):(this._zoomInternal(R*vr,P,U),this._isUserControllingZoom=!0)}((this._state&q.TRUCK)===q.TRUCK||(this._state&q.TOUCH_TRUCK)===q.TOUCH_TRUCK||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(T,x,!1),this._isUserControllingTruck=!0),((this._state&q.OFFSET)===q.OFFSET||(this._state&q.TOUCH_OFFSET)===q.TOUCH_OFFSET||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(T,x,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},y=()=>{Vo(this._activePointers,ce),n.copy(ce),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mouseup",h),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",w),this._domElement.ownerDocument.addEventListener("pointerlockerror",b),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),p())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",w),this._domElement.ownerDocument.removeEventListener("pointerlockerror",b))};const w=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},b=()=>{this.unlockPointer()};this._addAllEventListeners=v=>{this._domElement=v,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),Gf&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",u),this._domElement.addEventListener("wheel",f,{passive:!1}),this._domElement.addEventListener("contextmenu",_)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",u),this._domElement.removeEventListener("wheel",f,{passive:!1}),this._domElement.removeEventListener("contextmenu",_),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mouseup",h),this._domElement.ownerDocument.removeEventListener("pointerlockchange",w),this._domElement.ownerDocument.removeEventListener("pointerlockerror",b))},this.cancel=()=>{this._state!==q.NONE&&(this._state=q.NONE,this._activePointers.length=0,y())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=Fe(t.width,0,1),this._interactiveArea.height=Fe(t.height,0,1),this._interactiveArea.x=Fe(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Fe(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,s=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,s)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,s=!1){this._isUserControllingRotate=!1;const n=Fe(t,this.minAzimuthAngle,this.maxAzimuthAngle),r=Fe(e,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=n,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!s||gt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0,this._dollyToNoClamp(Fe(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=gt(o,this._spherical.radius);if(!(s>t)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,o)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const r=!e||gt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(di).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const s=!e||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=Fe(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const s=!e||gt(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(t,e,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,s)}truck(t,e,s=!1){this._camera.updateMatrix(),$e.setFromMatrixColumn(this._camera.matrix,0),Xe.setFromMatrixColumn(this._camera.matrix,1),$e.multiplyScalar(t),Xe.multiplyScalar(-e);const n=ht.copy($e).add(Xe),r=mt.copy(this._targetEnd).add(n);return this.moveTo(r.x,r.y,r.z,s)}forward(t,e=!1){ht.setFromMatrixColumn(this._camera.matrix,0),ht.crossVectors(this._camera.up,ht),ht.multiplyScalar(t);const s=mt.copy(this._targetEnd).add(ht);return this.moveTo(s.x,s.y,s.z,e)}elevate(t,e=!1){return ht.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+ht.x,this._targetEnd.y+ht.y,this._targetEnd.z+ht.z,e)}moveTo(t,e,s,n=!1){this._isUserControllingTruck=!1;const r=ht.set(t,e,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,n||this._target.copy(this._targetEnd);const o=!n||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,s,n=!1){const a=ht.set(t,e,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,n)}fitToBox(t,e,{cover:s=!1,paddingLeft:n=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],l=t.isBox3?Tn.copy(t):Tn.setFromObject(t);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=zc(this._sphericalEnd.theta,Uc),h=zc(this._sphericalEnd.phi,Uc);c.push(this.rotateTo(u,h,e));const d=ht.setFromSpherical(this._sphericalEnd).normalize(),f=Yc.setFromUnitVectors(d,zo),_=gt(Math.abs(d.y),1);_&&f.multiply(Bo.setFromAxisAngle(kr,u)),f.multiply(this._yAxisUpSpaceInverse);const p=Hc.makeEmpty();mt.copy(l.min).applyQuaternion(f),p.expandByPoint(mt),mt.copy(l.min).setX(l.max.x).applyQuaternion(f),p.expandByPoint(mt),mt.copy(l.min).setY(l.max.y).applyQuaternion(f),p.expandByPoint(mt),mt.copy(l.max).setZ(l.min.z).applyQuaternion(f),p.expandByPoint(mt),mt.copy(l.min).setZ(l.max.z).applyQuaternion(f),p.expandByPoint(mt),mt.copy(l.max).setY(l.min.y).applyQuaternion(f),p.expandByPoint(mt),mt.copy(l.max).setX(l.min.x).applyQuaternion(f),p.expandByPoint(mt),mt.copy(l.max).applyQuaternion(f),p.expandByPoint(mt),p.min.x-=n,p.min.y-=o,p.max.x+=r,p.max.y+=a,f.setFromUnitVectors(zo,d),_&&f.premultiply(Bo.invert()),f.premultiply(this._yAxisUpSpace);const m=p.getSize(ht),y=p.getCenter(mt).applyQuaternion(f);if(Ws(this._camera)){const w=this.getDistanceToFitBox(m.x,m.y,m.z,s);c.push(this.moveTo(y.x,y.y,y.z,e)),c.push(this.dollyTo(w,e)),c.push(this.setFocalOffset(0,0,0,e))}else if(ws(this._camera)){const w=this._camera,b=w.right-w.left,v=w.top-w.bottom,g=s?Math.max(b/m.x,v/m.y):Math.min(b/m.x,v/m.y);c.push(this.moveTo(y.x,y.y,y.z,e)),c.push(this.zoomTo(g,e)),c.push(this.setFocalOffset(0,0,0,e))}return Promise.all(c)}fitToSphere(t,e){const s=[],r=t instanceof at.Sphere?jo.copy(t):oa.createBoundingSphere(t,jo);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,e)),Ws(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,e))}else if(ws(this._camera)){const o=this._camera.right-this._camera.left,a=this._camera.top-this._camera.bottom,c=2*r.radius,l=Math.min(o/c,a/c);s.push(this.zoomTo(l,e))}return s.push(this.setFocalOffset(0,0,0,e)),Promise.all(s)}setLookAt(t,e,s,n,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0;const c=mt.set(n,r,o),l=ht.set(t,e,s);this._targetEnd.copy(c),this._sphericalEnd.setFromVector3(l.sub(c).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!a||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold)&>(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&>(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(t,e,s,n,r,o,a,c,l,u,h,d,f,_=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0;const p=ht.set(n,r,o),m=mt.set(t,e,s);Ce.setFromVector3(m.sub(p).applyQuaternion(this._yAxisUpSpace));const y=xn.set(u,h,d),w=mt.set(a,c,l);fi.setFromVector3(w.sub(y).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(p.lerp(y,f));const b=fi.theta-Ce.theta,v=fi.phi-Ce.phi,g=fi.radius-Ce.radius;this._sphericalEnd.set(Ce.radius+g*f,Ce.phi+v*f,Ce.theta+b*f),this.normalizeRotations(),this._needsUpdate=!0,_||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const T=!_||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold)&>(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&>(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(T)}setPosition(t,e,s,n=!1){return this.setLookAt(t,e,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,n)}setTarget(t,e,s,n=!1){const r=this.getPosition(ht),o=this.setLookAt(r.x,r.y,r.z,t,e,s,n);return this._sphericalEnd.phi=Fe(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,s,n=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,s),this._needsUpdate=!0,n||this._focalOffset.copy(this._focalOffsetEnd);const r=!n||gt(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&>(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&>(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(t,e,s){this._camera.updateMatrixWorld(),$e.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Xe.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Hs.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const n=ht.set(t,e,s),r=n.distanceTo(this._camera.position),o=n.sub(this._camera.position);$e.multiplyScalar(o.x),Xe.multiplyScalar(o.y),Hs.multiplyScalar(o.z),ht.copy($e).add(Xe).add(Hs),ht.z=ht.z+r,this.dollyTo(r,!1),this.setFocalOffset(-ht.x,ht.y,-ht.z,!1),this.moveTo(t,e,s,!1)}setBoundary(t){if(!t){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,s,n){if(t===null){this._viewport=null;return}this._viewport=this._viewport||new at.Vector4,typeof t=="number"?this._viewport.set(t,e,s,n):this._viewport.copy(t)}getDistanceToFitBox(t,e,s,n=!1){if(Uo(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=t/e,o=this._camera.getEffectiveFOV()*li,a=this._camera.aspect;return((n?r>a:re.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,s){const n=e.lengthSq();if(n===0)return t;const r=mt.copy(e).add(t),a=this._boundary.clampPoint(r,xn).sub(r),c=a.lengthSq();if(c===0)return t.add(e);if(c===n)return t;if(s===0)return t.add(e).add(a);{const l=1+s*c/e.dot(a);return t.add(mt.copy(e).multiplyScalar(l)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Ws(this._camera)){const t=this._camera,e=t.near,s=t.getEffectiveFOV()*li,n=Math.tan(s*.5)*e,r=n*t.aspect;this._nearPlaneCorners[0].set(-r,-n,0),this._nearPlaneCorners[1].set(r,-n,0),this._nearPlaneCorners[2].set(r,n,0),this._nearPlaneCorners[3].set(-r,n,0)}else if(ws(this._camera)){const t=this._camera,e=1/t.zoom,s=t.left*e,n=t.right*e,r=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(n,r,0),this._nearPlaneCorners[2].set(n,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1)||Uo(this._camera,"_collisionTest"))return t;const s=this._getTargetDirection(di);qo.lookAt(Bc,s,this._camera.up);for(let n=0;n<4;n++){const r=mt.copy(this._nearPlaneCorners[n]);r.applyMatrix4(qo);const o=xn.addVectors(this._target,r);xr.set(o,s),xr.far=this._spherical.radius+1;const a=xr.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),e()};this.addEventListener("rest",s)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new at.Sphere){const s=e,n=s.center;Tn.makeEmpty(),t.traverseVisible(o=>{o.isMesh&&Tn.expandByObject(o)}),Tn.getCenter(n);let r=0;return t.traverseVisible(o=>{if(!o.isMesh)return;const a=o,c=a.geometry.clone();c.applyMatrix4(a.matrixWorld);const u=c.attributes.position;for(let h=0,d=u.count;h{A.useMemo(()=>{Wo.install({THREE:vf}),Na({CameraControlsImpl:Wo})},[]);const{camera:e,domElement:s,makeDefault:n,onStart:r,onEnd:o,onChange:a,regress:c,...l}=i,u=Nt(g=>g.camera),h=Nt(g=>g.gl),d=Nt(g=>g.invalidate),f=Nt(g=>g.events),_=Nt(g=>g.setEvents),p=Nt(g=>g.set),m=Nt(g=>g.get),y=Nt(g=>g.performance),w=e||u,b=s||f.connected||h.domElement,v=A.useMemo(()=>new Wo(w),[w]);return be((g,T)=>{v.enabled&&v.update(T)},-1),A.useEffect(()=>(v.connect(b),()=>void v.disconnect()),[b,v]),A.useEffect(()=>{const g=k=>{d(),c&&y.regress(),a&&a(k)},T=k=>{r&&r(k)},x=k=>{o&&o(k)};return v.addEventListener("update",g),v.addEventListener("controlstart",T),v.addEventListener("controlend",x),()=>{v.removeEventListener("update",g),v.removeEventListener("controlstart",T),v.removeEventListener("controlend",x)}},[v,r,o,d,_,c,a]),A.useEffect(()=>{if(n){const g=m().controls;return p({controls:v}),()=>p({controls:g})}},[n,v]),A.createElement("primitive",Oe({ref:t,object:v},l))});ei.func.isRequired,ei.arrayOf(ei.oneOfType([ei.element,ei.func])).isRequired;const Gc=new er,$c=new er,Tr=[],pi=new tu;class Xf extends xf{constructor(){super(),this.color=new go("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var t;return(t=this.instance.current)==null?void 0:t.geometry}raycast(t,e){const s=this.instance.current;if(!s||!s.geometry||!s.material)return;pi.geometry=s.geometry;const n=s.matrixWorld,r=s.userData.instances.indexOf(this.instanceKey);if(!(r===-1||r>s.count)){s.getMatrixAt(r,Gc),$c.multiplyMatrices(n,Gc),pi.matrixWorld=$c,s.material instanceof Tf?pi.material.side=s.material.side:pi.material.side=s.material[0].side,pi.raycast(t,Tr);for(let o=0,a=Tr.length;o{A.useMemo(()=>Na({PositionMesh:Xf}),[]);const n=A.useRef(),{subscribe:r,getParent:o}=A.useContext(i||iu);return A.useLayoutEffect(()=>r(n),[]),A.createElement("positionMesh",Oe({instance:o(),instanceKey:n,ref:fo([s,n])},e),t)}),Qf=A.forwardRef(({children:i,range:t,limit:e=1e3,frames:s=1/0,...n},r)=>{const[{context:o,instance:a}]=A.useState(()=>{const m=A.createContext(null);return{context:m,instance:A.forwardRef((y,w)=>A.createElement(ru,Oe({context:m},y,{ref:w})))}}),c=A.useRef(null),[l,u]=A.useState([]),[[h,d]]=A.useState(()=>{const m=new Float32Array(e*16);for(let y=0;y1))]});A.useEffect(()=>{c.current.instanceMatrix.needsUpdate=!0});let f=0,_=0;be(()=>{if(s===1/0||f({getParent:()=>c,subscribe:m=>(u(y=>[...y,m]),()=>u(y=>y.filter(w=>w.current!==m.current)))}),[]);return A.createElement("instancedMesh",Oe({userData:{instances:l},matrixAutoUpdate:!1,ref:fo([r,c]),args:[null,null,0],raycast:()=>null},n),A.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:h.length/16,array:h,itemSize:16,usage:Ic}),A.createElement("instancedBufferAttribute",{attach:"instanceColor",count:d.length/3,array:d,itemSize:3,usage:Ic}),typeof i=="function"?A.createElement(o.Provider,{value:p},i(a)):A.createElement(iu.Provider,{value:p},i))}),ou=A.createContext(null),Kf=A.forwardRef((i,t)=>{A.useMemo(()=>Na({SegmentObject:Jf}),[]);const{limit:e=1e3,lineWidth:s=1,children:n,...r}=i,[o,a]=A.useState([]),[c]=A.useState(()=>new Fd),[l]=A.useState(()=>new Ld),[u]=A.useState(()=>new Vd),[h]=A.useState(()=>new _t(512,512)),[d]=A.useState(()=>Array(e*6).fill(0)),[f]=A.useState(()=>Array(e*6).fill(0)),_=A.useMemo(()=>({subscribe:p=>(a(m=>[...m,p]),()=>a(m=>m.filter(y=>y.current!==p.current)))}),[]);return be(()=>{for(let m=0;mi instanceof rt?i:new rt(...typeof i=="number"?[i,i,i]:i),t0=A.forwardRef(({color:i,start:t,end:e},s)=>{const n=A.useContext(ou);if(!n)throw"Segment must used inside Segments component.";const r=A.useRef(null);return A.useLayoutEffect(()=>n.subscribe(r),[]),A.createElement("segmentObject",{ref:fo([r,s]),color:i,start:tl(t),end:tl(e)})});function e0({all:i,scene:t,camera:e}){const s=Nt(({gl:o})=>o),n=Nt(({camera:o})=>o),r=Nt(({scene:o})=>o);return A.useLayoutEffect(()=>{const o=[];i&&(t||r).traverse(l=>{l.visible===!1&&(o.push(l),l.visible=!0)}),s.compile(t||r,e||n);const a=new wf(128);new bf(.01,1e5,a).update(s,t||r),a.dispose(),o.forEach(l=>l.visible=!1)},[]),null}function s0({pixelated:i}){const t=Nt(o=>o.gl),e=Nt(o=>o.internal.active),s=Nt(o=>o.performance.current),n=Nt(o=>o.viewport.initialDpr),r=Nt(o=>o.setDpr);return A.useEffect(()=>{const o=t.domElement;return()=>{e&&r(n),i&&o&&(o.style.imageRendering="auto")}},[]),A.useEffect(()=>{r(s*n),i&&t.domElement&&(t.domElement.style.imageRendering=s===1?"auto":"pixelated")},[s]),null}function n0(){const i=Nt(s=>s.get),t=Nt(s=>s.setEvents),e=Nt(s=>s.performance.current);return A.useEffect(()=>{const s=i().events.enabled;return()=>t({enabled:s})},[]),A.useEffect(()=>t({enabled:e===1}),[e]),null}const au=A.createContext(null);function i0({children:i,enabled:t=!0}){const[e,s]=A.useState([]),n=A.useMemo(()=>({selected:e,select:s,enabled:t}),[e,s,t]);return L.jsx(au.Provider,{value:n,children:i})}function r0({enabled:i=!1,children:t,...e}){const s=A.useRef(null),n=A.useContext(au);return A.useEffect(()=>{if(n&&i){let r=!1;const o=[];if(s.current.traverse(a=>{a.type==="Mesh"&&o.push(a),n.selected.indexOf(a)===-1&&(r=!0)}),r)return n.select(a=>[...a,...o]),()=>{n.select(a=>a.filter(c=>!o.includes(c)))}}},[i,t,n]),L.jsx("group",{ref:s,...e,children:t})}const o0={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},Os=Hl(i=>({...o0,setIsUserDragging:t=>i({isUserDragging:t}),setIsUserScrolling:t=>i({isUserScrolling:t}),setUserMovedCamera:t=>i({userMovedCamera:t}),setIsUserScrollingOnHtmlPanel:t=>i({isUserScrollingOnHtmlPanel:t})})),a0=()=>{const[i,t]=A.useState(""),e=A.useRef(null),{fetchData:s,setAbortRequests:n,seedQuestions:r}=Us(v=>v),[o]=Yl(v=>[v.setBudget]),{setUniverseQuestionIsOpen:a,setSidebarOpen:c,setShowCollapseButton:l}=Ji(v=>({setUniverseQuestionIsOpen:v.setUniverseQuestionIsOpen,setSidebarOpen:v.setSidebarOpen,setShowCollapseButton:v.setShowCollapseButton})),u=Od(v=>v.resetAiSummaryAnswer),[h,d]=A.useState([]);A.useEffect(()=>{r&&d(w(r).slice(0,4))},[r]),A.useEffect(()=>{e.current&&e.current.focus()},[]);const f=async v=>{v&&(u(),a(),c(!0),l(!0)),await s(o,n,v)},_=!!i.trim().length,p=async v=>{v.keyCode===13&&v.shiftKey===!1&&_&&(v.preventDefault(),f(i))},m=async v=>{t(v),await f(v)},y=()=>{a(),c(!0),l(!0)},w=v=>{const g=[...v];let T=g.length-1;for(;T>0;){const x=Math.floor(Math.random()*(T+1));[g[T],g[x]]=[g[x],g[T]],T-=1}return g},b=!!i&&i.trim().length>0;return L.jsxs(u0,{children:["Ideas have shapes",L.jsxs(l0,{onKeyDown:p,py:12,tabIndex:-1,children:[L.jsx(c0,{ref:e,onChange:v=>t(v.target.value),placeholder:"What do you want to know?",value:i}),L.jsx(h0,{color:"secondary",disabled:!b,onClick:()=>f(i),variant:"contained",children:b?L.jsxs(L.Fragment,{children:["Search ",L.jsx(Pc,{})]}):L.jsx(Pc,{})})]}),h.length>0&&L.jsx(f0,{children:h.map(v=>L.jsxs(p0,{onClick:()=>m(v),children:[L.jsx(Yd,{}),v]},v))}),L.jsx(d0,{"data-testid":"explore-graph-btn",onClick:y,startIcon:L.jsx(Gd,{}),children:"Explore Graph"})]})},c0=qt(df).attrs({maxRows:3})` + */const ct={LEFT:1,RIGHT:2,MIDDLE:4},q=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),vn={NONE:0,IN:1,OUT:-1};function Ws(i){return i.isPerspectiveCamera}function ws(i){return i.isOrthographicCamera}const kn=Math.PI*2,Uc=Math.PI/2,su=1e-5,li=Math.PI/180;function Fe(i,t,e){return Math.max(t,Math.min(e,i))}function Et(i,t=su){return Math.abs(i)0==p>u&&(p=u,e.value=(p-u)/r),p}function jc(i,t,e,s,n=1/0,r,o){s=Math.max(1e-4,s);const a=2/s,c=a*r,l=1/(1+c+.48*c*c+.235*c*c*c);let u=t.x,h=t.y,d=t.z,p=i.x-u,m=i.y-h,f=i.z-d;const _=u,y=h,w=d,b=n*s,v=b*b,g=p*p+m*m+f*f;if(g>v){const G=Math.sqrt(g);p=p/G*b,m=m/G*b,f=f/G*b}u=i.x-p,h=i.y-m,d=i.z-f;const x=(e.x+a*p)*r,T=(e.y+a*m)*r,k=(e.z+a*f)*r;e.x=(e.x-a*x)*l,e.y=(e.y-a*T)*l,e.z=(e.z-a*k)*l,o.x=u+(p+x)*l,o.y=h+(m+T)*l,o.z=d+(f+k)*l;const C=_-i.x,M=y-i.y,R=w-i.z,P=o.x-_,U=o.y-y,W=o.z-w;return C*P+M*U+R*W>0&&(o.x=_,o.y=y,o.z=w,e.x=(o.x-_)/r,e.y=(o.y-y)/r,e.z=(o.z-w)/r),o}function Vo(i,t){t.set(0,0),i.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=i.length,t.y/=i.length}function Uo(i,t){return ws(i)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}class Wf{constructor(){this._listeners={}}addEventListener(t,e){const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const n=this._listeners[t];if(n!==void 0){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}removeAllEventListeners(t){if(!t){this._listeners={};return}Array.isArray(this._listeners[t])&&(this._listeners[t].length=0)}dispatchEvent(t){const s=this._listeners[t.type];if(s!==void 0){t.target=this;const n=s.slice(0);for(let r=0,o=n.length;r{},this._enabled=!0,this._state=q.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=vn.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new at.Vector3,this._focalOffsetVelocity=new at.Vector3,this._zoomVelocity={value:0},this._truckInternal=(v,g,x)=>{let T,k;if(Ws(this._camera)){const C=ht.copy(this._camera.position).sub(this._target),M=this._camera.getEffectiveFOV()*li,R=C.length()*Math.tan(M*.5);T=this.truckSpeed*v*R/this._elementRect.height,k=this.truckSpeed*g*R/this._elementRect.height}else if(ws(this._camera)){const C=this._camera;T=v*(C.right-C.left)/C.zoom/this._elementRect.width,k=g*(C.top-C.bottom)/C.zoom/this._elementRect.height}else return;this.verticalDragToForward?(x?this.setFocalOffset(this._focalOffsetEnd.x+T,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(T,0,!0),this.forward(-k,!0)):x?this.setFocalOffset(this._focalOffsetEnd.x+T,this._focalOffsetEnd.y+k,this._focalOffsetEnd.z,!0):this.truck(T,k,!0)},this._rotateInternal=(v,g)=>{const x=kn*this.azimuthRotateSpeed*v/this._elementRect.height,T=kn*this.polarRotateSpeed*g/this._elementRect.height;this.rotate(x,T,!0)},this._dollyInternal=(v,g,x)=>{const T=Math.pow(.95,-v*this.dollySpeed),k=this._sphericalEnd.radius,C=this._sphericalEnd.radius*T,M=Fe(C,this.minDistance,this.maxDistance),R=M-C;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(C,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(R,!0),this._dollyToNoClamp(M,!0)):this._dollyToNoClamp(M,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?C:M)-k,this._dollyControlCoord.set(g,x)),this._lastDollyDirection=Math.sign(-v)},this._zoomInternal=(v,g,x)=>{const T=Math.pow(.95,v*this.dollySpeed),k=this._zoom,C=this._zoom*T;this.zoomTo(C,!0),this.dollyToCursor&&(this._changedZoom+=C-k,this._dollyControlCoord.set(g,x))},typeof at>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new at.Quaternion().setFromUnitVectors(this._camera.up,kr),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=q.NONE,this._target=new at.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new at.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new at.Spherical().setFromVector3(ht.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new at.Vector3,new at.Vector3,new at.Vector3,new at.Vector3],this._updateNearPlaneCorners(),this._boundary=new at.Box3(new at.Vector3(-1/0,-1/0,-1/0),new at.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new at.Vector2,this.mouseButtons={left:q.ROTATE,middle:q.DOLLY,right:q.TRUCK,wheel:Ws(this._camera)?q.DOLLY:ws(this._camera)?q.ZOOM:q.NONE},this.touches={one:q.TOUCH_ROTATE,two:Ws(this._camera)?q.TOUCH_DOLLY_TRUCK:ws(this._camera)?q.TOUCH_ZOOM_TRUCK:q.NONE,three:q.TOUCH_TRUCK};const s=new at.Vector2,n=new at.Vector2,r=new at.Vector2,o=v=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const T=this._domElement.getBoundingClientRect(),k=v.clientX/T.width,C=v.clientY/T.height;if(kthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const g=v.pointerType!=="mouse"?null:(v.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(v.buttons&ct.MIDDLE)===ct.MIDDLE?ct.MIDDLE:(v.buttons&ct.RIGHT)===ct.RIGHT?ct.RIGHT:null;if(g!==null){const T=this._findPointerByMouseButton(g);T&&this._disposePointer(T)}if((v.buttons&ct.LEFT)===ct.LEFT&&this._lockedPointer)return;const x={pointerId:v.pointerId,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:g};this._activePointers.push(x),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),this._isDragging=!0,f(v)},a=v=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const T=this._domElement.getBoundingClientRect(),k=v.clientX/T.width,C=v.clientY/T.height;if(kthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const g=(v.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(v.buttons&ct.MIDDLE)===ct.MIDDLE?ct.MIDDLE:(v.buttons&ct.RIGHT)===ct.RIGHT?ct.RIGHT:null;if(g!==null){const T=this._findPointerByMouseButton(g);T&&this._disposePointer(T)}const x={pointerId:1,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:(v.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(v.buttons&ct.MIDDLE)===ct.LEFT?ct.MIDDLE:(v.buttons&ct.RIGHT)===ct.LEFT?ct.RIGHT:null};this._activePointers.push(x),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",h),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",h),this._isDragging=!0,f(v)},c=v=>{v.cancelable&&v.preventDefault();const g=v.pointerId,x=this._lockedPointer||this._findPointerById(g);if(x){if(x.clientX=v.clientX,x.clientY=v.clientY,x.deltaX=v.movementX,x.deltaY=v.movementY,this._state=0,v.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(v.buttons&ct.LEFT)===ct.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(v.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(v.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right);_()}},l=v=>{const g=this._lockedPointer||this._findPointerById(1);g&&(g.clientX=v.clientX,g.clientY=v.clientY,g.deltaX=v.movementX,g.deltaY=v.movementY,this._state=0,(this._lockedPointer||(v.buttons&ct.LEFT)===ct.LEFT)&&(this._state=this._state|this.mouseButtons.left),(v.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right),_())},u=v=>{const g=this._findPointerById(v.pointerId);if(!(g&&g===this._lockedPointer)){if(g&&this._disposePointer(g),v.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=q.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=q.NONE;y()}},h=()=>{const v=this._findPointerById(1);v&&v===this._lockedPointer||(v&&this._disposePointer(v),this._state=q.NONE,y())};let d=-1;const p=v=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===q.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const C=this._domElement.getBoundingClientRect(),M=v.clientX/C.width,R=v.clientY/C.height;if(Mthis._interactiveArea.right||Rthis._interactiveArea.bottom)return}if(v.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===q.ROTATE||this.mouseButtons.wheel===q.TRUCK){const C=performance.now();d-C<1e3&&this._getClientRect(this._elementRect),d=C}const g=Yf?-1:-3,x=v.deltaMode===1?v.deltaY/g:v.deltaY/(g*10),T=this.dollyToCursor?(v.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,k=this.dollyToCursor?(v.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case q.ROTATE:{this._rotateInternal(v.deltaX,v.deltaY),this._isUserControllingRotate=!0;break}case q.TRUCK:{this._truckInternal(v.deltaX,v.deltaY,!1),this._isUserControllingTruck=!0;break}case q.OFFSET:{this._truckInternal(v.deltaX,v.deltaY,!0),this._isUserControllingOffset=!0;break}case q.DOLLY:{this._dollyInternal(-x,T,k),this._isUserControllingDolly=!0;break}case q.ZOOM:{this._zoomInternal(-x,T,k),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},m=v=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===oa.ACTION.NONE){const g=v instanceof PointerEvent?v.pointerId:(v instanceof MouseEvent,0),x=this._findPointerById(g);x&&this._disposePointer(x),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",h);return}v.preventDefault()}},f=v=>{if(!this._enabled)return;if(Vo(this._activePointers,ce),this._getClientRect(this._elementRect),s.copy(ce),n.copy(ce),this._activePointers.length>=2){const x=ce.x-this._activePointers[1].clientX,T=ce.y-this._activePointers[1].clientY,k=Math.sqrt(x*x+T*T);r.set(0,k);const C=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,M=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;n.set(C,M)}if(this._state=0,!v)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in v&&v.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(v.buttons&ct.LEFT)===ct.LEFT&&(this._state=this._state|this.mouseButtons.left),(v.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&q.ROTATE)===q.ROTATE||(this._state&q.TOUCH_ROTATE)===q.TOUCH_ROTATE||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&q.TRUCK)===q.TRUCK||(this._state&q.TOUCH_TRUCK)===q.TOUCH_TRUCK||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&q.DOLLY)===q.DOLLY||(this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&q.ZOOM)===q.ZOOM||(this._state&q.TOUCH_ZOOM)===q.TOUCH_ZOOM||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&q.OFFSET)===q.OFFSET||(this._state&q.TOUCH_OFFSET)===q.TOUCH_OFFSET||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},_=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Vo(this._activePointers,ce);const g=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,x=g?-g.deltaX:n.x-ce.x,T=g?-g.deltaY:n.y-ce.y;if(n.copy(ce),((this._state&q.ROTATE)===q.ROTATE||(this._state&q.TOUCH_ROTATE)===q.TOUCH_ROTATE||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(x,T),this._isUserControllingRotate=!0),(this._state&q.DOLLY)===q.DOLLY||(this._state&q.ZOOM)===q.ZOOM){const k=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,C=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,M=this.dollyDragInverted?-1:1;(this._state&q.DOLLY)===q.DOLLY?(this._dollyInternal(M*T*vr,k,C),this._isUserControllingDolly=!0):(this._zoomInternal(M*T*vr,k,C),this._isUserControllingZoom=!0)}if((this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_ZOOM)===q.TOUCH_ZOOM||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE){const k=ce.x-this._activePointers[1].clientX,C=ce.y-this._activePointers[1].clientY,M=Math.sqrt(k*k+C*C),R=r.y-M;r.set(0,M);const P=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,U=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET?(this._dollyInternal(R*vr,P,U),this._isUserControllingDolly=!0):(this._zoomInternal(R*vr,P,U),this._isUserControllingZoom=!0)}((this._state&q.TRUCK)===q.TRUCK||(this._state&q.TOUCH_TRUCK)===q.TOUCH_TRUCK||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(x,T,!1),this._isUserControllingTruck=!0),((this._state&q.OFFSET)===q.OFFSET||(this._state&q.TOUCH_OFFSET)===q.TOUCH_OFFSET||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(x,T,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},y=()=>{Vo(this._activePointers,ce),n.copy(ce),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mouseup",h),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",w),this._domElement.ownerDocument.addEventListener("pointerlockerror",b),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),f())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",w),this._domElement.ownerDocument.removeEventListener("pointerlockerror",b))};const w=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},b=()=>{this.unlockPointer()};this._addAllEventListeners=v=>{this._domElement=v,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),Gf&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",u),this._domElement.addEventListener("wheel",p,{passive:!1}),this._domElement.addEventListener("contextmenu",m)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",u),this._domElement.removeEventListener("wheel",p,{passive:!1}),this._domElement.removeEventListener("contextmenu",m),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mouseup",h),this._domElement.ownerDocument.removeEventListener("pointerlockchange",w),this._domElement.ownerDocument.removeEventListener("pointerlockerror",b))},this.cancel=()=>{this._state!==q.NONE&&(this._state=q.NONE,this._activePointers.length=0,y())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=Fe(t.width,0,1),this._interactiveArea.height=Fe(t.height,0,1),this._interactiveArea.x=Fe(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Fe(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,s=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,s)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,s=!1){this._isUserControllingRotate=!1;const n=Fe(t,this.minAzimuthAngle,this.maxAzimuthAngle),r=Fe(e,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=n,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!s||gt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0,this._dollyToNoClamp(Fe(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=gt(o,this._spherical.radius);if(!(s>t)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,o)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const r=!e||gt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(di).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const s=!e||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=Fe(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const s=!e||gt(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(t,e,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,s)}truck(t,e,s=!1){this._camera.updateMatrix(),$e.setFromMatrixColumn(this._camera.matrix,0),Xe.setFromMatrixColumn(this._camera.matrix,1),$e.multiplyScalar(t),Xe.multiplyScalar(-e);const n=ht.copy($e).add(Xe),r=mt.copy(this._targetEnd).add(n);return this.moveTo(r.x,r.y,r.z,s)}forward(t,e=!1){ht.setFromMatrixColumn(this._camera.matrix,0),ht.crossVectors(this._camera.up,ht),ht.multiplyScalar(t);const s=mt.copy(this._targetEnd).add(ht);return this.moveTo(s.x,s.y,s.z,e)}elevate(t,e=!1){return ht.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+ht.x,this._targetEnd.y+ht.y,this._targetEnd.z+ht.z,e)}moveTo(t,e,s,n=!1){this._isUserControllingTruck=!1;const r=ht.set(t,e,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,n||this._target.copy(this._targetEnd);const o=!n||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,s,n=!1){const a=ht.set(t,e,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,n)}fitToBox(t,e,{cover:s=!1,paddingLeft:n=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],l=t.isBox3?Tn.copy(t):Tn.setFromObject(t);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=zc(this._sphericalEnd.theta,Uc),h=zc(this._sphericalEnd.phi,Uc);c.push(this.rotateTo(u,h,e));const d=ht.setFromSpherical(this._sphericalEnd).normalize(),p=Yc.setFromUnitVectors(d,zo),m=gt(Math.abs(d.y),1);m&&p.multiply(Bo.setFromAxisAngle(kr,u)),p.multiply(this._yAxisUpSpaceInverse);const f=Hc.makeEmpty();mt.copy(l.min).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setX(l.max.x).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setY(l.max.y).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setZ(l.min.z).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setZ(l.max.z).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setY(l.min.y).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setX(l.min.x).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).applyQuaternion(p),f.expandByPoint(mt),f.min.x-=n,f.min.y-=o,f.max.x+=r,f.max.y+=a,p.setFromUnitVectors(zo,d),m&&p.premultiply(Bo.invert()),p.premultiply(this._yAxisUpSpace);const _=f.getSize(ht),y=f.getCenter(mt).applyQuaternion(p);if(Ws(this._camera)){const w=this.getDistanceToFitBox(_.x,_.y,_.z,s);c.push(this.moveTo(y.x,y.y,y.z,e)),c.push(this.dollyTo(w,e)),c.push(this.setFocalOffset(0,0,0,e))}else if(ws(this._camera)){const w=this._camera,b=w.right-w.left,v=w.top-w.bottom,g=s?Math.max(b/_.x,v/_.y):Math.min(b/_.x,v/_.y);c.push(this.moveTo(y.x,y.y,y.z,e)),c.push(this.zoomTo(g,e)),c.push(this.setFocalOffset(0,0,0,e))}return Promise.all(c)}fitToSphere(t,e){const s=[],r=t instanceof at.Sphere?jo.copy(t):oa.createBoundingSphere(t,jo);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,e)),Ws(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,e))}else if(ws(this._camera)){const o=this._camera.right-this._camera.left,a=this._camera.top-this._camera.bottom,c=2*r.radius,l=Math.min(o/c,a/c);s.push(this.zoomTo(l,e))}return s.push(this.setFocalOffset(0,0,0,e)),Promise.all(s)}setLookAt(t,e,s,n,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0;const c=mt.set(n,r,o),l=ht.set(t,e,s);this._targetEnd.copy(c),this._sphericalEnd.setFromVector3(l.sub(c).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!a||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold)&>(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&>(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(t,e,s,n,r,o,a,c,l,u,h,d,p,m=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0;const f=ht.set(n,r,o),_=mt.set(t,e,s);Ce.setFromVector3(_.sub(f).applyQuaternion(this._yAxisUpSpace));const y=xn.set(u,h,d),w=mt.set(a,c,l);fi.setFromVector3(w.sub(y).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(f.lerp(y,p));const b=fi.theta-Ce.theta,v=fi.phi-Ce.phi,g=fi.radius-Ce.radius;this._sphericalEnd.set(Ce.radius+g*p,Ce.phi+v*p,Ce.theta+b*p),this.normalizeRotations(),this._needsUpdate=!0,m||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const x=!m||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold)&>(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&>(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(x)}setPosition(t,e,s,n=!1){return this.setLookAt(t,e,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,n)}setTarget(t,e,s,n=!1){const r=this.getPosition(ht),o=this.setLookAt(r.x,r.y,r.z,t,e,s,n);return this._sphericalEnd.phi=Fe(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,s,n=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,s),this._needsUpdate=!0,n||this._focalOffset.copy(this._focalOffsetEnd);const r=!n||gt(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&>(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&>(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(t,e,s){this._camera.updateMatrixWorld(),$e.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Xe.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Hs.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const n=ht.set(t,e,s),r=n.distanceTo(this._camera.position),o=n.sub(this._camera.position);$e.multiplyScalar(o.x),Xe.multiplyScalar(o.y),Hs.multiplyScalar(o.z),ht.copy($e).add(Xe).add(Hs),ht.z=ht.z+r,this.dollyTo(r,!1),this.setFocalOffset(-ht.x,ht.y,-ht.z,!1),this.moveTo(t,e,s,!1)}setBoundary(t){if(!t){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,s,n){if(t===null){this._viewport=null;return}this._viewport=this._viewport||new at.Vector4,typeof t=="number"?this._viewport.set(t,e,s,n):this._viewport.copy(t)}getDistanceToFitBox(t,e,s,n=!1){if(Uo(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=t/e,o=this._camera.getEffectiveFOV()*li,a=this._camera.aspect;return((n?r>a:re.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,s){const n=e.lengthSq();if(n===0)return t;const r=mt.copy(e).add(t),a=this._boundary.clampPoint(r,xn).sub(r),c=a.lengthSq();if(c===0)return t.add(e);if(c===n)return t;if(s===0)return t.add(e).add(a);{const l=1+s*c/e.dot(a);return t.add(mt.copy(e).multiplyScalar(l)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Ws(this._camera)){const t=this._camera,e=t.near,s=t.getEffectiveFOV()*li,n=Math.tan(s*.5)*e,r=n*t.aspect;this._nearPlaneCorners[0].set(-r,-n,0),this._nearPlaneCorners[1].set(r,-n,0),this._nearPlaneCorners[2].set(r,n,0),this._nearPlaneCorners[3].set(-r,n,0)}else if(ws(this._camera)){const t=this._camera,e=1/t.zoom,s=t.left*e,n=t.right*e,r=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(n,r,0),this._nearPlaneCorners[2].set(n,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1)||Uo(this._camera,"_collisionTest"))return t;const s=this._getTargetDirection(di);qo.lookAt(Bc,s,this._camera.up);for(let n=0;n<4;n++){const r=mt.copy(this._nearPlaneCorners[n]);r.applyMatrix4(qo);const o=xn.addVectors(this._target,r);xr.set(o,s),xr.far=this._spherical.radius+1;const a=xr.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),e()};this.addEventListener("rest",s)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new at.Sphere){const s=e,n=s.center;Tn.makeEmpty(),t.traverseVisible(o=>{o.isMesh&&Tn.expandByObject(o)}),Tn.getCenter(n);let r=0;return t.traverseVisible(o=>{if(!o.isMesh)return;const a=o,c=a.geometry.clone();c.applyMatrix4(a.matrixWorld);const u=c.attributes.position;for(let h=0,d=u.count;h{A.useMemo(()=>{Wo.install({THREE:vf}),Na({CameraControlsImpl:Wo})},[]);const{camera:e,domElement:s,makeDefault:n,onStart:r,onEnd:o,onChange:a,regress:c,...l}=i,u=Nt(g=>g.camera),h=Nt(g=>g.gl),d=Nt(g=>g.invalidate),p=Nt(g=>g.events),m=Nt(g=>g.setEvents),f=Nt(g=>g.set),_=Nt(g=>g.get),y=Nt(g=>g.performance),w=e||u,b=s||p.connected||h.domElement,v=A.useMemo(()=>new Wo(w),[w]);return be((g,x)=>{v.enabled&&v.update(x)},-1),A.useEffect(()=>(v.connect(b),()=>void v.disconnect()),[b,v]),A.useEffect(()=>{const g=k=>{d(),c&&y.regress(),a&&a(k)},x=k=>{r&&r(k)},T=k=>{o&&o(k)};return v.addEventListener("update",g),v.addEventListener("controlstart",x),v.addEventListener("controlend",T),()=>{v.removeEventListener("update",g),v.removeEventListener("controlstart",x),v.removeEventListener("controlend",T)}},[v,r,o,d,m,c,a]),A.useEffect(()=>{if(n){const g=_().controls;return f({controls:v}),()=>f({controls:g})}},[n,v]),A.createElement("primitive",Oe({ref:t,object:v},l))});ei.func.isRequired,ei.arrayOf(ei.oneOfType([ei.element,ei.func])).isRequired;const Gc=new er,$c=new er,Tr=[],pi=new tu;class Xf extends xf{constructor(){super(),this.color=new go("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var t;return(t=this.instance.current)==null?void 0:t.geometry}raycast(t,e){const s=this.instance.current;if(!s||!s.geometry||!s.material)return;pi.geometry=s.geometry;const n=s.matrixWorld,r=s.userData.instances.indexOf(this.instanceKey);if(!(r===-1||r>s.count)){s.getMatrixAt(r,Gc),$c.multiplyMatrices(n,Gc),pi.matrixWorld=$c,s.material instanceof Tf?pi.material.side=s.material.side:pi.material.side=s.material[0].side,pi.raycast(t,Tr);for(let o=0,a=Tr.length;o{A.useMemo(()=>Na({PositionMesh:Xf}),[]);const n=A.useRef(),{subscribe:r,getParent:o}=A.useContext(i||iu);return A.useLayoutEffect(()=>r(n),[]),A.createElement("positionMesh",Oe({instance:o(),instanceKey:n,ref:fo([s,n])},e),t)}),Qf=A.forwardRef(({children:i,range:t,limit:e=1e3,frames:s=1/0,...n},r)=>{const[{context:o,instance:a}]=A.useState(()=>{const _=A.createContext(null);return{context:_,instance:A.forwardRef((y,w)=>A.createElement(ru,Oe({context:_},y,{ref:w})))}}),c=A.useRef(null),[l,u]=A.useState([]),[[h,d]]=A.useState(()=>{const _=new Float32Array(e*16);for(let y=0;y1))]});A.useEffect(()=>{c.current.instanceMatrix.needsUpdate=!0});let p=0,m=0;be(()=>{if(s===1/0||p({getParent:()=>c,subscribe:_=>(u(y=>[...y,_]),()=>u(y=>y.filter(w=>w.current!==_.current)))}),[]);return A.createElement("instancedMesh",Oe({userData:{instances:l},matrixAutoUpdate:!1,ref:fo([r,c]),args:[null,null,0],raycast:()=>null},n),A.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:h.length/16,array:h,itemSize:16,usage:Ic}),A.createElement("instancedBufferAttribute",{attach:"instanceColor",count:d.length/3,array:d,itemSize:3,usage:Ic}),typeof i=="function"?A.createElement(o.Provider,{value:f},i(a)):A.createElement(iu.Provider,{value:f},i))}),ou=A.createContext(null),Kf=A.forwardRef((i,t)=>{A.useMemo(()=>Na({SegmentObject:Jf}),[]);const{limit:e=1e3,lineWidth:s=1,children:n,...r}=i,[o,a]=A.useState([]),[c]=A.useState(()=>new Fd),[l]=A.useState(()=>new Ld),[u]=A.useState(()=>new Vd),[h]=A.useState(()=>new _t(512,512)),[d]=A.useState(()=>Array(e*6).fill(0)),[p]=A.useState(()=>Array(e*6).fill(0)),m=A.useMemo(()=>({subscribe:f=>(a(_=>[..._,f]),()=>a(_=>_.filter(y=>y.current!==f.current)))}),[]);return be(()=>{for(let _=0;_i instanceof rt?i:new rt(...typeof i=="number"?[i,i,i]:i),t0=A.forwardRef(({color:i,start:t,end:e},s)=>{const n=A.useContext(ou);if(!n)throw"Segment must used inside Segments component.";const r=A.useRef(null);return A.useLayoutEffect(()=>n.subscribe(r),[]),A.createElement("segmentObject",{ref:fo([r,s]),color:i,start:tl(t),end:tl(e)})});function e0({all:i,scene:t,camera:e}){const s=Nt(({gl:o})=>o),n=Nt(({camera:o})=>o),r=Nt(({scene:o})=>o);return A.useLayoutEffect(()=>{const o=[];i&&(t||r).traverse(l=>{l.visible===!1&&(o.push(l),l.visible=!0)}),s.compile(t||r,e||n);const a=new wf(128);new bf(.01,1e5,a).update(s,t||r),a.dispose(),o.forEach(l=>l.visible=!1)},[]),null}function s0({pixelated:i}){const t=Nt(o=>o.gl),e=Nt(o=>o.internal.active),s=Nt(o=>o.performance.current),n=Nt(o=>o.viewport.initialDpr),r=Nt(o=>o.setDpr);return A.useEffect(()=>{const o=t.domElement;return()=>{e&&r(n),i&&o&&(o.style.imageRendering="auto")}},[]),A.useEffect(()=>{r(s*n),i&&t.domElement&&(t.domElement.style.imageRendering=s===1?"auto":"pixelated")},[s]),null}function n0(){const i=Nt(s=>s.get),t=Nt(s=>s.setEvents),e=Nt(s=>s.performance.current);return A.useEffect(()=>{const s=i().events.enabled;return()=>t({enabled:s})},[]),A.useEffect(()=>t({enabled:e===1}),[e]),null}const au=A.createContext(null);function i0({children:i,enabled:t=!0}){const[e,s]=A.useState([]),n=A.useMemo(()=>({selected:e,select:s,enabled:t}),[e,s,t]);return L.jsx(au.Provider,{value:n,children:i})}function r0({enabled:i=!1,children:t,...e}){const s=A.useRef(null),n=A.useContext(au);return A.useEffect(()=>{if(n&&i){let r=!1;const o=[];if(s.current.traverse(a=>{a.type==="Mesh"&&o.push(a),n.selected.indexOf(a)===-1&&(r=!0)}),r)return n.select(a=>[...a,...o]),()=>{n.select(a=>a.filter(c=>!o.includes(c)))}}},[i,t,n]),L.jsx("group",{ref:s,...e,children:t})}const o0={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},Os=Hl(i=>({...o0,setIsUserDragging:t=>i({isUserDragging:t}),setIsUserScrolling:t=>i({isUserScrolling:t}),setUserMovedCamera:t=>i({userMovedCamera:t}),setIsUserScrollingOnHtmlPanel:t=>i({isUserScrollingOnHtmlPanel:t})})),a0=()=>{const[i,t]=A.useState(""),e=A.useRef(null),{fetchData:s,setAbortRequests:n,seedQuestions:r}=Us(v=>v),[o]=Yl(v=>[v.setBudget]),{setUniverseQuestionIsOpen:a,setSidebarOpen:c,setShowCollapseButton:l}=Ji(v=>({setUniverseQuestionIsOpen:v.setUniverseQuestionIsOpen,setSidebarOpen:v.setSidebarOpen,setShowCollapseButton:v.setShowCollapseButton})),u=Od(v=>v.resetAiSummaryAnswer),[h,d]=A.useState([]);A.useEffect(()=>{r&&d(w(r).slice(0,4))},[r]),A.useEffect(()=>{e.current&&e.current.focus()},[]);const p=async v=>{v&&(u(),a(),c(!0),l(!0)),await s(o,n,v)},m=!!i.trim().length,f=async v=>{v.keyCode===13&&v.shiftKey===!1&&m&&(v.preventDefault(),p(i))},_=async v=>{t(v),await p(v)},y=()=>{a(),c(!0),l(!0)},w=v=>{const g=[...v];let x=g.length-1;for(;x>0;){const T=Math.floor(Math.random()*(x+1));[g[x],g[T]]=[g[T],g[x]],x-=1}return g},b=!!i&&i.trim().length>0;return L.jsxs(u0,{children:["Ideas have shapes",L.jsxs(l0,{onKeyDown:f,py:12,tabIndex:-1,children:[L.jsx(c0,{ref:e,onChange:v=>t(v.target.value),placeholder:"What do you want to know?",value:i}),L.jsx(h0,{color:"secondary",disabled:!b,onClick:()=>p(i),variant:"contained",children:b?L.jsxs(L.Fragment,{children:["Search ",L.jsx(Pc,{})]}):L.jsx(Pc,{})})]}),h.length>0&&L.jsx(f0,{children:h.map(v=>L.jsxs(p0,{onClick:()=>_(v),children:[L.jsx(Yd,{}),v]},v))}),L.jsx(d0,{"data-testid":"explore-graph-btn",onClick:y,startIcon:L.jsx(Gd,{}),children:"Explore Graph"})]})},c0=qt(df).attrs({maxRows:3})` background: ${Tt.BG1}; max-width: 700px; width: 700px; @@ -128,9 +128,9 @@ import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y a path { fill: ${Tt.modalWhiteOverlayBg}; } -`,Ti=new rt(0,0,0),el=100,m0=600,_0=2e3,Ho={x:172.7392402058252,y:-239.04675366094037,z:-2e3},cu="14.8.49",sl=(i,t,e)=>({endTime:t,insertTime:e,type:"exponentialRampToValue",value:i}),nl=(i,t,e)=>({endTime:t,insertTime:e,type:"linearRampToValue",value:i}),aa=(i,t)=>({startTime:t,type:"setValue",value:i}),lu=(i,t,e)=>({duration:e,startTime:t,type:"setValueCurve",values:i}),uu=(i,t,{startTime:e,target:s,timeConstant:n})=>s+(t-s)*Math.exp((e-i)/n),En=i=>i.type==="exponentialRampToValue",Lr=i=>i.type==="linearRampToValue",bs=i=>En(i)||Lr(i),Ra=i=>i.type==="setValue",ls=i=>i.type==="setValueCurve",Vr=(i,t,e,s)=>{const n=i[t];return n===void 0?s:bs(n)||Ra(n)?n.value:ls(n)?n.values[n.values.length-1]:uu(e,Vr(i,t-1,n.startTime,s),n)},il=(i,t,e,s,n)=>e===void 0?[s.insertTime,n]:bs(e)?[e.endTime,e.value]:Ra(e)?[e.startTime,e.value]:ls(e)?[e.startTime+e.duration,e.values[e.values.length-1]]:[e.startTime,Vr(i,t-1,e.startTime,n)],ca=i=>i.type==="cancelAndHold",la=i=>i.type==="cancelScheduledValues",Ts=i=>ca(i)||la(i)?i.cancelTime:En(i)||Lr(i)?i.endTime:i.startTime,rl=(i,t,e,{endTime:s,value:n})=>e===n?n:0e+(i-t)/(s-t)*(n-e),g0=(i,t)=>{const e=Math.floor(t),s=Math.ceil(t);return e===s?i[e]:(1-(t-e))*i[e]+(1-(s-t))*i[s]},y0=(i,{duration:t,startTime:e,values:s})=>{const n=(i-e)/t*(s.length-1);return g0(s,n)},wr=i=>i.type==="setTarget";class v0{constructor(t){this._automationEvents=[],this._currenTime=0,this._defaultValue=t}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(t){const e=Ts(t);if(ca(t)||la(t)){const s=this._automationEvents.findIndex(r=>la(t)&&ls(r)?r.startTime+r.duration>=e:Ts(r)>=e),n=this._automationEvents[s];if(s!==-1&&(this._automationEvents=this._automationEvents.slice(0,s)),ca(t)){const r=this._automationEvents[this._automationEvents.length-1];if(n!==void 0&&bs(n)){if(r!==void 0&&wr(r))throw new Error("The internal list is malformed.");const o=r===void 0?n.insertTime:ls(r)?r.startTime+r.duration:Ts(r),a=r===void 0?this._defaultValue:ls(r)?r.values[r.values.length-1]:r.value,c=En(n)?rl(e,o,a,n):ol(e,o,a,n),l=En(n)?sl(c,e,this._currenTime):nl(c,e,this._currenTime);this._automationEvents.push(l)}if(r!==void 0&&wr(r)&&this._automationEvents.push(aa(this.getValue(e),e)),r!==void 0&&ls(r)&&r.startTime+r.duration>e){const o=e-r.startTime,a=(r.values.length-1)/r.duration,c=Math.max(2,1+Math.ceil(o*a)),l=o/(c-1)*a,u=r.values.slice(0,c);if(l<1)for(let h=1;hTs(o)>e),n=s===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[s-1];if(n!==void 0&&ls(n)&&Ts(n)+n.duration>e)return!1;const r=En(t)?sl(t.value,t.endTime,this._currenTime):Lr(t)?nl(t.value,e,this._currenTime):t;if(s===-1)this._automationEvents.push(r);else{if(ls(t)&&e+t.duration>Ts(this._automationEvents[s]))return!1;this._automationEvents.splice(s,0,r)}}return!0}flush(t){const e=this._automationEvents.findIndex(s=>Ts(s)>t);if(e>1){const s=this._automationEvents.slice(e-1),n=s[0];wr(n)&&s.unshift(aa(Vr(this._automationEvents,e-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=s}}getValue(t){if(this._automationEvents.length===0)return this._defaultValue;const e=this._automationEvents.findIndex(o=>Ts(o)>t),s=this._automationEvents[e],n=(e===-1?this._automationEvents.length:e)-1,r=this._automationEvents[n];if(r!==void 0&&wr(r)&&(s===void 0||!bs(s)||s.insertTime>t))return uu(t,Vr(this._automationEvents,n-1,r.startTime,this._defaultValue),r);if(r!==void 0&&Ra(r)&&(s===void 0||!bs(s)))return r.value;if(r!==void 0&&ls(r)&&(s===void 0||!bs(s)||r.startTime+r.duration>t))return t({cancelTime:i,type:"cancelAndHold"}),x0=i=>({cancelTime:i,type:"cancelScheduledValues"}),T0=(i,t)=>({endTime:t,type:"exponentialRampToValue",value:i}),w0=(i,t)=>({endTime:t,type:"linearRampToValue",value:i}),b0=(i,t,e)=>({startTime:t,target:i,timeConstant:e,type:"setTarget"}),C0=()=>new DOMException("","AbortError"),S0=i=>(t,e,[s,n,r],o)=>{i(t[n],[e,s,r],a=>a[0]===e&&a[1]===s,o)},E0=i=>(t,e,s)=>{const n=[];for(let r=0;r(t,e)=>{i.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:e})},Ln=new WeakSet,hu=new WeakMap,Fa=new WeakMap,du=new WeakMap,La=new WeakMap,yo=new WeakMap,fu=new WeakMap,ua=new WeakMap,ha=new WeakMap,da=new WeakMap,pu={construct(){return pu}},A0=i=>{try{const t=new Proxy(i,pu);new t}catch{return!1}return!0},al=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,cl=(i,t)=>{const e=[];let s=i.replace(/^[\s]+/,""),n=s.match(al);for(;n!==null;){const r=n[1].slice(1,-1),o=n[0].replace(/([\s]+)?;?$/,"").replace(r,new URL(r,t).toString());e.push(o),s=s.slice(n[0].length).replace(/^[\s]+/,""),n=s.match(al)}return[e.join(";"),s]},ll=i=>{if(i!==void 0&&!Array.isArray(i))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},ul=i=>{if(!A0(i))throw new TypeError("The given value for processorCtor should be a constructor.");if(i.prototype===null||typeof i.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},M0=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>{let f=0;return(_,p,m={credentials:"omit"})=>{const y=u.get(_);if(y!==void 0&&y.has(p))return Promise.resolve();const w=l.get(_);if(w!==void 0){const g=w.get(p);if(g!==void 0)return g}const b=r(_),v=b.audioWorklet===void 0?n(p).then(([g,T])=>{const[x,k]=cl(g,T),C=`${x};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${k} -})})(window,'_AWGS')`;return e(C)}).then(()=>{const g=d._AWGS.pop();if(g===void 0)throw new SyntaxError;s(b.currentTime,b.sampleRate,()=>g(class{},void 0,(T,x)=>{if(T.trim()==="")throw t();const k=ha.get(b);if(k!==void 0){if(k.has(T))throw t();ul(x),ll(x.parameterDescriptors),k.set(T,x)}else ul(x),ll(x.parameterDescriptors),ha.set(b,new Map([[T,x]]))},b.sampleRate,void 0,void 0))}):Promise.all([n(p),Promise.resolve(i(h,h))]).then(([[g,T],x])=>{const k=f+1;f=k;const[C,M]=cl(g,T),W=`${C};((AudioWorkletProcessor,registerProcessor)=>{${M} -})(${x?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${x?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${x?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${k}',class extends AudioWorkletProcessor{process(){return !1}})`,G=new Blob([W],{type:"application/javascript; charset=utf-8"}),Y=URL.createObjectURL(G);return b.audioWorklet.addModule(Y,m).then(()=>{if(a(b))return b;const j=o(b);return j.audioWorklet.addModule(Y,m).then(()=>j)}).then(j=>{if(c===null)throw new SyntaxError;try{new c(j,`__sac${k}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(Y))});return w===void 0?l.set(_,new Map([[p,v]])):w.set(p,v),v.then(()=>{const g=u.get(_);g===void 0?u.set(_,new Set([p])):g.add(p)}).finally(()=>{const g=l.get(_);g!==void 0&&g.delete(p)}),v}},je=(i,t)=>{const e=i.get(t);if(e===void 0)throw new Error("A value with the given key could not be found.");return e},vo=(i,t)=>{const e=Array.from(i).filter(t);if(e.length>1)throw Error("More than one element was found.");if(e.length===0)throw Error("No element was found.");const[s]=e;return i.delete(s),s},mu=(i,t,e,s)=>{const n=je(i,t),r=vo(n,o=>o[0]===e&&o[1]===s);return n.size===0&&i.delete(t),r},nr=i=>je(fu,i),Vn=i=>{if(Ln.has(i))throw new Error("The AudioNode is already stored.");Ln.add(i),nr(i).forEach(t=>t(!0))},_u=i=>"port"in i,ir=i=>{if(!Ln.has(i))throw new Error("The AudioNode is not stored.");Ln.delete(i),nr(i).forEach(t=>t(!1))},fa=(i,t)=>{!_u(i)&&t.every(e=>e.size===0)&&ir(i)},D0=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>{const f=new WeakMap;return(_,p,m,y,w)=>{const{activeInputs:b,passiveInputs:v}=r(p),{outputs:g}=r(_),T=a(_),x=k=>{const C=c(p),M=c(_);if(k){const R=mu(v,_,m,y);i(b,_,R,!1),!w&&!h(_)&&e(M,C,m,y),d(p)&&Vn(p)}else{const R=s(b,_,m,y);t(v,y,R,!1),!w&&!h(_)&&n(M,C,m,y);const P=o(p);if(P===0)u(p)&&fa(p,b);else{const U=f.get(p);U!==void 0&&clearTimeout(U),f.set(p,setTimeout(()=>{u(p)&&fa(p,b)},P*1e3))}}};return l(g,[p,m,y],k=>k[0]===p&&k[1]===m&&k[2]===y,!0)?(T.add(x),u(_)?i(b,_,[m,y,x],!0):t(v,y,[_,m,x],!0),!0):!1}},P0=i=>(t,e,[s,n,r],o)=>{const a=t.get(s);a===void 0?t.set(s,new Set([[n,e,r]])):i(a,[n,e,r],c=>c[0]===n&&c[1]===e,o)},N0=i=>(t,e)=>{const s=i(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});e.connect(s).connect(t.destination);const n=()=>{e.removeEventListener("ended",n),e.disconnect(s),s.disconnect()};e.addEventListener("ended",n)},I0=i=>(t,e)=>{i(t).add(e)},R0={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},F0=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...R0,...c},h=s(l,u),d=r(l)?t():null;super(a,!1,h,d),this._nativeAnalyserNode=h}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(a){this._nativeAnalyserNode.fftSize=a}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(a){const c=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=a,!(a>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=c,e()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(a){const c=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=a,!(this._nativeAnalyserNode.maxDecibels>a))throw this._nativeAnalyserNode.minDecibels=c,e()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(a){this._nativeAnalyserNode.smoothingTimeConstant=a}getByteFrequencyData(a){this._nativeAnalyserNode.getByteFrequencyData(a)}getByteTimeDomainData(a){this._nativeAnalyserNode.getByteTimeDomainData(a)}getFloatFrequencyData(a){this._nativeAnalyserNode.getFloatFrequencyData(a)}getFloatTimeDomainData(a){this._nativeAnalyserNode.getFloatTimeDomainData(a)}},se=(i,t)=>i.context===t,L0=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Ur=i=>{try{i.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},ss=()=>new DOMException("","IndexSizeError"),Va=i=>{i.getChannelData=(t=>e=>{try{return t.call(i,e)}catch(s){throw s.code===12?ss():s}})(i.getChannelData)},V0={numberOfChannels:1},U0=(i,t,e,s,n,r,o,a)=>{let c=null;return class gu{constructor(u){if(n===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:h,numberOfChannels:d,sampleRate:f}={...V0,...u};c===null&&(c=new n(1,1,44100));const _=s!==null&&t(r,r)?new s({length:h,numberOfChannels:d,sampleRate:f}):c.createBuffer(d,h,f);if(_.numberOfChannels===0)throw e();return typeof _.copyFromChannel!="function"?(o(_),Va(_)):t(Ur,()=>Ur(_))||a(_),i.add(_),_}static[Symbol.hasInstance](u){return u!==null&&typeof u=="object"&&Object.getPrototypeOf(u)===gu.prototype||i.has(u)}}},le=-34028234663852886e22,ne=-le,ds=i=>Ln.has(i),z0={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},j0=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...z0,...u},f=n(h,d),_=o(h),p=_?t():null;super(l,!1,f,p),this._audioBufferSourceNodeRenderer=p,this._isBufferNullified=!1,this._isBufferSet=d.buffer!==null,this._nativeAudioBufferSourceNode=f,this._onended=null,this._playbackRate=e(this,_,f.playbackRate,ne,le)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(l){if(this._nativeAudioBufferSourceNode.buffer=l,l!==null){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(l){this._nativeAudioBufferSourceNode.loop=l}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(l){this._nativeAudioBufferSourceNode.loopEnd=l}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(l){this._nativeAudioBufferSourceNode.loopStart=l}get onended(){return this._onended}set onended(l){const u=typeof l=="function"?a(this,l):null;this._nativeAudioBufferSourceNode.onended=u;const h=this._nativeAudioBufferSourceNode.onended;this._onended=h!==null&&h===u?l:h}get playbackRate(){return this._playbackRate}start(l=0,u=0,h){if(this._nativeAudioBufferSourceNode.start(l,u,h),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=h===void 0?[l,u]:[l,u,h]),this.context.state!=="closed"){Vn(this);const d=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",d),ds(this)&&ir(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",d)}}stop(l=0){this._nativeAudioBufferSourceNode.stop(l),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=l)}},B0=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=e(l);const d=se(h,u);if(!d){const f={buffer:h.buffer,channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,loop:h.loop,loopEnd:h.loopEnd,loopStart:h.loopStart,playbackRate:h.playbackRate.value};h=t(u,f),o!==null&&h.start(...o),a!==null&&h.stop(a)}return r.set(u,h),d?await i(u,l.playbackRate,h.playbackRate):await s(u,l.playbackRate,h.playbackRate),await n(l,u,h),h};return{set start(l){o=l},set stop(l){a=l},render(l,u){const h=r.get(u);return h!==void 0?Promise.resolve(h):c(l,u)}}},q0=i=>"playbackRate"in i,W0=i=>"frequency"in i&&"gain"in i,H0=i=>"offset"in i,Y0=i=>!("frequency"in i)&&"gain"in i,G0=i=>"detune"in i&&"frequency"in i,$0=i=>"pan"in i,re=i=>je(hu,i),rr=i=>je(du,i),pa=(i,t)=>{const{activeInputs:e}=re(i);e.forEach(n=>n.forEach(([r])=>{t.includes(i)||pa(r,[...t,i])}));const s=q0(i)?[i.playbackRate]:_u(i)?Array.from(i.parameters.values()):W0(i)?[i.Q,i.detune,i.frequency,i.gain]:H0(i)?[i.offset]:Y0(i)?[i.gain]:G0(i)?[i.detune,i.frequency]:$0(i)?[i.pan]:[];for(const n of s){const r=rr(n);r!==void 0&&r.activeInputs.forEach(([o])=>pa(o,t))}ds(i)&&ir(i)},yu=i=>{pa(i.destination,[])},X0=i=>i===void 0||typeof i=="number"||typeof i=="string"&&(i==="balanced"||i==="interactive"||i==="playback"),Z0=(i,t,e,s,n,r,o,a,c)=>class extends i{constructor(u={}){if(c===null)throw new Error("Missing the native AudioContext constructor.");let h;try{h=new c(u)}catch(_){throw _.code===12&&_.message==="sampleRate is not in range"?e():_}if(h===null)throw s();if(!X0(u.latencyHint))throw new TypeError(`The provided value '${u.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(u.sampleRate!==void 0&&h.sampleRate!==u.sampleRate)throw e();super(h,2);const{latencyHint:d}=u,{sampleRate:f}=h;if(this._baseLatency=typeof h.baseLatency=="number"?h.baseLatency:d==="balanced"?512/f:d==="interactive"||d===void 0?256/f:d==="playback"?1024/f:Math.max(2,Math.min(128,Math.round(d*f/128)))*128/f,this._nativeAudioContext=h,c.name==="webkitAudioContext"?(this._nativeGainNode=h.createGain(),this._nativeOscillatorNode=h.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(h.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,h.state==="running"){this._state="suspended";const _=()=>{this._state==="suspended"&&(this._state=null),h.removeEventListener("statechange",_)};h.addEventListener("statechange",_)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw t()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),yu(this)}))}createMediaElementSource(u){return new n(this,{mediaElement:u})}createMediaStreamDestination(){return new r(this)}createMediaStreamSource(u){return new o(this,{mediaStream:u})}createMediaStreamTrackSource(u){return new a(this,{mediaStreamTrack:u})}resume(){return this._state==="suspended"?new Promise((u,h)=>{const d=()=>{this._nativeAudioContext.removeEventListener("statechange",d),this._nativeAudioContext.state==="running"?u():this.resume().then(u,h)};this._nativeAudioContext.addEventListener("statechange",d)}):this._nativeAudioContext.resume().catch(u=>{throw u===void 0||u.code===15?t():u})}suspend(){return this._nativeAudioContext.suspend().catch(u=>{throw u===void 0?t():u})}},Q0=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d=o(h),f=n(h,u,d),_=d?t(a):null;super(l,!1,f,_),this._isNodeOfNativeOfflineAudioContext=d,this._nativeAudioDestinationNode=f}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(l>this._nativeAudioDestinationNode.maxChannelCount)throw e();this._nativeAudioDestinationNode.channelCount=l}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=l}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},K0=i=>{const t=new WeakMap,e=async(s,n)=>{const r=n.destination;return t.set(n,r),await i(s,n,r),r};return{render(s,n){const r=t.get(n);return r!==void 0?Promise.resolve(r):e(s,n)}}},J0=(i,t,e,s,n,r,o,a)=>(c,l)=>{const u=l.listener,h=()=>{const g=new Float32Array(1),T=t(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),x=o(l);let k=!1,C=[0,0,-1,0,1,0],M=[0,0,0];const R=()=>{if(k)return;k=!0;const G=s(l,256,9,0);G.onaudioprocess=({inputBuffer:Y})=>{const j=[r(Y,g,0),r(Y,g,1),r(Y,g,2),r(Y,g,3),r(Y,g,4),r(Y,g,5)];j.some((X,Q)=>X!==C[Q])&&(u.setOrientation(...j),C=j);const z=[r(Y,g,6),r(Y,g,7),r(Y,g,8)];z.some((X,Q)=>X!==M[Q])&&(u.setPosition(...z),M=z)},T.connect(G)},P=G=>Y=>{Y!==C[G]&&(C[G]=Y,u.setOrientation(...C))},U=G=>Y=>{Y!==M[G]&&(M[G]=Y,u.setPosition(...M))},W=(G,Y,j)=>{const z=e(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Y});z.connect(T,0,G),z.start(),Object.defineProperty(z.offset,"defaultValue",{get(){return Y}});const X=i({context:c},x,z.offset,ne,le);return a(X,"value",Q=>()=>Q.call(X),Q=>et=>{try{Q.call(X,et)}catch(I){if(I.code!==9)throw I}R(),x&&j(et)}),X.cancelAndHoldAtTime=(Q=>x?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.cancelAndHoldAtTime),X.cancelScheduledValues=(Q=>x?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.cancelScheduledValues),X.exponentialRampToValueAtTime=(Q=>x?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.exponentialRampToValueAtTime),X.linearRampToValueAtTime=(Q=>x?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.linearRampToValueAtTime),X.setTargetAtTime=(Q=>x?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.setTargetAtTime),X.setValueAtTime=(Q=>x?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.setValueAtTime),X.setValueCurveAtTime=(Q=>x?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.setValueCurveAtTime),X};return{forwardX:W(0,0,P(0)),forwardY:W(1,0,P(1)),forwardZ:W(2,-1,P(2)),positionX:W(6,0,U(0)),positionY:W(7,0,U(1)),positionZ:W(8,0,U(2)),upX:W(3,0,P(3)),upY:W(4,1,P(4)),upZ:W(5,0,P(5))}},{forwardX:d,forwardY:f,forwardZ:_,positionX:p,positionY:m,positionZ:y,upX:w,upY:b,upZ:v}=u.forwardX===void 0?h():u;return{get forwardX(){return d},get forwardY(){return f},get forwardZ(){return _},get positionX(){return p},get positionY(){return m},get positionZ(){return y},get upX(){return w},get upY(){return b},get upZ(){return v}}},zr=i=>"context"in i,or=i=>zr(i[0]),fn=(i,t,e,s)=>{for(const n of i)if(e(n)){if(s)return!1;throw Error("The set contains at least one similar element.")}return i.add(t),!0},hl=(i,t,[e,s],n)=>{fn(i,[t,e,s],r=>r[0]===t&&r[1]===e,n)},dl=(i,[t,e,s],n)=>{const r=i.get(t);r===void 0?i.set(t,new Set([[e,s]])):fn(r,[e,s],o=>o[0]===e,n)},Xn=i=>"inputs"in i,jr=(i,t,e,s)=>{if(Xn(t)){const n=t.inputs[s];return i.connect(n,e,0),[n,e,0]}return i.connect(t,e,s),[t,e,s]},vu=(i,t,e)=>{for(const s of i)if(s[0]===t&&s[1]===e)return i.delete(s),s;return null},tp=(i,t,e)=>vo(i,s=>s[0]===t&&s[1]===e),ku=(i,t)=>{if(!nr(i).delete(t))throw new Error("Missing the expected event listener.")},xu=(i,t,e)=>{const s=je(i,t),n=vo(s,r=>r[0]===e);return s.size===0&&i.delete(t),n},Br=(i,t,e,s)=>{Xn(t)?i.disconnect(t.inputs[s],e,0):i.disconnect(t,e,s)},Dt=i=>je(Fa,i),Ei=i=>je(La,i),on=i=>ua.has(i),Pr=i=>!Ln.has(i),fl=(i,t)=>new Promise(e=>{if(t!==null)e(!0);else{const s=i.createScriptProcessor(256,1,1),n=i.createGain(),r=i.createBuffer(1,2,44100),o=r.getChannelData(0);o[0]=1,o[1]=1;const a=i.createBufferSource();a.buffer=r,a.loop=!0,a.connect(s).connect(i.destination),a.connect(n),a.disconnect(n),s.onaudioprocess=c=>{const l=c.inputBuffer.getChannelData(0);Array.prototype.some.call(l,u=>u===1)?e(!0):e(!1),a.stop(),s.onaudioprocess=null,a.disconnect(s),s.disconnect(i.destination)},a.start()}}),Yo=(i,t)=>{const e=new Map;for(const s of i)for(const n of s){const r=e.get(n);e.set(n,r===void 0?1:r+1)}e.forEach((s,n)=>t(n,s))},qr=i=>"context"in i,ep=i=>{const t=new Map;i.connect=(e=>(s,n=0,r=0)=>{const o=qr(s)?e(s,n,r):e(s,n),a=t.get(s);return a===void 0?t.set(s,[{input:r,output:n}]):a.every(c=>c.input!==r||c.output!==n)&&a.push({input:r,output:n}),o})(i.connect.bind(i)),i.disconnect=(e=>(s,n,r)=>{if(e.apply(i),s===void 0)t.clear();else if(typeof s=="number")for(const[o,a]of t){const c=a.filter(l=>l.output!==s);c.length===0?t.delete(o):t.set(o,c)}else if(t.has(s))if(n===void 0)t.delete(s);else{const o=t.get(s);if(o!==void 0){const a=o.filter(c=>c.output!==n&&(c.input!==r||r===void 0));a.length===0?t.delete(s):t.set(s,a)}}for(const[o,a]of t)a.forEach(c=>{qr(o)?i.connect(o,c.output,c.input):i.connect(o,c.output)})})(i.disconnect)},sp=(i,t,e,s)=>{const{activeInputs:n,passiveInputs:r}=rr(t),{outputs:o}=re(i),a=nr(i),c=l=>{const u=Dt(i),h=Ei(t);if(l){const d=xu(r,i,e);hl(n,i,d,!1),!s&&!on(i)&&u.connect(h,e)}else{const d=tp(n,i,e);dl(r,d,!1),!s&&!on(i)&&u.disconnect(h,e)}};return fn(o,[t,e],l=>l[0]===t&&l[1]===e,!0)?(a.add(c),ds(i)?hl(n,i,[e,c],!0):dl(r,[i,e,c],!0),!0):!1},np=(i,t,e,s)=>{const{activeInputs:n,passiveInputs:r}=re(t),o=vu(n[s],i,e);return o===null?[mu(r,i,e,s)[2],!1]:[o[2],!0]},ip=(i,t,e)=>{const{activeInputs:s,passiveInputs:n}=rr(t),r=vu(s,i,e);return r===null?[xu(n,i,e)[1],!1]:[r[2],!0]},Ua=(i,t,e,s,n)=>{const[r,o]=np(i,e,s,n);if(r!==null&&(ku(i,r),o&&!t&&!on(i)&&Br(Dt(i),Dt(e),s,n)),ds(e)){const{activeInputs:a}=re(e);fa(e,a)}},za=(i,t,e,s)=>{const[n,r]=ip(i,e,s);n!==null&&(ku(i,n),r&&!t&&!on(i)&&Dt(i).disconnect(Ei(e),s))},rp=(i,t)=>{const e=re(i),s=[];for(const n of e.outputs)or(n)?Ua(i,t,...n):za(i,t,...n),s.push(n[0]);return e.outputs.clear(),s},op=(i,t,e)=>{const s=re(i),n=[];for(const r of s.outputs)r[1]===e&&(or(r)?Ua(i,t,...r):za(i,t,...r),n.push(r[0]),s.outputs.delete(r));return n},ap=(i,t,e,s,n)=>{const r=re(i);return Array.from(r.outputs).filter(o=>o[0]===e&&(s===void 0||o[1]===s)&&(n===void 0||o[2]===n)).map(o=>(or(o)?Ua(i,t,...o):za(i,t,...o),r.outputs.delete(o),o[0]))},cp=(i,t,e,s,n,r,o,a,c,l,u,h,d,f,_,p)=>class extends l{constructor(y,w,b,v){super(b),this._context=y,this._nativeAudioNode=b;const g=u(y);h(g)&&e(fl,()=>fl(g,p))!==!0&&ep(b),Fa.set(this,b),fu.set(this,new Set),y.state!=="closed"&&w&&Vn(this),i(this,v,b)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(y){this._nativeAudioNode.channelCount=y}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(y){this._nativeAudioNode.channelCountMode=y}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(y){this._nativeAudioNode.channelInterpretation=y}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(y,w=0,b=0){if(w<0||w>=this._nativeAudioNode.numberOfOutputs)throw n();const v=u(this._context),g=_(v);if(d(y)||f(y))throw r();if(zr(y)){const k=Dt(y);try{const M=jr(this._nativeAudioNode,k,w,b),R=Pr(this);(g||R)&&this._nativeAudioNode.disconnect(...M),this.context.state!=="closed"&&!R&&Pr(y)&&Vn(y)}catch(M){throw M.code===12?r():M}if(t(this,y,w,b,g)){const M=c([this],y);Yo(M,s(g))}return y}const T=Ei(y);if(T.name==="playbackRate"&&T.maxValue===1024)throw o();try{this._nativeAudioNode.connect(T,w),(g||Pr(this))&&this._nativeAudioNode.disconnect(T,w)}catch(k){throw k.code===12?r():k}if(sp(this,y,w,g)){const k=c([this],y);Yo(k,s(g))}}disconnect(y,w,b){let v;const g=u(this._context),T=_(g);if(y===void 0)v=rp(this,T);else if(typeof y=="number"){if(y<0||y>=this.numberOfOutputs)throw n();v=op(this,T,y)}else{if(w!==void 0&&(w<0||w>=this.numberOfOutputs)||zr(y)&&b!==void 0&&(b<0||b>=y.numberOfInputs))throw n();if(v=ap(this,T,y,w,b),v.length===0)throw r()}for(const x of v){const k=c([this],x);Yo(k,a)}}},lp=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>(f,_,p,m=null,y=null)=>{const w=p.value,b=new v0(w),v=_?s(b):null,g={get defaultValue(){return w},get maxValue(){return m===null?p.maxValue:m},get minValue(){return y===null?p.minValue:y},get value(){return p.value},set value(T){p.value=T,g.setValueAtTime(T,f.context.currentTime)},cancelAndHoldAtTime(T){if(typeof p.cancelAndHoldAtTime=="function")v===null&&b.flush(f.context.currentTime),b.add(n(T)),p.cancelAndHoldAtTime(T);else{const x=Array.from(b).pop();v===null&&b.flush(f.context.currentTime),b.add(n(T));const k=Array.from(b).pop();p.cancelScheduledValues(T),x!==k&&k!==void 0&&(k.type==="exponentialRampToValue"?p.exponentialRampToValueAtTime(k.value,k.endTime):k.type==="linearRampToValue"?p.linearRampToValueAtTime(k.value,k.endTime):k.type==="setValue"?p.setValueAtTime(k.value,k.startTime):k.type==="setValueCurve"&&p.setValueCurveAtTime(k.values,k.startTime,k.duration))}return g},cancelScheduledValues(T){return v===null&&b.flush(f.context.currentTime),b.add(r(T)),p.cancelScheduledValues(T),g},exponentialRampToValueAtTime(T,x){if(T===0)throw new RangeError;if(!Number.isFinite(x)||x<0)throw new RangeError;const k=f.context.currentTime;return v===null&&b.flush(k),Array.from(b).length===0&&(b.add(l(w,k)),p.setValueAtTime(w,k)),b.add(o(T,x)),p.exponentialRampToValueAtTime(T,x),g},linearRampToValueAtTime(T,x){const k=f.context.currentTime;return v===null&&b.flush(k),Array.from(b).length===0&&(b.add(l(w,k)),p.setValueAtTime(w,k)),b.add(a(T,x)),p.linearRampToValueAtTime(T,x),g},setTargetAtTime(T,x,k){return v===null&&b.flush(f.context.currentTime),b.add(c(T,x,k)),p.setTargetAtTime(T,x,k),g},setValueAtTime(T,x){return v===null&&b.flush(f.context.currentTime),b.add(l(T,x)),p.setValueAtTime(T,x),g},setValueCurveAtTime(T,x,k){const C=T instanceof Float32Array?T:new Float32Array(T);if(h!==null&&h.name==="webkitAudioContext"){const M=x+k,R=f.context.sampleRate,P=Math.ceil(x*R),U=Math.floor(M*R),W=U-P,G=new Float32Array(W);for(let j=0;j({replay(t){for(const e of i)if(e.type==="exponentialRampToValue"){const{endTime:s,value:n}=e;t.exponentialRampToValueAtTime(n,s)}else if(e.type==="linearRampToValue"){const{endTime:s,value:n}=e;t.linearRampToValueAtTime(n,s)}else if(e.type==="setTarget"){const{startTime:s,target:n,timeConstant:r}=e;t.setTargetAtTime(n,s,r)}else if(e.type==="setValue"){const{startTime:s,value:n}=e;t.setValueAtTime(n,s)}else if(e.type==="setValueCurve"){const{duration:s,startTime:n,values:r}=e;t.setValueCurveAtTime(r,n,s)}else throw new Error("Can't apply an unknown automation.")}});class Tu{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(t,e=null){return this._map.forEach((s,n)=>t.call(e,s,n,this))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}const hp={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},dp=(i,t,e,s,n,r,o,a,c,l,u,h,d,f)=>class extends t{constructor(p,m,y){var w;const b=a(p),v=c(b),g=u({...hp,...y});d(g);const T=ha.get(b),x=T==null?void 0:T.get(m),k=v||b.state!=="closed"?b:(w=o(b))!==null&&w!==void 0?w:b,C=n(k,v?null:p.baseLatency,l,m,x,g),M=v?s(m,g,x):null;super(p,!0,C,M);const R=[];C.parameters.forEach((U,W)=>{const G=e(this,v,U);R.push([W,G])}),this._nativeAudioWorkletNode=C,this._onprocessorerror=null,this._parameters=new Tu(R),v&&i(b,this);const{activeInputs:P}=r(this);h(C,P)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(p){const m=typeof p=="function"?f(this,p):null;this._nativeAudioWorkletNode.onprocessorerror=m;const y=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=y!==null&&y===m?p:y}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function Wr(i,t,e,s,n){if(typeof i.copyFromChannel=="function")t[e].byteLength===0&&(t[e]=new Float32Array(128)),i.copyFromChannel(t[e],s,n);else{const r=i.getChannelData(s);if(t[e].byteLength===0)t[e]=r.slice(n,n+128);else{const o=new Float32Array(r.buffer,n*Float32Array.BYTES_PER_ELEMENT,128);t[e].set(o)}}}const wu=(i,t,e,s,n)=>{typeof i.copyToChannel=="function"?t[e].byteLength!==0&&i.copyToChannel(t[e],s,n):t[e].byteLength!==0&&i.getChannelData(s).set(t[e],n)},Hr=(i,t)=>{const e=[];for(let s=0;s{const e=je(da,i),s=Dt(t);return je(e,s)},pp=async(i,t,e,s,n,r,o)=>{const a=t===null?Math.ceil(i.context.length/128)*128:t.length,c=s.channelCount*s.numberOfInputs,l=n.reduce((m,y)=>m+y,0),u=l===0?null:e.createBuffer(l,a,e.sampleRate);if(r===void 0)throw new Error("Missing the processor constructor.");const h=re(i),d=await fp(e,i),f=Hr(s.numberOfInputs,s.channelCount),_=Hr(s.numberOfOutputs,n),p=Array.from(i.parameters.keys()).reduce((m,y)=>({...m,[y]:new Float32Array(128)}),{});for(let m=0;m0&&t!==null)for(let y=0;y{Wr(t,p,y,c+w,m)});for(let y=0;yh.activeInputs[v].size===0?[]:b),w=o(m/e.sampleRate,e.sampleRate,()=>d.process(y,_,p));if(u!==null)for(let b=0,v=0;b(m,y,w)=>{const b=new WeakMap;let v=null;const g=async(T,x)=>{let k=u(T),C=null;const M=se(k,x),R=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(h===null){const P=R.reduce((Y,j)=>Y+j,0),U=n(x,{channelCount:Math.max(1,P),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,P)}),W=[];for(let Y=0;Y{const et=new d(X,Math.ceil(T.context.length/128)*128,x.sampleRate),I=[],F=[];for(let H=0;H{const N=r(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:H.value});return await f(et,H,N.offset),N})),D=s(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,j+z)});for(let H=0;H_(T,et,H))),p(et)})(),x,y,R,w,l)}const P=await v,U=e(x,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[W,G,Y]=C;P!==null&&(U.buffer=P,U.start(0)),U.connect(W);for(let j=0,z=0;jclass extends _{constructor(g,T){super(g,T),this._nativeContext=g,this._audioWorklet=i===void 0?void 0:{addModule:(x,k)=>i(this,x,k)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new n(this)}createBuffer(g,T,x){return new e({length:T,numberOfChannels:g,sampleRate:x})}createBufferSource(){return new s(this)}createChannelMerger(g=6){return new r(this,{numberOfInputs:g})}createChannelSplitter(g=6){return new o(this,{numberOfOutputs:g})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(g=1){return new u(this,{maxDelayTime:g})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(g,T){return new f(this,{feedback:T,feedforward:g})}createOscillator(){return new p(this)}createPanner(){return new m(this)}createPeriodicWave(g,T,x={disableNormalization:!1}){return new y(this,{...x,imag:T,real:g})}createStereoPanner(){return new w(this)}createWaveShaper(){return new b(this)}decodeAudioData(g,T,x){return l(this._nativeContext,g).then(k=>(typeof T=="function"&&T(k),k),k=>{throw typeof x=="function"&&x(k),k})}},gp={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},yp=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...gp,...u},f=n(h,d),_=o(h),p=_?e():null;super(l,!1,f,p),this._Q=t(this,_,f.Q,ne,le),this._detune=t(this,_,f.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,_,f.frequency,l.sampleRate/2,0),this._gain=t(this,_,f.gain,40*Math.log10(ne),le),this._nativeBiquadFilterNode=f,a(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(l){this._nativeBiquadFilterNode.type=l}getFrequencyResponse(l,u,h){try{this._nativeBiquadFilterNode.getFrequencyResponse(l,u,h)}catch(d){throw d.code===11?s():d}if(l.length!==u.length||u.length!==h.length)throw s()}},vp=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(c,h)}return r.set(c,l),u?(await i(c,a.Q,l.Q),await i(c,a.detune,l.detune),await i(c,a.frequency,l.frequency),await i(c,a.gain,l.gain)):(await s(c,a.Q,l.Q),await s(c,a.detune,l.detune),await s(c,a.frequency,l.frequency),await s(c,a.gain,l.gain)),await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},kp=(i,t)=>(e,s)=>{const n=t.get(e);if(n!==void 0)return n;const r=i.get(e);if(r!==void 0)return r;try{const o=s();return o instanceof Promise?(i.set(e,o),o.catch(()=>!1).then(a=>(i.delete(e),t.set(e,a),a))):(t.set(e,o),o)}catch{return t.set(e,!1),!1}},xp={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},Tp=(i,t,e,s,n)=>class extends i{constructor(o,a){const c=s(o),l={...xp,...a},u=e(c,l),h=n(c)?t():null;super(o,!1,u,h)}},wp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},bp={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},Cp=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u=r({...bp,...c}),h=e(l,u),d=n(l)?t():null;super(a,!1,h,d)}},Sp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Ep=i=>(t,e,s)=>i(e,t,s),Op=i=>(t,e,s=0,n=0)=>{const r=t[s];if(r===void 0)throw i();return qr(e)?r.connect(e,0,n):r.connect(e,0)},Ap=i=>(t,e)=>{const s=i(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),n=t.createBuffer(1,2,44100);return s.buffer=n,s.loop=!0,s.connect(e),s.start(),()=>{s.stop(),s.disconnect(e)}},Mp={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},Dp=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...Mp,...l},d=s(u,h),f=r(u),_=f?e():null;super(c,!1,d,_),this._constantSourceNodeRenderer=_,this._nativeConstantSourceNode=d,this._offset=t(this,f,d.offset,ne,le),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(c){const l=typeof c=="function"?o(this,c):null;this._nativeConstantSourceNode.onended=l;const u=this._nativeConstantSourceNode.onended;this._onended=u!==null&&u===l?c:u}start(c=0){if(this._nativeConstantSourceNode.start(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=c),this.context.state!=="closed"){Vn(this);const l=()=>{this._nativeConstantSourceNode.removeEventListener("ended",l),ds(this)&&ir(this)};this._nativeConstantSourceNode.addEventListener("ended",l)}}stop(c=0){this._nativeConstantSourceNode.stop(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=c)}},Pp=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=e(l);const d=se(h,u);if(!d){const f={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,offset:h.offset.value};h=t(u,f),o!==null&&h.start(o),a!==null&&h.stop(a)}return r.set(u,h),d?await i(u,l.offset,h.offset):await s(u,l.offset,h.offset),await n(l,u,h),h};return{set start(l){o=l},set stop(l){a=l},render(l,u){const h=r.get(u);return h!==void 0?Promise.resolve(h):c(l,u)}}},Np=i=>t=>(i[0]=t,i[0]),Ip={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},Rp=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u={...Ip,...c},h=e(l,u),f=n(l)?t():null;super(a,!1,h,f),this._isBufferNullified=!1,this._nativeConvolverNode=h,u.buffer!==null&&r(this,u.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(a){if(this._nativeConvolverNode.buffer=a,a===null&&this._nativeConvolverNode.buffer!==null){const c=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=c.createBuffer(1,1,c.sampleRate),this._isBufferNullified=!0,r(this,0)}else this._isBufferNullified=!1,r(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(a){this._nativeConvolverNode.normalize=a}},Fp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=i(o,l)}return s.set(o,a),Xn(a)?await e(r,o,a.inputs[0]):await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Lp=(i,t)=>(e,s,n)=>{if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(e,s,n)}catch(r){throw r.name==="SyntaxError"?i():r}},Vp=()=>new DOMException("","DataCloneError"),pl=i=>{const{port1:t,port2:e}=new MessageChannel;return new Promise(s=>{const n=()=>{e.onmessage=null,t.close(),e.close(),s()};e.onmessage=()=>n();try{t.postMessage(i,[i])}catch{}finally{n()}})},Up=(i,t,e,s,n,r,o,a,c,l,u)=>(h,d)=>{const f=o(h)?h:r(h);if(n.has(d)){const _=e();return Promise.reject(_)}try{n.add(d)}catch{}return t(c,()=>c(f))?f.decodeAudioData(d).then(_=>(pl(d).catch(()=>{}),t(a,()=>a(_))||u(_),i.add(_),_)):new Promise((_,p)=>{const m=async()=>{try{await pl(d)}catch{}},y=w=>{p(w),m()};try{f.decodeAudioData(d,w=>{typeof w.copyFromChannel!="function"&&(l(w),Va(w)),i.add(w),m().then(()=>_(w))},w=>{y(w===null?s():w)})}catch(w){y(w)}})},zp=(i,t,e,s,n,r,o,a)=>(c,l)=>{const u=t.get(c);if(u===void 0)throw new Error("Missing the expected cycle count.");const h=r(c.context),d=a(h);if(u===l){if(t.delete(c),!d&&o(c)){const f=s(c),{outputs:_}=e(c);for(const p of _)if(or(p)){const m=s(p[0]);i(f,m,p[1],p[2])}else{const m=n(p[0]);f.connect(m,p[1])}}}else t.set(c,u-l)},jp={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},Bp=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...jp,...l},d=s(u,h),f=r(u),_=f?e(h.maxDelayTime):null;super(c,!1,d,_),this._delayTime=t(this,f,d.delayTime),o(this,h.maxDelayTime)}get delayTime(){return this._delayTime}},qp=(i,t,e,s,n)=>r=>{const o=new WeakMap,a=async(c,l)=>{let u=e(c);const h=se(u,l);if(!h){const d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:r};u=t(l,d)}return o.set(l,u),h?await i(l,c.delayTime,u.delayTime):await s(l,c.delayTime,u.delayTime),await n(c,l,u),u};return{render(c,l){const u=o.get(l);return u!==void 0?Promise.resolve(u):a(c,l)}}},Wp=i=>(t,e,s,n)=>i(t[n],r=>r[0]===e&&r[1]===s),Hp=i=>(t,e)=>{i(t).delete(e)},Yp=i=>"delayTime"in i,Gp=(i,t,e)=>function s(n,r){const o=zr(r)?r:e(i,r);if(Yp(o))return[];if(n[0]===o)return[n];if(n.includes(o))return[];const{outputs:a}=t(o);return Array.from(a).map(c=>s([...n,o],c[0])).reduce((c,l)=>c.concat(l),[])},br=(i,t,e)=>{const s=t[e];if(s===void 0)throw i();return s},$p=i=>(t,e=void 0,s=void 0,n=0)=>e===void 0?t.forEach(r=>r.disconnect()):typeof e=="number"?br(i,t,e).disconnect():qr(e)?s===void 0?t.forEach(r=>r.disconnect(e)):n===void 0?br(i,t,s).disconnect(e,0):br(i,t,s).disconnect(e,0,n):s===void 0?t.forEach(r=>r.disconnect(e)):br(i,t,s).disconnect(e,0),Xp={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Zp=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...Xp,...u},f=s(h,d),_=o(h),p=_?e():null;super(l,!1,f,p),this._attack=t(this,_,f.attack),this._knee=t(this,_,f.knee),this._nativeDynamicsCompressorNode=f,this._ratio=t(this,_,f.ratio),this._release=t(this,_,f.release),this._threshold=t(this,_,f.threshold),a(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(l){const u=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=l,l>2)throw this._nativeDynamicsCompressorNode.channelCount=u,n()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(l){const u=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=l,l==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=u,n()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return typeof this._nativeDynamicsCompressorNode.reduction.value=="number"?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},Qp=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(c,h)}return r.set(c,l),u?(await i(c,a.attack,l.attack),await i(c,a.knee,l.knee),await i(c,a.ratio,l.ratio),await i(c,a.release,l.release),await i(c,a.threshold,l.threshold)):(await s(c,a.attack,l.attack),await s(c,a.knee,l.knee),await s(c,a.ratio,l.ratio),await s(c,a.release,l.release),await s(c,a.threshold,l.threshold)),await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Kp=()=>new DOMException("","EncodingError"),Jp=i=>t=>new Promise((e,s)=>{if(i===null){s(new SyntaxError);return}const n=i.document.head;if(n===null)s(new SyntaxError);else{const r=i.document.createElement("script"),o=new Blob([t],{type:"application/javascript"}),a=URL.createObjectURL(o),c=i.onerror,l=()=>{i.onerror=c,URL.revokeObjectURL(a)};i.onerror=(u,h,d,f,_)=>{if(h===a||h===i.location.href&&d===1&&f===1)return l(),s(_),!1;if(c!==null)return c(u,h,d,f,_)},r.onerror=()=>{l(),s(new SyntaxError)},r.onload=()=>{l(),e()},r.src=a,r.type="module",n.appendChild(r)}}),tm=i=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(e,s,n){if(s!==null){let r=this._listeners.get(s);r===void 0&&(r=i(this,s),typeof s=="function"&&this._listeners.set(s,r)),this._nativeEventTarget.addEventListener(e,r,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,s,n){const r=s===null?void 0:this._listeners.get(s);this._nativeEventTarget.removeEventListener(e,r===void 0?null:r,n)}},em=i=>(t,e,s)=>{Object.defineProperties(i,{currentFrame:{configurable:!0,get(){return Math.round(t*e)}},currentTime:{configurable:!0,get(){return t}}});try{return s()}finally{i!==null&&(delete i.currentFrame,delete i.currentTime)}},sm=i=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw i()},nm={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},im=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...nm,...c},h=s(l,u),d=r(l),f=d?e():null;super(a,!1,h,f),this._gain=t(this,d,h.gain,ne,le)}get gain(){return this._gain}},rm=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(c,h)}return r.set(c,l),u?await i(c,a.gain,l.gain):await s(c,a.gain,l.gain),await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},om=(i,t)=>e=>t(i,e),am=i=>t=>{const e=i(t);if(e.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return e.renderer},cm=i=>t=>{var e;return(e=i.get(t))!==null&&e!==void 0?e:0},lm=i=>t=>{const e=i(t);if(e.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return e.renderer},um=i=>t=>i.get(t),Xt=()=>new DOMException("","InvalidStateError"),hm=i=>t=>{const e=i.get(t);if(e===void 0)throw Xt();return e},dm=(i,t)=>e=>{let s=i.get(e);if(s!==void 0)return s;if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new t(1,1,44100),i.set(e,s),s},fm=i=>t=>{const e=i.get(t);if(e===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return e},ko=()=>new DOMException("","InvalidAccessError"),pm=i=>{i.getFrequencyResponse=(t=>(e,s,n)=>{if(e.length!==s.length||s.length!==n.length)throw ko();return t.call(i,e,s,n)})(i.getFrequencyResponse)},mm={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},_m=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u=n(l),h={...mm,...c},d=t(l,u?null:a.baseLatency,h),f=u?e(h.feedback,h.feedforward):null;super(a,!1,d,f),pm(d),this._nativeIIRFilterNode=d,r(this,1)}getFrequencyResponse(a,c,l){return this._nativeIIRFilterNode.getFrequencyResponse(a,c,l)}},bu=(i,t,e,s,n,r,o,a,c,l,u)=>{const h=l.length;let d=a;for(let f=0;f{const n=e instanceof Float64Array?e:new Float64Array(e),r=s instanceof Float64Array?s:new Float64Array(s),o=n.length,a=r.length,c=Math.min(o,a);if(n[0]!==1){for(let _=0;_(r,o)=>{const a=new WeakMap;let c=null;const l=async(u,h)=>{let d=null,f=t(u);const _=se(f,h);if(h.createIIRFilter===void 0?d=i(h,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):_||(f=h.createIIRFilter(o,r)),a.set(h,d===null?f:d),d!==null){if(c===null){if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");const m=new e(u.context.destination.channelCount,u.context.length,h.sampleRate);c=(async()=>{await s(u,m,m.destination);const y=await n(m);return gm(y,h,r,o)})()}const p=await c;return d.buffer=p,d.start(0),d}return await s(u,h,f),f};return{render(u,h){const d=a.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},vm=(i,t,e,s,n,r)=>o=>(a,c)=>{const l=i.get(a);if(l===void 0){if(!o&&r(a)){const u=s(a),{outputs:h}=e(a);for(const d of h)if(or(d)){const f=s(d[0]);t(u,f,d[1],d[2])}else{const f=n(d[0]);u.disconnect(f,d[1])}}i.set(a,c)}else i.set(a,l+c)},km=(i,t)=>e=>{const s=i.get(e);return t(s)||t(e)},xm=(i,t)=>e=>i.has(e)||t(e),Tm=(i,t)=>e=>i.has(e)||t(e),wm=(i,t)=>e=>{const s=i.get(e);return t(s)||t(e)},bm=i=>t=>i!==null&&t instanceof i,Cm=i=>t=>i!==null&&typeof i.AudioNode=="function"&&t instanceof i.AudioNode,Sm=i=>t=>i!==null&&typeof i.AudioParam=="function"&&t instanceof i.AudioParam,Em=(i,t)=>e=>i(e)||t(e),Om=i=>t=>i!==null&&t instanceof i,Am=i=>i!==null&&i.isSecureContext,Mm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r),c=t(a,o);if(s(a))throw TypeError();super(r,!0,c,null),this._nativeMediaElementAudioSourceNode=c}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},Dm={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},Pm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r);if(s(a))throw new TypeError;const c={...Dm,...o},l=t(a,c);super(r,!1,l,null),this._nativeMediaStreamAudioDestinationNode=l}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},Nm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r),c=t(a,o);if(s(a))throw new TypeError;super(r,!0,c,null),this._nativeMediaStreamAudioSourceNode=c}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},Im=(i,t,e)=>class extends i{constructor(n,r){const o=e(n),a=t(o,r);super(n,!0,a,null)}},Rm=(i,t,e,s,n,r)=>class extends e{constructor(a,c){super(a),this._nativeContext=a,yo.set(this,a),s(a)&&n.set(a,new Set),this._destination=new i(this,c),this._listener=t(this,a),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(a){const c=typeof a=="function"?r(this,a):null;this._nativeContext.onstatechange=c;const l=this._nativeContext.onstatechange;this._onstatechange=l!==null&&l===c?a:l}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},Oi=i=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const e=i.decodeAudioData(t.buffer,()=>{});return e===void 0?!1:(e.catch(()=>{}),!0)}catch{}return!1},Fm=(i,t)=>(e,s,n)=>{const r=new Set;return e.connect=(o=>(a,c=0,l=0)=>{const u=r.size===0;if(t(a))return o.call(e,a,c,l),i(r,[a,c,l],h=>h[0]===a&&h[1]===c&&h[2]===l,!0),u&&s(),a;o.call(e,a,c),i(r,[a,c],h=>h[0]===a&&h[1]===c,!0),u&&s()})(e.connect),e.disconnect=(o=>(a,c,l)=>{const u=r.size>0;if(a===void 0)o.apply(e),r.clear();else if(typeof a=="number"){o.call(e,a);for(const d of r)d[1]===a&&r.delete(d)}else{t(a)?o.call(e,a,c,l):o.call(e,a,c);for(const d of r)d[0]===a&&(c===void 0||d[1]===c)&&(l===void 0||d[2]===l)&&r.delete(d)}const h=r.size===0;u&&h&&n()})(e.disconnect),e},Pt=(i,t,e)=>{const s=t[e];s!==void 0&&s!==i[e]&&(i[e]=s)},Gt=(i,t)=>{Pt(i,t,"channelCount"),Pt(i,t,"channelCountMode"),Pt(i,t,"channelInterpretation")},ml=i=>typeof i.getFloatTimeDomainData=="function",Lm=i=>{i.getFloatTimeDomainData=t=>{const e=new Uint8Array(t.length);i.getByteTimeDomainData(e);const s=Math.max(e.length,i.fftSize);for(let n=0;n(e,s)=>{const n=e.createAnalyser();if(Gt(n,s),!(s.maxDecibels>s.minDecibels))throw t();return Pt(n,s,"fftSize"),Pt(n,s,"maxDecibels"),Pt(n,s,"minDecibels"),Pt(n,s,"smoothingTimeConstant"),i(ml,()=>ml(n))||Lm(n),n},Um=i=>i===null?null:i.hasOwnProperty("AudioBuffer")?i.AudioBuffer:null,Ft=(i,t,e)=>{const s=t[e];s!==void 0&&s!==i[e].value&&(i[e].value=s)},zm=i=>{i.start=(t=>{let e=!1;return(s=0,n=0,r)=>{if(e)throw Xt();t.call(i,s,n,r),e=!0}})(i.start)},ja=i=>{i.start=(t=>(e=0,s=0,n)=>{if(typeof n=="number"&&n<0||s<0||e<0)throw new RangeError("The parameters can't be negative.");t.call(i,e,s,n)})(i.start)},Ba=i=>{i.stop=(t=>(e=0)=>{if(e<0)throw new RangeError("The parameter can't be negative.");t.call(i,e)})(i.stop)},jm=(i,t,e,s,n,r,o,a,c,l,u)=>(h,d)=>{const f=h.createBufferSource();return Gt(f,d),Ft(f,d,"playbackRate"),Pt(f,d,"buffer"),Pt(f,d,"loop"),Pt(f,d,"loopEnd"),Pt(f,d,"loopStart"),t(e,()=>e(h))||zm(f),t(s,()=>s(h))||c(f),t(n,()=>n(h))||l(f,h),t(r,()=>r(h))||ja(f),t(o,()=>o(h))||u(f,h),t(a,()=>a(h))||Ba(f),i(h,f),f},Bm=i=>i===null?null:i.hasOwnProperty("AudioContext")?i.AudioContext:i.hasOwnProperty("webkitAudioContext")?i.webkitAudioContext:null,qm=(i,t)=>(e,s,n)=>{const r=e.destination;if(r.channelCount!==s)try{r.channelCount=s}catch{}n&&r.channelCountMode!=="explicit"&&(r.channelCountMode="explicit"),r.maxChannelCount===0&&Object.defineProperty(r,"maxChannelCount",{value:s});const o=i(e,{channelCount:s,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return t(o,"channelCount",a=>()=>a.call(o),a=>c=>{a.call(o,c);try{r.channelCount=c}catch(l){if(c>r.maxChannelCount)throw l}}),t(o,"channelCountMode",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelCountMode=c}),t(o,"channelInterpretation",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelInterpretation=c}),Object.defineProperty(o,"maxChannelCount",{get:()=>r.maxChannelCount}),o.connect(r),o},Wm=i=>i===null?null:i.hasOwnProperty("AudioWorkletNode")?i.AudioWorkletNode:null,Hm=i=>{const{port1:t}=new MessageChannel;try{t.postMessage(i)}finally{t.close()}},Ym=(i,t,e,s,n)=>(r,o,a,c,l,u)=>{if(a!==null)try{const h=new a(r,c,u),d=new Map;let f=null;if(Object.defineProperties(h,{channelCount:{get:()=>u.channelCount,set:()=>{throw i()}},channelCountMode:{get:()=>"explicit",set:()=>{throw i()}},onprocessorerror:{get:()=>f,set:_=>{typeof f=="function"&&h.removeEventListener("processorerror",f),f=typeof _=="function"?_:null,typeof f=="function"&&h.addEventListener("processorerror",f)}}}),h.addEventListener=(_=>(...p)=>{if(p[0]==="processorerror"){const m=typeof p[1]=="function"?p[1]:typeof p[1]=="object"&&p[1]!==null&&typeof p[1].handleEvent=="function"?p[1].handleEvent:null;if(m!==null){const y=d.get(p[1]);y!==void 0?p[1]=y:(p[1]=w=>{w.type==="error"?(Object.defineProperties(w,{type:{value:"processorerror"}}),m(w)):m(new ErrorEvent(p[0],{...w}))},d.set(m,p[1]))}}return _.call(h,"error",p[1],p[2]),_.call(h,...p)})(h.addEventListener),h.removeEventListener=(_=>(...p)=>{if(p[0]==="processorerror"){const m=d.get(p[1]);m!==void 0&&(d.delete(p[1]),p[1]=m)}return _.call(h,"error",p[1],p[2]),_.call(h,p[0],p[1],p[2])})(h.removeEventListener),u.numberOfOutputs!==0){const _=e(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return h.connect(_).connect(r.destination),n(h,()=>_.disconnect(),()=>_.connect(r.destination))}return h}catch(h){throw h.code===11?s():h}if(l===void 0)throw s();return Hm(u),t(r,o,l,u)},Cu=(i,t)=>i===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(i*t))))),Gm=i=>new Promise((t,e)=>{const{port1:s,port2:n}=new MessageChannel;s.onmessage=({data:r})=>{s.close(),n.close(),t(r)},s.onmessageerror=({data:r})=>{s.close(),n.close(),e(r)},n.postMessage(i)}),$m=async(i,t)=>{const e=await Gm(t);return new i(e)},Xm=(i,t,e,s)=>{let n=da.get(i);n===void 0&&(n=new WeakMap,da.set(i,n));const r=$m(e,s);return n.set(t,r),r},Zm=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>(f,_,p,m)=>{if(m.numberOfInputs===0&&m.numberOfOutputs===0)throw c();const y=Array.isArray(m.outputChannelCount)?m.outputChannelCount:Array.from(m.outputChannelCount);if(y.some(B=>B<1))throw c();if(y.length!==m.numberOfOutputs)throw t();if(m.channelCountMode!=="explicit")throw c();const w=m.channelCount*m.numberOfInputs,b=y.reduce((B,O)=>B+O,0),v=p.parameterDescriptors===void 0?0:p.parameterDescriptors.length;if(w+v>6||b>6)throw c();const g=new MessageChannel,T=[],x=[];for(let B=0;BB===void 0?0:B},maxValue:{get:()=>O===void 0?ne:O},minValue:{get:()=>E===void 0?le:E}}),k.push(tt)}const C=s(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,w+v)}),M=Cu(_,f.sampleRate),R=a(f,M,w+v,Math.max(1,b)),P=n(f,{channelCount:Math.max(1,b),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,b)}),U=[];for(let B=0;B{const E=k[O];return E.connect(C,0,w+O),E.start(0),[B,E.offset]}));C.connect(R);let G=m.channelInterpretation,Y=null;const j=m.numberOfOutputs===0?[R]:U,z={get bufferSize(){return M},get channelCount(){return m.channelCount},set channelCount(B){throw e()},get channelCountMode(){return m.channelCountMode},set channelCountMode(B){throw e()},get channelInterpretation(){return G},set channelInterpretation(B){for(const O of T)O.channelInterpretation=B;G=B},get context(){return R.context},get inputs(){return T},get numberOfInputs(){return m.numberOfInputs},get numberOfOutputs(){return m.numberOfOutputs},get onprocessorerror(){return Y},set onprocessorerror(B){typeof Y=="function"&&z.removeEventListener("processorerror",Y),Y=typeof B=="function"?B:null,typeof Y=="function"&&z.addEventListener("processorerror",Y)},get parameters(){return W},get port(){return g.port2},addEventListener(...B){return R.addEventListener(B[0],B[1],B[2])},connect:i.bind(null,j),disconnect:l.bind(null,j),dispatchEvent(...B){return R.dispatchEvent(B[0])},removeEventListener(...B){return R.removeEventListener(B[0],B[1],B[2])}},X=new Map;g.port1.addEventListener=(B=>(...O)=>{if(O[0]==="message"){const E=typeof O[1]=="function"?O[1]:typeof O[1]=="object"&&O[1]!==null&&typeof O[1].handleEvent=="function"?O[1].handleEvent:null;if(E!==null){const Z=X.get(O[1]);Z!==void 0?O[1]=Z:(O[1]=tt=>{u(f.currentTime,f.sampleRate,()=>E(tt))},X.set(E,O[1]))}}return B.call(g.port1,O[0],O[1],O[2])})(g.port1.addEventListener),g.port1.removeEventListener=(B=>(...O)=>{if(O[0]==="message"){const E=X.get(O[1]);E!==void 0&&(X.delete(O[1]),O[1]=E)}return B.call(g.port1,O[0],O[1],O[2])})(g.port1.removeEventListener);let Q=null;Object.defineProperty(g.port1,"onmessage",{get:()=>Q,set:B=>{typeof Q=="function"&&g.port1.removeEventListener("message",Q),Q=typeof B=="function"?B:null,typeof Q=="function"&&(g.port1.addEventListener("message",Q),g.port1.start())}}),p.prototype.port=g.port1;let et=null;Xm(f,z,p,m).then(B=>et=B);const F=Hr(m.numberOfInputs,m.channelCount),S=Hr(m.numberOfOutputs,y),D=p.parameterDescriptors===void 0?[]:p.parameterDescriptors.reduce((B,{name:O})=>({...B,[O]:new Float32Array(128)}),{});let H=!0;const N=()=>{m.numberOfOutputs>0&&R.disconnect(P);for(let B=0,O=0;B{if(et!==null){const E=h(z);for(let Z=0;Z{Wr(B,D,tt,w+lt,Z)});for(let tt=0;tt{if(E[Yt].size>0)return V.set(Yt,M/128),vt;const ti=V.get(Yt);return ti===void 0?[]:(vt.every(Io=>Io.every(fr=>fr===0))&&(ti===1?V.delete(Yt):V.set(Yt,ti-1)),vt)});H=u(f.currentTime+Z/f.sampleRate,f.sampleRate,()=>et.process(tt,S,D));for(let vt=0,Yt=0;vtR.connect(st).connect(f.destination),J=()=>{R.disconnect(st),st.disconnect()},pt=()=>{if(H){J(),m.numberOfOutputs>0&&R.connect(P);for(let B=0,O=0;B{H&&(nt(),N()),it=!1};return nt(),d(z,pt,K)},Su=(i,t)=>{const e=i.createBiquadFilter();return Gt(e,t),Ft(e,t,"Q"),Ft(e,t,"detune"),Ft(e,t,"frequency"),Ft(e,t,"gain"),Pt(e,t,"type"),e},Qm=(i,t)=>(e,s)=>{const n=e.createChannelMerger(s.numberOfInputs);return i!==null&&i.name==="webkitAudioContext"&&t(e,n),Gt(n,s),n},Km=i=>{const t=i.numberOfOutputs;Object.defineProperty(i,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Xt()}}),Object.defineProperty(i,"channelCountMode",{get:()=>"explicit",set:e=>{if(e!=="explicit")throw Xt()}}),Object.defineProperty(i,"channelInterpretation",{get:()=>"discrete",set:e=>{if(e!=="discrete")throw Xt()}})},ar=(i,t)=>{const e=i.createChannelSplitter(t.numberOfOutputs);return Gt(e,t),Km(e),e},Jm=(i,t,e,s,n)=>(r,o)=>{if(r.createConstantSource===void 0)return e(r,o);const a=r.createConstantSource();return Gt(a,o),Ft(a,o,"offset"),t(s,()=>s(r))||ja(a),t(n,()=>n(r))||Ba(a),i(r,a),a},Zn=(i,t)=>(i.connect=t.connect.bind(t),i.disconnect=t.disconnect.bind(t),i),t_=(i,t,e,s)=>(n,{offset:r,...o})=>{const a=n.createBuffer(1,2,44100),c=t(n,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=e(n,{...o,gain:r}),u=a.getChannelData(0);u[0]=1,u[1]=1,c.buffer=a,c.loop=!0;const h={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(_){l.channelCount=_},get channelCountMode(){return l.channelCountMode},set channelCountMode(_){l.channelCountMode=_},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(_){l.channelInterpretation=_},get context(){return l.context},get inputs(){return[]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return l.numberOfOutputs},get offset(){return l.gain},get onended(){return c.onended},set onended(_){c.onended=_},addEventListener(..._){return c.addEventListener(_[0],_[1],_[2])},dispatchEvent(..._){return c.dispatchEvent(_[0])},removeEventListener(..._){return c.removeEventListener(_[0],_[1],_[2])},start(_=0){c.start.call(c,_)},stop(_=0){c.stop.call(c,_)}},d=()=>c.connect(l),f=()=>c.disconnect(l);return i(n,c),s(Zn(h,l),d,f)},e_=(i,t)=>(e,s)=>{const n=e.createConvolver();if(Gt(n,s),s.disableNormalization===n.normalize&&(n.normalize=!s.disableNormalization),Pt(n,s,"buffer"),s.channelCount>2||(t(n,"channelCount",r=>()=>r.call(n),r=>o=>{if(o>2)throw i();return r.call(n,o)}),s.channelCountMode==="max"))throw i();return t(n,"channelCountMode",r=>()=>r.call(n),r=>o=>{if(o==="max")throw i();return r.call(n,o)}),n},Eu=(i,t)=>{const e=i.createDelay(t.maxDelayTime);return Gt(e,t),Ft(e,t,"delayTime"),e},s_=i=>(t,e)=>{const s=t.createDynamicsCompressor();if(Gt(s,e),e.channelCount>2||e.channelCountMode==="max")throw i();return Ft(s,e,"attack"),Ft(s,e,"knee"),Ft(s,e,"ratio"),Ft(s,e,"release"),Ft(s,e,"threshold"),s},me=(i,t)=>{const e=i.createGain();return Gt(e,t),Ft(e,t,"gain"),e},n_=i=>(t,e,s)=>{if(t.createIIRFilter===void 0)return i(t,e,s);const n=t.createIIRFilter(s.feedforward,s.feedback);return Gt(n,s),n};function i_(i,t){const e=t[0]*t[0]+t[1]*t[1];return[(i[0]*t[0]+i[1]*t[1])/e,(i[1]*t[0]-i[0]*t[1])/e]}function r_(i,t){return[i[0]*t[0]-i[1]*t[1],i[0]*t[1]+i[1]*t[0]]}function _l(i,t){let e=[0,0];for(let s=i.length-1;s>=0;s-=1)e=r_(e,t),e[0]+=i[s];return e}const o_=(i,t,e,s)=>(n,r,{channelCount:o,channelCountMode:a,channelInterpretation:c,feedback:l,feedforward:u})=>{const h=Cu(r,n.sampleRate),d=l instanceof Float64Array?l:new Float64Array(l),f=u instanceof Float64Array?u:new Float64Array(u),_=d.length,p=f.length,m=Math.min(_,p);if(_===0||_>20)throw s();if(d[0]===0)throw t();if(p===0||p>20)throw s();if(f[0]===0)throw t();if(d[0]!==1){for(let k=0;k{const C=k.inputBuffer,M=k.outputBuffer,R=C.numberOfChannels;for(let P=0;Pi.createMediaElementSource(t.mediaElement),c_=(i,t)=>{const e=i.createMediaStreamDestination();return Gt(e,t),e.numberOfOutputs===1&&Object.defineProperty(e,"numberOfOutputs",{get:()=>0}),e},l_=(i,{mediaStream:t})=>{const e=t.getAudioTracks();e.sort((r,o)=>r.ido.id?1:0);const s=e.slice(0,1),n=i.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(n,"mediaStream",{value:t}),n},u_=(i,t)=>(e,{mediaStreamTrack:s})=>{if(typeof e.createMediaStreamTrackSource=="function")return e.createMediaStreamTrackSource(s);const n=new MediaStream([s]),r=e.createMediaStreamSource(n);if(s.kind!=="audio")throw i();if(t(e))throw new TypeError;return r},h_=i=>i===null?null:i.hasOwnProperty("OfflineAudioContext")?i.OfflineAudioContext:i.hasOwnProperty("webkitOfflineAudioContext")?i.webkitOfflineAudioContext:null,d_=(i,t,e,s,n,r)=>(o,a)=>{const c=o.createOscillator();return Gt(c,a),Ft(c,a,"detune"),Ft(c,a,"frequency"),a.periodicWave!==void 0?c.setPeriodicWave(a.periodicWave):Pt(c,a,"type"),t(e,()=>e(o))||ja(c),t(s,()=>s(o))||r(c,o),t(n,()=>n(o))||Ba(c),i(o,c),c},f_=i=>(t,e)=>{const s=t.createPanner();return s.orientationX===void 0?i(t,e):(Gt(s,e),Ft(s,e,"orientationX"),Ft(s,e,"orientationY"),Ft(s,e,"orientationZ"),Ft(s,e,"positionX"),Ft(s,e,"positionY"),Ft(s,e,"positionZ"),Pt(s,e,"coneInnerAngle"),Pt(s,e,"coneOuterAngle"),Pt(s,e,"coneOuterGain"),Pt(s,e,"distanceModel"),Pt(s,e,"maxDistance"),Pt(s,e,"panningModel"),Pt(s,e,"refDistance"),Pt(s,e,"rolloffFactor"),s)},p_=(i,t,e,s,n,r,o,a,c,l)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:f,distanceModel:_,maxDistance:p,orientationX:m,orientationY:y,orientationZ:w,panningModel:b,positionX:v,positionY:g,positionZ:T,refDistance:x,rolloffFactor:k,...C})=>{const M=u.createPanner();if(C.channelCount>2||C.channelCountMode==="max")throw o();Gt(M,C);const R={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},P=e(u,{...R,channelInterpretation:"speakers",numberOfInputs:6}),U=s(u,{...C,gain:1}),W=s(u,{...R,gain:1}),G=s(u,{...R,gain:0}),Y=s(u,{...R,gain:0}),j=s(u,{...R,gain:0}),z=s(u,{...R,gain:0}),X=s(u,{...R,gain:0}),Q=n(u,256,6,1),et=r(u,{...R,curve:new Float32Array([1,1]),oversample:"none"});let I=[m,y,w],F=[v,g,T];const S=new Float32Array(1);Q.onaudioprocess=({inputBuffer:V})=>{const it=[c(V,S,0),c(V,S,1),c(V,S,2)];it.some((nt,J)=>nt!==I[J])&&(M.setOrientation(...it),I=it);const st=[c(V,S,3),c(V,S,4),c(V,S,5)];st.some((nt,J)=>nt!==F[J])&&(M.setPosition(...st),F=st)},Object.defineProperty(G.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Y.gain,"defaultValue",{get:()=>0}),Object.defineProperty(j.gain,"defaultValue",{get:()=>0}),Object.defineProperty(z.gain,"defaultValue",{get:()=>0}),Object.defineProperty(X.gain,"defaultValue",{get:()=>0});const D={get bufferSize(){},get channelCount(){return M.channelCount},set channelCount(V){if(V>2)throw o();U.channelCount=V,M.channelCount=V},get channelCountMode(){return M.channelCountMode},set channelCountMode(V){if(V==="max")throw o();U.channelCountMode=V,M.channelCountMode=V},get channelInterpretation(){return M.channelInterpretation},set channelInterpretation(V){U.channelInterpretation=V,M.channelInterpretation=V},get coneInnerAngle(){return M.coneInnerAngle},set coneInnerAngle(V){M.coneInnerAngle=V},get coneOuterAngle(){return M.coneOuterAngle},set coneOuterAngle(V){M.coneOuterAngle=V},get coneOuterGain(){return M.coneOuterGain},set coneOuterGain(V){if(V<0||V>1)throw t();M.coneOuterGain=V},get context(){return M.context},get distanceModel(){return M.distanceModel},set distanceModel(V){M.distanceModel=V},get inputs(){return[U]},get maxDistance(){return M.maxDistance},set maxDistance(V){if(V<0)throw new RangeError;M.maxDistance=V},get numberOfInputs(){return M.numberOfInputs},get numberOfOutputs(){return M.numberOfOutputs},get orientationX(){return W.gain},get orientationY(){return G.gain},get orientationZ(){return Y.gain},get panningModel(){return M.panningModel},set panningModel(V){M.panningModel=V},get positionX(){return j.gain},get positionY(){return z.gain},get positionZ(){return X.gain},get refDistance(){return M.refDistance},set refDistance(V){if(V<0)throw new RangeError;M.refDistance=V},get rolloffFactor(){return M.rolloffFactor},set rolloffFactor(V){if(V<0)throw new RangeError;M.rolloffFactor=V},addEventListener(...V){return U.addEventListener(V[0],V[1],V[2])},dispatchEvent(...V){return U.dispatchEvent(V[0])},removeEventListener(...V){return U.removeEventListener(V[0],V[1],V[2])}};h!==D.coneInnerAngle&&(D.coneInnerAngle=h),d!==D.coneOuterAngle&&(D.coneOuterAngle=d),f!==D.coneOuterGain&&(D.coneOuterGain=f),_!==D.distanceModel&&(D.distanceModel=_),p!==D.maxDistance&&(D.maxDistance=p),m!==D.orientationX.value&&(D.orientationX.value=m),y!==D.orientationY.value&&(D.orientationY.value=y),w!==D.orientationZ.value&&(D.orientationZ.value=w),b!==D.panningModel&&(D.panningModel=b),v!==D.positionX.value&&(D.positionX.value=v),g!==D.positionY.value&&(D.positionY.value=g),T!==D.positionZ.value&&(D.positionZ.value=T),x!==D.refDistance&&(D.refDistance=x),k!==D.rolloffFactor&&(D.rolloffFactor=k),(I[0]!==1||I[1]!==0||I[2]!==0)&&M.setOrientation(...I),(F[0]!==0||F[1]!==0||F[2]!==0)&&M.setPosition(...F);const H=()=>{U.connect(M),i(U,et,0,0),et.connect(W).connect(P,0,0),et.connect(G).connect(P,0,1),et.connect(Y).connect(P,0,2),et.connect(j).connect(P,0,3),et.connect(z).connect(P,0,4),et.connect(X).connect(P,0,5),P.connect(Q).connect(u.destination)},N=()=>{U.disconnect(M),a(U,et,0,0),et.disconnect(W),W.disconnect(P),et.disconnect(G),G.disconnect(P),et.disconnect(Y),Y.disconnect(P),et.disconnect(j),j.disconnect(P),et.disconnect(z),z.disconnect(P),et.disconnect(X),X.disconnect(P),P.disconnect(Q),Q.disconnect(u.destination)};return l(Zn(D,M),H,N)},m_=i=>(t,{disableNormalization:e,imag:s,real:n})=>{const r=s instanceof Float32Array?s:new Float32Array(s),o=n instanceof Float32Array?n:new Float32Array(n),a=t.createPeriodicWave(o,r,{disableNormalization:e});if(Array.from(s).length<2)throw i();return a},cr=(i,t,e,s)=>i.createScriptProcessor(t,e,s),__=(i,t)=>(e,s)=>{const n=s.channelCountMode;if(n==="clamped-max")throw t();if(e.createStereoPanner===void 0)return i(e,s);const r=e.createStereoPanner();return Gt(r,s),Ft(r,s,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>n,set:o=>{if(o!==n)throw t()}}),r},g_=(i,t,e,s,n,r)=>{const a=new Float32Array([1,1]),c=Math.PI/2,l={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...l,oversample:"none"},h=(_,p,m,y)=>{const w=new Float32Array(16385),b=new Float32Array(16385);for(let C=0;C<16385;C+=1){const M=C/16384*c;w[C]=Math.cos(M),b[C]=Math.sin(M)}const v=e(_,{...l,gain:0}),g=s(_,{...u,curve:w}),T=s(_,{...u,curve:a}),x=e(_,{...l,gain:0}),k=s(_,{...u,curve:b});return{connectGraph(){p.connect(v),p.connect(T.inputs===void 0?T:T.inputs[0]),p.connect(x),T.connect(m),m.connect(g.inputs===void 0?g:g.inputs[0]),m.connect(k.inputs===void 0?k:k.inputs[0]),g.connect(v.gain),k.connect(x.gain),v.connect(y,0,0),x.connect(y,0,1)},disconnectGraph(){p.disconnect(v),p.disconnect(T.inputs===void 0?T:T.inputs[0]),p.disconnect(x),T.disconnect(m),m.disconnect(g.inputs===void 0?g:g.inputs[0]),m.disconnect(k.inputs===void 0?k:k.inputs[0]),g.disconnect(v.gain),k.disconnect(x.gain),v.disconnect(y,0,0),x.disconnect(y,0,1)}}},d=(_,p,m,y)=>{const w=new Float32Array(16385),b=new Float32Array(16385),v=new Float32Array(16385),g=new Float32Array(16385),T=Math.floor(16385/2);for(let j=0;j<16385;j+=1)if(j>T){const z=(j-T)/(16384-T)*c;w[j]=Math.cos(z),b[j]=Math.sin(z),v[j]=0,g[j]=1}else{const z=j/(16384-T)*c;w[j]=1,b[j]=0,v[j]=Math.cos(z),g[j]=Math.sin(z)}const x=t(_,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),k=e(_,{...l,gain:0}),C=s(_,{...u,curve:w}),M=e(_,{...l,gain:0}),R=s(_,{...u,curve:b}),P=s(_,{...u,curve:a}),U=e(_,{...l,gain:0}),W=s(_,{...u,curve:v}),G=e(_,{...l,gain:0}),Y=s(_,{...u,curve:g});return{connectGraph(){p.connect(x),p.connect(P.inputs===void 0?P:P.inputs[0]),x.connect(k,0),x.connect(M,0),x.connect(U,1),x.connect(G,1),P.connect(m),m.connect(C.inputs===void 0?C:C.inputs[0]),m.connect(R.inputs===void 0?R:R.inputs[0]),m.connect(W.inputs===void 0?W:W.inputs[0]),m.connect(Y.inputs===void 0?Y:Y.inputs[0]),C.connect(k.gain),R.connect(M.gain),W.connect(U.gain),Y.connect(G.gain),k.connect(y,0,0),U.connect(y,0,0),M.connect(y,0,1),G.connect(y,0,1)},disconnectGraph(){p.disconnect(x),p.disconnect(P.inputs===void 0?P:P.inputs[0]),x.disconnect(k,0),x.disconnect(M,0),x.disconnect(U,1),x.disconnect(G,1),P.disconnect(m),m.disconnect(C.inputs===void 0?C:C.inputs[0]),m.disconnect(R.inputs===void 0?R:R.inputs[0]),m.disconnect(W.inputs===void 0?W:W.inputs[0]),m.disconnect(Y.inputs===void 0?Y:Y.inputs[0]),C.disconnect(k.gain),R.disconnect(M.gain),W.disconnect(U.gain),Y.disconnect(G.gain),k.disconnect(y,0,0),U.disconnect(y,0,0),M.disconnect(y,0,1),G.disconnect(y,0,1)}}},f=(_,p,m,y,w)=>{if(p===1)return h(_,m,y,w);if(p===2)return d(_,m,y,w);throw n()};return(_,{channelCount:p,channelCountMode:m,pan:y,...w})=>{if(m==="max")throw n();const b=i(_,{...w,channelCount:1,channelCountMode:m,numberOfInputs:2}),v=e(_,{...w,channelCount:p,channelCountMode:m,gain:1}),g=e(_,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:y});let{connectGraph:T,disconnectGraph:x}=f(_,p,v,g,b);Object.defineProperty(g.gain,"defaultValue",{get:()=>0}),Object.defineProperty(g.gain,"maxValue",{get:()=>1}),Object.defineProperty(g.gain,"minValue",{get:()=>-1});const k={get bufferSize(){},get channelCount(){return v.channelCount},set channelCount(P){v.channelCount!==P&&(C&&x(),{connectGraph:T,disconnectGraph:x}=f(_,P,v,g,b),C&&T()),v.channelCount=P},get channelCountMode(){return v.channelCountMode},set channelCountMode(P){if(P==="clamped-max"||P==="max")throw n();v.channelCountMode=P},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(P){v.channelInterpretation=P},get context(){return v.context},get inputs(){return[v]},get numberOfInputs(){return v.numberOfInputs},get numberOfOutputs(){return v.numberOfOutputs},get pan(){return g.gain},addEventListener(...P){return v.addEventListener(P[0],P[1],P[2])},dispatchEvent(...P){return v.dispatchEvent(P[0])},removeEventListener(...P){return v.removeEventListener(P[0],P[1],P[2])}};let C=!1;const M=()=>{T(),C=!0},R=()=>{x(),C=!1};return r(Zn(k,b),M,R)}},y_=(i,t,e,s,n,r,o)=>(a,c)=>{const l=a.createWaveShaper();if(r!==null&&r.name==="webkitAudioContext"&&a.createGain().gain.automationRate===void 0)return e(a,c);Gt(l,c);const u=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(u!==null&&u.length<2)throw t();Pt(l,{curve:u},"curve"),Pt(l,c,"oversample");let h=null,d=!1;return o(l,"curve",p=>()=>p.call(l),p=>m=>(p.call(l,m),d&&(s(m)&&h===null?h=i(a,l):!s(m)&&h!==null&&(h(),h=null)),m)),n(l,()=>{d=!0,s(l.curve)&&(h=i(a,l))},()=>{d=!1,h!==null&&(h(),h=null)})},v_=(i,t,e,s,n)=>(r,{curve:o,oversample:a,...c})=>{const l=r.createWaveShaper(),u=r.createWaveShaper();Gt(l,c),Gt(u,c);const h=e(r,{...c,gain:1}),d=e(r,{...c,gain:-1}),f=e(r,{...c,gain:1}),_=e(r,{...c,gain:-1});let p=null,m=!1,y=null;const w={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(g){h.channelCount=g,d.channelCount=g,l.channelCount=g,f.channelCount=g,u.channelCount=g,_.channelCount=g},get channelCountMode(){return l.channelCountMode},set channelCountMode(g){h.channelCountMode=g,d.channelCountMode=g,l.channelCountMode=g,f.channelCountMode=g,u.channelCountMode=g,_.channelCountMode=g},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(g){h.channelInterpretation=g,d.channelInterpretation=g,l.channelInterpretation=g,f.channelInterpretation=g,u.channelInterpretation=g,_.channelInterpretation=g},get context(){return l.context},get curve(){return y},set curve(g){if(g!==null&&g.length<2)throw t();if(g===null)l.curve=g,u.curve=g;else{const T=g.length,x=new Float32Array(T+2-T%2),k=new Float32Array(T+2-T%2);x[0]=g[0],k[0]=-g[T-1];const C=Math.ceil((T+1)/2),M=(T+1)/2-1;for(let R=1;R{h.connect(l).connect(f),h.connect(d).connect(u).connect(_).connect(f),m=!0,s(y)&&(p=i(r,h))},v=()=>{h.disconnect(l),l.disconnect(f),h.disconnect(d),d.disconnect(u),u.disconnect(_),_.disconnect(f),m=!1,p!==null&&(p(),p=null)};return n(Zn(w,f),b,v)},ae=()=>new DOMException("","NotSupportedError"),k_={numberOfChannels:1},x_=(i,t,e,s,n)=>class extends i{constructor(o,a,c){let l;if(typeof o=="number"&&a!==void 0&&c!==void 0)l={length:a,numberOfChannels:o,sampleRate:c};else if(typeof o=="object")l=o;else throw new Error("The given parameters are not valid.");const{length:u,numberOfChannels:h,sampleRate:d}={...k_,...l},f=s(h,u,d);t(Oi,()=>Oi(f))||f.addEventListener("statechange",(()=>{let _=0;const p=m=>{this._state==="running"&&(_>0?(f.removeEventListener("statechange",p),m.stopImmediatePropagation(),this._waitForThePromiseToSettle(m)):_+=1)};return p})()),super(f,h),this._length=u,this._nativeOfflineAudioContext=f,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state==="running"?Promise.reject(e()):(this._state="running",n(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,yu(this)}))}_waitForThePromiseToSettle(o){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(o):setTimeout(()=>this._waitForThePromiseToSettle(o))}},T_={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},w_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...T_,...l},d=e(u,h),f=r(u),_=f?s():null,p=c.sampleRate/2;super(c,!1,d,_),this._detune=t(this,f,d.detune,153600,-153600),this._frequency=t(this,f,d.frequency,p,-p),this._nativeOscillatorNode=d,this._onended=null,this._oscillatorNodeRenderer=_,this._oscillatorNodeRenderer!==null&&h.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=h.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(c){const l=typeof c=="function"?o(this,c):null;this._nativeOscillatorNode.onended=l;const u=this._nativeOscillatorNode.onended;this._onended=u!==null&&u===l?c:u}get type(){return this._nativeOscillatorNode.type}set type(c){this._nativeOscillatorNode.type=c,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(c){this._nativeOscillatorNode.setPeriodicWave(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=c)}start(c=0){if(this._nativeOscillatorNode.start(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=c),this.context.state!=="closed"){Vn(this);const l=()=>{this._nativeOscillatorNode.removeEventListener("ended",l),ds(this)&&ir(this)};this._nativeOscillatorNode.addEventListener("ended",l)}}stop(c=0){this._nativeOscillatorNode.stop(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=c)}},b_=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null,c=null;const l=async(u,h)=>{let d=e(u);const f=se(d,h);if(!f){const _={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:o===null?void 0:o,type:d.type};d=t(h,_),a!==null&&d.start(a),c!==null&&d.stop(c)}return r.set(h,d),f?(await i(h,u.detune,d.detune),await i(h,u.frequency,d.frequency)):(await s(h,u.detune,d.detune),await s(h,u.frequency,d.frequency)),await n(u,h,d),d};return{set periodicWave(u){o=u},set start(u){a=u},set stop(u){c=u},render(u,h){const d=r.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},C_={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},S_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...C_,...l},d=e(u,h),f=r(u),_=f?s():null;super(c,!1,d,_),this._nativePannerNode=d,this._orientationX=t(this,f,d.orientationX,ne,le),this._orientationY=t(this,f,d.orientationY,ne,le),this._orientationZ=t(this,f,d.orientationZ,ne,le),this._positionX=t(this,f,d.positionX,ne,le),this._positionY=t(this,f,d.positionY,ne,le),this._positionZ=t(this,f,d.positionZ,ne,le),o(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(c){this._nativePannerNode.coneInnerAngle=c}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(c){this._nativePannerNode.coneOuterAngle=c}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(c){this._nativePannerNode.coneOuterGain=c}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(c){this._nativePannerNode.distanceModel=c}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(c){this._nativePannerNode.maxDistance=c}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(c){this._nativePannerNode.panningModel=c}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(c){this._nativePannerNode.refDistance=c}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(c){this._nativePannerNode.rolloffFactor=c}},E_=(i,t,e,s,n,r,o,a,c,l)=>()=>{const u=new WeakMap;let h=null;const d=async(f,_)=>{let p=null,m=r(f);const y={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},w={...y,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=se(m,_);if("bufferSize"in m)p=s(_,{...y,gain:1});else if(!b){const v={...w,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=n(_,v)}if(u.set(_,p===null?m:p),p!==null){if(h===null){if(o===null)throw new Error("Missing the native OfflineAudioContext constructor.");const R=new o(6,f.context.length,_.sampleRate),P=t(R,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});P.connect(R.destination),h=(async()=>{const U=await Promise.all([f.orientationX,f.orientationY,f.orientationZ,f.positionX,f.positionY,f.positionZ].map(async(W,G)=>{const Y=e(R,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:G===0?1:0});return await a(R,W,Y.offset),Y}));for(let W=0;W<6;W+=1)U[W].connect(P,0,W),U[W].start(0);return l(R)})()}const v=await h,g=s(_,{...y,gain:1});await c(f,_,g);const T=[];for(let R=0;RW!==x[G])||U.some((W,G)=>W!==k[G])){x=P,k=U;const W=R/_.sampleRate;C.gain.setValueAtTime(0,W),C=s(_,{...y,gain:0}),M=n(_,{...w,orientationX:x[0],orientationY:x[1],orientationZ:x[2],positionX:k[0],positionY:k[1],positionZ:k[2]}),C.gain.setValueAtTime(1,W),g.connect(C).connect(M.inputs[0]),M.connect(p)}}return p}return b?(await i(_,f.orientationX,m.orientationX),await i(_,f.orientationY,m.orientationY),await i(_,f.orientationZ,m.orientationZ),await i(_,f.positionX,m.positionX),await i(_,f.positionY,m.positionY),await i(_,f.positionZ,m.positionZ)):(await a(_,f.orientationX,m.orientationX),await a(_,f.orientationY,m.orientationY),await a(_,f.orientationZ,m.orientationZ),await a(_,f.positionX,m.positionX),await a(_,f.positionY,m.positionY),await a(_,f.positionZ,m.positionZ)),Xn(m)?await c(f,_,m.inputs[0]):await c(f,_,m),m};return{render(f,_){const p=u.get(_);return p!==void 0?Promise.resolve(p):d(f,_)}}},O_={disableNormalization:!1},A_=(i,t,e,s)=>class Ou{constructor(r,o){const a=t(r),c=s({...O_,...o}),l=i(a,c);return e.add(l),l}static[Symbol.hasInstance](r){return r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===Ou.prototype||e.has(r)}},M_=(i,t)=>(e,s,n)=>(i(s).replay(n),t(s,e,n)),D_=(i,t,e)=>async(s,n,r)=>{const o=i(s);await Promise.all(o.activeInputs.map((a,c)=>Array.from(a).map(async([l,u])=>{const d=await t(l).render(l,n),f=s.context.destination;!e(l)&&(s!==f||!e(s))&&d.connect(r,u,c)})).reduce((a,c)=>[...a,...c],[]))},P_=(i,t,e)=>async(s,n,r)=>{const o=t(s);await Promise.all(Array.from(o.activeInputs).map(async([a,c])=>{const u=await i(a).render(a,n);e(a)||u.connect(r,c)}))},N_=(i,t,e,s)=>n=>i(Oi,()=>Oi(n))?Promise.resolve(i(s,s)).then(r=>{if(!r){const o=e(n,512,0,1);n.oncomplete=()=>{o.onaudioprocess=null,o.disconnect()},o.onaudioprocess=()=>n.currentTime,o.connect(n.destination)}return n.startRendering()}):new Promise(r=>{const o=t(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.oncomplete=a=>{o.disconnect(),r(a.renderedBuffer)},o.connect(n.destination),n.startRendering()}),I_=i=>(t,e)=>{i.set(t,e)},R_=i=>(t,e)=>i.set(t,e),F_=(i,t,e,s,n,r,o,a)=>(c,l)=>e(c).render(c,l).then(()=>Promise.all(Array.from(s(l)).map(u=>e(u).render(u,l)))).then(()=>n(l)).then(u=>(typeof u.copyFromChannel!="function"?(o(u),Va(u)):t(r,()=>r(u))||a(u),i.add(u),u)),L_={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},V_=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...L_,...c},h=e(l,u),d=r(l),f=d?s():null;super(a,!1,h,f),this._pan=t(this,d,h.pan)}get pan(){return this._pan}},U_=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(c,h)}return r.set(c,l),u?await i(c,a.pan,l.pan):await s(c,a.pan,l.pan),Xn(l)?await n(a,c,l.inputs[0]):await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},z_=i=>()=>{if(i===null)return!1;try{new i({length:1,sampleRate:44100})}catch{return!1}return!0},j_=(i,t)=>async()=>{if(i===null)return!0;if(t===null)return!1;const e=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new t(1,128,44100),n=URL.createObjectURL(e);let r=!1,o=!1;try{await s.audioWorklet.addModule(n);const a=new i(s,"a",{numberOfOutputs:0}),c=s.createOscillator();a.port.onmessage=()=>r=!0,a.onprocessorerror=()=>o=!0,c.connect(a),c.start(0),await s.startRendering(),await new Promise(l=>setTimeout(l))}catch{}finally{URL.revokeObjectURL(n)}return r&&!o},B_=(i,t)=>()=>{if(t===null)return Promise.resolve(!1);const e=new t(1,1,44100),s=i(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(n=>{e.oncomplete=()=>{s.disconnect(),n(e.currentTime!==0)},e.startRendering()})},q_=()=>new DOMException("","UnknownError"),W_={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},H_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...W_,...l},d=e(u,h),_=r(u)?s():null;super(c,!0,d,_),this._isCurveNullified=!1,this._nativeWaveShaperNode=d,o(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(c){if(c===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(c.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=c}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(c){this._nativeWaveShaperNode.oversample=c}},Y_=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=i(o,l)}return s.set(o,a),Xn(a)?await e(r,o,a.inputs[0]):await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},G_=()=>typeof window>"u"?null:window,$_=(i,t)=>e=>{e.copyFromChannel=(s,n,r=0)=>{const o=i(r),a=i(n);if(a>=e.numberOfChannels)throw t();const c=e.length,l=e.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+o{const o=i(r),a=i(n);if(a>=e.numberOfChannels)throw t();const c=e.length,l=e.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+ot=>{t.copyFromChannel=(e=>(s,n,r=0)=>{const o=i(r),a=i(n);if(o(s,n,r=0)=>{const o=i(r),a=i(n);if(o(t,e)=>{const s=e.createBuffer(1,1,44100);t.buffer===null&&(t.buffer=s),i(t,"buffer",n=>()=>{const r=n.call(t);return r===s?null:r},n=>r=>n.call(t,r===null?s:r))},Q_=(i,t)=>(e,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw i()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw i()}});const n=e.createBufferSource();t(s,()=>{const a=s.numberOfInputs;for(let c=0;cn.disconnect(s))},Au=(i,t,e)=>i.copyFromChannel===void 0?i.getChannelData(e)[0]:(i.copyFromChannel(t,e),t[0]),Mu=i=>{if(i===null)return!1;const t=i.length;return t%2!==0?i[Math.floor(t/2)]!==0:i[t/2-1]+i[t/2]!==0},lr=(i,t,e,s)=>{let n=i;for(;!n.hasOwnProperty(t);)n=Object.getPrototypeOf(n);const{get:r,set:o}=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,{get:e(r),set:s(o)})},K_=i=>({...i,outputChannelCount:i.outputChannelCount!==void 0?i.outputChannelCount:i.numberOfInputs===1&&i.numberOfOutputs===1?[i.channelCount]:Array.from({length:i.numberOfOutputs},()=>1)}),J_=i=>({...i,channelCount:i.numberOfOutputs}),tg=i=>{const{imag:t,real:e}=i;return t===void 0?e===void 0?{...i,imag:[0,0],real:[0,0]}:{...i,imag:Array.from(e,()=>0),real:e}:e===void 0?{...i,imag:t,real:Array.from(t,()=>0)}:{...i,imag:t,real:e}},Du=(i,t,e)=>{try{i.setValueAtTime(t,e)}catch(s){if(s.code!==9)throw s;Du(i,t,e+1e-7)}},eg=i=>{const t=i.createBufferSource();t.start();try{t.start()}catch{return!0}return!1},sg=i=>{const t=i.createBufferSource(),e=i.createBuffer(1,1,44100);t.buffer=e;try{t.start(0,1)}catch{return!1}return!0},ng=i=>{const t=i.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0},qa=i=>{const t=i.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Pu=i=>{const t=i.createBuffer(1,1,44100),e=i.createBufferSource();e.buffer=t,e.start(),e.stop();try{return e.stop(),!0}catch{return!1}},Wa=i=>{const t=i.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},ig=i=>{const{port1:t,port2:e}=new MessageChannel;try{t.postMessage(i)}finally{t.close(),e.close()}},rg=i=>{i.start=(t=>(e=0,s=0,n)=>{const r=i.buffer,o=r===null?s:Math.min(r.duration,s);r!==null&&o>r.duration-.5/i.context.sampleRate?t.call(i,e,0,0):t.call(i,e,o,n)})(i.start)},Nu=(i,t)=>{const e=t.createGain();i.connect(e);const s=(n=>()=>{n.call(i,e),i.removeEventListener("ended",s)})(i.disconnect);i.addEventListener("ended",s),Zn(i,e),i.stop=(n=>{let r=!1;return(o=0)=>{if(r)try{n.call(i,o)}catch{e.gain.setValueAtTime(0,o)}else n.call(i,o),r=!0}})(i.stop)},Qn=(i,t)=>e=>{const s={value:i};return Object.defineProperties(e,{currentTarget:s,target:s}),typeof t=="function"?t.call(i,e):t.handleEvent.call(i,e)},og=S0(fn),ag=P0(fn),cg=Wp(vo),Iu=new WeakMap,lg=cm(Iu),He=kp(new Map,new WeakMap),ts=G_(),Ru=Vm(He,ss),Ha=am(re),Qt=D_(re,Ha,on),ug=L0(Ru,Dt,Qt),At=hm(yo),vs=h_(ts),wt=Om(vs),Fu=new WeakMap,Lu=tm(Qn),ur=Bm(ts),Ya=bm(ur),Ga=Cm(ts),Vu=Sm(ts),Ai=Wm(ts),Wt=cp(E0(hu),D0(og,ag,jr,cg,Br,re,lg,nr,Dt,fn,ds,on,Pr),He,vm(ua,Br,re,Dt,Ei,ds),ss,ko,ae,zp(jr,ua,re,Dt,Ei,At,ds,wt),Gp(Fu,re,je),Lu,At,Ya,Ga,Vu,wt,Ai),hg=F0(Wt,ug,ss,Ru,At,wt),$a=new WeakSet,gl=Um(ts),Uu=Np(new Uint32Array(1)),Xa=$_(Uu,ss),Za=X_(Uu),zu=U0($a,He,ae,gl,vs,z_(gl),Xa,Za),xo=N0(me),ju=P_(Ha,rr,on),ns=Ep(ju),Kn=jm(xo,He,eg,sg,ng,qa,Pu,Wa,rg,Z_(lr),Nu),is=M_(lm(rr),ju),dg=B0(ns,Kn,Dt,is,Qt),Ye=lp(O0(du),Fu,La,up,k0,x0,T0,w0,b0,aa,lu,ur,Du),fg=j0(Wt,dg,Ye,Xt,Kn,At,wt,Qn),pg=Q0(Wt,K0,ss,Xt,qm(me,lr),At,wt,Qt),mg=vp(ns,Su,Dt,is,Qt),pn=R_(Iu),_g=yp(Wt,Ye,mg,ko,Su,At,wt,pn),zs=Fm(fn,Ga),gg=Q_(Xt,zs),js=Qm(ur,gg),yg=wp(js,Dt,Qt),vg=Tp(Wt,yg,js,At,wt),kg=Sp(ar,Dt,Qt),xg=Cp(Wt,kg,ar,At,wt,J_),Tg=t_(xo,Kn,me,zs),Jn=Jm(xo,He,Tg,qa,Wa),wg=Pp(ns,Jn,Dt,is,Qt),bg=Dp(Wt,Ye,wg,Jn,At,wt,Qn),Bu=e_(ae,lr),Cg=Fp(Bu,Dt,Qt),Sg=Rp(Wt,Cg,Bu,At,wt,pn),Eg=qp(ns,Eu,Dt,is,Qt),Og=Bp(Wt,Ye,Eg,Eu,At,wt,pn),qu=s_(ae),Ag=Qp(ns,qu,Dt,is,Qt),Mg=Zp(Wt,Ye,Ag,qu,ae,At,wt,pn),Dg=rm(ns,me,Dt,is,Qt),Pg=im(Wt,Ye,Dg,me,At,wt),Ng=o_(ko,Xt,cr,ae),To=N_(He,me,cr,B_(me,vs)),Ig=ym(Kn,Dt,vs,Qt,To),Rg=n_(Ng),Fg=_m(Wt,Rg,Ig,At,wt,pn),Lg=J0(Ye,js,Jn,cr,ae,Au,wt,lr),Wu=new WeakMap,Vg=Rm(pg,Lg,Lu,wt,Wu,Qn),Hu=d_(xo,He,qa,Pu,Wa,Nu),Ug=b_(ns,Hu,Dt,is,Qt),zg=w_(Wt,Ye,Hu,Ug,At,wt,Qn),Yu=Ap(Kn),jg=v_(Yu,Xt,me,Mu,zs),wo=y_(Yu,Xt,jg,Mu,zs,ur,lr),Bg=p_(jr,Xt,js,me,cr,wo,ae,Br,Au,zs),Gu=f_(Bg),qg=E_(ns,js,Jn,me,Gu,Dt,vs,is,Qt,To),Wg=S_(Wt,Ye,Gu,qg,At,wt,pn),Hg=m_(ss),Yg=A_(Hg,At,new WeakSet,tg),Gg=g_(js,ar,me,wo,ae,zs),$u=__(Gg,ae),$g=U_(ns,$u,Dt,is,Qt),Xg=V_(Wt,Ye,$u,$g,At,wt),Zg=Y_(wo,Dt,Qt),Qg=H_(Wt,Xt,wo,Zg,At,wt,pn),Xu=Am(ts),Qa=em(ts),Zu=new WeakMap,Kg=dm(Zu,vs),Jg=Xu?M0(He,ae,Jp(ts),Qa,sm(C0),At,Kg,wt,Ai,new WeakMap,new WeakMap,j_(Ai,vs),ts):void 0,ty=Em(Ya,wt),ey=Up($a,He,Vp,Kp,new WeakSet,At,ty,Ur,Oi,Xa,Za),Qu=_p(Jg,hg,zu,fg,_g,vg,xg,bg,Sg,ey,Og,Mg,Pg,Fg,Vg,zg,Wg,Yg,Xg,Qg),sy=Mm(Wt,a_,At,wt),ny=Pm(Wt,c_,At,wt),iy=Nm(Wt,l_,At,wt),ry=u_(Xt,wt),oy=Im(Wt,ry,At),ay=Z0(Qu,Xt,ae,q_,sy,ny,iy,oy,ur),Ka=fm(Wu),cy=I0(Ka),Ku=Op(ss),ly=Hp(Ka),Ju=$p(ss),th=new WeakMap,uy=om(th,je),hy=Zm(Ku,ss,Xt,js,ar,Jn,me,cr,ae,Ju,Qa,uy,zs),dy=Ym(Xt,hy,me,ae,zs),fy=mp(ns,Ku,Kn,js,ar,Jn,me,ly,Ju,Qa,Dt,Ai,vs,is,Qt,To),py=um(Zu),my=I_(th),yl=Xu?dp(cy,Wt,Ye,fy,dy,re,py,At,wt,Ai,K_,my,ig,Qn):void 0,_y=Lp(ae,vs),gy=F_($a,He,Ha,Ka,To,Ur,Xa,Za),yy=x_(Qu,He,Xt,_y,gy),vy=km(yo,Ya),ky=xm(Fa,Ga),xy=Tm(La,Vu),Ty=wm(yo,wt);function xe(i){return typeof i>"u"}function dt(i){return!xe(i)}function wy(i){return typeof i=="function"}function Ps(i){return typeof i=="number"}function Js(i){return Object.prototype.toString.call(i)==="[object Object]"&&i.constructor===Object}function by(i){return typeof i=="boolean"}function ze(i){return Array.isArray(i)}function fs(i){return typeof i=="string"}function Cr(i){return fs(i)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(i)}function ut(i,t){if(!i)throw new Error(t)}function Be(i,t,e=1/0){if(!(t<=i&&i<=e))throw new RangeError(`Value must be within [${t}, ${e}], got: ${i}`)}function eh(i){!i.isOffline&&i.state!=="running"&&Ja('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let sh=!1,vl=!1;function kl(i){sh=i}function Cy(i){xe(i)&&sh&&!vl&&(vl=!0,Ja("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let nh=console;function Sy(...i){nh.log(...i)}function Ja(...i){nh.warn(...i)}function Ey(i){return new ay(i)}function Oy(i,t,e){return new yy(i,t,e)}const tn=typeof self=="object"?self:null,Ay=tn&&(tn.hasOwnProperty("AudioContext")||tn.hasOwnProperty("webkitAudioContext"));function My(i,t,e){return ut(dt(yl),"This node only works in a secure context (https or localhost)"),new yl(i,t,e)}class Dy{constructor(t,e,s,n){this._callback=t,this._type=e,this._minimumUpdateInterval=Math.max(128/(n||44100),.001),this.updateInterval=s,this._createClock()}_createWorker(){const t=new Blob([` +`,Ti=new rt(0,0,0),el=100,m0=600,_0=2e3,Ho={x:172.7392402058252,y:-239.04675366094037,z:-2e3},cu="14.8.49",sl=(i,t,e)=>({endTime:t,insertTime:e,type:"exponentialRampToValue",value:i}),nl=(i,t,e)=>({endTime:t,insertTime:e,type:"linearRampToValue",value:i}),aa=(i,t)=>({startTime:t,type:"setValue",value:i}),lu=(i,t,e)=>({duration:e,startTime:t,type:"setValueCurve",values:i}),uu=(i,t,{startTime:e,target:s,timeConstant:n})=>s+(t-s)*Math.exp((e-i)/n),En=i=>i.type==="exponentialRampToValue",Lr=i=>i.type==="linearRampToValue",bs=i=>En(i)||Lr(i),Ra=i=>i.type==="setValue",ls=i=>i.type==="setValueCurve",Vr=(i,t,e,s)=>{const n=i[t];return n===void 0?s:bs(n)||Ra(n)?n.value:ls(n)?n.values[n.values.length-1]:uu(e,Vr(i,t-1,n.startTime,s),n)},il=(i,t,e,s,n)=>e===void 0?[s.insertTime,n]:bs(e)?[e.endTime,e.value]:Ra(e)?[e.startTime,e.value]:ls(e)?[e.startTime+e.duration,e.values[e.values.length-1]]:[e.startTime,Vr(i,t-1,e.startTime,n)],ca=i=>i.type==="cancelAndHold",la=i=>i.type==="cancelScheduledValues",Ts=i=>ca(i)||la(i)?i.cancelTime:En(i)||Lr(i)?i.endTime:i.startTime,rl=(i,t,e,{endTime:s,value:n})=>e===n?n:0e+(i-t)/(s-t)*(n-e),g0=(i,t)=>{const e=Math.floor(t),s=Math.ceil(t);return e===s?i[e]:(1-(t-e))*i[e]+(1-(s-t))*i[s]},y0=(i,{duration:t,startTime:e,values:s})=>{const n=(i-e)/t*(s.length-1);return g0(s,n)},wr=i=>i.type==="setTarget";class v0{constructor(t){this._automationEvents=[],this._currenTime=0,this._defaultValue=t}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(t){const e=Ts(t);if(ca(t)||la(t)){const s=this._automationEvents.findIndex(r=>la(t)&&ls(r)?r.startTime+r.duration>=e:Ts(r)>=e),n=this._automationEvents[s];if(s!==-1&&(this._automationEvents=this._automationEvents.slice(0,s)),ca(t)){const r=this._automationEvents[this._automationEvents.length-1];if(n!==void 0&&bs(n)){if(r!==void 0&&wr(r))throw new Error("The internal list is malformed.");const o=r===void 0?n.insertTime:ls(r)?r.startTime+r.duration:Ts(r),a=r===void 0?this._defaultValue:ls(r)?r.values[r.values.length-1]:r.value,c=En(n)?rl(e,o,a,n):ol(e,o,a,n),l=En(n)?sl(c,e,this._currenTime):nl(c,e,this._currenTime);this._automationEvents.push(l)}if(r!==void 0&&wr(r)&&this._automationEvents.push(aa(this.getValue(e),e)),r!==void 0&&ls(r)&&r.startTime+r.duration>e){const o=e-r.startTime,a=(r.values.length-1)/r.duration,c=Math.max(2,1+Math.ceil(o*a)),l=o/(c-1)*a,u=r.values.slice(0,c);if(l<1)for(let h=1;hTs(o)>e),n=s===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[s-1];if(n!==void 0&&ls(n)&&Ts(n)+n.duration>e)return!1;const r=En(t)?sl(t.value,t.endTime,this._currenTime):Lr(t)?nl(t.value,e,this._currenTime):t;if(s===-1)this._automationEvents.push(r);else{if(ls(t)&&e+t.duration>Ts(this._automationEvents[s]))return!1;this._automationEvents.splice(s,0,r)}}return!0}flush(t){const e=this._automationEvents.findIndex(s=>Ts(s)>t);if(e>1){const s=this._automationEvents.slice(e-1),n=s[0];wr(n)&&s.unshift(aa(Vr(this._automationEvents,e-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=s}}getValue(t){if(this._automationEvents.length===0)return this._defaultValue;const e=this._automationEvents.findIndex(o=>Ts(o)>t),s=this._automationEvents[e],n=(e===-1?this._automationEvents.length:e)-1,r=this._automationEvents[n];if(r!==void 0&&wr(r)&&(s===void 0||!bs(s)||s.insertTime>t))return uu(t,Vr(this._automationEvents,n-1,r.startTime,this._defaultValue),r);if(r!==void 0&&Ra(r)&&(s===void 0||!bs(s)))return r.value;if(r!==void 0&&ls(r)&&(s===void 0||!bs(s)||r.startTime+r.duration>t))return t({cancelTime:i,type:"cancelAndHold"}),x0=i=>({cancelTime:i,type:"cancelScheduledValues"}),T0=(i,t)=>({endTime:t,type:"exponentialRampToValue",value:i}),w0=(i,t)=>({endTime:t,type:"linearRampToValue",value:i}),b0=(i,t,e)=>({startTime:t,target:i,timeConstant:e,type:"setTarget"}),C0=()=>new DOMException("","AbortError"),S0=i=>(t,e,[s,n,r],o)=>{i(t[n],[e,s,r],a=>a[0]===e&&a[1]===s,o)},E0=i=>(t,e,s)=>{const n=[];for(let r=0;r(t,e)=>{i.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:e})},Ln=new WeakSet,hu=new WeakMap,Fa=new WeakMap,du=new WeakMap,La=new WeakMap,yo=new WeakMap,fu=new WeakMap,ua=new WeakMap,ha=new WeakMap,da=new WeakMap,pu={construct(){return pu}},A0=i=>{try{const t=new Proxy(i,pu);new t}catch{return!1}return!0},al=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,cl=(i,t)=>{const e=[];let s=i.replace(/^[\s]+/,""),n=s.match(al);for(;n!==null;){const r=n[1].slice(1,-1),o=n[0].replace(/([\s]+)?;?$/,"").replace(r,new URL(r,t).toString());e.push(o),s=s.slice(n[0].length).replace(/^[\s]+/,""),n=s.match(al)}return[e.join(";"),s]},ll=i=>{if(i!==void 0&&!Array.isArray(i))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},ul=i=>{if(!A0(i))throw new TypeError("The given value for processorCtor should be a constructor.");if(i.prototype===null||typeof i.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},M0=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>{let p=0;return(m,f,_={credentials:"omit"})=>{const y=u.get(m);if(y!==void 0&&y.has(f))return Promise.resolve();const w=l.get(m);if(w!==void 0){const g=w.get(f);if(g!==void 0)return g}const b=r(m),v=b.audioWorklet===void 0?n(f).then(([g,x])=>{const[T,k]=cl(g,x),C=`${T};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${k} +})})(window,'_AWGS')`;return e(C)}).then(()=>{const g=d._AWGS.pop();if(g===void 0)throw new SyntaxError;s(b.currentTime,b.sampleRate,()=>g(class{},void 0,(x,T)=>{if(x.trim()==="")throw t();const k=ha.get(b);if(k!==void 0){if(k.has(x))throw t();ul(T),ll(T.parameterDescriptors),k.set(x,T)}else ul(T),ll(T.parameterDescriptors),ha.set(b,new Map([[x,T]]))},b.sampleRate,void 0,void 0))}):Promise.all([n(f),Promise.resolve(i(h,h))]).then(([[g,x],T])=>{const k=p+1;p=k;const[C,M]=cl(g,x),W=`${C};((AudioWorkletProcessor,registerProcessor)=>{${M} +})(${T?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${T?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${T?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${k}',class extends AudioWorkletProcessor{process(){return !1}})`,G=new Blob([W],{type:"application/javascript; charset=utf-8"}),Y=URL.createObjectURL(G);return b.audioWorklet.addModule(Y,_).then(()=>{if(a(b))return b;const j=o(b);return j.audioWorklet.addModule(Y,_).then(()=>j)}).then(j=>{if(c===null)throw new SyntaxError;try{new c(j,`__sac${k}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(Y))});return w===void 0?l.set(m,new Map([[f,v]])):w.set(f,v),v.then(()=>{const g=u.get(m);g===void 0?u.set(m,new Set([f])):g.add(f)}).finally(()=>{const g=l.get(m);g!==void 0&&g.delete(f)}),v}},je=(i,t)=>{const e=i.get(t);if(e===void 0)throw new Error("A value with the given key could not be found.");return e},vo=(i,t)=>{const e=Array.from(i).filter(t);if(e.length>1)throw Error("More than one element was found.");if(e.length===0)throw Error("No element was found.");const[s]=e;return i.delete(s),s},mu=(i,t,e,s)=>{const n=je(i,t),r=vo(n,o=>o[0]===e&&o[1]===s);return n.size===0&&i.delete(t),r},nr=i=>je(fu,i),Vn=i=>{if(Ln.has(i))throw new Error("The AudioNode is already stored.");Ln.add(i),nr(i).forEach(t=>t(!0))},_u=i=>"port"in i,ir=i=>{if(!Ln.has(i))throw new Error("The AudioNode is not stored.");Ln.delete(i),nr(i).forEach(t=>t(!1))},fa=(i,t)=>{!_u(i)&&t.every(e=>e.size===0)&&ir(i)},D0=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>{const p=new WeakMap;return(m,f,_,y,w)=>{const{activeInputs:b,passiveInputs:v}=r(f),{outputs:g}=r(m),x=a(m),T=k=>{const C=c(f),M=c(m);if(k){const R=mu(v,m,_,y);i(b,m,R,!1),!w&&!h(m)&&e(M,C,_,y),d(f)&&Vn(f)}else{const R=s(b,m,_,y);t(v,y,R,!1),!w&&!h(m)&&n(M,C,_,y);const P=o(f);if(P===0)u(f)&&fa(f,b);else{const U=p.get(f);U!==void 0&&clearTimeout(U),p.set(f,setTimeout(()=>{u(f)&&fa(f,b)},P*1e3))}}};return l(g,[f,_,y],k=>k[0]===f&&k[1]===_&&k[2]===y,!0)?(x.add(T),u(m)?i(b,m,[_,y,T],!0):t(v,y,[m,_,T],!0),!0):!1}},P0=i=>(t,e,[s,n,r],o)=>{const a=t.get(s);a===void 0?t.set(s,new Set([[n,e,r]])):i(a,[n,e,r],c=>c[0]===n&&c[1]===e,o)},N0=i=>(t,e)=>{const s=i(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});e.connect(s).connect(t.destination);const n=()=>{e.removeEventListener("ended",n),e.disconnect(s),s.disconnect()};e.addEventListener("ended",n)},I0=i=>(t,e)=>{i(t).add(e)},R0={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},F0=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...R0,...c},h=s(l,u),d=r(l)?t():null;super(a,!1,h,d),this._nativeAnalyserNode=h}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(a){this._nativeAnalyserNode.fftSize=a}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(a){const c=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=a,!(a>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=c,e()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(a){const c=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=a,!(this._nativeAnalyserNode.maxDecibels>a))throw this._nativeAnalyserNode.minDecibels=c,e()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(a){this._nativeAnalyserNode.smoothingTimeConstant=a}getByteFrequencyData(a){this._nativeAnalyserNode.getByteFrequencyData(a)}getByteTimeDomainData(a){this._nativeAnalyserNode.getByteTimeDomainData(a)}getFloatFrequencyData(a){this._nativeAnalyserNode.getFloatFrequencyData(a)}getFloatTimeDomainData(a){this._nativeAnalyserNode.getFloatTimeDomainData(a)}},se=(i,t)=>i.context===t,L0=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Ur=i=>{try{i.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},ss=()=>new DOMException("","IndexSizeError"),Va=i=>{i.getChannelData=(t=>e=>{try{return t.call(i,e)}catch(s){throw s.code===12?ss():s}})(i.getChannelData)},V0={numberOfChannels:1},U0=(i,t,e,s,n,r,o,a)=>{let c=null;return class gu{constructor(u){if(n===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:h,numberOfChannels:d,sampleRate:p}={...V0,...u};c===null&&(c=new n(1,1,44100));const m=s!==null&&t(r,r)?new s({length:h,numberOfChannels:d,sampleRate:p}):c.createBuffer(d,h,p);if(m.numberOfChannels===0)throw e();return typeof m.copyFromChannel!="function"?(o(m),Va(m)):t(Ur,()=>Ur(m))||a(m),i.add(m),m}static[Symbol.hasInstance](u){return u!==null&&typeof u=="object"&&Object.getPrototypeOf(u)===gu.prototype||i.has(u)}}},le=-34028234663852886e22,ne=-le,ds=i=>Ln.has(i),z0={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},j0=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...z0,...u},p=n(h,d),m=o(h),f=m?t():null;super(l,!1,p,f),this._audioBufferSourceNodeRenderer=f,this._isBufferNullified=!1,this._isBufferSet=d.buffer!==null,this._nativeAudioBufferSourceNode=p,this._onended=null,this._playbackRate=e(this,m,p.playbackRate,ne,le)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(l){if(this._nativeAudioBufferSourceNode.buffer=l,l!==null){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(l){this._nativeAudioBufferSourceNode.loop=l}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(l){this._nativeAudioBufferSourceNode.loopEnd=l}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(l){this._nativeAudioBufferSourceNode.loopStart=l}get onended(){return this._onended}set onended(l){const u=typeof l=="function"?a(this,l):null;this._nativeAudioBufferSourceNode.onended=u;const h=this._nativeAudioBufferSourceNode.onended;this._onended=h!==null&&h===u?l:h}get playbackRate(){return this._playbackRate}start(l=0,u=0,h){if(this._nativeAudioBufferSourceNode.start(l,u,h),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=h===void 0?[l,u]:[l,u,h]),this.context.state!=="closed"){Vn(this);const d=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",d),ds(this)&&ir(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",d)}}stop(l=0){this._nativeAudioBufferSourceNode.stop(l),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=l)}},B0=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=e(l);const d=se(h,u);if(!d){const p={buffer:h.buffer,channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,loop:h.loop,loopEnd:h.loopEnd,loopStart:h.loopStart,playbackRate:h.playbackRate.value};h=t(u,p),o!==null&&h.start(...o),a!==null&&h.stop(a)}return r.set(u,h),d?await i(u,l.playbackRate,h.playbackRate):await s(u,l.playbackRate,h.playbackRate),await n(l,u,h),h};return{set start(l){o=l},set stop(l){a=l},render(l,u){const h=r.get(u);return h!==void 0?Promise.resolve(h):c(l,u)}}},q0=i=>"playbackRate"in i,W0=i=>"frequency"in i&&"gain"in i,H0=i=>"offset"in i,Y0=i=>!("frequency"in i)&&"gain"in i,G0=i=>"detune"in i&&"frequency"in i,$0=i=>"pan"in i,re=i=>je(hu,i),rr=i=>je(du,i),pa=(i,t)=>{const{activeInputs:e}=re(i);e.forEach(n=>n.forEach(([r])=>{t.includes(i)||pa(r,[...t,i])}));const s=q0(i)?[i.playbackRate]:_u(i)?Array.from(i.parameters.values()):W0(i)?[i.Q,i.detune,i.frequency,i.gain]:H0(i)?[i.offset]:Y0(i)?[i.gain]:G0(i)?[i.detune,i.frequency]:$0(i)?[i.pan]:[];for(const n of s){const r=rr(n);r!==void 0&&r.activeInputs.forEach(([o])=>pa(o,t))}ds(i)&&ir(i)},yu=i=>{pa(i.destination,[])},X0=i=>i===void 0||typeof i=="number"||typeof i=="string"&&(i==="balanced"||i==="interactive"||i==="playback"),Z0=(i,t,e,s,n,r,o,a,c)=>class extends i{constructor(u={}){if(c===null)throw new Error("Missing the native AudioContext constructor.");let h;try{h=new c(u)}catch(m){throw m.code===12&&m.message==="sampleRate is not in range"?e():m}if(h===null)throw s();if(!X0(u.latencyHint))throw new TypeError(`The provided value '${u.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(u.sampleRate!==void 0&&h.sampleRate!==u.sampleRate)throw e();super(h,2);const{latencyHint:d}=u,{sampleRate:p}=h;if(this._baseLatency=typeof h.baseLatency=="number"?h.baseLatency:d==="balanced"?512/p:d==="interactive"||d===void 0?256/p:d==="playback"?1024/p:Math.max(2,Math.min(128,Math.round(d*p/128)))*128/p,this._nativeAudioContext=h,c.name==="webkitAudioContext"?(this._nativeGainNode=h.createGain(),this._nativeOscillatorNode=h.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(h.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,h.state==="running"){this._state="suspended";const m=()=>{this._state==="suspended"&&(this._state=null),h.removeEventListener("statechange",m)};h.addEventListener("statechange",m)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw t()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),yu(this)}))}createMediaElementSource(u){return new n(this,{mediaElement:u})}createMediaStreamDestination(){return new r(this)}createMediaStreamSource(u){return new o(this,{mediaStream:u})}createMediaStreamTrackSource(u){return new a(this,{mediaStreamTrack:u})}resume(){return this._state==="suspended"?new Promise((u,h)=>{const d=()=>{this._nativeAudioContext.removeEventListener("statechange",d),this._nativeAudioContext.state==="running"?u():this.resume().then(u,h)};this._nativeAudioContext.addEventListener("statechange",d)}):this._nativeAudioContext.resume().catch(u=>{throw u===void 0||u.code===15?t():u})}suspend(){return this._nativeAudioContext.suspend().catch(u=>{throw u===void 0?t():u})}},Q0=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d=o(h),p=n(h,u,d),m=d?t(a):null;super(l,!1,p,m),this._isNodeOfNativeOfflineAudioContext=d,this._nativeAudioDestinationNode=p}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(l>this._nativeAudioDestinationNode.maxChannelCount)throw e();this._nativeAudioDestinationNode.channelCount=l}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=l}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},K0=i=>{const t=new WeakMap,e=async(s,n)=>{const r=n.destination;return t.set(n,r),await i(s,n,r),r};return{render(s,n){const r=t.get(n);return r!==void 0?Promise.resolve(r):e(s,n)}}},J0=(i,t,e,s,n,r,o,a)=>(c,l)=>{const u=l.listener,h=()=>{const g=new Float32Array(1),x=t(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),T=o(l);let k=!1,C=[0,0,-1,0,1,0],M=[0,0,0];const R=()=>{if(k)return;k=!0;const G=s(l,256,9,0);G.onaudioprocess=({inputBuffer:Y})=>{const j=[r(Y,g,0),r(Y,g,1),r(Y,g,2),r(Y,g,3),r(Y,g,4),r(Y,g,5)];j.some((X,Q)=>X!==C[Q])&&(u.setOrientation(...j),C=j);const z=[r(Y,g,6),r(Y,g,7),r(Y,g,8)];z.some((X,Q)=>X!==M[Q])&&(u.setPosition(...z),M=z)},x.connect(G)},P=G=>Y=>{Y!==C[G]&&(C[G]=Y,u.setOrientation(...C))},U=G=>Y=>{Y!==M[G]&&(M[G]=Y,u.setPosition(...M))},W=(G,Y,j)=>{const z=e(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Y});z.connect(x,0,G),z.start(),Object.defineProperty(z.offset,"defaultValue",{get(){return Y}});const X=i({context:c},T,z.offset,ne,le);return a(X,"value",Q=>()=>Q.call(X),Q=>et=>{try{Q.call(X,et)}catch(I){if(I.code!==9)throw I}R(),T&&j(et)}),X.cancelAndHoldAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.cancelAndHoldAtTime),X.cancelScheduledValues=(Q=>T?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.cancelScheduledValues),X.exponentialRampToValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.exponentialRampToValueAtTime),X.linearRampToValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.linearRampToValueAtTime),X.setTargetAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.setTargetAtTime),X.setValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.setValueAtTime),X.setValueCurveAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const I=Q.apply(X,et);return R(),I})(X.setValueCurveAtTime),X};return{forwardX:W(0,0,P(0)),forwardY:W(1,0,P(1)),forwardZ:W(2,-1,P(2)),positionX:W(6,0,U(0)),positionY:W(7,0,U(1)),positionZ:W(8,0,U(2)),upX:W(3,0,P(3)),upY:W(4,1,P(4)),upZ:W(5,0,P(5))}},{forwardX:d,forwardY:p,forwardZ:m,positionX:f,positionY:_,positionZ:y,upX:w,upY:b,upZ:v}=u.forwardX===void 0?h():u;return{get forwardX(){return d},get forwardY(){return p},get forwardZ(){return m},get positionX(){return f},get positionY(){return _},get positionZ(){return y},get upX(){return w},get upY(){return b},get upZ(){return v}}},zr=i=>"context"in i,or=i=>zr(i[0]),fn=(i,t,e,s)=>{for(const n of i)if(e(n)){if(s)return!1;throw Error("The set contains at least one similar element.")}return i.add(t),!0},hl=(i,t,[e,s],n)=>{fn(i,[t,e,s],r=>r[0]===t&&r[1]===e,n)},dl=(i,[t,e,s],n)=>{const r=i.get(t);r===void 0?i.set(t,new Set([[e,s]])):fn(r,[e,s],o=>o[0]===e,n)},Xn=i=>"inputs"in i,jr=(i,t,e,s)=>{if(Xn(t)){const n=t.inputs[s];return i.connect(n,e,0),[n,e,0]}return i.connect(t,e,s),[t,e,s]},vu=(i,t,e)=>{for(const s of i)if(s[0]===t&&s[1]===e)return i.delete(s),s;return null},tp=(i,t,e)=>vo(i,s=>s[0]===t&&s[1]===e),ku=(i,t)=>{if(!nr(i).delete(t))throw new Error("Missing the expected event listener.")},xu=(i,t,e)=>{const s=je(i,t),n=vo(s,r=>r[0]===e);return s.size===0&&i.delete(t),n},Br=(i,t,e,s)=>{Xn(t)?i.disconnect(t.inputs[s],e,0):i.disconnect(t,e,s)},Dt=i=>je(Fa,i),Ei=i=>je(La,i),on=i=>ua.has(i),Pr=i=>!Ln.has(i),fl=(i,t)=>new Promise(e=>{if(t!==null)e(!0);else{const s=i.createScriptProcessor(256,1,1),n=i.createGain(),r=i.createBuffer(1,2,44100),o=r.getChannelData(0);o[0]=1,o[1]=1;const a=i.createBufferSource();a.buffer=r,a.loop=!0,a.connect(s).connect(i.destination),a.connect(n),a.disconnect(n),s.onaudioprocess=c=>{const l=c.inputBuffer.getChannelData(0);Array.prototype.some.call(l,u=>u===1)?e(!0):e(!1),a.stop(),s.onaudioprocess=null,a.disconnect(s),s.disconnect(i.destination)},a.start()}}),Yo=(i,t)=>{const e=new Map;for(const s of i)for(const n of s){const r=e.get(n);e.set(n,r===void 0?1:r+1)}e.forEach((s,n)=>t(n,s))},qr=i=>"context"in i,ep=i=>{const t=new Map;i.connect=(e=>(s,n=0,r=0)=>{const o=qr(s)?e(s,n,r):e(s,n),a=t.get(s);return a===void 0?t.set(s,[{input:r,output:n}]):a.every(c=>c.input!==r||c.output!==n)&&a.push({input:r,output:n}),o})(i.connect.bind(i)),i.disconnect=(e=>(s,n,r)=>{if(e.apply(i),s===void 0)t.clear();else if(typeof s=="number")for(const[o,a]of t){const c=a.filter(l=>l.output!==s);c.length===0?t.delete(o):t.set(o,c)}else if(t.has(s))if(n===void 0)t.delete(s);else{const o=t.get(s);if(o!==void 0){const a=o.filter(c=>c.output!==n&&(c.input!==r||r===void 0));a.length===0?t.delete(s):t.set(s,a)}}for(const[o,a]of t)a.forEach(c=>{qr(o)?i.connect(o,c.output,c.input):i.connect(o,c.output)})})(i.disconnect)},sp=(i,t,e,s)=>{const{activeInputs:n,passiveInputs:r}=rr(t),{outputs:o}=re(i),a=nr(i),c=l=>{const u=Dt(i),h=Ei(t);if(l){const d=xu(r,i,e);hl(n,i,d,!1),!s&&!on(i)&&u.connect(h,e)}else{const d=tp(n,i,e);dl(r,d,!1),!s&&!on(i)&&u.disconnect(h,e)}};return fn(o,[t,e],l=>l[0]===t&&l[1]===e,!0)?(a.add(c),ds(i)?hl(n,i,[e,c],!0):dl(r,[i,e,c],!0),!0):!1},np=(i,t,e,s)=>{const{activeInputs:n,passiveInputs:r}=re(t),o=vu(n[s],i,e);return o===null?[mu(r,i,e,s)[2],!1]:[o[2],!0]},ip=(i,t,e)=>{const{activeInputs:s,passiveInputs:n}=rr(t),r=vu(s,i,e);return r===null?[xu(n,i,e)[1],!1]:[r[2],!0]},Ua=(i,t,e,s,n)=>{const[r,o]=np(i,e,s,n);if(r!==null&&(ku(i,r),o&&!t&&!on(i)&&Br(Dt(i),Dt(e),s,n)),ds(e)){const{activeInputs:a}=re(e);fa(e,a)}},za=(i,t,e,s)=>{const[n,r]=ip(i,e,s);n!==null&&(ku(i,n),r&&!t&&!on(i)&&Dt(i).disconnect(Ei(e),s))},rp=(i,t)=>{const e=re(i),s=[];for(const n of e.outputs)or(n)?Ua(i,t,...n):za(i,t,...n),s.push(n[0]);return e.outputs.clear(),s},op=(i,t,e)=>{const s=re(i),n=[];for(const r of s.outputs)r[1]===e&&(or(r)?Ua(i,t,...r):za(i,t,...r),n.push(r[0]),s.outputs.delete(r));return n},ap=(i,t,e,s,n)=>{const r=re(i);return Array.from(r.outputs).filter(o=>o[0]===e&&(s===void 0||o[1]===s)&&(n===void 0||o[2]===n)).map(o=>(or(o)?Ua(i,t,...o):za(i,t,...o),r.outputs.delete(o),o[0]))},cp=(i,t,e,s,n,r,o,a,c,l,u,h,d,p,m,f)=>class extends l{constructor(y,w,b,v){super(b),this._context=y,this._nativeAudioNode=b;const g=u(y);h(g)&&e(fl,()=>fl(g,f))!==!0&&ep(b),Fa.set(this,b),fu.set(this,new Set),y.state!=="closed"&&w&&Vn(this),i(this,v,b)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(y){this._nativeAudioNode.channelCount=y}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(y){this._nativeAudioNode.channelCountMode=y}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(y){this._nativeAudioNode.channelInterpretation=y}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(y,w=0,b=0){if(w<0||w>=this._nativeAudioNode.numberOfOutputs)throw n();const v=u(this._context),g=m(v);if(d(y)||p(y))throw r();if(zr(y)){const k=Dt(y);try{const M=jr(this._nativeAudioNode,k,w,b),R=Pr(this);(g||R)&&this._nativeAudioNode.disconnect(...M),this.context.state!=="closed"&&!R&&Pr(y)&&Vn(y)}catch(M){throw M.code===12?r():M}if(t(this,y,w,b,g)){const M=c([this],y);Yo(M,s(g))}return y}const x=Ei(y);if(x.name==="playbackRate"&&x.maxValue===1024)throw o();try{this._nativeAudioNode.connect(x,w),(g||Pr(this))&&this._nativeAudioNode.disconnect(x,w)}catch(k){throw k.code===12?r():k}if(sp(this,y,w,g)){const k=c([this],y);Yo(k,s(g))}}disconnect(y,w,b){let v;const g=u(this._context),x=m(g);if(y===void 0)v=rp(this,x);else if(typeof y=="number"){if(y<0||y>=this.numberOfOutputs)throw n();v=op(this,x,y)}else{if(w!==void 0&&(w<0||w>=this.numberOfOutputs)||zr(y)&&b!==void 0&&(b<0||b>=y.numberOfInputs))throw n();if(v=ap(this,x,y,w,b),v.length===0)throw r()}for(const T of v){const k=c([this],T);Yo(k,a)}}},lp=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>(p,m,f,_=null,y=null)=>{const w=f.value,b=new v0(w),v=m?s(b):null,g={get defaultValue(){return w},get maxValue(){return _===null?f.maxValue:_},get minValue(){return y===null?f.minValue:y},get value(){return f.value},set value(x){f.value=x,g.setValueAtTime(x,p.context.currentTime)},cancelAndHoldAtTime(x){if(typeof f.cancelAndHoldAtTime=="function")v===null&&b.flush(p.context.currentTime),b.add(n(x)),f.cancelAndHoldAtTime(x);else{const T=Array.from(b).pop();v===null&&b.flush(p.context.currentTime),b.add(n(x));const k=Array.from(b).pop();f.cancelScheduledValues(x),T!==k&&k!==void 0&&(k.type==="exponentialRampToValue"?f.exponentialRampToValueAtTime(k.value,k.endTime):k.type==="linearRampToValue"?f.linearRampToValueAtTime(k.value,k.endTime):k.type==="setValue"?f.setValueAtTime(k.value,k.startTime):k.type==="setValueCurve"&&f.setValueCurveAtTime(k.values,k.startTime,k.duration))}return g},cancelScheduledValues(x){return v===null&&b.flush(p.context.currentTime),b.add(r(x)),f.cancelScheduledValues(x),g},exponentialRampToValueAtTime(x,T){if(x===0)throw new RangeError;if(!Number.isFinite(T)||T<0)throw new RangeError;const k=p.context.currentTime;return v===null&&b.flush(k),Array.from(b).length===0&&(b.add(l(w,k)),f.setValueAtTime(w,k)),b.add(o(x,T)),f.exponentialRampToValueAtTime(x,T),g},linearRampToValueAtTime(x,T){const k=p.context.currentTime;return v===null&&b.flush(k),Array.from(b).length===0&&(b.add(l(w,k)),f.setValueAtTime(w,k)),b.add(a(x,T)),f.linearRampToValueAtTime(x,T),g},setTargetAtTime(x,T,k){return v===null&&b.flush(p.context.currentTime),b.add(c(x,T,k)),f.setTargetAtTime(x,T,k),g},setValueAtTime(x,T){return v===null&&b.flush(p.context.currentTime),b.add(l(x,T)),f.setValueAtTime(x,T),g},setValueCurveAtTime(x,T,k){const C=x instanceof Float32Array?x:new Float32Array(x);if(h!==null&&h.name==="webkitAudioContext"){const M=T+k,R=p.context.sampleRate,P=Math.ceil(T*R),U=Math.floor(M*R),W=U-P,G=new Float32Array(W);for(let j=0;j({replay(t){for(const e of i)if(e.type==="exponentialRampToValue"){const{endTime:s,value:n}=e;t.exponentialRampToValueAtTime(n,s)}else if(e.type==="linearRampToValue"){const{endTime:s,value:n}=e;t.linearRampToValueAtTime(n,s)}else if(e.type==="setTarget"){const{startTime:s,target:n,timeConstant:r}=e;t.setTargetAtTime(n,s,r)}else if(e.type==="setValue"){const{startTime:s,value:n}=e;t.setValueAtTime(n,s)}else if(e.type==="setValueCurve"){const{duration:s,startTime:n,values:r}=e;t.setValueCurveAtTime(r,n,s)}else throw new Error("Can't apply an unknown automation.")}});class Tu{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(t,e=null){return this._map.forEach((s,n)=>t.call(e,s,n,this))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}const hp={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},dp=(i,t,e,s,n,r,o,a,c,l,u,h,d,p)=>class extends t{constructor(f,_,y){var w;const b=a(f),v=c(b),g=u({...hp,...y});d(g);const x=ha.get(b),T=x==null?void 0:x.get(_),k=v||b.state!=="closed"?b:(w=o(b))!==null&&w!==void 0?w:b,C=n(k,v?null:f.baseLatency,l,_,T,g),M=v?s(_,g,T):null;super(f,!0,C,M);const R=[];C.parameters.forEach((U,W)=>{const G=e(this,v,U);R.push([W,G])}),this._nativeAudioWorkletNode=C,this._onprocessorerror=null,this._parameters=new Tu(R),v&&i(b,this);const{activeInputs:P}=r(this);h(C,P)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(f){const _=typeof f=="function"?p(this,f):null;this._nativeAudioWorkletNode.onprocessorerror=_;const y=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=y!==null&&y===_?f:y}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function Wr(i,t,e,s,n){if(typeof i.copyFromChannel=="function")t[e].byteLength===0&&(t[e]=new Float32Array(128)),i.copyFromChannel(t[e],s,n);else{const r=i.getChannelData(s);if(t[e].byteLength===0)t[e]=r.slice(n,n+128);else{const o=new Float32Array(r.buffer,n*Float32Array.BYTES_PER_ELEMENT,128);t[e].set(o)}}}const wu=(i,t,e,s,n)=>{typeof i.copyToChannel=="function"?t[e].byteLength!==0&&i.copyToChannel(t[e],s,n):t[e].byteLength!==0&&i.getChannelData(s).set(t[e],n)},Hr=(i,t)=>{const e=[];for(let s=0;s{const e=je(da,i),s=Dt(t);return je(e,s)},pp=async(i,t,e,s,n,r,o)=>{const a=t===null?Math.ceil(i.context.length/128)*128:t.length,c=s.channelCount*s.numberOfInputs,l=n.reduce((_,y)=>_+y,0),u=l===0?null:e.createBuffer(l,a,e.sampleRate);if(r===void 0)throw new Error("Missing the processor constructor.");const h=re(i),d=await fp(e,i),p=Hr(s.numberOfInputs,s.channelCount),m=Hr(s.numberOfOutputs,n),f=Array.from(i.parameters.keys()).reduce((_,y)=>({..._,[y]:new Float32Array(128)}),{});for(let _=0;_0&&t!==null)for(let y=0;y{Wr(t,f,y,c+w,_)});for(let y=0;yh.activeInputs[v].size===0?[]:b),w=o(_/e.sampleRate,e.sampleRate,()=>d.process(y,m,f));if(u!==null)for(let b=0,v=0;b(_,y,w)=>{const b=new WeakMap;let v=null;const g=async(x,T)=>{let k=u(x),C=null;const M=se(k,T),R=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(h===null){const P=R.reduce((Y,j)=>Y+j,0),U=n(T,{channelCount:Math.max(1,P),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,P)}),W=[];for(let Y=0;Y{const et=new d(X,Math.ceil(x.context.length/128)*128,T.sampleRate),I=[],F=[];for(let H=0;H{const N=r(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:H.value});return await p(et,H,N.offset),N})),D=s(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,j+z)});for(let H=0;Hm(x,et,H))),f(et)})(),T,y,R,w,l)}const P=await v,U=e(T,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[W,G,Y]=C;P!==null&&(U.buffer=P,U.start(0)),U.connect(W);for(let j=0,z=0;jclass extends m{constructor(g,x){super(g,x),this._nativeContext=g,this._audioWorklet=i===void 0?void 0:{addModule:(T,k)=>i(this,T,k)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new n(this)}createBuffer(g,x,T){return new e({length:x,numberOfChannels:g,sampleRate:T})}createBufferSource(){return new s(this)}createChannelMerger(g=6){return new r(this,{numberOfInputs:g})}createChannelSplitter(g=6){return new o(this,{numberOfOutputs:g})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(g=1){return new u(this,{maxDelayTime:g})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(g,x){return new p(this,{feedback:x,feedforward:g})}createOscillator(){return new f(this)}createPanner(){return new _(this)}createPeriodicWave(g,x,T={disableNormalization:!1}){return new y(this,{...T,imag:x,real:g})}createStereoPanner(){return new w(this)}createWaveShaper(){return new b(this)}decodeAudioData(g,x,T){return l(this._nativeContext,g).then(k=>(typeof x=="function"&&x(k),k),k=>{throw typeof T=="function"&&T(k),k})}},gp={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},yp=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...gp,...u},p=n(h,d),m=o(h),f=m?e():null;super(l,!1,p,f),this._Q=t(this,m,p.Q,ne,le),this._detune=t(this,m,p.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,m,p.frequency,l.sampleRate/2,0),this._gain=t(this,m,p.gain,40*Math.log10(ne),le),this._nativeBiquadFilterNode=p,a(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(l){this._nativeBiquadFilterNode.type=l}getFrequencyResponse(l,u,h){try{this._nativeBiquadFilterNode.getFrequencyResponse(l,u,h)}catch(d){throw d.code===11?s():d}if(l.length!==u.length||u.length!==h.length)throw s()}},vp=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(c,h)}return r.set(c,l),u?(await i(c,a.Q,l.Q),await i(c,a.detune,l.detune),await i(c,a.frequency,l.frequency),await i(c,a.gain,l.gain)):(await s(c,a.Q,l.Q),await s(c,a.detune,l.detune),await s(c,a.frequency,l.frequency),await s(c,a.gain,l.gain)),await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},kp=(i,t)=>(e,s)=>{const n=t.get(e);if(n!==void 0)return n;const r=i.get(e);if(r!==void 0)return r;try{const o=s();return o instanceof Promise?(i.set(e,o),o.catch(()=>!1).then(a=>(i.delete(e),t.set(e,a),a))):(t.set(e,o),o)}catch{return t.set(e,!1),!1}},xp={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},Tp=(i,t,e,s,n)=>class extends i{constructor(o,a){const c=s(o),l={...xp,...a},u=e(c,l),h=n(c)?t():null;super(o,!1,u,h)}},wp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},bp={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},Cp=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u=r({...bp,...c}),h=e(l,u),d=n(l)?t():null;super(a,!1,h,d)}},Sp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Ep=i=>(t,e,s)=>i(e,t,s),Op=i=>(t,e,s=0,n=0)=>{const r=t[s];if(r===void 0)throw i();return qr(e)?r.connect(e,0,n):r.connect(e,0)},Ap=i=>(t,e)=>{const s=i(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),n=t.createBuffer(1,2,44100);return s.buffer=n,s.loop=!0,s.connect(e),s.start(),()=>{s.stop(),s.disconnect(e)}},Mp={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},Dp=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...Mp,...l},d=s(u,h),p=r(u),m=p?e():null;super(c,!1,d,m),this._constantSourceNodeRenderer=m,this._nativeConstantSourceNode=d,this._offset=t(this,p,d.offset,ne,le),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(c){const l=typeof c=="function"?o(this,c):null;this._nativeConstantSourceNode.onended=l;const u=this._nativeConstantSourceNode.onended;this._onended=u!==null&&u===l?c:u}start(c=0){if(this._nativeConstantSourceNode.start(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=c),this.context.state!=="closed"){Vn(this);const l=()=>{this._nativeConstantSourceNode.removeEventListener("ended",l),ds(this)&&ir(this)};this._nativeConstantSourceNode.addEventListener("ended",l)}}stop(c=0){this._nativeConstantSourceNode.stop(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=c)}},Pp=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=e(l);const d=se(h,u);if(!d){const p={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,offset:h.offset.value};h=t(u,p),o!==null&&h.start(o),a!==null&&h.stop(a)}return r.set(u,h),d?await i(u,l.offset,h.offset):await s(u,l.offset,h.offset),await n(l,u,h),h};return{set start(l){o=l},set stop(l){a=l},render(l,u){const h=r.get(u);return h!==void 0?Promise.resolve(h):c(l,u)}}},Np=i=>t=>(i[0]=t,i[0]),Ip={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},Rp=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u={...Ip,...c},h=e(l,u),p=n(l)?t():null;super(a,!1,h,p),this._isBufferNullified=!1,this._nativeConvolverNode=h,u.buffer!==null&&r(this,u.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(a){if(this._nativeConvolverNode.buffer=a,a===null&&this._nativeConvolverNode.buffer!==null){const c=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=c.createBuffer(1,1,c.sampleRate),this._isBufferNullified=!0,r(this,0)}else this._isBufferNullified=!1,r(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(a){this._nativeConvolverNode.normalize=a}},Fp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=i(o,l)}return s.set(o,a),Xn(a)?await e(r,o,a.inputs[0]):await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Lp=(i,t)=>(e,s,n)=>{if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(e,s,n)}catch(r){throw r.name==="SyntaxError"?i():r}},Vp=()=>new DOMException("","DataCloneError"),pl=i=>{const{port1:t,port2:e}=new MessageChannel;return new Promise(s=>{const n=()=>{e.onmessage=null,t.close(),e.close(),s()};e.onmessage=()=>n();try{t.postMessage(i,[i])}catch{}finally{n()}})},Up=(i,t,e,s,n,r,o,a,c,l,u)=>(h,d)=>{const p=o(h)?h:r(h);if(n.has(d)){const m=e();return Promise.reject(m)}try{n.add(d)}catch{}return t(c,()=>c(p))?p.decodeAudioData(d).then(m=>(pl(d).catch(()=>{}),t(a,()=>a(m))||u(m),i.add(m),m)):new Promise((m,f)=>{const _=async()=>{try{await pl(d)}catch{}},y=w=>{f(w),_()};try{p.decodeAudioData(d,w=>{typeof w.copyFromChannel!="function"&&(l(w),Va(w)),i.add(w),_().then(()=>m(w))},w=>{y(w===null?s():w)})}catch(w){y(w)}})},zp=(i,t,e,s,n,r,o,a)=>(c,l)=>{const u=t.get(c);if(u===void 0)throw new Error("Missing the expected cycle count.");const h=r(c.context),d=a(h);if(u===l){if(t.delete(c),!d&&o(c)){const p=s(c),{outputs:m}=e(c);for(const f of m)if(or(f)){const _=s(f[0]);i(p,_,f[1],f[2])}else{const _=n(f[0]);p.connect(_,f[1])}}}else t.set(c,u-l)},jp={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},Bp=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...jp,...l},d=s(u,h),p=r(u),m=p?e(h.maxDelayTime):null;super(c,!1,d,m),this._delayTime=t(this,p,d.delayTime),o(this,h.maxDelayTime)}get delayTime(){return this._delayTime}},qp=(i,t,e,s,n)=>r=>{const o=new WeakMap,a=async(c,l)=>{let u=e(c);const h=se(u,l);if(!h){const d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:r};u=t(l,d)}return o.set(l,u),h?await i(l,c.delayTime,u.delayTime):await s(l,c.delayTime,u.delayTime),await n(c,l,u),u};return{render(c,l){const u=o.get(l);return u!==void 0?Promise.resolve(u):a(c,l)}}},Wp=i=>(t,e,s,n)=>i(t[n],r=>r[0]===e&&r[1]===s),Hp=i=>(t,e)=>{i(t).delete(e)},Yp=i=>"delayTime"in i,Gp=(i,t,e)=>function s(n,r){const o=zr(r)?r:e(i,r);if(Yp(o))return[];if(n[0]===o)return[n];if(n.includes(o))return[];const{outputs:a}=t(o);return Array.from(a).map(c=>s([...n,o],c[0])).reduce((c,l)=>c.concat(l),[])},br=(i,t,e)=>{const s=t[e];if(s===void 0)throw i();return s},$p=i=>(t,e=void 0,s=void 0,n=0)=>e===void 0?t.forEach(r=>r.disconnect()):typeof e=="number"?br(i,t,e).disconnect():qr(e)?s===void 0?t.forEach(r=>r.disconnect(e)):n===void 0?br(i,t,s).disconnect(e,0):br(i,t,s).disconnect(e,0,n):s===void 0?t.forEach(r=>r.disconnect(e)):br(i,t,s).disconnect(e,0),Xp={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Zp=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...Xp,...u},p=s(h,d),m=o(h),f=m?e():null;super(l,!1,p,f),this._attack=t(this,m,p.attack),this._knee=t(this,m,p.knee),this._nativeDynamicsCompressorNode=p,this._ratio=t(this,m,p.ratio),this._release=t(this,m,p.release),this._threshold=t(this,m,p.threshold),a(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(l){const u=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=l,l>2)throw this._nativeDynamicsCompressorNode.channelCount=u,n()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(l){const u=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=l,l==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=u,n()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return typeof this._nativeDynamicsCompressorNode.reduction.value=="number"?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},Qp=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(c,h)}return r.set(c,l),u?(await i(c,a.attack,l.attack),await i(c,a.knee,l.knee),await i(c,a.ratio,l.ratio),await i(c,a.release,l.release),await i(c,a.threshold,l.threshold)):(await s(c,a.attack,l.attack),await s(c,a.knee,l.knee),await s(c,a.ratio,l.ratio),await s(c,a.release,l.release),await s(c,a.threshold,l.threshold)),await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Kp=()=>new DOMException("","EncodingError"),Jp=i=>t=>new Promise((e,s)=>{if(i===null){s(new SyntaxError);return}const n=i.document.head;if(n===null)s(new SyntaxError);else{const r=i.document.createElement("script"),o=new Blob([t],{type:"application/javascript"}),a=URL.createObjectURL(o),c=i.onerror,l=()=>{i.onerror=c,URL.revokeObjectURL(a)};i.onerror=(u,h,d,p,m)=>{if(h===a||h===i.location.href&&d===1&&p===1)return l(),s(m),!1;if(c!==null)return c(u,h,d,p,m)},r.onerror=()=>{l(),s(new SyntaxError)},r.onload=()=>{l(),e()},r.src=a,r.type="module",n.appendChild(r)}}),tm=i=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(e,s,n){if(s!==null){let r=this._listeners.get(s);r===void 0&&(r=i(this,s),typeof s=="function"&&this._listeners.set(s,r)),this._nativeEventTarget.addEventListener(e,r,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,s,n){const r=s===null?void 0:this._listeners.get(s);this._nativeEventTarget.removeEventListener(e,r===void 0?null:r,n)}},em=i=>(t,e,s)=>{Object.defineProperties(i,{currentFrame:{configurable:!0,get(){return Math.round(t*e)}},currentTime:{configurable:!0,get(){return t}}});try{return s()}finally{i!==null&&(delete i.currentFrame,delete i.currentTime)}},sm=i=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw i()},nm={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},im=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...nm,...c},h=s(l,u),d=r(l),p=d?e():null;super(a,!1,h,p),this._gain=t(this,d,h.gain,ne,le)}get gain(){return this._gain}},rm=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(c,h)}return r.set(c,l),u?await i(c,a.gain,l.gain):await s(c,a.gain,l.gain),await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},om=(i,t)=>e=>t(i,e),am=i=>t=>{const e=i(t);if(e.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return e.renderer},cm=i=>t=>{var e;return(e=i.get(t))!==null&&e!==void 0?e:0},lm=i=>t=>{const e=i(t);if(e.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return e.renderer},um=i=>t=>i.get(t),Xt=()=>new DOMException("","InvalidStateError"),hm=i=>t=>{const e=i.get(t);if(e===void 0)throw Xt();return e},dm=(i,t)=>e=>{let s=i.get(e);if(s!==void 0)return s;if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new t(1,1,44100),i.set(e,s),s},fm=i=>t=>{const e=i.get(t);if(e===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return e},ko=()=>new DOMException("","InvalidAccessError"),pm=i=>{i.getFrequencyResponse=(t=>(e,s,n)=>{if(e.length!==s.length||s.length!==n.length)throw ko();return t.call(i,e,s,n)})(i.getFrequencyResponse)},mm={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},_m=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u=n(l),h={...mm,...c},d=t(l,u?null:a.baseLatency,h),p=u?e(h.feedback,h.feedforward):null;super(a,!1,d,p),pm(d),this._nativeIIRFilterNode=d,r(this,1)}getFrequencyResponse(a,c,l){return this._nativeIIRFilterNode.getFrequencyResponse(a,c,l)}},bu=(i,t,e,s,n,r,o,a,c,l,u)=>{const h=l.length;let d=a;for(let p=0;p{const n=e instanceof Float64Array?e:new Float64Array(e),r=s instanceof Float64Array?s:new Float64Array(s),o=n.length,a=r.length,c=Math.min(o,a);if(n[0]!==1){for(let m=0;m(r,o)=>{const a=new WeakMap;let c=null;const l=async(u,h)=>{let d=null,p=t(u);const m=se(p,h);if(h.createIIRFilter===void 0?d=i(h,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):m||(p=h.createIIRFilter(o,r)),a.set(h,d===null?p:d),d!==null){if(c===null){if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");const _=new e(u.context.destination.channelCount,u.context.length,h.sampleRate);c=(async()=>{await s(u,_,_.destination);const y=await n(_);return gm(y,h,r,o)})()}const f=await c;return d.buffer=f,d.start(0),d}return await s(u,h,p),p};return{render(u,h){const d=a.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},vm=(i,t,e,s,n,r)=>o=>(a,c)=>{const l=i.get(a);if(l===void 0){if(!o&&r(a)){const u=s(a),{outputs:h}=e(a);for(const d of h)if(or(d)){const p=s(d[0]);t(u,p,d[1],d[2])}else{const p=n(d[0]);u.disconnect(p,d[1])}}i.set(a,c)}else i.set(a,l+c)},km=(i,t)=>e=>{const s=i.get(e);return t(s)||t(e)},xm=(i,t)=>e=>i.has(e)||t(e),Tm=(i,t)=>e=>i.has(e)||t(e),wm=(i,t)=>e=>{const s=i.get(e);return t(s)||t(e)},bm=i=>t=>i!==null&&t instanceof i,Cm=i=>t=>i!==null&&typeof i.AudioNode=="function"&&t instanceof i.AudioNode,Sm=i=>t=>i!==null&&typeof i.AudioParam=="function"&&t instanceof i.AudioParam,Em=(i,t)=>e=>i(e)||t(e),Om=i=>t=>i!==null&&t instanceof i,Am=i=>i!==null&&i.isSecureContext,Mm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r),c=t(a,o);if(s(a))throw TypeError();super(r,!0,c,null),this._nativeMediaElementAudioSourceNode=c}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},Dm={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},Pm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r);if(s(a))throw new TypeError;const c={...Dm,...o},l=t(a,c);super(r,!1,l,null),this._nativeMediaStreamAudioDestinationNode=l}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},Nm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r),c=t(a,o);if(s(a))throw new TypeError;super(r,!0,c,null),this._nativeMediaStreamAudioSourceNode=c}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},Im=(i,t,e)=>class extends i{constructor(n,r){const o=e(n),a=t(o,r);super(n,!0,a,null)}},Rm=(i,t,e,s,n,r)=>class extends e{constructor(a,c){super(a),this._nativeContext=a,yo.set(this,a),s(a)&&n.set(a,new Set),this._destination=new i(this,c),this._listener=t(this,a),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(a){const c=typeof a=="function"?r(this,a):null;this._nativeContext.onstatechange=c;const l=this._nativeContext.onstatechange;this._onstatechange=l!==null&&l===c?a:l}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},Oi=i=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const e=i.decodeAudioData(t.buffer,()=>{});return e===void 0?!1:(e.catch(()=>{}),!0)}catch{}return!1},Fm=(i,t)=>(e,s,n)=>{const r=new Set;return e.connect=(o=>(a,c=0,l=0)=>{const u=r.size===0;if(t(a))return o.call(e,a,c,l),i(r,[a,c,l],h=>h[0]===a&&h[1]===c&&h[2]===l,!0),u&&s(),a;o.call(e,a,c),i(r,[a,c],h=>h[0]===a&&h[1]===c,!0),u&&s()})(e.connect),e.disconnect=(o=>(a,c,l)=>{const u=r.size>0;if(a===void 0)o.apply(e),r.clear();else if(typeof a=="number"){o.call(e,a);for(const d of r)d[1]===a&&r.delete(d)}else{t(a)?o.call(e,a,c,l):o.call(e,a,c);for(const d of r)d[0]===a&&(c===void 0||d[1]===c)&&(l===void 0||d[2]===l)&&r.delete(d)}const h=r.size===0;u&&h&&n()})(e.disconnect),e},Pt=(i,t,e)=>{const s=t[e];s!==void 0&&s!==i[e]&&(i[e]=s)},Gt=(i,t)=>{Pt(i,t,"channelCount"),Pt(i,t,"channelCountMode"),Pt(i,t,"channelInterpretation")},ml=i=>typeof i.getFloatTimeDomainData=="function",Lm=i=>{i.getFloatTimeDomainData=t=>{const e=new Uint8Array(t.length);i.getByteTimeDomainData(e);const s=Math.max(e.length,i.fftSize);for(let n=0;n(e,s)=>{const n=e.createAnalyser();if(Gt(n,s),!(s.maxDecibels>s.minDecibels))throw t();return Pt(n,s,"fftSize"),Pt(n,s,"maxDecibels"),Pt(n,s,"minDecibels"),Pt(n,s,"smoothingTimeConstant"),i(ml,()=>ml(n))||Lm(n),n},Um=i=>i===null?null:i.hasOwnProperty("AudioBuffer")?i.AudioBuffer:null,Ft=(i,t,e)=>{const s=t[e];s!==void 0&&s!==i[e].value&&(i[e].value=s)},zm=i=>{i.start=(t=>{let e=!1;return(s=0,n=0,r)=>{if(e)throw Xt();t.call(i,s,n,r),e=!0}})(i.start)},ja=i=>{i.start=(t=>(e=0,s=0,n)=>{if(typeof n=="number"&&n<0||s<0||e<0)throw new RangeError("The parameters can't be negative.");t.call(i,e,s,n)})(i.start)},Ba=i=>{i.stop=(t=>(e=0)=>{if(e<0)throw new RangeError("The parameter can't be negative.");t.call(i,e)})(i.stop)},jm=(i,t,e,s,n,r,o,a,c,l,u)=>(h,d)=>{const p=h.createBufferSource();return Gt(p,d),Ft(p,d,"playbackRate"),Pt(p,d,"buffer"),Pt(p,d,"loop"),Pt(p,d,"loopEnd"),Pt(p,d,"loopStart"),t(e,()=>e(h))||zm(p),t(s,()=>s(h))||c(p),t(n,()=>n(h))||l(p,h),t(r,()=>r(h))||ja(p),t(o,()=>o(h))||u(p,h),t(a,()=>a(h))||Ba(p),i(h,p),p},Bm=i=>i===null?null:i.hasOwnProperty("AudioContext")?i.AudioContext:i.hasOwnProperty("webkitAudioContext")?i.webkitAudioContext:null,qm=(i,t)=>(e,s,n)=>{const r=e.destination;if(r.channelCount!==s)try{r.channelCount=s}catch{}n&&r.channelCountMode!=="explicit"&&(r.channelCountMode="explicit"),r.maxChannelCount===0&&Object.defineProperty(r,"maxChannelCount",{value:s});const o=i(e,{channelCount:s,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return t(o,"channelCount",a=>()=>a.call(o),a=>c=>{a.call(o,c);try{r.channelCount=c}catch(l){if(c>r.maxChannelCount)throw l}}),t(o,"channelCountMode",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelCountMode=c}),t(o,"channelInterpretation",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelInterpretation=c}),Object.defineProperty(o,"maxChannelCount",{get:()=>r.maxChannelCount}),o.connect(r),o},Wm=i=>i===null?null:i.hasOwnProperty("AudioWorkletNode")?i.AudioWorkletNode:null,Hm=i=>{const{port1:t}=new MessageChannel;try{t.postMessage(i)}finally{t.close()}},Ym=(i,t,e,s,n)=>(r,o,a,c,l,u)=>{if(a!==null)try{const h=new a(r,c,u),d=new Map;let p=null;if(Object.defineProperties(h,{channelCount:{get:()=>u.channelCount,set:()=>{throw i()}},channelCountMode:{get:()=>"explicit",set:()=>{throw i()}},onprocessorerror:{get:()=>p,set:m=>{typeof p=="function"&&h.removeEventListener("processorerror",p),p=typeof m=="function"?m:null,typeof p=="function"&&h.addEventListener("processorerror",p)}}}),h.addEventListener=(m=>(...f)=>{if(f[0]==="processorerror"){const _=typeof f[1]=="function"?f[1]:typeof f[1]=="object"&&f[1]!==null&&typeof f[1].handleEvent=="function"?f[1].handleEvent:null;if(_!==null){const y=d.get(f[1]);y!==void 0?f[1]=y:(f[1]=w=>{w.type==="error"?(Object.defineProperties(w,{type:{value:"processorerror"}}),_(w)):_(new ErrorEvent(f[0],{...w}))},d.set(_,f[1]))}}return m.call(h,"error",f[1],f[2]),m.call(h,...f)})(h.addEventListener),h.removeEventListener=(m=>(...f)=>{if(f[0]==="processorerror"){const _=d.get(f[1]);_!==void 0&&(d.delete(f[1]),f[1]=_)}return m.call(h,"error",f[1],f[2]),m.call(h,f[0],f[1],f[2])})(h.removeEventListener),u.numberOfOutputs!==0){const m=e(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return h.connect(m).connect(r.destination),n(h,()=>m.disconnect(),()=>m.connect(r.destination))}return h}catch(h){throw h.code===11?s():h}if(l===void 0)throw s();return Hm(u),t(r,o,l,u)},Cu=(i,t)=>i===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(i*t))))),Gm=i=>new Promise((t,e)=>{const{port1:s,port2:n}=new MessageChannel;s.onmessage=({data:r})=>{s.close(),n.close(),t(r)},s.onmessageerror=({data:r})=>{s.close(),n.close(),e(r)},n.postMessage(i)}),$m=async(i,t)=>{const e=await Gm(t);return new i(e)},Xm=(i,t,e,s)=>{let n=da.get(i);n===void 0&&(n=new WeakMap,da.set(i,n));const r=$m(e,s);return n.set(t,r),r},Zm=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>(p,m,f,_)=>{if(_.numberOfInputs===0&&_.numberOfOutputs===0)throw c();const y=Array.isArray(_.outputChannelCount)?_.outputChannelCount:Array.from(_.outputChannelCount);if(y.some(B=>B<1))throw c();if(y.length!==_.numberOfOutputs)throw t();if(_.channelCountMode!=="explicit")throw c();const w=_.channelCount*_.numberOfInputs,b=y.reduce((B,O)=>B+O,0),v=f.parameterDescriptors===void 0?0:f.parameterDescriptors.length;if(w+v>6||b>6)throw c();const g=new MessageChannel,x=[],T=[];for(let B=0;B<_.numberOfInputs;B+=1)x.push(o(p,{channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation,gain:1})),T.push(n(p,{channelCount:_.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:_.channelCount}));const k=[];if(f.parameterDescriptors!==void 0)for(const{defaultValue:B,maxValue:O,minValue:E,name:Z}of f.parameterDescriptors){const tt=r(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:_.parameterData[Z]!==void 0?_.parameterData[Z]:B===void 0?0:B});Object.defineProperties(tt.offset,{defaultValue:{get:()=>B===void 0?0:B},maxValue:{get:()=>O===void 0?ne:O},minValue:{get:()=>E===void 0?le:E}}),k.push(tt)}const C=s(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,w+v)}),M=Cu(m,p.sampleRate),R=a(p,M,w+v,Math.max(1,b)),P=n(p,{channelCount:Math.max(1,b),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,b)}),U=[];for(let B=0;B<_.numberOfOutputs;B+=1)U.push(s(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:y[B]}));for(let B=0;B<_.numberOfInputs;B+=1){x[B].connect(T[B]);for(let O=0;O<_.channelCount;O+=1)T[B].connect(C,O,B*_.channelCount+O)}const W=new Tu(f.parameterDescriptors===void 0?[]:f.parameterDescriptors.map(({name:B},O)=>{const E=k[O];return E.connect(C,0,w+O),E.start(0),[B,E.offset]}));C.connect(R);let G=_.channelInterpretation,Y=null;const j=_.numberOfOutputs===0?[R]:U,z={get bufferSize(){return M},get channelCount(){return _.channelCount},set channelCount(B){throw e()},get channelCountMode(){return _.channelCountMode},set channelCountMode(B){throw e()},get channelInterpretation(){return G},set channelInterpretation(B){for(const O of x)O.channelInterpretation=B;G=B},get context(){return R.context},get inputs(){return x},get numberOfInputs(){return _.numberOfInputs},get numberOfOutputs(){return _.numberOfOutputs},get onprocessorerror(){return Y},set onprocessorerror(B){typeof Y=="function"&&z.removeEventListener("processorerror",Y),Y=typeof B=="function"?B:null,typeof Y=="function"&&z.addEventListener("processorerror",Y)},get parameters(){return W},get port(){return g.port2},addEventListener(...B){return R.addEventListener(B[0],B[1],B[2])},connect:i.bind(null,j),disconnect:l.bind(null,j),dispatchEvent(...B){return R.dispatchEvent(B[0])},removeEventListener(...B){return R.removeEventListener(B[0],B[1],B[2])}},X=new Map;g.port1.addEventListener=(B=>(...O)=>{if(O[0]==="message"){const E=typeof O[1]=="function"?O[1]:typeof O[1]=="object"&&O[1]!==null&&typeof O[1].handleEvent=="function"?O[1].handleEvent:null;if(E!==null){const Z=X.get(O[1]);Z!==void 0?O[1]=Z:(O[1]=tt=>{u(p.currentTime,p.sampleRate,()=>E(tt))},X.set(E,O[1]))}}return B.call(g.port1,O[0],O[1],O[2])})(g.port1.addEventListener),g.port1.removeEventListener=(B=>(...O)=>{if(O[0]==="message"){const E=X.get(O[1]);E!==void 0&&(X.delete(O[1]),O[1]=E)}return B.call(g.port1,O[0],O[1],O[2])})(g.port1.removeEventListener);let Q=null;Object.defineProperty(g.port1,"onmessage",{get:()=>Q,set:B=>{typeof Q=="function"&&g.port1.removeEventListener("message",Q),Q=typeof B=="function"?B:null,typeof Q=="function"&&(g.port1.addEventListener("message",Q),g.port1.start())}}),f.prototype.port=g.port1;let et=null;Xm(p,z,f,_).then(B=>et=B);const F=Hr(_.numberOfInputs,_.channelCount),S=Hr(_.numberOfOutputs,y),D=f.parameterDescriptors===void 0?[]:f.parameterDescriptors.reduce((B,{name:O})=>({...B,[O]:new Float32Array(128)}),{});let H=!0;const N=()=>{_.numberOfOutputs>0&&R.disconnect(P);for(let B=0,O=0;B<_.numberOfOutputs;B+=1){const E=U[B];for(let Z=0;Z{if(et!==null){const E=h(z);for(let Z=0;Z{Wr(B,D,tt,w+lt,Z)});for(let tt=0;tt<_.numberOfInputs;tt+=1)for(let lt=0;lt{if(E[Yt].size>0)return V.set(Yt,M/128),vt;const ti=V.get(Yt);return ti===void 0?[]:(vt.every(Io=>Io.every(fr=>fr===0))&&(ti===1?V.delete(Yt):V.set(Yt,ti-1)),vt)});H=u(p.currentTime+Z/p.sampleRate,p.sampleRate,()=>et.process(tt,S,D));for(let vt=0,Yt=0;vt<_.numberOfOutputs;vt+=1){for(let Ie=0;IeR.connect(st).connect(p.destination),J=()=>{R.disconnect(st),st.disconnect()},pt=()=>{if(H){J(),_.numberOfOutputs>0&&R.connect(P);for(let B=0,O=0;B<_.numberOfOutputs;B+=1){const E=U[B];for(let Z=0;Z{H&&(nt(),N()),it=!1};return nt(),d(z,pt,K)},Su=(i,t)=>{const e=i.createBiquadFilter();return Gt(e,t),Ft(e,t,"Q"),Ft(e,t,"detune"),Ft(e,t,"frequency"),Ft(e,t,"gain"),Pt(e,t,"type"),e},Qm=(i,t)=>(e,s)=>{const n=e.createChannelMerger(s.numberOfInputs);return i!==null&&i.name==="webkitAudioContext"&&t(e,n),Gt(n,s),n},Km=i=>{const t=i.numberOfOutputs;Object.defineProperty(i,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Xt()}}),Object.defineProperty(i,"channelCountMode",{get:()=>"explicit",set:e=>{if(e!=="explicit")throw Xt()}}),Object.defineProperty(i,"channelInterpretation",{get:()=>"discrete",set:e=>{if(e!=="discrete")throw Xt()}})},ar=(i,t)=>{const e=i.createChannelSplitter(t.numberOfOutputs);return Gt(e,t),Km(e),e},Jm=(i,t,e,s,n)=>(r,o)=>{if(r.createConstantSource===void 0)return e(r,o);const a=r.createConstantSource();return Gt(a,o),Ft(a,o,"offset"),t(s,()=>s(r))||ja(a),t(n,()=>n(r))||Ba(a),i(r,a),a},Zn=(i,t)=>(i.connect=t.connect.bind(t),i.disconnect=t.disconnect.bind(t),i),t_=(i,t,e,s)=>(n,{offset:r,...o})=>{const a=n.createBuffer(1,2,44100),c=t(n,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=e(n,{...o,gain:r}),u=a.getChannelData(0);u[0]=1,u[1]=1,c.buffer=a,c.loop=!0;const h={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(m){l.channelCount=m},get channelCountMode(){return l.channelCountMode},set channelCountMode(m){l.channelCountMode=m},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(m){l.channelInterpretation=m},get context(){return l.context},get inputs(){return[]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return l.numberOfOutputs},get offset(){return l.gain},get onended(){return c.onended},set onended(m){c.onended=m},addEventListener(...m){return c.addEventListener(m[0],m[1],m[2])},dispatchEvent(...m){return c.dispatchEvent(m[0])},removeEventListener(...m){return c.removeEventListener(m[0],m[1],m[2])},start(m=0){c.start.call(c,m)},stop(m=0){c.stop.call(c,m)}},d=()=>c.connect(l),p=()=>c.disconnect(l);return i(n,c),s(Zn(h,l),d,p)},e_=(i,t)=>(e,s)=>{const n=e.createConvolver();if(Gt(n,s),s.disableNormalization===n.normalize&&(n.normalize=!s.disableNormalization),Pt(n,s,"buffer"),s.channelCount>2||(t(n,"channelCount",r=>()=>r.call(n),r=>o=>{if(o>2)throw i();return r.call(n,o)}),s.channelCountMode==="max"))throw i();return t(n,"channelCountMode",r=>()=>r.call(n),r=>o=>{if(o==="max")throw i();return r.call(n,o)}),n},Eu=(i,t)=>{const e=i.createDelay(t.maxDelayTime);return Gt(e,t),Ft(e,t,"delayTime"),e},s_=i=>(t,e)=>{const s=t.createDynamicsCompressor();if(Gt(s,e),e.channelCount>2||e.channelCountMode==="max")throw i();return Ft(s,e,"attack"),Ft(s,e,"knee"),Ft(s,e,"ratio"),Ft(s,e,"release"),Ft(s,e,"threshold"),s},me=(i,t)=>{const e=i.createGain();return Gt(e,t),Ft(e,t,"gain"),e},n_=i=>(t,e,s)=>{if(t.createIIRFilter===void 0)return i(t,e,s);const n=t.createIIRFilter(s.feedforward,s.feedback);return Gt(n,s),n};function i_(i,t){const e=t[0]*t[0]+t[1]*t[1];return[(i[0]*t[0]+i[1]*t[1])/e,(i[1]*t[0]-i[0]*t[1])/e]}function r_(i,t){return[i[0]*t[0]-i[1]*t[1],i[0]*t[1]+i[1]*t[0]]}function _l(i,t){let e=[0,0];for(let s=i.length-1;s>=0;s-=1)e=r_(e,t),e[0]+=i[s];return e}const o_=(i,t,e,s)=>(n,r,{channelCount:o,channelCountMode:a,channelInterpretation:c,feedback:l,feedforward:u})=>{const h=Cu(r,n.sampleRate),d=l instanceof Float64Array?l:new Float64Array(l),p=u instanceof Float64Array?u:new Float64Array(u),m=d.length,f=p.length,_=Math.min(m,f);if(m===0||m>20)throw s();if(d[0]===0)throw t();if(f===0||f>20)throw s();if(p[0]===0)throw t();if(d[0]!==1){for(let k=0;k{const C=k.inputBuffer,M=k.outputBuffer,R=C.numberOfChannels;for(let P=0;Pi.createMediaElementSource(t.mediaElement),c_=(i,t)=>{const e=i.createMediaStreamDestination();return Gt(e,t),e.numberOfOutputs===1&&Object.defineProperty(e,"numberOfOutputs",{get:()=>0}),e},l_=(i,{mediaStream:t})=>{const e=t.getAudioTracks();e.sort((r,o)=>r.ido.id?1:0);const s=e.slice(0,1),n=i.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(n,"mediaStream",{value:t}),n},u_=(i,t)=>(e,{mediaStreamTrack:s})=>{if(typeof e.createMediaStreamTrackSource=="function")return e.createMediaStreamTrackSource(s);const n=new MediaStream([s]),r=e.createMediaStreamSource(n);if(s.kind!=="audio")throw i();if(t(e))throw new TypeError;return r},h_=i=>i===null?null:i.hasOwnProperty("OfflineAudioContext")?i.OfflineAudioContext:i.hasOwnProperty("webkitOfflineAudioContext")?i.webkitOfflineAudioContext:null,d_=(i,t,e,s,n,r)=>(o,a)=>{const c=o.createOscillator();return Gt(c,a),Ft(c,a,"detune"),Ft(c,a,"frequency"),a.periodicWave!==void 0?c.setPeriodicWave(a.periodicWave):Pt(c,a,"type"),t(e,()=>e(o))||ja(c),t(s,()=>s(o))||r(c,o),t(n,()=>n(o))||Ba(c),i(o,c),c},f_=i=>(t,e)=>{const s=t.createPanner();return s.orientationX===void 0?i(t,e):(Gt(s,e),Ft(s,e,"orientationX"),Ft(s,e,"orientationY"),Ft(s,e,"orientationZ"),Ft(s,e,"positionX"),Ft(s,e,"positionY"),Ft(s,e,"positionZ"),Pt(s,e,"coneInnerAngle"),Pt(s,e,"coneOuterAngle"),Pt(s,e,"coneOuterGain"),Pt(s,e,"distanceModel"),Pt(s,e,"maxDistance"),Pt(s,e,"panningModel"),Pt(s,e,"refDistance"),Pt(s,e,"rolloffFactor"),s)},p_=(i,t,e,s,n,r,o,a,c,l)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:m,maxDistance:f,orientationX:_,orientationY:y,orientationZ:w,panningModel:b,positionX:v,positionY:g,positionZ:x,refDistance:T,rolloffFactor:k,...C})=>{const M=u.createPanner();if(C.channelCount>2||C.channelCountMode==="max")throw o();Gt(M,C);const R={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},P=e(u,{...R,channelInterpretation:"speakers",numberOfInputs:6}),U=s(u,{...C,gain:1}),W=s(u,{...R,gain:1}),G=s(u,{...R,gain:0}),Y=s(u,{...R,gain:0}),j=s(u,{...R,gain:0}),z=s(u,{...R,gain:0}),X=s(u,{...R,gain:0}),Q=n(u,256,6,1),et=r(u,{...R,curve:new Float32Array([1,1]),oversample:"none"});let I=[_,y,w],F=[v,g,x];const S=new Float32Array(1);Q.onaudioprocess=({inputBuffer:V})=>{const it=[c(V,S,0),c(V,S,1),c(V,S,2)];it.some((nt,J)=>nt!==I[J])&&(M.setOrientation(...it),I=it);const st=[c(V,S,3),c(V,S,4),c(V,S,5)];st.some((nt,J)=>nt!==F[J])&&(M.setPosition(...st),F=st)},Object.defineProperty(G.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Y.gain,"defaultValue",{get:()=>0}),Object.defineProperty(j.gain,"defaultValue",{get:()=>0}),Object.defineProperty(z.gain,"defaultValue",{get:()=>0}),Object.defineProperty(X.gain,"defaultValue",{get:()=>0});const D={get bufferSize(){},get channelCount(){return M.channelCount},set channelCount(V){if(V>2)throw o();U.channelCount=V,M.channelCount=V},get channelCountMode(){return M.channelCountMode},set channelCountMode(V){if(V==="max")throw o();U.channelCountMode=V,M.channelCountMode=V},get channelInterpretation(){return M.channelInterpretation},set channelInterpretation(V){U.channelInterpretation=V,M.channelInterpretation=V},get coneInnerAngle(){return M.coneInnerAngle},set coneInnerAngle(V){M.coneInnerAngle=V},get coneOuterAngle(){return M.coneOuterAngle},set coneOuterAngle(V){M.coneOuterAngle=V},get coneOuterGain(){return M.coneOuterGain},set coneOuterGain(V){if(V<0||V>1)throw t();M.coneOuterGain=V},get context(){return M.context},get distanceModel(){return M.distanceModel},set distanceModel(V){M.distanceModel=V},get inputs(){return[U]},get maxDistance(){return M.maxDistance},set maxDistance(V){if(V<0)throw new RangeError;M.maxDistance=V},get numberOfInputs(){return M.numberOfInputs},get numberOfOutputs(){return M.numberOfOutputs},get orientationX(){return W.gain},get orientationY(){return G.gain},get orientationZ(){return Y.gain},get panningModel(){return M.panningModel},set panningModel(V){M.panningModel=V},get positionX(){return j.gain},get positionY(){return z.gain},get positionZ(){return X.gain},get refDistance(){return M.refDistance},set refDistance(V){if(V<0)throw new RangeError;M.refDistance=V},get rolloffFactor(){return M.rolloffFactor},set rolloffFactor(V){if(V<0)throw new RangeError;M.rolloffFactor=V},addEventListener(...V){return U.addEventListener(V[0],V[1],V[2])},dispatchEvent(...V){return U.dispatchEvent(V[0])},removeEventListener(...V){return U.removeEventListener(V[0],V[1],V[2])}};h!==D.coneInnerAngle&&(D.coneInnerAngle=h),d!==D.coneOuterAngle&&(D.coneOuterAngle=d),p!==D.coneOuterGain&&(D.coneOuterGain=p),m!==D.distanceModel&&(D.distanceModel=m),f!==D.maxDistance&&(D.maxDistance=f),_!==D.orientationX.value&&(D.orientationX.value=_),y!==D.orientationY.value&&(D.orientationY.value=y),w!==D.orientationZ.value&&(D.orientationZ.value=w),b!==D.panningModel&&(D.panningModel=b),v!==D.positionX.value&&(D.positionX.value=v),g!==D.positionY.value&&(D.positionY.value=g),x!==D.positionZ.value&&(D.positionZ.value=x),T!==D.refDistance&&(D.refDistance=T),k!==D.rolloffFactor&&(D.rolloffFactor=k),(I[0]!==1||I[1]!==0||I[2]!==0)&&M.setOrientation(...I),(F[0]!==0||F[1]!==0||F[2]!==0)&&M.setPosition(...F);const H=()=>{U.connect(M),i(U,et,0,0),et.connect(W).connect(P,0,0),et.connect(G).connect(P,0,1),et.connect(Y).connect(P,0,2),et.connect(j).connect(P,0,3),et.connect(z).connect(P,0,4),et.connect(X).connect(P,0,5),P.connect(Q).connect(u.destination)},N=()=>{U.disconnect(M),a(U,et,0,0),et.disconnect(W),W.disconnect(P),et.disconnect(G),G.disconnect(P),et.disconnect(Y),Y.disconnect(P),et.disconnect(j),j.disconnect(P),et.disconnect(z),z.disconnect(P),et.disconnect(X),X.disconnect(P),P.disconnect(Q),Q.disconnect(u.destination)};return l(Zn(D,M),H,N)},m_=i=>(t,{disableNormalization:e,imag:s,real:n})=>{const r=s instanceof Float32Array?s:new Float32Array(s),o=n instanceof Float32Array?n:new Float32Array(n),a=t.createPeriodicWave(o,r,{disableNormalization:e});if(Array.from(s).length<2)throw i();return a},cr=(i,t,e,s)=>i.createScriptProcessor(t,e,s),__=(i,t)=>(e,s)=>{const n=s.channelCountMode;if(n==="clamped-max")throw t();if(e.createStereoPanner===void 0)return i(e,s);const r=e.createStereoPanner();return Gt(r,s),Ft(r,s,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>n,set:o=>{if(o!==n)throw t()}}),r},g_=(i,t,e,s,n,r)=>{const a=new Float32Array([1,1]),c=Math.PI/2,l={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...l,oversample:"none"},h=(m,f,_,y)=>{const w=new Float32Array(16385),b=new Float32Array(16385);for(let C=0;C<16385;C+=1){const M=C/16384*c;w[C]=Math.cos(M),b[C]=Math.sin(M)}const v=e(m,{...l,gain:0}),g=s(m,{...u,curve:w}),x=s(m,{...u,curve:a}),T=e(m,{...l,gain:0}),k=s(m,{...u,curve:b});return{connectGraph(){f.connect(v),f.connect(x.inputs===void 0?x:x.inputs[0]),f.connect(T),x.connect(_),_.connect(g.inputs===void 0?g:g.inputs[0]),_.connect(k.inputs===void 0?k:k.inputs[0]),g.connect(v.gain),k.connect(T.gain),v.connect(y,0,0),T.connect(y,0,1)},disconnectGraph(){f.disconnect(v),f.disconnect(x.inputs===void 0?x:x.inputs[0]),f.disconnect(T),x.disconnect(_),_.disconnect(g.inputs===void 0?g:g.inputs[0]),_.disconnect(k.inputs===void 0?k:k.inputs[0]),g.disconnect(v.gain),k.disconnect(T.gain),v.disconnect(y,0,0),T.disconnect(y,0,1)}}},d=(m,f,_,y)=>{const w=new Float32Array(16385),b=new Float32Array(16385),v=new Float32Array(16385),g=new Float32Array(16385),x=Math.floor(16385/2);for(let j=0;j<16385;j+=1)if(j>x){const z=(j-x)/(16384-x)*c;w[j]=Math.cos(z),b[j]=Math.sin(z),v[j]=0,g[j]=1}else{const z=j/(16384-x)*c;w[j]=1,b[j]=0,v[j]=Math.cos(z),g[j]=Math.sin(z)}const T=t(m,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),k=e(m,{...l,gain:0}),C=s(m,{...u,curve:w}),M=e(m,{...l,gain:0}),R=s(m,{...u,curve:b}),P=s(m,{...u,curve:a}),U=e(m,{...l,gain:0}),W=s(m,{...u,curve:v}),G=e(m,{...l,gain:0}),Y=s(m,{...u,curve:g});return{connectGraph(){f.connect(T),f.connect(P.inputs===void 0?P:P.inputs[0]),T.connect(k,0),T.connect(M,0),T.connect(U,1),T.connect(G,1),P.connect(_),_.connect(C.inputs===void 0?C:C.inputs[0]),_.connect(R.inputs===void 0?R:R.inputs[0]),_.connect(W.inputs===void 0?W:W.inputs[0]),_.connect(Y.inputs===void 0?Y:Y.inputs[0]),C.connect(k.gain),R.connect(M.gain),W.connect(U.gain),Y.connect(G.gain),k.connect(y,0,0),U.connect(y,0,0),M.connect(y,0,1),G.connect(y,0,1)},disconnectGraph(){f.disconnect(T),f.disconnect(P.inputs===void 0?P:P.inputs[0]),T.disconnect(k,0),T.disconnect(M,0),T.disconnect(U,1),T.disconnect(G,1),P.disconnect(_),_.disconnect(C.inputs===void 0?C:C.inputs[0]),_.disconnect(R.inputs===void 0?R:R.inputs[0]),_.disconnect(W.inputs===void 0?W:W.inputs[0]),_.disconnect(Y.inputs===void 0?Y:Y.inputs[0]),C.disconnect(k.gain),R.disconnect(M.gain),W.disconnect(U.gain),Y.disconnect(G.gain),k.disconnect(y,0,0),U.disconnect(y,0,0),M.disconnect(y,0,1),G.disconnect(y,0,1)}}},p=(m,f,_,y,w)=>{if(f===1)return h(m,_,y,w);if(f===2)return d(m,_,y,w);throw n()};return(m,{channelCount:f,channelCountMode:_,pan:y,...w})=>{if(_==="max")throw n();const b=i(m,{...w,channelCount:1,channelCountMode:_,numberOfInputs:2}),v=e(m,{...w,channelCount:f,channelCountMode:_,gain:1}),g=e(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:y});let{connectGraph:x,disconnectGraph:T}=p(m,f,v,g,b);Object.defineProperty(g.gain,"defaultValue",{get:()=>0}),Object.defineProperty(g.gain,"maxValue",{get:()=>1}),Object.defineProperty(g.gain,"minValue",{get:()=>-1});const k={get bufferSize(){},get channelCount(){return v.channelCount},set channelCount(P){v.channelCount!==P&&(C&&T(),{connectGraph:x,disconnectGraph:T}=p(m,P,v,g,b),C&&x()),v.channelCount=P},get channelCountMode(){return v.channelCountMode},set channelCountMode(P){if(P==="clamped-max"||P==="max")throw n();v.channelCountMode=P},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(P){v.channelInterpretation=P},get context(){return v.context},get inputs(){return[v]},get numberOfInputs(){return v.numberOfInputs},get numberOfOutputs(){return v.numberOfOutputs},get pan(){return g.gain},addEventListener(...P){return v.addEventListener(P[0],P[1],P[2])},dispatchEvent(...P){return v.dispatchEvent(P[0])},removeEventListener(...P){return v.removeEventListener(P[0],P[1],P[2])}};let C=!1;const M=()=>{x(),C=!0},R=()=>{T(),C=!1};return r(Zn(k,b),M,R)}},y_=(i,t,e,s,n,r,o)=>(a,c)=>{const l=a.createWaveShaper();if(r!==null&&r.name==="webkitAudioContext"&&a.createGain().gain.automationRate===void 0)return e(a,c);Gt(l,c);const u=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(u!==null&&u.length<2)throw t();Pt(l,{curve:u},"curve"),Pt(l,c,"oversample");let h=null,d=!1;return o(l,"curve",f=>()=>f.call(l),f=>_=>(f.call(l,_),d&&(s(_)&&h===null?h=i(a,l):!s(_)&&h!==null&&(h(),h=null)),_)),n(l,()=>{d=!0,s(l.curve)&&(h=i(a,l))},()=>{d=!1,h!==null&&(h(),h=null)})},v_=(i,t,e,s,n)=>(r,{curve:o,oversample:a,...c})=>{const l=r.createWaveShaper(),u=r.createWaveShaper();Gt(l,c),Gt(u,c);const h=e(r,{...c,gain:1}),d=e(r,{...c,gain:-1}),p=e(r,{...c,gain:1}),m=e(r,{...c,gain:-1});let f=null,_=!1,y=null;const w={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(g){h.channelCount=g,d.channelCount=g,l.channelCount=g,p.channelCount=g,u.channelCount=g,m.channelCount=g},get channelCountMode(){return l.channelCountMode},set channelCountMode(g){h.channelCountMode=g,d.channelCountMode=g,l.channelCountMode=g,p.channelCountMode=g,u.channelCountMode=g,m.channelCountMode=g},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(g){h.channelInterpretation=g,d.channelInterpretation=g,l.channelInterpretation=g,p.channelInterpretation=g,u.channelInterpretation=g,m.channelInterpretation=g},get context(){return l.context},get curve(){return y},set curve(g){if(g!==null&&g.length<2)throw t();if(g===null)l.curve=g,u.curve=g;else{const x=g.length,T=new Float32Array(x+2-x%2),k=new Float32Array(x+2-x%2);T[0]=g[0],k[0]=-g[x-1];const C=Math.ceil((x+1)/2),M=(x+1)/2-1;for(let R=1;R{h.connect(l).connect(p),h.connect(d).connect(u).connect(m).connect(p),_=!0,s(y)&&(f=i(r,h))},v=()=>{h.disconnect(l),l.disconnect(p),h.disconnect(d),d.disconnect(u),u.disconnect(m),m.disconnect(p),_=!1,f!==null&&(f(),f=null)};return n(Zn(w,p),b,v)},ae=()=>new DOMException("","NotSupportedError"),k_={numberOfChannels:1},x_=(i,t,e,s,n)=>class extends i{constructor(o,a,c){let l;if(typeof o=="number"&&a!==void 0&&c!==void 0)l={length:a,numberOfChannels:o,sampleRate:c};else if(typeof o=="object")l=o;else throw new Error("The given parameters are not valid.");const{length:u,numberOfChannels:h,sampleRate:d}={...k_,...l},p=s(h,u,d);t(Oi,()=>Oi(p))||p.addEventListener("statechange",(()=>{let m=0;const f=_=>{this._state==="running"&&(m>0?(p.removeEventListener("statechange",f),_.stopImmediatePropagation(),this._waitForThePromiseToSettle(_)):m+=1)};return f})()),super(p,h),this._length=u,this._nativeOfflineAudioContext=p,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state==="running"?Promise.reject(e()):(this._state="running",n(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,yu(this)}))}_waitForThePromiseToSettle(o){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(o):setTimeout(()=>this._waitForThePromiseToSettle(o))}},T_={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},w_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...T_,...l},d=e(u,h),p=r(u),m=p?s():null,f=c.sampleRate/2;super(c,!1,d,m),this._detune=t(this,p,d.detune,153600,-153600),this._frequency=t(this,p,d.frequency,f,-f),this._nativeOscillatorNode=d,this._onended=null,this._oscillatorNodeRenderer=m,this._oscillatorNodeRenderer!==null&&h.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=h.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(c){const l=typeof c=="function"?o(this,c):null;this._nativeOscillatorNode.onended=l;const u=this._nativeOscillatorNode.onended;this._onended=u!==null&&u===l?c:u}get type(){return this._nativeOscillatorNode.type}set type(c){this._nativeOscillatorNode.type=c,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(c){this._nativeOscillatorNode.setPeriodicWave(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=c)}start(c=0){if(this._nativeOscillatorNode.start(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=c),this.context.state!=="closed"){Vn(this);const l=()=>{this._nativeOscillatorNode.removeEventListener("ended",l),ds(this)&&ir(this)};this._nativeOscillatorNode.addEventListener("ended",l)}}stop(c=0){this._nativeOscillatorNode.stop(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=c)}},b_=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null,c=null;const l=async(u,h)=>{let d=e(u);const p=se(d,h);if(!p){const m={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:o===null?void 0:o,type:d.type};d=t(h,m),a!==null&&d.start(a),c!==null&&d.stop(c)}return r.set(h,d),p?(await i(h,u.detune,d.detune),await i(h,u.frequency,d.frequency)):(await s(h,u.detune,d.detune),await s(h,u.frequency,d.frequency)),await n(u,h,d),d};return{set periodicWave(u){o=u},set start(u){a=u},set stop(u){c=u},render(u,h){const d=r.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},C_={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},S_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...C_,...l},d=e(u,h),p=r(u),m=p?s():null;super(c,!1,d,m),this._nativePannerNode=d,this._orientationX=t(this,p,d.orientationX,ne,le),this._orientationY=t(this,p,d.orientationY,ne,le),this._orientationZ=t(this,p,d.orientationZ,ne,le),this._positionX=t(this,p,d.positionX,ne,le),this._positionY=t(this,p,d.positionY,ne,le),this._positionZ=t(this,p,d.positionZ,ne,le),o(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(c){this._nativePannerNode.coneInnerAngle=c}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(c){this._nativePannerNode.coneOuterAngle=c}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(c){this._nativePannerNode.coneOuterGain=c}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(c){this._nativePannerNode.distanceModel=c}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(c){this._nativePannerNode.maxDistance=c}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(c){this._nativePannerNode.panningModel=c}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(c){this._nativePannerNode.refDistance=c}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(c){this._nativePannerNode.rolloffFactor=c}},E_=(i,t,e,s,n,r,o,a,c,l)=>()=>{const u=new WeakMap;let h=null;const d=async(p,m)=>{let f=null,_=r(p);const y={channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation},w={...y,coneInnerAngle:_.coneInnerAngle,coneOuterAngle:_.coneOuterAngle,coneOuterGain:_.coneOuterGain,distanceModel:_.distanceModel,maxDistance:_.maxDistance,panningModel:_.panningModel,refDistance:_.refDistance,rolloffFactor:_.rolloffFactor},b=se(_,m);if("bufferSize"in _)f=s(m,{...y,gain:1});else if(!b){const v={...w,orientationX:_.orientationX.value,orientationY:_.orientationY.value,orientationZ:_.orientationZ.value,positionX:_.positionX.value,positionY:_.positionY.value,positionZ:_.positionZ.value};_=n(m,v)}if(u.set(m,f===null?_:f),f!==null){if(h===null){if(o===null)throw new Error("Missing the native OfflineAudioContext constructor.");const R=new o(6,p.context.length,m.sampleRate),P=t(R,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});P.connect(R.destination),h=(async()=>{const U=await Promise.all([p.orientationX,p.orientationY,p.orientationZ,p.positionX,p.positionY,p.positionZ].map(async(W,G)=>{const Y=e(R,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:G===0?1:0});return await a(R,W,Y.offset),Y}));for(let W=0;W<6;W+=1)U[W].connect(P,0,W),U[W].start(0);return l(R)})()}const v=await h,g=s(m,{...y,gain:1});await c(p,m,g);const x=[];for(let R=0;RW!==T[G])||U.some((W,G)=>W!==k[G])){T=P,k=U;const W=R/m.sampleRate;C.gain.setValueAtTime(0,W),C=s(m,{...y,gain:0}),M=n(m,{...w,orientationX:T[0],orientationY:T[1],orientationZ:T[2],positionX:k[0],positionY:k[1],positionZ:k[2]}),C.gain.setValueAtTime(1,W),g.connect(C).connect(M.inputs[0]),M.connect(f)}}return f}return b?(await i(m,p.orientationX,_.orientationX),await i(m,p.orientationY,_.orientationY),await i(m,p.orientationZ,_.orientationZ),await i(m,p.positionX,_.positionX),await i(m,p.positionY,_.positionY),await i(m,p.positionZ,_.positionZ)):(await a(m,p.orientationX,_.orientationX),await a(m,p.orientationY,_.orientationY),await a(m,p.orientationZ,_.orientationZ),await a(m,p.positionX,_.positionX),await a(m,p.positionY,_.positionY),await a(m,p.positionZ,_.positionZ)),Xn(_)?await c(p,m,_.inputs[0]):await c(p,m,_),_};return{render(p,m){const f=u.get(m);return f!==void 0?Promise.resolve(f):d(p,m)}}},O_={disableNormalization:!1},A_=(i,t,e,s)=>class Ou{constructor(r,o){const a=t(r),c=s({...O_,...o}),l=i(a,c);return e.add(l),l}static[Symbol.hasInstance](r){return r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===Ou.prototype||e.has(r)}},M_=(i,t)=>(e,s,n)=>(i(s).replay(n),t(s,e,n)),D_=(i,t,e)=>async(s,n,r)=>{const o=i(s);await Promise.all(o.activeInputs.map((a,c)=>Array.from(a).map(async([l,u])=>{const d=await t(l).render(l,n),p=s.context.destination;!e(l)&&(s!==p||!e(s))&&d.connect(r,u,c)})).reduce((a,c)=>[...a,...c],[]))},P_=(i,t,e)=>async(s,n,r)=>{const o=t(s);await Promise.all(Array.from(o.activeInputs).map(async([a,c])=>{const u=await i(a).render(a,n);e(a)||u.connect(r,c)}))},N_=(i,t,e,s)=>n=>i(Oi,()=>Oi(n))?Promise.resolve(i(s,s)).then(r=>{if(!r){const o=e(n,512,0,1);n.oncomplete=()=>{o.onaudioprocess=null,o.disconnect()},o.onaudioprocess=()=>n.currentTime,o.connect(n.destination)}return n.startRendering()}):new Promise(r=>{const o=t(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.oncomplete=a=>{o.disconnect(),r(a.renderedBuffer)},o.connect(n.destination),n.startRendering()}),I_=i=>(t,e)=>{i.set(t,e)},R_=i=>(t,e)=>i.set(t,e),F_=(i,t,e,s,n,r,o,a)=>(c,l)=>e(c).render(c,l).then(()=>Promise.all(Array.from(s(l)).map(u=>e(u).render(u,l)))).then(()=>n(l)).then(u=>(typeof u.copyFromChannel!="function"?(o(u),Va(u)):t(r,()=>r(u))||a(u),i.add(u),u)),L_={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},V_=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...L_,...c},h=e(l,u),d=r(l),p=d?s():null;super(a,!1,h,p),this._pan=t(this,d,h.pan)}get pan(){return this._pan}},U_=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(c,h)}return r.set(c,l),u?await i(c,a.pan,l.pan):await s(c,a.pan,l.pan),Xn(l)?await n(a,c,l.inputs[0]):await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},z_=i=>()=>{if(i===null)return!1;try{new i({length:1,sampleRate:44100})}catch{return!1}return!0},j_=(i,t)=>async()=>{if(i===null)return!0;if(t===null)return!1;const e=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new t(1,128,44100),n=URL.createObjectURL(e);let r=!1,o=!1;try{await s.audioWorklet.addModule(n);const a=new i(s,"a",{numberOfOutputs:0}),c=s.createOscillator();a.port.onmessage=()=>r=!0,a.onprocessorerror=()=>o=!0,c.connect(a),c.start(0),await s.startRendering(),await new Promise(l=>setTimeout(l))}catch{}finally{URL.revokeObjectURL(n)}return r&&!o},B_=(i,t)=>()=>{if(t===null)return Promise.resolve(!1);const e=new t(1,1,44100),s=i(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(n=>{e.oncomplete=()=>{s.disconnect(),n(e.currentTime!==0)},e.startRendering()})},q_=()=>new DOMException("","UnknownError"),W_={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},H_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...W_,...l},d=e(u,h),m=r(u)?s():null;super(c,!0,d,m),this._isCurveNullified=!1,this._nativeWaveShaperNode=d,o(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(c){if(c===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(c.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=c}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(c){this._nativeWaveShaperNode.oversample=c}},Y_=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=i(o,l)}return s.set(o,a),Xn(a)?await e(r,o,a.inputs[0]):await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},G_=()=>typeof window>"u"?null:window,$_=(i,t)=>e=>{e.copyFromChannel=(s,n,r=0)=>{const o=i(r),a=i(n);if(a>=e.numberOfChannels)throw t();const c=e.length,l=e.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+o{const o=i(r),a=i(n);if(a>=e.numberOfChannels)throw t();const c=e.length,l=e.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+ot=>{t.copyFromChannel=(e=>(s,n,r=0)=>{const o=i(r),a=i(n);if(o(s,n,r=0)=>{const o=i(r),a=i(n);if(o(t,e)=>{const s=e.createBuffer(1,1,44100);t.buffer===null&&(t.buffer=s),i(t,"buffer",n=>()=>{const r=n.call(t);return r===s?null:r},n=>r=>n.call(t,r===null?s:r))},Q_=(i,t)=>(e,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw i()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw i()}});const n=e.createBufferSource();t(s,()=>{const a=s.numberOfInputs;for(let c=0;cn.disconnect(s))},Au=(i,t,e)=>i.copyFromChannel===void 0?i.getChannelData(e)[0]:(i.copyFromChannel(t,e),t[0]),Mu=i=>{if(i===null)return!1;const t=i.length;return t%2!==0?i[Math.floor(t/2)]!==0:i[t/2-1]+i[t/2]!==0},lr=(i,t,e,s)=>{let n=i;for(;!n.hasOwnProperty(t);)n=Object.getPrototypeOf(n);const{get:r,set:o}=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,{get:e(r),set:s(o)})},K_=i=>({...i,outputChannelCount:i.outputChannelCount!==void 0?i.outputChannelCount:i.numberOfInputs===1&&i.numberOfOutputs===1?[i.channelCount]:Array.from({length:i.numberOfOutputs},()=>1)}),J_=i=>({...i,channelCount:i.numberOfOutputs}),tg=i=>{const{imag:t,real:e}=i;return t===void 0?e===void 0?{...i,imag:[0,0],real:[0,0]}:{...i,imag:Array.from(e,()=>0),real:e}:e===void 0?{...i,imag:t,real:Array.from(t,()=>0)}:{...i,imag:t,real:e}},Du=(i,t,e)=>{try{i.setValueAtTime(t,e)}catch(s){if(s.code!==9)throw s;Du(i,t,e+1e-7)}},eg=i=>{const t=i.createBufferSource();t.start();try{t.start()}catch{return!0}return!1},sg=i=>{const t=i.createBufferSource(),e=i.createBuffer(1,1,44100);t.buffer=e;try{t.start(0,1)}catch{return!1}return!0},ng=i=>{const t=i.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0},qa=i=>{const t=i.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Pu=i=>{const t=i.createBuffer(1,1,44100),e=i.createBufferSource();e.buffer=t,e.start(),e.stop();try{return e.stop(),!0}catch{return!1}},Wa=i=>{const t=i.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},ig=i=>{const{port1:t,port2:e}=new MessageChannel;try{t.postMessage(i)}finally{t.close(),e.close()}},rg=i=>{i.start=(t=>(e=0,s=0,n)=>{const r=i.buffer,o=r===null?s:Math.min(r.duration,s);r!==null&&o>r.duration-.5/i.context.sampleRate?t.call(i,e,0,0):t.call(i,e,o,n)})(i.start)},Nu=(i,t)=>{const e=t.createGain();i.connect(e);const s=(n=>()=>{n.call(i,e),i.removeEventListener("ended",s)})(i.disconnect);i.addEventListener("ended",s),Zn(i,e),i.stop=(n=>{let r=!1;return(o=0)=>{if(r)try{n.call(i,o)}catch{e.gain.setValueAtTime(0,o)}else n.call(i,o),r=!0}})(i.stop)},Qn=(i,t)=>e=>{const s={value:i};return Object.defineProperties(e,{currentTarget:s,target:s}),typeof t=="function"?t.call(i,e):t.handleEvent.call(i,e)},og=S0(fn),ag=P0(fn),cg=Wp(vo),Iu=new WeakMap,lg=cm(Iu),He=kp(new Map,new WeakMap),ts=G_(),Ru=Vm(He,ss),Ha=am(re),Qt=D_(re,Ha,on),ug=L0(Ru,Dt,Qt),At=hm(yo),vs=h_(ts),wt=Om(vs),Fu=new WeakMap,Lu=tm(Qn),ur=Bm(ts),Ya=bm(ur),Ga=Cm(ts),Vu=Sm(ts),Ai=Wm(ts),Wt=cp(E0(hu),D0(og,ag,jr,cg,Br,re,lg,nr,Dt,fn,ds,on,Pr),He,vm(ua,Br,re,Dt,Ei,ds),ss,ko,ae,zp(jr,ua,re,Dt,Ei,At,ds,wt),Gp(Fu,re,je),Lu,At,Ya,Ga,Vu,wt,Ai),hg=F0(Wt,ug,ss,Ru,At,wt),$a=new WeakSet,gl=Um(ts),Uu=Np(new Uint32Array(1)),Xa=$_(Uu,ss),Za=X_(Uu),zu=U0($a,He,ae,gl,vs,z_(gl),Xa,Za),xo=N0(me),ju=P_(Ha,rr,on),ns=Ep(ju),Kn=jm(xo,He,eg,sg,ng,qa,Pu,Wa,rg,Z_(lr),Nu),is=M_(lm(rr),ju),dg=B0(ns,Kn,Dt,is,Qt),Ye=lp(O0(du),Fu,La,up,k0,x0,T0,w0,b0,aa,lu,ur,Du),fg=j0(Wt,dg,Ye,Xt,Kn,At,wt,Qn),pg=Q0(Wt,K0,ss,Xt,qm(me,lr),At,wt,Qt),mg=vp(ns,Su,Dt,is,Qt),pn=R_(Iu),_g=yp(Wt,Ye,mg,ko,Su,At,wt,pn),zs=Fm(fn,Ga),gg=Q_(Xt,zs),js=Qm(ur,gg),yg=wp(js,Dt,Qt),vg=Tp(Wt,yg,js,At,wt),kg=Sp(ar,Dt,Qt),xg=Cp(Wt,kg,ar,At,wt,J_),Tg=t_(xo,Kn,me,zs),Jn=Jm(xo,He,Tg,qa,Wa),wg=Pp(ns,Jn,Dt,is,Qt),bg=Dp(Wt,Ye,wg,Jn,At,wt,Qn),Bu=e_(ae,lr),Cg=Fp(Bu,Dt,Qt),Sg=Rp(Wt,Cg,Bu,At,wt,pn),Eg=qp(ns,Eu,Dt,is,Qt),Og=Bp(Wt,Ye,Eg,Eu,At,wt,pn),qu=s_(ae),Ag=Qp(ns,qu,Dt,is,Qt),Mg=Zp(Wt,Ye,Ag,qu,ae,At,wt,pn),Dg=rm(ns,me,Dt,is,Qt),Pg=im(Wt,Ye,Dg,me,At,wt),Ng=o_(ko,Xt,cr,ae),To=N_(He,me,cr,B_(me,vs)),Ig=ym(Kn,Dt,vs,Qt,To),Rg=n_(Ng),Fg=_m(Wt,Rg,Ig,At,wt,pn),Lg=J0(Ye,js,Jn,cr,ae,Au,wt,lr),Wu=new WeakMap,Vg=Rm(pg,Lg,Lu,wt,Wu,Qn),Hu=d_(xo,He,qa,Pu,Wa,Nu),Ug=b_(ns,Hu,Dt,is,Qt),zg=w_(Wt,Ye,Hu,Ug,At,wt,Qn),Yu=Ap(Kn),jg=v_(Yu,Xt,me,Mu,zs),wo=y_(Yu,Xt,jg,Mu,zs,ur,lr),Bg=p_(jr,Xt,js,me,cr,wo,ae,Br,Au,zs),Gu=f_(Bg),qg=E_(ns,js,Jn,me,Gu,Dt,vs,is,Qt,To),Wg=S_(Wt,Ye,Gu,qg,At,wt,pn),Hg=m_(ss),Yg=A_(Hg,At,new WeakSet,tg),Gg=g_(js,ar,me,wo,ae,zs),$u=__(Gg,ae),$g=U_(ns,$u,Dt,is,Qt),Xg=V_(Wt,Ye,$u,$g,At,wt),Zg=Y_(wo,Dt,Qt),Qg=H_(Wt,Xt,wo,Zg,At,wt,pn),Xu=Am(ts),Qa=em(ts),Zu=new WeakMap,Kg=dm(Zu,vs),Jg=Xu?M0(He,ae,Jp(ts),Qa,sm(C0),At,Kg,wt,Ai,new WeakMap,new WeakMap,j_(Ai,vs),ts):void 0,ty=Em(Ya,wt),ey=Up($a,He,Vp,Kp,new WeakSet,At,ty,Ur,Oi,Xa,Za),Qu=_p(Jg,hg,zu,fg,_g,vg,xg,bg,Sg,ey,Og,Mg,Pg,Fg,Vg,zg,Wg,Yg,Xg,Qg),sy=Mm(Wt,a_,At,wt),ny=Pm(Wt,c_,At,wt),iy=Nm(Wt,l_,At,wt),ry=u_(Xt,wt),oy=Im(Wt,ry,At),ay=Z0(Qu,Xt,ae,q_,sy,ny,iy,oy,ur),Ka=fm(Wu),cy=I0(Ka),Ku=Op(ss),ly=Hp(Ka),Ju=$p(ss),th=new WeakMap,uy=om(th,je),hy=Zm(Ku,ss,Xt,js,ar,Jn,me,cr,ae,Ju,Qa,uy,zs),dy=Ym(Xt,hy,me,ae,zs),fy=mp(ns,Ku,Kn,js,ar,Jn,me,ly,Ju,Qa,Dt,Ai,vs,is,Qt,To),py=um(Zu),my=I_(th),yl=Xu?dp(cy,Wt,Ye,fy,dy,re,py,At,wt,Ai,K_,my,ig,Qn):void 0,_y=Lp(ae,vs),gy=F_($a,He,Ha,Ka,To,Ur,Xa,Za),yy=x_(Qu,He,Xt,_y,gy),vy=km(yo,Ya),ky=xm(Fa,Ga),xy=Tm(La,Vu),Ty=wm(yo,wt);function xe(i){return typeof i>"u"}function dt(i){return!xe(i)}function wy(i){return typeof i=="function"}function Ps(i){return typeof i=="number"}function Js(i){return Object.prototype.toString.call(i)==="[object Object]"&&i.constructor===Object}function by(i){return typeof i=="boolean"}function ze(i){return Array.isArray(i)}function fs(i){return typeof i=="string"}function Cr(i){return fs(i)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(i)}function ut(i,t){if(!i)throw new Error(t)}function Be(i,t,e=1/0){if(!(t<=i&&i<=e))throw new RangeError(`Value must be within [${t}, ${e}], got: ${i}`)}function eh(i){!i.isOffline&&i.state!=="running"&&Ja('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let sh=!1,vl=!1;function kl(i){sh=i}function Cy(i){xe(i)&&sh&&!vl&&(vl=!0,Ja("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let nh=console;function Sy(...i){nh.log(...i)}function Ja(...i){nh.warn(...i)}function Ey(i){return new ay(i)}function Oy(i,t,e){return new yy(i,t,e)}const tn=typeof self=="object"?self:null,Ay=tn&&(tn.hasOwnProperty("AudioContext")||tn.hasOwnProperty("webkitAudioContext"));function My(i,t,e){return ut(dt(yl),"This node only works in a secure context (https or localhost)"),new yl(i,t,e)}class Dy{constructor(t,e,s,n){this._callback=t,this._type=e,this._minimumUpdateInterval=Math.max(128/(n||44100),.001),this.updateInterval=s,this._createClock()}_createWorker(){const t=new Blob([` // the initial timeout time let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; // onmessage callback @@ -150,7 +150,7 @@ import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y a * @author Yotam Mann * @license http://opensource.org/licenses/MIT MIT License * @copyright 2014-2019 Yotam Mann - */class ks{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...t){(this.debug||tn&&this.toString()===tn.TONE_DEBUG_CLASS)&&Sy(this,...t)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}ks.version=cu;const tc=1e-6;function Un(i,t){return i>t+tc}function ma(i,t){return Un(i,t)||Le(i,t)}function Yr(i,t){return i+tcthis.memory){const e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(t){const e=this._timeline.indexOf(t);return e!==-1&&this._timeline.splice(e,1),this}get(t,e="time"){const s=this._search(t,e);return s!==-1?this._timeline[s]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(t,e="time"){const s=this._search(t,e);return s+10&&this._timeline[e-1].time=0?this._timeline[s-1]:null}cancel(t){if(this._timeline.length>1){let e=this._search(t);if(e>=0)if(Le(this._timeline[e].time,t)){for(let s=e;s>=0&&Le(this._timeline[s].time,t);s--)e=s;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else this._timeline.length===1&&ma(this._timeline[0].time,t)&&(this._timeline=[]);return this}cancelBefore(t){const e=this._search(t);return e>=0&&(this._timeline=this._timeline.slice(e+1)),this}previousEvent(t){const e=this._timeline.indexOf(t);return e>0?this._timeline[e-1]:null}_search(t,e="time"){if(this._timeline.length===0)return-1;let s=0;const n=this._timeline.length;let r=n;if(n>0&&this._timeline[n-1][e]<=t)return n-1;for(;s=0&&this._timeline[s].time>=t;)s--;return this._iterate(e,s+1),this}forEachAtTime(t,e){const s=this._search(t);if(s!==-1&&Le(this._timeline[s].time,t)){let n=s;for(let r=s;r>=0&&Le(this._timeline[r].time,t);r--)n=r;this._iterate(r=>{e(r)},n,s)}return this}dispose(){return super.dispose(),this._timeline=[],this}};const rh=[];function bo(i){rh.push(i)}function Ly(i){rh.forEach(t=>t(i))}const oh=[];function Co(i){oh.push(i)}function Vy(i){oh.forEach(t=>t(i))}class hr extends ks{constructor(){super(...arguments),this.name="Emitter"}on(t,e){return t.split(/\W+/).forEach(n=>{xe(this._events)&&(this._events={}),this._events.hasOwnProperty(n)||(this._events[n]=[]),this._events[n].push(e)}),this}once(t,e){const s=(...n)=>{e(...n),this.off(t,s)};return this.on(t,s),this}off(t,e){return t.split(/\W+/).forEach(n=>{if(xe(this._events)&&(this._events={}),this._events.hasOwnProperty(n))if(xe(e))this._events[n]=[];else{const r=this._events[n];for(let o=r.length-1;o>=0;o--)r[o]===e&&r.splice(o,1)}}),this}emit(t,...e){if(this._events&&this._events.hasOwnProperty(t)){const s=this._events[t].slice(0);for(let n=0,r=s.length;n{const s=Object.getOwnPropertyDescriptor(hr.prototype,e);Object.defineProperty(t.prototype,e,s)})}dispose(){return super.dispose(),this._events=void 0,this}}class ah extends hr{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}let ec=class ch extends ah{constructor(){var t,e;super(),this.name="Context",this._constants=new Map,this._timeouts=new Ke,this._timeoutIds=0,this._initialized=!1,this._closeStarted=!1,this.isOffline=!1,this._workletPromise=null;const s=$(ch.getDefaults(),arguments,["context"]);s.context?(this._context=s.context,this._latencyHint=((t=arguments[0])===null||t===void 0?void 0:t.latencyHint)||""):(this._context=Ey({latencyHint:s.latencyHint}),this._latencyHint=s.latencyHint),this._ticker=new Dy(this.emit.bind(this,"tick"),s.clockSource,s.updateInterval,this._context.sampleRate),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this[!((e=arguments[0])===null||e===void 0)&&e.hasOwnProperty("updateInterval")?"_lookAhead":"lookAhead"]=s.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||(Ly(this),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(t,e,s){return this._context.createBuffer(t,e,s)}createChannelMerger(t){return this._context.createChannelMerger(t)}createChannelSplitter(t){return this._context.createChannelSplitter(t)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(t){return this._context.createDelay(t)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(t,e){return this._context.createIIRFilter(t,e)}createPanner(){return this._context.createPanner()}createPeriodicWave(t,e,s){return this._context.createPeriodicWave(t,e,s)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(t){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(t)}createMediaElementSource(t){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(t)}createMediaStreamDestination(){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(t){return this._context.decodeAudioData(t)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(t){ut(!this._initialized,"The listener cannot be set after initialization."),this._listener=t}get transport(){return this.initialize(),this._transport}set transport(t){ut(!this._initialized,"The transport cannot be set after initialization."),this._transport=t}get draw(){return this.initialize(),this._draw}set draw(t){ut(!this._initialized,"Draw cannot be set after initialization."),this._draw=t}get destination(){return this.initialize(),this._destination}set destination(t){ut(!this._initialized,"The destination cannot be set after initialization."),this._destination=t}createAudioWorkletNode(t,e){return My(this.rawContext,t,e)}addAudioWorkletModule(t){return Bt(this,void 0,void 0,function*(){ut(dt(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletPromise||(this._workletPromise=this.rawContext.audioWorklet.addModule(t)),yield this._workletPromise})}workletsAreReady(){return Bt(this,void 0,void 0,function*(){(yield this._workletPromise)?this._workletPromise:Promise.resolve()})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(t){this._ticker.updateInterval=t}get clockSource(){return this._ticker.type}set clockSource(t){this._ticker.type=t}get lookAhead(){return this._lookAhead}set lookAhead(t){this._lookAhead=t,this.updateInterval=t?t/2:.01}get latencyHint(){return this._latencyHint}get rawContext(){return this._context}now(){return this._context.currentTime+this._lookAhead}immediate(){return this._context.currentTime}resume(){return Sn(this._context)?this._context.resume():Promise.resolve()}close(){return Bt(this,void 0,void 0,function*(){Sn(this._context)&&this.state!=="closed"&&!this._closeStarted&&(this._closeStarted=!0,yield this._context.close()),this._initialized&&Vy(this)})}getConstant(t){if(this._constants.has(t))return this._constants.get(t);{const e=this._context.createBuffer(1,128,this._context.sampleRate),s=e.getChannelData(0);for(let r=0;rthis._constants[t].disconnect()),this.close(),this}_timeoutLoop(){const t=this.now();let e=this._timeouts.peek();for(;this._timeouts.length&&e&&e.time<=t;)e.callback(),this._timeouts.shift(),e=this._timeouts.peek()}setTimeout(t,e){this._timeoutIds++;const s=this.now();return this._timeouts.add({callback:t,id:this._timeoutIds,time:s+e}),this._timeoutIds}clearTimeout(t){return this._timeouts.forEach(e=>{e.id===t&&this._timeouts.remove(e)}),this}clearInterval(t){return this.clearTimeout(t)}setInterval(t,e){const s=++this._timeoutIds,n=()=>{const r=this.now();this._timeouts.add({callback:()=>{t(),n()},id:s,time:r+e})};return n(),s}};class Uy extends ah{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(t,e,s){return{}}createChannelMerger(t){return{}}createChannelSplitter(t){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(t){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(t,e){return{}}createPanner(){return{}}createPeriodicWave(t,e,s){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(t){return{}}createMediaElementSource(t){return{}}createMediaStreamDestination(){return{}}decodeAudioData(t){return Promise.resolve({})}createAudioWorkletNode(t,e){return{}}get rawContext(){return{}}addAudioWorkletModule(t){return Bt(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(t,e){return 0}clearTimeout(t){return this}setInterval(t,e){return 0}clearInterval(t){return this}getConstant(t){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(t){}get destination(){return{}}set destination(t){}now(){return 0}immediate(){return 0}}function Mt(i,t){ze(t)?t.forEach(e=>Mt(i,e)):Object.defineProperty(i,t,{enumerable:!0,writable:!1})}function sc(i,t){ze(t)?t.forEach(e=>sc(i,e)):Object.defineProperty(i,t,{writable:!0})}const yt=()=>{};class kt extends ks{constructor(){super(),this.name="ToneAudioBuffer",this.onload=yt;const t=$(kt.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=t.reverse,this.onload=t.onload,fs(t.url)?this.load(t.url).catch(t.onerror):t.url&&this.set(t.url)}static getDefaults(){return{onerror:yt,onload:yt,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Ve().sampleRate}set(t){return t instanceof kt?t.loaded?this._buffer=t.get():t.onload=()=>{this.set(t),this.onload(this)}:this._buffer=t,this._reversed&&this._reverse(),this}get(){return this._buffer}load(t){return Bt(this,void 0,void 0,function*(){const e=kt.load(t).then(s=>{this.set(s),this.onload(this)});kt.downloads.push(e);try{yield e}finally{const s=kt.downloads.indexOf(e);kt.downloads.splice(s,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(t){const e=ze(t)&&t[0].length>0,s=e?t.length:1,n=e?t[0].length:t.length,r=Ve(),o=r.createBuffer(s,n,r.sampleRate),a=!e&&s===1?[t]:t;for(let c=0;cn/s),this.fromArray(e)}return this}toArray(t){if(Ps(t))return this.getChannelData(t);if(this.numberOfChannels===1)return this.toArray(0);{const e=[];for(let s=0;s0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(t){this._reversed!==t&&(this._reversed=t,this._reverse())}static fromArray(t){return new kt().fromArray(t)}static fromUrl(t){return Bt(this,void 0,void 0,function*(){return yield new kt().load(t)})}static load(t){return Bt(this,void 0,void 0,function*(){const e=t.match(/\[([^\]\[]+\|.+)\]$/);if(e){const c=e[1].split("|");let l=c[0];for(const u of c)if(kt.supportsType(u)){l=u;break}t=t.replace(e[0],l)}const s=kt.baseUrl===""||kt.baseUrl.endsWith("/")?kt.baseUrl:kt.baseUrl+"/",n=document.createElement("a");n.href=s+t,n.pathname=(n.pathname+n.hash).split("/").map(encodeURIComponent).join("/");const r=yield fetch(n.href);if(!r.ok)throw new Error(`could not load url: ${t}`);const o=yield r.arrayBuffer();return yield Ve().decodeAudioData(o)})}static supportsType(t){const e=t.split("."),s=e[e.length-1];return document.createElement("audio").canPlayType("audio/"+s)!==""}static loaded(){return Bt(this,void 0,void 0,function*(){for(yield Promise.resolve();kt.downloads.length;)yield kt.downloads[0]})}}kt.baseUrl="";kt.downloads=[];class So extends ec{constructor(){super({clockSource:"offline",context:Nr(arguments[0])?arguments[0]:Oy(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:Nr(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=Nr(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(t){return Bt(this,void 0,void 0,function*(){let e=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,e++;const s=Math.floor(this.sampleRate/128);t&&e%s===0&&(yield new Promise(n=>setTimeout(n,1)))}})}render(t=!0){return Bt(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(t);const e=yield this._context.startRendering();return new kt(e)})}close(){return Promise.resolve()}}const lh=new Uy;let Zs=lh;function Ve(){return Zs===lh&&Ay&&zy(new ec),Zs}function zy(i,t=!1){t&&Zs.dispose(),Sn(i)?Zs=new ec(i):Nr(i)?Zs=new So(i):Zs=i}function jy(){return Zs.resume()}if(tn&&!tn.TONE_SILENCE_LOGGING){const t=` * Tone.js v${cu} * `;console.log(`%c${t}`,"background: #000; color: #fff")}function By(i){return Math.pow(10,i/20)}function qy(i){return 20*(Math.log(i)/Math.LN10)}function uh(i){return Math.pow(2,i/12)}let Eo=440;function Wy(){return Eo}function Hy(i){Eo=i}function _a(i){return Math.round(hh(i))}function hh(i){return 69+12*Math.log2(i/Eo)}function Yy(i){return Eo*Math.pow(2,(i-69)/12)}class nc extends ks{constructor(t,e,s){super(),this.defaultUnits="s",this._val=e,this._units=s,this.context=t,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:t=>this._frequencyToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:t=>this._ticksToUnits(parseInt(t,10)),regexp:/^(\d+)i$/i},m:{method:t=>this._beatsToUnits(parseInt(t,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(t,e)=>{const s=parseInt(t,10),n=e==="."?1.5:1;return s===1?this._beatsToUnits(this._getTimeSignature())*n:this._beatsToUnits(4/s)*n},regexp:/^(\d+)n(\.?)$/i},number:{method:t=>this._expressions[this.defaultUnits].method.call(this,t),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:t=>this._secondsToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:t=>parseInt(t,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:t=>{const e=parseInt(t,10);return this._beatsToUnits(8/(Math.floor(e)*3))},regexp:/^(\d+)t$/i},tr:{method:(t,e,s)=>{let n=0;return t&&t!=="0"&&(n+=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&e!=="0"&&(n+=this._beatsToUnits(parseFloat(e))),s&&s!=="0"&&(n+=this._beatsToUnits(parseFloat(s)/4)),n},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof nc&&this.fromType(this._val),xe(this._val))return this._noArg();if(fs(this._val)&&xe(this._units)){for(const t in this._expressions)if(this._expressions[t].regexp.test(this._val.trim())){this._units=t;break}}else if(Js(this._val)){let t=0;for(const e in this._val)if(dt(this._val[e])){const s=this._val[e],n=new this.constructor(this.context,e).valueOf()*s;t+=n}return t}if(dt(this._units)){const t=this._expressions[this._units],e=this._val.toString().trim().match(t.regexp);return e?t.method.apply(this,e.slice(1)):t.method.call(this,this._val)}else return fs(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(t){return 1/t}_beatsToUnits(t){return 60/this._getBpm()*t}_secondsToUnits(t){return t}_ticksToUnits(t){return t*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(t){switch(this._units=void 0,this.defaultUnits){case"s":this._val=t.toSeconds();break;case"i":this._val=t.toTicks();break;case"hz":this._val=t.toFrequency();break;case"midi":this._val=t.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}}class Ue extends nc{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:t=>this._now()+new this.constructor(this.context,t).valueOf(),regexp:/^\+(.+)/},quantize:{method:t=>{const e=new Ue(this.context,t).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(e))},regexp:/^@(.+)/}})}quantize(t,e=1){const s=new this.constructor(this.context,t).valueOf(),n=this.valueOf(),a=Math.round(n/s)*s-n;return n+a*e}toNotation(){const t=this.toSeconds(),e=["1m"];for(let r=1;r<9;r++){const o=Math.pow(2,r);e.push(o+"n."),e.push(o+"n"),e.push(o+"t")}e.push("0");let s=e[0],n=new Ue(this.context,e[0]).toSeconds();return e.forEach(r=>{const o=new Ue(this.context,r).toSeconds();Math.abs(o-t)3&&(n=parseFloat(parseFloat(r).toFixed(3))),[s,e,n].join(":")}toTicks(){const t=this._beatsToUnits(1);return this.valueOf()/t*this._getPPQ()}toSeconds(){return this.valueOf()}toMidi(){return _a(this.toFrequency())}_now(){return this.context.now()}}class Ae extends Ue{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return Wy()}static set A4(t){Hy(t)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(t){return this.defaultUnits==="midi"?t:Ae.mtof(t)}},note:{regexp:/^([a-g]{1}(?:b|#|##|x|bb|###|#x|x#|bbb)?)(-?[0-9]+)/i,method(t,e){const n=Gy[t.toLowerCase()]+(parseInt(e,10)+1)*12;return this.defaultUnits==="midi"?n:Ae.mtof(n)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(t,e,s){let n=1;return t&&t!=="0"&&(n*=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&e!=="0"&&(n*=this._beatsToUnits(parseFloat(e))),s&&s!=="0"&&(n*=this._beatsToUnits(parseFloat(s)/4)),n}}})}transpose(t){return new Ae(this.context,this.valueOf()*uh(t))}harmonize(t){return t.map(e=>this.transpose(e))}toMidi(){return _a(this.valueOf())}toNote(){const t=this.toFrequency(),e=Math.log2(t/Ae.A4);let s=Math.round(12*e)+57;const n=Math.floor(s/12);return n<0&&(s+=-12*n),$y[s%12]+n.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.floor(e*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(t){return t}_ticksToUnits(t){return 1/(t*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(t){return 1/super._beatsToUnits(t)}_secondsToUnits(t){return 1/t}static mtof(t){return Yy(t)}static ftom(t){return _a(t)}}const Gy={cbbb:-3,cbb:-2,cb:-1,c:0,"c#":1,cx:2,"c##":2,"c###":3,"cx#":3,"c#x":3,dbbb:-1,dbb:0,db:1,d:2,"d#":3,dx:4,"d##":4,"d###":5,"dx#":5,"d#x":5,ebbb:1,ebb:2,eb:3,e:4,"e#":5,ex:6,"e##":6,"e###":7,"ex#":7,"e#x":7,fbbb:2,fbb:3,fb:4,f:5,"f#":6,fx:7,"f##":7,"f###":8,"fx#":8,"f#x":8,gbbb:4,gbb:5,gb:6,g:7,"g#":8,gx:9,"g##":9,"g###":10,"gx#":10,"g#x":10,abbb:6,abb:7,ab:8,a:9,"a#":10,ax:11,"a##":11,"a###":12,"ax#":12,"a#x":12,bbbb:8,bbb:9,bb:10,b:11,"b#":12,bx:13,"b##":13,"b###":14,"bx#":14,"b#x":14},$y=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class wi extends Ue{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class ue extends ks{constructor(){super();const t=$(ue.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=t.context}static getDefaults(){return{context:Ve()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(t){return Cy(t),new Ue(this.context,t).toSeconds()}toFrequency(t){return new Ae(this.context,t).toFrequency()}toTicks(t){return new wi(this.context,t).toTicks()}_getPartialProperties(t){const e=this.get();return Object.keys(e).forEach(s=>{xe(t[s])&&delete e[s]}),e}get(){const t=Ry(this);return Object.keys(t).forEach(e=>{if(Reflect.has(this,e)){const s=this[e];dt(s)&&dt(s.value)&&dt(s.setValueAtTime)?t[e]=s.value:s instanceof ue?t[e]=s._getPartialProperties(t[e]):ze(s)||Ps(s)||fs(s)||by(s)?t[e]=s:delete t[e]}}),t}set(t){return Object.keys(t).forEach(e=>{Reflect.has(this,e)&&dt(this[e])&&(this[e]&&dt(this[e].value)&&dt(this[e].setValueAtTime)?this[e].value!==t[e]&&(this[e].value=t[e]):this[e]instanceof ue?this[e].set(t[e]):this[e]=t[e])}),this}}class ic extends Ke{constructor(t="stopped"){super(),this.name="StateTimeline",this._initial=t,this.setStateAtTime(this._initial,0)}getValueAtTime(t){const e=this.get(t);return e!==null?e.state:this._initial}setStateAtTime(t,e,s){return Be(e,0),this.add(Object.assign({},s,{state:t,time:e})),this}getLastState(t,e){const s=this._search(e);for(let n=s;n>=0;n--){const r=this._timeline[n];if(r.state===t)return r}}getNextState(t,e){const s=this._search(e);if(s!==-1)for(let n=s;n0,"timeConstant must be a number greater than 0");const r=this.toSeconds(e);return this._assertRange(n),ut(isFinite(n)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(t)}, ${JSON.stringify(e)}`),this._events.add({constant:s,time:r,type:"setTargetAtTime",value:n}),this.log(this.units,"setTargetAtTime",t,r,s),this._param.setTargetAtTime(n,r,s),this}setValueCurveAtTime(t,e,s,n=1){s=this.toSeconds(s),e=this.toSeconds(e);const r=this._fromType(t[0])*n;this.setValueAtTime(this._toType(r),e);const o=s/(t.length-1);for(let a=1;a{n.type==="cancelScheduledValues"?t.cancelScheduledValues(n.time):n.type==="setTargetAtTime"?t.setTargetAtTime(n.value,n.time,n.constant):t[n.type](n.value,n.time)}),this}setParam(t){ut(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const e=this.input;return e.disconnect(this._param),this.apply(t),this._param=t,e.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(t,e,s,n,r){return s+(e-s)*Math.exp(-(r-t)/n)}_linearInterpolate(t,e,s,n,r){return e+(n-e)*((r-t)/(s-t))}_exponentialInterpolate(t,e,s,n,r){return e*Math.pow(n/e,(r-t)/(s-t))}}class ot extends ue{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return dt(this.input)?an(this.input)||this.input instanceof xt?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dt(this.output)?this.output.numberOfOutputs:0}_isAudioNode(t){return dt(t)&&(t instanceof ot||As(t))}_getInternalNodes(){const t=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&t.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&t.push(this.output),t}_setChannelProperties(t){this._getInternalNodes().forEach(s=>{s.channelCount=t.channelCount,s.channelCountMode=t.channelCountMode,s.channelInterpretation=t.channelInterpretation})}_getChannelProperties(){const t=this._getInternalNodes();ut(t.length>0,"ToneAudioNode does not have any internal nodes");const e=t[0];return{channelCount:e.channelCount,channelCountMode:e.channelCountMode,channelInterpretation:e.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCount:t}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCountMode:t}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelInterpretation:t}))}connect(t,e=0,s=0){return Ns(this,t,e,s),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return Ja("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(t,e=0,s=0){return Xy(this,t,e,s),this}chain(...t){return Mi(this,...t),this}fan(...t){return t.forEach(e=>this.connect(e)),this}dispose(){return super.dispose(),dt(this.input)&&(this.input instanceof ot?this.input.dispose():As(this.input)&&this.input.disconnect()),dt(this.output)&&(this.output instanceof ot?this.output.dispose():As(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function Mi(...i){const t=i.shift();i.reduce((e,s)=>(e instanceof ot?e.connect(s):As(e)&&Ns(e,s),s),t)}function Ns(i,t,e=0,s=0){for(ut(dt(i),"Cannot connect from undefined node"),ut(dt(t),"Cannot connect to undefined node"),(t instanceof ot||As(t))&&ut(t.numberOfInputs>0,"Cannot connect to node with no inputs"),ut(i.numberOfOutputs>0,"Cannot connect from node with no outputs");t instanceof ot||t instanceof xt;)dt(t.input)&&(t=t.input);for(;i instanceof ot;)dt(i.output)&&(i=i.output);an(t)?i.connect(t,e):i.connect(t,e,s)}function Xy(i,t,e=0,s=0){if(dt(t))for(;t instanceof ot;)t=t.input;for(;!As(i);)dt(i.output)&&(i=i.output);an(t)?i.disconnect(t,e):As(t)?i.disconnect(t,e,s):i.disconnect()}class St extends ot{constructor(){super($(St.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const t=$(St.getDefaults(),arguments,["gain","units"]);this.gain=new xt({context:this.context,convert:t.convert,param:this._gainNode.gain,units:t.units,value:t.gain,minValue:t.minValue,maxValue:t.maxValue}),Mt(this,"gain")}static getDefaults(){return Object.assign(ot.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class zn extends ot{constructor(t){super(t),this.onended=yt,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new St({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){const s=this.toSeconds(e);return this._startTime!==-1&&s>=this._startTime&&(this._stopTime===-1||s<=this._stopTime)?"started":"stopped"},this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut,this._curve=t.curve,this.onended=t.onended}static getDefaults(){return Object.assign(ot.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:yt})}_startGain(t,e=1){ut(this._startTime===-1,"Source cannot be started more than once");const s=this.toSeconds(this._fadeIn);return this._startTime=t+s,this._startTime=Math.max(this._startTime,this.context.currentTime),s>0?(this._gainNode.gain.setValueAtTime(0,t),this._curve==="linear"?this._gainNode.gain.linearRampToValueAtTime(e,t+s):this._gainNode.gain.exponentialApproachValueAtTime(e,t,s)):this._gainNode.gain.setValueAtTime(e,t),this}stop(t){return this.log("stop",t),this._stopGain(this.toSeconds(t)),this}_stopGain(t){ut(this._startTime!==-1,"'start' must be called before 'stop'"),this.cancelStop();const e=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(t)+e,this._stopTime=Math.max(this._stopTime,this.now()),e>0?this._curve==="linear"?this._gainNode.gain.linearRampTo(0,e,t):this._gainNode.gain.targetRampTo(0,e,t):(this._gainNode.gain.cancelAndHoldAtTime(t),this._gainNode.gain.setValueAtTime(0,t)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{const s=this._curve==="exponential"?e*2:0;this._stopSource(this.now()+s),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==yt&&(this.onended(this),this.onended=yt,!this.context.isOffline)){const t=()=>this.dispose();typeof window.requestIdleCallback<"u"?window.requestIdleCallback(t):setTimeout(t,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),ut(this._startTime!==-1,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.dispose(),this.onended=yt,this}}class Gr extends zn{constructor(){super($(Gr.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const t=$(Gr.getDefaults(),arguments,["offset"]);Ns(this._source,this._gainNode),this.offset=new xt({context:this.context,convert:t.convert,param:this._source.offset,units:t.units,value:t.offset,minValue:t.minValue,maxValue:t.maxValue})}static getDefaults(){return Object.assign(zn.getDefaults(),{convert:!0,offset:1,units:"number"})}start(t){const e=this.toSeconds(t);return this.log("start",e),this._startGain(e),this._source.start(e),this}_stopSource(t){this._source.stop(t)}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Ot extends ot{constructor(){super($(Ot.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const t=$(Ot.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Gr({context:this.context,convert:t.convert,offset:t.value,units:t.units,minValue:t.minValue,maxValue:t.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(ot.getDefaults(),{convert:!0,units:"number",value:0})}connect(t,e=0,s=0){return rc(this,t,e,s),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(t,e){return this._param.setValueAtTime(t,e),this}getValueAtTime(t){return this._param.getValueAtTime(t)}setRampPoint(t){return this._param.setRampPoint(t),this}linearRampToValueAtTime(t,e){return this._param.linearRampToValueAtTime(t,e),this}exponentialRampToValueAtTime(t,e){return this._param.exponentialRampToValueAtTime(t,e),this}exponentialRampTo(t,e,s){return this._param.exponentialRampTo(t,e,s),this}linearRampTo(t,e,s){return this._param.linearRampTo(t,e,s),this}targetRampTo(t,e,s){return this._param.targetRampTo(t,e,s),this}exponentialApproachValueAtTime(t,e,s){return this._param.exponentialApproachValueAtTime(t,e,s),this}setTargetAtTime(t,e,s){return this._param.setTargetAtTime(t,e,s),this}setValueCurveAtTime(t,e,s,n){return this._param.setValueCurveAtTime(t,e,s,n),this}cancelScheduledValues(t){return this._param.cancelScheduledValues(t),this}cancelAndHoldAtTime(t){return this._param.cancelAndHoldAtTime(t),this}rampTo(t,e,s){return this._param.rampTo(t,e,s),this}get value(){return this._param.value}set value(t){this._param.value=t}get convert(){return this._param.convert}set convert(t){this._param.convert=t}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(t){this._param.overridden=t}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(t){return this._param.apply(t),this}}function rc(i,t,e,s){(t instanceof xt||an(t)||t instanceof Ot&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Ot&&(t.overridden=!0)),Ns(i,t,e,s)}class $r extends xt{constructor(){super($($r.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Ke(1/0),this._multiplier=1;const t=$($r.getDefaults(),arguments,["value"]);this._multiplier=t.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(t.value)}),this.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(xt.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(t,e,s){e=this.toSeconds(e),this.setRampPoint(e);const n=this._fromType(t),r=this._events.get(e),o=Math.round(Math.max(1/s,1));for(let a=0;a<=o;a++){const c=s*a+e,l=this._exponentialApproach(r.time,r.value,n,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}setValueAtTime(t,e){const s=this.toSeconds(e);super.setValueAtTime(t,e);const n=this._events.get(s),r=this._events.previousEvent(n),o=this._getTicksUntilEvent(r,s);return n.ticks=Math.max(o,0),this}linearRampToValueAtTime(t,e){const s=this.toSeconds(e);super.linearRampToValueAtTime(t,e);const n=this._events.get(s),r=this._events.previousEvent(n),o=this._getTicksUntilEvent(r,s);return n.ticks=Math.max(o,0),this}exponentialRampToValueAtTime(t,e){e=this.toSeconds(e);const s=this._fromType(t),n=this._events.get(e),r=Math.round(Math.max((e-n.time)*10,1)),o=(e-n.time)/r;for(let a=0;a<=r;a++){const c=o*a+n.time,l=this._exponentialInterpolate(n.time,n.value,e,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}_getTicksUntilEvent(t,e){if(t===null)t={ticks:0,time:0,type:"setValueAtTime",value:0};else if(xe(t.ticks)){const o=this._events.previousEvent(t);t.ticks=this._getTicksUntilEvent(o,t.time)}const s=this._fromType(this.getValueAtTime(t.time));let n=this._fromType(this.getValueAtTime(e));const r=this._events.get(e);return r&&r.time===e&&r.type==="setValueAtTime"&&(n=this._fromType(this.getValueAtTime(e-this.sampleTime))),.5*(e-t.time)*(s+n)+t.ticks}getTicksAtTime(t){const e=this.toSeconds(t),s=this._events.get(e);return Math.max(this._getTicksUntilEvent(s,e),0)}getDurationOfTicks(t,e){const s=this.toSeconds(e),n=this.getTicksAtTime(e);return this.getTimeOfTick(n+t)-s}getTimeOfTick(t){const e=this._events.get(t,"ticks"),s=this._events.getAfter(t,"ticks");if(e&&e.ticks===t)return e.time;if(e&&s&&s.type==="linearRampToValueAtTime"&&e.value!==s.value){const n=this._fromType(this.getValueAtTime(e.time)),o=(this._fromType(this.getValueAtTime(s.time))-n)/(s.time-e.time),a=Math.sqrt(Math.pow(n,2)-2*o*(e.ticks-t)),c=(-n+a)/o,l=(-n-a)/o;return(c>0?c:l)+e.time}else return e?e.value===0?1/0:e.time+(t-e.ticks)/e.value:t/this._initialValue}ticksToTime(t,e){return this.getDurationOfTicks(t,e)}timeToTicks(t,e){const s=this.toSeconds(e),n=this.toSeconds(t),r=this.getTicksAtTime(s);return this.getTicksAtTime(s+n)-r}_fromType(t){return this.units==="bpm"&&this.multiplier?1/(60/t/this.multiplier):super._fromType(t)}_toType(t){return this.units==="bpm"&&this.multiplier?t/this.multiplier*60:super._toType(t)}get multiplier(){return this._multiplier}set multiplier(t){const e=this.value;this._multiplier=t,this.cancelScheduledValues(0),this.setValueAtTime(e,0)}}class Xr extends Ot{constructor(){super($(Xr.getDefaults(),arguments,["value"])),this.name="TickSignal";const t=$(Xr.getDefaults(),arguments,["value"]);this.input=this._param=new $r({context:this.context,convert:t.convert,multiplier:t.multiplier,param:this._constantSource.offset,units:t.units,value:t.value})}static getDefaults(){return Object.assign(Ot.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(t,e){return this._param.ticksToTime(t,e)}timeToTicks(t,e){return this._param.timeToTicks(t,e)}getTimeOfTick(t){return this._param.getTimeOfTick(t)}getDurationOfTicks(t,e){return this._param.getDurationOfTicks(t,e)}getTicksAtTime(t){return this._param.getTicksAtTime(t)}get multiplier(){return this._param.multiplier}set multiplier(t){this._param.multiplier=t}dispose(){return super.dispose(),this._param.dispose(),this}}class Zr extends ue{constructor(){super($(Zr.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new ic,this._tickOffset=new Ke,this._ticksAtTime=new Ke,this._secondsAtTime=new Ke;const t=$(Zr.getDefaults(),arguments,["frequency"]);this.frequency=new Xr({context:this.context,units:t.units,value:t.frequency}),Mt(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},ue.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(t,e){const s=this.toSeconds(t);return this._state.getValueAtTime(s)!=="started"&&(this._state.setStateAtTime("started",s),dt(e)&&this.setTicksAtTime(e,s),this._ticksAtTime.cancel(s),this._secondsAtTime.cancel(s)),this}stop(t){const e=this.toSeconds(t);if(this._state.getValueAtTime(e)==="stopped"){const s=this._state.get(e);s&&s.time>0&&(this._tickOffset.cancel(s.time),this._state.cancel(s.time))}return this._state.cancel(e),this._state.setStateAtTime("stopped",e),this.setTicksAtTime(0,e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}pause(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)==="started"&&(this._state.setStateAtTime("paused",e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e)),this}cancel(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}getTicksAtTime(t){const e=this.toSeconds(t),s=this._state.getLastState("stopped",e),n=this._ticksAtTime.get(e),r={state:"paused",time:e};this._state.add(r);let o=n||s,a=n?n.ticks:0,c=null;return this._state.forEachBetween(o.time,e+this.sampleTime,l=>{let u=o.time;const h=this._tickOffset.get(l.time);h&&h.time>=o.time&&(a=h.ticks,u=h.time),o.state==="started"&&l.state!=="started"&&(a+=this.frequency.getTicksAtTime(l.time)-this.frequency.getTicksAtTime(u),l.time!=r.time&&(c={state:l.state,time:l.time,ticks:a})),o=l}),this._state.remove(r),c&&this._ticksAtTime.add(c),a}get ticks(){return this.getTicksAtTime(this.now())}set ticks(t){this.setTicksAtTime(t,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(t){const e=this.now(),s=this.frequency.timeToTicks(t,e);this.setTicksAtTime(s,e)}getSecondsAtTime(t){t=this.toSeconds(t);const e=this._state.getLastState("stopped",t),s={state:"paused",time:t};this._state.add(s);const n=this._secondsAtTime.get(t);let r=n||e,o=n?n.seconds:0,a=null;return this._state.forEachBetween(r.time,t+this.sampleTime,c=>{let l=r.time;const u=this._tickOffset.get(c.time);u&&u.time>=r.time&&(o=u.seconds,l=u.time),r.state==="started"&&c.state!=="started"&&(o+=c.time-l,c.time!=s.time&&(a={state:c.state,time:c.time,seconds:o})),r=c}),this._state.remove(s),a&&this._secondsAtTime.add(a),o}setTicksAtTime(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(t,e),ticks:t,time:e}),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getStateAtTime(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)}getTimeOfTick(t,e=this.now()){const s=this._tickOffset.get(e),n=this._state.get(e),r=Math.max(s.time,n.time),o=this.frequency.getTicksAtTime(r)+t-s.ticks;return this.frequency.getTimeOfTick(o)}forEachTickBetween(t,e,s){let n=this._state.get(t);this._state.forEachBetween(t,e,o=>{n&&n.state==="started"&&o.state!=="started"&&this.forEachTickBetween(Math.max(n.time,t),o.time-this.sampleTime,s),n=o});let r=null;if(n&&n.state==="started"){const o=Math.max(n.time,t),a=this.frequency.getTicksAtTime(o),c=this.frequency.getTicksAtTime(n.time),l=a-c;let u=Math.ceil(l)-l;u=Le(u,1)?0:u;let h=this.frequency.getTimeOfTick(a+u);for(;h{switch(s.state){case"started":const n=this._tickSource.getTicksAtTime(s.time);this.emit("start",s.time,n);break;case"stopped":s.time!==0&&this.emit("stop",s.time);break;case"paused":this.emit("pause",s.time);break}}),this._tickSource.forEachTickBetween(t,e,(s,n)=>{this.callback(s,n)}))}getStateAtTime(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}hr.mixin(Di);class oc extends ks{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const t=$(oc.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=t.baseUrl,Object.keys(t.urls).forEach(e=>{this._loadingCount++;const s=t.urls[e];this.add(e,s,this._bufferLoaded.bind(this,t.onload),t.onerror)})}static getDefaults(){return{baseUrl:"",onerror:yt,onload:yt,urls:{}}}has(t){return this._buffers.has(t.toString())}get(t){return ut(this.has(t),`ToneAudioBuffers has no buffer named: ${t}`),this._buffers.get(t.toString())}_bufferLoaded(t){this._loadingCount--,this._loadingCount===0&&t&&t()}get loaded(){return Array.from(this._buffers).every(([t,e])=>e.loaded)}add(t,e,s=yt,n=yt){return fs(e)?(this.baseUrl&&e.trim().substring(0,11).toLowerCase()==="data:audio/"&&(this.baseUrl=""),this._buffers.set(t.toString(),new kt(this.baseUrl+e,s,n))):this._buffers.set(t.toString(),new kt(e,s,n)),this}dispose(){return super.dispose(),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this}}class An extends wi{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(t){return this._getPPQ()*t}_secondsToUnits(t){return Math.floor(t/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(t){return t}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class Zy extends ue{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Ke,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(t){return this._events.cancel(this.toSeconds(t)),this}_drawLoop(){const t=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=t;){const e=this._events.shift();e&&t-e.time<=this.expiration&&e.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}bo(i=>{i.draw=new Zy({context:i})});Co(i=>{i.draw.dispose()});class Qy extends ks{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(t){ut(dt(t.time),"Events must have a time property"),ut(dt(t.duration),"Events must have a duration parameter"),t.time=t.time.valueOf();let e=new Ky(t.time,t.time+t.duration,t);for(this._root===null?this._root=e:this._root.insert(e),this._length++;e!==null;)e.updateHeight(),e.updateMax(),this._rebalance(e),e=e.parent;return this}remove(t){if(this._root!==null){const e=[];this._root.search(t.time,e);for(const s of e)if(s.event===t){this._removeNode(s),this._length--;break}}return this}get length(){return this._length}cancel(t){return this.forEachFrom(t,e=>this.remove(e)),this}_setRoot(t){this._root=t,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(t,e){t.parent!==null?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)}_removeNode(t){if(t.left===null&&t.right===null)this._replaceNodeInParent(t,null);else if(t.right===null)this._replaceNodeInParent(t,t.left);else if(t.left===null)this._replaceNodeInParent(t,t.right);else{const e=t.getBalance();let s,n=null;if(e>0)if(t.left.right===null)s=t.left,s.right=t.right,n=s;else{for(s=t.left.right;s.right!==null;)s=s.right;s.parent&&(s.parent.right=s.left,n=s.parent,s.left=t.left,s.right=t.right)}else if(t.right.left===null)s=t.right,s.left=t.left,n=s;else{for(s=t.right.left;s.left!==null;)s=s.left;s.parent&&(s.parent.left=s.right,n=s.parent,s.left=t.left,s.right=t.right)}t.parent!==null?t.isLeftChild()?t.parent.left=s:t.parent.right=s:this._setRoot(s),n&&this._rebalance(n)}t.dispose()}_rotateLeft(t){const e=t.parent,s=t.isLeftChild(),n=t.right;n&&(t.right=n.left,n.left=t),e!==null?s?e.left=n:e.right=n:this._setRoot(n)}_rotateRight(t){const e=t.parent,s=t.isLeftChild(),n=t.left;n&&(t.left=n.right,n.right=t),e!==null?s?e.left=n:e.right=n:this._setRoot(n)}_rebalance(t){const e=t.getBalance();e>1&&t.left?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&t.right&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))}get(t){if(this._root!==null){const e=[];if(this._root.search(t,e),e.length>0){let s=e[0];for(let n=1;ns.low&&(s=e[n]);return s.event}}return null}forEach(t){if(this._root!==null){const e=[];this._root.traverse(s=>e.push(s)),e.forEach(s=>{s.event&&t(s.event)})}return this}forEachAtTime(t,e){if(this._root!==null){const s=[];this._root.search(t,s),s.forEach(n=>{n.event&&e(n.event)})}return this}forEachFrom(t,e){if(this._root!==null){const s=[];this._root.searchAfter(t,s),s.forEach(n=>{n.event&&e(n.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(t=>t.dispose()),this._root=null,this}}class Ky{constructor(t,e,s){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=s,this.low=t,this.high=e,this.max=this.high}insert(t){t.low<=this.low?this.left===null?this.left=t:this.left.insert(t):this.right===null?this.right=t:this.right.insert(t)}search(t,e){t>this.max||(this.left!==null&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),!(this.low>t)&&this.right!==null&&this.right.search(t,e))}searchAfter(t,e){this.low>=t&&(e.push(this),this.left!==null&&this.left.searchAfter(t,e)),this.right!==null&&this.right.searchAfter(t,e)}traverse(t){t(this),this.left!==null&&this.left.traverse(t),this.right!==null&&this.right.traverse(t)}updateHeight(){this.left!==null&&this.right!==null?this.height=Math.max(this.left.height,this.right.height)+1:this.right!==null?this.height=this.right.height+1:this.left!==null?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,this.left!==null&&(this.max=Math.max(this.max,this.left.max)),this.right!==null&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let t=0;return this.left!==null&&this.right!==null?t=this.left.height-this.right.height:this.left!==null?t=this.left.height+1:this.right!==null&&(t=-(this.right.height+1)),t}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(t){this._left=t,t!==null&&(t.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(t){this._right=t,t!==null&&(t.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Is extends ot{constructor(){super($(Is.getDefaults(),arguments,["volume"])),this.name="Volume";const t=$(Is.getDefaults(),arguments,["volume"]);this.input=this.output=new St({context:this.context,gain:t.volume,units:"decibels"}),this.volume=this.output.gain,Mt(this,"volume"),this._unmutedVolume=t.volume,this.mute=t.mute}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}let Jy=class ga extends ot{constructor(){super($(ga.getDefaults(),arguments)),this.name="Destination",this.input=new Is({context:this.context}),this.output=new St({context:this.context}),this.volume=this.input.volume;const t=$(ga.getDefaults(),arguments);Mi(this.input,this.output,this.context.rawContext.destination),this.mute=t.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(t){this.input.mute=t}chain(...t){return this.input.disconnect(),t.unshift(this.input),t.push(this.output),Mi(...t),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};bo(i=>{i.destination=new Jy({context:i})});Co(i=>{i.destination.dispose()});class t1 extends ks{constructor(t){super(),this.name="TimelineValue",this._timeline=new Ke({memory:10}),this._initialValue=t}set(t,e){return this._timeline.add({value:t,time:e}),this}get(t){const e=this._timeline.get(t);return e?e.value:this._initialValue}}class ps extends ot{constructor(){super(Object.assign($(ps.getDefaults(),arguments,["context"])))}connect(t,e=0,s=0){return rc(this,t,e,s),this}}class cn extends ps{constructor(){super(Object.assign($(cn.getDefaults(),arguments,["mapping","length"]))),this.name="WaveShaper",this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper;const t=$(cn.getDefaults(),arguments,["mapping","length"]);ze(t.mapping)||t.mapping instanceof Float32Array?this.curve=Float32Array.from(t.mapping):wy(t.mapping)&&this.setMap(t.mapping,t.length)}static getDefaults(){return Object.assign(Ot.getDefaults(),{length:1024})}setMap(t,e=1024){const s=new Float32Array(e);for(let n=0,r=e;ns.includes(t));ut(e,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=t}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class Pi extends ps{constructor(){super(Object.assign($(Pi.getDefaults(),arguments,["value"]))),this.name="Pow";const t=$(Pi.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new cn({context:this.context,mapping:this._expFunc(t.value),length:8192}),this._exponent=t.value}static getDefaults(){return Object.assign(ps.getDefaults(),{value:1})}_expFunc(t){return e=>Math.pow(Math.abs(e),t)}get value(){return this._exponent}set value(t){this._exponent=t,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class Rs{constructor(t,e){this.id=Rs._eventId++,this._remainderTime=0;const s=Object.assign(Rs.getDefaults(),e);this.transport=t,this.callback=s.callback,this._once=s.once,this.time=Math.floor(s.time),this._remainderTime=s.time-this.time}static getDefaults(){return{callback:yt,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(t){if(this.callback){const e=this.transport.bpm.getDurationOfTicks(1,t);this.callback(t+this._remainderTime*e),this._once&&this.transport.clear(this.id)}}dispose(){return this.callback=void 0,this}}Rs._eventId=0;class ac extends Rs{constructor(t,e){super(t,e),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const s=Object.assign(ac.getDefaults(),e);this.duration=s.duration,this._interval=s.interval,this._nextTick=s.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.transport.on("ticks",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Rs.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(t){this._createEvents(t),super.invoke(t)}_createEvent(){return Yr(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new An(this.context,this._nextTick).toSeconds()):-1}_createEvents(t){Yr(this._nextTick+this._interval,this.floatTime+this.duration)&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new An(this.context,this._nextTick).toSeconds()))}_restart(t){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;const e=this.transport.getTicksAtTime(t);Un(e,this.time)&&(this._nextTick=this.floatTime+Math.ceil((e-this.floatTime)/this._interval)*this._interval),this._currentId=this._createEvent(),this._nextTick+=this._interval,this._nextId=this._createEvent()}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this.transport.off("ticks",this._boundRestart),this}}class Ni extends ue{constructor(){super($(Ni.getDefaults(),arguments)),this.name="Transport",this._loop=new t1(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Ke,this._repeatedEvents=new Qy,this._syncedSignals=[],this._swingAmount=0;const t=$(Ni.getDefaults(),arguments);this._ppq=t.ppq,this._clock=new Di({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=t.ppq,this.bpm.setValueAtTime(t.bpm,0),Mt(this,"bpm"),this._timeSignature=t.timeSignature,this._swingTicks=t.ppq/2}static getDefaults(){return Object.assign(ue.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(t,e){if(this._loop.get(t)&&e>=this._loopEnd&&(this.emit("loopEnd",t),this._clock.setTicksAtTime(this._loopStart,t),e=this._loopStart,this.emit("loopStart",t,this._clock.getSecondsAtTime(t)),this.emit("loop",t)),this._swingAmount>0&&e%this._ppq!==0&&e%(this._swingTicks*2)!==0){const s=e%(this._swingTicks*2)/(this._swingTicks*2),n=Math.sin(s*Math.PI)*this._swingAmount;t+=new An(this.context,this._swingTicks*2/3).toSeconds()*n}kl(!0),this._timeline.forEachAtTime(e,s=>s.invoke(t)),kl(!1)}schedule(t,e){const s=new Rs(this,{callback:t,time:new wi(this.context,e).toTicks()});return this._addEvent(s,this._timeline)}scheduleRepeat(t,e,s,n=1/0){const r=new ac(this,{callback:t,duration:new Ue(this.context,n).toTicks(),interval:new Ue(this.context,e).toTicks(),time:new wi(this.context,s).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(t,e){const s=new Rs(this,{callback:t,once:!0,time:new wi(this.context,e).toTicks()});return this._addEvent(s,this._timeline)}clear(t){if(this._scheduledEvents.hasOwnProperty(t)){const e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this}_addEvent(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id}cancel(t=0){const e=this.toTicks(t);return this._timeline.forEachFrom(e,s=>this.clear(s.id)),this._repeatedEvents.forEachFrom(e,s=>this.clear(s.id)),this}_bindClockEvents(){this._clock.on("start",(t,e)=>{e=new An(this.context,e).toSeconds(),this.emit("start",t,e)}),this._clock.on("stop",t=>{this.emit("stop",t)}),this._clock.on("pause",t=>{this.emit("pause",t)})}get state(){return this._clock.getStateAtTime(this.now())}start(t,e){this.context.resume();let s;return dt(e)&&(s=this.toTicks(e)),this._clock.start(t,s),this}stop(t){return this._clock.stop(t),this}pause(t){return this._clock.pause(t),this}toggle(t){return t=this.toSeconds(t),this._clock.getStateAtTime(t)!=="started"?this.start(t):this.stop(t),this}get timeSignature(){return this._timeSignature}set timeSignature(t){ze(t)&&(t=t[0]/t[1]*4),this._timeSignature=t}get loopStart(){return new Ue(this.context,this._loopStart,"i").toSeconds()}set loopStart(t){this._loopStart=this.toTicks(t)}get loopEnd(){return new Ue(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(t){this._loopEnd=this.toTicks(t)}get loop(){return this._loop.get(this.now())}set loop(t){this._loop.set(t,this.now())}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get swing(){return this._swingAmount}set swing(t){this._swingAmount=t}get swingSubdivision(){return new An(this.context,this._swingTicks).toNotation()}set swingSubdivision(t){this._swingTicks=this.toTicks(t)}get position(){const t=this.now(),e=this._clock.getTicksAtTime(t);return new An(this.context,e).toBarsBeatsSixteenths()}set position(t){const e=this.toTicks(t);this.ticks=e}get seconds(){return this._clock.seconds}set seconds(t){const e=this.now(),s=this._clock.frequency.timeToTicks(t,e);this.ticks=s}get progress(){if(this.loop){const t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(t){if(this._clock.ticks!==t){const e=this.now();if(this.state==="started"){const s=this._clock.getTicksAtTime(e),n=this._clock.frequency.getDurationOfTicks(Math.ceil(s)-s,e),r=e+n;this.emit("stop",r),this._clock.setTicksAtTime(t,r),this.emit("start",r,this._clock.getSecondsAtTime(r))}else this.emit("ticks",e),this._clock.setTicksAtTime(t,e)}}getTicksAtTime(t){return this._clock.getTicksAtTime(t)}getSecondsAtTime(t){return this._clock.getSecondsAtTime(t)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(t){this._clock.frequency.multiplier=t}nextSubdivision(t){if(t=this.toTicks(t),this.state!=="started")return 0;{const e=this.now(),s=this.getTicksAtTime(e),n=t-s%t;return this._clock.nextTickTime(n,e)}}syncSignal(t,e){const s=this.now();let n=this.bpm,r=1/(60/n.getValueAtTime(s)/this.PPQ),o=[];if(t.units==="time"){const c=.015625/r,l=new St(c),u=new Pi(-1),h=new St(c);n.chain(l,u,h),n=h,r=1/r,o=[l,u,h]}e||(t.getValueAtTime(s)!==0?e=t.getValueAtTime(s)/r:e=0);const a=new St(e);return n.connect(a),a.connect(t._param),o.push(a),this._syncedSignals.push({initial:t.value,nodes:o,signal:t}),t.value=0,this}unsyncSignal(t){for(let e=this._syncedSignals.length-1;e>=0;e--){const s=this._syncedSignals[e];s.signal===t&&(s.nodes.forEach(n=>n.dispose()),s.signal.value=s.initial,this._syncedSignals.splice(e,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),sc(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}hr.mixin(Ni);bo(i=>{i.transport=new Ni({context:i})});Co(i=>{i.transport.dispose()});class ee extends ot{constructor(t){super(t),this.input=void 0,this._state=new ic("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=yt,this._syncedStop=yt,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Is({context:this.context,mute:t.mute,volume:t.volume}),this.volume=this._volume.volume,Mt(this,"volume"),this.onstop=t.onstop}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,onstop:yt,volume:0})}get state(){return this._synced?this.context.transport.state==="started"?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}_clampToCurrentTime(t){return this._synced?t:Math.max(t,this.context.currentTime)}start(t,e,s){let n=xe(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(n=this._clampToCurrentTime(n),!this._synced&&this._state.getValueAtTime(n)==="started")ut(Un(n,this._state.get(n).time),"Start time must be strictly greater than previous start time"),this._state.cancel(n),this._state.setStateAtTime("started",n),this.log("restart",n),this.restart(n,e,s);else if(this.log("start",n),this._state.setStateAtTime("started",n),this._synced){const r=this._state.get(n);r&&(r.offset=this.toSeconds(Nn(e,0)),r.duration=s?this.toSeconds(s):void 0);const o=this.context.transport.schedule(a=>{this._start(a,e,s)},n);this._scheduled.push(o),this.context.transport.state==="started"&&this.context.transport.getSecondsAtTime(this.immediate())>n&&this._syncedStart(this.now(),this.context.transport.seconds)}else eh(this.context),this._start(n,e,s);return this}stop(t){let e=xe(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(e=this._clampToCurrentTime(e),this._state.getValueAtTime(e)==="started"||dt(this._state.getNextState("started",e))){if(this.log("stop",e),!this._synced)this._stop(e);else{const s=this.context.transport.schedule(this._stop.bind(this),e);this._scheduled.push(s)}this._state.cancel(e),this._state.setStateAtTime("stopped",e)}return this}restart(t,e,s){return t=this.toSeconds(t),this._state.getValueAtTime(t)==="started"&&(this._state.cancel(t),this._restart(t,e,s)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(t,e)=>{if(Un(e,0)){const s=this._state.get(e);if(s&&s.state==="started"&&s.time!==e){const n=e-this.toSeconds(s.time);let r;s.duration&&(r=this.toSeconds(s.duration)-n),this._start(t,this.toSeconds(s.offset)+n,r)}}},this._syncedStop=t=>{const e=this.context.transport.getSecondsAtTime(Math.max(t-this.sampleTime,0));this._state.getValueAtTime(e)==="started"&&this._stop(t)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach(t=>this.context.transport.clear(t)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=yt,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class jn extends zn{constructor(){super($(jn.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const t=$(jn.getDefaults(),arguments,["url","onload"]);Ns(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new xt({context:this.context,param:this._source.playbackRate,units:"positive",value:t.playbackRate}),this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this._buffer=new kt(t.url,t.onload,t.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(zn.getDefaults(),{url:new kt,loop:!1,loopEnd:0,loopStart:0,onload:yt,onerror:yt,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t}get curve(){return this._curve}set curve(t){this._curve=t}start(t,e,s,n=1){ut(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(t);this._startGain(r,n),this.loop?e=Nn(e,this.loopStart):e=Nn(e,0);let o=Math.max(this.toSeconds(e),0);if(this.loop){const a=this.toSeconds(this.loopEnd)||this.buffer.duration,c=this.toSeconds(this.loopStart),l=a-c;ma(o,a)&&(o=(o-c)%l+c),Le(o,this.buffer.duration)&&(o=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Yr(o,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,o)),dt(s)){let a=this.toSeconds(s);a=Math.max(a,0),this.stop(r+a)}return this}_stopSource(t){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(t)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(t){this._source.loopStart=this.toSeconds(t)}get loopEnd(){return this._source.loopEnd}set loopEnd(t){this._source.loopEnd=this.toSeconds(t)}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._source.loop}set loop(t){this._source.loop=t,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class Ii extends ee{constructor(){super($(Ii.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const t=$(Ii.getDefaults(),arguments,["type"]);this._playbackRate=t.playbackRate,this.type=t.type,this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut}static getDefaults(){return Object.assign(ee.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(t){if(ut(t in xl,"Noise: invalid type: "+t),this._type!==t&&(this._type=t,this.state==="started")){const e=this.now();this._stop(e),this._start(e)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this._source&&(this._source.playbackRate.value=t)}_start(t){const e=xl[this._type];this._source=new jn({url:e,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(t),Math.random()*(e.duration-.001))}_stop(t){this._source&&(this._source.stop(this.toSeconds(t)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(t){this._stop(t),this._start(t)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const wn=44100*5,Go=2,cs={brown:null,pink:null,white:null},xl={get brown(){if(!cs.brown){const i=[];for(let t=0;tthis.onstop(this)});this._oscillator=s,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(e)}_stop(t){const e=this.toSeconds(t);this._oscillator&&this._oscillator.stop(e)}_restart(t){const e=this.toSeconds(t);return this.log("restart",e),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(e),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if(this._type==="custom")return jt._periodicWaveCache.find(e=>e.phase===this._phase&&Iy(e.partials,this._partials));{const t=jt._periodicWaveCache.find(e=>e.type===this._type&&e.phase===this._phase);return this._partialCount=t?t.partialCount:this._partialCount,t}}get type(){return this._type}set type(t){this._type=t;const e=["sine","square","sawtooth","triangle"].indexOf(t)!==-1;if(this._phase===0&&e)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=t);else{const s=this._getCachedPeriodicWave();if(dt(s)){const{partials:n,wave:r}=s;this._wave=r,this._partials=n,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{const[n,r]=this._getRealImaginary(t,this._phase),o=this.context.createPeriodicWave(n,r);this._wave=o,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),jt._periodicWaveCache.push({imag:r,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:n,type:this._type,wave:this._wave}),jt._periodicWaveCache.length>100&&jt._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(t){this.partialCount&&this._type!=="custom"&&t!=="custom"?this.type=t+this.partialCount:this.type=t}get partialCount(){return this._partialCount}set partialCount(t){Be(t,0);let e=this._type;const s=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(s&&(e=s[1]),this._type!=="custom")t===0?this.type=e:this.type=e+t.toString();else{const n=new Float32Array(t);this._partials.forEach((r,o)=>n[o]=r),this._partials=Array.from(n),this.type=this._type}}_getRealImaginary(t,e){let n=2048;const r=new Float32Array(n),o=new Float32Array(n);let a=1;if(t==="custom"){if(a=this._partials.length+1,this._partialCount=this._partials.length,n=a,this._partials.length===0)return[r,o]}else{const c=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(t);c?(a=parseInt(c[2],10)+1,this._partialCount=parseInt(c[2],10),t=c[1],a=Math.max(a,2),n=a):this._partialCount=0,this._partials=[]}for(let c=1;c>1&1?-1:1):u=0,this._partials[c-1]=u;break;case"custom":u=this._partials[c-1];break;default:throw new TypeError("Oscillator: invalid type: "+t)}u!==0?(r[c]=-u*Math.sin(e*c),o[c]=u*Math.cos(e*c)):(r[c]=0,o[c]=0)}return[r,o]}_inverseFFT(t,e,s){let n=0;const r=t.length;for(let o=0;o(t+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Fs extends Ot{constructor(){super(Object.assign($(Fs.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const t=$(Fs.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new St({context:this.context,minValue:t.minValue,maxValue:t.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(Ot.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class Ri extends ee{constructor(){super($(Ri.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new e1({context:this.context}),this._modulationNode=new St({context:this.context});const t=$(Ri.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new jt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new jt({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Fs({context:this.context,units:"positive",value:t.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Mt(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(jt.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){this._modulator.restart(t),this._carrier.restart(t)}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class Fi extends ee{constructor(){super($(Fi.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new St({context:this.context,gain:0});const t=$(Fi.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new jt({context:this.context,detune:t.detune,frequency:0,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.detune=this._carrier.detune,this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this._modulator=new jt({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Fs({context:this.context,units:"positive",value:t.harmonicity}),this.modulationIndex=new Fs({context:this.context,units:"positive",value:t.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),Mt(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(jt.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){return this._modulator.restart(t),this._carrier.restart(t),this}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class Bn extends ee{constructor(){super($(Bn.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new St({context:this.context,gain:0}),this._thresh=new cn({context:this.context,mapping:e=>e<=0?-1:1});const t=$(Bn.getDefaults(),arguments,["frequency","width"]);this.width=new Ot({context:this.context,units:"audioRange",value:t.width}),this._triangle=new jt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),Mt(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ee.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(t){t=this.toSeconds(t),this._triangle.start(t),this._widthGate.gain.setValueAtTime(1,t)}_stop(t){t=this.toSeconds(t),this._triangle.stop(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(0,t)}_restart(t){this._triangle.restart(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(1,t)}get phase(){return this._triangle.phase}set phase(t){this._triangle.phase=t}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(t){this._triangle.type=t}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class Li extends ee{constructor(){super($(Li.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const t=$(Li.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Ot({context:this.context,units:"cents",value:t.detune}),this._spread=t.spread,this._type=t.type,this._phase=t.phase,this._partials=t.partials,this._partialCount=t.partialCount,this.count=t.count,Mt(this,["frequency","detune"])}static getDefaults(){return Object.assign(jt.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(t){t=this.toSeconds(t),this._forEach(e=>e.start(t))}_stop(t){t=this.toSeconds(t),this._forEach(e=>e.stop(t))}_restart(t){this._forEach(e=>e.restart(t))}_forEach(t){for(let e=0;ee.type=t)}get spread(){return this._spread}set spread(t){if(this._spread=t,this._oscillators.length>1){const e=-t/2,s=t/(this._oscillators.length-1);this._forEach((n,r)=>n.detune.value=e+s*r)}}get count(){return this._oscillators.length}set count(t){if(Be(t,1),this._oscillators.length!==t){this._forEach(e=>e.dispose()),this._oscillators=[];for(let e=0;ethis.onstop(this):yt});this.type==="custom"&&(s.partials=this._partials),this.frequency.connect(s.frequency),this.detune.connect(s.detune),s.detune.overridden=!1,s.connect(this.output),this._oscillators[e]=s}this.spread=this._spread,this.state==="started"&&this._forEach(e=>e.start())}}get phase(){return this._phase}set phase(t){this._phase=t,this._forEach((e,s)=>e.phase=this._phase+s/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(t){this._forEach(e=>e.baseType=t),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(t){this._partials=t,this._partialCount=this._partials.length,t.length&&(this._type="custom",this._forEach(e=>e.partials=t))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(t){this._partialCount=t,this._forEach(e=>e.partialCount=t),this._type=this._oscillators[0].type}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(t=>t.dispose()),this}}class Vi extends ee{constructor(){super($(Vi.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Fs({context:this.context,value:2});const t=$(Vi.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new Bn({context:this.context,frequency:t.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new jt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Mt(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ee.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)}_stop(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)}_restart(t){this._modulator.restart(t),this._pulse.restart(t)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(t){this._modulator.phase=t}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const Tl={am:Ri,fat:Li,fm:Fi,oscillator:jt,pulse:Bn,pwm:Vi};class ln extends ee{constructor(){super($(ln.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const t=$(ln.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Ot({context:this.context,units:"cents",value:t.detune}),Mt(this,["frequency","detune"]),this.set(t)}static getDefaults(){return Object.assign(jt.getDefaults(),Fi.getDefaults(),Ri.getDefaults(),Li.getDefaults(),Bn.getDefaults(),Vi.getDefaults())}_start(t){this._oscillator.start(t)}_stop(t){this._oscillator.stop(t)}_restart(t){return this._oscillator.restart(t),this}get type(){let t="";return["am","fm","fat"].some(e=>this._sourceType===e)&&(t=this._sourceType),t+this._oscillator.type}set type(t){t.substr(0,2)==="fm"?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):t.substr(0,2)==="am"?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):t.substr(0,3)==="fat"?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(3)):t==="pwm"?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):t==="pulse"?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=t)}get partials(){return this._oscillator.partials}set partials(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partials=t)}get partialCount(){return this._oscillator.partialCount}set partialCount(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partialCount=t)}set(t){return Reflect.has(t,"type")&&t.type&&(this.type=t.type),super.set(t),this}_createNewOscillator(t){if(t!==this._sourceType){this._sourceType=t;const e=Tl[t],s=this.now();if(this._oscillator){const n=this._oscillator;n.stop(s),this.context.setTimeout(()=>n.dispose(),this.blockTime)}this._oscillator=new e({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),this.state==="started"&&this._oscillator.start(s)}}get phase(){return this._oscillator.phase}set phase(t){this._oscillator.phase=t}get sourceType(){return this._sourceType}set sourceType(t){let e="sine";this._oscillator.type!=="pwm"&&this._oscillator.type!=="pulse"&&(e=this._oscillator.type),t==="fm"?this.type="fm"+e:t==="am"?this.type="am"+e:t==="fat"?this.type="fat"+e:t==="oscillator"?this.type=e:t==="pulse"?this.type="pulse":t==="pwm"&&(this.type="pwm")}_getOscType(t,e){return t instanceof Tl[e]}get baseType(){return this._oscillator.baseType}set baseType(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&t!=="pulse"&&t!=="pwm"&&(this._oscillator.baseType=t)}get width(){if(this._getOscType(this._oscillator,"pulse"))return this._oscillator.width}get count(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.count}set count(t){this._getOscType(this._oscillator,"fat")&&Ps(t)&&(this._oscillator.count=t)}get spread(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.spread}set spread(t){this._getOscType(this._oscillator,"fat")&&Ps(t)&&(this._oscillator.spread=t)}get modulationType(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.modulationType}set modulationType(t){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&fs(t)&&(this._oscillator.modulationType=t)}get modulationIndex(){if(this._getOscType(this._oscillator,"fm"))return this._oscillator.modulationIndex}get harmonicity(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.harmonicity}get modulationFrequency(){if(this._getOscType(this._oscillator,"pwm"))return this._oscillator.modulationFrequency}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class cc extends Ot{constructor(){super(Object.assign($(cc.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new St({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,Mi(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Ot.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class Kr extends ps{constructor(){super(Object.assign($(Kr.getDefaults(),arguments,["min","max"]))),this.name="Scale";const t=$(Kr.getDefaults(),arguments,["min","max"]);this._mult=this.input=new Fs({context:this.context,value:t.max-t.min}),this._add=this.output=new cc({context:this.context,value:t.min}),this._min=t.min,this._max=t.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ps.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(t){this._min=t,this._setRange()}get max(){return this._max}set max(t){this._max=t,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}function dh(i,t=1/0){const e=new WeakMap;return function(s,n){Reflect.defineProperty(s,n,{configurable:!0,enumerable:!0,get:function(){return e.get(this)},set:function(r){Be(r,i,t),e.set(this,r)}})}}function xs(i,t=1/0){const e=new WeakMap;return function(s,n){Reflect.defineProperty(s,n,{configurable:!0,enumerable:!0,get:function(){return e.get(this)},set:function(r){Be(this.toSeconds(r),i,t),e.set(this,r)}})}}class Ui extends ee{constructor(){super($(Ui.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const t=$(Ui.getDefaults(),arguments,["url","onload"]);this._buffer=new kt({onload:this._onload.bind(this,t.onload),onerror:t.onerror,reverse:t.reverse,url:t.url}),this.autostart=t.autostart,this._loop=t.loop,this._loopStart=t.loopStart,this._loopEnd=t.loopEnd,this._playbackRate=t.playbackRate,this.fadeIn=t.fadeIn,this.fadeOut=t.fadeOut}static getDefaults(){return Object.assign(ee.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:yt,onerror:yt,playbackRate:1,reverse:!1})}load(t){return Bt(this,void 0,void 0,function*(){return yield this._buffer.load(t),this._onload(),this})}_onload(t=yt){t(),this.autostart&&this.start()}_onSourceEnd(t){this.onstop(this),this._activeSources.delete(t),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())==="started"&&(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(t,e,s){return super.start(t,e,s),this}_start(t,e,s){this._loop?e=Nn(e,this._loopStart):e=Nn(e,0);const n=this.toSeconds(e),r=s;s=Nn(s,Math.max(this._buffer.duration-n,0));let o=this.toSeconds(s);o=o/this._playbackRate,t=this.toSeconds(t);const a=new jn({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);!this._loop&&!this._synced&&(this._state.cancel(t+o),this._state.setStateAtTime("stopped",t+o,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&xe(r)?a.start(t,n):a.start(t,n,o-this.toSeconds(this.fadeOut))}_stop(t){const e=this.toSeconds(t);this._activeSources.forEach(s=>s.stop(e))}restart(t,e,s){return super.restart(t,e,s),this}_restart(t,e,s){var n;(n=[...this._activeSources].pop())===null||n===void 0||n.stop(t),this._start(t,e,s)}seek(t,e){const s=this.toSeconds(e);if(this._state.getValueAtTime(s)==="started"){const n=this.toSeconds(t);this._stop(s),this._start(s,n)}return this}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get loopStart(){return this._loopStart}set loopStart(t){this._loopStart=t,this.buffer.loaded&&Be(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopStart=t})}get loopEnd(){return this._loopEnd}set loopEnd(t){this._loopEnd=t,this.buffer.loaded&&Be(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopEnd=t})}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._loop}set loop(t){if(this._loop!==t&&(this._loop=t,this._activeSources.forEach(e=>{e.loop=t}),t)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t;const e=this.now(),s=this._state.getNextState("stopped",e);s&&s.implicitEnd&&(this._state.cancel(s.time),this._activeSources.forEach(n=>n.cancelStop())),this._activeSources.forEach(n=>{n.playbackRate.setValueAtTime(t,e)})}get reverse(){return this._buffer.reverse}set reverse(t){this._buffer.reverse=t}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(t=>t.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}qe([xs(0)],Ui.prototype,"fadeIn",void 0);qe([xs(0)],Ui.prototype,"fadeOut",void 0);class s1 extends ps{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new cn({context:this.context,mapping:t=>Math.abs(t)*2-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Pe extends ot{constructor(){super($(Pe.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Ot({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const t=$(Pe.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=t.attack,this.decay=t.decay,this.sustain=t.sustain,this.release=t.release,this.attackCurve=t.attackCurve,this.releaseCurve=t.releaseCurve,this.decayCurve=t.decayCurve}static getDefaults(){return Object.assign(ot.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(t,e){if(fs(t))return t;{let s;for(s in Sr)if(Sr[s][e]===t)return s;return t}}_setCurve(t,e,s){if(fs(s)&&Reflect.has(Sr,s)){const n=Sr[s];Js(n)?t!=="_decayCurve"&&(this[t]=n[e]):this[t]=n}else if(ze(s)&&t!=="_decayCurve")this[t]=s;else throw new Error("Envelope: invalid curve: "+s)}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(t){this._setCurve("_attackCurve","In",t)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(t){this._setCurve("_releaseCurve","Out",t)}get decayCurve(){return this._getCurve(this._decayCurve,"Out")}set decayCurve(t){this._setCurve("_decayCurve","Out",t)}triggerAttack(t,e=1){this.log("triggerAttack",t,e),t=this.toSeconds(t);let n=this.toSeconds(this.attack);const r=this.toSeconds(this.decay),o=this.getValueAtTime(t);if(o>0){const a=1/n;n=(1-o)/a}if(n0){const s=this.toSeconds(this.release);s{let t,e;const s=[];for(t=0;t<128;t++)s[t]=Math.sin(t/(128-1)*(Math.PI/2));const n=[],r=6.4;for(t=0;t<128-1;t++){e=t/(128-1);const d=Math.sin(e*(Math.PI*2)*r-Math.PI/2)+1;n[t]=d/10+e*.83}n[128-1]=1;const o=[],a=5;for(t=0;t<128;t++)o[t]=Math.ceil(t/(128-1)*a)/a;const c=[];for(t=0;t<128;t++)e=t/(128-1),c[t]=.5*(1-Math.cos(Math.PI*e));const l=[];for(t=0;t<128;t++){e=t/(128-1);const d=Math.pow(e,3)*4+.2,f=Math.cos(d*Math.PI*2*e);l[t]=Math.abs(f*(1-e))}function u(d){const f=new Array(d.length);for(let _=0;_this._original_triggerRelease(e);const t=$(un.getDefaults(),arguments);this._volume=this.output=new Is({context:this.context,volume:t.volume}),this.volume=this._volume.volume,Mt(this,"volume")}static getDefaults(){return Object.assign(ot.getDefaults(),{volume:0})}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0),this.context.transport.on("stop",this._syncedRelease),this.context.transport.on("pause",this._syncedRelease),this.context.transport.on("loopEnd",this._syncedRelease)),this}_syncState(){let t=!1;return this._synced||(this._synced=!0,t=!0),t}_syncMethod(t,e){const s=this["_original_"+t]=this[t];this[t]=(...n)=>{const r=n[e],o=this.context.transport.schedule(a=>{n[e]=a,s.apply(this,n)},r);this._scheduledEvents.push(o)}}unsync(){return this._scheduledEvents.forEach(t=>this.context.transport.clear(t)),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease,this.context.transport.off("stop",this._syncedRelease),this.context.transport.off("pause",this._syncedRelease),this.context.transport.off("loopEnd",this._syncedRelease)),this}triggerAttackRelease(t,e,s,n){const r=this.toSeconds(s),o=this.toSeconds(e);return this.triggerAttack(t,r,n),this.triggerRelease(r+o),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class ms extends un{constructor(){super($(ms.getDefaults(),arguments));const t=$(ms.getDefaults(),arguments);this.portamento=t.portamento,this.onsilence=t.onsilence}static getDefaults(){return Object.assign(un.getDefaults(),{detune:0,onsilence:yt,portamento:0})}triggerAttack(t,e,s=1){this.log("triggerAttack",t,e,s);const n=this.toSeconds(e);return this._triggerEnvelopeAttack(n,s),this.setNote(t,n),this}triggerRelease(t){this.log("triggerRelease",t);const e=this.toSeconds(t);return this._triggerEnvelopeRelease(e),this}setNote(t,e){const s=this.toSeconds(e),n=t instanceof Ae?t.toFrequency():t;if(this.portamento>0&&this.getLevelAtTime(s)>.05){const r=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(n,r,s)}else this.frequency.setValueAtTime(n,s);return this}}qe([xs(0)],ms.prototype,"portamento",void 0);class Oo extends Pe{constructor(){super($(Oo.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new St({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class zi extends ms{constructor(){super($(zi.getDefaults(),arguments)),this.name="Synth";const t=$(zi.getDefaults(),arguments);this.oscillator=new ln(Object.assign({context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)},t.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Oo(Object.assign({context:this.context},t.envelope)),this.oscillator.chain(this.envelope,this.output),Mt(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(ms.getDefaults(),{envelope:Object.assign(On(Pe.getDefaults(),Object.keys(ot.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(On(ln.getDefaults(),[...Object.keys(ee.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(t,e){if(this.envelope.triggerAttack(t,e),this.oscillator.start(t),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+s+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ji extends ot{constructor(){super($(ji.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const t=$(ji.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new xt({context:this.context,units:"number",value:t.Q,param:this._filter.Q}),this.frequency=new xt({context:this.context,units:"frequency",value:t.frequency,param:this._filter.frequency}),this.detune=new xt({context:this.context,units:"cents",value:t.detune,param:this._filter.detune}),this.gain=new xt({context:this.context,units:"decibels",convert:!1,value:t.gain,param:this._filter.gain}),this.type=t.type}static getDefaults(){return Object.assign(ot.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(t){ut(["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(t)!==-1,`Invalid filter type: ${t}`),this._filter.type=t}getFrequencyResponse(t=128){const e=new Float32Array(t);for(let o=0;os.type=t)}get rolloff(){return this._rolloff}set rolloff(t){const e=Ps(t)?t:parseInt(t,10),s=[-12,-24,-48,-96];let n=s.indexOf(e);ut(n!==-1,`rolloff can only be ${s.join(", ")}`),n+=1,this._rolloff=e,this.input.disconnect(),this._filters.forEach(r=>r.disconnect()),this._filters=new Array(n);for(let r=0;r1);return this._filters.forEach(()=>{e.getFrequencyResponse(t).forEach((r,o)=>s[o]*=r)}),e.dispose(),s}dispose(){return super.dispose(),this._filters.forEach(t=>{t.dispose()}),sc(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Bi extends Pe{constructor(){super($(Bi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const t=$(Bi.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=t.octaves,this._baseFrequency=this.toFrequency(t.baseFrequency),this._exponent=this.input=new Pi({context:this.context,value:t.exponent}),this._scale=this.output=new Kr({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Pe.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(t){const e=this.toFrequency(t);Be(e,0),this._baseFrequency=e,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(t){this._octaves=t,this._scale.max=this._baseFrequency*Math.pow(2,t)}get exponent(){return this._exponent.value}set exponent(t){this._exponent.value=t}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class qi extends ms{constructor(){super($(qi.getDefaults(),arguments)),this.name="MonoSynth";const t=$(qi.getDefaults(),arguments);this.oscillator=new ln(Object.assign(t.oscillator,{context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new qn(Object.assign(t.filter,{context:this.context})),this.filterEnvelope=new Bi(Object.assign(t.filterEnvelope,{context:this.context})),this.envelope=new Oo(Object.assign(t.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Mt(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(ms.getDefaults(),{envelope:Object.assign(On(Pe.getDefaults(),Object.keys(ot.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(On(qn.getDefaults(),Object.keys(ot.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(On(Bi.getDefaults(),Object.keys(ot.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(On(ln.getDefaults(),Object.keys(ee.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(t,e=1){if(this.envelope.triggerAttack(t,e),this.filterEnvelope.triggerAttack(t),this.oscillator.start(t),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+s+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.filterEnvelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Wi extends zi{constructor(){super($(Wi.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const t=$(Wi.getDefaults(),arguments);this.pitchDecay=t.pitchDecay,this.octaves=t.octaves,Mt(this,["oscillator","envelope"])}static getDefaults(){return Pn(ms.getDefaults(),zi.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(t,e){const s=this.toSeconds(e),n=this.toFrequency(t instanceof Ae?t.toFrequency():t),r=n*this.octaves;return this.oscillator.frequency.setValueAtTime(r,s),this.oscillator.frequency.exponentialRampToValueAtTime(n,s+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}qe([dh(0)],Wi.prototype,"octaves",void 0);qe([xs(0)],Wi.prototype,"pitchDecay",void 0);const fh=new Set;function lc(i){fh.add(i)}function ph(i,t){const e=`registerProcessor("${i}", ${t})`;fh.add(e)}const n1=` + */class ks{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...t){(this.debug||tn&&this.toString()===tn.TONE_DEBUG_CLASS)&&Sy(this,...t)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}ks.version=cu;const tc=1e-6;function Un(i,t){return i>t+tc}function ma(i,t){return Un(i,t)||Le(i,t)}function Yr(i,t){return i+tcthis.memory){const e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(t){const e=this._timeline.indexOf(t);return e!==-1&&this._timeline.splice(e,1),this}get(t,e="time"){const s=this._search(t,e);return s!==-1?this._timeline[s]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(t,e="time"){const s=this._search(t,e);return s+10&&this._timeline[e-1].time=0?this._timeline[s-1]:null}cancel(t){if(this._timeline.length>1){let e=this._search(t);if(e>=0)if(Le(this._timeline[e].time,t)){for(let s=e;s>=0&&Le(this._timeline[s].time,t);s--)e=s;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else this._timeline.length===1&&ma(this._timeline[0].time,t)&&(this._timeline=[]);return this}cancelBefore(t){const e=this._search(t);return e>=0&&(this._timeline=this._timeline.slice(e+1)),this}previousEvent(t){const e=this._timeline.indexOf(t);return e>0?this._timeline[e-1]:null}_search(t,e="time"){if(this._timeline.length===0)return-1;let s=0;const n=this._timeline.length;let r=n;if(n>0&&this._timeline[n-1][e]<=t)return n-1;for(;s=0&&this._timeline[s].time>=t;)s--;return this._iterate(e,s+1),this}forEachAtTime(t,e){const s=this._search(t);if(s!==-1&&Le(this._timeline[s].time,t)){let n=s;for(let r=s;r>=0&&Le(this._timeline[r].time,t);r--)n=r;this._iterate(r=>{e(r)},n,s)}return this}dispose(){return super.dispose(),this._timeline=[],this}};const rh=[];function bo(i){rh.push(i)}function Ly(i){rh.forEach(t=>t(i))}const oh=[];function Co(i){oh.push(i)}function Vy(i){oh.forEach(t=>t(i))}class hr extends ks{constructor(){super(...arguments),this.name="Emitter"}on(t,e){return t.split(/\W+/).forEach(n=>{xe(this._events)&&(this._events={}),this._events.hasOwnProperty(n)||(this._events[n]=[]),this._events[n].push(e)}),this}once(t,e){const s=(...n)=>{e(...n),this.off(t,s)};return this.on(t,s),this}off(t,e){return t.split(/\W+/).forEach(n=>{if(xe(this._events)&&(this._events={}),this._events.hasOwnProperty(n))if(xe(e))this._events[n]=[];else{const r=this._events[n];for(let o=r.length-1;o>=0;o--)r[o]===e&&r.splice(o,1)}}),this}emit(t,...e){if(this._events&&this._events.hasOwnProperty(t)){const s=this._events[t].slice(0);for(let n=0,r=s.length;n{const s=Object.getOwnPropertyDescriptor(hr.prototype,e);Object.defineProperty(t.prototype,e,s)})}dispose(){return super.dispose(),this._events=void 0,this}}class ah extends hr{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}let ec=class ch extends ah{constructor(){var t,e;super(),this.name="Context",this._constants=new Map,this._timeouts=new Ke,this._timeoutIds=0,this._initialized=!1,this._closeStarted=!1,this.isOffline=!1,this._workletPromise=null;const s=$(ch.getDefaults(),arguments,["context"]);s.context?(this._context=s.context,this._latencyHint=((t=arguments[0])===null||t===void 0?void 0:t.latencyHint)||""):(this._context=Ey({latencyHint:s.latencyHint}),this._latencyHint=s.latencyHint),this._ticker=new Dy(this.emit.bind(this,"tick"),s.clockSource,s.updateInterval,this._context.sampleRate),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this[!((e=arguments[0])===null||e===void 0)&&e.hasOwnProperty("updateInterval")?"_lookAhead":"lookAhead"]=s.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||(Ly(this),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(t,e,s){return this._context.createBuffer(t,e,s)}createChannelMerger(t){return this._context.createChannelMerger(t)}createChannelSplitter(t){return this._context.createChannelSplitter(t)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(t){return this._context.createDelay(t)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(t,e){return this._context.createIIRFilter(t,e)}createPanner(){return this._context.createPanner()}createPeriodicWave(t,e,s){return this._context.createPeriodicWave(t,e,s)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(t){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(t)}createMediaElementSource(t){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(t)}createMediaStreamDestination(){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(t){return this._context.decodeAudioData(t)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(t){ut(!this._initialized,"The listener cannot be set after initialization."),this._listener=t}get transport(){return this.initialize(),this._transport}set transport(t){ut(!this._initialized,"The transport cannot be set after initialization."),this._transport=t}get draw(){return this.initialize(),this._draw}set draw(t){ut(!this._initialized,"Draw cannot be set after initialization."),this._draw=t}get destination(){return this.initialize(),this._destination}set destination(t){ut(!this._initialized,"The destination cannot be set after initialization."),this._destination=t}createAudioWorkletNode(t,e){return My(this.rawContext,t,e)}addAudioWorkletModule(t){return Bt(this,void 0,void 0,function*(){ut(dt(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletPromise||(this._workletPromise=this.rawContext.audioWorklet.addModule(t)),yield this._workletPromise})}workletsAreReady(){return Bt(this,void 0,void 0,function*(){(yield this._workletPromise)?this._workletPromise:Promise.resolve()})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(t){this._ticker.updateInterval=t}get clockSource(){return this._ticker.type}set clockSource(t){this._ticker.type=t}get lookAhead(){return this._lookAhead}set lookAhead(t){this._lookAhead=t,this.updateInterval=t?t/2:.01}get latencyHint(){return this._latencyHint}get rawContext(){return this._context}now(){return this._context.currentTime+this._lookAhead}immediate(){return this._context.currentTime}resume(){return Sn(this._context)?this._context.resume():Promise.resolve()}close(){return Bt(this,void 0,void 0,function*(){Sn(this._context)&&this.state!=="closed"&&!this._closeStarted&&(this._closeStarted=!0,yield this._context.close()),this._initialized&&Vy(this)})}getConstant(t){if(this._constants.has(t))return this._constants.get(t);{const e=this._context.createBuffer(1,128,this._context.sampleRate),s=e.getChannelData(0);for(let r=0;rthis._constants[t].disconnect()),this.close(),this}_timeoutLoop(){const t=this.now();let e=this._timeouts.peek();for(;this._timeouts.length&&e&&e.time<=t;)e.callback(),this._timeouts.shift(),e=this._timeouts.peek()}setTimeout(t,e){this._timeoutIds++;const s=this.now();return this._timeouts.add({callback:t,id:this._timeoutIds,time:s+e}),this._timeoutIds}clearTimeout(t){return this._timeouts.forEach(e=>{e.id===t&&this._timeouts.remove(e)}),this}clearInterval(t){return this.clearTimeout(t)}setInterval(t,e){const s=++this._timeoutIds,n=()=>{const r=this.now();this._timeouts.add({callback:()=>{t(),n()},id:s,time:r+e})};return n(),s}};class Uy extends ah{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(t,e,s){return{}}createChannelMerger(t){return{}}createChannelSplitter(t){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(t){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(t,e){return{}}createPanner(){return{}}createPeriodicWave(t,e,s){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(t){return{}}createMediaElementSource(t){return{}}createMediaStreamDestination(){return{}}decodeAudioData(t){return Promise.resolve({})}createAudioWorkletNode(t,e){return{}}get rawContext(){return{}}addAudioWorkletModule(t){return Bt(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(t,e){return 0}clearTimeout(t){return this}setInterval(t,e){return 0}clearInterval(t){return this}getConstant(t){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(t){}get destination(){return{}}set destination(t){}now(){return 0}immediate(){return 0}}function Mt(i,t){ze(t)?t.forEach(e=>Mt(i,e)):Object.defineProperty(i,t,{enumerable:!0,writable:!1})}function sc(i,t){ze(t)?t.forEach(e=>sc(i,e)):Object.defineProperty(i,t,{writable:!0})}const yt=()=>{};class kt extends ks{constructor(){super(),this.name="ToneAudioBuffer",this.onload=yt;const t=$(kt.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=t.reverse,this.onload=t.onload,fs(t.url)?this.load(t.url).catch(t.onerror):t.url&&this.set(t.url)}static getDefaults(){return{onerror:yt,onload:yt,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Ve().sampleRate}set(t){return t instanceof kt?t.loaded?this._buffer=t.get():t.onload=()=>{this.set(t),this.onload(this)}:this._buffer=t,this._reversed&&this._reverse(),this}get(){return this._buffer}load(t){return Bt(this,void 0,void 0,function*(){const e=kt.load(t).then(s=>{this.set(s),this.onload(this)});kt.downloads.push(e);try{yield e}finally{const s=kt.downloads.indexOf(e);kt.downloads.splice(s,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(t){const e=ze(t)&&t[0].length>0,s=e?t.length:1,n=e?t[0].length:t.length,r=Ve(),o=r.createBuffer(s,n,r.sampleRate),a=!e&&s===1?[t]:t;for(let c=0;cn/s),this.fromArray(e)}return this}toArray(t){if(Ps(t))return this.getChannelData(t);if(this.numberOfChannels===1)return this.toArray(0);{const e=[];for(let s=0;s0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(t){this._reversed!==t&&(this._reversed=t,this._reverse())}static fromArray(t){return new kt().fromArray(t)}static fromUrl(t){return Bt(this,void 0,void 0,function*(){return yield new kt().load(t)})}static load(t){return Bt(this,void 0,void 0,function*(){const e=t.match(/\[([^\]\[]+\|.+)\]$/);if(e){const c=e[1].split("|");let l=c[0];for(const u of c)if(kt.supportsType(u)){l=u;break}t=t.replace(e[0],l)}const s=kt.baseUrl===""||kt.baseUrl.endsWith("/")?kt.baseUrl:kt.baseUrl+"/",n=document.createElement("a");n.href=s+t,n.pathname=(n.pathname+n.hash).split("/").map(encodeURIComponent).join("/");const r=yield fetch(n.href);if(!r.ok)throw new Error(`could not load url: ${t}`);const o=yield r.arrayBuffer();return yield Ve().decodeAudioData(o)})}static supportsType(t){const e=t.split("."),s=e[e.length-1];return document.createElement("audio").canPlayType("audio/"+s)!==""}static loaded(){return Bt(this,void 0,void 0,function*(){for(yield Promise.resolve();kt.downloads.length;)yield kt.downloads[0]})}}kt.baseUrl="";kt.downloads=[];class So extends ec{constructor(){super({clockSource:"offline",context:Nr(arguments[0])?arguments[0]:Oy(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:Nr(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=Nr(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(t){return Bt(this,void 0,void 0,function*(){let e=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,e++;const s=Math.floor(this.sampleRate/128);t&&e%s===0&&(yield new Promise(n=>setTimeout(n,1)))}})}render(t=!0){return Bt(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(t);const e=yield this._context.startRendering();return new kt(e)})}close(){return Promise.resolve()}}const lh=new Uy;let Zs=lh;function Ve(){return Zs===lh&&Ay&&zy(new ec),Zs}function zy(i,t=!1){t&&Zs.dispose(),Sn(i)?Zs=new ec(i):Nr(i)?Zs=new So(i):Zs=i}function jy(){return Zs.resume()}if(tn&&!tn.TONE_SILENCE_LOGGING){const t=` * Tone.js v${cu} * `;console.log(`%c${t}`,"background: #000; color: #fff")}function By(i){return Math.pow(10,i/20)}function qy(i){return 20*(Math.log(i)/Math.LN10)}function uh(i){return Math.pow(2,i/12)}let Eo=440;function Wy(){return Eo}function Hy(i){Eo=i}function _a(i){return Math.round(hh(i))}function hh(i){return 69+12*Math.log2(i/Eo)}function Yy(i){return Eo*Math.pow(2,(i-69)/12)}class nc extends ks{constructor(t,e,s){super(),this.defaultUnits="s",this._val=e,this._units=s,this.context=t,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:t=>this._frequencyToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:t=>this._ticksToUnits(parseInt(t,10)),regexp:/^(\d+)i$/i},m:{method:t=>this._beatsToUnits(parseInt(t,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(t,e)=>{const s=parseInt(t,10),n=e==="."?1.5:1;return s===1?this._beatsToUnits(this._getTimeSignature())*n:this._beatsToUnits(4/s)*n},regexp:/^(\d+)n(\.?)$/i},number:{method:t=>this._expressions[this.defaultUnits].method.call(this,t),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:t=>this._secondsToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:t=>parseInt(t,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:t=>{const e=parseInt(t,10);return this._beatsToUnits(8/(Math.floor(e)*3))},regexp:/^(\d+)t$/i},tr:{method:(t,e,s)=>{let n=0;return t&&t!=="0"&&(n+=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&e!=="0"&&(n+=this._beatsToUnits(parseFloat(e))),s&&s!=="0"&&(n+=this._beatsToUnits(parseFloat(s)/4)),n},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof nc&&this.fromType(this._val),xe(this._val))return this._noArg();if(fs(this._val)&&xe(this._units)){for(const t in this._expressions)if(this._expressions[t].regexp.test(this._val.trim())){this._units=t;break}}else if(Js(this._val)){let t=0;for(const e in this._val)if(dt(this._val[e])){const s=this._val[e],n=new this.constructor(this.context,e).valueOf()*s;t+=n}return t}if(dt(this._units)){const t=this._expressions[this._units],e=this._val.toString().trim().match(t.regexp);return e?t.method.apply(this,e.slice(1)):t.method.call(this,this._val)}else return fs(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(t){return 1/t}_beatsToUnits(t){return 60/this._getBpm()*t}_secondsToUnits(t){return t}_ticksToUnits(t){return t*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(t){switch(this._units=void 0,this.defaultUnits){case"s":this._val=t.toSeconds();break;case"i":this._val=t.toTicks();break;case"hz":this._val=t.toFrequency();break;case"midi":this._val=t.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}}class Ue extends nc{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:t=>this._now()+new this.constructor(this.context,t).valueOf(),regexp:/^\+(.+)/},quantize:{method:t=>{const e=new Ue(this.context,t).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(e))},regexp:/^@(.+)/}})}quantize(t,e=1){const s=new this.constructor(this.context,t).valueOf(),n=this.valueOf(),a=Math.round(n/s)*s-n;return n+a*e}toNotation(){const t=this.toSeconds(),e=["1m"];for(let r=1;r<9;r++){const o=Math.pow(2,r);e.push(o+"n."),e.push(o+"n"),e.push(o+"t")}e.push("0");let s=e[0],n=new Ue(this.context,e[0]).toSeconds();return e.forEach(r=>{const o=new Ue(this.context,r).toSeconds();Math.abs(o-t)3&&(n=parseFloat(parseFloat(r).toFixed(3))),[s,e,n].join(":")}toTicks(){const t=this._beatsToUnits(1);return this.valueOf()/t*this._getPPQ()}toSeconds(){return this.valueOf()}toMidi(){return _a(this.toFrequency())}_now(){return this.context.now()}}class Ae extends Ue{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return Wy()}static set A4(t){Hy(t)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(t){return this.defaultUnits==="midi"?t:Ae.mtof(t)}},note:{regexp:/^([a-g]{1}(?:b|#|##|x|bb|###|#x|x#|bbb)?)(-?[0-9]+)/i,method(t,e){const n=Gy[t.toLowerCase()]+(parseInt(e,10)+1)*12;return this.defaultUnits==="midi"?n:Ae.mtof(n)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(t,e,s){let n=1;return t&&t!=="0"&&(n*=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&e!=="0"&&(n*=this._beatsToUnits(parseFloat(e))),s&&s!=="0"&&(n*=this._beatsToUnits(parseFloat(s)/4)),n}}})}transpose(t){return new Ae(this.context,this.valueOf()*uh(t))}harmonize(t){return t.map(e=>this.transpose(e))}toMidi(){return _a(this.valueOf())}toNote(){const t=this.toFrequency(),e=Math.log2(t/Ae.A4);let s=Math.round(12*e)+57;const n=Math.floor(s/12);return n<0&&(s+=-12*n),$y[s%12]+n.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.floor(e*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(t){return t}_ticksToUnits(t){return 1/(t*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(t){return 1/super._beatsToUnits(t)}_secondsToUnits(t){return 1/t}static mtof(t){return Yy(t)}static ftom(t){return _a(t)}}const Gy={cbbb:-3,cbb:-2,cb:-1,c:0,"c#":1,cx:2,"c##":2,"c###":3,"cx#":3,"c#x":3,dbbb:-1,dbb:0,db:1,d:2,"d#":3,dx:4,"d##":4,"d###":5,"dx#":5,"d#x":5,ebbb:1,ebb:2,eb:3,e:4,"e#":5,ex:6,"e##":6,"e###":7,"ex#":7,"e#x":7,fbbb:2,fbb:3,fb:4,f:5,"f#":6,fx:7,"f##":7,"f###":8,"fx#":8,"f#x":8,gbbb:4,gbb:5,gb:6,g:7,"g#":8,gx:9,"g##":9,"g###":10,"gx#":10,"g#x":10,abbb:6,abb:7,ab:8,a:9,"a#":10,ax:11,"a##":11,"a###":12,"ax#":12,"a#x":12,bbbb:8,bbb:9,bb:10,b:11,"b#":12,bx:13,"b##":13,"b###":14,"bx#":14,"b#x":14},$y=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class wi extends Ue{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class ue extends ks{constructor(){super();const t=$(ue.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=t.context}static getDefaults(){return{context:Ve()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(t){return Cy(t),new Ue(this.context,t).toSeconds()}toFrequency(t){return new Ae(this.context,t).toFrequency()}toTicks(t){return new wi(this.context,t).toTicks()}_getPartialProperties(t){const e=this.get();return Object.keys(e).forEach(s=>{xe(t[s])&&delete e[s]}),e}get(){const t=Ry(this);return Object.keys(t).forEach(e=>{if(Reflect.has(this,e)){const s=this[e];dt(s)&&dt(s.value)&&dt(s.setValueAtTime)?t[e]=s.value:s instanceof ue?t[e]=s._getPartialProperties(t[e]):ze(s)||Ps(s)||fs(s)||by(s)?t[e]=s:delete t[e]}}),t}set(t){return Object.keys(t).forEach(e=>{Reflect.has(this,e)&&dt(this[e])&&(this[e]&&dt(this[e].value)&&dt(this[e].setValueAtTime)?this[e].value!==t[e]&&(this[e].value=t[e]):this[e]instanceof ue?this[e].set(t[e]):this[e]=t[e])}),this}}class ic extends Ke{constructor(t="stopped"){super(),this.name="StateTimeline",this._initial=t,this.setStateAtTime(this._initial,0)}getValueAtTime(t){const e=this.get(t);return e!==null?e.state:this._initial}setStateAtTime(t,e,s){return Be(e,0),this.add(Object.assign({},s,{state:t,time:e})),this}getLastState(t,e){const s=this._search(e);for(let n=s;n>=0;n--){const r=this._timeline[n];if(r.state===t)return r}}getNextState(t,e){const s=this._search(e);if(s!==-1)for(let n=s;n0,"timeConstant must be a number greater than 0");const r=this.toSeconds(e);return this._assertRange(n),ut(isFinite(n)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(t)}, ${JSON.stringify(e)}`),this._events.add({constant:s,time:r,type:"setTargetAtTime",value:n}),this.log(this.units,"setTargetAtTime",t,r,s),this._param.setTargetAtTime(n,r,s),this}setValueCurveAtTime(t,e,s,n=1){s=this.toSeconds(s),e=this.toSeconds(e);const r=this._fromType(t[0])*n;this.setValueAtTime(this._toType(r),e);const o=s/(t.length-1);for(let a=1;a{n.type==="cancelScheduledValues"?t.cancelScheduledValues(n.time):n.type==="setTargetAtTime"?t.setTargetAtTime(n.value,n.time,n.constant):t[n.type](n.value,n.time)}),this}setParam(t){ut(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const e=this.input;return e.disconnect(this._param),this.apply(t),this._param=t,e.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(t,e,s,n,r){return s+(e-s)*Math.exp(-(r-t)/n)}_linearInterpolate(t,e,s,n,r){return e+(n-e)*((r-t)/(s-t))}_exponentialInterpolate(t,e,s,n,r){return e*Math.pow(n/e,(r-t)/(s-t))}}class ot extends ue{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return dt(this.input)?an(this.input)||this.input instanceof xt?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dt(this.output)?this.output.numberOfOutputs:0}_isAudioNode(t){return dt(t)&&(t instanceof ot||As(t))}_getInternalNodes(){const t=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&t.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&t.push(this.output),t}_setChannelProperties(t){this._getInternalNodes().forEach(s=>{s.channelCount=t.channelCount,s.channelCountMode=t.channelCountMode,s.channelInterpretation=t.channelInterpretation})}_getChannelProperties(){const t=this._getInternalNodes();ut(t.length>0,"ToneAudioNode does not have any internal nodes");const e=t[0];return{channelCount:e.channelCount,channelCountMode:e.channelCountMode,channelInterpretation:e.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCount:t}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCountMode:t}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelInterpretation:t}))}connect(t,e=0,s=0){return Ns(this,t,e,s),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return Ja("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(t,e=0,s=0){return Xy(this,t,e,s),this}chain(...t){return Mi(this,...t),this}fan(...t){return t.forEach(e=>this.connect(e)),this}dispose(){return super.dispose(),dt(this.input)&&(this.input instanceof ot?this.input.dispose():As(this.input)&&this.input.disconnect()),dt(this.output)&&(this.output instanceof ot?this.output.dispose():As(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function Mi(...i){const t=i.shift();i.reduce((e,s)=>(e instanceof ot?e.connect(s):As(e)&&Ns(e,s),s),t)}function Ns(i,t,e=0,s=0){for(ut(dt(i),"Cannot connect from undefined node"),ut(dt(t),"Cannot connect to undefined node"),(t instanceof ot||As(t))&&ut(t.numberOfInputs>0,"Cannot connect to node with no inputs"),ut(i.numberOfOutputs>0,"Cannot connect from node with no outputs");t instanceof ot||t instanceof xt;)dt(t.input)&&(t=t.input);for(;i instanceof ot;)dt(i.output)&&(i=i.output);an(t)?i.connect(t,e):i.connect(t,e,s)}function Xy(i,t,e=0,s=0){if(dt(t))for(;t instanceof ot;)t=t.input;for(;!As(i);)dt(i.output)&&(i=i.output);an(t)?i.disconnect(t,e):As(t)?i.disconnect(t,e,s):i.disconnect()}class St extends ot{constructor(){super($(St.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const t=$(St.getDefaults(),arguments,["gain","units"]);this.gain=new xt({context:this.context,convert:t.convert,param:this._gainNode.gain,units:t.units,value:t.gain,minValue:t.minValue,maxValue:t.maxValue}),Mt(this,"gain")}static getDefaults(){return Object.assign(ot.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class zn extends ot{constructor(t){super(t),this.onended=yt,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new St({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){const s=this.toSeconds(e);return this._startTime!==-1&&s>=this._startTime&&(this._stopTime===-1||s<=this._stopTime)?"started":"stopped"},this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut,this._curve=t.curve,this.onended=t.onended}static getDefaults(){return Object.assign(ot.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:yt})}_startGain(t,e=1){ut(this._startTime===-1,"Source cannot be started more than once");const s=this.toSeconds(this._fadeIn);return this._startTime=t+s,this._startTime=Math.max(this._startTime,this.context.currentTime),s>0?(this._gainNode.gain.setValueAtTime(0,t),this._curve==="linear"?this._gainNode.gain.linearRampToValueAtTime(e,t+s):this._gainNode.gain.exponentialApproachValueAtTime(e,t,s)):this._gainNode.gain.setValueAtTime(e,t),this}stop(t){return this.log("stop",t),this._stopGain(this.toSeconds(t)),this}_stopGain(t){ut(this._startTime!==-1,"'start' must be called before 'stop'"),this.cancelStop();const e=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(t)+e,this._stopTime=Math.max(this._stopTime,this.now()),e>0?this._curve==="linear"?this._gainNode.gain.linearRampTo(0,e,t):this._gainNode.gain.targetRampTo(0,e,t):(this._gainNode.gain.cancelAndHoldAtTime(t),this._gainNode.gain.setValueAtTime(0,t)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{const s=this._curve==="exponential"?e*2:0;this._stopSource(this.now()+s),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==yt&&(this.onended(this),this.onended=yt,!this.context.isOffline)){const t=()=>this.dispose();typeof window.requestIdleCallback<"u"?window.requestIdleCallback(t):setTimeout(t,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),ut(this._startTime!==-1,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.dispose(),this.onended=yt,this}}class Gr extends zn{constructor(){super($(Gr.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const t=$(Gr.getDefaults(),arguments,["offset"]);Ns(this._source,this._gainNode),this.offset=new xt({context:this.context,convert:t.convert,param:this._source.offset,units:t.units,value:t.offset,minValue:t.minValue,maxValue:t.maxValue})}static getDefaults(){return Object.assign(zn.getDefaults(),{convert:!0,offset:1,units:"number"})}start(t){const e=this.toSeconds(t);return this.log("start",e),this._startGain(e),this._source.start(e),this}_stopSource(t){this._source.stop(t)}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Ot extends ot{constructor(){super($(Ot.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const t=$(Ot.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Gr({context:this.context,convert:t.convert,offset:t.value,units:t.units,minValue:t.minValue,maxValue:t.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(ot.getDefaults(),{convert:!0,units:"number",value:0})}connect(t,e=0,s=0){return rc(this,t,e,s),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(t,e){return this._param.setValueAtTime(t,e),this}getValueAtTime(t){return this._param.getValueAtTime(t)}setRampPoint(t){return this._param.setRampPoint(t),this}linearRampToValueAtTime(t,e){return this._param.linearRampToValueAtTime(t,e),this}exponentialRampToValueAtTime(t,e){return this._param.exponentialRampToValueAtTime(t,e),this}exponentialRampTo(t,e,s){return this._param.exponentialRampTo(t,e,s),this}linearRampTo(t,e,s){return this._param.linearRampTo(t,e,s),this}targetRampTo(t,e,s){return this._param.targetRampTo(t,e,s),this}exponentialApproachValueAtTime(t,e,s){return this._param.exponentialApproachValueAtTime(t,e,s),this}setTargetAtTime(t,e,s){return this._param.setTargetAtTime(t,e,s),this}setValueCurveAtTime(t,e,s,n){return this._param.setValueCurveAtTime(t,e,s,n),this}cancelScheduledValues(t){return this._param.cancelScheduledValues(t),this}cancelAndHoldAtTime(t){return this._param.cancelAndHoldAtTime(t),this}rampTo(t,e,s){return this._param.rampTo(t,e,s),this}get value(){return this._param.value}set value(t){this._param.value=t}get convert(){return this._param.convert}set convert(t){this._param.convert=t}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(t){this._param.overridden=t}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(t){return this._param.apply(t),this}}function rc(i,t,e,s){(t instanceof xt||an(t)||t instanceof Ot&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Ot&&(t.overridden=!0)),Ns(i,t,e,s)}class $r extends xt{constructor(){super($($r.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Ke(1/0),this._multiplier=1;const t=$($r.getDefaults(),arguments,["value"]);this._multiplier=t.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(t.value)}),this.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(xt.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(t,e,s){e=this.toSeconds(e),this.setRampPoint(e);const n=this._fromType(t),r=this._events.get(e),o=Math.round(Math.max(1/s,1));for(let a=0;a<=o;a++){const c=s*a+e,l=this._exponentialApproach(r.time,r.value,n,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}setValueAtTime(t,e){const s=this.toSeconds(e);super.setValueAtTime(t,e);const n=this._events.get(s),r=this._events.previousEvent(n),o=this._getTicksUntilEvent(r,s);return n.ticks=Math.max(o,0),this}linearRampToValueAtTime(t,e){const s=this.toSeconds(e);super.linearRampToValueAtTime(t,e);const n=this._events.get(s),r=this._events.previousEvent(n),o=this._getTicksUntilEvent(r,s);return n.ticks=Math.max(o,0),this}exponentialRampToValueAtTime(t,e){e=this.toSeconds(e);const s=this._fromType(t),n=this._events.get(e),r=Math.round(Math.max((e-n.time)*10,1)),o=(e-n.time)/r;for(let a=0;a<=r;a++){const c=o*a+n.time,l=this._exponentialInterpolate(n.time,n.value,e,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}_getTicksUntilEvent(t,e){if(t===null)t={ticks:0,time:0,type:"setValueAtTime",value:0};else if(xe(t.ticks)){const o=this._events.previousEvent(t);t.ticks=this._getTicksUntilEvent(o,t.time)}const s=this._fromType(this.getValueAtTime(t.time));let n=this._fromType(this.getValueAtTime(e));const r=this._events.get(e);return r&&r.time===e&&r.type==="setValueAtTime"&&(n=this._fromType(this.getValueAtTime(e-this.sampleTime))),.5*(e-t.time)*(s+n)+t.ticks}getTicksAtTime(t){const e=this.toSeconds(t),s=this._events.get(e);return Math.max(this._getTicksUntilEvent(s,e),0)}getDurationOfTicks(t,e){const s=this.toSeconds(e),n=this.getTicksAtTime(e);return this.getTimeOfTick(n+t)-s}getTimeOfTick(t){const e=this._events.get(t,"ticks"),s=this._events.getAfter(t,"ticks");if(e&&e.ticks===t)return e.time;if(e&&s&&s.type==="linearRampToValueAtTime"&&e.value!==s.value){const n=this._fromType(this.getValueAtTime(e.time)),o=(this._fromType(this.getValueAtTime(s.time))-n)/(s.time-e.time),a=Math.sqrt(Math.pow(n,2)-2*o*(e.ticks-t)),c=(-n+a)/o,l=(-n-a)/o;return(c>0?c:l)+e.time}else return e?e.value===0?1/0:e.time+(t-e.ticks)/e.value:t/this._initialValue}ticksToTime(t,e){return this.getDurationOfTicks(t,e)}timeToTicks(t,e){const s=this.toSeconds(e),n=this.toSeconds(t),r=this.getTicksAtTime(s);return this.getTicksAtTime(s+n)-r}_fromType(t){return this.units==="bpm"&&this.multiplier?1/(60/t/this.multiplier):super._fromType(t)}_toType(t){return this.units==="bpm"&&this.multiplier?t/this.multiplier*60:super._toType(t)}get multiplier(){return this._multiplier}set multiplier(t){const e=this.value;this._multiplier=t,this.cancelScheduledValues(0),this.setValueAtTime(e,0)}}class Xr extends Ot{constructor(){super($(Xr.getDefaults(),arguments,["value"])),this.name="TickSignal";const t=$(Xr.getDefaults(),arguments,["value"]);this.input=this._param=new $r({context:this.context,convert:t.convert,multiplier:t.multiplier,param:this._constantSource.offset,units:t.units,value:t.value})}static getDefaults(){return Object.assign(Ot.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(t,e){return this._param.ticksToTime(t,e)}timeToTicks(t,e){return this._param.timeToTicks(t,e)}getTimeOfTick(t){return this._param.getTimeOfTick(t)}getDurationOfTicks(t,e){return this._param.getDurationOfTicks(t,e)}getTicksAtTime(t){return this._param.getTicksAtTime(t)}get multiplier(){return this._param.multiplier}set multiplier(t){this._param.multiplier=t}dispose(){return super.dispose(),this._param.dispose(),this}}class Zr extends ue{constructor(){super($(Zr.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new ic,this._tickOffset=new Ke,this._ticksAtTime=new Ke,this._secondsAtTime=new Ke;const t=$(Zr.getDefaults(),arguments,["frequency"]);this.frequency=new Xr({context:this.context,units:t.units,value:t.frequency}),Mt(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},ue.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(t,e){const s=this.toSeconds(t);return this._state.getValueAtTime(s)!=="started"&&(this._state.setStateAtTime("started",s),dt(e)&&this.setTicksAtTime(e,s),this._ticksAtTime.cancel(s),this._secondsAtTime.cancel(s)),this}stop(t){const e=this.toSeconds(t);if(this._state.getValueAtTime(e)==="stopped"){const s=this._state.get(e);s&&s.time>0&&(this._tickOffset.cancel(s.time),this._state.cancel(s.time))}return this._state.cancel(e),this._state.setStateAtTime("stopped",e),this.setTicksAtTime(0,e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}pause(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)==="started"&&(this._state.setStateAtTime("paused",e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e)),this}cancel(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}getTicksAtTime(t){const e=this.toSeconds(t),s=this._state.getLastState("stopped",e),n=this._ticksAtTime.get(e),r={state:"paused",time:e};this._state.add(r);let o=n||s,a=n?n.ticks:0,c=null;return this._state.forEachBetween(o.time,e+this.sampleTime,l=>{let u=o.time;const h=this._tickOffset.get(l.time);h&&h.time>=o.time&&(a=h.ticks,u=h.time),o.state==="started"&&l.state!=="started"&&(a+=this.frequency.getTicksAtTime(l.time)-this.frequency.getTicksAtTime(u),l.time!=r.time&&(c={state:l.state,time:l.time,ticks:a})),o=l}),this._state.remove(r),c&&this._ticksAtTime.add(c),a}get ticks(){return this.getTicksAtTime(this.now())}set ticks(t){this.setTicksAtTime(t,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(t){const e=this.now(),s=this.frequency.timeToTicks(t,e);this.setTicksAtTime(s,e)}getSecondsAtTime(t){t=this.toSeconds(t);const e=this._state.getLastState("stopped",t),s={state:"paused",time:t};this._state.add(s);const n=this._secondsAtTime.get(t);let r=n||e,o=n?n.seconds:0,a=null;return this._state.forEachBetween(r.time,t+this.sampleTime,c=>{let l=r.time;const u=this._tickOffset.get(c.time);u&&u.time>=r.time&&(o=u.seconds,l=u.time),r.state==="started"&&c.state!=="started"&&(o+=c.time-l,c.time!=s.time&&(a={state:c.state,time:c.time,seconds:o})),r=c}),this._state.remove(s),a&&this._secondsAtTime.add(a),o}setTicksAtTime(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(t,e),ticks:t,time:e}),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getStateAtTime(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)}getTimeOfTick(t,e=this.now()){const s=this._tickOffset.get(e),n=this._state.get(e),r=Math.max(s.time,n.time),o=this.frequency.getTicksAtTime(r)+t-s.ticks;return this.frequency.getTimeOfTick(o)}forEachTickBetween(t,e,s){let n=this._state.get(t);this._state.forEachBetween(t,e,o=>{n&&n.state==="started"&&o.state!=="started"&&this.forEachTickBetween(Math.max(n.time,t),o.time-this.sampleTime,s),n=o});let r=null;if(n&&n.state==="started"){const o=Math.max(n.time,t),a=this.frequency.getTicksAtTime(o),c=this.frequency.getTicksAtTime(n.time),l=a-c;let u=Math.ceil(l)-l;u=Le(u,1)?0:u;let h=this.frequency.getTimeOfTick(a+u);for(;h{switch(s.state){case"started":const n=this._tickSource.getTicksAtTime(s.time);this.emit("start",s.time,n);break;case"stopped":s.time!==0&&this.emit("stop",s.time);break;case"paused":this.emit("pause",s.time);break}}),this._tickSource.forEachTickBetween(t,e,(s,n)=>{this.callback(s,n)}))}getStateAtTime(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}hr.mixin(Di);class oc extends ks{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const t=$(oc.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=t.baseUrl,Object.keys(t.urls).forEach(e=>{this._loadingCount++;const s=t.urls[e];this.add(e,s,this._bufferLoaded.bind(this,t.onload),t.onerror)})}static getDefaults(){return{baseUrl:"",onerror:yt,onload:yt,urls:{}}}has(t){return this._buffers.has(t.toString())}get(t){return ut(this.has(t),`ToneAudioBuffers has no buffer named: ${t}`),this._buffers.get(t.toString())}_bufferLoaded(t){this._loadingCount--,this._loadingCount===0&&t&&t()}get loaded(){return Array.from(this._buffers).every(([t,e])=>e.loaded)}add(t,e,s=yt,n=yt){return fs(e)?(this.baseUrl&&e.trim().substring(0,11).toLowerCase()==="data:audio/"&&(this.baseUrl=""),this._buffers.set(t.toString(),new kt(this.baseUrl+e,s,n))):this._buffers.set(t.toString(),new kt(e,s,n)),this}dispose(){return super.dispose(),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this}}class An extends wi{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(t){return this._getPPQ()*t}_secondsToUnits(t){return Math.floor(t/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(t){return t}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class Zy extends ue{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Ke,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(t){return this._events.cancel(this.toSeconds(t)),this}_drawLoop(){const t=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=t;){const e=this._events.shift();e&&t-e.time<=this.expiration&&e.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}bo(i=>{i.draw=new Zy({context:i})});Co(i=>{i.draw.dispose()});class Qy extends ks{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(t){ut(dt(t.time),"Events must have a time property"),ut(dt(t.duration),"Events must have a duration parameter"),t.time=t.time.valueOf();let e=new Ky(t.time,t.time+t.duration,t);for(this._root===null?this._root=e:this._root.insert(e),this._length++;e!==null;)e.updateHeight(),e.updateMax(),this._rebalance(e),e=e.parent;return this}remove(t){if(this._root!==null){const e=[];this._root.search(t.time,e);for(const s of e)if(s.event===t){this._removeNode(s),this._length--;break}}return this}get length(){return this._length}cancel(t){return this.forEachFrom(t,e=>this.remove(e)),this}_setRoot(t){this._root=t,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(t,e){t.parent!==null?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)}_removeNode(t){if(t.left===null&&t.right===null)this._replaceNodeInParent(t,null);else if(t.right===null)this._replaceNodeInParent(t,t.left);else if(t.left===null)this._replaceNodeInParent(t,t.right);else{const e=t.getBalance();let s,n=null;if(e>0)if(t.left.right===null)s=t.left,s.right=t.right,n=s;else{for(s=t.left.right;s.right!==null;)s=s.right;s.parent&&(s.parent.right=s.left,n=s.parent,s.left=t.left,s.right=t.right)}else if(t.right.left===null)s=t.right,s.left=t.left,n=s;else{for(s=t.right.left;s.left!==null;)s=s.left;s.parent&&(s.parent.left=s.right,n=s.parent,s.left=t.left,s.right=t.right)}t.parent!==null?t.isLeftChild()?t.parent.left=s:t.parent.right=s:this._setRoot(s),n&&this._rebalance(n)}t.dispose()}_rotateLeft(t){const e=t.parent,s=t.isLeftChild(),n=t.right;n&&(t.right=n.left,n.left=t),e!==null?s?e.left=n:e.right=n:this._setRoot(n)}_rotateRight(t){const e=t.parent,s=t.isLeftChild(),n=t.left;n&&(t.left=n.right,n.right=t),e!==null?s?e.left=n:e.right=n:this._setRoot(n)}_rebalance(t){const e=t.getBalance();e>1&&t.left?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&t.right&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))}get(t){if(this._root!==null){const e=[];if(this._root.search(t,e),e.length>0){let s=e[0];for(let n=1;ns.low&&(s=e[n]);return s.event}}return null}forEach(t){if(this._root!==null){const e=[];this._root.traverse(s=>e.push(s)),e.forEach(s=>{s.event&&t(s.event)})}return this}forEachAtTime(t,e){if(this._root!==null){const s=[];this._root.search(t,s),s.forEach(n=>{n.event&&e(n.event)})}return this}forEachFrom(t,e){if(this._root!==null){const s=[];this._root.searchAfter(t,s),s.forEach(n=>{n.event&&e(n.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(t=>t.dispose()),this._root=null,this}}class Ky{constructor(t,e,s){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=s,this.low=t,this.high=e,this.max=this.high}insert(t){t.low<=this.low?this.left===null?this.left=t:this.left.insert(t):this.right===null?this.right=t:this.right.insert(t)}search(t,e){t>this.max||(this.left!==null&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),!(this.low>t)&&this.right!==null&&this.right.search(t,e))}searchAfter(t,e){this.low>=t&&(e.push(this),this.left!==null&&this.left.searchAfter(t,e)),this.right!==null&&this.right.searchAfter(t,e)}traverse(t){t(this),this.left!==null&&this.left.traverse(t),this.right!==null&&this.right.traverse(t)}updateHeight(){this.left!==null&&this.right!==null?this.height=Math.max(this.left.height,this.right.height)+1:this.right!==null?this.height=this.right.height+1:this.left!==null?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,this.left!==null&&(this.max=Math.max(this.max,this.left.max)),this.right!==null&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let t=0;return this.left!==null&&this.right!==null?t=this.left.height-this.right.height:this.left!==null?t=this.left.height+1:this.right!==null&&(t=-(this.right.height+1)),t}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(t){this._left=t,t!==null&&(t.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(t){this._right=t,t!==null&&(t.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Is extends ot{constructor(){super($(Is.getDefaults(),arguments,["volume"])),this.name="Volume";const t=$(Is.getDefaults(),arguments,["volume"]);this.input=this.output=new St({context:this.context,gain:t.volume,units:"decibels"}),this.volume=this.output.gain,Mt(this,"volume"),this._unmutedVolume=t.volume,this.mute=t.mute}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}let Jy=class ga extends ot{constructor(){super($(ga.getDefaults(),arguments)),this.name="Destination",this.input=new Is({context:this.context}),this.output=new St({context:this.context}),this.volume=this.input.volume;const t=$(ga.getDefaults(),arguments);Mi(this.input,this.output,this.context.rawContext.destination),this.mute=t.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(t){this.input.mute=t}chain(...t){return this.input.disconnect(),t.unshift(this.input),t.push(this.output),Mi(...t),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};bo(i=>{i.destination=new Jy({context:i})});Co(i=>{i.destination.dispose()});class t1 extends ks{constructor(t){super(),this.name="TimelineValue",this._timeline=new Ke({memory:10}),this._initialValue=t}set(t,e){return this._timeline.add({value:t,time:e}),this}get(t){const e=this._timeline.get(t);return e?e.value:this._initialValue}}class ps extends ot{constructor(){super(Object.assign($(ps.getDefaults(),arguments,["context"])))}connect(t,e=0,s=0){return rc(this,t,e,s),this}}class cn extends ps{constructor(){super(Object.assign($(cn.getDefaults(),arguments,["mapping","length"]))),this.name="WaveShaper",this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper;const t=$(cn.getDefaults(),arguments,["mapping","length"]);ze(t.mapping)||t.mapping instanceof Float32Array?this.curve=Float32Array.from(t.mapping):wy(t.mapping)&&this.setMap(t.mapping,t.length)}static getDefaults(){return Object.assign(Ot.getDefaults(),{length:1024})}setMap(t,e=1024){const s=new Float32Array(e);for(let n=0,r=e;ns.includes(t));ut(e,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=t}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class Pi extends ps{constructor(){super(Object.assign($(Pi.getDefaults(),arguments,["value"]))),this.name="Pow";const t=$(Pi.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new cn({context:this.context,mapping:this._expFunc(t.value),length:8192}),this._exponent=t.value}static getDefaults(){return Object.assign(ps.getDefaults(),{value:1})}_expFunc(t){return e=>Math.pow(Math.abs(e),t)}get value(){return this._exponent}set value(t){this._exponent=t,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class Rs{constructor(t,e){this.id=Rs._eventId++,this._remainderTime=0;const s=Object.assign(Rs.getDefaults(),e);this.transport=t,this.callback=s.callback,this._once=s.once,this.time=Math.floor(s.time),this._remainderTime=s.time-this.time}static getDefaults(){return{callback:yt,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(t){if(this.callback){const e=this.transport.bpm.getDurationOfTicks(1,t);this.callback(t+this._remainderTime*e),this._once&&this.transport.clear(this.id)}}dispose(){return this.callback=void 0,this}}Rs._eventId=0;class ac extends Rs{constructor(t,e){super(t,e),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const s=Object.assign(ac.getDefaults(),e);this.duration=s.duration,this._interval=s.interval,this._nextTick=s.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.transport.on("ticks",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Rs.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(t){this._createEvents(t),super.invoke(t)}_createEvent(){return Yr(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new An(this.context,this._nextTick).toSeconds()):-1}_createEvents(t){Yr(this._nextTick+this._interval,this.floatTime+this.duration)&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new An(this.context,this._nextTick).toSeconds()))}_restart(t){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;const e=this.transport.getTicksAtTime(t);Un(e,this.time)&&(this._nextTick=this.floatTime+Math.ceil((e-this.floatTime)/this._interval)*this._interval),this._currentId=this._createEvent(),this._nextTick+=this._interval,this._nextId=this._createEvent()}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this.transport.off("ticks",this._boundRestart),this}}class Ni extends ue{constructor(){super($(Ni.getDefaults(),arguments)),this.name="Transport",this._loop=new t1(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Ke,this._repeatedEvents=new Qy,this._syncedSignals=[],this._swingAmount=0;const t=$(Ni.getDefaults(),arguments);this._ppq=t.ppq,this._clock=new Di({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=t.ppq,this.bpm.setValueAtTime(t.bpm,0),Mt(this,"bpm"),this._timeSignature=t.timeSignature,this._swingTicks=t.ppq/2}static getDefaults(){return Object.assign(ue.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(t,e){if(this._loop.get(t)&&e>=this._loopEnd&&(this.emit("loopEnd",t),this._clock.setTicksAtTime(this._loopStart,t),e=this._loopStart,this.emit("loopStart",t,this._clock.getSecondsAtTime(t)),this.emit("loop",t)),this._swingAmount>0&&e%this._ppq!==0&&e%(this._swingTicks*2)!==0){const s=e%(this._swingTicks*2)/(this._swingTicks*2),n=Math.sin(s*Math.PI)*this._swingAmount;t+=new An(this.context,this._swingTicks*2/3).toSeconds()*n}kl(!0),this._timeline.forEachAtTime(e,s=>s.invoke(t)),kl(!1)}schedule(t,e){const s=new Rs(this,{callback:t,time:new wi(this.context,e).toTicks()});return this._addEvent(s,this._timeline)}scheduleRepeat(t,e,s,n=1/0){const r=new ac(this,{callback:t,duration:new Ue(this.context,n).toTicks(),interval:new Ue(this.context,e).toTicks(),time:new wi(this.context,s).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(t,e){const s=new Rs(this,{callback:t,once:!0,time:new wi(this.context,e).toTicks()});return this._addEvent(s,this._timeline)}clear(t){if(this._scheduledEvents.hasOwnProperty(t)){const e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this}_addEvent(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id}cancel(t=0){const e=this.toTicks(t);return this._timeline.forEachFrom(e,s=>this.clear(s.id)),this._repeatedEvents.forEachFrom(e,s=>this.clear(s.id)),this}_bindClockEvents(){this._clock.on("start",(t,e)=>{e=new An(this.context,e).toSeconds(),this.emit("start",t,e)}),this._clock.on("stop",t=>{this.emit("stop",t)}),this._clock.on("pause",t=>{this.emit("pause",t)})}get state(){return this._clock.getStateAtTime(this.now())}start(t,e){this.context.resume();let s;return dt(e)&&(s=this.toTicks(e)),this._clock.start(t,s),this}stop(t){return this._clock.stop(t),this}pause(t){return this._clock.pause(t),this}toggle(t){return t=this.toSeconds(t),this._clock.getStateAtTime(t)!=="started"?this.start(t):this.stop(t),this}get timeSignature(){return this._timeSignature}set timeSignature(t){ze(t)&&(t=t[0]/t[1]*4),this._timeSignature=t}get loopStart(){return new Ue(this.context,this._loopStart,"i").toSeconds()}set loopStart(t){this._loopStart=this.toTicks(t)}get loopEnd(){return new Ue(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(t){this._loopEnd=this.toTicks(t)}get loop(){return this._loop.get(this.now())}set loop(t){this._loop.set(t,this.now())}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get swing(){return this._swingAmount}set swing(t){this._swingAmount=t}get swingSubdivision(){return new An(this.context,this._swingTicks).toNotation()}set swingSubdivision(t){this._swingTicks=this.toTicks(t)}get position(){const t=this.now(),e=this._clock.getTicksAtTime(t);return new An(this.context,e).toBarsBeatsSixteenths()}set position(t){const e=this.toTicks(t);this.ticks=e}get seconds(){return this._clock.seconds}set seconds(t){const e=this.now(),s=this._clock.frequency.timeToTicks(t,e);this.ticks=s}get progress(){if(this.loop){const t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(t){if(this._clock.ticks!==t){const e=this.now();if(this.state==="started"){const s=this._clock.getTicksAtTime(e),n=this._clock.frequency.getDurationOfTicks(Math.ceil(s)-s,e),r=e+n;this.emit("stop",r),this._clock.setTicksAtTime(t,r),this.emit("start",r,this._clock.getSecondsAtTime(r))}else this.emit("ticks",e),this._clock.setTicksAtTime(t,e)}}getTicksAtTime(t){return this._clock.getTicksAtTime(t)}getSecondsAtTime(t){return this._clock.getSecondsAtTime(t)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(t){this._clock.frequency.multiplier=t}nextSubdivision(t){if(t=this.toTicks(t),this.state!=="started")return 0;{const e=this.now(),s=this.getTicksAtTime(e),n=t-s%t;return this._clock.nextTickTime(n,e)}}syncSignal(t,e){const s=this.now();let n=this.bpm,r=1/(60/n.getValueAtTime(s)/this.PPQ),o=[];if(t.units==="time"){const c=.015625/r,l=new St(c),u=new Pi(-1),h=new St(c);n.chain(l,u,h),n=h,r=1/r,o=[l,u,h]}e||(t.getValueAtTime(s)!==0?e=t.getValueAtTime(s)/r:e=0);const a=new St(e);return n.connect(a),a.connect(t._param),o.push(a),this._syncedSignals.push({initial:t.value,nodes:o,signal:t}),t.value=0,this}unsyncSignal(t){for(let e=this._syncedSignals.length-1;e>=0;e--){const s=this._syncedSignals[e];s.signal===t&&(s.nodes.forEach(n=>n.dispose()),s.signal.value=s.initial,this._syncedSignals.splice(e,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),sc(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}hr.mixin(Ni);bo(i=>{i.transport=new Ni({context:i})});Co(i=>{i.transport.dispose()});class ee extends ot{constructor(t){super(t),this.input=void 0,this._state=new ic("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=yt,this._syncedStop=yt,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Is({context:this.context,mute:t.mute,volume:t.volume}),this.volume=this._volume.volume,Mt(this,"volume"),this.onstop=t.onstop}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,onstop:yt,volume:0})}get state(){return this._synced?this.context.transport.state==="started"?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}_clampToCurrentTime(t){return this._synced?t:Math.max(t,this.context.currentTime)}start(t,e,s){let n=xe(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(n=this._clampToCurrentTime(n),!this._synced&&this._state.getValueAtTime(n)==="started")ut(Un(n,this._state.get(n).time),"Start time must be strictly greater than previous start time"),this._state.cancel(n),this._state.setStateAtTime("started",n),this.log("restart",n),this.restart(n,e,s);else if(this.log("start",n),this._state.setStateAtTime("started",n),this._synced){const r=this._state.get(n);r&&(r.offset=this.toSeconds(Nn(e,0)),r.duration=s?this.toSeconds(s):void 0);const o=this.context.transport.schedule(a=>{this._start(a,e,s)},n);this._scheduled.push(o),this.context.transport.state==="started"&&this.context.transport.getSecondsAtTime(this.immediate())>n&&this._syncedStart(this.now(),this.context.transport.seconds)}else eh(this.context),this._start(n,e,s);return this}stop(t){let e=xe(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(e=this._clampToCurrentTime(e),this._state.getValueAtTime(e)==="started"||dt(this._state.getNextState("started",e))){if(this.log("stop",e),!this._synced)this._stop(e);else{const s=this.context.transport.schedule(this._stop.bind(this),e);this._scheduled.push(s)}this._state.cancel(e),this._state.setStateAtTime("stopped",e)}return this}restart(t,e,s){return t=this.toSeconds(t),this._state.getValueAtTime(t)==="started"&&(this._state.cancel(t),this._restart(t,e,s)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(t,e)=>{if(Un(e,0)){const s=this._state.get(e);if(s&&s.state==="started"&&s.time!==e){const n=e-this.toSeconds(s.time);let r;s.duration&&(r=this.toSeconds(s.duration)-n),this._start(t,this.toSeconds(s.offset)+n,r)}}},this._syncedStop=t=>{const e=this.context.transport.getSecondsAtTime(Math.max(t-this.sampleTime,0));this._state.getValueAtTime(e)==="started"&&this._stop(t)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach(t=>this.context.transport.clear(t)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=yt,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class jn extends zn{constructor(){super($(jn.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const t=$(jn.getDefaults(),arguments,["url","onload"]);Ns(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new xt({context:this.context,param:this._source.playbackRate,units:"positive",value:t.playbackRate}),this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this._buffer=new kt(t.url,t.onload,t.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(zn.getDefaults(),{url:new kt,loop:!1,loopEnd:0,loopStart:0,onload:yt,onerror:yt,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t}get curve(){return this._curve}set curve(t){this._curve=t}start(t,e,s,n=1){ut(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(t);this._startGain(r,n),this.loop?e=Nn(e,this.loopStart):e=Nn(e,0);let o=Math.max(this.toSeconds(e),0);if(this.loop){const a=this.toSeconds(this.loopEnd)||this.buffer.duration,c=this.toSeconds(this.loopStart),l=a-c;ma(o,a)&&(o=(o-c)%l+c),Le(o,this.buffer.duration)&&(o=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Yr(o,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,o)),dt(s)){let a=this.toSeconds(s);a=Math.max(a,0),this.stop(r+a)}return this}_stopSource(t){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(t)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(t){this._source.loopStart=this.toSeconds(t)}get loopEnd(){return this._source.loopEnd}set loopEnd(t){this._source.loopEnd=this.toSeconds(t)}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._source.loop}set loop(t){this._source.loop=t,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class Ii extends ee{constructor(){super($(Ii.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const t=$(Ii.getDefaults(),arguments,["type"]);this._playbackRate=t.playbackRate,this.type=t.type,this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut}static getDefaults(){return Object.assign(ee.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(t){if(ut(t in xl,"Noise: invalid type: "+t),this._type!==t&&(this._type=t,this.state==="started")){const e=this.now();this._stop(e),this._start(e)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this._source&&(this._source.playbackRate.value=t)}_start(t){const e=xl[this._type];this._source=new jn({url:e,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(t),Math.random()*(e.duration-.001))}_stop(t){this._source&&(this._source.stop(this.toSeconds(t)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(t){this._stop(t),this._start(t)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const wn=44100*5,Go=2,cs={brown:null,pink:null,white:null},xl={get brown(){if(!cs.brown){const i=[];for(let t=0;tthis.onstop(this)});this._oscillator=s,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(e)}_stop(t){const e=this.toSeconds(t);this._oscillator&&this._oscillator.stop(e)}_restart(t){const e=this.toSeconds(t);return this.log("restart",e),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(e),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if(this._type==="custom")return jt._periodicWaveCache.find(e=>e.phase===this._phase&&Iy(e.partials,this._partials));{const t=jt._periodicWaveCache.find(e=>e.type===this._type&&e.phase===this._phase);return this._partialCount=t?t.partialCount:this._partialCount,t}}get type(){return this._type}set type(t){this._type=t;const e=["sine","square","sawtooth","triangle"].indexOf(t)!==-1;if(this._phase===0&&e)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=t);else{const s=this._getCachedPeriodicWave();if(dt(s)){const{partials:n,wave:r}=s;this._wave=r,this._partials=n,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{const[n,r]=this._getRealImaginary(t,this._phase),o=this.context.createPeriodicWave(n,r);this._wave=o,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),jt._periodicWaveCache.push({imag:r,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:n,type:this._type,wave:this._wave}),jt._periodicWaveCache.length>100&&jt._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(t){this.partialCount&&this._type!=="custom"&&t!=="custom"?this.type=t+this.partialCount:this.type=t}get partialCount(){return this._partialCount}set partialCount(t){Be(t,0);let e=this._type;const s=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(s&&(e=s[1]),this._type!=="custom")t===0?this.type=e:this.type=e+t.toString();else{const n=new Float32Array(t);this._partials.forEach((r,o)=>n[o]=r),this._partials=Array.from(n),this.type=this._type}}_getRealImaginary(t,e){let n=2048;const r=new Float32Array(n),o=new Float32Array(n);let a=1;if(t==="custom"){if(a=this._partials.length+1,this._partialCount=this._partials.length,n=a,this._partials.length===0)return[r,o]}else{const c=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(t);c?(a=parseInt(c[2],10)+1,this._partialCount=parseInt(c[2],10),t=c[1],a=Math.max(a,2),n=a):this._partialCount=0,this._partials=[]}for(let c=1;c>1&1?-1:1):u=0,this._partials[c-1]=u;break;case"custom":u=this._partials[c-1];break;default:throw new TypeError("Oscillator: invalid type: "+t)}u!==0?(r[c]=-u*Math.sin(e*c),o[c]=u*Math.cos(e*c)):(r[c]=0,o[c]=0)}return[r,o]}_inverseFFT(t,e,s){let n=0;const r=t.length;for(let o=0;o(t+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Fs extends Ot{constructor(){super(Object.assign($(Fs.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const t=$(Fs.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new St({context:this.context,minValue:t.minValue,maxValue:t.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(Ot.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class Ri extends ee{constructor(){super($(Ri.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new e1({context:this.context}),this._modulationNode=new St({context:this.context});const t=$(Ri.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new jt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new jt({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Fs({context:this.context,units:"positive",value:t.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Mt(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(jt.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){this._modulator.restart(t),this._carrier.restart(t)}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class Fi extends ee{constructor(){super($(Fi.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new St({context:this.context,gain:0});const t=$(Fi.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new jt({context:this.context,detune:t.detune,frequency:0,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.detune=this._carrier.detune,this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this._modulator=new jt({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Fs({context:this.context,units:"positive",value:t.harmonicity}),this.modulationIndex=new Fs({context:this.context,units:"positive",value:t.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),Mt(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(jt.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){return this._modulator.restart(t),this._carrier.restart(t),this}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class Bn extends ee{constructor(){super($(Bn.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new St({context:this.context,gain:0}),this._thresh=new cn({context:this.context,mapping:e=>e<=0?-1:1});const t=$(Bn.getDefaults(),arguments,["frequency","width"]);this.width=new Ot({context:this.context,units:"audioRange",value:t.width}),this._triangle=new jt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),Mt(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ee.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(t){t=this.toSeconds(t),this._triangle.start(t),this._widthGate.gain.setValueAtTime(1,t)}_stop(t){t=this.toSeconds(t),this._triangle.stop(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(0,t)}_restart(t){this._triangle.restart(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(1,t)}get phase(){return this._triangle.phase}set phase(t){this._triangle.phase=t}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(t){this._triangle.type=t}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class Li extends ee{constructor(){super($(Li.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const t=$(Li.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Ot({context:this.context,units:"cents",value:t.detune}),this._spread=t.spread,this._type=t.type,this._phase=t.phase,this._partials=t.partials,this._partialCount=t.partialCount,this.count=t.count,Mt(this,["frequency","detune"])}static getDefaults(){return Object.assign(jt.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(t){t=this.toSeconds(t),this._forEach(e=>e.start(t))}_stop(t){t=this.toSeconds(t),this._forEach(e=>e.stop(t))}_restart(t){this._forEach(e=>e.restart(t))}_forEach(t){for(let e=0;ee.type=t)}get spread(){return this._spread}set spread(t){if(this._spread=t,this._oscillators.length>1){const e=-t/2,s=t/(this._oscillators.length-1);this._forEach((n,r)=>n.detune.value=e+s*r)}}get count(){return this._oscillators.length}set count(t){if(Be(t,1),this._oscillators.length!==t){this._forEach(e=>e.dispose()),this._oscillators=[];for(let e=0;ethis.onstop(this):yt});this.type==="custom"&&(s.partials=this._partials),this.frequency.connect(s.frequency),this.detune.connect(s.detune),s.detune.overridden=!1,s.connect(this.output),this._oscillators[e]=s}this.spread=this._spread,this.state==="started"&&this._forEach(e=>e.start())}}get phase(){return this._phase}set phase(t){this._phase=t,this._forEach((e,s)=>e.phase=this._phase+s/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(t){this._forEach(e=>e.baseType=t),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(t){this._partials=t,this._partialCount=this._partials.length,t.length&&(this._type="custom",this._forEach(e=>e.partials=t))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(t){this._partialCount=t,this._forEach(e=>e.partialCount=t),this._type=this._oscillators[0].type}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(t=>t.dispose()),this}}class Vi extends ee{constructor(){super($(Vi.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Fs({context:this.context,value:2});const t=$(Vi.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new Bn({context:this.context,frequency:t.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new jt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Mt(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ee.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)}_stop(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)}_restart(t){this._modulator.restart(t),this._pulse.restart(t)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(t){this._modulator.phase=t}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const Tl={am:Ri,fat:Li,fm:Fi,oscillator:jt,pulse:Bn,pwm:Vi};class ln extends ee{constructor(){super($(ln.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const t=$(ln.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Ot({context:this.context,units:"cents",value:t.detune}),Mt(this,["frequency","detune"]),this.set(t)}static getDefaults(){return Object.assign(jt.getDefaults(),Fi.getDefaults(),Ri.getDefaults(),Li.getDefaults(),Bn.getDefaults(),Vi.getDefaults())}_start(t){this._oscillator.start(t)}_stop(t){this._oscillator.stop(t)}_restart(t){return this._oscillator.restart(t),this}get type(){let t="";return["am","fm","fat"].some(e=>this._sourceType===e)&&(t=this._sourceType),t+this._oscillator.type}set type(t){t.substr(0,2)==="fm"?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):t.substr(0,2)==="am"?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):t.substr(0,3)==="fat"?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(3)):t==="pwm"?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):t==="pulse"?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=t)}get partials(){return this._oscillator.partials}set partials(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partials=t)}get partialCount(){return this._oscillator.partialCount}set partialCount(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partialCount=t)}set(t){return Reflect.has(t,"type")&&t.type&&(this.type=t.type),super.set(t),this}_createNewOscillator(t){if(t!==this._sourceType){this._sourceType=t;const e=Tl[t],s=this.now();if(this._oscillator){const n=this._oscillator;n.stop(s),this.context.setTimeout(()=>n.dispose(),this.blockTime)}this._oscillator=new e({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),this.state==="started"&&this._oscillator.start(s)}}get phase(){return this._oscillator.phase}set phase(t){this._oscillator.phase=t}get sourceType(){return this._sourceType}set sourceType(t){let e="sine";this._oscillator.type!=="pwm"&&this._oscillator.type!=="pulse"&&(e=this._oscillator.type),t==="fm"?this.type="fm"+e:t==="am"?this.type="am"+e:t==="fat"?this.type="fat"+e:t==="oscillator"?this.type=e:t==="pulse"?this.type="pulse":t==="pwm"&&(this.type="pwm")}_getOscType(t,e){return t instanceof Tl[e]}get baseType(){return this._oscillator.baseType}set baseType(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&t!=="pulse"&&t!=="pwm"&&(this._oscillator.baseType=t)}get width(){if(this._getOscType(this._oscillator,"pulse"))return this._oscillator.width}get count(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.count}set count(t){this._getOscType(this._oscillator,"fat")&&Ps(t)&&(this._oscillator.count=t)}get spread(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.spread}set spread(t){this._getOscType(this._oscillator,"fat")&&Ps(t)&&(this._oscillator.spread=t)}get modulationType(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.modulationType}set modulationType(t){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&fs(t)&&(this._oscillator.modulationType=t)}get modulationIndex(){if(this._getOscType(this._oscillator,"fm"))return this._oscillator.modulationIndex}get harmonicity(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.harmonicity}get modulationFrequency(){if(this._getOscType(this._oscillator,"pwm"))return this._oscillator.modulationFrequency}asArray(t=1024){return Bt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class cc extends Ot{constructor(){super(Object.assign($(cc.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new St({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,Mi(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Ot.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class Kr extends ps{constructor(){super(Object.assign($(Kr.getDefaults(),arguments,["min","max"]))),this.name="Scale";const t=$(Kr.getDefaults(),arguments,["min","max"]);this._mult=this.input=new Fs({context:this.context,value:t.max-t.min}),this._add=this.output=new cc({context:this.context,value:t.min}),this._min=t.min,this._max=t.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ps.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(t){this._min=t,this._setRange()}get max(){return this._max}set max(t){this._max=t,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}function dh(i,t=1/0){const e=new WeakMap;return function(s,n){Reflect.defineProperty(s,n,{configurable:!0,enumerable:!0,get:function(){return e.get(this)},set:function(r){Be(r,i,t),e.set(this,r)}})}}function xs(i,t=1/0){const e=new WeakMap;return function(s,n){Reflect.defineProperty(s,n,{configurable:!0,enumerable:!0,get:function(){return e.get(this)},set:function(r){Be(this.toSeconds(r),i,t),e.set(this,r)}})}}class Ui extends ee{constructor(){super($(Ui.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const t=$(Ui.getDefaults(),arguments,["url","onload"]);this._buffer=new kt({onload:this._onload.bind(this,t.onload),onerror:t.onerror,reverse:t.reverse,url:t.url}),this.autostart=t.autostart,this._loop=t.loop,this._loopStart=t.loopStart,this._loopEnd=t.loopEnd,this._playbackRate=t.playbackRate,this.fadeIn=t.fadeIn,this.fadeOut=t.fadeOut}static getDefaults(){return Object.assign(ee.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:yt,onerror:yt,playbackRate:1,reverse:!1})}load(t){return Bt(this,void 0,void 0,function*(){return yield this._buffer.load(t),this._onload(),this})}_onload(t=yt){t(),this.autostart&&this.start()}_onSourceEnd(t){this.onstop(this),this._activeSources.delete(t),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())==="started"&&(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(t,e,s){return super.start(t,e,s),this}_start(t,e,s){this._loop?e=Nn(e,this._loopStart):e=Nn(e,0);const n=this.toSeconds(e),r=s;s=Nn(s,Math.max(this._buffer.duration-n,0));let o=this.toSeconds(s);o=o/this._playbackRate,t=this.toSeconds(t);const a=new jn({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);!this._loop&&!this._synced&&(this._state.cancel(t+o),this._state.setStateAtTime("stopped",t+o,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&xe(r)?a.start(t,n):a.start(t,n,o-this.toSeconds(this.fadeOut))}_stop(t){const e=this.toSeconds(t);this._activeSources.forEach(s=>s.stop(e))}restart(t,e,s){return super.restart(t,e,s),this}_restart(t,e,s){var n;(n=[...this._activeSources].pop())===null||n===void 0||n.stop(t),this._start(t,e,s)}seek(t,e){const s=this.toSeconds(e);if(this._state.getValueAtTime(s)==="started"){const n=this.toSeconds(t);this._stop(s),this._start(s,n)}return this}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get loopStart(){return this._loopStart}set loopStart(t){this._loopStart=t,this.buffer.loaded&&Be(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopStart=t})}get loopEnd(){return this._loopEnd}set loopEnd(t){this._loopEnd=t,this.buffer.loaded&&Be(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopEnd=t})}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._loop}set loop(t){if(this._loop!==t&&(this._loop=t,this._activeSources.forEach(e=>{e.loop=t}),t)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t;const e=this.now(),s=this._state.getNextState("stopped",e);s&&s.implicitEnd&&(this._state.cancel(s.time),this._activeSources.forEach(n=>n.cancelStop())),this._activeSources.forEach(n=>{n.playbackRate.setValueAtTime(t,e)})}get reverse(){return this._buffer.reverse}set reverse(t){this._buffer.reverse=t}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(t=>t.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}qe([xs(0)],Ui.prototype,"fadeIn",void 0);qe([xs(0)],Ui.prototype,"fadeOut",void 0);class s1 extends ps{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new cn({context:this.context,mapping:t=>Math.abs(t)*2-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Pe extends ot{constructor(){super($(Pe.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Ot({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const t=$(Pe.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=t.attack,this.decay=t.decay,this.sustain=t.sustain,this.release=t.release,this.attackCurve=t.attackCurve,this.releaseCurve=t.releaseCurve,this.decayCurve=t.decayCurve}static getDefaults(){return Object.assign(ot.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(t,e){if(fs(t))return t;{let s;for(s in Sr)if(Sr[s][e]===t)return s;return t}}_setCurve(t,e,s){if(fs(s)&&Reflect.has(Sr,s)){const n=Sr[s];Js(n)?t!=="_decayCurve"&&(this[t]=n[e]):this[t]=n}else if(ze(s)&&t!=="_decayCurve")this[t]=s;else throw new Error("Envelope: invalid curve: "+s)}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(t){this._setCurve("_attackCurve","In",t)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(t){this._setCurve("_releaseCurve","Out",t)}get decayCurve(){return this._getCurve(this._decayCurve,"Out")}set decayCurve(t){this._setCurve("_decayCurve","Out",t)}triggerAttack(t,e=1){this.log("triggerAttack",t,e),t=this.toSeconds(t);let n=this.toSeconds(this.attack);const r=this.toSeconds(this.decay),o=this.getValueAtTime(t);if(o>0){const a=1/n;n=(1-o)/a}if(n0){const s=this.toSeconds(this.release);s{let t,e;const s=[];for(t=0;t<128;t++)s[t]=Math.sin(t/(128-1)*(Math.PI/2));const n=[],r=6.4;for(t=0;t<128-1;t++){e=t/(128-1);const d=Math.sin(e*(Math.PI*2)*r-Math.PI/2)+1;n[t]=d/10+e*.83}n[128-1]=1;const o=[],a=5;for(t=0;t<128;t++)o[t]=Math.ceil(t/(128-1)*a)/a;const c=[];for(t=0;t<128;t++)e=t/(128-1),c[t]=.5*(1-Math.cos(Math.PI*e));const l=[];for(t=0;t<128;t++){e=t/(128-1);const d=Math.pow(e,3)*4+.2,p=Math.cos(d*Math.PI*2*e);l[t]=Math.abs(p*(1-e))}function u(d){const p=new Array(d.length);for(let m=0;mthis._original_triggerRelease(e);const t=$(un.getDefaults(),arguments);this._volume=this.output=new Is({context:this.context,volume:t.volume}),this.volume=this._volume.volume,Mt(this,"volume")}static getDefaults(){return Object.assign(ot.getDefaults(),{volume:0})}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0),this.context.transport.on("stop",this._syncedRelease),this.context.transport.on("pause",this._syncedRelease),this.context.transport.on("loopEnd",this._syncedRelease)),this}_syncState(){let t=!1;return this._synced||(this._synced=!0,t=!0),t}_syncMethod(t,e){const s=this["_original_"+t]=this[t];this[t]=(...n)=>{const r=n[e],o=this.context.transport.schedule(a=>{n[e]=a,s.apply(this,n)},r);this._scheduledEvents.push(o)}}unsync(){return this._scheduledEvents.forEach(t=>this.context.transport.clear(t)),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease,this.context.transport.off("stop",this._syncedRelease),this.context.transport.off("pause",this._syncedRelease),this.context.transport.off("loopEnd",this._syncedRelease)),this}triggerAttackRelease(t,e,s,n){const r=this.toSeconds(s),o=this.toSeconds(e);return this.triggerAttack(t,r,n),this.triggerRelease(r+o),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class ms extends un{constructor(){super($(ms.getDefaults(),arguments));const t=$(ms.getDefaults(),arguments);this.portamento=t.portamento,this.onsilence=t.onsilence}static getDefaults(){return Object.assign(un.getDefaults(),{detune:0,onsilence:yt,portamento:0})}triggerAttack(t,e,s=1){this.log("triggerAttack",t,e,s);const n=this.toSeconds(e);return this._triggerEnvelopeAttack(n,s),this.setNote(t,n),this}triggerRelease(t){this.log("triggerRelease",t);const e=this.toSeconds(t);return this._triggerEnvelopeRelease(e),this}setNote(t,e){const s=this.toSeconds(e),n=t instanceof Ae?t.toFrequency():t;if(this.portamento>0&&this.getLevelAtTime(s)>.05){const r=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(n,r,s)}else this.frequency.setValueAtTime(n,s);return this}}qe([xs(0)],ms.prototype,"portamento",void 0);class Oo extends Pe{constructor(){super($(Oo.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new St({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class zi extends ms{constructor(){super($(zi.getDefaults(),arguments)),this.name="Synth";const t=$(zi.getDefaults(),arguments);this.oscillator=new ln(Object.assign({context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)},t.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Oo(Object.assign({context:this.context},t.envelope)),this.oscillator.chain(this.envelope,this.output),Mt(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(ms.getDefaults(),{envelope:Object.assign(On(Pe.getDefaults(),Object.keys(ot.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(On(ln.getDefaults(),[...Object.keys(ee.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(t,e){if(this.envelope.triggerAttack(t,e),this.oscillator.start(t),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+s+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ji extends ot{constructor(){super($(ji.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const t=$(ji.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new xt({context:this.context,units:"number",value:t.Q,param:this._filter.Q}),this.frequency=new xt({context:this.context,units:"frequency",value:t.frequency,param:this._filter.frequency}),this.detune=new xt({context:this.context,units:"cents",value:t.detune,param:this._filter.detune}),this.gain=new xt({context:this.context,units:"decibels",convert:!1,value:t.gain,param:this._filter.gain}),this.type=t.type}static getDefaults(){return Object.assign(ot.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(t){ut(["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(t)!==-1,`Invalid filter type: ${t}`),this._filter.type=t}getFrequencyResponse(t=128){const e=new Float32Array(t);for(let o=0;os.type=t)}get rolloff(){return this._rolloff}set rolloff(t){const e=Ps(t)?t:parseInt(t,10),s=[-12,-24,-48,-96];let n=s.indexOf(e);ut(n!==-1,`rolloff can only be ${s.join(", ")}`),n+=1,this._rolloff=e,this.input.disconnect(),this._filters.forEach(r=>r.disconnect()),this._filters=new Array(n);for(let r=0;r1);return this._filters.forEach(()=>{e.getFrequencyResponse(t).forEach((r,o)=>s[o]*=r)}),e.dispose(),s}dispose(){return super.dispose(),this._filters.forEach(t=>{t.dispose()}),sc(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Bi extends Pe{constructor(){super($(Bi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const t=$(Bi.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=t.octaves,this._baseFrequency=this.toFrequency(t.baseFrequency),this._exponent=this.input=new Pi({context:this.context,value:t.exponent}),this._scale=this.output=new Kr({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Pe.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(t){const e=this.toFrequency(t);Be(e,0),this._baseFrequency=e,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(t){this._octaves=t,this._scale.max=this._baseFrequency*Math.pow(2,t)}get exponent(){return this._exponent.value}set exponent(t){this._exponent.value=t}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class qi extends ms{constructor(){super($(qi.getDefaults(),arguments)),this.name="MonoSynth";const t=$(qi.getDefaults(),arguments);this.oscillator=new ln(Object.assign(t.oscillator,{context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new qn(Object.assign(t.filter,{context:this.context})),this.filterEnvelope=new Bi(Object.assign(t.filterEnvelope,{context:this.context})),this.envelope=new Oo(Object.assign(t.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Mt(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(ms.getDefaults(),{envelope:Object.assign(On(Pe.getDefaults(),Object.keys(ot.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(On(qn.getDefaults(),Object.keys(ot.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(On(Bi.getDefaults(),Object.keys(ot.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(On(ln.getDefaults(),Object.keys(ee.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(t,e=1){if(this.envelope.triggerAttack(t,e),this.filterEnvelope.triggerAttack(t),this.oscillator.start(t),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+s+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.filterEnvelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Wi extends zi{constructor(){super($(Wi.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const t=$(Wi.getDefaults(),arguments);this.pitchDecay=t.pitchDecay,this.octaves=t.octaves,Mt(this,["oscillator","envelope"])}static getDefaults(){return Pn(ms.getDefaults(),zi.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(t,e){const s=this.toSeconds(e),n=this.toFrequency(t instanceof Ae?t.toFrequency():t),r=n*this.octaves;return this.oscillator.frequency.setValueAtTime(r,s),this.oscillator.frequency.exponentialRampToValueAtTime(n,s+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}qe([dh(0)],Wi.prototype,"octaves",void 0);qe([xs(0)],Wi.prototype,"pitchDecay",void 0);const fh=new Set;function lc(i){fh.add(i)}function ph(i,t){const e=`registerProcessor("${i}", ${t})`;fh.add(e)}const n1=` /** * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. */ @@ -321,7 +321,7 @@ import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y a return delayedSample; } } -`;ph(o1,a1);class Hi extends un{constructor(){super($(Hi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const t=$(Hi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),e={};Object.keys(t.urls).forEach(s=>{const n=parseInt(s,10);if(ut(Cr(s)||Ps(n)&&isFinite(n),`url key is neither a note or midi pitch: ${s}`),Cr(s)){const r=new Ae(this.context,s).toMidi();e[r]=t.urls[s]}else Ps(n)&&isFinite(n)&&(e[n]=t.urls[n])}),this._buffers=new oc({urls:e,onload:t.onload,baseUrl:t.baseUrl,onerror:t.onerror}),this.attack=t.attack,this.release=t.release,this.curve=t.curve,this._buffers.loaded&&Promise.resolve().then(t.onload)}static getDefaults(){return Object.assign(un.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:yt,onerror:yt,release:.1,urls:{}})}_findClosest(t){let s=0;for(;s<96;){if(this._buffers.has(t+s))return-s;if(this._buffers.has(t-s))return s;s++}throw new Error(`No available buffers for note: ${t}`)}triggerAttack(t,e,s=1){return this.log("triggerAttack",t,e,s),Array.isArray(t)||(t=[t]),t.forEach(n=>{const r=hh(new Ae(this.context,n).toFrequency()),o=Math.round(r),a=r-o,c=this._findClosest(o),l=o-c,u=this._buffers.get(l),h=uh(c+a),d=new jn({url:u,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:h}).connect(this.output);d.start(e,0,u.duration/h,s),ze(this._activeSources.get(o))||this._activeSources.set(o,[]),this._activeSources.get(o).push(d),d.onended=()=>{if(this._activeSources&&this._activeSources.has(o)){const f=this._activeSources.get(o),_=f.indexOf(d);_!==-1&&f.splice(_,1)}}}),this}triggerRelease(t,e){return this.log("triggerRelease",t,e),Array.isArray(t)||(t=[t]),t.forEach(s=>{const n=new Ae(this.context,s).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const r=this._activeSources.get(n);e=this.toSeconds(e),r.forEach(o=>{o.stop(e)}),this._activeSources.set(n,[])}}),this}releaseAll(t){const e=this.toSeconds(t);return this._activeSources.forEach(s=>{for(;s.length;)s.shift().stop(e)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(t,e,s,n=1){const r=this.toSeconds(s);return this.triggerAttack(t,r,n),ze(e)?(ut(ze(t),"notes must be an array when duration is array"),t.forEach((o,a)=>{const c=e[Math.min(a,e.length-1)];this.triggerRelease(o,r+this.toSeconds(c))})):this.triggerRelease(t,r+this.toSeconds(e)),this}add(t,e,s){if(ut(Cr(t)||isFinite(t),`note must be a pitch or midi: ${t}`),Cr(t)){const n=new Ae(this.context,t).toMidi();this._buffers.add(n,e,s)}else this._buffers.add(t,e,s);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(t=>{t.forEach(e=>e.dispose())}),this._activeSources.clear(),this}}qe([xs(0)],Hi.prototype,"attack",void 0);qe([xs(0)],Hi.prototype,"release",void 0);class Jr extends ot{constructor(){super(Object.assign($(Jr.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new s1({context:this.context}),this.a=new St({context:this.context,gain:0}),this.b=new St({context:this.context,gain:0}),this.output=new St({context:this.context}),this._internalChannels=[this.a,this.b];const t=$(Jr.getDefaults(),arguments,["fade"]);this.fade=new Ot({context:this.context,units:"normalRange",value:t.fade}),Mt(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Ns(this._split,this.a.gain,0),Ns(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(ot.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class wl extends ot{constructor(t){super(t),this.name="Effect",this._dryWet=new Jr({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new St({context:this.context}),this.effectReturn=new St({context:this.context}),this.input=new St({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(t.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Mt(this,"wet")}static getDefaults(){return Object.assign(ot.getDefaults(),{wet:1})}connectEffect(t){return this._internalChannels.push(t),this.effectSend.chain(t,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class to extends ot{constructor(){super(Object.assign($(to.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const t=$(to.getDefaults(),arguments,["pan"]);this.pan=new xt({context:this.context,param:this._panner.pan,value:t.pan,minValue:-1,maxValue:1}),this._panner.channelCount=t.channelCount,this._panner.channelCountMode="explicit",Mt(this,"pan")}static getDefaults(){return Object.assign(ot.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}const c1="bit-crusher",l1=` +`;ph(o1,a1);class Hi extends un{constructor(){super($(Hi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const t=$(Hi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),e={};Object.keys(t.urls).forEach(s=>{const n=parseInt(s,10);if(ut(Cr(s)||Ps(n)&&isFinite(n),`url key is neither a note or midi pitch: ${s}`),Cr(s)){const r=new Ae(this.context,s).toMidi();e[r]=t.urls[s]}else Ps(n)&&isFinite(n)&&(e[n]=t.urls[n])}),this._buffers=new oc({urls:e,onload:t.onload,baseUrl:t.baseUrl,onerror:t.onerror}),this.attack=t.attack,this.release=t.release,this.curve=t.curve,this._buffers.loaded&&Promise.resolve().then(t.onload)}static getDefaults(){return Object.assign(un.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:yt,onerror:yt,release:.1,urls:{}})}_findClosest(t){let s=0;for(;s<96;){if(this._buffers.has(t+s))return-s;if(this._buffers.has(t-s))return s;s++}throw new Error(`No available buffers for note: ${t}`)}triggerAttack(t,e,s=1){return this.log("triggerAttack",t,e,s),Array.isArray(t)||(t=[t]),t.forEach(n=>{const r=hh(new Ae(this.context,n).toFrequency()),o=Math.round(r),a=r-o,c=this._findClosest(o),l=o-c,u=this._buffers.get(l),h=uh(c+a),d=new jn({url:u,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:h}).connect(this.output);d.start(e,0,u.duration/h,s),ze(this._activeSources.get(o))||this._activeSources.set(o,[]),this._activeSources.get(o).push(d),d.onended=()=>{if(this._activeSources&&this._activeSources.has(o)){const p=this._activeSources.get(o),m=p.indexOf(d);m!==-1&&p.splice(m,1)}}}),this}triggerRelease(t,e){return this.log("triggerRelease",t,e),Array.isArray(t)||(t=[t]),t.forEach(s=>{const n=new Ae(this.context,s).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const r=this._activeSources.get(n);e=this.toSeconds(e),r.forEach(o=>{o.stop(e)}),this._activeSources.set(n,[])}}),this}releaseAll(t){const e=this.toSeconds(t);return this._activeSources.forEach(s=>{for(;s.length;)s.shift().stop(e)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(t,e,s,n=1){const r=this.toSeconds(s);return this.triggerAttack(t,r,n),ze(e)?(ut(ze(t),"notes must be an array when duration is array"),t.forEach((o,a)=>{const c=e[Math.min(a,e.length-1)];this.triggerRelease(o,r+this.toSeconds(c))})):this.triggerRelease(t,r+this.toSeconds(e)),this}add(t,e,s){if(ut(Cr(t)||isFinite(t),`note must be a pitch or midi: ${t}`),Cr(t)){const n=new Ae(this.context,t).toMidi();this._buffers.add(n,e,s)}else this._buffers.add(t,e,s);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(t=>{t.forEach(e=>e.dispose())}),this._activeSources.clear(),this}}qe([xs(0)],Hi.prototype,"attack",void 0);qe([xs(0)],Hi.prototype,"release",void 0);class Jr extends ot{constructor(){super(Object.assign($(Jr.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new s1({context:this.context}),this.a=new St({context:this.context,gain:0}),this.b=new St({context:this.context,gain:0}),this.output=new St({context:this.context}),this._internalChannels=[this.a,this.b];const t=$(Jr.getDefaults(),arguments,["fade"]);this.fade=new Ot({context:this.context,units:"normalRange",value:t.fade}),Mt(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Ns(this._split,this.a.gain,0),Ns(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(ot.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class wl extends ot{constructor(t){super(t),this.name="Effect",this._dryWet=new Jr({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new St({context:this.context}),this.effectReturn=new St({context:this.context}),this.input=new St({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(t.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Mt(this,"wet")}static getDefaults(){return Object.assign(ot.getDefaults(),{wet:1})}connectEffect(t){return this._internalChannels.push(t),this.effectSend.chain(t,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class to extends ot{constructor(){super(Object.assign($(to.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const t=$(to.getDefaults(),arguments,["pan"]);this.pan=new xt({context:this.context,param:this._panner.pan,value:t.pan,minValue:-1,maxValue:1}),this._panner.channelCount=t.channelCount,this._panner.channelCountMode="explicit",Mt(this,"pan")}static getDefaults(){return Object.assign(ot.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}const c1="bit-crusher",l1=` class BitCrusherWorklet extends SingleIOProcessor { static get parameterDescriptors() { @@ -340,7 +340,7 @@ import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y a return val; } } -`;ph(c1,l1);class eo extends ot{constructor(){super($(eo.getDefaults(),arguments,["channels"])),this.name="Merge";const t=$(eo.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(t.channels)}static getDefaults(){return Object.assign(ot.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class so extends wl{constructor(){super($(so.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const t=$(so.getDefaults(),arguments,["decay"]);this._decay=t.decay,this._preDelay=t.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(wl.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(t){t=this.toSeconds(t),Be(t,.001),this._decay=t,this.generate()}get preDelay(){return this._preDelay}set preDelay(t){t=this.toSeconds(t),Be(t,0),this._preDelay=t,this.generate()}generate(){return Bt(this,void 0,void 0,function*(){const t=this.ready,e=new So(2,this._decay+this._preDelay,this.context.sampleRate),s=new Ii({context:e}),n=new Ii({context:e}),r=new eo({context:e});s.connect(r,0,0),n.connect(r,0,1);const o=new St({context:e}).toDestination();r.connect(o),s.start(0),n.start(0),o.gain.setValueAtTime(0,0),o.gain.setValueAtTime(1,this._preDelay),o.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=e.render();return this.ready=a.then(yt),yield t,this._convolver.buffer=(yield a).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class Ut extends ot{constructor(){super($(Ut.getDefaults(),arguments,["solo"])),this.name="Solo";const t=$(Ut.getDefaults(),arguments,["solo"]);this.input=this.output=new St({context:this.context}),Ut._allSolos.has(this.context)||Ut._allSolos.set(this.context,new Set),Ut._allSolos.get(this.context).add(this),this.solo=t.solo}static getDefaults(){return Object.assign(ot.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(t){t?this._addSolo():this._removeSolo(),Ut._allSolos.get(this.context).forEach(e=>e._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){Ut._soloed.has(this.context)||Ut._soloed.set(this.context,new Set),Ut._soloed.get(this.context).add(this)}_removeSolo(){Ut._soloed.has(this.context)&&Ut._soloed.get(this.context).delete(this)}_isSoloed(){return Ut._soloed.has(this.context)&&Ut._soloed.get(this.context).has(this)}_noSolos(){return!Ut._soloed.has(this.context)||Ut._soloed.has(this.context)&&Ut._soloed.get(this.context).size===0}_updateSolo(){this._isSoloed()?this.input.gain.value=1:this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),Ut._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Ut._allSolos=new Map;Ut._soloed=new Map;class no extends ot{constructor(){super($(no.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const t=$(no.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new to({context:this.context,pan:t.pan,channelCount:t.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Is({context:this.context,volume:t.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=t.mute,Mt(this,["pan","volume"])}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class Xs extends ot{constructor(){super($(Xs.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const t=$(Xs.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Ut({solo:t.solo,context:this.context}),this._panVol=this.output=new no({context:this.context,pan:t.pan,volume:t.volume,mute:t.mute,channelCount:t.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Mt(this,["pan","volume"])}static getDefaults(){return Object.assign(ot.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(t){this._solo.solo=t}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(t){this._panVol.mute=t}_getBus(t){return Xs.buses.has(t)||Xs.buses.set(t,new St({context:this.context})),Xs.buses.get(t)}send(t,e=0){const s=this._getBus(t),n=new St({context:this.context,units:"decibels",gain:e});return this.connect(n),n.connect(s),n}receive(t){return this._getBus(t).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}Xs.buses=new Map;class u1 extends ot{constructor(){super(...arguments),this.name="Listener",this.positionX=new xt({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new xt({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new xt({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new xt({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new xt({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new xt({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new xt({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new xt({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new xt({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(ot.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}bo(i=>{i.listener=new u1({context:i})});Co(i=>{i.listener.dispose()});Ve().transport;const uc=Ve().destination;Ve().destination;Ve().listener;Ve().draw;Ve();const hc=new qn(900,"highpass"),mh=new Is(-6);mh.chain(hc,uc);const h1=new so(3).connect(mh),Ao=new qi({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});Ao.oscillator.type="triangle2";Ao.volume.value=-6;Ao.chain(hc,uc);const Mo=new qi({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(h1);Mo.oscillator.type="triangle";Mo.volume.value=-6;Mo.chain(hc,uc);function d1(){return Math.floor((Math.random()-.5)*20)}let bl=!1;const f1=async(i=0)=>{bl||(await jy(),bl=!0);try{if(i>2e3)Mo.triggerAttackRelease(60,.3);else if(i>1e3){let t=310;t+=d1(),Ao.triggerAttackRelease(t,.001)}}catch(t){console.warn(t)}},Er=1800,p1=(i,t)=>i.clone().normalize().clone().negate().normalize().multiplyScalar(t).add(i),m1=(i,t,e,s,n)=>{const r=new Jl,o=1e-5;r.absarc(o,o,o,-Math.PI/2,-Math.PI,!0),r.absarc(o,t-s*2,o,Math.PI,Math.PI/2,!0),r.absarc(i-s*2,t-s*2,o,Math.PI/2,0,!0),r.absarc(i-s*2,o,o,0,-Math.PI/2,!0);const a=new Sf(r,{depth:e-s*2,bevelEnabled:!0,bevelSegments:n,steps:2,bevelSize:s,bevelThickness:s,curveSegments:n});a.center();const c=[],l=a.getAttribute("normal"),u=a.getAttribute("position");for(let h=0;h.9?(_=f.x/i+.5,p=1-(f.z/e+.5)):Math.abs(d.x)>.9?(_=-f.z/e+.5,p=1-(-f.y/t+.5)):Math.abs(d.z)>.9&&(_=f.x/i+.5,p=1-(-f.y/t+.5)),c.push(_,p)}return a.setAttribute("uv",new Dr(c,2)),a};m1(10,10,10,2,10);const Cl=new Cf(10,10,10),_1=500,g1=800,y1=new rt(0,0,0),v1=16777215,k1=20,x1=(i,t)=>{var r,o;if(!(i!=null&&i.ref_id)||!(t!=null&&t.ref_id))return!1;let e=!1;const s=i.guests,n=t.guests;return((r=i.children)!=null&&r.includes(t.ref_id)||(o=t.children)!=null&&o.includes(i.ref_id))&&(e=!0),(s!=null&&s.find(a=>a.ref_id===t.ref_id)||n!=null&&n.find(a=>a.ref_id===i.ref_id))&&(e=!0),e};let mi=null;const T1=500,_h=(i,t)=>{if(mi)return null;mi=setTimeout(()=>{mi&&(clearTimeout(mi),mi=null)},T1);const e=[];return i.forEach(n=>{const r=t.position.distanceTo(y1.set(n.x,n.y,n.z));rn.distance-r.distance).slice(0,_1).map(n=>n.id)};let bn,_i;const w1=1e3,b1=2e3,C1=i=>{const t=We(),e=Os(k=>k.isUserDragging),s=Os(k=>k.isUserScrolling),n=Os(k=>k.setUserMovedCamera),{data:r,graphStyle:o,showSelectionGraph:a,setNearbyNodeIds:c,cameraFocusTrigger:l,graphRadius:u}=oe(k=>k),{camera:h}=Nt(),[d,f]=A.useState(!1),[_,p]=A.useState(!1),[m,y]=A.useState(el),w=A.useMemo(()=>{if(a)return new rt(0,0,0);const k=r==null?void 0:r.nodes.find(R=>R.ref_id===(t==null?void 0:t.ref_id)),C=u+300;let M=new rt(0,0,C);if(k&&r){const R=r==null?void 0:r.nodes.filter(Y=>{var j;return(j=k.children)==null?void 0:j.find(z=>z===Y.id)}),P=new rt(k.x,k.y,k.z);let U=new rt(0,0,0);R.map(Y=>(U=U.add(new rt(Y.x,Y.y,Y.z).normalize()),Y));const W=k.scale?1-1/(k.scale+10):1,G=P.sub(U).multiplyScalar(.8*W);M=P.add(G)}return M},[a,t,r,u]),b=A.useMemo(()=>{if(a)return new rt(0,0,0);const k=r==null?void 0:r.nodes.find(C=>C.ref_id===(t==null?void 0:t.ref_id));return new rt((k==null?void 0:k.x)||0,(k==null?void 0:k.y)||0,(k==null?void 0:k.z)||0)},[a,t,r]);A.useEffect(()=>{var k;a&&((k=i.current)==null||k.setLookAt(Ho.x,Ho.y,Ho.z,0,0,0,!1)),v()},[a]),A.useEffect(()=>{a?y(_0):(t==null?void 0:t.node_type)==="topic"?y(m0):y(el)},[t,y,a]),A.useEffect(()=>{g()},[l]),A.useEffect(()=>{(e||s)&&(f(!0),p(!0))},[e,s,f,p]),A.useEffect(()=>{if(t)if(!a&&o==="earth"&&(i!=null&&i.current)){const k=i.current.camera.position.distanceTo(new rt),C=p1(b,-k/2);i.current.setLookAt(C.x,C.y,C.z,0,0,0,!0)}else bn&&clearTimeout(bn),bn=setTimeout(()=>{p(!0),clearTimeout(bn)},b1),v();return()=>{bn&&clearTimeout(bn),_i&&clearTimeout(_i)}},[t]),be(k=>{i.current&&(d||T(w,k.camera),_||x(b,k.camera))});const v=()=>{if(t){const k=h.position.distanceTo(w);f1(k)}g()},g=()=>{f(!1),p(!1),n(!1),_i&&clearTimeout(_i),_i=setTimeout(()=>{f(!0),p(!0)},w1)},T=(k,C)=>{if(C.position.distanceTo(k){var M;(M=i==null?void 0:i.current)==null||M.setLookAt(C.position.x,C.position.y,C.position.z,k.x,k.y,k.z,!0)};return null},S1=1;let Or=null;const E1=(i,{enabled:t})=>{const e=We();C1(i);const s=Os(a=>a.isUserDragging),{graphStyle:n,graphRadius:r,disableCameraRotation:o}=oe(a=>a);return A.useEffect(()=>{t||(Or==null||Or.kill(),Or=null)},[t]),A.useEffect(()=>{i.current&&r&&(n==="sphere"?(i.current.maxDistance=8e3,i.current.minDistance=200,i.current.setTarget(0,0,500,!0)):(i.current.maxDistance=i.current.getDistanceToFitSphere(r+200),i.current.minDistance=100))},[r,n,i]),A.useEffect(()=>{!e&&i.current&&i.current.setLookAt(Ti.x,Ti.y,r,0,0,0,!0)},[e,r]),be((a,c)=>{i.current&&(!o&&!s&&(i.current.azimuthAngle+=S1*c*Ef.DEG2RAD),i.current.update(c))}),null},O1=({disableAnimations:i})=>{const t=A.useRef(null),{data:e,setNearbyNodeIds:s,setDisableCameraRotation:n}=oe(h=>h),[r]=A.useState(.8),{camera:o}=Nt(),[a,c,l,u]=Os(h=>[h.isUserDragging,h.setIsUserDragging,h.isUserScrolling,h.isUserScrollingOnHtmlPanel]);return E1(t,{enabled:!i&&!l&&!a}),A.useEffect(()=>{if(!a){const h=_h((e==null?void 0:e.nodes)||[],o);h&&s(h)}},[o,o.position,o.position.x,o.position.y,o.position.z,e==null?void 0:e.nodes,s,a]),A.useEffect(()=>{a&&n(!0)},[a,n]),L.jsx($f,{ref:t,boundaryEnclosesCamera:!0,enabled:!u,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>c(!1),onStart:()=>c(!0),smoothTime:r})};function us(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function gh(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,i.__proto__=t}/*! +`;ph(c1,l1);class eo extends ot{constructor(){super($(eo.getDefaults(),arguments,["channels"])),this.name="Merge";const t=$(eo.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(t.channels)}static getDefaults(){return Object.assign(ot.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class so extends wl{constructor(){super($(so.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const t=$(so.getDefaults(),arguments,["decay"]);this._decay=t.decay,this._preDelay=t.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(wl.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(t){t=this.toSeconds(t),Be(t,.001),this._decay=t,this.generate()}get preDelay(){return this._preDelay}set preDelay(t){t=this.toSeconds(t),Be(t,0),this._preDelay=t,this.generate()}generate(){return Bt(this,void 0,void 0,function*(){const t=this.ready,e=new So(2,this._decay+this._preDelay,this.context.sampleRate),s=new Ii({context:e}),n=new Ii({context:e}),r=new eo({context:e});s.connect(r,0,0),n.connect(r,0,1);const o=new St({context:e}).toDestination();r.connect(o),s.start(0),n.start(0),o.gain.setValueAtTime(0,0),o.gain.setValueAtTime(1,this._preDelay),o.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=e.render();return this.ready=a.then(yt),yield t,this._convolver.buffer=(yield a).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class Ut extends ot{constructor(){super($(Ut.getDefaults(),arguments,["solo"])),this.name="Solo";const t=$(Ut.getDefaults(),arguments,["solo"]);this.input=this.output=new St({context:this.context}),Ut._allSolos.has(this.context)||Ut._allSolos.set(this.context,new Set),Ut._allSolos.get(this.context).add(this),this.solo=t.solo}static getDefaults(){return Object.assign(ot.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(t){t?this._addSolo():this._removeSolo(),Ut._allSolos.get(this.context).forEach(e=>e._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){Ut._soloed.has(this.context)||Ut._soloed.set(this.context,new Set),Ut._soloed.get(this.context).add(this)}_removeSolo(){Ut._soloed.has(this.context)&&Ut._soloed.get(this.context).delete(this)}_isSoloed(){return Ut._soloed.has(this.context)&&Ut._soloed.get(this.context).has(this)}_noSolos(){return!Ut._soloed.has(this.context)||Ut._soloed.has(this.context)&&Ut._soloed.get(this.context).size===0}_updateSolo(){this._isSoloed()?this.input.gain.value=1:this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),Ut._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Ut._allSolos=new Map;Ut._soloed=new Map;class no extends ot{constructor(){super($(no.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const t=$(no.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new to({context:this.context,pan:t.pan,channelCount:t.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Is({context:this.context,volume:t.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=t.mute,Mt(this,["pan","volume"])}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class Xs extends ot{constructor(){super($(Xs.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const t=$(Xs.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Ut({solo:t.solo,context:this.context}),this._panVol=this.output=new no({context:this.context,pan:t.pan,volume:t.volume,mute:t.mute,channelCount:t.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Mt(this,["pan","volume"])}static getDefaults(){return Object.assign(ot.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(t){this._solo.solo=t}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(t){this._panVol.mute=t}_getBus(t){return Xs.buses.has(t)||Xs.buses.set(t,new St({context:this.context})),Xs.buses.get(t)}send(t,e=0){const s=this._getBus(t),n=new St({context:this.context,units:"decibels",gain:e});return this.connect(n),n.connect(s),n}receive(t){return this._getBus(t).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}Xs.buses=new Map;class u1 extends ot{constructor(){super(...arguments),this.name="Listener",this.positionX=new xt({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new xt({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new xt({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new xt({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new xt({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new xt({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new xt({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new xt({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new xt({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(ot.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}bo(i=>{i.listener=new u1({context:i})});Co(i=>{i.listener.dispose()});Ve().transport;const uc=Ve().destination;Ve().destination;Ve().listener;Ve().draw;Ve();const hc=new qn(900,"highpass"),mh=new Is(-6);mh.chain(hc,uc);const h1=new so(3).connect(mh),Ao=new qi({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});Ao.oscillator.type="triangle2";Ao.volume.value=-6;Ao.chain(hc,uc);const Mo=new qi({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(h1);Mo.oscillator.type="triangle";Mo.volume.value=-6;Mo.chain(hc,uc);function d1(){return Math.floor((Math.random()-.5)*20)}let bl=!1;const f1=async(i=0)=>{bl||(await jy(),bl=!0);try{if(i>2e3)Mo.triggerAttackRelease(60,.3);else if(i>1e3){let t=310;t+=d1(),Ao.triggerAttackRelease(t,.001)}}catch(t){console.warn(t)}},Er=1800,p1=(i,t)=>i.clone().normalize().clone().negate().normalize().multiplyScalar(t).add(i),m1=(i,t,e,s,n)=>{const r=new Jl,o=1e-5;r.absarc(o,o,o,-Math.PI/2,-Math.PI,!0),r.absarc(o,t-s*2,o,Math.PI,Math.PI/2,!0),r.absarc(i-s*2,t-s*2,o,Math.PI/2,0,!0),r.absarc(i-s*2,o,o,0,-Math.PI/2,!0);const a=new Sf(r,{depth:e-s*2,bevelEnabled:!0,bevelSegments:n,steps:2,bevelSize:s,bevelThickness:s,curveSegments:n});a.center();const c=[],l=a.getAttribute("normal"),u=a.getAttribute("position");for(let h=0;h.9?(m=p.x/i+.5,f=1-(p.z/e+.5)):Math.abs(d.x)>.9?(m=-p.z/e+.5,f=1-(-p.y/t+.5)):Math.abs(d.z)>.9&&(m=p.x/i+.5,f=1-(-p.y/t+.5)),c.push(m,f)}return a.setAttribute("uv",new Dr(c,2)),a};m1(10,10,10,2,10);const Cl=new Cf(10,10,10),_1=500,g1=800,y1=new rt(0,0,0),v1=16777215,k1=20,x1=(i,t)=>{var r,o;if(!(i!=null&&i.ref_id)||!(t!=null&&t.ref_id))return!1;let e=!1;const s=i.guests,n=t.guests;return((r=i.children)!=null&&r.includes(t.ref_id)||(o=t.children)!=null&&o.includes(i.ref_id))&&(e=!0),(s!=null&&s.find(a=>a.ref_id===t.ref_id)||n!=null&&n.find(a=>a.ref_id===i.ref_id))&&(e=!0),e};let mi=null;const T1=500,_h=(i,t)=>{if(mi)return null;mi=setTimeout(()=>{mi&&(clearTimeout(mi),mi=null)},T1);const e=[];return i.forEach(n=>{const r=t.position.distanceTo(y1.set(n.x,n.y,n.z));rn.distance-r.distance).slice(0,_1).map(n=>n.id)};let bn,_i;const w1=1e3,b1=2e3,C1=i=>{const t=We(),e=Os(k=>k.isUserDragging),s=Os(k=>k.isUserScrolling),n=Os(k=>k.setUserMovedCamera),{data:r,graphStyle:o,showSelectionGraph:a,setNearbyNodeIds:c,cameraFocusTrigger:l,graphRadius:u}=oe(k=>k),{camera:h}=Nt(),[d,p]=A.useState(!1),[m,f]=A.useState(!1),[_,y]=A.useState(el),w=A.useMemo(()=>{if(a)return new rt(0,0,0);const k=r==null?void 0:r.nodes.find(R=>R.ref_id===(t==null?void 0:t.ref_id)),C=u+300;let M=new rt(0,0,C);if(k&&r){const R=r==null?void 0:r.nodes.filter(Y=>{var j;return(j=k.children)==null?void 0:j.find(z=>z===Y.id)}),P=new rt(k.x,k.y,k.z);let U=new rt(0,0,0);R.map(Y=>(U=U.add(new rt(Y.x,Y.y,Y.z).normalize()),Y));const W=k.scale?1-1/(k.scale+10):1,G=P.sub(U).multiplyScalar(.8*W);M=P.add(G)}return M},[a,t,r,u]),b=A.useMemo(()=>{if(a)return new rt(0,0,0);const k=r==null?void 0:r.nodes.find(C=>C.ref_id===(t==null?void 0:t.ref_id));return new rt((k==null?void 0:k.x)||0,(k==null?void 0:k.y)||0,(k==null?void 0:k.z)||0)},[a,t,r]);A.useEffect(()=>{var k;a&&((k=i.current)==null||k.setLookAt(Ho.x,Ho.y,Ho.z,0,0,0,!1)),v()},[a]),A.useEffect(()=>{a?y(_0):(t==null?void 0:t.node_type)==="topic"?y(m0):y(el)},[t,y,a]),A.useEffect(()=>{g()},[l]),A.useEffect(()=>{(e||s)&&(p(!0),f(!0))},[e,s,p,f]),A.useEffect(()=>{if(t)if(!a&&o==="earth"&&(i!=null&&i.current)){const k=i.current.camera.position.distanceTo(new rt),C=p1(b,-k/2);i.current.setLookAt(C.x,C.y,C.z,0,0,0,!0)}else bn&&clearTimeout(bn),bn=setTimeout(()=>{f(!0),clearTimeout(bn)},b1),v();return()=>{bn&&clearTimeout(bn),_i&&clearTimeout(_i)}},[t]),be(k=>{i.current&&(d||x(w,k.camera),m||T(b,k.camera))});const v=()=>{if(t){const k=h.position.distanceTo(w);f1(k)}g()},g=()=>{p(!1),f(!1),n(!1),_i&&clearTimeout(_i),_i=setTimeout(()=>{p(!0),f(!0)},w1)},x=(k,C)=>{if(C.position.distanceTo(k)<_)p(!0);else{C.position.lerp(k,.5);const R=_h((r==null?void 0:r.nodes)||[],h);R&&c(R)}},T=(k,C)=>{var M;(M=i==null?void 0:i.current)==null||M.setLookAt(C.position.x,C.position.y,C.position.z,k.x,k.y,k.z,!0)};return null},S1=1;let Or=null;const E1=(i,{enabled:t})=>{const e=We();C1(i);const s=Os(a=>a.isUserDragging),{graphStyle:n,graphRadius:r,disableCameraRotation:o}=oe(a=>a);return A.useEffect(()=>{t||(Or==null||Or.kill(),Or=null)},[t]),A.useEffect(()=>{i.current&&r&&(n==="sphere"?(i.current.maxDistance=8e3,i.current.minDistance=200,i.current.setTarget(0,0,500,!0)):(i.current.maxDistance=i.current.getDistanceToFitSphere(r+200),i.current.minDistance=100))},[r,n,i]),A.useEffect(()=>{!e&&i.current&&i.current.setLookAt(Ti.x,Ti.y,r,0,0,0,!0)},[e,r]),be((a,c)=>{i.current&&(!o&&!s&&(i.current.azimuthAngle+=S1*c*Ef.DEG2RAD),i.current.update(c))}),null},O1=({disableAnimations:i})=>{const t=A.useRef(null),{data:e,setNearbyNodeIds:s,setDisableCameraRotation:n}=oe(h=>h),[r]=A.useState(.8),{camera:o}=Nt(),[a,c,l,u]=Os(h=>[h.isUserDragging,h.setIsUserDragging,h.isUserScrolling,h.isUserScrollingOnHtmlPanel]);return E1(t,{enabled:!i&&!l&&!a}),A.useEffect(()=>{if(!a){const h=_h((e==null?void 0:e.nodes)||[],o);h&&s(h)}},[o,o.position,o.position.x,o.position.y,o.position.z,e==null?void 0:e.nodes,s,a]),A.useEffect(()=>{a&&n(!0)},[a,n]),L.jsx($f,{ref:t,boundaryEnclosesCamera:!0,enabled:!u,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>c(!1),onStart:()=>c(!0),smoothTime:r})};function us(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function gh(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,i.__proto__=t}/*! * GSAP 3.12.4 * https://gsap.com * @@ -348,7 +348,7 @@ import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y a * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com -*/var Te={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Wn={duration:.5,overwrite:!1,delay:0},dc,Jt,Lt,Me=1e8,Ct=1/Me,ya=Math.PI*2,A1=ya/4,M1=0,yh=Math.sqrt,D1=Math.cos,P1=Math.sin,Zt=function(t){return typeof t=="string"},Vt=function(t){return typeof t=="function"},_s=function(t){return typeof t=="number"},fc=function(t){return typeof t>"u"},es=function(t){return typeof t=="object"},he=function(t){return t!==!1},pc=function(){return typeof window<"u"},Ar=function(t){return Vt(t)||Zt(t)},vh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},te=Array.isArray,va=/(?:-?\.?\d|\.)+/gi,kh=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Mn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$o=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,xh=/[+-]=-?[.\d]+/,Th=/[^,'"\[\]\s]+/gi,N1=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,It,Ee,ka,mc,we={},io={},wh,bh=function(t){return(io=hn(t,we))&&_e},_c=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Yi=function(t,e){return!e&&console.warn(t)},Ch=function(t,e){return t&&(we[t]=e)&&io&&(io[t]=e)||we},Gi=function(){return 0},I1={suppressEvents:!0,isStart:!0,kill:!1},Ir={suppressEvents:!0,kill:!1},R1={suppressEvents:!0},gc={},Ms=[],xa={},Sh,ye={},Xo={},Sl=30,Rr=[],yc="",vc=function(t){var e=t[0],s,n;if(es(e)||Vt(e)||(t=[t]),!(s=(e._gsap||{}).harness)){for(n=Rr.length;n--&&!Rr[n].targetTest(e););s=Rr[n]}for(n=t.length;n--;)t[n]&&(t[n]._gsap||(t[n]._gsap=new Zh(t[n],s)))||t.splice(n,1);return t},en=function(t){return t._gsap||vc(De(t))[0]._gsap},Eh=function(t,e,s){return(s=t[e])&&Vt(s)?t[e]():fc(s)&&t.getAttribute&&t.getAttribute(e)||s},de=function(t,e){return(t=t.split(",")).forEach(e)||t},zt=function(t){return Math.round(t*1e5)/1e5||0},$t=function(t){return Math.round(t*1e7)/1e7||0},In=function(t,e){var s=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),s==="+"?t+n:s==="-"?t-n:s==="*"?t*n:t/n},F1=function(t,e){for(var s=e.length,n=0;t.indexOf(e[n])<0&&++na;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[s],t[s]=e),e._next?e._next._prev=e:t[n]=e,e._prev=o,e.parent=e._dp=t,e},Do=function(t,e,s,n){s===void 0&&(s="_first"),n===void 0&&(n="_last");var r=e._prev,o=e._next;r?r._next=o:t[s]===e&&(t[s]=o),o?o._prev=r:t[n]===e&&(t[n]=r),e._next=e._prev=e.parent=null},Ls=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},sn=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var s=t;s;)s._dirty=1,s=s.parent;return t},U1=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Ta=function(t,e,s,n){return t._startAt&&(Jt?t._startAt.revert(Ir):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))},z1=function i(t){return!t||t._ts&&i(t.parent)},Ol=function(t){return t._repeat?Hn(t._tTime,t=t.duration()+t._rDelay)*t:0},Hn=function(t,e){var s=Math.floor(t/=e);return t&&s===t?s-1:s},ao=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Po=function(t){return t._end=$t(t._start+(t._tDur/Math.abs(t._ts||t._rts||Ct)||0))},No=function(t,e){var s=t._dp;return s&&s.smoothChildTiming&&t._ts&&(t._start=$t(s._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Po(t),s._dirty||sn(s,t)),t},Ph=function(t,e){var s;if((e._time||!e._dur&&e._initted||e._startCt)&&e.render(s,!0)),sn(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur=0&&s.totalTime(s._tTime),s=s._dp;t._zTime=-Ct}},Ze=function(t,e,s,n){return e.parent&&Ls(e),e._start=$t((_s(s)?s:s||t!==It?Se(t,s,e):t._time)+e._delay),e._end=$t(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Dh(t,e,"_first","_last",t._sort?"_start":0),wa(e)||(t._recent=e),n||Ph(t,e),t._ts<0&&No(t,t._tTime),t},Nh=function(t,e){return(we.ScrollTrigger||_c("scrollTrigger",e))&&we.ScrollTrigger.create(e,t)},Ih=function(t,e,s,n,r){if(xc(t,e,r),!t._initted)return 1;if(!s&&t._pt&&!Jt&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Sh!==ve.frame)return Ms.push(t),t._lazy=[r,n],1},j1=function i(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||i(e))},wa=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},B1=function(t,e,s,n){var r=t.ratio,o=e<0||!e&&(!t._start&&j1(t)&&!(!t._initted&&wa(t))||(t._ts<0||t._dp._ts<0)&&!wa(t))?0:1,a=t._rDelay,c=0,l,u,h;if(a&&t._repeat&&(c=dr(0,t._tDur,e),u=Hn(c,a),t._yoyo&&u&1&&(o=1-o),u!==Hn(t._tTime,a)&&(r=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==r||Jt||n||t._zTime===Ct||!e&&t._zTime){if(!t._initted&&Ih(t,e,n,s,c))return;for(h=t._zTime,t._zTime=e||(s?Ct:0),s||(s=e&&!h),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=c,l=t._pt;l;)l.r(o,l.d),l=l._next;e<0&&Ta(t,e,s,!0),t._onUpdate&&!s&&ke(t,"onUpdate"),c&&t._repeat&&!s&&t.parent&&ke(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Ls(t,1),!s&&!Jt&&(ke(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},q1=function(t,e,s){var n;if(s>e)for(n=t._first;n&&n._start<=s;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=s;){if(n.data==="isPause"&&n._start0&&!n&&No(t,t._tTime=t._tDur*a),t.parent&&Po(t),s||sn(t.parent,t),t},Al=function(t){return t instanceof ie?sn(t):Yn(t,t._dur)},W1={_start:0,endTime:Gi,totalDuration:Gi},Se=function i(t,e,s){var n=t.labels,r=t._recent||W1,o=t.duration()>=Me?r.endTime(!1):t._dur,a,c,l;return Zt(e)&&(isNaN(e)||e in n)?(c=e.charAt(0),l=e.substr(-1)==="%",a=e.indexOf("="),c==="<"||c===">"?(a>=0&&(e=e.replace(/=/,"")),(c==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(e.substr(1))||0)*(l?(a<0?r:s).totalDuration()/100:1)):a<0?(e in n||(n[e]=o),n[e]):(c=parseFloat(e.charAt(a-1)+e.substr(a+1)),l&&s&&(c=c/100*(te(s)?s[0]:s).totalDuration()),a>1?i(t,e.substr(0,a-1),s)+c:o+c)):e==null?o:+e},Ci=function(t,e,s){var n=_s(e[1]),r=(n?2:1)+(t<2?0:1),o=e[r],a,c;if(n&&(o.duration=e[1]),o.parent=s,t){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=he(c.vars.inherit)&&c.parent;o.immediateRender=he(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[r-1]}return new Ht(e[0],o,e[r+1])},Bs=function(t,e){return t||t===0?e(t):e},dr=function(t,e,s){return se?e:s},Kt=function(t,e){return!Zt(t)||!(e=N1.exec(t))?"":e[1]},H1=function(t,e,s){return Bs(s,function(n){return dr(t,e,n)})},ba=[].slice,Rh=function(t,e){return t&&es(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&es(t[0]))&&!t.nodeType&&t!==Ee},Y1=function(t,e,s){return s===void 0&&(s=[]),t.forEach(function(n){var r;return Zt(n)&&!e||Rh(n,1)?(r=s).push.apply(r,De(n)):s.push(n)})||s},De=function(t,e,s){return Lt&&!e&&Lt.selector?Lt.selector(t):Zt(t)&&!s&&(ka||!Gn())?ba.call((e||mc).querySelectorAll(t),0):te(t)?Y1(t,s):Rh(t)?ba.call(t,0):t?[t]:[]},Ca=function(t){return t=De(t)[0]||Yi("Invalid scope")||{},function(e){var s=t.current||t.nativeElement||t;return De(e,s.querySelectorAll?s:s===t?Yi("Invalid scope")||mc.createElement("div"):t)}},Fh=function(t){return t.sort(function(){return .5-Math.random()})},Lh=function(t){if(Vt(t))return t;var e=es(t)?t:{each:t},s=nn(e.ease),n=e.from||0,r=parseFloat(e.base)||0,o={},a=n>0&&n<1,c=isNaN(n)||a,l=e.axis,u=n,h=n;return Zt(n)?u=h={center:.5,edges:.5,end:1}[n]||0:!a&&c&&(u=n[0],h=n[1]),function(d,f,_){var p=(_||e).length,m=o[p],y,w,b,v,g,T,x,k,C;if(!m){if(C=e.grid==="auto"?0:(e.grid||[1,Me])[1],!C){for(x=-Me;x<(x=_[C++].getBoundingClientRect().left)&&Cx&&(x=g),gp?p-1:l?l==="y"?p/C:C:Math.max(C,p/C))||0)*(n==="edges"?-1:1),m.b=p<0?r-p:r,m.u=Kt(e.amount||e.each)||0,s=s&&p<0?Gh(s):s}return p=(m[d]-m.min)/m.max||0,$t(m.b+(s?s(p):p)*m.v)+m.u}},Sa=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(s){var n=$t(Math.round(parseFloat(s)/t)*t*e);return(n-n%1)/e+(_s(s)?0:Kt(s))}},Vh=function(t,e){var s=te(t),n,r;return!s&&es(t)&&(n=s=t.radius||Me,t.values?(t=De(t.values),(r=!_s(t[0]))&&(n*=n)):t=Sa(t.increment)),Bs(e,s?Vt(t)?function(o){return r=t(o),Math.abs(r-o)<=n?r:o}:function(o){for(var a=parseFloat(r?o.x:o),c=parseFloat(r?o.y:0),l=Me,u=0,h=t.length,d,f;h--;)r?(d=t[h].x-a,f=t[h].y-c,d=d*d+f*f):d=Math.abs(t[h]-a),dn?r-o:o)})},$i=function(t){for(var e=0,s="",n,r,o,a;~(n=t.indexOf("random(",e));)o=t.indexOf(")",n),a=t.charAt(n+7)==="[",r=t.substr(n+7,o-n-7).match(a?Th:va),s+=t.substr(e,n-e)+Uh(a?r:+r[0],a?0:+r[1],+r[2]||1e-5),e=o+1;return s+t.substr(e,t.length-e)},jh=function(t,e,s,n,r){var o=e-t,a=n-s;return Bs(r,function(c){return s+((c-t)/o*a||0)})},K1=function i(t,e,s,n){var r=isNaN(t+e)?0:function(f){return(1-f)*t+f*e};if(!r){var o=Zt(t),a={},c,l,u,h,d;if(s===!0&&(n=1)&&(s=null),o)t={p:t},e={p:e};else if(te(t)&&!te(e)){for(u=[],h=t.length,d=h-2,l=1;l(a=Math.abs(a))&&(c=o,r=a);return c},ke=function(t,e,s){var n=t.vars,r=n[e],o=Lt,a=t._ctx,c,l,u;if(r)return c=n[e+"Params"],l=n.callbackScope||t,s&&Ms.length&&ro(),a&&(Lt=a),u=c?r.apply(l,c):r.call(l),Lt=o,u},vi=function(t){return Ls(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Jt),t.progress()<1&&ke(t,"onInterrupt"),t},Dn,Bh=[],qh=function(t){if(pc()&&t){t=!t.name&&t.default||t;var e=t.name,s=Vt(t),n=e&&!s&&t.init?function(){this._props=[]}:t,r={init:Gi,render:bc,add:kc,kill:pv,modifier:fv,rawVars:0},o={targetTest:0,get:0,getSetter:wc,aliases:{},register:0};if(Gn(),t!==n){if(ye[e])return;Ne(n,Ne(oo(t,r),o)),hn(n.prototype,hn(r,oo(t,o))),ye[n.prop=e]=n,t.targetTest&&(Rr.push(n),gc[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Ch(e,n),t.register&&t.register(_e,n,fe)}else t&&Bh.push(t)},bt=255,ki={aqua:[0,bt,bt],lime:[0,bt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,bt],navy:[0,0,128],white:[bt,bt,bt],olive:[128,128,0],yellow:[bt,bt,0],orange:[bt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[bt,0,0],pink:[bt,192,203],cyan:[0,bt,bt],transparent:[bt,bt,bt,0]},Zo=function(t,e,s){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(s-e)*t*6:t<.5?s:t*3<2?e+(s-e)*(2/3-t)*6:e)*bt+.5|0},Wh=function(t,e,s){var n=t?_s(t)?[t>>16,t>>8&bt,t&bt]:0:ki.black,r,o,a,c,l,u,h,d,f,_;if(!n){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ki[t])n=ki[t];else if(t.charAt(0)==="#"){if(t.length<6&&(r=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+r+r+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return n=parseInt(t.substr(1,6),16),[n>>16,n>>8&bt,n&bt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),n=[t>>16,t>>8&bt,t&bt]}else if(t.substr(0,3)==="hsl"){if(n=_=t.match(va),!e)c=+n[0]%360/360,l=+n[1]/100,u=+n[2]/100,o=u<=.5?u*(l+1):u+l-u*l,r=u*2-o,n.length>3&&(n[3]*=1),n[0]=Zo(c+1/3,r,o),n[1]=Zo(c,r,o),n[2]=Zo(c-1/3,r,o);else if(~t.indexOf("="))return n=t.match(kh),s&&n.length<4&&(n[3]=1),n}else n=t.match(va)||ki.transparent;n=n.map(Number)}return e&&!_&&(r=n[0]/bt,o=n[1]/bt,a=n[2]/bt,h=Math.max(r,o,a),d=Math.min(r,o,a),u=(h+d)/2,h===d?c=l=0:(f=h-d,l=u>.5?f/(2-h-d):f/(h+d),c=h===r?(o-a)/f+(ot&&(s+=y-e),n+=y,g=n-s,b=g-o,(b>0||w)&&(T=++h.frame,d=g-h.time*1e3,h.time=g=g/1e3,o+=b+(b>=r?4:r-b),v=1),w||(c=l(p)),v)for(f=0;f=y&&f--},_listeners:a},h}(),Gn=function(){return!Xi&&ve.wake()},ft={},tv=/^[\d.\-M][\d.\-,\s]/,ev=/["']/g,sv=function(t){for(var e={},s=t.substr(1,t.length-3).split(":"),n=s[0],r=1,o=s.length,a,c,l;r1&&s.config?s.config.apply(null,~t.indexOf("{")?[sv(e[1])]:nv(t).split(",").map(Ah)):ft._CE&&tv.test(t)?ft._CE("",t):s},Gh=function(t){return function(e){return 1-t(1-e)}},$h=function i(t,e){for(var s=t._first,n;s;)s instanceof ie?i(s,e):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==e&&(s.timeline?i(s.timeline,e):(n=s._ease,s._ease=s._yEase,s._yEase=n,s._yoyo=e)),s=s._next},nn=function(t,e){return t&&(Vt(t)?t:ft[t]||iv(t))||e},_n=function(t,e,s,n){s===void 0&&(s=function(c){return 1-e(1-c)}),n===void 0&&(n=function(c){return c<.5?e(c*2)/2:1-e((1-c)*2)/2});var r={easeIn:e,easeOut:s,easeInOut:n},o;return de(t,function(a){ft[a]=we[a]=r,ft[o=a.toLowerCase()]=s;for(var c in r)ft[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ft[a+"."+c]=r[c]}),r},Xh=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Qo=function i(t,e,s){var n=e>=1?e:1,r=(s||(t?.3:.45))/(e<1?e:1),o=r/ya*(Math.asin(1/n)||0),a=function(u){return u===1?1:n*Math.pow(2,-10*u)*P1((u-o)*r)+1},c=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:Xh(a);return r=ya/r,c.config=function(l,u){return i(t,l,u)},c},Ko=function i(t,e){e===void 0&&(e=1.70158);var s=function(o){return o?--o*o*((e+1)*o+e)+1:0},n=t==="out"?s:t==="in"?function(r){return 1-s(1-r)}:Xh(s);return n.config=function(r){return i(t,r)},n};de("Linear,Quad,Cubic,Quart,Quint,Strong",function(i,t){var e=t<5?t+1:t;_n(i+",Power"+(e-1),t?function(s){return Math.pow(s,e)}:function(s){return s},function(s){return 1-Math.pow(1-s,e)},function(s){return s<.5?Math.pow(s*2,e)/2:1-Math.pow((1-s)*2,e)/2})});ft.Linear.easeNone=ft.none=ft.Linear.easeIn;_n("Elastic",Qo("in"),Qo("out"),Qo());(function(i,t){var e=1/t,s=2*e,n=2.5*e,r=function(a){return a0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},t.totalDuration=function(s){return arguments.length?(this._dirty=0,Yn(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(s,n){if(Gn(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(No(this,s),!r._dp||r.parent||Ph(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s0||!this._tDur&&!s)&&Ze(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Ct||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Oh(this,s,n)),this},t.time=function(s,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+Ol(this))%(this._dur+this._rDelay)||(s?this._dur:0),n):this._time},t.totalProgress=function(s,n){return arguments.length?this.totalTime(this.totalDuration()*s,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(s,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+Ol(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(s,n){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*r,n):this._repeat?Hn(this._tTime,r)+1:1},t.timeScale=function(s,n){if(!arguments.length)return this._rts===-Ct?0:this._rts;if(this._rts===s)return this;var r=this.parent&&this._ts?ao(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-Ct?0:this._rts,this.totalTime(dr(-Math.abs(this._delay),this._tDur,r),n!==!1),Po(this),U1(this)},t.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Gn(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ct&&(this._tTime-=Ct)))),this):this._ps},t.startTime=function(s){if(arguments.length){this._start=s;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&Ze(n,this,s-this._delay),this}return this._start},t.endTime=function(s){return this._start+(he(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(s){var n=this.parent||this._dp;return n?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ao(n.rawTime(s),this):this._tTime:this._tTime},t.revert=function(s){s===void 0&&(s=R1);var n=Jt;return Jt=s,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),Jt=n,this},t.globalTime=function(s){for(var n=this,r=arguments.length?s:n.rawTime();n;)r=n._start+r/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(s):r},t.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Al(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(s){if(arguments.length){var n=this._time;return this._rDelay=s,Al(this),n?this.time(n):this}return this._rDelay},t.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},t.seek=function(s,n){return this.totalTime(Se(this,s),he(n))},t.restart=function(s,n){return this.play().totalTime(s?-this._delay:0,he(n))},t.play=function(s,n){return s!=null&&this.seek(s,n),this.reversed(!1).paused(!1)},t.reverse=function(s,n){return s!=null&&this.seek(s||this.totalDuration(),n),this.reversed(!0).paused(!1)},t.pause=function(s,n){return s!=null&&this.seek(s,n),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-Ct:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ct,this},t.isActive=function(){var s=this.parent||this._dp,n=this._start,r;return!!(!s||this._ts&&this._initted&&s.isActive()&&(r=s.rawTime(!0))>=n&&r1?(n?(o[s]=n,r&&(o[s+"Params"]=r),s==="onUpdate"&&(this._onUpdate=n)):delete o[s],this):o[s]},t.then=function(s){var n=this;return new Promise(function(r){var o=Vt(s)?s:Mh,a=function(){var l=n.then;n.then=null,Vt(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=l),r(o),n.then=l};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?a():n._prom=a})},t.kill=function(){vi(this)},i}();Ne(Zi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Ct,_prom:0,_ps:!1,_rts:1});var ie=function(i){gh(t,i);function t(s,n){var r;return s===void 0&&(s={}),r=i.call(this,s)||this,r.labels={},r.smoothChildTiming=!!s.smoothChildTiming,r.autoRemoveChildren=!!s.autoRemoveChildren,r._sort=he(s.sortChildren),It&&Ze(s.parent||It,us(r),n),s.reversed&&r.reverse(),s.paused&&r.paused(!0),s.scrollTrigger&&Nh(us(r),s.scrollTrigger),r}var e=t.prototype;return e.to=function(n,r,o){return Ci(0,arguments,this),this},e.from=function(n,r,o){return Ci(1,arguments,this),this},e.fromTo=function(n,r,o,a){return Ci(2,arguments,this),this},e.set=function(n,r,o){return r.duration=0,r.parent=this,bi(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new Ht(n,r,Se(this,o),1),this},e.call=function(n,r,o){return Ze(this,Ht.delayedCall(0,n,r),o)},e.staggerTo=function(n,r,o,a,c,l,u){return o.duration=r,o.stagger=o.stagger||a,o.onComplete=l,o.onCompleteParams=u,o.parent=this,new Ht(n,o,Se(this,c)),this},e.staggerFrom=function(n,r,o,a,c,l,u){return o.runBackwards=1,bi(o).immediateRender=he(o.immediateRender),this.staggerTo(n,r,o,a,c,l,u)},e.staggerFromTo=function(n,r,o,a,c,l,u,h){return a.startAt=o,bi(a).immediateRender=he(a.immediateRender),this.staggerTo(n,r,a,c,l,u,h)},e.render=function(n,r,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,l=this._dur,u=n<=0?0:$t(n),h=this._zTime<0!=n<0&&(this._initted||!l),d,f,_,p,m,y,w,b,v,g,T,x;if(this!==It&&u>c&&n>=0&&(u=c),u!==this._tTime||o||h){if(a!==this._time&&l&&(u+=this._time-a,n+=this._time-a),d=u,v=this._start,b=this._ts,y=!b,h&&(l||(a=this._zTime),(n||!r)&&(this._zTime=n)),this._repeat){if(T=this._yoyo,m=l+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(m*100+n,r,o);if(d=$t(u%m),u===c?(p=this._repeat,d=l):(p=~~(u/m),p&&p===u/m&&(d=l,p--),d>l&&(d=l)),g=Hn(this._tTime,m),!a&&this._tTime&&g!==p&&this._tTime-g*m-this._dur<=0&&(g=p),T&&p&1&&(d=l-d,x=1),p!==g&&!this._lock){var k=T&&g&1,C=k===(T&&p&1);if(p=a&&n>=0)for(f=this._first;f;){if(_=f._next,(f._act||d>=f._start)&&f._ts&&w!==f){if(f.parent!==this)return this.render(n,r,o);if(f.render(f._ts>0?(d-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(d-f._start)*f._ts,r,o),d!==this._time||!this._ts&&!y){w=0,_&&(u+=this._zTime=-Ct);break}}f=_}else{f=this._last;for(var M=n<0?n:d;f;){if(_=f._prev,(f._act||M<=f._end)&&f._ts&&w!==f){if(f.parent!==this)return this.render(n,r,o);if(f.render(f._ts>0?(M-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(M-f._start)*f._ts,r,o||Jt&&(f._initted||f._startAt)),d!==this._time||!this._ts&&!y){w=0,_&&(u+=this._zTime=M?-Ct:Ct);break}}f=_}}if(w&&!r&&(this.pause(),w.render(d>=a?0:-Ct)._zTime=d>=a?1:-1,this._ts))return this._start=v,Po(this),this.render(n,r,o);this._onUpdate&&!r&&ke(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&a)&&(v===this._start||Math.abs(b)!==Math.abs(this._ts))&&(this._lock||((n||!l)&&(u===c&&this._ts>0||!u&&this._ts<0)&&Ls(this,1),!r&&!(n<0&&!a)&&(u||a||!c)&&(ke(this,u===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u0)&&this._prom())))}return this},e.add=function(n,r){var o=this;if(_s(r)||(r=Se(this,r,n)),!(n instanceof Zi)){if(te(n))return n.forEach(function(a){return o.add(a,r)}),this;if(Zt(n))return this.addLabel(n,r);if(Vt(n))n=Ht.delayedCall(0,n);else return this}return this!==n?Ze(this,n,r):this},e.getChildren=function(n,r,o,a){n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),a===void 0&&(a=-Me);for(var c=[],l=this._first;l;)l._start>=a&&(l instanceof Ht?r&&c.push(l):(o&&c.push(l),n&&c.push.apply(c,l.getChildren(!0,r,o)))),l=l._next;return c},e.getById=function(n){for(var r=this.getChildren(1,1,1),o=r.length;o--;)if(r[o].vars.id===n)return r[o]},e.remove=function(n){return Zt(n)?this.removeLabel(n):Vt(n)?this.killTweensOf(n):(Do(this,n),n===this._recent&&(this._recent=this._last),sn(this))},e.totalTime=function(n,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=$t(ve.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),i.prototype.totalTime.call(this,n,r),this._forcing=0,this):this._tTime},e.addLabel=function(n,r){return this.labels[n]=Se(this,r),this},e.removeLabel=function(n){return delete this.labels[n],this},e.addPause=function(n,r,o){var a=Ht.delayedCall(0,r||Gi,o);return a.data="isPause",this._hasPause=1,Ze(this,a,Se(this,n))},e.removePause=function(n){var r=this._first;for(n=Se(this,n);r;)r._start===n&&r.data==="isPause"&&Ls(r),r=r._next},e.killTweensOf=function(n,r,o){for(var a=this.getTweensOf(n,o),c=a.length;c--;)Cs!==a[c]&&a[c].kill(n,r);return this},e.getTweensOf=function(n,r){for(var o=[],a=De(n),c=this._first,l=_s(r),u;c;)c instanceof Ht?F1(c._targets,a)&&(l?(!Cs||c._initted&&c._ts)&&c.globalTime(0)<=r&&c.globalTime(c.totalDuration())>r:!r||c.isActive())&&o.push(c):(u=c.getTweensOf(a,r)).length&&o.push.apply(o,u),c=c._next;return o},e.tweenTo=function(n,r){r=r||{};var o=this,a=Se(o,n),c=r,l=c.startAt,u=c.onStart,h=c.onStartParams,d=c.immediateRender,f,_=Ht.to(o,Ne({ease:r.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale())||Ct,onStart:function(){if(o.pause(),!f){var m=r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());_._dur!==m&&Yn(_,m,0,1).render(_._time,!0,!0),f=1}u&&u.apply(_,h||[])}},r));return d?_.render(0):_},e.tweenFromTo=function(n,r,o){return this.tweenTo(r,Ne({startAt:{time:Se(this,n)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(n){return n===void 0&&(n=this._time),Ml(this,Se(this,n))},e.previousLabel=function(n){return n===void 0&&(n=this._time),Ml(this,Se(this,n),1)},e.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Ct)},e.shiftChildren=function(n,r,o){o===void 0&&(o=0);for(var a=this._first,c=this.labels,l;a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(r)for(l in c)c[l]>=o&&(c[l]+=n);return sn(this)},e.invalidate=function(n){var r=this._first;for(this._lock=0;r;)r.invalidate(n),r=r._next;return i.prototype.invalidate.call(this,n)},e.clear=function(n){n===void 0&&(n=!0);for(var r=this._first,o;r;)o=r._next,this.remove(r),r=o;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),sn(this)},e.totalDuration=function(n){var r=0,o=this,a=o._last,c=Me,l,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-n:n));if(o._dirty){for(h=o.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>c&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ze(o,a,u-a._delay,1)._lock=0):c=u,u<0&&a._ts&&(r-=u,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),c=0),a._end>r&&a._ts&&(r=a._end),a=l;Yn(o,o===It&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(n){if(It._ts&&(Oh(It,ao(n,It)),Sh=ve.frame),ve.frame>=Sl){Sl+=Te.autoSleep||120;var r=It._first;if((!r||!r._ts)&&Te.autoSleep&&ve._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||ve.sleep()}}},t}(Zi);Ne(ie.prototype,{_lock:0,_hasPause:0,_forcing:0});var rv=function(t,e,s,n,r,o,a){var c=new fe(this._pt,t,e,0,1,sd,null,r),l=0,u=0,h,d,f,_,p,m,y,w;for(c.b=s,c.e=n,s+="",n+="",(y=~n.indexOf("random("))&&(n=$i(n)),o&&(w=[s,n],o(w,t,e),s=w[0],n=w[1]),d=s.match($o)||[];h=$o.exec(n);)_=h[0],p=n.substring(l,h.index),f?f=(f+1)%5:p.substr(-5)==="rgba("&&(f=1),_!==d[u++]&&(m=parseFloat(d[u-1])||0,c._pt={_next:c._pt,p:p||u===1?p:",",s:m,c:_.charAt(1)==="="?In(m,_)-m:parseFloat(_)-m,m:f&&f<4?Math.round:0},l=$o.lastIndex);return c.c=l")}),v.duration();else{T={};for(k in _)k==="ease"||k==="easeEach"||lv(k,_[k],T,_.easeEach);for(k in T)for(U=T[k].sort(function(Y,j){return Y.t-j.t}),P=0,g=0;gc-Ct&&!u?c:nl&&(d=l)),y=this._yoyo&&_&1,y&&(v=this._yEase,d=l-d),m=Hn(this._tTime,p),d===a&&!o&&this._initted&&_===m)return this._tTime=h,this;_!==m&&(b&&this._yEase&&$h(b,y),this.vars.repeatRefresh&&!y&&!this._lock&&this._time!==l&&this._initted&&(this._lock=o=1,this.render($t(p*_),!0).invalidate()._lock=0))}if(!this._initted){if(Ih(this,u?n:d,o,r,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==m))return this;if(l!==this._dur)return this.render(n,r,o)}if(this._tTime=h,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=w=(v||this._ease)(d/l),this._from&&(this.ratio=w=1-w),d&&!a&&!r&&!_&&(ke(this,"onStart"),this._tTime!==h))return this;for(f=this._pt;f;)f.r(w,f.d),f=f._next;b&&b.render(n<0?n:!d&&y?-Ct:b._dur*b._ease(d/this._dur),r,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!r&&(u&&Ta(this,n,r,o),ke(this,"onUpdate")),this._repeat&&_!==m&&this.vars.onRepeat&&!r&&this.parent&&ke(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&Ta(this,n,!0,!0),(n||!l)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Ls(this,1),!r&&!(u&&!a)&&(h||a||y)&&(ke(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),i.prototype.invalidate.call(this,n)},e.resetTo=function(n,r,o,a,c){Xi||ve.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||xc(this,l),u=this._ease(l/this._dur),av(this,n,r,o,a,u,l,c)?this.resetTo(n,r,o,a,1):(No(this,0),this.parent||Dh(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(n,r){if(r===void 0&&(r="all"),!n&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?vi(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,r,Cs&&Cs.vars.overwrite!==!0)._first||vi(this),this.parent&&o!==this.timeline.totalDuration()&&Yn(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=n?De(n):a,l=this._ptLookup,u=this._pt,h,d,f,_,p,m,y;if((!r||r==="all")&&V1(a,c))return r==="all"&&(this._pt=0),vi(this);for(h=this._op=this._op||[],r!=="all"&&(Zt(r)&&(p={},de(r,function(w){return p[w]=1}),r=p),r=cv(a,r)),y=a.length;y--;)if(~c.indexOf(a[y])){d=l[y],r==="all"?(h[y]=r,_=d,f={}):(f=h[y]=h[y]||{},_=r);for(p in _)m=d&&d[p],m&&((!("kill"in m.d)||m.d.kill(p)===!0)&&Do(this,m,"_pt"),delete d[p]),f!=="all"&&(f[p]=1)}return this._initted&&!this._pt&&u&&vi(this),this},t.to=function(n,r){return new t(n,r,arguments[2])},t.from=function(n,r){return Ci(1,arguments)},t.delayedCall=function(n,r,o,a){return new t(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:r,onReverseComplete:r,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(n,r,o){return Ci(2,arguments)},t.set=function(n,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new t(n,r)},t.killTweensOf=function(n,r,o){return It.killTweensOf(n,r,o)},t}(Zi);Ne(Ht.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});de("staggerTo,staggerFrom,staggerFromTo",function(i){Ht[i]=function(){var t=new ie,e=ba.call(arguments,0);return e.splice(i==="staggerFromTo"?5:4,0,0),t[i].apply(t,e)}});var Tc=function(t,e,s){return t[e]=s},td=function(t,e,s){return t[e](s)},uv=function(t,e,s,n){return t[e](n.fp,s)},hv=function(t,e,s){return t.setAttribute(e,s)},wc=function(t,e){return Vt(t[e])?td:fc(t[e])&&t.setAttribute?hv:Tc},ed=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},dv=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},sd=function(t,e){var s=e._pt,n="";if(!t&&e.b)n=e.b;else if(t===1&&e.e)n=e.e;else{for(;s;)n=s.p+(s.m?s.m(s.s+s.c*t):Math.round((s.s+s.c*t)*1e4)/1e4)+n,s=s._next;n+=e.c}e.set(e.t,e.p,n,e)},bc=function(t,e){for(var s=e._pt;s;)s.r(t,s.d),s=s._next},fv=function(t,e,s,n){for(var r=this._pt,o;r;)o=r._next,r.p===n&&r.modifier(t,e,s),r=o},pv=function(t){for(var e=this._pt,s,n;e;)n=e._next,e.p===t&&!e.op||e.op===t?Do(this,e,"_pt"):e.dep||(s=1),e=n;return!s},mv=function(t,e,s,n){n.mSet(t,e,n.m.call(n.tween,s,n.mt),n)},nd=function(t){for(var e=t._pt,s,n,r,o;e;){for(s=e._next,n=r;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:o)?e._prev._next=e:r=e,(e._next=n)?n._prev=e:o=e,e=s}t._pt=r},fe=function(){function i(e,s,n,r,o,a,c,l,u){this.t=s,this.s=r,this.c=o,this.p=n,this.r=a||ed,this.d=c||this,this.set=l||Tc,this.pr=u||0,this._next=e,e&&(e._prev=this)}var t=i.prototype;return t.modifier=function(s,n,r){this.mSet=this.mSet||this.set,this.set=mv,this.m=s,this.mt=r,this.tween=n},i}();de(yc+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(i){return gc[i]=1});we.TweenMax=we.TweenLite=Ht;we.TimelineLite=we.TimelineMax=ie;It=new ie({sortChildren:!1,defaults:Wn,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Te.stringFilter=Yh;var rn=[],Fr={},_v=[],Pl=0,gv=0,Jo=function(t){return(Fr[t]||_v).map(function(e){return e()})},Oa=function(){var t=Date.now(),e=[];t-Pl>2&&(Jo("matchMediaInit"),rn.forEach(function(s){var n=s.queries,r=s.conditions,o,a,c,l;for(a in n)o=Ee.matchMedia(n[a]).matches,o&&(c=1),o!==r[a]&&(r[a]=o,l=1);l&&(s.revert(),c&&e.push(s))}),Jo("matchMediaRevert"),e.forEach(function(s){return s.onMatch(s,function(n){return s.add(null,n)})}),Pl=t,Jo("matchMedia"))},id=function(){function i(e,s){this.selector=s&&Ca(s),this.data=[],this._r=[],this.isReverted=!1,this.id=gv++,e&&this.add(e)}var t=i.prototype;return t.add=function(s,n,r){Vt(s)&&(r=n,n=s,s=Vt);var o=this,a=function(){var l=Lt,u=o.selector,h;return l&&l!==o&&l.data.push(o),r&&(o.selector=Ca(r)),Lt=o,h=n.apply(o,arguments),Vt(h)&&o._r.push(h),Lt=l,o.selector=u,o.isReverted=!1,h};return o.last=a,s===Vt?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},t.ignore=function(s){var n=Lt;Lt=null,s(this),Lt=n},t.getTweens=function(){var s=[];return this.data.forEach(function(n){return n instanceof i?s.push.apply(s,n.getTweens()):n instanceof Ht&&!(n.parent&&n.parent.data==="nested")&&s.push(n)}),s},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(s,n){var r=this;if(s?function(){for(var a=r.getTweens(),c=r.data.length,l;c--;)l=r.data[c],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,h){return h.g-u.g||-1/0}).forEach(function(u){return u.t.revert(s)}),c=r.data.length;c--;)l=r.data[c],l instanceof ie?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ht)&&l.revert&&l.revert(s);r._r.forEach(function(u){return u(s,r)}),r.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),n)for(var o=rn.length;o--;)rn[o].id===this.id&&rn.splice(o,1)},t.revert=function(s){this.kill(s||{})},i}(),yv=function(){function i(e){this.contexts=[],this.scope=e}var t=i.prototype;return t.add=function(s,n,r){es(s)||(s={matches:s});var o=new id(0,r||this.scope),a=o.conditions={},c,l,u;Lt&&!o.selector&&(o.selector=Lt.selector),this.contexts.push(o),n=o.add("onMatch",n),o.queries=s;for(l in s)l==="all"?u=1:(c=Ee.matchMedia(s[l]),c&&(rn.indexOf(o)<0&&rn.push(o),(a[l]=c.matches)&&(u=1),c.addListener?c.addListener(Oa):c.addEventListener("change",Oa)));return u&&n(o,function(h){return o.add(null,h)}),this},t.revert=function(s){this.kill(s||{})},t.kill=function(s){this.contexts.forEach(function(n){return n.kill(s,!0)})},i}(),co={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),s=0;s1){var n=t.map(function(u){return _e.quickSetter(u,e,s)}),r=n.length;return function(u){for(var h=r;h--;)n[h](u)}}t=t[0]||{};var o=ye[e],a=en(t),c=a.harness&&(a.harness.aliases||{})[e]||e,l=o?function(u){var h=new o;Dn._pt=0,h.init(t,s?u+s:u,Dn,0,[t]),h.render(1,h),Dn._pt&&bc(1,Dn)}:a.set(t,c);return o?l:function(u){return l(t,c,s?u+s:u,a,1)}},quickTo:function(t,e,s){var n,r=_e.to(t,hn((n={},n[e]="+=0.1",n.paused=!0,n),s||{})),o=function(c,l,u){return r.resetTo(e,c,l,u)};return o.tween=r,o},isTweening:function(t){return It.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=nn(t.ease,Wn.ease)),El(Wn,t||{})},config:function(t){return El(Te,t||{})},registerEffect:function(t){var e=t.name,s=t.effect,n=t.plugins,r=t.defaults,o=t.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!ye[a]&&!we[a]&&Yi(e+" effect requires "+a+" plugin.")}),Xo[e]=function(a,c,l){return s(De(a),Ne(c||{},r),l)},o&&(ie.prototype[e]=function(a,c,l){return this.add(Xo[e](a,es(c)?c:(l=c)&&{},this),l)})},registerEase:function(t,e){ft[t]=nn(e)},parseEase:function(t,e){return arguments.length?nn(t,e):ft},getById:function(t){return It.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var s=new ie(t),n,r;for(s.smoothChildTiming=he(t.smoothChildTiming),It.remove(s),s._dp=0,s._time=s._tTime=It._time,n=It._first;n;)r=n._next,(e||!(!n._dur&&n instanceof Ht&&n.vars.onComplete===n._targets[0]))&&Ze(s,n,n._start-n._delay),n=r;return Ze(It,s,0),s},context:function(t,e){return t?new id(t,e):Lt},matchMedia:function(t){return new yv(t)},matchMediaRefresh:function(){return rn.forEach(function(t){var e=t.conditions,s,n;for(n in e)e[n]&&(e[n]=!1,s=1);s&&t.revert()})||Oa()},addEventListener:function(t,e){var s=Fr[t]||(Fr[t]=[]);~s.indexOf(e)||s.push(e)},removeEventListener:function(t,e){var s=Fr[t],n=s&&s.indexOf(e);n>=0&&s.splice(n,1)},utils:{wrap:Z1,wrapYoyo:Q1,distribute:Lh,random:Uh,snap:Vh,normalize:X1,getUnit:Kt,clamp:H1,splitColor:Wh,toArray:De,selector:Ca,mapRange:jh,pipe:G1,unitize:$1,interpolate:K1,shuffle:Fh},install:bh,effects:Xo,ticker:ve,updateRoot:ie.updateRoot,plugins:ye,globalTimeline:It,core:{PropTween:fe,globals:Ch,Tween:Ht,Timeline:ie,Animation:Zi,getCache:en,_removeLinkedListItem:Do,reverting:function(){return Jt},context:function(t){return t&&Lt&&(Lt.data.push(t),t._ctx=Lt),Lt},suppressOverwrites:function(t){return dc=t}}};de("to,from,fromTo,delayedCall,set,killTweensOf",function(i){return co[i]=Ht[i]});ve.add(ie.updateRoot);Dn=co.to({},{duration:0});var vv=function(t,e){for(var s=t._pt;s&&s.p!==e&&s.op!==e&&s.fp!==e;)s=s._next;return s},kv=function(t,e){var s=t._targets,n,r,o;for(n in e)for(r=s.length;r--;)o=t._ptLookup[r][n],o&&(o=o.d)&&(o._pt&&(o=vv(o,n)),o&&o.modifier&&o.modifier(e[n],t,s[r],n))},ta=function(t,e){return{name:t,rawVars:1,init:function(n,r,o){o._onInit=function(a){var c,l;if(Zt(r)&&(c={},de(r,function(u){return c[u]=1}),r=c),e){c={};for(l in r)c[l]=e(r[l]);r=c}kv(a,r)}}}},_e=co.registerPlugin({name:"attr",init:function(t,e,s,n,r){var o,a,c;this.tween=s;for(o in e)c=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(c||0)+"",e[o],n,r,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(t,e){for(var s=e._pt;s;)Jt?s.set(s.t,s.p,s.b,s):s.r(t,s.d),s=s._next}},{name:"endArray",init:function(t,e){for(var s=e.length;s--;)this.add(t,s,t[s]||0,e[s],0,0,0,0,0,1)}},ta("roundProps",Sa),ta("modifiers"),ta("snap",Vh))||co;Ht.version=ie.version=_e.version="3.12.4";wh=1;pc()&&Gn();ft.Power0;ft.Power1;ft.Power2;ft.Power3;ft.Power4;ft.Linear;ft.Quad;ft.Cubic;ft.Quart;ft.Quint;ft.Strong;ft.Elastic;ft.Back;ft.SteppedEase;ft.Bounce;ft.Sine;ft.Expo;ft.Circ;/*! +*/var Te={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Wn={duration:.5,overwrite:!1,delay:0},dc,Jt,Lt,Me=1e8,Ct=1/Me,ya=Math.PI*2,A1=ya/4,M1=0,yh=Math.sqrt,D1=Math.cos,P1=Math.sin,Zt=function(t){return typeof t=="string"},Vt=function(t){return typeof t=="function"},_s=function(t){return typeof t=="number"},fc=function(t){return typeof t>"u"},es=function(t){return typeof t=="object"},he=function(t){return t!==!1},pc=function(){return typeof window<"u"},Ar=function(t){return Vt(t)||Zt(t)},vh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},te=Array.isArray,va=/(?:-?\.?\d|\.)+/gi,kh=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Mn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$o=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,xh=/[+-]=-?[.\d]+/,Th=/[^,'"\[\]\s]+/gi,N1=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,It,Ee,ka,mc,we={},io={},wh,bh=function(t){return(io=hn(t,we))&&_e},_c=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Yi=function(t,e){return!e&&console.warn(t)},Ch=function(t,e){return t&&(we[t]=e)&&io&&(io[t]=e)||we},Gi=function(){return 0},I1={suppressEvents:!0,isStart:!0,kill:!1},Ir={suppressEvents:!0,kill:!1},R1={suppressEvents:!0},gc={},Ms=[],xa={},Sh,ye={},Xo={},Sl=30,Rr=[],yc="",vc=function(t){var e=t[0],s,n;if(es(e)||Vt(e)||(t=[t]),!(s=(e._gsap||{}).harness)){for(n=Rr.length;n--&&!Rr[n].targetTest(e););s=Rr[n]}for(n=t.length;n--;)t[n]&&(t[n]._gsap||(t[n]._gsap=new Zh(t[n],s)))||t.splice(n,1);return t},en=function(t){return t._gsap||vc(De(t))[0]._gsap},Eh=function(t,e,s){return(s=t[e])&&Vt(s)?t[e]():fc(s)&&t.getAttribute&&t.getAttribute(e)||s},de=function(t,e){return(t=t.split(",")).forEach(e)||t},zt=function(t){return Math.round(t*1e5)/1e5||0},$t=function(t){return Math.round(t*1e7)/1e7||0},In=function(t,e){var s=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),s==="+"?t+n:s==="-"?t-n:s==="*"?t*n:t/n},F1=function(t,e){for(var s=e.length,n=0;t.indexOf(e[n])<0&&++na;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[s],t[s]=e),e._next?e._next._prev=e:t[n]=e,e._prev=o,e.parent=e._dp=t,e},Do=function(t,e,s,n){s===void 0&&(s="_first"),n===void 0&&(n="_last");var r=e._prev,o=e._next;r?r._next=o:t[s]===e&&(t[s]=o),o?o._prev=r:t[n]===e&&(t[n]=r),e._next=e._prev=e.parent=null},Ls=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},sn=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var s=t;s;)s._dirty=1,s=s.parent;return t},U1=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Ta=function(t,e,s,n){return t._startAt&&(Jt?t._startAt.revert(Ir):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))},z1=function i(t){return!t||t._ts&&i(t.parent)},Ol=function(t){return t._repeat?Hn(t._tTime,t=t.duration()+t._rDelay)*t:0},Hn=function(t,e){var s=Math.floor(t/=e);return t&&s===t?s-1:s},ao=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Po=function(t){return t._end=$t(t._start+(t._tDur/Math.abs(t._ts||t._rts||Ct)||0))},No=function(t,e){var s=t._dp;return s&&s.smoothChildTiming&&t._ts&&(t._start=$t(s._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Po(t),s._dirty||sn(s,t)),t},Ph=function(t,e){var s;if((e._time||!e._dur&&e._initted||e._startCt)&&e.render(s,!0)),sn(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur=0&&s.totalTime(s._tTime),s=s._dp;t._zTime=-Ct}},Ze=function(t,e,s,n){return e.parent&&Ls(e),e._start=$t((_s(s)?s:s||t!==It?Se(t,s,e):t._time)+e._delay),e._end=$t(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Dh(t,e,"_first","_last",t._sort?"_start":0),wa(e)||(t._recent=e),n||Ph(t,e),t._ts<0&&No(t,t._tTime),t},Nh=function(t,e){return(we.ScrollTrigger||_c("scrollTrigger",e))&&we.ScrollTrigger.create(e,t)},Ih=function(t,e,s,n,r){if(xc(t,e,r),!t._initted)return 1;if(!s&&t._pt&&!Jt&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Sh!==ve.frame)return Ms.push(t),t._lazy=[r,n],1},j1=function i(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||i(e))},wa=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},B1=function(t,e,s,n){var r=t.ratio,o=e<0||!e&&(!t._start&&j1(t)&&!(!t._initted&&wa(t))||(t._ts<0||t._dp._ts<0)&&!wa(t))?0:1,a=t._rDelay,c=0,l,u,h;if(a&&t._repeat&&(c=dr(0,t._tDur,e),u=Hn(c,a),t._yoyo&&u&1&&(o=1-o),u!==Hn(t._tTime,a)&&(r=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==r||Jt||n||t._zTime===Ct||!e&&t._zTime){if(!t._initted&&Ih(t,e,n,s,c))return;for(h=t._zTime,t._zTime=e||(s?Ct:0),s||(s=e&&!h),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=c,l=t._pt;l;)l.r(o,l.d),l=l._next;e<0&&Ta(t,e,s,!0),t._onUpdate&&!s&&ke(t,"onUpdate"),c&&t._repeat&&!s&&t.parent&&ke(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Ls(t,1),!s&&!Jt&&(ke(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},q1=function(t,e,s){var n;if(s>e)for(n=t._first;n&&n._start<=s;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=s;){if(n.data==="isPause"&&n._start0&&!n&&No(t,t._tTime=t._tDur*a),t.parent&&Po(t),s||sn(t.parent,t),t},Al=function(t){return t instanceof ie?sn(t):Yn(t,t._dur)},W1={_start:0,endTime:Gi,totalDuration:Gi},Se=function i(t,e,s){var n=t.labels,r=t._recent||W1,o=t.duration()>=Me?r.endTime(!1):t._dur,a,c,l;return Zt(e)&&(isNaN(e)||e in n)?(c=e.charAt(0),l=e.substr(-1)==="%",a=e.indexOf("="),c==="<"||c===">"?(a>=0&&(e=e.replace(/=/,"")),(c==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(e.substr(1))||0)*(l?(a<0?r:s).totalDuration()/100:1)):a<0?(e in n||(n[e]=o),n[e]):(c=parseFloat(e.charAt(a-1)+e.substr(a+1)),l&&s&&(c=c/100*(te(s)?s[0]:s).totalDuration()),a>1?i(t,e.substr(0,a-1),s)+c:o+c)):e==null?o:+e},Ci=function(t,e,s){var n=_s(e[1]),r=(n?2:1)+(t<2?0:1),o=e[r],a,c;if(n&&(o.duration=e[1]),o.parent=s,t){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=he(c.vars.inherit)&&c.parent;o.immediateRender=he(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[r-1]}return new Ht(e[0],o,e[r+1])},Bs=function(t,e){return t||t===0?e(t):e},dr=function(t,e,s){return se?e:s},Kt=function(t,e){return!Zt(t)||!(e=N1.exec(t))?"":e[1]},H1=function(t,e,s){return Bs(s,function(n){return dr(t,e,n)})},ba=[].slice,Rh=function(t,e){return t&&es(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&es(t[0]))&&!t.nodeType&&t!==Ee},Y1=function(t,e,s){return s===void 0&&(s=[]),t.forEach(function(n){var r;return Zt(n)&&!e||Rh(n,1)?(r=s).push.apply(r,De(n)):s.push(n)})||s},De=function(t,e,s){return Lt&&!e&&Lt.selector?Lt.selector(t):Zt(t)&&!s&&(ka||!Gn())?ba.call((e||mc).querySelectorAll(t),0):te(t)?Y1(t,s):Rh(t)?ba.call(t,0):t?[t]:[]},Ca=function(t){return t=De(t)[0]||Yi("Invalid scope")||{},function(e){var s=t.current||t.nativeElement||t;return De(e,s.querySelectorAll?s:s===t?Yi("Invalid scope")||mc.createElement("div"):t)}},Fh=function(t){return t.sort(function(){return .5-Math.random()})},Lh=function(t){if(Vt(t))return t;var e=es(t)?t:{each:t},s=nn(e.ease),n=e.from||0,r=parseFloat(e.base)||0,o={},a=n>0&&n<1,c=isNaN(n)||a,l=e.axis,u=n,h=n;return Zt(n)?u=h={center:.5,edges:.5,end:1}[n]||0:!a&&c&&(u=n[0],h=n[1]),function(d,p,m){var f=(m||e).length,_=o[f],y,w,b,v,g,x,T,k,C;if(!_){if(C=e.grid==="auto"?0:(e.grid||[1,Me])[1],!C){for(T=-Me;T<(T=m[C++].getBoundingClientRect().left)&&CT&&(T=g),gf?f-1:l?l==="y"?f/C:C:Math.max(C,f/C))||0)*(n==="edges"?-1:1),_.b=f<0?r-f:r,_.u=Kt(e.amount||e.each)||0,s=s&&f<0?Gh(s):s}return f=(_[d]-_.min)/_.max||0,$t(_.b+(s?s(f):f)*_.v)+_.u}},Sa=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(s){var n=$t(Math.round(parseFloat(s)/t)*t*e);return(n-n%1)/e+(_s(s)?0:Kt(s))}},Vh=function(t,e){var s=te(t),n,r;return!s&&es(t)&&(n=s=t.radius||Me,t.values?(t=De(t.values),(r=!_s(t[0]))&&(n*=n)):t=Sa(t.increment)),Bs(e,s?Vt(t)?function(o){return r=t(o),Math.abs(r-o)<=n?r:o}:function(o){for(var a=parseFloat(r?o.x:o),c=parseFloat(r?o.y:0),l=Me,u=0,h=t.length,d,p;h--;)r?(d=t[h].x-a,p=t[h].y-c,d=d*d+p*p):d=Math.abs(t[h]-a),dn?r-o:o)})},$i=function(t){for(var e=0,s="",n,r,o,a;~(n=t.indexOf("random(",e));)o=t.indexOf(")",n),a=t.charAt(n+7)==="[",r=t.substr(n+7,o-n-7).match(a?Th:va),s+=t.substr(e,n-e)+Uh(a?r:+r[0],a?0:+r[1],+r[2]||1e-5),e=o+1;return s+t.substr(e,t.length-e)},jh=function(t,e,s,n,r){var o=e-t,a=n-s;return Bs(r,function(c){return s+((c-t)/o*a||0)})},K1=function i(t,e,s,n){var r=isNaN(t+e)?0:function(p){return(1-p)*t+p*e};if(!r){var o=Zt(t),a={},c,l,u,h,d;if(s===!0&&(n=1)&&(s=null),o)t={p:t},e={p:e};else if(te(t)&&!te(e)){for(u=[],h=t.length,d=h-2,l=1;l(a=Math.abs(a))&&(c=o,r=a);return c},ke=function(t,e,s){var n=t.vars,r=n[e],o=Lt,a=t._ctx,c,l,u;if(r)return c=n[e+"Params"],l=n.callbackScope||t,s&&Ms.length&&ro(),a&&(Lt=a),u=c?r.apply(l,c):r.call(l),Lt=o,u},vi=function(t){return Ls(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Jt),t.progress()<1&&ke(t,"onInterrupt"),t},Dn,Bh=[],qh=function(t){if(pc()&&t){t=!t.name&&t.default||t;var e=t.name,s=Vt(t),n=e&&!s&&t.init?function(){this._props=[]}:t,r={init:Gi,render:bc,add:kc,kill:pv,modifier:fv,rawVars:0},o={targetTest:0,get:0,getSetter:wc,aliases:{},register:0};if(Gn(),t!==n){if(ye[e])return;Ne(n,Ne(oo(t,r),o)),hn(n.prototype,hn(r,oo(t,o))),ye[n.prop=e]=n,t.targetTest&&(Rr.push(n),gc[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Ch(e,n),t.register&&t.register(_e,n,fe)}else t&&Bh.push(t)},bt=255,ki={aqua:[0,bt,bt],lime:[0,bt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,bt],navy:[0,0,128],white:[bt,bt,bt],olive:[128,128,0],yellow:[bt,bt,0],orange:[bt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[bt,0,0],pink:[bt,192,203],cyan:[0,bt,bt],transparent:[bt,bt,bt,0]},Zo=function(t,e,s){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(s-e)*t*6:t<.5?s:t*3<2?e+(s-e)*(2/3-t)*6:e)*bt+.5|0},Wh=function(t,e,s){var n=t?_s(t)?[t>>16,t>>8&bt,t&bt]:0:ki.black,r,o,a,c,l,u,h,d,p,m;if(!n){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ki[t])n=ki[t];else if(t.charAt(0)==="#"){if(t.length<6&&(r=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+r+r+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return n=parseInt(t.substr(1,6),16),[n>>16,n>>8&bt,n&bt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),n=[t>>16,t>>8&bt,t&bt]}else if(t.substr(0,3)==="hsl"){if(n=m=t.match(va),!e)c=+n[0]%360/360,l=+n[1]/100,u=+n[2]/100,o=u<=.5?u*(l+1):u+l-u*l,r=u*2-o,n.length>3&&(n[3]*=1),n[0]=Zo(c+1/3,r,o),n[1]=Zo(c,r,o),n[2]=Zo(c-1/3,r,o);else if(~t.indexOf("="))return n=t.match(kh),s&&n.length<4&&(n[3]=1),n}else n=t.match(va)||ki.transparent;n=n.map(Number)}return e&&!m&&(r=n[0]/bt,o=n[1]/bt,a=n[2]/bt,h=Math.max(r,o,a),d=Math.min(r,o,a),u=(h+d)/2,h===d?c=l=0:(p=h-d,l=u>.5?p/(2-h-d):p/(h+d),c=h===r?(o-a)/p+(ot&&(s+=y-e),n+=y,g=n-s,b=g-o,(b>0||w)&&(x=++h.frame,d=g-h.time*1e3,h.time=g=g/1e3,o+=b+(b>=r?4:r-b),v=1),w||(c=l(f)),v)for(p=0;p=y&&p--},_listeners:a},h}(),Gn=function(){return!Xi&&ve.wake()},ft={},tv=/^[\d.\-M][\d.\-,\s]/,ev=/["']/g,sv=function(t){for(var e={},s=t.substr(1,t.length-3).split(":"),n=s[0],r=1,o=s.length,a,c,l;r1&&s.config?s.config.apply(null,~t.indexOf("{")?[sv(e[1])]:nv(t).split(",").map(Ah)):ft._CE&&tv.test(t)?ft._CE("",t):s},Gh=function(t){return function(e){return 1-t(1-e)}},$h=function i(t,e){for(var s=t._first,n;s;)s instanceof ie?i(s,e):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==e&&(s.timeline?i(s.timeline,e):(n=s._ease,s._ease=s._yEase,s._yEase=n,s._yoyo=e)),s=s._next},nn=function(t,e){return t&&(Vt(t)?t:ft[t]||iv(t))||e},_n=function(t,e,s,n){s===void 0&&(s=function(c){return 1-e(1-c)}),n===void 0&&(n=function(c){return c<.5?e(c*2)/2:1-e((1-c)*2)/2});var r={easeIn:e,easeOut:s,easeInOut:n},o;return de(t,function(a){ft[a]=we[a]=r,ft[o=a.toLowerCase()]=s;for(var c in r)ft[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ft[a+"."+c]=r[c]}),r},Xh=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Qo=function i(t,e,s){var n=e>=1?e:1,r=(s||(t?.3:.45))/(e<1?e:1),o=r/ya*(Math.asin(1/n)||0),a=function(u){return u===1?1:n*Math.pow(2,-10*u)*P1((u-o)*r)+1},c=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:Xh(a);return r=ya/r,c.config=function(l,u){return i(t,l,u)},c},Ko=function i(t,e){e===void 0&&(e=1.70158);var s=function(o){return o?--o*o*((e+1)*o+e)+1:0},n=t==="out"?s:t==="in"?function(r){return 1-s(1-r)}:Xh(s);return n.config=function(r){return i(t,r)},n};de("Linear,Quad,Cubic,Quart,Quint,Strong",function(i,t){var e=t<5?t+1:t;_n(i+",Power"+(e-1),t?function(s){return Math.pow(s,e)}:function(s){return s},function(s){return 1-Math.pow(1-s,e)},function(s){return s<.5?Math.pow(s*2,e)/2:1-Math.pow((1-s)*2,e)/2})});ft.Linear.easeNone=ft.none=ft.Linear.easeIn;_n("Elastic",Qo("in"),Qo("out"),Qo());(function(i,t){var e=1/t,s=2*e,n=2.5*e,r=function(a){return a0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},t.totalDuration=function(s){return arguments.length?(this._dirty=0,Yn(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(s,n){if(Gn(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(No(this,s),!r._dp||r.parent||Ph(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s0||!this._tDur&&!s)&&Ze(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Ct||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Oh(this,s,n)),this},t.time=function(s,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+Ol(this))%(this._dur+this._rDelay)||(s?this._dur:0),n):this._time},t.totalProgress=function(s,n){return arguments.length?this.totalTime(this.totalDuration()*s,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(s,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+Ol(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(s,n){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*r,n):this._repeat?Hn(this._tTime,r)+1:1},t.timeScale=function(s,n){if(!arguments.length)return this._rts===-Ct?0:this._rts;if(this._rts===s)return this;var r=this.parent&&this._ts?ao(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-Ct?0:this._rts,this.totalTime(dr(-Math.abs(this._delay),this._tDur,r),n!==!1),Po(this),U1(this)},t.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Gn(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ct&&(this._tTime-=Ct)))),this):this._ps},t.startTime=function(s){if(arguments.length){this._start=s;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&Ze(n,this,s-this._delay),this}return this._start},t.endTime=function(s){return this._start+(he(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(s){var n=this.parent||this._dp;return n?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ao(n.rawTime(s),this):this._tTime:this._tTime},t.revert=function(s){s===void 0&&(s=R1);var n=Jt;return Jt=s,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),Jt=n,this},t.globalTime=function(s){for(var n=this,r=arguments.length?s:n.rawTime();n;)r=n._start+r/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(s):r},t.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Al(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(s){if(arguments.length){var n=this._time;return this._rDelay=s,Al(this),n?this.time(n):this}return this._rDelay},t.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},t.seek=function(s,n){return this.totalTime(Se(this,s),he(n))},t.restart=function(s,n){return this.play().totalTime(s?-this._delay:0,he(n))},t.play=function(s,n){return s!=null&&this.seek(s,n),this.reversed(!1).paused(!1)},t.reverse=function(s,n){return s!=null&&this.seek(s||this.totalDuration(),n),this.reversed(!0).paused(!1)},t.pause=function(s,n){return s!=null&&this.seek(s,n),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-Ct:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ct,this},t.isActive=function(){var s=this.parent||this._dp,n=this._start,r;return!!(!s||this._ts&&this._initted&&s.isActive()&&(r=s.rawTime(!0))>=n&&r1?(n?(o[s]=n,r&&(o[s+"Params"]=r),s==="onUpdate"&&(this._onUpdate=n)):delete o[s],this):o[s]},t.then=function(s){var n=this;return new Promise(function(r){var o=Vt(s)?s:Mh,a=function(){var l=n.then;n.then=null,Vt(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=l),r(o),n.then=l};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?a():n._prom=a})},t.kill=function(){vi(this)},i}();Ne(Zi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Ct,_prom:0,_ps:!1,_rts:1});var ie=function(i){gh(t,i);function t(s,n){var r;return s===void 0&&(s={}),r=i.call(this,s)||this,r.labels={},r.smoothChildTiming=!!s.smoothChildTiming,r.autoRemoveChildren=!!s.autoRemoveChildren,r._sort=he(s.sortChildren),It&&Ze(s.parent||It,us(r),n),s.reversed&&r.reverse(),s.paused&&r.paused(!0),s.scrollTrigger&&Nh(us(r),s.scrollTrigger),r}var e=t.prototype;return e.to=function(n,r,o){return Ci(0,arguments,this),this},e.from=function(n,r,o){return Ci(1,arguments,this),this},e.fromTo=function(n,r,o,a){return Ci(2,arguments,this),this},e.set=function(n,r,o){return r.duration=0,r.parent=this,bi(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new Ht(n,r,Se(this,o),1),this},e.call=function(n,r,o){return Ze(this,Ht.delayedCall(0,n,r),o)},e.staggerTo=function(n,r,o,a,c,l,u){return o.duration=r,o.stagger=o.stagger||a,o.onComplete=l,o.onCompleteParams=u,o.parent=this,new Ht(n,o,Se(this,c)),this},e.staggerFrom=function(n,r,o,a,c,l,u){return o.runBackwards=1,bi(o).immediateRender=he(o.immediateRender),this.staggerTo(n,r,o,a,c,l,u)},e.staggerFromTo=function(n,r,o,a,c,l,u,h){return a.startAt=o,bi(a).immediateRender=he(a.immediateRender),this.staggerTo(n,r,a,c,l,u,h)},e.render=function(n,r,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,l=this._dur,u=n<=0?0:$t(n),h=this._zTime<0!=n<0&&(this._initted||!l),d,p,m,f,_,y,w,b,v,g,x,T;if(this!==It&&u>c&&n>=0&&(u=c),u!==this._tTime||o||h){if(a!==this._time&&l&&(u+=this._time-a,n+=this._time-a),d=u,v=this._start,b=this._ts,y=!b,h&&(l||(a=this._zTime),(n||!r)&&(this._zTime=n)),this._repeat){if(x=this._yoyo,_=l+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(_*100+n,r,o);if(d=$t(u%_),u===c?(f=this._repeat,d=l):(f=~~(u/_),f&&f===u/_&&(d=l,f--),d>l&&(d=l)),g=Hn(this._tTime,_),!a&&this._tTime&&g!==f&&this._tTime-g*_-this._dur<=0&&(g=f),x&&f&1&&(d=l-d,T=1),f!==g&&!this._lock){var k=x&&g&1,C=k===(x&&f&1);if(f=a&&n>=0)for(p=this._first;p;){if(m=p._next,(p._act||d>=p._start)&&p._ts&&w!==p){if(p.parent!==this)return this.render(n,r,o);if(p.render(p._ts>0?(d-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(d-p._start)*p._ts,r,o),d!==this._time||!this._ts&&!y){w=0,m&&(u+=this._zTime=-Ct);break}}p=m}else{p=this._last;for(var M=n<0?n:d;p;){if(m=p._prev,(p._act||M<=p._end)&&p._ts&&w!==p){if(p.parent!==this)return this.render(n,r,o);if(p.render(p._ts>0?(M-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(M-p._start)*p._ts,r,o||Jt&&(p._initted||p._startAt)),d!==this._time||!this._ts&&!y){w=0,m&&(u+=this._zTime=M?-Ct:Ct);break}}p=m}}if(w&&!r&&(this.pause(),w.render(d>=a?0:-Ct)._zTime=d>=a?1:-1,this._ts))return this._start=v,Po(this),this.render(n,r,o);this._onUpdate&&!r&&ke(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&a)&&(v===this._start||Math.abs(b)!==Math.abs(this._ts))&&(this._lock||((n||!l)&&(u===c&&this._ts>0||!u&&this._ts<0)&&Ls(this,1),!r&&!(n<0&&!a)&&(u||a||!c)&&(ke(this,u===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u0)&&this._prom())))}return this},e.add=function(n,r){var o=this;if(_s(r)||(r=Se(this,r,n)),!(n instanceof Zi)){if(te(n))return n.forEach(function(a){return o.add(a,r)}),this;if(Zt(n))return this.addLabel(n,r);if(Vt(n))n=Ht.delayedCall(0,n);else return this}return this!==n?Ze(this,n,r):this},e.getChildren=function(n,r,o,a){n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),a===void 0&&(a=-Me);for(var c=[],l=this._first;l;)l._start>=a&&(l instanceof Ht?r&&c.push(l):(o&&c.push(l),n&&c.push.apply(c,l.getChildren(!0,r,o)))),l=l._next;return c},e.getById=function(n){for(var r=this.getChildren(1,1,1),o=r.length;o--;)if(r[o].vars.id===n)return r[o]},e.remove=function(n){return Zt(n)?this.removeLabel(n):Vt(n)?this.killTweensOf(n):(Do(this,n),n===this._recent&&(this._recent=this._last),sn(this))},e.totalTime=function(n,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=$t(ve.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),i.prototype.totalTime.call(this,n,r),this._forcing=0,this):this._tTime},e.addLabel=function(n,r){return this.labels[n]=Se(this,r),this},e.removeLabel=function(n){return delete this.labels[n],this},e.addPause=function(n,r,o){var a=Ht.delayedCall(0,r||Gi,o);return a.data="isPause",this._hasPause=1,Ze(this,a,Se(this,n))},e.removePause=function(n){var r=this._first;for(n=Se(this,n);r;)r._start===n&&r.data==="isPause"&&Ls(r),r=r._next},e.killTweensOf=function(n,r,o){for(var a=this.getTweensOf(n,o),c=a.length;c--;)Cs!==a[c]&&a[c].kill(n,r);return this},e.getTweensOf=function(n,r){for(var o=[],a=De(n),c=this._first,l=_s(r),u;c;)c instanceof Ht?F1(c._targets,a)&&(l?(!Cs||c._initted&&c._ts)&&c.globalTime(0)<=r&&c.globalTime(c.totalDuration())>r:!r||c.isActive())&&o.push(c):(u=c.getTweensOf(a,r)).length&&o.push.apply(o,u),c=c._next;return o},e.tweenTo=function(n,r){r=r||{};var o=this,a=Se(o,n),c=r,l=c.startAt,u=c.onStart,h=c.onStartParams,d=c.immediateRender,p,m=Ht.to(o,Ne({ease:r.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale())||Ct,onStart:function(){if(o.pause(),!p){var _=r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());m._dur!==_&&Yn(m,_,0,1).render(m._time,!0,!0),p=1}u&&u.apply(m,h||[])}},r));return d?m.render(0):m},e.tweenFromTo=function(n,r,o){return this.tweenTo(r,Ne({startAt:{time:Se(this,n)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(n){return n===void 0&&(n=this._time),Ml(this,Se(this,n))},e.previousLabel=function(n){return n===void 0&&(n=this._time),Ml(this,Se(this,n),1)},e.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Ct)},e.shiftChildren=function(n,r,o){o===void 0&&(o=0);for(var a=this._first,c=this.labels,l;a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(r)for(l in c)c[l]>=o&&(c[l]+=n);return sn(this)},e.invalidate=function(n){var r=this._first;for(this._lock=0;r;)r.invalidate(n),r=r._next;return i.prototype.invalidate.call(this,n)},e.clear=function(n){n===void 0&&(n=!0);for(var r=this._first,o;r;)o=r._next,this.remove(r),r=o;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),sn(this)},e.totalDuration=function(n){var r=0,o=this,a=o._last,c=Me,l,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-n:n));if(o._dirty){for(h=o.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>c&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ze(o,a,u-a._delay,1)._lock=0):c=u,u<0&&a._ts&&(r-=u,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),c=0),a._end>r&&a._ts&&(r=a._end),a=l;Yn(o,o===It&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(n){if(It._ts&&(Oh(It,ao(n,It)),Sh=ve.frame),ve.frame>=Sl){Sl+=Te.autoSleep||120;var r=It._first;if((!r||!r._ts)&&Te.autoSleep&&ve._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||ve.sleep()}}},t}(Zi);Ne(ie.prototype,{_lock:0,_hasPause:0,_forcing:0});var rv=function(t,e,s,n,r,o,a){var c=new fe(this._pt,t,e,0,1,sd,null,r),l=0,u=0,h,d,p,m,f,_,y,w;for(c.b=s,c.e=n,s+="",n+="",(y=~n.indexOf("random("))&&(n=$i(n)),o&&(w=[s,n],o(w,t,e),s=w[0],n=w[1]),d=s.match($o)||[];h=$o.exec(n);)m=h[0],f=n.substring(l,h.index),p?p=(p+1)%5:f.substr(-5)==="rgba("&&(p=1),m!==d[u++]&&(_=parseFloat(d[u-1])||0,c._pt={_next:c._pt,p:f||u===1?f:",",s:_,c:m.charAt(1)==="="?In(_,m)-_:parseFloat(m)-_,m:p&&p<4?Math.round:0},l=$o.lastIndex);return c.c=l")}),v.duration();else{x={};for(k in m)k==="ease"||k==="easeEach"||lv(k,m[k],x,m.easeEach);for(k in x)for(U=x[k].sort(function(Y,j){return Y.t-j.t}),P=0,g=0;gc-Ct&&!u?c:nl&&(d=l)),y=this._yoyo&&m&1,y&&(v=this._yEase,d=l-d),_=Hn(this._tTime,f),d===a&&!o&&this._initted&&m===_)return this._tTime=h,this;m!==_&&(b&&this._yEase&&$h(b,y),this.vars.repeatRefresh&&!y&&!this._lock&&this._time!==l&&this._initted&&(this._lock=o=1,this.render($t(f*m),!0).invalidate()._lock=0))}if(!this._initted){if(Ih(this,u?n:d,o,r,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&m!==_))return this;if(l!==this._dur)return this.render(n,r,o)}if(this._tTime=h,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=w=(v||this._ease)(d/l),this._from&&(this.ratio=w=1-w),d&&!a&&!r&&!m&&(ke(this,"onStart"),this._tTime!==h))return this;for(p=this._pt;p;)p.r(w,p.d),p=p._next;b&&b.render(n<0?n:!d&&y?-Ct:b._dur*b._ease(d/this._dur),r,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!r&&(u&&Ta(this,n,r,o),ke(this,"onUpdate")),this._repeat&&m!==_&&this.vars.onRepeat&&!r&&this.parent&&ke(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&Ta(this,n,!0,!0),(n||!l)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Ls(this,1),!r&&!(u&&!a)&&(h||a||y)&&(ke(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),i.prototype.invalidate.call(this,n)},e.resetTo=function(n,r,o,a,c){Xi||ve.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||xc(this,l),u=this._ease(l/this._dur),av(this,n,r,o,a,u,l,c)?this.resetTo(n,r,o,a,1):(No(this,0),this.parent||Dh(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(n,r){if(r===void 0&&(r="all"),!n&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?vi(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,r,Cs&&Cs.vars.overwrite!==!0)._first||vi(this),this.parent&&o!==this.timeline.totalDuration()&&Yn(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=n?De(n):a,l=this._ptLookup,u=this._pt,h,d,p,m,f,_,y;if((!r||r==="all")&&V1(a,c))return r==="all"&&(this._pt=0),vi(this);for(h=this._op=this._op||[],r!=="all"&&(Zt(r)&&(f={},de(r,function(w){return f[w]=1}),r=f),r=cv(a,r)),y=a.length;y--;)if(~c.indexOf(a[y])){d=l[y],r==="all"?(h[y]=r,m=d,p={}):(p=h[y]=h[y]||{},m=r);for(f in m)_=d&&d[f],_&&((!("kill"in _.d)||_.d.kill(f)===!0)&&Do(this,_,"_pt"),delete d[f]),p!=="all"&&(p[f]=1)}return this._initted&&!this._pt&&u&&vi(this),this},t.to=function(n,r){return new t(n,r,arguments[2])},t.from=function(n,r){return Ci(1,arguments)},t.delayedCall=function(n,r,o,a){return new t(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:r,onReverseComplete:r,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(n,r,o){return Ci(2,arguments)},t.set=function(n,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new t(n,r)},t.killTweensOf=function(n,r,o){return It.killTweensOf(n,r,o)},t}(Zi);Ne(Ht.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});de("staggerTo,staggerFrom,staggerFromTo",function(i){Ht[i]=function(){var t=new ie,e=ba.call(arguments,0);return e.splice(i==="staggerFromTo"?5:4,0,0),t[i].apply(t,e)}});var Tc=function(t,e,s){return t[e]=s},td=function(t,e,s){return t[e](s)},uv=function(t,e,s,n){return t[e](n.fp,s)},hv=function(t,e,s){return t.setAttribute(e,s)},wc=function(t,e){return Vt(t[e])?td:fc(t[e])&&t.setAttribute?hv:Tc},ed=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},dv=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},sd=function(t,e){var s=e._pt,n="";if(!t&&e.b)n=e.b;else if(t===1&&e.e)n=e.e;else{for(;s;)n=s.p+(s.m?s.m(s.s+s.c*t):Math.round((s.s+s.c*t)*1e4)/1e4)+n,s=s._next;n+=e.c}e.set(e.t,e.p,n,e)},bc=function(t,e){for(var s=e._pt;s;)s.r(t,s.d),s=s._next},fv=function(t,e,s,n){for(var r=this._pt,o;r;)o=r._next,r.p===n&&r.modifier(t,e,s),r=o},pv=function(t){for(var e=this._pt,s,n;e;)n=e._next,e.p===t&&!e.op||e.op===t?Do(this,e,"_pt"):e.dep||(s=1),e=n;return!s},mv=function(t,e,s,n){n.mSet(t,e,n.m.call(n.tween,s,n.mt),n)},nd=function(t){for(var e=t._pt,s,n,r,o;e;){for(s=e._next,n=r;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:o)?e._prev._next=e:r=e,(e._next=n)?n._prev=e:o=e,e=s}t._pt=r},fe=function(){function i(e,s,n,r,o,a,c,l,u){this.t=s,this.s=r,this.c=o,this.p=n,this.r=a||ed,this.d=c||this,this.set=l||Tc,this.pr=u||0,this._next=e,e&&(e._prev=this)}var t=i.prototype;return t.modifier=function(s,n,r){this.mSet=this.mSet||this.set,this.set=mv,this.m=s,this.mt=r,this.tween=n},i}();de(yc+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(i){return gc[i]=1});we.TweenMax=we.TweenLite=Ht;we.TimelineLite=we.TimelineMax=ie;It=new ie({sortChildren:!1,defaults:Wn,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Te.stringFilter=Yh;var rn=[],Fr={},_v=[],Pl=0,gv=0,Jo=function(t){return(Fr[t]||_v).map(function(e){return e()})},Oa=function(){var t=Date.now(),e=[];t-Pl>2&&(Jo("matchMediaInit"),rn.forEach(function(s){var n=s.queries,r=s.conditions,o,a,c,l;for(a in n)o=Ee.matchMedia(n[a]).matches,o&&(c=1),o!==r[a]&&(r[a]=o,l=1);l&&(s.revert(),c&&e.push(s))}),Jo("matchMediaRevert"),e.forEach(function(s){return s.onMatch(s,function(n){return s.add(null,n)})}),Pl=t,Jo("matchMedia"))},id=function(){function i(e,s){this.selector=s&&Ca(s),this.data=[],this._r=[],this.isReverted=!1,this.id=gv++,e&&this.add(e)}var t=i.prototype;return t.add=function(s,n,r){Vt(s)&&(r=n,n=s,s=Vt);var o=this,a=function(){var l=Lt,u=o.selector,h;return l&&l!==o&&l.data.push(o),r&&(o.selector=Ca(r)),Lt=o,h=n.apply(o,arguments),Vt(h)&&o._r.push(h),Lt=l,o.selector=u,o.isReverted=!1,h};return o.last=a,s===Vt?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},t.ignore=function(s){var n=Lt;Lt=null,s(this),Lt=n},t.getTweens=function(){var s=[];return this.data.forEach(function(n){return n instanceof i?s.push.apply(s,n.getTweens()):n instanceof Ht&&!(n.parent&&n.parent.data==="nested")&&s.push(n)}),s},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(s,n){var r=this;if(s?function(){for(var a=r.getTweens(),c=r.data.length,l;c--;)l=r.data[c],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,h){return h.g-u.g||-1/0}).forEach(function(u){return u.t.revert(s)}),c=r.data.length;c--;)l=r.data[c],l instanceof ie?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ht)&&l.revert&&l.revert(s);r._r.forEach(function(u){return u(s,r)}),r.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),n)for(var o=rn.length;o--;)rn[o].id===this.id&&rn.splice(o,1)},t.revert=function(s){this.kill(s||{})},i}(),yv=function(){function i(e){this.contexts=[],this.scope=e}var t=i.prototype;return t.add=function(s,n,r){es(s)||(s={matches:s});var o=new id(0,r||this.scope),a=o.conditions={},c,l,u;Lt&&!o.selector&&(o.selector=Lt.selector),this.contexts.push(o),n=o.add("onMatch",n),o.queries=s;for(l in s)l==="all"?u=1:(c=Ee.matchMedia(s[l]),c&&(rn.indexOf(o)<0&&rn.push(o),(a[l]=c.matches)&&(u=1),c.addListener?c.addListener(Oa):c.addEventListener("change",Oa)));return u&&n(o,function(h){return o.add(null,h)}),this},t.revert=function(s){this.kill(s||{})},t.kill=function(s){this.contexts.forEach(function(n){return n.kill(s,!0)})},i}(),co={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),s=0;s1){var n=t.map(function(u){return _e.quickSetter(u,e,s)}),r=n.length;return function(u){for(var h=r;h--;)n[h](u)}}t=t[0]||{};var o=ye[e],a=en(t),c=a.harness&&(a.harness.aliases||{})[e]||e,l=o?function(u){var h=new o;Dn._pt=0,h.init(t,s?u+s:u,Dn,0,[t]),h.render(1,h),Dn._pt&&bc(1,Dn)}:a.set(t,c);return o?l:function(u){return l(t,c,s?u+s:u,a,1)}},quickTo:function(t,e,s){var n,r=_e.to(t,hn((n={},n[e]="+=0.1",n.paused=!0,n),s||{})),o=function(c,l,u){return r.resetTo(e,c,l,u)};return o.tween=r,o},isTweening:function(t){return It.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=nn(t.ease,Wn.ease)),El(Wn,t||{})},config:function(t){return El(Te,t||{})},registerEffect:function(t){var e=t.name,s=t.effect,n=t.plugins,r=t.defaults,o=t.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!ye[a]&&!we[a]&&Yi(e+" effect requires "+a+" plugin.")}),Xo[e]=function(a,c,l){return s(De(a),Ne(c||{},r),l)},o&&(ie.prototype[e]=function(a,c,l){return this.add(Xo[e](a,es(c)?c:(l=c)&&{},this),l)})},registerEase:function(t,e){ft[t]=nn(e)},parseEase:function(t,e){return arguments.length?nn(t,e):ft},getById:function(t){return It.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var s=new ie(t),n,r;for(s.smoothChildTiming=he(t.smoothChildTiming),It.remove(s),s._dp=0,s._time=s._tTime=It._time,n=It._first;n;)r=n._next,(e||!(!n._dur&&n instanceof Ht&&n.vars.onComplete===n._targets[0]))&&Ze(s,n,n._start-n._delay),n=r;return Ze(It,s,0),s},context:function(t,e){return t?new id(t,e):Lt},matchMedia:function(t){return new yv(t)},matchMediaRefresh:function(){return rn.forEach(function(t){var e=t.conditions,s,n;for(n in e)e[n]&&(e[n]=!1,s=1);s&&t.revert()})||Oa()},addEventListener:function(t,e){var s=Fr[t]||(Fr[t]=[]);~s.indexOf(e)||s.push(e)},removeEventListener:function(t,e){var s=Fr[t],n=s&&s.indexOf(e);n>=0&&s.splice(n,1)},utils:{wrap:Z1,wrapYoyo:Q1,distribute:Lh,random:Uh,snap:Vh,normalize:X1,getUnit:Kt,clamp:H1,splitColor:Wh,toArray:De,selector:Ca,mapRange:jh,pipe:G1,unitize:$1,interpolate:K1,shuffle:Fh},install:bh,effects:Xo,ticker:ve,updateRoot:ie.updateRoot,plugins:ye,globalTimeline:It,core:{PropTween:fe,globals:Ch,Tween:Ht,Timeline:ie,Animation:Zi,getCache:en,_removeLinkedListItem:Do,reverting:function(){return Jt},context:function(t){return t&&Lt&&(Lt.data.push(t),t._ctx=Lt),Lt},suppressOverwrites:function(t){return dc=t}}};de("to,from,fromTo,delayedCall,set,killTweensOf",function(i){return co[i]=Ht[i]});ve.add(ie.updateRoot);Dn=co.to({},{duration:0});var vv=function(t,e){for(var s=t._pt;s&&s.p!==e&&s.op!==e&&s.fp!==e;)s=s._next;return s},kv=function(t,e){var s=t._targets,n,r,o;for(n in e)for(r=s.length;r--;)o=t._ptLookup[r][n],o&&(o=o.d)&&(o._pt&&(o=vv(o,n)),o&&o.modifier&&o.modifier(e[n],t,s[r],n))},ta=function(t,e){return{name:t,rawVars:1,init:function(n,r,o){o._onInit=function(a){var c,l;if(Zt(r)&&(c={},de(r,function(u){return c[u]=1}),r=c),e){c={};for(l in r)c[l]=e(r[l]);r=c}kv(a,r)}}}},_e=co.registerPlugin({name:"attr",init:function(t,e,s,n,r){var o,a,c;this.tween=s;for(o in e)c=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(c||0)+"",e[o],n,r,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(t,e){for(var s=e._pt;s;)Jt?s.set(s.t,s.p,s.b,s):s.r(t,s.d),s=s._next}},{name:"endArray",init:function(t,e){for(var s=e.length;s--;)this.add(t,s,t[s]||0,e[s],0,0,0,0,0,1)}},ta("roundProps",Sa),ta("modifiers"),ta("snap",Vh))||co;Ht.version=ie.version=_e.version="3.12.4";wh=1;pc()&&Gn();ft.Power0;ft.Power1;ft.Power2;ft.Power3;ft.Power4;ft.Linear;ft.Quad;ft.Cubic;ft.Quart;ft.Quint;ft.Strong;ft.Elastic;ft.Back;ft.SteppedEase;ft.Bounce;ft.Sine;ft.Expo;ft.Circ;/*! * CSSPlugin 3.12.4 * https://gsap.com * @@ -356,7 +356,7 @@ import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y a * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com -*/var Nl,Ss,Rn,Cc,Qs,Il,Sc,xv=function(){return typeof window<"u"},gs={},$s=180/Math.PI,Fn=Math.PI/180,Cn=Math.atan2,Rl=1e8,Ec=/([A-Z])/g,Tv=/(left|right|width|margin|padding|x)/i,wv=/[\s,\(]\S/,Qe={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Aa=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},bv=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},Cv=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},Sv=function(t,e){var s=e.s+e.c*t;e.set(e.t,e.p,~~(s+(s<0?-.5:.5))+e.u,e)},rd=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},od=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},Ev=function(t,e,s){return t.style[e]=s},Ov=function(t,e,s){return t.style.setProperty(e,s)},Av=function(t,e,s){return t._gsap[e]=s},Mv=function(t,e,s){return t._gsap.scaleX=t._gsap.scaleY=s},Dv=function(t,e,s,n,r){var o=t._gsap;o.scaleX=o.scaleY=s,o.renderTransform(r,o)},Pv=function(t,e,s,n,r){var o=t._gsap;o[e]=s,o.renderTransform(r,o)},Rt="transform",pe=Rt+"Origin",Nv=function i(t,e){var s=this,n=this.target,r=n.style,o=n._gsap;if(t in gs&&r){if(this.tfm=this.tfm||{},t!=="transform")t=Qe[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return s.tfm[a]=hs(n,a)}):this.tfm[t]=o.x?o[t]:hs(n,t),t===pe&&(this.tfm.zOrigin=o.zOrigin);else return Qe.transform.split(",").forEach(function(a){return i.call(s,a,e)});if(this.props.indexOf(Rt)>=0)return;o.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(pe,e,"")),t=Rt}(r||e)&&this.props.push(t,e,r[t])},ad=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},Iv=function(){var t=this.props,e=this.target,s=e.style,n=e._gsap,r,o;for(r=0;r=0?Fl[o]:"")+t},Da=function(){xv()&&window.document&&(Nl=window,Ss=Nl.document,Rn=Ss.documentElement,Qs=Ma("div")||{style:{}},Ma("div"),Rt=$n(Rt),pe=Rt+"Origin",Qs.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",ld=!!$n("perspective"),Sc=_e.core.reverting,Cc=1)},ea=function i(t){var e=Ma("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=this.parentNode,n=this.nextSibling,r=this.style.cssText,o;if(Rn.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=i}catch{}else this._gsapBBox&&(o=this._gsapBBox());return s&&(n?s.insertBefore(this,n):s.appendChild(this)),Rn.removeChild(e),this.style.cssText=r,o},Ll=function(t,e){for(var s=e.length;s--;)if(t.hasAttribute(e[s]))return t.getAttribute(e[s])},ud=function(t){var e;try{e=t.getBBox()}catch{e=ea.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===ea||(e=ea.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Ll(t,["x","cx","x1"])||0,y:+Ll(t,["y","cy","y1"])||0,width:0,height:0}:e},hd=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ud(t))},dn=function(t,e){if(e){var s=t.style,n;e in gs&&e!==pe&&(e=Rt),s.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),s.removeProperty(n==="--"?e:e.replace(Ec,"-$1").toLowerCase())):s.removeAttribute(e)}},Es=function(t,e,s,n,r,o){var a=new fe(t._pt,e,s,0,1,o?od:rd);return t._pt=a,a.b=n,a.e=r,t._props.push(s),a},Vl={deg:1,rad:1,turn:1},Rv={grid:1,flex:1},Vs=function i(t,e,s,n){var r=parseFloat(s)||0,o=(s+"").trim().substr((r+"").length)||"px",a=Qs.style,c=Tv.test(e),l=t.tagName.toLowerCase()==="svg",u=(l?"client":"offset")+(c?"Width":"Height"),h=100,d=n==="px",f=n==="%",_,p,m,y;if(n===o||!r||Vl[n]||Vl[o])return r;if(o!=="px"&&!d&&(r=i(t,e,s,"px")),y=t.getCTM&&hd(t),(f||o==="%")&&(gs[e]||~e.indexOf("adius")))return _=y?t.getBBox()[c?"width":"height"]:t[u],zt(f?r/_*h:r/100*_);if(a[c?"width":"height"]=h+(d?o:n),p=~e.indexOf("adius")||n==="em"&&t.appendChild&&!l?t:t.parentNode,y&&(p=(t.ownerSVGElement||{}).parentNode),(!p||p===Ss||!p.appendChild)&&(p=Ss.body),m=p._gsap,m&&f&&m.width&&c&&m.time===ve.time&&!m.uncache)return zt(r/m.width*h);if(f&&(e==="height"||e==="width")){var w=t.style[e];t.style[e]=h+n,_=t[u],w?t.style[e]=w:dn(t,e)}else(f||o==="%")&&!Rv[Je(p,"display")]&&(a.position=Je(t,"position")),p===t&&(a.position="static"),p.appendChild(Qs),_=Qs[u],p.removeChild(Qs),a.position="absolute";return c&&f&&(m=en(p),m.time=ve.time,m.width=p[u]),zt(d?_*r/h:_&&r?h/_*r:0)},hs=function(t,e,s,n){var r;return Cc||Da(),e in Qe&&e!=="transform"&&(e=Qe[e],~e.indexOf(",")&&(e=e.split(",")[0])),gs[e]&&e!=="transform"?(r=Ki(t,n),r=e!=="transformOrigin"?r[e]:r.svg?r.origin:uo(Je(t,pe))+" "+r.zOrigin+"px"):(r=t.style[e],(!r||r==="auto"||n||~(r+"").indexOf("calc("))&&(r=lo[e]&&lo[e](t,e,s)||Je(t,e)||Eh(t,e)||(e==="opacity"?1:0))),s&&!~(r+"").trim().indexOf(" ")?Vs(t,e,r,s)+s:r},Fv=function(t,e,s,n){if(!s||s==="none"){var r=$n(e,t,1),o=r&&Je(t,r,1);o&&o!==s?(e=r,s=o):e==="borderColor"&&(s=Je(t,"borderTopColor"))}var a=new fe(this._pt,t.style,e,0,1,sd),c=0,l=0,u,h,d,f,_,p,m,y,w,b,v,g;if(a.b=s,a.e=n,s+="",n+="",n==="auto"&&(p=t.style[e],t.style[e]=n,n=Je(t,e)||n,p?t.style[e]=p:dn(t,e)),u=[s,n],Yh(u),s=u[0],n=u[1],d=s.match(Mn)||[],g=n.match(Mn)||[],g.length){for(;h=Mn.exec(n);)m=h[0],w=n.substring(c,h.index),_?_=(_+1)%5:(w.substr(-5)==="rgba("||w.substr(-5)==="hsla(")&&(_=1),m!==(p=d[l++]||"")&&(f=parseFloat(p)||0,v=p.substr((f+"").length),m.charAt(1)==="="&&(m=In(f,m)+v),y=parseFloat(m),b=m.substr((y+"").length),c=Mn.lastIndex-b.length,b||(b=b||Te.units[e]||v,c===n.length&&(n+=b,a.e+=b)),v!==b&&(f=Vs(t,e,p,b)||0),a._pt={_next:a._pt,p:w||l===1?w:",",s:f,c:y-f,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=c-1;)a=r[l],gs[a]&&(c=1,a=a==="transformOrigin"?pe:Rt),dn(s,a);c&&(dn(s,Rt),o&&(o.svg&&s.removeAttribute("transform"),Ki(s,1),o.uncache=1,ad(n)))}},lo={clearProps:function(t,e,s,n,r){if(r.data!=="isFromStart"){var o=t._pt=new fe(t._pt,e,s,0,0,Vv);return o.u=n,o.pr=-10,o.tween=r,t._props.push(s),1}}},Qi=[1,0,0,1,0,0],dd={},fd=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},zl=function(t){var e=Je(t,Rt);return fd(e)?Qi:e.substr(7).match(kh).map(zt)},Oc=function(t,e){var s=t._gsap||en(t),n=t.style,r=zl(t),o,a,c,l;return s.svg&&t.getAttribute("transform")?(c=t.transform.baseVal.consolidate().matrix,r=[c.a,c.b,c.c,c.d,c.e,c.f],r.join(",")==="1,0,0,1,0,0"?Qi:r):(r===Qi&&!t.offsetParent&&t!==Rn&&!s.svg&&(c=n.display,n.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(l=1,a=t.nextElementSibling,Rn.appendChild(t)),r=zl(t),c?n.display=c:dn(t,"display"),l&&(a?o.insertBefore(t,a):o?o.appendChild(t):Rn.removeChild(t))),e&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},Pa=function(t,e,s,n,r,o){var a=t._gsap,c=r||Oc(t,!0),l=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,d=a.yOffset||0,f=c[0],_=c[1],p=c[2],m=c[3],y=c[4],w=c[5],b=e.split(" "),v=parseFloat(b[0])||0,g=parseFloat(b[1])||0,T,x,k,C;s?c!==Qi&&(x=f*m-_*p)&&(k=v*(m/x)+g*(-p/x)+(p*w-m*y)/x,C=v*(-_/x)+g*(f/x)-(f*w-_*y)/x,v=k,g=C):(T=ud(t),v=T.x+(~b[0].indexOf("%")?v/100*T.width:v),g=T.y+(~(b[1]||b[0]).indexOf("%")?g/100*T.height:g)),n||n!==!1&&a.smooth?(y=v-l,w=g-u,a.xOffset=h+(y*f+w*p)-y,a.yOffset=d+(y*_+w*m)-w):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=g,a.smooth=!!n,a.origin=e,a.originIsAbsolute=!!s,t.style[pe]="0px 0px",o&&(Es(o,a,"xOrigin",l,v),Es(o,a,"yOrigin",u,g),Es(o,a,"xOffset",h,a.xOffset),Es(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",v+" "+g)},Ki=function(t,e){var s=t._gsap||new Zh(t);if("x"in s&&!e&&!s.uncache)return s;var n=t.style,r=s.scaleX<0,o="px",a="deg",c=getComputedStyle(t),l=Je(t,pe)||"0",u,h,d,f,_,p,m,y,w,b,v,g,T,x,k,C,M,R,P,U,W,G,Y,j,z,X,Q,et,I,F,S,D;return u=h=d=p=m=y=w=b=v=0,f=_=1,s.svg=!!(t.getCTM&&hd(t)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[Rt]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Rt]!=="none"?c[Rt]:"")),n.scale=n.rotate=n.translate="none"),x=Oc(t,s.svg),s.svg&&(s.uncache?(z=t.getBBox(),l=s.xOrigin-z.x+"px "+(s.yOrigin-z.y)+"px",j=""):j=!e&&t.getAttribute("data-svg-origin"),Pa(t,j||l,!!j||s.originIsAbsolute,s.smooth!==!1,x)),g=s.xOrigin||0,T=s.yOrigin||0,x!==Qi&&(R=x[0],P=x[1],U=x[2],W=x[3],u=G=x[4],h=Y=x[5],x.length===6?(f=Math.sqrt(R*R+P*P),_=Math.sqrt(W*W+U*U),p=R||P?Cn(P,R)*$s:0,w=U||W?Cn(U,W)*$s+p:0,w&&(_*=Math.abs(Math.cos(w*Fn))),s.svg&&(u-=g-(g*R+T*U),h-=T-(g*P+T*W))):(D=x[6],F=x[7],Q=x[8],et=x[9],I=x[10],S=x[11],u=x[12],h=x[13],d=x[14],k=Cn(D,I),m=k*$s,k&&(C=Math.cos(-k),M=Math.sin(-k),j=G*C+Q*M,z=Y*C+et*M,X=D*C+I*M,Q=G*-M+Q*C,et=Y*-M+et*C,I=D*-M+I*C,S=F*-M+S*C,G=j,Y=z,D=X),k=Cn(-U,I),y=k*$s,k&&(C=Math.cos(-k),M=Math.sin(-k),j=R*C-Q*M,z=P*C-et*M,X=U*C-I*M,S=W*M+S*C,R=j,P=z,U=X),k=Cn(P,R),p=k*$s,k&&(C=Math.cos(k),M=Math.sin(k),j=R*C+P*M,z=G*C+Y*M,P=P*C-R*M,Y=Y*C-G*M,R=j,G=z),m&&Math.abs(m)+Math.abs(p)>359.9&&(m=p=0,y=180-y),f=zt(Math.sqrt(R*R+P*P+U*U)),_=zt(Math.sqrt(Y*Y+D*D)),k=Cn(G,Y),w=Math.abs(k)>2e-4?k*$s:0,v=S?1/(S<0?-S:S):0),s.svg&&(j=t.getAttribute("transform"),s.forceCSS=t.setAttribute("transform","")||!fd(Je(t,Rt)),j&&t.setAttribute("transform",j))),Math.abs(w)>90&&Math.abs(w)<270&&(r?(f*=-1,w+=p<=0?180:-180,p+=p<=0?180:-180):(_*=-1,w+=w<=0?180:-180)),e=e||s.uncache,s.x=u-((s.xPercent=u&&(!e&&s.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-u)?-50:0)))?t.offsetWidth*s.xPercent/100:0)+o,s.y=h-((s.yPercent=h&&(!e&&s.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-h)?-50:0)))?t.offsetHeight*s.yPercent/100:0)+o,s.z=d+o,s.scaleX=zt(f),s.scaleY=zt(_),s.rotation=zt(p)+a,s.rotationX=zt(m)+a,s.rotationY=zt(y)+a,s.skewX=w+a,s.skewY=b+a,s.transformPerspective=v+o,(s.zOrigin=parseFloat(l.split(" ")[2])||!e&&s.zOrigin||0)&&(n[pe]=uo(l)),s.xOffset=s.yOffset=0,s.force3D=Te.force3D,s.renderTransform=s.svg?zv:ld?pd:Uv,s.uncache=0,s},uo=function(t){return(t=t.split(" "))[0]+" "+t[1]},sa=function(t,e,s){var n=Kt(e);return zt(parseFloat(e)+parseFloat(Vs(t,"x",s+"px",n)))+n},Uv=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,pd(t,e)},Ys="0deg",gi="0px",Gs=") ",pd=function(t,e){var s=e||this,n=s.xPercent,r=s.yPercent,o=s.x,a=s.y,c=s.z,l=s.rotation,u=s.rotationY,h=s.rotationX,d=s.skewX,f=s.skewY,_=s.scaleX,p=s.scaleY,m=s.transformPerspective,y=s.force3D,w=s.target,b=s.zOrigin,v="",g=y==="auto"&&t&&t!==1||y===!0;if(b&&(h!==Ys||u!==Ys)){var T=parseFloat(u)*Fn,x=Math.sin(T),k=Math.cos(T),C;T=parseFloat(h)*Fn,C=Math.cos(T),o=sa(w,o,x*C*-b),a=sa(w,a,-Math.sin(T)*-b),c=sa(w,c,k*C*-b+b)}m!==gi&&(v+="perspective("+m+Gs),(n||r)&&(v+="translate("+n+"%, "+r+"%) "),(g||o!==gi||a!==gi||c!==gi)&&(v+=c!==gi||g?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+Gs),l!==Ys&&(v+="rotate("+l+Gs),u!==Ys&&(v+="rotateY("+u+Gs),h!==Ys&&(v+="rotateX("+h+Gs),(d!==Ys||f!==Ys)&&(v+="skew("+d+", "+f+Gs),(_!==1||p!==1)&&(v+="scale("+_+", "+p+Gs),w.style[Rt]=v||"translate(0, 0)"},zv=function(t,e){var s=e||this,n=s.xPercent,r=s.yPercent,o=s.x,a=s.y,c=s.rotation,l=s.skewX,u=s.skewY,h=s.scaleX,d=s.scaleY,f=s.target,_=s.xOrigin,p=s.yOrigin,m=s.xOffset,y=s.yOffset,w=s.forceCSS,b=parseFloat(o),v=parseFloat(a),g,T,x,k,C;c=parseFloat(c),l=parseFloat(l),u=parseFloat(u),u&&(u=parseFloat(u),l+=u,c+=u),c||l?(c*=Fn,l*=Fn,g=Math.cos(c)*h,T=Math.sin(c)*h,x=Math.sin(c-l)*-d,k=Math.cos(c-l)*d,l&&(u*=Fn,C=Math.tan(l-u),C=Math.sqrt(1+C*C),x*=C,k*=C,u&&(C=Math.tan(u),C=Math.sqrt(1+C*C),g*=C,T*=C)),g=zt(g),T=zt(T),x=zt(x),k=zt(k)):(g=h,k=d,T=x=0),(b&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(b=Vs(f,"x",o,"px"),v=Vs(f,"y",a,"px")),(_||p||m||y)&&(b=zt(b+_-(_*g+p*x)+m),v=zt(v+p-(_*T+p*k)+y)),(n||r)&&(C=f.getBBox(),b=zt(b+n/100*C.width),v=zt(v+r/100*C.height)),C="matrix("+g+","+T+","+x+","+k+","+b+","+v+")",f.setAttribute("transform",C),w&&(f.style[Rt]=C)},jv=function(t,e,s,n,r){var o=360,a=Zt(r),c=parseFloat(r)*(a&&~r.indexOf("rad")?$s:1),l=c-n,u=n+l+"deg",h,d;return a&&(h=r.split("_")[1],h==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),h==="cw"&&l<0?l=(l+o*Rl)%o-~~(l/o)*o:h==="ccw"&&l>0&&(l=(l-o*Rl)%o-~~(l/o)*o)),t._pt=d=new fe(t._pt,e,s,n,l,bv),d.e=u,d.u="deg",t._props.push(s),d},jl=function(t,e){for(var s in e)t[s]=e[s];return t},Bv=function(t,e,s){var n=jl({},s._gsap),r="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,l,u,h,d,f,_;n.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),o[Rt]=e,a=Ki(s,1),dn(s,Rt),s.setAttribute("transform",l)):(l=getComputedStyle(s)[Rt],o[Rt]=e,a=Ki(s,1),o[Rt]=l);for(c in gs)l=n[c],u=a[c],l!==u&&r.indexOf(c)<0&&(f=Kt(l),_=Kt(u),h=f!==_?Vs(s,c,l,_):parseFloat(l),d=parseFloat(u),t._pt=new fe(t._pt,a,c,h,d-h,Aa),t._pt.u=_||0,t._props.push(c));jl(a,n)};de("padding,margin,Width,Radius",function(i,t){var e="Top",s="Right",n="Bottom",r="Left",o=(t<3?[e,s,n,r]:[e+r,e+s,n+s,n+r]).map(function(a){return t<2?i+a:"border"+a+i});lo[t>1?"border"+i:i]=function(a,c,l,u,h){var d,f;if(arguments.length<4)return d=o.map(function(_){return hs(a,_,l)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(u+"").split(" "),f={},o.forEach(function(_,p){return f[_]=d[p]=d[p]||d[(p-1)/2|0]}),a.init(c,f,h)}});var md={name:"css",register:Da,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,s,n,r){var o=this._props,a=t.style,c=s.vars.startAt,l,u,h,d,f,_,p,m,y,w,b,v,g,T,x,k;Cc||Da(),this.styles=this.styles||cd(t),k=this.styles.props,this.tween=s;for(p in e)if(p!=="autoRound"&&(u=e[p],!(ye[p]&&Qh(p,e,s,n,t,r)))){if(f=typeof u,_=lo[p],f==="function"&&(u=u.call(s,n,t,r),f=typeof u),f==="string"&&~u.indexOf("random(")&&(u=$i(u)),_)_(this,t,p,u,s)&&(x=1);else if(p.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(p)+"").trim(),u+="",Ds.lastIndex=0,Ds.test(l)||(m=Kt(l),y=Kt(u)),y?m!==y&&(l=Vs(t,p,l,y)+y):m&&(u+=m),this.add(a,"setProperty",l,u,n,r,0,0,p),o.push(p),k.push(p,0,a[p]);else if(f!=="undefined"){if(c&&p in c?(l=typeof c[p]=="function"?c[p].call(s,n,t,r):c[p],Zt(l)&&~l.indexOf("random(")&&(l=$i(l)),Kt(l+"")||l==="auto"||(l+=Te.units[p]||Kt(hs(t,p))||""),(l+"").charAt(1)==="="&&(l=hs(t,p))):l=hs(t,p),d=parseFloat(l),w=f==="string"&&u.charAt(1)==="="&&u.substr(0,2),w&&(u=u.substr(2)),h=parseFloat(u),p in Qe&&(p==="autoAlpha"&&(d===1&&hs(t,"visibility")==="hidden"&&h&&(d=0),k.push("visibility",0,a.visibility),Es(this,a,"visibility",d?"inherit":"hidden",h?"inherit":"hidden",!h)),p!=="scale"&&p!=="transform"&&(p=Qe[p],~p.indexOf(",")&&(p=p.split(",")[0]))),b=p in gs,b){if(this.styles.save(p),v||(g=t._gsap,g.renderTransform&&!e.parseTransform||Ki(t,e.parseTransform),T=e.smoothOrigin!==!1&&g.smooth,v=this._pt=new fe(this._pt,a,Rt,0,1,g.renderTransform,g,0,-1),v.dep=1),p==="scale")this._pt=new fe(this._pt,g,"scaleY",g.scaleY,(w?In(g.scaleY,w+h):h)-g.scaleY||0,Aa),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){k.push(pe,0,a[pe]),u=Lv(u),g.svg?Pa(t,u,0,T,0,this):(y=parseFloat(u.split(" ")[2])||0,y!==g.zOrigin&&Es(this,g,"zOrigin",g.zOrigin,y),Es(this,a,p,uo(l),uo(u)));continue}else if(p==="svgOrigin"){Pa(t,u,1,T,0,this);continue}else if(p in dd){jv(this,g,p,d,w?In(d,w+u):u);continue}else if(p==="smoothOrigin"){Es(this,g,"smooth",g.smooth,u);continue}else if(p==="force3D"){g[p]=u;continue}else if(p==="transform"){Bv(this,u,t);continue}}else p in a||(p=$n(p)||p);if(b||(h||h===0)&&(d||d===0)&&!wv.test(u)&&p in a)m=(l+"").substr((d+"").length),h||(h=0),y=Kt(u)||(p in Te.units?Te.units[p]:m),m!==y&&(d=Vs(t,p,l,y)),this._pt=new fe(this._pt,b?g:a,p,d,(w?In(d,w+h):h)-d,!b&&(y==="px"||p==="zIndex")&&e.autoRound!==!1?Sv:Aa),this._pt.u=y||0,m!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=Cv);else if(p in a)Fv.call(this,t,p,l,w?w+u:u);else if(p in t)this.add(t,p,l||t[p],w?w+u:u,n,r);else if(p!=="parseTransform"){_c(p,u);continue}b||(p in a?k.push(p,0,a[p]):k.push(p,1,l||t[p])),o.push(p)}}x&&nd(this)},render:function(t,e){if(e.tween._time||!Sc())for(var s=e._pt;s;)s.r(t,s.d),s=s._next;else e.styles.revert()},get:hs,aliases:Qe,getSetter:function(t,e,s){var n=Qe[e];return n&&n.indexOf(",")<0&&(e=n),e in gs&&e!==pe&&(t._gsap.x||hs(t,"x"))?s&&Il===s?e==="scale"?Mv:Av:(Il=s||{})&&(e==="scale"?Dv:Pv):t.style&&!fc(t.style[e])?Ev:~e.indexOf("-")?Ov:wc(t,e)},core:{_removeProperty:dn,_getMatrix:Oc}};_e.utils.checkPrefix=$n;_e.core.getStyleSaver=cd;(function(i,t,e,s){var n=de(i+","+t+","+e,function(r){gs[r]=1});de(t,function(r){Te.units[r]="deg",dd[r]=1}),Qe[n[13]]=i+","+t,de(s,function(r){var o=r.split(":");Qe[o[1]]=n[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");de("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(i){Te.units[i]="px"});_e.registerPlugin(md);var _d=_e.registerPlugin(md)||_e;_d.core.Tween;const gd=A.forwardRef(({source:i,target:t,isSelected:e,lineWidth:s,visible:n},r)=>{A.useEffect(()=>{const a=r.current;a&&_d.fromTo(a.material,{linewidth:5},{linewidth:e?2:s,duration:1})},[e,s,r]);const o=new go(16711680);return L.jsx(Ud,{ref:r,color:o,isLine2:!0,lineWidth:2,opacity:.5,points:[i,t],visible:n})});gd.displayName="LineComponent";const yd=A.memo(({linksPositions:i})=>{const t=Us(r=>r.dataInitial),{showSelectionGraph:e}=oe(r=>r),s=We(),n=A.useRef([]);return L.jsx("group",{name:"simulation-3d-group__connections",children:t==null?void 0:t.links.map((r,o)=>{var h,d,f,_,p,m;const a=new rt(((h=i[o])==null?void 0:h.sx)||0,((d=i[o])==null?void 0:d.sy)||0,((f=i[o])==null?void 0:f.sz)||0),c=new rt(((_=i[o])==null?void 0:_.tx)||0,((p=i[o])==null?void 0:p.ty)||0,((m=i[o])==null?void 0:m.tz)||0),l=(s==null?void 0:s.ref_id)===r.source||(s==null?void 0:s.ref_id)===r.target,u=s?0:.5;return L.jsx(gd,{ref:y=>{n.current[o]=y},isSelected:l,lineWidth:u,source:a,target:c,visible:!e},r.ref_id)})})});yd.displayName="Connections";const qv=({color:i})=>L.jsx(L.Fragment,{children:L.jsx(eu,{follow:!0,lockX:!1,lockY:!1,lockZ:!1,children:L.jsx(ru,{color:i})})}),Wv=["#fff","#9747FF","#00887A","#0098A6","#0288D1","#33691E","#465A65","#512DA7","#5C6BC0","#5D4038","#662C00","#689F39","#6B1B00","#750000","#78909C","#7E57C2","#8C6E63","#AA47BC","#BF360C","#C2175B","#EC407A","#EF6C00","#F5511E","#FF9696","#FFC064","#FFCD29","#FFEA60"],Hv=()=>{const i=We(),t=Us(r=>r.dataInitial),{normalizedSchemasByType:e}=Gl(r=>r),s=$l(),n=A.useMemo(()=>new Of(30,4,16,100),[]);return L.jsx(L.Fragment,{children:L.jsxs(Qf,{geometry:n,limit:1e3,range:1e3,visible:!i,children:[L.jsx("meshStandardMaterial",{}),t==null?void 0:t.nodes.map(r=>{var c;const a=((c=e[r.node_type])==null?void 0:c.primary_color)??(Wv[s.indexOf(r.node_type)]||Tt.white);return L.jsx(qv,{color:a},r.ref_id)})]})})},Yv=A.memo(Hv),Gv=qt(ys)` +*/var Nl,Ss,Rn,Cc,Qs,Il,Sc,xv=function(){return typeof window<"u"},gs={},$s=180/Math.PI,Fn=Math.PI/180,Cn=Math.atan2,Rl=1e8,Ec=/([A-Z])/g,Tv=/(left|right|width|margin|padding|x)/i,wv=/[\s,\(]\S/,Qe={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Aa=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},bv=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},Cv=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},Sv=function(t,e){var s=e.s+e.c*t;e.set(e.t,e.p,~~(s+(s<0?-.5:.5))+e.u,e)},rd=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},od=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},Ev=function(t,e,s){return t.style[e]=s},Ov=function(t,e,s){return t.style.setProperty(e,s)},Av=function(t,e,s){return t._gsap[e]=s},Mv=function(t,e,s){return t._gsap.scaleX=t._gsap.scaleY=s},Dv=function(t,e,s,n,r){var o=t._gsap;o.scaleX=o.scaleY=s,o.renderTransform(r,o)},Pv=function(t,e,s,n,r){var o=t._gsap;o[e]=s,o.renderTransform(r,o)},Rt="transform",pe=Rt+"Origin",Nv=function i(t,e){var s=this,n=this.target,r=n.style,o=n._gsap;if(t in gs&&r){if(this.tfm=this.tfm||{},t!=="transform")t=Qe[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return s.tfm[a]=hs(n,a)}):this.tfm[t]=o.x?o[t]:hs(n,t),t===pe&&(this.tfm.zOrigin=o.zOrigin);else return Qe.transform.split(",").forEach(function(a){return i.call(s,a,e)});if(this.props.indexOf(Rt)>=0)return;o.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(pe,e,"")),t=Rt}(r||e)&&this.props.push(t,e,r[t])},ad=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},Iv=function(){var t=this.props,e=this.target,s=e.style,n=e._gsap,r,o;for(r=0;r=0?Fl[o]:"")+t},Da=function(){xv()&&window.document&&(Nl=window,Ss=Nl.document,Rn=Ss.documentElement,Qs=Ma("div")||{style:{}},Ma("div"),Rt=$n(Rt),pe=Rt+"Origin",Qs.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",ld=!!$n("perspective"),Sc=_e.core.reverting,Cc=1)},ea=function i(t){var e=Ma("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=this.parentNode,n=this.nextSibling,r=this.style.cssText,o;if(Rn.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=i}catch{}else this._gsapBBox&&(o=this._gsapBBox());return s&&(n?s.insertBefore(this,n):s.appendChild(this)),Rn.removeChild(e),this.style.cssText=r,o},Ll=function(t,e){for(var s=e.length;s--;)if(t.hasAttribute(e[s]))return t.getAttribute(e[s])},ud=function(t){var e;try{e=t.getBBox()}catch{e=ea.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===ea||(e=ea.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Ll(t,["x","cx","x1"])||0,y:+Ll(t,["y","cy","y1"])||0,width:0,height:0}:e},hd=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ud(t))},dn=function(t,e){if(e){var s=t.style,n;e in gs&&e!==pe&&(e=Rt),s.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),s.removeProperty(n==="--"?e:e.replace(Ec,"-$1").toLowerCase())):s.removeAttribute(e)}},Es=function(t,e,s,n,r,o){var a=new fe(t._pt,e,s,0,1,o?od:rd);return t._pt=a,a.b=n,a.e=r,t._props.push(s),a},Vl={deg:1,rad:1,turn:1},Rv={grid:1,flex:1},Vs=function i(t,e,s,n){var r=parseFloat(s)||0,o=(s+"").trim().substr((r+"").length)||"px",a=Qs.style,c=Tv.test(e),l=t.tagName.toLowerCase()==="svg",u=(l?"client":"offset")+(c?"Width":"Height"),h=100,d=n==="px",p=n==="%",m,f,_,y;if(n===o||!r||Vl[n]||Vl[o])return r;if(o!=="px"&&!d&&(r=i(t,e,s,"px")),y=t.getCTM&&hd(t),(p||o==="%")&&(gs[e]||~e.indexOf("adius")))return m=y?t.getBBox()[c?"width":"height"]:t[u],zt(p?r/m*h:r/100*m);if(a[c?"width":"height"]=h+(d?o:n),f=~e.indexOf("adius")||n==="em"&&t.appendChild&&!l?t:t.parentNode,y&&(f=(t.ownerSVGElement||{}).parentNode),(!f||f===Ss||!f.appendChild)&&(f=Ss.body),_=f._gsap,_&&p&&_.width&&c&&_.time===ve.time&&!_.uncache)return zt(r/_.width*h);if(p&&(e==="height"||e==="width")){var w=t.style[e];t.style[e]=h+n,m=t[u],w?t.style[e]=w:dn(t,e)}else(p||o==="%")&&!Rv[Je(f,"display")]&&(a.position=Je(t,"position")),f===t&&(a.position="static"),f.appendChild(Qs),m=Qs[u],f.removeChild(Qs),a.position="absolute";return c&&p&&(_=en(f),_.time=ve.time,_.width=f[u]),zt(d?m*r/h:m&&r?h/m*r:0)},hs=function(t,e,s,n){var r;return Cc||Da(),e in Qe&&e!=="transform"&&(e=Qe[e],~e.indexOf(",")&&(e=e.split(",")[0])),gs[e]&&e!=="transform"?(r=Ki(t,n),r=e!=="transformOrigin"?r[e]:r.svg?r.origin:uo(Je(t,pe))+" "+r.zOrigin+"px"):(r=t.style[e],(!r||r==="auto"||n||~(r+"").indexOf("calc("))&&(r=lo[e]&&lo[e](t,e,s)||Je(t,e)||Eh(t,e)||(e==="opacity"?1:0))),s&&!~(r+"").trim().indexOf(" ")?Vs(t,e,r,s)+s:r},Fv=function(t,e,s,n){if(!s||s==="none"){var r=$n(e,t,1),o=r&&Je(t,r,1);o&&o!==s?(e=r,s=o):e==="borderColor"&&(s=Je(t,"borderTopColor"))}var a=new fe(this._pt,t.style,e,0,1,sd),c=0,l=0,u,h,d,p,m,f,_,y,w,b,v,g;if(a.b=s,a.e=n,s+="",n+="",n==="auto"&&(f=t.style[e],t.style[e]=n,n=Je(t,e)||n,f?t.style[e]=f:dn(t,e)),u=[s,n],Yh(u),s=u[0],n=u[1],d=s.match(Mn)||[],g=n.match(Mn)||[],g.length){for(;h=Mn.exec(n);)_=h[0],w=n.substring(c,h.index),m?m=(m+1)%5:(w.substr(-5)==="rgba("||w.substr(-5)==="hsla(")&&(m=1),_!==(f=d[l++]||"")&&(p=parseFloat(f)||0,v=f.substr((p+"").length),_.charAt(1)==="="&&(_=In(p,_)+v),y=parseFloat(_),b=_.substr((y+"").length),c=Mn.lastIndex-b.length,b||(b=b||Te.units[e]||v,c===n.length&&(n+=b,a.e+=b)),v!==b&&(p=Vs(t,e,f,b)||0),a._pt={_next:a._pt,p:w||l===1?w:",",s:p,c:y-p,m:m&&m<4||e==="zIndex"?Math.round:0});a.c=c-1;)a=r[l],gs[a]&&(c=1,a=a==="transformOrigin"?pe:Rt),dn(s,a);c&&(dn(s,Rt),o&&(o.svg&&s.removeAttribute("transform"),Ki(s,1),o.uncache=1,ad(n)))}},lo={clearProps:function(t,e,s,n,r){if(r.data!=="isFromStart"){var o=t._pt=new fe(t._pt,e,s,0,0,Vv);return o.u=n,o.pr=-10,o.tween=r,t._props.push(s),1}}},Qi=[1,0,0,1,0,0],dd={},fd=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},zl=function(t){var e=Je(t,Rt);return fd(e)?Qi:e.substr(7).match(kh).map(zt)},Oc=function(t,e){var s=t._gsap||en(t),n=t.style,r=zl(t),o,a,c,l;return s.svg&&t.getAttribute("transform")?(c=t.transform.baseVal.consolidate().matrix,r=[c.a,c.b,c.c,c.d,c.e,c.f],r.join(",")==="1,0,0,1,0,0"?Qi:r):(r===Qi&&!t.offsetParent&&t!==Rn&&!s.svg&&(c=n.display,n.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(l=1,a=t.nextElementSibling,Rn.appendChild(t)),r=zl(t),c?n.display=c:dn(t,"display"),l&&(a?o.insertBefore(t,a):o?o.appendChild(t):Rn.removeChild(t))),e&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},Pa=function(t,e,s,n,r,o){var a=t._gsap,c=r||Oc(t,!0),l=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,d=a.yOffset||0,p=c[0],m=c[1],f=c[2],_=c[3],y=c[4],w=c[5],b=e.split(" "),v=parseFloat(b[0])||0,g=parseFloat(b[1])||0,x,T,k,C;s?c!==Qi&&(T=p*_-m*f)&&(k=v*(_/T)+g*(-f/T)+(f*w-_*y)/T,C=v*(-m/T)+g*(p/T)-(p*w-m*y)/T,v=k,g=C):(x=ud(t),v=x.x+(~b[0].indexOf("%")?v/100*x.width:v),g=x.y+(~(b[1]||b[0]).indexOf("%")?g/100*x.height:g)),n||n!==!1&&a.smooth?(y=v-l,w=g-u,a.xOffset=h+(y*p+w*f)-y,a.yOffset=d+(y*m+w*_)-w):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=g,a.smooth=!!n,a.origin=e,a.originIsAbsolute=!!s,t.style[pe]="0px 0px",o&&(Es(o,a,"xOrigin",l,v),Es(o,a,"yOrigin",u,g),Es(o,a,"xOffset",h,a.xOffset),Es(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",v+" "+g)},Ki=function(t,e){var s=t._gsap||new Zh(t);if("x"in s&&!e&&!s.uncache)return s;var n=t.style,r=s.scaleX<0,o="px",a="deg",c=getComputedStyle(t),l=Je(t,pe)||"0",u,h,d,p,m,f,_,y,w,b,v,g,x,T,k,C,M,R,P,U,W,G,Y,j,z,X,Q,et,I,F,S,D;return u=h=d=f=_=y=w=b=v=0,p=m=1,s.svg=!!(t.getCTM&&hd(t)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[Rt]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[Rt]!=="none"?c[Rt]:"")),n.scale=n.rotate=n.translate="none"),T=Oc(t,s.svg),s.svg&&(s.uncache?(z=t.getBBox(),l=s.xOrigin-z.x+"px "+(s.yOrigin-z.y)+"px",j=""):j=!e&&t.getAttribute("data-svg-origin"),Pa(t,j||l,!!j||s.originIsAbsolute,s.smooth!==!1,T)),g=s.xOrigin||0,x=s.yOrigin||0,T!==Qi&&(R=T[0],P=T[1],U=T[2],W=T[3],u=G=T[4],h=Y=T[5],T.length===6?(p=Math.sqrt(R*R+P*P),m=Math.sqrt(W*W+U*U),f=R||P?Cn(P,R)*$s:0,w=U||W?Cn(U,W)*$s+f:0,w&&(m*=Math.abs(Math.cos(w*Fn))),s.svg&&(u-=g-(g*R+x*U),h-=x-(g*P+x*W))):(D=T[6],F=T[7],Q=T[8],et=T[9],I=T[10],S=T[11],u=T[12],h=T[13],d=T[14],k=Cn(D,I),_=k*$s,k&&(C=Math.cos(-k),M=Math.sin(-k),j=G*C+Q*M,z=Y*C+et*M,X=D*C+I*M,Q=G*-M+Q*C,et=Y*-M+et*C,I=D*-M+I*C,S=F*-M+S*C,G=j,Y=z,D=X),k=Cn(-U,I),y=k*$s,k&&(C=Math.cos(-k),M=Math.sin(-k),j=R*C-Q*M,z=P*C-et*M,X=U*C-I*M,S=W*M+S*C,R=j,P=z,U=X),k=Cn(P,R),f=k*$s,k&&(C=Math.cos(k),M=Math.sin(k),j=R*C+P*M,z=G*C+Y*M,P=P*C-R*M,Y=Y*C-G*M,R=j,G=z),_&&Math.abs(_)+Math.abs(f)>359.9&&(_=f=0,y=180-y),p=zt(Math.sqrt(R*R+P*P+U*U)),m=zt(Math.sqrt(Y*Y+D*D)),k=Cn(G,Y),w=Math.abs(k)>2e-4?k*$s:0,v=S?1/(S<0?-S:S):0),s.svg&&(j=t.getAttribute("transform"),s.forceCSS=t.setAttribute("transform","")||!fd(Je(t,Rt)),j&&t.setAttribute("transform",j))),Math.abs(w)>90&&Math.abs(w)<270&&(r?(p*=-1,w+=f<=0?180:-180,f+=f<=0?180:-180):(m*=-1,w+=w<=0?180:-180)),e=e||s.uncache,s.x=u-((s.xPercent=u&&(!e&&s.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-u)?-50:0)))?t.offsetWidth*s.xPercent/100:0)+o,s.y=h-((s.yPercent=h&&(!e&&s.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-h)?-50:0)))?t.offsetHeight*s.yPercent/100:0)+o,s.z=d+o,s.scaleX=zt(p),s.scaleY=zt(m),s.rotation=zt(f)+a,s.rotationX=zt(_)+a,s.rotationY=zt(y)+a,s.skewX=w+a,s.skewY=b+a,s.transformPerspective=v+o,(s.zOrigin=parseFloat(l.split(" ")[2])||!e&&s.zOrigin||0)&&(n[pe]=uo(l)),s.xOffset=s.yOffset=0,s.force3D=Te.force3D,s.renderTransform=s.svg?zv:ld?pd:Uv,s.uncache=0,s},uo=function(t){return(t=t.split(" "))[0]+" "+t[1]},sa=function(t,e,s){var n=Kt(e);return zt(parseFloat(e)+parseFloat(Vs(t,"x",s+"px",n)))+n},Uv=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,pd(t,e)},Ys="0deg",gi="0px",Gs=") ",pd=function(t,e){var s=e||this,n=s.xPercent,r=s.yPercent,o=s.x,a=s.y,c=s.z,l=s.rotation,u=s.rotationY,h=s.rotationX,d=s.skewX,p=s.skewY,m=s.scaleX,f=s.scaleY,_=s.transformPerspective,y=s.force3D,w=s.target,b=s.zOrigin,v="",g=y==="auto"&&t&&t!==1||y===!0;if(b&&(h!==Ys||u!==Ys)){var x=parseFloat(u)*Fn,T=Math.sin(x),k=Math.cos(x),C;x=parseFloat(h)*Fn,C=Math.cos(x),o=sa(w,o,T*C*-b),a=sa(w,a,-Math.sin(x)*-b),c=sa(w,c,k*C*-b+b)}_!==gi&&(v+="perspective("+_+Gs),(n||r)&&(v+="translate("+n+"%, "+r+"%) "),(g||o!==gi||a!==gi||c!==gi)&&(v+=c!==gi||g?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+Gs),l!==Ys&&(v+="rotate("+l+Gs),u!==Ys&&(v+="rotateY("+u+Gs),h!==Ys&&(v+="rotateX("+h+Gs),(d!==Ys||p!==Ys)&&(v+="skew("+d+", "+p+Gs),(m!==1||f!==1)&&(v+="scale("+m+", "+f+Gs),w.style[Rt]=v||"translate(0, 0)"},zv=function(t,e){var s=e||this,n=s.xPercent,r=s.yPercent,o=s.x,a=s.y,c=s.rotation,l=s.skewX,u=s.skewY,h=s.scaleX,d=s.scaleY,p=s.target,m=s.xOrigin,f=s.yOrigin,_=s.xOffset,y=s.yOffset,w=s.forceCSS,b=parseFloat(o),v=parseFloat(a),g,x,T,k,C;c=parseFloat(c),l=parseFloat(l),u=parseFloat(u),u&&(u=parseFloat(u),l+=u,c+=u),c||l?(c*=Fn,l*=Fn,g=Math.cos(c)*h,x=Math.sin(c)*h,T=Math.sin(c-l)*-d,k=Math.cos(c-l)*d,l&&(u*=Fn,C=Math.tan(l-u),C=Math.sqrt(1+C*C),T*=C,k*=C,u&&(C=Math.tan(u),C=Math.sqrt(1+C*C),g*=C,x*=C)),g=zt(g),x=zt(x),T=zt(T),k=zt(k)):(g=h,k=d,x=T=0),(b&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(b=Vs(p,"x",o,"px"),v=Vs(p,"y",a,"px")),(m||f||_||y)&&(b=zt(b+m-(m*g+f*T)+_),v=zt(v+f-(m*x+f*k)+y)),(n||r)&&(C=p.getBBox(),b=zt(b+n/100*C.width),v=zt(v+r/100*C.height)),C="matrix("+g+","+x+","+T+","+k+","+b+","+v+")",p.setAttribute("transform",C),w&&(p.style[Rt]=C)},jv=function(t,e,s,n,r){var o=360,a=Zt(r),c=parseFloat(r)*(a&&~r.indexOf("rad")?$s:1),l=c-n,u=n+l+"deg",h,d;return a&&(h=r.split("_")[1],h==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),h==="cw"&&l<0?l=(l+o*Rl)%o-~~(l/o)*o:h==="ccw"&&l>0&&(l=(l-o*Rl)%o-~~(l/o)*o)),t._pt=d=new fe(t._pt,e,s,n,l,bv),d.e=u,d.u="deg",t._props.push(s),d},jl=function(t,e){for(var s in e)t[s]=e[s];return t},Bv=function(t,e,s){var n=jl({},s._gsap),r="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,l,u,h,d,p,m;n.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),o[Rt]=e,a=Ki(s,1),dn(s,Rt),s.setAttribute("transform",l)):(l=getComputedStyle(s)[Rt],o[Rt]=e,a=Ki(s,1),o[Rt]=l);for(c in gs)l=n[c],u=a[c],l!==u&&r.indexOf(c)<0&&(p=Kt(l),m=Kt(u),h=p!==m?Vs(s,c,l,m):parseFloat(l),d=parseFloat(u),t._pt=new fe(t._pt,a,c,h,d-h,Aa),t._pt.u=m||0,t._props.push(c));jl(a,n)};de("padding,margin,Width,Radius",function(i,t){var e="Top",s="Right",n="Bottom",r="Left",o=(t<3?[e,s,n,r]:[e+r,e+s,n+s,n+r]).map(function(a){return t<2?i+a:"border"+a+i});lo[t>1?"border"+i:i]=function(a,c,l,u,h){var d,p;if(arguments.length<4)return d=o.map(function(m){return hs(a,m,l)}),p=d.join(" "),p.split(d[0]).length===5?d[0]:p;d=(u+"").split(" "),p={},o.forEach(function(m,f){return p[m]=d[f]=d[f]||d[(f-1)/2|0]}),a.init(c,p,h)}});var md={name:"css",register:Da,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,s,n,r){var o=this._props,a=t.style,c=s.vars.startAt,l,u,h,d,p,m,f,_,y,w,b,v,g,x,T,k;Cc||Da(),this.styles=this.styles||cd(t),k=this.styles.props,this.tween=s;for(f in e)if(f!=="autoRound"&&(u=e[f],!(ye[f]&&Qh(f,e,s,n,t,r)))){if(p=typeof u,m=lo[f],p==="function"&&(u=u.call(s,n,t,r),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=$i(u)),m)m(this,t,f,u,s)&&(T=1);else if(f.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(f)+"").trim(),u+="",Ds.lastIndex=0,Ds.test(l)||(_=Kt(l),y=Kt(u)),y?_!==y&&(l=Vs(t,f,l,y)+y):_&&(u+=_),this.add(a,"setProperty",l,u,n,r,0,0,f),o.push(f),k.push(f,0,a[f]);else if(p!=="undefined"){if(c&&f in c?(l=typeof c[f]=="function"?c[f].call(s,n,t,r):c[f],Zt(l)&&~l.indexOf("random(")&&(l=$i(l)),Kt(l+"")||l==="auto"||(l+=Te.units[f]||Kt(hs(t,f))||""),(l+"").charAt(1)==="="&&(l=hs(t,f))):l=hs(t,f),d=parseFloat(l),w=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),w&&(u=u.substr(2)),h=parseFloat(u),f in Qe&&(f==="autoAlpha"&&(d===1&&hs(t,"visibility")==="hidden"&&h&&(d=0),k.push("visibility",0,a.visibility),Es(this,a,"visibility",d?"inherit":"hidden",h?"inherit":"hidden",!h)),f!=="scale"&&f!=="transform"&&(f=Qe[f],~f.indexOf(",")&&(f=f.split(",")[0]))),b=f in gs,b){if(this.styles.save(f),v||(g=t._gsap,g.renderTransform&&!e.parseTransform||Ki(t,e.parseTransform),x=e.smoothOrigin!==!1&&g.smooth,v=this._pt=new fe(this._pt,a,Rt,0,1,g.renderTransform,g,0,-1),v.dep=1),f==="scale")this._pt=new fe(this._pt,g,"scaleY",g.scaleY,(w?In(g.scaleY,w+h):h)-g.scaleY||0,Aa),this._pt.u=0,o.push("scaleY",f),f+="X";else if(f==="transformOrigin"){k.push(pe,0,a[pe]),u=Lv(u),g.svg?Pa(t,u,0,x,0,this):(y=parseFloat(u.split(" ")[2])||0,y!==g.zOrigin&&Es(this,g,"zOrigin",g.zOrigin,y),Es(this,a,f,uo(l),uo(u)));continue}else if(f==="svgOrigin"){Pa(t,u,1,x,0,this);continue}else if(f in dd){jv(this,g,f,d,w?In(d,w+u):u);continue}else if(f==="smoothOrigin"){Es(this,g,"smooth",g.smooth,u);continue}else if(f==="force3D"){g[f]=u;continue}else if(f==="transform"){Bv(this,u,t);continue}}else f in a||(f=$n(f)||f);if(b||(h||h===0)&&(d||d===0)&&!wv.test(u)&&f in a)_=(l+"").substr((d+"").length),h||(h=0),y=Kt(u)||(f in Te.units?Te.units[f]:_),_!==y&&(d=Vs(t,f,l,y)),this._pt=new fe(this._pt,b?g:a,f,d,(w?In(d,w+h):h)-d,!b&&(y==="px"||f==="zIndex")&&e.autoRound!==!1?Sv:Aa),this._pt.u=y||0,_!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=Cv);else if(f in a)Fv.call(this,t,f,l,w?w+u:u);else if(f in t)this.add(t,f,l||t[f],w?w+u:u,n,r);else if(f!=="parseTransform"){_c(f,u);continue}b||(f in a?k.push(f,0,a[f]):k.push(f,1,l||t[f])),o.push(f)}}T&&nd(this)},render:function(t,e){if(e.tween._time||!Sc())for(var s=e._pt;s;)s.r(t,s.d),s=s._next;else e.styles.revert()},get:hs,aliases:Qe,getSetter:function(t,e,s){var n=Qe[e];return n&&n.indexOf(",")<0&&(e=n),e in gs&&e!==pe&&(t._gsap.x||hs(t,"x"))?s&&Il===s?e==="scale"?Mv:Av:(Il=s||{})&&(e==="scale"?Dv:Pv):t.style&&!fc(t.style[e])?Ev:~e.indexOf("-")?Ov:wc(t,e)},core:{_removeProperty:dn,_getMatrix:Oc}};_e.utils.checkPrefix=$n;_e.core.getStyleSaver=cd;(function(i,t,e,s){var n=de(i+","+t+","+e,function(r){gs[r]=1});de(t,function(r){Te.units[r]="deg",dd[r]=1}),Qe[n[13]]=i+","+t,de(s,function(r){var o=r.split(":");Qe[o[1]]=n[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");de("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(i){Te.units[i]="px"});_e.registerPlugin(md);var _d=_e.registerPlugin(md)||_e;_d.core.Tween;const gd=A.forwardRef(({source:i,target:t,isSelected:e,lineWidth:s,visible:n},r)=>{A.useEffect(()=>{const a=r.current;a&&_d.fromTo(a.material,{linewidth:5},{linewidth:e?2:s,duration:1})},[e,s,r]);const o=new go(16711680);return L.jsx(Ud,{ref:r,color:o,isLine2:!0,lineWidth:2,opacity:.5,points:[i,t],visible:n})});gd.displayName="LineComponent";const yd=A.memo(({linksPositions:i})=>{const t=Us(r=>r.dataInitial),{showSelectionGraph:e}=oe(r=>r),s=We(),n=A.useRef([]);return L.jsx("group",{name:"simulation-3d-group__connections",children:t==null?void 0:t.links.map((r,o)=>{var h,d,p,m,f,_;const a=new rt(((h=i[o])==null?void 0:h.sx)||0,((d=i[o])==null?void 0:d.sy)||0,((p=i[o])==null?void 0:p.sz)||0),c=new rt(((m=i[o])==null?void 0:m.tx)||0,((f=i[o])==null?void 0:f.ty)||0,((_=i[o])==null?void 0:_.tz)||0),l=(s==null?void 0:s.ref_id)===r.source||(s==null?void 0:s.ref_id)===r.target,u=s?0:.5;return L.jsx(gd,{ref:y=>{n.current[o]=y},isSelected:l,lineWidth:u,source:a,target:c,visible:!e},r.ref_id)})})});yd.displayName="Connections";const qv=({color:i})=>L.jsx(L.Fragment,{children:L.jsx(eu,{follow:!0,lockX:!1,lockY:!1,lockZ:!1,children:L.jsx(ru,{color:i})})}),Wv=["#fff","#9747FF","#00887A","#0098A6","#0288D1","#33691E","#465A65","#512DA7","#5C6BC0","#5D4038","#662C00","#689F39","#6B1B00","#750000","#78909C","#7E57C2","#8C6E63","#AA47BC","#BF360C","#C2175B","#EC407A","#EF6C00","#F5511E","#FF9696","#FFC064","#FFCD29","#FFEA60"],Hv=()=>{const i=We(),t=Us(r=>r.dataInitial),{normalizedSchemasByType:e}=Gl(r=>r),s=$l(),n=A.useMemo(()=>new Of(30,4,16,100),[]);return L.jsx(L.Fragment,{children:L.jsxs(Qf,{geometry:n,limit:1e3,range:1e3,visible:!i,children:[L.jsx("meshStandardMaterial",{}),t==null?void 0:t.nodes.map(r=>{var c;const a=((c=e[r.node_type])==null?void 0:c.primary_color)??(Wv[s.indexOf(r.node_type)]||Tt.white);return L.jsx(qv,{color:a},r.ref_id)})]})})},Yv=A.memo(Hv),Gv=qt(ys)` text-align: center; width: ${i=>i.type==="topic"?"auto":`${i.size}px`}; height: ${i=>i.type==="topic"?"auto":`${i.size}px`}; @@ -510,7 +510,7 @@ import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y a font-weight: 500; border-radius: 6px; margin-right: 5px; -`;const Xv=new rt,Zv=({position:i,userData:t,color:e})=>{const s=A.useRef(null),{selectedNode:n,setSelectedNode:r,showSelectionGraph:o,hoveredNode:a,setHoveredNode:c}=oe(Ia(f=>f)),l=((t==null?void 0:t.node_type)||"")==="Topic"||!!t.name,u=((t==null?void 0:t.node_type)||"")==="Guest"||((t==null?void 0:t.node_type)||"")==="Person";be(()=>{if(o&&s.current){const f=Xv.set((t==null?void 0:t.x)||0,(t==null?void 0:t.y)||0,(t==null?void 0:t.z)||0);s.current.position.copy(f)}}),A.useEffect(()=>function(){s.current&&s.current.clear()},[s]);const h=A.useMemo(()=>(a==null?void 0:a.ref_id)===(t==null?void 0:t.ref_id),[a==null?void 0:a.ref_id,t==null?void 0:t.ref_id]),d=(n==null?void 0:n.ref_id)===(t==null?void 0:t.ref_id);return l||d&&o||!d?L.jsx("group",{ref:s,position:i,children:L.jsx(tr,{center:!0,sprite:!0,zIndexRange:[0,0],children:l?L.jsxs($v,{direction:"column",onClick:f=>{f.stopPropagation(),t&&r(t)},onPointerOut:f=>{f.stopPropagation()},onPointerOver:f=>{f.stopPropagation()},children:[L.jsx("div",{className:"badge-wrapper",children:L.jsx(Nc,{type:(t==null?void 0:t.node_type)||""})}),Ql(t==null?void 0:t.name,20)]}):L.jsxs(Gv,{className:Xl(t==null?void 0:t.node_type,{selected:d}),color:e,fontColor:Tt.white,fontSize:l?64:20,onClick:f=>{f.stopPropagation(),t&&r(t)},onPointerOut:f=>{f.stopPropagation()},onPointerOver:f=>{f.stopPropagation()},scale:h?1.05:1,selected:!1,size:d?68:40,type:(t==null?void 0:t.node_type)||"",children:[!u&&!l?L.jsx("div",{className:"badge-wrapper",children:L.jsx(Nc,{type:(t==null?void 0:t.node_type)||""})}):null,t!=null&&t.name?t==null?void 0:t.name:L.jsx($d,{rounded:u,size:d?60:52,src:(t==null?void 0:t.image_url)||"audio_default.svg",type:t==null?void 0:t.node_type})]})})}):null},vd=A.memo(()=>{const{simulation:i,showSelectionGraph:t,selectedNode:e,selectionGraphData:s}=oe(Ia(o=>o)),n=mo(),r=A.useMemo(()=>{const o=(i==null?void 0:i.nodes())||[];return(t?s.nodes:o).filter(u=>n.includes((u==null?void 0:u.ref_id)||"")||(e==null?void 0:e.ref_id)===(u==null?void 0:u.ref_id)).slice(0,k1).map(u=>{const h=Zl(u.node_type||"",!0),d=new rt((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,(u==null?void 0:u.z)||0),f=o.filter(_=>_.ref_id&&x1(_,u)).map(_=>(_==null?void 0:_.ref_id)||"")||[];return L.jsx(Zv,{color:h,position:d,relativeIds:f,userData:u},`node-badge-${u.ref_id}`)})},[i,t,s.nodes,n,e==null?void 0:e.ref_id]);return L.jsx(A.Fragment,{children:r.length?r:null},"node-badges")});vd.displayName="RelevanceBadges";const Bl=Xd().stop(),ge={numDimensions:3,velocityDecay:.9,forceChargeStrength:-20,forceChargeMinDistance:10,forceChargeMaxDistance:8e3,forceLinkStrength:.04,forceCenterStrength:.85,disableCollide:!1,disableCenter:!1,disableLink:!1,disableCharge:!1,forceCollideRadiusMethod:i=>(i.edge_count||1)*6+200,forceLinkDistanceMethod:i=>{const t=i.source.node_type;let e=50;switch(t){case"topic":e=30;break;case"guest":e=30;break;case"clip":e=10;break;case"episode":e=15;break}return e*2/50}},Qv=(i,t,{numDimensions:e=ge.numDimensions,velocityDecay:s=ge.velocityDecay,forceChargeStrength:n=ge.forceChargeStrength,forceChargeMinDistance:r=ge.forceChargeMinDistance,forceChargeMaxDistance:o=ge.forceChargeMaxDistance,forceLinkStrength:a=ge.forceLinkStrength,forceCenterStrength:c=ge.forceCenterStrength,forceLinkDistanceMethod:l=ge.forceLinkDistanceMethod,forceCollideRadiusMethod:u=ge.forceCollideRadiusMethod,disableCollide:h=ge.disableCollide,disableCenter:d=ge.disableCenter,disableLink:f=ge.disableLink,disableCharge:_=ge.disableCharge})=>(Bl.alpha(1).stop().numDimensions(e).velocityDecay(s).force("collide",h?null:Zd().radius(u).iterations(1)).force("center",d?null:Qd().strength(c)).force("charge",_?null:Kd().strength(n).distanceMin(r).distanceMax(o)).nodes(i).force("link",f?null:Jd(t).id(p=>p.ref_id).distance(l).strength(a)).alpha(1).restart(),Bl),Kv=({link:i,animated:t})=>{const e=A.useRef(null),s=We(),[n,r]=A.useState(new rt(0,0,0)),[o,a]=A.useState(new rt(0,0,0)),[c,l]=A.useState(8947848),u=oe(h=>h.selectionGraphData);return A.useEffect(()=>{var f,_,p,m,y,w;const h=(s==null?void 0:s.ref_id)||"",d=s&&(h===i.target||h===i.source);!i.onlyVisibleOnSelect||d?(r(new rt(((f=i.sourcePosition)==null?void 0:f.x)||0,((_=i.sourcePosition)==null?void 0:_.y)||0,((p=i.sourcePosition)==null?void 0:p.z)||0)),a(new rt(((m=i.targetPosition)==null?void 0:m.x)||0,((y=i.targetPosition)==null?void 0:y.y)||0,((w=i.targetPosition)==null?void 0:w.z)||0))):(r(new rt(0,0,0)),a(new rt(0,0,0))),l(d?i.color||Ad.children.segmentColor:s?5592405:8947848)},[s,i]),be(()=>{if(t&&e.current){const h=u.nodes.find(f=>f.ref_id===i.source),d=u.nodes.find(f=>f.ref_id===i.target);e.current.start.set((h==null?void 0:h.x)||0,(h==null?void 0:h.y)||0,(h==null?void 0:h.z)||0),e.current.end.set((d==null?void 0:d.x)||0,(d==null?void 0:d.y)||0,(d==null?void 0:d.z)||0)}}),L.jsx(L.Fragment,{children:L.jsx(t0,{ref:e,color:"0xFFFFFF",end:o,start:n})})},Jv=({links:i,simulation:t})=>{const e=A.useRef(null);return A.useEffect(()=>function(){e.current&&e.current.clear()},[e]),be(()=>{if(e.current){const s=t.nodes();e.current.children.forEach((r,o)=>{var u;const a=i[o],c=s.find(h=>a.source===h.ref_id),l=s.find(h=>a.target===h.ref_id);(u=r.position)==null||u.set((c.x+l.x)/2,(c.y+l.y)/2,(c.z+l.z)/2)})}}),i.length?L.jsx("group",{ref:e,children:i.map(s=>L.jsx("mesh",{children:L.jsx(tr,{center:!0,sprite:!0,children:L.jsxs(tk,{direction:"row",justify:"center",onClick:n=>{n.stopPropagation()},onPointerOut:n=>{n.stopPropagation()},onPointerOver:n=>{n.stopPropagation()},children:[L.jsx("span",{children:s.edge_type}),L.jsx(ys,{className:"icon",children:L.jsx(tf,{})})]})})},s.ref_id))}):null},tk=qt(ys)` +`;const Xv=new rt,Zv=({position:i,userData:t,color:e})=>{const s=A.useRef(null),{selectedNode:n,setSelectedNode:r,showSelectionGraph:o,hoveredNode:a,setHoveredNode:c}=oe(Ia(p=>p)),l=((t==null?void 0:t.node_type)||"")==="Topic"||!!t.name,u=((t==null?void 0:t.node_type)||"")==="Guest"||((t==null?void 0:t.node_type)||"")==="Person";be(()=>{if(o&&s.current){const p=Xv.set((t==null?void 0:t.x)||0,(t==null?void 0:t.y)||0,(t==null?void 0:t.z)||0);s.current.position.copy(p)}}),A.useEffect(()=>function(){s.current&&s.current.clear()},[s]);const h=A.useMemo(()=>(a==null?void 0:a.ref_id)===(t==null?void 0:t.ref_id),[a==null?void 0:a.ref_id,t==null?void 0:t.ref_id]),d=(n==null?void 0:n.ref_id)===(t==null?void 0:t.ref_id);return l||d&&o||!d?L.jsx("group",{ref:s,position:i,children:L.jsx(tr,{center:!0,sprite:!0,zIndexRange:[0,0],children:l?L.jsxs($v,{direction:"column",onClick:p=>{p.stopPropagation(),t&&r(t)},onPointerOut:p=>{p.stopPropagation()},onPointerOver:p=>{p.stopPropagation()},children:[L.jsx("div",{className:"badge-wrapper",children:L.jsx(Nc,{type:(t==null?void 0:t.node_type)||""})}),Ql(t==null?void 0:t.name,20)]}):L.jsxs(Gv,{className:Xl(t==null?void 0:t.node_type,{selected:d}),color:e,fontColor:Tt.white,fontSize:l?64:20,onClick:p=>{p.stopPropagation(),t&&r(t)},onPointerOut:p=>{p.stopPropagation()},onPointerOver:p=>{p.stopPropagation()},scale:h?1.05:1,selected:!1,size:d?68:40,type:(t==null?void 0:t.node_type)||"",children:[!u&&!l?L.jsx("div",{className:"badge-wrapper",children:L.jsx(Nc,{type:(t==null?void 0:t.node_type)||""})}):null,t!=null&&t.name?t==null?void 0:t.name:L.jsx($d,{rounded:u,size:d?60:52,src:(t==null?void 0:t.image_url)||"audio_default.svg",type:t==null?void 0:t.node_type})]})})}):null},vd=A.memo(()=>{const{simulation:i,showSelectionGraph:t,selectedNode:e,selectionGraphData:s}=oe(Ia(o=>o)),n=mo(),r=A.useMemo(()=>{const o=(i==null?void 0:i.nodes())||[];return(t?s.nodes:o).filter(u=>n.includes((u==null?void 0:u.ref_id)||"")||(e==null?void 0:e.ref_id)===(u==null?void 0:u.ref_id)).slice(0,k1).map(u=>{const h=Zl(u.node_type||"",!0),d=new rt((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,(u==null?void 0:u.z)||0),p=o.filter(m=>m.ref_id&&x1(m,u)).map(m=>(m==null?void 0:m.ref_id)||"")||[];return L.jsx(Zv,{color:h,position:d,relativeIds:p,userData:u},`node-badge-${u.ref_id}`)})},[i,t,s.nodes,n,e==null?void 0:e.ref_id]);return L.jsx(A.Fragment,{children:r.length?r:null},"node-badges")});vd.displayName="RelevanceBadges";const Bl=Xd().stop(),ge={numDimensions:3,velocityDecay:.9,forceChargeStrength:-20,forceChargeMinDistance:10,forceChargeMaxDistance:8e3,forceLinkStrength:.04,forceCenterStrength:.85,disableCollide:!1,disableCenter:!1,disableLink:!1,disableCharge:!1,forceCollideRadiusMethod:i=>(i.edge_count||1)*6+200,forceLinkDistanceMethod:i=>{const t=i.source.node_type;let e=50;switch(t){case"topic":e=30;break;case"guest":e=30;break;case"clip":e=10;break;case"episode":e=15;break}return e*2/50}},Qv=(i,t,{numDimensions:e=ge.numDimensions,velocityDecay:s=ge.velocityDecay,forceChargeStrength:n=ge.forceChargeStrength,forceChargeMinDistance:r=ge.forceChargeMinDistance,forceChargeMaxDistance:o=ge.forceChargeMaxDistance,forceLinkStrength:a=ge.forceLinkStrength,forceCenterStrength:c=ge.forceCenterStrength,forceLinkDistanceMethod:l=ge.forceLinkDistanceMethod,forceCollideRadiusMethod:u=ge.forceCollideRadiusMethod,disableCollide:h=ge.disableCollide,disableCenter:d=ge.disableCenter,disableLink:p=ge.disableLink,disableCharge:m=ge.disableCharge})=>(Bl.alpha(1).stop().numDimensions(e).velocityDecay(s).force("collide",h?null:Zd().radius(u).iterations(1)).force("center",d?null:Qd().strength(c)).force("charge",m?null:Kd().strength(n).distanceMin(r).distanceMax(o)).nodes(i).force("link",p?null:Jd(t).id(f=>f.ref_id).distance(l).strength(a)).alpha(1).restart(),Bl),Kv=({link:i,animated:t})=>{const e=A.useRef(null),s=We(),[n,r]=A.useState(new rt(0,0,0)),[o,a]=A.useState(new rt(0,0,0)),[c,l]=A.useState(8947848),u=oe(h=>h.selectionGraphData);return A.useEffect(()=>{var p,m,f,_,y,w;const h=(s==null?void 0:s.ref_id)||"",d=s&&(h===i.target||h===i.source);!i.onlyVisibleOnSelect||d?(r(new rt(((p=i.sourcePosition)==null?void 0:p.x)||0,((m=i.sourcePosition)==null?void 0:m.y)||0,((f=i.sourcePosition)==null?void 0:f.z)||0)),a(new rt(((_=i.targetPosition)==null?void 0:_.x)||0,((y=i.targetPosition)==null?void 0:y.y)||0,((w=i.targetPosition)==null?void 0:w.z)||0))):(r(new rt(0,0,0)),a(new rt(0,0,0))),l(d?i.color||Ad.children.segmentColor:s?5592405:8947848)},[s,i]),be(()=>{if(t&&e.current){const h=u.nodes.find(p=>p.ref_id===i.source),d=u.nodes.find(p=>p.ref_id===i.target);e.current.start.set((h==null?void 0:h.x)||0,(h==null?void 0:h.y)||0,(h==null?void 0:h.z)||0),e.current.end.set((d==null?void 0:d.x)||0,(d==null?void 0:d.y)||0,(d==null?void 0:d.z)||0)}}),L.jsx(L.Fragment,{children:L.jsx(t0,{ref:e,color:"0xFFFFFF",end:o,start:n})})},Jv=({links:i,simulation:t})=>{const e=A.useRef(null);return A.useEffect(()=>function(){e.current&&e.current.clear()},[e]),be(()=>{if(e.current){const s=t.nodes();e.current.children.forEach((r,o)=>{var u;const a=i[o],c=s.find(h=>a.source===h.ref_id),l=s.find(h=>a.target===h.ref_id);(u=r.position)==null||u.set((c.x+l.x)/2,(c.y+l.y)/2,(c.z+l.z)/2)})}}),i.length?L.jsx("group",{ref:e,children:i.map(s=>L.jsx("mesh",{children:L.jsx(tr,{center:!0,sprite:!0,children:L.jsxs(tk,{direction:"row",justify:"center",onClick:n=>{n.stopPropagation()},onPointerOut:n=>{n.stopPropagation()},onPointerOver:n=>{n.stopPropagation()},children:[L.jsx("span",{children:s.edge_type}),L.jsx(ys,{className:"icon",children:L.jsx(tf,{})})]})})},s.ref_id))}):null},tk=qt(ys)` text-align: center; outline-offset: 0px; @@ -563,7 +563,7 @@ import{r as A,b as Oe,j as L,p as Hl,t as qt,v as Tt,F as ys,q as Us,z as Yl,y a } `,Ac={metalness:.9,roughness:0},kd=new _o,ho=kd.load("noimage.jpeg"),ql=new sr({...Ac,map:ho}),xd=.4,ek=new sr({...Ac,map:ho,transparent:!0,opacity:xd}),Mr={},sk=(i,t)=>{const[e,s]=A.useState(ho),[n,r]=A.useState(ql);return A.useEffect(()=>{const o=`${i}${t&&"-transparent"}`;if(Mr[o]){s(Mr[o].texture),r(Mr[o].material);return}kd.load(i,a=>{const c=new sr({map:a,transparent:t,opacity:t?xd:1,...Ac});Mr[o]={texture:a,material:c},s(a),r(c)},void 0,()=>{s(ho),r(t?ek:ql)})},[i,t]),A.useEffect(()=>function(){e.dispose(),n.dispose()},[e,n]),n},Td=A.memo(({node:i,hide:t,animated:e})=>{const s=A.useRef(null),[n]=A.useState(Cl),r=We(),{showSelectionGraph:o}=oe(u=>u),a=!!r&&i.ref_id===r.ref_id,c=sk(i.image_url||"noimage.jpeg",!1);be((u,h)=>{e&&s.current&&a&&(s.current.rotation.y+=h*1,s.current.rotation.x-=h*.6)}),A.useEffect(()=>function(){n.dispose()},[n]);const l=A.useMemo(()=>o&&a?20:a?(i.scale||1)*1.2:i.scale,[i,a,o]);return L.jsx(r0,{enabled:!!a,children:L.jsx("mesh",{ref:s,geometry:Cl,material:c,name:i.id,scale:l,userData:i,visible:!t})})});Td.displayName="Cube";const nk=i=>{const t=/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g;return i.replace(t,e=>/^[\d*#]$/.test(e)?e:"")},ik=["#fff","#9747FF","#00887A","#0098A6","#0288D1","#33691E","#465A65","#512DA7","#5C6BC0","#5D4038","#662C00","#689F39","#6B1B00","#750000","#78909C","#7E57C2","#8C6E63","#AA47BC","#BF360C","#C2175B","#EC407A","#EF6C00","#F5511E","#FF9696","#FFC064","#FFCD29","#FFEA60"];function rk(i){const t=Ql(i,30),e=t.split(" ");if(e.length<=5)return t;const s=Math.ceil(e.length/3),n=s*2,r=e.slice(0,s).join(" "),o=e.slice(s,n).join(" "),a=e.slice(n).join(" ");return`${r} ${o} -${a}`}const Mc=A.memo(({node:i,hide:t,isHovered:e})=>{var g,T;const s=A.useRef(null),n=A.useRef(null),r=A.useRef(null),o=We(),a=A.useRef(new rt),l=mo().includes((i==null?void 0:i.ref_id)||""),u=!!o&&(o==null?void 0:o.ref_id)===i.ref_id,h=oe(x=>x.showSelectionGraph),{normalizedSchemasByType:d}=Gl(x=>x);be(({camera:x})=>{(()=>{const C=a.current.setFromMatrixPosition(s.current.matrixWorld);r.current&&(r.current.visible=C.distanceTo(x.position)<2500)})()});const f=$l(),_=A.useMemo(()=>{let x=(i.edge_count||1)*20;h&&u?x=40:!u&&l&&(x=0);const k=x/Math.sqrt(i.name.length);return Math.min(Math.max(k,20),30)},[i.edge_count,i.name,u,l,h]);A.useMemo(()=>o&&!u||!e?.2:1,[u,o,e]);const p=(g=d[i.node_type])==null?void 0:g.primary_color,m=(T=d[i.node_type])==null?void 0:T.icon,y=p??(ik[f.indexOf(i.node_type)]||Tt.white),b=(m?ef[m]:null)?m:"NodesIcon",v=nk(String(i.name));return L.jsx(eu,{follow:!0,lockX:!1,lockY:!1,lockZ:!1,name:"billboard",userData:i,children:L.jsxs("mesh",{ref:r,name:i.id,userData:i,visible:!t,children:[L.jsx(qf,{ref:n,name:"svg",onUpdate:x=>{x.traverse(k=>{k instanceof tu&&(k.material=new sr({color:y}))})},position:[-15,15,0],scale:2,src:`svg-icons/${b}.svg`,strokeMaterial:{color:"yellow"},userData:i}),L.jsx(zd,{ref:s,color:y,fillOpacity:1,name:"text",position:[0,-40,0],scale:_,userData:i,...jd,children:rk(v)})]})})});Mc.displayName="TextNode";const wd=A.memo(()=>{const[i,t]=A.useState(null),{dataInitial:e}=Us(l=>l),s=We(),n=A.useRef(null),r=mo(),o=Bd(e==null?void 0:e.nodes.length),{selectionGraphData:a,setSelectionData:c}=oe(Ia(l=>l));return A.useEffect(()=>{const l=structuredClone((e==null?void 0:e.nodes)||[]),u=structuredClone((e==null?void 0:e.links)||[]);if(o===l.length)return;const h=l.filter(d=>d.ref_id===(s==null?void 0:s.ref_id)||r.includes((d==null?void 0:d.ref_id)||"")).map(d=>{const f=d.ref_id===(s==null?void 0:s.ref_id)?{fx:0,fy:0,fz:0}:{};return{...d,x:0,y:0,z:0,...f}});if(h){const d=u.filter(f=>h.some(_=>_.ref_id===f.target)&&h.some(_=>_.ref_id===f.source));c({nodes:h,links:d})}},[e,s,r,c,o]),A.useEffect(()=>{if(i||!a.nodes.length)return;const l=structuredClone(a.links),u=Qv(a.nodes,l,{numDimensions:2,forceLinkStrength:.01,forceCenterStrength:.85,forceChargeStrength:-20,velocityDecay:.9});t(u)},[a,i]),A.useEffect(()=>()=>{c({nodes:[],links:[]})},[c]),A.useEffect(()=>{i&&i.on("tick",()=>{n.current&&n.current.children.forEach((u,h)=>{const d=i.nodes()[h];d&&u.position.set(d.x,d.y,d.z)})})},[i]),console.log(a.nodes),L.jsxs(L.Fragment,{children:[L.jsx("group",{ref:n,name:"simulation-2d-group",children:a==null?void 0:a.nodes.map(l=>L.jsx("mesh",{children:l.name?L.jsx(Mc,{hide:!0,isHovered:!1,node:l},l.ref_id||l.id):L.jsx(Td,{hide:!0,node:l},l.ref_id||l.id)},l.ref_id))}),L.jsx(Kf,{fog:!0,lineWidth:.9,children:(a==null?void 0:a.links).map((l,u)=>L.jsx(Kv,{animated:!0,link:l},u.toString()))},`selection-links-${a==null?void 0:a.links.length}`),i&&L.jsx(Jv,{links:a.links,simulation:i})]})});wd.displayName="SelectionDataNodes";const ok=200,bd=A.memo(()=>{const i=We(),t=sf(),e=mo(),{selectionGraphData:s,showSelectionGraph:n,setHoveredNode:r,setIsHovering:o}=oe(p=>p),a=Us(p=>p.dataInitial),c=Ji(p=>p.setTranscriptOpen),l=A.useCallback(p=>!!(n&&!s.nodes.find(m=>m.ref_id===p.ref_id)),[n,s]),u=A.useCallback(p=>{const m=p==null?void 0:p[0];m&&(c(!1),m.userData&&(l(m.userData)||oe.getState().setSelectedNode((m==null?void 0:m.userData)||null)))},[c,l]),h=A.useRef(null),d=A.useCallback(p=>{p.stopPropagation(),o(!1),r(null),h.current&&(clearTimeout(h.current),h.current=null)},[o,r]),f=A.useCallback(p=>{var w;const y=p.intersections.map(b=>b.object)[0];if((w=y==null?void 0:y.userData)!=null&&w.ref_id){const b=y.userData;l(b)||(p.stopPropagation(),o(!0),h.current=setTimeout(()=>{r(b)},ok))}},[r,l,o]),_=n&&!!i;return L.jsxs(Bf,{filter:p=>p.filter(m=>{var y;return!!((y=m.userData)!=null&&y.ref_id)}),onChange:u,onPointerOut:d,onPointerOver:f,children:[L.jsx(vd,{}),L.jsx("group",{name:"simulation-3d-group__nodes",visible:!_,children:a==null?void 0:a.nodes.map(p=>{const m=!!i&&(e.includes(p.ref_id)||i.ref_id===p.ref_id);return L.jsxs("mesh",{name:"wr2",userData:p,children:[L.jsx("boxGeometry",{args:[40,40,40]}),L.jsx("meshStandardMaterial",{opacity:0,transparent:!0}),L.jsx(Mc,{hide:_||m,isHovered:!!t&&t.id===p.ref_id,node:p},p.ref_id||p.id)]},p.ref_id)})}),L.jsx("group",{name:"simulation-3d-group__node-points",children:L.jsx(Yv,{})}),_&&L.jsx(wd,{})]})});bd.displayName="Cubes";const ak={earthRef:null},ck=Hl(i=>({...ak,setEarthRef:t=>i({earthRef:t})})),lk=new rt(0,0,0),uk=()=>{const i=A.useRef(null),t=A.useRef(null),{graphStyle:e,showSelectionGraph:s}=oe(a=>a),n=ck(a=>a.setEarthRef),r=Ks("textures/earth/galaxy.png"),o=Ks("textures/earth/clouds.png");return be(({camera:a})=>{t.current&&t.current.position.copy(a.getWorldPosition(lk))}),A.useLayoutEffect(()=>{i.current&&n(i)},[n]),e!=="earth"||s?null:L.jsxs(L.Fragment,{children:[L.jsxs("mesh",{ref:i,userData:{type:"earth"},children:[L.jsx("sphereGeometry",{args:[Er,200,200]}),L.jsx(hk,{})]}),L.jsxs("mesh",{children:[L.jsx("sphereGeometry",{args:[Er+2,200,200]}),L.jsx("meshStandardMaterial",{alphaMap:o,map:o,transparent:!0})]}),L.jsxs("mesh",{children:[L.jsx("sphereGeometry",{args:[Er*4,200,200]}),L.jsx("meshStandardMaterial",{map:r,opacity:.4,side:ra,transparent:!0})]}),L.jsx("directionalLight",{ref:t,intensity:.9,position:[0,0,Er*3]})]})},hk=()=>{const i=Ks("textures/earth/earth.jpeg"),t=Ks("textures/earth/bump.jpeg"),e=Ks("textures/earth/water.png"),s=A.useMemo(()=>new sr({map:i,bumpMap:t,aoMap:t,roughnessMap:t,metalnessMap:e,toneMapped:!0,roughness:35,metalness:0}),[i,t,e]);return L.jsx("meshStandardMaterial",{...s})},dk="C",fk=256,pk=256,mk={g:"LottieFiles AE 0.1.20"},_k=[{ty:0,nm:"I",sr:1,st:0,op:26,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_0",ind:1},{ty:0,nm:"I",sr:1,st:26,op:52,ip:26,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_1",ind:2},{ty:0,nm:"I",sr:1,st:52,op:78,ip:52,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_2",ind:3},{ty:0,nm:"I",sr:1,st:78,op:108,ip:78,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_3",ind:4}],gk="5.5.7",yk=60,vk=104,kk=0,xk=[{nm:"",id:"comp_0",layers:[{ty:4,nm:"I",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.656,.016],[0,20],[-34.641,0],[.016,-19.984]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,10],[17.321,30],[17.321,-10],[51.962,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,-9.984],[17.32,10],[17.32,-30],[-17.32,-50.016]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,30],[17.32,50],[17.305,10],[-17.32,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.321,10],[-51.962,30],[-51.962,-10],[-17.321,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[0,20],[-34.641,0],[0,-20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:1}]},{nm:"",id:"comp_1",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"S",sr:1,st:-20,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,-10.016],[-17.32,-30],[17.32,-50],[51.961,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[.015,-20],[0,20],[34.641,40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,-10.016],[-17.32,-30],[17.32,-50],[51.961,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:33,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.324,30],[-17.34,-9.984],[17.336,-30.016],[17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:35,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[.015,-20],[0,20],[34.641,40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.324,30],[-17.34,-9.984],[17.336,-30.016],[17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.305,30],[-17.336,-9.984],[17.336,-30.016],[17.32,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.016,-20.016],[-34.643,-40],[-34.641,.016],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:31,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,-10],[17.321,30],[-17.321,10],[-17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.305,50],[-51.961,30],[-17.321,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:10,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:34,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.305,30],[-17.336,-9.984],[17.336,-30.016],[17.32,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:11,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,-10],[17.321,30],[-17.321,10],[-17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.305,50],[-51.961,30],[-17.321,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:12,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.016,-20.016],[-34.643,-40],[-34.641,.016],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:13,parent:1}]},{nm:"",id:"comp_2",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"T",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-34.656,.031],[.047,-19.969],[34.652,.031],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[17.32,-9.984],[17.32,-50],[-17.32,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"F",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.321,30],[-51.962,10],[-51.962,-30],[-17.321,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"S",sr:1,st:0,op:30,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[17.32,-9.984],[17.32,-50],[-17.32,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"F",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,30],[17.321,10],[17.321,-30],[51.962,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"S",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,50],[17.32,30],[17.336,-10],[-17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"F",sr:1,st:0,op:30,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,30],[17.321,10],[17.321,-30],[51.962,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"T",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-34.656,0],[.015,-20],[34.656,0],[.012,20.062]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1}]},{nm:"",id:"comp_3",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"S",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-10],[-17.32,-30.016],[-51.961,-10],[-17.305,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"T",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.015,60.016],[-34.642,40],[-34.641,0],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[-17.32,-30],[17.32,-10],[17.32,30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.312,-10],[-17.313,10],[17.332,30],[51.977,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"F",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-29.984],[17.348,10],[-17.305,30],[-17.305,-9.984]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"F",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-30],[17.32,10],[-17.32,30],[-17.336,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-10],[-17.32,-30.016],[-51.961,-10],[-17.305,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"T",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[0,-20],[0,-60.016],[34.641,-40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"S",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[-17.32,-30],[17.32,-10],[17.32,30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.312,-10],[-17.313,10],[17.332,30],[51.977,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1},{ty:4,nm:"F",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-30],[17.32,10],[-17.32,30],[-17.336,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:10,parent:1}]}],Tk={nm:dk,h:fk,w:pk,meta:mk,layers:_k,v:gk,fr:yk,op:vk,ip:kk,assets:xk},wk=({meshId:i})=>{const t=A.useRef(null);return A.useEffect(()=>{const e=document.getElementById(`lottie-animation-${i}`);return e&&(t.current=Md.loadAnimation({container:e,animationData:Tk,loop:!0,autoplay:!0})),()=>{t.current&&t.current.destroy()}},[i]),L.jsx("div",{id:`lottie-animation-${i}`,style:{width:"2em",height:"2em"}})},na=()=>Math.floor(Math.random()*2001)-1e3,bk=()=>L.jsx(L.Fragment,{children:["a","b","c"].map(i=>{const t=na(),e=na(),s=na();return L.jsx("mesh",{position:[t,e,s],children:L.jsx(tr,{center:!0,sprite:!0,children:L.jsx(Ck,{children:L.jsx(wk,{meshId:i})})})},i)})}),Ck=qt.div` +${a}`}const Mc=A.memo(({node:i,hide:t,isHovered:e})=>{var v,g;const s=A.useRef(null),n=A.useRef(null),r=We(),o=A.useRef(new rt),c=mo().includes((i==null?void 0:i.ref_id)||""),l=!!r&&(r==null?void 0:r.ref_id)===i.ref_id,u=oe(x=>x.showSelectionGraph),{normalizedSchemasByType:h}=Gl(x=>x);be(({camera:x})=>{(()=>{const k=o.current.setFromMatrixPosition(n.current.matrixWorld);n.current&&(n.current.visible=k.distanceTo(x.position)<2500)})()});const d=$l(),p=A.useMemo(()=>{if(!i.name)return 0;let x=(i.edge_count||1)*20;u&&l?x=40:!l&&c&&(x=0);const T=x/Math.sqrt(i.name.length);return Math.min(Math.max(T,20),30)},[i.edge_count,i.name,l,c,u]);A.useMemo(()=>r&&!l||!e?.2:1,[l,r,e]);const m=(v=h[i.node_type])==null?void 0:v.primary_color,f=(g=h[i.node_type])==null?void 0:g.icon,_=m??(ik[d.indexOf(i.node_type)]||Tt.white),w=(f?ef[f]:null)?f:"NodesIcon",b=nk(String(i.name));return L.jsx(eu,{follow:!0,lockX:!1,lockY:!1,lockZ:!1,name:"billboard",userData:i,children:L.jsxs("mesh",{ref:n,name:i.id,userData:i,visible:!t,children:[L.jsx(qf,{ref:s,name:"svg",onUpdate:x=>{x.traverse(T=>{T instanceof tu&&(T.material=new sr({color:_}))})},position:[-15,15,0],scale:2,src:`svg-icons/${w}.svg`,strokeMaterial:{color:"yellow"},userData:i}),i.name&&L.jsx(zd,{color:_,fillOpacity:1,name:"text",position:[0,-40,0],scale:p,userData:i,...jd,children:rk(b)})]})})});Mc.displayName="TextNode";const wd=A.memo(()=>{const[i,t]=A.useState(null),{dataInitial:e}=Us(l=>l),s=We(),n=A.useRef(null),r=mo(),o=Bd(e==null?void 0:e.nodes.length),{selectionGraphData:a,setSelectionData:c}=oe(Ia(l=>l));return A.useEffect(()=>{const l=structuredClone((e==null?void 0:e.nodes)||[]),u=structuredClone((e==null?void 0:e.links)||[]);if(o===l.length)return;const h=l.filter(d=>d.ref_id===(s==null?void 0:s.ref_id)||r.includes((d==null?void 0:d.ref_id)||"")).map(d=>{const p=d.ref_id===(s==null?void 0:s.ref_id)?{fx:0,fy:0,fz:0}:{};return{...d,x:0,y:0,z:0,...p}});if(h){const d=u.filter(p=>h.some(m=>m.ref_id===p.target)&&h.some(m=>m.ref_id===p.source));c({nodes:h,links:d})}},[e,s,r,c,o]),A.useEffect(()=>{if(i||!a.nodes.length)return;const l=structuredClone(a.links),u=Qv(a.nodes,l,{numDimensions:2,forceLinkStrength:.01,forceCenterStrength:.85,forceChargeStrength:-20,velocityDecay:.9});t(u)},[a,i]),A.useEffect(()=>()=>{c({nodes:[],links:[]})},[c]),A.useEffect(()=>{i&&i.on("tick",()=>{n.current&&n.current.children.forEach((u,h)=>{const d=i.nodes()[h];d&&u.position.set(d.x,d.y,d.z)})})},[i]),console.log(a.nodes),L.jsxs(L.Fragment,{children:[L.jsx("group",{ref:n,name:"simulation-2d-group",children:a==null?void 0:a.nodes.map(l=>L.jsx("mesh",{children:l.name?L.jsx(Mc,{hide:!0,isHovered:!1,node:l},l.ref_id||l.id):L.jsx(Td,{hide:!0,node:l},l.ref_id||l.id)},l.ref_id))}),L.jsx(Kf,{fog:!0,lineWidth:.9,children:(a==null?void 0:a.links).map((l,u)=>L.jsx(Kv,{animated:!0,link:l},u.toString()))},`selection-links-${a==null?void 0:a.links.length}`),i&&L.jsx(Jv,{links:a.links,simulation:i})]})});wd.displayName="SelectionDataNodes";const ok=200,bd=A.memo(()=>{const i=We(),t=sf(),e=mo(),{selectionGraphData:s,showSelectionGraph:n,setHoveredNode:r,setIsHovering:o}=oe(f=>f),a=Us(f=>f.dataInitial),c=Ji(f=>f.setTranscriptOpen),l=A.useCallback(f=>!!(n&&!s.nodes.find(_=>_.ref_id===f.ref_id)),[n,s]),u=A.useCallback(f=>{const _=f==null?void 0:f[0];_&&(c(!1),_.userData&&(l(_.userData)||oe.getState().setSelectedNode((_==null?void 0:_.userData)||null)))},[c,l]),h=A.useRef(null),d=A.useCallback(f=>{f.stopPropagation(),o(!1),r(null),h.current&&(clearTimeout(h.current),h.current=null)},[o,r]),p=A.useCallback(f=>{var w;const y=f.intersections.map(b=>b.object)[0];if((w=y==null?void 0:y.userData)!=null&&w.ref_id){const b=y.userData;l(b)||(f.stopPropagation(),o(!0),h.current=setTimeout(()=>{r(b)},ok))}},[r,l,o]),m=n&&!!i;return L.jsxs(Bf,{filter:f=>f.filter(_=>{var y;return!!((y=_.userData)!=null&&y.ref_id)}),onChange:u,onPointerOut:d,onPointerOver:p,children:[L.jsx(vd,{}),L.jsx("group",{name:"simulation-3d-group__nodes",visible:!m,children:a==null?void 0:a.nodes.map(f=>{const _=!!i&&(e.includes(f.ref_id)||i.ref_id===f.ref_id);return L.jsxs("mesh",{name:"wr2",userData:f,children:[L.jsx("boxGeometry",{args:[40,40,40]}),L.jsx("meshStandardMaterial",{opacity:0,transparent:!0}),L.jsx(Mc,{hide:m||_,isHovered:!!t&&t.id===f.ref_id,node:f},f.ref_id||f.id)]},f.ref_id)})}),L.jsx("group",{name:"simulation-3d-group__node-points",children:L.jsx(Yv,{})}),m&&L.jsx(wd,{})]})});bd.displayName="Cubes";const ak={earthRef:null},ck=Hl(i=>({...ak,setEarthRef:t=>i({earthRef:t})})),lk=new rt(0,0,0),uk=()=>{const i=A.useRef(null),t=A.useRef(null),{graphStyle:e,showSelectionGraph:s}=oe(a=>a),n=ck(a=>a.setEarthRef),r=Ks("textures/earth/galaxy.png"),o=Ks("textures/earth/clouds.png");return be(({camera:a})=>{t.current&&t.current.position.copy(a.getWorldPosition(lk))}),A.useLayoutEffect(()=>{i.current&&n(i)},[n]),e!=="earth"||s?null:L.jsxs(L.Fragment,{children:[L.jsxs("mesh",{ref:i,userData:{type:"earth"},children:[L.jsx("sphereGeometry",{args:[Er,200,200]}),L.jsx(hk,{})]}),L.jsxs("mesh",{children:[L.jsx("sphereGeometry",{args:[Er+2,200,200]}),L.jsx("meshStandardMaterial",{alphaMap:o,map:o,transparent:!0})]}),L.jsxs("mesh",{children:[L.jsx("sphereGeometry",{args:[Er*4,200,200]}),L.jsx("meshStandardMaterial",{map:r,opacity:.4,side:ra,transparent:!0})]}),L.jsx("directionalLight",{ref:t,intensity:.9,position:[0,0,Er*3]})]})},hk=()=>{const i=Ks("textures/earth/earth.jpeg"),t=Ks("textures/earth/bump.jpeg"),e=Ks("textures/earth/water.png"),s=A.useMemo(()=>new sr({map:i,bumpMap:t,aoMap:t,roughnessMap:t,metalnessMap:e,toneMapped:!0,roughness:35,metalness:0}),[i,t,e]);return L.jsx("meshStandardMaterial",{...s})},dk="C",fk=256,pk=256,mk={g:"LottieFiles AE 0.1.20"},_k=[{ty:0,nm:"I",sr:1,st:0,op:26,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_0",ind:1},{ty:0,nm:"I",sr:1,st:26,op:52,ip:26,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_1",ind:2},{ty:0,nm:"I",sr:1,st:52,op:78,ip:52,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_2",ind:3},{ty:0,nm:"I",sr:1,st:78,op:108,ip:78,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_3",ind:4}],gk="5.5.7",yk=60,vk=104,kk=0,xk=[{nm:"",id:"comp_0",layers:[{ty:4,nm:"I",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.656,.016],[0,20],[-34.641,0],[.016,-19.984]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,10],[17.321,30],[17.321,-10],[51.962,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,-9.984],[17.32,10],[17.32,-30],[-17.32,-50.016]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,30],[17.32,50],[17.305,10],[-17.32,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.321,10],[-51.962,30],[-51.962,-10],[-17.321,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[0,20],[-34.641,0],[0,-20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:1}]},{nm:"",id:"comp_1",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"S",sr:1,st:-20,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,-10.016],[-17.32,-30],[17.32,-50],[51.961,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[.015,-20],[0,20],[34.641,40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,-10.016],[-17.32,-30],[17.32,-50],[51.961,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:33,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.324,30],[-17.34,-9.984],[17.336,-30.016],[17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:35,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[.015,-20],[0,20],[34.641,40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.324,30],[-17.34,-9.984],[17.336,-30.016],[17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.305,30],[-17.336,-9.984],[17.336,-30.016],[17.32,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.016,-20.016],[-34.643,-40],[-34.641,.016],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:31,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,-10],[17.321,30],[-17.321,10],[-17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.305,50],[-51.961,30],[-17.321,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:10,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:34,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.305,30],[-17.336,-9.984],[17.336,-30.016],[17.32,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:11,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,-10],[17.321,30],[-17.321,10],[-17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.305,50],[-51.961,30],[-17.321,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:12,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.016,-20.016],[-34.643,-40],[-34.641,.016],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:13,parent:1}]},{nm:"",id:"comp_2",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"T",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-34.656,.031],[.047,-19.969],[34.652,.031],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[17.32,-9.984],[17.32,-50],[-17.32,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"F",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.321,30],[-51.962,10],[-51.962,-30],[-17.321,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"S",sr:1,st:0,op:30,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[17.32,-9.984],[17.32,-50],[-17.32,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"F",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,30],[17.321,10],[17.321,-30],[51.962,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"S",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,50],[17.32,30],[17.336,-10],[-17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"F",sr:1,st:0,op:30,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,30],[17.321,10],[17.321,-30],[51.962,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"T",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-34.656,0],[.015,-20],[34.656,0],[.012,20.062]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1}]},{nm:"",id:"comp_3",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"S",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-10],[-17.32,-30.016],[-51.961,-10],[-17.305,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"T",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.015,60.016],[-34.642,40],[-34.641,0],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[-17.32,-30],[17.32,-10],[17.32,30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.312,-10],[-17.313,10],[17.332,30],[51.977,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"F",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-29.984],[17.348,10],[-17.305,30],[-17.305,-9.984]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"F",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-30],[17.32,10],[-17.32,30],[-17.336,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-10],[-17.32,-30.016],[-51.961,-10],[-17.305,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"T",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[0,-20],[0,-60.016],[34.641,-40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"S",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[-17.32,-30],[17.32,-10],[17.32,30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.312,-10],[-17.313,10],[17.332,30],[51.977,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1},{ty:4,nm:"F",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-30],[17.32,10],[-17.32,30],[-17.336,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:10,parent:1}]}],Tk={nm:dk,h:fk,w:pk,meta:mk,layers:_k,v:gk,fr:yk,op:vk,ip:kk,assets:xk},wk=({meshId:i})=>{const t=A.useRef(null);return A.useEffect(()=>{const e=document.getElementById(`lottie-animation-${i}`);return e&&(t.current=Md.loadAnimation({container:e,animationData:Tk,loop:!0,autoplay:!0})),()=>{t.current&&t.current.destroy()}},[i]),L.jsx("div",{id:`lottie-animation-${i}`,style:{width:"2em",height:"2em"}})},na=()=>Math.floor(Math.random()*2001)-1e3,bk=()=>L.jsx(L.Fragment,{children:["a","b","c"].map(i=>{const t=na(),e=na(),s=na();return L.jsx("mesh",{position:[t,e,s],children:L.jsx(tr,{center:!0,sprite:!0,children:L.jsx(Ck,{children:L.jsx(wk,{meshId:i})})})},i)})}),Ck=qt.div` border: 2px solid white; border-radius: 50%; display: flex; @@ -571,7 +571,7 @@ ${a}`}const Mc=A.memo(({node:i,hide:t,isHovered:e})=>{var g,T;const s=A.useRef(n justify-content: center; color: white; font-size: 20px; -`,yi=i=>({close:{backgroundColor:"rgba(48, 51, 66, 1)",borderColor:"#fff",fontColor:"rgba(255, 255, 255, 1)"},focus:{backgroundColor:i?"rgba(255, 255, 255, 0.90);":"rgba(255, 255, 255, 0.90)",borderColor:i?"#FFDB58bb":"#fff",fontColor:"rgba(48, 51, 66, 1)"},menu:{backgroundColor:"#00000066",borderColor:i?"#ffffff66":"#5078f2",fontColor:i?"#ffffff66":"#fff"}}),Sk=new rt,Cd=A.memo(()=>{var x;const i=A.useRef(null),t=Ji(k=>k.setSidebarOpen),[e,s]=Dd.useState(null),{open:n}=pr("editNodeName"),{open:r}=pr("addEdgeToNode"),{open:o}=pr("mergeToNode"),{open:a}=pr("createBounty"),[c]=Yl(k=>[k.isAdmin]),[l]=Us(k=>[k.addNewNode]),u=We(),{showSelectionGraph:h,selectionGraphData:d,setSelectedNode:f,setShowSelectionGraph:_}=oe(k=>k),p=Df(),m=A.useCallback(async()=>{try{if(u!=null&&u.ref_id){const k=await Pd(u==null?void 0:u.ref_id,d.nodes.length||0);k&&l(k)}}catch(k){console.log(k)}},[l,u==null?void 0:u.ref_id,d.nodes.length]);be(()=>{y()});const y=A.useCallback(()=>{const k=h?d:p;if(i.current){const C=k==null?void 0:k.nodes.find(M=>M.ref_id===(u==null?void 0:u.ref_id));if(C){const M=Sk.set(C==null?void 0:C.x,C==null?void 0:C.y,C==null?void 0:C.z);i.current.position.copy(M)}}},[u,h,d,p]),w=A.useMemo(()=>{const k=c?[{key:"control-key-1",colors:yi(h).focus,icon:L.jsx(of,{}),left:-80,className:"add",onClick:M=>{s(M.currentTarget)}},{key:"control-key-2",colors:yi(h).focus,icon:L.jsx(af,{}),left:-40,className:"edit",onClick:()=>{n()}}]:[],C=[{key:"control-key-4",colors:yi(h).focus,icon:L.jsx(Af,{}),left:0,className:"expand",onClick:()=>{const M=!h;_(M),M&&t(!0)}},{key:"control-key-5",colors:yi(!0).close,icon:L.jsx(cf,{}),left:40,className:"exit",onClick:()=>{m()}},{key:"control-key-6",colors:yi(!0).close,icon:L.jsx(Mf,{}),left:40,className:"exit",onClick:()=>{_(!1),f(null)}}];return[...k,...C].map((M,R)=>({...M,left:-80+R*40}))},[c,h,n,_,t,m,f]);if(!u)return null;const b=()=>{s(null)},v=!!e,g=v?"simple-popover":void 0,T=!!(u&&((x=u==null?void 0:u.node_type)==null?void 0:x.toLowerCase())==="function");return L.jsx("group",{ref:i,children:L.jsxs(tr,{center:!0,className:"control-panel",onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),onPointerDown:k=>k.stopPropagation(),onPointerOut:k=>k.stopPropagation(),onPointerOver:k=>k.stopPropagation(),onPointerUp:k=>k.stopPropagation(),sprite:!0,zIndexRange:[16777271,16777272],children:[w.map(k=>L.jsx(Ek,{backgroundColor:k.colors.backgroundColor,borderColor:k.colors.borderColor,className:k.className,fontColor:k.colors.fontColor,left:k.left,onClick:C=>{C.stopPropagation(),k.onClick(C)},children:k.icon},k.key)),T&&L.jsx(Ak,{left:2,onClick:()=>{a()},children:"Create Test"}),L.jsxs(Ok,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:g,onClose:b,open:v,transformOrigin:{vertical:"top",horizontal:"right"},children:[L.jsxs(Wl,{"data-testid":"merge",onClick:()=>{o(),b()},children:[L.jsx(nf,{"data-testid":"MergeIcon"})," Merge"]}),L.jsxs(Wl,{"data-testid":"add_edge",onClick:()=>{r(),b()},children:[L.jsx(rf,{"data-testid":"AddCircleIcon"})," Add edge"]})]})]})})});Cd.displayName="NodeControls";const Ek=qt.div` +`,yi=i=>({close:{backgroundColor:"rgba(48, 51, 66, 1)",borderColor:"#fff",fontColor:"rgba(255, 255, 255, 1)"},focus:{backgroundColor:i?"rgba(255, 255, 255, 0.90);":"rgba(255, 255, 255, 0.90)",borderColor:i?"#FFDB58bb":"#fff",fontColor:"rgba(48, 51, 66, 1)"},menu:{backgroundColor:"#00000066",borderColor:i?"#ffffff66":"#5078f2",fontColor:i?"#ffffff66":"#fff"}}),Sk=new rt,Cd=A.memo(()=>{var T;const i=A.useRef(null),t=Ji(k=>k.setSidebarOpen),[e,s]=Dd.useState(null),{open:n}=pr("editNodeName"),{open:r}=pr("addEdgeToNode"),{open:o}=pr("mergeToNode"),{open:a}=pr("createBounty"),[c]=Yl(k=>[k.isAdmin]),[l]=Us(k=>[k.addNewNode]),u=We(),{showSelectionGraph:h,selectionGraphData:d,setSelectedNode:p,setShowSelectionGraph:m}=oe(k=>k),f=Df(),_=A.useCallback(async()=>{try{if(u!=null&&u.ref_id){const k=await Pd(u==null?void 0:u.ref_id,d.nodes.length||0);k&&l(k)}}catch(k){console.log(k)}},[l,u==null?void 0:u.ref_id,d.nodes.length]);be(()=>{y()});const y=A.useCallback(()=>{const k=h?d:f;if(i.current){const C=k==null?void 0:k.nodes.find(M=>M.ref_id===(u==null?void 0:u.ref_id));if(C){const M=Sk.set(C==null?void 0:C.x,C==null?void 0:C.y,C==null?void 0:C.z);i.current.position.copy(M)}}},[u,h,d,f]),w=A.useMemo(()=>{const k=c?[{key:"control-key-1",colors:yi(h).focus,icon:L.jsx(of,{}),left:-80,className:"add",onClick:M=>{s(M.currentTarget)}},{key:"control-key-2",colors:yi(h).focus,icon:L.jsx(af,{}),left:-40,className:"edit",onClick:()=>{n()}}]:[],C=[{key:"control-key-4",colors:yi(h).focus,icon:L.jsx(Af,{}),left:0,className:"expand",onClick:()=>{const M=!h;m(M),M&&t(!0)}},{key:"control-key-5",colors:yi(!0).close,icon:L.jsx(cf,{}),left:40,className:"exit",onClick:()=>{_()}},{key:"control-key-6",colors:yi(!0).close,icon:L.jsx(Mf,{}),left:40,className:"exit",onClick:()=>{m(!1),p(null)}}];return[...k,...C].map((M,R)=>({...M,left:-80+R*40}))},[c,h,n,m,t,_,p]);if(!u)return null;const b=()=>{s(null)},v=!!e,g=v?"simple-popover":void 0,x=!!(u&&((T=u==null?void 0:u.node_type)==null?void 0:T.toLowerCase())==="function");return L.jsx("group",{ref:i,children:L.jsxs(tr,{center:!0,className:"control-panel",onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),onPointerDown:k=>k.stopPropagation(),onPointerOut:k=>k.stopPropagation(),onPointerOver:k=>k.stopPropagation(),onPointerUp:k=>k.stopPropagation(),sprite:!0,zIndexRange:[16777271,16777272],children:[w.map(k=>L.jsx(Ek,{backgroundColor:k.colors.backgroundColor,borderColor:k.colors.borderColor,className:k.className,fontColor:k.colors.fontColor,left:k.left,onClick:C=>{C.stopPropagation(),k.onClick(C)},children:k.icon},k.key)),x&&L.jsx(Ak,{left:2,onClick:()=>{a()},children:"Create Test"}),L.jsxs(Ok,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:g,onClose:b,open:v,transformOrigin:{vertical:"top",horizontal:"right"},children:[L.jsxs(Wl,{"data-testid":"merge",onClick:()=>{o(),b()},children:[L.jsx(nf,{"data-testid":"MergeIcon"})," Merge"]}),L.jsxs(Wl,{"data-testid":"add_edge",onClick:()=>{r(),b()},children:[L.jsx(rf,{"data-testid":"AddCircleIcon"})," Add edge"]})]})]})})});Cd.displayName="NodeControls";const Ek=qt.div` position: fixed; top: -60px; left: ${i=>-7+i.left}px; @@ -635,7 +635,7 @@ ${a}`}const Mc=A.memo(({node:i,hide:t,isHovered:e})=>{var g,T;const s=A.useRef(n &:hover { transform: scale(1.05); } -`,Sd=A.memo(()=>L.jsx(L.Fragment,{children:L.jsx(Cd,{})}));Sd.displayName="NodeDetailsPanel";const Mk=()=>{const{dataInitial:i,isLoadingNew:t,isFetching:e,dataNew:s,resetDataNew:n}=Us(_=>_),r=A.useRef(null),o=A.useRef(!1),a=A.useRef([]),{setData:c,simulation:l,simulationCreate:u,simulationHelpers:h,graphStyle:d,setGraphRadius:f}=oe(_=>_);return A.useEffect(()=>{if(!s)return;const _=s.nodes||[],p=s.links||[],m=structuredClone(_),y=structuredClone(p);if(l){const w=Nd.isEqual(s,i);h.addNodesAndLinks(m,y,w)}l||u(m,y),n()},[c,s,l,u,n,h,i]),A.useEffect(()=>{l&&h.setForces()},[d,h,l]),A.useEffect(()=>{l&&(l.on("tick",()=>{if(!o.current&&l.alpha()<.1){const _=l.nodes().map(w=>new rt(w.x,w.y,w.z)),p=new Rc().setFromPoints(_),m=new Fc;p.getBoundingSphere(m);const y=Math.min(5e3,m.radius);f(y),o.current=!0}if(r.current){const _=r.current.getObjectByName("simulation-3d-group__nodes"),p=r.current.getObjectByName("simulation-3d-group__node-points"),m=r.current.getObjectByName("simulation-3d-group__connections");_.children.forEach((y,w)=>{const b=l.nodes()[w];b&&y.position.set(b.x,b.y,b.z)}),p&&p.children[0].children.forEach((y,w)=>{const b=l.nodes()[w];b&&y.position.set(b.x,b.y,b.z)}),m.children.forEach((y,w)=>{const b=i==null?void 0:i.links[w],v=y;if(b){const g=l.nodes().find(W=>W.ref_id===b.source),T=l.nodes().find(W=>W.ref_id===b.target),{x,y:k,z:C}=g,{x:M,y:R,z:P}=T;a.current[w]={sx:x,sy:k,sz:C,tx:M,ty:R,tz:P},v.geometry.setPositions([x,k,C,M,R,P]);const{material:U}=v;U.color=new go("white"),U.transparent=!0,U.opacity=.1}})}}),l.on("end",()=>{const _=l.nodes().map(w=>new rt(w.x,w.y,w.z)),p=new Rc().setFromPoints(_),m=new Fc;p.getBoundingSphere(m);const y=m.radius;f(y),o.current=!1}))},[i,l,f]),l?L.jsxs("group",{ref:r,children:[L.jsx(bd,{}),L.jsx(uk,{}),(t||e)&&L.jsx(bk,{}),d!=="earth"&&L.jsx(yd,{linksPositions:a.current}),L.jsx(Sd,{})]}):null},Dk=({fullSize:i=!0})=>{const t=Ji(e=>e.sidebarIsOpen);return L.jsx(Pk,{align:"center",className:Xl({"sidebar-is-open":t&&!i}),justify:"center",children:L.jsx(Pf,{color:Tt.SECONDARY_BLUE,size:64})})},Pk=qt(ys)` +`,Sd=A.memo(()=>L.jsx(L.Fragment,{children:L.jsx(Cd,{})}));Sd.displayName="NodeDetailsPanel";const Mk=()=>{const{dataInitial:i,isLoadingNew:t,isFetching:e,dataNew:s,resetDataNew:n}=Us(m=>m),r=A.useRef(null),o=A.useRef(!1),a=A.useRef([]),{setData:c,simulation:l,simulationCreate:u,simulationHelpers:h,graphStyle:d,setGraphRadius:p}=oe(m=>m);return A.useEffect(()=>{if(!s)return;const m=s.nodes||[],f=s.links||[],_=structuredClone(m),y=structuredClone(f);if(l){const w=Nd.isEqual(s,i);h.addNodesAndLinks(_,y,w)}l||u(_,y),n()},[c,s,l,u,n,h,i]),A.useEffect(()=>{l&&h.setForces()},[d,h,l]),A.useEffect(()=>{l&&(l.on("tick",()=>{if(!o.current&&l.alpha()<.1){const m=l.nodes().map(w=>new rt(w.x,w.y,w.z)),f=new Rc().setFromPoints(m),_=new Fc;f.getBoundingSphere(_);const y=Math.min(5e3,_.radius);p(y),o.current=!0}if(r.current){const m=r.current.getObjectByName("simulation-3d-group__nodes"),f=r.current.getObjectByName("simulation-3d-group__node-points"),_=r.current.getObjectByName("simulation-3d-group__connections");m.children.forEach((y,w)=>{const b=l.nodes()[w];b&&y.position.set(b.x,b.y,b.z)}),f&&f.children[0].children.forEach((y,w)=>{const b=l.nodes()[w];b&&y.position.set(b.x,b.y,b.z)}),_.children.forEach((y,w)=>{const b=i==null?void 0:i.links[w],v=y;if(b){const g=l.nodes().find(W=>W.ref_id===b.source),x=l.nodes().find(W=>W.ref_id===b.target),{x:T,y:k,z:C}=g,{x:M,y:R,z:P}=x;a.current[w]={sx:T,sy:k,sz:C,tx:M,ty:R,tz:P},v.geometry.setPositions([T,k,C,M,R,P]);const{material:U}=v;U.color=new go("white"),U.transparent=!0,U.opacity=.1}})}}),l.on("end",()=>{const m=l.nodes().map(w=>new rt(w.x,w.y,w.z)),f=new Rc().setFromPoints(m),_=new Fc;f.getBoundingSphere(_);const y=_.radius;p(y),o.current=!1}))},[i,l,p]),l?L.jsxs("group",{ref:r,children:[L.jsx(bd,{}),L.jsx(uk,{}),(t||e)&&L.jsx(bk,{}),d!=="earth"&&L.jsx(yd,{linksPositions:a.current}),L.jsx(Sd,{})]}):null},Dk=({fullSize:i=!0})=>{const t=Ji(e=>e.sidebarIsOpen);return L.jsx(Pk,{align:"center",className:Xl({"sidebar-is-open":t&&!i}),justify:"center",children:L.jsx(Pf,{color:Tt.SECONDARY_BLUE,size:64})})},Pk=qt(ys)` position: absolute; left: 0; right: 0; diff --git a/build/assets/index-d70b7e8e.js b/build/assets/index-fabd940a.js similarity index 64% rename from build/assets/index-d70b7e8e.js rename to build/assets/index-fabd940a.js index 0f36dafc3..bbb2552c6 100644 --- a/build/assets/index-d70b7e8e.js +++ b/build/assets/index-fabd940a.js @@ -1,4 +1,4 @@ -import{t as i,j as t,v as a}from"./index-69dca385.js";import{f as n}from"./index.esm-86c83cdb.js";import{ba as e}from"./index-94c3c981.js";const r=i.div` +import{t as i,j as t,v as a}from"./index-b856be88.js";import{f as n}from"./index.esm-c2a09dd4.js";import{ba as e}from"./index-c59af388.js";const r=i.div` display: Flex; justify-content: center; align-items: center; diff --git a/build/assets/index.esm-86c83cdb.js b/build/assets/index.esm-c2a09dd4.js similarity index 98% rename from build/assets/index.esm-86c83cdb.js rename to build/assets/index.esm-c2a09dd4.js index c0a242642..037d5f9a4 100644 --- a/build/assets/index.esm-86c83cdb.js +++ b/build/assets/index.esm-c2a09dd4.js @@ -1 +1 @@ -import{R as c}from"./index-69dca385.js";var u={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},g=c.createContext&&c.createContext(u),i=globalThis&&globalThis.__assign||function(){return i=Object.assign||function(t){for(var a,e=1,r=arguments.length;e{const{classes:r,checked:a,disabled:n,edge:s}=e,t={root:["root",a&&"checked",n&&"disabled",s&&`edge${H(s)}`],input:["input"]};return be(t,ar,r)},sr=M(rr)(({ownerState:e})=>S({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),ir=M("input",{shouldForwardProp:Ne})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),or=U.forwardRef(function(r,a){const{autoFocus:n,checked:s,checkedIcon:t,className:i,defaultChecked:o,disabled:l,disableFocusRipple:c=!1,edge:d=!1,icon:f,id:u,inputProps:h,inputRef:p,name:g,onBlur:b,onChange:y,onFocus:v,readOnly:O,required:$=!1,tabIndex:m,type:P,value:E}=r,A=ge(r,nr),[w,xe]=je({controlled:s,default:!!o,name:"SwitchBase",state:"checked"}),C=$e(),Me=_=>{v&&v(_),C&&C.onFocus&&C.onFocus(_)},Be=_=>{b&&b(_),C&&C.onBlur&&C.onBlur(_)},qe=_=>{if(_.nativeEvent.defaultPrevented)return;const Q=_.target.checked;xe(Q),y&&y(_,Q)};let I=l;C&&typeof I>"u"&&(I=C.disabled);const De=P==="checkbox"||P==="radio",D=S({},r,{checked:w,disabled:I,disableFocusRipple:c,edge:d}),J=tr(D);return L.jsxs(sr,S({component:"span",className:K(J.root,i),centerRipple:!0,focusRipple:!c,disabled:I,tabIndex:null,role:void 0,onFocus:Me,onBlur:Be,ownerState:D,ref:a},A,{children:[L.jsx(ir,S({autoFocus:n,checked:s,defaultChecked:o,className:J.input,disabled:I,id:De?u:void 0,name:g,onChange:qe,readOnly:O,ref:p,required:$,ownerState:D,tabIndex:m,type:P},P==="checkbox"&&E===void 0?{}:{value:E},h)),w?t:f]}))}),is=or;function lr(e){return de("MuiFormControlLabel",e)}const ur=pe("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),F=ur,cr=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],fr=e=>{const{classes:r,disabled:a,labelPlacement:n,error:s,required:t}=e,i={root:["root",a&&"disabled",`labelPlacement${H(n)}`,s&&"error",t&&"required"],label:["label",a&&"disabled"],asterisk:["asterisk",s&&"error"]};return be(i,lr,r)},dr=M("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[{[`& .${F.label}`]:r.label},r.root,r[`labelPlacement${H(a.labelPlacement)}`]]}})(({theme:e,ownerState:r})=>S({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${F.disabled}`]:{cursor:"default"}},r.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},r.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},r.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${F.label}`]:{[`&.${F.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),pr=M("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,r)=>r.asterisk})(({theme:e})=>({[`&.${F.error}`]:{color:(e.vars||e).palette.error.main}})),gr=U.forwardRef(function(r,a){var n,s;const t=Ge({props:r,name:"MuiFormControlLabel"}),{className:i,componentsProps:o={},control:l,disabled:c,disableTypography:d,label:f,labelPlacement:u="end",required:h,slotProps:p={}}=t,g=ge(t,cr),b=$e(),y=(n=c??l.props.disabled)!=null?n:b==null?void 0:b.disabled,v=h??l.props.required,O={disabled:y,required:v};["checked","name","onChange","value","inputRef"].forEach(w=>{typeof l.props[w]>"u"&&typeof t[w]<"u"&&(O[w]=t[w])});const $=Ve({props:t,muiFormControl:b,states:["error"]}),m=S({},t,{disabled:y,labelPlacement:u,required:v,error:$.error}),P=fr(m),E=(s=p.typography)!=null?s:o.typography;let A=f;return A!=null&&A.type!==W&&!d&&(A=L.jsx(W,S({component:"span"},E,{className:K(P.label,E==null?void 0:E.className),children:A}))),L.jsxs(dr,S({className:K(P.root,i),ownerState:m,ref:a},g,{children:[U.cloneElement(l,O),v?L.jsxs(er,{display:"block",children:[A,L.jsxs(pr,{ownerState:m,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):A]}))}),os=gr;var br=k,hr=T,vr=B,yr="[object String]";function mr(e){return typeof e=="string"||!hr(e)&&vr(e)&&br(e)==yr}var _r=mr;const ls=z(_r);function $r(e){return function(r,a,n){for(var s=-1,t=Object(r),i=n(r),o=i.length;o--;){var l=i[e?o:++s];if(a(t[l],l,t)===!1)break}return r}}var Pr=$r,Ar=Pr,Cr=Ar(),Sr=Cr,Tr=Sr,Or=he;function wr(e,r){return e&&Tr(e,r,Or)}var Er=wr;function Lr(e){return e}var Ir=Lr,Fr=k,Rr=Ue,xr=B,Mr="[object Object]",Br=Function.prototype,qr=Object.prototype,Pe=Br.toString,Dr=qr.hasOwnProperty,Nr=Pe.call(Object);function Gr(e){if(!xr(e)||Fr(e)!=Mr)return!1;var r=Rr(e);if(r===null)return!0;var a=Dr.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&Pe.call(a)==Nr}var Ur=Gr;const us=z(Ur);function Kr(e,r){for(var a=-1,n=e==null?0:e.length,s=Array(n);++ao))return!1;var c=t.get(e),d=t.get(r);if(c&&d)return c==r&&d==e;var f=-1,u=!0,h=a&ia?new aa:void 0;for(t.set(e,r),t.set(r,e);++f{const{classes:r,checked:a,disabled:n,edge:s}=e,t={root:["root",a&&"checked",n&&"disabled",s&&`edge${H(s)}`],input:["input"]};return be(t,ar,r)},sr=M(rr)(({ownerState:e})=>S({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),ir=M("input",{shouldForwardProp:Ne})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),or=U.forwardRef(function(r,a){const{autoFocus:n,checked:s,checkedIcon:t,className:i,defaultChecked:o,disabled:l,disableFocusRipple:c=!1,edge:d=!1,icon:f,id:u,inputProps:h,inputRef:p,name:g,onBlur:b,onChange:y,onFocus:v,readOnly:O,required:$=!1,tabIndex:m,type:P,value:E}=r,A=ge(r,nr),[w,xe]=je({controlled:s,default:!!o,name:"SwitchBase",state:"checked"}),C=$e(),Me=_=>{v&&v(_),C&&C.onFocus&&C.onFocus(_)},Be=_=>{b&&b(_),C&&C.onBlur&&C.onBlur(_)},qe=_=>{if(_.nativeEvent.defaultPrevented)return;const Q=_.target.checked;xe(Q),y&&y(_,Q)};let I=l;C&&typeof I>"u"&&(I=C.disabled);const De=P==="checkbox"||P==="radio",D=S({},r,{checked:w,disabled:I,disableFocusRipple:c,edge:d}),J=tr(D);return L.jsxs(sr,S({component:"span",className:K(J.root,i),centerRipple:!0,focusRipple:!c,disabled:I,tabIndex:null,role:void 0,onFocus:Me,onBlur:Be,ownerState:D,ref:a},A,{children:[L.jsx(ir,S({autoFocus:n,checked:s,defaultChecked:o,className:J.input,disabled:I,id:De?u:void 0,name:g,onChange:qe,readOnly:O,ref:p,required:$,ownerState:D,tabIndex:m,type:P},P==="checkbox"&&E===void 0?{}:{value:E},h)),w?t:f]}))}),is=or;function lr(e){return de("MuiFormControlLabel",e)}const ur=pe("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),F=ur,cr=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],fr=e=>{const{classes:r,disabled:a,labelPlacement:n,error:s,required:t}=e,i={root:["root",a&&"disabled",`labelPlacement${H(n)}`,s&&"error",t&&"required"],label:["label",a&&"disabled"],asterisk:["asterisk",s&&"error"]};return be(i,lr,r)},dr=M("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[{[`& .${F.label}`]:r.label},r.root,r[`labelPlacement${H(a.labelPlacement)}`]]}})(({theme:e,ownerState:r})=>S({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${F.disabled}`]:{cursor:"default"}},r.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},r.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},r.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${F.label}`]:{[`&.${F.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),pr=M("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,r)=>r.asterisk})(({theme:e})=>({[`&.${F.error}`]:{color:(e.vars||e).palette.error.main}})),gr=U.forwardRef(function(r,a){var n,s;const t=Ge({props:r,name:"MuiFormControlLabel"}),{className:i,componentsProps:o={},control:l,disabled:c,disableTypography:d,label:f,labelPlacement:u="end",required:h,slotProps:p={}}=t,g=ge(t,cr),b=$e(),y=(n=c??l.props.disabled)!=null?n:b==null?void 0:b.disabled,v=h??l.props.required,O={disabled:y,required:v};["checked","name","onChange","value","inputRef"].forEach(w=>{typeof l.props[w]>"u"&&typeof t[w]<"u"&&(O[w]=t[w])});const $=Ve({props:t,muiFormControl:b,states:["error"]}),m=S({},t,{disabled:y,labelPlacement:u,required:v,error:$.error}),P=fr(m),E=(s=p.typography)!=null?s:o.typography;let A=f;return A!=null&&A.type!==W&&!d&&(A=L.jsx(W,S({component:"span"},E,{className:K(P.label,E==null?void 0:E.className),children:A}))),L.jsxs(dr,S({className:K(P.root,i),ownerState:m,ref:a},g,{children:[U.cloneElement(l,O),v?L.jsxs(er,{display:"block",children:[A,L.jsxs(pr,{ownerState:m,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):A]}))}),os=gr;var br=k,hr=T,vr=B,yr="[object String]";function mr(e){return typeof e=="string"||!hr(e)&&vr(e)&&br(e)==yr}var _r=mr;const ls=z(_r);function $r(e){return function(r,a,n){for(var s=-1,t=Object(r),i=n(r),o=i.length;o--;){var l=i[e?o:++s];if(a(t[l],l,t)===!1)break}return r}}var Pr=$r,Ar=Pr,Cr=Ar(),Sr=Cr,Tr=Sr,Or=he;function wr(e,r){return e&&Tr(e,r,Or)}var Er=wr;function Lr(e){return e}var Ir=Lr,Fr=k,Rr=Ue,xr=B,Mr="[object Object]",Br=Function.prototype,qr=Object.prototype,Pe=Br.toString,Dr=qr.hasOwnProperty,Nr=Pe.call(Object);function Gr(e){if(!xr(e)||Fr(e)!=Mr)return!1;var r=Rr(e);if(r===null)return!0;var a=Dr.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&Pe.call(a)==Nr}var Ur=Gr;const us=z(Ur);function Kr(e,r){for(var a=-1,n=e==null?0:e.length,s=Array(n);++ao))return!1;var c=t.get(e),d=t.get(r);if(c&&d)return c==r&&d==e;var f=-1,u=!0,h=a&ia?new aa:void 0;for(t.set(e,r),t.set(r,e);++f Second Brain - +