From 7f87e563db35c56cdea4fd5ff7ef2da9537a6e71 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Thu, 24 Oct 2024 16:55:34 +0000 Subject: [PATCH] ci: automatic build fixes --- ...der-3e52df85.js => ClipLoader-e049ef5e.js} | 2 +- ...on-151f0a1e.js => DailyMotion-542adefd.js} | 2 +- ...ebook-efd3df3f.js => Facebook-3300d9ca.js} | 2 +- ...yer-07b6fa1b.js => FilePlayer-60739ed0.js} | 2 +- ...altura-eca24f7e.js => Kaltura-bc0b2095.js} | 2 +- ...cloud-7278c891.js => Mixcloud-ca20574f.js} | 2 +- ...review-44e8e206.js => Preview-2ad6d0ea.js} | 2 +- ...leton-af57499b.js => Skeleton-224a4953.js} | 2 +- ...oud-deab1d49.js => SoundCloud-a32ad7b2.js} | 2 +- .../{Stack-dcbf847f.js => Stack-57ab9e76.js} | 2 +- ...ble-5d47d4dc.js => Streamable-1d987e98.js} | 2 +- .../{Tabs-7a262088.js => Tabs-b82c05ad.js} | 2 +- ...73cbad.js => TextareaAutosize-6f8daf3f.js} | 4 +- ...{Twitch-9bb7747c.js => Twitch-d246f176.js} | 2 +- ...phy-5302f73b.js => Typography-543ae8c6.js} | 2 +- ...idyard-326cf564.js => Vidyard-4e893f64.js} | 2 +- .../{Vimeo-794f619c.js => Vimeo-797d4bed.js} | 2 +- ...{Wistia-b4231027.js => Wistia-8fb3c44b.js} | 2 +- ...ouTube-b4edb4e4.js => YouTube-c46c3d3c.js} | 2 +- ...ants-104c86df.js => constants-a86c243d.js} | 2 +- ...-5d2e26a6.js => createSvgIcon-7c6eee06.js} | 2 +- .../{index-023df127.js => index-0614cd43.js} | 2 +- .../{index-edbea3ee.js => index-1a6ba924.js} | 2 +- .../{index-146a182e.js => index-23519643.js} | 2 +- .../{index-e1867c29.js => index-28e22657.js} | 2 +- .../{index-52ffd3c1.js => index-47786f03.js} | 50 +- .../{index-4410528e.js => index-49403f56.js} | 10 +- .../{index-dfcc1a18.js => index-4cad102d.js} | 4 +- build/assets/index-615a69d5.js | 859 ------------------ .../{index-311f5e1d.js => index-69dca385.js} | 2 +- .../{index-b23283cd.js => index-6c23b30f.js} | 2 +- .../{index-b83fe05f.js => index-6eefb34c.js} | 2 +- .../{index-40985a8d.js => index-6f865e1f.js} | 8 +- build/assets/index-7d2b0c32.js | 649 +++++++++++++ build/assets/index-7d7c7f8c.js | 18 - build/assets/index-8bf7fe7b.js | 18 + .../{index-b3d504b4.js => index-94c3c981.js} | 6 +- .../{index-63a59983.js => index-a579da74.js} | 6 +- .../{index-9a08ebbb.js => index-a7628b9d.js} | 2 +- build/assets/index-b853c371.js | 47 + .../{index-e7f30eed.js => index-bd732748.js} | 2 +- .../{index-994f71d4.js => index-d70b7e8e.js} | 2 +- build/assets/index-dd2e0f5e.js | 47 - .../{index-ea411943.js => index-e0a45087.js} | 2 +- .../{index-44c82821.js => index-e780f823.js} | 6 +- .../{index-d6bbde2b.js => index-f0d2a829.js} | 2 +- .../{index-63ae9a26.js => index-f19bc108.js} | 4 +- .../{index-97c1e407.js => index-f27ea18e.js} | 8 +- .../{index-20836eed.js => index-ff6c14e9.js} | 4 +- ....esm-46402b6f.js => index.esm-86c83cdb.js} | 2 +- .../{map-1d4da850.js => map-85d405d6.js} | 2 +- ...e-ebe9f2a4.js => three.module-52004ab8.js} | 2 +- build/index.html | 2 +- 53 files changed, 805 insertions(+), 1015 deletions(-) rename build/assets/{ClipLoader-3e52df85.js => ClipLoader-e049ef5e.js} (97%) rename build/assets/{DailyMotion-151f0a1e.js => DailyMotion-542adefd.js} (95%) rename build/assets/{Facebook-efd3df3f.js => Facebook-3300d9ca.js} (96%) rename build/assets/{FilePlayer-07b6fa1b.js => FilePlayer-60739ed0.js} (98%) rename build/assets/{Kaltura-eca24f7e.js => Kaltura-bc0b2095.js} (95%) rename build/assets/{Mixcloud-7278c891.js => Mixcloud-ca20574f.js} (95%) rename build/assets/{Preview-44e8e206.js => Preview-2ad6d0ea.js} (97%) rename build/assets/{Skeleton-af57499b.js => Skeleton-224a4953.js} (97%) rename build/assets/{SoundCloud-deab1d49.js => SoundCloud-a32ad7b2.js} (95%) rename build/assets/{Stack-dcbf847f.js => Stack-57ab9e76.js} (99%) rename build/assets/{Streamable-5d47d4dc.js => Streamable-1d987e98.js} (95%) rename build/assets/{Tabs-7a262088.js => Tabs-b82c05ad.js} (88%) rename build/assets/{TextareaAutosize-8373cbad.js => TextareaAutosize-6f8daf3f.js} (58%) rename build/assets/{Twitch-9bb7747c.js => Twitch-d246f176.js} (95%) rename build/assets/{Typography-5302f73b.js => Typography-543ae8c6.js} (93%) rename build/assets/{Vidyard-326cf564.js => Vidyard-4e893f64.js} (95%) rename build/assets/{Vimeo-794f619c.js => Vimeo-797d4bed.js} (96%) rename build/assets/{Wistia-b4231027.js => Wistia-8fb3c44b.js} (96%) rename build/assets/{YouTube-b4edb4e4.js => YouTube-c46c3d3c.js} (97%) rename build/assets/{constants-104c86df.js => constants-a86c243d.js} (79%) rename build/assets/{createSvgIcon-5d2e26a6.js => createSvgIcon-7c6eee06.js} (97%) rename build/assets/{index-023df127.js => index-0614cd43.js} (94%) rename build/assets/{index-edbea3ee.js => index-1a6ba924.js} (96%) rename build/assets/{index-146a182e.js => index-23519643.js} (96%) rename build/assets/{index-e1867c29.js => index-28e22657.js} (88%) rename build/assets/{index-52ffd3c1.js => index-47786f03.js} (74%) rename build/assets/{index-4410528e.js => index-49403f56.js} (91%) rename build/assets/{index-dfcc1a18.js => index-4cad102d.js} (99%) delete mode 100644 build/assets/index-615a69d5.js rename build/assets/{index-311f5e1d.js => index-69dca385.js} (99%) rename build/assets/{index-b23283cd.js => index-6c23b30f.js} (90%) rename build/assets/{index-b83fe05f.js => index-6eefb34c.js} (57%) rename build/assets/{index-40985a8d.js => index-6f865e1f.js} (55%) create mode 100644 build/assets/index-7d2b0c32.js delete mode 100644 build/assets/index-7d7c7f8c.js create mode 100644 build/assets/index-8bf7fe7b.js rename build/assets/{index-b3d504b4.js => index-94c3c981.js} (98%) rename build/assets/{index-63a59983.js => index-a579da74.js} (74%) rename build/assets/{index-9a08ebbb.js => index-a7628b9d.js} (92%) create mode 100644 build/assets/index-b853c371.js rename build/assets/{index-e7f30eed.js => index-bd732748.js} (88%) rename build/assets/{index-994f71d4.js => index-d70b7e8e.js} (64%) delete mode 100644 build/assets/index-dd2e0f5e.js rename build/assets/{index-ea411943.js => index-e0a45087.js} (85%) rename build/assets/{index-44c82821.js => index-e780f823.js} (95%) rename build/assets/{index-d6bbde2b.js => index-f0d2a829.js} (69%) rename build/assets/{index-63ae9a26.js => index-f19bc108.js} (50%) rename build/assets/{index-97c1e407.js => index-f27ea18e.js} (61%) rename build/assets/{index-20836eed.js => index-ff6c14e9.js} (76%) rename build/assets/{index.esm-46402b6f.js => index.esm-86c83cdb.js} (98%) rename build/assets/{map-1d4da850.js => map-85d405d6.js} (98%) rename build/assets/{three.module-ebe9f2a4.js => three.module-52004ab8.js} (99%) diff --git a/build/assets/ClipLoader-3e52df85.js b/build/assets/ClipLoader-e049ef5e.js similarity index 97% rename from build/assets/ClipLoader-3e52df85.js rename to build/assets/ClipLoader-e049ef5e.js index 0733814d0..6a5f626ba 100644 --- a/build/assets/ClipLoader-3e52df85.js +++ b/build/assets/ClipLoader-e049ef5e.js @@ -1,4 +1,4 @@ -import{r as m}from"./index-311f5e1d.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-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=` @keyframes `.concat(r,` { `).concat(t,` } diff --git a/build/assets/DailyMotion-151f0a1e.js b/build/assets/DailyMotion-542adefd.js similarity index 95% rename from build/assets/DailyMotion-151f0a1e.js rename to build/assets/DailyMotion-542adefd.js index aaa790487..fc864ee15 100644 --- a/build/assets/DailyMotion-151f0a1e.js +++ b/build/assets/DailyMotion-542adefd.js @@ -1 +1 @@ -import{g as P,r as v}from"./index-311f5e1d.js";import{u as D,p as O}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Facebook-efd3df3f.js b/build/assets/Facebook-3300d9ca.js similarity index 96% rename from build/assets/Facebook-efd3df3f.js rename to build/assets/Facebook-3300d9ca.js index 1590ed925..e67a9e692 100644 --- a/build/assets/Facebook-efd3df3f.js +++ b/build/assets/Facebook-3300d9ca.js @@ -1 +1 @@ -import{g as _,r as g}from"./index-311f5e1d.js";import{u as P,p as m}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/FilePlayer-07b6fa1b.js b/build/assets/FilePlayer-60739ed0.js similarity index 98% rename from build/assets/FilePlayer-07b6fa1b.js rename to build/assets/FilePlayer-60739ed0.js index a3d8729c8..18b09b98a 100644 --- a/build/assets/FilePlayer-07b6fa1b.js +++ b/build/assets/FilePlayer-60739ed0.js @@ -1 +1 @@ -import{g as b,r as _}from"./index-311f5e1d.js";import{u as O,p as A}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Kaltura-eca24f7e.js b/build/assets/Kaltura-bc0b2095.js similarity index 95% rename from build/assets/Kaltura-eca24f7e.js rename to build/assets/Kaltura-bc0b2095.js index ddeb83c61..66d66b781 100644 --- a/build/assets/Kaltura-eca24f7e.js +++ b/build/assets/Kaltura-bc0b2095.js @@ -1 +1 @@ -import{g as y,r as f}from"./index-311f5e1d.js";import{u as _,p as m}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Mixcloud-7278c891.js b/build/assets/Mixcloud-ca20574f.js similarity index 95% rename from build/assets/Mixcloud-7278c891.js rename to build/assets/Mixcloud-ca20574f.js index b4cab05e2..6256f0ce3 100644 --- a/build/assets/Mixcloud-7278c891.js +++ b/build/assets/Mixcloud-ca20574f.js @@ -1 +1 @@ -import{g as _,r as f}from"./index-311f5e1d.js";import{u as m,p as g}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Preview-44e8e206.js b/build/assets/Preview-2ad6d0ea.js similarity index 97% rename from build/assets/Preview-44e8e206.js rename to build/assets/Preview-2ad6d0ea.js index 8399823cc..a969a4245 100644 --- a/build/assets/Preview-44e8e206.js +++ b/build/assets/Preview-2ad6d0ea.js @@ -1 +1 @@ -import{g as y,r as b}from"./index-311f5e1d.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-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}; diff --git a/build/assets/Skeleton-af57499b.js b/build/assets/Skeleton-224a4953.js similarity index 97% rename from build/assets/Skeleton-af57499b.js rename to build/assets/Skeleton-224a4953.js index 910f03712..71dc2c939 100644 --- a/build/assets/Skeleton-af57499b.js +++ b/build/assets/Skeleton-224a4953.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-311f5e1d.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-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` 0% { opacity: 1; } diff --git a/build/assets/SoundCloud-deab1d49.js b/build/assets/SoundCloud-a32ad7b2.js similarity index 95% rename from build/assets/SoundCloud-deab1d49.js rename to build/assets/SoundCloud-a32ad7b2.js index 63b5fc421..c3235b6f6 100644 --- a/build/assets/SoundCloud-deab1d49.js +++ b/build/assets/SoundCloud-a32ad7b2.js @@ -1 +1 @@ -import{g as P,r as g}from"./index-311f5e1d.js";import{u as b,p as v}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Stack-dcbf847f.js b/build/assets/Stack-57ab9e76.js similarity index 99% rename from build/assets/Stack-dcbf847f.js rename to build/assets/Stack-57ab9e76.js index 21e58dd9b..f1a4d086e 100644 --- a/build/assets/Stack-dcbf847f.js +++ b/build/assets/Stack-57ab9e76.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-311f5e1d.js";import{G as et,b9 as Xt,x as tt,y as rt,W as Yt}from"./index-b3d504b4.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-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}; diff --git a/build/assets/Streamable-5d47d4dc.js b/build/assets/Streamable-1d987e98.js similarity index 95% rename from build/assets/Streamable-5d47d4dc.js rename to build/assets/Streamable-1d987e98.js index cd70347c9..79ee60937 100644 --- a/build/assets/Streamable-5d47d4dc.js +++ b/build/assets/Streamable-1d987e98.js @@ -1 +1 @@ -import{g as m,r as f}from"./index-311f5e1d.js";import{u as _,p as b}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Tabs-7a262088.js b/build/assets/Tabs-b82c05ad.js similarity index 88% rename from build/assets/Tabs-7a262088.js rename to build/assets/Tabs-b82c05ad.js index 27271822f..a02e611eb 100644 --- a/build/assets/Tabs-7a262088.js +++ b/build/assets/Tabs-b82c05ad.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-311f5e1d.js";import{b4 as Nt,y as Zt,Q as $t,K as kt,W as lt,z as ut,G as te}from"./index-b3d504b4.js";import{c as Ft}from"./createSvgIcon-5d2e26a6.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,D=rt(i,re),Y=b({},i,{disabled:d,disableFocusRipple:h,selected:I,icon:!!u,iconPosition:m,label:!!T,fullWidth:p,textColor:H,wrapped:nt}),X=ne(Y),N=u&&T&&c.isValidElement(u)?c.cloneElement(u,{className:L(X.iconWrapper,u.props.className)}):u,Q=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(X.root,n),ref:r,role:"tab","aria-selected":I,disabled:d,onClick:Q,onFocus:_,ownerState:Y,tabIndex:I?0:-1},D,{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:D={},slotProps:Y={},TabIndicatorProps:X={},TabScrollButtonProps:N={},textColor:Q="primary",value:_,variant:R="standard",visibleScrollbar:st=!1}=i,Ot=rt(i,Te),E=R==="scrollable",B=g==="vertical",K=B?"scrollTop":"scrollLeft",J=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:Q,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:D.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:$}),Ht=lt({elementType:D.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:$}),[vt,Dt]=c.useState(!1),[k,mt]=c.useState(Wt),[xt,Xt]=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:D.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:D.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[J]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=>{Xt(!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(()=>{Dt(!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({},X,{className:L(W.indicator,X.className),ownerState:$,style:b({},k,X.style)}));let et=0;const Qt=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:Q,value:l},et===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Jt=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:Jt,ref:F,role:"tablist",children:Qt}),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-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}; diff --git a/build/assets/TextareaAutosize-8373cbad.js b/build/assets/TextareaAutosize-6f8daf3f.js similarity index 58% rename from build/assets/TextareaAutosize-8373cbad.js rename to build/assets/TextareaAutosize-6f8daf3f.js index 258b9a166..7c5581d32 100644 --- a/build/assets/TextareaAutosize-8373cbad.js +++ b/build/assets/TextareaAutosize-6f8daf3f.js @@ -1,2 +1,2 @@ -import{r as o,_ as L,j as p,b as v,l as I}from"./index-311f5e1d.js";import{x as D,K as T,y as F,Q as K}from"./index-b3d504b4.js";const P=["onChange","maxRows","minRows","style","value"];function m(r){return parseInt(r,10)||0}const Q={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 Z=o.forwardRef(function(l,O){const{onChange:R,maxRows:x,minRows:h=1,style:S,value:y}=l,k=L(l,P),{current:A}=o.useRef(y!=null),b=o.useRef(null),N=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)),x&&(s=Math.min(Number(x)*d,s)),s=Math.max(s,d);const j=s+(g==="border-box"?w+a:0),B=Math.abs(s-u)<=1;return{outerHeightStyle:j,overflow:B}},[x,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=K(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},[y]);const _=e=>{c.current=0,A||W(),R&&R(e)};return p.jsxs(o.Fragment,{children:[p.jsx("textarea",v({value:y,onChange:_,ref:N,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({},Q.shadow,S,{paddingTop:0,paddingBottom:0})})]})});export{Z as T}; +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)===` +`&&(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-9bb7747c.js b/build/assets/Twitch-d246f176.js similarity index 95% rename from build/assets/Twitch-9bb7747c.js rename to build/assets/Twitch-d246f176.js index 9b8fd1107..3e2df69c5 100644 --- a/build/assets/Twitch-9bb7747c.js +++ b/build/assets/Twitch-d246f176.js @@ -1 +1 @@ -import{g as w,r as D}from"./index-311f5e1d.js";import{u as C,p as N}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Typography-5302f73b.js b/build/assets/Typography-543ae8c6.js similarity index 93% rename from build/assets/Typography-5302f73b.js rename to build/assets/Typography-543ae8c6.js index 18ac3fa8b..a29216207 100644 --- a/build/assets/Typography-5302f73b.js +++ b/build/assets/Typography-543ae8c6.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-311f5e1d.js";import{e as _}from"./Stack-dcbf847f.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-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}; diff --git a/build/assets/Vidyard-326cf564.js b/build/assets/Vidyard-4e893f64.js similarity index 95% rename from build/assets/Vidyard-326cf564.js rename to build/assets/Vidyard-4e893f64.js index dfdccb387..bfa8c93d6 100644 --- a/build/assets/Vidyard-326cf564.js +++ b/build/assets/Vidyard-4e893f64.js @@ -1 +1 @@ -import{g,r as v}from"./index-311f5e1d.js";import{u as b,p as O}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Vimeo-794f619c.js b/build/assets/Vimeo-797d4bed.js similarity index 96% rename from build/assets/Vimeo-794f619c.js rename to build/assets/Vimeo-797d4bed.js index 50a4f1913..07b588066 100644 --- a/build/assets/Vimeo-794f619c.js +++ b/build/assets/Vimeo-797d4bed.js @@ -1 +1 @@ -import{g as d,r as f}from"./index-311f5e1d.js";import{u as m,p as _}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/Wistia-b4231027.js b/build/assets/Wistia-8fb3c44b.js similarity index 96% rename from build/assets/Wistia-b4231027.js rename to build/assets/Wistia-8fb3c44b.js index 52e7f8c0b..ed399d8df 100644 --- a/build/assets/Wistia-b4231027.js +++ b/build/assets/Wistia-8fb3c44b.js @@ -1 +1 @@ -import{g as m,r as g}from"./index-311f5e1d.js";import{u as v,p as w}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/YouTube-b4edb4e4.js b/build/assets/YouTube-c46c3d3c.js similarity index 97% rename from build/assets/YouTube-b4edb4e4.js rename to build/assets/YouTube-c46c3d3c.js index f5dabdc9c..d0fbf4747 100644 --- a/build/assets/YouTube-b4edb4e4.js +++ b/build/assets/YouTube-c46c3d3c.js @@ -1 +1 @@ -import{g as U,r as I}from"./index-311f5e1d.js";import{u as L,p as Y}from"./index-dfcc1a18.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-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}; diff --git a/build/assets/constants-104c86df.js b/build/assets/constants-a86c243d.js similarity index 79% rename from build/assets/constants-104c86df.js rename to build/assets/constants-a86c243d.js index 97d91e6ac..d4cd351c3 100644 --- a/build/assets/constants-104c86df.js +++ b/build/assets/constants-a86c243d.js @@ -1,4 +1,4 @@ -import{t,aD as s,aB as a,aC as o}from"./index-311f5e1d.js";import{aw as n}from"./index-b3d504b4.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-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)` && { vertical-align: middle; margin: 5px 0 0 4px; diff --git a/build/assets/createSvgIcon-5d2e26a6.js b/build/assets/createSvgIcon-7c6eee06.js similarity index 97% rename from build/assets/createSvgIcon-5d2e26a6.js rename to build/assets/createSvgIcon-7c6eee06.js index 07f7a6435..94873f5c7 100644 --- a/build/assets/createSvgIcon-5d2e26a6.js +++ b/build/assets/createSvgIcon-7c6eee06.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-311f5e1d.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-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}; diff --git a/build/assets/index-023df127.js b/build/assets/index-0614cd43.js similarity index 94% rename from build/assets/index-023df127.js rename to build/assets/index-0614cd43.js index ff9c4462e..5c1ec9f1c 100644 --- a/build/assets/index-023df127.js +++ b/build/assets/index-0614cd43.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-311f5e1d.js";import{B as Ai}from"./index-146a182e.js";import{$ as wr,B as _n,a0 as Mo,ah as Er,at as E,I as sr,a$ as Mi,Z as ki,aw as Ri,D as ko,P 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-b3d504b4.js";import{O as Di,n as Hi,a as ia,N as Fo}from"./constants-b2a2fa82.js";import{T as xn}from"./index-44c82821.js";import{A as Dt}from"./index-4410528e.js";import{C as Ne}from"./ClipLoader-3e52df85.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-1d4da850.js";import{T as Xi,a as Ki}from"./Tabs-7a262088.js";import{p as lr,c as qi,g as Zi}from"./index-e1867c29.js";import{e as Qi}from"./Stack-dcbf847f.js";import{g as Ji,m as es,u as xe,b as jn,t as cr,T as No,i as Io,H as ts,j as sa,C as ns,P as rs,k as as}from"./index-52ffd3c1.js";import{a4 as os,a5 as is,E as ss,V as L,a6 as Ke,a7 as qe,a8 as la,x as un,a9 as pn,aa as ca,b as pe,ab as ls,_ as cs,C as us}from"./three.module-ebe9f2a4.js";import"./index.esm-46402b6f.js";import"./createSvgIcon-5d2e26a6.js";import"./TextareaAutosize-8373cbad.js";import"./Typography-5302f73b.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-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)` .MuiInputBase-input { font-family: Barlow; font-size: 14px; diff --git a/build/assets/index-edbea3ee.js b/build/assets/index-1a6ba924.js similarity index 96% rename from build/assets/index-edbea3ee.js rename to build/assets/index-1a6ba924.js index e0f344a61..90eb97812 100644 --- a/build/assets/index-edbea3ee.js +++ b/build/assets/index-1a6ba924.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-311f5e1d.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-b3d504b4.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-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"})` flex: 0 0 64px; z-index: 31; transition: opacity 1s; diff --git a/build/assets/index-146a182e.js b/build/assets/index-23519643.js similarity index 96% rename from build/assets/index-146a182e.js rename to build/assets/index-23519643.js index 6d80080c6..46fc6f781 100644 --- a/build/assets/index-146a182e.js +++ b/build/assets/index-23519643.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-311f5e1d.js";import{u as v,ah as y}from"./index-b3d504b4.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-69dca385.js";import{u as v,ai as y}from"./index-94c3c981.js";const j=m` 0% { transform: scale(0.8); } diff --git a/build/assets/index-e1867c29.js b/build/assets/index-28e22657.js similarity index 88% rename from build/assets/index-e1867c29.js rename to build/assets/index-28e22657.js index 0858d2f9d..97841381c 100644 --- a/build/assets/index-e1867c29.js +++ b/build/assets/index-28e22657.js @@ -1 +1 @@ -import{V as e}from"./three.module-ebe9f2a4.js";function l(t){const n={};return t.forEach(o=>{const{key:s,type:i,required:r}=o;r?n[s]=i:n[s]=`?${i}`}),n}function c(t){return Object.keys(t).map(n=>{const o=t[n];let s="";return typeof o=="string"&&(o.includes("?")?s=o.slice(1):s=o),{required:s?!o.includes("?"):!1,type:s,key:n}}).filter(({key:n,type:o})=>!["type","ref_id","parent"].includes(n)&&o)}const f=t=>{const n=new e(t.x-10,t.y+45,t.z),o=new e(t.x+5,t.y+10,t.z),s=new e(t.x,t.y,t.z);return[n,s,o]};export{l as c,f as g,c as p}; +import{V as e}from"./three.module-52004ab8.js";function l(t){const n={};return t.forEach(o=>{const{key:s,type:i,required:r}=o;r?n[s]=i:n[s]=`?${i}`}),n}function c(t){return Object.keys(t).map(n=>{const o=t[n];let s="";return typeof o=="string"&&(o.includes("?")?s=o.slice(1):s=o),{required:s?!o.includes("?"):!1,type:s,key:n}}).filter(({key:n,type:o})=>!["type","ref_id","parent"].includes(n)&&o)}const f=t=>{const n=new e(t.x-10,t.y+45,t.z),o=new e(t.x+5,t.y+10,t.z),s=new e(t.x,t.y,t.z);return[n,s,o]};export{l as c,f as g,c as p}; diff --git a/build/assets/index-52ffd3c1.js b/build/assets/index-47786f03.js similarity index 74% rename from build/assets/index-52ffd3c1.js rename to build/assets/index-47786f03.js index 1946571ba..9022401ee 100644 --- a/build/assets/index-52ffd3c1.js +++ b/build/assets/index-47786f03.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 Ki,bb as nd,bc as rd,bd as id}from"./index-311f5e1d.js";import{ac as fl,J as Vl,ad as od,U as ad,d as Ec,I as ld,C as io,ae as sd,a9 as Zl,x as Ql,z as da,af as dl,ag as ud,ah as cd,ai as fd,X as dd,aj as hd,ak as pd,al as vd,V as st,b as Nr,am as md,h as gd,g as Xl,a2 as pa,an as Tc,e as Ul,ao as Rl,ap as pi,aq as yd,a3 as Yl,s as xd,ar as Fl,as as Fu,y as wd,at as Sd,A as oo,Q as xi,au as Mc,a0 as kc,H as Cd,w as _d,av as Ed,aw as Td,t as Md,G as Au,r as kd,ax as Pd,M as Ld,ay as Ud,az as Jl,aA as Du,aB as Ir,aC as Rd,aD as hl}from"./three.module-ebe9f2a4.js";import{b3 as _t,t as Fd,f as Ad}from"./index-b3d504b4.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-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={};/** * @license React * react-reconciler-constants.production.min.js * @@ -6,7 +6,7 @@ import{r as P,g as Cc,b as yi,b9 as _c,ba as ed,j as L,R as td,v as Ki,bb as nd, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */Gr.ConcurrentRoot=1;Gr.ContinuousEventPriority=4;Gr.DefaultEventPriority=16;Gr.DiscreteEventPriority=1;Gr.IdleEventPriority=536870912;Gr.LegacyRoot=0;Pc.exports=Gr;var vi=Pc.exports;function Dd(a){let n;const c=new Set,v=(h,d)=>{const m=typeof h=="function"?h(n):h;if(m!==n){const y=n;n=d?m:Object.assign({},n,m),c.forEach(x=>x(n,y))}},i=()=>n,r=(h,d=i,m=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let y=d(n);function x(){const C=d(n);if(!m(y,C)){const T=y;h(y=C,T)}}return c.add(x),()=>c.delete(x)},u={setState:v,getState:i,subscribe:(h,d,m)=>d||m?r(h,d,m):(c.add(h),()=>c.delete(h)),destroy:()=>c.clear()};return n=a(v,i,u),u}const Od=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Ou=Od?P.useEffect:P.useLayoutEffect;function zd(a){const n=typeof a=="function"?Dd(a):a,c=(v=n.getState,i=Object.is)=>{const[,r]=P.useReducer(S=>S+1,0),s=n.getState(),f=P.useRef(s),u=P.useRef(v),h=P.useRef(i),d=P.useRef(!1),m=P.useRef();m.current===void 0&&(m.current=v(s));let y,x=!1;(f.current!==s||u.current!==v||h.current!==i||d.current)&&(y=v(s),x=!i(m.current,y)),Ou(()=>{x&&(m.current=y),f.current=s,u.current=v,h.current=i,d.current=!1});const C=P.useRef(s);Ou(()=>{const S=()=>{try{const w=n.getState(),M=u.current(w);h.current(m.current,M)||(f.current=w,m.current=M,r())}catch{d.current=!0,r()}},_=n.subscribe(S);return n.getState()!==C.current&&S(),_},[]);const T=x?y:m.current;return P.useDebugValue(T),T};return Object.assign(c,n),c[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const v=[c,n];return{next(){const i=v.length<=0;return{value:v.shift(),done:i}}}},c}var Lc={exports:{}},Uc={exports:{}},Rc={};/** + */Gr.ConcurrentRoot=1;Gr.ContinuousEventPriority=4;Gr.DefaultEventPriority=16;Gr.DiscreteEventPriority=1;Gr.IdleEventPriority=536870912;Gr.LegacyRoot=0;Pc.exports=Gr;var vi=Pc.exports;function Dd(l){let n;const c=new Set,v=(h,d)=>{const m=typeof h=="function"?h(n):h;if(m!==n){const y=n;n=d?m:Object.assign({},n,m),c.forEach(x=>x(n,y))}},i=()=>n,r=(h,d=i,m=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let y=d(n);function x(){const C=d(n);if(!m(y,C)){const T=y;h(y=C,T)}}return c.add(x),()=>c.delete(x)},u={setState:v,getState:i,subscribe:(h,d,m)=>d||m?r(h,d,m):(c.add(h),()=>c.delete(h)),destroy:()=>c.clear()};return n=l(v,i,u),u}const Od=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Ou=Od?P.useEffect:P.useLayoutEffect;function zd(l){const n=typeof l=="function"?Dd(l):l,c=(v=n.getState,i=Object.is)=>{const[,r]=P.useReducer(S=>S+1,0),s=n.getState(),f=P.useRef(s),u=P.useRef(v),h=P.useRef(i),d=P.useRef(!1),m=P.useRef();m.current===void 0&&(m.current=v(s));let y,x=!1;(f.current!==s||u.current!==v||h.current!==i||d.current)&&(y=v(s),x=!i(m.current,y)),Ou(()=>{x&&(m.current=y),f.current=s,u.current=v,h.current=i,d.current=!1});const C=P.useRef(s);Ou(()=>{const S=()=>{try{const w=n.getState(),M=u.current(w);h.current(m.current,M)||(f.current=w,m.current=M,r())}catch{d.current=!0,r()}},_=n.subscribe(S);return n.getState()!==C.current&&S(),_},[]);const T=x?y:m.current;return P.useDebugValue(T),T};return Object.assign(c,n),c[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const v=[c,n];return{next(){const i=v.length<=0;return{value:v.shift(),done:i}}}},c}var Lc={exports:{}},Uc={exports:{}},Rc={};/** * @license React * scheduler.production.min.js * @@ -14,7 +14,7 @@ import{r as P,g as Cc,b as yi,b9 as _c,ba as ed,j as L,R as td,v as Ki,bb as nd, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(a){function n(Z,j){var W=Z.length;Z.push(j);e:for(;0>>1,I=Z[k];if(0>>1;ki(H,W))rei(X,H)?(Z[k]=X,Z[re]=W,k=re):(Z[k]=H,Z[Y]=W,k=Y);else if(rei(X,W))Z[k]=X,Z[re]=W,k=re;else break e}}return j}function i(Z,j){var W=Z.sortIndex-j.sortIndex;return W!==0?W:Z.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;a.unstable_now=function(){return r.now()}}else{var s=Date,f=s.now();a.unstable_now=function(){return s.now()-f}}var u=[],h=[],d=1,m=null,y=3,x=!1,C=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(Z){for(var j=c(h);j!==null;){if(j.callback===null)v(h);else if(j.startTime<=Z)v(h),j.sortIndex=j.expirationTime,n(u,j);else break;j=c(h)}}function D(Z){if(T=!1,M(Z),!C)if(c(u)!==null)C=!0,ae(R);else{var j=c(h);j!==null&&ve(D,j.startTime-Z)}}function R(Z,j){C=!1,T&&(T=!1,_(B),B=-1),x=!0;var W=y;try{for(M(j),m=c(u);m!==null&&(!(m.expirationTime>j)||Z&&!G());){var k=m.callback;if(typeof k=="function"){m.callback=null,y=m.priorityLevel;var I=k(m.expirationTime<=j);j=a.unstable_now(),typeof I=="function"?m.callback=I:m===c(u)&&v(u),M(j)}else v(u);m=c(u)}if(m!==null)var Q=!0;else{var Y=c(h);Y!==null&&ve(D,Y.startTime-j),Q=!1}return Q}finally{m=null,y=W,x=!1}}var A=!1,b=null,B=-1,J=5,oe=-1;function G(){return!(a.unstable_now()-oeZ||125k?(Z.sortIndex=W,n(h,Z),c(u)===null&&Z===c(h)&&(T?(_(B),B=-1):T=!0,ve(D,W-k))):(Z.sortIndex=I,n(u,Z),C||x||(C=!0,ae(R))),Z},a.unstable_shouldYield=G,a.unstable_wrapCallback=function(Z){var j=y;return function(){var W=y;y=j;try{return Z.apply(this,arguments)}finally{y=W}}}})(Rc);Uc.exports=Rc;var Al=Uc.exports;/** + */(function(l){function n(Z,j){var W=Z.length;Z.push(j);e:for(;0>>1,I=Z[k];if(0>>1;ki(H,W))rei(X,H)?(Z[k]=X,Z[re]=W,k=re):(Z[k]=H,Z[Y]=W,k=Y);else if(rei(X,W))Z[k]=X,Z[re]=W,k=re;else break e}}return j}function i(Z,j){var W=Z.sortIndex-j.sortIndex;return W!==0?W:Z.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;l.unstable_now=function(){return r.now()}}else{var s=Date,f=s.now();l.unstable_now=function(){return s.now()-f}}var u=[],h=[],d=1,m=null,y=3,x=!1,C=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(Z){for(var j=c(h);j!==null;){if(j.callback===null)v(h);else if(j.startTime<=Z)v(h),j.sortIndex=j.expirationTime,n(u,j);else break;j=c(h)}}function D(Z){if(T=!1,M(Z),!C)if(c(u)!==null)C=!0,ae(R);else{var j=c(h);j!==null&&ve(D,j.startTime-Z)}}function R(Z,j){C=!1,T&&(T=!1,_(B),B=-1),x=!0;var W=y;try{for(M(j),m=c(u);m!==null&&(!(m.expirationTime>j)||Z&&!G());){var k=m.callback;if(typeof k=="function"){m.callback=null,y=m.priorityLevel;var I=k(m.expirationTime<=j);j=l.unstable_now(),typeof I=="function"?m.callback=I:m===c(u)&&v(u),M(j)}else v(u);m=c(u)}if(m!==null)var Q=!0;else{var Y=c(h);Y!==null&&ve(D,Y.startTime-j),Q=!1}return Q}finally{m=null,y=W,x=!1}}var A=!1,b=null,B=-1,J=5,oe=-1;function G(){return!(l.unstable_now()-oeZ||125k?(Z.sortIndex=W,n(h,Z),c(u)===null&&Z===c(h)&&(T?(_(B),B=-1):T=!0,ve(D,W-k))):(Z.sortIndex=I,n(u,Z),C||x||(C=!0,ae(R))),Z},l.unstable_shouldYield=G,l.unstable_wrapCallback=function(Z){var j=y;return function(){var W=y;y=j;try{return Z.apply(this,arguments)}finally{y=W}}}})(Rc);Uc.exports=Rc;var Al=Uc.exports;/** * @license React * react-reconciler.production.min.js * @@ -22,17 +22,17 @@ import{r as P,g as Cc,b as yi,b9 as _c,ba as ed,j as L,R as td,v as Ki,bb as nd, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Id=function(n){var c={},v=P,i=Al,r=Object.assign;function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;oU||p[E]!==g[U]){var V=` -`+p[E].replace(" at new "," at ");return e.displayName&&V.includes("")&&(V=V.replace("",e.displayName)),V}while(1<=E&&0<=U);break}}}finally{Mi=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?Rn(e):""}var Hr=Object.prototype.hasOwnProperty,Vr=[],In=-1;function ln(e){return{current:e}}function Ye(e){0>In||(e.current=Vr[In],Vr[In]=null,In--)}function Ke(e,t){In++,Vr[In]=e.current,e.current=t}var sn={},St=ln(sn),Et=ln(!1),jn=sn;function yn(e,t){var o=e.type.contextTypes;if(!o)return sn;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in o)p[g]=t[g];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=p),p}function Tt(e){return e=e.childContextTypes,e!=null}function Fn(){Ye(Et),Ye(St)}function Zr(e,t,o){if(St.current!==sn)throw Error(s(168));Ke(St,t),Ke(Et,o)}function Qr(e,t,o){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var p in l)if(!(p in t))throw Error(s(108,B(e)||"Unknown",p));return r({},o,l)}function sr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sn,jn=St.current,Ke(St,e),Ke(Et,Et.current),!0}function un(e,t,o){var l=e.stateNode;if(!l)throw Error(s(169));o?(e=Qr(e,t,jn),l.__reactInternalMemoizedMergedChildContext=e,Ye(Et),Ye(St),Ke(St,e)):Ye(Et),Ke(Et,o)}var cn=Math.clz32?Math.clz32:fo,Xr=Math.log,wr=Math.LN2;function fo(e){return e>>>=0,e===0?32:31-(Xr(e)/wr|0)|0}var Kn=64,qn=4194304;function $n(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sr(e,t){var o=e.pendingLanes;if(o===0)return 0;var l=0,p=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var U=E&~p;U!==0?l=$n(U):(g&=E,g!==0&&(l=$n(g)))}else E=o&~p,E!==0?l=$n(E):g!==0&&(l=$n(g));if(l===0)return 0;if(t!==0&&t!==l&&!(t&p)&&(p=l&-l,g=t&-t,p>=g||p===16&&(g&4194240)!==0))return t;if(l&4&&(l|=o&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0o;o++)t.push(e);return t}function bn(e,t,o){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-cn(t),e[t]=o}function ur(e,t){var o=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0>=E,p-=E,rr=1<<32-cn(t)+p|o<Ve?(Lt=Ae,Ae=null):Lt=Ae.sibling;var Ze=Le(z,Ae,N[Ve],he);if(Ze===null){Ae===null&&(Ae=Lt);break}e&&Ae&&Ze.alternate===null&&t(z,Ae),F=g(Ze,F,Ve),je===null?Ee=Ze:je.sibling=Ze,je=Ze,Ae=Lt}if(Ve===N.length)return o(z,Ae),ot&&Pr(z,Ve),Ee;if(Ae===null){for(;VeVe?(Lt=Ae,Ae=null):Lt=Ae.sibling;var yr=Le(z,Ae,Ze.value,he);if(yr===null){Ae===null&&(Ae=Lt);break}e&&Ae&&yr.alternate===null&&t(z,Ae),F=g(yr,F,Ve),je===null?Ee=yr:je.sibling=yr,je=yr,Ae=Lt}if(Ze.done)return o(z,Ae),ot&&Pr(z,Ve),Ee;if(Ae===null){for(;!Ze.done;Ve++,Ze=N.next())Ze=Fe(z,Ze.value,he),Ze!==null&&(F=g(Ze,F,Ve),je===null?Ee=Ze:je.sibling=Ze,je=Ze);return ot&&Pr(z,Ve),Ee}for(Ae=l(z,Ae);!Ze.done;Ve++,Ze=N.next())Ze=$e(Ae,z,Ve,Ze.value,he),Ze!==null&&(e&&Ze.alternate!==null&&Ae.delete(Ze.key===null?Ve:Ze.key),F=g(Ze,F,Ve),je===null?Ee=Ze:je.sibling=Ze,je=Ze);return e&&Ae.forEach(function($f){return t(z,$f)}),ot&&Pr(z,Ve),Ee}function Mn(z,F,N,he){if(typeof N=="object"&&N!==null&&N.type===d&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case u:e:{for(var Ee=N.key,je=F;je!==null;){if(je.key===Ee){if(Ee=N.type,Ee===d){if(je.tag===7){o(z,je.sibling),F=p(je,N.props.children),F.return=z,z=F;break e}}else if(je.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===M&&ms(Ee)===je.type){o(z,je.sibling),F=p(je,N.props),F.ref=zi(z,je,N),F.return=z,z=F;break e}o(z,je);break}else t(z,je);je=je.sibling}N.type===d?(F=Or(N.props.children,z.mode,he,N.key),F.return=z,z=F):(he=ea(N.type,N.key,N.props,null,z.mode,he),he.ref=zi(z,F,N),he.return=z,z=he)}return E(z);case h:e:{for(je=N.key;F!==null;){if(F.key===je)if(F.tag===4&&F.stateNode.containerInfo===N.containerInfo&&F.stateNode.implementation===N.implementation){o(z,F.sibling),F=p(F,N.children||[]),F.return=z,z=F;break e}else{o(z,F);break}else t(z,F);F=F.sibling}F=ul(N,z.mode,he),F.return=z,z=F}return E(z);case M:return je=N._init,Mn(z,F,je(N._payload),he)}if(ne(N))return Te(z,F,N,he);if(A(N))return bt(z,F,N,he);_o(z,N)}return typeof N=="string"&&N!==""||typeof N=="number"?(N=""+N,F!==null&&F.tag===6?(o(z,F.sibling),F=p(F,N),F.return=z,z=F):(o(z,F),F=sl(N,z.mode,he),F.return=z,z=F),E(z)):o(z,F)}return Mn}var ni=gs(!0),ys=gs(!1),Ii={},Cn=ln(Ii),ji=ln(Ii),ri=ln(Ii);function Gn(e){if(e===Ii)throw Error(s(174));return e}function Ma(e,t){Ke(ri,t),Ke(ji,e),Ke(Cn,Ii),e=ve(t),Ye(Cn),Ke(Cn,e)}function ii(){Ye(Cn),Ye(ji),Ye(ri)}function xs(e){var t=Gn(ri.current),o=Gn(Cn.current);t=Z(o,e.type,t),o!==t&&(Ke(ji,e),Ke(Cn,t))}function ka(e){ji.current===e&&(Ye(Cn),Ye(ji))}var lt=ln(0);function Eo(e){for(var t=e;t!==null;){if(t.tag===13){var o=t.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Xe(o)||ht(o)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pa=[];function La(){for(var e=0;eo?o:4,e(!0);var l=_n.transition;_n.transition={};try{e(!1),t()}finally{Ne=o,_n.transition=l}}function As(){return Wn().memoizedState}function Mf(e,t,o){var l=vr(e);o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},Ds(e)?Os(t,o):(zs(e,t,o),o=Kt(),e=En(e,l,o),e!==null&&Is(e,t,l))}function kf(e,t,o){var l=vr(e),p={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Os(t,p);else{zs(e,t,p);var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var E=t.lastRenderedState,U=g(E,o);if(p.hasEagerState=!0,p.eagerState=U,dn(U,E))return}catch{}finally{}o=Kt(),e=En(e,l,o),e!==null&&Is(e,t,l)}}function Ds(e){var t=e.alternate;return e===dt||t!==null&&t===dt}function Os(e,t){bi=Mo=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function zs(e,t,o){xt!==null&&e.mode&1&&!(Be&2)?(e=t.interleaved,e===null?(o.next=o,hn===null?hn=[t]:hn.push(t)):(o.next=e.next,e.next=o),t.interleaved=o):(e=t.pending,e===null?o.next=o:(o.next=e.next,e.next=o),t.pending=o)}function Is(e,t,o){if(o&4194240){var l=t.lanes;l&=e.pendingLanes,o|=l,t.lanes=o,Bn(e,o)}}var Ro={readContext:vt,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useInsertionEffect:It,useLayoutEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useMutableSource:It,useSyncExternalStore:It,useId:It,unstable_isNewReconciler:!1},Pf={readContext:vt,useCallback:function(e,t){return or().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:Da,useImperativeHandle:function(e,t,o){return o=o!=null?o.concat([e]):null,Lo(4194308,4,Ls.bind(null,t,e),o)},useLayoutEffect:function(e,t){return Lo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Lo(4,2,e,t)},useMemo:function(e,t){var o=or();return t=t===void 0?null:t,e=e(),o.memoizedState=[e,t],e},useReducer:function(e,t,o){var l=or();return t=o!==void 0?o(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Mf.bind(null,dt,e),[l.memoizedState,e]},useRef:function(e){var t=or();return e={current:e},t.memoizedState=e},useState:Aa,useDebugValue:Oa,useDeferredValue:function(e){var t=Aa(e),o=t[0],l=t[1];return Da(function(){var p=_n.transition;_n.transition={};try{l(e)}finally{_n.transition=p}},[e]),o},useTransition:function(){var e=Aa(!1),t=e[0];return e=Tf.bind(null,e[1]),or().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,o){var l=dt,p=or();if(ot){if(o===void 0)throw Error(s(407));o=o()}else{if(o=t(),xt===null)throw Error(s(349));oi&30||Cs(l,t,o)}p.memoizedState=o;var g={value:o,getSnapshot:t};return p.queue=g,Da(Es.bind(null,l,g,e),[e]),l.flags|=2048,Ni(9,_s.bind(null,l,g,o,t),void 0,null),o},useId:function(){var e=or(),t=xt.identifierPrefix;if(ot){var o=ir,l=rr;o=(l&~(1<<32-cn(l)-1)).toString(32)+o,t=":"+t+"R"+o,o=Bi++,0")&&(V=V.replace("",e.displayName)),V}while(1<=E&&0<=U);break}}}finally{Ti=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?Rn(e):""}var Hr=Object.prototype.hasOwnProperty,Vr=[],In=-1;function ln(e){return{current:e}}function Ye(e){0>In||(e.current=Vr[In],Vr[In]=null,In--)}function Ke(e,t){In++,Vr[In]=e.current,e.current=t}var sn={},St=ln(sn),Et=ln(!1),jn=sn;function yn(e,t){var o=e.type.contextTypes;if(!o)return sn;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in o)p[g]=t[g];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=p),p}function Tt(e){return e=e.childContextTypes,e!=null}function Fn(){Ye(Et),Ye(St)}function Zr(e,t,o){if(St.current!==sn)throw Error(s(168));Ke(St,t),Ke(Et,o)}function Qr(e,t,o){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return o;a=a.getChildContext();for(var p in a)if(!(p in t))throw Error(s(108,B(e)||"Unknown",p));return r({},o,a)}function sr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sn,jn=St.current,Ke(St,e),Ke(Et,Et.current),!0}function un(e,t,o){var a=e.stateNode;if(!a)throw Error(s(169));o?(e=Qr(e,t,jn),a.__reactInternalMemoizedMergedChildContext=e,Ye(Et),Ye(St),Ke(St,e)):Ye(Et),Ke(Et,o)}var cn=Math.clz32?Math.clz32:fo,Xr=Math.log,wr=Math.LN2;function fo(e){return e>>>=0,e===0?32:31-(Xr(e)/wr|0)|0}var Kn=64,qn=4194304;function $n(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sr(e,t){var o=e.pendingLanes;if(o===0)return 0;var a=0,p=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var U=E&~p;U!==0?a=$n(U):(g&=E,g!==0&&(a=$n(g)))}else E=o&~p,E!==0?a=$n(E):g!==0&&(a=$n(g));if(a===0)return 0;if(t!==0&&t!==a&&!(t&p)&&(p=a&-a,g=t&-t,p>=g||p===16&&(g&4194240)!==0))return t;if(a&4&&(a|=o&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0o;o++)t.push(e);return t}function bn(e,t,o){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-cn(t),e[t]=o}function ur(e,t){var o=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0>=E,p-=E,rr=1<<32-cn(t)+p|o<Ve?(Lt=Ae,Ae=null):Lt=Ae.sibling;var Ze=Le(z,Ae,N[Ve],he);if(Ze===null){Ae===null&&(Ae=Lt);break}e&&Ae&&Ze.alternate===null&&t(z,Ae),F=g(Ze,F,Ve),je===null?Ee=Ze:je.sibling=Ze,je=Ze,Ae=Lt}if(Ve===N.length)return o(z,Ae),ot&&Pr(z,Ve),Ee;if(Ae===null){for(;VeVe?(Lt=Ae,Ae=null):Lt=Ae.sibling;var yr=Le(z,Ae,Ze.value,he);if(yr===null){Ae===null&&(Ae=Lt);break}e&&Ae&&yr.alternate===null&&t(z,Ae),F=g(yr,F,Ve),je===null?Ee=yr:je.sibling=yr,je=yr,Ae=Lt}if(Ze.done)return o(z,Ae),ot&&Pr(z,Ve),Ee;if(Ae===null){for(;!Ze.done;Ve++,Ze=N.next())Ze=Fe(z,Ze.value,he),Ze!==null&&(F=g(Ze,F,Ve),je===null?Ee=Ze:je.sibling=Ze,je=Ze);return ot&&Pr(z,Ve),Ee}for(Ae=a(z,Ae);!Ze.done;Ve++,Ze=N.next())Ze=$e(Ae,z,Ve,Ze.value,he),Ze!==null&&(e&&Ze.alternate!==null&&Ae.delete(Ze.key===null?Ve:Ze.key),F=g(Ze,F,Ve),je===null?Ee=Ze:je.sibling=Ze,je=Ze);return e&&Ae.forEach(function($f){return t(z,$f)}),ot&&Pr(z,Ve),Ee}function Mn(z,F,N,he){if(typeof N=="object"&&N!==null&&N.type===d&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case u:e:{for(var Ee=N.key,je=F;je!==null;){if(je.key===Ee){if(Ee=N.type,Ee===d){if(je.tag===7){o(z,je.sibling),F=p(je,N.props.children),F.return=z,z=F;break e}}else if(je.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===M&&ms(Ee)===je.type){o(z,je.sibling),F=p(je,N.props),F.ref=Oi(z,je,N),F.return=z,z=F;break e}o(z,je);break}else t(z,je);je=je.sibling}N.type===d?(F=Or(N.props.children,z.mode,he,N.key),F.return=z,z=F):(he=ea(N.type,N.key,N.props,null,z.mode,he),he.ref=Oi(z,F,N),he.return=z,z=he)}return E(z);case h:e:{for(je=N.key;F!==null;){if(F.key===je)if(F.tag===4&&F.stateNode.containerInfo===N.containerInfo&&F.stateNode.implementation===N.implementation){o(z,F.sibling),F=p(F,N.children||[]),F.return=z,z=F;break e}else{o(z,F);break}else t(z,F);F=F.sibling}F=ul(N,z.mode,he),F.return=z,z=F}return E(z);case M:return je=N._init,Mn(z,F,je(N._payload),he)}if(ne(N))return Te(z,F,N,he);if(A(N))return bt(z,F,N,he);_o(z,N)}return typeof N=="string"&&N!==""||typeof N=="number"?(N=""+N,F!==null&&F.tag===6?(o(z,F.sibling),F=p(F,N),F.return=z,z=F):(o(z,F),F=sl(N,z.mode,he),F.return=z,z=F),E(z)):o(z,F)}return Mn}var ni=gs(!0),ys=gs(!1),zi={},Cn=ln(zi),Ii=ln(zi),ri=ln(zi);function Gn(e){if(e===zi)throw Error(s(174));return e}function Ma(e,t){Ke(ri,t),Ke(Ii,e),Ke(Cn,zi),e=ve(t),Ye(Cn),Ke(Cn,e)}function ii(){Ye(Cn),Ye(Ii),Ye(ri)}function xs(e){var t=Gn(ri.current),o=Gn(Cn.current);t=Z(o,e.type,t),o!==t&&(Ke(Ii,e),Ke(Cn,t))}function ka(e){Ii.current===e&&(Ye(Cn),Ye(Ii))}var lt=ln(0);function Eo(e){for(var t=e;t!==null;){if(t.tag===13){var o=t.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Xe(o)||ht(o)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pa=[];function La(){for(var e=0;eo?o:4,e(!0);var a=_n.transition;_n.transition={};try{e(!1),t()}finally{Ne=o,_n.transition=a}}function As(){return Wn().memoizedState}function Mf(e,t,o){var a=vr(e);o={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null},Ds(e)?Os(t,o):(zs(e,t,o),o=Kt(),e=En(e,a,o),e!==null&&Is(e,t,a))}function kf(e,t,o){var a=vr(e),p={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Os(t,p);else{zs(e,t,p);var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=t.lastRenderedReducer,g!==null))try{var E=t.lastRenderedState,U=g(E,o);if(p.hasEagerState=!0,p.eagerState=U,dn(U,E))return}catch{}finally{}o=Kt(),e=En(e,a,o),e!==null&&Is(e,t,a)}}function Ds(e){var t=e.alternate;return e===dt||t!==null&&t===dt}function Os(e,t){ji=Mo=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function zs(e,t,o){xt!==null&&e.mode&1&&!(Be&2)?(e=t.interleaved,e===null?(o.next=o,hn===null?hn=[t]:hn.push(t)):(o.next=e.next,e.next=o),t.interleaved=o):(e=t.pending,e===null?o.next=o:(o.next=e.next,e.next=o),t.pending=o)}function Is(e,t,o){if(o&4194240){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,Bn(e,o)}}var Ro={readContext:vt,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useInsertionEffect:It,useLayoutEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useMutableSource:It,useSyncExternalStore:It,useId:It,unstable_isNewReconciler:!1},Pf={readContext:vt,useCallback:function(e,t){return or().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:Da,useImperativeHandle:function(e,t,o){return o=o!=null?o.concat([e]):null,Lo(4194308,4,Ls.bind(null,t,e),o)},useLayoutEffect:function(e,t){return Lo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Lo(4,2,e,t)},useMemo:function(e,t){var o=or();return t=t===void 0?null:t,e=e(),o.memoizedState=[e,t],e},useReducer:function(e,t,o){var a=or();return t=o!==void 0?o(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=Mf.bind(null,dt,e),[a.memoizedState,e]},useRef:function(e){var t=or();return e={current:e},t.memoizedState=e},useState:Aa,useDebugValue:Oa,useDeferredValue:function(e){var t=Aa(e),o=t[0],a=t[1];return Da(function(){var p=_n.transition;_n.transition={};try{a(e)}finally{_n.transition=p}},[e]),o},useTransition:function(){var e=Aa(!1),t=e[0];return e=Tf.bind(null,e[1]),or().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,o){var a=dt,p=or();if(ot){if(o===void 0)throw Error(s(407));o=o()}else{if(o=t(),xt===null)throw Error(s(349));oi&30||Cs(a,t,o)}p.memoizedState=o;var g={value:o,getSnapshot:t};return p.queue=g,Da(Es.bind(null,a,g,e),[e]),a.flags|=2048,Bi(9,_s.bind(null,a,g,o,t),void 0,null),o},useId:function(){var e=or(),t=xt.identifierPrefix;if(ot){var o=ir,a=rr;o=(a&~(1<<32-cn(a)-1)).toString(32)+o,t=":"+t+"R"+o,o=bi++,0el&&(t.flags|=128,l=!0,Vi(p,!1),t.lanes=4194304)}else{if(!l)if(e=Eo(g),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),Vi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!g.alternate&&!ot)return jt(t),null}else 2*at()-p.renderingStartTime>el&&o!==1073741824&&(t.flags|=128,l=!0,Vi(p,!1),t.lanes=4194304);p.isBackwards?(g.sibling=t.child,t.child=g):(e=p.last,e!==null?e.sibling=g:t.child=g,p.last=g)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=at(),t.sibling=null,e=lt.current,Ke(lt,l?e&1|2:e&1),t):(jt(t),null);case 22:case 23:return ol(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&t.mode&1?gn&1073741824&&(jt(t),K&&t.subtreeFlags&6&&(t.flags|=8192)):jt(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}var Af=f.ReactCurrentOwner,mn=!1;function Jt(e,t,o,l){t.child=e===null?ys(t,null,o,l):ni(t,e.child,o,l)}function Vs(e,t,o,l,p){o=o.render;var g=t.ref;return pt(t,p),l=Ra(e,t,o,l,g,p),o=Fa(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~p,ar(e,t,p)):(ot&&o&&Sa(t),t.flags|=1,Jt(e,t,l,p),t.child)}function Zs(e,t,o,l,p){if(e===null){var g=o.type;return typeof g=="function"&&!ll(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(t.tag=15,t.type=g,Qs(e,t,g,l,p)):(e=ea(o.type,null,l,t,t.mode,p),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,!(e.lanes&p)){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:Tr,o(E,l)&&e.ref===t.ref)return ar(e,t,p)}return t.flags|=1,e=gr(g,l),e.ref=t.ref,e.return=t,t.child=e}function Qs(e,t,o,l,p){if(e!==null&&Tr(e.memoizedProps,l)&&e.ref===t.ref)if(mn=!1,(e.lanes&p)!==0)e.flags&131072&&(mn=!0);else return t.lanes=e.lanes,ar(e,t,p);return ja(e,t,o,l,p)}function Xs(e,t,o){var l=t.pendingProps,p=l.children,g=e!==null?e.memoizedState:null;if(l.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null},Ke(ai,gn),gn|=o;else if(o&1073741824)t.memoizedState={baseLanes:0,cachePool:null},l=g!==null?g.baseLanes:o,Ke(ai,gn),gn|=l;else return e=g!==null?g.baseLanes|o:o,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null},t.updateQueue=null,Ke(ai,gn),gn|=e,null;else g!==null?(l=g.baseLanes|o,t.memoizedState=null):l=o,Ke(ai,gn),gn|=l;return Jt(e,t,p,o),t.child}function Ys(e,t){var o=t.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(t.flags|=512,t.flags|=2097152)}function ja(e,t,o,l,p){var g=Tt(o)?jn:St.current;return g=yn(t,g),pt(t,p),o=Ra(e,t,o,l,g,p),l=Fa(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~p,ar(e,t,p)):(ot&&l&&Sa(t),t.flags|=1,Jt(e,t,o,p),t.child)}function Js(e,t,o,l,p){if(Tt(o)){var g=!0;sr(t)}else g=!1;if(pt(t,p),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),cs(t,o,l),wa(t,o,l,p),l=!0;else if(e===null){var E=t.stateNode,U=t.memoizedProps;E.props=U;var V=E.context,se=o.contextType;typeof se=="object"&&se!==null?se=vt(se):(se=Tt(o)?jn:St.current,se=yn(t,se));var ge=o.getDerivedStateFromProps,Fe=typeof ge=="function"||typeof E.getSnapshotBeforeUpdate=="function";Fe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(U!==l||V!==se)&&fs(t,E,l,se),fr=!1;var Le=t.memoizedState;E.state=Le,xo(t,l,E,p),V=t.memoizedState,U!==l||Le!==V||Et.current||fr?(typeof ge=="function"&&(xa(t,o,ge,l),V=t.memoizedState),(U=fr||us(t,o,U,l,Le,V,se))?(Fe||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(t.flags|=4194308)):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=V),E.props=l,E.state=V,E.context=se,l=U):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{E=t.stateNode,os(e,t),U=t.memoizedProps,se=t.type===t.elementType?U:Xt(t.type,U),E.props=se,Fe=t.pendingProps,Le=E.context,V=o.contextType,typeof V=="object"&&V!==null?V=vt(V):(V=Tt(o)?jn:St.current,V=yn(t,V));var $e=o.getDerivedStateFromProps;(ge=typeof $e=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(U!==Fe||Le!==V)&&fs(t,E,l,V),fr=!1,Le=t.memoizedState,E.state=Le,xo(t,l,E,p);var Te=t.memoizedState;U!==Fe||Le!==Te||Et.current||fr?(typeof $e=="function"&&(xa(t,o,$e,l),Te=t.memoizedState),(se=fr||us(t,o,se,l,Le,Te,V)||!1)?(ge||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(l,Te,V),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(l,Te,V)),typeof E.componentDidUpdate=="function"&&(t.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof E.componentDidUpdate!="function"||U===e.memoizedProps&&Le===e.memoizedState||(t.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===e.memoizedProps&&Le===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Te),E.props=l,E.state=Te,E.context=V,l=se):(typeof E.componentDidUpdate!="function"||U===e.memoizedProps&&Le===e.memoizedState||(t.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===e.memoizedProps&&Le===e.memoizedState||(t.flags|=1024),l=!1)}return ba(e,t,o,l,g,p)}function ba(e,t,o,l,p,g){Ys(e,t);var E=(t.flags&128)!==0;if(!l&&!E)return p&&un(t,o,!1),ar(e,t,g);l=t.stateNode,Af.current=t;var U=E&&typeof o.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&E?(t.child=ni(t,e.child,null,g),t.child=ni(t,null,U,g)):Jt(e,t,U,g),t.memoizedState=l.state,p&&un(t,o,!0),t.child}function Ks(e){var t=e.stateNode;t.pendingContext?Zr(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Zr(e,t.context,!1),Ma(e,t.containerInfo)}function qs(e,t,o,l,p){return ti(),Ta(p),t.flags|=256,Jt(e,t,o,l),t.child}var Do={dehydrated:null,treeContext:null,retryLane:0};function Oo(e){return{baseLanes:e,cachePool:null}}function $s(e,t,o){var l=t.pendingProps,p=lt.current,g=!1,E=(t.flags&128)!==0,U;if((U=E)||(U=e!==null&&e.memoizedState===null?!1:(p&2)!==0),U?(g=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Ke(lt,p&1),e===null)return Ea(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?ht(e)?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(p=l.children,e=l.fallback,g?(l=t.mode,g=t.child,p={mode:"hidden",children:p},!(l&1)&&g!==null?(g.childLanes=0,g.pendingProps=p):g=ta(p,l,0,null),e=Or(e,l,o,null),g.return=t,e.return=t,g.sibling=e,t.child=g,t.child.memoizedState=Oo(o),t.memoizedState=Do,e):Ba(t,p));if(p=e.memoizedState,p!==null){if(U=p.dehydrated,U!==null){if(E)return t.flags&256?(t.flags&=-257,zo(e,t,o,Error(s(422)))):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(g=l.fallback,p=t.mode,l=ta({mode:"visible",children:l.children},p,0,null),g=Or(g,p,o,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,t.mode&1&&ni(t,e.child,null,o),t.child.memoizedState=Oo(o),t.memoizedState=Do,g);if(!(t.mode&1))t=zo(e,t,o,null);else if(ht(U))t=zo(e,t,o,Error(s(419)));else if(l=(o&e.childLanes)!==0,mn||l){if(l=xt,l!==null){switch(o&-o){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}l=g&(l.suspendedLanes|o)?0:g,l!==0&&l!==p.retryLane&&(p.retryLane=l,En(e,l,-1))}al(),t=zo(e,t,o,Error(s(421)))}else Xe(U)?(t.flags|=128,t.child=e.child,t=Zf.bind(null,e),qt(U,t),t=null):(o=p.treeContext,xe&&(vn=On(U),pn=t,ot=!0,Dn=null,Di=!1,o!==null&&(wn[Sn++]=rr,wn[Sn++]=ir,wn[Sn++]=kr,rr=o.id,ir=o.overflow,kr=t)),t=Ba(t,t.pendingProps.children),t.flags|=4096);return t}return g?(l=tu(e,t,l.children,l.fallback,o),g=t.child,p=e.child.memoizedState,g.memoizedState=p===null?Oo(o):{baseLanes:p.baseLanes|o,cachePool:null},g.childLanes=e.childLanes&~o,t.memoizedState=Do,l):(o=eu(e,t,l.children,o),t.memoizedState=null,o)}return g?(l=tu(e,t,l.children,l.fallback,o),g=t.child,p=e.child.memoizedState,g.memoizedState=p===null?Oo(o):{baseLanes:p.baseLanes|o,cachePool:null},g.childLanes=e.childLanes&~o,t.memoizedState=Do,l):(o=eu(e,t,l.children,o),t.memoizedState=null,o)}function Ba(e,t){return t=ta({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function eu(e,t,o,l){var p=e.child;return e=p.sibling,o=gr(p,{mode:"visible",children:o}),!(t.mode&1)&&(o.lanes=l),o.return=t,o.sibling=null,e!==null&&(l=t.deletions,l===null?(t.deletions=[e],t.flags|=16):l.push(e)),t.child=o}function tu(e,t,o,l,p){var g=t.mode;e=e.child;var E=e.sibling,U={mode:"hidden",children:o};return!(g&1)&&t.child!==e?(o=t.child,o.childLanes=0,o.pendingProps=U,t.deletions=null):(o=gr(e,U),o.subtreeFlags=e.subtreeFlags&14680064),E!==null?l=gr(E,l):(l=Or(l,g,p,null),l.flags|=2),l.return=t,o.return=t,o.sibling=l,t.child=o,l}function zo(e,t,o,l){return l!==null&&Ta(l),ni(t,e.child,null,o),e=Ba(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nu(e,t,o){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Yt(e.return,t,o)}function Na(e,t,o,l,p){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:p}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=o,g.tailMode=p)}function ru(e,t,o){var l=t.pendingProps,p=l.revealOrder,g=l.tail;if(Jt(e,t,l.children,o),l=lt.current,l&2)l=l&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nu(e,o,t);else if(e.tag===19)nu(e,o,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Ke(lt,l),!(t.mode&1))t.memoizedState=null;else switch(p){case"forwards":for(o=t.child,p=null;o!==null;)e=o.alternate,e!==null&&Eo(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=t.child,t.child=null):(p=o.sibling,o.sibling=null),Na(t,!1,p,o,g);break;case"backwards":for(o=null,p=t.child,t.child=null;p!==null;){if(e=p.alternate,e!==null&&Eo(e)===null){t.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}Na(t,!0,o,null,g);break;case"together":Na(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ar(e,t,o){if(e!==null&&(t.dependencies=e.dependencies),li|=t.lanes,!(o&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,o=gr(e,e.pendingProps),t.child=o,o.return=t;e.sibling!==null;)e=e.sibling,o=o.sibling=gr(e,e.pendingProps),o.return=t;o.sibling=null}return t.child}function Df(e,t,o){switch(t.tag){case 3:Ks(t),ti();break;case 5:xs(t);break;case 1:Tt(t.type)&&sr(t);break;case 4:Ma(t,t.stateNode.containerInfo);break;case 10:go(t,t.type._context,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Ke(lt,lt.current&1),t.flags|=128,null):o&t.child.childLanes?$s(e,t,o):(Ke(lt,lt.current&1),e=ar(e,t,o),e!==null?e.sibling:null);Ke(lt,lt.current&1);break;case 19:if(l=(o&t.childLanes)!==0,e.flags&128){if(l)return ru(e,t,o);t.flags|=128}var p=t.memoizedState;if(p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Ke(lt,lt.current),l)break;return null;case 22:case 23:return t.lanes=0,Xs(e,t,o)}return ar(e,t,o)}function Of(e,t){switch(Ca(t),t.tag){case 1:return Tt(t.type)&&Fn(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ii(),Ye(Et),Ye(St),La(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ka(t),null;case 13:if(Ye(lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ti()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ye(lt),null;case 4:return ii(),null;case 10:return kt(t.type._context),null;case 22:case 23:return ol(),null;case 24:return null;default:return null}}var Io=!1,Ur=!1,zf=typeof WeakSet=="function"?WeakSet:Set,de=null;function jo(e,t){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){nn(e,t,l)}else o.current=null}function Ga(e,t,o){try{o()}catch(l){nn(e,t,l)}}var iu=!1;function If(e,t){for(j(e.containerInfo),de=t;de!==null;)if(e=de,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,de=t;else for(;de!==null;){e=de;try{var o=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(o!==null){var l=o.memoizedProps,p=o.memoizedState,g=e.stateNode,E=g.getSnapshotBeforeUpdate(e.elementType===e.type?l:Xt(e.type,l),p);g.__reactInternalSnapshotBeforeUpdate=E}break;case 3:K&&Ln(e.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(U){nn(e,e.return,U)}if(t=e.sibling,t!==null){t.return=e.return,de=t;break}de=e.return}return o=iu,iu=!1,o}function Rr(e,t,o){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&e)===e){var g=p.destroy;p.destroy=void 0,g!==void 0&&Ga(t,o,g)}p=p.next}while(p!==l)}}function Zi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var o=t=t.next;do{if((o.tag&e)===e){var l=o.create;o.destroy=l()}o=o.next}while(o!==t)}}function Wa(e){var t=e.ref;if(t!==null){var o=e.stateNode;switch(e.tag){case 5:e=ae(o);break;default:e=o}typeof t=="function"?t(e):t.current=e}}function ou(e,t,o){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(_r,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var l=e=e.next;do{var p=l,g=p.destroy;p=p.tag,g!==void 0&&(p&2||p&4)&&Ga(t,o,g),l=l.next}while(l!==e)}break;case 1:if(jo(t,o),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(E){nn(t,o,E)}break;case 5:jo(t,o);break;case 4:K?fu(e,t,o):$&&$&&(t=t.stateNode.containerInfo,o=Un(t),tt(t,o))}}function au(e,t,o){for(var l=t;;)if(ou(e,l,o),l.child===null||K&&l.tag===4){if(l===t)break;for(;l.sibling===null;){if(l.return===null||l.return===t)return;l=l.return}l.sibling.return=l.return,l=l.sibling}else l.child.return=l,l=l.child}function lu(e){var t=e.alternate;t!==null&&(e.alternate=null,lu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ke(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function su(e){return e.tag===5||e.tag===3||e.tag===4}function uu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||su(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cu(e){if(K){e:{for(var t=e.return;t!==null;){if(su(t))break e;t=t.return}throw Error(s(160))}var o=t;switch(o.tag){case 5:t=o.stateNode,o.flags&32&&(Je(t),o.flags&=-33),o=uu(e),Va(e,o,t);break;case 3:case 4:t=o.stateNode.containerInfo,o=uu(e),Ha(e,o,t);break;default:throw Error(s(161))}}}function Ha(e,t,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?be(o,e,t):ze(o,e);else if(l!==4&&(e=e.child,e!==null))for(Ha(e,t,o),e=e.sibling;e!==null;)Ha(e,t,o),e=e.sibling}function Va(e,t,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?qe(o,e,t):Me(o,e);else if(l!==4&&(e=e.child,e!==null))for(Va(e,t,o),e=e.sibling;e!==null;)Va(e,t,o),e=e.sibling}function fu(e,t,o){for(var l=t,p=!1,g,E;;){if(!p){p=l.return;e:for(;;){if(p===null)throw Error(s(160));switch(g=p.stateNode,p.tag){case 5:E=!1;break e;case 3:g=g.containerInfo,E=!0;break e;case 4:g=g.containerInfo,E=!0;break e}p=p.return}p=!0}if(l.tag===5||l.tag===6)au(e,l,o),E?Qe(g,l.stateNode):Ue(g,l.stateNode);else if(l.tag===18)E?co(g,l.stateNode):ga(g,l.stateNode);else if(l.tag===4){if(l.child!==null){g=l.stateNode.containerInfo,E=!0,l.child.return=l,l=l.child;continue}}else if(ou(e,l,o),l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break;for(;l.sibling===null;){if(l.return===null||l.return===t)return;l=l.return,l.tag===4&&(p=!1)}l.sibling.return=l.return,l=l.sibling}}function Za(e,t){if(K){switch(t.tag){case 0:case 11:case 14:case 15:Rr(3,t,t.return),Zi(3,t),Rr(5,t,t.return);return;case 1:return;case 5:var o=t.stateNode;if(o!=null){var l=t.memoizedProps;e=e!==null?e.memoizedProps:l;var p=t.type,g=t.updateQueue;t.updateQueue=null,g!==null&&De(o,g,p,e,l,t)}return;case 6:if(t.stateNode===null)throw Error(s(162));o=t.memoizedProps,He(t.stateNode,e!==null?e.memoizedProps:o,o);return;case 3:xe&&e!==null&&e.memoizedState.isDehydrated&&xr(t.stateNode.containerInfo);return;case 12:return;case 13:bo(t);return;case 19:bo(t);return;case 17:return}throw Error(s(163))}switch(t.tag){case 0:case 11:case 14:case 15:Rr(3,t,t.return),Zi(3,t),Rr(5,t,t.return);return;case 12:return;case 13:bo(t);return;case 19:bo(t);return;case 3:xe&&e!==null&&e.memoizedState.isDehydrated&&xr(t.stateNode.containerInfo);break;case 22:case 23:return}e:if($){switch(t.tag){case 1:case 5:case 6:break e;case 3:case 4:t=t.stateNode,tt(t.containerInfo,t.pendingChildren);break e}throw Error(s(163))}}function bo(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new zf),t.forEach(function(l){var p=Qf.bind(null,e,l);o.has(l)||(o.add(l),l.then(p,p))})}}function jf(e,t){for(de=t;de!==null;){t=de;var o=t.deletions;if(o!==null)for(var l=0;l";case No:return":has("+(Ya(e)||"")+")";case Go:return'[role="'+e.value+'"]';case Ho:return'"'+e.value+'"';case Wo:return'[data-testname="'+e.value+'"]';default:throw Error(s(365))}}function mu(e,t){var o=[];e=[e,0];for(var l=0;lp&&(p=E),l&=~g}if(l=p,l=at()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Bf(l/1960))-l,10e?16:e,pr===null)var l=!1;else{if(e=pr,pr=null,Yo=0,Be&6)throw Error(s(331));var p=Be;for(Be|=4,de=e.current;de!==null;){var g=de,E=g.child;if(de.flags&16){var U=g.deletions;if(U!==null){for(var V=0;Vat()-$a?Fr(e,0):qa|=o),tn(e,t)}function Tu(e,t){t===0&&(e.mode&1?(t=qn,qn<<=1,!(qn&130023424)&&(qn=4194304)):t=1);var o=Kt();e=qo(e,t),e!==null&&(bn(e,t,o),tn(e,o))}function Zf(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),Tu(e,o)}function Qf(e,t){var o=0;switch(e.tag){case 13:var l=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(t),Tu(e,o)}var Mu;Mu=function(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)mn=!0;else{if(!(e.lanes&o)&&!(t.flags&128))return mn=!1,Df(e,t,o);mn=!!(e.flags&131072)}else mn=!1,ot&&t.flags&1048576&&ds(t,Co,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var p=yn(t,St.current);pt(t,o),p=Ra(null,t,l,e,p,o);var g=Fa();return t.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tt(l)?(g=!0,sr(t)):g=!1,t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,ya(t),p.updater=wo,t.stateNode=p,p._reactInternals=t,wa(t,l,e,o),t=ba(null,t,l,!0,g,o)):(t.tag=0,ot&&g&&Sa(t),Jt(null,t,p,o),t=t.child),t;case 16:l=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,p=l._init,l=p(l._payload),t.type=l,p=t.tag=Yf(l),e=Xt(l,e),p){case 0:t=ja(null,t,l,e,o);break e;case 1:t=Js(null,t,l,e,o);break e;case 11:t=Vs(null,t,l,e,o);break e;case 14:t=Zs(null,t,l,Xt(l.type,e),o);break e}throw Error(s(306,l,""))}return t;case 0:return l=t.type,p=t.pendingProps,p=t.elementType===l?p:Xt(l,p),ja(e,t,l,p,o);case 1:return l=t.type,p=t.pendingProps,p=t.elementType===l?p:Xt(l,p),Js(e,t,l,p,o);case 3:e:{if(Ks(t),e===null)throw Error(s(387));l=t.pendingProps,g=t.memoizedState,p=g.element,os(e,t),xo(t,l,null,o);var E=t.memoizedState;if(l=E.element,xe&&g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:E.cache,transitions:E.transitions},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){p=Error(s(423)),t=qs(e,t,l,o,p);break e}else if(l!==p){p=Error(s(424)),t=qs(e,t,l,o,p);break e}else for(xe&&(vn=Rt(t.stateNode.containerInfo),pn=t,ot=!0,Dn=null,Di=!1),o=ys(t,null,l,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ti(),l===p){t=ar(e,t,o);break e}Jt(e,t,l,o)}t=t.child}return t;case 5:return xs(t),e===null&&Ea(t),l=t.type,p=t.pendingProps,g=e!==null?e.memoizedProps:null,E=p.children,H(l,p)?E=null:g!==null&&H(l,g)&&(t.flags|=32),Ys(e,t),Jt(e,t,E,o),t.child;case 6:return e===null&&Ea(t),null;case 13:return $s(e,t,o);case 4:return Ma(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ni(t,null,l,o):Jt(e,t,l,o),t.child;case 11:return l=t.type,p=t.pendingProps,p=t.elementType===l?p:Xt(l,p),Vs(e,t,l,p,o);case 7:return Jt(e,t,t.pendingProps,o),t.child;case 8:return Jt(e,t,t.pendingProps.children,o),t.child;case 12:return Jt(e,t,t.pendingProps.children,o),t.child;case 10:e:{if(l=t.type._context,p=t.pendingProps,g=t.memoizedProps,E=p.value,go(t,l,E),g!==null)if(dn(g.value,E)){if(g.children===p.children&&!Et.current){t=ar(e,t,o);break e}}else for(g=t.child,g!==null&&(g.return=t);g!==null;){var U=g.dependencies;if(U!==null){E=g.child;for(var V=U.firstContext;V!==null;){if(V.context===l){if(g.tag===1){V=nr(-1,o&-o),V.tag=2;var se=g.updateQueue;if(se!==null){se=se.shared;var ge=se.pending;ge===null?V.next=V:(V.next=ge.next,ge.next=V),se.pending=V}}g.lanes|=o,V=g.alternate,V!==null&&(V.lanes|=o),Yt(g.return,o,t),U.lanes|=o;break}V=V.next}}else if(g.tag===10)E=g.type===t.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(s(341));E.lanes|=o,U=E.alternate,U!==null&&(U.lanes|=o),Yt(E,o,t),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===t){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}Jt(e,t,p.children,o),t=t.child}return t;case 9:return p=t.type,l=t.pendingProps.children,pt(t,o),p=vt(p),l=l(p),t.flags|=1,Jt(e,t,l,o),t.child;case 14:return l=t.type,p=Xt(l,t.pendingProps),p=Xt(l.type,p),Zs(e,t,l,p,o);case 15:return Qs(e,t,t.type,t.pendingProps,o);case 17:return l=t.type,p=t.pendingProps,p=t.elementType===l?p:Xt(l,p),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,Tt(l)?(e=!0,sr(t)):e=!1,pt(t,o),cs(t,l,p),wa(t,l,p,o),ba(null,t,l,!0,e,o);case 19:return ru(e,t,o);case 22:return Xs(e,t,o)}throw Error(s(156,t.tag))};function ku(e,t){return tr(e,t)}function Xf(e,t,o,l){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(e,t,o,l){return new Xf(e,t,o,l)}function ll(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yf(e){if(typeof e=="function")return ll(e)?1:0;if(e!=null){if(e=e.$$typeof,e===T)return 11;if(e===w)return 14}return 2}function gr(e,t){var o=e.alternate;return o===null?(o=Tn(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function ea(e,t,o,l,p,g){var E=2;if(l=e,typeof e=="function")ll(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case d:return Or(o.children,p,g,t);case m:E=8,p|=8;break;case y:return e=Tn(12,o,t,p|2),e.elementType=y,e.lanes=g,e;case S:return e=Tn(13,o,t,p),e.elementType=S,e.lanes=g,e;case _:return e=Tn(19,o,t,p),e.elementType=_,e.lanes=g,e;case D:return ta(o,p,g,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x:E=10;break e;case C:E=9;break e;case T:E=11;break e;case w:E=14;break e;case M:E=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Tn(E,o,t,p),t.elementType=e,t.type=l,t.lanes=g,t}function Or(e,t,o,l){return e=Tn(7,e,l,t),e.lanes=o,e}function ta(e,t,o,l){return e=Tn(22,e,l,t),e.elementType=D,e.lanes=o,e.stateNode={},e}function sl(e,t,o){return e=Tn(6,e,null,t),e.lanes=o,e}function ul(e,t,o){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jf(e,t,o,l,p){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ue,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yr(0),this.expirationTimes=Yr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yr(0),this.identifierPrefix=l,this.onRecoverableError=p,xe&&(this.mutableSourceEagerHydrationData=null)}function Pu(e,t,o,l,p,g,E,U,V){return e=new Jf(e,t,o,U,V),t===1?(t=1,g===!0&&(t|=8)):t=0,g=Tn(3,null,null,t),e.current=g,g.stateNode=e,g.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null},ya(g),e}function Lu(e){if(!e)return sn;e=e._reactInternals;e:{if(J(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var o=e.type;if(Tt(o))return Qr(e,o,t)}return t}function Uu(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=O(t),e===null?null:e.stateNode}function Ru(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o=se&&g>=Fe&&p<=ge&&E<=Le){e.splice(t,1);break}else if(l!==se||o.width!==V.width||LeE){if(!(g!==Fe||o.height!==V.height||gep)){se>l&&(V.width+=se-l,V.x=l),geg&&(V.height+=Fe-g,V.y=g),Leo&&(o=E)),E ")+` +`+g.stack}return{value:e,source:t,stack:p}}function Ia(e,t){try{console.error(t.value)}catch(o){setTimeout(function(){throw o})}}var Rf=typeof WeakMap=="function"?WeakMap:Map;function js(e,t,o){o=nr(-1,o),o.tag=3,o.payload={element:null};var a=t.value;return o.callback=function(){Qo||(Qo=!0,tl=a),Ia(e,t)},o}function bs(e,t,o){o=nr(-1,o),o.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var p=t.value;o.payload=function(){return a(p)},o.callback=function(){Ia(e,t)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(o.callback=function(){Ia(e,t),typeof a!="function"&&(hr===null?hr=new Set([this]):hr.add(this));var E=t.stack;this.componentDidCatch(t.value,{componentStack:E!==null?E:""})}),o}function Bs(e,t,o){var a=e.pingCache;if(a===null){a=e.pingCache=new Rf;var p=new Set;a.set(t,p)}else p=a.get(t),p===void 0&&(p=new Set,a.set(t,p));p.has(o)||(p.add(o),e=Vf.bind(null,e,t,o),t.then(e,e))}function Ns(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Gs(e,t,o,a,p){return e.mode&1?(e.flags|=65536,e.lanes=p,e):(e===t?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(t=nr(-1,1),t.tag=2,dr(o,t))),o.lanes|=1),e)}function Hn(e){e.flags|=4}function Ws(e,t){if(e!==null&&e.child===t.child)return!0;if(t.flags&16)return!1;for(e=t.child;e!==null;){if(e.flags&12854||e.subtreeFlags&12854)return!1;e=e.sibling}return!0}var Gi,Wi,Fo,Ao;if(K)Gi=function(e,t){for(var o=t.child;o!==null;){if(o.tag===5||o.tag===6)I(e,o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break;for(;o.sibling===null;){if(o.return===null||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Wi=function(){},Fo=function(e,t,o,a,p){if(e=e.memoizedProps,e!==a){var g=t.stateNode,E=Gn(Cn.current);o=Y(g,o,e,a,p,E),(t.updateQueue=o)&&Hn(t)}},Ao=function(e,t,o,a){o!==a&&Hn(t)};else if($){Gi=function(e,t,o,a){for(var p=t.child;p!==null;){if(p.tag===5){var g=p.stateNode;o&&a&&(g=lr(g,p.type,p.memoizedProps,p)),I(e,g)}else if(p.tag===6)g=p.stateNode,o&&a&&(g=rt(g,p.memoizedProps,p)),I(e,g);else if(p.tag!==4){if(p.tag===22&&p.memoizedState!==null)g=p.child,g!==null&&(g.return=p),Gi(e,p,!0,!0);else if(p.child!==null){p.child.return=p,p=p.child;continue}}if(p===t)break;for(;p.sibling===null;){if(p.return===null||p.return===t)return;p=p.return}p.sibling.return=p.return,p=p.sibling}};var Hs=function(e,t,o,a){for(var p=t.child;p!==null;){if(p.tag===5){var g=p.stateNode;o&&a&&(g=lr(g,p.type,p.memoizedProps,p)),Wt(e,g)}else if(p.tag===6)g=p.stateNode,o&&a&&(g=rt(g,p.memoizedProps,p)),Wt(e,g);else if(p.tag!==4){if(p.tag===22&&p.memoizedState!==null)g=p.child,g!==null&&(g.return=p),Hs(e,p,!0,!0);else if(p.child!==null){p.child.return=p,p=p.child;continue}}if(p===t)break;for(;p.sibling===null;){if(p.return===null||p.return===t)return;p=p.return}p.sibling.return=p.return,p=p.sibling}};Wi=function(e,t){var o=t.stateNode;if(!Ws(e,t)){e=o.containerInfo;var a=Un(e);Hs(a,t,!1,!1),o.pendingChildren=a,Hn(t),Ht(e,a)}},Fo=function(e,t,o,a,p){var g=e.stateNode,E=e.memoizedProps;if((e=Ws(e,t))&&E===a)t.stateNode=g;else{var U=t.stateNode,V=Gn(Cn.current),se=null;E!==a&&(se=Y(U,o,E,a,p,V)),e&&se===null?t.stateNode=g:(g=Yn(g,se,o,E,a,t,e,U),Q(g,o,a,p,V)&&Hn(t),t.stateNode=g,e?Hn(t):Gi(g,t,!1,!1))}},Ao=function(e,t,o,a){o!==a?(e=Gn(ri.current),o=Gn(Cn.current),t.stateNode=re(a,e,o,t),Hn(t)):t.stateNode=e.stateNode}}else Wi=function(){},Fo=function(){},Ao=function(){};function Hi(e,t){if(!ot)switch(e.tailMode){case"hidden":t=e.tail;for(var o=null;t!==null;)t.alternate!==null&&(o=t),t=t.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var a=null;o!==null;)o.alternate!==null&&(a=o),o=o.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function jt(e){var t=e.alternate!==null&&e.alternate.child===e.child,o=0,a=0;if(t)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,a|=p.subtreeFlags&14680064,a|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,a|=p.subtreeFlags,a|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=a,e.childLanes=o,t}function Ff(e,t,o){var a=t.pendingProps;switch(Ca(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(t),null;case 1:return Tt(t.type)&&Fn(),jt(t),null;case 3:return a=t.stateNode,ii(),Ye(Et),Ye(St),La(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Di(t)?Hn(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dn!==null&&(il(Dn),Dn=null))),Wi(e,t),jt(t),null;case 5:ka(t),o=Gn(ri.current);var p=t.type;if(e!==null&&t.stateNode!=null)Fo(e,t,p,a,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(s(166));return jt(t),null}if(e=Gn(Cn.current),Di(t)){if(!xe)throw Error(s(175));e=an(t.stateNode,t.type,t.memoizedProps,o,e,t,!Ai),t.updateQueue=e,e!==null&&Hn(t)}else{var g=k(p,a,o,e,t);Gi(g,t,!1,!1),t.stateNode=g,Q(g,p,a,o,e)&&Hn(t)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return jt(t),null;case 6:if(e&&t.stateNode!=null)Ao(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(s(166));if(e=Gn(ri.current),o=Gn(Cn.current),Di(t)){if(!xe)throw Error(s(176));if(e=t.stateNode,a=t.memoizedProps,(o=Jn(e,a,t,!Ai))&&(p=pn,p!==null))switch(g=(p.mode&1)!==0,p.tag){case 3:_i(p.stateNode.containerInfo,e,a,g);break;case 5:Ei(p.type,p.memoizedProps,p.stateNode,e,a,g)}o&&Hn(t)}else t.stateNode=re(a,e,o,t)}return jt(t),null;case 13:if(Ye(lt),a=t.memoizedState,ot&&vn!==null&&t.mode&1&&!(t.flags&128)){for(e=vn;e;)e=ft(e);return ti(),t.flags|=98560,t}if(a!==null&&a.dehydrated!==null){if(a=Di(t),e===null){if(!a)throw Error(s(318));if(!xe)throw Error(s(344));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));ma(e,t)}else ti(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;return jt(t),null}return Dn!==null&&(il(Dn),Dn=null),t.flags&128?(t.lanes=o,t):(a=a!==null,o=!1,e===null?Di(t):o=e.memoizedState!==null,a&&!o&&(t.child.flags|=8192,t.mode&1&&(e===null||lt.current&1?Ct===0&&(Ct=3):al())),t.updateQueue!==null&&(t.flags|=4),jt(t),null);case 4:return ii(),Wi(e,t),e===null&&ce(t.stateNode.containerInfo),jt(t),null;case 10:return kt(t.type._context),jt(t),null;case 17:return Tt(t.type)&&Fn(),jt(t),null;case 19:if(Ye(lt),p=t.memoizedState,p===null)return jt(t),null;if(a=(t.flags&128)!==0,g=p.rendering,g===null)if(a)Hi(p,!1);else{if(Ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(g=Eo(e),g!==null){for(t.flags|=128,Hi(p,!1),e=g.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=o,a=t.child;a!==null;)o=a,p=e,o.flags&=14680066,g=o.alternate,g===null?(o.childLanes=0,o.lanes=p,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=g.childLanes,o.lanes=g.lanes,o.child=g.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=g.memoizedProps,o.memoizedState=g.memoizedState,o.updateQueue=g.updateQueue,o.type=g.type,p=g.dependencies,o.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),a=a.sibling;return Ke(lt,lt.current&1|2),t.child}e=e.sibling}p.tail!==null&&at()>el&&(t.flags|=128,a=!0,Hi(p,!1),t.lanes=4194304)}else{if(!a)if(e=Eo(g),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),Hi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!g.alternate&&!ot)return jt(t),null}else 2*at()-p.renderingStartTime>el&&o!==1073741824&&(t.flags|=128,a=!0,Hi(p,!1),t.lanes=4194304);p.isBackwards?(g.sibling=t.child,t.child=g):(e=p.last,e!==null?e.sibling=g:t.child=g,p.last=g)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=at(),t.sibling=null,e=lt.current,Ke(lt,a?e&1|2:e&1),t):(jt(t),null);case 22:case 23:return ol(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&t.mode&1?gn&1073741824&&(jt(t),K&&t.subtreeFlags&6&&(t.flags|=8192)):jt(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}var Af=f.ReactCurrentOwner,mn=!1;function Jt(e,t,o,a){t.child=e===null?ys(t,null,o,a):ni(t,e.child,o,a)}function Vs(e,t,o,a,p){o=o.render;var g=t.ref;return pt(t,p),a=Ra(e,t,o,a,g,p),o=Fa(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~p,ar(e,t,p)):(ot&&o&&Sa(t),t.flags|=1,Jt(e,t,a,p),t.child)}function Zs(e,t,o,a,p){if(e===null){var g=o.type;return typeof g=="function"&&!ll(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(t.tag=15,t.type=g,Qs(e,t,g,a,p)):(e=ea(o.type,null,a,t,t.mode,p),e.ref=t.ref,e.return=t,t.child=e)}if(g=e.child,!(e.lanes&p)){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:Tr,o(E,a)&&e.ref===t.ref)return ar(e,t,p)}return t.flags|=1,e=gr(g,a),e.ref=t.ref,e.return=t,t.child=e}function Qs(e,t,o,a,p){if(e!==null&&Tr(e.memoizedProps,a)&&e.ref===t.ref)if(mn=!1,(e.lanes&p)!==0)e.flags&131072&&(mn=!0);else return t.lanes=e.lanes,ar(e,t,p);return ja(e,t,o,a,p)}function Xs(e,t,o){var a=t.pendingProps,p=a.children,g=e!==null?e.memoizedState:null;if(a.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null},Ke(ai,gn),gn|=o;else if(o&1073741824)t.memoizedState={baseLanes:0,cachePool:null},a=g!==null?g.baseLanes:o,Ke(ai,gn),gn|=a;else return e=g!==null?g.baseLanes|o:o,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null},t.updateQueue=null,Ke(ai,gn),gn|=e,null;else g!==null?(a=g.baseLanes|o,t.memoizedState=null):a=o,Ke(ai,gn),gn|=a;return Jt(e,t,p,o),t.child}function Ys(e,t){var o=t.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(t.flags|=512,t.flags|=2097152)}function ja(e,t,o,a,p){var g=Tt(o)?jn:St.current;return g=yn(t,g),pt(t,p),o=Ra(e,t,o,a,g,p),a=Fa(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~p,ar(e,t,p)):(ot&&a&&Sa(t),t.flags|=1,Jt(e,t,o,p),t.child)}function Js(e,t,o,a,p){if(Tt(o)){var g=!0;sr(t)}else g=!1;if(pt(t,p),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),cs(t,o,a),wa(t,o,a,p),a=!0;else if(e===null){var E=t.stateNode,U=t.memoizedProps;E.props=U;var V=E.context,se=o.contextType;typeof se=="object"&&se!==null?se=vt(se):(se=Tt(o)?jn:St.current,se=yn(t,se));var ge=o.getDerivedStateFromProps,Fe=typeof ge=="function"||typeof E.getSnapshotBeforeUpdate=="function";Fe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(U!==a||V!==se)&&fs(t,E,a,se),fr=!1;var Le=t.memoizedState;E.state=Le,xo(t,a,E,p),V=t.memoizedState,U!==a||Le!==V||Et.current||fr?(typeof ge=="function"&&(xa(t,o,ge,a),V=t.memoizedState),(U=fr||us(t,o,U,a,Le,V,se))?(Fe||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(t.flags|=4194308)):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=V),E.props=a,E.state=V,E.context=se,a=U):(typeof E.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{E=t.stateNode,os(e,t),U=t.memoizedProps,se=t.type===t.elementType?U:Xt(t.type,U),E.props=se,Fe=t.pendingProps,Le=E.context,V=o.contextType,typeof V=="object"&&V!==null?V=vt(V):(V=Tt(o)?jn:St.current,V=yn(t,V));var $e=o.getDerivedStateFromProps;(ge=typeof $e=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(U!==Fe||Le!==V)&&fs(t,E,a,V),fr=!1,Le=t.memoizedState,E.state=Le,xo(t,a,E,p);var Te=t.memoizedState;U!==Fe||Le!==Te||Et.current||fr?(typeof $e=="function"&&(xa(t,o,$e,a),Te=t.memoizedState),(se=fr||us(t,o,se,a,Le,Te,V)||!1)?(ge||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(a,Te,V),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(a,Te,V)),typeof E.componentDidUpdate=="function"&&(t.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof E.componentDidUpdate!="function"||U===e.memoizedProps&&Le===e.memoizedState||(t.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===e.memoizedProps&&Le===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=Te),E.props=a,E.state=Te,E.context=V,a=se):(typeof E.componentDidUpdate!="function"||U===e.memoizedProps&&Le===e.memoizedState||(t.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===e.memoizedProps&&Le===e.memoizedState||(t.flags|=1024),a=!1)}return ba(e,t,o,a,g,p)}function ba(e,t,o,a,p,g){Ys(e,t);var E=(t.flags&128)!==0;if(!a&&!E)return p&&un(t,o,!1),ar(e,t,g);a=t.stateNode,Af.current=t;var U=E&&typeof o.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&E?(t.child=ni(t,e.child,null,g),t.child=ni(t,null,U,g)):Jt(e,t,U,g),t.memoizedState=a.state,p&&un(t,o,!0),t.child}function Ks(e){var t=e.stateNode;t.pendingContext?Zr(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Zr(e,t.context,!1),Ma(e,t.containerInfo)}function qs(e,t,o,a,p){return ti(),Ta(p),t.flags|=256,Jt(e,t,o,a),t.child}var Do={dehydrated:null,treeContext:null,retryLane:0};function Oo(e){return{baseLanes:e,cachePool:null}}function $s(e,t,o){var a=t.pendingProps,p=lt.current,g=!1,E=(t.flags&128)!==0,U;if((U=E)||(U=e!==null&&e.memoizedState===null?!1:(p&2)!==0),U?(g=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Ke(lt,p&1),e===null)return Ea(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?ht(e)?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(p=a.children,e=a.fallback,g?(a=t.mode,g=t.child,p={mode:"hidden",children:p},!(a&1)&&g!==null?(g.childLanes=0,g.pendingProps=p):g=ta(p,a,0,null),e=Or(e,a,o,null),g.return=t,e.return=t,g.sibling=e,t.child=g,t.child.memoizedState=Oo(o),t.memoizedState=Do,e):Ba(t,p));if(p=e.memoizedState,p!==null){if(U=p.dehydrated,U!==null){if(E)return t.flags&256?(t.flags&=-257,zo(e,t,o,Error(s(422)))):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(g=a.fallback,p=t.mode,a=ta({mode:"visible",children:a.children},p,0,null),g=Or(g,p,o,null),g.flags|=2,a.return=t,g.return=t,a.sibling=g,t.child=a,t.mode&1&&ni(t,e.child,null,o),t.child.memoizedState=Oo(o),t.memoizedState=Do,g);if(!(t.mode&1))t=zo(e,t,o,null);else if(ht(U))t=zo(e,t,o,Error(s(419)));else if(a=(o&e.childLanes)!==0,mn||a){if(a=xt,a!==null){switch(o&-o){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}a=g&(a.suspendedLanes|o)?0:g,a!==0&&a!==p.retryLane&&(p.retryLane=a,En(e,a,-1))}al(),t=zo(e,t,o,Error(s(421)))}else Xe(U)?(t.flags|=128,t.child=e.child,t=Zf.bind(null,e),qt(U,t),t=null):(o=p.treeContext,xe&&(vn=On(U),pn=t,ot=!0,Dn=null,Ai=!1,o!==null&&(wn[Sn++]=rr,wn[Sn++]=ir,wn[Sn++]=kr,rr=o.id,ir=o.overflow,kr=t)),t=Ba(t,t.pendingProps.children),t.flags|=4096);return t}return g?(a=tu(e,t,a.children,a.fallback,o),g=t.child,p=e.child.memoizedState,g.memoizedState=p===null?Oo(o):{baseLanes:p.baseLanes|o,cachePool:null},g.childLanes=e.childLanes&~o,t.memoizedState=Do,a):(o=eu(e,t,a.children,o),t.memoizedState=null,o)}return g?(a=tu(e,t,a.children,a.fallback,o),g=t.child,p=e.child.memoizedState,g.memoizedState=p===null?Oo(o):{baseLanes:p.baseLanes|o,cachePool:null},g.childLanes=e.childLanes&~o,t.memoizedState=Do,a):(o=eu(e,t,a.children,o),t.memoizedState=null,o)}function Ba(e,t){return t=ta({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function eu(e,t,o,a){var p=e.child;return e=p.sibling,o=gr(p,{mode:"visible",children:o}),!(t.mode&1)&&(o.lanes=a),o.return=t,o.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=o}function tu(e,t,o,a,p){var g=t.mode;e=e.child;var E=e.sibling,U={mode:"hidden",children:o};return!(g&1)&&t.child!==e?(o=t.child,o.childLanes=0,o.pendingProps=U,t.deletions=null):(o=gr(e,U),o.subtreeFlags=e.subtreeFlags&14680064),E!==null?a=gr(E,a):(a=Or(a,g,p,null),a.flags|=2),a.return=t,o.return=t,o.sibling=a,t.child=o,a}function zo(e,t,o,a){return a!==null&&Ta(a),ni(t,e.child,null,o),e=Ba(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nu(e,t,o){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Yt(e.return,t,o)}function Na(e,t,o,a,p){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:o,tailMode:p}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=a,g.tail=o,g.tailMode=p)}function ru(e,t,o){var a=t.pendingProps,p=a.revealOrder,g=a.tail;if(Jt(e,t,a.children,o),a=lt.current,a&2)a=a&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nu(e,o,t);else if(e.tag===19)nu(e,o,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(Ke(lt,a),!(t.mode&1))t.memoizedState=null;else switch(p){case"forwards":for(o=t.child,p=null;o!==null;)e=o.alternate,e!==null&&Eo(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=t.child,t.child=null):(p=o.sibling,o.sibling=null),Na(t,!1,p,o,g);break;case"backwards":for(o=null,p=t.child,t.child=null;p!==null;){if(e=p.alternate,e!==null&&Eo(e)===null){t.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}Na(t,!0,o,null,g);break;case"together":Na(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ar(e,t,o){if(e!==null&&(t.dependencies=e.dependencies),li|=t.lanes,!(o&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,o=gr(e,e.pendingProps),t.child=o,o.return=t;e.sibling!==null;)e=e.sibling,o=o.sibling=gr(e,e.pendingProps),o.return=t;o.sibling=null}return t.child}function Df(e,t,o){switch(t.tag){case 3:Ks(t),ti();break;case 5:xs(t);break;case 1:Tt(t.type)&&sr(t);break;case 4:Ma(t,t.stateNode.containerInfo);break;case 10:go(t,t.type._context,t.memoizedProps.value);break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Ke(lt,lt.current&1),t.flags|=128,null):o&t.child.childLanes?$s(e,t,o):(Ke(lt,lt.current&1),e=ar(e,t,o),e!==null?e.sibling:null);Ke(lt,lt.current&1);break;case 19:if(a=(o&t.childLanes)!==0,e.flags&128){if(a)return ru(e,t,o);t.flags|=128}var p=t.memoizedState;if(p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Ke(lt,lt.current),a)break;return null;case 22:case 23:return t.lanes=0,Xs(e,t,o)}return ar(e,t,o)}function Of(e,t){switch(Ca(t),t.tag){case 1:return Tt(t.type)&&Fn(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ii(),Ye(Et),Ye(St),La(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ka(t),null;case 13:if(Ye(lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ti()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ye(lt),null;case 4:return ii(),null;case 10:return kt(t.type._context),null;case 22:case 23:return ol(),null;case 24:return null;default:return null}}var Io=!1,Ur=!1,zf=typeof WeakSet=="function"?WeakSet:Set,de=null;function jo(e,t){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(a){nn(e,t,a)}else o.current=null}function Ga(e,t,o){try{o()}catch(a){nn(e,t,a)}}var iu=!1;function If(e,t){for(j(e.containerInfo),de=t;de!==null;)if(e=de,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,de=t;else for(;de!==null;){e=de;try{var o=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(o!==null){var a=o.memoizedProps,p=o.memoizedState,g=e.stateNode,E=g.getSnapshotBeforeUpdate(e.elementType===e.type?a:Xt(e.type,a),p);g.__reactInternalSnapshotBeforeUpdate=E}break;case 3:K&&Ln(e.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(U){nn(e,e.return,U)}if(t=e.sibling,t!==null){t.return=e.return,de=t;break}de=e.return}return o=iu,iu=!1,o}function Rr(e,t,o){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var p=a=a.next;do{if((p.tag&e)===e){var g=p.destroy;p.destroy=void 0,g!==void 0&&Ga(t,o,g)}p=p.next}while(p!==a)}}function Vi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var o=t=t.next;do{if((o.tag&e)===e){var a=o.create;o.destroy=a()}o=o.next}while(o!==t)}}function Wa(e){var t=e.ref;if(t!==null){var o=e.stateNode;switch(e.tag){case 5:e=ae(o);break;default:e=o}typeof t=="function"?t(e):t.current=e}}function ou(e,t,o){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(_r,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var a=e=e.next;do{var p=a,g=p.destroy;p=p.tag,g!==void 0&&(p&2||p&4)&&Ga(t,o,g),a=a.next}while(a!==e)}break;case 1:if(jo(t,o),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(E){nn(t,o,E)}break;case 5:jo(t,o);break;case 4:K?fu(e,t,o):$&&$&&(t=t.stateNode.containerInfo,o=Un(t),tt(t,o))}}function au(e,t,o){for(var a=t;;)if(ou(e,a,o),a.child===null||K&&a.tag===4){if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}else a.child.return=a,a=a.child}function lu(e){var t=e.alternate;t!==null&&(e.alternate=null,lu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ke(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function su(e){return e.tag===5||e.tag===3||e.tag===4}function uu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||su(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cu(e){if(K){e:{for(var t=e.return;t!==null;){if(su(t))break e;t=t.return}throw Error(s(160))}var o=t;switch(o.tag){case 5:t=o.stateNode,o.flags&32&&(Je(t),o.flags&=-33),o=uu(e),Va(e,o,t);break;case 3:case 4:t=o.stateNode.containerInfo,o=uu(e),Ha(e,o,t);break;default:throw Error(s(161))}}}function Ha(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?be(o,e,t):ze(o,e);else if(a!==4&&(e=e.child,e!==null))for(Ha(e,t,o),e=e.sibling;e!==null;)Ha(e,t,o),e=e.sibling}function Va(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?qe(o,e,t):Me(o,e);else if(a!==4&&(e=e.child,e!==null))for(Va(e,t,o),e=e.sibling;e!==null;)Va(e,t,o),e=e.sibling}function fu(e,t,o){for(var a=t,p=!1,g,E;;){if(!p){p=a.return;e:for(;;){if(p===null)throw Error(s(160));switch(g=p.stateNode,p.tag){case 5:E=!1;break e;case 3:g=g.containerInfo,E=!0;break e;case 4:g=g.containerInfo,E=!0;break e}p=p.return}p=!0}if(a.tag===5||a.tag===6)au(e,a,o),E?Qe(g,a.stateNode):Ue(g,a.stateNode);else if(a.tag===18)E?co(g,a.stateNode):ga(g,a.stateNode);else if(a.tag===4){if(a.child!==null){g=a.stateNode.containerInfo,E=!0,a.child.return=a,a=a.child;continue}}else if(ou(e,a,o),a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return,a.tag===4&&(p=!1)}a.sibling.return=a.return,a=a.sibling}}function Za(e,t){if(K){switch(t.tag){case 0:case 11:case 14:case 15:Rr(3,t,t.return),Vi(3,t),Rr(5,t,t.return);return;case 1:return;case 5:var o=t.stateNode;if(o!=null){var a=t.memoizedProps;e=e!==null?e.memoizedProps:a;var p=t.type,g=t.updateQueue;t.updateQueue=null,g!==null&&De(o,g,p,e,a,t)}return;case 6:if(t.stateNode===null)throw Error(s(162));o=t.memoizedProps,He(t.stateNode,e!==null?e.memoizedProps:o,o);return;case 3:xe&&e!==null&&e.memoizedState.isDehydrated&&xr(t.stateNode.containerInfo);return;case 12:return;case 13:bo(t);return;case 19:bo(t);return;case 17:return}throw Error(s(163))}switch(t.tag){case 0:case 11:case 14:case 15:Rr(3,t,t.return),Vi(3,t),Rr(5,t,t.return);return;case 12:return;case 13:bo(t);return;case 19:bo(t);return;case 3:xe&&e!==null&&e.memoizedState.isDehydrated&&xr(t.stateNode.containerInfo);break;case 22:case 23:return}e:if($){switch(t.tag){case 1:case 5:case 6:break e;case 3:case 4:t=t.stateNode,tt(t.containerInfo,t.pendingChildren);break e}throw Error(s(163))}}function bo(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new zf),t.forEach(function(a){var p=Qf.bind(null,e,a);o.has(a)||(o.add(a),a.then(p,p))})}}function jf(e,t){for(de=t;de!==null;){t=de;var o=t.deletions;if(o!==null)for(var a=0;a";case No:return":has("+(Ya(e)||"")+")";case Go:return'[role="'+e.value+'"]';case Ho:return'"'+e.value+'"';case Wo:return'[data-testname="'+e.value+'"]';default:throw Error(s(365))}}function mu(e,t){var o=[];e=[e,0];for(var a=0;ap&&(p=E),a&=~g}if(a=p,a=at()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*Bf(a/1960))-a,10e?16:e,pr===null)var a=!1;else{if(e=pr,pr=null,Yo=0,Be&6)throw Error(s(331));var p=Be;for(Be|=4,de=e.current;de!==null;){var g=de,E=g.child;if(de.flags&16){var U=g.deletions;if(U!==null){for(var V=0;Vat()-$a?Fr(e,0):qa|=o),tn(e,t)}function Tu(e,t){t===0&&(e.mode&1?(t=qn,qn<<=1,!(qn&130023424)&&(qn=4194304)):t=1);var o=Kt();e=qo(e,t),e!==null&&(bn(e,t,o),tn(e,o))}function Zf(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),Tu(e,o)}function Qf(e,t){var o=0;switch(e.tag){case 13:var a=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(s(314))}a!==null&&a.delete(t),Tu(e,o)}var Mu;Mu=function(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)mn=!0;else{if(!(e.lanes&o)&&!(t.flags&128))return mn=!1,Df(e,t,o);mn=!!(e.flags&131072)}else mn=!1,ot&&t.flags&1048576&&ds(t,Co,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var p=yn(t,St.current);pt(t,o),p=Ra(null,t,a,e,p,o);var g=Fa();return t.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tt(a)?(g=!0,sr(t)):g=!1,t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,ya(t),p.updater=wo,t.stateNode=p,p._reactInternals=t,wa(t,a,e,o),t=ba(null,t,a,!0,g,o)):(t.tag=0,ot&&g&&Sa(t),Jt(null,t,p,o),t=t.child),t;case 16:a=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,p=a._init,a=p(a._payload),t.type=a,p=t.tag=Yf(a),e=Xt(a,e),p){case 0:t=ja(null,t,a,e,o);break e;case 1:t=Js(null,t,a,e,o);break e;case 11:t=Vs(null,t,a,e,o);break e;case 14:t=Zs(null,t,a,Xt(a.type,e),o);break e}throw Error(s(306,a,""))}return t;case 0:return a=t.type,p=t.pendingProps,p=t.elementType===a?p:Xt(a,p),ja(e,t,a,p,o);case 1:return a=t.type,p=t.pendingProps,p=t.elementType===a?p:Xt(a,p),Js(e,t,a,p,o);case 3:e:{if(Ks(t),e===null)throw Error(s(387));a=t.pendingProps,g=t.memoizedState,p=g.element,os(e,t),xo(t,a,null,o);var E=t.memoizedState;if(a=E.element,xe&&g.isDehydrated)if(g={element:a,isDehydrated:!1,cache:E.cache,transitions:E.transitions},t.updateQueue.baseState=g,t.memoizedState=g,t.flags&256){p=Error(s(423)),t=qs(e,t,a,o,p);break e}else if(a!==p){p=Error(s(424)),t=qs(e,t,a,o,p);break e}else for(xe&&(vn=Rt(t.stateNode.containerInfo),pn=t,ot=!0,Dn=null,Ai=!1),o=ys(t,null,a,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ti(),a===p){t=ar(e,t,o);break e}Jt(e,t,a,o)}t=t.child}return t;case 5:return xs(t),e===null&&Ea(t),a=t.type,p=t.pendingProps,g=e!==null?e.memoizedProps:null,E=p.children,H(a,p)?E=null:g!==null&&H(a,g)&&(t.flags|=32),Ys(e,t),Jt(e,t,E,o),t.child;case 6:return e===null&&Ea(t),null;case 13:return $s(e,t,o);case 4:return Ma(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ni(t,null,a,o):Jt(e,t,a,o),t.child;case 11:return a=t.type,p=t.pendingProps,p=t.elementType===a?p:Xt(a,p),Vs(e,t,a,p,o);case 7:return Jt(e,t,t.pendingProps,o),t.child;case 8:return Jt(e,t,t.pendingProps.children,o),t.child;case 12:return Jt(e,t,t.pendingProps.children,o),t.child;case 10:e:{if(a=t.type._context,p=t.pendingProps,g=t.memoizedProps,E=p.value,go(t,a,E),g!==null)if(dn(g.value,E)){if(g.children===p.children&&!Et.current){t=ar(e,t,o);break e}}else for(g=t.child,g!==null&&(g.return=t);g!==null;){var U=g.dependencies;if(U!==null){E=g.child;for(var V=U.firstContext;V!==null;){if(V.context===a){if(g.tag===1){V=nr(-1,o&-o),V.tag=2;var se=g.updateQueue;if(se!==null){se=se.shared;var ge=se.pending;ge===null?V.next=V:(V.next=ge.next,ge.next=V),se.pending=V}}g.lanes|=o,V=g.alternate,V!==null&&(V.lanes|=o),Yt(g.return,o,t),U.lanes|=o;break}V=V.next}}else if(g.tag===10)E=g.type===t.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(s(341));E.lanes|=o,U=E.alternate,U!==null&&(U.lanes|=o),Yt(E,o,t),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===t){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}Jt(e,t,p.children,o),t=t.child}return t;case 9:return p=t.type,a=t.pendingProps.children,pt(t,o),p=vt(p),a=a(p),t.flags|=1,Jt(e,t,a,o),t.child;case 14:return a=t.type,p=Xt(a,t.pendingProps),p=Xt(a.type,p),Zs(e,t,a,p,o);case 15:return Qs(e,t,t.type,t.pendingProps,o);case 17:return a=t.type,p=t.pendingProps,p=t.elementType===a?p:Xt(a,p),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,Tt(a)?(e=!0,sr(t)):e=!1,pt(t,o),cs(t,a,p),wa(t,a,p,o),ba(null,t,a,!0,e,o);case 19:return ru(e,t,o);case 22:return Xs(e,t,o)}throw Error(s(156,t.tag))};function ku(e,t){return tr(e,t)}function Xf(e,t,o,a){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(e,t,o,a){return new Xf(e,t,o,a)}function ll(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yf(e){if(typeof e=="function")return ll(e)?1:0;if(e!=null){if(e=e.$$typeof,e===T)return 11;if(e===w)return 14}return 2}function gr(e,t){var o=e.alternate;return o===null?(o=Tn(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function ea(e,t,o,a,p,g){var E=2;if(a=e,typeof e=="function")ll(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case d:return Or(o.children,p,g,t);case m:E=8,p|=8;break;case y:return e=Tn(12,o,t,p|2),e.elementType=y,e.lanes=g,e;case S:return e=Tn(13,o,t,p),e.elementType=S,e.lanes=g,e;case _:return e=Tn(19,o,t,p),e.elementType=_,e.lanes=g,e;case D:return ta(o,p,g,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x:E=10;break e;case C:E=9;break e;case T:E=11;break e;case w:E=14;break e;case M:E=16,a=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Tn(E,o,t,p),t.elementType=e,t.type=a,t.lanes=g,t}function Or(e,t,o,a){return e=Tn(7,e,a,t),e.lanes=o,e}function ta(e,t,o,a){return e=Tn(22,e,a,t),e.elementType=D,e.lanes=o,e.stateNode={},e}function sl(e,t,o){return e=Tn(6,e,null,t),e.lanes=o,e}function ul(e,t,o){return t=Tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jf(e,t,o,a,p){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ue,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yr(0),this.expirationTimes=Yr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yr(0),this.identifierPrefix=a,this.onRecoverableError=p,xe&&(this.mutableSourceEagerHydrationData=null)}function Pu(e,t,o,a,p,g,E,U,V){return e=new Jf(e,t,o,U,V),t===1?(t=1,g===!0&&(t|=8)):t=0,g=Tn(3,null,null,t),e.current=g,g.stateNode=e,g.memoizedState={element:a,isDehydrated:o,cache:null,transitions:null},ya(g),e}function Lu(e){if(!e)return sn;e=e._reactInternals;e:{if(J(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var o=e.type;if(Tt(o))return Qr(e,o,t)}return t}function Uu(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=O(t),e===null?null:e.stateNode}function Ru(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o=se&&g>=Fe&&p<=ge&&E<=Le){e.splice(t,1);break}else if(a!==se||o.width!==V.width||LeE){if(!(g!==Fe||o.height!==V.height||gep)){se>a&&(V.width+=se-a,V.x=a),geg&&(V.height+=Fe-g,V.y=g),Leo&&(o=E)),E ")+` No matching component was found for: - `)+e.join(" > ")}return null},c.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return ae(e.child.stateNode);default:return e.child.stateNode}},c.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:Kf,findFiberByHostInstance:e.findFiberByHostInstance||qf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{_r=t.inject(e),fn=t}catch{}e=!!t.checkDCE}}return e},c.isAlreadyRendering=function(){return!1},c.observeVisibleRects=function(e,t,o,l){if(!pe)throw Error(s(363));e=Ja(e,t);var p=Oe(e,o,l).disconnect;return{disconnect:function(){p()}}},c.registerMutableSourceForHydration=function(e,t){var o=t._getVersion;o=o(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,o]:e.mutableSourceEagerHydrationData.push(t,o)},c.runWithPriority=function(e,t){var o=Ne;try{return Ne=e,t()}finally{Ne=o}},c.shouldError=function(){return null},c.shouldSuspend=function(){return!1},c.updateContainer=function(e,t,o,l){var p=t.current,g=Kt(),E=vr(p);return o=Lu(o),t.context===null?t.context=o:t.pendingContext=o,t=nr(g,E),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),dr(p,t),e=En(p,E,g),e!==null&&yo(e,p,E),E},c};Lc.exports=Id;var jd=Lc.exports;const bd=Cc(jd),Bd=a=>typeof a=="object"&&typeof a.then=="function",jr=[];function Fc(a,n,c=(v,i)=>v===i){if(a===n)return!0;if(!a||!n)return!1;const v=a.length;if(n.length!==v)return!1;for(let i=0;i0&&(r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.remove,v.lifespan)),r.response;if(!c)throw r.promise}const i={keys:n,equal:v.equal,remove:()=>{const r=jr.indexOf(i);r!==-1&&jr.splice(r,1)},promise:(Bd(a)?a:a(...n)).then(r=>{i.response=r,v.lifespan&&v.lifespan>0&&(i.timeout=setTimeout(i.remove,v.lifespan))}).catch(r=>i.error=r)};if(jr.push(i),!c)throw i.promise}const Nd=(a,n,c)=>Ac(a,n,!1,c),Gd=(a,n,c)=>void Ac(a,n,!0,c),Wd=a=>{if(a===void 0||a.length===0)jr.splice(0,jr.length);else{const n=jr.find(c=>Fc(a,c.keys,c.equal));n&&n.remove()}},Kl={},Hd=a=>void Object.assign(Kl,a);function Vd(a,n){function c(d,{args:m=[],attach:y,...x},C){let T=`${d[0].toUpperCase()}${d.slice(1)}`,S;if(d==="primitive"){if(x.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const _=x.object;S=di(_,{type:d,root:C,attach:y,primitive:!0})}else{const _=Kl[T];if(!_)throw new Error(`R3F: ${T} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(m))throw new Error("R3F: The args prop must be an array!");S=di(new _(...m),{type:d,root:C,attach:y,memoizedProps:{args:m}})}return S.__r3f.attach===void 0&&(S instanceof Ec?S.__r3f.attach="geometry":S instanceof ld&&(S.__r3f.attach="material")),T!=="inject"&&ml(S,x),S}function v(d,m){let y=!1;if(m){var x,C;(x=m.__r3f)!=null&&x.attach?vl(d,m,m.__r3f.attach):m.isObject3D&&d.isObject3D&&(d.add(m),y=!0),y||(C=d.__r3f)==null||C.objects.push(m),m.__r3f||di(m,{}),m.__r3f.parent=d,Ol(m),hi(m)}}function i(d,m,y){let x=!1;if(m){var C,T;if((C=m.__r3f)!=null&&C.attach)vl(d,m,m.__r3f.attach);else if(m.isObject3D&&d.isObject3D){m.parent=d,m.dispatchEvent({type:"added"});const S=d.children.filter(w=>w!==m),_=S.indexOf(y);d.children=[...S.slice(0,_),m,...S.slice(_)],x=!0}x||(T=d.__r3f)==null||T.objects.push(m),m.__r3f||di(m,{}),m.__r3f.parent=d,Ol(m),hi(m)}}function r(d,m,y=!1){d&&[...d].forEach(x=>s(m,x,y))}function s(d,m,y){if(m){var x,C,T;if(m.__r3f&&(m.__r3f.parent=null),(x=d.__r3f)!=null&&x.objects&&(d.__r3f.objects=d.__r3f.objects.filter(D=>D!==m)),(C=m.__r3f)!=null&&C.attach)Bu(d,m,m.__r3f.attach);else if(m.isObject3D&&d.isObject3D){var S;d.remove(m),(S=m.__r3f)!=null&&S.root&&e1(m.__r3f.root,m)}const w=(T=m.__r3f)==null?void 0:T.primitive,M=!w&&(y===void 0?m.dispose!==null:y);if(!w){var _;r((_=m.__r3f)==null?void 0:_.objects,m,M),r(m.children,m,M)}if(delete m.__r3f,M&&m.dispose&&m.type!=="Scene"){const D=()=>{try{m.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?Al.unstable_scheduleCallback(Al.unstable_IdlePriority,D):D()}hi(d)}}function f(d,m,y,x){var C;const T=(C=d.__r3f)==null?void 0:C.parent;if(!T)return;const S=c(m,y,d.__r3f.root);if(d.children){for(const _ of d.children)_.__r3f&&v(S,_);d.children=d.children.filter(_=>!_.__r3f)}d.__r3f.objects.forEach(_=>v(S,_)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||s(T,d),S.parent&&(S.__r3f.autoRemovedBeforeAppend=!0),v(T,S),S.raycast&&S.__r3f.eventCount&&S.__r3f.root.getState().internal.interaction.push(S),[x,x.alternate].forEach(_=>{_!==null&&(_.stateNode=S,_.ref&&(typeof _.ref=="function"?_.ref(S):_.ref.current=S))})}const u=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:bd({createInstance:c,removeChild:s,appendChild:v,appendInitialChild:v,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,m)=>{if(!m)return;const y=d.getState().scene;y.__r3f&&(y.__r3f.root=d,v(y,m))},removeChildFromContainer:(d,m)=>{m&&s(d.getState().scene,m)},insertInContainerBefore:(d,m,y)=>{if(!m||!y)return;const x=d.getState().scene;x.__r3f&&i(x,m,y)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var m;return!!((m=d==null?void 0:d.__r3f)!=null?m:{}).handlers},prepareUpdate(d,m,y,x){var C;if(((C=d==null?void 0:d.__r3f)!=null?C:{}).primitive&&x.object&&x.object!==d)return[!0];{const{args:S=[],children:_,...w}=x,{args:M=[],children:D,...R}=y;if(!Array.isArray(S))throw new Error("R3F: the args prop must be an array!");if(S.some((b,B)=>b!==M[B]))return[!0];const A=Bc(d,w,R,!0);return A.changes.length?[!1,A]:null}},commitUpdate(d,[m,y],x,C,T,S){m?f(d,x,T,S):ml(d,y)},commitMount(d,m,y,x){var C;const T=(C=d.__r3f)!=null?C:{};d.raycast&&T.handlers&&T.eventCount&&d.__r3f.root.getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>di(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var m;const{attach:y,parent:x}=(m=d.__r3f)!=null?m:{};y&&x&&Bu(x,d,y),d.isObject3D&&(d.visible=!1),hi(d)},unhideInstance(d,m){var y;const{attach:x,parent:C}=(y=d.__r3f)!=null?y:{};x&&C&&vl(C,d,x),(d.isObject3D&&m.visible==null||m.visible)&&(d.visible=!0),hi(d)},createTextInstance:u,hideTextInstance:u,unhideTextInstance:u,getCurrentEventPriority:()=>n?n():vi.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&nt.fun(performance.now)?performance.now:nt.fun(Date.now)?Date.now:()=>0,scheduleTimeout:nt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:nt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:ml}}var zu,Iu;const pl=a=>"colorSpace"in a||"outputColorSpace"in a,Dc=()=>{var a;return(a=Kl.ColorManagement)!=null?a:null},Oc=a=>a&&a.isOrthographicCamera,Zd=a=>a&&a.hasOwnProperty("current"),Si=typeof window<"u"&&((zu=window.document)!=null&&zu.createElement||((Iu=window.navigator)==null?void 0:Iu.product)==="ReactNative")?P.useLayoutEffect:P.useEffect;function zc(a){const n=P.useRef(a);return Si(()=>void(n.current=a),[a]),n}function Qd({set:a}){return Si(()=>(a(new Promise(()=>null)),()=>a(!1)),[a]),null}class Ic extends P.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}}Ic.getDerivedStateFromError=()=>({error:!0});const jc="__default",ju=new Map,Xd=a=>a&&!!a.memoized&&!!a.changes;function bc(a){var n;const c=typeof window<"u"?(n=window.devicePixelRatio)!=null?n:2:1;return Array.isArray(a)?Math.min(Math.max(a[0],c),a[1]):a}const qi=a=>{var n;return(n=a.__r3f)==null?void 0:n.root.getState()},nt={obj:a=>a===Object(a)&&!nt.arr(a)&&typeof a!="function",fun:a=>typeof a=="function",str:a=>typeof a=="string",num:a=>typeof a=="number",boo:a=>typeof a=="boolean",und:a=>a===void 0,arr:a=>Array.isArray(a),equ(a,n,{arrays:c="shallow",objects:v="reference",strict:i=!0}={}){if(typeof a!=typeof n||!!a!=!!n)return!1;if(nt.str(a)||nt.num(a))return a===n;const r=nt.obj(a);if(r&&v==="reference")return a===n;const s=nt.arr(a);if(s&&c==="reference")return a===n;if((s||r)&&a===n)return!0;let f;for(f in a)if(!(f in n))return!1;if(r&&c==="shallow"&&v==="shallow"){for(f in i?n:a)if(!nt.equ(a[f],n[f],{strict:i,objects:"reference"}))return!1}else for(f in i?n:a)if(a[f]!==n[f])return!1;if(nt.und(f)){if(s&&a.length===0&&n.length===0||r&&Object.keys(a).length===0&&Object.keys(n).length===0)return!0;if(a!==n)return!1}return!0}};function Yd(a){const n={nodes:{},materials:{}};return a&&a.traverse(c=>{c.name&&(n.nodes[c.name]=c),c.material&&!n.materials[c.material.name]&&(n.materials[c.material.name]=c.material)}),n}function Jd(a){a.dispose&&a.type!=="Scene"&&a.dispose();for(const n in a)n.dispose==null||n.dispose(),delete a[n]}function di(a,n){const c=a;return c.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...n},a}function Dl(a,n){let c=a;if(n.includes("-")){const v=n.split("-"),i=v.pop();return c=v.reduce((r,s)=>r[s],a),{target:c,key:i}}else return{target:c,key:n}}const bu=/-\d+$/;function vl(a,n,c){if(nt.str(c)){if(bu.test(c)){const r=c.replace(bu,""),{target:s,key:f}=Dl(a,r);Array.isArray(s[f])||(s[f]=[])}const{target:v,key:i}=Dl(a,c);n.__r3f.previousAttach=v[i],v[i]=n}else n.__r3f.previousAttach=c(a,n)}function Bu(a,n,c){var v,i;if(nt.str(c)){const{target:r,key:s}=Dl(a,c),f=n.__r3f.previousAttach;f===void 0?delete r[s]:r[s]=f}else(v=n.__r3f)==null||v.previousAttach==null||v.previousAttach(a,n);(i=n.__r3f)==null||delete i.previousAttach}function Bc(a,{children:n,key:c,ref:v,...i},{children:r,key:s,ref:f,...u}={},h=!1){var d;const m=(d=a==null?void 0:a.__r3f)!=null?d:{},y=Object.entries(i),x=[];if(h){const T=Object.keys(u);for(let S=0;S{var _;if((_=a.__r3f)!=null&&_.primitive&&T==="object"||nt.equ(S,u[T]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(T))return x.push([T,S,!0,[]]);let w=[];T.includes("-")&&(w=T.split("-")),x.push([T,S,!1,w]);for(const M in i){const D=i[M];M.startsWith(`${T}-`)&&x.push([M,D,!1,M.split("-")])}});const C={...i};return m.memoizedProps&&m.memoizedProps.args&&(C.args=m.memoizedProps.args),m.memoizedProps&&m.memoizedProps.attach&&(C.attach=m.memoizedProps.attach),{memoized:C,changes:x}}const Kd=typeof process<"u"&&!1;function ml(a,n){var c,v,i;const r=(c=a.__r3f)!=null?c:{},s=r.root,f=(v=s==null||s.getState==null?void 0:s.getState())!=null?v:{},{memoized:u,changes:h}=Xd(n)?n:Bc(a,n),d=r.eventCount;a.__r3f&&(a.__r3f.memoizedProps=u);for(let y=0;yM[D],a),!(w&&w.set))){const[M,...D]=S.reverse();_=D.reverse().reduce((R,A)=>R[A],a),x=M}if(C===jc+"remove")if(_.constructor){let M=ju.get(_.constructor);M||(M=new _.constructor,ju.set(_.constructor,M)),C=M[x]}else C=0;if(T)C?r.handlers[x]=C:delete r.handlers[x],r.eventCount=Object.keys(r.handlers).length;else if(w&&w.set&&(w.copy||w instanceof fl)){if(Array.isArray(C))w.fromArray?w.fromArray(C):w.set(...C);else if(w.copy&&C&&C.constructor&&(Kd?w.constructor.name===C.constructor.name:w.constructor===C.constructor))w.copy(C);else if(C!==void 0){const M=w instanceof io;!M&&w.setScalar?w.setScalar(C):w instanceof fl&&C instanceof fl?w.mask=C.mask:w.set(C),!Dc()&&!f.linear&&M&&w.convertSRGBToLinear()}}else if(_[x]=C,_[x]instanceof Vl&&_[x].format===od&&_[x].type===ad){const M=_[x];pl(M)&&pl(f.gl)?M.colorSpace=f.gl.outputColorSpace:M.encoding=f.gl.outputEncoding}hi(a)}if(r.parent&&f.internal&&a.raycast&&d!==r.eventCount){const y=f.internal.interaction.indexOf(a);y>-1&&f.internal.interaction.splice(y,1),r.eventCount&&f.internal.interaction.push(a)}return!(h.length===1&&h[0][0]==="onUpdate")&&h.length&&(i=a.__r3f)!=null&&i.parent&&Ol(a),a}function hi(a){var n,c;const v=(n=a.__r3f)==null||(c=n.root)==null||c.getState==null?void 0:c.getState();v&&v.internal.frames===0&&v.invalidate()}function Ol(a){a.onUpdate==null||a.onUpdate(a)}function qd(a,n){a.manual||(Oc(a)?(a.left=n.width/-2,a.right=n.width/2,a.top=n.height/2,a.bottom=n.height/-2):a.aspect=n.width/n.height,a.updateProjectionMatrix(),a.updateMatrixWorld())}function na(a){return(a.eventObject||a.object).uuid+"/"+a.index+a.instanceId}function $d(){var a;const n=typeof self<"u"&&self||typeof window<"u"&&window;if(!n)return vi.DefaultEventPriority;switch((a=n.event)==null?void 0:a.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return vi.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return vi.ContinuousEventPriority;default:return vi.DefaultEventPriority}}function Nc(a,n,c,v){const i=c.get(n);i&&(c.delete(n),c.size===0&&(a.delete(v),i.target.releasePointerCapture(v)))}function e1(a,n){const{internal:c}=a.getState();c.interaction=c.interaction.filter(v=>v!==n),c.initialHits=c.initialHits.filter(v=>v!==n),c.hovered.forEach((v,i)=>{(v.eventObject===n||v.object===n)&&c.hovered.delete(i)}),c.capturedMap.forEach((v,i)=>{Nc(c.capturedMap,n,v,i)})}function t1(a){function n(u){const{internal:h}=a.getState(),d=u.offsetX-h.initialClick[0],m=u.offsetY-h.initialClick[1];return Math.round(Math.sqrt(d*d+m*m))}function c(u){return u.filter(h=>["Move","Over","Enter","Out","Leave"].some(d=>{var m;return(m=h.__r3f)==null?void 0:m.handlers["onPointer"+d]}))}function v(u,h){const d=a.getState(),m=new Set,y=[],x=h?h(d.internal.interaction):d.internal.interaction;for(let _=0;_{const M=qi(_.object),D=qi(w.object);return!M||!D?_.distance-w.distance:D.events.priority-M.events.priority||_.distance-w.distance}).filter(_=>{const w=na(_);return m.has(w)?!1:(m.add(w),!0)});d.events.filter&&(T=d.events.filter(T,d));for(const _ of T){let w=_.object;for(;w;){var S;(S=w.__r3f)!=null&&S.eventCount&&y.push({..._,eventObject:w}),w=w.parent}}if("pointerId"in u&&d.internal.capturedMap.has(u.pointerId))for(let _ of d.internal.capturedMap.get(u.pointerId).values())m.has(na(_.intersection))||y.push(_.intersection);return y}function i(u,h,d,m){const y=a.getState();if(u.length){const x={stopped:!1};for(const C of u){const T=qi(C.object)||y,{raycaster:S,pointer:_,camera:w,internal:M}=T,D=new st(_.x,_.y,0).unproject(w),R=oe=>{var G,O;return(G=(O=M.capturedMap.get(oe))==null?void 0:O.has(C.eventObject))!=null?G:!1},A=oe=>{const G={intersection:C,target:h.target};M.capturedMap.has(oe)?M.capturedMap.get(oe).set(C.eventObject,G):M.capturedMap.set(oe,new Map([[C.eventObject,G]])),h.target.setPointerCapture(oe)},b=oe=>{const G=M.capturedMap.get(oe);G&&Nc(M.capturedMap,C.eventObject,G,oe)};let B={};for(let oe in h){let G=h[oe];typeof G!="function"&&(B[oe]=G)}let J={...C,...B,pointer:_,intersections:u,stopped:x.stopped,delta:d,unprojectedPoint:D,ray:S.ray,camera:w,stopPropagation(){const oe="pointerId"in h&&M.capturedMap.get(h.pointerId);if((!oe||oe.has(C.eventObject))&&(J.stopped=x.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(G=>G.eventObject===C.eventObject))){const G=u.slice(0,u.indexOf(C));r([...G,C])}},target:{hasPointerCapture:R,setPointerCapture:A,releasePointerCapture:b},currentTarget:{hasPointerCapture:R,setPointerCapture:A,releasePointerCapture:b},nativeEvent:h};if(m(J),x.stopped===!0)break}}return u}function r(u){const{internal:h}=a.getState();for(const d of h.hovered.values())if(!u.length||!u.find(m=>m.object===d.object&&m.index===d.index&&m.instanceId===d.instanceId)){const y=d.eventObject.__r3f,x=y==null?void 0:y.handlers;if(h.hovered.delete(na(d)),y!=null&&y.eventCount){const C={...d,intersections:u};x.onPointerOut==null||x.onPointerOut(C),x.onPointerLeave==null||x.onPointerLeave(C)}}}function s(u,h){for(let d=0;dr([]);case"onLostPointerCapture":return h=>{const{internal:d}=a.getState();"pointerId"in h&&d.capturedMap.has(h.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(h.pointerId)&&(d.capturedMap.delete(h.pointerId),r([]))})}}return function(d){const{onPointerMissed:m,internal:y}=a.getState();y.lastEvent.current=d;const x=u==="onPointerMove",C=u==="onClick"||u==="onContextMenu"||u==="onDoubleClick",S=v(d,x?c:void 0),_=C?n(d):0;u==="onPointerDown"&&(y.initialClick=[d.offsetX,d.offsetY],y.initialHits=S.map(M=>M.eventObject)),C&&!S.length&&_<=2&&(s(d,y.interaction),m&&m(d)),x&&r(S);function w(M){const D=M.eventObject,R=D.__r3f,A=R==null?void 0:R.handlers;if(R!=null&&R.eventCount)if(x){if(A.onPointerOver||A.onPointerEnter||A.onPointerOut||A.onPointerLeave){const b=na(M),B=y.hovered.get(b);B?B.stopped&&M.stopPropagation():(y.hovered.set(b,M),A.onPointerOver==null||A.onPointerOver(M),A.onPointerEnter==null||A.onPointerEnter(M))}A.onPointerMove==null||A.onPointerMove(M)}else{const b=A[u];b?(!C||y.initialHits.includes(D))&&(s(d,y.interaction.filter(B=>!y.initialHits.includes(B))),b(M)):C&&y.initialHits.includes(D)&&s(d,y.interaction.filter(B=>!y.initialHits.includes(B)))}}i(S,d,_,w)}}return{handlePointer:f}}const Gc=a=>!!(a!=null&&a.render),Wc=P.createContext(null),n1=(a,n)=>{const c=zd((f,u)=>{const h=new st,d=new st,m=new st;function y(_=u().camera,w=d,M=u().size){const{width:D,height:R,top:A,left:b}=M,B=D/R;w instanceof st?m.copy(w):m.set(...w);const J=_.getWorldPosition(h).distanceTo(m);if(Oc(_))return{width:D/_.zoom,height:R/_.zoom,top:A,left:b,factor:1,distance:J,aspect:B};{const oe=_.fov*Math.PI/180,G=2*Math.tan(oe/2)*J,O=G*(D/R);return{width:O,height:G,top:A,left:b,factor:D/O,distance:J,aspect:B}}}let x;const C=_=>f(w=>({performance:{...w.performance,current:_}})),T=new Nr;return{set:f,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(_=1)=>a(u(),_),advance:(_,w)=>n(_,w,u()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new md,pointer:T,mouse:T,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const _=u();x&&clearTimeout(x),_.performance.current!==_.performance.min&&C(_.performance.min),x=setTimeout(()=>C(u().performance.max),_.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:y},setEvents:_=>f(w=>({...w,events:{...w.events,..._}})),setSize:(_,w,M,D,R)=>{const A=u().camera,b={width:_,height:w,top:D||0,left:R||0,updateStyle:M};f(B=>({size:b,viewport:{...B.viewport,...y(A,d,b)}}))},setDpr:_=>f(w=>{const M=bc(_);return{viewport:{...w.viewport,dpr:M,initialDpr:w.viewport.initialDpr||M}}}),setFrameloop:(_="always")=>{const w=u().clock;w.stop(),w.elapsedTime=0,_!=="never"&&(w.start(),w.elapsedTime=0),f(()=>({frameloop:_}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:P.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(_,w,M)=>{const D=u().internal;return D.priority=D.priority+(w>0?1:0),D.subscribers.push({ref:_,priority:w,store:M}),D.subscribers=D.subscribers.sort((R,A)=>R.priority-A.priority),()=>{const R=u().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(w>0?1:0),R.subscribers=R.subscribers.filter(A=>A.ref!==_))}}}}}),v=c.getState();let i=v.size,r=v.viewport.dpr,s=v.camera;return c.subscribe(()=>{const{camera:f,size:u,viewport:h,gl:d,set:m}=c.getState();if(u.width!==i.width||u.height!==i.height||h.dpr!==r){var y;i=u,r=h.dpr,qd(f,u),d.setPixelRatio(h.dpr);const x=(y=u.updateStyle)!=null?y:typeof HTMLCanvasElement<"u"&&d.domElement instanceof HTMLCanvasElement;d.setSize(u.width,u.height,x)}f!==s&&(s=f,m(x=>({viewport:{...x.viewport,...x.viewport.getCurrentViewport(f)}})))}),c.subscribe(f=>a(f)),c};function ql(a,n){const c={callback:a};return n.add(c),()=>void n.delete(c)}let ra,Hc=new Set,Vc=new Set,Zc=new Set;const r1=a=>ql(a,Hc),i1=a=>ql(a,Vc),o1=a=>ql(a,Zc);function gl(a,n){if(a.size)for(const{callback:c}of a.values())c(n)}function $i(a,n){switch(a){case"before":return gl(Hc,n);case"after":return gl(Vc,n);case"tail":return gl(Zc,n)}}let yl,xl;function wl(a,n,c){let v=n.clock.getDelta();for(n.frameloop==="never"&&typeof a=="number"&&(v=a-n.clock.elapsedTime,n.clock.oldTime=n.clock.elapsedTime,n.clock.elapsedTime=a),yl=n.internal.subscribers,ra=0;ra0)&&!((h=i.gl.xr)!=null&&h.isPresenting)&&(c+=wl(u,i))}if($i("after",u),c===0)return $i("tail",u),n=!1,cancelAnimationFrame(v)}function s(u,h=1){var d;if(!u)return a.forEach(m=>s(m.store.getState()),h);(d=u.gl.xr)!=null&&d.isPresenting||!u.internal.active||u.frameloop==="never"||(u.internal.frames=Math.min(60,u.internal.frames+h),n||(n=!0,requestAnimationFrame(r)))}function f(u,h=!0,d,m){if(h&&$i("before",u),d)wl(u,d,m);else for(const y of a.values())wl(u,y.store.getState());h&&$i("after",u)}return{loop:r,invalidate:s,advance:f}}function fp(a){const n=P.useRef(null);return Si(()=>void(n.current=a.current.__r3f),[a]),n}function Qc(){const a=P.useContext(Wc);if(!a)throw new Error("R3F: Hooks can only be used within the Canvas component!");return a}function Ci(a=c=>c,n){return Qc()(a,n)}function ao(a,n=0){const c=Qc(),v=c.getState().internal.subscribe,i=zc(a);return Si(()=>v(i,n,c),[n,v,c]),null}const Nu=new WeakMap;function Xc(a,n){return function(c,...v){let i=Nu.get(c);return i||(i=new c,Nu.set(c,i)),a&&a(i),Promise.all(v.map(r=>new Promise((s,f)=>i.load(r,u=>{u.scene&&Object.assign(u,Yd(u.scene)),s(u)},n,u=>f(new Error(`Could not load ${r}: ${u==null?void 0:u.message}`)))))).finally(()=>i.dispose==null?void 0:i.dispose())}}function Yc(a,n,c,v){const i=Array.isArray(n)?n:[n],r=Nd(Xc(c,v),[a,...i],{equal:nt.equ});return Array.isArray(n)?r:r[0]}Yc.preload=function(a,n,c){const v=Array.isArray(n)?n:[n];return Gd(Xc(c),[a,...v])};Yc.clear=function(a,n){const c=Array.isArray(n)?n:[n];return Wd([a,...c])};const wi=new Map,{invalidate:Gu,advance:Wu}=a1(wi),{reconciler:ha,applyProps:ui}=Vd(wi,$d),ci={objects:"shallow",strict:!1},l1=(a,n)=>{const c=typeof a=="function"?a(n):a;return Gc(c)?c:new fd({powerPreference:"high-performance",canvas:n,antialias:!0,alpha:!0,...a})};function s1(a,n){const c=typeof HTMLCanvasElement<"u"&&a instanceof HTMLCanvasElement;if(n){const{width:v,height:i,top:r,left:s,updateStyle:f=c}=n;return{width:v,height:i,top:r,left:s,updateStyle:f}}else if(typeof HTMLCanvasElement<"u"&&a instanceof HTMLCanvasElement&&a.parentElement){const{width:v,height:i,top:r,left:s}=a.parentElement.getBoundingClientRect();return{width:v,height:i,top:r,left:s,updateStyle:c}}else if(typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas)return{width:a.width,height:a.height,top:0,left:0,updateStyle:c};return{width:0,height:0,top:0,left:0}}function u1(a){const n=wi.get(a),c=n==null?void 0:n.fiber,v=n==null?void 0:n.store;n&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,r=v||n1(Gu,Wu),s=c||ha.createContainer(r,vi.ConcurrentRoot,null,!1,null,"",i,null);n||wi.set(a,{fiber:s,store:r});let f,u=!1,h;return{configure(d={}){let{gl:m,size:y,scene:x,events:C,onCreated:T,shadows:S=!1,linear:_=!1,flat:w=!1,legacy:M=!1,orthographic:D=!1,frameloop:R="always",dpr:A=[1,2],performance:b,raycaster:B,camera:J,onPointerMissed:oe}=d,G=r.getState(),O=G.gl;G.gl||G.set({gl:O=l1(m,a)});let ee=G.raycaster;ee||G.set({raycaster:ee=new sd});const{params:q,...ne}=B||{};if(nt.equ(ne,ee,ci)||ui(ee,{...ne}),nt.equ(q,ee.params,ci)||ui(ee,{params:{...ee.params,...q}}),!G.camera||G.camera===h&&!nt.equ(h,J,ci)){h=J;const I=J instanceof dd,Q=I?J:D?new Zl(0,0,0,0,.1,1e3):new Ql(75,0,.1,1e3);I||(Q.position.z=5,J&&ui(Q,J),!G.camera&&!(J!=null&&J.rotation)&&Q.lookAt(0,0,0)),G.set({camera:Q}),ee.camera=Q}if(!G.scene){let I;x instanceof da?I=x:(I=new da,x&&ui(I,x)),G.set({scene:di(I)})}if(!G.xr){var ae;const I=(H,re)=>{const X=r.getState();X.frameloop!=="never"&&Wu(H,!0,X,re)},Q=()=>{const H=r.getState();H.gl.xr.enabled=H.gl.xr.isPresenting,H.gl.xr.setAnimationLoop(H.gl.xr.isPresenting?I:null),H.gl.xr.isPresenting||Gu(H)},Y={connect(){const H=r.getState().gl;H.xr.addEventListener("sessionstart",Q),H.xr.addEventListener("sessionend",Q)},disconnect(){const H=r.getState().gl;H.xr.removeEventListener("sessionstart",Q),H.xr.removeEventListener("sessionend",Q)}};typeof((ae=O.xr)==null?void 0:ae.addEventListener)=="function"&&Y.connect(),G.set({xr:Y})}if(O.shadowMap){const I=O.shadowMap.enabled,Q=O.shadowMap.type;if(O.shadowMap.enabled=!!S,nt.boo(S))O.shadowMap.type=dl;else if(nt.str(S)){var ve;const Y={basic:hd,percentage:pd,soft:dl,variance:vd};O.shadowMap.type=(ve=Y[S])!=null?ve:dl}else nt.obj(S)&&Object.assign(O.shadowMap,S);(I!==O.shadowMap.enabled||Q!==O.shadowMap.type)&&(O.shadowMap.needsUpdate=!0)}const Z=Dc();Z&&("enabled"in Z?Z.enabled=!M:"legacyMode"in Z&&(Z.legacyMode=M)),ui(O,{outputEncoding:_?3e3:3001,toneMapping:w?ud:cd}),G.legacy!==M&&G.set(()=>({legacy:M})),G.linear!==_&&G.set(()=>({linear:_})),G.flat!==w&&G.set(()=>({flat:w})),m&&!nt.fun(m)&&!Gc(m)&&!nt.equ(m,O,ci)&&ui(O,m),C&&!G.events.handlers&&G.set({events:C(r)});const k=s1(a,y);return nt.equ(k,G.size,ci)||G.setSize(k.width,k.height,k.updateStyle,k.top,k.left),A&&G.viewport.dpr!==bc(A)&&G.setDpr(A),G.frameloop!==R&&G.setFrameloop(R),G.onPointerMissed||G.set({onPointerMissed:oe}),b&&!nt.equ(b,G.performance,ci)&&G.set(I=>({performance:{...I.performance,...b}})),f=T,u=!0,this},render(d){return u||this.configure(),ha.updateContainer(P.createElement(c1,{store:r,children:d,onCreated:f,rootElement:a}),s,null,()=>{}),r},unmount(){Jc(a)}}}function c1({store:a,children:n,onCreated:c,rootElement:v}){return Si(()=>{const i=a.getState();i.set(r=>({internal:{...r.internal,active:!0}})),c&&c(i),a.getState().events.connected||i.events.connect==null||i.events.connect(v)},[]),P.createElement(Wc.Provider,{value:a},n)}function Jc(a,n){const c=wi.get(a),v=c==null?void 0:c.fiber;if(v){const i=c==null?void 0:c.store.getState();i&&(i.internal.active=!1),ha.updateContainer(null,v,null,()=>{i&&setTimeout(()=>{try{var r,s,f,u;i.events.disconnect==null||i.events.disconnect(),(r=i.gl)==null||(s=r.renderLists)==null||s.dispose==null||s.dispose(),(f=i.gl)==null||f.forceContextLoss==null||f.forceContextLoss(),(u=i.gl)!=null&&u.xr&&i.xr.disconnect(),Jd(i),wi.delete(a),n&&n(a)}catch{}},500)})}}ha.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:P.version});function zl(a,n,c){var v,i,r,s,f;n==null&&(n=100);function u(){var d=Date.now()-s;d=0?v=setTimeout(u,n-d):(v=null,c||(f=a.apply(r,i),r=i=null))}var h=function(){r=this,i=arguments,s=Date.now();var d=c&&!v;return v||(v=setTimeout(u,n)),d&&(f=a.apply(r,i),r=i=null),f};return h.clear=function(){v&&(clearTimeout(v),v=null)},h.flush=function(){v&&(f=a.apply(r,i),r=i=null,clearTimeout(v),v=null)},h}zl.debounce=zl;var f1=zl;const Hu=Cc(f1);function d1(a){let{debounce:n,scroll:c,polyfill:v,offsetSize:i}=a===void 0?{debounce:0,scroll:!1,offsetSize:!1}:a;const r=v||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,f]=P.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=P.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),h=n?typeof n=="number"?n:n.scroll:null,d=n?typeof n=="number"?n:n.resize:null,m=P.useRef(!1);P.useEffect(()=>(m.current=!0,()=>void(m.current=!1)));const[y,x,C]=P.useMemo(()=>{const w=()=>{if(!u.current.element)return;const{left:M,top:D,width:R,height:A,bottom:b,right:B,x:J,y:oe}=u.current.element.getBoundingClientRect(),G={left:M,top:D,width:R,height:A,bottom:b,right:B,x:J,y:oe};u.current.element instanceof HTMLElement&&i&&(G.height=u.current.element.offsetHeight,G.width=u.current.element.offsetWidth),Object.freeze(G),m.current&&!m1(u.current.lastBounds,G)&&f(u.current.lastBounds=G)};return[w,d?Hu(w,d):w,h?Hu(w,h):w]},[f,i,h,d]);function T(){u.current.scrollContainers&&(u.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",C,!0)),u.current.scrollContainers=null),u.current.resizeObserver&&(u.current.resizeObserver.disconnect(),u.current.resizeObserver=null)}function S(){u.current.element&&(u.current.resizeObserver=new r(C),u.current.resizeObserver.observe(u.current.element),c&&u.current.scrollContainers&&u.current.scrollContainers.forEach(w=>w.addEventListener("scroll",C,{capture:!0,passive:!0})))}const _=w=>{!w||w===u.current.element||(T(),u.current.element=w,u.current.scrollContainers=Kc(w),S())};return p1(C,!!c),h1(x),P.useEffect(()=>{T(),S()},[c,C,x]),P.useEffect(()=>T,[]),[_,s,y]}function h1(a){P.useEffect(()=>{const n=a;return window.addEventListener("resize",n),()=>void window.removeEventListener("resize",n)},[a])}function p1(a,n){P.useEffect(()=>{if(n){const c=a;return window.addEventListener("scroll",c,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",c,!0)}},[a,n])}function Kc(a){const n=[];if(!a||a===document.body)return n;const{overflow:c,overflowX:v,overflowY:i}=window.getComputedStyle(a);return[c,v,i].some(r=>r==="auto"||r==="scroll")&&n.push(a),[...n,...Kc(a.parentElement)]}const v1=["x","y","top","bottom","left","right","width","height"],m1=(a,n)=>v1.every(c=>a[c]===n[c]);var g1=Object.defineProperty,y1=Object.defineProperties,x1=Object.getOwnPropertyDescriptors,Vu=Object.getOwnPropertySymbols,w1=Object.prototype.hasOwnProperty,S1=Object.prototype.propertyIsEnumerable,Zu=(a,n,c)=>n in a?g1(a,n,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[n]=c,Qu=(a,n)=>{for(var c in n||(n={}))w1.call(n,c)&&Zu(a,c,n[c]);if(Vu)for(var c of Vu(n))S1.call(n,c)&&Zu(a,c,n[c]);return a},C1=(a,n)=>y1(a,x1(n));function qc(a,n,c){if(!a)return;if(c(a)===!0)return a;let v=n?a.return:a.child;for(;v;){const i=qc(v,n,c);if(i)return i;v=n?null:v.sibling}}function $c(a){try{return Object.defineProperties(a,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return a}}const $l=$c(P.createContext(null));class ef extends P.Component{render(){return P.createElement($l.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Xu,ReactCurrentDispatcher:Yu}=P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _1(){const a=P.useContext($l);if(a===null)throw new Error("its-fine: useFiber must be called within a !");const n=P.useId();return P.useMemo(()=>{for(const v of[Xu==null?void 0:Xu.current,a,a==null?void 0:a.alternate]){if(!v)continue;const i=qc(v,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===n)return!0;s=s.next}});if(i)return i}},[a,n])}function E1(){var a,n;const c=_1(),[v]=P.useState(()=>new Map);v.clear();let i=c;for(;i;){const r=(a=i.type)==null?void 0:a._context;r&&r!==$l&&!v.has(r)&&v.set(r,(n=Yu==null?void 0:Yu.current)==null?void 0:n.readContext($c(r))),i=i.return}return v}function T1(){const a=E1();return P.useMemo(()=>Array.from(a.keys()).reduce((n,c)=>v=>P.createElement(n,null,P.createElement(c.Provider,C1(Qu({},v),{value:a.get(c)}))),n=>P.createElement(ef,Qu({},n))),[a])}const Sl={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function M1(a){const{handlePointer:n}=t1(a);return{priority:1,enabled:!0,compute(c,v,i){v.pointer.set(c.offsetX/v.size.width*2-1,-(c.offsetY/v.size.height)*2+1),v.raycaster.setFromCamera(v.pointer,v.camera)},connected:void 0,handlers:Object.keys(Sl).reduce((c,v)=>({...c,[v]:n(v)}),{}),update:()=>{var c;const{events:v,internal:i}=a.getState();(c=i.lastEvent)!=null&&c.current&&v.handlers&&v.handlers.onPointerMove(i.lastEvent.current)},connect:c=>{var v;const{set:i,events:r}=a.getState();r.disconnect==null||r.disconnect(),i(s=>({events:{...s.events,connected:c}})),Object.entries((v=r.handlers)!=null?v:[]).forEach(([s,f])=>{const[u,h]=Sl[s];c.addEventListener(u,f,{passive:h})})},disconnect:()=>{const{set:c,events:v}=a.getState();if(v.connected){var i;Object.entries((i=v.handlers)!=null?i:[]).forEach(([r,s])=>{if(v&&v.connected instanceof HTMLElement){const[f]=Sl[r];v.connected.removeEventListener(f,s)}}),c(r=>({events:{...r.events,connected:void 0}}))}}}}const k1=P.forwardRef(function({children:n,fallback:c,resize:v,style:i,gl:r,events:s=M1,eventSource:f,eventPrefix:u,shadows:h,linear:d,flat:m,legacy:y,orthographic:x,frameloop:C,dpr:T,performance:S,raycaster:_,camera:w,scene:M,onPointerMissed:D,onCreated:R,...A},b){P.useMemo(()=>Hd(gd),[]);const B=T1(),[J,oe]=d1({scroll:!0,debounce:{scroll:50,resize:0},...v}),G=P.useRef(null),O=P.useRef(null);P.useImperativeHandle(b,()=>G.current);const ee=zc(D),[q,ne]=P.useState(!1),[ae,ve]=P.useState(!1);if(q)throw q;if(ae)throw ae;const Z=P.useRef(null);Si(()=>{const W=G.current;oe.width>0&&oe.height>0&&W&&(Z.current||(Z.current=u1(W)),Z.current.configure({gl:r,events:s,shadows:h,linear:d,flat:m,legacy:y,orthographic:x,frameloop:C,dpr:T,performance:S,raycaster:_,camera:w,scene:M,size:oe,onPointerMissed:(...k)=>ee.current==null?void 0:ee.current(...k),onCreated:k=>{k.events.connect==null||k.events.connect(f?Zd(f)?f.current:f:O.current),u&&k.setEvents({compute:(I,Q)=>{const Y=I[u+"X"],H=I[u+"Y"];Q.pointer.set(Y/Q.size.width*2-1,-(H/Q.size.height)*2+1),Q.raycaster.setFromCamera(Q.pointer,Q.camera)}}),R==null||R(k)}}),Z.current.render(P.createElement(B,null,P.createElement(Ic,{set:ve},P.createElement(P.Suspense,{fallback:P.createElement(Qd,{set:ne})},n)))))}),P.useEffect(()=>{const W=G.current;if(W)return()=>Jc(W)},[]);const j=f?"none":"auto";return P.createElement("div",yi({ref:O,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:j,...i}},A),P.createElement("div",{ref:J,style:{width:"100%",height:"100%"}},P.createElement("canvas",{ref:G,style:{display:"block"}},c)))}),P1=P.forwardRef(function(n,c){return P.createElement(ef,null,P.createElement(k1,yi({},n,{ref:c})))}),lo=new st,es=new st,L1=new st;function U1(a,n,c){const v=lo.setFromMatrixPosition(a.matrixWorld);v.project(n);const i=c.width/2,r=c.height/2;return[v.x*i+i,-(v.y*r)+r]}function R1(a,n){const c=lo.setFromMatrixPosition(a.matrixWorld),v=es.setFromMatrixPosition(n.matrixWorld),i=c.sub(v),r=n.getWorldDirection(L1);return i.angleTo(r)>Math.PI/2}function F1(a,n,c,v){const i=lo.setFromMatrixPosition(a.matrixWorld),r=i.clone();r.project(n),c.setFromCamera(r,n);const s=c.intersectObjects(v,!0);if(s.length){const f=s[0].distance;return i.distanceTo(c.ray.origin)Math.abs(a)<1e-10?0:a;function tf(a,n,c=""){let v="matrix3d(";for(let i=0;i!==16;i++)v+=Il(n[i]*a.elements[i])+(i!==15?",":")");return c+v}const O1=(a=>n=>tf(n,a))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),z1=(a=>(n,c)=>tf(n,a(c),"translate(-50%,-50%)"))(a=>[1/a,1/a,1/a,1,-1/a,-1/a,-1/a,-1,1/a,1/a,1/a,1,1,1,1,1]);function I1(a){return a&&typeof a=="object"&&"current"in a}const hp=P.forwardRef(({children:a,eps:n=.001,style:c,className:v,prepend:i,center:r,fullscreen:s,portal:f,distanceFactor:u,sprite:h=!1,transform:d=!1,occlude:m,onOcclude:y,castShadow:x,receiveShadow:C,material:T,geometry:S,zIndexRange:_=[16777271,0],calculatePosition:w=U1,as:M="div",wrapperClass:D,pointerEvents:R="auto",...A},b)=>{const{gl:B,camera:J,scene:oe,size:G,raycaster:O,events:ee,viewport:q}=Ci(),[ne]=P.useState(()=>document.createElement(M)),ae=P.useRef(),ve=P.useRef(null),Z=P.useRef(0),j=P.useRef([0,0]),W=P.useRef(null),k=P.useRef(null),I=(f==null?void 0:f.current)||ee.connected||B.domElement.parentNode,Q=P.useRef(null),Y=P.useRef(!1),H=P.useMemo(()=>m&&m!=="blending"||Array.isArray(m)&&m.length&&I1(m[0]),[m]);P.useLayoutEffect(()=>{const fe=B.domElement;m&&m==="blending"?(fe.style.zIndex=`${Math.floor(_[0]/2)}`,fe.style.position="absolute",fe.style.pointerEvents="none"):(fe.style.zIndex=null,fe.style.position=null,fe.style.pointerEvents=null)},[m]),P.useLayoutEffect(()=>{if(ve.current){const fe=ae.current=_c(ne);if(oe.updateMatrixWorld(),d)ne.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const K=w(ve.current,J,G);ne.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${K[0]}px,${K[1]}px,0);transform-origin:0 0;`}return I&&(i?I.prepend(ne):I.appendChild(ne)),()=>{I&&I.removeChild(ne),fe.unmount()}}},[I,d]),P.useLayoutEffect(()=>{D&&(ne.className=D)},[D]);const re=P.useMemo(()=>d?{position:"absolute",top:0,left:0,width:G.width,height:G.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:r?"translate3d(-50%,-50%,0)":"none",...s&&{top:-G.height/2,left:-G.width/2,width:G.width,height:G.height},...c},[c,r,s,G,d]),X=P.useMemo(()=>({position:"absolute",pointerEvents:R}),[R]);P.useLayoutEffect(()=>{if(Y.current=!1,d){var fe;(fe=ae.current)==null||fe.render(P.createElement("div",{ref:W,style:re},P.createElement("div",{ref:k,style:X},P.createElement("div",{ref:b,className:v,style:c,children:a}))))}else{var K;(K=ae.current)==null||K.render(P.createElement("div",{ref:b,style:re,className:v,children:a}))}});const te=P.useRef(!0);ao(fe=>{if(ve.current){J.updateMatrixWorld(),ve.current.updateWorldMatrix(!0,!1);const K=d?j.current:w(ve.current,J,G);if(d||Math.abs(Z.current-J.zoom)>n||Math.abs(j.current[0]-K[0])>n||Math.abs(j.current[1]-K[1])>n){const $=R1(ve.current,J);let xe=!1;H&&(m!=="blending"?xe=[oe]:Array.isArray(m)&&(xe=m.map(ke=>ke.current)));const Re=te.current;if(xe){const ke=F1(ve.current,J,O,xe);te.current=ke&&!$}else te.current=!$;Re!==te.current&&(y?y(!te.current):ne.style.display=te.current?"block":"none");const ce=Math.floor(_[0]/2),Se=m?H?[_[0],ce]:[ce-1,0]:_;if(ne.style.zIndex=`${D1(ve.current,J,Se)}`,d){const[ke,le]=[G.width/2,G.height/2],Ce=J.projectionMatrix.elements[5]*le,{isOrthographicCamera:pe,top:ie,left:Pe,bottom:ye,right:we}=J,me=O1(J.matrixWorldInverse),We=pe?`scale(${Ce})translate(${Il(-(we+Pe)/2)}px,${Il((ie+ye)/2)}px)`:`translateZ(${Ce}px)`;let Oe=ve.current.matrixWorld;h&&(Oe=J.matrixWorldInverse.clone().transpose().copyPosition(Oe).scale(ve.current.scale),Oe.elements[3]=Oe.elements[7]=Oe.elements[11]=0,Oe.elements[15]=1),ne.style.width=G.width+"px",ne.style.height=G.height+"px",ne.style.perspective=pe?"":`${Ce}px`,W.current&&k.current&&(W.current.style.transform=`${We}${me}translate(${ke}px,${le}px)`,k.current.style.transform=z1(Oe,1/((u||10)/400)))}else{const ke=u===void 0?1:A1(ve.current,J)*u;ne.style.transform=`translate3d(${K[0]}px,${K[1]}px,0) scale(${ke})`}j.current=K,Z.current=J.zoom}}if(!H&&Q.current&&!Y.current)if(d){if(W.current){const K=W.current.children[0];if(K!=null&&K.clientWidth&&K!=null&&K.clientHeight){const{isOrthographicCamera:$}=J;if($||S)A.scale&&(Array.isArray(A.scale)?A.scale instanceof st?Q.current.scale.copy(A.scale.clone().divideScalar(1)):Q.current.scale.set(1/A.scale[0],1/A.scale[1],1/A.scale[2]):Q.current.scale.setScalar(1/A.scale));else{const xe=(u||10)/400,Re=K.clientWidth*xe,ce=K.clientHeight*xe;Q.current.scale.set(Re,ce,1)}Y.current=!0}}}else{const K=ne.children[0];if(K!=null&&K.clientWidth&&K!=null&&K.clientHeight){const $=1/q.factor,xe=K.clientWidth*$,Re=K.clientHeight*$;Q.current.scale.set(xe,Re,1),Y.current=!0}Q.current.lookAt(fe.camera.position)}});const ue=P.useMemo(()=>({vertexShader:d?void 0:` + `)+e.join(" > ")}return null},c.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return ae(e.child.stateNode);default:return e.child.stateNode}},c.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:Kf,findFiberByHostInstance:e.findFiberByHostInstance||qf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{_r=t.inject(e),fn=t}catch{}e=!!t.checkDCE}}return e},c.isAlreadyRendering=function(){return!1},c.observeVisibleRects=function(e,t,o,a){if(!pe)throw Error(s(363));e=Ja(e,t);var p=Oe(e,o,a).disconnect;return{disconnect:function(){p()}}},c.registerMutableSourceForHydration=function(e,t){var o=t._getVersion;o=o(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,o]:e.mutableSourceEagerHydrationData.push(t,o)},c.runWithPriority=function(e,t){var o=Ne;try{return Ne=e,t()}finally{Ne=o}},c.shouldError=function(){return null},c.shouldSuspend=function(){return!1},c.updateContainer=function(e,t,o,a){var p=t.current,g=Kt(),E=vr(p);return o=Lu(o),t.context===null?t.context=o:t.pendingContext=o,t=nr(g,E),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),dr(p,t),e=En(p,E,g),e!==null&&yo(e,p,E),E},c};Lc.exports=Id;var jd=Lc.exports;const bd=Cc(jd),Bd=l=>typeof l=="object"&&typeof l.then=="function",jr=[];function Fc(l,n,c=(v,i)=>v===i){if(l===n)return!0;if(!l||!n)return!1;const v=l.length;if(n.length!==v)return!1;for(let i=0;i0&&(r.timeout&&clearTimeout(r.timeout),r.timeout=setTimeout(r.remove,v.lifespan)),r.response;if(!c)throw r.promise}const i={keys:n,equal:v.equal,remove:()=>{const r=jr.indexOf(i);r!==-1&&jr.splice(r,1)},promise:(Bd(l)?l:l(...n)).then(r=>{i.response=r,v.lifespan&&v.lifespan>0&&(i.timeout=setTimeout(i.remove,v.lifespan))}).catch(r=>i.error=r)};if(jr.push(i),!c)throw i.promise}const Nd=(l,n,c)=>Ac(l,n,!1,c),Gd=(l,n,c)=>void Ac(l,n,!0,c),Wd=l=>{if(l===void 0||l.length===0)jr.splice(0,jr.length);else{const n=jr.find(c=>Fc(l,c.keys,c.equal));n&&n.remove()}},Kl={},Hd=l=>void Object.assign(Kl,l);function Vd(l,n){function c(d,{args:m=[],attach:y,...x},C){let T=`${d[0].toUpperCase()}${d.slice(1)}`,S;if(d==="primitive"){if(x.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const _=x.object;S=di(_,{type:d,root:C,attach:y,primitive:!0})}else{const _=Kl[T];if(!_)throw new Error(`R3F: ${T} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(m))throw new Error("R3F: The args prop must be an array!");S=di(new _(...m),{type:d,root:C,attach:y,memoizedProps:{args:m}})}return S.__r3f.attach===void 0&&(S instanceof Ec?S.__r3f.attach="geometry":S instanceof ld&&(S.__r3f.attach="material")),T!=="inject"&&ml(S,x),S}function v(d,m){let y=!1;if(m){var x,C;(x=m.__r3f)!=null&&x.attach?vl(d,m,m.__r3f.attach):m.isObject3D&&d.isObject3D&&(d.add(m),y=!0),y||(C=d.__r3f)==null||C.objects.push(m),m.__r3f||di(m,{}),m.__r3f.parent=d,Ol(m),hi(m)}}function i(d,m,y){let x=!1;if(m){var C,T;if((C=m.__r3f)!=null&&C.attach)vl(d,m,m.__r3f.attach);else if(m.isObject3D&&d.isObject3D){m.parent=d,m.dispatchEvent({type:"added"});const S=d.children.filter(w=>w!==m),_=S.indexOf(y);d.children=[...S.slice(0,_),m,...S.slice(_)],x=!0}x||(T=d.__r3f)==null||T.objects.push(m),m.__r3f||di(m,{}),m.__r3f.parent=d,Ol(m),hi(m)}}function r(d,m,y=!1){d&&[...d].forEach(x=>s(m,x,y))}function s(d,m,y){if(m){var x,C,T;if(m.__r3f&&(m.__r3f.parent=null),(x=d.__r3f)!=null&&x.objects&&(d.__r3f.objects=d.__r3f.objects.filter(D=>D!==m)),(C=m.__r3f)!=null&&C.attach)Bu(d,m,m.__r3f.attach);else if(m.isObject3D&&d.isObject3D){var S;d.remove(m),(S=m.__r3f)!=null&&S.root&&e1(m.__r3f.root,m)}const w=(T=m.__r3f)==null?void 0:T.primitive,M=!w&&(y===void 0?m.dispose!==null:y);if(!w){var _;r((_=m.__r3f)==null?void 0:_.objects,m,M),r(m.children,m,M)}if(delete m.__r3f,M&&m.dispose&&m.type!=="Scene"){const D=()=>{try{m.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?Al.unstable_scheduleCallback(Al.unstable_IdlePriority,D):D()}hi(d)}}function f(d,m,y,x){var C;const T=(C=d.__r3f)==null?void 0:C.parent;if(!T)return;const S=c(m,y,d.__r3f.root);if(d.children){for(const _ of d.children)_.__r3f&&v(S,_);d.children=d.children.filter(_=>!_.__r3f)}d.__r3f.objects.forEach(_=>v(S,_)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||s(T,d),S.parent&&(S.__r3f.autoRemovedBeforeAppend=!0),v(T,S),S.raycast&&S.__r3f.eventCount&&S.__r3f.root.getState().internal.interaction.push(S),[x,x.alternate].forEach(_=>{_!==null&&(_.stateNode=S,_.ref&&(typeof _.ref=="function"?_.ref(S):_.ref.current=S))})}const u=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:bd({createInstance:c,removeChild:s,appendChild:v,appendInitialChild:v,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,m)=>{if(!m)return;const y=d.getState().scene;y.__r3f&&(y.__r3f.root=d,v(y,m))},removeChildFromContainer:(d,m)=>{m&&s(d.getState().scene,m)},insertInContainerBefore:(d,m,y)=>{if(!m||!y)return;const x=d.getState().scene;x.__r3f&&i(x,m,y)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var m;return!!((m=d==null?void 0:d.__r3f)!=null?m:{}).handlers},prepareUpdate(d,m,y,x){var C;if(((C=d==null?void 0:d.__r3f)!=null?C:{}).primitive&&x.object&&x.object!==d)return[!0];{const{args:S=[],children:_,...w}=x,{args:M=[],children:D,...R}=y;if(!Array.isArray(S))throw new Error("R3F: the args prop must be an array!");if(S.some((b,B)=>b!==M[B]))return[!0];const A=Bc(d,w,R,!0);return A.changes.length?[!1,A]:null}},commitUpdate(d,[m,y],x,C,T,S){m?f(d,x,T,S):ml(d,y)},commitMount(d,m,y,x){var C;const T=(C=d.__r3f)!=null?C:{};d.raycast&&T.handlers&&T.eventCount&&d.__r3f.root.getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>di(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var m;const{attach:y,parent:x}=(m=d.__r3f)!=null?m:{};y&&x&&Bu(x,d,y),d.isObject3D&&(d.visible=!1),hi(d)},unhideInstance(d,m){var y;const{attach:x,parent:C}=(y=d.__r3f)!=null?y:{};x&&C&&vl(C,d,x),(d.isObject3D&&m.visible==null||m.visible)&&(d.visible=!0),hi(d)},createTextInstance:u,hideTextInstance:u,unhideTextInstance:u,getCurrentEventPriority:()=>n?n():vi.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&nt.fun(performance.now)?performance.now:nt.fun(Date.now)?Date.now:()=>0,scheduleTimeout:nt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:nt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:ml}}var zu,Iu;const pl=l=>"colorSpace"in l||"outputColorSpace"in l,Dc=()=>{var l;return(l=Kl.ColorManagement)!=null?l:null},Oc=l=>l&&l.isOrthographicCamera,Zd=l=>l&&l.hasOwnProperty("current"),oo=typeof window<"u"&&((zu=window.document)!=null&&zu.createElement||((Iu=window.navigator)==null?void 0:Iu.product)==="ReactNative")?P.useLayoutEffect:P.useEffect;function zc(l){const n=P.useRef(l);return oo(()=>void(n.current=l),[l]),n}function Qd({set:l}){return oo(()=>(l(new Promise(()=>null)),()=>l(!1)),[l]),null}class Ic extends P.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}}Ic.getDerivedStateFromError=()=>({error:!0});const jc="__default",ju=new Map,Xd=l=>l&&!!l.memoized&&!!l.changes;function bc(l){var n;const c=typeof window<"u"?(n=window.devicePixelRatio)!=null?n:2:1;return Array.isArray(l)?Math.min(Math.max(l[0],c),l[1]):l}const Ki=l=>{var n;return(n=l.__r3f)==null?void 0:n.root.getState()},nt={obj:l=>l===Object(l)&&!nt.arr(l)&&typeof l!="function",fun:l=>typeof l=="function",str:l=>typeof l=="string",num:l=>typeof l=="number",boo:l=>typeof l=="boolean",und:l=>l===void 0,arr:l=>Array.isArray(l),equ(l,n,{arrays:c="shallow",objects:v="reference",strict:i=!0}={}){if(typeof l!=typeof n||!!l!=!!n)return!1;if(nt.str(l)||nt.num(l))return l===n;const r=nt.obj(l);if(r&&v==="reference")return l===n;const s=nt.arr(l);if(s&&c==="reference")return l===n;if((s||r)&&l===n)return!0;let f;for(f in l)if(!(f in n))return!1;if(r&&c==="shallow"&&v==="shallow"){for(f in i?n:l)if(!nt.equ(l[f],n[f],{strict:i,objects:"reference"}))return!1}else for(f in i?n:l)if(l[f]!==n[f])return!1;if(nt.und(f)){if(s&&l.length===0&&n.length===0||r&&Object.keys(l).length===0&&Object.keys(n).length===0)return!0;if(l!==n)return!1}return!0}};function Yd(l){const n={nodes:{},materials:{}};return l&&l.traverse(c=>{c.name&&(n.nodes[c.name]=c),c.material&&!n.materials[c.material.name]&&(n.materials[c.material.name]=c.material)}),n}function Jd(l){l.dispose&&l.type!=="Scene"&&l.dispose();for(const n in l)n.dispose==null||n.dispose(),delete l[n]}function di(l,n){const c=l;return c.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...n},l}function Dl(l,n){let c=l;if(n.includes("-")){const v=n.split("-"),i=v.pop();return c=v.reduce((r,s)=>r[s],l),{target:c,key:i}}else return{target:c,key:n}}const bu=/-\d+$/;function vl(l,n,c){if(nt.str(c)){if(bu.test(c)){const r=c.replace(bu,""),{target:s,key:f}=Dl(l,r);Array.isArray(s[f])||(s[f]=[])}const{target:v,key:i}=Dl(l,c);n.__r3f.previousAttach=v[i],v[i]=n}else n.__r3f.previousAttach=c(l,n)}function Bu(l,n,c){var v,i;if(nt.str(c)){const{target:r,key:s}=Dl(l,c),f=n.__r3f.previousAttach;f===void 0?delete r[s]:r[s]=f}else(v=n.__r3f)==null||v.previousAttach==null||v.previousAttach(l,n);(i=n.__r3f)==null||delete i.previousAttach}function Bc(l,{children:n,key:c,ref:v,...i},{children:r,key:s,ref:f,...u}={},h=!1){var d;const m=(d=l==null?void 0:l.__r3f)!=null?d:{},y=Object.entries(i),x=[];if(h){const T=Object.keys(u);for(let S=0;S{var _;if((_=l.__r3f)!=null&&_.primitive&&T==="object"||nt.equ(S,u[T]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(T))return x.push([T,S,!0,[]]);let w=[];T.includes("-")&&(w=T.split("-")),x.push([T,S,!1,w]);for(const M in i){const D=i[M];M.startsWith(`${T}-`)&&x.push([M,D,!1,M.split("-")])}});const C={...i};return m.memoizedProps&&m.memoizedProps.args&&(C.args=m.memoizedProps.args),m.memoizedProps&&m.memoizedProps.attach&&(C.attach=m.memoizedProps.attach),{memoized:C,changes:x}}const Kd=typeof process<"u"&&!1;function ml(l,n){var c,v,i;const r=(c=l.__r3f)!=null?c:{},s=r.root,f=(v=s==null||s.getState==null?void 0:s.getState())!=null?v:{},{memoized:u,changes:h}=Xd(n)?n:Bc(l,n),d=r.eventCount;l.__r3f&&(l.__r3f.memoizedProps=u);for(let y=0;yM[D],l),!(w&&w.set))){const[M,...D]=S.reverse();_=D.reverse().reduce((R,A)=>R[A],l),x=M}if(C===jc+"remove")if(_.constructor){let M=ju.get(_.constructor);M||(M=new _.constructor,ju.set(_.constructor,M)),C=M[x]}else C=0;if(T)C?r.handlers[x]=C:delete r.handlers[x],r.eventCount=Object.keys(r.handlers).length;else if(w&&w.set&&(w.copy||w instanceof fl)){if(Array.isArray(C))w.fromArray?w.fromArray(C):w.set(...C);else if(w.copy&&C&&C.constructor&&(Kd?w.constructor.name===C.constructor.name:w.constructor===C.constructor))w.copy(C);else if(C!==void 0){const M=w instanceof ro;!M&&w.setScalar?w.setScalar(C):w instanceof fl&&C instanceof fl?w.mask=C.mask:w.set(C),!Dc()&&!f.linear&&M&&w.convertSRGBToLinear()}}else if(_[x]=C,_[x]instanceof Vl&&_[x].format===od&&_[x].type===ad){const M=_[x];pl(M)&&pl(f.gl)?M.colorSpace=f.gl.outputColorSpace:M.encoding=f.gl.outputEncoding}hi(l)}if(r.parent&&f.internal&&l.raycast&&d!==r.eventCount){const y=f.internal.interaction.indexOf(l);y>-1&&f.internal.interaction.splice(y,1),r.eventCount&&f.internal.interaction.push(l)}return!(h.length===1&&h[0][0]==="onUpdate")&&h.length&&(i=l.__r3f)!=null&&i.parent&&Ol(l),l}function hi(l){var n,c;const v=(n=l.__r3f)==null||(c=n.root)==null||c.getState==null?void 0:c.getState();v&&v.internal.frames===0&&v.invalidate()}function Ol(l){l.onUpdate==null||l.onUpdate(l)}function qd(l,n){l.manual||(Oc(l)?(l.left=n.width/-2,l.right=n.width/2,l.top=n.height/2,l.bottom=n.height/-2):l.aspect=n.width/n.height,l.updateProjectionMatrix(),l.updateMatrixWorld())}function na(l){return(l.eventObject||l.object).uuid+"/"+l.index+l.instanceId}function $d(){var l;const n=typeof self<"u"&&self||typeof window<"u"&&window;if(!n)return vi.DefaultEventPriority;switch((l=n.event)==null?void 0:l.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return vi.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return vi.ContinuousEventPriority;default:return vi.DefaultEventPriority}}function Nc(l,n,c,v){const i=c.get(n);i&&(c.delete(n),c.size===0&&(l.delete(v),i.target.releasePointerCapture(v)))}function e1(l,n){const{internal:c}=l.getState();c.interaction=c.interaction.filter(v=>v!==n),c.initialHits=c.initialHits.filter(v=>v!==n),c.hovered.forEach((v,i)=>{(v.eventObject===n||v.object===n)&&c.hovered.delete(i)}),c.capturedMap.forEach((v,i)=>{Nc(c.capturedMap,n,v,i)})}function t1(l){function n(u){const{internal:h}=l.getState(),d=u.offsetX-h.initialClick[0],m=u.offsetY-h.initialClick[1];return Math.round(Math.sqrt(d*d+m*m))}function c(u){return u.filter(h=>["Move","Over","Enter","Out","Leave"].some(d=>{var m;return(m=h.__r3f)==null?void 0:m.handlers["onPointer"+d]}))}function v(u,h){const d=l.getState(),m=new Set,y=[],x=h?h(d.internal.interaction):d.internal.interaction;for(let _=0;_{const M=Ki(_.object),D=Ki(w.object);return!M||!D?_.distance-w.distance:D.events.priority-M.events.priority||_.distance-w.distance}).filter(_=>{const w=na(_);return m.has(w)?!1:(m.add(w),!0)});d.events.filter&&(T=d.events.filter(T,d));for(const _ of T){let w=_.object;for(;w;){var S;(S=w.__r3f)!=null&&S.eventCount&&y.push({..._,eventObject:w}),w=w.parent}}if("pointerId"in u&&d.internal.capturedMap.has(u.pointerId))for(let _ of d.internal.capturedMap.get(u.pointerId).values())m.has(na(_.intersection))||y.push(_.intersection);return y}function i(u,h,d,m){const y=l.getState();if(u.length){const x={stopped:!1};for(const C of u){const T=Ki(C.object)||y,{raycaster:S,pointer:_,camera:w,internal:M}=T,D=new st(_.x,_.y,0).unproject(w),R=oe=>{var G,O;return(G=(O=M.capturedMap.get(oe))==null?void 0:O.has(C.eventObject))!=null?G:!1},A=oe=>{const G={intersection:C,target:h.target};M.capturedMap.has(oe)?M.capturedMap.get(oe).set(C.eventObject,G):M.capturedMap.set(oe,new Map([[C.eventObject,G]])),h.target.setPointerCapture(oe)},b=oe=>{const G=M.capturedMap.get(oe);G&&Nc(M.capturedMap,C.eventObject,G,oe)};let B={};for(let oe in h){let G=h[oe];typeof G!="function"&&(B[oe]=G)}let J={...C,...B,pointer:_,intersections:u,stopped:x.stopped,delta:d,unprojectedPoint:D,ray:S.ray,camera:w,stopPropagation(){const oe="pointerId"in h&&M.capturedMap.get(h.pointerId);if((!oe||oe.has(C.eventObject))&&(J.stopped=x.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(G=>G.eventObject===C.eventObject))){const G=u.slice(0,u.indexOf(C));r([...G,C])}},target:{hasPointerCapture:R,setPointerCapture:A,releasePointerCapture:b},currentTarget:{hasPointerCapture:R,setPointerCapture:A,releasePointerCapture:b},nativeEvent:h};if(m(J),x.stopped===!0)break}}return u}function r(u){const{internal:h}=l.getState();for(const d of h.hovered.values())if(!u.length||!u.find(m=>m.object===d.object&&m.index===d.index&&m.instanceId===d.instanceId)){const y=d.eventObject.__r3f,x=y==null?void 0:y.handlers;if(h.hovered.delete(na(d)),y!=null&&y.eventCount){const C={...d,intersections:u};x.onPointerOut==null||x.onPointerOut(C),x.onPointerLeave==null||x.onPointerLeave(C)}}}function s(u,h){for(let d=0;dr([]);case"onLostPointerCapture":return h=>{const{internal:d}=l.getState();"pointerId"in h&&d.capturedMap.has(h.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(h.pointerId)&&(d.capturedMap.delete(h.pointerId),r([]))})}}return function(d){const{onPointerMissed:m,internal:y}=l.getState();y.lastEvent.current=d;const x=u==="onPointerMove",C=u==="onClick"||u==="onContextMenu"||u==="onDoubleClick",S=v(d,x?c:void 0),_=C?n(d):0;u==="onPointerDown"&&(y.initialClick=[d.offsetX,d.offsetY],y.initialHits=S.map(M=>M.eventObject)),C&&!S.length&&_<=2&&(s(d,y.interaction),m&&m(d)),x&&r(S);function w(M){const D=M.eventObject,R=D.__r3f,A=R==null?void 0:R.handlers;if(R!=null&&R.eventCount)if(x){if(A.onPointerOver||A.onPointerEnter||A.onPointerOut||A.onPointerLeave){const b=na(M),B=y.hovered.get(b);B?B.stopped&&M.stopPropagation():(y.hovered.set(b,M),A.onPointerOver==null||A.onPointerOver(M),A.onPointerEnter==null||A.onPointerEnter(M))}A.onPointerMove==null||A.onPointerMove(M)}else{const b=A[u];b?(!C||y.initialHits.includes(D))&&(s(d,y.interaction.filter(B=>!y.initialHits.includes(B))),b(M)):C&&y.initialHits.includes(D)&&s(d,y.interaction.filter(B=>!y.initialHits.includes(B)))}}i(S,d,_,w)}}return{handlePointer:f}}const Gc=l=>!!(l!=null&&l.render),Wc=P.createContext(null),n1=(l,n)=>{const c=zd((f,u)=>{const h=new st,d=new st,m=new st;function y(_=u().camera,w=d,M=u().size){const{width:D,height:R,top:A,left:b}=M,B=D/R;w instanceof st?m.copy(w):m.set(...w);const J=_.getWorldPosition(h).distanceTo(m);if(Oc(_))return{width:D/_.zoom,height:R/_.zoom,top:A,left:b,factor:1,distance:J,aspect:B};{const oe=_.fov*Math.PI/180,G=2*Math.tan(oe/2)*J,O=G*(D/R);return{width:O,height:G,top:A,left:b,factor:D/O,distance:J,aspect:B}}}let x;const C=_=>f(w=>({performance:{...w.performance,current:_}})),T=new Nr;return{set:f,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(_=1)=>l(u(),_),advance:(_,w)=>n(_,w,u()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new md,pointer:T,mouse:T,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const _=u();x&&clearTimeout(x),_.performance.current!==_.performance.min&&C(_.performance.min),x=setTimeout(()=>C(u().performance.max),_.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:y},setEvents:_=>f(w=>({...w,events:{...w.events,..._}})),setSize:(_,w,M,D,R)=>{const A=u().camera,b={width:_,height:w,top:D||0,left:R||0,updateStyle:M};f(B=>({size:b,viewport:{...B.viewport,...y(A,d,b)}}))},setDpr:_=>f(w=>{const M=bc(_);return{viewport:{...w.viewport,dpr:M,initialDpr:w.viewport.initialDpr||M}}}),setFrameloop:(_="always")=>{const w=u().clock;w.stop(),w.elapsedTime=0,_!=="never"&&(w.start(),w.elapsedTime=0),f(()=>({frameloop:_}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:P.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(_,w,M)=>{const D=u().internal;return D.priority=D.priority+(w>0?1:0),D.subscribers.push({ref:_,priority:w,store:M}),D.subscribers=D.subscribers.sort((R,A)=>R.priority-A.priority),()=>{const R=u().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(w>0?1:0),R.subscribers=R.subscribers.filter(A=>A.ref!==_))}}}}}),v=c.getState();let i=v.size,r=v.viewport.dpr,s=v.camera;return c.subscribe(()=>{const{camera:f,size:u,viewport:h,gl:d,set:m}=c.getState();if(u.width!==i.width||u.height!==i.height||h.dpr!==r){var y;i=u,r=h.dpr,qd(f,u),d.setPixelRatio(h.dpr);const x=(y=u.updateStyle)!=null?y:typeof HTMLCanvasElement<"u"&&d.domElement instanceof HTMLCanvasElement;d.setSize(u.width,u.height,x)}f!==s&&(s=f,m(x=>({viewport:{...x.viewport,...x.viewport.getCurrentViewport(f)}})))}),c.subscribe(f=>l(f)),c};function ql(l,n){const c={callback:l};return n.add(c),()=>void n.delete(c)}let ra,Hc=new Set,Vc=new Set,Zc=new Set;const r1=l=>ql(l,Hc),i1=l=>ql(l,Vc),o1=l=>ql(l,Zc);function gl(l,n){if(l.size)for(const{callback:c}of l.values())c(n)}function qi(l,n){switch(l){case"before":return gl(Hc,n);case"after":return gl(Vc,n);case"tail":return gl(Zc,n)}}let yl,xl;function wl(l,n,c){let v=n.clock.getDelta();for(n.frameloop==="never"&&typeof l=="number"&&(v=l-n.clock.elapsedTime,n.clock.oldTime=n.clock.elapsedTime,n.clock.elapsedTime=l),yl=n.internal.subscribers,ra=0;ra0)&&!((h=i.gl.xr)!=null&&h.isPresenting)&&(c+=wl(u,i))}if(qi("after",u),c===0)return qi("tail",u),n=!1,cancelAnimationFrame(v)}function s(u,h=1){var d;if(!u)return l.forEach(m=>s(m.store.getState()),h);(d=u.gl.xr)!=null&&d.isPresenting||!u.internal.active||u.frameloop==="never"||(u.internal.frames=Math.min(60,u.internal.frames+h),n||(n=!0,requestAnimationFrame(r)))}function f(u,h=!0,d,m){if(h&&qi("before",u),d)wl(u,d,m);else for(const y of l.values())wl(u,y.store.getState());h&&qi("after",u)}return{loop:r,invalidate:s,advance:f}}function Qc(){const l=P.useContext(Wc);if(!l)throw new Error("R3F: Hooks can only be used within the Canvas component!");return l}function Si(l=c=>c,n){return Qc()(l,n)}function ao(l,n=0){const c=Qc(),v=c.getState().internal.subscribe,i=zc(l);return oo(()=>v(i,n,c),[n,v,c]),null}const Nu=new WeakMap;function Xc(l,n){return function(c,...v){let i=Nu.get(c);return i||(i=new c,Nu.set(c,i)),l&&l(i),Promise.all(v.map(r=>new Promise((s,f)=>i.load(r,u=>{u.scene&&Object.assign(u,Yd(u.scene)),s(u)},n,u=>f(new Error(`Could not load ${r}: ${u==null?void 0:u.message}`)))))).finally(()=>i.dispose==null?void 0:i.dispose())}}function Yc(l,n,c,v){const i=Array.isArray(n)?n:[n],r=Nd(Xc(c,v),[l,...i],{equal:nt.equ});return Array.isArray(n)?r:r[0]}Yc.preload=function(l,n,c){const v=Array.isArray(n)?n:[n];return Gd(Xc(c),[l,...v])};Yc.clear=function(l,n){const c=Array.isArray(n)?n:[n];return Wd([l,...c])};const wi=new Map,{invalidate:Gu,advance:Wu}=a1(wi),{reconciler:ha,applyProps:ui}=Vd(wi,$d),ci={objects:"shallow",strict:!1},l1=(l,n)=>{const c=typeof l=="function"?l(n):l;return Gc(c)?c:new fd({powerPreference:"high-performance",canvas:n,antialias:!0,alpha:!0,...l})};function s1(l,n){const c=typeof HTMLCanvasElement<"u"&&l instanceof HTMLCanvasElement;if(n){const{width:v,height:i,top:r,left:s,updateStyle:f=c}=n;return{width:v,height:i,top:r,left:s,updateStyle:f}}else if(typeof HTMLCanvasElement<"u"&&l instanceof HTMLCanvasElement&&l.parentElement){const{width:v,height:i,top:r,left:s}=l.parentElement.getBoundingClientRect();return{width:v,height:i,top:r,left:s,updateStyle:c}}else if(typeof OffscreenCanvas<"u"&&l instanceof OffscreenCanvas)return{width:l.width,height:l.height,top:0,left:0,updateStyle:c};return{width:0,height:0,top:0,left:0}}function u1(l){const n=wi.get(l),c=n==null?void 0:n.fiber,v=n==null?void 0:n.store;n&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,r=v||n1(Gu,Wu),s=c||ha.createContainer(r,vi.ConcurrentRoot,null,!1,null,"",i,null);n||wi.set(l,{fiber:s,store:r});let f,u=!1,h;return{configure(d={}){let{gl:m,size:y,scene:x,events:C,onCreated:T,shadows:S=!1,linear:_=!1,flat:w=!1,legacy:M=!1,orthographic:D=!1,frameloop:R="always",dpr:A=[1,2],performance:b,raycaster:B,camera:J,onPointerMissed:oe}=d,G=r.getState(),O=G.gl;G.gl||G.set({gl:O=l1(m,l)});let ee=G.raycaster;ee||G.set({raycaster:ee=new sd});const{params:q,...ne}=B||{};if(nt.equ(ne,ee,ci)||ui(ee,{...ne}),nt.equ(q,ee.params,ci)||ui(ee,{params:{...ee.params,...q}}),!G.camera||G.camera===h&&!nt.equ(h,J,ci)){h=J;const I=J instanceof dd,Q=I?J:D?new Zl(0,0,0,0,.1,1e3):new Ql(75,0,.1,1e3);I||(Q.position.z=5,J&&ui(Q,J),!G.camera&&!(J!=null&&J.rotation)&&Q.lookAt(0,0,0)),G.set({camera:Q}),ee.camera=Q}if(!G.scene){let I;x instanceof da?I=x:(I=new da,x&&ui(I,x)),G.set({scene:di(I)})}if(!G.xr){var ae;const I=(H,re)=>{const X=r.getState();X.frameloop!=="never"&&Wu(H,!0,X,re)},Q=()=>{const H=r.getState();H.gl.xr.enabled=H.gl.xr.isPresenting,H.gl.xr.setAnimationLoop(H.gl.xr.isPresenting?I:null),H.gl.xr.isPresenting||Gu(H)},Y={connect(){const H=r.getState().gl;H.xr.addEventListener("sessionstart",Q),H.xr.addEventListener("sessionend",Q)},disconnect(){const H=r.getState().gl;H.xr.removeEventListener("sessionstart",Q),H.xr.removeEventListener("sessionend",Q)}};typeof((ae=O.xr)==null?void 0:ae.addEventListener)=="function"&&Y.connect(),G.set({xr:Y})}if(O.shadowMap){const I=O.shadowMap.enabled,Q=O.shadowMap.type;if(O.shadowMap.enabled=!!S,nt.boo(S))O.shadowMap.type=dl;else if(nt.str(S)){var ve;const Y={basic:hd,percentage:pd,soft:dl,variance:vd};O.shadowMap.type=(ve=Y[S])!=null?ve:dl}else nt.obj(S)&&Object.assign(O.shadowMap,S);(I!==O.shadowMap.enabled||Q!==O.shadowMap.type)&&(O.shadowMap.needsUpdate=!0)}const Z=Dc();Z&&("enabled"in Z?Z.enabled=!M:"legacyMode"in Z&&(Z.legacyMode=M)),ui(O,{outputEncoding:_?3e3:3001,toneMapping:w?ud:cd}),G.legacy!==M&&G.set(()=>({legacy:M})),G.linear!==_&&G.set(()=>({linear:_})),G.flat!==w&&G.set(()=>({flat:w})),m&&!nt.fun(m)&&!Gc(m)&&!nt.equ(m,O,ci)&&ui(O,m),C&&!G.events.handlers&&G.set({events:C(r)});const k=s1(l,y);return nt.equ(k,G.size,ci)||G.setSize(k.width,k.height,k.updateStyle,k.top,k.left),A&&G.viewport.dpr!==bc(A)&&G.setDpr(A),G.frameloop!==R&&G.setFrameloop(R),G.onPointerMissed||G.set({onPointerMissed:oe}),b&&!nt.equ(b,G.performance,ci)&&G.set(I=>({performance:{...I.performance,...b}})),f=T,u=!0,this},render(d){return u||this.configure(),ha.updateContainer(P.createElement(c1,{store:r,children:d,onCreated:f,rootElement:l}),s,null,()=>{}),r},unmount(){Jc(l)}}}function c1({store:l,children:n,onCreated:c,rootElement:v}){return oo(()=>{const i=l.getState();i.set(r=>({internal:{...r.internal,active:!0}})),c&&c(i),l.getState().events.connected||i.events.connect==null||i.events.connect(v)},[]),P.createElement(Wc.Provider,{value:l},n)}function Jc(l,n){const c=wi.get(l),v=c==null?void 0:c.fiber;if(v){const i=c==null?void 0:c.store.getState();i&&(i.internal.active=!1),ha.updateContainer(null,v,null,()=>{i&&setTimeout(()=>{try{var r,s,f,u;i.events.disconnect==null||i.events.disconnect(),(r=i.gl)==null||(s=r.renderLists)==null||s.dispose==null||s.dispose(),(f=i.gl)==null||f.forceContextLoss==null||f.forceContextLoss(),(u=i.gl)!=null&&u.xr&&i.xr.disconnect(),Jd(i),wi.delete(l),n&&n(l)}catch{}},500)})}}ha.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:P.version});function zl(l,n,c){var v,i,r,s,f;n==null&&(n=100);function u(){var d=Date.now()-s;d=0?v=setTimeout(u,n-d):(v=null,c||(f=l.apply(r,i),r=i=null))}var h=function(){r=this,i=arguments,s=Date.now();var d=c&&!v;return v||(v=setTimeout(u,n)),d&&(f=l.apply(r,i),r=i=null),f};return h.clear=function(){v&&(clearTimeout(v),v=null)},h.flush=function(){v&&(f=l.apply(r,i),r=i=null,clearTimeout(v),v=null)},h}zl.debounce=zl;var f1=zl;const Hu=Cc(f1);function d1(l){let{debounce:n,scroll:c,polyfill:v,offsetSize:i}=l===void 0?{debounce:0,scroll:!1,offsetSize:!1}:l;const r=v||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,f]=P.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=P.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),h=n?typeof n=="number"?n:n.scroll:null,d=n?typeof n=="number"?n:n.resize:null,m=P.useRef(!1);P.useEffect(()=>(m.current=!0,()=>void(m.current=!1)));const[y,x,C]=P.useMemo(()=>{const w=()=>{if(!u.current.element)return;const{left:M,top:D,width:R,height:A,bottom:b,right:B,x:J,y:oe}=u.current.element.getBoundingClientRect(),G={left:M,top:D,width:R,height:A,bottom:b,right:B,x:J,y:oe};u.current.element instanceof HTMLElement&&i&&(G.height=u.current.element.offsetHeight,G.width=u.current.element.offsetWidth),Object.freeze(G),m.current&&!m1(u.current.lastBounds,G)&&f(u.current.lastBounds=G)};return[w,d?Hu(w,d):w,h?Hu(w,h):w]},[f,i,h,d]);function T(){u.current.scrollContainers&&(u.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",C,!0)),u.current.scrollContainers=null),u.current.resizeObserver&&(u.current.resizeObserver.disconnect(),u.current.resizeObserver=null)}function S(){u.current.element&&(u.current.resizeObserver=new r(C),u.current.resizeObserver.observe(u.current.element),c&&u.current.scrollContainers&&u.current.scrollContainers.forEach(w=>w.addEventListener("scroll",C,{capture:!0,passive:!0})))}const _=w=>{!w||w===u.current.element||(T(),u.current.element=w,u.current.scrollContainers=Kc(w),S())};return p1(C,!!c),h1(x),P.useEffect(()=>{T(),S()},[c,C,x]),P.useEffect(()=>T,[]),[_,s,y]}function h1(l){P.useEffect(()=>{const n=l;return window.addEventListener("resize",n),()=>void window.removeEventListener("resize",n)},[l])}function p1(l,n){P.useEffect(()=>{if(n){const c=l;return window.addEventListener("scroll",c,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",c,!0)}},[l,n])}function Kc(l){const n=[];if(!l||l===document.body)return n;const{overflow:c,overflowX:v,overflowY:i}=window.getComputedStyle(l);return[c,v,i].some(r=>r==="auto"||r==="scroll")&&n.push(l),[...n,...Kc(l.parentElement)]}const v1=["x","y","top","bottom","left","right","width","height"],m1=(l,n)=>v1.every(c=>l[c]===n[c]);var g1=Object.defineProperty,y1=Object.defineProperties,x1=Object.getOwnPropertyDescriptors,Vu=Object.getOwnPropertySymbols,w1=Object.prototype.hasOwnProperty,S1=Object.prototype.propertyIsEnumerable,Zu=(l,n,c)=>n in l?g1(l,n,{enumerable:!0,configurable:!0,writable:!0,value:c}):l[n]=c,Qu=(l,n)=>{for(var c in n||(n={}))w1.call(n,c)&&Zu(l,c,n[c]);if(Vu)for(var c of Vu(n))S1.call(n,c)&&Zu(l,c,n[c]);return l},C1=(l,n)=>y1(l,x1(n));function qc(l,n,c){if(!l)return;if(c(l)===!0)return l;let v=n?l.return:l.child;for(;v;){const i=qc(v,n,c);if(i)return i;v=n?null:v.sibling}}function $c(l){try{return Object.defineProperties(l,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return l}}const $l=$c(P.createContext(null));class ef extends P.Component{render(){return P.createElement($l.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Xu,ReactCurrentDispatcher:Yu}=P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _1(){const l=P.useContext($l);if(l===null)throw new Error("its-fine: useFiber must be called within a !");const n=P.useId();return P.useMemo(()=>{for(const v of[Xu==null?void 0:Xu.current,l,l==null?void 0:l.alternate]){if(!v)continue;const i=qc(v,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===n)return!0;s=s.next}});if(i)return i}},[l,n])}function E1(){var l,n;const c=_1(),[v]=P.useState(()=>new Map);v.clear();let i=c;for(;i;){const r=(l=i.type)==null?void 0:l._context;r&&r!==$l&&!v.has(r)&&v.set(r,(n=Yu==null?void 0:Yu.current)==null?void 0:n.readContext($c(r))),i=i.return}return v}function T1(){const l=E1();return P.useMemo(()=>Array.from(l.keys()).reduce((n,c)=>v=>P.createElement(n,null,P.createElement(c.Provider,C1(Qu({},v),{value:l.get(c)}))),n=>P.createElement(ef,Qu({},n))),[l])}const Sl={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function M1(l){const{handlePointer:n}=t1(l);return{priority:1,enabled:!0,compute(c,v,i){v.pointer.set(c.offsetX/v.size.width*2-1,-(c.offsetY/v.size.height)*2+1),v.raycaster.setFromCamera(v.pointer,v.camera)},connected:void 0,handlers:Object.keys(Sl).reduce((c,v)=>({...c,[v]:n(v)}),{}),update:()=>{var c;const{events:v,internal:i}=l.getState();(c=i.lastEvent)!=null&&c.current&&v.handlers&&v.handlers.onPointerMove(i.lastEvent.current)},connect:c=>{var v;const{set:i,events:r}=l.getState();r.disconnect==null||r.disconnect(),i(s=>({events:{...s.events,connected:c}})),Object.entries((v=r.handlers)!=null?v:[]).forEach(([s,f])=>{const[u,h]=Sl[s];c.addEventListener(u,f,{passive:h})})},disconnect:()=>{const{set:c,events:v}=l.getState();if(v.connected){var i;Object.entries((i=v.handlers)!=null?i:[]).forEach(([r,s])=>{if(v&&v.connected instanceof HTMLElement){const[f]=Sl[r];v.connected.removeEventListener(f,s)}}),c(r=>({events:{...r.events,connected:void 0}}))}}}}const k1=P.forwardRef(function({children:n,fallback:c,resize:v,style:i,gl:r,events:s=M1,eventSource:f,eventPrefix:u,shadows:h,linear:d,flat:m,legacy:y,orthographic:x,frameloop:C,dpr:T,performance:S,raycaster:_,camera:w,scene:M,onPointerMissed:D,onCreated:R,...A},b){P.useMemo(()=>Hd(gd),[]);const B=T1(),[J,oe]=d1({scroll:!0,debounce:{scroll:50,resize:0},...v}),G=P.useRef(null),O=P.useRef(null);P.useImperativeHandle(b,()=>G.current);const ee=zc(D),[q,ne]=P.useState(!1),[ae,ve]=P.useState(!1);if(q)throw q;if(ae)throw ae;const Z=P.useRef(null);oo(()=>{const W=G.current;oe.width>0&&oe.height>0&&W&&(Z.current||(Z.current=u1(W)),Z.current.configure({gl:r,events:s,shadows:h,linear:d,flat:m,legacy:y,orthographic:x,frameloop:C,dpr:T,performance:S,raycaster:_,camera:w,scene:M,size:oe,onPointerMissed:(...k)=>ee.current==null?void 0:ee.current(...k),onCreated:k=>{k.events.connect==null||k.events.connect(f?Zd(f)?f.current:f:O.current),u&&k.setEvents({compute:(I,Q)=>{const Y=I[u+"X"],H=I[u+"Y"];Q.pointer.set(Y/Q.size.width*2-1,-(H/Q.size.height)*2+1),Q.raycaster.setFromCamera(Q.pointer,Q.camera)}}),R==null||R(k)}}),Z.current.render(P.createElement(B,null,P.createElement(Ic,{set:ve},P.createElement(P.Suspense,{fallback:P.createElement(Qd,{set:ne})},n)))))}),P.useEffect(()=>{const W=G.current;if(W)return()=>Jc(W)},[]);const j=f?"none":"auto";return P.createElement("div",yi({ref:O,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:j,...i}},A),P.createElement("div",{ref:J,style:{width:"100%",height:"100%"}},P.createElement("canvas",{ref:G,style:{display:"block"}},c)))}),P1=P.forwardRef(function(n,c){return P.createElement(ef,null,P.createElement(k1,yi({},n,{ref:c})))}),lo=new st,es=new st,L1=new st;function U1(l,n,c){const v=lo.setFromMatrixPosition(l.matrixWorld);v.project(n);const i=c.width/2,r=c.height/2;return[v.x*i+i,-(v.y*r)+r]}function R1(l,n){const c=lo.setFromMatrixPosition(l.matrixWorld),v=es.setFromMatrixPosition(n.matrixWorld),i=c.sub(v),r=n.getWorldDirection(L1);return i.angleTo(r)>Math.PI/2}function F1(l,n,c,v){const i=lo.setFromMatrixPosition(l.matrixWorld),r=i.clone();r.project(n),c.setFromCamera(r,n);const s=c.intersectObjects(v,!0);if(s.length){const f=s[0].distance;return i.distanceTo(c.ray.origin)Math.abs(l)<1e-10?0:l;function tf(l,n,c=""){let v="matrix3d(";for(let i=0;i!==16;i++)v+=Il(n[i]*l.elements[i])+(i!==15?",":")");return c+v}const O1=(l=>n=>tf(n,l))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),z1=(l=>(n,c)=>tf(n,l(c),"translate(-50%,-50%)"))(l=>[1/l,1/l,1/l,1,-1/l,-1/l,-1/l,-1,1/l,1/l,1/l,1,1,1,1,1]);function I1(l){return l&&typeof l=="object"&&"current"in l}const dp=P.forwardRef(({children:l,eps:n=.001,style:c,className:v,prepend:i,center:r,fullscreen:s,portal:f,distanceFactor:u,sprite:h=!1,transform:d=!1,occlude:m,onOcclude:y,castShadow:x,receiveShadow:C,material:T,geometry:S,zIndexRange:_=[16777271,0],calculatePosition:w=U1,as:M="div",wrapperClass:D,pointerEvents:R="auto",...A},b)=>{const{gl:B,camera:J,scene:oe,size:G,raycaster:O,events:ee,viewport:q}=Si(),[ne]=P.useState(()=>document.createElement(M)),ae=P.useRef(),ve=P.useRef(null),Z=P.useRef(0),j=P.useRef([0,0]),W=P.useRef(null),k=P.useRef(null),I=(f==null?void 0:f.current)||ee.connected||B.domElement.parentNode,Q=P.useRef(null),Y=P.useRef(!1),H=P.useMemo(()=>m&&m!=="blending"||Array.isArray(m)&&m.length&&I1(m[0]),[m]);P.useLayoutEffect(()=>{const fe=B.domElement;m&&m==="blending"?(fe.style.zIndex=`${Math.floor(_[0]/2)}`,fe.style.position="absolute",fe.style.pointerEvents="none"):(fe.style.zIndex=null,fe.style.position=null,fe.style.pointerEvents=null)},[m]),P.useLayoutEffect(()=>{if(ve.current){const fe=ae.current=_c(ne);if(oe.updateMatrixWorld(),d)ne.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const K=w(ve.current,J,G);ne.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${K[0]}px,${K[1]}px,0);transform-origin:0 0;`}return I&&(i?I.prepend(ne):I.appendChild(ne)),()=>{I&&I.removeChild(ne),fe.unmount()}}},[I,d]),P.useLayoutEffect(()=>{D&&(ne.className=D)},[D]);const re=P.useMemo(()=>d?{position:"absolute",top:0,left:0,width:G.width,height:G.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:r?"translate3d(-50%,-50%,0)":"none",...s&&{top:-G.height/2,left:-G.width/2,width:G.width,height:G.height},...c},[c,r,s,G,d]),X=P.useMemo(()=>({position:"absolute",pointerEvents:R}),[R]);P.useLayoutEffect(()=>{if(Y.current=!1,d){var fe;(fe=ae.current)==null||fe.render(P.createElement("div",{ref:W,style:re},P.createElement("div",{ref:k,style:X},P.createElement("div",{ref:b,className:v,style:c,children:l}))))}else{var K;(K=ae.current)==null||K.render(P.createElement("div",{ref:b,style:re,className:v,children:l}))}});const te=P.useRef(!0);ao(fe=>{if(ve.current){J.updateMatrixWorld(),ve.current.updateWorldMatrix(!0,!1);const K=d?j.current:w(ve.current,J,G);if(d||Math.abs(Z.current-J.zoom)>n||Math.abs(j.current[0]-K[0])>n||Math.abs(j.current[1]-K[1])>n){const $=R1(ve.current,J);let xe=!1;H&&(m!=="blending"?xe=[oe]:Array.isArray(m)&&(xe=m.map(ke=>ke.current)));const Re=te.current;if(xe){const ke=F1(ve.current,J,O,xe);te.current=ke&&!$}else te.current=!$;Re!==te.current&&(y?y(!te.current):ne.style.display=te.current?"block":"none");const ce=Math.floor(_[0]/2),Se=m?H?[_[0],ce]:[ce-1,0]:_;if(ne.style.zIndex=`${D1(ve.current,J,Se)}`,d){const[ke,le]=[G.width/2,G.height/2],Ce=J.projectionMatrix.elements[5]*le,{isOrthographicCamera:pe,top:ie,left:Pe,bottom:ye,right:we}=J,me=O1(J.matrixWorldInverse),We=pe?`scale(${Ce})translate(${Il(-(we+Pe)/2)}px,${Il((ie+ye)/2)}px)`:`translateZ(${Ce}px)`;let Oe=ve.current.matrixWorld;h&&(Oe=J.matrixWorldInverse.clone().transpose().copyPosition(Oe).scale(ve.current.scale),Oe.elements[3]=Oe.elements[7]=Oe.elements[11]=0,Oe.elements[15]=1),ne.style.width=G.width+"px",ne.style.height=G.height+"px",ne.style.perspective=pe?"":`${Ce}px`,W.current&&k.current&&(W.current.style.transform=`${We}${me}translate(${ke}px,${le}px)`,k.current.style.transform=z1(Oe,1/((u||10)/400)))}else{const ke=u===void 0?1:A1(ve.current,J)*u;ne.style.transform=`translate3d(${K[0]}px,${K[1]}px,0) scale(${ke})`}j.current=K,Z.current=J.zoom}}if(!H&&Q.current&&!Y.current)if(d){if(W.current){const K=W.current.children[0];if(K!=null&&K.clientWidth&&K!=null&&K.clientHeight){const{isOrthographicCamera:$}=J;if($||S)A.scale&&(Array.isArray(A.scale)?A.scale instanceof st?Q.current.scale.copy(A.scale.clone().divideScalar(1)):Q.current.scale.set(1/A.scale[0],1/A.scale[1],1/A.scale[2]):Q.current.scale.setScalar(1/A.scale));else{const xe=(u||10)/400,Re=K.clientWidth*xe,ce=K.clientHeight*xe;Q.current.scale.set(Re,ce,1)}Y.current=!0}}}else{const K=ne.children[0];if(K!=null&&K.clientWidth&&K!=null&&K.clientHeight){const $=1/q.factor,xe=K.clientWidth*$,Re=K.clientHeight*$;Q.current.scale.set(xe,Re,1),Y.current=!0}Q.current.lookAt(fe.camera.position)}});const ue=P.useMemo(()=>({vertexShader:d?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite @@ -69,7 +69,7 @@ No matching component was found for: void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } - `}),[d]);return P.createElement("group",yi({},A,{ref:ve}),m&&!H&&P.createElement("mesh",{castShadow:x,receiveShadow:C,ref:Q},S||P.createElement("planeGeometry",null),T||P.createElement("shaderMaterial",{side:Xl,vertexShader:ue.vertexShader,fragmentShader:ue.fragmentShader})))});function pp(a){return function(n){a.forEach(function(c){typeof c=="function"?c(n):c!=null&&(c.current=n)})}}function j1(a){let n=0;for(let v in a.attributes){const i=a.getAttribute(v);n+=i.count*i.itemSize*i.array.BYTES_PER_ELEMENT}const c=a.getIndex();return n+=c?c.count*c.itemSize*c.array.BYTES_PER_ELEMENT:0,n}const Ju=new pa,ia=new st;class ts extends Tc{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const n=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],c=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],v=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(v),this.setAttribute("position",new Ul(n,3)),this.setAttribute("uv",new Ul(c,2))}applyMatrix4(n){const c=this.attributes.instanceStart,v=this.attributes.instanceEnd;return c!==void 0&&(c.applyMatrix4(n),v.applyMatrix4(n),c.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(n){let c;n instanceof Float32Array?c=n:Array.isArray(n)&&(c=new Float32Array(n));const v=new Rl(c,6,1);return this.setAttribute("instanceStart",new pi(v,3,0)),this.setAttribute("instanceEnd",new pi(v,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(n){let c;n instanceof Float32Array?c=n:Array.isArray(n)&&(c=new Float32Array(n));const v=new Rl(c,6,1);return this.setAttribute("instanceColorStart",new pi(v,3,0)),this.setAttribute("instanceColorEnd",new pi(v,3,3)),this}fromWireframeGeometry(n){return this.setPositions(n.attributes.position.array),this}fromEdgesGeometry(n){return this.setPositions(n.attributes.position.array),this}fromMesh(n){return this.fromWireframeGeometry(new yd(n.geometry)),this}fromLineSegments(n){const c=n.geometry;return this.setPositions(c.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new pa);const n=this.attributes.instanceStart,c=this.attributes.instanceEnd;n!==void 0&&c!==void 0&&(this.boundingBox.setFromBufferAttribute(n),Ju.setFromBufferAttribute(c),this.boundingBox.union(Ju))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Yl),this.boundingBox===null&&this.computeBoundingBox();const n=this.attributes.instanceStart,c=this.attributes.instanceEnd;if(n!==void 0&&c!==void 0){const v=this.boundingSphere.center;this.boundingBox.getCenter(v);let i=0;for(let r=0,s=n.count;r #include #include @@ -456,15 +456,15 @@ No matching component was found for: #include } - `,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(c){this.uniforms.diffuse.value=c}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(c){c===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(c){this.uniforms.linewidth.value=c}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(c){!!c!="USE_DASH"in this.defines&&(this.needsUpdate=!0),c===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(c){this.uniforms.dashScale.value=c}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(c){this.uniforms.dashSize.value=c}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(c){this.uniforms.dashOffset.value=c}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(c){this.uniforms.gapSize.value=c}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(c){this.uniforms.opacity.value=c}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(c){this.uniforms.resolution.value.copy(c)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(c){!!c!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),c===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(n)}}const Ku=new st,qu=new st,At=new xi,Dt=new xi,Vn=new xi,Cl=new st,_l=new Mc,Bt=new Sd,$u=new st,oa=new pa,aa=new Yl,Zn=new xi;let Qn,jl,rf,br;function ec(a,n,c){return Zn.set(0,0,-n,1).applyMatrix4(a.projectionMatrix),Zn.multiplyScalar(1/Zn.w),Zn.x=br/c.width,Zn.y=br/c.height,Zn.applyMatrix4(a.projectionMatrixInverse),Zn.multiplyScalar(1/Zn.w),Math.abs(Math.max(Zn.x,Zn.y))}function b1(a,n){for(let c=0,v=jl.count;cd&&Dt.z>d)continue;if(At.z>d){const w=At.z-Dt.z,M=(At.z-d)/w;At.lerp(Dt,M)}else if(Dt.z>d){const w=Dt.z-At.z,M=(Dt.z-d)/w;Dt.lerp(At,M)}At.applyMatrix4(v),Dt.applyMatrix4(v),At.multiplyScalar(1/At.w),Dt.multiplyScalar(1/Dt.w),At.x*=r.x/2,At.y*=r.y/2,Dt.x*=r.x/2,Dt.y*=r.y/2,Bt.start.copy(At),Bt.start.z=0,Bt.end.copy(Dt),Bt.end.z=0;const C=Bt.closestPointToPointParameter(Cl,!0);Bt.at(C,$u);const T=kc.lerp(At.z,Dt.z,C),S=T>=-1&&T<=1,_=Cl.distanceTo($u)C.size),m=P.useMemo(()=>s?new of:new N1,[s]),[y]=P.useState(()=>new ns),x=P.useMemo(()=>{const C=s?new ts:new nf,T=n.map(S=>{const _=Array.isArray(S);return S instanceof st?[S.x,S.y,S.z]:S instanceof Nr?[S.x,S.y,0]:_&&S.length===3?[S[0],S[1],S[2]]:_&&S.length===2?[S[0],S[1],0]:S});if(C.setPositions(T.flat()),v){const S=v.map(_=>_ instanceof io?_.toArray():_);C.setColors(S.flat())}return C},[n,s,v]);return P.useLayoutEffect(()=>{m.computeLineDistances()},[n,m]),P.useLayoutEffect(()=>{f?y.defines.USE_DASH="":delete y.defines.USE_DASH,y.needsUpdate=!0},[f,y]),P.useEffect(()=>()=>x.dispose(),[x]),P.createElement("primitive",yi({object:m,ref:h},u),P.createElement("primitive",{object:x,attach:"geometry"}),P.createElement("primitive",yi({object:y,attach:"material",color:c,vertexColors:!!v,resolution:[d.width,d.height],linewidth:i??r,dashed:f},u)))});function G1(){var a=Object.create(null);function n(i,r){var s=i.id,f=i.name,u=i.dependencies;u===void 0&&(u=[]);var h=i.init;h===void 0&&(h=function(){});var d=i.getTransferables;if(d===void 0&&(d=null),!a[s])try{u=u.map(function(y){return y&&y.isWorkerModule&&(n(y,function(x){if(x instanceof Error)throw x}),y=a[y.id].value),y}),h=v("<"+f+">.init",h),d&&(d=v("<"+f+">.getTransferables",d));var m=null;typeof h=="function"?m=h.apply(void 0,u):console.error("worker module init function failed to rehydrate"),a[s]={id:s,value:m,getTransferables:d},r(m)}catch(y){y&&y.noLog||console.error(y),r(y)}}function c(i,r){var s,f=i.id,u=i.args;(!a[f]||typeof a[f].value!="function")&&r(new Error("Worker module "+f+": not found or its 'init' did not return a function"));try{var h=(s=a[f]).value.apply(s,u);h&&typeof h.then=="function"?h.then(d,function(m){return r(m instanceof Error?m:new Error(""+m))}):d(h)}catch(m){r(m)}function d(m){try{var y=a[f].getTransferables&&a[f].getTransferables(m);(!y||!Array.isArray(y)||!y.length)&&(y=void 0),r(m,y)}catch(x){console.error(x),r(x)}}}function v(i,r){var s=void 0;self.troikaDefine=function(u){return s=u};var f=URL.createObjectURL(new Blob(["/** "+i.replace(/\*/g,"")+` **/ + `,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(c){this.uniforms.diffuse.value=c}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(c){c===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(c){this.uniforms.linewidth.value=c}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(c){!!c!="USE_DASH"in this.defines&&(this.needsUpdate=!0),c===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(c){this.uniforms.dashScale.value=c}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(c){this.uniforms.dashSize.value=c}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(c){this.uniforms.dashOffset.value=c}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(c){this.uniforms.gapSize.value=c}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(c){this.uniforms.opacity.value=c}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(c){this.uniforms.resolution.value.copy(c)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(c){!!c!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),c===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(n)}}const Ku=new st,qu=new st,At=new xi,Dt=new xi,Vn=new xi,Cl=new st,_l=new Mc,Bt=new Sd,$u=new st,oa=new pa,aa=new Yl,Zn=new xi;let Qn,jl,rf,br;function ec(l,n,c){return Zn.set(0,0,-n,1).applyMatrix4(l.projectionMatrix),Zn.multiplyScalar(1/Zn.w),Zn.x=br/c.width,Zn.y=br/c.height,Zn.applyMatrix4(l.projectionMatrixInverse),Zn.multiplyScalar(1/Zn.w),Math.abs(Math.max(Zn.x,Zn.y))}function b1(l,n){for(let c=0,v=jl.count;cd&&Dt.z>d)continue;if(At.z>d){const w=At.z-Dt.z,M=(At.z-d)/w;At.lerp(Dt,M)}else if(Dt.z>d){const w=Dt.z-At.z,M=(Dt.z-d)/w;Dt.lerp(At,M)}At.applyMatrix4(v),Dt.applyMatrix4(v),At.multiplyScalar(1/At.w),Dt.multiplyScalar(1/Dt.w),At.x*=r.x/2,At.y*=r.y/2,Dt.x*=r.x/2,Dt.y*=r.y/2,Bt.start.copy(At),Bt.start.z=0,Bt.end.copy(Dt),Bt.end.z=0;const C=Bt.closestPointToPointParameter(Cl,!0);Bt.at(C,$u);const T=kc.lerp(At.z,Dt.z,C),S=T>=-1&&T<=1,_=Cl.distanceTo($u)C.size),m=P.useMemo(()=>s?new of:new N1,[s]),[y]=P.useState(()=>new ns),x=P.useMemo(()=>{const C=s?new ts:new nf,T=n.map(S=>{const _=Array.isArray(S);return S instanceof st?[S.x,S.y,S.z]:S instanceof Nr?[S.x,S.y,0]:_&&S.length===3?[S[0],S[1],S[2]]:_&&S.length===2?[S[0],S[1],0]:S});if(C.setPositions(T.flat()),v){const S=v.map(_=>_ instanceof ro?_.toArray():_);C.setColors(S.flat())}return C},[n,s,v]);return P.useLayoutEffect(()=>{m.computeLineDistances()},[n,m]),P.useLayoutEffect(()=>{f?y.defines.USE_DASH="":delete y.defines.USE_DASH,y.needsUpdate=!0},[f,y]),P.useEffect(()=>()=>x.dispose(),[x]),P.createElement("primitive",yi({object:m,ref:h},u),P.createElement("primitive",{object:x,attach:"geometry"}),P.createElement("primitive",yi({object:y,attach:"material",color:c,vertexColors:!!v,resolution:[d.width,d.height],linewidth:i??r,dashed:f},u)))});function G1(){var l=Object.create(null);function n(i,r){var s=i.id,f=i.name,u=i.dependencies;u===void 0&&(u=[]);var h=i.init;h===void 0&&(h=function(){});var d=i.getTransferables;if(d===void 0&&(d=null),!l[s])try{u=u.map(function(y){return y&&y.isWorkerModule&&(n(y,function(x){if(x instanceof Error)throw x}),y=l[y.id].value),y}),h=v("<"+f+">.init",h),d&&(d=v("<"+f+">.getTransferables",d));var m=null;typeof h=="function"?m=h.apply(void 0,u):console.error("worker module init function failed to rehydrate"),l[s]={id:s,value:m,getTransferables:d},r(m)}catch(y){y&&y.noLog||console.error(y),r(y)}}function c(i,r){var s,f=i.id,u=i.args;(!l[f]||typeof l[f].value!="function")&&r(new Error("Worker module "+f+": not found or its 'init' did not return a function"));try{var h=(s=l[f]).value.apply(s,u);h&&typeof h.then=="function"?h.then(d,function(m){return r(m instanceof Error?m:new Error(""+m))}):d(h)}catch(m){r(m)}function d(m){try{var y=l[f].getTransferables&&l[f].getTransferables(m);(!y||!Array.isArray(y)||!y.length)&&(y=void 0),r(m,y)}catch(x){console.error(x),r(x)}}}function v(i,r){var s=void 0;self.troikaDefine=function(u){return s=u};var f=URL.createObjectURL(new Blob(["/** "+i.replace(/\*/g,"")+` **/ troikaDefine( `+r+` -)`],{type:"application/javascript"}));try{importScripts(f)}catch(u){console.error(u)}return URL.revokeObjectURL(f),delete self.troikaDefine,s}self.addEventListener("message",function(i){var r=i.data,s=r.messageId,f=r.action,u=r.data;try{f==="registerModule"&&n(u,function(h){h instanceof Error?postMessage({messageId:s,success:!1,error:h.message}):postMessage({messageId:s,success:!0,result:{isCallable:typeof h=="function"}})}),f==="callModule"&&c(u,function(h,d){h instanceof Error?postMessage({messageId:s,success:!1,error:h.message}):postMessage({messageId:s,success:!0,result:h},d||void 0)})}catch(h){postMessage({messageId:s,success:!1,error:h.stack})}})}function W1(a){var n=function(){for(var c=[],v=arguments.length;v--;)c[v]=arguments[v];return n._getInitResult().then(function(i){if(typeof i=="function")return i.apply(void 0,c);throw new Error("Worker module function was called but `init` did not return a callable function")})};return n._getInitResult=function(){var c=a.dependencies,v=a.init;c=Array.isArray(c)?c.map(function(r){return r&&r._getInitResult?r._getInitResult():r}):[];var i=Promise.all(c).then(function(r){return v.apply(null,r)});return n._getInitResult=function(){return i},i},n}var af=function(){var a=!1;if(typeof window<"u"&&typeof window.document<"u")try{var n=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));n.terminate(),a=!0}catch(c){typeof process<"u",console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+c.message+"]")}return af=function(){return a},a},H1=0,V1=0,El=!1,no=Object.create(null),ro=Object.create(null),bl=Object.create(null);function so(a){if((!a||typeof a.init!="function")&&!El)throw new Error("requires `options.init` function");var n=a.dependencies,c=a.init,v=a.getTransferables,i=a.workerId;if(!af())return W1(a);i==null&&(i="#default");var r="workerModule"+ ++H1,s=a.name||r,f=null;n=n&&n.map(function(h){return typeof h=="function"&&!h.workerModuleData&&(El=!0,h=so({workerId:i,name:"<"+s+"> function dependency: "+h.name,init:`function(){return ( +)`],{type:"application/javascript"}));try{importScripts(f)}catch(u){console.error(u)}return URL.revokeObjectURL(f),delete self.troikaDefine,s}self.addEventListener("message",function(i){var r=i.data,s=r.messageId,f=r.action,u=r.data;try{f==="registerModule"&&n(u,function(h){h instanceof Error?postMessage({messageId:s,success:!1,error:h.message}):postMessage({messageId:s,success:!0,result:{isCallable:typeof h=="function"}})}),f==="callModule"&&c(u,function(h,d){h instanceof Error?postMessage({messageId:s,success:!1,error:h.message}):postMessage({messageId:s,success:!0,result:h},d||void 0)})}catch(h){postMessage({messageId:s,success:!1,error:h.stack})}})}function W1(l){var n=function(){for(var c=[],v=arguments.length;v--;)c[v]=arguments[v];return n._getInitResult().then(function(i){if(typeof i=="function")return i.apply(void 0,c);throw new Error("Worker module function was called but `init` did not return a callable function")})};return n._getInitResult=function(){var c=l.dependencies,v=l.init;c=Array.isArray(c)?c.map(function(r){return r&&r._getInitResult?r._getInitResult():r}):[];var i=Promise.all(c).then(function(r){return v.apply(null,r)});return n._getInitResult=function(){return i},i},n}var af=function(){var l=!1;if(typeof window<"u"&&typeof window.document<"u")try{var n=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));n.terminate(),l=!0}catch(c){typeof process<"u",console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+c.message+"]")}return af=function(){return l},l},H1=0,V1=0,El=!1,to=Object.create(null),no=Object.create(null),bl=Object.create(null);function so(l){if((!l||typeof l.init!="function")&&!El)throw new Error("requires `options.init` function");var n=l.dependencies,c=l.init,v=l.getTransferables,i=l.workerId;if(!af())return W1(l);i==null&&(i="#default");var r="workerModule"+ ++H1,s=l.name||r,f=null;n=n&&n.map(function(h){return typeof h=="function"&&!h.workerModuleData&&(El=!0,h=so({workerId:i,name:"<"+s+"> function dependency: "+h.name,init:`function(){return ( `+ca(h)+` -)}`}),El=!1),h&&h.workerModuleData&&(h=h.workerModuleData),h});function u(){for(var h=[],d=arguments.length;d--;)h[d]=arguments[d];if(!f){f=tc(i,"registerModule",u.workerModuleData);var m=function(){f=null,ro[i].delete(m)};(ro[i]||(ro[i]=new Set)).add(m)}return f.then(function(y){var x=y.isCallable;if(x)return tc(i,"callModule",{id:r,args:h});throw new Error("Worker module function was called but `init` did not return a callable function")})}return u.workerModuleData={isWorkerModule:!0,id:r,name:s,dependencies:n,init:ca(c),getTransferables:v&&ca(v)},u}function Z1(a){ro[a]&&ro[a].forEach(function(n){n()}),no[a]&&(no[a].terminate(),delete no[a])}function ca(a){var n=a.toString();return!/^function/.test(n)&&/^\w+\s*\(/.test(n)&&(n="function "+n),n}function Q1(a){var n=no[a];if(!n){var c=ca(G1);n=no[a]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+a.replace(/\*/g,"")+` **/ +)}`}),El=!1),h&&h.workerModuleData&&(h=h.workerModuleData),h});function u(){for(var h=[],d=arguments.length;d--;)h[d]=arguments[d];if(!f){f=tc(i,"registerModule",u.workerModuleData);var m=function(){f=null,no[i].delete(m)};(no[i]||(no[i]=new Set)).add(m)}return f.then(function(y){var x=y.isCallable;if(x)return tc(i,"callModule",{id:r,args:h});throw new Error("Worker module function was called but `init` did not return a callable function")})}return u.workerModuleData={isWorkerModule:!0,id:r,name:s,dependencies:n,init:ca(c),getTransferables:v&&ca(v)},u}function Z1(l){no[l]&&no[l].forEach(function(n){n()}),to[l]&&(to[l].terminate(),delete to[l])}function ca(l){var n=l.toString();return!/^function/.test(n)&&/^\w+\s*\(/.test(n)&&(n="function "+n),n}function Q1(l){var n=to[l];if(!n){var c=ca(G1);n=to[l]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+l.replace(/\*/g,"")+` **/ -;(`+c+")()"],{type:"application/javascript"}))),n.onmessage=function(v){var i=v.data,r=i.messageId,s=bl[r];if(!s)throw new Error("WorkerModule response with empty or unknown messageId");delete bl[r],s(i)}}return n}function tc(a,n,c){return new Promise(function(v,i){var r=++V1;bl[r]=function(s){s.success?v(s.result):i(new Error("Error in worker "+n+" call: "+s.error))},Q1(a).postMessage({messageId:r,action:n,data:c})})}function lf(){var a=function(n){function c(j,W,k,I,Q,Y,H,re){var X=1-H;re.x=X*X*j+2*X*H*k+H*H*Q,re.y=X*X*W+2*X*H*I+H*H*Y}function v(j,W,k,I,Q,Y,H,re,X,te){var ue=1-X;te.x=ue*ue*ue*j+3*ue*ue*X*k+3*ue*X*X*Q+X*X*X*H,te.y=ue*ue*ue*W+3*ue*ue*X*I+3*ue*X*X*Y+X*X*X*re}function i(j,W){for(var k=/([MLQCZ])([^MLQCZ]*)/g,I,Q,Y,H,re;I=k.exec(j);){var X=I[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(te){return parseFloat(te)});switch(I[1]){case"M":H=Q=X[0],re=Y=X[1];break;case"L":(X[0]!==H||X[1]!==re)&&W("L",H,re,H=X[0],re=X[1]);break;case"Q":{W("Q",H,re,H=X[2],re=X[3],X[0],X[1]);break}case"C":{W("C",H,re,H=X[4],re=X[5],X[0],X[1],X[2],X[3]);break}case"Z":(H!==Q||re!==Y)&&W("L",H,re,Q,Y);break}}}function r(j,W,k){k===void 0&&(k=16);var I={x:0,y:0};i(j,function(Q,Y,H,re,X,te,ue,fe,K){switch(Q){case"L":W(Y,H,re,X);break;case"Q":{for(var $=Y,xe=H,Re=1;Re0;)Oe[Me]=arguments[Me+2];var ze=pe[We]||(pe[We]=k.getUniformLocation(ie,We));k["uniform"+me].apply(k,[ze].concat(Oe))},setAttribute:function(me,We,Oe,Me,ze){var He=Ce[me];He||(He=Ce[me]={buf:k.createBuffer(),loc:k.getAttribLocation(ie,me),data:null}),k.bindBuffer(k.ARRAY_BUFFER,He.buf),k.vertexAttribPointer(He.loc,We,k.FLOAT,!1,0,0),k.enableVertexAttribArray(He.loc),Q?k.vertexAttribDivisor(He.loc,Me):ue("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(He.loc,Me),ze!==He.data&&(k.bufferData(k.ARRAY_BUFFER,ze,Oe),He.data=ze)}})}}}H[ce].transaction(le)},$=function(ce,Se){X++;try{k.activeTexture(k.TEXTURE0+X);var ke=re[ce];ke||(ke=re[ce]=k.createTexture(),k.bindTexture(k.TEXTURE_2D,ke),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,k.NEAREST),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,k.NEAREST)),k.bindTexture(k.TEXTURE_2D,ke),Se(ke,X)}finally{X--}},xe=function(ce,Se,ke){var le=k.createFramebuffer();te.push(le),k.bindFramebuffer(k.FRAMEBUFFER,le),k.activeTexture(k.TEXTURE0+Se),k.bindTexture(k.TEXTURE_2D,ce),k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_2D,ce,0);try{ke(le)}finally{k.deleteFramebuffer(le),k.bindFramebuffer(k.FRAMEBUFFER,te[--te.length-1]||null)}},Re=function(){Y={},H={},re={},X=-1,te.length=0};var Q=typeof WebGL2RenderingContext<"u"&&k instanceof WebGL2RenderingContext,Y={},H={},re={},X=-1,te=[];k.canvas.addEventListener("webglcontextlost",function(ce){Re(),ce.preventDefault()},!1),u.set(k,I={gl:k,isWebGL2:Q,getExtension:ue,withProgram:K,withTexture:$,withTextureFramebuffer:xe,handleContextLoss:Re})}W(I)}function m(j,W,k,I,Q,Y,H,re){H===void 0&&(H=15),re===void 0&&(re=null),d(j,function(X){var te=X.gl,ue=X.withProgram,fe=X.withTexture;fe("copy",function(K,$){te.texImage2D(te.TEXTURE_2D,0,te.RGBA,Q,Y,0,te.RGBA,te.UNSIGNED_BYTE,W),ue("copy",s,f,function(xe){var Re=xe.setUniform,ce=xe.setAttribute;ce("aUV",2,te.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),Re("1i","image",$),te.bindFramebuffer(te.FRAMEBUFFER,re||null),te.disable(te.BLEND),te.colorMask(H&8,H&4,H&2,H&1),te.viewport(k,I,Q,Y),te.scissor(k,I,Q,Y),te.drawArrays(te.TRIANGLES,0,3)})})})}function y(j,W,k){var I=j.width,Q=j.height;d(j,function(Y){var H=Y.gl,re=new Uint8Array(I*Q*4);H.readPixels(0,0,I,Q,H.RGBA,H.UNSIGNED_BYTE,re),j.width=W,j.height=k,m(H,re,0,0,I,Q)})}var x=Object.freeze({__proto__:null,withWebGLContext:d,renderImageData:m,resizeWebGLCanvasWithoutClearing:y});function C(j,W,k,I,Q,Y){Y===void 0&&(Y=1);var H=new Uint8Array(j*W),re=I[2]-I[0],X=I[3]-I[1],te=[];r(k,function(ce,Se,ke,le){te.push({x1:ce,y1:Se,x2:ke,y2:le,minX:Math.min(ce,ke),minY:Math.min(Se,le),maxX:Math.max(ce,ke),maxY:Math.max(Se,le)})}),te.sort(function(ce,Se){return ce.maxX-Se.maxX});for(var ue=0;uepe.minX&&Se-lepe.minY){var ie=_(ce,Se,pe.x1,pe.y1,pe.x2,pe.y2);ieSe!=Ce.y2>Se&&ce<(Ce.x2-Ce.x1)*(Se-Ce.y1)/(Ce.y2-Ce.y1)+Ce.x1;pe&&(ke+=Ce.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function T(le,Ce){var pe=36,ie=0,Pe=new Map,ye=Ce&&new Map,we;return le.split(",").forEach(function me(We){if(We.indexOf("+")!==-1)for(var Oe=+We;Oe--;)me(we);else{we=We;var Me=We.split(">"),ze=Me[0],He=Me[1];ze=String.fromCodePoint(ie+=parseInt(ze,pe)),He=String.fromCodePoint(ie+=parseInt(He,pe)),Pe.set(ze,He),Ce&&ye.set(He,ze)}}),{map:Pe,reverseMap:ye}}var S,_,w;function M(){if(!S){var le=T(C.pairs,!0),Ce=le.map,pe=le.reverseMap;S=Ce,_=pe,w=T(C.canonical,!1).map}}function D(le){return M(),S.get(le)||null}function R(le){return M(),_.get(le)||null}function A(le){return M(),w.get(le)||null}var b=v.L,B=v.R,J=v.EN,oe=v.ES,G=v.ET,O=v.AN,ee=v.CS,q=v.B,ne=v.S,ae=v.ON,ve=v.BN,Z=v.NSM,j=v.AL,W=v.LRO,k=v.RLO,I=v.LRE,Q=v.RLE,Y=v.PDF,H=v.LRI,re=v.RLI,X=v.FSI,te=v.PDI;function ue(le,Ce){for(var pe=125,ie=new Uint32Array(le.length),Pe=0;Pe0)Qe--;else if(ct>0){for(Je=0;!be[be.length-1]._isolate;)be.pop();var Un=be[be.length-1]._isolInitIndex;Un!=null&&(We.set(Un,Ie),We.set(Ie,Un)),be.pop(),ct--}Ue=be[be.length-1],me[Ie]=Ue._level,Ue._override&&we(Ie,Ue._override)}else et&Y?(Qe===0&&(Je>0?Je--:!Ue._isolate&&be.length>1&&(be.pop(),Ue=be[be.length-1])),me[Ie]=Ue._level):et&q&&(me[Ie]=Me.level);else me[Ie]=Ue._level,Ue._override&&et!==ve&&we(Ie,Ue._override)}for(var Wt=[],Ht=null,tt=Me.start;tt<=Me.end;tt++){var lr=ie[tt];if(!(lr&u)){var rt=me[tt],it=lr&r,on=lr===te;Ht&&rt===Ht._level?(Ht._end=tt,Ht._endsWithIsolInit=it):Wt.push(Ht={_start:tt,_end:tt,_level:rt,_startsWithPDI:on,_endsWithIsolInit:it})}}for(var Vt=[],Xe=0;Xe=0;xr--)if(!(ie[xr]&u)){uo=me[xr];break}var _i=Rt[Rt.length-1],ga=me[_i],co=Me.level;if(!(ie[_i]&r)){for(var Wr=_i+1;Wr<=Me.end;Wr++)if(!(ie[Wr]&u)){co=me[Wr];break}}Vt.push({_seqIndices:Rt,_sosType:Math.max(uo,ma)%2?B:b,_eosType:Math.max(co,ga)%2?B:b})}}for(var Ei=0;Ei=0;ln--)if(!(ie[_e[ln]]&u)){In=ie[_e[ln]];break}we(Vr,In&(r|te)?ae:In)}}if(ye.get(J))for(var Ye=0;Ye<_e.length;Ye++){var Ke=_e[Ye];if(ie[Ke]&J)for(var sn=Ye-1;sn>=-1;sn--){var St=sn===-1?Rn:ie[_e[sn]];if(St&s){St===j&&we(Ke,O);break}}}if(ye.get(j))for(var Et=0;Et<_e.length;Et++){var jn=_e[Et];ie[jn]&j&&we(jn,B)}if(ye.get(oe)||ye.get(ee))for(var yn=1;yn<_e.length-1;yn++){var Tt=_e[yn];if(ie[Tt]&(oe|ee)){for(var Fn=0,Zr=0,Qr=yn-1;Qr>=0&&(Fn=ie[_e[Qr]],!!(Fn&u));Qr--);for(var sr=yn+1;sr<_e.length&&(Zr=ie[_e[sr]],!!(Zr&u));sr++);Fn===Zr&&(ie[Tt]===oe?Fn===J:Fn&(J|O))&&we(Tt,Fn)}}if(ye.get(J))for(var un=0;un<_e.length;un++){var cn=_e[un];if(ie[cn]&J){for(var Xr=un-1;Xr>=0&&ie[_e[Xr]]&(G|u);Xr--)we(_e[Xr],J);for(un++;un<_e.length&&ie[_e[un]]&(G|u|J);un++)ie[_e[un]]!==J&&we(_e[un],J)}}if(ye.get(G)||ye.get(oe)||ye.get(ee))for(var wr=0;wr<_e.length;wr++){var fo=_e[wr];if(ie[fo]&(G|oe|ee)){we(fo,ae);for(var Kn=wr-1;Kn>=0&&ie[_e[Kn]]&u;Kn--)we(_e[Kn],ae);for(var qn=wr+1;qn<_e.length&&ie[_e[qn]]&u;qn++)we(_e[qn],ae)}}if(ye.get(J))for(var $n=0,Sr=Rn;$n<_e.length;$n++){var ho=_e[$n],ki=ie[ho];ki&J?Sr===b&&we(ho,b):ki&s&&(Sr=ki)}if(ye.get(f)){var er=B|J|O,Yr=er|b,bn=[];{for(var ur=[],Bn=0;Bn<_e.length;Bn++)if(ie[_e[Bn]]&f){var Ne=le[_e[Bn]],Pi=void 0;if(D(Ne)!==null)if(ur.length<63)ur.push({char:Ne,seqIndex:Bn});else break;else if((Pi=R(Ne))!==null)for(var tr=ur.length-1;tr>=0;tr--){var Jr=ur[tr].char;if(Jr===Pi||Jr===R(A(Ne))||D(A(Jr))===Ne){bn.push([ur[tr].seqIndex,Bn]),ur.length=tr;break}}}bn.sort(function(kt,Yt){return kt[0]-Yt[0]})}for(var Li=0;Li=0;Ri--){var mo=_e[Ri];if(ie[mo]&Yr){var dn=ie[mo]&er?B:b;dn!==zn?Zt=dn:Zt=zn;break}}}if(Zt){if(ie[_e[at]]=ie[_e[Cr]]=Zt,Zt!==zn){for(var Qt=at+1;Qt<_e.length;Qt++)if(!(ie[_e[Qt]]&u)){y(le[_e[Qt]])&Z&&(ie[_e[Qt]]=Zt);break}}if(Zt!==zn){for(var Nn=Cr+1;Nn<_e.length;Nn++)if(!(ie[_e[Nn]]&u)){y(le[_e[Nn]])&Z&&(ie[_e[Nn]]=Zt);break}}}}for(var xn=0;xn<_e.length;xn++)if(ie[_e[xn]]&f){for(var Fi=xn,Ai=xn,$t=Rn,Er=xn-1;Er>=0;Er--)if(ie[_e[Er]]&u)Fi=Er;else{$t=ie[_e[Er]]&er?B:b;break}for(var Tr=Mi,Mr=xn+1;Mr<_e.length;Mr++)if(ie[_e[Mr]]&(f|u))Ai=Mr;else{Tr=ie[_e[Mr]]&er?B:b;break}for(var Xt=Fi;Xt<=Ai;Xt++)ie[_e[Xt]]=$t===Tr?$t:zn;xn=Ai}}}for(var Mt=Me.start;Mt<=Me.end;Mt++){var Kr=me[Mt],An=ie[Mt];if(Kr&1?An&(b|J|O)&&me[Mt]++:An&B?me[Mt]++:An&(O|J)&&(me[Mt]+=2),An&u&&(me[Mt]=Mt===0?Me.level:me[Mt-1]),Mt===Me.end||y(le[Mt])&(ne|q))for(var cr=Mt;cr>=0&&y(le[cr])&h;cr--)me[cr]=Me.level}}return{levels:me,paragraphs:Oe};function qr(kt,Yt){for(var pt=kt;pt=me&&y(le[Me])&h;Me--)Oe[Me]=we.level;for(var ze=we.level,He=1/0,ut=0;utze&&(ze=De),De=He;qe--)for(var be=0;be=qe){for(var Ue=be;be+1=qe;)be++;be>Ue&&ye.push([Ue+me,be+me])}}}),ye}function Se(le,Ce,pe,ie){var Pe=ke(le,Ce,pe,ie),ye=[].concat(le);return Pe.forEach(function(we,me){ye[me]=(Ce.levels[we]&1?xe(le[we]):null)||le[we]}),ye.join("")}function ke(le,Ce,pe,ie){for(var Pe=ce(le,Ce,pe,ie),ye=[],we=0;we/gm;function c(v,i){let r=Td[i];return r?Bl(r):v}return a.replace(n,c)}const Ot=[];for(let a=0;a<256;a++)Ot[a]=(a<16?"0":"")+a.toString(16);function Y1(){const a=Math.random()*4294967295|0,n=Math.random()*4294967295|0,c=Math.random()*4294967295|0,v=Math.random()*4294967295|0;return(Ot[a&255]+Ot[a>>8&255]+Ot[a>>16&255]+Ot[a>>24&255]+"-"+Ot[n&255]+Ot[n>>8&255]+"-"+Ot[n>>16&15|64]+Ot[n>>24&255]+"-"+Ot[c&63|128]+Ot[c>>8&255]+"-"+Ot[c>>16&255]+Ot[c>>24&255]+Ot[v&255]+Ot[v>>8&255]+Ot[v>>16&255]+Ot[v>>24&255]).toUpperCase()}const zr=Object.assign||function(){let a=arguments[0];for(let n=1,c=arguments.length;n/gm,` +;(`+c+")()"],{type:"application/javascript"}))),n.onmessage=function(v){var i=v.data,r=i.messageId,s=bl[r];if(!s)throw new Error("WorkerModule response with empty or unknown messageId");delete bl[r],s(i)}}return n}function tc(l,n,c){return new Promise(function(v,i){var r=++V1;bl[r]=function(s){s.success?v(s.result):i(new Error("Error in worker "+n+" call: "+s.error))},Q1(l).postMessage({messageId:r,action:n,data:c})})}function lf(){var l=function(n){function c(j,W,k,I,Q,Y,H,re){var X=1-H;re.x=X*X*j+2*X*H*k+H*H*Q,re.y=X*X*W+2*X*H*I+H*H*Y}function v(j,W,k,I,Q,Y,H,re,X,te){var ue=1-X;te.x=ue*ue*ue*j+3*ue*ue*X*k+3*ue*X*X*Q+X*X*X*H,te.y=ue*ue*ue*W+3*ue*ue*X*I+3*ue*X*X*Y+X*X*X*re}function i(j,W){for(var k=/([MLQCZ])([^MLQCZ]*)/g,I,Q,Y,H,re;I=k.exec(j);){var X=I[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(te){return parseFloat(te)});switch(I[1]){case"M":H=Q=X[0],re=Y=X[1];break;case"L":(X[0]!==H||X[1]!==re)&&W("L",H,re,H=X[0],re=X[1]);break;case"Q":{W("Q",H,re,H=X[2],re=X[3],X[0],X[1]);break}case"C":{W("C",H,re,H=X[4],re=X[5],X[0],X[1],X[2],X[3]);break}case"Z":(H!==Q||re!==Y)&&W("L",H,re,Q,Y);break}}}function r(j,W,k){k===void 0&&(k=16);var I={x:0,y:0};i(j,function(Q,Y,H,re,X,te,ue,fe,K){switch(Q){case"L":W(Y,H,re,X);break;case"Q":{for(var $=Y,xe=H,Re=1;Re0;)Oe[Me]=arguments[Me+2];var ze=pe[We]||(pe[We]=k.getUniformLocation(ie,We));k["uniform"+me].apply(k,[ze].concat(Oe))},setAttribute:function(me,We,Oe,Me,ze){var He=Ce[me];He||(He=Ce[me]={buf:k.createBuffer(),loc:k.getAttribLocation(ie,me),data:null}),k.bindBuffer(k.ARRAY_BUFFER,He.buf),k.vertexAttribPointer(He.loc,We,k.FLOAT,!1,0,0),k.enableVertexAttribArray(He.loc),Q?k.vertexAttribDivisor(He.loc,Me):ue("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(He.loc,Me),ze!==He.data&&(k.bufferData(k.ARRAY_BUFFER,ze,Oe),He.data=ze)}})}}}H[ce].transaction(le)},$=function(ce,Se){X++;try{k.activeTexture(k.TEXTURE0+X);var ke=re[ce];ke||(ke=re[ce]=k.createTexture(),k.bindTexture(k.TEXTURE_2D,ke),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,k.NEAREST),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,k.NEAREST)),k.bindTexture(k.TEXTURE_2D,ke),Se(ke,X)}finally{X--}},xe=function(ce,Se,ke){var le=k.createFramebuffer();te.push(le),k.bindFramebuffer(k.FRAMEBUFFER,le),k.activeTexture(k.TEXTURE0+Se),k.bindTexture(k.TEXTURE_2D,ce),k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_2D,ce,0);try{ke(le)}finally{k.deleteFramebuffer(le),k.bindFramebuffer(k.FRAMEBUFFER,te[--te.length-1]||null)}},Re=function(){Y={},H={},re={},X=-1,te.length=0};var Q=typeof WebGL2RenderingContext<"u"&&k instanceof WebGL2RenderingContext,Y={},H={},re={},X=-1,te=[];k.canvas.addEventListener("webglcontextlost",function(ce){Re(),ce.preventDefault()},!1),u.set(k,I={gl:k,isWebGL2:Q,getExtension:ue,withProgram:K,withTexture:$,withTextureFramebuffer:xe,handleContextLoss:Re})}W(I)}function m(j,W,k,I,Q,Y,H,re){H===void 0&&(H=15),re===void 0&&(re=null),d(j,function(X){var te=X.gl,ue=X.withProgram,fe=X.withTexture;fe("copy",function(K,$){te.texImage2D(te.TEXTURE_2D,0,te.RGBA,Q,Y,0,te.RGBA,te.UNSIGNED_BYTE,W),ue("copy",s,f,function(xe){var Re=xe.setUniform,ce=xe.setAttribute;ce("aUV",2,te.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),Re("1i","image",$),te.bindFramebuffer(te.FRAMEBUFFER,re||null),te.disable(te.BLEND),te.colorMask(H&8,H&4,H&2,H&1),te.viewport(k,I,Q,Y),te.scissor(k,I,Q,Y),te.drawArrays(te.TRIANGLES,0,3)})})})}function y(j,W,k){var I=j.width,Q=j.height;d(j,function(Y){var H=Y.gl,re=new Uint8Array(I*Q*4);H.readPixels(0,0,I,Q,H.RGBA,H.UNSIGNED_BYTE,re),j.width=W,j.height=k,m(H,re,0,0,I,Q)})}var x=Object.freeze({__proto__:null,withWebGLContext:d,renderImageData:m,resizeWebGLCanvasWithoutClearing:y});function C(j,W,k,I,Q,Y){Y===void 0&&(Y=1);var H=new Uint8Array(j*W),re=I[2]-I[0],X=I[3]-I[1],te=[];r(k,function(ce,Se,ke,le){te.push({x1:ce,y1:Se,x2:ke,y2:le,minX:Math.min(ce,ke),minY:Math.min(Se,le),maxX:Math.max(ce,ke),maxY:Math.max(Se,le)})}),te.sort(function(ce,Se){return ce.maxX-Se.maxX});for(var ue=0;uepe.minX&&Se-lepe.minY){var ie=_(ce,Se,pe.x1,pe.y1,pe.x2,pe.y2);ieSe!=Ce.y2>Se&&ce<(Ce.x2-Ce.x1)*(Se-Ce.y1)/(Ce.y2-Ce.y1)+Ce.x1;pe&&(ke+=Ce.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function T(le,Ce){var pe=36,ie=0,Pe=new Map,ye=Ce&&new Map,we;return le.split(",").forEach(function me(We){if(We.indexOf("+")!==-1)for(var Oe=+We;Oe--;)me(we);else{we=We;var Me=We.split(">"),ze=Me[0],He=Me[1];ze=String.fromCodePoint(ie+=parseInt(ze,pe)),He=String.fromCodePoint(ie+=parseInt(He,pe)),Pe.set(ze,He),Ce&&ye.set(He,ze)}}),{map:Pe,reverseMap:ye}}var S,_,w;function M(){if(!S){var le=T(C.pairs,!0),Ce=le.map,pe=le.reverseMap;S=Ce,_=pe,w=T(C.canonical,!1).map}}function D(le){return M(),S.get(le)||null}function R(le){return M(),_.get(le)||null}function A(le){return M(),w.get(le)||null}var b=v.L,B=v.R,J=v.EN,oe=v.ES,G=v.ET,O=v.AN,ee=v.CS,q=v.B,ne=v.S,ae=v.ON,ve=v.BN,Z=v.NSM,j=v.AL,W=v.LRO,k=v.RLO,I=v.LRE,Q=v.RLE,Y=v.PDF,H=v.LRI,re=v.RLI,X=v.FSI,te=v.PDI;function ue(le,Ce){for(var pe=125,ie=new Uint32Array(le.length),Pe=0;Pe0)Qe--;else if(ct>0){for(Je=0;!be[be.length-1]._isolate;)be.pop();var Un=be[be.length-1]._isolInitIndex;Un!=null&&(We.set(Un,Ie),We.set(Ie,Un)),be.pop(),ct--}Ue=be[be.length-1],me[Ie]=Ue._level,Ue._override&&we(Ie,Ue._override)}else et&Y?(Qe===0&&(Je>0?Je--:!Ue._isolate&&be.length>1&&(be.pop(),Ue=be[be.length-1])),me[Ie]=Ue._level):et&q&&(me[Ie]=Me.level);else me[Ie]=Ue._level,Ue._override&&et!==ve&&we(Ie,Ue._override)}for(var Wt=[],Ht=null,tt=Me.start;tt<=Me.end;tt++){var lr=ie[tt];if(!(lr&u)){var rt=me[tt],it=lr&r,on=lr===te;Ht&&rt===Ht._level?(Ht._end=tt,Ht._endsWithIsolInit=it):Wt.push(Ht={_start:tt,_end:tt,_level:rt,_startsWithPDI:on,_endsWithIsolInit:it})}}for(var Vt=[],Xe=0;Xe=0;xr--)if(!(ie[xr]&u)){uo=me[xr];break}var Ci=Rt[Rt.length-1],ga=me[Ci],co=Me.level;if(!(ie[Ci]&r)){for(var Wr=Ci+1;Wr<=Me.end;Wr++)if(!(ie[Wr]&u)){co=me[Wr];break}}Vt.push({_seqIndices:Rt,_sosType:Math.max(uo,ma)%2?B:b,_eosType:Math.max(co,ga)%2?B:b})}}for(var _i=0;_i=0;ln--)if(!(ie[_e[ln]]&u)){In=ie[_e[ln]];break}we(Vr,In&(r|te)?ae:In)}}if(ye.get(J))for(var Ye=0;Ye<_e.length;Ye++){var Ke=_e[Ye];if(ie[Ke]&J)for(var sn=Ye-1;sn>=-1;sn--){var St=sn===-1?Rn:ie[_e[sn]];if(St&s){St===j&&we(Ke,O);break}}}if(ye.get(j))for(var Et=0;Et<_e.length;Et++){var jn=_e[Et];ie[jn]&j&&we(jn,B)}if(ye.get(oe)||ye.get(ee))for(var yn=1;yn<_e.length-1;yn++){var Tt=_e[yn];if(ie[Tt]&(oe|ee)){for(var Fn=0,Zr=0,Qr=yn-1;Qr>=0&&(Fn=ie[_e[Qr]],!!(Fn&u));Qr--);for(var sr=yn+1;sr<_e.length&&(Zr=ie[_e[sr]],!!(Zr&u));sr++);Fn===Zr&&(ie[Tt]===oe?Fn===J:Fn&(J|O))&&we(Tt,Fn)}}if(ye.get(J))for(var un=0;un<_e.length;un++){var cn=_e[un];if(ie[cn]&J){for(var Xr=un-1;Xr>=0&&ie[_e[Xr]]&(G|u);Xr--)we(_e[Xr],J);for(un++;un<_e.length&&ie[_e[un]]&(G|u|J);un++)ie[_e[un]]!==J&&we(_e[un],J)}}if(ye.get(G)||ye.get(oe)||ye.get(ee))for(var wr=0;wr<_e.length;wr++){var fo=_e[wr];if(ie[fo]&(G|oe|ee)){we(fo,ae);for(var Kn=wr-1;Kn>=0&&ie[_e[Kn]]&u;Kn--)we(_e[Kn],ae);for(var qn=wr+1;qn<_e.length&&ie[_e[qn]]&u;qn++)we(_e[qn],ae)}}if(ye.get(J))for(var $n=0,Sr=Rn;$n<_e.length;$n++){var ho=_e[$n],Mi=ie[ho];Mi&J?Sr===b&&we(ho,b):Mi&s&&(Sr=Mi)}if(ye.get(f)){var er=B|J|O,Yr=er|b,bn=[];{for(var ur=[],Bn=0;Bn<_e.length;Bn++)if(ie[_e[Bn]]&f){var Ne=le[_e[Bn]],ki=void 0;if(D(Ne)!==null)if(ur.length<63)ur.push({char:Ne,seqIndex:Bn});else break;else if((ki=R(Ne))!==null)for(var tr=ur.length-1;tr>=0;tr--){var Jr=ur[tr].char;if(Jr===ki||Jr===R(A(Ne))||D(A(Jr))===Ne){bn.push([ur[tr].seqIndex,Bn]),ur.length=tr;break}}}bn.sort(function(kt,Yt){return kt[0]-Yt[0]})}for(var Pi=0;Pi=0;Ui--){var mo=_e[Ui];if(ie[mo]&Yr){var dn=ie[mo]&er?B:b;dn!==zn?Zt=dn:Zt=zn;break}}}if(Zt){if(ie[_e[at]]=ie[_e[Cr]]=Zt,Zt!==zn){for(var Qt=at+1;Qt<_e.length;Qt++)if(!(ie[_e[Qt]]&u)){y(le[_e[Qt]])&Z&&(ie[_e[Qt]]=Zt);break}}if(Zt!==zn){for(var Nn=Cr+1;Nn<_e.length;Nn++)if(!(ie[_e[Nn]]&u)){y(le[_e[Nn]])&Z&&(ie[_e[Nn]]=Zt);break}}}}for(var xn=0;xn<_e.length;xn++)if(ie[_e[xn]]&f){for(var Ri=xn,Fi=xn,$t=Rn,Er=xn-1;Er>=0;Er--)if(ie[_e[Er]]&u)Ri=Er;else{$t=ie[_e[Er]]&er?B:b;break}for(var Tr=Ti,Mr=xn+1;Mr<_e.length;Mr++)if(ie[_e[Mr]]&(f|u))Fi=Mr;else{Tr=ie[_e[Mr]]&er?B:b;break}for(var Xt=Ri;Xt<=Fi;Xt++)ie[_e[Xt]]=$t===Tr?$t:zn;xn=Fi}}}for(var Mt=Me.start;Mt<=Me.end;Mt++){var Kr=me[Mt],An=ie[Mt];if(Kr&1?An&(b|J|O)&&me[Mt]++:An&B?me[Mt]++:An&(O|J)&&(me[Mt]+=2),An&u&&(me[Mt]=Mt===0?Me.level:me[Mt-1]),Mt===Me.end||y(le[Mt])&(ne|q))for(var cr=Mt;cr>=0&&y(le[cr])&h;cr--)me[cr]=Me.level}}return{levels:me,paragraphs:Oe};function qr(kt,Yt){for(var pt=kt;pt=me&&y(le[Me])&h;Me--)Oe[Me]=we.level;for(var ze=we.level,He=1/0,ut=0;utze&&(ze=De),De=He;qe--)for(var be=0;be=qe){for(var Ue=be;be+1=qe;)be++;be>Ue&&ye.push([Ue+me,be+me])}}}),ye}function Se(le,Ce,pe,ie){var Pe=ke(le,Ce,pe,ie),ye=[].concat(le);return Pe.forEach(function(we,me){ye[me]=(Ce.levels[we]&1?xe(le[we]):null)||le[we]}),ye.join("")}function ke(le,Ce,pe,ie){for(var Pe=ce(le,Ce,pe,ie),ye=[],we=0;we/gm;function c(v,i){let r=Td[i];return r?Bl(r):v}return l.replace(n,c)}const Ot=[];for(let l=0;l<256;l++)Ot[l]=(l<16?"0":"")+l.toString(16);function Y1(){const l=Math.random()*4294967295|0,n=Math.random()*4294967295|0,c=Math.random()*4294967295|0,v=Math.random()*4294967295|0;return(Ot[l&255]+Ot[l>>8&255]+Ot[l>>16&255]+Ot[l>>24&255]+"-"+Ot[n&255]+Ot[n>>8&255]+"-"+Ot[n>>16&15|64]+Ot[n>>24&255]+"-"+Ot[c&63|128]+Ot[c>>8&255]+"-"+Ot[c>>16&255]+Ot[c>>24&255]+Ot[v&255]+Ot[v>>8&255]+Ot[v>>16&255]+Ot[v>>24&255]).toUpperCase()}const zr=Object.assign||function(){let l=arguments[0];for(let n=1,c=arguments.length;n/gm,` //!BEGIN_POST_CHUNK $1 $& //!END_POST_CHUNK @@ -487,27 +487,27 @@ troika_normal_${i} = vec3(normal); troika_uv_${i} = vec2(uv); troikaVertexTransform${i}(troika_position_${i}, troika_normal_${i}, troika_uv_${i}); ${s} -`,n=n.replace(/\b(position|normal|uv)\b/g,(T,S,_,w)=>/\battribute\s+vec[23]\s+$/.test(w.substr(0,_))?S:`troika_${S}_${i}`),a.map&&a.map.channel>0||(n=n.replace(/\bMAP_UV\b/g,`troika_uv_${i}`))),n=ic(n,i,r,s,f),c=ic(c,i,h,d,m),{vertexShader:n,fragmentShader:c}}function ic(a,n,c,v,i){return(v||i||c)&&(a=a.replace(sf,` +`,n=n.replace(/\b(position|normal|uv)\b/g,(T,S,_,w)=>/\battribute\s+vec[23]\s+$/.test(w.substr(0,_))?S:`troika_${S}_${i}`),l.map&&l.map.channel>0||(n=n.replace(/\bMAP_UV\b/g,`troika_uv_${i}`))),n=ic(n,i,r,s,f),c=ic(c,i,h,d,m),{vertexShader:n,fragmentShader:c}}function ic(l,n,c,v,i){return(v||i||c)&&(l=l.replace(sf,` ${c} -void troikaOrigMain${n}() {`),a+=` +void troikaOrigMain${n}() {`),l+=` void main() { ${v} troikaOrigMain${n}(); ${i} -}`),a}function $1(a,n){return a==="uniforms"?void 0:typeof n=="function"?n.toString():n}let e0=0;const oc=new Map;function t0(a){const n=JSON.stringify(a,$1);let c=oc.get(n);return c==null&&oc.set(n,c=++e0),c}function n0(a,n,c){const{defaultFontURL:v}=c,i=Object.create(null),r=1/0,s=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,f="[^\\S\\u00A0]",u=new RegExp(`${f}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function h(w,M){function D(){const R=A=>{console.error(`Failure loading font ${w}${w===v?"":"; trying fallback"}`,A),w!==v&&(w=v,D())};try{const A=new XMLHttpRequest;A.open("get",w,!0),A.responseType="arraybuffer",A.onload=function(){if(A.status>=400)R(new Error(A.statusText));else if(A.status>0)try{const b=a(A.response);M(b)}catch(b){R(b)}},A.onerror=R,A.send()}catch(A){R(A)}}D()}function d(w,M){w||(w=v);let D=i[w];D?D.pending?D.pending.push(M):M(D):(i[w]={pending:[M]},h(w,R=>{let A=i[w].pending;i[w]=R,A.forEach(b=>b(R))}))}function m({text:w="",font:M=v,sdfGlyphSize:D=64,fontSize:R=1,letterSpacing:A=0,lineHeight:b="normal",maxWidth:B=r,direction:J,textAlign:oe="left",textIndent:G=0,whiteSpace:O="normal",overflowWrap:ee="normal",anchorX:q=0,anchorY:ne=0,includeCaretPositions:ae=!1,chunkedBoundsSize:ve=8192,colorRanges:Z=null},j,W=!1){const k=T(),I={fontLoad:0,typesetting:0};w.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),w=w.replace(/\r\n/g,` +}`),l}function $1(l,n){return l==="uniforms"?void 0:typeof n=="function"?n.toString():n}let e0=0;const oc=new Map;function t0(l){const n=JSON.stringify(l,$1);let c=oc.get(n);return c==null&&oc.set(n,c=++e0),c}function n0(l,n,c){const{defaultFontURL:v}=c,i=Object.create(null),r=1/0,s=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,f="[^\\S\\u00A0]",u=new RegExp(`${f}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function h(w,M){function D(){const R=A=>{console.error(`Failure loading font ${w}${w===v?"":"; trying fallback"}`,A),w!==v&&(w=v,D())};try{const A=new XMLHttpRequest;A.open("get",w,!0),A.responseType="arraybuffer",A.onload=function(){if(A.status>=400)R(new Error(A.statusText));else if(A.status>0)try{const b=l(A.response);M(b)}catch(b){R(b)}},A.onerror=R,A.send()}catch(A){R(A)}}D()}function d(w,M){w||(w=v);let D=i[w];D?D.pending?D.pending.push(M):M(D):(i[w]={pending:[M]},h(w,R=>{let A=i[w].pending;i[w]=R,A.forEach(b=>b(R))}))}function m({text:w="",font:M=v,sdfGlyphSize:D=64,fontSize:R=1,letterSpacing:A=0,lineHeight:b="normal",maxWidth:B=r,direction:J,textAlign:oe="left",textIndent:G=0,whiteSpace:O="normal",overflowWrap:ee="normal",anchorX:q=0,anchorY:ne=0,includeCaretPositions:ae=!1,chunkedBoundsSize:ve=8192,colorRanges:Z=null},j,W=!1){const k=T(),I={fontLoad:0,typesetting:0};w.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),w=w.replace(/\r\n/g,` `).replace(/\r/g,` `)),R=+R,A=+A,B=+B,b=b||"normal",G=+G,d(M,Q=>{const Y=isFinite(B);let H=null,re=null,X=null,te=null,ue=null,fe=null,K=null,$=0,xe=0,Re=O!=="nowrap";const{ascender:ce,descender:Se,unitsPerEm:ke,lineGap:le,capHeight:Ce,xHeight:pe}=Q;I.fontLoad=T()-k;const ie=T(),Pe=R/ke;b==="normal"&&(b=(ce-Se+le)/ke),b=b*R;const ye=(b-(ce-Se)*Pe)/2,we=-(ce*Pe+ye),me=Math.min(b,(ce-Se)*Pe),We=(ce+Se)/2*Pe-me/2;let Oe=G,Me=new S;const ze=[Me];Q.forEachGlyph(w,R,A,(De,qe,be)=>{const Ue=w.charAt(be),Qe=De.advanceWidth*Pe,Je=Me.count;let ct;if("isEmpty"in De||(De.isWhitespace=!!Ue&&new RegExp(f).test(Ue),De.canBreakAfter=!!Ue&&u.test(Ue),De.isEmpty=De.xMin===De.xMax||De.yMin===De.yMax||s.test(Ue)),!De.isWhitespace&&!De.isEmpty&&xe++,Re&&Y&&!De.isWhitespace&&qe+Qe+Oe>B&&Je){if(Me.glyphAt(Je-1).glyphObj.canBreakAfter)ct=new S,Oe=-qe;else for(let et=Je;et--;)if(et===0&&ee==="break-word"){ct=new S,Oe=-qe;break}else if(Me.glyphAt(et).glyphObj.canBreakAfter){ct=Me.splitAt(et+1);const Ut=ct.glyphAt(0).x;Oe-=Ut;for(let Ln=ct.count;Ln--;)ct.glyphAt(Ln).x-=Ut;break}ct&&(Me.isSoftWrapped=!0,Me=ct,ze.push(Me),$=B)}let Ie=Me.glyphAt(Me.count);Ie.glyphObj=De,Ie.x=qe+Oe,Ie.width=Qe,Ie.charIndex=be,Ue===` -`&&(Me=new S,ze.push(Me),Oe=-(qe+Qe+A*R)+G)}),ze.forEach(De=>{for(let qe=De.count;qe--;){let{glyphObj:be,x:Ue,width:Qe}=De.glyphAt(qe);if(!be.isWhitespace){De.width=Ue+Qe,De.width>$&&($=De.width);return}}});let He=0,ut=0;if(q&&(typeof q=="number"?He=-q:typeof q=="string"&&(He=-$*(q==="left"?0:q==="center"?.5:q==="right"?1:x(q)))),ne){if(typeof ne=="number")ut=-ne;else if(typeof ne=="string"){let De=ze.length*b;ut=ne==="top"?0:ne==="top-baseline"?-we:ne==="top-cap"?-we-Ce*Pe:ne==="top-ex"?-we-pe*Pe:ne==="middle"?De/2:ne==="bottom"?De:ne==="bottom-baseline"?De-ye+Se*Pe:x(ne)*De}}if(!W){const De=n.getEmbeddingLevels(w,J);H=new Uint16Array(xe),re=new Float32Array(xe*2),X={},fe=[r,r,-r,-r],K=[];let qe=we;ae&&(ue=new Float32Array(w.length*3)),Z&&(te=new Uint8Array(xe*3));let be=0,Ue=-1,Qe=-1,Je,ct;if(ze.forEach((Ie,et)=>{let{count:Ut,width:Ln}=Ie;if(Ut>0){let Yn=0;for(let rt=Ut;rt--&&Ie.glyphAt(rt).glyphObj.isWhitespace;)Yn++;let Un=0,Wt=0;if(oe==="center")Un=($-Ln)/2;else if(oe==="right")Un=$-Ln;else if(oe==="justify"&&Ie.isSoftWrapped){let rt=0;for(let it=Ut-Yn;it--;)Ie.glyphAt(it).glyphObj.isWhitespace&&rt++;Wt=($-Ln)/rt}if(Wt||Un){let rt=0;for(let it=0;it=it){let qt=ht,ft=ht;for(;fton)break;fttt=rt;for(let rt=0;rt1&&C(ue,Ue,ft),Ue=Xe}if(Z){const{charIndex:Xe}=it;for(;Xe>Qe;)Qe++,Z.hasOwnProperty(Qe)&&(ct=Z[Qe])}if(!tt.isWhitespace&&!tt.isEmpty){const Xe=be++;X[on]||(X[on]={path:tt.path,pathBounds:[tt.xMin,tt.yMin,tt.xMax,tt.yMax]});const ht=it.x+He,qt=qe+ut;re[Xe*2]=ht,re[Xe*2+1]=qt;const ft=ht+tt.xMin*Pe,yt=qt+tt.yMin*Pe,Rt=ht+tt.xMax*Pe,On=qt+tt.yMax*Pe;ftfe[2]&&(fe[2]=Rt),On>fe[3]&&(fe[3]=On),Xe%ve===0&&(Je={start:Xe,end:Xe,rect:[r,r,-r,-r]},K.push(Je)),Je.end++;const an=Je.rect;if(ftan[2]&&(an[2]=Rt),On>an[3]&&(an[3]=On),H[Xe]=on,Z){const Jn=Xe*3;te[Jn]=ct>>16&255,te[Jn+1]=ct>>8&255,te[Jn+2]=ct&255}}}}qe-=b}),ue){const Ie=w.length-Ue;Ie>1&&C(ue,Ue,Ie)}}I.typesetting=T()-ie,j({glyphIds:H,glyphPositions:re,glyphData:X,caretPositions:ue,caretHeight:me,glyphColors:te,chunkedBounds:K,fontSize:R,unitsPerEm:ke,ascender:ce*Pe,descender:Se*Pe,capHeight:Ce*Pe,xHeight:pe*Pe,lineHeight:b,topBaseline:we,blockBounds:[He,ut-ze.length*b,He+$,ut],visibleBounds:fe,timings:I})})}function y(w,M){m(w,D=>{const[R,A,b,B]=D.blockBounds;M({width:b-R,height:B-A})},{metricsOnly:!0})}function x(w){let M=w.match(/^([\d.]+)%$/),D=M?parseFloat(M[1]):NaN;return isNaN(D)?0:D/100}function C(w,M,D){const R=w[M*3],A=w[M*3+1],b=w[M*3+2],B=(A-R)/D;for(let J=0;J(Object.defineProperty(w,M,{get(){return this.data[this.index*_.length+D]},set(A){this.data[this.index*_.length+D]=A}}),w),{data:null,index:0}),{typeset:m,measure:y,loadFont:d}}const Br=()=>(self.performance||Date).now(),va=lf();let ac;function r0(a,n,c,v,i,r,s,f,u,h,d=!0){return d?o0(a,n,c,v,i,r,s,f,u,h).then(null,m=>(ac||(console.warn("WebGL SDF generation failed, falling back to JS",m),ac=!0),sc(a,n,c,v,i,r,s,f,u,h))):sc(a,n,c,v,i,r,s,f,u,h)}const fa=[],i0=5;let Gl=0;function uf(){const a=Br();for(;fa.length&&Br()-anew Promise((n,c)=>{fa.push(()=>{const v=Br();try{va.webgl.generateIntoCanvas(...a),n({timing:Br()-v})}catch(i){c(i)}}),Gl||(Gl=setTimeout(uf,0))}),a0=4,l0=2e3,lc={};let s0=0;function sc(a,n,c,v,i,r,s,f,u,h){const d="TroikaTextSDFGenerator_JS_"+s0++%a0;let m=lc[d];return m||(m=lc[d]={workerModule:so({name:d,workerId:d,dependencies:[lf,Br],init(y,x){const C=y().javascript.generate;return function(...T){const S=x();return{textureData:C(...T),timing:x()-S}}},getTransferables(y){return[y.textureData.buffer]}}),requests:0,idleTimer:null}),m.requests++,clearTimeout(m.idleTimer),m.workerModule(a,n,c,v,i,r).then(({textureData:y,timing:x})=>{const C=Br(),T=new Uint8Array(y.length*4);for(let S=0;S{Z1(d)},l0)),{timing:x}})}function u0(a){a._warm||(va.webgl.isSupported(a),a._warm=!0)}const c0=va.webglUtils.resizeWebGLCanvasWithoutClearing;/*! +`&&(Me=new S,ze.push(Me),Oe=-(qe+Qe+A*R)+G)}),ze.forEach(De=>{for(let qe=De.count;qe--;){let{glyphObj:be,x:Ue,width:Qe}=De.glyphAt(qe);if(!be.isWhitespace){De.width=Ue+Qe,De.width>$&&($=De.width);return}}});let He=0,ut=0;if(q&&(typeof q=="number"?He=-q:typeof q=="string"&&(He=-$*(q==="left"?0:q==="center"?.5:q==="right"?1:x(q)))),ne){if(typeof ne=="number")ut=-ne;else if(typeof ne=="string"){let De=ze.length*b;ut=ne==="top"?0:ne==="top-baseline"?-we:ne==="top-cap"?-we-Ce*Pe:ne==="top-ex"?-we-pe*Pe:ne==="middle"?De/2:ne==="bottom"?De:ne==="bottom-baseline"?De-ye+Se*Pe:x(ne)*De}}if(!W){const De=n.getEmbeddingLevels(w,J);H=new Uint16Array(xe),re=new Float32Array(xe*2),X={},fe=[r,r,-r,-r],K=[];let qe=we;ae&&(ue=new Float32Array(w.length*3)),Z&&(te=new Uint8Array(xe*3));let be=0,Ue=-1,Qe=-1,Je,ct;if(ze.forEach((Ie,et)=>{let{count:Ut,width:Ln}=Ie;if(Ut>0){let Yn=0;for(let rt=Ut;rt--&&Ie.glyphAt(rt).glyphObj.isWhitespace;)Yn++;let Un=0,Wt=0;if(oe==="center")Un=($-Ln)/2;else if(oe==="right")Un=$-Ln;else if(oe==="justify"&&Ie.isSoftWrapped){let rt=0;for(let it=Ut-Yn;it--;)Ie.glyphAt(it).glyphObj.isWhitespace&&rt++;Wt=($-Ln)/rt}if(Wt||Un){let rt=0;for(let it=0;it=it){let qt=ht,ft=ht;for(;fton)break;fttt=rt;for(let rt=0;rt1&&C(ue,Ue,ft),Ue=Xe}if(Z){const{charIndex:Xe}=it;for(;Xe>Qe;)Qe++,Z.hasOwnProperty(Qe)&&(ct=Z[Qe])}if(!tt.isWhitespace&&!tt.isEmpty){const Xe=be++;X[on]||(X[on]={path:tt.path,pathBounds:[tt.xMin,tt.yMin,tt.xMax,tt.yMax]});const ht=it.x+He,qt=qe+ut;re[Xe*2]=ht,re[Xe*2+1]=qt;const ft=ht+tt.xMin*Pe,yt=qt+tt.yMin*Pe,Rt=ht+tt.xMax*Pe,On=qt+tt.yMax*Pe;ftfe[2]&&(fe[2]=Rt),On>fe[3]&&(fe[3]=On),Xe%ve===0&&(Je={start:Xe,end:Xe,rect:[r,r,-r,-r]},K.push(Je)),Je.end++;const an=Je.rect;if(ftan[2]&&(an[2]=Rt),On>an[3]&&(an[3]=On),H[Xe]=on,Z){const Jn=Xe*3;te[Jn]=ct>>16&255,te[Jn+1]=ct>>8&255,te[Jn+2]=ct&255}}}}qe-=b}),ue){const Ie=w.length-Ue;Ie>1&&C(ue,Ue,Ie)}}I.typesetting=T()-ie,j({glyphIds:H,glyphPositions:re,glyphData:X,caretPositions:ue,caretHeight:me,glyphColors:te,chunkedBounds:K,fontSize:R,unitsPerEm:ke,ascender:ce*Pe,descender:Se*Pe,capHeight:Ce*Pe,xHeight:pe*Pe,lineHeight:b,topBaseline:we,blockBounds:[He,ut-ze.length*b,He+$,ut],visibleBounds:fe,timings:I})})}function y(w,M){m(w,D=>{const[R,A,b,B]=D.blockBounds;M({width:b-R,height:B-A})},{metricsOnly:!0})}function x(w){let M=w.match(/^([\d.]+)%$/),D=M?parseFloat(M[1]):NaN;return isNaN(D)?0:D/100}function C(w,M,D){const R=w[M*3],A=w[M*3+1],b=w[M*3+2],B=(A-R)/D;for(let J=0;J(Object.defineProperty(w,M,{get(){return this.data[this.index*_.length+D]},set(A){this.data[this.index*_.length+D]=A}}),w),{data:null,index:0}),{typeset:m,measure:y,loadFont:d}}const Br=()=>(self.performance||Date).now(),va=lf();let ac;function r0(l,n,c,v,i,r,s,f,u,h,d=!0){return d?o0(l,n,c,v,i,r,s,f,u,h).then(null,m=>(ac||(console.warn("WebGL SDF generation failed, falling back to JS",m),ac=!0),sc(l,n,c,v,i,r,s,f,u,h))):sc(l,n,c,v,i,r,s,f,u,h)}const fa=[],i0=5;let Gl=0;function uf(){const l=Br();for(;fa.length&&Br()-lnew Promise((n,c)=>{fa.push(()=>{const v=Br();try{va.webgl.generateIntoCanvas(...l),n({timing:Br()-v})}catch(i){c(i)}}),Gl||(Gl=setTimeout(uf,0))}),a0=4,l0=2e3,lc={};let s0=0;function sc(l,n,c,v,i,r,s,f,u,h){const d="TroikaTextSDFGenerator_JS_"+s0++%a0;let m=lc[d];return m||(m=lc[d]={workerModule:so({name:d,workerId:d,dependencies:[lf,Br],init(y,x){const C=y().javascript.generate;return function(...T){const S=x();return{textureData:C(...T),timing:x()-S}}},getTransferables(y){return[y.textureData.buffer]}}),requests:0,idleTimer:null}),m.requests++,clearTimeout(m.idleTimer),m.workerModule(l,n,c,v,i,r).then(({textureData:y,timing:x})=>{const C=Br(),T=new Uint8Array(y.length*4);for(let S=0;S{Z1(d)},l0)),{timing:x}})}function u0(l){l._warm||(va.webgl.isSupported(l),l._warm=!0)}const c0=va.webglUtils.resizeWebGLCanvasWithoutClearing;/*! Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering. Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE -*/function f0(){return typeof window>"u"&&(self.window=self),function(a){var n={parse:function(i){var r=n._bin,s=new Uint8Array(i);if(r.readASCII(s,0,4)=="ttcf"){var f=4;r.readUshort(s,f),f+=2,r.readUshort(s,f),f+=2;var u=r.readUint(s,f);f+=4;for(var h=[],d=0;d>>s&1&&r++;return r},n._lctf.readClassDef=function(i,r){var s=n._bin,f=[],u=s.readUshort(i,r);if(r+=2,u==1){var h=s.readUshort(i,r);r+=2;var d=s.readUshort(i,r);r+=2;for(var m=0;m0&&(u.featureParams=f+h);var d=s.readUshort(i,r);r+=2,u.tab=[];for(var m=0;m255?-1:n.CFF.glyphByUnicode(i,n.CFF.tableSE[r])},n.CFF.readEncoding=function(i,r,s){n._bin;var f=[".notdef"],u=i[r];if(r++,u!=0)throw"error: unknown encoding format: "+u;var h=i[r];r++;for(var d=0;d>4,w=15&S;if(_!=15&&T.push(_),w!=15&&T.push(w),w==15)break}for(var M="",D=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],R=0;R=h.xMax||h.yMin>=h.yMax)return null;if(h.noc>0){h.endPts=[];for(var d=0;d=1&&d.fmt<=2){y=u.readUshort(i,s),s+=2;var C=u.readUshort(i,s);s+=2,x=n._lctf.numOfOnes(y);var T=n._lctf.numOfOnes(C);if(d.fmt==1){d.pairsets=[];var S=u.readUshort(i,s);s+=2;for(var _=0;_=1&&d.fmt<=2){if(d.fmt==1)d.delta=u.readShort(i,s),s+=2;else if(d.fmt==2){var y=u.readUshort(i,s);s+=2,d.newg=u.readUshorts(i,s,y),s+=2*d.newg.length}}else if(r==4){d.vals=[],y=u.readUshort(i,s),s+=2;for(var x=0;x>>8;if((C&=15)!=0)throw"unknown kern table format: "+C;r=n.kern.readFormat0(i,r,m)}return m},n.kern.parseV1=function(i,r,s,f){var u=n._bin;u.readFixed(i,r),r+=4;var h=u.readUint(i,r);r+=4;for(var d={glyph1:[],rval:[]},m=0;m>>8;if((x&=15)!=0)throw"unknown kern table format: "+x;r=n.kern.readFormat0(i,r,d)}return d},n.kern.readFormat0=function(i,r,s){var f=n._bin,u=-1,h=f.readUshort(i,r);r+=2,f.readUshort(i,r),r+=2,f.readUshort(i,r),r+=2,f.readUshort(i,r),r+=2;for(var d=0;d=u.map.length?0:u.map[r];if(u.format==4){for(var h=-1,d=0;dr?0:65535&(u.idRangeOffset[h]!=0?u.glyphIdArray[r-u.startCount[h]+(u.idRangeOffset[h]>>1)-(u.idRangeOffset.length-h)]:r+u.idDelta[h])}if(u.format==12){if(r>u.groups[u.groups.length-1][1])return 0;for(d=0;d-1?n.U._simpleGlyph(f,s):n.U._compoGlyph(f,r,s))},n.U._simpleGlyph=function(i,r){for(var s=0;su)){for(var S=!0,_=0,w=0;wu)){for(S=!0,w=0;w>1,h.length=0,m=!0;else if(O=="o3"||O=="o23")h.length%2!=0&&!m&&(y=h.shift()+f.nominalWidthX),d+=h.length>>1,h.length=0,m=!0;else if(O=="o4")h.length>1&&!m&&(y=h.shift()+f.nominalWidthX,m=!0),x&&n.U.P.closePath(u),S+=h.pop(),n.U.P.moveTo(u,T,S),x=!0;else if(O=="o5")for(;h.length>0;)T+=h.shift(),S+=h.shift(),n.U.P.lineTo(u,T,S);else if(O=="o6"||O=="o7")for(var ee=h.length,q=O=="o6",ne=0;neMath.abs(B-S)?T=b+h.shift():S=B+h.shift(),n.U.P.curveTo(u,_,w,M,D,J,oe),n.U.P.curveTo(u,R,A,b,B,T,S));else if(O=="o14"){if(h.length>0&&!m&&(y=h.shift()+s.nominalWidthX,m=!0),h.length==4){var Z=h.shift(),j=h.shift(),W=h.shift(),k=h.shift(),I=n.CFF.glyphBySE(s,W),Q=n.CFF.glyphBySE(s,k);n.U._drawCFF(s.CharStrings[I],r,s,f,u),r.x=Z,r.y=j,n.U._drawCFF(s.CharStrings[Q],r,s,f,u)}x&&(n.U.P.closePath(u),x=!1)}else if(O=="o19"||O=="o20")h.length%2!=0&&!m&&(y=h.shift()+f.nominalWidthX),d+=h.length>>1,h.length=0,m=!0,C+=d+7>>3;else if(O=="o21")h.length>2&&!m&&(y=h.shift()+f.nominalWidthX,m=!0),S+=h.pop(),T+=h.pop(),x&&n.U.P.closePath(u),n.U.P.moveTo(u,T,S),x=!0;else if(O=="o22")h.length>1&&!m&&(y=h.shift()+f.nominalWidthX,m=!0),T+=h.pop(),x&&n.U.P.closePath(u),n.U.P.moveTo(u,T,S),x=!0;else if(O=="o25"){for(;h.length>6;)T+=h.shift(),S+=h.shift(),n.U.P.lineTo(u,T,S);_=T+h.shift(),w=S+h.shift(),M=_+h.shift(),D=w+h.shift(),T=M+h.shift(),S=D+h.shift(),n.U.P.curveTo(u,_,w,M,D,T,S)}else if(O=="o26")for(h.length%2&&(T+=h.shift());h.length>0;)_=T,w=S+h.shift(),T=M=_+h.shift(),S=(D=w+h.shift())+h.shift(),n.U.P.curveTo(u,_,w,M,D,T,S);else if(O=="o27")for(h.length%2&&(S+=h.shift());h.length>0;)w=S,M=(_=T+h.shift())+h.shift(),D=w+h.shift(),T=M+h.shift(),S=D,n.U.P.curveTo(u,_,w,M,D,T,S);else if(O=="o10"||O=="o29"){var Y=O=="o10"?f:s;if(h.length==0)console.debug("error: empty stack");else{var H=h.pop(),re=Y.Subrs[H+Y.Bias];r.x=T,r.y=S,r.nStems=d,r.haveWidth=m,r.width=y,r.open=x,n.U._drawCFF(re,r,s,f,u),T=r.x,S=r.y,d=r.nStems,m=r.haveWidth,y=r.width,x=r.open}}else if(O=="o30"||O=="o31"){var X=h.length,te=(ve=0,O=="o31");for(ve+=X-(ee=-3&X);ve"u"&&(self.window=self),function(l){var n={parse:function(i){var r=n._bin,s=new Uint8Array(i);if(r.readASCII(s,0,4)=="ttcf"){var f=4;r.readUshort(s,f),f+=2,r.readUshort(s,f),f+=2;var u=r.readUint(s,f);f+=4;for(var h=[],d=0;d>>s&1&&r++;return r},n._lctf.readClassDef=function(i,r){var s=n._bin,f=[],u=s.readUshort(i,r);if(r+=2,u==1){var h=s.readUshort(i,r);r+=2;var d=s.readUshort(i,r);r+=2;for(var m=0;m0&&(u.featureParams=f+h);var d=s.readUshort(i,r);r+=2,u.tab=[];for(var m=0;m255?-1:n.CFF.glyphByUnicode(i,n.CFF.tableSE[r])},n.CFF.readEncoding=function(i,r,s){n._bin;var f=[".notdef"],u=i[r];if(r++,u!=0)throw"error: unknown encoding format: "+u;var h=i[r];r++;for(var d=0;d>4,w=15&S;if(_!=15&&T.push(_),w!=15&&T.push(w),w==15)break}for(var M="",D=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],R=0;R=h.xMax||h.yMin>=h.yMax)return null;if(h.noc>0){h.endPts=[];for(var d=0;d=1&&d.fmt<=2){y=u.readUshort(i,s),s+=2;var C=u.readUshort(i,s);s+=2,x=n._lctf.numOfOnes(y);var T=n._lctf.numOfOnes(C);if(d.fmt==1){d.pairsets=[];var S=u.readUshort(i,s);s+=2;for(var _=0;_=1&&d.fmt<=2){if(d.fmt==1)d.delta=u.readShort(i,s),s+=2;else if(d.fmt==2){var y=u.readUshort(i,s);s+=2,d.newg=u.readUshorts(i,s,y),s+=2*d.newg.length}}else if(r==4){d.vals=[],y=u.readUshort(i,s),s+=2;for(var x=0;x>>8;if((C&=15)!=0)throw"unknown kern table format: "+C;r=n.kern.readFormat0(i,r,m)}return m},n.kern.parseV1=function(i,r,s,f){var u=n._bin;u.readFixed(i,r),r+=4;var h=u.readUint(i,r);r+=4;for(var d={glyph1:[],rval:[]},m=0;m>>8;if((x&=15)!=0)throw"unknown kern table format: "+x;r=n.kern.readFormat0(i,r,d)}return d},n.kern.readFormat0=function(i,r,s){var f=n._bin,u=-1,h=f.readUshort(i,r);r+=2,f.readUshort(i,r),r+=2,f.readUshort(i,r),r+=2,f.readUshort(i,r),r+=2;for(var d=0;d=u.map.length?0:u.map[r];if(u.format==4){for(var h=-1,d=0;dr?0:65535&(u.idRangeOffset[h]!=0?u.glyphIdArray[r-u.startCount[h]+(u.idRangeOffset[h]>>1)-(u.idRangeOffset.length-h)]:r+u.idDelta[h])}if(u.format==12){if(r>u.groups[u.groups.length-1][1])return 0;for(d=0;d-1?n.U._simpleGlyph(f,s):n.U._compoGlyph(f,r,s))},n.U._simpleGlyph=function(i,r){for(var s=0;su)){for(var S=!0,_=0,w=0;wu)){for(S=!0,w=0;w>1,h.length=0,m=!0;else if(O=="o3"||O=="o23")h.length%2!=0&&!m&&(y=h.shift()+f.nominalWidthX),d+=h.length>>1,h.length=0,m=!0;else if(O=="o4")h.length>1&&!m&&(y=h.shift()+f.nominalWidthX,m=!0),x&&n.U.P.closePath(u),S+=h.pop(),n.U.P.moveTo(u,T,S),x=!0;else if(O=="o5")for(;h.length>0;)T+=h.shift(),S+=h.shift(),n.U.P.lineTo(u,T,S);else if(O=="o6"||O=="o7")for(var ee=h.length,q=O=="o6",ne=0;neMath.abs(B-S)?T=b+h.shift():S=B+h.shift(),n.U.P.curveTo(u,_,w,M,D,J,oe),n.U.P.curveTo(u,R,A,b,B,T,S));else if(O=="o14"){if(h.length>0&&!m&&(y=h.shift()+s.nominalWidthX,m=!0),h.length==4){var Z=h.shift(),j=h.shift(),W=h.shift(),k=h.shift(),I=n.CFF.glyphBySE(s,W),Q=n.CFF.glyphBySE(s,k);n.U._drawCFF(s.CharStrings[I],r,s,f,u),r.x=Z,r.y=j,n.U._drawCFF(s.CharStrings[Q],r,s,f,u)}x&&(n.U.P.closePath(u),x=!1)}else if(O=="o19"||O=="o20")h.length%2!=0&&!m&&(y=h.shift()+f.nominalWidthX),d+=h.length>>1,h.length=0,m=!0,C+=d+7>>3;else if(O=="o21")h.length>2&&!m&&(y=h.shift()+f.nominalWidthX,m=!0),S+=h.pop(),T+=h.pop(),x&&n.U.P.closePath(u),n.U.P.moveTo(u,T,S),x=!0;else if(O=="o22")h.length>1&&!m&&(y=h.shift()+f.nominalWidthX,m=!0),T+=h.pop(),x&&n.U.P.closePath(u),n.U.P.moveTo(u,T,S),x=!0;else if(O=="o25"){for(;h.length>6;)T+=h.shift(),S+=h.shift(),n.U.P.lineTo(u,T,S);_=T+h.shift(),w=S+h.shift(),M=_+h.shift(),D=w+h.shift(),T=M+h.shift(),S=D+h.shift(),n.U.P.curveTo(u,_,w,M,D,T,S)}else if(O=="o26")for(h.length%2&&(T+=h.shift());h.length>0;)_=T,w=S+h.shift(),T=M=_+h.shift(),S=(D=w+h.shift())+h.shift(),n.U.P.curveTo(u,_,w,M,D,T,S);else if(O=="o27")for(h.length%2&&(S+=h.shift());h.length>0;)w=S,M=(_=T+h.shift())+h.shift(),D=w+h.shift(),T=M+h.shift(),S=D,n.U.P.curveTo(u,_,w,M,D,T,S);else if(O=="o10"||O=="o29"){var Y=O=="o10"?f:s;if(h.length==0)console.debug("error: empty stack");else{var H=h.pop(),re=Y.Subrs[H+Y.Bias];r.x=T,r.y=S,r.nStems=d,r.haveWidth=m,r.width=y,r.open=x,n.U._drawCFF(re,r,s,f,u),T=r.x,S=r.y,d=r.nStems,m=r.haveWidth,y=r.width,x=r.open}}else if(O=="o30"||O=="o31"){var X=h.length,te=(ve=0,O=="o31");for(ve+=X-(ee=-3&X);ve>>1|(21845&x)<<1;C=(61680&(C=(52428&C)>>>2|(13107&C)<<2))>>>4|(3855&C)<<4,y[x]=((65280&C)>>>8|(255&C)<<8)>>>1}var T=function(O,ee,q){for(var ne=O.length,ae=0,ve=new c(ee);ae>>W]=k}else for(Z=new c(ne),ae=0;ae>>15-O[ae]);return Z},S=new n(288);for(x=0;x<144;++x)S[x]=8;for(x=144;x<256;++x)S[x]=9;for(x=256;x<280;++x)S[x]=7;for(x=280;x<288;++x)S[x]=8;var _=new n(32);for(x=0;x<32;++x)_[x]=5;var w=T(S,9,1),M=T(_,5,1),D=function(O){for(var ee=O[0],q=1;qee&&(ee=O[q]);return ee},R=function(O,ee,q){var ne=ee/8|0;return(O[ne]|O[ne+1]<<8)>>(7&ee)&q},A=function(O,ee){var q=ee/8|0;return(O[q]|O[q+1]<<8|O[q+2]<<16)>>(7&ee)},b=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],B=function(O,ee,q){var ne=new Error(ee||b[O]);if(ne.code=O,Error.captureStackTrace&&Error.captureStackTrace(ne,B),!q)throw ne;return ne},J=function(O,ee,q){var ne=O.length;if(!ne||q&&!q.l&&ne<5)return ee||new n(0);var ae=!ee||q,ve=!q||q.i;q||(q={}),ee||(ee=new n(3*ne));var Z,j=function(Ue){var Qe=ee.length;if(Ue>Qe){var Je=new n(Math.max(2*Qe,Ue));Je.set(ee),ee=Je}},W=q.f||0,k=q.p||0,I=q.b||0,Q=q.l,Y=q.d,H=q.m,re=q.n,X=8*ne;do{if(!Q){q.f=W=R(O,k,1);var te=R(O,k+1,3);if(k+=3,!te){var ue=O[(pe=((Z=k)/8|0)+(7&Z&&1)+4)-4]|O[pe-3]<<8,fe=pe+ue;if(fe>ne){ve&&B(0);break}ae&&j(I+ue),ee.set(O.subarray(pe,fe),I),q.b=I+=ue,q.p=k=8*fe;continue}if(te==1)Q=w,Y=M,H=9,re=5;else if(te==2){var K=R(O,k,31)+257,$=R(O,k+10,15)+4,xe=K+R(O,k+5,31)+1;k+=14;for(var Re=new n(xe),ce=new n(19),Se=0;Se<$;++Se)ce[s[Se]]=R(O,k+3*Se,7);k+=3*$;var ke=D(ce),le=(1<>>4)<16)Re[Se++]=pe;else{var Pe=0,ye=0;for(pe==16?(ye=3+R(O,k,3),k+=2,Pe=Re[Se-1]):pe==17?(ye=3+R(O,k,7),k+=3):pe==18&&(ye=11+R(O,k,127),k+=7);ye--;)Re[Se++]=Pe}}var we=Re.subarray(0,K),me=Re.subarray(K);H=D(we),re=D(me),Q=T(we,H,1),Y=T(me,re,1)}else B(1);if(k>X){ve&&B(0);break}}ae&&j(I+131072);for(var We=(1<>>4;if((k+=15&Pe)>X){ve&&B(0);break}if(Pe||B(2),ze<256)ee[I++]=ze;else{if(ze==256){Me=k,Q=null;break}var He=ze-254;if(ze>264){var ut=i[Se=ze-257];He=R(O,k,(1<>>4;if(De||B(3),k+=15&De,me=m[qe],qe>3&&(ut=r[qe],me+=A(O,k)&(1<X){ve&&B(0);break}ae&&j(I+131072);for(var be=I+He;IUe.length)&&(Je=Ue.length);var ct=new(Ue instanceof c?c:Ue instanceof v?v:n)(Je-Qe);return ct.set(Ue.subarray(Qe,Je)),ct}(ee,0,I)},oe=new n(0),G=typeof TextDecoder<"u"&&new TextDecoder;try{G.decode(oe,{stream:!0})}catch{}return a.convert_streams=function(O){var ee=new DataView(O),q=0;function ne(){var K=ee.getUint16(q);return q+=2,K}function ae(){var K=ee.getUint32(q);return q+=4,K}function ve(K){ue.setUint16(fe,K),fe+=2}function Z(K){ue.setUint32(fe,K),fe+=4}for(var j={signature:ae(),flavor:ae(),length:ae(),numTables:ne(),reserved:ne(),totalSfntSize:ae(),majorVersion:ne(),minorVersion:ne(),metaOffset:ae(),metaLength:ae(),metaOrigLength:ae(),privOffset:ae(),privLength:ae()},W=0;Math.pow(2,W)<=j.numTables;)W++;W--;for(var k=16*Math.pow(2,W),I=16*j.numTables-k,Q=12,Y=[],H=0;H{let[oe,G]=J.split("+");oe=parseInt(oe,36),G=G?parseInt(G,36):0,d.set(B+=oe,A[b]);for(let O=G;O--;)d.set(++B,A[b])})}}return d.get(R)||h}const y=1,x=2,C=3,T=4,S=[null,"isol","init","fina","medi"];function _(R){const A=new Uint8Array(R.length);let b=h,B=y,J=-1;for(let oe=0;oe65535&&oe++)}return A}function w(R,A){const b=[];for(let J=0;J65535&&J++,b.push(a.U.codeToGlyph(R,oe))}const B=R.GSUB;if(B){const{lookupList:J,featureList:oe}=B;let G;const O=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,ee=[];oe.forEach(q=>{if(O.test(q.tag))for(let ne=0;ne{if(k!==-1){let Q=A[k];if(!Q){const{cmds:Y,crds:H}=a.U.glyphToPath(R,k);let re="",X=0;for(let $=0,xe=Y.length;$1?",":"")+H[X++]}let te,ue,fe,K;if(H.length){te=ue=1/0,fe=K=-1/0;for(let $=0,xe=H.length;$fe&&(fe=Re),ce>K&&(K=ce)}}else te=fe=ue=K=0;Q=A[k]={index:k,advanceWidth:R.hmtx.aWidth[k],xMin:te,yMin:ue,xMax:fe,yMax:K,path:re,pathCommandCount:Y.length}}W!==-1&&(ae+=a.U.getPairAdjustment(R,W,k)*ve),ne.call(null,Q,ae,j),Q.advanceWidth&&(ae+=Q.advanceWidth*ve),q&&(ae+=q*ee),W=k}j+=O.codePointAt(j)>65535?2:1}),ae}};return G}return function(A){const b=new Uint8Array(A,0,4),B=a._bin.readASCII(b,0,4);if(B==="wOFF")A=n(A);else if(B==="wOF2")throw new Error("woff2 fonts not supported");return D(a.parse(A)[0])}}const p0=so({name:"Typr Font Parser",dependencies:[f0,d0,h0],init(a,n,c){const v=a(),i=n();return c(v,i)}}),mi={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},v0=new io;function fi(){return(self.performance||Date).now()}const uc=Object.create(null);function cf(a,n){a=y0({},a);const c=fi();if(a.font=x0(a.font||mi.defaultFontURL),a.text=""+a.text,a.sdfGlyphSize=a.sdfGlyphSize||mi.sdfGlyphSize,a.colorRanges!=null){let m={};for(let y in a.colorRanges)if(a.colorRanges.hasOwnProperty(y)){let x=a.colorRanges[y];typeof x!="number"&&(x=v0.set(x).getHex()),m[y]=x}a.colorRanges=m}Object.freeze(a);const{textureWidth:v,sdfExponent:i}=mi,{sdfGlyphSize:r}=a,s=v/r*4;let f=uc[r];if(!f){const m=document.createElement("canvas");m.width=v,m.height=r*256/s,f=uc[r]={glyphCount:0,sdfGlyphSize:r,sdfCanvas:m,sdfTexture:new Vl(m,void 0,void 0,void 0,Au,Au),contextLost:!1,glyphsByFont:new Map},f.sdfTexture.generateMipmaps=!1,m0(f)}const{sdfTexture:u,sdfCanvas:h}=f;let d=f.glyphsByFont.get(a.font);d||f.glyphsByFont.set(a.font,d=new Map),S0(a).then(m=>{const{glyphIds:y,glyphPositions:x,fontSize:C,unitsPerEm:T,timings:S}=m,_=[],w=new Float32Array(y.length*4),M=C/T;let D=0,R=0;const A=fi();y.forEach((G,O)=>{let ee=d.get(G);if(!ee){const{path:ve,pathBounds:Z}=m.glyphData[G],j=Math.max(Z[2]-Z[0],Z[3]-Z[1])/r*(mi.sdfMargin*r+.5),W=f.glyphCount++,k=[Z[0]-j,Z[1]-j,Z[2]+j,Z[3]+j];d.set(G,ee={path:ve,atlasIndex:W,sdfViewBox:k}),_.push(ee)}const{sdfViewBox:q}=ee,ne=x[R++],ae=x[R++];w[D++]=ne+q[0]*M,w[D++]=ae+q[1]*M,w[D++]=ne+q[2]*M,w[D++]=ae+q[3]*M,y[O]=ee.atlasIndex}),S.quads=(S.quads||0)+(fi()-A);const b=fi();S.sdf={};const B=h.height,J=Math.ceil(f.glyphCount/s),oe=Math.pow(2,Math.ceil(Math.log2(J*r)));oe>B&&(console.info(`Increasing SDF texture size ${B}->${oe}`),c0(h,v,oe),u.dispose()),Promise.all(_.map(G=>ff(G,f,a.gpuAccelerateSDF).then(({timing:O})=>{S.sdf[G.atlasIndex]=O}))).then(()=>{_.length&&!f.contextLost&&(df(f),u.needsUpdate=!0),S.sdfTotal=fi()-b,S.total=fi()-c,n(Object.freeze({parameters:a,sdfTexture:u,sdfGlyphSize:r,sdfExponent:i,glyphBounds:w,glyphAtlasIndices:y,glyphColors:m.glyphColors,caretPositions:m.caretPositions,caretHeight:m.caretHeight,chunkedBounds:m.chunkedBounds,ascender:m.ascender,descender:m.descender,lineHeight:m.lineHeight,capHeight:m.capHeight,xHeight:m.xHeight,topBaseline:m.topBaseline,blockBounds:m.blockBounds,visibleBounds:m.visibleBounds,timings:m.timings}))})}),Promise.resolve().then(()=>{f.contextLost||u0(h)})}function ff({path:a,atlasIndex:n,sdfViewBox:c},{sdfGlyphSize:v,sdfCanvas:i,contextLost:r},s){if(r)return Promise.resolve({timing:-1});const{textureWidth:f,sdfExponent:u}=mi,h=Math.max(c[2]-c[0],c[3]-c[1]),d=Math.floor(n/4),m=d%(f/v)*v,y=Math.floor(d/(f/v))*v,x=n%4;return r0(v,v,a,c,h,u,i,m,y,x,s)}function m0(a){const n=a.sdfCanvas;n.addEventListener("webglcontextlost",c=>{console.log("Context Lost",c),c.preventDefault(),a.contextLost=!0}),n.addEventListener("webglcontextrestored",c=>{console.log("Context Restored",c),a.contextLost=!1;const v=[];a.glyphsByFont.forEach(i=>{i.forEach(r=>{v.push(ff(r,a,!0))})}),Promise.all(v).then(()=>{df(a),a.sdfTexture.needsUpdate=!0})})}function g0({font:a,characters:n,sdfGlyphSize:c},v){let i=Array.isArray(n)?n.join(` -`):""+n;cf({font:a,sdfGlyphSize:c,text:i},v)}function y0(a,n){for(let c in n)n.hasOwnProperty(c)&&(a[c]=n[c]);return a}let la;function x0(a){return la||(la=typeof document>"u"?{}:document.createElement("a")),la.href=a,la.href}function df(a){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:n,sdfTexture:c}=a,{width:v,height:i}=n,r=a.sdfCanvas.getContext("webgl");let s=c.image.data;(!s||s.length!==v*i*4)&&(s=new Uint8Array(v*i*4),c.image={width:v,height:i,data:s},c.flipY=!1,c.isDataTexture=!0),r.readPixels(0,0,v,i,r.RGBA,r.UNSIGNED_BYTE,s)}}const w0=so({name:"Typesetter",dependencies:[mi,p0,n0,X1],init(a,n,c,v){const{defaultFontURL:i}=a;return c(n,v(),{defaultFontURL:i})}}),S0=so({name:"Typesetter",dependencies:[w0],init(a){return function(n){return new Promise(c=>{a.typeset(n,c)})}},getTransferables(a){const n=[a.glyphPositions.buffer,a.glyphIds.buffer];return a.caretPositions&&n.push(a.caretPositions.buffer),a.glyphColors&&n.push(a.glyphColors.buffer),n}}),cc={};function C0(a){let n=cc[a];if(!n){const c=new Jl(1,1,a,a),v=c.clone(),i=c.attributes,r=v.attributes,s=new Ec,f=i.uv.count;for(let u=0;u{s.setAttribute(u,new Ul([...i[u].array,...r[u].array],i[u].itemSize))}),s.setIndex([...c.index.array,...v.index.array.map(u=>u+f)]),s.translate(.5,.5,0),n=cc[a]=s}return n}const _0="aTroikaGlyphBounds",fc="aTroikaGlyphIndex",E0="aTroikaGlyphColor";class T0 extends Tc{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new Yl,this.boundingBox=new pa}computeBoundingSphere(){}computeBoundingBox(){}setSide(n){const c=this.getIndex().count;this.setDrawRange(n===kd?c/2:0,n===Xl?c:c/2)}set detail(n){if(n!==this._detail){this._detail=n,(typeof n!="number"||n<1)&&(n=1);let c=C0(n);["position","normal","uv"].forEach(v=>{this.attributes[v]=c.attributes[v].clone()}),this.setIndex(c.getIndex().clone())}}get detail(){return this._detail}set curveRadius(n){n!==this._curveRadius&&(this._curveRadius=n,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(n,c,v,i,r){Tl(this,_0,n,4),Tl(this,fc,c,1),Tl(this,E0,r,3),this._blockBounds=v,this._chunkedBounds=i,this.instanceCount=c.length,this._updateBounds()}_updateBounds(){const n=this._blockBounds;if(n){const{curveRadius:c,boundingBox:v}=this;if(c){const{PI:i,floor:r,min:s,max:f,sin:u,cos:h}=Math,d=i/2,m=i*2,y=Math.abs(c),x=n[0]/y,C=n[2]/y,T=r((x+d)/m)!==r((C+d)/m)?-y:s(u(x)*y,u(C)*y),S=r((x-d)/m)!==r((C-d)/m)?y:f(u(x)*y,u(C)*y),_=r((x+i)/m)!==r((C+i)/m)?y*2:f(y-h(x)*y,y-h(C)*y);v.min.set(T,n[1],c<0?-_:0),v.max.set(S,n[3],c<0?0:_)}else v.min.set(n[0],n[1],0),v.max.set(n[2],n[3],0);v.getBoundingSphere(this.boundingSphere)}}applyClipRect(n){let c=this.getAttribute(fc).count,v=this._chunkedBounds;if(v)for(let i=v.length;i--;){c=v[i].end;let r=v[i].rect;if(r[1]n.y&&r[0]n.x)break}this.instanceCount=c}}function Tl(a,n,c,v){const i=a.getAttribute(n);c?i&&i.array.length===c.length?(i.array.set(c),i.needsUpdate=!0):(a.setAttribute(n,new Pd(c,v)),delete a._maxInstanceCount,a.dispose()):i&&a.deleteAttribute(n)}const M0=` +*/function d0(){return function(l){var n=Uint8Array,c=Uint16Array,v=Uint32Array,i=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),r=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(O,ee){for(var q=new c(31),ne=0;ne<31;++ne)q[ne]=ee+=1<>>1|(21845&x)<<1;C=(61680&(C=(52428&C)>>>2|(13107&C)<<2))>>>4|(3855&C)<<4,y[x]=((65280&C)>>>8|(255&C)<<8)>>>1}var T=function(O,ee,q){for(var ne=O.length,ae=0,ve=new c(ee);ae>>W]=k}else for(Z=new c(ne),ae=0;ae>>15-O[ae]);return Z},S=new n(288);for(x=0;x<144;++x)S[x]=8;for(x=144;x<256;++x)S[x]=9;for(x=256;x<280;++x)S[x]=7;for(x=280;x<288;++x)S[x]=8;var _=new n(32);for(x=0;x<32;++x)_[x]=5;var w=T(S,9,1),M=T(_,5,1),D=function(O){for(var ee=O[0],q=1;qee&&(ee=O[q]);return ee},R=function(O,ee,q){var ne=ee/8|0;return(O[ne]|O[ne+1]<<8)>>(7&ee)&q},A=function(O,ee){var q=ee/8|0;return(O[q]|O[q+1]<<8|O[q+2]<<16)>>(7&ee)},b=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],B=function(O,ee,q){var ne=new Error(ee||b[O]);if(ne.code=O,Error.captureStackTrace&&Error.captureStackTrace(ne,B),!q)throw ne;return ne},J=function(O,ee,q){var ne=O.length;if(!ne||q&&!q.l&&ne<5)return ee||new n(0);var ae=!ee||q,ve=!q||q.i;q||(q={}),ee||(ee=new n(3*ne));var Z,j=function(Ue){var Qe=ee.length;if(Ue>Qe){var Je=new n(Math.max(2*Qe,Ue));Je.set(ee),ee=Je}},W=q.f||0,k=q.p||0,I=q.b||0,Q=q.l,Y=q.d,H=q.m,re=q.n,X=8*ne;do{if(!Q){q.f=W=R(O,k,1);var te=R(O,k+1,3);if(k+=3,!te){var ue=O[(pe=((Z=k)/8|0)+(7&Z&&1)+4)-4]|O[pe-3]<<8,fe=pe+ue;if(fe>ne){ve&&B(0);break}ae&&j(I+ue),ee.set(O.subarray(pe,fe),I),q.b=I+=ue,q.p=k=8*fe;continue}if(te==1)Q=w,Y=M,H=9,re=5;else if(te==2){var K=R(O,k,31)+257,$=R(O,k+10,15)+4,xe=K+R(O,k+5,31)+1;k+=14;for(var Re=new n(xe),ce=new n(19),Se=0;Se<$;++Se)ce[s[Se]]=R(O,k+3*Se,7);k+=3*$;var ke=D(ce),le=(1<>>4)<16)Re[Se++]=pe;else{var Pe=0,ye=0;for(pe==16?(ye=3+R(O,k,3),k+=2,Pe=Re[Se-1]):pe==17?(ye=3+R(O,k,7),k+=3):pe==18&&(ye=11+R(O,k,127),k+=7);ye--;)Re[Se++]=Pe}}var we=Re.subarray(0,K),me=Re.subarray(K);H=D(we),re=D(me),Q=T(we,H,1),Y=T(me,re,1)}else B(1);if(k>X){ve&&B(0);break}}ae&&j(I+131072);for(var We=(1<>>4;if((k+=15&Pe)>X){ve&&B(0);break}if(Pe||B(2),ze<256)ee[I++]=ze;else{if(ze==256){Me=k,Q=null;break}var He=ze-254;if(ze>264){var ut=i[Se=ze-257];He=R(O,k,(1<>>4;if(De||B(3),k+=15&De,me=m[qe],qe>3&&(ut=r[qe],me+=A(O,k)&(1<X){ve&&B(0);break}ae&&j(I+131072);for(var be=I+He;IUe.length)&&(Je=Ue.length);var ct=new(Ue instanceof c?c:Ue instanceof v?v:n)(Je-Qe);return ct.set(Ue.subarray(Qe,Je)),ct}(ee,0,I)},oe=new n(0),G=typeof TextDecoder<"u"&&new TextDecoder;try{G.decode(oe,{stream:!0})}catch{}return l.convert_streams=function(O){var ee=new DataView(O),q=0;function ne(){var K=ee.getUint16(q);return q+=2,K}function ae(){var K=ee.getUint32(q);return q+=4,K}function ve(K){ue.setUint16(fe,K),fe+=2}function Z(K){ue.setUint32(fe,K),fe+=4}for(var j={signature:ae(),flavor:ae(),length:ae(),numTables:ne(),reserved:ne(),totalSfntSize:ae(),majorVersion:ne(),minorVersion:ne(),metaOffset:ae(),metaLength:ae(),metaOrigLength:ae(),privOffset:ae(),privLength:ae()},W=0;Math.pow(2,W)<=j.numTables;)W++;W--;for(var k=16*Math.pow(2,W),I=16*j.numTables-k,Q=12,Y=[],H=0;H{let[oe,G]=J.split("+");oe=parseInt(oe,36),G=G?parseInt(G,36):0,d.set(B+=oe,A[b]);for(let O=G;O--;)d.set(++B,A[b])})}}return d.get(R)||h}const y=1,x=2,C=3,T=4,S=[null,"isol","init","fina","medi"];function _(R){const A=new Uint8Array(R.length);let b=h,B=y,J=-1;for(let oe=0;oe65535&&oe++)}return A}function w(R,A){const b=[];for(let J=0;J65535&&J++,b.push(l.U.codeToGlyph(R,oe))}const B=R.GSUB;if(B){const{lookupList:J,featureList:oe}=B;let G;const O=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,ee=[];oe.forEach(q=>{if(O.test(q.tag))for(let ne=0;ne{if(k!==-1){let Q=A[k];if(!Q){const{cmds:Y,crds:H}=l.U.glyphToPath(R,k);let re="",X=0;for(let $=0,xe=Y.length;$1?",":"")+H[X++]}let te,ue,fe,K;if(H.length){te=ue=1/0,fe=K=-1/0;for(let $=0,xe=H.length;$fe&&(fe=Re),ce>K&&(K=ce)}}else te=fe=ue=K=0;Q=A[k]={index:k,advanceWidth:R.hmtx.aWidth[k],xMin:te,yMin:ue,xMax:fe,yMax:K,path:re,pathCommandCount:Y.length}}W!==-1&&(ae+=l.U.getPairAdjustment(R,W,k)*ve),ne.call(null,Q,ae,j),Q.advanceWidth&&(ae+=Q.advanceWidth*ve),q&&(ae+=q*ee),W=k}j+=O.codePointAt(j)>65535?2:1}),ae}};return G}return function(A){const b=new Uint8Array(A,0,4),B=l._bin.readASCII(b,0,4);if(B==="wOFF")A=n(A);else if(B==="wOF2")throw new Error("woff2 fonts not supported");return D(l.parse(A)[0])}}const p0=so({name:"Typr Font Parser",dependencies:[f0,d0,h0],init(l,n,c){const v=l(),i=n();return c(v,i)}}),mi={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},v0=new ro;function fi(){return(self.performance||Date).now()}const uc=Object.create(null);function cf(l,n){l=y0({},l);const c=fi();if(l.font=x0(l.font||mi.defaultFontURL),l.text=""+l.text,l.sdfGlyphSize=l.sdfGlyphSize||mi.sdfGlyphSize,l.colorRanges!=null){let m={};for(let y in l.colorRanges)if(l.colorRanges.hasOwnProperty(y)){let x=l.colorRanges[y];typeof x!="number"&&(x=v0.set(x).getHex()),m[y]=x}l.colorRanges=m}Object.freeze(l);const{textureWidth:v,sdfExponent:i}=mi,{sdfGlyphSize:r}=l,s=v/r*4;let f=uc[r];if(!f){const m=document.createElement("canvas");m.width=v,m.height=r*256/s,f=uc[r]={glyphCount:0,sdfGlyphSize:r,sdfCanvas:m,sdfTexture:new Vl(m,void 0,void 0,void 0,Au,Au),contextLost:!1,glyphsByFont:new Map},f.sdfTexture.generateMipmaps=!1,m0(f)}const{sdfTexture:u,sdfCanvas:h}=f;let d=f.glyphsByFont.get(l.font);d||f.glyphsByFont.set(l.font,d=new Map),S0(l).then(m=>{const{glyphIds:y,glyphPositions:x,fontSize:C,unitsPerEm:T,timings:S}=m,_=[],w=new Float32Array(y.length*4),M=C/T;let D=0,R=0;const A=fi();y.forEach((G,O)=>{let ee=d.get(G);if(!ee){const{path:ve,pathBounds:Z}=m.glyphData[G],j=Math.max(Z[2]-Z[0],Z[3]-Z[1])/r*(mi.sdfMargin*r+.5),W=f.glyphCount++,k=[Z[0]-j,Z[1]-j,Z[2]+j,Z[3]+j];d.set(G,ee={path:ve,atlasIndex:W,sdfViewBox:k}),_.push(ee)}const{sdfViewBox:q}=ee,ne=x[R++],ae=x[R++];w[D++]=ne+q[0]*M,w[D++]=ae+q[1]*M,w[D++]=ne+q[2]*M,w[D++]=ae+q[3]*M,y[O]=ee.atlasIndex}),S.quads=(S.quads||0)+(fi()-A);const b=fi();S.sdf={};const B=h.height,J=Math.ceil(f.glyphCount/s),oe=Math.pow(2,Math.ceil(Math.log2(J*r)));oe>B&&(console.info(`Increasing SDF texture size ${B}->${oe}`),c0(h,v,oe),u.dispose()),Promise.all(_.map(G=>ff(G,f,l.gpuAccelerateSDF).then(({timing:O})=>{S.sdf[G.atlasIndex]=O}))).then(()=>{_.length&&!f.contextLost&&(df(f),u.needsUpdate=!0),S.sdfTotal=fi()-b,S.total=fi()-c,n(Object.freeze({parameters:l,sdfTexture:u,sdfGlyphSize:r,sdfExponent:i,glyphBounds:w,glyphAtlasIndices:y,glyphColors:m.glyphColors,caretPositions:m.caretPositions,caretHeight:m.caretHeight,chunkedBounds:m.chunkedBounds,ascender:m.ascender,descender:m.descender,lineHeight:m.lineHeight,capHeight:m.capHeight,xHeight:m.xHeight,topBaseline:m.topBaseline,blockBounds:m.blockBounds,visibleBounds:m.visibleBounds,timings:m.timings}))})}),Promise.resolve().then(()=>{f.contextLost||u0(h)})}function ff({path:l,atlasIndex:n,sdfViewBox:c},{sdfGlyphSize:v,sdfCanvas:i,contextLost:r},s){if(r)return Promise.resolve({timing:-1});const{textureWidth:f,sdfExponent:u}=mi,h=Math.max(c[2]-c[0],c[3]-c[1]),d=Math.floor(n/4),m=d%(f/v)*v,y=Math.floor(d/(f/v))*v,x=n%4;return r0(v,v,l,c,h,u,i,m,y,x,s)}function m0(l){const n=l.sdfCanvas;n.addEventListener("webglcontextlost",c=>{console.log("Context Lost",c),c.preventDefault(),l.contextLost=!0}),n.addEventListener("webglcontextrestored",c=>{console.log("Context Restored",c),l.contextLost=!1;const v=[];l.glyphsByFont.forEach(i=>{i.forEach(r=>{v.push(ff(r,l,!0))})}),Promise.all(v).then(()=>{df(l),l.sdfTexture.needsUpdate=!0})})}function g0({font:l,characters:n,sdfGlyphSize:c},v){let i=Array.isArray(n)?n.join(` +`):""+n;cf({font:l,sdfGlyphSize:c,text:i},v)}function y0(l,n){for(let c in n)n.hasOwnProperty(c)&&(l[c]=n[c]);return l}let la;function x0(l){return la||(la=typeof document>"u"?{}:document.createElement("a")),la.href=l,la.href}function df(l){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:n,sdfTexture:c}=l,{width:v,height:i}=n,r=l.sdfCanvas.getContext("webgl");let s=c.image.data;(!s||s.length!==v*i*4)&&(s=new Uint8Array(v*i*4),c.image={width:v,height:i,data:s},c.flipY=!1,c.isDataTexture=!0),r.readPixels(0,0,v,i,r.RGBA,r.UNSIGNED_BYTE,s)}}const w0=so({name:"Typesetter",dependencies:[mi,p0,n0,X1],init(l,n,c,v){const{defaultFontURL:i}=l;return c(n,v(),{defaultFontURL:i})}}),S0=so({name:"Typesetter",dependencies:[w0],init(l){return function(n){return new Promise(c=>{l.typeset(n,c)})}},getTransferables(l){const n=[l.glyphPositions.buffer,l.glyphIds.buffer];return l.caretPositions&&n.push(l.caretPositions.buffer),l.glyphColors&&n.push(l.glyphColors.buffer),n}}),cc={};function C0(l){let n=cc[l];if(!n){const c=new Jl(1,1,l,l),v=c.clone(),i=c.attributes,r=v.attributes,s=new Ec,f=i.uv.count;for(let u=0;u{s.setAttribute(u,new Ul([...i[u].array,...r[u].array],i[u].itemSize))}),s.setIndex([...c.index.array,...v.index.array.map(u=>u+f)]),s.translate(.5,.5,0),n=cc[l]=s}return n}const _0="aTroikaGlyphBounds",fc="aTroikaGlyphIndex",E0="aTroikaGlyphColor";class T0 extends Tc{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new Yl,this.boundingBox=new pa}computeBoundingSphere(){}computeBoundingBox(){}setSide(n){const c=this.getIndex().count;this.setDrawRange(n===kd?c/2:0,n===Xl?c:c/2)}set detail(n){if(n!==this._detail){this._detail=n,(typeof n!="number"||n<1)&&(n=1);let c=C0(n);["position","normal","uv"].forEach(v=>{this.attributes[v]=c.attributes[v].clone()}),this.setIndex(c.getIndex().clone())}}get detail(){return this._detail}set curveRadius(n){n!==this._curveRadius&&(this._curveRadius=n,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(n,c,v,i,r){Tl(this,_0,n,4),Tl(this,fc,c,1),Tl(this,E0,r,3),this._blockBounds=v,this._chunkedBounds=i,this.instanceCount=c.length,this._updateBounds()}_updateBounds(){const n=this._blockBounds;if(n){const{curveRadius:c,boundingBox:v}=this;if(c){const{PI:i,floor:r,min:s,max:f,sin:u,cos:h}=Math,d=i/2,m=i*2,y=Math.abs(c),x=n[0]/y,C=n[2]/y,T=r((x+d)/m)!==r((C+d)/m)?-y:s(u(x)*y,u(C)*y),S=r((x-d)/m)!==r((C-d)/m)?y:f(u(x)*y,u(C)*y),_=r((x+i)/m)!==r((C+i)/m)?y*2:f(y-h(x)*y,y-h(C)*y);v.min.set(T,n[1],c<0?-_:0),v.max.set(S,n[3],c<0?0:_)}else v.min.set(n[0],n[1],0),v.max.set(n[2],n[3],0);v.getBoundingSphere(this.boundingSphere)}}applyClipRect(n){let c=this.getAttribute(fc).count,v=this._chunkedBounds;if(v)for(let i=v.length;i--;){c=v[i].end;let r=v[i].rect;if(r[1]n.y&&r[0]n.x)break}this.instanceCount=c}}function Tl(l,n,c,v){const i=l.getAttribute(n);c?i&&i.array.length===c.length?(i.array.set(c),i.needsUpdate=!0):(l.setAttribute(n,new Pd(c,v)),delete l._maxInstanceCount,l.dispose()):i&&l.deleteAttribute(n)}const M0=` uniform vec2 uTroikaSDFTextureSize; uniform float uTroikaSDFGlyphSize; uniform vec4 uTroikaTotalBounds; @@ -665,9 +665,9 @@ gl_FragColor.a *= edgeAlpha; if (edgeAlpha == 0.0) { discard; } -`;function U0(a){const n=Nl(a,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Nr},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new xi(0,0,0,0)},uTroikaClipRect:{value:new xi(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Nr},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new io},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Ld},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:M0,vertexTransform:k0,fragmentDefs:P0,fragmentColorTransform:L0,customRewriter({vertexShader:c,fragmentShader:v}){let i=/\buniform\s+vec3\s+diffuse\b/;return i.test(v)&&(v=v.replace(i,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),i.test(c)||(c=c.replace(sf,`uniform vec3 diffuse; +`;function U0(l){const n=Nl(l,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Nr},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new xi(0,0,0,0)},uTroikaClipRect:{value:new xi(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Nr},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new ro},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Ld},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:M0,vertexTransform:k0,fragmentDefs:P0,fragmentColorTransform:L0,customRewriter({vertexShader:c,fragmentShader:v}){let i=/\buniform\s+vec3\s+diffuse\b/;return i.test(v)&&(v=v.replace(i,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),i.test(c)||(c=c.replace(sf,`uniform vec3 diffuse; $& vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; -`))),{vertexShader:c,fragmentShader:v}}});return n.transparent=!0,Object.defineProperties(n,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),n}const rs=new Ud({color:16777215,side:Xl,transparent:!0}),dc=8421504,hc=new Mc,sa=new st,Ml=new st,eo=[],R0=new st,kl="+x+y";function pc(a){return Array.isArray(a)?a[0]:a}let hf=()=>{const a=new oo(new Jl(1,1),rs);return hf=()=>a,a},pf=()=>{const a=new oo(new Jl(1,1,32,1),rs);return pf=()=>a,a};const F0={type:"syncstart"},A0={type:"synccomplete"},vf=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],D0=vf.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let mf=class extends oo{constructor(){const n=new T0;super(n,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=dc,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=kl,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(n){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(n):(this._isSyncing=!0,this.dispatchEvent(F0),cf({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},c=>{this._isSyncing=!1,this._textRenderInfo=c,this.geometry.updateGlyphs(c.glyphBounds,c.glyphAtlasIndices,c.blockBounds,c.chunkedBounds,c.glyphColors);const v=this._queuedSyncs;v&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{v.forEach(i=>i&&i())})),this.dispatchEvent(A0),n&&n()})))}onBeforeRender(n,c,v,i,r,s){this.sync(),r.isTroikaTextMaterial&&this._prepareForRender(r),r._hadOwnSide=r.hasOwnProperty("side"),this.geometry.setSide(r._actualSide=r.side),r.side=Md}onAfterRender(n,c,v,i,r,s){r._hadOwnSide?r.side=r._actualSide:delete r.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let n=this._derivedMaterial;const c=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=rs.clone());if((!n||n.baseMaterial!==c)&&(n=this._derivedMaterial=U0(c),c.addEventListener("dispose",function v(){c.removeEventListener("dispose",v),n.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let v=n._outlineMtl;return v||(v=n._outlineMtl=Object.create(n,{id:{value:n.id+.1}}),v.isTextOutlineMaterial=!0,v.depthWrite=!1,v.map=null,n.addEventListener("dispose",function i(){n.removeEventListener("dispose",i),v.dispose()})),[v,n]}else return n}set material(n){n&&n.isTroikaTextMaterial?(this._derivedMaterial=n,this._baseMaterial=n.baseMaterial):this._baseMaterial=n}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(n){this.geometry.detail=n}get curveRadius(){return this.geometry.curveRadius}set curveRadius(n){this.geometry.curveRadius=n}get customDepthMaterial(){return pc(this.material).getDepthMaterial()}get customDistanceMaterial(){return pc(this.material).getDistanceMaterial()}_prepareForRender(n){const c=n.isTextOutlineMaterial,v=n.uniforms,i=this.textRenderInfo;if(i){const{sdfTexture:f,blockBounds:u}=i;v.uTroikaSDFTexture.value=f,v.uTroikaSDFTextureSize.value.set(f.image.width,f.image.height),v.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,v.uTroikaSDFExponent.value=i.sdfExponent,v.uTroikaTotalBounds.value.fromArray(u),v.uTroikaUseGlyphColors.value=!c&&!!i.glyphColors;let h=0,d=0,m=0,y,x,C,T=0,S=0;if(c){let{outlineWidth:w,outlineOffsetX:M,outlineOffsetY:D,outlineBlur:R,outlineOpacity:A}=this;h=this._parsePercent(w)||0,d=Math.max(0,this._parsePercent(R)||0),y=A,T=this._parsePercent(M)||0,S=this._parsePercent(D)||0}else m=Math.max(0,this._parsePercent(this.strokeWidth)||0),m&&(C=this.strokeColor,v.uTroikaStrokeColor.value.set(C??dc),x=this.strokeOpacity,x==null&&(x=1)),y=this.fillOpacity;v.uTroikaDistanceOffset.value=h,v.uTroikaPositionOffset.value.set(T,S),v.uTroikaBlurRadius.value=d,v.uTroikaStrokeWidth.value=m,v.uTroikaStrokeOpacity.value=x,v.uTroikaFillOpacity.value=y??1,v.uTroikaCurveRadius.value=this.curveRadius||0;let _=this.clipRect;if(_&&Array.isArray(_)&&_.length===4)v.uTroikaClipRect.value.fromArray(_);else{const w=(this.fontSize||.1)*100;v.uTroikaClipRect.value.set(u[0]-w,u[1]-w,u[2]+w,u[3]+w)}this.geometry.applyClipRect(v.uTroikaClipRect.value)}v.uTroikaSDFDebug.value=!!this.debugSDF,n.polygonOffset=!!this.depthOffset,n.polygonOffsetFactor=n.polygonOffsetUnits=this.depthOffset||0;const r=c?this.outlineColor||0:this.color;if(r==null)delete n.color;else{const f=n.hasOwnProperty("color")?n.color:n.color=new io;(r!==f._input||typeof r=="object")&&f.set(f._input=r)}let s=this.orientation||kl;if(s!==n._orientation){let f=v.uTroikaOrient.value;s=s.replace(/[^-+xyz]/g,"");let u=s!==kl&&s.match(/^([-+])([xyz])([-+])([xyz])$/);if(u){let[,h,d,m,y]=u;sa.set(0,0,0)[d]=h==="-"?1:-1,Ml.set(0,0,0)[y]=m==="-"?-1:1,hc.lookAt(R0,sa.cross(Ml),Ml),f.setFromMatrix4(hc)}else f.identity();n._orientation=s}}_parsePercent(n){if(typeof n=="string"){let c=n.match(/^(-?[\d.]+)%$/),v=c?parseFloat(c[1]):NaN;n=(isNaN(v)?0:v/100)*this.fontSize}return n}localPositionToTextCoords(n,c=new Nr){c.copy(n);const v=this.curveRadius;return v&&(c.x=Math.atan2(n.x,Math.abs(v)-Math.abs(n.z))*Math.abs(v)),c}worldPositionToTextCoords(n,c=new Nr){return sa.copy(n),this.localPositionToTextCoords(this.worldToLocal(sa),c)}raycast(n,c){const{textRenderInfo:v,curveRadius:i}=this;if(v){const r=v.blockBounds,s=i?pf():hf(),f=s.geometry,{position:u,uv:h}=f.attributes;for(let d=0;d{this[v]=n[v]}),this}clone(){return new this.constructor().copy(this)}};vf.forEach(a=>{const n="_private_"+a;Object.defineProperty(mf.prototype,a,{get(){return this[n]},set(c){c!==this[n]&&(this[n]=c,this._needsSync=!0)}})});function O0(a,n,c=(v,i)=>v===i){if(a===n)return!0;if(!a||!n)return!1;const v=a.length;if(n.length!==v)return!1;for(let i=0;ii.response=r).then(()=>{v.lifespan&&v.lifespan>0&&setTimeout(()=>{const r=ua.indexOf(i);r!==-1&&ua.splice(r,1)},v.lifespan)}).catch(r=>i.error=r)};if(ua.push(i),!c)throw i.promise}const I0=(a,n,c)=>z0(a,n,!1,c),vc=P.forwardRef(({anchorX:a="center",anchorY:n="middle",font:c,fontSize:v=1,children:i,characters:r,onSync:s,...f},u)=>{const h=Ci(({invalidate:x})=>x),[d]=P.useState(()=>new mf),[m,y]=P.useMemo(()=>{const x=[];let C="";return P.Children.forEach(i,T=>{typeof T=="string"||typeof T=="number"?C+=T:x.push(T)}),[x,C]},[i]);return I0(()=>new Promise(x=>g0({font:c,characters:r},x)),["troika-text",c,r]),P.useLayoutEffect(()=>void d.sync(()=>{h(),s&&s(d)})),P.useEffect(()=>()=>d.dispose(),[d]),P.createElement("primitive",yi({object:d,ref:u,font:c,text:y,anchorX:a,anchorY:n,fontSize:v},f),m)});function gt(a,n){if(a==null)return{};var c={},v=Object.keys(a),i,r;for(r=0;r=0)&&(c[i]=a[i]);return c}var j0=["color"],gf=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,j0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M0 1.5C0 1.22386 0.223858 1 0.5 1H2.5C2.77614 1 3 1.22386 3 1.5C3 1.77614 2.77614 2 2.5 2H0.5C0.223858 2 0 1.77614 0 1.5ZM4 1.5C4 1.22386 4.22386 1 4.5 1H14.5C14.7761 1 15 1.22386 15 1.5C15 1.77614 14.7761 2 14.5 2H4.5C4.22386 2 4 1.77614 4 1.5ZM4 4.5C4 4.22386 4.22386 4 4.5 4H11.5C11.7761 4 12 4.22386 12 4.5C12 4.77614 11.7761 5 11.5 5H4.5C4.22386 5 4 4.77614 4 4.5ZM0 7.5C0 7.22386 0.223858 7 0.5 7H2.5C2.77614 7 3 7.22386 3 7.5C3 7.77614 2.77614 8 2.5 8H0.5C0.223858 8 0 7.77614 0 7.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H4.5C4.22386 11 4 10.7761 4 10.5ZM0 13.5C0 13.2239 0.223858 13 0.5 13H2.5C2.77614 13 3 13.2239 3 13.5C3 13.7761 2.77614 14 2.5 14H0.5C0.223858 14 0 13.7761 0 13.5ZM4 13.5C4 13.2239 4.22386 13 4.5 13H14.5C14.7761 13 15 13.2239 15 13.5C15 13.7761 14.7761 14 14.5 14H4.5C4.22386 14 4 13.7761 4 13.5Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),b0=["color"],B0=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,b0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M11.5 1C11.7761 1 12 1.22386 12 1.5V13.5C12 13.7761 11.7761 14 11.5 14C11.2239 14 11 13.7761 11 13.5V1.5C11 1.22386 11.2239 1 11.5 1ZM9.5 3C9.77614 3 10 3.22386 10 3.5V13.5C10 13.7761 9.77614 14 9.5 14C9.22386 14 9 13.7761 9 13.5V3.5C9 3.22386 9.22386 3 9.5 3ZM13.5 3C13.7761 3 14 3.22386 14 3.5V13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5V3.5C13 3.22386 13.2239 3 13.5 3ZM5.5 4C5.77614 4 6 4.22386 6 4.5V13.5C6 13.7761 5.77614 14 5.5 14C5.22386 14 5 13.7761 5 13.5V4.5C5 4.22386 5.22386 4 5.5 4ZM1.5 5C1.77614 5 2 5.22386 2 5.5V13.5C2 13.7761 1.77614 14 1.5 14C1.22386 14 1 13.7761 1 13.5V5.5C1 5.22386 1.22386 5 1.5 5ZM7.5 5C7.77614 5 8 5.22386 8 5.5V13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5V5.5C7 5.22386 7.22386 5 7.5 5ZM3.5 7C3.77614 7 4 7.22386 4 7.5V13.5C4 13.7761 3.77614 14 3.5 14C3.22386 14 3 13.7761 3 13.5V7.5C3 7.22386 3.22386 7 3.5 7Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),N0=["color"],G0=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,N0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M2 5H13C13.5523 5 14 5.44772 14 6V9C14 9.55228 13.5523 10 13 10H2C1.44772 10 1 9.55228 1 9V6C1 5.44772 1.44772 5 2 5ZM0 6C0 4.89543 0.895431 4 2 4H13C14.1046 4 15 4.89543 15 6V9C15 10.1046 14.1046 11 13 11H2C0.89543 11 0 10.1046 0 9V6ZM4.5 6.75C4.08579 6.75 3.75 7.08579 3.75 7.5C3.75 7.91421 4.08579 8.25 4.5 8.25C4.91421 8.25 5.25 7.91421 5.25 7.5C5.25 7.08579 4.91421 6.75 4.5 6.75ZM6.75 7.5C6.75 7.08579 7.08579 6.75 7.5 6.75C7.91421 6.75 8.25 7.08579 8.25 7.5C8.25 7.91421 7.91421 8.25 7.5 8.25C7.08579 8.25 6.75 7.91421 6.75 7.5ZM10.5 6.75C10.0858 6.75 9.75 7.08579 9.75 7.5C9.75 7.91421 10.0858 8.25 10.5 8.25C10.9142 8.25 11.25 7.91421 11.25 7.5C11.25 7.08579 10.9142 6.75 10.5 6.75Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),W0=["color"],H0=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,W0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.28856 0.796908C7.42258 0.734364 7.57742 0.734364 7.71144 0.796908L13.7114 3.59691C13.8875 3.67906 14 3.85574 14 4.05V10.95C14 11.1443 13.8875 11.3209 13.7114 11.4031L7.71144 14.2031C7.57742 14.2656 7.42258 14.2656 7.28856 14.2031L1.28856 11.4031C1.11252 11.3209 1 11.1443 1 10.95V4.05C1 3.85574 1.11252 3.67906 1.28856 3.59691L7.28856 0.796908ZM2 4.80578L7 6.93078V12.9649L2 10.6316V4.80578ZM8 12.9649L13 10.6316V4.80578L8 6.93078V12.9649ZM7.5 6.05672L12.2719 4.02866L7.5 1.80176L2.72809 4.02866L7.5 6.05672Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),V0=["color"],Z0=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,V0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.5 9.125C8.39746 9.125 9.125 8.39746 9.125 7.5C9.125 6.60254 8.39746 5.875 7.5 5.875C6.60254 5.875 5.875 6.60254 5.875 7.5C5.875 8.39746 6.60254 9.125 7.5 9.125ZM7.5 10.125C8.94975 10.125 10.125 8.94975 10.125 7.5C10.125 6.05025 8.94975 4.875 7.5 4.875C6.05025 4.875 4.875 6.05025 4.875 7.5C4.875 8.94975 6.05025 10.125 7.5 10.125Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),Q0=["color"],X0=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,Q0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.49999 3.09998C7.27907 3.09998 7.09999 3.27906 7.09999 3.49998C7.09999 3.72089 7.27907 3.89998 7.49999 3.89998H14.5C14.7209 3.89998 14.9 3.72089 14.9 3.49998C14.9 3.27906 14.7209 3.09998 14.5 3.09998H7.49999ZM7.49998 5.1C7.27907 5.1 7.09998 5.27908 7.09998 5.5C7.09998 5.72091 7.27907 5.9 7.49998 5.9H14.5C14.7209 5.9 14.9 5.72091 14.9 5.5C14.9 5.27908 14.7209 5.1 14.5 5.1H7.49998ZM7.1 7.5C7.1 7.27908 7.27909 7.1 7.5 7.1H14.5C14.7209 7.1 14.9 7.27908 14.9 7.5C14.9 7.72091 14.7209 7.9 14.5 7.9H7.5C7.27909 7.9 7.1 7.72091 7.1 7.5ZM7.49998 9.1C7.27907 9.1 7.09998 9.27908 7.09998 9.5C7.09998 9.72091 7.27907 9.9 7.49998 9.9H14.5C14.7209 9.9 14.9 9.72091 14.9 9.5C14.9 9.27908 14.7209 9.1 14.5 9.1H7.49998ZM7.09998 11.5C7.09998 11.2791 7.27907 11.1 7.49998 11.1H14.5C14.7209 11.1 14.9 11.2791 14.9 11.5C14.9 11.7209 14.7209 11.9 14.5 11.9H7.49998C7.27907 11.9 7.09998 11.7209 7.09998 11.5ZM2.5 9.25003L5 6.00003H0L2.5 9.25003Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),Y0=["color"],J0=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,Y0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),K0=["color"],q0=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,K0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),$0=["color"],Wl=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,$0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),eh=["color"],th=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,eh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M5.49998 0.5C5.49998 0.223858 5.72383 0 5.99998 0H7.49998H8.99998C9.27612 0 9.49998 0.223858 9.49998 0.5C9.49998 0.776142 9.27612 1 8.99998 1H7.99998V2.11922C9.09832 2.20409 10.119 2.56622 10.992 3.13572C11.0116 3.10851 11.0336 3.08252 11.058 3.05806L12.058 2.05806C12.3021 1.81398 12.6978 1.81398 12.9419 2.05806C13.186 2.30214 13.186 2.69786 12.9419 2.94194L11.967 3.91682C13.1595 5.07925 13.9 6.70314 13.9 8.49998C13.9 12.0346 11.0346 14.9 7.49998 14.9C3.96535 14.9 1.09998 12.0346 1.09998 8.49998C1.09998 5.13361 3.69904 2.3743 6.99998 2.11922V1H5.99998C5.72383 1 5.49998 0.776142 5.49998 0.5ZM2.09998 8.49998C2.09998 5.51764 4.51764 3.09998 7.49998 3.09998C10.4823 3.09998 12.9 5.51764 12.9 8.49998C12.9 11.4823 10.4823 13.9 7.49998 13.9C4.51764 13.9 2.09998 11.4823 2.09998 8.49998ZM7.49998 8.49998V4.09998C5.06992 4.09998 3.09998 6.06992 3.09998 8.49998C3.09998 10.93 5.06992 12.9 7.49998 12.9C8.715 12.9 9.815 12.4075 10.6112 11.6112L7.49998 8.49998Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),nh=["color"],rh=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,nh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.75432 0.819537C7.59742 0.726821 7.4025 0.726821 7.24559 0.819537L1.74559 4.06954C1.59336 4.15949 1.49996 4.32317 1.49996 4.5C1.49996 4.67683 1.59336 4.84051 1.74559 4.93046L7.24559 8.18046C7.4025 8.27318 7.59742 8.27318 7.75432 8.18046L13.2543 4.93046C13.4066 4.84051 13.5 4.67683 13.5 4.5C13.5 4.32317 13.4066 4.15949 13.2543 4.06954L7.75432 0.819537ZM7.49996 7.16923L2.9828 4.5L7.49996 1.83077L12.0171 4.5L7.49996 7.16923ZM1.5695 7.49564C1.70998 7.2579 2.01659 7.17906 2.25432 7.31954L7.49996 10.4192L12.7456 7.31954C12.9833 7.17906 13.2899 7.2579 13.4304 7.49564C13.5709 7.73337 13.4921 8.03998 13.2543 8.18046L7.75432 11.4305C7.59742 11.5232 7.4025 11.5232 7.24559 11.4305L1.74559 8.18046C1.50786 8.03998 1.42901 7.73337 1.5695 7.49564ZM1.56949 10.4956C1.70998 10.2579 2.01658 10.1791 2.25432 10.3195L7.49996 13.4192L12.7456 10.3195C12.9833 10.1791 13.2899 10.2579 13.4304 10.4956C13.5709 10.7334 13.4921 11.04 13.2543 11.1805L7.75432 14.4305C7.59742 14.5232 7.4025 14.5232 7.24559 14.4305L1.74559 11.1805C1.50785 11.04 1.42901 10.7334 1.56949 10.4956Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),ih=["color"],oh=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,ih);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M8.69667 0.0403541C8.90859 0.131038 9.03106 0.354857 8.99316 0.582235L8.0902 6.00001H12.5C12.6893 6.00001 12.8625 6.10701 12.9472 6.27641C13.0319 6.4458 13.0136 6.6485 12.8999 6.80001L6.89997 14.8C6.76167 14.9844 6.51521 15.0503 6.30328 14.9597C6.09135 14.869 5.96888 14.6452 6.00678 14.4178L6.90974 9H2.49999C2.31061 9 2.13748 8.893 2.05278 8.72361C1.96809 8.55422 1.98636 8.35151 2.09999 8.2L8.09997 0.200038C8.23828 0.0156255 8.48474 -0.0503301 8.69667 0.0403541ZM3.49999 8.00001H7.49997C7.64695 8.00001 7.78648 8.06467 7.88148 8.17682C7.97648 8.28896 8.01733 8.43723 7.99317 8.5822L7.33027 12.5596L11.5 7.00001H7.49997C7.353 7.00001 7.21347 6.93534 7.11846 6.8232C7.02346 6.71105 6.98261 6.56279 7.00678 6.41781L7.66968 2.44042L3.49999 8.00001Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),ah=["color"],lh=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,ah);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M1.49988 2.00012C1.77602 2.00012 1.99988 1.77626 1.99988 1.50012C1.99988 1.22398 1.77602 1.00012 1.49988 1.00012C1.22374 1.00012 0.999878 1.22398 0.999878 1.50012C0.999878 1.77626 1.22374 2.00012 1.49988 2.00012ZM4.49988 2.00012C4.77602 2.00012 4.99988 1.77626 4.99988 1.50012C4.99988 1.22398 4.77602 1.00012 4.49988 1.00012C4.22374 1.00012 3.99988 1.22398 3.99988 1.50012C3.99988 1.77626 4.22374 2.00012 4.49988 2.00012ZM7.99988 1.50012C7.99988 1.77626 7.77602 2.00012 7.49988 2.00012C7.22374 2.00012 6.99988 1.77626 6.99988 1.50012C6.99988 1.22398 7.22374 1.00012 7.49988 1.00012C7.77602 1.00012 7.99988 1.22398 7.99988 1.50012ZM10.4999 2.00012C10.776 2.00012 10.9999 1.77626 10.9999 1.50012C10.9999 1.22398 10.776 1.00012 10.4999 1.00012C10.2237 1.00012 9.99988 1.22398 9.99988 1.50012C9.99988 1.77626 10.2237 2.00012 10.4999 2.00012ZM13.9999 1.50012C13.9999 1.77626 13.776 2.00012 13.4999 2.00012C13.2237 2.00012 12.9999 1.77626 12.9999 1.50012C12.9999 1.22398 13.2237 1.00012 13.4999 1.00012C13.776 1.00012 13.9999 1.22398 13.9999 1.50012ZM1.49988 14.0001C1.77602 14.0001 1.99988 13.7763 1.99988 13.5001C1.99988 13.224 1.77602 13.0001 1.49988 13.0001C1.22374 13.0001 0.999878 13.224 0.999878 13.5001C0.999878 13.7763 1.22374 14.0001 1.49988 14.0001ZM1.99988 10.5001C1.99988 10.7763 1.77602 11.0001 1.49988 11.0001C1.22374 11.0001 0.999878 10.7763 0.999878 10.5001C0.999878 10.224 1.22374 10.0001 1.49988 10.0001C1.77602 10.0001 1.99988 10.224 1.99988 10.5001ZM1.49988 8.00012C1.77602 8.00012 1.99988 7.77626 1.99988 7.50012C1.99988 7.22398 1.77602 7.00012 1.49988 7.00012C1.22374 7.00012 0.999878 7.22398 0.999878 7.50012C0.999878 7.77626 1.22374 8.00012 1.49988 8.00012ZM1.99988 4.50012C1.99988 4.77626 1.77602 5.00012 1.49988 5.00012C1.22374 5.00012 0.999878 4.77626 0.999878 4.50012C0.999878 4.22398 1.22374 4.00012 1.49988 4.00012C1.77602 4.00012 1.99988 4.22398 1.99988 4.50012ZM13.4999 11.0001C13.776 11.0001 13.9999 10.7763 13.9999 10.5001C13.9999 10.224 13.776 10.0001 13.4999 10.0001C13.2237 10.0001 12.9999 10.224 12.9999 10.5001C12.9999 10.7763 13.2237 11.0001 13.4999 11.0001ZM13.9999 7.50012C13.9999 7.77626 13.776 8.00012 13.4999 8.00012C13.2237 8.00012 12.9999 7.77626 12.9999 7.50012C12.9999 7.22398 13.2237 7.00012 13.4999 7.00012C13.776 7.00012 13.9999 7.22398 13.9999 7.50012ZM13.4999 5.00012C13.776 5.00012 13.9999 4.77626 13.9999 4.50012C13.9999 4.22398 13.776 4.00012 13.4999 4.00012C13.2237 4.00012 12.9999 4.22398 12.9999 4.50012C12.9999 4.77626 13.2237 5.00012 13.4999 5.00012ZM4.99988 13.5001C4.99988 13.7763 4.77602 14.0001 4.49988 14.0001C4.22374 14.0001 3.99988 13.7763 3.99988 13.5001C3.99988 13.224 4.22374 13.0001 4.49988 13.0001C4.77602 13.0001 4.99988 13.224 4.99988 13.5001ZM7.49988 14.0001C7.77602 14.0001 7.99988 13.7763 7.99988 13.5001C7.99988 13.224 7.77602 13.0001 7.49988 13.0001C7.22374 13.0001 6.99988 13.224 6.99988 13.5001C6.99988 13.7763 7.22374 14.0001 7.49988 14.0001ZM10.9999 13.5001C10.9999 13.7763 10.776 14.0001 10.4999 14.0001C10.2237 14.0001 9.99988 13.7763 9.99988 13.5001C9.99988 13.224 10.2237 13.0001 10.4999 13.0001C10.776 13.0001 10.9999 13.224 10.9999 13.5001ZM13.4999 14.0001C13.776 14.0001 13.9999 13.7763 13.9999 13.5001C13.9999 13.224 13.776 13.0001 13.4999 13.0001C13.2237 13.0001 12.9999 13.224 12.9999 13.5001C12.9999 13.7763 13.2237 14.0001 13.4999 14.0001ZM3.99988 5.00012C3.99988 4.44784 4.44759 4.00012 4.99988 4.00012H9.99988C10.5522 4.00012 10.9999 4.44784 10.9999 5.00012V10.0001C10.9999 10.5524 10.5522 11.0001 9.99988 11.0001H4.99988C4.44759 11.0001 3.99988 10.5524 3.99988 10.0001V5.00012ZM4.99988 5.00012H9.99988V10.0001H4.99988V5.00012Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),sh=["color"],uh=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,sh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),ch=["color"],fh=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,ch);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M6.04995 2.74998C6.04995 2.44623 5.80371 2.19998 5.49995 2.19998C5.19619 2.19998 4.94995 2.44623 4.94995 2.74998V12.25C4.94995 12.5537 5.19619 12.8 5.49995 12.8C5.80371 12.8 6.04995 12.5537 6.04995 12.25V2.74998ZM10.05 2.74998C10.05 2.44623 9.80371 2.19998 9.49995 2.19998C9.19619 2.19998 8.94995 2.44623 8.94995 2.74998V12.25C8.94995 12.5537 9.19619 12.8 9.49995 12.8C9.80371 12.8 10.05 12.5537 10.05 12.25V2.74998Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),dh=["color"],hh=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,dh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M6.85357 3.85355L7.65355 3.05353C8.2981 2.40901 9.42858 1.96172 10.552 1.80125C11.1056 1.72217 11.6291 1.71725 12.0564 1.78124C12.4987 1.84748 12.7698 1.97696 12.8965 2.10357C13.0231 2.23018 13.1526 2.50125 13.2188 2.94357C13.2828 3.37086 13.2779 3.89439 13.1988 4.44801C13.0383 5.57139 12.591 6.70188 11.9464 7.34645L7.49999 11.7929L6.35354 10.6465C6.15827 10.4512 5.84169 10.4512 5.64643 10.6465C5.45117 10.8417 5.45117 11.1583 5.64643 11.3536L7.14644 12.8536C7.34171 13.0488 7.65829 13.0488 7.85355 12.8536L8.40073 12.3064L9.57124 14.2572C9.65046 14.3893 9.78608 14.4774 9.9389 14.4963C10.0917 14.5151 10.2447 14.4624 10.3535 14.3536L12.3535 12.3536C12.4648 12.2423 12.5172 12.0851 12.495 11.9293L12.0303 8.67679L12.6536 8.05355C13.509 7.19808 14.0117 5.82855 14.1887 4.58943C14.2784 3.9618 14.2891 3.33847 14.2078 2.79546C14.1287 2.26748 13.9519 1.74482 13.6035 1.39645C13.2552 1.04809 12.7325 0.871332 12.2045 0.792264C11.6615 0.710945 11.0382 0.721644 10.4105 0.8113C9.17143 0.988306 7.80189 1.491 6.94644 2.34642L6.32322 2.96968L3.07071 2.50504C2.91492 2.48278 2.75773 2.53517 2.64645 2.64646L0.646451 4.64645C0.537579 4.75533 0.484938 4.90829 0.50375 5.0611C0.522563 5.21391 0.61073 5.34954 0.742757 5.42876L2.69364 6.59928L2.14646 7.14645C2.0527 7.24022 2.00002 7.3674 2.00002 7.50001C2.00002 7.63261 2.0527 7.75979 2.14646 7.85356L3.64647 9.35356C3.84173 9.54883 4.15831 9.54883 4.35357 9.35356C4.54884 9.1583 4.54884 8.84172 4.35357 8.64646L3.20712 7.50001L3.85357 6.85356L6.85357 3.85355ZM10.0993 13.1936L9.12959 11.5775L11.1464 9.56067L11.4697 11.8232L10.0993 13.1936ZM3.42251 5.87041L5.43935 3.85356L3.17678 3.53034L1.80638 4.90074L3.42251 5.87041ZM2.35356 10.3535C2.54882 10.1583 2.54882 9.8417 2.35356 9.64644C2.1583 9.45118 1.84171 9.45118 1.64645 9.64644L0.646451 10.6464C0.451188 10.8417 0.451188 11.1583 0.646451 11.3535C0.841713 11.5488 1.1583 11.5488 1.35356 11.3535L2.35356 10.3535ZM3.85358 11.8536C4.04884 11.6583 4.04885 11.3417 3.85359 11.1465C3.65833 10.9512 3.34175 10.9512 3.14648 11.1465L1.14645 13.1464C0.95119 13.3417 0.951187 13.6583 1.14645 13.8535C1.34171 14.0488 1.65829 14.0488 1.85355 13.8536L3.85358 11.8536ZM5.35356 13.3535C5.54882 13.1583 5.54882 12.8417 5.35356 12.6464C5.1583 12.4512 4.84171 12.4512 4.64645 12.6464L3.64645 13.6464C3.45119 13.8417 3.45119 14.1583 3.64645 14.3535C3.84171 14.5488 4.1583 14.5488 4.35356 14.3535L5.35356 13.3535ZM9.49997 6.74881C10.1897 6.74881 10.7488 6.1897 10.7488 5.5C10.7488 4.8103 10.1897 4.25118 9.49997 4.25118C8.81026 4.25118 8.25115 4.8103 8.25115 5.5C8.25115 6.1897 8.81026 6.74881 9.49997 6.74881Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),ph=["color"],vh=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,ph);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M0.5 4C0.223858 4 0 4.22386 0 4.5V10.5C0 10.7761 0.223858 11 0.5 11H14.5C14.7761 11 15 10.7761 15 10.5V4.5C15 4.22386 14.7761 4 14.5 4H0.5ZM1 10V5H2.075V7.5C2.075 7.73472 2.26528 7.925 2.5 7.925C2.73472 7.925 2.925 7.73472 2.925 7.5V5H4.075V6.5C4.075 6.73472 4.26528 6.925 4.5 6.925C4.73472 6.925 4.925 6.73472 4.925 6.5V5H6.075V6.5C6.075 6.73472 6.26528 6.925 6.5 6.925C6.73472 6.925 6.925 6.73472 6.925 6.5V5H8.075V7.5C8.075 7.73472 8.26528 7.925 8.5 7.925C8.73472 7.925 8.925 7.73472 8.925 7.5V5H10.075V6.5C10.075 6.73472 10.2653 6.925 10.5 6.925C10.7347 6.925 10.925 6.73472 10.925 6.5V5H12.075V6.5C12.075 6.73472 12.2653 6.925 12.5 6.925C12.7347 6.925 12.925 6.73472 12.925 6.5V5H14V10H1Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),mh=["color"],gh=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,mh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),yh=["color"],yf=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,yh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:v}))}),xh=["color"],xf=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,xh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:v}))}),wh=["color"],wf=P.forwardRef(function(a,n){var c=a.color,v=c===void 0?"currentColor":c,i=gt(a,wh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.49998 1L6.92321 2.00307L1.17498 12L0.599976 13H1.7535H13.2464H14.4L13.825 12L8.07674 2.00307L7.49998 1ZM7.49998 3.00613L2.3285 12H12.6714L7.49998 3.00613Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))});function Sh(a,n){if(typeof a!="object"||a===null)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var v=c.call(a,n||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(a)}function Ch(a){var n=Sh(a,"string");return typeof n=="symbol"?n:String(n)}function _h(a,n,c){return n=Ch(n),n in a?Object.defineProperty(a,n,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[n]=c,a}function mc(a,n){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(a);n&&(v=v.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),c.push.apply(c,v)}return c}function Hl(a){for(var n=1;n(a==null?void 0:a.reduce((n,c)=>n+c,0))/a.length;class Eh{constructor(n={}){this.names=[""],this.finished=[],this.gl=void 0,this.extension=void 0,this.query=void 0,this.paused=!1,this.overClock=!1,this.queryHasResult=!1,this.queryCreated=!1,this.isWebGL2=!0,this.memAccums=[],this.gpuAccums=[],this.activeAccums=[],this.logsAccums={mem:[],gpu:[],cpu:[],fps:[],fpsFixed:[]},this.fpsChart=[],this.gpuChart=[],this.cpuChart=[],this.memChart=[],this.paramLogger=()=>{},this.glFinish=()=>{},this.chartLogger=()=>{},this.chartLen=60,this.maxMemory=1500,this.chartHz=10,this.startCpuProfiling=!1,this.lastCalculateFixed=0,this.chartFrame=0,this.gpuTimeProcess=0,this.chartTime=0,this.activeQueries=0,this.circularId=0,this.detected=0,this.frameId=0,this.rafId=0,this.idleCbId=0,this.checkQueryId=0,this.uuid=void 0,this.currentCpu=0,this.currentMem=0,this.paramFrame=0,this.paramTime=0,this.now=()=>{},this.t0=0,window.GLPerf=window.GLPerf||{},Object.assign(this,n),this.fpsChart=new Array(this.chartLen).fill(0),this.gpuChart=new Array(this.chartLen).fill(0),this.cpuChart=new Array(this.chartLen).fill(0),this.memChart=new Array(this.chartLen).fill(0),this.now=()=>window.performance&&window.performance.now?window.performance.now():Date.now(),this.initGpu(),this.is120hz()}initGpu(){this.uuid=kc.generateUUID(),this.gl&&(this.isWebGL2=!0,this.extension||(this.extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")),this.extension===null&&(this.isWebGL2=!1))}is120hz(){let n=0;const c=v=>{++n<20?this.rafId=window.requestAnimationFrame(c):(this.detected=Math.ceil(1e3*n/(v-this.t0)/70),window.cancelAnimationFrame(this.rafId)),this.t0||(this.t0=v)};this.rafId=window.requestAnimationFrame(c)}addUI(n){this.names.indexOf(n)===-1&&(this.names.push(n),this.gpuAccums.push(0),this.activeAccums.push(!1))}nextFps(n){const c=16.666666666666668,v=c-n.timeRemaining(),i=c*Pn.fpsLimit/10/v;i<0||(Pn.value=i,Pn.isOverLimit<25?Pn.isOverLimit++:Ge.setState({overclockingFps:!0}))}nextFrame(n){this.frameId++;const c=n||this.now();let v=c-this.paramTime,i=0;if(this.frameId<=1)this.paramFrame=this.frameId,this.paramTime=c;else if(c>=this.paramTime){this.maxMemory=window.performance.memory?window.performance.memory.jsHeapSizeLimit/1048576:0;const r=this.frameId-this.paramFrame,s=r*1e3/v,f=Ge.getState().overclockingFps?Pn.value:s;if(i=this.isWebGL2?this.gpuAccums[0]:this.gpuAccums[0]/v,this.isWebGL2?this.gpuAccums[0]=0:Promise.all(this.finished).then(()=>{this.gpuAccums[0]=0,this.finished=[]}),this.currentMem=Math.round(window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize/1048576:0),window.performance&&this.startCpuProfiling){window.performance.mark("cpu-finished");const u=performance.measure("cpu-duration","cpu-started","cpu-finished");this.currentCpu=u.duration,this.logsAccums.cpu.push(this.currentCpu),this.startCpuProfiling=!1}this.logsAccums.mem.push(this.currentMem),this.logsAccums.fpsFixed.push(s),this.logsAccums.fps.push(f),this.logsAccums.gpu.push(i),this.overClock&&typeof window.requestIdleCallback<"u"&&(Pn.isOverLimit>0&&f>s?Pn.isOverLimit--:Ge.getState().overclockingFps&&Ge.setState({overclockingFps:!1})),c>=this.paramTime+180&&(this.paramLogger({cpu:to(this.logsAccums.cpu),gpu:to(this.logsAccums.gpu),mem:to(this.logsAccums.mem),fps:to(this.logsAccums.fps),duration:Math.round(v),maxMemory:this.maxMemory,frameCount:r}),this.logsAccums.mem=[],this.logsAccums.fps=[],this.logsAccums.gpu=[],this.logsAccums.cpu=[],this.paramFrame=this.frameId,this.paramTime=c),this.overClock&&c-this.lastCalculateFixed>=2*1e3&&(this.lastCalculateFixed=n,Pn.fpsLimit=Math.round(to(this.logsAccums.fpsFixed)/10)*100,Ge.setState({fpsLimit:Pn.fpsLimit/10}),this.logsAccums.fpsFixed=[],this.paramFrame=this.frameId,this.paramTime=c)}if(!this.detected||!this.chartFrame)this.chartFrame=this.frameId,this.chartTime=c,this.circularId=0;else{const r=c-this.chartTime;let s=this.chartHz*r/1e3;for(;--s>0&&this.detected;){const u=(this.frameId-this.chartFrame)/r*1e3,h=Ge.getState().overclockingFps?Pn.value:u;this.fpsChart[this.circularId%this.chartLen]=h;const d=1e3/this.currentMem,m=this.currentCpu,y=(this.isWebGL2?this.gpuAccums[1]*2:Math.round(this.gpuAccums[1]/v*100))+4;y>0&&(this.gpuChart[this.circularId%this.chartLen]=y),m>0&&(this.cpuChart[this.circularId%this.chartLen]=m),d>0&&(this.memChart[this.circularId%this.chartLen]=d);for(let x=0;x0&&(i||this.activeAccums.forEach((u,h)=>{this.gpuAccums[h]=f}))}}(v||!this.query)&&(this.queryCreated=!0,this.query=n.createQuery(),n.beginQuery(c.TIME_ELAPSED_EXT,this.query))}}endGpu(){const n=this.extension,c=this.gl;this.isWebGL2&&this.queryCreated&&c.getQuery(n.TIME_ELAPSED_EXT,c.CURRENT_QUERY)&&c.endQuery(n.TIME_ELAPSED_EXT)}begin(n){this.startGpu(),this.updateAccums(n)}end(n){this.endGpu(),this.updateAccums(n)}updateAccums(n){let c=this.names.indexOf(n);c===-1&&(c=this.names.length,this.addUI(n));const v=this.now();this.activeAccums[c]=!this.activeAccums[c],this.t0=v}}const Th=a=>{a.forEach((n,c)=>{const{meshes:v}=n;if(!v)return;let i={total:0,type:"Triangle",data:[]};Object.keys(v).forEach(r=>{const s=v[r],{geometry:f,material:u}=s;let h=f.index;const d=f.attributes.position;if(!d)return;let m=1;u.wireframe===!0&&(m=0);const y=h!==null?h.count:d.count,x=f.drawRange.start*m,C=f.drawRange.count*m,T=x,S=Math.min(y,x+C)-1;let _=1;const w=s.count||1;let M="Triangle",D=0;s.isMesh?u.wireframe===!0?(M="Line",_=_/2):(M="Triangle",_=_/3):s.isLine?(M="Line",s.isLineSegments?_=_/2:s.isLineLoop?_=_:_=_-1):s.isPoints?(M="Point",_=_):s.isSprite&&(M="Triangle",_=_/3);const R=Math.round(Math.max(0,S-T+1)*(_*w));R>D&&(D=R,i.type=M),i.total+=R,i.data.push({drawCount:R,type:M}),s.userData.drawCount={type:M,count:R}}),n.drawCounts=i})},Mh=Ir.prototype.updateMatrixWorld,kh=Ir.prototype.updateWorldMatrix,gc=Ir.prototype.updateMatrix;let gi={value:0},Xn={value:0};const Ph=a=>{let n=""+a;return n=n.match("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"),n!==null},yc=(a,n)=>{a.defines||(a.defines={}),a.defines&&!a.defines.muiPerf&&(a.defines=Object.assign(a.defines||{},{muiPerf:a.uuid}));const c=a.uuid;return n[c]||(n[c]={meshes:{},material:a},a.needsUpdate=!0),a.needsUpdate=!1,c},Lh=a=>a==="muiPerf",Ge=ed(a=>({log:null,paused:!1,triggerProgramsUpdate:0,customData:0,fpsLimit:60,overclockingFps:!1,chart:{data:{fps:[],cpu:[],gpu:[],mem:[]},circularId:0},gl:void 0,objectWithMaterials:null,scene:void 0,programs:new Map,sceneLength:void 0,tab:"infos"})),Sf=({trackCPU:a,overClock:n,chart:c,deepAnalyze:v,matrixUpdate:i})=>{const{gl:r,scene:s}=Ci();Ge.setState({gl:r,scene:s});const f=P.useMemo(()=>{const u=new Eh({trackGPU:!0,overClock:n,chartLen:c?c.length:120,chartHz:c?c.hz:60,gl:r.getContext(),chartLogger:m=>{Ge.setState({chart:m})},paramLogger:m=>{Ge.setState({log:{maxMemory:m.maxMemory,gpu:m.gpu,cpu:m.cpu,mem:m.mem,fps:m.fps,totalTime:m.duration,frameCount:m.frameCount}})}}),h=new Map,d=new Map;return Object.defineProperty(da.prototype,"onBeforeRender",{get(){return(...m)=>{var y;u&&u.begin("profiler"),(y=h.get(this))===null||y===void 0||y(...m)}},set(m){h.set(this,m)},configurable:!0}),Object.defineProperty(da.prototype,"onAfterRender",{get(){return(...m)=>{var y;u&&u.end("profiler"),(y=d.get(this))===null||y===void 0||y(...m)}},set(m){d.set(this,m)},configurable:!0}),u},[]);return P.useEffect(()=>{f&&(f.overClock=n||!1,n===!1&&(Ge.setState({overclockingFps:!1}),Pn.value=0,Pn.isOverLimit=0),f.chartHz=(c==null?void 0:c.hz)||60,f.chartLen=(c==null?void 0:c.length)||120)},[n,f,c==null?void 0:c.length,c==null?void 0:c.hz]),P.useEffect(()=>{i&&(Ir.prototype.updateMatrixWorld=function(){(this.matrixWorldNeedsUpdate||arguments[0])&&gi.value++,Mh.apply(this,arguments)},Ir.prototype.updateWorldMatrix=function(){gi.value++,kh.apply(this,arguments)},Ir.prototype.updateMatrix=function(){Xn.value++,gc.apply(this,arguments)}),r.info.autoReset=!1;let u=null,h=null;if(r.info)return u=r1(function(){Ge.getState().paused&&Ge.setState({paused:!1}),window.performance&&(window.performance.mark("cpu-started"),f.startCpuProfiling=!0),Xn.value-=1,gi.value=0,Xn.value=0,r.info&&r.info.reset()}),h=i1(function(){if(f&&!f.paused&&(f.nextFrame(window.performance.now()),n&&typeof window.requestIdleCallback<"u"&&(f.idleCbId=requestIdleCallback(f.nextFps))),v){var m,y;const x={},C=new Map;s.traverse(function(S){if((S instanceof oo||S instanceof Rd)&&S.material){let _=S.material.uuid;Array.isArray(S.material)&&S.material.length>1?_=yc(S.material[1],x):_=yc(S.material,x),x[_].meshes[S.uuid]=S}}),r==null||(m=r.info)===null||m===void 0||(y=m.programs)===null||y===void 0||y.forEach(T=>{const S=T.cacheKey.split(","),_=S[S.findIndex(Lh)+1];if(Ph(_)&&x[_]){const{material:w,meshes:M}=x[_];C.set(_,{program:T,material:w,meshes:M,drawCounts:{total:0,type:"triangle",data:[]},expand:!1,visible:!0})}}),C.size!==Ge.getState().programs.size&&(Th(C),Ge.setState({programs:C,triggerProgramsUpdate:Ge.getState().triggerProgramsUpdate++}))}}),()=>{f&&(typeof window.cancelIdleCallback<"u"&&window.cancelIdleCallback(f.idleCbId),window.cancelAnimationFrame(f.rafId),window.cancelAnimationFrame(f.checkQueryId)),i&&(Ir.prototype.updateMatrixWorld=gc),u(),h()}},[f,r,a,c,i]),P.useEffect(()=>{const u=o1(function(){return f&&(f.paused=!0,Xn.value=0,gi.value=0,Ge.setState({paused:!0,log:{maxMemory:0,gpu:0,mem:0,cpu:0,fps:0,totalTime:0,frameCount:0}})),!1});return()=>{u()}},[]),null},Uh=_t("div",{position:"fixed",top:0,right:0,zIndex:9999,fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', +`))),{vertexShader:c,fragmentShader:v}}});return n.transparent=!0,Object.defineProperties(n,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),n}const rs=new Ud({color:16777215,side:Xl,transparent:!0}),dc=8421504,hc=new Mc,sa=new st,Ml=new st,$i=[],R0=new st,kl="+x+y";function pc(l){return Array.isArray(l)?l[0]:l}let hf=()=>{const l=new io(new Jl(1,1),rs);return hf=()=>l,l},pf=()=>{const l=new io(new Jl(1,1,32,1),rs);return pf=()=>l,l};const F0={type:"syncstart"},A0={type:"synccomplete"},vf=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],D0=vf.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let mf=class extends io{constructor(){const n=new T0;super(n,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=dc,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=kl,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(n){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(n):(this._isSyncing=!0,this.dispatchEvent(F0),cf({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},c=>{this._isSyncing=!1,this._textRenderInfo=c,this.geometry.updateGlyphs(c.glyphBounds,c.glyphAtlasIndices,c.blockBounds,c.chunkedBounds,c.glyphColors);const v=this._queuedSyncs;v&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{v.forEach(i=>i&&i())})),this.dispatchEvent(A0),n&&n()})))}onBeforeRender(n,c,v,i,r,s){this.sync(),r.isTroikaTextMaterial&&this._prepareForRender(r),r._hadOwnSide=r.hasOwnProperty("side"),this.geometry.setSide(r._actualSide=r.side),r.side=Md}onAfterRender(n,c,v,i,r,s){r._hadOwnSide?r.side=r._actualSide:delete r.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let n=this._derivedMaterial;const c=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=rs.clone());if((!n||n.baseMaterial!==c)&&(n=this._derivedMaterial=U0(c),c.addEventListener("dispose",function v(){c.removeEventListener("dispose",v),n.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let v=n._outlineMtl;return v||(v=n._outlineMtl=Object.create(n,{id:{value:n.id+.1}}),v.isTextOutlineMaterial=!0,v.depthWrite=!1,v.map=null,n.addEventListener("dispose",function i(){n.removeEventListener("dispose",i),v.dispose()})),[v,n]}else return n}set material(n){n&&n.isTroikaTextMaterial?(this._derivedMaterial=n,this._baseMaterial=n.baseMaterial):this._baseMaterial=n}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(n){this.geometry.detail=n}get curveRadius(){return this.geometry.curveRadius}set curveRadius(n){this.geometry.curveRadius=n}get customDepthMaterial(){return pc(this.material).getDepthMaterial()}get customDistanceMaterial(){return pc(this.material).getDistanceMaterial()}_prepareForRender(n){const c=n.isTextOutlineMaterial,v=n.uniforms,i=this.textRenderInfo;if(i){const{sdfTexture:f,blockBounds:u}=i;v.uTroikaSDFTexture.value=f,v.uTroikaSDFTextureSize.value.set(f.image.width,f.image.height),v.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,v.uTroikaSDFExponent.value=i.sdfExponent,v.uTroikaTotalBounds.value.fromArray(u),v.uTroikaUseGlyphColors.value=!c&&!!i.glyphColors;let h=0,d=0,m=0,y,x,C,T=0,S=0;if(c){let{outlineWidth:w,outlineOffsetX:M,outlineOffsetY:D,outlineBlur:R,outlineOpacity:A}=this;h=this._parsePercent(w)||0,d=Math.max(0,this._parsePercent(R)||0),y=A,T=this._parsePercent(M)||0,S=this._parsePercent(D)||0}else m=Math.max(0,this._parsePercent(this.strokeWidth)||0),m&&(C=this.strokeColor,v.uTroikaStrokeColor.value.set(C??dc),x=this.strokeOpacity,x==null&&(x=1)),y=this.fillOpacity;v.uTroikaDistanceOffset.value=h,v.uTroikaPositionOffset.value.set(T,S),v.uTroikaBlurRadius.value=d,v.uTroikaStrokeWidth.value=m,v.uTroikaStrokeOpacity.value=x,v.uTroikaFillOpacity.value=y??1,v.uTroikaCurveRadius.value=this.curveRadius||0;let _=this.clipRect;if(_&&Array.isArray(_)&&_.length===4)v.uTroikaClipRect.value.fromArray(_);else{const w=(this.fontSize||.1)*100;v.uTroikaClipRect.value.set(u[0]-w,u[1]-w,u[2]+w,u[3]+w)}this.geometry.applyClipRect(v.uTroikaClipRect.value)}v.uTroikaSDFDebug.value=!!this.debugSDF,n.polygonOffset=!!this.depthOffset,n.polygonOffsetFactor=n.polygonOffsetUnits=this.depthOffset||0;const r=c?this.outlineColor||0:this.color;if(r==null)delete n.color;else{const f=n.hasOwnProperty("color")?n.color:n.color=new ro;(r!==f._input||typeof r=="object")&&f.set(f._input=r)}let s=this.orientation||kl;if(s!==n._orientation){let f=v.uTroikaOrient.value;s=s.replace(/[^-+xyz]/g,"");let u=s!==kl&&s.match(/^([-+])([xyz])([-+])([xyz])$/);if(u){let[,h,d,m,y]=u;sa.set(0,0,0)[d]=h==="-"?1:-1,Ml.set(0,0,0)[y]=m==="-"?-1:1,hc.lookAt(R0,sa.cross(Ml),Ml),f.setFromMatrix4(hc)}else f.identity();n._orientation=s}}_parsePercent(n){if(typeof n=="string"){let c=n.match(/^(-?[\d.]+)%$/),v=c?parseFloat(c[1]):NaN;n=(isNaN(v)?0:v/100)*this.fontSize}return n}localPositionToTextCoords(n,c=new Nr){c.copy(n);const v=this.curveRadius;return v&&(c.x=Math.atan2(n.x,Math.abs(v)-Math.abs(n.z))*Math.abs(v)),c}worldPositionToTextCoords(n,c=new Nr){return sa.copy(n),this.localPositionToTextCoords(this.worldToLocal(sa),c)}raycast(n,c){const{textRenderInfo:v,curveRadius:i}=this;if(v){const r=v.blockBounds,s=i?pf():hf(),f=s.geometry,{position:u,uv:h}=f.attributes;for(let d=0;d{this[v]=n[v]}),this}clone(){return new this.constructor().copy(this)}};vf.forEach(l=>{const n="_private_"+l;Object.defineProperty(mf.prototype,l,{get(){return this[n]},set(c){c!==this[n]&&(this[n]=c,this._needsSync=!0)}})});function O0(l,n,c=(v,i)=>v===i){if(l===n)return!0;if(!l||!n)return!1;const v=l.length;if(n.length!==v)return!1;for(let i=0;ii.response=r).then(()=>{v.lifespan&&v.lifespan>0&&setTimeout(()=>{const r=ua.indexOf(i);r!==-1&&ua.splice(r,1)},v.lifespan)}).catch(r=>i.error=r)};if(ua.push(i),!c)throw i.promise}const I0=(l,n,c)=>z0(l,n,!1,c),vc=P.forwardRef(({anchorX:l="center",anchorY:n="middle",font:c,fontSize:v=1,children:i,characters:r,onSync:s,...f},u)=>{const h=Si(({invalidate:x})=>x),[d]=P.useState(()=>new mf),[m,y]=P.useMemo(()=>{const x=[];let C="";return P.Children.forEach(i,T=>{typeof T=="string"||typeof T=="number"?C+=T:x.push(T)}),[x,C]},[i]);return I0(()=>new Promise(x=>g0({font:c,characters:r},x)),["troika-text",c,r]),P.useLayoutEffect(()=>void d.sync(()=>{h(),s&&s(d)})),P.useEffect(()=>()=>d.dispose(),[d]),P.createElement("primitive",yi({object:d,ref:u,font:c,text:y,anchorX:l,anchorY:n,fontSize:v},f),m)});function gt(l,n){if(l==null)return{};var c={},v=Object.keys(l),i,r;for(r=0;r=0)&&(c[i]=l[i]);return c}var j0=["color"],gf=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,j0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M0 1.5C0 1.22386 0.223858 1 0.5 1H2.5C2.77614 1 3 1.22386 3 1.5C3 1.77614 2.77614 2 2.5 2H0.5C0.223858 2 0 1.77614 0 1.5ZM4 1.5C4 1.22386 4.22386 1 4.5 1H14.5C14.7761 1 15 1.22386 15 1.5C15 1.77614 14.7761 2 14.5 2H4.5C4.22386 2 4 1.77614 4 1.5ZM4 4.5C4 4.22386 4.22386 4 4.5 4H11.5C11.7761 4 12 4.22386 12 4.5C12 4.77614 11.7761 5 11.5 5H4.5C4.22386 5 4 4.77614 4 4.5ZM0 7.5C0 7.22386 0.223858 7 0.5 7H2.5C2.77614 7 3 7.22386 3 7.5C3 7.77614 2.77614 8 2.5 8H0.5C0.223858 8 0 7.77614 0 7.5ZM4 7.5C4 7.22386 4.22386 7 4.5 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H4.5C4.22386 8 4 7.77614 4 7.5ZM4 10.5C4 10.2239 4.22386 10 4.5 10H11.5C11.7761 10 12 10.2239 12 10.5C12 10.7761 11.7761 11 11.5 11H4.5C4.22386 11 4 10.7761 4 10.5ZM0 13.5C0 13.2239 0.223858 13 0.5 13H2.5C2.77614 13 3 13.2239 3 13.5C3 13.7761 2.77614 14 2.5 14H0.5C0.223858 14 0 13.7761 0 13.5ZM4 13.5C4 13.2239 4.22386 13 4.5 13H14.5C14.7761 13 15 13.2239 15 13.5C15 13.7761 14.7761 14 14.5 14H4.5C4.22386 14 4 13.7761 4 13.5Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),b0=["color"],B0=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,b0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M11.5 1C11.7761 1 12 1.22386 12 1.5V13.5C12 13.7761 11.7761 14 11.5 14C11.2239 14 11 13.7761 11 13.5V1.5C11 1.22386 11.2239 1 11.5 1ZM9.5 3C9.77614 3 10 3.22386 10 3.5V13.5C10 13.7761 9.77614 14 9.5 14C9.22386 14 9 13.7761 9 13.5V3.5C9 3.22386 9.22386 3 9.5 3ZM13.5 3C13.7761 3 14 3.22386 14 3.5V13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5V3.5C13 3.22386 13.2239 3 13.5 3ZM5.5 4C5.77614 4 6 4.22386 6 4.5V13.5C6 13.7761 5.77614 14 5.5 14C5.22386 14 5 13.7761 5 13.5V4.5C5 4.22386 5.22386 4 5.5 4ZM1.5 5C1.77614 5 2 5.22386 2 5.5V13.5C2 13.7761 1.77614 14 1.5 14C1.22386 14 1 13.7761 1 13.5V5.5C1 5.22386 1.22386 5 1.5 5ZM7.5 5C7.77614 5 8 5.22386 8 5.5V13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5V5.5C7 5.22386 7.22386 5 7.5 5ZM3.5 7C3.77614 7 4 7.22386 4 7.5V13.5C4 13.7761 3.77614 14 3.5 14C3.22386 14 3 13.7761 3 13.5V7.5C3 7.22386 3.22386 7 3.5 7Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),N0=["color"],G0=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,N0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M2 5H13C13.5523 5 14 5.44772 14 6V9C14 9.55228 13.5523 10 13 10H2C1.44772 10 1 9.55228 1 9V6C1 5.44772 1.44772 5 2 5ZM0 6C0 4.89543 0.895431 4 2 4H13C14.1046 4 15 4.89543 15 6V9C15 10.1046 14.1046 11 13 11H2C0.89543 11 0 10.1046 0 9V6ZM4.5 6.75C4.08579 6.75 3.75 7.08579 3.75 7.5C3.75 7.91421 4.08579 8.25 4.5 8.25C4.91421 8.25 5.25 7.91421 5.25 7.5C5.25 7.08579 4.91421 6.75 4.5 6.75ZM6.75 7.5C6.75 7.08579 7.08579 6.75 7.5 6.75C7.91421 6.75 8.25 7.08579 8.25 7.5C8.25 7.91421 7.91421 8.25 7.5 8.25C7.08579 8.25 6.75 7.91421 6.75 7.5ZM10.5 6.75C10.0858 6.75 9.75 7.08579 9.75 7.5C9.75 7.91421 10.0858 8.25 10.5 8.25C10.9142 8.25 11.25 7.91421 11.25 7.5C11.25 7.08579 10.9142 6.75 10.5 6.75Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),W0=["color"],H0=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,W0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.28856 0.796908C7.42258 0.734364 7.57742 0.734364 7.71144 0.796908L13.7114 3.59691C13.8875 3.67906 14 3.85574 14 4.05V10.95C14 11.1443 13.8875 11.3209 13.7114 11.4031L7.71144 14.2031C7.57742 14.2656 7.42258 14.2656 7.28856 14.2031L1.28856 11.4031C1.11252 11.3209 1 11.1443 1 10.95V4.05C1 3.85574 1.11252 3.67906 1.28856 3.59691L7.28856 0.796908ZM2 4.80578L7 6.93078V12.9649L2 10.6316V4.80578ZM8 12.9649L13 10.6316V4.80578L8 6.93078V12.9649ZM7.5 6.05672L12.2719 4.02866L7.5 1.80176L2.72809 4.02866L7.5 6.05672Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),V0=["color"],Z0=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,V0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.5 9.125C8.39746 9.125 9.125 8.39746 9.125 7.5C9.125 6.60254 8.39746 5.875 7.5 5.875C6.60254 5.875 5.875 6.60254 5.875 7.5C5.875 8.39746 6.60254 9.125 7.5 9.125ZM7.5 10.125C8.94975 10.125 10.125 8.94975 10.125 7.5C10.125 6.05025 8.94975 4.875 7.5 4.875C6.05025 4.875 4.875 6.05025 4.875 7.5C4.875 8.94975 6.05025 10.125 7.5 10.125Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),Q0=["color"],X0=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,Q0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.49999 3.09998C7.27907 3.09998 7.09999 3.27906 7.09999 3.49998C7.09999 3.72089 7.27907 3.89998 7.49999 3.89998H14.5C14.7209 3.89998 14.9 3.72089 14.9 3.49998C14.9 3.27906 14.7209 3.09998 14.5 3.09998H7.49999ZM7.49998 5.1C7.27907 5.1 7.09998 5.27908 7.09998 5.5C7.09998 5.72091 7.27907 5.9 7.49998 5.9H14.5C14.7209 5.9 14.9 5.72091 14.9 5.5C14.9 5.27908 14.7209 5.1 14.5 5.1H7.49998ZM7.1 7.5C7.1 7.27908 7.27909 7.1 7.5 7.1H14.5C14.7209 7.1 14.9 7.27908 14.9 7.5C14.9 7.72091 14.7209 7.9 14.5 7.9H7.5C7.27909 7.9 7.1 7.72091 7.1 7.5ZM7.49998 9.1C7.27907 9.1 7.09998 9.27908 7.09998 9.5C7.09998 9.72091 7.27907 9.9 7.49998 9.9H14.5C14.7209 9.9 14.9 9.72091 14.9 9.5C14.9 9.27908 14.7209 9.1 14.5 9.1H7.49998ZM7.09998 11.5C7.09998 11.2791 7.27907 11.1 7.49998 11.1H14.5C14.7209 11.1 14.9 11.2791 14.9 11.5C14.9 11.7209 14.7209 11.9 14.5 11.9H7.49998C7.27907 11.9 7.09998 11.7209 7.09998 11.5ZM2.5 9.25003L5 6.00003H0L2.5 9.25003Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),Y0=["color"],J0=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,Y0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),K0=["color"],q0=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,K0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),$0=["color"],Wl=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,$0);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),eh=["color"],th=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,eh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M5.49998 0.5C5.49998 0.223858 5.72383 0 5.99998 0H7.49998H8.99998C9.27612 0 9.49998 0.223858 9.49998 0.5C9.49998 0.776142 9.27612 1 8.99998 1H7.99998V2.11922C9.09832 2.20409 10.119 2.56622 10.992 3.13572C11.0116 3.10851 11.0336 3.08252 11.058 3.05806L12.058 2.05806C12.3021 1.81398 12.6978 1.81398 12.9419 2.05806C13.186 2.30214 13.186 2.69786 12.9419 2.94194L11.967 3.91682C13.1595 5.07925 13.9 6.70314 13.9 8.49998C13.9 12.0346 11.0346 14.9 7.49998 14.9C3.96535 14.9 1.09998 12.0346 1.09998 8.49998C1.09998 5.13361 3.69904 2.3743 6.99998 2.11922V1H5.99998C5.72383 1 5.49998 0.776142 5.49998 0.5ZM2.09998 8.49998C2.09998 5.51764 4.51764 3.09998 7.49998 3.09998C10.4823 3.09998 12.9 5.51764 12.9 8.49998C12.9 11.4823 10.4823 13.9 7.49998 13.9C4.51764 13.9 2.09998 11.4823 2.09998 8.49998ZM7.49998 8.49998V4.09998C5.06992 4.09998 3.09998 6.06992 3.09998 8.49998C3.09998 10.93 5.06992 12.9 7.49998 12.9C8.715 12.9 9.815 12.4075 10.6112 11.6112L7.49998 8.49998Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),nh=["color"],rh=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,nh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.75432 0.819537C7.59742 0.726821 7.4025 0.726821 7.24559 0.819537L1.74559 4.06954C1.59336 4.15949 1.49996 4.32317 1.49996 4.5C1.49996 4.67683 1.59336 4.84051 1.74559 4.93046L7.24559 8.18046C7.4025 8.27318 7.59742 8.27318 7.75432 8.18046L13.2543 4.93046C13.4066 4.84051 13.5 4.67683 13.5 4.5C13.5 4.32317 13.4066 4.15949 13.2543 4.06954L7.75432 0.819537ZM7.49996 7.16923L2.9828 4.5L7.49996 1.83077L12.0171 4.5L7.49996 7.16923ZM1.5695 7.49564C1.70998 7.2579 2.01659 7.17906 2.25432 7.31954L7.49996 10.4192L12.7456 7.31954C12.9833 7.17906 13.2899 7.2579 13.4304 7.49564C13.5709 7.73337 13.4921 8.03998 13.2543 8.18046L7.75432 11.4305C7.59742 11.5232 7.4025 11.5232 7.24559 11.4305L1.74559 8.18046C1.50786 8.03998 1.42901 7.73337 1.5695 7.49564ZM1.56949 10.4956C1.70998 10.2579 2.01658 10.1791 2.25432 10.3195L7.49996 13.4192L12.7456 10.3195C12.9833 10.1791 13.2899 10.2579 13.4304 10.4956C13.5709 10.7334 13.4921 11.04 13.2543 11.1805L7.75432 14.4305C7.59742 14.5232 7.4025 14.5232 7.24559 14.4305L1.74559 11.1805C1.50785 11.04 1.42901 10.7334 1.56949 10.4956Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),ih=["color"],oh=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,ih);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M8.69667 0.0403541C8.90859 0.131038 9.03106 0.354857 8.99316 0.582235L8.0902 6.00001H12.5C12.6893 6.00001 12.8625 6.10701 12.9472 6.27641C13.0319 6.4458 13.0136 6.6485 12.8999 6.80001L6.89997 14.8C6.76167 14.9844 6.51521 15.0503 6.30328 14.9597C6.09135 14.869 5.96888 14.6452 6.00678 14.4178L6.90974 9H2.49999C2.31061 9 2.13748 8.893 2.05278 8.72361C1.96809 8.55422 1.98636 8.35151 2.09999 8.2L8.09997 0.200038C8.23828 0.0156255 8.48474 -0.0503301 8.69667 0.0403541ZM3.49999 8.00001H7.49997C7.64695 8.00001 7.78648 8.06467 7.88148 8.17682C7.97648 8.28896 8.01733 8.43723 7.99317 8.5822L7.33027 12.5596L11.5 7.00001H7.49997C7.353 7.00001 7.21347 6.93534 7.11846 6.8232C7.02346 6.71105 6.98261 6.56279 7.00678 6.41781L7.66968 2.44042L3.49999 8.00001Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),ah=["color"],lh=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,ah);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M1.49988 2.00012C1.77602 2.00012 1.99988 1.77626 1.99988 1.50012C1.99988 1.22398 1.77602 1.00012 1.49988 1.00012C1.22374 1.00012 0.999878 1.22398 0.999878 1.50012C0.999878 1.77626 1.22374 2.00012 1.49988 2.00012ZM4.49988 2.00012C4.77602 2.00012 4.99988 1.77626 4.99988 1.50012C4.99988 1.22398 4.77602 1.00012 4.49988 1.00012C4.22374 1.00012 3.99988 1.22398 3.99988 1.50012C3.99988 1.77626 4.22374 2.00012 4.49988 2.00012ZM7.99988 1.50012C7.99988 1.77626 7.77602 2.00012 7.49988 2.00012C7.22374 2.00012 6.99988 1.77626 6.99988 1.50012C6.99988 1.22398 7.22374 1.00012 7.49988 1.00012C7.77602 1.00012 7.99988 1.22398 7.99988 1.50012ZM10.4999 2.00012C10.776 2.00012 10.9999 1.77626 10.9999 1.50012C10.9999 1.22398 10.776 1.00012 10.4999 1.00012C10.2237 1.00012 9.99988 1.22398 9.99988 1.50012C9.99988 1.77626 10.2237 2.00012 10.4999 2.00012ZM13.9999 1.50012C13.9999 1.77626 13.776 2.00012 13.4999 2.00012C13.2237 2.00012 12.9999 1.77626 12.9999 1.50012C12.9999 1.22398 13.2237 1.00012 13.4999 1.00012C13.776 1.00012 13.9999 1.22398 13.9999 1.50012ZM1.49988 14.0001C1.77602 14.0001 1.99988 13.7763 1.99988 13.5001C1.99988 13.224 1.77602 13.0001 1.49988 13.0001C1.22374 13.0001 0.999878 13.224 0.999878 13.5001C0.999878 13.7763 1.22374 14.0001 1.49988 14.0001ZM1.99988 10.5001C1.99988 10.7763 1.77602 11.0001 1.49988 11.0001C1.22374 11.0001 0.999878 10.7763 0.999878 10.5001C0.999878 10.224 1.22374 10.0001 1.49988 10.0001C1.77602 10.0001 1.99988 10.224 1.99988 10.5001ZM1.49988 8.00012C1.77602 8.00012 1.99988 7.77626 1.99988 7.50012C1.99988 7.22398 1.77602 7.00012 1.49988 7.00012C1.22374 7.00012 0.999878 7.22398 0.999878 7.50012C0.999878 7.77626 1.22374 8.00012 1.49988 8.00012ZM1.99988 4.50012C1.99988 4.77626 1.77602 5.00012 1.49988 5.00012C1.22374 5.00012 0.999878 4.77626 0.999878 4.50012C0.999878 4.22398 1.22374 4.00012 1.49988 4.00012C1.77602 4.00012 1.99988 4.22398 1.99988 4.50012ZM13.4999 11.0001C13.776 11.0001 13.9999 10.7763 13.9999 10.5001C13.9999 10.224 13.776 10.0001 13.4999 10.0001C13.2237 10.0001 12.9999 10.224 12.9999 10.5001C12.9999 10.7763 13.2237 11.0001 13.4999 11.0001ZM13.9999 7.50012C13.9999 7.77626 13.776 8.00012 13.4999 8.00012C13.2237 8.00012 12.9999 7.77626 12.9999 7.50012C12.9999 7.22398 13.2237 7.00012 13.4999 7.00012C13.776 7.00012 13.9999 7.22398 13.9999 7.50012ZM13.4999 5.00012C13.776 5.00012 13.9999 4.77626 13.9999 4.50012C13.9999 4.22398 13.776 4.00012 13.4999 4.00012C13.2237 4.00012 12.9999 4.22398 12.9999 4.50012C12.9999 4.77626 13.2237 5.00012 13.4999 5.00012ZM4.99988 13.5001C4.99988 13.7763 4.77602 14.0001 4.49988 14.0001C4.22374 14.0001 3.99988 13.7763 3.99988 13.5001C3.99988 13.224 4.22374 13.0001 4.49988 13.0001C4.77602 13.0001 4.99988 13.224 4.99988 13.5001ZM7.49988 14.0001C7.77602 14.0001 7.99988 13.7763 7.99988 13.5001C7.99988 13.224 7.77602 13.0001 7.49988 13.0001C7.22374 13.0001 6.99988 13.224 6.99988 13.5001C6.99988 13.7763 7.22374 14.0001 7.49988 14.0001ZM10.9999 13.5001C10.9999 13.7763 10.776 14.0001 10.4999 14.0001C10.2237 14.0001 9.99988 13.7763 9.99988 13.5001C9.99988 13.224 10.2237 13.0001 10.4999 13.0001C10.776 13.0001 10.9999 13.224 10.9999 13.5001ZM13.4999 14.0001C13.776 14.0001 13.9999 13.7763 13.9999 13.5001C13.9999 13.224 13.776 13.0001 13.4999 13.0001C13.2237 13.0001 12.9999 13.224 12.9999 13.5001C12.9999 13.7763 13.2237 14.0001 13.4999 14.0001ZM3.99988 5.00012C3.99988 4.44784 4.44759 4.00012 4.99988 4.00012H9.99988C10.5522 4.00012 10.9999 4.44784 10.9999 5.00012V10.0001C10.9999 10.5524 10.5522 11.0001 9.99988 11.0001H4.99988C4.44759 11.0001 3.99988 10.5524 3.99988 10.0001V5.00012ZM4.99988 5.00012H9.99988V10.0001H4.99988V5.00012Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),sh=["color"],uh=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,sh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),ch=["color"],fh=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,ch);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M6.04995 2.74998C6.04995 2.44623 5.80371 2.19998 5.49995 2.19998C5.19619 2.19998 4.94995 2.44623 4.94995 2.74998V12.25C4.94995 12.5537 5.19619 12.8 5.49995 12.8C5.80371 12.8 6.04995 12.5537 6.04995 12.25V2.74998ZM10.05 2.74998C10.05 2.44623 9.80371 2.19998 9.49995 2.19998C9.19619 2.19998 8.94995 2.44623 8.94995 2.74998V12.25C8.94995 12.5537 9.19619 12.8 9.49995 12.8C9.80371 12.8 10.05 12.5537 10.05 12.25V2.74998Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),dh=["color"],hh=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,dh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M6.85357 3.85355L7.65355 3.05353C8.2981 2.40901 9.42858 1.96172 10.552 1.80125C11.1056 1.72217 11.6291 1.71725 12.0564 1.78124C12.4987 1.84748 12.7698 1.97696 12.8965 2.10357C13.0231 2.23018 13.1526 2.50125 13.2188 2.94357C13.2828 3.37086 13.2779 3.89439 13.1988 4.44801C13.0383 5.57139 12.591 6.70188 11.9464 7.34645L7.49999 11.7929L6.35354 10.6465C6.15827 10.4512 5.84169 10.4512 5.64643 10.6465C5.45117 10.8417 5.45117 11.1583 5.64643 11.3536L7.14644 12.8536C7.34171 13.0488 7.65829 13.0488 7.85355 12.8536L8.40073 12.3064L9.57124 14.2572C9.65046 14.3893 9.78608 14.4774 9.9389 14.4963C10.0917 14.5151 10.2447 14.4624 10.3535 14.3536L12.3535 12.3536C12.4648 12.2423 12.5172 12.0851 12.495 11.9293L12.0303 8.67679L12.6536 8.05355C13.509 7.19808 14.0117 5.82855 14.1887 4.58943C14.2784 3.9618 14.2891 3.33847 14.2078 2.79546C14.1287 2.26748 13.9519 1.74482 13.6035 1.39645C13.2552 1.04809 12.7325 0.871332 12.2045 0.792264C11.6615 0.710945 11.0382 0.721644 10.4105 0.8113C9.17143 0.988306 7.80189 1.491 6.94644 2.34642L6.32322 2.96968L3.07071 2.50504C2.91492 2.48278 2.75773 2.53517 2.64645 2.64646L0.646451 4.64645C0.537579 4.75533 0.484938 4.90829 0.50375 5.0611C0.522563 5.21391 0.61073 5.34954 0.742757 5.42876L2.69364 6.59928L2.14646 7.14645C2.0527 7.24022 2.00002 7.3674 2.00002 7.50001C2.00002 7.63261 2.0527 7.75979 2.14646 7.85356L3.64647 9.35356C3.84173 9.54883 4.15831 9.54883 4.35357 9.35356C4.54884 9.1583 4.54884 8.84172 4.35357 8.64646L3.20712 7.50001L3.85357 6.85356L6.85357 3.85355ZM10.0993 13.1936L9.12959 11.5775L11.1464 9.56067L11.4697 11.8232L10.0993 13.1936ZM3.42251 5.87041L5.43935 3.85356L3.17678 3.53034L1.80638 4.90074L3.42251 5.87041ZM2.35356 10.3535C2.54882 10.1583 2.54882 9.8417 2.35356 9.64644C2.1583 9.45118 1.84171 9.45118 1.64645 9.64644L0.646451 10.6464C0.451188 10.8417 0.451188 11.1583 0.646451 11.3535C0.841713 11.5488 1.1583 11.5488 1.35356 11.3535L2.35356 10.3535ZM3.85358 11.8536C4.04884 11.6583 4.04885 11.3417 3.85359 11.1465C3.65833 10.9512 3.34175 10.9512 3.14648 11.1465L1.14645 13.1464C0.95119 13.3417 0.951187 13.6583 1.14645 13.8535C1.34171 14.0488 1.65829 14.0488 1.85355 13.8536L3.85358 11.8536ZM5.35356 13.3535C5.54882 13.1583 5.54882 12.8417 5.35356 12.6464C5.1583 12.4512 4.84171 12.4512 4.64645 12.6464L3.64645 13.6464C3.45119 13.8417 3.45119 14.1583 3.64645 14.3535C3.84171 14.5488 4.1583 14.5488 4.35356 14.3535L5.35356 13.3535ZM9.49997 6.74881C10.1897 6.74881 10.7488 6.1897 10.7488 5.5C10.7488 4.8103 10.1897 4.25118 9.49997 4.25118C8.81026 4.25118 8.25115 4.8103 8.25115 5.5C8.25115 6.1897 8.81026 6.74881 9.49997 6.74881Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),ph=["color"],vh=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,ph);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M0.5 4C0.223858 4 0 4.22386 0 4.5V10.5C0 10.7761 0.223858 11 0.5 11H14.5C14.7761 11 15 10.7761 15 10.5V4.5C15 4.22386 14.7761 4 14.5 4H0.5ZM1 10V5H2.075V7.5C2.075 7.73472 2.26528 7.925 2.5 7.925C2.73472 7.925 2.925 7.73472 2.925 7.5V5H4.075V6.5C4.075 6.73472 4.26528 6.925 4.5 6.925C4.73472 6.925 4.925 6.73472 4.925 6.5V5H6.075V6.5C6.075 6.73472 6.26528 6.925 6.5 6.925C6.73472 6.925 6.925 6.73472 6.925 6.5V5H8.075V7.5C8.075 7.73472 8.26528 7.925 8.5 7.925C8.73472 7.925 8.925 7.73472 8.925 7.5V5H10.075V6.5C10.075 6.73472 10.2653 6.925 10.5 6.925C10.7347 6.925 10.925 6.73472 10.925 6.5V5H12.075V6.5C12.075 6.73472 12.2653 6.925 12.5 6.925C12.7347 6.925 12.925 6.73472 12.925 6.5V5H14V10H1Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),mh=["color"],gh=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,mh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M2.5 4C2.22386 4 2 4.22386 2 4.5C2 4.77614 2.22386 5 2.5 5H12.5C12.7761 5 13 4.77614 13 4.5C13 4.22386 12.7761 4 12.5 4H2.5ZM2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5ZM2 10.5C2 10.2239 2.22386 10 2.5 10H12.5C12.7761 10 13 10.2239 13 10.5C13 10.7761 12.7761 11 12.5 11H2.5C2.22386 11 2 10.7761 2 10.5Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))}),yh=["color"],yf=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,yh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:v}))}),xh=["color"],xf=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,xh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:v}))}),wh=["color"],wf=P.forwardRef(function(l,n){var c=l.color,v=c===void 0?"currentColor":c,i=gt(l,wh);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:n}),P.createElement("path",{d:"M7.49998 1L6.92321 2.00307L1.17498 12L0.599976 13H1.7535H13.2464H14.4L13.825 12L8.07674 2.00307L7.49998 1ZM7.49998 3.00613L2.3285 12H12.6714L7.49998 3.00613Z",fill:v,fillRule:"evenodd",clipRule:"evenodd"}))});function Sh(l,n){if(typeof l!="object"||l===null)return l;var c=l[Symbol.toPrimitive];if(c!==void 0){var v=c.call(l,n||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(l)}function Ch(l){var n=Sh(l,"string");return typeof n=="symbol"?n:String(n)}function _h(l,n,c){return n=Ch(n),n in l?Object.defineProperty(l,n,{value:c,enumerable:!0,configurable:!0,writable:!0}):l[n]=c,l}function mc(l,n){var c=Object.keys(l);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(l);n&&(v=v.filter(function(i){return Object.getOwnPropertyDescriptor(l,i).enumerable})),c.push.apply(c,v)}return c}function Hl(l){for(var n=1;n(l==null?void 0:l.reduce((n,c)=>n+c,0))/l.length;class Eh{constructor(n={}){this.names=[""],this.finished=[],this.gl=void 0,this.extension=void 0,this.query=void 0,this.paused=!1,this.overClock=!1,this.queryHasResult=!1,this.queryCreated=!1,this.isWebGL2=!0,this.memAccums=[],this.gpuAccums=[],this.activeAccums=[],this.logsAccums={mem:[],gpu:[],cpu:[],fps:[],fpsFixed:[]},this.fpsChart=[],this.gpuChart=[],this.cpuChart=[],this.memChart=[],this.paramLogger=()=>{},this.glFinish=()=>{},this.chartLogger=()=>{},this.chartLen=60,this.maxMemory=1500,this.chartHz=10,this.startCpuProfiling=!1,this.lastCalculateFixed=0,this.chartFrame=0,this.gpuTimeProcess=0,this.chartTime=0,this.activeQueries=0,this.circularId=0,this.detected=0,this.frameId=0,this.rafId=0,this.idleCbId=0,this.checkQueryId=0,this.uuid=void 0,this.currentCpu=0,this.currentMem=0,this.paramFrame=0,this.paramTime=0,this.now=()=>{},this.t0=0,window.GLPerf=window.GLPerf||{},Object.assign(this,n),this.fpsChart=new Array(this.chartLen).fill(0),this.gpuChart=new Array(this.chartLen).fill(0),this.cpuChart=new Array(this.chartLen).fill(0),this.memChart=new Array(this.chartLen).fill(0),this.now=()=>window.performance&&window.performance.now?window.performance.now():Date.now(),this.initGpu(),this.is120hz()}initGpu(){this.uuid=kc.generateUUID(),this.gl&&(this.isWebGL2=!0,this.extension||(this.extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")),this.extension===null&&(this.isWebGL2=!1))}is120hz(){let n=0;const c=v=>{++n<20?this.rafId=window.requestAnimationFrame(c):(this.detected=Math.ceil(1e3*n/(v-this.t0)/70),window.cancelAnimationFrame(this.rafId)),this.t0||(this.t0=v)};this.rafId=window.requestAnimationFrame(c)}addUI(n){this.names.indexOf(n)===-1&&(this.names.push(n),this.gpuAccums.push(0),this.activeAccums.push(!1))}nextFps(n){const c=16.666666666666668,v=c-n.timeRemaining(),i=c*Pn.fpsLimit/10/v;i<0||(Pn.value=i,Pn.isOverLimit<25?Pn.isOverLimit++:Ge.setState({overclockingFps:!0}))}nextFrame(n){this.frameId++;const c=n||this.now();let v=c-this.paramTime,i=0;if(this.frameId<=1)this.paramFrame=this.frameId,this.paramTime=c;else if(c>=this.paramTime){this.maxMemory=window.performance.memory?window.performance.memory.jsHeapSizeLimit/1048576:0;const r=this.frameId-this.paramFrame,s=r*1e3/v,f=Ge.getState().overclockingFps?Pn.value:s;if(i=this.isWebGL2?this.gpuAccums[0]:this.gpuAccums[0]/v,this.isWebGL2?this.gpuAccums[0]=0:Promise.all(this.finished).then(()=>{this.gpuAccums[0]=0,this.finished=[]}),this.currentMem=Math.round(window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize/1048576:0),window.performance&&this.startCpuProfiling){window.performance.mark("cpu-finished");const u=performance.measure("cpu-duration","cpu-started","cpu-finished");this.currentCpu=u.duration,this.logsAccums.cpu.push(this.currentCpu),this.startCpuProfiling=!1}this.logsAccums.mem.push(this.currentMem),this.logsAccums.fpsFixed.push(s),this.logsAccums.fps.push(f),this.logsAccums.gpu.push(i),this.overClock&&typeof window.requestIdleCallback<"u"&&(Pn.isOverLimit>0&&f>s?Pn.isOverLimit--:Ge.getState().overclockingFps&&Ge.setState({overclockingFps:!1})),c>=this.paramTime+180&&(this.paramLogger({cpu:eo(this.logsAccums.cpu),gpu:eo(this.logsAccums.gpu),mem:eo(this.logsAccums.mem),fps:eo(this.logsAccums.fps),duration:Math.round(v),maxMemory:this.maxMemory,frameCount:r}),this.logsAccums.mem=[],this.logsAccums.fps=[],this.logsAccums.gpu=[],this.logsAccums.cpu=[],this.paramFrame=this.frameId,this.paramTime=c),this.overClock&&c-this.lastCalculateFixed>=2*1e3&&(this.lastCalculateFixed=n,Pn.fpsLimit=Math.round(eo(this.logsAccums.fpsFixed)/10)*100,Ge.setState({fpsLimit:Pn.fpsLimit/10}),this.logsAccums.fpsFixed=[],this.paramFrame=this.frameId,this.paramTime=c)}if(!this.detected||!this.chartFrame)this.chartFrame=this.frameId,this.chartTime=c,this.circularId=0;else{const r=c-this.chartTime;let s=this.chartHz*r/1e3;for(;--s>0&&this.detected;){const u=(this.frameId-this.chartFrame)/r*1e3,h=Ge.getState().overclockingFps?Pn.value:u;this.fpsChart[this.circularId%this.chartLen]=h;const d=1e3/this.currentMem,m=this.currentCpu,y=(this.isWebGL2?this.gpuAccums[1]*2:Math.round(this.gpuAccums[1]/v*100))+4;y>0&&(this.gpuChart[this.circularId%this.chartLen]=y),m>0&&(this.cpuChart[this.circularId%this.chartLen]=m),d>0&&(this.memChart[this.circularId%this.chartLen]=d);for(let x=0;x0&&(i||this.activeAccums.forEach((u,h)=>{this.gpuAccums[h]=f}))}}(v||!this.query)&&(this.queryCreated=!0,this.query=n.createQuery(),n.beginQuery(c.TIME_ELAPSED_EXT,this.query))}}endGpu(){const n=this.extension,c=this.gl;this.isWebGL2&&this.queryCreated&&c.getQuery(n.TIME_ELAPSED_EXT,c.CURRENT_QUERY)&&c.endQuery(n.TIME_ELAPSED_EXT)}begin(n){this.startGpu(),this.updateAccums(n)}end(n){this.endGpu(),this.updateAccums(n)}updateAccums(n){let c=this.names.indexOf(n);c===-1&&(c=this.names.length,this.addUI(n));const v=this.now();this.activeAccums[c]=!this.activeAccums[c],this.t0=v}}const Th=l=>{l.forEach((n,c)=>{const{meshes:v}=n;if(!v)return;let i={total:0,type:"Triangle",data:[]};Object.keys(v).forEach(r=>{const s=v[r],{geometry:f,material:u}=s;let h=f.index;const d=f.attributes.position;if(!d)return;let m=1;u.wireframe===!0&&(m=0);const y=h!==null?h.count:d.count,x=f.drawRange.start*m,C=f.drawRange.count*m,T=x,S=Math.min(y,x+C)-1;let _=1;const w=s.count||1;let M="Triangle",D=0;s.isMesh?u.wireframe===!0?(M="Line",_=_/2):(M="Triangle",_=_/3):s.isLine?(M="Line",s.isLineSegments?_=_/2:s.isLineLoop?_=_:_=_-1):s.isPoints?(M="Point",_=_):s.isSprite&&(M="Triangle",_=_/3);const R=Math.round(Math.max(0,S-T+1)*(_*w));R>D&&(D=R,i.type=M),i.total+=R,i.data.push({drawCount:R,type:M}),s.userData.drawCount={type:M,count:R}}),n.drawCounts=i})},Mh=Ir.prototype.updateMatrixWorld,kh=Ir.prototype.updateWorldMatrix,gc=Ir.prototype.updateMatrix;let gi={value:0},Xn={value:0};const Ph=l=>{let n=""+l;return n=n.match("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"),n!==null},yc=(l,n)=>{l.defines||(l.defines={}),l.defines&&!l.defines.muiPerf&&(l.defines=Object.assign(l.defines||{},{muiPerf:l.uuid}));const c=l.uuid;return n[c]||(n[c]={meshes:{},material:l},l.needsUpdate=!0),l.needsUpdate=!1,c},Lh=l=>l==="muiPerf",Ge=ed(l=>({log:null,paused:!1,triggerProgramsUpdate:0,customData:0,fpsLimit:60,overclockingFps:!1,chart:{data:{fps:[],cpu:[],gpu:[],mem:[]},circularId:0},gl:void 0,objectWithMaterials:null,scene:void 0,programs:new Map,sceneLength:void 0,tab:"infos"})),Sf=({trackCPU:l,overClock:n,chart:c,deepAnalyze:v,matrixUpdate:i})=>{const{gl:r,scene:s}=Si();Ge.setState({gl:r,scene:s});const f=P.useMemo(()=>{const u=new Eh({trackGPU:!0,overClock:n,chartLen:c?c.length:120,chartHz:c?c.hz:60,gl:r.getContext(),chartLogger:m=>{Ge.setState({chart:m})},paramLogger:m=>{Ge.setState({log:{maxMemory:m.maxMemory,gpu:m.gpu,cpu:m.cpu,mem:m.mem,fps:m.fps,totalTime:m.duration,frameCount:m.frameCount}})}}),h=new Map,d=new Map;return Object.defineProperty(da.prototype,"onBeforeRender",{get(){return(...m)=>{var y;u&&u.begin("profiler"),(y=h.get(this))===null||y===void 0||y(...m)}},set(m){h.set(this,m)},configurable:!0}),Object.defineProperty(da.prototype,"onAfterRender",{get(){return(...m)=>{var y;u&&u.end("profiler"),(y=d.get(this))===null||y===void 0||y(...m)}},set(m){d.set(this,m)},configurable:!0}),u},[]);return P.useEffect(()=>{f&&(f.overClock=n||!1,n===!1&&(Ge.setState({overclockingFps:!1}),Pn.value=0,Pn.isOverLimit=0),f.chartHz=(c==null?void 0:c.hz)||60,f.chartLen=(c==null?void 0:c.length)||120)},[n,f,c==null?void 0:c.length,c==null?void 0:c.hz]),P.useEffect(()=>{i&&(Ir.prototype.updateMatrixWorld=function(){(this.matrixWorldNeedsUpdate||arguments[0])&&gi.value++,Mh.apply(this,arguments)},Ir.prototype.updateWorldMatrix=function(){gi.value++,kh.apply(this,arguments)},Ir.prototype.updateMatrix=function(){Xn.value++,gc.apply(this,arguments)}),r.info.autoReset=!1;let u=null,h=null;if(r.info)return u=r1(function(){Ge.getState().paused&&Ge.setState({paused:!1}),window.performance&&(window.performance.mark("cpu-started"),f.startCpuProfiling=!0),Xn.value-=1,gi.value=0,Xn.value=0,r.info&&r.info.reset()}),h=i1(function(){if(f&&!f.paused&&(f.nextFrame(window.performance.now()),n&&typeof window.requestIdleCallback<"u"&&(f.idleCbId=requestIdleCallback(f.nextFps))),v){var m,y;const x={},C=new Map;s.traverse(function(S){if((S instanceof io||S instanceof Rd)&&S.material){let _=S.material.uuid;Array.isArray(S.material)&&S.material.length>1?_=yc(S.material[1],x):_=yc(S.material,x),x[_].meshes[S.uuid]=S}}),r==null||(m=r.info)===null||m===void 0||(y=m.programs)===null||y===void 0||y.forEach(T=>{const S=T.cacheKey.split(","),_=S[S.findIndex(Lh)+1];if(Ph(_)&&x[_]){const{material:w,meshes:M}=x[_];C.set(_,{program:T,material:w,meshes:M,drawCounts:{total:0,type:"triangle",data:[]},expand:!1,visible:!0})}}),C.size!==Ge.getState().programs.size&&(Th(C),Ge.setState({programs:C,triggerProgramsUpdate:Ge.getState().triggerProgramsUpdate++}))}}),()=>{f&&(typeof window.cancelIdleCallback<"u"&&window.cancelIdleCallback(f.idleCbId),window.cancelAnimationFrame(f.rafId),window.cancelAnimationFrame(f.checkQueryId)),i&&(Ir.prototype.updateMatrixWorld=gc),u(),h()}},[f,r,l,c,i]),P.useEffect(()=>{const u=o1(function(){return f&&(f.paused=!0,Xn.value=0,gi.value=0,Ge.setState({paused:!0,log:{maxMemory:0,gpu:0,mem:0,cpu:0,fps:0,totalTime:0,frameCount:0}})),!1});return()=>{u()}},[]),null},Uh=_t("div",{position:"fixed",top:0,right:0,zIndex:9999,fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif`,backgroundColor:"rgba(36, 36, 36, .9)",color:"#fff",margin:0,minHeight:"100px",padding:"4px 0","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale",userSelect:"none","&.top-left":{right:"initial",left:0},"&.bottom-left":{right:"initial",top:"initial",bottom:0,left:0,".__perf_toggle":{top:"-20px",bottom:"initial"}},"&.bottom-right":{top:"initial",bottom:0,".__perf_toggle":{top:"-20px",bottom:"initial"}},"&.minimal":{backgroundColor:"rgba(36, 36, 36, .75)"},"*":{margin:"0",padding:"0",border:"0",fontSize:"100%",lineHeight:"1",verticalAlign:"baseline"}}),Pl=_t("small",{position:"absolute",right:0,fontSize:"10px"}),Nt=_t("div",{display:"inline-flex",fontStyle:"normal",padding:0,lineHeight:"13px",fontSize:"14px",width:"62px",position:"relative",pointerEvents:"auto",cursor:"default",fontWeight:500,letterSpacing:"0px",textAlign:"left",height:"29px",whiteSpace:"nowrap",justifyContent:"space-evenly",fontVariantNumeric:"tabular-nums",small:{paddingLeft:"12px"},svg:{padding:0,color:"rgba(145, 145, 145, 0.3)",fontSize:"40px",position:"absolute",zIndex:1,maxHeight:"20px",left:" 50%",marginLeft:"-23px",top:"4px"}}),rn=_t("span",{verticalAlign:"bottom",position:"absolute",bottom:"5px",color:"rgba(101, 197, 188, 1)",textAlign:"right",letterSpacing:"1px",fontSize:"8px",fontWeight:"500",width:"60px"}),Rh=_t("div",{display:"flex"}),Fh=_t("div",{backgroundColor:"#404040",padding:"6px",display:"block",fontSize:"12px",marginBottom:"6px",cursor:"pointer","*":{cursor:"pointer !important"},"> span":{},small:{fontSize:"9px"},"> b":{marginRight:"4px",cursor:"pointer"}}),Ah=_t("div",{height:"66px",overflow:"hidden",position:"absolute",pointerEvents:"none",display:"flex",top:"0px",justifyContent:"center",width:"100%",minWidth:"310px",margin:"0 auto",canvas:{background:"transparent !important",position:"absolute !important"}}),Dh=_t("div",{textAlign:"center",fontWeight:700,fontSize:"12px",lineHeight:"12px",display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"middle",color:"#f1f1f1",padding:"7px",width:"100%",backgroundColor:"rgba(36, 36, 37, 0.8)",zIndex:1,position:"absolute",height:"100%"}),is=_t("div",{pointerEvents:"auto",justifyContent:"center",cursor:"pointer",fontSize:"12px",backgroundColor:"rgb(41, 43, 45)",marginTop:"6px",width:"auto",margin:"0",color:"rgba(145, 145, 145, 1)",textAlign:"center",display:"inline-block",verticalAlign:"middle",padding:"4px 6px","&.__perf_toggle_tab_active":{backgroundColor:"rgb(31 31 31)"},svg:{width:"12px",height:"12px",float:"left"}}),Oh=_t("div",{pointerEvents:"auto",justifyContent:"center",cursor:"pointer",fontSize:"12px",float:"right",backgroundColor:"rgb(41, 43, 45)",width:"auto",margin:"0",color:"rgba(145, 145, 145, 1)",textAlign:"center",display:"inline-block",verticalAlign:"middle",padding:"4px 6px","&.__perf_toggle_tab_active":{backgroundColor:"rgb(31 31 31)"},svg:{width:"12px",height:"12px",float:"left"}}),zh=_t("div",{padding:"4px 6px",fontSize:"12px",pointerEvents:"auto"}),Ih=_t("span",{fontWeight:"bold",letterSpacing:"0.08em",maxWidth:"145px",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"middle",fontSize:"11px",marginRight:"10px"}),jh=_t("div",{maxHeight:"50vh",overflowY:"auto",marginTop:"38px"}),bh=_t("div",{marginTop:"0"}),xc=_t("div",{display:"flex",position:"relative",fontWeight:"bold",color:"#fff",lineHeight:"14px",svg:{marginRight:"4px",display:"inline-block"}}),Cf=_t("ul",{display:"block",position:"relative",paddingLeft:"10px",margin:"6px 6px",img:{maxHeight:"60px",maxWidth:"100%",margin:"6px auto",display:"block"},"&:after":{content:"",position:"absolute",left:"0px",top:"0px",width:"1px",height:"100%",backgroundColor:"grey",transform:"translateX(-50%)",maxHeight:"50vh",overflowY:"auto"},li:{borderBottom:"1px solid #313131",display:"block",padding:"4px",margin:0,lineHeight:1,verticalAlign:"middle",height:"24px"},b:{fontWeight:"bold"},small:{textAlign:"revert",letterSpacing:"1px",fontSize:"10px",fontWeight:"500",marginLeft:"2px",color:"rgb(101, 197, 188)"}}),_f=_t("button",{fontWeight:"bold",letterSpacing:"0.02em",backgroundColor:"rgb(41, 43, 45)",color:"rgb(211, 211, 211)",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"block",verticalAlign:"middle",fontSize:"11px",padding:"5px",margin:"4px auto"}),Bh=_t("div",{display:"flex",justifyContent:"center",cursor:"pointer",fontSize:"12px",backgroundColor:"rgb(41, 43, 45)",marginTop:"6px",width:"auto",margin:"0 auto",color:"rgba(145, 145, 145, 1)",textAlign:"center",position:"absolute",right:0,bottom:" -20px",svg:{width:"12px",height:"12px",float:"left"}}),Nh=_t("li",{display:"flex !important",height:"auto !important",span:{height:"40px",display:"block",position:"relative"},b:{paddingLeft:"12px"}}),kn=P.memo(({isPerf:a,color:n,colorBlind:c,customData:v,isMemory:i,isShadersInfo:r,metric:s,fontSize:f,offsetY:u=0,offsetX:h,round:d,hasInstance:m})=>{const{width:y,height:x}=Ci(S=>S.viewport),C=P.useRef(null),T=P.useRef(null);return ao(function(){const _=Ge.getState().gl,w=Ge.getState().log;if(!w||!C.current||(v&&(C.current.text=Ge.getState().customData),!s))return;let M=w[s];if(r){var D;M=(D=_.info.programs)===null||D===void 0?void 0:D.length}else s==="matriceCount"?M=Xn.value:!a&&_.info.render&&(M=(i?_.info.memory:_.info.render)[s]);if(s==="fps"&&(C.current.color=Ge.getState().overclockingFps?Gt(c).overClock.toString():`rgb(${Gt(c).fps.toString()})`),C.current.text=(Math.round(M*Math.pow(10,d))/Math.pow(10,d)).toFixed(d),m){const R=_.info.instance;if(typeof R>"u"&&s!=="matriceCount")return;let A;s==="matriceCount"?A=gi.value:A=R[s],A>0?(C.current.fontSize=f/1.15,T.current.fontSize=M>0?f/1.4:f,C.current.position.y=x/2-u-f/1.9,T.current.text=" ± "+(Math.round(A*Math.pow(10,d))/Math.pow(10,d)).toFixed(d)):(C.current.position.y=x/2-u-f,C.current.fontSize=f)}Xn.value-=1,C.current.updateMatrix(),C.current.matrixWorld.copy(C.current.matrix)}),L.jsxs(P.Suspense,{fallback:null,children:[L.jsxs(vc,{textAlign:"justify",matrixAutoUpdate:!1,ref:C,fontSize:f,position:[-y/2+h+f,x/2-u-f,0],color:n,characters:"0123456789",onUpdate:S=>{S.updateMatrix(),Xn.value-=1,S.matrixWorld.copy(S.matrix)},children:[L.jsx("meshBasicMaterial",{blending:Du}),"0"]}),m&&L.jsx(vc,{textAlign:"justify",matrixAutoUpdate:!1,ref:T,fontSize:8,position:[-y/2+h+f,x/2-u-f*1.15,0],color:"lightgrey",characters:"0123456789",onUpdate:S=>{S.updateMatrix(),Xn.value-=1,S.matrixWorld.copy(S.matrix)},children:L.jsx("meshBasicMaterial",{blending:Du})})]})}),Gh=({colorBlind:a,customData:n,minimal:c,matrixUpdate:v})=>L.jsxs(L.Fragment,{children:[L.jsx(kn,{colorBlind:a,color:`rgb(${Gt(a).fps.toString()})`,isPerf:!0,metric:"fps",fontSize:14,offsetX:140,round:0}),L.jsx(kn,{color:`rgb(${Gt(a).cpu.toString()})`,isPerf:!0,metric:"cpu",fontSize:14,offsetX:72,round:3}),L.jsx(kn,{color:`rgb(${Gt(a).gpu.toString()})`,isPerf:!0,metric:"gpu",fontSize:14,offsetX:10,round:3}),c?null:L.jsxs(L.Fragment,{children:[L.jsx(kn,{metric:"calls",fontSize:14,offsetX:200,round:0,hasInstance:!0}),L.jsx(kn,{metric:"triangles",fontSize:14,offsetX:260,round:0,hasInstance:!0}),L.jsx(kn,{isMemory:!0,metric:"geometries",fontSize:14,offsetY:30,offsetX:0,round:0}),L.jsx(kn,{isMemory:!0,metric:"textures",fontSize:14,offsetY:30,offsetX:80,round:0}),L.jsx(kn,{isShadersInfo:!0,metric:"programs",fontSize:14,offsetY:30,offsetX:140,round:0}),L.jsx(kn,{metric:"lines",fontSize:14,offsetY:30,offsetX:200,round:0,hasInstance:!0}),L.jsx(kn,{metric:"points",fontSize:14,offsetY:30,offsetX:260,round:0,hasInstance:!0}),v&&L.jsx(kn,{isPerf:!0,metric:"matriceCount",fontSize:14,offsetY:30,offsetX:320,round:0,hasInstance:!0})]}),n&&L.jsx(kn,{color:`rgb(${Gt(a).custom.toString()})`,customData:n,fontSize:14,offsetY:0,offsetX:c?200:320,round:0})]}),Wh=({colorBlind:a,minimal:n,chart:c={length:30,hz:15}})=>{const v=P.useMemo(()=>({fps:new Float32Array(c.length*3),cpu:new Float32Array(c.length*3),gpu:new Float32Array(c.length*3)}),[c]),i=P.useRef(null),r=P.useRef(null),s=P.useRef(null),f=P.useRef(null),u=P.useMemo(()=>new st(0,0,0),[]),h=(d,m=1,y,x)=>{let C=0;const{width:T,height:S}=x,_=Ge.getState().chart.data[d];if(!_||_.length===0)return;const w=n?2:6,M=n?12:50;let D=_.length;for(let R=0;RC&&(C=_[A]*m),u.set(w+R/(D-1)*(T-w*2)-T/2,Math.min(100,_[A])*m/100*(S-w*2-M)-S/2,0),u.toArray(y.attributes.position.array,R*3))}y.attributes.position.needsUpdate=!0};return ao(function({viewport:m}){h("fps",1,i.current,m),r.current&&r.current.color.set(Ge.getState().overclockingFps?Gt(a).overClock.toString():`rgb(${Gt(a).fps.toString()})`),h("gpu",5,s.current,m),h("cpu",5,f.current,m)}),L.jsxs(L.Fragment,{children:[L.jsxs("line",{children:[L.jsx("bufferGeometry",{ref:i,children:L.jsx("bufferAttribute",{attach:"attributes-position",count:c.length,array:v.fps,itemSize:3,usage:hl,needsUpdate:!0})}),L.jsx("lineBasicMaterial",{ref:r,color:`rgb(${Gt(a).fps.toString()})`,transparent:!0,opacity:.5})]}),L.jsxs("line",{children:[L.jsx("bufferGeometry",{ref:s,children:L.jsx("bufferAttribute",{attach:"attributes-position",count:c.length,array:v.gpu,itemSize:3,usage:hl,needsUpdate:!0})}),L.jsx("lineBasicMaterial",{color:`rgb(${Gt(a).gpu.toString()})`,transparent:!0,opacity:.5})]}),L.jsxs("line",{children:[L.jsx("bufferGeometry",{ref:f,children:L.jsx("bufferAttribute",{attach:"attributes-position",count:c.length,array:v.cpu,itemSize:3,usage:hl,needsUpdate:!0})}),L.jsx("lineBasicMaterial",{color:`rgb(${Gt(a).cpu.toString()})`,transparent:!0,opacity:.5})]})]})},Hh=({colorBlind:a,chart:n,customData:c,matrixUpdate:v,showGraph:i=!0,antialias:r=!0,minimal:s})=>{const f=P.useRef(void 0),u=Ge(h=>h.paused);return L.jsxs(Ah,{style:{display:"flex",position:"absolute",height:`${s?37:i?100:60}px`,minWidth:`${s?"100px":c?"370px":"310px"}`},children:[L.jsx(P1,{ref:f,orthographic:!0,dpr:r?[1,2]:1,gl:{antialias:!0,alpha:!0,stencil:!1,depth:!1},onCreated:({scene:h})=>{h.traverse(d=>{d.matrixWorldAutoUpdate=!1,d.matrixAutoUpdate=!1})},flat:!0,style:{marginBottom:"-42px",position:"relative",pointerEvents:"none",background:"transparent !important",height:`${s?37:i?100:60}px`},children:u?null:L.jsxs(L.Fragment,{children:[L.jsx(Vh,{}),L.jsx(Gh,{customData:c,minimal:s,matrixUpdate:v}),i&&L.jsx(Wh,{colorBlind:a,minimal:s,chart:n})]})}),u&&L.jsxs(Dh,{children:[L.jsx(fh,{})," PAUSED"]})]})},Vh=()=>(ao(function({gl:n,scene:c,camera:v}){v.updateMatrix(),Xn.value-=1,v.matrixWorld.copy(v.matrix),v.matrixWorldInverse.copy(v.matrixWorld).invert(),n.render(c,v),gi.value=0,Xn.value=0},1/0),null);function Zh(a,n){if(a==null)return{};var c={},v=Object.keys(a),i,r;for(r=0;r=0)&&(c[i]=a[i]);return c}function Qh(a,n){if(a==null)return{};var c=Zh(a,n),v,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(a);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(a,v)&&(c[v]=a[v])}return c}const Xh=["portal","className","children"],Yh=P.forwardRef((a,n)=>{let{portal:c,className:v,children:i}=a,r=Qh(a,Xh);const s=Ci(d=>d.gl),f=P.useRef(null),u=P.useRef(null),h=(c==null?void 0:c.current)!=null?c.current:s.domElement.parentNode;return P.useLayoutEffect(()=>{if(!f.current||!h)return;const d=document.createElement("div"),m=u.current=_c(d);return h.appendChild(d),()=>{m.unmount(),u.current=null,h.removeChild(d)}},[h]),P.useLayoutEffect(()=>{const d=u.current;d&&d.render(L.jsx("div",{ref:n,className:v,children:i}))}),L.jsx("group",Hl(Hl({},r),{},{ref:f}))}),wc=(a,n)=>{const c=i=>{switch(i){case 1e3:return"RepeatWrapping";case 1001:return"ClampToEdgeWrapping";case 1002:return"MirroredRepeatWrapping";default:return"ClampToEdgeWrapping"}},v=i=>{switch(i){case 3e3:return"LinearEncoding";case 3001:return"sRGBEncoding";case 3002:return"RGBEEncoding";case 3003:return"LogLuvEncoding";case 3004:return"RGBM7Encoding";case 3005:return"RGBM16Encoding";case 3006:return"RGBDEncoding";case 3007:return"GammaEncoding";default:return"ClampToEdgeWrapping"}};return{name:a,url:n.image.currentSrc,encoding:v(n.encoding),wrapT:c(n.image.wrapT),flipY:n.flipY.toString()}},Jh=({program:a,material:n,setTexNumber:c})=>{const v=Ge(s=>s.gl),[i,r]=P.useState(null);return P.useEffect(()=>{if(v){const s=a==null?void 0:a.getUniforms();let f=0;const u=new Map;s.seq.forEach(h=>{if(!h.id.includes("uTroika")&&h.id!=="isOrthographic"&&h.id!=="uvTransform"&&h.id!=="lightProbe"&&h.id!=="projectionMatrix"&&h.id!=="viewMatrix"&&h.id!=="normalMatrix"&&h.id!=="modelMatrix"&&h.id!=="modelViewMatrix"){let d=[],m={name:h.id};h.cache&&(h.cache.forEach(y=>{typeof y<"u"&&d.push(y.toString().substring(0,4))}),m.value=d.join(),n[h.id]&&n[h.id].image&&n[h.id].image&&(f++,m.value=wc(h.id,n[h.id])),m.value||(m.value="empty"),u.set(h.id,m))}}),n.uniforms&&Object.keys(n.uniforms).forEach(h=>{const d=n.uniforms[h];if(d.value){const{value:m}=d;let y={name:h};if(h.includes("uTroika"))return;if(m instanceof Vl)f++,y.value=wc(h,m);else{let x=JSON.stringify(m);try{x=JSON.stringify(m)}catch{x=m.toString()}y.value=x}u.set(h,y)}}),f>0&&c(f),r(u)}},[]),L.jsx(Cf,{children:i&&Array.from(i.values()).map(s=>L.jsx("span",{children:typeof s.value=="string"?L.jsx("li",{children:L.jsxs("span",{children:[s.name," :"," ",L.jsxs("b",{children:[s.value.substring(0,30),s.value.length>30?"...":""]})]})}):L.jsxs(L.Fragment,{children:[L.jsx("li",{children:L.jsxs("b",{children:[s.value.name,":"]})}),L.jsxs("div",{children:[Object.keys(s.value).map(f=>f!=="name"?L.jsx("div",{children:f==="url"?L.jsx("a",{href:s.value[f],target:"_blank",children:L.jsx("img",{src:s.value[f]})}):L.jsxs("li",{children:[f,": ",L.jsx("b",{children:s.value[f]})]})},f):null),L.jsxs(_f,{onClick:()=>{var f;console.info(n[s.value.name]||(n==null||(f=n.uniforms[s.value.name])===null||f===void 0?void 0:f.value))},children:["console.info(",s.value.name,");"]})]})]})},s.name))})},Kh=({el:a})=>{Ge(v=>v.log);const n=Ge(v=>v.gl),c=v=>{if(!n)return 0;const i=Math.round(v.drawCounts.total/(n.info.render.triangles+n.info.render.lines+n.info.render.points)*100*10)/10;return isFinite(i)&&i||0};return L.jsx(L.Fragment,{children:a.drawCounts.total>0&&L.jsxs(Nt,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[a.drawCounts.type==="Triangle"?L.jsx(wf,{style:{top:"-1px"}}):L.jsx(gf,{style:{top:"-1px"}}),a.drawCounts.total,L.jsxs("small",{children:[a.drawCounts.type,"s"]}),n&&L.jsxs(rn,{style:{bottom:"-10px",width:"40px",fontWeight:"bold"},children:[a.visible&&!a.material.wireframe?c(a):0,"%"]})]})})},qh=({el:a})=>{const[n,c]=P.useState(a.visible),[v,i]=P.useState(a.expand),[r,s]=P.useState(0),{meshes:f,program:u,material:h}=a;return L.jsxs(zh,{children:[L.jsxs(Fh,{onClick:()=>{a.expand=!v,Object.keys(f).forEach(d=>{const m=f[d];m.material.wireframe=!1}),i(!v)},children:[L.jsx(is,{style:{marginRight:"6px"},children:v?L.jsx("span",{children:L.jsx(yf,{})}):L.jsx("span",{children:L.jsx(xf,{})})}),u&&L.jsxs("span",{children:[L.jsx(Ih,{children:u.name}),L.jsxs(Nt,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[L.jsx(rh,{style:{top:"-1px"}}),Object.keys(f).length,L.jsx("small",{children:Object.keys(f).length>1?"users":"user"})]}),r>0&&L.jsxs(Nt,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[r>1?L.jsx(Wl,{style:{top:"-1px"}}):L.jsx(Wl,{style:{top:"-1px"}}),r,L.jsx("small",{children:"tex"})]}),L.jsx(Kh,{el:a}),h.glslVersion==="300 es"&&L.jsxs(Nt,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[L.jsx(hh,{style:{top:"-1px"}}),"300",L.jsx("small",{children:"es"}),L.jsx(rn,{style:{bottom:"-10px",width:"40px"},children:"glsl"})]})]}),L.jsx(Oh,{onPointerEnter:()=>{Object.keys(f).forEach(d=>{const m=f[d];m.material.wireframe=!0})},onPointerLeave:()=>{Object.keys(f).forEach(d=>{const m=f[d];m.material.wireframe=!1})},onClick:d=>{d.stopPropagation(),Object.keys(f).forEach(m=>{const y=f[m],x=!n;y.visible=x,a.visible=x,c(x)})},children:n?L.jsx(q0,{}):L.jsx(J0,{})})]}),L.jsxs("div",{style:{maxHeight:v?"9999px":0,overflow:"hidden"},children:[L.jsxs(xc,{children:[L.jsx(G0,{})," Uniforms:"]}),L.jsx(Jh,{program:u,material:h,setTexNumber:s}),L.jsxs(xc,{children:[L.jsx(H0,{})," Geometries:"]}),L.jsx(Cf,{children:f&&Object.keys(f).map(d=>f[d]&&f[d].geometry&&L.jsxs(Nh,{children:[L.jsxs("span",{children:[f[d].geometry.type,": "]}),f[d].userData&&f[d].userData.drawCount&&L.jsxs("b",{children:[L.jsxs("div",{children:[f[d].userData.drawCount.count,L.jsxs("small",{children:[" ",f[d].userData.drawCount.type,"s"]})]}),L.jsx("br",{}),L.jsxs("div",{children:[Math.round(j1(f[d].geometry)/1024*1e3)/1e3,"Kb",L.jsx("small",{children:" memory used"})]})]})]},d))}),L.jsxs(_f,{onClick:()=>{console.info(h)},children:["console.info(",h.type,")"]})]})]})},$h=()=>{Ge(n=>n.triggerProgramsUpdate);const a=Ge(n=>n.programs);return L.jsx(bh,{children:a&&Array.from(a.values()).map(n=>n&&n?L.jsx(qh,{el:n},n.material.uuid):null)})},Gt=a=>({overClock:"#ff6eff",fps:a?"100, 143, 255":"238,38,110",cpu:a?"254, 254, 98":"66,226,46",gpu:a?"254,254,254":"253,151,31",custom:a?"86,180,233":"40,255,255"}),ep=({showGraph:a,colorBlind:n})=>{const c=Ge(i=>i.overclockingFps),v=Ge(i=>i.fpsLimit);return L.jsxs(rn,{style:a?{color:c?Gt(n).overClock.toString():`rgb(${Gt(n).fps})`}:{},children:["FPS ",c?`${v}🚀`:""]})},tp=({showGraph:a,colorBlind:n,customData:c,minimal:v})=>{const i=Ge(r=>r.gl);return i?L.jsxs(Rh,{children:[L.jsxs(Nt,{children:[L.jsx(oh,{}),L.jsx(rn,{style:a?{color:`rgb(${Gt(n).gpu.toString()})`}:{},children:"GPU"}),L.jsx(Pl,{children:"ms"})]}),L.jsxs(Nt,{children:[L.jsx(vh,{}),L.jsx(rn,{style:a?{color:`rgb(${Gt(n).cpu.toString()})`}:{},children:"CPU"}),L.jsx(Pl,{children:"ms"})]}),L.jsxs(Nt,{children:[L.jsx(th,{}),L.jsx(ep,{showGraph:a,colorBlind:n})]}),!v&&i&&L.jsxs(Nt,{children:[L.jsx(gh,{}),L.jsx(rn,{children:i.info.render.calls===1?"call":"calls"})]}),!v&&i&&L.jsxs(Nt,{children:[L.jsx(wf,{}),L.jsx(rn,{children:"Triangles"})]}),c&&L.jsxs(Nt,{children:[L.jsx(B0,{}),L.jsx(rn,{style:a?{color:`rgb(${Gt(n).custom})`}:{},children:c.name}),c.info&&L.jsx(Pl,{children:c.info})]})]}):null},np=({showGraph:a,colorBlind:n,deepAnalyze:c,customData:v,matrixUpdate:i,openByDefault:r,minimal:s})=>L.jsxs(L.Fragment,{children:[L.jsx(tp,{showGraph:a,colorBlind:n,customData:v,minimal:s}),!s&&L.jsx(ip,{matrixUpdate:i,openByDefault:r,deepAnalyze:c,showGraph:a})]}),rp=({matrixUpdate:a})=>L.jsxs("div",{children:[L.jsxs(Nt,{children:[L.jsx(lh,{}),L.jsx(rn,{children:"Geometries"})]}),L.jsxs(Nt,{children:[L.jsx(Wl,{}),L.jsx(rn,{children:"Textures"})]}),L.jsxs(Nt,{children:[L.jsx(gf,{}),L.jsx(rn,{children:"shaders"})]}),L.jsxs(Nt,{children:[L.jsx(uh,{}),L.jsx(rn,{children:"Lines"})]}),L.jsxs(Nt,{children:[L.jsx(Z0,{}),L.jsx(rn,{children:"Points"})]}),a&&L.jsxs(Nt,{children:[L.jsx(X0,{}),L.jsx(rn,{children:"Matrices"})]})]}),Sc=({tab:a,title:n,set:c})=>{const v=Ge(i=>i.tab);return L.jsx(is,{className:`${v===a?" __perf_toggle_tab_active":""}`,onClick:()=>{c(!0),Ge.setState({tab:a})},children:L.jsx("span",{children:n})})},ip=({openByDefault:a,showGraph:n,deepAnalyze:c,matrixUpdate:v})=>{const[i,r]=td.useState(a);return L.jsxs("span",{children:[L.jsx(op,{show:i,showGraph:n,matrixUpdate:v}),a&&!c?null:L.jsxs(Bh,{className:"__perf_toggle",children:[c&&L.jsx(Sc,{tab:"programs",title:"Programs",set:r}),c&&L.jsx(Sc,{tab:"infos",title:"Infos",set:r}),L.jsx(is,{onClick:()=>{r(!i)},children:i?L.jsxs("span",{children:[L.jsx(yf,{})," Minimize"]}):L.jsxs("span",{children:[L.jsx(xf,{})," More"]})})]})]})},op=({show:a,showGraph:n,matrixUpdate:c})=>{const v=Ge(i=>i.tab);return L.jsxs(L.Fragment,{children:[L.jsx(rp,{matrixUpdate:c}),a&&L.jsx("div",{children:L.jsx(jh,{style:{marginTop:n?"38px":0},children:v==="programs"&&L.jsx($h,{})})})]})},ap=({showGraph:a,colorBlind:n,openByDefault:c,className:v,overClock:i,style:r,position:s,chart:f,deepAnalyze:u,antialias:h,customData:d,matrixUpdate:m,minimal:y})=>{const x=P.useRef(null);return L.jsxs(L.Fragment,{children:[L.jsx(Sf,{chart:f,overClock:i,deepAnalyze:u,matrixUpdate:m}),L.jsx(Yh,{transform:!1,children:L.jsxs(Uh,{className:(v?" ".concat(v):" ")+` ${s||""} ${y?"minimal":""}`,style:Hl({minHeight:y?"37px":a?"100px":"60px"},r),ref:x,children:[L.jsx(Hh,{perfContainerRef:x,colorBlind:n,chart:f,showGraph:a,antialias:h,customData:d,minimal:y,matrixUpdate:m}),L.jsx(np,{colorBlind:n,showGraph:a,deepAnalyze:u,openByDefault:c,customData:d,matrixUpdate:m,minimal:y})]})})]})},gp=({headless:a=!1,colorBlind:n=!1,overClock:c=!1,showGraph:v=!0,trackCPU:i=!1,deepAnalyze:r=!1,antialias:s=!0,openByDefault:f=!0,customData:u,matrixUpdate:h=!1,position:d="top-right",chart:m={length:30,hz:15},className:y,style:x,minimal:C=!1})=>a?L.jsx(Sf,{chart:m,deepAnalyze:r,matrixUpdate:h,overClock:c}):L.jsx(ap,{colorBlind:n,showGraph:v,trackCPU:i,openByDefault:f,className:y,style:x,overClock:c,position:d,antialias:s,chart:m,deepAnalyze:r,minimal:C,customData:u,matrixUpdate:h}),Ll=5e3,lp={show:"#FF723C",clip:"#FFFF00",episode:"#FF7F50",guest:"#E066FF",topic:"#F8F8FF",Topic:"#F8F8FF",Organization:"#FF7F50"},yp=(a,n)=>{const c=lp[a]||"#F8F8FF";return n?c:parseInt(c.replace("#","0x"),16)},xp=()=>{const{fogColor:a}=Fd("universe",{fogColor:id}),n=Ad(r=>r.graphStyle),c=P.useRef(null),v=P.useRef(null),i=P.useRef(null);return ao(({camera:r,clock:s})=>{const f=s.getElapsedTime();if(c.current){const h=Math.sin(f/8)*1e3;c.current.position.setZ(h)}if(v.current&&v.current.position.lerp(r.position,.5),i.current){const u=f*.5,h=Math.sin(u)*Ll,d=Math.cos(u)*Ll;i.current.position.set(h,0,d)}}),L.jsxs(L.Fragment,{children:[L.jsx("hemisphereLight",{args:[Ki.white,nd,rd]}),n!=="earth"&&L.jsx("fog",{args:[a,5,18e3],attach:"fog"}),L.jsx("ambientLight",{color:Ki.white,intensity:1}),L.jsx("pointLight",{ref:v,color:Ki.white,distance:4e3,intensity:5,position:[0,0,0]}),L.jsx("directionalLight",{ref:i,color:Ki.white,intensity:8,position:[Ll,0,0]}),L.jsx("pointLight",{ref:c,color:Ki.white,distance:4e3,intensity:8,position:[0,0,0]})]})},wp=a=>{const n=P.useRef();return P.useEffect(()=>{n.current=a}),n.current},Sp={font:"/fonts/Inter-Bold.woff",characters:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!",fontSize:2,letterSpacing:-.05,lineHeight:1,"material-toneMapped":!1},Cp=(a,n)=>a.length>n?`${a.substring(0,n)}...`:a;export{P1 as C,lp as D,hp as H,N1 as L,gp as P,vc as T,Yc as a,ao as b,ns as c,ts as d,Hd as e,fp as f,vp as g,yp as h,Sp as i,wp as j,xp as k,pp as m,Cp as t,Ci as u}; + sans-serif`,backgroundColor:"rgba(36, 36, 36, .9)",color:"#fff",margin:0,minHeight:"100px",padding:"4px 0","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale",userSelect:"none","&.top-left":{right:"initial",left:0},"&.bottom-left":{right:"initial",top:"initial",bottom:0,left:0,".__perf_toggle":{top:"-20px",bottom:"initial"}},"&.bottom-right":{top:"initial",bottom:0,".__perf_toggle":{top:"-20px",bottom:"initial"}},"&.minimal":{backgroundColor:"rgba(36, 36, 36, .75)"},"*":{margin:"0",padding:"0",border:"0",fontSize:"100%",lineHeight:"1",verticalAlign:"baseline"}}),Pl=_t("small",{position:"absolute",right:0,fontSize:"10px"}),Nt=_t("div",{display:"inline-flex",fontStyle:"normal",padding:0,lineHeight:"13px",fontSize:"14px",width:"62px",position:"relative",pointerEvents:"auto",cursor:"default",fontWeight:500,letterSpacing:"0px",textAlign:"left",height:"29px",whiteSpace:"nowrap",justifyContent:"space-evenly",fontVariantNumeric:"tabular-nums",small:{paddingLeft:"12px"},svg:{padding:0,color:"rgba(145, 145, 145, 0.3)",fontSize:"40px",position:"absolute",zIndex:1,maxHeight:"20px",left:" 50%",marginLeft:"-23px",top:"4px"}}),rn=_t("span",{verticalAlign:"bottom",position:"absolute",bottom:"5px",color:"rgba(101, 197, 188, 1)",textAlign:"right",letterSpacing:"1px",fontSize:"8px",fontWeight:"500",width:"60px"}),Rh=_t("div",{display:"flex"}),Fh=_t("div",{backgroundColor:"#404040",padding:"6px",display:"block",fontSize:"12px",marginBottom:"6px",cursor:"pointer","*":{cursor:"pointer !important"},"> span":{},small:{fontSize:"9px"},"> b":{marginRight:"4px",cursor:"pointer"}}),Ah=_t("div",{height:"66px",overflow:"hidden",position:"absolute",pointerEvents:"none",display:"flex",top:"0px",justifyContent:"center",width:"100%",minWidth:"310px",margin:"0 auto",canvas:{background:"transparent !important",position:"absolute !important"}}),Dh=_t("div",{textAlign:"center",fontWeight:700,fontSize:"12px",lineHeight:"12px",display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"middle",color:"#f1f1f1",padding:"7px",width:"100%",backgroundColor:"rgba(36, 36, 37, 0.8)",zIndex:1,position:"absolute",height:"100%"}),is=_t("div",{pointerEvents:"auto",justifyContent:"center",cursor:"pointer",fontSize:"12px",backgroundColor:"rgb(41, 43, 45)",marginTop:"6px",width:"auto",margin:"0",color:"rgba(145, 145, 145, 1)",textAlign:"center",display:"inline-block",verticalAlign:"middle",padding:"4px 6px","&.__perf_toggle_tab_active":{backgroundColor:"rgb(31 31 31)"},svg:{width:"12px",height:"12px",float:"left"}}),Oh=_t("div",{pointerEvents:"auto",justifyContent:"center",cursor:"pointer",fontSize:"12px",float:"right",backgroundColor:"rgb(41, 43, 45)",width:"auto",margin:"0",color:"rgba(145, 145, 145, 1)",textAlign:"center",display:"inline-block",verticalAlign:"middle",padding:"4px 6px","&.__perf_toggle_tab_active":{backgroundColor:"rgb(31 31 31)"},svg:{width:"12px",height:"12px",float:"left"}}),zh=_t("div",{padding:"4px 6px",fontSize:"12px",pointerEvents:"auto"}),Ih=_t("span",{fontWeight:"bold",letterSpacing:"0.08em",maxWidth:"145px",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"middle",fontSize:"11px",marginRight:"10px"}),jh=_t("div",{maxHeight:"50vh",overflowY:"auto",marginTop:"38px"}),bh=_t("div",{marginTop:"0"}),xc=_t("div",{display:"flex",position:"relative",fontWeight:"bold",color:"#fff",lineHeight:"14px",svg:{marginRight:"4px",display:"inline-block"}}),Cf=_t("ul",{display:"block",position:"relative",paddingLeft:"10px",margin:"6px 6px",img:{maxHeight:"60px",maxWidth:"100%",margin:"6px auto",display:"block"},"&:after":{content:"",position:"absolute",left:"0px",top:"0px",width:"1px",height:"100%",backgroundColor:"grey",transform:"translateX(-50%)",maxHeight:"50vh",overflowY:"auto"},li:{borderBottom:"1px solid #313131",display:"block",padding:"4px",margin:0,lineHeight:1,verticalAlign:"middle",height:"24px"},b:{fontWeight:"bold"},small:{textAlign:"revert",letterSpacing:"1px",fontSize:"10px",fontWeight:"500",marginLeft:"2px",color:"rgb(101, 197, 188)"}}),_f=_t("button",{fontWeight:"bold",letterSpacing:"0.02em",backgroundColor:"rgb(41, 43, 45)",color:"rgb(211, 211, 211)",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"block",verticalAlign:"middle",fontSize:"11px",padding:"5px",margin:"4px auto"}),Bh=_t("div",{display:"flex",justifyContent:"center",cursor:"pointer",fontSize:"12px",backgroundColor:"rgb(41, 43, 45)",marginTop:"6px",width:"auto",margin:"0 auto",color:"rgba(145, 145, 145, 1)",textAlign:"center",position:"absolute",right:0,bottom:" -20px",svg:{width:"12px",height:"12px",float:"left"}}),Nh=_t("li",{display:"flex !important",height:"auto !important",span:{height:"40px",display:"block",position:"relative"},b:{paddingLeft:"12px"}}),kn=P.memo(({isPerf:l,color:n,colorBlind:c,customData:v,isMemory:i,isShadersInfo:r,metric:s,fontSize:f,offsetY:u=0,offsetX:h,round:d,hasInstance:m})=>{const{width:y,height:x}=Si(S=>S.viewport),C=P.useRef(null),T=P.useRef(null);return ao(function(){const _=Ge.getState().gl,w=Ge.getState().log;if(!w||!C.current||(v&&(C.current.text=Ge.getState().customData),!s))return;let M=w[s];if(r){var D;M=(D=_.info.programs)===null||D===void 0?void 0:D.length}else s==="matriceCount"?M=Xn.value:!l&&_.info.render&&(M=(i?_.info.memory:_.info.render)[s]);if(s==="fps"&&(C.current.color=Ge.getState().overclockingFps?Gt(c).overClock.toString():`rgb(${Gt(c).fps.toString()})`),C.current.text=(Math.round(M*Math.pow(10,d))/Math.pow(10,d)).toFixed(d),m){const R=_.info.instance;if(typeof R>"u"&&s!=="matriceCount")return;let A;s==="matriceCount"?A=gi.value:A=R[s],A>0?(C.current.fontSize=f/1.15,T.current.fontSize=M>0?f/1.4:f,C.current.position.y=x/2-u-f/1.9,T.current.text=" ± "+(Math.round(A*Math.pow(10,d))/Math.pow(10,d)).toFixed(d)):(C.current.position.y=x/2-u-f,C.current.fontSize=f)}Xn.value-=1,C.current.updateMatrix(),C.current.matrixWorld.copy(C.current.matrix)}),L.jsxs(P.Suspense,{fallback:null,children:[L.jsxs(vc,{textAlign:"justify",matrixAutoUpdate:!1,ref:C,fontSize:f,position:[-y/2+h+f,x/2-u-f,0],color:n,characters:"0123456789",onUpdate:S=>{S.updateMatrix(),Xn.value-=1,S.matrixWorld.copy(S.matrix)},children:[L.jsx("meshBasicMaterial",{blending:Du}),"0"]}),m&&L.jsx(vc,{textAlign:"justify",matrixAutoUpdate:!1,ref:T,fontSize:8,position:[-y/2+h+f,x/2-u-f*1.15,0],color:"lightgrey",characters:"0123456789",onUpdate:S=>{S.updateMatrix(),Xn.value-=1,S.matrixWorld.copy(S.matrix)},children:L.jsx("meshBasicMaterial",{blending:Du})})]})}),Gh=({colorBlind:l,customData:n,minimal:c,matrixUpdate:v})=>L.jsxs(L.Fragment,{children:[L.jsx(kn,{colorBlind:l,color:`rgb(${Gt(l).fps.toString()})`,isPerf:!0,metric:"fps",fontSize:14,offsetX:140,round:0}),L.jsx(kn,{color:`rgb(${Gt(l).cpu.toString()})`,isPerf:!0,metric:"cpu",fontSize:14,offsetX:72,round:3}),L.jsx(kn,{color:`rgb(${Gt(l).gpu.toString()})`,isPerf:!0,metric:"gpu",fontSize:14,offsetX:10,round:3}),c?null:L.jsxs(L.Fragment,{children:[L.jsx(kn,{metric:"calls",fontSize:14,offsetX:200,round:0,hasInstance:!0}),L.jsx(kn,{metric:"triangles",fontSize:14,offsetX:260,round:0,hasInstance:!0}),L.jsx(kn,{isMemory:!0,metric:"geometries",fontSize:14,offsetY:30,offsetX:0,round:0}),L.jsx(kn,{isMemory:!0,metric:"textures",fontSize:14,offsetY:30,offsetX:80,round:0}),L.jsx(kn,{isShadersInfo:!0,metric:"programs",fontSize:14,offsetY:30,offsetX:140,round:0}),L.jsx(kn,{metric:"lines",fontSize:14,offsetY:30,offsetX:200,round:0,hasInstance:!0}),L.jsx(kn,{metric:"points",fontSize:14,offsetY:30,offsetX:260,round:0,hasInstance:!0}),v&&L.jsx(kn,{isPerf:!0,metric:"matriceCount",fontSize:14,offsetY:30,offsetX:320,round:0,hasInstance:!0})]}),n&&L.jsx(kn,{color:`rgb(${Gt(l).custom.toString()})`,customData:n,fontSize:14,offsetY:0,offsetX:c?200:320,round:0})]}),Wh=({colorBlind:l,minimal:n,chart:c={length:30,hz:15}})=>{const v=P.useMemo(()=>({fps:new Float32Array(c.length*3),cpu:new Float32Array(c.length*3),gpu:new Float32Array(c.length*3)}),[c]),i=P.useRef(null),r=P.useRef(null),s=P.useRef(null),f=P.useRef(null),u=P.useMemo(()=>new st(0,0,0),[]),h=(d,m=1,y,x)=>{let C=0;const{width:T,height:S}=x,_=Ge.getState().chart.data[d];if(!_||_.length===0)return;const w=n?2:6,M=n?12:50;let D=_.length;for(let R=0;RC&&(C=_[A]*m),u.set(w+R/(D-1)*(T-w*2)-T/2,Math.min(100,_[A])*m/100*(S-w*2-M)-S/2,0),u.toArray(y.attributes.position.array,R*3))}y.attributes.position.needsUpdate=!0};return ao(function({viewport:m}){h("fps",1,i.current,m),r.current&&r.current.color.set(Ge.getState().overclockingFps?Gt(l).overClock.toString():`rgb(${Gt(l).fps.toString()})`),h("gpu",5,s.current,m),h("cpu",5,f.current,m)}),L.jsxs(L.Fragment,{children:[L.jsxs("line",{children:[L.jsx("bufferGeometry",{ref:i,children:L.jsx("bufferAttribute",{attach:"attributes-position",count:c.length,array:v.fps,itemSize:3,usage:hl,needsUpdate:!0})}),L.jsx("lineBasicMaterial",{ref:r,color:`rgb(${Gt(l).fps.toString()})`,transparent:!0,opacity:.5})]}),L.jsxs("line",{children:[L.jsx("bufferGeometry",{ref:s,children:L.jsx("bufferAttribute",{attach:"attributes-position",count:c.length,array:v.gpu,itemSize:3,usage:hl,needsUpdate:!0})}),L.jsx("lineBasicMaterial",{color:`rgb(${Gt(l).gpu.toString()})`,transparent:!0,opacity:.5})]}),L.jsxs("line",{children:[L.jsx("bufferGeometry",{ref:f,children:L.jsx("bufferAttribute",{attach:"attributes-position",count:c.length,array:v.cpu,itemSize:3,usage:hl,needsUpdate:!0})}),L.jsx("lineBasicMaterial",{color:`rgb(${Gt(l).cpu.toString()})`,transparent:!0,opacity:.5})]})]})},Hh=({colorBlind:l,chart:n,customData:c,matrixUpdate:v,showGraph:i=!0,antialias:r=!0,minimal:s})=>{const f=P.useRef(void 0),u=Ge(h=>h.paused);return L.jsxs(Ah,{style:{display:"flex",position:"absolute",height:`${s?37:i?100:60}px`,minWidth:`${s?"100px":c?"370px":"310px"}`},children:[L.jsx(P1,{ref:f,orthographic:!0,dpr:r?[1,2]:1,gl:{antialias:!0,alpha:!0,stencil:!1,depth:!1},onCreated:({scene:h})=>{h.traverse(d=>{d.matrixWorldAutoUpdate=!1,d.matrixAutoUpdate=!1})},flat:!0,style:{marginBottom:"-42px",position:"relative",pointerEvents:"none",background:"transparent !important",height:`${s?37:i?100:60}px`},children:u?null:L.jsxs(L.Fragment,{children:[L.jsx(Vh,{}),L.jsx(Gh,{customData:c,minimal:s,matrixUpdate:v}),i&&L.jsx(Wh,{colorBlind:l,minimal:s,chart:n})]})}),u&&L.jsxs(Dh,{children:[L.jsx(fh,{})," PAUSED"]})]})},Vh=()=>(ao(function({gl:n,scene:c,camera:v}){v.updateMatrix(),Xn.value-=1,v.matrixWorld.copy(v.matrix),v.matrixWorldInverse.copy(v.matrixWorld).invert(),n.render(c,v),gi.value=0,Xn.value=0},1/0),null);function Zh(l,n){if(l==null)return{};var c={},v=Object.keys(l),i,r;for(r=0;r=0)&&(c[i]=l[i]);return c}function Qh(l,n){if(l==null)return{};var c=Zh(l,n),v,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(l);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(l,v)&&(c[v]=l[v])}return c}const Xh=["portal","className","children"],Yh=P.forwardRef((l,n)=>{let{portal:c,className:v,children:i}=l,r=Qh(l,Xh);const s=Si(d=>d.gl),f=P.useRef(null),u=P.useRef(null),h=(c==null?void 0:c.current)!=null?c.current:s.domElement.parentNode;return P.useLayoutEffect(()=>{if(!f.current||!h)return;const d=document.createElement("div"),m=u.current=_c(d);return h.appendChild(d),()=>{m.unmount(),u.current=null,h.removeChild(d)}},[h]),P.useLayoutEffect(()=>{const d=u.current;d&&d.render(L.jsx("div",{ref:n,className:v,children:i}))}),L.jsx("group",Hl(Hl({},r),{},{ref:f}))}),wc=(l,n)=>{const c=i=>{switch(i){case 1e3:return"RepeatWrapping";case 1001:return"ClampToEdgeWrapping";case 1002:return"MirroredRepeatWrapping";default:return"ClampToEdgeWrapping"}},v=i=>{switch(i){case 3e3:return"LinearEncoding";case 3001:return"sRGBEncoding";case 3002:return"RGBEEncoding";case 3003:return"LogLuvEncoding";case 3004:return"RGBM7Encoding";case 3005:return"RGBM16Encoding";case 3006:return"RGBDEncoding";case 3007:return"GammaEncoding";default:return"ClampToEdgeWrapping"}};return{name:l,url:n.image.currentSrc,encoding:v(n.encoding),wrapT:c(n.image.wrapT),flipY:n.flipY.toString()}},Jh=({program:l,material:n,setTexNumber:c})=>{const v=Ge(s=>s.gl),[i,r]=P.useState(null);return P.useEffect(()=>{if(v){const s=l==null?void 0:l.getUniforms();let f=0;const u=new Map;s.seq.forEach(h=>{if(!h.id.includes("uTroika")&&h.id!=="isOrthographic"&&h.id!=="uvTransform"&&h.id!=="lightProbe"&&h.id!=="projectionMatrix"&&h.id!=="viewMatrix"&&h.id!=="normalMatrix"&&h.id!=="modelMatrix"&&h.id!=="modelViewMatrix"){let d=[],m={name:h.id};h.cache&&(h.cache.forEach(y=>{typeof y<"u"&&d.push(y.toString().substring(0,4))}),m.value=d.join(),n[h.id]&&n[h.id].image&&n[h.id].image&&(f++,m.value=wc(h.id,n[h.id])),m.value||(m.value="empty"),u.set(h.id,m))}}),n.uniforms&&Object.keys(n.uniforms).forEach(h=>{const d=n.uniforms[h];if(d.value){const{value:m}=d;let y={name:h};if(h.includes("uTroika"))return;if(m instanceof Vl)f++,y.value=wc(h,m);else{let x=JSON.stringify(m);try{x=JSON.stringify(m)}catch{x=m.toString()}y.value=x}u.set(h,y)}}),f>0&&c(f),r(u)}},[]),L.jsx(Cf,{children:i&&Array.from(i.values()).map(s=>L.jsx("span",{children:typeof s.value=="string"?L.jsx("li",{children:L.jsxs("span",{children:[s.name," :"," ",L.jsxs("b",{children:[s.value.substring(0,30),s.value.length>30?"...":""]})]})}):L.jsxs(L.Fragment,{children:[L.jsx("li",{children:L.jsxs("b",{children:[s.value.name,":"]})}),L.jsxs("div",{children:[Object.keys(s.value).map(f=>f!=="name"?L.jsx("div",{children:f==="url"?L.jsx("a",{href:s.value[f],target:"_blank",children:L.jsx("img",{src:s.value[f]})}):L.jsxs("li",{children:[f,": ",L.jsx("b",{children:s.value[f]})]})},f):null),L.jsxs(_f,{onClick:()=>{var f;console.info(n[s.value.name]||(n==null||(f=n.uniforms[s.value.name])===null||f===void 0?void 0:f.value))},children:["console.info(",s.value.name,");"]})]})]})},s.name))})},Kh=({el:l})=>{Ge(v=>v.log);const n=Ge(v=>v.gl),c=v=>{if(!n)return 0;const i=Math.round(v.drawCounts.total/(n.info.render.triangles+n.info.render.lines+n.info.render.points)*100*10)/10;return isFinite(i)&&i||0};return L.jsx(L.Fragment,{children:l.drawCounts.total>0&&L.jsxs(Nt,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[l.drawCounts.type==="Triangle"?L.jsx(wf,{style:{top:"-1px"}}):L.jsx(gf,{style:{top:"-1px"}}),l.drawCounts.total,L.jsxs("small",{children:[l.drawCounts.type,"s"]}),n&&L.jsxs(rn,{style:{bottom:"-10px",width:"40px",fontWeight:"bold"},children:[l.visible&&!l.material.wireframe?c(l):0,"%"]})]})})},qh=({el:l})=>{const[n,c]=P.useState(l.visible),[v,i]=P.useState(l.expand),[r,s]=P.useState(0),{meshes:f,program:u,material:h}=l;return L.jsxs(zh,{children:[L.jsxs(Fh,{onClick:()=>{l.expand=!v,Object.keys(f).forEach(d=>{const m=f[d];m.material.wireframe=!1}),i(!v)},children:[L.jsx(is,{style:{marginRight:"6px"},children:v?L.jsx("span",{children:L.jsx(yf,{})}):L.jsx("span",{children:L.jsx(xf,{})})}),u&&L.jsxs("span",{children:[L.jsx(Ih,{children:u.name}),L.jsxs(Nt,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[L.jsx(rh,{style:{top:"-1px"}}),Object.keys(f).length,L.jsx("small",{children:Object.keys(f).length>1?"users":"user"})]}),r>0&&L.jsxs(Nt,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[r>1?L.jsx(Wl,{style:{top:"-1px"}}):L.jsx(Wl,{style:{top:"-1px"}}),r,L.jsx("small",{children:"tex"})]}),L.jsx(Kh,{el:l}),h.glslVersion==="300 es"&&L.jsxs(Nt,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[L.jsx(hh,{style:{top:"-1px"}}),"300",L.jsx("small",{children:"es"}),L.jsx(rn,{style:{bottom:"-10px",width:"40px"},children:"glsl"})]})]}),L.jsx(Oh,{onPointerEnter:()=>{Object.keys(f).forEach(d=>{const m=f[d];m.material.wireframe=!0})},onPointerLeave:()=>{Object.keys(f).forEach(d=>{const m=f[d];m.material.wireframe=!1})},onClick:d=>{d.stopPropagation(),Object.keys(f).forEach(m=>{const y=f[m],x=!n;y.visible=x,l.visible=x,c(x)})},children:n?L.jsx(q0,{}):L.jsx(J0,{})})]}),L.jsxs("div",{style:{maxHeight:v?"9999px":0,overflow:"hidden"},children:[L.jsxs(xc,{children:[L.jsx(G0,{})," Uniforms:"]}),L.jsx(Jh,{program:u,material:h,setTexNumber:s}),L.jsxs(xc,{children:[L.jsx(H0,{})," Geometries:"]}),L.jsx(Cf,{children:f&&Object.keys(f).map(d=>f[d]&&f[d].geometry&&L.jsxs(Nh,{children:[L.jsxs("span",{children:[f[d].geometry.type,": "]}),f[d].userData&&f[d].userData.drawCount&&L.jsxs("b",{children:[L.jsxs("div",{children:[f[d].userData.drawCount.count,L.jsxs("small",{children:[" ",f[d].userData.drawCount.type,"s"]})]}),L.jsx("br",{}),L.jsxs("div",{children:[Math.round(j1(f[d].geometry)/1024*1e3)/1e3,"Kb",L.jsx("small",{children:" memory used"})]})]})]},d))}),L.jsxs(_f,{onClick:()=>{console.info(h)},children:["console.info(",h.type,")"]})]})]})},$h=()=>{Ge(n=>n.triggerProgramsUpdate);const l=Ge(n=>n.programs);return L.jsx(bh,{children:l&&Array.from(l.values()).map(n=>n&&n?L.jsx(qh,{el:n},n.material.uuid):null)})},Gt=l=>({overClock:"#ff6eff",fps:l?"100, 143, 255":"238,38,110",cpu:l?"254, 254, 98":"66,226,46",gpu:l?"254,254,254":"253,151,31",custom:l?"86,180,233":"40,255,255"}),ep=({showGraph:l,colorBlind:n})=>{const c=Ge(i=>i.overclockingFps),v=Ge(i=>i.fpsLimit);return L.jsxs(rn,{style:l?{color:c?Gt(n).overClock.toString():`rgb(${Gt(n).fps})`}:{},children:["FPS ",c?`${v}🚀`:""]})},tp=({showGraph:l,colorBlind:n,customData:c,minimal:v})=>{const i=Ge(r=>r.gl);return i?L.jsxs(Rh,{children:[L.jsxs(Nt,{children:[L.jsx(oh,{}),L.jsx(rn,{style:l?{color:`rgb(${Gt(n).gpu.toString()})`}:{},children:"GPU"}),L.jsx(Pl,{children:"ms"})]}),L.jsxs(Nt,{children:[L.jsx(vh,{}),L.jsx(rn,{style:l?{color:`rgb(${Gt(n).cpu.toString()})`}:{},children:"CPU"}),L.jsx(Pl,{children:"ms"})]}),L.jsxs(Nt,{children:[L.jsx(th,{}),L.jsx(ep,{showGraph:l,colorBlind:n})]}),!v&&i&&L.jsxs(Nt,{children:[L.jsx(gh,{}),L.jsx(rn,{children:i.info.render.calls===1?"call":"calls"})]}),!v&&i&&L.jsxs(Nt,{children:[L.jsx(wf,{}),L.jsx(rn,{children:"Triangles"})]}),c&&L.jsxs(Nt,{children:[L.jsx(B0,{}),L.jsx(rn,{style:l?{color:`rgb(${Gt(n).custom})`}:{},children:c.name}),c.info&&L.jsx(Pl,{children:c.info})]})]}):null},np=({showGraph:l,colorBlind:n,deepAnalyze:c,customData:v,matrixUpdate:i,openByDefault:r,minimal:s})=>L.jsxs(L.Fragment,{children:[L.jsx(tp,{showGraph:l,colorBlind:n,customData:v,minimal:s}),!s&&L.jsx(ip,{matrixUpdate:i,openByDefault:r,deepAnalyze:c,showGraph:l})]}),rp=({matrixUpdate:l})=>L.jsxs("div",{children:[L.jsxs(Nt,{children:[L.jsx(lh,{}),L.jsx(rn,{children:"Geometries"})]}),L.jsxs(Nt,{children:[L.jsx(Wl,{}),L.jsx(rn,{children:"Textures"})]}),L.jsxs(Nt,{children:[L.jsx(gf,{}),L.jsx(rn,{children:"shaders"})]}),L.jsxs(Nt,{children:[L.jsx(uh,{}),L.jsx(rn,{children:"Lines"})]}),L.jsxs(Nt,{children:[L.jsx(Z0,{}),L.jsx(rn,{children:"Points"})]}),l&&L.jsxs(Nt,{children:[L.jsx(X0,{}),L.jsx(rn,{children:"Matrices"})]})]}),Sc=({tab:l,title:n,set:c})=>{const v=Ge(i=>i.tab);return L.jsx(is,{className:`${v===l?" __perf_toggle_tab_active":""}`,onClick:()=>{c(!0),Ge.setState({tab:l})},children:L.jsx("span",{children:n})})},ip=({openByDefault:l,showGraph:n,deepAnalyze:c,matrixUpdate:v})=>{const[i,r]=td.useState(l);return L.jsxs("span",{children:[L.jsx(op,{show:i,showGraph:n,matrixUpdate:v}),l&&!c?null:L.jsxs(Bh,{className:"__perf_toggle",children:[c&&L.jsx(Sc,{tab:"programs",title:"Programs",set:r}),c&&L.jsx(Sc,{tab:"infos",title:"Infos",set:r}),L.jsx(is,{onClick:()=>{r(!i)},children:i?L.jsxs("span",{children:[L.jsx(yf,{})," Minimize"]}):L.jsxs("span",{children:[L.jsx(xf,{})," More"]})})]})]})},op=({show:l,showGraph:n,matrixUpdate:c})=>{const v=Ge(i=>i.tab);return L.jsxs(L.Fragment,{children:[L.jsx(rp,{matrixUpdate:c}),l&&L.jsx("div",{children:L.jsx(jh,{style:{marginTop:n?"38px":0},children:v==="programs"&&L.jsx($h,{})})})]})},ap=({showGraph:l,colorBlind:n,openByDefault:c,className:v,overClock:i,style:r,position:s,chart:f,deepAnalyze:u,antialias:h,customData:d,matrixUpdate:m,minimal:y})=>{const x=P.useRef(null);return L.jsxs(L.Fragment,{children:[L.jsx(Sf,{chart:f,overClock:i,deepAnalyze:u,matrixUpdate:m}),L.jsx(Yh,{transform:!1,children:L.jsxs(Uh,{className:(v?" ".concat(v):" ")+` ${s||""} ${y?"minimal":""}`,style:Hl({minHeight:y?"37px":l?"100px":"60px"},r),ref:x,children:[L.jsx(Hh,{perfContainerRef:x,colorBlind:n,chart:f,showGraph:l,antialias:h,customData:d,minimal:y,matrixUpdate:m}),L.jsx(np,{colorBlind:n,showGraph:l,deepAnalyze:u,openByDefault:c,customData:d,matrixUpdate:m,minimal:y})]})})]})},mp=({headless:l=!1,colorBlind:n=!1,overClock:c=!1,showGraph:v=!0,trackCPU:i=!1,deepAnalyze:r=!1,antialias:s=!0,openByDefault:f=!0,customData:u,matrixUpdate:h=!1,position:d="top-right",chart:m={length:30,hz:15},className:y,style:x,minimal:C=!1})=>l?L.jsx(Sf,{chart:m,deepAnalyze:r,matrixUpdate:h,overClock:c}):L.jsx(ap,{colorBlind:n,showGraph:v,trackCPU:i,openByDefault:f,className:y,style:x,overClock:c,position:d,antialias:s,chart:m,deepAnalyze:r,minimal:C,customData:u,matrixUpdate:h}),Ll=5e3,lp={show:"#FF723C",clip:"#FFFF00",episode:"#FF7F50",guest:"#E066FF",topic:"#F8F8FF",Topic:"#F8F8FF",Organization:"#FF7F50"},gp=(l,n)=>{const c=lp[l]||"#F8F8FF";return n?c:parseInt(c.replace("#","0x"),16)},yp=()=>{const{fogColor:l}=Fd("universe",{fogColor:id}),n=Ad(r=>r.graphStyle),c=P.useRef(null),v=P.useRef(null),i=P.useRef(null);return ao(({camera:r,clock:s})=>{const f=s.getElapsedTime();if(c.current){const h=Math.sin(f/8)*1e3;c.current.position.setZ(h)}if(v.current&&v.current.position.lerp(r.position,.5),i.current){const u=f*.5,h=Math.sin(u)*Ll,d=Math.cos(u)*Ll;i.current.position.set(h,0,d)}}),L.jsxs(L.Fragment,{children:[L.jsx("hemisphereLight",{args:[Ji.white,nd,rd]}),n!=="earth"&&L.jsx("fog",{args:[l,5,18e3],attach:"fog"}),L.jsx("ambientLight",{color:Ji.white,intensity:1}),L.jsx("pointLight",{ref:v,color:Ji.white,distance:4e3,intensity:5,position:[0,0,0]}),L.jsx("directionalLight",{ref:i,color:Ji.white,intensity:8,position:[Ll,0,0]}),L.jsx("pointLight",{ref:c,color:Ji.white,distance:4e3,intensity:8,position:[0,0,0]})]})},xp=l=>{const n=P.useRef();return P.useEffect(()=>{n.current=l}),n.current},wp={font:"/fonts/Inter-Bold.woff",characters:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!",fontSize:1,letterSpacing:-.05,lineHeight:1,"material-toneMapped":!1},Sp=(l,n)=>l.length>n?`${l.substring(0,n)}...`:l;export{P1 as C,dp as H,N1 as L,mp as P,vc as T,ao as a,Yc as b,ns as c,ts as d,Hd as e,pp as f,gp as g,wp as h,xp as i,yp as j,hp as m,Sp as t,Si as u}; diff --git a/build/assets/index-4410528e.js b/build/assets/index-49403f56.js similarity index 91% rename from build/assets/index-4410528e.js rename to build/assets/index-49403f56.js index 80d38b598..d70e66938 100644 --- a/build/assets/index-4410528e.js +++ b/build/assets/index-49403f56.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-311f5e1d.js";import{z as xo,b6 as At,x as lo,b4 as Uo,y as dt,V as Ho,aw as ut,aO as pt,b7 as Nt,G as Fo,s as zt,b8 as Dt,W as Vo,T as Et}from"./index-b3d504b4.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-dcbf847f.js";import{c as zo}from"./createSvgIcon-5d2e26a6.js";import{T as _t}from"./TextareaAutosize-8373cbad.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 Jt(e){const{unstable_isActiveElementInListbox:o=Zt,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=Yt,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:J,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),Z=u.useRef(null),be=u.useRef(null),[Me,Y]=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&&Ye?"":_,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?Z.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?Z.current.removeAttribute("aria-activedescendant"):Z.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)Z.current.value=_;else{const ge=ee(j[pe]);Z.current.value=ge,ge.toLowerCase().indexOf(_.toLowerCase())===0&&_.length>0&&Z.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},Ze=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&&Ze()});u.useEffect(()=>{Ze()},[Ze]);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;J&&J(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)&&Z.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&&Z.current.setSelectionRange(Z.current.value.length,Z.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)){Z.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)&&(Z.current.focus(),Le&&We.current&&Z.current.selectionEnd-Z.current.selectionStart===0&&Z.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:Z,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:Y,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",J=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(J),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:J},se,E,{children:[re||U,f.jsx(un,{className:ne(G.label),ownerState:J,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:J,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=>{},[]),Z=lo(fe,C,k.ref,We),[be,Me]=u.useState(!1),Y=so(),H=io({props:s,muiFormControl:Y,states:["color","disabled","error","hiddenLabel","size","required","filled"]});H.focused=Y?Y.focused:be,u.useEffect(()=>{!Y&&$&&be&&(Me(!1),q&&q())},[Y,$,be,q]);const ze=Y&&Y.onFilled,_e=Y&&Y.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),Y&&Y.onFocus?Y.onFocus(z):Me(!0)},to=z=>{q&&q(z),k.onBlur&&k.onBlur(z),Y&&Y.onBlur?Y.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(()=>{Y&&Y.setAdornedStart(!!ie)},[Y,ie]);const me=a({},s,{color:H.color||"primary",disabled:H.disabled,endAdornment:R,error:H.error,focused:H.focused,formControl:Y,fullWidth:M,hiddenLabel:H.hiddenLabel,multiline:N,size:H.size,startAdornment:ie,type:Se}),Ae=vn(me),Ye=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(Ye,a({},De,!Ho(Ye)&&{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:J,type:Se},ce,!Ho(Ee)&&{as:Fe,ownerState:a({},me,ce.ownerState)},{ref:Z,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,Yo;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:J=!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:Z="Open",PaperComponent:be=pt,PopperComponent:Me=No,popupIcon:Y=Yo||(Yo=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:Ye,getTagProps:De,getListboxProps:Ee,getOptionProps:z,value:j,dirty:he,expanded:Ke,id:qe,popupOpen:y,focused:B,focusedTag:X,anchorEl:ke,setAnchorEl:Ze,inputValue:Po,groupedOptions:Ne}=Jt(a({},i,{componentName:"Autocomplete"})),Ge=!E&&!F&&he&&!H,Ue=(!J||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:Ze,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({},Ye(),{"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:Z,title:y?k:Z,ownerState:Ce},l,{className:ne(ve.popupIndicator,l==null?void 0:l.className),children:Y})):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&&!J&&!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,Zo,Jo,Qo,et;const Je=44,Gn=it(Zo||(Zo=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-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` 0% { transform: rotate(0deg); } @@ -6,7 +6,7 @@ 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 100% { transform: rotate(360deg); } -`)),Xn=it(Jo||(Jo=So` +`)),Xn=it(Zo||(Zo=So` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; @@ -21,11 +21,11 @@ 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 stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; } -`)),Yn=e=>{const{classes:o,variant:t,color:r,disableShrink:s}=e,c={root:["root",t,`color${w(r)}`],svg:["svg"],circle:["circle",`circle${w(t)}`,s&&"circleDisableShrink"]};return Ie(c,Kn,o)},Zn=L("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],o[`color${w(t.color)}`]]}})(({ownerState:e,theme:o})=>a({display:"inline-block"},e.variant==="determinate"&&{transition:o.transitions.create("transform")},e.color!=="inherit"&&{color:(o.vars||o).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&ct(Qo||(Qo=So` +`)),Jn=e=>{const{classes:o,variant:t,color:r,disableShrink:s}=e,c={root:["root",t,`color${w(r)}`],svg:["svg"],circle:["circle",`circle${w(t)}`,s&&"circleDisableShrink"]};return Ie(c,Kn,o)},Yn=L("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],o[`color${w(t.color)}`]]}})(({ownerState:e,theme:o})=>a({display:"inline-block"},e.variant==="determinate"&&{transition:o.transitions.create("transform")},e.color!=="inherit"&&{color:(o.vars||o).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&ct(Qo||(Qo=So` animation: ${0} 1.4s linear infinite; - `),Gn)),Jn=L("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,o)=>o.svg})({display:"block"}),Qn=L("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.circle,o[`circle${w(t.variant)}`],t.disableShrink&&o.circleDisableShrink]}})(({ownerState:e,theme:o})=>a({stroke:"currentColor"},e.variant==="determinate"&&{transition:o.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&ct(et||(et=So` + `),Gn)),Zn=L("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,o)=>o.svg})({display:"block"}),Qn=L("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.circle,o[`circle${w(t.variant)}`],t.disableShrink&&o.circleDisableShrink]}})(({ownerState:e,theme:o})=>a({stroke:"currentColor"},e.variant==="determinate"&&{transition:o.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&ct(et||(et=So` animation: ${0} 1.4s ease-in-out infinite; - `),Xn)),er=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiCircularProgress"}),{className:s,color:c="primary",disableShrink:d=!1,size:i=40,style:b,thickness:p=3.6,value:m=0,variant:h="indeterminate"}=r,$=ae(r,qn),v=a({},r,{color:c,disableShrink:d,size:i,thickness:p,value:m,variant:h}),R=Yn(v),M={},P={},O={};if(h==="determinate"){const k=2*Math.PI*((Je-p)/2);M.strokeDasharray=k.toFixed(3),O["aria-valuenow"]=Math.round(m),M.strokeDashoffset=`${((100-m)/100*k).toFixed(3)}px`,P.transform="rotate(-90deg)"}return f.jsx(Zn,a({className:ne(R.root,s),style:a({width:i,height:i},P,b),ownerState:v,ref:t,role:"progressbar"},O,$,{children:f.jsx(Jn,{className:R.svg,ownerState:v,viewBox:`${Je/2} ${Je/2} ${Je} ${Je}`,children:f.jsx(Qn,{className:R.circle,style:M,ownerState:v,cx:Je,cy:Je,r:(Je-p)/2,fill:"none",strokeWidth:p})})}))}),or=er,tr=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],nr=e=>{const{classes:o,disableUnderline:t}=e,s=Ie({root:["root",!t&&"underline"],input:["input"]},Pn,o);return a({},o,s)},rr=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Co(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{var t;const r=e.palette.mode==="light",s=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",c=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",d=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return a({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:d,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c}},[`&.${we.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c},[`&.${we.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i}},!o.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(t=(e.vars||e).palette[o.color||"primary"])==null?void 0:t.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${we.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${we.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${we.disabled}, .${we.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${we.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&a({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),ar=L(Io,{name:"MuiFilledInput",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>a({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),mt=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiFilledInput"}),{components:b={},componentsProps:p,fullWidth:m=!1,inputComponent:h="input",multiline:$=!1,slotProps:v,slots:R={},type:M="text"}=i,P=ae(i,tr),O=a({},i,{fullWidth:m,inputComponent:h,multiline:$,type:M}),k=nr(i),C={root:{ownerState:O},input:{ownerState:O}},I=v??p?To(C,v??p):C,E=(r=(s=R.root)!=null?s:b.Root)!=null?r:rr,N=(c=(d=R.input)!=null?d:b.Input)!=null?c:ar;return f.jsx(Do,a({slots:{root:E,input:N},componentsProps:I,fullWidth:m,inputComponent:h,multiline:$,ref:t,type:M},P,{classes:k}))});mt.muiName="Input";const ht=mt;function lr(e){return ye("MuiFormHelperText",e)}const sr=$e("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),ot=sr;var tt;const ir=["children","className","component","disabled","error","filled","focused","margin","required","variant"],cr=e=>{const{classes:o,contained:t,size:r,disabled:s,error:c,filled:d,focused:i,required:b}=e,p={root:["root",s&&"disabled",c&&"error",r&&`size${w(r)}`,t&&"contained",i&&"focused",d&&"filled",b&&"required"]};return Ie(p,lr,o)},dr=L("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${w(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>a({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${ot.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ot.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),ur=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiFormHelperText"}),{children:s,className:c,component:d="p"}=r,i=ae(r,ir),b=so(),p=io({props:r,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),m=a({},r,{component:d,contained:p.variant==="filled"||p.variant==="outlined",variant:p.variant,size:p.size,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required}),h=cr(m);return f.jsx(dr,a({as:d,ownerState:m,className:ne(h.root,c),ref:t},i,{children:s===" "?tt||(tt=f.jsx("span",{className:"notranslate",children:"​"})):s}))}),pr=ur;function fr(e){return ye("MuiFormLabel",e)}const br=$e("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),bo=br,gr=["children","className","color","component","disabled","error","filled","focused","required"],mr=e=>{const{classes:o,color:t,focused:r,disabled:s,error:c,filled:d,required:i}=e,b={root:["root",`color${w(t)}`,s&&"disabled",c&&"error",d&&"filled",r&&"focused",i&&"required"],asterisk:["asterisk",c&&"error"]};return Ie(b,fr,o)},hr=L("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},o)=>a({},o.root,e.color==="secondary"&&o.colorSecondary,e.filled&&o.filled)})(({theme:e,ownerState:o})=>a({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${bo.focused}`]:{color:(e.vars||e).palette[o.color].main},[`&.${bo.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${bo.error}`]:{color:(e.vars||e).palette.error.main}})),vr=L("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${bo.error}`]:{color:(e.vars||e).palette.error.main}})),xr=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiFormLabel"}),{children:s,className:c,component:d="label"}=r,i=ae(r,gr),b=so(),p=io({props:r,muiFormControl:b,states:["color","required","focused","disabled","error","filled"]}),m=a({},r,{color:p.color||"primary",component:d,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required}),h=mr(m);return f.jsxs(hr,a({as:d,ownerState:m,className:ne(h.root,c),ref:t},i,{children:[s,p.required&&f.jsxs(vr,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[" ","*"]})]}))}),Cr=xr,yr=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],$r=e=>{const{classes:o,disableUnderline:t}=e,s=Ie({root:["root",!t&&"underline"],input:["input"]},yn,o);return a({},o,s)},Ir=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Co(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{let r=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(r=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),a({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(e.vars||e).palette[o.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Qe.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Qe.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Qe.disabled}, .${Qe.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Qe.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Sr=L(Io,{name:"MuiInput",slot:"Input",overridesResolver:yo})({}),vt=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiInput"}),{disableUnderline:b,components:p={},componentsProps:m,fullWidth:h=!1,inputComponent:$="input",multiline:v=!1,slotProps:R,slots:M={},type:P="text"}=i,O=ae(i,yr),k=$r(i),I={root:{ownerState:{disableUnderline:b}}},E=R??m?To(R??m,I):I,N=(r=(s=M.root)!=null?s:p.Root)!=null?r:Ir,F=(c=(d=M.input)!=null?d:p.Input)!=null?c:Sr;return f.jsx(Do,a({slots:{root:N,input:F},slotProps:E,fullWidth:h,inputComponent:$,multiline:v,ref:t,type:P},O,{classes:k}))});vt.muiName="Input";const xt=vt;function Pr(e){return ye("MuiInputLabel",e)}$e("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const kr=["disableAnimation","margin","shrink","variant","className"],Rr=e=>{const{classes:o,formControl:t,size:r,shrink:s,disableAnimation:c,variant:d,required:i}=e,b={root:["root",t&&"formControl",!c&&"animated",s&&"shrink",r&&r!=="normal"&&`size${w(r)}`,d],asterisk:[i&&"asterisk"]},p=Ie(b,Pr,o);return a({},o,p)},Or=L(Cr,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${bo.asterisk}`]:o.asterisk},o.root,t.formControl&&o.formControl,t.size==="small"&&o.sizeSmall,t.shrink&&o.shrink,!t.disableAnimation&&o.animated,t.focused&&o.focused,o[t.variant]]}})(({theme:e,ownerState:o})=>a({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},o.variant==="filled"&&a({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&a({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&a({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),wr=u.forwardRef(function(o,t){const r=Pe({name:"MuiInputLabel",props:o}),{disableAnimation:s=!1,shrink:c,className:d}=r,i=ae(r,kr),b=so();let p=c;typeof p>"u"&&b&&(p=b.filled||b.focused||b.adornedStart);const m=io({props:r,muiFormControl:b,states:["size","variant","required","focused"]}),h=a({},r,{disableAnimation:s,formControl:b,shrink:p,size:m.size,variant:m.variant,required:m.required,focused:m.focused}),$=Rr(h);return f.jsx(Or,a({"data-shrink":p,ownerState:h,ref:t,className:ne($.root,d)},i,{classes:$}))}),Lr=wr,Mr=u.createContext({}),Fr=Mr;function Tr(e){return ye("MuiList",e)}$e("MuiList",["root","padding","dense","subheader"]);const Ar=["children","className","component","dense","disablePadding","subheader"],Nr=e=>{const{classes:o,disablePadding:t,dense:r,subheader:s}=e;return Ie({root:["root",!t&&"padding",r&&"dense",s&&"subheader"]},Tr,o)},zr=L("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,!t.disablePadding&&o.padding,t.dense&&o.dense,t.subheader&&o.subheader]}})(({ownerState:e})=>a({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),Dr=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiList"}),{children:s,className:c,component:d="ul",dense:i=!1,disablePadding:b=!1,subheader:p}=r,m=ae(r,Ar),h=u.useMemo(()=>({dense:i}),[i]),$=a({},r,{component:d,dense:i,disablePadding:b}),v=Nr($);return f.jsx(Fr.Provider,{value:h,children:f.jsxs(zr,a({as:d,className:ne(v.root,c),ref:t,ownerState:$},m,{children:[p,s]}))})}),Er=Dr,Br=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function Mo(e,o,t){return e===o?e.firstChild:o&&o.nextElementSibling?o.nextElementSibling:t?null:e.firstChild}function nt(e,o,t){return e===o?t?e.firstChild:e.lastChild:o&&o.previousElementSibling?o.previousElementSibling:t?null:e.lastChild}function Ct(e,o){if(o===void 0)return!0;let t=e.innerText;return t===void 0&&(t=e.textContent),t=t.trim().toLowerCase(),t.length===0?!1:o.repeating?t[0]===o.keys[0]:t.indexOf(o.keys.join(""))===0}function uo(e,o,t,r,s,c){let d=!1,i=s(e,o,o?t:!1);for(;i;){if(i===e.firstChild){if(d)return!1;d=!0}const b=r?!1:i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||!Ct(i,c)||b)i=s(e,i,t);else return i.focus(),!0}return!1}const jr=u.forwardRef(function(o,t){const{actions:r,autoFocus:s=!1,autoFocusItem:c=!1,children:d,className:i,disabledItemsFocusable:b=!1,disableListWrap:p=!1,onKeyDown:m,variant:h="selectedMenu"}=o,$=ae(o,Br),v=u.useRef(null),R=u.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});dt(()=>{s&&v.current.focus()},[s]),u.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(C,I)=>{const E=!v.current.style.width;if(C.clientHeight{const I=v.current,E=C.key,N=Fo(I).activeElement;if(E==="ArrowDown")C.preventDefault(),uo(I,N,p,b,Mo);else if(E==="ArrowUp")C.preventDefault(),uo(I,N,p,b,nt);else if(E==="Home")C.preventDefault(),uo(I,null,p,b,Mo);else if(E==="End")C.preventDefault(),uo(I,null,p,b,nt);else if(E.length===1){const F=R.current,q=E.toLowerCase(),le=performance.now();F.keys.length>0&&(le-F.lastTime>500?(F.keys=[],F.repeating=!0,F.previousKeyMatched=!0):F.repeating&&q!==F.keys[0]&&(F.repeating=!1)),F.lastTime=le,F.keys.push(q);const de=N&&!F.repeating&&Ct(N,F);F.previousKeyMatched&&(de||uo(I,N,!1,b,Mo,F))?C.preventDefault():F.previousKeyMatched=!1}m&&m(C)},P=lo(v,t);let O=-1;u.Children.forEach(d,(C,I)=>{if(!u.isValidElement(C)){O===I&&(O+=1,O>=d.length&&(O=-1));return}C.props.disabled||(h==="selectedMenu"&&C.props.selected||O===-1)&&(O=I),O===I&&(C.props.disabled||C.props.muiSkipListHighlight||C.type.muiSkipListHighlight)&&(O+=1,O>=d.length&&(O=-1))});const k=u.Children.map(d,(C,I)=>{if(I===O){const E={};return c&&(E.autoFocus=!0),C.props.tabIndex===void 0&&h==="selectedMenu"&&(E.tabIndex=0),u.cloneElement(C,E)}return C});return f.jsx(Er,a({role:"menu",ref:P,className:i,onKeyDown:M,tabIndex:s?0:-1},$,{children:k}))}),Wr=jr;function _r(e){return ye("MuiMenu",e)}$e("MuiMenu",["root","paper","list"]);const Ur=["onEntering"],Hr=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Vr={vertical:"top",horizontal:"right"},Kr={vertical:"top",horizontal:"left"},qr=e=>{const{classes:o}=e;return Ie({root:["root"],paper:["paper"],list:["list"]},_r,o)},Gr=L(zt,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Xr=L(Dt,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,o)=>o.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Yr=L(Wr,{name:"MuiMenu",slot:"List",overridesResolver:(e,o)=>o.list})({outline:0}),Zr=u.forwardRef(function(o,t){var r,s;const c=Pe({props:o,name:"MuiMenu"}),{autoFocus:d=!0,children:i,className:b,disableAutoFocusItem:p=!1,MenuListProps:m={},onClose:h,open:$,PaperProps:v={},PopoverClasses:R,transitionDuration:M="auto",TransitionProps:{onEntering:P}={},variant:O="selectedMenu",slots:k={},slotProps:C={}}=c,I=ae(c.TransitionProps,Ur),E=ae(c,Hr),N=Lt(),F=N.direction==="rtl",q=a({},c,{autoFocus:d,disableAutoFocusItem:p,MenuListProps:m,onEntering:P,PaperProps:v,transitionDuration:M,TransitionProps:I,variant:O}),le=qr(q),de=d&&!p&&$,oe=u.useRef(null),T=(A,ie)=>{oe.current&&oe.current.adjustStyleForScrollbar(A,N),P&&P(A,ie)},J=A=>{A.key==="Tab"&&(A.preventDefault(),h&&h(A,"tabKeyDown"))};let G=-1;u.Children.map(i,(A,ie)=>{u.isValidElement(A)&&(A.props.disabled||(O==="selectedMenu"&&A.props.selected||G===-1)&&(G=ie))});const se=(r=k.paper)!=null?r:Xr,Q=(s=C.paper)!=null?s:v,re=Vo({elementType:k.root,externalSlotProps:C.root,ownerState:q,className:[le.root,b]}),U=Vo({elementType:se,externalSlotProps:Q,ownerState:q,className:le.paper});return f.jsx(Gr,a({onClose:h,anchorOrigin:{vertical:"bottom",horizontal:F?"right":"left"},transformOrigin:F?Vr:Kr,slots:{paper:se,root:k.root},slotProps:{root:re,paper:U},open:$,ref:t,transitionDuration:M,TransitionProps:a({onEntering:T},I),ownerState:q},E,{classes:R,children:f.jsx(Yr,a({onKeyDown:J,actions:oe,autoFocus:d&&(G===-1||p),autoFocusItem:de,variant:O},m,{className:ne(le.list,m.className),children:i}))}))}),Jr=Zr;function Qr(e){return ye("MuiNativeSelect",e)}const ea=$e("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Eo=ea,oa=["className","disabled","error","IconComponent","inputRef","variant"],ta=e=>{const{classes:o,variant:t,disabled:r,multiple:s,open:c,error:d}=e,i={select:["select",t,r&&"disabled",s&&"multiple",d&&"error"],icon:["icon",`icon${w(t)}`,c&&"iconOpen",r&&"disabled"]};return Ie(i,Qr,o)},yt=({ownerState:e,theme:o})=>a({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":a({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Eo.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),na=L("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Xe,overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.select,o[t.variant],t.error&&o.error,{[`&.${Eo.multiple}`]:o.multiple}]}})(yt),$t=({ownerState:e,theme:o})=>a({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${Eo.disabled}`]:{color:(o.vars||o).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),ra=L("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${w(t.variant)}`],t.open&&o.iconOpen]}})($t),aa=u.forwardRef(function(o,t){const{className:r,disabled:s,error:c,IconComponent:d,inputRef:i,variant:b="standard"}=o,p=ae(o,oa),m=a({},o,{disabled:s,variant:b,error:c}),h=ta(m);return f.jsxs(u.Fragment,{children:[f.jsx(na,a({ownerState:m,className:ne(h.select,r),disabled:s,ref:i||t},p)),o.multiple?null:f.jsx(ra,{as:d,ownerState:m,className:h.icon})]})}),la=aa;var rt;const sa=["children","classes","className","label","notched"],ia=L("fieldset",{shouldForwardProp:Xe})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),ca=L("legend",{shouldForwardProp:Xe})(({ownerState:e,theme:o})=>a({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},e.withLabel&&a({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function da(e){const{className:o,label:t,notched:r}=e,s=ae(e,sa),c=t!=null&&t!=="",d=a({},e,{notched:r,withLabel:c});return f.jsx(ia,a({"aria-hidden":!0,className:o,ownerState:d},s,{children:f.jsx(ca,{ownerState:d,children:c?f.jsx("span",{children:t}):rt||(rt=f.jsx("span",{className:"notranslate",children:"​"}))})}))}const ua=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],pa=e=>{const{classes:o}=e,r=Ie({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},In,o);return a({},o,r)},fa=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return a({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Ve.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Ve.focused} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette[o.color].main,borderWidth:2},[`&.${Ve.error} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Ve.disabled} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&a({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),ba=L(da,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,o)=>o.notchedOutline})(({theme:e})=>{const o=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:o}}),ga=L(Io,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>a({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),It=u.forwardRef(function(o,t){var r,s,c,d,i;const b=Pe({props:o,name:"MuiOutlinedInput"}),{components:p={},fullWidth:m=!1,inputComponent:h="input",label:$,multiline:v=!1,notched:R,slots:M={},type:P="text"}=b,O=ae(b,ua),k=pa(b),C=so(),I=io({props:b,muiFormControl:C,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),E=a({},b,{color:I.color||"primary",disabled:I.disabled,error:I.error,focused:I.focused,formControl:C,fullWidth:m,hiddenLabel:I.hiddenLabel,multiline:v,size:I.size,type:P}),N=(r=(s=M.root)!=null?s:p.Root)!=null?r:fa,F=(c=(d=M.input)!=null?d:p.Input)!=null?c:ga;return f.jsx(Do,a({slots:{root:N,input:F},renderSuffix:q=>f.jsx(ba,{ownerState:E,className:k.notchedOutline,label:$!=null&&$!==""&&I.required?i||(i=f.jsxs(u.Fragment,{children:[$," ","*"]})):$,notched:typeof R<"u"?R:!!(q.startAdornment||q.filled||q.focused)}),fullWidth:m,inputComponent:h,multiline:v,ref:t,type:P},O,{classes:a({},k,{notchedOutline:null})}))});It.muiName="Input";const St=It;function ma(e){return ye("MuiSelect",e)}const ha=$e("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),po=ha;var at;const va=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],xa=L("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`&.${po.select}`]:o.select},{[`&.${po.select}`]:o[t.variant]},{[`&.${po.error}`]:o.error},{[`&.${po.multiple}`]:o.multiple}]}})(yt,{[`&.${po.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Ca=L("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${w(t.variant)}`],t.open&&o.iconOpen]}})($t),ya=L("input",{shouldForwardProp:e=>Mt(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function lt(e,o){return typeof o=="object"&&o!==null?e===o:String(e)===String(o)}function $a(e){return e==null||typeof e=="string"&&!e.trim()}const Ia=e=>{const{classes:o,variant:t,disabled:r,multiple:s,open:c,error:d}=e,i={select:["select",t,r&&"disabled",s&&"multiple",d&&"error"],icon:["icon",`icon${w(t)}`,c&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ie(i,ma,o)},Sa=u.forwardRef(function(o,t){var r;const{"aria-describedby":s,"aria-label":c,autoFocus:d,autoWidth:i,children:b,className:p,defaultOpen:m,defaultValue:h,disabled:$,displayEmpty:v,error:R=!1,IconComponent:M,inputRef:P,labelId:O,MenuProps:k={},multiple:C,name:I,onBlur:E,onChange:N,onClose:F,onFocus:q,onOpen:le,open:de,readOnly:oe,renderValue:T,SelectDisplayProps:J={},tabIndex:G,value:se,variant:Q="standard"}=o,re=ae(o,va),[U,A]=fo({controlled:se,default:h,name:"Select"}),[ie,Se]=fo({controlled:de,default:m,name:"Select"}),Le=u.useRef(null),ue=u.useRef(null),[W,ee]=u.useState(null),{current:fe}=u.useRef(de!=null),[We,Z]=u.useState(),be=lo(t,P),Me=u.useCallback(y=>{ue.current=y,y&&ee(y)},[]),Y=W==null?void 0:W.parentNode;u.useImperativeHandle(be,()=>({focus:()=>{ue.current.focus()},node:Le.current,value:U}),[U]),u.useEffect(()=>{m&&ie&&W&&!fe&&(Z(i?null:Y.clientWidth),ue.current.focus())},[W,i]),u.useEffect(()=>{d&&ue.current.focus()},[d]),u.useEffect(()=>{if(!O)return;const y=Fo(ue.current).getElementById(O);if(y){const B=()=>{getSelection().isCollapsed&&ue.current.focus()};return y.addEventListener("click",B),()=>{y.removeEventListener("click",B)}}},[O]);const H=(y,B)=>{y?le&&le(B):F&&F(B),fe||(Z(i?null:Y.clientWidth),Se(y))},ze=y=>{y.button===0&&(y.preventDefault(),ue.current.focus(),H(!0,y))},_e=y=>{H(!1,y)},te=u.Children.toArray(b),S=y=>{const B=te.find(X=>X.props.value===y.target.value);B!==void 0&&(A(B.props.value),N&&N(y,B))},to=y=>B=>{let X;if(B.currentTarget.hasAttribute("tabindex")){if(C){X=Array.isArray(U)?U.slice():[];const ke=U.indexOf(y.props.value);ke===-1?X.push(y.props.value):X.splice(ke,1)}else X=y.props.value;if(y.props.onClick&&y.props.onClick(B),U!==X&&(A(X),N)){const ke=B.nativeEvent||B,Ze=new ke.constructor(ke.type,ke);Object.defineProperty(Ze,"target",{writable:!0,value:{value:X,name:I}}),N(Ze,y)}C||H(!1,B)}},_=y=>{oe||[" ","ArrowUp","ArrowDown","Enter"].indexOf(y.key)!==-1&&(y.preventDefault(),H(!0,y))},xe=W!==null&&ie,Fe=y=>{!xe&&E&&(Object.defineProperty(y,"target",{writable:!0,value:{value:U,name:I}}),E(y))};delete re["aria-invalid"];let ce,Te;const me=[];let Ae=!1;(ft({value:U})||v)&&(T?ce=T(U):Ae=!0);const Ye=te.map(y=>{if(!u.isValidElement(y))return null;let B;if(C){if(!Array.isArray(U))throw new Error(st(2));B=U.some(X=>lt(X,y.props.value)),B&&Ae&&me.push(y.props.children)}else B=lt(U,y.props.value),B&&Ae&&(Te=y.props.children);return u.cloneElement(y,{"aria-selected":B?"true":"false",onClick:to(y),onKeyUp:X=>{X.key===" "&&X.preventDefault(),y.props.onKeyUp&&y.props.onKeyUp(X)},role:"option",selected:B,value:void 0,"data-value":y.props.value})});Ae&&(C?me.length===0?ce=null:ce=me.reduce((y,B,X)=>(y.push(B),X{const{classes:o}=e;return o},Bo={name:"MuiSelect",overridesResolver:(e,o)=>o.root,shouldForwardProp:e=>Xe(e)&&e!=="variant",slot:"Root"},wa=L(xt,Bo)(""),La=L(St,Bo)(""),Ma=L(ht,Bo)(""),Pt=u.forwardRef(function(o,t){const r=Pe({name:"MuiSelect",props:o}),{autoWidth:s=!1,children:c,classes:d={},className:i,defaultOpen:b=!1,displayEmpty:p=!1,IconComponent:m=gt,id:h,input:$,inputProps:v,label:R,labelId:M,MenuProps:P,multiple:O=!1,native:k=!1,onClose:C,onOpen:I,open:E,renderValue:N,SelectDisplayProps:F,variant:q="outlined"}=r,le=ae(r,ka),de=k?la:Pa,oe=so(),T=io({props:r,muiFormControl:oe,states:["variant","error"]}),J=T.variant||q,G=a({},r,{variant:J,classes:d}),se=Oa(G),Q=ae(se,Ra),re=$||{standard:f.jsx(wa,{ownerState:G}),outlined:f.jsx(La,{label:R,ownerState:G}),filled:f.jsx(Ma,{ownerState:G})}[J],U=lo(t,re.ref);return f.jsx(u.Fragment,{children:u.cloneElement(re,a({inputComponent:de,inputProps:a({children:c,error:T.error,IconComponent:m,variant:J,type:void 0,multiple:O},k?{id:h}:{autoWidth:s,defaultOpen:b,displayEmpty:p,labelId:M,MenuProps:P,onClose:C,onOpen:I,open:E,renderValue:N,SelectDisplayProps:a({id:h},F)},v,{classes:v?To(Q,v.classes):Q},$?$.props.inputProps:{})},O&&k&&J==="outlined"?{notched:!0}:{},{ref:U,className:ne(re.props.className,i,se.root)},!$&&{variant:J},le))})});Pt.muiName="Select";const Fa=Pt;function Ta(e){return ye("MuiTextField",e)}$e("MuiTextField",["root"]);const Aa=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Na={standard:xt,filled:ht,outlined:St},za=e=>{const{classes:o}=e;return Ie({root:["root"]},Ta,o)},Da=L(jt,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Ea=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiTextField"}),{autoComplete:s,autoFocus:c=!1,children:d,className:i,color:b="primary",defaultValue:p,disabled:m=!1,error:h=!1,FormHelperTextProps:$,fullWidth:v=!1,helperText:R,id:M,InputLabelProps:P,inputProps:O,InputProps:k,inputRef:C,label:I,maxRows:E,minRows:N,multiline:F=!1,name:q,onBlur:le,onChange:de,onFocus:oe,placeholder:T,required:J=!1,rows:G,select:se=!1,SelectProps:Q,type:re,value:U,variant:A="outlined"}=r,ie=ae(r,Aa),Se=a({},r,{autoFocus:c,color:b,disabled:m,error:h,fullWidth:v,multiline:F,required:J,select:se,variant:A}),Le=za(Se),ue={};A==="outlined"&&(P&&typeof P.shrink<"u"&&(ue.notched=P.shrink),ue.label=I),se&&((!Q||!Q.native)&&(ue.id=void 0),ue["aria-describedby"]=void 0);const W=Ao(M),ee=R&&W?`${W}-helper-text`:void 0,fe=I&&W?`${W}-label`:void 0,We=Na[A],Z=f.jsx(We,a({"aria-describedby":ee,autoComplete:s,autoFocus:c,defaultValue:p,fullWidth:v,multiline:F,name:q,rows:G,maxRows:E,minRows:N,type:re,value:U,id:W,inputRef:C,onBlur:le,onChange:de,onFocus:oe,placeholder:T,inputProps:O},ue,k));return f.jsxs(Da,a({className:ne(Le.root,i),disabled:m,error:h,fullWidth:v,ref:t,required:J,color:b,variant:A,ownerState:Se},ie,{children:[I!=null&&I!==""&&f.jsx(Lr,a({htmlFor:W,id:fe},P,{children:I})),se?f.jsx(Fa,a({"aria-describedby":ee,id:W,labelId:fe,value:U,input:Z},Q,{children:d})):Z,R&&f.jsx(pr,a({id:ee},$,{children:R}))]}))}),Ba=Ea,ja={options:[],getOptionLabel:e=>e.label,handleInputChange:e=>e},qa=({options:e,onSelect:o,selectedValue:t=null,handleInputChange:r,isLoading:s=!1,autoFocus:c=!1,disabled:d=!1,dataTestId:i,dataId:b,placeholder:p,className:m})=>{const h=u.useRef(null),[$,v]=u.useState(!1);u.useEffect(()=>{c&&h.current&&(h.current.focus(),v(!0))},[c]);const R=(M,P)=>{o(P)};return f.jsx(Wt,{flexGrow:1,spacing:1,children:f.jsx(Vn,{...ja,autoFocus:!0,autoHighlight:!0,blurOnSelect:!0,className:m,"data-testid":b,disableClearable:!0,disabled:d,disablePortal:!0,id:"blur-on-select",ListboxProps:{sx:{backgroundColor:je.DROPDOWN_BG,"&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{backgroundClip:"padding-box",backgroundColor:je.SCROLL_BAR,borderRadius:"6px"}},ref:h},loading:s,onChange:R,onClose:()=>v(!1),onInputChange:(M,P)=>r==null?void 0:r(P),onOpen:()=>v(!0),open:$,options:e??[],PopperComponent:({children:M,...P})=>f.jsx(No,{...P,placement:"bottom-start",children:M}),renderInput:M=>f.jsx(Wa,{inputRef:h,...M,"data-testid":i,InputProps:{...M.InputProps,disableUnderline:!0,endAdornment:f.jsx(f.Fragment,{children:s?f.jsx(or,{color:"inherit",size:20}):M.InputProps.endAdornment})},placeholder:p,size:"medium",variant:"standard"}),renderOption:(M,P)=>f.jsx("li",{...M,children:f.jsxs(Tt,{align:"center","data-testid":P.label,direction:"row",grow:1,justify:"space-between",onClick:P==null?void 0:P.action,shrink:1,style:{fontSize:"14px",wordBreak:"break-word"},children:[f.jsx("div",{className:"option",children:P.label!==""?P.label:"Not Selected"}),(P==null?void 0:P.type)&&f.jsx(Et,{type:P.type})]})}),sx:{"&.MuiAutocomplete-option:hover":{backgroundColor:je.DROPDOWN_HOVER},"&.MuiAutocomplete-option[aria-selected='true']":{backgroundColor:je.DROPDOWN_SELECTED}},value:t||void 0})})},Wa=Ft(Ba)` + `),Xn)),er=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiCircularProgress"}),{className:s,color:c="primary",disableShrink:d=!1,size:i=40,style:b,thickness:p=3.6,value:m=0,variant:h="indeterminate"}=r,$=ae(r,qn),v=a({},r,{color:c,disableShrink:d,size:i,thickness:p,value:m,variant:h}),R=Jn(v),M={},P={},O={};if(h==="determinate"){const k=2*Math.PI*((Ze-p)/2);M.strokeDasharray=k.toFixed(3),O["aria-valuenow"]=Math.round(m),M.strokeDashoffset=`${((100-m)/100*k).toFixed(3)}px`,P.transform="rotate(-90deg)"}return f.jsx(Yn,a({className:ne(R.root,s),style:a({width:i,height:i},P,b),ownerState:v,ref:t,role:"progressbar"},O,$,{children:f.jsx(Zn,{className:R.svg,ownerState:v,viewBox:`${Ze/2} ${Ze/2} ${Ze} ${Ze}`,children:f.jsx(Qn,{className:R.circle,style:M,ownerState:v,cx:Ze,cy:Ze,r:(Ze-p)/2,fill:"none",strokeWidth:p})})}))}),or=er,tr=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],nr=e=>{const{classes:o,disableUnderline:t}=e,s=Ie({root:["root",!t&&"underline"],input:["input"]},Pn,o);return a({},o,s)},rr=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Co(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{var t;const r=e.palette.mode==="light",s=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",c=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",d=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return a({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:d,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c}},[`&.${we.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c},[`&.${we.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i}},!o.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(t=(e.vars||e).palette[o.color||"primary"])==null?void 0:t.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${we.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${we.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${we.disabled}, .${we.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${we.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&a({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),ar=L(Io,{name:"MuiFilledInput",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>a({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),mt=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiFilledInput"}),{components:b={},componentsProps:p,fullWidth:m=!1,inputComponent:h="input",multiline:$=!1,slotProps:v,slots:R={},type:M="text"}=i,P=ae(i,tr),O=a({},i,{fullWidth:m,inputComponent:h,multiline:$,type:M}),k=nr(i),C={root:{ownerState:O},input:{ownerState:O}},I=v??p?To(C,v??p):C,E=(r=(s=R.root)!=null?s:b.Root)!=null?r:rr,N=(c=(d=R.input)!=null?d:b.Input)!=null?c:ar;return f.jsx(Do,a({slots:{root:E,input:N},componentsProps:I,fullWidth:m,inputComponent:h,multiline:$,ref:t,type:M},P,{classes:k}))});mt.muiName="Input";const ht=mt;function lr(e){return ye("MuiFormHelperText",e)}const sr=$e("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),ot=sr;var tt;const ir=["children","className","component","disabled","error","filled","focused","margin","required","variant"],cr=e=>{const{classes:o,contained:t,size:r,disabled:s,error:c,filled:d,focused:i,required:b}=e,p={root:["root",s&&"disabled",c&&"error",r&&`size${w(r)}`,t&&"contained",i&&"focused",d&&"filled",b&&"required"]};return Ie(p,lr,o)},dr=L("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${w(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>a({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${ot.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ot.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),ur=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiFormHelperText"}),{children:s,className:c,component:d="p"}=r,i=ae(r,ir),b=so(),p=io({props:r,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),m=a({},r,{component:d,contained:p.variant==="filled"||p.variant==="outlined",variant:p.variant,size:p.size,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required}),h=cr(m);return f.jsx(dr,a({as:d,ownerState:m,className:ne(h.root,c),ref:t},i,{children:s===" "?tt||(tt=f.jsx("span",{className:"notranslate",children:"​"})):s}))}),pr=ur;function fr(e){return ye("MuiFormLabel",e)}const br=$e("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),bo=br,gr=["children","className","color","component","disabled","error","filled","focused","required"],mr=e=>{const{classes:o,color:t,focused:r,disabled:s,error:c,filled:d,required:i}=e,b={root:["root",`color${w(t)}`,s&&"disabled",c&&"error",d&&"filled",r&&"focused",i&&"required"],asterisk:["asterisk",c&&"error"]};return Ie(b,fr,o)},hr=L("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},o)=>a({},o.root,e.color==="secondary"&&o.colorSecondary,e.filled&&o.filled)})(({theme:e,ownerState:o})=>a({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${bo.focused}`]:{color:(e.vars||e).palette[o.color].main},[`&.${bo.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${bo.error}`]:{color:(e.vars||e).palette.error.main}})),vr=L("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${bo.error}`]:{color:(e.vars||e).palette.error.main}})),xr=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiFormLabel"}),{children:s,className:c,component:d="label"}=r,i=ae(r,gr),b=so(),p=io({props:r,muiFormControl:b,states:["color","required","focused","disabled","error","filled"]}),m=a({},r,{color:p.color||"primary",component:d,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required}),h=mr(m);return f.jsxs(hr,a({as:d,ownerState:m,className:ne(h.root,c),ref:t},i,{children:[s,p.required&&f.jsxs(vr,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[" ","*"]})]}))}),Cr=xr,yr=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],$r=e=>{const{classes:o,disableUnderline:t}=e,s=Ie({root:["root",!t&&"underline"],input:["input"]},yn,o);return a({},o,s)},Ir=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Co(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{let r=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(r=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),a({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(e.vars||e).palette[o.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Qe.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Qe.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Qe.disabled}, .${Qe.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Qe.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Sr=L(Io,{name:"MuiInput",slot:"Input",overridesResolver:yo})({}),vt=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiInput"}),{disableUnderline:b,components:p={},componentsProps:m,fullWidth:h=!1,inputComponent:$="input",multiline:v=!1,slotProps:R,slots:M={},type:P="text"}=i,O=ae(i,yr),k=$r(i),I={root:{ownerState:{disableUnderline:b}}},E=R??m?To(R??m,I):I,N=(r=(s=M.root)!=null?s:p.Root)!=null?r:Ir,F=(c=(d=M.input)!=null?d:p.Input)!=null?c:Sr;return f.jsx(Do,a({slots:{root:N,input:F},slotProps:E,fullWidth:h,inputComponent:$,multiline:v,ref:t,type:P},O,{classes:k}))});vt.muiName="Input";const xt=vt;function Pr(e){return ye("MuiInputLabel",e)}$e("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const kr=["disableAnimation","margin","shrink","variant","className"],Rr=e=>{const{classes:o,formControl:t,size:r,shrink:s,disableAnimation:c,variant:d,required:i}=e,b={root:["root",t&&"formControl",!c&&"animated",s&&"shrink",r&&r!=="normal"&&`size${w(r)}`,d],asterisk:[i&&"asterisk"]},p=Ie(b,Pr,o);return a({},o,p)},Or=L(Cr,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${bo.asterisk}`]:o.asterisk},o.root,t.formControl&&o.formControl,t.size==="small"&&o.sizeSmall,t.shrink&&o.shrink,!t.disableAnimation&&o.animated,t.focused&&o.focused,o[t.variant]]}})(({theme:e,ownerState:o})=>a({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},o.variant==="filled"&&a({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&a({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&a({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),wr=u.forwardRef(function(o,t){const r=Pe({name:"MuiInputLabel",props:o}),{disableAnimation:s=!1,shrink:c,className:d}=r,i=ae(r,kr),b=so();let p=c;typeof p>"u"&&b&&(p=b.filled||b.focused||b.adornedStart);const m=io({props:r,muiFormControl:b,states:["size","variant","required","focused"]}),h=a({},r,{disableAnimation:s,formControl:b,shrink:p,size:m.size,variant:m.variant,required:m.required,focused:m.focused}),$=Rr(h);return f.jsx(Or,a({"data-shrink":p,ownerState:h,ref:t,className:ne($.root,d)},i,{classes:$}))}),Lr=wr,Mr=u.createContext({}),Fr=Mr;function Tr(e){return ye("MuiList",e)}$e("MuiList",["root","padding","dense","subheader"]);const Ar=["children","className","component","dense","disablePadding","subheader"],Nr=e=>{const{classes:o,disablePadding:t,dense:r,subheader:s}=e;return Ie({root:["root",!t&&"padding",r&&"dense",s&&"subheader"]},Tr,o)},zr=L("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,!t.disablePadding&&o.padding,t.dense&&o.dense,t.subheader&&o.subheader]}})(({ownerState:e})=>a({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),Dr=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiList"}),{children:s,className:c,component:d="ul",dense:i=!1,disablePadding:b=!1,subheader:p}=r,m=ae(r,Ar),h=u.useMemo(()=>({dense:i}),[i]),$=a({},r,{component:d,dense:i,disablePadding:b}),v=Nr($);return f.jsx(Fr.Provider,{value:h,children:f.jsxs(zr,a({as:d,className:ne(v.root,c),ref:t,ownerState:$},m,{children:[p,s]}))})}),Er=Dr,Br=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function Mo(e,o,t){return e===o?e.firstChild:o&&o.nextElementSibling?o.nextElementSibling:t?null:e.firstChild}function nt(e,o,t){return e===o?t?e.firstChild:e.lastChild:o&&o.previousElementSibling?o.previousElementSibling:t?null:e.lastChild}function Ct(e,o){if(o===void 0)return!0;let t=e.innerText;return t===void 0&&(t=e.textContent),t=t.trim().toLowerCase(),t.length===0?!1:o.repeating?t[0]===o.keys[0]:t.indexOf(o.keys.join(""))===0}function uo(e,o,t,r,s,c){let d=!1,i=s(e,o,o?t:!1);for(;i;){if(i===e.firstChild){if(d)return!1;d=!0}const b=r?!1:i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||!Ct(i,c)||b)i=s(e,i,t);else return i.focus(),!0}return!1}const jr=u.forwardRef(function(o,t){const{actions:r,autoFocus:s=!1,autoFocusItem:c=!1,children:d,className:i,disabledItemsFocusable:b=!1,disableListWrap:p=!1,onKeyDown:m,variant:h="selectedMenu"}=o,$=ae(o,Br),v=u.useRef(null),R=u.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});dt(()=>{s&&v.current.focus()},[s]),u.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(C,I)=>{const E=!v.current.style.width;if(C.clientHeight{const I=v.current,E=C.key,N=Fo(I).activeElement;if(E==="ArrowDown")C.preventDefault(),uo(I,N,p,b,Mo);else if(E==="ArrowUp")C.preventDefault(),uo(I,N,p,b,nt);else if(E==="Home")C.preventDefault(),uo(I,null,p,b,Mo);else if(E==="End")C.preventDefault(),uo(I,null,p,b,nt);else if(E.length===1){const F=R.current,q=E.toLowerCase(),le=performance.now();F.keys.length>0&&(le-F.lastTime>500?(F.keys=[],F.repeating=!0,F.previousKeyMatched=!0):F.repeating&&q!==F.keys[0]&&(F.repeating=!1)),F.lastTime=le,F.keys.push(q);const de=N&&!F.repeating&&Ct(N,F);F.previousKeyMatched&&(de||uo(I,N,!1,b,Mo,F))?C.preventDefault():F.previousKeyMatched=!1}m&&m(C)},P=lo(v,t);let O=-1;u.Children.forEach(d,(C,I)=>{if(!u.isValidElement(C)){O===I&&(O+=1,O>=d.length&&(O=-1));return}C.props.disabled||(h==="selectedMenu"&&C.props.selected||O===-1)&&(O=I),O===I&&(C.props.disabled||C.props.muiSkipListHighlight||C.type.muiSkipListHighlight)&&(O+=1,O>=d.length&&(O=-1))});const k=u.Children.map(d,(C,I)=>{if(I===O){const E={};return c&&(E.autoFocus=!0),C.props.tabIndex===void 0&&h==="selectedMenu"&&(E.tabIndex=0),u.cloneElement(C,E)}return C});return f.jsx(Er,a({role:"menu",ref:P,className:i,onKeyDown:M,tabIndex:s?0:-1},$,{children:k}))}),Wr=jr;function _r(e){return ye("MuiMenu",e)}$e("MuiMenu",["root","paper","list"]);const Ur=["onEntering"],Hr=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Vr={vertical:"top",horizontal:"right"},Kr={vertical:"top",horizontal:"left"},qr=e=>{const{classes:o}=e;return Ie({root:["root"],paper:["paper"],list:["list"]},_r,o)},Gr=L(zt,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Xr=L(Dt,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,o)=>o.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Jr=L(Wr,{name:"MuiMenu",slot:"List",overridesResolver:(e,o)=>o.list})({outline:0}),Yr=u.forwardRef(function(o,t){var r,s;const c=Pe({props:o,name:"MuiMenu"}),{autoFocus:d=!0,children:i,className:b,disableAutoFocusItem:p=!1,MenuListProps:m={},onClose:h,open:$,PaperProps:v={},PopoverClasses:R,transitionDuration:M="auto",TransitionProps:{onEntering:P}={},variant:O="selectedMenu",slots:k={},slotProps:C={}}=c,I=ae(c.TransitionProps,Ur),E=ae(c,Hr),N=Lt(),F=N.direction==="rtl",q=a({},c,{autoFocus:d,disableAutoFocusItem:p,MenuListProps:m,onEntering:P,PaperProps:v,transitionDuration:M,TransitionProps:I,variant:O}),le=qr(q),de=d&&!p&&$,oe=u.useRef(null),T=(A,ie)=>{oe.current&&oe.current.adjustStyleForScrollbar(A,N),P&&P(A,ie)},Z=A=>{A.key==="Tab"&&(A.preventDefault(),h&&h(A,"tabKeyDown"))};let G=-1;u.Children.map(i,(A,ie)=>{u.isValidElement(A)&&(A.props.disabled||(O==="selectedMenu"&&A.props.selected||G===-1)&&(G=ie))});const se=(r=k.paper)!=null?r:Xr,Q=(s=C.paper)!=null?s:v,re=Vo({elementType:k.root,externalSlotProps:C.root,ownerState:q,className:[le.root,b]}),U=Vo({elementType:se,externalSlotProps:Q,ownerState:q,className:le.paper});return f.jsx(Gr,a({onClose:h,anchorOrigin:{vertical:"bottom",horizontal:F?"right":"left"},transformOrigin:F?Vr:Kr,slots:{paper:se,root:k.root},slotProps:{root:re,paper:U},open:$,ref:t,transitionDuration:M,TransitionProps:a({onEntering:T},I),ownerState:q},E,{classes:R,children:f.jsx(Jr,a({onKeyDown:Z,actions:oe,autoFocus:d&&(G===-1||p),autoFocusItem:de,variant:O},m,{className:ne(le.list,m.className),children:i}))}))}),Zr=Yr;function Qr(e){return ye("MuiNativeSelect",e)}const ea=$e("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Eo=ea,oa=["className","disabled","error","IconComponent","inputRef","variant"],ta=e=>{const{classes:o,variant:t,disabled:r,multiple:s,open:c,error:d}=e,i={select:["select",t,r&&"disabled",s&&"multiple",d&&"error"],icon:["icon",`icon${w(t)}`,c&&"iconOpen",r&&"disabled"]};return Ie(i,Qr,o)},yt=({ownerState:e,theme:o})=>a({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":a({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Eo.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),na=L("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Xe,overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.select,o[t.variant],t.error&&o.error,{[`&.${Eo.multiple}`]:o.multiple}]}})(yt),$t=({ownerState:e,theme:o})=>a({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${Eo.disabled}`]:{color:(o.vars||o).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),ra=L("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${w(t.variant)}`],t.open&&o.iconOpen]}})($t),aa=u.forwardRef(function(o,t){const{className:r,disabled:s,error:c,IconComponent:d,inputRef:i,variant:b="standard"}=o,p=ae(o,oa),m=a({},o,{disabled:s,variant:b,error:c}),h=ta(m);return f.jsxs(u.Fragment,{children:[f.jsx(na,a({ownerState:m,className:ne(h.select,r),disabled:s,ref:i||t},p)),o.multiple?null:f.jsx(ra,{as:d,ownerState:m,className:h.icon})]})}),la=aa;var rt;const sa=["children","classes","className","label","notched"],ia=L("fieldset",{shouldForwardProp:Xe})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),ca=L("legend",{shouldForwardProp:Xe})(({ownerState:e,theme:o})=>a({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},e.withLabel&&a({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function da(e){const{className:o,label:t,notched:r}=e,s=ae(e,sa),c=t!=null&&t!=="",d=a({},e,{notched:r,withLabel:c});return f.jsx(ia,a({"aria-hidden":!0,className:o,ownerState:d},s,{children:f.jsx(ca,{ownerState:d,children:c?f.jsx("span",{children:t}):rt||(rt=f.jsx("span",{className:"notranslate",children:"​"}))})}))}const ua=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],pa=e=>{const{classes:o}=e,r=Ie({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},In,o);return a({},o,r)},fa=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return a({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Ve.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Ve.focused} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette[o.color].main,borderWidth:2},[`&.${Ve.error} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Ve.disabled} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&a({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),ba=L(da,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,o)=>o.notchedOutline})(({theme:e})=>{const o=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:o}}),ga=L(Io,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>a({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),It=u.forwardRef(function(o,t){var r,s,c,d,i;const b=Pe({props:o,name:"MuiOutlinedInput"}),{components:p={},fullWidth:m=!1,inputComponent:h="input",label:$,multiline:v=!1,notched:R,slots:M={},type:P="text"}=b,O=ae(b,ua),k=pa(b),C=so(),I=io({props:b,muiFormControl:C,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),E=a({},b,{color:I.color||"primary",disabled:I.disabled,error:I.error,focused:I.focused,formControl:C,fullWidth:m,hiddenLabel:I.hiddenLabel,multiline:v,size:I.size,type:P}),N=(r=(s=M.root)!=null?s:p.Root)!=null?r:fa,F=(c=(d=M.input)!=null?d:p.Input)!=null?c:ga;return f.jsx(Do,a({slots:{root:N,input:F},renderSuffix:q=>f.jsx(ba,{ownerState:E,className:k.notchedOutline,label:$!=null&&$!==""&&I.required?i||(i=f.jsxs(u.Fragment,{children:[$," ","*"]})):$,notched:typeof R<"u"?R:!!(q.startAdornment||q.filled||q.focused)}),fullWidth:m,inputComponent:h,multiline:v,ref:t,type:P},O,{classes:a({},k,{notchedOutline:null})}))});It.muiName="Input";const St=It;function ma(e){return ye("MuiSelect",e)}const ha=$e("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),po=ha;var at;const va=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],xa=L("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`&.${po.select}`]:o.select},{[`&.${po.select}`]:o[t.variant]},{[`&.${po.error}`]:o.error},{[`&.${po.multiple}`]:o.multiple}]}})(yt,{[`&.${po.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Ca=L("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${w(t.variant)}`],t.open&&o.iconOpen]}})($t),ya=L("input",{shouldForwardProp:e=>Mt(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function lt(e,o){return typeof o=="object"&&o!==null?e===o:String(e)===String(o)}function $a(e){return e==null||typeof e=="string"&&!e.trim()}const Ia=e=>{const{classes:o,variant:t,disabled:r,multiple:s,open:c,error:d}=e,i={select:["select",t,r&&"disabled",s&&"multiple",d&&"error"],icon:["icon",`icon${w(t)}`,c&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ie(i,ma,o)},Sa=u.forwardRef(function(o,t){var r;const{"aria-describedby":s,"aria-label":c,autoFocus:d,autoWidth:i,children:b,className:p,defaultOpen:m,defaultValue:h,disabled:$,displayEmpty:v,error:R=!1,IconComponent:M,inputRef:P,labelId:O,MenuProps:k={},multiple:C,name:I,onBlur:E,onChange:N,onClose:F,onFocus:q,onOpen:le,open:de,readOnly:oe,renderValue:T,SelectDisplayProps:Z={},tabIndex:G,value:se,variant:Q="standard"}=o,re=ae(o,va),[U,A]=fo({controlled:se,default:h,name:"Select"}),[ie,Se]=fo({controlled:de,default:m,name:"Select"}),Le=u.useRef(null),ue=u.useRef(null),[W,ee]=u.useState(null),{current:fe}=u.useRef(de!=null),[We,Y]=u.useState(),be=lo(t,P),Me=u.useCallback(y=>{ue.current=y,y&&ee(y)},[]),J=W==null?void 0:W.parentNode;u.useImperativeHandle(be,()=>({focus:()=>{ue.current.focus()},node:Le.current,value:U}),[U]),u.useEffect(()=>{m&&ie&&W&&!fe&&(Y(i?null:J.clientWidth),ue.current.focus())},[W,i]),u.useEffect(()=>{d&&ue.current.focus()},[d]),u.useEffect(()=>{if(!O)return;const y=Fo(ue.current).getElementById(O);if(y){const B=()=>{getSelection().isCollapsed&&ue.current.focus()};return y.addEventListener("click",B),()=>{y.removeEventListener("click",B)}}},[O]);const H=(y,B)=>{y?le&&le(B):F&&F(B),fe||(Y(i?null:J.clientWidth),Se(y))},ze=y=>{y.button===0&&(y.preventDefault(),ue.current.focus(),H(!0,y))},_e=y=>{H(!1,y)},te=u.Children.toArray(b),S=y=>{const B=te.find(X=>X.props.value===y.target.value);B!==void 0&&(A(B.props.value),N&&N(y,B))},to=y=>B=>{let X;if(B.currentTarget.hasAttribute("tabindex")){if(C){X=Array.isArray(U)?U.slice():[];const ke=U.indexOf(y.props.value);ke===-1?X.push(y.props.value):X.splice(ke,1)}else X=y.props.value;if(y.props.onClick&&y.props.onClick(B),U!==X&&(A(X),N)){const ke=B.nativeEvent||B,Ye=new ke.constructor(ke.type,ke);Object.defineProperty(Ye,"target",{writable:!0,value:{value:X,name:I}}),N(Ye,y)}C||H(!1,B)}},_=y=>{oe||[" ","ArrowUp","ArrowDown","Enter"].indexOf(y.key)!==-1&&(y.preventDefault(),H(!0,y))},xe=W!==null&&ie,Fe=y=>{!xe&&E&&(Object.defineProperty(y,"target",{writable:!0,value:{value:U,name:I}}),E(y))};delete re["aria-invalid"];let ce,Te;const me=[];let Ae=!1;(ft({value:U})||v)&&(T?ce=T(U):Ae=!0);const Je=te.map(y=>{if(!u.isValidElement(y))return null;let B;if(C){if(!Array.isArray(U))throw new Error(st(2));B=U.some(X=>lt(X,y.props.value)),B&&Ae&&me.push(y.props.children)}else B=lt(U,y.props.value),B&&Ae&&(Te=y.props.children);return u.cloneElement(y,{"aria-selected":B?"true":"false",onClick:to(y),onKeyUp:X=>{X.key===" "&&X.preventDefault(),y.props.onKeyUp&&y.props.onKeyUp(X)},role:"option",selected:B,value:void 0,"data-value":y.props.value})});Ae&&(C?me.length===0?ce=null:ce=me.reduce((y,B,X)=>(y.push(B),X{const{classes:o}=e;return o},Bo={name:"MuiSelect",overridesResolver:(e,o)=>o.root,shouldForwardProp:e=>Xe(e)&&e!=="variant",slot:"Root"},wa=L(xt,Bo)(""),La=L(St,Bo)(""),Ma=L(ht,Bo)(""),Pt=u.forwardRef(function(o,t){const r=Pe({name:"MuiSelect",props:o}),{autoWidth:s=!1,children:c,classes:d={},className:i,defaultOpen:b=!1,displayEmpty:p=!1,IconComponent:m=gt,id:h,input:$,inputProps:v,label:R,labelId:M,MenuProps:P,multiple:O=!1,native:k=!1,onClose:C,onOpen:I,open:E,renderValue:N,SelectDisplayProps:F,variant:q="outlined"}=r,le=ae(r,ka),de=k?la:Pa,oe=so(),T=io({props:r,muiFormControl:oe,states:["variant","error"]}),Z=T.variant||q,G=a({},r,{variant:Z,classes:d}),se=Oa(G),Q=ae(se,Ra),re=$||{standard:f.jsx(wa,{ownerState:G}),outlined:f.jsx(La,{label:R,ownerState:G}),filled:f.jsx(Ma,{ownerState:G})}[Z],U=lo(t,re.ref);return f.jsx(u.Fragment,{children:u.cloneElement(re,a({inputComponent:de,inputProps:a({children:c,error:T.error,IconComponent:m,variant:Z,type:void 0,multiple:O},k?{id:h}:{autoWidth:s,defaultOpen:b,displayEmpty:p,labelId:M,MenuProps:P,onClose:C,onOpen:I,open:E,renderValue:N,SelectDisplayProps:a({id:h},F)},v,{classes:v?To(Q,v.classes):Q},$?$.props.inputProps:{})},O&&k&&Z==="outlined"?{notched:!0}:{},{ref:U,className:ne(re.props.className,i,se.root)},!$&&{variant:Z},le))})});Pt.muiName="Select";const Fa=Pt;function Ta(e){return ye("MuiTextField",e)}$e("MuiTextField",["root"]);const Aa=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Na={standard:xt,filled:ht,outlined:St},za=e=>{const{classes:o}=e;return Ie({root:["root"]},Ta,o)},Da=L(jt,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Ea=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiTextField"}),{autoComplete:s,autoFocus:c=!1,children:d,className:i,color:b="primary",defaultValue:p,disabled:m=!1,error:h=!1,FormHelperTextProps:$,fullWidth:v=!1,helperText:R,id:M,InputLabelProps:P,inputProps:O,InputProps:k,inputRef:C,label:I,maxRows:E,minRows:N,multiline:F=!1,name:q,onBlur:le,onChange:de,onFocus:oe,placeholder:T,required:Z=!1,rows:G,select:se=!1,SelectProps:Q,type:re,value:U,variant:A="outlined"}=r,ie=ae(r,Aa),Se=a({},r,{autoFocus:c,color:b,disabled:m,error:h,fullWidth:v,multiline:F,required:Z,select:se,variant:A}),Le=za(Se),ue={};A==="outlined"&&(P&&typeof P.shrink<"u"&&(ue.notched=P.shrink),ue.label=I),se&&((!Q||!Q.native)&&(ue.id=void 0),ue["aria-describedby"]=void 0);const W=Ao(M),ee=R&&W?`${W}-helper-text`:void 0,fe=I&&W?`${W}-label`:void 0,We=Na[A],Y=f.jsx(We,a({"aria-describedby":ee,autoComplete:s,autoFocus:c,defaultValue:p,fullWidth:v,multiline:F,name:q,rows:G,maxRows:E,minRows:N,type:re,value:U,id:W,inputRef:C,onBlur:le,onChange:de,onFocus:oe,placeholder:T,inputProps:O},ue,k));return f.jsxs(Da,a({className:ne(Le.root,i),disabled:m,error:h,fullWidth:v,ref:t,required:Z,color:b,variant:A,ownerState:Se},ie,{children:[I!=null&&I!==""&&f.jsx(Lr,a({htmlFor:W,id:fe},P,{children:I})),se?f.jsx(Fa,a({"aria-describedby":ee,id:W,labelId:fe,value:U,input:Y},Q,{children:d})):Y,R&&f.jsx(pr,a({id:ee},$,{children:R}))]}))}),Ba=Ea,ja={options:[],getOptionLabel:e=>e.label,handleInputChange:e=>e},qa=({options:e,onSelect:o,selectedValue:t=null,handleInputChange:r,isLoading:s=!1,autoFocus:c=!1,disabled:d=!1,dataTestId:i,dataId:b,placeholder:p,className:m})=>{const h=u.useRef(null),[$,v]=u.useState(!1);u.useEffect(()=>{c&&h.current&&(h.current.focus(),v(!0))},[c]);const R=(M,P)=>{o(P)};return f.jsx(Wt,{flexGrow:1,spacing:1,children:f.jsx(Vn,{...ja,autoFocus:!0,autoHighlight:!0,blurOnSelect:!0,className:m,"data-testid":b,disableClearable:!0,disabled:d,disablePortal:!0,id:"blur-on-select",ListboxProps:{sx:{backgroundColor:je.DROPDOWN_BG,"&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{backgroundClip:"padding-box",backgroundColor:je.SCROLL_BAR,borderRadius:"6px"}},ref:h},loading:s,onChange:R,onClose:()=>v(!1),onInputChange:(M,P)=>r==null?void 0:r(P),onOpen:()=>v(!0),open:$,options:e??[],PopperComponent:({children:M,...P})=>f.jsx(No,{...P,placement:"bottom-start",children:M}),renderInput:M=>f.jsx(Wa,{inputRef:h,...M,"data-testid":i,InputProps:{...M.InputProps,disableUnderline:!0,endAdornment:f.jsx(f.Fragment,{children:s?f.jsx(or,{color:"inherit",size:20}):M.InputProps.endAdornment})},placeholder:p,size:"medium",variant:"standard"}),renderOption:(M,P)=>f.jsx("li",{...M,children:f.jsxs(Tt,{align:"center","data-testid":P.label,direction:"row",grow:1,justify:"space-between",onClick:P==null?void 0:P.action,shrink:1,style:{fontSize:"14px",wordBreak:"break-word"},children:[f.jsx("div",{className:"option",children:P.label!==""?P.label:"Not Selected"}),(P==null?void 0:P.type)&&f.jsx(Et,{type:P.type})]})}),sx:{"&.MuiAutocomplete-option:hover":{backgroundColor:je.DROPDOWN_HOVER},"&.MuiAutocomplete-option[aria-selected='true']":{backgroundColor:je.DROPDOWN_SELECTED}},value:t||void 0})})},Wa=Ft(Ba)` && { z-index: 2; width: 100%; diff --git a/build/assets/index-dfcc1a18.js b/build/assets/index-4cad102d.js similarity index 99% rename from build/assets/index-dfcc1a18.js rename to build/assets/index-4cad102d.js index 9c65d50e8..dc646134d 100644 --- a/build/assets/index-dfcc1a18.js +++ b/build/assets/index-4cad102d.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-311f5e1d.js";import{v as wa,w as hI,x as Al,y as sj,z as bl,G as yl,J as Vc,K as gI,L as lj,Q as uj,R as cj,U as ix,V as vl,W as zr,X as ox,Y as Hs,Z as Ay,$ as dj,a0 as pj,a1 as mI,a2 as fj,P as ky,a3 as bI,i as Jn,T as Ai,a4 as Pr,a5 as yI,a6 as hj,a7 as ps,a8 as gj,a9 as Oy,aa as Iu,ab as Iy,B as qt,ac as mj,ad as vI,ae as SI,af as bj,s as yj,ag as xI,ah as EI,ai as vj,aj as Sj,u as Vm,ak as Ru,al as xj,am as Ej,an as wj,ao as _j,ap as Ry,aq as Tj,ar as Aj,as as kj,at 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-b3d504b4.js";import{c as Fj,a as Yc,C as Nu}from"./ClipLoader-3e52df85.js";import{S as AI}from"./Skeleton-af57499b.js";import{u as kI,P as Cy,a as Bj,F as Uj}from"./Stack-dcbf847f.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-1d4da850.js";import{c as Dy}from"./createSvgIcon-5d2e26a6.js";import{B as eF}from"./index-146a182e.js";import{u as RI}from"./index-d6bbde2b.js";import{b as tF,a as nF,c as rF,d as aF}from"./index.esm-46402b6f.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-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"}))` 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-b4edb4e4.js").then(e=>e.Y),["assets/YouTube-b4edb4e4.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"soundcloud",name:"SoundCloud",canPlay:un.canPlay.soundcloud,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./SoundCloud-deab1d49.js").then(e=>e.S),["assets/SoundCloud-deab1d49.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"vimeo",name:"Vimeo",canPlay:un.canPlay.vimeo,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Vimeo-794f619c.js").then(e=>e.V),["assets/Vimeo-794f619c.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"facebook",name:"Facebook",canPlay:un.canPlay.facebook,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Facebook-efd3df3f.js").then(e=>e.F),["assets/Facebook-efd3df3f.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"streamable",name:"Streamable",canPlay:un.canPlay.streamable,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Streamable-5d47d4dc.js").then(e=>e.S),["assets/Streamable-5d47d4dc.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"wistia",name:"Wistia",canPlay:un.canPlay.wistia,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Wistia-b4231027.js").then(e=>e.W),["assets/Wistia-b4231027.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"twitch",name:"Twitch",canPlay:un.canPlay.twitch,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Twitch-9bb7747c.js").then(e=>e.T),["assets/Twitch-9bb7747c.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"dailymotion",name:"DailyMotion",canPlay:un.canPlay.dailymotion,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./DailyMotion-151f0a1e.js").then(e=>e.D),["assets/DailyMotion-151f0a1e.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"mixcloud",name:"Mixcloud",canPlay:un.canPlay.mixcloud,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Mixcloud-7278c891.js").then(e=>e.M),["assets/Mixcloud-7278c891.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"vidyard",name:"Vidyard",canPlay:un.canPlay.vidyard,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Vidyard-326cf564.js").then(e=>e.V),["assets/Vidyard-326cf564.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]))},{key:"kaltura",name:"Kaltura",canPlay:un.canPlay.kaltura,lazyPlayer:(0,mn.lazy)(()=>bn(()=>import("./Kaltura-eca24f7e.js").then(e=>e.K),["assets/Kaltura-eca24f7e.js","assets/index-311f5e1d.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-07b6fa1b.js").then(e=>e.F),["assets/FilePlayer-07b6fa1b.js","assets/index-311f5e1d.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-44e8e206.js").then(e=>e.P),["assets/Preview-44e8e206.js","assets/index-311f5e1d.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-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)` height: 60px; padding: 12px 16px; ${e=>e.showToolbar&&` diff --git a/build/assets/index-615a69d5.js b/build/assets/index-615a69d5.js deleted file mode 100644 index 777e1dbfb..000000000 --- a/build/assets/index-615a69d5.js +++ /dev/null @@ -1,859 +0,0 @@ -import{r as D,b as Ls,j as U,R as ro,p as ku,t as Ye,v as Oe,F as Os,q as On,z as wu,y as vr,J as pf,w as Su,U as mf,A as _f,V as gf,C as vf,X as yf,H as xf,Y as Tf,O as kf}from"./index-311f5e1d.js";import{u as Pe,a as Uo,e as oc,b as Bt,L as wf,c as Sf,d as bf,m as Cf,f as Ef,g as Of,h as bu,H as yr,t as Cu,T as Af,i as Mf,j as Pf,D as Df,C as Rf,P as If,k as Nf}from"./index-52ffd3c1.js";import{D as Ir,F as Ff,V as le,L as Uf,a as Lf,M as Rn,b as ae,S as Bf,B as zf,c as Eu,P as oa,d as Ou,e as Jr,f as nn,T as Lo,g as hn,h as Vf,C as ys,W as jf,i as Hf,E as ac,j as At,N as Jn,k as qf,l as fi,U as ks,m as Gf,n as Wf,o as Yf,p as Zf,q as $f,r as Nr,s as as,t as Xf,u as he,R as Qf,v as As,w as Da,x as Au,y as cc,z as ll,A as Kf,G as oo,H as Jf,I as Mu,J as Pu,K as Du,O as Ru,Q as ul,X as ep,Y as Fr,Z as tp,_ as sp,$ as np,a0 as ip,a1 as xr,a2 as hl,a3 as dl}from"./three.module-ebe9f2a4.js";import{B as Iu,c as fl,H as rp,E as op,_ as We,d as $t,e as cs,f as ht,g as lc,h as Bo,T as pl,i as ap,j as cp,k as lp,l as up,m as hp,n as dp,D as fp,o as pp,I as mp,u as Ur,p as _p,q as gp,P as vp,r as yp,N as xp,s as Tp,O as kp,t as wp}from"./index-b3d504b4.js";import{T as Sp}from"./TextareaAutosize-8373cbad.js";import{M as bp,a as Cp}from"./index.esm-46402b6f.js";import{u as Ep}from"./index-d6bbde2b.js";import{C as Op}from"./ClipLoader-3e52df85.js";function Ap(n){let e;const t=new Set,s=(l,u)=>{const h=typeof l=="function"?l(e):l;if(h!==e){const d=e;e=u?h:Object.assign({},e,h),t.forEach(f=>f(e,d))}},i=()=>e,r=(l,u=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(e);function f(){const m=u(e);if(!h(d,m)){const p=d;l(d=m,p)}}return t.add(f),()=>t.delete(f)},c={setState:s,getState:i,subscribe:(l,u,h)=>u||h?r(l,u,h):(t.add(l),()=>t.delete(l)),destroy:()=>t.clear()};return e=n(s,i,c),c}const Mp=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ml=Mp?D.useEffect:D.useLayoutEffect;function Pp(n){const e=typeof n=="function"?Ap(n):n,t=(s=e.getState,i=Object.is)=>{const[,r]=D.useReducer(_=>_+1,0),o=e.getState(),a=D.useRef(o),c=D.useRef(s),l=D.useRef(i),u=D.useRef(!1),h=D.useRef();h.current===void 0&&(h.current=s(o));let d,f=!1;(a.current!==o||c.current!==s||l.current!==i||u.current)&&(d=s(o),f=!i(h.current,d)),ml(()=>{f&&(h.current=d),a.current=o,c.current=s,l.current=i,u.current=!1});const m=D.useRef(o);ml(()=>{const _=()=>{try{const k=e.getState(),w=c.current(k);l.current(h.current,w)||(a.current=k,h.current=w,r())}catch{u.current=!0,r()}},y=e.subscribe(_);return e.getState()!==m.current&&_(),y},[]);const p=f?d:h.current;return D.useDebugValue(p),p};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const s=[t,e];return{next(){const i=s.length<=0;return{value:s.shift(),done:i}}}},t}let xi=0;const Dp=Pp(n=>(Ir.onStart=(e,t,s)=>{n({active:!0,item:e,loaded:t,total:s,progress:(t-xi)/(s-xi)*100})},Ir.onLoad=()=>{n({active:!1})},Ir.onError=e=>n(t=>({errors:[...t.errors,e]})),Ir.onProgress=(e,t,s)=>{t===s&&(xi=s),n({active:!0,item:e,loaded:t,total:s,progress:(t-xi)/(s-xi)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),Rp=n=>`Loading ${n.toFixed(2)}%`;function Ip({containerStyles:n,innerStyles:e,barStyles:t,dataStyles:s,dataInterpolation:i=Rp,initialState:r=o=>o}){const{active:o,progress:a}=Dp(),c=D.useRef(0),l=D.useRef(0),u=D.useRef(null),[h,d]=D.useState(r(o));D.useEffect(()=>{let m;return o!==h&&(m=setTimeout(()=>d(o),300)),()=>clearTimeout(m)},[h,o]);const f=D.useCallback(()=>{u.current&&(c.current+=(a-c.current)/2,(c.current>.95*a||a===100)&&(c.current=a),u.current.innerText=i(c.current),c.current(f(),()=>cancelAnimationFrame(l.current)),[f]),h?D.createElement("div",{style:{...Lr.container,opacity:o?1:0,...n}},D.createElement("div",null,D.createElement("div",{style:{...Lr.inner,...e}},D.createElement("div",{style:{...Lr.bar,transform:`scaleX(${a/100})`,...t}}),D.createElement("span",{ref:u,style:{...Lr.data,...s}})))):null}const Lr={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"}};let Ti;function Np(){var n;if(Ti!==void 0)return Ti;try{let e;const t=document.createElement("canvas");return Ti=!!(window.WebGL2RenderingContext&&(e=t.getContext("webgl2"))),e&&((n=e.getExtension("WEBGL_lose_context"))==null||n.loseContext()),Ti}catch{return Ti=!1}}const aa=new Ff,ca=new le,In=new le,Vt=new le,ds=new le,Kt=new le,fs=new le,ps=new le,ki=new le,wi=new le,Si=new le,Br=new le,bi=new le,Ci=new le,Ei=new le;class Fp{constructor(e,t,s){this.camera=e,this.scene=t,this.startPoint=new le,this.endPoint=new le,this.collection=[],this.deep=s||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(aa,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){In.copy(e),In.x=Math.min(e.x,t.x),In.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),Vt.setFromMatrixPosition(this.camera.matrixWorld),ds.copy(In),Kt.set(t.x,In.y,0),fs.copy(t),ps.set(In.x,t.y,0),ds.unproject(this.camera),Kt.unproject(this.camera),fs.unproject(this.camera),ps.unproject(this.camera),bi.copy(ds).sub(Vt),Ci.copy(Kt).sub(Vt),Ei.copy(fs).sub(Vt),bi.normalize(),Ci.normalize(),Ei.normalize(),bi.multiplyScalar(this.deep),Ci.multiplyScalar(this.deep),Ei.multiplyScalar(this.deep),bi.add(Vt),Ci.add(Vt),Ei.add(Vt);var s=aa.planes;s[0].setFromCoplanarPoints(Vt,ds,Kt),s[1].setFromCoplanarPoints(Vt,Kt,fs),s[2].setFromCoplanarPoints(fs,ps,Vt),s[3].setFromCoplanarPoints(ps,ds,Vt),s[4].setFromCoplanarPoints(Kt,fs,ps),s[5].setFromCoplanarPoints(Ei,Ci,bi),s[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const i=Math.min(e.x,t.x),r=Math.max(e.y,t.y),o=Math.max(e.x,t.x),a=Math.min(e.y,t.y);ds.set(i,r,-1),Kt.set(o,r,-1),fs.set(o,a,-1),ps.set(i,a,-1),ki.set(i,r,1),wi.set(o,r,1),Si.set(o,a,1),Br.set(i,a,1),ds.unproject(this.camera),Kt.unproject(this.camera),fs.unproject(this.camera),ps.unproject(this.camera),ki.unproject(this.camera),wi.unproject(this.camera),Si.unproject(this.camera),Br.unproject(this.camera);var s=aa.planes;s[0].setFromCoplanarPoints(ds,ki,wi),s[1].setFromCoplanarPoints(Kt,wi,Si),s[2].setFromCoplanarPoints(Si,Br,ps),s[3].setFromCoplanarPoints(Br,ki,ds),s[4].setFromCoplanarPoints(Kt,fs,ps),s[5].setFromCoplanarPoints(Si,wi,ki),s[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&t.material!==void 0&&(t.geometry.boundingSphere===null&&t.geometry.computeBoundingSphere(),ca.copy(t.geometry.boundingSphere.center),ca.applyMatrix4(t.matrixWorld),e.containsPoint(ca)&&this.collection.push(t)),t.children.length>0)for(let s=0;s0?$.copy(M[M.length-1]):$.identity())}function i(N){const F=new nn,C=new ae,P=new ae,G=new ae;let I=!0,B=!1;const se=N.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi);for(let ne=0,J=se.length;ne0&&(C.copy(G),F.currentPath.currentPoint.copy(C),I=!0);break;default:console.warn(ge)}B=!1}return F}function r(N){if(!(!N.sheet||!N.sheet.cssRules||!N.sheet.cssRules.length))for(let F=0;FG.trim());for(let G=0;G1){const cl=Math.sqrt(X);F=cl*F,C=cl*C,K=F*F,j=C*C}const ee=K*E+j*O,ue=(K*j-ee)/ee;let ke=Math.sqrt(Math.max(0,ue));G===I&&(ke=-ke);const Xe=ke*F*ge/C,zt=-ke*C*J/F,yi=Math.cos(P)*Xe-Math.sin(P)*zt+(B.x+ie.x)/2,ra=Math.sin(P)*Xe+Math.cos(P)*zt+(B.y+ie.y)/2,Rr=a(1,0,(J-Xe)/F,(ge-zt)/C),ff=a((J-Xe)/F,(ge-zt)/C,(-J-Xe)/F,(-ge-zt)/C)%(Math.PI*2);N.currentPath.absellipse(yi,ra,F,C,Rr,Rr+ff,I===0,P)}function a(N,F,C,P){const G=N*C+F*P,I=Math.sqrt(N*N+F*F)*Math.sqrt(C*C+P*P);let B=Math.acos(Math.max(-1,Math.min(1,G/I)));return N*P-F*C<0&&(B=-B),B}function c(N){const F=w(N.getAttribute("x")||0),C=w(N.getAttribute("y")||0),P=w(N.getAttribute("rx")||N.getAttribute("ry")||0),G=w(N.getAttribute("ry")||N.getAttribute("rx")||0),I=w(N.getAttribute("width")),B=w(N.getAttribute("height")),ie=1-.551915024494,se=new nn;return se.moveTo(F+P,C),se.lineTo(F+I-P,C),(P!==0||G!==0)&&se.bezierCurveTo(F+I-P*ie,C,F+I,C+G*ie,F+I,C+G),se.lineTo(F+I,C+B-G),(P!==0||G!==0)&&se.bezierCurveTo(F+I,C+B-G*ie,F+I-P*ie,C+B,F+I-P,C+B),se.lineTo(F+P,C+B),(P!==0||G!==0)&&se.bezierCurveTo(F+P*ie,C+B,F,C+B-G*ie,F,C+B-G),se.lineTo(F,C+G),(P!==0||G!==0)&&se.bezierCurveTo(F,C+G*ie,F+P*ie,C,F+P,C),se}function l(N){function F(I,B,ie){const se=w(B),ne=w(ie);G===0?P.moveTo(se,ne):P.lineTo(se,ne),G++}const C=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,P=new nn;let G=0;return N.getAttribute("points").replace(C,F),P.currentPath.autoClose=!0,P}function u(N){function F(I,B,ie){const se=w(B),ne=w(ie);G===0?P.moveTo(se,ne):P.lineTo(se,ne),G++}const C=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,P=new nn;let G=0;return N.getAttribute("points").replace(C,F),P.currentPath.autoClose=!1,P}function h(N){const F=w(N.getAttribute("cx")||0),C=w(N.getAttribute("cy")||0),P=w(N.getAttribute("r")||0),G=new oa;G.absarc(F,C,P,0,Math.PI*2);const I=new nn;return I.subPaths.push(G),I}function d(N){const F=w(N.getAttribute("cx")||0),C=w(N.getAttribute("cy")||0),P=w(N.getAttribute("rx")||0),G=w(N.getAttribute("ry")||0),I=new oa;I.absellipse(F,C,P,G,0,Math.PI*2);const B=new nn;return B.subPaths.push(I),B}function f(N){const F=w(N.getAttribute("x1")||0),C=w(N.getAttribute("y1")||0),P=w(N.getAttribute("x2")||0),G=w(N.getAttribute("y2")||0),I=new nn;return I.moveTo(F,C),I.lineTo(P,G),I.currentPath.autoClose=!1,I}function m(N,F){F=Object.assign({},F);let C={};if(N.hasAttribute("class")){const B=N.getAttribute("class").split(/\s/).filter(Boolean).map(ie=>ie.trim());for(let ie=0;ie0&&F.premultiply(M[M.length-1]),$.copy(F),M.push(F),F}function g(N){const F=new Rn,C=L;if(N.nodeName==="use"&&(N.hasAttribute("x")||N.hasAttribute("y"))){const P=w(N.getAttribute("x")),G=w(N.getAttribute("y"));F.translate(P,G)}if(N.hasAttribute("transform")){const P=N.getAttribute("transform").split(")");for(let G=P.length-1;G>=0;G--){const I=P[G].trim();if(I==="")continue;const B=I.indexOf("("),ie=I.length;if(B>0&&B=1){const J=ne[0];let ge=J;ne.length>=2&&(ge=ne[1]),C.translate(J,ge)}break;case"rotate":if(ne.length>=1){let J=0,ge=0,K=0;J=-ne[0]*Math.PI/180,ne.length>=3&&(ge=ne[1],K=ne[2]),q.identity().translate(-ge,-K),Y.identity().rotate(J),W.multiplyMatrices(Y,q),q.identity().translate(ge,K),C.multiplyMatrices(q,W)}break;case"scale":if(ne.length>=1){const J=ne[0];let ge=J;ne.length>=2&&(ge=ne[1]),C.scale(J,ge)}break;case"skewX":ne.length===1&&C.set(1,Math.tan(ne[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":ne.length===1&&C.set(1,0,0,Math.tan(ne[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":ne.length===6&&C.set(ne[0],ne[2],ne[4],ne[1],ne[3],ne[5],0,0,1);break}}F.premultiply(C)}}return F}function S(N,F){function C(I){z.set(I.x,I.y,1).applyMatrix3(F),I.set(z.x,z.y)}const P=T(F),G=N.subPaths;for(let I=0,B=G.length;I=1||W<0||W>1)return null;if(M===0&&q===0){for(let V=0;V<2;V++)if(o(V===0?k:w,_,y),i.loc==s.ORIGIN){const z=V===0?k:w;return{x:z.x,y:z.y,t:i.t}}else if(i.loc==s.BETWEEN){const z=+(v+i.t*(g-v)).toPrecision(10),$=+(x+i.t*(b-x)).toPrecision(10);return{x:z,y:$,t:i.t}}return null}else{for(let $=0;$<2;$++)if(o($===0?k:w,_,y),i.loc==s.ORIGIN){const Q=$===0?k:w;return{x:Q.x,y:Q.y,t:i.t}}const V=+(v+Y*(g-v)).toPrecision(10),z=+(x+Y*(b-x)).toPrecision(10);return{x:V,y:z,t:Y}}}function o(_,y,k){const w=k.x-y.x,v=k.y-y.y,g=_.x-y.x,S=_.y-y.y,T=w*S-g*v;if(_.x===y.x&&_.y===y.y){i.loc=s.ORIGIN,i.t=0;return}if(_.x===k.x&&_.y===k.y){i.loc=s.DESTINATION,i.t=1;return}if(T<-Number.EPSILON){i.loc=s.LEFT;return}if(T>Number.EPSILON){i.loc=s.RIGHT;return}if(w*g<0||v*S<0){i.loc=s.BEHIND;return}if(Math.sqrt(w*w+v*v)R.t<=A.t+Number.EPSILON&&R.t>=A.t-Number.EPSILON)===void 0&&(k.push(A),w.push(new ae(A.x,A.y)))}}return w}function c(_,y,k){const w=new ae;y.getCenter(w);const v=[];return k.forEach(g=>{g.boundingBox.containsPoint(w)&&a(_,g.points).forEach(T=>{v.push({identifier:g.identifier,isCW:g.isCW,point:T})})}),v.sort((g,S)=>g.point.x-S.point.x),v}function l(_,y,k,w,v){(v==null||v==="")&&(v="nonzero");const g=new ae;_.boundingBox.getCenter(g);const S=[new ae(k,g.y),new ae(w,g.y)],T=c(S,_.boundingBox,y);T.sort((L,q)=>L.point.x-q.point.x);const x=[],b=[];T.forEach(L=>{L.identifier===_.identifier?x.push(L):b.push(L)});const A=x[0].point.x,R=[];let M=0;for(;M0&&R[R.length-1]===b[M].identifier?R.pop():R.push(b[M].identifier),M++;if(R.push(_.identifier),v==="evenodd"){const L=R.length%2===0,q=R[R.length-2];return{identifier:_.identifier,isHole:L,for:q}}else if(v==="nonzero"){let L=!0,q=null,Y=null;for(let W=0;W{const y=_.getPoints();let k=-999999999,w=999999999,v=-999999999,g=999999999;for(let S=0;Sk&&(k=T.y),T.yv&&(v=T.x),T.x=g&&(h=g-1),{curves:_.curves,points:y,isCW:Bf.isClockWise(y),identifier:u++,boundingBox:new zf(new ae(g,w),new ae(v,k))}});f=f.filter(_=>_.points.length>1);const m=f.map(_=>l(_,f,h,d,e.userData.style.fillRule)),p=[];return f.forEach(_=>{if(!m[_.identifier].isHole){const k=new Eu;k.curves=_.curves,m.filter(v=>v.isHole&&v.for===_.identifier).forEach(v=>{const g=f[v.identifier],S=new oa;S.curves=g.curves,k.holes.push(S)}),p.push(k)}}),p}static getStrokeStyle(e,t,s,i,r){return e=e!==void 0?e:1,t=t!==void 0?t:"#000",s=s!==void 0?s:"miter",i=i!==void 0?i:"butt",r=r!==void 0?r:4,{strokeColor:t,strokeWidth:e,strokeLineJoin:s,strokeLineCap:i,strokeMiterLimit:r}}static pointsToStroke(e,t,s,i){const r=[],o=[],a=[];if(Bi.pointsToStrokeWithBuffers(e,t,s,i,r,o,a)===0)return null;const c=new Ou;return c.setAttribute("position",new Jr(r,3)),c.setAttribute("normal",new Jr(o,3)),c.setAttribute("uv",new Jr(a,2)),c}static pointsToStrokeWithBuffers(e,t,s,i,r,o,a,c){const l=new ae,u=new ae,h=new ae,d=new ae,f=new ae,m=new ae,p=new ae,_=new ae,y=new ae,k=new ae,w=new ae,v=new ae,g=new ae,S=new ae,T=new ae,x=new ae,b=new ae;s=s!==void 0?s:12,i=i!==void 0?i:.001,c=c!==void 0?c:0,e=ge(e);const A=e.length;if(A<2)return 0;const R=e[0].equals(e[A-1]);let M,L=e[0],q;const Y=t.strokeWidth/2,W=1/(A-1);let V=0,z,$,Q,te,N=!1,F=0,C=c*3,P=c*2;G(e[0],e[1],l).multiplyScalar(Y),_.copy(e[0]).sub(l),y.copy(e[0]).add(l),k.copy(_),w.copy(y);for(let K=1;K=i&&O.push(K[E]);return O.push(K[K.length-1]),O}}}function Up(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(let s=0;sc,...a}){const{setEvents:c,camera:l,raycaster:u,gl:h,controls:d,size:f,get:m}=Pe(),[p,_]=D.useState(!1),[y,k]=D.useReducer((S,{object:T,shift:x})=>T===void 0?[]:Array.isArray(T)?T:x?S.includes(T)?S.filter(b=>b!==T):[T,...S]:S[0]===T?[]:[T],[]);D.useEffect(()=>void(s==null?void 0:s(y)),[y]);const w=D.useCallback(S=>{S.stopPropagation(),k({object:o([S.object])[0],shift:e&&S.shiftKey})},[]),v=D.useCallback(S=>!p&&k({}),[p]),g=D.useRef(null);return D.useEffect(()=>{if(!n||!e)return;const S=new Fp(l,g.current),T=document.createElement("div");T.style.pointerEvents="none",T.style.border=i,T.style.backgroundColor=r,T.style.position="fixed";const x=new ae,b=new ae,A=new ae,R=m().events.enabled,M=d==null?void 0:d.enabled;let L=!1;function q(N,F){const{offsetX:C,offsetY:P}=N,{width:G,height:I}=f;F.set(C/G*2-1,-(P/I)*2+1)}function Y(N){var F;d&&(d.enabled=!1),c({enabled:!1}),L=!0,(F=h.domElement.parentElement)==null||F.appendChild(T),T.style.left=`${N.clientX}px`,T.style.top=`${N.clientY}px`,T.style.width="0px",T.style.height="0px",x.x=N.clientX,x.y=N.clientY}function W(N){A.x=Math.max(x.x,N.clientX),A.y=Math.max(x.y,N.clientY),b.x=Math.min(x.x,N.clientX),b.y=Math.min(x.y,N.clientY),T.style.left=`${b.x}px`,T.style.top=`${b.y}px`,T.style.width=`${A.x-b.x}px`,T.style.height=`${A.y-b.y}px`}function V(){if(L){var N;d&&(d.enabled=M),c({enabled:R}),L=!1,(N=T.parentElement)==null||N.removeChild(T)}}function z(N){N.shiftKey&&(Y(N),q(N,S.startPoint))}let $=[];function Q(N){if(L){W(N),q(N,S.endPoint);const F=S.select().sort(C=>C.uuid).filter(C=>C.isMesh);Up(F,$)||($=F,k({object:o(F)}))}}function te(N){L&&V()}return document.addEventListener("pointerdown",z,{passive:!0}),document.addEventListener("pointermove",Q,{passive:!0,capture:!0}),document.addEventListener("pointerup",te,{passive:!0}),()=>{document.removeEventListener("pointerdown",z),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",te)}},[f.width,f.height,u,l,d,h]),D.createElement("group",Ls({ref:g,onClick:w,onPointerOver:()=>_(!0),onPointerOut:()=>_(!1),onPointerMissed:v},a),D.createElement(Lp.Provider,{value:y},t))}const _l=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function pn(n,e){const t=Pe(i=>i.gl),s=Uo(Lo,_l(n)?Object.values(n):n);if(D.useLayoutEffect(()=>{e==null||e(s)},[e]),D.useEffect(()=>{(Array.isArray(s)?s:[s]).forEach(t.initTexture)},[t,s]),_l(n)){const i=Object.keys(n),r={};return i.forEach(o=>Object.assign(r,{[o]:s[i.indexOf(o)]})),r}else return s}pn.preload=n=>Uo.preload(Lo,n);pn.clear=n=>Uo.clear(Lo,n);const zp=D.forwardRef(function({src:e,skipFill:t,skipStrokes:s,fillMaterial:i,strokeMaterial:r,fillMeshProps:o,strokeMeshProps:a,...c},l){const u=Uo(Bi,e.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(m=>Bi.pointsToStroke(m.getPoints(),d.userData.style))}),[u,s]);return D.useEffect(()=>()=>h.forEach(d=>d&&d.map(f=>f.dispose())),[h]),D.createElement("object3D",Ls({ref:l},c),D.createElement("object3D",{scale:[1,-1,1]},u.paths.map((d,f)=>{var m,p;return D.createElement(D.Fragment,{key:f},!t&&((m=d.userData)==null?void 0:m.style.fill)!==void 0&&d.userData.style.fill!=="none"&&Bi.createShapes(d).map((_,y)=>D.createElement("mesh",Ls({key:y},o),D.createElement("shapeGeometry",{args:[_]}),D.createElement("meshBasicMaterial",Ls({color:d.userData.style.fill,opacity:d.userData.style.fillOpacity,transparent:!0,side:hn,depthWrite:!1},i)))),!s&&((p=d.userData)==null?void 0:p.style.stroke)!==void 0&&d.userData.style.stroke!=="none"&&d.subPaths.map((_,y)=>D.createElement("mesh",Ls({key:y,geometry:h[f][y]},a),D.createElement("meshBasicMaterial",Ls({color:d.userData.style.stroke,opacity:d.userData.style.strokeOpacity,transparent:!0,side:hn,depthWrite:!1},r)))))})))});/*! - * camera-controls - * https://github.com/yomotsu/camera-controls - * (c) 2017 @yomotsu - * Released under the MIT License. - */const ce={LEFT:1,RIGHT:2,MIDDLE:4},H=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}),Nn={NONE:0,IN:1,OUT:-1};function rn(n){return n.isPerspectiveCamera}function Fs(n){return n.isOrthographicCamera}const Fn=Math.PI*2,gl=Math.PI/2,Nu=1e-5,Oi=Math.PI/180;function jt(n,e,t){return Math.max(e,Math.min(t,n))}function Me(n,e=Nu){return Math.abs(n)0==f>u&&(f=u,t.value=(f-u)/r),f}function yl(n,e,t,s,i=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=e.x,h=e.y,d=e.z,f=n.x-u,m=n.y-h,p=n.z-d;const _=u,y=h,k=d,w=i*s,v=w*w,g=f*f+m*m+p*p;if(g>v){const Y=Math.sqrt(g);f=f/Y*w,m=m/Y*w,p=p/Y*w}u=n.x-f,h=n.y-m,d=n.z-p;const S=(t.x+a*f)*r,T=(t.y+a*m)*r,x=(t.z+a*p)*r;t.x=(t.x-a*S)*l,t.y=(t.y-a*T)*l,t.z=(t.z-a*x)*l,o.x=u+(f+S)*l,o.y=h+(m+T)*l,o.z=d+(p+x)*l;const b=_-n.x,A=y-n.y,R=k-n.z,M=o.x-_,L=o.y-y,q=o.z-k;return b*M+A*L+R*q>0&&(o.x=_,o.y=y,o.z=k,t.x=(o.x-_)/r,t.y=(o.y-y)/r,t.z=(o.z-k)/r),o}function la(n,e){e.set(0,0),n.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=n.length,e.y/=n.length}function ua(n,e){return Fs(n)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class Vp{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let r=0,o=i.length;r{},this._enabled=!0,this._state=H.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=Nn.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new oe.Vector3,this._focalOffsetVelocity=new oe.Vector3,this._zoomVelocity={value:0},this._truckInternal=(v,g,S)=>{let T,x;if(rn(this._camera)){const b=fe.copy(this._camera.position).sub(this._target),A=this._camera.getEffectiveFOV()*Oi,R=b.length()*Math.tan(A*.5);T=this.truckSpeed*v*R/this._elementRect.height,x=this.truckSpeed*g*R/this._elementRect.height}else if(Fs(this._camera)){const b=this._camera;T=v*(b.right-b.left)/b.zoom/this._elementRect.width,x=g*(b.top-b.bottom)/b.zoom/this._elementRect.height}else return;this.verticalDragToForward?(S?this.setFocalOffset(this._focalOffsetEnd.x+T,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(T,0,!0),this.forward(-x,!0)):S?this.setFocalOffset(this._focalOffsetEnd.x+T,this._focalOffsetEnd.y+x,this._focalOffsetEnd.z,!0):this.truck(T,x,!0)},this._rotateInternal=(v,g)=>{const S=Fn*this.azimuthRotateSpeed*v/this._elementRect.height,T=Fn*this.polarRotateSpeed*g/this._elementRect.height;this.rotate(S,T,!0)},this._dollyInternal=(v,g,S)=>{const T=Math.pow(.95,-v*this.dollySpeed),x=this._sphericalEnd.radius,b=this._sphericalEnd.radius*T,A=jt(b,this.minDistance,this.maxDistance),R=A-b;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(b,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(R,!0),this._dollyToNoClamp(A,!0)):this._dollyToNoClamp(A,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?b:A)-x,this._dollyControlCoord.set(g,S)),this._lastDollyDirection=Math.sign(-v)},this._zoomInternal=(v,g,S)=>{const T=Math.pow(.95,v*this.dollySpeed),x=this._zoom,b=this._zoom*T;this.zoomTo(b,!0),this.dollyToCursor&&(this._changedZoom+=b-x,this._dollyControlCoord.set(g,S))},typeof oe>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new oe.Quaternion().setFromUnitVectors(this._camera.up,jr),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=H.NONE,this._target=new oe.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new oe.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new oe.Spherical().setFromVector3(fe.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 oe.Vector3,new oe.Vector3,new oe.Vector3,new oe.Vector3],this._updateNearPlaneCorners(),this._boundary=new oe.Box3(new oe.Vector3(-1/0,-1/0,-1/0),new oe.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 oe.Vector2,this.mouseButtons={left:H.ROTATE,middle:H.DOLLY,right:H.TRUCK,wheel:rn(this._camera)?H.DOLLY:Fs(this._camera)?H.ZOOM:H.NONE},this.touches={one:H.TOUCH_ROTATE,two:rn(this._camera)?H.TOUCH_DOLLY_TRUCK:Fs(this._camera)?H.TOUCH_ZOOM_TRUCK:H.NONE,three:H.TOUCH_TRUCK};const s=new oe.Vector2,i=new oe.Vector2,r=new oe.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(),x=v.clientX/T.width,b=v.clientY/T.height;if(xthis._interactiveArea.right||bthis._interactiveArea.bottom)return}const g=v.pointerType!=="mouse"?null:(v.buttons&ce.LEFT)===ce.LEFT?ce.LEFT:(v.buttons&ce.MIDDLE)===ce.MIDDLE?ce.MIDDLE:(v.buttons&ce.RIGHT)===ce.RIGHT?ce.RIGHT:null;if(g!==null){const T=this._findPointerByMouseButton(g);T&&this._disposePointer(T)}if((v.buttons&ce.LEFT)===ce.LEFT&&this._lockedPointer)return;const S={pointerId:v.pointerId,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:g};this._activePointers.push(S),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 T=this._domElement.getBoundingClientRect(),x=v.clientX/T.width,b=v.clientY/T.height;if(xthis._interactiveArea.right||bthis._interactiveArea.bottom)return}const g=(v.buttons&ce.LEFT)===ce.LEFT?ce.LEFT:(v.buttons&ce.MIDDLE)===ce.MIDDLE?ce.MIDDLE:(v.buttons&ce.RIGHT)===ce.RIGHT?ce.RIGHT:null;if(g!==null){const T=this._findPointerByMouseButton(g);T&&this._disposePointer(T)}const S={pointerId:1,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:(v.buttons&ce.LEFT)===ce.LEFT?ce.LEFT:(v.buttons&ce.MIDDLE)===ce.LEFT?ce.MIDDLE:(v.buttons&ce.RIGHT)===ce.LEFT?ce.RIGHT:null};this._activePointers.push(S),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,S=this._lockedPointer||this._findPointerById(g);if(S){if(S.clientX=v.clientX,S.clientY=v.clientY,S.deltaX=v.movementX,S.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&ce.LEFT)===ce.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(v.buttons&ce.MIDDLE)===ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(v.buttons&ce.RIGHT)===ce.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&ce.LEFT)===ce.LEFT)&&(this._state=this._state|this.mouseButtons.left),(v.buttons&ce.MIDDLE)===ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&ce.RIGHT)===ce.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=H.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=H.NONE;y()}},h=()=>{const v=this._findPointerById(1);v&&v===this._lockedPointer||(v&&this._disposePointer(v),this._state=H.NONE,y())};let d=-1;const f=v=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===H.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const b=this._domElement.getBoundingClientRect(),A=v.clientX/b.width,R=v.clientY/b.height;if(Athis._interactiveArea.right||Rthis._interactiveArea.bottom)return}if(v.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===H.ROTATE||this.mouseButtons.wheel===H.TRUCK){const b=performance.now();d-b<1e3&&this._getClientRect(this._elementRect),d=b}const g=Hp?-1:-3,S=v.deltaMode===1?v.deltaY/g:v.deltaY/(g*10),T=this.dollyToCursor?(v.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,x=this.dollyToCursor?(v.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case H.ROTATE:{this._rotateInternal(v.deltaX,v.deltaY),this._isUserControllingRotate=!0;break}case H.TRUCK:{this._truckInternal(v.deltaX,v.deltaY,!1),this._isUserControllingTruck=!0;break}case H.OFFSET:{this._truckInternal(v.deltaX,v.deltaY,!0),this._isUserControllingOffset=!0;break}case H.DOLLY:{this._dollyInternal(-S,T,x),this._isUserControllingDolly=!0;break}case H.ZOOM:{this._zoomInternal(-S,T,x),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},m=v=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===Ra.ACTION.NONE){const g=v instanceof PointerEvent?v.pointerId:(v instanceof MouseEvent,0),S=this._findPointerById(g);S&&this._disposePointer(S),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(la(this._activePointers,pt),this._getClientRect(this._elementRect),s.copy(pt),i.copy(pt),this._activePointers.length>=2){const S=pt.x-this._activePointers[1].clientX,T=pt.y-this._activePointers[1].clientY,x=Math.sqrt(S*S+T*T);r.set(0,x);const b=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,A=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(b,A)}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&ce.LEFT)===ce.LEFT&&(this._state=this._state|this.mouseButtons.left),(v.buttons&ce.MIDDLE)===ce.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&ce.RIGHT)===ce.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&H.ROTATE)===H.ROTATE||(this._state&H.TOUCH_ROTATE)===H.TOUCH_ROTATE||(this._state&H.TOUCH_DOLLY_ROTATE)===H.TOUCH_DOLLY_ROTATE||(this._state&H.TOUCH_ZOOM_ROTATE)===H.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&H.TRUCK)===H.TRUCK||(this._state&H.TOUCH_TRUCK)===H.TOUCH_TRUCK||(this._state&H.TOUCH_DOLLY_TRUCK)===H.TOUCH_DOLLY_TRUCK||(this._state&H.TOUCH_ZOOM_TRUCK)===H.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&H.DOLLY)===H.DOLLY||(this._state&H.TOUCH_DOLLY)===H.TOUCH_DOLLY||(this._state&H.TOUCH_DOLLY_TRUCK)===H.TOUCH_DOLLY_TRUCK||(this._state&H.TOUCH_DOLLY_OFFSET)===H.TOUCH_DOLLY_OFFSET||(this._state&H.TOUCH_DOLLY_ROTATE)===H.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&H.ZOOM)===H.ZOOM||(this._state&H.TOUCH_ZOOM)===H.TOUCH_ZOOM||(this._state&H.TOUCH_ZOOM_TRUCK)===H.TOUCH_ZOOM_TRUCK||(this._state&H.TOUCH_ZOOM_OFFSET)===H.TOUCH_ZOOM_OFFSET||(this._state&H.TOUCH_ZOOM_ROTATE)===H.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&H.OFFSET)===H.OFFSET||(this._state&H.TOUCH_OFFSET)===H.TOUCH_OFFSET||(this._state&H.TOUCH_DOLLY_OFFSET)===H.TOUCH_DOLLY_OFFSET||(this._state&H.TOUCH_ZOOM_OFFSET)===H.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,la(this._activePointers,pt);const g=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,S=g?-g.deltaX:i.x-pt.x,T=g?-g.deltaY:i.y-pt.y;if(i.copy(pt),((this._state&H.ROTATE)===H.ROTATE||(this._state&H.TOUCH_ROTATE)===H.TOUCH_ROTATE||(this._state&H.TOUCH_DOLLY_ROTATE)===H.TOUCH_DOLLY_ROTATE||(this._state&H.TOUCH_ZOOM_ROTATE)===H.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(S,T),this._isUserControllingRotate=!0),(this._state&H.DOLLY)===H.DOLLY||(this._state&H.ZOOM)===H.ZOOM){const x=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,b=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,A=this.dollyDragInverted?-1:1;(this._state&H.DOLLY)===H.DOLLY?(this._dollyInternal(A*T*Vr,x,b),this._isUserControllingDolly=!0):(this._zoomInternal(A*T*Vr,x,b),this._isUserControllingZoom=!0)}if((this._state&H.TOUCH_DOLLY)===H.TOUCH_DOLLY||(this._state&H.TOUCH_ZOOM)===H.TOUCH_ZOOM||(this._state&H.TOUCH_DOLLY_TRUCK)===H.TOUCH_DOLLY_TRUCK||(this._state&H.TOUCH_ZOOM_TRUCK)===H.TOUCH_ZOOM_TRUCK||(this._state&H.TOUCH_DOLLY_OFFSET)===H.TOUCH_DOLLY_OFFSET||(this._state&H.TOUCH_ZOOM_OFFSET)===H.TOUCH_ZOOM_OFFSET||(this._state&H.TOUCH_DOLLY_ROTATE)===H.TOUCH_DOLLY_ROTATE||(this._state&H.TOUCH_ZOOM_ROTATE)===H.TOUCH_ZOOM_ROTATE){const x=pt.x-this._activePointers[1].clientX,b=pt.y-this._activePointers[1].clientY,A=Math.sqrt(x*x+b*b),R=r.y-A;r.set(0,A);const M=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,L=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&H.TOUCH_DOLLY)===H.TOUCH_DOLLY||(this._state&H.TOUCH_DOLLY_ROTATE)===H.TOUCH_DOLLY_ROTATE||(this._state&H.TOUCH_DOLLY_TRUCK)===H.TOUCH_DOLLY_TRUCK||(this._state&H.TOUCH_DOLLY_OFFSET)===H.TOUCH_DOLLY_OFFSET?(this._dollyInternal(R*Vr,M,L),this._isUserControllingDolly=!0):(this._zoomInternal(R*Vr,M,L),this._isUserControllingZoom=!0)}((this._state&H.TRUCK)===H.TRUCK||(this._state&H.TOUCH_TRUCK)===H.TOUCH_TRUCK||(this._state&H.TOUCH_DOLLY_TRUCK)===H.TOUCH_DOLLY_TRUCK||(this._state&H.TOUCH_ZOOM_TRUCK)===H.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(S,T,!1),this._isUserControllingTruck=!0),((this._state&H.OFFSET)===H.OFFSET||(this._state&H.TOUCH_OFFSET)===H.TOUCH_OFFSET||(this._state&H.TOUCH_DOLLY_OFFSET)===H.TOUCH_DOLLY_OFFSET||(this._state&H.TOUCH_ZOOM_OFFSET)===H.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(S,T,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},y=()=>{la(this._activePointers,pt),i.copy(pt),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",k),this._domElement.ownerDocument.addEventListener("pointerlockerror",w),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",k),this._domElement.ownerDocument.removeEventListener("pointerlockerror",w))};const k=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},w=()=>{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),qp&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",u),this._domElement.addEventListener("wheel",f,{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",f,{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",k),this._domElement.ownerDocument.removeEventListener("pointerlockerror",w))},this.cancel=()=>{this._state!==H.NONE&&(this._state=H.NONE,this._activePointers.length=0,y())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(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(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=jt(e.width,0,1),this._interactiveArea.height=jt(e.height,0,1),this._interactiveArea.x=jt(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=jt(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,s=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,s)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,s=!1){this._isUserControllingRotate=!1;const i=jt(e,this.minAzimuthAngle,this.maxAzimuthAngle),r=jt(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,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||xe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&xe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Nn.NONE,this._changedDolly=0,this._dollyToNoClamp(jt(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=xe(o,this._spherical.radius);if(!(s>e)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,o)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const r=!t||xe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Pi).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const s=!t||xe(this._target.x,this._targetEnd.x,this.restThreshold)&&xe(this._target.y,this._targetEnd.y,this.restThreshold)&&xe(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=jt(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const s=!t||xe(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(e,t,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,s)}truck(e,t,s=!1){this._camera.updateMatrix(),Jt.setFromMatrixColumn(this._camera.matrix,0),es.setFromMatrixColumn(this._camera.matrix,1),Jt.multiplyScalar(e),es.multiplyScalar(-t);const i=fe.copy(Jt).add(es),r=ve.copy(this._targetEnd).add(i);return this.moveTo(r.x,r.y,r.z,s)}forward(e,t=!1){fe.setFromMatrixColumn(this._camera.matrix,0),fe.crossVectors(this._camera.up,fe),fe.multiplyScalar(e);const s=ve.copy(this._targetEnd).add(fe);return this.moveTo(s.x,s.y,s.z,t)}elevate(e,t=!1){return fe.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+fe.x,this._targetEnd.y+fe.y,this._targetEnd.z+fe.z,t)}moveTo(e,t,s,i=!1){this._isUserControllingTruck=!1;const r=fe.set(e,t,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||xe(this._target.x,this._targetEnd.x,this.restThreshold)&&xe(this._target.y,this._targetEnd.y,this.restThreshold)&&xe(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,s,i=!1){const a=fe.set(e,t,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,i)}fitToBox(e,t,{cover:s=!1,paddingLeft:i=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],l=e.isBox3?Ln.copy(e):Ln.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=vl(this._sphericalEnd.theta,gl),h=vl(this._sphericalEnd.phi,gl);c.push(this.rotateTo(u,h,t));const d=fe.setFromSpherical(this._sphericalEnd).normalize(),f=Sl.setFromUnitVectors(d,ha),m=xe(Math.abs(d.y),1);m&&f.multiply(fa.setFromAxisAngle(jr,u)),f.multiply(this._yAxisUpSpaceInverse);const p=wl.makeEmpty();ve.copy(l.min).applyQuaternion(f),p.expandByPoint(ve),ve.copy(l.min).setX(l.max.x).applyQuaternion(f),p.expandByPoint(ve),ve.copy(l.min).setY(l.max.y).applyQuaternion(f),p.expandByPoint(ve),ve.copy(l.max).setZ(l.min.z).applyQuaternion(f),p.expandByPoint(ve),ve.copy(l.min).setZ(l.max.z).applyQuaternion(f),p.expandByPoint(ve),ve.copy(l.max).setY(l.min.y).applyQuaternion(f),p.expandByPoint(ve),ve.copy(l.max).setX(l.min.x).applyQuaternion(f),p.expandByPoint(ve),ve.copy(l.max).applyQuaternion(f),p.expandByPoint(ve),p.min.x-=i,p.min.y-=o,p.max.x+=r,p.max.y+=a,f.setFromUnitVectors(ha,d),m&&f.premultiply(fa.invert()),f.premultiply(this._yAxisUpSpace);const _=p.getSize(fe),y=p.getCenter(ve).applyQuaternion(f);if(rn(this._camera)){const k=this.getDistanceToFitBox(_.x,_.y,_.z,s);c.push(this.moveTo(y.x,y.y,y.z,t)),c.push(this.dollyTo(k,t)),c.push(this.setFocalOffset(0,0,0,t))}else if(Fs(this._camera)){const k=this._camera,w=k.right-k.left,v=k.top-k.bottom,g=s?Math.max(w/_.x,v/_.y):Math.min(w/_.x,v/_.y);c.push(this.moveTo(y.x,y.y,y.z,t)),c.push(this.zoomTo(g,t)),c.push(this.setFocalOffset(0,0,0,t))}return Promise.all(c)}fitToSphere(e,t){const s=[],r=e instanceof oe.Sphere?da.copy(e):Ra.createBoundingSphere(e,da);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),rn(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,t))}else if(Fs(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,t))}return s.push(this.setFocalOffset(0,0,0,t)),Promise.all(s)}setLookAt(e,t,s,i,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Nn.NONE,this._changedDolly=0;const c=ve.set(i,r,o),l=fe.set(e,t,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||xe(this._target.x,this._targetEnd.x,this.restThreshold)&&xe(this._target.y,this._targetEnd.y,this.restThreshold)&&xe(this._target.z,this._targetEnd.z,this.restThreshold)&&xe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&xe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&xe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(e,t,s,i,r,o,a,c,l,u,h,d,f,m=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Nn.NONE,this._changedDolly=0;const p=fe.set(i,r,o),_=ve.set(e,t,s);Pt.setFromVector3(_.sub(p).applyQuaternion(this._yAxisUpSpace));const y=Un.set(u,h,d),k=ve.set(a,c,l);Di.setFromVector3(k.sub(y).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(p.lerp(y,f));const w=Di.theta-Pt.theta,v=Di.phi-Pt.phi,g=Di.radius-Pt.radius;this._sphericalEnd.set(Pt.radius+g*f,Pt.phi+v*f,Pt.theta+w*f),this.normalizeRotations(),this._needsUpdate=!0,m||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const S=!m||xe(this._target.x,this._targetEnd.x,this.restThreshold)&&xe(this._target.y,this._targetEnd.y,this.restThreshold)&&xe(this._target.z,this._targetEnd.z,this.restThreshold)&&xe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&xe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&xe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(S)}setPosition(e,t,s,i=!1){return this.setLookAt(e,t,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,s,i=!1){const r=this.getPosition(fe),o=this.setLookAt(r.x,r.y,r.z,e,t,s,i);return this._sphericalEnd.phi=jt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const r=!i||xe(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&xe(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&xe(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(e,t,s){this._camera.updateMatrixWorld(),Jt.setFromMatrixColumn(this._camera.matrixWorldInverse,0),es.setFromMatrixColumn(this._camera.matrixWorldInverse,1),on.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=fe.set(e,t,s),r=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);Jt.multiplyScalar(o.x),es.multiplyScalar(o.y),on.multiplyScalar(o.z),fe.copy(Jt).add(es).add(on),fe.z=fe.z+r,this.dollyTo(r,!1),this.setFocalOffset(-fe.x,fe.y,-fe.z,!1),this.moveTo(e,t,s,!1)}setBoundary(e){if(!e){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(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,s,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new oe.Vector4,typeof e=="number"?this._viewport.set(e,t,s,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,s,i=!1){if(ua(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=e/t,o=this._camera.getEffectiveFOV()*Oi,a=this._camera.aspect;return((i?r>a:rt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,s){const i=t.lengthSq();if(i===0)return e;const r=ve.copy(t).add(e),a=this._boundary.clampPoint(r,Un).sub(r),c=a.lengthSq();if(c===0)return e.add(t);if(c===i)return e;if(s===0)return e.add(t).add(a);{const l=1+s*c/t.dot(a);return e.add(ve.copy(t).multiplyScalar(l)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(rn(this._camera)){const e=this._camera,t=e.near,s=e.getEffectiveFOV()*Oi,i=Math.tan(s*.5)*t,r=i*e.aspect;this._nearPlaneCorners[0].set(-r,-i,0),this._nearPlaneCorners[1].set(r,-i,0),this._nearPlaneCorners[2].set(r,i,0),this._nearPlaneCorners[3].set(-r,i,0)}else if(Fs(this._camera)){const e=this._camera,t=1/e.zoom,s=e.left*t,i=e.right*t,r=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(i,r,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||ua(this._camera,"_collisionTest"))return e;const s=this._getTargetDirection(Pi);pa.lookAt(xl,s,this._camera.up);for(let i=0;i<4;i++){const r=ve.copy(this._nearPlaneCorners[i]);r.applyMatrix4(pa);const o=Un.addVectors(this._target,r);Hr.set(o,s),Hr.far=this._spherical.radius+1;const a=Hr.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),t()};this.addEventListener("rest",s)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){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(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new oe.Sphere){const s=t,i=s.center;Ln.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Ln.expandByObject(o)}),Ln.getCenter(i);let r=0;return e.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{D.useMemo(()=>{ma.install({THREE:Vf}),oc({CameraControlsImpl:ma})},[]);const{camera:t,domElement:s,makeDefault:i,onStart:r,onEnd:o,onChange:a,regress:c,...l}=n,u=Pe(g=>g.camera),h=Pe(g=>g.gl),d=Pe(g=>g.invalidate),f=Pe(g=>g.events),m=Pe(g=>g.setEvents),p=Pe(g=>g.set),_=Pe(g=>g.get),y=Pe(g=>g.performance),k=t||u,w=s||f.connected||h.domElement,v=D.useMemo(()=>new ma(k),[k]);return Bt((g,S)=>{v.enabled&&v.update(S)},-1),D.useEffect(()=>(v.connect(w),()=>void v.disconnect()),[w,v]),D.useEffect(()=>{const g=x=>{d(),c&&y.regress(),a&&a(x)},S=x=>{r&&r(x)},T=x=>{o&&o(x)};return v.addEventListener("update",g),v.addEventListener("controlstart",S),v.addEventListener("controlend",T),()=>{v.removeEventListener("update",g),v.removeEventListener("controlstart",S),v.removeEventListener("controlend",T)}},[v,r,o,d,m,c,a]),D.useEffect(()=>{if(i){const g=_().controls;return p({controls:v}),()=>p({controls:g})}},[i,v]),D.createElement("primitive",Ls({ref:e,object:v},l))}),Uu=D.createContext(null),Wp=D.forwardRef((n,e)=>{D.useMemo(()=>oc({SegmentObject:Yp}),[]);const{limit:t=1e3,lineWidth:s=1,children:i,...r}=n,[o,a]=D.useState([]),[c]=D.useState(()=>new wf),[l]=D.useState(()=>new Sf),[u]=D.useState(()=>new bf),[h]=D.useState(()=>new ae(512,512)),[d]=D.useState(()=>Array(t*6).fill(0)),[f]=D.useState(()=>Array(t*6).fill(0)),m=D.useMemo(()=>({subscribe:p=>(a(_=>[..._,p]),()=>a(_=>_.filter(y=>y.current!==p.current)))}),[]);return Bt(()=>{for(let _=0;_n instanceof le?n:new le(...typeof n=="number"?[n,n,n]:n),Zp=D.forwardRef(({color:n,start:e,end:t},s)=>{const i=D.useContext(Uu);if(!i)throw"Segment must used inside Segments component.";const r=D.useRef(null);return D.useLayoutEffect(()=>i.subscribe(r),[]),D.createElement("segmentObject",{ref:Cf([r,s]),color:n,start:bl(e),end:bl(t)})});function $p({all:n,scene:e,camera:t}){const s=Pe(({gl:o})=>o),i=Pe(({camera:o})=>o),r=Pe(({scene:o})=>o);return D.useLayoutEffect(()=>{const o=[];n&&(e||r).traverse(l=>{l.visible===!1&&(o.push(l),l.visible=!0)}),s.compile(e||r,t||i);const a=new jf(128);new Hf(.01,1e5,a).update(s,e||r),a.dispose(),o.forEach(l=>l.visible=!1)},[]),null}function Xp({pixelated:n}){const e=Pe(o=>o.gl),t=Pe(o=>o.internal.active),s=Pe(o=>o.performance.current),i=Pe(o=>o.viewport.initialDpr),r=Pe(o=>o.setDpr);return D.useEffect(()=>{const o=e.domElement;return()=>{t&&r(i),n&&o&&(o.style.imageRendering="auto")}},[]),D.useEffect(()=>{r(s*i),n&&e.domElement&&(e.domElement.style.imageRendering=s===1?"auto":"pixelated")},[s]),null}function Qp(){const n=Pe(s=>s.get),e=Pe(s=>s.setEvents),t=Pe(s=>s.performance.current);return D.useEffect(()=>{const s=n().events.enabled;return()=>e({enabled:s})},[]),D.useEffect(()=>e({enabled:t===1}),[t]),null}const uc=D.createContext(null);function Kp({children:n,enabled:e=!0}){const[t,s]=D.useState([]),i=D.useMemo(()=>({selected:t,select:s,enabled:e}),[t,s,e]);return U.jsx(uc.Provider,{value:i,children:n})}function Lu({enabled:n=!1,children:e,...t}){const s=D.useRef(null),i=D.useContext(uc);return D.useEffect(()=>{if(i&&n){let r=!1;const o=[];if(s.current.traverse(a=>{a.type==="Mesh"&&o.push(a),i.selected.indexOf(a)===-1&&(r=!0)}),r)return i.select(a=>[...a,...o]),()=>{i.select(a=>a.filter(c=>!o.includes(c)))}}},[n,e,i]),U.jsx("group",{ref:s,...t,children:e})}/** - * postprocessing v6.33.4 build Sat Dec 02 2023 - * https://github.com/pmndrs/postprocessing - * Copyright 2015-2023 Raoul van Rüschen - * @license Zlib - */var Bu="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",pe={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},zu="",Je="srgb",zo="srgb-linear",xs={NONE:0,DEPTH:1,CONVOLUTION:2},ye={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Vo={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},qr={DEFAULT:0,ESKIL:1},Vu=Number(cc.replace(/\D+/g,"")),ju=Vu>=152,Jp=new Map([[Du,zo],[Ru,Je]]),e0=new Map([[zo,Du],[Je,Ru]]);function ei(n){return n===null?null:ju?n.outputColorSpace:Jp.get(n.outputEncoding)}function js(n,e){n!==null&&(ju?n.colorSpace=e:n.encoding=e0.get(e))}function Tr(n){return Vu<154?n.replace("colorspace_fragment","encodings_fragment"):n}var t0=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; -#include -}`,s0="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",n0=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],i0=class extends as{constructor(n=new ul){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new he(null),texelSize:new he(new ul),scale:new he(1),kernel:new he(0)},blending:As,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:t0,vertexShader:s0}),this.fragmentShader=Tr(this.fragmentShader),this.setTexelSize(n.x,n.y),this.kernelSize=Vo.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return n0[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e,n*.5,e*.5)}setSize(n,e){const t=1/n,s=1/e;this.uniforms.texelSize.value.set(t,s,t*.5,s*.5)}},r0=`#include -#include -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; -#include -#include -}`,Hu=class extends as{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new he(null),opacity:new he(1)},blending:As,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:r0,vertexShader:Bu}),this.fragmentShader=Tr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},o0=`#include -#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform float cameraNear;uniform float cameraFar;centroid varying float vViewZ;centroid varying vec4 vProjTexCoord;void main(){ -#include -vec2 projTexCoord=(vProjTexCoord.xy/vProjTexCoord.w)*0.5+0.5;projTexCoord=clamp(projTexCoord,0.002,0.998); -#if DEPTH_PACKING == 3201 -float fragCoordZ=unpackRGBAToDepth(texture2D(depthBuffer,projTexCoord)); -#else -float fragCoordZ=texture2D(depthBuffer,projTexCoord).r; -#endif -#ifdef PERSPECTIVE_CAMERA -float viewZ=perspectiveDepthToViewZ(fragCoordZ,cameraNear,cameraFar); -#else -float viewZ=orthographicDepthToViewZ(fragCoordZ,cameraNear,cameraFar); -#endif -float depthTest=(-vViewZ>-viewZ)?1.0:0.0;gl_FragColor.rg=vec2(0.0,depthTest);}`,a0=`#include -#include -#include -#include -varying float vViewZ;varying vec4 vProjTexCoord;void main(){ -#include -#include -#include -#include -#include -vViewZ=mvPosition.z;vProjTexCoord=gl_Position; -#include -}`,c0=class extends as{constructor(n=null,e){super({name:"DepthComparisonMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new he(null),cameraNear:new he(.3),cameraFar:new he(1e3)},blending:As,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:o0,vertexShader:a0}),this.depthBuffer=n,this.depthPacking=Da,this.copyCameraSettings(e)}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=Da){this.depthBuffer=n,this.depthPacking=e}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof Au?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},l0=`#include -#ifdef GL_FRAGMENT_PRECISION_HIGH -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -#ifdef DOWNSAMPLE_NORMALS -uniform lowp sampler2D normalBuffer; -#endif -varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; -#include -}`,f0="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",p0=class extends as{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new he(null),texelSize:new he(new ae)},blending:As,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:d0,vertexShader:f0}),this.fragmentShader=Tr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},m0=`#include -#include -#include -#define packFloatToRGBA(v) packDepthToRGBA(v) -#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#if DEPTH_PACKING == 3201 -uniform lowp sampler2D depthBuffer; -#elif defined(GL_FRAGMENT_PRECISION_HIGH) -uniform highp sampler2D depthBuffer; -#else -uniform mediump sampler2D depthBuffer; -#endif -uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv; -#if THREE_REVISION < 143 -#define luminance(v) linearToRelativeLuminance(v) -#endif -#if THREE_REVISION >= 137 -vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);} -#endif -float readDepth(const in vec2 uv){ -#if DEPTH_PACKING == 3201 -return unpackRGBAToDepth(texture2D(depthBuffer,uv)); -#else -return texture2D(depthBuffer,uv).r; -#endif -}float getViewZ(const in float depth){ -#ifdef PERSPECTIVE_CAMERA -return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); -#else -return orthographicDepthToViewZ(depth,cameraNear,cameraFar); -#endif -}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0; -#ifdef ENCODE_OUTPUT -#include -#endif -#include -}`,_0="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",g0=class extends as{constructor(n,e,t,s,i=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:cc.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new he(null),depthBuffer:new he(null),resolution:new he(new ae),texelSize:new he(new ae),cameraNear:new he(.3),cameraFar:new he(1e3),aspect:new he(1),time:new he(0)},blending:As,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:i}),n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(s)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=fi){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=m0.replace(ye.FRAGMENT_HEAD,n.get(ye.FRAGMENT_HEAD)||"").replace(ye.FRAGMENT_MAIN_UV,n.get(ye.FRAGMENT_MAIN_UV)||"").replace(ye.FRAGMENT_MAIN_IMAGE,n.get(ye.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=_0.replace(ye.VERTEX_HEAD,n.get(ye.VERTEX_HEAD)||"").replace(ye.VERTEX_MAIN_SUPPORT,n.get(ye.VERTEX_MAIN_SUPPORT)||""),this.fragmentShader=Tr(this.fragmentShader),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof Au?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return ye}},v0=`#include -#if THREE_REVISION < 143 -#define luminance(v) linearToRelativeLuminance(v) -#endif -#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer; -#else -uniform lowp sampler2D inputBuffer; -#endif -#ifdef RANGE -uniform vec2 range; -#elif defined(THRESHOLD) -uniform float threshold;uniform float smoothing; -#endif -varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb); -#ifdef RANGE -float low=step(range.x,l);float high=step(l,range.y);l*=low*high; -#elif defined(THRESHOLD) -l=smoothstep(threshold,threshold+smoothing,l); -#endif -#ifdef COLOR -gl_FragColor=vec4(texel.rgb*l,l); -#else -gl_FragColor=vec4(l); -#endif -}`,y0=class extends as{constructor(n=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:cc.replace(/\D+/g,"")},uniforms:{inputBuffer:new he(null),threshold:new he(0),smoothing:new he(1),range:new he(null)},blending:As,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:v0,vertexShader:Bu}),this.colorOutput=n,this.luminanceRange=e}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},x0="uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",T0="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",k0=class extends as{constructor(n=new ae){super({name:"OutlineMaterial",uniforms:{inputBuffer:new he(null),texelSize:new he(new ae)},blending:As,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:x0,vertexShader:T0}),this.uniforms.texelSize.value.set(n.x,n.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},w0=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; -#else -uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; -#endif -uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); -#include -}`,S0="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",b0=class extends as{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new he(null),supportBuffer:new he(null),texelSize:new he(new ae),radius:new he(.85)},blending:As,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:w0,vertexShader:S0}),this.fragmentShader=Tr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},C0=new ep,Rs=null;function E0(){if(Rs===null){const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Rs=new Ou,Rs.setAttribute!==void 0?(Rs.setAttribute("position",new Fr(n,3)),Rs.setAttribute("uv",new Fr(e,2))):(Rs.addAttribute("position",new Fr(n,3)),Rs.addAttribute("uv",new Fr(e,2)))}return Rs}var dt=class qu{constructor(e="Pass",t=new ll,s=C0){this.name=e,this.renderer=null,this.scene=t,this.camera=s,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new Kf(E0(),e),t.frustumCulled=!1,this.scene===null&&(this.scene=new ll),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=fi){}render(e,t,s,i,r){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,s){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof At||t instanceof Mu||t instanceof Pu||t instanceof qu)&&this[e].dispose()}}},O0=class extends dt{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new Hu,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new At(1,1,{minFilter:oo,magFilter:oo,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,s,i){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==ks?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":ei(n)===Je&&js(this.renderTarget.texture,Je))}},A0=class extends dt{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,s,i){const r=n.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},Cl=new ys,hc=class extends dt{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,s,i){const r=this.overrideClearColor,o=this.overrideClearAlpha,a=n.getClearAlpha(),c=r!==null,l=o>=0;c?(n.getClearColor(Cl),n.setClearColor(r,l?o:a)):l&&n.setClearAlpha(o),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),c?n.setClearColor(Cl,a):l&&n.setClearAlpha(a)}},jo=class extends dt{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new hc,this.overrideMaterialManager=t===null?null:new Ol(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new Ol(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,s,i){const r=this.scene,o=this.camera,a=this.selection,c=o.layers.mask,l=r.background,u=n.shadowMap.autoUpdate,h=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(r.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(h),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,r,o):n.render(r,o),o.layers.mask=c,r.background=l,n.shadowMap.autoUpdate=u}},M0=class extends dt{constructor(n,e,{renderTarget:t,resolutionScale:s=1,width:i=Be.AUTO_SIZE,height:r=Be.AUTO_SIZE,resolutionX:o=i,resolutionY:a=r}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new jo(n,e,new Jf({depthPacking:Da}));const c=this.renderPass;c.skipShadowMapUpdate=!0,c.ignoreBackground=!0;const l=c.clearPass;l.overrideClearColor=new ys(16777215),l.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new At(1,1,{minFilter:Jn,magFilter:Jn}),this.renderTarget.texture.name="DepthPass.Target");const u=this.resolution=new Be(this,o,a,s);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},P0=class extends dt{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=Be.AUTO_SIZE,height:s=Be.AUTO_SIZE,resolutionX:i=t,resolutionY:r=s}={}){super("DepthDownsamplingPass");const o=new h0;o.normalBuffer=n,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new At(1,1,{minFilter:Jn,magFilter:Jn,depthBuffer:!1,type:qf}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const a=this.resolution=new Be(this,i,r,e);a.addEventListener("change",c=>this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=fi){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,s,i){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const s=n.getContext();if(!(s.getExtension("EXT_color_buffer_float")||s.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}};function El(n,e,t){for(const s of e){const i="$1"+n+s.charAt(0).toUpperCase()+s.slice(1),r=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(r,i))}}function D0(n,e,t){let s=e.getFragmentShader(),i=e.getVertexShader();const r=s!==void 0&&/mainImage/.test(s),o=s!==void 0&&/mainUv/.test(s);if(t.attributes|=e.getAttributes(),s===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&t.attributes&xs.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!r&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=t.shaderParts;let l=c.get(ye.FRAGMENT_HEAD)||"",u=c.get(ye.FRAGMENT_MAIN_UV)||"",h=c.get(ye.FRAGMENT_MAIN_IMAGE)||"",d=c.get(ye.VERTEX_HEAD)||"",f=c.get(ye.VERTEX_MAIN_SUPPORT)||"";const m=new Set,p=new Set;if(o&&(u+=` ${n}MainUv(UV); -`,t.uvTransformation=!0),i!==null&&/mainSupport/.test(i)){const k=/mainSupport *\([\w\s]*?uv\s*?\)/.test(i);f+=` ${n}MainSupport(`,f+=k?`vUv); -`:`); -`;for(const w of i.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const v of w[1].split(/\s*,\s*/))t.varyings.add(v),m.add(v),p.add(v);for(const w of i.matchAll(a))p.add(w[1])}for(const k of s.matchAll(a))p.add(k[1]);for(const k of e.defines.keys())p.add(k.replace(/\([\w\s,]*\)/g,""));for(const k of e.uniforms.keys())p.add(k);p.delete("while"),p.delete("for"),p.delete("if"),e.uniforms.forEach((k,w)=>t.uniforms.set(n+w.charAt(0).toUpperCase()+w.slice(1),k)),e.defines.forEach((k,w)=>t.defines.set(n+w.charAt(0).toUpperCase()+w.slice(1),k));const _=new Map([["fragment",s],["vertex",i]]);El(n,p,t.defines),El(n,p,_),s=_.get("fragment"),i=_.get("vertex");const y=e.blendMode;if(t.blendModes.set(y.blendFunction,y),r){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(h+=e.inputColorSpace===Je?`color0 = LinearTosRGB(color0); - `:`color0 = sRGBToLinear(color0); - `),e.outputColorSpace!==zu?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const k=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;h+=`${n}MainImage(color0, UV, `,t.attributes&xs.DEPTH&&k.test(s)&&(h+="depth, ",t.readDepth=!0),h+=`color1); - `;const w=n+"BlendOpacity";t.uniforms.set(w,y.opacity),h+=`color0 = blend${y.blendFunction}(color0, color1, ${w}); - - `,l+=`uniform float ${w}; - -`}if(l+=s+` -`,i!==null&&(d+=i+` -`),c.set(ye.FRAGMENT_HEAD,l),c.set(ye.FRAGMENT_MAIN_UV,u),c.set(ye.FRAGMENT_MAIN_IMAGE,h),c.set(ye.VERTEX_HEAD,d),c.set(ye.VERTEX_MAIN_SUPPORT,f),e.extensions!==null)for(const k of e.extensions)t.extensions.add(k)}}var R0=class extends dt{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new g0(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new j0;let e=0;for(const o of this.effects)if(o.blendMode.blendFunction===pe.DST)n.attributes|=o.getAttributes()&xs.DEPTH;else{if(n.attributes&o.getAttributes()&xs.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${o.name})`);D0("e"+e++,o,n)}let t=n.shaderParts.get(ye.FRAGMENT_HEAD),s=n.shaderParts.get(ye.FRAGMENT_MAIN_IMAGE),i=n.shaderParts.get(ye.FRAGMENT_MAIN_UV);const r=/\bblend\b/g;for(const o of n.blendModes.values())t+=o.getShaderCode().replace(r,`blend${o.blendFunction}`)+` -`;n.attributes&xs.DEPTH?(n.readDepth&&(s=`float depth = readDepth(UV); - - `+s),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===Je&&(s+=`color0 = sRGBToLinear(color0); - `),n.uvTransformation?(i=`vec2 transformedUv = vUv; -`+i,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(ye.FRAGMENT_HEAD,t),n.shaderParts.set(ye.FRAGMENT_MAIN_IMAGE,s),n.shaderParts.set(ye.FRAGMENT_MAIN_UV,i);for(const[o,a]of n.shaderParts)a!==null&&n.shaderParts.set(o,a.trim().replace(/^#/,` -#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=fi){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,s,i){for(const r of this.effects)r.update(n,e,s);if(!this.skipRendering||this.renderToScreen){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,r.time+=s*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const s of this.effects)s.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==ks&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},Gu=class extends dt{constructor({kernelSize:n=Vo.MEDIUM,resolutionScale:e=.5,width:t=Be.AUTO_SIZE,height:s=Be.AUTO_SIZE,resolutionX:i=t,resolutionY:r=s}={}){super("KawaseBlurPass"),this.renderTargetA=new At(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new Be(this,i,r,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new i0,this._blurMaterial.kernelSize=n,this.copyMaterial=new Hu}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.scene,o=this.camera,a=this.renderTargetA,c=this.renderTargetB,l=this.blurMaterial,u=l.kernelSequence;let h=e;this.fullscreenMaterial=l;for(let d=0,f=u.length;dthis.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,s,i){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==ks&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},N0=class extends dt{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new hc(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,s,i){const r=n.getContext(),o=n.state.buffers,a=this.scene,c=this.camera,l=this.clearPass,u=this.inverted?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),o.stencil.setFunc(r.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(n,null):(l.render(n,e),l.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(a,c)):(n.setRenderTarget(e),n.render(a,c),n.setRenderTarget(t),n.render(a,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(r.EQUAL,1,4294967295),o.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),o.stencil.setLocked(!0)}},F0=class extends dt{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new At(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new p0,this.upsamplingMaterial=new b0,this.resolution=new ae}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t=0;--d){const f=u[d];c.setSize(h.width,h.height),c.inputBuffer=h.texture,c.supportBuffer=l[d].texture,n.setRenderTarget(f),n.render(r,o),h=f}}setSize(n,e){const t=this.resolution;t.set(n,e);let s=t.width,i=t.height;for(let r=0,o=this.downsamplingMipmaps.length;rthis.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},L0=class extends dt{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,s,i){const r=this.fullscreenMaterial.uniforms;e!==null&&r!==void 0&&r[this.input]!==void 0&&(r[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==ks&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},_a=1/1e3,B0=1e3,z0=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*_a}get fixedDelta(){return this._fixedDelta*_a}set fixedDelta(n){this._fixedDelta=n*B0}get elapsed(){return this._elapsed*_a}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},V0=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:s=!1,multisampling:i=0,frameBufferType:r}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,s,r,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new O0,this.depthTexture=null,this.passes=[],this.timer=new z0,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,s=this.multisampling;s>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):s!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new ae),s=e.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;i===ks&&ei(e)===Je&&(js(this.inputBuffer.texture,Je),js(this.outputBuffer.texture,Je),this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const r of this.passes)r.initialize(e,s,i)}}replaceRenderer(e,t=!0){const s=this.renderer,i=s.domElement.parentNode;return this.setRenderer(e),t&&i!==null&&(i.removeChild(s.domElement),i.appendChild(e.domElement)),s}createDepthTexture(){const e=this.depthTexture=new Wf;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=Yf,e.type=Zf):e.type=$f,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,s,i){const r=this.renderer,o=r===null?new ae:r.getDrawingBufferSize(new ae),a={minFilter:oo,magFilter:oo,stencilBuffer:t,depthBuffer:e,type:s},c=new At(o.width,o.height,a);return i>0&&(c.ignoreDepthForMultisampleCopy=!1,c.samples=i),s===ks&&ei(r)===Je&&js(c.texture,Je),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const s=this.passes,i=this.renderer,r=i.getDrawingBufferSize(new ae),o=i.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(e.setRenderer(i),e.setSize(r.width,r.height),e.initialize(i,o,a),this.autoRenderToScreen&&(s.length>0&&(s[s.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?s.splice(t,0,e):s.push(e),this.autoRenderToScreen&&(s[s.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const c=this.createDepthTexture();for(e of s)e.setDepthTexture(c)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,s=t.indexOf(e);if(s!==-1&&t.splice(s,1).length>0){if(this.depthTexture!==null){const o=(c,l)=>c||l.needsDepthTexture;t.reduce(o,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&s===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,s=this.copyPass;let i=this.inputBuffer,r=this.outputBuffer,o=!1,a,c,l;e===void 0&&(this.timer.update(),e=this.timer.delta);for(const u of this.passes)u.enabled&&(u.render(t,i,r,e,o),u.needsSwap&&(o&&(s.renderToScreen=u.renderToScreen,a=t.getContext(),c=t.state.buffers.stencil,c.setFunc(a.NOTEQUAL,1,4294967295),s.render(t,i,r,e,o),c.setFunc(a.EQUAL,1,4294967295)),l=i,i=r,r=l),u instanceof N0?o=!0:u instanceof A0&&(o=!1))}setSize(e,t,s){const i=this.renderer,r=i.getSize(new ae);(e===void 0||t===void 0)&&(e=r.width,t=r.height),(r.width!==e||r.height!==t)&&i.setSize(e,t,s);const o=i.getDrawingBufferSize(new ae);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const a of this.passes)a.setSize(o.width,o.height)}reset(){const e=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=e}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},j0=class{constructor(){this.shaderParts=new Map([[ye.FRAGMENT_HEAD,null],[ye.FRAGMENT_MAIN_UV,null],[ye.FRAGMENT_MAIN_IMAGE,null],[ye.VERTEX_HEAD,null],[ye.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=xs.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=zo}},ga=!1,Ol=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case hn:t=this.materialsFlatShadedDoubleSide;break;case Nr:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case hn:t=this.materialsDoubleSide;break;case Nr:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof as))return n.clone();const e=n.uniforms,t=new Map;for(const i in e){const r=e[i].value;r.isRenderTargetTexture&&(e[i].value=null,t.set(i,r))}const s=n.clone();for(const i of t)e[i[0]].value=i[1],s.uniforms[i[0]].value=i[1];return s}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Xf;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.side=Nr,s}),this.materialsDoubleSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.side=hn,s}),this.materialsFlatShaded=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s}),this.materialsFlatShadedBackSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s.side=Nr,s}),this.materialsFlatShadedDoubleSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s.side=hn,s})}}render(n,e,t){const s=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,ga){const i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const r of i)r[0].material=r[1];this.meshCount!==i.size&&i.clear()}else{const i=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=i}n.shadowMap.enabled=s}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return ga}static set workaroundEnabled(n){ga=n}},Is=-1,Be=class extends ac{constructor(n,e=Is,t=Is,s=1){super(),this.resizable=n,this.baseSize=new ae(1,1),this.preferredSize=new ae(e,t),this.target=this.preferredSize,this.s=s,this.effectiveSize=new ae,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,s=this.scale;e.width!==Is?t.width=e.width:e.height!==Is?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*s),e.height!==Is?t.height=e.height:e.width!==Is?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*s)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(Is),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return Is}},H0=class extends Set{constructor(n,e=10){super(),this.l=e,this.exclusive=!1,n!==void 0&&this.set(n)}get layer(){return this.l}set layer(n){const e=this.l;for(const t of this)t.layers.disable(e),t.layers.enable(n);this.l=n}getLayer(){return this.layer}setLayer(n){this.layer=n}isExclusive(){return this.exclusive}setExclusive(n){this.exclusive=n}clear(){const n=this.layer;for(const e of this)e.layers.disable(n);return super.clear()}set(n){this.clear();for(const e of n)this.add(e);return this}indexOf(n){return this.has(n)?0:-1}add(n){return this.exclusive?n.layers.set(this.layer):n.layers.enable(this.layer),super.add(n)}delete(n){return this.has(n)&&n.layers.disable(this.layer),super.delete(n)}toggle(n){let e;return this.has(n)?(this.delete(n),e=!1):(this.add(n),e=!0),e}setVisible(n){for(const e of this)n?e.layers.enable(0):e.layers.disable(0);return this}},q0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",G0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",W0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",Y0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",Z0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",$0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",X0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",Q0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",K0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",J0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",em="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",tm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",sm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",nm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",im="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",rm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",om="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",am="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",cm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",lm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",um="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",hm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",dm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",fm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",pm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",mm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",_m="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",gm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",vm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",ym="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",xm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",Tm="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",km=new Map([[pe.ADD,q0],[pe.ALPHA,G0],[pe.AVERAGE,W0],[pe.COLOR,Y0],[pe.COLOR_BURN,Z0],[pe.COLOR_DODGE,$0],[pe.DARKEN,X0],[pe.DIFFERENCE,Q0],[pe.DIVIDE,K0],[pe.DST,null],[pe.EXCLUSION,J0],[pe.HARD_LIGHT,em],[pe.HARD_MIX,tm],[pe.HUE,sm],[pe.INVERT,nm],[pe.INVERT_RGB,im],[pe.LIGHTEN,rm],[pe.LINEAR_BURN,om],[pe.LINEAR_DODGE,am],[pe.LINEAR_LIGHT,cm],[pe.LUMINOSITY,lm],[pe.MULTIPLY,um],[pe.NEGATION,hm],[pe.NORMAL,dm],[pe.OVERLAY,fm],[pe.PIN_LIGHT,pm],[pe.REFLECT,mm],[pe.SATURATION,_m],[pe.SCREEN,gm],[pe.SOFT_LIGHT,vm],[pe.SRC,ym],[pe.SUBTRACT,xm],[pe.VIVID_LIGHT,Tm]]),wm=class extends ac{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new he(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return km.get(this.blendFunction)}},Gi=class extends ac{constructor(e,t,{attributes:s=xs.NONE,blendFunction:i=pe.NORMAL,defines:r=new Map,uniforms:o=new Map,extensions:a=null,vertexShader:c=null}={}){super(),this.name=e,this.renderer=null,this.attributes=s,this.fragmentShader=t,this.vertexShader=c,this.defines=r,this.uniforms=o,this.extensions=a,this.blendMode=new wm(i),this.blendMode.addEventListener("change",l=>this.setChanged()),this._inputColorSpace=zo,this._outputColorSpace=zu}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=fi){}update(e,t,s){}setSize(e,t){}initialize(e,t,s){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof At||t instanceof Mu||t instanceof Pu||t instanceof dt)&&this[e].dispose()}}},Sm=`#ifdef FRAMEBUFFER_PRECISION_HIGH -uniform mediump sampler2D map; -#else -uniform lowp sampler2D map; -#endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,texel.a);}`,bm=class extends Gi{constructor({blendFunction:n=pe.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,mipmapBlur:s=!1,intensity:i=1,radius:r=.85,levels:o=8,kernelSize:a=Vo.LARGE,resolutionScale:c=.5,width:l=Be.AUTO_SIZE,height:u=Be.AUTO_SIZE,resolutionX:h=l,resolutionY:d=u}={}){super("BloomEffect",Sm,{blendFunction:n,uniforms:new Map([["map",new he(null)],["intensity",new he(i)]])}),this.renderTarget=new At(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new Gu({kernelSize:a}),this.luminancePass=new I0({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new F0,this.mipmapBlurPass.enabled=s,this.mipmapBlurPass.radius=r,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=s?this.mipmapBlurPass.texture:this.renderTarget.texture;const f=this.resolution=new Be(this,h,d,c);f.addEventListener("change",m=>this.setSize(f.baseWidth,f.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,e,t){const s=this.renderTarget,i=this.luminancePass;i.enabled?(i.render(n,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,i.renderTarget):this.blurPass.render(n,i.renderTarget,s)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,e):this.blurPass.render(n,e,s)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(n,e),this.mipmapBlurPass.setSize(n,e)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.luminancePass.initialize(n,e,t),this.mipmapBlurPass.initialize(n,e,t),t!==void 0&&(this.renderTarget.texture.type=t,ei(n)===Je&&js(this.renderTarget.texture,Je))}},Cm=`uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength; -#ifdef USE_PATTERN -uniform lowp sampler2D patternTexture;varying vec2 vUvPattern; -#endif -void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 edge=texture2D(edgeTexture,uv).rg;vec2 mask=texture2D(maskTexture,uv).rg; -#ifndef X_RAY -edge.y=0.0; -#endif -edge*=(edgeStrength*mask.x*pulse);vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;float visibilityFactor=0.0; -#ifdef USE_PATTERN -vec4 patternColor=texture2D(patternTexture,vUvPattern); -#ifdef X_RAY -float hiddenFactor=0.5; -#else -float hiddenFactor=0.0; -#endif -visibilityFactor=(1.0-mask.y>0.0)?1.0:hiddenFactor;visibilityFactor*=(1.0-mask.x)*patternColor.a;color+=visibilityFactor*patternColor.rgb; -#endif -float alpha=max(max(edge.x,edge.y),visibilityFactor); -#ifdef ALPHA -outputColor=vec4(color,alpha); -#else -outputColor=vec4(color,max(alpha,inputColor.a)); -#endif -}`,Em="uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}",Om=class extends Gi{constructor(n,e,{blendFunction:t=pe.SCREEN,patternTexture:s=null,patternScale:i=1,edgeStrength:r=1,pulseSpeed:o=0,visibleEdgeColor:a=16777215,hiddenEdgeColor:c=2230538,kernelSize:l=Vo.VERY_SMALL,blur:u=!1,xRay:h=!0,multisampling:d=0,resolutionScale:f=.5,width:m=Be.AUTO_SIZE,height:p=Be.AUTO_SIZE,resolutionX:_=m,resolutionY:y=p}={}){super("OutlineEffect",Cm,{uniforms:new Map([["maskTexture",new he(null)],["edgeTexture",new he(null)],["edgeStrength",new he(r)],["visibleEdgeColor",new he(new ys(a))],["hiddenEdgeColor",new he(new ys(c))],["pulse",new he(1)],["patternScale",new he(i)],["patternTexture",new he(null)]])}),this.blendMode.addEventListener("change",g=>{this.blendMode.blendFunction===pe.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()}),this.blendMode.blendFunction=t,this.patternTexture=s,this.xRay=h,this.scene=n,this.camera=e,this.renderTargetMask=new At(1,1),this.renderTargetMask.samples=d,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new At(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new hc,this.clearPass.overrideClearColor=new ys(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new M0(n,e),this.maskPass=new jo(n,e,new c0(this.depthPass.texture,e));const k=this.maskPass.clearPass;k.overrideClearColor=new ys(16777215),k.overrideClearAlpha=1,this.blurPass=new Gu({resolutionScale:f,resolutionX:_,resolutionY:y,kernelSize:l}),this.blurPass.enabled=u;const w=this.blurPass.resolution;w.addEventListener("change",g=>this.setSize(w.baseWidth,w.baseHeight)),this.outlinePass=new L0(new k0);const v=this.outlinePass.fullscreenMaterial;v.inputBuffer=this.renderTargetMask.texture,this.time=0,this.forceUpdate=!0,this.selection=new H0,this.selection.layer=10,this.pulseSpeed=o}set mainScene(n){this.scene=n,this.depthPass.mainScene=n,this.maskPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.maskPass.mainCamera=n,this.maskPass.overrideMaterial.copyCameraSettings(n)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(n){this.renderTargetMask.samples=n,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(n){this.uniforms.get("patternScale").value=n}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(n){this.uniforms.get("edgeStrength").value=n}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(n){this.uniforms.get("visibleEdgeColor").value=n}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(n){this.uniforms.get("hiddenEdgeColor").value=n}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(n){this.pulseSpeed=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get selectionLayer(){return this.selection.layer}set selectionLayer(n){this.selection.layer=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get xRay(){return this.defines.has("X_RAY")}set xRay(n){this.xRay!==n&&(n?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(n){this.xRay=n}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(n){n!==null?(n.wrapS=n.wrapT=Qf,this.defines.set("USE_PATTERN","1"),this.setVertexShader(Em)):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.uniforms.get("patternTexture").value=n,this.setChanged()}setPatternTexture(n){this.patternTexture=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}setSelection(n){return this.selection.set(n),this}clearSelection(){return this.selection.clear(),this}selectObject(n){return this.selection.add(n),this}deselectObject(n){return this.selection.delete(n),this}update(n,e,t){const s=this.scene,i=this.camera,r=this.selection,a=this.uniforms.get("pulse"),c=s.background,l=i.layers.mask;(this.forceUpdate||r.size>0)&&(s.background=null,a.value=1,this.pulseSpeed>0&&(a.value=Math.cos(this.time*this.pulseSpeed*10)*.375+.625),this.time+=t,r.setVisible(!1),this.depthPass.render(n),r.setVisible(!0),i.layers.set(r.layer),this.maskPass.render(n,this.renderTargetMask),i.layers.mask=l,s.background=c,this.outlinePass.render(n,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(n,this.renderTargetOutline,this.renderTargetOutline)),this.forceUpdate=r.size>0}setSize(n,e){this.blurPass.setSize(n,e),this.renderTargetMask.setSize(n,e);const t=this.resolution;t.setBaseSize(n,e);const s=t.width,i=t.height;this.depthPass.setSize(s,i),this.renderTargetOutline.setSize(s,i),this.outlinePass.fullscreenMaterial.setSize(s,i)}initialize(n,e,t){this.blurPass.initialize(n,e,ks),t!==void 0&&(this.depthPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.outlinePass.initialize(n,e,t))}},Am=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; -#if VIGNETTE_TECHNIQUE == 0 -float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); -#else -vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); -#endif -outputColor=vec4(color,inputColor.a);}`,Mm=class extends Gi{constructor({blendFunction:n,technique:e=qr.DEFAULT,eskil:t=!1,offset:s=.5,darkness:i=.5}={}){super("VignetteEffect",Am,{blendFunction:n,defines:new Map([["VIGNETTE_TECHNIQUE",e.toFixed(0)]]),uniforms:new Map([["offset",new he(s)],["darkness",new he(i)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(n){this.technique!==n&&(this.defines.set("VIGNETTE_TECHNIQUE",n.toFixed(0)),this.setChanged())}get eskil(){return this.technique===qr.ESKIL}set eskil(n){this.technique=n?qr.ESKIL:qr.DEFAULT}getTechnique(){return this.technique}setTechnique(n){this.technique=n}get offset(){return this.uniforms.get("offset").value}set offset(n){this.uniforms.get("offset").value=n}getOffset(){return this.offset}setOffset(n){this.offset=n}get darkness(){return this.uniforms.get("darkness").value}set darkness(n){this.uniforms.get("darkness").value=n}getDarkness(){return this.darkness}setDarkness(n){this.darkness=n}};const Wu=D.createContext(null),Al=n=>(n.getAttributes()&xs.CONVOLUTION)===xs.CONVOLUTION,Pm=ro.memo(D.forwardRef(({children:n,camera:e,scene:t,resolutionScale:s,enabled:i=!0,renderPriority:r=1,autoClear:o=!0,depthBuffer:a,disableNormalPass:c,stencilBuffer:l,multisampling:u=8,frameBufferType:h=tp},d)=>{const{gl:f,scene:m,camera:p,size:_}=Pe(),y=t||m,k=e||p,[w,v,g]=D.useMemo(()=>{const b=Np(),A=new V0(f,{depthBuffer:a,stencilBuffer:l,multisampling:u>0&&b?u:0,frameBufferType:h});A.addPass(new jo(y,k));let R=null,M=null;return c||(M=new U0(y,k),M.enabled=!1,A.addPass(M),s!==void 0&&b&&(R=new P0({normalBuffer:M.texture,resolutionScale:s}),R.enabled=!1,A.addPass(R))),[A,M,R]},[k,f,a,l,u,h,y,c,s]);D.useEffect(()=>w==null?void 0:w.setSize(_.width,_.height),[w,_]),Bt((b,A)=>{if(i){const R=f.autoClear;f.autoClear=o,l&&!o&&f.clearStencil(),w.render(A),f.autoClear=R}},i?r:0);const S=D.useRef(null),T=Ef(S);D.useLayoutEffect(()=>{const b=[];if(S.current&&T.current&&w){const A=T.current.objects;for(let R=0;R{for(const A of b)w==null||w.removePass(A);v&&(v.enabled=!1),g&&(g.enabled=!1)}},[w,n,k,v,g,T]);const x=D.useMemo(()=>({composer:w,normalPass:v,downSamplingPass:g,resolutionScale:s,camera:k,scene:y}),[w,v,g,s,k,y]);return D.useImperativeHandle(d,()=>w,[w]),U.jsx(Wu.Provider,{value:x,children:U.jsx("group",{ref:S,children:n})})})),Ml=n=>typeof n=="object"&&n!=null&&"current"in n?n.current:n;let Dm=0;const Pl=new WeakMap,Yu=(n,e)=>ro.forwardRef(function({blendFunction:s=e==null?void 0:e.blendFunction,opacity:i=e==null?void 0:e.opacity,...r},o){let a=Pl.get(n);if(!a){const u=`@react-three/postprocessing/${n.name}-${Dm++}`;oc({[u]:n}),Pl.set(n,a=u)}const c=Pe(u=>u.camera),l=ro.useMemo(()=>{var u,h;return[...(u=e==null?void 0:e.args)!=null?u:[],...(h=r.args)!=null?h:[{...e,...r}]]},[JSON.stringify(r)]);return U.jsx(a,{camera:c,"blendMode-blendFunction":s,"blendMode-opacity-value":i,...r,ref:o,args:l})}),Rm=Yu(bm,{blendFunction:pe.ADD}),Im=D.forwardRef(function({selection:e=[],selectionLayer:t=10,blendFunction:s,patternTexture:i,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:c,width:l,height:u,kernelSize:h,blur:d,xRay:f,...m},p){const _=Pe(g=>g.invalidate),{scene:y,camera:k}=D.useContext(Wu),w=D.useMemo(()=>new Om(y,k,{blendFunction:s,patternTexture:i,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:c,width:l,height:u,kernelSize:h,blur:d,xRay:f,...m}),[s,d,k,r,u,c,h,i,o,y,a,l,f]),v=D.useContext(uc);return D.useEffect(()=>{if(!v&&e)return w.selection.set(Array.isArray(e)?e.map(Ml):[Ml(e)]),_(),()=>{w.selection.clear(),_()}},[w,e,v,_]),D.useEffect(()=>{w.selectionLayer=t,_()},[w,_,t]),D.useRef(),D.useEffect(()=>{var g;if(v&&v.enabled&&(g=v.selected)!=null&&g.length)return w.selection.set(v.selected),_(),()=>{w.selection.clear(),_()}},[v,w.selection,_]),D.useEffect(()=>()=>{w.dispose()},[w]),U.jsx("primitive",{ref:p,object:w})}),Nm=Yu(Mm),Fm={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},Hs=ku(n=>({...Fm,setIsUserDragging:e=>n({isUserDragging:e}),setIsUserScrolling:e=>n({isUserScrolling:e}),setUserMovedCamera:e=>n({userMovedCamera:e}),setIsUserScrollingOnHtmlPanel:e=>n({isUserScrollingOnHtmlPanel:e})})),Um=()=>{const[n,e]=D.useState(""),t=D.useRef(null),{fetchData:s,setAbortRequests:i,seedQuestions:r}=On(v=>v),[o]=wu(v=>[v.setBudget]),{setUniverseQuestionIsOpen:a,setSidebarOpen:c,setShowCollapseButton:l}=vr(v=>({setUniverseQuestionIsOpen:v.setUniverseQuestionIsOpen,setSidebarOpen:v.setSidebarOpen,setShowCollapseButton:v.setShowCollapseButton})),u=pf(v=>v.resetAiSummaryAnswer),[h,d]=D.useState([]);D.useEffect(()=>{r&&d(k(r).slice(0,4))},[r]),D.useEffect(()=>{t.current&&t.current.focus()},[]);const f=async v=>{v&&(u(),a(),c(!0),l(!0)),await s(o,i,v)},m=!!n.trim().length,p=async v=>{v.keyCode===13&&v.shiftKey===!1&&m&&(v.preventDefault(),f(n))},_=async v=>{e(v),await f(v)},y=()=>{a(),c(!0),l(!0)},k=v=>{const g=[...v];let S=g.length-1;for(;S>0;){const T=Math.floor(Math.random()*(S+1));[g[S],g[T]]=[g[T],g[S]],S-=1}return g},w=!!n&&n.trim().length>0;return U.jsxs(zm,{children:["Ideas have shapes",U.jsxs(Bm,{onKeyDown:p,py:12,tabIndex:-1,children:[U.jsx(Lm,{ref:t,onChange:v=>e(v.target.value),placeholder:"What do you want to know?",value:n}),U.jsx(Vm,{color:"secondary",disabled:!w,onClick:()=>f(n),variant:"contained",children:w?U.jsxs(U.Fragment,{children:["Search ",U.jsx(fl,{})]}):U.jsx(fl,{})})]}),h.length>0&&U.jsx(Hm,{children:h.map(v=>U.jsxs(qm,{onClick:()=>_(v),children:[U.jsx(rp,{}),v]},v))}),U.jsx(jm,{"data-testid":"explore-graph-btn",onClick:y,startIcon:U.jsx(op,{}),children:"Explore Graph"})]})},Lm=Ye(Sp).attrs({maxRows:3})` - background: ${Oe.BG1}; - max-width: 700px; - width: 700px; - color: ${Oe.white}; - padding: 0 16px 0 16px; - overflow-y: auto !important; - border: none; - resize: none; - outline: none; - border-radius: 12px; - font-family: 'Barlow'; - display: flex; - align-items: center; - text-align: justify; - font-size: 16px; - font-weight: 400; - - &:-moz-placeholder, /* Firefox 18- */ - &::-moz-placeholder, /* Firefox 19+ */ - &:-ms-input-placeholder, /* IE 10+ */ - &::-webkit-input-placeholder, /* Webkit based */ - &::placeholder { - color: #0bf; - } - - &::-webkit-scrollbar { - width: 3px; - } - - &::-webkit-scrollbar-track { - border-radius: 12px; - margin: 13px; - overflow-y: hidden; - } -`,Bm=Ye(Os)` - position: relative; - margin-top: 30px; - background: ${Oe.BG1}; - max-width: 702px; - width: 702px; - color: ${Oe.white}; - min-height: 150px; - border: 1px solid ${Oe.modalShield}; - resize: none; - outline: none; - border-radius: 12px; - box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.5); -`,zm=Ye(Os)` - background: #16161de3; - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; - color: #fff; - align-items: center; - justify-content: center; - font-size: 32px; - font-style: normal; - font-weight: 700; - line-height: 16px; - font-family: 'Barlow'; -`,Vm=Ye(Iu)` - && { - position: absolute; - bottom: 16px; - right: 16px; - height: 32px; - border-radius: 16px; - min-width: 32px; - } - - &&.MuiButton-root { - padding: 0 10px 0 12px; - } - - svg { - margin-top: 1px; - width: 11px; - height: 11px; - } -`,jm=Ye(Iu)` - && { - position: absolute; - bottom: 20px; - right: 20px; - border-radius: 16px; - } -`,Hm=Ye.div` - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 10px; - margin-top: 20px; - max-width: 702px; - width: 100%; -`,qm=Ye.div` - background: ${Oe.BG1}; - color: ${Oe.white}; - padding: 15px 12px; - border-radius: 8px; - cursor: pointer; - display: flex; - align-items: center; - justify-content: flex-start; - text-align: left; - font-family: Barlow; - font-size: 14px; - font-weight: 400; - gap: 10px; - &:hover { - background: ${Oe.SEEDQUESTION_HOVER}; - } - - &:active { - background: ${Oe.SEEDQUESTION}; - } - svg { - width: 20px; - height: 20px; - } - - path { - fill: ${Oe.modalWhiteOverlayBg}; - } -`,zi=new le(0,0,0),Dl=100,Gm=600,Wm=2e3,va={x:172.7392402058252,y:-239.04675366094037,z:-2e3},Zu="14.8.49",Rl=(n,e,t)=>({endTime:e,insertTime:t,type:"exponentialRampToValue",value:n}),Il=(n,e,t)=>({endTime:e,insertTime:t,type:"linearRampToValue",value:n}),Ia=(n,e)=>({startTime:e,type:"setValue",value:n}),$u=(n,e,t)=>({duration:t,startTime:e,type:"setValueCurve",values:n}),Xu=(n,e,{startTime:t,target:s,timeConstant:i})=>s+(e-s)*Math.exp((t-n)/i),Hn=n=>n.type==="exponentialRampToValue",ao=n=>n.type==="linearRampToValue",Us=n=>Hn(n)||ao(n),dc=n=>n.type==="setValue",_s=n=>n.type==="setValueCurve",co=(n,e,t,s)=>{const i=n[e];return i===void 0?s:Us(i)||dc(i)?i.value:_s(i)?i.values[i.values.length-1]:Xu(t,co(n,e-1,i.startTime,s),i)},Nl=(n,e,t,s,i)=>t===void 0?[s.insertTime,i]:Us(t)?[t.endTime,t.value]:dc(t)?[t.startTime,t.value]:_s(t)?[t.startTime+t.duration,t.values[t.values.length-1]]:[t.startTime,co(n,e-1,t.startTime,i)],Na=n=>n.type==="cancelAndHold",Fa=n=>n.type==="cancelScheduledValues",Ns=n=>Na(n)||Fa(n)?n.cancelTime:Hn(n)||ao(n)?n.endTime:n.startTime,Fl=(n,e,t,{endTime:s,value:i})=>t===i?i:0t+(n-e)/(s-e)*(i-t),Ym=(n,e)=>{const t=Math.floor(e),s=Math.ceil(e);return t===s?n[t]:(1-(e-t))*n[t]+(1-(s-e))*n[s]},Zm=(n,{duration:e,startTime:t,values:s})=>{const i=(n-t)/e*(s.length-1);return Ym(s,i)},Gr=n=>n.type==="setTarget";class $m{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=Ns(e);if(Na(e)||Fa(e)){const s=this._automationEvents.findIndex(r=>Fa(e)&&_s(r)?r.startTime+r.duration>=t:Ns(r)>=t),i=this._automationEvents[s];if(s!==-1&&(this._automationEvents=this._automationEvents.slice(0,s)),Na(e)){const r=this._automationEvents[this._automationEvents.length-1];if(i!==void 0&&Us(i)){if(r!==void 0&&Gr(r))throw new Error("The internal list is malformed.");const o=r===void 0?i.insertTime:_s(r)?r.startTime+r.duration:Ns(r),a=r===void 0?this._defaultValue:_s(r)?r.values[r.values.length-1]:r.value,c=Hn(i)?Fl(t,o,a,i):Ul(t,o,a,i),l=Hn(i)?Rl(c,t,this._currenTime):Il(c,t,this._currenTime);this._automationEvents.push(l)}if(r!==void 0&&Gr(r)&&this._automationEvents.push(Ia(this.getValue(t),t)),r!==void 0&&_s(r)&&r.startTime+r.duration>t){const o=t-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;hNs(o)>t),i=s===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[s-1];if(i!==void 0&&_s(i)&&Ns(i)+i.duration>t)return!1;const r=Hn(e)?Rl(e.value,e.endTime,this._currenTime):ao(e)?Il(e.value,t,this._currenTime):e;if(s===-1)this._automationEvents.push(r);else{if(_s(e)&&t+e.duration>Ns(this._automationEvents[s]))return!1;this._automationEvents.splice(s,0,r)}}return!0}flush(e){const t=this._automationEvents.findIndex(s=>Ns(s)>e);if(t>1){const s=this._automationEvents.slice(t-1),i=s[0];Gr(i)&&s.unshift(Ia(co(this._automationEvents,t-2,i.startTime,this._defaultValue),i.startTime)),this._automationEvents=s}}getValue(e){if(this._automationEvents.length===0)return this._defaultValue;const t=this._automationEvents.findIndex(o=>Ns(o)>e),s=this._automationEvents[t],i=(t===-1?this._automationEvents.length:t)-1,r=this._automationEvents[i];if(r!==void 0&&Gr(r)&&(s===void 0||!Us(s)||s.insertTime>e))return Xu(e,co(this._automationEvents,i-1,r.startTime,this._defaultValue),r);if(r!==void 0&&dc(r)&&(s===void 0||!Us(s)))return r.value;if(r!==void 0&&_s(r)&&(s===void 0||!Us(s)||r.startTime+r.duration>e))return e({cancelTime:n,type:"cancelAndHold"}),Qm=n=>({cancelTime:n,type:"cancelScheduledValues"}),Km=(n,e)=>({endTime:e,type:"exponentialRampToValue",value:n}),Jm=(n,e)=>({endTime:e,type:"linearRampToValue",value:n}),e_=(n,e,t)=>({startTime:e,target:n,timeConstant:t,type:"setTarget"}),t_=()=>new DOMException("","AbortError"),s_=n=>(e,t,[s,i,r],o)=>{n(e[i],[t,s,r],a=>a[0]===t&&a[1]===s,o)},n_=n=>(e,t,s)=>{const i=[];for(let r=0;r(e,t)=>{n.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})},ti=new WeakSet,Qu=new WeakMap,fc=new WeakMap,Ku=new WeakMap,pc=new WeakMap,Ho=new WeakMap,Ju=new WeakMap,Ua=new WeakMap,La=new WeakMap,Ba=new WeakMap,eh={construct(){return eh}},r_=n=>{try{const e=new Proxy(n,eh);new e}catch{return!1}return!0},Ll=/^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]*);?/,Bl=(n,e)=>{const t=[];let s=n.replace(/^[\s]+/,""),i=s.match(Ll);for(;i!==null;){const r=i[1].slice(1,-1),o=i[0].replace(/([\s]+)?;?$/,"").replace(r,new URL(r,e).toString());t.push(o),s=s.slice(i[0].length).replace(/^[\s]+/,""),i=s.match(Ll)}return[t.join(";"),s]},zl=n=>{if(n!==void 0&&!Array.isArray(n))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},Vl=n=>{if(!r_(n))throw new TypeError("The given value for processorCtor should be a constructor.");if(n.prototype===null||typeof n.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},o_=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>{let f=0;return(m,p,_={credentials:"omit"})=>{const y=u.get(m);if(y!==void 0&&y.has(p))return Promise.resolve();const k=l.get(m);if(k!==void 0){const g=k.get(p);if(g!==void 0)return g}const w=r(m),v=w.audioWorklet===void 0?i(p).then(([g,S])=>{const[T,x]=Bl(g,S),b=`${T};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${x} -})})(window,'_AWGS')`;return t(b)}).then(()=>{const g=d._AWGS.pop();if(g===void 0)throw new SyntaxError;s(w.currentTime,w.sampleRate,()=>g(class{},void 0,(S,T)=>{if(S.trim()==="")throw e();const x=La.get(w);if(x!==void 0){if(x.has(S))throw e();Vl(T),zl(T.parameterDescriptors),x.set(S,T)}else Vl(T),zl(T.parameterDescriptors),La.set(w,new Map([[S,T]]))},w.sampleRate,void 0,void 0))}):Promise.all([i(p),Promise.resolve(n(h,h))]).then(([[g,S],T])=>{const x=f+1;f=x;const[b,A]=Bl(g,S),q=`${b};((AudioWorkletProcessor,registerProcessor)=>{${A} -})(${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${x}',class extends AudioWorkletProcessor{process(){return !1}})`,Y=new Blob([q],{type:"application/javascript; charset=utf-8"}),W=URL.createObjectURL(Y);return w.audioWorklet.addModule(W,_).then(()=>{if(a(w))return w;const V=o(w);return V.audioWorklet.addModule(W,_).then(()=>V)}).then(V=>{if(c===null)throw new SyntaxError;try{new c(V,`__sac${x}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(W))});return k===void 0?l.set(m,new Map([[p,v]])):k.set(p,v),v.then(()=>{const g=u.get(m);g===void 0?u.set(m,new Set([p])):g.add(p)}).finally(()=>{const g=l.get(m);g!==void 0&&g.delete(p)}),v}},Yt=(n,e)=>{const t=n.get(e);if(t===void 0)throw new Error("A value with the given key could not be found.");return t},qo=(n,e)=>{const t=Array.from(n).filter(e);if(t.length>1)throw Error("More than one element was found.");if(t.length===0)throw Error("No element was found.");const[s]=t;return n.delete(s),s},th=(n,e,t,s)=>{const i=Yt(n,e),r=qo(i,o=>o[0]===t&&o[1]===s);return i.size===0&&n.delete(e),r},kr=n=>Yt(Ju,n),si=n=>{if(ti.has(n))throw new Error("The AudioNode is already stored.");ti.add(n),kr(n).forEach(e=>e(!0))},sh=n=>"port"in n,wr=n=>{if(!ti.has(n))throw new Error("The AudioNode is not stored.");ti.delete(n),kr(n).forEach(e=>e(!1))},za=(n,e)=>{!sh(n)&&e.every(t=>t.size===0)&&wr(n)},a_=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>{const f=new WeakMap;return(m,p,_,y,k)=>{const{activeInputs:w,passiveInputs:v}=r(p),{outputs:g}=r(m),S=a(m),T=x=>{const b=c(p),A=c(m);if(x){const R=th(v,m,_,y);n(w,m,R,!1),!k&&!h(m)&&t(A,b,_,y),d(p)&&si(p)}else{const R=s(w,m,_,y);e(v,y,R,!1),!k&&!h(m)&&i(A,b,_,y);const M=o(p);if(M===0)u(p)&&za(p,w);else{const L=f.get(p);L!==void 0&&clearTimeout(L),f.set(p,setTimeout(()=>{u(p)&&za(p,w)},M*1e3))}}};return l(g,[p,_,y],x=>x[0]===p&&x[1]===_&&x[2]===y,!0)?(S.add(T),u(m)?n(w,m,[_,y,T],!0):e(v,y,[m,_,T],!0),!0):!1}},c_=n=>(e,t,[s,i,r],o)=>{const a=e.get(s);a===void 0?e.set(s,new Set([[i,t,r]])):n(a,[i,t,r],c=>c[0]===i&&c[1]===t,o)},l_=n=>(e,t)=>{const s=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(s).connect(e.destination);const i=()=>{t.removeEventListener("ended",i),t.disconnect(s),s.disconnect()};t.addEventListener("ended",i)},u_=n=>(e,t)=>{n(e).add(t)},h_={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},d_=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={...h_,...c},h=s(l,u),d=r(l)?e():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,t()}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,t()}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)}},at=(n,e)=>n.context===e,f_=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!at(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=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},lo=n=>{try{n.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},ls=()=>new DOMException("","IndexSizeError"),mc=n=>{n.getChannelData=(e=>t=>{try{return e.call(n,t)}catch(s){throw s.code===12?ls():s}})(n.getChannelData)},p_={numberOfChannels:1},m_=(n,e,t,s,i,r,o,a)=>{let c=null;return class nh{constructor(u){if(i===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:h,numberOfChannels:d,sampleRate:f}={...p_,...u};c===null&&(c=new i(1,1,44100));const m=s!==null&&e(r,r)?new s({length:h,numberOfChannels:d,sampleRate:f}):c.createBuffer(d,h,f);if(m.numberOfChannels===0)throw t();return typeof m.copyFromChannel!="function"?(o(m),mc(m)):e(lo,()=>lo(m))||a(m),n.add(m),m}static[Symbol.hasInstance](u){return u!==null&&typeof u=="object"&&Object.getPrototypeOf(u)===nh.prototype||n.has(u)}}},mt=-34028234663852886e22,ct=-mt,Ts=n=>ti.has(n),__={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},g_=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...__,...u},f=i(h,d),m=o(h),p=m?e():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=t(this,m,f.playbackRate,ct,mt)}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"){si(this);const d=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",d),Ts(this)&&wr(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",d)}}stop(l=0){this._nativeAudioBufferSourceNode.stop(l),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=l)}},v_=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=t(l);const d=at(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=e(u,f),o!==null&&h.start(...o),a!==null&&h.stop(a)}return r.set(u,h),d?await n(u,l.playbackRate,h.playbackRate):await s(u,l.playbackRate,h.playbackRate),await i(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)}}},y_=n=>"playbackRate"in n,x_=n=>"frequency"in n&&"gain"in n,T_=n=>"offset"in n,k_=n=>!("frequency"in n)&&"gain"in n,w_=n=>"detune"in n&&"frequency"in n,S_=n=>"pan"in n,ut=n=>Yt(Qu,n),Sr=n=>Yt(Ku,n),Va=(n,e)=>{const{activeInputs:t}=ut(n);t.forEach(i=>i.forEach(([r])=>{e.includes(n)||Va(r,[...e,n])}));const s=y_(n)?[n.playbackRate]:sh(n)?Array.from(n.parameters.values()):x_(n)?[n.Q,n.detune,n.frequency,n.gain]:T_(n)?[n.offset]:k_(n)?[n.gain]:w_(n)?[n.detune,n.frequency]:S_(n)?[n.pan]:[];for(const i of s){const r=Sr(i);r!==void 0&&r.activeInputs.forEach(([o])=>Va(o,e))}Ts(n)&&wr(n)},ih=n=>{Va(n.destination,[])},b_=n=>n===void 0||typeof n=="number"||typeof n=="string"&&(n==="balanced"||n==="interactive"||n==="playback"),C_=(n,e,t,s,i,r,o,a,c)=>class extends n{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"?t():m}if(h===null)throw s();if(!b_(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 t();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 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 e()}):(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()),ih(this)}))}createMediaElementSource(u){return new i(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?e():u})}suspend(){return this._nativeAudioContext.suspend().catch(u=>{throw u===void 0?e():u})}},E_=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d=o(h),f=i(h,u,d),m=d?e(a):null;super(l,!1,f,m),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 t();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}},O_=n=>{const e=new WeakMap,t=async(s,i)=>{const r=i.destination;return e.set(i,r),await n(s,i,r),r};return{render(s,i){const r=e.get(i);return r!==void 0?Promise.resolve(r):t(s,i)}}},A_=(n,e,t,s,i,r,o,a)=>(c,l)=>{const u=l.listener,h=()=>{const g=new Float32Array(1),S=e(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),T=o(l);let x=!1,b=[0,0,-1,0,1,0],A=[0,0,0];const R=()=>{if(x)return;x=!0;const Y=s(l,256,9,0);Y.onaudioprocess=({inputBuffer:W})=>{const V=[r(W,g,0),r(W,g,1),r(W,g,2),r(W,g,3),r(W,g,4),r(W,g,5)];V.some(($,Q)=>$!==b[Q])&&(u.setOrientation(...V),b=V);const z=[r(W,g,6),r(W,g,7),r(W,g,8)];z.some(($,Q)=>$!==A[Q])&&(u.setPosition(...z),A=z)},S.connect(Y)},M=Y=>W=>{W!==b[Y]&&(b[Y]=W,u.setOrientation(...b))},L=Y=>W=>{W!==A[Y]&&(A[Y]=W,u.setPosition(...A))},q=(Y,W,V)=>{const z=t(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:W});z.connect(S,0,Y),z.start(),Object.defineProperty(z.offset,"defaultValue",{get(){return W}});const $=n({context:c},T,z.offset,ct,mt);return a($,"value",Q=>()=>Q.call($),Q=>te=>{try{Q.call($,te)}catch(N){if(N.code!==9)throw N}R(),T&&V(te)}),$.cancelAndHoldAtTime=(Q=>T?()=>{throw i()}:(...te)=>{const N=Q.apply($,te);return R(),N})($.cancelAndHoldAtTime),$.cancelScheduledValues=(Q=>T?()=>{throw i()}:(...te)=>{const N=Q.apply($,te);return R(),N})($.cancelScheduledValues),$.exponentialRampToValueAtTime=(Q=>T?()=>{throw i()}:(...te)=>{const N=Q.apply($,te);return R(),N})($.exponentialRampToValueAtTime),$.linearRampToValueAtTime=(Q=>T?()=>{throw i()}:(...te)=>{const N=Q.apply($,te);return R(),N})($.linearRampToValueAtTime),$.setTargetAtTime=(Q=>T?()=>{throw i()}:(...te)=>{const N=Q.apply($,te);return R(),N})($.setTargetAtTime),$.setValueAtTime=(Q=>T?()=>{throw i()}:(...te)=>{const N=Q.apply($,te);return R(),N})($.setValueAtTime),$.setValueCurveAtTime=(Q=>T?()=>{throw i()}:(...te)=>{const N=Q.apply($,te);return R(),N})($.setValueCurveAtTime),$};return{forwardX:q(0,0,M(0)),forwardY:q(1,0,M(1)),forwardZ:q(2,-1,M(2)),positionX:q(6,0,L(0)),positionY:q(7,0,L(1)),positionZ:q(8,0,L(2)),upX:q(3,0,M(3)),upY:q(4,1,M(4)),upZ:q(5,0,M(5))}},{forwardX:d,forwardY:f,forwardZ:m,positionX:p,positionY:_,positionZ:y,upX:k,upY:w,upZ:v}=u.forwardX===void 0?h():u;return{get forwardX(){return d},get forwardY(){return f},get forwardZ(){return m},get positionX(){return p},get positionY(){return _},get positionZ(){return y},get upX(){return k},get upY(){return w},get upZ(){return v}}},uo=n=>"context"in n,br=n=>uo(n[0]),An=(n,e,t,s)=>{for(const i of n)if(t(i)){if(s)return!1;throw Error("The set contains at least one similar element.")}return n.add(e),!0},jl=(n,e,[t,s],i)=>{An(n,[e,t,s],r=>r[0]===e&&r[1]===t,i)},Hl=(n,[e,t,s],i)=>{const r=n.get(e);r===void 0?n.set(e,new Set([[t,s]])):An(r,[t,s],o=>o[0]===t,i)},pi=n=>"inputs"in n,ho=(n,e,t,s)=>{if(pi(e)){const i=e.inputs[s];return n.connect(i,t,0),[i,t,0]}return n.connect(e,t,s),[e,t,s]},rh=(n,e,t)=>{for(const s of n)if(s[0]===e&&s[1]===t)return n.delete(s),s;return null},M_=(n,e,t)=>qo(n,s=>s[0]===e&&s[1]===t),oh=(n,e)=>{if(!kr(n).delete(e))throw new Error("Missing the expected event listener.")},ah=(n,e,t)=>{const s=Yt(n,e),i=qo(s,r=>r[0]===t);return s.size===0&&n.delete(e),i},fo=(n,e,t,s)=>{pi(e)?n.disconnect(e.inputs[s],t,0):n.disconnect(e,t,s)},Ne=n=>Yt(fc,n),Wi=n=>Yt(pc,n),Tn=n=>Ua.has(n),eo=n=>!ti.has(n),ql=(n,e)=>new Promise(t=>{if(e!==null)t(!0);else{const s=n.createScriptProcessor(256,1,1),i=n.createGain(),r=n.createBuffer(1,2,44100),o=r.getChannelData(0);o[0]=1,o[1]=1;const a=n.createBufferSource();a.buffer=r,a.loop=!0,a.connect(s).connect(n.destination),a.connect(i),a.disconnect(i),s.onaudioprocess=c=>{const l=c.inputBuffer.getChannelData(0);Array.prototype.some.call(l,u=>u===1)?t(!0):t(!1),a.stop(),s.onaudioprocess=null,a.disconnect(s),s.disconnect(n.destination)},a.start()}}),ya=(n,e)=>{const t=new Map;for(const s of n)for(const i of s){const r=t.get(i);t.set(i,r===void 0?1:r+1)}t.forEach((s,i)=>e(i,s))},po=n=>"context"in n,P_=n=>{const e=new Map;n.connect=(t=>(s,i=0,r=0)=>{const o=po(s)?t(s,i,r):t(s,i),a=e.get(s);return a===void 0?e.set(s,[{input:r,output:i}]):a.every(c=>c.input!==r||c.output!==i)&&a.push({input:r,output:i}),o})(n.connect.bind(n)),n.disconnect=(t=>(s,i,r)=>{if(t.apply(n),s===void 0)e.clear();else if(typeof s=="number")for(const[o,a]of e){const c=a.filter(l=>l.output!==s);c.length===0?e.delete(o):e.set(o,c)}else if(e.has(s))if(i===void 0)e.delete(s);else{const o=e.get(s);if(o!==void 0){const a=o.filter(c=>c.output!==i&&(c.input!==r||r===void 0));a.length===0?e.delete(s):e.set(s,a)}}for(const[o,a]of e)a.forEach(c=>{po(o)?n.connect(o,c.output,c.input):n.connect(o,c.output)})})(n.disconnect)},D_=(n,e,t,s)=>{const{activeInputs:i,passiveInputs:r}=Sr(e),{outputs:o}=ut(n),a=kr(n),c=l=>{const u=Ne(n),h=Wi(e);if(l){const d=ah(r,n,t);jl(i,n,d,!1),!s&&!Tn(n)&&u.connect(h,t)}else{const d=M_(i,n,t);Hl(r,d,!1),!s&&!Tn(n)&&u.disconnect(h,t)}};return An(o,[e,t],l=>l[0]===e&&l[1]===t,!0)?(a.add(c),Ts(n)?jl(i,n,[t,c],!0):Hl(r,[n,t,c],!0),!0):!1},R_=(n,e,t,s)=>{const{activeInputs:i,passiveInputs:r}=ut(e),o=rh(i[s],n,t);return o===null?[th(r,n,t,s)[2],!1]:[o[2],!0]},I_=(n,e,t)=>{const{activeInputs:s,passiveInputs:i}=Sr(e),r=rh(s,n,t);return r===null?[ah(i,n,t)[1],!1]:[r[2],!0]},_c=(n,e,t,s,i)=>{const[r,o]=R_(n,t,s,i);if(r!==null&&(oh(n,r),o&&!e&&!Tn(n)&&fo(Ne(n),Ne(t),s,i)),Ts(t)){const{activeInputs:a}=ut(t);za(t,a)}},gc=(n,e,t,s)=>{const[i,r]=I_(n,t,s);i!==null&&(oh(n,i),r&&!e&&!Tn(n)&&Ne(n).disconnect(Wi(t),s))},N_=(n,e)=>{const t=ut(n),s=[];for(const i of t.outputs)br(i)?_c(n,e,...i):gc(n,e,...i),s.push(i[0]);return t.outputs.clear(),s},F_=(n,e,t)=>{const s=ut(n),i=[];for(const r of s.outputs)r[1]===t&&(br(r)?_c(n,e,...r):gc(n,e,...r),i.push(r[0]),s.outputs.delete(r));return i},U_=(n,e,t,s,i)=>{const r=ut(n);return Array.from(r.outputs).filter(o=>o[0]===t&&(s===void 0||o[1]===s)&&(i===void 0||o[2]===i)).map(o=>(br(o)?_c(n,e,...o):gc(n,e,...o),r.outputs.delete(o),o[0]))},L_=(n,e,t,s,i,r,o,a,c,l,u,h,d,f,m,p)=>class extends l{constructor(y,k,w,v){super(w),this._context=y,this._nativeAudioNode=w;const g=u(y);h(g)&&t(ql,()=>ql(g,p))!==!0&&P_(w),fc.set(this,w),Ju.set(this,new Set),y.state!=="closed"&&k&&si(this),n(this,v,w)}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,k=0,w=0){if(k<0||k>=this._nativeAudioNode.numberOfOutputs)throw i();const v=u(this._context),g=m(v);if(d(y)||f(y))throw r();if(uo(y)){const x=Ne(y);try{const A=ho(this._nativeAudioNode,x,k,w),R=eo(this);(g||R)&&this._nativeAudioNode.disconnect(...A),this.context.state!=="closed"&&!R&&eo(y)&&si(y)}catch(A){throw A.code===12?r():A}if(e(this,y,k,w,g)){const A=c([this],y);ya(A,s(g))}return y}const S=Wi(y);if(S.name==="playbackRate"&&S.maxValue===1024)throw o();try{this._nativeAudioNode.connect(S,k),(g||eo(this))&&this._nativeAudioNode.disconnect(S,k)}catch(x){throw x.code===12?r():x}if(D_(this,y,k,g)){const x=c([this],y);ya(x,s(g))}}disconnect(y,k,w){let v;const g=u(this._context),S=m(g);if(y===void 0)v=N_(this,S);else if(typeof y=="number"){if(y<0||y>=this.numberOfOutputs)throw i();v=F_(this,S,y)}else{if(k!==void 0&&(k<0||k>=this.numberOfOutputs)||uo(y)&&w!==void 0&&(w<0||w>=y.numberOfInputs))throw i();if(v=U_(this,S,y,k,w),v.length===0)throw r()}for(const T of v){const x=c([this],T);ya(x,a)}}},B_=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>(f,m,p,_=null,y=null)=>{const k=p.value,w=new $m(k),v=m?s(w):null,g={get defaultValue(){return k},get maxValue(){return _===null?p.maxValue:_},get minValue(){return y===null?p.minValue:y},get value(){return p.value},set value(S){p.value=S,g.setValueAtTime(S,f.context.currentTime)},cancelAndHoldAtTime(S){if(typeof p.cancelAndHoldAtTime=="function")v===null&&w.flush(f.context.currentTime),w.add(i(S)),p.cancelAndHoldAtTime(S);else{const T=Array.from(w).pop();v===null&&w.flush(f.context.currentTime),w.add(i(S));const x=Array.from(w).pop();p.cancelScheduledValues(S),T!==x&&x!==void 0&&(x.type==="exponentialRampToValue"?p.exponentialRampToValueAtTime(x.value,x.endTime):x.type==="linearRampToValue"?p.linearRampToValueAtTime(x.value,x.endTime):x.type==="setValue"?p.setValueAtTime(x.value,x.startTime):x.type==="setValueCurve"&&p.setValueCurveAtTime(x.values,x.startTime,x.duration))}return g},cancelScheduledValues(S){return v===null&&w.flush(f.context.currentTime),w.add(r(S)),p.cancelScheduledValues(S),g},exponentialRampToValueAtTime(S,T){if(S===0)throw new RangeError;if(!Number.isFinite(T)||T<0)throw new RangeError;const x=f.context.currentTime;return v===null&&w.flush(x),Array.from(w).length===0&&(w.add(l(k,x)),p.setValueAtTime(k,x)),w.add(o(S,T)),p.exponentialRampToValueAtTime(S,T),g},linearRampToValueAtTime(S,T){const x=f.context.currentTime;return v===null&&w.flush(x),Array.from(w).length===0&&(w.add(l(k,x)),p.setValueAtTime(k,x)),w.add(a(S,T)),p.linearRampToValueAtTime(S,T),g},setTargetAtTime(S,T,x){return v===null&&w.flush(f.context.currentTime),w.add(c(S,T,x)),p.setTargetAtTime(S,T,x),g},setValueAtTime(S,T){return v===null&&w.flush(f.context.currentTime),w.add(l(S,T)),p.setValueAtTime(S,T),g},setValueCurveAtTime(S,T,x){const b=S instanceof Float32Array?S:new Float32Array(S);if(h!==null&&h.name==="webkitAudioContext"){const A=T+x,R=f.context.sampleRate,M=Math.ceil(T*R),L=Math.floor(A*R),q=L-M,Y=new Float32Array(q);for(let V=0;V({replay(e){for(const t of n)if(t.type==="exponentialRampToValue"){const{endTime:s,value:i}=t;e.exponentialRampToValueAtTime(i,s)}else if(t.type==="linearRampToValue"){const{endTime:s,value:i}=t;e.linearRampToValueAtTime(i,s)}else if(t.type==="setTarget"){const{startTime:s,target:i,timeConstant:r}=t;e.setTargetAtTime(i,s,r)}else if(t.type==="setValue"){const{startTime:s,value:i}=t;e.setValueAtTime(i,s)}else if(t.type==="setValueCurve"){const{duration:s,startTime:i,values:r}=t;e.setValueCurveAtTime(r,i,s)}else throw new Error("Can't apply an unknown automation.")}});class ch{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach((s,i)=>e.call(t,s,i,this))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const V_={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},j_=(n,e,t,s,i,r,o,a,c,l,u,h,d,f)=>class extends e{constructor(p,_,y){var k;const w=a(p),v=c(w),g=u({...V_,...y});d(g);const S=La.get(w),T=S==null?void 0:S.get(_),x=v||w.state!=="closed"?w:(k=o(w))!==null&&k!==void 0?k:w,b=i(x,v?null:p.baseLatency,l,_,T,g),A=v?s(_,g,T):null;super(p,!0,b,A);const R=[];b.parameters.forEach((L,q)=>{const Y=t(this,v,L);R.push([q,Y])}),this._nativeAudioWorkletNode=b,this._onprocessorerror=null,this._parameters=new ch(R),v&&n(w,this);const{activeInputs:M}=r(this);h(b,M)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(p){const _=typeof p=="function"?f(this,p):null;this._nativeAudioWorkletNode.onprocessorerror=_;const y=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=y!==null&&y===_?p:y}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function mo(n,e,t,s,i){if(typeof n.copyFromChannel=="function")e[t].byteLength===0&&(e[t]=new Float32Array(128)),n.copyFromChannel(e[t],s,i);else{const r=n.getChannelData(s);if(e[t].byteLength===0)e[t]=r.slice(i,i+128);else{const o=new Float32Array(r.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);e[t].set(o)}}}const lh=(n,e,t,s,i)=>{typeof n.copyToChannel=="function"?e[t].byteLength!==0&&n.copyToChannel(e[t],s,i):e[t].byteLength!==0&&n.getChannelData(s).set(e[t],i)},_o=(n,e)=>{const t=[];for(let s=0;s{const t=Yt(Ba,n),s=Ne(e);return Yt(t,s)},q_=async(n,e,t,s,i,r,o)=>{const a=e===null?Math.ceil(n.context.length/128)*128:e.length,c=s.channelCount*s.numberOfInputs,l=i.reduce((_,y)=>_+y,0),u=l===0?null:t.createBuffer(l,a,t.sampleRate);if(r===void 0)throw new Error("Missing the processor constructor.");const h=ut(n),d=await H_(t,n),f=_o(s.numberOfInputs,s.channelCount),m=_o(s.numberOfOutputs,i),p=Array.from(n.parameters.keys()).reduce((_,y)=>({..._,[y]:new Float32Array(128)}),{});for(let _=0;_0&&e!==null)for(let y=0;y{mo(e,p,y,c+k,_)});for(let y=0;yh.activeInputs[v].size===0?[]:w),k=o(_/t.sampleRate,t.sampleRate,()=>d.process(y,m,p));if(u!==null)for(let w=0,v=0;w(_,y,k)=>{const w=new WeakMap;let v=null;const g=async(S,T)=>{let x=u(S),b=null;const A=at(x,T),R=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(h===null){const M=R.reduce((W,V)=>W+V,0),L=i(T,{channelCount:Math.max(1,M),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,M)}),q=[];for(let W=0;W{const te=new d($,Math.ceil(S.context.length/128)*128,T.sampleRate),N=[],F=[];for(let G=0;G{const I=r(te,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:G.value});return await f(te,G,I.offset),I})),P=s(te,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,V+z)});for(let G=0;Gm(S,te,G))),p(te)})(),T,y,R,k,l)}const M=await v,L=t(T,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[q,Y,W]=b;M!==null&&(L.buffer=M,L.start(0)),L.connect(q);for(let V=0,z=0;Vclass extends m{constructor(g,S){super(g,S),this._nativeContext=g,this._audioWorklet=n===void 0?void 0:{addModule:(T,x)=>n(this,T,x)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new e(this)}createBiquadFilter(){return new i(this)}createBuffer(g,S,T){return new t({length:S,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,S){return new f(this,{feedback:S,feedforward:g})}createOscillator(){return new p(this)}createPanner(){return new _(this)}createPeriodicWave(g,S,T={disableNormalization:!1}){return new y(this,{...T,imag:S,real:g})}createStereoPanner(){return new k(this)}createWaveShaper(){return new w(this)}decodeAudioData(g,S,T){return l(this._nativeContext,g).then(x=>(typeof S=="function"&&S(x),x),x=>{throw typeof T=="function"&&T(x),x})}},Y_={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},Z_=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...Y_,...u},f=i(h,d),m=o(h),p=m?t():null;super(l,!1,f,p),this._Q=e(this,m,f.Q,ct,mt),this._detune=e(this,m,f.detune,1200*Math.log2(ct),-1200*Math.log2(ct)),this._frequency=e(this,m,f.frequency,l.sampleRate/2,0),this._gain=e(this,m,f.gain,40*Math.log10(ct),mt),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()}},$_=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=at(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=e(c,h)}return r.set(c,l),u?(await n(c,a.Q,l.Q),await n(c,a.detune,l.detune),await n(c,a.frequency,l.frequency),await n(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 i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},X_=(n,e)=>(t,s)=>{const i=e.get(t);if(i!==void 0)return i;const r=n.get(t);if(r!==void 0)return r;try{const o=s();return o instanceof Promise?(n.set(t,o),o.catch(()=>!1).then(a=>(n.delete(t),e.set(t,a),a))):(e.set(t,o),o)}catch{return e.set(t,!1),!1}},Q_={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},K_=(n,e,t,s,i)=>class extends n{constructor(o,a){const c=s(o),l={...Q_,...a},u=t(c,l),h=i(c)?e():null;super(o,!1,u,h)}},J_=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!at(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},eg={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},tg=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u=r({...eg,...c}),h=t(l,u),d=i(l)?e():null;super(a,!1,h,d)}},sg=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!at(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},ng=n=>(e,t,s)=>n(t,e,s),ig=n=>(e,t,s=0,i=0)=>{const r=e[s];if(r===void 0)throw n();return po(t)?r.connect(t,0,i):r.connect(t,0)},rg=n=>(e,t)=>{const s=n(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),i=e.createBuffer(1,2,44100);return s.buffer=i,s.loop=!0,s.connect(t),s.start(),()=>{s.stop(),s.disconnect(t)}},og={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},ag=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...og,...l},d=s(u,h),f=r(u),m=f?t():null;super(c,!1,d,m),this._constantSourceNodeRenderer=m,this._nativeConstantSourceNode=d,this._offset=e(this,f,d.offset,ct,mt),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"){si(this);const l=()=>{this._nativeConstantSourceNode.removeEventListener("ended",l),Ts(this)&&wr(this)};this._nativeConstantSourceNode.addEventListener("ended",l)}}stop(c=0){this._nativeConstantSourceNode.stop(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=c)}},cg=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=t(l);const d=at(h,u);if(!d){const f={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,offset:h.offset.value};h=e(u,f),o!==null&&h.start(o),a!==null&&h.stop(a)}return r.set(u,h),d?await n(u,l.offset,h.offset):await s(u,l.offset,h.offset),await i(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)}}},lg=n=>e=>(n[0]=e,n[0]),ug={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},hg=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u={...ug,...c},h=t(l,u),f=i(l)?e():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}},dg=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!at(a,o)){const l={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=n(o,l)}return s.set(o,a),pi(a)?await t(r,o,a.inputs[0]):await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},fg=(n,e)=>(t,s,i)=>{if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new e(t,s,i)}catch(r){throw r.name==="SyntaxError"?n():r}},pg=()=>new DOMException("","DataCloneError"),Gl=n=>{const{port1:e,port2:t}=new MessageChannel;return new Promise(s=>{const i=()=>{t.onmessage=null,e.close(),t.close(),s()};t.onmessage=()=>i();try{e.postMessage(n,[n])}catch{}finally{i()}})},mg=(n,e,t,s,i,r,o,a,c,l,u)=>(h,d)=>{const f=o(h)?h:r(h);if(i.has(d)){const m=t();return Promise.reject(m)}try{i.add(d)}catch{}return e(c,()=>c(f))?f.decodeAudioData(d).then(m=>(Gl(d).catch(()=>{}),e(a,()=>a(m))||u(m),n.add(m),m)):new Promise((m,p)=>{const _=async()=>{try{await Gl(d)}catch{}},y=k=>{p(k),_()};try{f.decodeAudioData(d,k=>{typeof k.copyFromChannel!="function"&&(l(k),mc(k)),n.add(k),_().then(()=>m(k))},k=>{y(k===null?s():k)})}catch(k){y(k)}})},_g=(n,e,t,s,i,r,o,a)=>(c,l)=>{const u=e.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(e.delete(c),!d&&o(c)){const f=s(c),{outputs:m}=t(c);for(const p of m)if(br(p)){const _=s(p[0]);n(f,_,p[1],p[2])}else{const _=i(p[0]);f.connect(_,p[1])}}}else e.set(c,u-l)},gg={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},vg=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...gg,...l},d=s(u,h),f=r(u),m=f?t(h.maxDelayTime):null;super(c,!1,d,m),this._delayTime=e(this,f,d.delayTime),o(this,h.maxDelayTime)}get delayTime(){return this._delayTime}},yg=(n,e,t,s,i)=>r=>{const o=new WeakMap,a=async(c,l)=>{let u=t(c);const h=at(u,l);if(!h){const d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:r};u=e(l,d)}return o.set(l,u),h?await n(l,c.delayTime,u.delayTime):await s(l,c.delayTime,u.delayTime),await i(c,l,u),u};return{render(c,l){const u=o.get(l);return u!==void 0?Promise.resolve(u):a(c,l)}}},xg=n=>(e,t,s,i)=>n(e[i],r=>r[0]===t&&r[1]===s),Tg=n=>(e,t)=>{n(e).delete(t)},kg=n=>"delayTime"in n,wg=(n,e,t)=>function s(i,r){const o=uo(r)?r:t(n,r);if(kg(o))return[];if(i[0]===o)return[i];if(i.includes(o))return[];const{outputs:a}=e(o);return Array.from(a).map(c=>s([...i,o],c[0])).reduce((c,l)=>c.concat(l),[])},Wr=(n,e,t)=>{const s=e[t];if(s===void 0)throw n();return s},Sg=n=>(e,t=void 0,s=void 0,i=0)=>t===void 0?e.forEach(r=>r.disconnect()):typeof t=="number"?Wr(n,e,t).disconnect():po(t)?s===void 0?e.forEach(r=>r.disconnect(t)):i===void 0?Wr(n,e,s).disconnect(t,0):Wr(n,e,s).disconnect(t,0,i):s===void 0?e.forEach(r=>r.disconnect(t)):Wr(n,e,s).disconnect(t,0),bg={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Cg=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...bg,...u},f=s(h,d),m=o(h),p=m?t():null;super(l,!1,f,p),this._attack=e(this,m,f.attack),this._knee=e(this,m,f.knee),this._nativeDynamicsCompressorNode=f,this._ratio=e(this,m,f.ratio),this._release=e(this,m,f.release),this._threshold=e(this,m,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,i()}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,i()}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}},Eg=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=at(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=e(c,h)}return r.set(c,l),u?(await n(c,a.attack,l.attack),await n(c,a.knee,l.knee),await n(c,a.ratio,l.ratio),await n(c,a.release,l.release),await n(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 i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Og=()=>new DOMException("","EncodingError"),Ag=n=>e=>new Promise((t,s)=>{if(n===null){s(new SyntaxError);return}const i=n.document.head;if(i===null)s(new SyntaxError);else{const r=n.document.createElement("script"),o=new Blob([e],{type:"application/javascript"}),a=URL.createObjectURL(o),c=n.onerror,l=()=>{n.onerror=c,URL.revokeObjectURL(a)};n.onerror=(u,h,d,f,m)=>{if(h===a||h===n.location.href&&d===1&&f===1)return l(),s(m),!1;if(c!==null)return c(u,h,d,f,m)},r.onerror=()=>{l(),s(new SyntaxError)},r.onload=()=>{l(),t()},r.src=a,r.type="module",i.appendChild(r)}}),Mg=n=>class{constructor(t){this._nativeEventTarget=t,this._listeners=new WeakMap}addEventListener(t,s,i){if(s!==null){let r=this._listeners.get(s);r===void 0&&(r=n(this,s),typeof s=="function"&&this._listeners.set(s,r)),this._nativeEventTarget.addEventListener(t,r,i)}}dispatchEvent(t){return this._nativeEventTarget.dispatchEvent(t)}removeEventListener(t,s,i){const r=s===null?void 0:this._listeners.get(s);this._nativeEventTarget.removeEventListener(t,r===void 0?null:r,i)}},Pg=n=>(e,t,s)=>{Object.defineProperties(n,{currentFrame:{configurable:!0,get(){return Math.round(e*t)}},currentTime:{configurable:!0,get(){return e}}});try{return s()}finally{n!==null&&(delete n.currentFrame,delete n.currentTime)}},Dg=n=>async e=>{try{const t=await fetch(e);if(t.ok)return[await t.text(),t.url]}catch{}throw n()},Rg={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Ig=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={...Rg,...c},h=s(l,u),d=r(l),f=d?t():null;super(a,!1,h,f),this._gain=e(this,d,h.gain,ct,mt)}get gain(){return this._gain}},Ng=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=at(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=e(c,h)}return r.set(c,l),u?await n(c,a.gain,l.gain):await s(c,a.gain,l.gain),await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Fg=(n,e)=>t=>e(n,t),Ug=n=>e=>{const t=n(e);if(t.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return t.renderer},Lg=n=>e=>{var t;return(t=n.get(e))!==null&&t!==void 0?t:0},Bg=n=>e=>{const t=n(e);if(t.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return t.renderer},zg=n=>e=>n.get(e),et=()=>new DOMException("","InvalidStateError"),Vg=n=>e=>{const t=n.get(e);if(t===void 0)throw et();return t},jg=(n,e)=>t=>{let s=n.get(t);if(s!==void 0)return s;if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new e(1,1,44100),n.set(t,s),s},Hg=n=>e=>{const t=n.get(e);if(t===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return t},Go=()=>new DOMException("","InvalidAccessError"),qg=n=>{n.getFrequencyResponse=(e=>(t,s,i)=>{if(t.length!==s.length||s.length!==i.length)throw Go();return e.call(n,t,s,i)})(n.getFrequencyResponse)},Gg={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Wg=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u=i(l),h={...Gg,...c},d=e(l,u?null:a.baseLatency,h),f=u?t(h.feedback,h.feedforward):null;super(a,!1,d,f),qg(d),this._nativeIIRFilterNode=d,r(this,1)}getFrequencyResponse(a,c,l){return this._nativeIIRFilterNode.getFrequencyResponse(a,c,l)}},uh=(n,e,t,s,i,r,o,a,c,l,u)=>{const h=l.length;let d=a;for(let f=0;f{const i=t instanceof Float64Array?t:new Float64Array(t),r=s instanceof Float64Array?s:new Float64Array(s),o=i.length,a=r.length,c=Math.min(o,a);if(i[0]!==1){for(let m=0;m(r,o)=>{const a=new WeakMap;let c=null;const l=async(u,h)=>{let d=null,f=e(u);const m=at(f,h);if(h.createIIRFilter===void 0?d=n(h,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):m||(f=h.createIIRFilter(o,r)),a.set(h,d===null?f:d),d!==null){if(c===null){if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");const _=new t(u.context.destination.channelCount,u.context.length,h.sampleRate);c=(async()=>{await s(u,_,_.destination);const y=await i(_);return Yg(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)}}},$g=(n,e,t,s,i,r)=>o=>(a,c)=>{const l=n.get(a);if(l===void 0){if(!o&&r(a)){const u=s(a),{outputs:h}=t(a);for(const d of h)if(br(d)){const f=s(d[0]);e(u,f,d[1],d[2])}else{const f=i(d[0]);u.disconnect(f,d[1])}}n.set(a,c)}else n.set(a,l+c)},Xg=(n,e)=>t=>{const s=n.get(t);return e(s)||e(t)},Qg=(n,e)=>t=>n.has(t)||e(t),Kg=(n,e)=>t=>n.has(t)||e(t),Jg=(n,e)=>t=>{const s=n.get(t);return e(s)||e(t)},ev=n=>e=>n!==null&&e instanceof n,tv=n=>e=>n!==null&&typeof n.AudioNode=="function"&&e instanceof n.AudioNode,sv=n=>e=>n!==null&&typeof n.AudioParam=="function"&&e instanceof n.AudioParam,nv=(n,e)=>t=>n(t)||e(t),iv=n=>e=>n!==null&&e instanceof n,rv=n=>n!==null&&n.isSecureContext,ov=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r),c=e(a,o);if(s(a))throw TypeError();super(r,!0,c,null),this._nativeMediaElementAudioSourceNode=c}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},av={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},cv=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r);if(s(a))throw new TypeError;const c={...av,...o},l=e(a,c);super(r,!1,l,null),this._nativeMediaStreamAudioDestinationNode=l}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},lv=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r),c=e(a,o);if(s(a))throw new TypeError;super(r,!0,c,null),this._nativeMediaStreamAudioSourceNode=c}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},uv=(n,e,t)=>class extends n{constructor(i,r){const o=t(i),a=e(o,r);super(i,!0,a,null)}},hv=(n,e,t,s,i,r)=>class extends t{constructor(a,c){super(a),this._nativeContext=a,Ho.set(this,a),s(a)&&i.set(a,new Set),this._destination=new n(this,c),this._listener=e(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}},Yi=n=>{const e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const t=n.decodeAudioData(e.buffer,()=>{});return t===void 0?!1:(t.catch(()=>{}),!0)}catch{}return!1},dv=(n,e)=>(t,s,i)=>{const r=new Set;return t.connect=(o=>(a,c=0,l=0)=>{const u=r.size===0;if(e(a))return o.call(t,a,c,l),n(r,[a,c,l],h=>h[0]===a&&h[1]===c&&h[2]===l,!0),u&&s(),a;o.call(t,a,c),n(r,[a,c],h=>h[0]===a&&h[1]===c,!0),u&&s()})(t.connect),t.disconnect=(o=>(a,c,l)=>{const u=r.size>0;if(a===void 0)o.apply(t),r.clear();else if(typeof a=="number"){o.call(t,a);for(const d of r)d[1]===a&&r.delete(d)}else{e(a)?o.call(t,a,c,l):o.call(t,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&&i()})(t.disconnect),t},Fe=(n,e,t)=>{const s=e[t];s!==void 0&&s!==n[t]&&(n[t]=s)},Qe=(n,e)=>{Fe(n,e,"channelCount"),Fe(n,e,"channelCountMode"),Fe(n,e,"channelInterpretation")},Wl=n=>typeof n.getFloatTimeDomainData=="function",fv=n=>{n.getFloatTimeDomainData=e=>{const t=new Uint8Array(e.length);n.getByteTimeDomainData(t);const s=Math.max(t.length,n.fftSize);for(let i=0;i(t,s)=>{const i=t.createAnalyser();if(Qe(i,s),!(s.maxDecibels>s.minDecibels))throw e();return Fe(i,s,"fftSize"),Fe(i,s,"maxDecibels"),Fe(i,s,"minDecibels"),Fe(i,s,"smoothingTimeConstant"),n(Wl,()=>Wl(i))||fv(i),i},mv=n=>n===null?null:n.hasOwnProperty("AudioBuffer")?n.AudioBuffer:null,ze=(n,e,t)=>{const s=e[t];s!==void 0&&s!==n[t].value&&(n[t].value=s)},_v=n=>{n.start=(e=>{let t=!1;return(s=0,i=0,r)=>{if(t)throw et();e.call(n,s,i,r),t=!0}})(n.start)},vc=n=>{n.start=(e=>(t=0,s=0,i)=>{if(typeof i=="number"&&i<0||s<0||t<0)throw new RangeError("The parameters can't be negative.");e.call(n,t,s,i)})(n.start)},yc=n=>{n.stop=(e=>(t=0)=>{if(t<0)throw new RangeError("The parameter can't be negative.");e.call(n,t)})(n.stop)},gv=(n,e,t,s,i,r,o,a,c,l,u)=>(h,d)=>{const f=h.createBufferSource();return Qe(f,d),ze(f,d,"playbackRate"),Fe(f,d,"buffer"),Fe(f,d,"loop"),Fe(f,d,"loopEnd"),Fe(f,d,"loopStart"),e(t,()=>t(h))||_v(f),e(s,()=>s(h))||c(f),e(i,()=>i(h))||l(f,h),e(r,()=>r(h))||vc(f),e(o,()=>o(h))||u(f,h),e(a,()=>a(h))||yc(f),n(h,f),f},vv=n=>n===null?null:n.hasOwnProperty("AudioContext")?n.AudioContext:n.hasOwnProperty("webkitAudioContext")?n.webkitAudioContext:null,yv=(n,e)=>(t,s,i)=>{const r=t.destination;if(r.channelCount!==s)try{r.channelCount=s}catch{}i&&r.channelCountMode!=="explicit"&&(r.channelCountMode="explicit"),r.maxChannelCount===0&&Object.defineProperty(r,"maxChannelCount",{value:s});const o=n(t,{channelCount:s,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return e(o,"channelCount",a=>()=>a.call(o),a=>c=>{a.call(o,c);try{r.channelCount=c}catch(l){if(c>r.maxChannelCount)throw l}}),e(o,"channelCountMode",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelCountMode=c}),e(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},xv=n=>n===null?null:n.hasOwnProperty("AudioWorkletNode")?n.AudioWorkletNode:null,Tv=n=>{const{port1:e}=new MessageChannel;try{e.postMessage(n)}finally{e.close()}},kv=(n,e,t,s,i)=>(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 n()}},channelCountMode:{get:()=>"explicit",set:()=>{throw n()}},onprocessorerror:{get:()=>f,set:m=>{typeof f=="function"&&h.removeEventListener("processorerror",f),f=typeof m=="function"?m:null,typeof f=="function"&&h.addEventListener("processorerror",f)}}}),h.addEventListener=(m=>(...p)=>{if(p[0]==="processorerror"){const _=typeof p[1]=="function"?p[1]:typeof p[1]=="object"&&p[1]!==null&&typeof p[1].handleEvent=="function"?p[1].handleEvent:null;if(_!==null){const y=d.get(p[1]);y!==void 0?p[1]=y:(p[1]=k=>{k.type==="error"?(Object.defineProperties(k,{type:{value:"processorerror"}}),_(k)):_(new ErrorEvent(p[0],{...k}))},d.set(_,p[1]))}}return m.call(h,"error",p[1],p[2]),m.call(h,...p)})(h.addEventListener),h.removeEventListener=(m=>(...p)=>{if(p[0]==="processorerror"){const _=d.get(p[1]);_!==void 0&&(d.delete(p[1]),p[1]=_)}return m.call(h,"error",p[1],p[2]),m.call(h,p[0],p[1],p[2])})(h.removeEventListener),u.numberOfOutputs!==0){const m=t(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return h.connect(m).connect(r.destination),i(h,()=>m.disconnect(),()=>m.connect(r.destination))}return h}catch(h){throw h.code===11?s():h}if(l===void 0)throw s();return Tv(u),e(r,o,l,u)},hh=(n,e)=>n===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(n*e))))),wv=n=>new Promise((e,t)=>{const{port1:s,port2:i}=new MessageChannel;s.onmessage=({data:r})=>{s.close(),i.close(),e(r)},s.onmessageerror=({data:r})=>{s.close(),i.close(),t(r)},i.postMessage(n)}),Sv=async(n,e)=>{const t=await wv(e);return new n(t)},bv=(n,e,t,s)=>{let i=Ba.get(n);i===void 0&&(i=new WeakMap,Ba.set(n,i));const r=Sv(t,s);return i.set(e,r),r},Cv=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>(f,m,p,_)=>{if(_.numberOfInputs===0&&_.numberOfOutputs===0)throw c();const y=Array.isArray(_.outputChannelCount)?_.outputChannelCount:Array.from(_.outputChannelCount);if(y.some(j=>j<1))throw c();if(y.length!==_.numberOfOutputs)throw e();if(_.channelCountMode!=="explicit")throw c();const k=_.channelCount*_.numberOfInputs,w=y.reduce((j,O)=>j+O,0),v=p.parameterDescriptors===void 0?0:p.parameterDescriptors.length;if(k+v>6||w>6)throw c();const g=new MessageChannel,S=[],T=[];for(let j=0;j<_.numberOfInputs;j+=1)S.push(o(f,{channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation,gain:1})),T.push(i(f,{channelCount:_.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:_.channelCount}));const x=[];if(p.parameterDescriptors!==void 0)for(const{defaultValue:j,maxValue:O,minValue:E,name:X}of p.parameterDescriptors){const ee=r(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:_.parameterData[X]!==void 0?_.parameterData[X]:j===void 0?0:j});Object.defineProperties(ee.offset,{defaultValue:{get:()=>j===void 0?0:j},maxValue:{get:()=>O===void 0?ct:O},minValue:{get:()=>E===void 0?mt:E}}),x.push(ee)}const b=s(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,k+v)}),A=hh(m,f.sampleRate),R=a(f,A,k+v,Math.max(1,w)),M=i(f,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),L=[];for(let j=0;j<_.numberOfOutputs;j+=1)L.push(s(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:y[j]}));for(let j=0;j<_.numberOfInputs;j+=1){S[j].connect(T[j]);for(let O=0;O<_.channelCount;O+=1)T[j].connect(b,O,j*_.channelCount+O)}const q=new ch(p.parameterDescriptors===void 0?[]:p.parameterDescriptors.map(({name:j},O)=>{const E=x[O];return E.connect(b,0,k+O),E.start(0),[j,E.offset]}));b.connect(R);let Y=_.channelInterpretation,W=null;const V=_.numberOfOutputs===0?[R]:L,z={get bufferSize(){return A},get channelCount(){return _.channelCount},set channelCount(j){throw t()},get channelCountMode(){return _.channelCountMode},set channelCountMode(j){throw t()},get channelInterpretation(){return Y},set channelInterpretation(j){for(const O of S)O.channelInterpretation=j;Y=j},get context(){return R.context},get inputs(){return S},get numberOfInputs(){return _.numberOfInputs},get numberOfOutputs(){return _.numberOfOutputs},get onprocessorerror(){return W},set onprocessorerror(j){typeof W=="function"&&z.removeEventListener("processorerror",W),W=typeof j=="function"?j:null,typeof W=="function"&&z.addEventListener("processorerror",W)},get parameters(){return q},get port(){return g.port2},addEventListener(...j){return R.addEventListener(j[0],j[1],j[2])},connect:n.bind(null,V),disconnect:l.bind(null,V),dispatchEvent(...j){return R.dispatchEvent(j[0])},removeEventListener(...j){return R.removeEventListener(j[0],j[1],j[2])}},$=new Map;g.port1.addEventListener=(j=>(...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 X=$.get(O[1]);X!==void 0?O[1]=X:(O[1]=ee=>{u(f.currentTime,f.sampleRate,()=>E(ee))},$.set(E,O[1]))}}return j.call(g.port1,O[0],O[1],O[2])})(g.port1.addEventListener),g.port1.removeEventListener=(j=>(...O)=>{if(O[0]==="message"){const E=$.get(O[1]);E!==void 0&&($.delete(O[1]),O[1]=E)}return j.call(g.port1,O[0],O[1],O[2])})(g.port1.removeEventListener);let Q=null;Object.defineProperty(g.port1,"onmessage",{get:()=>Q,set:j=>{typeof Q=="function"&&g.port1.removeEventListener("message",Q),Q=typeof j=="function"?j:null,typeof Q=="function"&&(g.port1.addEventListener("message",Q),g.port1.start())}}),p.prototype.port=g.port1;let te=null;bv(f,z,p,_).then(j=>te=j);const F=_o(_.numberOfInputs,_.channelCount),C=_o(_.numberOfOutputs,y),P=p.parameterDescriptors===void 0?[]:p.parameterDescriptors.reduce((j,{name:O})=>({...j,[O]:new Float32Array(128)}),{});let G=!0;const I=()=>{_.numberOfOutputs>0&&R.disconnect(M);for(let j=0,O=0;j<_.numberOfOutputs;j+=1){const E=L[j];for(let X=0;X{if(te!==null){const E=h(z);for(let X=0;X{mo(j,P,ee,k+ue,X)});for(let ee=0;ee<_.numberOfInputs;ee+=1)for(let ue=0;ue{if(E[Xe].size>0)return B.set(Xe,A/128),ke;const yi=B.get(Xe);return yi===void 0?[]:(ke.every(ra=>ra.every(Rr=>Rr===0))&&(yi===1?B.delete(Xe):B.set(Xe,yi-1)),ke)});G=u(f.currentTime+X/f.sampleRate,f.sampleRate,()=>te.process(ee,C,P));for(let ke=0,Xe=0;ke<_.numberOfOutputs;ke+=1){for(let zt=0;ztR.connect(se).connect(f.destination),J=()=>{R.disconnect(se),se.disconnect()},ge=()=>{if(G){J(),_.numberOfOutputs>0&&R.connect(M);for(let j=0,O=0;j<_.numberOfOutputs;j+=1){const E=L[j];for(let X=0;X{G&&(ne(),I()),ie=!1};return ne(),d(z,ge,K)},dh=(n,e)=>{const t=n.createBiquadFilter();return Qe(t,e),ze(t,e,"Q"),ze(t,e,"detune"),ze(t,e,"frequency"),ze(t,e,"gain"),Fe(t,e,"type"),t},Ev=(n,e)=>(t,s)=>{const i=t.createChannelMerger(s.numberOfInputs);return n!==null&&n.name==="webkitAudioContext"&&e(t,i),Qe(i,s),i},Ov=n=>{const e=n.numberOfOutputs;Object.defineProperty(n,"channelCount",{get:()=>e,set:t=>{if(t!==e)throw et()}}),Object.defineProperty(n,"channelCountMode",{get:()=>"explicit",set:t=>{if(t!=="explicit")throw et()}}),Object.defineProperty(n,"channelInterpretation",{get:()=>"discrete",set:t=>{if(t!=="discrete")throw et()}})},Cr=(n,e)=>{const t=n.createChannelSplitter(e.numberOfOutputs);return Qe(t,e),Ov(t),t},Av=(n,e,t,s,i)=>(r,o)=>{if(r.createConstantSource===void 0)return t(r,o);const a=r.createConstantSource();return Qe(a,o),ze(a,o,"offset"),e(s,()=>s(r))||vc(a),e(i,()=>i(r))||yc(a),n(r,a),a},mi=(n,e)=>(n.connect=e.connect.bind(e),n.disconnect=e.disconnect.bind(e),n),Mv=(n,e,t,s)=>(i,{offset:r,...o})=>{const a=i.createBuffer(1,2,44100),c=e(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=t(i,{...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),f=()=>c.disconnect(l);return n(i,c),s(mi(h,l),d,f)},Pv=(n,e)=>(t,s)=>{const i=t.createConvolver();if(Qe(i,s),s.disableNormalization===i.normalize&&(i.normalize=!s.disableNormalization),Fe(i,s,"buffer"),s.channelCount>2||(e(i,"channelCount",r=>()=>r.call(i),r=>o=>{if(o>2)throw n();return r.call(i,o)}),s.channelCountMode==="max"))throw n();return e(i,"channelCountMode",r=>()=>r.call(i),r=>o=>{if(o==="max")throw n();return r.call(i,o)}),i},fh=(n,e)=>{const t=n.createDelay(e.maxDelayTime);return Qe(t,e),ze(t,e,"delayTime"),t},Dv=n=>(e,t)=>{const s=e.createDynamicsCompressor();if(Qe(s,t),t.channelCount>2||t.channelCountMode==="max")throw n();return ze(s,t,"attack"),ze(s,t,"knee"),ze(s,t,"ratio"),ze(s,t,"release"),ze(s,t,"threshold"),s},Tt=(n,e)=>{const t=n.createGain();return Qe(t,e),ze(t,e,"gain"),t},Rv=n=>(e,t,s)=>{if(e.createIIRFilter===void 0)return n(e,t,s);const i=e.createIIRFilter(s.feedforward,s.feedback);return Qe(i,s),i};function Iv(n,e){const t=e[0]*e[0]+e[1]*e[1];return[(n[0]*e[0]+n[1]*e[1])/t,(n[1]*e[0]-n[0]*e[1])/t]}function Nv(n,e){return[n[0]*e[0]-n[1]*e[1],n[0]*e[1]+n[1]*e[0]]}function Yl(n,e){let t=[0,0];for(let s=n.length-1;s>=0;s-=1)t=Nv(t,e),t[0]+=n[s];return t}const Fv=(n,e,t,s)=>(i,r,{channelCount:o,channelCountMode:a,channelInterpretation:c,feedback:l,feedforward:u})=>{const h=hh(r,i.sampleRate),d=l instanceof Float64Array?l:new Float64Array(l),f=u instanceof Float64Array?u:new Float64Array(u),m=d.length,p=f.length,_=Math.min(m,p);if(m===0||m>20)throw s();if(d[0]===0)throw e();if(p===0||p>20)throw s();if(f[0]===0)throw e();if(d[0]!==1){for(let x=0;x{const b=x.inputBuffer,A=x.outputBuffer,R=b.numberOfChannels;for(let M=0;Mn.createMediaElementSource(e.mediaElement),Lv=(n,e)=>{const t=n.createMediaStreamDestination();return Qe(t,e),t.numberOfOutputs===1&&Object.defineProperty(t,"numberOfOutputs",{get:()=>0}),t},Bv=(n,{mediaStream:e})=>{const t=e.getAudioTracks();t.sort((r,o)=>r.ido.id?1:0);const s=t.slice(0,1),i=n.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(i,"mediaStream",{value:e}),i},zv=(n,e)=>(t,{mediaStreamTrack:s})=>{if(typeof t.createMediaStreamTrackSource=="function")return t.createMediaStreamTrackSource(s);const i=new MediaStream([s]),r=t.createMediaStreamSource(i);if(s.kind!=="audio")throw n();if(e(t))throw new TypeError;return r},Vv=n=>n===null?null:n.hasOwnProperty("OfflineAudioContext")?n.OfflineAudioContext:n.hasOwnProperty("webkitOfflineAudioContext")?n.webkitOfflineAudioContext:null,jv=(n,e,t,s,i,r)=>(o,a)=>{const c=o.createOscillator();return Qe(c,a),ze(c,a,"detune"),ze(c,a,"frequency"),a.periodicWave!==void 0?c.setPeriodicWave(a.periodicWave):Fe(c,a,"type"),e(t,()=>t(o))||vc(c),e(s,()=>s(o))||r(c,o),e(i,()=>i(o))||yc(c),n(o,c),c},Hv=n=>(e,t)=>{const s=e.createPanner();return s.orientationX===void 0?n(e,t):(Qe(s,t),ze(s,t,"orientationX"),ze(s,t,"orientationY"),ze(s,t,"orientationZ"),ze(s,t,"positionX"),ze(s,t,"positionY"),ze(s,t,"positionZ"),Fe(s,t,"coneInnerAngle"),Fe(s,t,"coneOuterAngle"),Fe(s,t,"coneOuterGain"),Fe(s,t,"distanceModel"),Fe(s,t,"maxDistance"),Fe(s,t,"panningModel"),Fe(s,t,"refDistance"),Fe(s,t,"rolloffFactor"),s)},qv=(n,e,t,s,i,r,o,a,c,l)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:f,distanceModel:m,maxDistance:p,orientationX:_,orientationY:y,orientationZ:k,panningModel:w,positionX:v,positionY:g,positionZ:S,refDistance:T,rolloffFactor:x,...b})=>{const A=u.createPanner();if(b.channelCount>2||b.channelCountMode==="max")throw o();Qe(A,b);const R={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},M=t(u,{...R,channelInterpretation:"speakers",numberOfInputs:6}),L=s(u,{...b,gain:1}),q=s(u,{...R,gain:1}),Y=s(u,{...R,gain:0}),W=s(u,{...R,gain:0}),V=s(u,{...R,gain:0}),z=s(u,{...R,gain:0}),$=s(u,{...R,gain:0}),Q=i(u,256,6,1),te=r(u,{...R,curve:new Float32Array([1,1]),oversample:"none"});let N=[_,y,k],F=[v,g,S];const C=new Float32Array(1);Q.onaudioprocess=({inputBuffer:B})=>{const ie=[c(B,C,0),c(B,C,1),c(B,C,2)];ie.some((ne,J)=>ne!==N[J])&&(A.setOrientation(...ie),N=ie);const se=[c(B,C,3),c(B,C,4),c(B,C,5)];se.some((ne,J)=>ne!==F[J])&&(A.setPosition(...se),F=se)},Object.defineProperty(Y.gain,"defaultValue",{get:()=>0}),Object.defineProperty(W.gain,"defaultValue",{get:()=>0}),Object.defineProperty(V.gain,"defaultValue",{get:()=>0}),Object.defineProperty(z.gain,"defaultValue",{get:()=>0}),Object.defineProperty($.gain,"defaultValue",{get:()=>0});const P={get bufferSize(){},get channelCount(){return A.channelCount},set channelCount(B){if(B>2)throw o();L.channelCount=B,A.channelCount=B},get channelCountMode(){return A.channelCountMode},set channelCountMode(B){if(B==="max")throw o();L.channelCountMode=B,A.channelCountMode=B},get channelInterpretation(){return A.channelInterpretation},set channelInterpretation(B){L.channelInterpretation=B,A.channelInterpretation=B},get coneInnerAngle(){return A.coneInnerAngle},set coneInnerAngle(B){A.coneInnerAngle=B},get coneOuterAngle(){return A.coneOuterAngle},set coneOuterAngle(B){A.coneOuterAngle=B},get coneOuterGain(){return A.coneOuterGain},set coneOuterGain(B){if(B<0||B>1)throw e();A.coneOuterGain=B},get context(){return A.context},get distanceModel(){return A.distanceModel},set distanceModel(B){A.distanceModel=B},get inputs(){return[L]},get maxDistance(){return A.maxDistance},set maxDistance(B){if(B<0)throw new RangeError;A.maxDistance=B},get numberOfInputs(){return A.numberOfInputs},get numberOfOutputs(){return A.numberOfOutputs},get orientationX(){return q.gain},get orientationY(){return Y.gain},get orientationZ(){return W.gain},get panningModel(){return A.panningModel},set panningModel(B){A.panningModel=B},get positionX(){return V.gain},get positionY(){return z.gain},get positionZ(){return $.gain},get refDistance(){return A.refDistance},set refDistance(B){if(B<0)throw new RangeError;A.refDistance=B},get rolloffFactor(){return A.rolloffFactor},set rolloffFactor(B){if(B<0)throw new RangeError;A.rolloffFactor=B},addEventListener(...B){return L.addEventListener(B[0],B[1],B[2])},dispatchEvent(...B){return L.dispatchEvent(B[0])},removeEventListener(...B){return L.removeEventListener(B[0],B[1],B[2])}};h!==P.coneInnerAngle&&(P.coneInnerAngle=h),d!==P.coneOuterAngle&&(P.coneOuterAngle=d),f!==P.coneOuterGain&&(P.coneOuterGain=f),m!==P.distanceModel&&(P.distanceModel=m),p!==P.maxDistance&&(P.maxDistance=p),_!==P.orientationX.value&&(P.orientationX.value=_),y!==P.orientationY.value&&(P.orientationY.value=y),k!==P.orientationZ.value&&(P.orientationZ.value=k),w!==P.panningModel&&(P.panningModel=w),v!==P.positionX.value&&(P.positionX.value=v),g!==P.positionY.value&&(P.positionY.value=g),S!==P.positionZ.value&&(P.positionZ.value=S),T!==P.refDistance&&(P.refDistance=T),x!==P.rolloffFactor&&(P.rolloffFactor=x),(N[0]!==1||N[1]!==0||N[2]!==0)&&A.setOrientation(...N),(F[0]!==0||F[1]!==0||F[2]!==0)&&A.setPosition(...F);const G=()=>{L.connect(A),n(L,te,0,0),te.connect(q).connect(M,0,0),te.connect(Y).connect(M,0,1),te.connect(W).connect(M,0,2),te.connect(V).connect(M,0,3),te.connect(z).connect(M,0,4),te.connect($).connect(M,0,5),M.connect(Q).connect(u.destination)},I=()=>{L.disconnect(A),a(L,te,0,0),te.disconnect(q),q.disconnect(M),te.disconnect(Y),Y.disconnect(M),te.disconnect(W),W.disconnect(M),te.disconnect(V),V.disconnect(M),te.disconnect(z),z.disconnect(M),te.disconnect($),$.disconnect(M),M.disconnect(Q),Q.disconnect(u.destination)};return l(mi(P,A),G,I)},Gv=n=>(e,{disableNormalization:t,imag:s,real:i})=>{const r=s instanceof Float32Array?s:new Float32Array(s),o=i instanceof Float32Array?i:new Float32Array(i),a=e.createPeriodicWave(o,r,{disableNormalization:t});if(Array.from(s).length<2)throw n();return a},Er=(n,e,t,s)=>n.createScriptProcessor(e,t,s),Wv=(n,e)=>(t,s)=>{const i=s.channelCountMode;if(i==="clamped-max")throw e();if(t.createStereoPanner===void 0)return n(t,s);const r=t.createStereoPanner();return Qe(r,s),ze(r,s,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>i,set:o=>{if(o!==i)throw e()}}),r},Yv=(n,e,t,s,i,r)=>{const a=new Float32Array([1,1]),c=Math.PI/2,l={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...l,oversample:"none"},h=(m,p,_,y)=>{const k=new Float32Array(16385),w=new Float32Array(16385);for(let b=0;b<16385;b+=1){const A=b/16384*c;k[b]=Math.cos(A),w[b]=Math.sin(A)}const v=t(m,{...l,gain:0}),g=s(m,{...u,curve:k}),S=s(m,{...u,curve:a}),T=t(m,{...l,gain:0}),x=s(m,{...u,curve:w});return{connectGraph(){p.connect(v),p.connect(S.inputs===void 0?S:S.inputs[0]),p.connect(T),S.connect(_),_.connect(g.inputs===void 0?g:g.inputs[0]),_.connect(x.inputs===void 0?x:x.inputs[0]),g.connect(v.gain),x.connect(T.gain),v.connect(y,0,0),T.connect(y,0,1)},disconnectGraph(){p.disconnect(v),p.disconnect(S.inputs===void 0?S:S.inputs[0]),p.disconnect(T),S.disconnect(_),_.disconnect(g.inputs===void 0?g:g.inputs[0]),_.disconnect(x.inputs===void 0?x:x.inputs[0]),g.disconnect(v.gain),x.disconnect(T.gain),v.disconnect(y,0,0),T.disconnect(y,0,1)}}},d=(m,p,_,y)=>{const k=new Float32Array(16385),w=new Float32Array(16385),v=new Float32Array(16385),g=new Float32Array(16385),S=Math.floor(16385/2);for(let V=0;V<16385;V+=1)if(V>S){const z=(V-S)/(16384-S)*c;k[V]=Math.cos(z),w[V]=Math.sin(z),v[V]=0,g[V]=1}else{const z=V/(16384-S)*c;k[V]=1,w[V]=0,v[V]=Math.cos(z),g[V]=Math.sin(z)}const T=e(m,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),x=t(m,{...l,gain:0}),b=s(m,{...u,curve:k}),A=t(m,{...l,gain:0}),R=s(m,{...u,curve:w}),M=s(m,{...u,curve:a}),L=t(m,{...l,gain:0}),q=s(m,{...u,curve:v}),Y=t(m,{...l,gain:0}),W=s(m,{...u,curve:g});return{connectGraph(){p.connect(T),p.connect(M.inputs===void 0?M:M.inputs[0]),T.connect(x,0),T.connect(A,0),T.connect(L,1),T.connect(Y,1),M.connect(_),_.connect(b.inputs===void 0?b:b.inputs[0]),_.connect(R.inputs===void 0?R:R.inputs[0]),_.connect(q.inputs===void 0?q:q.inputs[0]),_.connect(W.inputs===void 0?W:W.inputs[0]),b.connect(x.gain),R.connect(A.gain),q.connect(L.gain),W.connect(Y.gain),x.connect(y,0,0),L.connect(y,0,0),A.connect(y,0,1),Y.connect(y,0,1)},disconnectGraph(){p.disconnect(T),p.disconnect(M.inputs===void 0?M:M.inputs[0]),T.disconnect(x,0),T.disconnect(A,0),T.disconnect(L,1),T.disconnect(Y,1),M.disconnect(_),_.disconnect(b.inputs===void 0?b:b.inputs[0]),_.disconnect(R.inputs===void 0?R:R.inputs[0]),_.disconnect(q.inputs===void 0?q:q.inputs[0]),_.disconnect(W.inputs===void 0?W:W.inputs[0]),b.disconnect(x.gain),R.disconnect(A.gain),q.disconnect(L.gain),W.disconnect(Y.gain),x.disconnect(y,0,0),L.disconnect(y,0,0),A.disconnect(y,0,1),Y.disconnect(y,0,1)}}},f=(m,p,_,y,k)=>{if(p===1)return h(m,_,y,k);if(p===2)return d(m,_,y,k);throw i()};return(m,{channelCount:p,channelCountMode:_,pan:y,...k})=>{if(_==="max")throw i();const w=n(m,{...k,channelCount:1,channelCountMode:_,numberOfInputs:2}),v=t(m,{...k,channelCount:p,channelCountMode:_,gain:1}),g=t(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:y});let{connectGraph:S,disconnectGraph:T}=f(m,p,v,g,w);Object.defineProperty(g.gain,"defaultValue",{get:()=>0}),Object.defineProperty(g.gain,"maxValue",{get:()=>1}),Object.defineProperty(g.gain,"minValue",{get:()=>-1});const x={get bufferSize(){},get channelCount(){return v.channelCount},set channelCount(M){v.channelCount!==M&&(b&&T(),{connectGraph:S,disconnectGraph:T}=f(m,M,v,g,w),b&&S()),v.channelCount=M},get channelCountMode(){return v.channelCountMode},set channelCountMode(M){if(M==="clamped-max"||M==="max")throw i();v.channelCountMode=M},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(M){v.channelInterpretation=M},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(...M){return v.addEventListener(M[0],M[1],M[2])},dispatchEvent(...M){return v.dispatchEvent(M[0])},removeEventListener(...M){return v.removeEventListener(M[0],M[1],M[2])}};let b=!1;const A=()=>{S(),b=!0},R=()=>{T(),b=!1};return r(mi(x,w),A,R)}},Zv=(n,e,t,s,i,r,o)=>(a,c)=>{const l=a.createWaveShaper();if(r!==null&&r.name==="webkitAudioContext"&&a.createGain().gain.automationRate===void 0)return t(a,c);Qe(l,c);const u=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(u!==null&&u.length<2)throw e();Fe(l,{curve:u},"curve"),Fe(l,c,"oversample");let h=null,d=!1;return o(l,"curve",p=>()=>p.call(l),p=>_=>(p.call(l,_),d&&(s(_)&&h===null?h=n(a,l):!s(_)&&h!==null&&(h(),h=null)),_)),i(l,()=>{d=!0,s(l.curve)&&(h=n(a,l))},()=>{d=!1,h!==null&&(h(),h=null)})},$v=(n,e,t,s,i)=>(r,{curve:o,oversample:a,...c})=>{const l=r.createWaveShaper(),u=r.createWaveShaper();Qe(l,c),Qe(u,c);const h=t(r,{...c,gain:1}),d=t(r,{...c,gain:-1}),f=t(r,{...c,gain:1}),m=t(r,{...c,gain:-1});let p=null,_=!1,y=null;const k={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,m.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,m.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,m.channelInterpretation=g},get context(){return l.context},get curve(){return y},set curve(g){if(g!==null&&g.length<2)throw e();if(g===null)l.curve=g,u.curve=g;else{const S=g.length,T=new Float32Array(S+2-S%2),x=new Float32Array(S+2-S%2);T[0]=g[0],x[0]=-g[S-1];const b=Math.ceil((S+1)/2),A=(S+1)/2-1;for(let R=1;R{h.connect(l).connect(f),h.connect(d).connect(u).connect(m).connect(f),_=!0,s(y)&&(p=n(r,h))},v=()=>{h.disconnect(l),l.disconnect(f),h.disconnect(d),d.disconnect(u),u.disconnect(m),m.disconnect(f),_=!1,p!==null&&(p(),p=null)};return i(mi(k,f),w,v)},ft=()=>new DOMException("","NotSupportedError"),Xv={numberOfChannels:1},Qv=(n,e,t,s,i)=>class extends n{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}={...Xv,...l},f=s(h,u,d);e(Yi,()=>Yi(f))||f.addEventListener("statechange",(()=>{let m=0;const p=_=>{this._state==="running"&&(m>0?(f.removeEventListener("statechange",p),_.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(t()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,ih(this)}))}_waitForThePromiseToSettle(o){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(o):setTimeout(()=>this._waitForThePromiseToSettle(o))}},Kv={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},Jv=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...Kv,...l},d=t(u,h),f=r(u),m=f?s():null,p=c.sampleRate/2;super(c,!1,d,m),this._detune=e(this,f,d.detune,153600,-153600),this._frequency=e(this,f,d.frequency,p,-p),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"){si(this);const l=()=>{this._nativeOscillatorNode.removeEventListener("ended",l),Ts(this)&&wr(this)};this._nativeOscillatorNode.addEventListener("ended",l)}}stop(c=0){this._nativeOscillatorNode.stop(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=c)}},ey=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null,c=null;const l=async(u,h)=>{let d=t(u);const f=at(d,h);if(!f){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=e(h,m),a!==null&&d.start(a),c!==null&&d.stop(c)}return r.set(h,d),f?(await n(h,u.detune,d.detune),await n(h,u.frequency,d.frequency)):(await s(h,u.detune,d.detune),await s(h,u.frequency,d.frequency)),await i(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)}}},ty={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},sy=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...ty,...l},d=t(u,h),f=r(u),m=f?s():null;super(c,!1,d,m),this._nativePannerNode=d,this._orientationX=e(this,f,d.orientationX,ct,mt),this._orientationY=e(this,f,d.orientationY,ct,mt),this._orientationZ=e(this,f,d.orientationZ,ct,mt),this._positionX=e(this,f,d.positionX,ct,mt),this._positionY=e(this,f,d.positionY,ct,mt),this._positionZ=e(this,f,d.positionZ,ct,mt),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}},ny=(n,e,t,s,i,r,o,a,c,l)=>()=>{const u=new WeakMap;let h=null;const d=async(f,m)=>{let p=null,_=r(f);const y={channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation},k={...y,coneInnerAngle:_.coneInnerAngle,coneOuterAngle:_.coneOuterAngle,coneOuterGain:_.coneOuterGain,distanceModel:_.distanceModel,maxDistance:_.maxDistance,panningModel:_.panningModel,refDistance:_.refDistance,rolloffFactor:_.rolloffFactor},w=at(_,m);if("bufferSize"in _)p=s(m,{...y,gain:1});else if(!w){const v={...k,orientationX:_.orientationX.value,orientationY:_.orientationY.value,orientationZ:_.orientationZ.value,positionX:_.positionX.value,positionY:_.positionY.value,positionZ:_.positionZ.value};_=i(m,v)}if(u.set(m,p===null?_: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,m.sampleRate),M=e(R,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});M.connect(R.destination),h=(async()=>{const L=await Promise.all([f.orientationX,f.orientationY,f.orientationZ,f.positionX,f.positionY,f.positionZ].map(async(q,Y)=>{const W=t(R,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Y===0?1:0});return await a(R,q,W.offset),W}));for(let q=0;q<6;q+=1)L[q].connect(M,0,q),L[q].start(0);return l(R)})()}const v=await h,g=s(m,{...y,gain:1});await c(f,m,g);const S=[];for(let R=0;Rq!==T[Y])||L.some((q,Y)=>q!==x[Y])){T=M,x=L;const q=R/m.sampleRate;b.gain.setValueAtTime(0,q),b=s(m,{...y,gain:0}),A=i(m,{...k,orientationX:T[0],orientationY:T[1],orientationZ:T[2],positionX:x[0],positionY:x[1],positionZ:x[2]}),b.gain.setValueAtTime(1,q),g.connect(b).connect(A.inputs[0]),A.connect(p)}}return p}return w?(await n(m,f.orientationX,_.orientationX),await n(m,f.orientationY,_.orientationY),await n(m,f.orientationZ,_.orientationZ),await n(m,f.positionX,_.positionX),await n(m,f.positionY,_.positionY),await n(m,f.positionZ,_.positionZ)):(await a(m,f.orientationX,_.orientationX),await a(m,f.orientationY,_.orientationY),await a(m,f.orientationZ,_.orientationZ),await a(m,f.positionX,_.positionX),await a(m,f.positionY,_.positionY),await a(m,f.positionZ,_.positionZ)),pi(_)?await c(f,m,_.inputs[0]):await c(f,m,_),_};return{render(f,m){const p=u.get(m);return p!==void 0?Promise.resolve(p):d(f,m)}}},iy={disableNormalization:!1},ry=(n,e,t,s)=>class ph{constructor(r,o){const a=e(r),c=s({...iy,...o}),l=n(a,c);return t.add(l),l}static[Symbol.hasInstance](r){return r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===ph.prototype||t.has(r)}},oy=(n,e)=>(t,s,i)=>(n(s).replay(i),e(s,t,i)),ay=(n,e,t)=>async(s,i,r)=>{const o=n(s);await Promise.all(o.activeInputs.map((a,c)=>Array.from(a).map(async([l,u])=>{const d=await e(l).render(l,i),f=s.context.destination;!t(l)&&(s!==f||!t(s))&&d.connect(r,u,c)})).reduce((a,c)=>[...a,...c],[]))},cy=(n,e,t)=>async(s,i,r)=>{const o=e(s);await Promise.all(Array.from(o.activeInputs).map(async([a,c])=>{const u=await n(a).render(a,i);t(a)||u.connect(r,c)}))},ly=(n,e,t,s)=>i=>n(Yi,()=>Yi(i))?Promise.resolve(n(s,s)).then(r=>{if(!r){const o=t(i,512,0,1);i.oncomplete=()=>{o.onaudioprocess=null,o.disconnect()},o.onaudioprocess=()=>i.currentTime,o.connect(i.destination)}return i.startRendering()}):new Promise(r=>{const o=e(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=a=>{o.disconnect(),r(a.renderedBuffer)},o.connect(i.destination),i.startRendering()}),uy=n=>(e,t)=>{n.set(e,t)},hy=n=>(e,t)=>n.set(e,t),dy=(n,e,t,s,i,r,o,a)=>(c,l)=>t(c).render(c,l).then(()=>Promise.all(Array.from(s(l)).map(u=>t(u).render(u,l)))).then(()=>i(l)).then(u=>(typeof u.copyFromChannel!="function"?(o(u),mc(u)):e(r,()=>r(u))||a(u),n.add(u),u)),fy={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},py=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={...fy,...c},h=t(l,u),d=r(l),f=d?s():null;super(a,!1,h,f),this._pan=e(this,d,h.pan)}get pan(){return this._pan}},my=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=at(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=e(c,h)}return r.set(c,l),u?await n(c,a.pan,l.pan):await s(c,a.pan,l.pan),pi(l)?await i(a,c,l.inputs[0]):await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},_y=n=>()=>{if(n===null)return!1;try{new n({length:1,sampleRate:44100})}catch{return!1}return!0},gy=(n,e)=>async()=>{if(n===null)return!0;if(e===null)return!1;const t=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 e(1,128,44100),i=URL.createObjectURL(t);let r=!1,o=!1;try{await s.audioWorklet.addModule(i);const a=new n(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(i)}return r&&!o},vy=(n,e)=>()=>{if(e===null)return Promise.resolve(!1);const t=new e(1,1,44100),s=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(i=>{t.oncomplete=()=>{s.disconnect(),i(t.currentTime!==0)},t.startRendering()})},yy=()=>new DOMException("","UnknownError"),xy={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},Ty=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...xy,...l},d=t(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 e();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=c}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(c){this._nativeWaveShaperNode.oversample=c}},ky=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!at(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=n(o,l)}return s.set(o,a),pi(a)?await t(r,o,a.inputs[0]):await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},wy=()=>typeof window>"u"?null:window,Sy=(n,e)=>t=>{t.copyFromChannel=(s,i,r=0)=>{const o=n(r),a=n(i);if(a>=t.numberOfChannels)throw e();const c=t.length,l=t.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+o{const o=n(r),a=n(i);if(a>=t.numberOfChannels)throw e();const c=t.length,l=t.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+oe=>{e.copyFromChannel=(t=>(s,i,r=0)=>{const o=n(r),a=n(i);if(o(s,i,r=0)=>{const o=n(r),a=n(i);if(o(e,t)=>{const s=t.createBuffer(1,1,44100);e.buffer===null&&(e.buffer=s),n(e,"buffer",i=>()=>{const r=i.call(e);return r===s?null:r},i=>r=>i.call(e,r===null?s:r))},Ey=(n,e)=>(t,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw n()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw n()}});const i=t.createBufferSource();e(s,()=>{const a=s.numberOfInputs;for(let c=0;ci.disconnect(s))},mh=(n,e,t)=>n.copyFromChannel===void 0?n.getChannelData(t)[0]:(n.copyFromChannel(e,t),e[0]),_h=n=>{if(n===null)return!1;const e=n.length;return e%2!==0?n[Math.floor(e/2)]!==0:n[e/2-1]+n[e/2]!==0},Or=(n,e,t,s)=>{let i=n;for(;!i.hasOwnProperty(e);)i=Object.getPrototypeOf(i);const{get:r,set:o}=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(n,e,{get:t(r),set:s(o)})},Oy=n=>({...n,outputChannelCount:n.outputChannelCount!==void 0?n.outputChannelCount:n.numberOfInputs===1&&n.numberOfOutputs===1?[n.channelCount]:Array.from({length:n.numberOfOutputs},()=>1)}),Ay=n=>({...n,channelCount:n.numberOfOutputs}),My=n=>{const{imag:e,real:t}=n;return e===void 0?t===void 0?{...n,imag:[0,0],real:[0,0]}:{...n,imag:Array.from(t,()=>0),real:t}:t===void 0?{...n,imag:e,real:Array.from(e,()=>0)}:{...n,imag:e,real:t}},gh=(n,e,t)=>{try{n.setValueAtTime(e,t)}catch(s){if(s.code!==9)throw s;gh(n,e,t+1e-7)}},Py=n=>{const e=n.createBufferSource();e.start();try{e.start()}catch{return!0}return!1},Dy=n=>{const e=n.createBufferSource(),t=n.createBuffer(1,1,44100);e.buffer=t;try{e.start(0,1)}catch{return!1}return!0},Ry=n=>{const e=n.createBufferSource();e.start();try{e.stop()}catch{return!1}return!0},xc=n=>{const e=n.createOscillator();try{e.start(-1)}catch(t){return t instanceof RangeError}return!1},vh=n=>{const e=n.createBuffer(1,1,44100),t=n.createBufferSource();t.buffer=e,t.start(),t.stop();try{return t.stop(),!0}catch{return!1}},Tc=n=>{const e=n.createOscillator();try{e.stop(-1)}catch(t){return t instanceof RangeError}return!1},Iy=n=>{const{port1:e,port2:t}=new MessageChannel;try{e.postMessage(n)}finally{e.close(),t.close()}},Ny=n=>{n.start=(e=>(t=0,s=0,i)=>{const r=n.buffer,o=r===null?s:Math.min(r.duration,s);r!==null&&o>r.duration-.5/n.context.sampleRate?e.call(n,t,0,0):e.call(n,t,o,i)})(n.start)},yh=(n,e)=>{const t=e.createGain();n.connect(t);const s=(i=>()=>{i.call(n,t),n.removeEventListener("ended",s)})(n.disconnect);n.addEventListener("ended",s),mi(n,t),n.stop=(i=>{let r=!1;return(o=0)=>{if(r)try{i.call(n,o)}catch{t.gain.setValueAtTime(0,o)}else i.call(n,o),r=!0}})(n.stop)},_i=(n,e)=>t=>{const s={value:n};return Object.defineProperties(t,{currentTarget:s,target:s}),typeof e=="function"?e.call(n,t):e.handleEvent.call(n,t)},Fy=s_(An),Uy=c_(An),Ly=xg(qo),xh=new WeakMap,By=Lg(xh),Xt=X_(new Map,new WeakMap),rs=wy(),Th=pv(Xt,ls),kc=Ug(ut),st=ay(ut,kc,Tn),zy=f_(Th,Ne,st),Re=Vg(Ho),Ms=Vv(rs),be=iv(Ms),kh=new WeakMap,wh=Mg(_i),Ar=vv(rs),wc=ev(Ar),Sc=tv(rs),Sh=sv(rs),Zi=xv(rs),Ze=L_(n_(Qu),a_(Fy,Uy,ho,Ly,fo,ut,By,kr,Ne,An,Ts,Tn,eo),Xt,$g(Ua,fo,ut,Ne,Wi,Ts),ls,Go,ft,_g(ho,Ua,ut,Ne,Wi,Re,Ts,be),wg(kh,ut,Yt),wh,Re,wc,Sc,Sh,be,Zi),Vy=d_(Ze,zy,ls,Th,Re,be),bc=new WeakSet,Zl=mv(rs),bh=lg(new Uint32Array(1)),Cc=Sy(bh,ls),Ec=by(bh),Ch=m_(bc,Xt,ft,Zl,Ms,_y(Zl),Cc,Ec),Wo=l_(Tt),Eh=cy(kc,Sr,Tn),us=ng(Eh),gi=gv(Wo,Xt,Py,Dy,Ry,xc,vh,Tc,Ny,Cy(Or),yh),hs=oy(Bg(Sr),Eh),jy=v_(us,gi,Ne,hs,st),Qt=B_(i_(Ku),kh,pc,z_,Xm,Qm,Km,Jm,e_,Ia,$u,Ar,gh),Hy=g_(Ze,jy,Qt,et,gi,Re,be,_i),qy=E_(Ze,O_,ls,et,yv(Tt,Or),Re,be,st),Gy=$_(us,dh,Ne,hs,st),Mn=hy(xh),Wy=Z_(Ze,Qt,Gy,Go,dh,Re,be,Mn),en=dv(An,Sc),Yy=Ey(et,en),tn=Ev(Ar,Yy),Zy=J_(tn,Ne,st),$y=K_(Ze,Zy,tn,Re,be),Xy=sg(Cr,Ne,st),Qy=tg(Ze,Xy,Cr,Re,be,Ay),Ky=Mv(Wo,gi,Tt,en),vi=Av(Wo,Xt,Ky,xc,Tc),Jy=cg(us,vi,Ne,hs,st),e1=ag(Ze,Qt,Jy,vi,Re,be,_i),Oh=Pv(ft,Or),t1=dg(Oh,Ne,st),s1=hg(Ze,t1,Oh,Re,be,Mn),n1=yg(us,fh,Ne,hs,st),i1=vg(Ze,Qt,n1,fh,Re,be,Mn),Ah=Dv(ft),r1=Eg(us,Ah,Ne,hs,st),o1=Cg(Ze,Qt,r1,Ah,ft,Re,be,Mn),a1=Ng(us,Tt,Ne,hs,st),c1=Ig(Ze,Qt,a1,Tt,Re,be),l1=Fv(Go,et,Er,ft),Yo=ly(Xt,Tt,Er,vy(Tt,Ms)),u1=Zg(gi,Ne,Ms,st,Yo),h1=Rv(l1),d1=Wg(Ze,h1,u1,Re,be,Mn),f1=A_(Qt,tn,vi,Er,ft,mh,be,Or),Mh=new WeakMap,p1=hv(qy,f1,wh,be,Mh,_i),Ph=jv(Wo,Xt,xc,vh,Tc,yh),m1=ey(us,Ph,Ne,hs,st),_1=Jv(Ze,Qt,Ph,m1,Re,be,_i),Dh=rg(gi),g1=$v(Dh,et,Tt,_h,en),Zo=Zv(Dh,et,g1,_h,en,Ar,Or),v1=qv(ho,et,tn,Tt,Er,Zo,ft,fo,mh,en),Rh=Hv(v1),y1=ny(us,tn,vi,Tt,Rh,Ne,Ms,hs,st,Yo),x1=sy(Ze,Qt,Rh,y1,Re,be,Mn),T1=Gv(ls),k1=ry(T1,Re,new WeakSet,My),w1=Yv(tn,Cr,Tt,Zo,ft,en),Ih=Wv(w1,ft),S1=my(us,Ih,Ne,hs,st),b1=py(Ze,Qt,Ih,S1,Re,be),C1=ky(Zo,Ne,st),E1=Ty(Ze,et,Zo,C1,Re,be,Mn),Nh=rv(rs),Oc=Pg(rs),Fh=new WeakMap,O1=jg(Fh,Ms),A1=Nh?o_(Xt,ft,Ag(rs),Oc,Dg(t_),Re,O1,be,Zi,new WeakMap,new WeakMap,gy(Zi,Ms),rs):void 0,M1=nv(wc,be),P1=mg(bc,Xt,pg,Og,new WeakSet,Re,M1,lo,Yi,Cc,Ec),Uh=W_(A1,Vy,Ch,Hy,Wy,$y,Qy,e1,s1,P1,i1,o1,c1,d1,p1,_1,x1,k1,b1,E1),D1=ov(Ze,Uv,Re,be),R1=cv(Ze,Lv,Re,be),I1=lv(Ze,Bv,Re,be),N1=zv(et,be),F1=uv(Ze,N1,Re),U1=C_(Uh,et,ft,yy,D1,R1,I1,F1,Ar),Ac=Hg(Mh),L1=u_(Ac),Lh=ig(ls),B1=Tg(Ac),Bh=Sg(ls),zh=new WeakMap,z1=Fg(zh,Yt),V1=Cv(Lh,ls,et,tn,Cr,vi,Tt,Er,ft,Bh,Oc,z1,en),j1=kv(et,V1,Tt,ft,en),H1=G_(us,Lh,gi,tn,Cr,vi,Tt,B1,Bh,Oc,Ne,Zi,Ms,hs,st,Yo),q1=zg(Fh),G1=uy(zh),$l=Nh?j_(L1,Ze,Qt,H1,j1,ut,q1,Re,be,Zi,Oy,G1,Iy,_i):void 0,W1=fg(ft,Ms),Y1=dy(bc,Xt,kc,Ac,Yo,lo,Cc,Ec),Z1=Qv(Uh,Xt,et,W1,Y1),$1=Xg(Ho,wc),X1=Qg(fc,Sc),Q1=Kg(pc,Sh),K1=Jg(Ho,be);function Et(n){return typeof n>"u"}function me(n){return!Et(n)}function J1(n){return typeof n=="function"}function Ys(n){return typeof n=="number"}function mn(n){return Object.prototype.toString.call(n)==="[object Object]"&&n.constructor===Object}function ex(n){return typeof n=="boolean"}function Wt(n){return Array.isArray(n)}function ws(n){return typeof n=="string"}function Yr(n){return ws(n)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(n)}function de(n,e){if(!n)throw new Error(e)}function Zt(n,e,t=1/0){if(!(e<=n&&n<=t))throw new RangeError(`Value must be within [${e}, ${t}], got: ${n}`)}function Vh(n){!n.isOffline&&n.state!=="running"&&Mc('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let jh=!1,Xl=!1;function Ql(n){jh=n}function tx(n){Et(n)&&jh&&!Xl&&(Xl=!0,Mc("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let Hh=console;function sx(...n){Hh.log(...n)}function Mc(...n){Hh.warn(...n)}function nx(n){return new U1(n)}function ix(n,e,t){return new Z1(n,e,t)}const _n=typeof self=="object"?self:null,rx=_n&&(_n.hasOwnProperty("AudioContext")||_n.hasOwnProperty("webkitAudioContext"));function ox(n,e,t){return de(me($l),"This node only works in a secure context (https or localhost)"),new $l(n,e,t)}class ax{constructor(e,t,s,i){this._callback=e,this._type=t,this._minimumUpdateInterval=Math.max(128/(i||44100),.001),this.updateInterval=s,this._createClock()}_createWorker(){const e=new Blob([` - // the initial timeout time - let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; - // onmessage callback - self.onmessage = function(msg){ - timeoutTime = parseInt(msg.data); - }; - // the tick function which posts a message - // and schedules a new tick - function tick(){ - setTimeout(tick, timeoutTime); - self.postMessage('tick'); - } - // call tick initially - tick(); - `],{type:"text/javascript"}),t=URL.createObjectURL(e),s=new Worker(t);s.onmessage=this._callback.bind(this),this._worker=s}_createTimeout(){this._timeout=setTimeout(()=>{this._createTimeout(),this._callback()},this._updateInterval*1e3)}_createClock(){if(this._type==="worker")try{this._createWorker()}catch{this._type="timeout",this._createClock()}else this._type==="timeout"&&this._createTimeout()}_disposeClock(){this._timeout&&clearTimeout(this._timeout),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){var t;this._updateInterval=Math.max(e,this._minimumUpdateInterval),this._type==="worker"&&((t=this._worker)===null||t===void 0||t.postMessage(this._updateInterval*1e3))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}}function kn(n){return Q1(n)}function qs(n){return X1(n)}function to(n){return K1(n)}function jn(n){return $1(n)}function cx(n){return n instanceof Ch}function lx(n,e){return n==="value"||kn(e)||qs(e)||cx(e)}function Zn(n,...e){if(!e.length)return n;const t=e.shift();if(mn(n)&&mn(t))for(const s in t)lx(s,t[s])?n[s]=t[s]:mn(t[s])?(n[s]||Object.assign(n,{[s]:{}}),Zn(n[s],t[s])):Object.assign(n,{[s]:t[s]});return Zn(n,...e)}function ux(n,e){return n.length===e.length&&n.every((t,s)=>e[s]===t)}function Z(n,e,t=[],s){const i={},r=Array.from(e);if(mn(r[0])&&s&&!Reflect.has(r[0],s)&&(Object.keys(r[0]).some(a=>Reflect.has(n,a))||(Zn(i,{[s]:r[0]}),t.splice(t.indexOf(s),1),r.shift())),r.length===1&&mn(r[0]))Zn(i,r[0]);else for(let o=0;o{Reflect.has(n,t)&&delete n[t]}),n}/** - * Tone.js - * @author Yotam Mann - * @license http://opensource.org/licenses/MIT MIT License - * @copyright 2014-2019 Yotam Mann - */class Ps{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...e){(this.debug||_n&&this.toString()===_n.TONE_DEBUG_CLASS)&&sx(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Ps.version=Zu;const Pc=1e-6;function ni(n,e){return n>e+Pc}function ja(n,e){return ni(n,e)||Ht(n,e)}function go(n,e){return n+Pcthis.memory){const t=this.length-this.memory;this._timeline.splice(0,t)}return this}remove(e){const t=this._timeline.indexOf(e);return t!==-1&&this._timeline.splice(t,1),this}get(e,t="time"){const s=this._search(e,t);return s!==-1?this._timeline[s]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,t="time"){const s=this._search(e,t);return s+10&&this._timeline[t-1].time=0?this._timeline[s-1]:null}cancel(e){if(this._timeline.length>1){let t=this._search(e);if(t>=0)if(Ht(this._timeline[t].time,e)){for(let s=t;s>=0&&Ht(this._timeline[s].time,e);s--)t=s;this._timeline=this._timeline.slice(0,t)}else this._timeline=this._timeline.slice(0,t+1);else this._timeline=[]}else this._timeline.length===1&&ja(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){const t=this._search(e);return t>=0&&(this._timeline=this._timeline.slice(t+1)),this}previousEvent(e){const t=this._timeline.indexOf(e);return t>0?this._timeline[t-1]:null}_search(e,t="time"){if(this._timeline.length===0)return-1;let s=0;const i=this._timeline.length;let r=i;if(i>0&&this._timeline[i-1][t]<=e)return i-1;for(;s=0&&this._timeline[s].time>=e;)s--;return this._iterate(t,s+1),this}forEachAtTime(e,t){const s=this._search(e);if(s!==-1&&Ht(this._timeline[s].time,e)){let i=s;for(let r=s;r>=0&&Ht(this._timeline[r].time,e);r--)i=r;this._iterate(r=>{t(r)},i,s)}return this}dispose(){return super.dispose(),this._timeline=[],this}};const Gh=[];function $o(n){Gh.push(n)}function fx(n){Gh.forEach(e=>e(n))}const Wh=[];function Xo(n){Wh.push(n)}function px(n){Wh.forEach(e=>e(n))}class Mr extends Ps{constructor(){super(...arguments),this.name="Emitter"}on(e,t){return e.split(/\W+/).forEach(i=>{Et(this._events)&&(this._events={}),this._events.hasOwnProperty(i)||(this._events[i]=[]),this._events[i].push(t)}),this}once(e,t){const s=(...i)=>{t(...i),this.off(e,s)};return this.on(e,s),this}off(e,t){return e.split(/\W+/).forEach(i=>{if(Et(this._events)&&(this._events={}),this._events.hasOwnProperty(i))if(Et(t))this._events[i]=[];else{const r=this._events[i];for(let o=r.length-1;o>=0;o--)r[o]===t&&r.splice(o,1)}}),this}emit(e,...t){if(this._events&&this._events.hasOwnProperty(e)){const s=this._events[e].slice(0);for(let i=0,r=s.length;i{const s=Object.getOwnPropertyDescriptor(Mr.prototype,t);Object.defineProperty(e.prototype,t,s)})}dispose(){return super.dispose(),this._events=void 0,this}}class Yh extends Mr{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}let Dc=class Zh extends Yh{constructor(){var e,t;super(),this.name="Context",this._constants=new Map,this._timeouts=new ns,this._timeoutIds=0,this._initialized=!1,this._closeStarted=!1,this.isOffline=!1,this._workletPromise=null;const s=Z(Zh.getDefaults(),arguments,["context"]);s.context?(this._context=s.context,this._latencyHint=((e=arguments[0])===null||e===void 0?void 0:e.latencyHint)||""):(this._context=nx({latencyHint:s.latencyHint}),this._latencyHint=s.latencyHint),this._ticker=new ax(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[!((t=arguments[0])===null||t===void 0)&&t.hasOwnProperty("updateInterval")?"_lookAhead":"lookAhead"]=s.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||(fx(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(e,t,s){return this._context.createBuffer(e,t,s)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,t){return this._context.createIIRFilter(e,t)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,t,s){return this._context.createPeriodicWave(e,t,s)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){return de(jn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(e)}createMediaElementSource(e){return de(jn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(e)}createMediaStreamDestination(){return de(jn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}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(e){de(!this._initialized,"The listener cannot be set after initialization."),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){de(!this._initialized,"The transport cannot be set after initialization."),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){de(!this._initialized,"Draw cannot be set after initialization."),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){de(!this._initialized,"The destination cannot be set after initialization."),this._destination=e}createAudioWorkletNode(e,t){return ox(this.rawContext,e,t)}addAudioWorkletModule(e){return We(this,void 0,void 0,function*(){de(me(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletPromise||(this._workletPromise=this.rawContext.audioWorklet.addModule(e)),yield this._workletPromise})}workletsAreReady(){return We(this,void 0,void 0,function*(){(yield this._workletPromise)?this._workletPromise:Promise.resolve()})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get lookAhead(){return this._lookAhead}set lookAhead(e){this._lookAhead=e,this.updateInterval=e?e/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 jn(this._context)?this._context.resume():Promise.resolve()}close(){return We(this,void 0,void 0,function*(){jn(this._context)&&this.state!=="closed"&&!this._closeStarted&&(this._closeStarted=!0,yield this._context.close()),this._initialized&&px(this)})}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{const t=this._context.createBuffer(1,128,this._context.sampleRate),s=t.getChannelData(0);for(let r=0;rthis._constants[e].disconnect()),this.close(),this}_timeoutLoop(){const e=this.now();let t=this._timeouts.peek();for(;this._timeouts.length&&t&&t.time<=e;)t.callback(),this._timeouts.shift(),t=this._timeouts.peek()}setTimeout(e,t){this._timeoutIds++;const s=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:s+t}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach(t=>{t.id===e&&this._timeouts.remove(t)}),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,t){const s=++this._timeoutIds,i=()=>{const r=this.now();this._timeouts.add({callback:()=>{e(),i()},id:s,time:r+t})};return i(),s}};class mx extends Yh{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,t,s){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,t){return{}}createPanner(){return{}}createPeriodicWave(e,t,s){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,t){return{}}get rawContext(){return{}}addAudioWorkletModule(e){return We(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(e,t){return 0}clearTimeout(e){return this}setInterval(e,t){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}}function Ie(n,e){Wt(e)?e.forEach(t=>Ie(n,t)):Object.defineProperty(n,e,{enumerable:!0,writable:!1})}function Rc(n,e){Wt(e)?e.forEach(t=>Rc(n,t)):Object.defineProperty(n,e,{writable:!0})}const Te=()=>{};class we extends Ps{constructor(){super(),this.name="ToneAudioBuffer",this.onload=Te;const e=Z(we.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,ws(e.url)?this.load(e.url).catch(e.onerror):e.url&&this.set(e.url)}static getDefaults(){return{onerror:Te,onload:Te,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:qt().sampleRate}set(e){return e instanceof we?e.loaded?this._buffer=e.get():e.onload=()=>{this.set(e),this.onload(this)}:this._buffer=e,this._reversed&&this._reverse(),this}get(){return this._buffer}load(e){return We(this,void 0,void 0,function*(){const t=we.load(e).then(s=>{this.set(s),this.onload(this)});we.downloads.push(t);try{yield t}finally{const s=we.downloads.indexOf(t);we.downloads.splice(s,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(e){const t=Wt(e)&&e[0].length>0,s=t?e.length:1,i=t?e[0].length:e.length,r=qt(),o=r.createBuffer(s,i,r.sampleRate),a=!t&&s===1?[e]:e;for(let c=0;ci/s),this.fromArray(t)}return this}toArray(e){if(Ys(e))return this.getChannelData(e);if(this.numberOfChannels===1)return this.toArray(0);{const t=[];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(e){this._reversed!==e&&(this._reversed=e,this._reverse())}static fromArray(e){return new we().fromArray(e)}static fromUrl(e){return We(this,void 0,void 0,function*(){return yield new we().load(e)})}static load(e){return We(this,void 0,void 0,function*(){const t=e.match(/\[([^\]\[]+\|.+)\]$/);if(t){const c=t[1].split("|");let l=c[0];for(const u of c)if(we.supportsType(u)){l=u;break}e=e.replace(t[0],l)}const s=we.baseUrl===""||we.baseUrl.endsWith("/")?we.baseUrl:we.baseUrl+"/",i=document.createElement("a");i.href=s+e,i.pathname=(i.pathname+i.hash).split("/").map(encodeURIComponent).join("/");const r=yield fetch(i.href);if(!r.ok)throw new Error(`could not load url: ${e}`);const o=yield r.arrayBuffer();return yield qt().decodeAudioData(o)})}static supportsType(e){const t=e.split("."),s=t[t.length-1];return document.createElement("audio").canPlayType("audio/"+s)!==""}static loaded(){return We(this,void 0,void 0,function*(){for(yield Promise.resolve();we.downloads.length;)yield we.downloads[0]})}}we.baseUrl="";we.downloads=[];class Qo extends Dc{constructor(){super({clockSource:"offline",context:to(arguments[0])?arguments[0]:ix(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:to(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=to(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return We(this,void 0,void 0,function*(){let t=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,t++;const s=Math.floor(this.sampleRate/128);e&&t%s===0&&(yield new Promise(i=>setTimeout(i,1)))}})}render(e=!0){return We(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(e);const t=yield this._context.startRendering();return new we(t)})}close(){return Promise.resolve()}}const $h=new mx;let dn=$h;function qt(){return dn===$h&&rx&&_x(new Dc),dn}function _x(n,e=!1){e&&dn.dispose(),jn(n)?dn=new Dc(n):to(n)?dn=new Qo(n):dn=n}function gx(){return dn.resume()}if(_n&&!_n.TONE_SILENCE_LOGGING){const e=` * Tone.js v${Zu} * `;console.log(`%c${e}`,"background: #000; color: #fff")}function vx(n){return Math.pow(10,n/20)}function yx(n){return 20*(Math.log(n)/Math.LN10)}function Xh(n){return Math.pow(2,n/12)}let Ko=440;function xx(){return Ko}function Tx(n){Ko=n}function Ha(n){return Math.round(Qh(n))}function Qh(n){return 69+12*Math.log2(n/Ko)}function kx(n){return Ko*Math.pow(2,(n-69)/12)}class Ic extends Ps{constructor(e,t,s){super(),this.defaultUnits="s",this._val=t,this._units=s,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,t)=>{const s=parseInt(e,10),i=t==="."?1.5:1;return s===1?this._beatsToUnits(this._getTimeSignature())*i:this._beatsToUnits(4/s)*i},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{const t=parseInt(e,10);return this._beatsToUnits(8/(Math.floor(t)*3))},regexp:/^(\d+)t$/i},tr:{method:(e,t,s)=>{let i=0;return e&&e!=="0"&&(i+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&t!=="0"&&(i+=this._beatsToUnits(parseFloat(t))),s&&s!=="0"&&(i+=this._beatsToUnits(parseFloat(s)/4)),i},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof Ic&&this.fromType(this._val),Et(this._val))return this._noArg();if(ws(this._val)&&Et(this._units)){for(const e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(mn(this._val)){let e=0;for(const t in this._val)if(me(this._val[t])){const s=this._val[t],i=new this.constructor(this.context,t).valueOf()*s;e+=i}return e}if(me(this._units)){const e=this._expressions[this._units],t=this._val.toString().trim().match(e.regexp);return t?e.method.apply(this,t.slice(1)):e.method.call(this,this._val)}else return ws(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*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(e){switch(this._units=void 0,this.defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}}class Gt extends Ic{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:e=>{const t=new Gt(this.context,e).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(t))},regexp:/^@(.+)/}})}quantize(e,t=1){const s=new this.constructor(this.context,e).valueOf(),i=this.valueOf(),a=Math.round(i/s)*s-i;return i+a*t}toNotation(){const e=this.toSeconds(),t=["1m"];for(let r=1;r<9;r++){const o=Math.pow(2,r);t.push(o+"n."),t.push(o+"n"),t.push(o+"t")}t.push("0");let s=t[0],i=new Gt(this.context,t[0]).toSeconds();return t.forEach(r=>{const o=new Gt(this.context,r).toSeconds();Math.abs(o-e)3&&(i=parseFloat(parseFloat(r).toFixed(3))),[s,t,i].join(":")}toTicks(){const e=this._beatsToUnits(1);return this.valueOf()/e*this._getPPQ()}toSeconds(){return this.valueOf()}toMidi(){return Ha(this.toFrequency())}_now(){return this.context.now()}}class It extends Gt{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return xx()}static set A4(e){Tx(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return this.defaultUnits==="midi"?e:It.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|##|x|bb|###|#x|x#|bbb)?)(-?[0-9]+)/i,method(e,t){const i=wx[e.toLowerCase()]+(parseInt(t,10)+1)*12;return this.defaultUnits==="midi"?i:It.mtof(i)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,t,s){let i=1;return e&&e!=="0"&&(i*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&t!=="0"&&(i*=this._beatsToUnits(parseFloat(t))),s&&s!=="0"&&(i*=this._beatsToUnits(parseFloat(s)/4)),i}}})}transpose(e){return new It(this.context,this.valueOf()*Xh(e))}harmonize(e){return e.map(t=>this.transpose(t))}toMidi(){return Ha(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/It.A4);let s=Math.round(12*t)+57;const i=Math.floor(s/12);return i<0&&(s+=-12*i),Sx[s%12]+i.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(e*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return kx(e)}static ftom(e){return Ha(e)}}const wx={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},Sx=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class Vi extends Gt{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class _t extends Ps{constructor(){super();const e=Z(_t.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:qt()}}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(e){return tx(e),new Gt(this.context,e).toSeconds()}toFrequency(e){return new It(this.context,e).toFrequency()}toTicks(e){return new Vi(this.context,e).toTicks()}_getPartialProperties(e){const t=this.get();return Object.keys(t).forEach(s=>{Et(e[s])&&delete t[s]}),t}get(){const e=hx(this);return Object.keys(e).forEach(t=>{if(Reflect.has(this,t)){const s=this[t];me(s)&&me(s.value)&&me(s.setValueAtTime)?e[t]=s.value:s instanceof _t?e[t]=s._getPartialProperties(e[t]):Wt(s)||Ys(s)||ws(s)||ex(s)?e[t]=s:delete e[t]}}),e}set(e){return Object.keys(e).forEach(t=>{Reflect.has(this,t)&&me(this[t])&&(this[t]&&me(this[t].value)&&me(this[t].setValueAtTime)?this[t].value!==e[t]&&(this[t].value=e[t]):this[t]instanceof _t?this[t].set(e[t]):this[t]=e[t])}),this}}class Nc extends ns{constructor(e="stopped"){super(),this.name="StateTimeline",this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){const t=this.get(e);return t!==null?t.state:this._initial}setStateAtTime(e,t,s){return Zt(t,0),this.add(Object.assign({},s,{state:e,time:t})),this}getLastState(e,t){const s=this._search(t);for(let i=s;i>=0;i--){const r=this._timeline[i];if(r.state===e)return r}}getNextState(e,t){const s=this._search(t);if(s!==-1)for(let i=s;i0,"timeConstant must be a number greater than 0");const r=this.toSeconds(t);return this._assertRange(i),de(isFinite(i)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(t)}`),this._events.add({constant:s,time:r,type:"setTargetAtTime",value:i}),this.log(this.units,"setTargetAtTime",e,r,s),this._param.setTargetAtTime(i,r,s),this}setValueCurveAtTime(e,t,s,i=1){s=this.toSeconds(s),t=this.toSeconds(t);const r=this._fromType(e[0])*i;this.setValueAtTime(this._toType(r),t);const o=s/(e.length-1);for(let a=1;a{i.type==="cancelScheduledValues"?e.cancelScheduledValues(i.time):i.type==="setTargetAtTime"?e.setTargetAtTime(i.value,i.time,i.constant):e[i.type](i.value,i.time)}),this}setParam(e){de(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const t=this.input;return t.disconnect(this._param),this.apply(e),this._param=e,t.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,t,s,i,r){return s+(t-s)*Math.exp(-(r-e)/i)}_linearInterpolate(e,t,s,i,r){return t+(i-t)*((r-e)/(s-e))}_exponentialInterpolate(e,t,s,i,r){return t*Math.pow(i/t,(r-e)/(s-e))}}class re extends _t{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return me(this.input)?kn(this.input)||this.input instanceof Se?1:this.input.numberOfInputs:0}get numberOfOutputs(){return me(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return me(e)&&(e instanceof re||qs(e))}_getInternalNodes(){const e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach(s=>{s.channelCount=e.channelCount,s.channelCountMode=e.channelCountMode,s.channelInterpretation=e.channelInterpretation})}_getChannelProperties(){const e=this._getInternalNodes();de(e.length>0,"ToneAudioNode does not have any internal nodes");const t=e[0];return{channelCount:t.channelCount,channelCountMode:t.channelCountMode,channelInterpretation:t.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelInterpretation:e}))}connect(e,t=0,s=0){return Zs(this,e,t,s),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return Mc("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,s=0){return bx(this,e,t,s),this}chain(...e){return $i(this,...e),this}fan(...e){return e.forEach(t=>this.connect(t)),this}dispose(){return super.dispose(),me(this.input)&&(this.input instanceof re?this.input.dispose():qs(this.input)&&this.input.disconnect()),me(this.output)&&(this.output instanceof re?this.output.dispose():qs(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function $i(...n){const e=n.shift();n.reduce((t,s)=>(t instanceof re?t.connect(s):qs(t)&&Zs(t,s),s),e)}function Zs(n,e,t=0,s=0){for(de(me(n),"Cannot connect from undefined node"),de(me(e),"Cannot connect to undefined node"),(e instanceof re||qs(e))&&de(e.numberOfInputs>0,"Cannot connect to node with no inputs"),de(n.numberOfOutputs>0,"Cannot connect from node with no outputs");e instanceof re||e instanceof Se;)me(e.input)&&(e=e.input);for(;n instanceof re;)me(n.output)&&(n=n.output);kn(e)?n.connect(e,t):n.connect(e,t,s)}function bx(n,e,t=0,s=0){if(me(e))for(;e instanceof re;)e=e.input;for(;!qs(n);)me(n.output)&&(n=n.output);kn(e)?n.disconnect(e,t):qs(e)?n.disconnect(e,t,s):n.disconnect()}class Ae extends re{constructor(){super(Z(Ae.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=Z(Ae.getDefaults(),arguments,["gain","units"]);this.gain=new Se({context:this.context,convert:e.convert,param:this._gainNode.gain,units:e.units,value:e.gain,minValue:e.minValue,maxValue:e.maxValue}),Ie(this,"gain")}static getDefaults(){return Object.assign(re.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class ii extends re{constructor(e){super(e),this.onended=Te,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new Ae({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(t){const s=this.toSeconds(t);return this._startTime!==-1&&s>=this._startTime&&(this._stopTime===-1||s<=this._stopTime)?"started":"stopped"},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign(re.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:Te})}_startGain(e,t=1){de(this._startTime===-1,"Source cannot be started more than once");const s=this.toSeconds(this._fadeIn);return this._startTime=e+s,this._startTime=Math.max(this._startTime,this.context.currentTime),s>0?(this._gainNode.gain.setValueAtTime(0,e),this._curve==="linear"?this._gainNode.gain.linearRampToValueAtTime(t,e+s):this._gainNode.gain.exponentialApproachValueAtTime(t,e,s)):this._gainNode.gain.setValueAtTime(t,e),this}stop(e){return this.log("stop",e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){de(this._startTime!==-1,"'start' must be called before 'stop'"),this.cancelStop();const t=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+t,this._stopTime=Math.max(this._stopTime,this.now()),t>0?this._curve==="linear"?this._gainNode.gain.linearRampTo(0,t,e):this._gainNode.gain.targetRampTo(0,t,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{const s=this._curve==="exponential"?t*2:0;this._stopSource(this.now()+s),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==Te&&(this.onended(this),this.onended=Te,!this.context.isOffline)){const e=()=>this.dispose();typeof window.requestIdleCallback<"u"?window.requestIdleCallback(e):setTimeout(e,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),de(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=Te,this}}class vo extends ii{constructor(){super(Z(vo.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=Z(vo.getDefaults(),arguments,["offset"]);Zs(this._source,this._gainNode),this.offset=new Se({context:this.context,convert:e.convert,param:this._source.offset,units:e.units,value:e.offset,minValue:e.minValue,maxValue:e.maxValue})}static getDefaults(){return Object.assign(ii.getDefaults(),{convert:!0,offset:1,units:"number"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._source.start(t),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class De extends re{constructor(){super(Z(De.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=Z(De.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new vo({context:this.context,convert:e.convert,offset:e.value,units:e.units,minValue:e.minValue,maxValue:e.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(re.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,s=0){return Fc(this,e,t,s),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,t){return this._param.setValueAtTime(e,t),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,t){return this._param.linearRampToValueAtTime(e,t),this}exponentialRampToValueAtTime(e,t){return this._param.exponentialRampToValueAtTime(e,t),this}exponentialRampTo(e,t,s){return this._param.exponentialRampTo(e,t,s),this}linearRampTo(e,t,s){return this._param.linearRampTo(e,t,s),this}targetRampTo(e,t,s){return this._param.targetRampTo(e,t,s),this}exponentialApproachValueAtTime(e,t,s){return this._param.exponentialApproachValueAtTime(e,t,s),this}setTargetAtTime(e,t,s){return this._param.setTargetAtTime(e,t,s),this}setValueCurveAtTime(e,t,s,i){return this._param.setValueCurveAtTime(e,t,s,i),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,t,s){return this._param.rampTo(e,t,s),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}}function Fc(n,e,t,s){(e instanceof Se||kn(e)||e instanceof De&&e.override)&&(e.cancelScheduledValues(0),e.setValueAtTime(0,0),e instanceof De&&(e.overridden=!0)),Zs(n,e,t,s)}class yo extends Se{constructor(){super(Z(yo.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new ns(1/0),this._multiplier=1;const e=Z(yo.getDefaults(),arguments,["value"]);this._multiplier=e.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(e.value)}),this.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(Se.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(e,t,s){t=this.toSeconds(t),this.setRampPoint(t);const i=this._fromType(e),r=this._events.get(t),o=Math.round(Math.max(1/s,1));for(let a=0;a<=o;a++){const c=s*a+t,l=this._exponentialApproach(r.time,r.value,i,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}setValueAtTime(e,t){const s=this.toSeconds(t);super.setValueAtTime(e,t);const i=this._events.get(s),r=this._events.previousEvent(i),o=this._getTicksUntilEvent(r,s);return i.ticks=Math.max(o,0),this}linearRampToValueAtTime(e,t){const s=this.toSeconds(t);super.linearRampToValueAtTime(e,t);const i=this._events.get(s),r=this._events.previousEvent(i),o=this._getTicksUntilEvent(r,s);return i.ticks=Math.max(o,0),this}exponentialRampToValueAtTime(e,t){t=this.toSeconds(t);const s=this._fromType(e),i=this._events.get(t),r=Math.round(Math.max((t-i.time)*10,1)),o=(t-i.time)/r;for(let a=0;a<=r;a++){const c=o*a+i.time,l=this._exponentialInterpolate(i.time,i.value,t,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}_getTicksUntilEvent(e,t){if(e===null)e={ticks:0,time:0,type:"setValueAtTime",value:0};else if(Et(e.ticks)){const o=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(o,e.time)}const s=this._fromType(this.getValueAtTime(e.time));let i=this._fromType(this.getValueAtTime(t));const r=this._events.get(t);return r&&r.time===t&&r.type==="setValueAtTime"&&(i=this._fromType(this.getValueAtTime(t-this.sampleTime))),.5*(t-e.time)*(s+i)+e.ticks}getTicksAtTime(e){const t=this.toSeconds(e),s=this._events.get(t);return Math.max(this._getTicksUntilEvent(s,t),0)}getDurationOfTicks(e,t){const s=this.toSeconds(t),i=this.getTicksAtTime(t);return this.getTimeOfTick(i+e)-s}getTimeOfTick(e){const t=this._events.get(e,"ticks"),s=this._events.getAfter(e,"ticks");if(t&&t.ticks===e)return t.time;if(t&&s&&s.type==="linearRampToValueAtTime"&&t.value!==s.value){const i=this._fromType(this.getValueAtTime(t.time)),o=(this._fromType(this.getValueAtTime(s.time))-i)/(s.time-t.time),a=Math.sqrt(Math.pow(i,2)-2*o*(t.ticks-e)),c=(-i+a)/o,l=(-i-a)/o;return(c>0?c:l)+t.time}else return t?t.value===0?1/0:t.time+(e-t.ticks)/t.value:e/this._initialValue}ticksToTime(e,t){return this.getDurationOfTicks(e,t)}timeToTicks(e,t){const s=this.toSeconds(t),i=this.toSeconds(e),r=this.getTicksAtTime(s);return this.getTicksAtTime(s+i)-r}_fromType(e){return this.units==="bpm"&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return this.units==="bpm"&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){const t=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(t,0)}}class xo extends De{constructor(){super(Z(xo.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=Z(xo.getDefaults(),arguments,["value"]);this.input=this._param=new yo({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(De.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(e,t){return this._param.ticksToTime(e,t)}timeToTicks(e,t){return this._param.timeToTicks(e,t)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,t){return this._param.getDurationOfTicks(e,t)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}}class To extends _t{constructor(){super(Z(To.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new Nc,this._tickOffset=new ns,this._ticksAtTime=new ns,this._secondsAtTime=new ns;const e=Z(To.getDefaults(),arguments,["frequency"]);this.frequency=new xo({context:this.context,units:e.units,value:e.frequency}),Ie(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},_t.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,t){const s=this.toSeconds(e);return this._state.getValueAtTime(s)!=="started"&&(this._state.setStateAtTime("started",s),me(t)&&this.setTicksAtTime(t,s),this._ticksAtTime.cancel(s),this._secondsAtTime.cancel(s)),this}stop(e){const t=this.toSeconds(e);if(this._state.getValueAtTime(t)==="stopped"){const s=this._state.get(t);s&&s.time>0&&(this._tickOffset.cancel(s.time),this._state.cancel(s.time))}return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this.setTicksAtTime(0,t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}pause(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)==="started"&&(this._state.setStateAtTime("paused",t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t)),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getTicksAtTime(e){const t=this.toSeconds(e),s=this._state.getLastState("stopped",t),i=this._ticksAtTime.get(t),r={state:"paused",time:t};this._state.add(r);let o=i||s,a=i?i.ticks:0,c=null;return this._state.forEachBetween(o.time,t+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(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){const t=this.now(),s=this.frequency.timeToTicks(e,t);this.setTicksAtTime(s,t)}getSecondsAtTime(e){e=this.toSeconds(e);const t=this._state.getLastState("stopped",e),s={state:"paused",time:e};this._state.add(s);const i=this._secondsAtTime.get(e);let r=i||t,o=i?i.seconds:0,a=null;return this._state.forEachBetween(r.time,e+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(e,t){return t=this.toSeconds(t),this._tickOffset.cancel(t),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,t),ticks:e,time:t}),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,t=this.now()){const s=this._tickOffset.get(t),i=this._state.get(t),r=Math.max(s.time,i.time),o=this.frequency.getTicksAtTime(r)+e-s.ticks;return this.frequency.getTimeOfTick(o)}forEachTickBetween(e,t,s){let i=this._state.get(e);this._state.forEachBetween(e,t,o=>{i&&i.state==="started"&&o.state!=="started"&&this.forEachTickBetween(Math.max(i.time,e),o.time-this.sampleTime,s),i=o});let r=null;if(i&&i.state==="started"){const o=Math.max(i.time,e),a=this.frequency.getTicksAtTime(o),c=this.frequency.getTicksAtTime(i.time),l=a-c;let u=Math.ceil(l)-l;u=Ht(u,1)?0:u;let h=this.frequency.getTimeOfTick(a+u);for(;h{switch(s.state){case"started":const i=this._tickSource.getTicksAtTime(s.time);this.emit("start",s.time,i);break;case"stopped":s.time!==0&&this.emit("stop",s.time);break;case"paused":this.emit("pause",s.time);break}}),this._tickSource.forEachTickBetween(e,t,(s,i)=>{this.callback(s,i)}))}getStateAtTime(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}Mr.mixin(Xi);class Uc extends Ps{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=Z(Uc.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=e.baseUrl,Object.keys(e.urls).forEach(t=>{this._loadingCount++;const s=e.urls[t];this.add(t,s,this._bufferLoaded.bind(this,e.onload),e.onerror)})}static getDefaults(){return{baseUrl:"",onerror:Te,onload:Te,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return de(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,this._loadingCount===0&&e&&e()}get loaded(){return Array.from(this._buffers).every(([e,t])=>t.loaded)}add(e,t,s=Te,i=Te){return ws(t)?(this.baseUrl&&t.trim().substring(0,11).toLowerCase()==="data:audio/"&&(this.baseUrl=""),this._buffers.set(e.toString(),new we(this.baseUrl+t,s,i))):this._buffers.set(e.toString(),new we(t,s,i)),this}dispose(){return super.dispose(),this._buffers.forEach(e=>e.dispose()),this._buffers.clear(),this}}class Gn extends Vi{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class Cx extends _t{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new ns,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,t){return this._events.add({callback:e,time:this.toSeconds(t)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){const e=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=e;){const t=this._events.shift();t&&e-t.time<=this.expiration&&t.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}$o(n=>{n.draw=new Cx({context:n})});Xo(n=>{n.draw.dispose()});class Ex extends Ps{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(e){de(me(e.time),"Events must have a time property"),de(me(e.duration),"Events must have a duration parameter"),e.time=e.time.valueOf();let t=new Ox(e.time,e.time+e.duration,e);for(this._root===null?this._root=t:this._root.insert(t),this._length++;t!==null;)t.updateHeight(),t.updateMax(),this._rebalance(t),t=t.parent;return this}remove(e){if(this._root!==null){const t=[];this._root.search(e.time,t);for(const s of t)if(s.event===e){this._removeNode(s),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,t=>this.remove(t)),this}_setRoot(e){this._root=e,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(e,t){e.parent!==null?(e.isLeftChild()?e.parent.left=t:e.parent.right=t,this._rebalance(e.parent)):this._setRoot(t)}_removeNode(e){if(e.left===null&&e.right===null)this._replaceNodeInParent(e,null);else if(e.right===null)this._replaceNodeInParent(e,e.left);else if(e.left===null)this._replaceNodeInParent(e,e.right);else{const t=e.getBalance();let s,i=null;if(t>0)if(e.left.right===null)s=e.left,s.right=e.right,i=s;else{for(s=e.left.right;s.right!==null;)s=s.right;s.parent&&(s.parent.right=s.left,i=s.parent,s.left=e.left,s.right=e.right)}else if(e.right.left===null)s=e.right,s.left=e.left,i=s;else{for(s=e.right.left;s.left!==null;)s=s.left;s.parent&&(s.parent.left=s.right,i=s.parent,s.left=e.left,s.right=e.right)}e.parent!==null?e.isLeftChild()?e.parent.left=s:e.parent.right=s:this._setRoot(s),i&&this._rebalance(i)}e.dispose()}_rotateLeft(e){const t=e.parent,s=e.isLeftChild(),i=e.right;i&&(e.right=i.left,i.left=e),t!==null?s?t.left=i:t.right=i:this._setRoot(i)}_rotateRight(e){const t=e.parent,s=e.isLeftChild(),i=e.left;i&&(e.left=i.right,i.right=e),t!==null?s?t.left=i:t.right=i:this._setRoot(i)}_rebalance(e){const t=e.getBalance();t>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):t<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(this._root!==null){const t=[];if(this._root.search(e,t),t.length>0){let s=t[0];for(let i=1;is.low&&(s=t[i]);return s.event}}return null}forEach(e){if(this._root!==null){const t=[];this._root.traverse(s=>t.push(s)),t.forEach(s=>{s.event&&e(s.event)})}return this}forEachAtTime(e,t){if(this._root!==null){const s=[];this._root.search(e,s),s.forEach(i=>{i.event&&t(i.event)})}return this}forEachFrom(e,t){if(this._root!==null){const s=[];this._root.searchAfter(e,s),s.forEach(i=>{i.event&&t(i.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(e=>e.dispose()),this._root=null,this}}class Ox{constructor(e,t,s){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=s,this.low=e,this.high=t,this.max=this.high}insert(e){e.low<=this.low?this.left===null?this.left=e:this.left.insert(e):this.right===null?this.right=e:this.right.insert(e)}search(e,t){e>this.max||(this.left!==null&&this.left.search(e,t),this.low<=e&&this.high>e&&t.push(this),!(this.low>e)&&this.right!==null&&this.right.search(e,t))}searchAfter(e,t){this.low>=e&&(t.push(this),this.left!==null&&this.left.searchAfter(e,t)),this.right!==null&&this.right.searchAfter(e,t)}traverse(e){e(this),this.left!==null&&this.left.traverse(e),this.right!==null&&this.right.traverse(e)}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 e=0;return this.left!==null&&this.right!==null?e=this.left.height-this.right.height:this.left!==null?e=this.left.height+1:this.right!==null&&(e=-(this.right.height+1)),e}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class $s extends re{constructor(){super(Z($s.getDefaults(),arguments,["volume"])),this.name="Volume";const e=Z($s.getDefaults(),arguments,["volume"]);this.input=this.output=new Ae({context:this.context,gain:e.volume,units:"decibels"}),this.volume=this.output.gain,Ie(this,"volume"),this._unmutedVolume=e.volume,this.mute=e.mute}static getDefaults(){return Object.assign(re.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}let Ax=class qa extends re{constructor(){super(Z(qa.getDefaults(),arguments)),this.name="Destination",this.input=new $s({context:this.context}),this.output=new Ae({context:this.context}),this.volume=this.input.volume;const e=Z(qa.getDefaults(),arguments);$i(this.input,this.output,this.context.rawContext.destination),this.mute=e.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(re.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),$i(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};$o(n=>{n.destination=new Ax({context:n})});Xo(n=>{n.destination.dispose()});class Mx extends Ps{constructor(e){super(),this.name="TimelineValue",this._timeline=new ns({memory:10}),this._initialValue=e}set(e,t){return this._timeline.add({value:e,time:t}),this}get(e){const t=this._timeline.get(e);return t?t.value:this._initialValue}}class Ss extends re{constructor(){super(Object.assign(Z(Ss.getDefaults(),arguments,["context"])))}connect(e,t=0,s=0){return Fc(this,e,t,s),this}}class wn extends Ss{constructor(){super(Object.assign(Z(wn.getDefaults(),arguments,["mapping","length"]))),this.name="WaveShaper",this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper;const e=Z(wn.getDefaults(),arguments,["mapping","length"]);Wt(e.mapping)||e.mapping instanceof Float32Array?this.curve=Float32Array.from(e.mapping):J1(e.mapping)&&this.setMap(e.mapping,e.length)}static getDefaults(){return Object.assign(De.getDefaults(),{length:1024})}setMap(e,t=1024){const s=new Float32Array(t);for(let i=0,r=t;is.includes(e));de(t,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class Qi extends Ss{constructor(){super(Object.assign(Z(Qi.getDefaults(),arguments,["value"]))),this.name="Pow";const e=Z(Qi.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new wn({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(Ss.getDefaults(),{value:1})}_expFunc(e){return t=>Math.pow(Math.abs(t),e)}get value(){return this._exponent}set value(e){this._exponent=e,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class Xs{constructor(e,t){this.id=Xs._eventId++,this._remainderTime=0;const s=Object.assign(Xs.getDefaults(),t);this.transport=e,this.callback=s.callback,this._once=s.once,this.time=Math.floor(s.time),this._remainderTime=s.time-this.time}static getDefaults(){return{callback:Te,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(e){if(this.callback){const t=this.transport.bpm.getDurationOfTicks(1,e);this.callback(e+this._remainderTime*t),this._once&&this.transport.clear(this.id)}}dispose(){return this.callback=void 0,this}}Xs._eventId=0;class Lc extends Xs{constructor(e,t){super(e,t),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const s=Object.assign(Lc.getDefaults(),t);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({},Xs.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvent(){return go(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new Gn(this.context,this._nextTick).toSeconds()):-1}_createEvents(e){go(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 Gn(this.context,this._nextTick).toSeconds()))}_restart(e){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;const t=this.transport.getTicksAtTime(e);ni(t,this.time)&&(this._nextTick=this.floatTime+Math.ceil((t-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 Ki extends _t{constructor(){super(Z(Ki.getDefaults(),arguments)),this.name="Transport",this._loop=new Mx(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new ns,this._repeatedEvents=new Ex,this._syncedSignals=[],this._swingAmount=0;const e=Z(Ki.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new Xi({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=e.ppq,this.bpm.setValueAtTime(e.bpm,0),Ie(this,"bpm"),this._timeSignature=e.timeSignature,this._swingTicks=e.ppq/2}static getDefaults(){return Object.assign(_t.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,t){if(this._loop.get(e)&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._swingAmount>0&&t%this._ppq!==0&&t%(this._swingTicks*2)!==0){const s=t%(this._swingTicks*2)/(this._swingTicks*2),i=Math.sin(s*Math.PI)*this._swingAmount;e+=new Gn(this.context,this._swingTicks*2/3).toSeconds()*i}Ql(!0),this._timeline.forEachAtTime(t,s=>s.invoke(e)),Ql(!1)}schedule(e,t){const s=new Xs(this,{callback:e,time:new Vi(this.context,t).toTicks()});return this._addEvent(s,this._timeline)}scheduleRepeat(e,t,s,i=1/0){const r=new Lc(this,{callback:e,duration:new Gt(this.context,i).toTicks(),interval:new Gt(this.context,t).toTicks(),time:new Vi(this.context,s).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const s=new Xs(this,{callback:e,once:!0,time:new Vi(this.context,t).toTicks()});return this._addEvent(s,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){const t=this._scheduledEvents[e.toString()];t.timeline.remove(t.event),t.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,t){return this._scheduledEvents[e.id.toString()]={event:e,timeline:t},t.add(e),e.id}cancel(e=0){const t=this.toTicks(e);return this._timeline.forEachFrom(t,s=>this.clear(s.id)),this._repeatedEvents.forEachFrom(t,s=>this.clear(s.id)),this}_bindClockEvents(){this._clock.on("start",(e,t)=>{t=new Gn(this.context,t).toSeconds(),this.emit("start",e,t)}),this._clock.on("stop",e=>{this.emit("stop",e)}),this._clock.on("pause",e=>{this.emit("pause",e)})}get state(){return this._clock.getStateAtTime(this.now())}start(e,t){this.context.resume();let s;return me(t)&&(s=this.toTicks(t)),this._clock.start(e,s),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),this._clock.getStateAtTime(e)!=="started"?this.start(e):this.stop(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){Wt(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new Gt(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new Gt(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new Gn(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){const e=this.now(),t=this._clock.getTicksAtTime(e);return new Gn(this.context,t).toBarsBeatsSixteenths()}set position(e){const t=this.toTicks(e);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(e){const t=this.now(),s=this._clock.frequency.timeToTicks(e,t);this.ticks=s}get progress(){if(this.loop){const e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){const t=this.now();if(this.state==="started"){const s=this._clock.getTicksAtTime(t),i=this._clock.frequency.getDurationOfTicks(Math.ceil(s)-s,t),r=t+i;this.emit("stop",r),this._clock.setTicksAtTime(e,r),this.emit("start",r,this._clock.getSecondsAtTime(r))}else this.emit("ticks",t),this._clock.setTicksAtTime(e,t)}}getTicksAtTime(e){return this._clock.getTicksAtTime(e)}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),this.state!=="started")return 0;{const t=this.now(),s=this.getTicksAtTime(t),i=e-s%e;return this._clock.nextTickTime(i,t)}}syncSignal(e,t){const s=this.now();let i=this.bpm,r=1/(60/i.getValueAtTime(s)/this.PPQ),o=[];if(e.units==="time"){const c=.015625/r,l=new Ae(c),u=new Qi(-1),h=new Ae(c);i.chain(l,u,h),i=h,r=1/r,o=[l,u,h]}t||(e.getValueAtTime(s)!==0?t=e.getValueAtTime(s)/r:t=0);const a=new Ae(t);return i.connect(a),a.connect(e._param),o.push(a),this._syncedSignals.push({initial:e.value,nodes:o,signal:e}),e.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;t>=0;t--){const s=this._syncedSignals[t];s.signal===e&&(s.nodes.forEach(i=>i.dispose()),s.signal.value=s.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Rc(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}Mr.mixin(Ki);$o(n=>{n.transport=new Ki({context:n})});Xo(n=>{n.transport.dispose()});class ot extends re{constructor(e){super(e),this.input=void 0,this._state=new Nc("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=Te,this._syncedStop=Te,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new $s({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,Ie(this,"volume"),this.onstop=e.onstop}static getDefaults(){return Object.assign(re.getDefaults(),{mute:!1,onstop:Te,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(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,t,s){let i=Et(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(i=this._clampToCurrentTime(i),!this._synced&&this._state.getValueAtTime(i)==="started")de(ni(i,this._state.get(i).time),"Start time must be strictly greater than previous start time"),this._state.cancel(i),this._state.setStateAtTime("started",i),this.log("restart",i),this.restart(i,t,s);else if(this.log("start",i),this._state.setStateAtTime("started",i),this._synced){const r=this._state.get(i);r&&(r.offset=this.toSeconds($n(t,0)),r.duration=s?this.toSeconds(s):void 0);const o=this.context.transport.schedule(a=>{this._start(a,t,s)},i);this._scheduled.push(o),this.context.transport.state==="started"&&this.context.transport.getSecondsAtTime(this.immediate())>i&&this._syncedStart(this.now(),this.context.transport.seconds)}else Vh(this.context),this._start(i,t,s);return this}stop(e){let t=Et(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(t=this._clampToCurrentTime(t),this._state.getValueAtTime(t)==="started"||me(this._state.getNextState("started",t))){if(this.log("stop",t),!this._synced)this._stop(t);else{const s=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(s)}this._state.cancel(t),this._state.setStateAtTime("stopped",t)}return this}restart(e,t,s){return e=this.toSeconds(e),this._state.getValueAtTime(e)==="started"&&(this._state.cancel(e),this._restart(e,t,s)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,t)=>{if(ni(t,0)){const s=this._state.get(t);if(s&&s.state==="started"&&s.time!==t){const i=t-this.toSeconds(s.time);let r;s.duration&&(r=this.toSeconds(s.duration)-i),this._start(e,this.toSeconds(s.offset)+i,r)}}},this._syncedStop=e=>{const t=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));this._state.getValueAtTime(t)==="started"&&this._stop(e)},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(e=>this.context.transport.clear(e)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=Te,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class ri extends ii{constructor(){super(Z(ri.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=Z(ri.getDefaults(),arguments,["url","onload"]);Zs(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new Se({context:this.context,param:this._source.playbackRate,units:"positive",value:e.playbackRate}),this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this._buffer=new we(e.url,e.onload,e.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(ii.getDefaults(),{url:new we,loop:!1,loopEnd:0,loopStart:0,onload:Te,onerror:Te,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,t,s,i=1){de(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(e);this._startGain(r,i),this.loop?t=$n(t,this.loopStart):t=$n(t,0);let o=Math.max(this.toSeconds(t),0);if(this.loop){const a=this.toSeconds(this.loopEnd)||this.buffer.duration,c=this.toSeconds(this.loopStart),l=a-c;ja(o,a)&&(o=(o-c)%l+c),Ht(o,this.buffer.duration)&&(o=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,go(o,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,o)),me(s)){let a=this.toSeconds(s);a=Math.max(a,0),this.stop(r+a)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class Ji extends ot{constructor(){super(Z(Ji.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=Z(Ji.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ot.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(de(e in Kl,"Noise: invalid type: "+e),this._type!==e&&(this._type=e,this.state==="started")){const t=this.now();this._stop(t),this._start(t)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._source&&(this._source.playbackRate.value=e)}_start(e){const t=Kl[this._type];this._source=new ri({url:t,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(e),Math.random()*(t.duration-.001))}_stop(e){this._source&&(this._source.stop(this.toSeconds(e)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(e){this._stop(e),this._start(e)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const Bn=44100*5,xa=2,ms={brown:null,pink:null,white:null},Kl={get brown(){if(!ms.brown){const n=[];for(let e=0;ethis.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(t)}_stop(e){const t=this.toSeconds(e);this._oscillator&&this._oscillator.stop(t)}_restart(e){const t=this.toSeconds(e);return this.log("restart",t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),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 Ge._periodicWaveCache.find(t=>t.phase===this._phase&&ux(t.partials,this._partials));{const e=Ge._periodicWaveCache.find(t=>t.type===this._type&&t.phase===this._phase);return this._partialCount=e?e.partialCount:this._partialCount,e}}get type(){return this._type}set type(e){this._type=e;const t=["sine","square","sawtooth","triangle"].indexOf(e)!==-1;if(this._phase===0&&t)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=e);else{const s=this._getCachedPeriodicWave();if(me(s)){const{partials:i,wave:r}=s;this._wave=r,this._partials=i,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{const[i,r]=this._getRealImaginary(e,this._phase),o=this.context.createPeriodicWave(i,r);this._wave=o,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),Ge._periodicWaveCache.push({imag:r,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:i,type:this._type,wave:this._wave}),Ge._periodicWaveCache.length>100&&Ge._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(e){this.partialCount&&this._type!=="custom"&&e!=="custom"?this.type=e+this.partialCount:this.type=e}get partialCount(){return this._partialCount}set partialCount(e){Zt(e,0);let t=this._type;const s=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(s&&(t=s[1]),this._type!=="custom")e===0?this.type=t:this.type=t+e.toString();else{const i=new Float32Array(e);this._partials.forEach((r,o)=>i[o]=r),this._partials=Array.from(i),this.type=this._type}}_getRealImaginary(e,t){let i=2048;const r=new Float32Array(i),o=new Float32Array(i);let a=1;if(e==="custom"){if(a=this._partials.length+1,this._partialCount=this._partials.length,i=a,this._partials.length===0)return[r,o]}else{const c=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);c?(a=parseInt(c[2],10)+1,this._partialCount=parseInt(c[2],10),e=c[1],a=Math.max(a,2),i=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: "+e)}u!==0?(r[c]=-u*Math.sin(t*c),o[c]=u*Math.cos(t*c)):(r[c]=0,o[c]=0)}return[r,o]}_inverseFFT(e,t,s){let i=0;const r=e.length;for(let o=0;o(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Qs extends De{constructor(){super(Object.assign(Z(Qs.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=Z(Qs.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new Ae({context:this.context,minValue:e.minValue,maxValue:e.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(De.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class er extends ot{constructor(){super(Z(er.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new Px({context:this.context}),this._modulationNode=new Ae({context:this.context});const e=Z(er.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Ge({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new Ge({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new Qs({context:this.context,units:"positive",value:e.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Ie(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Ge.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return We(this,void 0,void 0,function*(){return Pn(this,e)})}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 tr extends ot{constructor(){super(Z(tr.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new Ae({context:this.context,gain:0});const e=Z(tr.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Ge({context:this.context,detune:e.detune,frequency:0,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.detune=this._carrier.detune,this.frequency=new De({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new Ge({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new Qs({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new Qs({context:this.context,units:"positive",value:e.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),Ie(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Ge.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return We(this,void 0,void 0,function*(){return Pn(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class oi extends ot{constructor(){super(Z(oi.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new Ae({context:this.context,gain:0}),this._thresh=new wn({context:this.context,mapping:t=>t<=0?-1:1});const e=Z(oi.getDefaults(),arguments,["frequency","width"]);this.width=new De({context:this.context,units:"audioRange",value:e.width}),this._triangle=new Ge({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.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),Ie(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ot.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(e=1024){return We(this,void 0,void 0,function*(){return Pn(this,e)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class sr extends ot{constructor(){super(Z(sr.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=Z(sr.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new De({context:this.context,units:"frequency",value:e.frequency}),this.detune=new De({context:this.context,units:"cents",value:e.detune}),this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=e.partials,this._partialCount=e.partialCount,this.count=e.count,Ie(this,["frequency","detune"])}static getDefaults(){return Object.assign(Ge.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach(t=>t.start(e))}_stop(e){e=this.toSeconds(e),this._forEach(t=>t.stop(e))}_restart(e){this._forEach(t=>t.restart(e))}_forEach(e){for(let t=0;tt.type=e)}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){const t=-e/2,s=e/(this._oscillators.length-1);this._forEach((i,r)=>i.detune.value=t+s*r)}}get count(){return this._oscillators.length}set count(e){if(Zt(e,1),this._oscillators.length!==e){this._forEach(t=>t.dispose()),this._oscillators=[];for(let t=0;tthis.onstop(this):Te});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[t]=s}this.spread=this._spread,this.state==="started"&&this._forEach(t=>t.start())}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach((t,s)=>t.phase=this._phase+s/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach(t=>t.baseType=e),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach(t=>t.partials=e))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach(t=>t.partialCount=e),this._type=this._oscillators[0].type}asArray(e=1024){return We(this,void 0,void 0,function*(){return Pn(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(e=>e.dispose()),this}}class nr extends ot{constructor(){super(Z(nr.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Qs({context:this.context,value:2});const e=Z(nr.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new oi({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new Ge({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Ie(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ot.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(e=1024){return We(this,void 0,void 0,function*(){return Pn(this,e)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const Jl={am:er,fat:sr,fm:tr,oscillator:Ge,pulse:oi,pwm:nr};class Sn extends ot{constructor(){super(Z(Sn.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=Z(Sn.getDefaults(),arguments,["frequency","type"]);this.frequency=new De({context:this.context,units:"frequency",value:e.frequency}),this.detune=new De({context:this.context,units:"cents",value:e.detune}),Ie(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(Ge.getDefaults(),tr.getDefaults(),er.getDefaults(),sr.getDefaults(),oi.getDefaults(),nr.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e="";return["am","fm","fat"].some(t=>this._sourceType===t)&&(e=this._sourceType),e+this._oscillator.type}set type(e){e.substr(0,2)==="fm"?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,2)==="am"?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,3)==="fat"?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):e==="pwm"?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):e==="pulse"?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,"type")&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;const t=Jl[e],s=this.now();if(this._oscillator){const i=this._oscillator;i.stop(s),this.context.setTimeout(()=>i.dispose(),this.blockTime)}this._oscillator=new t({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(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let t="sine";this._oscillator.type!=="pwm"&&this._oscillator.type!=="pulse"&&(t=this._oscillator.type),e==="fm"?this.type="fm"+t:e==="am"?this.type="am"+t:e==="fat"?this.type="fat"+t:e==="oscillator"?this.type=t:e==="pulse"?this.type="pulse":e==="pwm"&&(this.type="pwm")}_getOscType(e,t){return e instanceof Jl[t]}get baseType(){return this._oscillator.baseType}set baseType(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&e!=="pulse"&&e!=="pwm"&&(this._oscillator.baseType=e)}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(e){this._getOscType(this._oscillator,"fat")&&Ys(e)&&(this._oscillator.count=e)}get spread(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.spread}set spread(e){this._getOscType(this._oscillator,"fat")&&Ys(e)&&(this._oscillator.spread=e)}get modulationType(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.modulationType}set modulationType(e){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&ws(e)&&(this._oscillator.modulationType=e)}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(e=1024){return We(this,void 0,void 0,function*(){return Pn(this,e)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class Bc extends De{constructor(){super(Object.assign(Z(Bc.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new Ae({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,$i(this._constantSource,this._sum)}static getDefaults(){return Object.assign(De.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class wo extends Ss{constructor(){super(Object.assign(Z(wo.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=Z(wo.getDefaults(),arguments,["min","max"]);this._mult=this.input=new Qs({context:this.context,value:e.max-e.min}),this._add=this.output=new Bc({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(Ss.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(e){this._min=e,this._setRange()}get max(){return this._max}set max(e){this._max=e,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 Kh(n,e=1/0){const t=new WeakMap;return function(s,i){Reflect.defineProperty(s,i,{configurable:!0,enumerable:!0,get:function(){return t.get(this)},set:function(r){Zt(r,n,e),t.set(this,r)}})}}function Ds(n,e=1/0){const t=new WeakMap;return function(s,i){Reflect.defineProperty(s,i,{configurable:!0,enumerable:!0,get:function(){return t.get(this)},set:function(r){Zt(this.toSeconds(r),n,e),t.set(this,r)}})}}class ir extends ot{constructor(){super(Z(ir.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=Z(ir.getDefaults(),arguments,["url","onload"]);this._buffer=new we({onload:this._onload.bind(this,e.onload),onerror:e.onerror,reverse:e.reverse,url:e.url}),this.autostart=e.autostart,this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ot.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Te,onerror:Te,playbackRate:1,reverse:!1})}load(e){return We(this,void 0,void 0,function*(){return yield this._buffer.load(e),this._onload(),this})}_onload(e=Te){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())==="started"&&(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(e,t,s){return super.start(e,t,s),this}_start(e,t,s){this._loop?t=$n(t,this._loopStart):t=$n(t,0);const i=this.toSeconds(t),r=s;s=$n(s,Math.max(this._buffer.duration-i,0));let o=this.toSeconds(s);o=o/this._playbackRate,e=this.toSeconds(e);const a=new ri({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(e+o),this._state.setStateAtTime("stopped",e+o,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&Et(r)?a.start(e,i):a.start(e,i,o-this.toSeconds(this.fadeOut))}_stop(e){const t=this.toSeconds(e);this._activeSources.forEach(s=>s.stop(t))}restart(e,t,s){return super.restart(e,t,s),this}_restart(e,t,s){var i;(i=[...this._activeSources].pop())===null||i===void 0||i.stop(e),this._start(e,t,s)}seek(e,t){const s=this.toSeconds(t);if(this._state.getValueAtTime(s)==="started"){const i=this.toSeconds(e);this._stop(s),this._start(s,i)}return this}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&Zt(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopStart=e})}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&Zt(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopEnd=e})}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach(t=>{t.loop=e}),e)){const t=this._state.getNextState("stopped",this.now());t&&this._state.cancel(t.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;const t=this.now(),s=this._state.getNextState("stopped",t);s&&s.implicitEnd&&(this._state.cancel(s.time),this._activeSources.forEach(i=>i.cancelStop())),this._activeSources.forEach(i=>{i.playbackRate.setValueAtTime(e,t)})}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(e=>e.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}$t([Ds(0)],ir.prototype,"fadeIn",void 0);$t([Ds(0)],ir.prototype,"fadeOut",void 0);class Dx extends Ss{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new wn({context:this.context,mapping:e=>Math.abs(e)*2-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Ut extends re{constructor(){super(Z(Ut.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new De({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=Z(Ut.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve,this.decayCurve=e.decayCurve}static getDefaults(){return Object.assign(re.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,t){if(ws(e))return e;{let s;for(s in Zr)if(Zr[s][t]===e)return s;return e}}_setCurve(e,t,s){if(ws(s)&&Reflect.has(Zr,s)){const i=Zr[s];mn(i)?e!=="_decayCurve"&&(this[e]=i[t]):this[e]=i}else if(Wt(s)&&e!=="_decayCurve")this[e]=s;else throw new Error("Envelope: invalid curve: "+s)}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(e){this._setCurve("_attackCurve","In",e)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(e){this._setCurve("_releaseCurve","Out",e)}get decayCurve(){return this._getCurve(this._decayCurve,"Out")}set decayCurve(e){this._setCurve("_decayCurve","Out",e)}triggerAttack(e,t=1){this.log("triggerAttack",e,t),e=this.toSeconds(e);let i=this.toSeconds(this.attack);const r=this.toSeconds(this.decay),o=this.getValueAtTime(e);if(o>0){const a=1/i;i=(1-o)/a}if(i0){const s=this.toSeconds(this.release);s{let e,t;const s=[];for(e=0;e<128;e++)s[e]=Math.sin(e/(128-1)*(Math.PI/2));const i=[],r=6.4;for(e=0;e<128-1;e++){t=e/(128-1);const d=Math.sin(t*(Math.PI*2)*r-Math.PI/2)+1;i[e]=d/10+t*.83}i[128-1]=1;const o=[],a=5;for(e=0;e<128;e++)o[e]=Math.ceil(e/(128-1)*a)/a;const c=[];for(e=0;e<128;e++)t=e/(128-1),c[e]=.5*(1-Math.cos(Math.PI*t));const l=[];for(e=0;e<128;e++){t=e/(128-1);const d=Math.pow(t,3)*4+.2,f=Math.cos(d*Math.PI*2*t);l[e]=Math.abs(f*(1-t))}function u(d){const f=new Array(d.length);for(let m=0;mthis._original_triggerRelease(t);const e=Z(bn.getDefaults(),arguments);this._volume=this.output=new $s({context:this.context,volume:e.volume}),this.volume=this._volume.volume,Ie(this,"volume")}static getDefaults(){return Object.assign(re.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 e=!1;return this._synced||(this._synced=!0,e=!0),e}_syncMethod(e,t){const s=this["_original_"+e]=this[e];this[e]=(...i)=>{const r=i[t],o=this.context.transport.schedule(a=>{i[t]=a,s.apply(this,i)},r);this._scheduledEvents.push(o)}}unsync(){return this._scheduledEvents.forEach(e=>this.context.transport.clear(e)),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(e,t,s,i){const r=this.toSeconds(s),o=this.toSeconds(t);return this.triggerAttack(e,r,i),this.triggerRelease(r+o),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class bs extends bn{constructor(){super(Z(bs.getDefaults(),arguments));const e=Z(bs.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(bn.getDefaults(),{detune:0,onsilence:Te,portamento:0})}triggerAttack(e,t,s=1){this.log("triggerAttack",e,t,s);const i=this.toSeconds(t);return this._triggerEnvelopeAttack(i,s),this.setNote(e,i),this}triggerRelease(e){this.log("triggerRelease",e);const t=this.toSeconds(e);return this._triggerEnvelopeRelease(t),this}setNote(e,t){const s=this.toSeconds(t),i=e instanceof It?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(s)>.05){const r=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(i,r,s)}else this.frequency.setValueAtTime(i,s);return this}}$t([Ds(0)],bs.prototype,"portamento",void 0);class Jo extends Ut{constructor(){super(Z(Jo.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new Ae({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 rr extends bs{constructor(){super(Z(rr.getDefaults(),arguments)),this.name="Synth";const e=Z(rr.getDefaults(),arguments);this.oscillator=new Sn(Object.assign({context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)},e.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Jo(Object.assign({context:this.context},e.envelope)),this.oscillator.chain(this.envelope,this.output),Ie(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(bs.getDefaults(),{envelope:Object.assign(qn(Ut.getDefaults(),Object.keys(re.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(qn(Sn.getDefaults(),[...Object.keys(ot.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(e,t){if(this.envelope.triggerAttack(e,t),this.oscillator.start(e),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),i=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+s+i)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class or extends re{constructor(){super(Z(or.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=Z(or.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new Se({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new Se({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new Se({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new Se({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(re.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(e){de(["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(e)!==-1,`Invalid filter type: ${e}`),this._filter.type=e}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let o=0;os.type=e)}get rolloff(){return this._rolloff}set rolloff(e){const t=Ys(e)?e:parseInt(e,10),s=[-12,-24,-48,-96];let i=s.indexOf(t);de(i!==-1,`rolloff can only be ${s.join(", ")}`),i+=1,this._rolloff=t,this.input.disconnect(),this._filters.forEach(r=>r.disconnect()),this._filters=new Array(i);for(let r=0;r1);return this._filters.forEach(()=>{t.getFrequencyResponse(e).forEach((r,o)=>s[o]*=r)}),t.dispose(),s}dispose(){return super.dispose(),this._filters.forEach(e=>{e.dispose()}),Rc(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class ar extends Ut{constructor(){super(Z(ar.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=Z(ar.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Qi({context:this.context,value:e.exponent}),this._scale=this.output=new wo({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(Ut.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);Zt(t,0),this._baseFrequency=t,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._scale.max=this._baseFrequency*Math.pow(2,e)}get exponent(){return this._exponent.value}set exponent(e){this._exponent.value=e}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class cr extends bs{constructor(){super(Z(cr.getDefaults(),arguments)),this.name="MonoSynth";const e=Z(cr.getDefaults(),arguments);this.oscillator=new Sn(Object.assign(e.oscillator,{context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new ai(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new ar(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Jo(Object.assign(e.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Ie(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(bs.getDefaults(),{envelope:Object.assign(qn(Ut.getDefaults(),Object.keys(re.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(qn(ai.getDefaults(),Object.keys(re.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(qn(ar.getDefaults(),Object.keys(re.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(qn(Sn.getDefaults(),Object.keys(ot.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(e,t=1){if(this.envelope.triggerAttack(e,t),this.filterEnvelope.triggerAttack(e),this.oscillator.start(e),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),i=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+s+i)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.filterEnvelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class lr extends rr{constructor(){super(Z(lr.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=Z(lr.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,Ie(this,["oscillator","envelope"])}static getDefaults(){return Zn(bs.getDefaults(),rr.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(e,t){const s=this.toSeconds(t),i=this.toFrequency(e instanceof It?e.toFrequency():e),r=i*this.octaves;return this.oscillator.frequency.setValueAtTime(r,s),this.oscillator.frequency.exponentialRampToValueAtTime(i,s+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}$t([Kh(0)],lr.prototype,"octaves",void 0);$t([Ds(0)],lr.prototype,"pitchDecay",void 0);const Jh=new Set;function zc(n){Jh.add(n)}function ed(n,e){const t=`registerProcessor("${n}", ${e})`;Jh.add(t)}const Rx=` - /** - * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. - */ - class ToneAudioWorkletProcessor extends AudioWorkletProcessor { - - constructor(options) { - - super(options); - /** - * If the processor was disposed or not. Keep alive until it's disposed. - */ - this.disposed = false; - /** - * The number of samples in the processing block - */ - this.blockSize = 128; - /** - * the sample rate - */ - this.sampleRate = sampleRate; - - this.port.onmessage = (event) => { - // when it receives a dispose - if (event.data === "dispose") { - this.disposed = true; - } - }; - } - } -`;zc(Rx);const Ix=` - /** - * Abstract class for a single input/output processor. - * has a 'generate' function which processes one sample at a time - */ - class SingleIOProcessor extends ToneAudioWorkletProcessor { - - constructor(options) { - super(Object.assign(options, { - numberOfInputs: 1, - numberOfOutputs: 1 - })); - /** - * Holds the name of the parameter and a single value of that - * parameter at the current sample - * @type { [name: string]: number } - */ - this.params = {} - } - - /** - * Generate an output sample from the input sample and parameters - * @abstract - * @param input number - * @param channel number - * @param parameters { [name: string]: number } - * @returns number - */ - generate(){} - - /** - * Update the private params object with the - * values of the parameters at the given index - * @param parameters { [name: string]: Float32Array }, - * @param index number - */ - updateParams(parameters, index) { - for (const paramName in parameters) { - const param = parameters[paramName]; - if (param.length > 1) { - this.params[paramName] = parameters[paramName][index]; - } else { - this.params[paramName] = parameters[paramName][0]; - } - } - } - - /** - * Process a single frame of the audio - * @param inputs Float32Array[][] - * @param outputs Float32Array[][] - */ - process(inputs, outputs, parameters) { - const input = inputs[0]; - const output = outputs[0]; - // get the parameter values - const channelCount = Math.max(input && input.length || 0, output.length); - for (let sample = 0; sample < this.blockSize; sample++) { - this.updateParams(parameters, sample); - for (let channel = 0; channel < channelCount; channel++) { - const inputSample = input && input.length ? input[channel][sample] : 0; - output[channel][sample] = this.generate(inputSample, channel, this.params); - } - } - return !this.disposed; - } - }; -`;zc(Ix);const Nx=` - /** - * A multichannel buffer for use within an AudioWorkletProcessor as a delay line - */ - class DelayLine { - - constructor(size, channels) { - this.buffer = []; - this.writeHead = [] - this.size = size; - - // create the empty channels - for (let i = 0; i < channels; i++) { - this.buffer[i] = new Float32Array(this.size); - this.writeHead[i] = 0; - } - } - - /** - * Push a value onto the end - * @param channel number - * @param value number - */ - push(channel, value) { - this.writeHead[channel] += 1; - if (this.writeHead[channel] > this.size) { - this.writeHead[channel] = 0; - } - this.buffer[channel][this.writeHead[channel]] = value; - } - - /** - * Get the recorded value of the channel given the delay - * @param channel number - * @param delay number delay samples - */ - get(channel, delay) { - let readHead = this.writeHead[channel] - Math.floor(delay); - if (readHead < 0) { - readHead += this.size; - } - return this.buffer[channel][readHead]; - } - } -`;zc(Nx);const Fx="feedback-comb-filter",Ux=` - class FeedbackCombFilterWorklet extends SingleIOProcessor { - - constructor(options) { - super(options); - this.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2); - } - - static get parameterDescriptors() { - return [{ - name: "delayTime", - defaultValue: 0.1, - minValue: 0, - maxValue: 1, - automationRate: "k-rate" - }, { - name: "feedback", - defaultValue: 0.5, - minValue: 0, - maxValue: 0.9999, - automationRate: "k-rate" - }]; - } - - generate(input, channel, parameters) { - const delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate); - this.delayLine.push(channel, input + delayedSample * parameters.feedback); - return delayedSample; - } - } -`;ed(Fx,Ux);class ur extends bn{constructor(){super(Z(ur.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=Z(ur.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),t={};Object.keys(e.urls).forEach(s=>{const i=parseInt(s,10);if(de(Yr(s)||Ys(i)&&isFinite(i),`url key is neither a note or midi pitch: ${s}`),Yr(s)){const r=new It(this.context,s).toMidi();t[r]=e.urls[s]}else Ys(i)&&isFinite(i)&&(t[i]=e.urls[i])}),this._buffers=new Uc({urls:t,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.attack=e.attack,this.release=e.release,this.curve=e.curve,this._buffers.loaded&&Promise.resolve().then(e.onload)}static getDefaults(){return Object.assign(bn.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:Te,onerror:Te,release:.1,urls:{}})}_findClosest(e){let s=0;for(;s<96;){if(this._buffers.has(e+s))return-s;if(this._buffers.has(e-s))return s;s++}throw new Error(`No available buffers for note: ${e}`)}triggerAttack(e,t,s=1){return this.log("triggerAttack",e,t,s),Array.isArray(e)||(e=[e]),e.forEach(i=>{const r=Qh(new It(this.context,i).toFrequency()),o=Math.round(r),a=r-o,c=this._findClosest(o),l=o-c,u=this._buffers.get(l),h=Xh(c+a),d=new ri({url:u,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:h}).connect(this.output);d.start(t,0,u.duration/h,s),Wt(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),m=f.indexOf(d);m!==-1&&f.splice(m,1)}}}),this}triggerRelease(e,t){return this.log("triggerRelease",e,t),Array.isArray(e)||(e=[e]),e.forEach(s=>{const i=new It(this.context,s).toMidi();if(this._activeSources.has(i)&&this._activeSources.get(i).length){const r=this._activeSources.get(i);t=this.toSeconds(t),r.forEach(o=>{o.stop(t)}),this._activeSources.set(i,[])}}),this}releaseAll(e){const t=this.toSeconds(e);return this._activeSources.forEach(s=>{for(;s.length;)s.shift().stop(t)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(e,t,s,i=1){const r=this.toSeconds(s);return this.triggerAttack(e,r,i),Wt(t)?(de(Wt(e),"notes must be an array when duration is array"),e.forEach((o,a)=>{const c=t[Math.min(a,t.length-1)];this.triggerRelease(o,r+this.toSeconds(c))})):this.triggerRelease(e,r+this.toSeconds(t)),this}add(e,t,s){if(de(Yr(e)||isFinite(e),`note must be a pitch or midi: ${e}`),Yr(e)){const i=new It(this.context,e).toMidi();this._buffers.add(i,t,s)}else this._buffers.add(e,t,s);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(e=>{e.forEach(t=>t.dispose())}),this._activeSources.clear(),this}}$t([Ds(0)],ur.prototype,"attack",void 0);$t([Ds(0)],ur.prototype,"release",void 0);class So extends re{constructor(){super(Object.assign(Z(So.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new Dx({context:this.context}),this.a=new Ae({context:this.context,gain:0}),this.b=new Ae({context:this.context,gain:0}),this.output=new Ae({context:this.context}),this._internalChannels=[this.a,this.b];const e=Z(So.getDefaults(),arguments,["fade"]);this.fade=new De({context:this.context,units:"normalRange",value:e.fade}),Ie(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Zs(this._split,this.a.gain,0),Zs(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(re.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 eu extends re{constructor(e){super(e),this.name="Effect",this._dryWet=new So({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new Ae({context:this.context}),this.effectReturn=new Ae({context:this.context}),this.input=new Ae({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(e.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Ie(this,"wet")}static getDefaults(){return Object.assign(re.getDefaults(),{wet:1})}connectEffect(e){return this._internalChannels.push(e),this.effectSend.chain(e,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class bo extends re{constructor(){super(Object.assign(Z(bo.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=Z(bo.getDefaults(),arguments,["pan"]);this.pan=new Se({context:this.context,param:this._panner.pan,value:e.pan,minValue:-1,maxValue:1}),this._panner.channelCount=e.channelCount,this._panner.channelCountMode="explicit",Ie(this,"pan")}static getDefaults(){return Object.assign(re.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}const Lx="bit-crusher",Bx=` - class BitCrusherWorklet extends SingleIOProcessor { - - static get parameterDescriptors() { - return [{ - name: "bits", - defaultValue: 12, - minValue: 1, - maxValue: 16, - automationRate: 'k-rate' - }]; - } - - generate(input, _channel, parameters) { - const step = Math.pow(0.5, parameters.bits - 1); - const val = step * Math.floor(input / step + 0.5); - return val; - } - } -`;ed(Lx,Bx);class Co extends re{constructor(){super(Z(Co.getDefaults(),arguments,["channels"])),this.name="Merge";const e=Z(Co.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(re.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Eo extends eu{constructor(){super(Z(Eo.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=Z(Eo.getDefaults(),arguments,["decay"]);this._decay=e.decay,this._preDelay=e.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(eu.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(e){e=this.toSeconds(e),Zt(e,.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){e=this.toSeconds(e),Zt(e,0),this._preDelay=e,this.generate()}generate(){return We(this,void 0,void 0,function*(){const e=this.ready,t=new Qo(2,this._decay+this._preDelay,this.context.sampleRate),s=new Ji({context:t}),i=new Ji({context:t}),r=new Co({context:t});s.connect(r,0,0),i.connect(r,0,1);const o=new Ae({context:t}).toDestination();r.connect(o),s.start(0),i.start(0),o.gain.setValueAtTime(0,0),o.gain.setValueAtTime(1,this._preDelay),o.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=t.render();return this.ready=a.then(Te),yield e,this._convolver.buffer=(yield a).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class He extends re{constructor(){super(Z(He.getDefaults(),arguments,["solo"])),this.name="Solo";const e=Z(He.getDefaults(),arguments,["solo"]);this.input=this.output=new Ae({context:this.context}),He._allSolos.has(this.context)||He._allSolos.set(this.context,new Set),He._allSolos.get(this.context).add(this),this.solo=e.solo}static getDefaults(){return Object.assign(re.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(e){e?this._addSolo():this._removeSolo(),He._allSolos.get(this.context).forEach(t=>t._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){He._soloed.has(this.context)||He._soloed.set(this.context,new Set),He._soloed.get(this.context).add(this)}_removeSolo(){He._soloed.has(this.context)&&He._soloed.get(this.context).delete(this)}_isSoloed(){return He._soloed.has(this.context)&&He._soloed.get(this.context).has(this)}_noSolos(){return!He._soloed.has(this.context)||He._soloed.has(this.context)&&He._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(),He._allSolos.get(this.context).delete(this),this._removeSolo(),this}}He._allSolos=new Map;He._soloed=new Map;class Oo extends re{constructor(){super(Z(Oo.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=Z(Oo.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new bo({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new $s({context:this.context,volume:e.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,Ie(this,["pan","volume"])}static getDefaults(){return Object.assign(re.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class un extends re{constructor(){super(Z(un.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=Z(un.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new He({solo:e.solo,context:this.context}),this._panVol=this.output=new Oo({context:this.context,pan:e.pan,volume:e.volume,mute:e.mute,channelCount:e.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Ie(this,["pan","volume"])}static getDefaults(){return Object.assign(re.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(e){return un.buses.has(e)||un.buses.set(e,new Ae({context:this.context})),un.buses.get(e)}send(e,t=0){const s=this._getBus(e),i=new Ae({context:this.context,units:"decibels",gain:t});return this.connect(i),i.connect(s),i}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}un.buses=new Map;class zx extends re{constructor(){super(...arguments),this.name="Listener",this.positionX=new Se({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new Se({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new Se({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new Se({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new Se({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new Se({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new Se({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new Se({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new Se({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(re.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}}$o(n=>{n.listener=new zx({context:n})});Xo(n=>{n.listener.dispose()});qt().transport;const Vc=qt().destination;qt().destination;qt().listener;qt().draw;qt();const jc=new ai(900,"highpass"),td=new $s(-6);td.chain(jc,Vc);const Vx=new Eo(3).connect(td),ea=new cr({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});ea.oscillator.type="triangle2";ea.volume.value=-6;ea.chain(jc,Vc);const ta=new cr({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(Vx);ta.oscillator.type="triangle";ta.volume.value=-6;ta.chain(jc,Vc);function jx(){return Math.floor((Math.random()-.5)*20)}let tu=!1;const Hx=async(n=0)=>{tu||(await gx(),tu=!0);try{if(n>2e3)ta.triggerAttackRelease(60,.3);else if(n>1e3){let e=310;e+=jx(),ea.triggerAttackRelease(e,.001)}}catch(e){console.warn(e)}},$r=1800,qx=(n,e)=>n.clone().normalize().clone().negate().normalize().multiplyScalar(e).add(n),Gx=(n,e,t,s,i)=>{const r=new Eu,o=1e-5;r.absarc(o,o,o,-Math.PI/2,-Math.PI,!0),r.absarc(o,e-s*2,o,Math.PI,Math.PI/2,!0),r.absarc(n-s*2,e-s*2,o,Math.PI/2,0,!0),r.absarc(n-s*2,o,o,0,-Math.PI/2,!0);const a=new np(r,{depth:t-s*2,bevelEnabled:!0,bevelSegments:i,steps:2,bevelSize:s,bevelThickness:s,curveSegments:i});a.center();const c=[],l=a.getAttribute("normal"),u=a.getAttribute("position");for(let h=0;h.9?(m=f.x/n+.5,p=1-(f.z/t+.5)):Math.abs(d.x)>.9?(m=-f.z/t+.5,p=1-(-f.y/e+.5)):Math.abs(d.z)>.9&&(m=f.x/n+.5,p=1-(-f.y/e+.5)),c.push(m,p)}return a.setAttribute("uv",new Jr(c,2)),a};Gx(10,10,10,2,10);const su=new sp(10,10,10),Wx=500,Yx=800,Zx=new le(0,0,0),$x=16777215,Xx=20,Qx=(n,e)=>{var r,o;if(!(n!=null&&n.ref_id)||!(e!=null&&e.ref_id))return!1;let t=!1;const s=n.guests,i=e.guests;return((r=n.children)!=null&&r.includes(e.ref_id)||(o=e.children)!=null&&o.includes(n.ref_id))&&(t=!0),(s!=null&&s.find(a=>a.ref_id===e.ref_id)||i!=null&&i.find(a=>a.ref_id===n.ref_id))&&(t=!0),t};let Ri=null;const Kx=500,sd=(n,e)=>{if(Ri)return null;Ri=setTimeout(()=>{Ri&&(clearTimeout(Ri),Ri=null)},Kx);const t=[];return n.forEach(i=>{const r=e.position.distanceTo(Zx.set(i.x,i.y,i.z));ri.distance-r.distance).slice(0,Wx).map(i=>i.id)};let zn,Ii;const Jx=1e3,eT=2e3,tT=n=>{const e=cs(),t=Hs(x=>x.isUserDragging),s=Hs(x=>x.isUserScrolling),i=Hs(x=>x.setUserMovedCamera),{data:r,graphStyle:o,showSelectionGraph:a,setNearbyNodeIds:c,cameraFocusTrigger:l,graphRadius:u}=ht(x=>x),{camera:h}=Pe(),[d,f]=D.useState(!1),[m,p]=D.useState(!1),[_,y]=D.useState(Dl),k=D.useMemo(()=>{if(a)return new le(0,0,0);const x=r==null?void 0:r.nodes.find(R=>R.ref_id===(e==null?void 0:e.ref_id)),b=u+300;let A=new le(0,0,b);if(x&&r){const R=r==null?void 0:r.nodes.filter(W=>{var V;return(V=x.children)==null?void 0:V.find(z=>z===W.id)}),M=new le(x.x,x.y,x.z);let L=new le(0,0,0);R.map(W=>(L=L.add(new le(W.x,W.y,W.z).normalize()),W));const q=x.scale?1-1/(x.scale+10):1,Y=M.sub(L).multiplyScalar(.8*q);A=M.add(Y)}return A},[a,e,r,u]),w=D.useMemo(()=>{if(a)return new le(0,0,0);const x=r==null?void 0:r.nodes.find(b=>b.ref_id===(e==null?void 0:e.ref_id));return new le((x==null?void 0:x.x)||0,(x==null?void 0:x.y)||0,(x==null?void 0:x.z)||0)},[a,e,r]);D.useEffect(()=>{var x;a&&((x=n.current)==null||x.setLookAt(va.x,va.y,va.z,0,0,0,!1)),v()},[a]),D.useEffect(()=>{a?y(Wm):(e==null?void 0:e.node_type)==="topic"?y(Gm):y(Dl)},[e,y,a]),D.useEffect(()=>{g()},[l]),D.useEffect(()=>{(t||s)&&(f(!0),p(!0))},[t,s,f,p]),D.useEffect(()=>{if(e)if(!a&&o==="earth"&&(n!=null&&n.current)){const x=n.current.camera.position.distanceTo(new le),b=qx(w,-x/2);n.current.setLookAt(b.x,b.y,b.z,0,0,0,!0)}else zn&&clearTimeout(zn),zn=setTimeout(()=>{p(!0),clearTimeout(zn)},eT),v();return()=>{zn&&clearTimeout(zn),Ii&&clearTimeout(Ii)}},[e]),Bt(x=>{n.current&&(d||S(k,x.camera),m||T(w,x.camera))});const v=()=>{if(e){const x=h.position.distanceTo(k);Hx(x)}g()},g=()=>{f(!1),p(!1),i(!1),Ii&&clearTimeout(Ii),Ii=setTimeout(()=>{f(!0),p(!0)},Jx)},S=(x,b)=>{if(b.position.distanceTo(x)<_)f(!0);else{b.position.lerp(x,.5);const R=sd((r==null?void 0:r.nodes)||[],h);R&&c(R)}},T=(x,b)=>{var A;(A=n==null?void 0:n.current)==null||A.setLookAt(b.position.x,b.position.y,b.position.z,x.x,x.y,x.z,!0)};return null},sT=1;let Xr=null;const nT=(n,{enabled:e})=>{const t=cs();tT(n);const s=Hs(a=>a.isUserDragging),{graphStyle:i,graphRadius:r,disableCameraRotation:o}=ht(a=>a);return D.useEffect(()=>{e||(Xr==null||Xr.kill(),Xr=null)},[e]),D.useEffect(()=>{n.current&&r&&(i==="sphere"?(n.current.maxDistance=8e3,n.current.minDistance=200,n.current.setTarget(0,0,500,!0)):(n.current.maxDistance=n.current.getDistanceToFitSphere(r+200),n.current.minDistance=100))},[r,i,n]),D.useEffect(()=>{!t&&n.current&&n.current.setLookAt(zi.x,zi.y,r,0,0,0,!0)},[t,r]),Bt((a,c)=>{n.current&&(!o&&!s&&(n.current.azimuthAngle+=sT*c*ip.DEG2RAD),n.current.update(c))}),null},iT=({disableAnimations:n})=>{const e=D.useRef(null),{data:t,setNearbyNodeIds:s,setDisableCameraRotation:i}=ht(h=>h),[r]=D.useState(.8),{camera:o}=Pe(),[a,c,l,u]=Hs(h=>[h.isUserDragging,h.setIsUserDragging,h.isUserScrolling,h.isUserScrollingOnHtmlPanel]);return nT(e,{enabled:!n&&!l&&!a}),D.useEffect(()=>{if(!a){const h=sd((t==null?void 0:t.nodes)||[],o);h&&s(h)}},[o,o.position,o.position.x,o.position.y,o.position.z,t==null?void 0:t.nodes,s,a]),D.useEffect(()=>{a&&i(!0)},[a,i]),U.jsx(Gp,{ref:e,boundaryEnclosesCamera:!0,enabled:!u,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>c(!1),onStart:()=>c(!0),smoothTime:r})};function gs(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function nd(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*! - * GSAP 3.12.4 - * https://gsap.com - * - * @license Copyright 2008-2023, GreenSock. All rights reserved. - * 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 Ot={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ci={duration:.5,overwrite:!1,delay:0},Hc,it,Ve,Nt=1e8,Ee=1/Nt,Ga=Math.PI*2,rT=Ga/4,oT=0,id=Math.sqrt,aT=Math.cos,cT=Math.sin,tt=function(e){return typeof e=="string"},je=function(e){return typeof e=="function"},Cs=function(e){return typeof e=="number"},qc=function(e){return typeof e>"u"},os=function(e){return typeof e=="object"},gt=function(e){return e!==!1},Gc=function(){return typeof window<"u"},Qr=function(e){return je(e)||tt(e)},rd=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},rt=Array.isArray,Wa=/(?:-?\.?\d|\.)+/gi,od=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Wn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ta=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ad=/[+-]=-?[.\d]+/,cd=/[^,'"\[\]\s]+/gi,lT=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ue,Rt,Ya,Wc,Mt={},Ao={},ld,ud=function(e){return(Ao=Cn(e,Mt))&&kt},Yc=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},hr=function(e,t){return!t&&console.warn(e)},hd=function(e,t){return e&&(Mt[e]=t)&&Ao&&(Ao[e]=t)||Mt},dr=function(){return 0},uT={suppressEvents:!0,isStart:!0,kill:!1},so={suppressEvents:!0,kill:!1},hT={suppressEvents:!0},Zc={},Gs=[],Za={},dd,St={},ka={},nu=30,no=[],$c="",Xc=function(e){var t=e[0],s,i;if(os(t)||je(t)||(e=[e]),!(s=(t._gsap||{}).harness)){for(i=no.length;i--&&!no[i].targetTest(t););s=no[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new Fd(e[i],s)))||e.splice(i,1);return e},gn=function(e){return e._gsap||Xc(Ft(e))[0]._gsap},fd=function(e,t,s){return(s=e[t])&&je(s)?e[t]():qc(s)&&e.getAttribute&&e.getAttribute(t)||s},vt=function(e,t){return(e=e.split(",")).forEach(t)||e},qe=function(e){return Math.round(e*1e5)/1e5||0},Ke=function(e){return Math.round(e*1e7)/1e7||0},Xn=function(e,t){var s=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),s==="+"?e+i:s==="-"?e-i:s==="*"?e*i:e/i},dT=function(e,t){for(var s=t.length,i=0;e.indexOf(t[i])<0&&++ia;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[s],e[s]=t),t._next?t._next._prev=t:e[i]=t,t._prev=o,t.parent=t._dp=e,t},sa=function(e,t,s,i){s===void 0&&(s="_first"),i===void 0&&(i="_last");var r=t._prev,o=t._next;r?r._next=o:e[s]===t&&(e[s]=o),o?o._prev=r:e[i]===t&&(e[i]=r),t._next=t._prev=t.parent=null},Ks=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},vn=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var s=e;s;)s._dirty=1,s=s.parent;return e},mT=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},$a=function(e,t,s,i){return e._startAt&&(it?e._startAt.revert(so):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},_T=function n(e){return!e||e._ts&&n(e.parent)},ru=function(e){return e._repeat?li(e._tTime,e=e.duration()+e._rDelay)*e:0},li=function(e,t){var s=Math.floor(e/=t);return e&&s===e?s-1:s},Do=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},na=function(e){return e._end=Ke(e._start+(e._tDur/Math.abs(e._ts||e._rts||Ee)||0))},ia=function(e,t){var s=e._dp;return s&&s.smoothChildTiming&&e._ts&&(e._start=Ke(s._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),na(e),s._dirty||vn(s,e)),e},vd=function(e,t){var s;if((t._time||!t._dur&&t._initted||t._startEe)&&t.render(s,!0)),vn(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&s.totalTime(s._tTime),s=s._dp;e._zTime=-Ee}},ts=function(e,t,s,i){return t.parent&&Ks(t),t._start=Ke((Cs(s)?s:s||e!==Ue?Dt(e,s,t):e._time)+t._delay),t._end=Ke(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),gd(e,t,"_first","_last",e._sort?"_start":0),Xa(t)||(e._recent=t),i||vd(e,t),e._ts<0&&ia(e,e._tTime),e},yd=function(e,t){return(Mt.ScrollTrigger||Yc("scrollTrigger",t))&&Mt.ScrollTrigger.create(t,e)},xd=function(e,t,s,i,r){if(Kc(e,t,r),!e._initted)return 1;if(!s&&e._pt&&!it&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&dd!==bt.frame)return Gs.push(e),e._lazy=[r,i],1},gT=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},Xa=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},vT=function(e,t,s,i){var r=e.ratio,o=t<0||!t&&(!e._start&&gT(e)&&!(!e._initted&&Xa(e))||(e._ts<0||e._dp._ts<0)&&!Xa(e))?0:1,a=e._rDelay,c=0,l,u,h;if(a&&e._repeat&&(c=Pr(0,e._tDur,t),u=li(c,a),e._yoyo&&u&1&&(o=1-o),u!==li(e._tTime,a)&&(r=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==r||it||i||e._zTime===Ee||!t&&e._zTime){if(!e._initted&&xd(e,t,i,s,c))return;for(h=e._zTime,e._zTime=t||(s?Ee:0),s||(s=t&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=c,l=e._pt;l;)l.r(o,l.d),l=l._next;t<0&&$a(e,t,s,!0),e._onUpdate&&!s&&Ct(e,"onUpdate"),c&&e._repeat&&!s&&e.parent&&Ct(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&Ks(e,1),!s&&!it&&(Ct(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},yT=function(e,t,s){var i;if(s>t)for(i=e._first;i&&i._start<=s;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=s;){if(i.data==="isPause"&&i._start0&&!i&&ia(e,e._tTime=e._tDur*a),e.parent&&na(e),s||vn(e.parent,e),e},ou=function(e){return e instanceof lt?vn(e):ui(e,e._dur)},xT={_start:0,endTime:dr,totalDuration:dr},Dt=function n(e,t,s){var i=e.labels,r=e._recent||xT,o=e.duration()>=Nt?r.endTime(!1):e._dur,a,c,l;return tt(t)&&(isNaN(t)||t in i)?(c=t.charAt(0),l=t.substr(-1)==="%",a=t.indexOf("="),c==="<"||c===">"?(a>=0&&(t=t.replace(/=/,"")),(c==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(t.substr(1))||0)*(l?(a<0?r:s).totalDuration()/100:1)):a<0?(t in i||(i[t]=o),i[t]):(c=parseFloat(t.charAt(a-1)+t.substr(a+1)),l&&s&&(c=c/100*(rt(s)?s[0]:s).totalDuration()),a>1?n(e,t.substr(0,a-1),s)+c:o+c)):t==null?o:+t},Hi=function(e,t,s){var i=Cs(t[1]),r=(i?2:1)+(e<2?0:1),o=t[r],a,c;if(i&&(o.duration=t[1]),o.parent=s,e){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=gt(c.vars.inherit)&&c.parent;o.immediateRender=gt(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[r-1]}return new $e(t[0],o,t[r+1])},sn=function(e,t){return e||e===0?t(e):t},Pr=function(e,t,s){return st?t:s},nt=function(e,t){return!tt(e)||!(t=lT.exec(e))?"":t[1]},TT=function(e,t,s){return sn(s,function(i){return Pr(e,t,i)})},Qa=[].slice,Td=function(e,t){return e&&os(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&os(e[0]))&&!e.nodeType&&e!==Rt},kT=function(e,t,s){return s===void 0&&(s=[]),e.forEach(function(i){var r;return tt(i)&&!t||Td(i,1)?(r=s).push.apply(r,Ft(i)):s.push(i)})||s},Ft=function(e,t,s){return Ve&&!t&&Ve.selector?Ve.selector(e):tt(e)&&!s&&(Ya||!hi())?Qa.call((t||Wc).querySelectorAll(e),0):rt(e)?kT(e,s):Td(e)?Qa.call(e,0):e?[e]:[]},Ka=function(e){return e=Ft(e)[0]||hr("Invalid scope")||{},function(t){var s=e.current||e.nativeElement||e;return Ft(t,s.querySelectorAll?s:s===e?hr("Invalid scope")||Wc.createElement("div"):e)}},kd=function(e){return e.sort(function(){return .5-Math.random()})},wd=function(e){if(je(e))return e;var t=os(e)?e:{each:e},s=yn(t.ease),i=t.from||0,r=parseFloat(t.base)||0,o={},a=i>0&&i<1,c=isNaN(i)||a,l=t.axis,u=i,h=i;return tt(i)?u=h={center:.5,edges:.5,end:1}[i]||0:!a&&c&&(u=i[0],h=i[1]),function(d,f,m){var p=(m||t).length,_=o[p],y,k,w,v,g,S,T,x,b;if(!_){if(b=t.grid==="auto"?0:(t.grid||[1,Nt])[1],!b){for(T=-Nt;T<(T=m[b++].getBoundingClientRect().left)&&bT&&(T=g),gp?p-1:l?l==="y"?p/b:b:Math.max(b,p/b))||0)*(i==="edges"?-1:1),_.b=p<0?r-p:r,_.u=nt(t.amount||t.each)||0,s=s&&p<0?Rd(s):s}return p=(_[d]-_.min)/_.max||0,Ke(_.b+(s?s(p):p)*_.v)+_.u}},Ja=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(s){var i=Ke(Math.round(parseFloat(s)/e)*e*t);return(i-i%1)/t+(Cs(s)?0:nt(s))}},Sd=function(e,t){var s=rt(e),i,r;return!s&&os(e)&&(i=s=e.radius||Nt,e.values?(e=Ft(e.values),(r=!Cs(e[0]))&&(i*=i)):e=Ja(e.increment)),sn(t,s?je(e)?function(o){return r=e(o),Math.abs(r-o)<=i?r:o}:function(o){for(var a=parseFloat(r?o.x:o),c=parseFloat(r?o.y:0),l=Nt,u=0,h=e.length,d,f;h--;)r?(d=e[h].x-a,f=e[h].y-c,d=d*d+f*f):d=Math.abs(e[h]-a),di?r-o:o)})},fr=function(e){for(var t=0,s="",i,r,o,a;~(i=e.indexOf("random(",t));)o=e.indexOf(")",i),a=e.charAt(i+7)==="[",r=e.substr(i+7,o-i-7).match(a?cd:Wa),s+=e.substr(t,i-t)+bd(a?r:+r[0],a?0:+r[1],+r[2]||1e-5),t=o+1;return s+e.substr(t,e.length-t)},Ed=function(e,t,s,i,r){var o=t-e,a=i-s;return sn(r,function(c){return s+((c-e)/o*a||0)})},OT=function n(e,t,s,i){var r=isNaN(e+t)?0:function(f){return(1-f)*e+f*t};if(!r){var o=tt(e),a={},c,l,u,h,d;if(s===!0&&(i=1)&&(s=null),o)e={p:e},t={p:t};else if(rt(e)&&!rt(t)){for(u=[],h=e.length,d=h-2,l=1;l(a=Math.abs(a))&&(c=o,r=a);return c},Ct=function(e,t,s){var i=e.vars,r=i[t],o=Ve,a=e._ctx,c,l,u;if(r)return c=i[t+"Params"],l=i.callbackScope||e,s&&Gs.length&&Mo(),a&&(Ve=a),u=c?r.apply(l,c):r.call(l),Ve=o,u},Ui=function(e){return Ks(e),e.scrollTrigger&&e.scrollTrigger.kill(!!it),e.progress()<1&&Ct(e,"onInterrupt"),e},Yn,Od=[],Ad=function(e){if(Gc()&&e){e=!e.name&&e.default||e;var t=e.name,s=je(e),i=t&&!s&&e.init?function(){this._props=[]}:e,r={init:dr,render:tl,add:Qc,kill:qT,modifier:HT,rawVars:0},o={targetTest:0,get:0,getSetter:el,aliases:{},register:0};if(hi(),e!==i){if(St[t])return;Lt(i,Lt(Po(e,r),o)),Cn(i.prototype,Cn(r,Po(e,o))),St[i.prop=t]=i,e.targetTest&&(no.push(i),Zc[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}hd(t,i),e.register&&e.register(kt,i,yt)}else e&&Od.push(e)},Ce=255,Li={aqua:[0,Ce,Ce],lime:[0,Ce,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ce],navy:[0,0,128],white:[Ce,Ce,Ce],olive:[128,128,0],yellow:[Ce,Ce,0],orange:[Ce,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ce,0,0],pink:[Ce,192,203],cyan:[0,Ce,Ce],transparent:[Ce,Ce,Ce,0]},wa=function(e,t,s){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(s-t)*e*6:e<.5?s:e*3<2?t+(s-t)*(2/3-e)*6:t)*Ce+.5|0},Md=function(e,t,s){var i=e?Cs(e)?[e>>16,e>>8&Ce,e&Ce]:0:Li.black,r,o,a,c,l,u,h,d,f,m;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Li[e])i=Li[e];else if(e.charAt(0)==="#"){if(e.length<6&&(r=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+r+r+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&Ce,i&Ce,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&Ce,e&Ce]}else if(e.substr(0,3)==="hsl"){if(i=m=e.match(Wa),!t)c=+i[0]%360/360,l=+i[1]/100,u=+i[2]/100,o=u<=.5?u*(l+1):u+l-u*l,r=u*2-o,i.length>3&&(i[3]*=1),i[0]=wa(c+1/3,r,o),i[1]=wa(c,r,o),i[2]=wa(c-1/3,r,o);else if(~e.indexOf("="))return i=e.match(od),s&&i.length<4&&(i[3]=1),i}else i=e.match(Wa)||Li.transparent;i=i.map(Number)}return t&&!m&&(r=i[0]/Ce,o=i[1]/Ce,a=i[2]/Ce,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+(oe&&(s+=y-t),i+=y,g=i-s,w=g-o,(w>0||k)&&(S=++h.frame,d=g-h.time*1e3,h.time=g=g/1e3,o+=w+(w>=r?4:r-w),v=1),k||(c=l(p)),v)for(f=0;f=y&&f--},_listeners:a},h}(),hi=function(){return!pr&&bt.wake()},_e={},MT=/^[\d.\-M][\d.\-,\s]/,PT=/["']/g,DT=function(e){for(var t={},s=e.substr(1,e.length-3).split(":"),i=s[0],r=1,o=s.length,a,c,l;r1&&s.config?s.config.apply(null,~e.indexOf("{")?[DT(t[1])]:RT(e).split(",").map(md)):_e._CE&&MT.test(e)?_e._CE("",e):s},Rd=function(e){return function(t){return 1-e(1-t)}},Id=function n(e,t){for(var s=e._first,i;s;)s instanceof lt?n(s,t):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==t&&(s.timeline?n(s.timeline,t):(i=s._ease,s._ease=s._yEase,s._yEase=i,s._yoyo=t)),s=s._next},yn=function(e,t){return e&&(je(e)?e:_e[e]||IT(e))||t},Dn=function(e,t,s,i){s===void 0&&(s=function(c){return 1-t(1-c)}),i===void 0&&(i=function(c){return c<.5?t(c*2)/2:1-t((1-c)*2)/2});var r={easeIn:t,easeOut:s,easeInOut:i},o;return vt(e,function(a){_e[a]=Mt[a]=r,_e[o=a.toLowerCase()]=s;for(var c in r)_e[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=_e[a+"."+c]=r[c]}),r},Nd=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},Sa=function n(e,t,s){var i=t>=1?t:1,r=(s||(e?.3:.45))/(t<1?t:1),o=r/Ga*(Math.asin(1/i)||0),a=function(u){return u===1?1:i*Math.pow(2,-10*u)*cT((u-o)*r)+1},c=e==="out"?a:e==="in"?function(l){return 1-a(1-l)}:Nd(a);return r=Ga/r,c.config=function(l,u){return n(e,l,u)},c},ba=function n(e,t){t===void 0&&(t=1.70158);var s=function(o){return o?--o*o*((t+1)*o+t)+1:0},i=e==="out"?s:e==="in"?function(r){return 1-s(1-r)}:Nd(s);return i.config=function(r){return n(e,r)},i};vt("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;Dn(n+",Power"+(t-1),e?function(s){return Math.pow(s,t)}:function(s){return s},function(s){return 1-Math.pow(1-s,t)},function(s){return s<.5?Math.pow(s*2,t)/2:1-Math.pow((1-s)*2,t)/2})});_e.Linear.easeNone=_e.none=_e.Linear.easeIn;Dn("Elastic",Sa("in"),Sa("out"),Sa());(function(n,e){var t=1/e,s=2*t,i=2.5*t,r=function(a){return a0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},e.totalDuration=function(s){return arguments.length?(this._dirty=0,ui(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(s,i){if(hi(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(ia(this,s),!r._dp||r.parent||vd(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)&&ts(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===Ee||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),pd(this,s,i)),this},e.time=function(s,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+ru(this))%(this._dur+this._rDelay)||(s?this._dur:0),i):this._time},e.totalProgress=function(s,i){return arguments.length?this.totalTime(this.totalDuration()*s,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(s,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+ru(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(s,i){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*r,i):this._repeat?li(this._tTime,r)+1:1},e.timeScale=function(s,i){if(!arguments.length)return this._rts===-Ee?0:this._rts;if(this._rts===s)return this;var r=this.parent&&this._ts?Do(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-Ee?0:this._rts,this.totalTime(Pr(-Math.abs(this._delay),this._tDur,r),i!==!1),na(this),mT(this)},e.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):(hi(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ee&&(this._tTime-=Ee)))),this):this._ps},e.startTime=function(s){if(arguments.length){this._start=s;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&ts(i,this,s-this._delay),this}return this._start},e.endTime=function(s){return this._start+(gt(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(s){var i=this.parent||this._dp;return i?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Do(i.rawTime(s),this):this._tTime:this._tTime},e.revert=function(s){s===void 0&&(s=hT);var i=it;return it=s,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),it=i,this},e.globalTime=function(s){for(var i=this,r=arguments.length?s:i.rawTime();i;)r=i._start+r/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(s):r},e.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,ou(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(s){if(arguments.length){var i=this._time;return this._rDelay=s,ou(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},e.seek=function(s,i){return this.totalTime(Dt(this,s),gt(i))},e.restart=function(s,i){return this.play().totalTime(s?-this._delay:0,gt(i))},e.play=function(s,i){return s!=null&&this.seek(s,i),this.reversed(!1).paused(!1)},e.reverse=function(s,i){return s!=null&&this.seek(s||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(s,i){return s!=null&&this.seek(s,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-Ee:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ee,this},e.isActive=function(){var s=this.parent||this._dp,i=this._start,r;return!!(!s||this._ts&&this._initted&&s.isActive()&&(r=s.rawTime(!0))>=i&&r1?(i?(o[s]=i,r&&(o[s+"Params"]=r),s==="onUpdate"&&(this._onUpdate=i)):delete o[s],this):o[s]},e.then=function(s){var i=this;return new Promise(function(r){var o=je(s)?s:_d,a=function(){var l=i.then;i.then=null,je(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=l),r(o),i.then=l};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?a():i._prom=a})},e.kill=function(){Ui(this)},n}();Lt(mr.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:-Ee,_prom:0,_ps:!1,_rts:1});var lt=function(n){nd(e,n);function e(s,i){var r;return s===void 0&&(s={}),r=n.call(this,s)||this,r.labels={},r.smoothChildTiming=!!s.smoothChildTiming,r.autoRemoveChildren=!!s.autoRemoveChildren,r._sort=gt(s.sortChildren),Ue&&ts(s.parent||Ue,gs(r),i),s.reversed&&r.reverse(),s.paused&&r.paused(!0),s.scrollTrigger&&yd(gs(r),s.scrollTrigger),r}var t=e.prototype;return t.to=function(i,r,o){return Hi(0,arguments,this),this},t.from=function(i,r,o){return Hi(1,arguments,this),this},t.fromTo=function(i,r,o,a){return Hi(2,arguments,this),this},t.set=function(i,r,o){return r.duration=0,r.parent=this,ji(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new $e(i,r,Dt(this,o),1),this},t.call=function(i,r,o){return ts(this,$e.delayedCall(0,i,r),o)},t.staggerTo=function(i,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 $e(i,o,Dt(this,c)),this},t.staggerFrom=function(i,r,o,a,c,l,u){return o.runBackwards=1,ji(o).immediateRender=gt(o.immediateRender),this.staggerTo(i,r,o,a,c,l,u)},t.staggerFromTo=function(i,r,o,a,c,l,u,h){return a.startAt=o,ji(a).immediateRender=gt(a.immediateRender),this.staggerTo(i,r,a,c,l,u,h)},t.render=function(i,r,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,l=this._dur,u=i<=0?0:Ke(i),h=this._zTime<0!=i<0&&(this._initted||!l),d,f,m,p,_,y,k,w,v,g,S,T;if(this!==Ue&&u>c&&i>=0&&(u=c),u!==this._tTime||o||h){if(a!==this._time&&l&&(u+=this._time-a,i+=this._time-a),d=u,v=this._start,w=this._ts,y=!w,h&&(l||(a=this._zTime),(i||!r)&&(this._zTime=i)),this._repeat){if(S=this._yoyo,_=l+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(_*100+i,r,o);if(d=Ke(u%_),u===c?(p=this._repeat,d=l):(p=~~(u/_),p&&p===u/_&&(d=l,p--),d>l&&(d=l)),g=li(this._tTime,_),!a&&this._tTime&&g!==p&&this._tTime-g*_-this._dur<=0&&(g=p),S&&p&1&&(d=l-d,T=1),p!==g&&!this._lock){var x=S&&g&1,b=x===(S&&p&1);if(p=a&&i>=0)for(f=this._first;f;){if(m=f._next,(f._act||d>=f._start)&&f._ts&&k!==f){if(f.parent!==this)return this.render(i,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){k=0,m&&(u+=this._zTime=-Ee);break}}f=m}else{f=this._last;for(var A=i<0?i:d;f;){if(m=f._prev,(f._act||A<=f._end)&&f._ts&&k!==f){if(f.parent!==this)return this.render(i,r,o);if(f.render(f._ts>0?(A-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(A-f._start)*f._ts,r,o||it&&(f._initted||f._startAt)),d!==this._time||!this._ts&&!y){k=0,m&&(u+=this._zTime=A?-Ee:Ee);break}}f=m}}if(k&&!r&&(this.pause(),k.render(d>=a?0:-Ee)._zTime=d>=a?1:-1,this._ts))return this._start=v,na(this),this.render(i,r,o);this._onUpdate&&!r&&Ct(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&a)&&(v===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((i||!l)&&(u===c&&this._ts>0||!u&&this._ts<0)&&Ks(this,1),!r&&!(i<0&&!a)&&(u||a||!c)&&(Ct(this,u===c&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u0)&&this._prom())))}return this},t.add=function(i,r){var o=this;if(Cs(r)||(r=Dt(this,r,i)),!(i instanceof mr)){if(rt(i))return i.forEach(function(a){return o.add(a,r)}),this;if(tt(i))return this.addLabel(i,r);if(je(i))i=$e.delayedCall(0,i);else return this}return this!==i?ts(this,i,r):this},t.getChildren=function(i,r,o,a){i===void 0&&(i=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),a===void 0&&(a=-Nt);for(var c=[],l=this._first;l;)l._start>=a&&(l instanceof $e?r&&c.push(l):(o&&c.push(l),i&&c.push.apply(c,l.getChildren(!0,r,o)))),l=l._next;return c},t.getById=function(i){for(var r=this.getChildren(1,1,1),o=r.length;o--;)if(r[o].vars.id===i)return r[o]},t.remove=function(i){return tt(i)?this.removeLabel(i):je(i)?this.killTweensOf(i):(sa(this,i),i===this._recent&&(this._recent=this._last),vn(this))},t.totalTime=function(i,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ke(bt.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),n.prototype.totalTime.call(this,i,r),this._forcing=0,this):this._tTime},t.addLabel=function(i,r){return this.labels[i]=Dt(this,r),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,r,o){var a=$e.delayedCall(0,r||dr,o);return a.data="isPause",this._hasPause=1,ts(this,a,Dt(this,i))},t.removePause=function(i){var r=this._first;for(i=Dt(this,i);r;)r._start===i&&r.data==="isPause"&&Ks(r),r=r._next},t.killTweensOf=function(i,r,o){for(var a=this.getTweensOf(i,o),c=a.length;c--;)Bs!==a[c]&&a[c].kill(i,r);return this},t.getTweensOf=function(i,r){for(var o=[],a=Ft(i),c=this._first,l=Cs(r),u;c;)c instanceof $e?dT(c._targets,a)&&(l?(!Bs||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},t.tweenTo=function(i,r){r=r||{};var o=this,a=Dt(o,i),c=r,l=c.startAt,u=c.onStart,h=c.onStartParams,d=c.immediateRender,f,m=$e.to(o,Lt({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())||Ee,onStart:function(){if(o.pause(),!f){var _=r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());m._dur!==_&&ui(m,_,0,1).render(m._time,!0,!0),f=1}u&&u.apply(m,h||[])}},r));return d?m.render(0):m},t.tweenFromTo=function(i,r,o){return this.tweenTo(r,Lt({startAt:{time:Dt(this,i)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),au(this,Dt(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),au(this,Dt(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+Ee)},t.shiftChildren=function(i,r,o){o===void 0&&(o=0);for(var a=this._first,c=this.labels,l;a;)a._start>=o&&(a._start+=i,a._end+=i),a=a._next;if(r)for(l in c)c[l]>=o&&(c[l]+=i);return vn(this)},t.invalidate=function(i){var r=this._first;for(this._lock=0;r;)r.invalidate(i),r=r._next;return n.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!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),i&&(this.labels={}),vn(this)},t.totalDuration=function(i){var r=0,o=this,a=o._last,c=Nt,l,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));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,ts(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;ui(o,o===Ue&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(i){if(Ue._ts&&(pd(Ue,Do(i,Ue)),dd=bt.frame),bt.frame>=nu){nu+=Ot.autoSleep||120;var r=Ue._first;if((!r||!r._ts)&&Ot.autoSleep&&bt._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||bt.sleep()}}},e}(mr);Lt(lt.prototype,{_lock:0,_hasPause:0,_forcing:0});var NT=function(e,t,s,i,r,o,a){var c=new yt(this._pt,e,t,0,1,jd,null,r),l=0,u=0,h,d,f,m,p,_,y,k;for(c.b=s,c.e=i,s+="",i+="",(y=~i.indexOf("random("))&&(i=fr(i)),o&&(k=[s,i],o(k,e,t),s=k[0],i=k[1]),d=s.match(Ta)||[];h=Ta.exec(i);)m=h[0],p=i.substring(l,h.index),f?f=(f+1)%5:p.substr(-5)==="rgba("&&(f=1),m!==d[u++]&&(_=parseFloat(d[u-1])||0,c._pt={_next:c._pt,p:p||u===1?p:",",s:_,c:m.charAt(1)==="="?Xn(_,m)-_:parseFloat(m)-_,m:f&&f<4?Math.round:0},l=Ta.lastIndex);return c.c=l")}),v.duration();else{S={};for(x in m)x==="ease"||x==="easeEach"||BT(x,m[x],S,m.easeEach);for(x in S)for(L=S[x].sort(function(W,V){return W.t-V.t}),M=0,g=0;gc-Ee&&!u?c:il&&(d=l)),y=this._yoyo&&m&1,y&&(v=this._yEase,d=l-d),_=li(this._tTime,p),d===a&&!o&&this._initted&&m===_)return this._tTime=h,this;m!==_&&(w&&this._yEase&&Id(w,y),this.vars.repeatRefresh&&!y&&!this._lock&&this._time!==l&&this._initted&&(this._lock=o=1,this.render(Ke(p*m),!0).invalidate()._lock=0))}if(!this._initted){if(xd(this,u?i: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(i,r,o)}if(this._tTime=h,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=k=(v||this._ease)(d/l),this._from&&(this.ratio=k=1-k),d&&!a&&!r&&!m&&(Ct(this,"onStart"),this._tTime!==h))return this;for(f=this._pt;f;)f.r(k,f.d),f=f._next;w&&w.render(i<0?i:!d&&y?-Ee:w._dur*w._ease(d/this._dur),r,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!r&&(u&&$a(this,i,r,o),Ct(this,"onUpdate")),this._repeat&&m!==_&&this.vars.onRepeat&&!r&&this.parent&&Ct(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&$a(this,i,!0,!0),(i||!l)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Ks(this,1),!r&&!(u&&!a)&&(h||a||y)&&(Ct(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),n.prototype.invalidate.call(this,i)},t.resetTo=function(i,r,o,a,c){pr||bt.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Kc(this,l),u=this._ease(l/this._dur),UT(this,i,r,o,a,u,l,c)?this.resetTo(i,r,o,a,1):(ia(this,0),this.parent||gd(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,r){if(r===void 0&&(r="all"),!i&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?Ui(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,r,Bs&&Bs.vars.overwrite!==!0)._first||Ui(this),this.parent&&o!==this.timeline.totalDuration()&&ui(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=i?Ft(i):a,l=this._ptLookup,u=this._pt,h,d,f,m,p,_,y;if((!r||r==="all")&&pT(a,c))return r==="all"&&(this._pt=0),Ui(this);for(h=this._op=this._op||[],r!=="all"&&(tt(r)&&(p={},vt(r,function(k){return p[k]=1}),r=p),r=LT(a,r)),y=a.length;y--;)if(~c.indexOf(a[y])){d=l[y],r==="all"?(h[y]=r,m=d,f={}):(f=h[y]=h[y]||{},m=r);for(p in m)_=d&&d[p],_&&((!("kill"in _.d)||_.d.kill(p)===!0)&&sa(this,_,"_pt"),delete d[p]),f!=="all"&&(f[p]=1)}return this._initted&&!this._pt&&u&&Ui(this),this},e.to=function(i,r){return new e(i,r,arguments[2])},e.from=function(i,r){return Hi(1,arguments)},e.delayedCall=function(i,r,o,a){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:r,onReverseComplete:r,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(i,r,o){return Hi(2,arguments)},e.set=function(i,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(i,r)},e.killTweensOf=function(i,r,o){return Ue.killTweensOf(i,r,o)},e}(mr);Lt($e.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});vt("staggerTo,staggerFrom,staggerFromTo",function(n){$e[n]=function(){var e=new lt,t=Qa.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var Jc=function(e,t,s){return e[t]=s},zd=function(e,t,s){return e[t](s)},zT=function(e,t,s,i){return e[t](i.fp,s)},VT=function(e,t,s){return e.setAttribute(t,s)},el=function(e,t){return je(e[t])?zd:qc(e[t])&&e.setAttribute?VT:Jc},Vd=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},jT=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},jd=function(e,t){var s=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;s;)i=s.p+(s.m?s.m(s.s+s.c*e):Math.round((s.s+s.c*e)*1e4)/1e4)+i,s=s._next;i+=t.c}t.set(t.t,t.p,i,t)},tl=function(e,t){for(var s=t._pt;s;)s.r(e,s.d),s=s._next},HT=function(e,t,s,i){for(var r=this._pt,o;r;)o=r._next,r.p===i&&r.modifier(e,t,s),r=o},qT=function(e){for(var t=this._pt,s,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?sa(this,t,"_pt"):t.dep||(s=1),t=i;return!s},GT=function(e,t,s,i){i.mSet(e,t,i.m.call(i.tween,s,i.mt),i)},Hd=function(e){for(var t=e._pt,s,i,r,o;t;){for(s=t._next,i=r;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:o)?t._prev._next=t:r=t,(t._next=i)?i._prev=t:o=t,t=s}e._pt=r},yt=function(){function n(t,s,i,r,o,a,c,l,u){this.t=s,this.s=r,this.c=o,this.p=i,this.r=a||Vd,this.d=c||this,this.set=l||Jc,this.pr=u||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(s,i,r){this.mSet=this.mSet||this.set,this.set=GT,this.m=s,this.mt=r,this.tween=i},n}();vt($c+"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(n){return Zc[n]=1});Mt.TweenMax=Mt.TweenLite=$e;Mt.TimelineLite=Mt.TimelineMax=lt;Ue=new lt({sortChildren:!1,defaults:ci,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Ot.stringFilter=Dd;var xn=[],io={},WT=[],lu=0,YT=0,Ca=function(e){return(io[e]||WT).map(function(t){return t()})},tc=function(){var e=Date.now(),t=[];e-lu>2&&(Ca("matchMediaInit"),xn.forEach(function(s){var i=s.queries,r=s.conditions,o,a,c,l;for(a in i)o=Rt.matchMedia(i[a]).matches,o&&(c=1),o!==r[a]&&(r[a]=o,l=1);l&&(s.revert(),c&&t.push(s))}),Ca("matchMediaRevert"),t.forEach(function(s){return s.onMatch(s,function(i){return s.add(null,i)})}),lu=e,Ca("matchMedia"))},qd=function(){function n(t,s){this.selector=s&&Ka(s),this.data=[],this._r=[],this.isReverted=!1,this.id=YT++,t&&this.add(t)}var e=n.prototype;return e.add=function(s,i,r){je(s)&&(r=i,i=s,s=je);var o=this,a=function(){var l=Ve,u=o.selector,h;return l&&l!==o&&l.data.push(o),r&&(o.selector=Ka(r)),Ve=o,h=i.apply(o,arguments),je(h)&&o._r.push(h),Ve=l,o.selector=u,o.isReverted=!1,h};return o.last=a,s===je?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},e.ignore=function(s){var i=Ve;Ve=null,s(this),Ve=i},e.getTweens=function(){var s=[];return this.data.forEach(function(i){return i instanceof n?s.push.apply(s,i.getTweens()):i instanceof $e&&!(i.parent&&i.parent.data==="nested")&&s.push(i)}),s},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(s,i){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 lt?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof $e)&&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(),i)for(var o=xn.length;o--;)xn[o].id===this.id&&xn.splice(o,1)},e.revert=function(s){this.kill(s||{})},n}(),ZT=function(){function n(t){this.contexts=[],this.scope=t}var e=n.prototype;return e.add=function(s,i,r){os(s)||(s={matches:s});var o=new qd(0,r||this.scope),a=o.conditions={},c,l,u;Ve&&!o.selector&&(o.selector=Ve.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=s;for(l in s)l==="all"?u=1:(c=Rt.matchMedia(s[l]),c&&(xn.indexOf(o)<0&&xn.push(o),(a[l]=c.matches)&&(u=1),c.addListener?c.addListener(tc):c.addEventListener("change",tc)));return u&&i(o,function(h){return o.add(null,h)}),this},e.revert=function(s){this.kill(s||{})},e.kill=function(s){this.contexts.forEach(function(i){return i.kill(s,!0)})},n}(),Ro={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),s=0;s1){var i=e.map(function(u){return kt.quickSetter(u,t,s)}),r=i.length;return function(u){for(var h=r;h--;)i[h](u)}}e=e[0]||{};var o=St[t],a=gn(e),c=a.harness&&(a.harness.aliases||{})[t]||t,l=o?function(u){var h=new o;Yn._pt=0,h.init(e,s?u+s:u,Yn,0,[e]),h.render(1,h),Yn._pt&&tl(1,Yn)}:a.set(e,c);return o?l:function(u){return l(e,c,s?u+s:u,a,1)}},quickTo:function(e,t,s){var i,r=kt.to(e,Cn((i={},i[t]="+=0.1",i.paused=!0,i),s||{})),o=function(c,l,u){return r.resetTo(t,c,l,u)};return o.tween=r,o},isTweening:function(e){return Ue.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=yn(e.ease,ci.ease)),iu(ci,e||{})},config:function(e){return iu(Ot,e||{})},registerEffect:function(e){var t=e.name,s=e.effect,i=e.plugins,r=e.defaults,o=e.extendTimeline;(i||"").split(",").forEach(function(a){return a&&!St[a]&&!Mt[a]&&hr(t+" effect requires "+a+" plugin.")}),ka[t]=function(a,c,l){return s(Ft(a),Lt(c||{},r),l)},o&&(lt.prototype[t]=function(a,c,l){return this.add(ka[t](a,os(c)?c:(l=c)&&{},this),l)})},registerEase:function(e,t){_e[e]=yn(t)},parseEase:function(e,t){return arguments.length?yn(e,t):_e},getById:function(e){return Ue.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var s=new lt(e),i,r;for(s.smoothChildTiming=gt(e.smoothChildTiming),Ue.remove(s),s._dp=0,s._time=s._tTime=Ue._time,i=Ue._first;i;)r=i._next,(t||!(!i._dur&&i instanceof $e&&i.vars.onComplete===i._targets[0]))&&ts(s,i,i._start-i._delay),i=r;return ts(Ue,s,0),s},context:function(e,t){return e?new qd(e,t):Ve},matchMedia:function(e){return new ZT(e)},matchMediaRefresh:function(){return xn.forEach(function(e){var t=e.conditions,s,i;for(i in t)t[i]&&(t[i]=!1,s=1);s&&e.revert()})||tc()},addEventListener:function(e,t){var s=io[e]||(io[e]=[]);~s.indexOf(t)||s.push(t)},removeEventListener:function(e,t){var s=io[e],i=s&&s.indexOf(t);i>=0&&s.splice(i,1)},utils:{wrap:CT,wrapYoyo:ET,distribute:wd,random:bd,snap:Sd,normalize:bT,getUnit:nt,clamp:TT,splitColor:Md,toArray:Ft,selector:Ka,mapRange:Ed,pipe:wT,unitize:ST,interpolate:OT,shuffle:kd},install:ud,effects:ka,ticker:bt,updateRoot:lt.updateRoot,plugins:St,globalTimeline:Ue,core:{PropTween:yt,globals:hd,Tween:$e,Timeline:lt,Animation:mr,getCache:gn,_removeLinkedListItem:sa,reverting:function(){return it},context:function(e){return e&&Ve&&(Ve.data.push(e),e._ctx=Ve),Ve},suppressOverwrites:function(e){return Hc=e}}};vt("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return Ro[n]=$e[n]});bt.add(lt.updateRoot);Yn=Ro.to({},{duration:0});var $T=function(e,t){for(var s=e._pt;s&&s.p!==t&&s.op!==t&&s.fp!==t;)s=s._next;return s},XT=function(e,t){var s=e._targets,i,r,o;for(i in t)for(r=s.length;r--;)o=e._ptLookup[r][i],o&&(o=o.d)&&(o._pt&&(o=$T(o,i)),o&&o.modifier&&o.modifier(t[i],e,s[r],i))},Ea=function(e,t){return{name:e,rawVars:1,init:function(i,r,o){o._onInit=function(a){var c,l;if(tt(r)&&(c={},vt(r,function(u){return c[u]=1}),r=c),t){c={};for(l in r)c[l]=t(r[l]);r=c}XT(a,r)}}}},kt=Ro.registerPlugin({name:"attr",init:function(e,t,s,i,r){var o,a,c;this.tween=s;for(o in t)c=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(c||0)+"",t[o],i,r,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(e,t){for(var s=t._pt;s;)it?s.set(s.t,s.p,s.b,s):s.r(e,s.d),s=s._next}},{name:"endArray",init:function(e,t){for(var s=t.length;s--;)this.add(e,s,e[s]||0,t[s],0,0,0,0,0,1)}},Ea("roundProps",Ja),Ea("modifiers"),Ea("snap",Sd))||Ro;$e.version=lt.version=kt.version="3.12.4";ld=1;Gc()&&hi();_e.Power0;_e.Power1;_e.Power2;_e.Power3;_e.Power4;_e.Linear;_e.Quad;_e.Cubic;_e.Quart;_e.Quint;_e.Strong;_e.Elastic;_e.Back;_e.SteppedEase;_e.Bounce;_e.Sine;_e.Expo;_e.Circ;/*! - * CSSPlugin 3.12.4 - * https://gsap.com - * - * Copyright 2008-2023, GreenSock. All rights reserved. - * 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 uu,zs,Qn,sl,fn,hu,nl,QT=function(){return typeof window<"u"},Es={},ln=180/Math.PI,Kn=Math.PI/180,Vn=Math.atan2,du=1e8,il=/([A-Z])/g,KT=/(left|right|width|margin|padding|x)/i,JT=/[\s,\(]\S/,ss={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},sc=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},ek=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},tk=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},sk=function(e,t){var s=t.s+t.c*e;t.set(t.t,t.p,~~(s+(s<0?-.5:.5))+t.u,t)},Gd=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Wd=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},nk=function(e,t,s){return e.style[t]=s},ik=function(e,t,s){return e.style.setProperty(t,s)},rk=function(e,t,s){return e._gsap[t]=s},ok=function(e,t,s){return e._gsap.scaleX=e._gsap.scaleY=s},ak=function(e,t,s,i,r){var o=e._gsap;o.scaleX=o.scaleY=s,o.renderTransform(r,o)},ck=function(e,t,s,i,r){var o=e._gsap;o[t]=s,o.renderTransform(r,o)},Le="transform",xt=Le+"Origin",lk=function n(e,t){var s=this,i=this.target,r=i.style,o=i._gsap;if(e in Es&&r){if(this.tfm=this.tfm||{},e!=="transform")e=ss[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return s.tfm[a]=vs(i,a)}):this.tfm[e]=o.x?o[e]:vs(i,e),e===xt&&(this.tfm.zOrigin=o.zOrigin);else return ss.transform.split(",").forEach(function(a){return n.call(s,a,t)});if(this.props.indexOf(Le)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(xt,t,"")),e=Le}(r||t)&&this.props.push(e,t,r[e])},Yd=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},uk=function(){var e=this.props,t=this.target,s=t.style,i=t._gsap,r,o;for(r=0;r=0?fu[o]:"")+e},ic=function(){QT()&&window.document&&(uu=window,zs=uu.document,Qn=zs.documentElement,fn=nc("div")||{style:{}},nc("div"),Le=di(Le),xt=Le+"Origin",fn.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",$d=!!di("perspective"),nl=kt.core.reverting,sl=1)},Oa=function n(e){var t=nc("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=this.parentNode,i=this.nextSibling,r=this.style.cssText,o;if(Qn.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=n}catch{}else this._gsapBBox&&(o=this._gsapBBox());return s&&(i?s.insertBefore(this,i):s.appendChild(this)),Qn.removeChild(t),this.style.cssText=r,o},pu=function(e,t){for(var s=t.length;s--;)if(e.hasAttribute(t[s]))return e.getAttribute(t[s])},Xd=function(e){var t;try{t=e.getBBox()}catch{t=Oa.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Oa||(t=Oa.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+pu(e,["x","cx","x1"])||0,y:+pu(e,["y","cy","y1"])||0,width:0,height:0}:t},Qd=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Xd(e))},En=function(e,t){if(t){var s=e.style,i;t in Es&&t!==xt&&(t=Le),s.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),s.removeProperty(i==="--"?t:t.replace(il,"-$1").toLowerCase())):s.removeAttribute(t)}},Vs=function(e,t,s,i,r,o){var a=new yt(e._pt,t,s,0,1,o?Wd:Gd);return e._pt=a,a.b=i,a.e=r,e._props.push(s),a},mu={deg:1,rad:1,turn:1},hk={grid:1,flex:1},Js=function n(e,t,s,i){var r=parseFloat(s)||0,o=(s+"").trim().substr((r+"").length)||"px",a=fn.style,c=KT.test(t),l=e.tagName.toLowerCase()==="svg",u=(l?"client":"offset")+(c?"Width":"Height"),h=100,d=i==="px",f=i==="%",m,p,_,y;if(i===o||!r||mu[i]||mu[o])return r;if(o!=="px"&&!d&&(r=n(e,t,s,"px")),y=e.getCTM&&Qd(e),(f||o==="%")&&(Es[t]||~t.indexOf("adius")))return m=y?e.getBBox()[c?"width":"height"]:e[u],qe(f?r/m*h:r/100*m);if(a[c?"width":"height"]=h+(d?o:i),p=~t.indexOf("adius")||i==="em"&&e.appendChild&&!l?e:e.parentNode,y&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===zs||!p.appendChild)&&(p=zs.body),_=p._gsap,_&&f&&_.width&&c&&_.time===bt.time&&!_.uncache)return qe(r/_.width*h);if(f&&(t==="height"||t==="width")){var k=e.style[t];e.style[t]=h+i,m=e[u],k?e.style[t]=k:En(e,t)}else(f||o==="%")&&!hk[is(p,"display")]&&(a.position=is(e,"position")),p===e&&(a.position="static"),p.appendChild(fn),m=fn[u],p.removeChild(fn),a.position="absolute";return c&&f&&(_=gn(p),_.time=bt.time,_.width=p[u]),qe(d?m*r/h:m&&r?h/m*r:0)},vs=function(e,t,s,i){var r;return sl||ic(),t in ss&&t!=="transform"&&(t=ss[t],~t.indexOf(",")&&(t=t.split(",")[0])),Es[t]&&t!=="transform"?(r=gr(e,i),r=t!=="transformOrigin"?r[t]:r.svg?r.origin:No(is(e,xt))+" "+r.zOrigin+"px"):(r=e.style[t],(!r||r==="auto"||i||~(r+"").indexOf("calc("))&&(r=Io[t]&&Io[t](e,t,s)||is(e,t)||fd(e,t)||(t==="opacity"?1:0))),s&&!~(r+"").trim().indexOf(" ")?Js(e,t,r,s)+s:r},dk=function(e,t,s,i){if(!s||s==="none"){var r=di(t,e,1),o=r&&is(e,r,1);o&&o!==s?(t=r,s=o):t==="borderColor"&&(s=is(e,"borderTopColor"))}var a=new yt(this._pt,e.style,t,0,1,jd),c=0,l=0,u,h,d,f,m,p,_,y,k,w,v,g;if(a.b=s,a.e=i,s+="",i+="",i==="auto"&&(p=e.style[t],e.style[t]=i,i=is(e,t)||i,p?e.style[t]=p:En(e,t)),u=[s,i],Dd(u),s=u[0],i=u[1],d=s.match(Wn)||[],g=i.match(Wn)||[],g.length){for(;h=Wn.exec(i);)_=h[0],k=i.substring(c,h.index),m?m=(m+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(m=1),_!==(p=d[l++]||"")&&(f=parseFloat(p)||0,v=p.substr((f+"").length),_.charAt(1)==="="&&(_=Xn(f,_)+v),y=parseFloat(_),w=_.substr((y+"").length),c=Wn.lastIndex-w.length,w||(w=w||Ot.units[t]||v,c===i.length&&(i+=w,a.e+=w)),v!==w&&(f=Js(e,t,p,w)||0),a._pt={_next:a._pt,p:k||l===1?k:",",s:f,c:y-f,m:m&&m<4||t==="zIndex"?Math.round:0});a.c=c-1;)a=r[l],Es[a]&&(c=1,a=a==="transformOrigin"?xt:Le),En(s,a);c&&(En(s,Le),o&&(o.svg&&s.removeAttribute("transform"),gr(s,1),o.uncache=1,Yd(i)))}},Io={clearProps:function(e,t,s,i,r){if(r.data!=="isFromStart"){var o=e._pt=new yt(e._pt,t,s,0,0,pk);return o.u=i,o.pr=-10,o.tween=r,e._props.push(s),1}}},_r=[1,0,0,1,0,0],Kd={},Jd=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},gu=function(e){var t=is(e,Le);return Jd(t)?_r:t.substr(7).match(od).map(qe)},rl=function(e,t){var s=e._gsap||gn(e),i=e.style,r=gu(e),o,a,c,l;return s.svg&&e.getAttribute("transform")?(c=e.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"?_r:r):(r===_r&&!e.offsetParent&&e!==Qn&&!s.svg&&(c=i.display,i.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(l=1,a=e.nextElementSibling,Qn.appendChild(e)),r=gu(e),c?i.display=c:En(e,"display"),l&&(a?o.insertBefore(e,a):o?o.appendChild(e):Qn.removeChild(e))),t&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},rc=function(e,t,s,i,r,o){var a=e._gsap,c=r||rl(e,!0),l=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,d=a.yOffset||0,f=c[0],m=c[1],p=c[2],_=c[3],y=c[4],k=c[5],w=t.split(" "),v=parseFloat(w[0])||0,g=parseFloat(w[1])||0,S,T,x,b;s?c!==_r&&(T=f*_-m*p)&&(x=v*(_/T)+g*(-p/T)+(p*k-_*y)/T,b=v*(-m/T)+g*(f/T)-(f*k-m*y)/T,v=x,g=b):(S=Xd(e),v=S.x+(~w[0].indexOf("%")?v/100*S.width:v),g=S.y+(~(w[1]||w[0]).indexOf("%")?g/100*S.height:g)),i||i!==!1&&a.smooth?(y=v-l,k=g-u,a.xOffset=h+(y*f+k*p)-y,a.yOffset=d+(y*m+k*_)-k):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=g,a.smooth=!!i,a.origin=t,a.originIsAbsolute=!!s,e.style[xt]="0px 0px",o&&(Vs(o,a,"xOrigin",l,v),Vs(o,a,"yOrigin",u,g),Vs(o,a,"xOffset",h,a.xOffset),Vs(o,a,"yOffset",d,a.yOffset)),e.setAttribute("data-svg-origin",v+" "+g)},gr=function(e,t){var s=e._gsap||new Fd(e);if("x"in s&&!t&&!s.uncache)return s;var i=e.style,r=s.scaleX<0,o="px",a="deg",c=getComputedStyle(e),l=is(e,xt)||"0",u,h,d,f,m,p,_,y,k,w,v,g,S,T,x,b,A,R,M,L,q,Y,W,V,z,$,Q,te,N,F,C,P;return u=h=d=p=_=y=k=w=v=0,f=m=1,s.svg=!!(e.getCTM&&Qd(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(i[Le]=(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[Le]!=="none"?c[Le]:"")),i.scale=i.rotate=i.translate="none"),T=rl(e,s.svg),s.svg&&(s.uncache?(z=e.getBBox(),l=s.xOrigin-z.x+"px "+(s.yOrigin-z.y)+"px",V=""):V=!t&&e.getAttribute("data-svg-origin"),rc(e,V||l,!!V||s.originIsAbsolute,s.smooth!==!1,T)),g=s.xOrigin||0,S=s.yOrigin||0,T!==_r&&(R=T[0],M=T[1],L=T[2],q=T[3],u=Y=T[4],h=W=T[5],T.length===6?(f=Math.sqrt(R*R+M*M),m=Math.sqrt(q*q+L*L),p=R||M?Vn(M,R)*ln:0,k=L||q?Vn(L,q)*ln+p:0,k&&(m*=Math.abs(Math.cos(k*Kn))),s.svg&&(u-=g-(g*R+S*L),h-=S-(g*M+S*q))):(P=T[6],F=T[7],Q=T[8],te=T[9],N=T[10],C=T[11],u=T[12],h=T[13],d=T[14],x=Vn(P,N),_=x*ln,x&&(b=Math.cos(-x),A=Math.sin(-x),V=Y*b+Q*A,z=W*b+te*A,$=P*b+N*A,Q=Y*-A+Q*b,te=W*-A+te*b,N=P*-A+N*b,C=F*-A+C*b,Y=V,W=z,P=$),x=Vn(-L,N),y=x*ln,x&&(b=Math.cos(-x),A=Math.sin(-x),V=R*b-Q*A,z=M*b-te*A,$=L*b-N*A,C=q*A+C*b,R=V,M=z,L=$),x=Vn(M,R),p=x*ln,x&&(b=Math.cos(x),A=Math.sin(x),V=R*b+M*A,z=Y*b+W*A,M=M*b-R*A,W=W*b-Y*A,R=V,Y=z),_&&Math.abs(_)+Math.abs(p)>359.9&&(_=p=0,y=180-y),f=qe(Math.sqrt(R*R+M*M+L*L)),m=qe(Math.sqrt(W*W+P*P)),x=Vn(Y,W),k=Math.abs(x)>2e-4?x*ln:0,v=C?1/(C<0?-C:C):0),s.svg&&(V=e.getAttribute("transform"),s.forceCSS=e.setAttribute("transform","")||!Jd(is(e,Le)),V&&e.setAttribute("transform",V))),Math.abs(k)>90&&Math.abs(k)<270&&(r?(f*=-1,k+=p<=0?180:-180,p+=p<=0?180:-180):(m*=-1,k+=k<=0?180:-180)),t=t||s.uncache,s.x=u-((s.xPercent=u&&(!t&&s.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-u)?-50:0)))?e.offsetWidth*s.xPercent/100:0)+o,s.y=h-((s.yPercent=h&&(!t&&s.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*s.yPercent/100:0)+o,s.z=d+o,s.scaleX=qe(f),s.scaleY=qe(m),s.rotation=qe(p)+a,s.rotationX=qe(_)+a,s.rotationY=qe(y)+a,s.skewX=k+a,s.skewY=w+a,s.transformPerspective=v+o,(s.zOrigin=parseFloat(l.split(" ")[2])||!t&&s.zOrigin||0)&&(i[xt]=No(l)),s.xOffset=s.yOffset=0,s.force3D=Ot.force3D,s.renderTransform=s.svg?_k:$d?ef:mk,s.uncache=0,s},No=function(e){return(e=e.split(" "))[0]+" "+e[1]},Aa=function(e,t,s){var i=nt(t);return qe(parseFloat(t)+parseFloat(Js(e,"x",s+"px",i)))+i},mk=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,ef(e,t)},an="0deg",Ni="0px",cn=") ",ef=function(e,t){var s=t||this,i=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,m=s.scaleX,p=s.scaleY,_=s.transformPerspective,y=s.force3D,k=s.target,w=s.zOrigin,v="",g=y==="auto"&&e&&e!==1||y===!0;if(w&&(h!==an||u!==an)){var S=parseFloat(u)*Kn,T=Math.sin(S),x=Math.cos(S),b;S=parseFloat(h)*Kn,b=Math.cos(S),o=Aa(k,o,T*b*-w),a=Aa(k,a,-Math.sin(S)*-w),c=Aa(k,c,x*b*-w+w)}_!==Ni&&(v+="perspective("+_+cn),(i||r)&&(v+="translate("+i+"%, "+r+"%) "),(g||o!==Ni||a!==Ni||c!==Ni)&&(v+=c!==Ni||g?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+cn),l!==an&&(v+="rotate("+l+cn),u!==an&&(v+="rotateY("+u+cn),h!==an&&(v+="rotateX("+h+cn),(d!==an||f!==an)&&(v+="skew("+d+", "+f+cn),(m!==1||p!==1)&&(v+="scale("+m+", "+p+cn),k.style[Le]=v||"translate(0, 0)"},_k=function(e,t){var s=t||this,i=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,m=s.xOrigin,p=s.yOrigin,_=s.xOffset,y=s.yOffset,k=s.forceCSS,w=parseFloat(o),v=parseFloat(a),g,S,T,x,b;c=parseFloat(c),l=parseFloat(l),u=parseFloat(u),u&&(u=parseFloat(u),l+=u,c+=u),c||l?(c*=Kn,l*=Kn,g=Math.cos(c)*h,S=Math.sin(c)*h,T=Math.sin(c-l)*-d,x=Math.cos(c-l)*d,l&&(u*=Kn,b=Math.tan(l-u),b=Math.sqrt(1+b*b),T*=b,x*=b,u&&(b=Math.tan(u),b=Math.sqrt(1+b*b),g*=b,S*=b)),g=qe(g),S=qe(S),T=qe(T),x=qe(x)):(g=h,x=d,S=T=0),(w&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(w=Js(f,"x",o,"px"),v=Js(f,"y",a,"px")),(m||p||_||y)&&(w=qe(w+m-(m*g+p*T)+_),v=qe(v+p-(m*S+p*x)+y)),(i||r)&&(b=f.getBBox(),w=qe(w+i/100*b.width),v=qe(v+r/100*b.height)),b="matrix("+g+","+S+","+T+","+x+","+w+","+v+")",f.setAttribute("transform",b),k&&(f.style[Le]=b)},gk=function(e,t,s,i,r){var o=360,a=tt(r),c=parseFloat(r)*(a&&~r.indexOf("rad")?ln:1),l=c-i,u=i+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*du)%o-~~(l/o)*o:h==="ccw"&&l>0&&(l=(l-o*du)%o-~~(l/o)*o)),e._pt=d=new yt(e._pt,t,s,i,l,ek),d.e=u,d.u="deg",e._props.push(s),d},vu=function(e,t){for(var s in t)e[s]=t[s];return e},vk=function(e,t,s){var i=vu({},s._gsap),r="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,l,u,h,d,f,m;i.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),o[Le]=t,a=gr(s,1),En(s,Le),s.setAttribute("transform",l)):(l=getComputedStyle(s)[Le],o[Le]=t,a=gr(s,1),o[Le]=l);for(c in Es)l=i[c],u=a[c],l!==u&&r.indexOf(c)<0&&(f=nt(l),m=nt(u),h=f!==m?Js(s,c,l,m):parseFloat(l),d=parseFloat(u),e._pt=new yt(e._pt,a,c,h,d-h,sc),e._pt.u=m||0,e._props.push(c));vu(a,i)};vt("padding,margin,Width,Radius",function(n,e){var t="Top",s="Right",i="Bottom",r="Left",o=(e<3?[t,s,i,r]:[t+r,t+s,i+s,i+r]).map(function(a){return e<2?n+a:"border"+a+n});Io[e>1?"border"+n:n]=function(a,c,l,u,h){var d,f;if(arguments.length<4)return d=o.map(function(m){return vs(a,m,l)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(u+"").split(" "),f={},o.forEach(function(m,p){return f[m]=d[p]=d[p]||d[(p-1)/2|0]}),a.init(c,f,h)}});var tf={name:"css",register:ic,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,s,i,r){var o=this._props,a=e.style,c=s.vars.startAt,l,u,h,d,f,m,p,_,y,k,w,v,g,S,T,x;sl||ic(),this.styles=this.styles||Zd(e),x=this.styles.props,this.tween=s;for(p in t)if(p!=="autoRound"&&(u=t[p],!(St[p]&&Ud(p,t,s,i,e,r)))){if(f=typeof u,m=Io[p],f==="function"&&(u=u.call(s,i,e,r),f=typeof u),f==="string"&&~u.indexOf("random(")&&(u=fr(u)),m)m(this,e,p,u,s)&&(T=1);else if(p.substr(0,2)==="--")l=(getComputedStyle(e).getPropertyValue(p)+"").trim(),u+="",Ws.lastIndex=0,Ws.test(l)||(_=nt(l),y=nt(u)),y?_!==y&&(l=Js(e,p,l,y)+y):_&&(u+=_),this.add(a,"setProperty",l,u,i,r,0,0,p),o.push(p),x.push(p,0,a[p]);else if(f!=="undefined"){if(c&&p in c?(l=typeof c[p]=="function"?c[p].call(s,i,e,r):c[p],tt(l)&&~l.indexOf("random(")&&(l=fr(l)),nt(l+"")||l==="auto"||(l+=Ot.units[p]||nt(vs(e,p))||""),(l+"").charAt(1)==="="&&(l=vs(e,p))):l=vs(e,p),d=parseFloat(l),k=f==="string"&&u.charAt(1)==="="&&u.substr(0,2),k&&(u=u.substr(2)),h=parseFloat(u),p in ss&&(p==="autoAlpha"&&(d===1&&vs(e,"visibility")==="hidden"&&h&&(d=0),x.push("visibility",0,a.visibility),Vs(this,a,"visibility",d?"inherit":"hidden",h?"inherit":"hidden",!h)),p!=="scale"&&p!=="transform"&&(p=ss[p],~p.indexOf(",")&&(p=p.split(",")[0]))),w=p in Es,w){if(this.styles.save(p),v||(g=e._gsap,g.renderTransform&&!t.parseTransform||gr(e,t.parseTransform),S=t.smoothOrigin!==!1&&g.smooth,v=this._pt=new yt(this._pt,a,Le,0,1,g.renderTransform,g,0,-1),v.dep=1),p==="scale")this._pt=new yt(this._pt,g,"scaleY",g.scaleY,(k?Xn(g.scaleY,k+h):h)-g.scaleY||0,sc),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){x.push(xt,0,a[xt]),u=fk(u),g.svg?rc(e,u,0,S,0,this):(y=parseFloat(u.split(" ")[2])||0,y!==g.zOrigin&&Vs(this,g,"zOrigin",g.zOrigin,y),Vs(this,a,p,No(l),No(u)));continue}else if(p==="svgOrigin"){rc(e,u,1,S,0,this);continue}else if(p in Kd){gk(this,g,p,d,k?Xn(d,k+u):u);continue}else if(p==="smoothOrigin"){Vs(this,g,"smooth",g.smooth,u);continue}else if(p==="force3D"){g[p]=u;continue}else if(p==="transform"){vk(this,u,e);continue}}else p in a||(p=di(p)||p);if(w||(h||h===0)&&(d||d===0)&&!JT.test(u)&&p in a)_=(l+"").substr((d+"").length),h||(h=0),y=nt(u)||(p in Ot.units?Ot.units[p]:_),_!==y&&(d=Js(e,p,l,y)),this._pt=new yt(this._pt,w?g:a,p,d,(k?Xn(d,k+h):h)-d,!w&&(y==="px"||p==="zIndex")&&t.autoRound!==!1?sk:sc),this._pt.u=y||0,_!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=tk);else if(p in a)dk.call(this,e,p,l,k?k+u:u);else if(p in e)this.add(e,p,l||e[p],k?k+u:u,i,r);else if(p!=="parseTransform"){Yc(p,u);continue}w||(p in a?x.push(p,0,a[p]):x.push(p,1,l||e[p])),o.push(p)}}T&&Hd(this)},render:function(e,t){if(t.tween._time||!nl())for(var s=t._pt;s;)s.r(e,s.d),s=s._next;else t.styles.revert()},get:vs,aliases:ss,getSetter:function(e,t,s){var i=ss[t];return i&&i.indexOf(",")<0&&(t=i),t in Es&&t!==xt&&(e._gsap.x||vs(e,"x"))?s&&hu===s?t==="scale"?ok:rk:(hu=s||{})&&(t==="scale"?ak:ck):e.style&&!qc(e.style[t])?nk:~t.indexOf("-")?ik:el(e,t)},core:{_removeProperty:En,_getMatrix:rl}};kt.utils.checkPrefix=di;kt.core.getStyleSaver=Zd;(function(n,e,t,s){var i=vt(n+","+e+","+t,function(r){Es[r]=1});vt(e,function(r){Ot.units[r]="deg",Kd[r]=1}),ss[i[13]]=n+","+e,vt(s,function(r){var o=r.split(":");ss[o[1]]=i[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");vt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){Ot.units[n]="px"});kt.registerPlugin(tf);var sf=kt.registerPlugin(tf)||kt;sf.core.Tween;const nf=D.forwardRef(({source:n,target:e,isSelected:t,lineWidth:s,visible:i},r)=>(D.useEffect(()=>{const o=r.current;o&&sf.fromTo(o.material,{linewidth:5},{linewidth:t?2:s,duration:1})},[t,s,r]),U.jsx(Of,{ref:r,color:"rgba(136, 136, 136, 1)",isLine2:!0,lineWidth:1,opacity:1,points:[n,e],transparent:!0,visible:i})));nf.displayName="LineComponent";const rf=D.memo(({linksPositions:n})=>{const e=On(r=>r.dataInitial),{showSelectionGraph:t}=ht(r=>r),s=cs(),i=D.useRef([]);return U.jsx("group",{name:"simulation-3d-group__connections",children:e==null?void 0:e.links.map((r,o)=>{var h,d,f,m,p,_;const a=new le(((h=n[o])==null?void 0:h.sx)||0,((d=n[o])==null?void 0:d.sy)||0,((f=n[o])==null?void 0:f.sz)||0),c=new le(((m=n[o])==null?void 0:m.tx)||0,((p=n[o])==null?void 0:p.ty)||0,((_=n[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 U.jsx(nf,{ref:y=>{i.current[o]=y},isSelected:l,lineWidth:u,source:a,target:c,visible:!t},r.ref_id)})})});rf.displayName="Connections";const Dr={metalness:.9,roughness:0},yk={...Dr};new xr(yk);const of=new Lo,Fo=of.load("noimage.jpeg"),yu=new xr({...Dr,map:Fo}),af=.4,xk=new xr({...Dr,map:Fo,transparent:!0,opacity:af}),Kr={},Tk=(n,e)=>{const[t,s]=D.useState(Fo),[i,r]=D.useState(yu);return D.useEffect(()=>{const o=`${n}${e&&"-transparent"}`;if(Kr[o]){s(Kr[o].texture),r(Kr[o].material);return}of.load(n,a=>{const c=new xr({map:a,transparent:e,opacity:e?af:1,...Dr});Kr[o]={texture:a,material:c},s(a),r(c)},void 0,()=>{s(Fo),r(e?xk:yu)})},[n,e]),D.useEffect(()=>function(){t.dispose(),i.dispose()},[t,i]),i},ol=D.memo(({node:n,hide:e,animated:t})=>{const s=D.useRef(null),[i]=D.useState(su),r=cs(),{showSelectionGraph:o}=ht(u=>u),a=!!r&&n.ref_id===r.ref_id,c=Tk(n.image_url||"noimage.jpeg",!1);Bt((u,h)=>{t&&s.current&&a&&(s.current.rotation.y+=h*1,s.current.rotation.x-=h*.6)}),D.useEffect(()=>function(){i.dispose()},[i]);const l=D.useMemo(()=>o&&a?20:a?(n.scale||1)*1.2:n.scale,[n,a,o]);return U.jsx(Lu,{enabled:!!a,children:U.jsx("mesh",{ref:s,geometry:su,material:c,name:n.id,scale:l,userData:n,visible:!e})})});ol.displayName="Cube";const kk=Ye(Os)` - text-align: center; - width: ${n=>n.type==="topic"?"auto":`${n.size}px`}; - height: ${n=>n.type==="topic"?"auto":`${n.size}px`}; - outline: 1px solid ${n=>Oe.white||n.color}; - outline-offset: 0px; - background: rgba(0, 0, 0, 0.75); - color: ${n=>n.fontColor}; - border-radius: ${n=>`${n.type==="guest"?"100%":"6px"}`}; - font-size: ${n=>`${n.fontSize}px`}; - cursor: pointer; - transition: font-size 0.4s, outline 0.4s; - transform: scale(${n=>n.scale}); - align-items: center; - justify-content: center; - font-family: Barlow; - font-size: 26px; - font-style: normal; - font-weight: 700; - text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); - - &:hover { - outline-offset: 4px; - } - - &.selected { - .badge-wrapper { - top: 0; - } - - font-size: 36px; - - &:hover { - outline-offset: 0px; - } - } - - &.topic { - outline: none; - background: none; - &:hover { - font-size: 36px; - } - white-space: nowrap; - .badge-wrapper { - display: none; - } - } - - .badge-wrapper { - position: absolute; - top: -7px; - left: -14px; - } -`,wk=Ye(Os)` - text-align: center; - outline: 1px solid ${Oe.white}; - outline-offset: 0px; - white-space: nowrap; - padding: 4px; - background: rgba(0, 0, 0, 0.75); - color: ${Oe.white}; - border-radius: 6px; - font-size: 20px; - cursor: pointer; - transition: font-size 0.4s, outline 0.4s; - align-items: center; - justify-content: flex-start; - font-family: Barlow; - font-size: 26px; - font-style: normal; - font-weight: 700; - text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); - max-width: auto; - max-height: 100px; - white-space: normal; - font-size: 16px; - - &:hover { - outline-offset: 4px; - } - - &.selected { - .badge-wrapper { - top: 0; - } - - font-size: 36px; - - &:hover { - outline-offset: 0px; - } - } - - &.topic { - outline: none; - background: none; - &:hover { - font-size: 36px; - } - white-space: nowrap; - .badge-wrapper { - display: none; - } - } - - .badge-wrapper { - position: absolute; - top: -7px; - left: -14px; - } -`;Ye.img` - background-image: ${({src:n})=>`url(${n})`}; - background-size: contain; - background-repeat: no-repeat; - width: ${n=>n.size}px; - height: ${n=>n.size}px; - border-radius: ${n=>n.borderRadius}; -`;Ye.div` - display: flex; - position: absolute; - bottom: -14px; - left: -5px; - width: auto; - justify-content: center; - align-items: center; -`;Ye.div` - display: flex; - justify-content: center; - align-items: center; - background: ${Oe.transparentBlack}; - border: 2px solid ${n=>n.color}; - color: #fff; - padding: 0 4px; - min-width: 30px; - height: 26px; - font-size: 12px; - font-weight: 500; - border-radius: 6px; - margin-right: 5px; -`;Ye.div` - display: flex; - justify-content: center; - align-items: center; - border: 2px solid ${n=>n.color}44; - background: ${Oe.transparentBlack}; - padding: 0 4px; - color: ${n=>n.color}; - min-width: 30px; - height: 26px; - font-size: 12px; - font-weight: 500; - border-radius: 6px; - margin-right: 5px; -`;const Sk=new le,bk=({position:n,userData:e,color:t})=>{const s=D.useRef(null),{selectedNode:i,setSelectedNode:r,showSelectionGraph:o,hoveredNode:a,setHoveredNode:c}=ht(lc(f=>f)),l=((e==null?void 0:e.node_type)||"")==="Topic"||!!e.name,u=((e==null?void 0:e.node_type)||"")==="Guest"||((e==null?void 0:e.node_type)||"")==="Person";Bt(()=>{if(o&&s.current){const f=Sk.set((e==null?void 0:e.x)||0,(e==null?void 0:e.y)||0,(e==null?void 0:e.z)||0);s.current.position.copy(f)}}),D.useEffect(()=>function(){s.current&&s.current.clear()},[s]);const h=D.useMemo(()=>(a==null?void 0:a.ref_id)===(e==null?void 0:e.ref_id),[a==null?void 0:a.ref_id,e==null?void 0:e.ref_id]),d=(i==null?void 0:i.ref_id)===(e==null?void 0:e.ref_id);return l||d&&o||!d?U.jsx("group",{ref:s,position:n,children:U.jsx(yr,{center:!0,sprite:!0,zIndexRange:[0,0],children:l?U.jsxs(wk,{direction:"column",onClick:f=>{f.stopPropagation(),e&&r(e)},onPointerOut:f=>{f.stopPropagation()},onPointerOver:f=>{f.stopPropagation()},children:[U.jsx("div",{className:"badge-wrapper",children:U.jsx(pl,{type:(e==null?void 0:e.node_type)||""})}),Cu(e==null?void 0:e.name,20)]}):U.jsxs(kk,{className:Su(e==null?void 0:e.node_type,{selected:d}),color:t,fontColor:Oe.white,fontSize:l?64:20,onClick:f=>{f.stopPropagation(),e&&r(e)},onPointerOut:f=>{f.stopPropagation()},onPointerOver:f=>{f.stopPropagation()},scale:h?1.05:1,selected:!1,size:d?68:40,type:(e==null?void 0:e.node_type)||"",children:[!u&&!l?U.jsx("div",{className:"badge-wrapper",children:U.jsx(pl,{type:(e==null?void 0:e.node_type)||""})}):null,e!=null&&e.name?e==null?void 0:e.name:U.jsx(ap,{rounded:u,size:d?60:52,src:(e==null?void 0:e.image_url)||"audio_default.svg",type:e==null?void 0:e.node_type})]})})}):null},cf=D.memo(()=>{const{simulation:n,showSelectionGraph:e,selectedNode:t,selectionGraphData:s}=ht(lc(o=>o)),i=Bo(),r=D.useMemo(()=>{const o=(n==null?void 0:n.nodes())||[];return(e?s.nodes:o).filter(u=>i.includes((u==null?void 0:u.ref_id)||"")||(t==null?void 0:t.ref_id)===(u==null?void 0:u.ref_id)).slice(0,Xx).map(u=>{const h=bu(u.node_type||"",!0),d=new le((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,(u==null?void 0:u.z)||0),f=o.filter(m=>m.ref_id&&Qx(m,u)).map(m=>(m==null?void 0:m.ref_id)||"")||[];return U.jsx(bk,{color:h,position:d,relativeIds:f,userData:u},`node-badge-${u.ref_id}`)})},[n,e,s.nodes,i,t==null?void 0:t.ref_id]);return U.jsx(D.Fragment,{children:r.length?r:null},"node-badges")});cf.displayName="RelevanceBadges";const xu=cp().stop(),wt={numDimensions:3,velocityDecay:.9,forceChargeStrength:-20,forceChargeMinDistance:10,forceChargeMaxDistance:8e3,forceLinkStrength:.04,forceCenterStrength:.85,disableCollide:!1,disableCenter:!1,disableLink:!1,disableCharge:!1,forceCollideRadiusMethod:n=>(n.edge_count||1)*6+200,forceLinkDistanceMethod:n=>{const e=n.source.node_type;let t=50;switch(e){case"topic":t=30;break;case"guest":t=30;break;case"clip":t=10;break;case"episode":t=15;break}return t*2/50}},Ck=(n,e,{numDimensions:t=wt.numDimensions,velocityDecay:s=wt.velocityDecay,forceChargeStrength:i=wt.forceChargeStrength,forceChargeMinDistance:r=wt.forceChargeMinDistance,forceChargeMaxDistance:o=wt.forceChargeMaxDistance,forceLinkStrength:a=wt.forceLinkStrength,forceCenterStrength:c=wt.forceCenterStrength,forceLinkDistanceMethod:l=wt.forceLinkDistanceMethod,forceCollideRadiusMethod:u=wt.forceCollideRadiusMethod,disableCollide:h=wt.disableCollide,disableCenter:d=wt.disableCenter,disableLink:f=wt.disableLink,disableCharge:m=wt.disableCharge})=>(xu.alpha(1).stop().numDimensions(t).velocityDecay(s).force("collide",h?null:lp().radius(u).iterations(1)).force("center",d?null:up().strength(c)).force("charge",m?null:hp().strength(i).distanceMin(r).distanceMax(o)).nodes(n).force("link",f?null:dp(e).id(p=>p.ref_id).distance(l).strength(a)).alpha(1).restart(),xu),Ek=({link:n,animated:e})=>{const t=D.useRef(null),s=cs(),[i,r]=D.useState(new le(0,0,0)),[o,a]=D.useState(new le(0,0,0)),[c,l]=D.useState(8947848),u=ht(h=>h.selectionGraphData);return D.useEffect(()=>{var f,m,p,_,y,k;const h=(s==null?void 0:s.ref_id)||"",d=s&&(h===n.target||h===n.source);!n.onlyVisibleOnSelect||d?(r(new le(((f=n.sourcePosition)==null?void 0:f.x)||0,((m=n.sourcePosition)==null?void 0:m.y)||0,((p=n.sourcePosition)==null?void 0:p.z)||0)),a(new le(((_=n.targetPosition)==null?void 0:_.x)||0,((y=n.targetPosition)==null?void 0:y.y)||0,((k=n.targetPosition)==null?void 0:k.z)||0))):(r(new le(0,0,0)),a(new le(0,0,0))),l(d?n.color||mf.children.segmentColor:s?5592405:8947848)},[s,n]),Bt(()=>{if(e&&t.current){const h=u.nodes.find(f=>f.ref_id===n.source),d=u.nodes.find(f=>f.ref_id===n.target);t.current.start.set((h==null?void 0:h.x)||0,(h==null?void 0:h.y)||0,(h==null?void 0:h.z)||0),t.current.end.set((d==null?void 0:d.x)||0,(d==null?void 0:d.y)||0,(d==null?void 0:d.z)||0)}}),U.jsx(U.Fragment,{children:U.jsx(Zp,{ref:t,color:"0xFFFFFF",end:o,start:i})})},Ok=({links:n,simulation:e})=>{const t=D.useRef(null);return D.useEffect(()=>function(){t.current&&t.current.clear()},[t]),Bt(()=>{if(t.current){const s=e.nodes();t.current.children.forEach((r,o)=>{var u;const a=n[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)})}}),n.length?U.jsx("group",{ref:t,children:n.map(s=>U.jsx("mesh",{children:U.jsx(yr,{center:!0,sprite:!0,children:U.jsxs(Ak,{direction:"row",justify:"center",onClick:i=>{i.stopPropagation()},onPointerOut:i=>{i.stopPropagation()},onPointerOver:i=>{i.stopPropagation()},children:[U.jsx("span",{children:s.edge_type}),U.jsx(Os,{className:"icon",children:U.jsx(fp,{})})]})})},s.ref_id))}):null},Ak=Ye(Os)` - text-align: center; - - outline-offset: 0px; - background: rgba(0, 0, 0, 0.75); - color: #eee; - cursor: pointer; - transition: font-size 0.4s, outline 0.4s; - align-items: center; - justify-content: center; - font-family: Barlow; - font-size: 12px; - font-style: normal; - font-weight: 700; - text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); - - &:hover { - outline-offset: 4px; - span { - opacity: 0.1; - } - - .icon { - display: flex; - } - } - - .icon { - position: absolute; - width: 24px; - height: 24px; - /* bottom: 100%; */ - display: none; - color: #000; - border-radius: 40px; - justify-content: center; - align-items: center; - background: #ffffff; - color: #000; - border-radius: 100%; - font-size: 16px; - cursor: pointer; - transition: opacity 0.4s; - box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.5); - } - - .badge-wrapper { - position: absolute; - top: -7px; - left: -14px; - } -`,Mk=n=>{const e=/(?:[\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 n.replace(e,t=>/^[\d*#]$/.test(t)?t:"")},Pk=["#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 Dk(n){const e=Cu(n,30),t=e.split(" ");if(n.split(" ").length<=5)return e;const s=Math.ceil(t.length/3),i=s*2,r=t.slice(0,s).join(" "),o=t.slice(s,i).join(" "),a=t.slice(i).join(" ");return`${r} -${o} -${a}`}const al=D.memo(({node:n,hide:e})=>{var g,S;const t=D.useRef(null),s=D.useRef(null),i=cs(),r=pp(),a=Bo().includes((n==null?void 0:n.ref_id)||""),c=!!i&&(i==null?void 0:i.ref_id)===n.ref_id,l=!!r&&(r==null?void 0:r.ref_id)===n.ref_id,u=ht(T=>T.showSelectionGraph),{normalizedSchemasByType:h}=_f(T=>T),d=gf();Bt(({camera:T})=>{t!=null&&t.current&&t.current.quaternion.copy(T.quaternion),s!=null&&s.current&&s.current.quaternion.copy(T.quaternion)});const f=D.useMemo(()=>{let T=(n.edge_count||1)*20;u&&c?T=40:!c&&a&&(T=0);const x=T/Math.sqrt(n.name.length);return T=Math.max(x,20),Math.min(T,30)},[n.edge_count,n.name,c,a,u]),m=D.useMemo(()=>i&&!c||r&&!l?.2:1,[c,i,l,r]),p=(g=h[n.node_type])==null?void 0:g.primary_color,_=(S=h[n.node_type])==null?void 0:S.icon,y=p??(Pk[d.indexOf(n.node_type)]||Oe.white),k=_?mp[_]:null,w=k?_:"AddCircleIcon",v=Mk(String(n.name));return U.jsx(U.Fragment,{children:k?U.jsx(Lu,{enabled:!!c,children:U.jsxs("mesh",{name:n.id,userData:n,visible:!e,children:[U.jsx("sphereGeometry",{args:[30,32,32],userData:n}),U.jsx("meshStandardMaterial",{...Dr,color:y}),U.jsx(zp,{ref:s,position:[20,20,20],scale:2,src:`svg-icons/${w}.svg`})]})}):U.jsx(Af,{ref:t,anchorX:"center",anchorY:"middle",color:y,fillOpacity:m,scale:f,userData:n,visible:!e,...Mf,children:Dk(v)})})});al.displayName="TextNode";const lf=D.memo(()=>{const[n,e]=D.useState(null),{dataInitial:t}=On(l=>l),s=cs(),i=D.useRef(null),r=Bo(),o=Pf(t==null?void 0:t.nodes.length),{selectionGraphData:a,setSelectionData:c}=ht(lc(l=>l));return D.useEffect(()=>{const l=structuredClone((t==null?void 0:t.nodes)||[]),u=structuredClone((t==null?void 0:t.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(m=>m.ref_id===f.target)&&h.some(m=>m.ref_id===f.source));c({nodes:h,links:d})}},[t,s,r,c,o]),D.useEffect(()=>{if(n||!a.nodes.length)return;const l=structuredClone(a.links),u=Ck(a.nodes,l,{numDimensions:2,forceLinkStrength:.01,forceCenterStrength:.85,forceChargeStrength:-20,velocityDecay:.9});e(u)},[a,n]),D.useEffect(()=>()=>{c({nodes:[],links:[]})},[c]),D.useEffect(()=>{n&&n.on("tick",()=>{i.current&&i.current.children.forEach((u,h)=>{const d=n.nodes()[h];d&&u.position.set(d.x,d.y,d.z)})})},[n]),console.log(a.nodes),U.jsxs(U.Fragment,{children:[U.jsx("group",{ref:i,name:"simulation-2d-group",children:a==null?void 0:a.nodes.map(l=>U.jsx("mesh",{children:l.name?U.jsx(al,{hide:!0,node:l},l.ref_id||l.id):U.jsx(ol,{hide:!0,node:l},l.ref_id||l.id)},l.ref_id))}),U.jsx(Wp,{fog:!0,lineWidth:.9,children:(a==null?void 0:a.links).map((l,u)=>U.jsx(Ek,{animated:!0,link:l},u.toString()))},`selection-links-${a==null?void 0:a.links.length}`),n&&U.jsx(Ok,{links:a.links,simulation:n})]})});lf.displayName="SelectionDataNodes";const Rk=200,uf=D.memo(()=>{const n=cs(),e=Bo(),{selectionGraphData:t,showSelectionGraph:s,setHoveredNode:i,setIsHovering:r}=ht(m=>m),o=On(m=>m.dataInitial),a=vr(m=>m.setTranscriptOpen),c=D.useCallback(m=>!!(s&&!t.nodes.find(p=>p.ref_id===m.ref_id)),[s,t]),l=D.useCallback(m=>{const p=m==null?void 0:m[0];p&&(a(!1),p.userData&&(c(p.userData)||ht.getState().setSelectedNode((p==null?void 0:p.userData)||null)))},[a,c]),u=D.useRef(null),h=D.useCallback(m=>{m.stopPropagation(),r(!1),i(null),u.current&&(clearTimeout(u.current),u.current=null)},[r,i]),d=D.useCallback(m=>{var y;const _=m.intersections.map(k=>k.object)[0];if((y=_==null?void 0:_.userData)!=null&&y.ref_id){const k=_.userData;c(k)||(m.stopPropagation(),r(!0),u.current=setTimeout(()=>{i(k)},Rk))}},[i,c,r]),f=s&&!!n;return U.jsxs(Bp,{filter:m=>m.filter(p=>{var _;return!!((_=p.userData)!=null&&_.ref_id)}),onChange:l,onPointerOut:h,onPointerOver:d,children:[!1,U.jsx(cf,{}),U.jsx("group",{name:"simulation-3d-group__nodes",children:o==null?void 0:o.nodes.map(m=>{const p=!!n&&(e.includes(m.ref_id)||n.ref_id===m.ref_id);return U.jsx("mesh",{children:m.name?U.jsx(al,{hide:f||p,node:m},m.ref_id||m.id):U.jsx(ol,{hide:f,node:m},m.ref_id||m.id)},m.ref_id)})}),f&&U.jsx(lf,{})]})});uf.displayName="Cubes";const Ik={earthRef:null},Nk=ku(n=>({...Ik,setEarthRef:e=>n({earthRef:e})})),Fk=new le(0,0,0),Uk=()=>{const n=D.useRef(null),e=D.useRef(null),{graphStyle:t,showSelectionGraph:s}=ht(a=>a),i=Nk(a=>a.setEarthRef),r=pn("textures/earth/galaxy.png"),o=pn("textures/earth/clouds.png");return Bt(({camera:a})=>{e.current&&e.current.position.copy(a.getWorldPosition(Fk))}),D.useLayoutEffect(()=>{n.current&&i(n)},[i]),t!=="earth"||s?null:U.jsxs(U.Fragment,{children:[U.jsxs("mesh",{ref:n,userData:{type:"earth"},children:[U.jsx("sphereGeometry",{args:[$r,200,200]}),U.jsx(Lk,{})]}),U.jsxs("mesh",{children:[U.jsx("sphereGeometry",{args:[$r+2,200,200]}),U.jsx("meshStandardMaterial",{alphaMap:o,map:o,transparent:!0})]}),U.jsxs("mesh",{children:[U.jsx("sphereGeometry",{args:[$r*4,200,200]}),U.jsx("meshStandardMaterial",{map:r,opacity:.4,side:hn,transparent:!0})]}),U.jsx("directionalLight",{ref:e,intensity:.9,position:[0,0,$r*3]})]})},Lk=()=>{const n=pn("textures/earth/earth.jpeg"),e=pn("textures/earth/bump.jpeg"),t=pn("textures/earth/water.png"),s=D.useMemo(()=>new xr({map:n,bumpMap:e,aoMap:e,roughnessMap:e,metalnessMap:t,toneMapped:!0,roughness:35,metalness:0}),[n,e,t]);return U.jsx("meshStandardMaterial",{...s})},Bk="C",zk=256,Vk=256,jk={g:"LottieFiles AE 0.1.20"},Hk=[{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}],qk="5.5.7",Gk=60,Wk=104,Yk=0,Zk=[{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}]}],$k={nm:Bk,h:zk,w:Vk,meta:jk,layers:Hk,v:qk,fr:Gk,op:Wk,ip:Yk,assets:Zk},Xk=({meshId:n})=>{const e=D.useRef(null);return D.useEffect(()=>{const t=document.getElementById(`lottie-animation-${n}`);return t&&(e.current=vf.loadAnimation({container:t,animationData:$k,loop:!0,autoplay:!0})),()=>{e.current&&e.current.destroy()}},[n]),U.jsx("div",{id:`lottie-animation-${n}`,style:{width:"2em",height:"2em"}})},Ma=()=>Math.floor(Math.random()*2001)-1e3,Qk=()=>U.jsx(U.Fragment,{children:["a","b","c"].map(n=>{const e=Ma(),t=Ma(),s=Ma();return U.jsx("mesh",{position:[e,t,s],children:U.jsx(yr,{center:!0,sprite:!0,children:U.jsx(Kk,{children:U.jsx(Xk,{meshId:n})})})},n)})}),Kk=Ye.div` - border: 2px solid white; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - color: white; - font-size: 20px; -`;Object.values(Df).map(n=>n);const Fi=n=>({close:{backgroundColor:"rgba(48, 51, 66, 1)",borderColor:"#fff",fontColor:"rgba(255, 255, 255, 1)"},focus:{backgroundColor:n?"rgba(255, 255, 255, 0.90);":"rgba(255, 255, 255, 0.90)",borderColor:n?"#FFDB58bb":"#fff",fontColor:"rgba(48, 51, 66, 1)"},menu:{backgroundColor:"#00000066",borderColor:n?"#ffffff66":"#5078f2",fontColor:n?"#ffffff66":"#fff"}}),Jk=new le,hf=D.memo(()=>{var T;const n=D.useRef(null),e=vr(x=>x.setSidebarOpen),[t,s]=ro.useState(null),{open:i}=Ur("editNodeName"),{open:r}=Ur("addEdgeToNode"),{open:o}=Ur("mergeToNode"),{open:a}=Ur("createBounty"),[c]=wu(x=>[x.isAdmin]),[l]=On(x=>[x.addNewNode]),u=cs(),{showSelectionGraph:h,selectionGraphData:d,setSelectedNode:f,setShowSelectionGraph:m}=ht(x=>x),p=Ep(),_=D.useCallback(async()=>{try{if(u!=null&&u.ref_id){const x=await yf(u==null?void 0:u.ref_id,d.nodes.length||0);x&&l(x)}}catch(x){console.log(x)}},[l,u==null?void 0:u.ref_id,d.nodes.length]);Bt(()=>{y()});const y=D.useCallback(()=>{const x=h?d:p;if(n.current){const b=x==null?void 0:x.nodes.find(A=>A.ref_id===(u==null?void 0:u.ref_id));if(b){const A=Jk.set(b==null?void 0:b.x,b==null?void 0:b.y,b==null?void 0:b.z);n.current.position.copy(A)}}},[u,h,d,p]),k=D.useMemo(()=>{const x=c?[{key:"control-key-1",colors:Fi(h).focus,icon:U.jsx(vp,{}),left:-80,className:"add",onClick:A=>{s(A.currentTarget)}},{key:"control-key-2",colors:Fi(h).focus,icon:U.jsx(yp,{}),left:-40,className:"edit",onClick:()=>{i()}}]:[],b=[{key:"control-key-4",colors:Fi(h).focus,icon:U.jsx(bp,{}),left:0,className:"expand",onClick:()=>{const A=!h;m(A),A&&e(!0)}},{key:"control-key-5",colors:Fi(!0).close,icon:U.jsx(xp,{}),left:40,className:"exit",onClick:()=>{_()}},{key:"control-key-6",colors:Fi(!0).close,icon:U.jsx(Cp,{}),left:40,className:"exit",onClick:()=>{m(!1),f(null)}}];return[...x,...b].map((A,R)=>({...A,left:-80+R*40}))},[c,h,i,m,e,_,f]);if(!u)return null;const w=()=>{s(null)},v=!!t,g=v?"simple-popover":void 0,S=!!(u&&((T=u==null?void 0:u.node_type)==null?void 0:T.toLowerCase())==="function");return U.jsx("group",{ref:n,children:U.jsxs(yr,{center:!0,className:"control-panel",onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),onPointerDown:x=>x.stopPropagation(),onPointerOut:x=>x.stopPropagation(),onPointerOver:x=>x.stopPropagation(),onPointerUp:x=>x.stopPropagation(),sprite:!0,zIndexRange:[16777271,16777272],children:[k.map(x=>U.jsx(ew,{backgroundColor:x.colors.backgroundColor,borderColor:x.colors.borderColor,className:x.className,fontColor:x.colors.fontColor,left:x.left,onClick:b=>{b.stopPropagation(),x.onClick(b)},children:x.icon},x.key)),S&&U.jsx(sw,{left:2,onClick:()=>{a()},children:"Create Test"}),U.jsxs(tw,{anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:g,onClose:w,open:v,transformOrigin:{vertical:"top",horizontal:"right"},children:[U.jsxs(Tu,{"data-testid":"merge",onClick:()=>{o(),w()},children:[U.jsx(_p,{"data-testid":"MergeIcon"})," Merge"]}),U.jsxs(Tu,{"data-testid":"add_edge",onClick:()=>{r(),w()},children:[U.jsx(gp,{"data-testid":"AddCircleIcon"})," Add edge"]})]})]})})});hf.displayName="NodeControls";const ew=Ye.div` - position: fixed; - top: -60px; - left: ${n=>-7+n.left}px; - width: 24px; - height: 24px; - - border-radius: 40px; - display: flex; - justify-content: center; - align-items: center; - background: ${n=>n.backgroundColor?n.backgroundColor:"#000000bb"}; - color: ${n=>n.fontColor?n.fontColor:"#ffffff"}; - border-radius: 100%; - font-size: 16px; - cursor: pointer; - transition: opacity 0.4s; - box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.5); -`,Tu=Ye(Os).attrs({direction:"row",px:12,py:8})` - display: flex; - align-items: center; - justify-content: start; - gap: 12px; - cursor: pointer; - background: ${Oe.BUTTON1}; - color: ${Oe.white}; - - &:hover { - background: ${Oe.BUTTON1_HOVER}; - color: ${Oe.GRAY3}; - } -`,tw=Ye(Tp)` - && { - z-index: 9999; - } - .MuiPaper-root { - min-width: 149px; - color: ${Oe.GRAY3}; - box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); - border-radius: 6px; - z-index: 1; - font-family: Barlow; - font-size: 14px; - font-weight: 500; - } -`,sw=Ye.div` - position: fixed; - top: 40px; - left: ${n=>-53+n.left}px; - width: 100px; - padding: 6px; - border-radius: 4px; - display: flex; - justify-content: center; - align-items: center; - background: ${Oe.createTestButton}; - color: ${Oe.black}; - font-size: 14px; - font-family: Barlow; - font-weight: 600; - cursor: pointer; - &:hover { - transform: scale(1.05); - } -`,df=D.memo(()=>U.jsx(U.Fragment,{children:U.jsx(hf,{})}));df.displayName="NodeDetailsPanel";const nw=()=>{const{dataInitial:n,isLoadingNew:e,isFetching:t,dataNew:s,resetDataNew:i}=On(m=>m),r=D.useRef(null),o=D.useRef(!1),a=D.useRef([]),{setData:c,simulation:l,simulationCreate:u,simulationHelpers:h,graphStyle:d,setGraphRadius:f}=ht(m=>m);return D.useEffect(()=>{if(!s)return;const m=s.nodes||[],p=s.links||[],_=structuredClone(m),y=structuredClone(p);if(l){const k=xf.isEqual(s,n);h.addNodesAndLinks(_,y,k)}l||u(_,y),i()},[c,s,l,u,i,h,n]),D.useEffect(()=>{l&&h.setForces()},[d,h,l]),D.useEffect(()=>{l&&(l.on("tick",()=>{if(!o.current&&l.alpha()<.1){const m=l.nodes().map(k=>new le(k.x,k.y,k.z)),p=new hl().setFromPoints(m),_=new dl;p.getBoundingSphere(_);const y=Math.min(5e3,_.radius);f(y),o.current=!0}if(r.current){const m=r.current.getObjectByName("simulation-3d-group__nodes"),p=r.current.getObjectByName("simulation-3d-group__connections");m.children.forEach((_,y)=>{const k=l.nodes()[y];k&&_.position.set(k.x,k.y,k.z)}),p.children.forEach((_,y)=>{const k=n==null?void 0:n.links[y],w=_;if(k){const v=l.nodes().find(L=>L.ref_id===k.source),g=l.nodes().find(L=>L.ref_id===k.target),{x:S,y:T,z:x}=v,{x:b,y:A,z:R}=g;a.current[y]={sx:S,sy:T,sz:x,tx:b,ty:A,tz:R},w.geometry.setPositions([S,T,x,b,A,R]);const{material:M}=w;M.color=new ys("white"),M.transparent=!0,M.opacity=.1}})}}),l.on("end",()=>{const m=l.nodes().map(k=>new le(k.x,k.y,k.z)),p=new hl().setFromPoints(m),_=new dl;p.getBoundingSphere(_);const y=_.radius;f(y),o.current=!1}))},[n,l,f]),l?U.jsxs("group",{ref:r,children:[U.jsx(uf,{}),U.jsx(Uk,{}),!1,(e||t)&&U.jsx(Qk,{}),d!=="earth"&&U.jsx(rf,{linksPositions:a.current}),U.jsx(df,{})]}):null},iw=({fullSize:n=!0})=>{const e=vr(t=>t.sidebarIsOpen);return U.jsx(rw,{align:"center",className:Su({"sidebar-is-open":e&&!n}),justify:"center",children:U.jsx(Op,{color:Oe.SECONDARY_BLUE,size:64})})},rw=Ye(Os)` - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; - background-color: ${Oe.black}; - z-index: 1; -`,ow=()=>U.jsx(yr,{children:U.jsx(Ip,{})}),aw=()=>{const{universeColor:n}=wp("universe",{universeColor:Oe.black}),e=cs(),t=D.useMemo(()=>e!=null&&e.node_type?bu(e.node_type):$x,[e]);return U.jsxs(U.Fragment,{children:[U.jsx("color",{args:[n],attach:"background"}),U.jsx(Nf,{}),U.jsx(iT,{}),U.jsxs(Kp,{children:[U.jsxs(Pm,{autoClear:!1,multisampling:8,children:[U.jsx(Nm,{darkness:.7,eskil:!1,offset:.05}),U.jsx(Rm,{luminanceThreshold:1,mipmapBlur:!0,resolutionX:Be.AUTO_SIZE,resolutionY:Be.AUTO_SIZE}),U.jsx(Im,{blendFunction:pe.SCREEN,blur:!0,edgeStrength:4,hiddenEdgeColor:t,visibleEdgeColor:t})]}),U.jsx(nw,{})]})]})};let Pa=null;const cw={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[zi.x,zi.y,zi.z]},lw=()=>{const[n,e,t]=[Hs(a=>a.setIsUserScrollingOnHtmlPanel),Hs(a=>a.setIsUserScrolling),Hs(a=>a.setUserMovedCamera)],s=On(a=>a.isFetching),i=vr(a=>a.universeQuestionIsOpen),r=D.useCallback(a=>{var u;const{target:c}=a,{offsetParent:l}=c;Pa&&clearTimeout(Pa),(u=l==null?void 0:l.classList)!=null&&u.contains("html-panel")&&l.clientHeight{e(!1),n(!1)},200)},[e,n,t]),o=D.useCallback(a=>Tf(a,"threeState"),[]);return U.jsxs(uw,{children:[U.jsx(D.Suspense,{fallback:null,children:U.jsxs(Rf,{camera:cw,id:"universe-canvas",onCreated:o,onWheel:r,children:[kf&&U.jsx(If,{position:"bottom-right"}),U.jsxs(D.Suspense,{fallback:U.jsx(ow,{}),children:[U.jsx($p,{}),U.jsx(Xp,{}),U.jsx(Qp,{}),U.jsx(aw,{})]})]})}),i&&U.jsx(Um,{}),s&&U.jsx(iw,{fullSize:!1}),U.jsx(kp,{})]})},uw=Ye(Os)` - flex: 1 1 100%; - position: relative; -`,$w=D.memo(lw);export{$w as Universe}; diff --git a/build/assets/index-311f5e1d.js b/build/assets/index-69dca385.js similarity index 99% rename from build/assets/index-311f5e1d.js rename to build/assets/index-69dca385.js index 959d51554..0a26e3eb8 100644 --- a/build/assets/index-311f5e1d.js +++ b/build/assets/index-69dca385.js @@ -529,4 +529,4 @@ PROCEED WITH CAUTION! align-items: center; width: 100%; height: 100%; -`,LazyApp=reactExports.lazy(()=>__vitePreload(()=>import("./index-b3d504b4.js").then(a=>a.bd),["assets/index-b3d504b4.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,NODE_RELATIVE_HIGHLIGHT_COLORS as U,useNodeTypes 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-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}; diff --git a/build/assets/index-b23283cd.js b/build/assets/index-6c23b30f.js similarity index 90% rename from build/assets/index-b23283cd.js rename to build/assets/index-6c23b30f.js index e463e023e..524329240 100644 --- a/build/assets/index-b23283cd.js +++ b/build/assets/index-6c23b30f.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-311f5e1d.js";import{B as I}from"./index-146a182e.js";import{a_ as z,u as j,f as D,e as E,B as w}from"./index-b3d504b4.js";import{S as L}from"./Skeleton-af57499b.js";import{C as T}from"./ClipLoader-3e52df85.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-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)` color: ${t.white}; font-family: 'Barlow'; font-size: 20px; diff --git a/build/assets/index-b83fe05f.js b/build/assets/index-6eefb34c.js similarity index 57% rename from build/assets/index-b83fe05f.js rename to build/assets/index-6eefb34c.js index 41467ca41..6ac90a20b 100644 --- a/build/assets/index-b83fe05f.js +++ b/build/assets/index-6eefb34c.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-311f5e1d.js";import{B as z}from"./index-146a182e.js";import{ah as N,aP as D,aQ as M,aR as P,u as I,$ as X,e as Y,a0 as H,B as R}from"./index-b3d504b4.js";import{A as L,T as G}from"./index-4410528e.js";import{O as V}from"./constants-b2a2fa82.js";import{S as W,A as $}from"./constants-104c86df.js";import{C as _}from"./ClipLoader-3e52df85.js";import"./Stack-dcbf847f.js";import"./createSvgIcon-5d2e26a6.js";import"./TextareaAutosize-8373cbad.js";const Q=({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:$,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(Q,{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-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` position: absolute; top: 26px; bottom: 26px; diff --git a/build/assets/index-40985a8d.js b/build/assets/index-6f865e1f.js similarity index 55% rename from build/assets/index-40985a8d.js rename to build/assets/index-6f865e1f.js index 318002762..ce8a87a1b 100644 --- a/build/assets/index-40985a8d.js +++ b/build/assets/index-6f865e1f.js @@ -1,8 +1,8 @@ -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-311f5e1d.js";import{B as S,b5 as w,u as y,$ as k,a0 as v}from"./index-b3d504b4.js";import{B as F}from"./index-146a182e.js";import{S as B}from"./index-994f71d4.js";import{T}from"./index-44c82821.js";import"./index.esm-46402b6f.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($,{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"})})]}),$=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-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)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,z=()=>e.jsxs(s,{align:"center",direction:"column",justify:"center",p:40,children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsx(M,{children:"We've Got Your Feedback"}),e.jsx(A,{children:"Thank you for sharing your thoughts with us! We value your input."})]}),C=a.div` +`,C=()=>e.jsxs(s,{align:"center",direction:"column",justify:"center",p:40,children:[e.jsx(M,{children:e.jsx(w,{})}),e.jsx($,{children:"We've Got Your Feedback"}),e.jsx(A,{children:"Thank you for sharing your thoughts with us! We value your input."})]}),M=a.div` margin-bottom: 20px; width: 50px; height: 50px; @@ -17,7 +17,7 @@ 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-311 circle { color: ${i.SUCESS}; } -`,M=a(n)` +`,$=a(n)` font-size: 22px; font-weight: 700; font-family: 'Barlow'; @@ -31,4 +31,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-311 font-weight: 400; color: ${i.GRAY6}; padding-top: 10px; -`,I=async r=>{try{const t=await j.post("/prediction/feedback",JSON.stringify(r));if(t.error){const{message:o}=t.error;throw new Error(o)}}catch(t){throw new Error(t.message||"Error submitting feedback")}},U=()=>{const{close:r,visible:t}=y("feedback"),o=k({mode:"onChange"}),{watch:u,reset:c}=o,[x,d]=m.useState(!1);m.useEffect(()=>()=>{d(!1),c()},[t,c]);const l=u("message"),h=!!l&&l.trim().length>0,f=o.handleSubmit(async p=>{try{await I(p),B("Feedback Submitted"),d(!0)}catch(b){console.error(b.message)}});return e.jsx(F,{id:"feedback",kind:"small",onClose:r,preventOutsideClose:!0,children:e.jsx(v,{...o,children:e.jsx("form",{id:"feedback-form",onSubmit:f,children:x?e.jsx(z,{}):e.jsx(E,{allowNextStep:h})})})})};export{U as UserFeedBackModal}; +`,I=async r=>{try{const t=await j.post("/prediction/feedback",JSON.stringify(r));if(t.error){const{message:o}=t.error;throw new Error(o)}}catch(t){throw new Error(t.message||"Error submitting feedback")}},U=()=>{const{close:r,visible:t}=y("feedback"),o=k({mode:"onChange"}),{watch:u,reset:c}=o,[x,d]=m.useState(!1);m.useEffect(()=>()=>{d(!1),c()},[t,c]);const l=u("message"),h=!!l&&l.trim().length>0,f=o.handleSubmit(async p=>{try{await I(p),B("Feedback Submitted"),d(!0)}catch(b){console.error(b.message)}});return e.jsx(F,{id:"feedback",kind:"small",onClose:r,preventOutsideClose:!0,children:e.jsx(v,{...o,children:e.jsx("form",{id:"feedback-form",onSubmit:f,children:x?e.jsx(C,{}):e.jsx(E,{allowNextStep:h})})})})};export{U as UserFeedBackModal}; diff --git a/build/assets/index-7d2b0c32.js b/build/assets/index-7d2b0c32.js new file mode 100644 index 000000000..0bea4b919 --- /dev/null +++ b/build/assets/index-7d2b0c32.js @@ -0,0 +1,649 @@ +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)))))})))});/*! + * 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})` + background: ${Tt.BG1}; + max-width: 700px; + width: 700px; + color: ${Tt.white}; + padding: 0 16px 0 16px; + overflow-y: auto !important; + border: none; + resize: none; + outline: none; + border-radius: 12px; + font-family: 'Barlow'; + display: flex; + align-items: center; + text-align: justify; + font-size: 16px; + font-weight: 400; + + &:-moz-placeholder, /* Firefox 18- */ + &::-moz-placeholder, /* Firefox 19+ */ + &:-ms-input-placeholder, /* IE 10+ */ + &::-webkit-input-placeholder, /* Webkit based */ + &::placeholder { + color: #0bf; + } + + &::-webkit-scrollbar { + width: 3px; + } + + &::-webkit-scrollbar-track { + border-radius: 12px; + margin: 13px; + overflow-y: hidden; + } +`,l0=qt(ys)` + position: relative; + margin-top: 30px; + background: ${Tt.BG1}; + max-width: 702px; + width: 702px; + color: ${Tt.white}; + min-height: 150px; + border: 1px solid ${Tt.modalShield}; + resize: none; + outline: none; + border-radius: 12px; + box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.5); +`,u0=qt(ys)` + background: #16161de3; + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; + color: #fff; + align-items: center; + justify-content: center; + font-size: 32px; + font-style: normal; + font-weight: 700; + line-height: 16px; + font-family: 'Barlow'; +`,h0=qt(Kl)` + && { + position: absolute; + bottom: 16px; + right: 16px; + height: 32px; + border-radius: 16px; + min-width: 32px; + } + + &&.MuiButton-root { + padding: 0 10px 0 12px; + } + + svg { + margin-top: 1px; + width: 11px; + height: 11px; + } +`,d0=qt(Kl)` + && { + position: absolute; + bottom: 20px; + right: 20px; + border-radius: 16px; + } +`,f0=qt.div` + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 10px; + margin-top: 20px; + max-width: 702px; + width: 100%; +`,p0=qt.div` + background: ${Tt.BG1}; + color: ${Tt.white}; + padding: 15px 12px; + border-radius: 8px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: flex-start; + text-align: left; + font-family: Barlow; + font-size: 14px; + font-weight: 400; + gap: 10px; + &:hover { + background: ${Tt.SEEDQUESTION_HOVER}; + } + + &:active { + background: ${Tt.SEEDQUESTION}; + } + svg { + width: 20px; + height: 20px; + } + + 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([` + // the initial timeout time + let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; + // onmessage callback + self.onmessage = function(msg){ + timeoutTime = parseInt(msg.data); + }; + // the tick function which posts a message + // and schedules a new tick + function tick(){ + setTimeout(tick, timeoutTime); + self.postMessage('tick'); + } + // call tick initially + tick(); + `],{type:"text/javascript"}),e=URL.createObjectURL(t),s=new Worker(e);s.onmessage=this._callback.bind(this),this._worker=s}_createTimeout(){this._timeout=setTimeout(()=>{this._createTimeout(),this._callback()},this._updateInterval*1e3)}_createClock(){if(this._type==="worker")try{this._createWorker()}catch{this._type="timeout",this._createClock()}else this._type==="timeout"&&this._createTimeout()}_disposeClock(){this._timeout&&clearTimeout(this._timeout),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(t){var e;this._updateInterval=Math.max(t,this._minimumUpdateInterval),this._type==="worker"&&((e=this._worker)===null||e===void 0||e.postMessage(this._updateInterval*1e3))}get type(){return this._type}set type(t){this._disposeClock(),this._type=t,this._createClock()}dispose(){this._disposeClock()}}function an(i){return xy(i)}function As(i){return ky(i)}function Nr(i){return Ty(i)}function Sn(i){return vy(i)}function Py(i){return i instanceof zu}function Ny(i,t){return i==="value"||an(t)||As(t)||Py(t)}function Pn(i,...t){if(!t.length)return i;const e=t.shift();if(Js(i)&&Js(e))for(const s in e)Ny(s,e[s])?i[s]=e[s]:Js(e[s])?(i[s]||Object.assign(i,{[s]:{}}),Pn(i[s],e[s])):Object.assign(i,{[s]:e[s]});return Pn(i,...t)}function Iy(i,t){return i.length===t.length&&i.every((e,s)=>t[s]===e)}function $(i,t,e=[],s){const n={},r=Array.from(t);if(Js(r[0])&&s&&!Reflect.has(r[0],s)&&(Object.keys(r[0]).some(a=>Reflect.has(i,a))||(Pn(n,{[s]:r[0]}),e.splice(e.indexOf(s),1),r.shift())),r.length===1&&Js(r[0]))Pn(n,r[0]);else for(let o=0;o{Reflect.has(i,e)&&delete i[e]}),i}/** + * Tone.js + * @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=` + /** + * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. + */ + class ToneAudioWorkletProcessor extends AudioWorkletProcessor { + + constructor(options) { + + super(options); + /** + * If the processor was disposed or not. Keep alive until it's disposed. + */ + this.disposed = false; + /** + * The number of samples in the processing block + */ + this.blockSize = 128; + /** + * the sample rate + */ + this.sampleRate = sampleRate; + + this.port.onmessage = (event) => { + // when it receives a dispose + if (event.data === "dispose") { + this.disposed = true; + } + }; + } + } +`;lc(n1);const i1=` + /** + * Abstract class for a single input/output processor. + * has a 'generate' function which processes one sample at a time + */ + class SingleIOProcessor extends ToneAudioWorkletProcessor { + + constructor(options) { + super(Object.assign(options, { + numberOfInputs: 1, + numberOfOutputs: 1 + })); + /** + * Holds the name of the parameter and a single value of that + * parameter at the current sample + * @type { [name: string]: number } + */ + this.params = {} + } + + /** + * Generate an output sample from the input sample and parameters + * @abstract + * @param input number + * @param channel number + * @param parameters { [name: string]: number } + * @returns number + */ + generate(){} + + /** + * Update the private params object with the + * values of the parameters at the given index + * @param parameters { [name: string]: Float32Array }, + * @param index number + */ + updateParams(parameters, index) { + for (const paramName in parameters) { + const param = parameters[paramName]; + if (param.length > 1) { + this.params[paramName] = parameters[paramName][index]; + } else { + this.params[paramName] = parameters[paramName][0]; + } + } + } + + /** + * Process a single frame of the audio + * @param inputs Float32Array[][] + * @param outputs Float32Array[][] + */ + process(inputs, outputs, parameters) { + const input = inputs[0]; + const output = outputs[0]; + // get the parameter values + const channelCount = Math.max(input && input.length || 0, output.length); + for (let sample = 0; sample < this.blockSize; sample++) { + this.updateParams(parameters, sample); + for (let channel = 0; channel < channelCount; channel++) { + const inputSample = input && input.length ? input[channel][sample] : 0; + output[channel][sample] = this.generate(inputSample, channel, this.params); + } + } + return !this.disposed; + } + }; +`;lc(i1);const r1=` + /** + * A multichannel buffer for use within an AudioWorkletProcessor as a delay line + */ + class DelayLine { + + constructor(size, channels) { + this.buffer = []; + this.writeHead = [] + this.size = size; + + // create the empty channels + for (let i = 0; i < channels; i++) { + this.buffer[i] = new Float32Array(this.size); + this.writeHead[i] = 0; + } + } + + /** + * Push a value onto the end + * @param channel number + * @param value number + */ + push(channel, value) { + this.writeHead[channel] += 1; + if (this.writeHead[channel] > this.size) { + this.writeHead[channel] = 0; + } + this.buffer[channel][this.writeHead[channel]] = value; + } + + /** + * Get the recorded value of the channel given the delay + * @param channel number + * @param delay number delay samples + */ + get(channel, delay) { + let readHead = this.writeHead[channel] - Math.floor(delay); + if (readHead < 0) { + readHead += this.size; + } + return this.buffer[channel][readHead]; + } + } +`;lc(r1);const o1="feedback-comb-filter",a1=` + class FeedbackCombFilterWorklet extends SingleIOProcessor { + + constructor(options) { + super(options); + this.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2); + } + + static get parameterDescriptors() { + return [{ + name: "delayTime", + defaultValue: 0.1, + minValue: 0, + maxValue: 1, + automationRate: "k-rate" + }, { + name: "feedback", + defaultValue: 0.5, + minValue: 0, + maxValue: 0.9999, + automationRate: "k-rate" + }]; + } + + generate(input, channel, parameters) { + const delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate); + this.delayLine.push(channel, input + delayedSample * parameters.feedback); + 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=` + class BitCrusherWorklet extends SingleIOProcessor { + + static get parameterDescriptors() { + return [{ + name: "bits", + defaultValue: 12, + minValue: 1, + maxValue: 16, + automationRate: 'k-rate' + }]; + } + + generate(input, _channel, parameters) { + const step = Math.pow(0.5, parameters.bits - 1); + const val = step * Math.floor(input / step + 0.5); + 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}/*! + * GSAP 3.12.4 + * https://gsap.com + * + * @license Copyright 2008-2023, GreenSock. All rights reserved. + * 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;/*! + * CSSPlugin 3.12.4 + * https://gsap.com + * + * Copyright 2008-2023, GreenSock. All rights reserved. + * 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)` + text-align: center; + width: ${i=>i.type==="topic"?"auto":`${i.size}px`}; + height: ${i=>i.type==="topic"?"auto":`${i.size}px`}; + outline: 1px solid ${i=>Tt.white||i.color}; + outline-offset: 0px; + background: rgba(0, 0, 0, 0.75); + color: ${i=>i.fontColor}; + border-radius: ${i=>`${i.type==="guest"?"100%":"6px"}`}; + font-size: ${i=>`${i.fontSize}px`}; + cursor: pointer; + transition: font-size 0.4s, outline 0.4s; + transform: scale(${i=>i.scale}); + align-items: center; + justify-content: center; + font-family: Barlow; + font-size: 26px; + font-style: normal; + font-weight: 700; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); + + &:hover { + outline-offset: 4px; + } + + &.selected { + .badge-wrapper { + top: 0; + } + + font-size: 36px; + + &:hover { + outline-offset: 0px; + } + } + + &.topic { + outline: none; + background: none; + &:hover { + font-size: 36px; + } + white-space: nowrap; + .badge-wrapper { + display: none; + } + } + + .badge-wrapper { + position: absolute; + top: -7px; + left: -14px; + } +`,$v=qt(ys)` + text-align: center; + outline: 1px solid ${Tt.white}; + outline-offset: 0px; + white-space: nowrap; + padding: 4px; + background: rgba(0, 0, 0, 0.75); + color: ${Tt.white}; + border-radius: 6px; + font-size: 20px; + cursor: pointer; + transition: font-size 0.4s, outline 0.4s; + align-items: center; + justify-content: flex-start; + font-family: Barlow; + font-size: 26px; + font-style: normal; + font-weight: 700; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); + max-width: auto; + max-height: 100px; + white-space: normal; + font-size: 16px; + + &:hover { + outline-offset: 4px; + } + + &.selected { + .badge-wrapper { + top: 0; + } + + font-size: 36px; + + &:hover { + outline-offset: 0px; + } + } + + &.topic { + outline: none; + background: none; + &:hover { + font-size: 36px; + } + white-space: nowrap; + .badge-wrapper { + display: none; + } + } + + .badge-wrapper { + position: absolute; + top: -7px; + left: -14px; + } +`;qt.img` + background-image: ${({src:i})=>`url(${i})`}; + background-size: contain; + background-repeat: no-repeat; + width: ${i=>i.size}px; + height: ${i=>i.size}px; + border-radius: ${i=>i.borderRadius}; +`;qt.div` + display: flex; + position: absolute; + bottom: -14px; + left: -5px; + width: auto; + justify-content: center; + align-items: center; +`;qt.div` + display: flex; + justify-content: center; + align-items: center; + background: ${Tt.transparentBlack}; + border: 2px solid ${i=>i.color}; + color: #fff; + padding: 0 4px; + min-width: 30px; + height: 26px; + font-size: 12px; + font-weight: 500; + border-radius: 6px; + margin-right: 5px; +`;qt.div` + display: flex; + justify-content: center; + align-items: center; + border: 2px solid ${i=>i.color}44; + background: ${Tt.transparentBlack}; + padding: 0 4px; + color: ${i=>i.color}; + min-width: 30px; + height: 26px; + font-size: 12px; + 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)` + text-align: center; + + outline-offset: 0px; + background: rgba(0, 0, 0, 0.75); + color: #eee; + cursor: pointer; + transition: font-size 0.4s, outline 0.4s; + align-items: center; + justify-content: center; + font-family: Barlow; + font-size: 12px; + font-style: normal; + font-weight: 700; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); + + &:hover { + outline-offset: 4px; + span { + opacity: 0.1; + } + + .icon { + display: flex; + } + } + + .icon { + position: absolute; + width: 24px; + height: 24px; + /* bottom: 100%; */ + display: none; + color: #000; + border-radius: 40px; + justify-content: center; + align-items: center; + background: #ffffff; + color: #000; + border-radius: 100%; + font-size: 16px; + cursor: pointer; + transition: opacity 0.4s; + box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.5); + } + + .badge-wrapper { + position: absolute; + top: -7px; + left: -14px; + } +`,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` + border: 2px solid white; + border-radius: 50%; + display: flex; + align-items: center; + 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` + position: fixed; + top: -60px; + left: ${i=>-7+i.left}px; + width: 24px; + height: 24px; + + border-radius: 40px; + display: flex; + justify-content: center; + align-items: center; + background: ${i=>i.backgroundColor?i.backgroundColor:"#000000bb"}; + color: ${i=>i.fontColor?i.fontColor:"#ffffff"}; + border-radius: 100%; + font-size: 16px; + cursor: pointer; + transition: opacity 0.4s; + box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.5); +`,Wl=qt(ys).attrs({direction:"row",px:12,py:8})` + display: flex; + align-items: center; + justify-content: start; + gap: 12px; + cursor: pointer; + background: ${Tt.BUTTON1}; + color: ${Tt.white}; + + &:hover { + background: ${Tt.BUTTON1_HOVER}; + color: ${Tt.GRAY3}; + } +`,Ok=qt(lf)` + && { + z-index: 9999; + } + .MuiPaper-root { + min-width: 149px; + color: ${Tt.GRAY3}; + box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); + border-radius: 6px; + z-index: 1; + font-family: Barlow; + font-size: 14px; + font-weight: 500; + } +`,Ak=qt.div` + position: fixed; + top: 40px; + left: ${i=>-53+i.left}px; + width: 100px; + padding: 6px; + border-radius: 4px; + display: flex; + justify-content: center; + align-items: center; + background: ${Tt.createTestButton}; + color: ${Tt.black}; + font-size: 14px; + font-family: Barlow; + font-weight: 600; + cursor: pointer; + &: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)` + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; + background-color: ${Tt.black}; + z-index: 1; +`,Nk=()=>L.jsx(tr,{children:L.jsx(Vf,{})}),Ik=()=>{const{universeColor:i}=hf("universe",{universeColor:Tt.black}),t=We();return A.useMemo(()=>t!=null&&t.node_type?Zl(t.node_type):v1,[t]),L.jsxs(L.Fragment,{children:[L.jsx("color",{args:[i],attach:"background"}),L.jsx(Hd,{}),L.jsx(O1,{}),L.jsxs(i0,{children:[!1,L.jsx(Mk,{})]})]})};let ia=null;const Rk={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[Ti.x,Ti.y,Ti.z]},Fk=()=>{const[i,t,e]=[Os(a=>a.setIsUserScrollingOnHtmlPanel),Os(a=>a.setIsUserScrolling),Os(a=>a.setUserMovedCamera)],s=Us(a=>a.isFetching),n=Ji(a=>a.universeQuestionIsOpen),r=A.useCallback(a=>{var u;const{target:c}=a,{offsetParent:l}=c;ia&&clearTimeout(ia),(u=l==null?void 0:l.classList)!=null&&u.contains("html-panel")&&l.clientHeight{t(!1),i(!1)},200)},[t,i,e]),o=A.useCallback(a=>Id(a,"threeState"),[]);return L.jsxs(Lk,{children:[L.jsx(A.Suspense,{fallback:null,children:L.jsxs(qd,{camera:Rk,id:"universe-canvas",onCreated:o,onWheel:r,children:[Rd&&L.jsx(Wd,{position:"top-right",style:{top:"80px"}}),L.jsxs(A.Suspense,{fallback:L.jsx(Nk,{}),children:[L.jsx(e0,{}),L.jsx(s0,{}),L.jsx(n0,{}),L.jsx(Ik,{})]})]})}),n&&L.jsx(a0,{}),s&&L.jsx(Dk,{fullSize:!1}),L.jsx(uf,{})]})},Lk=qt(ys)` + flex: 1 1 100%; + position: relative; +`,kx=A.memo(Fk);export{kx as Universe}; diff --git a/build/assets/index-7d7c7f8c.js b/build/assets/index-7d7c7f8c.js deleted file mode 100644 index dafb41a0b..000000000 --- a/build/assets/index-7d7c7f8c.js +++ /dev/null @@ -1,18 +0,0 @@ -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-311f5e1d.js";import{Z as V,B as S,u as E,e as A,$ as _,a0 as R}from"./index-b3d504b4.js";import{B as G}from"./index-146a182e.js";import{S as I}from"./index-994f71d4.js";import{A as K}from"./index-4410528e.js";import{T as N}from"./index-44c82821.js";import"./index.esm-46402b6f.js";import"./Stack-dcbf847f.js";import"./createSvgIcon-5d2e26a6.js";import"./TextareaAutosize-8373cbad.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 Z(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 Z(e){let t="";const r=e.byteLength;for(let a=0;a{const t=e.trim();return!!(t&&D.test(t))},H=({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=v(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(J,{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'; - margin-bottom: 6px; -`,J=B(k)` - font-size: 18px; - font-weight: 600; - font-family: 'Barlow'; - margin-bottom: 6px; -`,Q=B(d)` - font-size: 13px; - font-family: Barlow; - color: #ff8f80; - line-height: 0.2px; - margin-top: 12px; - padding-top: 20px; -`,X=()=>{const[e,t]=x.useState(""),{close:r}=E("createBounty"),s=A(),a=_({mode:"onChange"}),{handleSubmit:l,setValue:c}=a,u=()=>{c("budget",""),c("nodeType",""),c("workspaceUuid",""),r()},g=async f=>{const{budget:y,workspaceUuid:h}=f;try{const o=await q(),i={type:"code_generation",amount:Number(y),workspace_uuid:h||"ck9drb84nncjnaefo090",ref_id:s==null?void 0:s.ref_id,node_data:(s==null?void 0:s.properties)||{},jwt_token:o};await O(i),I("Bounty Created")}catch(o){t(o)}finally{c("budget",""),c("nodeType",""),c("workspaceUuid",""),u()}};return n.jsx(R,{...a,children:n.jsx("form",{id:"create-bounty-form",onSubmit:l(g),children:n.jsx(H,{errMessage:e,handleClose:u})})})},de=()=>{const{close:e}=E("createBounty"),t=_({mode:"onChange"}),{setValue:r}=t,s=()=>{r("budget",""),r("nodeType",""),e()},a="small";return n.jsx(G,{id:"createBounty",kind:a,onClose:s,preventOutsideClose:!0,children:n.jsx(X,{})})};export{de as CreateBountyModal}; diff --git a/build/assets/index-8bf7fe7b.js b/build/assets/index-8bf7fe7b.js new file mode 100644 index 000000000..b92de0d06 --- /dev/null +++ b/build/assets/index-8bf7fe7b.js @@ -0,0 +1,18 @@ +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)` + font-size: 14px; + font-weight: 600; + font-family: 'Barlow'; + margin-bottom: 6px; +`,Z=B(k)` + font-size: 18px; + font-weight: 600; + font-family: 'Barlow'; + margin-bottom: 6px; +`,Q=B(d)` + font-size: 13px; + font-family: Barlow; + color: #ff8f80; + line-height: 0.2px; + margin-top: 12px; + padding-top: 20px; +`,X=()=>{const[e,t]=x.useState(""),{close:r}=E("createBounty"),s=A(),a=_({mode:"onChange"}),{handleSubmit:l,setValue:c}=a,u=()=>{c("budget",""),c("nodeType",""),c("workspaceUuid",""),r()},g=async f=>{const{budget:y,workspaceUuid:h}=f;try{const o=await q(),i={type:"code_generation",amount:Number(y),workspace_uuid:h||"ck9drb84nncjnaefo090",ref_id:s==null?void 0:s.ref_id,node_data:(s==null?void 0:s.properties)||{},jwt_token:o};await O(i),I("Bounty Created")}catch(o){t(o)}finally{c("budget",""),c("nodeType",""),c("workspaceUuid",""),u()}};return n.jsx(R,{...a,children:n.jsx("form",{id:"create-bounty-form",onSubmit:l(g),children:n.jsx(J,{errMessage:e,handleClose:u})})})},de=()=>{const{close:e}=E("createBounty"),t=_({mode:"onChange"}),{setValue:r}=t,s=()=>{r("budget",""),r("nodeType",""),e()},a="small";return n.jsx(G,{id:"createBounty",kind:a,onClose:s,preventOutsideClose:!0,children:n.jsx(X,{})})};export{de as CreateBountyModal}; diff --git a/build/assets/index-b3d504b4.js b/build/assets/index-94c3c981.js similarity index 98% rename from build/assets/index-b3d504b4.js rename to build/assets/index-94c3c981.js index bf49ec043..249d0a460 100644 --- a/build/assets/index-b3d504b4.js +++ b/build/assets/index-94c3c981.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-311f5e1d.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-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` 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-e7f30eed.js"),["assets/index-e7f30eed.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/ClipLoader-3e52df85.js","assets/index.esm-46402b6f.js","assets/index-994f71d4.js","assets/index-44c82821.js","assets/Tabs-7a262088.js","assets/createSvgIcon-5d2e26a6.js"]).then(({SettingsModal:e})=>({default:e}))),fm=p.lazy(()=>W1(()=>import("./index-97c1e407.js"),["assets/index-97c1e407.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/index-994f71d4.js","assets/index.esm-46402b6f.js","assets/ClipLoader-3e52df85.js","assets/index-44c82821.js"]).then(({AddContentModal:e})=>({default:e}))),hm=p.lazy(()=>W1(()=>import("./index-20836eed.js"),["assets/index-20836eed.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/index-994f71d4.js","assets/index.esm-46402b6f.js","assets/ClipLoader-3e52df85.js","assets/constants-b2a2fa82.js","assets/index-e1867c29.js","assets/three.module-ebe9f2a4.js","assets/index-44c82821.js","assets/index-4410528e.js","assets/Stack-dcbf847f.js","assets/createSvgIcon-5d2e26a6.js","assets/TextareaAutosize-8373cbad.js","assets/index-64f1c910.js"]).then(({AddItemModal:e})=>({default:e}))),pm=p.lazy(()=>W1(()=>import("./index-9a08ebbb.js"),["assets/index-9a08ebbb.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/constants-104c86df.js","assets/ClipLoader-3e52df85.js","assets/index.esm-46402b6f.js","assets/index-4410528e.js","assets/Stack-dcbf847f.js","assets/createSvgIcon-5d2e26a6.js","assets/TextareaAutosize-8373cbad.js","assets/index-44c82821.js","assets/index-ea411943.js","assets/constants-b2a2fa82.js","assets/Typography-5302f73b.js","assets/Tabs-7a262088.js"]).then(({SourcesTableModal:e})=>({default:e}))),mm=p.lazy(()=>W1(()=>import("./index-dd2e0f5e.js"),["assets/index-dd2e0f5e.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/index-44c82821.js","assets/index.esm-46402b6f.js","assets/Skeleton-af57499b.js","assets/ClipLoader-3e52df85.js"]).then(({EditNodeNameModal:e})=>({default:e}))),xm=p.lazy(()=>W1(()=>import("./index-b23283cd.js"),["assets/index-b23283cd.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/Skeleton-af57499b.js","assets/ClipLoader-3e52df85.js"]).then(({RemoveNodeModal:e})=>({default:e}))),km=p.lazy(()=>W1(()=>import("./index-b83fe05f.js"),["assets/index-b83fe05f.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/index-4410528e.js","assets/Stack-dcbf847f.js","assets/createSvgIcon-5d2e26a6.js","assets/TextareaAutosize-8373cbad.js","assets/constants-b2a2fa82.js","assets/constants-104c86df.js","assets/ClipLoader-3e52df85.js"]).then(({AddNodeEdgeModal:e})=>({default:e}))),gm=p.lazy(()=>W1(()=>import("./index-63ae9a26.js"),["assets/index-63ae9a26.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/index-ea411943.js","assets/constants-104c86df.js","assets/constants-b2a2fa82.js","assets/index-4410528e.js","assets/Stack-dcbf847f.js","assets/createSvgIcon-5d2e26a6.js","assets/TextareaAutosize-8373cbad.js","assets/ClipLoader-3e52df85.js"]).then(({MergeNodeModal:e})=>({default:e}))),Cm=p.lazy(()=>W1(()=>import("./index-63a59983.js"),["assets/index-63a59983.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/index-44c82821.js","assets/index.esm-46402b6f.js","assets/index-e1867c29.js","assets/three.module-ebe9f2a4.js","assets/constants-b2a2fa82.js","assets/ClipLoader-3e52df85.js","assets/index-4410528e.js","assets/Stack-dcbf847f.js","assets/createSvgIcon-5d2e26a6.js","assets/TextareaAutosize-8373cbad.js","assets/index-64f1c910.js"]).then(({ChangeNodeTypeModal:e})=>({default:e}))),ym=p.lazy(()=>W1(()=>import("./index-023df127.js"),["assets/index-023df127.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/constants-b2a2fa82.js","assets/index-44c82821.js","assets/index.esm-46402b6f.js","assets/index-4410528e.js","assets/Stack-dcbf847f.js","assets/createSvgIcon-5d2e26a6.js","assets/TextareaAutosize-8373cbad.js","assets/ClipLoader-3e52df85.js","assets/map-1d4da850.js","assets/Typography-5302f73b.js","assets/Tabs-7a262088.js","assets/index-e1867c29.js","assets/three.module-ebe9f2a4.js","assets/index-52ffd3c1.js"]).then(({BlueprintModal:e})=>({default:e}))),bm=p.lazy(()=>W1(()=>import("./index-40985a8d.js"),["assets/index-40985a8d.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/index-994f71d4.js","assets/index.esm-46402b6f.js","assets/index-44c82821.js"]).then(({UserFeedBackModal:e})=>({default:e}))),vm=p.lazy(()=>W1(()=>import("./index-7d7c7f8c.js"),["assets/index-7d7c7f8c.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-146a182e.js","assets/index-994f71d4.js","assets/index.esm-46402b6f.js","assets/index-4410528e.js","assets/Stack-dcbf847f.js","assets/createSvgIcon-5d2e26a6.js","assets/TextareaAutosize-8373cbad.js","assets/index-44c82821.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-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)` 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-edbea3ee.js"),["assets/index-edbea3ee.js","assets/index-311f5e1d.js","assets/index-a2878e02.css"]).then(({MainToolbar:e})=>({default:e}))),gg=p.lazy(()=>W1(()=>import("./index-615a69d5.js"),["assets/index-615a69d5.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/index-52ffd3c1.js","assets/three.module-ebe9f2a4.js","assets/TextareaAutosize-8373cbad.js","assets/index.esm-46402b6f.js","assets/index-d6bbde2b.js","assets/ClipLoader-3e52df85.js"]).then(({Universe:e})=>({default:e}))),Cg=p.lazy(()=>W1(()=>import("./index-dfcc1a18.js").then(e=>e.i),["assets/index-dfcc1a18.js","assets/index-311f5e1d.js","assets/index-a2878e02.css","assets/ClipLoader-3e52df85.js","assets/Skeleton-af57499b.js","assets/Stack-dcbf847f.js","assets/map-1d4da850.js","assets/Typography-5302f73b.js","assets/createSvgIcon-5d2e26a6.js","assets/index-146a182e.js","assets/index-d6bbde2b.js","assets/index.esm-46402b6f.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}),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{lh as $,Km as A,ii as B,o3 as C,Sx as D,Tx as E,Rx as F,we as G,Yx as H,Ik as I,Ya as J,st as K,Ua as L,ek as M,_3 as N,im as O,dk as P,al as Q,Za as R,Bk as S,Xp as T,It as U,qa as V,Ht as W,R5 as X,nc as Y,_n as Z,I0 as _,Zm as a,jg as a$,Wf as a0,vk as a1,$k as a2,ix as a3,Jx as a4,Ux as a5,qx as a6,$i as a7,Dk as a8,px 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_,dx as aa,J3 as ab,Xm as ac,qm as ad,Ym as ae,Jm as af,cx as ag,Dn as ah,ox as ai,Dx as aj,C3 as ak,Vk as al,i3 as am,mk as an,Ek as ao,y3 as ap,Kx as aq,yk as ar,bk as as,g1 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,Bx as r,W5 as s,Bg as t,$m as u,el as v,pl as w,Pe as x,dr as y,S0 as z}; +`,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}; diff --git a/build/assets/index-63a59983.js b/build/assets/index-a579da74.js similarity index 74% rename from build/assets/index-63a59983.js rename to build/assets/index-a579da74.js index 61b6542b7..c80fe8bc7 100644 --- a/build/assets/index-63a59983.js +++ b/build/assets/index-a579da74.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 Z,az as O,a_ as Q,b1 as X}from"./index-311f5e1d.js";import{Z as U,B as P,e as V,u as D,$ as N,a0 as ee}from"./index-b3d504b4.js";import{B as te}from"./index-146a182e.js";import{T as re}from"./index-44c82821.js";import{p as G}from"./index-e1867c29.js";import{n as ne}from"./constants-b2a2fa82.js";import{C as W}from"./ClipLoader-3e52df85.js";import{A as Y}from"./index-4410528e.js";import{c as oe}from"./index-64f1c910.js";import"./index.esm-46402b6f.js";import"./three.module-ebe9f2a4.js";import"./Stack-dcbf847f.js";import"./createSvgIcon-5d2e26a6.js";import"./TextareaAutosize-8373cbad.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-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)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -70,8 +70,8 @@ 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 Z, font-family: 'Barlow'; color: white; margin-bottom: 15px; -`,ye={label:"Not Selected",value:"Not Selected"},ge=[{label:"Corporation",value:"Corporation"},{label:"Event",value:"Event"},{label:"Image",value:"Image"},{label:"Organization",value:"Organization"},{label:"Person",value:"Person"},{label:"Place",value:"Place"},{label:"Project",value:"Project"},{label:"Software",value:"Software"},{label:"Topic",value:"Topic"}],je=({skipToStep:a,allowNextStep:l,onSelectType:x,selectedType:r})=>{const[f]=K(i=>[i.customSchemaFeatureFlag]),[b,h]=m.useState(null),[C,j]=m.useState(!1),t=V();m.useEffect(()=>{(async()=>{var p;if(f){j(!0);try{const S=await Z(),w=["about","schema",(p=t==null?void 0:t.node_type)==null?void 0:p.toLowerCase()],c=S.schemas.filter(o=>o.ref_id&&!w.includes(o.type.toLowerCase())&&!o.is_deleted).map(o=>({label:oe(o.type),value:o.type,action:()=>a("mapProperties")}));h(c)}catch(S){console.warn(S)}finally{j(!1)}}else h([...ge,ye])})()},[t==null?void 0:t.node_type,r,f,a]);const s=i=>{x((i==null?void 0:i.label)||"")};return e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(we,{children:"Select Type"})})}),e.jsx(n,{direction:"row",mb:20,children:e.jsx(Y,{autoFocus:!0,isLoading:C,onSelect:s,options:b})}),e.jsx(n,{children:e.jsx(P,{color:"secondary",disabled:!l,onClick:()=>a("mapProperties"),size:"large",type:"button",variant:"contained",children:"Next"})})]})},we=v(z)` +`,ye={label:"Not Selected",value:"Not Selected"},ge=[{label:"Corporation",value:"Corporation"},{label:"Event",value:"Event"},{label:"Image",value:"Image"},{label:"Organization",value:"Organization"},{label:"Person",value:"Person"},{label:"Place",value:"Place"},{label:"Project",value:"Project"},{label:"Software",value:"Software"},{label:"Topic",value:"Topic"}],je=({skipToStep:a,allowNextStep:l,onSelectType:x,selectedType:r})=>{const[f]=K(i=>[i.customSchemaFeatureFlag]),[b,h]=m.useState(null),[C,j]=m.useState(!1),t=V();m.useEffect(()=>{(async()=>{var p;if(f){j(!0);try{const S=await Q(),w=["about","schema",(p=t==null?void 0:t.node_type)==null?void 0:p.toLowerCase()],c=S.schemas.filter(o=>o.ref_id&&!w.includes(o.type.toLowerCase())&&!o.is_deleted).map(o=>({label:oe(o.type),value:o.type,action:()=>a("mapProperties")}));h(c)}catch(S){console.warn(S)}finally{j(!1)}}else h([...ge,ye])})()},[t==null?void 0:t.node_type,r,f,a]);const s=i=>{x((i==null?void 0:i.label)||"")};return e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(we,{children:"Select Type"})})}),e.jsx(n,{direction:"row",mb:20,children:e.jsx(Y,{autoFocus:!0,isLoading:C,onSelect:s,options:b})}),e.jsx(n,{children:e.jsx(P,{color:"secondary",disabled:!l,onClick:()=>a("mapProperties"),size:"large",type:"button",variant:"contained",children:"Next"})})]})},we=v(z)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,be=async(a,l,x,r)=>{const f={},b=[];Object.entries(x).forEach(([t,s])=>{s!=="none"&&(f[s]=t),t!==s&&b.push(t)});const h={};Object.keys(r||{}).forEach(t=>{const s=r==null?void 0:r[t];Object.entries(f).forEach(([i,p])=>{p===t&&(h[f[i]]=s)})}),Object.keys(a).forEach(t=>{t!=="nodeType"&&(h[t]=a[t])});const C=r?r.node_type.charAt(0).toUpperCase()+r.node_type.slice(1):void 0,j={node_type:l,node_data:h,properties_to_be_deleted:b,type_to_be_deleted:C?[C]:[]};try{let t=r==null?void 0:r.ref_id;if((r==null?void 0:r.type)==="topic"){const{data:i}=await Q({search:r==null?void 0:r.name}),p=i.find(S=>S.name===r.name);t=p==null?void 0:p.ref_id}const s=t||(r==null?void 0:r.ref_id);s&&await X(s,j)}catch(t){console.error(t);let s=O;if(t.status===400)try{const i=await t.json();s=i.message||i.errorCode||(i==null?void 0:i.status)||O}catch{s=O}else t instanceof Error&&(s=t.message);throw new Error(s)}},Le=()=>{const[a,l]=m.useState("sourceType"),{close:x,visible:r}=D("changeNodeType"),{open:f}=D("editNodeName"),{open:b}=D("addType"),h=N({mode:"onChange"}),{watch:C,setValue:j,reset:t}=h,[s,i]=m.useState(""),[p,S]=m.useState({});m.useEffect(()=>()=>{l("sourceType"),t()},[r,t]);const w=V(),c=w!=null&&w.node_type?w.node_type.charAt(0).toUpperCase()+w.node_type.slice(1):"",o=C("nodeType");C("title");const T=()=>{x()},A=_=>{l(_)},d=h.handleSubmit(async _=>{try{await be(_,o,p,w),T()}catch(E){let L=O;if(T(),(E==null?void 0:E.status)===400){const B=await E.json();L=B.errorCode||(B==null?void 0:B.status)||O}else E instanceof Error&&(L=E.message);i(String(L))}}),u=_=>{_==="Create custom type"?b():j("nodeType",_)},y={sourceType:e.jsx(je,{allowNextStep:!!o,onSelectType:u,selectedType:o,skipToStep:A}),requiredProperties:e.jsx(ae,{handleSelectType:u,nodeType:o,selectedValues:p,skipToStep:A}),createConfirmation:e.jsx(le,{nodeType:o,onclose:T,selectedNodeType:c}),mapProperties:e.jsx(pe,{handleSelectType:u,nodeType:o,selectedNodeType:c,selectedValues:p,setSelectedValues:S,skipToStep:A})},g=a==="mapProperties"?"regular":"small",F=()=>{x(),f()};return e.jsx(te,{id:"changeNodeType",kind:g,onClose:F,preventOutsideClose:!0,children:e.jsx(ee,{...h,children:e.jsx("form",{id:"add-node-form",onSubmit:d,children:y[a]})})})};export{Le as ChangeNodeTypeModal}; +`,be=async(a,l,x,r)=>{const f={},b=[];Object.entries(x).forEach(([t,s])=>{s!=="none"&&(f[s]=t),t!==s&&b.push(t)});const h={};Object.keys(r||{}).forEach(t=>{const s=r==null?void 0:r[t];Object.entries(f).forEach(([i,p])=>{p===t&&(h[f[i]]=s)})}),Object.keys(a).forEach(t=>{t!=="nodeType"&&(h[t]=a[t])});const C=r?r.node_type.charAt(0).toUpperCase()+r.node_type.slice(1):void 0,j={node_type:l,node_data:h,properties_to_be_deleted:b,type_to_be_deleted:C?[C]:[]};try{let t=r==null?void 0:r.ref_id;if((r==null?void 0:r.type)==="topic"){const{data:i}=await X({search:r==null?void 0:r.name}),p=i.find(S=>S.name===r.name);t=p==null?void 0:p.ref_id}const s=t||(r==null?void 0:r.ref_id);s&&await Z(s,j)}catch(t){console.error(t);let s=O;if(t.status===400)try{const i=await t.json();s=i.message||i.errorCode||(i==null?void 0:i.status)||O}catch{s=O}else t instanceof Error&&(s=t.message);throw new Error(s)}},Le=()=>{const[a,l]=m.useState("sourceType"),{close:x,visible:r}=D("changeNodeType"),{open:f}=D("editNodeName"),{open:b}=D("addType"),h=N({mode:"onChange"}),{watch:C,setValue:j,reset:t}=h,[s,i]=m.useState(""),[p,S]=m.useState({});m.useEffect(()=>()=>{l("sourceType"),t()},[r,t]);const w=V(),c=w!=null&&w.node_type?w.node_type.charAt(0).toUpperCase()+w.node_type.slice(1):"",o=C("nodeType");C("title");const T=()=>{x()},A=_=>{l(_)},d=h.handleSubmit(async _=>{try{await be(_,o,p,w),T()}catch(E){let L=O;if(T(),(E==null?void 0:E.status)===400){const B=await E.json();L=B.errorCode||(B==null?void 0:B.status)||O}else E instanceof Error&&(L=E.message);i(String(L))}}),u=_=>{_==="Create custom type"?b():j("nodeType",_)},y={sourceType:e.jsx(je,{allowNextStep:!!o,onSelectType:u,selectedType:o,skipToStep:A}),requiredProperties:e.jsx(ae,{handleSelectType:u,nodeType:o,selectedValues:p,skipToStep:A}),createConfirmation:e.jsx(le,{nodeType:o,onclose:T,selectedNodeType:c}),mapProperties:e.jsx(pe,{handleSelectType:u,nodeType:o,selectedNodeType:c,selectedValues:p,setSelectedValues:S,skipToStep:A})},g=a==="mapProperties"?"regular":"small",F=()=>{x(),f()};return e.jsx(te,{id:"changeNodeType",kind:g,onClose:F,preventOutsideClose:!0,children:e.jsx(ee,{...h,children:e.jsx("form",{id:"add-node-form",onSubmit:d,children:y[a]})})})};export{Le as ChangeNodeTypeModal}; diff --git a/build/assets/index-9a08ebbb.js b/build/assets/index-a7628b9d.js similarity index 92% rename from build/assets/index-9a08ebbb.js rename to build/assets/index-a7628b9d.js index 1f60b6904..c1d79d5d0 100644 --- a/build/assets/index-9a08ebbb.js +++ b/build/assets/index-a7628b9d.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-311f5e1d.js";import{B as ce}from"./index-146a182e.js";import{B as H,u as M,aM as kt,P as _t,s as we,aN as be,aw as V,aO as Nt,D as zt,r as Bt,ah as ee,a1 as Xe,aP as Ke,aQ as Ze,aR as Je,$ as Ce,a0 as ve,ag 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-b3d504b4.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-104c86df.js";import{C as z}from"./ClipLoader-3e52df85.js";import{f as Wt,g as Ht,h as Pt,a as Dt}from"./index.esm-46402b6f.js";import{I as Ut,A as Se,T as at}from"./index-4410528e.js";import{B as Gt,T as Yt}from"./index-44c82821.js";import{u as L}from"./index-ea411943.js";import{O as it}from"./constants-b2a2fa82.js";import{T as Le}from"./Typography-5302f73b.js";import{T as Vt,a as Qt}from"./Tabs-7a262088.js";import"./Stack-dcbf847f.js";import"./createSvgIcon-5d2e26a6.js";import"./TextareaAutosize-8373cbad.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-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 ${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-b853c371.js b/build/assets/index-b853c371.js new file mode 100644 index 000000000..8a7a617e3 --- /dev/null +++ b/build/assets/index-b853c371.js @@ -0,0 +1,47 @@ +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)` + font-size: 22px; + font-weight: 600; + font-family: 'Barlow'; +`,oe=i(E)` + color: ${N.GRAY6}; + font-family: 'Barlow'; + font-size: 12px; + font-weight: 400; + line-height: 18px; +`,ne=i.span` + display: inline-flex; + align-items: center; + justify-content: center; + gap: 15px; + margin: 5px 0 0 40px; +`,se=i(s)` + align-items: center; + cursor: pointer; +`,re=i(s)` + display: flex; + max-height: 60vh; + overflow-y: auto; + padding-right: 40px; + width: calc(100% + 40px); +`,ie=()=>{var w,C,S;const{close:l}=h("editNodeName"),x=H({mode:"onChange"}),{watch:f,setValue:a,reset:j,getValues:p}=x,[m,y]=c.useState(!1),[g,o]=c.useState(!1),[n,T]=c.useState(),t=F(),{open:B}=h("removeNode");c.useEffect(()=>(n?Object.keys(n).forEach(r=>{a(r,n[r])}):t&&Object.keys(t).forEach(r=>{a(r,t[r])}),()=>{j()}),[n,a,j,t]),c.useEffect(()=>{(async()=>{if(!(!t||t.type!=="topic")){o(!0);try{const{data:d}=await P({search:t==null?void 0:t.name}),A=d.find(O=>O.name===t.name);T(A)}catch(d){console.log(d)}finally{o(!1)}}})()},[t]);const D=f("imageInputType"),b=f("image_url");c.useEffect(()=>{a("imageInputType",ee(b))},[b,a]);const L=()=>{l()},u=n||t,_=async()=>{y(!0);const r=p();try{await V((u==null?void 0:u.ref_id)||"",{node_data:r});const{updateNode:d}=k.getState();d({...u,...r}),L()}catch(d){console.warn(d)}finally{y(!1)}},R=async()=>{B()},v=(C=(w=p())==null?void 0:w.name)==null?void 0:C.trim(),$=v&&(n==null?void 0:n.name.trim())!==v,z=p().image_url&&(t==null?void 0:t.image_url)!==((S=p())==null?void 0:S.image_url),M=m||g||!!b&&!D||!$&&!z;return e.jsx(ce,{children:e.jsxs(Z,{...x,children:[g?e.jsx(s,{my:24,children:e.jsx(K,{})}):e.jsx(te,{}),e.jsxs(s,{direction:"row",justify:"space-between",mt:20,children:[e.jsx(s,{direction:"column",children:e.jsx(le,{color:"secondary",disabled:g||!u,onClick:R,size:"large",variant:"contained",children:"Delete"})}),e.jsxs(pe,{color:"secondary",disabled:M,onClick:_,size:"large",variant:"contained",children:["Save Changes",m&&e.jsx(de,{children:e.jsx(Q,{color:N.lightGray,size:12})})]})]})]})})},ce=i(s)` + padding: 20px; +`,le=i(I)` + && { + color: ${N.primaryRed}; + background-color: rgba(237, 116, 116, 0.1); + flex: 1; + margin-right: 10px; + + &:hover, + &:active, + &:focus { + color: ${N.primaryRed}; + background-color: rgba(237, 116, 116, 0.2); + } + } +`,de=i.span` + margin-top: 4px; +`,pe=i(I)` + width: 80% !important; + margin: 0 auto !important; +`,ye=()=>{const{close:l}=h("editNodeName");return e.jsx(q,{id:"editNodeName",kind:"regular",onClose:l,preventOutsideClose:!0,children:e.jsx(ie,{})})};export{ye as EditNodeNameModal}; diff --git a/build/assets/index-e7f30eed.js b/build/assets/index-bd732748.js similarity index 88% rename from build/assets/index-e7f30eed.js rename to build/assets/index-bd732748.js index 7767b17bb..0b809edd8 100644 --- a/build/assets/index-e7f30eed.js +++ b/build/assets/index-bd732748.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-311f5e1d.js";import{B as A}from"./index-146a182e.js";import{f as T,g as k,aI as M,aJ as D,C as R,am as E,aK as L,B as C,$ as P,a0 as W,u as w}from"./index-b3d504b4.js";import{C as G}from"./ClipLoader-3e52df85.js";import{e as F}from"./index.esm-46402b6f.js";import{S as V}from"./index-994f71d4.js";import{T as j}from"./index-44c82821.js";import{T as U,a as N}from"./Tabs-7a262088.js";import"./createSvgIcon-5d2e26a6.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-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"})` width: 447px; height: 48px; background: ${r.appearanceBg}; diff --git a/build/assets/index-994f71d4.js b/build/assets/index-d70b7e8e.js similarity index 64% rename from build/assets/index-994f71d4.js rename to build/assets/index-d70b7e8e.js index 129c85c9a..0f36dafc3 100644 --- a/build/assets/index-994f71d4.js +++ b/build/assets/index-d70b7e8e.js @@ -1,4 +1,4 @@ -import{t as i,j as t,v as a}from"./index-311f5e1d.js";import{f as n}from"./index.esm-46402b6f.js";import{ba as e}from"./index-b3d504b4.js";const r=i.div` +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` display: Flex; justify-content: center; align-items: center; diff --git a/build/assets/index-dd2e0f5e.js b/build/assets/index-dd2e0f5e.js deleted file mode 100644 index 67844bd10..000000000 --- a/build/assets/index-dd2e0f5e.js +++ /dev/null @@ -1,47 +0,0 @@ -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-311f5e1d.js";import{B as q}from"./index-146a182e.js";import{u as h,e as F,T as G,aZ as Y,$ as H,a0 as Z,B as I}from"./index-b3d504b4.js";import{T as J}from"./index-44c82821.js";import{S as K}from"./Skeleton-af57499b.js";import{C as Q}from"./ClipLoader-3e52df85.js";import"./index.esm-46402b6f.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(a=>({changeNodeTypeFeatureFlag:a.changeNodeTypeFeatureFlag})),o=F(),j=o==null?void 0:o.node_type,[p,m]=c.useState({});c.useEffect(()=>{o!=null&&o.properties&&m(o.properties)},[o]);const y=()=>{x(),l()},g=(a,n)=>{m(T=>({...T,[a]: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(oe,{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(a=>e.jsxs(s,{mb:18,children:[e.jsx(ae,{style:{marginBottom:8},children:a}),e.jsx(J,{id:`cy-${a}`,maxLength:50,name:`properties.${a}`,onChange:n=>g(a,n),placeholder:`Please Enter the ${a}`,rules:a==="name"?{...W}:{}})]},a))})]})},oe=i(E)` - font-size: 22px; - font-weight: 600; - font-family: 'Barlow'; -`,ae=i(E)` - color: ${N.GRAY6}; - font-family: 'Barlow'; - font-size: 12px; - font-weight: 400; - line-height: 18px; -`,ne=i.span` - display: inline-flex; - align-items: center; - justify-content: center; - gap: 15px; - margin: 5px 0 0 40px; -`,se=i(s)` - align-items: center; - cursor: pointer; -`,re=i(s)` - display: flex; - max-height: 60vh; - overflow-y: auto; - padding-right: 40px; - width: calc(100% + 40px); -`,ie=()=>{var w,C,S;const{close:l}=h("editNodeName"),x=H({mode:"onChange"}),{watch:f,setValue:o,reset:j,getValues:p}=x,[m,y]=c.useState(!1),[g,a]=c.useState(!1),[n,T]=c.useState(),t=F(),{open:B}=h("removeNode");c.useEffect(()=>(n?Object.keys(n).forEach(r=>{o(r,n[r])}):t&&Object.keys(t).forEach(r=>{o(r,t[r])}),()=>{j()}),[n,o,j,t]),c.useEffect(()=>{(async()=>{if(!(!t||t.type!=="topic")){a(!0);try{const{data:d}=await P({search:t==null?void 0:t.name}),A=d.find(O=>O.name===t.name);T(A)}catch(d){console.log(d)}finally{a(!1)}}})()},[t]);const D=f("imageInputType"),b=f("image_url");c.useEffect(()=>{o("imageInputType",ee(b))},[b,o]);const L=()=>{l()},u=n||t,_=async()=>{y(!0);const r=p();try{await V((u==null?void 0:u.ref_id)||"",{node_data:r});const{updateNode:d}=k.getState();d({...u,...r}),L()}catch(d){console.warn(d)}finally{y(!1)}},$=async()=>{B()},v=(C=(w=p())==null?void 0:w.name)==null?void 0:C.trim(),R=v&&(n==null?void 0:n.name.trim())!==v,z=p().image_url&&(t==null?void 0:t.image_url)!==((S=p())==null?void 0:S.image_url),M=m||g||!!b&&!D||!R&&!z;return e.jsx(ce,{children:e.jsxs(Z,{...x,children:[g?e.jsx(s,{my:24,children:e.jsx(K,{})}):e.jsx(te,{}),e.jsxs(s,{direction:"row",justify:"space-between",mt:20,children:[e.jsx(s,{direction:"column",children:e.jsx(le,{color:"secondary",disabled:g||!u,onClick:$,size:"large",variant:"contained",children:"Delete"})}),e.jsxs(pe,{color:"secondary",disabled:M,onClick:_,size:"large",variant:"contained",children:["Save Changes",m&&e.jsx(de,{children:e.jsx(Q,{color:N.lightGray,size:12})})]})]})]})})},ce=i(s)` - padding: 20px; -`,le=i(I)` - && { - color: ${N.primaryRed}; - background-color: rgba(237, 116, 116, 0.1); - flex: 1; - margin-right: 10px; - - &:hover, - &:active, - &:focus { - color: ${N.primaryRed}; - background-color: rgba(237, 116, 116, 0.2); - } - } -`,de=i.span` - margin-top: 4px; -`,pe=i(I)` - width: 80% !important; - margin: 0 auto !important; -`,ye=()=>{const{close:l}=h("editNodeName");return e.jsx(q,{id:"editNodeName",kind:"regular",onClose:l,preventOutsideClose:!0,children:e.jsx(ie,{})})};export{ye as EditNodeNameModal}; diff --git a/build/assets/index-ea411943.js b/build/assets/index-e0a45087.js similarity index 85% rename from build/assets/index-ea411943.js rename to build/assets/index-e0a45087.js index df4270551..f4ab8199e 100644 --- a/build/assets/index-ea411943.js +++ b/build/assets/index-e0a45087.js @@ -1 +1 @@ -import{p as f,a_ as m}from"./index-311f5e1d.js";import{D as y}from"./constants-104c86df.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-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}; diff --git a/build/assets/index-44c82821.js b/build/assets/index-e780f823.js similarity index 95% rename from build/assets/index-44c82821.js rename to build/assets/index-e780f823.js index 71075d588..423d2820c 100644 --- a/build/assets/index-44c82821.js +++ b/build/assets/index-e780f823.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-311f5e1d.js";import{Z as he,bb as ge,ay as ve,bc as me}from"./index-b3d504b4.js";import{e as be}from"./index.esm-46402b6f.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; @@ -32,7 +32,7 @@ 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-3 -webkit-text-fill-color: ${({placeholderTextColor:e})=>S[e]}; color: ${({placeholderTextColor:e})=>S[e]}; } -`;Z.displayName="WebTextInput";const ae=I.forwardRef(({autoComplete:e=O.autoComplete,autoFocus:r,className:t,colorName:n=O.colorName,dataTestId:o,defaultValue:i,disabled:s=O.disabled,id:u,maxLength:f=O.maxLength,name:p,onBlur:l,onChange:a,onFocus:c,onKeyDown:h,placeholder:w=O.placeholder,placeholderTextColor:g=O.placeholderTextColor,textAlign:d=O.textAlign,type:P=O.type,value:y},C)=>{const F=I.useCallback(M=>{a&&a(M.target.value)},[a]);return E.jsx(Z,{ref:C,autoComplete:e,autoFocus:r,className:t,colorName:n,"data-testid":o,defaultValue:i,disabled:s,id:u,maxLength:f,name:p,onBlur:l,onChange:F,onFocus:c,onKeyDown:h,placeholder:w,placeholderTextColor:g,spellCheck:!1,textAlign:d,type:P,value:y})});ae.displayName="BaseTextInput";const Me=e=>e.hasError?S.primaryRed:e.hasContent||e.isFocused||e.isHovered?S.primaryBlue:"transparent",Ae=N(L)` +`;U.displayName="WebTextInput";const ae=I.forwardRef(({autoComplete:e=O.autoComplete,autoFocus:r,className:t,colorName:n=O.colorName,dataTestId:o,defaultValue:i,disabled:s=O.disabled,id:u,maxLength:f=O.maxLength,name:p,onBlur:l,onChange:a,onFocus:c,onKeyDown:h,placeholder:w=O.placeholder,placeholderTextColor:g=O.placeholderTextColor,textAlign:d=O.textAlign,type:P=O.type,value:y},C)=>{const F=I.useCallback(M=>{a&&a(M.target.value)},[a]);return E.jsx(U,{ref:C,autoComplete:e,autoFocus:r,className:t,colorName:n,"data-testid":o,defaultValue:i,disabled:s,id:u,maxLength:f,name:p,onBlur:l,onChange:F,onFocus:c,onKeyDown:h,placeholder:w,placeholderTextColor:g,spellCheck:!1,textAlign:d,type:P,value:y})});ae.displayName="BaseTextInput";const Me=e=>e.hasError?S.primaryRed:e.hasContent||e.isFocused||e.isHovered?S.primaryBlue:"transparent",Ae=N(L)` background: ${S.inputBg2}; border-radius: 8px; border: 1px solid ${Me}; @@ -93,4 +93,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-3 line-height: 20px; letter-spacing: 0.01em; text-align: left; -`,Ne=({id:e,dataTestId:r,label:t,mask:n="",message:o,name:i,rules:s,showMask:u=!1,maskPlaceholder:f=null,isTextArea:p=!1,placeholder:l="",maxLength:a,...c})=>{const{register:h,control:w,formState:{errors:g},getValues:d}=he()||{},P=ge(g,i),y=d(i),[C,F]=I.useState(!1),[M,A]=I.useState(!1);return I.useEffect(()=>{const V=document.getElementById(e);V&&V.focus()},[e]),E.jsxs(L,{shrink:1,children:[E.jsxs(L,{align:"center",direction:"row",children:[t&&E.jsx(Ie,{htmlFor:e,children:t}),o&&E.jsxs(Re,{name:i,role:"tooltip",children:[E.jsx(ve,{}),E.jsx("div",{className:"tooltip",children:o})]})]}),E.jsx(Ae,{hasContent:!!y,hasError:!!P,isFocused:C,isHovered:M,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:E.jsx(me,{control:w,...h(i),render:({field:{onBlur:V,onChange:T,value:D,ref:$}})=>{const{disabled:v=O.disabled,textAlign:m=O.textAlign}=c;return p?E.jsx(Te,{ref:$,"data-testid":r,disabled:v,id:e,maxLength:a,onBlur:()=>{F(!1),V()},onChange:T,onFocus:()=>F(!0),placeholder:l,value:D||""}):n?E.jsx(Le,{alwaysShowMask:u,disabled:!1,inputRef:$,mask:n,...h(i),maskPlaceholder:f,onBlur:V,onChange:T,value:D,children:E.jsx(Z,{colorName:"white","data-testid":r,disabled:v,...h(i),id:e,onBlur:()=>F(!1),onFocus:()=>F(!0),placeholderTextColor:"inputPlaceholder",textAlign:m})}):E.jsx(ae,{...c,colorName:"white",dataTestId:r,id:e,...h(i),onBlur:()=>{F(!1),V()},onChange:T,onFocus:()=>F(!0),placeholder:l,placeholderTextColor:"inputPlaceholder",value:D||""})},rules:s})}),P&&E.jsx(L,{pl:4,pt:8,shrink:1,tabIndex:0,children:E.jsx(pe,{color:"primaryRed",kind:"regularBold",children:E.jsxs(L,{align:"center",direction:"row",shrink:1,children:[E.jsx(be,{fontSize:18}),E.jsx(L,{pl:4,shrink:1,children:P.message!==""?P.message:"Please enter a valid URL"})]})})})]})};export{ae as B,Ne as T}; +`,Ne=({id:e,dataTestId:r,label:t,mask:n="",message:o,name:i,rules:s,showMask:u=!1,maskPlaceholder:f=null,isTextArea:p=!1,placeholder:l="",maxLength:a,...c})=>{const{register:h,control:w,formState:{errors:g},getValues:d}=he()||{},P=ge(g,i),y=d(i),[C,F]=I.useState(!1),[M,A]=I.useState(!1);return I.useEffect(()=>{const V=document.getElementById(e);V&&V.focus()},[e]),E.jsxs(L,{shrink:1,children:[E.jsxs(L,{align:"center",direction:"row",children:[t&&E.jsx(Ie,{htmlFor:e,children:t}),o&&E.jsxs(Re,{name:i,role:"tooltip",children:[E.jsx(ve,{}),E.jsx("div",{className:"tooltip",children:o})]})]}),E.jsx(Ae,{hasContent:!!y,hasError:!!P,isFocused:C,isHovered:M,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:E.jsx(me,{control:w,...h(i),render:({field:{onBlur:V,onChange:T,value:D,ref:$}})=>{const{disabled:v=O.disabled,textAlign:m=O.textAlign}=c;return p?E.jsx(Te,{ref:$,"data-testid":r,disabled:v,id:e,maxLength:a,onBlur:()=>{F(!1),V()},onChange:T,onFocus:()=>F(!0),placeholder:l,value:D||""}):n?E.jsx(Le,{alwaysShowMask:u,disabled:!1,inputRef:$,mask:n,...h(i),maskPlaceholder:f,onBlur:V,onChange:T,value:D,children:E.jsx(U,{colorName:"white","data-testid":r,disabled:v,...h(i),id:e,onBlur:()=>F(!1),onFocus:()=>F(!0),placeholderTextColor:"inputPlaceholder",textAlign:m})}):E.jsx(ae,{...c,colorName:"white",dataTestId:r,id:e,...h(i),onBlur:()=>{F(!1),V()},onChange:T,onFocus:()=>F(!0),placeholder:l,placeholderTextColor:"inputPlaceholder",value:D||""})},rules:s})}),P&&E.jsx(L,{pl:4,pt:8,shrink:1,tabIndex:0,children:E.jsx(pe,{color:"primaryRed",kind:"regularBold",children:E.jsxs(L,{align:"center",direction:"row",shrink:1,children:[E.jsx(be,{fontSize:18}),E.jsx(L,{pl:4,shrink:1,children:P.message!==""?P.message:"Please enter a valid URL"})]})})})]})};export{ae as B,Ne as T}; diff --git a/build/assets/index-d6bbde2b.js b/build/assets/index-f0d2a829.js similarity index 69% rename from build/assets/index-d6bbde2b.js rename to build/assets/index-f0d2a829.js index cebc4b4dd..84e5fe16a 100644 --- a/build/assets/index-d6bbde2b.js +++ b/build/assets/index-f0d2a829.js @@ -1 +1 @@ -import"./index-311f5e1d.js";import{f as o}from"./index-b3d504b4.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-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}; diff --git a/build/assets/index-63ae9a26.js b/build/assets/index-f19bc108.js similarity index 50% rename from build/assets/index-63ae9a26.js rename to build/assets/index-f19bc108.js index 92bf3d512..30c8e4a1c 100644 --- a/build/assets/index-63ae9a26.js +++ b/build/assets/index-f19bc108.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-311f5e1d.js";import{ah as A,aP as B,aQ as E,aR as F,u as M,$ as N,e as k,a0 as O,B as z}from"./index-b3d504b4.js";import{B as D}from"./index-146a182e.js";import{u as w}from"./index-ea411943.js";import{S as P,A as R,I as Y}from"./constants-104c86df.js";import{O as H}from"./constants-b2a2fa82.js";import{A as W,T as X}from"./index-4410528e.js";import{C as $}from"./ClipLoader-3e52df85.js";import"./Stack-dcbf847f.js";import"./createSvgIcon-5d2e26a6.js";import"./TextareaAutosize-8373cbad.js";const Q=({topicId:s,onSelect:a,selectedValue:d,dataId:c})=>{const[u,h]=p.useState([]),[g,f]=p.useState(!1),j=p.useMemo(()=>{const o=async i=>{const m={is_muted:"False",sort_by:R,search:i,skip:"0",limit:"1000"};f(!0);try{const C=(await I(m.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==s);h(C)}catch{h([])}finally{f(!1)}};return T.debounce(o,300)},[s]),r=o=>{const i=o.trim();if(!i){h([]);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})},U=({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(Z,{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(Q,{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,{})})]})]})]}),Z=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-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)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -87,7 +87,7 @@ 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"./i transform: translateY(10px) translateX(3px); color: #6b7a8d; line-height: 1; -`,be=()=>{const{close:s}=M("mergeToNode"),[a,d,c]=w(l=>[l.data,l.ids,l.total]),u=N({mode:"onChange"}),[h,g]=p.useState(!1),[f,j]=p.useState(!1),[r,b]=p.useState(null),[t,S]=p.useState(),o=k();p.useEffect(()=>{o&&S(o)},[o]);const i=()=>{b(null),s()},m=async()=>{if(!(!r||!a)){g(!0);try{await L({from:t==null?void 0:t.ref_id,to:r==null?void 0:r.ref_id}),t!=null&&t.ref_id&&(a[t==null?void 0:t.ref_id]={...a[t==null?void 0:t.ref_id],edgeList:[Y],edgeCount:a[t==null?void 0:t.ref_id].edgeCount-1},w.setState({ids:d.filter(l=>l!==r.ref_id),total:c-1})),i()}catch(l){console.warn(l)}finally{g(!1)}}};return e.jsx(D,{id:"mergeToNode",kind:"small",onClose:i,preventOutsideClose:!0,children:e.jsxs(O,{...u,children:[e.jsx(U,{from:t,isSwapped:f,onSelect:b,selectedToNode:r,setIsSwapped:()=>j(!f)}),e.jsxs(ae,{color:"secondary","data-testid":"merge-topics-button",disabled:h||!r,onClick:m,size:"large",variant:"contained",children:["Merge topics",h&&e.jsx(re,{children:e.jsx($,{color:_.BLUE_PRESS_STATE,size:12})})]})]})})},ae=n(z)` +`,be=()=>{const{close:s}=M("mergeToNode"),[a,d,c]=w(l=>[l.data,l.ids,l.total]),u=N({mode:"onChange"}),[f,g]=p.useState(!1),[h,j]=p.useState(!1),[r,b]=p.useState(null),[t,S]=p.useState(),o=k();p.useEffect(()=>{o&&S(o)},[o]);const i=()=>{b(null),s()},m=async()=>{if(!(!r||!a)){g(!0);try{await L({from:t==null?void 0:t.ref_id,to:r==null?void 0:r.ref_id}),t!=null&&t.ref_id&&(a[t==null?void 0:t.ref_id]={...a[t==null?void 0:t.ref_id],edgeList:[Y],edgeCount:a[t==null?void 0:t.ref_id].edgeCount-1},w.setState({ids:d.filter(l=>l!==r.ref_id),total:c-1})),i()}catch(l){console.warn(l)}finally{g(!1)}}};return e.jsx(D,{id:"mergeToNode",kind:"small",onClose:i,preventOutsideClose:!0,children:e.jsxs(O,{...u,children:[e.jsx(Z,{from:t,isSwapped:h,onSelect:b,selectedToNode:r,setIsSwapped:()=>j(!h)}),e.jsxs(ae,{color:"secondary","data-testid":"merge-topics-button",disabled:f||!r,onClick:m,size:"large",variant:"contained",children:["Merge topics",f&&e.jsx(re,{children:e.jsx(Q,{color:_.BLUE_PRESS_STATE,size:12})})]})]})})},ae=n(z)` width: 293px !important; margin: 0 0 10px auto !important; `,re=n.span` diff --git a/build/assets/index-97c1e407.js b/build/assets/index-f27ea18e.js similarity index 61% rename from build/assets/index-97c1e407.js rename to build/assets/index-f27ea18e.js index 656a91fc3..7640262c5 100644 --- a/build/assets/index-97c1e407.js +++ b/build/assets/index-f27ea18e.js @@ -1,4 +1,4 @@ -import{aB as j,aC as E,aD as b,aE as R,aF as T,aG as D,aH as U,aI as G,t as p,v as u,z as O,r as h,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-311f5e1d.js";import{aL as ae,B as z,ag as ie,u as ce,$ as le,a0 as de}from"./index-b3d504b4.js";import{B as ue}from"./index-146a182e.js";import{S as pe}from"./index-994f71d4.js";import{e as xe}from"./index.esm-46402b6f.js";import{C as fe}from"./ClipLoader-3e52df85.js";import{T as he}from"./index-44c82821.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))?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),$e=({onClick:t,loading:s,type:n,error:o})=>{const y=O(i=>i.budget),[a,x]=h.useState(10),d=_(n)?"radar":"add_node";return h.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(Te,{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(fe,{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]})},Te=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-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"})` width: 141px; height: 61px; border: 1px solid ${u.GRAY7}; @@ -81,11 +81,11 @@ import{aB as j,aC as E,aD as b,aE as R,aF as T,aG as D,aH as U,aI as G,t as p,v width: 16px; height: 16px; } -`,Ie=/^(https?:\/\/)/g,Le=/(www\.)?/g,De=/[\w-]+(\.[\w-]+)*/g,Ue=/(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61})[a-zA-Z0-9](?:\.[a-zA-Z]{2,})/g,Ge=/(\/[^\s?]*)?/g,Oe=/(\?[^\s]*)?/g,Z=new RegExp(`${Ie.source}${Le.source}${De.source}${Ue.source}?${Ge.source}${Oe.source}$`,"i"),M=t=>{if(t==null?void 0:t.match(Z)){const o=new URL(t).hostname;return o!=null&&o.startsWith("www.")?((o==null?void 0:o.match(/\./g))||[]).length>=2:((o==null?void 0:o.match(/\./g))||[]).length>=1}return!1},Ze=({type:t,onNextStep:s,allowNextStep:n})=>e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(Me,{children:"Add Content"})})}),e.jsx(r,{mb:12,children:e.jsx(he,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here...",rules:{...K,...t!==T?{pattern:{message:"Please enter a valid URL",value:Z},validate:{source:M}}:{}}})}),e.jsx(r,{children:e.jsx(z,{color:"secondary","data-testid":"add-content-btn",disabled:!n,onClick:s,size:"large",variant:"contained",children:"Next"})})]}),Me=p(C)` +`,Ie=/^(https?:\/\/)/g,Le=/(www\.)?/g,De=/[\w-]+(\.[\w-]+)*/g,Ue=/(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61})[a-zA-Z0-9](?:\.[a-zA-Z]{2,})/g,Ge=/(\/[^\s?]*)?/g,Oe=/(\?[^\s]*)?/g,Z=new RegExp(`${Ie.source}${Le.source}${De.source}${Ue.source}?${Ge.source}${Oe.source}$`,"i"),M=t=>{if(t==null?void 0:t.match(Z)){const o=new URL(t).hostname;return o!=null&&o.startsWith("www.")?((o==null?void 0:o.match(/\./g))||[]).length>=2:((o==null?void 0:o.match(/\./g))||[]).length>=1}return!1},Ze=({type:t,onNextStep:s,allowNextStep:n})=>e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(Me,{children:"Add Content"})})}),e.jsx(r,{mb:12,children:e.jsx(fe,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here...",rules:{...K,...t!==$?{pattern:{message:"Please enter a valid URL",value:Z},validate:{source:M}}:{}}})}),e.jsx(r,{children:e.jsx(z,{color:"secondary","data-testid":"add-content-btn",disabled:!n,onClick:s,size:"large",variant:"contained",children:"Next"})})]}),Me=p(C)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,$={[j]:{label:"Twitter handle",img:"twitter_default.svg"},[E]:{label:"Youtube channel",img:"youtube_default.svg"},[b]:{label:"RSS Feed",img:"rss_feed.svg"},[R]:{label:"GitHub Repository",img:"github_default.svg"}},Fe=({onNextStep:t,onPrevStep:s,type:n,value:o})=>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(We,{children:"Source Type"})})}),e.jsxs(r,{mb:20,children:[e.jsxs(qe,{children:[e.jsx("img",{alt:$[n].label,className:"badge__img",src:$[n].img}),e.jsx(Ye,{children:$[n].label})]}),e.jsx(He,{children:Be(o,n)??o})]}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(Ve,{color:"secondary",disabled:!1,onClick:()=>s(),size:"large",variant:"contained",children:"Cancel"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(z,{color:"secondary","data-testid":"source_next_btn",onClick:()=>t(),size:"large",variant:"contained",children:"Next"})})]})]}),He=p(r)` +`,T={[j]:{label:"Twitter handle",img:"twitter_default.svg"},[E]:{label:"Youtube channel",img:"youtube_default.svg"},[b]:{label:"RSS Feed",img:"rss_feed.svg"},[R]:{label:"GitHub Repository",img:"github_default.svg"}},Fe=({onNextStep:t,onPrevStep:s,type:n,value:o})=>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(We,{children:"Source Type"})})}),e.jsxs(r,{mb:20,children:[e.jsxs(qe,{children:[e.jsx("img",{alt:T[n].label,className:"badge__img",src:T[n].img}),e.jsx(Ye,{children:T[n].label})]}),e.jsx(He,{children:Be(o,n)??o})]}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(Ve,{color:"secondary",disabled:!1,onClick:()=>s(),size:"large",variant:"contained",children:"Cancel"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(z,{color:"secondary","data-testid":"source_next_btn",onClick:()=>t(),size:"large",variant:"contained",children:"Next"})})]})]}),He=p(r)` font-family: Barlow; font-size: 14px; font-weight: 400; @@ -130,4 +130,4 @@ import{aB as j,aC as E,aD as b,aE as R,aF as T,aG as D,aH as U,aI as G,t as p,v color: ${u.BG2}; } } -`,F=async(t,s,n,o)=>{const y=_(s)?"radar":"add_node",a={};if(s===T)a.media_url=t.source,a.content_type="audio_video";else if(s===D){if(/(?:https?:\/\/)?(?:www\.)?(twitter|x)\.com\/\w+\/status\/(\d+)/s.test(t.source)){const c=/\/status\/(\d+)/,l=t.source.match(c);if(l!=null&&l[1]){const[,S]=l;a.tweet_id=S}}else a.tweet_id=t.source;a.content_type="tweet"}else if(s===U)a.content_type="webpage",a.web_page=t.source;else if(s===G)a.content_type="document",a.text=t.source;else if(s===j){const[,i]=(t.source||"").match(A)||[];if(i)a.source=i,a.source_type=s;else return}else(s===E||s===b||s===R)&&(a.source=t.source,a.source_type=s);t.latitude&&t.longitude&&(a.latitude=t.latitude,a.longitude=t.longitude);let x="",d;X?d=await te.enable():d=await ee.enable(),a.pubkey=d==null?void 0:d.pubkey,x=await se();try{const i=await ne.post(`/${y}`,JSON.stringify(a),{Authorization:x});if(await oe(n),i.data.project_id&&o(i.data.project_id),i.error){const{message:c}=i.error;throw new Error(c)}}catch(i){if(i.status===402)await re(n),await F(t,s,n,o);else{let c=m;if(i.status===400)try{const l=await i.json();c=l.message||l.status||(l==null?void 0:l.errorCode)||m}catch{c=m}else i instanceof Error&&(c=i.message||m);throw new Error(c)}}},nt=()=>{const[t,s]=h.useState(0),{close:n,visible:o}=ce("addContent"),{setBudget:y}=O(g=>g),{setRunningProjectId:a}=Q(g=>g),x=le({mode:"onChange"}),{watch:d,setValue:i,reset:c}=x,[l,S]=h.useState(!1),[H,k]=h.useState("");h.useEffect(()=>()=>{k(""),s(0),c()},[o,c]);const w=d("inputType"),N=d("source"),P=d("source"),W=M(N);h.useEffect(()=>{(async()=>{const f=await ze(P);i("inputType",f)})()},[P,i]);const Y=()=>{n()},I=()=>{s(t===0?_(w)?1:2:t+1)},q=()=>{s(t-1)},V=x.handleSubmit(async g=>{S(!0);try{await F(g,w,y,a),pe("Content Added"),Y()}catch(f){let B=m;if((f==null?void 0:f.status)===400){const v=await f.json();B=v.errorCode||(v==null?void 0:v.status)||m}else f instanceof Error&&(B=f.message);k(String(B))}finally{S(!1)}});return e.jsx(ue,{id:"addContent",kind:"small",onClose:n,preventOutsideClose:!0,children:e.jsx(de,{...x,children:e.jsxs("form",{id:"add-node-form",onSubmit:V,children:[t===0&&e.jsx(Ze,{allowNextStep:W,onNextStep:I,type:w}),t===1&&_(w)&&e.jsx(Fe,{onNextStep:I,onPrevStep:q,type:w,value:N}),t===2&&e.jsx($e,{error:H,loading:l,onClick:()=>null,type:w})]})})})};export{nt as AddContentModal}; +`,F=async(t,s,n,o)=>{const y=_(s)?"radar":"add_node",a={};if(s===$)a.media_url=t.source,a.content_type="audio_video";else if(s===D){if(/(?:https?:\/\/)?(?:www\.)?(twitter|x)\.com\/\w+\/status\/(\d+)/s.test(t.source)){const c=/\/status\/(\d+)/,l=t.source.match(c);if(l!=null&&l[1]){const[,S]=l;a.tweet_id=S}}else a.tweet_id=t.source;a.content_type="tweet"}else if(s===U)a.content_type="webpage",a.web_page=t.source;else if(s===G)a.content_type="document",a.text=t.source;else if(s===j){const[,i]=(t.source||"").match(A)||[];if(i)a.source=i,a.source_type=s;else return}else(s===E||s===b||s===R)&&(a.source=t.source,a.source_type=s);t.latitude&&t.longitude&&(a.latitude=t.latitude,a.longitude=t.longitude);let x="",d;X?d=await te.enable():d=await ee.enable(),a.pubkey=d==null?void 0:d.pubkey,x=await se();try{const i=await ne.post(`/${y}`,JSON.stringify(a),{Authorization:x});if(await oe(n),i.data.project_id&&o(i.data.project_id),i.error){const{message:c}=i.error;throw new Error(c)}}catch(i){if(i.status===402)await re(n),await F(t,s,n,o);else{let c=m;if(i.status===400)try{const l=await i.json();c=l.message||l.status||(l==null?void 0:l.errorCode)||m}catch{c=m}else i instanceof Error&&(c=i.message||m);throw new Error(c)}}},nt=()=>{const[t,s]=f.useState(0),{close:n,visible:o}=ce("addContent"),{setBudget:y}=O(g=>g),{setRunningProjectId:a}=Q(g=>g),x=le({mode:"onChange"}),{watch:d,setValue:i,reset:c}=x,[l,S]=f.useState(!1),[H,k]=f.useState("");f.useEffect(()=>()=>{k(""),s(0),c()},[o,c]);const w=d("inputType"),N=d("source"),P=d("source"),W=M(N);f.useEffect(()=>{(async()=>{const h=await ze(P);i("inputType",h)})()},[P,i]);const Y=()=>{n()},I=()=>{s(t===0?_(w)?1:2:t+1)},q=()=>{s(t-1)},V=x.handleSubmit(async g=>{S(!0);try{await F(g,w,y,a),pe("Content Added"),Y()}catch(h){let B=m;if((h==null?void 0:h.status)===400){const v=await h.json();B=v.errorCode||(v==null?void 0:v.status)||m}else h instanceof Error&&(B=h.message);k(String(B))}finally{S(!1)}});return e.jsx(ue,{id:"addContent",kind:"small",onClose:n,preventOutsideClose:!0,children:e.jsx(de,{...x,children:e.jsxs("form",{id:"add-node-form",onSubmit:V,children:[t===0&&e.jsx(Ze,{allowNextStep:W,onNextStep:I,type:w}),t===1&&_(w)&&e.jsx(Fe,{onNextStep:I,onPrevStep:q,type:w,value:N}),t===2&&e.jsx(Te,{error:H,loading:l,onClick:()=>null,type:w})]})})})};export{nt as AddContentModal}; diff --git a/build/assets/index-20836eed.js b/build/assets/index-ff6c14e9.js similarity index 76% rename from build/assets/index-20836eed.js rename to build/assets/index-ff6c14e9.js index a2e165c56..4c3f2c09e 100644 --- a/build/assets/index-20836eed.js +++ b/build/assets/index-ff6c14e9.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-311f5e1d.js";import{aL as ce,B as C,ag as le,Z as de,u as D,$ as pe,f as me,a0 as xe}from"./index-b3d504b4.js";import{B as ue}from"./index-146a182e.js";import{S as he}from"./index-994f71d4.js";import{e as fe}from"./index.esm-46402b6f.js";import{C as J}from"./ClipLoader-3e52df85.js";import{n as B,O as ye,i as ge}from"./constants-b2a2fa82.js";import{p as q}from"./index-e1867c29.js";import{T as F}from"./index-44c82821.js";import{A as je}from"./index-4410528e.js";import{c as we}from"./index-64f1c910.js";import"./three.module-ebe9f2a4.js";import"./Stack-dcbf847f.js";import"./createSvgIcon-5d2e26a6.js";import"./TextareaAutosize-8373cbad.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-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"})` width: 141px; height: 61px; border: 1px solid ${b.GRAY7}; @@ -120,4 +120,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 font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,Pe=async(o,a,c)=>{var f;const x=Object.entries(o).reduce((n,[j,p])=>(p!=null&&p!==""&&(n[j]=p),n),{}),{nodeType:d,typeName:r,sourceLink:m,...l}=x;let h="",w="";d!=="Create custom type"&&await re(async()=>{const n=await ie.enable();w=n==null?void 0:n.pubkey,h=await ae()});try{const n=await Se(d,l,m,r,h,w);c(o,(f=n==null?void 0:n.data)==null?void 0:f.ref_id)}catch(n){let j=I;if(n.status===400){const p=await n.json();j=p.message||p.errorCode||(p==null?void 0:p.status)||I}else n instanceof Error&&(j=n.message);throw new Error(j)}},et=()=>{const[o,a]=y.useState("sourceType"),{close:c,visible:x}=D("addItem"),{open:d}=D("addType"),{setBudget:r}=V(i=>i),m=pe({mode:"onChange"}),{watch:l,setValue:h,reset:w}=m,[f,n]=y.useState(!1),[j,p]=y.useState(""),{addNewNode:s}=oe(i=>i),[u]=me(i=>[i.setSelectedNode]);y.useEffect(()=>()=>{a("sourceType"),w()},[x,w]);const S=l("nodeType"),A=l("typeName"),_=l("sourceLink"),U=l("type");l("title");const M=()=>{c()},E=i=>{p(""),a(i)},W=(i,N)=>{const v=N||`new-id-${Math.random()}`,k=i.nodeType.toLocaleLowerCase(),K=Object.entries(i).reduce(($,[Q,z])=>(z!=null&&z!==""&&($[Q]=z),$),{}),P={name:i.typeName??i.name,type:k,label:i.typeName??i.name,node_type:k,id:v,edge_count:0,ref_id:v,x:Math.random(),y:Math.random(),z:Math.random(),date:parseInt((new Date().getTime()/1e3).toFixed(0),10),weight:4,...i.source_link?{source_link:i.source_link}:{},properties:{...K}};s({nodes:[P],links:[]}),u(P)},Y=m.handleSubmit(async i=>{p(""),n(!0);try{await Pe(i,r,W),he("Item Added"),M()}catch(N){let v=I;if((N==null?void 0:N.status)===400){const k=await N.json();v=k.errorCode||(k==null?void 0:k.status)||I}else N instanceof Error&&(v=N.message);p(String(v))}finally{n(!1)}}),O=i=>{i==="Create custom type"?d():h("nodeType",i)},Z={sourceType:e.jsx(Me,{allowNextStep:!!S,onSelectType:O,selectedType:S,skipToStep:E}),source:e.jsx(Le,{name:A,skipToStep:E,sourceLink:_||"",type:S}),setBudget:e.jsx(Ne,{error:j,loading:f,onClick:()=>null}),createConfirmation:e.jsx(Be,{onclose:M,type:U}),setAttribues:e.jsx(Ie,{handleSelectType:O,nodeType:S,skipToStep:E})},H="small";return e.jsx(ue,{id:"addItem",kind:H,onClose:c,preventOutsideClose:!0,children:e.jsx(xe,{...m,children:e.jsx("form",{id:"add-node-form",onSubmit:Y,children:Z[o]})})})};export{et as AddItemModal}; +`,Pe=async(o,a,c)=>{var f;const x=Object.entries(o).reduce((n,[j,p])=>(p!=null&&p!==""&&(n[j]=p),n),{}),{nodeType:d,typeName:r,sourceLink:m,...l}=x;let h="",w="";d!=="Create custom type"&&await re(async()=>{const n=await ie.enable();w=n==null?void 0:n.pubkey,h=await ae()});try{const n=await Se(d,l,m,r,h,w);c(o,(f=n==null?void 0:n.data)==null?void 0:f.ref_id)}catch(n){let j=I;if(n.status===400){const p=await n.json();j=p.message||p.errorCode||(p==null?void 0:p.status)||I}else n instanceof Error&&(j=n.message);throw new Error(j)}},et=()=>{const[o,a]=y.useState("sourceType"),{close:c,visible:x}=D("addItem"),{open:d}=D("addType"),{setBudget:r}=V(i=>i),m=pe({mode:"onChange"}),{watch:l,setValue:h,reset:w}=m,[f,n]=y.useState(!1),[j,p]=y.useState(""),{addNewNode:s}=oe(i=>i),[u]=me(i=>[i.setSelectedNode]);y.useEffect(()=>()=>{a("sourceType"),w()},[x,w]);const S=l("nodeType"),A=l("typeName"),_=l("sourceLink"),U=l("type");l("title");const M=()=>{c()},E=i=>{p(""),a(i)},W=(i,N)=>{const v=N||`new-id-${Math.random()}`,k=i.nodeType.toLocaleLowerCase(),Z=Object.entries(i).reduce(($,[Q,z])=>(z!=null&&z!==""&&($[Q]=z),$),{}),P={name:i.typeName??i.name,type:k,label:i.typeName??i.name,node_type:k,id:v,edge_count:0,ref_id:v,x:Math.random(),y:Math.random(),z:Math.random(),date:parseInt((new Date().getTime()/1e3).toFixed(0),10),weight:4,...i.source_link?{source_link:i.source_link}:{},properties:{...Z}};s({nodes:[P],links:[]}),u(P)},Y=m.handleSubmit(async i=>{p(""),n(!0);try{await Pe(i,r,W),he("Item Added"),M()}catch(N){let v=I;if((N==null?void 0:N.status)===400){const k=await N.json();v=k.errorCode||(k==null?void 0:k.status)||I}else N instanceof Error&&(v=N.message);p(String(v))}finally{n(!1)}}),O=i=>{i==="Create custom type"?d():h("nodeType",i)},H={sourceType:e.jsx(Me,{allowNextStep:!!S,onSelectType:O,selectedType:S,skipToStep:E}),source:e.jsx(Le,{name:A,skipToStep:E,sourceLink:_||"",type:S}),setBudget:e.jsx(Ne,{error:j,loading:f,onClick:()=>null}),createConfirmation:e.jsx(Be,{onclose:M,type:U}),setAttribues:e.jsx(Ie,{handleSelectType:O,nodeType:S,skipToStep:E})},K="small";return e.jsx(ue,{id:"addItem",kind:K,onClose:c,preventOutsideClose:!0,children:e.jsx(xe,{...m,children:e.jsx("form",{id:"add-node-form",onSubmit:Y,children:H[o]})})})};export{et as AddItemModal}; diff --git a/build/assets/index.esm-46402b6f.js b/build/assets/index.esm-86c83cdb.js similarity index 98% rename from build/assets/index.esm-46402b6f.js rename to build/assets/index.esm-86c83cdb.js index 72562e507..c0a242642 100644 --- a/build/assets/index.esm-46402b6f.js +++ b/build/assets/index.esm-86c83cdb.js @@ -1 +1 @@ -import{R as c}from"./index-311f5e1d.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);++fh||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/H.x),i.x=s.x*H.x,D.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/H.y),i.y=s.y*H.y,D.mapSize.y=s.y)),D.map===null){const K=this.type!==Bi?{minFilter:ot,magFilter:ot}:{};D.map=new Ot(i.x,i.y,K),D.map.texture.name=ee.name+".shadowMap",D.camera.updateProjectionMatrix()}o.setRenderTarget(D.map),o.clear();const z=D.getViewportCount();for(let K=0;K0){const Z=P.uuid,ee=b.uuid;let D=c[Z];D===void 0&&(D={},c[Z]=D);let H=D[ee];H===void 0&&(H=P.clone(),D[ee]=H),P=H}return P.visible=b.visible,P.wireframe=b.wireframe,E===Bi?P.side=b.shadowSide!==null?b.shadowSide:b.side:P.side=b.shadowSide!==null?b.shadowSide:u[b.side],P.alphaMap=b.alphaMap,P.alphaTest=b.alphaTest,P.clipShadows=b.clipShadows,P.clippingPlanes=b.clippingPlanes,P.clipIntersection=b.clipIntersection,P.displacementMap=b.displacementMap,P.displacementScale=b.displacementScale,P.displacementBias=b.displacementBias,P.wireframeLinewidth=b.wireframeLinewidth,P.linewidth=b.linewidth,S.isPointLight===!0&&P.isMeshDistanceMaterial===!0&&(P.referencePosition.setFromMatrixPosition(S.matrixWorld),P.nearDistance=L,P.farDistance=y),P}function M(v,b,S,L,y){if(v.visible===!1)return;if(v.layers.test(b.layers)&&(v.isMesh||v.isLine||v.isPoints)&&(v.castShadow||v.receiveShadow&&y===Bi)&&(!v.frustumCulled||n.intersectsObject(v))){v.modelViewMatrix.multiplyMatrices(S.matrixWorldInverse,v.matrixWorld);const I=e.update(v),Z=v.material;if(Array.isArray(Z)){const ee=I.groups;for(let D=0,H=ee.length;D=1):$.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),z=K>=2);let B=null,V={};const te=o.getParameter(3088),j=o.getParameter(2978),se=new He().fromArray(te),ge=new He().fromArray(j);function Se(R,de,G){const he=new Uint8Array(4),ce=o.createTexture();o.bindTexture(R,ce),o.texParameteri(R,10241,9728),o.texParameteri(R,10240,9728);for(let Ue=0;UeQ||C.height>Q)&&(ie=Q/Math.max(C.width,C.height)),ie<1||w===!0)if(typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&C instanceof ImageBitmap){const le=w?qr:Math.floor,Te=le(ie*C.width),U=le(ie*C.height);p===void 0&&(p=x(Te,U));const _e=O?x(Te,U):p;return _e.width=Te,_e.height=U,_e.getContext("2d").drawImage(C,0,0,Te,U),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+C.width+"x"+C.height+") to ("+Te+"x"+U+")."),_e}else return"data"in C&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+C.width+"x"+C.height+")."),C;return C}function v(C){return So(C.width)&&So(C.height)}function b(C){return a?!1:C.wrapS!==vt||C.wrapT!==vt||C.minFilter!==ot&&C.minFilter!==it}function S(C,w){return C.generateMipmaps&&w&&C.minFilter!==ot&&C.minFilter!==it}function L(C){o.generateMipmap(C)}function y(C,w,O,Q,ie=!1){if(a===!1)return w;if(C!==null){if(o[C]!==void 0)return o[C];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+C+"'")}let le=w;return w===6403&&(O===5126&&(le=33326),O===5131&&(le=33325),O===5121&&(le=33321)),w===33319&&(O===5126&&(le=33328),O===5131&&(le=33327),O===5121&&(le=33323)),w===6408&&(O===5126&&(le=34836),O===5131&&(le=34842),O===5121&&(le=Q===Je&&ie===!1?35907:32856),O===32819&&(le=32854),O===32820&&(le=32855)),(le===33325||le===33326||le===33327||le===33328||le===34842||le===34836)&&e.get("EXT_color_buffer_float"),le}function E(C,w,O){return S(C,O)===!0||C.isFramebufferTexture&&C.minFilter!==ot&&C.minFilter!==it?Math.log2(Math.max(w.width,w.height))+1:C.mipmaps!==void 0&&C.mipmaps.length>0?C.mipmaps.length:C.isCompressedTexture&&Array.isArray(C.image)?w.mipmaps.length:1}function P(C){return C===ot||C===Gr||C===Hr?9728:9729}function I(C){const w=C.target;w.removeEventListener("dispose",I),ee(w),w.isVideoTexture&&g.delete(w)}function Z(C){const w=C.target;w.removeEventListener("dispose",Z),H(w)}function ee(C){const w=n.get(C);if(w.__webglInit===void 0)return;const O=C.source,Q=m.get(O);if(Q){const ie=Q[w.__cacheKey];ie.usedTimes--,ie.usedTimes===0&&D(C),Object.keys(Q).length===0&&m.delete(O)}n.remove(C)}function D(C){const w=n.get(C);o.deleteTexture(w.__webglTexture);const O=C.source,Q=m.get(O);delete Q[w.__cacheKey],r.memory.textures--}function H(C){const w=C.texture,O=n.get(C),Q=n.get(w);if(Q.__webglTexture!==void 0&&(o.deleteTexture(Q.__webglTexture),r.memory.textures--),C.depthTexture&&C.depthTexture.dispose(),C.isWebGLCubeRenderTarget)for(let ie=0;ie<6;ie++)o.deleteFramebuffer(O.__webglFramebuffer[ie]),O.__webglDepthbuffer&&o.deleteRenderbuffer(O.__webglDepthbuffer[ie]);else{if(o.deleteFramebuffer(O.__webglFramebuffer),O.__webglDepthbuffer&&o.deleteRenderbuffer(O.__webglDepthbuffer),O.__webglMultisampledFramebuffer&&o.deleteFramebuffer(O.__webglMultisampledFramebuffer),O.__webglColorRenderbuffer)for(let ie=0;ie=l&&console.warn("THREE.WebGLTextures: Trying to use "+C+" texture units while this GPU supports only "+l),z+=1,C}function B(C){const w=[];return w.push(C.wrapS),w.push(C.wrapT),w.push(C.magFilter),w.push(C.minFilter),w.push(C.anisotropy),w.push(C.internalFormat),w.push(C.format),w.push(C.type),w.push(C.generateMipmaps),w.push(C.premultiplyAlpha),w.push(C.flipY),w.push(C.unpackAlignment),w.push(C.encoding),w.join()}function V(C,w){const O=n.get(C);if(C.isVideoTexture&&Ze(C),C.isRenderTargetTexture===!1&&C.version>0&&O.__version!==C.version){const Q=C.image;if(Q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Me(O,C,w);return}}t.activeTexture(33984+w),t.bindTexture(3553,O.__webglTexture)}function te(C,w){const O=n.get(C);if(C.version>0&&O.__version!==C.version){Me(O,C,w);return}t.activeTexture(33984+w),t.bindTexture(35866,O.__webglTexture)}function j(C,w){const O=n.get(C);if(C.version>0&&O.__version!==C.version){Me(O,C,w);return}t.activeTexture(33984+w),t.bindTexture(32879,O.__webglTexture)}function se(C,w){const O=n.get(C);if(C.version>0&&O.__version!==C.version){Ae(O,C,w);return}t.activeTexture(33984+w),t.bindTexture(34067,O.__webglTexture)}const ge={[As]:10497,[vt]:33071,[Ts]:33648},Se={[ot]:9728,[Gr]:9984,[Hr]:9986,[it]:9729,[zo]:9985,[hi]:9987};function q(C,w,O){if(O?(o.texParameteri(C,10242,ge[w.wrapS]),o.texParameteri(C,10243,ge[w.wrapT]),(C===32879||C===35866)&&o.texParameteri(C,32882,ge[w.wrapR]),o.texParameteri(C,10240,Se[w.magFilter]),o.texParameteri(C,10241,Se[w.minFilter])):(o.texParameteri(C,10242,33071),o.texParameteri(C,10243,33071),(C===32879||C===35866)&&o.texParameteri(C,32882,33071),(w.wrapS!==vt||w.wrapT!==vt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),o.texParameteri(C,10240,P(w.magFilter)),o.texParameteri(C,10241,P(w.minFilter)),w.minFilter!==ot&&w.minFilter!==it&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Q=e.get("EXT_texture_filter_anisotropic");if(w.type===on&&e.has("OES_texture_float_linear")===!1||a===!1&&w.type===Wi&&e.has("OES_texture_half_float_linear")===!1)return;(w.anisotropy>1||n.get(w).__currentAnisotropy)&&(o.texParameterf(C,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy)}}function De(C,w){let O=!1;C.__webglInit===void 0&&(C.__webglInit=!0,w.addEventListener("dispose",I));const Q=w.source;let ie=m.get(Q);ie===void 0&&(ie={},m.set(Q,ie));const le=B(w);if(le!==C.__cacheKey){ie[le]===void 0&&(ie[le]={texture:o.createTexture(),usedTimes:0},r.memory.textures++,O=!0),ie[le].usedTimes++;const Te=ie[C.__cacheKey];Te!==void 0&&(ie[C.__cacheKey].usedTimes--,Te.usedTimes===0&&D(w)),C.__cacheKey=le,C.__webglTexture=ie[le].texture}return O}function Me(C,w,O){let Q=3553;w.isDataArrayTexture&&(Q=35866),w.isData3DTexture&&(Q=32879);const ie=De(C,w),le=w.source;if(t.activeTexture(33984+O),t.bindTexture(Q,C.__webglTexture),le.version!==le.__currentVersion||ie===!0){o.pixelStorei(37440,w.flipY),o.pixelStorei(37441,w.premultiplyAlpha),o.pixelStorei(3317,w.unpackAlignment),o.pixelStorei(37443,0);const Te=b(w)&&v(w.image)===!1;let U=M(w.image,Te,!1,h);U=Xe(w,U);const _e=v(U)||a,fe=s.convert(w.format,w.encoding);let ve=s.convert(w.type),pe=y(w.internalFormat,fe,ve,w.encoding,w.isVideoTexture);q(Q,w,_e);let Re;const Ve=w.mipmaps,et=a&&w.isVideoTexture!==!0,R=le.__currentVersion===void 0||ie===!0,de=E(w,U,_e);if(w.isDepthTexture)pe=6402,a?w.type===on?pe=36012:w.type===wn?pe=33190:w.type===jn?pe=35056:pe=33189:w.type===on&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),w.format===An&&pe===6402&&w.type!==Bo&&w.type!==wn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),w.type=wn,ve=s.convert(w.type)),w.format===ii&&pe===6402&&(pe=34041,w.type!==jn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),w.type=jn,ve=s.convert(w.type))),R&&(et?t.texStorage2D(3553,1,pe,U.width,U.height):t.texImage2D(3553,0,pe,U.width,U.height,0,fe,ve,null));else if(w.isDataTexture)if(Ve.length>0&&_e){et&&R&&t.texStorage2D(3553,de,pe,Ve[0].width,Ve[0].height);for(let G=0,he=Ve.length;G>=1,he>>=1}}else if(Ve.length>0&&_e){et&&R&&t.texStorage2D(3553,de,pe,Ve[0].width,Ve[0].height);for(let G=0,he=Ve.length;G0&&R++,t.texStorage2D(34067,R,Re,U[0].width,U[0].height));for(let G=0;G<6;G++)if(Te){Ve?t.texSubImage2D(34069+G,0,0,0,U[G].width,U[G].height,ve,pe,U[G].data):t.texImage2D(34069+G,0,Re,U[G].width,U[G].height,0,ve,pe,U[G].data);for(let he=0;he0&&ye(C)===!1){const U=le?w:[w];O.__webglMultisampledFramebuffer=o.createFramebuffer(),O.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,O.__webglMultisampledFramebuffer);for(let _e=0;_e0&&ye(C)===!1){const w=C.isWebGLMultipleRenderTargets?C.texture:[C.texture],O=C.width,Q=C.height;let ie=16384;const le=[],Te=C.stencilBuffer?33306:36096,U=n.get(C),_e=C.isWebGLMultipleRenderTargets===!0;if(_e)for(let fe=0;fe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function Ze(C){const w=r.render.frame;g.get(C)!==w&&(g.set(C,w),C.update())}function Xe(C,w){const O=C.encoding,Q=C.format,ie=C.type;return C.isCompressedTexture===!0||C.isVideoTexture===!0||C.format===Wr||O!==Ln&&(O===Je?a===!1?e.has("EXT_sRGB")===!0&&Q===zt?(C.format=Wr,C.minFilter=it,C.generateMipmaps=!1):w=ko.sRGBToLinear(w):(Q!==zt||ie!==Cn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",O)),w}this.allocateTextureUnit=$,this.resetTextureUnits=K,this.setTexture2D=V,this.setTexture2DArray=te,this.setTexture3D=j,this.setTextureCube=se,this.rebindTextures=ne,this.setupRenderTarget=xe,this.updateRenderTargetMipmap=ae,this.updateMultisampleRenderTarget=Ee,this.setupDepthRenderbuffer=W,this.setupFrameBufferTexture=oe,this.useMultisampledRTT=ye}function Xh(o,e,t){const n=t.isWebGL2;function i(s,r=null){let a;if(s===Cn)return 5121;if(s===mh)return 32819;if(s===gh)return 32820;if(s===dh)return 5120;if(s===fh)return 5122;if(s===Bo)return 5123;if(s===ph)return 5124;if(s===wn)return 5125;if(s===on)return 5126;if(s===Wi)return n?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===xh)return 6406;if(s===zt)return 6408;if(s===vh)return 6409;if(s===yh)return 6410;if(s===An)return 6402;if(s===ii)return 34041;if(s===Mh)return 6403;if(s===_h)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===Wr)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===bh)return 36244;if(s===wh)return 33319;if(s===Sh)return 33320;if(s===Ah)return 36249;if(s===Dr||s===Fr||s===Nr||s===zr)if(r===Je)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Dr)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Fr)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Nr)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===zr)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Dr)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Fr)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Nr)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===zr)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===to||s===no||s===io||s===so)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===to)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===no)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===io)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===so)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Th)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===ro||s===ao)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===ro)return r===Je?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===ao)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===oo||s===lo||s===co||s===ho||s===uo||s===fo||s===po||s===mo||s===go||s===xo||s===_o||s===vo||s===yo||s===Mo)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===oo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===lo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===co)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===ho)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===uo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===fo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===po)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===mo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===go)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===xo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===_o)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===vo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===yo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Mo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===bo)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===bo)return r===Je?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return s===jn?n?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):o[s]!==void 0?o[s]:null}return{convert:i}}class Yh extends dt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ki extends We{constructor(){super(),this.isGroup=!0,this.type="Group"}}const k0={type:"move"};class Ua{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ki,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ki,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new A,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new A),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ki,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new A,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new A),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,r=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){r=!0;for(const p of e.hand.values()){const m=t.getJointPose(p,n);if(c.joints[p.jointName]===void 0){const x=new ki;x.matrixAutoUpdate=!1,x.visible=!1,c.joints[p.jointName]=x,c.add(x)}const _=c.joints[p.jointName];m!==null&&(_.matrix.fromArray(m.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.jointRadius=m.radius),_.visible=m!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,g=.005;c.inputState.pinching&&d>f+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(k0)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=r!==null),this}}class Zh extends ct{constructor(e,t,n,i,s,r,a,l,c,h){if(h=h!==void 0?h:An,h!==An&&h!==ii)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===An&&(n=wn),n===void 0&&h===ii&&(n=jn),super(null,i,s,r,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:ot,this.minFilter=l!==void 0?l:ot,this.flipY=!1,this.generateMipmaps=!1}}class V0 extends un{constructor(e,t){super();const n=this;let i=null,s=1,r=null,a="local-floor",l=null,c=null,h=null,u=null,d=null,f=null;const g=t.getContextAttributes();let p=null,m=null;const _=[],x=[],M=new dt;M.layers.enable(1),M.viewport=new He;const v=new dt;v.layers.enable(2),v.viewport=new He;const b=[M,v],S=new Yh;S.layers.enable(1),S.layers.enable(2);let L=null,y=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let V=_[B];return V===void 0&&(V=new Ua,_[B]=V),V.getTargetRaySpace()},this.getControllerGrip=function(B){let V=_[B];return V===void 0&&(V=new Ua,_[B]=V),V.getGripSpace()},this.getHand=function(B){let V=_[B];return V===void 0&&(V=new Ua,_[B]=V),V.getHandSpace()};function E(B){const V=x.indexOf(B.inputSource);if(V===-1)return;const te=_[V];te!==void 0&&te.dispatchEvent({type:B.type,data:B.inputSource})}function P(){i.removeEventListener("select",E),i.removeEventListener("selectstart",E),i.removeEventListener("selectend",E),i.removeEventListener("squeeze",E),i.removeEventListener("squeezestart",E),i.removeEventListener("squeezeend",E),i.removeEventListener("end",P),i.removeEventListener("inputsourceschange",I);for(let B=0;B<_.length;B++){const V=x[B];V!==null&&(x[B]=null,_[B].disconnect(V))}L=null,y=null,e.setRenderTarget(p),d=null,u=null,h=null,i=null,m=null,$.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){s=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){a=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||r},this.setReferenceSpace=function(B){l=B},this.getBaseLayer=function(){return u!==null?u:d},this.getBinding=function(){return h},this.getFrame=function(){return f},this.getSession=function(){return i},this.setSession=async function(B){if(i=B,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",E),i.addEventListener("selectstart",E),i.addEventListener("selectend",E),i.addEventListener("squeeze",E),i.addEventListener("squeezestart",E),i.addEventListener("squeezeend",E),i.addEventListener("end",P),i.addEventListener("inputsourceschange",I),g.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const V={antialias:i.renderState.layers===void 0?g.antialias:!0,alpha:g.alpha,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,t,V),i.updateRenderState({baseLayer:d}),m=new Ot(d.framebufferWidth,d.framebufferHeight,{format:zt,type:Cn,encoding:e.outputEncoding})}else{let V=null,te=null,j=null;g.depth&&(j=g.stencil?35056:33190,V=g.stencil?ii:An,te=g.stencil?jn:wn);const se={colorFormat:32856,depthFormat:j,scaleFactor:s};h=new XRWebGLBinding(i,t),u=h.createProjectionLayer(se),i.updateRenderState({layers:[u]}),m=new Ot(u.textureWidth,u.textureHeight,{format:zt,type:Cn,depthTexture:new Zh(u.textureWidth,u.textureHeight,te,void 0,void 0,void 0,void 0,void 0,void 0,V),stencilBuffer:g.stencil,encoding:e.outputEncoding,samples:g.antialias?4:0});const ge=e.properties.get(m);ge.__ignoreDepthValues=u.ignoreDepthValues}m.isXRRenderTarget=!0,this.setFoveation(1),l=null,r=await i.requestReferenceSpace(a),$.setContext(i),$.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function I(B){for(let V=0;V=0&&(x[j]=null,_[j].dispatchEvent({type:"disconnected",data:te}))}for(let V=0;V=x.length){x.push(te),j=ge;break}else if(x[ge]===null){x[ge]=te,j=ge;break}if(j===-1)break}const se=_[j];se&&se.dispatchEvent({type:"connected",data:te})}}const Z=new A,ee=new A;function D(B,V,te){Z.setFromMatrixPosition(V.matrixWorld),ee.setFromMatrixPosition(te.matrixWorld);const j=Z.distanceTo(ee),se=V.projectionMatrix.elements,ge=te.projectionMatrix.elements,Se=se[14]/(se[10]-1),q=se[14]/(se[10]+1),De=(se[9]+1)/se[5],Me=(se[9]-1)/se[5],Ae=(se[8]-1)/se[0],oe=(ge[8]+1)/ge[0],ze=Se*Ae,X=Se*oe,W=j/(-Ae+oe),ne=W*-Ae;V.matrixWorld.decompose(B.position,B.quaternion,B.scale),B.translateX(ne),B.translateZ(W),B.matrixWorld.compose(B.position,B.quaternion,B.scale),B.matrixWorldInverse.copy(B.matrixWorld).invert();const xe=Se+W,ae=q+W,Ee=ze-ne,be=X+(j-ne),ye=De*q/ae*xe,Ze=Me*q/ae*xe;B.projectionMatrix.makePerspective(Ee,be,ye,Ze,xe,ae)}function H(B,V){V===null?B.matrixWorld.copy(B.matrix):B.matrixWorld.multiplyMatrices(V.matrixWorld,B.matrix),B.matrixWorldInverse.copy(B.matrixWorld).invert()}this.updateCamera=function(B){if(i===null)return;S.near=v.near=M.near=B.near,S.far=v.far=M.far=B.far,(L!==S.near||y!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),L=S.near,y=S.far);const V=B.parent,te=S.cameras;H(S,V);for(let se=0;se0&&(p.alphaTest.value=m.alphaTest);const _=e.get(m).envMap;if(_&&(p.envMap.value=_,p.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap){p.lightMap.value=m.lightMap;const v=o.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=m.lightMapIntensity*v}m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity);let x;m.map?x=m.map:m.specularMap?x=m.specularMap:m.displacementMap?x=m.displacementMap:m.normalMap?x=m.normalMap:m.bumpMap?x=m.bumpMap:m.roughnessMap?x=m.roughnessMap:m.metalnessMap?x=m.metalnessMap:m.alphaMap?x=m.alphaMap:m.emissiveMap?x=m.emissiveMap:m.clearcoatMap?x=m.clearcoatMap:m.clearcoatNormalMap?x=m.clearcoatNormalMap:m.clearcoatRoughnessMap?x=m.clearcoatRoughnessMap:m.iridescenceMap?x=m.iridescenceMap:m.iridescenceThicknessMap?x=m.iridescenceThicknessMap:m.specularIntensityMap?x=m.specularIntensityMap:m.specularColorMap?x=m.specularColorMap:m.transmissionMap?x=m.transmissionMap:m.thicknessMap?x=m.thicknessMap:m.sheenColorMap?x=m.sheenColorMap:m.sheenRoughnessMap&&(x=m.sheenRoughnessMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),p.uvTransform.value.copy(x.matrix));let M;m.aoMap?M=m.aoMap:m.lightMap&&(M=m.lightMap),M!==void 0&&(M.isWebGLRenderTarget&&(M=M.texture),M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uv2Transform.value.copy(M.matrix))}function s(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity}function r(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function a(p,m,_,x){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*_,p.scale.value=x*.5,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let M;m.map?M=m.map:m.alphaMap&&(M=m.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uvTransform.value.copy(M.matrix))}function l(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let _;m.map?_=m.map:m.alphaMap&&(_=m.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),p.uvTransform.value.copy(_.matrix))}function c(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function h(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function u(p,m){p.roughness.value=m.roughness,p.metalness.value=m.metalness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap),e.get(m).envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,_){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),p.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===Bt&&p.clearcoatNormalScale.value.negate())),m.iridescence>0&&(p.iridescence.value=m.iridescence,p.iridescenceIOR.value=m.iridescenceIOR,p.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(p.iridescenceMap.value=m.iridescenceMap),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap)),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=_.texture,p.transmissionSamplerSize.value.set(_.width,_.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap)}function f(p,m){m.matcap&&(p.matcap.value=m.matcap)}function g(p,m){p.referencePosition.value.copy(m.referencePosition),p.nearDistance.value=m.nearDistance,p.farDistance.value=m.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function H0(o,e,t,n){let i={},s={},r=[];const a=t.isWebGL2?o.getParameter(35375):0;function l(x,M){const v=M.program;n.uniformBlockBinding(x,v)}function c(x,M){let v=i[x.id];v===void 0&&(g(x),v=h(x),i[x.id]=v,x.addEventListener("dispose",m));const b=M.program;n.updateUBOMapping(x,b);const S=e.render.frame;s[x.id]!==S&&(d(x),s[x.id]=S)}function h(x){const M=u();x.__bindingPointIndex=M;const v=o.createBuffer(),b=x.__size,S=x.usage;return o.bindBuffer(35345,v),o.bufferData(35345,b,S),o.bindBuffer(35345,null),o.bindBufferBase(35345,M,v),v}function u(){for(let x=0;x0){S=v%b;const I=b-S;S!==0&&I-P.boundary<0&&(v+=b-S,E.__offset=v)}v+=P.storage}return S=v%b,S>0&&(v+=b-S),x.__size=v,x.__cache={},this}function p(x){const M=x.value,v={boundary:0,storage:0};return typeof M=="number"?(v.boundary=4,v.storage=4):M.isVector2?(v.boundary=8,v.storage=8):M.isVector3||M.isColor?(v.boundary=16,v.storage=12):M.isVector4?(v.boundary=16,v.storage=16):M.isMatrix3?(v.boundary=48,v.storage=48):M.isMatrix4?(v.boundary=64,v.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),v}function m(x){const M=x.target;M.removeEventListener("dispose",m);const v=r.indexOf(M.__bindingPointIndex);r.splice(v,1),o.deleteBuffer(i[M.id]),delete i[M.id],delete s[M.id]}function _(){for(const x in i)o.deleteBuffer(i[x]);r=[],i={},s={}}return{bind:l,update:c,dispose:_}}function W0(){const o=Is("canvas");return o.style.display="block",o}function Jh(o={}){this.isWebGLRenderer=!0;const e=o.canvas!==void 0?o.canvas:W0(),t=o.context!==void 0?o.context:null,n=o.depth!==void 0?o.depth:!0,i=o.stencil!==void 0?o.stencil:!0,s=o.antialias!==void 0?o.antialias:!1,r=o.premultipliedAlpha!==void 0?o.premultipliedAlpha:!0,a=o.preserveDrawingBuffer!==void 0?o.preserveDrawingBuffer:!1,l=o.powerPreference!==void 0?o.powerPreference:"default",c=o.failIfMajorPerformanceCaveat!==void 0?o.failIfMajorPerformanceCaveat:!1;let h;t!==null?h=t.getContextAttributes().alpha:h=o.alpha!==void 0?o.alpha:!1;let u=null,d=null;const f=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Ln,this.physicallyCorrectLights=!1,this.toneMapping=Yt,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const p=this;let m=!1,_=0,x=0,M=null,v=-1,b=null;const S=new He,L=new He;let y=null,E=e.width,P=e.height,I=1,Z=null,ee=null;const D=new He(0,0,E,P),H=new He(0,0,E,P);let z=!1;const K=new jr;let $=!1,B=!1,V=null;const te=new Le,j=new J,se=new A,ge={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Se(){return M===null?I:1}let q=t;function De(T,F){for(let k=0;k0?d=g[g.length-1]:d=null,f.pop(),f.length>0?u=f[f.length-1]:u=null};function dn(T,F,k,N){if(T.visible===!1)return;if(T.layers.test(F.layers)){if(T.isGroup)k=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(F);else if(T.isLight)d.pushLight(T),T.castShadow&&d.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||K.intersectsSprite(T)){N&&se.setFromMatrixPosition(T.matrixWorld).applyMatrix4(te);const Ce=be.update(T),Fe=T.material;Fe.visible&&u.push(T,Ce,Fe,k,se.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(T.isSkinnedMesh&&T.skeleton.frame!==ze.render.frame&&(T.skeleton.update(),T.skeleton.frame=ze.render.frame),!T.frustumCulled||K.intersectsObject(T))){N&&se.setFromMatrixPosition(T.matrixWorld).applyMatrix4(te);const Ce=be.update(T),Fe=T.material;if(Array.isArray(Fe)){const Ie=Ce.groups;for(let qe=0,Be=Ie.length;qe0&&jt(Y,F,k),N&&oe.viewport(S.copy(N)),Y.length>0&&Pt(Y,F,k),we.length>0&&Pt(we,F,k),Ce.length>0&&Pt(Ce,F,k),oe.buffers.depth.setTest(!0),oe.buffers.depth.setMask(!0),oe.buffers.color.setMask(!0),oe.setPolygonOffset(!1)}function jt(T,F,k){const N=Ae.isWebGL2;V===null&&(V=new Ot(1,1,{generateMipmaps:!0,type:Me.has("EXT_color_buffer_half_float")?Wi:Cn,minFilter:hi,samples:N&&s===!0?4:0})),p.getDrawingBufferSize(j),N?V.setSize(j.x,j.y):V.setSize(qr(j.x),qr(j.y));const Y=p.getRenderTarget();p.setRenderTarget(V),p.clear();const we=p.toneMapping;p.toneMapping=Yt,Pt(T,F,k),p.toneMapping=we,W.updateMultisampleRenderTarget(V),W.updateRenderTargetMipmap(V),p.setRenderTarget(Y)}function Pt(T,F,k){const N=F.isScene===!0?F.overrideMaterial:null;for(let Y=0,we=T.length;Y0&&W.useMultisampledRTT(T)===!1?Y=X.get(T).__webglMultisampledFramebuffer:Y=qe,S.copy(T.viewport),L.copy(T.scissor),y=T.scissorTest}else S.copy(D).multiplyScalar(I).floor(),L.copy(H).multiplyScalar(I).floor(),y=z;if(oe.bindFramebuffer(36160,Y)&&Ae.drawBuffers&&N&&oe.drawBuffers(T,Y),oe.viewport(S),oe.scissor(L),oe.setScissorTest(y),we){const Ie=X.get(T.texture);q.framebufferTexture2D(36160,36064,34069+F,Ie.__webglTexture,k)}else if(Ce){const Ie=X.get(T.texture),qe=F||0;q.framebufferTextureLayer(36160,36064,Ie.__webglTexture,k||0,qe)}v=-1},this.readRenderTargetPixels=function(T,F,k,N,Y,we,Ce){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Fe=X.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&Ce!==void 0&&(Fe=Fe[Ce]),Fe){oe.bindFramebuffer(36160,Fe);try{const Ie=T.texture,qe=Ie.format,Be=Ie.type;if(qe!==zt&&U.convert(qe)!==q.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ke=Be===Wi&&(Me.has("EXT_color_buffer_half_float")||Ae.isWebGL2&&Me.has("EXT_color_buffer_float"));if(Be!==Cn&&U.convert(Be)!==q.getParameter(35738)&&!(Be===on&&(Ae.isWebGL2||Me.has("OES_texture_float")||Me.has("WEBGL_color_buffer_float")))&&!ke){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}F>=0&&F<=T.width-N&&k>=0&&k<=T.height-Y&&q.readPixels(F,k,N,Y,U.convert(qe),U.convert(Be),we)}finally{const Ie=M!==null?X.get(M).__webglFramebuffer:null;oe.bindFramebuffer(36160,Ie)}}},this.copyFramebufferToTexture=function(T,F,k=0){const N=Math.pow(2,-k),Y=Math.floor(F.image.width*N),we=Math.floor(F.image.height*N);W.setTexture2D(F,0),q.copyTexSubImage2D(3553,k,0,0,T.x,T.y,Y,we),oe.unbindTexture()},this.copyTextureToTexture=function(T,F,k,N=0){const Y=F.image.width,we=F.image.height,Ce=U.convert(k.format),Fe=U.convert(k.type);W.setTexture2D(k,0),q.pixelStorei(37440,k.flipY),q.pixelStorei(37441,k.premultiplyAlpha),q.pixelStorei(3317,k.unpackAlignment),F.isDataTexture?q.texSubImage2D(3553,N,T.x,T.y,Y,we,Ce,Fe,F.image.data):F.isCompressedTexture?q.compressedTexSubImage2D(3553,N,T.x,T.y,F.mipmaps[0].width,F.mipmaps[0].height,Ce,F.mipmaps[0].data):q.texSubImage2D(3553,N,T.x,T.y,Ce,Fe,F.image),N===0&&k.generateMipmaps&&q.generateMipmap(3553),oe.unbindTexture()},this.copyTextureToTexture3D=function(T,F,k,N,Y=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const we=T.max.x-T.min.x+1,Ce=T.max.y-T.min.y+1,Fe=T.max.z-T.min.z+1,Ie=U.convert(N.format),qe=U.convert(N.type);let Be;if(N.isData3DTexture)W.setTexture3D(N,0),Be=32879;else if(N.isDataArrayTexture)W.setTexture2DArray(N,0),Be=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(37440,N.flipY),q.pixelStorei(37441,N.premultiplyAlpha),q.pixelStorei(3317,N.unpackAlignment);const ke=q.getParameter(3314),je=q.getParameter(32878),Nn=q.getParameter(3316),gi=q.getParameter(3315),xi=q.getParameter(32877),qt=k.isCompressedTexture?k.mipmaps[0]:k.image;q.pixelStorei(3314,qt.width),q.pixelStorei(32878,qt.height),q.pixelStorei(3316,T.min.x),q.pixelStorei(3315,T.min.y),q.pixelStorei(32877,T.min.z),k.isDataTexture||k.isData3DTexture?q.texSubImage3D(Be,Y,F.x,F.y,F.z,we,Ce,Fe,Ie,qe,qt.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),q.compressedTexSubImage3D(Be,Y,F.x,F.y,F.z,we,Ce,Fe,Ie,qt.data)):q.texSubImage3D(Be,Y,F.x,F.y,F.z,we,Ce,Fe,Ie,qe,qt),q.pixelStorei(3314,ke),q.pixelStorei(32878,je),q.pixelStorei(3316,Nn),q.pixelStorei(3315,gi),q.pixelStorei(32877,xi),Y===0&&N.generateMipmaps&&q.generateMipmap(Be),oe.unbindTexture()},this.initTexture=function(T){T.isCubeTexture?W.setTextureCube(T,0):T.isData3DTexture?W.setTexture3D(T,0):T.isDataArrayTexture?W.setTexture2DArray(T,0):W.setTexture2D(T,0),oe.unbindTexture()},this.resetState=function(){_=0,x=0,M=null,oe.reset(),_e.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class $h extends Jh{}$h.prototype.isWebGL1Renderer=!0;class ta{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ue(e),this.density=t}clone(){return new ta(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class na{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new ue(e),this.near=t,this.far=n}clone(){return new na(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Kh extends We{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}class ia{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ps,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ct()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:ps.clone(),uv:Nt.getUV(ps,dr,gs,fr,Yl,ka,Zl,new J),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function pr(o,e,t,n,i,s){zi.subVectors(o,t).addScalar(.5).multiply(n),i!==void 0?(ms.x=s*zi.x-i*zi.y,ms.y=i*zi.x+s*zi.y):ms.copy(zi),o.copy(e),o.x+=ms.x,o.y+=ms.y,o.applyMatrix4(jh)}const mr=new A,Jl=new A;class eu extends We{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){mr.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(mr);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){mr.setFromMatrixPosition(e.matrixWorld),Jl.setFromMatrixPosition(this.matrixWorld);const n=mr.distanceTo(Jl)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);const y=e.ray.origin.distanceTo(d);ye.far||t.push({distance:y,point:u.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const _=Math.max(0,r.start),x=Math.min(m.count,r.start+r.count);for(let M=_,v=x-1;Ml)continue;d.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(d);Se.far||t.push({distance:S,point:u.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,r=i.length;s0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,r=i.length;si.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:r})}}class Y0 extends ct{constructor(e,t,n,i,s,r,a,l,c){super(e,t,n,i,s,r,a,l,c),this.isVideoTexture=!0,this.minFilter=r!==void 0?r:it,this.magFilter=s!==void 0?s:it,this.generateMipmaps=!1;const h=this;function u(){h.needsUpdate=!0,e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Z0 extends ct{constructor(e,t,n){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=n,this.magFilter=ot,this.minFilter=ot,this.generateMipmaps=!1,this.needsUpdate=!0}}class ru extends ct{constructor(e,t,n,i,s,r,a,l,c,h,u,d){super(null,r,a,l,c,h,i,s,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class J0 extends ct{constructor(e,t,n,i,s,r,a,l,c){super(e,t,n,i,s,r,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ht{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),s=0;t.push(0);for(let r=1;r<=e;r++)n=this.getPoint(r/e),s+=n.distanceTo(i),t.push(s),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const s=n.length;let r;t?r=t:r=e*n[s-1];let a=0,l=s-1,c;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),c=n[i]-r,c<0)a=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===r)return i/(s-1);const h=n[i],d=n[i+1]-h,f=(r-h)/d;return(i+f)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const r=this.getPoint(i),a=this.getPoint(s),l=t||(r.isVector2?new J:new A);return l.copy(a).sub(r).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new A,i=[],s=[],r=[],a=new A,l=new Le;for(let f=0;f<=e;f++){const g=f/e;i[f]=this.getTangentAt(g,new A)}s[0]=new A,r[0]=new A;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),r[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),r[f]=r[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(st(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,g))}r[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(st(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let g=1;g<=e;g++)s[g].applyMatrix4(l.makeRotationAxis(i[g],f*g)),r[g].crossVectors(i[g],s[g])}return{tangents:i,normals:s,binormals:r}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ra extends Ht{constructor(e=0,t=0,n=1,i=1,s=0,r=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new J,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,h;this.closed||a>0?c=i[(a-1)%s]:(yr.subVectors(i[0],i[1]).add(i[0]),c=yr);const u=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:r+1],u=i[r>i.length-3?i.length-1:r+2];return n.set(hc(a,l.x,c.x,h.x,u.x),hc(a,l.y,c.y,h.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const r=i[s]-n,a=this.curves[s],l=a.getLength(),c=l===0?0:1-r/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class ai extends Pe{constructor(e=[new J(0,-.5),new J(.5,0),new J(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=st(i,0,Math.PI*2);const s=[],r=[],a=[],l=[],c=[],h=1/t,u=new A,d=new J,f=new A,g=new A,p=new A;let m=0,_=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:m=e[x+1].x-e[x].x,_=e[x+1].y-e[x].y,f.x=_*1,f.y=-m,f.z=_*0,p.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(p.x,p.y,p.z);break;default:m=e[x+1].x-e[x].x,_=e[x+1].y-e[x].y,f.x=_*1,f.y=-m,f.z=_*0,g.copy(f),f.x+=p.x,f.y+=p.y,f.z+=p.z,f.normalize(),l.push(f.x,f.y,f.z),p.copy(g)}for(let x=0;x<=t;x++){const M=n+x*h*i,v=Math.sin(M),b=Math.cos(M);for(let S=0;S<=e.length-1;S++){u.x=e[S].x*v,u.y=e[S].y,u.z=e[S].x*b,r.push(u.x,u.y,u.z),d.x=x/t,d.y=S/(e.length-1),a.push(d.x,d.y);const L=l[3*S+0]*v,y=l[3*S+1],E=l[3*S+0]*b;c.push(L,y,E)}}for(let x=0;x0&&M(!0),t>0&&M(!1)),this.setIndex(h),this.setAttribute("position",new me(u,3)),this.setAttribute("normal",new me(d,3)),this.setAttribute("uv",new me(f,2));function x(){const v=new A,b=new A;let S=0;const L=(t-e)/n;for(let y=0;y<=s;y++){const E=[],P=y/s,I=P*(t-e)+e;for(let Z=0;Z<=i;Z++){const ee=Z/i,D=ee*l+a,H=Math.sin(D),z=Math.cos(D);b.x=I*H,b.y=-P*n+m,b.z=I*z,u.push(b.x,b.y,b.z),v.set(H,L,z).normalize(),d.push(v.x,v.y,v.z),f.push(ee,1-P),E.push(g++)}p.push(E)}for(let y=0;y.9&&L<.1&&(M<.2&&(r[x+0]+=1),v<.2&&(r[x+2]+=1),b<.2&&(r[x+4]+=1))}}function d(x){s.push(x.x,x.y,x.z)}function f(x,M){const v=x*3;M.x=e[v+0],M.y=e[v+1],M.z=e[v+2]}function g(){const x=new A,M=new A,v=new A,b=new A,S=new J,L=new J,y=new J;for(let E=0,P=0;E80*t){a=c=o[0],l=h=o[1];for(let g=t;gc&&(c=u),d>h&&(h=d);f=Math.max(c-a,h-l),f=f!==0?1/f:0}return Fs(s,r,t,a,l,f),r}};function du(o,e,t,n,i){let s,r;if(i===vx(o,e,t,n)>0)for(s=e;s=e;s-=n)r=uc(s,o[s],o[s+1],r);return r&&oa(r,r.next)&&(zs(r),r=r.next),r}function In(o,e){if(!o)return o;e||(e=o);let t=o,n;do if(n=!1,!t.steiner&&(oa(t,t.next)||$e(t.prev,t,t.next)===0)){if(zs(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Fs(o,e,t,n,i,s,r){if(!o)return;!r&&s&&fx(o,n,i,s);let a=o,l,c;for(;o.prev!==o.next;){if(l=o.prev,c=o.next,s?rx(o,n,i,s):sx(o)){e.push(l.i/t),e.push(o.i/t),e.push(c.i/t),zs(o),o=c.next,a=c.next;continue}if(o=c,o===a){r?r===1?(o=ax(In(o),e,t),Fs(o,e,t,n,i,s,2)):r===2&&ox(o,e,t,n,i,s):Fs(In(o),e,t,n,i,s,1);break}}}function sx(o){const e=o.prev,t=o,n=o.next;if($e(e,t,n)>=0)return!1;let i=o.next.next;for(;i!==o.prev;){if(Vi(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&$e(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function rx(o,e,t,n){const i=o.prev,s=o,r=o.next;if($e(i,s,r)>=0)return!1;const a=i.xs.x?i.x>r.x?i.x:r.x:s.x>r.x?s.x:r.x,h=i.y>s.y?i.y>r.y?i.y:r.y:s.y>r.y?s.y:r.y,u=Co(a,l,e,t,n),d=Co(c,h,e,t,n);let f=o.prevZ,g=o.nextZ;for(;f&&f.z>=u&&g&&g.z<=d;){if(f!==o.prev&&f!==o.next&&Vi(i.x,i.y,s.x,s.y,r.x,r.y,f.x,f.y)&&$e(f.prev,f,f.next)>=0||(f=f.prevZ,g!==o.prev&&g!==o.next&&Vi(i.x,i.y,s.x,s.y,r.x,r.y,g.x,g.y)&&$e(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;f&&f.z>=u;){if(f!==o.prev&&f!==o.next&&Vi(i.x,i.y,s.x,s.y,r.x,r.y,f.x,f.y)&&$e(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;g&&g.z<=d;){if(g!==o.prev&&g!==o.next&&Vi(i.x,i.y,s.x,s.y,r.x,r.y,g.x,g.y)&&$e(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function ax(o,e,t){let n=o;do{const i=n.prev,s=n.next.next;!oa(i,s)&&fu(i,n,n.next,s)&&Ns(i,s)&&Ns(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),zs(n),zs(n.next),n=o=s),n=n.next}while(n!==o);return In(n)}function ox(o,e,t,n,i,s){let r=o;do{let a=r.next.next;for(;a!==r.prev;){if(r.i!==a.i&&gx(r,a)){let l=pu(r,a);r=In(r,r.next),l=In(l,l.next),Fs(r,e,t,n,i,s),Fs(l,e,t,n,i,s);return}a=a.next}r=r.next}while(r!==o)}function lx(o,e,t,n){const i=[];let s,r,a,l,c;for(s=0,r=e.length;s=t.next.y&&t.next.y!==t.y){const d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}r=t.x=t.x&&t.x>=l&&n!==t.x&&Vi(ir.x||t.x===r.x&&dx(r,t)))&&(r=t,h=u)),t=t.next;while(t!==a);return r}function dx(o,e){return $e(o.prev,o,e.prev)<0&&$e(e.next,o,o.next)<0}function fx(o,e,t,n){let i=o;do i.z===null&&(i.z=Co(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==o);i.prevZ.nextZ=null,i.prevZ=null,px(i)}function px(o){let e,t,n,i,s,r,a,l,c=1;do{for(t=o,o=null,s=null,r=0;t;){for(r++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:o=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(r>1);return o}function Co(o,e,t,n,i){return o=32767*(o-t)*i,e=32767*(e-n)*i,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,o|e<<1}function mx(o){let e=o,t=o;do(e.x=0&&(o-r)*(n-a)-(t-r)*(e-a)>=0&&(t-r)*(s-a)-(i-r)*(n-a)>=0}function gx(o,e){return o.next.i!==e.i&&o.prev.i!==e.i&&!xx(o,e)&&(Ns(o,e)&&Ns(e,o)&&_x(o,e)&&($e(o.prev,o,e.prev)||$e(o,e.prev,e))||oa(o,e)&&$e(o.prev,o,o.next)>0&&$e(e.prev,e,e.next)>0)}function $e(o,e,t){return(e.y-o.y)*(t.x-e.x)-(e.x-o.x)*(t.y-e.y)}function oa(o,e){return o.x===e.x&&o.y===e.y}function fu(o,e,t,n){const i=Ar($e(o,e,t)),s=Ar($e(o,e,n)),r=Ar($e(t,n,o)),a=Ar($e(t,n,e));return!!(i!==s&&r!==a||i===0&&Sr(o,t,e)||s===0&&Sr(o,n,e)||r===0&&Sr(t,o,n)||a===0&&Sr(t,e,n))}function Sr(o,e,t){return e.x<=Math.max(o.x,t.x)&&e.x>=Math.min(o.x,t.x)&&e.y<=Math.max(o.y,t.y)&&e.y>=Math.min(o.y,t.y)}function Ar(o){return o>0?1:o<0?-1:0}function xx(o,e){let t=o;do{if(t.i!==o.i&&t.next.i!==o.i&&t.i!==e.i&&t.next.i!==e.i&&fu(t,t.next,o,e))return!0;t=t.next}while(t!==o);return!1}function Ns(o,e){return $e(o.prev,o,o.next)<0?$e(o,e,o.next)>=0&&$e(o,o.prev,e)>=0:$e(o,e,o.prev)<0||$e(o,o.next,e)<0}function _x(o,e){let t=o,n=!1;const i=(o.x+e.x)/2,s=(o.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==o);return n}function pu(o,e){const t=new Lo(o.i,o.x,o.y),n=new Lo(e.i,e.x,e.y),i=o.next,s=e.prev;return o.next=e,e.prev=o,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function uc(o,e,t,n){const i=new Lo(o,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function zs(o){o.next.prev=o.prev,o.prev.next=o.next,o.prevZ&&(o.prevZ.nextZ=o.nextZ),o.nextZ&&(o.nextZ.prevZ=o.prevZ)}function Lo(o,e,t){this.i=o,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function vx(o,e,t,n){let i=0;for(let s=e,r=t-n;s2&&o[e-1].equals(o[0])&&o.pop()}function fc(o,e){for(let t=0;tNumber.EPSILON){const O=Math.sqrt(C),Q=Math.sqrt(Ze*Ze+Xe*Xe),ie=W.x-ye/O,le=W.y+be/O,Te=ne.x-Xe/Q,U=ne.y+Ze/Q,_e=((Te-ie)*Xe-(U-le)*Ze)/(be*Xe-ye*Ze);xe=ie+be*_e-X.x,ae=le+ye*_e-X.y;const fe=xe*xe+ae*ae;if(fe<=2)return new J(xe,ae);Ee=Math.sqrt(fe/2)}else{let O=!1;be>Number.EPSILON?Ze>Number.EPSILON&&(O=!0):be<-Number.EPSILON?Ze<-Number.EPSILON&&(O=!0):Math.sign(ye)===Math.sign(Xe)&&(O=!0),O?(xe=-ye,ae=be,Ee=Math.sqrt(C)):(xe=be,ae=ye,Ee=Math.sqrt(C/2))}return new J(xe/Ee,ae/Ee)}const B=[];for(let X=0,W=D.length,ne=W-1,xe=X+1;X=0;X--){const W=X/m,ne=f*Math.cos(W*Math.PI/2),xe=g*Math.sin(W*Math.PI/2)+p;for(let ae=0,Ee=D.length;ae=0;){const xe=ne;let ae=ne-1;ae<0&&(ae=X.length-1);for(let Ee=0,be=h+m*2;Ee0)&&f.push(M,v,S),(_!==n-1||l0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class vu extends gt{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ue(16777215),this.specular=new ue(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ui,this.normalScale=new J(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Vs,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class yu extends gt{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ue(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ui,this.normalScale=new J(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Mu extends gt{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ui,this.normalScale=new J(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class bu extends gt{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ue(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Vs,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class wu extends gt{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ue(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ui,this.normalScale=new J(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Su extends bt{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Ft(o,e,t){return nl(o)?new o.constructor(o.subarray(e,t!==void 0?t:o.length)):o.slice(e,t)}function $n(o,e,t){return!o||!t&&o.constructor===e?o:typeof e.BYTES_PER_ELEMENT=="number"?new e(o):Array.prototype.slice.call(o)}function nl(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function Au(o){function e(i,s){return o[i]-o[s]}const t=o.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function Po(o,e,t){const n=o.length,i=new o.constructor(n);for(let s=0,r=0;r!==n;++s){const a=t[s]*e;for(let l=0;l!==e;++l)i[r++]=o[a+l]}return i}function il(o,e,t,n){let i=1,s=o[0];for(;s!==void 0&&s[n]===void 0;)s=o[i++];if(s===void 0)return;let r=s[n];if(r!==void 0)if(Array.isArray(r))do r=s[n],r!==void 0&&(e.push(s.time),t.push.apply(t,r)),s=o[i++];while(s!==void 0);else if(r.toArray!==void 0)do r=s[n],r!==void 0&&(e.push(s.time),r.toArray(t,t.length)),s=o[i++];while(s!==void 0);else do r=s[n],r!==void 0&&(e.push(s.time),t.push(r)),s=o[i++];while(s!==void 0)}function wx(o,e,t,n,i=30){const s=o.clone();s.name=e;const r=[];for(let l=0;l=n)){u.push(c.times[f]);for(let p=0;ps.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[g]){const _=g*u+h,x=_+u-h;p=Ft(a.values,_,x)}else{const _=a.createInterpolant(),x=h,M=u-h;_.evaluate(s),p=Ft(_.resultBuffer,x,M)}l==="quaternion"&&new St().fromArray(p).normalize().conjugate().toArray(p);const m=c.times.length;for(let _=0;_=s)){const a=t[1];e=s)break t}r=n,n=0;break n}break e}for(;n>>1;et;)--r;if(++r,s!==0||r!==i){s>=r&&(r=Math.max(r,1),s=r-1);const a=this.getValueSize();this.times=Ft(n,s,r),this.values=Ft(this.values,s*a,r*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let a=0;a!==s;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(r!==null&&r>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,r),e=!1;break}r=l}if(i!==void 0&&nl(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=Ft(this.times),t=Ft(this.values),n=this.getValueSize(),i=this.getInterpolation()===Br,s=e.length-1;let r=1;for(let a=1;a0){e[r]=e[s];for(let a=s*n,l=r*n,c=0;c!==n;++c)t[l+c]=t[a+c];++r}return r!==e.length?(this.times=Ft(e,0,r),this.values=Ft(t,0,r*n)):(this.times=e,this.values=t),this}clone(){const e=Ft(this.times,0),t=Ft(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Wt.prototype.TimeBufferType=Float32Array;Wt.prototype.ValueBufferType=Float32Array;Wt.prototype.DefaultInterpolation=Cs;class pi extends Wt{}pi.prototype.ValueTypeName="bool";pi.prototype.ValueBufferType=Array;pi.prototype.DefaultInterpolation=Es;pi.prototype.InterpolantFactoryMethodLinear=void 0;pi.prototype.InterpolantFactoryMethodSmooth=void 0;class rl extends Wt{}rl.prototype.ValueTypeName="color";class Bs extends Wt{}Bs.prototype.ValueTypeName="number";class Cu extends qs{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t);let c=e*a;for(let h=c+a;c!==h;c+=4)St.slerpFlat(s,0,r,c-a,r,c,l);return s}}class ls extends Wt{InterpolantFactoryMethodLinear(e){return new Cu(this.times,this.values,this.getValueSize(),e)}}ls.prototype.ValueTypeName="quaternion";ls.prototype.DefaultInterpolation=Cs;ls.prototype.InterpolantFactoryMethodSmooth=void 0;class mi extends Wt{}mi.prototype.ValueTypeName="string";mi.prototype.ValueBufferType=Array;mi.prototype.DefaultInterpolation=Es;mi.prototype.InterpolantFactoryMethodLinear=void 0;mi.prototype.InterpolantFactoryMethodSmooth=void 0;class Os extends Wt{}Os.prototype.ValueTypeName="vector";class Us{constructor(e,t=-1,n,i=Zr){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ct(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let r=0,a=n.length;r!==a;++r)t.push(Ex(n[r]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,r=n.length;s!==r;++s)t.push(Wt.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,r=[];for(let a=0;a1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.push(c)}}const r=[];for(const a in i)r.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return r}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,f,g,p){if(f.length!==0){const m=[],_=[];il(f,m,_,g),m.length!==0&&p.push(new u(d,m,_))}},i=[],s=e.name||"default",r=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u{t&&t(s),this.manager.itemEnd(e)},0),s;if(rn[e]!==void 0){rn[e].push({onLoad:t,onProgress:n,onError:i});return}rn[e]=[],rn[e].push({onLoad:t,onProgress:n,onError:i});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(r).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=rn[e],u=c.body.getReader(),d=c.headers.get("Content-Length"),f=d?parseInt(d):0,g=f!==0;let p=0;const m=new ReadableStream({start(_){x();function x(){u.read().then(({done:M,value:v})=>{if(M)_.close();else{p+=v.byteLength;const b=new ProgressEvent("progress",{lengthComputable:g,loaded:p,total:f});for(let S=0,L=h.length;S{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return c.json();default:if(a===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(a),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(g=>f.decode(g))}}}).then(c=>{ci.add(e,c);const h=rn[e];delete rn[e];for(let u=0,d=h.length;u{const h=rn[e];if(h===void 0)throw this.manager.itemError(e),c;delete rn[e];for(let u=0,d=h.length;u{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Lx extends Lt{constructor(e){super(e)}load(e,t,n,i){const s=this,r=new hn(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const r=e.uniforms[s];switch(i.uniforms[s]={},r.type){case"t":i.uniforms[s].value=n(r.value);break;case"c":i.uniforms[s].value=new ue().setHex(r.value);break;case"v2":i.uniforms[s].value=new J().fromArray(r.value);break;case"v3":i.uniforms[s].value=new A().fromArray(r.value);break;case"v4":i.uniforms[s].value=new He().fromArray(r.value);break;case"m3":i.uniforms[s].value=new wt().fromArray(r.value);break;case"m4":i.uniforms[s].value=new Le().fromArray(r.value);break;default:i.uniforms[s].value=r.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new J().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new J().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:gu,SpriteMaterial:Xo,RawShaderMaterial:xu,ShaderMaterial:Jt,PointsMaterial:Zo,MeshPhysicalMaterial:_u,MeshStandardMaterial:tl,MeshPhongMaterial:vu,MeshToonMaterial:yu,MeshNormalMaterial:Mu,MeshLambertMaterial:bu,MeshDepthMaterial:Wo,MeshDistanceMaterial:qo,MeshBasicMaterial:Dn,MeshMatcapMaterial:wu,LineDashedMaterial:Su,LineBasicMaterial:bt,Material:gt};return new t[e]}}class Ro{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){const l=new al(t);s=new ks(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,h=e.length;c0){i=new ks(this.manager),i.setCrossOrigin(this.crossOrigin);for(let r=0,a=e.length;r"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,r=ci.get(e);if(r!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(r),s.manager.itemEnd(e)},0),r;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){ci.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){i&&i(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let Tr;const ll={getContext:function(){return Tr===void 0&&(Tr=new(window.AudioContext||window.webkitAudioContext)),Tr},setContext:function(o){Tr=o}};class kx extends Lt{constructor(e){super(e)}load(e,t,n,i){const s=this,r=new hn(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(a){try{const l=a.slice(0);ll.getContext().decodeAudioData(l,function(h){t(h)})}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}}class Vx extends la{constructor(e,t,n=1){super(void 0,n),this.isHemisphereLightProbe=!0;const i=new ue().set(e),s=new ue().set(t),r=new A(i.r,i.g,i.b),a=new A(s.r,s.g,s.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(r).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(r).sub(a).multiplyScalar(c)}}class Gx extends la{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const n=new ue().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const bc=new Le,wc=new Le,Un=new Le;class Hx{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new dt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new dt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Un.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,r=t.near*Math.tan(Qn*t.fov*.5)/t.zoom;let a,l;wc.elements[12]=-i,bc.elements[12]=i,a=-r*t.aspect+s,l=r*t.aspect+s,Un.elements[0]=2*t.near/(l-a),Un.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Un),a=-r*t.aspect-s,l=r*t.aspect-s,Un.elements[0]=2*t.near/(l-a),Un.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Un)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(wc),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(bc)}}class Uu{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Sc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Sc();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Sc(){return(typeof performance>"u"?Date:performance).now()}const kn=new A,Ac=new St,Wx=new A,Vn=new A;class qx extends We{constructor(){super(),this.type="AudioListener",this.context=ll.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Uu}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(kn,Ac,Wx),Vn.set(0,0,-1).applyQuaternion(Ac),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(kn.x,i),t.positionY.linearRampToValueAtTime(kn.y,i),t.positionZ.linearRampToValueAtTime(kn.z,i),t.forwardX.linearRampToValueAtTime(Vn.x,i),t.forwardY.linearRampToValueAtTime(Vn.y,i),t.forwardZ.linearRampToValueAtTime(Vn.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(kn.x,kn.y,kn.z),t.setOrientation(Vn.x,Vn.y,Vn.z,n.x,n.y,n.z)}}class ku extends We{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,r=i;s!==r;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==s;++r)e[t+r]=e[n+r]}_slerp(e,t,n,i){St.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const r=this._workIndex*s;St.multiplyQuaternionsFlat(e,r,e,t,e,n),St.slerpFlat(e,t,e,t,e,r,i)}_lerp(e,t,n,i,s){const r=1-i;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*r+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let r=0;r!==s;++r){const a=t+r;e[a]=e[a]+e[n+r]*i}}}const cl="\\[\\]\\.:\\/",Jx=new RegExp("["+cl+"]","g"),hl="[^"+cl+"]",$x="[^"+cl.replace("\\.","")+"]",Kx=/((?:WC+[\/:])*)/.source.replace("WC",hl),jx=/(WCOD+)?/.source.replace("WCOD",$x),Qx=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",hl),e_=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",hl),t_=new RegExp("^"+Kx+jx+Qx+e_+"$"),n_=["material","materials","bones"];class i_{constructor(e,t,n){const i=n||Oe.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Oe{constructor(e,t,n){this.path=t,this.parsedPath=n||Oe.parseTrackName(t),this.node=Oe.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Oe.Composite(e,t,n):new Oe(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Jx,"")}static parseTrackName(e){const t=t_.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);n_.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let r=0;r=s){const u=s++,d=e[u];t[d.uuid]=h,e[h]=d,t[c]=u,e[u]=l;for(let f=0,g=i;f!==g;++f){const p=n[f],m=p[u],_=p[h];p[h]=m,p[u]=_}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,r=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],h=c.uuid,u=t[h];if(u!==void 0)if(delete t[h],u0&&(t[f.uuid]=u),e[u]=f,e.pop();for(let g=0,p=i;g!==p;++g){const m=n[g];m[u]=m[d],m.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const s=this._bindings;if(i!==void 0)return s[i];const r=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);i=s.length,n[e]=i,r.push(e),a.push(t),s.push(u);for(let d=h,f=l.length;d!==f;++d){const g=l[d];u[d]=new Oe(g,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,s=this._parsedPaths,r=this._bindings,a=r.length-1,l=r[a],c=e[a];t[c]=n,r[n]=l,r.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}}class r_{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,r=s.length,a=new Array(r),l={endingStart:Yn,endingEnd:Yn};for(let c=0;c!==r;++c){const h=s[c].createInterpolant(null);a[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ch,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,s=e._clip.duration,r=s/i,a=i/s;e.warp(1,r,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,s=i.time,r=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/r,c[1]=t/r,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);const r=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Oo:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(r),c[h].accumulateAdditive(a);break;case Zr:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(r),c[h].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,s=this._loopCount;const r=n===Lh;if(e===0)return s===-1?i:r&&(s&1)===1?t-i:i;if(n===Eh){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,r)):this._setEndings(this.repetitions===0,!0,r)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,r)}else this._setEndings(!1,!1,r);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(r&&(s&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=Zn,i.endingEnd=Zn):(e?i.endingStart=this.zeroSlopeAtStart?Zn:Yn:i.endingStart=Ls,t?i.endingEnd=this.zeroSlopeAtEnd?Zn:Yn:i.endingEnd=Ls)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let r=this._weightInterpolant;r===null&&(r=i._lendControlInterpolant(),this._weightInterpolant=r);const a=r.parameterPositions,l=r.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}}const a_=new Float32Array(1);class o_ extends un{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,r=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==s;++u){const d=i[u],f=d.name;let g=h[f];if(g!==void 0)++g.referenceCount,r[u]=g;else{if(g=r[u],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,f));continue}const p=t&&t._propertyBindings[u].binding.parsedPath;g=new Vu(Oe.create(n,f,p),d.ValueTypeName,d.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,f),r[u]=g}a[u].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),r=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,r);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(r);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Cc.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Lc=new A,Er=new A;class g_{constructor(e=new A,t=new A){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Lc.subVectors(e,this.start),Er.subVectors(this.end,this.start);const n=Er.dot(Er);let s=Er.dot(Lc)/n;return t&&(s=st(s,0,1)),s}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const Pc=new A;class x_ extends We{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Pe,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let r=0,a=1,l=32;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Nc.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Nc,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class P_ extends Kt{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Pe;i.setAttribute("position",new me(t,3)),i.setAttribute("color",new me(n,3));const s=new bt({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,n){const i=new ue,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class R_{constructor(){this.type="ShapePath",this.color=new ue,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ds,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,s,r){return this.currentPath.bezierCurveTo(e,t,n,i,s,r),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(x){const M=[];for(let v=0,b=x.length;vNumber.EPSILON){if(I<0&&(y=M[L],P=-P,E=M[S],I=-I),x.yE.y)continue;if(x.y===y.y){if(x.x===y.x)return!0}else{const Z=I*(x.x-y.x)-P*(x.y-y.y);if(Z===0)return!0;if(Z<0)continue;b=!b}}else{if(x.y!==y.y)continue;if(E.x<=x.x&&x.x<=y.x||y.x<=x.x&&x.x<=E.x)return!0}}return b}const s=Zt.isClockWise,r=this.subPaths;if(r.length===0)return[];if(t===!0)return n(r);let a,l,c;const h=[];if(r.length===1)return l=r[0],c=new ti,c.curves=l.curves,h.push(c),h;let u=!s(r[0].getPoints());u=e?!u:u;const d=[],f=[];let g=[],p=0,m;f[p]=void 0,g[p]=[];for(let x=0,M=r.length;x1){let x=!1,M=0;for(let v=0,b=f.length;v0&&x===!1&&(g=d)}let _;for(let x=0,M=f.length;x>-c-14,n[l|256]=1024>>-c-14|32768,i[l]=-c-1,i[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,i[l]=13,i[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,i[l]=24,i[l|256]=24):(n[l]=31744,n[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),r=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;!(c&8388608);)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)r[l]=l<<23;r[31]=1199570944,r[32]=2147483648;for(let l=33;l<63;++l)r[l]=2147483648+(l-32<<23);r[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:r,offsetTable:a}}function D_(o){Math.abs(o)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),o=st(o,-65504,65504),an.floatView[0]=o;const e=an.uint32View[0],t=e>>23&511;return an.baseTable[t]+((e&8388607)>>an.shiftTable[t])}function F_(o){const e=o>>10;return an.uint32View[0]=an.mantissaTable[an.offsetTable[e]+(o&1023)]+an.exponentTable[e],an.floatView[0]}var N_=Object.freeze({__proto__:null,toHalfFloat:D_,fromHalfFloat:F_});class z_ extends Pe{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class B_ extends Pe{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function O_(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function U_(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function k_(){console.error("THREE.ImmediateRenderObject has been removed.")}class V_ extends Ot{constructor(e,t,n){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,n),this.samples=4}}class G_ extends Gs{constructor(e,t,n,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,n,i)}}class H_ extends Jr{constructor(e,t,n,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,n,i)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Xr}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Xr);const W_=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:hh,AddEquation:qn,AddOperation:ah,AdditiveAnimationBlendMode:Oo,AdditiveBlending:$a,AlphaFormat:xh,AlwaysDepth:Qc,AlwaysStencilFunc:Dh,AmbientLight:Fu,AmbientLightProbe:Gx,AnimationClip:Us,AnimationLoader:Lx,AnimationMixer:o_,AnimationObjectGroup:s_,AnimationUtils:Ax,ArcCurve:au,ArrayCamera:Yh,ArrowHelper:L_,Audio:ku,AudioAnalyser:Zx,AudioContext:ll,AudioListener:qx,AudioLoader:kx,AxesHelper:P_,BackSide:Bt,BasicDepthPacking:Ph,BasicShadowMap:Ku,Bone:Yo,BooleanKeyframeTrack:pi,Box2:m_,Box3:di,Box3Helper:E_,BoxBufferGeometry:cn,BoxGeometry:cn,BoxHelper:T_,BufferAttribute:Ye,BufferGeometry:Pe,BufferGeometryLoader:Ou,ByteType:dh,Cache:ci,Camera:Kr,CameraHelper:A_,CanvasTexture:J0,CapsuleBufferGeometry:Yi,CapsuleGeometry:Yi,CatmullRomCurve3:ou,CineonToneMapping:ch,CircleBufferGeometry:Zi,CircleGeometry:Zi,ClampToEdgeWrapping:vt,Clock:Uu,Color:ue,ColorKeyframeTrack:rl,ColorManagement:Dt,CompressedTexture:ru,CompressedTextureLoader:Px,ConeBufferGeometry:Ji,ConeGeometry:Ji,CubeCamera:Oh,CubeReflectionMapping:Tn,CubeRefractionMapping:En,CubeTexture:Ws,CubeTextureLoader:Rx,CubeUVReflectionMapping:rs,CubicBezierCurve:$o,CubicBezierCurve3:lu,CubicInterpolant:Tu,CullFaceBack:Ja,CullFaceFront:Bc,CullFaceFrontBack:$u,CullFaceNone:zc,Curve:Ht,CurvePath:hu,CustomBlending:kc,CustomToneMapping:uh,CylinderBufferGeometry:Rn,CylinderGeometry:Rn,Cylindrical:p_,Data3DTexture:Jr,DataArrayTexture:Gs,DataTexture:Gi,DataTexture2DArray:G_,DataTexture3D:H_,DataTextureLoader:Ix,DataUtils:N_,DecrementStencilOp:hd,DecrementWrapStencilOp:dd,DefaultLoadingManager:Lu,DepthFormat:An,DepthStencilFormat:ii,DepthTexture:Zh,DirectionalLight:Du,DirectionalLightHelper:S_,DiscreteInterpolant:Eu,DodecahedronBufferGeometry:$i,DodecahedronGeometry:$i,DoubleSide:ni,DstAlphaFactor:Yc,DstColorFactor:Jc,DynamicCopyUsage:Ed,DynamicDrawUsage:Md,DynamicReadUsage:Sd,EdgesGeometry:uu,EllipseCurve:ra,EqualDepth:th,EqualStencilFunc:gd,EquirectangularReflectionMapping:ws,EquirectangularRefractionMapping:Ss,Euler:as,EventDispatcher:un,ExtrudeBufferGeometry:Ki,ExtrudeGeometry:Ki,FileLoader:hn,FlatShading:Uc,Float16BufferAttribute:uf,Float32BufferAttribute:me,Float64BufferAttribute:df,FloatType:on,Fog:na,FogExp2:ta,Font:U_,FontLoader:O_,FramebufferTexture:Z0,FrontSide:Hi,Frustum:jr,GLBufferAttribute:u_,GLSL1:Ld,GLSL3:wo,GreaterDepth:ih,GreaterEqualDepth:nh,GreaterEqualStencilFunc:yd,GreaterStencilFunc:_d,GridHelper:b_,Group:ki,HalfFloatType:Wi,HemisphereLight:Pu,HemisphereLightHelper:M_,HemisphereLightProbe:Vx,IcosahedronBufferGeometry:ji,IcosahedronGeometry:ji,ImageBitmapLoader:Ux,ImageLoader:ks,ImageUtils:ko,ImmediateRenderObject:k_,IncrementStencilOp:cd,IncrementWrapStencilOp:ud,InstancedBufferAttribute:Xi,InstancedBufferGeometry:Bu,InstancedInterleavedBuffer:h_,InstancedMesh:nu,Int16BufferAttribute:cf,Int32BufferAttribute:hf,Int8BufferAttribute:af,IntType:ph,InterleavedBuffer:ia,InterleavedBufferAttribute:ri,Interpolant:qs,InterpolateDiscrete:Es,InterpolateLinear:Cs,InterpolateSmooth:Br,InvertStencilOp:fd,KeepStencilOp:Or,KeyframeTrack:Wt,LOD:eu,LatheBufferGeometry:ai,LatheGeometry:ai,Layers:$r,LessDepth:eh,LessEqualDepth:Vr,LessEqualStencilFunc:xd,LessStencilFunc:md,Light:Fn,LightProbe:la,Line:Pn,Line3:g_,LineBasicMaterial:bt,LineCurve:aa,LineCurve3:cu,LineDashedMaterial:Su,LineLoop:iu,LineSegments:Kt,LinearEncoding:Ln,LinearFilter:it,LinearInterpolant:sl,LinearMipMapLinearFilter:nd,LinearMipMapNearestFilter:td,LinearMipmapLinearFilter:hi,LinearMipmapNearestFilter:zo,LinearSRGBColorSpace:Sn,LinearToneMapping:oh,Loader:Lt,LoaderUtils:Ro,LoadingManager:al,LoopOnce:Eh,LoopPingPong:Lh,LoopRepeat:Ch,LuminanceAlphaFormat:yh,LuminanceFormat:vh,MOUSE:Zu,Material:gt,MaterialLoader:ca,MathUtils:qd,Matrix3:wt,Matrix4:Le,MaxEquation:eo,Mesh:ft,MeshBasicMaterial:Dn,MeshDepthMaterial:Wo,MeshDistanceMaterial:qo,MeshLambertMaterial:bu,MeshMatcapMaterial:wu,MeshNormalMaterial:Mu,MeshPhongMaterial:vu,MeshPhysicalMaterial:_u,MeshStandardMaterial:tl,MeshToonMaterial:yu,MinEquation:Qa,MirroredRepeatWrapping:Ts,MixOperation:rh,MultiplyBlending:ja,MultiplyOperation:Vs,NearestFilter:ot,NearestMipMapLinearFilter:ed,NearestMipMapNearestFilter:Qu,NearestMipmapLinearFilter:Hr,NearestMipmapNearestFilter:Gr,NeverDepth:jc,NeverStencilFunc:pd,NoBlending:ln,NoColorSpace:ad,NoToneMapping:Yt,NormalAnimationBlendMode:Zr,NormalBlending:Kn,NotEqualDepth:sh,NotEqualStencilFunc:vd,NumberKeyframeTrack:Bs,Object3D:We,ObjectLoader:Bx,ObjectSpaceNormalMap:Ih,OctahedronBufferGeometry:oi,OctahedronGeometry:oi,OneFactor:Wc,OneMinusDstAlphaFactor:Zc,OneMinusDstColorFactor:$c,OneMinusSrcAlphaFactor:No,OneMinusSrcColorFactor:Xc,OrthographicCamera:Qr,PCFShadowMap:Do,PCFSoftShadowMap:Oc,PMREMGenerator:Ao,ParametricGeometry:z_,Path:Ds,PerspectiveCamera:dt,Plane:bn,PlaneBufferGeometry:si,PlaneGeometry:si,PlaneHelper:C_,PointLight:Iu,PointLightHelper:v_,Points:su,PointsMaterial:Zo,PolarGridHelper:w_,PolyhedronBufferGeometry:$t,PolyhedronGeometry:$t,PositionalAudio:Yx,PropertyBinding:Oe,PropertyMixer:Vu,QuadraticBezierCurve:Ko,QuadraticBezierCurve3:jo,Quaternion:St,QuaternionKeyframeTrack:ls,QuaternionLinearInterpolant:Cu,REVISION:Xr,RGBADepthPacking:Rh,RGBAFormat:zt,RGBAIntegerFormat:Ah,RGBA_ASTC_10x10_Format:vo,RGBA_ASTC_10x5_Format:go,RGBA_ASTC_10x6_Format:xo,RGBA_ASTC_10x8_Format:_o,RGBA_ASTC_12x10_Format:yo,RGBA_ASTC_12x12_Format:Mo,RGBA_ASTC_4x4_Format:oo,RGBA_ASTC_5x4_Format:lo,RGBA_ASTC_5x5_Format:co,RGBA_ASTC_6x5_Format:ho,RGBA_ASTC_6x6_Format:uo,RGBA_ASTC_8x5_Format:fo,RGBA_ASTC_8x6_Format:po,RGBA_ASTC_8x8_Format:mo,RGBA_BPTC_Format:bo,RGBA_ETC2_EAC_Format:ao,RGBA_PVRTC_2BPPV1_Format:so,RGBA_PVRTC_4BPPV1_Format:io,RGBA_S3TC_DXT1_Format:Fr,RGBA_S3TC_DXT3_Format:Nr,RGBA_S3TC_DXT5_Format:zr,RGBFormat:_h,RGB_ETC1_Format:Th,RGB_ETC2_Format:ro,RGB_PVRTC_2BPPV1_Format:no,RGB_PVRTC_4BPPV1_Format:to,RGB_S3TC_DXT1_Format:Dr,RGFormat:wh,RGIntegerFormat:Sh,RawShaderMaterial:xu,Ray:Hs,Raycaster:d_,RectAreaLight:Nu,RedFormat:Mh,RedIntegerFormat:bh,ReinhardToneMapping:lh,RepeatWrapping:As,ReplaceStencilOp:ld,ReverseSubtractEquation:Gc,RingBufferGeometry:Qi,RingGeometry:Qi,SRGBColorSpace:Xt,Scene:Kh,ShaderChunk:Ne,ShaderLib:Gt,ShaderMaterial:Jt,ShadowMaterial:gu,Shape:ti,ShapeBufferGeometry:es,ShapeGeometry:es,ShapePath:R_,ShapeUtils:Zt,ShortType:fh,Skeleton:sa,SkeletonHelper:__,SkinnedMesh:tu,SmoothShading:ju,Source:Jn,Sphere:fi,SphereBufferGeometry:li,SphereGeometry:li,Spherical:f_,SphericalHarmonics3:zu,SplineCurve:Qo,SpotLight:Ru,SpotLightHelper:x_,Sprite:Qh,SpriteMaterial:Xo,SrcAlphaFactor:Fo,SrcAlphaSaturateFactor:Kc,SrcColorFactor:qc,StaticCopyUsage:Td,StaticDrawUsage:Ps,StaticReadUsage:wd,StereoCamera:Hx,StreamCopyUsage:Cd,StreamDrawUsage:bd,StreamReadUsage:Ad,StringKeyframeTrack:mi,SubtractEquation:Vc,SubtractiveBlending:Ka,TOUCH:Ju,TangentSpaceNormalMap:ui,TetrahedronBufferGeometry:ts,TetrahedronGeometry:ts,TextGeometry:B_,Texture:ct,TextureLoader:Dx,TorusBufferGeometry:ns,TorusGeometry:ns,TorusKnotBufferGeometry:is,TorusKnotGeometry:is,Triangle:Nt,TriangleFanDrawMode:rd,TriangleStripDrawMode:sd,TrianglesDrawMode:id,TubeBufferGeometry:ss,TubeGeometry:ss,UVMapping:Yr,Uint16BufferAttribute:Vo,Uint32BufferAttribute:Go,Uint8BufferAttribute:of,Uint8ClampedBufferAttribute:lf,Uniform:ul,UniformsGroup:c_,UniformsLib:re,UniformsUtils:Bh,UnsignedByteType:Cn,UnsignedInt248Type:jn,UnsignedIntType:wn,UnsignedShort4444Type:mh,UnsignedShort5551Type:gh,UnsignedShortType:Bo,VSMShadowMap:Bi,Vector2:J,Vector3:A,Vector4:He,VectorKeyframeTrack:Os,VideoTexture:Y0,WebGL1Renderer:$h,WebGL3DRenderTarget:Jd,WebGLArrayRenderTarget:Zd,WebGLCubeRenderTarget:Uh,WebGLMultipleRenderTargets:$d,WebGLMultisampleRenderTarget:V_,WebGLRenderTarget:Ot,WebGLRenderer:Jh,WebGLUtils:Xh,WireframeGeometry:mu,WrapAroundEnding:Ls,ZeroCurvatureEnding:Yn,ZeroFactor:Hc,ZeroSlopeEnding:Zn,ZeroStencilOp:od,_SRGBAFormat:Wr,sRGBEncoding:Je},Symbol.toStringTag,{value:"Module"}));export{Ki as $,ft as A,m_ as B,ue as C,Lu as D,un as E,jr as F,it as G,Wo as H,gt as I,ct as J,Ln as K,Lt as L,wt as M,ot as N,Je as O,Ds as P,He as Q,As as R,Zt as S,Dx as T,Cn as U,A as V,Uh as W,Kr as X,Ye as Y,Wi as Z,cn as _,hn as a,qd as a0,tl as a1,di as a2,fi as a3,Hs as a4,bn as a5,Zu as a6,Ju as a7,St as a8,Qr as a9,Kn as aA,We as aB,su as aC,Md as aD,f_ as aa,jo as ab,$r as ac,zt as ad,d_ as ae,Oc as af,Yt as ag,hh as ah,Jh as ai,Ku as aj,Do as ak,Bi as al,Uu as am,Bu as an,h_ as ao,ri as ap,mu as aq,Bh as ar,re as as,g_ as at,Le as au,qo as av,Ne as aw,Xi as ax,Dn as ay,si as az,J as b,ti as c,Pe as d,me as e,R_ as f,ni as g,W_ as h,Oh as i,Ot as j,on as k,Ph as l,Mu as m,Zh as n,ii as o,jn as p,wn as q,Bt as r,Jt as s,Hi as t,ul as u,ln as v,Rh as w,dt as x,Xr as y,Kh as z}; +}`;function B0(o,e,t){let n=new jr;const i=new J,s=new J,r=new He,a=new Wo({depthPacking:Rh}),l=new qo,c={},h=t.maxTextureSize,u={0:Bt,1:Hi,2:ni},d=new Jt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new J},radius:{value:4}},vertexShader:N0,fragmentShader:z0}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const g=new Pe;g.setAttribute("position",new Ye(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const p=new ft(g,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Do,this.render=function(v,b,S){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||v.length===0)return;const L=o.getRenderTarget(),y=o.getActiveCubeFace(),E=o.getActiveMipmapLevel(),P=o.state;P.setBlending(ln),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);for(let I=0,Z=v.length;Ih||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/H.x),i.x=s.x*H.x,D.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/H.y),i.y=s.y*H.y,D.mapSize.y=s.y)),D.map===null){const K=this.type!==Bi?{minFilter:ot,magFilter:ot}:{};D.map=new Ot(i.x,i.y,K),D.map.texture.name=ee.name+".shadowMap",D.camera.updateProjectionMatrix()}o.setRenderTarget(D.map),o.clear();const z=D.getViewportCount();for(let K=0;K0){const Z=P.uuid,ee=b.uuid;let D=c[Z];D===void 0&&(D={},c[Z]=D);let H=D[ee];H===void 0&&(H=P.clone(),D[ee]=H),P=H}return P.visible=b.visible,P.wireframe=b.wireframe,E===Bi?P.side=b.shadowSide!==null?b.shadowSide:b.side:P.side=b.shadowSide!==null?b.shadowSide:u[b.side],P.alphaMap=b.alphaMap,P.alphaTest=b.alphaTest,P.clipShadows=b.clipShadows,P.clippingPlanes=b.clippingPlanes,P.clipIntersection=b.clipIntersection,P.displacementMap=b.displacementMap,P.displacementScale=b.displacementScale,P.displacementBias=b.displacementBias,P.wireframeLinewidth=b.wireframeLinewidth,P.linewidth=b.linewidth,S.isPointLight===!0&&P.isMeshDistanceMaterial===!0&&(P.referencePosition.setFromMatrixPosition(S.matrixWorld),P.nearDistance=L,P.farDistance=y),P}function M(v,b,S,L,y){if(v.visible===!1)return;if(v.layers.test(b.layers)&&(v.isMesh||v.isLine||v.isPoints)&&(v.castShadow||v.receiveShadow&&y===Bi)&&(!v.frustumCulled||n.intersectsObject(v))){v.modelViewMatrix.multiplyMatrices(S.matrixWorldInverse,v.matrixWorld);const I=e.update(v),Z=v.material;if(Array.isArray(Z)){const ee=I.groups;for(let D=0,H=ee.length;D=1):$.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),z=K>=2);let B=null,V={};const te=o.getParameter(3088),j=o.getParameter(2978),se=new He().fromArray(te),ge=new He().fromArray(j);function Se(R,de,G){const he=new Uint8Array(4),ce=o.createTexture();o.bindTexture(R,ce),o.texParameteri(R,10241,9728),o.texParameteri(R,10240,9728);for(let Ue=0;UeQ||C.height>Q)&&(ie=Q/Math.max(C.width,C.height)),ie<1||w===!0)if(typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&C instanceof ImageBitmap){const le=w?qr:Math.floor,Te=le(ie*C.width),U=le(ie*C.height);p===void 0&&(p=x(Te,U));const _e=O?x(Te,U):p;return _e.width=Te,_e.height=U,_e.getContext("2d").drawImage(C,0,0,Te,U),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+C.width+"x"+C.height+") to ("+Te+"x"+U+")."),_e}else return"data"in C&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+C.width+"x"+C.height+")."),C;return C}function v(C){return So(C.width)&&So(C.height)}function b(C){return a?!1:C.wrapS!==vt||C.wrapT!==vt||C.minFilter!==ot&&C.minFilter!==it}function S(C,w){return C.generateMipmaps&&w&&C.minFilter!==ot&&C.minFilter!==it}function L(C){o.generateMipmap(C)}function y(C,w,O,Q,ie=!1){if(a===!1)return w;if(C!==null){if(o[C]!==void 0)return o[C];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+C+"'")}let le=w;return w===6403&&(O===5126&&(le=33326),O===5131&&(le=33325),O===5121&&(le=33321)),w===33319&&(O===5126&&(le=33328),O===5131&&(le=33327),O===5121&&(le=33323)),w===6408&&(O===5126&&(le=34836),O===5131&&(le=34842),O===5121&&(le=Q===Je&&ie===!1?35907:32856),O===32819&&(le=32854),O===32820&&(le=32855)),(le===33325||le===33326||le===33327||le===33328||le===34842||le===34836)&&e.get("EXT_color_buffer_float"),le}function E(C,w,O){return S(C,O)===!0||C.isFramebufferTexture&&C.minFilter!==ot&&C.minFilter!==it?Math.log2(Math.max(w.width,w.height))+1:C.mipmaps!==void 0&&C.mipmaps.length>0?C.mipmaps.length:C.isCompressedTexture&&Array.isArray(C.image)?w.mipmaps.length:1}function P(C){return C===ot||C===Gr||C===Hr?9728:9729}function I(C){const w=C.target;w.removeEventListener("dispose",I),ee(w),w.isVideoTexture&&g.delete(w)}function Z(C){const w=C.target;w.removeEventListener("dispose",Z),H(w)}function ee(C){const w=n.get(C);if(w.__webglInit===void 0)return;const O=C.source,Q=m.get(O);if(Q){const ie=Q[w.__cacheKey];ie.usedTimes--,ie.usedTimes===0&&D(C),Object.keys(Q).length===0&&m.delete(O)}n.remove(C)}function D(C){const w=n.get(C);o.deleteTexture(w.__webglTexture);const O=C.source,Q=m.get(O);delete Q[w.__cacheKey],r.memory.textures--}function H(C){const w=C.texture,O=n.get(C),Q=n.get(w);if(Q.__webglTexture!==void 0&&(o.deleteTexture(Q.__webglTexture),r.memory.textures--),C.depthTexture&&C.depthTexture.dispose(),C.isWebGLCubeRenderTarget)for(let ie=0;ie<6;ie++)o.deleteFramebuffer(O.__webglFramebuffer[ie]),O.__webglDepthbuffer&&o.deleteRenderbuffer(O.__webglDepthbuffer[ie]);else{if(o.deleteFramebuffer(O.__webglFramebuffer),O.__webglDepthbuffer&&o.deleteRenderbuffer(O.__webglDepthbuffer),O.__webglMultisampledFramebuffer&&o.deleteFramebuffer(O.__webglMultisampledFramebuffer),O.__webglColorRenderbuffer)for(let ie=0;ie=l&&console.warn("THREE.WebGLTextures: Trying to use "+C+" texture units while this GPU supports only "+l),z+=1,C}function B(C){const w=[];return w.push(C.wrapS),w.push(C.wrapT),w.push(C.magFilter),w.push(C.minFilter),w.push(C.anisotropy),w.push(C.internalFormat),w.push(C.format),w.push(C.type),w.push(C.generateMipmaps),w.push(C.premultiplyAlpha),w.push(C.flipY),w.push(C.unpackAlignment),w.push(C.encoding),w.join()}function V(C,w){const O=n.get(C);if(C.isVideoTexture&&Ze(C),C.isRenderTargetTexture===!1&&C.version>0&&O.__version!==C.version){const Q=C.image;if(Q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Me(O,C,w);return}}t.activeTexture(33984+w),t.bindTexture(3553,O.__webglTexture)}function te(C,w){const O=n.get(C);if(C.version>0&&O.__version!==C.version){Me(O,C,w);return}t.activeTexture(33984+w),t.bindTexture(35866,O.__webglTexture)}function j(C,w){const O=n.get(C);if(C.version>0&&O.__version!==C.version){Me(O,C,w);return}t.activeTexture(33984+w),t.bindTexture(32879,O.__webglTexture)}function se(C,w){const O=n.get(C);if(C.version>0&&O.__version!==C.version){Ae(O,C,w);return}t.activeTexture(33984+w),t.bindTexture(34067,O.__webglTexture)}const ge={[As]:10497,[vt]:33071,[Ts]:33648},Se={[ot]:9728,[Gr]:9984,[Hr]:9986,[it]:9729,[zo]:9985,[hi]:9987};function q(C,w,O){if(O?(o.texParameteri(C,10242,ge[w.wrapS]),o.texParameteri(C,10243,ge[w.wrapT]),(C===32879||C===35866)&&o.texParameteri(C,32882,ge[w.wrapR]),o.texParameteri(C,10240,Se[w.magFilter]),o.texParameteri(C,10241,Se[w.minFilter])):(o.texParameteri(C,10242,33071),o.texParameteri(C,10243,33071),(C===32879||C===35866)&&o.texParameteri(C,32882,33071),(w.wrapS!==vt||w.wrapT!==vt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),o.texParameteri(C,10240,P(w.magFilter)),o.texParameteri(C,10241,P(w.minFilter)),w.minFilter!==ot&&w.minFilter!==it&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Q=e.get("EXT_texture_filter_anisotropic");if(w.type===on&&e.has("OES_texture_float_linear")===!1||a===!1&&w.type===Wi&&e.has("OES_texture_half_float_linear")===!1)return;(w.anisotropy>1||n.get(w).__currentAnisotropy)&&(o.texParameterf(C,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy)}}function De(C,w){let O=!1;C.__webglInit===void 0&&(C.__webglInit=!0,w.addEventListener("dispose",I));const Q=w.source;let ie=m.get(Q);ie===void 0&&(ie={},m.set(Q,ie));const le=B(w);if(le!==C.__cacheKey){ie[le]===void 0&&(ie[le]={texture:o.createTexture(),usedTimes:0},r.memory.textures++,O=!0),ie[le].usedTimes++;const Te=ie[C.__cacheKey];Te!==void 0&&(ie[C.__cacheKey].usedTimes--,Te.usedTimes===0&&D(w)),C.__cacheKey=le,C.__webglTexture=ie[le].texture}return O}function Me(C,w,O){let Q=3553;w.isDataArrayTexture&&(Q=35866),w.isData3DTexture&&(Q=32879);const ie=De(C,w),le=w.source;if(t.activeTexture(33984+O),t.bindTexture(Q,C.__webglTexture),le.version!==le.__currentVersion||ie===!0){o.pixelStorei(37440,w.flipY),o.pixelStorei(37441,w.premultiplyAlpha),o.pixelStorei(3317,w.unpackAlignment),o.pixelStorei(37443,0);const Te=b(w)&&v(w.image)===!1;let U=M(w.image,Te,!1,h);U=Xe(w,U);const _e=v(U)||a,fe=s.convert(w.format,w.encoding);let ve=s.convert(w.type),pe=y(w.internalFormat,fe,ve,w.encoding,w.isVideoTexture);q(Q,w,_e);let Re;const Ve=w.mipmaps,et=a&&w.isVideoTexture!==!0,R=le.__currentVersion===void 0||ie===!0,de=E(w,U,_e);if(w.isDepthTexture)pe=6402,a?w.type===on?pe=36012:w.type===wn?pe=33190:w.type===jn?pe=35056:pe=33189:w.type===on&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),w.format===An&&pe===6402&&w.type!==Bo&&w.type!==wn&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),w.type=wn,ve=s.convert(w.type)),w.format===ii&&pe===6402&&(pe=34041,w.type!==jn&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),w.type=jn,ve=s.convert(w.type))),R&&(et?t.texStorage2D(3553,1,pe,U.width,U.height):t.texImage2D(3553,0,pe,U.width,U.height,0,fe,ve,null));else if(w.isDataTexture)if(Ve.length>0&&_e){et&&R&&t.texStorage2D(3553,de,pe,Ve[0].width,Ve[0].height);for(let G=0,he=Ve.length;G>=1,he>>=1}}else if(Ve.length>0&&_e){et&&R&&t.texStorage2D(3553,de,pe,Ve[0].width,Ve[0].height);for(let G=0,he=Ve.length;G0&&R++,t.texStorage2D(34067,R,Re,U[0].width,U[0].height));for(let G=0;G<6;G++)if(Te){Ve?t.texSubImage2D(34069+G,0,0,0,U[G].width,U[G].height,ve,pe,U[G].data):t.texImage2D(34069+G,0,Re,U[G].width,U[G].height,0,ve,pe,U[G].data);for(let he=0;he0&&ye(C)===!1){const U=le?w:[w];O.__webglMultisampledFramebuffer=o.createFramebuffer(),O.__webglColorRenderbuffer=[],t.bindFramebuffer(36160,O.__webglMultisampledFramebuffer);for(let _e=0;_e0&&ye(C)===!1){const w=C.isWebGLMultipleRenderTargets?C.texture:[C.texture],O=C.width,Q=C.height;let ie=16384;const le=[],Te=C.stencilBuffer?33306:36096,U=n.get(C),_e=C.isWebGLMultipleRenderTargets===!0;if(_e)for(let fe=0;fe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function Ze(C){const w=r.render.frame;g.get(C)!==w&&(g.set(C,w),C.update())}function Xe(C,w){const O=C.encoding,Q=C.format,ie=C.type;return C.isCompressedTexture===!0||C.isVideoTexture===!0||C.format===Wr||O!==Ln&&(O===Je?a===!1?e.has("EXT_sRGB")===!0&&Q===zt?(C.format=Wr,C.minFilter=it,C.generateMipmaps=!1):w=ko.sRGBToLinear(w):(Q!==zt||ie!==Cn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",O)),w}this.allocateTextureUnit=$,this.resetTextureUnits=K,this.setTexture2D=V,this.setTexture2DArray=te,this.setTexture3D=j,this.setTextureCube=se,this.rebindTextures=ne,this.setupRenderTarget=xe,this.updateRenderTargetMipmap=ae,this.updateMultisampleRenderTarget=Ee,this.setupDepthRenderbuffer=W,this.setupFrameBufferTexture=oe,this.useMultisampledRTT=ye}function Xh(o,e,t){const n=t.isWebGL2;function i(s,r=null){let a;if(s===Cn)return 5121;if(s===mh)return 32819;if(s===gh)return 32820;if(s===dh)return 5120;if(s===fh)return 5122;if(s===Bo)return 5123;if(s===ph)return 5124;if(s===wn)return 5125;if(s===on)return 5126;if(s===Wi)return n?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===xh)return 6406;if(s===zt)return 6408;if(s===vh)return 6409;if(s===yh)return 6410;if(s===An)return 6402;if(s===ii)return 34041;if(s===Mh)return 6403;if(s===_h)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(s===Wr)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===bh)return 36244;if(s===wh)return 33319;if(s===Sh)return 33320;if(s===Ah)return 36249;if(s===Dr||s===Fr||s===Nr||s===zr)if(r===Je)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Dr)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Fr)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Nr)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===zr)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Dr)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Fr)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Nr)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===zr)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===to||s===no||s===io||s===so)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===to)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===no)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===io)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===so)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Th)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===ro||s===ao)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===ro)return r===Je?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===ao)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===oo||s===lo||s===co||s===ho||s===uo||s===fo||s===po||s===mo||s===go||s===xo||s===_o||s===vo||s===yo||s===Mo)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===oo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===lo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===co)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===ho)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===uo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===fo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===po)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===mo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===go)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===xo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===_o)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===vo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===yo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Mo)return r===Je?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===bo)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===bo)return r===Je?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return s===jn?n?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):o[s]!==void 0?o[s]:null}return{convert:i}}class Yh extends dt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ki extends We{constructor(){super(),this.isGroup=!0,this.type="Group"}}const k0={type:"move"};class Ua{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ki,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ki,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new A,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new A),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ki,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new A,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new A),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,r=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){r=!0;for(const p of e.hand.values()){const m=t.getJointPose(p,n);if(c.joints[p.jointName]===void 0){const x=new ki;x.matrixAutoUpdate=!1,x.visible=!1,c.joints[p.jointName]=x,c.add(x)}const _=c.joints[p.jointName];m!==null&&(_.matrix.fromArray(m.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.jointRadius=m.radius),_.visible=m!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,g=.005;c.inputState.pinching&&d>f+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(k0)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=r!==null),this}}class Zh extends ct{constructor(e,t,n,i,s,r,a,l,c,h){if(h=h!==void 0?h:An,h!==An&&h!==ii)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===An&&(n=wn),n===void 0&&h===ii&&(n=jn),super(null,i,s,r,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:ot,this.minFilter=l!==void 0?l:ot,this.flipY=!1,this.generateMipmaps=!1}}class V0 extends un{constructor(e,t){super();const n=this;let i=null,s=1,r=null,a="local-floor",l=null,c=null,h=null,u=null,d=null,f=null;const g=t.getContextAttributes();let p=null,m=null;const _=[],x=[],M=new dt;M.layers.enable(1),M.viewport=new He;const v=new dt;v.layers.enable(2),v.viewport=new He;const b=[M,v],S=new Yh;S.layers.enable(1),S.layers.enable(2);let L=null,y=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(B){let V=_[B];return V===void 0&&(V=new Ua,_[B]=V),V.getTargetRaySpace()},this.getControllerGrip=function(B){let V=_[B];return V===void 0&&(V=new Ua,_[B]=V),V.getGripSpace()},this.getHand=function(B){let V=_[B];return V===void 0&&(V=new Ua,_[B]=V),V.getHandSpace()};function E(B){const V=x.indexOf(B.inputSource);if(V===-1)return;const te=_[V];te!==void 0&&te.dispatchEvent({type:B.type,data:B.inputSource})}function P(){i.removeEventListener("select",E),i.removeEventListener("selectstart",E),i.removeEventListener("selectend",E),i.removeEventListener("squeeze",E),i.removeEventListener("squeezestart",E),i.removeEventListener("squeezeend",E),i.removeEventListener("end",P),i.removeEventListener("inputsourceschange",I);for(let B=0;B<_.length;B++){const V=x[B];V!==null&&(x[B]=null,_[B].disconnect(V))}L=null,y=null,e.setRenderTarget(p),d=null,u=null,h=null,i=null,m=null,$.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(B){s=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(B){a=B,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||r},this.setReferenceSpace=function(B){l=B},this.getBaseLayer=function(){return u!==null?u:d},this.getBinding=function(){return h},this.getFrame=function(){return f},this.getSession=function(){return i},this.setSession=async function(B){if(i=B,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",E),i.addEventListener("selectstart",E),i.addEventListener("selectend",E),i.addEventListener("squeeze",E),i.addEventListener("squeezestart",E),i.addEventListener("squeezeend",E),i.addEventListener("end",P),i.addEventListener("inputsourceschange",I),g.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const V={antialias:i.renderState.layers===void 0?g.antialias:!0,alpha:g.alpha,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,t,V),i.updateRenderState({baseLayer:d}),m=new Ot(d.framebufferWidth,d.framebufferHeight,{format:zt,type:Cn,encoding:e.outputEncoding})}else{let V=null,te=null,j=null;g.depth&&(j=g.stencil?35056:33190,V=g.stencil?ii:An,te=g.stencil?jn:wn);const se={colorFormat:32856,depthFormat:j,scaleFactor:s};h=new XRWebGLBinding(i,t),u=h.createProjectionLayer(se),i.updateRenderState({layers:[u]}),m=new Ot(u.textureWidth,u.textureHeight,{format:zt,type:Cn,depthTexture:new Zh(u.textureWidth,u.textureHeight,te,void 0,void 0,void 0,void 0,void 0,void 0,V),stencilBuffer:g.stencil,encoding:e.outputEncoding,samples:g.antialias?4:0});const ge=e.properties.get(m);ge.__ignoreDepthValues=u.ignoreDepthValues}m.isXRRenderTarget=!0,this.setFoveation(1),l=null,r=await i.requestReferenceSpace(a),$.setContext(i),$.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function I(B){for(let V=0;V=0&&(x[j]=null,_[j].dispatchEvent({type:"disconnected",data:te}))}for(let V=0;V=x.length){x.push(te),j=ge;break}else if(x[ge]===null){x[ge]=te,j=ge;break}if(j===-1)break}const se=_[j];se&&se.dispatchEvent({type:"connected",data:te})}}const Z=new A,ee=new A;function D(B,V,te){Z.setFromMatrixPosition(V.matrixWorld),ee.setFromMatrixPosition(te.matrixWorld);const j=Z.distanceTo(ee),se=V.projectionMatrix.elements,ge=te.projectionMatrix.elements,Se=se[14]/(se[10]-1),q=se[14]/(se[10]+1),De=(se[9]+1)/se[5],Me=(se[9]-1)/se[5],Ae=(se[8]-1)/se[0],oe=(ge[8]+1)/ge[0],ze=Se*Ae,X=Se*oe,W=j/(-Ae+oe),ne=W*-Ae;V.matrixWorld.decompose(B.position,B.quaternion,B.scale),B.translateX(ne),B.translateZ(W),B.matrixWorld.compose(B.position,B.quaternion,B.scale),B.matrixWorldInverse.copy(B.matrixWorld).invert();const xe=Se+W,ae=q+W,Ee=ze-ne,be=X+(j-ne),ye=De*q/ae*xe,Ze=Me*q/ae*xe;B.projectionMatrix.makePerspective(Ee,be,ye,Ze,xe,ae)}function H(B,V){V===null?B.matrixWorld.copy(B.matrix):B.matrixWorld.multiplyMatrices(V.matrixWorld,B.matrix),B.matrixWorldInverse.copy(B.matrixWorld).invert()}this.updateCamera=function(B){if(i===null)return;S.near=v.near=M.near=B.near,S.far=v.far=M.far=B.far,(L!==S.near||y!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),L=S.near,y=S.far);const V=B.parent,te=S.cameras;H(S,V);for(let se=0;se0&&(p.alphaTest.value=m.alphaTest);const _=e.get(m).envMap;if(_&&(p.envMap.value=_,p.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap){p.lightMap.value=m.lightMap;const v=o.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=m.lightMapIntensity*v}m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity);let x;m.map?x=m.map:m.specularMap?x=m.specularMap:m.displacementMap?x=m.displacementMap:m.normalMap?x=m.normalMap:m.bumpMap?x=m.bumpMap:m.roughnessMap?x=m.roughnessMap:m.metalnessMap?x=m.metalnessMap:m.alphaMap?x=m.alphaMap:m.emissiveMap?x=m.emissiveMap:m.clearcoatMap?x=m.clearcoatMap:m.clearcoatNormalMap?x=m.clearcoatNormalMap:m.clearcoatRoughnessMap?x=m.clearcoatRoughnessMap:m.iridescenceMap?x=m.iridescenceMap:m.iridescenceThicknessMap?x=m.iridescenceThicknessMap:m.specularIntensityMap?x=m.specularIntensityMap:m.specularColorMap?x=m.specularColorMap:m.transmissionMap?x=m.transmissionMap:m.thicknessMap?x=m.thicknessMap:m.sheenColorMap?x=m.sheenColorMap:m.sheenRoughnessMap&&(x=m.sheenRoughnessMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),p.uvTransform.value.copy(x.matrix));let M;m.aoMap?M=m.aoMap:m.lightMap&&(M=m.lightMap),M!==void 0&&(M.isWebGLRenderTarget&&(M=M.texture),M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uv2Transform.value.copy(M.matrix))}function s(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity}function r(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function a(p,m,_,x){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*_,p.scale.value=x*.5,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let M;m.map?M=m.map:m.alphaMap&&(M=m.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uvTransform.value.copy(M.matrix))}function l(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let _;m.map?_=m.map:m.alphaMap&&(_=m.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),p.uvTransform.value.copy(_.matrix))}function c(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function h(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function u(p,m){p.roughness.value=m.roughness,p.metalness.value=m.metalness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap),e.get(m).envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,_){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),p.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===Bt&&p.clearcoatNormalScale.value.negate())),m.iridescence>0&&(p.iridescence.value=m.iridescence,p.iridescenceIOR.value=m.iridescenceIOR,p.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(p.iridescenceMap.value=m.iridescenceMap),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap)),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=_.texture,p.transmissionSamplerSize.value.set(_.width,_.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap)}function f(p,m){m.matcap&&(p.matcap.value=m.matcap)}function g(p,m){p.referencePosition.value.copy(m.referencePosition),p.nearDistance.value=m.nearDistance,p.farDistance.value=m.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function H0(o,e,t,n){let i={},s={},r=[];const a=t.isWebGL2?o.getParameter(35375):0;function l(x,M){const v=M.program;n.uniformBlockBinding(x,v)}function c(x,M){let v=i[x.id];v===void 0&&(g(x),v=h(x),i[x.id]=v,x.addEventListener("dispose",m));const b=M.program;n.updateUBOMapping(x,b);const S=e.render.frame;s[x.id]!==S&&(d(x),s[x.id]=S)}function h(x){const M=u();x.__bindingPointIndex=M;const v=o.createBuffer(),b=x.__size,S=x.usage;return o.bindBuffer(35345,v),o.bufferData(35345,b,S),o.bindBuffer(35345,null),o.bindBufferBase(35345,M,v),v}function u(){for(let x=0;x0){S=v%b;const I=b-S;S!==0&&I-P.boundary<0&&(v+=b-S,E.__offset=v)}v+=P.storage}return S=v%b,S>0&&(v+=b-S),x.__size=v,x.__cache={},this}function p(x){const M=x.value,v={boundary:0,storage:0};return typeof M=="number"?(v.boundary=4,v.storage=4):M.isVector2?(v.boundary=8,v.storage=8):M.isVector3||M.isColor?(v.boundary=16,v.storage=12):M.isVector4?(v.boundary=16,v.storage=16):M.isMatrix3?(v.boundary=48,v.storage=48):M.isMatrix4?(v.boundary=64,v.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),v}function m(x){const M=x.target;M.removeEventListener("dispose",m);const v=r.indexOf(M.__bindingPointIndex);r.splice(v,1),o.deleteBuffer(i[M.id]),delete i[M.id],delete s[M.id]}function _(){for(const x in i)o.deleteBuffer(i[x]);r=[],i={},s={}}return{bind:l,update:c,dispose:_}}function W0(){const o=Is("canvas");return o.style.display="block",o}function Jh(o={}){this.isWebGLRenderer=!0;const e=o.canvas!==void 0?o.canvas:W0(),t=o.context!==void 0?o.context:null,n=o.depth!==void 0?o.depth:!0,i=o.stencil!==void 0?o.stencil:!0,s=o.antialias!==void 0?o.antialias:!1,r=o.premultipliedAlpha!==void 0?o.premultipliedAlpha:!0,a=o.preserveDrawingBuffer!==void 0?o.preserveDrawingBuffer:!1,l=o.powerPreference!==void 0?o.powerPreference:"default",c=o.failIfMajorPerformanceCaveat!==void 0?o.failIfMajorPerformanceCaveat:!1;let h;t!==null?h=t.getContextAttributes().alpha:h=o.alpha!==void 0?o.alpha:!1;let u=null,d=null;const f=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Ln,this.physicallyCorrectLights=!1,this.toneMapping=Yt,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const p=this;let m=!1,_=0,x=0,M=null,v=-1,b=null;const S=new He,L=new He;let y=null,E=e.width,P=e.height,I=1,Z=null,ee=null;const D=new He(0,0,E,P),H=new He(0,0,E,P);let z=!1;const K=new jr;let $=!1,B=!1,V=null;const te=new Le,j=new J,se=new A,ge={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Se(){return M===null?I:1}let q=t;function De(T,F){for(let k=0;k0?d=g[g.length-1]:d=null,f.pop(),f.length>0?u=f[f.length-1]:u=null};function dn(T,F,k,N){if(T.visible===!1)return;if(T.layers.test(F.layers)){if(T.isGroup)k=T.renderOrder;else if(T.isLOD)T.autoUpdate===!0&&T.update(F);else if(T.isLight)d.pushLight(T),T.castShadow&&d.pushShadow(T);else if(T.isSprite){if(!T.frustumCulled||K.intersectsSprite(T)){N&&se.setFromMatrixPosition(T.matrixWorld).applyMatrix4(te);const Ce=be.update(T),Fe=T.material;Fe.visible&&u.push(T,Ce,Fe,k,se.z,null)}}else if((T.isMesh||T.isLine||T.isPoints)&&(T.isSkinnedMesh&&T.skeleton.frame!==ze.render.frame&&(T.skeleton.update(),T.skeleton.frame=ze.render.frame),!T.frustumCulled||K.intersectsObject(T))){N&&se.setFromMatrixPosition(T.matrixWorld).applyMatrix4(te);const Ce=be.update(T),Fe=T.material;if(Array.isArray(Fe)){const Ie=Ce.groups;for(let qe=0,Be=Ie.length;qe0&&jt(Y,F,k),N&&oe.viewport(S.copy(N)),Y.length>0&&Pt(Y,F,k),we.length>0&&Pt(we,F,k),Ce.length>0&&Pt(Ce,F,k),oe.buffers.depth.setTest(!0),oe.buffers.depth.setMask(!0),oe.buffers.color.setMask(!0),oe.setPolygonOffset(!1)}function jt(T,F,k){const N=Ae.isWebGL2;V===null&&(V=new Ot(1,1,{generateMipmaps:!0,type:Me.has("EXT_color_buffer_half_float")?Wi:Cn,minFilter:hi,samples:N&&s===!0?4:0})),p.getDrawingBufferSize(j),N?V.setSize(j.x,j.y):V.setSize(qr(j.x),qr(j.y));const Y=p.getRenderTarget();p.setRenderTarget(V),p.clear();const we=p.toneMapping;p.toneMapping=Yt,Pt(T,F,k),p.toneMapping=we,W.updateMultisampleRenderTarget(V),W.updateRenderTargetMipmap(V),p.setRenderTarget(Y)}function Pt(T,F,k){const N=F.isScene===!0?F.overrideMaterial:null;for(let Y=0,we=T.length;Y0&&W.useMultisampledRTT(T)===!1?Y=X.get(T).__webglMultisampledFramebuffer:Y=qe,S.copy(T.viewport),L.copy(T.scissor),y=T.scissorTest}else S.copy(D).multiplyScalar(I).floor(),L.copy(H).multiplyScalar(I).floor(),y=z;if(oe.bindFramebuffer(36160,Y)&&Ae.drawBuffers&&N&&oe.drawBuffers(T,Y),oe.viewport(S),oe.scissor(L),oe.setScissorTest(y),we){const Ie=X.get(T.texture);q.framebufferTexture2D(36160,36064,34069+F,Ie.__webglTexture,k)}else if(Ce){const Ie=X.get(T.texture),qe=F||0;q.framebufferTextureLayer(36160,36064,Ie.__webglTexture,k||0,qe)}v=-1},this.readRenderTargetPixels=function(T,F,k,N,Y,we,Ce){if(!(T&&T.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Fe=X.get(T).__webglFramebuffer;if(T.isWebGLCubeRenderTarget&&Ce!==void 0&&(Fe=Fe[Ce]),Fe){oe.bindFramebuffer(36160,Fe);try{const Ie=T.texture,qe=Ie.format,Be=Ie.type;if(qe!==zt&&U.convert(qe)!==q.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ke=Be===Wi&&(Me.has("EXT_color_buffer_half_float")||Ae.isWebGL2&&Me.has("EXT_color_buffer_float"));if(Be!==Cn&&U.convert(Be)!==q.getParameter(35738)&&!(Be===on&&(Ae.isWebGL2||Me.has("OES_texture_float")||Me.has("WEBGL_color_buffer_float")))&&!ke){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}F>=0&&F<=T.width-N&&k>=0&&k<=T.height-Y&&q.readPixels(F,k,N,Y,U.convert(qe),U.convert(Be),we)}finally{const Ie=M!==null?X.get(M).__webglFramebuffer:null;oe.bindFramebuffer(36160,Ie)}}},this.copyFramebufferToTexture=function(T,F,k=0){const N=Math.pow(2,-k),Y=Math.floor(F.image.width*N),we=Math.floor(F.image.height*N);W.setTexture2D(F,0),q.copyTexSubImage2D(3553,k,0,0,T.x,T.y,Y,we),oe.unbindTexture()},this.copyTextureToTexture=function(T,F,k,N=0){const Y=F.image.width,we=F.image.height,Ce=U.convert(k.format),Fe=U.convert(k.type);W.setTexture2D(k,0),q.pixelStorei(37440,k.flipY),q.pixelStorei(37441,k.premultiplyAlpha),q.pixelStorei(3317,k.unpackAlignment),F.isDataTexture?q.texSubImage2D(3553,N,T.x,T.y,Y,we,Ce,Fe,F.image.data):F.isCompressedTexture?q.compressedTexSubImage2D(3553,N,T.x,T.y,F.mipmaps[0].width,F.mipmaps[0].height,Ce,F.mipmaps[0].data):q.texSubImage2D(3553,N,T.x,T.y,Ce,Fe,F.image),N===0&&k.generateMipmaps&&q.generateMipmap(3553),oe.unbindTexture()},this.copyTextureToTexture3D=function(T,F,k,N,Y=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const we=T.max.x-T.min.x+1,Ce=T.max.y-T.min.y+1,Fe=T.max.z-T.min.z+1,Ie=U.convert(N.format),qe=U.convert(N.type);let Be;if(N.isData3DTexture)W.setTexture3D(N,0),Be=32879;else if(N.isDataArrayTexture)W.setTexture2DArray(N,0),Be=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(37440,N.flipY),q.pixelStorei(37441,N.premultiplyAlpha),q.pixelStorei(3317,N.unpackAlignment);const ke=q.getParameter(3314),je=q.getParameter(32878),Nn=q.getParameter(3316),gi=q.getParameter(3315),xi=q.getParameter(32877),qt=k.isCompressedTexture?k.mipmaps[0]:k.image;q.pixelStorei(3314,qt.width),q.pixelStorei(32878,qt.height),q.pixelStorei(3316,T.min.x),q.pixelStorei(3315,T.min.y),q.pixelStorei(32877,T.min.z),k.isDataTexture||k.isData3DTexture?q.texSubImage3D(Be,Y,F.x,F.y,F.z,we,Ce,Fe,Ie,qe,qt.data):k.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),q.compressedTexSubImage3D(Be,Y,F.x,F.y,F.z,we,Ce,Fe,Ie,qt.data)):q.texSubImage3D(Be,Y,F.x,F.y,F.z,we,Ce,Fe,Ie,qe,qt),q.pixelStorei(3314,ke),q.pixelStorei(32878,je),q.pixelStorei(3316,Nn),q.pixelStorei(3315,gi),q.pixelStorei(32877,xi),Y===0&&N.generateMipmaps&&q.generateMipmap(Be),oe.unbindTexture()},this.initTexture=function(T){T.isCubeTexture?W.setTextureCube(T,0):T.isData3DTexture?W.setTexture3D(T,0):T.isDataArrayTexture?W.setTexture2DArray(T,0):W.setTexture2D(T,0),oe.unbindTexture()},this.resetState=function(){_=0,x=0,M=null,oe.reset(),_e.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class $h extends Jh{}$h.prototype.isWebGL1Renderer=!0;class ta{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ue(e),this.density=t}clone(){return new ta(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class na{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new ue(e),this.near=t,this.far=n}clone(){return new na(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Kh extends We{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}class ia{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ps,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ct()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:ps.clone(),uv:Nt.getUV(ps,dr,gs,fr,Yl,ka,Zl,new J),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function pr(o,e,t,n,i,s){zi.subVectors(o,t).addScalar(.5).multiply(n),i!==void 0?(ms.x=s*zi.x-i*zi.y,ms.y=i*zi.x+s*zi.y):ms.copy(zi),o.copy(e),o.x+=ms.x,o.y+=ms.y,o.applyMatrix4(jh)}const mr=new A,Jl=new A;class eu extends We{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){mr.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(mr);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){mr.setFromMatrixPosition(e.matrixWorld),Jl.setFromMatrixPosition(this.matrixWorld);const n=mr.distanceTo(Jl)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;il)continue;d.applyMatrix4(this.matrixWorld);const y=e.ray.origin.distanceTo(d);ye.far||t.push({distance:y,point:u.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const _=Math.max(0,r.start),x=Math.min(m.count,r.start+r.count);for(let M=_,v=x-1;Ml)continue;d.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(d);Se.far||t.push({distance:S,point:u.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,r=i.length;s0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,r=i.length;si.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:r})}}class Y0 extends ct{constructor(e,t,n,i,s,r,a,l,c){super(e,t,n,i,s,r,a,l,c),this.isVideoTexture=!0,this.minFilter=r!==void 0?r:it,this.magFilter=s!==void 0?s:it,this.generateMipmaps=!1;const h=this;function u(){h.needsUpdate=!0,e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Z0 extends ct{constructor(e,t,n){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=n,this.magFilter=ot,this.minFilter=ot,this.generateMipmaps=!1,this.needsUpdate=!0}}class ru extends ct{constructor(e,t,n,i,s,r,a,l,c,h,u,d){super(null,r,a,l,c,h,i,s,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class J0 extends ct{constructor(e,t,n,i,s,r,a,l,c){super(e,t,n,i,s,r,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ht{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),s=0;t.push(0);for(let r=1;r<=e;r++)n=this.getPoint(r/e),s+=n.distanceTo(i),t.push(s),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const s=n.length;let r;t?r=t:r=e*n[s-1];let a=0,l=s-1,c;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),c=n[i]-r,c<0)a=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===r)return i/(s-1);const h=n[i],d=n[i+1]-h,f=(r-h)/d;return(i+f)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const r=this.getPoint(i),a=this.getPoint(s),l=t||(r.isVector2?new J:new A);return l.copy(a).sub(r).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new A,i=[],s=[],r=[],a=new A,l=new Le;for(let f=0;f<=e;f++){const g=f/e;i[f]=this.getTangentAt(g,new A)}s[0]=new A,r[0]=new A;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),r[0].crossVectors(i[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),r[f]=r[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(st(i[f-1].dot(i[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,g))}r[f].crossVectors(i[f],s[f])}if(t===!0){let f=Math.acos(st(s[0].dot(s[e]),-1,1));f/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let g=1;g<=e;g++)s[g].applyMatrix4(l.makeRotationAxis(i[g],f*g)),r[g].crossVectors(i[g],s[g])}return{tangents:i,normals:s,binormals:r}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class ra extends Ht{constructor(e=0,t=0,n=1,i=1,s=0,r=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new J,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,h;this.closed||a>0?c=i[(a-1)%s]:(yr.subVectors(i[0],i[1]).add(i[0]),c=yr);const u=i[a%s],d=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:r+1],u=i[r>i.length-3?i.length-1:r+2];return n.set(hc(a,l.x,c.x,h.x,u.x),hc(a,l.y,c.y,h.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const r=i[s]-n,a=this.curves[s],l=a.getLength(),c=l===0?0:1-r/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class ai extends Pe{constructor(e=[new J(0,-.5),new J(.5,0),new J(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=st(i,0,Math.PI*2);const s=[],r=[],a=[],l=[],c=[],h=1/t,u=new A,d=new J,f=new A,g=new A,p=new A;let m=0,_=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:m=e[x+1].x-e[x].x,_=e[x+1].y-e[x].y,f.x=_*1,f.y=-m,f.z=_*0,p.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(p.x,p.y,p.z);break;default:m=e[x+1].x-e[x].x,_=e[x+1].y-e[x].y,f.x=_*1,f.y=-m,f.z=_*0,g.copy(f),f.x+=p.x,f.y+=p.y,f.z+=p.z,f.normalize(),l.push(f.x,f.y,f.z),p.copy(g)}for(let x=0;x<=t;x++){const M=n+x*h*i,v=Math.sin(M),b=Math.cos(M);for(let S=0;S<=e.length-1;S++){u.x=e[S].x*v,u.y=e[S].y,u.z=e[S].x*b,r.push(u.x,u.y,u.z),d.x=x/t,d.y=S/(e.length-1),a.push(d.x,d.y);const L=l[3*S+0]*v,y=l[3*S+1],E=l[3*S+0]*b;c.push(L,y,E)}}for(let x=0;x0&&M(!0),t>0&&M(!1)),this.setIndex(h),this.setAttribute("position",new me(u,3)),this.setAttribute("normal",new me(d,3)),this.setAttribute("uv",new me(f,2));function x(){const v=new A,b=new A;let S=0;const L=(t-e)/n;for(let y=0;y<=s;y++){const E=[],P=y/s,I=P*(t-e)+e;for(let Z=0;Z<=i;Z++){const ee=Z/i,D=ee*l+a,H=Math.sin(D),z=Math.cos(D);b.x=I*H,b.y=-P*n+m,b.z=I*z,u.push(b.x,b.y,b.z),v.set(H,L,z).normalize(),d.push(v.x,v.y,v.z),f.push(ee,1-P),E.push(g++)}p.push(E)}for(let y=0;y.9&&L<.1&&(M<.2&&(r[x+0]+=1),v<.2&&(r[x+2]+=1),b<.2&&(r[x+4]+=1))}}function d(x){s.push(x.x,x.y,x.z)}function f(x,M){const v=x*3;M.x=e[v+0],M.y=e[v+1],M.z=e[v+2]}function g(){const x=new A,M=new A,v=new A,b=new A,S=new J,L=new J,y=new J;for(let E=0,P=0;E80*t){a=c=o[0],l=h=o[1];for(let g=t;gc&&(c=u),d>h&&(h=d);f=Math.max(c-a,h-l),f=f!==0?1/f:0}return Fs(s,r,t,a,l,f),r}};function du(o,e,t,n,i){let s,r;if(i===vx(o,e,t,n)>0)for(s=e;s=e;s-=n)r=uc(s,o[s],o[s+1],r);return r&&oa(r,r.next)&&(zs(r),r=r.next),r}function In(o,e){if(!o)return o;e||(e=o);let t=o,n;do if(n=!1,!t.steiner&&(oa(t,t.next)||$e(t.prev,t,t.next)===0)){if(zs(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Fs(o,e,t,n,i,s,r){if(!o)return;!r&&s&&fx(o,n,i,s);let a=o,l,c;for(;o.prev!==o.next;){if(l=o.prev,c=o.next,s?rx(o,n,i,s):sx(o)){e.push(l.i/t),e.push(o.i/t),e.push(c.i/t),zs(o),o=c.next,a=c.next;continue}if(o=c,o===a){r?r===1?(o=ax(In(o),e,t),Fs(o,e,t,n,i,s,2)):r===2&&ox(o,e,t,n,i,s):Fs(In(o),e,t,n,i,s,1);break}}}function sx(o){const e=o.prev,t=o,n=o.next;if($e(e,t,n)>=0)return!1;let i=o.next.next;for(;i!==o.prev;){if(Vi(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&$e(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function rx(o,e,t,n){const i=o.prev,s=o,r=o.next;if($e(i,s,r)>=0)return!1;const a=i.xs.x?i.x>r.x?i.x:r.x:s.x>r.x?s.x:r.x,h=i.y>s.y?i.y>r.y?i.y:r.y:s.y>r.y?s.y:r.y,u=Co(a,l,e,t,n),d=Co(c,h,e,t,n);let f=o.prevZ,g=o.nextZ;for(;f&&f.z>=u&&g&&g.z<=d;){if(f!==o.prev&&f!==o.next&&Vi(i.x,i.y,s.x,s.y,r.x,r.y,f.x,f.y)&&$e(f.prev,f,f.next)>=0||(f=f.prevZ,g!==o.prev&&g!==o.next&&Vi(i.x,i.y,s.x,s.y,r.x,r.y,g.x,g.y)&&$e(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;f&&f.z>=u;){if(f!==o.prev&&f!==o.next&&Vi(i.x,i.y,s.x,s.y,r.x,r.y,f.x,f.y)&&$e(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;g&&g.z<=d;){if(g!==o.prev&&g!==o.next&&Vi(i.x,i.y,s.x,s.y,r.x,r.y,g.x,g.y)&&$e(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function ax(o,e,t){let n=o;do{const i=n.prev,s=n.next.next;!oa(i,s)&&fu(i,n,n.next,s)&&Ns(i,s)&&Ns(s,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(s.i/t),zs(n),zs(n.next),n=o=s),n=n.next}while(n!==o);return In(n)}function ox(o,e,t,n,i,s){let r=o;do{let a=r.next.next;for(;a!==r.prev;){if(r.i!==a.i&&gx(r,a)){let l=pu(r,a);r=In(r,r.next),l=In(l,l.next),Fs(r,e,t,n,i,s),Fs(l,e,t,n,i,s);return}a=a.next}r=r.next}while(r!==o)}function lx(o,e,t,n){const i=[];let s,r,a,l,c;for(s=0,r=e.length;s=t.next.y&&t.next.y!==t.y){const d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>s){if(s=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}r=t.x=t.x&&t.x>=l&&n!==t.x&&Vi(ir.x||t.x===r.x&&dx(r,t)))&&(r=t,h=u)),t=t.next;while(t!==a);return r}function dx(o,e){return $e(o.prev,o,e.prev)<0&&$e(e.next,o,o.next)<0}function fx(o,e,t,n){let i=o;do i.z===null&&(i.z=Co(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==o);i.prevZ.nextZ=null,i.prevZ=null,px(i)}function px(o){let e,t,n,i,s,r,a,l,c=1;do{for(t=o,o=null,s=null,r=0;t;){for(r++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:o=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(r>1);return o}function Co(o,e,t,n,i){return o=32767*(o-t)*i,e=32767*(e-n)*i,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,o|e<<1}function mx(o){let e=o,t=o;do(e.x=0&&(o-r)*(n-a)-(t-r)*(e-a)>=0&&(t-r)*(s-a)-(i-r)*(n-a)>=0}function gx(o,e){return o.next.i!==e.i&&o.prev.i!==e.i&&!xx(o,e)&&(Ns(o,e)&&Ns(e,o)&&_x(o,e)&&($e(o.prev,o,e.prev)||$e(o,e.prev,e))||oa(o,e)&&$e(o.prev,o,o.next)>0&&$e(e.prev,e,e.next)>0)}function $e(o,e,t){return(e.y-o.y)*(t.x-e.x)-(e.x-o.x)*(t.y-e.y)}function oa(o,e){return o.x===e.x&&o.y===e.y}function fu(o,e,t,n){const i=Ar($e(o,e,t)),s=Ar($e(o,e,n)),r=Ar($e(t,n,o)),a=Ar($e(t,n,e));return!!(i!==s&&r!==a||i===0&&Sr(o,t,e)||s===0&&Sr(o,n,e)||r===0&&Sr(t,o,n)||a===0&&Sr(t,e,n))}function Sr(o,e,t){return e.x<=Math.max(o.x,t.x)&&e.x>=Math.min(o.x,t.x)&&e.y<=Math.max(o.y,t.y)&&e.y>=Math.min(o.y,t.y)}function Ar(o){return o>0?1:o<0?-1:0}function xx(o,e){let t=o;do{if(t.i!==o.i&&t.next.i!==o.i&&t.i!==e.i&&t.next.i!==e.i&&fu(t,t.next,o,e))return!0;t=t.next}while(t!==o);return!1}function Ns(o,e){return $e(o.prev,o,o.next)<0?$e(o,e,o.next)>=0&&$e(o,o.prev,e)>=0:$e(o,e,o.prev)<0||$e(o,o.next,e)<0}function _x(o,e){let t=o,n=!1;const i=(o.x+e.x)/2,s=(o.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==o);return n}function pu(o,e){const t=new Lo(o.i,o.x,o.y),n=new Lo(e.i,e.x,e.y),i=o.next,s=e.prev;return o.next=e,e.prev=o,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function uc(o,e,t,n){const i=new Lo(o,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function zs(o){o.next.prev=o.prev,o.prev.next=o.next,o.prevZ&&(o.prevZ.nextZ=o.nextZ),o.nextZ&&(o.nextZ.prevZ=o.prevZ)}function Lo(o,e,t){this.i=o,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function vx(o,e,t,n){let i=0;for(let s=e,r=t-n;s2&&o[e-1].equals(o[0])&&o.pop()}function fc(o,e){for(let t=0;tNumber.EPSILON){const O=Math.sqrt(C),Q=Math.sqrt(Ze*Ze+Xe*Xe),ie=W.x-ye/O,le=W.y+be/O,Te=ne.x-Xe/Q,U=ne.y+Ze/Q,_e=((Te-ie)*Xe-(U-le)*Ze)/(be*Xe-ye*Ze);xe=ie+be*_e-X.x,ae=le+ye*_e-X.y;const fe=xe*xe+ae*ae;if(fe<=2)return new J(xe,ae);Ee=Math.sqrt(fe/2)}else{let O=!1;be>Number.EPSILON?Ze>Number.EPSILON&&(O=!0):be<-Number.EPSILON?Ze<-Number.EPSILON&&(O=!0):Math.sign(ye)===Math.sign(Xe)&&(O=!0),O?(xe=-ye,ae=be,Ee=Math.sqrt(C)):(xe=be,ae=ye,Ee=Math.sqrt(C/2))}return new J(xe/Ee,ae/Ee)}const B=[];for(let X=0,W=D.length,ne=W-1,xe=X+1;X=0;X--){const W=X/m,ne=f*Math.cos(W*Math.PI/2),xe=g*Math.sin(W*Math.PI/2)+p;for(let ae=0,Ee=D.length;ae=0;){const xe=ne;let ae=ne-1;ae<0&&(ae=X.length-1);for(let Ee=0,be=h+m*2;Ee0)&&f.push(M,v,S),(_!==n-1||l0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class vu extends gt{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ue(16777215),this.specular=new ue(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ui,this.normalScale=new J(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Vs,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class yu extends gt{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ue(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ui,this.normalScale=new J(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Mu extends gt{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ui,this.normalScale=new J(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class bu extends gt{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ue(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Vs,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class wu extends gt{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ue(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ui,this.normalScale=new J(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Su extends bt{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Ft(o,e,t){return nl(o)?new o.constructor(o.subarray(e,t!==void 0?t:o.length)):o.slice(e,t)}function $n(o,e,t){return!o||!t&&o.constructor===e?o:typeof e.BYTES_PER_ELEMENT=="number"?new e(o):Array.prototype.slice.call(o)}function nl(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function Au(o){function e(i,s){return o[i]-o[s]}const t=o.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function Po(o,e,t){const n=o.length,i=new o.constructor(n);for(let s=0,r=0;r!==n;++s){const a=t[s]*e;for(let l=0;l!==e;++l)i[r++]=o[a+l]}return i}function il(o,e,t,n){let i=1,s=o[0];for(;s!==void 0&&s[n]===void 0;)s=o[i++];if(s===void 0)return;let r=s[n];if(r!==void 0)if(Array.isArray(r))do r=s[n],r!==void 0&&(e.push(s.time),t.push.apply(t,r)),s=o[i++];while(s!==void 0);else if(r.toArray!==void 0)do r=s[n],r!==void 0&&(e.push(s.time),r.toArray(t,t.length)),s=o[i++];while(s!==void 0);else do r=s[n],r!==void 0&&(e.push(s.time),t.push(r)),s=o[i++];while(s!==void 0)}function wx(o,e,t,n,i=30){const s=o.clone();s.name=e;const r=[];for(let l=0;l=n)){u.push(c.times[f]);for(let p=0;ps.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[g]){const _=g*u+h,x=_+u-h;p=Ft(a.values,_,x)}else{const _=a.createInterpolant(),x=h,M=u-h;_.evaluate(s),p=Ft(_.resultBuffer,x,M)}l==="quaternion"&&new St().fromArray(p).normalize().conjugate().toArray(p);const m=c.times.length;for(let _=0;_=s)){const a=t[1];e=s)break t}r=n,n=0;break n}break e}for(;n>>1;et;)--r;if(++r,s!==0||r!==i){s>=r&&(r=Math.max(r,1),s=r-1);const a=this.getValueSize();this.times=Ft(n,s,r),this.values=Ft(this.values,s*a,r*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let a=0;a!==s;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(r!==null&&r>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,r),e=!1;break}r=l}if(i!==void 0&&nl(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=Ft(this.times),t=Ft(this.values),n=this.getValueSize(),i=this.getInterpolation()===Br,s=e.length-1;let r=1;for(let a=1;a0){e[r]=e[s];for(let a=s*n,l=r*n,c=0;c!==n;++c)t[l+c]=t[a+c];++r}return r!==e.length?(this.times=Ft(e,0,r),this.values=Ft(t,0,r*n)):(this.times=e,this.values=t),this}clone(){const e=Ft(this.times,0),t=Ft(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Wt.prototype.TimeBufferType=Float32Array;Wt.prototype.ValueBufferType=Float32Array;Wt.prototype.DefaultInterpolation=Cs;class pi extends Wt{}pi.prototype.ValueTypeName="bool";pi.prototype.ValueBufferType=Array;pi.prototype.DefaultInterpolation=Es;pi.prototype.InterpolantFactoryMethodLinear=void 0;pi.prototype.InterpolantFactoryMethodSmooth=void 0;class rl extends Wt{}rl.prototype.ValueTypeName="color";class Bs extends Wt{}Bs.prototype.ValueTypeName="number";class Cu extends qs{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t);let c=e*a;for(let h=c+a;c!==h;c+=4)St.slerpFlat(s,0,r,c-a,r,c,l);return s}}class ls extends Wt{InterpolantFactoryMethodLinear(e){return new Cu(this.times,this.values,this.getValueSize(),e)}}ls.prototype.ValueTypeName="quaternion";ls.prototype.DefaultInterpolation=Cs;ls.prototype.InterpolantFactoryMethodSmooth=void 0;class mi extends Wt{}mi.prototype.ValueTypeName="string";mi.prototype.ValueBufferType=Array;mi.prototype.DefaultInterpolation=Es;mi.prototype.InterpolantFactoryMethodLinear=void 0;mi.prototype.InterpolantFactoryMethodSmooth=void 0;class Os extends Wt{}Os.prototype.ValueTypeName="vector";class Us{constructor(e,t=-1,n,i=Zr){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ct(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let r=0,a=n.length;r!==a;++r)t.push(Ex(n[r]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,r=n.length;s!==r;++s)t.push(Wt.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,r=[];for(let a=0;a1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.push(c)}}const r=[];for(const a in i)r.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return r}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,f,g,p){if(f.length!==0){const m=[],_=[];il(f,m,_,g),m.length!==0&&p.push(new u(d,m,_))}},i=[],s=e.name||"default",r=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u{t&&t(s),this.manager.itemEnd(e)},0),s;if(rn[e]!==void 0){rn[e].push({onLoad:t,onProgress:n,onError:i});return}rn[e]=[],rn[e].push({onLoad:t,onProgress:n,onError:i});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(r).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=rn[e],u=c.body.getReader(),d=c.headers.get("Content-Length"),f=d?parseInt(d):0,g=f!==0;let p=0;const m=new ReadableStream({start(_){x();function x(){u.read().then(({done:M,value:v})=>{if(M)_.close();else{p+=v.byteLength;const b=new ProgressEvent("progress",{lengthComputable:g,loaded:p,total:f});for(let S=0,L=h.length;S{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return c.json();default:if(a===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(a),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(g=>f.decode(g))}}}).then(c=>{ci.add(e,c);const h=rn[e];delete rn[e];for(let u=0,d=h.length;u{const h=rn[e];if(h===void 0)throw this.manager.itemError(e),c;delete rn[e];for(let u=0,d=h.length;u{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Lx extends Lt{constructor(e){super(e)}load(e,t,n,i){const s=this,r=new hn(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const r=e.uniforms[s];switch(i.uniforms[s]={},r.type){case"t":i.uniforms[s].value=n(r.value);break;case"c":i.uniforms[s].value=new ue().setHex(r.value);break;case"v2":i.uniforms[s].value=new J().fromArray(r.value);break;case"v3":i.uniforms[s].value=new A().fromArray(r.value);break;case"v4":i.uniforms[s].value=new He().fromArray(r.value);break;case"m3":i.uniforms[s].value=new wt().fromArray(r.value);break;case"m4":i.uniforms[s].value=new Le().fromArray(r.value);break;default:i.uniforms[s].value=r.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new J().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new J().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:gu,SpriteMaterial:Xo,RawShaderMaterial:xu,ShaderMaterial:Jt,PointsMaterial:Zo,MeshPhysicalMaterial:_u,MeshStandardMaterial:tl,MeshPhongMaterial:vu,MeshToonMaterial:yu,MeshNormalMaterial:Mu,MeshLambertMaterial:bu,MeshDepthMaterial:Wo,MeshDistanceMaterial:qo,MeshBasicMaterial:Dn,MeshMatcapMaterial:wu,LineDashedMaterial:Su,LineBasicMaterial:bt,Material:gt};return new t[e]}}class Ro{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){const l=new al(t);s=new ks(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,h=e.length;c0){i=new ks(this.manager),i.setCrossOrigin(this.crossOrigin);for(let r=0,a=e.length;r"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,r=ci.get(e);if(r!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(r),s.manager.itemEnd(e)},0),r;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){ci.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){i&&i(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let Tr;const ll={getContext:function(){return Tr===void 0&&(Tr=new(window.AudioContext||window.webkitAudioContext)),Tr},setContext:function(o){Tr=o}};class kx extends Lt{constructor(e){super(e)}load(e,t,n,i){const s=this,r=new hn(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(a){try{const l=a.slice(0);ll.getContext().decodeAudioData(l,function(h){t(h)})}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}}class Vx extends la{constructor(e,t,n=1){super(void 0,n),this.isHemisphereLightProbe=!0;const i=new ue().set(e),s=new ue().set(t),r=new A(i.r,i.g,i.b),a=new A(s.r,s.g,s.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(r).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(r).sub(a).multiplyScalar(c)}}class Gx extends la{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const n=new ue().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const bc=new Le,wc=new Le,Un=new Le;class Hx{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new dt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new dt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Un.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,r=t.near*Math.tan(Qn*t.fov*.5)/t.zoom;let a,l;wc.elements[12]=-i,bc.elements[12]=i,a=-r*t.aspect+s,l=r*t.aspect+s,Un.elements[0]=2*t.near/(l-a),Un.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Un),a=-r*t.aspect-s,l=r*t.aspect-s,Un.elements[0]=2*t.near/(l-a),Un.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Un)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(wc),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(bc)}}class Uu{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Sc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Sc();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Sc(){return(typeof performance>"u"?Date:performance).now()}const kn=new A,Ac=new St,Wx=new A,Vn=new A;class qx extends We{constructor(){super(),this.type="AudioListener",this.context=ll.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Uu}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(kn,Ac,Wx),Vn.set(0,0,-1).applyQuaternion(Ac),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(kn.x,i),t.positionY.linearRampToValueAtTime(kn.y,i),t.positionZ.linearRampToValueAtTime(kn.z,i),t.forwardX.linearRampToValueAtTime(Vn.x,i),t.forwardY.linearRampToValueAtTime(Vn.y,i),t.forwardZ.linearRampToValueAtTime(Vn.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(kn.x,kn.y,kn.z),t.setOrientation(Vn.x,Vn.y,Vn.z,n.x,n.y,n.z)}}class ku extends We{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,r=i;s!==r;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==s;++r)e[t+r]=e[n+r]}_slerp(e,t,n,i){St.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const r=this._workIndex*s;St.multiplyQuaternionsFlat(e,r,e,t,e,n),St.slerpFlat(e,t,e,t,e,r,i)}_lerp(e,t,n,i,s){const r=1-i;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*r+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let r=0;r!==s;++r){const a=t+r;e[a]=e[a]+e[n+r]*i}}}const cl="\\[\\]\\.:\\/",Jx=new RegExp("["+cl+"]","g"),hl="[^"+cl+"]",$x="[^"+cl.replace("\\.","")+"]",Kx=/((?:WC+[\/:])*)/.source.replace("WC",hl),jx=/(WCOD+)?/.source.replace("WCOD",$x),Qx=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",hl),e_=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",hl),t_=new RegExp("^"+Kx+jx+Qx+e_+"$"),n_=["material","materials","bones"];class i_{constructor(e,t,n){const i=n||Oe.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Oe{constructor(e,t,n){this.path=t,this.parsedPath=n||Oe.parseTrackName(t),this.node=Oe.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Oe.Composite(e,t,n):new Oe(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Jx,"")}static parseTrackName(e){const t=t_.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);n_.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let r=0;r=s){const u=s++,d=e[u];t[d.uuid]=h,e[h]=d,t[c]=u,e[u]=l;for(let f=0,g=i;f!==g;++f){const p=n[f],m=p[u],_=p[h];p[h]=m,p[u]=_}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,r=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],h=c.uuid,u=t[h];if(u!==void 0)if(delete t[h],u0&&(t[f.uuid]=u),e[u]=f,e.pop();for(let g=0,p=i;g!==p;++g){const m=n[g];m[u]=m[d],m.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const s=this._bindings;if(i!==void 0)return s[i];const r=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);i=s.length,n[e]=i,r.push(e),a.push(t),s.push(u);for(let d=h,f=l.length;d!==f;++d){const g=l[d];u[d]=new Oe(g,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,s=this._parsedPaths,r=this._bindings,a=r.length-1,l=r[a],c=e[a];t[c]=n,r[n]=l,r.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}}class r_{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,r=s.length,a=new Array(r),l={endingStart:Yn,endingEnd:Yn};for(let c=0;c!==r;++c){const h=s[c].createInterpolant(null);a[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ch,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,s=e._clip.duration,r=s/i,a=i/s;e.warp(1,r,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,s=i.time,r=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/r,c[1]=t/r,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);const r=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Oo:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(r),c[h].accumulateAdditive(a);break;case Zr:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(r),c[h].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,s=this._loopCount;const r=n===Lh;if(e===0)return s===-1?i:r&&(s&1)===1?t-i:i;if(n===Eh){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,r)):this._setEndings(this.repetitions===0,!0,r)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,r)}else this._setEndings(!1,!1,r);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(r&&(s&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=Zn,i.endingEnd=Zn):(e?i.endingStart=this.zeroSlopeAtStart?Zn:Yn:i.endingStart=Ls,t?i.endingEnd=this.zeroSlopeAtEnd?Zn:Yn:i.endingEnd=Ls)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let r=this._weightInterpolant;r===null&&(r=i._lendControlInterpolant(),this._weightInterpolant=r);const a=r.parameterPositions,l=r.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}}const a_=new Float32Array(1);class o_ extends un{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,r=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==s;++u){const d=i[u],f=d.name;let g=h[f];if(g!==void 0)++g.referenceCount,r[u]=g;else{if(g=r[u],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,f));continue}const p=t&&t._propertyBindings[u].binding.parsedPath;g=new Vu(Oe.create(n,f,p),d.ValueTypeName,d.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,f),r[u]=g}a[u].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),r=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,r);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(r);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Cc.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Lc=new A,Er=new A;class g_{constructor(e=new A,t=new A){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Lc.subVectors(e,this.start),Er.subVectors(this.end,this.start);const n=Er.dot(Er);let s=Er.dot(Lc)/n;return t&&(s=st(s,0,1)),s}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const Pc=new A;class x_ extends We{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Pe,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let r=0,a=1,l=32;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Nc.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Nc,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class P_ extends Kt{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Pe;i.setAttribute("position",new me(t,3)),i.setAttribute("color",new me(n,3));const s=new bt({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,n){const i=new ue,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class R_{constructor(){this.type="ShapePath",this.color=new ue,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ds,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,s,r){return this.currentPath.bezierCurveTo(e,t,n,i,s,r),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(x){const M=[];for(let v=0,b=x.length;vNumber.EPSILON){if(I<0&&(y=M[L],P=-P,E=M[S],I=-I),x.yE.y)continue;if(x.y===y.y){if(x.x===y.x)return!0}else{const Z=I*(x.x-y.x)-P*(x.y-y.y);if(Z===0)return!0;if(Z<0)continue;b=!b}}else{if(x.y!==y.y)continue;if(E.x<=x.x&&x.x<=y.x||y.x<=x.x&&x.x<=E.x)return!0}}return b}const s=Zt.isClockWise,r=this.subPaths;if(r.length===0)return[];if(t===!0)return n(r);let a,l,c;const h=[];if(r.length===1)return l=r[0],c=new ti,c.curves=l.curves,h.push(c),h;let u=!s(r[0].getPoints());u=e?!u:u;const d=[],f=[];let g=[],p=0,m;f[p]=void 0,g[p]=[];for(let x=0,M=r.length;x1){let x=!1,M=0;for(let v=0,b=f.length;v0&&x===!1&&(g=d)}let _;for(let x=0,M=f.length;x>-c-14,n[l|256]=1024>>-c-14|32768,i[l]=-c-1,i[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,i[l]=13,i[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,i[l]=24,i[l|256]=24):(n[l]=31744,n[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),r=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;!(c&8388608);)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)r[l]=l<<23;r[31]=1199570944,r[32]=2147483648;for(let l=33;l<63;++l)r[l]=2147483648+(l-32<<23);r[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:r,offsetTable:a}}function D_(o){Math.abs(o)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),o=st(o,-65504,65504),an.floatView[0]=o;const e=an.uint32View[0],t=e>>23&511;return an.baseTable[t]+((e&8388607)>>an.shiftTable[t])}function F_(o){const e=o>>10;return an.uint32View[0]=an.mantissaTable[an.offsetTable[e]+(o&1023)]+an.exponentTable[e],an.floatView[0]}var N_=Object.freeze({__proto__:null,toHalfFloat:D_,fromHalfFloat:F_});class z_ extends Pe{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class B_ extends Pe{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function O_(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function U_(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function k_(){console.error("THREE.ImmediateRenderObject has been removed.")}class V_ extends Ot{constructor(e,t,n){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,n),this.samples=4}}class G_ extends Gs{constructor(e,t,n,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,n,i)}}class H_ extends Jr{constructor(e,t,n,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,n,i)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Xr}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Xr);const W_=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:hh,AddEquation:qn,AddOperation:ah,AdditiveAnimationBlendMode:Oo,AdditiveBlending:$a,AlphaFormat:xh,AlwaysDepth:Qc,AlwaysStencilFunc:Dh,AmbientLight:Fu,AmbientLightProbe:Gx,AnimationClip:Us,AnimationLoader:Lx,AnimationMixer:o_,AnimationObjectGroup:s_,AnimationUtils:Ax,ArcCurve:au,ArrayCamera:Yh,ArrowHelper:L_,Audio:ku,AudioAnalyser:Zx,AudioContext:ll,AudioListener:qx,AudioLoader:kx,AxesHelper:P_,BackSide:Bt,BasicDepthPacking:Ph,BasicShadowMap:Ku,Bone:Yo,BooleanKeyframeTrack:pi,Box2:m_,Box3:di,Box3Helper:E_,BoxBufferGeometry:cn,BoxGeometry:cn,BoxHelper:T_,BufferAttribute:Ye,BufferGeometry:Pe,BufferGeometryLoader:Ou,ByteType:dh,Cache:ci,Camera:Kr,CameraHelper:A_,CanvasTexture:J0,CapsuleBufferGeometry:Yi,CapsuleGeometry:Yi,CatmullRomCurve3:ou,CineonToneMapping:ch,CircleBufferGeometry:Zi,CircleGeometry:Zi,ClampToEdgeWrapping:vt,Clock:Uu,Color:ue,ColorKeyframeTrack:rl,ColorManagement:Dt,CompressedTexture:ru,CompressedTextureLoader:Px,ConeBufferGeometry:Ji,ConeGeometry:Ji,CubeCamera:Oh,CubeReflectionMapping:Tn,CubeRefractionMapping:En,CubeTexture:Ws,CubeTextureLoader:Rx,CubeUVReflectionMapping:rs,CubicBezierCurve:$o,CubicBezierCurve3:lu,CubicInterpolant:Tu,CullFaceBack:Ja,CullFaceFront:Bc,CullFaceFrontBack:$u,CullFaceNone:zc,Curve:Ht,CurvePath:hu,CustomBlending:kc,CustomToneMapping:uh,CylinderBufferGeometry:Rn,CylinderGeometry:Rn,Cylindrical:p_,Data3DTexture:Jr,DataArrayTexture:Gs,DataTexture:Gi,DataTexture2DArray:G_,DataTexture3D:H_,DataTextureLoader:Ix,DataUtils:N_,DecrementStencilOp:hd,DecrementWrapStencilOp:dd,DefaultLoadingManager:Lu,DepthFormat:An,DepthStencilFormat:ii,DepthTexture:Zh,DirectionalLight:Du,DirectionalLightHelper:S_,DiscreteInterpolant:Eu,DodecahedronBufferGeometry:$i,DodecahedronGeometry:$i,DoubleSide:ni,DstAlphaFactor:Yc,DstColorFactor:Jc,DynamicCopyUsage:Ed,DynamicDrawUsage:Md,DynamicReadUsage:Sd,EdgesGeometry:uu,EllipseCurve:ra,EqualDepth:th,EqualStencilFunc:gd,EquirectangularReflectionMapping:ws,EquirectangularRefractionMapping:Ss,Euler:as,EventDispatcher:un,ExtrudeBufferGeometry:Ki,ExtrudeGeometry:Ki,FileLoader:hn,FlatShading:Uc,Float16BufferAttribute:uf,Float32BufferAttribute:me,Float64BufferAttribute:df,FloatType:on,Fog:na,FogExp2:ta,Font:U_,FontLoader:O_,FramebufferTexture:Z0,FrontSide:Hi,Frustum:jr,GLBufferAttribute:u_,GLSL1:Ld,GLSL3:wo,GreaterDepth:ih,GreaterEqualDepth:nh,GreaterEqualStencilFunc:yd,GreaterStencilFunc:_d,GridHelper:b_,Group:ki,HalfFloatType:Wi,HemisphereLight:Pu,HemisphereLightHelper:M_,HemisphereLightProbe:Vx,IcosahedronBufferGeometry:ji,IcosahedronGeometry:ji,ImageBitmapLoader:Ux,ImageLoader:ks,ImageUtils:ko,ImmediateRenderObject:k_,IncrementStencilOp:cd,IncrementWrapStencilOp:ud,InstancedBufferAttribute:Xi,InstancedBufferGeometry:Bu,InstancedInterleavedBuffer:h_,InstancedMesh:nu,Int16BufferAttribute:cf,Int32BufferAttribute:hf,Int8BufferAttribute:af,IntType:ph,InterleavedBuffer:ia,InterleavedBufferAttribute:ri,Interpolant:qs,InterpolateDiscrete:Es,InterpolateLinear:Cs,InterpolateSmooth:Br,InvertStencilOp:fd,KeepStencilOp:Or,KeyframeTrack:Wt,LOD:eu,LatheBufferGeometry:ai,LatheGeometry:ai,Layers:$r,LessDepth:eh,LessEqualDepth:Vr,LessEqualStencilFunc:xd,LessStencilFunc:md,Light:Fn,LightProbe:la,Line:Pn,Line3:g_,LineBasicMaterial:bt,LineCurve:aa,LineCurve3:cu,LineDashedMaterial:Su,LineLoop:iu,LineSegments:Kt,LinearEncoding:Ln,LinearFilter:it,LinearInterpolant:sl,LinearMipMapLinearFilter:nd,LinearMipMapNearestFilter:td,LinearMipmapLinearFilter:hi,LinearMipmapNearestFilter:zo,LinearSRGBColorSpace:Sn,LinearToneMapping:oh,Loader:Lt,LoaderUtils:Ro,LoadingManager:al,LoopOnce:Eh,LoopPingPong:Lh,LoopRepeat:Ch,LuminanceAlphaFormat:yh,LuminanceFormat:vh,MOUSE:Zu,Material:gt,MaterialLoader:ca,MathUtils:qd,Matrix3:wt,Matrix4:Le,MaxEquation:eo,Mesh:ft,MeshBasicMaterial:Dn,MeshDepthMaterial:Wo,MeshDistanceMaterial:qo,MeshLambertMaterial:bu,MeshMatcapMaterial:wu,MeshNormalMaterial:Mu,MeshPhongMaterial:vu,MeshPhysicalMaterial:_u,MeshStandardMaterial:tl,MeshToonMaterial:yu,MinEquation:Qa,MirroredRepeatWrapping:Ts,MixOperation:rh,MultiplyBlending:ja,MultiplyOperation:Vs,NearestFilter:ot,NearestMipMapLinearFilter:ed,NearestMipMapNearestFilter:Qu,NearestMipmapLinearFilter:Hr,NearestMipmapNearestFilter:Gr,NeverDepth:jc,NeverStencilFunc:pd,NoBlending:ln,NoColorSpace:ad,NoToneMapping:Yt,NormalAnimationBlendMode:Zr,NormalBlending:Kn,NotEqualDepth:sh,NotEqualStencilFunc:vd,NumberKeyframeTrack:Bs,Object3D:We,ObjectLoader:Bx,ObjectSpaceNormalMap:Ih,OctahedronBufferGeometry:oi,OctahedronGeometry:oi,OneFactor:Wc,OneMinusDstAlphaFactor:Zc,OneMinusDstColorFactor:$c,OneMinusSrcAlphaFactor:No,OneMinusSrcColorFactor:Xc,OrthographicCamera:Qr,PCFShadowMap:Do,PCFSoftShadowMap:Oc,PMREMGenerator:Ao,ParametricGeometry:z_,Path:Ds,PerspectiveCamera:dt,Plane:bn,PlaneBufferGeometry:si,PlaneGeometry:si,PlaneHelper:C_,PointLight:Iu,PointLightHelper:v_,Points:su,PointsMaterial:Zo,PolarGridHelper:w_,PolyhedronBufferGeometry:$t,PolyhedronGeometry:$t,PositionalAudio:Yx,PropertyBinding:Oe,PropertyMixer:Vu,QuadraticBezierCurve:Ko,QuadraticBezierCurve3:jo,Quaternion:St,QuaternionKeyframeTrack:ls,QuaternionLinearInterpolant:Cu,REVISION:Xr,RGBADepthPacking:Rh,RGBAFormat:zt,RGBAIntegerFormat:Ah,RGBA_ASTC_10x10_Format:vo,RGBA_ASTC_10x5_Format:go,RGBA_ASTC_10x6_Format:xo,RGBA_ASTC_10x8_Format:_o,RGBA_ASTC_12x10_Format:yo,RGBA_ASTC_12x12_Format:Mo,RGBA_ASTC_4x4_Format:oo,RGBA_ASTC_5x4_Format:lo,RGBA_ASTC_5x5_Format:co,RGBA_ASTC_6x5_Format:ho,RGBA_ASTC_6x6_Format:uo,RGBA_ASTC_8x5_Format:fo,RGBA_ASTC_8x6_Format:po,RGBA_ASTC_8x8_Format:mo,RGBA_BPTC_Format:bo,RGBA_ETC2_EAC_Format:ao,RGBA_PVRTC_2BPPV1_Format:so,RGBA_PVRTC_4BPPV1_Format:io,RGBA_S3TC_DXT1_Format:Fr,RGBA_S3TC_DXT3_Format:Nr,RGBA_S3TC_DXT5_Format:zr,RGBFormat:_h,RGB_ETC1_Format:Th,RGB_ETC2_Format:ro,RGB_PVRTC_2BPPV1_Format:no,RGB_PVRTC_4BPPV1_Format:to,RGB_S3TC_DXT1_Format:Dr,RGFormat:wh,RGIntegerFormat:Sh,RawShaderMaterial:xu,Ray:Hs,Raycaster:d_,RectAreaLight:Nu,RedFormat:Mh,RedIntegerFormat:bh,ReinhardToneMapping:lh,RepeatWrapping:As,ReplaceStencilOp:ld,ReverseSubtractEquation:Gc,RingBufferGeometry:Qi,RingGeometry:Qi,SRGBColorSpace:Xt,Scene:Kh,ShaderChunk:Ne,ShaderLib:Gt,ShaderMaterial:Jt,ShadowMaterial:gu,Shape:ti,ShapeBufferGeometry:es,ShapeGeometry:es,ShapePath:R_,ShapeUtils:Zt,ShortType:fh,Skeleton:sa,SkeletonHelper:__,SkinnedMesh:tu,SmoothShading:ju,Source:Jn,Sphere:fi,SphereBufferGeometry:li,SphereGeometry:li,Spherical:f_,SphericalHarmonics3:zu,SplineCurve:Qo,SpotLight:Ru,SpotLightHelper:x_,Sprite:Qh,SpriteMaterial:Xo,SrcAlphaFactor:Fo,SrcAlphaSaturateFactor:Kc,SrcColorFactor:qc,StaticCopyUsage:Td,StaticDrawUsage:Ps,StaticReadUsage:wd,StereoCamera:Hx,StreamCopyUsage:Cd,StreamDrawUsage:bd,StreamReadUsage:Ad,StringKeyframeTrack:mi,SubtractEquation:Vc,SubtractiveBlending:Ka,TOUCH:Ju,TangentSpaceNormalMap:ui,TetrahedronBufferGeometry:ts,TetrahedronGeometry:ts,TextGeometry:B_,Texture:ct,TextureLoader:Dx,TorusBufferGeometry:ns,TorusGeometry:ns,TorusKnotBufferGeometry:is,TorusKnotGeometry:is,Triangle:Nt,TriangleFanDrawMode:rd,TriangleStripDrawMode:sd,TrianglesDrawMode:id,TubeBufferGeometry:ss,TubeGeometry:ss,UVMapping:Yr,Uint16BufferAttribute:Vo,Uint32BufferAttribute:Go,Uint8BufferAttribute:of,Uint8ClampedBufferAttribute:lf,Uniform:ul,UniformsGroup:c_,UniformsLib:re,UniformsUtils:Bh,UnsignedByteType:Cn,UnsignedInt248Type:jn,UnsignedIntType:wn,UnsignedShort4444Type:mh,UnsignedShort5551Type:gh,UnsignedShortType:Bo,VSMShadowMap:Bi,Vector2:J,Vector3:A,Vector4:He,VectorKeyframeTrack:Os,VideoTexture:Y0,WebGL1Renderer:$h,WebGL3DRenderTarget:Jd,WebGLArrayRenderTarget:Zd,WebGLCubeRenderTarget:Uh,WebGLMultipleRenderTargets:$d,WebGLMultisampleRenderTarget:V_,WebGLRenderTarget:Ot,WebGLRenderer:Jh,WebGLUtils:Xh,WireframeGeometry:mu,WrapAroundEnding:Ls,ZeroCurvatureEnding:Yn,ZeroFactor:Hc,ZeroSlopeEnding:Zn,ZeroStencilOp:od,_SRGBAFormat:Wr,sRGBEncoding:Je},Symbol.toStringTag,{value:"Module"}));export{Ku as $,$r as A,m_ as B,ue as C,Lu as D,Ki as E,jr as F,ki as G,ct as H,zt as I,d_ as J,Kh as K,Lt as L,wt as M,Oc as N,Qr as O,Ds as P,St as Q,Hs as R,Zt as S,Dx as T,Cn as U,A as V,Uh as W,Yt as X,hh as Y,Jh as Z,Kr as _,hn as a,Do as a0,Bi as a1,Uu as a2,Bu as a3,h_ as a4,ri as a5,mu as a6,Jt as a7,Bh as a8,re as a9,Xr as aa,g_ as ab,He as ac,Wo as ad,Rh as ae,qo as af,Ne as ag,Hi as ah,it as ai,Bt as aj,Xi as ak,Dn as al,si as am,Kn as an,We as ao,su as ap,J as b,ti as c,Pe as d,me as e,R_ as f,ni as g,W_ as h,Md as i,Le as j,gt as k,ft as l,Oh as m,cn as n,qd as o,ns as p,tl as q,di as r,fi as s,bn as t,un as u,Zu as v,Ju as w,dt as x,f_ as y,jo as z}; diff --git a/build/index.html b/build/index.html index 5a4287ca9..ee78e9d82 100644 --- a/build/index.html +++ b/build/index.html @@ -22,7 +22,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Second Brain - +