From c392bfa123e99cc66b75778d59a6f64fbf932a6a Mon Sep 17 00:00:00 2001 From: Github Actions Date: Thu, 21 Dec 2023 15:52:06 +0000 Subject: [PATCH] ci: automatic build fixes --- build/assets/DailyMotion-8bcd7fa5.js | 1 + build/assets/Facebook-3861963e.js | 1 + build/assets/FilePlayer-9c0411e3.js | 1 + build/assets/Kaltura-2acfad14.js | 1 + build/assets/Mixcloud-b5d9ccb9.js | 1 + build/assets/Preview-e1f6a083.js | 1 + build/assets/SoundCloud-69b8b3fa.js | 1 + build/assets/Streamable-97944a29.js | 1 + build/assets/Twitch-a814064e.js | 1 + build/assets/Vidyard-fc7804c3.js | 1 + build/assets/Vimeo-308f3829.js | 1 + build/assets/Wistia-8102eb9f.js | 1 + build/assets/YouTube-bdb5f19a.js | 1 + .../{index-2fc286f3.js => index-58e91b76.js} | 390 +++++++++--------- build/index.html | 2 +- 15 files changed, 203 insertions(+), 202 deletions(-) create mode 100644 build/assets/DailyMotion-8bcd7fa5.js create mode 100644 build/assets/Facebook-3861963e.js create mode 100644 build/assets/FilePlayer-9c0411e3.js create mode 100644 build/assets/Kaltura-2acfad14.js create mode 100644 build/assets/Mixcloud-b5d9ccb9.js create mode 100644 build/assets/Preview-e1f6a083.js create mode 100644 build/assets/SoundCloud-69b8b3fa.js create mode 100644 build/assets/Streamable-97944a29.js create mode 100644 build/assets/Twitch-a814064e.js create mode 100644 build/assets/Vidyard-fc7804c3.js create mode 100644 build/assets/Vimeo-308f3829.js create mode 100644 build/assets/Wistia-8102eb9f.js create mode 100644 build/assets/YouTube-bdb5f19a.js rename build/assets/{index-2fc286f3.js => index-58e91b76.js} (80%) diff --git a/build/assets/DailyMotion-8bcd7fa5.js b/build/assets/DailyMotion-8bcd7fa5.js new file mode 100644 index 000000000..77d1e4813 --- /dev/null +++ b/build/assets/DailyMotion-8bcd7fa5.js @@ -0,0 +1 @@ +import{g as P,r as v,u as D,p as O}from"./index-58e91b76.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(_),I=b({__proto__:null,default:R},[_]);export{I as D}; diff --git a/build/assets/Facebook-3861963e.js b/build/assets/Facebook-3861963e.js new file mode 100644 index 000000000..95a30494a --- /dev/null +++ b/build/assets/Facebook-3861963e.js @@ -0,0 +1 @@ +import{g as _,r as g,u as P,p as m}from"./index-58e91b76.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",y="FB",f="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,y,f).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,y,f).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),B=v({__proto__:null,default:M},[d]);export{B as F}; diff --git a/build/assets/FilePlayer-9c0411e3.js b/build/assets/FilePlayer-9c0411e3.js new file mode 100644 index 000000000..d35c662ca --- /dev/null +++ b/build/assets/FilePlayer-9c0411e3.js @@ -0,0 +1 @@ +import{g as b,r as _,u as O,p as A}from"./index-58e91b76.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),J=R({__proto__:null,default:z},[g]);export{J as F}; diff --git a/build/assets/Kaltura-2acfad14.js b/build/assets/Kaltura-2acfad14.js new file mode 100644 index 000000000..1868a41f8 --- /dev/null +++ b/build/assets/Kaltura-2acfad14.js @@ -0,0 +1 @@ +import{g as y,r as f,u as _,p as m}from"./index-58e91b76.js";function P(r,e){for(var t=0;ts[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,s)=>{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:!(s=b(e,a))||s.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),o=(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),o(this,"callPlayer",p.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,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:s,seconds:a})=>{this.duration=s,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"})}}o(i,"displayName","Kaltura");o(i,"canPlay",S.canPlay.kaltura);const M=y(d),C=P({__proto__:null,default:M},[d]);export{C as K}; diff --git a/build/assets/Mixcloud-b5d9ccb9.js b/build/assets/Mixcloud-b5d9ccb9.js new file mode 100644 index 000000000..605190454 --- /dev/null +++ b/build/assets/Mixcloud-b5d9ccb9.js @@ -0,0 +1 @@ +import{g as _,r as f,u as m,p as g}from"./index-58e91b76.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),p=D(f),u=m,y=g;const E="https://widget.mixcloud.com/media/js/widgetApi.js",L="Mixcloud";class l extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",u.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,u.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,u.queryString)({...r.options,feed:`/${s}/`});return p.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),A=v({__proto__:null,default:T},[h]);export{A as M}; diff --git a/build/assets/Preview-e1f6a083.js b/build/assets/Preview-e1f6a083.js new file mode 100644 index 000000000..29e681db2 --- /dev/null +++ b/build/assets/Preview-e1f6a083.js @@ -0,0 +1 @@ +import{g as y,r as b}from"./index-58e91b76.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/SoundCloud-69b8b3fa.js b/build/assets/SoundCloud-69b8b3fa.js new file mode 100644 index 000000000..47cfba82e --- /dev/null +++ b/build/assets/SoundCloud-69b8b3fa.js @@ -0,0 +1 @@ +import{g as P,r as g,u as b,p as v}from"./index-58e91b76.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),F=O({__proto__:null,default:N},[f]);export{F as S}; diff --git a/build/assets/Streamable-97944a29.js b/build/assets/Streamable-97944a29.js new file mode 100644 index 000000000..020e0ca0f --- /dev/null +++ b/build/assets/Streamable-97944a29.js @@ -0,0 +1 @@ +import{g as m,r as f,u as _,p as b}from"./index-58e91b76.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),C=P({__proto__:null,default:x},[y]);export{C as S}; diff --git a/build/assets/Twitch-a814064e.js b/build/assets/Twitch-a814064e.js new file mode 100644 index 000000000..c8998d914 --- /dev/null +++ b/build/assets/Twitch-a814064e.js @@ -0,0 +1 @@ +import{g as w,r as D,u as C,p as N}from"./index-58e91b76.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),n=(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),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:o,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),...o.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})}}n(h,"displayName","Twitch");n(h,"canPlay",u.canPlay.twitch);n(h,"loopOnEnded",!0);const W=w(f),G=I({__proto__:null,default:W},[f]);export{G as T}; diff --git a/build/assets/Vidyard-fc7804c3.js b/build/assets/Vidyard-fc7804c3.js new file mode 100644 index 000000000..d7ec7bca5 --- /dev/null +++ b/build/assets/Vidyard-fc7804c3.js @@ -0,0 +1 @@ +import{g as m,r as v,u as b,p as O}from"./index-58e91b76.js";function V(t,e){for(var r=0;rs[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,s)=>{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:!(s=j(e,a))||s.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),o=(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),o(this,"callPlayer",d.callPlayer),o(this,"mute",()=>{this.setVolume(0)}),o(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:s,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,g)=>{this.player||(this.player=g,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,...s.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}))}}o(y,"displayName","Vidyard");o(y,"canPlay",P.canPlay.vidyard);const T=m(f),K=V({__proto__:null,default:T},[f]);export{K as V}; diff --git a/build/assets/Vimeo-308f3829.js b/build/assets/Vimeo-308f3829.js new file mode 100644 index 000000000..f5df64012 --- /dev/null +++ b/build/assets/Vimeo-308f3829.js @@ -0,0 +1 @@ +import{g as d,r as f,u as m,p as _}from"./index-58e91b76.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),C=P({__proto__:null,default:T},[y]);export{C as V}; diff --git a/build/assets/Wistia-8102eb9f.js b/build/assets/Wistia-8102eb9f.js new file mode 100644 index 000000000..869c68421 --- /dev/null +++ b/build/assets/Wistia-8102eb9f.js @@ -0,0 +1 @@ +import{g,r as m,u as v,p as w}from"./index-58e91b76.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(m),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=g(_),T=O({__proto__:null,default:L},[_]);export{T as W}; diff --git a/build/assets/YouTube-bdb5f19a.js b/build/assets/YouTube-bdb5f19a.js new file mode 100644 index 000000000..38114b9c3 --- /dev/null +++ b/build/assets/YouTube-bdb5f19a.js @@ -0,0 +1 @@ +import{g as U,r as I,u as L,p as Y}from"./index-58e91b76.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),b=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_-]+)/,m=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends b.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(m.test(e)){const[,t]=e.match(m);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)||m.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 b.default.createElement("div",{style:t},b.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=U(S),q=k({__proto__:null,default:$},[S]);export{q as Y}; diff --git a/build/assets/index-2fc286f3.js b/build/assets/index-58e91b76.js similarity index 80% rename from build/assets/index-2fc286f3.js rename to build/assets/index-58e91b76.js index d227c85ee..de34f239f 100644 --- a/build/assets/index-2fc286f3.js +++ b/build/assets/index-58e91b76.js @@ -1,9 +1,9 @@ -var ix=Object.defineProperty;var rx=(tt,et,nt)=>et in tt?ix(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):tt[et]=nt;var ox=(tt,et)=>()=>(et||tt((et={exports:{}}).exports,et),et.exports);var bw=(tt,et,nt)=>(rx(tt,typeof et!="symbol"?et+"":et,nt),nt);var ax=ox((exports,module)=>{function _mergeNamespaces(tt,et){for(var nt=0;ntit[rt]})}}}return Object.freeze(Object.defineProperty(tt,Symbol.toStringTag,{value:"Module"}))}(function(){const et=document.createElement("link").relList;if(et&&et.supports&&et.supports("modulepreload"))return;for(const rt of document.querySelectorAll('link[rel="modulepreload"]'))it(rt);new MutationObserver(rt=>{for(const ot of rt)if(ot.type==="childList")for(const at of ot.addedNodes)at.tagName==="LINK"&&at.rel==="modulepreload"&&it(at)}).observe(document,{childList:!0,subtree:!0});function nt(rt){const ot={};return rt.integrity&&(ot.integrity=rt.integrity),rt.referrerPolicy&&(ot.referrerPolicy=rt.referrerPolicy),rt.crossOrigin==="use-credentials"?ot.credentials="include":rt.crossOrigin==="anonymous"?ot.credentials="omit":ot.credentials="same-origin",ot}function it(rt){if(rt.ep)return;rt.ep=!0;const ot=nt(rt);fetch(rt.href,ot)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(tt){return tt&&tt.__esModule&&Object.prototype.hasOwnProperty.call(tt,"default")?tt.default:tt}function getAugmentedNamespace(tt){if(tt.__esModule)return tt;var et=tt.default;if(typeof et=="function"){var nt=function it(){return this instanceof it?Reflect.construct(et,arguments,this.constructor):et.apply(this,arguments)};nt.prototype=et.prototype}else nt={};return Object.defineProperty(nt,"__esModule",{value:!0}),Object.keys(tt).forEach(function(it){var rt=Object.getOwnPropertyDescriptor(tt,it);Object.defineProperty(nt,it,rt.get?rt:{enumerable:!0,get:function(){return tt[it]}})}),nt}var buffer$2={},base64Js={};base64Js.byteLength=byteLength$1;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup$2=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$9=0,len=code$1.length;i$90)throw new Error("Invalid string. Length must be a multiple of 4");var nt=tt.indexOf("=");nt===-1&&(nt=et);var it=nt===et?0:4-nt%4;return[nt,it]}function byteLength$1(tt){var et=getLens(tt),nt=et[0],it=et[1];return(nt+it)*3/4-it}function _byteLength(tt,et,nt){return(et+nt)*3/4-nt}function toByteArray(tt){var et,nt=getLens(tt),it=nt[0],rt=nt[1],ot=new Arr(_byteLength(tt,it,rt)),at=0,st=rt>0?it-4:it,lt;for(lt=0;lt>16&255,ot[at++]=et>>8&255,ot[at++]=et&255;return rt===2&&(et=revLookup[tt.charCodeAt(lt)]<<2|revLookup[tt.charCodeAt(lt+1)]>>4,ot[at++]=et&255),rt===1&&(et=revLookup[tt.charCodeAt(lt)]<<10|revLookup[tt.charCodeAt(lt+1)]<<4|revLookup[tt.charCodeAt(lt+2)]>>2,ot[at++]=et>>8&255,ot[at++]=et&255),ot}function tripletToBase64(tt){return lookup$2[tt>>18&63]+lookup$2[tt>>12&63]+lookup$2[tt>>6&63]+lookup$2[tt&63]}function encodeChunk(tt,et,nt){for(var it,rt=[],ot=et;otst?st:at+ot));return it===1?(et=tt[nt-1],rt.push(lookup$2[et>>2]+lookup$2[et<<4&63]+"==")):it===2&&(et=(tt[nt-2]<<8)+tt[nt-1],rt.push(lookup$2[et>>10]+lookup$2[et>>4&63]+lookup$2[et<<2&63]+"=")),rt.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754.read=function(tt,et,nt,it,rt){var ot,at,st=rt*8-it-1,lt=(1<>1,ut=-7,ht=nt?rt-1:0,dt=nt?-1:1,pt=tt[et+ht];for(ht+=dt,ot=pt&(1<<-ut)-1,pt>>=-ut,ut+=st;ut>0;ot=ot*256+tt[et+ht],ht+=dt,ut-=8);for(at=ot&(1<<-ut)-1,ot>>=-ut,ut+=it;ut>0;at=at*256+tt[et+ht],ht+=dt,ut-=8);if(ot===0)ot=1-ct;else{if(ot===lt)return at?NaN:(pt?-1:1)*(1/0);at=at+Math.pow(2,it),ot=ot-ct}return(pt?-1:1)*at*Math.pow(2,ot-it)};ieee754.write=function(tt,et,nt,it,rt,ot){var at,st,lt,ct=ot*8-rt-1,ut=(1<>1,dt=rt===23?Math.pow(2,-24)-Math.pow(2,-77):0,pt=it?0:ot-1,mt=it?1:-1,gt=et<0||et===0&&1/et<0?1:0;for(et=Math.abs(et),isNaN(et)||et===1/0?(st=isNaN(et)?1:0,at=ut):(at=Math.floor(Math.log(et)/Math.LN2),et*(lt=Math.pow(2,-at))<1&&(at--,lt*=2),at+ht>=1?et+=dt/lt:et+=dt*Math.pow(2,1-ht),et*lt>=2&&(at++,lt/=2),at+ht>=ut?(st=0,at=ut):at+ht>=1?(st=(et*lt-1)*Math.pow(2,rt),at=at+ht):(st=et*Math.pow(2,ht-1)*Math.pow(2,rt),at=0));rt>=8;tt[nt+pt]=st&255,pt+=mt,st/=256,rt-=8);for(at=at<0;tt[nt+pt]=at&255,pt+=mt,at/=256,ct-=8);tt[nt+pt-mt]|=gt*128};/*! +var ix=Object.defineProperty;var rx=(tt,et,nt)=>et in tt?ix(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):tt[et]=nt;var bw=(tt,et,nt)=>(rx(tt,typeof et!="symbol"?et+"":et,nt),nt);function _mergeNamespaces(tt,et){for(var nt=0;ntit[rt]})}}}return Object.freeze(Object.defineProperty(tt,Symbol.toStringTag,{value:"Module"}))}(function(){const et=document.createElement("link").relList;if(et&&et.supports&&et.supports("modulepreload"))return;for(const rt of document.querySelectorAll('link[rel="modulepreload"]'))it(rt);new MutationObserver(rt=>{for(const ot of rt)if(ot.type==="childList")for(const at of ot.addedNodes)at.tagName==="LINK"&&at.rel==="modulepreload"&&it(at)}).observe(document,{childList:!0,subtree:!0});function nt(rt){const ot={};return rt.integrity&&(ot.integrity=rt.integrity),rt.referrerPolicy&&(ot.referrerPolicy=rt.referrerPolicy),rt.crossOrigin==="use-credentials"?ot.credentials="include":rt.crossOrigin==="anonymous"?ot.credentials="omit":ot.credentials="same-origin",ot}function it(rt){if(rt.ep)return;rt.ep=!0;const ot=nt(rt);fetch(rt.href,ot)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(tt){return tt&&tt.__esModule&&Object.prototype.hasOwnProperty.call(tt,"default")?tt.default:tt}function getAugmentedNamespace(tt){if(tt.__esModule)return tt;var et=tt.default;if(typeof et=="function"){var nt=function it(){return this instanceof it?Reflect.construct(et,arguments,this.constructor):et.apply(this,arguments)};nt.prototype=et.prototype}else nt={};return Object.defineProperty(nt,"__esModule",{value:!0}),Object.keys(tt).forEach(function(it){var rt=Object.getOwnPropertyDescriptor(tt,it);Object.defineProperty(nt,it,rt.get?rt:{enumerable:!0,get:function(){return tt[it]}})}),nt}var buffer$2={},base64Js={};base64Js.byteLength=byteLength$1;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup$2=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$9=0,len=code$1.length;i$90)throw new Error("Invalid string. Length must be a multiple of 4");var nt=tt.indexOf("=");nt===-1&&(nt=et);var it=nt===et?0:4-nt%4;return[nt,it]}function byteLength$1(tt){var et=getLens(tt),nt=et[0],it=et[1];return(nt+it)*3/4-it}function _byteLength(tt,et,nt){return(et+nt)*3/4-nt}function toByteArray(tt){var et,nt=getLens(tt),it=nt[0],rt=nt[1],ot=new Arr(_byteLength(tt,it,rt)),at=0,st=rt>0?it-4:it,lt;for(lt=0;lt>16&255,ot[at++]=et>>8&255,ot[at++]=et&255;return rt===2&&(et=revLookup[tt.charCodeAt(lt)]<<2|revLookup[tt.charCodeAt(lt+1)]>>4,ot[at++]=et&255),rt===1&&(et=revLookup[tt.charCodeAt(lt)]<<10|revLookup[tt.charCodeAt(lt+1)]<<4|revLookup[tt.charCodeAt(lt+2)]>>2,ot[at++]=et>>8&255,ot[at++]=et&255),ot}function tripletToBase64(tt){return lookup$2[tt>>18&63]+lookup$2[tt>>12&63]+lookup$2[tt>>6&63]+lookup$2[tt&63]}function encodeChunk(tt,et,nt){for(var it,rt=[],ot=et;otst?st:at+ot));return it===1?(et=tt[nt-1],rt.push(lookup$2[et>>2]+lookup$2[et<<4&63]+"==")):it===2&&(et=(tt[nt-2]<<8)+tt[nt-1],rt.push(lookup$2[et>>10]+lookup$2[et>>4&63]+lookup$2[et<<2&63]+"=")),rt.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754.read=function(tt,et,nt,it,rt){var ot,at,st=rt*8-it-1,lt=(1<>1,ut=-7,ht=nt?rt-1:0,dt=nt?-1:1,pt=tt[et+ht];for(ht+=dt,ot=pt&(1<<-ut)-1,pt>>=-ut,ut+=st;ut>0;ot=ot*256+tt[et+ht],ht+=dt,ut-=8);for(at=ot&(1<<-ut)-1,ot>>=-ut,ut+=it;ut>0;at=at*256+tt[et+ht],ht+=dt,ut-=8);if(ot===0)ot=1-ct;else{if(ot===lt)return at?NaN:(pt?-1:1)*(1/0);at=at+Math.pow(2,it),ot=ot-ct}return(pt?-1:1)*at*Math.pow(2,ot-it)};ieee754.write=function(tt,et,nt,it,rt,ot){var at,st,lt,ct=ot*8-rt-1,ut=(1<>1,dt=rt===23?Math.pow(2,-24)-Math.pow(2,-77):0,pt=it?0:ot-1,mt=it?1:-1,gt=et<0||et===0&&1/et<0?1:0;for(et=Math.abs(et),isNaN(et)||et===1/0?(st=isNaN(et)?1:0,at=ut):(at=Math.floor(Math.log(et)/Math.LN2),et*(lt=Math.pow(2,-at))<1&&(at--,lt*=2),at+ht>=1?et+=dt/lt:et+=dt*Math.pow(2,1-ht),et*lt>=2&&(at++,lt/=2),at+ht>=ut?(st=0,at=ut):at+ht>=1?(st=(et*lt-1)*Math.pow(2,rt),at=at+ht):(st=et*Math.pow(2,ht-1)*Math.pow(2,rt),at=0));rt>=8;tt[nt+pt]=st&255,pt+=mt,st/=256,rt-=8);for(at=at<0;tt[nt+pt]=at&255,pt+=mt,at/=256,ct-=8);tt[nt+pt-mt]|=gt*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */(function(tt){const et=base64Js,nt=ieee754,it=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;tt.Buffer=st,tt.SlowBuffer=wt,tt.INSPECT_MAX_BYTES=50;const rt=2147483647;tt.kMaxLength=rt,st.TYPED_ARRAY_SUPPORT=ot(),!st.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ot(){try{const nn=new Uint8Array(1),Kt={foo:function(){return 42}};return Object.setPrototypeOf(Kt,Uint8Array.prototype),Object.setPrototypeOf(nn,Kt),nn.foo()===42}catch{return!1}}Object.defineProperty(st.prototype,"parent",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.buffer}}),Object.defineProperty(st.prototype,"offset",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.byteOffset}});function at(nn){if(nn>rt)throw new RangeError('The value "'+nn+'" is invalid for option "size"');const Kt=new Uint8Array(nn);return Object.setPrototypeOf(Kt,st.prototype),Kt}function st(nn,Kt,Yt){if(typeof nn=="number"){if(typeof Kt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ht(nn)}return lt(nn,Kt,Yt)}st.poolSize=8192;function lt(nn,Kt,Yt){if(typeof nn=="string")return dt(nn,Kt);if(ArrayBuffer.isView(nn))return mt(nn);if(nn==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof nn);if(xn(nn,ArrayBuffer)||nn&&xn(nn.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xn(nn,SharedArrayBuffer)||nn&&xn(nn.buffer,SharedArrayBuffer)))return gt(nn,Kt,Yt);if(typeof nn=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const _n=nn.valueOf&&nn.valueOf();if(_n!=null&&_n!==nn)return st.from(_n,Kt,Yt);const Mn=bt(nn);if(Mn)return Mn;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof nn[Symbol.toPrimitive]=="function")return st.from(nn[Symbol.toPrimitive]("string"),Kt,Yt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof nn)}st.from=function(nn,Kt,Yt){return lt(nn,Kt,Yt)},Object.setPrototypeOf(st.prototype,Uint8Array.prototype),Object.setPrototypeOf(st,Uint8Array);function ct(nn){if(typeof nn!="number")throw new TypeError('"size" argument must be of type number');if(nn<0)throw new RangeError('The value "'+nn+'" is invalid for option "size"')}function ut(nn,Kt,Yt){return ct(nn),nn<=0?at(nn):Kt!==void 0?typeof Yt=="string"?at(nn).fill(Kt,Yt):at(nn).fill(Kt):at(nn)}st.alloc=function(nn,Kt,Yt){return ut(nn,Kt,Yt)};function ht(nn){return ct(nn),at(nn<0?0:yt(nn)|0)}st.allocUnsafe=function(nn){return ht(nn)},st.allocUnsafeSlow=function(nn){return ht(nn)};function dt(nn,Kt){if((typeof Kt!="string"||Kt==="")&&(Kt="utf8"),!st.isEncoding(Kt))throw new TypeError("Unknown encoding: "+Kt);const Yt=vt(nn,Kt)|0;let _n=at(Yt);const Mn=_n.write(nn,Kt);return Mn!==Yt&&(_n=_n.slice(0,Mn)),_n}function pt(nn){const Kt=nn.length<0?0:yt(nn.length)|0,Yt=at(Kt);for(let _n=0;_n=rt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rt.toString(16)+" bytes");return nn|0}function wt(nn){return+nn!=nn&&(nn=0),st.alloc(+nn)}st.isBuffer=function(Kt){return Kt!=null&&Kt._isBuffer===!0&&Kt!==st.prototype},st.compare=function(Kt,Yt){if(xn(Kt,Uint8Array)&&(Kt=st.from(Kt,Kt.offset,Kt.byteLength)),xn(Yt,Uint8Array)&&(Yt=st.from(Yt,Yt.offset,Yt.byteLength)),!st.isBuffer(Kt)||!st.isBuffer(Yt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Kt===Yt)return 0;let _n=Kt.length,Mn=Yt.length;for(let Bn=0,Nn=Math.min(_n,Mn);BnMn.length?(st.isBuffer(Nn)||(Nn=st.from(Nn)),Nn.copy(Mn,Bn)):Uint8Array.prototype.set.call(Mn,Nn,Bn);else if(st.isBuffer(Nn))Nn.copy(Mn,Bn);else throw new TypeError('"list" argument must be an Array of Buffers');Bn+=Nn.length}return Mn};function vt(nn,Kt){if(st.isBuffer(nn))return nn.length;if(ArrayBuffer.isView(nn)||xn(nn,ArrayBuffer))return nn.byteLength;if(typeof nn!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof nn);const Yt=nn.length,_n=arguments.length>2&&arguments[2]===!0;if(!_n&&Yt===0)return 0;let Mn=!1;for(;;)switch(Kt){case"ascii":case"latin1":case"binary":return Yt;case"utf8":case"utf-8":return Un(nn).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yt*2;case"hex":return Yt>>>1;case"base64":return En(nn).length;default:if(Mn)return _n?-1:Un(nn).length;Kt=(""+Kt).toLowerCase(),Mn=!0}}st.byteLength=vt;function xt(nn,Kt,Yt){let _n=!1;if((Kt===void 0||Kt<0)&&(Kt=0),Kt>this.length||((Yt===void 0||Yt>this.length)&&(Yt=this.length),Yt<=0)||(Yt>>>=0,Kt>>>=0,Yt<=Kt))return"";for(nn||(nn="utf8");;)switch(nn){case"hex":return Ot(this,Kt,Yt);case"utf8":case"utf-8":return kt(this,Kt,Yt);case"ascii":return Wt(this,Kt,Yt);case"latin1":case"binary":return jt(this,Kt,Yt);case"base64":return Pt(this,Kt,Yt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ct(this,Kt,Yt);default:if(_n)throw new TypeError("Unknown encoding: "+nn);nn=(nn+"").toLowerCase(),_n=!0}}st.prototype._isBuffer=!0;function St(nn,Kt,Yt){const _n=nn[Kt];nn[Kt]=nn[Yt],nn[Yt]=_n}st.prototype.swap16=function(){const Kt=this.length;if(Kt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Yt=0;YtYt&&(Kt+=" ... "),""},it&&(st.prototype[it]=st.prototype.inspect),st.prototype.compare=function(Kt,Yt,_n,Mn,Bn){if(xn(Kt,Uint8Array)&&(Kt=st.from(Kt,Kt.offset,Kt.byteLength)),!st.isBuffer(Kt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Kt);if(Yt===void 0&&(Yt=0),_n===void 0&&(_n=Kt?Kt.length:0),Mn===void 0&&(Mn=0),Bn===void 0&&(Bn=this.length),Yt<0||_n>Kt.length||Mn<0||Bn>this.length)throw new RangeError("out of range index");if(Mn>=Bn&&Yt>=_n)return 0;if(Mn>=Bn)return-1;if(Yt>=_n)return 1;if(Yt>>>=0,_n>>>=0,Mn>>>=0,Bn>>>=0,this===Kt)return 0;let Nn=Bn-Mn,qn=_n-Yt;const Wn=Math.min(Nn,qn),Vn=this.slice(Mn,Bn),Fn=Kt.slice(Yt,_n);for(let Jn=0;Jn2147483647?Yt=2147483647:Yt<-2147483648&&(Yt=-2147483648),Yt=+Yt,dn(Yt)&&(Yt=Mn?0:nn.length-1),Yt<0&&(Yt=nn.length+Yt),Yt>=nn.length){if(Mn)return-1;Yt=nn.length-1}else if(Yt<0)if(Mn)Yt=0;else return-1;if(typeof Kt=="string"&&(Kt=st.from(Kt,_n)),st.isBuffer(Kt))return Kt.length===0?-1:It(nn,Kt,Yt,_n,Mn);if(typeof Kt=="number")return Kt=Kt&255,typeof Uint8Array.prototype.indexOf=="function"?Mn?Uint8Array.prototype.indexOf.call(nn,Kt,Yt):Uint8Array.prototype.lastIndexOf.call(nn,Kt,Yt):It(nn,[Kt],Yt,_n,Mn);throw new TypeError("val must be string, number or Buffer")}function It(nn,Kt,Yt,_n,Mn){let Bn=1,Nn=nn.length,qn=Kt.length;if(_n!==void 0&&(_n=String(_n).toLowerCase(),_n==="ucs2"||_n==="ucs-2"||_n==="utf16le"||_n==="utf-16le")){if(nn.length<2||Kt.length<2)return-1;Bn=2,Nn/=2,qn/=2,Yt/=2}function Wn(Fn,Jn){return Bn===1?Fn[Jn]:Fn.readUInt16BE(Jn*Bn)}let Vn;if(Mn){let Fn=-1;for(Vn=Yt;VnNn&&(Yt=Nn-qn),Vn=Yt;Vn>=0;Vn--){let Fn=!0;for(let Jn=0;JnMn&&(_n=Mn)):_n=Mn;const Bn=Kt.length;_n>Bn/2&&(_n=Bn/2);let Nn;for(Nn=0;Nn<_n;++Nn){const qn=parseInt(Kt.substr(Nn*2,2),16);if(dn(qn))return Nn;nn[Yt+Nn]=qn}return Nn}function $t(nn,Kt,Yt,_n){return In(Un(Kt,nn.length-Yt),nn,Yt,_n)}function Ut(nn,Kt,Yt,_n){return In(yn(Kt),nn,Yt,_n)}function Lt(nn,Kt,Yt,_n){return In(En(Kt),nn,Yt,_n)}function Bt(nn,Kt,Yt,_n){return In(un(Kt,nn.length-Yt),nn,Yt,_n)}st.prototype.write=function(Kt,Yt,_n,Mn){if(Yt===void 0)Mn="utf8",_n=this.length,Yt=0;else if(_n===void 0&&typeof Yt=="string")Mn=Yt,_n=this.length,Yt=0;else if(isFinite(Yt))Yt=Yt>>>0,isFinite(_n)?(_n=_n>>>0,Mn===void 0&&(Mn="utf8")):(Mn=_n,_n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Bn=this.length-Yt;if((_n===void 0||_n>Bn)&&(_n=Bn),Kt.length>0&&(_n<0||Yt<0)||Yt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Mn||(Mn="utf8");let Nn=!1;for(;;)switch(Mn){case"hex":return Tt(this,Kt,Yt,_n);case"utf8":case"utf-8":return $t(this,Kt,Yt,_n);case"ascii":case"latin1":case"binary":return Ut(this,Kt,Yt,_n);case"base64":return Lt(this,Kt,Yt,_n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bt(this,Kt,Yt,_n);default:if(Nn)throw new TypeError("Unknown encoding: "+Mn);Mn=(""+Mn).toLowerCase(),Nn=!0}},st.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Pt(nn,Kt,Yt){return Kt===0&&Yt===nn.length?et.fromByteArray(nn):et.fromByteArray(nn.slice(Kt,Yt))}function kt(nn,Kt,Yt){Yt=Math.min(nn.length,Yt);const _n=[];let Mn=Kt;for(;Mn239?4:Bn>223?3:Bn>191?2:1;if(Mn+qn<=Yt){let Wn,Vn,Fn,Jn;switch(qn){case 1:Bn<128&&(Nn=Bn);break;case 2:Wn=nn[Mn+1],(Wn&192)===128&&(Jn=(Bn&31)<<6|Wn&63,Jn>127&&(Nn=Jn));break;case 3:Wn=nn[Mn+1],Vn=nn[Mn+2],(Wn&192)===128&&(Vn&192)===128&&(Jn=(Bn&15)<<12|(Wn&63)<<6|Vn&63,Jn>2047&&(Jn<55296||Jn>57343)&&(Nn=Jn));break;case 4:Wn=nn[Mn+1],Vn=nn[Mn+2],Fn=nn[Mn+3],(Wn&192)===128&&(Vn&192)===128&&(Fn&192)===128&&(Jn=(Bn&15)<<18|(Wn&63)<<12|(Vn&63)<<6|Fn&63,Jn>65535&&Jn<1114112&&(Nn=Jn))}}Nn===null?(Nn=65533,qn=1):Nn>65535&&(Nn-=65536,_n.push(Nn>>>10&1023|55296),Nn=56320|Nn&1023),_n.push(Nn),Mn+=qn}return Rt(_n)}const At=4096;function Rt(nn){const Kt=nn.length;if(Kt<=At)return String.fromCharCode.apply(String,nn);let Yt="",_n=0;for(;_n_n)&&(Yt=_n);let Mn="";for(let Bn=Kt;Bn_n&&(Kt=_n),Yt<0?(Yt+=_n,Yt<0&&(Yt=0)):Yt>_n&&(Yt=_n),YtYt)throw new RangeError("Trying to access beyond buffer length")}st.prototype.readUintLE=st.prototype.readUIntLE=function(Kt,Yt,_n){Kt=Kt>>>0,Yt=Yt>>>0,_n||Dt(Kt,Yt,this.length);let Mn=this[Kt],Bn=1,Nn=0;for(;++Nn>>0,Yt=Yt>>>0,_n||Dt(Kt,Yt,this.length);let Mn=this[Kt+--Yt],Bn=1;for(;Yt>0&&(Bn*=256);)Mn+=this[Kt+--Yt]*Bn;return Mn},st.prototype.readUint8=st.prototype.readUInt8=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,1,this.length),this[Kt]},st.prototype.readUint16LE=st.prototype.readUInt16LE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,2,this.length),this[Kt]|this[Kt+1]<<8},st.prototype.readUint16BE=st.prototype.readUInt16BE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,2,this.length),this[Kt]<<8|this[Kt+1]},st.prototype.readUint32LE=st.prototype.readUInt32LE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,4,this.length),(this[Kt]|this[Kt+1]<<8|this[Kt+2]<<16)+this[Kt+3]*16777216},st.prototype.readUint32BE=st.prototype.readUInt32BE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,4,this.length),this[Kt]*16777216+(this[Kt+1]<<16|this[Kt+2]<<8|this[Kt+3])},st.prototype.readBigUInt64LE=hn(function(Kt){Kt=Kt>>>0,Sn(Kt,"offset");const Yt=this[Kt],_n=this[Kt+7];(Yt===void 0||_n===void 0)&&Tn(Kt,this.length-8);const Mn=Yt+this[++Kt]*2**8+this[++Kt]*2**16+this[++Kt]*2**24,Bn=this[++Kt]+this[++Kt]*2**8+this[++Kt]*2**16+_n*2**24;return BigInt(Mn)+(BigInt(Bn)<>>0,Sn(Kt,"offset");const Yt=this[Kt],_n=this[Kt+7];(Yt===void 0||_n===void 0)&&Tn(Kt,this.length-8);const Mn=Yt*2**24+this[++Kt]*2**16+this[++Kt]*2**8+this[++Kt],Bn=this[++Kt]*2**24+this[++Kt]*2**16+this[++Kt]*2**8+_n;return(BigInt(Mn)<>>0,Yt=Yt>>>0,_n||Dt(Kt,Yt,this.length);let Mn=this[Kt],Bn=1,Nn=0;for(;++Nn=Bn&&(Mn-=Math.pow(2,8*Yt)),Mn},st.prototype.readIntBE=function(Kt,Yt,_n){Kt=Kt>>>0,Yt=Yt>>>0,_n||Dt(Kt,Yt,this.length);let Mn=Yt,Bn=1,Nn=this[Kt+--Mn];for(;Mn>0&&(Bn*=256);)Nn+=this[Kt+--Mn]*Bn;return Bn*=128,Nn>=Bn&&(Nn-=Math.pow(2,8*Yt)),Nn},st.prototype.readInt8=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,1,this.length),this[Kt]&128?(255-this[Kt]+1)*-1:this[Kt]},st.prototype.readInt16LE=function(Kt,Yt){Kt=Kt>>>0,Yt||Dt(Kt,2,this.length);const _n=this[Kt]|this[Kt+1]<<8;return _n&32768?_n|4294901760:_n},st.prototype.readInt16BE=function(Kt,Yt){Kt=Kt>>>0,Yt||Dt(Kt,2,this.length);const _n=this[Kt+1]|this[Kt]<<8;return _n&32768?_n|4294901760:_n},st.prototype.readInt32LE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,4,this.length),this[Kt]|this[Kt+1]<<8|this[Kt+2]<<16|this[Kt+3]<<24},st.prototype.readInt32BE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,4,this.length),this[Kt]<<24|this[Kt+1]<<16|this[Kt+2]<<8|this[Kt+3]},st.prototype.readBigInt64LE=hn(function(Kt){Kt=Kt>>>0,Sn(Kt,"offset");const Yt=this[Kt],_n=this[Kt+7];(Yt===void 0||_n===void 0)&&Tn(Kt,this.length-8);const Mn=this[Kt+4]+this[Kt+5]*2**8+this[Kt+6]*2**16+(_n<<24);return(BigInt(Mn)<>>0,Sn(Kt,"offset");const Yt=this[Kt],_n=this[Kt+7];(Yt===void 0||_n===void 0)&&Tn(Kt,this.length-8);const Mn=(Yt<<24)+this[++Kt]*2**16+this[++Kt]*2**8+this[++Kt];return(BigInt(Mn)<>>0,Yt||Dt(Kt,4,this.length),nt.read(this,Kt,!0,23,4)},st.prototype.readFloatBE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,4,this.length),nt.read(this,Kt,!1,23,4)},st.prototype.readDoubleLE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,8,this.length),nt.read(this,Kt,!0,52,8)},st.prototype.readDoubleBE=function(Kt,Yt){return Kt=Kt>>>0,Yt||Dt(Kt,8,this.length),nt.read(this,Kt,!1,52,8)};function Mt(nn,Kt,Yt,_n,Mn,Bn){if(!st.isBuffer(nn))throw new TypeError('"buffer" argument must be a Buffer instance');if(Kt>Mn||Ktnn.length)throw new RangeError("Index out of range")}st.prototype.writeUintLE=st.prototype.writeUIntLE=function(Kt,Yt,_n,Mn){if(Kt=+Kt,Yt=Yt>>>0,_n=_n>>>0,!Mn){const qn=Math.pow(2,8*_n)-1;Mt(this,Kt,Yt,_n,qn,0)}let Bn=1,Nn=0;for(this[Yt]=Kt&255;++Nn<_n&&(Bn*=256);)this[Yt+Nn]=Kt/Bn&255;return Yt+_n},st.prototype.writeUintBE=st.prototype.writeUIntBE=function(Kt,Yt,_n,Mn){if(Kt=+Kt,Yt=Yt>>>0,_n=_n>>>0,!Mn){const qn=Math.pow(2,8*_n)-1;Mt(this,Kt,Yt,_n,qn,0)}let Bn=_n-1,Nn=1;for(this[Yt+Bn]=Kt&255;--Bn>=0&&(Nn*=256);)this[Yt+Bn]=Kt/Nn&255;return Yt+_n},st.prototype.writeUint8=st.prototype.writeUInt8=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,1,255,0),this[Yt]=Kt&255,Yt+1},st.prototype.writeUint16LE=st.prototype.writeUInt16LE=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,2,65535,0),this[Yt]=Kt&255,this[Yt+1]=Kt>>>8,Yt+2},st.prototype.writeUint16BE=st.prototype.writeUInt16BE=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,2,65535,0),this[Yt]=Kt>>>8,this[Yt+1]=Kt&255,Yt+2},st.prototype.writeUint32LE=st.prototype.writeUInt32LE=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,4,4294967295,0),this[Yt+3]=Kt>>>24,this[Yt+2]=Kt>>>16,this[Yt+1]=Kt>>>8,this[Yt]=Kt&255,Yt+4},st.prototype.writeUint32BE=st.prototype.writeUInt32BE=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,4,4294967295,0),this[Yt]=Kt>>>24,this[Yt+1]=Kt>>>16,this[Yt+2]=Kt>>>8,this[Yt+3]=Kt&255,Yt+4};function Vt(nn,Kt,Yt,_n,Mn){Zt(Kt,_n,Mn,nn,Yt,7);let Bn=Number(Kt&BigInt(4294967295));nn[Yt++]=Bn,Bn=Bn>>8,nn[Yt++]=Bn,Bn=Bn>>8,nn[Yt++]=Bn,Bn=Bn>>8,nn[Yt++]=Bn;let Nn=Number(Kt>>BigInt(32)&BigInt(4294967295));return nn[Yt++]=Nn,Nn=Nn>>8,nn[Yt++]=Nn,Nn=Nn>>8,nn[Yt++]=Nn,Nn=Nn>>8,nn[Yt++]=Nn,Yt}function Qt(nn,Kt,Yt,_n,Mn){Zt(Kt,_n,Mn,nn,Yt,7);let Bn=Number(Kt&BigInt(4294967295));nn[Yt+7]=Bn,Bn=Bn>>8,nn[Yt+6]=Bn,Bn=Bn>>8,nn[Yt+5]=Bn,Bn=Bn>>8,nn[Yt+4]=Bn;let Nn=Number(Kt>>BigInt(32)&BigInt(4294967295));return nn[Yt+3]=Nn,Nn=Nn>>8,nn[Yt+2]=Nn,Nn=Nn>>8,nn[Yt+1]=Nn,Nn=Nn>>8,nn[Yt]=Nn,Yt+8}st.prototype.writeBigUInt64LE=hn(function(Kt,Yt=0){return Vt(this,Kt,Yt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeBigUInt64BE=hn(function(Kt,Yt=0){return Qt(this,Kt,Yt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeIntLE=function(Kt,Yt,_n,Mn){if(Kt=+Kt,Yt=Yt>>>0,!Mn){const Wn=Math.pow(2,8*_n-1);Mt(this,Kt,Yt,_n,Wn-1,-Wn)}let Bn=0,Nn=1,qn=0;for(this[Yt]=Kt&255;++Bn<_n&&(Nn*=256);)Kt<0&&qn===0&&this[Yt+Bn-1]!==0&&(qn=1),this[Yt+Bn]=(Kt/Nn>>0)-qn&255;return Yt+_n},st.prototype.writeIntBE=function(Kt,Yt,_n,Mn){if(Kt=+Kt,Yt=Yt>>>0,!Mn){const Wn=Math.pow(2,8*_n-1);Mt(this,Kt,Yt,_n,Wn-1,-Wn)}let Bn=_n-1,Nn=1,qn=0;for(this[Yt+Bn]=Kt&255;--Bn>=0&&(Nn*=256);)Kt<0&&qn===0&&this[Yt+Bn+1]!==0&&(qn=1),this[Yt+Bn]=(Kt/Nn>>0)-qn&255;return Yt+_n},st.prototype.writeInt8=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,1,127,-128),Kt<0&&(Kt=255+Kt+1),this[Yt]=Kt&255,Yt+1},st.prototype.writeInt16LE=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,2,32767,-32768),this[Yt]=Kt&255,this[Yt+1]=Kt>>>8,Yt+2},st.prototype.writeInt16BE=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,2,32767,-32768),this[Yt]=Kt>>>8,this[Yt+1]=Kt&255,Yt+2},st.prototype.writeInt32LE=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,4,2147483647,-2147483648),this[Yt]=Kt&255,this[Yt+1]=Kt>>>8,this[Yt+2]=Kt>>>16,this[Yt+3]=Kt>>>24,Yt+4},st.prototype.writeInt32BE=function(Kt,Yt,_n){return Kt=+Kt,Yt=Yt>>>0,_n||Mt(this,Kt,Yt,4,2147483647,-2147483648),Kt<0&&(Kt=4294967295+Kt+1),this[Yt]=Kt>>>24,this[Yt+1]=Kt>>>16,this[Yt+2]=Kt>>>8,this[Yt+3]=Kt&255,Yt+4},st.prototype.writeBigInt64LE=hn(function(Kt,Yt=0){return Vt(this,Kt,Yt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),st.prototype.writeBigInt64BE=hn(function(Kt,Yt=0){return Qt(this,Kt,Yt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rn(nn,Kt,Yt,_n,Mn,Bn){if(Yt+_n>nn.length)throw new RangeError("Index out of range");if(Yt<0)throw new RangeError("Index out of range")}function Xt(nn,Kt,Yt,_n,Mn){return Kt=+Kt,Yt=Yt>>>0,Mn||rn(nn,Kt,Yt,4),nt.write(nn,Kt,Yt,_n,23,4),Yt+4}st.prototype.writeFloatLE=function(Kt,Yt,_n){return Xt(this,Kt,Yt,!0,_n)},st.prototype.writeFloatBE=function(Kt,Yt,_n){return Xt(this,Kt,Yt,!1,_n)};function an(nn,Kt,Yt,_n,Mn){return Kt=+Kt,Yt=Yt>>>0,Mn||rn(nn,Kt,Yt,8),nt.write(nn,Kt,Yt,_n,52,8),Yt+8}st.prototype.writeDoubleLE=function(Kt,Yt,_n){return an(this,Kt,Yt,!0,_n)},st.prototype.writeDoubleBE=function(Kt,Yt,_n){return an(this,Kt,Yt,!1,_n)},st.prototype.copy=function(Kt,Yt,_n,Mn){if(!st.isBuffer(Kt))throw new TypeError("argument should be a Buffer");if(_n||(_n=0),!Mn&&Mn!==0&&(Mn=this.length),Yt>=Kt.length&&(Yt=Kt.length),Yt||(Yt=0),Mn>0&&Mn<_n&&(Mn=_n),Mn===_n||Kt.length===0||this.length===0)return 0;if(Yt<0)throw new RangeError("targetStart out of bounds");if(_n<0||_n>=this.length)throw new RangeError("Index out of range");if(Mn<0)throw new RangeError("sourceEnd out of bounds");Mn>this.length&&(Mn=this.length),Kt.length-Yt>>0,_n=_n===void 0?this.length:_n>>>0,Kt||(Kt=0);let Bn;if(typeof Kt=="number")for(Bn=Yt;Bn<_n;++Bn)this[Bn]=Kt;else{const Nn=st.isBuffer(Kt)?Kt:st.from(Kt,Mn),qn=Nn.length;if(qn===0)throw new TypeError('The value "'+Kt+'" is invalid for argument "value"');for(Bn=0;Bn<_n-Yt;++Bn)this[Bn+Yt]=Nn[Bn%qn]}return this};const tn={};function pn(nn,Kt,Yt){tn[nn]=class extends Yt{constructor(){super(),Object.defineProperty(this,"message",{value:Kt.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${nn}]`,this.stack,delete this.name}get code(){return nn}set code(Mn){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Mn,writable:!0})}toString(){return`${this.name} [${nn}]: ${this.message}`}}}pn("ERR_BUFFER_OUT_OF_BOUNDS",function(nn){return nn?`${nn} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),pn("ERR_INVALID_ARG_TYPE",function(nn,Kt){return`The "${nn}" argument must be of type number. Received type ${typeof Kt}`},TypeError),pn("ERR_OUT_OF_RANGE",function(nn,Kt,Yt){let _n=`The value of "${nn}" is out of range.`,Mn=Yt;return Number.isInteger(Yt)&&Math.abs(Yt)>2**32?Mn=vn(String(Yt)):typeof Yt=="bigint"&&(Mn=String(Yt),(Yt>BigInt(2)**BigInt(32)||Yt<-(BigInt(2)**BigInt(32)))&&(Mn=vn(Mn)),Mn+="n"),_n+=` It must be ${Kt}. Received ${Mn}`,_n},RangeError);function vn(nn){let Kt="",Yt=nn.length;const _n=nn[0]==="-"?1:0;for(;Yt>=_n+4;Yt-=3)Kt=`_${nn.slice(Yt-3,Yt)}${Kt}`;return`${nn.slice(0,Yt)}${Kt}`}function sn(nn,Kt,Yt){Sn(Kt,"offset"),(nn[Kt]===void 0||nn[Kt+Yt]===void 0)&&Tn(Kt,nn.length-(Yt+1))}function Zt(nn,Kt,Yt,_n,Mn,Bn){if(nn>Yt||nn3?Kt===0||Kt===BigInt(0)?qn=`>= 0${Nn} and < 2${Nn} ** ${(Bn+1)*8}${Nn}`:qn=`>= -(2${Nn} ** ${(Bn+1)*8-1}${Nn}) and < 2 ** ${(Bn+1)*8-1}${Nn}`:qn=`>= ${Kt}${Nn} and <= ${Yt}${Nn}`,new tn.ERR_OUT_OF_RANGE("value",qn,nn)}sn(_n,Mn,Bn)}function Sn(nn,Kt){if(typeof nn!="number")throw new tn.ERR_INVALID_ARG_TYPE(Kt,"number",nn)}function Tn(nn,Kt,Yt){throw Math.floor(nn)!==nn?(Sn(nn,Yt),new tn.ERR_OUT_OF_RANGE(Yt||"offset","an integer",nn)):Kt<0?new tn.ERR_BUFFER_OUT_OF_BOUNDS:new tn.ERR_OUT_OF_RANGE(Yt||"offset",`>= ${Yt?1:0} and <= ${Kt}`,nn)}const Cn=/[^+/0-9A-Za-z-_]/g;function jn(nn){if(nn=nn.split("=")[0],nn=nn.trim().replace(Cn,""),nn.length<2)return"";for(;nn.length%4!==0;)nn=nn+"=";return nn}function Un(nn,Kt){Kt=Kt||1/0;let Yt;const _n=nn.length;let Mn=null;const Bn=[];for(let Nn=0;Nn<_n;++Nn){if(Yt=nn.charCodeAt(Nn),Yt>55295&&Yt<57344){if(!Mn){if(Yt>56319){(Kt-=3)>-1&&Bn.push(239,191,189);continue}else if(Nn+1===_n){(Kt-=3)>-1&&Bn.push(239,191,189);continue}Mn=Yt;continue}if(Yt<56320){(Kt-=3)>-1&&Bn.push(239,191,189),Mn=Yt;continue}Yt=(Mn-55296<<10|Yt-56320)+65536}else Mn&&(Kt-=3)>-1&&Bn.push(239,191,189);if(Mn=null,Yt<128){if((Kt-=1)<0)break;Bn.push(Yt)}else if(Yt<2048){if((Kt-=2)<0)break;Bn.push(Yt>>6|192,Yt&63|128)}else if(Yt<65536){if((Kt-=3)<0)break;Bn.push(Yt>>12|224,Yt>>6&63|128,Yt&63|128)}else if(Yt<1114112){if((Kt-=4)<0)break;Bn.push(Yt>>18|240,Yt>>12&63|128,Yt>>6&63|128,Yt&63|128)}else throw new Error("Invalid code point")}return Bn}function yn(nn){const Kt=[];for(let Yt=0;Yt>8,Mn=Yt%256,Bn.push(Mn),Bn.push(_n);return Bn}function En(nn){return et.toByteArray(jn(nn))}function In(nn,Kt,Yt,_n){let Mn;for(Mn=0;Mn<_n&&!(Mn+Yt>=Kt.length||Mn>=nn.length);++Mn)Kt[Mn+Yt]=nn[Mn];return Mn}function xn(nn,Kt){return nn instanceof Kt||nn!=null&&nn.constructor!=null&&nn.constructor.name!=null&&nn.constructor.name===Kt.name}function dn(nn){return nn!==nn}const cn=function(){const nn="0123456789abcdef",Kt=new Array(256);for(let Yt=0;Yt<16;++Yt){const _n=Yt*16;for(let Mn=0;Mn<16;++Mn)Kt[_n+Mn]=nn[Yt]+nn[Mn]}return Kt}();function hn(nn){return typeof BigInt>"u"?$n:nn}function $n(){throw new Error("BigInt not supported")}})(buffer$2);var browser$d={exports:{}},process$1=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(tt){if(cachedSetTimeout===setTimeout)return setTimeout(tt,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(tt,0);try{return cachedSetTimeout(tt,0)}catch{try{return cachedSetTimeout.call(null,tt,0)}catch{return cachedSetTimeout.call(this,tt,0)}}}function runClearTimeout(tt){if(cachedClearTimeout===clearTimeout)return clearTimeout(tt);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(tt);try{return cachedClearTimeout(tt)}catch{try{return cachedClearTimeout.call(null,tt)}catch{return cachedClearTimeout.call(this,tt)}}}var queue$2=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue$2=currentQueue.concat(queue$2):queueIndex=-1,queue$2.length&&drainQueue())}function drainQueue(){if(!draining){var tt=runTimeout(cleanUpNextTick);draining=!0;for(var et=queue$2.length;et;){for(currentQueue=queue$2,queue$2=[];++queueIndex1)for(var nt=1;ntrt)throw new RangeError('The value "'+tn+'" is invalid for option "size"');const qt=new Uint8Array(tn);return Object.setPrototypeOf(qt,st.prototype),qt}function st(tn,qt,Kt){if(typeof tn=="number"){if(typeof qt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ht(tn)}return lt(tn,qt,Kt)}st.poolSize=8192;function lt(tn,qt,Kt){if(typeof tn=="string")return dt(tn,qt);if(ArrayBuffer.isView(tn))return mt(tn);if(tn==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof tn);if(yn(tn,ArrayBuffer)||tn&&yn(tn.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(yn(tn,SharedArrayBuffer)||tn&&yn(tn.buffer,SharedArrayBuffer)))return gt(tn,qt,Kt);if(typeof tn=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const wn=tn.valueOf&&tn.valueOf();if(wn!=null&&wn!==tn)return st.from(wn,qt,Kt);const Rn=bt(tn);if(Rn)return Rn;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof tn[Symbol.toPrimitive]=="function")return st.from(tn[Symbol.toPrimitive]("string"),qt,Kt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof tn)}st.from=function(tn,qt,Kt){return lt(tn,qt,Kt)},Object.setPrototypeOf(st.prototype,Uint8Array.prototype),Object.setPrototypeOf(st,Uint8Array);function ct(tn){if(typeof tn!="number")throw new TypeError('"size" argument must be of type number');if(tn<0)throw new RangeError('The value "'+tn+'" is invalid for option "size"')}function ut(tn,qt,Kt){return ct(tn),tn<=0?at(tn):qt!==void 0?typeof Kt=="string"?at(tn).fill(qt,Kt):at(tn).fill(qt):at(tn)}st.alloc=function(tn,qt,Kt){return ut(tn,qt,Kt)};function ht(tn){return ct(tn),at(tn<0?0:yt(tn)|0)}st.allocUnsafe=function(tn){return ht(tn)},st.allocUnsafeSlow=function(tn){return ht(tn)};function dt(tn,qt){if((typeof qt!="string"||qt==="")&&(qt="utf8"),!st.isEncoding(qt))throw new TypeError("Unknown encoding: "+qt);const Kt=vt(tn,qt)|0;let wn=at(Kt);const Rn=wn.write(tn,qt);return Rn!==Kt&&(wn=wn.slice(0,Rn)),wn}function pt(tn){const qt=tn.length<0?0:yt(tn.length)|0,Kt=at(qt);for(let wn=0;wn=rt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rt.toString(16)+" bytes");return tn|0}function wt(tn){return+tn!=tn&&(tn=0),st.alloc(+tn)}st.isBuffer=function(qt){return qt!=null&&qt._isBuffer===!0&&qt!==st.prototype},st.compare=function(qt,Kt){if(yn(qt,Uint8Array)&&(qt=st.from(qt,qt.offset,qt.byteLength)),yn(Kt,Uint8Array)&&(Kt=st.from(Kt,Kt.offset,Kt.byteLength)),!st.isBuffer(qt)||!st.isBuffer(Kt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(qt===Kt)return 0;let wn=qt.length,Rn=Kt.length;for(let jn=0,Bn=Math.min(wn,Rn);jnRn.length?(st.isBuffer(Bn)||(Bn=st.from(Bn)),Bn.copy(Rn,jn)):Uint8Array.prototype.set.call(Rn,Bn,jn);else if(st.isBuffer(Bn))Bn.copy(Rn,jn);else throw new TypeError('"list" argument must be an Array of Buffers');jn+=Bn.length}return Rn};function vt(tn,qt){if(st.isBuffer(tn))return tn.length;if(ArrayBuffer.isView(tn)||yn(tn,ArrayBuffer))return tn.byteLength;if(typeof tn!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof tn);const Kt=tn.length,wn=arguments.length>2&&arguments[2]===!0;if(!wn&&Kt===0)return 0;let Rn=!1;for(;;)switch(qt){case"ascii":case"latin1":case"binary":return Kt;case"utf8":case"utf-8":return Un(tn).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kt*2;case"hex":return Kt>>>1;case"base64":return gn(tn).length;default:if(Rn)return wn?-1:Un(tn).length;qt=(""+qt).toLowerCase(),Rn=!0}}st.byteLength=vt;function xt(tn,qt,Kt){let wn=!1;if((qt===void 0||qt<0)&&(qt=0),qt>this.length||((Kt===void 0||Kt>this.length)&&(Kt=this.length),Kt<=0)||(Kt>>>=0,qt>>>=0,Kt<=qt))return"";for(tn||(tn="utf8");;)switch(tn){case"hex":return Bt(this,qt,Kt);case"utf8":case"utf-8":return kt(this,qt,Kt);case"ascii":return Ut(this,qt,Kt);case"latin1":case"binary":return Nt(this,qt,Kt);case"base64":return jt(this,qt,Kt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mt(this,qt,Kt);default:if(wn)throw new TypeError("Unknown encoding: "+tn);tn=(tn+"").toLowerCase(),wn=!0}}st.prototype._isBuffer=!0;function St(tn,qt,Kt){const wn=tn[qt];tn[qt]=tn[Kt],tn[Kt]=wn}st.prototype.swap16=function(){const qt=this.length;if(qt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Kt=0;KtKt&&(qt+=" ... "),""},it&&(st.prototype[it]=st.prototype.inspect),st.prototype.compare=function(qt,Kt,wn,Rn,jn){if(yn(qt,Uint8Array)&&(qt=st.from(qt,qt.offset,qt.byteLength)),!st.isBuffer(qt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof qt);if(Kt===void 0&&(Kt=0),wn===void 0&&(wn=qt?qt.length:0),Rn===void 0&&(Rn=0),jn===void 0&&(jn=this.length),Kt<0||wn>qt.length||Rn<0||jn>this.length)throw new RangeError("out of range index");if(Rn>=jn&&Kt>=wn)return 0;if(Rn>=jn)return-1;if(Kt>=wn)return 1;if(Kt>>>=0,wn>>>=0,Rn>>>=0,jn>>>=0,this===qt)return 0;let Bn=jn-Rn,Xn=wn-Kt;const Wn=Math.min(Bn,Xn),Gn=this.slice(Rn,jn),Fn=qt.slice(Kt,wn);for(let Jn=0;Jn2147483647?Kt=2147483647:Kt<-2147483648&&(Kt=-2147483648),Kt=+Kt,dn(Kt)&&(Kt=Rn?0:tn.length-1),Kt<0&&(Kt=tn.length+Kt),Kt>=tn.length){if(Rn)return-1;Kt=tn.length-1}else if(Kt<0)if(Rn)Kt=0;else return-1;if(typeof qt=="string"&&(qt=st.from(qt,wn)),st.isBuffer(qt))return qt.length===0?-1:$t(tn,qt,Kt,wn,Rn);if(typeof qt=="number")return qt=qt&255,typeof Uint8Array.prototype.indexOf=="function"?Rn?Uint8Array.prototype.indexOf.call(tn,qt,Kt):Uint8Array.prototype.lastIndexOf.call(tn,qt,Kt):$t(tn,[qt],Kt,wn,Rn);throw new TypeError("val must be string, number or Buffer")}function $t(tn,qt,Kt,wn,Rn){let jn=1,Bn=tn.length,Xn=qt.length;if(wn!==void 0&&(wn=String(wn).toLowerCase(),wn==="ucs2"||wn==="ucs-2"||wn==="utf16le"||wn==="utf-16le")){if(tn.length<2||qt.length<2)return-1;jn=2,Bn/=2,Xn/=2,Kt/=2}function Wn(Fn,Jn){return jn===1?Fn[Jn]:Fn.readUInt16BE(Jn*jn)}let Gn;if(Rn){let Fn=-1;for(Gn=Kt;GnBn&&(Kt=Bn-Xn),Gn=Kt;Gn>=0;Gn--){let Fn=!0;for(let Jn=0;JnRn&&(wn=Rn)):wn=Rn;const jn=qt.length;wn>jn/2&&(wn=jn/2);let Bn;for(Bn=0;Bn>>0,isFinite(wn)?(wn=wn>>>0,Rn===void 0&&(Rn="utf8")):(Rn=wn,wn=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const jn=this.length-Kt;if((wn===void 0||wn>jn)&&(wn=jn),qt.length>0&&(wn<0||Kt<0)||Kt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Rn||(Rn="utf8");let Bn=!1;for(;;)switch(Rn){case"hex":return It(this,qt,Kt,wn);case"utf8":case"utf-8":return Ft(this,qt,Kt,wn);case"ascii":case"latin1":case"binary":return Ht(this,qt,Kt,wn);case"base64":return zt(this,qt,Kt,wn);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ot(this,qt,Kt,wn);default:if(Bn)throw new TypeError("Unknown encoding: "+Rn);Rn=(""+Rn).toLowerCase(),Bn=!0}},st.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jt(tn,qt,Kt){return qt===0&&Kt===tn.length?et.fromByteArray(tn):et.fromByteArray(tn.slice(qt,Kt))}function kt(tn,qt,Kt){Kt=Math.min(tn.length,Kt);const wn=[];let Rn=qt;for(;Rn239?4:jn>223?3:jn>191?2:1;if(Rn+Xn<=Kt){let Wn,Gn,Fn,Jn;switch(Xn){case 1:jn<128&&(Bn=jn);break;case 2:Wn=tn[Rn+1],(Wn&192)===128&&(Jn=(jn&31)<<6|Wn&63,Jn>127&&(Bn=Jn));break;case 3:Wn=tn[Rn+1],Gn=tn[Rn+2],(Wn&192)===128&&(Gn&192)===128&&(Jn=(jn&15)<<12|(Wn&63)<<6|Gn&63,Jn>2047&&(Jn<55296||Jn>57343)&&(Bn=Jn));break;case 4:Wn=tn[Rn+1],Gn=tn[Rn+2],Fn=tn[Rn+3],(Wn&192)===128&&(Gn&192)===128&&(Fn&192)===128&&(Jn=(jn&15)<<18|(Wn&63)<<12|(Gn&63)<<6|Fn&63,Jn>65535&&Jn<1114112&&(Bn=Jn))}}Bn===null?(Bn=65533,Xn=1):Bn>65535&&(Bn-=65536,wn.push(Bn>>>10&1023|55296),Bn=56320|Bn&1023),wn.push(Bn),Rn+=Xn}return Ct(wn)}const Tt=4096;function Ct(tn){const qt=tn.length;if(qt<=Tt)return String.fromCharCode.apply(String,tn);let Kt="",wn=0;for(;wnwn)&&(Kt=wn);let Rn="";for(let jn=qt;jnwn&&(qt=wn),Kt<0?(Kt+=wn,Kt<0&&(Kt=0)):Kt>wn&&(Kt=wn),KtKt)throw new RangeError("Trying to access beyond buffer length")}st.prototype.readUintLE=st.prototype.readUIntLE=function(qt,Kt,wn){qt=qt>>>0,Kt=Kt>>>0,wn||Dt(qt,Kt,this.length);let Rn=this[qt],jn=1,Bn=0;for(;++Bn>>0,Kt=Kt>>>0,wn||Dt(qt,Kt,this.length);let Rn=this[qt+--Kt],jn=1;for(;Kt>0&&(jn*=256);)Rn+=this[qt+--Kt]*jn;return Rn},st.prototype.readUint8=st.prototype.readUInt8=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,1,this.length),this[qt]},st.prototype.readUint16LE=st.prototype.readUInt16LE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,2,this.length),this[qt]|this[qt+1]<<8},st.prototype.readUint16BE=st.prototype.readUInt16BE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,2,this.length),this[qt]<<8|this[qt+1]},st.prototype.readUint32LE=st.prototype.readUInt32LE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,4,this.length),(this[qt]|this[qt+1]<<8|this[qt+2]<<16)+this[qt+3]*16777216},st.prototype.readUint32BE=st.prototype.readUInt32BE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,4,this.length),this[qt]*16777216+(this[qt+1]<<16|this[qt+2]<<8|this[qt+3])},st.prototype.readBigUInt64LE=rn(function(qt){qt=qt>>>0,En(qt,"offset");const Kt=this[qt],wn=this[qt+7];(Kt===void 0||wn===void 0)&&In(qt,this.length-8);const Rn=Kt+this[++qt]*2**8+this[++qt]*2**16+this[++qt]*2**24,jn=this[++qt]+this[++qt]*2**8+this[++qt]*2**16+wn*2**24;return BigInt(Rn)+(BigInt(jn)<>>0,En(qt,"offset");const Kt=this[qt],wn=this[qt+7];(Kt===void 0||wn===void 0)&&In(qt,this.length-8);const Rn=Kt*2**24+this[++qt]*2**16+this[++qt]*2**8+this[++qt],jn=this[++qt]*2**24+this[++qt]*2**16+this[++qt]*2**8+wn;return(BigInt(Rn)<>>0,Kt=Kt>>>0,wn||Dt(qt,Kt,this.length);let Rn=this[qt],jn=1,Bn=0;for(;++Bn=jn&&(Rn-=Math.pow(2,8*Kt)),Rn},st.prototype.readIntBE=function(qt,Kt,wn){qt=qt>>>0,Kt=Kt>>>0,wn||Dt(qt,Kt,this.length);let Rn=Kt,jn=1,Bn=this[qt+--Rn];for(;Rn>0&&(jn*=256);)Bn+=this[qt+--Rn]*jn;return jn*=128,Bn>=jn&&(Bn-=Math.pow(2,8*Kt)),Bn},st.prototype.readInt8=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,1,this.length),this[qt]&128?(255-this[qt]+1)*-1:this[qt]},st.prototype.readInt16LE=function(qt,Kt){qt=qt>>>0,Kt||Dt(qt,2,this.length);const wn=this[qt]|this[qt+1]<<8;return wn&32768?wn|4294901760:wn},st.prototype.readInt16BE=function(qt,Kt){qt=qt>>>0,Kt||Dt(qt,2,this.length);const wn=this[qt+1]|this[qt]<<8;return wn&32768?wn|4294901760:wn},st.prototype.readInt32LE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,4,this.length),this[qt]|this[qt+1]<<8|this[qt+2]<<16|this[qt+3]<<24},st.prototype.readInt32BE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,4,this.length),this[qt]<<24|this[qt+1]<<16|this[qt+2]<<8|this[qt+3]},st.prototype.readBigInt64LE=rn(function(qt){qt=qt>>>0,En(qt,"offset");const Kt=this[qt],wn=this[qt+7];(Kt===void 0||wn===void 0)&&In(qt,this.length-8);const Rn=this[qt+4]+this[qt+5]*2**8+this[qt+6]*2**16+(wn<<24);return(BigInt(Rn)<>>0,En(qt,"offset");const Kt=this[qt],wn=this[qt+7];(Kt===void 0||wn===void 0)&&In(qt,this.length-8);const Rn=(Kt<<24)+this[++qt]*2**16+this[++qt]*2**8+this[++qt];return(BigInt(Rn)<>>0,Kt||Dt(qt,4,this.length),nt.read(this,qt,!0,23,4)},st.prototype.readFloatBE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,4,this.length),nt.read(this,qt,!1,23,4)},st.prototype.readDoubleLE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,8,this.length),nt.read(this,qt,!0,52,8)},st.prototype.readDoubleBE=function(qt,Kt){return qt=qt>>>0,Kt||Dt(qt,8,this.length),nt.read(this,qt,!1,52,8)};function Pt(tn,qt,Kt,wn,Rn,jn){if(!st.isBuffer(tn))throw new TypeError('"buffer" argument must be a Buffer instance');if(qt>Rn||qttn.length)throw new RangeError("Index out of range")}st.prototype.writeUintLE=st.prototype.writeUIntLE=function(qt,Kt,wn,Rn){if(qt=+qt,Kt=Kt>>>0,wn=wn>>>0,!Rn){const Xn=Math.pow(2,8*wn)-1;Pt(this,qt,Kt,wn,Xn,0)}let jn=1,Bn=0;for(this[Kt]=qt&255;++Bn>>0,wn=wn>>>0,!Rn){const Xn=Math.pow(2,8*wn)-1;Pt(this,qt,Kt,wn,Xn,0)}let jn=wn-1,Bn=1;for(this[Kt+jn]=qt&255;--jn>=0&&(Bn*=256);)this[Kt+jn]=qt/Bn&255;return Kt+wn},st.prototype.writeUint8=st.prototype.writeUInt8=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,1,255,0),this[Kt]=qt&255,Kt+1},st.prototype.writeUint16LE=st.prototype.writeUInt16LE=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,2,65535,0),this[Kt]=qt&255,this[Kt+1]=qt>>>8,Kt+2},st.prototype.writeUint16BE=st.prototype.writeUInt16BE=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,2,65535,0),this[Kt]=qt>>>8,this[Kt+1]=qt&255,Kt+2},st.prototype.writeUint32LE=st.prototype.writeUInt32LE=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,4,4294967295,0),this[Kt+3]=qt>>>24,this[Kt+2]=qt>>>16,this[Kt+1]=qt>>>8,this[Kt]=qt&255,Kt+4},st.prototype.writeUint32BE=st.prototype.writeUInt32BE=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,4,4294967295,0),this[Kt]=qt>>>24,this[Kt+1]=qt>>>16,this[Kt+2]=qt>>>8,this[Kt+3]=qt&255,Kt+4};function Vt(tn,qt,Kt,wn,Rn){Zt(qt,wn,Rn,tn,Kt,7);let jn=Number(qt&BigInt(4294967295));tn[Kt++]=jn,jn=jn>>8,tn[Kt++]=jn,jn=jn>>8,tn[Kt++]=jn,jn=jn>>8,tn[Kt++]=jn;let Bn=Number(qt>>BigInt(32)&BigInt(4294967295));return tn[Kt++]=Bn,Bn=Bn>>8,tn[Kt++]=Bn,Bn=Bn>>8,tn[Kt++]=Bn,Bn=Bn>>8,tn[Kt++]=Bn,Kt}function nn(tn,qt,Kt,wn,Rn){Zt(qt,wn,Rn,tn,Kt,7);let jn=Number(qt&BigInt(4294967295));tn[Kt+7]=jn,jn=jn>>8,tn[Kt+6]=jn,jn=jn>>8,tn[Kt+5]=jn,jn=jn>>8,tn[Kt+4]=jn;let Bn=Number(qt>>BigInt(32)&BigInt(4294967295));return tn[Kt+3]=Bn,Bn=Bn>>8,tn[Kt+2]=Bn,Bn=Bn>>8,tn[Kt+1]=Bn,Bn=Bn>>8,tn[Kt]=Bn,Kt+8}st.prototype.writeBigUInt64LE=rn(function(qt,Kt=0){return Vt(this,qt,Kt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeBigUInt64BE=rn(function(qt,Kt=0){return nn(this,qt,Kt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeIntLE=function(qt,Kt,wn,Rn){if(qt=+qt,Kt=Kt>>>0,!Rn){const Wn=Math.pow(2,8*wn-1);Pt(this,qt,Kt,wn,Wn-1,-Wn)}let jn=0,Bn=1,Xn=0;for(this[Kt]=qt&255;++jn>0)-Xn&255;return Kt+wn},st.prototype.writeIntBE=function(qt,Kt,wn,Rn){if(qt=+qt,Kt=Kt>>>0,!Rn){const Wn=Math.pow(2,8*wn-1);Pt(this,qt,Kt,wn,Wn-1,-Wn)}let jn=wn-1,Bn=1,Xn=0;for(this[Kt+jn]=qt&255;--jn>=0&&(Bn*=256);)qt<0&&Xn===0&&this[Kt+jn+1]!==0&&(Xn=1),this[Kt+jn]=(qt/Bn>>0)-Xn&255;return Kt+wn},st.prototype.writeInt8=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,1,127,-128),qt<0&&(qt=255+qt+1),this[Kt]=qt&255,Kt+1},st.prototype.writeInt16LE=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,2,32767,-32768),this[Kt]=qt&255,this[Kt+1]=qt>>>8,Kt+2},st.prototype.writeInt16BE=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,2,32767,-32768),this[Kt]=qt>>>8,this[Kt+1]=qt&255,Kt+2},st.prototype.writeInt32LE=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,4,2147483647,-2147483648),this[Kt]=qt&255,this[Kt+1]=qt>>>8,this[Kt+2]=qt>>>16,this[Kt+3]=qt>>>24,Kt+4},st.prototype.writeInt32BE=function(qt,Kt,wn){return qt=+qt,Kt=Kt>>>0,wn||Pt(this,qt,Kt,4,2147483647,-2147483648),qt<0&&(qt=4294967295+qt+1),this[Kt]=qt>>>24,this[Kt+1]=qt>>>16,this[Kt+2]=qt>>>8,this[Kt+3]=qt&255,Kt+4},st.prototype.writeBigInt64LE=rn(function(qt,Kt=0){return Vt(this,qt,Kt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),st.prototype.writeBigInt64BE=rn(function(qt,Kt=0){return nn(this,qt,Kt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function cn(tn,qt,Kt,wn,Rn,jn){if(Kt+wn>tn.length)throw new RangeError("Index out of range");if(Kt<0)throw new RangeError("Index out of range")}function Xt(tn,qt,Kt,wn,Rn){return qt=+qt,Kt=Kt>>>0,Rn||cn(tn,qt,Kt,4),nt.write(tn,qt,Kt,wn,23,4),Kt+4}st.prototype.writeFloatLE=function(qt,Kt,wn){return Xt(this,qt,Kt,!0,wn)},st.prototype.writeFloatBE=function(qt,Kt,wn){return Xt(this,qt,Kt,!1,wn)};function un(tn,qt,Kt,wn,Rn){return qt=+qt,Kt=Kt>>>0,Rn||cn(tn,qt,Kt,8),nt.write(tn,qt,Kt,wn,52,8),Kt+8}st.prototype.writeDoubleLE=function(qt,Kt,wn){return un(this,qt,Kt,!0,wn)},st.prototype.writeDoubleBE=function(qt,Kt,wn){return un(this,qt,Kt,!1,wn)},st.prototype.copy=function(qt,Kt,wn,Rn){if(!st.isBuffer(qt))throw new TypeError("argument should be a Buffer");if(wn||(wn=0),!Rn&&Rn!==0&&(Rn=this.length),Kt>=qt.length&&(Kt=qt.length),Kt||(Kt=0),Rn>0&&Rn=this.length)throw new RangeError("Index out of range");if(Rn<0)throw new RangeError("sourceEnd out of bounds");Rn>this.length&&(Rn=this.length),qt.length-Kt>>0,wn=wn===void 0?this.length:wn>>>0,qt||(qt=0);let jn;if(typeof qt=="number")for(jn=Kt;jn2**32?Rn=xn(String(Kt)):typeof Kt=="bigint"&&(Rn=String(Kt),(Kt>BigInt(2)**BigInt(32)||Kt<-(BigInt(2)**BigInt(32)))&&(Rn=xn(Rn)),Rn+="n"),wn+=` It must be ${qt}. Received ${Rn}`,wn},RangeError);function xn(tn){let qt="",Kt=tn.length;const wn=tn[0]==="-"?1:0;for(;Kt>=wn+4;Kt-=3)qt=`_${tn.slice(Kt-3,Kt)}${qt}`;return`${tn.slice(0,Kt)}${qt}`}function an(tn,qt,Kt){En(qt,"offset"),(tn[qt]===void 0||tn[qt+Kt]===void 0)&&In(qt,tn.length-(Kt+1))}function Zt(tn,qt,Kt,wn,Rn,jn){if(tn>Kt||tn3?qt===0||qt===BigInt(0)?Xn=`>= 0${Bn} and < 2${Bn} ** ${(jn+1)*8}${Bn}`:Xn=`>= -(2${Bn} ** ${(jn+1)*8-1}${Bn}) and < 2 ** ${(jn+1)*8-1}${Bn}`:Xn=`>= ${qt}${Bn} and <= ${Kt}${Bn}`,new en.ERR_OUT_OF_RANGE("value",Xn,tn)}an(wn,Rn,jn)}function En(tn,qt){if(typeof tn!="number")throw new en.ERR_INVALID_ARG_TYPE(qt,"number",tn)}function In(tn,qt,Kt){throw Math.floor(tn)!==tn?(En(tn,Kt),new en.ERR_OUT_OF_RANGE(Kt||"offset","an integer",tn)):qt<0?new en.ERR_BUFFER_OUT_OF_BOUNDS:new en.ERR_OUT_OF_RANGE(Kt||"offset",`>= ${Kt?1:0} and <= ${qt}`,tn)}const Cn=/[^+/0-9A-Za-z-_]/g;function Nn(tn){if(tn=tn.split("=")[0],tn=tn.trim().replace(Cn,""),tn.length<2)return"";for(;tn.length%4!==0;)tn=tn+"=";return tn}function Un(tn,qt){qt=qt||1/0;let Kt;const wn=tn.length;let Rn=null;const jn=[];for(let Bn=0;Bn55295&&Kt<57344){if(!Rn){if(Kt>56319){(qt-=3)>-1&&jn.push(239,191,189);continue}else if(Bn+1===wn){(qt-=3)>-1&&jn.push(239,191,189);continue}Rn=Kt;continue}if(Kt<56320){(qt-=3)>-1&&jn.push(239,191,189),Rn=Kt;continue}Kt=(Rn-55296<<10|Kt-56320)+65536}else Rn&&(qt-=3)>-1&&jn.push(239,191,189);if(Rn=null,Kt<128){if((qt-=1)<0)break;jn.push(Kt)}else if(Kt<2048){if((qt-=2)<0)break;jn.push(Kt>>6|192,Kt&63|128)}else if(Kt<65536){if((qt-=3)<0)break;jn.push(Kt>>12|224,Kt>>6&63|128,Kt&63|128)}else if(Kt<1114112){if((qt-=4)<0)break;jn.push(Kt>>18|240,Kt>>12&63|128,Kt>>6&63|128,Kt&63|128)}else throw new Error("Invalid code point")}return jn}function _n(tn){const qt=[];for(let Kt=0;Kt>8,Rn=Kt%256,jn.push(Rn),jn.push(wn);return jn}function gn(tn){return et.toByteArray(Nn(tn))}function Tn(tn,qt,Kt,wn){let Rn;for(Rn=0;Rn=qt.length||Rn>=tn.length);++Rn)qt[Rn+Kt]=tn[Rn];return Rn}function yn(tn,qt){return tn instanceof qt||tn!=null&&tn.constructor!=null&&tn.constructor.name!=null&&tn.constructor.name===qt.name}function dn(tn){return tn!==tn}const sn=function(){const tn="0123456789abcdef",qt=new Array(256);for(let Kt=0;Kt<16;++Kt){const wn=Kt*16;for(let Rn=0;Rn<16;++Rn)qt[wn+Rn]=tn[Kt]+tn[Rn]}return qt}();function rn(tn){return typeof BigInt>"u"?Sn:tn}function Sn(){throw new Error("BigInt not supported")}})(buffer$2);var browser$d={exports:{}},process$1=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(tt){if(cachedSetTimeout===setTimeout)return setTimeout(tt,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(tt,0);try{return cachedSetTimeout(tt,0)}catch{try{return cachedSetTimeout.call(null,tt,0)}catch{return cachedSetTimeout.call(this,tt,0)}}}function runClearTimeout(tt){if(cachedClearTimeout===clearTimeout)return clearTimeout(tt);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(tt);try{return cachedClearTimeout(tt)}catch{try{return cachedClearTimeout.call(null,tt)}catch{return cachedClearTimeout.call(this,tt)}}}var queue$2=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue$2=currentQueue.concat(queue$2):queueIndex=-1,queue$2.length&&drainQueue())}function drainQueue(){if(!draining){var tt=runTimeout(cleanUpNextTick);draining=!0;for(var et=queue$2.length;et;){for(currentQueue=queue$2,queue$2=[];++queueIndex1)for(var nt=1;ntet in tt?ix(tt,et,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(tt){function et(jt,Ot){var Ct=jt.length;jt.push(Ot);e:for(;0>>1,Mt=jt[Dt];if(0>>1;Dtrt(rn,Ct))Xtrt(an,rn)?(jt[Dt]=an,jt[Xt]=Ct,Dt=Xt):(jt[Dt]=rn,jt[Qt]=Ct,Dt=Qt);else if(Xtrt(an,Ct))jt[Dt]=an,jt[Xt]=Ct,Dt=Xt;else break e}}return Ot}function rt(jt,Ot){var Ct=jt.sortIndex-Ot.sortIndex;return Ct!==0?Ct:jt.id-Ot.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ot=performance;tt.unstable_now=function(){return ot.now()}}else{var at=Date,st=at.now();tt.unstable_now=function(){return at.now()-st}}var lt=[],ct=[],ut=1,ht=null,dt=3,pt=!1,mt=!1,gt=!1,bt=typeof setTimeout=="function"?setTimeout:null,yt=typeof clearTimeout=="function"?clearTimeout:null,wt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vt(jt){for(var Ot=nt(ct);Ot!==null;){if(Ot.callback===null)it(ct);else if(Ot.startTime<=jt)it(ct),Ot.sortIndex=Ot.expirationTime,et(lt,Ot);else break;Ot=nt(ct)}}function xt(jt){if(gt=!1,vt(jt),!mt)if(nt(lt)!==null)mt=!0,Rt(St);else{var Ot=nt(ct);Ot!==null&&Wt(xt,Ot.startTime-jt)}}function St(jt,Ot){mt=!1,gt&&(gt=!1,yt(Tt),Tt=-1),pt=!0;var Ct=dt;try{for(vt(Ot),ht=nt(lt);ht!==null&&(!(ht.expirationTime>Ot)||jt&&!Lt());){var Dt=ht.callback;if(typeof Dt=="function"){ht.callback=null,dt=ht.priorityLevel;var Mt=Dt(ht.expirationTime<=Ot);Ot=tt.unstable_now(),typeof Mt=="function"?ht.callback=Mt:ht===nt(lt)&&it(lt),vt(Ot)}else it(lt);ht=nt(lt)}if(ht!==null)var Vt=!0;else{var Qt=nt(ct);Qt!==null&&Wt(xt,Qt.startTime-Ot),Vt=!1}return Vt}finally{ht=null,dt=Ct,pt=!1}}var Et=!1,It=null,Tt=-1,$t=5,Ut=-1;function Lt(){return!(tt.unstable_now()-Ut<$t)}function Bt(){if(It!==null){var jt=tt.unstable_now();Ut=jt;var Ot=!0;try{Ot=It(!0,jt)}finally{Ot?Pt():(Et=!1,It=null)}}else Et=!1}var Pt;if(typeof wt=="function")Pt=function(){wt(Bt)};else if(typeof MessageChannel<"u"){var kt=new MessageChannel,At=kt.port2;kt.port1.onmessage=Bt,Pt=function(){At.postMessage(null)}}else Pt=function(){bt(Bt,0)};function Rt(jt){It=jt,Et||(Et=!0,Pt())}function Wt(jt,Ot){Tt=bt(function(){jt(tt.unstable_now())},Ot)}tt.unstable_IdlePriority=5,tt.unstable_ImmediatePriority=1,tt.unstable_LowPriority=4,tt.unstable_NormalPriority=3,tt.unstable_Profiling=null,tt.unstable_UserBlockingPriority=2,tt.unstable_cancelCallback=function(jt){jt.callback=null},tt.unstable_continueExecution=function(){mt||pt||(mt=!0,Rt(St))},tt.unstable_forceFrameRate=function(jt){0>jt||125Dt?(jt.sortIndex=Ct,et(ct,jt),nt(lt)===null&&jt===nt(ct)&&(gt?(yt(Tt),Tt=-1):gt=!0,Wt(xt,Ct-Dt))):(jt.sortIndex=Mt,et(lt,jt),mt||pt||(mt=!0,Rt(St))),jt},tt.unstable_shouldYield=Lt,tt.unstable_wrapCallback=function(jt){var Ot=dt;return function(){var Ct=dt;dt=Ot;try{return jt.apply(this,arguments)}finally{dt=Ct}}}})(scheduler_production_min$1);scheduler$1.exports=scheduler_production_min$1;var schedulerExports$1=scheduler$1.exports;/** + */(function(tt){function et(Nt,Bt){var Mt=Nt.length;Nt.push(Bt);e:for(;0>>1,Pt=Nt[Dt];if(0>>1;Dtrt(cn,Mt))Xtrt(un,cn)?(Nt[Dt]=un,Nt[Xt]=Mt,Dt=Xt):(Nt[Dt]=cn,Nt[nn]=Mt,Dt=nn);else if(Xtrt(un,Mt))Nt[Dt]=un,Nt[Xt]=Mt,Dt=Xt;else break e}}return Bt}function rt(Nt,Bt){var Mt=Nt.sortIndex-Bt.sortIndex;return Mt!==0?Mt:Nt.id-Bt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ot=performance;tt.unstable_now=function(){return ot.now()}}else{var at=Date,st=at.now();tt.unstable_now=function(){return at.now()-st}}var lt=[],ct=[],ut=1,ht=null,dt=3,pt=!1,mt=!1,gt=!1,bt=typeof setTimeout=="function"?setTimeout:null,yt=typeof clearTimeout=="function"?clearTimeout:null,wt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vt(Nt){for(var Bt=nt(ct);Bt!==null;){if(Bt.callback===null)it(ct);else if(Bt.startTime<=Nt)it(ct),Bt.sortIndex=Bt.expirationTime,et(lt,Bt);else break;Bt=nt(ct)}}function xt(Nt){if(gt=!1,vt(Nt),!mt)if(nt(lt)!==null)mt=!0,Ct(St);else{var Bt=nt(ct);Bt!==null&&Ut(xt,Bt.startTime-Nt)}}function St(Nt,Bt){mt=!1,gt&&(gt=!1,yt(It),It=-1),pt=!0;var Mt=dt;try{for(vt(Bt),ht=nt(lt);ht!==null&&(!(ht.expirationTime>Bt)||Nt&&!zt());){var Dt=ht.callback;if(typeof Dt=="function"){ht.callback=null,dt=ht.priorityLevel;var Pt=Dt(ht.expirationTime<=Bt);Bt=tt.unstable_now(),typeof Pt=="function"?ht.callback=Pt:ht===nt(lt)&&it(lt),vt(Bt)}else it(lt);ht=nt(lt)}if(ht!==null)var Vt=!0;else{var nn=nt(ct);nn!==null&&Ut(xt,nn.startTime-Bt),Vt=!1}return Vt}finally{ht=null,dt=Mt,pt=!1}}var Et=!1,$t=null,It=-1,Ft=5,Ht=-1;function zt(){return!(tt.unstable_now()-HtNt||125Dt?(Nt.sortIndex=Mt,et(ct,Nt),nt(lt)===null&&Nt===nt(ct)&&(gt?(yt(It),It=-1):gt=!0,Ut(xt,Mt-Dt))):(Nt.sortIndex=Pt,et(lt,Nt),mt||pt||(mt=!0,Ct(St))),Nt},tt.unstable_shouldYield=zt,tt.unstable_wrapCallback=function(Nt){var Bt=dt;return function(){var Mt=dt;dt=Bt;try{return Nt.apply(this,arguments)}finally{dt=Mt}}}})(scheduler_production_min$1);scheduler$1.exports=scheduler_production_min$1;var schedulerExports$1=scheduler$1.exports;/** * @license React * react-dom.production.min.js * @@ -39,13 +39,13 @@ var ix=Object.defineProperty;var rx=(tt,et,nt)=>et in tt?ix(tt,et,{enumerable:!0 `+La+tt}var Na=!1;function Oa(tt,et){if(!tt||Na)return"";Na=!0;var nt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(et)if(et=function(){throw Error()},Object.defineProperty(et.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(et,[])}catch(ct){var it=ct}Reflect.construct(tt,[],et)}else{try{et.call()}catch(ct){it=ct}tt.call(et.prototype)}else{try{throw Error()}catch(ct){it=ct}tt()}}catch(ct){if(ct&&it&&typeof ct.stack=="string"){for(var rt=ct.stack.split(` `),ot=it.stack.split(` `),at=rt.length-1,st=ot.length-1;1<=at&&0<=st&&rt[at]!==ot[st];)st--;for(;1<=at&&0<=st;at--,st--)if(rt[at]!==ot[st]){if(at!==1||st!==1)do if(at--,st--,0>st||rt[at]!==ot[st]){var lt=` -`+rt[at].replace(" at new "," at ");return tt.displayName&<.includes("")&&(lt=lt.replace("",tt.displayName)),lt}while(1<=at&&0<=st);break}}}finally{Na=!1,Error.prepareStackTrace=nt}return(tt=tt?tt.displayName||tt.name:"")?Ma(tt):""}function Pa(tt){switch(tt.tag){case 5:return Ma(tt.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return tt=Oa(tt.type,!1),tt;case 11:return tt=Oa(tt.type.render,!1),tt;case 1:return tt=Oa(tt.type,!0),tt;default:return""}}function Qa(tt){if(tt==null)return null;if(typeof tt=="function")return tt.displayName||tt.name||null;if(typeof tt=="string")return tt;switch(tt){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof tt=="object")switch(tt.$$typeof){case Ca:return(tt.displayName||"Context")+".Consumer";case Ba:return(tt._context.displayName||"Context")+".Provider";case Da:var et=tt.render;return tt=tt.displayName,tt||(tt=et.displayName||et.name||"",tt=tt!==""?"ForwardRef("+tt+")":"ForwardRef"),tt;case Ga:return et=tt.displayName||null,et!==null?et:Qa(tt.type)||"Memo";case Ha:et=tt._payload,tt=tt._init;try{return Qa(tt(et))}catch{}}return null}function Ra(tt){var et=tt.type;switch(tt.tag){case 24:return"Cache";case 9:return(et.displayName||"Context")+".Consumer";case 10:return(et._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return tt=et.render,tt=tt.displayName||tt.name||"",et.displayName||(tt!==""?"ForwardRef("+tt+")":"ForwardRef");case 7:return"Fragment";case 5:return et;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(et);case 8:return et===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof et=="function")return et.displayName||et.name||null;if(typeof et=="string")return et}return null}function Sa(tt){switch(typeof tt){case"boolean":case"number":case"string":case"undefined":return tt;case"object":return tt;default:return""}}function Ta(tt){var et=tt.type;return(tt=tt.nodeName)&&tt.toLowerCase()==="input"&&(et==="checkbox"||et==="radio")}function Ua(tt){var et=Ta(tt)?"checked":"value",nt=Object.getOwnPropertyDescriptor(tt.constructor.prototype,et),it=""+tt[et];if(!tt.hasOwnProperty(et)&&typeof nt<"u"&&typeof nt.get=="function"&&typeof nt.set=="function"){var rt=nt.get,ot=nt.set;return Object.defineProperty(tt,et,{configurable:!0,get:function(){return rt.call(this)},set:function(at){it=""+at,ot.call(this,at)}}),Object.defineProperty(tt,et,{enumerable:nt.enumerable}),{getValue:function(){return it},setValue:function(at){it=""+at},stopTracking:function(){tt._valueTracker=null,delete tt[et]}}}}function Va(tt){tt._valueTracker||(tt._valueTracker=Ua(tt))}function Wa(tt){if(!tt)return!1;var et=tt._valueTracker;if(!et)return!0;var nt=et.getValue(),it="";return tt&&(it=Ta(tt)?tt.checked?"true":"false":tt.value),tt=it,tt!==nt?(et.setValue(tt),!0):!1}function Xa(tt){if(tt=tt||(typeof document<"u"?document:void 0),typeof tt>"u")return null;try{return tt.activeElement||tt.body}catch{return tt.body}}function Ya(tt,et){var nt=et.checked;return A$3({},et,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:nt??tt._wrapperState.initialChecked})}function Za(tt,et){var nt=et.defaultValue==null?"":et.defaultValue,it=et.checked!=null?et.checked:et.defaultChecked;nt=Sa(et.value!=null?et.value:nt),tt._wrapperState={initialChecked:it,initialValue:nt,controlled:et.type==="checkbox"||et.type==="radio"?et.checked!=null:et.value!=null}}function ab(tt,et){et=et.checked,et!=null&&ta(tt,"checked",et,!1)}function bb(tt,et){ab(tt,et);var nt=Sa(et.value),it=et.type;if(nt!=null)it==="number"?(nt===0&&tt.value===""||tt.value!=nt)&&(tt.value=""+nt):tt.value!==""+nt&&(tt.value=""+nt);else if(it==="submit"||it==="reset"){tt.removeAttribute("value");return}et.hasOwnProperty("value")?cb(tt,et.type,nt):et.hasOwnProperty("defaultValue")&&cb(tt,et.type,Sa(et.defaultValue)),et.checked==null&&et.defaultChecked!=null&&(tt.defaultChecked=!!et.defaultChecked)}function db(tt,et,nt){if(et.hasOwnProperty("value")||et.hasOwnProperty("defaultValue")){var it=et.type;if(!(it!=="submit"&&it!=="reset"||et.value!==void 0&&et.value!==null))return;et=""+tt._wrapperState.initialValue,nt||et===tt.value||(tt.value=et),tt.defaultValue=et}nt=tt.name,nt!==""&&(tt.name=""),tt.defaultChecked=!!tt._wrapperState.initialChecked,nt!==""&&(tt.name=nt)}function cb(tt,et,nt){(et!=="number"||Xa(tt.ownerDocument)!==tt)&&(nt==null?tt.defaultValue=""+tt._wrapperState.initialValue:tt.defaultValue!==""+nt&&(tt.defaultValue=""+nt))}var eb=Array.isArray;function fb(tt,et,nt,it){if(tt=tt.options,et){et={};for(var rt=0;rt"+et.valueOf().toString()+"",et=mb.firstChild;tt.firstChild;)tt.removeChild(tt.firstChild);for(;et.firstChild;)tt.appendChild(et.firstChild)}});function ob(tt,et){if(et){var nt=tt.firstChild;if(nt&&nt===tt.lastChild&&nt.nodeType===3){nt.nodeValue=et;return}}tt.textContent=et}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(tt){qb.forEach(function(et){et=et+tt.charAt(0).toUpperCase()+tt.substring(1),pb[et]=pb[tt]})});function rb(tt,et,nt){return et==null||typeof et=="boolean"||et===""?"":nt||typeof et!="number"||et===0||pb.hasOwnProperty(tt)&&pb[tt]?(""+et).trim():et+"px"}function sb(tt,et){tt=tt.style;for(var nt in et)if(et.hasOwnProperty(nt)){var it=nt.indexOf("--")===0,rt=rb(nt,et[nt],it);nt==="float"&&(nt="cssFloat"),it?tt.setProperty(nt,rt):tt[nt]=rt}}var tb=A$3({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(tt,et){if(et){if(tb[tt]&&(et.children!=null||et.dangerouslySetInnerHTML!=null))throw Error(p$9(137,tt));if(et.dangerouslySetInnerHTML!=null){if(et.children!=null)throw Error(p$9(60));if(typeof et.dangerouslySetInnerHTML!="object"||!("__html"in et.dangerouslySetInnerHTML))throw Error(p$9(61))}if(et.style!=null&&typeof et.style!="object")throw Error(p$9(62))}}function vb(tt,et){if(tt.indexOf("-")===-1)return typeof et.is=="string";switch(tt){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(tt){return tt=tt.target||tt.srcElement||window,tt.correspondingUseElement&&(tt=tt.correspondingUseElement),tt.nodeType===3?tt.parentNode:tt}var yb=null,zb=null,Ab=null;function Bb(tt){if(tt=Cb(tt)){if(typeof yb!="function")throw Error(p$9(280));var et=tt.stateNode;et&&(et=Db(et),yb(tt.stateNode,tt.type,et))}}function Eb(tt){zb?Ab?Ab.push(tt):Ab=[tt]:zb=tt}function Fb(){if(zb){var tt=zb,et=Ab;if(Ab=zb=null,Bb(tt),et)for(tt=0;tt>>=0,tt===0?32:31-(pc(tt)/qc|0)|0}var rc=64,sc=4194304;function tc(tt){switch(tt&-tt){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 tt&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return tt&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return tt}}function uc(tt,et){var nt=tt.pendingLanes;if(nt===0)return 0;var it=0,rt=tt.suspendedLanes,ot=tt.pingedLanes,at=nt&268435455;if(at!==0){var st=at&~rt;st!==0?it=tc(st):(ot&=at,ot!==0&&(it=tc(ot)))}else at=nt&~rt,at!==0?it=tc(at):ot!==0&&(it=tc(ot));if(it===0)return 0;if(et!==0&&et!==it&&!(et&rt)&&(rt=it&-it,ot=et&-et,rt>=ot||rt===16&&(ot&4194240)!==0))return et;if(it&4&&(it|=nt&16),et=tt.entangledLanes,et!==0)for(tt=tt.entanglements,et&=it;0nt;nt++)et.push(tt);return et}function Ac(tt,et,nt){tt.pendingLanes|=et,et!==536870912&&(tt.suspendedLanes=0,tt.pingedLanes=0),tt=tt.eventTimes,et=31-oc(et),tt[et]=nt}function Bc(tt,et){var nt=tt.pendingLanes&~et;tt.pendingLanes=et,tt.suspendedLanes=0,tt.pingedLanes=0,tt.expiredLanes&=et,tt.mutableReadLanes&=et,tt.entangledLanes&=et,et=tt.entanglements;var it=tt.eventTimes;for(tt=tt.expirationTimes;0=be$1),ee$2=String.fromCharCode(32),fe$1=!1;function ge$1(tt,et){switch(tt){case"keyup":return $d.indexOf(et.keyCode)!==-1;case"keydown":return et.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he$1(tt){return tt=tt.detail,typeof tt=="object"&&"data"in tt?tt.data:null}var ie$1=!1;function je$1(tt,et){switch(tt){case"compositionend":return he$1(et);case"keypress":return et.which!==32?null:(fe$1=!0,ee$2);case"textInput":return tt=et.data,tt===ee$2&&fe$1?null:tt;default:return null}}function ke$1(tt,et){if(ie$1)return tt==="compositionend"||!ae$1&&ge$1(tt,et)?(tt=nd(),md=ld=kd=null,ie$1=!1,tt):null;switch(tt){case"paste":return null;case"keypress":if(!(et.ctrlKey||et.altKey||et.metaKey)||et.ctrlKey&&et.altKey){if(et.char&&1=et)return{node:nt,offset:et-tt};tt=it}e:{for(;nt;){if(nt.nextSibling){nt=nt.nextSibling;break e}nt=nt.parentNode}nt=void 0}nt=Je(nt)}}function Le$1(tt,et){return tt&&et?tt===et?!0:tt&&tt.nodeType===3?!1:et&&et.nodeType===3?Le$1(tt,et.parentNode):"contains"in tt?tt.contains(et):tt.compareDocumentPosition?!!(tt.compareDocumentPosition(et)&16):!1:!1}function Me$2(){for(var tt=window,et=Xa();et instanceof tt.HTMLIFrameElement;){try{var nt=typeof et.contentWindow.location.href=="string"}catch{nt=!1}if(nt)tt=et.contentWindow;else break;et=Xa(tt.document)}return et}function Ne$2(tt){var et=tt&&tt.nodeName&&tt.nodeName.toLowerCase();return et&&(et==="input"&&(tt.type==="text"||tt.type==="search"||tt.type==="tel"||tt.type==="url"||tt.type==="password")||et==="textarea"||tt.contentEditable==="true")}function Oe$1(tt){var et=Me$2(),nt=tt.focusedElem,it=tt.selectionRange;if(et!==nt&&nt&&nt.ownerDocument&&Le$1(nt.ownerDocument.documentElement,nt)){if(it!==null&&Ne$2(nt)){if(et=it.start,tt=it.end,tt===void 0&&(tt=et),"selectionStart"in nt)nt.selectionStart=et,nt.selectionEnd=Math.min(tt,nt.value.length);else if(tt=(et=nt.ownerDocument||document)&&et.defaultView||window,tt.getSelection){tt=tt.getSelection();var rt=nt.textContent.length,ot=Math.min(it.start,rt);it=it.end===void 0?ot:Math.min(it.end,rt),!tt.extend&&ot>it&&(rt=it,it=ot,ot=rt),rt=Ke(nt,ot);var at=Ke(nt,it);rt&&at&&(tt.rangeCount!==1||tt.anchorNode!==rt.node||tt.anchorOffset!==rt.offset||tt.focusNode!==at.node||tt.focusOffset!==at.offset)&&(et=et.createRange(),et.setStart(rt.node,rt.offset),tt.removeAllRanges(),ot>it?(tt.addRange(et),tt.extend(at.node,at.offset)):(et.setEnd(at.node,at.offset),tt.addRange(et)))}}for(et=[],tt=nt;tt=tt.parentNode;)tt.nodeType===1&&et.push({element:tt,left:tt.scrollLeft,top:tt.scrollTop});for(typeof nt.focus=="function"&&nt.focus(),nt=0;nt=document.documentMode,Qe=null,Re$1=null,Se$1=null,Te$1=!1;function Ue(tt,et,nt){var it=nt.window===nt?nt.document:nt.nodeType===9?nt:nt.ownerDocument;Te$1||Qe==null||Qe!==Xa(it)||(it=Qe,"selectionStart"in it&&Ne$2(it)?it={start:it.selectionStart,end:it.selectionEnd}:(it=(it.ownerDocument&&it.ownerDocument.defaultView||window).getSelection(),it={anchorNode:it.anchorNode,anchorOffset:it.anchorOffset,focusNode:it.focusNode,focusOffset:it.focusOffset}),Se$1&&Ie(Se$1,it)||(Se$1=it,it=oe$1(Re$1,"onSelect"),0Tf||(tt.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G$3(tt,et){Tf++,Sf[Tf]=tt.current,tt.current=et}var Vf={},H$3=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(tt,et){var nt=tt.type.contextTypes;if(!nt)return Vf;var it=tt.stateNode;if(it&&it.__reactInternalMemoizedUnmaskedChildContext===et)return it.__reactInternalMemoizedMaskedChildContext;var rt={},ot;for(ot in nt)rt[ot]=et[ot];return it&&(tt=tt.stateNode,tt.__reactInternalMemoizedUnmaskedChildContext=et,tt.__reactInternalMemoizedMaskedChildContext=rt),rt}function Zf(tt){return tt=tt.childContextTypes,tt!=null}function $f(){E$2(Wf),E$2(H$3)}function ag(tt,et,nt){if(H$3.current!==Vf)throw Error(p$9(168));G$3(H$3,et),G$3(Wf,nt)}function bg(tt,et,nt){var it=tt.stateNode;if(et=et.childContextTypes,typeof it.getChildContext!="function")return nt;it=it.getChildContext();for(var rt in it)if(!(rt in et))throw Error(p$9(108,Ra(tt)||"Unknown",rt));return A$3({},nt,it)}function cg(tt){return tt=(tt=tt.stateNode)&&tt.__reactInternalMemoizedMergedChildContext||Vf,Xf=H$3.current,G$3(H$3,tt),G$3(Wf,Wf.current),!0}function dg(tt,et,nt){var it=tt.stateNode;if(!it)throw Error(p$9(169));nt?(tt=bg(tt,et,Xf),it.__reactInternalMemoizedMergedChildContext=tt,E$2(Wf),E$2(H$3),G$3(H$3,tt)):E$2(Wf),G$3(Wf,nt)}var eg=null,fg=!1,gg=!1;function hg(tt){eg===null?eg=[tt]:eg.push(tt)}function ig(tt){fg=!0,hg(tt)}function jg(){if(!gg&&eg!==null){gg=!0;var tt=0,et=C$2;try{var nt=eg;for(C$2=1;tt>=at,rt-=at,rg=1<<32-oc(et)+rt|nt<Tt?($t=It,It=null):$t=It.sibling;var Ut=dt(yt,It,vt[Tt],xt);if(Ut===null){It===null&&(It=$t);break}tt&&It&&Ut.alternate===null&&et(yt,It),wt=ot(Ut,wt,Tt),Et===null?St=Ut:Et.sibling=Ut,Et=Ut,It=$t}if(Tt===vt.length)return nt(yt,It),I$4&&tg(yt,Tt),St;if(It===null){for(;TtTt?($t=It,It=null):$t=It.sibling;var Lt=dt(yt,It,Ut.value,xt);if(Lt===null){It===null&&(It=$t);break}tt&&It&&Lt.alternate===null&&et(yt,It),wt=ot(Lt,wt,Tt),Et===null?St=Lt:Et.sibling=Lt,Et=Lt,It=$t}if(Ut.done)return nt(yt,It),I$4&&tg(yt,Tt),St;if(It===null){for(;!Ut.done;Tt++,Ut=vt.next())Ut=ht(yt,Ut.value,xt),Ut!==null&&(wt=ot(Ut,wt,Tt),Et===null?St=Ut:Et.sibling=Ut,Et=Ut);return I$4&&tg(yt,Tt),St}for(It=it(yt,It);!Ut.done;Tt++,Ut=vt.next())Ut=pt(It,yt,Tt,Ut.value,xt),Ut!==null&&(tt&&Ut.alternate!==null&&It.delete(Ut.key===null?Tt:Ut.key),wt=ot(Ut,wt,Tt),Et===null?St=Ut:Et.sibling=Ut,Et=Ut);return tt&&It.forEach(function(Bt){return et(yt,Bt)}),I$4&&tg(yt,Tt),St}function bt(yt,wt,vt,xt){if(typeof vt=="object"&&vt!==null&&vt.type===ya&&vt.key===null&&(vt=vt.props.children),typeof vt=="object"&&vt!==null){switch(vt.$$typeof){case va:e:{for(var St=vt.key,Et=wt;Et!==null;){if(Et.key===St){if(St=vt.type,St===ya){if(Et.tag===7){nt(yt,Et.sibling),wt=rt(Et,vt.props.children),wt.return=yt,yt=wt;break e}}else if(Et.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===Ha&&uh(St)===Et.type){nt(yt,Et.sibling),wt=rt(Et,vt.props),wt.ref=sh$1(yt,Et,vt),wt.return=yt,yt=wt;break e}nt(yt,Et);break}else et(yt,Et);Et=Et.sibling}vt.type===ya?(wt=Ah(vt.props.children,yt.mode,xt,vt.key),wt.return=yt,yt=wt):(xt=yh(vt.type,vt.key,vt.props,null,yt.mode,xt),xt.ref=sh$1(yt,wt,vt),xt.return=yt,yt=xt)}return at(yt);case wa:e:{for(Et=vt.key;wt!==null;){if(wt.key===Et)if(wt.tag===4&&wt.stateNode.containerInfo===vt.containerInfo&&wt.stateNode.implementation===vt.implementation){nt(yt,wt.sibling),wt=rt(wt,vt.children||[]),wt.return=yt,yt=wt;break e}else{nt(yt,wt);break}else et(yt,wt);wt=wt.sibling}wt=zh(vt,yt.mode,xt),wt.return=yt,yt=wt}return at(yt);case Ha:return Et=vt._init,bt(yt,wt,Et(vt._payload),xt)}if(eb(vt))return mt(yt,wt,vt,xt);if(Ka(vt))return gt(yt,wt,vt,xt);th(yt,vt)}return typeof vt=="string"&&vt!==""||typeof vt=="number"?(vt=""+vt,wt!==null&&wt.tag===6?(nt(yt,wt.sibling),wt=rt(wt,vt),wt.return=yt,yt=wt):(nt(yt,wt),wt=xh(vt,yt.mode,xt),wt.return=yt,yt=wt),at(yt)):nt(yt,wt)}return bt}var Bh=vh(!0),Ch$1=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(tt){if(tt===Dh)throw Error(p$9(174));return tt}function Ih(tt,et){switch(G$3(Gh,et),G$3(Fh,tt),G$3(Eh,Dh),tt=et.nodeType,tt){case 9:case 11:et=(et=et.documentElement)?et.namespaceURI:lb(null,"");break;default:tt=tt===8?et.parentNode:et,et=tt.namespaceURI||null,tt=tt.tagName,et=lb(et,tt)}E$2(Eh),G$3(Eh,et)}function Jh(){E$2(Eh),E$2(Fh),E$2(Gh)}function Kh$1(tt){Hh(Gh.current);var et=Hh(Eh.current),nt=lb(et,tt.type);et!==nt&&(G$3(Fh,tt),G$3(Eh,nt))}function Lh(tt){Fh.current===tt&&(E$2(Eh),E$2(Fh))}var M$3=Uf(0);function Mh(tt){for(var et=tt;et!==null;){if(et.tag===13){var nt=et.memoizedState;if(nt!==null&&(nt=nt.dehydrated,nt===null||nt.data==="$?"||nt.data==="$!"))return et}else if(et.tag===19&&et.memoizedProps.revealOrder!==void 0){if(et.flags&128)return et}else if(et.child!==null){et.child.return=et,et=et.child;continue}if(et===tt)break;for(;et.sibling===null;){if(et.return===null||et.return===tt)return null;et=et.return}et.sibling.return=et.return,et=et.sibling}return null}var Nh=[];function Oh(){for(var tt=0;ttnt?nt:4,tt(!0);var it=Qh.transition;Qh.transition={};try{tt(!1),et()}finally{C$2=nt,Qh.transition=it}}function Fi(){return di().memoizedState}function Gi(tt,et,nt){var it=lh(tt);if(nt={lane:it,action:nt,hasEagerState:!1,eagerState:null,next:null},Hi(tt))Ii(et,nt);else if(nt=Yg(tt,et,nt,it),nt!==null){var rt=L$3();mh(nt,tt,it,rt),Ji(nt,et,it)}}function ri(tt,et,nt){var it=lh(tt),rt={lane:it,action:nt,hasEagerState:!1,eagerState:null,next:null};if(Hi(tt))Ii(et,rt);else{var ot=tt.alternate;if(tt.lanes===0&&(ot===null||ot.lanes===0)&&(ot=et.lastRenderedReducer,ot!==null))try{var at=et.lastRenderedState,st=ot(at,nt);if(rt.hasEagerState=!0,rt.eagerState=st,He$1(st,at)){var lt=et.interleaved;lt===null?(rt.next=rt,Xg(et)):(rt.next=lt.next,lt.next=rt),et.interleaved=rt;return}}catch{}finally{}nt=Yg(tt,et,rt,it),nt!==null&&(rt=L$3(),mh(nt,tt,it,rt),Ji(nt,et,it))}}function Hi(tt){var et=tt.alternate;return tt===N$3||et!==null&&et===N$3}function Ii(tt,et){Th=Sh=!0;var nt=tt.pending;nt===null?et.next=et:(et.next=nt.next,nt.next=et),tt.pending=et}function Ji(tt,et,nt){if(nt&4194240){var it=et.lanes;it&=tt.pendingLanes,nt|=it,et.lanes=nt,Cc(tt,nt)}}var ai={readContext:Vg,useCallback:Q$2,useContext:Q$2,useEffect:Q$2,useImperativeHandle:Q$2,useInsertionEffect:Q$2,useLayoutEffect:Q$2,useMemo:Q$2,useReducer:Q$2,useRef:Q$2,useState:Q$2,useDebugValue:Q$2,useDeferredValue:Q$2,useTransition:Q$2,useMutableSource:Q$2,useSyncExternalStore:Q$2,useId:Q$2,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(tt,et){return ci().memoizedState=[tt,et===void 0?null:et],tt},useContext:Vg,useEffect:vi,useImperativeHandle:function(tt,et,nt){return nt=nt!=null?nt.concat([tt]):null,ti(4194308,4,yi.bind(null,et,tt),nt)},useLayoutEffect:function(tt,et){return ti(4194308,4,tt,et)},useInsertionEffect:function(tt,et){return ti(4,2,tt,et)},useMemo:function(tt,et){var nt=ci();return et=et===void 0?null:et,tt=tt(),nt.memoizedState=[tt,et],tt},useReducer:function(tt,et,nt){var it=ci();return et=nt!==void 0?nt(et):et,it.memoizedState=it.baseState=et,tt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tt,lastRenderedState:et},it.queue=tt,tt=tt.dispatch=Gi.bind(null,N$3,tt),[it.memoizedState,tt]},useRef:function(tt){var et=ci();return tt={current:tt},et.memoizedState=tt},useState:qi,useDebugValue:Ai,useDeferredValue:function(tt){return ci().memoizedState=tt},useTransition:function(){var tt=qi(!1),et=tt[0];return tt=Ei.bind(null,tt[1]),ci().memoizedState=tt,[et,tt]},useMutableSource:function(){},useSyncExternalStore:function(tt,et,nt){var it=N$3,rt=ci();if(I$4){if(nt===void 0)throw Error(p$9(407));nt=nt()}else{if(nt=et(),R$2===null)throw Error(p$9(349));Rh&30||ni(it,et,nt)}rt.memoizedState=nt;var ot={value:nt,getSnapshot:et};return rt.queue=ot,vi(ki.bind(null,it,ot,tt),[tt]),it.flags|=2048,li(9,mi.bind(null,it,ot,nt,et),void 0,null),nt},useId:function(){var tt=ci(),et=R$2.identifierPrefix;if(I$4){var nt=sg,it=rg;nt=(it&~(1<<32-oc(it)-1)).toString(32)+nt,et=":"+et+"R"+nt,nt=Uh++,0")&&(lt=lt.replace("",tt.displayName)),lt}while(1<=at&&0<=st);break}}}finally{Na=!1,Error.prepareStackTrace=nt}return(tt=tt?tt.displayName||tt.name:"")?Ma(tt):""}function Pa(tt){switch(tt.tag){case 5:return Ma(tt.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return tt=Oa(tt.type,!1),tt;case 11:return tt=Oa(tt.type.render,!1),tt;case 1:return tt=Oa(tt.type,!0),tt;default:return""}}function Qa(tt){if(tt==null)return null;if(typeof tt=="function")return tt.displayName||tt.name||null;if(typeof tt=="string")return tt;switch(tt){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof tt=="object")switch(tt.$$typeof){case Ca:return(tt.displayName||"Context")+".Consumer";case Ba:return(tt._context.displayName||"Context")+".Provider";case Da:var et=tt.render;return tt=tt.displayName,tt||(tt=et.displayName||et.name||"",tt=tt!==""?"ForwardRef("+tt+")":"ForwardRef"),tt;case Ga:return et=tt.displayName||null,et!==null?et:Qa(tt.type)||"Memo";case Ha:et=tt._payload,tt=tt._init;try{return Qa(tt(et))}catch{}}return null}function Ra(tt){var et=tt.type;switch(tt.tag){case 24:return"Cache";case 9:return(et.displayName||"Context")+".Consumer";case 10:return(et._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return tt=et.render,tt=tt.displayName||tt.name||"",et.displayName||(tt!==""?"ForwardRef("+tt+")":"ForwardRef");case 7:return"Fragment";case 5:return et;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(et);case 8:return et===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof et=="function")return et.displayName||et.name||null;if(typeof et=="string")return et}return null}function Sa(tt){switch(typeof tt){case"boolean":case"number":case"string":case"undefined":return tt;case"object":return tt;default:return""}}function Ta(tt){var et=tt.type;return(tt=tt.nodeName)&&tt.toLowerCase()==="input"&&(et==="checkbox"||et==="radio")}function Ua(tt){var et=Ta(tt)?"checked":"value",nt=Object.getOwnPropertyDescriptor(tt.constructor.prototype,et),it=""+tt[et];if(!tt.hasOwnProperty(et)&&typeof nt<"u"&&typeof nt.get=="function"&&typeof nt.set=="function"){var rt=nt.get,ot=nt.set;return Object.defineProperty(tt,et,{configurable:!0,get:function(){return rt.call(this)},set:function(at){it=""+at,ot.call(this,at)}}),Object.defineProperty(tt,et,{enumerable:nt.enumerable}),{getValue:function(){return it},setValue:function(at){it=""+at},stopTracking:function(){tt._valueTracker=null,delete tt[et]}}}}function Va(tt){tt._valueTracker||(tt._valueTracker=Ua(tt))}function Wa(tt){if(!tt)return!1;var et=tt._valueTracker;if(!et)return!0;var nt=et.getValue(),it="";return tt&&(it=Ta(tt)?tt.checked?"true":"false":tt.value),tt=it,tt!==nt?(et.setValue(tt),!0):!1}function Xa(tt){if(tt=tt||(typeof document<"u"?document:void 0),typeof tt>"u")return null;try{return tt.activeElement||tt.body}catch{return tt.body}}function Ya(tt,et){var nt=et.checked;return A$3({},et,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:nt??tt._wrapperState.initialChecked})}function Za(tt,et){var nt=et.defaultValue==null?"":et.defaultValue,it=et.checked!=null?et.checked:et.defaultChecked;nt=Sa(et.value!=null?et.value:nt),tt._wrapperState={initialChecked:it,initialValue:nt,controlled:et.type==="checkbox"||et.type==="radio"?et.checked!=null:et.value!=null}}function ab(tt,et){et=et.checked,et!=null&&ta(tt,"checked",et,!1)}function bb(tt,et){ab(tt,et);var nt=Sa(et.value),it=et.type;if(nt!=null)it==="number"?(nt===0&&tt.value===""||tt.value!=nt)&&(tt.value=""+nt):tt.value!==""+nt&&(tt.value=""+nt);else if(it==="submit"||it==="reset"){tt.removeAttribute("value");return}et.hasOwnProperty("value")?cb(tt,et.type,nt):et.hasOwnProperty("defaultValue")&&cb(tt,et.type,Sa(et.defaultValue)),et.checked==null&&et.defaultChecked!=null&&(tt.defaultChecked=!!et.defaultChecked)}function db(tt,et,nt){if(et.hasOwnProperty("value")||et.hasOwnProperty("defaultValue")){var it=et.type;if(!(it!=="submit"&&it!=="reset"||et.value!==void 0&&et.value!==null))return;et=""+tt._wrapperState.initialValue,nt||et===tt.value||(tt.value=et),tt.defaultValue=et}nt=tt.name,nt!==""&&(tt.name=""),tt.defaultChecked=!!tt._wrapperState.initialChecked,nt!==""&&(tt.name=nt)}function cb(tt,et,nt){(et!=="number"||Xa(tt.ownerDocument)!==tt)&&(nt==null?tt.defaultValue=""+tt._wrapperState.initialValue:tt.defaultValue!==""+nt&&(tt.defaultValue=""+nt))}var eb=Array.isArray;function fb(tt,et,nt,it){if(tt=tt.options,et){et={};for(var rt=0;rt"+et.valueOf().toString()+"",et=mb.firstChild;tt.firstChild;)tt.removeChild(tt.firstChild);for(;et.firstChild;)tt.appendChild(et.firstChild)}});function ob(tt,et){if(et){var nt=tt.firstChild;if(nt&&nt===tt.lastChild&&nt.nodeType===3){nt.nodeValue=et;return}}tt.textContent=et}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(tt){qb.forEach(function(et){et=et+tt.charAt(0).toUpperCase()+tt.substring(1),pb[et]=pb[tt]})});function rb(tt,et,nt){return et==null||typeof et=="boolean"||et===""?"":nt||typeof et!="number"||et===0||pb.hasOwnProperty(tt)&&pb[tt]?(""+et).trim():et+"px"}function sb(tt,et){tt=tt.style;for(var nt in et)if(et.hasOwnProperty(nt)){var it=nt.indexOf("--")===0,rt=rb(nt,et[nt],it);nt==="float"&&(nt="cssFloat"),it?tt.setProperty(nt,rt):tt[nt]=rt}}var tb=A$3({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(tt,et){if(et){if(tb[tt]&&(et.children!=null||et.dangerouslySetInnerHTML!=null))throw Error(p$9(137,tt));if(et.dangerouslySetInnerHTML!=null){if(et.children!=null)throw Error(p$9(60));if(typeof et.dangerouslySetInnerHTML!="object"||!("__html"in et.dangerouslySetInnerHTML))throw Error(p$9(61))}if(et.style!=null&&typeof et.style!="object")throw Error(p$9(62))}}function vb(tt,et){if(tt.indexOf("-")===-1)return typeof et.is=="string";switch(tt){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(tt){return tt=tt.target||tt.srcElement||window,tt.correspondingUseElement&&(tt=tt.correspondingUseElement),tt.nodeType===3?tt.parentNode:tt}var yb=null,zb=null,Ab=null;function Bb(tt){if(tt=Cb(tt)){if(typeof yb!="function")throw Error(p$9(280));var et=tt.stateNode;et&&(et=Db(et),yb(tt.stateNode,tt.type,et))}}function Eb(tt){zb?Ab?Ab.push(tt):Ab=[tt]:zb=tt}function Fb(){if(zb){var tt=zb,et=Ab;if(Ab=zb=null,Bb(tt),et)for(tt=0;tt>>=0,tt===0?32:31-(pc(tt)/qc|0)|0}var rc=64,sc=4194304;function tc(tt){switch(tt&-tt){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 tt&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return tt&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return tt}}function uc(tt,et){var nt=tt.pendingLanes;if(nt===0)return 0;var it=0,rt=tt.suspendedLanes,ot=tt.pingedLanes,at=nt&268435455;if(at!==0){var st=at&~rt;st!==0?it=tc(st):(ot&=at,ot!==0&&(it=tc(ot)))}else at=nt&~rt,at!==0?it=tc(at):ot!==0&&(it=tc(ot));if(it===0)return 0;if(et!==0&&et!==it&&!(et&rt)&&(rt=it&-it,ot=et&-et,rt>=ot||rt===16&&(ot&4194240)!==0))return et;if(it&4&&(it|=nt&16),et=tt.entangledLanes,et!==0)for(tt=tt.entanglements,et&=it;0nt;nt++)et.push(tt);return et}function Ac(tt,et,nt){tt.pendingLanes|=et,et!==536870912&&(tt.suspendedLanes=0,tt.pingedLanes=0),tt=tt.eventTimes,et=31-oc(et),tt[et]=nt}function Bc(tt,et){var nt=tt.pendingLanes&~et;tt.pendingLanes=et,tt.suspendedLanes=0,tt.pingedLanes=0,tt.expiredLanes&=et,tt.mutableReadLanes&=et,tt.entangledLanes&=et,et=tt.entanglements;var it=tt.eventTimes;for(tt=tt.expirationTimes;0=be$1),ee$2=String.fromCharCode(32),fe$1=!1;function ge$1(tt,et){switch(tt){case"keyup":return $d.indexOf(et.keyCode)!==-1;case"keydown":return et.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he$1(tt){return tt=tt.detail,typeof tt=="object"&&"data"in tt?tt.data:null}var ie$1=!1;function je$1(tt,et){switch(tt){case"compositionend":return he$1(et);case"keypress":return et.which!==32?null:(fe$1=!0,ee$2);case"textInput":return tt=et.data,tt===ee$2&&fe$1?null:tt;default:return null}}function ke$1(tt,et){if(ie$1)return tt==="compositionend"||!ae$1&&ge$1(tt,et)?(tt=nd(),md=ld=kd=null,ie$1=!1,tt):null;switch(tt){case"paste":return null;case"keypress":if(!(et.ctrlKey||et.altKey||et.metaKey)||et.ctrlKey&&et.altKey){if(et.char&&1=et)return{node:nt,offset:et-tt};tt=it}e:{for(;nt;){if(nt.nextSibling){nt=nt.nextSibling;break e}nt=nt.parentNode}nt=void 0}nt=Je(nt)}}function Le$1(tt,et){return tt&&et?tt===et?!0:tt&&tt.nodeType===3?!1:et&&et.nodeType===3?Le$1(tt,et.parentNode):"contains"in tt?tt.contains(et):tt.compareDocumentPosition?!!(tt.compareDocumentPosition(et)&16):!1:!1}function Me$2(){for(var tt=window,et=Xa();et instanceof tt.HTMLIFrameElement;){try{var nt=typeof et.contentWindow.location.href=="string"}catch{nt=!1}if(nt)tt=et.contentWindow;else break;et=Xa(tt.document)}return et}function Ne$2(tt){var et=tt&&tt.nodeName&&tt.nodeName.toLowerCase();return et&&(et==="input"&&(tt.type==="text"||tt.type==="search"||tt.type==="tel"||tt.type==="url"||tt.type==="password")||et==="textarea"||tt.contentEditable==="true")}function Oe$1(tt){var et=Me$2(),nt=tt.focusedElem,it=tt.selectionRange;if(et!==nt&&nt&&nt.ownerDocument&&Le$1(nt.ownerDocument.documentElement,nt)){if(it!==null&&Ne$2(nt)){if(et=it.start,tt=it.end,tt===void 0&&(tt=et),"selectionStart"in nt)nt.selectionStart=et,nt.selectionEnd=Math.min(tt,nt.value.length);else if(tt=(et=nt.ownerDocument||document)&&et.defaultView||window,tt.getSelection){tt=tt.getSelection();var rt=nt.textContent.length,ot=Math.min(it.start,rt);it=it.end===void 0?ot:Math.min(it.end,rt),!tt.extend&&ot>it&&(rt=it,it=ot,ot=rt),rt=Ke(nt,ot);var at=Ke(nt,it);rt&&at&&(tt.rangeCount!==1||tt.anchorNode!==rt.node||tt.anchorOffset!==rt.offset||tt.focusNode!==at.node||tt.focusOffset!==at.offset)&&(et=et.createRange(),et.setStart(rt.node,rt.offset),tt.removeAllRanges(),ot>it?(tt.addRange(et),tt.extend(at.node,at.offset)):(et.setEnd(at.node,at.offset),tt.addRange(et)))}}for(et=[],tt=nt;tt=tt.parentNode;)tt.nodeType===1&&et.push({element:tt,left:tt.scrollLeft,top:tt.scrollTop});for(typeof nt.focus=="function"&&nt.focus(),nt=0;nt=document.documentMode,Qe=null,Re$1=null,Se$1=null,Te$1=!1;function Ue(tt,et,nt){var it=nt.window===nt?nt.document:nt.nodeType===9?nt:nt.ownerDocument;Te$1||Qe==null||Qe!==Xa(it)||(it=Qe,"selectionStart"in it&&Ne$2(it)?it={start:it.selectionStart,end:it.selectionEnd}:(it=(it.ownerDocument&&it.ownerDocument.defaultView||window).getSelection(),it={anchorNode:it.anchorNode,anchorOffset:it.anchorOffset,focusNode:it.focusNode,focusOffset:it.focusOffset}),Se$1&&Ie(Se$1,it)||(Se$1=it,it=oe$1(Re$1,"onSelect"),0Tf||(tt.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G$3(tt,et){Tf++,Sf[Tf]=tt.current,tt.current=et}var Vf={},H$3=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(tt,et){var nt=tt.type.contextTypes;if(!nt)return Vf;var it=tt.stateNode;if(it&&it.__reactInternalMemoizedUnmaskedChildContext===et)return it.__reactInternalMemoizedMaskedChildContext;var rt={},ot;for(ot in nt)rt[ot]=et[ot];return it&&(tt=tt.stateNode,tt.__reactInternalMemoizedUnmaskedChildContext=et,tt.__reactInternalMemoizedMaskedChildContext=rt),rt}function Zf(tt){return tt=tt.childContextTypes,tt!=null}function $f(){E$2(Wf),E$2(H$3)}function ag(tt,et,nt){if(H$3.current!==Vf)throw Error(p$9(168));G$3(H$3,et),G$3(Wf,nt)}function bg(tt,et,nt){var it=tt.stateNode;if(et=et.childContextTypes,typeof it.getChildContext!="function")return nt;it=it.getChildContext();for(var rt in it)if(!(rt in et))throw Error(p$9(108,Ra(tt)||"Unknown",rt));return A$3({},nt,it)}function cg(tt){return tt=(tt=tt.stateNode)&&tt.__reactInternalMemoizedMergedChildContext||Vf,Xf=H$3.current,G$3(H$3,tt),G$3(Wf,Wf.current),!0}function dg(tt,et,nt){var it=tt.stateNode;if(!it)throw Error(p$9(169));nt?(tt=bg(tt,et,Xf),it.__reactInternalMemoizedMergedChildContext=tt,E$2(Wf),E$2(H$3),G$3(H$3,tt)):E$2(Wf),G$3(Wf,nt)}var eg=null,fg=!1,gg=!1;function hg(tt){eg===null?eg=[tt]:eg.push(tt)}function ig(tt){fg=!0,hg(tt)}function jg(){if(!gg&&eg!==null){gg=!0;var tt=0,et=C$2;try{var nt=eg;for(C$2=1;tt>=at,rt-=at,rg=1<<32-oc(et)+rt|nt<It?(Ft=$t,$t=null):Ft=$t.sibling;var Ht=dt(yt,$t,vt[It],xt);if(Ht===null){$t===null&&($t=Ft);break}tt&&$t&&Ht.alternate===null&&et(yt,$t),wt=ot(Ht,wt,It),Et===null?St=Ht:Et.sibling=Ht,Et=Ht,$t=Ft}if(It===vt.length)return nt(yt,$t),I$4&&tg(yt,It),St;if($t===null){for(;ItIt?(Ft=$t,$t=null):Ft=$t.sibling;var zt=dt(yt,$t,Ht.value,xt);if(zt===null){$t===null&&($t=Ft);break}tt&&$t&&zt.alternate===null&&et(yt,$t),wt=ot(zt,wt,It),Et===null?St=zt:Et.sibling=zt,Et=zt,$t=Ft}if(Ht.done)return nt(yt,$t),I$4&&tg(yt,It),St;if($t===null){for(;!Ht.done;It++,Ht=vt.next())Ht=ht(yt,Ht.value,xt),Ht!==null&&(wt=ot(Ht,wt,It),Et===null?St=Ht:Et.sibling=Ht,Et=Ht);return I$4&&tg(yt,It),St}for($t=it(yt,$t);!Ht.done;It++,Ht=vt.next())Ht=pt($t,yt,It,Ht.value,xt),Ht!==null&&(tt&&Ht.alternate!==null&&$t.delete(Ht.key===null?It:Ht.key),wt=ot(Ht,wt,It),Et===null?St=Ht:Et.sibling=Ht,Et=Ht);return tt&&$t.forEach(function(Ot){return et(yt,Ot)}),I$4&&tg(yt,It),St}function bt(yt,wt,vt,xt){if(typeof vt=="object"&&vt!==null&&vt.type===ya&&vt.key===null&&(vt=vt.props.children),typeof vt=="object"&&vt!==null){switch(vt.$$typeof){case va:e:{for(var St=vt.key,Et=wt;Et!==null;){if(Et.key===St){if(St=vt.type,St===ya){if(Et.tag===7){nt(yt,Et.sibling),wt=rt(Et,vt.props.children),wt.return=yt,yt=wt;break e}}else if(Et.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===Ha&&uh(St)===Et.type){nt(yt,Et.sibling),wt=rt(Et,vt.props),wt.ref=sh$1(yt,Et,vt),wt.return=yt,yt=wt;break e}nt(yt,Et);break}else et(yt,Et);Et=Et.sibling}vt.type===ya?(wt=Ah(vt.props.children,yt.mode,xt,vt.key),wt.return=yt,yt=wt):(xt=yh(vt.type,vt.key,vt.props,null,yt.mode,xt),xt.ref=sh$1(yt,wt,vt),xt.return=yt,yt=xt)}return at(yt);case wa:e:{for(Et=vt.key;wt!==null;){if(wt.key===Et)if(wt.tag===4&&wt.stateNode.containerInfo===vt.containerInfo&&wt.stateNode.implementation===vt.implementation){nt(yt,wt.sibling),wt=rt(wt,vt.children||[]),wt.return=yt,yt=wt;break e}else{nt(yt,wt);break}else et(yt,wt);wt=wt.sibling}wt=zh(vt,yt.mode,xt),wt.return=yt,yt=wt}return at(yt);case Ha:return Et=vt._init,bt(yt,wt,Et(vt._payload),xt)}if(eb(vt))return mt(yt,wt,vt,xt);if(Ka(vt))return gt(yt,wt,vt,xt);th(yt,vt)}return typeof vt=="string"&&vt!==""||typeof vt=="number"?(vt=""+vt,wt!==null&&wt.tag===6?(nt(yt,wt.sibling),wt=rt(wt,vt),wt.return=yt,yt=wt):(nt(yt,wt),wt=xh(vt,yt.mode,xt),wt.return=yt,yt=wt),at(yt)):nt(yt,wt)}return bt}var Bh=vh(!0),Ch$1=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(tt){if(tt===Dh)throw Error(p$9(174));return tt}function Ih(tt,et){switch(G$3(Gh,et),G$3(Fh,tt),G$3(Eh,Dh),tt=et.nodeType,tt){case 9:case 11:et=(et=et.documentElement)?et.namespaceURI:lb(null,"");break;default:tt=tt===8?et.parentNode:et,et=tt.namespaceURI||null,tt=tt.tagName,et=lb(et,tt)}E$2(Eh),G$3(Eh,et)}function Jh(){E$2(Eh),E$2(Fh),E$2(Gh)}function Kh$1(tt){Hh(Gh.current);var et=Hh(Eh.current),nt=lb(et,tt.type);et!==nt&&(G$3(Fh,tt),G$3(Eh,nt))}function Lh(tt){Fh.current===tt&&(E$2(Eh),E$2(Fh))}var M$3=Uf(0);function Mh(tt){for(var et=tt;et!==null;){if(et.tag===13){var nt=et.memoizedState;if(nt!==null&&(nt=nt.dehydrated,nt===null||nt.data==="$?"||nt.data==="$!"))return et}else if(et.tag===19&&et.memoizedProps.revealOrder!==void 0){if(et.flags&128)return et}else if(et.child!==null){et.child.return=et,et=et.child;continue}if(et===tt)break;for(;et.sibling===null;){if(et.return===null||et.return===tt)return null;et=et.return}et.sibling.return=et.return,et=et.sibling}return null}var Nh=[];function Oh(){for(var tt=0;ttnt?nt:4,tt(!0);var it=Qh.transition;Qh.transition={};try{tt(!1),et()}finally{C$2=nt,Qh.transition=it}}function Fi(){return di().memoizedState}function Gi(tt,et,nt){var it=lh(tt);if(nt={lane:it,action:nt,hasEagerState:!1,eagerState:null,next:null},Hi(tt))Ii(et,nt);else if(nt=Yg(tt,et,nt,it),nt!==null){var rt=L$3();mh(nt,tt,it,rt),Ji(nt,et,it)}}function ri(tt,et,nt){var it=lh(tt),rt={lane:it,action:nt,hasEagerState:!1,eagerState:null,next:null};if(Hi(tt))Ii(et,rt);else{var ot=tt.alternate;if(tt.lanes===0&&(ot===null||ot.lanes===0)&&(ot=et.lastRenderedReducer,ot!==null))try{var at=et.lastRenderedState,st=ot(at,nt);if(rt.hasEagerState=!0,rt.eagerState=st,He$1(st,at)){var lt=et.interleaved;lt===null?(rt.next=rt,Xg(et)):(rt.next=lt.next,lt.next=rt),et.interleaved=rt;return}}catch{}finally{}nt=Yg(tt,et,rt,it),nt!==null&&(rt=L$3(),mh(nt,tt,it,rt),Ji(nt,et,it))}}function Hi(tt){var et=tt.alternate;return tt===N$3||et!==null&&et===N$3}function Ii(tt,et){Th=Sh=!0;var nt=tt.pending;nt===null?et.next=et:(et.next=nt.next,nt.next=et),tt.pending=et}function Ji(tt,et,nt){if(nt&4194240){var it=et.lanes;it&=tt.pendingLanes,nt|=it,et.lanes=nt,Cc(tt,nt)}}var ai={readContext:Vg,useCallback:Q$2,useContext:Q$2,useEffect:Q$2,useImperativeHandle:Q$2,useInsertionEffect:Q$2,useLayoutEffect:Q$2,useMemo:Q$2,useReducer:Q$2,useRef:Q$2,useState:Q$2,useDebugValue:Q$2,useDeferredValue:Q$2,useTransition:Q$2,useMutableSource:Q$2,useSyncExternalStore:Q$2,useId:Q$2,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(tt,et){return ci().memoizedState=[tt,et===void 0?null:et],tt},useContext:Vg,useEffect:vi,useImperativeHandle:function(tt,et,nt){return nt=nt!=null?nt.concat([tt]):null,ti(4194308,4,yi.bind(null,et,tt),nt)},useLayoutEffect:function(tt,et){return ti(4194308,4,tt,et)},useInsertionEffect:function(tt,et){return ti(4,2,tt,et)},useMemo:function(tt,et){var nt=ci();return et=et===void 0?null:et,tt=tt(),nt.memoizedState=[tt,et],tt},useReducer:function(tt,et,nt){var it=ci();return et=nt!==void 0?nt(et):et,it.memoizedState=it.baseState=et,tt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:tt,lastRenderedState:et},it.queue=tt,tt=tt.dispatch=Gi.bind(null,N$3,tt),[it.memoizedState,tt]},useRef:function(tt){var et=ci();return tt={current:tt},et.memoizedState=tt},useState:qi,useDebugValue:Ai,useDeferredValue:function(tt){return ci().memoizedState=tt},useTransition:function(){var tt=qi(!1),et=tt[0];return tt=Ei.bind(null,tt[1]),ci().memoizedState=tt,[et,tt]},useMutableSource:function(){},useSyncExternalStore:function(tt,et,nt){var it=N$3,rt=ci();if(I$4){if(nt===void 0)throw Error(p$9(407));nt=nt()}else{if(nt=et(),R$2===null)throw Error(p$9(349));Rh&30||ni(it,et,nt)}rt.memoizedState=nt;var ot={value:nt,getSnapshot:et};return rt.queue=ot,vi(ki.bind(null,it,ot,tt),[tt]),it.flags|=2048,li(9,mi.bind(null,it,ot,nt,et),void 0,null),nt},useId:function(){var tt=ci(),et=R$2.identifierPrefix;if(I$4){var nt=sg,it=rg;nt=(it&~(1<<32-oc(it)-1)).toString(32)+nt,et=":"+et+"R"+nt,nt=Uh++,0<\/script>",tt=tt.removeChild(tt.firstChild)):typeof it.is=="string"?tt=at.createElement(nt,{is:it.is}):(tt=at.createElement(nt),nt==="select"&&(at=tt,it.multiple?at.multiple=!0:it.size&&(at.size=it.size))):tt=at.createElementNS(tt,nt),tt[Of]=et,tt[Pf]=it,Aj(tt,et,!1,!1),et.stateNode=tt;e:{switch(at=vb(nt,it),nt){case"dialog":D$2("cancel",tt),D$2("close",tt),rt=it;break;case"iframe":case"object":case"embed":D$2("load",tt),rt=it;break;case"video":case"audio":for(rt=0;rtHj&&(et.flags|=128,it=!0,Ej(ot,!1),et.lanes=4194304)}else{if(!it)if(tt=Mh(at),tt!==null){if(et.flags|=128,it=!0,nt=tt.updateQueue,nt!==null&&(et.updateQueue=nt,et.flags|=4),Ej(ot,!0),ot.tail===null&&ot.tailMode==="hidden"&&!at.alternate&&!I$4)return S$4(et),null}else 2*B$2()-ot.renderingStartTime>Hj&&nt!==1073741824&&(et.flags|=128,it=!0,Ej(ot,!1),et.lanes=4194304);ot.isBackwards?(at.sibling=et.child,et.child=at):(nt=ot.last,nt!==null?nt.sibling=at:et.child=at,ot.last=at)}return ot.tail!==null?(et=ot.tail,ot.rendering=et,ot.tail=et.sibling,ot.renderingStartTime=B$2(),et.sibling=null,nt=M$3.current,G$3(M$3,it?nt&1|2:nt&1),et):(S$4(et),null);case 22:case 23:return Ij(),it=et.memoizedState!==null,tt!==null&&tt.memoizedState!==null!==it&&(et.flags|=8192),it&&et.mode&1?gj&1073741824&&(S$4(et),et.subtreeFlags&6&&(et.flags|=8192)):S$4(et),null;case 24:return null;case 25:return null}throw Error(p$9(156,et.tag))}function Jj(tt,et){switch(wg(et),et.tag){case 1:return Zf(et.type)&&$f(),tt=et.flags,tt&65536?(et.flags=tt&-65537|128,et):null;case 3:return Jh(),E$2(Wf),E$2(H$3),Oh(),tt=et.flags,tt&65536&&!(tt&128)?(et.flags=tt&-65537|128,et):null;case 5:return Lh(et),null;case 13:if(E$2(M$3),tt=et.memoizedState,tt!==null&&tt.dehydrated!==null){if(et.alternate===null)throw Error(p$9(340));Ig()}return tt=et.flags,tt&65536?(et.flags=tt&-65537|128,et):null;case 19:return E$2(M$3),null;case 4:return Jh(),null;case 10:return Rg(et.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U$3=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V$4=null;function Mj(tt,et){var nt=tt.ref;if(nt!==null)if(typeof nt=="function")try{nt(null)}catch(it){W$8(tt,et,it)}else nt.current=null}function Nj(tt,et,nt){try{nt()}catch(it){W$8(tt,et,it)}}var Oj=!1;function Pj(tt,et){if(Cf=dd,tt=Me$2(),Ne$2(tt)){if("selectionStart"in tt)var nt={start:tt.selectionStart,end:tt.selectionEnd};else e:{nt=(nt=tt.ownerDocument)&&nt.defaultView||window;var it=nt.getSelection&&nt.getSelection();if(it&&it.rangeCount!==0){nt=it.anchorNode;var rt=it.anchorOffset,ot=it.focusNode;it=it.focusOffset;try{nt.nodeType,ot.nodeType}catch{nt=null;break e}var at=0,st=-1,lt=-1,ct=0,ut=0,ht=tt,dt=null;t:for(;;){for(var pt;ht!==nt||rt!==0&&ht.nodeType!==3||(st=at+rt),ht!==ot||it!==0&&ht.nodeType!==3||(lt=at+it),ht.nodeType===3&&(at+=ht.nodeValue.length),(pt=ht.firstChild)!==null;)dt=ht,ht=pt;for(;;){if(ht===tt)break t;if(dt===nt&&++ct===rt&&(st=at),dt===ot&&++ut===it&&(lt=at),(pt=ht.nextSibling)!==null)break;ht=dt,dt=ht.parentNode}ht=pt}nt=st===-1||lt===-1?null:{start:st,end:lt}}else nt=null}nt=nt||{start:0,end:0}}else nt=null;for(Df={focusedElem:tt,selectionRange:nt},dd=!1,V$4=et;V$4!==null;)if(et=V$4,tt=et.child,(et.subtreeFlags&1028)!==0&&tt!==null)tt.return=et,V$4=tt;else for(;V$4!==null;){et=V$4;try{var mt=et.alternate;if(et.flags&1024)switch(et.tag){case 0:case 11:case 15:break;case 1:if(mt!==null){var gt=mt.memoizedProps,bt=mt.memoizedState,yt=et.stateNode,wt=yt.getSnapshotBeforeUpdate(et.elementType===et.type?gt:Lg(et.type,gt),bt);yt.__reactInternalSnapshotBeforeUpdate=wt}break;case 3:var vt=et.stateNode.containerInfo;vt.nodeType===1?vt.textContent="":vt.nodeType===9&&vt.documentElement&&vt.removeChild(vt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$9(163))}}catch(xt){W$8(et,et.return,xt)}if(tt=et.sibling,tt!==null){tt.return=et.return,V$4=tt;break}V$4=et.return}return mt=Oj,Oj=!1,mt}function Qj(tt,et,nt){var it=et.updateQueue;if(it=it!==null?it.lastEffect:null,it!==null){var rt=it=it.next;do{if((rt.tag&tt)===tt){var ot=rt.destroy;rt.destroy=void 0,ot!==void 0&&Nj(et,nt,ot)}rt=rt.next}while(rt!==it)}}function Rj(tt,et){if(et=et.updateQueue,et=et!==null?et.lastEffect:null,et!==null){var nt=et=et.next;do{if((nt.tag&tt)===tt){var it=nt.create;nt.destroy=it()}nt=nt.next}while(nt!==et)}}function Sj(tt){var et=tt.ref;if(et!==null){var nt=tt.stateNode;switch(tt.tag){case 5:tt=nt;break;default:tt=nt}typeof et=="function"?et(tt):et.current=tt}}function Tj(tt){var et=tt.alternate;et!==null&&(tt.alternate=null,Tj(et)),tt.child=null,tt.deletions=null,tt.sibling=null,tt.tag===5&&(et=tt.stateNode,et!==null&&(delete et[Of],delete et[Pf],delete et[of],delete et[Qf],delete et[Rf])),tt.stateNode=null,tt.return=null,tt.dependencies=null,tt.memoizedProps=null,tt.memoizedState=null,tt.pendingProps=null,tt.stateNode=null,tt.updateQueue=null}function Uj(tt){return tt.tag===5||tt.tag===3||tt.tag===4}function Vj(tt){e:for(;;){for(;tt.sibling===null;){if(tt.return===null||Uj(tt.return))return null;tt=tt.return}for(tt.sibling.return=tt.return,tt=tt.sibling;tt.tag!==5&&tt.tag!==6&&tt.tag!==18;){if(tt.flags&2||tt.child===null||tt.tag===4)continue e;tt.child.return=tt,tt=tt.child}if(!(tt.flags&2))return tt.stateNode}}function Wj(tt,et,nt){var it=tt.tag;if(it===5||it===6)tt=tt.stateNode,et?nt.nodeType===8?nt.parentNode.insertBefore(tt,et):nt.insertBefore(tt,et):(nt.nodeType===8?(et=nt.parentNode,et.insertBefore(tt,nt)):(et=nt,et.appendChild(tt)),nt=nt._reactRootContainer,nt!=null||et.onclick!==null||(et.onclick=Bf));else if(it!==4&&(tt=tt.child,tt!==null))for(Wj(tt,et,nt),tt=tt.sibling;tt!==null;)Wj(tt,et,nt),tt=tt.sibling}function Xj(tt,et,nt){var it=tt.tag;if(it===5||it===6)tt=tt.stateNode,et?nt.insertBefore(tt,et):nt.appendChild(tt);else if(it!==4&&(tt=tt.child,tt!==null))for(Xj(tt,et,nt),tt=tt.sibling;tt!==null;)Xj(tt,et,nt),tt=tt.sibling}var X$2=null,Yj=!1;function Zj(tt,et,nt){for(nt=nt.child;nt!==null;)ak(tt,et,nt),nt=nt.sibling}function ak(tt,et,nt){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,nt)}catch{}switch(nt.tag){case 5:U$3||Mj(nt,et);case 6:var it=X$2,rt=Yj;X$2=null,Zj(tt,et,nt),X$2=it,Yj=rt,X$2!==null&&(Yj?(tt=X$2,nt=nt.stateNode,tt.nodeType===8?tt.parentNode.removeChild(nt):tt.removeChild(nt)):X$2.removeChild(nt.stateNode));break;case 18:X$2!==null&&(Yj?(tt=X$2,nt=nt.stateNode,tt.nodeType===8?Kf(tt.parentNode,nt):tt.nodeType===1&&Kf(tt,nt),bd(tt)):Kf(X$2,nt.stateNode));break;case 4:it=X$2,rt=Yj,X$2=nt.stateNode.containerInfo,Yj=!0,Zj(tt,et,nt),X$2=it,Yj=rt;break;case 0:case 11:case 14:case 15:if(!U$3&&(it=nt.updateQueue,it!==null&&(it=it.lastEffect,it!==null))){rt=it=it.next;do{var ot=rt,at=ot.destroy;ot=ot.tag,at!==void 0&&(ot&2||ot&4)&&Nj(nt,et,at),rt=rt.next}while(rt!==it)}Zj(tt,et,nt);break;case 1:if(!U$3&&(Mj(nt,et),it=nt.stateNode,typeof it.componentWillUnmount=="function"))try{it.props=nt.memoizedProps,it.state=nt.memoizedState,it.componentWillUnmount()}catch(st){W$8(nt,et,st)}Zj(tt,et,nt);break;case 21:Zj(tt,et,nt);break;case 22:nt.mode&1?(U$3=(it=U$3)||nt.memoizedState!==null,Zj(tt,et,nt),U$3=it):Zj(tt,et,nt);break;default:Zj(tt,et,nt)}}function bk(tt){var et=tt.updateQueue;if(et!==null){tt.updateQueue=null;var nt=tt.stateNode;nt===null&&(nt=tt.stateNode=new Lj),et.forEach(function(it){var rt=ck.bind(null,tt,it);nt.has(it)||(nt.add(it),it.then(rt,rt))})}}function dk(tt,et){var nt=et.deletions;if(nt!==null)for(var it=0;itrt&&(rt=at),it&=~ot}if(it=rt,it=B$2()-it,it=(120>it?120:480>it?480:1080>it?1080:1920>it?1920:3e3>it?3e3:4320>it?4320:1960*mk(it/1960))-it,10tt?16:tt,xk===null)var it=!1;else{if(tt=xk,xk=null,yk=0,K$7&6)throw Error(p$9(331));var rt=K$7;for(K$7|=4,V$4=tt.current;V$4!==null;){var ot=V$4,at=ot.child;if(V$4.flags&16){var st=ot.deletions;if(st!==null){for(var lt=0;ltB$2()-gk?Lk(tt,0):sk|=nt),Ek(tt,et)}function Zk(tt,et){et===0&&(tt.mode&1?(et=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):et=1);var nt=L$3();tt=Zg(tt,et),tt!==null&&(Ac(tt,et,nt),Ek(tt,nt))}function vj(tt){var et=tt.memoizedState,nt=0;et!==null&&(nt=et.retryLane),Zk(tt,nt)}function ck(tt,et){var nt=0;switch(tt.tag){case 13:var it=tt.stateNode,rt=tt.memoizedState;rt!==null&&(nt=rt.retryLane);break;case 19:it=tt.stateNode;break;default:throw Error(p$9(314))}it!==null&&it.delete(et),Zk(tt,nt)}var Wk;Wk=function(tt,et,nt){if(tt!==null)if(tt.memoizedProps!==et.pendingProps||Wf.current)Ug=!0;else{if(!(tt.lanes&nt)&&!(et.flags&128))return Ug=!1,zj(tt,et,nt);Ug=!!(tt.flags&131072)}else Ug=!1,I$4&&et.flags&1048576&&ug(et,ng,et.index);switch(et.lanes=0,et.tag){case 2:var it=et.type;jj(tt,et),tt=et.pendingProps;var rt=Yf(et,H$3.current);Tg(et,nt),rt=Xh(null,et,it,tt,rt,nt);var ot=bi();return et.flags|=1,typeof rt=="object"&&rt!==null&&typeof rt.render=="function"&&rt.$$typeof===void 0?(et.tag=1,et.memoizedState=null,et.updateQueue=null,Zf(it)?(ot=!0,cg(et)):ot=!1,et.memoizedState=rt.state!==null&&rt.state!==void 0?rt.state:null,ah(et),rt.updater=nh,et.stateNode=rt,rt._reactInternals=et,rh$1(et,it,tt,nt),et=kj(null,et,it,!0,ot,nt)):(et.tag=0,I$4&&ot&&vg(et),Yi(null,et,rt,nt),et=et.child),et;case 16:it=et.elementType;e:{switch(jj(tt,et),tt=et.pendingProps,rt=it._init,it=rt(it._payload),et.type=it,rt=et.tag=$k(it),tt=Lg(it,tt),rt){case 0:et=dj(null,et,it,tt,nt);break e;case 1:et=ij(null,et,it,tt,nt);break e;case 11:et=Zi(null,et,it,tt,nt);break e;case 14:et=aj(null,et,it,Lg(it.type,tt),nt);break e}throw Error(p$9(306,it,""))}return et;case 0:return it=et.type,rt=et.pendingProps,rt=et.elementType===it?rt:Lg(it,rt),dj(tt,et,it,rt,nt);case 1:return it=et.type,rt=et.pendingProps,rt=et.elementType===it?rt:Lg(it,rt),ij(tt,et,it,rt,nt);case 3:e:{if(lj(et),tt===null)throw Error(p$9(387));it=et.pendingProps,ot=et.memoizedState,rt=ot.element,bh(tt,et),gh(et,it,null,nt);var at=et.memoizedState;if(it=at.element,ot.isDehydrated)if(ot={element:it,isDehydrated:!1,cache:at.cache,pendingSuspenseBoundaries:at.pendingSuspenseBoundaries,transitions:at.transitions},et.updateQueue.baseState=ot,et.memoizedState=ot,et.flags&256){rt=Ki(Error(p$9(423)),et),et=mj(tt,et,it,nt,rt);break e}else if(it!==rt){rt=Ki(Error(p$9(424)),et),et=mj(tt,et,it,nt,rt);break e}else for(yg=Lf(et.stateNode.containerInfo.firstChild),xg=et,I$4=!0,zg=null,nt=Ch$1(et,null,it,nt),et.child=nt;nt;)nt.flags=nt.flags&-3|4096,nt=nt.sibling;else{if(Ig(),it===rt){et=$i(tt,et,nt);break e}Yi(tt,et,it,nt)}et=et.child}return et;case 5:return Kh$1(et),tt===null&&Eg(et),it=et.type,rt=et.pendingProps,ot=tt!==null?tt.memoizedProps:null,at=rt.children,Ef(it,rt)?at=null:ot!==null&&Ef(it,ot)&&(et.flags|=32),hj(tt,et),Yi(tt,et,at,nt),et.child;case 6:return tt===null&&Eg(et),null;case 13:return pj(tt,et,nt);case 4:return Ih(et,et.stateNode.containerInfo),it=et.pendingProps,tt===null?et.child=Bh(et,null,it,nt):Yi(tt,et,it,nt),et.child;case 11:return it=et.type,rt=et.pendingProps,rt=et.elementType===it?rt:Lg(it,rt),Zi(tt,et,it,rt,nt);case 7:return Yi(tt,et,et.pendingProps,nt),et.child;case 8:return Yi(tt,et,et.pendingProps.children,nt),et.child;case 12:return Yi(tt,et,et.pendingProps.children,nt),et.child;case 10:e:{if(it=et.type._context,rt=et.pendingProps,ot=et.memoizedProps,at=rt.value,G$3(Mg,it._currentValue),it._currentValue=at,ot!==null)if(He$1(ot.value,at)){if(ot.children===rt.children&&!Wf.current){et=$i(tt,et,nt);break e}}else for(ot=et.child,ot!==null&&(ot.return=et);ot!==null;){var st=ot.dependencies;if(st!==null){at=ot.child;for(var lt=st.firstContext;lt!==null;){if(lt.context===it){if(ot.tag===1){lt=ch$1(-1,nt&-nt),lt.tag=2;var ct=ot.updateQueue;if(ct!==null){ct=ct.shared;var ut=ct.pending;ut===null?lt.next=lt:(lt.next=ut.next,ut.next=lt),ct.pending=lt}}ot.lanes|=nt,lt=ot.alternate,lt!==null&&(lt.lanes|=nt),Sg(ot.return,nt,et),st.lanes|=nt;break}lt=lt.next}}else if(ot.tag===10)at=ot.type===et.type?null:ot.child;else if(ot.tag===18){if(at=ot.return,at===null)throw Error(p$9(341));at.lanes|=nt,st=at.alternate,st!==null&&(st.lanes|=nt),Sg(at,nt,et),at=ot.sibling}else at=ot.child;if(at!==null)at.return=ot;else for(at=ot;at!==null;){if(at===et){at=null;break}if(ot=at.sibling,ot!==null){ot.return=at.return,at=ot;break}at=at.return}ot=at}Yi(tt,et,rt.children,nt),et=et.child}return et;case 9:return rt=et.type,it=et.pendingProps.children,Tg(et,nt),rt=Vg(rt),it=it(rt),et.flags|=1,Yi(tt,et,it,nt),et.child;case 14:return it=et.type,rt=Lg(it,et.pendingProps),rt=Lg(it.type,rt),aj(tt,et,it,rt,nt);case 15:return cj(tt,et,et.type,et.pendingProps,nt);case 17:return it=et.type,rt=et.pendingProps,rt=et.elementType===it?rt:Lg(it,rt),jj(tt,et),et.tag=1,Zf(it)?(tt=!0,cg(et)):tt=!1,Tg(et,nt),ph(et,it,rt),rh$1(et,it,rt,nt),kj(null,et,it,!0,tt,nt);case 19:return yj(tt,et,nt);case 22:return ej(tt,et,nt)}throw Error(p$9(156,et.tag))};function Gk(tt,et){return ac(tt,et)}function al(tt,et,nt,it){this.tag=tt,this.key=nt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=et,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=it,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg$1(tt,et,nt,it){return new al(tt,et,nt,it)}function bj(tt){return tt=tt.prototype,!(!tt||!tt.isReactComponent)}function $k(tt){if(typeof tt=="function")return bj(tt)?1:0;if(tt!=null){if(tt=tt.$$typeof,tt===Da)return 11;if(tt===Ga)return 14}return 2}function wh(tt,et){var nt=tt.alternate;return nt===null?(nt=Bg$1(tt.tag,et,tt.key,tt.mode),nt.elementType=tt.elementType,nt.type=tt.type,nt.stateNode=tt.stateNode,nt.alternate=tt,tt.alternate=nt):(nt.pendingProps=et,nt.type=tt.type,nt.flags=0,nt.subtreeFlags=0,nt.deletions=null),nt.flags=tt.flags&14680064,nt.childLanes=tt.childLanes,nt.lanes=tt.lanes,nt.child=tt.child,nt.memoizedProps=tt.memoizedProps,nt.memoizedState=tt.memoizedState,nt.updateQueue=tt.updateQueue,et=tt.dependencies,nt.dependencies=et===null?null:{lanes:et.lanes,firstContext:et.firstContext},nt.sibling=tt.sibling,nt.index=tt.index,nt.ref=tt.ref,nt}function yh(tt,et,nt,it,rt,ot){var at=2;if(it=tt,typeof tt=="function")bj(tt)&&(at=1);else if(typeof tt=="string")at=5;else e:switch(tt){case ya:return Ah(nt.children,rt,ot,et);case za:at=8,rt|=8;break;case Aa:return tt=Bg$1(12,nt,et,rt|2),tt.elementType=Aa,tt.lanes=ot,tt;case Ea:return tt=Bg$1(13,nt,et,rt),tt.elementType=Ea,tt.lanes=ot,tt;case Fa:return tt=Bg$1(19,nt,et,rt),tt.elementType=Fa,tt.lanes=ot,tt;case Ia:return qj(nt,rt,ot,et);default:if(typeof tt=="object"&&tt!==null)switch(tt.$$typeof){case Ba:at=10;break e;case Ca:at=9;break e;case Da:at=11;break e;case Ga:at=14;break e;case Ha:at=16,it=null;break e}throw Error(p$9(130,tt==null?tt:typeof tt,""))}return et=Bg$1(at,nt,et,rt),et.elementType=tt,et.type=it,et.lanes=ot,et}function Ah(tt,et,nt,it){return tt=Bg$1(7,tt,it,et),tt.lanes=nt,tt}function qj(tt,et,nt,it){return tt=Bg$1(22,tt,it,et),tt.elementType=Ia,tt.lanes=nt,tt.stateNode={isHidden:!1},tt}function xh(tt,et,nt){return tt=Bg$1(6,tt,null,et),tt.lanes=nt,tt}function zh(tt,et,nt){return et=Bg$1(4,tt.children!==null?tt.children:[],tt.key,et),et.lanes=nt,et.stateNode={containerInfo:tt.containerInfo,pendingChildren:null,implementation:tt.implementation},et}function bl(tt,et,nt,it,rt){this.tag=et,this.containerInfo=tt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=it,this.onRecoverableError=rt,this.mutableSourceEagerHydrationData=null}function cl(tt,et,nt,it,rt,ot,at,st,lt){return tt=new bl(tt,et,nt,st,lt),et===1?(et=1,ot===!0&&(et|=8)):et=0,ot=Bg$1(3,null,null,et),tt.current=ot,ot.stateNode=tt,ot.memoizedState={element:it,isDehydrated:nt,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(ot),tt}function dl(tt,et,nt){var it=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(tt){console.error(tt)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var createRoot$1,m$9=reactDomExports;createRoot$1=client$1.createRoot=m$9.createRoot,client$1.hydrateRoot=m$9.hydrateRoot;function _extends$u(){return _extends$u=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.forEach(nt=>$6ed0406888f73fc4$var$setRef(nt,et))}function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...tt){return reactExports.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...tt),tt)}const $5e63c961fc1ce211$export$8c6ed5c666ac1360=reactExports.forwardRef((tt,et)=>{const{children:nt,...it}=tt,rt=reactExports.Children.toArray(nt),ot=rt.find($5e63c961fc1ce211$var$isSlottable);if(ot){const at=ot.props.children,st=rt.map(lt=>lt===ot?reactExports.Children.count(at)>1?reactExports.Children.only(null):reactExports.isValidElement(at)?at.props.children:null:lt);return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$u({},it,{ref:et}),reactExports.isValidElement(at)?reactExports.cloneElement(at,void 0,st):null)}return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$u({},it,{ref:et}),nt)});$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName="Slot";const $5e63c961fc1ce211$var$SlotClone=reactExports.forwardRef((tt,et)=>{const{children:nt,...it}=tt;return reactExports.isValidElement(nt)?reactExports.cloneElement(nt,{...$5e63c961fc1ce211$var$mergeProps(it,nt.props),ref:et?$6ed0406888f73fc4$export$43e446d32b3d21af(et,nt.ref):nt.ref}):reactExports.Children.count(nt)>1?reactExports.Children.only(null):null});$5e63c961fc1ce211$var$SlotClone.displayName="SlotClone";const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45=({children:tt})=>reactExports.createElement(reactExports.Fragment,null,tt);function $5e63c961fc1ce211$var$isSlottable(tt){return reactExports.isValidElement(tt)&&tt.type===$5e63c961fc1ce211$export$d9f1ccf0bdb05d45}function $5e63c961fc1ce211$var$mergeProps(tt,et){const nt={...et};for(const it in et){const rt=tt[it],ot=et[it];/^on[A-Z]/.test(it)?rt&&ot?nt[it]=(...st)=>{ot(...st),rt(...st)}:rt&&(nt[it]=rt):it==="style"?nt[it]={...rt,...ot}:it==="className"&&(nt[it]=[rt,ot].filter(Boolean).join(" "))}return{...tt,...nt}}const $8927f6f2acc4f386$var$NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$8927f6f2acc4f386$export$250ffa63cdc0d034=$8927f6f2acc4f386$var$NODES.reduce((tt,et)=>{const nt=reactExports.forwardRef((it,rt)=>{const{asChild:ot,...at}=it,st=ot?$5e63c961fc1ce211$export$8c6ed5c666ac1360:et;return reactExports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),reactExports.createElement(st,_extends$u({},at,{ref:rt}))});return nt.displayName=`Primitive.${et}`,{...tt,[et]:nt}},{});function $8927f6f2acc4f386$export$6d1a0317bde7de7f(tt,et){tt&&reactDomExports.flushSync(()=>tt.dispatchEvent(et))}const $f1701beae083dbae$export$602eac185826482c=reactExports.forwardRef((tt,et)=>{var nt;const{container:it=globalThis==null||(nt=globalThis.document)===null||nt===void 0?void 0:nt.body,...rt}=tt;return it?ReactDOM.createPortal(reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},rt,{ref:et})),it):null}),$f1701beae083dbae$export$be92b6f5f03c0fe9=$f1701beae083dbae$export$602eac185826482c;var has$7=Object.prototype.hasOwnProperty;function dequal(tt,et){var nt,it;if(tt===et)return!0;if(tt&&et&&(nt=tt.constructor)===et.constructor){if(nt===Date)return tt.getTime()===et.getTime();if(nt===RegExp)return tt.toString()===et.toString();if(nt===Array){if((it=tt.length)===et.length)for(;it--&&dequal(tt[it],et[it]););return it===-1}if(!nt||typeof tt=="object"){it=0;for(nt in tt)if(has$7.call(tt,nt)&&++it&&!has$7.call(et,nt)||!(nt in et)||!dequal(tt[nt],et[nt]))return!1;return Object.keys(et).length===it}}return tt!==tt&&et!==et}function shallow$2(tt,et){if(Object.is(tt,et))return!0;if(typeof tt!="object"||tt===null||typeof et!="object"||et===null)return!1;const nt=Object.keys(tt);if(nt.length!==Object.keys(et).length)return!1;for(let it=0;it0;)at[st]=arguments[st+4];tt.call(this,at),tt.captureStackTrace&&tt.captureStackTrace(this,et),this.rule=nt,this.value=it,this.cause=rt,this.target=ot}return tt&&(et.__proto__=tt),et.prototype=Object.create(tt&&tt.prototype),et.prototype.constructor=et,et}(Error),Context$2=function(et,nt){et===void 0&&(et=[]),nt===void 0&&(nt=[]),this.chain=et,this.nextRuleModifiers=nt};Context$2.prototype._applyRule=function(et,nt){var it=this;return function(){for(var rt=[],ot=arguments.length;ot--;)rt[ot]=arguments[ot];return it.chain.push(new Rule(nt,et.apply(it,rt),rt,it.nextRuleModifiers)),it.nextRuleModifiers=[],it}};Context$2.prototype._applyModifier=function(et,nt){return this.nextRuleModifiers.push(new Modifier(nt,et.simple,et.async)),this};Context$2.prototype._clone=function(){return new Context$2(this.chain.slice(),this.nextRuleModifiers.slice())};Context$2.prototype.test=function(et){return this.chain.every(function(nt){return nt._test(et)})};Context$2.prototype.testAll=function(et){var nt=[];return this.chain.forEach(function(it){try{it._check(et)}catch(rt){nt.push(new ValidationError(it,et,rt))}}),nt};Context$2.prototype.check=function(et){this.chain.forEach(function(nt){try{nt._check(et)}catch(it){throw new ValidationError(nt,et,it)}})};Context$2.prototype.testAsync=function(et){var nt=this;return new Promise(function(it,rt){executeAsyncRules(et,nt.chain.slice(),it,rt)})};function executeAsyncRules(tt,et,nt,it){if(et.length){var rt=et.shift();rt._testAsync(tt).then(function(){executeAsyncRules(tt,et,nt,it)},function(ot){it(new ValidationError(rt,tt,ot))})}else nt(tt)}var consideredEmpty=function(tt,et){return et&&typeof tt=="string"&&tt.trim().length===0?!0:tt==null};function optional(tt,et){return et===void 0&&(et=!1),{simple:function(nt){return consideredEmpty(nt,et)||tt.check(nt)===void 0},async:function(nt){return consideredEmpty(nt,et)||tt.testAsync(nt)}}}function v8n(){return typeof Proxy<"u"?proxyContext(new Context$2):proxylessContext(new Context$2)}var customRules={};v8n.extend=function(tt){Object.assign(customRules,tt)};v8n.clearCustomRules=function(){customRules={}};function proxyContext(tt){return new Proxy(tt,{get:function(nt,it){if(it in nt)return nt[it];var rt=proxyContext(tt._clone());if(it in availableModifiers)return rt._applyModifier(availableModifiers[it],it);if(it in customRules)return rt._applyRule(customRules[it],it);if(it in availableRules)return rt._applyRule(availableRules[it],it)}})}function proxylessContext(tt){var et=function(rt,ot){return Object.keys(rt).forEach(function(at){ot[at]=function(){for(var st=[],lt=arguments.length;lt--;)st[lt]=arguments[lt];var ct=proxylessContext(ot._clone()),ut=ct._applyRule(rt[at],at).apply(void 0,st);return ut}}),ot},nt=et(availableRules,tt),it=et(customRules,nt);return Object.keys(availableModifiers).forEach(function(rt){Object.defineProperty(it,rt,{get:function(){var ot=proxylessContext(it._clone());return ot._applyModifier(availableModifiers[rt],rt)}})}),it}var availableModifiers={not:{simple:function(tt){return function(et){return!tt(et)}},async:function(tt){return function(et){return Promise.resolve(tt(et)).then(function(nt){return!nt}).catch(function(){return!0})}}},some:{simple:function(tt){return function(et){return split$1(et).some(function(nt){try{return tt(nt)}catch{return!1}})}},async:function(tt){return function(et){return Promise.all(split$1(et).map(function(nt){try{return tt(nt).catch(function(){return!1})}catch{return!1}})).then(function(nt){return nt.some(Boolean)})}}},every:{simple:function(tt){return function(et){return et!==!1&&split$1(et).every(tt)}},async:function(tt){return function(et){return Promise.all(split$1(et).map(tt)).then(function(nt){return nt.every(Boolean)})}}},strict:{simple:function(tt,et){return function(nt){return isSchemaRule(et)&&nt&&typeof nt=="object"?Object.keys(et.args[0]).length===Object.keys(nt).length&&tt(nt):tt(nt)}},async:function(tt,et){return function(nt){return Promise.resolve(tt(nt)).then(function(it){return isSchemaRule(et)&&nt&&typeof nt=="object"?Object.keys(et.args[0]).length===Object.keys(nt).length&&it:it}).catch(function(){return!1})}}}};function isSchemaRule(tt){return tt&&tt.name==="schema"&&tt.args.length>0&&typeof tt.args[0]=="object"}function split$1(tt){return typeof tt=="string"?tt.split(""):tt}var availableRules={equal:function(tt){return function(et){return et==tt}},exact:function(tt){return function(et){return et===tt}},number:function(tt){return tt===void 0&&(tt=!0),function(et){return typeof et=="number"&&(tt||isFinite(et))}},integer:function(){return function(tt){var et=Number.isInteger||isIntegerPolyfill;return et(tt)}},numeric:function(){return function(tt){return!isNaN(parseFloat(tt))&&isFinite(tt)}},string:function(){return testType("string")},boolean:function(){return testType("boolean")},undefined:function(){return testType("undefined")},null:function(){return testType("null")},array:function(){return testType("array")},object:function(){return testType("object")},instanceOf:function(tt){return function(et){return et instanceof tt}},pattern:function(tt){return function(et){return tt.test(et)}},lowercase:function(){return function(tt){return typeof tt=="boolean"||tt===tt.toLowerCase()&&tt.trim()!==""}},uppercase:function(){return function(tt){return tt===tt.toUpperCase()&&tt.trim()!==""}},vowel:function(){return function(tt){return/^[aeiou]+$/i.test(tt)}},consonant:function(){return function(tt){return/^(?=[^aeiou])([a-z]+)$/i.test(tt)}},first:function(tt){return function(et){return et[0]==tt}},last:function(tt){return function(et){return et[et.length-1]==tt}},empty:function(){return function(tt){return tt.length===0}},length:function(tt,et){return function(nt){return nt.length>=tt&&nt.length<=(et||tt)}},minLength:function(tt){return function(et){return et.length>=tt}},maxLength:function(tt){return function(et){return et.length<=tt}},negative:function(){return function(tt){return tt<0}},positive:function(){return function(tt){return tt>=0}},between:function(tt,et){return function(nt){return nt>=tt&&nt<=et}},range:function(tt,et){return function(nt){return nt>=tt&&nt<=et}},lessThan:function(tt){return function(et){return ettt}},greaterThanOrEqual:function(tt){return function(et){return et>=tt}},even:function(){return function(tt){return tt%2===0}},odd:function(){return function(tt){return tt%2!==0}},includes:function(tt){return function(et){return~et.indexOf(tt)}},schema:function(tt){return testSchema(tt)},passesAnyOf:function(){for(var tt=[],et=arguments.length;et--;)tt[et]=arguments[et];return function(nt){return tt.some(function(it){return it.test(nt)})}},optional};function testType(tt){return function(et){return Array.isArray(et)&&tt==="array"||et===null&&tt==="null"||typeof et===tt}}function isIntegerPolyfill(tt){return typeof tt=="number"&&isFinite(tt)&&Math.floor(tt)===tt}function testSchema(tt){return{simple:function(et){var nt=[];if(Object.keys(tt).forEach(function(it){var rt=tt[it];try{rt.check((et||{})[it])}catch(ot){ot.target=it,nt.push(ot)}}),nt.length>0)throw nt;return!0},async:function(et){var nt=[],it=Object.keys(tt).map(function(rt){var ot=tt[rt];return ot.testAsync((et||{})[rt]).catch(function(at){at.target=rt,nt.push(at)})});return Promise.all(it).then(function(){if(nt.length>0)throw nt;return!0})}}}var e$6="colors",t$7="sizes",r$c="space",n$7={gap:r$c,gridGap:r$c,columnGap:r$c,gridColumnGap:r$c,rowGap:r$c,gridRowGap:r$c,inset:r$c,insetBlock:r$c,insetBlockEnd:r$c,insetBlockStart:r$c,insetInline:r$c,insetInlineEnd:r$c,insetInlineStart:r$c,margin:r$c,marginTop:r$c,marginRight:r$c,marginBottom:r$c,marginLeft:r$c,marginBlock:r$c,marginBlockEnd:r$c,marginBlockStart:r$c,marginInline:r$c,marginInlineEnd:r$c,marginInlineStart:r$c,padding:r$c,paddingTop:r$c,paddingRight:r$c,paddingBottom:r$c,paddingLeft:r$c,paddingBlock:r$c,paddingBlockEnd:r$c,paddingBlockStart:r$c,paddingInline:r$c,paddingInlineEnd:r$c,paddingInlineStart:r$c,top:r$c,right:r$c,bottom:r$c,left:r$c,scrollMargin:r$c,scrollMarginTop:r$c,scrollMarginRight:r$c,scrollMarginBottom:r$c,scrollMarginLeft:r$c,scrollMarginX:r$c,scrollMarginY:r$c,scrollMarginBlock:r$c,scrollMarginBlockEnd:r$c,scrollMarginBlockStart:r$c,scrollMarginInline:r$c,scrollMarginInlineEnd:r$c,scrollMarginInlineStart:r$c,scrollPadding:r$c,scrollPaddingTop:r$c,scrollPaddingRight:r$c,scrollPaddingBottom:r$c,scrollPaddingLeft:r$c,scrollPaddingX:r$c,scrollPaddingY:r$c,scrollPaddingBlock:r$c,scrollPaddingBlockEnd:r$c,scrollPaddingBlockStart:r$c,scrollPaddingInline:r$c,scrollPaddingInlineEnd:r$c,scrollPaddingInlineStart:r$c,fontSize:"fontSizes",background:e$6,backgroundColor:e$6,backgroundImage:e$6,borderImage:e$6,border:e$6,borderBlock:e$6,borderBlockEnd:e$6,borderBlockStart:e$6,borderBottom:e$6,borderBottomColor:e$6,borderColor:e$6,borderInline:e$6,borderInlineEnd:e$6,borderInlineStart:e$6,borderLeft:e$6,borderLeftColor:e$6,borderRight:e$6,borderRightColor:e$6,borderTop:e$6,borderTopColor:e$6,caretColor:e$6,color:e$6,columnRuleColor:e$6,fill:e$6,outline:e$6,outlineColor:e$6,stroke:e$6,textDecorationColor:e$6,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t$7,minBlockSize:t$7,maxBlockSize:t$7,inlineSize:t$7,minInlineSize:t$7,maxInlineSize:t$7,width:t$7,minWidth:t$7,maxWidth:t$7,height:t$7,minHeight:t$7,maxHeight:t$7,flexBasis:t$7,gridTemplateColumns:t$7,gridTemplateRows:t$7,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i$8=(tt,et)=>typeof et=="function"?{"()":Function.prototype.toString.call(et)}:et,o$2=()=>{const tt=Object.create(null);return(et,nt,...it)=>{const rt=(ot=>JSON.stringify(ot,i$8))(et);return rt in tt?tt[rt]:tt[rt]=nt(et,...it)}},l$6=Symbol.for("sxs.internal"),s$5=(tt,et)=>Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)),a$4=tt=>{for(const et in tt)return!0;return!1},{hasOwnProperty:c$8}=Object.prototype,d$6=tt=>tt.includes("-")?tt:tt.replace(/[A-Z]/g,et=>"-"+et.toLowerCase()),g$9=/\s+(?![^()]*\))/,p$8=tt=>et=>tt(...typeof et=="string"?String(et).split(g$9):[et]),u$6={appearance:tt=>({WebkitAppearance:tt,appearance:tt}),backfaceVisibility:tt=>({WebkitBackfaceVisibility:tt,backfaceVisibility:tt}),backdropFilter:tt=>({WebkitBackdropFilter:tt,backdropFilter:tt}),backgroundClip:tt=>({WebkitBackgroundClip:tt,backgroundClip:tt}),boxDecorationBreak:tt=>({WebkitBoxDecorationBreak:tt,boxDecorationBreak:tt}),clipPath:tt=>({WebkitClipPath:tt,clipPath:tt}),content:tt=>({content:tt.includes('"')||tt.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(tt)?tt:`"${tt}"`}),hyphens:tt=>({WebkitHyphens:tt,hyphens:tt}),maskImage:tt=>({WebkitMaskImage:tt,maskImage:tt}),maskSize:tt=>({WebkitMaskSize:tt,maskSize:tt}),tabSize:tt=>({MozTabSize:tt,tabSize:tt}),textSizeAdjust:tt=>({WebkitTextSizeAdjust:tt,textSizeAdjust:tt}),userSelect:tt=>({WebkitUserSelect:tt,userSelect:tt}),marginBlock:p$8((tt,et)=>({marginBlockStart:tt,marginBlockEnd:et||tt})),marginInline:p$8((tt,et)=>({marginInlineStart:tt,marginInlineEnd:et||tt})),maxSize:p$8((tt,et)=>({maxBlockSize:tt,maxInlineSize:et||tt})),minSize:p$8((tt,et)=>({minBlockSize:tt,minInlineSize:et||tt})),paddingBlock:p$8((tt,et)=>({paddingBlockStart:tt,paddingBlockEnd:et||tt})),paddingInline:p$8((tt,et)=>({paddingInlineStart:tt,paddingInlineEnd:et||tt}))},h$b=/([\d.]+)([^]*)/,f$8=(tt,et)=>tt.length?tt.reduce((nt,it)=>(nt.push(...et.map(rt=>rt.includes("&")?rt.replace(/&/g,/[ +>|~]/.test(it)&&/&.*&/.test(rt)?`:is(${it})`:it):it+" "+rt)),nt),[]):et,m$8=(tt,et)=>tt in b$7&&typeof et=="string"?et.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(nt,it,rt,ot)=>it+(rt==="stretch"?`-moz-available${ot};${d$6(tt)}:${it}-webkit-fill-available`:`-moz-fit-content${ot};${d$6(tt)}:${it}fit-content`)+ot):String(et),b$7={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S$3=tt=>tt?tt+"-":"",k$a=(tt,et,nt)=>tt.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(it,rt,ot,at,st)=>at=="$"==!!ot?it:(rt||at=="--"?"calc(":"")+"var(--"+(at==="$"?S$3(et)+(st.includes("$")?"":S$3(nt))+st.replace(/\$/g,"-"):st)+")"+(rt||at=="--"?"*"+(rt||"")+(ot||"1")+")":"")),y$8=/\s*,\s*(?![^()]*\))/,B$1=Object.prototype.toString,$$3=(tt,et,nt,it,rt)=>{let ot,at,st;const lt=(ct,ut,ht)=>{let dt,pt;const mt=gt=>{for(dt in gt){const wt=dt.charCodeAt(0)===64,vt=wt&&Array.isArray(gt[dt])?gt[dt]:[gt[dt]];for(pt of vt){const xt=/[A-Z]/.test(yt=dt)?yt:yt.replace(/-[^]/g,Et=>Et[1].toUpperCase()),St=typeof pt=="object"&&pt&&pt.toString===B$1&&(!it.utils[xt]||!ut.length);if(xt in it.utils&&!St){const Et=it.utils[xt];if(Et!==at){at=Et,mt(Et(pt)),at=null;continue}}else if(xt in u$6){const Et=u$6[xt];if(Et!==st){st=Et,mt(Et(pt)),st=null;continue}}if(wt&&(bt=dt.slice(1)in it.media?"@media "+it.media[dt.slice(1)]:dt,dt=bt.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(Et,It,Tt,$t,Ut,Lt)=>{const Bt=h$b.test(It),Pt=.0625*(Bt?-1:1),[kt,At]=Bt?[$t,It]:[It,$t];return"("+(Tt[0]==="="?"":Tt[0]===">"===Bt?"max-":"min-")+kt+":"+(Tt[0]!=="="&&Tt.length===1?At.replace(h$b,(Rt,Wt,jt)=>Number(Wt)+Pt*(Tt===">"?1:-1)+jt):At)+(Ut?") and ("+(Ut[0]===">"?"min-":"max-")+kt+":"+(Ut.length===1?Lt.replace(h$b,(Rt,Wt,jt)=>Number(Wt)+Pt*(Ut===">"?-1:1)+jt):Lt):"")+")"})),St){const Et=wt?ht.concat(dt):[...ht],It=wt?[...ut]:f$8(ut,dt.split(y$8));ot!==void 0&&rt(x$8(...ot)),ot=void 0,lt(pt,It,Et)}else ot===void 0&&(ot=[[],ut,ht]),dt=wt||dt.charCodeAt(0)!==36?dt:`--${S$3(it.prefix)}${dt.slice(1).replace(/\$/g,"-")}`,pt=St?pt:typeof pt=="number"?pt&&xt in I$3?String(pt)+"px":String(pt):k$a(m$8(xt,pt??""),it.prefix,it.themeMap[xt]),ot[0].push(`${wt?`${dt} `:`${d$6(dt)}:`}${pt}`)}}var bt,yt};mt(ct),ot!==void 0&&rt(x$8(...ot)),ot=void 0};lt(tt,et,nt)},x$8=(tt,et,nt)=>`${nt.map(it=>`${it}{`).join("")}${et.length?`${et.join(",")}{`:""}${tt.join(";")}${et.length?"}":""}${Array(nt.length?nt.length+1:0).join("}")}`,I$3={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R$1=tt=>String.fromCharCode(tt+(tt>25?39:97)),z$6=tt=>(et=>{let nt,it="";for(nt=Math.abs(et);nt>52;nt=nt/52|0)it=R$1(nt%52)+it;return R$1(nt%52)+it})(((et,nt)=>{let it=nt.length;for(;it;)et=33*et^nt.charCodeAt(--it);return et})(5381,JSON.stringify(tt))>>>0),W$7=["themed","global","styled","onevar","resonevar","allvar","inline"],j$3=tt=>{if(tt.href&&!tt.href.startsWith(location.origin))return!1;try{return!!tt.cssRules}catch{return!1}},E$1=tt=>{let et;const nt=()=>{const{cssRules:rt}=et.sheet;return[].map.call(rt,(ot,at)=>{const{cssText:st}=ot;let lt="";if(st.startsWith("--sxs"))return"";if(rt[at-1]&&(lt=rt[at-1].cssText).startsWith("--sxs")){if(!ot.cssRules.length)return"";for(const ct in et.rules)if(et.rules[ct].group===ot)return`--sxs{--sxs:${[...et.rules[ct].cache].join(" ")}}${st}`;return ot.cssRules.length?`${lt}${st}`:""}return st}).join("")},it=()=>{if(et){const{rules:st,sheet:lt}=et;if(!lt.deleteRule){for(;Object(Object(lt.cssRules)[0]).type===3;)lt.cssRules.splice(0,1);lt.cssRules=[]}for(const ct in st)delete st[ct]}const rt=Object(tt).styleSheets||[];for(const st of rt)if(j$3(st)){for(let lt=0,ct=st.cssRules;ct[lt];++lt){const ut=Object(ct[lt]);if(ut.type!==1)continue;const ht=Object(ct[lt+1]);if(ht.type!==4)continue;++lt;const{cssText:dt}=ut;if(!dt.startsWith("--sxs"))continue;const pt=dt.slice(14,-3).trim().split(/\s+/),mt=W$7[pt[0]];mt&&(et||(et={sheet:st,reset:it,rules:{},toString:nt}),et.rules[mt]={group:ht,index:lt,cache:new Set(pt)})}if(et)break}if(!et){const st=(lt,ct)=>({type:ct,cssRules:[],insertRule(ut,ht){this.cssRules.splice(ht,0,st(ut,{import:3,undefined:1}[(ut.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return lt==="@media{}"?`@media{${[].map.call(this.cssRules,ut=>ut.cssText).join("")}}`:lt}});et={sheet:tt?(tt.head||tt).appendChild(document.createElement("style")).sheet:st("","text/css"),rules:{},reset:it,toString:nt}}const{sheet:ot,rules:at}=et;for(let st=W$7.length-1;st>=0;--st){const lt=W$7[st];if(!at[lt]){const ct=W$7[st+1],ut=at[ct]?at[ct].index:ot.cssRules.length;ot.insertRule("@media{}",ut),ot.insertRule(`--sxs{--sxs:${st}}`,ut),at[lt]={group:ot.cssRules[ut+1],index:ut,cache:new Set([st])}}v$a(at[lt])}};return it(),et},v$a=tt=>{const et=tt.group;let nt=et.cssRules.length;tt.apply=it=>{try{et.insertRule(it,nt),++nt}catch{}}},T$2=Symbol(),w$7=o$2(),M$2=(tt,et)=>w$7(tt,()=>(...nt)=>{let it={type:null,composers:new Set};for(const rt of nt)if(rt!=null)if(rt[l$6]){it.type==null&&(it.type=rt[l$6].type);for(const ot of rt[l$6].composers)it.composers.add(ot)}else rt.constructor!==Object||rt.$$typeof?it.type==null&&(it.type=rt):it.composers.add(C$1(rt,tt));return it.type==null&&(it.type="span"),it.composers.size||it.composers.add(["PJLV",{},[],[],{},[]]),P$3(tt,it,et)}),C$1=({variants:tt,compoundVariants:et,defaultVariants:nt,...it},rt)=>{const ot=`${S$3(rt.prefix)}c-${z$6(it)}`,at=[],st=[],lt=Object.create(null),ct=[];for(const dt in nt)lt[dt]=String(nt[dt]);if(typeof tt=="object"&&tt)for(const dt in tt){ut=lt,ht=dt,c$8.call(ut,ht)||(lt[dt]="undefined");const pt=tt[dt];for(const mt in pt){const gt={[dt]:String(mt)};String(mt)==="undefined"&&ct.push(dt);const bt=pt[mt],yt=[gt,bt,!a$4(bt)];at.push(yt)}}var ut,ht;if(typeof et=="object"&&et)for(const dt of et){let{css:pt,...mt}=dt;pt=typeof pt=="object"&&pt||{};for(const bt in mt)mt[bt]=String(mt[bt]);const gt=[mt,pt,!a$4(pt)];st.push(gt)}return[ot,it,at,st,lt,ct]},P$3=(tt,et,nt)=>{const[it,rt,ot,at]=L$2(et.composers),st=typeof et.type=="function"||et.type.$$typeof?(ht=>{function dt(){for(let pt=0;ptdt.rules[pt]={apply:mt=>dt[T$2].push([pt,mt])}),dt})(nt):null,lt=(st||nt).rules,ct=`.${it}${rt.length>1?`:where(.${rt.slice(1).join(".")})`:""}`,ut=ht=>{ht=typeof ht=="object"&&ht||A$2;const{css:dt,...pt}=ht,mt={};for(const yt in ot)if(delete pt[yt],yt in ht){let wt=ht[yt];typeof wt=="object"&&wt?mt[yt]={"@initial":ot[yt],...wt}:(wt=String(wt),mt[yt]=wt!=="undefined"||at.has(yt)?wt:ot[yt])}else mt[yt]=ot[yt];const gt=new Set([...rt]);for(const[yt,wt,vt,xt]of et.composers){nt.rules.styled.cache.has(yt)||(nt.rules.styled.cache.add(yt),$$3(wt,[`.${yt}`],[],tt,It=>{lt.styled.apply(It)}));const St=O(vt,mt,tt.media),Et=O(xt,mt,tt.media,!0);for(const It of St)if(It!==void 0)for(const[Tt,$t,Ut]of It){const Lt=`${yt}-${z$6($t)}-${Tt}`;gt.add(Lt);const Bt=(Ut?nt.rules.resonevar:nt.rules.onevar).cache,Pt=Ut?lt.resonevar:lt.onevar;Bt.has(Lt)||(Bt.add(Lt),$$3($t,[`.${Lt}`],[],tt,kt=>{Pt.apply(kt)}))}for(const It of Et)if(It!==void 0)for(const[Tt,$t]of It){const Ut=`${yt}-${z$6($t)}-${Tt}`;gt.add(Ut),nt.rules.allvar.cache.has(Ut)||(nt.rules.allvar.cache.add(Ut),$$3($t,[`.${Ut}`],[],tt,Lt=>{lt.allvar.apply(Lt)}))}}if(typeof dt=="object"&&dt){const yt=`${it}-i${z$6(dt)}-css`;gt.add(yt),nt.rules.inline.cache.has(yt)||(nt.rules.inline.cache.add(yt),$$3(dt,[`.${yt}`],[],tt,wt=>{lt.inline.apply(wt)}))}for(const yt of String(ht.className||"").trim().split(/\s+/))yt&>.add(yt);const bt=pt.className=[...gt].join(" ");return{type:et.type,className:bt,selector:ct,props:pt,toString:()=>bt,deferredInjector:st}};return s$5(ut,{className:it,selector:ct,[l$6]:et,toString:()=>(nt.rules.styled.cache.has(it)||ut(),it)})},L$2=tt=>{let et="";const nt=[],it={},rt=[];for(const[ot,,,,at,st]of tt){et===""&&(et=ot),nt.push(ot),rt.push(...st);for(const lt in at){const ct=at[lt];(it[lt]===void 0||ct!=="undefined"||st.includes(ct))&&(it[lt]=ct)}}return[et,nt,it,new Set(rt)]},O=(tt,et,nt,it)=>{const rt=[];e:for(let[ot,at,st]of tt){if(st)continue;let lt,ct=0,ut=!1;for(lt in ot){const ht=ot[lt];let dt=et[lt];if(dt!==ht){if(typeof dt!="object"||!dt)continue e;{let pt,mt,gt=0;for(const bt in dt){if(ht===String(dt[bt])){if(bt!=="@initial"){const yt=bt.slice(1);(mt=mt||[]).push(yt in nt?nt[yt]:bt.replace(/^@media ?/,"")),ut=!0}ct+=gt,pt=!0}++gt}if(mt&&mt.length&&(at={["@media "+mt.join(", ")]:at}),!pt)continue e}}}(rt[ct]=rt[ct]||[]).push([it?"cv":`${lt}-${ot[lt]}`,at,ut])}return rt},A$2={},N$2=o$2(),D$1=(tt,et)=>N$2(tt,()=>(...nt)=>{const it=()=>{for(let rt of nt){rt=typeof rt=="object"&&rt||{};let ot=z$6(rt);if(!et.rules.global.cache.has(ot)){if(et.rules.global.cache.add(ot),"@import"in rt){let at=[].indexOf.call(et.sheet.cssRules,et.rules.themed.group)-1;for(let st of[].concat(rt["@import"]))st=st.includes('"')||st.includes("'")?st:`"${st}"`,et.sheet.insertRule(`@import ${st};`,at++);delete rt["@import"]}$$3(rt,[],[],tt,at=>{et.rules.global.apply(at)})}}return""};return s$5(it,{toString:it})}),H$2=o$2(),V$3=(tt,et)=>H$2(tt,()=>nt=>{const it=`${S$3(tt.prefix)}k-${z$6(nt)}`,rt=()=>{if(!et.rules.global.cache.has(it)){et.rules.global.cache.add(it);const ot=[];$$3(nt,[],[],tt,st=>ot.push(st));const at=`@keyframes ${it}{${ot.join("")}}`;et.rules.global.apply(at)}return it};return s$5(rt,{get name(){return rt()},toString:rt})}),G$2=class{constructor(et,nt,it,rt){this.token=et==null?"":String(et),this.value=nt==null?"":String(nt),this.scale=it==null?"":String(it),this.prefix=rt==null?"":String(rt)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S$3(this.prefix)+S$3(this.scale)+this.token}toString(){return this.computedValue}},F$2=o$2(),J$2=(tt,et)=>F$2(tt,()=>(nt,it)=>{it=typeof nt=="object"&&nt||Object(it);const rt=`.${nt=(nt=typeof nt=="string"?nt:"")||`${S$3(tt.prefix)}t-${z$6(it)}`}`,ot={},at=[];for(const lt in it){ot[lt]={};for(const ct in it[lt]){const ut=`--${S$3(tt.prefix)}${lt}-${ct}`,ht=k$a(String(it[lt][ct]),tt.prefix,lt);ot[lt][ct]=new G$2(ct,ht,lt,tt.prefix),at.push(`${ut}:${ht}`)}}const st=()=>{if(at.length&&!et.rules.themed.cache.has(nt)){et.rules.themed.cache.add(nt);const lt=`${it===tt.theme?":root,":""}.${nt}{${at.join(";")}}`;et.rules.themed.apply(lt)}return nt};return{...ot,get className(){return st()},selector:rt,toString:st}}),U$2=o$2(),X$1,Y$2=o$2(),q$7=tt=>{const et=(nt=>{let it=!1;const rt=U$2(nt,ot=>{it=!0;const at="prefix"in(ot=typeof ot=="object"&&ot||{})?String(ot.prefix):"",st=typeof ot.media=="object"&&ot.media||{},lt=typeof ot.root=="object"?ot.root||null:globalThis.document||null,ct=typeof ot.theme=="object"&&ot.theme||{},ut={prefix:at,media:st,theme:ct,themeMap:typeof ot.themeMap=="object"&&ot.themeMap||{...n$7},utils:typeof ot.utils=="object"&&ot.utils||{}},ht=E$1(lt),dt={css:M$2(ut,ht),globalCss:D$1(ut,ht),keyframes:V$3(ut,ht),createTheme:J$2(ut,ht),reset(){ht.reset(),dt.theme.toString()},theme:{},sheet:ht,config:ut,prefix:at,getCssText:ht.toString,toString:ht.toString};return String(dt.theme=dt.createTheme(ct)),dt});return it||rt.reset(),rt})(tt);return et.styled=(({config:nt,sheet:it})=>Y$2(nt,()=>{const rt=M$2(nt,it);return(...ot)=>{const at=rt(...ot),st=at[l$6].type,lt=React$1.forwardRef((ct,ut)=>{const ht=ct&&ct.as||st,{props:dt,deferredInjector:pt}=at(ct);return delete dt.as,dt.ref=ut,pt?React$1.createElement(React$1.Fragment,null,React$1.createElement(ht,dt),React$1.createElement(pt,null)):React$1.createElement(ht,dt)});return lt.className=at.className,lt.displayName=`Styled.${st.displayName||st.name||st}`,lt.selector=at.selector,lt.toString=()=>at.selector,lt[l$6]=at[l$6],lt}}))(et),et},K$6=()=>X$1||(X$1=q$7()),re$5=(...tt)=>K$6().styled(...tt);function clamp$9(tt,et,nt){return Math.max(et,Math.min(tt,nt))}const V$2={toVector(tt,et){return tt===void 0&&(tt=et),Array.isArray(tt)?tt:[tt,tt]},add(tt,et){return[tt[0]+et[0],tt[1]+et[1]]},sub(tt,et){return[tt[0]-et[0],tt[1]-et[1]]},addTo(tt,et){tt[0]+=et[0],tt[1]+=et[1]},subTo(tt,et){tt[0]-=et[0],tt[1]-=et[1]}};function rubberband(tt,et,nt){return et===0||Math.abs(et)===1/0?Math.pow(tt,nt*5):tt*et*nt/(et+nt*tt)}function rubberbandIfOutOfBounds(tt,et,nt,it=.15){return it===0?clamp$9(tt,et,nt):ttnt?+rubberband(tt-nt,nt-et,it)+nt:tt}function computeRubberband(tt,[et,nt],[it,rt]){const[[ot,at],[st,lt]]=tt;return[rubberbandIfOutOfBounds(et,ot,at,it),rubberbandIfOutOfBounds(nt,st,lt,rt)]}function _toPrimitive$F(tt,et){if(typeof tt!="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(typeof it!="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function _toPropertyKey$E(tt){var et=_toPrimitive$F(tt,"string");return typeof et=="symbol"?et:String(et)}function _defineProperty$J(tt,et,nt){return et=_toPropertyKey$E(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$G(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread2$2(tt){for(var et=1;et{var nt,it;return et.target===tt.currentTarget||((nt=tt.currentTarget)===null||nt===void 0||(it=nt.contains)===null||it===void 0?void 0:it.call(nt,et.target))})}function getTouchList(tt){return tt.type==="touchend"||tt.type==="touchcancel"?tt.changedTouches:tt.targetTouches}function getValueEvent(tt){return isTouch$1(tt)?getTouchList(tt)[0]:tt}function touchIds(tt){return getCurrentTargetTouchList(tt).map(et=>et.identifier)}function pointerId(tt){const et=getValueEvent(tt);return isTouch$1(tt)?et.identifier:et.pointerId}function pointerValues(tt){const et=getValueEvent(tt);return[et.clientX,et.clientY]}function getEventDetails(tt){const et={};if("buttons"in tt&&(et.buttons=tt.buttons),"shiftKey"in tt){const{shiftKey:nt,altKey:it,metaKey:rt,ctrlKey:ot}=tt;Object.assign(et,{shiftKey:nt,altKey:it,metaKey:rt,ctrlKey:ot})}return et}function call$2(tt,...et){return typeof tt=="function"?tt(...et):tt}function noop$a(){}function chain(...tt){return tt.length===0?noop$a:tt.length===1?tt[0]:function(){let et;for(const nt of tt)et=nt.apply(this,arguments)||et;return et}}function assignDefault(tt,et){return Object.assign({},et,tt||{})}const BEFORE_LAST_KINEMATICS_DELAY=32;class Engine{constructor(et,nt,it){this.ctrl=et,this.args=nt,this.key=it,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(et){this.ctrl.state[this.key]=et}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:et,shared:nt,ingKey:it,args:rt}=this;nt[it]=et._active=et.active=et._blocked=et._force=!1,et._step=[!1,!1],et.intentional=!1,et._movement=[0,0],et._distance=[0,0],et._direction=[0,0],et._delta=[0,0],et._bounds=[[-1/0,1/0],[-1/0,1/0]],et.args=rt,et.axis=void 0,et.memo=void 0,et.elapsedTime=et.timeDelta=0,et.direction=[0,0],et.distance=[0,0],et.overflow=[0,0],et._movementBound=[!1,!1],et.velocity=[0,0],et.movement=[0,0],et.delta=[0,0],et.timeStamp=0}start(et){const nt=this.state,it=this.config;nt._active||(this.reset(),this.computeInitial(),nt._active=!0,nt.target=et.target,nt.currentTarget=et.currentTarget,nt.lastOffset=it.from?call$2(it.from,nt):nt.offset,nt.offset=nt.lastOffset,nt.startTime=nt.timeStamp=et.timeStamp)}computeValues(et){const nt=this.state;nt._values=et,nt.values=this.config.transform(et)}computeInitial(){const et=this.state;et._initial=et._values,et.initial=et.values}compute(et){const{state:nt,config:it,shared:rt}=this;nt.args=this.args;let ot=0;if(et&&(nt.event=et,it.preventDefault&&et.cancelable&&nt.event.preventDefault(),nt.type=et.type,rt.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,rt.locked=!!document.pointerLockElement,Object.assign(rt,getEventDetails(et)),rt.down=rt.pressed=rt.buttons%2===1||rt.touches>0,ot=et.timeStamp-nt.timeStamp,nt.timeStamp=et.timeStamp,nt.elapsedTime=nt.timeStamp-nt.startTime),nt._active){const Et=nt._delta.map(Math.abs);V$2.addTo(nt._distance,Et)}this.axisIntent&&this.axisIntent(et);const[at,st]=nt._movement,[lt,ct]=it.threshold,{_step:ut,values:ht}=nt;if(it.hasCustomTransform?(ut[0]===!1&&(ut[0]=Math.abs(at)>=lt&&ht[0]),ut[1]===!1&&(ut[1]=Math.abs(st)>=ct&&ht[1])):(ut[0]===!1&&(ut[0]=Math.abs(at)>=lt&&Math.sign(at)*lt),ut[1]===!1&&(ut[1]=Math.abs(st)>=ct&&Math.sign(st)*ct)),nt.intentional=ut[0]!==!1||ut[1]!==!1,!nt.intentional)return;const dt=[0,0];if(it.hasCustomTransform){const[Et,It]=ht;dt[0]=ut[0]!==!1?Et-ut[0]:0,dt[1]=ut[1]!==!1?It-ut[1]:0}else dt[0]=ut[0]!==!1?at-ut[0]:0,dt[1]=ut[1]!==!1?st-ut[1]:0;this.restrictToAxis&&!nt._blocked&&this.restrictToAxis(dt);const pt=nt.offset,mt=nt._active&&!nt._blocked||nt.active;mt&&(nt.first=nt._active&&!nt.active,nt.last=!nt._active&&nt.active,nt.active=rt[this.ingKey]=nt._active,et&&(nt.first&&("bounds"in it&&(nt._bounds=call$2(it.bounds,nt)),this.setup&&this.setup()),nt.movement=dt,this.computeOffset()));const[gt,bt]=nt.offset,[[yt,wt],[vt,xt]]=nt._bounds;nt.overflow=[gtwt?1:0,btxt?1:0],nt._movementBound[0]=nt.overflow[0]?nt._movementBound[0]===!1?nt._movement[0]:nt._movementBound[0]:!1,nt._movementBound[1]=nt.overflow[1]?nt._movementBound[1]===!1?nt._movement[1]:nt._movementBound[1]:!1;const St=nt._active?it.rubberband||[0,0]:[0,0];if(nt.offset=computeRubberband(nt._bounds,nt.offset,St),nt.delta=V$2.sub(nt.offset,pt),this.computeMovement(),mt&&(!nt.last||ot>BEFORE_LAST_KINEMATICS_DELAY)){nt.delta=V$2.sub(nt.offset,pt);const Et=nt.delta.map(Math.abs);V$2.addTo(nt.distance,Et),nt.direction=nt.delta.map(Math.sign),nt._direction=nt._delta.map(Math.sign),!nt.first&&ot>0&&(nt.velocity=[Et[0]/ot,Et[1]/ot],nt.timeDelta=ot)}}emit(){const et=this.state,nt=this.shared,it=this.config;if(et._active||this.clean(),(et._blocked||!et.intentional)&&!et._force&&!it.triggerAllEvents)return;const rt=this.handler(_objectSpread2$2(_objectSpread2$2(_objectSpread2$2({},nt),et),{},{[this.aliasKey]:et.values}));rt!==void 0&&(et.memo=rt)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function selectAxis([tt,et],nt){const it=Math.abs(tt),rt=Math.abs(et);if(it>rt&&it>nt)return"x";if(rt>it&&rt>nt)return"y"}class CoordinatesEngine extends Engine{constructor(...et){super(...et),_defineProperty$J(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=V$2.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=V$2.sub(this.state.offset,this.state.lastOffset)}axisIntent(et){const nt=this.state,it=this.config;if(!nt.axis&&et){const rt=typeof it.axisThreshold=="object"?it.axisThreshold[getPointerType(et)]:it.axisThreshold;nt.axis=selectAxis(nt._movement,rt)}nt._blocked=(it.lockDirection||!!it.axis)&&!nt.axis||!!it.axis&&it.axis!==nt.axis}restrictToAxis(et){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":et[1]=0;break;case"y":et[0]=0;break}}}const identity$e=tt=>tt,DEFAULT_RUBBERBAND=.15,commonConfigResolver={enabled(tt=!0){return tt},eventOptions(tt,et,nt){return _objectSpread2$2(_objectSpread2$2({},nt.shared.eventOptions),tt)},preventDefault(tt=!1){return tt},triggerAllEvents(tt=!1){return tt},rubberband(tt=0){switch(tt){case!0:return[DEFAULT_RUBBERBAND,DEFAULT_RUBBERBAND];case!1:return[0,0];default:return V$2.toVector(tt)}},from(tt){if(typeof tt=="function")return tt;if(tt!=null)return V$2.toVector(tt)},transform(tt,et,nt){const it=tt||nt.shared.transform;return this.hasCustomTransform=!!it,it||identity$e},threshold(tt){return V$2.toVector(tt,0)}},DEFAULT_AXIS_THRESHOLD=0,coordinatesConfigResolver=_objectSpread2$2(_objectSpread2$2({},commonConfigResolver),{},{axis(tt,et,{axis:nt}){if(this.lockDirection=nt==="lock",!this.lockDirection)return nt},axisThreshold(tt=DEFAULT_AXIS_THRESHOLD){return tt},bounds(tt={}){if(typeof tt=="function")return ot=>coordinatesConfigResolver.bounds(tt(ot));if("current"in tt)return()=>tt.current;if(typeof HTMLElement=="function"&&tt instanceof HTMLElement)return tt;const{left:et=-1/0,right:nt=1/0,top:it=-1/0,bottom:rt=1/0}=tt;return[[et,nt],[it,rt]]}}),KEYS_DELTA_MAP={ArrowRight:(tt,et=1)=>[tt*et,0],ArrowLeft:(tt,et=1)=>[-1*tt*et,0],ArrowUp:(tt,et=1)=>[0,-1*tt*et],ArrowDown:(tt,et=1)=>[0,tt*et]};class DragEngine extends CoordinatesEngine{constructor(...et){super(...et),_defineProperty$J(this,"ingKey","dragging")}reset(){super.reset();const et=this.state;et._pointerId=void 0,et._pointerActive=!1,et._keyboardActive=!1,et._preventScroll=!1,et._delayed=!1,et.swipe=[0,0],et.tap=!1,et.canceled=!1,et.cancel=this.cancel.bind(this)}setup(){const et=this.state;if(et._bounds instanceof HTMLElement){const nt=et._bounds.getBoundingClientRect(),it=et.currentTarget.getBoundingClientRect(),rt={left:nt.left-it.left+et.offset[0],right:nt.right-it.right+et.offset[0],top:nt.top-it.top+et.offset[1],bottom:nt.bottom-it.bottom+et.offset[1]};et._bounds=coordinatesConfigResolver.bounds(rt)}}cancel(){const et=this.state;et.canceled||(et.canceled=!0,et._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(et){const nt=this.config,it=this.state;if(et.buttons!=null&&(Array.isArray(nt.pointerButtons)?!nt.pointerButtons.includes(et.buttons):nt.pointerButtons!==-1&&nt.pointerButtons!==et.buttons))return;const rt=this.ctrl.setEventIds(et);nt.pointerCapture&&et.target.setPointerCapture(et.pointerId),!(rt&&rt.size>1&&it._pointerActive)&&(this.start(et),this.setupPointer(et),it._pointerId=pointerId(et),it._pointerActive=!0,this.computeValues(pointerValues(et)),this.computeInitial(),nt.preventScrollAxis&&getPointerType(et)!=="mouse"?(it._active=!1,this.setupScrollPrevention(et)):nt.delay>0?(this.setupDelayTrigger(et),nt.triggerAllEvents&&(this.compute(et),this.emit())):this.startPointerDrag(et))}startPointerDrag(et){const nt=this.state;nt._active=!0,nt._preventScroll=!0,nt._delayed=!1,this.compute(et),this.emit()}pointerMove(et){const nt=this.state,it=this.config;if(!nt._pointerActive)return;const rt=pointerId(et);if(nt._pointerId!==void 0&&rt!==nt._pointerId)return;const ot=pointerValues(et);if(document.pointerLockElement===et.target?nt._delta=[et.movementX,et.movementY]:(nt._delta=V$2.sub(ot,nt._values),this.computeValues(ot)),V$2.addTo(nt._movement,nt._delta),this.compute(et),nt._delayed&&nt.intentional){this.timeoutStore.remove("dragDelay"),nt.active=!1,this.startPointerDrag(et);return}if(it.preventScrollAxis&&!nt._preventScroll)if(nt.axis)if(nt.axis===it.preventScrollAxis||it.preventScrollAxis==="xy"){nt._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(et);return}else return;this.emit()}pointerUp(et){this.ctrl.setEventIds(et);try{this.config.pointerCapture&&et.target.hasPointerCapture(et.pointerId)&&et.target.releasePointerCapture(et.pointerId)}catch{}const nt=this.state,it=this.config;if(!nt._active||!nt._pointerActive)return;const rt=pointerId(et);if(nt._pointerId!==void 0&&rt!==nt._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(et);const[ot,at]=nt._distance;if(nt.tap=ot<=it.tapsThreshold&&at<=it.tapsThreshold,nt.tap&&it.filterTaps)nt._force=!0;else{const[st,lt]=nt._delta,[ct,ut]=nt._movement,[ht,dt]=it.swipe.velocity,[pt,mt]=it.swipe.distance,gt=it.swipe.duration;if(nt.elapsedTimeht&&Math.abs(ct)>pt&&(nt.swipe[0]=Math.sign(st)),yt>dt&&Math.abs(ut)>mt&&(nt.swipe[1]=Math.sign(lt))}}this.emit()}pointerClick(et){!this.state.tap&&et.detail>0&&(et.preventDefault(),et.stopPropagation())}setupPointer(et){const nt=this.config,it=nt.device;nt.pointerLock&&et.currentTarget.requestPointerLock(),nt.pointerCapture||(this.eventStore.add(this.sharedConfig.window,it,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,it,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,it,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(et){this.state._preventScroll&&et.cancelable&&et.preventDefault()}setupScrollPrevention(et){this.state._preventScroll=!1,persistEvent(et);const nt=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",nt),this.eventStore.add(this.sharedConfig.window,"touch","cancel",nt),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,et)}setupDelayTrigger(et){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(et)},this.config.delay)}keyDown(et){const nt=KEYS_DELTA_MAP[et.key];if(nt){const it=this.state,rt=et.shiftKey?10:et.altKey?.1:1;this.start(et),it._delta=nt(this.config.keyboardDisplacement,rt),it._keyboardActive=!0,V$2.addTo(it._movement,it._delta),this.compute(et),this.emit()}}keyUp(et){et.key in KEYS_DELTA_MAP&&(this.state._keyboardActive=!1,this.setActive(),this.compute(et),this.emit())}bind(et){const nt=this.config.device;et(nt,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(et(nt,"change",this.pointerMove.bind(this)),et(nt,"end",this.pointerUp.bind(this)),et(nt,"cancel",this.pointerUp.bind(this)),et("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(et("key","down",this.keyDown.bind(this)),et("key","up",this.keyUp.bind(this))),this.config.filterTaps&&et("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function persistEvent(tt){"persist"in tt&&typeof tt.persist=="function"&&tt.persist()}const isBrowser$2=typeof window<"u"&&window.document&&window.document.createElement;function supportsTouchEvents(){return isBrowser$2&&"ontouchstart"in window}function isTouchScreen(){return supportsTouchEvents()||isBrowser$2&&window.navigator.maxTouchPoints>1}function supportsPointerEvents(){return isBrowser$2&&"onpointerdown"in window}function supportsPointerLock(){return isBrowser$2&&"exitPointerLock"in window.document}function supportsGestureEvents(){try{return"constructor"in GestureEvent}catch{return!1}}const SUPPORT={isBrowser:isBrowser$2,gesture:supportsGestureEvents(),touch:supportsTouchEvents(),touchscreen:isTouchScreen(),pointer:supportsPointerEvents(),pointerLock:supportsPointerLock()},DEFAULT_PREVENT_SCROLL_DELAY=250,DEFAULT_DRAG_DELAY=180,DEFAULT_SWIPE_VELOCITY=.5,DEFAULT_SWIPE_DISTANCE=50,DEFAULT_SWIPE_DURATION=250,DEFAULT_KEYBOARD_DISPLACEMENT=10,DEFAULT_DRAG_AXIS_THRESHOLD={mouse:0,touch:0,pen:8},dragConfigResolver=_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{device(tt,et,{pointer:{touch:nt=!1,lock:it=!1,mouse:rt=!1}={}}){return this.pointerLock=it&&SUPPORT.pointerLock,SUPPORT.touch&&nt?"touch":this.pointerLock?"mouse":SUPPORT.pointer&&!rt?"pointer":SUPPORT.touch?"touch":"mouse"},preventScrollAxis(tt,et,{preventScroll:nt}){if(this.preventScrollDelay=typeof nt=="number"?nt:nt||nt===void 0&&tt?DEFAULT_PREVENT_SCROLL_DELAY:void 0,!(!SUPPORT.touchscreen||nt===!1))return tt||(nt!==void 0?"y":void 0)},pointerCapture(tt,et,{pointer:{capture:nt=!0,buttons:it=1,keys:rt=!0}={}}){return this.pointerButtons=it,this.keys=rt,!this.pointerLock&&this.device==="pointer"&&nt},threshold(tt,et,{filterTaps:nt=!1,tapsThreshold:it=3,axis:rt=void 0}){const ot=V$2.toVector(tt,nt?it:rt?1:0);return this.filterTaps=nt,this.tapsThreshold=it,ot},swipe({velocity:tt=DEFAULT_SWIPE_VELOCITY,distance:et=DEFAULT_SWIPE_DISTANCE,duration:nt=DEFAULT_SWIPE_DURATION}={}){return{velocity:this.transform(V$2.toVector(tt)),distance:this.transform(V$2.toVector(et)),duration:nt}},delay(tt=0){switch(tt){case!0:return DEFAULT_DRAG_DELAY;case!1:return 0;default:return tt}},axisThreshold(tt){return tt?_objectSpread2$2(_objectSpread2$2({},DEFAULT_DRAG_AXIS_THRESHOLD),tt):DEFAULT_DRAG_AXIS_THRESHOLD},keyboardDisplacement(tt=DEFAULT_KEYBOARD_DISPLACEMENT){return tt}});_objectSpread2$2(_objectSpread2$2({},commonConfigResolver),{},{device(tt,et,{shared:nt,pointer:{touch:it=!1}={}}){if(nt.target&&!SUPPORT.touch&&SUPPORT.gesture)return"gesture";if(SUPPORT.touch&&it)return"touch";if(SUPPORT.touchscreen){if(SUPPORT.pointer)return"pointer";if(SUPPORT.touch)return"touch"}},bounds(tt,et,{scaleBounds:nt={},angleBounds:it={}}){const rt=at=>{const st=assignDefault(call$2(nt,at),{min:-1/0,max:1/0});return[st.min,st.max]},ot=at=>{const st=assignDefault(call$2(it,at),{min:-1/0,max:1/0});return[st.min,st.max]};return typeof nt!="function"&&typeof it!="function"?[rt(),ot()]:at=>[rt(at),ot(at)]},threshold(tt,et,nt){return this.lockDirection=nt.axis==="lock",V$2.toVector(tt,this.lockDirection?[.1,3]:0)},modifierKey(tt){return tt===void 0?"ctrlKey":tt},pinchOnWheel(tt=!0){return tt}});_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{mouseOnly:(tt=!0)=>tt});_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{mouseOnly:(tt=!0)=>tt});const EngineMap=new Map,ConfigResolverMap=new Map;function registerAction(tt){EngineMap.set(tt.key,tt.engine),ConfigResolverMap.set(tt.key,tt.resolver)}const dragAction={key:"drag",engine:DragEngine,resolver:dragConfigResolver};function _objectWithoutPropertiesLoose$p(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _objectWithoutProperties$m(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$p(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}const sharedConfigResolver={target(tt){if(tt)return()=>"current"in tt?tt.current:tt},enabled(tt=!0){return tt},window(tt=SUPPORT.isBrowser?window:void 0){return tt},eventOptions({passive:tt=!0,capture:et=!1}={}){return{passive:tt,capture:et}},transform(tt){return tt}},_excluded$1i=["target","eventOptions","window","enabled","transform"];function resolveWith(tt={},et){const nt={};for(const[it,rt]of Object.entries(et))switch(typeof rt){case"function":nt[it]=rt.call(nt,tt[it],it,tt);break;case"object":nt[it]=resolveWith(tt[it],rt);break;case"boolean":rt&&(nt[it]=tt[it]);break}return nt}function parse$5(tt,et,nt={}){const it=tt,{target:rt,eventOptions:ot,window:at,enabled:st,transform:lt}=it,ct=_objectWithoutProperties$m(it,_excluded$1i);if(nt.shared=resolveWith({target:rt,eventOptions:ot,window:at,enabled:st,transform:lt},sharedConfigResolver),et){const ut=ConfigResolverMap.get(et);nt[et]=resolveWith(_objectSpread2$2({shared:nt.shared},ct),ut)}else for(const ut in ct){const ht=ConfigResolverMap.get(ut);ht&&(nt[ut]=resolveWith(_objectSpread2$2({shared:nt.shared},ct[ut]),ht))}return nt}class EventStore{constructor(et,nt){_defineProperty$J(this,"_listeners",new Set),this._ctrl=et,this._gestureKey=nt}add(et,nt,it,rt,ot){const at=this._listeners,st=toDomEventType(nt,it),lt=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},ct=_objectSpread2$2(_objectSpread2$2({},lt),ot);et.addEventListener(st,rt,ct);const ut=()=>{et.removeEventListener(st,rt,ct),at.delete(ut)};return at.add(ut),ut}clean(){this._listeners.forEach(et=>et()),this._listeners.clear()}}class TimeoutStore{constructor(){_defineProperty$J(this,"_timeouts",new Map)}add(et,nt,it=140,...rt){this.remove(et),this._timeouts.set(et,window.setTimeout(nt,it,...rt))}remove(et){const nt=this._timeouts.get(et);nt&&window.clearTimeout(nt)}clean(){this._timeouts.forEach(et=>void window.clearTimeout(et)),this._timeouts.clear()}}let Controller$1=class{constructor(et){_defineProperty$J(this,"gestures",new Set),_defineProperty$J(this,"_targetEventStore",new EventStore(this)),_defineProperty$J(this,"gestureEventStores",{}),_defineProperty$J(this,"gestureTimeoutStores",{}),_defineProperty$J(this,"handlers",{}),_defineProperty$J(this,"config",{}),_defineProperty$J(this,"pointerIds",new Set),_defineProperty$J(this,"touchIds",new Set),_defineProperty$J(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),resolveGestures(this,et)}setEventIds(et){if(isTouch$1(et))return this.touchIds=new Set(touchIds(et)),this.touchIds;if("pointerId"in et)return et.type==="pointerup"||et.type==="pointercancel"?this.pointerIds.delete(et.pointerId):et.type==="pointerdown"&&this.pointerIds.add(et.pointerId),this.pointerIds}applyHandlers(et,nt){this.handlers=et,this.nativeHandlers=nt}applyConfig(et,nt){this.config=parse$5(et,nt,this.config)}clean(){this._targetEventStore.clean();for(const et of this.gestures)this.gestureEventStores[et].clean(),this.gestureTimeoutStores[et].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...et){const nt=this.config.shared,it={};let rt;if(!(nt.target&&(rt=nt.target(),!rt))){if(nt.enabled){for(const at of this.gestures){const st=this.config[at],lt=bindToProps(it,st.eventOptions,!!rt);if(st.enabled){const ct=EngineMap.get(at);new ct(this,et,at).bind(lt)}}const ot=bindToProps(it,nt.eventOptions,!!rt);for(const at in this.nativeHandlers)ot(at,"",st=>this.nativeHandlers[at](_objectSpread2$2(_objectSpread2$2({},this.state.shared),{},{event:st,args:et})),void 0,!0)}for(const ot in it)it[ot]=chain(...it[ot]);if(!rt)return it;for(const ot in it){const{device:at,capture:st,passive:lt}=parseProp(ot);this._targetEventStore.add(rt,at,"",it[ot],{capture:st,passive:lt})}}}};function setupGesture(tt,et){tt.gestures.add(et),tt.gestureEventStores[et]=new EventStore(tt,et),tt.gestureTimeoutStores[et]=new TimeoutStore}function resolveGestures(tt,et){et.drag&&setupGesture(tt,"drag"),et.wheel&&setupGesture(tt,"wheel"),et.scroll&&setupGesture(tt,"scroll"),et.move&&setupGesture(tt,"move"),et.pinch&&setupGesture(tt,"pinch"),et.hover&&setupGesture(tt,"hover")}const bindToProps=(tt,et,nt)=>(it,rt,ot,at={},st=!1)=>{var lt,ct;const ut=(lt=at.capture)!==null&<!==void 0?lt:et.capture,ht=(ct=at.passive)!==null&&ct!==void 0?ct:et.passive;let dt=st?it:toHandlerProp(it,rt,ut);nt&&ht&&(dt+="Passive"),tt[dt]=tt[dt]||[],tt[dt].push(ot)};function useRecognizers(tt,et={},nt,it){const rt=React$1.useMemo(()=>new Controller$1(tt),[]);if(rt.applyHandlers(tt,it),rt.applyConfig(et,nt),React$1.useEffect(rt.effect.bind(rt)),React$1.useEffect(()=>rt.clean.bind(rt),[]),et.target===void 0)return rt.bind.bind(rt)}function useDrag$2(tt,et){return registerAction(dragAction),useRecognizers({drag:tt},et||{},"drag")}function $e42e1063c40fb3ef$export$b9ecd428b558ff10(tt,et,{checkForDefaultPrevented:nt=!0}={}){return function(rt){if(tt==null||tt(rt),nt===!1||!rt.defaultPrevented)return et==null?void 0:et(rt)}}function $c512c27ab02ef895$export$50c7b4e9d9f19c1(tt,et=[]){let nt=[];function it(ot,at){const st=reactExports.createContext(at),lt=nt.length;nt=[...nt,at];function ct(ht){const{scope:dt,children:pt,...mt}=ht,gt=(dt==null?void 0:dt[tt][lt])||st,bt=reactExports.useMemo(()=>mt,Object.values(mt));return reactExports.createElement(gt.Provider,{value:bt},pt)}function ut(ht,dt){const pt=(dt==null?void 0:dt[tt][lt])||st,mt=reactExports.useContext(pt);if(mt)return mt;if(at!==void 0)return at;throw new Error(`\`${ht}\` must be used within \`${ot}\``)}return ct.displayName=ot+"Provider",[ct,ut]}const rt=()=>{const ot=nt.map(at=>reactExports.createContext(at));return function(st){const lt=(st==null?void 0:st[tt])||ot;return reactExports.useMemo(()=>({[`__scope${tt}`]:{...st,[tt]:lt}}),[st,lt])}};return rt.scopeName=tt,[it,$c512c27ab02ef895$var$composeContextScopes(rt,...et)]}function $c512c27ab02ef895$var$composeContextScopes(...tt){const et=tt[0];if(tt.length===1)return et;const nt=()=>{const it=tt.map(rt=>({useScope:rt(),scopeName:rt.scopeName}));return function(ot){const at=it.reduce((st,{useScope:lt,scopeName:ct})=>{const ht=lt(ot)[`__scope${ct}`];return{...st,...ht}},{});return reactExports.useMemo(()=>({[`__scope${et.scopeName}`]:at}),[at])}};return nt.scopeName=et.scopeName,nt}function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt){const et=reactExports.useRef(tt);return reactExports.useEffect(()=>{et.current=tt}),reactExports.useMemo(()=>(...nt)=>{var it;return(it=et.current)===null||it===void 0?void 0:it.call(et,...nt)},[])}function $addc16e1bbe58fd0$export$3a72a57244d6e765(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt);reactExports.useEffect(()=>{const it=rt=>{rt.key==="Escape"&&nt(rt)};return et.addEventListener("keydown",it),()=>et.removeEventListener("keydown",it)},[nt,et])}const $5cb92bef7577960e$var$CONTEXT_UPDATE="dismissableLayer.update",$5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",$5cb92bef7577960e$var$FOCUS_OUTSIDE="dismissableLayer.focusOutside";let $5cb92bef7577960e$var$originalBodyPointerEvents;const $5cb92bef7577960e$var$DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$5cb92bef7577960e$export$177fb62ff3ec1f22=reactExports.forwardRef((tt,et)=>{var nt;const{disableOutsidePointerEvents:it=!1,onEscapeKeyDown:rt,onPointerDownOutside:ot,onFocusOutside:at,onInteractOutside:st,onDismiss:lt,...ct}=tt,ut=reactExports.useContext($5cb92bef7577960e$var$DismissableLayerContext),[ht,dt]=reactExports.useState(null),pt=(nt=ht==null?void 0:ht.ownerDocument)!==null&&nt!==void 0?nt:globalThis==null?void 0:globalThis.document,[,mt]=reactExports.useState({}),gt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,Tt=>dt(Tt)),bt=Array.from(ut.layers),[yt]=[...ut.layersWithOutsidePointerEventsDisabled].slice(-1),wt=bt.indexOf(yt),vt=ht?bt.indexOf(ht):-1,xt=ut.layersWithOutsidePointerEventsDisabled.size>0,St=vt>=wt,Et=$5cb92bef7577960e$var$usePointerDownOutside(Tt=>{const $t=Tt.target,Ut=[...ut.branches].some(Lt=>Lt.contains($t));!St||Ut||(ot==null||ot(Tt),st==null||st(Tt),Tt.defaultPrevented||lt==null||lt())},pt),It=$5cb92bef7577960e$var$useFocusOutside(Tt=>{const $t=Tt.target;[...ut.branches].some(Lt=>Lt.contains($t))||(at==null||at(Tt),st==null||st(Tt),Tt.defaultPrevented||lt==null||lt())},pt);return $addc16e1bbe58fd0$export$3a72a57244d6e765(Tt=>{vt===ut.layers.size-1&&(rt==null||rt(Tt),!Tt.defaultPrevented&<&&(Tt.preventDefault(),lt()))},pt),reactExports.useEffect(()=>{if(ht)return it&&(ut.layersWithOutsidePointerEventsDisabled.size===0&&($5cb92bef7577960e$var$originalBodyPointerEvents=pt.body.style.pointerEvents,pt.body.style.pointerEvents="none"),ut.layersWithOutsidePointerEventsDisabled.add(ht)),ut.layers.add(ht),$5cb92bef7577960e$var$dispatchUpdate(),()=>{it&&ut.layersWithOutsidePointerEventsDisabled.size===1&&(pt.body.style.pointerEvents=$5cb92bef7577960e$var$originalBodyPointerEvents)}},[ht,pt,it,ut]),reactExports.useEffect(()=>()=>{ht&&(ut.layers.delete(ht),ut.layersWithOutsidePointerEventsDisabled.delete(ht),$5cb92bef7577960e$var$dispatchUpdate())},[ht,ut]),reactExports.useEffect(()=>{const Tt=()=>mt({});return document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,Tt),()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,Tt)},[]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},ct,{ref:gt,style:{pointerEvents:xt?St?"auto":"none":void 0,...tt.style},onFocusCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onFocusCapture,It.onFocusCapture),onBlurCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onBlurCapture,It.onBlurCapture),onPointerDownCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerDownCapture,Et.onPointerDownCapture)}))});function $5cb92bef7577960e$var$usePointerDownOutside(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt),it=reactExports.useRef(!1),rt=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const ot=st=>{if(st.target&&!it.current){let ut=function(){$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE,nt,ct,{discrete:!0})};var lt=ut;const ct={originalEvent:st};st.pointerType==="touch"?(et.removeEventListener("click",rt.current),rt.current=ut,et.addEventListener("click",rt.current,{once:!0})):ut()}else et.removeEventListener("click",rt.current);it.current=!1},at=window.setTimeout(()=>{et.addEventListener("pointerdown",ot)},0);return()=>{window.clearTimeout(at),et.removeEventListener("pointerdown",ot),et.removeEventListener("click",rt.current)}},[et,nt]),{onPointerDownCapture:()=>it.current=!0}}function $5cb92bef7577960e$var$useFocusOutside(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt),it=reactExports.useRef(!1);return reactExports.useEffect(()=>{const rt=ot=>{ot.target&&!it.current&&$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE,nt,{originalEvent:ot},{discrete:!1})};return et.addEventListener("focusin",rt),()=>et.removeEventListener("focusin",rt)},[et,nt]),{onFocusCapture:()=>it.current=!0,onBlurCapture:()=>it.current=!1}}function $5cb92bef7577960e$var$dispatchUpdate(){const tt=new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);document.dispatchEvent(tt)}function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(tt,et,nt,{discrete:it}){const rt=nt.originalEvent.target,ot=new CustomEvent(tt,{bubbles:!1,cancelable:!0,detail:nt});et&&rt.addEventListener(tt,et,{once:!0}),it?$8927f6f2acc4f386$export$6d1a0317bde7de7f(rt,ot):rt.dispatchEvent(ot)}const $9f79659886946c16$export$e5c5a5f917a5871c=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{},$1746a345f3d73bb7$var$useReactId=React$2["useId".toString()]||(()=>{});let $1746a345f3d73bb7$var$count=0;function $1746a345f3d73bb7$export$f680877a34711e37(tt){const[et,nt]=reactExports.useState($1746a345f3d73bb7$var$useReactId());return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{tt||nt(it=>it??String($1746a345f3d73bb7$var$count++))},[tt]),tt||(et?`radix-${et}`:"")}const sides=["top","right","bottom","left"],min$7=Math.min,max$7=Math.max,round$4=Math.round,floor$1=Math.floor,createCoords=tt=>({x:tt,y:tt}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$8(tt,et,nt){return max$7(tt,min$7(et,nt))}function evaluate$1(tt,et){return typeof tt=="function"?tt(et):tt}function getSide(tt){return tt.split("-")[0]}function getAlignment(tt){return tt.split("-")[1]}function getOppositeAxis(tt){return tt==="x"?"y":"x"}function getAxisLength(tt){return tt==="y"?"height":"width"}function getSideAxis(tt){return["top","bottom"].includes(getSide(tt))?"y":"x"}function getAlignmentAxis(tt){return getOppositeAxis(getSideAxis(tt))}function getAlignmentSides(tt,et,nt){nt===void 0&&(nt=!1);const it=getAlignment(tt),rt=getAlignmentAxis(tt),ot=getAxisLength(rt);let at=rt==="x"?it===(nt?"end":"start")?"right":"left":it==="start"?"bottom":"top";return et.reference[ot]>et.floating[ot]&&(at=getOppositePlacement$1(at)),[at,getOppositePlacement$1(at)]}function getExpandedPlacements(tt){const et=getOppositePlacement$1(tt);return[getOppositeAlignmentPlacement(tt),et,getOppositeAlignmentPlacement(et)]}function getOppositeAlignmentPlacement(tt){return tt.replace(/start|end/g,et=>oppositeAlignmentMap[et])}function getSideList(tt,et,nt){const it=["left","right"],rt=["right","left"],ot=["top","bottom"],at=["bottom","top"];switch(tt){case"top":case"bottom":return nt?et?rt:it:et?it:rt;case"left":case"right":return et?ot:at;default:return[]}}function getOppositeAxisPlacements(tt,et,nt,it){const rt=getAlignment(tt);let ot=getSideList(getSide(tt),nt==="start",it);return rt&&(ot=ot.map(at=>at+"-"+rt),et&&(ot=ot.concat(ot.map(getOppositeAlignmentPlacement)))),ot}function getOppositePlacement$1(tt){return tt.replace(/left|right|bottom|top/g,et=>oppositeSideMap[et])}function expandPaddingObject(tt){return{top:0,right:0,bottom:0,left:0,...tt}}function getPaddingObject(tt){return typeof tt!="number"?expandPaddingObject(tt):{top:tt,right:tt,bottom:tt,left:tt}}function rectToClientRect$1(tt){return{...tt,top:tt.y,left:tt.x,right:tt.x+tt.width,bottom:tt.y+tt.height}}function computeCoordsFromPlacement(tt,et,nt){let{reference:it,floating:rt}=tt;const ot=getSideAxis(et),at=getAlignmentAxis(et),st=getAxisLength(at),lt=getSide(et),ct=ot==="y",ut=it.x+it.width/2-rt.width/2,ht=it.y+it.height/2-rt.height/2,dt=it[st]/2-rt[st]/2;let pt;switch(lt){case"top":pt={x:ut,y:it.y-rt.height};break;case"bottom":pt={x:ut,y:it.y+it.height};break;case"right":pt={x:it.x+it.width,y:ht};break;case"left":pt={x:it.x-rt.width,y:ht};break;default:pt={x:it.x,y:it.y}}switch(getAlignment(et)){case"start":pt[at]-=dt*(nt&&ct?-1:1);break;case"end":pt[at]+=dt*(nt&&ct?-1:1);break}return pt}const computePosition$1=async(tt,et,nt)=>{const{placement:it="bottom",strategy:rt="absolute",middleware:ot=[],platform:at}=nt,st=ot.filter(Boolean),lt=await(at.isRTL==null?void 0:at.isRTL(et));let ct=await at.getElementRects({reference:tt,floating:et,strategy:rt}),{x:ut,y:ht}=computeCoordsFromPlacement(ct,it,lt),dt=it,pt={},mt=0;for(let gt=0;gt({name:"arrow",options:tt,async fn(et){const{x:nt,y:it,placement:rt,rects:ot,platform:at,elements:st,middlewareData:lt}=et,{element:ct,padding:ut=0}=evaluate$1(tt,et)||{};if(ct==null)return{};const ht=getPaddingObject(ut),dt={x:nt,y:it},pt=getAlignmentAxis(rt),mt=getAxisLength(pt),gt=await at.getDimensions(ct),bt=pt==="y",yt=bt?"top":"left",wt=bt?"bottom":"right",vt=bt?"clientHeight":"clientWidth",xt=ot.reference[mt]+ot.reference[pt]-dt[pt]-ot.floating[mt],St=dt[pt]-ot.reference[pt],Et=await(at.getOffsetParent==null?void 0:at.getOffsetParent(ct));let It=Et?Et[vt]:0;(!It||!await(at.isElement==null?void 0:at.isElement(Et)))&&(It=st.floating[vt]||ot.floating[mt]);const Tt=xt/2-St/2,$t=It/2-gt[mt]/2-1,Ut=min$7(ht[yt],$t),Lt=min$7(ht[wt],$t),Bt=Ut,Pt=It-gt[mt]-Lt,kt=It/2-gt[mt]/2+Tt,At=clamp$8(Bt,kt,Pt),Rt=!lt.arrow&&getAlignment(rt)!=null&&kt!=At&&ot.reference[mt]/2-(ktBt<=0)){var $t,Ut;const Bt=((($t=ot.flip)==null?void 0:$t.index)||0)+1,Pt=St[Bt];if(Pt)return{data:{index:Bt,overflows:Tt},reset:{placement:Pt}};let kt=(Ut=Tt.filter(At=>At.overflows[0]<=0).sort((At,Rt)=>At.overflows[1]-Rt.overflows[1])[0])==null?void 0:Ut.placement;if(!kt)switch(pt){case"bestFit":{var Lt;const At=(Lt=Tt.map(Rt=>[Rt.placement,Rt.overflows.filter(Wt=>Wt>0).reduce((Wt,jt)=>Wt+jt,0)]).sort((Rt,Wt)=>Rt[1]-Wt[1])[0])==null?void 0:Lt[0];At&&(kt=At);break}case"initialPlacement":kt=st;break}if(rt!==kt)return{reset:{placement:kt}}}return{}}}};function getSideOffsets$1(tt,et){return{top:tt.top-et.height,right:tt.right-et.width,bottom:tt.bottom-et.height,left:tt.left-et.width}}function isAnySideFullyClipped$1(tt){return sides.some(et=>tt[et]>=0)}const hide$5=function(tt){return tt===void 0&&(tt={}),{name:"hide",options:tt,async fn(et){const{rects:nt}=et,{strategy:it="referenceHidden",...rt}=evaluate$1(tt,et);switch(it){case"referenceHidden":{const ot=await detectOverflow$1(et,{...rt,elementContext:"reference"}),at=getSideOffsets$1(ot,nt.reference);return{data:{referenceHiddenOffsets:at,referenceHidden:isAnySideFullyClipped$1(at)}}}case"escaped":{const ot=await detectOverflow$1(et,{...rt,altBoundary:!0}),at=getSideOffsets$1(ot,nt.floating);return{data:{escapedOffsets:at,escaped:isAnySideFullyClipped$1(at)}}}default:return{}}}}};async function convertValueToCoords(tt,et){const{placement:nt,platform:it,elements:rt}=tt,ot=await(it.isRTL==null?void 0:it.isRTL(rt.floating)),at=getSide(nt),st=getAlignment(nt),lt=getSideAxis(nt)==="y",ct=["left","top"].includes(at)?-1:1,ut=ot&<?-1:1,ht=evaluate$1(et,tt);let{mainAxis:dt,crossAxis:pt,alignmentAxis:mt}=typeof ht=="number"?{mainAxis:ht,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...ht};return st&&typeof mt=="number"&&(pt=st==="end"?mt*-1:mt),lt?{x:pt*ut,y:dt*ct}:{x:dt*ct,y:pt*ut}}const offset$3=function(tt){return tt===void 0&&(tt=0),{name:"offset",options:tt,async fn(et){const{x:nt,y:it}=et,rt=await convertValueToCoords(et,tt);return{x:nt+rt.x,y:it+rt.y,data:rt}}}},shift=function(tt){return tt===void 0&&(tt={}),{name:"shift",options:tt,async fn(et){const{x:nt,y:it,placement:rt}=et,{mainAxis:ot=!0,crossAxis:at=!1,limiter:st={fn:bt=>{let{x:yt,y:wt}=bt;return{x:yt,y:wt}}},...lt}=evaluate$1(tt,et),ct={x:nt,y:it},ut=await detectOverflow$1(et,lt),ht=getSideAxis(getSide(rt)),dt=getOppositeAxis(ht);let pt=ct[dt],mt=ct[ht];if(ot){const bt=dt==="y"?"top":"left",yt=dt==="y"?"bottom":"right",wt=pt+ut[bt],vt=pt-ut[yt];pt=clamp$8(wt,pt,vt)}if(at){const bt=ht==="y"?"top":"left",yt=ht==="y"?"bottom":"right",wt=mt+ut[bt],vt=mt-ut[yt];mt=clamp$8(wt,mt,vt)}const gt=st.fn({...et,[dt]:pt,[ht]:mt});return{...gt,data:{x:gt.x-nt,y:gt.y-it}}}}},limitShift=function(tt){return tt===void 0&&(tt={}),{options:tt,fn(et){const{x:nt,y:it,placement:rt,rects:ot,middlewareData:at}=et,{offset:st=0,mainAxis:lt=!0,crossAxis:ct=!0}=evaluate$1(tt,et),ut={x:nt,y:it},ht=getSideAxis(rt),dt=getOppositeAxis(ht);let pt=ut[dt],mt=ut[ht];const gt=evaluate$1(st,et),bt=typeof gt=="number"?{mainAxis:gt,crossAxis:0}:{mainAxis:0,crossAxis:0,...gt};if(lt){const vt=dt==="y"?"height":"width",xt=ot.reference[dt]-ot.floating[vt]+bt.mainAxis,St=ot.reference[dt]+ot.reference[vt]-bt.mainAxis;ptSt&&(pt=St)}if(ct){var yt,wt;const vt=dt==="y"?"width":"height",xt=["top","left"].includes(getSide(rt)),St=ot.reference[ht]-ot.floating[vt]+(xt&&((yt=at.offset)==null?void 0:yt[ht])||0)+(xt?0:bt.crossAxis),Et=ot.reference[ht]+ot.reference[vt]+(xt?0:((wt=at.offset)==null?void 0:wt[ht])||0)-(xt?bt.crossAxis:0);mtEt&&(mt=Et)}return{[dt]:pt,[ht]:mt}}}},size=function(tt){return tt===void 0&&(tt={}),{name:"size",options:tt,async fn(et){const{placement:nt,rects:it,platform:rt,elements:ot}=et,{apply:at=()=>{},...st}=evaluate$1(tt,et),lt=await detectOverflow$1(et,st),ct=getSide(nt),ut=getAlignment(nt),ht=getSideAxis(nt)==="y",{width:dt,height:pt}=it.floating;let mt,gt;ct==="top"||ct==="bottom"?(mt=ct,gt=ut===(await(rt.isRTL==null?void 0:rt.isRTL(ot.floating))?"start":"end")?"left":"right"):(gt=ct,mt=ut==="end"?"top":"bottom");const bt=pt-lt[mt],yt=dt-lt[gt],wt=!et.middlewareData.shift;let vt=bt,xt=yt;if(ht){const Et=dt-lt.left-lt.right;xt=ut||wt?min$7(yt,Et):Et}else{const Et=pt-lt.top-lt.bottom;vt=ut||wt?min$7(bt,Et):Et}if(wt&&!ut){const Et=max$7(lt.left,0),It=max$7(lt.right,0),Tt=max$7(lt.top,0),$t=max$7(lt.bottom,0);ht?xt=dt-2*(Et!==0||It!==0?Et+It:max$7(lt.left,lt.right)):vt=pt-2*(Tt!==0||$t!==0?Tt+$t:max$7(lt.top,lt.bottom))}await at({...et,availableWidth:xt,availableHeight:vt});const St=await rt.getDimensions(ot.floating);return dt!==St.width||pt!==St.height?{reset:{rects:!0}}:{}}}};function getNodeName$1(tt){return isNode(tt)?(tt.nodeName||"").toLowerCase():"#document"}function getWindow$1(tt){var et;return(tt==null||(et=tt.ownerDocument)==null?void 0:et.defaultView)||window}function getDocumentElement$1(tt){var et;return(et=(isNode(tt)?tt.ownerDocument:tt.document)||window.document)==null?void 0:et.documentElement}function isNode(tt){return tt instanceof Node||tt instanceof getWindow$1(tt).Node}function isElement$1(tt){return tt instanceof Element||tt instanceof getWindow$1(tt).Element}function isHTMLElement$3(tt){return tt instanceof HTMLElement||tt instanceof getWindow$1(tt).HTMLElement}function isShadowRoot$1(tt){return typeof ShadowRoot>"u"?!1:tt instanceof ShadowRoot||tt instanceof getWindow$1(tt).ShadowRoot}function isOverflowElement(tt){const{overflow:et,overflowX:nt,overflowY:it,display:rt}=getComputedStyle$2(tt);return/auto|scroll|overlay|hidden|clip/.test(et+it+nt)&&!["inline","contents"].includes(rt)}function isTableElement$1(tt){return["table","td","th"].includes(getNodeName$1(tt))}function isContainingBlock(tt){const et=isWebKit(),nt=getComputedStyle$2(tt);return nt.transform!=="none"||nt.perspective!=="none"||(nt.containerType?nt.containerType!=="normal":!1)||!et&&(nt.backdropFilter?nt.backdropFilter!=="none":!1)||!et&&(nt.filter?nt.filter!=="none":!1)||["transform","perspective","filter"].some(it=>(nt.willChange||"").includes(it))||["paint","layout","strict","content"].some(it=>(nt.contain||"").includes(it))}function getContainingBlock$1(tt){let et=getParentNode$1(tt);for(;isHTMLElement$3(et)&&!isLastTraversableNode(et);){if(isContainingBlock(et))return et;et=getParentNode$1(et)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(tt){return["html","body","#document"].includes(getNodeName$1(tt))}function getComputedStyle$2(tt){return getWindow$1(tt).getComputedStyle(tt)}function getNodeScroll$1(tt){return isElement$1(tt)?{scrollLeft:tt.scrollLeft,scrollTop:tt.scrollTop}:{scrollLeft:tt.pageXOffset,scrollTop:tt.pageYOffset}}function getParentNode$1(tt){if(getNodeName$1(tt)==="html")return tt;const et=tt.assignedSlot||tt.parentNode||isShadowRoot$1(tt)&&tt.host||getDocumentElement$1(tt);return isShadowRoot$1(et)?et.host:et}function getNearestOverflowAncestor(tt){const et=getParentNode$1(tt);return isLastTraversableNode(et)?tt.ownerDocument?tt.ownerDocument.body:tt.body:isHTMLElement$3(et)&&isOverflowElement(et)?et:getNearestOverflowAncestor(et)}function getOverflowAncestors(tt,et,nt){var it;et===void 0&&(et=[]),nt===void 0&&(nt=!0);const rt=getNearestOverflowAncestor(tt),ot=rt===((it=tt.ownerDocument)==null?void 0:it.body),at=getWindow$1(rt);return ot?et.concat(at,at.visualViewport||[],isOverflowElement(rt)?rt:[],at.frameElement&&nt?getOverflowAncestors(at.frameElement):[]):et.concat(rt,getOverflowAncestors(rt,[],nt))}function getCssDimensions(tt){const et=getComputedStyle$2(tt);let nt=parseFloat(et.width)||0,it=parseFloat(et.height)||0;const rt=isHTMLElement$3(tt),ot=rt?tt.offsetWidth:nt,at=rt?tt.offsetHeight:it,st=round$4(nt)!==ot||round$4(it)!==at;return st&&(nt=ot,it=at),{width:nt,height:it,$:st}}function unwrapElement(tt){return isElement$1(tt)?tt:tt.contextElement}function getScale$1(tt){const et=unwrapElement(tt);if(!isHTMLElement$3(et))return createCoords(1);const nt=et.getBoundingClientRect(),{width:it,height:rt,$:ot}=getCssDimensions(et);let at=(ot?round$4(nt.width):nt.width)/it,st=(ot?round$4(nt.height):nt.height)/rt;return(!at||!Number.isFinite(at))&&(at=1),(!st||!Number.isFinite(st))&&(st=1),{x:at,y:st}}const noOffsets=createCoords(0);function getVisualOffsets(tt){const et=getWindow$1(tt);return!isWebKit()||!et.visualViewport?noOffsets:{x:et.visualViewport.offsetLeft,y:et.visualViewport.offsetTop}}function shouldAddVisualOffsets(tt,et,nt){return et===void 0&&(et=!1),!nt||et&&nt!==getWindow$1(tt)?!1:et}function getBoundingClientRect$1(tt,et,nt,it){et===void 0&&(et=!1),nt===void 0&&(nt=!1);const rt=tt.getBoundingClientRect(),ot=unwrapElement(tt);let at=createCoords(1);et&&(it?isElement$1(it)&&(at=getScale$1(it)):at=getScale$1(tt));const st=shouldAddVisualOffsets(ot,nt,it)?getVisualOffsets(ot):createCoords(0);let lt=(rt.left+st.x)/at.x,ct=(rt.top+st.y)/at.y,ut=rt.width/at.x,ht=rt.height/at.y;if(ot){const dt=getWindow$1(ot),pt=it&&isElement$1(it)?getWindow$1(it):it;let mt=dt.frameElement;for(;mt&&it&&pt!==dt;){const gt=getScale$1(mt),bt=mt.getBoundingClientRect(),yt=getComputedStyle$2(mt),wt=bt.left+(mt.clientLeft+parseFloat(yt.paddingLeft))*gt.x,vt=bt.top+(mt.clientTop+parseFloat(yt.paddingTop))*gt.y;lt*=gt.x,ct*=gt.y,ut*=gt.x,ht*=gt.y,lt+=wt,ct+=vt,mt=getWindow$1(mt).frameElement}}return rectToClientRect$1({width:ut,height:ht,x:lt,y:ct})}function convertOffsetParentRelativeRectToViewportRelativeRect(tt){let{rect:et,offsetParent:nt,strategy:it}=tt;const rt=isHTMLElement$3(nt),ot=getDocumentElement$1(nt);if(nt===ot)return et;let at={scrollLeft:0,scrollTop:0},st=createCoords(1);const lt=createCoords(0);if((rt||!rt&&it!=="fixed")&&((getNodeName$1(nt)!=="body"||isOverflowElement(ot))&&(at=getNodeScroll$1(nt)),isHTMLElement$3(nt))){const ct=getBoundingClientRect$1(nt);st=getScale$1(nt),lt.x=ct.x+nt.clientLeft,lt.y=ct.y+nt.clientTop}return{width:et.width*st.x,height:et.height*st.y,x:et.x*st.x-at.scrollLeft*st.x+lt.x,y:et.y*st.y-at.scrollTop*st.y+lt.y}}function getClientRects(tt){return Array.from(tt.getClientRects())}function getWindowScrollBarX$1(tt){return getBoundingClientRect$1(getDocumentElement$1(tt)).left+getNodeScroll$1(tt).scrollLeft}function getDocumentRect$1(tt){const et=getDocumentElement$1(tt),nt=getNodeScroll$1(tt),it=tt.ownerDocument.body,rt=max$7(et.scrollWidth,et.clientWidth,it.scrollWidth,it.clientWidth),ot=max$7(et.scrollHeight,et.clientHeight,it.scrollHeight,it.clientHeight);let at=-nt.scrollLeft+getWindowScrollBarX$1(tt);const st=-nt.scrollTop;return getComputedStyle$2(it).direction==="rtl"&&(at+=max$7(et.clientWidth,it.clientWidth)-rt),{width:rt,height:ot,x:at,y:st}}function getViewportRect$1(tt,et){const nt=getWindow$1(tt),it=getDocumentElement$1(tt),rt=nt.visualViewport;let ot=it.clientWidth,at=it.clientHeight,st=0,lt=0;if(rt){ot=rt.width,at=rt.height;const ct=isWebKit();(!ct||ct&&et==="fixed")&&(st=rt.offsetLeft,lt=rt.offsetTop)}return{width:ot,height:at,x:st,y:lt}}function getInnerBoundingClientRect$1(tt,et){const nt=getBoundingClientRect$1(tt,!0,et==="fixed"),it=nt.top+tt.clientTop,rt=nt.left+tt.clientLeft,ot=isHTMLElement$3(tt)?getScale$1(tt):createCoords(1),at=tt.clientWidth*ot.x,st=tt.clientHeight*ot.y,lt=rt*ot.x,ct=it*ot.y;return{width:at,height:st,x:lt,y:ct}}function getClientRectFromClippingAncestor(tt,et,nt){let it;if(et==="viewport")it=getViewportRect$1(tt,nt);else if(et==="document")it=getDocumentRect$1(getDocumentElement$1(tt));else if(isElement$1(et))it=getInnerBoundingClientRect$1(et,nt);else{const rt=getVisualOffsets(tt);it={...et,x:et.x-rt.x,y:et.y-rt.y}}return rectToClientRect$1(it)}function hasFixedPositionAncestor(tt,et){const nt=getParentNode$1(tt);return nt===et||!isElement$1(nt)||isLastTraversableNode(nt)?!1:getComputedStyle$2(nt).position==="fixed"||hasFixedPositionAncestor(nt,et)}function getClippingElementAncestors(tt,et){const nt=et.get(tt);if(nt)return nt;let it=getOverflowAncestors(tt,[],!1).filter(st=>isElement$1(st)&&getNodeName$1(st)!=="body"),rt=null;const ot=getComputedStyle$2(tt).position==="fixed";let at=ot?getParentNode$1(tt):tt;for(;isElement$1(at)&&!isLastTraversableNode(at);){const st=getComputedStyle$2(at),lt=isContainingBlock(at);!lt&&st.position==="fixed"&&(rt=null),(ot?!lt&&!rt:!lt&&st.position==="static"&&!!rt&&["absolute","fixed"].includes(rt.position)||isOverflowElement(at)&&!lt&&hasFixedPositionAncestor(tt,at))?it=it.filter(ut=>ut!==at):rt=st,at=getParentNode$1(at)}return et.set(tt,it),it}function getClippingRect$1(tt){let{element:et,boundary:nt,rootBoundary:it,strategy:rt}=tt;const at=[...nt==="clippingAncestors"?getClippingElementAncestors(et,this._c):[].concat(nt),it],st=at[0],lt=at.reduce((ct,ut)=>{const ht=getClientRectFromClippingAncestor(et,ut,rt);return ct.top=max$7(ht.top,ct.top),ct.right=min$7(ht.right,ct.right),ct.bottom=min$7(ht.bottom,ct.bottom),ct.left=max$7(ht.left,ct.left),ct},getClientRectFromClippingAncestor(et,st,rt));return{width:lt.right-lt.left,height:lt.bottom-lt.top,x:lt.left,y:lt.top}}function getDimensions$1(tt){return getCssDimensions(tt)}function getRectRelativeToOffsetParent(tt,et,nt){const it=isHTMLElement$3(et),rt=getDocumentElement$1(et),ot=nt==="fixed",at=getBoundingClientRect$1(tt,!0,ot,et);let st={scrollLeft:0,scrollTop:0};const lt=createCoords(0);if(it||!it&&!ot)if((getNodeName$1(et)!=="body"||isOverflowElement(rt))&&(st=getNodeScroll$1(et)),it){const ct=getBoundingClientRect$1(et,!0,ot,et);lt.x=ct.x+et.clientLeft,lt.y=ct.y+et.clientTop}else rt&&(lt.x=getWindowScrollBarX$1(rt));return{x:at.left+st.scrollLeft-lt.x,y:at.top+st.scrollTop-lt.y,width:at.width,height:at.height}}function getTrueOffsetParent$1(tt,et){return!isHTMLElement$3(tt)||getComputedStyle$2(tt).position==="fixed"?null:et?et(tt):tt.offsetParent}function getOffsetParent$1(tt,et){const nt=getWindow$1(tt);if(!isHTMLElement$3(tt))return nt;let it=getTrueOffsetParent$1(tt,et);for(;it&&isTableElement$1(it)&&getComputedStyle$2(it).position==="static";)it=getTrueOffsetParent$1(it,et);return it&&(getNodeName$1(it)==="html"||getNodeName$1(it)==="body"&&getComputedStyle$2(it).position==="static"&&!isContainingBlock(it))?nt:it||getContainingBlock$1(tt)||nt}const getElementRects=async function(tt){let{reference:et,floating:nt,strategy:it}=tt;const rt=this.getOffsetParent||getOffsetParent$1,ot=this.getDimensions;return{reference:getRectRelativeToOffsetParent(et,await rt(nt),it),floating:{x:0,y:0,...await ot(nt)}}};function isRTL(tt){return getComputedStyle$2(tt).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement$1,getClippingRect:getClippingRect$1,getOffsetParent:getOffsetParent$1,getElementRects,getClientRects,getDimensions:getDimensions$1,getScale:getScale$1,isElement:isElement$1,isRTL};function observeMove(tt,et){let nt=null,it;const rt=getDocumentElement$1(tt);function ot(){clearTimeout(it),nt&&nt.disconnect(),nt=null}function at(st,lt){st===void 0&&(st=!1),lt===void 0&&(lt=1),ot();const{left:ct,top:ut,width:ht,height:dt}=tt.getBoundingClientRect();if(st||et(),!ht||!dt)return;const pt=floor$1(ut),mt=floor$1(rt.clientWidth-(ct+ht)),gt=floor$1(rt.clientHeight-(ut+dt)),bt=floor$1(ct),wt={rootMargin:-pt+"px "+-mt+"px "+-gt+"px "+-bt+"px",threshold:max$7(0,min$7(1,lt))||1};let vt=!0;function xt(St){const Et=St[0].intersectionRatio;if(Et!==lt){if(!vt)return at();Et?at(!1,Et):it=setTimeout(()=>{at(!1,1e-7)},100)}vt=!1}try{nt=new IntersectionObserver(xt,{...wt,root:rt.ownerDocument})}catch{nt=new IntersectionObserver(xt,wt)}nt.observe(tt)}return at(!0),ot}function autoUpdate(tt,et,nt,it){it===void 0&&(it={});const{ancestorScroll:rt=!0,ancestorResize:ot=!0,elementResize:at=typeof ResizeObserver=="function",layoutShift:st=typeof IntersectionObserver=="function",animationFrame:lt=!1}=it,ct=unwrapElement(tt),ut=rt||ot?[...ct?getOverflowAncestors(ct):[],...getOverflowAncestors(et)]:[];ut.forEach(yt=>{rt&&yt.addEventListener("scroll",nt,{passive:!0}),ot&&yt.addEventListener("resize",nt)});const ht=ct&&st?observeMove(ct,nt):null;let dt=-1,pt=null;at&&(pt=new ResizeObserver(yt=>{let[wt]=yt;wt&&wt.target===ct&&pt&&(pt.unobserve(et),cancelAnimationFrame(dt),dt=requestAnimationFrame(()=>{pt&&pt.observe(et)})),nt()}),ct&&!lt&&pt.observe(ct),pt.observe(et));let mt,gt=lt?getBoundingClientRect$1(tt):null;lt&&bt();function bt(){const yt=getBoundingClientRect$1(tt);gt&&(yt.x!==gt.x||yt.y!==gt.y||yt.width!==gt.width||yt.height!==gt.height)&&nt(),gt=yt,mt=requestAnimationFrame(bt)}return nt(),()=>{ut.forEach(yt=>{rt&&yt.removeEventListener("scroll",nt),ot&&yt.removeEventListener("resize",nt)}),ht&&ht(),pt&&pt.disconnect(),pt=null,lt&&cancelAnimationFrame(mt)}}const computePosition=(tt,et,nt)=>{const it=new Map,rt={platform,...nt},ot={...rt.platform,_c:it};return computePosition$1(tt,et,{...rt,platform:ot})},arrow$2=tt=>{function et(nt){return{}.hasOwnProperty.call(nt,"current")}return{name:"arrow",options:tt,fn(nt){const{element:it,padding:rt}=typeof tt=="function"?tt(nt):tt;return it&&et(it)?it.current!=null?arrow$3({element:it.current,padding:rt}).fn(nt):{}:it?arrow$3({element:it,padding:rt}).fn(nt):{}}}};var index$3=typeof document<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function deepEqual$3(tt,et){if(tt===et)return!0;if(typeof tt!=typeof et)return!1;if(typeof tt=="function"&&tt.toString()===et.toString())return!0;let nt,it,rt;if(tt&&et&&typeof tt=="object"){if(Array.isArray(tt)){if(nt=tt.length,nt!=et.length)return!1;for(it=nt;it--!==0;)if(!deepEqual$3(tt[it],et[it]))return!1;return!0}if(rt=Object.keys(tt),nt=rt.length,nt!==Object.keys(et).length)return!1;for(it=nt;it--!==0;)if(!{}.hasOwnProperty.call(et,rt[it]))return!1;for(it=nt;it--!==0;){const ot=rt[it];if(!(ot==="_owner"&&tt.$$typeof)&&!deepEqual$3(tt[ot],et[ot]))return!1}return!0}return tt!==tt&&et!==et}function getDPR(tt){return typeof window>"u"?1:(tt.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(tt,et){const nt=getDPR(tt);return Math.round(et*nt)/nt}function useLatestRef(tt){const et=reactExports.useRef(tt);return index$3(()=>{et.current=tt}),et}function useFloating(tt){tt===void 0&&(tt={});const{placement:et="bottom",strategy:nt="absolute",middleware:it=[],platform:rt,elements:{reference:ot,floating:at}={},transform:st=!0,whileElementsMounted:lt,open:ct}=tt,[ut,ht]=reactExports.useState({x:0,y:0,strategy:nt,placement:et,middlewareData:{},isPositioned:!1}),[dt,pt]=reactExports.useState(it);deepEqual$3(dt,it)||pt(it);const[mt,gt]=reactExports.useState(null),[bt,yt]=reactExports.useState(null),wt=reactExports.useCallback(Rt=>{Rt!=Et.current&&(Et.current=Rt,gt(Rt))},[gt]),vt=reactExports.useCallback(Rt=>{Rt!==It.current&&(It.current=Rt,yt(Rt))},[yt]),xt=ot||mt,St=at||bt,Et=reactExports.useRef(null),It=reactExports.useRef(null),Tt=reactExports.useRef(ut),$t=useLatestRef(lt),Ut=useLatestRef(rt),Lt=reactExports.useCallback(()=>{if(!Et.current||!It.current)return;const Rt={placement:et,strategy:nt,middleware:dt};Ut.current&&(Rt.platform=Ut.current),computePosition(Et.current,It.current,Rt).then(Wt=>{const jt={...Wt,isPositioned:!0};Bt.current&&!deepEqual$3(Tt.current,jt)&&(Tt.current=jt,reactDomExports.flushSync(()=>{ht(jt)}))})},[dt,et,nt,Ut]);index$3(()=>{ct===!1&&Tt.current.isPositioned&&(Tt.current.isPositioned=!1,ht(Rt=>({...Rt,isPositioned:!1})))},[ct]);const Bt=reactExports.useRef(!1);index$3(()=>(Bt.current=!0,()=>{Bt.current=!1}),[]),index$3(()=>{if(xt&&(Et.current=xt),St&&(It.current=St),xt&&St){if($t.current)return $t.current(xt,St,Lt);Lt()}},[xt,St,Lt,$t]);const Pt=reactExports.useMemo(()=>({reference:Et,floating:It,setReference:wt,setFloating:vt}),[wt,vt]),kt=reactExports.useMemo(()=>({reference:xt,floating:St}),[xt,St]),At=reactExports.useMemo(()=>{const Rt={position:nt,left:0,top:0};if(!kt.floating)return Rt;const Wt=roundByDPR(kt.floating,ut.x),jt=roundByDPR(kt.floating,ut.y);return st?{...Rt,transform:"translate("+Wt+"px, "+jt+"px)",...getDPR(kt.floating)>=1.5&&{willChange:"transform"}}:{position:nt,left:Wt,top:jt}},[nt,st,kt.floating,ut.x,ut.y]);return reactExports.useMemo(()=>({...ut,update:Lt,refs:Pt,elements:kt,floatingStyles:At}),[ut,Lt,Pt,kt,At])}const $7e8f5cd07187803e$export$21b07c8f274aebd5=reactExports.forwardRef((tt,et)=>{const{children:nt,width:it=10,height:rt=5,...ot}=tt;return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg,_extends$u({},ot,{ref:et,width:it,height:rt,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),tt.asChild?nt:reactExports.createElement("polygon",{points:"0,0 30,0 15,10"}))}),$7e8f5cd07187803e$export$be92b6f5f03c0fe9=$7e8f5cd07187803e$export$21b07c8f274aebd5;function $db6c3485150b8e66$export$1ab7ae714698c4b8(tt){const[et,nt]=reactExports.useState(void 0);return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(tt){nt({width:tt.offsetWidth,height:tt.offsetHeight});const it=new ResizeObserver(rt=>{if(!Array.isArray(rt)||!rt.length)return;const ot=rt[0];let at,st;if("borderBoxSize"in ot){const lt=ot.borderBoxSize,ct=Array.isArray(lt)?lt[0]:lt;at=ct.inlineSize,st=ct.blockSize}else at=tt.offsetWidth,st=tt.offsetHeight;nt({width:at,height:st})});return it.observe(tt,{box:"border-box"}),()=>it.unobserve(tt)}else nt(void 0)},[tt]),et}const $cf1ac5d9fe0e8206$var$POPPER_NAME="Popper",[$cf1ac5d9fe0e8206$var$createPopperContext,$cf1ac5d9fe0e8206$export$722aac194ae923]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME),[$cf1ac5d9fe0e8206$var$PopperProvider,$cf1ac5d9fe0e8206$var$usePopperContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME),$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9=tt=>{const{__scopePopper:et,children:nt}=tt,[it,rt]=reactExports.useState(null);return reactExports.createElement($cf1ac5d9fe0e8206$var$PopperProvider,{scope:et,anchor:it,onAnchorChange:rt},nt)},$cf1ac5d9fe0e8206$var$ANCHOR_NAME="PopperAnchor",$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d=reactExports.forwardRef((tt,et)=>{const{__scopePopper:nt,virtualRef:it,...rt}=tt,ot=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME,nt),at=reactExports.useRef(null),st=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,at);return reactExports.useEffect(()=>{ot.onAnchorChange((it==null?void 0:it.current)||at.current)}),it?null:reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({},rt,{ref:st}))}),$cf1ac5d9fe0e8206$var$CONTENT_NAME="PopperContent",[$cf1ac5d9fe0e8206$var$PopperContentProvider,$cf1ac5d9fe0e8206$var$useContentContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME),$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc=reactExports.forwardRef((tt,et)=>{var nt,it,rt,ot,at,st,lt,ct;const{__scopePopper:ut,side:ht="bottom",sideOffset:dt=0,align:pt="center",alignOffset:mt=0,arrowPadding:gt=0,avoidCollisions:bt=!0,collisionBoundary:yt=[],collisionPadding:wt=0,sticky:vt="partial",hideWhenDetached:xt=!1,updatePositionStrategy:St="optimized",onPlaced:Et,...It}=tt,Tt=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME,ut),[$t,Ut]=reactExports.useState(null),Lt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,Cn=>Ut(Cn)),[Bt,Pt]=reactExports.useState(null),kt=$db6c3485150b8e66$export$1ab7ae714698c4b8(Bt),At=(nt=kt==null?void 0:kt.width)!==null&&nt!==void 0?nt:0,Rt=(it=kt==null?void 0:kt.height)!==null&&it!==void 0?it:0,Wt=ht+(pt!=="center"?"-"+pt:""),jt=typeof wt=="number"?wt:{top:0,right:0,bottom:0,left:0,...wt},Ot=Array.isArray(yt)?yt:[yt],Ct=Ot.length>0,Dt={padding:jt,boundary:Ot.filter($cf1ac5d9fe0e8206$var$isNotNull),altBoundary:Ct},{refs:Mt,floatingStyles:Vt,placement:Qt,isPositioned:rn,middlewareData:Xt}=useFloating({strategy:"fixed",placement:Wt,whileElementsMounted:(...Cn)=>autoUpdate(...Cn,{animationFrame:St==="always"}),elements:{reference:Tt.anchor},middleware:[offset$3({mainAxis:dt+Rt,alignmentAxis:mt}),bt&&shift({mainAxis:!0,crossAxis:!1,limiter:vt==="partial"?limitShift():void 0,...Dt}),bt&&flip$2({...Dt}),size({...Dt,apply:({elements:Cn,rects:jn,availableWidth:Un,availableHeight:yn})=>{const{width:un,height:En}=jn.reference,In=Cn.floating.style;In.setProperty("--radix-popper-available-width",`${Un}px`),In.setProperty("--radix-popper-available-height",`${yn}px`),In.setProperty("--radix-popper-anchor-width",`${un}px`),In.setProperty("--radix-popper-anchor-height",`${En}px`)}}),Bt&&arrow$2({element:Bt,padding:gt}),$cf1ac5d9fe0e8206$var$transformOrigin({arrowWidth:At,arrowHeight:Rt}),xt&&hide$5({strategy:"referenceHidden",...Dt})]}),[an,tn]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(Qt),pn=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Et);$9f79659886946c16$export$e5c5a5f917a5871c(()=>{rn&&(pn==null||pn())},[rn,pn]);const vn=(rt=Xt.arrow)===null||rt===void 0?void 0:rt.x,sn=(ot=Xt.arrow)===null||ot===void 0?void 0:ot.y,Zt=((at=Xt.arrow)===null||at===void 0?void 0:at.centerOffset)!==0,[Sn,Tn]=reactExports.useState();return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{$t&&Tn(window.getComputedStyle($t).zIndex)},[$t]),reactExports.createElement("div",{ref:Mt.setFloating,"data-radix-popper-content-wrapper":"",style:{...Vt,transform:rn?Vt.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Sn,"--radix-popper-transform-origin":[(st=Xt.transformOrigin)===null||st===void 0?void 0:st.x,(lt=Xt.transformOrigin)===null||lt===void 0?void 0:lt.y].join(" ")},dir:tt.dir},reactExports.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider,{scope:ut,placedSide:an,onArrowChange:Pt,arrowX:vn,arrowY:sn,shouldHideArrow:Zt},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$u({"data-side":an,"data-align":tn},It,{ref:Lt,style:{...It.style,animation:rn?void 0:"none",opacity:(ct=Xt.hide)!==null&&ct!==void 0&&ct.referenceHidden?0:void 0}}))))}),$cf1ac5d9fe0e8206$var$ARROW_NAME="PopperArrow",$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0=reactExports.forwardRef(function(et,nt){const{__scopePopper:it,...rt}=et,ot=$cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME,it),at=$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[ot.placedSide];return reactExports.createElement("span",{ref:ot.onArrowChange,style:{position:"absolute",left:ot.arrowX,top:ot.arrowY,[at]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[ot.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[ot.placedSide],visibility:ot.shouldHideArrow?"hidden":void 0}},reactExports.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9,_extends$u({},rt,{ref:nt,style:{...rt.style,display:"block"}})))});function $cf1ac5d9fe0e8206$var$isNotNull(tt){return tt!==null}const $cf1ac5d9fe0e8206$var$transformOrigin=tt=>({name:"transformOrigin",options:tt,fn(et){var nt,it,rt,ot,at;const{placement:st,rects:lt,middlewareData:ct}=et,ht=((nt=ct.arrow)===null||nt===void 0?void 0:nt.centerOffset)!==0,dt=ht?0:tt.arrowWidth,pt=ht?0:tt.arrowHeight,[mt,gt]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(st),bt={start:"0%",center:"50%",end:"100%"}[gt],yt=((it=(rt=ct.arrow)===null||rt===void 0?void 0:rt.x)!==null&&it!==void 0?it:0)+dt/2,wt=((ot=(at=ct.arrow)===null||at===void 0?void 0:at.y)!==null&&ot!==void 0?ot:0)+pt/2;let vt="",xt="";return mt==="bottom"?(vt=ht?bt:`${yt}px`,xt=`${-pt}px`):mt==="top"?(vt=ht?bt:`${yt}px`,xt=`${lt.floating.height+pt}px`):mt==="right"?(vt=`${-pt}px`,xt=ht?bt:`${wt}px`):mt==="left"&&(vt=`${lt.floating.width+pt}px`,xt=ht?bt:`${wt}px`),{data:{x:vt,y:xt}}}});function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(tt){const[et,nt="center"]=tt.split("-");return[et,nt]}const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9=$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9,$cf1ac5d9fe0e8206$export$b688253958b8dfe7=$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d,$cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2=$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc,$cf1ac5d9fe0e8206$export$21b07c8f274aebd5=$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;function $fe963b355347cc68$export$3e6543de14f8614f(tt,et){return reactExports.useReducer((nt,it)=>{const rt=et[nt][it];return rt??nt},tt)}const $921a889cee6df7e8$export$99c2b779aa4e8b8b=tt=>{const{present:et,children:nt}=tt,it=$921a889cee6df7e8$var$usePresence(et),rt=typeof nt=="function"?nt({present:it.isPresent}):reactExports.Children.only(nt),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(it.ref,rt.ref);return typeof nt=="function"||it.isPresent?reactExports.cloneElement(rt,{ref:ot}):null};$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName="Presence";function $921a889cee6df7e8$var$usePresence(tt){const[et,nt]=reactExports.useState(),it=reactExports.useRef({}),rt=reactExports.useRef(tt),ot=reactExports.useRef("none"),at=tt?"mounted":"unmounted",[st,lt]=$fe963b355347cc68$export$3e6543de14f8614f(at,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const ct=$921a889cee6df7e8$var$getAnimationName(it.current);ot.current=st==="mounted"?ct:"none"},[st]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const ct=it.current,ut=rt.current;if(ut!==tt){const dt=ot.current,pt=$921a889cee6df7e8$var$getAnimationName(ct);tt?lt("MOUNT"):pt==="none"||(ct==null?void 0:ct.display)==="none"?lt("UNMOUNT"):lt(ut&&dt!==pt?"ANIMATION_OUT":"UNMOUNT"),rt.current=tt}},[tt,lt]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(et){const ct=ht=>{const pt=$921a889cee6df7e8$var$getAnimationName(it.current).includes(ht.animationName);ht.target===et&&pt&&reactDomExports.flushSync(()=>lt("ANIMATION_END"))},ut=ht=>{ht.target===et&&(ot.current=$921a889cee6df7e8$var$getAnimationName(it.current))};return et.addEventListener("animationstart",ut),et.addEventListener("animationcancel",ct),et.addEventListener("animationend",ct),()=>{et.removeEventListener("animationstart",ut),et.removeEventListener("animationcancel",ct),et.removeEventListener("animationend",ct)}}else lt("ANIMATION_END")},[et,lt]),{isPresent:["mounted","unmountSuspended"].includes(st),ref:reactExports.useCallback(ct=>{ct&&(it.current=getComputedStyle(ct)),nt(ct)},[])}}function $921a889cee6df7e8$var$getAnimationName(tt){return(tt==null?void 0:tt.animationName)||"none"}function $71cd76cc60e0454e$export$6f32135080cb4c3({prop:tt,defaultProp:et,onChange:nt=()=>{}}){const[it,rt]=$71cd76cc60e0454e$var$useUncontrolledState({defaultProp:et,onChange:nt}),ot=tt!==void 0,at=ot?tt:it,st=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(nt),lt=reactExports.useCallback(ct=>{if(ot){const ht=typeof ct=="function"?ct(tt):ct;ht!==tt&&st(ht)}else rt(ct)},[ot,tt,rt,st]);return[at,lt]}function $71cd76cc60e0454e$var$useUncontrolledState({defaultProp:tt,onChange:et}){const nt=reactExports.useState(tt),[it]=nt,rt=reactExports.useRef(it),ot=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(et);return reactExports.useEffect(()=>{rt.current!==it&&(ot(it),rt.current=it)},[it,rt,ot]),nt}const $ea1ef594cf570d83$export$439d29a4e110a164=reactExports.forwardRef((tt,et)=>reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$u({},tt,{ref:et,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...tt.style}}))),$ea1ef594cf570d83$export$be92b6f5f03c0fe9=$ea1ef594cf570d83$export$439d29a4e110a164,[$a093c7e1ec25a057$var$createTooltipContext,$a093c7e1ec25a057$export$1c540a2224f0d865]=$c512c27ab02ef895$export$50c7b4e9d9f19c1("Tooltip",[$cf1ac5d9fe0e8206$export$722aac194ae923]),$a093c7e1ec25a057$var$usePopperScope=$cf1ac5d9fe0e8206$export$722aac194ae923(),$a093c7e1ec25a057$var$PROVIDER_NAME="TooltipProvider",$a093c7e1ec25a057$var$TOOLTIP_OPEN="tooltip.open",[$a093c7e1ec25a057$var$TooltipProviderContextProvider,$a093c7e1ec25a057$var$useTooltipProviderContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PROVIDER_NAME),$a093c7e1ec25a057$var$TOOLTIP_NAME="Tooltip",[$a093c7e1ec25a057$var$TooltipContextProvider,$a093c7e1ec25a057$var$useTooltipContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME),$a093c7e1ec25a057$export$28c660c63b792dea=tt=>{const{__scopeTooltip:et,children:nt,open:it,defaultOpen:rt=!1,onOpenChange:ot,disableHoverableContent:at,delayDuration:st}=tt,lt=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TOOLTIP_NAME,tt.__scopeTooltip),ct=$a093c7e1ec25a057$var$usePopperScope(et),[ut,ht]=reactExports.useState(null),dt=$1746a345f3d73bb7$export$f680877a34711e37(),pt=reactExports.useRef(0),mt=at??lt.disableHoverableContent,gt=st??lt.delayDuration,bt=reactExports.useRef(!1),[yt=!1,wt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:it,defaultProp:rt,onChange:It=>{It?(lt.onOpen(),document.dispatchEvent(new CustomEvent($a093c7e1ec25a057$var$TOOLTIP_OPEN))):lt.onClose(),ot==null||ot(It)}}),vt=reactExports.useMemo(()=>yt?bt.current?"delayed-open":"instant-open":"closed",[yt]),xt=reactExports.useCallback(()=>{window.clearTimeout(pt.current),bt.current=!1,wt(!0)},[wt]),St=reactExports.useCallback(()=>{window.clearTimeout(pt.current),wt(!1)},[wt]),Et=reactExports.useCallback(()=>{window.clearTimeout(pt.current),pt.current=window.setTimeout(()=>{bt.current=!0,wt(!0)},gt)},[gt,wt]);return reactExports.useEffect(()=>()=>window.clearTimeout(pt.current),[]),reactExports.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9,ct,reactExports.createElement($a093c7e1ec25a057$var$TooltipContextProvider,{scope:et,contentId:dt,open:yt,stateAttribute:vt,trigger:ut,onTriggerChange:ht,onTriggerEnter:reactExports.useCallback(()=>{lt.isOpenDelayed?Et():xt()},[lt.isOpenDelayed,Et,xt]),onTriggerLeave:reactExports.useCallback(()=>{mt?St():window.clearTimeout(pt.current)},[St,mt]),onOpen:xt,onClose:St,disableHoverableContent:mt},nt))},$a093c7e1ec25a057$var$TRIGGER_NAME="TooltipTrigger",$a093c7e1ec25a057$export$8c610744efcf8a1d=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,...it}=tt,rt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$TRIGGER_NAME,nt),ot=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TRIGGER_NAME,nt),at=$a093c7e1ec25a057$var$usePopperScope(nt),st=reactExports.useRef(null),lt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,st,rt.onTriggerChange),ct=reactExports.useRef(!1),ut=reactExports.useRef(!1),ht=reactExports.useCallback(()=>ct.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",ht),[ht]),reactExports.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7,_extends$u({asChild:!0},at),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$u({"aria-describedby":rt.open?rt.contentId:void 0,"data-state":rt.stateAttribute},it,{ref:lt,onPointerMove:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerMove,dt=>{dt.pointerType!=="touch"&&!ut.current&&!ot.isPointerInTransitRef.current&&(rt.onTriggerEnter(),ut.current=!0)}),onPointerLeave:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerLeave,()=>{rt.onTriggerLeave(),ut.current=!1}),onPointerDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerDown,()=>{ct.current=!0,document.addEventListener("pointerup",ht,{once:!0})}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onFocus,()=>{ct.current||rt.onOpen()}),onBlur:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onBlur,rt.onClose),onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onClick,rt.onClose)})))}),$a093c7e1ec25a057$var$PORTAL_NAME="TooltipPortal",[$a093c7e1ec25a057$var$PortalProvider,$a093c7e1ec25a057$var$usePortalContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PORTAL_NAME,{forceMount:void 0}),$a093c7e1ec25a057$var$CONTENT_NAME="TooltipContent",$a093c7e1ec25a057$export$e9003e2be37ec060=reactExports.forwardRef((tt,et)=>{const nt=$a093c7e1ec25a057$var$usePortalContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),{forceMount:it=nt.forceMount,side:rt="top",...ot}=tt,at=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip);return reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:it||at.open},at.disableHoverableContent?reactExports.createElement($a093c7e1ec25a057$var$TooltipContentImpl,_extends$u({side:rt},ot,{ref:et})):reactExports.createElement($a093c7e1ec25a057$var$TooltipContentHoverable,_extends$u({side:rt},ot,{ref:et})))}),$a093c7e1ec25a057$var$TooltipContentHoverable=reactExports.forwardRef((tt,et)=>{const nt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),it=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),rt=reactExports.useRef(null),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,rt),[at,st]=reactExports.useState(null),{trigger:lt,onClose:ct}=nt,ut=rt.current,{onPointerInTransitChange:ht}=it,dt=reactExports.useCallback(()=>{st(null),ht(!1)},[ht]),pt=reactExports.useCallback((mt,gt)=>{const bt=mt.currentTarget,yt={x:mt.clientX,y:mt.clientY},wt=$a093c7e1ec25a057$var$getExitSideFromRect(yt,bt.getBoundingClientRect()),vt=$a093c7e1ec25a057$var$getPaddedExitPoints(yt,wt),xt=$a093c7e1ec25a057$var$getPointsFromRect(gt.getBoundingClientRect()),St=$a093c7e1ec25a057$var$getHull([...vt,...xt]);st(St),ht(!0)},[ht]);return reactExports.useEffect(()=>()=>dt(),[dt]),reactExports.useEffect(()=>{if(lt&&ut){const mt=bt=>pt(bt,ut),gt=bt=>pt(bt,lt);return lt.addEventListener("pointerleave",mt),ut.addEventListener("pointerleave",gt),()=>{lt.removeEventListener("pointerleave",mt),ut.removeEventListener("pointerleave",gt)}}},[lt,ut,pt,dt]),reactExports.useEffect(()=>{if(at){const mt=gt=>{const bt=gt.target,yt={x:gt.clientX,y:gt.clientY},wt=(lt==null?void 0:lt.contains(bt))||(ut==null?void 0:ut.contains(bt)),vt=!$a093c7e1ec25a057$var$isPointInPolygon(yt,at);wt?dt():vt&&(dt(),ct())};return document.addEventListener("pointermove",mt),()=>document.removeEventListener("pointermove",mt)}},[lt,ut,at,ct,dt]),reactExports.createElement($a093c7e1ec25a057$var$TooltipContentImpl,_extends$u({},tt,{ref:ot}))}),[$a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider,$a093c7e1ec25a057$var$useVisuallyHiddenContentContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME,{isInside:!1}),$a093c7e1ec25a057$var$TooltipContentImpl=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,children:it,"aria-label":rt,onEscapeKeyDown:ot,onPointerDownOutside:at,...st}=tt,lt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,nt),ct=$a093c7e1ec25a057$var$usePopperScope(nt),{onClose:ut}=lt;return reactExports.useEffect(()=>(document.addEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN,ut),()=>document.removeEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN,ut)),[ut]),reactExports.useEffect(()=>{if(lt.trigger){const ht=dt=>{const pt=dt.target;pt!=null&&pt.contains(lt.trigger)&&ut()};return window.addEventListener("scroll",ht,{capture:!0}),()=>window.removeEventListener("scroll",ht,{capture:!0})}},[lt.trigger,ut]),reactExports.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:ot,onPointerDownOutside:at,onFocusOutside:ht=>ht.preventDefault(),onDismiss:ut},reactExports.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2,_extends$u({"data-state":lt.stateAttribute},ct,st,{ref:et,style:{...st.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),reactExports.createElement($5e63c961fc1ce211$export$d9f1ccf0bdb05d45,null,it),reactExports.createElement($a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider,{scope:nt,isInside:!0},reactExports.createElement($ea1ef594cf570d83$export$be92b6f5f03c0fe9,{id:lt.contentId,role:"tooltip"},rt||it))))}),$a093c7e1ec25a057$var$ARROW_NAME="TooltipArrow",$a093c7e1ec25a057$export$c27ee0ad710f7559=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,...it}=tt,rt=$a093c7e1ec25a057$var$usePopperScope(nt);return $a093c7e1ec25a057$var$useVisuallyHiddenContentContext($a093c7e1ec25a057$var$ARROW_NAME,nt).isInside?null:reactExports.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5,_extends$u({},rt,it,{ref:et}))});function $a093c7e1ec25a057$var$getExitSideFromRect(tt,et){const nt=Math.abs(et.top-tt.y),it=Math.abs(et.bottom-tt.y),rt=Math.abs(et.right-tt.x),ot=Math.abs(et.left-tt.x);switch(Math.min(nt,it,rt,ot)){case ot:return"left";case rt:return"right";case nt:return"top";case it:return"bottom";default:throw new Error("unreachable")}}function $a093c7e1ec25a057$var$getPaddedExitPoints(tt,et,nt=5){const it=[];switch(et){case"top":it.push({x:tt.x-nt,y:tt.y+nt},{x:tt.x+nt,y:tt.y+nt});break;case"bottom":it.push({x:tt.x-nt,y:tt.y-nt},{x:tt.x+nt,y:tt.y-nt});break;case"left":it.push({x:tt.x+nt,y:tt.y-nt},{x:tt.x+nt,y:tt.y+nt});break;case"right":it.push({x:tt.x-nt,y:tt.y-nt},{x:tt.x-nt,y:tt.y+nt});break}return it}function $a093c7e1ec25a057$var$getPointsFromRect(tt){const{top:et,right:nt,bottom:it,left:rt}=tt;return[{x:rt,y:et},{x:nt,y:et},{x:nt,y:it},{x:rt,y:it}]}function $a093c7e1ec25a057$var$isPointInPolygon(tt,et){const{x:nt,y:it}=tt;let rt=!1;for(let ot=0,at=et.length-1;otit!=ut>it&&nt<(ct-st)*(it-lt)/(ut-lt)+st&&(rt=!rt)}return rt}function $a093c7e1ec25a057$var$getHull(tt){const et=tt.slice();return et.sort((nt,it)=>nt.xit.x?1:nt.yit.y?1:0),$a093c7e1ec25a057$var$getHullPresorted(et)}function $a093c7e1ec25a057$var$getHullPresorted(tt){if(tt.length<=1)return tt.slice();const et=[];for(let it=0;it=2;){const ot=et[et.length-1],at=et[et.length-2];if((ot.x-at.x)*(rt.y-at.y)>=(ot.y-at.y)*(rt.x-at.x))et.pop();else break}et.push(rt)}et.pop();const nt=[];for(let it=tt.length-1;it>=0;it--){const rt=tt[it];for(;nt.length>=2;){const ot=nt[nt.length-1],at=nt[nt.length-2];if((ot.x-at.x)*(rt.y-at.y)>=(ot.y-at.y)*(rt.x-at.x))nt.pop();else break}nt.push(rt)}return nt.pop(),et.length===1&&nt.length===1&&et[0].x===nt[0].x&&et[0].y===nt[0].y?et:et.concat(nt)}const $a093c7e1ec25a057$export$be92b6f5f03c0fe9=$a093c7e1ec25a057$export$28c660c63b792dea,$a093c7e1ec25a057$export$41fb9f06171c75f4=$a093c7e1ec25a057$export$8c610744efcf8a1d,$a093c7e1ec25a057$export$7c6e2c02157bb7d2=$a093c7e1ec25a057$export$e9003e2be37ec060,$a093c7e1ec25a057$export$21b07c8f274aebd5=$a093c7e1ec25a057$export$c27ee0ad710f7559;function _objectWithoutPropertiesLoose$o(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _objectWithoutProperties$l(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$o(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}let LevaErrors;(function(tt){tt[tt.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",tt[tt.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",tt[tt.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",tt[tt.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",tt[tt.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",tt[tt.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",tt[tt.THEME_ERROR=6]="THEME_ERROR",tt[tt.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",tt[tt.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",tt[tt.EMPTY_KEY=9]="EMPTY_KEY"})(LevaErrors||(LevaErrors={}));const ErrorList={[LevaErrors.UNSUPPORTED_INPUT]:(tt,et)=>[`An input with type \`${tt}\` input was found at path \`${et}\` but it's not supported yet.`],[LevaErrors.NO_COMPONENT_FOR_TYPE]:(tt,et)=>[`Type \`${tt}\` found at path \`${et}\` can't be displayed in panel because no component supports it yet.`],[LevaErrors.UNKNOWN_INPUT]:(tt,et)=>[`input at path \`${tt}\` is not recognized.`,et],[LevaErrors.DUPLICATE_KEYS]:(tt,et,nt)=>[`Key \`${tt}\` of path \`${et}\` already exists at path \`${nt}\`. Even nested keys need to be unique. Rename one of the keys.`],[LevaErrors.ALREADY_REGISTERED_TYPE]:tt=>[`Type ${tt} has already been registered. You can't register a component with the same type.`],[LevaErrors.CLIPBOARD_ERROR]:tt=>["Error copying the value",tt],[LevaErrors.THEME_ERROR]:(tt,et)=>[`Error accessing the theme \`${tt}.${et}\` value.`],[LevaErrors.PATH_DOESNT_EXIST]:tt=>[`Error getting the value at path \`${tt}\`. There is probably an error in your \`render\` function.`],[LevaErrors.PATH_DOESNT_EXIST]:tt=>[`Error accessing the value at path \`${tt}\``],[LevaErrors.INPUT_TYPE_OVERRIDE]:(tt,et,nt)=>[`Input at path \`${tt}\` already exists with type: \`${et}\`. Its type cannot be overridden with type \`${nt}\`.`],[LevaErrors.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function _log(tt,et,...nt){const[it,...rt]=ErrorList[et](...nt);console[tt]("LEVA: "+it,...rt)}const warn$3=_log.bind(null,"warn"),log$2=_log.bind(null,"log"),_excluded$a$1=["value"],_excluded2$4$1=["schema"],_excluded3$1$1=["value"],Schemas=[],Plugins={};function getValueType(tt){let{value:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$a$1);for(let it of Schemas){const rt=it(et,nt);if(rt)return rt}}function register(tt,et){let{schema:nt}=et,it=_objectWithoutProperties$l(et,_excluded2$4$1);if(tt in Plugins){warn$3(LevaErrors.ALREADY_REGISTERED_TYPE,tt);return}Schemas.push((rt,ot)=>nt(rt,ot)&&tt),Plugins[tt]=it}function createInternalPlugin(tt){return tt}function normalize$3$2(tt,et,nt,it){const{normalize:rt}=Plugins[tt];if(rt)return rt(et,nt,it);if(typeof et!="object"||!("value"in et))return{value:et};const{value:ot}=et,at=_objectWithoutProperties$l(et,_excluded3$1$1);return{value:ot,settings:at}}function sanitize$4(tt,et,nt,it,rt,ot){const{sanitize:at}=Plugins[tt];return at?at(et,nt,it,rt,ot):et}function format$2$1(tt,et,nt){const{format:it}=Plugins[tt];return it?it(et,nt):et}function _defineProperty$I(tt,et,nt){return et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$F(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread2$1(tt){for(var et=1;ettt>nt?nt:tt{if(tt===""||typeof tt=="number")return tt;try{const et=evaluate(tt);if(!isNaN(et))return et}catch{}return parseFloat(tt)},log10=Math.log(10);function getStep(tt){let et=Math.abs(+String(tt).replace(".",""));if(et===0)return .01;for(;et!==0&&et%10===0;)et/=10;const nt=Math.floor(Math.log(et)/log10)+1,it=Math.floor(Math.log10(Math.abs(tt))),rt=Math.pow(10,it-nt);return Math.max(rt,.001)}const range$9=(tt,et,nt)=>nt===et?0:(clamp$7(tt,et,nt)-et)/(nt-et),invertedRange=(tt,et,nt)=>tt*(nt-et)+et,getUid=()=>"_"+Math.random().toString(36).substr(2,9),parens=/\(([0-9+\-*/^ .]+)\)/,exp$1=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,mul=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,div=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,add$5=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,sub=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function evaluate(tt){if(isNaN(Number(tt)))if(parens.test(tt)){const et=tt.replace(parens,(nt,it)=>String(evaluate(it)));return evaluate(et)}else if(exp$1.test(tt)){const et=tt.replace(exp$1,(nt,it,rt)=>String(Math.pow(Number(it),Number(rt))));return evaluate(et)}else if(mul.test(tt)){const et=tt.replace(mul,(nt,it,rt)=>String(Number(it)*Number(rt)));return evaluate(et)}else if(div.test(tt)){const et=tt.replace(div,(nt,it,rt)=>{if(rt!=0)return String(Number(it)/Number(rt));throw new Error("Division by zero")});return evaluate(et)}else if(add$5.test(tt)){const et=tt.replace(add$5,(nt,it,rt)=>String(Number(it)+Number(rt)));return evaluate(et)}else if(sub.test(tt)){const et=tt.replace(sub,(nt,it,rt)=>String(Number(it)-Number(rt)));return evaluate(et)}else return Number(tt);return Number(tt)}function pick$1(tt,et){return et.reduce((nt,it)=>(tt&&tt.hasOwnProperty(it)&&(nt[it]=tt[it]),nt),{})}function omit$1(tt,et){const nt=_objectSpread2$1({},tt);return et.forEach(it=>it in tt&&delete nt[it]),nt}function mapArrayToKeys(tt,et){return tt.reduce((nt,it,rt)=>Object.assign(nt,{[et[rt]]:it}),{})}function isObject$t(tt){return Object.prototype.toString.call(tt)==="[object Object]"}const isEmptyObject$1=tt=>isObject$t(tt)&&Object.keys(tt).length===0;let SpecialInputs;(function(tt){tt.BUTTON="BUTTON",tt.BUTTON_GROUP="BUTTON_GROUP",tt.MONITOR="MONITOR",tt.FOLDER="FOLDER"})(SpecialInputs||(SpecialInputs={}));let LevaInputs;(function(tt){tt.SELECT="SELECT",tt.IMAGE="IMAGE",tt.NUMBER="NUMBER",tt.COLOR="COLOR",tt.STRING="STRING",tt.BOOLEAN="BOOLEAN",tt.INTERVAL="INTERVAL",tt.VECTOR3D="VECTOR3D",tt.VECTOR2D="VECTOR2D"})(LevaInputs||(LevaInputs={}));const _excluded$9$1=["type","__customInput"],_excluded2$3$1=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],_excluded3$3=["type"];function parseOptions(tt,et,nt={},it){var rt,ot;if(typeof tt!="object"||Array.isArray(tt))return{type:it,input:tt,options:_objectSpread2$1({key:et,label:et,optional:!1,disabled:!1,order:0},nt)};if("__customInput"in tt){const{type:St,__customInput:Et}=tt,It=_objectWithoutProperties$l(tt,_excluded$9$1);return parseOptions(Et,et,It,St)}const{render:at,label:st,optional:lt,order:ct=0,disabled:ut,hint:ht,onChange:dt,onEditStart:pt,onEditEnd:mt,transient:gt}=tt,bt=_objectWithoutProperties$l(tt,_excluded2$3$1),yt=_objectSpread2$1({render:at,key:et,label:st??et,hint:ht,transient:gt??!!dt,onEditStart:pt,onEditEnd:mt,disabled:ut,optional:lt,order:ct},nt);let{type:wt}=bt,vt=_objectWithoutProperties$l(bt,_excluded3$3);if(wt=it??wt,wt in SpecialInputs)return{type:wt,input:vt,options:yt};let xt;return it&&isObject$t(vt)&&"value"in vt?xt=vt.value:xt=isEmptyObject$1(vt)?void 0:vt,{type:wt,input:xt,options:_objectSpread2$1(_objectSpread2$1({},yt),{},{onChange:dt,optional:(rt=yt.optional)!==null&&rt!==void 0?rt:!1,disabled:(ot=yt.disabled)!==null&&ot!==void 0?ot:!1})}}function normalizeInput(tt,et,nt,it){const rt=parseOptions(tt,et),{type:ot,input:at,options:st}=rt;if(ot)return ot in SpecialInputs?rt:{type:ot,input:normalize$3$2(ot,at,nt,it),options:st};let lt=getValueType(at);return lt?{type:lt,input:normalize$3$2(lt,at,nt,it),options:st}:(lt=getValueType({value:at}),lt?{type:lt,input:normalize$3$2(lt,{value:at},nt,it),options:st}:!1)}function updateInput(tt,et,nt,it,rt){const{value:ot,type:at,settings:st}=tt;tt.value=sanitizeValue({type:at,value:ot,settings:st},et,nt,it),tt.fromPanel=rt}const ValueError=function(et,nt,it){this.type="LEVA_ERROR",this.message="LEVA: "+et,this.previousValue=nt,this.error=it};function sanitizeValue({type:tt,value:et,settings:nt},it,rt,ot){const at=tt!=="SELECT"&&typeof it=="function"?it(et):it;let st;try{st=sanitize$4(tt,at,nt,et,rt,ot)}catch(lt){throw new ValueError(`The value \`${it}\` did not result in a correct value.`,et,lt)}return dequal(st,et)?et:st}const debounce$5=(tt,et,nt=!1)=>{let it=0;return function(){const rt=arguments,ot=nt&&!it,at=()=>tt.apply(this,rt);window.clearTimeout(it),it=window.setTimeout(at,et),ot&&at()}},multiplyStep=tt=>tt.shiftKey?5:tt.altKey?1/5:1;function render(tt,et){const nt=console.error;console.error=()=>{},ReactDOM.render(tt,et),console.error=nt}const _excluded$8$1=["value"],_excluded2$2$1=["min","max"],schema$3=tt=>{if(typeof tt=="number")return!0;if(typeof tt=="string"){const et=parseFloat(tt);return isNaN(et)?!1:tt.substring((""+et).length).trim().length<4}return!1},sanitize$3=(tt,{min:et=-1/0,max:nt=1/0,suffix:it})=>{const rt=parseFloat(tt);if(tt===""||isNaN(rt))throw Error("Invalid number");const ot=clamp$7(rt,et,nt);return it?ot+it:ot},format$1$2=(tt,{pad:et=0,suffix:nt})=>{const it=parseFloat(tt).toFixed(et);return nt?it+nt:it},normalize$2$2=tt=>{let{value:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$8$1);const{min:it=-1/0,max:rt=1/0}=nt,ot=_objectWithoutProperties$l(nt,_excluded2$2$1);let at=parseFloat(et);const st=typeof et=="string"?et.substring((""+at).length):void 0;at=clamp$7(at,it,rt);let lt=nt.step;lt||(Number.isFinite(it)?Number.isFinite(rt)?lt=+(Math.abs(rt-it)/100).toPrecision(1):lt=+(Math.abs(at-it)/100).toPrecision(1):Number.isFinite(rt)&&(lt=+(Math.abs(rt-at)/100).toPrecision(1)));const ct=lt?getStep(lt)*10:getStep(at);lt=lt||ct/10;const ut=Math.round(clamp$7(Math.log10(1/ct),0,2));return{value:st?at+st:at,settings:_objectSpread2$1({initialValue:at,step:lt,pad:ut,min:it,max:rt,suffix:st},ot)}},sanitizeStep$1=(tt,{step:et,initialValue:nt})=>{const it=Math.round((tt-nt)/et);return nt+it*et};var props$3$1=Object.freeze({__proto__:null,schema:schema$3,sanitize:sanitize$3,format:format$1$2,normalize:normalize$2$2,sanitizeStep:sanitizeStep$1});function _extends$t(){return _extends$t=Object.assign?Object.assign.bind():function(tt){for(var et=1;et({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function createStateClass(tt,et){const[nt,it]=tt.split(" "),rt={};return nt!=="none"&&(rt.boxShadow=`${et.inset?"inset ":""}0 0 0 $borderWidths${[et.key]} $colors${nt!=="default"&&nt||et.borderColor}`),it&&(rt.backgroundColor=it),rt}const utils$r={$inputStyle:()=>tt=>createStateClass(tt,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>tt=>createStateClass(tt,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>tt=>createStateClass(tt,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>tt=>createStateClass(tt,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:styled$5,css:css$1,createTheme:createTheme$2,globalCss,keyframes:keyframes$1}=q$7({prefix:"leva",theme:getDefaultTheme(),utils:_objectSpread2$1(_objectSpread2$1({},utils$r),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:tt=>({"&:focus":utils$r.$focusStyle()(tt)}),$focusWithin:tt=>({"&:focus-within":utils$r.$focusStyle()(tt)}),$hover:tt=>({"&:hover":utils$r.$hoverStyle()(tt)}),$active:tt=>({"&:active":utils$r.$activeStyle()(tt)})})}),globalStyles=globalCss({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function mergeTheme(tt){const et=getDefaultTheme();if(!tt)return{theme:et,className:""};Object.keys(tt).forEach(it=>{Object.assign(et[it],tt[it])});const nt=createTheme$2(et);return{theme:et,className:nt.className}}function useTh(tt,et){const{theme:nt}=reactExports.useContext(ThemeContext$3);if(!(tt in nt)||!(et in nt[tt]))return warn$3(LevaErrors.THEME_ERROR,tt,et),"";let it=et;for(;;){let rt=nt[tt][it];if(typeof rt=="string"&&rt.charAt(0)==="$")it=rt.substr(1);else return rt}}const StyledInput$2=styled$5("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),InnerLabel=styled$5("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${StyledInput$2}`]:{paddingLeft:0}}),InnerNumberLabel=styled$5(InnerLabel,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),InputContainer=styled$5("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),_excluded$7$2=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],_excluded2$1$2=["onUpdate"];function ValueInput(tt){let{innerLabel:et,value:nt,onUpdate:it,onChange:rt,onKeyDown:ot,type:at,id:st,inputType:lt="text",rows:ct=0}=tt,ut=_objectWithoutProperties$l(tt,_excluded$7$2);const{id:ht,emitOnEditStart:dt,emitOnEditEnd:pt,disabled:mt}=useInputContext(),gt=st||ht,bt=reactExports.useRef(null),yt=ct>0,wt=yt?"textarea":"input",vt=reactExports.useCallback(Et=>It=>{const Tt=It.currentTarget.value;Et(Tt)},[]);React$1.useEffect(()=>{const Et=bt.current,It=vt(Tt=>{it(Tt),pt()});return Et==null||Et.addEventListener("blur",It),()=>Et==null?void 0:Et.removeEventListener("blur",It)},[vt,it,pt]);const xt=reactExports.useCallback(Et=>{Et.key==="Enter"&&vt(it)(Et)},[vt,it]),St=Object.assign({as:wt},yt?{rows:ct}:{},ut);return React$1.createElement(InputContainer,{textArea:yt},et&&typeof et=="string"?React$1.createElement(InnerLabel,null,et):et,React$1.createElement(StyledInput$2,_extends$t({levaType:at,ref:bt,id:gt,type:lt,autoComplete:"off",spellCheck:"false",value:nt,onChange:vt(rt),onFocus:()=>dt(),onKeyPress:xt,onKeyDown:ot,disabled:mt},St)))}function NumberInput(tt){let{onUpdate:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded2$1$2);const it=reactExports.useCallback(ot=>et(parseNumber(ot)),[et]),rt=reactExports.useCallback(ot=>{const at=ot.key==="ArrowUp"?1:ot.key==="ArrowDown"?-1:0;if(at){ot.preventDefault();const st=ot.altKey?.1:ot.shiftKey?10:1;et(lt=>parseFloat(lt)+at*st)}},[et]);return React$1.createElement(ValueInput,_extends$t({},nt,{onUpdate:it,onKeyDown:rt,type:"number"}))}const StyledFolder=styled$5("div",{}),StyledWrapper=styled$5("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),StyledTitle=styled$5("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${StyledWrapper}::after`]:{opacity:.6},[`${StyledFolder}:hover > & + ${StyledWrapper}::after`]:{opacity:.6},[`${StyledFolder}:hover > & > svg`]:{opacity:1}}),StyledContent=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${StyledFolder}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),StyledRow=styled$5("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${StyledContent} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),StyledInputRow=styled$5(StyledRow,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),CopyLabelContainer=styled$5("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),StyledOptionalToggle=styled$5("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),StyledLabel$1=styled$5("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),StyledInputWrapper$1=styled$5("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${StyledLabel$1}`]:{pointerEvents:"auto"}}}}}),Overlay$1=styled$5("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),StyledToolTipContent=styled$5("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),ToolTipArrow=styled$5($a093c7e1ec25a057$export$21b07c8f274aebd5,{fill:"$toolTipBackground"});function Portal$1({children:tt}){const{className:et}=reactExports.useContext(ThemeContext$3);return React$1.createElement($f1701beae083dbae$export$be92b6f5f03c0fe9,{className:et},tt)}const _excluded$6$2=["align"];function OptionalToggle(){const{id:tt,disable:et,disabled:nt}=useInputContext();return React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledOptionalToggle,{id:tt+"__disable",type:"checkbox",checked:!nt,onChange:()=>et(!nt)}),React$1.createElement("label",{htmlFor:tt+"__disable"}))}function RawLabel(tt){const{id:et,optional:nt,hint:it}=useInputContext(),rt=tt.htmlFor||(et?{htmlFor:et}:null),ot=!it&&typeof tt.children=="string"?{title:tt.children}:null;return React$1.createElement(React$1.Fragment,null,nt&&React$1.createElement(OptionalToggle,null),it!==void 0?React$1.createElement($a093c7e1ec25a057$export$be92b6f5f03c0fe9,null,React$1.createElement($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0},React$1.createElement(StyledLabel$1,_extends$t({},rt,tt))),React$1.createElement($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{side:"top",sideOffset:2},React$1.createElement(StyledToolTipContent,null,it,React$1.createElement(ToolTipArrow,null)))):React$1.createElement(StyledLabel$1,_extends$t({},rt,ot,tt)))}function Label$2(tt){let{align:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$6$2);const{value:it,label:rt,key:ot,disabled:at}=useInputContext(),{hideCopyButton:st}=usePanelSettingsContext(),lt=!st&&ot!==void 0,[ct,ut]=reactExports.useState(!1),ht=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[ot]:it??""})),ut(!0)}catch{warn$3(LevaErrors.CLIPBOARD_ERROR,{[ot]:it})}};return React$1.createElement(CopyLabelContainer,{align:et,onPointerLeave:()=>ut(!1)},React$1.createElement(RawLabel,nt),lt&&!at&&React$1.createElement("div",{title:`Click to copy ${typeof rt=="string"?rt:ot} value`},ct?React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),React$1.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):React$1.createElement("svg",{onClick:ht,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),React$1.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const _excluded$5$2=["toggled"],Svg$1=styled$5("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Chevron(tt){let{toggled:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$5$2);return React$1.createElement(Svg$1,_extends$t({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${et?0:-90}deg)`}},nt),React$1.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const _excluded$4$2=["input"];function Row(tt){let{input:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$4$2);return et?React$1.createElement(StyledInputRow,nt):React$1.createElement(StyledRow,nt)}function useInputSetters({value:tt,type:et,settings:nt,setValue:it}){const[rt,ot]=reactExports.useState(format$2$1(et,tt,nt)),at=reactExports.useRef(tt),st=reactExports.useRef(nt);st.current=nt;const lt=reactExports.useCallback(ut=>ot(format$2$1(et,ut,st.current)),[et]),ct=reactExports.useCallback(ut=>{try{it(ut)}catch(ht){const{type:dt,previousValue:pt}=ht;if(dt!=="LEVA_ERROR")throw ht;lt(pt)}},[lt,it]);return reactExports.useEffect(()=>{dequal(tt,at.current)||lt(tt),at.current=tt},[tt,lt]),{displayValue:rt,onChange:ot,onUpdate:ct}}function useDrag$1(tt,et){const{emitOnEditStart:nt,emitOnEditEnd:it}=useInputContext();return useDrag$2(rt=>{rt.first&&(document.body.classList.add("leva__panel__dragged"),nt==null||nt());const ot=tt(rt);return rt.last&&(document.body.classList.remove("leva__panel__dragged"),it==null||it()),ot},et)}function useCanvas2d(tt){const et=reactExports.useRef(null),nt=reactExports.useRef(null),it=reactExports.useRef(!1);return reactExports.useEffect(()=>{const rt=debounce$5(()=>{et.current.width=et.current.offsetWidth*window.devicePixelRatio,et.current.height=et.current.offsetHeight*window.devicePixelRatio,tt(et.current,nt.current)},250);return window.addEventListener("resize",rt),it.current||(rt(),it.current=!0),()=>window.removeEventListener("resize",rt)},[tt]),reactExports.useEffect(()=>{nt.current=et.current.getContext("2d")},[]),[et,nt]}function useTransform(){const tt=reactExports.useRef(null),et=reactExports.useRef({x:0,y:0}),nt=reactExports.useCallback(it=>{Object.assign(et.current,it),tt.current&&(tt.current.style.transform=`translate3d(${et.current.x}px, ${et.current.y}px, 0)`)},[]);return[tt,nt]}const _excluded$3$2=["__refCount"],getInputAtPath=(tt,et)=>{if(!tt[et])return null;const nt=tt[et];return _objectWithoutProperties$l(nt,_excluded$3$2)};function useInput(tt){const et=useStoreContext(),[nt,it]=reactExports.useState(getInputAtPath(et.getData(),tt)),rt=reactExports.useCallback(ct=>et.setValueAtPath(tt,ct,!0),[tt,et]),ot=reactExports.useCallback(ct=>et.setSettingsAtPath(tt,ct),[tt,et]),at=reactExports.useCallback(ct=>et.disableInputAtPath(tt,ct),[tt,et]),st=reactExports.useCallback(()=>et.emitOnEditStart(tt),[tt,et]),lt=reactExports.useCallback(()=>et.emitOnEditEnd(tt),[tt,et]);return reactExports.useEffect(()=>{it(getInputAtPath(et.getData(),tt));const ct=et.useStore.subscribe(ut=>getInputAtPath(ut.data,tt),it,{equalityFn:shallow$2});return()=>ct()},[et,tt]),[nt,{set:rt,setSettings:ot,disable:at,storeId:et.storeId,emitOnEditStart:st,emitOnEditEnd:lt}]}const RangeGrid=styled$5("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),Range=styled$5("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),Scrubber=styled$5("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),RangeWrapper=styled$5("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),Indicator=styled$5("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function RangeSlider({value:tt,min:et,max:nt,onDrag:it,step:rt,initialValue:ot}){const at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useRef(0),ct=useTh("sizes","scrubberWidth"),ut=useDrag$1(({event:dt,first:pt,xy:[mt],movement:[gt],memo:bt})=>{if(pt){const{width:wt,left:vt}=at.current.getBoundingClientRect();lt.current=wt-parseFloat(ct),bt=(dt==null?void 0:dt.target)===st.current?tt:invertedRange((mt-vt)/wt,et,nt)}const yt=bt+invertedRange(gt/lt.current,0,nt-et);return it(sanitizeStep$1(yt,{step:rt,initialValue:ot})),bt}),ht=range$9(tt,et,nt);return React$1.createElement(RangeWrapper,_extends$t({ref:at},ut()),React$1.createElement(Range,null,React$1.createElement(Indicator,{style:{left:0,right:`${(1-ht)*100}%`}})),React$1.createElement(Scrubber,{ref:st,style:{left:`calc(${ht} * (100% - ${ct}))`}}))}const DraggableLabel=React$1.memo(({label:tt,onUpdate:et,step:nt,innerLabelTrim:it})=>{const[rt,ot]=reactExports.useState(!1),at=useDrag$1(({active:st,delta:[lt],event:ct,memo:ut=0})=>(ot(st),ut+=lt/2,Math.abs(ut)>=1&&(et(ht=>parseFloat(ht)+Math.floor(ut)*nt*multiplyStep(ct)),ut=0),ut));return React$1.createElement(InnerNumberLabel,_extends$t({dragging:rt,title:tt.length>1?tt:""},at()),tt.slice(0,it))});function Number$1({label:tt,id:et,displayValue:nt,onUpdate:it,onChange:rt,settings:ot,innerLabelTrim:at=1}){const st=at>0&&React$1.createElement(DraggableLabel,{label:tt,step:ot.step,onUpdate:it,innerLabelTrim:at});return React$1.createElement(NumberInput,{id:et,value:String(nt),onUpdate:it,onChange:rt,innerLabel:st})}function NumberComponent(){const tt=useInputContext(),{label:et,value:nt,onUpdate:it,settings:rt,id:ot}=tt,{min:at,max:st}=rt,lt=st!==1/0&&at!==-1/0;return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,et),React$1.createElement(RangeGrid,{hasRange:lt},lt&&React$1.createElement(RangeSlider,_extends$t({value:parseFloat(nt),onDrag:it},rt)),React$1.createElement(Number$1,_extends$t({},tt,{id:ot,label:"value",innerLabelTrim:lt?0:1}))))}const{sanitizeStep}=props$3$1,rest=_objectWithoutProperties$l(props$3$1,["sanitizeStep"]);var number$7=_objectSpread2$1({component:NumberComponent},rest);const schema$2$1=(tt,et)=>v8n().schema({options:v8n().passesAnyOf(v8n().object(),v8n().array())}).test(et),sanitize$2$1=(tt,{values:et})=>{if(et.indexOf(tt)<0)throw Error("Selected value doesn't match Select options");return tt},format$3=(tt,{values:et})=>et.indexOf(tt),normalize$1$2=tt=>{let{value:et,options:nt}=tt,it,rt;return Array.isArray(nt)?(rt=nt,it=nt.map(ot=>String(ot))):(rt=Object.values(nt),it=Object.keys(nt)),"value"in tt?rt.includes(et)||(it.unshift(String(et)),rt.unshift(et)):et=rt[0],Object.values(nt).includes(et)||(nt[String(et)]=et),{value:et,settings:{keys:it,values:rt}}};var props$2$1=Object.freeze({__proto__:null,schema:schema$2$1,sanitize:sanitize$2$1,format:format$3,normalize:normalize$1$2});const SelectContainer=styled$5("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),NativeSelect=styled$5("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),PresentationalSelect=styled$5("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${NativeSelect}:focus + &`]:{$focusStyle:""},[`${NativeSelect}:hover + &`]:{$hoverStyle:""}});function Select$4({displayValue:tt,value:et,onUpdate:nt,id:it,settings:rt,disabled:ot}){const{keys:at,values:st}=rt,lt=reactExports.useRef();return et===st[tt]&&(lt.current=at[tt]),React$1.createElement(SelectContainer,null,React$1.createElement(NativeSelect,{id:it,value:tt,onChange:ct=>nt(st[Number(ct.currentTarget.value)]),disabled:ot},at.map((ct,ut)=>React$1.createElement("option",{key:ct,value:ut},ct))),React$1.createElement(PresentationalSelect,null,lt.current),React$1.createElement(Chevron,{toggled:!0}))}function SelectComponent(){const{label:tt,value:et,displayValue:nt,onUpdate:it,id:rt,disabled:ot,settings:at}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Select$4,{id:rt,value:et,displayValue:nt,onUpdate:it,settings:at,disabled:ot}))}var select$1=_objectSpread2$1({component:SelectComponent},props$2$1);const schema$1$1=tt=>v8n().string().test(tt),sanitize$1$1=tt=>{if(typeof tt!="string")throw Error("Invalid string");return tt},normalize$6=({value:tt,editable:et=!0,rows:nt=!1})=>({value:tt,settings:{editable:et,rows:typeof nt=="number"?nt:nt?5:0}});var props$1$1=Object.freeze({__proto__:null,schema:schema$1$1,sanitize:sanitize$1$1,normalize:normalize$6});const _excluded$2$2=["displayValue","onUpdate","onChange","editable"],NonEditableString=styled$5("div",{whiteSpace:"pre-wrap"});function String$1(tt){let{displayValue:et,onUpdate:nt,onChange:it,editable:rt=!0}=tt,ot=_objectWithoutProperties$l(tt,_excluded$2$2);return rt?React$1.createElement(ValueInput,_extends$t({value:et,onUpdate:nt,onChange:it},ot)):React$1.createElement(NonEditableString,null,et)}function StringComponent(){const{label:tt,settings:et,displayValue:nt,onUpdate:it,onChange:rt}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(String$1,_extends$t({displayValue:nt,onUpdate:it,onChange:rt},et)))}var string$3=_objectSpread2$1({component:StringComponent},props$1$1);const schema$4=tt=>v8n().boolean().test(tt),sanitize$5=tt=>{if(typeof tt!="boolean")throw Error("Invalid boolean");return tt};var props$4=Object.freeze({__proto__:null,schema:schema$4,sanitize:sanitize$5});const StyledInputWrapper=styled$5("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function Boolean$1({value:tt,onUpdate:et,id:nt,disabled:it}){return React$1.createElement(StyledInputWrapper,null,React$1.createElement("input",{id:nt,type:"checkbox",checked:tt,onChange:rt=>et(rt.currentTarget.checked),disabled:it}),React$1.createElement("label",{htmlFor:nt},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},React$1.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function BooleanComponent(){const{label:tt,value:et,onUpdate:nt,disabled:it,id:rt}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Boolean$1,{value:et,onUpdate:nt,id:rt,disabled:it}))}var boolean$1=_objectSpread2$1({component:BooleanComponent},props$4);const _excluded$1$4=["locked"];function Coordinate({value:tt,id:et,valueKey:nt,settings:it,onUpdate:rt,innerLabelTrim:ot}){const at=reactExports.useRef(tt[nt]);at.current=tt[nt];const st=reactExports.useCallback(ct=>rt({[nt]:sanitizeValue({type:"NUMBER",value:at.current,settings:it},ct)}),[rt,it,nt]),lt=useInputSetters({type:"NUMBER",value:tt[nt],settings:it,setValue:st});return React$1.createElement(Number$1,{id:et,label:nt,value:tt[nt],displayValue:lt.displayValue,onUpdate:lt.onUpdate,onChange:lt.onChange,settings:it,innerLabelTrim:ot})}const Container$3=styled$5("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function Lock(tt){let{locked:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$1$4);return React$1.createElement("svg",_extends$t({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nt),et?React$1.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):React$1.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Vector({value:tt,onUpdate:et,settings:nt,innerLabelTrim:it}){const{id:rt,setSettings:ot}=useInputContext(),{lock:at,locked:st}=nt;return React$1.createElement(Container$3,{withLock:at},at&&React$1.createElement(Lock,{locked:st,onClick:()=>ot({locked:!st})}),Object.keys(tt).map((lt,ct)=>React$1.createElement(Coordinate,{id:ct===0?rt:`${rt}.${lt}`,key:lt,valueKey:lt,value:tt,settings:nt[lt],onUpdate:et,innerLabelTrim:it})))}const normalizeKeyedNumberSettings=(tt,et)=>{const nt={};let it=0,rt=1/0;Object.entries(tt).forEach(([ot,at])=>{nt[ot]=normalize$2$2(_objectSpread2$1({value:at},et[ot])).settings,it=Math.max(it,nt[ot].step),rt=Math.min(rt,nt[ot].pad)});for(let ot in nt){const{step:at,min:st,max:lt}=et[ot]||{};!isFinite(at)&&(!isFinite(st)||!isFinite(lt))&&(nt[ot].step=it,nt[ot].pad=rt)}return nt},_excluded$1h=["lock"],_excluded2$c=["value"];function getVectorSchema(tt){const et=v8n().array().length(tt).every.number(),nt=it=>{if(!it||typeof it!="object")return!1;const rt=Object.values(it);return rt.length===tt&&rt.every(ot=>isFinite(ot))};return it=>et.test(it)||nt(it)}function getVectorType(tt){return Array.isArray(tt)?"array":"object"}function convert$7(tt,et,nt){return getVectorType(tt)===et?tt:et==="array"?Object.values(tt):mapArrayToKeys(tt,nt)}const sanitizeVector=(tt,et,nt)=>{const it=convert$7(tt,"object",et.keys);for(let at in it)it[at]=sanitize$3(it[at],et[at]);const rt=Object.keys(it);let ot={};if(rt.length===et.keys.length)ot=it;else{const at=convert$7(nt,"object",et.keys);if(rt.length===1&&et.locked){const st=rt[0],lt=it[st],ct=at[st],ut=ct!==0?lt/ct:1;for(let ht in at)ht===st?ot[st]=lt:ot[ht]=at[ht]*ut}else ot=_objectSpread2$1(_objectSpread2$1({},at),it)}return convert$7(ot,et.format,et.keys)},formatVector=(tt,et)=>convert$7(tt,"object",et.keys),isNumberSettings=tt=>!!tt&&("step"in tt||"min"in tt||"max"in tt);function normalizeVector(tt,et,nt=[]){const{lock:it=!1}=et,rt=_objectWithoutProperties$l(et,_excluded$1h),ot=Array.isArray(tt)?"array":"object",at=ot==="object"?Object.keys(tt):nt,st=convert$7(tt,"object",at),lt=isNumberSettings(rt)?at.reduce((ut,ht)=>Object.assign(ut,{[ht]:rt}),{}):rt,ct=normalizeKeyedNumberSettings(st,lt);return{value:ot==="array"?tt:st,settings:_objectSpread2$1(_objectSpread2$1({},ct),{},{format:ot,keys:at,lock:it,locked:!1})}}function getVectorPlugin(tt){return{schema:getVectorSchema(tt.length),normalize:et=>{let{value:nt}=et,it=_objectWithoutProperties$l(et,_excluded2$c);return normalizeVector(nt,it,tt)},format:(et,nt)=>formatVector(et,nt),sanitize:(et,nt,it)=>sanitizeVector(et,nt,it)}}var r$b={grad:.9,turn:360,rad:360/(2*Math.PI)},t$6=function(tt){return typeof tt=="string"?tt.length>0:typeof tt=="number"},n$6=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=Math.pow(10,et)),Math.round(nt*tt)/nt+0},e$5=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=1),tt>nt?nt:tt>et?tt:et},u$5=function(tt){return(tt=isFinite(tt)?tt%360:0)>0?tt:tt+360},a$3=function(tt){return{r:e$5(tt.r,0,255),g:e$5(tt.g,0,255),b:e$5(tt.b,0,255),a:e$5(tt.a)}},o$1=function(tt){return{r:n$6(tt.r),g:n$6(tt.g),b:n$6(tt.b),a:n$6(tt.a,3)}},i$7=/^#([0-9a-f]{3,8})$/i,s$4=function(tt){var et=tt.toString(16);return et.length<2?"0"+et:et},h$a=function(tt){var et=tt.r,nt=tt.g,it=tt.b,rt=tt.a,ot=Math.max(et,nt,it),at=ot-Math.min(et,nt,it),st=at?ot===et?(nt-it)/at:ot===nt?2+(it-et)/at:4+(et-nt)/at:0;return{h:60*(st<0?st+6:st),s:ot?at/ot*100:0,v:ot/255*100,a:rt}},b$6=function(tt){var et=tt.h,nt=tt.s,it=tt.v,rt=tt.a;et=et/360*6,nt/=100,it/=100;var ot=Math.floor(et),at=it*(1-nt),st=it*(1-(et-ot)*nt),lt=it*(1-(1-et+ot)*nt),ct=ot%6;return{r:255*[it,st,at,at,lt,it][ct],g:255*[lt,it,it,st,at,at][ct],b:255*[at,at,lt,it,it,st][ct],a:rt}},g$8=function(tt){return{h:u$5(tt.h),s:e$5(tt.s,0,100),l:e$5(tt.l,0,100),a:e$5(tt.a)}},d$5=function(tt){return{h:n$6(tt.h),s:n$6(tt.s),l:n$6(tt.l),a:n$6(tt.a,3)}},f$7=function(tt){return b$6((nt=(et=tt).s,{h:et.h,s:(nt*=((it=et.l)<50?it:100-it)/100)>0?2*nt/(it+nt)*100:0,v:it+nt,a:et.a}));var et,nt,it},c$7=function(tt){return{h:(et=h$a(tt)).h,s:(rt=(200-(nt=et.s))*(it=et.v)/100)>0&&rt<200?nt*it/100/(rt<=100?rt:200-rt)*100:0,l:rt/2,a:et.a};var et,nt,it,rt},l$5=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p$7=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v$9=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m$7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y$7={string:[[function(tt){var et=i$7.exec(tt);return et?(tt=et[1]).length<=4?{r:parseInt(tt[0]+tt[0],16),g:parseInt(tt[1]+tt[1],16),b:parseInt(tt[2]+tt[2],16),a:tt.length===4?n$6(parseInt(tt[3]+tt[3],16)/255,2):1}:tt.length===6||tt.length===8?{r:parseInt(tt.substr(0,2),16),g:parseInt(tt.substr(2,2),16),b:parseInt(tt.substr(4,2),16),a:tt.length===8?n$6(parseInt(tt.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(tt){var et=v$9.exec(tt)||m$7.exec(tt);return et?et[2]!==et[4]||et[4]!==et[6]?null:a$3({r:Number(et[1])/(et[2]?100/255:1),g:Number(et[3])/(et[4]?100/255:1),b:Number(et[5])/(et[6]?100/255:1),a:et[7]===void 0?1:Number(et[7])/(et[8]?100:1)}):null},"rgb"],[function(tt){var et=l$5.exec(tt)||p$7.exec(tt);if(!et)return null;var nt,it,rt=g$8({h:(nt=et[1],it=et[2],it===void 0&&(it="deg"),Number(nt)*(r$b[it]||1)),s:Number(et[3]),l:Number(et[4]),a:et[5]===void 0?1:Number(et[5])/(et[6]?100:1)});return f$7(rt)},"hsl"]],object:[[function(tt){var et=tt.r,nt=tt.g,it=tt.b,rt=tt.a,ot=rt===void 0?1:rt;return t$6(et)&&t$6(nt)&&t$6(it)?a$3({r:Number(et),g:Number(nt),b:Number(it),a:Number(ot)}):null},"rgb"],[function(tt){var et=tt.h,nt=tt.s,it=tt.l,rt=tt.a,ot=rt===void 0?1:rt;if(!t$6(et)||!t$6(nt)||!t$6(it))return null;var at=g$8({h:Number(et),s:Number(nt),l:Number(it),a:Number(ot)});return f$7(at)},"hsl"],[function(tt){var et=tt.h,nt=tt.s,it=tt.v,rt=tt.a,ot=rt===void 0?1:rt;if(!t$6(et)||!t$6(nt)||!t$6(it))return null;var at=function(st){return{h:u$5(st.h),s:e$5(st.s,0,100),v:e$5(st.v,0,100),a:e$5(st.a)}}({h:Number(et),s:Number(nt),v:Number(it),a:Number(ot)});return b$6(at)},"hsv"]]},N$1=function(tt,et){for(var nt=0;nt=.5},tt.prototype.toHex=function(){return et=o$1(this.rgba),nt=et.r,it=et.g,rt=et.b,at=(ot=et.a)<1?s$4(n$6(255*ot)):"","#"+s$4(nt)+s$4(it)+s$4(rt)+at;var et,nt,it,rt,ot,at},tt.prototype.toRgb=function(){return o$1(this.rgba)},tt.prototype.toRgbString=function(){return et=o$1(this.rgba),nt=et.r,it=et.g,rt=et.b,(ot=et.a)<1?"rgba("+nt+", "+it+", "+rt+", "+ot+")":"rgb("+nt+", "+it+", "+rt+")";var et,nt,it,rt,ot},tt.prototype.toHsl=function(){return d$5(c$7(this.rgba))},tt.prototype.toHslString=function(){return et=d$5(c$7(this.rgba)),nt=et.h,it=et.s,rt=et.l,(ot=et.a)<1?"hsla("+nt+", "+it+"%, "+rt+"%, "+ot+")":"hsl("+nt+", "+it+"%, "+rt+"%)";var et,nt,it,rt,ot},tt.prototype.toHsv=function(){return et=h$a(this.rgba),{h:n$6(et.h),s:n$6(et.s),v:n$6(et.v),a:n$6(et.a,3)};var et},tt.prototype.invert=function(){return w$6({r:255-(et=this.rgba).r,g:255-et.g,b:255-et.b,a:et.a});var et},tt.prototype.saturate=function(et){return et===void 0&&(et=.1),w$6(M$1(this.rgba,et))},tt.prototype.desaturate=function(et){return et===void 0&&(et=.1),w$6(M$1(this.rgba,-et))},tt.prototype.grayscale=function(){return w$6(M$1(this.rgba,-1))},tt.prototype.lighten=function(et){return et===void 0&&(et=.1),w$6($$2(this.rgba,et))},tt.prototype.darken=function(et){return et===void 0&&(et=.1),w$6($$2(this.rgba,-et))},tt.prototype.rotate=function(et){return et===void 0&&(et=15),this.hue(this.hue()+et)},tt.prototype.alpha=function(et){return typeof et=="number"?w$6({r:(nt=this.rgba).r,g:nt.g,b:nt.b,a:et}):n$6(this.rgba.a,3);var nt},tt.prototype.hue=function(et){var nt=c$7(this.rgba);return typeof et=="number"?w$6({h:et,s:nt.s,l:nt.l,a:nt.a}):n$6(nt.h)},tt.prototype.isEqual=function(et){return this.toHex()===w$6(et).toHex()},tt}(),w$6=function(tt){return tt instanceof j$2?tt:new j$2(tt)},S$2=[],k$9=function(tt){tt.forEach(function(et){S$2.indexOf(et)<0&&(et(j$2,y$7),S$2.push(et))})};function namesPlugin(tt,et){var nt={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},it={};for(var rt in nt)it[nt[rt]]=rt;var ot={};tt.prototype.toName=function(at){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var st,lt,ct=it[this.toHex()];if(ct)return ct;if(at!=null&&at.closest){var ut=this.toRgb(),ht=1/0,dt="black";if(!ot.length)for(var pt in nt)ot[pt]=new tt(nt[pt]).toRgb();for(var mt in nt){var gt=(st=ut,lt=ot[mt],Math.pow(st.r-lt.r,2)+Math.pow(st.g-lt.g,2)+Math.pow(st.b-lt.b,2));gt=0||(rt[nt]=tt[nt]);return rt}function i$6(tt){var et=reactExports.useRef(tt),nt=reactExports.useRef(function(it){et.current&&et.current(it)});return et.current=tt,nt.current}var s$3=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=1),tt>nt?nt:tt0:bt.buttons>0)&&rt.current?ot(d$4(rt.current,bt,st.current)):gt(!1)},mt=function(){return gt(!1)};function gt(bt){var yt=lt.current,wt=v$8(rt.current),vt=bt?wt.addEventListener:wt.removeEventListener;vt(yt?"touchmove":"mousemove",pt),vt(yt?"touchend":"mouseup",mt)}return[function(bt){var yt=bt.nativeEvent,wt=rt.current;if(wt&&(h$9(yt),!function(xt,St){return St&&!f$6(xt)}(yt,lt.current)&&wt)){if(f$6(yt)){lt.current=!0;var vt=yt.changedTouches||[];vt.length&&(st.current=vt[0].identifier)}wt.focus(),ot(d$4(wt,yt,st.current)),gt(!0)}},function(bt){var yt=bt.which||bt.keyCode;yt<37||yt>40||(bt.preventDefault(),at({left:yt===39?.05:yt===37?-.05:0,top:yt===40?.05:yt===38?-.05:0}))},gt]},[at,ot]),ut=ct[0],ht=ct[1],dt=ct[2];return reactExports.useEffect(function(){return dt},[dt]),React$1.createElement("div",u$4({},it,{onTouchStart:ut,onMouseDown:ut,className:"react-colorful__interactive",ref:rt,onKeyDown:ht,tabIndex:0,role:"slider"}))}),g$7=function(tt){return tt.filter(Boolean).join(" ")},p$6=function(tt){var et=tt.color,nt=tt.left,it=tt.top,rt=it===void 0?.5:it,ot=g$7(["react-colorful__pointer",tt.className]);return React$1.createElement("div",{className:ot,style:{top:100*rt+"%",left:100*nt+"%"}},React$1.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:et}}))},b$5=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=Math.pow(10,et)),Math.round(nt*tt)/nt},y$6=function(tt){var et=tt.s,nt=tt.v,it=tt.a,rt=(200-et)*nt/100;return{h:b$5(tt.h),s:b$5(rt>0&&rt<200?et*nt/100/(rt<=100?rt:200-rt)*100:0),l:b$5(rt/2),a:b$5(it,2)}},q$6=function(tt){var et=y$6(tt);return"hsl("+et.h+", "+et.s+"%, "+et.l+"%)"},k$8=function(tt){var et=y$6(tt);return"hsla("+et.h+", "+et.s+"%, "+et.l+"%, "+et.a+")"},I$1=function(tt){var et=tt.h,nt=tt.s,it=tt.v,rt=tt.a;et=et/360*6,nt/=100,it/=100;var ot=Math.floor(et),at=it*(1-nt),st=it*(1-(et-ot)*nt),lt=it*(1-(1-et+ot)*nt),ct=ot%6;return{r:b$5(255*[it,st,at,at,lt,it][ct]),g:b$5(255*[lt,it,it,st,at,at][ct]),b:b$5(255*[at,at,lt,it,it,st][ct]),a:b$5(rt,2)}},L$1=function(tt){var et=tt.r,nt=tt.g,it=tt.b,rt=tt.a,ot=Math.max(et,nt,it),at=ot-Math.min(et,nt,it),st=at?ot===et?(nt-it)/at:ot===nt?2+(it-et)/at:4+(et-nt)/at:0;return{h:b$5(60*(st<0?st+6:st)),s:b$5(ot?at/ot*100:0),v:b$5(ot/255*100),a:rt}},S$1=React$1.memo(function(tt){var et=tt.hue,nt=tt.onChange,it=g$7(["react-colorful__hue",tt.className]);return React$1.createElement("div",{className:it},React$1.createElement(m$6,{onMove:function(rt){nt({h:360*rt.left})},onKey:function(rt){nt({h:s$3(et+360*rt.left,0,360)})},"aria-label":"Hue","aria-valuenow":b$5(et),"aria-valuemax":"360","aria-valuemin":"0"},React$1.createElement(p$6,{className:"react-colorful__hue-pointer",left:et/360,color:q$6({h:et,s:100,v:100,a:1})})))}),T$1=React$1.memo(function(tt){var et=tt.hsva,nt=tt.onChange,it={backgroundColor:q$6({h:et.h,s:100,v:100,a:1})};return React$1.createElement("div",{className:"react-colorful__saturation",style:it},React$1.createElement(m$6,{onMove:function(rt){nt({s:100*rt.left,v:100-100*rt.top})},onKey:function(rt){nt({s:s$3(et.s+100*rt.left,0,100),v:s$3(et.v-100*rt.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+b$5(et.s)+"%, Brightness "+b$5(et.v)+"%"},React$1.createElement(p$6,{className:"react-colorful__saturation-pointer",top:1-et.v/100,left:et.s/100,color:q$6(et)})))}),F$1=function(tt,et){if(tt===et)return!0;for(var nt in tt)if(tt[nt]!==et[nt])return!1;return!0};function Y$1(tt,et,nt){var it=i$6(nt),rt=reactExports.useState(function(){return tt.toHsva(et)}),ot=rt[0],at=rt[1],st=reactExports.useRef({color:et,hsva:ot});reactExports.useEffect(function(){if(!tt.equal(et,st.current.color)){var ct=tt.toHsva(et);st.current={hsva:ct,color:et},at(ct)}},[et,tt]),reactExports.useEffect(function(){var ct;F$1(ot,st.current.hsva)||tt.equal(ct=tt.fromHsva(ot),st.current.color)||(st.current={hsva:ot,color:ct},it(ct))},[ot,tt,it]);var lt=reactExports.useCallback(function(ct){at(function(ut){return Object.assign({},ut,ct)})},[]);return[ot,lt]}var V$1=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,$$1=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J$1=new Map,Q$1=function(tt){V$1(function(){var et=tt.current?tt.current.ownerDocument:document;if(et!==void 0&&!J$1.has(et)){var nt=et.createElement("style");nt.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J$1.set(et,nt);var it=$$1();it&&nt.setAttribute("nonce",it),et.head.appendChild(nt)}},[])},U$1=function(tt){var et=tt.className,nt=tt.colorModel,it=tt.color,rt=it===void 0?nt.defaultColor:it,ot=tt.onChange,at=c$6(tt,["className","colorModel","color","onChange"]),st=reactExports.useRef(null);Q$1(st);var lt=Y$1(nt,rt,ot),ct=lt[0],ut=lt[1],ht=g$7(["react-colorful",et]);return React$1.createElement("div",u$4({},at,{ref:st,className:ht}),React$1.createElement(T$1,{hsva:ct,onChange:ut}),React$1.createElement(S$1,{hue:ct.h,onChange:ut,className:"react-colorful__last-control"}))},ee$1=function(tt){var et=tt.className,nt=tt.hsva,it=tt.onChange,rt={backgroundImage:"linear-gradient(90deg, "+k$8(Object.assign({},nt,{a:0}))+", "+k$8(Object.assign({},nt,{a:1}))+")"},ot=g$7(["react-colorful__alpha",et]),at=b$5(100*nt.a);return React$1.createElement("div",{className:ot},React$1.createElement("div",{className:"react-colorful__alpha-gradient",style:rt}),React$1.createElement(m$6,{onMove:function(st){it({a:st.left})},onKey:function(st){it({a:s$3(nt.a+st.left)})},"aria-label":"Alpha","aria-valuetext":at+"%","aria-valuenow":at,"aria-valuemin":"0","aria-valuemax":"100"},React$1.createElement(p$6,{className:"react-colorful__alpha-pointer",left:nt.a,color:k$8(nt)})))},re$4=function(tt){var et=tt.className,nt=tt.colorModel,it=tt.color,rt=it===void 0?nt.defaultColor:it,ot=tt.onChange,at=c$6(tt,["className","colorModel","color","onChange"]),st=reactExports.useRef(null);Q$1(st);var lt=Y$1(nt,rt,ot),ct=lt[0],ut=lt[1],ht=g$7(["react-colorful",et]);return React$1.createElement("div",u$4({},at,{ref:st,className:ht}),React$1.createElement(T$1,{hsva:ct,onChange:ut}),React$1.createElement(S$1,{hue:ct.h,onChange:ut}),React$1.createElement(ee$1,{hsva:ct,onChange:ut,className:"react-colorful__last-control"}))},xe$1={defaultColor:{r:0,g:0,b:0,a:1},toHsva:L$1,fromHsva:I$1,equal:F$1},Ce=function(tt){return React$1.createElement(re$4,u$4({},tt,{colorModel:xe$1}))},Me$1={defaultColor:{r:0,g:0,b:0},toHsva:function(tt){return L$1({r:tt.r,g:tt.g,b:tt.b,a:1})},fromHsva:function(tt){return{r:(et=I$1(tt)).r,g:et.g,b:et.b};var et},equal:F$1},Ne$1=function(tt){return React$1.createElement(U$1,u$4({},tt,{colorModel:Me$1}))},propTypes$1={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function tt(it,rt,ot,at,st,lt){if(lt!==ReactPropTypesSecret){var ct=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 ct.name="Invariant Violation",ct}}tt.isRequired=tt;function et(){return tt}var nt={array:tt,bigint:tt,bool:tt,func:tt,number:tt,object:tt,string:tt,symbol:tt,any:tt,arrayOf:et,element:tt,elementType:tt,instanceOf:et,node:tt,objectOf:et,oneOf:et,oneOfType:et,shape:et,exact:et,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return nt.PropTypes=nt,nt};propTypes$1.exports=factoryWithThrowingShims();var propTypesExports=propTypes$1.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function __decorate(tt,et,nt,it){var rt=arguments.length,ot=rt<3?et:it===null?it=Object.getOwnPropertyDescriptor(et,nt):it,at;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ot=Reflect.decorate(tt,et,nt,it);else for(var st=tt.length-1;st>=0;st--)(at=tt[st])&&(ot=(rt<3?at(ot):rt>3?at(et,nt,ot):at(et,nt))||ot);return rt>3&&ot&&Object.defineProperty(et,nt,ot),ot}function __awaiter(tt,et,nt,it){function rt(ot){return ot instanceof nt?ot:new nt(function(at){at(ot)})}return new(nt||(nt=Promise))(function(ot,at){function st(ut){try{ct(it.next(ut))}catch(ht){at(ht)}}function lt(ut){try{ct(it.throw(ut))}catch(ht){at(ht)}}function ct(ut){ut.done?ot(ut.value):rt(ut.value).then(st,lt)}ct((it=it.apply(tt,et||[])).next())})}function __generator(tt,et){var nt={label:0,sent:function(){if(ot[0]&1)throw ot[1];return ot[1]},trys:[],ops:[]},it,rt,ot,at;return at={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(at[Symbol.iterator]=function(){return this}),at;function st(ct){return function(ut){return lt([ct,ut])}}function lt(ct){if(it)throw new TypeError("Generator is already executing.");for(;at&&(at=0,ct[0]&&(nt=0)),nt;)try{if(it=1,rt&&(ot=ct[0]&2?rt.return:ct[0]?rt.throw||((ot=rt.return)&&ot.call(rt),0):rt.next)&&!(ot=ot.call(rt,ct[1])).done)return ot;switch(rt=0,ot&&(ct=[ct[0]&2,ot.value]),ct[0]){case 0:case 1:ot=ct;break;case 4:return nt.label++,{value:ct[1],done:!1};case 5:nt.label++,rt=ct[1],ct=[0];continue;case 7:ct=nt.ops.pop(),nt.trys.pop();continue;default:if(ot=nt.trys,!(ot=ot.length>0&&ot[ot.length-1])&&(ct[0]===6||ct[0]===2)){nt=0;continue}if(ct[0]===3&&(!ot||ct[1]>ot[0]&&ct[1]0)&&!(rt=it.next()).done;)ot.push(rt.value)}catch(st){at={error:st}}finally{try{rt&&!rt.done&&(nt=it.return)&&nt.call(it)}finally{if(at)throw at.error}}return ot}function __spread(){for(var tt=[],et=0;et0?it:tt.name,writable:!1,configurable:!1,enumerable:!0})}return nt}function withMimeType(tt){var et=tt.name,nt=et&&et.lastIndexOf(".")!==-1;if(nt&&!tt.type){var it=et.split(".").pop().toLowerCase(),rt=COMMON_MIME_TYPES.get(it);rt&&Object.defineProperty(tt,"type",{value:rt,writable:!1,configurable:!1,enumerable:!0})}return tt}var FILES_TO_IGNORE=[".DS_Store","Thumbs.db"];function fromEvent(tt){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(et){return isObject$s(tt)&&isDataTransfer(tt)?[2,getDataTransferFiles(tt.dataTransfer,tt.type)]:isChangeEvt(tt)?[2,getInputFiles(tt)]:Array.isArray(tt)&&tt.every(function(nt){return"getFile"in nt&&typeof nt.getFile=="function"})?[2,getFsHandleFiles(tt)]:[2,[]]})})}function isDataTransfer(tt){return isObject$s(tt.dataTransfer)}function isChangeEvt(tt){return isObject$s(tt)&&isObject$s(tt.target)}function isObject$s(tt){return typeof tt=="object"&&tt!==null}function getInputFiles(tt){return fromList(tt.target.files).map(function(et){return toFileWithPath(et)})}function getFsHandleFiles(tt){return __awaiter(this,void 0,void 0,function(){var et;return __generator(this,function(nt){switch(nt.label){case 0:return[4,Promise.all(tt.map(function(it){return it.getFile()}))];case 1:return et=nt.sent(),[2,et.map(function(it){return toFileWithPath(it)})]}})})}function getDataTransferFiles(tt,et){return __awaiter(this,void 0,void 0,function(){var nt,it;return __generator(this,function(rt){switch(rt.label){case 0:return tt===null?[2,[]]:tt.items?(nt=fromList(tt.items).filter(function(ot){return ot.kind==="file"}),et!=="drop"?[2,nt]:[4,Promise.all(nt.map(toFilePromises))]):[3,2];case 1:return it=rt.sent(),[2,noIgnoredFiles(flatten$1(it))];case 2:return[2,noIgnoredFiles(fromList(tt.files).map(function(ot){return toFileWithPath(ot)}))]}})})}function noIgnoredFiles(tt){return tt.filter(function(et){return FILES_TO_IGNORE.indexOf(et.name)===-1})}function fromList(tt){if(tt===null)return[];for(var et=[],nt=0;nttt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);ntnt)return[!1,getTooLargeRejectionErr(nt)];if(tt.sizent)return[!1,getTooLargeRejectionErr(nt)]}return[!0,null]}function isDefined$1(tt){return tt!=null}function allFilesAccepted(tt){var et=tt.files,nt=tt.accept,it=tt.minSize,rt=tt.maxSize,ot=tt.multiple,at=tt.maxFiles;return!ot&&et.length>1||ot&&at>=1&&et.length>at?!1:et.every(function(st){var lt=fileAccepted(st,nt),ct=_slicedToArray$e(lt,1),ut=ct[0],ht=fileMatchSize(st,it,rt),dt=_slicedToArray$e(ht,1),pt=dt[0];return ut&&pt})}function isPropagationStopped(tt){return typeof tt.isPropagationStopped=="function"?tt.isPropagationStopped():typeof tt.cancelBubble<"u"?tt.cancelBubble:!1}function isEvtWithFiles(tt){return tt.dataTransfer?Array.prototype.some.call(tt.dataTransfer.types,function(et){return et==="Files"||et==="application/x-moz-file"}):!!tt.target&&!!tt.target.files}function onDocumentDragOver(tt){tt.preventDefault()}function isIe(tt){return tt.indexOf("MSIE")!==-1||tt.indexOf("Trident/")!==-1}function isEdge$1(tt){return tt.indexOf("Edge/")!==-1}function isIeOrEdge(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return isIe(tt)||isEdge$1(tt)}function composeEventHandlers(){for(var tt=arguments.length,et=new Array(tt),nt=0;nt1?rt-1:0),at=1;attt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$n(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var Dropzone=reactExports.forwardRef(function(tt,et){var nt=tt.children,it=_objectWithoutProperties$k(tt,_excluded$1g),rt=useDropzone(it),ot=rt.open,at=_objectWithoutProperties$k(rt,_excluded2$b);return reactExports.useImperativeHandle(et,function(){return{open:ot}},[ot]),React$1.createElement(reactExports.Fragment,null,nt(_objectSpread$B(_objectSpread$B({},at),{},{open:ot})))});Dropzone.displayName="Dropzone";var defaultProps$7={disabled:!1,getFilesFromEvent:fromEvent,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};Dropzone.defaultProps=defaultProps$7;Dropzone.propTypes={children:PropTypes.func,accept:PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),multiple:PropTypes.bool,preventDropOnDocument:PropTypes.bool,noClick:PropTypes.bool,noKeyboard:PropTypes.bool,noDrag:PropTypes.bool,noDragEventsBubbling:PropTypes.bool,minSize:PropTypes.number,maxSize:PropTypes.number,maxFiles:PropTypes.number,disabled:PropTypes.bool,getFilesFromEvent:PropTypes.func,onFileDialogCancel:PropTypes.func,onFileDialogOpen:PropTypes.func,useFsAccessApi:PropTypes.bool,onDragEnter:PropTypes.func,onDragLeave:PropTypes.func,onDragOver:PropTypes.func,onDrop:PropTypes.func,onDropAccepted:PropTypes.func,onDropRejected:PropTypes.func,validator:PropTypes.func};var initialState$1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function useDropzone(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},et=_objectSpread$B(_objectSpread$B({},defaultProps$7),tt),nt=et.accept,it=et.disabled,rt=et.getFilesFromEvent,ot=et.maxSize,at=et.minSize,st=et.multiple,lt=et.maxFiles,ct=et.onDragEnter,ut=et.onDragLeave,ht=et.onDragOver,dt=et.onDrop,pt=et.onDropAccepted,mt=et.onDropRejected,gt=et.onFileDialogCancel,bt=et.onFileDialogOpen,yt=et.useFsAccessApi,wt=et.preventDropOnDocument,vt=et.noClick,xt=et.noKeyboard,St=et.noDrag,Et=et.noDragEventsBubbling,It=et.validator,Tt=reactExports.useMemo(function(){return typeof bt=="function"?bt:noop$9},[bt]),$t=reactExports.useMemo(function(){return typeof gt=="function"?gt:noop$9},[gt]),Ut=reactExports.useRef(null),Lt=reactExports.useRef(null),Bt=reactExports.useReducer(reducer,initialState$1),Pt=_slicedToArray$d(Bt,2),kt=Pt[0],At=Pt[1],Rt=kt.isFocused,Wt=kt.isFileDialogActive,jt=kt.draggedFiles,Ot=reactExports.useRef(typeof window<"u"&&window.isSecureContext&&yt&&canUseFileSystemAccessAPI()),Ct=function(){!Ot.current&&Wt&&setTimeout(function(){if(Lt.current){var cn=Lt.current.files;cn.length||(At({type:"closeDialog"}),$t())}},300)};reactExports.useEffect(function(){return window.addEventListener("focus",Ct,!1),function(){window.removeEventListener("focus",Ct,!1)}},[Lt,Wt,$t,Ot]);var Dt=reactExports.useRef([]),Mt=function(cn){Ut.current&&Ut.current.contains(cn.target)||(cn.preventDefault(),Dt.current=[])};reactExports.useEffect(function(){return wt&&(document.addEventListener("dragover",onDocumentDragOver,!1),document.addEventListener("drop",Mt,!1)),function(){wt&&(document.removeEventListener("dragover",onDocumentDragOver),document.removeEventListener("drop",Mt))}},[Ut,wt]);var Vt=reactExports.useCallback(function(dn){dn.preventDefault(),dn.persist(),jn(dn),Dt.current=[].concat(_toConsumableArray$c(Dt.current),[dn.target]),isEvtWithFiles(dn)&&Promise.resolve(rt(dn)).then(function(cn){isPropagationStopped(dn)&&!Et||(At({draggedFiles:cn,isDragActive:!0,type:"setDraggedFiles"}),ct&&ct(dn))})},[rt,ct,Et]),Qt=reactExports.useCallback(function(dn){dn.preventDefault(),dn.persist(),jn(dn);var cn=isEvtWithFiles(dn);if(cn&&dn.dataTransfer)try{dn.dataTransfer.dropEffect="copy"}catch{}return cn&&ht&&ht(dn),!1},[ht,Et]),rn=reactExports.useCallback(function(dn){dn.preventDefault(),dn.persist(),jn(dn);var cn=Dt.current.filter(function($n){return Ut.current&&Ut.current.contains($n)}),hn=cn.indexOf(dn.target);hn!==-1&&cn.splice(hn,1),Dt.current=cn,!(cn.length>0)&&(At({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),isEvtWithFiles(dn)&&ut&&ut(dn))},[Ut,ut,Et]),Xt=reactExports.useCallback(function(dn,cn){var hn=[],$n=[];dn.forEach(function(nn){var Kt=fileAccepted(nn,nt),Yt=_slicedToArray$d(Kt,2),_n=Yt[0],Mn=Yt[1],Bn=fileMatchSize(nn,at,ot),Nn=_slicedToArray$d(Bn,2),qn=Nn[0],Wn=Nn[1],Vn=It?It(nn):null;if(_n&&qn&&!Vn)hn.push(nn);else{var Fn=[Mn,Wn];Vn&&(Fn=Fn.concat(Vn)),$n.push({file:nn,errors:Fn.filter(function(Jn){return Jn})})}}),(!st&&hn.length>1||st&<>=1&&hn.length>lt)&&(hn.forEach(function(nn){$n.push({file:nn,errors:[TOO_MANY_FILES_REJECTION]})}),hn.splice(0)),At({acceptedFiles:hn,fileRejections:$n,type:"setFiles"}),dt&&dt(hn,$n,cn),$n.length>0&&mt&&mt($n,cn),hn.length>0&&pt&&pt(hn,cn)},[At,st,nt,at,ot,lt,dt,pt,mt,It]),an=reactExports.useCallback(function(dn){dn.preventDefault(),dn.persist(),jn(dn),Dt.current=[],isEvtWithFiles(dn)&&Promise.resolve(rt(dn)).then(function(cn){isPropagationStopped(dn)&&!Et||Xt(cn,dn)}),At({type:"reset"})},[rt,Xt,Et]),tn=reactExports.useCallback(function(){if(Ot.current){At({type:"openDialog"}),Tt();var dn={multiple:st,types:filePickerOptionsTypes(nt)};window.showOpenFilePicker(dn).then(function(cn){return rt(cn)}).then(function(cn){Xt(cn,null),At({type:"closeDialog"})}).catch(function(cn){isAbort(cn)?($t(cn),At({type:"closeDialog"})):isSecurityError(cn)&&(Ot.current=!1,Lt.current&&(Lt.current.value=null,Lt.current.click()))});return}Lt.current&&(At({type:"openDialog"}),Tt(),Lt.current.value=null,Lt.current.click())},[At,Tt,$t,yt,Xt,nt,st]),pn=reactExports.useCallback(function(dn){!Ut.current||!Ut.current.isEqualNode(dn.target)||(dn.key===" "||dn.key==="Enter"||dn.keyCode===32||dn.keyCode===13)&&(dn.preventDefault(),tn())},[Ut,tn]),vn=reactExports.useCallback(function(){At({type:"focus"})},[]),sn=reactExports.useCallback(function(){At({type:"blur"})},[]),Zt=reactExports.useCallback(function(){vt||(isIeOrEdge()?setTimeout(tn,0):tn())},[vt,tn]),Sn=function(cn){return it?null:cn},Tn=function(cn){return xt?null:Sn(cn)},Cn=function(cn){return St?null:Sn(cn)},jn=function(cn){Et&&cn.stopPropagation()},Un=reactExports.useMemo(function(){return function(){var dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},cn=dn.refKey,hn=cn===void 0?"ref":cn,$n=dn.role,nn=dn.onKeyDown,Kt=dn.onFocus,Yt=dn.onBlur,_n=dn.onClick,Mn=dn.onDragEnter,Bn=dn.onDragOver,Nn=dn.onDragLeave,qn=dn.onDrop,Wn=_objectWithoutProperties$k(dn,_excluded3$2);return _objectSpread$B(_objectSpread$B(_defineProperty$G({onKeyDown:Tn(composeEventHandlers(nn,pn)),onFocus:Tn(composeEventHandlers(Kt,vn)),onBlur:Tn(composeEventHandlers(Yt,sn)),onClick:Sn(composeEventHandlers(_n,Zt)),onDragEnter:Cn(composeEventHandlers(Mn,Vt)),onDragOver:Cn(composeEventHandlers(Bn,Qt)),onDragLeave:Cn(composeEventHandlers(Nn,rn)),onDrop:Cn(composeEventHandlers(qn,an)),role:typeof $n=="string"&&$n!==""?$n:"button"},hn,Ut),!it&&!xt?{tabIndex:0}:{}),Wn)}},[Ut,pn,vn,sn,Zt,Vt,Qt,rn,an,xt,St,it]),yn=reactExports.useCallback(function(dn){dn.stopPropagation()},[]),un=reactExports.useMemo(function(){return function(){var dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},cn=dn.refKey,hn=cn===void 0?"ref":cn,$n=dn.onChange,nn=dn.onClick,Kt=_objectWithoutProperties$k(dn,_excluded4),Yt=_defineProperty$G({accept:nt,multiple:st,type:"file",style:{display:"none"},onChange:Sn(composeEventHandlers($n,an)),onClick:Sn(composeEventHandlers(nn,yn)),tabIndex:-1},hn,Lt);return _objectSpread$B(_objectSpread$B({},Yt),Kt)}},[Lt,nt,st,an,it]),En=jt.length,In=En>0&&allFilesAccepted({files:jt,accept:nt,minSize:at,maxSize:ot,multiple:st,maxFiles:lt}),xn=En>0&&!In;return _objectSpread$B(_objectSpread$B({},kt),{},{isDragAccept:In,isDragReject:xn,isFocused:Rt&&!it,getRootProps:Un,getInputProps:un,rootRef:Ut,inputRef:Lt,open:Sn(tn)})}function reducer(tt,et){switch(et.type){case"focus":return _objectSpread$B(_objectSpread$B({},tt),{},{isFocused:!0});case"blur":return _objectSpread$B(_objectSpread$B({},tt),{},{isFocused:!1});case"openDialog":return _objectSpread$B(_objectSpread$B({},initialState$1),{},{isFileDialogActive:!0});case"closeDialog":return _objectSpread$B(_objectSpread$B({},tt),{},{isFileDialogActive:!1});case"setDraggedFiles":var nt=et.isDragActive,it=et.draggedFiles;return _objectSpread$B(_objectSpread$B({},tt),{},{draggedFiles:it,isDragActive:nt});case"setFiles":return _objectSpread$B(_objectSpread$B({},tt),{},{acceptedFiles:et.acceptedFiles,fileRejections:et.fileRejections});case"reset":return _objectSpread$B({},initialState$1);default:return tt}}function noop$9(){}function createStore$4(tt){let et;const nt=new Set,it=(ct,ut)=>{const ht=typeof ct=="function"?ct(et):ct;if(ht!==et){const dt=et;et=ut?ht:Object.assign({},et,ht),nt.forEach(pt=>pt(et,dt))}},rt=()=>et,ot=(ct,ut=rt,ht=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let dt=ut(et);function pt(){const mt=ut(et);if(!ht(dt,mt)){const gt=dt;ct(dt=mt,gt)}}return nt.add(pt),()=>nt.delete(pt)},lt={setState:it,getState:rt,subscribe:(ct,ut,ht)=>ut||ht?ot(ct,ut,ht):(nt.add(ct),()=>nt.delete(ct)),destroy:()=>nt.clear()};return et=tt(it,rt,lt),lt}const isSSR$2=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),useIsomorphicLayoutEffect$3=isSSR$2?reactExports.useEffect:reactExports.useLayoutEffect;function create$8(tt){const et=typeof tt=="function"?createStore$4(tt):tt,nt=(it=et.getState,rt=Object.is)=>{const[,ot]=reactExports.useReducer(bt=>bt+1,0),at=et.getState(),st=reactExports.useRef(at),lt=reactExports.useRef(it),ct=reactExports.useRef(rt),ut=reactExports.useRef(!1),ht=reactExports.useRef();ht.current===void 0&&(ht.current=it(at));let dt,pt=!1;(st.current!==at||lt.current!==it||ct.current!==rt||ut.current)&&(dt=it(at),pt=!rt(ht.current,dt)),useIsomorphicLayoutEffect$3(()=>{pt&&(ht.current=dt),st.current=at,lt.current=it,ct.current=rt,ut.current=!1});const mt=reactExports.useRef(at);useIsomorphicLayoutEffect$3(()=>{const bt=()=>{try{const wt=et.getState(),vt=lt.current(wt);ct.current(ht.current,vt)||(st.current=wt,ht.current=vt,ot())}catch{ut.current=!0,ot()}},yt=et.subscribe(bt);return et.getState()!==mt.current&&bt(),yt},[]);const gt=pt?dt:ht.current;return reactExports.useDebugValue(gt),gt};return Object.assign(nt,et),nt[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const it=[nt,et];return{next(){const rt=it.length<=0;return{value:it.shift(),done:rt}}}},nt}const subscribeWithSelector=tt=>(et,nt,it)=>{const rt=it.subscribe;return it.subscribe=(at,st,lt)=>{let ct=at;if(st){const ut=(lt==null?void 0:lt.equalityFn)||Object.is;let ht=at(it.getState());ct=dt=>{const pt=at(dt);if(!ut(ht,pt)){const mt=ht;st(ht=pt,mt)}},lt!=null&<.fireImmediately&&st(ht,ht)}return rt(ct)},tt(et,nt,it)};/*! +`+ot.stack}return{value:tt,source:et,stack:rt,digest:null}}function Li(tt,et,nt){return{value:tt,source:null,stack:nt??null,digest:et??null}}function Mi(tt,et){try{console.error(et.value)}catch(nt){setTimeout(function(){throw nt})}}var Ni=typeof WeakMap=="function"?WeakMap:Map;function Oi(tt,et,nt){nt=ch$1(-1,nt),nt.tag=3,nt.payload={element:null};var it=et.value;return nt.callback=function(){Pi$1||(Pi$1=!0,Qi=it),Mi(tt,et)},nt}function Ri(tt,et,nt){nt=ch$1(-1,nt),nt.tag=3;var it=tt.type.getDerivedStateFromError;if(typeof it=="function"){var rt=et.value;nt.payload=function(){return it(rt)},nt.callback=function(){Mi(tt,et)}}var ot=tt.stateNode;return ot!==null&&typeof ot.componentDidCatch=="function"&&(nt.callback=function(){Mi(tt,et),typeof it!="function"&&(Si===null?Si=new Set([this]):Si.add(this));var at=et.stack;this.componentDidCatch(et.value,{componentStack:at!==null?at:""})}),nt}function Ti(tt,et,nt){var it=tt.pingCache;if(it===null){it=tt.pingCache=new Ni;var rt=new Set;it.set(et,rt)}else rt=it.get(et),rt===void 0&&(rt=new Set,it.set(et,rt));rt.has(nt)||(rt.add(nt),tt=Ui.bind(null,tt,et,nt),et.then(tt,tt))}function Vi(tt){do{var et;if((et=tt.tag===13)&&(et=tt.memoizedState,et=et!==null?et.dehydrated!==null:!0),et)return tt;tt=tt.return}while(tt!==null);return null}function Wi(tt,et,nt,it,rt){return tt.mode&1?(tt.flags|=65536,tt.lanes=rt,tt):(tt===et?tt.flags|=65536:(tt.flags|=128,nt.flags|=131072,nt.flags&=-52805,nt.tag===1&&(nt.alternate===null?nt.tag=17:(et=ch$1(-1,1),et.tag=2,dh$1(nt,et,1))),nt.lanes|=1),tt)}var Xi=ua.ReactCurrentOwner,Ug=!1;function Yi(tt,et,nt,it){et.child=tt===null?Ch$1(et,null,nt,it):Bh(et,tt.child,nt,it)}function Zi(tt,et,nt,it,rt){nt=nt.render;var ot=et.ref;return Tg(et,rt),it=Xh(tt,et,nt,it,ot,rt),nt=bi(),tt!==null&&!Ug?(et.updateQueue=tt.updateQueue,et.flags&=-2053,tt.lanes&=~rt,$i(tt,et,rt)):(I$4&&nt&&vg(et),et.flags|=1,Yi(tt,et,it,rt),et.child)}function aj(tt,et,nt,it,rt){if(tt===null){var ot=nt.type;return typeof ot=="function"&&!bj(ot)&&ot.defaultProps===void 0&&nt.compare===null&&nt.defaultProps===void 0?(et.tag=15,et.type=ot,cj(tt,et,ot,it,rt)):(tt=yh(nt.type,null,it,et,et.mode,rt),tt.ref=et.ref,tt.return=et,et.child=tt)}if(ot=tt.child,!(tt.lanes&rt)){var at=ot.memoizedProps;if(nt=nt.compare,nt=nt!==null?nt:Ie,nt(at,it)&&tt.ref===et.ref)return $i(tt,et,rt)}return et.flags|=1,tt=wh(ot,it),tt.ref=et.ref,tt.return=et,et.child=tt}function cj(tt,et,nt,it,rt){if(tt!==null){var ot=tt.memoizedProps;if(Ie(ot,it)&&tt.ref===et.ref)if(Ug=!1,et.pendingProps=it=ot,(tt.lanes&rt)!==0)tt.flags&131072&&(Ug=!0);else return et.lanes=tt.lanes,$i(tt,et,rt)}return dj(tt,et,nt,it,rt)}function ej(tt,et,nt){var it=et.pendingProps,rt=it.children,ot=tt!==null?tt.memoizedState:null;if(it.mode==="hidden")if(!(et.mode&1))et.memoizedState={baseLanes:0,cachePool:null,transitions:null},G$3(fj,gj),gj|=nt;else{if(!(nt&1073741824))return tt=ot!==null?ot.baseLanes|nt:nt,et.lanes=et.childLanes=1073741824,et.memoizedState={baseLanes:tt,cachePool:null,transitions:null},et.updateQueue=null,G$3(fj,gj),gj|=tt,null;et.memoizedState={baseLanes:0,cachePool:null,transitions:null},it=ot!==null?ot.baseLanes:nt,G$3(fj,gj),gj|=it}else ot!==null?(it=ot.baseLanes|nt,et.memoizedState=null):it=nt,G$3(fj,gj),gj|=it;return Yi(tt,et,rt,nt),et.child}function hj(tt,et){var nt=et.ref;(tt===null&&nt!==null||tt!==null&&tt.ref!==nt)&&(et.flags|=512,et.flags|=2097152)}function dj(tt,et,nt,it,rt){var ot=Zf(nt)?Xf:H$3.current;return ot=Yf(et,ot),Tg(et,rt),nt=Xh(tt,et,nt,it,ot,rt),it=bi(),tt!==null&&!Ug?(et.updateQueue=tt.updateQueue,et.flags&=-2053,tt.lanes&=~rt,$i(tt,et,rt)):(I$4&&it&&vg(et),et.flags|=1,Yi(tt,et,nt,rt),et.child)}function ij(tt,et,nt,it,rt){if(Zf(nt)){var ot=!0;cg(et)}else ot=!1;if(Tg(et,rt),et.stateNode===null)jj(tt,et),ph(et,nt,it),rh$1(et,nt,it,rt),it=!0;else if(tt===null){var at=et.stateNode,st=et.memoizedProps;at.props=st;var lt=at.context,ct=nt.contextType;typeof ct=="object"&&ct!==null?ct=Vg(ct):(ct=Zf(nt)?Xf:H$3.current,ct=Yf(et,ct));var ut=nt.getDerivedStateFromProps,ht=typeof ut=="function"||typeof at.getSnapshotBeforeUpdate=="function";ht||typeof at.UNSAFE_componentWillReceiveProps!="function"&&typeof at.componentWillReceiveProps!="function"||(st!==it||lt!==ct)&&qh(et,at,it,ct),$g=!1;var dt=et.memoizedState;at.state=dt,gh(et,it,at,rt),lt=et.memoizedState,st!==it||dt!==lt||Wf.current||$g?(typeof ut=="function"&&(kh(et,nt,ut,it),lt=et.memoizedState),(st=$g||oh(et,nt,st,it,dt,lt,ct))?(ht||typeof at.UNSAFE_componentWillMount!="function"&&typeof at.componentWillMount!="function"||(typeof at.componentWillMount=="function"&&at.componentWillMount(),typeof at.UNSAFE_componentWillMount=="function"&&at.UNSAFE_componentWillMount()),typeof at.componentDidMount=="function"&&(et.flags|=4194308)):(typeof at.componentDidMount=="function"&&(et.flags|=4194308),et.memoizedProps=it,et.memoizedState=lt),at.props=it,at.state=lt,at.context=ct,it=st):(typeof at.componentDidMount=="function"&&(et.flags|=4194308),it=!1)}else{at=et.stateNode,bh(tt,et),st=et.memoizedProps,ct=et.type===et.elementType?st:Lg(et.type,st),at.props=ct,ht=et.pendingProps,dt=at.context,lt=nt.contextType,typeof lt=="object"&<!==null?lt=Vg(lt):(lt=Zf(nt)?Xf:H$3.current,lt=Yf(et,lt));var pt=nt.getDerivedStateFromProps;(ut=typeof pt=="function"||typeof at.getSnapshotBeforeUpdate=="function")||typeof at.UNSAFE_componentWillReceiveProps!="function"&&typeof at.componentWillReceiveProps!="function"||(st!==ht||dt!==lt)&&qh(et,at,it,lt),$g=!1,dt=et.memoizedState,at.state=dt,gh(et,it,at,rt);var mt=et.memoizedState;st!==ht||dt!==mt||Wf.current||$g?(typeof pt=="function"&&(kh(et,nt,pt,it),mt=et.memoizedState),(ct=$g||oh(et,nt,ct,it,dt,mt,lt)||!1)?(ut||typeof at.UNSAFE_componentWillUpdate!="function"&&typeof at.componentWillUpdate!="function"||(typeof at.componentWillUpdate=="function"&&at.componentWillUpdate(it,mt,lt),typeof at.UNSAFE_componentWillUpdate=="function"&&at.UNSAFE_componentWillUpdate(it,mt,lt)),typeof at.componentDidUpdate=="function"&&(et.flags|=4),typeof at.getSnapshotBeforeUpdate=="function"&&(et.flags|=1024)):(typeof at.componentDidUpdate!="function"||st===tt.memoizedProps&&dt===tt.memoizedState||(et.flags|=4),typeof at.getSnapshotBeforeUpdate!="function"||st===tt.memoizedProps&&dt===tt.memoizedState||(et.flags|=1024),et.memoizedProps=it,et.memoizedState=mt),at.props=it,at.state=mt,at.context=lt,it=ct):(typeof at.componentDidUpdate!="function"||st===tt.memoizedProps&&dt===tt.memoizedState||(et.flags|=4),typeof at.getSnapshotBeforeUpdate!="function"||st===tt.memoizedProps&&dt===tt.memoizedState||(et.flags|=1024),it=!1)}return kj(tt,et,nt,it,ot,rt)}function kj(tt,et,nt,it,rt,ot){hj(tt,et);var at=(et.flags&128)!==0;if(!it&&!at)return rt&&dg(et,nt,!1),$i(tt,et,ot);it=et.stateNode,Xi.current=et;var st=at&&typeof nt.getDerivedStateFromError!="function"?null:it.render();return et.flags|=1,tt!==null&&at?(et.child=Bh(et,tt.child,null,ot),et.child=Bh(et,null,st,ot)):Yi(tt,et,st,ot),et.memoizedState=it.state,rt&&dg(et,nt,!0),et.child}function lj(tt){var et=tt.stateNode;et.pendingContext?ag(tt,et.pendingContext,et.pendingContext!==et.context):et.context&&ag(tt,et.context,!1),Ih(tt,et.containerInfo)}function mj(tt,et,nt,it,rt){return Ig(),Jg(rt),et.flags|=256,Yi(tt,et,nt,it),et.child}var nj={dehydrated:null,treeContext:null,retryLane:0};function oj(tt){return{baseLanes:tt,cachePool:null,transitions:null}}function pj(tt,et,nt){var it=et.pendingProps,rt=M$3.current,ot=!1,at=(et.flags&128)!==0,st;if((st=at)||(st=tt!==null&&tt.memoizedState===null?!1:(rt&2)!==0),st?(ot=!0,et.flags&=-129):(tt===null||tt.memoizedState!==null)&&(rt|=1),G$3(M$3,rt&1),tt===null)return Eg(et),tt=et.memoizedState,tt!==null&&(tt=tt.dehydrated,tt!==null)?(et.mode&1?tt.data==="$!"?et.lanes=8:et.lanes=1073741824:et.lanes=1,null):(at=it.children,tt=it.fallback,ot?(it=et.mode,ot=et.child,at={mode:"hidden",children:at},!(it&1)&&ot!==null?(ot.childLanes=0,ot.pendingProps=at):ot=qj(at,it,0,null),tt=Ah(tt,it,nt,null),ot.return=et,tt.return=et,ot.sibling=tt,et.child=ot,et.child.memoizedState=oj(nt),et.memoizedState=nj,tt):rj(et,at));if(rt=tt.memoizedState,rt!==null&&(st=rt.dehydrated,st!==null))return sj(tt,et,at,it,st,rt,nt);if(ot){ot=it.fallback,at=et.mode,rt=tt.child,st=rt.sibling;var lt={mode:"hidden",children:it.children};return!(at&1)&&et.child!==rt?(it=et.child,it.childLanes=0,it.pendingProps=lt,et.deletions=null):(it=wh(rt,lt),it.subtreeFlags=rt.subtreeFlags&14680064),st!==null?ot=wh(st,ot):(ot=Ah(ot,at,nt,null),ot.flags|=2),ot.return=et,it.return=et,it.sibling=ot,et.child=it,it=ot,ot=et.child,at=tt.child.memoizedState,at=at===null?oj(nt):{baseLanes:at.baseLanes|nt,cachePool:null,transitions:at.transitions},ot.memoizedState=at,ot.childLanes=tt.childLanes&~nt,et.memoizedState=nj,it}return ot=tt.child,tt=ot.sibling,it=wh(ot,{mode:"visible",children:it.children}),!(et.mode&1)&&(it.lanes=nt),it.return=et,it.sibling=null,tt!==null&&(nt=et.deletions,nt===null?(et.deletions=[tt],et.flags|=16):nt.push(tt)),et.child=it,et.memoizedState=null,it}function rj(tt,et){return et=qj({mode:"visible",children:et},tt.mode,0,null),et.return=tt,tt.child=et}function tj(tt,et,nt,it){return it!==null&&Jg(it),Bh(et,tt.child,null,nt),tt=rj(et,et.pendingProps.children),tt.flags|=2,et.memoizedState=null,tt}function sj(tt,et,nt,it,rt,ot,at){if(nt)return et.flags&256?(et.flags&=-257,it=Li(Error(p$9(422))),tj(tt,et,at,it)):et.memoizedState!==null?(et.child=tt.child,et.flags|=128,null):(ot=it.fallback,rt=et.mode,it=qj({mode:"visible",children:it.children},rt,0,null),ot=Ah(ot,rt,at,null),ot.flags|=2,it.return=et,ot.return=et,it.sibling=ot,et.child=it,et.mode&1&&Bh(et,tt.child,null,at),et.child.memoizedState=oj(at),et.memoizedState=nj,ot);if(!(et.mode&1))return tj(tt,et,at,null);if(rt.data==="$!"){if(it=rt.nextSibling&&rt.nextSibling.dataset,it)var st=it.dgst;return it=st,ot=Error(p$9(419)),it=Li(ot,it,void 0),tj(tt,et,at,it)}if(st=(at&tt.childLanes)!==0,Ug||st){if(it=R$2,it!==null){switch(at&-at){case 4:rt=2;break;case 16:rt=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:rt=32;break;case 536870912:rt=268435456;break;default:rt=0}rt=rt&(it.suspendedLanes|at)?0:rt,rt!==0&&rt!==ot.retryLane&&(ot.retryLane=rt,Zg(tt,rt),mh(it,tt,rt,-1))}return uj(),it=Li(Error(p$9(421))),tj(tt,et,at,it)}return rt.data==="$?"?(et.flags|=128,et.child=tt.child,et=vj.bind(null,tt),rt._reactRetry=et,null):(tt=ot.treeContext,yg=Lf(rt.nextSibling),xg=et,I$4=!0,zg=null,tt!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=tt.id,sg=tt.overflow,qg=et),et=rj(et,it.children),et.flags|=4096,et)}function wj(tt,et,nt){tt.lanes|=et;var it=tt.alternate;it!==null&&(it.lanes|=et),Sg(tt.return,et,nt)}function xj(tt,et,nt,it,rt){var ot=tt.memoizedState;ot===null?tt.memoizedState={isBackwards:et,rendering:null,renderingStartTime:0,last:it,tail:nt,tailMode:rt}:(ot.isBackwards=et,ot.rendering=null,ot.renderingStartTime=0,ot.last=it,ot.tail=nt,ot.tailMode=rt)}function yj(tt,et,nt){var it=et.pendingProps,rt=it.revealOrder,ot=it.tail;if(Yi(tt,et,it.children,nt),it=M$3.current,it&2)it=it&1|2,et.flags|=128;else{if(tt!==null&&tt.flags&128)e:for(tt=et.child;tt!==null;){if(tt.tag===13)tt.memoizedState!==null&&wj(tt,nt,et);else if(tt.tag===19)wj(tt,nt,et);else if(tt.child!==null){tt.child.return=tt,tt=tt.child;continue}if(tt===et)break e;for(;tt.sibling===null;){if(tt.return===null||tt.return===et)break e;tt=tt.return}tt.sibling.return=tt.return,tt=tt.sibling}it&=1}if(G$3(M$3,it),!(et.mode&1))et.memoizedState=null;else switch(rt){case"forwards":for(nt=et.child,rt=null;nt!==null;)tt=nt.alternate,tt!==null&&Mh(tt)===null&&(rt=nt),nt=nt.sibling;nt=rt,nt===null?(rt=et.child,et.child=null):(rt=nt.sibling,nt.sibling=null),xj(et,!1,rt,nt,ot);break;case"backwards":for(nt=null,rt=et.child,et.child=null;rt!==null;){if(tt=rt.alternate,tt!==null&&Mh(tt)===null){et.child=rt;break}tt=rt.sibling,rt.sibling=nt,nt=rt,rt=tt}xj(et,!0,nt,null,ot);break;case"together":xj(et,!1,null,null,void 0);break;default:et.memoizedState=null}return et.child}function jj(tt,et){!(et.mode&1)&&tt!==null&&(tt.alternate=null,et.alternate=null,et.flags|=2)}function $i(tt,et,nt){if(tt!==null&&(et.dependencies=tt.dependencies),hh|=et.lanes,!(nt&et.childLanes))return null;if(tt!==null&&et.child!==tt.child)throw Error(p$9(153));if(et.child!==null){for(tt=et.child,nt=wh(tt,tt.pendingProps),et.child=nt,nt.return=et;tt.sibling!==null;)tt=tt.sibling,nt=nt.sibling=wh(tt,tt.pendingProps),nt.return=et;nt.sibling=null}return et.child}function zj(tt,et,nt){switch(et.tag){case 3:lj(et),Ig();break;case 5:Kh$1(et);break;case 1:Zf(et.type)&&cg(et);break;case 4:Ih(et,et.stateNode.containerInfo);break;case 10:var it=et.type._context,rt=et.memoizedProps.value;G$3(Mg,it._currentValue),it._currentValue=rt;break;case 13:if(it=et.memoizedState,it!==null)return it.dehydrated!==null?(G$3(M$3,M$3.current&1),et.flags|=128,null):nt&et.child.childLanes?pj(tt,et,nt):(G$3(M$3,M$3.current&1),tt=$i(tt,et,nt),tt!==null?tt.sibling:null);G$3(M$3,M$3.current&1);break;case 19:if(it=(nt&et.childLanes)!==0,tt.flags&128){if(it)return yj(tt,et,nt);et.flags|=128}if(rt=et.memoizedState,rt!==null&&(rt.rendering=null,rt.tail=null,rt.lastEffect=null),G$3(M$3,M$3.current),it)break;return null;case 22:case 23:return et.lanes=0,ej(tt,et,nt)}return $i(tt,et,nt)}var Aj,Bj,Cj,Dj;Aj=function(tt,et){for(var nt=et.child;nt!==null;){if(nt.tag===5||nt.tag===6)tt.appendChild(nt.stateNode);else if(nt.tag!==4&&nt.child!==null){nt.child.return=nt,nt=nt.child;continue}if(nt===et)break;for(;nt.sibling===null;){if(nt.return===null||nt.return===et)return;nt=nt.return}nt.sibling.return=nt.return,nt=nt.sibling}};Bj=function(){};Cj=function(tt,et,nt,it){var rt=tt.memoizedProps;if(rt!==it){tt=et.stateNode,Hh(Eh.current);var ot=null;switch(nt){case"input":rt=Ya(tt,rt),it=Ya(tt,it),ot=[];break;case"select":rt=A$3({},rt,{value:void 0}),it=A$3({},it,{value:void 0}),ot=[];break;case"textarea":rt=gb(tt,rt),it=gb(tt,it),ot=[];break;default:typeof rt.onClick!="function"&&typeof it.onClick=="function"&&(tt.onclick=Bf)}ub(nt,it);var at;nt=null;for(ct in rt)if(!it.hasOwnProperty(ct)&&rt.hasOwnProperty(ct)&&rt[ct]!=null)if(ct==="style"){var st=rt[ct];for(at in st)st.hasOwnProperty(at)&&(nt||(nt={}),nt[at]="")}else ct!=="dangerouslySetInnerHTML"&&ct!=="children"&&ct!=="suppressContentEditableWarning"&&ct!=="suppressHydrationWarning"&&ct!=="autoFocus"&&(ea.hasOwnProperty(ct)?ot||(ot=[]):(ot=ot||[]).push(ct,null));for(ct in it){var lt=it[ct];if(st=rt!=null?rt[ct]:void 0,it.hasOwnProperty(ct)&<!==st&&(lt!=null||st!=null))if(ct==="style")if(st){for(at in st)!st.hasOwnProperty(at)||lt&<.hasOwnProperty(at)||(nt||(nt={}),nt[at]="");for(at in lt)lt.hasOwnProperty(at)&&st[at]!==lt[at]&&(nt||(nt={}),nt[at]=lt[at])}else nt||(ot||(ot=[]),ot.push(ct,nt)),nt=lt;else ct==="dangerouslySetInnerHTML"?(lt=lt?lt.__html:void 0,st=st?st.__html:void 0,lt!=null&&st!==lt&&(ot=ot||[]).push(ct,lt)):ct==="children"?typeof lt!="string"&&typeof lt!="number"||(ot=ot||[]).push(ct,""+lt):ct!=="suppressContentEditableWarning"&&ct!=="suppressHydrationWarning"&&(ea.hasOwnProperty(ct)?(lt!=null&&ct==="onScroll"&&D$2("scroll",tt),ot||st===lt||(ot=[])):(ot=ot||[]).push(ct,lt))}nt&&(ot=ot||[]).push("style",nt);var ct=ot;(et.updateQueue=ct)&&(et.flags|=4)}};Dj=function(tt,et,nt,it){nt!==it&&(et.flags|=4)};function Ej(tt,et){if(!I$4)switch(tt.tailMode){case"hidden":et=tt.tail;for(var nt=null;et!==null;)et.alternate!==null&&(nt=et),et=et.sibling;nt===null?tt.tail=null:nt.sibling=null;break;case"collapsed":nt=tt.tail;for(var it=null;nt!==null;)nt.alternate!==null&&(it=nt),nt=nt.sibling;it===null?et||tt.tail===null?tt.tail=null:tt.tail.sibling=null:it.sibling=null}}function S$4(tt){var et=tt.alternate!==null&&tt.alternate.child===tt.child,nt=0,it=0;if(et)for(var rt=tt.child;rt!==null;)nt|=rt.lanes|rt.childLanes,it|=rt.subtreeFlags&14680064,it|=rt.flags&14680064,rt.return=tt,rt=rt.sibling;else for(rt=tt.child;rt!==null;)nt|=rt.lanes|rt.childLanes,it|=rt.subtreeFlags,it|=rt.flags,rt.return=tt,rt=rt.sibling;return tt.subtreeFlags|=it,tt.childLanes=nt,et}function Fj(tt,et,nt){var it=et.pendingProps;switch(wg(et),et.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S$4(et),null;case 1:return Zf(et.type)&&$f(),S$4(et),null;case 3:return it=et.stateNode,Jh(),E$2(Wf),E$2(H$3),Oh(),it.pendingContext&&(it.context=it.pendingContext,it.pendingContext=null),(tt===null||tt.child===null)&&(Gg(et)?et.flags|=4:tt===null||tt.memoizedState.isDehydrated&&!(et.flags&256)||(et.flags|=1024,zg!==null&&(Gj(zg),zg=null))),Bj(tt,et),S$4(et),null;case 5:Lh(et);var rt=Hh(Gh.current);if(nt=et.type,tt!==null&&et.stateNode!=null)Cj(tt,et,nt,it,rt),tt.ref!==et.ref&&(et.flags|=512,et.flags|=2097152);else{if(!it){if(et.stateNode===null)throw Error(p$9(166));return S$4(et),null}if(tt=Hh(Eh.current),Gg(et)){it=et.stateNode,nt=et.type;var ot=et.memoizedProps;switch(it[Of]=et,it[Pf]=ot,tt=(et.mode&1)!==0,nt){case"dialog":D$2("cancel",it),D$2("close",it);break;case"iframe":case"object":case"embed":D$2("load",it);break;case"video":case"audio":for(rt=0;rt<\/script>",tt=tt.removeChild(tt.firstChild)):typeof it.is=="string"?tt=at.createElement(nt,{is:it.is}):(tt=at.createElement(nt),nt==="select"&&(at=tt,it.multiple?at.multiple=!0:it.size&&(at.size=it.size))):tt=at.createElementNS(tt,nt),tt[Of]=et,tt[Pf]=it,Aj(tt,et,!1,!1),et.stateNode=tt;e:{switch(at=vb(nt,it),nt){case"dialog":D$2("cancel",tt),D$2("close",tt),rt=it;break;case"iframe":case"object":case"embed":D$2("load",tt),rt=it;break;case"video":case"audio":for(rt=0;rtHj&&(et.flags|=128,it=!0,Ej(ot,!1),et.lanes=4194304)}else{if(!it)if(tt=Mh(at),tt!==null){if(et.flags|=128,it=!0,nt=tt.updateQueue,nt!==null&&(et.updateQueue=nt,et.flags|=4),Ej(ot,!0),ot.tail===null&&ot.tailMode==="hidden"&&!at.alternate&&!I$4)return S$4(et),null}else 2*B$2()-ot.renderingStartTime>Hj&&nt!==1073741824&&(et.flags|=128,it=!0,Ej(ot,!1),et.lanes=4194304);ot.isBackwards?(at.sibling=et.child,et.child=at):(nt=ot.last,nt!==null?nt.sibling=at:et.child=at,ot.last=at)}return ot.tail!==null?(et=ot.tail,ot.rendering=et,ot.tail=et.sibling,ot.renderingStartTime=B$2(),et.sibling=null,nt=M$3.current,G$3(M$3,it?nt&1|2:nt&1),et):(S$4(et),null);case 22:case 23:return Ij(),it=et.memoizedState!==null,tt!==null&&tt.memoizedState!==null!==it&&(et.flags|=8192),it&&et.mode&1?gj&1073741824&&(S$4(et),et.subtreeFlags&6&&(et.flags|=8192)):S$4(et),null;case 24:return null;case 25:return null}throw Error(p$9(156,et.tag))}function Jj(tt,et){switch(wg(et),et.tag){case 1:return Zf(et.type)&&$f(),tt=et.flags,tt&65536?(et.flags=tt&-65537|128,et):null;case 3:return Jh(),E$2(Wf),E$2(H$3),Oh(),tt=et.flags,tt&65536&&!(tt&128)?(et.flags=tt&-65537|128,et):null;case 5:return Lh(et),null;case 13:if(E$2(M$3),tt=et.memoizedState,tt!==null&&tt.dehydrated!==null){if(et.alternate===null)throw Error(p$9(340));Ig()}return tt=et.flags,tt&65536?(et.flags=tt&-65537|128,et):null;case 19:return E$2(M$3),null;case 4:return Jh(),null;case 10:return Rg(et.type._context),null;case 22:case 23:return Ij(),null;case 24:return null;default:return null}}var Kj=!1,U$3=!1,Lj=typeof WeakSet=="function"?WeakSet:Set,V$4=null;function Mj(tt,et){var nt=tt.ref;if(nt!==null)if(typeof nt=="function")try{nt(null)}catch(it){W$8(tt,et,it)}else nt.current=null}function Nj(tt,et,nt){try{nt()}catch(it){W$8(tt,et,it)}}var Oj=!1;function Pj(tt,et){if(Cf=dd,tt=Me$2(),Ne$2(tt)){if("selectionStart"in tt)var nt={start:tt.selectionStart,end:tt.selectionEnd};else e:{nt=(nt=tt.ownerDocument)&&nt.defaultView||window;var it=nt.getSelection&&nt.getSelection();if(it&&it.rangeCount!==0){nt=it.anchorNode;var rt=it.anchorOffset,ot=it.focusNode;it=it.focusOffset;try{nt.nodeType,ot.nodeType}catch{nt=null;break e}var at=0,st=-1,lt=-1,ct=0,ut=0,ht=tt,dt=null;t:for(;;){for(var pt;ht!==nt||rt!==0&&ht.nodeType!==3||(st=at+rt),ht!==ot||it!==0&&ht.nodeType!==3||(lt=at+it),ht.nodeType===3&&(at+=ht.nodeValue.length),(pt=ht.firstChild)!==null;)dt=ht,ht=pt;for(;;){if(ht===tt)break t;if(dt===nt&&++ct===rt&&(st=at),dt===ot&&++ut===it&&(lt=at),(pt=ht.nextSibling)!==null)break;ht=dt,dt=ht.parentNode}ht=pt}nt=st===-1||lt===-1?null:{start:st,end:lt}}else nt=null}nt=nt||{start:0,end:0}}else nt=null;for(Df={focusedElem:tt,selectionRange:nt},dd=!1,V$4=et;V$4!==null;)if(et=V$4,tt=et.child,(et.subtreeFlags&1028)!==0&&tt!==null)tt.return=et,V$4=tt;else for(;V$4!==null;){et=V$4;try{var mt=et.alternate;if(et.flags&1024)switch(et.tag){case 0:case 11:case 15:break;case 1:if(mt!==null){var gt=mt.memoizedProps,bt=mt.memoizedState,yt=et.stateNode,wt=yt.getSnapshotBeforeUpdate(et.elementType===et.type?gt:Lg(et.type,gt),bt);yt.__reactInternalSnapshotBeforeUpdate=wt}break;case 3:var vt=et.stateNode.containerInfo;vt.nodeType===1?vt.textContent="":vt.nodeType===9&&vt.documentElement&&vt.removeChild(vt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$9(163))}}catch(xt){W$8(et,et.return,xt)}if(tt=et.sibling,tt!==null){tt.return=et.return,V$4=tt;break}V$4=et.return}return mt=Oj,Oj=!1,mt}function Qj(tt,et,nt){var it=et.updateQueue;if(it=it!==null?it.lastEffect:null,it!==null){var rt=it=it.next;do{if((rt.tag&tt)===tt){var ot=rt.destroy;rt.destroy=void 0,ot!==void 0&&Nj(et,nt,ot)}rt=rt.next}while(rt!==it)}}function Rj(tt,et){if(et=et.updateQueue,et=et!==null?et.lastEffect:null,et!==null){var nt=et=et.next;do{if((nt.tag&tt)===tt){var it=nt.create;nt.destroy=it()}nt=nt.next}while(nt!==et)}}function Sj(tt){var et=tt.ref;if(et!==null){var nt=tt.stateNode;switch(tt.tag){case 5:tt=nt;break;default:tt=nt}typeof et=="function"?et(tt):et.current=tt}}function Tj(tt){var et=tt.alternate;et!==null&&(tt.alternate=null,Tj(et)),tt.child=null,tt.deletions=null,tt.sibling=null,tt.tag===5&&(et=tt.stateNode,et!==null&&(delete et[Of],delete et[Pf],delete et[of],delete et[Qf],delete et[Rf])),tt.stateNode=null,tt.return=null,tt.dependencies=null,tt.memoizedProps=null,tt.memoizedState=null,tt.pendingProps=null,tt.stateNode=null,tt.updateQueue=null}function Uj(tt){return tt.tag===5||tt.tag===3||tt.tag===4}function Vj(tt){e:for(;;){for(;tt.sibling===null;){if(tt.return===null||Uj(tt.return))return null;tt=tt.return}for(tt.sibling.return=tt.return,tt=tt.sibling;tt.tag!==5&&tt.tag!==6&&tt.tag!==18;){if(tt.flags&2||tt.child===null||tt.tag===4)continue e;tt.child.return=tt,tt=tt.child}if(!(tt.flags&2))return tt.stateNode}}function Wj(tt,et,nt){var it=tt.tag;if(it===5||it===6)tt=tt.stateNode,et?nt.nodeType===8?nt.parentNode.insertBefore(tt,et):nt.insertBefore(tt,et):(nt.nodeType===8?(et=nt.parentNode,et.insertBefore(tt,nt)):(et=nt,et.appendChild(tt)),nt=nt._reactRootContainer,nt!=null||et.onclick!==null||(et.onclick=Bf));else if(it!==4&&(tt=tt.child,tt!==null))for(Wj(tt,et,nt),tt=tt.sibling;tt!==null;)Wj(tt,et,nt),tt=tt.sibling}function Xj(tt,et,nt){var it=tt.tag;if(it===5||it===6)tt=tt.stateNode,et?nt.insertBefore(tt,et):nt.appendChild(tt);else if(it!==4&&(tt=tt.child,tt!==null))for(Xj(tt,et,nt),tt=tt.sibling;tt!==null;)Xj(tt,et,nt),tt=tt.sibling}var X$2=null,Yj=!1;function Zj(tt,et,nt){for(nt=nt.child;nt!==null;)ak(tt,et,nt),nt=nt.sibling}function ak(tt,et,nt){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,nt)}catch{}switch(nt.tag){case 5:U$3||Mj(nt,et);case 6:var it=X$2,rt=Yj;X$2=null,Zj(tt,et,nt),X$2=it,Yj=rt,X$2!==null&&(Yj?(tt=X$2,nt=nt.stateNode,tt.nodeType===8?tt.parentNode.removeChild(nt):tt.removeChild(nt)):X$2.removeChild(nt.stateNode));break;case 18:X$2!==null&&(Yj?(tt=X$2,nt=nt.stateNode,tt.nodeType===8?Kf(tt.parentNode,nt):tt.nodeType===1&&Kf(tt,nt),bd(tt)):Kf(X$2,nt.stateNode));break;case 4:it=X$2,rt=Yj,X$2=nt.stateNode.containerInfo,Yj=!0,Zj(tt,et,nt),X$2=it,Yj=rt;break;case 0:case 11:case 14:case 15:if(!U$3&&(it=nt.updateQueue,it!==null&&(it=it.lastEffect,it!==null))){rt=it=it.next;do{var ot=rt,at=ot.destroy;ot=ot.tag,at!==void 0&&(ot&2||ot&4)&&Nj(nt,et,at),rt=rt.next}while(rt!==it)}Zj(tt,et,nt);break;case 1:if(!U$3&&(Mj(nt,et),it=nt.stateNode,typeof it.componentWillUnmount=="function"))try{it.props=nt.memoizedProps,it.state=nt.memoizedState,it.componentWillUnmount()}catch(st){W$8(nt,et,st)}Zj(tt,et,nt);break;case 21:Zj(tt,et,nt);break;case 22:nt.mode&1?(U$3=(it=U$3)||nt.memoizedState!==null,Zj(tt,et,nt),U$3=it):Zj(tt,et,nt);break;default:Zj(tt,et,nt)}}function bk(tt){var et=tt.updateQueue;if(et!==null){tt.updateQueue=null;var nt=tt.stateNode;nt===null&&(nt=tt.stateNode=new Lj),et.forEach(function(it){var rt=ck.bind(null,tt,it);nt.has(it)||(nt.add(it),it.then(rt,rt))})}}function dk(tt,et){var nt=et.deletions;if(nt!==null)for(var it=0;itrt&&(rt=at),it&=~ot}if(it=rt,it=B$2()-it,it=(120>it?120:480>it?480:1080>it?1080:1920>it?1920:3e3>it?3e3:4320>it?4320:1960*mk(it/1960))-it,10tt?16:tt,xk===null)var it=!1;else{if(tt=xk,xk=null,yk=0,K$7&6)throw Error(p$9(331));var rt=K$7;for(K$7|=4,V$4=tt.current;V$4!==null;){var ot=V$4,at=ot.child;if(V$4.flags&16){var st=ot.deletions;if(st!==null){for(var lt=0;ltB$2()-gk?Lk(tt,0):sk|=nt),Ek(tt,et)}function Zk(tt,et){et===0&&(tt.mode&1?(et=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):et=1);var nt=L$3();tt=Zg(tt,et),tt!==null&&(Ac(tt,et,nt),Ek(tt,nt))}function vj(tt){var et=tt.memoizedState,nt=0;et!==null&&(nt=et.retryLane),Zk(tt,nt)}function ck(tt,et){var nt=0;switch(tt.tag){case 13:var it=tt.stateNode,rt=tt.memoizedState;rt!==null&&(nt=rt.retryLane);break;case 19:it=tt.stateNode;break;default:throw Error(p$9(314))}it!==null&&it.delete(et),Zk(tt,nt)}var Wk;Wk=function(tt,et,nt){if(tt!==null)if(tt.memoizedProps!==et.pendingProps||Wf.current)Ug=!0;else{if(!(tt.lanes&nt)&&!(et.flags&128))return Ug=!1,zj(tt,et,nt);Ug=!!(tt.flags&131072)}else Ug=!1,I$4&&et.flags&1048576&&ug(et,ng,et.index);switch(et.lanes=0,et.tag){case 2:var it=et.type;jj(tt,et),tt=et.pendingProps;var rt=Yf(et,H$3.current);Tg(et,nt),rt=Xh(null,et,it,tt,rt,nt);var ot=bi();return et.flags|=1,typeof rt=="object"&&rt!==null&&typeof rt.render=="function"&&rt.$$typeof===void 0?(et.tag=1,et.memoizedState=null,et.updateQueue=null,Zf(it)?(ot=!0,cg(et)):ot=!1,et.memoizedState=rt.state!==null&&rt.state!==void 0?rt.state:null,ah(et),rt.updater=nh,et.stateNode=rt,rt._reactInternals=et,rh$1(et,it,tt,nt),et=kj(null,et,it,!0,ot,nt)):(et.tag=0,I$4&&ot&&vg(et),Yi(null,et,rt,nt),et=et.child),et;case 16:it=et.elementType;e:{switch(jj(tt,et),tt=et.pendingProps,rt=it._init,it=rt(it._payload),et.type=it,rt=et.tag=$k(it),tt=Lg(it,tt),rt){case 0:et=dj(null,et,it,tt,nt);break e;case 1:et=ij(null,et,it,tt,nt);break e;case 11:et=Zi(null,et,it,tt,nt);break e;case 14:et=aj(null,et,it,Lg(it.type,tt),nt);break e}throw Error(p$9(306,it,""))}return et;case 0:return it=et.type,rt=et.pendingProps,rt=et.elementType===it?rt:Lg(it,rt),dj(tt,et,it,rt,nt);case 1:return it=et.type,rt=et.pendingProps,rt=et.elementType===it?rt:Lg(it,rt),ij(tt,et,it,rt,nt);case 3:e:{if(lj(et),tt===null)throw Error(p$9(387));it=et.pendingProps,ot=et.memoizedState,rt=ot.element,bh(tt,et),gh(et,it,null,nt);var at=et.memoizedState;if(it=at.element,ot.isDehydrated)if(ot={element:it,isDehydrated:!1,cache:at.cache,pendingSuspenseBoundaries:at.pendingSuspenseBoundaries,transitions:at.transitions},et.updateQueue.baseState=ot,et.memoizedState=ot,et.flags&256){rt=Ki(Error(p$9(423)),et),et=mj(tt,et,it,nt,rt);break e}else if(it!==rt){rt=Ki(Error(p$9(424)),et),et=mj(tt,et,it,nt,rt);break e}else for(yg=Lf(et.stateNode.containerInfo.firstChild),xg=et,I$4=!0,zg=null,nt=Ch$1(et,null,it,nt),et.child=nt;nt;)nt.flags=nt.flags&-3|4096,nt=nt.sibling;else{if(Ig(),it===rt){et=$i(tt,et,nt);break e}Yi(tt,et,it,nt)}et=et.child}return et;case 5:return Kh$1(et),tt===null&&Eg(et),it=et.type,rt=et.pendingProps,ot=tt!==null?tt.memoizedProps:null,at=rt.children,Ef(it,rt)?at=null:ot!==null&&Ef(it,ot)&&(et.flags|=32),hj(tt,et),Yi(tt,et,at,nt),et.child;case 6:return tt===null&&Eg(et),null;case 13:return pj(tt,et,nt);case 4:return Ih(et,et.stateNode.containerInfo),it=et.pendingProps,tt===null?et.child=Bh(et,null,it,nt):Yi(tt,et,it,nt),et.child;case 11:return it=et.type,rt=et.pendingProps,rt=et.elementType===it?rt:Lg(it,rt),Zi(tt,et,it,rt,nt);case 7:return Yi(tt,et,et.pendingProps,nt),et.child;case 8:return Yi(tt,et,et.pendingProps.children,nt),et.child;case 12:return Yi(tt,et,et.pendingProps.children,nt),et.child;case 10:e:{if(it=et.type._context,rt=et.pendingProps,ot=et.memoizedProps,at=rt.value,G$3(Mg,it._currentValue),it._currentValue=at,ot!==null)if(He$1(ot.value,at)){if(ot.children===rt.children&&!Wf.current){et=$i(tt,et,nt);break e}}else for(ot=et.child,ot!==null&&(ot.return=et);ot!==null;){var st=ot.dependencies;if(st!==null){at=ot.child;for(var lt=st.firstContext;lt!==null;){if(lt.context===it){if(ot.tag===1){lt=ch$1(-1,nt&-nt),lt.tag=2;var ct=ot.updateQueue;if(ct!==null){ct=ct.shared;var ut=ct.pending;ut===null?lt.next=lt:(lt.next=ut.next,ut.next=lt),ct.pending=lt}}ot.lanes|=nt,lt=ot.alternate,lt!==null&&(lt.lanes|=nt),Sg(ot.return,nt,et),st.lanes|=nt;break}lt=lt.next}}else if(ot.tag===10)at=ot.type===et.type?null:ot.child;else if(ot.tag===18){if(at=ot.return,at===null)throw Error(p$9(341));at.lanes|=nt,st=at.alternate,st!==null&&(st.lanes|=nt),Sg(at,nt,et),at=ot.sibling}else at=ot.child;if(at!==null)at.return=ot;else for(at=ot;at!==null;){if(at===et){at=null;break}if(ot=at.sibling,ot!==null){ot.return=at.return,at=ot;break}at=at.return}ot=at}Yi(tt,et,rt.children,nt),et=et.child}return et;case 9:return rt=et.type,it=et.pendingProps.children,Tg(et,nt),rt=Vg(rt),it=it(rt),et.flags|=1,Yi(tt,et,it,nt),et.child;case 14:return it=et.type,rt=Lg(it,et.pendingProps),rt=Lg(it.type,rt),aj(tt,et,it,rt,nt);case 15:return cj(tt,et,et.type,et.pendingProps,nt);case 17:return it=et.type,rt=et.pendingProps,rt=et.elementType===it?rt:Lg(it,rt),jj(tt,et),et.tag=1,Zf(it)?(tt=!0,cg(et)):tt=!1,Tg(et,nt),ph(et,it,rt),rh$1(et,it,rt,nt),kj(null,et,it,!0,tt,nt);case 19:return yj(tt,et,nt);case 22:return ej(tt,et,nt)}throw Error(p$9(156,et.tag))};function Gk(tt,et){return ac(tt,et)}function al(tt,et,nt,it){this.tag=tt,this.key=nt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=et,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=it,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg$1(tt,et,nt,it){return new al(tt,et,nt,it)}function bj(tt){return tt=tt.prototype,!(!tt||!tt.isReactComponent)}function $k(tt){if(typeof tt=="function")return bj(tt)?1:0;if(tt!=null){if(tt=tt.$$typeof,tt===Da)return 11;if(tt===Ga)return 14}return 2}function wh(tt,et){var nt=tt.alternate;return nt===null?(nt=Bg$1(tt.tag,et,tt.key,tt.mode),nt.elementType=tt.elementType,nt.type=tt.type,nt.stateNode=tt.stateNode,nt.alternate=tt,tt.alternate=nt):(nt.pendingProps=et,nt.type=tt.type,nt.flags=0,nt.subtreeFlags=0,nt.deletions=null),nt.flags=tt.flags&14680064,nt.childLanes=tt.childLanes,nt.lanes=tt.lanes,nt.child=tt.child,nt.memoizedProps=tt.memoizedProps,nt.memoizedState=tt.memoizedState,nt.updateQueue=tt.updateQueue,et=tt.dependencies,nt.dependencies=et===null?null:{lanes:et.lanes,firstContext:et.firstContext},nt.sibling=tt.sibling,nt.index=tt.index,nt.ref=tt.ref,nt}function yh(tt,et,nt,it,rt,ot){var at=2;if(it=tt,typeof tt=="function")bj(tt)&&(at=1);else if(typeof tt=="string")at=5;else e:switch(tt){case ya:return Ah(nt.children,rt,ot,et);case za:at=8,rt|=8;break;case Aa:return tt=Bg$1(12,nt,et,rt|2),tt.elementType=Aa,tt.lanes=ot,tt;case Ea:return tt=Bg$1(13,nt,et,rt),tt.elementType=Ea,tt.lanes=ot,tt;case Fa:return tt=Bg$1(19,nt,et,rt),tt.elementType=Fa,tt.lanes=ot,tt;case Ia:return qj(nt,rt,ot,et);default:if(typeof tt=="object"&&tt!==null)switch(tt.$$typeof){case Ba:at=10;break e;case Ca:at=9;break e;case Da:at=11;break e;case Ga:at=14;break e;case Ha:at=16,it=null;break e}throw Error(p$9(130,tt==null?tt:typeof tt,""))}return et=Bg$1(at,nt,et,rt),et.elementType=tt,et.type=it,et.lanes=ot,et}function Ah(tt,et,nt,it){return tt=Bg$1(7,tt,it,et),tt.lanes=nt,tt}function qj(tt,et,nt,it){return tt=Bg$1(22,tt,it,et),tt.elementType=Ia,tt.lanes=nt,tt.stateNode={isHidden:!1},tt}function xh(tt,et,nt){return tt=Bg$1(6,tt,null,et),tt.lanes=nt,tt}function zh(tt,et,nt){return et=Bg$1(4,tt.children!==null?tt.children:[],tt.key,et),et.lanes=nt,et.stateNode={containerInfo:tt.containerInfo,pendingChildren:null,implementation:tt.implementation},et}function bl(tt,et,nt,it,rt){this.tag=et,this.containerInfo=tt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=it,this.onRecoverableError=rt,this.mutableSourceEagerHydrationData=null}function cl(tt,et,nt,it,rt,ot,at,st,lt){return tt=new bl(tt,et,nt,st,lt),et===1?(et=1,ot===!0&&(et|=8)):et=0,ot=Bg$1(3,null,null,et),tt.current=ot,ot.stateNode=tt,ot.memoizedState={element:it,isDehydrated:nt,cache:null,transitions:null,pendingSuspenseBoundaries:null},ah(ot),tt}function dl(tt,et,nt){var it=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(tt){console.error(tt)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var createRoot$1,m$9=reactDomExports;createRoot$1=client$1.createRoot=m$9.createRoot,client$1.hydrateRoot=m$9.hydrateRoot;function _extends$t(){return _extends$t=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.forEach(nt=>$6ed0406888f73fc4$var$setRef(nt,et))}function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...tt){return reactExports.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...tt),tt)}const $5e63c961fc1ce211$export$8c6ed5c666ac1360=reactExports.forwardRef((tt,et)=>{const{children:nt,...it}=tt,rt=reactExports.Children.toArray(nt),ot=rt.find($5e63c961fc1ce211$var$isSlottable);if(ot){const at=ot.props.children,st=rt.map(lt=>lt===ot?reactExports.Children.count(at)>1?reactExports.Children.only(null):reactExports.isValidElement(at)?at.props.children:null:lt);return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$t({},it,{ref:et}),reactExports.isValidElement(at)?reactExports.cloneElement(at,void 0,st):null)}return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$t({},it,{ref:et}),nt)});$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName="Slot";const $5e63c961fc1ce211$var$SlotClone=reactExports.forwardRef((tt,et)=>{const{children:nt,...it}=tt;return reactExports.isValidElement(nt)?reactExports.cloneElement(nt,{...$5e63c961fc1ce211$var$mergeProps(it,nt.props),ref:et?$6ed0406888f73fc4$export$43e446d32b3d21af(et,nt.ref):nt.ref}):reactExports.Children.count(nt)>1?reactExports.Children.only(null):null});$5e63c961fc1ce211$var$SlotClone.displayName="SlotClone";const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45=({children:tt})=>reactExports.createElement(reactExports.Fragment,null,tt);function $5e63c961fc1ce211$var$isSlottable(tt){return reactExports.isValidElement(tt)&&tt.type===$5e63c961fc1ce211$export$d9f1ccf0bdb05d45}function $5e63c961fc1ce211$var$mergeProps(tt,et){const nt={...et};for(const it in et){const rt=tt[it],ot=et[it];/^on[A-Z]/.test(it)?rt&&ot?nt[it]=(...st)=>{ot(...st),rt(...st)}:rt&&(nt[it]=rt):it==="style"?nt[it]={...rt,...ot}:it==="className"&&(nt[it]=[rt,ot].filter(Boolean).join(" "))}return{...tt,...nt}}const $8927f6f2acc4f386$var$NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$8927f6f2acc4f386$export$250ffa63cdc0d034=$8927f6f2acc4f386$var$NODES.reduce((tt,et)=>{const nt=reactExports.forwardRef((it,rt)=>{const{asChild:ot,...at}=it,st=ot?$5e63c961fc1ce211$export$8c6ed5c666ac1360:et;return reactExports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),reactExports.createElement(st,_extends$t({},at,{ref:rt}))});return nt.displayName=`Primitive.${et}`,{...tt,[et]:nt}},{});function $8927f6f2acc4f386$export$6d1a0317bde7de7f(tt,et){tt&&reactDomExports.flushSync(()=>tt.dispatchEvent(et))}const $f1701beae083dbae$export$602eac185826482c=reactExports.forwardRef((tt,et)=>{var nt;const{container:it=globalThis==null||(nt=globalThis.document)===null||nt===void 0?void 0:nt.body,...rt}=tt;return it?ReactDOM.createPortal(reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$t({},rt,{ref:et})),it):null}),$f1701beae083dbae$export$be92b6f5f03c0fe9=$f1701beae083dbae$export$602eac185826482c;var has$7=Object.prototype.hasOwnProperty;function dequal(tt,et){var nt,it;if(tt===et)return!0;if(tt&&et&&(nt=tt.constructor)===et.constructor){if(nt===Date)return tt.getTime()===et.getTime();if(nt===RegExp)return tt.toString()===et.toString();if(nt===Array){if((it=tt.length)===et.length)for(;it--&&dequal(tt[it],et[it]););return it===-1}if(!nt||typeof tt=="object"){it=0;for(nt in tt)if(has$7.call(tt,nt)&&++it&&!has$7.call(et,nt)||!(nt in et)||!dequal(tt[nt],et[nt]))return!1;return Object.keys(et).length===it}}return tt!==tt&&et!==et}function shallow$2(tt,et){if(Object.is(tt,et))return!0;if(typeof tt!="object"||tt===null||typeof et!="object"||et===null)return!1;const nt=Object.keys(tt);if(nt.length!==Object.keys(et).length)return!1;for(let it=0;it0;)at[st]=arguments[st+4];tt.call(this,at),tt.captureStackTrace&&tt.captureStackTrace(this,et),this.rule=nt,this.value=it,this.cause=rt,this.target=ot}return tt&&(et.__proto__=tt),et.prototype=Object.create(tt&&tt.prototype),et.prototype.constructor=et,et}(Error),Context$2=function(et,nt){et===void 0&&(et=[]),nt===void 0&&(nt=[]),this.chain=et,this.nextRuleModifiers=nt};Context$2.prototype._applyRule=function(et,nt){var it=this;return function(){for(var rt=[],ot=arguments.length;ot--;)rt[ot]=arguments[ot];return it.chain.push(new Rule(nt,et.apply(it,rt),rt,it.nextRuleModifiers)),it.nextRuleModifiers=[],it}};Context$2.prototype._applyModifier=function(et,nt){return this.nextRuleModifiers.push(new Modifier(nt,et.simple,et.async)),this};Context$2.prototype._clone=function(){return new Context$2(this.chain.slice(),this.nextRuleModifiers.slice())};Context$2.prototype.test=function(et){return this.chain.every(function(nt){return nt._test(et)})};Context$2.prototype.testAll=function(et){var nt=[];return this.chain.forEach(function(it){try{it._check(et)}catch(rt){nt.push(new ValidationError(it,et,rt))}}),nt};Context$2.prototype.check=function(et){this.chain.forEach(function(nt){try{nt._check(et)}catch(it){throw new ValidationError(nt,et,it)}})};Context$2.prototype.testAsync=function(et){var nt=this;return new Promise(function(it,rt){executeAsyncRules(et,nt.chain.slice(),it,rt)})};function executeAsyncRules(tt,et,nt,it){if(et.length){var rt=et.shift();rt._testAsync(tt).then(function(){executeAsyncRules(tt,et,nt,it)},function(ot){it(new ValidationError(rt,tt,ot))})}else nt(tt)}var consideredEmpty=function(tt,et){return et&&typeof tt=="string"&&tt.trim().length===0?!0:tt==null};function optional(tt,et){return et===void 0&&(et=!1),{simple:function(nt){return consideredEmpty(nt,et)||tt.check(nt)===void 0},async:function(nt){return consideredEmpty(nt,et)||tt.testAsync(nt)}}}function v8n(){return typeof Proxy<"u"?proxyContext(new Context$2):proxylessContext(new Context$2)}var customRules={};v8n.extend=function(tt){Object.assign(customRules,tt)};v8n.clearCustomRules=function(){customRules={}};function proxyContext(tt){return new Proxy(tt,{get:function(nt,it){if(it in nt)return nt[it];var rt=proxyContext(tt._clone());if(it in availableModifiers)return rt._applyModifier(availableModifiers[it],it);if(it in customRules)return rt._applyRule(customRules[it],it);if(it in availableRules)return rt._applyRule(availableRules[it],it)}})}function proxylessContext(tt){var et=function(rt,ot){return Object.keys(rt).forEach(function(at){ot[at]=function(){for(var st=[],lt=arguments.length;lt--;)st[lt]=arguments[lt];var ct=proxylessContext(ot._clone()),ut=ct._applyRule(rt[at],at).apply(void 0,st);return ut}}),ot},nt=et(availableRules,tt),it=et(customRules,nt);return Object.keys(availableModifiers).forEach(function(rt){Object.defineProperty(it,rt,{get:function(){var ot=proxylessContext(it._clone());return ot._applyModifier(availableModifiers[rt],rt)}})}),it}var availableModifiers={not:{simple:function(tt){return function(et){return!tt(et)}},async:function(tt){return function(et){return Promise.resolve(tt(et)).then(function(nt){return!nt}).catch(function(){return!0})}}},some:{simple:function(tt){return function(et){return split$1(et).some(function(nt){try{return tt(nt)}catch{return!1}})}},async:function(tt){return function(et){return Promise.all(split$1(et).map(function(nt){try{return tt(nt).catch(function(){return!1})}catch{return!1}})).then(function(nt){return nt.some(Boolean)})}}},every:{simple:function(tt){return function(et){return et!==!1&&split$1(et).every(tt)}},async:function(tt){return function(et){return Promise.all(split$1(et).map(tt)).then(function(nt){return nt.every(Boolean)})}}},strict:{simple:function(tt,et){return function(nt){return isSchemaRule(et)&&nt&&typeof nt=="object"?Object.keys(et.args[0]).length===Object.keys(nt).length&&tt(nt):tt(nt)}},async:function(tt,et){return function(nt){return Promise.resolve(tt(nt)).then(function(it){return isSchemaRule(et)&&nt&&typeof nt=="object"?Object.keys(et.args[0]).length===Object.keys(nt).length&&it:it}).catch(function(){return!1})}}}};function isSchemaRule(tt){return tt&&tt.name==="schema"&&tt.args.length>0&&typeof tt.args[0]=="object"}function split$1(tt){return typeof tt=="string"?tt.split(""):tt}var availableRules={equal:function(tt){return function(et){return et==tt}},exact:function(tt){return function(et){return et===tt}},number:function(tt){return tt===void 0&&(tt=!0),function(et){return typeof et=="number"&&(tt||isFinite(et))}},integer:function(){return function(tt){var et=Number.isInteger||isIntegerPolyfill;return et(tt)}},numeric:function(){return function(tt){return!isNaN(parseFloat(tt))&&isFinite(tt)}},string:function(){return testType("string")},boolean:function(){return testType("boolean")},undefined:function(){return testType("undefined")},null:function(){return testType("null")},array:function(){return testType("array")},object:function(){return testType("object")},instanceOf:function(tt){return function(et){return et instanceof tt}},pattern:function(tt){return function(et){return tt.test(et)}},lowercase:function(){return function(tt){return typeof tt=="boolean"||tt===tt.toLowerCase()&&tt.trim()!==""}},uppercase:function(){return function(tt){return tt===tt.toUpperCase()&&tt.trim()!==""}},vowel:function(){return function(tt){return/^[aeiou]+$/i.test(tt)}},consonant:function(){return function(tt){return/^(?=[^aeiou])([a-z]+)$/i.test(tt)}},first:function(tt){return function(et){return et[0]==tt}},last:function(tt){return function(et){return et[et.length-1]==tt}},empty:function(){return function(tt){return tt.length===0}},length:function(tt,et){return function(nt){return nt.length>=tt&&nt.length<=(et||tt)}},minLength:function(tt){return function(et){return et.length>=tt}},maxLength:function(tt){return function(et){return et.length<=tt}},negative:function(){return function(tt){return tt<0}},positive:function(){return function(tt){return tt>=0}},between:function(tt,et){return function(nt){return nt>=tt&&nt<=et}},range:function(tt,et){return function(nt){return nt>=tt&&nt<=et}},lessThan:function(tt){return function(et){return ettt}},greaterThanOrEqual:function(tt){return function(et){return et>=tt}},even:function(){return function(tt){return tt%2===0}},odd:function(){return function(tt){return tt%2!==0}},includes:function(tt){return function(et){return~et.indexOf(tt)}},schema:function(tt){return testSchema(tt)},passesAnyOf:function(){for(var tt=[],et=arguments.length;et--;)tt[et]=arguments[et];return function(nt){return tt.some(function(it){return it.test(nt)})}},optional};function testType(tt){return function(et){return Array.isArray(et)&&tt==="array"||et===null&&tt==="null"||typeof et===tt}}function isIntegerPolyfill(tt){return typeof tt=="number"&&isFinite(tt)&&Math.floor(tt)===tt}function testSchema(tt){return{simple:function(et){var nt=[];if(Object.keys(tt).forEach(function(it){var rt=tt[it];try{rt.check((et||{})[it])}catch(ot){ot.target=it,nt.push(ot)}}),nt.length>0)throw nt;return!0},async:function(et){var nt=[],it=Object.keys(tt).map(function(rt){var ot=tt[rt];return ot.testAsync((et||{})[rt]).catch(function(at){at.target=rt,nt.push(at)})});return Promise.all(it).then(function(){if(nt.length>0)throw nt;return!0})}}}var e$6="colors",t$7="sizes",r$c="space",n$7={gap:r$c,gridGap:r$c,columnGap:r$c,gridColumnGap:r$c,rowGap:r$c,gridRowGap:r$c,inset:r$c,insetBlock:r$c,insetBlockEnd:r$c,insetBlockStart:r$c,insetInline:r$c,insetInlineEnd:r$c,insetInlineStart:r$c,margin:r$c,marginTop:r$c,marginRight:r$c,marginBottom:r$c,marginLeft:r$c,marginBlock:r$c,marginBlockEnd:r$c,marginBlockStart:r$c,marginInline:r$c,marginInlineEnd:r$c,marginInlineStart:r$c,padding:r$c,paddingTop:r$c,paddingRight:r$c,paddingBottom:r$c,paddingLeft:r$c,paddingBlock:r$c,paddingBlockEnd:r$c,paddingBlockStart:r$c,paddingInline:r$c,paddingInlineEnd:r$c,paddingInlineStart:r$c,top:r$c,right:r$c,bottom:r$c,left:r$c,scrollMargin:r$c,scrollMarginTop:r$c,scrollMarginRight:r$c,scrollMarginBottom:r$c,scrollMarginLeft:r$c,scrollMarginX:r$c,scrollMarginY:r$c,scrollMarginBlock:r$c,scrollMarginBlockEnd:r$c,scrollMarginBlockStart:r$c,scrollMarginInline:r$c,scrollMarginInlineEnd:r$c,scrollMarginInlineStart:r$c,scrollPadding:r$c,scrollPaddingTop:r$c,scrollPaddingRight:r$c,scrollPaddingBottom:r$c,scrollPaddingLeft:r$c,scrollPaddingX:r$c,scrollPaddingY:r$c,scrollPaddingBlock:r$c,scrollPaddingBlockEnd:r$c,scrollPaddingBlockStart:r$c,scrollPaddingInline:r$c,scrollPaddingInlineEnd:r$c,scrollPaddingInlineStart:r$c,fontSize:"fontSizes",background:e$6,backgroundColor:e$6,backgroundImage:e$6,borderImage:e$6,border:e$6,borderBlock:e$6,borderBlockEnd:e$6,borderBlockStart:e$6,borderBottom:e$6,borderBottomColor:e$6,borderColor:e$6,borderInline:e$6,borderInlineEnd:e$6,borderInlineStart:e$6,borderLeft:e$6,borderLeftColor:e$6,borderRight:e$6,borderRightColor:e$6,borderTop:e$6,borderTopColor:e$6,caretColor:e$6,color:e$6,columnRuleColor:e$6,fill:e$6,outline:e$6,outlineColor:e$6,stroke:e$6,textDecorationColor:e$6,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t$7,minBlockSize:t$7,maxBlockSize:t$7,inlineSize:t$7,minInlineSize:t$7,maxInlineSize:t$7,width:t$7,minWidth:t$7,maxWidth:t$7,height:t$7,minHeight:t$7,maxHeight:t$7,flexBasis:t$7,gridTemplateColumns:t$7,gridTemplateRows:t$7,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i$8=(tt,et)=>typeof et=="function"?{"()":Function.prototype.toString.call(et)}:et,o$2=()=>{const tt=Object.create(null);return(et,nt,...it)=>{const rt=(ot=>JSON.stringify(ot,i$8))(et);return rt in tt?tt[rt]:tt[rt]=nt(et,...it)}},l$6=Symbol.for("sxs.internal"),s$5=(tt,et)=>Object.defineProperties(tt,Object.getOwnPropertyDescriptors(et)),a$4=tt=>{for(const et in tt)return!0;return!1},{hasOwnProperty:c$8}=Object.prototype,d$6=tt=>tt.includes("-")?tt:tt.replace(/[A-Z]/g,et=>"-"+et.toLowerCase()),g$9=/\s+(?![^()]*\))/,p$8=tt=>et=>tt(...typeof et=="string"?String(et).split(g$9):[et]),u$6={appearance:tt=>({WebkitAppearance:tt,appearance:tt}),backfaceVisibility:tt=>({WebkitBackfaceVisibility:tt,backfaceVisibility:tt}),backdropFilter:tt=>({WebkitBackdropFilter:tt,backdropFilter:tt}),backgroundClip:tt=>({WebkitBackgroundClip:tt,backgroundClip:tt}),boxDecorationBreak:tt=>({WebkitBoxDecorationBreak:tt,boxDecorationBreak:tt}),clipPath:tt=>({WebkitClipPath:tt,clipPath:tt}),content:tt=>({content:tt.includes('"')||tt.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(tt)?tt:`"${tt}"`}),hyphens:tt=>({WebkitHyphens:tt,hyphens:tt}),maskImage:tt=>({WebkitMaskImage:tt,maskImage:tt}),maskSize:tt=>({WebkitMaskSize:tt,maskSize:tt}),tabSize:tt=>({MozTabSize:tt,tabSize:tt}),textSizeAdjust:tt=>({WebkitTextSizeAdjust:tt,textSizeAdjust:tt}),userSelect:tt=>({WebkitUserSelect:tt,userSelect:tt}),marginBlock:p$8((tt,et)=>({marginBlockStart:tt,marginBlockEnd:et||tt})),marginInline:p$8((tt,et)=>({marginInlineStart:tt,marginInlineEnd:et||tt})),maxSize:p$8((tt,et)=>({maxBlockSize:tt,maxInlineSize:et||tt})),minSize:p$8((tt,et)=>({minBlockSize:tt,minInlineSize:et||tt})),paddingBlock:p$8((tt,et)=>({paddingBlockStart:tt,paddingBlockEnd:et||tt})),paddingInline:p$8((tt,et)=>({paddingInlineStart:tt,paddingInlineEnd:et||tt}))},h$b=/([\d.]+)([^]*)/,f$8=(tt,et)=>tt.length?tt.reduce((nt,it)=>(nt.push(...et.map(rt=>rt.includes("&")?rt.replace(/&/g,/[ +>|~]/.test(it)&&/&.*&/.test(rt)?`:is(${it})`:it):it+" "+rt)),nt),[]):et,m$8=(tt,et)=>tt in b$7&&typeof et=="string"?et.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(nt,it,rt,ot)=>it+(rt==="stretch"?`-moz-available${ot};${d$6(tt)}:${it}-webkit-fill-available`:`-moz-fit-content${ot};${d$6(tt)}:${it}fit-content`)+ot):String(et),b$7={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S$3=tt=>tt?tt+"-":"",k$a=(tt,et,nt)=>tt.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(it,rt,ot,at,st)=>at=="$"==!!ot?it:(rt||at=="--"?"calc(":"")+"var(--"+(at==="$"?S$3(et)+(st.includes("$")?"":S$3(nt))+st.replace(/\$/g,"-"):st)+")"+(rt||at=="--"?"*"+(rt||"")+(ot||"1")+")":"")),y$8=/\s*,\s*(?![^()]*\))/,B$1=Object.prototype.toString,$$3=(tt,et,nt,it,rt)=>{let ot,at,st;const lt=(ct,ut,ht)=>{let dt,pt;const mt=gt=>{for(dt in gt){const wt=dt.charCodeAt(0)===64,vt=wt&&Array.isArray(gt[dt])?gt[dt]:[gt[dt]];for(pt of vt){const xt=/[A-Z]/.test(yt=dt)?yt:yt.replace(/-[^]/g,Et=>Et[1].toUpperCase()),St=typeof pt=="object"&&pt&&pt.toString===B$1&&(!it.utils[xt]||!ut.length);if(xt in it.utils&&!St){const Et=it.utils[xt];if(Et!==at){at=Et,mt(Et(pt)),at=null;continue}}else if(xt in u$6){const Et=u$6[xt];if(Et!==st){st=Et,mt(Et(pt)),st=null;continue}}if(wt&&(bt=dt.slice(1)in it.media?"@media "+it.media[dt.slice(1)]:dt,dt=bt.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(Et,$t,It,Ft,Ht,zt)=>{const Ot=h$b.test($t),jt=.0625*(Ot?-1:1),[kt,Tt]=Ot?[Ft,$t]:[$t,Ft];return"("+(It[0]==="="?"":It[0]===">"===Ot?"max-":"min-")+kt+":"+(It[0]!=="="&&It.length===1?Tt.replace(h$b,(Ct,Ut,Nt)=>Number(Ut)+jt*(It===">"?1:-1)+Nt):Tt)+(Ht?") and ("+(Ht[0]===">"?"min-":"max-")+kt+":"+(Ht.length===1?zt.replace(h$b,(Ct,Ut,Nt)=>Number(Ut)+jt*(Ht===">"?-1:1)+Nt):zt):"")+")"})),St){const Et=wt?ht.concat(dt):[...ht],$t=wt?[...ut]:f$8(ut,dt.split(y$8));ot!==void 0&&rt(x$8(...ot)),ot=void 0,lt(pt,$t,Et)}else ot===void 0&&(ot=[[],ut,ht]),dt=wt||dt.charCodeAt(0)!==36?dt:`--${S$3(it.prefix)}${dt.slice(1).replace(/\$/g,"-")}`,pt=St?pt:typeof pt=="number"?pt&&xt in I$3?String(pt)+"px":String(pt):k$a(m$8(xt,pt??""),it.prefix,it.themeMap[xt]),ot[0].push(`${wt?`${dt} `:`${d$6(dt)}:`}${pt}`)}}var bt,yt};mt(ct),ot!==void 0&&rt(x$8(...ot)),ot=void 0};lt(tt,et,nt)},x$8=(tt,et,nt)=>`${nt.map(it=>`${it}{`).join("")}${et.length?`${et.join(",")}{`:""}${tt.join(";")}${et.length?"}":""}${Array(nt.length?nt.length+1:0).join("}")}`,I$3={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R$1=tt=>String.fromCharCode(tt+(tt>25?39:97)),z$6=tt=>(et=>{let nt,it="";for(nt=Math.abs(et);nt>52;nt=nt/52|0)it=R$1(nt%52)+it;return R$1(nt%52)+it})(((et,nt)=>{let it=nt.length;for(;it;)et=33*et^nt.charCodeAt(--it);return et})(5381,JSON.stringify(tt))>>>0),W$7=["themed","global","styled","onevar","resonevar","allvar","inline"],j$3=tt=>{if(tt.href&&!tt.href.startsWith(location.origin))return!1;try{return!!tt.cssRules}catch{return!1}},E$1=tt=>{let et;const nt=()=>{const{cssRules:rt}=et.sheet;return[].map.call(rt,(ot,at)=>{const{cssText:st}=ot;let lt="";if(st.startsWith("--sxs"))return"";if(rt[at-1]&&(lt=rt[at-1].cssText).startsWith("--sxs")){if(!ot.cssRules.length)return"";for(const ct in et.rules)if(et.rules[ct].group===ot)return`--sxs{--sxs:${[...et.rules[ct].cache].join(" ")}}${st}`;return ot.cssRules.length?`${lt}${st}`:""}return st}).join("")},it=()=>{if(et){const{rules:st,sheet:lt}=et;if(!lt.deleteRule){for(;Object(Object(lt.cssRules)[0]).type===3;)lt.cssRules.splice(0,1);lt.cssRules=[]}for(const ct in st)delete st[ct]}const rt=Object(tt).styleSheets||[];for(const st of rt)if(j$3(st)){for(let lt=0,ct=st.cssRules;ct[lt];++lt){const ut=Object(ct[lt]);if(ut.type!==1)continue;const ht=Object(ct[lt+1]);if(ht.type!==4)continue;++lt;const{cssText:dt}=ut;if(!dt.startsWith("--sxs"))continue;const pt=dt.slice(14,-3).trim().split(/\s+/),mt=W$7[pt[0]];mt&&(et||(et={sheet:st,reset:it,rules:{},toString:nt}),et.rules[mt]={group:ht,index:lt,cache:new Set(pt)})}if(et)break}if(!et){const st=(lt,ct)=>({type:ct,cssRules:[],insertRule(ut,ht){this.cssRules.splice(ht,0,st(ut,{import:3,undefined:1}[(ut.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return lt==="@media{}"?`@media{${[].map.call(this.cssRules,ut=>ut.cssText).join("")}}`:lt}});et={sheet:tt?(tt.head||tt).appendChild(document.createElement("style")).sheet:st("","text/css"),rules:{},reset:it,toString:nt}}const{sheet:ot,rules:at}=et;for(let st=W$7.length-1;st>=0;--st){const lt=W$7[st];if(!at[lt]){const ct=W$7[st+1],ut=at[ct]?at[ct].index:ot.cssRules.length;ot.insertRule("@media{}",ut),ot.insertRule(`--sxs{--sxs:${st}}`,ut),at[lt]={group:ot.cssRules[ut+1],index:ut,cache:new Set([st])}}v$a(at[lt])}};return it(),et},v$a=tt=>{const et=tt.group;let nt=et.cssRules.length;tt.apply=it=>{try{et.insertRule(it,nt),++nt}catch{}}},T$2=Symbol(),w$7=o$2(),M$2=(tt,et)=>w$7(tt,()=>(...nt)=>{let it={type:null,composers:new Set};for(const rt of nt)if(rt!=null)if(rt[l$6]){it.type==null&&(it.type=rt[l$6].type);for(const ot of rt[l$6].composers)it.composers.add(ot)}else rt.constructor!==Object||rt.$$typeof?it.type==null&&(it.type=rt):it.composers.add(C$1(rt,tt));return it.type==null&&(it.type="span"),it.composers.size||it.composers.add(["PJLV",{},[],[],{},[]]),P$3(tt,it,et)}),C$1=({variants:tt,compoundVariants:et,defaultVariants:nt,...it},rt)=>{const ot=`${S$3(rt.prefix)}c-${z$6(it)}`,at=[],st=[],lt=Object.create(null),ct=[];for(const dt in nt)lt[dt]=String(nt[dt]);if(typeof tt=="object"&&tt)for(const dt in tt){ut=lt,ht=dt,c$8.call(ut,ht)||(lt[dt]="undefined");const pt=tt[dt];for(const mt in pt){const gt={[dt]:String(mt)};String(mt)==="undefined"&&ct.push(dt);const bt=pt[mt],yt=[gt,bt,!a$4(bt)];at.push(yt)}}var ut,ht;if(typeof et=="object"&&et)for(const dt of et){let{css:pt,...mt}=dt;pt=typeof pt=="object"&&pt||{};for(const bt in mt)mt[bt]=String(mt[bt]);const gt=[mt,pt,!a$4(pt)];st.push(gt)}return[ot,it,at,st,lt,ct]},P$3=(tt,et,nt)=>{const[it,rt,ot,at]=L$2(et.composers),st=typeof et.type=="function"||et.type.$$typeof?(ht=>{function dt(){for(let pt=0;ptdt.rules[pt]={apply:mt=>dt[T$2].push([pt,mt])}),dt})(nt):null,lt=(st||nt).rules,ct=`.${it}${rt.length>1?`:where(.${rt.slice(1).join(".")})`:""}`,ut=ht=>{ht=typeof ht=="object"&&ht||A$2;const{css:dt,...pt}=ht,mt={};for(const yt in ot)if(delete pt[yt],yt in ht){let wt=ht[yt];typeof wt=="object"&&wt?mt[yt]={"@initial":ot[yt],...wt}:(wt=String(wt),mt[yt]=wt!=="undefined"||at.has(yt)?wt:ot[yt])}else mt[yt]=ot[yt];const gt=new Set([...rt]);for(const[yt,wt,vt,xt]of et.composers){nt.rules.styled.cache.has(yt)||(nt.rules.styled.cache.add(yt),$$3(wt,[`.${yt}`],[],tt,$t=>{lt.styled.apply($t)}));const St=O(vt,mt,tt.media),Et=O(xt,mt,tt.media,!0);for(const $t of St)if($t!==void 0)for(const[It,Ft,Ht]of $t){const zt=`${yt}-${z$6(Ft)}-${It}`;gt.add(zt);const Ot=(Ht?nt.rules.resonevar:nt.rules.onevar).cache,jt=Ht?lt.resonevar:lt.onevar;Ot.has(zt)||(Ot.add(zt),$$3(Ft,[`.${zt}`],[],tt,kt=>{jt.apply(kt)}))}for(const $t of Et)if($t!==void 0)for(const[It,Ft]of $t){const Ht=`${yt}-${z$6(Ft)}-${It}`;gt.add(Ht),nt.rules.allvar.cache.has(Ht)||(nt.rules.allvar.cache.add(Ht),$$3(Ft,[`.${Ht}`],[],tt,zt=>{lt.allvar.apply(zt)}))}}if(typeof dt=="object"&&dt){const yt=`${it}-i${z$6(dt)}-css`;gt.add(yt),nt.rules.inline.cache.has(yt)||(nt.rules.inline.cache.add(yt),$$3(dt,[`.${yt}`],[],tt,wt=>{lt.inline.apply(wt)}))}for(const yt of String(ht.className||"").trim().split(/\s+/))yt&>.add(yt);const bt=pt.className=[...gt].join(" ");return{type:et.type,className:bt,selector:ct,props:pt,toString:()=>bt,deferredInjector:st}};return s$5(ut,{className:it,selector:ct,[l$6]:et,toString:()=>(nt.rules.styled.cache.has(it)||ut(),it)})},L$2=tt=>{let et="";const nt=[],it={},rt=[];for(const[ot,,,,at,st]of tt){et===""&&(et=ot),nt.push(ot),rt.push(...st);for(const lt in at){const ct=at[lt];(it[lt]===void 0||ct!=="undefined"||st.includes(ct))&&(it[lt]=ct)}}return[et,nt,it,new Set(rt)]},O=(tt,et,nt,it)=>{const rt=[];e:for(let[ot,at,st]of tt){if(st)continue;let lt,ct=0,ut=!1;for(lt in ot){const ht=ot[lt];let dt=et[lt];if(dt!==ht){if(typeof dt!="object"||!dt)continue e;{let pt,mt,gt=0;for(const bt in dt){if(ht===String(dt[bt])){if(bt!=="@initial"){const yt=bt.slice(1);(mt=mt||[]).push(yt in nt?nt[yt]:bt.replace(/^@media ?/,"")),ut=!0}ct+=gt,pt=!0}++gt}if(mt&&mt.length&&(at={["@media "+mt.join(", ")]:at}),!pt)continue e}}}(rt[ct]=rt[ct]||[]).push([it?"cv":`${lt}-${ot[lt]}`,at,ut])}return rt},A$2={},N$2=o$2(),D$1=(tt,et)=>N$2(tt,()=>(...nt)=>{const it=()=>{for(let rt of nt){rt=typeof rt=="object"&&rt||{};let ot=z$6(rt);if(!et.rules.global.cache.has(ot)){if(et.rules.global.cache.add(ot),"@import"in rt){let at=[].indexOf.call(et.sheet.cssRules,et.rules.themed.group)-1;for(let st of[].concat(rt["@import"]))st=st.includes('"')||st.includes("'")?st:`"${st}"`,et.sheet.insertRule(`@import ${st};`,at++);delete rt["@import"]}$$3(rt,[],[],tt,at=>{et.rules.global.apply(at)})}}return""};return s$5(it,{toString:it})}),H$2=o$2(),V$3=(tt,et)=>H$2(tt,()=>nt=>{const it=`${S$3(tt.prefix)}k-${z$6(nt)}`,rt=()=>{if(!et.rules.global.cache.has(it)){et.rules.global.cache.add(it);const ot=[];$$3(nt,[],[],tt,st=>ot.push(st));const at=`@keyframes ${it}{${ot.join("")}}`;et.rules.global.apply(at)}return it};return s$5(rt,{get name(){return rt()},toString:rt})}),G$2=class{constructor(et,nt,it,rt){this.token=et==null?"":String(et),this.value=nt==null?"":String(nt),this.scale=it==null?"":String(it),this.prefix=rt==null?"":String(rt)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S$3(this.prefix)+S$3(this.scale)+this.token}toString(){return this.computedValue}},F$2=o$2(),J$2=(tt,et)=>F$2(tt,()=>(nt,it)=>{it=typeof nt=="object"&&nt||Object(it);const rt=`.${nt=(nt=typeof nt=="string"?nt:"")||`${S$3(tt.prefix)}t-${z$6(it)}`}`,ot={},at=[];for(const lt in it){ot[lt]={};for(const ct in it[lt]){const ut=`--${S$3(tt.prefix)}${lt}-${ct}`,ht=k$a(String(it[lt][ct]),tt.prefix,lt);ot[lt][ct]=new G$2(ct,ht,lt,tt.prefix),at.push(`${ut}:${ht}`)}}const st=()=>{if(at.length&&!et.rules.themed.cache.has(nt)){et.rules.themed.cache.add(nt);const lt=`${it===tt.theme?":root,":""}.${nt}{${at.join(";")}}`;et.rules.themed.apply(lt)}return nt};return{...ot,get className(){return st()},selector:rt,toString:st}}),U$2=o$2(),X$1,Y$2=o$2(),q$7=tt=>{const et=(nt=>{let it=!1;const rt=U$2(nt,ot=>{it=!0;const at="prefix"in(ot=typeof ot=="object"&&ot||{})?String(ot.prefix):"",st=typeof ot.media=="object"&&ot.media||{},lt=typeof ot.root=="object"?ot.root||null:globalThis.document||null,ct=typeof ot.theme=="object"&&ot.theme||{},ut={prefix:at,media:st,theme:ct,themeMap:typeof ot.themeMap=="object"&&ot.themeMap||{...n$7},utils:typeof ot.utils=="object"&&ot.utils||{}},ht=E$1(lt),dt={css:M$2(ut,ht),globalCss:D$1(ut,ht),keyframes:V$3(ut,ht),createTheme:J$2(ut,ht),reset(){ht.reset(),dt.theme.toString()},theme:{},sheet:ht,config:ut,prefix:at,getCssText:ht.toString,toString:ht.toString};return String(dt.theme=dt.createTheme(ct)),dt});return it||rt.reset(),rt})(tt);return et.styled=(({config:nt,sheet:it})=>Y$2(nt,()=>{const rt=M$2(nt,it);return(...ot)=>{const at=rt(...ot),st=at[l$6].type,lt=React$1.forwardRef((ct,ut)=>{const ht=ct&&ct.as||st,{props:dt,deferredInjector:pt}=at(ct);return delete dt.as,dt.ref=ut,pt?React$1.createElement(React$1.Fragment,null,React$1.createElement(ht,dt),React$1.createElement(pt,null)):React$1.createElement(ht,dt)});return lt.className=at.className,lt.displayName=`Styled.${st.displayName||st.name||st}`,lt.selector=at.selector,lt.toString=()=>at.selector,lt[l$6]=at[l$6],lt}}))(et),et},K$6=()=>X$1||(X$1=q$7()),re$5=(...tt)=>K$6().styled(...tt);function clamp$9(tt,et,nt){return Math.max(et,Math.min(tt,nt))}const V$2={toVector(tt,et){return tt===void 0&&(tt=et),Array.isArray(tt)?tt:[tt,tt]},add(tt,et){return[tt[0]+et[0],tt[1]+et[1]]},sub(tt,et){return[tt[0]-et[0],tt[1]-et[1]]},addTo(tt,et){tt[0]+=et[0],tt[1]+=et[1]},subTo(tt,et){tt[0]-=et[0],tt[1]-=et[1]}};function rubberband(tt,et,nt){return et===0||Math.abs(et)===1/0?Math.pow(tt,nt*5):tt*et*nt/(et+nt*tt)}function rubberbandIfOutOfBounds(tt,et,nt,it=.15){return it===0?clamp$9(tt,et,nt):ttnt?+rubberband(tt-nt,nt-et,it)+nt:tt}function computeRubberband(tt,[et,nt],[it,rt]){const[[ot,at],[st,lt]]=tt;return[rubberbandIfOutOfBounds(et,ot,at,it),rubberbandIfOutOfBounds(nt,st,lt,rt)]}function _toPrimitive$F(tt,et){if(typeof tt!="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(typeof it!="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function _toPropertyKey$E(tt){var et=_toPrimitive$F(tt,"string");return typeof et=="symbol"?et:String(et)}function _defineProperty$I(tt,et,nt){return et=_toPropertyKey$E(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$F(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread2$2(tt){for(var et=1;et{var nt,it;return et.target===tt.currentTarget||((nt=tt.currentTarget)===null||nt===void 0||(it=nt.contains)===null||it===void 0?void 0:it.call(nt,et.target))})}function getTouchList(tt){return tt.type==="touchend"||tt.type==="touchcancel"?tt.changedTouches:tt.targetTouches}function getValueEvent(tt){return isTouch$1(tt)?getTouchList(tt)[0]:tt}function touchIds(tt){return getCurrentTargetTouchList(tt).map(et=>et.identifier)}function pointerId(tt){const et=getValueEvent(tt);return isTouch$1(tt)?et.identifier:et.pointerId}function pointerValues(tt){const et=getValueEvent(tt);return[et.clientX,et.clientY]}function getEventDetails(tt){const et={};if("buttons"in tt&&(et.buttons=tt.buttons),"shiftKey"in tt){const{shiftKey:nt,altKey:it,metaKey:rt,ctrlKey:ot}=tt;Object.assign(et,{shiftKey:nt,altKey:it,metaKey:rt,ctrlKey:ot})}return et}function call$2(tt,...et){return typeof tt=="function"?tt(...et):tt}function noop$a(){}function chain(...tt){return tt.length===0?noop$a:tt.length===1?tt[0]:function(){let et;for(const nt of tt)et=nt.apply(this,arguments)||et;return et}}function assignDefault(tt,et){return Object.assign({},et,tt||{})}const BEFORE_LAST_KINEMATICS_DELAY=32;class Engine{constructor(et,nt,it){this.ctrl=et,this.args=nt,this.key=it,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(et){this.ctrl.state[this.key]=et}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:et,shared:nt,ingKey:it,args:rt}=this;nt[it]=et._active=et.active=et._blocked=et._force=!1,et._step=[!1,!1],et.intentional=!1,et._movement=[0,0],et._distance=[0,0],et._direction=[0,0],et._delta=[0,0],et._bounds=[[-1/0,1/0],[-1/0,1/0]],et.args=rt,et.axis=void 0,et.memo=void 0,et.elapsedTime=et.timeDelta=0,et.direction=[0,0],et.distance=[0,0],et.overflow=[0,0],et._movementBound=[!1,!1],et.velocity=[0,0],et.movement=[0,0],et.delta=[0,0],et.timeStamp=0}start(et){const nt=this.state,it=this.config;nt._active||(this.reset(),this.computeInitial(),nt._active=!0,nt.target=et.target,nt.currentTarget=et.currentTarget,nt.lastOffset=it.from?call$2(it.from,nt):nt.offset,nt.offset=nt.lastOffset,nt.startTime=nt.timeStamp=et.timeStamp)}computeValues(et){const nt=this.state;nt._values=et,nt.values=this.config.transform(et)}computeInitial(){const et=this.state;et._initial=et._values,et.initial=et.values}compute(et){const{state:nt,config:it,shared:rt}=this;nt.args=this.args;let ot=0;if(et&&(nt.event=et,it.preventDefault&&et.cancelable&&nt.event.preventDefault(),nt.type=et.type,rt.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,rt.locked=!!document.pointerLockElement,Object.assign(rt,getEventDetails(et)),rt.down=rt.pressed=rt.buttons%2===1||rt.touches>0,ot=et.timeStamp-nt.timeStamp,nt.timeStamp=et.timeStamp,nt.elapsedTime=nt.timeStamp-nt.startTime),nt._active){const Et=nt._delta.map(Math.abs);V$2.addTo(nt._distance,Et)}this.axisIntent&&this.axisIntent(et);const[at,st]=nt._movement,[lt,ct]=it.threshold,{_step:ut,values:ht}=nt;if(it.hasCustomTransform?(ut[0]===!1&&(ut[0]=Math.abs(at)>=lt&&ht[0]),ut[1]===!1&&(ut[1]=Math.abs(st)>=ct&&ht[1])):(ut[0]===!1&&(ut[0]=Math.abs(at)>=lt&&Math.sign(at)*lt),ut[1]===!1&&(ut[1]=Math.abs(st)>=ct&&Math.sign(st)*ct)),nt.intentional=ut[0]!==!1||ut[1]!==!1,!nt.intentional)return;const dt=[0,0];if(it.hasCustomTransform){const[Et,$t]=ht;dt[0]=ut[0]!==!1?Et-ut[0]:0,dt[1]=ut[1]!==!1?$t-ut[1]:0}else dt[0]=ut[0]!==!1?at-ut[0]:0,dt[1]=ut[1]!==!1?st-ut[1]:0;this.restrictToAxis&&!nt._blocked&&this.restrictToAxis(dt);const pt=nt.offset,mt=nt._active&&!nt._blocked||nt.active;mt&&(nt.first=nt._active&&!nt.active,nt.last=!nt._active&&nt.active,nt.active=rt[this.ingKey]=nt._active,et&&(nt.first&&("bounds"in it&&(nt._bounds=call$2(it.bounds,nt)),this.setup&&this.setup()),nt.movement=dt,this.computeOffset()));const[gt,bt]=nt.offset,[[yt,wt],[vt,xt]]=nt._bounds;nt.overflow=[gtwt?1:0,btxt?1:0],nt._movementBound[0]=nt.overflow[0]?nt._movementBound[0]===!1?nt._movement[0]:nt._movementBound[0]:!1,nt._movementBound[1]=nt.overflow[1]?nt._movementBound[1]===!1?nt._movement[1]:nt._movementBound[1]:!1;const St=nt._active?it.rubberband||[0,0]:[0,0];if(nt.offset=computeRubberband(nt._bounds,nt.offset,St),nt.delta=V$2.sub(nt.offset,pt),this.computeMovement(),mt&&(!nt.last||ot>BEFORE_LAST_KINEMATICS_DELAY)){nt.delta=V$2.sub(nt.offset,pt);const Et=nt.delta.map(Math.abs);V$2.addTo(nt.distance,Et),nt.direction=nt.delta.map(Math.sign),nt._direction=nt._delta.map(Math.sign),!nt.first&&ot>0&&(nt.velocity=[Et[0]/ot,Et[1]/ot],nt.timeDelta=ot)}}emit(){const et=this.state,nt=this.shared,it=this.config;if(et._active||this.clean(),(et._blocked||!et.intentional)&&!et._force&&!it.triggerAllEvents)return;const rt=this.handler(_objectSpread2$2(_objectSpread2$2(_objectSpread2$2({},nt),et),{},{[this.aliasKey]:et.values}));rt!==void 0&&(et.memo=rt)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function selectAxis([tt,et],nt){const it=Math.abs(tt),rt=Math.abs(et);if(it>rt&&it>nt)return"x";if(rt>it&&rt>nt)return"y"}class CoordinatesEngine extends Engine{constructor(...et){super(...et),_defineProperty$I(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=V$2.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=V$2.sub(this.state.offset,this.state.lastOffset)}axisIntent(et){const nt=this.state,it=this.config;if(!nt.axis&&et){const rt=typeof it.axisThreshold=="object"?it.axisThreshold[getPointerType(et)]:it.axisThreshold;nt.axis=selectAxis(nt._movement,rt)}nt._blocked=(it.lockDirection||!!it.axis)&&!nt.axis||!!it.axis&&it.axis!==nt.axis}restrictToAxis(et){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":et[1]=0;break;case"y":et[0]=0;break}}}const identity$e=tt=>tt,DEFAULT_RUBBERBAND=.15,commonConfigResolver={enabled(tt=!0){return tt},eventOptions(tt,et,nt){return _objectSpread2$2(_objectSpread2$2({},nt.shared.eventOptions),tt)},preventDefault(tt=!1){return tt},triggerAllEvents(tt=!1){return tt},rubberband(tt=0){switch(tt){case!0:return[DEFAULT_RUBBERBAND,DEFAULT_RUBBERBAND];case!1:return[0,0];default:return V$2.toVector(tt)}},from(tt){if(typeof tt=="function")return tt;if(tt!=null)return V$2.toVector(tt)},transform(tt,et,nt){const it=tt||nt.shared.transform;return this.hasCustomTransform=!!it,it||identity$e},threshold(tt){return V$2.toVector(tt,0)}},DEFAULT_AXIS_THRESHOLD=0,coordinatesConfigResolver=_objectSpread2$2(_objectSpread2$2({},commonConfigResolver),{},{axis(tt,et,{axis:nt}){if(this.lockDirection=nt==="lock",!this.lockDirection)return nt},axisThreshold(tt=DEFAULT_AXIS_THRESHOLD){return tt},bounds(tt={}){if(typeof tt=="function")return ot=>coordinatesConfigResolver.bounds(tt(ot));if("current"in tt)return()=>tt.current;if(typeof HTMLElement=="function"&&tt instanceof HTMLElement)return tt;const{left:et=-1/0,right:nt=1/0,top:it=-1/0,bottom:rt=1/0}=tt;return[[et,nt],[it,rt]]}}),KEYS_DELTA_MAP={ArrowRight:(tt,et=1)=>[tt*et,0],ArrowLeft:(tt,et=1)=>[-1*tt*et,0],ArrowUp:(tt,et=1)=>[0,-1*tt*et],ArrowDown:(tt,et=1)=>[0,tt*et]};class DragEngine extends CoordinatesEngine{constructor(...et){super(...et),_defineProperty$I(this,"ingKey","dragging")}reset(){super.reset();const et=this.state;et._pointerId=void 0,et._pointerActive=!1,et._keyboardActive=!1,et._preventScroll=!1,et._delayed=!1,et.swipe=[0,0],et.tap=!1,et.canceled=!1,et.cancel=this.cancel.bind(this)}setup(){const et=this.state;if(et._bounds instanceof HTMLElement){const nt=et._bounds.getBoundingClientRect(),it=et.currentTarget.getBoundingClientRect(),rt={left:nt.left-it.left+et.offset[0],right:nt.right-it.right+et.offset[0],top:nt.top-it.top+et.offset[1],bottom:nt.bottom-it.bottom+et.offset[1]};et._bounds=coordinatesConfigResolver.bounds(rt)}}cancel(){const et=this.state;et.canceled||(et.canceled=!0,et._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(et){const nt=this.config,it=this.state;if(et.buttons!=null&&(Array.isArray(nt.pointerButtons)?!nt.pointerButtons.includes(et.buttons):nt.pointerButtons!==-1&&nt.pointerButtons!==et.buttons))return;const rt=this.ctrl.setEventIds(et);nt.pointerCapture&&et.target.setPointerCapture(et.pointerId),!(rt&&rt.size>1&&it._pointerActive)&&(this.start(et),this.setupPointer(et),it._pointerId=pointerId(et),it._pointerActive=!0,this.computeValues(pointerValues(et)),this.computeInitial(),nt.preventScrollAxis&&getPointerType(et)!=="mouse"?(it._active=!1,this.setupScrollPrevention(et)):nt.delay>0?(this.setupDelayTrigger(et),nt.triggerAllEvents&&(this.compute(et),this.emit())):this.startPointerDrag(et))}startPointerDrag(et){const nt=this.state;nt._active=!0,nt._preventScroll=!0,nt._delayed=!1,this.compute(et),this.emit()}pointerMove(et){const nt=this.state,it=this.config;if(!nt._pointerActive)return;const rt=pointerId(et);if(nt._pointerId!==void 0&&rt!==nt._pointerId)return;const ot=pointerValues(et);if(document.pointerLockElement===et.target?nt._delta=[et.movementX,et.movementY]:(nt._delta=V$2.sub(ot,nt._values),this.computeValues(ot)),V$2.addTo(nt._movement,nt._delta),this.compute(et),nt._delayed&&nt.intentional){this.timeoutStore.remove("dragDelay"),nt.active=!1,this.startPointerDrag(et);return}if(it.preventScrollAxis&&!nt._preventScroll)if(nt.axis)if(nt.axis===it.preventScrollAxis||it.preventScrollAxis==="xy"){nt._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(et);return}else return;this.emit()}pointerUp(et){this.ctrl.setEventIds(et);try{this.config.pointerCapture&&et.target.hasPointerCapture(et.pointerId)&&et.target.releasePointerCapture(et.pointerId)}catch{}const nt=this.state,it=this.config;if(!nt._active||!nt._pointerActive)return;const rt=pointerId(et);if(nt._pointerId!==void 0&&rt!==nt._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(et);const[ot,at]=nt._distance;if(nt.tap=ot<=it.tapsThreshold&&at<=it.tapsThreshold,nt.tap&&it.filterTaps)nt._force=!0;else{const[st,lt]=nt._delta,[ct,ut]=nt._movement,[ht,dt]=it.swipe.velocity,[pt,mt]=it.swipe.distance,gt=it.swipe.duration;if(nt.elapsedTimeht&&Math.abs(ct)>pt&&(nt.swipe[0]=Math.sign(st)),yt>dt&&Math.abs(ut)>mt&&(nt.swipe[1]=Math.sign(lt))}}this.emit()}pointerClick(et){!this.state.tap&&et.detail>0&&(et.preventDefault(),et.stopPropagation())}setupPointer(et){const nt=this.config,it=nt.device;nt.pointerLock&&et.currentTarget.requestPointerLock(),nt.pointerCapture||(this.eventStore.add(this.sharedConfig.window,it,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,it,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,it,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(et){this.state._preventScroll&&et.cancelable&&et.preventDefault()}setupScrollPrevention(et){this.state._preventScroll=!1,persistEvent(et);const nt=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",nt),this.eventStore.add(this.sharedConfig.window,"touch","cancel",nt),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,et)}setupDelayTrigger(et){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(et)},this.config.delay)}keyDown(et){const nt=KEYS_DELTA_MAP[et.key];if(nt){const it=this.state,rt=et.shiftKey?10:et.altKey?.1:1;this.start(et),it._delta=nt(this.config.keyboardDisplacement,rt),it._keyboardActive=!0,V$2.addTo(it._movement,it._delta),this.compute(et),this.emit()}}keyUp(et){et.key in KEYS_DELTA_MAP&&(this.state._keyboardActive=!1,this.setActive(),this.compute(et),this.emit())}bind(et){const nt=this.config.device;et(nt,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(et(nt,"change",this.pointerMove.bind(this)),et(nt,"end",this.pointerUp.bind(this)),et(nt,"cancel",this.pointerUp.bind(this)),et("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(et("key","down",this.keyDown.bind(this)),et("key","up",this.keyUp.bind(this))),this.config.filterTaps&&et("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function persistEvent(tt){"persist"in tt&&typeof tt.persist=="function"&&tt.persist()}const isBrowser$2=typeof window<"u"&&window.document&&window.document.createElement;function supportsTouchEvents(){return isBrowser$2&&"ontouchstart"in window}function isTouchScreen(){return supportsTouchEvents()||isBrowser$2&&window.navigator.maxTouchPoints>1}function supportsPointerEvents(){return isBrowser$2&&"onpointerdown"in window}function supportsPointerLock(){return isBrowser$2&&"exitPointerLock"in window.document}function supportsGestureEvents(){try{return"constructor"in GestureEvent}catch{return!1}}const SUPPORT={isBrowser:isBrowser$2,gesture:supportsGestureEvents(),touch:supportsTouchEvents(),touchscreen:isTouchScreen(),pointer:supportsPointerEvents(),pointerLock:supportsPointerLock()},DEFAULT_PREVENT_SCROLL_DELAY=250,DEFAULT_DRAG_DELAY=180,DEFAULT_SWIPE_VELOCITY=.5,DEFAULT_SWIPE_DISTANCE=50,DEFAULT_SWIPE_DURATION=250,DEFAULT_KEYBOARD_DISPLACEMENT=10,DEFAULT_DRAG_AXIS_THRESHOLD={mouse:0,touch:0,pen:8},dragConfigResolver=_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{device(tt,et,{pointer:{touch:nt=!1,lock:it=!1,mouse:rt=!1}={}}){return this.pointerLock=it&&SUPPORT.pointerLock,SUPPORT.touch&&nt?"touch":this.pointerLock?"mouse":SUPPORT.pointer&&!rt?"pointer":SUPPORT.touch?"touch":"mouse"},preventScrollAxis(tt,et,{preventScroll:nt}){if(this.preventScrollDelay=typeof nt=="number"?nt:nt||nt===void 0&&tt?DEFAULT_PREVENT_SCROLL_DELAY:void 0,!(!SUPPORT.touchscreen||nt===!1))return tt||(nt!==void 0?"y":void 0)},pointerCapture(tt,et,{pointer:{capture:nt=!0,buttons:it=1,keys:rt=!0}={}}){return this.pointerButtons=it,this.keys=rt,!this.pointerLock&&this.device==="pointer"&&nt},threshold(tt,et,{filterTaps:nt=!1,tapsThreshold:it=3,axis:rt=void 0}){const ot=V$2.toVector(tt,nt?it:rt?1:0);return this.filterTaps=nt,this.tapsThreshold=it,ot},swipe({velocity:tt=DEFAULT_SWIPE_VELOCITY,distance:et=DEFAULT_SWIPE_DISTANCE,duration:nt=DEFAULT_SWIPE_DURATION}={}){return{velocity:this.transform(V$2.toVector(tt)),distance:this.transform(V$2.toVector(et)),duration:nt}},delay(tt=0){switch(tt){case!0:return DEFAULT_DRAG_DELAY;case!1:return 0;default:return tt}},axisThreshold(tt){return tt?_objectSpread2$2(_objectSpread2$2({},DEFAULT_DRAG_AXIS_THRESHOLD),tt):DEFAULT_DRAG_AXIS_THRESHOLD},keyboardDisplacement(tt=DEFAULT_KEYBOARD_DISPLACEMENT){return tt}});_objectSpread2$2(_objectSpread2$2({},commonConfigResolver),{},{device(tt,et,{shared:nt,pointer:{touch:it=!1}={}}){if(nt.target&&!SUPPORT.touch&&SUPPORT.gesture)return"gesture";if(SUPPORT.touch&&it)return"touch";if(SUPPORT.touchscreen){if(SUPPORT.pointer)return"pointer";if(SUPPORT.touch)return"touch"}},bounds(tt,et,{scaleBounds:nt={},angleBounds:it={}}){const rt=at=>{const st=assignDefault(call$2(nt,at),{min:-1/0,max:1/0});return[st.min,st.max]},ot=at=>{const st=assignDefault(call$2(it,at),{min:-1/0,max:1/0});return[st.min,st.max]};return typeof nt!="function"&&typeof it!="function"?[rt(),ot()]:at=>[rt(at),ot(at)]},threshold(tt,et,nt){return this.lockDirection=nt.axis==="lock",V$2.toVector(tt,this.lockDirection?[.1,3]:0)},modifierKey(tt){return tt===void 0?"ctrlKey":tt},pinchOnWheel(tt=!0){return tt}});_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{mouseOnly:(tt=!0)=>tt});_objectSpread2$2(_objectSpread2$2({},coordinatesConfigResolver),{},{mouseOnly:(tt=!0)=>tt});const EngineMap=new Map,ConfigResolverMap=new Map;function registerAction(tt){EngineMap.set(tt.key,tt.engine),ConfigResolverMap.set(tt.key,tt.resolver)}const dragAction={key:"drag",engine:DragEngine,resolver:dragConfigResolver};function _objectWithoutPropertiesLoose$p(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _objectWithoutProperties$m(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$p(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}const sharedConfigResolver={target(tt){if(tt)return()=>"current"in tt?tt.current:tt},enabled(tt=!0){return tt},window(tt=SUPPORT.isBrowser?window:void 0){return tt},eventOptions({passive:tt=!0,capture:et=!1}={}){return{passive:tt,capture:et}},transform(tt){return tt}},_excluded$1i=["target","eventOptions","window","enabled","transform"];function resolveWith(tt={},et){const nt={};for(const[it,rt]of Object.entries(et))switch(typeof rt){case"function":nt[it]=rt.call(nt,tt[it],it,tt);break;case"object":nt[it]=resolveWith(tt[it],rt);break;case"boolean":rt&&(nt[it]=tt[it]);break}return nt}function parse$4(tt,et,nt={}){const it=tt,{target:rt,eventOptions:ot,window:at,enabled:st,transform:lt}=it,ct=_objectWithoutProperties$m(it,_excluded$1i);if(nt.shared=resolveWith({target:rt,eventOptions:ot,window:at,enabled:st,transform:lt},sharedConfigResolver),et){const ut=ConfigResolverMap.get(et);nt[et]=resolveWith(_objectSpread2$2({shared:nt.shared},ct),ut)}else for(const ut in ct){const ht=ConfigResolverMap.get(ut);ht&&(nt[ut]=resolveWith(_objectSpread2$2({shared:nt.shared},ct[ut]),ht))}return nt}class EventStore{constructor(et,nt){_defineProperty$I(this,"_listeners",new Set),this._ctrl=et,this._gestureKey=nt}add(et,nt,it,rt,ot){const at=this._listeners,st=toDomEventType(nt,it),lt=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},ct=_objectSpread2$2(_objectSpread2$2({},lt),ot);et.addEventListener(st,rt,ct);const ut=()=>{et.removeEventListener(st,rt,ct),at.delete(ut)};return at.add(ut),ut}clean(){this._listeners.forEach(et=>et()),this._listeners.clear()}}class TimeoutStore{constructor(){_defineProperty$I(this,"_timeouts",new Map)}add(et,nt,it=140,...rt){this.remove(et),this._timeouts.set(et,window.setTimeout(nt,it,...rt))}remove(et){const nt=this._timeouts.get(et);nt&&window.clearTimeout(nt)}clean(){this._timeouts.forEach(et=>void window.clearTimeout(et)),this._timeouts.clear()}}let Controller$1=class{constructor(et){_defineProperty$I(this,"gestures",new Set),_defineProperty$I(this,"_targetEventStore",new EventStore(this)),_defineProperty$I(this,"gestureEventStores",{}),_defineProperty$I(this,"gestureTimeoutStores",{}),_defineProperty$I(this,"handlers",{}),_defineProperty$I(this,"config",{}),_defineProperty$I(this,"pointerIds",new Set),_defineProperty$I(this,"touchIds",new Set),_defineProperty$I(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),resolveGestures(this,et)}setEventIds(et){if(isTouch$1(et))return this.touchIds=new Set(touchIds(et)),this.touchIds;if("pointerId"in et)return et.type==="pointerup"||et.type==="pointercancel"?this.pointerIds.delete(et.pointerId):et.type==="pointerdown"&&this.pointerIds.add(et.pointerId),this.pointerIds}applyHandlers(et,nt){this.handlers=et,this.nativeHandlers=nt}applyConfig(et,nt){this.config=parse$4(et,nt,this.config)}clean(){this._targetEventStore.clean();for(const et of this.gestures)this.gestureEventStores[et].clean(),this.gestureTimeoutStores[et].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...et){const nt=this.config.shared,it={};let rt;if(!(nt.target&&(rt=nt.target(),!rt))){if(nt.enabled){for(const at of this.gestures){const st=this.config[at],lt=bindToProps(it,st.eventOptions,!!rt);if(st.enabled){const ct=EngineMap.get(at);new ct(this,et,at).bind(lt)}}const ot=bindToProps(it,nt.eventOptions,!!rt);for(const at in this.nativeHandlers)ot(at,"",st=>this.nativeHandlers[at](_objectSpread2$2(_objectSpread2$2({},this.state.shared),{},{event:st,args:et})),void 0,!0)}for(const ot in it)it[ot]=chain(...it[ot]);if(!rt)return it;for(const ot in it){const{device:at,capture:st,passive:lt}=parseProp(ot);this._targetEventStore.add(rt,at,"",it[ot],{capture:st,passive:lt})}}}};function setupGesture(tt,et){tt.gestures.add(et),tt.gestureEventStores[et]=new EventStore(tt,et),tt.gestureTimeoutStores[et]=new TimeoutStore}function resolveGestures(tt,et){et.drag&&setupGesture(tt,"drag"),et.wheel&&setupGesture(tt,"wheel"),et.scroll&&setupGesture(tt,"scroll"),et.move&&setupGesture(tt,"move"),et.pinch&&setupGesture(tt,"pinch"),et.hover&&setupGesture(tt,"hover")}const bindToProps=(tt,et,nt)=>(it,rt,ot,at={},st=!1)=>{var lt,ct;const ut=(lt=at.capture)!==null&<!==void 0?lt:et.capture,ht=(ct=at.passive)!==null&&ct!==void 0?ct:et.passive;let dt=st?it:toHandlerProp(it,rt,ut);nt&&ht&&(dt+="Passive"),tt[dt]=tt[dt]||[],tt[dt].push(ot)};function useRecognizers(tt,et={},nt,it){const rt=React$1.useMemo(()=>new Controller$1(tt),[]);if(rt.applyHandlers(tt,it),rt.applyConfig(et,nt),React$1.useEffect(rt.effect.bind(rt)),React$1.useEffect(()=>rt.clean.bind(rt),[]),et.target===void 0)return rt.bind.bind(rt)}function useDrag$2(tt,et){return registerAction(dragAction),useRecognizers({drag:tt},et||{},"drag")}function $e42e1063c40fb3ef$export$b9ecd428b558ff10(tt,et,{checkForDefaultPrevented:nt=!0}={}){return function(rt){if(tt==null||tt(rt),nt===!1||!rt.defaultPrevented)return et==null?void 0:et(rt)}}function $c512c27ab02ef895$export$50c7b4e9d9f19c1(tt,et=[]){let nt=[];function it(ot,at){const st=reactExports.createContext(at),lt=nt.length;nt=[...nt,at];function ct(ht){const{scope:dt,children:pt,...mt}=ht,gt=(dt==null?void 0:dt[tt][lt])||st,bt=reactExports.useMemo(()=>mt,Object.values(mt));return reactExports.createElement(gt.Provider,{value:bt},pt)}function ut(ht,dt){const pt=(dt==null?void 0:dt[tt][lt])||st,mt=reactExports.useContext(pt);if(mt)return mt;if(at!==void 0)return at;throw new Error(`\`${ht}\` must be used within \`${ot}\``)}return ct.displayName=ot+"Provider",[ct,ut]}const rt=()=>{const ot=nt.map(at=>reactExports.createContext(at));return function(st){const lt=(st==null?void 0:st[tt])||ot;return reactExports.useMemo(()=>({[`__scope${tt}`]:{...st,[tt]:lt}}),[st,lt])}};return rt.scopeName=tt,[it,$c512c27ab02ef895$var$composeContextScopes(rt,...et)]}function $c512c27ab02ef895$var$composeContextScopes(...tt){const et=tt[0];if(tt.length===1)return et;const nt=()=>{const it=tt.map(rt=>({useScope:rt(),scopeName:rt.scopeName}));return function(ot){const at=it.reduce((st,{useScope:lt,scopeName:ct})=>{const ht=lt(ot)[`__scope${ct}`];return{...st,...ht}},{});return reactExports.useMemo(()=>({[`__scope${et.scopeName}`]:at}),[at])}};return nt.scopeName=et.scopeName,nt}function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt){const et=reactExports.useRef(tt);return reactExports.useEffect(()=>{et.current=tt}),reactExports.useMemo(()=>(...nt)=>{var it;return(it=et.current)===null||it===void 0?void 0:it.call(et,...nt)},[])}function $addc16e1bbe58fd0$export$3a72a57244d6e765(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt);reactExports.useEffect(()=>{const it=rt=>{rt.key==="Escape"&&nt(rt)};return et.addEventListener("keydown",it),()=>et.removeEventListener("keydown",it)},[nt,et])}const $5cb92bef7577960e$var$CONTEXT_UPDATE="dismissableLayer.update",$5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",$5cb92bef7577960e$var$FOCUS_OUTSIDE="dismissableLayer.focusOutside";let $5cb92bef7577960e$var$originalBodyPointerEvents;const $5cb92bef7577960e$var$DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$5cb92bef7577960e$export$177fb62ff3ec1f22=reactExports.forwardRef((tt,et)=>{var nt;const{disableOutsidePointerEvents:it=!1,onEscapeKeyDown:rt,onPointerDownOutside:ot,onFocusOutside:at,onInteractOutside:st,onDismiss:lt,...ct}=tt,ut=reactExports.useContext($5cb92bef7577960e$var$DismissableLayerContext),[ht,dt]=reactExports.useState(null),pt=(nt=ht==null?void 0:ht.ownerDocument)!==null&&nt!==void 0?nt:globalThis==null?void 0:globalThis.document,[,mt]=reactExports.useState({}),gt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,It=>dt(It)),bt=Array.from(ut.layers),[yt]=[...ut.layersWithOutsidePointerEventsDisabled].slice(-1),wt=bt.indexOf(yt),vt=ht?bt.indexOf(ht):-1,xt=ut.layersWithOutsidePointerEventsDisabled.size>0,St=vt>=wt,Et=$5cb92bef7577960e$var$usePointerDownOutside(It=>{const Ft=It.target,Ht=[...ut.branches].some(zt=>zt.contains(Ft));!St||Ht||(ot==null||ot(It),st==null||st(It),It.defaultPrevented||lt==null||lt())},pt),$t=$5cb92bef7577960e$var$useFocusOutside(It=>{const Ft=It.target;[...ut.branches].some(zt=>zt.contains(Ft))||(at==null||at(It),st==null||st(It),It.defaultPrevented||lt==null||lt())},pt);return $addc16e1bbe58fd0$export$3a72a57244d6e765(It=>{vt===ut.layers.size-1&&(rt==null||rt(It),!It.defaultPrevented&<&&(It.preventDefault(),lt()))},pt),reactExports.useEffect(()=>{if(ht)return it&&(ut.layersWithOutsidePointerEventsDisabled.size===0&&($5cb92bef7577960e$var$originalBodyPointerEvents=pt.body.style.pointerEvents,pt.body.style.pointerEvents="none"),ut.layersWithOutsidePointerEventsDisabled.add(ht)),ut.layers.add(ht),$5cb92bef7577960e$var$dispatchUpdate(),()=>{it&&ut.layersWithOutsidePointerEventsDisabled.size===1&&(pt.body.style.pointerEvents=$5cb92bef7577960e$var$originalBodyPointerEvents)}},[ht,pt,it,ut]),reactExports.useEffect(()=>()=>{ht&&(ut.layers.delete(ht),ut.layersWithOutsidePointerEventsDisabled.delete(ht),$5cb92bef7577960e$var$dispatchUpdate())},[ht,ut]),reactExports.useEffect(()=>{const It=()=>mt({});return document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,It),()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE,It)},[]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$t({},ct,{ref:gt,style:{pointerEvents:xt?St?"auto":"none":void 0,...tt.style},onFocusCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onFocusCapture,$t.onFocusCapture),onBlurCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onBlurCapture,$t.onBlurCapture),onPointerDownCapture:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerDownCapture,Et.onPointerDownCapture)}))});function $5cb92bef7577960e$var$usePointerDownOutside(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt),it=reactExports.useRef(!1),rt=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const ot=st=>{if(st.target&&!it.current){let ct=function(){$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE,nt,lt,{discrete:!0})};const lt={originalEvent:st};st.pointerType==="touch"?(et.removeEventListener("click",rt.current),rt.current=ct,et.addEventListener("click",rt.current,{once:!0})):ct()}else et.removeEventListener("click",rt.current);it.current=!1},at=window.setTimeout(()=>{et.addEventListener("pointerdown",ot)},0);return()=>{window.clearTimeout(at),et.removeEventListener("pointerdown",ot),et.removeEventListener("click",rt.current)}},[et,nt]),{onPointerDownCapture:()=>it.current=!0}}function $5cb92bef7577960e$var$useFocusOutside(tt,et=globalThis==null?void 0:globalThis.document){const nt=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(tt),it=reactExports.useRef(!1);return reactExports.useEffect(()=>{const rt=ot=>{ot.target&&!it.current&&$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE,nt,{originalEvent:ot},{discrete:!1})};return et.addEventListener("focusin",rt),()=>et.removeEventListener("focusin",rt)},[et,nt]),{onFocusCapture:()=>it.current=!0,onBlurCapture:()=>it.current=!1}}function $5cb92bef7577960e$var$dispatchUpdate(){const tt=new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);document.dispatchEvent(tt)}function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(tt,et,nt,{discrete:it}){const rt=nt.originalEvent.target,ot=new CustomEvent(tt,{bubbles:!1,cancelable:!0,detail:nt});et&&rt.addEventListener(tt,et,{once:!0}),it?$8927f6f2acc4f386$export$6d1a0317bde7de7f(rt,ot):rt.dispatchEvent(ot)}const $9f79659886946c16$export$e5c5a5f917a5871c=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{},$1746a345f3d73bb7$var$useReactId=React$2["useId".toString()]||(()=>{});let $1746a345f3d73bb7$var$count=0;function $1746a345f3d73bb7$export$f680877a34711e37(tt){const[et,nt]=reactExports.useState($1746a345f3d73bb7$var$useReactId());return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{tt||nt(it=>it??String($1746a345f3d73bb7$var$count++))},[tt]),tt||(et?`radix-${et}`:"")}const sides=["top","right","bottom","left"],min$7=Math.min,max$7=Math.max,round$4=Math.round,floor$1=Math.floor,createCoords=tt=>({x:tt,y:tt}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$8(tt,et,nt){return max$7(tt,min$7(et,nt))}function evaluate$1(tt,et){return typeof tt=="function"?tt(et):tt}function getSide(tt){return tt.split("-")[0]}function getAlignment(tt){return tt.split("-")[1]}function getOppositeAxis(tt){return tt==="x"?"y":"x"}function getAxisLength(tt){return tt==="y"?"height":"width"}function getSideAxis(tt){return["top","bottom"].includes(getSide(tt))?"y":"x"}function getAlignmentAxis(tt){return getOppositeAxis(getSideAxis(tt))}function getAlignmentSides(tt,et,nt){nt===void 0&&(nt=!1);const it=getAlignment(tt),rt=getAlignmentAxis(tt),ot=getAxisLength(rt);let at=rt==="x"?it===(nt?"end":"start")?"right":"left":it==="start"?"bottom":"top";return et.reference[ot]>et.floating[ot]&&(at=getOppositePlacement$1(at)),[at,getOppositePlacement$1(at)]}function getExpandedPlacements(tt){const et=getOppositePlacement$1(tt);return[getOppositeAlignmentPlacement(tt),et,getOppositeAlignmentPlacement(et)]}function getOppositeAlignmentPlacement(tt){return tt.replace(/start|end/g,et=>oppositeAlignmentMap[et])}function getSideList(tt,et,nt){const it=["left","right"],rt=["right","left"],ot=["top","bottom"],at=["bottom","top"];switch(tt){case"top":case"bottom":return nt?et?rt:it:et?it:rt;case"left":case"right":return et?ot:at;default:return[]}}function getOppositeAxisPlacements(tt,et,nt,it){const rt=getAlignment(tt);let ot=getSideList(getSide(tt),nt==="start",it);return rt&&(ot=ot.map(at=>at+"-"+rt),et&&(ot=ot.concat(ot.map(getOppositeAlignmentPlacement)))),ot}function getOppositePlacement$1(tt){return tt.replace(/left|right|bottom|top/g,et=>oppositeSideMap[et])}function expandPaddingObject(tt){return{top:0,right:0,bottom:0,left:0,...tt}}function getPaddingObject(tt){return typeof tt!="number"?expandPaddingObject(tt):{top:tt,right:tt,bottom:tt,left:tt}}function rectToClientRect$1(tt){return{...tt,top:tt.y,left:tt.x,right:tt.x+tt.width,bottom:tt.y+tt.height}}function computeCoordsFromPlacement(tt,et,nt){let{reference:it,floating:rt}=tt;const ot=getSideAxis(et),at=getAlignmentAxis(et),st=getAxisLength(at),lt=getSide(et),ct=ot==="y",ut=it.x+it.width/2-rt.width/2,ht=it.y+it.height/2-rt.height/2,dt=it[st]/2-rt[st]/2;let pt;switch(lt){case"top":pt={x:ut,y:it.y-rt.height};break;case"bottom":pt={x:ut,y:it.y+it.height};break;case"right":pt={x:it.x+it.width,y:ht};break;case"left":pt={x:it.x-rt.width,y:ht};break;default:pt={x:it.x,y:it.y}}switch(getAlignment(et)){case"start":pt[at]-=dt*(nt&&ct?-1:1);break;case"end":pt[at]+=dt*(nt&&ct?-1:1);break}return pt}const computePosition$1=async(tt,et,nt)=>{const{placement:it="bottom",strategy:rt="absolute",middleware:ot=[],platform:at}=nt,st=ot.filter(Boolean),lt=await(at.isRTL==null?void 0:at.isRTL(et));let ct=await at.getElementRects({reference:tt,floating:et,strategy:rt}),{x:ut,y:ht}=computeCoordsFromPlacement(ct,it,lt),dt=it,pt={},mt=0;for(let gt=0;gt({name:"arrow",options:tt,async fn(et){const{x:nt,y:it,placement:rt,rects:ot,platform:at,elements:st,middlewareData:lt}=et,{element:ct,padding:ut=0}=evaluate$1(tt,et)||{};if(ct==null)return{};const ht=getPaddingObject(ut),dt={x:nt,y:it},pt=getAlignmentAxis(rt),mt=getAxisLength(pt),gt=await at.getDimensions(ct),bt=pt==="y",yt=bt?"top":"left",wt=bt?"bottom":"right",vt=bt?"clientHeight":"clientWidth",xt=ot.reference[mt]+ot.reference[pt]-dt[pt]-ot.floating[mt],St=dt[pt]-ot.reference[pt],Et=await(at.getOffsetParent==null?void 0:at.getOffsetParent(ct));let $t=Et?Et[vt]:0;(!$t||!await(at.isElement==null?void 0:at.isElement(Et)))&&($t=st.floating[vt]||ot.floating[mt]);const It=xt/2-St/2,Ft=$t/2-gt[mt]/2-1,Ht=min$7(ht[yt],Ft),zt=min$7(ht[wt],Ft),Ot=Ht,jt=$t-gt[mt]-zt,kt=$t/2-gt[mt]/2+It,Tt=clamp$8(Ot,kt,jt),Ct=!lt.arrow&&getAlignment(rt)!=null&&kt!=Tt&&ot.reference[mt]/2-(ktOt<=0)){var Ft,Ht;const Ot=(((Ft=ot.flip)==null?void 0:Ft.index)||0)+1,jt=St[Ot];if(jt)return{data:{index:Ot,overflows:It},reset:{placement:jt}};let kt=(Ht=It.filter(Tt=>Tt.overflows[0]<=0).sort((Tt,Ct)=>Tt.overflows[1]-Ct.overflows[1])[0])==null?void 0:Ht.placement;if(!kt)switch(pt){case"bestFit":{var zt;const Tt=(zt=It.map(Ct=>[Ct.placement,Ct.overflows.filter(Ut=>Ut>0).reduce((Ut,Nt)=>Ut+Nt,0)]).sort((Ct,Ut)=>Ct[1]-Ut[1])[0])==null?void 0:zt[0];Tt&&(kt=Tt);break}case"initialPlacement":kt=st;break}if(rt!==kt)return{reset:{placement:kt}}}return{}}}};function getSideOffsets$1(tt,et){return{top:tt.top-et.height,right:tt.right-et.width,bottom:tt.bottom-et.height,left:tt.left-et.width}}function isAnySideFullyClipped$1(tt){return sides.some(et=>tt[et]>=0)}const hide$5=function(tt){return tt===void 0&&(tt={}),{name:"hide",options:tt,async fn(et){const{rects:nt}=et,{strategy:it="referenceHidden",...rt}=evaluate$1(tt,et);switch(it){case"referenceHidden":{const ot=await detectOverflow$1(et,{...rt,elementContext:"reference"}),at=getSideOffsets$1(ot,nt.reference);return{data:{referenceHiddenOffsets:at,referenceHidden:isAnySideFullyClipped$1(at)}}}case"escaped":{const ot=await detectOverflow$1(et,{...rt,altBoundary:!0}),at=getSideOffsets$1(ot,nt.floating);return{data:{escapedOffsets:at,escaped:isAnySideFullyClipped$1(at)}}}default:return{}}}}};async function convertValueToCoords(tt,et){const{placement:nt,platform:it,elements:rt}=tt,ot=await(it.isRTL==null?void 0:it.isRTL(rt.floating)),at=getSide(nt),st=getAlignment(nt),lt=getSideAxis(nt)==="y",ct=["left","top"].includes(at)?-1:1,ut=ot&<?-1:1,ht=evaluate$1(et,tt);let{mainAxis:dt,crossAxis:pt,alignmentAxis:mt}=typeof ht=="number"?{mainAxis:ht,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...ht};return st&&typeof mt=="number"&&(pt=st==="end"?mt*-1:mt),lt?{x:pt*ut,y:dt*ct}:{x:dt*ct,y:pt*ut}}const offset$3=function(tt){return tt===void 0&&(tt=0),{name:"offset",options:tt,async fn(et){var nt,it;const{x:rt,y:ot,placement:at,middlewareData:st}=et,lt=await convertValueToCoords(et,tt);return at===((nt=st.offset)==null?void 0:nt.placement)&&(it=st.arrow)!=null&&it.alignmentOffset?{}:{x:rt+lt.x,y:ot+lt.y,data:{...lt,placement:at}}}}},shift=function(tt){return tt===void 0&&(tt={}),{name:"shift",options:tt,async fn(et){const{x:nt,y:it,placement:rt}=et,{mainAxis:ot=!0,crossAxis:at=!1,limiter:st={fn:bt=>{let{x:yt,y:wt}=bt;return{x:yt,y:wt}}},...lt}=evaluate$1(tt,et),ct={x:nt,y:it},ut=await detectOverflow$1(et,lt),ht=getSideAxis(getSide(rt)),dt=getOppositeAxis(ht);let pt=ct[dt],mt=ct[ht];if(ot){const bt=dt==="y"?"top":"left",yt=dt==="y"?"bottom":"right",wt=pt+ut[bt],vt=pt-ut[yt];pt=clamp$8(wt,pt,vt)}if(at){const bt=ht==="y"?"top":"left",yt=ht==="y"?"bottom":"right",wt=mt+ut[bt],vt=mt-ut[yt];mt=clamp$8(wt,mt,vt)}const gt=st.fn({...et,[dt]:pt,[ht]:mt});return{...gt,data:{x:gt.x-nt,y:gt.y-it}}}}},limitShift=function(tt){return tt===void 0&&(tt={}),{options:tt,fn(et){const{x:nt,y:it,placement:rt,rects:ot,middlewareData:at}=et,{offset:st=0,mainAxis:lt=!0,crossAxis:ct=!0}=evaluate$1(tt,et),ut={x:nt,y:it},ht=getSideAxis(rt),dt=getOppositeAxis(ht);let pt=ut[dt],mt=ut[ht];const gt=evaluate$1(st,et),bt=typeof gt=="number"?{mainAxis:gt,crossAxis:0}:{mainAxis:0,crossAxis:0,...gt};if(lt){const vt=dt==="y"?"height":"width",xt=ot.reference[dt]-ot.floating[vt]+bt.mainAxis,St=ot.reference[dt]+ot.reference[vt]-bt.mainAxis;ptSt&&(pt=St)}if(ct){var yt,wt;const vt=dt==="y"?"width":"height",xt=["top","left"].includes(getSide(rt)),St=ot.reference[ht]-ot.floating[vt]+(xt&&((yt=at.offset)==null?void 0:yt[ht])||0)+(xt?0:bt.crossAxis),Et=ot.reference[ht]+ot.reference[vt]+(xt?0:((wt=at.offset)==null?void 0:wt[ht])||0)-(xt?bt.crossAxis:0);mtEt&&(mt=Et)}return{[dt]:pt,[ht]:mt}}}},size=function(tt){return tt===void 0&&(tt={}),{name:"size",options:tt,async fn(et){const{placement:nt,rects:it,platform:rt,elements:ot}=et,{apply:at=()=>{},...st}=evaluate$1(tt,et),lt=await detectOverflow$1(et,st),ct=getSide(nt),ut=getAlignment(nt),ht=getSideAxis(nt)==="y",{width:dt,height:pt}=it.floating;let mt,gt;ct==="top"||ct==="bottom"?(mt=ct,gt=ut===(await(rt.isRTL==null?void 0:rt.isRTL(ot.floating))?"start":"end")?"left":"right"):(gt=ct,mt=ut==="end"?"top":"bottom");const bt=pt-lt[mt],yt=dt-lt[gt],wt=!et.middlewareData.shift;let vt=bt,xt=yt;if(ht){const Et=dt-lt.left-lt.right;xt=ut||wt?min$7(yt,Et):Et}else{const Et=pt-lt.top-lt.bottom;vt=ut||wt?min$7(bt,Et):Et}if(wt&&!ut){const Et=max$7(lt.left,0),$t=max$7(lt.right,0),It=max$7(lt.top,0),Ft=max$7(lt.bottom,0);ht?xt=dt-2*(Et!==0||$t!==0?Et+$t:max$7(lt.left,lt.right)):vt=pt-2*(It!==0||Ft!==0?It+Ft:max$7(lt.top,lt.bottom))}await at({...et,availableWidth:xt,availableHeight:vt});const St=await rt.getDimensions(ot.floating);return dt!==St.width||pt!==St.height?{reset:{rects:!0}}:{}}}};function getNodeName$1(tt){return isNode(tt)?(tt.nodeName||"").toLowerCase():"#document"}function getWindow$1(tt){var et;return(tt==null||(et=tt.ownerDocument)==null?void 0:et.defaultView)||window}function getDocumentElement$1(tt){var et;return(et=(isNode(tt)?tt.ownerDocument:tt.document)||window.document)==null?void 0:et.documentElement}function isNode(tt){return tt instanceof Node||tt instanceof getWindow$1(tt).Node}function isElement$1(tt){return tt instanceof Element||tt instanceof getWindow$1(tt).Element}function isHTMLElement$3(tt){return tt instanceof HTMLElement||tt instanceof getWindow$1(tt).HTMLElement}function isShadowRoot$1(tt){return typeof ShadowRoot>"u"?!1:tt instanceof ShadowRoot||tt instanceof getWindow$1(tt).ShadowRoot}function isOverflowElement(tt){const{overflow:et,overflowX:nt,overflowY:it,display:rt}=getComputedStyle$2(tt);return/auto|scroll|overlay|hidden|clip/.test(et+it+nt)&&!["inline","contents"].includes(rt)}function isTableElement$1(tt){return["table","td","th"].includes(getNodeName$1(tt))}function isContainingBlock(tt){const et=isWebKit(),nt=getComputedStyle$2(tt);return nt.transform!=="none"||nt.perspective!=="none"||(nt.containerType?nt.containerType!=="normal":!1)||!et&&(nt.backdropFilter?nt.backdropFilter!=="none":!1)||!et&&(nt.filter?nt.filter!=="none":!1)||["transform","perspective","filter"].some(it=>(nt.willChange||"").includes(it))||["paint","layout","strict","content"].some(it=>(nt.contain||"").includes(it))}function getContainingBlock$1(tt){let et=getParentNode$1(tt);for(;isHTMLElement$3(et)&&!isLastTraversableNode(et);){if(isContainingBlock(et))return et;et=getParentNode$1(et)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(tt){return["html","body","#document"].includes(getNodeName$1(tt))}function getComputedStyle$2(tt){return getWindow$1(tt).getComputedStyle(tt)}function getNodeScroll$1(tt){return isElement$1(tt)?{scrollLeft:tt.scrollLeft,scrollTop:tt.scrollTop}:{scrollLeft:tt.pageXOffset,scrollTop:tt.pageYOffset}}function getParentNode$1(tt){if(getNodeName$1(tt)==="html")return tt;const et=tt.assignedSlot||tt.parentNode||isShadowRoot$1(tt)&&tt.host||getDocumentElement$1(tt);return isShadowRoot$1(et)?et.host:et}function getNearestOverflowAncestor(tt){const et=getParentNode$1(tt);return isLastTraversableNode(et)?tt.ownerDocument?tt.ownerDocument.body:tt.body:isHTMLElement$3(et)&&isOverflowElement(et)?et:getNearestOverflowAncestor(et)}function getOverflowAncestors(tt,et,nt){var it;et===void 0&&(et=[]),nt===void 0&&(nt=!0);const rt=getNearestOverflowAncestor(tt),ot=rt===((it=tt.ownerDocument)==null?void 0:it.body),at=getWindow$1(rt);return ot?et.concat(at,at.visualViewport||[],isOverflowElement(rt)?rt:[],at.frameElement&&nt?getOverflowAncestors(at.frameElement):[]):et.concat(rt,getOverflowAncestors(rt,[],nt))}function getCssDimensions(tt){const et=getComputedStyle$2(tt);let nt=parseFloat(et.width)||0,it=parseFloat(et.height)||0;const rt=isHTMLElement$3(tt),ot=rt?tt.offsetWidth:nt,at=rt?tt.offsetHeight:it,st=round$4(nt)!==ot||round$4(it)!==at;return st&&(nt=ot,it=at),{width:nt,height:it,$:st}}function unwrapElement(tt){return isElement$1(tt)?tt:tt.contextElement}function getScale$1(tt){const et=unwrapElement(tt);if(!isHTMLElement$3(et))return createCoords(1);const nt=et.getBoundingClientRect(),{width:it,height:rt,$:ot}=getCssDimensions(et);let at=(ot?round$4(nt.width):nt.width)/it,st=(ot?round$4(nt.height):nt.height)/rt;return(!at||!Number.isFinite(at))&&(at=1),(!st||!Number.isFinite(st))&&(st=1),{x:at,y:st}}const noOffsets=createCoords(0);function getVisualOffsets(tt){const et=getWindow$1(tt);return!isWebKit()||!et.visualViewport?noOffsets:{x:et.visualViewport.offsetLeft,y:et.visualViewport.offsetTop}}function shouldAddVisualOffsets(tt,et,nt){return et===void 0&&(et=!1),!nt||et&&nt!==getWindow$1(tt)?!1:et}function getBoundingClientRect$1(tt,et,nt,it){et===void 0&&(et=!1),nt===void 0&&(nt=!1);const rt=tt.getBoundingClientRect(),ot=unwrapElement(tt);let at=createCoords(1);et&&(it?isElement$1(it)&&(at=getScale$1(it)):at=getScale$1(tt));const st=shouldAddVisualOffsets(ot,nt,it)?getVisualOffsets(ot):createCoords(0);let lt=(rt.left+st.x)/at.x,ct=(rt.top+st.y)/at.y,ut=rt.width/at.x,ht=rt.height/at.y;if(ot){const dt=getWindow$1(ot),pt=it&&isElement$1(it)?getWindow$1(it):it;let mt=dt.frameElement;for(;mt&&it&&pt!==dt;){const gt=getScale$1(mt),bt=mt.getBoundingClientRect(),yt=getComputedStyle$2(mt),wt=bt.left+(mt.clientLeft+parseFloat(yt.paddingLeft))*gt.x,vt=bt.top+(mt.clientTop+parseFloat(yt.paddingTop))*gt.y;lt*=gt.x,ct*=gt.y,ut*=gt.x,ht*=gt.y,lt+=wt,ct+=vt,mt=getWindow$1(mt).frameElement}}return rectToClientRect$1({width:ut,height:ht,x:lt,y:ct})}function convertOffsetParentRelativeRectToViewportRelativeRect(tt){let{rect:et,offsetParent:nt,strategy:it}=tt;const rt=isHTMLElement$3(nt),ot=getDocumentElement$1(nt);if(nt===ot)return et;let at={scrollLeft:0,scrollTop:0},st=createCoords(1);const lt=createCoords(0);if((rt||!rt&&it!=="fixed")&&((getNodeName$1(nt)!=="body"||isOverflowElement(ot))&&(at=getNodeScroll$1(nt)),isHTMLElement$3(nt))){const ct=getBoundingClientRect$1(nt);st=getScale$1(nt),lt.x=ct.x+nt.clientLeft,lt.y=ct.y+nt.clientTop}return{width:et.width*st.x,height:et.height*st.y,x:et.x*st.x-at.scrollLeft*st.x+lt.x,y:et.y*st.y-at.scrollTop*st.y+lt.y}}function getClientRects(tt){return Array.from(tt.getClientRects())}function getWindowScrollBarX$1(tt){return getBoundingClientRect$1(getDocumentElement$1(tt)).left+getNodeScroll$1(tt).scrollLeft}function getDocumentRect$1(tt){const et=getDocumentElement$1(tt),nt=getNodeScroll$1(tt),it=tt.ownerDocument.body,rt=max$7(et.scrollWidth,et.clientWidth,it.scrollWidth,it.clientWidth),ot=max$7(et.scrollHeight,et.clientHeight,it.scrollHeight,it.clientHeight);let at=-nt.scrollLeft+getWindowScrollBarX$1(tt);const st=-nt.scrollTop;return getComputedStyle$2(it).direction==="rtl"&&(at+=max$7(et.clientWidth,it.clientWidth)-rt),{width:rt,height:ot,x:at,y:st}}function getViewportRect$1(tt,et){const nt=getWindow$1(tt),it=getDocumentElement$1(tt),rt=nt.visualViewport;let ot=it.clientWidth,at=it.clientHeight,st=0,lt=0;if(rt){ot=rt.width,at=rt.height;const ct=isWebKit();(!ct||ct&&et==="fixed")&&(st=rt.offsetLeft,lt=rt.offsetTop)}return{width:ot,height:at,x:st,y:lt}}function getInnerBoundingClientRect$1(tt,et){const nt=getBoundingClientRect$1(tt,!0,et==="fixed"),it=nt.top+tt.clientTop,rt=nt.left+tt.clientLeft,ot=isHTMLElement$3(tt)?getScale$1(tt):createCoords(1),at=tt.clientWidth*ot.x,st=tt.clientHeight*ot.y,lt=rt*ot.x,ct=it*ot.y;return{width:at,height:st,x:lt,y:ct}}function getClientRectFromClippingAncestor(tt,et,nt){let it;if(et==="viewport")it=getViewportRect$1(tt,nt);else if(et==="document")it=getDocumentRect$1(getDocumentElement$1(tt));else if(isElement$1(et))it=getInnerBoundingClientRect$1(et,nt);else{const rt=getVisualOffsets(tt);it={...et,x:et.x-rt.x,y:et.y-rt.y}}return rectToClientRect$1(it)}function hasFixedPositionAncestor(tt,et){const nt=getParentNode$1(tt);return nt===et||!isElement$1(nt)||isLastTraversableNode(nt)?!1:getComputedStyle$2(nt).position==="fixed"||hasFixedPositionAncestor(nt,et)}function getClippingElementAncestors(tt,et){const nt=et.get(tt);if(nt)return nt;let it=getOverflowAncestors(tt,[],!1).filter(st=>isElement$1(st)&&getNodeName$1(st)!=="body"),rt=null;const ot=getComputedStyle$2(tt).position==="fixed";let at=ot?getParentNode$1(tt):tt;for(;isElement$1(at)&&!isLastTraversableNode(at);){const st=getComputedStyle$2(at),lt=isContainingBlock(at);!lt&&st.position==="fixed"&&(rt=null),(ot?!lt&&!rt:!lt&&st.position==="static"&&!!rt&&["absolute","fixed"].includes(rt.position)||isOverflowElement(at)&&!lt&&hasFixedPositionAncestor(tt,at))?it=it.filter(ut=>ut!==at):rt=st,at=getParentNode$1(at)}return et.set(tt,it),it}function getClippingRect$1(tt){let{element:et,boundary:nt,rootBoundary:it,strategy:rt}=tt;const at=[...nt==="clippingAncestors"?getClippingElementAncestors(et,this._c):[].concat(nt),it],st=at[0],lt=at.reduce((ct,ut)=>{const ht=getClientRectFromClippingAncestor(et,ut,rt);return ct.top=max$7(ht.top,ct.top),ct.right=min$7(ht.right,ct.right),ct.bottom=min$7(ht.bottom,ct.bottom),ct.left=max$7(ht.left,ct.left),ct},getClientRectFromClippingAncestor(et,st,rt));return{width:lt.right-lt.left,height:lt.bottom-lt.top,x:lt.left,y:lt.top}}function getDimensions$1(tt){return getCssDimensions(tt)}function getRectRelativeToOffsetParent(tt,et,nt){const it=isHTMLElement$3(et),rt=getDocumentElement$1(et),ot=nt==="fixed",at=getBoundingClientRect$1(tt,!0,ot,et);let st={scrollLeft:0,scrollTop:0};const lt=createCoords(0);if(it||!it&&!ot)if((getNodeName$1(et)!=="body"||isOverflowElement(rt))&&(st=getNodeScroll$1(et)),it){const ct=getBoundingClientRect$1(et,!0,ot,et);lt.x=ct.x+et.clientLeft,lt.y=ct.y+et.clientTop}else rt&&(lt.x=getWindowScrollBarX$1(rt));return{x:at.left+st.scrollLeft-lt.x,y:at.top+st.scrollTop-lt.y,width:at.width,height:at.height}}function getTrueOffsetParent$1(tt,et){return!isHTMLElement$3(tt)||getComputedStyle$2(tt).position==="fixed"?null:et?et(tt):tt.offsetParent}function getOffsetParent$1(tt,et){const nt=getWindow$1(tt);if(!isHTMLElement$3(tt))return nt;let it=getTrueOffsetParent$1(tt,et);for(;it&&isTableElement$1(it)&&getComputedStyle$2(it).position==="static";)it=getTrueOffsetParent$1(it,et);return it&&(getNodeName$1(it)==="html"||getNodeName$1(it)==="body"&&getComputedStyle$2(it).position==="static"&&!isContainingBlock(it))?nt:it||getContainingBlock$1(tt)||nt}const getElementRects=async function(tt){let{reference:et,floating:nt,strategy:it}=tt;const rt=this.getOffsetParent||getOffsetParent$1,ot=this.getDimensions;return{reference:getRectRelativeToOffsetParent(et,await rt(nt),it),floating:{x:0,y:0,...await ot(nt)}}};function isRTL(tt){return getComputedStyle$2(tt).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement$1,getClippingRect:getClippingRect$1,getOffsetParent:getOffsetParent$1,getElementRects,getClientRects,getDimensions:getDimensions$1,getScale:getScale$1,isElement:isElement$1,isRTL};function observeMove(tt,et){let nt=null,it;const rt=getDocumentElement$1(tt);function ot(){clearTimeout(it),nt&&nt.disconnect(),nt=null}function at(st,lt){st===void 0&&(st=!1),lt===void 0&&(lt=1),ot();const{left:ct,top:ut,width:ht,height:dt}=tt.getBoundingClientRect();if(st||et(),!ht||!dt)return;const pt=floor$1(ut),mt=floor$1(rt.clientWidth-(ct+ht)),gt=floor$1(rt.clientHeight-(ut+dt)),bt=floor$1(ct),wt={rootMargin:-pt+"px "+-mt+"px "+-gt+"px "+-bt+"px",threshold:max$7(0,min$7(1,lt))||1};let vt=!0;function xt(St){const Et=St[0].intersectionRatio;if(Et!==lt){if(!vt)return at();Et?at(!1,Et):it=setTimeout(()=>{at(!1,1e-7)},100)}vt=!1}try{nt=new IntersectionObserver(xt,{...wt,root:rt.ownerDocument})}catch{nt=new IntersectionObserver(xt,wt)}nt.observe(tt)}return at(!0),ot}function autoUpdate(tt,et,nt,it){it===void 0&&(it={});const{ancestorScroll:rt=!0,ancestorResize:ot=!0,elementResize:at=typeof ResizeObserver=="function",layoutShift:st=typeof IntersectionObserver=="function",animationFrame:lt=!1}=it,ct=unwrapElement(tt),ut=rt||ot?[...ct?getOverflowAncestors(ct):[],...getOverflowAncestors(et)]:[];ut.forEach(yt=>{rt&&yt.addEventListener("scroll",nt,{passive:!0}),ot&&yt.addEventListener("resize",nt)});const ht=ct&&st?observeMove(ct,nt):null;let dt=-1,pt=null;at&&(pt=new ResizeObserver(yt=>{let[wt]=yt;wt&&wt.target===ct&&pt&&(pt.unobserve(et),cancelAnimationFrame(dt),dt=requestAnimationFrame(()=>{pt&&pt.observe(et)})),nt()}),ct&&!lt&&pt.observe(ct),pt.observe(et));let mt,gt=lt?getBoundingClientRect$1(tt):null;lt&&bt();function bt(){const yt=getBoundingClientRect$1(tt);gt&&(yt.x!==gt.x||yt.y!==gt.y||yt.width!==gt.width||yt.height!==gt.height)&&nt(),gt=yt,mt=requestAnimationFrame(bt)}return nt(),()=>{ut.forEach(yt=>{rt&&yt.removeEventListener("scroll",nt),ot&&yt.removeEventListener("resize",nt)}),ht&&ht(),pt&&pt.disconnect(),pt=null,lt&&cancelAnimationFrame(mt)}}const computePosition=(tt,et,nt)=>{const it=new Map,rt={platform,...nt},ot={...rt.platform,_c:it};return computePosition$1(tt,et,{...rt,platform:ot})},arrow$2=tt=>{function et(nt){return{}.hasOwnProperty.call(nt,"current")}return{name:"arrow",options:tt,fn(nt){const{element:it,padding:rt}=typeof tt=="function"?tt(nt):tt;return it&&et(it)?it.current!=null?arrow$3({element:it.current,padding:rt}).fn(nt):{}:it?arrow$3({element:it,padding:rt}).fn(nt):{}}}};var index$3=typeof document<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function deepEqual$3(tt,et){if(tt===et)return!0;if(typeof tt!=typeof et)return!1;if(typeof tt=="function"&&tt.toString()===et.toString())return!0;let nt,it,rt;if(tt&&et&&typeof tt=="object"){if(Array.isArray(tt)){if(nt=tt.length,nt!=et.length)return!1;for(it=nt;it--!==0;)if(!deepEqual$3(tt[it],et[it]))return!1;return!0}if(rt=Object.keys(tt),nt=rt.length,nt!==Object.keys(et).length)return!1;for(it=nt;it--!==0;)if(!{}.hasOwnProperty.call(et,rt[it]))return!1;for(it=nt;it--!==0;){const ot=rt[it];if(!(ot==="_owner"&&tt.$$typeof)&&!deepEqual$3(tt[ot],et[ot]))return!1}return!0}return tt!==tt&&et!==et}function getDPR(tt){return typeof window>"u"?1:(tt.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(tt,et){const nt=getDPR(tt);return Math.round(et*nt)/nt}function useLatestRef(tt){const et=reactExports.useRef(tt);return index$3(()=>{et.current=tt}),et}function useFloating(tt){tt===void 0&&(tt={});const{placement:et="bottom",strategy:nt="absolute",middleware:it=[],platform:rt,elements:{reference:ot,floating:at}={},transform:st=!0,whileElementsMounted:lt,open:ct}=tt,[ut,ht]=reactExports.useState({x:0,y:0,strategy:nt,placement:et,middlewareData:{},isPositioned:!1}),[dt,pt]=reactExports.useState(it);deepEqual$3(dt,it)||pt(it);const[mt,gt]=reactExports.useState(null),[bt,yt]=reactExports.useState(null),wt=reactExports.useCallback(Ct=>{Ct!=Et.current&&(Et.current=Ct,gt(Ct))},[gt]),vt=reactExports.useCallback(Ct=>{Ct!==$t.current&&($t.current=Ct,yt(Ct))},[yt]),xt=ot||mt,St=at||bt,Et=reactExports.useRef(null),$t=reactExports.useRef(null),It=reactExports.useRef(ut),Ft=useLatestRef(lt),Ht=useLatestRef(rt),zt=reactExports.useCallback(()=>{if(!Et.current||!$t.current)return;const Ct={placement:et,strategy:nt,middleware:dt};Ht.current&&(Ct.platform=Ht.current),computePosition(Et.current,$t.current,Ct).then(Ut=>{const Nt={...Ut,isPositioned:!0};Ot.current&&!deepEqual$3(It.current,Nt)&&(It.current=Nt,reactDomExports.flushSync(()=>{ht(Nt)}))})},[dt,et,nt,Ht]);index$3(()=>{ct===!1&&It.current.isPositioned&&(It.current.isPositioned=!1,ht(Ct=>({...Ct,isPositioned:!1})))},[ct]);const Ot=reactExports.useRef(!1);index$3(()=>(Ot.current=!0,()=>{Ot.current=!1}),[]),index$3(()=>{if(xt&&(Et.current=xt),St&&($t.current=St),xt&&St){if(Ft.current)return Ft.current(xt,St,zt);zt()}},[xt,St,zt,Ft]);const jt=reactExports.useMemo(()=>({reference:Et,floating:$t,setReference:wt,setFloating:vt}),[wt,vt]),kt=reactExports.useMemo(()=>({reference:xt,floating:St}),[xt,St]),Tt=reactExports.useMemo(()=>{const Ct={position:nt,left:0,top:0};if(!kt.floating)return Ct;const Ut=roundByDPR(kt.floating,ut.x),Nt=roundByDPR(kt.floating,ut.y);return st?{...Ct,transform:"translate("+Ut+"px, "+Nt+"px)",...getDPR(kt.floating)>=1.5&&{willChange:"transform"}}:{position:nt,left:Ut,top:Nt}},[nt,st,kt.floating,ut.x,ut.y]);return reactExports.useMemo(()=>({...ut,update:zt,refs:jt,elements:kt,floatingStyles:Tt}),[ut,zt,jt,kt,Tt])}const $7e8f5cd07187803e$export$21b07c8f274aebd5=reactExports.forwardRef((tt,et)=>{const{children:nt,width:it=10,height:rt=5,...ot}=tt;return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg,_extends$t({},ot,{ref:et,width:it,height:rt,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),tt.asChild?nt:reactExports.createElement("polygon",{points:"0,0 30,0 15,10"}))}),$7e8f5cd07187803e$export$be92b6f5f03c0fe9=$7e8f5cd07187803e$export$21b07c8f274aebd5;function $db6c3485150b8e66$export$1ab7ae714698c4b8(tt){const[et,nt]=reactExports.useState(void 0);return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(tt){nt({width:tt.offsetWidth,height:tt.offsetHeight});const it=new ResizeObserver(rt=>{if(!Array.isArray(rt)||!rt.length)return;const ot=rt[0];let at,st;if("borderBoxSize"in ot){const lt=ot.borderBoxSize,ct=Array.isArray(lt)?lt[0]:lt;at=ct.inlineSize,st=ct.blockSize}else at=tt.offsetWidth,st=tt.offsetHeight;nt({width:at,height:st})});return it.observe(tt,{box:"border-box"}),()=>it.unobserve(tt)}else nt(void 0)},[tt]),et}const $cf1ac5d9fe0e8206$var$POPPER_NAME="Popper",[$cf1ac5d9fe0e8206$var$createPopperContext,$cf1ac5d9fe0e8206$export$722aac194ae923]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME),[$cf1ac5d9fe0e8206$var$PopperProvider,$cf1ac5d9fe0e8206$var$usePopperContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME),$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9=tt=>{const{__scopePopper:et,children:nt}=tt,[it,rt]=reactExports.useState(null);return reactExports.createElement($cf1ac5d9fe0e8206$var$PopperProvider,{scope:et,anchor:it,onAnchorChange:rt},nt)},$cf1ac5d9fe0e8206$var$ANCHOR_NAME="PopperAnchor",$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d=reactExports.forwardRef((tt,et)=>{const{__scopePopper:nt,virtualRef:it,...rt}=tt,ot=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME,nt),at=reactExports.useRef(null),st=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,at);return reactExports.useEffect(()=>{ot.onAnchorChange((it==null?void 0:it.current)||at.current)}),it?null:reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$t({},rt,{ref:st}))}),$cf1ac5d9fe0e8206$var$CONTENT_NAME="PopperContent",[$cf1ac5d9fe0e8206$var$PopperContentProvider,$cf1ac5d9fe0e8206$var$useContentContext]=$cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME),$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc=reactExports.forwardRef((tt,et)=>{var nt,it,rt,ot,at,st,lt,ct;const{__scopePopper:ut,side:ht="bottom",sideOffset:dt=0,align:pt="center",alignOffset:mt=0,arrowPadding:gt=0,avoidCollisions:bt=!0,collisionBoundary:yt=[],collisionPadding:wt=0,sticky:vt="partial",hideWhenDetached:xt=!1,updatePositionStrategy:St="optimized",onPlaced:Et,...$t}=tt,It=$cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME,ut),[Ft,Ht]=reactExports.useState(null),zt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,Cn=>Ht(Cn)),[Ot,jt]=reactExports.useState(null),kt=$db6c3485150b8e66$export$1ab7ae714698c4b8(Ot),Tt=(nt=kt==null?void 0:kt.width)!==null&&nt!==void 0?nt:0,Ct=(it=kt==null?void 0:kt.height)!==null&&it!==void 0?it:0,Ut=ht+(pt!=="center"?"-"+pt:""),Nt=typeof wt=="number"?wt:{top:0,right:0,bottom:0,left:0,...wt},Bt=Array.isArray(yt)?yt:[yt],Mt=Bt.length>0,Dt={padding:Nt,boundary:Bt.filter($cf1ac5d9fe0e8206$var$isNotNull),altBoundary:Mt},{refs:Pt,floatingStyles:Vt,placement:nn,isPositioned:cn,middlewareData:Xt}=useFloating({strategy:"fixed",placement:Ut,whileElementsMounted:(...Cn)=>autoUpdate(...Cn,{animationFrame:St==="always"}),elements:{reference:It.anchor},middleware:[offset$3({mainAxis:dt+Ct,alignmentAxis:mt}),bt&&shift({mainAxis:!0,crossAxis:!1,limiter:vt==="partial"?limitShift():void 0,...Dt}),bt&&flip$2({...Dt}),size({...Dt,apply:({elements:Cn,rects:Nn,availableWidth:Un,availableHeight:_n})=>{const{width:An,height:gn}=Nn.reference,Tn=Cn.floating.style;Tn.setProperty("--radix-popper-available-width",`${Un}px`),Tn.setProperty("--radix-popper-available-height",`${_n}px`),Tn.setProperty("--radix-popper-anchor-width",`${An}px`),Tn.setProperty("--radix-popper-anchor-height",`${gn}px`)}}),Ot&&arrow$2({element:Ot,padding:gt}),$cf1ac5d9fe0e8206$var$transformOrigin({arrowWidth:Tt,arrowHeight:Ct}),xt&&hide$5({strategy:"referenceHidden",...Dt})]}),[un,en]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(nn),fn=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Et);$9f79659886946c16$export$e5c5a5f917a5871c(()=>{cn&&(fn==null||fn())},[cn,fn]);const xn=(rt=Xt.arrow)===null||rt===void 0?void 0:rt.x,an=(ot=Xt.arrow)===null||ot===void 0?void 0:ot.y,Zt=((at=Xt.arrow)===null||at===void 0?void 0:at.centerOffset)!==0,[En,In]=reactExports.useState();return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{Ft&&In(window.getComputedStyle(Ft).zIndex)},[Ft]),reactExports.createElement("div",{ref:Pt.setFloating,"data-radix-popper-content-wrapper":"",style:{...Vt,transform:cn?Vt.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:En,"--radix-popper-transform-origin":[(st=Xt.transformOrigin)===null||st===void 0?void 0:st.x,(lt=Xt.transformOrigin)===null||lt===void 0?void 0:lt.y].join(" ")},dir:tt.dir},reactExports.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider,{scope:ut,placedSide:un,onArrowChange:jt,arrowX:xn,arrowY:an,shouldHideArrow:Zt},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$t({"data-side":un,"data-align":en},$t,{ref:zt,style:{...$t.style,animation:cn?void 0:"none",opacity:(ct=Xt.hide)!==null&&ct!==void 0&&ct.referenceHidden?0:void 0}}))))}),$cf1ac5d9fe0e8206$var$ARROW_NAME="PopperArrow",$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0=reactExports.forwardRef(function(et,nt){const{__scopePopper:it,...rt}=et,ot=$cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME,it),at=$cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[ot.placedSide];return reactExports.createElement("span",{ref:ot.onArrowChange,style:{position:"absolute",left:ot.arrowX,top:ot.arrowY,[at]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[ot.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[ot.placedSide],visibility:ot.shouldHideArrow?"hidden":void 0}},reactExports.createElement($7e8f5cd07187803e$export$be92b6f5f03c0fe9,_extends$t({},rt,{ref:nt,style:{...rt.style,display:"block"}})))});function $cf1ac5d9fe0e8206$var$isNotNull(tt){return tt!==null}const $cf1ac5d9fe0e8206$var$transformOrigin=tt=>({name:"transformOrigin",options:tt,fn(et){var nt,it,rt,ot,at;const{placement:st,rects:lt,middlewareData:ct}=et,ht=((nt=ct.arrow)===null||nt===void 0?void 0:nt.centerOffset)!==0,dt=ht?0:tt.arrowWidth,pt=ht?0:tt.arrowHeight,[mt,gt]=$cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(st),bt={start:"0%",center:"50%",end:"100%"}[gt],yt=((it=(rt=ct.arrow)===null||rt===void 0?void 0:rt.x)!==null&&it!==void 0?it:0)+dt/2,wt=((ot=(at=ct.arrow)===null||at===void 0?void 0:at.y)!==null&&ot!==void 0?ot:0)+pt/2;let vt="",xt="";return mt==="bottom"?(vt=ht?bt:`${yt}px`,xt=`${-pt}px`):mt==="top"?(vt=ht?bt:`${yt}px`,xt=`${lt.floating.height+pt}px`):mt==="right"?(vt=`${-pt}px`,xt=ht?bt:`${wt}px`):mt==="left"&&(vt=`${lt.floating.width+pt}px`,xt=ht?bt:`${wt}px`),{data:{x:vt,y:xt}}}});function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(tt){const[et,nt="center"]=tt.split("-");return[et,nt]}const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9=$cf1ac5d9fe0e8206$export$badac9ada3a0bdf9,$cf1ac5d9fe0e8206$export$b688253958b8dfe7=$cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d,$cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2=$cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc,$cf1ac5d9fe0e8206$export$21b07c8f274aebd5=$cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;function $fe963b355347cc68$export$3e6543de14f8614f(tt,et){return reactExports.useReducer((nt,it)=>{const rt=et[nt][it];return rt??nt},tt)}const $921a889cee6df7e8$export$99c2b779aa4e8b8b=tt=>{const{present:et,children:nt}=tt,it=$921a889cee6df7e8$var$usePresence(et),rt=typeof nt=="function"?nt({present:it.isPresent}):reactExports.Children.only(nt),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(it.ref,rt.ref);return typeof nt=="function"||it.isPresent?reactExports.cloneElement(rt,{ref:ot}):null};$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName="Presence";function $921a889cee6df7e8$var$usePresence(tt){const[et,nt]=reactExports.useState(),it=reactExports.useRef({}),rt=reactExports.useRef(tt),ot=reactExports.useRef("none"),at=tt?"mounted":"unmounted",[st,lt]=$fe963b355347cc68$export$3e6543de14f8614f(at,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const ct=$921a889cee6df7e8$var$getAnimationName(it.current);ot.current=st==="mounted"?ct:"none"},[st]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const ct=it.current,ut=rt.current;if(ut!==tt){const dt=ot.current,pt=$921a889cee6df7e8$var$getAnimationName(ct);tt?lt("MOUNT"):pt==="none"||(ct==null?void 0:ct.display)==="none"?lt("UNMOUNT"):lt(ut&&dt!==pt?"ANIMATION_OUT":"UNMOUNT"),rt.current=tt}},[tt,lt]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(et){const ct=ht=>{const pt=$921a889cee6df7e8$var$getAnimationName(it.current).includes(ht.animationName);ht.target===et&&pt&&reactDomExports.flushSync(()=>lt("ANIMATION_END"))},ut=ht=>{ht.target===et&&(ot.current=$921a889cee6df7e8$var$getAnimationName(it.current))};return et.addEventListener("animationstart",ut),et.addEventListener("animationcancel",ct),et.addEventListener("animationend",ct),()=>{et.removeEventListener("animationstart",ut),et.removeEventListener("animationcancel",ct),et.removeEventListener("animationend",ct)}}else lt("ANIMATION_END")},[et,lt]),{isPresent:["mounted","unmountSuspended"].includes(st),ref:reactExports.useCallback(ct=>{ct&&(it.current=getComputedStyle(ct)),nt(ct)},[])}}function $921a889cee6df7e8$var$getAnimationName(tt){return(tt==null?void 0:tt.animationName)||"none"}function $71cd76cc60e0454e$export$6f32135080cb4c3({prop:tt,defaultProp:et,onChange:nt=()=>{}}){const[it,rt]=$71cd76cc60e0454e$var$useUncontrolledState({defaultProp:et,onChange:nt}),ot=tt!==void 0,at=ot?tt:it,st=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(nt),lt=reactExports.useCallback(ct=>{if(ot){const ht=typeof ct=="function"?ct(tt):ct;ht!==tt&&st(ht)}else rt(ct)},[ot,tt,rt,st]);return[at,lt]}function $71cd76cc60e0454e$var$useUncontrolledState({defaultProp:tt,onChange:et}){const nt=reactExports.useState(tt),[it]=nt,rt=reactExports.useRef(it),ot=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(et);return reactExports.useEffect(()=>{rt.current!==it&&(ot(it),rt.current=it)},[it,rt,ot]),nt}const $ea1ef594cf570d83$export$439d29a4e110a164=reactExports.forwardRef((tt,et)=>reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$t({},tt,{ref:et,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...tt.style}}))),$ea1ef594cf570d83$export$be92b6f5f03c0fe9=$ea1ef594cf570d83$export$439d29a4e110a164,[$a093c7e1ec25a057$var$createTooltipContext,$a093c7e1ec25a057$export$1c540a2224f0d865]=$c512c27ab02ef895$export$50c7b4e9d9f19c1("Tooltip",[$cf1ac5d9fe0e8206$export$722aac194ae923]),$a093c7e1ec25a057$var$usePopperScope=$cf1ac5d9fe0e8206$export$722aac194ae923(),$a093c7e1ec25a057$var$PROVIDER_NAME="TooltipProvider",$a093c7e1ec25a057$var$TOOLTIP_OPEN="tooltip.open",[$a093c7e1ec25a057$var$TooltipProviderContextProvider,$a093c7e1ec25a057$var$useTooltipProviderContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PROVIDER_NAME),$a093c7e1ec25a057$var$TOOLTIP_NAME="Tooltip",[$a093c7e1ec25a057$var$TooltipContextProvider,$a093c7e1ec25a057$var$useTooltipContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME),$a093c7e1ec25a057$export$28c660c63b792dea=tt=>{const{__scopeTooltip:et,children:nt,open:it,defaultOpen:rt=!1,onOpenChange:ot,disableHoverableContent:at,delayDuration:st}=tt,lt=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TOOLTIP_NAME,tt.__scopeTooltip),ct=$a093c7e1ec25a057$var$usePopperScope(et),[ut,ht]=reactExports.useState(null),dt=$1746a345f3d73bb7$export$f680877a34711e37(),pt=reactExports.useRef(0),mt=at??lt.disableHoverableContent,gt=st??lt.delayDuration,bt=reactExports.useRef(!1),[yt=!1,wt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:it,defaultProp:rt,onChange:$t=>{$t?(lt.onOpen(),document.dispatchEvent(new CustomEvent($a093c7e1ec25a057$var$TOOLTIP_OPEN))):lt.onClose(),ot==null||ot($t)}}),vt=reactExports.useMemo(()=>yt?bt.current?"delayed-open":"instant-open":"closed",[yt]),xt=reactExports.useCallback(()=>{window.clearTimeout(pt.current),bt.current=!1,wt(!0)},[wt]),St=reactExports.useCallback(()=>{window.clearTimeout(pt.current),wt(!1)},[wt]),Et=reactExports.useCallback(()=>{window.clearTimeout(pt.current),pt.current=window.setTimeout(()=>{bt.current=!0,wt(!0)},gt)},[gt,wt]);return reactExports.useEffect(()=>()=>window.clearTimeout(pt.current),[]),reactExports.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9,ct,reactExports.createElement($a093c7e1ec25a057$var$TooltipContextProvider,{scope:et,contentId:dt,open:yt,stateAttribute:vt,trigger:ut,onTriggerChange:ht,onTriggerEnter:reactExports.useCallback(()=>{lt.isOpenDelayed?Et():xt()},[lt.isOpenDelayed,Et,xt]),onTriggerLeave:reactExports.useCallback(()=>{mt?St():window.clearTimeout(pt.current)},[St,mt]),onOpen:xt,onClose:St,disableHoverableContent:mt},nt))},$a093c7e1ec25a057$var$TRIGGER_NAME="TooltipTrigger",$a093c7e1ec25a057$export$8c610744efcf8a1d=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,...it}=tt,rt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$TRIGGER_NAME,nt),ot=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TRIGGER_NAME,nt),at=$a093c7e1ec25a057$var$usePopperScope(nt),st=reactExports.useRef(null),lt=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,st,rt.onTriggerChange),ct=reactExports.useRef(!1),ut=reactExports.useRef(!1),ht=reactExports.useCallback(()=>ct.current=!1,[]);return reactExports.useEffect(()=>()=>document.removeEventListener("pointerup",ht),[ht]),reactExports.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7,_extends$t({asChild:!0},at),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$t({"aria-describedby":rt.open?rt.contentId:void 0,"data-state":rt.stateAttribute},it,{ref:lt,onPointerMove:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerMove,dt=>{dt.pointerType!=="touch"&&!ut.current&&!ot.isPointerInTransitRef.current&&(rt.onTriggerEnter(),ut.current=!0)}),onPointerLeave:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerLeave,()=>{rt.onTriggerLeave(),ut.current=!1}),onPointerDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onPointerDown,()=>{ct.current=!0,document.addEventListener("pointerup",ht,{once:!0})}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onFocus,()=>{ct.current||rt.onOpen()}),onBlur:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onBlur,rt.onClose),onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(tt.onClick,rt.onClose)})))}),$a093c7e1ec25a057$var$PORTAL_NAME="TooltipPortal",[$a093c7e1ec25a057$var$PortalProvider,$a093c7e1ec25a057$var$usePortalContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PORTAL_NAME,{forceMount:void 0}),$a093c7e1ec25a057$var$CONTENT_NAME="TooltipContent",$a093c7e1ec25a057$export$e9003e2be37ec060=reactExports.forwardRef((tt,et)=>{const nt=$a093c7e1ec25a057$var$usePortalContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),{forceMount:it=nt.forceMount,side:rt="top",...ot}=tt,at=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip);return reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:it||at.open},at.disableHoverableContent?reactExports.createElement($a093c7e1ec25a057$var$TooltipContentImpl,_extends$t({side:rt},ot,{ref:et})):reactExports.createElement($a093c7e1ec25a057$var$TooltipContentHoverable,_extends$t({side:rt},ot,{ref:et})))}),$a093c7e1ec25a057$var$TooltipContentHoverable=reactExports.forwardRef((tt,et)=>{const nt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),it=$a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$CONTENT_NAME,tt.__scopeTooltip),rt=reactExports.useRef(null),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(et,rt),[at,st]=reactExports.useState(null),{trigger:lt,onClose:ct}=nt,ut=rt.current,{onPointerInTransitChange:ht}=it,dt=reactExports.useCallback(()=>{st(null),ht(!1)},[ht]),pt=reactExports.useCallback((mt,gt)=>{const bt=mt.currentTarget,yt={x:mt.clientX,y:mt.clientY},wt=$a093c7e1ec25a057$var$getExitSideFromRect(yt,bt.getBoundingClientRect()),vt=$a093c7e1ec25a057$var$getPaddedExitPoints(yt,wt),xt=$a093c7e1ec25a057$var$getPointsFromRect(gt.getBoundingClientRect()),St=$a093c7e1ec25a057$var$getHull([...vt,...xt]);st(St),ht(!0)},[ht]);return reactExports.useEffect(()=>()=>dt(),[dt]),reactExports.useEffect(()=>{if(lt&&ut){const mt=bt=>pt(bt,ut),gt=bt=>pt(bt,lt);return lt.addEventListener("pointerleave",mt),ut.addEventListener("pointerleave",gt),()=>{lt.removeEventListener("pointerleave",mt),ut.removeEventListener("pointerleave",gt)}}},[lt,ut,pt,dt]),reactExports.useEffect(()=>{if(at){const mt=gt=>{const bt=gt.target,yt={x:gt.clientX,y:gt.clientY},wt=(lt==null?void 0:lt.contains(bt))||(ut==null?void 0:ut.contains(bt)),vt=!$a093c7e1ec25a057$var$isPointInPolygon(yt,at);wt?dt():vt&&(dt(),ct())};return document.addEventListener("pointermove",mt),()=>document.removeEventListener("pointermove",mt)}},[lt,ut,at,ct,dt]),reactExports.createElement($a093c7e1ec25a057$var$TooltipContentImpl,_extends$t({},tt,{ref:ot}))}),[$a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider,$a093c7e1ec25a057$var$useVisuallyHiddenContentContext]=$a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME,{isInside:!1}),$a093c7e1ec25a057$var$TooltipContentImpl=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,children:it,"aria-label":rt,onEscapeKeyDown:ot,onPointerDownOutside:at,...st}=tt,lt=$a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME,nt),ct=$a093c7e1ec25a057$var$usePopperScope(nt),{onClose:ut}=lt;return reactExports.useEffect(()=>(document.addEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN,ut),()=>document.removeEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN,ut)),[ut]),reactExports.useEffect(()=>{if(lt.trigger){const ht=dt=>{const pt=dt.target;pt!=null&&pt.contains(lt.trigger)&&ut()};return window.addEventListener("scroll",ht,{capture:!0}),()=>window.removeEventListener("scroll",ht,{capture:!0})}},[lt.trigger,ut]),reactExports.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:ot,onPointerDownOutside:at,onFocusOutside:ht=>ht.preventDefault(),onDismiss:ut},reactExports.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2,_extends$t({"data-state":lt.stateAttribute},ct,st,{ref:et,style:{...st.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),reactExports.createElement($5e63c961fc1ce211$export$d9f1ccf0bdb05d45,null,it),reactExports.createElement($a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider,{scope:nt,isInside:!0},reactExports.createElement($ea1ef594cf570d83$export$be92b6f5f03c0fe9,{id:lt.contentId,role:"tooltip"},rt||it))))}),$a093c7e1ec25a057$var$ARROW_NAME="TooltipArrow",$a093c7e1ec25a057$export$c27ee0ad710f7559=reactExports.forwardRef((tt,et)=>{const{__scopeTooltip:nt,...it}=tt,rt=$a093c7e1ec25a057$var$usePopperScope(nt);return $a093c7e1ec25a057$var$useVisuallyHiddenContentContext($a093c7e1ec25a057$var$ARROW_NAME,nt).isInside?null:reactExports.createElement($cf1ac5d9fe0e8206$export$21b07c8f274aebd5,_extends$t({},rt,it,{ref:et}))});function $a093c7e1ec25a057$var$getExitSideFromRect(tt,et){const nt=Math.abs(et.top-tt.y),it=Math.abs(et.bottom-tt.y),rt=Math.abs(et.right-tt.x),ot=Math.abs(et.left-tt.x);switch(Math.min(nt,it,rt,ot)){case ot:return"left";case rt:return"right";case nt:return"top";case it:return"bottom";default:throw new Error("unreachable")}}function $a093c7e1ec25a057$var$getPaddedExitPoints(tt,et,nt=5){const it=[];switch(et){case"top":it.push({x:tt.x-nt,y:tt.y+nt},{x:tt.x+nt,y:tt.y+nt});break;case"bottom":it.push({x:tt.x-nt,y:tt.y-nt},{x:tt.x+nt,y:tt.y-nt});break;case"left":it.push({x:tt.x+nt,y:tt.y-nt},{x:tt.x+nt,y:tt.y+nt});break;case"right":it.push({x:tt.x-nt,y:tt.y-nt},{x:tt.x-nt,y:tt.y+nt});break}return it}function $a093c7e1ec25a057$var$getPointsFromRect(tt){const{top:et,right:nt,bottom:it,left:rt}=tt;return[{x:rt,y:et},{x:nt,y:et},{x:nt,y:it},{x:rt,y:it}]}function $a093c7e1ec25a057$var$isPointInPolygon(tt,et){const{x:nt,y:it}=tt;let rt=!1;for(let ot=0,at=et.length-1;otit!=ut>it&&nt<(ct-st)*(it-lt)/(ut-lt)+st&&(rt=!rt)}return rt}function $a093c7e1ec25a057$var$getHull(tt){const et=tt.slice();return et.sort((nt,it)=>nt.xit.x?1:nt.yit.y?1:0),$a093c7e1ec25a057$var$getHullPresorted(et)}function $a093c7e1ec25a057$var$getHullPresorted(tt){if(tt.length<=1)return tt.slice();const et=[];for(let it=0;it=2;){const ot=et[et.length-1],at=et[et.length-2];if((ot.x-at.x)*(rt.y-at.y)>=(ot.y-at.y)*(rt.x-at.x))et.pop();else break}et.push(rt)}et.pop();const nt=[];for(let it=tt.length-1;it>=0;it--){const rt=tt[it];for(;nt.length>=2;){const ot=nt[nt.length-1],at=nt[nt.length-2];if((ot.x-at.x)*(rt.y-at.y)>=(ot.y-at.y)*(rt.x-at.x))nt.pop();else break}nt.push(rt)}return nt.pop(),et.length===1&&nt.length===1&&et[0].x===nt[0].x&&et[0].y===nt[0].y?et:et.concat(nt)}const $a093c7e1ec25a057$export$be92b6f5f03c0fe9=$a093c7e1ec25a057$export$28c660c63b792dea,$a093c7e1ec25a057$export$41fb9f06171c75f4=$a093c7e1ec25a057$export$8c610744efcf8a1d,$a093c7e1ec25a057$export$7c6e2c02157bb7d2=$a093c7e1ec25a057$export$e9003e2be37ec060,$a093c7e1ec25a057$export$21b07c8f274aebd5=$a093c7e1ec25a057$export$c27ee0ad710f7559;function _objectWithoutPropertiesLoose$o(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _objectWithoutProperties$l(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$o(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}let LevaErrors;(function(tt){tt[tt.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",tt[tt.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",tt[tt.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",tt[tt.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",tt[tt.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",tt[tt.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",tt[tt.THEME_ERROR=6]="THEME_ERROR",tt[tt.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",tt[tt.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",tt[tt.EMPTY_KEY=9]="EMPTY_KEY"})(LevaErrors||(LevaErrors={}));const ErrorList={[LevaErrors.UNSUPPORTED_INPUT]:(tt,et)=>[`An input with type \`${tt}\` input was found at path \`${et}\` but it's not supported yet.`],[LevaErrors.NO_COMPONENT_FOR_TYPE]:(tt,et)=>[`Type \`${tt}\` found at path \`${et}\` can't be displayed in panel because no component supports it yet.`],[LevaErrors.UNKNOWN_INPUT]:(tt,et)=>[`input at path \`${tt}\` is not recognized.`,et],[LevaErrors.DUPLICATE_KEYS]:(tt,et,nt)=>[`Key \`${tt}\` of path \`${et}\` already exists at path \`${nt}\`. Even nested keys need to be unique. Rename one of the keys.`],[LevaErrors.ALREADY_REGISTERED_TYPE]:tt=>[`Type ${tt} has already been registered. You can't register a component with the same type.`],[LevaErrors.CLIPBOARD_ERROR]:tt=>["Error copying the value",tt],[LevaErrors.THEME_ERROR]:(tt,et)=>[`Error accessing the theme \`${tt}.${et}\` value.`],[LevaErrors.PATH_DOESNT_EXIST]:tt=>[`Error getting the value at path \`${tt}\`. There is probably an error in your \`render\` function.`],[LevaErrors.PATH_DOESNT_EXIST]:tt=>[`Error accessing the value at path \`${tt}\``],[LevaErrors.INPUT_TYPE_OVERRIDE]:(tt,et,nt)=>[`Input at path \`${tt}\` already exists with type: \`${et}\`. Its type cannot be overridden with type \`${nt}\`.`],[LevaErrors.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function _log(tt,et,...nt){const[it,...rt]=ErrorList[et](...nt);console[tt]("LEVA: "+it,...rt)}const warn$3=_log.bind(null,"warn"),log$2=_log.bind(null,"log"),_excluded$a$1=["value"],_excluded2$4$1=["schema"],_excluded3$1$1=["value"],Schemas=[],Plugins={};function getValueType(tt){let{value:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$a$1);for(let it of Schemas){const rt=it(et,nt);if(rt)return rt}}function register(tt,et){let{schema:nt}=et,it=_objectWithoutProperties$l(et,_excluded2$4$1);if(tt in Plugins){warn$3(LevaErrors.ALREADY_REGISTERED_TYPE,tt);return}Schemas.push((rt,ot)=>nt(rt,ot)&&tt),Plugins[tt]=it}function createInternalPlugin(tt){return tt}function normalize$3$2(tt,et,nt,it){const{normalize:rt}=Plugins[tt];if(rt)return rt(et,nt,it);if(typeof et!="object"||!("value"in et))return{value:et};const{value:ot}=et,at=_objectWithoutProperties$l(et,_excluded3$1$1);return{value:ot,settings:at}}function sanitize$4(tt,et,nt,it,rt,ot){const{sanitize:at}=Plugins[tt];return at?at(et,nt,it,rt,ot):et}function format$2$1(tt,et,nt){const{format:it}=Plugins[tt];return it?it(et,nt):et}function _defineProperty$H(tt,et,nt){return et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$E(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread2$1(tt){for(var et=1;ettt>nt?nt:tt{if(tt===""||typeof tt=="number")return tt;try{const et=evaluate(tt);if(!isNaN(et))return et}catch{}return parseFloat(tt)},log10=Math.log(10);function getStep(tt){let et=Math.abs(+String(tt).replace(".",""));if(et===0)return .01;for(;et!==0&&et%10===0;)et/=10;const nt=Math.floor(Math.log(et)/log10)+1,it=Math.floor(Math.log10(Math.abs(tt))),rt=Math.pow(10,it-nt);return Math.max(rt,.001)}const range$9=(tt,et,nt)=>nt===et?0:(clamp$7(tt,et,nt)-et)/(nt-et),invertedRange=(tt,et,nt)=>tt*(nt-et)+et,getUid=()=>"_"+Math.random().toString(36).substr(2,9),parens=/\(([0-9+\-*/^ .]+)\)/,exp$1=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,mul=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,div=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,add$5=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,sub=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function evaluate(tt){if(isNaN(Number(tt)))if(parens.test(tt)){const et=tt.replace(parens,(nt,it)=>String(evaluate(it)));return evaluate(et)}else if(exp$1.test(tt)){const et=tt.replace(exp$1,(nt,it,rt)=>String(Math.pow(Number(it),Number(rt))));return evaluate(et)}else if(mul.test(tt)){const et=tt.replace(mul,(nt,it,rt)=>String(Number(it)*Number(rt)));return evaluate(et)}else if(div.test(tt)){const et=tt.replace(div,(nt,it,rt)=>{if(rt!=0)return String(Number(it)/Number(rt));throw new Error("Division by zero")});return evaluate(et)}else if(add$5.test(tt)){const et=tt.replace(add$5,(nt,it,rt)=>String(Number(it)+Number(rt)));return evaluate(et)}else if(sub.test(tt)){const et=tt.replace(sub,(nt,it,rt)=>String(Number(it)-Number(rt)));return evaluate(et)}else return Number(tt);return Number(tt)}function pick$1(tt,et){return et.reduce((nt,it)=>(tt&&tt.hasOwnProperty(it)&&(nt[it]=tt[it]),nt),{})}function omit$1(tt,et){const nt=_objectSpread2$1({},tt);return et.forEach(it=>it in tt&&delete nt[it]),nt}function mapArrayToKeys(tt,et){return tt.reduce((nt,it,rt)=>Object.assign(nt,{[et[rt]]:it}),{})}function isObject$t(tt){return Object.prototype.toString.call(tt)==="[object Object]"}const isEmptyObject$1=tt=>isObject$t(tt)&&Object.keys(tt).length===0;let SpecialInputs;(function(tt){tt.BUTTON="BUTTON",tt.BUTTON_GROUP="BUTTON_GROUP",tt.MONITOR="MONITOR",tt.FOLDER="FOLDER"})(SpecialInputs||(SpecialInputs={}));let LevaInputs;(function(tt){tt.SELECT="SELECT",tt.IMAGE="IMAGE",tt.NUMBER="NUMBER",tt.COLOR="COLOR",tt.STRING="STRING",tt.BOOLEAN="BOOLEAN",tt.INTERVAL="INTERVAL",tt.VECTOR3D="VECTOR3D",tt.VECTOR2D="VECTOR2D"})(LevaInputs||(LevaInputs={}));const _excluded$9$1=["type","__customInput"],_excluded2$3$1=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],_excluded3$3=["type"];function parseOptions(tt,et,nt={},it){var rt,ot;if(typeof tt!="object"||Array.isArray(tt))return{type:it,input:tt,options:_objectSpread2$1({key:et,label:et,optional:!1,disabled:!1,order:0},nt)};if("__customInput"in tt){const{type:St,__customInput:Et}=tt,$t=_objectWithoutProperties$l(tt,_excluded$9$1);return parseOptions(Et,et,$t,St)}const{render:at,label:st,optional:lt,order:ct=0,disabled:ut,hint:ht,onChange:dt,onEditStart:pt,onEditEnd:mt,transient:gt}=tt,bt=_objectWithoutProperties$l(tt,_excluded2$3$1),yt=_objectSpread2$1({render:at,key:et,label:st??et,hint:ht,transient:gt??!!dt,onEditStart:pt,onEditEnd:mt,disabled:ut,optional:lt,order:ct},nt);let{type:wt}=bt,vt=_objectWithoutProperties$l(bt,_excluded3$3);if(wt=it??wt,wt in SpecialInputs)return{type:wt,input:vt,options:yt};let xt;return it&&isObject$t(vt)&&"value"in vt?xt=vt.value:xt=isEmptyObject$1(vt)?void 0:vt,{type:wt,input:xt,options:_objectSpread2$1(_objectSpread2$1({},yt),{},{onChange:dt,optional:(rt=yt.optional)!==null&&rt!==void 0?rt:!1,disabled:(ot=yt.disabled)!==null&&ot!==void 0?ot:!1})}}function normalizeInput(tt,et,nt,it){const rt=parseOptions(tt,et),{type:ot,input:at,options:st}=rt;if(ot)return ot in SpecialInputs?rt:{type:ot,input:normalize$3$2(ot,at,nt,it),options:st};let lt=getValueType(at);return lt?{type:lt,input:normalize$3$2(lt,at,nt,it),options:st}:(lt=getValueType({value:at}),lt?{type:lt,input:normalize$3$2(lt,{value:at},nt,it),options:st}:!1)}function updateInput(tt,et,nt,it,rt){const{value:ot,type:at,settings:st}=tt;tt.value=sanitizeValue({type:at,value:ot,settings:st},et,nt,it),tt.fromPanel=rt}const ValueError=function(et,nt,it){this.type="LEVA_ERROR",this.message="LEVA: "+et,this.previousValue=nt,this.error=it};function sanitizeValue({type:tt,value:et,settings:nt},it,rt,ot){const at=tt!=="SELECT"&&typeof it=="function"?it(et):it;let st;try{st=sanitize$4(tt,at,nt,et,rt,ot)}catch(lt){throw new ValueError(`The value \`${it}\` did not result in a correct value.`,et,lt)}return dequal(st,et)?et:st}const debounce$5=(tt,et,nt=!1)=>{let it=0;return function(){const rt=arguments,ot=nt&&!it,at=()=>tt.apply(this,rt);window.clearTimeout(it),it=window.setTimeout(at,et),ot&&at()}},multiplyStep=tt=>tt.shiftKey?5:tt.altKey?1/5:1;function render(tt,et){const nt=console.error;console.error=()=>{},ReactDOM.render(tt,et),console.error=nt}const _excluded$8$1=["value"],_excluded2$2$1=["min","max"],schema$3=tt=>{if(typeof tt=="number")return!0;if(typeof tt=="string"){const et=parseFloat(tt);return isNaN(et)?!1:tt.substring((""+et).length).trim().length<4}return!1},sanitize$3=(tt,{min:et=-1/0,max:nt=1/0,suffix:it})=>{const rt=parseFloat(tt);if(tt===""||isNaN(rt))throw Error("Invalid number");const ot=clamp$7(rt,et,nt);return it?ot+it:ot},format$1$2=(tt,{pad:et=0,suffix:nt})=>{const it=parseFloat(tt).toFixed(et);return nt?it+nt:it},normalize$2$2=tt=>{let{value:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$8$1);const{min:it=-1/0,max:rt=1/0}=nt,ot=_objectWithoutProperties$l(nt,_excluded2$2$1);let at=parseFloat(et);const st=typeof et=="string"?et.substring((""+at).length):void 0;at=clamp$7(at,it,rt);let lt=nt.step;lt||(Number.isFinite(it)?Number.isFinite(rt)?lt=+(Math.abs(rt-it)/100).toPrecision(1):lt=+(Math.abs(at-it)/100).toPrecision(1):Number.isFinite(rt)&&(lt=+(Math.abs(rt-at)/100).toPrecision(1)));const ct=lt?getStep(lt)*10:getStep(at);lt=lt||ct/10;const ut=Math.round(clamp$7(Math.log10(1/ct),0,2));return{value:st?at+st:at,settings:_objectSpread2$1({initialValue:at,step:lt,pad:ut,min:it,max:rt,suffix:st},ot)}},sanitizeStep$1=(tt,{step:et,initialValue:nt})=>{const it=Math.round((tt-nt)/et);return nt+it*et};var props$3$1=Object.freeze({__proto__:null,schema:schema$3,sanitize:sanitize$3,format:format$1$2,normalize:normalize$2$2,sanitizeStep:sanitizeStep$1});function _extends$s(){return _extends$s=Object.assign?Object.assign.bind():function(tt){for(var et=1;et({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function createStateClass(tt,et){const[nt,it]=tt.split(" "),rt={};return nt!=="none"&&(rt.boxShadow=`${et.inset?"inset ":""}0 0 0 $borderWidths${[et.key]} $colors${nt!=="default"&&nt||et.borderColor}`),it&&(rt.backgroundColor=it),rt}const utils$r={$inputStyle:()=>tt=>createStateClass(tt,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>tt=>createStateClass(tt,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>tt=>createStateClass(tt,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>tt=>createStateClass(tt,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:styled$5,css:css$1,createTheme:createTheme$2,globalCss,keyframes:keyframes$1}=q$7({prefix:"leva",theme:getDefaultTheme(),utils:_objectSpread2$1(_objectSpread2$1({},utils$r),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:tt=>({"&:focus":utils$r.$focusStyle()(tt)}),$focusWithin:tt=>({"&:focus-within":utils$r.$focusStyle()(tt)}),$hover:tt=>({"&:hover":utils$r.$hoverStyle()(tt)}),$active:tt=>({"&:active":utils$r.$activeStyle()(tt)})})}),globalStyles=globalCss({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function mergeTheme(tt){const et=getDefaultTheme();if(!tt)return{theme:et,className:""};Object.keys(tt).forEach(it=>{Object.assign(et[it],tt[it])});const nt=createTheme$2(et);return{theme:et,className:nt.className}}function useTh(tt,et){const{theme:nt}=reactExports.useContext(ThemeContext$3);if(!(tt in nt)||!(et in nt[tt]))return warn$3(LevaErrors.THEME_ERROR,tt,et),"";let it=et;for(;;){let rt=nt[tt][it];if(typeof rt=="string"&&rt.charAt(0)==="$")it=rt.substr(1);else return rt}}const StyledInput$2=styled$5("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),InnerLabel=styled$5("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${StyledInput$2}`]:{paddingLeft:0}}),InnerNumberLabel=styled$5(InnerLabel,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),InputContainer=styled$5("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),_excluded$7$2=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],_excluded2$1$2=["onUpdate"];function ValueInput(tt){let{innerLabel:et,value:nt,onUpdate:it,onChange:rt,onKeyDown:ot,type:at,id:st,inputType:lt="text",rows:ct=0}=tt,ut=_objectWithoutProperties$l(tt,_excluded$7$2);const{id:ht,emitOnEditStart:dt,emitOnEditEnd:pt,disabled:mt}=useInputContext(),gt=st||ht,bt=reactExports.useRef(null),yt=ct>0,wt=yt?"textarea":"input",vt=reactExports.useCallback(Et=>$t=>{const It=$t.currentTarget.value;Et(It)},[]);React$1.useEffect(()=>{const Et=bt.current,$t=vt(It=>{it(It),pt()});return Et==null||Et.addEventListener("blur",$t),()=>Et==null?void 0:Et.removeEventListener("blur",$t)},[vt,it,pt]);const xt=reactExports.useCallback(Et=>{Et.key==="Enter"&&vt(it)(Et)},[vt,it]),St=Object.assign({as:wt},yt?{rows:ct}:{},ut);return React$1.createElement(InputContainer,{textArea:yt},et&&typeof et=="string"?React$1.createElement(InnerLabel,null,et):et,React$1.createElement(StyledInput$2,_extends$s({levaType:at,ref:bt,id:gt,type:lt,autoComplete:"off",spellCheck:"false",value:nt,onChange:vt(rt),onFocus:()=>dt(),onKeyPress:xt,onKeyDown:ot,disabled:mt},St)))}function NumberInput(tt){let{onUpdate:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded2$1$2);const it=reactExports.useCallback(ot=>et(parseNumber(ot)),[et]),rt=reactExports.useCallback(ot=>{const at=ot.key==="ArrowUp"?1:ot.key==="ArrowDown"?-1:0;if(at){ot.preventDefault();const st=ot.altKey?.1:ot.shiftKey?10:1;et(lt=>parseFloat(lt)+at*st)}},[et]);return React$1.createElement(ValueInput,_extends$s({},nt,{onUpdate:it,onKeyDown:rt,type:"number"}))}const StyledFolder=styled$5("div",{}),StyledWrapper=styled$5("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),StyledTitle=styled$5("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${StyledWrapper}::after`]:{opacity:.6},[`${StyledFolder}:hover > & + ${StyledWrapper}::after`]:{opacity:.6},[`${StyledFolder}:hover > & > svg`]:{opacity:1}}),StyledContent=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${StyledFolder}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),StyledRow=styled$5("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${StyledContent} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),StyledInputRow=styled$5(StyledRow,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),CopyLabelContainer=styled$5("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),StyledOptionalToggle=styled$5("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),StyledLabel$1=styled$5("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),StyledInputWrapper$1=styled$5("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${StyledLabel$1}`]:{pointerEvents:"auto"}}}}}),Overlay$1=styled$5("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),StyledToolTipContent=styled$5("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),ToolTipArrow=styled$5($a093c7e1ec25a057$export$21b07c8f274aebd5,{fill:"$toolTipBackground"});function Portal$1({children:tt}){const{className:et}=reactExports.useContext(ThemeContext$3);return React$1.createElement($f1701beae083dbae$export$be92b6f5f03c0fe9,{className:et},tt)}const _excluded$6$2=["align"];function OptionalToggle(){const{id:tt,disable:et,disabled:nt}=useInputContext();return React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledOptionalToggle,{id:tt+"__disable",type:"checkbox",checked:!nt,onChange:()=>et(!nt)}),React$1.createElement("label",{htmlFor:tt+"__disable"}))}function RawLabel(tt){const{id:et,optional:nt,hint:it}=useInputContext(),rt=tt.htmlFor||(et?{htmlFor:et}:null),ot=!it&&typeof tt.children=="string"?{title:tt.children}:null;return React$1.createElement(React$1.Fragment,null,nt&&React$1.createElement(OptionalToggle,null),it!==void 0?React$1.createElement($a093c7e1ec25a057$export$be92b6f5f03c0fe9,null,React$1.createElement($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0},React$1.createElement(StyledLabel$1,_extends$s({},rt,tt))),React$1.createElement($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{side:"top",sideOffset:2},React$1.createElement(StyledToolTipContent,null,it,React$1.createElement(ToolTipArrow,null)))):React$1.createElement(StyledLabel$1,_extends$s({},rt,ot,tt)))}function Label$2(tt){let{align:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$6$2);const{value:it,label:rt,key:ot,disabled:at}=useInputContext(),{hideCopyButton:st}=usePanelSettingsContext(),lt=!st&&ot!==void 0,[ct,ut]=reactExports.useState(!1),ht=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[ot]:it??""})),ut(!0)}catch{warn$3(LevaErrors.CLIPBOARD_ERROR,{[ot]:it})}};return React$1.createElement(CopyLabelContainer,{align:et,onPointerLeave:()=>ut(!1)},React$1.createElement(RawLabel,nt),lt&&!at&&React$1.createElement("div",{title:`Click to copy ${typeof rt=="string"?rt:ot} value`},ct?React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),React$1.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):React$1.createElement("svg",{onClick:ht,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),React$1.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const _excluded$5$2=["toggled"],Svg$1=styled$5("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Chevron(tt){let{toggled:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$5$2);return React$1.createElement(Svg$1,_extends$s({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${et?0:-90}deg)`}},nt),React$1.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const _excluded$4$2=["input"];function Row(tt){let{input:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$4$2);return et?React$1.createElement(StyledInputRow,nt):React$1.createElement(StyledRow,nt)}function useInputSetters({value:tt,type:et,settings:nt,setValue:it}){const[rt,ot]=reactExports.useState(format$2$1(et,tt,nt)),at=reactExports.useRef(tt),st=reactExports.useRef(nt);st.current=nt;const lt=reactExports.useCallback(ut=>ot(format$2$1(et,ut,st.current)),[et]),ct=reactExports.useCallback(ut=>{try{it(ut)}catch(ht){const{type:dt,previousValue:pt}=ht;if(dt!=="LEVA_ERROR")throw ht;lt(pt)}},[lt,it]);return reactExports.useEffect(()=>{dequal(tt,at.current)||lt(tt),at.current=tt},[tt,lt]),{displayValue:rt,onChange:ot,onUpdate:ct}}function useDrag$1(tt,et){const{emitOnEditStart:nt,emitOnEditEnd:it}=useInputContext();return useDrag$2(rt=>{rt.first&&(document.body.classList.add("leva__panel__dragged"),nt==null||nt());const ot=tt(rt);return rt.last&&(document.body.classList.remove("leva__panel__dragged"),it==null||it()),ot},et)}function useCanvas2d(tt){const et=reactExports.useRef(null),nt=reactExports.useRef(null),it=reactExports.useRef(!1);return reactExports.useEffect(()=>{const rt=debounce$5(()=>{et.current.width=et.current.offsetWidth*window.devicePixelRatio,et.current.height=et.current.offsetHeight*window.devicePixelRatio,tt(et.current,nt.current)},250);return window.addEventListener("resize",rt),it.current||(rt(),it.current=!0),()=>window.removeEventListener("resize",rt)},[tt]),reactExports.useEffect(()=>{nt.current=et.current.getContext("2d")},[]),[et,nt]}function useTransform(){const tt=reactExports.useRef(null),et=reactExports.useRef({x:0,y:0}),nt=reactExports.useCallback(it=>{Object.assign(et.current,it),tt.current&&(tt.current.style.transform=`translate3d(${et.current.x}px, ${et.current.y}px, 0)`)},[]);return[tt,nt]}const _excluded$3$2=["__refCount"],getInputAtPath=(tt,et)=>{if(!tt[et])return null;const nt=tt[et];return _objectWithoutProperties$l(nt,_excluded$3$2)};function useInput(tt){const et=useStoreContext(),[nt,it]=reactExports.useState(getInputAtPath(et.getData(),tt)),rt=reactExports.useCallback(ct=>et.setValueAtPath(tt,ct,!0),[tt,et]),ot=reactExports.useCallback(ct=>et.setSettingsAtPath(tt,ct),[tt,et]),at=reactExports.useCallback(ct=>et.disableInputAtPath(tt,ct),[tt,et]),st=reactExports.useCallback(()=>et.emitOnEditStart(tt),[tt,et]),lt=reactExports.useCallback(()=>et.emitOnEditEnd(tt),[tt,et]);return reactExports.useEffect(()=>{it(getInputAtPath(et.getData(),tt));const ct=et.useStore.subscribe(ut=>getInputAtPath(ut.data,tt),it,{equalityFn:shallow$2});return()=>ct()},[et,tt]),[nt,{set:rt,setSettings:ot,disable:at,storeId:et.storeId,emitOnEditStart:st,emitOnEditEnd:lt}]}const RangeGrid=styled$5("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),Range=styled$5("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),Scrubber=styled$5("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),RangeWrapper=styled$5("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),Indicator=styled$5("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function RangeSlider({value:tt,min:et,max:nt,onDrag:it,step:rt,initialValue:ot}){const at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useRef(0),ct=useTh("sizes","scrubberWidth"),ut=useDrag$1(({event:dt,first:pt,xy:[mt],movement:[gt],memo:bt})=>{if(pt){const{width:wt,left:vt}=at.current.getBoundingClientRect();lt.current=wt-parseFloat(ct),bt=(dt==null?void 0:dt.target)===st.current?tt:invertedRange((mt-vt)/wt,et,nt)}const yt=bt+invertedRange(gt/lt.current,0,nt-et);return it(sanitizeStep$1(yt,{step:rt,initialValue:ot})),bt}),ht=range$9(tt,et,nt);return React$1.createElement(RangeWrapper,_extends$s({ref:at},ut()),React$1.createElement(Range,null,React$1.createElement(Indicator,{style:{left:0,right:`${(1-ht)*100}%`}})),React$1.createElement(Scrubber,{ref:st,style:{left:`calc(${ht} * (100% - ${ct}))`}}))}const DraggableLabel=React$1.memo(({label:tt,onUpdate:et,step:nt,innerLabelTrim:it})=>{const[rt,ot]=reactExports.useState(!1),at=useDrag$1(({active:st,delta:[lt],event:ct,memo:ut=0})=>(ot(st),ut+=lt/2,Math.abs(ut)>=1&&(et(ht=>parseFloat(ht)+Math.floor(ut)*nt*multiplyStep(ct)),ut=0),ut));return React$1.createElement(InnerNumberLabel,_extends$s({dragging:rt,title:tt.length>1?tt:""},at()),tt.slice(0,it))});function Number$1({label:tt,id:et,displayValue:nt,onUpdate:it,onChange:rt,settings:ot,innerLabelTrim:at=1}){const st=at>0&&React$1.createElement(DraggableLabel,{label:tt,step:ot.step,onUpdate:it,innerLabelTrim:at});return React$1.createElement(NumberInput,{id:et,value:String(nt),onUpdate:it,onChange:rt,innerLabel:st})}function NumberComponent(){const tt=useInputContext(),{label:et,value:nt,onUpdate:it,settings:rt,id:ot}=tt,{min:at,max:st}=rt,lt=st!==1/0&&at!==-1/0;return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,et),React$1.createElement(RangeGrid,{hasRange:lt},lt&&React$1.createElement(RangeSlider,_extends$s({value:parseFloat(nt),onDrag:it},rt)),React$1.createElement(Number$1,_extends$s({},tt,{id:ot,label:"value",innerLabelTrim:lt?0:1}))))}const{sanitizeStep}=props$3$1,rest=_objectWithoutProperties$l(props$3$1,["sanitizeStep"]);var number$7=_objectSpread2$1({component:NumberComponent},rest);const schema$2$1=(tt,et)=>v8n().schema({options:v8n().passesAnyOf(v8n().object(),v8n().array())}).test(et),sanitize$2$1=(tt,{values:et})=>{if(et.indexOf(tt)<0)throw Error("Selected value doesn't match Select options");return tt},format$3=(tt,{values:et})=>et.indexOf(tt),normalize$1$2=tt=>{let{value:et,options:nt}=tt,it,rt;return Array.isArray(nt)?(rt=nt,it=nt.map(ot=>String(ot))):(rt=Object.values(nt),it=Object.keys(nt)),"value"in tt?rt.includes(et)||(it.unshift(String(et)),rt.unshift(et)):et=rt[0],Object.values(nt).includes(et)||(nt[String(et)]=et),{value:et,settings:{keys:it,values:rt}}};var props$2$1=Object.freeze({__proto__:null,schema:schema$2$1,sanitize:sanitize$2$1,format:format$3,normalize:normalize$1$2});const SelectContainer=styled$5("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),NativeSelect=styled$5("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),PresentationalSelect=styled$5("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${NativeSelect}:focus + &`]:{$focusStyle:""},[`${NativeSelect}:hover + &`]:{$hoverStyle:""}});function Select$4({displayValue:tt,value:et,onUpdate:nt,id:it,settings:rt,disabled:ot}){const{keys:at,values:st}=rt,lt=reactExports.useRef();return et===st[tt]&&(lt.current=at[tt]),React$1.createElement(SelectContainer,null,React$1.createElement(NativeSelect,{id:it,value:tt,onChange:ct=>nt(st[Number(ct.currentTarget.value)]),disabled:ot},at.map((ct,ut)=>React$1.createElement("option",{key:ct,value:ut},ct))),React$1.createElement(PresentationalSelect,null,lt.current),React$1.createElement(Chevron,{toggled:!0}))}function SelectComponent(){const{label:tt,value:et,displayValue:nt,onUpdate:it,id:rt,disabled:ot,settings:at}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Select$4,{id:rt,value:et,displayValue:nt,onUpdate:it,settings:at,disabled:ot}))}var select$1=_objectSpread2$1({component:SelectComponent},props$2$1);const schema$1$1=tt=>v8n().string().test(tt),sanitize$1$1=tt=>{if(typeof tt!="string")throw Error("Invalid string");return tt},normalize$6=({value:tt,editable:et=!0,rows:nt=!1})=>({value:tt,settings:{editable:et,rows:typeof nt=="number"?nt:nt?5:0}});var props$1$1=Object.freeze({__proto__:null,schema:schema$1$1,sanitize:sanitize$1$1,normalize:normalize$6});const _excluded$2$2=["displayValue","onUpdate","onChange","editable"],NonEditableString=styled$5("div",{whiteSpace:"pre-wrap"});function String$1(tt){let{displayValue:et,onUpdate:nt,onChange:it,editable:rt=!0}=tt,ot=_objectWithoutProperties$l(tt,_excluded$2$2);return rt?React$1.createElement(ValueInput,_extends$s({value:et,onUpdate:nt,onChange:it},ot)):React$1.createElement(NonEditableString,null,et)}function StringComponent(){const{label:tt,settings:et,displayValue:nt,onUpdate:it,onChange:rt}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(String$1,_extends$s({displayValue:nt,onUpdate:it,onChange:rt},et)))}var string$3=_objectSpread2$1({component:StringComponent},props$1$1);const schema$4=tt=>v8n().boolean().test(tt),sanitize$5=tt=>{if(typeof tt!="boolean")throw Error("Invalid boolean");return tt};var props$4=Object.freeze({__proto__:null,schema:schema$4,sanitize:sanitize$5});const StyledInputWrapper=styled$5("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function Boolean$1({value:tt,onUpdate:et,id:nt,disabled:it}){return React$1.createElement(StyledInputWrapper,null,React$1.createElement("input",{id:nt,type:"checkbox",checked:tt,onChange:rt=>et(rt.currentTarget.checked),disabled:it}),React$1.createElement("label",{htmlFor:nt},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},React$1.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function BooleanComponent(){const{label:tt,value:et,onUpdate:nt,disabled:it,id:rt}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Boolean$1,{value:et,onUpdate:nt,id:rt,disabled:it}))}var boolean$1=_objectSpread2$1({component:BooleanComponent},props$4);const _excluded$1$4=["locked"];function Coordinate({value:tt,id:et,valueKey:nt,settings:it,onUpdate:rt,innerLabelTrim:ot}){const at=reactExports.useRef(tt[nt]);at.current=tt[nt];const st=reactExports.useCallback(ct=>rt({[nt]:sanitizeValue({type:"NUMBER",value:at.current,settings:it},ct)}),[rt,it,nt]),lt=useInputSetters({type:"NUMBER",value:tt[nt],settings:it,setValue:st});return React$1.createElement(Number$1,{id:et,label:nt,value:tt[nt],displayValue:lt.displayValue,onUpdate:lt.onUpdate,onChange:lt.onChange,settings:it,innerLabelTrim:ot})}const Container$3=styled$5("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function Lock(tt){let{locked:et}=tt,nt=_objectWithoutProperties$l(tt,_excluded$1$4);return React$1.createElement("svg",_extends$s({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nt),et?React$1.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):React$1.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Vector({value:tt,onUpdate:et,settings:nt,innerLabelTrim:it}){const{id:rt,setSettings:ot}=useInputContext(),{lock:at,locked:st}=nt;return React$1.createElement(Container$3,{withLock:at},at&&React$1.createElement(Lock,{locked:st,onClick:()=>ot({locked:!st})}),Object.keys(tt).map((lt,ct)=>React$1.createElement(Coordinate,{id:ct===0?rt:`${rt}.${lt}`,key:lt,valueKey:lt,value:tt,settings:nt[lt],onUpdate:et,innerLabelTrim:it})))}const normalizeKeyedNumberSettings=(tt,et)=>{const nt={};let it=0,rt=1/0;Object.entries(tt).forEach(([ot,at])=>{nt[ot]=normalize$2$2(_objectSpread2$1({value:at},et[ot])).settings,it=Math.max(it,nt[ot].step),rt=Math.min(rt,nt[ot].pad)});for(let ot in nt){const{step:at,min:st,max:lt}=et[ot]||{};!isFinite(at)&&(!isFinite(st)||!isFinite(lt))&&(nt[ot].step=it,nt[ot].pad=rt)}return nt},_excluded$1h=["lock"],_excluded2$c=["value"];function getVectorSchema(tt){const et=v8n().array().length(tt).every.number(),nt=it=>{if(!it||typeof it!="object")return!1;const rt=Object.values(it);return rt.length===tt&&rt.every(ot=>isFinite(ot))};return it=>et.test(it)||nt(it)}function getVectorType(tt){return Array.isArray(tt)?"array":"object"}function convert$7(tt,et,nt){return getVectorType(tt)===et?tt:et==="array"?Object.values(tt):mapArrayToKeys(tt,nt)}const sanitizeVector=(tt,et,nt)=>{const it=convert$7(tt,"object",et.keys);for(let at in it)it[at]=sanitize$3(it[at],et[at]);const rt=Object.keys(it);let ot={};if(rt.length===et.keys.length)ot=it;else{const at=convert$7(nt,"object",et.keys);if(rt.length===1&&et.locked){const st=rt[0],lt=it[st],ct=at[st],ut=ct!==0?lt/ct:1;for(let ht in at)ht===st?ot[st]=lt:ot[ht]=at[ht]*ut}else ot=_objectSpread2$1(_objectSpread2$1({},at),it)}return convert$7(ot,et.format,et.keys)},formatVector=(tt,et)=>convert$7(tt,"object",et.keys),isNumberSettings=tt=>!!tt&&("step"in tt||"min"in tt||"max"in tt);function normalizeVector(tt,et,nt=[]){const{lock:it=!1}=et,rt=_objectWithoutProperties$l(et,_excluded$1h),ot=Array.isArray(tt)?"array":"object",at=ot==="object"?Object.keys(tt):nt,st=convert$7(tt,"object",at),lt=isNumberSettings(rt)?at.reduce((ut,ht)=>Object.assign(ut,{[ht]:rt}),{}):rt,ct=normalizeKeyedNumberSettings(st,lt);return{value:ot==="array"?tt:st,settings:_objectSpread2$1(_objectSpread2$1({},ct),{},{format:ot,keys:at,lock:it,locked:!1})}}function getVectorPlugin(tt){return{schema:getVectorSchema(tt.length),normalize:et=>{let{value:nt}=et,it=_objectWithoutProperties$l(et,_excluded2$c);return normalizeVector(nt,it,tt)},format:(et,nt)=>formatVector(et,nt),sanitize:(et,nt,it)=>sanitizeVector(et,nt,it)}}var r$b={grad:.9,turn:360,rad:360/(2*Math.PI)},t$6=function(tt){return typeof tt=="string"?tt.length>0:typeof tt=="number"},n$6=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=Math.pow(10,et)),Math.round(nt*tt)/nt+0},e$5=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=1),tt>nt?nt:tt>et?tt:et},u$5=function(tt){return(tt=isFinite(tt)?tt%360:0)>0?tt:tt+360},a$3=function(tt){return{r:e$5(tt.r,0,255),g:e$5(tt.g,0,255),b:e$5(tt.b,0,255),a:e$5(tt.a)}},o$1=function(tt){return{r:n$6(tt.r),g:n$6(tt.g),b:n$6(tt.b),a:n$6(tt.a,3)}},i$7=/^#([0-9a-f]{3,8})$/i,s$4=function(tt){var et=tt.toString(16);return et.length<2?"0"+et:et},h$a=function(tt){var et=tt.r,nt=tt.g,it=tt.b,rt=tt.a,ot=Math.max(et,nt,it),at=ot-Math.min(et,nt,it),st=at?ot===et?(nt-it)/at:ot===nt?2+(it-et)/at:4+(et-nt)/at:0;return{h:60*(st<0?st+6:st),s:ot?at/ot*100:0,v:ot/255*100,a:rt}},b$6=function(tt){var et=tt.h,nt=tt.s,it=tt.v,rt=tt.a;et=et/360*6,nt/=100,it/=100;var ot=Math.floor(et),at=it*(1-nt),st=it*(1-(et-ot)*nt),lt=it*(1-(1-et+ot)*nt),ct=ot%6;return{r:255*[it,st,at,at,lt,it][ct],g:255*[lt,it,it,st,at,at][ct],b:255*[at,at,lt,it,it,st][ct],a:rt}},g$8=function(tt){return{h:u$5(tt.h),s:e$5(tt.s,0,100),l:e$5(tt.l,0,100),a:e$5(tt.a)}},d$5=function(tt){return{h:n$6(tt.h),s:n$6(tt.s),l:n$6(tt.l),a:n$6(tt.a,3)}},f$7=function(tt){return b$6((nt=(et=tt).s,{h:et.h,s:(nt*=((it=et.l)<50?it:100-it)/100)>0?2*nt/(it+nt)*100:0,v:it+nt,a:et.a}));var et,nt,it},c$7=function(tt){return{h:(et=h$a(tt)).h,s:(rt=(200-(nt=et.s))*(it=et.v)/100)>0&&rt<200?nt*it/100/(rt<=100?rt:200-rt)*100:0,l:rt/2,a:et.a};var et,nt,it,rt},l$5=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p$7=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v$9=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m$7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y$7={string:[[function(tt){var et=i$7.exec(tt);return et?(tt=et[1]).length<=4?{r:parseInt(tt[0]+tt[0],16),g:parseInt(tt[1]+tt[1],16),b:parseInt(tt[2]+tt[2],16),a:tt.length===4?n$6(parseInt(tt[3]+tt[3],16)/255,2):1}:tt.length===6||tt.length===8?{r:parseInt(tt.substr(0,2),16),g:parseInt(tt.substr(2,2),16),b:parseInt(tt.substr(4,2),16),a:tt.length===8?n$6(parseInt(tt.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(tt){var et=v$9.exec(tt)||m$7.exec(tt);return et?et[2]!==et[4]||et[4]!==et[6]?null:a$3({r:Number(et[1])/(et[2]?100/255:1),g:Number(et[3])/(et[4]?100/255:1),b:Number(et[5])/(et[6]?100/255:1),a:et[7]===void 0?1:Number(et[7])/(et[8]?100:1)}):null},"rgb"],[function(tt){var et=l$5.exec(tt)||p$7.exec(tt);if(!et)return null;var nt,it,rt=g$8({h:(nt=et[1],it=et[2],it===void 0&&(it="deg"),Number(nt)*(r$b[it]||1)),s:Number(et[3]),l:Number(et[4]),a:et[5]===void 0?1:Number(et[5])/(et[6]?100:1)});return f$7(rt)},"hsl"]],object:[[function(tt){var et=tt.r,nt=tt.g,it=tt.b,rt=tt.a,ot=rt===void 0?1:rt;return t$6(et)&&t$6(nt)&&t$6(it)?a$3({r:Number(et),g:Number(nt),b:Number(it),a:Number(ot)}):null},"rgb"],[function(tt){var et=tt.h,nt=tt.s,it=tt.l,rt=tt.a,ot=rt===void 0?1:rt;if(!t$6(et)||!t$6(nt)||!t$6(it))return null;var at=g$8({h:Number(et),s:Number(nt),l:Number(it),a:Number(ot)});return f$7(at)},"hsl"],[function(tt){var et=tt.h,nt=tt.s,it=tt.v,rt=tt.a,ot=rt===void 0?1:rt;if(!t$6(et)||!t$6(nt)||!t$6(it))return null;var at=function(st){return{h:u$5(st.h),s:e$5(st.s,0,100),v:e$5(st.v,0,100),a:e$5(st.a)}}({h:Number(et),s:Number(nt),v:Number(it),a:Number(ot)});return b$6(at)},"hsv"]]},N$1=function(tt,et){for(var nt=0;nt=.5},tt.prototype.toHex=function(){return et=o$1(this.rgba),nt=et.r,it=et.g,rt=et.b,at=(ot=et.a)<1?s$4(n$6(255*ot)):"","#"+s$4(nt)+s$4(it)+s$4(rt)+at;var et,nt,it,rt,ot,at},tt.prototype.toRgb=function(){return o$1(this.rgba)},tt.prototype.toRgbString=function(){return et=o$1(this.rgba),nt=et.r,it=et.g,rt=et.b,(ot=et.a)<1?"rgba("+nt+", "+it+", "+rt+", "+ot+")":"rgb("+nt+", "+it+", "+rt+")";var et,nt,it,rt,ot},tt.prototype.toHsl=function(){return d$5(c$7(this.rgba))},tt.prototype.toHslString=function(){return et=d$5(c$7(this.rgba)),nt=et.h,it=et.s,rt=et.l,(ot=et.a)<1?"hsla("+nt+", "+it+"%, "+rt+"%, "+ot+")":"hsl("+nt+", "+it+"%, "+rt+"%)";var et,nt,it,rt,ot},tt.prototype.toHsv=function(){return et=h$a(this.rgba),{h:n$6(et.h),s:n$6(et.s),v:n$6(et.v),a:n$6(et.a,3)};var et},tt.prototype.invert=function(){return w$6({r:255-(et=this.rgba).r,g:255-et.g,b:255-et.b,a:et.a});var et},tt.prototype.saturate=function(et){return et===void 0&&(et=.1),w$6(M$1(this.rgba,et))},tt.prototype.desaturate=function(et){return et===void 0&&(et=.1),w$6(M$1(this.rgba,-et))},tt.prototype.grayscale=function(){return w$6(M$1(this.rgba,-1))},tt.prototype.lighten=function(et){return et===void 0&&(et=.1),w$6($$2(this.rgba,et))},tt.prototype.darken=function(et){return et===void 0&&(et=.1),w$6($$2(this.rgba,-et))},tt.prototype.rotate=function(et){return et===void 0&&(et=15),this.hue(this.hue()+et)},tt.prototype.alpha=function(et){return typeof et=="number"?w$6({r:(nt=this.rgba).r,g:nt.g,b:nt.b,a:et}):n$6(this.rgba.a,3);var nt},tt.prototype.hue=function(et){var nt=c$7(this.rgba);return typeof et=="number"?w$6({h:et,s:nt.s,l:nt.l,a:nt.a}):n$6(nt.h)},tt.prototype.isEqual=function(et){return this.toHex()===w$6(et).toHex()},tt}(),w$6=function(tt){return tt instanceof j$2?tt:new j$2(tt)},S$2=[],k$9=function(tt){tt.forEach(function(et){S$2.indexOf(et)<0&&(et(j$2,y$7),S$2.push(et))})};function namesPlugin(tt,et){var nt={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},it={};for(var rt in nt)it[nt[rt]]=rt;var ot={};tt.prototype.toName=function(at){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var st,lt,ct=it[this.toHex()];if(ct)return ct;if(at!=null&&at.closest){var ut=this.toRgb(),ht=1/0,dt="black";if(!ot.length)for(var pt in nt)ot[pt]=new tt(nt[pt]).toRgb();for(var mt in nt){var gt=(st=ut,lt=ot[mt],Math.pow(st.r-lt.r,2)+Math.pow(st.g-lt.g,2)+Math.pow(st.b-lt.b,2));gt=0||(rt[nt]=tt[nt]);return rt}function i$6(tt){var et=reactExports.useRef(tt),nt=reactExports.useRef(function(it){et.current&&et.current(it)});return et.current=tt,nt.current}var s$3=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=1),tt>nt?nt:tt0:bt.buttons>0)&&rt.current?ot(d$4(rt.current,bt,st.current)):gt(!1)},mt=function(){return gt(!1)};function gt(bt){var yt=lt.current,wt=v$8(rt.current),vt=bt?wt.addEventListener:wt.removeEventListener;vt(yt?"touchmove":"mousemove",pt),vt(yt?"touchend":"mouseup",mt)}return[function(bt){var yt=bt.nativeEvent,wt=rt.current;if(wt&&(h$9(yt),!function(xt,St){return St&&!f$6(xt)}(yt,lt.current)&&wt)){if(f$6(yt)){lt.current=!0;var vt=yt.changedTouches||[];vt.length&&(st.current=vt[0].identifier)}wt.focus(),ot(d$4(wt,yt,st.current)),gt(!0)}},function(bt){var yt=bt.which||bt.keyCode;yt<37||yt>40||(bt.preventDefault(),at({left:yt===39?.05:yt===37?-.05:0,top:yt===40?.05:yt===38?-.05:0}))},gt]},[at,ot]),ut=ct[0],ht=ct[1],dt=ct[2];return reactExports.useEffect(function(){return dt},[dt]),React$1.createElement("div",u$4({},it,{onTouchStart:ut,onMouseDown:ut,className:"react-colorful__interactive",ref:rt,onKeyDown:ht,tabIndex:0,role:"slider"}))}),g$7=function(tt){return tt.filter(Boolean).join(" ")},p$6=function(tt){var et=tt.color,nt=tt.left,it=tt.top,rt=it===void 0?.5:it,ot=g$7(["react-colorful__pointer",tt.className]);return React$1.createElement("div",{className:ot,style:{top:100*rt+"%",left:100*nt+"%"}},React$1.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:et}}))},b$5=function(tt,et,nt){return et===void 0&&(et=0),nt===void 0&&(nt=Math.pow(10,et)),Math.round(nt*tt)/nt},y$6=function(tt){var et=tt.s,nt=tt.v,it=tt.a,rt=(200-et)*nt/100;return{h:b$5(tt.h),s:b$5(rt>0&&rt<200?et*nt/100/(rt<=100?rt:200-rt)*100:0),l:b$5(rt/2),a:b$5(it,2)}},q$6=function(tt){var et=y$6(tt);return"hsl("+et.h+", "+et.s+"%, "+et.l+"%)"},k$8=function(tt){var et=y$6(tt);return"hsla("+et.h+", "+et.s+"%, "+et.l+"%, "+et.a+")"},I$1=function(tt){var et=tt.h,nt=tt.s,it=tt.v,rt=tt.a;et=et/360*6,nt/=100,it/=100;var ot=Math.floor(et),at=it*(1-nt),st=it*(1-(et-ot)*nt),lt=it*(1-(1-et+ot)*nt),ct=ot%6;return{r:b$5(255*[it,st,at,at,lt,it][ct]),g:b$5(255*[lt,it,it,st,at,at][ct]),b:b$5(255*[at,at,lt,it,it,st][ct]),a:b$5(rt,2)}},L$1=function(tt){var et=tt.r,nt=tt.g,it=tt.b,rt=tt.a,ot=Math.max(et,nt,it),at=ot-Math.min(et,nt,it),st=at?ot===et?(nt-it)/at:ot===nt?2+(it-et)/at:4+(et-nt)/at:0;return{h:b$5(60*(st<0?st+6:st)),s:b$5(ot?at/ot*100:0),v:b$5(ot/255*100),a:rt}},S$1=React$1.memo(function(tt){var et=tt.hue,nt=tt.onChange,it=g$7(["react-colorful__hue",tt.className]);return React$1.createElement("div",{className:it},React$1.createElement(m$6,{onMove:function(rt){nt({h:360*rt.left})},onKey:function(rt){nt({h:s$3(et+360*rt.left,0,360)})},"aria-label":"Hue","aria-valuenow":b$5(et),"aria-valuemax":"360","aria-valuemin":"0"},React$1.createElement(p$6,{className:"react-colorful__hue-pointer",left:et/360,color:q$6({h:et,s:100,v:100,a:1})})))}),T$1=React$1.memo(function(tt){var et=tt.hsva,nt=tt.onChange,it={backgroundColor:q$6({h:et.h,s:100,v:100,a:1})};return React$1.createElement("div",{className:"react-colorful__saturation",style:it},React$1.createElement(m$6,{onMove:function(rt){nt({s:100*rt.left,v:100-100*rt.top})},onKey:function(rt){nt({s:s$3(et.s+100*rt.left,0,100),v:s$3(et.v-100*rt.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+b$5(et.s)+"%, Brightness "+b$5(et.v)+"%"},React$1.createElement(p$6,{className:"react-colorful__saturation-pointer",top:1-et.v/100,left:et.s/100,color:q$6(et)})))}),F$1=function(tt,et){if(tt===et)return!0;for(var nt in tt)if(tt[nt]!==et[nt])return!1;return!0};function Y$1(tt,et,nt){var it=i$6(nt),rt=reactExports.useState(function(){return tt.toHsva(et)}),ot=rt[0],at=rt[1],st=reactExports.useRef({color:et,hsva:ot});reactExports.useEffect(function(){if(!tt.equal(et,st.current.color)){var ct=tt.toHsva(et);st.current={hsva:ct,color:et},at(ct)}},[et,tt]),reactExports.useEffect(function(){var ct;F$1(ot,st.current.hsva)||tt.equal(ct=tt.fromHsva(ot),st.current.color)||(st.current={hsva:ot,color:ct},it(ct))},[ot,tt,it]);var lt=reactExports.useCallback(function(ct){at(function(ut){return Object.assign({},ut,ct)})},[]);return[ot,lt]}var V$1=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,$$1=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J$1=new Map,Q$1=function(tt){V$1(function(){var et=tt.current?tt.current.ownerDocument:document;if(et!==void 0&&!J$1.has(et)){var nt=et.createElement("style");nt.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J$1.set(et,nt);var it=$$1();it&&nt.setAttribute("nonce",it),et.head.appendChild(nt)}},[])},U$1=function(tt){var et=tt.className,nt=tt.colorModel,it=tt.color,rt=it===void 0?nt.defaultColor:it,ot=tt.onChange,at=c$6(tt,["className","colorModel","color","onChange"]),st=reactExports.useRef(null);Q$1(st);var lt=Y$1(nt,rt,ot),ct=lt[0],ut=lt[1],ht=g$7(["react-colorful",et]);return React$1.createElement("div",u$4({},at,{ref:st,className:ht}),React$1.createElement(T$1,{hsva:ct,onChange:ut}),React$1.createElement(S$1,{hue:ct.h,onChange:ut,className:"react-colorful__last-control"}))},ee$1=function(tt){var et=tt.className,nt=tt.hsva,it=tt.onChange,rt={backgroundImage:"linear-gradient(90deg, "+k$8(Object.assign({},nt,{a:0}))+", "+k$8(Object.assign({},nt,{a:1}))+")"},ot=g$7(["react-colorful__alpha",et]),at=b$5(100*nt.a);return React$1.createElement("div",{className:ot},React$1.createElement("div",{className:"react-colorful__alpha-gradient",style:rt}),React$1.createElement(m$6,{onMove:function(st){it({a:st.left})},onKey:function(st){it({a:s$3(nt.a+st.left)})},"aria-label":"Alpha","aria-valuetext":at+"%","aria-valuenow":at,"aria-valuemin":"0","aria-valuemax":"100"},React$1.createElement(p$6,{className:"react-colorful__alpha-pointer",left:nt.a,color:k$8(nt)})))},re$4=function(tt){var et=tt.className,nt=tt.colorModel,it=tt.color,rt=it===void 0?nt.defaultColor:it,ot=tt.onChange,at=c$6(tt,["className","colorModel","color","onChange"]),st=reactExports.useRef(null);Q$1(st);var lt=Y$1(nt,rt,ot),ct=lt[0],ut=lt[1],ht=g$7(["react-colorful",et]);return React$1.createElement("div",u$4({},at,{ref:st,className:ht}),React$1.createElement(T$1,{hsva:ct,onChange:ut}),React$1.createElement(S$1,{hue:ct.h,onChange:ut}),React$1.createElement(ee$1,{hsva:ct,onChange:ut,className:"react-colorful__last-control"}))},xe$1={defaultColor:{r:0,g:0,b:0,a:1},toHsva:L$1,fromHsva:I$1,equal:F$1},Ce=function(tt){return React$1.createElement(re$4,u$4({},tt,{colorModel:xe$1}))},Me$1={defaultColor:{r:0,g:0,b:0},toHsva:function(tt){return L$1({r:tt.r,g:tt.g,b:tt.b,a:1})},fromHsva:function(tt){return{r:(et=I$1(tt)).r,g:et.g,b:et.b};var et},equal:F$1},Ne$1=function(tt){return React$1.createElement(U$1,u$4({},tt,{colorModel:Me$1}))},propTypes$1={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function tt(it,rt,ot,at,st,lt){if(lt!==ReactPropTypesSecret){var ct=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 ct.name="Invariant Violation",ct}}tt.isRequired=tt;function et(){return tt}var nt={array:tt,bigint:tt,bool:tt,func:tt,number:tt,object:tt,string:tt,symbol:tt,any:tt,arrayOf:et,element:tt,elementType:tt,instanceOf:et,node:tt,objectOf:et,oneOf:et,oneOfType:et,shape:et,exact:et,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return nt.PropTypes=nt,nt};propTypes$1.exports=factoryWithThrowingShims();var propTypesExports=propTypes$1.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function __decorate(tt,et,nt,it){var rt=arguments.length,ot=rt<3?et:it===null?it=Object.getOwnPropertyDescriptor(et,nt):it,at;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ot=Reflect.decorate(tt,et,nt,it);else for(var st=tt.length-1;st>=0;st--)(at=tt[st])&&(ot=(rt<3?at(ot):rt>3?at(et,nt,ot):at(et,nt))||ot);return rt>3&&ot&&Object.defineProperty(et,nt,ot),ot}function __awaiter(tt,et,nt,it){function rt(ot){return ot instanceof nt?ot:new nt(function(at){at(ot)})}return new(nt||(nt=Promise))(function(ot,at){function st(ut){try{ct(it.next(ut))}catch(ht){at(ht)}}function lt(ut){try{ct(it.throw(ut))}catch(ht){at(ht)}}function ct(ut){ut.done?ot(ut.value):rt(ut.value).then(st,lt)}ct((it=it.apply(tt,et||[])).next())})}function __generator(tt,et){var nt={label:0,sent:function(){if(ot[0]&1)throw ot[1];return ot[1]},trys:[],ops:[]},it,rt,ot,at;return at={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(at[Symbol.iterator]=function(){return this}),at;function st(ct){return function(ut){return lt([ct,ut])}}function lt(ct){if(it)throw new TypeError("Generator is already executing.");for(;at&&(at=0,ct[0]&&(nt=0)),nt;)try{if(it=1,rt&&(ot=ct[0]&2?rt.return:ct[0]?rt.throw||((ot=rt.return)&&ot.call(rt),0):rt.next)&&!(ot=ot.call(rt,ct[1])).done)return ot;switch(rt=0,ot&&(ct=[ct[0]&2,ot.value]),ct[0]){case 0:case 1:ot=ct;break;case 4:return nt.label++,{value:ct[1],done:!1};case 5:nt.label++,rt=ct[1],ct=[0];continue;case 7:ct=nt.ops.pop(),nt.trys.pop();continue;default:if(ot=nt.trys,!(ot=ot.length>0&&ot[ot.length-1])&&(ct[0]===6||ct[0]===2)){nt=0;continue}if(ct[0]===3&&(!ot||ct[1]>ot[0]&&ct[1]0)&&!(rt=it.next()).done;)ot.push(rt.value)}catch(st){at={error:st}}finally{try{rt&&!rt.done&&(nt=it.return)&&nt.call(it)}finally{if(at)throw at.error}}return ot}function __spread(){for(var tt=[],et=0;et0?it:tt.name,writable:!1,configurable:!1,enumerable:!0})}return nt}function withMimeType(tt){var et=tt.name,nt=et&&et.lastIndexOf(".")!==-1;if(nt&&!tt.type){var it=et.split(".").pop().toLowerCase(),rt=COMMON_MIME_TYPES.get(it);rt&&Object.defineProperty(tt,"type",{value:rt,writable:!1,configurable:!1,enumerable:!0})}return tt}var FILES_TO_IGNORE=[".DS_Store","Thumbs.db"];function fromEvent(tt){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(et){return isObject$s(tt)&&isDataTransfer(tt)?[2,getDataTransferFiles(tt.dataTransfer,tt.type)]:isChangeEvt(tt)?[2,getInputFiles(tt)]:Array.isArray(tt)&&tt.every(function(nt){return"getFile"in nt&&typeof nt.getFile=="function"})?[2,getFsHandleFiles(tt)]:[2,[]]})})}function isDataTransfer(tt){return isObject$s(tt.dataTransfer)}function isChangeEvt(tt){return isObject$s(tt)&&isObject$s(tt.target)}function isObject$s(tt){return typeof tt=="object"&&tt!==null}function getInputFiles(tt){return fromList(tt.target.files).map(function(et){return toFileWithPath(et)})}function getFsHandleFiles(tt){return __awaiter(this,void 0,void 0,function(){var et;return __generator(this,function(nt){switch(nt.label){case 0:return[4,Promise.all(tt.map(function(it){return it.getFile()}))];case 1:return et=nt.sent(),[2,et.map(function(it){return toFileWithPath(it)})]}})})}function getDataTransferFiles(tt,et){return __awaiter(this,void 0,void 0,function(){var nt,it;return __generator(this,function(rt){switch(rt.label){case 0:return tt===null?[2,[]]:tt.items?(nt=fromList(tt.items).filter(function(ot){return ot.kind==="file"}),et!=="drop"?[2,nt]:[4,Promise.all(nt.map(toFilePromises))]):[3,2];case 1:return it=rt.sent(),[2,noIgnoredFiles(flatten$1(it))];case 2:return[2,noIgnoredFiles(fromList(tt.files).map(function(ot){return toFileWithPath(ot)}))]}})})}function noIgnoredFiles(tt){return tt.filter(function(et){return FILES_TO_IGNORE.indexOf(et.name)===-1})}function fromList(tt){if(tt===null)return[];for(var et=[],nt=0;nttt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);ntnt)return[!1,getTooLargeRejectionErr(nt)];if(tt.sizent)return[!1,getTooLargeRejectionErr(nt)]}return[!0,null]}function isDefined$1(tt){return tt!=null}function allFilesAccepted(tt){var et=tt.files,nt=tt.accept,it=tt.minSize,rt=tt.maxSize,ot=tt.multiple,at=tt.maxFiles;return!ot&&et.length>1||ot&&at>=1&&et.length>at?!1:et.every(function(st){var lt=fileAccepted(st,nt),ct=_slicedToArray$d(lt,1),ut=ct[0],ht=fileMatchSize(st,it,rt),dt=_slicedToArray$d(ht,1),pt=dt[0];return ut&&pt})}function isPropagationStopped(tt){return typeof tt.isPropagationStopped=="function"?tt.isPropagationStopped():typeof tt.cancelBubble<"u"?tt.cancelBubble:!1}function isEvtWithFiles(tt){return tt.dataTransfer?Array.prototype.some.call(tt.dataTransfer.types,function(et){return et==="Files"||et==="application/x-moz-file"}):!!tt.target&&!!tt.target.files}function onDocumentDragOver(tt){tt.preventDefault()}function isIe(tt){return tt.indexOf("MSIE")!==-1||tt.indexOf("Trident/")!==-1}function isEdge$1(tt){return tt.indexOf("Edge/")!==-1}function isIeOrEdge(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return isIe(tt)||isEdge$1(tt)}function composeEventHandlers(){for(var tt=arguments.length,et=new Array(tt),nt=0;nt1?rt-1:0),at=1;attt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$n(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var Dropzone=reactExports.forwardRef(function(tt,et){var nt=tt.children,it=_objectWithoutProperties$k(tt,_excluded$1g),rt=useDropzone(it),ot=rt.open,at=_objectWithoutProperties$k(rt,_excluded2$b);return reactExports.useImperativeHandle(et,function(){return{open:ot}},[ot]),React$1.createElement(reactExports.Fragment,null,nt(_objectSpread$A(_objectSpread$A({},at),{},{open:ot})))});Dropzone.displayName="Dropzone";var defaultProps$7={disabled:!1,getFilesFromEvent:fromEvent,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};Dropzone.defaultProps=defaultProps$7;Dropzone.propTypes={children:PropTypes.func,accept:PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),multiple:PropTypes.bool,preventDropOnDocument:PropTypes.bool,noClick:PropTypes.bool,noKeyboard:PropTypes.bool,noDrag:PropTypes.bool,noDragEventsBubbling:PropTypes.bool,minSize:PropTypes.number,maxSize:PropTypes.number,maxFiles:PropTypes.number,disabled:PropTypes.bool,getFilesFromEvent:PropTypes.func,onFileDialogCancel:PropTypes.func,onFileDialogOpen:PropTypes.func,useFsAccessApi:PropTypes.bool,onDragEnter:PropTypes.func,onDragLeave:PropTypes.func,onDragOver:PropTypes.func,onDrop:PropTypes.func,onDropAccepted:PropTypes.func,onDropRejected:PropTypes.func,validator:PropTypes.func};var initialState$1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function useDropzone(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},et=_objectSpread$A(_objectSpread$A({},defaultProps$7),tt),nt=et.accept,it=et.disabled,rt=et.getFilesFromEvent,ot=et.maxSize,at=et.minSize,st=et.multiple,lt=et.maxFiles,ct=et.onDragEnter,ut=et.onDragLeave,ht=et.onDragOver,dt=et.onDrop,pt=et.onDropAccepted,mt=et.onDropRejected,gt=et.onFileDialogCancel,bt=et.onFileDialogOpen,yt=et.useFsAccessApi,wt=et.preventDropOnDocument,vt=et.noClick,xt=et.noKeyboard,St=et.noDrag,Et=et.noDragEventsBubbling,$t=et.validator,It=reactExports.useMemo(function(){return typeof bt=="function"?bt:noop$9},[bt]),Ft=reactExports.useMemo(function(){return typeof gt=="function"?gt:noop$9},[gt]),Ht=reactExports.useRef(null),zt=reactExports.useRef(null),Ot=reactExports.useReducer(reducer,initialState$1),jt=_slicedToArray$c(Ot,2),kt=jt[0],Tt=jt[1],Ct=kt.isFocused,Ut=kt.isFileDialogActive,Nt=kt.draggedFiles,Bt=reactExports.useRef(typeof window<"u"&&window.isSecureContext&&yt&&canUseFileSystemAccessAPI()),Mt=function(){!Bt.current&&Ut&&setTimeout(function(){if(zt.current){var sn=zt.current.files;sn.length||(Tt({type:"closeDialog"}),Ft())}},300)};reactExports.useEffect(function(){return window.addEventListener("focus",Mt,!1),function(){window.removeEventListener("focus",Mt,!1)}},[zt,Ut,Ft,Bt]);var Dt=reactExports.useRef([]),Pt=function(sn){Ht.current&&Ht.current.contains(sn.target)||(sn.preventDefault(),Dt.current=[])};reactExports.useEffect(function(){return wt&&(document.addEventListener("dragover",onDocumentDragOver,!1),document.addEventListener("drop",Pt,!1)),function(){wt&&(document.removeEventListener("dragover",onDocumentDragOver),document.removeEventListener("drop",Pt))}},[Ht,wt]);var Vt=reactExports.useCallback(function(dn){dn.preventDefault(),dn.persist(),Nn(dn),Dt.current=[].concat(_toConsumableArray$b(Dt.current),[dn.target]),isEvtWithFiles(dn)&&Promise.resolve(rt(dn)).then(function(sn){isPropagationStopped(dn)&&!Et||(Tt({draggedFiles:sn,isDragActive:!0,type:"setDraggedFiles"}),ct&&ct(dn))})},[rt,ct,Et]),nn=reactExports.useCallback(function(dn){dn.preventDefault(),dn.persist(),Nn(dn);var sn=isEvtWithFiles(dn);if(sn&&dn.dataTransfer)try{dn.dataTransfer.dropEffect="copy"}catch{}return sn&&ht&&ht(dn),!1},[ht,Et]),cn=reactExports.useCallback(function(dn){dn.preventDefault(),dn.persist(),Nn(dn);var sn=Dt.current.filter(function(Sn){return Ht.current&&Ht.current.contains(Sn)}),rn=sn.indexOf(dn.target);rn!==-1&&sn.splice(rn,1),Dt.current=sn,!(sn.length>0)&&(Tt({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),isEvtWithFiles(dn)&&ut&&ut(dn))},[Ht,ut,Et]),Xt=reactExports.useCallback(function(dn,sn){var rn=[],Sn=[];dn.forEach(function(tn){var qt=fileAccepted(tn,nt),Kt=_slicedToArray$c(qt,2),wn=Kt[0],Rn=Kt[1],jn=fileMatchSize(tn,at,ot),Bn=_slicedToArray$c(jn,2),Xn=Bn[0],Wn=Bn[1],Gn=$t?$t(tn):null;if(wn&&Xn&&!Gn)rn.push(tn);else{var Fn=[Rn,Wn];Gn&&(Fn=Fn.concat(Gn)),Sn.push({file:tn,errors:Fn.filter(function(Jn){return Jn})})}}),(!st&&rn.length>1||st&<>=1&&rn.length>lt)&&(rn.forEach(function(tn){Sn.push({file:tn,errors:[TOO_MANY_FILES_REJECTION]})}),rn.splice(0)),Tt({acceptedFiles:rn,fileRejections:Sn,type:"setFiles"}),dt&&dt(rn,Sn,sn),Sn.length>0&&mt&&mt(Sn,sn),rn.length>0&&pt&&pt(rn,sn)},[Tt,st,nt,at,ot,lt,dt,pt,mt,$t]),un=reactExports.useCallback(function(dn){dn.preventDefault(),dn.persist(),Nn(dn),Dt.current=[],isEvtWithFiles(dn)&&Promise.resolve(rt(dn)).then(function(sn){isPropagationStopped(dn)&&!Et||Xt(sn,dn)}),Tt({type:"reset"})},[rt,Xt,Et]),en=reactExports.useCallback(function(){if(Bt.current){Tt({type:"openDialog"}),It();var dn={multiple:st,types:filePickerOptionsTypes(nt)};window.showOpenFilePicker(dn).then(function(sn){return rt(sn)}).then(function(sn){Xt(sn,null),Tt({type:"closeDialog"})}).catch(function(sn){isAbort(sn)?(Ft(sn),Tt({type:"closeDialog"})):isSecurityError(sn)&&(Bt.current=!1,zt.current&&(zt.current.value=null,zt.current.click()))});return}zt.current&&(Tt({type:"openDialog"}),It(),zt.current.value=null,zt.current.click())},[Tt,It,Ft,yt,Xt,nt,st]),fn=reactExports.useCallback(function(dn){!Ht.current||!Ht.current.isEqualNode(dn.target)||(dn.key===" "||dn.key==="Enter"||dn.keyCode===32||dn.keyCode===13)&&(dn.preventDefault(),en())},[Ht,en]),xn=reactExports.useCallback(function(){Tt({type:"focus"})},[]),an=reactExports.useCallback(function(){Tt({type:"blur"})},[]),Zt=reactExports.useCallback(function(){vt||(isIeOrEdge()?setTimeout(en,0):en())},[vt,en]),En=function(sn){return it?null:sn},In=function(sn){return xt?null:En(sn)},Cn=function(sn){return St?null:En(sn)},Nn=function(sn){Et&&sn.stopPropagation()},Un=reactExports.useMemo(function(){return function(){var dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},sn=dn.refKey,rn=sn===void 0?"ref":sn,Sn=dn.role,tn=dn.onKeyDown,qt=dn.onFocus,Kt=dn.onBlur,wn=dn.onClick,Rn=dn.onDragEnter,jn=dn.onDragOver,Bn=dn.onDragLeave,Xn=dn.onDrop,Wn=_objectWithoutProperties$k(dn,_excluded3$2);return _objectSpread$A(_objectSpread$A(_defineProperty$F({onKeyDown:In(composeEventHandlers(tn,fn)),onFocus:In(composeEventHandlers(qt,xn)),onBlur:In(composeEventHandlers(Kt,an)),onClick:En(composeEventHandlers(wn,Zt)),onDragEnter:Cn(composeEventHandlers(Rn,Vt)),onDragOver:Cn(composeEventHandlers(jn,nn)),onDragLeave:Cn(composeEventHandlers(Bn,cn)),onDrop:Cn(composeEventHandlers(Xn,un)),role:typeof Sn=="string"&&Sn!==""?Sn:"button"},rn,Ht),!it&&!xt?{tabIndex:0}:{}),Wn)}},[Ht,fn,xn,an,Zt,Vt,nn,cn,un,xt,St,it]),_n=reactExports.useCallback(function(dn){dn.stopPropagation()},[]),An=reactExports.useMemo(function(){return function(){var dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},sn=dn.refKey,rn=sn===void 0?"ref":sn,Sn=dn.onChange,tn=dn.onClick,qt=_objectWithoutProperties$k(dn,_excluded4),Kt=_defineProperty$F({accept:nt,multiple:st,type:"file",style:{display:"none"},onChange:En(composeEventHandlers(Sn,un)),onClick:En(composeEventHandlers(tn,_n)),tabIndex:-1},rn,zt);return _objectSpread$A(_objectSpread$A({},Kt),qt)}},[zt,nt,st,un,it]),gn=Nt.length,Tn=gn>0&&allFilesAccepted({files:Nt,accept:nt,minSize:at,maxSize:ot,multiple:st,maxFiles:lt}),yn=gn>0&&!Tn;return _objectSpread$A(_objectSpread$A({},kt),{},{isDragAccept:Tn,isDragReject:yn,isFocused:Ct&&!it,getRootProps:Un,getInputProps:An,rootRef:Ht,inputRef:zt,open:En(en)})}function reducer(tt,et){switch(et.type){case"focus":return _objectSpread$A(_objectSpread$A({},tt),{},{isFocused:!0});case"blur":return _objectSpread$A(_objectSpread$A({},tt),{},{isFocused:!1});case"openDialog":return _objectSpread$A(_objectSpread$A({},initialState$1),{},{isFileDialogActive:!0});case"closeDialog":return _objectSpread$A(_objectSpread$A({},tt),{},{isFileDialogActive:!1});case"setDraggedFiles":var nt=et.isDragActive,it=et.draggedFiles;return _objectSpread$A(_objectSpread$A({},tt),{},{draggedFiles:it,isDragActive:nt});case"setFiles":return _objectSpread$A(_objectSpread$A({},tt),{},{acceptedFiles:et.acceptedFiles,fileRejections:et.fileRejections});case"reset":return _objectSpread$A({},initialState$1);default:return tt}}function noop$9(){}function createStore$4(tt){let et;const nt=new Set,it=(ct,ut)=>{const ht=typeof ct=="function"?ct(et):ct;if(ht!==et){const dt=et;et=ut?ht:Object.assign({},et,ht),nt.forEach(pt=>pt(et,dt))}},rt=()=>et,ot=(ct,ut=rt,ht=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let dt=ut(et);function pt(){const mt=ut(et);if(!ht(dt,mt)){const gt=dt;ct(dt=mt,gt)}}return nt.add(pt),()=>nt.delete(pt)},lt={setState:it,getState:rt,subscribe:(ct,ut,ht)=>ut||ht?ot(ct,ut,ht):(nt.add(ct),()=>nt.delete(ct)),destroy:()=>nt.clear()};return et=tt(it,rt,lt),lt}const isSSR$2=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),useIsomorphicLayoutEffect$3=isSSR$2?reactExports.useEffect:reactExports.useLayoutEffect;function create$8(tt){const et=typeof tt=="function"?createStore$4(tt):tt,nt=(it=et.getState,rt=Object.is)=>{const[,ot]=reactExports.useReducer(bt=>bt+1,0),at=et.getState(),st=reactExports.useRef(at),lt=reactExports.useRef(it),ct=reactExports.useRef(rt),ut=reactExports.useRef(!1),ht=reactExports.useRef();ht.current===void 0&&(ht.current=it(at));let dt,pt=!1;(st.current!==at||lt.current!==it||ct.current!==rt||ut.current)&&(dt=it(at),pt=!rt(ht.current,dt)),useIsomorphicLayoutEffect$3(()=>{pt&&(ht.current=dt),st.current=at,lt.current=it,ct.current=rt,ut.current=!1});const mt=reactExports.useRef(at);useIsomorphicLayoutEffect$3(()=>{const bt=()=>{try{const wt=et.getState(),vt=lt.current(wt);ct.current(ht.current,vt)||(st.current=wt,ht.current=vt,ot())}catch{ut.current=!0,ot()}},yt=et.subscribe(bt);return et.getState()!==mt.current&&bt(),yt},[]);const gt=pt?dt:ht.current;return reactExports.useDebugValue(gt),gt};return Object.assign(nt,et),nt[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const it=[nt,et];return{next(){const rt=it.length<=0;return{value:it.shift(),done:rt}}}},nt}const subscribeWithSelector=tt=>(et,nt,it)=>{const rt=it.subscribe;return it.subscribe=(at,st,lt)=>{let ct=at;if(st){const ut=(lt==null?void 0:lt.equalityFn)||Object.is;let ht=at(it.getState());ct=dt=>{const pt=at(dt);if(!ut(ht,pt)){const mt=ht;st(ht=pt,mt)}},lt!=null&<.fireImmediately&&st(ht,ht)}return rt(ct)},tt(et,nt,it)};/*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. @@ -95,7 +95,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Copyright (c) 2014-2015, 2017, Jon Schlinkert. * Released under the MIT License. - */var split=splitString,extend$5=extendShallow,isPlainObject$6=isPlainObject$8,isObject$m=isExtendable,setValue=function(tt,et,nt){if(!isObject$m(tt)||(Array.isArray(et)&&(et=[].concat.apply([],et).join(".")),typeof et!="string"))return tt;for(var it=split(et,{sep:".",brackets:!0}).filter(isValidKey),rt=it.length,ot=-1,at=tt;++ottt.filter(Boolean).join(".");function getKeyPath(tt){const et=tt.split(".");return[et.pop(),et.join(".")||void 0]}function getValuesForPaths(tt,et){return Object.entries(pick$1(tt,et)).reduce((nt,[,{value:it,disabled:rt,key:ot}])=>(nt[ot]=rt?void 0:it,nt),{})}function useCompareMemoize(tt,et){const nt=reactExports.useRef();return(et?dequal:shallow$2)(tt,nt.current)||(nt.current=tt),nt.current}function useDeepMemo(tt,et){return reactExports.useMemo(tt,useCompareMemoize(et,!0))}function useToggle(tt){const et=reactExports.useRef(null),nt=reactExports.useRef(null),it=reactExports.useRef(!0);return reactExports.useLayoutEffect(()=>{tt||(et.current.style.height="0px",et.current.style.overflow="hidden")},[]),reactExports.useEffect(()=>{if(it.current){it.current=!1;return}let rt;const ot=et.current,at=()=>{tt&&(ot.style.removeProperty("height"),ot.style.removeProperty("overflow"),nt.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};ot.addEventListener("transitionend",at,{once:!0});const{height:st}=nt.current.getBoundingClientRect();return ot.style.height=st+"px",tt||(ot.style.overflow="hidden",rt=window.setTimeout(()=>ot.style.height="0px",50)),()=>{ot.removeEventListener("transitionend",at),clearTimeout(rt)}},[tt]),{wrapperRef:et,contentRef:nt}}const useVisiblePaths=tt=>{const[et,nt]=reactExports.useState(tt.getVisiblePaths());return reactExports.useEffect(()=>{nt(tt.getVisiblePaths());const it=tt.useStore.subscribe(tt.getVisiblePaths,nt,{equalityFn:shallow$2});return()=>it()},[tt]),et};function useValuesForPath(tt,et,nt){return tt.useStore(rt=>{const ot=_objectSpread2$1(_objectSpread2$1({},nt),rt.data);return getValuesForPaths(ot,et)},shallow$2)}function usePopin(tt=3){const et=reactExports.useRef(null),nt=reactExports.useRef(null),[it,rt]=reactExports.useState(!1),ot=reactExports.useCallback(()=>rt(!0),[]),at=reactExports.useCallback(()=>rt(!1),[]);return reactExports.useLayoutEffect(()=>{if(it){const{bottom:st,top:lt,left:ct}=et.current.getBoundingClientRect(),{height:ut}=nt.current.getBoundingClientRect(),ht=st+ut>window.innerHeight-40?"up":"down";nt.current.style.position="fixed",nt.current.style.zIndex="10000",nt.current.style.left=ct+"px",ht==="down"?nt.current.style.top=st+tt+"px":nt.current.style.bottom=window.innerHeight-lt+tt+"px"}},[tt,it]),{popinRef:et,wrapperRef:nt,shown:it,show:ot,hide:at}}k$9([namesPlugin]);const convertMap={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};v8n.extend({color:()=>tt=>w$6(tt).isValid()});const schema$2=tt=>v8n().color().test(tt);function convert$6(tt,{format:et,hasAlpha:nt,isString:it}){const rt=convertMap[et]+(it&&et!=="hex"?"String":""),ot=tt[rt]();return typeof ot=="object"&&!nt?omit$1(ot,["a"]):ot}const sanitize$2=(tt,et)=>{const nt=w$6(tt);if(!nt.isValid())throw Error("Invalid color");return convert$6(nt,et)},format$1$1=(tt,et)=>convert$6(w$6(tt),_objectSpread2$1(_objectSpread2$1({},et),{},{isString:!0,format:"hex"})),normalize$3$1=({value:tt})=>{const et=I$2(tt),nt=et==="name"?"hex":et,it=typeof tt=="object"?"a"in tt:et==="hex"&&tt.length===8||/^(rgba)|(hsla)|(hsva)/.test(tt),rt={format:nt,hasAlpha:it,isString:typeof tt=="string"};return{value:sanitize$2(tt,rt),settings:rt}};var props$2=Object.freeze({__proto__:null,schema:schema$2,sanitize:sanitize$2,format:format$1$1,normalize:normalize$3$1});const ColorPreview=styled$5("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),PickerContainer=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),PickerWrapper=styled$5("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function convertToRgb(tt,et){return et!=="rgb"?w$6(tt).toRgb():tt}function Color$2({value:tt,displayValue:et,settings:nt,onUpdate:it}){const{emitOnEditStart:rt,emitOnEditEnd:ot}=useInputContext(),{format:at,hasAlpha:st}=nt,{popinRef:lt,wrapperRef:ct,shown:ut,show:ht,hide:dt}=usePopin(),pt=reactExports.useRef(0),[mt,gt]=reactExports.useState(()=>convertToRgb(tt,at)),bt=st?Ce:Ne$1,yt=()=>{gt(convertToRgb(tt,at)),ht(),rt()},wt=()=>{dt(),ot(),window.clearTimeout(pt.current)},vt=()=>{pt.current=window.setTimeout(wt,500)};return reactExports.useEffect(()=>()=>window.clearTimeout(pt.current),[]),React$1.createElement(React$1.Fragment,null,React$1.createElement(ColorPreview,{ref:lt,active:ut,onClick:()=>yt(),style:{color:et}}),ut&&React$1.createElement(Portal$1,null,React$1.createElement(Overlay$1,{onPointerUp:wt}),React$1.createElement(PickerWrapper,{ref:ct,onMouseEnter:()=>window.clearTimeout(pt.current),onMouseLeave:xt=>xt.buttons===0&&vt()},React$1.createElement(bt,{color:mt,onChange:it}))))}function ColorComponent(){const{value:tt,displayValue:et,label:nt,onChange:it,onUpdate:rt,settings:ot}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,nt),React$1.createElement(PickerContainer,null,React$1.createElement(Color$2,{value:tt,displayValue:et,onChange:it,onUpdate:rt,settings:ot}),React$1.createElement(ValueInput,{value:et,onChange:it,onUpdate:rt})))}var color$4=_objectSpread2$1({component:ColorComponent},props$2);function Vector3dComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:it}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Vector,{value:et,settings:it,onUpdate:nt}))}var vector3d=_objectSpread2$1({component:Vector3dComponent},getVectorPlugin(["x","y","z"]));const JoystickTrigger=styled$5("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),JoystickPlayground=styled$5("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function Joystick({value:tt,settings:et,onUpdate:nt}){const it=reactExports.useRef(),rt=reactExports.useRef(0),ot=reactExports.useRef(0),at=reactExports.useRef(1),[st,lt]=reactExports.useState(!1),[ct,ut]=reactExports.useState(!1),[ht,dt]=useTransform(),pt=reactExports.useRef(null),mt=reactExports.useRef(null);reactExports.useLayoutEffect(()=>{if(st){const{top:Bt,left:Pt,width:kt,height:At}=pt.current.getBoundingClientRect();mt.current.style.left=Pt+kt/2+"px",mt.current.style.top=Bt+At/2+"px"}},[st]);const{keys:[gt,bt],joystick:yt}=et,wt=yt==="invertY"?1:-1,{[gt]:{step:vt},[bt]:{step:xt}}=et,St=useTh("sizes","joystickWidth"),Et=useTh("sizes","joystickHeight"),It=parseFloat(St)*.8/2,Tt=parseFloat(Et)*.8/2,$t=reactExports.useCallback(()=>{it.current||(ut(!0),rt.current&&dt({x:rt.current*It}),ot.current&&dt({y:ot.current*-Tt}),it.current=window.setInterval(()=>{nt(Bt=>{const Pt=vt*rt.current*at.current,kt=wt*xt*ot.current*at.current;return Array.isArray(Bt)?{[gt]:Bt[0]+Pt,[bt]:Bt[1]+kt}:{[gt]:Bt[gt]+Pt,[bt]:Bt[bt]+kt}})},16))},[It,Tt,nt,dt,vt,xt,gt,bt,wt]),Ut=reactExports.useCallback(()=>{window.clearTimeout(it.current),it.current=void 0,ut(!1)},[]);reactExports.useEffect(()=>{function Bt(Pt){at.current=multiplyStep(Pt)}return window.addEventListener("keydown",Bt),window.addEventListener("keyup",Bt),()=>{window.clearTimeout(it.current),window.removeEventListener("keydown",Bt),window.removeEventListener("keyup",Bt)}},[]);const Lt=useDrag$1(({first:Bt,active:Pt,delta:[kt,At],movement:[Rt,Wt]})=>{Bt&<(!0);const jt=clamp$7(Rt,-It,It),Ot=clamp$7(Wt,-Tt,Tt);rt.current=Math.abs(Rt)>Math.abs(jt)?Math.sign(Rt-jt):0,ot.current=Math.abs(Wt)>Math.abs(Ot)?Math.sign(Ot-Wt):0;let Ct=tt[gt],Dt=tt[bt];Pt?(rt.current||(Ct+=kt*vt*at.current,dt({x:jt})),ot.current||(Dt-=wt*At*xt*at.current,dt({y:Ot})),rt.current||ot.current?$t():Ut(),nt({[gt]:Ct,[bt]:Dt})):(lt(!1),rt.current=0,ot.current=0,dt({x:0,y:0}),Ut())});return React$1.createElement(JoystickTrigger,_extends$t({ref:pt},Lt()),st&&React$1.createElement(Portal$1,null,React$1.createElement(JoystickPlayground,{ref:mt,isOutOfBounds:ct},React$1.createElement("div",null),React$1.createElement("span",{ref:ht}))))}const Container$1=styled$5("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function Vector2dComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:it}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Container$1,{withJoystick:!!it.joystick},it.joystick&&React$1.createElement(Joystick,{value:et,settings:it,onUpdate:nt}),React$1.createElement(Vector,{value:et,settings:it,onUpdate:nt})))}const _excluded$7$1=["joystick"],plugin=getVectorPlugin(["x","y"]),normalize$2$1=tt=>{let{joystick:et=!0}=tt,nt=_objectWithoutProperties$l(tt,_excluded$7$1);const{value:it,settings:rt}=plugin.normalize(nt);return{value:it,settings:_objectSpread2$1(_objectSpread2$1({},rt),{},{joystick:et})}};var vector2d=_objectSpread2$1(_objectSpread2$1({component:Vector2dComponent},plugin),{},{normalize:normalize$2$1});const sanitize$1=tt=>{if(tt!==void 0){if(tt instanceof File)try{return URL.createObjectURL(tt)}catch{return}if(typeof tt=="string"&&tt.indexOf("blob:")===0)return tt;throw Error("Invalid image format [undefined | blob | File].")}},schema$1=(tt,et)=>typeof et=="object"&&"image"in et,normalize$1$1=({image:tt})=>({value:tt});var props$1=Object.freeze({__proto__:null,sanitize:sanitize$1,schema:schema$1,normalize:normalize$1$1});const ImageContainer=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),DropZone=styled$5("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),ImagePreview=styled$5("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),ImageLargePreview=styled$5("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),Instructions=styled$5("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),Remove=styled$5("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function ImageComponent(){const{label:tt,value:et,onUpdate:nt,disabled:it}=useInputContext(),{popinRef:rt,wrapperRef:ot,shown:at,show:st,hide:lt}=usePopin(),ct=reactExports.useCallback(mt=>{mt.length&&nt(mt[0])},[nt]),ut=reactExports.useCallback(mt=>{mt.stopPropagation(),nt(void 0)},[nt]),{getRootProps:ht,getInputProps:dt,isDragAccept:pt}=useDropzone({maxFiles:1,accept:"image/*",onDrop:ct,disabled:it});return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(ImageContainer,null,React$1.createElement(ImagePreview,{ref:rt,hasImage:!!et,onPointerDown:()=>!!et&&st(),onPointerUp:lt,style:{backgroundImage:et?`url(${et})`:"none"}}),at&&!!et&&React$1.createElement(Portal$1,null,React$1.createElement(Overlay$1,{onPointerUp:lt,style:{cursor:"pointer"}}),React$1.createElement(ImageLargePreview,{ref:ot,style:{backgroundImage:`url(${et})`}})),React$1.createElement(DropZone,ht({isDragAccept:pt}),React$1.createElement("input",dt()),React$1.createElement(Instructions,null,pt?"drop image":"click or drop")),React$1.createElement(Remove,{onClick:ut,disabled:!et})))}var image$1=_objectSpread2$1({component:ImageComponent},props$1);const number$6=v8n().number(),schema=(tt,et)=>v8n().array().length(2).every.number().test(tt)&&v8n().schema({min:number$6,max:number$6}).test(et),format$2=tt=>({min:tt[0],max:tt[1]}),sanitize=(tt,{bounds:[et,nt]},it)=>{const rt=Array.isArray(tt)?format$2(tt):tt,ot={min:it[0],max:it[1]},{min:at,max:st}=_objectSpread2$1(_objectSpread2$1({},ot),rt);return[clamp$7(Number(at),et,Math.max(et,st)),clamp$7(Number(st),Math.min(nt,at),nt)]},normalize$5=({value:tt,min:et,max:nt})=>{const it={min:et,max:nt},rt=normalizeKeyedNumberSettings(format$2(tt),{min:it,max:it}),ot=[et,nt],at=_objectSpread2$1(_objectSpread2$1({},rt),{},{bounds:ot});return{value:sanitize(format$2(tt),at,tt),settings:at}};var props$3=Object.freeze({__proto__:null,schema,format:format$2,sanitize,normalize:normalize$5});const _excluded$6$1=["value","bounds","onDrag"],_excluded2$1$1=["bounds"],Container$2=styled$5("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function IntervalSlider(tt){let{value:et,bounds:[nt,it],onDrag:rt}=tt,ot=_objectWithoutProperties$l(tt,_excluded$6$1);const at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useRef(null),ct=reactExports.useRef(0),ut=useTh("sizes","scrubberWidth"),ht=useDrag$1(({event:mt,first:gt,xy:[bt],movement:[yt],memo:wt={}})=>{if(gt){const{width:xt,left:St}=at.current.getBoundingClientRect();ct.current=xt-parseFloat(ut);const Et=(mt==null?void 0:mt.target)===st.current||(mt==null?void 0:mt.target)===lt.current;wt.pos=invertedRange((bt-St)/xt,nt,it);const It=Math.abs(wt.pos-et.min)-Math.abs(wt.pos-et.max);wt.key=It<0||It===0&&wt.pos<=et.min?"min":"max",Et&&(wt.pos=et[wt.key])}const vt=wt.pos+invertedRange(yt/ct.current,0,it-nt);return rt({[wt.key]:sanitizeStep(vt,ot[wt.key])}),wt}),dt=`calc(${range$9(et.min,nt,it)} * (100% - ${ut} - 8px) + 4px)`,pt=`calc(${1-range$9(et.max,nt,it)} * (100% - ${ut} - 8px) + 4px)`;return React$1.createElement(RangeWrapper,_extends$t({ref:at},ht()),React$1.createElement(Range,null,React$1.createElement(Indicator,{style:{left:dt,right:pt}})),React$1.createElement(Scrubber,{position:"left",ref:st,style:{left:dt}}),React$1.createElement(Scrubber,{position:"right",ref:lt,style:{right:pt}}))}function IntervalComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:it}=useInputContext(),rt=_objectWithoutProperties$l(it,_excluded2$1$1);return React$1.createElement(React$1.Fragment,null,React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Container$2,null,React$1.createElement(IntervalSlider,_extends$t({value:et},it,{onDrag:nt})),React$1.createElement(Vector,{value:et,settings:rt,onUpdate:nt,innerLabelTrim:0}))))}var interval$1=_objectSpread2$1({component:IntervalComponent},props$3);const createEventEmitter=()=>{const tt=new Map;return{on:(et,nt)=>{let it=tt.get(et);it===void 0&&(it=new Set,tt.set(et,it)),it.add(nt)},off:(et,nt)=>{const it=tt.get(et);it!==void 0&&(it.delete(nt),it.size===0&&tt.delete(et))},emit:(et,...nt)=>{const it=tt.get(et);if(it!==void 0)for(const rt of it)rt(...nt)}}},_excluded$5$1=["type","value"],_excluded2$a=["onChange","transient","onEditStart","onEditEnd"],Store=function(){const et=create$8(subscribeWithSelector(()=>({data:{}}))),nt=createEventEmitter();this.storeId=getUid(),this.useStore=et;const it={},rt=new Set;this.getVisiblePaths=()=>{const at=this.getData(),st=Object.keys(at),lt=[];Object.entries(it).forEach(([ut,ht])=>{ht.render&&st.some(dt=>dt.indexOf(ut)===0)&&!ht.render(this.get)&<.push(ut+".")});const ct=[];return rt.forEach(ut=>{ut in at&&at[ut].__refCount>0&<.every(ht=>ut.indexOf(ht)===-1)&&(!at[ut].render||at[ut].render(this.get))&&ct.push(ut)}),ct},this.setOrderedPaths=at=>{at.forEach(st=>rt.add(st))},this.orderPaths=at=>(this.setOrderedPaths(at),at),this.disposePaths=at=>{et.setState(st=>{const lt=st.data;return at.forEach(ct=>{if(ct in lt){const ut=lt[ct];ut.__refCount--,ut.__refCount===0&&ut.type in SpecialInputs&&delete lt[ct]}}),{data:lt}})},this.dispose=()=>{et.setState(()=>({data:{}}))},this.getFolderSettings=at=>it[at]||{},this.getData=()=>et.getState().data,this.addData=(at,st)=>{et.setState(lt=>{const ct=lt.data;return Object.entries(at).forEach(([ut,ht])=>{let dt=ct[ut];if(dt){const{type:pt,value:mt}=ht,gt=_objectWithoutProperties$l(ht,_excluded$5$1);pt!==dt.type?warn$3(LevaErrors.INPUT_TYPE_OVERRIDE,pt):((dt.__refCount===0||st)&&Object.assign(dt,gt),dt.__refCount++)}else ct[ut]=_objectSpread2$1(_objectSpread2$1({},ht),{},{__refCount:1})}),{data:ct}})},this.setValueAtPath=(at,st,lt)=>{et.setState(ct=>{const ut=ct.data;return updateInput(ut[at],st,at,this,lt),{data:ut}})},this.setSettingsAtPath=(at,st)=>{et.setState(lt=>{const ct=lt.data;return ct[at].settings=_objectSpread2$1(_objectSpread2$1({},ct[at].settings),st),{data:ct}})},this.disableInputAtPath=(at,st)=>{et.setState(lt=>{const ct=lt.data;return ct[at].disabled=st,{data:ct}})},this.set=(at,st)=>{et.setState(lt=>{const ct=lt.data;return Object.entries(at).forEach(([ut,ht])=>{try{updateInput(ct[ut],ht,void 0,void 0,st)}catch{}}),{data:ct}})},this.getInput=at=>{try{return this.getData()[at]}catch{warn$3(LevaErrors.PATH_DOESNT_EXIST,at)}},this.get=at=>{var st;return(st=this.getInput(at))===null||st===void 0?void 0:st.value},this.emitOnEditStart=at=>{nt.emit(`onEditStart:${at}`,this.get(at),at,_objectSpread2$1(_objectSpread2$1({},this.getInput(at)),{},{get:this.get}))},this.emitOnEditEnd=at=>{nt.emit(`onEditEnd:${at}`,this.get(at),at,_objectSpread2$1(_objectSpread2$1({},this.getInput(at)),{},{get:this.get}))},this.subscribeToEditStart=(at,st)=>{const lt=`onEditStart:${at}`;return nt.on(lt,st),()=>nt.off(lt,st)},this.subscribeToEditEnd=(at,st)=>{const lt=`onEditEnd:${at}`;return nt.on(lt,st),()=>nt.off(lt,st)};const ot=(at,st,lt)=>{const ct={};return Object.entries(at).forEach(([ut,ht])=>{if(ut==="")return warn$3(LevaErrors.EMPTY_KEY);let dt=join$1(st,ut);if(ht.type===SpecialInputs.FOLDER){const pt=ot(ht.schema,dt,lt);Object.assign(ct,pt),dt in it||(it[dt]=ht.settings)}else if(ut in lt)warn$3(LevaErrors.DUPLICATE_KEYS,ut,dt,lt[ut].path);else{const pt=normalizeInput(ht,ut,dt,ct);if(pt){const{type:mt,options:gt,input:bt}=pt,{onChange:yt,transient:wt,onEditStart:vt,onEditEnd:xt}=gt,St=_objectWithoutProperties$l(gt,_excluded2$a);ct[dt]=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({type:mt},St),bt),{},{fromPanel:!0}),lt[ut]={path:dt,onChange:yt,transient:wt,onEditStart:vt,onEditEnd:xt}}else warn$3(LevaErrors.UNKNOWN_INPUT,dt,ht)}}),ct};this.getDataFromSchema=at=>{const st={};return[ot(at,"",st),st]}},levaStore=new Store,defaultSettings$2={collapsed:!1};function folder(tt,et){return{type:SpecialInputs.FOLDER,schema:tt,settings:_objectSpread2$1(_objectSpread2$1({},defaultSettings$2),et)}}const isInput=tt=>"__levaInput"in tt,buildTree=(tt,et)=>{const nt={},it=et?et.toLowerCase():null;return tt.forEach(rt=>{const[ot,at]=getKeyPath(rt);(!it||ot.toLowerCase().indexOf(it)>-1)&&merge$3(nt,at,{[ot]:{__levaInput:!0,path:rt}})}),nt},_excluded$4$1=["type","label","path","valueKey","value","settings","setValue","disabled"];function ControlInput(tt){let{type:et,label:nt,path:it,valueKey:rt,value:ot,settings:at,setValue:st,disabled:lt}=tt,ct=_objectWithoutProperties$l(tt,_excluded$4$1);const{displayValue:ut,onChange:ht,onUpdate:dt}=useInputSetters({type:et,value:ot,settings:at,setValue:st}),pt=Plugins[et].component;return pt?React$1.createElement(InputContext.Provider,{value:_objectSpread2$1({key:rt,path:it,id:""+it,label:nt,displayValue:ut,value:ot,onChange:ht,onUpdate:dt,settings:at,setValue:st,disabled:lt},ct)},React$1.createElement(StyledInputWrapper$1,{disabled:lt},React$1.createElement(pt,null))):(warn$3(LevaErrors.NO_COMPONENT_FOR_TYPE,et,it),null)}const StyledButton$8=styled$5("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function Button$3({onClick:tt,settings:et,label:nt}){const it=useStoreContext();return React$1.createElement(Row,null,React$1.createElement(StyledButton$8,{disabled:et.disabled,onClick:()=>tt(it.get)},nt))}const StyledButtonGroup=styled$5("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),StyledButtonGroupButton=styled$5("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),getOpts=({label:tt,opts:et})=>{let nt=typeof tt=="string"&&tt.trim()===""?null:tt,it=et;return typeof et.opts=="object"&&(it.label!==void 0&&(nt=et.label),it=et.opts),{label:nt,opts:it}};function ButtonGroup(tt){const{label:et,opts:nt}=getOpts(tt),it=useStoreContext();return React$1.createElement(Row,{input:!!et},et&&React$1.createElement(Label$2,null,et),React$1.createElement(StyledButtonGroup,null,Object.entries(nt).map(([rt,ot])=>React$1.createElement(StyledButtonGroupButton,{key:rt,onClick:()=>ot(it.get)},rt))))}const Canvas$1=styled$5("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),POINTS=100;function push$1(tt,et){tt.push(et),tt.length>POINTS&&tt.shift()}const MonitorCanvas=reactExports.forwardRef(function({initialValue:tt},et){const nt=useTh("colors","highlight3"),it=useTh("colors","elevation2"),rt=useTh("colors","highlight1"),[ot,at]=reactExports.useMemo(()=>[w$6(rt).alpha(.4).toRgbString(),w$6(rt).alpha(.1).toRgbString()],[rt]),st=reactExports.useRef([tt]),lt=reactExports.useRef(tt),ct=reactExports.useRef(tt),ut=reactExports.useRef(),ht=reactExports.useCallback((mt,gt)=>{if(!mt)return;const{width:bt,height:yt}=mt,wt=new Path2D,vt=bt/POINTS,xt=yt*.05;for(let It=0;It({frame:mt=>{(lt.current===void 0||mtct.current)&&(ct.current=mt),push$1(st.current,mt),ut.current=requestAnimationFrame(()=>ht(dt.current,pt.current))}}),[dt,pt,ht]),reactExports.useEffect(()=>()=>cancelAnimationFrame(ut.current),[]),React$1.createElement(Canvas$1,{ref:dt})}),parse$4=tt=>Number.isFinite(tt)?tt.toPrecision(2):tt.toString(),MonitorLog=reactExports.forwardRef(function({initialValue:tt},et){const[nt,it]=reactExports.useState(parse$4(tt));return reactExports.useImperativeHandle(et,()=>({frame:rt=>it(parse$4(rt))}),[]),React$1.createElement("div",null,nt)});function getValue$4(tt){return typeof tt=="function"?tt():tt.current}function Monitor({label:tt,objectOrFn:et,settings:nt}){const it=reactExports.useRef(),rt=reactExports.useRef(getValue$4(et));return reactExports.useEffect(()=>{const ot=window.setInterval(()=>{var at;document.hidden||(at=it.current)===null||at===void 0||at.frame(getValue$4(et))},nt.interval);return()=>window.clearInterval(ot)},[et,nt.interval]),React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,{align:"top"},tt),nt.graph?React$1.createElement(MonitorCanvas,{ref:it,initialValue:rt.current}):React$1.createElement(MonitorLog,{ref:it,initialValue:rt.current}))}const _excluded$3$1=["type","label","key"],specialComponents={[SpecialInputs.BUTTON]:Button$3,[SpecialInputs.BUTTON_GROUP]:ButtonGroup,[SpecialInputs.MONITOR]:Monitor},Control=React$1.memo(({path:tt})=>{const[et,{set:nt,setSettings:it,disable:rt,storeId:ot,emitOnEditStart:at,emitOnEditEnd:st}]=useInput(tt);if(!et)return null;const{type:lt,label:ct,key:ut}=et,ht=_objectWithoutProperties$l(et,_excluded$3$1);if(lt in SpecialInputs){const dt=specialComponents[lt];return React$1.createElement(dt,_extends$t({label:ct,path:tt},ht))}return lt in Plugins?React$1.createElement(ControlInput,_extends$t({key:ot+tt,type:lt,label:ct,storeId:ot,path:tt,valueKey:ut,setValue:nt,setSettings:it,disable:rt,emitOnEditStart:at,emitOnEditEnd:st},ht)):(log$2(LevaErrors.UNSUPPORTED_INPUT,lt,tt),null)});function FolderTitle({toggle:tt,toggled:et,name:nt}){return React$1.createElement(StyledTitle,{onClick:()=>tt()},React$1.createElement(Chevron,{toggled:et}),React$1.createElement("div",null,nt))}const Folder=({name:tt,path:et,tree:nt})=>{const it=useStoreContext(),rt=join$1(et,tt),{collapsed:ot,color:at}=it.getFolderSettings(rt),[st,lt]=reactExports.useState(!ot),ct=reactExports.useRef(null),ut=useTh("colors","folderWidgetColor"),ht=useTh("colors","folderTextColor");return reactExports.useLayoutEffect(()=>{ct.current.style.setProperty("--leva-colors-folderWidgetColor",at||ut),ct.current.style.setProperty("--leva-colors-folderTextColor",at||ht)},[at,ut,ht]),React$1.createElement(StyledFolder,{ref:ct},React$1.createElement(FolderTitle,{name:tt,toggled:st,toggle:()=>lt(dt=>!dt)}),React$1.createElement(TreeWrapper,{parent:rt,tree:nt,toggled:st}))},TreeWrapper=React$1.memo(({isRoot:tt=!1,fill:et=!1,flat:nt=!1,parent:it,tree:rt,toggled:ot})=>{const{wrapperRef:at,contentRef:st}=useToggle(ot),lt=useStoreContext(),ct=([ht,dt])=>{var pt;return(isInput(dt)?(pt=lt.getInput(dt.path))===null||pt===void 0?void 0:pt.order:lt.getFolderSettings(join$1(it,ht)).order)||0},ut=Object.entries(rt).sort((ht,dt)=>ct(ht)-ct(dt));return React$1.createElement(StyledWrapper,{ref:at,isRoot:tt,fill:et,flat:nt},React$1.createElement(StyledContent,{ref:st,isRoot:tt,toggled:ot},ut.map(([ht,dt])=>isInput(dt)?React$1.createElement(Control,{key:dt.path,valueKey:dt.valueKey,path:dt.path}):React$1.createElement(Folder,{key:ht,name:ht,path:it,tree:dt}))))}),StyledRoot=styled$5("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${StyledInputRow}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),iconWidth=40,Icon=styled$5("i",{$flexCenter:"",width:iconWidth,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),StyledTitleWithFilter=styled$5("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),FilterWrapper=styled$5("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${Icon}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),StyledFilterInput=styled$5("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),TitleContainer=styled$5("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:iconWidth}}}}),FilterInput=React$1.forwardRef(({setFilter:tt,toggle:et},nt)=>{const[it,rt]=reactExports.useState(""),ot=reactExports.useMemo(()=>debounce$5(tt,250),[tt]),at=()=>{tt(""),rt("")},st=lt=>{const ct=lt.currentTarget.value;et(!0),rt(ct)};return reactExports.useEffect(()=>{ot(it)},[it,ot]),React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledFilterInput,{ref:nt,value:it,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:lt=>lt.stopPropagation(),onChange:st}),React$1.createElement(Icon,{onClick:()=>at(),style:{visibility:it?"visible":"hidden"}},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function TitleWithFilter({setFilter:tt,onDrag:et,onDragStart:nt,onDragEnd:it,toggle:rt,toggled:ot,title:at,drag:st,filterEnabled:lt,from:ct}){const[ut,ht]=reactExports.useState(!1),dt=reactExports.useRef(null);reactExports.useEffect(()=>{var mt,gt;ut?(mt=dt.current)===null||mt===void 0||mt.focus():(gt=dt.current)===null||gt===void 0||gt.blur()},[ut]);const pt=useDrag$1(({offset:[mt,gt],first:bt,last:yt})=>{et({x:mt,y:gt}),bt&&nt({x:mt,y:gt}),yt&&it({x:mt,y:gt})},{filterTaps:!0,from:({offset:[mt,gt]})=>[(ct==null?void 0:ct.x)||mt,(ct==null?void 0:ct.y)||gt]});return reactExports.useEffect(()=>{const mt=gt=>{gt.key==="L"&>.shiftKey&>.metaKey&&ht(bt=>!bt)};return window.addEventListener("keydown",mt),()=>window.removeEventListener("keydown",mt)},[]),React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledTitleWithFilter,{mode:st?"drag":void 0},React$1.createElement(Icon,{active:!ot,onClick:()=>rt()},React$1.createElement(Chevron,{toggled:ot,width:12,height:8})),React$1.createElement(TitleContainer,_extends$t({},st?pt():{},{drag:st,filterEnabled:lt}),at===void 0&&st?React$1.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},React$1.createElement("circle",{cx:"2",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"14",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"26",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"2",cy:"12",r:"2"}),React$1.createElement("circle",{cx:"14",cy:"12",r:"2"}),React$1.createElement("circle",{cx:"26",cy:"12",r:"2"})):at),lt&&React$1.createElement(Icon,{active:ut,onClick:()=>ht(mt=>!mt)},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},React$1.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),React$1.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),React$1.createElement(FilterWrapper,{toggled:ut},React$1.createElement(FilterInput,{ref:dt,setFilter:tt,toggle:rt})))}const _excluded$2$1=["store","hidden","theme","collapsed"];function LevaRoot(tt){let{store:et,hidden:nt=!1,theme:it,collapsed:rt=!1}=tt,ot=_objectWithoutProperties$l(tt,_excluded$2$1);const at=useDeepMemo(()=>mergeTheme(it),[it]),[st,lt]=reactExports.useState(!rt),ct=typeof rt=="object"?!rt.collapsed:st,ut=reactExports.useMemo(()=>typeof rt=="object"?ht=>{typeof ht=="function"?rt.onChange(!ht(!rt.collapsed)):rt.onChange(!ht)}:lt,[rt]);return!et||nt?null:React$1.createElement(ThemeContext$3.Provider,{value:at},React$1.createElement(LevaCore,_extends$t({store:et},ot,{toggled:ct,setToggle:ut,rootClass:at.className})))}const LevaCore=React$1.memo(({store:tt,rootClass:et,fill:nt=!1,flat:it=!1,neverHide:rt=!1,oneLineLabels:ot=!1,titleBar:at={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:st=!1,toggled:lt,setToggle:ct})=>{var ut,ht;const dt=useVisiblePaths(tt),[pt,mt]=reactExports.useState(""),gt=reactExports.useMemo(()=>buildTree(dt,pt),[dt,pt]),[bt,yt]=useTransform(),wt=rt||dt.length>0,vt=typeof at=="object"&&at.title||void 0,xt=typeof at=="object"&&(ut=at.drag)!==null&&ut!==void 0?ut:!0,St=typeof at=="object"&&(ht=at.filter)!==null&&ht!==void 0?ht:!0,Et=typeof at=="object"&&at.position||void 0,It=typeof at=="object"&&at.onDrag||void 0,Tt=typeof at=="object"&&at.onDragStart||void 0,$t=typeof at=="object"&&at.onDragEnd||void 0;return React$1.useEffect(()=>{yt({x:Et==null?void 0:Et.x,y:Et==null?void 0:Et.y})},[Et,yt]),globalStyles(),React$1.createElement(PanelSettingsContext.Provider,{value:{hideCopyButton:st}},React$1.createElement(StyledRoot,{ref:bt,className:et,fill:nt,flat:it,oneLineLabels:ot,hideTitleBar:!at,style:{display:wt?"block":"none"}},at&&React$1.createElement(TitleWithFilter,{onDrag:Ut=>{yt(Ut),It==null||It(Ut)},onDragStart:Ut=>Tt==null?void 0:Tt(Ut),onDragEnd:Ut=>$t==null?void 0:$t(Ut),setFilter:mt,toggle:Ut=>ct(Lt=>Ut??!Lt),toggled:lt,title:vt,drag:xt,filterEnabled:St,from:Et}),wt&&React$1.createElement(StoreContext$1.Provider,{value:tt},React$1.createElement(TreeWrapper,{isRoot:!0,fill:nt,flat:it,tree:gt,toggled:lt}))))}),_excluded$1$3=["isRoot"];let rootInitialized=!1,rootEl=null;function Leva(tt){let{isRoot:et=!1}=tt,nt=_objectWithoutProperties$l(tt,_excluded$1$3);return reactExports.useEffect(()=>(rootInitialized=!0,!et&&rootEl&&(rootEl.remove(),rootEl=null),()=>{et||(rootInitialized=!1)}),[et]),React$1.createElement(LevaRoot,_extends$t({store:levaStore},nt))}function useRenderRoot(tt){reactExports.useEffect(()=>{tt&&!rootInitialized&&(rootEl||(rootEl=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(rootEl),render(React$1.createElement(Leva,{isRoot:!0}),rootEl))),rootInitialized=!0)},[tt])}function parseArgs(tt,et,nt,it,rt){let ot,at,st,lt,ct;return typeof tt=="string"?(at=tt,ot=et,Array.isArray(nt)?ct=nt:nt&&("store"in nt?(lt=nt,ct=it):(st=nt,Array.isArray(it)?ct=it:(lt=it,ct=rt)))):(ot=tt,Array.isArray(et)?ct=et:(lt=et,ct=nt)),{schema:ot,folderName:at,folderSettings:st,hookSettings:lt,deps:ct||[]}}function useControls(tt,et,nt,it,rt){const{folderName:ot,schema:at,folderSettings:st,hookSettings:lt,deps:ct}=parseArgs(tt,et,nt,it,rt),ut=typeof at=="function",ht=reactExports.useRef(!1),dt=reactExports.useRef(!0),pt=useDeepMemo(()=>{ht.current=!0;const Lt=typeof at=="function"?at():at;return ot?{[ot]:folder(Lt,st)}:Lt},ct),mt=!(lt!=null&<.store);useRenderRoot(mt);const[gt]=reactExports.useState(()=>(lt==null?void 0:lt.store)||levaStore),[bt,yt]=reactExports.useMemo(()=>gt.getDataFromSchema(pt),[gt,pt]),[wt,vt,xt,St,Et]=reactExports.useMemo(()=>{const Lt=[],Bt=[],Pt={},kt={},At={};return Object.values(yt).forEach(({path:Rt,onChange:Wt,onEditStart:jt,onEditEnd:Ot,transient:Ct})=>{Lt.push(Rt),Wt?(Pt[Rt]=Wt,Ct||Bt.push(Rt)):Bt.push(Rt),jt&&(kt[Rt]=jt),Ot&&(At[Rt]=Ot)}),[Lt,Bt,Pt,kt,At]},[yt]),It=reactExports.useMemo(()=>gt.orderPaths(wt),[wt,gt]),Tt=useValuesForPath(gt,vt,bt),$t=reactExports.useCallback(Lt=>{const Bt=Object.entries(Lt).reduce((Pt,[kt,At])=>Object.assign(Pt,{[yt[kt].path]:At}),{});gt.set(Bt,!1)},[gt,yt]),Ut=reactExports.useCallback(Lt=>gt.get(yt[Lt].path),[gt,yt]);return reactExports.useEffect(()=>{const Lt=!dt.current&&ht.current;return gt.addData(bt,Lt),dt.current=!1,ht.current=!1,()=>gt.disposePaths(It)},[gt,It,bt]),reactExports.useEffect(()=>{const Lt=[];return Object.entries(xt).forEach(([Bt,Pt])=>{Pt(gt.get(Bt),Bt,_objectSpread2$1({initial:!0,get:gt.get},gt.getInput(Bt)));const kt=gt.useStore.subscribe(At=>{const Rt=At.data[Bt];return[Rt.disabled?void 0:Rt.value,Rt]},([At,Rt])=>Pt(At,Bt,_objectSpread2$1({initial:!1,get:gt.get},Rt)),{equalityFn:shallow$2});Lt.push(kt)}),()=>Lt.forEach(Bt=>Bt())},[gt,xt]),reactExports.useEffect(()=>{const Lt=[];return Object.entries(St).forEach(([Bt,Pt])=>Lt.push(gt.subscribeToEditStart(Bt,Pt))),Object.entries(Et).forEach(([Bt,Pt])=>Lt.push(gt.subscribeToEditEnd(Bt,Pt))),()=>Lt.forEach(Bt=>Bt())},[St,Et,gt]),ut?[Tt,$t,Ut]:Tt}register(LevaInputs.SELECT,select$1);register(LevaInputs.IMAGE,image$1);register(LevaInputs.NUMBER,number$7);register(LevaInputs.COLOR,color$4);register(LevaInputs.STRING,string$3);register(LevaInputs.BOOLEAN,boolean$1);register(LevaInputs.INTERVAL,interval$1);register(LevaInputs.VECTOR3D,vector3d);register(LevaInputs.VECTOR2D,vector2d);var isCheckBoxInput=tt=>tt.type==="checkbox",isDateObject=tt=>tt instanceof Date,isNullOrUndefined=tt=>tt==null;const isObjectType=tt=>typeof tt=="object";var isObject$k=tt=>!isNullOrUndefined(tt)&&!Array.isArray(tt)&&isObjectType(tt)&&!isDateObject(tt),getEventValue=tt=>isObject$k(tt)&&tt.target?isCheckBoxInput(tt.target)?tt.target.checked:tt.target.value:tt,getNodeParentName=tt=>tt.substring(0,tt.search(/\.\d+(\.|$)/))||tt,isNameInFieldArray=(tt,et)=>tt.has(getNodeParentName(et)),isPlainObject$5=tt=>{const et=tt.constructor&&tt.constructor.prototype;return isObject$k(et)&&et.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(tt){let et;const nt=Array.isArray(tt);if(tt instanceof Date)et=new Date(tt);else if(tt instanceof Set)et=new Set(tt);else if(!(isWeb&&(tt instanceof Blob||tt instanceof FileList))&&(nt||isObject$k(tt)))if(et=nt?[]:{},!nt&&!isPlainObject$5(tt))et=tt;else for(const it in tt)tt.hasOwnProperty(it)&&(et[it]=cloneObject(tt[it]));else return tt;return et}var compact=tt=>Array.isArray(tt)?tt.filter(Boolean):[],isUndefined$1=tt=>tt===void 0,get$6=(tt,et,nt)=>{if(!et||!isObject$k(tt))return nt;const it=compact(et.split(/[,[\].]+?/)).reduce((rt,ot)=>isNullOrUndefined(rt)?rt:rt[ot],tt);return isUndefined$1(it)||it===tt?isUndefined$1(tt[et])?nt:tt[et]:it},isBoolean$3=tt=>typeof tt=="boolean";const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$1.createContext(null),useFormContext=()=>React$1.useContext(HookFormContext),FormProvider=tt=>{const{children:et,...nt}=tt;return React$1.createElement(HookFormContext.Provider,{value:nt},et)};var getProxyFormState=(tt,et,nt,it=!0)=>{const rt={defaultValues:et._defaultValues};for(const ot in tt)Object.defineProperty(rt,ot,{get:()=>{const at=ot;return et._proxyFormState[at]!==VALIDATION_MODE.all&&(et._proxyFormState[at]=!it||VALIDATION_MODE.all),nt&&(nt[at]=!0),tt[at]}});return rt},isEmptyObject=tt=>isObject$k(tt)&&!Object.keys(tt).length,shouldRenderFormState=(tt,et,nt,it)=>{nt(tt);const{name:rt,...ot}=tt;return isEmptyObject(ot)||Object.keys(ot).length>=Object.keys(et).length||Object.keys(ot).find(at=>et[at]===(!it||VALIDATION_MODE.all))},convertToArrayPayload=tt=>Array.isArray(tt)?tt:[tt],shouldSubscribeByName=(tt,et,nt)=>!tt||!et||tt===et||convertToArrayPayload(tt).some(it=>it&&(nt?it===et:it.startsWith(et)||et.startsWith(it)));function useSubscribe(tt){const et=React$1.useRef(tt);et.current=tt,React$1.useEffect(()=>{const nt=!tt.disabled&&et.current.subject&&et.current.subject.subscribe({next:et.current.next});return()=>{nt&&nt.unsubscribe()}},[tt.disabled])}function useFormState(tt){const et=useFormContext(),{control:nt=et.control,disabled:it,name:rt,exact:ot}=tt||{},[at,st]=React$1.useState(nt._formState),lt=React$1.useRef(!0),ct=React$1.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),ut=React$1.useRef(rt);return ut.current=rt,useSubscribe({disabled:it,next:ht=>lt.current&&shouldSubscribeByName(ut.current,ht.name,ot)&&shouldRenderFormState(ht,ct.current,nt._updateFormState)&&st({...nt._formState,...ht}),subject:nt._subjects.state}),React$1.useEffect(()=>(lt.current=!0,ct.current.isValid&&nt._updateValid(!0),()=>{lt.current=!1}),[nt]),getProxyFormState(at,nt,ct.current,!1)}var isString$4=tt=>typeof tt=="string",generateWatchOutput=(tt,et,nt,it,rt)=>isString$4(tt)?(it&&et.watch.add(tt),get$6(nt,tt,rt)):Array.isArray(tt)?tt.map(ot=>(it&&et.watch.add(ot),get$6(nt,ot))):(it&&(et.watchAll=!0),nt);function useWatch(tt){const et=useFormContext(),{control:nt=et.control,name:it,defaultValue:rt,disabled:ot,exact:at}=tt||{},st=React$1.useRef(it);st.current=it,useSubscribe({disabled:ot,subject:nt._subjects.values,next:ut=>{shouldSubscribeByName(st.current,ut.name,at)&&ct(cloneObject(generateWatchOutput(st.current,nt._names,ut.values||nt._formValues,!1,rt)))}});const[lt,ct]=React$1.useState(nt._getWatch(it,rt));return React$1.useEffect(()=>nt._removeUnmounted()),lt}var isKey$4=tt=>/^\w*$/.test(tt),stringToPath$3=tt=>compact(tt.replace(/["|']|\]/g,"").split(/\.|\[/));function set$3(tt,et,nt){let it=-1;const rt=isKey$4(et)?[et]:stringToPath$3(et),ot=rt.length,at=ot-1;for(;++it{const ut=rt._options.shouldUnregister||ot,ht=(dt,pt)=>{const mt=get$6(rt._fields,dt);mt&&(mt._f.mount=pt)};if(ht(nt,!0),ut){const dt=cloneObject(get$6(rt._options.defaultValues,nt));set$3(rt._defaultValues,nt,dt),isUndefined$1(get$6(rt._formValues,nt))&&set$3(rt._formValues,nt,dt)}return()=>{(at?ut&&!rt._state.action:ut)?rt.unregister(nt):ht(nt,!1)}},[nt,rt,at,ot]),React$1.useEffect(()=>{get$6(rt._fields,nt)&&rt._updateDisabledField({disabled:it,fields:rt._fields,name:nt,value:get$6(rt._fields,nt)._f.value})},[it,nt,rt]),{field:{name:nt,value:st,...isBoolean$3(it)||isBoolean$3(lt.disabled)?{disabled:lt.disabled||it}:{},onChange:React$1.useCallback(ut=>ct.current.onChange({target:{value:getEventValue(ut),name:nt},type:EVENTS.CHANGE}),[nt]),onBlur:React$1.useCallback(()=>ct.current.onBlur({target:{value:get$6(rt._formValues,nt),name:nt},type:EVENTS.BLUR}),[nt,rt]),ref:ut=>{const ht=get$6(rt._fields,nt);ht&&ut&&(ht._f.ref={focus:()=>ut.focus(),select:()=>ut.select(),setCustomValidity:dt=>ut.setCustomValidity(dt),reportValidity:()=>ut.reportValidity()})}},formState:lt,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get$6(lt.errors,nt)},isDirty:{enumerable:!0,get:()=>!!get$6(lt.dirtyFields,nt)},isTouched:{enumerable:!0,get:()=>!!get$6(lt.touchedFields,nt)},error:{enumerable:!0,get:()=>get$6(lt.errors,nt)}})}}const Controller=tt=>tt.render(useController(tt));var appendErrors=(tt,et,nt,it,rt)=>et?{...nt[tt],types:{...nt[tt]&&nt[tt].types?nt[tt].types:{},[it]:rt||!0}}:{},getValidationModes=tt=>({isOnSubmit:!tt||tt===VALIDATION_MODE.onSubmit,isOnBlur:tt===VALIDATION_MODE.onBlur,isOnChange:tt===VALIDATION_MODE.onChange,isOnAll:tt===VALIDATION_MODE.all,isOnTouch:tt===VALIDATION_MODE.onTouched}),isWatched=(tt,et,nt)=>!nt&&(et.watchAll||et.watch.has(tt)||[...et.watch].some(it=>tt.startsWith(it)&&/^\.\w+/.test(tt.slice(it.length))));const iterateFieldsByAction=(tt,et,nt,it)=>{for(const rt of nt||Object.keys(tt)){const ot=get$6(tt,rt);if(ot){const{_f:at,...st}=ot;if(at){if(at.refs&&at.refs[0]&&et(at.refs[0],rt)&&!it)break;if(at.ref&&et(at.ref,at.name)&&!it)break}else isObject$k(st)&&iterateFieldsByAction(st,et)}}};var updateFieldArrayRootError=(tt,et,nt)=>{const it=compact(get$6(tt,nt));return set$3(it,"root",et[nt]),set$3(tt,nt,it),tt},isFileInput=tt=>tt.type==="file",isFunction$6=tt=>typeof tt=="function",isHTMLElement$2=tt=>{if(!isWeb)return!1;const et=tt?tt.ownerDocument:0;return tt instanceof(et&&et.defaultView?et.defaultView.HTMLElement:HTMLElement)},isMessage=tt=>isString$4(tt),isRadioInput=tt=>tt.type==="radio",isRegex=tt=>tt instanceof RegExp;const defaultResult$1={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=tt=>{if(Array.isArray(tt)){if(tt.length>1){const et=tt.filter(nt=>nt&&nt.checked&&!nt.disabled).map(nt=>nt.value);return{value:et,isValid:!!et.length}}return tt[0].checked&&!tt[0].disabled?tt[0].attributes&&!isUndefined$1(tt[0].attributes.value)?isUndefined$1(tt[0].value)||tt[0].value===""?validResult:{value:tt[0].value,isValid:!0}:validResult:defaultResult$1}return defaultResult$1};const defaultReturn={isValid:!1,value:null};var getRadioValue=tt=>Array.isArray(tt)?tt.reduce((et,nt)=>nt&&nt.checked&&!nt.disabled?{isValid:!0,value:nt.value}:et,defaultReturn):defaultReturn;function getValidateError(tt,et,nt="validate"){if(isMessage(tt)||Array.isArray(tt)&&tt.every(isMessage)||isBoolean$3(tt)&&!tt)return{type:nt,message:isMessage(tt)?tt:"",ref:et}}var getValueAndMessage=tt=>isObject$k(tt)&&!isRegex(tt)?tt:{value:tt,message:""},validateField=async(tt,et,nt,it,rt)=>{const{ref:ot,refs:at,required:st,maxLength:lt,minLength:ct,min:ut,max:ht,pattern:dt,validate:pt,name:mt,valueAsNumber:gt,mount:bt,disabled:yt}=tt._f,wt=get$6(et,mt);if(!bt||yt)return{};const vt=at?at[0]:ot,xt=Bt=>{it&&vt.reportValidity&&(vt.setCustomValidity(isBoolean$3(Bt)?"":Bt||""),vt.reportValidity())},St={},Et=isRadioInput(ot),It=isCheckBoxInput(ot),Tt=Et||It,$t=(gt||isFileInput(ot))&&isUndefined$1(ot.value)&&isUndefined$1(wt)||isHTMLElement$2(ot)&&ot.value===""||wt===""||Array.isArray(wt)&&!wt.length,Ut=appendErrors.bind(null,mt,nt,St),Lt=(Bt,Pt,kt,At=INPUT_VALIDATION_RULES.maxLength,Rt=INPUT_VALIDATION_RULES.minLength)=>{const Wt=Bt?Pt:kt;St[mt]={type:Bt?At:Rt,message:Wt,ref:ot,...Ut(Bt?At:Rt,Wt)}};if(rt?!Array.isArray(wt)||!wt.length:st&&(!Tt&&($t||isNullOrUndefined(wt))||isBoolean$3(wt)&&!wt||It&&!getCheckboxValue(at).isValid||Et&&!getRadioValue(at).isValid)){const{value:Bt,message:Pt}=isMessage(st)?{value:!!st,message:st}:getValueAndMessage(st);if(Bt&&(St[mt]={type:INPUT_VALIDATION_RULES.required,message:Pt,ref:vt,...Ut(INPUT_VALIDATION_RULES.required,Pt)},!nt))return xt(Pt),St}if(!$t&&(!isNullOrUndefined(ut)||!isNullOrUndefined(ht))){let Bt,Pt;const kt=getValueAndMessage(ht),At=getValueAndMessage(ut);if(!isNullOrUndefined(wt)&&!isNaN(wt)){const Rt=ot.valueAsNumber||wt&&+wt;isNullOrUndefined(kt.value)||(Bt=Rt>kt.value),isNullOrUndefined(At.value)||(Pt=Rtnew Date(new Date().toDateString()+" "+Ct),jt=ot.type=="time",Ot=ot.type=="week";isString$4(kt.value)&&wt&&(Bt=jt?Wt(wt)>Wt(kt.value):Ot?wt>kt.value:Rt>new Date(kt.value)),isString$4(At.value)&&wt&&(Pt=jt?Wt(wt)+Bt.value,At=!isNullOrUndefined(Pt.value)&&wt.length<+Pt.value;if((kt||At)&&(Lt(kt,Bt.message,Pt.message),!nt))return xt(St[mt].message),St}if(dt&&!$t&&isString$4(wt)){const{value:Bt,message:Pt}=getValueAndMessage(dt);if(isRegex(Bt)&&!wt.match(Bt)&&(St[mt]={type:INPUT_VALIDATION_RULES.pattern,message:Pt,ref:ot,...Ut(INPUT_VALIDATION_RULES.pattern,Pt)},!nt))return xt(Pt),St}if(pt){if(isFunction$6(pt)){const Bt=await pt(wt,et),Pt=getValidateError(Bt,vt);if(Pt&&(St[mt]={...Pt,...Ut(INPUT_VALIDATION_RULES.validate,Pt.message)},!nt))return xt(Pt.message),St}else if(isObject$k(pt)){let Bt={};for(const Pt in pt){if(!isEmptyObject(Bt)&&!nt)break;const kt=getValidateError(await pt[Pt](wt,et),vt,Pt);kt&&(Bt={...kt,...Ut(Pt,kt.message)},xt(kt.message),nt&&(St[mt]=Bt))}if(!isEmptyObject(Bt)&&(St[mt]={ref:vt,...Bt},!nt))return St}}return xt(!0),St};function baseGet$4(tt,et){const nt=et.slice(0,-1).length;let it=0;for(;it{for(const ot of tt)ot.next&&ot.next(rt)},subscribe:rt=>(tt.push(rt),{unsubscribe:()=>{tt=tt.filter(ot=>ot!==rt)}}),unsubscribe:()=>{tt=[]}}}var isPrimitive=tt=>isNullOrUndefined(tt)||!isObjectType(tt);function deepEqual$2(tt,et){if(isPrimitive(tt)||isPrimitive(et))return tt===et;if(isDateObject(tt)&&isDateObject(et))return tt.getTime()===et.getTime();const nt=Object.keys(tt),it=Object.keys(et);if(nt.length!==it.length)return!1;for(const rt of nt){const ot=tt[rt];if(!it.includes(rt))return!1;if(rt!=="ref"){const at=et[rt];if(isDateObject(ot)&&isDateObject(at)||isObject$k(ot)&&isObject$k(at)||Array.isArray(ot)&&Array.isArray(at)?!deepEqual$2(ot,at):ot!==at)return!1}}return!0}var isMultipleSelect=tt=>tt.type==="select-multiple",isRadioOrCheckbox=tt=>isRadioInput(tt)||isCheckBoxInput(tt),live=tt=>isHTMLElement$2(tt)&&tt.isConnected,objectHasFunction=tt=>{for(const et in tt)if(isFunction$6(tt[et]))return!0;return!1};function markFieldsDirty(tt,et={}){const nt=Array.isArray(tt);if(isObject$k(tt)||nt)for(const it in tt)Array.isArray(tt[it])||isObject$k(tt[it])&&!objectHasFunction(tt[it])?(et[it]=Array.isArray(tt[it])?[]:{},markFieldsDirty(tt[it],et[it])):isNullOrUndefined(tt[it])||(et[it]=!0);return et}function getDirtyFieldsFromDefaultValues(tt,et,nt){const it=Array.isArray(tt);if(isObject$k(tt)||it)for(const rt in tt)Array.isArray(tt[rt])||isObject$k(tt[rt])&&!objectHasFunction(tt[rt])?isUndefined$1(et)||isPrimitive(nt[rt])?nt[rt]=Array.isArray(tt[rt])?markFieldsDirty(tt[rt],[]):{...markFieldsDirty(tt[rt])}:getDirtyFieldsFromDefaultValues(tt[rt],isNullOrUndefined(et)?{}:et[rt],nt[rt]):nt[rt]=!deepEqual$2(tt[rt],et[rt]);return nt}var getDirtyFields=(tt,et)=>getDirtyFieldsFromDefaultValues(tt,et,markFieldsDirty(et)),getFieldValueAs=(tt,{valueAsNumber:et,valueAsDate:nt,setValueAs:it})=>isUndefined$1(tt)?tt:et?tt===""?NaN:tt&&+tt:nt&&isString$4(tt)?new Date(tt):it?it(tt):tt;function getFieldValue(tt){const et=tt.ref;if(!(tt.refs?tt.refs.every(nt=>nt.disabled):et.disabled))return isFileInput(et)?et.files:isRadioInput(et)?getRadioValue(tt.refs).value:isMultipleSelect(et)?[...et.selectedOptions].map(({value:nt})=>nt):isCheckBoxInput(et)?getCheckboxValue(tt.refs).value:getFieldValueAs(isUndefined$1(et.value)?tt.ref.value:et.value,tt)}var getResolverOptions=(tt,et,nt,it)=>{const rt={};for(const ot of tt){const at=get$6(et,ot);at&&set$3(rt,ot,at._f)}return{criteriaMode:nt,names:[...tt],fields:rt,shouldUseNativeValidation:it}},getRuleValue=tt=>isUndefined$1(tt)?tt:isRegex(tt)?tt.source:isObject$k(tt)?isRegex(tt.value)?tt.value.source:tt.value:tt,hasValidation=tt=>tt.mount&&(tt.required||tt.min||tt.max||tt.maxLength||tt.minLength||tt.pattern||tt.validate);function schemaErrorLookup(tt,et,nt){const it=get$6(tt,nt);if(it||isKey$4(nt))return{error:it,name:nt};const rt=nt.split(".");for(;rt.length;){const ot=rt.join("."),at=get$6(et,ot),st=get$6(tt,ot);if(at&&!Array.isArray(at)&&nt!==ot)return{name:nt};if(st&&st.type)return{name:ot,error:st};rt.pop()}return{name:nt}}var skipValidation=(tt,et,nt,it,rt)=>rt.isOnAll?!1:!nt&&rt.isOnTouch?!(et||tt):(nt?it.isOnBlur:rt.isOnBlur)?!tt:(nt?it.isOnChange:rt.isOnChange)?tt:!0,unsetEmptyArray=(tt,et)=>!compact(get$6(tt,et)).length&&unset(tt,et);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(tt={},et){let nt={...defaultOptions,...tt},it={submitCount:0,isDirty:!1,isLoading:isFunction$6(nt.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},rt={},ot=isObject$k(nt.defaultValues)||isObject$k(nt.values)?cloneObject(nt.defaultValues||nt.values)||{}:{},at=nt.shouldUnregister?{}:cloneObject(ot),st={action:!1,mount:!1,watch:!1},lt={mount:new Set,unMount:new Set,array:new Set,watch:new Set},ct,ut=0;const ht={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},dt={values:createSubject(),array:createSubject(),state:createSubject()},pt=tt.resetOptions&&tt.resetOptions.keepDirtyValues,mt=getValidationModes(nt.mode),gt=getValidationModes(nt.reValidateMode),bt=nt.criteriaMode===VALIDATION_MODE.all,yt=un=>En=>{clearTimeout(ut),ut=setTimeout(un,En)},wt=async un=>{if(ht.isValid||un){const En=nt.resolver?isEmptyObject((await $t()).errors):await Lt(rt,!0);En!==it.isValid&&dt.state.next({isValid:En})}},vt=un=>ht.isValidating&&dt.state.next({isValidating:un}),xt=(un,En=[],In,xn,dn=!0,cn=!0)=>{if(xn&&In){if(st.action=!0,cn&&Array.isArray(get$6(rt,un))){const hn=In(get$6(rt,un),xn.argA,xn.argB);dn&&set$3(rt,un,hn)}if(cn&&Array.isArray(get$6(it.errors,un))){const hn=In(get$6(it.errors,un),xn.argA,xn.argB);dn&&set$3(it.errors,un,hn),unsetEmptyArray(it.errors,un)}if(ht.touchedFields&&cn&&Array.isArray(get$6(it.touchedFields,un))){const hn=In(get$6(it.touchedFields,un),xn.argA,xn.argB);dn&&set$3(it.touchedFields,un,hn)}ht.dirtyFields&&(it.dirtyFields=getDirtyFields(ot,at)),dt.state.next({name:un,isDirty:Pt(un,En),dirtyFields:it.dirtyFields,errors:it.errors,isValid:it.isValid})}else set$3(at,un,En)},St=(un,En)=>{set$3(it.errors,un,En),dt.state.next({errors:it.errors})},Et=(un,En,In,xn)=>{const dn=get$6(rt,un);if(dn){const cn=get$6(at,un,isUndefined$1(In)?get$6(ot,un):In);isUndefined$1(cn)||xn&&xn.defaultChecked||En?set$3(at,un,En?cn:getFieldValue(dn._f)):Rt(un,cn),st.mount&&wt()}},It=(un,En,In,xn,dn)=>{let cn=!1,hn=!1;const $n={name:un};if(!In||xn){ht.isDirty&&(hn=it.isDirty,it.isDirty=$n.isDirty=Pt(),cn=hn!==$n.isDirty);const nn=deepEqual$2(get$6(ot,un),En);hn=get$6(it.dirtyFields,un),nn?unset(it.dirtyFields,un):set$3(it.dirtyFields,un,!0),$n.dirtyFields=it.dirtyFields,cn=cn||ht.dirtyFields&&hn!==!nn}if(In){const nn=get$6(it.touchedFields,un);nn||(set$3(it.touchedFields,un,In),$n.touchedFields=it.touchedFields,cn=cn||ht.touchedFields&&nn!==In)}return cn&&dn&&dt.state.next($n),cn?$n:{}},Tt=(un,En,In,xn)=>{const dn=get$6(it.errors,un),cn=ht.isValid&&isBoolean$3(En)&&it.isValid!==En;if(tt.delayError&&In?(ct=yt(()=>St(un,In)),ct(tt.delayError)):(clearTimeout(ut),ct=null,In?set$3(it.errors,un,In):unset(it.errors,un)),(In?!deepEqual$2(dn,In):dn)||!isEmptyObject(xn)||cn){const hn={...xn,...cn&&isBoolean$3(En)?{isValid:En}:{},errors:it.errors,name:un};it={...it,...hn},dt.state.next(hn)}vt(!1)},$t=async un=>nt.resolver(at,nt.context,getResolverOptions(un||lt.mount,rt,nt.criteriaMode,nt.shouldUseNativeValidation)),Ut=async un=>{const{errors:En}=await $t(un);if(un)for(const In of un){const xn=get$6(En,In);xn?set$3(it.errors,In,xn):unset(it.errors,In)}else it.errors=En;return En},Lt=async(un,En,In={valid:!0})=>{for(const xn in un){const dn=un[xn];if(dn){const{_f:cn,...hn}=dn;if(cn){const $n=lt.array.has(cn.name),nn=await validateField(dn,at,bt,nt.shouldUseNativeValidation&&!En,$n);if(nn[cn.name]&&(In.valid=!1,En))break;!En&&(get$6(nn,cn.name)?$n?updateFieldArrayRootError(it.errors,nn,cn.name):set$3(it.errors,cn.name,nn[cn.name]):unset(it.errors,cn.name))}hn&&await Lt(hn,En,In)}}return In.valid},Bt=()=>{for(const un of lt.unMount){const En=get$6(rt,un);En&&(En._f.refs?En._f.refs.every(In=>!live(In)):!live(En._f.ref))&&an(un)}lt.unMount=new Set},Pt=(un,En)=>(un&&En&&set$3(at,un,En),!deepEqual$2(Mt(),ot)),kt=(un,En,In)=>generateWatchOutput(un,lt,{...st.mount?at:isUndefined$1(En)?ot:isString$4(un)?{[un]:En}:En},In,En),At=un=>compact(get$6(st.mount?at:ot,un,tt.shouldUnregister?get$6(ot,un,[]):[])),Rt=(un,En,In={})=>{const xn=get$6(rt,un);let dn=En;if(xn){const cn=xn._f;cn&&(!cn.disabled&&set$3(at,un,getFieldValueAs(En,cn)),dn=isHTMLElement$2(cn.ref)&&isNullOrUndefined(En)?"":En,isMultipleSelect(cn.ref)?[...cn.ref.options].forEach(hn=>hn.selected=dn.includes(hn.value)):cn.refs?isCheckBoxInput(cn.ref)?cn.refs.length>1?cn.refs.forEach(hn=>(!hn.defaultChecked||!hn.disabled)&&(hn.checked=Array.isArray(dn)?!!dn.find($n=>$n===hn.value):dn===hn.value)):cn.refs[0]&&(cn.refs[0].checked=!!dn):cn.refs.forEach(hn=>hn.checked=hn.value===dn):isFileInput(cn.ref)?cn.ref.value="":(cn.ref.value=dn,cn.ref.type||dt.values.next({name:un,values:{...at}})))}(In.shouldDirty||In.shouldTouch)&&It(un,dn,In.shouldTouch,In.shouldDirty,!0),In.shouldValidate&&Dt(un)},Wt=(un,En,In)=>{for(const xn in En){const dn=En[xn],cn=`${un}.${xn}`,hn=get$6(rt,cn);(lt.array.has(un)||!isPrimitive(dn)||hn&&!hn._f)&&!isDateObject(dn)?Wt(cn,dn,In):Rt(cn,dn,In)}},jt=(un,En,In={})=>{const xn=get$6(rt,un),dn=lt.array.has(un),cn=cloneObject(En);set$3(at,un,cn),dn?(dt.array.next({name:un,values:{...at}}),(ht.isDirty||ht.dirtyFields)&&In.shouldDirty&&dt.state.next({name:un,dirtyFields:getDirtyFields(ot,at),isDirty:Pt(un,cn)})):xn&&!xn._f&&!isNullOrUndefined(cn)?Wt(un,cn,In):Rt(un,cn,In),isWatched(un,lt)&&dt.state.next({...it}),dt.values.next({name:un,values:{...at}}),!st.mount&&et()},Ot=async un=>{const En=un.target;let In=En.name,xn=!0;const dn=get$6(rt,In),cn=()=>En.type?getFieldValue(dn._f):getEventValue(un),hn=$n=>{xn=Number.isNaN($n)||$n===get$6(at,In,$n)};if(dn){let $n,nn;const Kt=cn(),Yt=un.type===EVENTS.BLUR||un.type===EVENTS.FOCUS_OUT,_n=!hasValidation(dn._f)&&!nt.resolver&&!get$6(it.errors,In)&&!dn._f.deps||skipValidation(Yt,get$6(it.touchedFields,In),it.isSubmitted,gt,mt),Mn=isWatched(In,lt,Yt);set$3(at,In,Kt),Yt?(dn._f.onBlur&&dn._f.onBlur(un),ct&&ct(0)):dn._f.onChange&&dn._f.onChange(un);const Bn=It(In,Kt,Yt,!1),Nn=!isEmptyObject(Bn)||Mn;if(!Yt&&dt.values.next({name:In,type:un.type,values:{...at}}),_n)return ht.isValid&&wt(),Nn&&dt.state.next({name:In,...Mn?{}:Bn});if(!Yt&&Mn&&dt.state.next({...it}),vt(!0),nt.resolver){const{errors:qn}=await $t([In]);if(hn(Kt),xn){const Wn=schemaErrorLookup(it.errors,rt,In),Vn=schemaErrorLookup(qn,rt,Wn.name||In);$n=Vn.error,In=Vn.name,nn=isEmptyObject(qn)}}else $n=(await validateField(dn,at,bt,nt.shouldUseNativeValidation))[In],hn(Kt),xn&&($n?nn=!1:ht.isValid&&(nn=await Lt(rt,!0)));xn&&(dn._f.deps&&Dt(dn._f.deps),Tt(In,nn,$n,Bn))}},Ct=(un,En)=>{if(get$6(it.errors,En)&&un.focus)return un.focus(),1},Dt=async(un,En={})=>{let In,xn;const dn=convertToArrayPayload(un);if(vt(!0),nt.resolver){const cn=await Ut(isUndefined$1(un)?un:dn);In=isEmptyObject(cn),xn=un?!dn.some(hn=>get$6(cn,hn)):In}else un?(xn=(await Promise.all(dn.map(async cn=>{const hn=get$6(rt,cn);return await Lt(hn&&hn._f?{[cn]:hn}:hn)}))).every(Boolean),!(!xn&&!it.isValid)&&wt()):xn=In=await Lt(rt);return dt.state.next({...!isString$4(un)||ht.isValid&&In!==it.isValid?{}:{name:un},...nt.resolver||!un?{isValid:In}:{},errors:it.errors,isValidating:!1}),En.shouldFocus&&!xn&&iterateFieldsByAction(rt,Ct,un?dn:lt.mount),xn},Mt=un=>{const En={...ot,...st.mount?at:{}};return isUndefined$1(un)?En:isString$4(un)?get$6(En,un):un.map(In=>get$6(En,In))},Vt=(un,En)=>({invalid:!!get$6((En||it).errors,un),isDirty:!!get$6((En||it).dirtyFields,un),isTouched:!!get$6((En||it).touchedFields,un),error:get$6((En||it).errors,un)}),Qt=un=>{un&&convertToArrayPayload(un).forEach(En=>unset(it.errors,En)),dt.state.next({errors:un?it.errors:{}})},rn=(un,En,In)=>{const xn=(get$6(rt,un,{_f:{}})._f||{}).ref;set$3(it.errors,un,{...En,ref:xn}),dt.state.next({name:un,errors:it.errors,isValid:!1}),In&&In.shouldFocus&&xn&&xn.focus&&xn.focus()},Xt=(un,En)=>isFunction$6(un)?dt.values.subscribe({next:In=>un(kt(void 0,En),In)}):kt(un,En,!0),an=(un,En={})=>{for(const In of un?convertToArrayPayload(un):lt.mount)lt.mount.delete(In),lt.array.delete(In),En.keepValue||(unset(rt,In),unset(at,In)),!En.keepError&&unset(it.errors,In),!En.keepDirty&&unset(it.dirtyFields,In),!En.keepTouched&&unset(it.touchedFields,In),!nt.shouldUnregister&&!En.keepDefaultValue&&unset(ot,In);dt.values.next({values:{...at}}),dt.state.next({...it,...En.keepDirty?{isDirty:Pt()}:{}}),!En.keepIsValid&&wt()},tn=({disabled:un,name:En,field:In,fields:xn,value:dn})=>{if(isBoolean$3(un)){const cn=un?void 0:isUndefined$1(dn)?getFieldValue(In?In._f:get$6(xn,En)._f):dn;set$3(at,En,cn),It(En,cn,!1,!1,!0)}},pn=(un,En={})=>{let In=get$6(rt,un);const xn=isBoolean$3(En.disabled);return set$3(rt,un,{...In||{},_f:{...In&&In._f?In._f:{ref:{name:un}},name:un,mount:!0,...En}}),lt.mount.add(un),In?tn({field:In,disabled:En.disabled,name:un}):Et(un,!0,En.value),{...xn?{disabled:En.disabled}:{},...nt.progressive?{required:!!En.required,min:getRuleValue(En.min),max:getRuleValue(En.max),minLength:getRuleValue(En.minLength),maxLength:getRuleValue(En.maxLength),pattern:getRuleValue(En.pattern)}:{},name:un,onChange:Ot,onBlur:Ot,ref:dn=>{if(dn){pn(un,En),In=get$6(rt,un);const cn=isUndefined$1(dn.value)&&dn.querySelectorAll&&dn.querySelectorAll("input,select,textarea")[0]||dn,hn=isRadioOrCheckbox(cn),$n=In._f.refs||[];if(hn?$n.find(nn=>nn===cn):cn===In._f.ref)return;set$3(rt,un,{_f:{...In._f,...hn?{refs:[...$n.filter(live),cn,...Array.isArray(get$6(ot,un))?[{}]:[]],ref:{type:cn.type,name:un}}:{ref:cn}}}),Et(un,!1,void 0,cn)}else In=get$6(rt,un,{}),In._f&&(In._f.mount=!1),(nt.shouldUnregister||En.shouldUnregister)&&!(isNameInFieldArray(lt.array,un)&&st.action)&<.unMount.add(un)}}},vn=()=>nt.shouldFocusError&&iterateFieldsByAction(rt,Ct,lt.mount),sn=un=>{isBoolean$3(un)&&(dt.state.next({disabled:un}),iterateFieldsByAction(rt,En=>{En.disabled=un},0,!1))},Zt=(un,En)=>async In=>{In&&(In.preventDefault&&In.preventDefault(),In.persist&&In.persist());let xn=cloneObject(at);if(dt.state.next({isSubmitting:!0}),nt.resolver){const{errors:dn,values:cn}=await $t();it.errors=dn,xn=cn}else await Lt(rt);unset(it.errors,"root"),isEmptyObject(it.errors)?(dt.state.next({errors:{}}),await un(xn,In)):(En&&await En({...it.errors},In),vn(),setTimeout(vn)),dt.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(it.errors),submitCount:it.submitCount+1,errors:it.errors})},Sn=(un,En={})=>{get$6(rt,un)&&(isUndefined$1(En.defaultValue)?jt(un,get$6(ot,un)):(jt(un,En.defaultValue),set$3(ot,un,En.defaultValue)),En.keepTouched||unset(it.touchedFields,un),En.keepDirty||(unset(it.dirtyFields,un),it.isDirty=En.defaultValue?Pt(un,get$6(ot,un)):Pt()),En.keepError||(unset(it.errors,un),ht.isValid&&wt()),dt.state.next({...it}))},Tn=(un,En={})=>{const In=un?cloneObject(un):ot,xn=cloneObject(In),dn=un&&!isEmptyObject(un)?xn:ot;if(En.keepDefaultValues||(ot=In),!En.keepValues){if(En.keepDirtyValues||pt)for(const cn of lt.mount)get$6(it.dirtyFields,cn)?set$3(dn,cn,get$6(at,cn)):jt(cn,get$6(dn,cn));else{if(isWeb&&isUndefined$1(un))for(const cn of lt.mount){const hn=get$6(rt,cn);if(hn&&hn._f){const $n=Array.isArray(hn._f.refs)?hn._f.refs[0]:hn._f.ref;if(isHTMLElement$2($n)){const nn=$n.closest("form");if(nn){nn.reset();break}}}}rt={}}at=tt.shouldUnregister?En.keepDefaultValues?cloneObject(ot):{}:cloneObject(dn),dt.array.next({values:{...dn}}),dt.values.next({values:{...dn}})}lt={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!st.mount&&et(),st.mount=!ht.isValid||!!En.keepIsValid,st.watch=!!tt.shouldUnregister,dt.state.next({submitCount:En.keepSubmitCount?it.submitCount:0,isDirty:En.keepDirty?it.isDirty:!!(En.keepDefaultValues&&!deepEqual$2(un,ot)),isSubmitted:En.keepIsSubmitted?it.isSubmitted:!1,dirtyFields:En.keepDirtyValues?it.dirtyFields:En.keepDefaultValues&&un?getDirtyFields(ot,un):{},touchedFields:En.keepTouched?it.touchedFields:{},errors:En.keepErrors?it.errors:{},isSubmitSuccessful:En.keepIsSubmitSuccessful?it.isSubmitSuccessful:!1,isSubmitting:!1})},Cn=(un,En)=>Tn(isFunction$6(un)?un(at):un,En);return{control:{register:pn,unregister:an,getFieldState:Vt,handleSubmit:Zt,setError:rn,_executeSchema:$t,_getWatch:kt,_getDirty:Pt,_updateValid:wt,_removeUnmounted:Bt,_updateFieldArray:xt,_updateDisabledField:tn,_getFieldArray:At,_reset:Tn,_resetDefaultValues:()=>isFunction$6(nt.defaultValues)&&nt.defaultValues().then(un=>{Cn(un,nt.resetOptions),dt.state.next({isLoading:!1})}),_updateFormState:un=>{it={...it,...un}},_disableForm:sn,_subjects:dt,_proxyFormState:ht,get _fields(){return rt},get _formValues(){return at},get _state(){return st},set _state(un){st=un},get _defaultValues(){return ot},get _names(){return lt},set _names(un){lt=un},get _formState(){return it},set _formState(un){it=un},get _options(){return nt},set _options(un){nt={...nt,...un}}},trigger:Dt,register:pn,handleSubmit:Zt,watch:Xt,setValue:jt,getValues:Mt,reset:Cn,resetField:Sn,clearErrors:Qt,unregister:an,setError:rn,setFocus:(un,En={})=>{const In=get$6(rt,un),xn=In&&In._f;if(xn){const dn=xn.refs?xn.refs[0]:xn.ref;dn.focus&&(dn.focus(),En.shouldSelect&&dn.select())}},getFieldState:Vt}}function useForm(tt={}){const et=React$1.useRef(),nt=React$1.useRef(),[it,rt]=React$1.useState({isDirty:!1,isValidating:!1,isLoading:isFunction$6(tt.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:isFunction$6(tt.defaultValues)?void 0:tt.defaultValues});et.current||(et.current={...createFormControl(tt,()=>rt(at=>({...at}))),formState:it});const ot=et.current.control;return ot._options=tt,useSubscribe({subject:ot._subjects.state,next:at=>{shouldRenderFormState(at,ot._proxyFormState,ot._updateFormState,!0)&&rt({...ot._formState})}}),React$1.useEffect(()=>ot._disableForm(tt.disabled),[ot,tt.disabled]),React$1.useEffect(()=>{if(ot._proxyFormState.isDirty){const at=ot._getDirty();at!==it.isDirty&&ot._subjects.state.next({isDirty:at})}},[ot,it.isDirty]),React$1.useEffect(()=>{tt.values&&!deepEqual$2(tt.values,nt.current)?(ot._reset(tt.values,ot._options.resetOptions),nt.current=tt.values):ot._resetDefaultValues()},[tt.values,ot]),React$1.useEffect(()=>{ot._state.mount||(ot._updateValid(),ot._state.mount=!0),ot._state.watch&&(ot._state.watch=!1,ot._subjects.state.next({...ot._formState})),ot._removeUnmounted()}),et.current.formState=getProxyFormState(it,ot),et.current}const ReactToastify="";var dist$4={exports:{}},lib$3={},postMessage$2={};Object.defineProperty(postMessage$2,"__esModule",{value:!0});postMessage$2.removeEventer=postMessage$2.addEventer=postMessage$2.postMessage=void 0;function postMessage$1(tt){var et=window;if(et.sendToElectron)return et.sendToElectron("sphinx-bridge",tt);et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?et.ReactNativeWebView.postMessage(JSON.stringify(tt)):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx?et.webkit.messageHandlers.sphinx.postMessage(tt):et.Android?et.Android.receiveMessage(JSON.stringify(tt)):et.parent.postMessage(tt,"*")}postMessage$2.postMessage=postMessage$1;function addEventer(tt){var et=window;if(et.sendToElectron){et.EE&&et.EE.once("sphinx-bridge",tt);return}else et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?document.addEventListener("message",function(nt){var it={};try{it=JSON.parse(nt.data)}catch{}tt({data:it})}):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx?et.sphinxMessage=function(nt){var it={};try{it=JSON.parse(nt)}catch{}tt({data:it})}:et.Android?et.sphinxMessage=function(nt){var it={};try{it=JSON.parse(nt)}catch{}tt({data:it})}:et.addEventListener("message",tt)}postMessage$2.addEventer=addEventer;function removeEventer(tt){var et=window;et.sendToElectron||(et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?document.removeEventListener("message",tt):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx||et.Android?et.sphinxMessage=null:et.removeEventListener("message",tt))}postMessage$2.removeEventer=removeEventer;(function(tt){var et=commonjsGlobal&&commonjsGlobal.__assign||function(){return et=Object.assign||function(lt){for(var ct,ut=1,ht=arguments.length;ut0&&pt[pt.length-1])&&(yt[0]===6||yt[0]===2)){ut=0;continue}if(yt[0]===3&&(!pt||yt[1]>pt[0]&&yt[1] ENABLE!"),this.isEnabled)return[2,{budget:this.budget,pubkey:this.pubkey,application:at}];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.AUTHORIZE)];case 2:return ut=dt.sent(),ut.pubkey?(this.isEnabled=!0,this.pubkey=ut.pubkey,[2,ut]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[3,4];case 4:return[2,null]}})})},lt.prototype.authorize=function(ct,ut,ht){return nt(this,void 0,void 0,function(){var dt,pt,mt,gt;return it(this,function(bt){switch(bt.label){case 0:ht&&(this.logging=!0),this.logging&&console.log("=> AUTHORIZE!"),bt.label=1;case 1:return bt.trys.push([1,3,,4]),dt=ut||!1,[4,this.postMsg(ot.AUTHORIZE,{challenge:ct,noBudget:dt})];case 2:return pt=bt.sent(),mt=pt.budget||pt.budget===0,(dt||mt)&&pt.pubkey?(this.isEnabled=!0,this.budget=pt.budget||0,this.pubkey=pt.pubkey,[2,pt]):[3,4];case 3:return gt=bt.sent(),this.logging&&console.log(gt),[3,4];case 4:return[2,null]}})})},lt.prototype.topup=function(){return nt(this,void 0,void 0,function(){var ct,ut,ht;return it(this,function(dt){switch(dt.label){case 0:this.logging&&console.log("=> TOP UP"),dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SETBUDGET)];case 2:return ct=dt.sent(),ut=ct.budget||ct.budget===0,ut?(this.budget=ct.budget,[2,ct]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[3,4];case 4:return[2,null]}})})},lt.prototype.keysend=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt,pt;return it(this,function(mt){switch(mt.label){case 0:if(this.logging&&console.log("=> KEYSEND"),!this.isEnabled)return[2,null];if(!ct||!ut)return[2,null];if(ct.length!==66)return[2,null];if(ut<1)return[2,null];if(ut>this.budget)return[2,null];mt.label=1;case 1:return mt.trys.push([1,3,,4]),ht={dest:ct,amt:ut},[4,this.postMsg(ot.KEYSEND,ht)];case 2:return dt=mt.sent(),dt&&dt.success&&(this.budget=this.budget-ut,dt.budget=this.budget),[2,dt];case 3:return pt=mt.sent(),this.logging&&console.log(pt),[2,null];case 4:return[2]}})})},lt.prototype.updated=function(){return nt(this,void 0,void 0,function(){var ct,ut;return it(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> UDPATED"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.UPDATED)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.sendPayment=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SEND PAYMENT"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.PAYMENT,{paymentRequest:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.saveLsat=function(ct,ut,ht){return nt(this,void 0,void 0,function(){var dt,pt;return it(this,function(mt){switch(mt.label){case 0:this.logging&&console.log("=> SAVE LSAT"),mt.label=1;case 1:return mt.trys.push([1,3,,4]),[4,this.postMsg(ot.LSAT,{paymentRequest:ct,macaroon:ut,issuer:ht})];case 2:return dt=mt.sent(),[2,dt];case 3:return pt=mt.sent(),this.logging&&console.log(pt),[2,pt];case 4:return[2]}})})},lt.prototype.getLsat=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> GET LSAT"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.GETLSAT,{issuer:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,ht];case 4:return[2]}})})},lt.prototype.updateLsat=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return it(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> UPDATE LSAT"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.UPDATELSAT,{identifier:ct,status:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,dt];case 4:return[2]}})})},lt.prototype.makeInvoice=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return it(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> MAKE INVOICE"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.INVOICE,{amt:ct,memo:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,null];case 4:return[2]}})})},lt.prototype.signMessage=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SIGN MESSAGE"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SIGN,{message:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.verifyMessage=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return it(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> VERIFY MESSAGE"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.SIGN,{signature:ct,message:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,null];case 4:return[2]}})})},lt.prototype.reload=function(ct){return nt(this,void 0,void 0,function(){var ut,ht,dt;return it(this,function(pt){switch(pt.label){case 0:this.logging&&console.log("=> RELOAD"),pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.RELOAD,{password:ct})];case 2:return ut=pt.sent(),ht=ut.budget||ut.budget===0,ht&&ut.pubkey?(this.isEnabled=!0,this.budget=ut.budget,this.pubkey=ut.pubkey,[2,ut]):[3,4];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[3,4];case 4:return[2,null]}})})},lt.prototype.saveGraphData=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SAVEDATA"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SAVEDATA,{data:{type:ct.type,metaData:ct.metaData}})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.getPersonData=function(){return nt(this,void 0,void 0,function(){var ct,ut;return it(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> GETPERSONDATA"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.GETPERSONDATA)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.getBudget=function(){return nt(this,void 0,void 0,function(){var ct,ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> GETBUDGET"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.GETBUDGET)];case 2:return ct=dt.sent(),ut=ct.budget||ct.budget===0,ut?(this.budget=ct.budget,[2,ct]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.setBudget=function(){return nt(this,void 0,void 0,function(){var ct,ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SETBUDGET"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SETBUDGET)];case 2:return ct=dt.sent(),ut=ct.budget||ct.budget===0,ut?(this.budget=ct.budget,[2,ct]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.postMsg=function(ct,ut){var ht,dt=this;dt.active&&Promise.reject(new Error("User is busy")),dt.active=ct;var pt=window;return!((ht=pt.kmpJsBridge)===null||ht===void 0)&&ht.callNative?new Promise(function(mt,gt){pt.kmpJsBridge.callNative("sphinx-bridge",JSON.stringify(et({application:at,type:ct},ut||{})),function(bt){var yt={};try{yt=JSON.parse(bt)}catch{}yt||yt.application!==at||(dt.active=null,yt.error?gt(yt.error):mt(yt))})}):new Promise(function(mt,gt){rt.postMessage(et({application:at,type:ct},ut||{}));function bt(yt){!yt.data||yt.data.application!==at||(yt.data.error?(dt.active=null,gt(yt.data.error)):(dt.active=null,mt(yt.data)),rt.removeEventer(bt))}rt.addEventer(bt)})},lt}();tt.default=st})(lib$3);var dist$3=dist$4.exports;Object.defineProperty(dist$3,"__esModule",{value:!0});var lib_1=lib$3,sphinx=new lib_1.default;dist$4.exports=sphinx;var distExports$1=dist$4.exports,reactIs$3={exports:{}},reactIs_production_min$2={};/** + */var split=splitString,extend$5=extendShallow,isPlainObject$6=isPlainObject$8,isObject$m=isExtendable,setValue=function(tt,et,nt){if(!isObject$m(tt)||(Array.isArray(et)&&(et=[].concat.apply([],et).join(".")),typeof et!="string"))return tt;for(var it=split(et,{sep:".",brackets:!0}).filter(isValidKey),rt=it.length,ot=-1,at=tt;++ottt.filter(Boolean).join(".");function getKeyPath(tt){const et=tt.split(".");return[et.pop(),et.join(".")||void 0]}function getValuesForPaths(tt,et){return Object.entries(pick$1(tt,et)).reduce((nt,[,{value:it,disabled:rt,key:ot}])=>(nt[ot]=rt?void 0:it,nt),{})}function useCompareMemoize(tt,et){const nt=reactExports.useRef();return(et?dequal:shallow$2)(tt,nt.current)||(nt.current=tt),nt.current}function useDeepMemo(tt,et){return reactExports.useMemo(tt,useCompareMemoize(et,!0))}function useToggle(tt){const et=reactExports.useRef(null),nt=reactExports.useRef(null),it=reactExports.useRef(!0);return reactExports.useLayoutEffect(()=>{tt||(et.current.style.height="0px",et.current.style.overflow="hidden")},[]),reactExports.useEffect(()=>{if(it.current){it.current=!1;return}let rt;const ot=et.current,at=()=>{tt&&(ot.style.removeProperty("height"),ot.style.removeProperty("overflow"),nt.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};ot.addEventListener("transitionend",at,{once:!0});const{height:st}=nt.current.getBoundingClientRect();return ot.style.height=st+"px",tt||(ot.style.overflow="hidden",rt=window.setTimeout(()=>ot.style.height="0px",50)),()=>{ot.removeEventListener("transitionend",at),clearTimeout(rt)}},[tt]),{wrapperRef:et,contentRef:nt}}const useVisiblePaths=tt=>{const[et,nt]=reactExports.useState(tt.getVisiblePaths());return reactExports.useEffect(()=>{nt(tt.getVisiblePaths());const it=tt.useStore.subscribe(tt.getVisiblePaths,nt,{equalityFn:shallow$2});return()=>it()},[tt]),et};function useValuesForPath(tt,et,nt){return tt.useStore(rt=>{const ot=_objectSpread2$1(_objectSpread2$1({},nt),rt.data);return getValuesForPaths(ot,et)},shallow$2)}function usePopin(tt=3){const et=reactExports.useRef(null),nt=reactExports.useRef(null),[it,rt]=reactExports.useState(!1),ot=reactExports.useCallback(()=>rt(!0),[]),at=reactExports.useCallback(()=>rt(!1),[]);return reactExports.useLayoutEffect(()=>{if(it){const{bottom:st,top:lt,left:ct}=et.current.getBoundingClientRect(),{height:ut}=nt.current.getBoundingClientRect(),ht=st+ut>window.innerHeight-40?"up":"down";nt.current.style.position="fixed",nt.current.style.zIndex="10000",nt.current.style.left=ct+"px",ht==="down"?nt.current.style.top=st+tt+"px":nt.current.style.bottom=window.innerHeight-lt+tt+"px"}},[tt,it]),{popinRef:et,wrapperRef:nt,shown:it,show:ot,hide:at}}k$9([namesPlugin]);const convertMap={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};v8n.extend({color:()=>tt=>w$6(tt).isValid()});const schema$2=tt=>v8n().color().test(tt);function convert$6(tt,{format:et,hasAlpha:nt,isString:it}){const rt=convertMap[et]+(it&&et!=="hex"?"String":""),ot=tt[rt]();return typeof ot=="object"&&!nt?omit$1(ot,["a"]):ot}const sanitize$2=(tt,et)=>{const nt=w$6(tt);if(!nt.isValid())throw Error("Invalid color");return convert$6(nt,et)},format$1$1=(tt,et)=>convert$6(w$6(tt),_objectSpread2$1(_objectSpread2$1({},et),{},{isString:!0,format:"hex"})),normalize$3$1=({value:tt})=>{const et=I$2(tt),nt=et==="name"?"hex":et,it=typeof tt=="object"?"a"in tt:et==="hex"&&tt.length===8||/^(rgba)|(hsla)|(hsva)/.test(tt),rt={format:nt,hasAlpha:it,isString:typeof tt=="string"};return{value:sanitize$2(tt,rt),settings:rt}};var props$2=Object.freeze({__proto__:null,schema:schema$2,sanitize:sanitize$2,format:format$1$1,normalize:normalize$3$1});const ColorPreview=styled$5("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),PickerContainer=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),PickerWrapper=styled$5("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function convertToRgb(tt,et){return et!=="rgb"?w$6(tt).toRgb():tt}function Color$2({value:tt,displayValue:et,settings:nt,onUpdate:it}){const{emitOnEditStart:rt,emitOnEditEnd:ot}=useInputContext(),{format:at,hasAlpha:st}=nt,{popinRef:lt,wrapperRef:ct,shown:ut,show:ht,hide:dt}=usePopin(),pt=reactExports.useRef(0),[mt,gt]=reactExports.useState(()=>convertToRgb(tt,at)),bt=st?Ce:Ne$1,yt=()=>{gt(convertToRgb(tt,at)),ht(),rt()},wt=()=>{dt(),ot(),window.clearTimeout(pt.current)},vt=()=>{pt.current=window.setTimeout(wt,500)};return reactExports.useEffect(()=>()=>window.clearTimeout(pt.current),[]),React$1.createElement(React$1.Fragment,null,React$1.createElement(ColorPreview,{ref:lt,active:ut,onClick:()=>yt(),style:{color:et}}),ut&&React$1.createElement(Portal$1,null,React$1.createElement(Overlay$1,{onPointerUp:wt}),React$1.createElement(PickerWrapper,{ref:ct,onMouseEnter:()=>window.clearTimeout(pt.current),onMouseLeave:xt=>xt.buttons===0&&vt()},React$1.createElement(bt,{color:mt,onChange:it}))))}function ColorComponent(){const{value:tt,displayValue:et,label:nt,onChange:it,onUpdate:rt,settings:ot}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,nt),React$1.createElement(PickerContainer,null,React$1.createElement(Color$2,{value:tt,displayValue:et,onChange:it,onUpdate:rt,settings:ot}),React$1.createElement(ValueInput,{value:et,onChange:it,onUpdate:rt})))}var color$4=_objectSpread2$1({component:ColorComponent},props$2);function Vector3dComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:it}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Vector,{value:et,settings:it,onUpdate:nt}))}var vector3d=_objectSpread2$1({component:Vector3dComponent},getVectorPlugin(["x","y","z"]));const JoystickTrigger=styled$5("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),JoystickPlayground=styled$5("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function Joystick({value:tt,settings:et,onUpdate:nt}){const it=reactExports.useRef(),rt=reactExports.useRef(0),ot=reactExports.useRef(0),at=reactExports.useRef(1),[st,lt]=reactExports.useState(!1),[ct,ut]=reactExports.useState(!1),[ht,dt]=useTransform(),pt=reactExports.useRef(null),mt=reactExports.useRef(null);reactExports.useLayoutEffect(()=>{if(st){const{top:Ot,left:jt,width:kt,height:Tt}=pt.current.getBoundingClientRect();mt.current.style.left=jt+kt/2+"px",mt.current.style.top=Ot+Tt/2+"px"}},[st]);const{keys:[gt,bt],joystick:yt}=et,wt=yt==="invertY"?1:-1,{[gt]:{step:vt},[bt]:{step:xt}}=et,St=useTh("sizes","joystickWidth"),Et=useTh("sizes","joystickHeight"),$t=parseFloat(St)*.8/2,It=parseFloat(Et)*.8/2,Ft=reactExports.useCallback(()=>{it.current||(ut(!0),rt.current&&dt({x:rt.current*$t}),ot.current&&dt({y:ot.current*-It}),it.current=window.setInterval(()=>{nt(Ot=>{const jt=vt*rt.current*at.current,kt=wt*xt*ot.current*at.current;return Array.isArray(Ot)?{[gt]:Ot[0]+jt,[bt]:Ot[1]+kt}:{[gt]:Ot[gt]+jt,[bt]:Ot[bt]+kt}})},16))},[$t,It,nt,dt,vt,xt,gt,bt,wt]),Ht=reactExports.useCallback(()=>{window.clearTimeout(it.current),it.current=void 0,ut(!1)},[]);reactExports.useEffect(()=>{function Ot(jt){at.current=multiplyStep(jt)}return window.addEventListener("keydown",Ot),window.addEventListener("keyup",Ot),()=>{window.clearTimeout(it.current),window.removeEventListener("keydown",Ot),window.removeEventListener("keyup",Ot)}},[]);const zt=useDrag$1(({first:Ot,active:jt,delta:[kt,Tt],movement:[Ct,Ut]})=>{Ot&<(!0);const Nt=clamp$7(Ct,-$t,$t),Bt=clamp$7(Ut,-It,It);rt.current=Math.abs(Ct)>Math.abs(Nt)?Math.sign(Ct-Nt):0,ot.current=Math.abs(Ut)>Math.abs(Bt)?Math.sign(Bt-Ut):0;let Mt=tt[gt],Dt=tt[bt];jt?(rt.current||(Mt+=kt*vt*at.current,dt({x:Nt})),ot.current||(Dt-=wt*Tt*xt*at.current,dt({y:Bt})),rt.current||ot.current?Ft():Ht(),nt({[gt]:Mt,[bt]:Dt})):(lt(!1),rt.current=0,ot.current=0,dt({x:0,y:0}),Ht())});return React$1.createElement(JoystickTrigger,_extends$s({ref:pt},zt()),st&&React$1.createElement(Portal$1,null,React$1.createElement(JoystickPlayground,{ref:mt,isOutOfBounds:ct},React$1.createElement("div",null),React$1.createElement("span",{ref:ht}))))}const Container$1=styled$5("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function Vector2dComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:it}=useInputContext();return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Container$1,{withJoystick:!!it.joystick},it.joystick&&React$1.createElement(Joystick,{value:et,settings:it,onUpdate:nt}),React$1.createElement(Vector,{value:et,settings:it,onUpdate:nt})))}const _excluded$7$1=["joystick"],plugin=getVectorPlugin(["x","y"]),normalize$2$1=tt=>{let{joystick:et=!0}=tt,nt=_objectWithoutProperties$l(tt,_excluded$7$1);const{value:it,settings:rt}=plugin.normalize(nt);return{value:it,settings:_objectSpread2$1(_objectSpread2$1({},rt),{},{joystick:et})}};var vector2d=_objectSpread2$1(_objectSpread2$1({component:Vector2dComponent},plugin),{},{normalize:normalize$2$1});const sanitize$1=tt=>{if(tt!==void 0){if(tt instanceof File)try{return URL.createObjectURL(tt)}catch{return}if(typeof tt=="string"&&tt.indexOf("blob:")===0)return tt;throw Error("Invalid image format [undefined | blob | File].")}},schema$1=(tt,et)=>typeof et=="object"&&"image"in et,normalize$1$1=({image:tt})=>({value:tt});var props$1=Object.freeze({__proto__:null,sanitize:sanitize$1,schema:schema$1,normalize:normalize$1$1});const ImageContainer=styled$5("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),DropZone=styled$5("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),ImagePreview=styled$5("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),ImageLargePreview=styled$5("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),Instructions=styled$5("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),Remove=styled$5("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function ImageComponent(){const{label:tt,value:et,onUpdate:nt,disabled:it}=useInputContext(),{popinRef:rt,wrapperRef:ot,shown:at,show:st,hide:lt}=usePopin(),ct=reactExports.useCallback(mt=>{mt.length&&nt(mt[0])},[nt]),ut=reactExports.useCallback(mt=>{mt.stopPropagation(),nt(void 0)},[nt]),{getRootProps:ht,getInputProps:dt,isDragAccept:pt}=useDropzone({maxFiles:1,accept:"image/*",onDrop:ct,disabled:it});return React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(ImageContainer,null,React$1.createElement(ImagePreview,{ref:rt,hasImage:!!et,onPointerDown:()=>!!et&&st(),onPointerUp:lt,style:{backgroundImage:et?`url(${et})`:"none"}}),at&&!!et&&React$1.createElement(Portal$1,null,React$1.createElement(Overlay$1,{onPointerUp:lt,style:{cursor:"pointer"}}),React$1.createElement(ImageLargePreview,{ref:ot,style:{backgroundImage:`url(${et})`}})),React$1.createElement(DropZone,ht({isDragAccept:pt}),React$1.createElement("input",dt()),React$1.createElement(Instructions,null,pt?"drop image":"click or drop")),React$1.createElement(Remove,{onClick:ut,disabled:!et})))}var image$1=_objectSpread2$1({component:ImageComponent},props$1);const number$6=v8n().number(),schema=(tt,et)=>v8n().array().length(2).every.number().test(tt)&&v8n().schema({min:number$6,max:number$6}).test(et),format$2=tt=>({min:tt[0],max:tt[1]}),sanitize=(tt,{bounds:[et,nt]},it)=>{const rt=Array.isArray(tt)?format$2(tt):tt,ot={min:it[0],max:it[1]},{min:at,max:st}=_objectSpread2$1(_objectSpread2$1({},ot),rt);return[clamp$7(Number(at),et,Math.max(et,st)),clamp$7(Number(st),Math.min(nt,at),nt)]},normalize$5=({value:tt,min:et,max:nt})=>{const it={min:et,max:nt},rt=normalizeKeyedNumberSettings(format$2(tt),{min:it,max:it}),ot=[et,nt],at=_objectSpread2$1(_objectSpread2$1({},rt),{},{bounds:ot});return{value:sanitize(format$2(tt),at,tt),settings:at}};var props$3=Object.freeze({__proto__:null,schema,format:format$2,sanitize,normalize:normalize$5});const _excluded$6$1=["value","bounds","onDrag"],_excluded2$1$1=["bounds"],Container$2=styled$5("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function IntervalSlider(tt){let{value:et,bounds:[nt,it],onDrag:rt}=tt,ot=_objectWithoutProperties$l(tt,_excluded$6$1);const at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useRef(null),ct=reactExports.useRef(0),ut=useTh("sizes","scrubberWidth"),ht=useDrag$1(({event:mt,first:gt,xy:[bt],movement:[yt],memo:wt={}})=>{if(gt){const{width:xt,left:St}=at.current.getBoundingClientRect();ct.current=xt-parseFloat(ut);const Et=(mt==null?void 0:mt.target)===st.current||(mt==null?void 0:mt.target)===lt.current;wt.pos=invertedRange((bt-St)/xt,nt,it);const $t=Math.abs(wt.pos-et.min)-Math.abs(wt.pos-et.max);wt.key=$t<0||$t===0&&wt.pos<=et.min?"min":"max",Et&&(wt.pos=et[wt.key])}const vt=wt.pos+invertedRange(yt/ct.current,0,it-nt);return rt({[wt.key]:sanitizeStep(vt,ot[wt.key])}),wt}),dt=`calc(${range$9(et.min,nt,it)} * (100% - ${ut} - 8px) + 4px)`,pt=`calc(${1-range$9(et.max,nt,it)} * (100% - ${ut} - 8px) + 4px)`;return React$1.createElement(RangeWrapper,_extends$s({ref:at},ht()),React$1.createElement(Range,null,React$1.createElement(Indicator,{style:{left:dt,right:pt}})),React$1.createElement(Scrubber,{position:"left",ref:st,style:{left:dt}}),React$1.createElement(Scrubber,{position:"right",ref:lt,style:{right:pt}}))}function IntervalComponent(){const{label:tt,displayValue:et,onUpdate:nt,settings:it}=useInputContext(),rt=_objectWithoutProperties$l(it,_excluded2$1$1);return React$1.createElement(React$1.Fragment,null,React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,null,tt),React$1.createElement(Container$2,null,React$1.createElement(IntervalSlider,_extends$s({value:et},it,{onDrag:nt})),React$1.createElement(Vector,{value:et,settings:rt,onUpdate:nt,innerLabelTrim:0}))))}var interval$1=_objectSpread2$1({component:IntervalComponent},props$3);const createEventEmitter=()=>{const tt=new Map;return{on:(et,nt)=>{let it=tt.get(et);it===void 0&&(it=new Set,tt.set(et,it)),it.add(nt)},off:(et,nt)=>{const it=tt.get(et);it!==void 0&&(it.delete(nt),it.size===0&&tt.delete(et))},emit:(et,...nt)=>{const it=tt.get(et);if(it!==void 0)for(const rt of it)rt(...nt)}}},_excluded$5$1=["type","value"],_excluded2$a=["onChange","transient","onEditStart","onEditEnd"],Store=function(){const et=create$8(subscribeWithSelector(()=>({data:{}}))),nt=createEventEmitter();this.storeId=getUid(),this.useStore=et;const it={},rt=new Set;this.getVisiblePaths=()=>{const at=this.getData(),st=Object.keys(at),lt=[];Object.entries(it).forEach(([ut,ht])=>{ht.render&&st.some(dt=>dt.indexOf(ut)===0)&&!ht.render(this.get)&<.push(ut+".")});const ct=[];return rt.forEach(ut=>{ut in at&&at[ut].__refCount>0&<.every(ht=>ut.indexOf(ht)===-1)&&(!at[ut].render||at[ut].render(this.get))&&ct.push(ut)}),ct},this.setOrderedPaths=at=>{at.forEach(st=>rt.add(st))},this.orderPaths=at=>(this.setOrderedPaths(at),at),this.disposePaths=at=>{et.setState(st=>{const lt=st.data;return at.forEach(ct=>{if(ct in lt){const ut=lt[ct];ut.__refCount--,ut.__refCount===0&&ut.type in SpecialInputs&&delete lt[ct]}}),{data:lt}})},this.dispose=()=>{et.setState(()=>({data:{}}))},this.getFolderSettings=at=>it[at]||{},this.getData=()=>et.getState().data,this.addData=(at,st)=>{et.setState(lt=>{const ct=lt.data;return Object.entries(at).forEach(([ut,ht])=>{let dt=ct[ut];if(dt){const{type:pt,value:mt}=ht,gt=_objectWithoutProperties$l(ht,_excluded$5$1);pt!==dt.type?warn$3(LevaErrors.INPUT_TYPE_OVERRIDE,pt):((dt.__refCount===0||st)&&Object.assign(dt,gt),dt.__refCount++)}else ct[ut]=_objectSpread2$1(_objectSpread2$1({},ht),{},{__refCount:1})}),{data:ct}})},this.setValueAtPath=(at,st,lt)=>{et.setState(ct=>{const ut=ct.data;return updateInput(ut[at],st,at,this,lt),{data:ut}})},this.setSettingsAtPath=(at,st)=>{et.setState(lt=>{const ct=lt.data;return ct[at].settings=_objectSpread2$1(_objectSpread2$1({},ct[at].settings),st),{data:ct}})},this.disableInputAtPath=(at,st)=>{et.setState(lt=>{const ct=lt.data;return ct[at].disabled=st,{data:ct}})},this.set=(at,st)=>{et.setState(lt=>{const ct=lt.data;return Object.entries(at).forEach(([ut,ht])=>{try{updateInput(ct[ut],ht,void 0,void 0,st)}catch{}}),{data:ct}})},this.getInput=at=>{try{return this.getData()[at]}catch{warn$3(LevaErrors.PATH_DOESNT_EXIST,at)}},this.get=at=>{var st;return(st=this.getInput(at))===null||st===void 0?void 0:st.value},this.emitOnEditStart=at=>{nt.emit(`onEditStart:${at}`,this.get(at),at,_objectSpread2$1(_objectSpread2$1({},this.getInput(at)),{},{get:this.get}))},this.emitOnEditEnd=at=>{nt.emit(`onEditEnd:${at}`,this.get(at),at,_objectSpread2$1(_objectSpread2$1({},this.getInput(at)),{},{get:this.get}))},this.subscribeToEditStart=(at,st)=>{const lt=`onEditStart:${at}`;return nt.on(lt,st),()=>nt.off(lt,st)},this.subscribeToEditEnd=(at,st)=>{const lt=`onEditEnd:${at}`;return nt.on(lt,st),()=>nt.off(lt,st)};const ot=(at,st,lt)=>{const ct={};return Object.entries(at).forEach(([ut,ht])=>{if(ut==="")return warn$3(LevaErrors.EMPTY_KEY);let dt=join$1(st,ut);if(ht.type===SpecialInputs.FOLDER){const pt=ot(ht.schema,dt,lt);Object.assign(ct,pt),dt in it||(it[dt]=ht.settings)}else if(ut in lt)warn$3(LevaErrors.DUPLICATE_KEYS,ut,dt,lt[ut].path);else{const pt=normalizeInput(ht,ut,dt,ct);if(pt){const{type:mt,options:gt,input:bt}=pt,{onChange:yt,transient:wt,onEditStart:vt,onEditEnd:xt}=gt,St=_objectWithoutProperties$l(gt,_excluded2$a);ct[dt]=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({type:mt},St),bt),{},{fromPanel:!0}),lt[ut]={path:dt,onChange:yt,transient:wt,onEditStart:vt,onEditEnd:xt}}else warn$3(LevaErrors.UNKNOWN_INPUT,dt,ht)}}),ct};this.getDataFromSchema=at=>{const st={};return[ot(at,"",st),st]}},levaStore=new Store,defaultSettings$2={collapsed:!1};function folder(tt,et){return{type:SpecialInputs.FOLDER,schema:tt,settings:_objectSpread2$1(_objectSpread2$1({},defaultSettings$2),et)}}const isInput=tt=>"__levaInput"in tt,buildTree=(tt,et)=>{const nt={},it=et?et.toLowerCase():null;return tt.forEach(rt=>{const[ot,at]=getKeyPath(rt);(!it||ot.toLowerCase().indexOf(it)>-1)&&merge$3(nt,at,{[ot]:{__levaInput:!0,path:rt}})}),nt},_excluded$4$1=["type","label","path","valueKey","value","settings","setValue","disabled"];function ControlInput(tt){let{type:et,label:nt,path:it,valueKey:rt,value:ot,settings:at,setValue:st,disabled:lt}=tt,ct=_objectWithoutProperties$l(tt,_excluded$4$1);const{displayValue:ut,onChange:ht,onUpdate:dt}=useInputSetters({type:et,value:ot,settings:at,setValue:st}),pt=Plugins[et].component;return pt?React$1.createElement(InputContext.Provider,{value:_objectSpread2$1({key:rt,path:it,id:""+it,label:nt,displayValue:ut,value:ot,onChange:ht,onUpdate:dt,settings:at,setValue:st,disabled:lt},ct)},React$1.createElement(StyledInputWrapper$1,{disabled:lt},React$1.createElement(pt,null))):(warn$3(LevaErrors.NO_COMPONENT_FOR_TYPE,et,it),null)}const StyledButton$8=styled$5("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function Button$3({onClick:tt,settings:et,label:nt}){const it=useStoreContext();return React$1.createElement(Row,null,React$1.createElement(StyledButton$8,{disabled:et.disabled,onClick:()=>tt(it.get)},nt))}const StyledButtonGroup=styled$5("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),StyledButtonGroupButton=styled$5("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),getOpts=({label:tt,opts:et})=>{let nt=typeof tt=="string"&&tt.trim()===""?null:tt,it=et;return typeof et.opts=="object"&&(it.label!==void 0&&(nt=et.label),it=et.opts),{label:nt,opts:it}};function ButtonGroup(tt){const{label:et,opts:nt}=getOpts(tt),it=useStoreContext();return React$1.createElement(Row,{input:!!et},et&&React$1.createElement(Label$2,null,et),React$1.createElement(StyledButtonGroup,null,Object.entries(nt).map(([rt,ot])=>React$1.createElement(StyledButtonGroupButton,{key:rt,onClick:()=>ot(it.get)},rt))))}const Canvas$1=styled$5("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),POINTS=100;function push$1(tt,et){tt.push(et),tt.length>POINTS&&tt.shift()}const MonitorCanvas=reactExports.forwardRef(function({initialValue:tt},et){const nt=useTh("colors","highlight3"),it=useTh("colors","elevation2"),rt=useTh("colors","highlight1"),[ot,at]=reactExports.useMemo(()=>[w$6(rt).alpha(.4).toRgbString(),w$6(rt).alpha(.1).toRgbString()],[rt]),st=reactExports.useRef([tt]),lt=reactExports.useRef(tt),ct=reactExports.useRef(tt),ut=reactExports.useRef(),ht=reactExports.useCallback((mt,gt)=>{if(!mt)return;const{width:bt,height:yt}=mt,wt=new Path2D,vt=bt/POINTS,xt=yt*.05;for(let $t=0;$t({frame:mt=>{(lt.current===void 0||mtct.current)&&(ct.current=mt),push$1(st.current,mt),ut.current=requestAnimationFrame(()=>ht(dt.current,pt.current))}}),[dt,pt,ht]),reactExports.useEffect(()=>()=>cancelAnimationFrame(ut.current),[]),React$1.createElement(Canvas$1,{ref:dt})}),parse$3=tt=>Number.isFinite(tt)?tt.toPrecision(2):tt.toString(),MonitorLog=reactExports.forwardRef(function({initialValue:tt},et){const[nt,it]=reactExports.useState(parse$3(tt));return reactExports.useImperativeHandle(et,()=>({frame:rt=>it(parse$3(rt))}),[]),React$1.createElement("div",null,nt)});function getValue$4(tt){return typeof tt=="function"?tt():tt.current}function Monitor({label:tt,objectOrFn:et,settings:nt}){const it=reactExports.useRef(),rt=reactExports.useRef(getValue$4(et));return reactExports.useEffect(()=>{const ot=window.setInterval(()=>{var at;document.hidden||(at=it.current)===null||at===void 0||at.frame(getValue$4(et))},nt.interval);return()=>window.clearInterval(ot)},[et,nt.interval]),React$1.createElement(Row,{input:!0},React$1.createElement(Label$2,{align:"top"},tt),nt.graph?React$1.createElement(MonitorCanvas,{ref:it,initialValue:rt.current}):React$1.createElement(MonitorLog,{ref:it,initialValue:rt.current}))}const _excluded$3$1=["type","label","key"],specialComponents={[SpecialInputs.BUTTON]:Button$3,[SpecialInputs.BUTTON_GROUP]:ButtonGroup,[SpecialInputs.MONITOR]:Monitor},Control=React$1.memo(({path:tt})=>{const[et,{set:nt,setSettings:it,disable:rt,storeId:ot,emitOnEditStart:at,emitOnEditEnd:st}]=useInput(tt);if(!et)return null;const{type:lt,label:ct,key:ut}=et,ht=_objectWithoutProperties$l(et,_excluded$3$1);if(lt in SpecialInputs){const dt=specialComponents[lt];return React$1.createElement(dt,_extends$s({label:ct,path:tt},ht))}return lt in Plugins?React$1.createElement(ControlInput,_extends$s({key:ot+tt,type:lt,label:ct,storeId:ot,path:tt,valueKey:ut,setValue:nt,setSettings:it,disable:rt,emitOnEditStart:at,emitOnEditEnd:st},ht)):(log$2(LevaErrors.UNSUPPORTED_INPUT,lt,tt),null)});function FolderTitle({toggle:tt,toggled:et,name:nt}){return React$1.createElement(StyledTitle,{onClick:()=>tt()},React$1.createElement(Chevron,{toggled:et}),React$1.createElement("div",null,nt))}const Folder=({name:tt,path:et,tree:nt})=>{const it=useStoreContext(),rt=join$1(et,tt),{collapsed:ot,color:at}=it.getFolderSettings(rt),[st,lt]=reactExports.useState(!ot),ct=reactExports.useRef(null),ut=useTh("colors","folderWidgetColor"),ht=useTh("colors","folderTextColor");return reactExports.useLayoutEffect(()=>{ct.current.style.setProperty("--leva-colors-folderWidgetColor",at||ut),ct.current.style.setProperty("--leva-colors-folderTextColor",at||ht)},[at,ut,ht]),React$1.createElement(StyledFolder,{ref:ct},React$1.createElement(FolderTitle,{name:tt,toggled:st,toggle:()=>lt(dt=>!dt)}),React$1.createElement(TreeWrapper,{parent:rt,tree:nt,toggled:st}))},TreeWrapper=React$1.memo(({isRoot:tt=!1,fill:et=!1,flat:nt=!1,parent:it,tree:rt,toggled:ot})=>{const{wrapperRef:at,contentRef:st}=useToggle(ot),lt=useStoreContext(),ct=([ht,dt])=>{var pt;return(isInput(dt)?(pt=lt.getInput(dt.path))===null||pt===void 0?void 0:pt.order:lt.getFolderSettings(join$1(it,ht)).order)||0},ut=Object.entries(rt).sort((ht,dt)=>ct(ht)-ct(dt));return React$1.createElement(StyledWrapper,{ref:at,isRoot:tt,fill:et,flat:nt},React$1.createElement(StyledContent,{ref:st,isRoot:tt,toggled:ot},ut.map(([ht,dt])=>isInput(dt)?React$1.createElement(Control,{key:dt.path,valueKey:dt.valueKey,path:dt.path}):React$1.createElement(Folder,{key:ht,name:ht,path:it,tree:dt}))))}),StyledRoot=styled$5("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${StyledInputRow}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),iconWidth=40,Icon=styled$5("i",{$flexCenter:"",width:iconWidth,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),StyledTitleWithFilter=styled$5("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),FilterWrapper=styled$5("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${Icon}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),StyledFilterInput=styled$5("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),TitleContainer=styled$5("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:iconWidth}}}}),FilterInput=React$1.forwardRef(({setFilter:tt,toggle:et},nt)=>{const[it,rt]=reactExports.useState(""),ot=reactExports.useMemo(()=>debounce$5(tt,250),[tt]),at=()=>{tt(""),rt("")},st=lt=>{const ct=lt.currentTarget.value;et(!0),rt(ct)};return reactExports.useEffect(()=>{ot(it)},[it,ot]),React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledFilterInput,{ref:nt,value:it,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:lt=>lt.stopPropagation(),onChange:st}),React$1.createElement(Icon,{onClick:()=>at(),style:{visibility:it?"visible":"hidden"}},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},React$1.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function TitleWithFilter({setFilter:tt,onDrag:et,onDragStart:nt,onDragEnd:it,toggle:rt,toggled:ot,title:at,drag:st,filterEnabled:lt,from:ct}){const[ut,ht]=reactExports.useState(!1),dt=reactExports.useRef(null);reactExports.useEffect(()=>{var mt,gt;ut?(mt=dt.current)===null||mt===void 0||mt.focus():(gt=dt.current)===null||gt===void 0||gt.blur()},[ut]);const pt=useDrag$1(({offset:[mt,gt],first:bt,last:yt})=>{et({x:mt,y:gt}),bt&&nt({x:mt,y:gt}),yt&&it({x:mt,y:gt})},{filterTaps:!0,from:({offset:[mt,gt]})=>[(ct==null?void 0:ct.x)||mt,(ct==null?void 0:ct.y)||gt]});return reactExports.useEffect(()=>{const mt=gt=>{gt.key==="L"&>.shiftKey&>.metaKey&&ht(bt=>!bt)};return window.addEventListener("keydown",mt),()=>window.removeEventListener("keydown",mt)},[]),React$1.createElement(React$1.Fragment,null,React$1.createElement(StyledTitleWithFilter,{mode:st?"drag":void 0},React$1.createElement(Icon,{active:!ot,onClick:()=>rt()},React$1.createElement(Chevron,{toggled:ot,width:12,height:8})),React$1.createElement(TitleContainer,_extends$s({},st?pt():{},{drag:st,filterEnabled:lt}),at===void 0&&st?React$1.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},React$1.createElement("circle",{cx:"2",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"14",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"26",cy:"2",r:"2"}),React$1.createElement("circle",{cx:"2",cy:"12",r:"2"}),React$1.createElement("circle",{cx:"14",cy:"12",r:"2"}),React$1.createElement("circle",{cx:"26",cy:"12",r:"2"})):at),lt&&React$1.createElement(Icon,{active:ut,onClick:()=>ht(mt=>!mt)},React$1.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},React$1.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),React$1.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),React$1.createElement(FilterWrapper,{toggled:ut},React$1.createElement(FilterInput,{ref:dt,setFilter:tt,toggle:rt})))}const _excluded$2$1=["store","hidden","theme","collapsed"];function LevaRoot(tt){let{store:et,hidden:nt=!1,theme:it,collapsed:rt=!1}=tt,ot=_objectWithoutProperties$l(tt,_excluded$2$1);const at=useDeepMemo(()=>mergeTheme(it),[it]),[st,lt]=reactExports.useState(!rt),ct=typeof rt=="object"?!rt.collapsed:st,ut=reactExports.useMemo(()=>typeof rt=="object"?ht=>{typeof ht=="function"?rt.onChange(!ht(!rt.collapsed)):rt.onChange(!ht)}:lt,[rt]);return!et||nt?null:React$1.createElement(ThemeContext$3.Provider,{value:at},React$1.createElement(LevaCore,_extends$s({store:et},ot,{toggled:ct,setToggle:ut,rootClass:at.className})))}const LevaCore=React$1.memo(({store:tt,rootClass:et,fill:nt=!1,flat:it=!1,neverHide:rt=!1,oneLineLabels:ot=!1,titleBar:at={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:st=!1,toggled:lt,setToggle:ct})=>{var ut,ht;const dt=useVisiblePaths(tt),[pt,mt]=reactExports.useState(""),gt=reactExports.useMemo(()=>buildTree(dt,pt),[dt,pt]),[bt,yt]=useTransform(),wt=rt||dt.length>0,vt=typeof at=="object"&&at.title||void 0,xt=typeof at=="object"&&(ut=at.drag)!==null&&ut!==void 0?ut:!0,St=typeof at=="object"&&(ht=at.filter)!==null&&ht!==void 0?ht:!0,Et=typeof at=="object"&&at.position||void 0,$t=typeof at=="object"&&at.onDrag||void 0,It=typeof at=="object"&&at.onDragStart||void 0,Ft=typeof at=="object"&&at.onDragEnd||void 0;return React$1.useEffect(()=>{yt({x:Et==null?void 0:Et.x,y:Et==null?void 0:Et.y})},[Et,yt]),globalStyles(),React$1.createElement(PanelSettingsContext.Provider,{value:{hideCopyButton:st}},React$1.createElement(StyledRoot,{ref:bt,className:et,fill:nt,flat:it,oneLineLabels:ot,hideTitleBar:!at,style:{display:wt?"block":"none"}},at&&React$1.createElement(TitleWithFilter,{onDrag:Ht=>{yt(Ht),$t==null||$t(Ht)},onDragStart:Ht=>It==null?void 0:It(Ht),onDragEnd:Ht=>Ft==null?void 0:Ft(Ht),setFilter:mt,toggle:Ht=>ct(zt=>Ht??!zt),toggled:lt,title:vt,drag:xt,filterEnabled:St,from:Et}),wt&&React$1.createElement(StoreContext$1.Provider,{value:tt},React$1.createElement(TreeWrapper,{isRoot:!0,fill:nt,flat:it,tree:gt,toggled:lt}))))}),_excluded$1$3=["isRoot"];let rootInitialized=!1,rootEl=null;function Leva(tt){let{isRoot:et=!1}=tt,nt=_objectWithoutProperties$l(tt,_excluded$1$3);return reactExports.useEffect(()=>(rootInitialized=!0,!et&&rootEl&&(rootEl.remove(),rootEl=null),()=>{et||(rootInitialized=!1)}),[et]),React$1.createElement(LevaRoot,_extends$s({store:levaStore},nt))}function useRenderRoot(tt){reactExports.useEffect(()=>{tt&&!rootInitialized&&(rootEl||(rootEl=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(rootEl),render(React$1.createElement(Leva,{isRoot:!0}),rootEl))),rootInitialized=!0)},[tt])}function parseArgs(tt,et,nt,it,rt){let ot,at,st,lt,ct;return typeof tt=="string"?(at=tt,ot=et,Array.isArray(nt)?ct=nt:nt&&("store"in nt?(lt=nt,ct=it):(st=nt,Array.isArray(it)?ct=it:(lt=it,ct=rt)))):(ot=tt,Array.isArray(et)?ct=et:(lt=et,ct=nt)),{schema:ot,folderName:at,folderSettings:st,hookSettings:lt,deps:ct||[]}}function useControls(tt,et,nt,it,rt){const{folderName:ot,schema:at,folderSettings:st,hookSettings:lt,deps:ct}=parseArgs(tt,et,nt,it,rt),ut=typeof at=="function",ht=reactExports.useRef(!1),dt=reactExports.useRef(!0),pt=useDeepMemo(()=>{ht.current=!0;const zt=typeof at=="function"?at():at;return ot?{[ot]:folder(zt,st)}:zt},ct),mt=!(lt!=null&<.store);useRenderRoot(mt);const[gt]=reactExports.useState(()=>(lt==null?void 0:lt.store)||levaStore),[bt,yt]=reactExports.useMemo(()=>gt.getDataFromSchema(pt),[gt,pt]),[wt,vt,xt,St,Et]=reactExports.useMemo(()=>{const zt=[],Ot=[],jt={},kt={},Tt={};return Object.values(yt).forEach(({path:Ct,onChange:Ut,onEditStart:Nt,onEditEnd:Bt,transient:Mt})=>{zt.push(Ct),Ut?(jt[Ct]=Ut,Mt||Ot.push(Ct)):Ot.push(Ct),Nt&&(kt[Ct]=Nt),Bt&&(Tt[Ct]=Bt)}),[zt,Ot,jt,kt,Tt]},[yt]),$t=reactExports.useMemo(()=>gt.orderPaths(wt),[wt,gt]),It=useValuesForPath(gt,vt,bt),Ft=reactExports.useCallback(zt=>{const Ot=Object.entries(zt).reduce((jt,[kt,Tt])=>Object.assign(jt,{[yt[kt].path]:Tt}),{});gt.set(Ot,!1)},[gt,yt]),Ht=reactExports.useCallback(zt=>gt.get(yt[zt].path),[gt,yt]);return reactExports.useEffect(()=>{const zt=!dt.current&&ht.current;return gt.addData(bt,zt),dt.current=!1,ht.current=!1,()=>gt.disposePaths($t)},[gt,$t,bt]),reactExports.useEffect(()=>{const zt=[];return Object.entries(xt).forEach(([Ot,jt])=>{jt(gt.get(Ot),Ot,_objectSpread2$1({initial:!0,get:gt.get},gt.getInput(Ot)));const kt=gt.useStore.subscribe(Tt=>{const Ct=Tt.data[Ot];return[Ct.disabled?void 0:Ct.value,Ct]},([Tt,Ct])=>jt(Tt,Ot,_objectSpread2$1({initial:!1,get:gt.get},Ct)),{equalityFn:shallow$2});zt.push(kt)}),()=>zt.forEach(Ot=>Ot())},[gt,xt]),reactExports.useEffect(()=>{const zt=[];return Object.entries(St).forEach(([Ot,jt])=>zt.push(gt.subscribeToEditStart(Ot,jt))),Object.entries(Et).forEach(([Ot,jt])=>zt.push(gt.subscribeToEditEnd(Ot,jt))),()=>zt.forEach(Ot=>Ot())},[St,Et,gt]),ut?[It,Ft,Ht]:It}register(LevaInputs.SELECT,select$1);register(LevaInputs.IMAGE,image$1);register(LevaInputs.NUMBER,number$7);register(LevaInputs.COLOR,color$4);register(LevaInputs.STRING,string$3);register(LevaInputs.BOOLEAN,boolean$1);register(LevaInputs.INTERVAL,interval$1);register(LevaInputs.VECTOR3D,vector3d);register(LevaInputs.VECTOR2D,vector2d);var isCheckBoxInput=tt=>tt.type==="checkbox",isDateObject=tt=>tt instanceof Date,isNullOrUndefined=tt=>tt==null;const isObjectType=tt=>typeof tt=="object";var isObject$k=tt=>!isNullOrUndefined(tt)&&!Array.isArray(tt)&&isObjectType(tt)&&!isDateObject(tt),getEventValue=tt=>isObject$k(tt)&&tt.target?isCheckBoxInput(tt.target)?tt.target.checked:tt.target.value:tt,getNodeParentName=tt=>tt.substring(0,tt.search(/\.\d+(\.|$)/))||tt,isNameInFieldArray=(tt,et)=>tt.has(getNodeParentName(et)),isPlainObject$5=tt=>{const et=tt.constructor&&tt.constructor.prototype;return isObject$k(et)&&et.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(tt){let et;const nt=Array.isArray(tt);if(tt instanceof Date)et=new Date(tt);else if(tt instanceof Set)et=new Set(tt);else if(!(isWeb&&(tt instanceof Blob||tt instanceof FileList))&&(nt||isObject$k(tt)))if(et=nt?[]:{},!nt&&!isPlainObject$5(tt))et=tt;else for(const it in tt)tt.hasOwnProperty(it)&&(et[it]=cloneObject(tt[it]));else return tt;return et}var compact=tt=>Array.isArray(tt)?tt.filter(Boolean):[],isUndefined$1=tt=>tt===void 0,get$6=(tt,et,nt)=>{if(!et||!isObject$k(tt))return nt;const it=compact(et.split(/[,[\].]+?/)).reduce((rt,ot)=>isNullOrUndefined(rt)?rt:rt[ot],tt);return isUndefined$1(it)||it===tt?isUndefined$1(tt[et])?nt:tt[et]:it},isBoolean$3=tt=>typeof tt=="boolean";const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$1.createContext(null),useFormContext=()=>React$1.useContext(HookFormContext),FormProvider=tt=>{const{children:et,...nt}=tt;return React$1.createElement(HookFormContext.Provider,{value:nt},et)};var getProxyFormState=(tt,et,nt,it=!0)=>{const rt={defaultValues:et._defaultValues};for(const ot in tt)Object.defineProperty(rt,ot,{get:()=>{const at=ot;return et._proxyFormState[at]!==VALIDATION_MODE.all&&(et._proxyFormState[at]=!it||VALIDATION_MODE.all),nt&&(nt[at]=!0),tt[at]}});return rt},isEmptyObject=tt=>isObject$k(tt)&&!Object.keys(tt).length,shouldRenderFormState=(tt,et,nt,it)=>{nt(tt);const{name:rt,...ot}=tt;return isEmptyObject(ot)||Object.keys(ot).length>=Object.keys(et).length||Object.keys(ot).find(at=>et[at]===(!it||VALIDATION_MODE.all))},convertToArrayPayload=tt=>Array.isArray(tt)?tt:[tt],shouldSubscribeByName=(tt,et,nt)=>!tt||!et||tt===et||convertToArrayPayload(tt).some(it=>it&&(nt?it===et:it.startsWith(et)||et.startsWith(it)));function useSubscribe(tt){const et=React$1.useRef(tt);et.current=tt,React$1.useEffect(()=>{const nt=!tt.disabled&&et.current.subject&&et.current.subject.subscribe({next:et.current.next});return()=>{nt&&nt.unsubscribe()}},[tt.disabled])}function useFormState(tt){const et=useFormContext(),{control:nt=et.control,disabled:it,name:rt,exact:ot}=tt||{},[at,st]=React$1.useState(nt._formState),lt=React$1.useRef(!0),ct=React$1.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),ut=React$1.useRef(rt);return ut.current=rt,useSubscribe({disabled:it,next:ht=>lt.current&&shouldSubscribeByName(ut.current,ht.name,ot)&&shouldRenderFormState(ht,ct.current,nt._updateFormState)&&st({...nt._formState,...ht}),subject:nt._subjects.state}),React$1.useEffect(()=>(lt.current=!0,ct.current.isValid&&nt._updateValid(!0),()=>{lt.current=!1}),[nt]),getProxyFormState(at,nt,ct.current,!1)}var isString$4=tt=>typeof tt=="string",generateWatchOutput=(tt,et,nt,it,rt)=>isString$4(tt)?(it&&et.watch.add(tt),get$6(nt,tt,rt)):Array.isArray(tt)?tt.map(ot=>(it&&et.watch.add(ot),get$6(nt,ot))):(it&&(et.watchAll=!0),nt);function useWatch(tt){const et=useFormContext(),{control:nt=et.control,name:it,defaultValue:rt,disabled:ot,exact:at}=tt||{},st=React$1.useRef(it);st.current=it,useSubscribe({disabled:ot,subject:nt._subjects.values,next:ut=>{shouldSubscribeByName(st.current,ut.name,at)&&ct(cloneObject(generateWatchOutput(st.current,nt._names,ut.values||nt._formValues,!1,rt)))}});const[lt,ct]=React$1.useState(nt._getWatch(it,rt));return React$1.useEffect(()=>nt._removeUnmounted()),lt}var isKey$4=tt=>/^\w*$/.test(tt),stringToPath$3=tt=>compact(tt.replace(/["|']|\]/g,"").split(/\.|\[/)),set$3=(tt,et,nt)=>{let it=-1;const rt=isKey$4(et)?[et]:stringToPath$3(et),ot=rt.length,at=ot-1;for(;++it{const ut=rt._options.shouldUnregister||ot,ht=(dt,pt)=>{const mt=get$6(rt._fields,dt);mt&&(mt._f.mount=pt)};if(ht(nt,!0),ut){const dt=cloneObject(get$6(rt._options.defaultValues,nt));set$3(rt._defaultValues,nt,dt),isUndefined$1(get$6(rt._formValues,nt))&&set$3(rt._formValues,nt,dt)}return()=>{(at?ut&&!rt._state.action:ut)?rt.unregister(nt):ht(nt,!1)}},[nt,rt,at,ot]),React$1.useEffect(()=>{get$6(rt._fields,nt)&&rt._updateDisabledField({disabled:it,fields:rt._fields,name:nt,value:get$6(rt._fields,nt)._f.value})},[it,nt,rt]),{field:{name:nt,value:st,...isBoolean$3(it)||isBoolean$3(lt.disabled)?{disabled:lt.disabled||it}:{},onChange:React$1.useCallback(ut=>ct.current.onChange({target:{value:getEventValue(ut),name:nt},type:EVENTS.CHANGE}),[nt]),onBlur:React$1.useCallback(()=>ct.current.onBlur({target:{value:get$6(rt._formValues,nt),name:nt},type:EVENTS.BLUR}),[nt,rt]),ref:ut=>{const ht=get$6(rt._fields,nt);ht&&ut&&(ht._f.ref={focus:()=>ut.focus(),select:()=>ut.select(),setCustomValidity:dt=>ut.setCustomValidity(dt),reportValidity:()=>ut.reportValidity()})}},formState:lt,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get$6(lt.errors,nt)},isDirty:{enumerable:!0,get:()=>!!get$6(lt.dirtyFields,nt)},isTouched:{enumerable:!0,get:()=>!!get$6(lt.touchedFields,nt)},error:{enumerable:!0,get:()=>get$6(lt.errors,nt)}})}}const Controller=tt=>tt.render(useController(tt));var appendErrors=(tt,et,nt,it,rt)=>et?{...nt[tt],types:{...nt[tt]&&nt[tt].types?nt[tt].types:{},[it]:rt||!0}}:{},getValidationModes=tt=>({isOnSubmit:!tt||tt===VALIDATION_MODE.onSubmit,isOnBlur:tt===VALIDATION_MODE.onBlur,isOnChange:tt===VALIDATION_MODE.onChange,isOnAll:tt===VALIDATION_MODE.all,isOnTouch:tt===VALIDATION_MODE.onTouched}),isWatched=(tt,et,nt)=>!nt&&(et.watchAll||et.watch.has(tt)||[...et.watch].some(it=>tt.startsWith(it)&&/^\.\w+/.test(tt.slice(it.length))));const iterateFieldsByAction=(tt,et,nt,it)=>{for(const rt of nt||Object.keys(tt)){const ot=get$6(tt,rt);if(ot){const{_f:at,...st}=ot;if(at){if(at.refs&&at.refs[0]&&et(at.refs[0],rt)&&!it)break;if(at.ref&&et(at.ref,at.name)&&!it)break;iterateFieldsByAction(st,et)}else isObject$k(st)&&iterateFieldsByAction(st,et)}}};var updateFieldArrayRootError=(tt,et,nt)=>{const it=compact(get$6(tt,nt));return set$3(it,"root",et[nt]),set$3(tt,nt,it),tt},isFileInput=tt=>tt.type==="file",isFunction$6=tt=>typeof tt=="function",isHTMLElement$2=tt=>{if(!isWeb)return!1;const et=tt?tt.ownerDocument:0;return tt instanceof(et&&et.defaultView?et.defaultView.HTMLElement:HTMLElement)},isMessage=tt=>isString$4(tt),isRadioInput=tt=>tt.type==="radio",isRegex=tt=>tt instanceof RegExp;const defaultResult$1={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=tt=>{if(Array.isArray(tt)){if(tt.length>1){const et=tt.filter(nt=>nt&&nt.checked&&!nt.disabled).map(nt=>nt.value);return{value:et,isValid:!!et.length}}return tt[0].checked&&!tt[0].disabled?tt[0].attributes&&!isUndefined$1(tt[0].attributes.value)?isUndefined$1(tt[0].value)||tt[0].value===""?validResult:{value:tt[0].value,isValid:!0}:validResult:defaultResult$1}return defaultResult$1};const defaultReturn={isValid:!1,value:null};var getRadioValue=tt=>Array.isArray(tt)?tt.reduce((et,nt)=>nt&&nt.checked&&!nt.disabled?{isValid:!0,value:nt.value}:et,defaultReturn):defaultReturn;function getValidateError(tt,et,nt="validate"){if(isMessage(tt)||Array.isArray(tt)&&tt.every(isMessage)||isBoolean$3(tt)&&!tt)return{type:nt,message:isMessage(tt)?tt:"",ref:et}}var getValueAndMessage=tt=>isObject$k(tt)&&!isRegex(tt)?tt:{value:tt,message:""},validateField=async(tt,et,nt,it,rt)=>{const{ref:ot,refs:at,required:st,maxLength:lt,minLength:ct,min:ut,max:ht,pattern:dt,validate:pt,name:mt,valueAsNumber:gt,mount:bt,disabled:yt}=tt._f,wt=get$6(et,mt);if(!bt||yt)return{};const vt=at?at[0]:ot,xt=Ot=>{it&&vt.reportValidity&&(vt.setCustomValidity(isBoolean$3(Ot)?"":Ot||""),vt.reportValidity())},St={},Et=isRadioInput(ot),$t=isCheckBoxInput(ot),It=Et||$t,Ft=(gt||isFileInput(ot))&&isUndefined$1(ot.value)&&isUndefined$1(wt)||isHTMLElement$2(ot)&&ot.value===""||wt===""||Array.isArray(wt)&&!wt.length,Ht=appendErrors.bind(null,mt,nt,St),zt=(Ot,jt,kt,Tt=INPUT_VALIDATION_RULES.maxLength,Ct=INPUT_VALIDATION_RULES.minLength)=>{const Ut=Ot?jt:kt;St[mt]={type:Ot?Tt:Ct,message:Ut,ref:ot,...Ht(Ot?Tt:Ct,Ut)}};if(rt?!Array.isArray(wt)||!wt.length:st&&(!It&&(Ft||isNullOrUndefined(wt))||isBoolean$3(wt)&&!wt||$t&&!getCheckboxValue(at).isValid||Et&&!getRadioValue(at).isValid)){const{value:Ot,message:jt}=isMessage(st)?{value:!!st,message:st}:getValueAndMessage(st);if(Ot&&(St[mt]={type:INPUT_VALIDATION_RULES.required,message:jt,ref:vt,...Ht(INPUT_VALIDATION_RULES.required,jt)},!nt))return xt(jt),St}if(!Ft&&(!isNullOrUndefined(ut)||!isNullOrUndefined(ht))){let Ot,jt;const kt=getValueAndMessage(ht),Tt=getValueAndMessage(ut);if(!isNullOrUndefined(wt)&&!isNaN(wt)){const Ct=ot.valueAsNumber||wt&&+wt;isNullOrUndefined(kt.value)||(Ot=Ct>kt.value),isNullOrUndefined(Tt.value)||(jt=Ctnew Date(new Date().toDateString()+" "+Mt),Nt=ot.type=="time",Bt=ot.type=="week";isString$4(kt.value)&&wt&&(Ot=Nt?Ut(wt)>Ut(kt.value):Bt?wt>kt.value:Ct>new Date(kt.value)),isString$4(Tt.value)&&wt&&(jt=Nt?Ut(wt)+Ot.value,Tt=!isNullOrUndefined(jt.value)&&wt.length<+jt.value;if((kt||Tt)&&(zt(kt,Ot.message,jt.message),!nt))return xt(St[mt].message),St}if(dt&&!Ft&&isString$4(wt)){const{value:Ot,message:jt}=getValueAndMessage(dt);if(isRegex(Ot)&&!wt.match(Ot)&&(St[mt]={type:INPUT_VALIDATION_RULES.pattern,message:jt,ref:ot,...Ht(INPUT_VALIDATION_RULES.pattern,jt)},!nt))return xt(jt),St}if(pt){if(isFunction$6(pt)){const Ot=await pt(wt,et),jt=getValidateError(Ot,vt);if(jt&&(St[mt]={...jt,...Ht(INPUT_VALIDATION_RULES.validate,jt.message)},!nt))return xt(jt.message),St}else if(isObject$k(pt)){let Ot={};for(const jt in pt){if(!isEmptyObject(Ot)&&!nt)break;const kt=getValidateError(await pt[jt](wt,et),vt,jt);kt&&(Ot={...kt,...Ht(jt,kt.message)},xt(kt.message),nt&&(St[mt]=Ot))}if(!isEmptyObject(Ot)&&(St[mt]={ref:vt,...Ot},!nt))return St}}return xt(!0),St};function baseGet$4(tt,et){const nt=et.slice(0,-1).length;let it=0;for(;it{let tt=[];return{get observers(){return tt},next:rt=>{for(const ot of tt)ot.next&&ot.next(rt)},subscribe:rt=>(tt.push(rt),{unsubscribe:()=>{tt=tt.filter(ot=>ot!==rt)}}),unsubscribe:()=>{tt=[]}}},isPrimitive=tt=>isNullOrUndefined(tt)||!isObjectType(tt);function deepEqual$2(tt,et){if(isPrimitive(tt)||isPrimitive(et))return tt===et;if(isDateObject(tt)&&isDateObject(et))return tt.getTime()===et.getTime();const nt=Object.keys(tt),it=Object.keys(et);if(nt.length!==it.length)return!1;for(const rt of nt){const ot=tt[rt];if(!it.includes(rt))return!1;if(rt!=="ref"){const at=et[rt];if(isDateObject(ot)&&isDateObject(at)||isObject$k(ot)&&isObject$k(at)||Array.isArray(ot)&&Array.isArray(at)?!deepEqual$2(ot,at):ot!==at)return!1}}return!0}var isMultipleSelect=tt=>tt.type==="select-multiple",isRadioOrCheckbox=tt=>isRadioInput(tt)||isCheckBoxInput(tt),live=tt=>isHTMLElement$2(tt)&&tt.isConnected,objectHasFunction=tt=>{for(const et in tt)if(isFunction$6(tt[et]))return!0;return!1};function markFieldsDirty(tt,et={}){const nt=Array.isArray(tt);if(isObject$k(tt)||nt)for(const it in tt)Array.isArray(tt[it])||isObject$k(tt[it])&&!objectHasFunction(tt[it])?(et[it]=Array.isArray(tt[it])?[]:{},markFieldsDirty(tt[it],et[it])):isNullOrUndefined(tt[it])||(et[it]=!0);return et}function getDirtyFieldsFromDefaultValues(tt,et,nt){const it=Array.isArray(tt);if(isObject$k(tt)||it)for(const rt in tt)Array.isArray(tt[rt])||isObject$k(tt[rt])&&!objectHasFunction(tt[rt])?isUndefined$1(et)||isPrimitive(nt[rt])?nt[rt]=Array.isArray(tt[rt])?markFieldsDirty(tt[rt],[]):{...markFieldsDirty(tt[rt])}:getDirtyFieldsFromDefaultValues(tt[rt],isNullOrUndefined(et)?{}:et[rt],nt[rt]):nt[rt]=!deepEqual$2(tt[rt],et[rt]);return nt}var getDirtyFields=(tt,et)=>getDirtyFieldsFromDefaultValues(tt,et,markFieldsDirty(et)),getFieldValueAs=(tt,{valueAsNumber:et,valueAsDate:nt,setValueAs:it})=>isUndefined$1(tt)?tt:et?tt===""?NaN:tt&&+tt:nt&&isString$4(tt)?new Date(tt):it?it(tt):tt;function getFieldValue(tt){const et=tt.ref;if(!(tt.refs?tt.refs.every(nt=>nt.disabled):et.disabled))return isFileInput(et)?et.files:isRadioInput(et)?getRadioValue(tt.refs).value:isMultipleSelect(et)?[...et.selectedOptions].map(({value:nt})=>nt):isCheckBoxInput(et)?getCheckboxValue(tt.refs).value:getFieldValueAs(isUndefined$1(et.value)?tt.ref.value:et.value,tt)}var getResolverOptions=(tt,et,nt,it)=>{const rt={};for(const ot of tt){const at=get$6(et,ot);at&&set$3(rt,ot,at._f)}return{criteriaMode:nt,names:[...tt],fields:rt,shouldUseNativeValidation:it}},getRuleValue=tt=>isUndefined$1(tt)?tt:isRegex(tt)?tt.source:isObject$k(tt)?isRegex(tt.value)?tt.value.source:tt.value:tt,hasValidation=tt=>tt.mount&&(tt.required||tt.min||tt.max||tt.maxLength||tt.minLength||tt.pattern||tt.validate);function schemaErrorLookup(tt,et,nt){const it=get$6(tt,nt);if(it||isKey$4(nt))return{error:it,name:nt};const rt=nt.split(".");for(;rt.length;){const ot=rt.join("."),at=get$6(et,ot),st=get$6(tt,ot);if(at&&!Array.isArray(at)&&nt!==ot)return{name:nt};if(st&&st.type)return{name:ot,error:st};rt.pop()}return{name:nt}}var skipValidation=(tt,et,nt,it,rt)=>rt.isOnAll?!1:!nt&&rt.isOnTouch?!(et||tt):(nt?it.isOnBlur:rt.isOnBlur)?!tt:(nt?it.isOnChange:rt.isOnChange)?tt:!0,unsetEmptyArray=(tt,et)=>!compact(get$6(tt,et)).length&&unset(tt,et);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(tt={},et){let nt={...defaultOptions,...tt},it={submitCount:0,isDirty:!1,isLoading:isFunction$6(nt.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:nt.errors||{},disabled:!1},rt={},ot=isObject$k(nt.defaultValues)||isObject$k(nt.values)?cloneObject(nt.defaultValues||nt.values)||{}:{},at=nt.shouldUnregister?{}:cloneObject(ot),st={action:!1,mount:!1,watch:!1},lt={mount:new Set,unMount:new Set,array:new Set,watch:new Set},ct,ut=0;const ht={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},dt={values:createSubject(),array:createSubject(),state:createSubject()},pt=tt.resetOptions&&tt.resetOptions.keepDirtyValues,mt=getValidationModes(nt.mode),gt=getValidationModes(nt.reValidateMode),bt=nt.criteriaMode===VALIDATION_MODE.all,yt=gn=>Tn=>{clearTimeout(ut),ut=setTimeout(gn,Tn)},wt=async gn=>{if(ht.isValid||gn){const Tn=nt.resolver?isEmptyObject((await Ht()).errors):await Ot(rt,!0);Tn!==it.isValid&&dt.state.next({isValid:Tn})}},vt=gn=>ht.isValidating&&dt.state.next({isValidating:gn}),xt=(gn,Tn=[],yn,dn,sn=!0,rn=!0)=>{if(dn&&yn){if(st.action=!0,rn&&Array.isArray(get$6(rt,gn))){const Sn=yn(get$6(rt,gn),dn.argA,dn.argB);sn&&set$3(rt,gn,Sn)}if(rn&&Array.isArray(get$6(it.errors,gn))){const Sn=yn(get$6(it.errors,gn),dn.argA,dn.argB);sn&&set$3(it.errors,gn,Sn),unsetEmptyArray(it.errors,gn)}if(ht.touchedFields&&rn&&Array.isArray(get$6(it.touchedFields,gn))){const Sn=yn(get$6(it.touchedFields,gn),dn.argA,dn.argB);sn&&set$3(it.touchedFields,gn,Sn)}ht.dirtyFields&&(it.dirtyFields=getDirtyFields(ot,at)),dt.state.next({name:gn,isDirty:kt(gn,Tn),dirtyFields:it.dirtyFields,errors:it.errors,isValid:it.isValid})}else set$3(at,gn,Tn)},St=(gn,Tn)=>{set$3(it.errors,gn,Tn),dt.state.next({errors:it.errors})},Et=gn=>{it.errors=gn,dt.state.next({errors:it.errors,isValid:!1})},$t=(gn,Tn,yn,dn)=>{const sn=get$6(rt,gn);if(sn){const rn=get$6(at,gn,isUndefined$1(yn)?get$6(ot,gn):yn);isUndefined$1(rn)||dn&&dn.defaultChecked||Tn?set$3(at,gn,Tn?rn:getFieldValue(sn._f)):Ut(gn,rn),st.mount&&wt()}},It=(gn,Tn,yn,dn,sn)=>{let rn=!1,Sn=!1;const tn={name:gn},qt=!!(get$6(rt,gn)&&get$6(rt,gn)._f.disabled);if(!yn||dn){ht.isDirty&&(Sn=it.isDirty,it.isDirty=tn.isDirty=kt(),rn=Sn!==tn.isDirty);const Kt=qt||deepEqual$2(get$6(ot,gn),Tn);Sn=!!(!qt&&get$6(it.dirtyFields,gn)),Kt||qt?unset(it.dirtyFields,gn):set$3(it.dirtyFields,gn,!0),tn.dirtyFields=it.dirtyFields,rn=rn||ht.dirtyFields&&Sn!==!Kt}if(yn){const Kt=get$6(it.touchedFields,gn);Kt||(set$3(it.touchedFields,gn,yn),tn.touchedFields=it.touchedFields,rn=rn||ht.touchedFields&&Kt!==yn)}return rn&&sn&&dt.state.next(tn),rn?tn:{}},Ft=(gn,Tn,yn,dn)=>{const sn=get$6(it.errors,gn),rn=ht.isValid&&isBoolean$3(Tn)&&it.isValid!==Tn;if(tt.delayError&&yn?(ct=yt(()=>St(gn,yn)),ct(tt.delayError)):(clearTimeout(ut),ct=null,yn?set$3(it.errors,gn,yn):unset(it.errors,gn)),(yn?!deepEqual$2(sn,yn):sn)||!isEmptyObject(dn)||rn){const Sn={...dn,...rn&&isBoolean$3(Tn)?{isValid:Tn}:{},errors:it.errors,name:gn};it={...it,...Sn},dt.state.next(Sn)}vt(!1)},Ht=async gn=>nt.resolver(at,nt.context,getResolverOptions(gn||lt.mount,rt,nt.criteriaMode,nt.shouldUseNativeValidation)),zt=async gn=>{const{errors:Tn}=await Ht(gn);if(gn)for(const yn of gn){const dn=get$6(Tn,yn);dn?set$3(it.errors,yn,dn):unset(it.errors,yn)}else it.errors=Tn;return Tn},Ot=async(gn,Tn,yn={valid:!0})=>{for(const dn in gn){const sn=gn[dn];if(sn){const{_f:rn,...Sn}=sn;if(rn){const tn=lt.array.has(rn.name),qt=await validateField(sn,at,bt,nt.shouldUseNativeValidation&&!Tn,tn);if(qt[rn.name]&&(yn.valid=!1,Tn))break;!Tn&&(get$6(qt,rn.name)?tn?updateFieldArrayRootError(it.errors,qt,rn.name):set$3(it.errors,rn.name,qt[rn.name]):unset(it.errors,rn.name))}Sn&&await Ot(Sn,Tn,yn)}}return yn.valid},jt=()=>{for(const gn of lt.unMount){const Tn=get$6(rt,gn);Tn&&(Tn._f.refs?Tn._f.refs.every(yn=>!live(yn)):!live(Tn._f.ref))&&en(gn)}lt.unMount=new Set},kt=(gn,Tn)=>(gn&&Tn&&set$3(at,gn,Tn),!deepEqual$2(Vt(),ot)),Tt=(gn,Tn,yn)=>generateWatchOutput(gn,lt,{...st.mount?at:isUndefined$1(Tn)?ot:isString$4(gn)?{[gn]:Tn}:Tn},yn,Tn),Ct=gn=>compact(get$6(st.mount?at:ot,gn,tt.shouldUnregister?get$6(ot,gn,[]):[])),Ut=(gn,Tn,yn={})=>{const dn=get$6(rt,gn);let sn=Tn;if(dn){const rn=dn._f;rn&&(!rn.disabled&&set$3(at,gn,getFieldValueAs(Tn,rn)),sn=isHTMLElement$2(rn.ref)&&isNullOrUndefined(Tn)?"":Tn,isMultipleSelect(rn.ref)?[...rn.ref.options].forEach(Sn=>Sn.selected=sn.includes(Sn.value)):rn.refs?isCheckBoxInput(rn.ref)?rn.refs.length>1?rn.refs.forEach(Sn=>(!Sn.defaultChecked||!Sn.disabled)&&(Sn.checked=Array.isArray(sn)?!!sn.find(tn=>tn===Sn.value):sn===Sn.value)):rn.refs[0]&&(rn.refs[0].checked=!!sn):rn.refs.forEach(Sn=>Sn.checked=Sn.value===sn):isFileInput(rn.ref)?rn.ref.value="":(rn.ref.value=sn,rn.ref.type||dt.values.next({name:gn,values:{...at}})))}(yn.shouldDirty||yn.shouldTouch)&&It(gn,sn,yn.shouldTouch,yn.shouldDirty,!0),yn.shouldValidate&&Pt(gn)},Nt=(gn,Tn,yn)=>{for(const dn in Tn){const sn=Tn[dn],rn=`${gn}.${dn}`,Sn=get$6(rt,rn);(lt.array.has(gn)||!isPrimitive(sn)||Sn&&!Sn._f)&&!isDateObject(sn)?Nt(rn,sn,yn):Ut(rn,sn,yn)}},Bt=(gn,Tn,yn={})=>{const dn=get$6(rt,gn),sn=lt.array.has(gn),rn=cloneObject(Tn);set$3(at,gn,rn),sn?(dt.array.next({name:gn,values:{...at}}),(ht.isDirty||ht.dirtyFields)&&yn.shouldDirty&&dt.state.next({name:gn,dirtyFields:getDirtyFields(ot,at),isDirty:kt(gn,rn)})):dn&&!dn._f&&!isNullOrUndefined(rn)?Nt(gn,rn,yn):Ut(gn,rn,yn),isWatched(gn,lt)&&dt.state.next({...it}),dt.values.next({name:gn,values:{...at}}),!st.mount&&et()},Mt=async gn=>{const Tn=gn.target;let yn=Tn.name,dn=!0;const sn=get$6(rt,yn),rn=()=>Tn.type?getFieldValue(sn._f):getEventValue(gn),Sn=tn=>{dn=Number.isNaN(tn)||tn===get$6(at,yn,tn)};if(sn){let tn,qt;const Kt=rn(),wn=gn.type===EVENTS.BLUR||gn.type===EVENTS.FOCUS_OUT,Rn=!hasValidation(sn._f)&&!nt.resolver&&!get$6(it.errors,yn)&&!sn._f.deps||skipValidation(wn,get$6(it.touchedFields,yn),it.isSubmitted,gt,mt),jn=isWatched(yn,lt,wn);set$3(at,yn,Kt),wn?(sn._f.onBlur&&sn._f.onBlur(gn),ct&&ct(0)):sn._f.onChange&&sn._f.onChange(gn);const Bn=It(yn,Kt,wn,!1),Xn=!isEmptyObject(Bn)||jn;if(!wn&&dt.values.next({name:yn,type:gn.type,values:{...at}}),Rn)return ht.isValid&&wt(),Xn&&dt.state.next({name:yn,...jn?{}:Bn});if(!wn&&jn&&dt.state.next({...it}),vt(!0),nt.resolver){const{errors:Wn}=await Ht([yn]);if(Sn(Kt),dn){const Gn=schemaErrorLookup(it.errors,rt,yn),Fn=schemaErrorLookup(Wn,rt,Gn.name||yn);tn=Fn.error,yn=Fn.name,qt=isEmptyObject(Wn)}}else tn=(await validateField(sn,at,bt,nt.shouldUseNativeValidation))[yn],Sn(Kt),dn&&(tn?qt=!1:ht.isValid&&(qt=await Ot(rt,!0)));dn&&(sn._f.deps&&Pt(sn._f.deps),Ft(yn,qt,tn,Bn))}},Dt=(gn,Tn)=>{if(get$6(it.errors,Tn)&&gn.focus)return gn.focus(),1},Pt=async(gn,Tn={})=>{let yn,dn;const sn=convertToArrayPayload(gn);if(vt(!0),nt.resolver){const rn=await zt(isUndefined$1(gn)?gn:sn);yn=isEmptyObject(rn),dn=gn?!sn.some(Sn=>get$6(rn,Sn)):yn}else gn?(dn=(await Promise.all(sn.map(async rn=>{const Sn=get$6(rt,rn);return await Ot(Sn&&Sn._f?{[rn]:Sn}:Sn)}))).every(Boolean),!(!dn&&!it.isValid)&&wt()):dn=yn=await Ot(rt);return dt.state.next({...!isString$4(gn)||ht.isValid&&yn!==it.isValid?{}:{name:gn},...nt.resolver||!gn?{isValid:yn}:{},errors:it.errors,isValidating:!1}),Tn.shouldFocus&&!dn&&iterateFieldsByAction(rt,Dt,gn?sn:lt.mount),dn},Vt=gn=>{const Tn={...ot,...st.mount?at:{}};return isUndefined$1(gn)?Tn:isString$4(gn)?get$6(Tn,gn):gn.map(yn=>get$6(Tn,yn))},nn=(gn,Tn)=>({invalid:!!get$6((Tn||it).errors,gn),isDirty:!!get$6((Tn||it).dirtyFields,gn),isTouched:!!get$6((Tn||it).touchedFields,gn),error:get$6((Tn||it).errors,gn)}),cn=gn=>{gn&&convertToArrayPayload(gn).forEach(Tn=>unset(it.errors,Tn)),dt.state.next({errors:gn?it.errors:{}})},Xt=(gn,Tn,yn)=>{const dn=(get$6(rt,gn,{_f:{}})._f||{}).ref;set$3(it.errors,gn,{...Tn,ref:dn}),dt.state.next({name:gn,errors:it.errors,isValid:!1}),yn&&yn.shouldFocus&&dn&&dn.focus&&dn.focus()},un=(gn,Tn)=>isFunction$6(gn)?dt.values.subscribe({next:yn=>gn(Tt(void 0,Tn),yn)}):Tt(gn,Tn,!0),en=(gn,Tn={})=>{for(const yn of gn?convertToArrayPayload(gn):lt.mount)lt.mount.delete(yn),lt.array.delete(yn),Tn.keepValue||(unset(rt,yn),unset(at,yn)),!Tn.keepError&&unset(it.errors,yn),!Tn.keepDirty&&unset(it.dirtyFields,yn),!Tn.keepTouched&&unset(it.touchedFields,yn),!nt.shouldUnregister&&!Tn.keepDefaultValue&&unset(ot,yn);dt.values.next({values:{...at}}),dt.state.next({...it,...Tn.keepDirty?{isDirty:kt()}:{}}),!Tn.keepIsValid&&wt()},fn=({disabled:gn,name:Tn,field:yn,fields:dn,value:sn})=>{if(isBoolean$3(gn)){const rn=gn?void 0:isUndefined$1(sn)?getFieldValue(yn?yn._f:get$6(dn,Tn)._f):sn;set$3(at,Tn,rn),It(Tn,rn,!1,!1,!0)}},xn=(gn,Tn={})=>{let yn=get$6(rt,gn);const dn=isBoolean$3(Tn.disabled);return set$3(rt,gn,{...yn||{},_f:{...yn&&yn._f?yn._f:{ref:{name:gn}},name:gn,mount:!0,...Tn}}),lt.mount.add(gn),yn?fn({field:yn,disabled:Tn.disabled,name:gn,value:Tn.value}):$t(gn,!0,Tn.value),{...dn?{disabled:Tn.disabled}:{},...nt.progressive?{required:!!Tn.required,min:getRuleValue(Tn.min),max:getRuleValue(Tn.max),minLength:getRuleValue(Tn.minLength),maxLength:getRuleValue(Tn.maxLength),pattern:getRuleValue(Tn.pattern)}:{},name:gn,onChange:Mt,onBlur:Mt,ref:sn=>{if(sn){xn(gn,Tn),yn=get$6(rt,gn);const rn=isUndefined$1(sn.value)&&sn.querySelectorAll&&sn.querySelectorAll("input,select,textarea")[0]||sn,Sn=isRadioOrCheckbox(rn),tn=yn._f.refs||[];if(Sn?tn.find(qt=>qt===rn):rn===yn._f.ref)return;set$3(rt,gn,{_f:{...yn._f,...Sn?{refs:[...tn.filter(live),rn,...Array.isArray(get$6(ot,gn))?[{}]:[]],ref:{type:rn.type,name:gn}}:{ref:rn}}}),$t(gn,!1,void 0,rn)}else yn=get$6(rt,gn,{}),yn._f&&(yn._f.mount=!1),(nt.shouldUnregister||Tn.shouldUnregister)&&!(isNameInFieldArray(lt.array,gn)&&st.action)&<.unMount.add(gn)}}},an=()=>nt.shouldFocusError&&iterateFieldsByAction(rt,Dt,lt.mount),Zt=gn=>{isBoolean$3(gn)&&(dt.state.next({disabled:gn}),iterateFieldsByAction(rt,(Tn,yn)=>{let dn=gn;const sn=get$6(rt,yn);sn&&isBoolean$3(sn._f.disabled)&&(dn||(dn=sn._f.disabled)),Tn.disabled=dn},0,!1))},En=(gn,Tn)=>async yn=>{yn&&(yn.preventDefault&&yn.preventDefault(),yn.persist&&yn.persist());let dn=cloneObject(at);if(dt.state.next({isSubmitting:!0}),nt.resolver){const{errors:sn,values:rn}=await Ht();it.errors=sn,dn=rn}else await Ot(rt);unset(it.errors,"root"),isEmptyObject(it.errors)?(dt.state.next({errors:{}}),await gn(dn,yn)):(Tn&&await Tn({...it.errors},yn),an(),setTimeout(an)),dt.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(it.errors),submitCount:it.submitCount+1,errors:it.errors})},In=(gn,Tn={})=>{get$6(rt,gn)&&(isUndefined$1(Tn.defaultValue)?Bt(gn,get$6(ot,gn)):(Bt(gn,Tn.defaultValue),set$3(ot,gn,Tn.defaultValue)),Tn.keepTouched||unset(it.touchedFields,gn),Tn.keepDirty||(unset(it.dirtyFields,gn),it.isDirty=Tn.defaultValue?kt(gn,get$6(ot,gn)):kt()),Tn.keepError||(unset(it.errors,gn),ht.isValid&&wt()),dt.state.next({...it}))},Cn=(gn,Tn={})=>{const yn=gn?cloneObject(gn):ot,dn=cloneObject(yn),sn=gn&&!isEmptyObject(gn)?dn:ot;if(Tn.keepDefaultValues||(ot=yn),!Tn.keepValues){if(Tn.keepDirtyValues||pt)for(const rn of lt.mount)get$6(it.dirtyFields,rn)?set$3(sn,rn,get$6(at,rn)):Bt(rn,get$6(sn,rn));else{if(isWeb&&isUndefined$1(gn))for(const rn of lt.mount){const Sn=get$6(rt,rn);if(Sn&&Sn._f){const tn=Array.isArray(Sn._f.refs)?Sn._f.refs[0]:Sn._f.ref;if(isHTMLElement$2(tn)){const qt=tn.closest("form");if(qt){qt.reset();break}}}}rt={}}at=tt.shouldUnregister?Tn.keepDefaultValues?cloneObject(ot):{}:cloneObject(sn),dt.array.next({values:{...sn}}),dt.values.next({values:{...sn}})}lt={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!st.mount&&et(),st.mount=!ht.isValid||!!Tn.keepIsValid,st.watch=!!tt.shouldUnregister,dt.state.next({submitCount:Tn.keepSubmitCount?it.submitCount:0,isDirty:Tn.keepDirty?it.isDirty:!!(Tn.keepDefaultValues&&!deepEqual$2(gn,ot)),isSubmitted:Tn.keepIsSubmitted?it.isSubmitted:!1,dirtyFields:Tn.keepDirtyValues?it.dirtyFields:Tn.keepDefaultValues&&gn?getDirtyFields(ot,gn):{},touchedFields:Tn.keepTouched?it.touchedFields:{},errors:Tn.keepErrors?it.errors:{},isSubmitSuccessful:Tn.keepIsSubmitSuccessful?it.isSubmitSuccessful:!1,isSubmitting:!1})},Nn=(gn,Tn)=>Cn(isFunction$6(gn)?gn(at):gn,Tn);return{control:{register:xn,unregister:en,getFieldState:nn,handleSubmit:En,setError:Xt,_executeSchema:Ht,_getWatch:Tt,_getDirty:kt,_updateValid:wt,_removeUnmounted:jt,_updateFieldArray:xt,_updateDisabledField:fn,_getFieldArray:Ct,_reset:Cn,_resetDefaultValues:()=>isFunction$6(nt.defaultValues)&&nt.defaultValues().then(gn=>{Nn(gn,nt.resetOptions),dt.state.next({isLoading:!1})}),_updateFormState:gn=>{it={...it,...gn}},_disableForm:Zt,_subjects:dt,_proxyFormState:ht,_setErrors:Et,get _fields(){return rt},get _formValues(){return at},get _state(){return st},set _state(gn){st=gn},get _defaultValues(){return ot},get _names(){return lt},set _names(gn){lt=gn},get _formState(){return it},set _formState(gn){it=gn},get _options(){return nt},set _options(gn){nt={...nt,...gn}}},trigger:Pt,register:xn,handleSubmit:En,watch:un,setValue:Bt,getValues:Vt,reset:Nn,resetField:In,clearErrors:cn,unregister:en,setError:Xt,setFocus:(gn,Tn={})=>{const yn=get$6(rt,gn),dn=yn&&yn._f;if(dn){const sn=dn.refs?dn.refs[0]:dn.ref;sn.focus&&(sn.focus(),Tn.shouldSelect&&sn.select())}},getFieldState:nn}}function useForm(tt={}){const et=React$1.useRef(),nt=React$1.useRef(),[it,rt]=React$1.useState({isDirty:!1,isValidating:!1,isLoading:isFunction$6(tt.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:tt.errors||{},disabled:!1,defaultValues:isFunction$6(tt.defaultValues)?void 0:tt.defaultValues});et.current||(et.current={...createFormControl(tt,()=>rt(at=>({...at}))),formState:it});const ot=et.current.control;return ot._options=tt,useSubscribe({subject:ot._subjects.state,next:at=>{shouldRenderFormState(at,ot._proxyFormState,ot._updateFormState,!0)&&rt({...ot._formState})}}),React$1.useEffect(()=>ot._disableForm(tt.disabled),[ot,tt.disabled]),React$1.useEffect(()=>{if(ot._proxyFormState.isDirty){const at=ot._getDirty();at!==it.isDirty&&ot._subjects.state.next({isDirty:at})}},[ot,it.isDirty]),React$1.useEffect(()=>{tt.values&&!deepEqual$2(tt.values,nt.current)?(ot._reset(tt.values,ot._options.resetOptions),nt.current=tt.values,rt(at=>({...at}))):ot._resetDefaultValues()},[tt.values,ot]),React$1.useEffect(()=>{tt.errors&&ot._setErrors(tt.errors)},[tt.errors,ot]),React$1.useEffect(()=>{ot._state.mount||(ot._updateValid(),ot._state.mount=!0),ot._state.watch&&(ot._state.watch=!1,ot._subjects.state.next({...ot._formState})),ot._removeUnmounted()}),et.current.formState=getProxyFormState(it,ot),et.current}const ReactToastify="";var dist$4={exports:{}},lib$3={},postMessage$2={};Object.defineProperty(postMessage$2,"__esModule",{value:!0});postMessage$2.removeEventer=postMessage$2.addEventer=postMessage$2.postMessage=void 0;function postMessage$1(tt){var et=window;if(et.sendToElectron)return et.sendToElectron("sphinx-bridge",tt);et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?et.ReactNativeWebView.postMessage(JSON.stringify(tt)):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx?et.webkit.messageHandlers.sphinx.postMessage(tt):et.Android?et.Android.receiveMessage(JSON.stringify(tt)):et.parent.postMessage(tt,"*")}postMessage$2.postMessage=postMessage$1;function addEventer(tt){var et=window;if(et.sendToElectron){et.EE&&et.EE.once("sphinx-bridge",tt);return}else et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?document.addEventListener("message",function(nt){var it={};try{it=JSON.parse(nt.data)}catch{}tt({data:it})}):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx?et.sphinxMessage=function(nt){var it={};try{it=JSON.parse(nt)}catch{}tt({data:it})}:et.Android?et.sphinxMessage=function(nt){var it={};try{it=JSON.parse(nt)}catch{}tt({data:it})}:et.addEventListener("message",tt)}postMessage$2.addEventer=addEventer;function removeEventer(tt){var et=window;et.sendToElectron||(et.ReactNativeWebView&&et.ReactNativeWebView.postMessage?document.removeEventListener("message",tt):et.webkit&&et.webkit.messageHandlers&&et.webkit.messageHandlers.sphinx&&et.webkit.messageHandlers.sphinx||et.Android?et.sphinxMessage=null:et.removeEventListener("message",tt))}postMessage$2.removeEventer=removeEventer;(function(tt){var et=commonjsGlobal&&commonjsGlobal.__assign||function(){return et=Object.assign||function(lt){for(var ct,ut=1,ht=arguments.length;ut0&&pt[pt.length-1])&&(yt[0]===6||yt[0]===2)){ut=0;continue}if(yt[0]===3&&(!pt||yt[1]>pt[0]&&yt[1] ENABLE!"),this.isEnabled)return[2,{budget:this.budget,pubkey:this.pubkey,application:at}];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.AUTHORIZE)];case 2:return ut=dt.sent(),ut.pubkey?(this.isEnabled=!0,this.pubkey=ut.pubkey,[2,ut]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[3,4];case 4:return[2,null]}})})},lt.prototype.authorize=function(ct,ut,ht){return nt(this,void 0,void 0,function(){var dt,pt,mt,gt;return it(this,function(bt){switch(bt.label){case 0:ht&&(this.logging=!0),this.logging&&console.log("=> AUTHORIZE!"),bt.label=1;case 1:return bt.trys.push([1,3,,4]),dt=ut||!1,[4,this.postMsg(ot.AUTHORIZE,{challenge:ct,noBudget:dt})];case 2:return pt=bt.sent(),mt=pt.budget||pt.budget===0,(dt||mt)&&pt.pubkey?(this.isEnabled=!0,this.budget=pt.budget||0,this.pubkey=pt.pubkey,[2,pt]):[3,4];case 3:return gt=bt.sent(),this.logging&&console.log(gt),[3,4];case 4:return[2,null]}})})},lt.prototype.topup=function(){return nt(this,void 0,void 0,function(){var ct,ut,ht;return it(this,function(dt){switch(dt.label){case 0:this.logging&&console.log("=> TOP UP"),dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SETBUDGET)];case 2:return ct=dt.sent(),ut=ct.budget||ct.budget===0,ut?(this.budget=ct.budget,[2,ct]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[3,4];case 4:return[2,null]}})})},lt.prototype.keysend=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt,pt;return it(this,function(mt){switch(mt.label){case 0:if(this.logging&&console.log("=> KEYSEND"),!this.isEnabled)return[2,null];if(!ct||!ut)return[2,null];if(ct.length!==66)return[2,null];if(ut<1)return[2,null];if(ut>this.budget)return[2,null];mt.label=1;case 1:return mt.trys.push([1,3,,4]),ht={dest:ct,amt:ut},[4,this.postMsg(ot.KEYSEND,ht)];case 2:return dt=mt.sent(),dt&&dt.success&&(this.budget=this.budget-ut,dt.budget=this.budget),[2,dt];case 3:return pt=mt.sent(),this.logging&&console.log(pt),[2,null];case 4:return[2]}})})},lt.prototype.updated=function(){return nt(this,void 0,void 0,function(){var ct,ut;return it(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> UDPATED"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.UPDATED)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.sendPayment=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SEND PAYMENT"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.PAYMENT,{paymentRequest:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.saveLsat=function(ct,ut,ht){return nt(this,void 0,void 0,function(){var dt,pt;return it(this,function(mt){switch(mt.label){case 0:this.logging&&console.log("=> SAVE LSAT"),mt.label=1;case 1:return mt.trys.push([1,3,,4]),[4,this.postMsg(ot.LSAT,{paymentRequest:ct,macaroon:ut,issuer:ht})];case 2:return dt=mt.sent(),[2,dt];case 3:return pt=mt.sent(),this.logging&&console.log(pt),[2,pt];case 4:return[2]}})})},lt.prototype.getLsat=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> GET LSAT"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.GETLSAT,{issuer:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,ht];case 4:return[2]}})})},lt.prototype.updateLsat=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return it(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> UPDATE LSAT"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.UPDATELSAT,{identifier:ct,status:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,dt];case 4:return[2]}})})},lt.prototype.makeInvoice=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return it(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> MAKE INVOICE"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.INVOICE,{amt:ct,memo:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,null];case 4:return[2]}})})},lt.prototype.signMessage=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SIGN MESSAGE"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SIGN,{message:ct})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.verifyMessage=function(ct,ut){return nt(this,void 0,void 0,function(){var ht,dt;return it(this,function(pt){switch(pt.label){case 0:if(this.logging&&console.log("=> VERIFY MESSAGE"),!this.isEnabled)return[2,null];pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.SIGN,{signature:ct,message:ut})];case 2:return ht=pt.sent(),[2,ht];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[2,null];case 4:return[2]}})})},lt.prototype.reload=function(ct){return nt(this,void 0,void 0,function(){var ut,ht,dt;return it(this,function(pt){switch(pt.label){case 0:this.logging&&console.log("=> RELOAD"),pt.label=1;case 1:return pt.trys.push([1,3,,4]),[4,this.postMsg(ot.RELOAD,{password:ct})];case 2:return ut=pt.sent(),ht=ut.budget||ut.budget===0,ht&&ut.pubkey?(this.isEnabled=!0,this.budget=ut.budget,this.pubkey=ut.pubkey,[2,ut]):[3,4];case 3:return dt=pt.sent(),this.logging&&console.log(dt),[3,4];case 4:return[2,null]}})})},lt.prototype.saveGraphData=function(ct){return nt(this,void 0,void 0,function(){var ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SAVEDATA"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SAVEDATA,{data:{type:ct.type,metaData:ct.metaData}})];case 2:return ut=dt.sent(),[2,ut];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.getPersonData=function(){return nt(this,void 0,void 0,function(){var ct,ut;return it(this,function(ht){switch(ht.label){case 0:if(this.logging&&console.log("=> GETPERSONDATA"),!this.isEnabled)return[2,null];ht.label=1;case 1:return ht.trys.push([1,3,,4]),[4,this.postMsg(ot.GETPERSONDATA)];case 2:return ct=ht.sent(),[2,ct];case 3:return ut=ht.sent(),this.logging&&console.log(ut),[2,null];case 4:return[2]}})})},lt.prototype.getBudget=function(){return nt(this,void 0,void 0,function(){var ct,ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> GETBUDGET"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.GETBUDGET)];case 2:return ct=dt.sent(),ut=ct.budget||ct.budget===0,ut?(this.budget=ct.budget,[2,ct]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.setBudget=function(){return nt(this,void 0,void 0,function(){var ct,ut,ht;return it(this,function(dt){switch(dt.label){case 0:if(this.logging&&console.log("=> SETBUDGET"),!this.isEnabled)return[2,null];dt.label=1;case 1:return dt.trys.push([1,3,,4]),[4,this.postMsg(ot.SETBUDGET)];case 2:return ct=dt.sent(),ut=ct.budget||ct.budget===0,ut?(this.budget=ct.budget,[2,ct]):[3,4];case 3:return ht=dt.sent(),this.logging&&console.log(ht),[2,null];case 4:return[2]}})})},lt.prototype.postMsg=function(ct,ut){var ht,dt=this;dt.active&&Promise.reject(new Error("User is busy")),dt.active=ct;var pt=window;return!((ht=pt.kmpJsBridge)===null||ht===void 0)&&ht.callNative?new Promise(function(mt,gt){pt.kmpJsBridge.callNative("sphinx-bridge",JSON.stringify(et({application:at,type:ct},ut||{})),function(bt){var yt={};try{yt=JSON.parse(bt)}catch{}yt||yt.application!==at||(dt.active=null,yt.error?gt(yt.error):mt(yt))})}):new Promise(function(mt,gt){rt.postMessage(et({application:at,type:ct},ut||{}));function bt(yt){!yt.data||yt.data.application!==at||(yt.data.error?(dt.active=null,gt(yt.data.error)):(dt.active=null,mt(yt.data)),rt.removeEventer(bt))}rt.addEventer(bt)})},lt}();tt.default=st})(lib$3);var dist$3=dist$4.exports;Object.defineProperty(dist$3,"__esModule",{value:!0});var lib_1=lib$3,sphinx=new lib_1.default;dist$4.exports=sphinx;var distExports$1=dist$4.exports,reactIs$3={exports:{}},reactIs_production_min$2={};/** * @license React * react-is.production.min.js * @@ -103,7 +103,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var b$4=Symbol.for("react.element"),c$5=Symbol.for("react.portal"),d$3=Symbol.for("react.fragment"),e$4=Symbol.for("react.strict_mode"),f$5=Symbol.for("react.profiler"),g$6=Symbol.for("react.provider"),h$8=Symbol.for("react.context"),k$7=Symbol.for("react.server_context"),l$4=Symbol.for("react.forward_ref"),m$5=Symbol.for("react.suspense"),n$5=Symbol.for("react.suspense_list"),p$5=Symbol.for("react.memo"),q$5=Symbol.for("react.lazy"),t$5=Symbol.for("react.offscreen"),u$3;u$3=Symbol.for("react.module.reference");function v$7(tt){if(typeof tt=="object"&&tt!==null){var et=tt.$$typeof;switch(et){case b$4:switch(tt=tt.type,tt){case d$3:case f$5:case e$4:case m$5:case n$5:return tt;default:switch(tt=tt&&tt.$$typeof,tt){case k$7:case h$8:case l$4:case q$5:case p$5:case g$6:return tt;default:return et}}case c$5:return et}}}reactIs_production_min$2.ContextConsumer=h$8;reactIs_production_min$2.ContextProvider=g$6;reactIs_production_min$2.Element=b$4;reactIs_production_min$2.ForwardRef=l$4;reactIs_production_min$2.Fragment=d$3;reactIs_production_min$2.Lazy=q$5;reactIs_production_min$2.Memo=p$5;reactIs_production_min$2.Portal=c$5;reactIs_production_min$2.Profiler=f$5;reactIs_production_min$2.StrictMode=e$4;reactIs_production_min$2.Suspense=m$5;reactIs_production_min$2.SuspenseList=n$5;reactIs_production_min$2.isAsyncMode=function(){return!1};reactIs_production_min$2.isConcurrentMode=function(){return!1};reactIs_production_min$2.isContextConsumer=function(tt){return v$7(tt)===h$8};reactIs_production_min$2.isContextProvider=function(tt){return v$7(tt)===g$6};reactIs_production_min$2.isElement=function(tt){return typeof tt=="object"&&tt!==null&&tt.$$typeof===b$4};reactIs_production_min$2.isForwardRef=function(tt){return v$7(tt)===l$4};reactIs_production_min$2.isFragment=function(tt){return v$7(tt)===d$3};reactIs_production_min$2.isLazy=function(tt){return v$7(tt)===q$5};reactIs_production_min$2.isMemo=function(tt){return v$7(tt)===p$5};reactIs_production_min$2.isPortal=function(tt){return v$7(tt)===c$5};reactIs_production_min$2.isProfiler=function(tt){return v$7(tt)===f$5};reactIs_production_min$2.isStrictMode=function(tt){return v$7(tt)===e$4};reactIs_production_min$2.isSuspense=function(tt){return v$7(tt)===m$5};reactIs_production_min$2.isSuspenseList=function(tt){return v$7(tt)===n$5};reactIs_production_min$2.isValidElementType=function(tt){return typeof tt=="string"||typeof tt=="function"||tt===d$3||tt===f$5||tt===e$4||tt===m$5||tt===n$5||tt===t$5||typeof tt=="object"&&tt!==null&&(tt.$$typeof===q$5||tt.$$typeof===p$5||tt.$$typeof===g$6||tt.$$typeof===h$8||tt.$$typeof===l$4||tt.$$typeof===u$3||tt.getModuleId!==void 0)};reactIs_production_min$2.typeOf=v$7;reactIs$3.exports=reactIs_production_min$2;var reactIsExports$2=reactIs$3.exports;function stylis_min(tt){function et(Mt,Vt,Qt,rn,Xt){for(var an=0,tn=0,pn=0,vn=0,sn,Zt,Sn=0,Tn=0,Cn,jn=Cn=sn=0,Un=0,yn=0,un=0,En=0,In=Qt.length,xn=In-1,dn,cn="",hn="",$n="",nn="",Kt;Unsn)&&(En=(cn=cn.replace(" ",":")).length),0rn&&(rn=(Vt=Vt.trim()).charCodeAt(0)),rn){case 38:return Vt.replace(yt,"$1"+Mt.trim());case 58:return Mt.trim()+Vt.replace(yt,"$1"+Mt.trim());default:if(0<1*Qt&&0tn.charCodeAt(8))break;case 115:Xt=Xt.replace(tn,"-webkit-"+tn)+";"+Xt;break;case 207:case 102:Xt=Xt.replace(tn,"-webkit-"+(102Qt.charCodeAt(0)&&(Qt=Qt.trim()),Dt=Qt,Qt=[Dt],0an)&&(gn=(sn=sn.replace(" ",":")).length),0cn&&(cn=(Vt=Vt.trim()).charCodeAt(0)),cn){case 38:return Vt.replace(yt,"$1"+Pt.trim());case 58:return Pt.trim()+Vt.replace(yt,"$1"+Pt.trim());default:if(0<1*nn&&0en.charCodeAt(8))break;case 115:Xt=Xt.replace(en,"-webkit-"+en)+";"+Xt;break;case 207:case 102:Xt=Xt.replace(en,"-webkit-"+(102nn.charCodeAt(0)&&(nn=nn.trim()),Dt=nn,nn=[Dt],01?et-1:0),it=1;it0?" Args: "+nt.join(", "):""))}var j$1=function(){function tt(nt){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=nt}var et=tt.prototype;return et.indexOfGroup=function(nt){for(var it=0,rt=0;rt=this.groupSizes.length){for(var rt=this.groupSizes,ot=rt.length,at=ot;nt>=at;)(at<<=1)<0&&D(16,""+nt);this.groupSizes=new Uint32Array(at),this.groupSizes.set(rt),this.length=at;for(var st=ot;st=this.length||this.groupSizes[nt]===0)return it;for(var rt=this.groupSizes[nt],ot=this.indexOfGroup(nt),at=ot+rt,st=ot;st=k$5&&(k$5=et+1),T.set(tt,et),x$5.set(et,tt)},M="style["+N+'][data-styled-version="5.3.11"]',G$1=new RegExp("^"+N+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),L=function(tt,et,nt){for(var it,rt=nt.split(","),ot=0,at=rt.length;ot=0;ct--){var ut=lt[ct];if(ut&&ut.nodeType===1&&ut.hasAttribute(N))return ut}}(nt),ot=rt!==void 0?rt.nextSibling:null;it.setAttribute(N,"active"),it.setAttribute("data-styled-version","5.3.11");var at=Y();return at&&it.setAttribute("nonce",at),nt.insertBefore(it,ot),it},H=function(){function tt(nt){var it=this.element=q$3(nt);it.appendChild(document.createTextNode("")),this.sheet=function(rt){if(rt.sheet)return rt.sheet;for(var ot=document.styleSheets,at=0,st=ot.length;at=0){var rt=document.createTextNode(it),ot=this.nodes[nt];return this.element.insertBefore(rt,ot||null),this.length++,!0}return!1},et.deleteRule=function(nt){this.element.removeChild(this.nodes[nt]),this.length--},et.getRule=function(nt){return nt0&&(ht+=dt+",")}),ot+=""+ct+ut+'{content:"'+ht+`"}/*!sc*/ -`}}}return ot}(this)},tt}(),Z=/(a)(d)/gi,K$5=function(tt){return String.fromCharCode(tt+(tt>25?39:97))};function Q(tt){var et,nt="";for(et=Math.abs(tt);et>52;et=et/52|0)nt=K$5(et%52)+nt;return(K$5(et%52)+nt).replace(Z,"$1-$2")}var ee=function(tt,et){for(var nt=et.length;nt;)tt=33*tt^et.charCodeAt(--nt);return tt},te=function(tt){return ee(5381,tt)};function ne(tt){for(var et=0;et>>0);if(!nt.hasNameForId(rt,st)){var lt=it(at,"."+st,void 0,rt);nt.insertRules(rt,st,lt)}ot.push(st),this.staticRulesId=st}else{for(var ct=this.rules.length,ut=ee(this.baseHash,it.hash),ht="",dt=0;dt>>0);if(!nt.hasNameForId(rt,bt)){var yt=it(ht,"."+bt,void 0,rt);nt.insertRules(rt,bt,yt)}ot.push(bt)}}return ot.join(" ")},tt}(),se=/^\s*\/\/.*$/gm,ie=[":","[",".","#"];function ae(tt){var et,nt,it,rt,ot=tt===void 0?w$4:tt,at=ot.options,st=at===void 0?w$4:at,lt=ot.plugins,ct=lt===void 0?S:lt,ut=new stylis_min(st),ht=[],dt=function(gt){function bt(yt){if(yt)try{gt(yt+"}")}catch{}}return function(yt,wt,vt,xt,St,Et,It,Tt,$t,Ut){switch(yt){case 1:if($t===0&&wt.charCodeAt(0)===64)return gt(wt+";"),"";break;case 2:if(Tt===0)return wt+"/*|*/";break;case 3:switch(Tt){case 102:case 112:return gt(vt[0]+wt),"";default:return wt+(Ut===0?"/*|*/":"")}case-2:wt.split("/*|*/}").forEach(bt)}}}(function(gt){ht.push(gt)}),pt=function(gt,bt,yt){return bt===0&&ie.indexOf(yt[nt.length])!==-1||yt.match(rt)?gt:"."+et};function mt(gt,bt,yt,wt){wt===void 0&&(wt="&");var vt=gt.replace(se,""),xt=bt&&yt?yt+" "+bt+" { "+vt+" }":vt;return et=wt,nt=bt,it=new RegExp("\\"+nt+"\\b","g"),rt=new RegExp("(\\"+nt+"\\b){2,}"),ut(yt||!bt?"":bt,xt)}return ut.use([].concat(ct,[function(gt,bt,yt){gt===2&&yt.length&&yt[0].lastIndexOf(nt)>0&&(yt[0]=yt[0].replace(it,pt))},dt,function(gt){if(gt===-2){var bt=ht;return ht=[],bt}}])),mt.hash=ct.length?ct.reduce(function(gt,bt){return bt.name||D(15),ee(gt,bt.name)},5381).toString():"",mt}var ce=React$1.createContext();ce.Consumer;var le=React$1.createContext(),de=(le.Consumer,new X),he=ae();function pe(){return reactExports.useContext(ce)||de}function fe(){return reactExports.useContext(le)||he}var ye=function(){function tt(et,nt){var it=this;this.inject=function(rt,ot){ot===void 0&&(ot=he);var at=it.name+ot.hash;rt.hasNameForId(it.id,at)||rt.insertRules(it.id,at,ot(it.rules,at,"@keyframes"))},this.toString=function(){return D(12,String(it.name))},this.name=et,this.id="sc-keyframes-"+et,this.rules=nt}return tt.prototype.getName=function(et){return et===void 0&&(et=he),this.name+et.hash},tt}(),ve=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(tt){return"-"+tt.toLowerCase()};function Ee(tt){return ve.test(tt)?tt.replace(ge,we).replace(Se,"-ms-"):tt}var be=function(tt){return tt==null||tt===!1||tt===""};function _e(tt,et,nt,it){if(Array.isArray(tt)){for(var rt,ot=[],at=0,st=tt.length;at1?et-1:0),it=1;it?@[\\\]^`{|}~-]+/g,De=/(^-|-$)/g;function je(tt){return tt.replace(Re,"-").replace(De,"")}var Te=function(tt){return Q(te(tt)>>>0)};function xe(tt){return typeof tt=="string"&&!0}var ke=function(tt){return typeof tt=="function"||typeof tt=="object"&&tt!==null&&!Array.isArray(tt)},Ve=function(tt){return tt!=="__proto__"&&tt!=="constructor"&&tt!=="prototype"};function Be(tt,et,nt){var it=tt[nt];ke(et)&&ke(it)?ze(it,et):tt[nt]=et}function ze(tt){for(var et=arguments.length,nt=new Array(et>1?et-1:0),it=1;it=0||(Ut[Tt]=Et[Tt]);return Ut}(et,["componentId"]),St=vt&&vt+"-"+(xe(wt)?wt:je(b$2(wt)));return Ye(wt,y$4({},xt,{attrs:dt,componentId:St}),nt)},Object.defineProperty(mt,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(wt){this._foldedDefaultProps=it?ze({},tt.defaultProps,wt):wt}}),Object.defineProperty(mt,"toString",{value:function(){return"."+mt.styledComponentId}}),rt&&hoistNonReactStatics$1(mt,tt,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),mt}var qe=function(tt){return function et(nt,it,rt){if(rt===void 0&&(rt=w$4),!reactIsExports$2.isValidElementType(it))return D(1,String(it));var ot=function(){return nt(it,rt,Ae.apply(void 0,arguments))};return ot.withConfig=function(at){return et(nt,it,y$4({},rt,{},at))},ot.attrs=function(at){return et(nt,it,y$4({},rt,{attrs:Array.prototype.concat(rt.attrs,at).filter(Boolean)}))},ot}(Ye,tt)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(tt){qe[tt]=qe(tt)});var He=function(){function tt(nt,it){this.rules=nt,this.componentId=it,this.isStatic=ne(nt),X.registerId(this.componentId+1)}var et=tt.prototype;return et.createStyles=function(nt,it,rt,ot){var at=ot(_e(this.rules,it,rt,ot).join(""),""),st=this.componentId+nt;rt.insertRules(st,st,at)},et.removeStyles=function(nt,it){it.clearRules(this.componentId+nt)},et.renderStyles=function(nt,it,rt,ot){nt>2&&X.registerId(this.componentId+nt),this.removeStyles(nt,rt),this.createStyles(nt,it,rt,ot)},tt}();function $e(tt){for(var et=arguments.length,nt=new Array(et>1?et-1:0),it=1;it1?et-1:0),it=1;it25?39:97))};function Q(tt){var et,nt="";for(et=Math.abs(tt);et>52;et=et/52|0)nt=K$5(et%52)+nt;return(K$5(et%52)+nt).replace(Z,"$1-$2")}var ee=function(tt,et){for(var nt=et.length;nt;)tt=33*tt^et.charCodeAt(--nt);return tt},te=function(tt){return ee(5381,tt)};function ne(tt){for(var et=0;et>>0);if(!nt.hasNameForId(rt,st)){var lt=it(at,"."+st,void 0,rt);nt.insertRules(rt,st,lt)}ot.push(st),this.staticRulesId=st}else{for(var ct=this.rules.length,ut=ee(this.baseHash,it.hash),ht="",dt=0;dt>>0);if(!nt.hasNameForId(rt,bt)){var yt=it(ht,"."+bt,void 0,rt);nt.insertRules(rt,bt,yt)}ot.push(bt)}}return ot.join(" ")},tt}(),se=/^\s*\/\/.*$/gm,ie=[":","[",".","#"];function ae(tt){var et,nt,it,rt,ot=tt===void 0?w$4:tt,at=ot.options,st=at===void 0?w$4:at,lt=ot.plugins,ct=lt===void 0?S:lt,ut=new stylis_min(st),ht=[],dt=function(gt){function bt(yt){if(yt)try{gt(yt+"}")}catch{}}return function(yt,wt,vt,xt,St,Et,$t,It,Ft,Ht){switch(yt){case 1:if(Ft===0&&wt.charCodeAt(0)===64)return gt(wt+";"),"";break;case 2:if(It===0)return wt+"/*|*/";break;case 3:switch(It){case 102:case 112:return gt(vt[0]+wt),"";default:return wt+(Ht===0?"/*|*/":"")}case-2:wt.split("/*|*/}").forEach(bt)}}}(function(gt){ht.push(gt)}),pt=function(gt,bt,yt){return bt===0&&ie.indexOf(yt[nt.length])!==-1||yt.match(rt)?gt:"."+et};function mt(gt,bt,yt,wt){wt===void 0&&(wt="&");var vt=gt.replace(se,""),xt=bt&&yt?yt+" "+bt+" { "+vt+" }":vt;return et=wt,nt=bt,it=new RegExp("\\"+nt+"\\b","g"),rt=new RegExp("(\\"+nt+"\\b){2,}"),ut(yt||!bt?"":bt,xt)}return ut.use([].concat(ct,[function(gt,bt,yt){gt===2&&yt.length&&yt[0].lastIndexOf(nt)>0&&(yt[0]=yt[0].replace(it,pt))},dt,function(gt){if(gt===-2){var bt=ht;return ht=[],bt}}])),mt.hash=ct.length?ct.reduce(function(gt,bt){return bt.name||D(15),ee(gt,bt.name)},5381).toString():"",mt}var ce=React$1.createContext();ce.Consumer;var le=React$1.createContext(),de=(le.Consumer,new X),he=ae();function pe(){return reactExports.useContext(ce)||de}function fe(){return reactExports.useContext(le)||he}var ye=function(){function tt(et,nt){var it=this;this.inject=function(rt,ot){ot===void 0&&(ot=he);var at=it.name+ot.hash;rt.hasNameForId(it.id,at)||rt.insertRules(it.id,at,ot(it.rules,at,"@keyframes"))},this.toString=function(){return D(12,String(it.name))},this.name=et,this.id="sc-keyframes-"+et,this.rules=nt}return tt.prototype.getName=function(et){return et===void 0&&(et=he),this.name+et.hash},tt}(),ve=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(tt){return"-"+tt.toLowerCase()};function Ee(tt){return ve.test(tt)?tt.replace(ge,we).replace(Se,"-ms-"):tt}var be=function(tt){return tt==null||tt===!1||tt===""};function _e(tt,et,nt,it){if(Array.isArray(tt)){for(var rt,ot=[],at=0,st=tt.length;at1?et-1:0),it=1;it?@[\\\]^`{|}~-]+/g,De=/(^-|-$)/g;function je(tt){return tt.replace(Re,"-").replace(De,"")}var Te=function(tt){return Q(te(tt)>>>0)};function xe(tt){return typeof tt=="string"&&!0}var ke=function(tt){return typeof tt=="function"||typeof tt=="object"&&tt!==null&&!Array.isArray(tt)},Ve=function(tt){return tt!=="__proto__"&&tt!=="constructor"&&tt!=="prototype"};function Be(tt,et,nt){var it=tt[nt];ke(et)&&ke(it)?ze(it,et):tt[nt]=et}function ze(tt){for(var et=arguments.length,nt=new Array(et>1?et-1:0),it=1;it=0||(Ht[It]=Et[It]);return Ht}(et,["componentId"]),St=vt&&vt+"-"+(xe(wt)?wt:je(b$2(wt)));return Ye(wt,y$4({},xt,{attrs:dt,componentId:St}),nt)},Object.defineProperty(mt,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(wt){this._foldedDefaultProps=it?ze({},tt.defaultProps,wt):wt}}),Object.defineProperty(mt,"toString",{value:function(){return"."+mt.styledComponentId}}),rt&&hoistNonReactStatics$1(mt,tt,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),mt}var qe=function(tt){return function et(nt,it,rt){if(rt===void 0&&(rt=w$4),!reactIsExports$2.isValidElementType(it))return D(1,String(it));var ot=function(){return nt(it,rt,Ae.apply(void 0,arguments))};return ot.withConfig=function(at){return et(nt,it,y$4({},rt,{},at))},ot.attrs=function(at){return et(nt,it,y$4({},rt,{attrs:Array.prototype.concat(rt.attrs,at).filter(Boolean)}))},ot}(Ye,tt)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(tt){qe[tt]=qe(tt)});var He=function(){function tt(nt,it){this.rules=nt,this.componentId=it,this.isStatic=ne(nt),X.registerId(this.componentId+1)}var et=tt.prototype;return et.createStyles=function(nt,it,rt,ot){var at=ot(_e(this.rules,it,rt,ot).join(""),""),st=this.componentId+nt;rt.insertRules(st,st,at)},et.removeStyles=function(nt,it){it.clearRules(this.componentId+nt)},et.renderStyles=function(nt,it,rt,ot){nt>2&&X.registerId(this.componentId+nt),this.removeStyles(nt,rt),this.createStyles(nt,it,rt,ot)},tt}();function $e(tt){for(var et=arguments.length,nt=new Array(et>1?et-1:0),it=1;it1?et-1:0),it=1;ittt&&`background-color: ${colors[tt]};`} `,switchProp$3=(tt,et)=>{switch(tt){case"borderColor":return`border-color: ${et};`;case"borderRadius":return`border-radius: ${et}px;`;case"borderRadiusBottomLeft":return`border-bottom-left-radius: ${et}px;`;case"borderRadiusBottomRight":return`border-bottom-right-radius: ${et}px;`;case"borderRadiusTopLeft":return`border-top-left-radius: ${et}px;`;case"borderRadiusTopRight":return`border-top-right-radius: ${et}px;`;case"borderSize":return` border-style: solid; @@ -185,7 +185,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * @license * Copyright 2010-2022 Three.js Authors * SPDX-License-Identifier: MIT - */const REVISION="143",MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},CullFaceNone=0,CullFaceBack=1,CullFaceFront=2,CullFaceFrontBack=3,BasicShadowMap=0,PCFShadowMap=1,PCFSoftShadowMap=2,VSMShadowMap=3,FrontSide=0,BackSide=1,DoubleSide=2,FlatShading=1,SmoothShading=2,NoBlending=0,NormalBlending=1,AdditiveBlending=2,SubtractiveBlending=3,MultiplyBlending=4,CustomBlending=5,AddEquation=100,SubtractEquation=101,ReverseSubtractEquation=102,MinEquation=103,MaxEquation=104,ZeroFactor=200,OneFactor=201,SrcColorFactor=202,OneMinusSrcColorFactor=203,SrcAlphaFactor=204,OneMinusSrcAlphaFactor=205,DstAlphaFactor=206,OneMinusDstAlphaFactor=207,DstColorFactor=208,OneMinusDstColorFactor=209,SrcAlphaSaturateFactor=210,NeverDepth=0,AlwaysDepth=1,LessDepth=2,LessEqualDepth=3,EqualDepth=4,GreaterEqualDepth=5,GreaterDepth=6,NotEqualDepth=7,MultiplyOperation=0,MixOperation=1,AddOperation=2,NoToneMapping=0,LinearToneMapping=1,ReinhardToneMapping=2,CineonToneMapping=3,ACESFilmicToneMapping=4,CustomToneMapping=5,UVMapping=300,CubeReflectionMapping=301,CubeRefractionMapping=302,EquirectangularReflectionMapping=303,EquirectangularRefractionMapping=304,CubeUVReflectionMapping=306,RepeatWrapping=1e3,ClampToEdgeWrapping=1001,MirroredRepeatWrapping=1002,NearestFilter=1003,NearestMipmapNearestFilter=1004,NearestMipMapNearestFilter=1004,NearestMipmapLinearFilter=1005,NearestMipMapLinearFilter=1005,LinearFilter=1006,LinearMipmapNearestFilter=1007,LinearMipMapNearestFilter=1007,LinearMipmapLinearFilter=1008,LinearMipMapLinearFilter=1008,UnsignedByteType=1009,ByteType=1010,ShortType=1011,UnsignedShortType=1012,IntType=1013,UnsignedIntType=1014,FloatType=1015,HalfFloatType=1016,UnsignedShort4444Type=1017,UnsignedShort5551Type=1018,UnsignedInt248Type=1020,AlphaFormat=1021,RGBFormat=1022,RGBAFormat=1023,LuminanceFormat=1024,LuminanceAlphaFormat=1025,DepthFormat=1026,DepthStencilFormat=1027,RedFormat=1028,RedIntegerFormat=1029,RGFormat=1030,RGIntegerFormat=1031,RGBAIntegerFormat=1033,RGB_S3TC_DXT1_Format=33776,RGBA_S3TC_DXT1_Format=33777,RGBA_S3TC_DXT3_Format=33778,RGBA_S3TC_DXT5_Format=33779,RGB_PVRTC_4BPPV1_Format=35840,RGB_PVRTC_2BPPV1_Format=35841,RGBA_PVRTC_4BPPV1_Format=35842,RGBA_PVRTC_2BPPV1_Format=35843,RGB_ETC1_Format=36196,RGB_ETC2_Format=37492,RGBA_ETC2_EAC_Format=37496,RGBA_ASTC_4x4_Format=37808,RGBA_ASTC_5x4_Format=37809,RGBA_ASTC_5x5_Format=37810,RGBA_ASTC_6x5_Format=37811,RGBA_ASTC_6x6_Format=37812,RGBA_ASTC_8x5_Format=37813,RGBA_ASTC_8x6_Format=37814,RGBA_ASTC_8x8_Format=37815,RGBA_ASTC_10x5_Format=37816,RGBA_ASTC_10x6_Format=37817,RGBA_ASTC_10x8_Format=37818,RGBA_ASTC_10x10_Format=37819,RGBA_ASTC_12x10_Format=37820,RGBA_ASTC_12x12_Format=37821,RGBA_BPTC_Format=36492,LoopOnce=2200,LoopRepeat=2201,LoopPingPong=2202,InterpolateDiscrete=2300,InterpolateLinear=2301,InterpolateSmooth=2302,ZeroCurvatureEnding=2400,ZeroSlopeEnding=2401,WrapAroundEnding=2402,NormalAnimationBlendMode=2500,AdditiveAnimationBlendMode=2501,TrianglesDrawMode=0,TriangleStripDrawMode=1,TriangleFanDrawMode=2,LinearEncoding=3e3,sRGBEncoding=3001,BasicDepthPacking=3200,RGBADepthPacking=3201,TangentSpaceNormalMap=0,ObjectSpaceNormalMap=1,NoColorSpace$1="",SRGBColorSpace$1="srgb",LinearSRGBColorSpace$1="srgb-linear",ZeroStencilOp=0,KeepStencilOp=7680,ReplaceStencilOp=7681,IncrementStencilOp=7682,DecrementStencilOp=7683,IncrementWrapStencilOp=34055,DecrementWrapStencilOp=34056,InvertStencilOp=5386,NeverStencilFunc=512,LessStencilFunc=513,EqualStencilFunc=514,LessEqualStencilFunc=515,GreaterStencilFunc=516,NotEqualStencilFunc=517,GreaterEqualStencilFunc=518,AlwaysStencilFunc=519,StaticDrawUsage=35044,DynamicDrawUsage=35048,StreamDrawUsage=35040,StaticReadUsage=35045,DynamicReadUsage=35049,StreamReadUsage=35041,StaticCopyUsage=35046,DynamicCopyUsage=35050,StreamCopyUsage=35042,GLSL1="100",GLSL3="300 es",_SRGBAFormat=1035;let EventDispatcher$1=class{addEventListener(et,nt){this._listeners===void 0&&(this._listeners={});const it=this._listeners;it[et]===void 0&&(it[et]=[]),it[et].indexOf(nt)===-1&&it[et].push(nt)}hasEventListener(et,nt){if(this._listeners===void 0)return!1;const it=this._listeners;return it[et]!==void 0&&it[et].indexOf(nt)!==-1}removeEventListener(et,nt){if(this._listeners===void 0)return;const rt=this._listeners[et];if(rt!==void 0){const ot=rt.indexOf(nt);ot!==-1&&rt.splice(ot,1)}}dispatchEvent(et){if(this._listeners===void 0)return;const it=this._listeners[et.type];if(it!==void 0){et.target=this;const rt=it.slice(0);for(let ot=0,at=rt.length;ot>8&255]+_lut$1[tt>>16&255]+_lut$1[tt>>24&255]+"-"+_lut$1[et&255]+_lut$1[et>>8&255]+"-"+_lut$1[et>>16&15|64]+_lut$1[et>>24&255]+"-"+_lut$1[nt&63|128]+_lut$1[nt>>8&255]+"-"+_lut$1[nt>>16&255]+_lut$1[nt>>24&255]+_lut$1[it&255]+_lut$1[it>>8&255]+_lut$1[it>>16&255]+_lut$1[it>>24&255]).toLowerCase()}function clamp$6(tt,et,nt){return Math.max(et,Math.min(nt,tt))}function euclideanModulo(tt,et){return(tt%et+et)%et}function mapLinear(tt,et,nt,it,rt){return it+(tt-et)*(rt-it)/(nt-et)}function inverseLerp(tt,et,nt){return tt!==et?(nt-tt)/(et-tt):0}function lerp(tt,et,nt){return(1-nt)*tt+nt*et}function damp(tt,et,nt,it){return lerp(tt,et,1-Math.exp(-nt*it))}function pingpong(tt,et=1){return et-Math.abs(euclideanModulo(tt,et*2)-et)}function smoothstep(tt,et,nt){return tt<=et?0:tt>=nt?1:(tt=(tt-et)/(nt-et),tt*tt*(3-2*tt))}function smootherstep(tt,et,nt){return tt<=et?0:tt>=nt?1:(tt=(tt-et)/(nt-et),tt*tt*tt*(tt*(tt*6-15)+10))}function randInt(tt,et){return tt+Math.floor(Math.random()*(et-tt+1))}function randFloat(tt,et){return tt+Math.random()*(et-tt)}function randFloatSpread(tt){return tt*(.5-Math.random())}function seededRandom(tt){tt!==void 0&&(_seed=tt);let et=_seed+=1831565813;return et=Math.imul(et^et>>>15,et|1),et^=et+Math.imul(et^et>>>7,et|61),((et^et>>>14)>>>0)/4294967296}function degToRad(tt){return tt*DEG2RAD$1}function radToDeg(tt){return tt*RAD2DEG}function isPowerOfTwo(tt){return(tt&tt-1)===0&&tt!==0}function ceilPowerOfTwo(tt){return Math.pow(2,Math.ceil(Math.log(tt)/Math.LN2))}function floorPowerOfTwo(tt){return Math.pow(2,Math.floor(Math.log(tt)/Math.LN2))}function setQuaternionFromProperEuler(tt,et,nt,it,rt){const ot=Math.cos,at=Math.sin,st=ot(nt/2),lt=at(nt/2),ct=ot((et+it)/2),ut=at((et+it)/2),ht=ot((et-it)/2),dt=at((et-it)/2),pt=ot((it-et)/2),mt=at((it-et)/2);switch(rt){case"XYX":tt.set(st*ut,lt*ht,lt*dt,st*ct);break;case"YZY":tt.set(lt*dt,st*ut,lt*ht,st*ct);break;case"ZXZ":tt.set(lt*ht,lt*dt,st*ut,st*ct);break;case"XZX":tt.set(st*ut,lt*mt,lt*pt,st*ct);break;case"YXY":tt.set(lt*pt,st*ut,lt*mt,st*ct);break;case"ZYZ":tt.set(lt*mt,lt*pt,st*ut,st*ct);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+rt)}}function denormalize$1(tt,et){switch(et.constructor){case Float32Array:return tt;case Uint16Array:return tt/65535;case Uint8Array:return tt/255;case Int16Array:return Math.max(tt/32767,-1);case Int8Array:return Math.max(tt/127,-1);default:throw new Error("Invalid component type.")}}function normalize$4(tt,et){switch(et.constructor){case Float32Array:return tt;case Uint16Array:return Math.round(tt*65535);case Uint8Array:return Math.round(tt*255);case Int16Array:return Math.round(tt*32767);case Int8Array:return Math.round(tt*127);default:throw new Error("Invalid component type.")}}var MathUtils=Object.freeze({__proto__:null,DEG2RAD:DEG2RAD$1,RAD2DEG,generateUUID:generateUUID$1,clamp:clamp$6,euclideanModulo,mapLinear,inverseLerp,lerp,damp,pingpong,smoothstep,smootherstep,randInt,randFloat,randFloatSpread,seededRandom,degToRad,radToDeg,isPowerOfTwo,ceilPowerOfTwo,floorPowerOfTwo,setQuaternionFromProperEuler,normalize:normalize$4,denormalize:denormalize$1});class Vector2{constructor(et=0,nt=0){Vector2.prototype.isVector2=!0,this.x=et,this.y=nt}get width(){return this.x}set width(et){this.x=et}get height(){return this.y}set height(et){this.y=et}set(et,nt){return this.x=et,this.y=nt,this}setScalar(et){return this.x=et,this.y=et,this}setX(et){return this.x=et,this}setY(et){return this.y=et,this}setComponent(et,nt){switch(et){case 0:this.x=nt;break;case 1:this.y=nt;break;default:throw new Error("index is out of range: "+et)}return this}getComponent(et){switch(et){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+et)}}clone(){return new this.constructor(this.x,this.y)}copy(et){return this.x=et.x,this.y=et.y,this}add(et){return this.x+=et.x,this.y+=et.y,this}addScalar(et){return this.x+=et,this.y+=et,this}addVectors(et,nt){return this.x=et.x+nt.x,this.y=et.y+nt.y,this}addScaledVector(et,nt){return this.x+=et.x*nt,this.y+=et.y*nt,this}sub(et){return this.x-=et.x,this.y-=et.y,this}subScalar(et){return this.x-=et,this.y-=et,this}subVectors(et,nt){return this.x=et.x-nt.x,this.y=et.y-nt.y,this}multiply(et){return this.x*=et.x,this.y*=et.y,this}multiplyScalar(et){return this.x*=et,this.y*=et,this}divide(et){return this.x/=et.x,this.y/=et.y,this}divideScalar(et){return this.multiplyScalar(1/et)}applyMatrix3(et){const nt=this.x,it=this.y,rt=et.elements;return this.x=rt[0]*nt+rt[3]*it+rt[6],this.y=rt[1]*nt+rt[4]*it+rt[7],this}min(et){return this.x=Math.min(this.x,et.x),this.y=Math.min(this.y,et.y),this}max(et){return this.x=Math.max(this.x,et.x),this.y=Math.max(this.y,et.y),this}clamp(et,nt){return this.x=Math.max(et.x,Math.min(nt.x,this.x)),this.y=Math.max(et.y,Math.min(nt.y,this.y)),this}clampScalar(et,nt){return this.x=Math.max(et,Math.min(nt,this.x)),this.y=Math.max(et,Math.min(nt,this.y)),this}clampLength(et,nt){const it=this.length();return this.divideScalar(it||1).multiplyScalar(Math.max(et,Math.min(nt,it)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(et){return this.x*et.x+this.y*et.y}cross(et){return this.x*et.y-this.y*et.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(et){return Math.sqrt(this.distanceToSquared(et))}distanceToSquared(et){const nt=this.x-et.x,it=this.y-et.y;return nt*nt+it*it}manhattanDistanceTo(et){return Math.abs(this.x-et.x)+Math.abs(this.y-et.y)}setLength(et){return this.normalize().multiplyScalar(et)}lerp(et,nt){return this.x+=(et.x-this.x)*nt,this.y+=(et.y-this.y)*nt,this}lerpVectors(et,nt,it){return this.x=et.x+(nt.x-et.x)*it,this.y=et.y+(nt.y-et.y)*it,this}equals(et){return et.x===this.x&&et.y===this.y}fromArray(et,nt=0){return this.x=et[nt],this.y=et[nt+1],this}toArray(et=[],nt=0){return et[nt]=this.x,et[nt+1]=this.y,et}fromBufferAttribute(et,nt){return this.x=et.getX(nt),this.y=et.getY(nt),this}rotateAround(et,nt){const it=Math.cos(nt),rt=Math.sin(nt),ot=this.x-et.x,at=this.y-et.y;return this.x=ot*it-at*rt+et.x,this.y=ot*rt+at*it+et.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(et,nt,it,rt,ot,at,st,lt,ct){const ut=this.elements;return ut[0]=et,ut[1]=rt,ut[2]=st,ut[3]=nt,ut[4]=ot,ut[5]=lt,ut[6]=it,ut[7]=at,ut[8]=ct,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(et){const nt=this.elements,it=et.elements;return nt[0]=it[0],nt[1]=it[1],nt[2]=it[2],nt[3]=it[3],nt[4]=it[4],nt[5]=it[5],nt[6]=it[6],nt[7]=it[7],nt[8]=it[8],this}extractBasis(et,nt,it){return et.setFromMatrix3Column(this,0),nt.setFromMatrix3Column(this,1),it.setFromMatrix3Column(this,2),this}setFromMatrix4(et){const nt=et.elements;return this.set(nt[0],nt[4],nt[8],nt[1],nt[5],nt[9],nt[2],nt[6],nt[10]),this}multiply(et){return this.multiplyMatrices(this,et)}premultiply(et){return this.multiplyMatrices(et,this)}multiplyMatrices(et,nt){const it=et.elements,rt=nt.elements,ot=this.elements,at=it[0],st=it[3],lt=it[6],ct=it[1],ut=it[4],ht=it[7],dt=it[2],pt=it[5],mt=it[8],gt=rt[0],bt=rt[3],yt=rt[6],wt=rt[1],vt=rt[4],xt=rt[7],St=rt[2],Et=rt[5],It=rt[8];return ot[0]=at*gt+st*wt+lt*St,ot[3]=at*bt+st*vt+lt*Et,ot[6]=at*yt+st*xt+lt*It,ot[1]=ct*gt+ut*wt+ht*St,ot[4]=ct*bt+ut*vt+ht*Et,ot[7]=ct*yt+ut*xt+ht*It,ot[2]=dt*gt+pt*wt+mt*St,ot[5]=dt*bt+pt*vt+mt*Et,ot[8]=dt*yt+pt*xt+mt*It,this}multiplyScalar(et){const nt=this.elements;return nt[0]*=et,nt[3]*=et,nt[6]*=et,nt[1]*=et,nt[4]*=et,nt[7]*=et,nt[2]*=et,nt[5]*=et,nt[8]*=et,this}determinant(){const et=this.elements,nt=et[0],it=et[1],rt=et[2],ot=et[3],at=et[4],st=et[5],lt=et[6],ct=et[7],ut=et[8];return nt*at*ut-nt*st*ct-it*ot*ut+it*st*lt+rt*ot*ct-rt*at*lt}invert(){const et=this.elements,nt=et[0],it=et[1],rt=et[2],ot=et[3],at=et[4],st=et[5],lt=et[6],ct=et[7],ut=et[8],ht=ut*at-st*ct,dt=st*lt-ut*ot,pt=ct*ot-at*lt,mt=nt*ht+it*dt+rt*pt;if(mt===0)return this.set(0,0,0,0,0,0,0,0,0);const gt=1/mt;return et[0]=ht*gt,et[1]=(rt*ct-ut*it)*gt,et[2]=(st*it-rt*at)*gt,et[3]=dt*gt,et[4]=(ut*nt-rt*lt)*gt,et[5]=(rt*ot-st*nt)*gt,et[6]=pt*gt,et[7]=(it*lt-ct*nt)*gt,et[8]=(at*nt-it*ot)*gt,this}transpose(){let et;const nt=this.elements;return et=nt[1],nt[1]=nt[3],nt[3]=et,et=nt[2],nt[2]=nt[6],nt[6]=et,et=nt[5],nt[5]=nt[7],nt[7]=et,this}getNormalMatrix(et){return this.setFromMatrix4(et).invert().transpose()}transposeIntoArray(et){const nt=this.elements;return et[0]=nt[0],et[1]=nt[3],et[2]=nt[6],et[3]=nt[1],et[4]=nt[4],et[5]=nt[7],et[6]=nt[2],et[7]=nt[5],et[8]=nt[8],this}setUvTransform(et,nt,it,rt,ot,at,st){const lt=Math.cos(ot),ct=Math.sin(ot);return this.set(it*lt,it*ct,-it*(lt*at+ct*st)+at+et,-rt*ct,rt*lt,-rt*(-ct*at+lt*st)+st+nt,0,0,1),this}scale(et,nt){const it=this.elements;return it[0]*=et,it[3]*=et,it[6]*=et,it[1]*=nt,it[4]*=nt,it[7]*=nt,this}rotate(et){const nt=Math.cos(et),it=Math.sin(et),rt=this.elements,ot=rt[0],at=rt[3],st=rt[6],lt=rt[1],ct=rt[4],ut=rt[7];return rt[0]=nt*ot+it*lt,rt[3]=nt*at+it*ct,rt[6]=nt*st+it*ut,rt[1]=-it*ot+nt*lt,rt[4]=-it*at+nt*ct,rt[7]=-it*st+nt*ut,this}translate(et,nt){const it=this.elements;return it[0]+=et*it[2],it[3]+=et*it[5],it[6]+=et*it[8],it[1]+=nt*it[2],it[4]+=nt*it[5],it[7]+=nt*it[8],this}equals(et){const nt=this.elements,it=et.elements;for(let rt=0;rt<9;rt++)if(nt[rt]!==it[rt])return!1;return!0}fromArray(et,nt=0){for(let it=0;it<9;it++)this.elements[it]=et[it+nt];return this}toArray(et=[],nt=0){const it=this.elements;return et[nt]=it[0],et[nt+1]=it[1],et[nt+2]=it[2],et[nt+3]=it[3],et[nt+4]=it[4],et[nt+5]=it[5],et[nt+6]=it[6],et[nt+7]=it[7],et[nt+8]=it[8],et}clone(){return new this.constructor().fromArray(this.elements)}}function arrayNeedsUint32(tt){for(let et=tt.length-1;et>=0;--et)if(tt[et]>65535)return!0;return!1}const TYPED_ARRAYS={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function getTypedArray(tt,et){return new TYPED_ARRAYS[tt](et)}function createElementNS(tt){return document.createElementNS("http://www.w3.org/1999/xhtml",tt)}function SRGBToLinear(tt){return tt<.04045?tt*.0773993808:Math.pow(tt*.9478672986+.0521327014,2.4)}function LinearToSRGB(tt){return tt<.0031308?tt*12.92:1.055*Math.pow(tt,.41666)-.055}const FN={[SRGBColorSpace$1]:{[LinearSRGBColorSpace$1]:SRGBToLinear},[LinearSRGBColorSpace$1]:{[SRGBColorSpace$1]:LinearToSRGB}},ColorManagement={legacyMode:!0,get workingColorSpace(){return LinearSRGBColorSpace$1},set workingColorSpace(tt){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(tt,et,nt){if(this.legacyMode||et===nt||!et||!nt)return tt;if(FN[et]&&FN[et][nt]!==void 0){const it=FN[et][nt];return tt.r=it(tt.r),tt.g=it(tt.g),tt.b=it(tt.b),tt}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(tt,et){return this.convert(tt,this.workingColorSpace,et)},toWorkingColorSpace:function(tt,et){return this.convert(tt,et,this.workingColorSpace)}},_colorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},_rgb={r:0,g:0,b:0},_hslA={h:0,s:0,l:0},_hslB={h:0,s:0,l:0};function hue2rgb(tt,et,nt){return nt<0&&(nt+=1),nt>1&&(nt-=1),nt<1/6?tt+(et-tt)*6*nt:nt<1/2?et:nt<2/3?tt+(et-tt)*6*(2/3-nt):tt}function toComponents(tt,et){return et.r=tt.r,et.g=tt.g,et.b=tt.b,et}let Color$1=class{constructor(et,nt,it){return this.isColor=!0,this.r=1,this.g=1,this.b=1,nt===void 0&&it===void 0?this.set(et):this.setRGB(et,nt,it)}set(et){return et&&et.isColor?this.copy(et):typeof et=="number"?this.setHex(et):typeof et=="string"&&this.setStyle(et),this}setScalar(et){return this.r=et,this.g=et,this.b=et,this}setHex(et,nt=SRGBColorSpace$1){return et=Math.floor(et),this.r=(et>>16&255)/255,this.g=(et>>8&255)/255,this.b=(et&255)/255,ColorManagement.toWorkingColorSpace(this,nt),this}setRGB(et,nt,it,rt=LinearSRGBColorSpace$1){return this.r=et,this.g=nt,this.b=it,ColorManagement.toWorkingColorSpace(this,rt),this}setHSL(et,nt,it,rt=LinearSRGBColorSpace$1){if(et=euclideanModulo(et,1),nt=clamp$6(nt,0,1),it=clamp$6(it,0,1),nt===0)this.r=this.g=this.b=it;else{const ot=it<=.5?it*(1+nt):it+nt-it*nt,at=2*it-ot;this.r=hue2rgb(at,ot,et+1/3),this.g=hue2rgb(at,ot,et),this.b=hue2rgb(at,ot,et-1/3)}return ColorManagement.toWorkingColorSpace(this,rt),this}setStyle(et,nt=SRGBColorSpace$1){function it(ot){ot!==void 0&&parseFloat(ot)<1&&console.warn("THREE.Color: Alpha component of "+et+" will be ignored.")}let rt;if(rt=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(et)){let ot;const at=rt[1],st=rt[2];switch(at){case"rgb":case"rgba":if(ot=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(st))return this.r=Math.min(255,parseInt(ot[1],10))/255,this.g=Math.min(255,parseInt(ot[2],10))/255,this.b=Math.min(255,parseInt(ot[3],10))/255,ColorManagement.toWorkingColorSpace(this,nt),it(ot[4]),this;if(ot=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(st))return this.r=Math.min(100,parseInt(ot[1],10))/100,this.g=Math.min(100,parseInt(ot[2],10))/100,this.b=Math.min(100,parseInt(ot[3],10))/100,ColorManagement.toWorkingColorSpace(this,nt),it(ot[4]),this;break;case"hsl":case"hsla":if(ot=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(st)){const lt=parseFloat(ot[1])/360,ct=parseInt(ot[2],10)/100,ut=parseInt(ot[3],10)/100;return it(ot[4]),this.setHSL(lt,ct,ut,nt)}break}}else if(rt=/^\#([A-Fa-f\d]+)$/.exec(et)){const ot=rt[1],at=ot.length;if(at===3)return this.r=parseInt(ot.charAt(0)+ot.charAt(0),16)/255,this.g=parseInt(ot.charAt(1)+ot.charAt(1),16)/255,this.b=parseInt(ot.charAt(2)+ot.charAt(2),16)/255,ColorManagement.toWorkingColorSpace(this,nt),this;if(at===6)return this.r=parseInt(ot.charAt(0)+ot.charAt(1),16)/255,this.g=parseInt(ot.charAt(2)+ot.charAt(3),16)/255,this.b=parseInt(ot.charAt(4)+ot.charAt(5),16)/255,ColorManagement.toWorkingColorSpace(this,nt),this}return et&&et.length>0?this.setColorName(et,nt):this}setColorName(et,nt=SRGBColorSpace$1){const it=_colorKeywords[et.toLowerCase()];return it!==void 0?this.setHex(it,nt):console.warn("THREE.Color: Unknown color "+et),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(et){return this.r=et.r,this.g=et.g,this.b=et.b,this}copySRGBToLinear(et){return this.r=SRGBToLinear(et.r),this.g=SRGBToLinear(et.g),this.b=SRGBToLinear(et.b),this}copyLinearToSRGB(et){return this.r=LinearToSRGB(et.r),this.g=LinearToSRGB(et.g),this.b=LinearToSRGB(et.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(et=SRGBColorSpace$1){return ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),et),clamp$6(_rgb.r*255,0,255)<<16^clamp$6(_rgb.g*255,0,255)<<8^clamp$6(_rgb.b*255,0,255)<<0}getHexString(et=SRGBColorSpace$1){return("000000"+this.getHex(et).toString(16)).slice(-6)}getHSL(et,nt=LinearSRGBColorSpace$1){ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),nt);const it=_rgb.r,rt=_rgb.g,ot=_rgb.b,at=Math.max(it,rt,ot),st=Math.min(it,rt,ot);let lt,ct;const ut=(st+at)/2;if(st===at)lt=0,ct=0;else{const ht=at-st;switch(ct=ut<=.5?ht/(at+st):ht/(2-at-st),at){case it:lt=(rt-ot)/ht+(rt"u")return et.src;let nt;if(et instanceof HTMLCanvasElement)nt=et;else{_canvas===void 0&&(_canvas=createElementNS("canvas")),_canvas.width=et.width,_canvas.height=et.height;const it=_canvas.getContext("2d");et instanceof ImageData?it.putImageData(et,0,0):it.drawImage(et,0,0,et.width,et.height),nt=_canvas}return nt.width>2048||nt.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",et),nt.toDataURL("image/jpeg",.6)):nt.toDataURL("image/png")}static sRGBToLinear(et){if(typeof HTMLImageElement<"u"&&et instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&et instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&et instanceof ImageBitmap){const nt=createElementNS("canvas");nt.width=et.width,nt.height=et.height;const it=nt.getContext("2d");it.drawImage(et,0,0,et.width,et.height);const rt=it.getImageData(0,0,et.width,et.height),ot=rt.data;for(let at=0;at1)switch(this.wrapS){case RepeatWrapping:et.x=et.x-Math.floor(et.x);break;case ClampToEdgeWrapping:et.x=et.x<0?0:1;break;case MirroredRepeatWrapping:Math.abs(Math.floor(et.x)%2)===1?et.x=Math.ceil(et.x)-et.x:et.x=et.x-Math.floor(et.x);break}if(et.y<0||et.y>1)switch(this.wrapT){case RepeatWrapping:et.y=et.y-Math.floor(et.y);break;case ClampToEdgeWrapping:et.y=et.y<0?0:1;break;case MirroredRepeatWrapping:Math.abs(Math.floor(et.y)%2)===1?et.y=Math.ceil(et.y)-et.y:et.y=et.y-Math.floor(et.y);break}return this.flipY&&(et.y=1-et.y),et}set needsUpdate(et){et===!0&&(this.version++,this.source.needsUpdate=!0)}}Texture.DEFAULT_IMAGE=null;Texture.DEFAULT_MAPPING=UVMapping;class Vector4{constructor(et=0,nt=0,it=0,rt=1){Vector4.prototype.isVector4=!0,this.x=et,this.y=nt,this.z=it,this.w=rt}get width(){return this.z}set width(et){this.z=et}get height(){return this.w}set height(et){this.w=et}set(et,nt,it,rt){return this.x=et,this.y=nt,this.z=it,this.w=rt,this}setScalar(et){return this.x=et,this.y=et,this.z=et,this.w=et,this}setX(et){return this.x=et,this}setY(et){return this.y=et,this}setZ(et){return this.z=et,this}setW(et){return this.w=et,this}setComponent(et,nt){switch(et){case 0:this.x=nt;break;case 1:this.y=nt;break;case 2:this.z=nt;break;case 3:this.w=nt;break;default:throw new Error("index is out of range: "+et)}return this}getComponent(et){switch(et){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+et)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(et){return this.x=et.x,this.y=et.y,this.z=et.z,this.w=et.w!==void 0?et.w:1,this}add(et){return this.x+=et.x,this.y+=et.y,this.z+=et.z,this.w+=et.w,this}addScalar(et){return this.x+=et,this.y+=et,this.z+=et,this.w+=et,this}addVectors(et,nt){return this.x=et.x+nt.x,this.y=et.y+nt.y,this.z=et.z+nt.z,this.w=et.w+nt.w,this}addScaledVector(et,nt){return this.x+=et.x*nt,this.y+=et.y*nt,this.z+=et.z*nt,this.w+=et.w*nt,this}sub(et){return this.x-=et.x,this.y-=et.y,this.z-=et.z,this.w-=et.w,this}subScalar(et){return this.x-=et,this.y-=et,this.z-=et,this.w-=et,this}subVectors(et,nt){return this.x=et.x-nt.x,this.y=et.y-nt.y,this.z=et.z-nt.z,this.w=et.w-nt.w,this}multiply(et){return this.x*=et.x,this.y*=et.y,this.z*=et.z,this.w*=et.w,this}multiplyScalar(et){return this.x*=et,this.y*=et,this.z*=et,this.w*=et,this}applyMatrix4(et){const nt=this.x,it=this.y,rt=this.z,ot=this.w,at=et.elements;return this.x=at[0]*nt+at[4]*it+at[8]*rt+at[12]*ot,this.y=at[1]*nt+at[5]*it+at[9]*rt+at[13]*ot,this.z=at[2]*nt+at[6]*it+at[10]*rt+at[14]*ot,this.w=at[3]*nt+at[7]*it+at[11]*rt+at[15]*ot,this}divideScalar(et){return this.multiplyScalar(1/et)}setAxisAngleFromQuaternion(et){this.w=2*Math.acos(et.w);const nt=Math.sqrt(1-et.w*et.w);return nt<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=et.x/nt,this.y=et.y/nt,this.z=et.z/nt),this}setAxisAngleFromRotationMatrix(et){let nt,it,rt,ot;const lt=et.elements,ct=lt[0],ut=lt[4],ht=lt[8],dt=lt[1],pt=lt[5],mt=lt[9],gt=lt[2],bt=lt[6],yt=lt[10];if(Math.abs(ut-dt)<.01&&Math.abs(ht-gt)<.01&&Math.abs(mt-bt)<.01){if(Math.abs(ut+dt)<.1&&Math.abs(ht+gt)<.1&&Math.abs(mt+bt)<.1&&Math.abs(ct+pt+yt-3)<.1)return this.set(1,0,0,0),this;nt=Math.PI;const vt=(ct+1)/2,xt=(pt+1)/2,St=(yt+1)/2,Et=(ut+dt)/4,It=(ht+gt)/4,Tt=(mt+bt)/4;return vt>xt&&vt>St?vt<.01?(it=0,rt=.707106781,ot=.707106781):(it=Math.sqrt(vt),rt=Et/it,ot=It/it):xt>St?xt<.01?(it=.707106781,rt=0,ot=.707106781):(rt=Math.sqrt(xt),it=Et/rt,ot=Tt/rt):St<.01?(it=.707106781,rt=.707106781,ot=0):(ot=Math.sqrt(St),it=It/ot,rt=Tt/ot),this.set(it,rt,ot,nt),this}let wt=Math.sqrt((bt-mt)*(bt-mt)+(ht-gt)*(ht-gt)+(dt-ut)*(dt-ut));return Math.abs(wt)<.001&&(wt=1),this.x=(bt-mt)/wt,this.y=(ht-gt)/wt,this.z=(dt-ut)/wt,this.w=Math.acos((ct+pt+yt-1)/2),this}min(et){return this.x=Math.min(this.x,et.x),this.y=Math.min(this.y,et.y),this.z=Math.min(this.z,et.z),this.w=Math.min(this.w,et.w),this}max(et){return this.x=Math.max(this.x,et.x),this.y=Math.max(this.y,et.y),this.z=Math.max(this.z,et.z),this.w=Math.max(this.w,et.w),this}clamp(et,nt){return this.x=Math.max(et.x,Math.min(nt.x,this.x)),this.y=Math.max(et.y,Math.min(nt.y,this.y)),this.z=Math.max(et.z,Math.min(nt.z,this.z)),this.w=Math.max(et.w,Math.min(nt.w,this.w)),this}clampScalar(et,nt){return this.x=Math.max(et,Math.min(nt,this.x)),this.y=Math.max(et,Math.min(nt,this.y)),this.z=Math.max(et,Math.min(nt,this.z)),this.w=Math.max(et,Math.min(nt,this.w)),this}clampLength(et,nt){const it=this.length();return this.divideScalar(it||1).multiplyScalar(Math.max(et,Math.min(nt,it)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(et){return this.x*et.x+this.y*et.y+this.z*et.z+this.w*et.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(et){return this.normalize().multiplyScalar(et)}lerp(et,nt){return this.x+=(et.x-this.x)*nt,this.y+=(et.y-this.y)*nt,this.z+=(et.z-this.z)*nt,this.w+=(et.w-this.w)*nt,this}lerpVectors(et,nt,it){return this.x=et.x+(nt.x-et.x)*it,this.y=et.y+(nt.y-et.y)*it,this.z=et.z+(nt.z-et.z)*it,this.w=et.w+(nt.w-et.w)*it,this}equals(et){return et.x===this.x&&et.y===this.y&&et.z===this.z&&et.w===this.w}fromArray(et,nt=0){return this.x=et[nt],this.y=et[nt+1],this.z=et[nt+2],this.w=et[nt+3],this}toArray(et=[],nt=0){return et[nt]=this.x,et[nt+1]=this.y,et[nt+2]=this.z,et[nt+3]=this.w,et}fromBufferAttribute(et,nt){return this.x=et.getX(nt),this.y=et.getY(nt),this.z=et.getZ(nt),this.w=et.getW(nt),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class WebGLRenderTarget extends EventDispatcher$1{constructor(et,nt,it={}){super(),this.isWebGLRenderTarget=!0,this.width=et,this.height=nt,this.depth=1,this.scissor=new Vector4(0,0,et,nt),this.scissorTest=!1,this.viewport=new Vector4(0,0,et,nt);const rt={width:et,height:nt,depth:1};this.texture=new Texture(rt,it.mapping,it.wrapS,it.wrapT,it.magFilter,it.minFilter,it.format,it.type,it.anisotropy,it.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=it.generateMipmaps!==void 0?it.generateMipmaps:!1,this.texture.internalFormat=it.internalFormat!==void 0?it.internalFormat:null,this.texture.minFilter=it.minFilter!==void 0?it.minFilter:LinearFilter,this.depthBuffer=it.depthBuffer!==void 0?it.depthBuffer:!0,this.stencilBuffer=it.stencilBuffer!==void 0?it.stencilBuffer:!1,this.depthTexture=it.depthTexture!==void 0?it.depthTexture:null,this.samples=it.samples!==void 0?it.samples:0}setSize(et,nt,it=1){(this.width!==et||this.height!==nt||this.depth!==it)&&(this.width=et,this.height=nt,this.depth=it,this.texture.image.width=et,this.texture.image.height=nt,this.texture.image.depth=it,this.dispose()),this.viewport.set(0,0,et,nt),this.scissor.set(0,0,et,nt)}clone(){return new this.constructor().copy(this)}copy(et){this.width=et.width,this.height=et.height,this.depth=et.depth,this.viewport.copy(et.viewport),this.texture=et.texture.clone(),this.texture.isRenderTargetTexture=!0;const nt=Object.assign({},et.texture.image);return this.texture.source=new Source$1(nt),this.depthBuffer=et.depthBuffer,this.stencilBuffer=et.stencilBuffer,et.depthTexture!==null&&(this.depthTexture=et.depthTexture.clone()),this.samples=et.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class DataArrayTexture extends Texture{constructor(et=null,nt=1,it=1,rt=1){super(null),this.isDataArrayTexture=!0,this.image={data:et,width:nt,height:it,depth:rt},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WebGLArrayRenderTarget extends WebGLRenderTarget{constructor(et,nt,it){super(et,nt),this.isWebGLArrayRenderTarget=!0,this.depth=it,this.texture=new DataArrayTexture(null,et,nt,it),this.texture.isRenderTargetTexture=!0}}class Data3DTexture extends Texture{constructor(et=null,nt=1,it=1,rt=1){super(null),this.isData3DTexture=!0,this.image={data:et,width:nt,height:it,depth:rt},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WebGL3DRenderTarget extends WebGLRenderTarget{constructor(et,nt,it){super(et,nt),this.isWebGL3DRenderTarget=!0,this.depth=it,this.texture=new Data3DTexture(null,et,nt,it),this.texture.isRenderTargetTexture=!0}}class WebGLMultipleRenderTargets extends WebGLRenderTarget{constructor(et,nt,it,rt={}){super(et,nt,rt),this.isWebGLMultipleRenderTargets=!0;const ot=this.texture;this.texture=[];for(let at=0;at=0?1:-1,vt=1-yt*yt;if(vt>Number.EPSILON){const St=Math.sqrt(vt),Et=Math.atan2(St,yt*wt);bt=Math.sin(bt*Et)/St,st=Math.sin(st*Et)/St}const xt=st*wt;if(lt=lt*bt+dt*xt,ct=ct*bt+pt*xt,ut=ut*bt+mt*xt,ht=ht*bt+gt*xt,bt===1-st){const St=1/Math.sqrt(lt*lt+ct*ct+ut*ut+ht*ht);lt*=St,ct*=St,ut*=St,ht*=St}}et[nt]=lt,et[nt+1]=ct,et[nt+2]=ut,et[nt+3]=ht}static multiplyQuaternionsFlat(et,nt,it,rt,ot,at){const st=it[rt],lt=it[rt+1],ct=it[rt+2],ut=it[rt+3],ht=ot[at],dt=ot[at+1],pt=ot[at+2],mt=ot[at+3];return et[nt]=st*mt+ut*ht+lt*pt-ct*dt,et[nt+1]=lt*mt+ut*dt+ct*ht-st*pt,et[nt+2]=ct*mt+ut*pt+st*dt-lt*ht,et[nt+3]=ut*mt-st*ht-lt*dt-ct*pt,et}get x(){return this._x}set x(et){this._x=et,this._onChangeCallback()}get y(){return this._y}set y(et){this._y=et,this._onChangeCallback()}get z(){return this._z}set z(et){this._z=et,this._onChangeCallback()}get w(){return this._w}set w(et){this._w=et,this._onChangeCallback()}set(et,nt,it,rt){return this._x=et,this._y=nt,this._z=it,this._w=rt,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(et){return this._x=et.x,this._y=et.y,this._z=et.z,this._w=et.w,this._onChangeCallback(),this}setFromEuler(et,nt){if(!(et&&et.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const it=et._x,rt=et._y,ot=et._z,at=et._order,st=Math.cos,lt=Math.sin,ct=st(it/2),ut=st(rt/2),ht=st(ot/2),dt=lt(it/2),pt=lt(rt/2),mt=lt(ot/2);switch(at){case"XYZ":this._x=dt*ut*ht+ct*pt*mt,this._y=ct*pt*ht-dt*ut*mt,this._z=ct*ut*mt+dt*pt*ht,this._w=ct*ut*ht-dt*pt*mt;break;case"YXZ":this._x=dt*ut*ht+ct*pt*mt,this._y=ct*pt*ht-dt*ut*mt,this._z=ct*ut*mt-dt*pt*ht,this._w=ct*ut*ht+dt*pt*mt;break;case"ZXY":this._x=dt*ut*ht-ct*pt*mt,this._y=ct*pt*ht+dt*ut*mt,this._z=ct*ut*mt+dt*pt*ht,this._w=ct*ut*ht-dt*pt*mt;break;case"ZYX":this._x=dt*ut*ht-ct*pt*mt,this._y=ct*pt*ht+dt*ut*mt,this._z=ct*ut*mt-dt*pt*ht,this._w=ct*ut*ht+dt*pt*mt;break;case"YZX":this._x=dt*ut*ht+ct*pt*mt,this._y=ct*pt*ht+dt*ut*mt,this._z=ct*ut*mt-dt*pt*ht,this._w=ct*ut*ht-dt*pt*mt;break;case"XZY":this._x=dt*ut*ht-ct*pt*mt,this._y=ct*pt*ht-dt*ut*mt,this._z=ct*ut*mt+dt*pt*ht,this._w=ct*ut*ht+dt*pt*mt;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+at)}return nt!==!1&&this._onChangeCallback(),this}setFromAxisAngle(et,nt){const it=nt/2,rt=Math.sin(it);return this._x=et.x*rt,this._y=et.y*rt,this._z=et.z*rt,this._w=Math.cos(it),this._onChangeCallback(),this}setFromRotationMatrix(et){const nt=et.elements,it=nt[0],rt=nt[4],ot=nt[8],at=nt[1],st=nt[5],lt=nt[9],ct=nt[2],ut=nt[6],ht=nt[10],dt=it+st+ht;if(dt>0){const pt=.5/Math.sqrt(dt+1);this._w=.25/pt,this._x=(ut-lt)*pt,this._y=(ot-ct)*pt,this._z=(at-rt)*pt}else if(it>st&&it>ht){const pt=2*Math.sqrt(1+it-st-ht);this._w=(ut-lt)/pt,this._x=.25*pt,this._y=(rt+at)/pt,this._z=(ot+ct)/pt}else if(st>ht){const pt=2*Math.sqrt(1+st-it-ht);this._w=(ot-ct)/pt,this._x=(rt+at)/pt,this._y=.25*pt,this._z=(lt+ut)/pt}else{const pt=2*Math.sqrt(1+ht-it-st);this._w=(at-rt)/pt,this._x=(ot+ct)/pt,this._y=(lt+ut)/pt,this._z=.25*pt}return this._onChangeCallback(),this}setFromUnitVectors(et,nt){let it=et.dot(nt)+1;return itMath.abs(et.z)?(this._x=-et.y,this._y=et.x,this._z=0,this._w=it):(this._x=0,this._y=-et.z,this._z=et.y,this._w=it)):(this._x=et.y*nt.z-et.z*nt.y,this._y=et.z*nt.x-et.x*nt.z,this._z=et.x*nt.y-et.y*nt.x,this._w=it),this.normalize()}angleTo(et){return 2*Math.acos(Math.abs(clamp$6(this.dot(et),-1,1)))}rotateTowards(et,nt){const it=this.angleTo(et);if(it===0)return this;const rt=Math.min(1,nt/it);return this.slerp(et,rt),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(et){return this._x*et._x+this._y*et._y+this._z*et._z+this._w*et._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let et=this.length();return et===0?(this._x=0,this._y=0,this._z=0,this._w=1):(et=1/et,this._x=this._x*et,this._y=this._y*et,this._z=this._z*et,this._w=this._w*et),this._onChangeCallback(),this}multiply(et){return this.multiplyQuaternions(this,et)}premultiply(et){return this.multiplyQuaternions(et,this)}multiplyQuaternions(et,nt){const it=et._x,rt=et._y,ot=et._z,at=et._w,st=nt._x,lt=nt._y,ct=nt._z,ut=nt._w;return this._x=it*ut+at*st+rt*ct-ot*lt,this._y=rt*ut+at*lt+ot*st-it*ct,this._z=ot*ut+at*ct+it*lt-rt*st,this._w=at*ut-it*st-rt*lt-ot*ct,this._onChangeCallback(),this}slerp(et,nt){if(nt===0)return this;if(nt===1)return this.copy(et);const it=this._x,rt=this._y,ot=this._z,at=this._w;let st=at*et._w+it*et._x+rt*et._y+ot*et._z;if(st<0?(this._w=-et._w,this._x=-et._x,this._y=-et._y,this._z=-et._z,st=-st):this.copy(et),st>=1)return this._w=at,this._x=it,this._y=rt,this._z=ot,this;const lt=1-st*st;if(lt<=Number.EPSILON){const pt=1-nt;return this._w=pt*at+nt*this._w,this._x=pt*it+nt*this._x,this._y=pt*rt+nt*this._y,this._z=pt*ot+nt*this._z,this.normalize(),this._onChangeCallback(),this}const ct=Math.sqrt(lt),ut=Math.atan2(ct,st),ht=Math.sin((1-nt)*ut)/ct,dt=Math.sin(nt*ut)/ct;return this._w=at*ht+this._w*dt,this._x=it*ht+this._x*dt,this._y=rt*ht+this._y*dt,this._z=ot*ht+this._z*dt,this._onChangeCallback(),this}slerpQuaternions(et,nt,it){return this.copy(et).slerp(nt,it)}random(){const et=Math.random(),nt=Math.sqrt(1-et),it=Math.sqrt(et),rt=2*Math.PI*Math.random(),ot=2*Math.PI*Math.random();return this.set(nt*Math.cos(rt),it*Math.sin(ot),it*Math.cos(ot),nt*Math.sin(rt))}equals(et){return et._x===this._x&&et._y===this._y&&et._z===this._z&&et._w===this._w}fromArray(et,nt=0){return this._x=et[nt],this._y=et[nt+1],this._z=et[nt+2],this._w=et[nt+3],this._onChangeCallback(),this}toArray(et=[],nt=0){return et[nt]=this._x,et[nt+1]=this._y,et[nt+2]=this._z,et[nt+3]=this._w,et}fromBufferAttribute(et,nt){return this._x=et.getX(nt),this._y=et.getY(nt),this._z=et.getZ(nt),this._w=et.getW(nt),this}_onChange(et){return this._onChangeCallback=et,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(et=0,nt=0,it=0){Vector3.prototype.isVector3=!0,this.x=et,this.y=nt,this.z=it}set(et,nt,it){return it===void 0&&(it=this.z),this.x=et,this.y=nt,this.z=it,this}setScalar(et){return this.x=et,this.y=et,this.z=et,this}setX(et){return this.x=et,this}setY(et){return this.y=et,this}setZ(et){return this.z=et,this}setComponent(et,nt){switch(et){case 0:this.x=nt;break;case 1:this.y=nt;break;case 2:this.z=nt;break;default:throw new Error("index is out of range: "+et)}return this}getComponent(et){switch(et){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+et)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(et){return this.x=et.x,this.y=et.y,this.z=et.z,this}add(et){return this.x+=et.x,this.y+=et.y,this.z+=et.z,this}addScalar(et){return this.x+=et,this.y+=et,this.z+=et,this}addVectors(et,nt){return this.x=et.x+nt.x,this.y=et.y+nt.y,this.z=et.z+nt.z,this}addScaledVector(et,nt){return this.x+=et.x*nt,this.y+=et.y*nt,this.z+=et.z*nt,this}sub(et){return this.x-=et.x,this.y-=et.y,this.z-=et.z,this}subScalar(et){return this.x-=et,this.y-=et,this.z-=et,this}subVectors(et,nt){return this.x=et.x-nt.x,this.y=et.y-nt.y,this.z=et.z-nt.z,this}multiply(et){return this.x*=et.x,this.y*=et.y,this.z*=et.z,this}multiplyScalar(et){return this.x*=et,this.y*=et,this.z*=et,this}multiplyVectors(et,nt){return this.x=et.x*nt.x,this.y=et.y*nt.y,this.z=et.z*nt.z,this}applyEuler(et){return this.applyQuaternion(_quaternion$4.setFromEuler(et))}applyAxisAngle(et,nt){return this.applyQuaternion(_quaternion$4.setFromAxisAngle(et,nt))}applyMatrix3(et){const nt=this.x,it=this.y,rt=this.z,ot=et.elements;return this.x=ot[0]*nt+ot[3]*it+ot[6]*rt,this.y=ot[1]*nt+ot[4]*it+ot[7]*rt,this.z=ot[2]*nt+ot[5]*it+ot[8]*rt,this}applyNormalMatrix(et){return this.applyMatrix3(et).normalize()}applyMatrix4(et){const nt=this.x,it=this.y,rt=this.z,ot=et.elements,at=1/(ot[3]*nt+ot[7]*it+ot[11]*rt+ot[15]);return this.x=(ot[0]*nt+ot[4]*it+ot[8]*rt+ot[12])*at,this.y=(ot[1]*nt+ot[5]*it+ot[9]*rt+ot[13])*at,this.z=(ot[2]*nt+ot[6]*it+ot[10]*rt+ot[14])*at,this}applyQuaternion(et){const nt=this.x,it=this.y,rt=this.z,ot=et.x,at=et.y,st=et.z,lt=et.w,ct=lt*nt+at*rt-st*it,ut=lt*it+st*nt-ot*rt,ht=lt*rt+ot*it-at*nt,dt=-ot*nt-at*it-st*rt;return this.x=ct*lt+dt*-ot+ut*-st-ht*-at,this.y=ut*lt+dt*-at+ht*-ot-ct*-st,this.z=ht*lt+dt*-st+ct*-at-ut*-ot,this}project(et){return this.applyMatrix4(et.matrixWorldInverse).applyMatrix4(et.projectionMatrix)}unproject(et){return this.applyMatrix4(et.projectionMatrixInverse).applyMatrix4(et.matrixWorld)}transformDirection(et){const nt=this.x,it=this.y,rt=this.z,ot=et.elements;return this.x=ot[0]*nt+ot[4]*it+ot[8]*rt,this.y=ot[1]*nt+ot[5]*it+ot[9]*rt,this.z=ot[2]*nt+ot[6]*it+ot[10]*rt,this.normalize()}divide(et){return this.x/=et.x,this.y/=et.y,this.z/=et.z,this}divideScalar(et){return this.multiplyScalar(1/et)}min(et){return this.x=Math.min(this.x,et.x),this.y=Math.min(this.y,et.y),this.z=Math.min(this.z,et.z),this}max(et){return this.x=Math.max(this.x,et.x),this.y=Math.max(this.y,et.y),this.z=Math.max(this.z,et.z),this}clamp(et,nt){return this.x=Math.max(et.x,Math.min(nt.x,this.x)),this.y=Math.max(et.y,Math.min(nt.y,this.y)),this.z=Math.max(et.z,Math.min(nt.z,this.z)),this}clampScalar(et,nt){return this.x=Math.max(et,Math.min(nt,this.x)),this.y=Math.max(et,Math.min(nt,this.y)),this.z=Math.max(et,Math.min(nt,this.z)),this}clampLength(et,nt){const it=this.length();return this.divideScalar(it||1).multiplyScalar(Math.max(et,Math.min(nt,it)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(et){return this.x*et.x+this.y*et.y+this.z*et.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(et){return this.normalize().multiplyScalar(et)}lerp(et,nt){return this.x+=(et.x-this.x)*nt,this.y+=(et.y-this.y)*nt,this.z+=(et.z-this.z)*nt,this}lerpVectors(et,nt,it){return this.x=et.x+(nt.x-et.x)*it,this.y=et.y+(nt.y-et.y)*it,this.z=et.z+(nt.z-et.z)*it,this}cross(et){return this.crossVectors(this,et)}crossVectors(et,nt){const it=et.x,rt=et.y,ot=et.z,at=nt.x,st=nt.y,lt=nt.z;return this.x=rt*lt-ot*st,this.y=ot*at-it*lt,this.z=it*st-rt*at,this}projectOnVector(et){const nt=et.lengthSq();if(nt===0)return this.set(0,0,0);const it=et.dot(this)/nt;return this.copy(et).multiplyScalar(it)}projectOnPlane(et){return _vector$c.copy(this).projectOnVector(et),this.sub(_vector$c)}reflect(et){return this.sub(_vector$c.copy(et).multiplyScalar(2*this.dot(et)))}angleTo(et){const nt=Math.sqrt(this.lengthSq()*et.lengthSq());if(nt===0)return Math.PI/2;const it=this.dot(et)/nt;return Math.acos(clamp$6(it,-1,1))}distanceTo(et){return Math.sqrt(this.distanceToSquared(et))}distanceToSquared(et){const nt=this.x-et.x,it=this.y-et.y,rt=this.z-et.z;return nt*nt+it*it+rt*rt}manhattanDistanceTo(et){return Math.abs(this.x-et.x)+Math.abs(this.y-et.y)+Math.abs(this.z-et.z)}setFromSpherical(et){return this.setFromSphericalCoords(et.radius,et.phi,et.theta)}setFromSphericalCoords(et,nt,it){const rt=Math.sin(nt)*et;return this.x=rt*Math.sin(it),this.y=Math.cos(nt)*et,this.z=rt*Math.cos(it),this}setFromCylindrical(et){return this.setFromCylindricalCoords(et.radius,et.theta,et.y)}setFromCylindricalCoords(et,nt,it){return this.x=et*Math.sin(nt),this.y=it,this.z=et*Math.cos(nt),this}setFromMatrixPosition(et){const nt=et.elements;return this.x=nt[12],this.y=nt[13],this.z=nt[14],this}setFromMatrixScale(et){const nt=this.setFromMatrixColumn(et,0).length(),it=this.setFromMatrixColumn(et,1).length(),rt=this.setFromMatrixColumn(et,2).length();return this.x=nt,this.y=it,this.z=rt,this}setFromMatrixColumn(et,nt){return this.fromArray(et.elements,nt*4)}setFromMatrix3Column(et,nt){return this.fromArray(et.elements,nt*3)}setFromEuler(et){return this.x=et._x,this.y=et._y,this.z=et._z,this}equals(et){return et.x===this.x&&et.y===this.y&&et.z===this.z}fromArray(et,nt=0){return this.x=et[nt],this.y=et[nt+1],this.z=et[nt+2],this}toArray(et=[],nt=0){return et[nt]=this.x,et[nt+1]=this.y,et[nt+2]=this.z,et}fromBufferAttribute(et,nt){return this.x=et.getX(nt),this.y=et.getY(nt),this.z=et.getZ(nt),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const et=(Math.random()-.5)*2,nt=Math.random()*Math.PI*2,it=Math.sqrt(1-et**2);return this.x=it*Math.cos(nt),this.y=it*Math.sin(nt),this.z=et,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _vector$c=new Vector3,_quaternion$4=new Quaternion;class Box3{constructor(et=new Vector3(1/0,1/0,1/0),nt=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=et,this.max=nt}set(et,nt){return this.min.copy(et),this.max.copy(nt),this}setFromArray(et){let nt=1/0,it=1/0,rt=1/0,ot=-1/0,at=-1/0,st=-1/0;for(let lt=0,ct=et.length;ltot&&(ot=ut),ht>at&&(at=ht),dt>st&&(st=dt)}return this.min.set(nt,it,rt),this.max.set(ot,at,st),this}setFromBufferAttribute(et){let nt=1/0,it=1/0,rt=1/0,ot=-1/0,at=-1/0,st=-1/0;for(let lt=0,ct=et.count;ltot&&(ot=ut),ht>at&&(at=ht),dt>st&&(st=dt)}return this.min.set(nt,it,rt),this.max.set(ot,at,st),this}setFromPoints(et){this.makeEmpty();for(let nt=0,it=et.length;ntthis.max.x||et.ythis.max.y||et.zthis.max.z)}containsBox(et){return this.min.x<=et.min.x&&et.max.x<=this.max.x&&this.min.y<=et.min.y&&et.max.y<=this.max.y&&this.min.z<=et.min.z&&et.max.z<=this.max.z}getParameter(et,nt){return nt.set((et.x-this.min.x)/(this.max.x-this.min.x),(et.y-this.min.y)/(this.max.y-this.min.y),(et.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(et){return!(et.max.xthis.max.x||et.max.ythis.max.y||et.max.zthis.max.z)}intersectsSphere(et){return this.clampPoint(et.center,_vector$b),_vector$b.distanceToSquared(et.center)<=et.radius*et.radius}intersectsPlane(et){let nt,it;return et.normal.x>0?(nt=et.normal.x*this.min.x,it=et.normal.x*this.max.x):(nt=et.normal.x*this.max.x,it=et.normal.x*this.min.x),et.normal.y>0?(nt+=et.normal.y*this.min.y,it+=et.normal.y*this.max.y):(nt+=et.normal.y*this.max.y,it+=et.normal.y*this.min.y),et.normal.z>0?(nt+=et.normal.z*this.min.z,it+=et.normal.z*this.max.z):(nt+=et.normal.z*this.max.z,it+=et.normal.z*this.min.z),nt<=-et.constant&&it>=-et.constant}intersectsTriangle(et){if(this.isEmpty())return!1;this.getCenter(_center),_extents.subVectors(this.max,_center),_v0$2.subVectors(et.a,_center),_v1$7.subVectors(et.b,_center),_v2$3.subVectors(et.c,_center),_f0.subVectors(_v1$7,_v0$2),_f1.subVectors(_v2$3,_v1$7),_f2.subVectors(_v0$2,_v2$3);let nt=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];return!satForAxes(nt,_v0$2,_v1$7,_v2$3,_extents)||(nt=[1,0,0,0,1,0,0,0,1],!satForAxes(nt,_v0$2,_v1$7,_v2$3,_extents))?!1:(_triangleNormal.crossVectors(_f0,_f1),nt=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z],satForAxes(nt,_v0$2,_v1$7,_v2$3,_extents))}clampPoint(et,nt){return nt.copy(et).clamp(this.min,this.max)}distanceToPoint(et){return _vector$b.copy(et).clamp(this.min,this.max).sub(et).length()}getBoundingSphere(et){return this.getCenter(et.center),et.radius=this.getSize(_vector$b).length()*.5,et}intersect(et){return this.min.max(et.min),this.max.min(et.max),this.isEmpty()&&this.makeEmpty(),this}union(et){return this.min.min(et.min),this.max.max(et.max),this}applyMatrix4(et){return this.isEmpty()?this:(_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(et),_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(et),_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(et),_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(et),_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(et),_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(et),_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(et),_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(et),this.setFromPoints(_points),this)}translate(et){return this.min.add(et),this.max.add(et),this}equals(et){return et.min.equals(this.min)&&et.max.equals(this.max)}}const _points=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],_vector$b=new Vector3,_box$3=new Box3,_v0$2=new Vector3,_v1$7=new Vector3,_v2$3=new Vector3,_f0=new Vector3,_f1=new Vector3,_f2=new Vector3,_center=new Vector3,_extents=new Vector3,_triangleNormal=new Vector3,_testAxis=new Vector3;function satForAxes(tt,et,nt,it,rt){for(let ot=0,at=tt.length-3;ot<=at;ot+=3){_testAxis.fromArray(tt,ot);const st=rt.x*Math.abs(_testAxis.x)+rt.y*Math.abs(_testAxis.y)+rt.z*Math.abs(_testAxis.z),lt=et.dot(_testAxis),ct=nt.dot(_testAxis),ut=it.dot(_testAxis);if(Math.max(-Math.max(lt,ct,ut),Math.min(lt,ct,ut))>st)return!1}return!0}const _box$2=new Box3,_v1$6=new Vector3,_toFarthestPoint=new Vector3,_toPoint=new Vector3;class Sphere{constructor(et=new Vector3,nt=-1){this.center=et,this.radius=nt}set(et,nt){return this.center.copy(et),this.radius=nt,this}setFromPoints(et,nt){const it=this.center;nt!==void 0?it.copy(nt):_box$2.setFromPoints(et).getCenter(it);let rt=0;for(let ot=0,at=et.length;otthis.radius*this.radius&&(nt.sub(this.center).normalize(),nt.multiplyScalar(this.radius).add(this.center)),nt}getBoundingBox(et){return this.isEmpty()?(et.makeEmpty(),et):(et.set(this.center,this.center),et.expandByScalar(this.radius),et)}applyMatrix4(et){return this.center.applyMatrix4(et),this.radius=this.radius*et.getMaxScaleOnAxis(),this}translate(et){return this.center.add(et),this}expandByPoint(et){_toPoint.subVectors(et,this.center);const nt=_toPoint.lengthSq();if(nt>this.radius*this.radius){const it=Math.sqrt(nt),rt=(it-this.radius)*.5;this.center.add(_toPoint.multiplyScalar(rt/it)),this.radius+=rt}return this}union(et){return this.center.equals(et.center)===!0?_toFarthestPoint.set(0,0,1).multiplyScalar(et.radius):_toFarthestPoint.subVectors(et.center,this.center).normalize().multiplyScalar(et.radius),this.expandByPoint(_v1$6.copy(et.center).add(_toFarthestPoint)),this.expandByPoint(_v1$6.copy(et.center).sub(_toFarthestPoint)),this}equals(et){return et.center.equals(this.center)&&et.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _vector$a=new Vector3,_segCenter=new Vector3,_segDir=new Vector3,_diff=new Vector3,_edge1=new Vector3,_edge2=new Vector3,_normal$1=new Vector3;class Ray{constructor(et=new Vector3,nt=new Vector3(0,0,-1)){this.origin=et,this.direction=nt}set(et,nt){return this.origin.copy(et),this.direction.copy(nt),this}copy(et){return this.origin.copy(et.origin),this.direction.copy(et.direction),this}at(et,nt){return nt.copy(this.direction).multiplyScalar(et).add(this.origin)}lookAt(et){return this.direction.copy(et).sub(this.origin).normalize(),this}recast(et){return this.origin.copy(this.at(et,_vector$a)),this}closestPointToPoint(et,nt){nt.subVectors(et,this.origin);const it=nt.dot(this.direction);return it<0?nt.copy(this.origin):nt.copy(this.direction).multiplyScalar(it).add(this.origin)}distanceToPoint(et){return Math.sqrt(this.distanceSqToPoint(et))}distanceSqToPoint(et){const nt=_vector$a.subVectors(et,this.origin).dot(this.direction);return nt<0?this.origin.distanceToSquared(et):(_vector$a.copy(this.direction).multiplyScalar(nt).add(this.origin),_vector$a.distanceToSquared(et))}distanceSqToSegment(et,nt,it,rt){_segCenter.copy(et).add(nt).multiplyScalar(.5),_segDir.copy(nt).sub(et).normalize(),_diff.copy(this.origin).sub(_segCenter);const ot=et.distanceTo(nt)*.5,at=-this.direction.dot(_segDir),st=_diff.dot(this.direction),lt=-_diff.dot(_segDir),ct=_diff.lengthSq(),ut=Math.abs(1-at*at);let ht,dt,pt,mt;if(ut>0)if(ht=at*lt-st,dt=at*st-lt,mt=ot*ut,ht>=0)if(dt>=-mt)if(dt<=mt){const gt=1/ut;ht*=gt,dt*=gt,pt=ht*(ht+at*dt+2*st)+dt*(at*ht+dt+2*lt)+ct}else dt=ot,ht=Math.max(0,-(at*dt+st)),pt=-ht*ht+dt*(dt+2*lt)+ct;else dt=-ot,ht=Math.max(0,-(at*dt+st)),pt=-ht*ht+dt*(dt+2*lt)+ct;else dt<=-mt?(ht=Math.max(0,-(-at*ot+st)),dt=ht>0?-ot:Math.min(Math.max(-ot,-lt),ot),pt=-ht*ht+dt*(dt+2*lt)+ct):dt<=mt?(ht=0,dt=Math.min(Math.max(-ot,-lt),ot),pt=dt*(dt+2*lt)+ct):(ht=Math.max(0,-(at*ot+st)),dt=ht>0?ot:Math.min(Math.max(-ot,-lt),ot),pt=-ht*ht+dt*(dt+2*lt)+ct);else dt=at>0?-ot:ot,ht=Math.max(0,-(at*dt+st)),pt=-ht*ht+dt*(dt+2*lt)+ct;return it&&it.copy(this.direction).multiplyScalar(ht).add(this.origin),rt&&rt.copy(_segDir).multiplyScalar(dt).add(_segCenter),pt}intersectSphere(et,nt){_vector$a.subVectors(et.center,this.origin);const it=_vector$a.dot(this.direction),rt=_vector$a.dot(_vector$a)-it*it,ot=et.radius*et.radius;if(rt>ot)return null;const at=Math.sqrt(ot-rt),st=it-at,lt=it+at;return st<0&<<0?null:st<0?this.at(lt,nt):this.at(st,nt)}intersectsSphere(et){return this.distanceSqToPoint(et.center)<=et.radius*et.radius}distanceToPlane(et){const nt=et.normal.dot(this.direction);if(nt===0)return et.distanceToPoint(this.origin)===0?0:null;const it=-(this.origin.dot(et.normal)+et.constant)/nt;return it>=0?it:null}intersectPlane(et,nt){const it=this.distanceToPlane(et);return it===null?null:this.at(it,nt)}intersectsPlane(et){const nt=et.distanceToPoint(this.origin);return nt===0||et.normal.dot(this.direction)*nt<0}intersectBox(et,nt){let it,rt,ot,at,st,lt;const ct=1/this.direction.x,ut=1/this.direction.y,ht=1/this.direction.z,dt=this.origin;return ct>=0?(it=(et.min.x-dt.x)*ct,rt=(et.max.x-dt.x)*ct):(it=(et.max.x-dt.x)*ct,rt=(et.min.x-dt.x)*ct),ut>=0?(ot=(et.min.y-dt.y)*ut,at=(et.max.y-dt.y)*ut):(ot=(et.max.y-dt.y)*ut,at=(et.min.y-dt.y)*ut),it>at||ot>rt||((ot>it||it!==it)&&(it=ot),(at=0?(st=(et.min.z-dt.z)*ht,lt=(et.max.z-dt.z)*ht):(st=(et.max.z-dt.z)*ht,lt=(et.min.z-dt.z)*ht),it>lt||st>rt)||((st>it||it!==it)&&(it=st),(lt=0?it:rt,nt)}intersectsBox(et){return this.intersectBox(et,_vector$a)!==null}intersectTriangle(et,nt,it,rt,ot){_edge1.subVectors(nt,et),_edge2.subVectors(it,et),_normal$1.crossVectors(_edge1,_edge2);let at=this.direction.dot(_normal$1),st;if(at>0){if(rt)return null;st=1}else if(at<0)st=-1,at=-at;else return null;_diff.subVectors(this.origin,et);const lt=st*this.direction.dot(_edge2.crossVectors(_diff,_edge2));if(lt<0)return null;const ct=st*this.direction.dot(_edge1.cross(_diff));if(ct<0||lt+ct>at)return null;const ut=-st*_diff.dot(_normal$1);return ut<0?null:this.at(ut/at,ot)}applyMatrix4(et){return this.origin.applyMatrix4(et),this.direction.transformDirection(et),this}equals(et){return et.origin.equals(this.origin)&&et.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Matrix4{constructor(){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt,bt){const yt=this.elements;return yt[0]=et,yt[4]=nt,yt[8]=it,yt[12]=rt,yt[1]=ot,yt[5]=at,yt[9]=st,yt[13]=lt,yt[2]=ct,yt[6]=ut,yt[10]=ht,yt[14]=dt,yt[3]=pt,yt[7]=mt,yt[11]=gt,yt[15]=bt,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Matrix4().fromArray(this.elements)}copy(et){const nt=this.elements,it=et.elements;return nt[0]=it[0],nt[1]=it[1],nt[2]=it[2],nt[3]=it[3],nt[4]=it[4],nt[5]=it[5],nt[6]=it[6],nt[7]=it[7],nt[8]=it[8],nt[9]=it[9],nt[10]=it[10],nt[11]=it[11],nt[12]=it[12],nt[13]=it[13],nt[14]=it[14],nt[15]=it[15],this}copyPosition(et){const nt=this.elements,it=et.elements;return nt[12]=it[12],nt[13]=it[13],nt[14]=it[14],this}setFromMatrix3(et){const nt=et.elements;return this.set(nt[0],nt[3],nt[6],0,nt[1],nt[4],nt[7],0,nt[2],nt[5],nt[8],0,0,0,0,1),this}extractBasis(et,nt,it){return et.setFromMatrixColumn(this,0),nt.setFromMatrixColumn(this,1),it.setFromMatrixColumn(this,2),this}makeBasis(et,nt,it){return this.set(et.x,nt.x,it.x,0,et.y,nt.y,it.y,0,et.z,nt.z,it.z,0,0,0,0,1),this}extractRotation(et){const nt=this.elements,it=et.elements,rt=1/_v1$5.setFromMatrixColumn(et,0).length(),ot=1/_v1$5.setFromMatrixColumn(et,1).length(),at=1/_v1$5.setFromMatrixColumn(et,2).length();return nt[0]=it[0]*rt,nt[1]=it[1]*rt,nt[2]=it[2]*rt,nt[3]=0,nt[4]=it[4]*ot,nt[5]=it[5]*ot,nt[6]=it[6]*ot,nt[7]=0,nt[8]=it[8]*at,nt[9]=it[9]*at,nt[10]=it[10]*at,nt[11]=0,nt[12]=0,nt[13]=0,nt[14]=0,nt[15]=1,this}makeRotationFromEuler(et){const nt=this.elements,it=et.x,rt=et.y,ot=et.z,at=Math.cos(it),st=Math.sin(it),lt=Math.cos(rt),ct=Math.sin(rt),ut=Math.cos(ot),ht=Math.sin(ot);if(et.order==="XYZ"){const dt=at*ut,pt=at*ht,mt=st*ut,gt=st*ht;nt[0]=lt*ut,nt[4]=-lt*ht,nt[8]=ct,nt[1]=pt+mt*ct,nt[5]=dt-gt*ct,nt[9]=-st*lt,nt[2]=gt-dt*ct,nt[6]=mt+pt*ct,nt[10]=at*lt}else if(et.order==="YXZ"){const dt=lt*ut,pt=lt*ht,mt=ct*ut,gt=ct*ht;nt[0]=dt+gt*st,nt[4]=mt*st-pt,nt[8]=at*ct,nt[1]=at*ht,nt[5]=at*ut,nt[9]=-st,nt[2]=pt*st-mt,nt[6]=gt+dt*st,nt[10]=at*lt}else if(et.order==="ZXY"){const dt=lt*ut,pt=lt*ht,mt=ct*ut,gt=ct*ht;nt[0]=dt-gt*st,nt[4]=-at*ht,nt[8]=mt+pt*st,nt[1]=pt+mt*st,nt[5]=at*ut,nt[9]=gt-dt*st,nt[2]=-at*ct,nt[6]=st,nt[10]=at*lt}else if(et.order==="ZYX"){const dt=at*ut,pt=at*ht,mt=st*ut,gt=st*ht;nt[0]=lt*ut,nt[4]=mt*ct-pt,nt[8]=dt*ct+gt,nt[1]=lt*ht,nt[5]=gt*ct+dt,nt[9]=pt*ct-mt,nt[2]=-ct,nt[6]=st*lt,nt[10]=at*lt}else if(et.order==="YZX"){const dt=at*lt,pt=at*ct,mt=st*lt,gt=st*ct;nt[0]=lt*ut,nt[4]=gt-dt*ht,nt[8]=mt*ht+pt,nt[1]=ht,nt[5]=at*ut,nt[9]=-st*ut,nt[2]=-ct*ut,nt[6]=pt*ht+mt,nt[10]=dt-gt*ht}else if(et.order==="XZY"){const dt=at*lt,pt=at*ct,mt=st*lt,gt=st*ct;nt[0]=lt*ut,nt[4]=-ht,nt[8]=ct*ut,nt[1]=dt*ht+gt,nt[5]=at*ut,nt[9]=pt*ht-mt,nt[2]=mt*ht-pt,nt[6]=st*ut,nt[10]=gt*ht+dt}return nt[3]=0,nt[7]=0,nt[11]=0,nt[12]=0,nt[13]=0,nt[14]=0,nt[15]=1,this}makeRotationFromQuaternion(et){return this.compose(_zero,et,_one)}lookAt(et,nt,it){const rt=this.elements;return _z.subVectors(et,nt),_z.lengthSq()===0&&(_z.z=1),_z.normalize(),_x.crossVectors(it,_z),_x.lengthSq()===0&&(Math.abs(it.z)===1?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(it,_z)),_x.normalize(),_y.crossVectors(_z,_x),rt[0]=_x.x,rt[4]=_y.x,rt[8]=_z.x,rt[1]=_x.y,rt[5]=_y.y,rt[9]=_z.y,rt[2]=_x.z,rt[6]=_y.z,rt[10]=_z.z,this}multiply(et){return this.multiplyMatrices(this,et)}premultiply(et){return this.multiplyMatrices(et,this)}multiplyMatrices(et,nt){const it=et.elements,rt=nt.elements,ot=this.elements,at=it[0],st=it[4],lt=it[8],ct=it[12],ut=it[1],ht=it[5],dt=it[9],pt=it[13],mt=it[2],gt=it[6],bt=it[10],yt=it[14],wt=it[3],vt=it[7],xt=it[11],St=it[15],Et=rt[0],It=rt[4],Tt=rt[8],$t=rt[12],Ut=rt[1],Lt=rt[5],Bt=rt[9],Pt=rt[13],kt=rt[2],At=rt[6],Rt=rt[10],Wt=rt[14],jt=rt[3],Ot=rt[7],Ct=rt[11],Dt=rt[15];return ot[0]=at*Et+st*Ut+lt*kt+ct*jt,ot[4]=at*It+st*Lt+lt*At+ct*Ot,ot[8]=at*Tt+st*Bt+lt*Rt+ct*Ct,ot[12]=at*$t+st*Pt+lt*Wt+ct*Dt,ot[1]=ut*Et+ht*Ut+dt*kt+pt*jt,ot[5]=ut*It+ht*Lt+dt*At+pt*Ot,ot[9]=ut*Tt+ht*Bt+dt*Rt+pt*Ct,ot[13]=ut*$t+ht*Pt+dt*Wt+pt*Dt,ot[2]=mt*Et+gt*Ut+bt*kt+yt*jt,ot[6]=mt*It+gt*Lt+bt*At+yt*Ot,ot[10]=mt*Tt+gt*Bt+bt*Rt+yt*Ct,ot[14]=mt*$t+gt*Pt+bt*Wt+yt*Dt,ot[3]=wt*Et+vt*Ut+xt*kt+St*jt,ot[7]=wt*It+vt*Lt+xt*At+St*Ot,ot[11]=wt*Tt+vt*Bt+xt*Rt+St*Ct,ot[15]=wt*$t+vt*Pt+xt*Wt+St*Dt,this}multiplyScalar(et){const nt=this.elements;return nt[0]*=et,nt[4]*=et,nt[8]*=et,nt[12]*=et,nt[1]*=et,nt[5]*=et,nt[9]*=et,nt[13]*=et,nt[2]*=et,nt[6]*=et,nt[10]*=et,nt[14]*=et,nt[3]*=et,nt[7]*=et,nt[11]*=et,nt[15]*=et,this}determinant(){const et=this.elements,nt=et[0],it=et[4],rt=et[8],ot=et[12],at=et[1],st=et[5],lt=et[9],ct=et[13],ut=et[2],ht=et[6],dt=et[10],pt=et[14],mt=et[3],gt=et[7],bt=et[11],yt=et[15];return mt*(+ot*lt*ht-rt*ct*ht-ot*st*dt+it*ct*dt+rt*st*pt-it*lt*pt)+gt*(+nt*lt*pt-nt*ct*dt+ot*at*dt-rt*at*pt+rt*ct*ut-ot*lt*ut)+bt*(+nt*ct*ht-nt*st*pt-ot*at*ht+it*at*pt+ot*st*ut-it*ct*ut)+yt*(-rt*st*ut-nt*lt*ht+nt*st*dt+rt*at*ht-it*at*dt+it*lt*ut)}transpose(){const et=this.elements;let nt;return nt=et[1],et[1]=et[4],et[4]=nt,nt=et[2],et[2]=et[8],et[8]=nt,nt=et[6],et[6]=et[9],et[9]=nt,nt=et[3],et[3]=et[12],et[12]=nt,nt=et[7],et[7]=et[13],et[13]=nt,nt=et[11],et[11]=et[14],et[14]=nt,this}setPosition(et,nt,it){const rt=this.elements;return et.isVector3?(rt[12]=et.x,rt[13]=et.y,rt[14]=et.z):(rt[12]=et,rt[13]=nt,rt[14]=it),this}invert(){const et=this.elements,nt=et[0],it=et[1],rt=et[2],ot=et[3],at=et[4],st=et[5],lt=et[6],ct=et[7],ut=et[8],ht=et[9],dt=et[10],pt=et[11],mt=et[12],gt=et[13],bt=et[14],yt=et[15],wt=ht*bt*ct-gt*dt*ct+gt*lt*pt-st*bt*pt-ht*lt*yt+st*dt*yt,vt=mt*dt*ct-ut*bt*ct-mt*lt*pt+at*bt*pt+ut*lt*yt-at*dt*yt,xt=ut*gt*ct-mt*ht*ct+mt*st*pt-at*gt*pt-ut*st*yt+at*ht*yt,St=mt*ht*lt-ut*gt*lt-mt*st*dt+at*gt*dt+ut*st*bt-at*ht*bt,Et=nt*wt+it*vt+rt*xt+ot*St;if(Et===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const It=1/Et;return et[0]=wt*It,et[1]=(gt*dt*ot-ht*bt*ot-gt*rt*pt+it*bt*pt+ht*rt*yt-it*dt*yt)*It,et[2]=(st*bt*ot-gt*lt*ot+gt*rt*ct-it*bt*ct-st*rt*yt+it*lt*yt)*It,et[3]=(ht*lt*ot-st*dt*ot-ht*rt*ct+it*dt*ct+st*rt*pt-it*lt*pt)*It,et[4]=vt*It,et[5]=(ut*bt*ot-mt*dt*ot+mt*rt*pt-nt*bt*pt-ut*rt*yt+nt*dt*yt)*It,et[6]=(mt*lt*ot-at*bt*ot-mt*rt*ct+nt*bt*ct+at*rt*yt-nt*lt*yt)*It,et[7]=(at*dt*ot-ut*lt*ot+ut*rt*ct-nt*dt*ct-at*rt*pt+nt*lt*pt)*It,et[8]=xt*It,et[9]=(mt*ht*ot-ut*gt*ot-mt*it*pt+nt*gt*pt+ut*it*yt-nt*ht*yt)*It,et[10]=(at*gt*ot-mt*st*ot+mt*it*ct-nt*gt*ct-at*it*yt+nt*st*yt)*It,et[11]=(ut*st*ot-at*ht*ot-ut*it*ct+nt*ht*ct+at*it*pt-nt*st*pt)*It,et[12]=St*It,et[13]=(ut*gt*rt-mt*ht*rt+mt*it*dt-nt*gt*dt-ut*it*bt+nt*ht*bt)*It,et[14]=(mt*st*rt-at*gt*rt-mt*it*lt+nt*gt*lt+at*it*bt-nt*st*bt)*It,et[15]=(at*ht*rt-ut*st*rt+ut*it*lt-nt*ht*lt-at*it*dt+nt*st*dt)*It,this}scale(et){const nt=this.elements,it=et.x,rt=et.y,ot=et.z;return nt[0]*=it,nt[4]*=rt,nt[8]*=ot,nt[1]*=it,nt[5]*=rt,nt[9]*=ot,nt[2]*=it,nt[6]*=rt,nt[10]*=ot,nt[3]*=it,nt[7]*=rt,nt[11]*=ot,this}getMaxScaleOnAxis(){const et=this.elements,nt=et[0]*et[0]+et[1]*et[1]+et[2]*et[2],it=et[4]*et[4]+et[5]*et[5]+et[6]*et[6],rt=et[8]*et[8]+et[9]*et[9]+et[10]*et[10];return Math.sqrt(Math.max(nt,it,rt))}makeTranslation(et,nt,it){return this.set(1,0,0,et,0,1,0,nt,0,0,1,it,0,0,0,1),this}makeRotationX(et){const nt=Math.cos(et),it=Math.sin(et);return this.set(1,0,0,0,0,nt,-it,0,0,it,nt,0,0,0,0,1),this}makeRotationY(et){const nt=Math.cos(et),it=Math.sin(et);return this.set(nt,0,it,0,0,1,0,0,-it,0,nt,0,0,0,0,1),this}makeRotationZ(et){const nt=Math.cos(et),it=Math.sin(et);return this.set(nt,-it,0,0,it,nt,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(et,nt){const it=Math.cos(nt),rt=Math.sin(nt),ot=1-it,at=et.x,st=et.y,lt=et.z,ct=ot*at,ut=ot*st;return this.set(ct*at+it,ct*st-rt*lt,ct*lt+rt*st,0,ct*st+rt*lt,ut*st+it,ut*lt-rt*at,0,ct*lt-rt*st,ut*lt+rt*at,ot*lt*lt+it,0,0,0,0,1),this}makeScale(et,nt,it){return this.set(et,0,0,0,0,nt,0,0,0,0,it,0,0,0,0,1),this}makeShear(et,nt,it,rt,ot,at){return this.set(1,it,ot,0,et,1,at,0,nt,rt,1,0,0,0,0,1),this}compose(et,nt,it){const rt=this.elements,ot=nt._x,at=nt._y,st=nt._z,lt=nt._w,ct=ot+ot,ut=at+at,ht=st+st,dt=ot*ct,pt=ot*ut,mt=ot*ht,gt=at*ut,bt=at*ht,yt=st*ht,wt=lt*ct,vt=lt*ut,xt=lt*ht,St=it.x,Et=it.y,It=it.z;return rt[0]=(1-(gt+yt))*St,rt[1]=(pt+xt)*St,rt[2]=(mt-vt)*St,rt[3]=0,rt[4]=(pt-xt)*Et,rt[5]=(1-(dt+yt))*Et,rt[6]=(bt+wt)*Et,rt[7]=0,rt[8]=(mt+vt)*It,rt[9]=(bt-wt)*It,rt[10]=(1-(dt+gt))*It,rt[11]=0,rt[12]=et.x,rt[13]=et.y,rt[14]=et.z,rt[15]=1,this}decompose(et,nt,it){const rt=this.elements;let ot=_v1$5.set(rt[0],rt[1],rt[2]).length();const at=_v1$5.set(rt[4],rt[5],rt[6]).length(),st=_v1$5.set(rt[8],rt[9],rt[10]).length();this.determinant()<0&&(ot=-ot),et.x=rt[12],et.y=rt[13],et.z=rt[14],_m1$2.copy(this);const ct=1/ot,ut=1/at,ht=1/st;return _m1$2.elements[0]*=ct,_m1$2.elements[1]*=ct,_m1$2.elements[2]*=ct,_m1$2.elements[4]*=ut,_m1$2.elements[5]*=ut,_m1$2.elements[6]*=ut,_m1$2.elements[8]*=ht,_m1$2.elements[9]*=ht,_m1$2.elements[10]*=ht,nt.setFromRotationMatrix(_m1$2),it.x=ot,it.y=at,it.z=st,this}makePerspective(et,nt,it,rt,ot,at){const st=this.elements,lt=2*ot/(nt-et),ct=2*ot/(it-rt),ut=(nt+et)/(nt-et),ht=(it+rt)/(it-rt),dt=-(at+ot)/(at-ot),pt=-2*at*ot/(at-ot);return st[0]=lt,st[4]=0,st[8]=ut,st[12]=0,st[1]=0,st[5]=ct,st[9]=ht,st[13]=0,st[2]=0,st[6]=0,st[10]=dt,st[14]=pt,st[3]=0,st[7]=0,st[11]=-1,st[15]=0,this}makeOrthographic(et,nt,it,rt,ot,at){const st=this.elements,lt=1/(nt-et),ct=1/(it-rt),ut=1/(at-ot),ht=(nt+et)*lt,dt=(it+rt)*ct,pt=(at+ot)*ut;return st[0]=2*lt,st[4]=0,st[8]=0,st[12]=-ht,st[1]=0,st[5]=2*ct,st[9]=0,st[13]=-dt,st[2]=0,st[6]=0,st[10]=-2*ut,st[14]=-pt,st[3]=0,st[7]=0,st[11]=0,st[15]=1,this}equals(et){const nt=this.elements,it=et.elements;for(let rt=0;rt<16;rt++)if(nt[rt]!==it[rt])return!1;return!0}fromArray(et,nt=0){for(let it=0;it<16;it++)this.elements[it]=et[it+nt];return this}toArray(et=[],nt=0){const it=this.elements;return et[nt]=it[0],et[nt+1]=it[1],et[nt+2]=it[2],et[nt+3]=it[3],et[nt+4]=it[4],et[nt+5]=it[5],et[nt+6]=it[6],et[nt+7]=it[7],et[nt+8]=it[8],et[nt+9]=it[9],et[nt+10]=it[10],et[nt+11]=it[11],et[nt+12]=it[12],et[nt+13]=it[13],et[nt+14]=it[14],et[nt+15]=it[15],et}}const _v1$5=new Vector3,_m1$2=new Matrix4,_zero=new Vector3(0,0,0),_one=new Vector3(1,1,1),_x=new Vector3,_y=new Vector3,_z=new Vector3,_matrix$1=new Matrix4,_quaternion$3=new Quaternion;class Euler{constructor(et=0,nt=0,it=0,rt=Euler.DefaultOrder){this.isEuler=!0,this._x=et,this._y=nt,this._z=it,this._order=rt}get x(){return this._x}set x(et){this._x=et,this._onChangeCallback()}get y(){return this._y}set y(et){this._y=et,this._onChangeCallback()}get z(){return this._z}set z(et){this._z=et,this._onChangeCallback()}get order(){return this._order}set order(et){this._order=et,this._onChangeCallback()}set(et,nt,it,rt=this._order){return this._x=et,this._y=nt,this._z=it,this._order=rt,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(et){return this._x=et._x,this._y=et._y,this._z=et._z,this._order=et._order,this._onChangeCallback(),this}setFromRotationMatrix(et,nt=this._order,it=!0){const rt=et.elements,ot=rt[0],at=rt[4],st=rt[8],lt=rt[1],ct=rt[5],ut=rt[9],ht=rt[2],dt=rt[6],pt=rt[10];switch(nt){case"XYZ":this._y=Math.asin(clamp$6(st,-1,1)),Math.abs(st)<.9999999?(this._x=Math.atan2(-ut,pt),this._z=Math.atan2(-at,ot)):(this._x=Math.atan2(dt,ct),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp$6(ut,-1,1)),Math.abs(ut)<.9999999?(this._y=Math.atan2(st,pt),this._z=Math.atan2(lt,ct)):(this._y=Math.atan2(-ht,ot),this._z=0);break;case"ZXY":this._x=Math.asin(clamp$6(dt,-1,1)),Math.abs(dt)<.9999999?(this._y=Math.atan2(-ht,pt),this._z=Math.atan2(-at,ct)):(this._y=0,this._z=Math.atan2(lt,ot));break;case"ZYX":this._y=Math.asin(-clamp$6(ht,-1,1)),Math.abs(ht)<.9999999?(this._x=Math.atan2(dt,pt),this._z=Math.atan2(lt,ot)):(this._x=0,this._z=Math.atan2(-at,ct));break;case"YZX":this._z=Math.asin(clamp$6(lt,-1,1)),Math.abs(lt)<.9999999?(this._x=Math.atan2(-ut,ct),this._y=Math.atan2(-ht,ot)):(this._x=0,this._y=Math.atan2(st,pt));break;case"XZY":this._z=Math.asin(-clamp$6(at,-1,1)),Math.abs(at)<.9999999?(this._x=Math.atan2(dt,ct),this._y=Math.atan2(st,ot)):(this._x=Math.atan2(-ut,pt),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+nt)}return this._order=nt,it===!0&&this._onChangeCallback(),this}setFromQuaternion(et,nt,it){return _matrix$1.makeRotationFromQuaternion(et),this.setFromRotationMatrix(_matrix$1,nt,it)}setFromVector3(et,nt=this._order){return this.set(et.x,et.y,et.z,nt)}reorder(et){return _quaternion$3.setFromEuler(this),this.setFromQuaternion(_quaternion$3,et)}equals(et){return et._x===this._x&&et._y===this._y&&et._z===this._z&&et._order===this._order}fromArray(et){return this._x=et[0],this._y=et[1],this._z=et[2],et[3]!==void 0&&(this._order=et[3]),this._onChangeCallback(),this}toArray(et=[],nt=0){return et[nt]=this._x,et[nt+1]=this._y,et[nt+2]=this._z,et[nt+3]=this._order,et}_onChange(et){return this._onChangeCallback=et,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}Euler.DefaultOrder="XYZ";Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Layers{constructor(){this.mask=1}set(et){this.mask=(1<>>0}enable(et){this.mask|=1<1){for(let nt=0;nt1){for(let it=0;it0){rt.children=[];for(let st=0;st0){rt.animations=[];for(let st=0;st0&&(it.geometries=st),lt.length>0&&(it.materials=lt),ct.length>0&&(it.textures=ct),ut.length>0&&(it.images=ut),ht.length>0&&(it.shapes=ht),dt.length>0&&(it.skeletons=dt),pt.length>0&&(it.animations=pt),mt.length>0&&(it.nodes=mt)}return it.object=rt,it;function at(st){const lt=[];for(const ct in st){const ut=st[ct];delete ut.metadata,lt.push(ut)}return lt}}clone(et){return new this.constructor().copy(this,et)}copy(et,nt=!0){if(this.name=et.name,this.up.copy(et.up),this.position.copy(et.position),this.rotation.order=et.rotation.order,this.quaternion.copy(et.quaternion),this.scale.copy(et.scale),this.matrix.copy(et.matrix),this.matrixWorld.copy(et.matrixWorld),this.matrixAutoUpdate=et.matrixAutoUpdate,this.matrixWorldNeedsUpdate=et.matrixWorldNeedsUpdate,this.layers.mask=et.layers.mask,this.visible=et.visible,this.castShadow=et.castShadow,this.receiveShadow=et.receiveShadow,this.frustumCulled=et.frustumCulled,this.renderOrder=et.renderOrder,this.userData=JSON.parse(JSON.stringify(et.userData)),nt===!0)for(let it=0;it0?rt.multiplyScalar(1/Math.sqrt(ot)):rt.set(0,0,0)}static getBarycoord(et,nt,it,rt,ot){_v0$1.subVectors(rt,nt),_v1$3.subVectors(it,nt),_v2$2.subVectors(et,nt);const at=_v0$1.dot(_v0$1),st=_v0$1.dot(_v1$3),lt=_v0$1.dot(_v2$2),ct=_v1$3.dot(_v1$3),ut=_v1$3.dot(_v2$2),ht=at*ct-st*st;if(ht===0)return ot.set(-2,-1,-1);const dt=1/ht,pt=(ct*lt-st*ut)*dt,mt=(at*ut-st*lt)*dt;return ot.set(1-pt-mt,mt,pt)}static containsPoint(et,nt,it,rt){return this.getBarycoord(et,nt,it,rt,_v3$1),_v3$1.x>=0&&_v3$1.y>=0&&_v3$1.x+_v3$1.y<=1}static getUV(et,nt,it,rt,ot,at,st,lt){return this.getBarycoord(et,nt,it,rt,_v3$1),lt.set(0,0),lt.addScaledVector(ot,_v3$1.x),lt.addScaledVector(at,_v3$1.y),lt.addScaledVector(st,_v3$1.z),lt}static isFrontFacing(et,nt,it,rt){return _v0$1.subVectors(it,nt),_v1$3.subVectors(et,nt),_v0$1.cross(_v1$3).dot(rt)<0}set(et,nt,it){return this.a.copy(et),this.b.copy(nt),this.c.copy(it),this}setFromPointsAndIndices(et,nt,it,rt){return this.a.copy(et[nt]),this.b.copy(et[it]),this.c.copy(et[rt]),this}setFromAttributeAndIndices(et,nt,it,rt){return this.a.fromBufferAttribute(et,nt),this.b.fromBufferAttribute(et,it),this.c.fromBufferAttribute(et,rt),this}clone(){return new this.constructor().copy(this)}copy(et){return this.a.copy(et.a),this.b.copy(et.b),this.c.copy(et.c),this}getArea(){return _v0$1.subVectors(this.c,this.b),_v1$3.subVectors(this.a,this.b),_v0$1.cross(_v1$3).length()*.5}getMidpoint(et){return et.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(et){return Triangle.getNormal(this.a,this.b,this.c,et)}getPlane(et){return et.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(et,nt){return Triangle.getBarycoord(et,this.a,this.b,this.c,nt)}getUV(et,nt,it,rt,ot){return Triangle.getUV(et,this.a,this.b,this.c,nt,it,rt,ot)}containsPoint(et){return Triangle.containsPoint(et,this.a,this.b,this.c)}isFrontFacing(et){return Triangle.isFrontFacing(this.a,this.b,this.c,et)}intersectsBox(et){return et.intersectsTriangle(this)}closestPointToPoint(et,nt){const it=this.a,rt=this.b,ot=this.c;let at,st;_vab.subVectors(rt,it),_vac.subVectors(ot,it),_vap.subVectors(et,it);const lt=_vab.dot(_vap),ct=_vac.dot(_vap);if(lt<=0&&ct<=0)return nt.copy(it);_vbp.subVectors(et,rt);const ut=_vab.dot(_vbp),ht=_vac.dot(_vbp);if(ut>=0&&ht<=ut)return nt.copy(rt);const dt=lt*ht-ut*ct;if(dt<=0&<>=0&&ut<=0)return at=lt/(lt-ut),nt.copy(it).addScaledVector(_vab,at);_vcp.subVectors(et,ot);const pt=_vab.dot(_vcp),mt=_vac.dot(_vcp);if(mt>=0&&pt<=mt)return nt.copy(ot);const gt=pt*ct-lt*mt;if(gt<=0&&ct>=0&&mt<=0)return st=ct/(ct-mt),nt.copy(it).addScaledVector(_vac,st);const bt=ut*mt-pt*ht;if(bt<=0&&ht-ut>=0&&pt-mt>=0)return _vbc.subVectors(ot,rt),st=(ht-ut)/(ht-ut+(pt-mt)),nt.copy(rt).addScaledVector(_vbc,st);const yt=1/(bt+gt+dt);return at=gt*yt,st=dt*yt,nt.copy(it).addScaledVector(_vab,at).addScaledVector(_vac,st)}equals(et){return et.a.equals(this.a)&&et.b.equals(this.b)&&et.c.equals(this.c)}}let materialId=0;class Material extends EventDispatcher$1{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:materialId++}),this.uuid=generateUUID$1(),this.name="",this.type="Material",this.blending=NormalBlending,this.side=FrontSide,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=SrcAlphaFactor,this.blendDst=OneMinusSrcAlphaFactor,this.blendEquation=AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=AlwaysStencilFunc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=KeepStencilOp,this.stencilZFail=KeepStencilOp,this.stencilZPass=KeepStencilOp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(et){this._alphaTest>0!=et>0&&this.version++,this._alphaTest=et}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(et){if(et!==void 0)for(const nt in et){const it=et[nt];if(it===void 0){console.warn("THREE.Material: '"+nt+"' parameter is undefined.");continue}if(nt==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=it===FlatShading;continue}const rt=this[nt];if(rt===void 0){console.warn("THREE."+this.type+": '"+nt+"' is not a property of this material.");continue}rt&&rt.isColor?rt.set(it):rt&&rt.isVector3&&it&&it.isVector3?rt.copy(it):this[nt]=it}}toJSON(et){const nt=et===void 0||typeof et=="string";nt&&(et={textures:{},images:{}});const it={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};it.uuid=this.uuid,it.type=this.type,this.name!==""&&(it.name=this.name),this.color&&this.color.isColor&&(it.color=this.color.getHex()),this.roughness!==void 0&&(it.roughness=this.roughness),this.metalness!==void 0&&(it.metalness=this.metalness),this.sheen!==void 0&&(it.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(it.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(it.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(it.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(it.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(it.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(it.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(it.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(it.shininess=this.shininess),this.clearcoat!==void 0&&(it.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(it.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(it.clearcoatMap=this.clearcoatMap.toJSON(et).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(it.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(et).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(it.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(et).uuid,it.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(it.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(it.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(it.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(it.iridescenceMap=this.iridescenceMap.toJSON(et).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(it.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(et).uuid),this.map&&this.map.isTexture&&(it.map=this.map.toJSON(et).uuid),this.matcap&&this.matcap.isTexture&&(it.matcap=this.matcap.toJSON(et).uuid),this.alphaMap&&this.alphaMap.isTexture&&(it.alphaMap=this.alphaMap.toJSON(et).uuid),this.lightMap&&this.lightMap.isTexture&&(it.lightMap=this.lightMap.toJSON(et).uuid,it.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(it.aoMap=this.aoMap.toJSON(et).uuid,it.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(it.bumpMap=this.bumpMap.toJSON(et).uuid,it.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(it.normalMap=this.normalMap.toJSON(et).uuid,it.normalMapType=this.normalMapType,it.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(it.displacementMap=this.displacementMap.toJSON(et).uuid,it.displacementScale=this.displacementScale,it.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(it.roughnessMap=this.roughnessMap.toJSON(et).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(it.metalnessMap=this.metalnessMap.toJSON(et).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(it.emissiveMap=this.emissiveMap.toJSON(et).uuid),this.specularMap&&this.specularMap.isTexture&&(it.specularMap=this.specularMap.toJSON(et).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(it.specularIntensityMap=this.specularIntensityMap.toJSON(et).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(it.specularColorMap=this.specularColorMap.toJSON(et).uuid),this.envMap&&this.envMap.isTexture&&(it.envMap=this.envMap.toJSON(et).uuid,this.combine!==void 0&&(it.combine=this.combine)),this.envMapIntensity!==void 0&&(it.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(it.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(it.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(it.gradientMap=this.gradientMap.toJSON(et).uuid),this.transmission!==void 0&&(it.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(it.transmissionMap=this.transmissionMap.toJSON(et).uuid),this.thickness!==void 0&&(it.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(it.thicknessMap=this.thicknessMap.toJSON(et).uuid),this.attenuationDistance!==void 0&&(it.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(it.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(it.size=this.size),this.shadowSide!==null&&(it.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(it.sizeAttenuation=this.sizeAttenuation),this.blending!==NormalBlending&&(it.blending=this.blending),this.side!==FrontSide&&(it.side=this.side),this.vertexColors&&(it.vertexColors=!0),this.opacity<1&&(it.opacity=this.opacity),this.transparent===!0&&(it.transparent=this.transparent),it.depthFunc=this.depthFunc,it.depthTest=this.depthTest,it.depthWrite=this.depthWrite,it.colorWrite=this.colorWrite,it.stencilWrite=this.stencilWrite,it.stencilWriteMask=this.stencilWriteMask,it.stencilFunc=this.stencilFunc,it.stencilRef=this.stencilRef,it.stencilFuncMask=this.stencilFuncMask,it.stencilFail=this.stencilFail,it.stencilZFail=this.stencilZFail,it.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(it.rotation=this.rotation),this.polygonOffset===!0&&(it.polygonOffset=!0),this.polygonOffsetFactor!==0&&(it.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(it.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(it.linewidth=this.linewidth),this.dashSize!==void 0&&(it.dashSize=this.dashSize),this.gapSize!==void 0&&(it.gapSize=this.gapSize),this.scale!==void 0&&(it.scale=this.scale),this.dithering===!0&&(it.dithering=!0),this.alphaTest>0&&(it.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(it.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(it.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(it.wireframe=this.wireframe),this.wireframeLinewidth>1&&(it.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(it.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(it.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(it.flatShading=this.flatShading),this.visible===!1&&(it.visible=!1),this.toneMapped===!1&&(it.toneMapped=!1),this.fog===!1&&(it.fog=!1),JSON.stringify(this.userData)!=="{}"&&(it.userData=this.userData);function rt(ot){const at=[];for(const st in ot){const lt=ot[st];delete lt.metadata,at.push(lt)}return at}if(nt){const ot=rt(et.textures),at=rt(et.images);ot.length>0&&(it.textures=ot),at.length>0&&(it.images=at)}return it}clone(){return new this.constructor().copy(this)}copy(et){this.name=et.name,this.blending=et.blending,this.side=et.side,this.vertexColors=et.vertexColors,this.opacity=et.opacity,this.transparent=et.transparent,this.blendSrc=et.blendSrc,this.blendDst=et.blendDst,this.blendEquation=et.blendEquation,this.blendSrcAlpha=et.blendSrcAlpha,this.blendDstAlpha=et.blendDstAlpha,this.blendEquationAlpha=et.blendEquationAlpha,this.depthFunc=et.depthFunc,this.depthTest=et.depthTest,this.depthWrite=et.depthWrite,this.stencilWriteMask=et.stencilWriteMask,this.stencilFunc=et.stencilFunc,this.stencilRef=et.stencilRef,this.stencilFuncMask=et.stencilFuncMask,this.stencilFail=et.stencilFail,this.stencilZFail=et.stencilZFail,this.stencilZPass=et.stencilZPass,this.stencilWrite=et.stencilWrite;const nt=et.clippingPlanes;let it=null;if(nt!==null){const rt=nt.length;it=new Array(rt);for(let ot=0;ot!==rt;++ot)it[ot]=nt[ot].clone()}return this.clippingPlanes=it,this.clipIntersection=et.clipIntersection,this.clipShadows=et.clipShadows,this.shadowSide=et.shadowSide,this.colorWrite=et.colorWrite,this.precision=et.precision,this.polygonOffset=et.polygonOffset,this.polygonOffsetFactor=et.polygonOffsetFactor,this.polygonOffsetUnits=et.polygonOffsetUnits,this.dithering=et.dithering,this.alphaTest=et.alphaTest,this.alphaToCoverage=et.alphaToCoverage,this.premultipliedAlpha=et.premultipliedAlpha,this.visible=et.visible,this.toneMapped=et.toneMapped,this.userData=JSON.parse(JSON.stringify(et.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(et){et===!0&&this.version++}}class MeshBasicMaterial extends Material{constructor(et){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color$1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}const _vector$9=new Vector3,_vector2$1=new Vector2;class BufferAttribute{constructor(et,nt,it){if(Array.isArray(et))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=et,this.itemSize=nt,this.count=et!==void 0?et.length/nt:0,this.normalized=it===!0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(et){et===!0&&this.version++}setUsage(et){return this.usage=et,this}copy(et){return this.name=et.name,this.array=new et.array.constructor(et.array),this.itemSize=et.itemSize,this.count=et.count,this.normalized=et.normalized,this.usage=et.usage,this}copyAt(et,nt,it){et*=this.itemSize,it*=nt.itemSize;for(let rt=0,ot=this.itemSize;rt0&&(et.userData=this.userData),this.parameters!==void 0){const lt=this.parameters;for(const ct in lt)lt[ct]!==void 0&&(et[ct]=lt[ct]);return et}et.data={attributes:{}};const nt=this.index;nt!==null&&(et.data.index={type:nt.array.constructor.name,array:Array.prototype.slice.call(nt.array)});const it=this.attributes;for(const lt in it){const ct=it[lt];et.data.attributes[lt]=ct.toJSON(et.data)}const rt={};let ot=!1;for(const lt in this.morphAttributes){const ct=this.morphAttributes[lt],ut=[];for(let ht=0,dt=ct.length;ht0&&(rt[lt]=ut,ot=!0)}ot&&(et.data.morphAttributes=rt,et.data.morphTargetsRelative=this.morphTargetsRelative);const at=this.groups;at.length>0&&(et.data.groups=JSON.parse(JSON.stringify(at)));const st=this.boundingSphere;return st!==null&&(et.data.boundingSphere={center:st.center.toArray(),radius:st.radius}),et}clone(){return new this.constructor().copy(this)}copy(et){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const nt={};this.name=et.name;const it=et.index;it!==null&&this.setIndex(it.clone(nt));const rt=et.attributes;for(const ct in rt){const ut=rt[ct];this.setAttribute(ct,ut.clone(nt))}const ot=et.morphAttributes;for(const ct in ot){const ut=[],ht=ot[ct];for(let dt=0,pt=ht.length;dt0){const rt=nt[it[0]];if(rt!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=rt.length;otnt.far?null:{distance:ct,point:_intersectionPointWorld.clone(),object:tt}}function checkBufferGeometryIntersection(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht){_vA$1.fromBufferAttribute(rt,ct),_vB$1.fromBufferAttribute(rt,ut),_vC$1.fromBufferAttribute(rt,ht);const dt=tt.morphTargetInfluences;if(ot&&dt){_morphA.set(0,0,0),_morphB.set(0,0,0),_morphC.set(0,0,0);for(let mt=0,gt=ot.length;mt0?1:-1,ut.push(Ot.x,Ot.y,Ot.z),ht.push(Mt/It),ht.push(1-Ct/Tt),Wt+=1}}for(let Ct=0;Ct>8&255]+_lut$1[tt>>16&255]+_lut$1[tt>>24&255]+"-"+_lut$1[et&255]+_lut$1[et>>8&255]+"-"+_lut$1[et>>16&15|64]+_lut$1[et>>24&255]+"-"+_lut$1[nt&63|128]+_lut$1[nt>>8&255]+"-"+_lut$1[nt>>16&255]+_lut$1[nt>>24&255]+_lut$1[it&255]+_lut$1[it>>8&255]+_lut$1[it>>16&255]+_lut$1[it>>24&255]).toLowerCase()}function clamp$6(tt,et,nt){return Math.max(et,Math.min(nt,tt))}function euclideanModulo(tt,et){return(tt%et+et)%et}function mapLinear(tt,et,nt,it,rt){return it+(tt-et)*(rt-it)/(nt-et)}function inverseLerp(tt,et,nt){return tt!==et?(nt-tt)/(et-tt):0}function lerp(tt,et,nt){return(1-nt)*tt+nt*et}function damp(tt,et,nt,it){return lerp(tt,et,1-Math.exp(-nt*it))}function pingpong(tt,et=1){return et-Math.abs(euclideanModulo(tt,et*2)-et)}function smoothstep(tt,et,nt){return tt<=et?0:tt>=nt?1:(tt=(tt-et)/(nt-et),tt*tt*(3-2*tt))}function smootherstep(tt,et,nt){return tt<=et?0:tt>=nt?1:(tt=(tt-et)/(nt-et),tt*tt*tt*(tt*(tt*6-15)+10))}function randInt(tt,et){return tt+Math.floor(Math.random()*(et-tt+1))}function randFloat(tt,et){return tt+Math.random()*(et-tt)}function randFloatSpread(tt){return tt*(.5-Math.random())}function seededRandom(tt){tt!==void 0&&(_seed=tt);let et=_seed+=1831565813;return et=Math.imul(et^et>>>15,et|1),et^=et+Math.imul(et^et>>>7,et|61),((et^et>>>14)>>>0)/4294967296}function degToRad(tt){return tt*DEG2RAD$1}function radToDeg(tt){return tt*RAD2DEG}function isPowerOfTwo(tt){return(tt&tt-1)===0&&tt!==0}function ceilPowerOfTwo(tt){return Math.pow(2,Math.ceil(Math.log(tt)/Math.LN2))}function floorPowerOfTwo(tt){return Math.pow(2,Math.floor(Math.log(tt)/Math.LN2))}function setQuaternionFromProperEuler(tt,et,nt,it,rt){const ot=Math.cos,at=Math.sin,st=ot(nt/2),lt=at(nt/2),ct=ot((et+it)/2),ut=at((et+it)/2),ht=ot((et-it)/2),dt=at((et-it)/2),pt=ot((it-et)/2),mt=at((it-et)/2);switch(rt){case"XYX":tt.set(st*ut,lt*ht,lt*dt,st*ct);break;case"YZY":tt.set(lt*dt,st*ut,lt*ht,st*ct);break;case"ZXZ":tt.set(lt*ht,lt*dt,st*ut,st*ct);break;case"XZX":tt.set(st*ut,lt*mt,lt*pt,st*ct);break;case"YXY":tt.set(lt*pt,st*ut,lt*mt,st*ct);break;case"ZYZ":tt.set(lt*mt,lt*pt,st*ut,st*ct);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+rt)}}function denormalize$1(tt,et){switch(et.constructor){case Float32Array:return tt;case Uint16Array:return tt/65535;case Uint8Array:return tt/255;case Int16Array:return Math.max(tt/32767,-1);case Int8Array:return Math.max(tt/127,-1);default:throw new Error("Invalid component type.")}}function normalize$4(tt,et){switch(et.constructor){case Float32Array:return tt;case Uint16Array:return Math.round(tt*65535);case Uint8Array:return Math.round(tt*255);case Int16Array:return Math.round(tt*32767);case Int8Array:return Math.round(tt*127);default:throw new Error("Invalid component type.")}}var MathUtils=Object.freeze({__proto__:null,DEG2RAD:DEG2RAD$1,RAD2DEG,generateUUID:generateUUID$1,clamp:clamp$6,euclideanModulo,mapLinear,inverseLerp,lerp,damp,pingpong,smoothstep,smootherstep,randInt,randFloat,randFloatSpread,seededRandom,degToRad,radToDeg,isPowerOfTwo,ceilPowerOfTwo,floorPowerOfTwo,setQuaternionFromProperEuler,normalize:normalize$4,denormalize:denormalize$1});class Vector2{constructor(et=0,nt=0){Vector2.prototype.isVector2=!0,this.x=et,this.y=nt}get width(){return this.x}set width(et){this.x=et}get height(){return this.y}set height(et){this.y=et}set(et,nt){return this.x=et,this.y=nt,this}setScalar(et){return this.x=et,this.y=et,this}setX(et){return this.x=et,this}setY(et){return this.y=et,this}setComponent(et,nt){switch(et){case 0:this.x=nt;break;case 1:this.y=nt;break;default:throw new Error("index is out of range: "+et)}return this}getComponent(et){switch(et){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+et)}}clone(){return new this.constructor(this.x,this.y)}copy(et){return this.x=et.x,this.y=et.y,this}add(et){return this.x+=et.x,this.y+=et.y,this}addScalar(et){return this.x+=et,this.y+=et,this}addVectors(et,nt){return this.x=et.x+nt.x,this.y=et.y+nt.y,this}addScaledVector(et,nt){return this.x+=et.x*nt,this.y+=et.y*nt,this}sub(et){return this.x-=et.x,this.y-=et.y,this}subScalar(et){return this.x-=et,this.y-=et,this}subVectors(et,nt){return this.x=et.x-nt.x,this.y=et.y-nt.y,this}multiply(et){return this.x*=et.x,this.y*=et.y,this}multiplyScalar(et){return this.x*=et,this.y*=et,this}divide(et){return this.x/=et.x,this.y/=et.y,this}divideScalar(et){return this.multiplyScalar(1/et)}applyMatrix3(et){const nt=this.x,it=this.y,rt=et.elements;return this.x=rt[0]*nt+rt[3]*it+rt[6],this.y=rt[1]*nt+rt[4]*it+rt[7],this}min(et){return this.x=Math.min(this.x,et.x),this.y=Math.min(this.y,et.y),this}max(et){return this.x=Math.max(this.x,et.x),this.y=Math.max(this.y,et.y),this}clamp(et,nt){return this.x=Math.max(et.x,Math.min(nt.x,this.x)),this.y=Math.max(et.y,Math.min(nt.y,this.y)),this}clampScalar(et,nt){return this.x=Math.max(et,Math.min(nt,this.x)),this.y=Math.max(et,Math.min(nt,this.y)),this}clampLength(et,nt){const it=this.length();return this.divideScalar(it||1).multiplyScalar(Math.max(et,Math.min(nt,it)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(et){return this.x*et.x+this.y*et.y}cross(et){return this.x*et.y-this.y*et.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(et){return Math.sqrt(this.distanceToSquared(et))}distanceToSquared(et){const nt=this.x-et.x,it=this.y-et.y;return nt*nt+it*it}manhattanDistanceTo(et){return Math.abs(this.x-et.x)+Math.abs(this.y-et.y)}setLength(et){return this.normalize().multiplyScalar(et)}lerp(et,nt){return this.x+=(et.x-this.x)*nt,this.y+=(et.y-this.y)*nt,this}lerpVectors(et,nt,it){return this.x=et.x+(nt.x-et.x)*it,this.y=et.y+(nt.y-et.y)*it,this}equals(et){return et.x===this.x&&et.y===this.y}fromArray(et,nt=0){return this.x=et[nt],this.y=et[nt+1],this}toArray(et=[],nt=0){return et[nt]=this.x,et[nt+1]=this.y,et}fromBufferAttribute(et,nt){return this.x=et.getX(nt),this.y=et.getY(nt),this}rotateAround(et,nt){const it=Math.cos(nt),rt=Math.sin(nt),ot=this.x-et.x,at=this.y-et.y;return this.x=ot*it-at*rt+et.x,this.y=ot*rt+at*it+et.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(et,nt,it,rt,ot,at,st,lt,ct){const ut=this.elements;return ut[0]=et,ut[1]=rt,ut[2]=st,ut[3]=nt,ut[4]=ot,ut[5]=lt,ut[6]=it,ut[7]=at,ut[8]=ct,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(et){const nt=this.elements,it=et.elements;return nt[0]=it[0],nt[1]=it[1],nt[2]=it[2],nt[3]=it[3],nt[4]=it[4],nt[5]=it[5],nt[6]=it[6],nt[7]=it[7],nt[8]=it[8],this}extractBasis(et,nt,it){return et.setFromMatrix3Column(this,0),nt.setFromMatrix3Column(this,1),it.setFromMatrix3Column(this,2),this}setFromMatrix4(et){const nt=et.elements;return this.set(nt[0],nt[4],nt[8],nt[1],nt[5],nt[9],nt[2],nt[6],nt[10]),this}multiply(et){return this.multiplyMatrices(this,et)}premultiply(et){return this.multiplyMatrices(et,this)}multiplyMatrices(et,nt){const it=et.elements,rt=nt.elements,ot=this.elements,at=it[0],st=it[3],lt=it[6],ct=it[1],ut=it[4],ht=it[7],dt=it[2],pt=it[5],mt=it[8],gt=rt[0],bt=rt[3],yt=rt[6],wt=rt[1],vt=rt[4],xt=rt[7],St=rt[2],Et=rt[5],$t=rt[8];return ot[0]=at*gt+st*wt+lt*St,ot[3]=at*bt+st*vt+lt*Et,ot[6]=at*yt+st*xt+lt*$t,ot[1]=ct*gt+ut*wt+ht*St,ot[4]=ct*bt+ut*vt+ht*Et,ot[7]=ct*yt+ut*xt+ht*$t,ot[2]=dt*gt+pt*wt+mt*St,ot[5]=dt*bt+pt*vt+mt*Et,ot[8]=dt*yt+pt*xt+mt*$t,this}multiplyScalar(et){const nt=this.elements;return nt[0]*=et,nt[3]*=et,nt[6]*=et,nt[1]*=et,nt[4]*=et,nt[7]*=et,nt[2]*=et,nt[5]*=et,nt[8]*=et,this}determinant(){const et=this.elements,nt=et[0],it=et[1],rt=et[2],ot=et[3],at=et[4],st=et[5],lt=et[6],ct=et[7],ut=et[8];return nt*at*ut-nt*st*ct-it*ot*ut+it*st*lt+rt*ot*ct-rt*at*lt}invert(){const et=this.elements,nt=et[0],it=et[1],rt=et[2],ot=et[3],at=et[4],st=et[5],lt=et[6],ct=et[7],ut=et[8],ht=ut*at-st*ct,dt=st*lt-ut*ot,pt=ct*ot-at*lt,mt=nt*ht+it*dt+rt*pt;if(mt===0)return this.set(0,0,0,0,0,0,0,0,0);const gt=1/mt;return et[0]=ht*gt,et[1]=(rt*ct-ut*it)*gt,et[2]=(st*it-rt*at)*gt,et[3]=dt*gt,et[4]=(ut*nt-rt*lt)*gt,et[5]=(rt*ot-st*nt)*gt,et[6]=pt*gt,et[7]=(it*lt-ct*nt)*gt,et[8]=(at*nt-it*ot)*gt,this}transpose(){let et;const nt=this.elements;return et=nt[1],nt[1]=nt[3],nt[3]=et,et=nt[2],nt[2]=nt[6],nt[6]=et,et=nt[5],nt[5]=nt[7],nt[7]=et,this}getNormalMatrix(et){return this.setFromMatrix4(et).invert().transpose()}transposeIntoArray(et){const nt=this.elements;return et[0]=nt[0],et[1]=nt[3],et[2]=nt[6],et[3]=nt[1],et[4]=nt[4],et[5]=nt[7],et[6]=nt[2],et[7]=nt[5],et[8]=nt[8],this}setUvTransform(et,nt,it,rt,ot,at,st){const lt=Math.cos(ot),ct=Math.sin(ot);return this.set(it*lt,it*ct,-it*(lt*at+ct*st)+at+et,-rt*ct,rt*lt,-rt*(-ct*at+lt*st)+st+nt,0,0,1),this}scale(et,nt){const it=this.elements;return it[0]*=et,it[3]*=et,it[6]*=et,it[1]*=nt,it[4]*=nt,it[7]*=nt,this}rotate(et){const nt=Math.cos(et),it=Math.sin(et),rt=this.elements,ot=rt[0],at=rt[3],st=rt[6],lt=rt[1],ct=rt[4],ut=rt[7];return rt[0]=nt*ot+it*lt,rt[3]=nt*at+it*ct,rt[6]=nt*st+it*ut,rt[1]=-it*ot+nt*lt,rt[4]=-it*at+nt*ct,rt[7]=-it*st+nt*ut,this}translate(et,nt){const it=this.elements;return it[0]+=et*it[2],it[3]+=et*it[5],it[6]+=et*it[8],it[1]+=nt*it[2],it[4]+=nt*it[5],it[7]+=nt*it[8],this}equals(et){const nt=this.elements,it=et.elements;for(let rt=0;rt<9;rt++)if(nt[rt]!==it[rt])return!1;return!0}fromArray(et,nt=0){for(let it=0;it<9;it++)this.elements[it]=et[it+nt];return this}toArray(et=[],nt=0){const it=this.elements;return et[nt]=it[0],et[nt+1]=it[1],et[nt+2]=it[2],et[nt+3]=it[3],et[nt+4]=it[4],et[nt+5]=it[5],et[nt+6]=it[6],et[nt+7]=it[7],et[nt+8]=it[8],et}clone(){return new this.constructor().fromArray(this.elements)}}function arrayNeedsUint32(tt){for(let et=tt.length-1;et>=0;--et)if(tt[et]>65535)return!0;return!1}const TYPED_ARRAYS={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function getTypedArray(tt,et){return new TYPED_ARRAYS[tt](et)}function createElementNS(tt){return document.createElementNS("http://www.w3.org/1999/xhtml",tt)}function SRGBToLinear(tt){return tt<.04045?tt*.0773993808:Math.pow(tt*.9478672986+.0521327014,2.4)}function LinearToSRGB(tt){return tt<.0031308?tt*12.92:1.055*Math.pow(tt,.41666)-.055}const FN={[SRGBColorSpace$1]:{[LinearSRGBColorSpace$1]:SRGBToLinear},[LinearSRGBColorSpace$1]:{[SRGBColorSpace$1]:LinearToSRGB}},ColorManagement={legacyMode:!0,get workingColorSpace(){return LinearSRGBColorSpace$1},set workingColorSpace(tt){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(tt,et,nt){if(this.legacyMode||et===nt||!et||!nt)return tt;if(FN[et]&&FN[et][nt]!==void 0){const it=FN[et][nt];return tt.r=it(tt.r),tt.g=it(tt.g),tt.b=it(tt.b),tt}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(tt,et){return this.convert(tt,this.workingColorSpace,et)},toWorkingColorSpace:function(tt,et){return this.convert(tt,et,this.workingColorSpace)}},_colorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},_rgb={r:0,g:0,b:0},_hslA={h:0,s:0,l:0},_hslB={h:0,s:0,l:0};function hue2rgb(tt,et,nt){return nt<0&&(nt+=1),nt>1&&(nt-=1),nt<1/6?tt+(et-tt)*6*nt:nt<1/2?et:nt<2/3?tt+(et-tt)*6*(2/3-nt):tt}function toComponents(tt,et){return et.r=tt.r,et.g=tt.g,et.b=tt.b,et}let Color$1=class{constructor(et,nt,it){return this.isColor=!0,this.r=1,this.g=1,this.b=1,nt===void 0&&it===void 0?this.set(et):this.setRGB(et,nt,it)}set(et){return et&&et.isColor?this.copy(et):typeof et=="number"?this.setHex(et):typeof et=="string"&&this.setStyle(et),this}setScalar(et){return this.r=et,this.g=et,this.b=et,this}setHex(et,nt=SRGBColorSpace$1){return et=Math.floor(et),this.r=(et>>16&255)/255,this.g=(et>>8&255)/255,this.b=(et&255)/255,ColorManagement.toWorkingColorSpace(this,nt),this}setRGB(et,nt,it,rt=LinearSRGBColorSpace$1){return this.r=et,this.g=nt,this.b=it,ColorManagement.toWorkingColorSpace(this,rt),this}setHSL(et,nt,it,rt=LinearSRGBColorSpace$1){if(et=euclideanModulo(et,1),nt=clamp$6(nt,0,1),it=clamp$6(it,0,1),nt===0)this.r=this.g=this.b=it;else{const ot=it<=.5?it*(1+nt):it+nt-it*nt,at=2*it-ot;this.r=hue2rgb(at,ot,et+1/3),this.g=hue2rgb(at,ot,et),this.b=hue2rgb(at,ot,et-1/3)}return ColorManagement.toWorkingColorSpace(this,rt),this}setStyle(et,nt=SRGBColorSpace$1){function it(ot){ot!==void 0&&parseFloat(ot)<1&&console.warn("THREE.Color: Alpha component of "+et+" will be ignored.")}let rt;if(rt=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(et)){let ot;const at=rt[1],st=rt[2];switch(at){case"rgb":case"rgba":if(ot=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(st))return this.r=Math.min(255,parseInt(ot[1],10))/255,this.g=Math.min(255,parseInt(ot[2],10))/255,this.b=Math.min(255,parseInt(ot[3],10))/255,ColorManagement.toWorkingColorSpace(this,nt),it(ot[4]),this;if(ot=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(st))return this.r=Math.min(100,parseInt(ot[1],10))/100,this.g=Math.min(100,parseInt(ot[2],10))/100,this.b=Math.min(100,parseInt(ot[3],10))/100,ColorManagement.toWorkingColorSpace(this,nt),it(ot[4]),this;break;case"hsl":case"hsla":if(ot=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(st)){const lt=parseFloat(ot[1])/360,ct=parseInt(ot[2],10)/100,ut=parseInt(ot[3],10)/100;return it(ot[4]),this.setHSL(lt,ct,ut,nt)}break}}else if(rt=/^\#([A-Fa-f\d]+)$/.exec(et)){const ot=rt[1],at=ot.length;if(at===3)return this.r=parseInt(ot.charAt(0)+ot.charAt(0),16)/255,this.g=parseInt(ot.charAt(1)+ot.charAt(1),16)/255,this.b=parseInt(ot.charAt(2)+ot.charAt(2),16)/255,ColorManagement.toWorkingColorSpace(this,nt),this;if(at===6)return this.r=parseInt(ot.charAt(0)+ot.charAt(1),16)/255,this.g=parseInt(ot.charAt(2)+ot.charAt(3),16)/255,this.b=parseInt(ot.charAt(4)+ot.charAt(5),16)/255,ColorManagement.toWorkingColorSpace(this,nt),this}return et&&et.length>0?this.setColorName(et,nt):this}setColorName(et,nt=SRGBColorSpace$1){const it=_colorKeywords[et.toLowerCase()];return it!==void 0?this.setHex(it,nt):console.warn("THREE.Color: Unknown color "+et),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(et){return this.r=et.r,this.g=et.g,this.b=et.b,this}copySRGBToLinear(et){return this.r=SRGBToLinear(et.r),this.g=SRGBToLinear(et.g),this.b=SRGBToLinear(et.b),this}copyLinearToSRGB(et){return this.r=LinearToSRGB(et.r),this.g=LinearToSRGB(et.g),this.b=LinearToSRGB(et.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(et=SRGBColorSpace$1){return ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),et),clamp$6(_rgb.r*255,0,255)<<16^clamp$6(_rgb.g*255,0,255)<<8^clamp$6(_rgb.b*255,0,255)<<0}getHexString(et=SRGBColorSpace$1){return("000000"+this.getHex(et).toString(16)).slice(-6)}getHSL(et,nt=LinearSRGBColorSpace$1){ColorManagement.fromWorkingColorSpace(toComponents(this,_rgb),nt);const it=_rgb.r,rt=_rgb.g,ot=_rgb.b,at=Math.max(it,rt,ot),st=Math.min(it,rt,ot);let lt,ct;const ut=(st+at)/2;if(st===at)lt=0,ct=0;else{const ht=at-st;switch(ct=ut<=.5?ht/(at+st):ht/(2-at-st),at){case it:lt=(rt-ot)/ht+(rt"u")return et.src;let nt;if(et instanceof HTMLCanvasElement)nt=et;else{_canvas===void 0&&(_canvas=createElementNS("canvas")),_canvas.width=et.width,_canvas.height=et.height;const it=_canvas.getContext("2d");et instanceof ImageData?it.putImageData(et,0,0):it.drawImage(et,0,0,et.width,et.height),nt=_canvas}return nt.width>2048||nt.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",et),nt.toDataURL("image/jpeg",.6)):nt.toDataURL("image/png")}static sRGBToLinear(et){if(typeof HTMLImageElement<"u"&&et instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&et instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&et instanceof ImageBitmap){const nt=createElementNS("canvas");nt.width=et.width,nt.height=et.height;const it=nt.getContext("2d");it.drawImage(et,0,0,et.width,et.height);const rt=it.getImageData(0,0,et.width,et.height),ot=rt.data;for(let at=0;at1)switch(this.wrapS){case RepeatWrapping:et.x=et.x-Math.floor(et.x);break;case ClampToEdgeWrapping:et.x=et.x<0?0:1;break;case MirroredRepeatWrapping:Math.abs(Math.floor(et.x)%2)===1?et.x=Math.ceil(et.x)-et.x:et.x=et.x-Math.floor(et.x);break}if(et.y<0||et.y>1)switch(this.wrapT){case RepeatWrapping:et.y=et.y-Math.floor(et.y);break;case ClampToEdgeWrapping:et.y=et.y<0?0:1;break;case MirroredRepeatWrapping:Math.abs(Math.floor(et.y)%2)===1?et.y=Math.ceil(et.y)-et.y:et.y=et.y-Math.floor(et.y);break}return this.flipY&&(et.y=1-et.y),et}set needsUpdate(et){et===!0&&(this.version++,this.source.needsUpdate=!0)}}Texture.DEFAULT_IMAGE=null;Texture.DEFAULT_MAPPING=UVMapping;class Vector4{constructor(et=0,nt=0,it=0,rt=1){Vector4.prototype.isVector4=!0,this.x=et,this.y=nt,this.z=it,this.w=rt}get width(){return this.z}set width(et){this.z=et}get height(){return this.w}set height(et){this.w=et}set(et,nt,it,rt){return this.x=et,this.y=nt,this.z=it,this.w=rt,this}setScalar(et){return this.x=et,this.y=et,this.z=et,this.w=et,this}setX(et){return this.x=et,this}setY(et){return this.y=et,this}setZ(et){return this.z=et,this}setW(et){return this.w=et,this}setComponent(et,nt){switch(et){case 0:this.x=nt;break;case 1:this.y=nt;break;case 2:this.z=nt;break;case 3:this.w=nt;break;default:throw new Error("index is out of range: "+et)}return this}getComponent(et){switch(et){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+et)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(et){return this.x=et.x,this.y=et.y,this.z=et.z,this.w=et.w!==void 0?et.w:1,this}add(et){return this.x+=et.x,this.y+=et.y,this.z+=et.z,this.w+=et.w,this}addScalar(et){return this.x+=et,this.y+=et,this.z+=et,this.w+=et,this}addVectors(et,nt){return this.x=et.x+nt.x,this.y=et.y+nt.y,this.z=et.z+nt.z,this.w=et.w+nt.w,this}addScaledVector(et,nt){return this.x+=et.x*nt,this.y+=et.y*nt,this.z+=et.z*nt,this.w+=et.w*nt,this}sub(et){return this.x-=et.x,this.y-=et.y,this.z-=et.z,this.w-=et.w,this}subScalar(et){return this.x-=et,this.y-=et,this.z-=et,this.w-=et,this}subVectors(et,nt){return this.x=et.x-nt.x,this.y=et.y-nt.y,this.z=et.z-nt.z,this.w=et.w-nt.w,this}multiply(et){return this.x*=et.x,this.y*=et.y,this.z*=et.z,this.w*=et.w,this}multiplyScalar(et){return this.x*=et,this.y*=et,this.z*=et,this.w*=et,this}applyMatrix4(et){const nt=this.x,it=this.y,rt=this.z,ot=this.w,at=et.elements;return this.x=at[0]*nt+at[4]*it+at[8]*rt+at[12]*ot,this.y=at[1]*nt+at[5]*it+at[9]*rt+at[13]*ot,this.z=at[2]*nt+at[6]*it+at[10]*rt+at[14]*ot,this.w=at[3]*nt+at[7]*it+at[11]*rt+at[15]*ot,this}divideScalar(et){return this.multiplyScalar(1/et)}setAxisAngleFromQuaternion(et){this.w=2*Math.acos(et.w);const nt=Math.sqrt(1-et.w*et.w);return nt<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=et.x/nt,this.y=et.y/nt,this.z=et.z/nt),this}setAxisAngleFromRotationMatrix(et){let nt,it,rt,ot;const lt=et.elements,ct=lt[0],ut=lt[4],ht=lt[8],dt=lt[1],pt=lt[5],mt=lt[9],gt=lt[2],bt=lt[6],yt=lt[10];if(Math.abs(ut-dt)<.01&&Math.abs(ht-gt)<.01&&Math.abs(mt-bt)<.01){if(Math.abs(ut+dt)<.1&&Math.abs(ht+gt)<.1&&Math.abs(mt+bt)<.1&&Math.abs(ct+pt+yt-3)<.1)return this.set(1,0,0,0),this;nt=Math.PI;const vt=(ct+1)/2,xt=(pt+1)/2,St=(yt+1)/2,Et=(ut+dt)/4,$t=(ht+gt)/4,It=(mt+bt)/4;return vt>xt&&vt>St?vt<.01?(it=0,rt=.707106781,ot=.707106781):(it=Math.sqrt(vt),rt=Et/it,ot=$t/it):xt>St?xt<.01?(it=.707106781,rt=0,ot=.707106781):(rt=Math.sqrt(xt),it=Et/rt,ot=It/rt):St<.01?(it=.707106781,rt=.707106781,ot=0):(ot=Math.sqrt(St),it=$t/ot,rt=It/ot),this.set(it,rt,ot,nt),this}let wt=Math.sqrt((bt-mt)*(bt-mt)+(ht-gt)*(ht-gt)+(dt-ut)*(dt-ut));return Math.abs(wt)<.001&&(wt=1),this.x=(bt-mt)/wt,this.y=(ht-gt)/wt,this.z=(dt-ut)/wt,this.w=Math.acos((ct+pt+yt-1)/2),this}min(et){return this.x=Math.min(this.x,et.x),this.y=Math.min(this.y,et.y),this.z=Math.min(this.z,et.z),this.w=Math.min(this.w,et.w),this}max(et){return this.x=Math.max(this.x,et.x),this.y=Math.max(this.y,et.y),this.z=Math.max(this.z,et.z),this.w=Math.max(this.w,et.w),this}clamp(et,nt){return this.x=Math.max(et.x,Math.min(nt.x,this.x)),this.y=Math.max(et.y,Math.min(nt.y,this.y)),this.z=Math.max(et.z,Math.min(nt.z,this.z)),this.w=Math.max(et.w,Math.min(nt.w,this.w)),this}clampScalar(et,nt){return this.x=Math.max(et,Math.min(nt,this.x)),this.y=Math.max(et,Math.min(nt,this.y)),this.z=Math.max(et,Math.min(nt,this.z)),this.w=Math.max(et,Math.min(nt,this.w)),this}clampLength(et,nt){const it=this.length();return this.divideScalar(it||1).multiplyScalar(Math.max(et,Math.min(nt,it)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(et){return this.x*et.x+this.y*et.y+this.z*et.z+this.w*et.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(et){return this.normalize().multiplyScalar(et)}lerp(et,nt){return this.x+=(et.x-this.x)*nt,this.y+=(et.y-this.y)*nt,this.z+=(et.z-this.z)*nt,this.w+=(et.w-this.w)*nt,this}lerpVectors(et,nt,it){return this.x=et.x+(nt.x-et.x)*it,this.y=et.y+(nt.y-et.y)*it,this.z=et.z+(nt.z-et.z)*it,this.w=et.w+(nt.w-et.w)*it,this}equals(et){return et.x===this.x&&et.y===this.y&&et.z===this.z&&et.w===this.w}fromArray(et,nt=0){return this.x=et[nt],this.y=et[nt+1],this.z=et[nt+2],this.w=et[nt+3],this}toArray(et=[],nt=0){return et[nt]=this.x,et[nt+1]=this.y,et[nt+2]=this.z,et[nt+3]=this.w,et}fromBufferAttribute(et,nt){return this.x=et.getX(nt),this.y=et.getY(nt),this.z=et.getZ(nt),this.w=et.getW(nt),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class WebGLRenderTarget extends EventDispatcher$1{constructor(et,nt,it={}){super(),this.isWebGLRenderTarget=!0,this.width=et,this.height=nt,this.depth=1,this.scissor=new Vector4(0,0,et,nt),this.scissorTest=!1,this.viewport=new Vector4(0,0,et,nt);const rt={width:et,height:nt,depth:1};this.texture=new Texture(rt,it.mapping,it.wrapS,it.wrapT,it.magFilter,it.minFilter,it.format,it.type,it.anisotropy,it.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=it.generateMipmaps!==void 0?it.generateMipmaps:!1,this.texture.internalFormat=it.internalFormat!==void 0?it.internalFormat:null,this.texture.minFilter=it.minFilter!==void 0?it.minFilter:LinearFilter,this.depthBuffer=it.depthBuffer!==void 0?it.depthBuffer:!0,this.stencilBuffer=it.stencilBuffer!==void 0?it.stencilBuffer:!1,this.depthTexture=it.depthTexture!==void 0?it.depthTexture:null,this.samples=it.samples!==void 0?it.samples:0}setSize(et,nt,it=1){(this.width!==et||this.height!==nt||this.depth!==it)&&(this.width=et,this.height=nt,this.depth=it,this.texture.image.width=et,this.texture.image.height=nt,this.texture.image.depth=it,this.dispose()),this.viewport.set(0,0,et,nt),this.scissor.set(0,0,et,nt)}clone(){return new this.constructor().copy(this)}copy(et){this.width=et.width,this.height=et.height,this.depth=et.depth,this.viewport.copy(et.viewport),this.texture=et.texture.clone(),this.texture.isRenderTargetTexture=!0;const nt=Object.assign({},et.texture.image);return this.texture.source=new Source$1(nt),this.depthBuffer=et.depthBuffer,this.stencilBuffer=et.stencilBuffer,et.depthTexture!==null&&(this.depthTexture=et.depthTexture.clone()),this.samples=et.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class DataArrayTexture extends Texture{constructor(et=null,nt=1,it=1,rt=1){super(null),this.isDataArrayTexture=!0,this.image={data:et,width:nt,height:it,depth:rt},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WebGLArrayRenderTarget extends WebGLRenderTarget{constructor(et,nt,it){super(et,nt),this.isWebGLArrayRenderTarget=!0,this.depth=it,this.texture=new DataArrayTexture(null,et,nt,it),this.texture.isRenderTargetTexture=!0}}class Data3DTexture extends Texture{constructor(et=null,nt=1,it=1,rt=1){super(null),this.isData3DTexture=!0,this.image={data:et,width:nt,height:it,depth:rt},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WebGL3DRenderTarget extends WebGLRenderTarget{constructor(et,nt,it){super(et,nt),this.isWebGL3DRenderTarget=!0,this.depth=it,this.texture=new Data3DTexture(null,et,nt,it),this.texture.isRenderTargetTexture=!0}}class WebGLMultipleRenderTargets extends WebGLRenderTarget{constructor(et,nt,it,rt={}){super(et,nt,rt),this.isWebGLMultipleRenderTargets=!0;const ot=this.texture;this.texture=[];for(let at=0;at=0?1:-1,vt=1-yt*yt;if(vt>Number.EPSILON){const St=Math.sqrt(vt),Et=Math.atan2(St,yt*wt);bt=Math.sin(bt*Et)/St,st=Math.sin(st*Et)/St}const xt=st*wt;if(lt=lt*bt+dt*xt,ct=ct*bt+pt*xt,ut=ut*bt+mt*xt,ht=ht*bt+gt*xt,bt===1-st){const St=1/Math.sqrt(lt*lt+ct*ct+ut*ut+ht*ht);lt*=St,ct*=St,ut*=St,ht*=St}}et[nt]=lt,et[nt+1]=ct,et[nt+2]=ut,et[nt+3]=ht}static multiplyQuaternionsFlat(et,nt,it,rt,ot,at){const st=it[rt],lt=it[rt+1],ct=it[rt+2],ut=it[rt+3],ht=ot[at],dt=ot[at+1],pt=ot[at+2],mt=ot[at+3];return et[nt]=st*mt+ut*ht+lt*pt-ct*dt,et[nt+1]=lt*mt+ut*dt+ct*ht-st*pt,et[nt+2]=ct*mt+ut*pt+st*dt-lt*ht,et[nt+3]=ut*mt-st*ht-lt*dt-ct*pt,et}get x(){return this._x}set x(et){this._x=et,this._onChangeCallback()}get y(){return this._y}set y(et){this._y=et,this._onChangeCallback()}get z(){return this._z}set z(et){this._z=et,this._onChangeCallback()}get w(){return this._w}set w(et){this._w=et,this._onChangeCallback()}set(et,nt,it,rt){return this._x=et,this._y=nt,this._z=it,this._w=rt,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(et){return this._x=et.x,this._y=et.y,this._z=et.z,this._w=et.w,this._onChangeCallback(),this}setFromEuler(et,nt){if(!(et&&et.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const it=et._x,rt=et._y,ot=et._z,at=et._order,st=Math.cos,lt=Math.sin,ct=st(it/2),ut=st(rt/2),ht=st(ot/2),dt=lt(it/2),pt=lt(rt/2),mt=lt(ot/2);switch(at){case"XYZ":this._x=dt*ut*ht+ct*pt*mt,this._y=ct*pt*ht-dt*ut*mt,this._z=ct*ut*mt+dt*pt*ht,this._w=ct*ut*ht-dt*pt*mt;break;case"YXZ":this._x=dt*ut*ht+ct*pt*mt,this._y=ct*pt*ht-dt*ut*mt,this._z=ct*ut*mt-dt*pt*ht,this._w=ct*ut*ht+dt*pt*mt;break;case"ZXY":this._x=dt*ut*ht-ct*pt*mt,this._y=ct*pt*ht+dt*ut*mt,this._z=ct*ut*mt+dt*pt*ht,this._w=ct*ut*ht-dt*pt*mt;break;case"ZYX":this._x=dt*ut*ht-ct*pt*mt,this._y=ct*pt*ht+dt*ut*mt,this._z=ct*ut*mt-dt*pt*ht,this._w=ct*ut*ht+dt*pt*mt;break;case"YZX":this._x=dt*ut*ht+ct*pt*mt,this._y=ct*pt*ht+dt*ut*mt,this._z=ct*ut*mt-dt*pt*ht,this._w=ct*ut*ht-dt*pt*mt;break;case"XZY":this._x=dt*ut*ht-ct*pt*mt,this._y=ct*pt*ht-dt*ut*mt,this._z=ct*ut*mt+dt*pt*ht,this._w=ct*ut*ht+dt*pt*mt;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+at)}return nt!==!1&&this._onChangeCallback(),this}setFromAxisAngle(et,nt){const it=nt/2,rt=Math.sin(it);return this._x=et.x*rt,this._y=et.y*rt,this._z=et.z*rt,this._w=Math.cos(it),this._onChangeCallback(),this}setFromRotationMatrix(et){const nt=et.elements,it=nt[0],rt=nt[4],ot=nt[8],at=nt[1],st=nt[5],lt=nt[9],ct=nt[2],ut=nt[6],ht=nt[10],dt=it+st+ht;if(dt>0){const pt=.5/Math.sqrt(dt+1);this._w=.25/pt,this._x=(ut-lt)*pt,this._y=(ot-ct)*pt,this._z=(at-rt)*pt}else if(it>st&&it>ht){const pt=2*Math.sqrt(1+it-st-ht);this._w=(ut-lt)/pt,this._x=.25*pt,this._y=(rt+at)/pt,this._z=(ot+ct)/pt}else if(st>ht){const pt=2*Math.sqrt(1+st-it-ht);this._w=(ot-ct)/pt,this._x=(rt+at)/pt,this._y=.25*pt,this._z=(lt+ut)/pt}else{const pt=2*Math.sqrt(1+ht-it-st);this._w=(at-rt)/pt,this._x=(ot+ct)/pt,this._y=(lt+ut)/pt,this._z=.25*pt}return this._onChangeCallback(),this}setFromUnitVectors(et,nt){let it=et.dot(nt)+1;return itMath.abs(et.z)?(this._x=-et.y,this._y=et.x,this._z=0,this._w=it):(this._x=0,this._y=-et.z,this._z=et.y,this._w=it)):(this._x=et.y*nt.z-et.z*nt.y,this._y=et.z*nt.x-et.x*nt.z,this._z=et.x*nt.y-et.y*nt.x,this._w=it),this.normalize()}angleTo(et){return 2*Math.acos(Math.abs(clamp$6(this.dot(et),-1,1)))}rotateTowards(et,nt){const it=this.angleTo(et);if(it===0)return this;const rt=Math.min(1,nt/it);return this.slerp(et,rt),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(et){return this._x*et._x+this._y*et._y+this._z*et._z+this._w*et._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let et=this.length();return et===0?(this._x=0,this._y=0,this._z=0,this._w=1):(et=1/et,this._x=this._x*et,this._y=this._y*et,this._z=this._z*et,this._w=this._w*et),this._onChangeCallback(),this}multiply(et){return this.multiplyQuaternions(this,et)}premultiply(et){return this.multiplyQuaternions(et,this)}multiplyQuaternions(et,nt){const it=et._x,rt=et._y,ot=et._z,at=et._w,st=nt._x,lt=nt._y,ct=nt._z,ut=nt._w;return this._x=it*ut+at*st+rt*ct-ot*lt,this._y=rt*ut+at*lt+ot*st-it*ct,this._z=ot*ut+at*ct+it*lt-rt*st,this._w=at*ut-it*st-rt*lt-ot*ct,this._onChangeCallback(),this}slerp(et,nt){if(nt===0)return this;if(nt===1)return this.copy(et);const it=this._x,rt=this._y,ot=this._z,at=this._w;let st=at*et._w+it*et._x+rt*et._y+ot*et._z;if(st<0?(this._w=-et._w,this._x=-et._x,this._y=-et._y,this._z=-et._z,st=-st):this.copy(et),st>=1)return this._w=at,this._x=it,this._y=rt,this._z=ot,this;const lt=1-st*st;if(lt<=Number.EPSILON){const pt=1-nt;return this._w=pt*at+nt*this._w,this._x=pt*it+nt*this._x,this._y=pt*rt+nt*this._y,this._z=pt*ot+nt*this._z,this.normalize(),this._onChangeCallback(),this}const ct=Math.sqrt(lt),ut=Math.atan2(ct,st),ht=Math.sin((1-nt)*ut)/ct,dt=Math.sin(nt*ut)/ct;return this._w=at*ht+this._w*dt,this._x=it*ht+this._x*dt,this._y=rt*ht+this._y*dt,this._z=ot*ht+this._z*dt,this._onChangeCallback(),this}slerpQuaternions(et,nt,it){return this.copy(et).slerp(nt,it)}random(){const et=Math.random(),nt=Math.sqrt(1-et),it=Math.sqrt(et),rt=2*Math.PI*Math.random(),ot=2*Math.PI*Math.random();return this.set(nt*Math.cos(rt),it*Math.sin(ot),it*Math.cos(ot),nt*Math.sin(rt))}equals(et){return et._x===this._x&&et._y===this._y&&et._z===this._z&&et._w===this._w}fromArray(et,nt=0){return this._x=et[nt],this._y=et[nt+1],this._z=et[nt+2],this._w=et[nt+3],this._onChangeCallback(),this}toArray(et=[],nt=0){return et[nt]=this._x,et[nt+1]=this._y,et[nt+2]=this._z,et[nt+3]=this._w,et}fromBufferAttribute(et,nt){return this._x=et.getX(nt),this._y=et.getY(nt),this._z=et.getZ(nt),this._w=et.getW(nt),this}_onChange(et){return this._onChangeCallback=et,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(et=0,nt=0,it=0){Vector3.prototype.isVector3=!0,this.x=et,this.y=nt,this.z=it}set(et,nt,it){return it===void 0&&(it=this.z),this.x=et,this.y=nt,this.z=it,this}setScalar(et){return this.x=et,this.y=et,this.z=et,this}setX(et){return this.x=et,this}setY(et){return this.y=et,this}setZ(et){return this.z=et,this}setComponent(et,nt){switch(et){case 0:this.x=nt;break;case 1:this.y=nt;break;case 2:this.z=nt;break;default:throw new Error("index is out of range: "+et)}return this}getComponent(et){switch(et){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+et)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(et){return this.x=et.x,this.y=et.y,this.z=et.z,this}add(et){return this.x+=et.x,this.y+=et.y,this.z+=et.z,this}addScalar(et){return this.x+=et,this.y+=et,this.z+=et,this}addVectors(et,nt){return this.x=et.x+nt.x,this.y=et.y+nt.y,this.z=et.z+nt.z,this}addScaledVector(et,nt){return this.x+=et.x*nt,this.y+=et.y*nt,this.z+=et.z*nt,this}sub(et){return this.x-=et.x,this.y-=et.y,this.z-=et.z,this}subScalar(et){return this.x-=et,this.y-=et,this.z-=et,this}subVectors(et,nt){return this.x=et.x-nt.x,this.y=et.y-nt.y,this.z=et.z-nt.z,this}multiply(et){return this.x*=et.x,this.y*=et.y,this.z*=et.z,this}multiplyScalar(et){return this.x*=et,this.y*=et,this.z*=et,this}multiplyVectors(et,nt){return this.x=et.x*nt.x,this.y=et.y*nt.y,this.z=et.z*nt.z,this}applyEuler(et){return this.applyQuaternion(_quaternion$4.setFromEuler(et))}applyAxisAngle(et,nt){return this.applyQuaternion(_quaternion$4.setFromAxisAngle(et,nt))}applyMatrix3(et){const nt=this.x,it=this.y,rt=this.z,ot=et.elements;return this.x=ot[0]*nt+ot[3]*it+ot[6]*rt,this.y=ot[1]*nt+ot[4]*it+ot[7]*rt,this.z=ot[2]*nt+ot[5]*it+ot[8]*rt,this}applyNormalMatrix(et){return this.applyMatrix3(et).normalize()}applyMatrix4(et){const nt=this.x,it=this.y,rt=this.z,ot=et.elements,at=1/(ot[3]*nt+ot[7]*it+ot[11]*rt+ot[15]);return this.x=(ot[0]*nt+ot[4]*it+ot[8]*rt+ot[12])*at,this.y=(ot[1]*nt+ot[5]*it+ot[9]*rt+ot[13])*at,this.z=(ot[2]*nt+ot[6]*it+ot[10]*rt+ot[14])*at,this}applyQuaternion(et){const nt=this.x,it=this.y,rt=this.z,ot=et.x,at=et.y,st=et.z,lt=et.w,ct=lt*nt+at*rt-st*it,ut=lt*it+st*nt-ot*rt,ht=lt*rt+ot*it-at*nt,dt=-ot*nt-at*it-st*rt;return this.x=ct*lt+dt*-ot+ut*-st-ht*-at,this.y=ut*lt+dt*-at+ht*-ot-ct*-st,this.z=ht*lt+dt*-st+ct*-at-ut*-ot,this}project(et){return this.applyMatrix4(et.matrixWorldInverse).applyMatrix4(et.projectionMatrix)}unproject(et){return this.applyMatrix4(et.projectionMatrixInverse).applyMatrix4(et.matrixWorld)}transformDirection(et){const nt=this.x,it=this.y,rt=this.z,ot=et.elements;return this.x=ot[0]*nt+ot[4]*it+ot[8]*rt,this.y=ot[1]*nt+ot[5]*it+ot[9]*rt,this.z=ot[2]*nt+ot[6]*it+ot[10]*rt,this.normalize()}divide(et){return this.x/=et.x,this.y/=et.y,this.z/=et.z,this}divideScalar(et){return this.multiplyScalar(1/et)}min(et){return this.x=Math.min(this.x,et.x),this.y=Math.min(this.y,et.y),this.z=Math.min(this.z,et.z),this}max(et){return this.x=Math.max(this.x,et.x),this.y=Math.max(this.y,et.y),this.z=Math.max(this.z,et.z),this}clamp(et,nt){return this.x=Math.max(et.x,Math.min(nt.x,this.x)),this.y=Math.max(et.y,Math.min(nt.y,this.y)),this.z=Math.max(et.z,Math.min(nt.z,this.z)),this}clampScalar(et,nt){return this.x=Math.max(et,Math.min(nt,this.x)),this.y=Math.max(et,Math.min(nt,this.y)),this.z=Math.max(et,Math.min(nt,this.z)),this}clampLength(et,nt){const it=this.length();return this.divideScalar(it||1).multiplyScalar(Math.max(et,Math.min(nt,it)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(et){return this.x*et.x+this.y*et.y+this.z*et.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(et){return this.normalize().multiplyScalar(et)}lerp(et,nt){return this.x+=(et.x-this.x)*nt,this.y+=(et.y-this.y)*nt,this.z+=(et.z-this.z)*nt,this}lerpVectors(et,nt,it){return this.x=et.x+(nt.x-et.x)*it,this.y=et.y+(nt.y-et.y)*it,this.z=et.z+(nt.z-et.z)*it,this}cross(et){return this.crossVectors(this,et)}crossVectors(et,nt){const it=et.x,rt=et.y,ot=et.z,at=nt.x,st=nt.y,lt=nt.z;return this.x=rt*lt-ot*st,this.y=ot*at-it*lt,this.z=it*st-rt*at,this}projectOnVector(et){const nt=et.lengthSq();if(nt===0)return this.set(0,0,0);const it=et.dot(this)/nt;return this.copy(et).multiplyScalar(it)}projectOnPlane(et){return _vector$c.copy(this).projectOnVector(et),this.sub(_vector$c)}reflect(et){return this.sub(_vector$c.copy(et).multiplyScalar(2*this.dot(et)))}angleTo(et){const nt=Math.sqrt(this.lengthSq()*et.lengthSq());if(nt===0)return Math.PI/2;const it=this.dot(et)/nt;return Math.acos(clamp$6(it,-1,1))}distanceTo(et){return Math.sqrt(this.distanceToSquared(et))}distanceToSquared(et){const nt=this.x-et.x,it=this.y-et.y,rt=this.z-et.z;return nt*nt+it*it+rt*rt}manhattanDistanceTo(et){return Math.abs(this.x-et.x)+Math.abs(this.y-et.y)+Math.abs(this.z-et.z)}setFromSpherical(et){return this.setFromSphericalCoords(et.radius,et.phi,et.theta)}setFromSphericalCoords(et,nt,it){const rt=Math.sin(nt)*et;return this.x=rt*Math.sin(it),this.y=Math.cos(nt)*et,this.z=rt*Math.cos(it),this}setFromCylindrical(et){return this.setFromCylindricalCoords(et.radius,et.theta,et.y)}setFromCylindricalCoords(et,nt,it){return this.x=et*Math.sin(nt),this.y=it,this.z=et*Math.cos(nt),this}setFromMatrixPosition(et){const nt=et.elements;return this.x=nt[12],this.y=nt[13],this.z=nt[14],this}setFromMatrixScale(et){const nt=this.setFromMatrixColumn(et,0).length(),it=this.setFromMatrixColumn(et,1).length(),rt=this.setFromMatrixColumn(et,2).length();return this.x=nt,this.y=it,this.z=rt,this}setFromMatrixColumn(et,nt){return this.fromArray(et.elements,nt*4)}setFromMatrix3Column(et,nt){return this.fromArray(et.elements,nt*3)}setFromEuler(et){return this.x=et._x,this.y=et._y,this.z=et._z,this}equals(et){return et.x===this.x&&et.y===this.y&&et.z===this.z}fromArray(et,nt=0){return this.x=et[nt],this.y=et[nt+1],this.z=et[nt+2],this}toArray(et=[],nt=0){return et[nt]=this.x,et[nt+1]=this.y,et[nt+2]=this.z,et}fromBufferAttribute(et,nt){return this.x=et.getX(nt),this.y=et.getY(nt),this.z=et.getZ(nt),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const et=(Math.random()-.5)*2,nt=Math.random()*Math.PI*2,it=Math.sqrt(1-et**2);return this.x=it*Math.cos(nt),this.y=it*Math.sin(nt),this.z=et,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _vector$c=new Vector3,_quaternion$4=new Quaternion;class Box3{constructor(et=new Vector3(1/0,1/0,1/0),nt=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=et,this.max=nt}set(et,nt){return this.min.copy(et),this.max.copy(nt),this}setFromArray(et){let nt=1/0,it=1/0,rt=1/0,ot=-1/0,at=-1/0,st=-1/0;for(let lt=0,ct=et.length;ltot&&(ot=ut),ht>at&&(at=ht),dt>st&&(st=dt)}return this.min.set(nt,it,rt),this.max.set(ot,at,st),this}setFromBufferAttribute(et){let nt=1/0,it=1/0,rt=1/0,ot=-1/0,at=-1/0,st=-1/0;for(let lt=0,ct=et.count;ltot&&(ot=ut),ht>at&&(at=ht),dt>st&&(st=dt)}return this.min.set(nt,it,rt),this.max.set(ot,at,st),this}setFromPoints(et){this.makeEmpty();for(let nt=0,it=et.length;ntthis.max.x||et.ythis.max.y||et.zthis.max.z)}containsBox(et){return this.min.x<=et.min.x&&et.max.x<=this.max.x&&this.min.y<=et.min.y&&et.max.y<=this.max.y&&this.min.z<=et.min.z&&et.max.z<=this.max.z}getParameter(et,nt){return nt.set((et.x-this.min.x)/(this.max.x-this.min.x),(et.y-this.min.y)/(this.max.y-this.min.y),(et.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(et){return!(et.max.xthis.max.x||et.max.ythis.max.y||et.max.zthis.max.z)}intersectsSphere(et){return this.clampPoint(et.center,_vector$b),_vector$b.distanceToSquared(et.center)<=et.radius*et.radius}intersectsPlane(et){let nt,it;return et.normal.x>0?(nt=et.normal.x*this.min.x,it=et.normal.x*this.max.x):(nt=et.normal.x*this.max.x,it=et.normal.x*this.min.x),et.normal.y>0?(nt+=et.normal.y*this.min.y,it+=et.normal.y*this.max.y):(nt+=et.normal.y*this.max.y,it+=et.normal.y*this.min.y),et.normal.z>0?(nt+=et.normal.z*this.min.z,it+=et.normal.z*this.max.z):(nt+=et.normal.z*this.max.z,it+=et.normal.z*this.min.z),nt<=-et.constant&&it>=-et.constant}intersectsTriangle(et){if(this.isEmpty())return!1;this.getCenter(_center),_extents.subVectors(this.max,_center),_v0$2.subVectors(et.a,_center),_v1$7.subVectors(et.b,_center),_v2$3.subVectors(et.c,_center),_f0.subVectors(_v1$7,_v0$2),_f1.subVectors(_v2$3,_v1$7),_f2.subVectors(_v0$2,_v2$3);let nt=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];return!satForAxes(nt,_v0$2,_v1$7,_v2$3,_extents)||(nt=[1,0,0,0,1,0,0,0,1],!satForAxes(nt,_v0$2,_v1$7,_v2$3,_extents))?!1:(_triangleNormal.crossVectors(_f0,_f1),nt=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z],satForAxes(nt,_v0$2,_v1$7,_v2$3,_extents))}clampPoint(et,nt){return nt.copy(et).clamp(this.min,this.max)}distanceToPoint(et){return _vector$b.copy(et).clamp(this.min,this.max).sub(et).length()}getBoundingSphere(et){return this.getCenter(et.center),et.radius=this.getSize(_vector$b).length()*.5,et}intersect(et){return this.min.max(et.min),this.max.min(et.max),this.isEmpty()&&this.makeEmpty(),this}union(et){return this.min.min(et.min),this.max.max(et.max),this}applyMatrix4(et){return this.isEmpty()?this:(_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(et),_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(et),_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(et),_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(et),_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(et),_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(et),_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(et),_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(et),this.setFromPoints(_points),this)}translate(et){return this.min.add(et),this.max.add(et),this}equals(et){return et.min.equals(this.min)&&et.max.equals(this.max)}}const _points=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],_vector$b=new Vector3,_box$3=new Box3,_v0$2=new Vector3,_v1$7=new Vector3,_v2$3=new Vector3,_f0=new Vector3,_f1=new Vector3,_f2=new Vector3,_center=new Vector3,_extents=new Vector3,_triangleNormal=new Vector3,_testAxis=new Vector3;function satForAxes(tt,et,nt,it,rt){for(let ot=0,at=tt.length-3;ot<=at;ot+=3){_testAxis.fromArray(tt,ot);const st=rt.x*Math.abs(_testAxis.x)+rt.y*Math.abs(_testAxis.y)+rt.z*Math.abs(_testAxis.z),lt=et.dot(_testAxis),ct=nt.dot(_testAxis),ut=it.dot(_testAxis);if(Math.max(-Math.max(lt,ct,ut),Math.min(lt,ct,ut))>st)return!1}return!0}const _box$2=new Box3,_v1$6=new Vector3,_toFarthestPoint=new Vector3,_toPoint=new Vector3;class Sphere{constructor(et=new Vector3,nt=-1){this.center=et,this.radius=nt}set(et,nt){return this.center.copy(et),this.radius=nt,this}setFromPoints(et,nt){const it=this.center;nt!==void 0?it.copy(nt):_box$2.setFromPoints(et).getCenter(it);let rt=0;for(let ot=0,at=et.length;otthis.radius*this.radius&&(nt.sub(this.center).normalize(),nt.multiplyScalar(this.radius).add(this.center)),nt}getBoundingBox(et){return this.isEmpty()?(et.makeEmpty(),et):(et.set(this.center,this.center),et.expandByScalar(this.radius),et)}applyMatrix4(et){return this.center.applyMatrix4(et),this.radius=this.radius*et.getMaxScaleOnAxis(),this}translate(et){return this.center.add(et),this}expandByPoint(et){_toPoint.subVectors(et,this.center);const nt=_toPoint.lengthSq();if(nt>this.radius*this.radius){const it=Math.sqrt(nt),rt=(it-this.radius)*.5;this.center.add(_toPoint.multiplyScalar(rt/it)),this.radius+=rt}return this}union(et){return this.center.equals(et.center)===!0?_toFarthestPoint.set(0,0,1).multiplyScalar(et.radius):_toFarthestPoint.subVectors(et.center,this.center).normalize().multiplyScalar(et.radius),this.expandByPoint(_v1$6.copy(et.center).add(_toFarthestPoint)),this.expandByPoint(_v1$6.copy(et.center).sub(_toFarthestPoint)),this}equals(et){return et.center.equals(this.center)&&et.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _vector$a=new Vector3,_segCenter=new Vector3,_segDir=new Vector3,_diff=new Vector3,_edge1=new Vector3,_edge2=new Vector3,_normal$1=new Vector3;class Ray{constructor(et=new Vector3,nt=new Vector3(0,0,-1)){this.origin=et,this.direction=nt}set(et,nt){return this.origin.copy(et),this.direction.copy(nt),this}copy(et){return this.origin.copy(et.origin),this.direction.copy(et.direction),this}at(et,nt){return nt.copy(this.direction).multiplyScalar(et).add(this.origin)}lookAt(et){return this.direction.copy(et).sub(this.origin).normalize(),this}recast(et){return this.origin.copy(this.at(et,_vector$a)),this}closestPointToPoint(et,nt){nt.subVectors(et,this.origin);const it=nt.dot(this.direction);return it<0?nt.copy(this.origin):nt.copy(this.direction).multiplyScalar(it).add(this.origin)}distanceToPoint(et){return Math.sqrt(this.distanceSqToPoint(et))}distanceSqToPoint(et){const nt=_vector$a.subVectors(et,this.origin).dot(this.direction);return nt<0?this.origin.distanceToSquared(et):(_vector$a.copy(this.direction).multiplyScalar(nt).add(this.origin),_vector$a.distanceToSquared(et))}distanceSqToSegment(et,nt,it,rt){_segCenter.copy(et).add(nt).multiplyScalar(.5),_segDir.copy(nt).sub(et).normalize(),_diff.copy(this.origin).sub(_segCenter);const ot=et.distanceTo(nt)*.5,at=-this.direction.dot(_segDir),st=_diff.dot(this.direction),lt=-_diff.dot(_segDir),ct=_diff.lengthSq(),ut=Math.abs(1-at*at);let ht,dt,pt,mt;if(ut>0)if(ht=at*lt-st,dt=at*st-lt,mt=ot*ut,ht>=0)if(dt>=-mt)if(dt<=mt){const gt=1/ut;ht*=gt,dt*=gt,pt=ht*(ht+at*dt+2*st)+dt*(at*ht+dt+2*lt)+ct}else dt=ot,ht=Math.max(0,-(at*dt+st)),pt=-ht*ht+dt*(dt+2*lt)+ct;else dt=-ot,ht=Math.max(0,-(at*dt+st)),pt=-ht*ht+dt*(dt+2*lt)+ct;else dt<=-mt?(ht=Math.max(0,-(-at*ot+st)),dt=ht>0?-ot:Math.min(Math.max(-ot,-lt),ot),pt=-ht*ht+dt*(dt+2*lt)+ct):dt<=mt?(ht=0,dt=Math.min(Math.max(-ot,-lt),ot),pt=dt*(dt+2*lt)+ct):(ht=Math.max(0,-(at*ot+st)),dt=ht>0?ot:Math.min(Math.max(-ot,-lt),ot),pt=-ht*ht+dt*(dt+2*lt)+ct);else dt=at>0?-ot:ot,ht=Math.max(0,-(at*dt+st)),pt=-ht*ht+dt*(dt+2*lt)+ct;return it&&it.copy(this.direction).multiplyScalar(ht).add(this.origin),rt&&rt.copy(_segDir).multiplyScalar(dt).add(_segCenter),pt}intersectSphere(et,nt){_vector$a.subVectors(et.center,this.origin);const it=_vector$a.dot(this.direction),rt=_vector$a.dot(_vector$a)-it*it,ot=et.radius*et.radius;if(rt>ot)return null;const at=Math.sqrt(ot-rt),st=it-at,lt=it+at;return st<0&<<0?null:st<0?this.at(lt,nt):this.at(st,nt)}intersectsSphere(et){return this.distanceSqToPoint(et.center)<=et.radius*et.radius}distanceToPlane(et){const nt=et.normal.dot(this.direction);if(nt===0)return et.distanceToPoint(this.origin)===0?0:null;const it=-(this.origin.dot(et.normal)+et.constant)/nt;return it>=0?it:null}intersectPlane(et,nt){const it=this.distanceToPlane(et);return it===null?null:this.at(it,nt)}intersectsPlane(et){const nt=et.distanceToPoint(this.origin);return nt===0||et.normal.dot(this.direction)*nt<0}intersectBox(et,nt){let it,rt,ot,at,st,lt;const ct=1/this.direction.x,ut=1/this.direction.y,ht=1/this.direction.z,dt=this.origin;return ct>=0?(it=(et.min.x-dt.x)*ct,rt=(et.max.x-dt.x)*ct):(it=(et.max.x-dt.x)*ct,rt=(et.min.x-dt.x)*ct),ut>=0?(ot=(et.min.y-dt.y)*ut,at=(et.max.y-dt.y)*ut):(ot=(et.max.y-dt.y)*ut,at=(et.min.y-dt.y)*ut),it>at||ot>rt||((ot>it||it!==it)&&(it=ot),(at=0?(st=(et.min.z-dt.z)*ht,lt=(et.max.z-dt.z)*ht):(st=(et.max.z-dt.z)*ht,lt=(et.min.z-dt.z)*ht),it>lt||st>rt)||((st>it||it!==it)&&(it=st),(lt=0?it:rt,nt)}intersectsBox(et){return this.intersectBox(et,_vector$a)!==null}intersectTriangle(et,nt,it,rt,ot){_edge1.subVectors(nt,et),_edge2.subVectors(it,et),_normal$1.crossVectors(_edge1,_edge2);let at=this.direction.dot(_normal$1),st;if(at>0){if(rt)return null;st=1}else if(at<0)st=-1,at=-at;else return null;_diff.subVectors(this.origin,et);const lt=st*this.direction.dot(_edge2.crossVectors(_diff,_edge2));if(lt<0)return null;const ct=st*this.direction.dot(_edge1.cross(_diff));if(ct<0||lt+ct>at)return null;const ut=-st*_diff.dot(_normal$1);return ut<0?null:this.at(ut/at,ot)}applyMatrix4(et){return this.origin.applyMatrix4(et),this.direction.transformDirection(et),this}equals(et){return et.origin.equals(this.origin)&&et.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Matrix4{constructor(){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt,bt){const yt=this.elements;return yt[0]=et,yt[4]=nt,yt[8]=it,yt[12]=rt,yt[1]=ot,yt[5]=at,yt[9]=st,yt[13]=lt,yt[2]=ct,yt[6]=ut,yt[10]=ht,yt[14]=dt,yt[3]=pt,yt[7]=mt,yt[11]=gt,yt[15]=bt,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Matrix4().fromArray(this.elements)}copy(et){const nt=this.elements,it=et.elements;return nt[0]=it[0],nt[1]=it[1],nt[2]=it[2],nt[3]=it[3],nt[4]=it[4],nt[5]=it[5],nt[6]=it[6],nt[7]=it[7],nt[8]=it[8],nt[9]=it[9],nt[10]=it[10],nt[11]=it[11],nt[12]=it[12],nt[13]=it[13],nt[14]=it[14],nt[15]=it[15],this}copyPosition(et){const nt=this.elements,it=et.elements;return nt[12]=it[12],nt[13]=it[13],nt[14]=it[14],this}setFromMatrix3(et){const nt=et.elements;return this.set(nt[0],nt[3],nt[6],0,nt[1],nt[4],nt[7],0,nt[2],nt[5],nt[8],0,0,0,0,1),this}extractBasis(et,nt,it){return et.setFromMatrixColumn(this,0),nt.setFromMatrixColumn(this,1),it.setFromMatrixColumn(this,2),this}makeBasis(et,nt,it){return this.set(et.x,nt.x,it.x,0,et.y,nt.y,it.y,0,et.z,nt.z,it.z,0,0,0,0,1),this}extractRotation(et){const nt=this.elements,it=et.elements,rt=1/_v1$5.setFromMatrixColumn(et,0).length(),ot=1/_v1$5.setFromMatrixColumn(et,1).length(),at=1/_v1$5.setFromMatrixColumn(et,2).length();return nt[0]=it[0]*rt,nt[1]=it[1]*rt,nt[2]=it[2]*rt,nt[3]=0,nt[4]=it[4]*ot,nt[5]=it[5]*ot,nt[6]=it[6]*ot,nt[7]=0,nt[8]=it[8]*at,nt[9]=it[9]*at,nt[10]=it[10]*at,nt[11]=0,nt[12]=0,nt[13]=0,nt[14]=0,nt[15]=1,this}makeRotationFromEuler(et){const nt=this.elements,it=et.x,rt=et.y,ot=et.z,at=Math.cos(it),st=Math.sin(it),lt=Math.cos(rt),ct=Math.sin(rt),ut=Math.cos(ot),ht=Math.sin(ot);if(et.order==="XYZ"){const dt=at*ut,pt=at*ht,mt=st*ut,gt=st*ht;nt[0]=lt*ut,nt[4]=-lt*ht,nt[8]=ct,nt[1]=pt+mt*ct,nt[5]=dt-gt*ct,nt[9]=-st*lt,nt[2]=gt-dt*ct,nt[6]=mt+pt*ct,nt[10]=at*lt}else if(et.order==="YXZ"){const dt=lt*ut,pt=lt*ht,mt=ct*ut,gt=ct*ht;nt[0]=dt+gt*st,nt[4]=mt*st-pt,nt[8]=at*ct,nt[1]=at*ht,nt[5]=at*ut,nt[9]=-st,nt[2]=pt*st-mt,nt[6]=gt+dt*st,nt[10]=at*lt}else if(et.order==="ZXY"){const dt=lt*ut,pt=lt*ht,mt=ct*ut,gt=ct*ht;nt[0]=dt-gt*st,nt[4]=-at*ht,nt[8]=mt+pt*st,nt[1]=pt+mt*st,nt[5]=at*ut,nt[9]=gt-dt*st,nt[2]=-at*ct,nt[6]=st,nt[10]=at*lt}else if(et.order==="ZYX"){const dt=at*ut,pt=at*ht,mt=st*ut,gt=st*ht;nt[0]=lt*ut,nt[4]=mt*ct-pt,nt[8]=dt*ct+gt,nt[1]=lt*ht,nt[5]=gt*ct+dt,nt[9]=pt*ct-mt,nt[2]=-ct,nt[6]=st*lt,nt[10]=at*lt}else if(et.order==="YZX"){const dt=at*lt,pt=at*ct,mt=st*lt,gt=st*ct;nt[0]=lt*ut,nt[4]=gt-dt*ht,nt[8]=mt*ht+pt,nt[1]=ht,nt[5]=at*ut,nt[9]=-st*ut,nt[2]=-ct*ut,nt[6]=pt*ht+mt,nt[10]=dt-gt*ht}else if(et.order==="XZY"){const dt=at*lt,pt=at*ct,mt=st*lt,gt=st*ct;nt[0]=lt*ut,nt[4]=-ht,nt[8]=ct*ut,nt[1]=dt*ht+gt,nt[5]=at*ut,nt[9]=pt*ht-mt,nt[2]=mt*ht-pt,nt[6]=st*ut,nt[10]=gt*ht+dt}return nt[3]=0,nt[7]=0,nt[11]=0,nt[12]=0,nt[13]=0,nt[14]=0,nt[15]=1,this}makeRotationFromQuaternion(et){return this.compose(_zero,et,_one)}lookAt(et,nt,it){const rt=this.elements;return _z.subVectors(et,nt),_z.lengthSq()===0&&(_z.z=1),_z.normalize(),_x.crossVectors(it,_z),_x.lengthSq()===0&&(Math.abs(it.z)===1?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(it,_z)),_x.normalize(),_y.crossVectors(_z,_x),rt[0]=_x.x,rt[4]=_y.x,rt[8]=_z.x,rt[1]=_x.y,rt[5]=_y.y,rt[9]=_z.y,rt[2]=_x.z,rt[6]=_y.z,rt[10]=_z.z,this}multiply(et){return this.multiplyMatrices(this,et)}premultiply(et){return this.multiplyMatrices(et,this)}multiplyMatrices(et,nt){const it=et.elements,rt=nt.elements,ot=this.elements,at=it[0],st=it[4],lt=it[8],ct=it[12],ut=it[1],ht=it[5],dt=it[9],pt=it[13],mt=it[2],gt=it[6],bt=it[10],yt=it[14],wt=it[3],vt=it[7],xt=it[11],St=it[15],Et=rt[0],$t=rt[4],It=rt[8],Ft=rt[12],Ht=rt[1],zt=rt[5],Ot=rt[9],jt=rt[13],kt=rt[2],Tt=rt[6],Ct=rt[10],Ut=rt[14],Nt=rt[3],Bt=rt[7],Mt=rt[11],Dt=rt[15];return ot[0]=at*Et+st*Ht+lt*kt+ct*Nt,ot[4]=at*$t+st*zt+lt*Tt+ct*Bt,ot[8]=at*It+st*Ot+lt*Ct+ct*Mt,ot[12]=at*Ft+st*jt+lt*Ut+ct*Dt,ot[1]=ut*Et+ht*Ht+dt*kt+pt*Nt,ot[5]=ut*$t+ht*zt+dt*Tt+pt*Bt,ot[9]=ut*It+ht*Ot+dt*Ct+pt*Mt,ot[13]=ut*Ft+ht*jt+dt*Ut+pt*Dt,ot[2]=mt*Et+gt*Ht+bt*kt+yt*Nt,ot[6]=mt*$t+gt*zt+bt*Tt+yt*Bt,ot[10]=mt*It+gt*Ot+bt*Ct+yt*Mt,ot[14]=mt*Ft+gt*jt+bt*Ut+yt*Dt,ot[3]=wt*Et+vt*Ht+xt*kt+St*Nt,ot[7]=wt*$t+vt*zt+xt*Tt+St*Bt,ot[11]=wt*It+vt*Ot+xt*Ct+St*Mt,ot[15]=wt*Ft+vt*jt+xt*Ut+St*Dt,this}multiplyScalar(et){const nt=this.elements;return nt[0]*=et,nt[4]*=et,nt[8]*=et,nt[12]*=et,nt[1]*=et,nt[5]*=et,nt[9]*=et,nt[13]*=et,nt[2]*=et,nt[6]*=et,nt[10]*=et,nt[14]*=et,nt[3]*=et,nt[7]*=et,nt[11]*=et,nt[15]*=et,this}determinant(){const et=this.elements,nt=et[0],it=et[4],rt=et[8],ot=et[12],at=et[1],st=et[5],lt=et[9],ct=et[13],ut=et[2],ht=et[6],dt=et[10],pt=et[14],mt=et[3],gt=et[7],bt=et[11],yt=et[15];return mt*(+ot*lt*ht-rt*ct*ht-ot*st*dt+it*ct*dt+rt*st*pt-it*lt*pt)+gt*(+nt*lt*pt-nt*ct*dt+ot*at*dt-rt*at*pt+rt*ct*ut-ot*lt*ut)+bt*(+nt*ct*ht-nt*st*pt-ot*at*ht+it*at*pt+ot*st*ut-it*ct*ut)+yt*(-rt*st*ut-nt*lt*ht+nt*st*dt+rt*at*ht-it*at*dt+it*lt*ut)}transpose(){const et=this.elements;let nt;return nt=et[1],et[1]=et[4],et[4]=nt,nt=et[2],et[2]=et[8],et[8]=nt,nt=et[6],et[6]=et[9],et[9]=nt,nt=et[3],et[3]=et[12],et[12]=nt,nt=et[7],et[7]=et[13],et[13]=nt,nt=et[11],et[11]=et[14],et[14]=nt,this}setPosition(et,nt,it){const rt=this.elements;return et.isVector3?(rt[12]=et.x,rt[13]=et.y,rt[14]=et.z):(rt[12]=et,rt[13]=nt,rt[14]=it),this}invert(){const et=this.elements,nt=et[0],it=et[1],rt=et[2],ot=et[3],at=et[4],st=et[5],lt=et[6],ct=et[7],ut=et[8],ht=et[9],dt=et[10],pt=et[11],mt=et[12],gt=et[13],bt=et[14],yt=et[15],wt=ht*bt*ct-gt*dt*ct+gt*lt*pt-st*bt*pt-ht*lt*yt+st*dt*yt,vt=mt*dt*ct-ut*bt*ct-mt*lt*pt+at*bt*pt+ut*lt*yt-at*dt*yt,xt=ut*gt*ct-mt*ht*ct+mt*st*pt-at*gt*pt-ut*st*yt+at*ht*yt,St=mt*ht*lt-ut*gt*lt-mt*st*dt+at*gt*dt+ut*st*bt-at*ht*bt,Et=nt*wt+it*vt+rt*xt+ot*St;if(Et===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const $t=1/Et;return et[0]=wt*$t,et[1]=(gt*dt*ot-ht*bt*ot-gt*rt*pt+it*bt*pt+ht*rt*yt-it*dt*yt)*$t,et[2]=(st*bt*ot-gt*lt*ot+gt*rt*ct-it*bt*ct-st*rt*yt+it*lt*yt)*$t,et[3]=(ht*lt*ot-st*dt*ot-ht*rt*ct+it*dt*ct+st*rt*pt-it*lt*pt)*$t,et[4]=vt*$t,et[5]=(ut*bt*ot-mt*dt*ot+mt*rt*pt-nt*bt*pt-ut*rt*yt+nt*dt*yt)*$t,et[6]=(mt*lt*ot-at*bt*ot-mt*rt*ct+nt*bt*ct+at*rt*yt-nt*lt*yt)*$t,et[7]=(at*dt*ot-ut*lt*ot+ut*rt*ct-nt*dt*ct-at*rt*pt+nt*lt*pt)*$t,et[8]=xt*$t,et[9]=(mt*ht*ot-ut*gt*ot-mt*it*pt+nt*gt*pt+ut*it*yt-nt*ht*yt)*$t,et[10]=(at*gt*ot-mt*st*ot+mt*it*ct-nt*gt*ct-at*it*yt+nt*st*yt)*$t,et[11]=(ut*st*ot-at*ht*ot-ut*it*ct+nt*ht*ct+at*it*pt-nt*st*pt)*$t,et[12]=St*$t,et[13]=(ut*gt*rt-mt*ht*rt+mt*it*dt-nt*gt*dt-ut*it*bt+nt*ht*bt)*$t,et[14]=(mt*st*rt-at*gt*rt-mt*it*lt+nt*gt*lt+at*it*bt-nt*st*bt)*$t,et[15]=(at*ht*rt-ut*st*rt+ut*it*lt-nt*ht*lt-at*it*dt+nt*st*dt)*$t,this}scale(et){const nt=this.elements,it=et.x,rt=et.y,ot=et.z;return nt[0]*=it,nt[4]*=rt,nt[8]*=ot,nt[1]*=it,nt[5]*=rt,nt[9]*=ot,nt[2]*=it,nt[6]*=rt,nt[10]*=ot,nt[3]*=it,nt[7]*=rt,nt[11]*=ot,this}getMaxScaleOnAxis(){const et=this.elements,nt=et[0]*et[0]+et[1]*et[1]+et[2]*et[2],it=et[4]*et[4]+et[5]*et[5]+et[6]*et[6],rt=et[8]*et[8]+et[9]*et[9]+et[10]*et[10];return Math.sqrt(Math.max(nt,it,rt))}makeTranslation(et,nt,it){return this.set(1,0,0,et,0,1,0,nt,0,0,1,it,0,0,0,1),this}makeRotationX(et){const nt=Math.cos(et),it=Math.sin(et);return this.set(1,0,0,0,0,nt,-it,0,0,it,nt,0,0,0,0,1),this}makeRotationY(et){const nt=Math.cos(et),it=Math.sin(et);return this.set(nt,0,it,0,0,1,0,0,-it,0,nt,0,0,0,0,1),this}makeRotationZ(et){const nt=Math.cos(et),it=Math.sin(et);return this.set(nt,-it,0,0,it,nt,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(et,nt){const it=Math.cos(nt),rt=Math.sin(nt),ot=1-it,at=et.x,st=et.y,lt=et.z,ct=ot*at,ut=ot*st;return this.set(ct*at+it,ct*st-rt*lt,ct*lt+rt*st,0,ct*st+rt*lt,ut*st+it,ut*lt-rt*at,0,ct*lt-rt*st,ut*lt+rt*at,ot*lt*lt+it,0,0,0,0,1),this}makeScale(et,nt,it){return this.set(et,0,0,0,0,nt,0,0,0,0,it,0,0,0,0,1),this}makeShear(et,nt,it,rt,ot,at){return this.set(1,it,ot,0,et,1,at,0,nt,rt,1,0,0,0,0,1),this}compose(et,nt,it){const rt=this.elements,ot=nt._x,at=nt._y,st=nt._z,lt=nt._w,ct=ot+ot,ut=at+at,ht=st+st,dt=ot*ct,pt=ot*ut,mt=ot*ht,gt=at*ut,bt=at*ht,yt=st*ht,wt=lt*ct,vt=lt*ut,xt=lt*ht,St=it.x,Et=it.y,$t=it.z;return rt[0]=(1-(gt+yt))*St,rt[1]=(pt+xt)*St,rt[2]=(mt-vt)*St,rt[3]=0,rt[4]=(pt-xt)*Et,rt[5]=(1-(dt+yt))*Et,rt[6]=(bt+wt)*Et,rt[7]=0,rt[8]=(mt+vt)*$t,rt[9]=(bt-wt)*$t,rt[10]=(1-(dt+gt))*$t,rt[11]=0,rt[12]=et.x,rt[13]=et.y,rt[14]=et.z,rt[15]=1,this}decompose(et,nt,it){const rt=this.elements;let ot=_v1$5.set(rt[0],rt[1],rt[2]).length();const at=_v1$5.set(rt[4],rt[5],rt[6]).length(),st=_v1$5.set(rt[8],rt[9],rt[10]).length();this.determinant()<0&&(ot=-ot),et.x=rt[12],et.y=rt[13],et.z=rt[14],_m1$2.copy(this);const ct=1/ot,ut=1/at,ht=1/st;return _m1$2.elements[0]*=ct,_m1$2.elements[1]*=ct,_m1$2.elements[2]*=ct,_m1$2.elements[4]*=ut,_m1$2.elements[5]*=ut,_m1$2.elements[6]*=ut,_m1$2.elements[8]*=ht,_m1$2.elements[9]*=ht,_m1$2.elements[10]*=ht,nt.setFromRotationMatrix(_m1$2),it.x=ot,it.y=at,it.z=st,this}makePerspective(et,nt,it,rt,ot,at){const st=this.elements,lt=2*ot/(nt-et),ct=2*ot/(it-rt),ut=(nt+et)/(nt-et),ht=(it+rt)/(it-rt),dt=-(at+ot)/(at-ot),pt=-2*at*ot/(at-ot);return st[0]=lt,st[4]=0,st[8]=ut,st[12]=0,st[1]=0,st[5]=ct,st[9]=ht,st[13]=0,st[2]=0,st[6]=0,st[10]=dt,st[14]=pt,st[3]=0,st[7]=0,st[11]=-1,st[15]=0,this}makeOrthographic(et,nt,it,rt,ot,at){const st=this.elements,lt=1/(nt-et),ct=1/(it-rt),ut=1/(at-ot),ht=(nt+et)*lt,dt=(it+rt)*ct,pt=(at+ot)*ut;return st[0]=2*lt,st[4]=0,st[8]=0,st[12]=-ht,st[1]=0,st[5]=2*ct,st[9]=0,st[13]=-dt,st[2]=0,st[6]=0,st[10]=-2*ut,st[14]=-pt,st[3]=0,st[7]=0,st[11]=0,st[15]=1,this}equals(et){const nt=this.elements,it=et.elements;for(let rt=0;rt<16;rt++)if(nt[rt]!==it[rt])return!1;return!0}fromArray(et,nt=0){for(let it=0;it<16;it++)this.elements[it]=et[it+nt];return this}toArray(et=[],nt=0){const it=this.elements;return et[nt]=it[0],et[nt+1]=it[1],et[nt+2]=it[2],et[nt+3]=it[3],et[nt+4]=it[4],et[nt+5]=it[5],et[nt+6]=it[6],et[nt+7]=it[7],et[nt+8]=it[8],et[nt+9]=it[9],et[nt+10]=it[10],et[nt+11]=it[11],et[nt+12]=it[12],et[nt+13]=it[13],et[nt+14]=it[14],et[nt+15]=it[15],et}}const _v1$5=new Vector3,_m1$2=new Matrix4,_zero=new Vector3(0,0,0),_one=new Vector3(1,1,1),_x=new Vector3,_y=new Vector3,_z=new Vector3,_matrix$1=new Matrix4,_quaternion$3=new Quaternion;class Euler{constructor(et=0,nt=0,it=0,rt=Euler.DefaultOrder){this.isEuler=!0,this._x=et,this._y=nt,this._z=it,this._order=rt}get x(){return this._x}set x(et){this._x=et,this._onChangeCallback()}get y(){return this._y}set y(et){this._y=et,this._onChangeCallback()}get z(){return this._z}set z(et){this._z=et,this._onChangeCallback()}get order(){return this._order}set order(et){this._order=et,this._onChangeCallback()}set(et,nt,it,rt=this._order){return this._x=et,this._y=nt,this._z=it,this._order=rt,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(et){return this._x=et._x,this._y=et._y,this._z=et._z,this._order=et._order,this._onChangeCallback(),this}setFromRotationMatrix(et,nt=this._order,it=!0){const rt=et.elements,ot=rt[0],at=rt[4],st=rt[8],lt=rt[1],ct=rt[5],ut=rt[9],ht=rt[2],dt=rt[6],pt=rt[10];switch(nt){case"XYZ":this._y=Math.asin(clamp$6(st,-1,1)),Math.abs(st)<.9999999?(this._x=Math.atan2(-ut,pt),this._z=Math.atan2(-at,ot)):(this._x=Math.atan2(dt,ct),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp$6(ut,-1,1)),Math.abs(ut)<.9999999?(this._y=Math.atan2(st,pt),this._z=Math.atan2(lt,ct)):(this._y=Math.atan2(-ht,ot),this._z=0);break;case"ZXY":this._x=Math.asin(clamp$6(dt,-1,1)),Math.abs(dt)<.9999999?(this._y=Math.atan2(-ht,pt),this._z=Math.atan2(-at,ct)):(this._y=0,this._z=Math.atan2(lt,ot));break;case"ZYX":this._y=Math.asin(-clamp$6(ht,-1,1)),Math.abs(ht)<.9999999?(this._x=Math.atan2(dt,pt),this._z=Math.atan2(lt,ot)):(this._x=0,this._z=Math.atan2(-at,ct));break;case"YZX":this._z=Math.asin(clamp$6(lt,-1,1)),Math.abs(lt)<.9999999?(this._x=Math.atan2(-ut,ct),this._y=Math.atan2(-ht,ot)):(this._x=0,this._y=Math.atan2(st,pt));break;case"XZY":this._z=Math.asin(-clamp$6(at,-1,1)),Math.abs(at)<.9999999?(this._x=Math.atan2(dt,ct),this._y=Math.atan2(st,ot)):(this._x=Math.atan2(-ut,pt),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+nt)}return this._order=nt,it===!0&&this._onChangeCallback(),this}setFromQuaternion(et,nt,it){return _matrix$1.makeRotationFromQuaternion(et),this.setFromRotationMatrix(_matrix$1,nt,it)}setFromVector3(et,nt=this._order){return this.set(et.x,et.y,et.z,nt)}reorder(et){return _quaternion$3.setFromEuler(this),this.setFromQuaternion(_quaternion$3,et)}equals(et){return et._x===this._x&&et._y===this._y&&et._z===this._z&&et._order===this._order}fromArray(et){return this._x=et[0],this._y=et[1],this._z=et[2],et[3]!==void 0&&(this._order=et[3]),this._onChangeCallback(),this}toArray(et=[],nt=0){return et[nt]=this._x,et[nt+1]=this._y,et[nt+2]=this._z,et[nt+3]=this._order,et}_onChange(et){return this._onChangeCallback=et,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}Euler.DefaultOrder="XYZ";Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Layers{constructor(){this.mask=1}set(et){this.mask=(1<>>0}enable(et){this.mask|=1<1){for(let nt=0;nt1){for(let it=0;it0){rt.children=[];for(let st=0;st0){rt.animations=[];for(let st=0;st0&&(it.geometries=st),lt.length>0&&(it.materials=lt),ct.length>0&&(it.textures=ct),ut.length>0&&(it.images=ut),ht.length>0&&(it.shapes=ht),dt.length>0&&(it.skeletons=dt),pt.length>0&&(it.animations=pt),mt.length>0&&(it.nodes=mt)}return it.object=rt,it;function at(st){const lt=[];for(const ct in st){const ut=st[ct];delete ut.metadata,lt.push(ut)}return lt}}clone(et){return new this.constructor().copy(this,et)}copy(et,nt=!0){if(this.name=et.name,this.up.copy(et.up),this.position.copy(et.position),this.rotation.order=et.rotation.order,this.quaternion.copy(et.quaternion),this.scale.copy(et.scale),this.matrix.copy(et.matrix),this.matrixWorld.copy(et.matrixWorld),this.matrixAutoUpdate=et.matrixAutoUpdate,this.matrixWorldNeedsUpdate=et.matrixWorldNeedsUpdate,this.layers.mask=et.layers.mask,this.visible=et.visible,this.castShadow=et.castShadow,this.receiveShadow=et.receiveShadow,this.frustumCulled=et.frustumCulled,this.renderOrder=et.renderOrder,this.userData=JSON.parse(JSON.stringify(et.userData)),nt===!0)for(let it=0;it0?rt.multiplyScalar(1/Math.sqrt(ot)):rt.set(0,0,0)}static getBarycoord(et,nt,it,rt,ot){_v0$1.subVectors(rt,nt),_v1$3.subVectors(it,nt),_v2$2.subVectors(et,nt);const at=_v0$1.dot(_v0$1),st=_v0$1.dot(_v1$3),lt=_v0$1.dot(_v2$2),ct=_v1$3.dot(_v1$3),ut=_v1$3.dot(_v2$2),ht=at*ct-st*st;if(ht===0)return ot.set(-2,-1,-1);const dt=1/ht,pt=(ct*lt-st*ut)*dt,mt=(at*ut-st*lt)*dt;return ot.set(1-pt-mt,mt,pt)}static containsPoint(et,nt,it,rt){return this.getBarycoord(et,nt,it,rt,_v3$1),_v3$1.x>=0&&_v3$1.y>=0&&_v3$1.x+_v3$1.y<=1}static getUV(et,nt,it,rt,ot,at,st,lt){return this.getBarycoord(et,nt,it,rt,_v3$1),lt.set(0,0),lt.addScaledVector(ot,_v3$1.x),lt.addScaledVector(at,_v3$1.y),lt.addScaledVector(st,_v3$1.z),lt}static isFrontFacing(et,nt,it,rt){return _v0$1.subVectors(it,nt),_v1$3.subVectors(et,nt),_v0$1.cross(_v1$3).dot(rt)<0}set(et,nt,it){return this.a.copy(et),this.b.copy(nt),this.c.copy(it),this}setFromPointsAndIndices(et,nt,it,rt){return this.a.copy(et[nt]),this.b.copy(et[it]),this.c.copy(et[rt]),this}setFromAttributeAndIndices(et,nt,it,rt){return this.a.fromBufferAttribute(et,nt),this.b.fromBufferAttribute(et,it),this.c.fromBufferAttribute(et,rt),this}clone(){return new this.constructor().copy(this)}copy(et){return this.a.copy(et.a),this.b.copy(et.b),this.c.copy(et.c),this}getArea(){return _v0$1.subVectors(this.c,this.b),_v1$3.subVectors(this.a,this.b),_v0$1.cross(_v1$3).length()*.5}getMidpoint(et){return et.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(et){return Triangle.getNormal(this.a,this.b,this.c,et)}getPlane(et){return et.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(et,nt){return Triangle.getBarycoord(et,this.a,this.b,this.c,nt)}getUV(et,nt,it,rt,ot){return Triangle.getUV(et,this.a,this.b,this.c,nt,it,rt,ot)}containsPoint(et){return Triangle.containsPoint(et,this.a,this.b,this.c)}isFrontFacing(et){return Triangle.isFrontFacing(this.a,this.b,this.c,et)}intersectsBox(et){return et.intersectsTriangle(this)}closestPointToPoint(et,nt){const it=this.a,rt=this.b,ot=this.c;let at,st;_vab.subVectors(rt,it),_vac.subVectors(ot,it),_vap.subVectors(et,it);const lt=_vab.dot(_vap),ct=_vac.dot(_vap);if(lt<=0&&ct<=0)return nt.copy(it);_vbp.subVectors(et,rt);const ut=_vab.dot(_vbp),ht=_vac.dot(_vbp);if(ut>=0&&ht<=ut)return nt.copy(rt);const dt=lt*ht-ut*ct;if(dt<=0&<>=0&&ut<=0)return at=lt/(lt-ut),nt.copy(it).addScaledVector(_vab,at);_vcp.subVectors(et,ot);const pt=_vab.dot(_vcp),mt=_vac.dot(_vcp);if(mt>=0&&pt<=mt)return nt.copy(ot);const gt=pt*ct-lt*mt;if(gt<=0&&ct>=0&&mt<=0)return st=ct/(ct-mt),nt.copy(it).addScaledVector(_vac,st);const bt=ut*mt-pt*ht;if(bt<=0&&ht-ut>=0&&pt-mt>=0)return _vbc.subVectors(ot,rt),st=(ht-ut)/(ht-ut+(pt-mt)),nt.copy(rt).addScaledVector(_vbc,st);const yt=1/(bt+gt+dt);return at=gt*yt,st=dt*yt,nt.copy(it).addScaledVector(_vab,at).addScaledVector(_vac,st)}equals(et){return et.a.equals(this.a)&&et.b.equals(this.b)&&et.c.equals(this.c)}}let materialId=0;class Material extends EventDispatcher$1{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:materialId++}),this.uuid=generateUUID$1(),this.name="",this.type="Material",this.blending=NormalBlending,this.side=FrontSide,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=SrcAlphaFactor,this.blendDst=OneMinusSrcAlphaFactor,this.blendEquation=AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=AlwaysStencilFunc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=KeepStencilOp,this.stencilZFail=KeepStencilOp,this.stencilZPass=KeepStencilOp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(et){this._alphaTest>0!=et>0&&this.version++,this._alphaTest=et}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(et){if(et!==void 0)for(const nt in et){const it=et[nt];if(it===void 0){console.warn("THREE.Material: '"+nt+"' parameter is undefined.");continue}if(nt==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=it===FlatShading;continue}const rt=this[nt];if(rt===void 0){console.warn("THREE."+this.type+": '"+nt+"' is not a property of this material.");continue}rt&&rt.isColor?rt.set(it):rt&&rt.isVector3&&it&&it.isVector3?rt.copy(it):this[nt]=it}}toJSON(et){const nt=et===void 0||typeof et=="string";nt&&(et={textures:{},images:{}});const it={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};it.uuid=this.uuid,it.type=this.type,this.name!==""&&(it.name=this.name),this.color&&this.color.isColor&&(it.color=this.color.getHex()),this.roughness!==void 0&&(it.roughness=this.roughness),this.metalness!==void 0&&(it.metalness=this.metalness),this.sheen!==void 0&&(it.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(it.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(it.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(it.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(it.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(it.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(it.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(it.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(it.shininess=this.shininess),this.clearcoat!==void 0&&(it.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(it.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(it.clearcoatMap=this.clearcoatMap.toJSON(et).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(it.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(et).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(it.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(et).uuid,it.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(it.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(it.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(it.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(it.iridescenceMap=this.iridescenceMap.toJSON(et).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(it.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(et).uuid),this.map&&this.map.isTexture&&(it.map=this.map.toJSON(et).uuid),this.matcap&&this.matcap.isTexture&&(it.matcap=this.matcap.toJSON(et).uuid),this.alphaMap&&this.alphaMap.isTexture&&(it.alphaMap=this.alphaMap.toJSON(et).uuid),this.lightMap&&this.lightMap.isTexture&&(it.lightMap=this.lightMap.toJSON(et).uuid,it.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(it.aoMap=this.aoMap.toJSON(et).uuid,it.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(it.bumpMap=this.bumpMap.toJSON(et).uuid,it.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(it.normalMap=this.normalMap.toJSON(et).uuid,it.normalMapType=this.normalMapType,it.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(it.displacementMap=this.displacementMap.toJSON(et).uuid,it.displacementScale=this.displacementScale,it.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(it.roughnessMap=this.roughnessMap.toJSON(et).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(it.metalnessMap=this.metalnessMap.toJSON(et).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(it.emissiveMap=this.emissiveMap.toJSON(et).uuid),this.specularMap&&this.specularMap.isTexture&&(it.specularMap=this.specularMap.toJSON(et).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(it.specularIntensityMap=this.specularIntensityMap.toJSON(et).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(it.specularColorMap=this.specularColorMap.toJSON(et).uuid),this.envMap&&this.envMap.isTexture&&(it.envMap=this.envMap.toJSON(et).uuid,this.combine!==void 0&&(it.combine=this.combine)),this.envMapIntensity!==void 0&&(it.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(it.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(it.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(it.gradientMap=this.gradientMap.toJSON(et).uuid),this.transmission!==void 0&&(it.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(it.transmissionMap=this.transmissionMap.toJSON(et).uuid),this.thickness!==void 0&&(it.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(it.thicknessMap=this.thicknessMap.toJSON(et).uuid),this.attenuationDistance!==void 0&&(it.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(it.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(it.size=this.size),this.shadowSide!==null&&(it.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(it.sizeAttenuation=this.sizeAttenuation),this.blending!==NormalBlending&&(it.blending=this.blending),this.side!==FrontSide&&(it.side=this.side),this.vertexColors&&(it.vertexColors=!0),this.opacity<1&&(it.opacity=this.opacity),this.transparent===!0&&(it.transparent=this.transparent),it.depthFunc=this.depthFunc,it.depthTest=this.depthTest,it.depthWrite=this.depthWrite,it.colorWrite=this.colorWrite,it.stencilWrite=this.stencilWrite,it.stencilWriteMask=this.stencilWriteMask,it.stencilFunc=this.stencilFunc,it.stencilRef=this.stencilRef,it.stencilFuncMask=this.stencilFuncMask,it.stencilFail=this.stencilFail,it.stencilZFail=this.stencilZFail,it.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(it.rotation=this.rotation),this.polygonOffset===!0&&(it.polygonOffset=!0),this.polygonOffsetFactor!==0&&(it.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(it.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(it.linewidth=this.linewidth),this.dashSize!==void 0&&(it.dashSize=this.dashSize),this.gapSize!==void 0&&(it.gapSize=this.gapSize),this.scale!==void 0&&(it.scale=this.scale),this.dithering===!0&&(it.dithering=!0),this.alphaTest>0&&(it.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(it.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(it.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(it.wireframe=this.wireframe),this.wireframeLinewidth>1&&(it.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(it.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(it.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(it.flatShading=this.flatShading),this.visible===!1&&(it.visible=!1),this.toneMapped===!1&&(it.toneMapped=!1),this.fog===!1&&(it.fog=!1),JSON.stringify(this.userData)!=="{}"&&(it.userData=this.userData);function rt(ot){const at=[];for(const st in ot){const lt=ot[st];delete lt.metadata,at.push(lt)}return at}if(nt){const ot=rt(et.textures),at=rt(et.images);ot.length>0&&(it.textures=ot),at.length>0&&(it.images=at)}return it}clone(){return new this.constructor().copy(this)}copy(et){this.name=et.name,this.blending=et.blending,this.side=et.side,this.vertexColors=et.vertexColors,this.opacity=et.opacity,this.transparent=et.transparent,this.blendSrc=et.blendSrc,this.blendDst=et.blendDst,this.blendEquation=et.blendEquation,this.blendSrcAlpha=et.blendSrcAlpha,this.blendDstAlpha=et.blendDstAlpha,this.blendEquationAlpha=et.blendEquationAlpha,this.depthFunc=et.depthFunc,this.depthTest=et.depthTest,this.depthWrite=et.depthWrite,this.stencilWriteMask=et.stencilWriteMask,this.stencilFunc=et.stencilFunc,this.stencilRef=et.stencilRef,this.stencilFuncMask=et.stencilFuncMask,this.stencilFail=et.stencilFail,this.stencilZFail=et.stencilZFail,this.stencilZPass=et.stencilZPass,this.stencilWrite=et.stencilWrite;const nt=et.clippingPlanes;let it=null;if(nt!==null){const rt=nt.length;it=new Array(rt);for(let ot=0;ot!==rt;++ot)it[ot]=nt[ot].clone()}return this.clippingPlanes=it,this.clipIntersection=et.clipIntersection,this.clipShadows=et.clipShadows,this.shadowSide=et.shadowSide,this.colorWrite=et.colorWrite,this.precision=et.precision,this.polygonOffset=et.polygonOffset,this.polygonOffsetFactor=et.polygonOffsetFactor,this.polygonOffsetUnits=et.polygonOffsetUnits,this.dithering=et.dithering,this.alphaTest=et.alphaTest,this.alphaToCoverage=et.alphaToCoverage,this.premultipliedAlpha=et.premultipliedAlpha,this.visible=et.visible,this.toneMapped=et.toneMapped,this.userData=JSON.parse(JSON.stringify(et.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(et){et===!0&&this.version++}}class MeshBasicMaterial extends Material{constructor(et){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color$1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}const _vector$9=new Vector3,_vector2$1=new Vector2;class BufferAttribute{constructor(et,nt,it){if(Array.isArray(et))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=et,this.itemSize=nt,this.count=et!==void 0?et.length/nt:0,this.normalized=it===!0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(et){et===!0&&this.version++}setUsage(et){return this.usage=et,this}copy(et){return this.name=et.name,this.array=new et.array.constructor(et.array),this.itemSize=et.itemSize,this.count=et.count,this.normalized=et.normalized,this.usage=et.usage,this}copyAt(et,nt,it){et*=this.itemSize,it*=nt.itemSize;for(let rt=0,ot=this.itemSize;rt0&&(et.userData=this.userData),this.parameters!==void 0){const lt=this.parameters;for(const ct in lt)lt[ct]!==void 0&&(et[ct]=lt[ct]);return et}et.data={attributes:{}};const nt=this.index;nt!==null&&(et.data.index={type:nt.array.constructor.name,array:Array.prototype.slice.call(nt.array)});const it=this.attributes;for(const lt in it){const ct=it[lt];et.data.attributes[lt]=ct.toJSON(et.data)}const rt={};let ot=!1;for(const lt in this.morphAttributes){const ct=this.morphAttributes[lt],ut=[];for(let ht=0,dt=ct.length;ht0&&(rt[lt]=ut,ot=!0)}ot&&(et.data.morphAttributes=rt,et.data.morphTargetsRelative=this.morphTargetsRelative);const at=this.groups;at.length>0&&(et.data.groups=JSON.parse(JSON.stringify(at)));const st=this.boundingSphere;return st!==null&&(et.data.boundingSphere={center:st.center.toArray(),radius:st.radius}),et}clone(){return new this.constructor().copy(this)}copy(et){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const nt={};this.name=et.name;const it=et.index;it!==null&&this.setIndex(it.clone(nt));const rt=et.attributes;for(const ct in rt){const ut=rt[ct];this.setAttribute(ct,ut.clone(nt))}const ot=et.morphAttributes;for(const ct in ot){const ut=[],ht=ot[ct];for(let dt=0,pt=ht.length;dt0){const rt=nt[it[0]];if(rt!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=rt.length;otnt.far?null:{distance:ct,point:_intersectionPointWorld.clone(),object:tt}}function checkBufferGeometryIntersection(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht){_vA$1.fromBufferAttribute(rt,ct),_vB$1.fromBufferAttribute(rt,ut),_vC$1.fromBufferAttribute(rt,ht);const dt=tt.morphTargetInfluences;if(ot&&dt){_morphA.set(0,0,0),_morphB.set(0,0,0),_morphC.set(0,0,0);for(let mt=0,gt=ot.length;mt0?1:-1,ut.push(Bt.x,Bt.y,Bt.z),ht.push(Pt/$t),ht.push(1-Mt/It),Ut+=1}}for(let Mt=0;Mt #include #include -}`,ShaderChunk={alphamap_fragment,alphamap_pars_fragment,alphatest_fragment,alphatest_pars_fragment,aomap_fragment,aomap_pars_fragment,begin_vertex,beginnormal_vertex,bsdfs,iridescence_fragment,bumpmap_pars_fragment,clipping_planes_fragment,clipping_planes_pars_fragment,clipping_planes_pars_vertex,clipping_planes_vertex,color_fragment,color_pars_fragment,color_pars_vertex,color_vertex,common:common$8,cube_uv_reflection_fragment,defaultnormal_vertex,displacementmap_pars_vertex,displacementmap_vertex,emissivemap_fragment,emissivemap_pars_fragment,encodings_fragment,encodings_pars_fragment,envmap_fragment,envmap_common_pars_fragment,envmap_pars_fragment,envmap_pars_vertex,envmap_physical_pars_fragment,envmap_vertex,fog_vertex,fog_pars_vertex,fog_fragment,fog_pars_fragment,gradientmap_pars_fragment,lightmap_fragment,lightmap_pars_fragment,lights_lambert_vertex,lights_pars_begin,lights_toon_fragment,lights_toon_pars_fragment,lights_phong_fragment,lights_phong_pars_fragment,lights_physical_fragment,lights_physical_pars_fragment,lights_fragment_begin,lights_fragment_maps,lights_fragment_end,logdepthbuf_fragment,logdepthbuf_pars_fragment,logdepthbuf_pars_vertex,logdepthbuf_vertex,map_fragment,map_pars_fragment,map_particle_fragment,map_particle_pars_fragment,metalnessmap_fragment,metalnessmap_pars_fragment,morphcolor_vertex,morphnormal_vertex,morphtarget_pars_vertex,morphtarget_vertex,normal_fragment_begin,normal_fragment_maps,normal_pars_fragment,normal_pars_vertex,normal_vertex,normalmap_pars_fragment,clearcoat_normal_fragment_begin,clearcoat_normal_fragment_maps,clearcoat_pars_fragment,iridescence_pars_fragment,output_fragment,packing,premultiplied_alpha_fragment,project_vertex,dithering_fragment,dithering_pars_fragment,roughnessmap_fragment,roughnessmap_pars_fragment,shadowmap_pars_fragment,shadowmap_pars_vertex,shadowmap_vertex,shadowmask_pars_fragment,skinbase_vertex,skinning_pars_vertex,skinning_vertex,skinnormal_vertex,specularmap_fragment,specularmap_pars_fragment,tonemapping_fragment,tonemapping_pars_fragment,transmission_fragment,transmission_pars_fragment,uv_pars_fragment,uv_pars_vertex,uv_vertex,uv2_pars_fragment,uv2_pars_vertex,uv2_vertex,worldpos_vertex,background_vert:vertex$g,background_frag:fragment$g,cube_vert:vertex$f,cube_frag:fragment$f,depth_vert:vertex$e,depth_frag:fragment$e,distanceRGBA_vert:vertex$d,distanceRGBA_frag:fragment$d,equirect_vert:vertex$c,equirect_frag:fragment$c,linedashed_vert:vertex$b,linedashed_frag:fragment$b,meshbasic_vert:vertex$a,meshbasic_frag:fragment$a,meshlambert_vert:vertex$9,meshlambert_frag:fragment$9,meshmatcap_vert:vertex$8,meshmatcap_frag:fragment$8,meshnormal_vert:vertex$7,meshnormal_frag:fragment$7,meshphong_vert:vertex$6,meshphong_frag:fragment$6,meshphysical_vert:vertex$5,meshphysical_frag:fragment$5,meshtoon_vert:vertex$4,meshtoon_frag:fragment$4,points_vert:vertex$3,points_frag:fragment$3,shadow_vert:vertex$2,shadow_frag:fragment$2,sprite_vert:vertex$1,sprite_frag:fragment$1},UniformsLib={common:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Matrix3},uv2Transform:{value:new Matrix3},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color$1(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}}},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)},specular:{value:new Color$1(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},cube:{uniforms:mergeUniforms([UniformsLib.envmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color$1(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Color$1(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Color$1(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Color$1(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};function WebGLBackground(tt,et,nt,it,rt,ot){const at=new Color$1(0);let st=rt===!0?0:1,lt,ct,ut=null,ht=0,dt=null;function pt(gt,bt){let yt=!1,wt=bt.isScene===!0?bt.background:null;wt&&wt.isTexture&&(wt=et.get(wt));const vt=tt.xr,xt=vt.getSession&&vt.getSession();xt&&xt.environmentBlendMode==="additive"&&(wt=null),wt===null?mt(at,st):wt&&wt.isColor&&(mt(wt,1),yt=!0),(tt.autoClear||yt)&&tt.clear(tt.autoClearColor,tt.autoClearDepth,tt.autoClearStencil),wt&&(wt.isCubeTexture||wt.mapping===CubeUVReflectionMapping)?(ct===void 0&&(ct=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.cube.uniforms),vertexShader:ShaderLib.cube.vertexShader,fragmentShader:ShaderLib.cube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1})),ct.geometry.deleteAttribute("normal"),ct.geometry.deleteAttribute("uv"),ct.onBeforeRender=function(St,Et,It){this.matrixWorld.copyPosition(It.matrixWorld)},Object.defineProperty(ct.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),it.update(ct)),ct.material.uniforms.envMap.value=wt,ct.material.uniforms.flipEnvMap.value=wt.isCubeTexture&&wt.isRenderTargetTexture===!1?-1:1,(ut!==wt||ht!==wt.version||dt!==tt.toneMapping)&&(ct.material.needsUpdate=!0,ut=wt,ht=wt.version,dt=tt.toneMapping),ct.layers.enableAll(),gt.unshift(ct,ct.geometry,ct.material,0,0,null)):wt&&wt.isTexture&&(lt===void 0&&(lt=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1})),lt.geometry.deleteAttribute("normal"),Object.defineProperty(lt.material,"map",{get:function(){return this.uniforms.t2D.value}}),it.update(lt)),lt.material.uniforms.t2D.value=wt,wt.matrixAutoUpdate===!0&&wt.updateMatrix(),lt.material.uniforms.uvTransform.value.copy(wt.matrix),(ut!==wt||ht!==wt.version||dt!==tt.toneMapping)&&(lt.material.needsUpdate=!0,ut=wt,ht=wt.version,dt=tt.toneMapping),lt.layers.enableAll(),gt.unshift(lt,lt.geometry,lt.material,0,0,null))}function mt(gt,bt){nt.buffers.color.setClear(gt.r,gt.g,gt.b,bt,ot)}return{getClearColor:function(){return at},setClearColor:function(gt,bt=1){at.set(gt),st=bt,mt(at,st)},getClearAlpha:function(){return st},setClearAlpha:function(gt){st=gt,mt(at,st)},render:pt}}function WebGLBindingStates(tt,et,nt,it){const rt=tt.getParameter(34921),ot=it.isWebGL2?null:et.get("OES_vertex_array_object"),at=it.isWebGL2||ot!==null,st={},lt=bt(null);let ct=lt,ut=!1;function ht(kt,At,Rt,Wt,jt){let Ot=!1;if(at){const Ct=gt(Wt,Rt,At);ct!==Ct&&(ct=Ct,pt(ct.object)),Ot=yt(kt,Wt,Rt,jt),Ot&&wt(kt,Wt,Rt,jt)}else{const Ct=At.wireframe===!0;(ct.geometry!==Wt.id||ct.program!==Rt.id||ct.wireframe!==Ct)&&(ct.geometry=Wt.id,ct.program=Rt.id,ct.wireframe=Ct,Ot=!0)}jt!==null&&nt.update(jt,34963),(Ot||ut)&&(ut=!1,Tt(kt,At,Rt,Wt),jt!==null&&tt.bindBuffer(34963,nt.get(jt).buffer))}function dt(){return it.isWebGL2?tt.createVertexArray():ot.createVertexArrayOES()}function pt(kt){return it.isWebGL2?tt.bindVertexArray(kt):ot.bindVertexArrayOES(kt)}function mt(kt){return it.isWebGL2?tt.deleteVertexArray(kt):ot.deleteVertexArrayOES(kt)}function gt(kt,At,Rt){const Wt=Rt.wireframe===!0;let jt=st[kt.id];jt===void 0&&(jt={},st[kt.id]=jt);let Ot=jt[At.id];Ot===void 0&&(Ot={},jt[At.id]=Ot);let Ct=Ot[Wt];return Ct===void 0&&(Ct=bt(dt()),Ot[Wt]=Ct),Ct}function bt(kt){const At=[],Rt=[],Wt=[];for(let jt=0;jt=0){const Qt=jt[Mt];let rn=Ot[Mt];if(rn===void 0&&(Mt==="instanceMatrix"&&kt.instanceMatrix&&(rn=kt.instanceMatrix),Mt==="instanceColor"&&kt.instanceColor&&(rn=kt.instanceColor)),Qt===void 0||Qt.attribute!==rn||rn&&Qt.data!==rn.data)return!0;Ct++}return ct.attributesNum!==Ct||ct.index!==Wt}function wt(kt,At,Rt,Wt){const jt={},Ot=At.attributes;let Ct=0;const Dt=Rt.getAttributes();for(const Mt in Dt)if(Dt[Mt].location>=0){let Qt=Ot[Mt];Qt===void 0&&(Mt==="instanceMatrix"&&kt.instanceMatrix&&(Qt=kt.instanceMatrix),Mt==="instanceColor"&&kt.instanceColor&&(Qt=kt.instanceColor));const rn={};rn.attribute=Qt,Qt&&Qt.data&&(rn.data=Qt.data),jt[Mt]=rn,Ct++}ct.attributes=jt,ct.attributesNum=Ct,ct.index=Wt}function vt(){const kt=ct.newAttributes;for(let At=0,Rt=kt.length;At=0){let Vt=jt[Dt];if(Vt===void 0&&(Dt==="instanceMatrix"&&kt.instanceMatrix&&(Vt=kt.instanceMatrix),Dt==="instanceColor"&&kt.instanceColor&&(Vt=kt.instanceColor)),Vt!==void 0){const Qt=Vt.normalized,rn=Vt.itemSize,Xt=nt.get(Vt);if(Xt===void 0)continue;const an=Xt.buffer,tn=Xt.type,pn=Xt.bytesPerElement;if(Vt.isInterleavedBufferAttribute){const vn=Vt.data,sn=vn.stride,Zt=Vt.offset;if(vn.isInstancedInterleavedBuffer){for(let Sn=0;Sn0&&tt.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";It="mediump"}return It==="mediump"&&tt.getShaderPrecisionFormat(35633,36337).precision>0&&tt.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const at=typeof WebGL2RenderingContext<"u"&&tt instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&tt instanceof WebGL2ComputeRenderingContext;let st=nt.precision!==void 0?nt.precision:"highp";const lt=ot(st);lt!==st&&(console.warn("THREE.WebGLRenderer:",st,"not supported, using",lt,"instead."),st=lt);const ct=at||et.has("WEBGL_draw_buffers"),ut=nt.logarithmicDepthBuffer===!0,ht=tt.getParameter(34930),dt=tt.getParameter(35660),pt=tt.getParameter(3379),mt=tt.getParameter(34076),gt=tt.getParameter(34921),bt=tt.getParameter(36347),yt=tt.getParameter(36348),wt=tt.getParameter(36349),vt=dt>0,xt=at||et.has("OES_texture_float"),St=vt&&xt,Et=at?tt.getParameter(36183):0;return{isWebGL2:at,drawBuffers:ct,getMaxAnisotropy:rt,getMaxPrecision:ot,precision:st,logarithmicDepthBuffer:ut,maxTextures:ht,maxVertexTextures:dt,maxTextureSize:pt,maxCubemapSize:mt,maxAttributes:gt,maxVertexUniforms:bt,maxVaryings:yt,maxFragmentUniforms:wt,vertexTextures:vt,floatFragmentTextures:xt,floatVertexTextures:St,maxSamples:Et}}function WebGLClipping(tt){const et=this;let nt=null,it=0,rt=!1,ot=!1;const at=new Plane,st=new Matrix3,lt={value:null,needsUpdate:!1};this.uniform=lt,this.numPlanes=0,this.numIntersection=0,this.init=function(ht,dt,pt){const mt=ht.length!==0||dt||it!==0||rt;return rt=dt,nt=ut(ht,pt,0),it=ht.length,mt},this.beginShadows=function(){ot=!0,ut(null)},this.endShadows=function(){ot=!1,ct()},this.setState=function(ht,dt,pt){const mt=ht.clippingPlanes,gt=ht.clipIntersection,bt=ht.clipShadows,yt=tt.get(ht);if(!rt||mt===null||mt.length===0||ot&&!bt)ot?ut(null):ct();else{const wt=ot?0:it,vt=wt*4;let xt=yt.clippingState||null;lt.value=xt,xt=ut(mt,dt,vt,pt);for(let St=0;St!==vt;++St)xt[St]=nt[St];yt.clippingState=xt,this.numIntersection=gt?this.numPlanes:0,this.numPlanes+=wt}};function ct(){lt.value!==nt&&(lt.value=nt,lt.needsUpdate=it>0),et.numPlanes=it,et.numIntersection=0}function ut(ht,dt,pt,mt){const gt=ht!==null?ht.length:0;let bt=null;if(gt!==0){if(bt=lt.value,mt!==!0||bt===null){const yt=pt+gt*4,wt=dt.matrixWorldInverse;st.getNormalMatrix(wt),(bt===null||bt.length0){const ct=new WebGLCubeRenderTarget(lt.height/2);return ct.fromEquirectangularTexture(tt,at),et.set(at,ct),at.addEventListener("dispose",rt),nt(ct.texture,at.mapping)}else return null}}return at}function rt(at){const st=at.target;st.removeEventListener("dispose",rt);const lt=et.get(st);lt!==void 0&&(et.delete(st),lt.dispose())}function ot(){et=new WeakMap}return{get:it,dispose:ot}}class OrthographicCamera extends Camera{constructor(et=-1,nt=1,it=1,rt=-1,ot=.1,at=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=et,this.right=nt,this.top=it,this.bottom=rt,this.near=ot,this.far=at,this.updateProjectionMatrix()}copy(et,nt){return super.copy(et,nt),this.left=et.left,this.right=et.right,this.top=et.top,this.bottom=et.bottom,this.near=et.near,this.far=et.far,this.zoom=et.zoom,this.view=et.view===null?null:Object.assign({},et.view),this}setViewOffset(et,nt,it,rt,ot,at){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=et,this.view.fullHeight=nt,this.view.offsetX=it,this.view.offsetY=rt,this.view.width=ot,this.view.height=at,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const et=(this.right-this.left)/(2*this.zoom),nt=(this.top-this.bottom)/(2*this.zoom),it=(this.right+this.left)/2,rt=(this.top+this.bottom)/2;let ot=it-et,at=it+et,st=rt+nt,lt=rt-nt;if(this.view!==null&&this.view.enabled){const ct=(this.right-this.left)/this.view.fullWidth/this.zoom,ut=(this.top-this.bottom)/this.view.fullHeight/this.zoom;ot+=ct*this.view.offsetX,at=ot+ct*this.view.width,st-=ut*this.view.offsetY,lt=st-ut*this.view.height}this.projectionMatrix.makeOrthographic(ot,at,st,lt,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(et){const nt=super.toJSON(et);return nt.object.zoom=this.zoom,nt.object.left=this.left,nt.object.right=this.right,nt.object.top=this.top,nt.object.bottom=this.bottom,nt.object.near=this.near,nt.object.far=this.far,this.view!==null&&(nt.object.view=Object.assign({},this.view)),nt}}const LOD_MIN=4,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],MAX_SAMPLES=20,_flatCamera=new OrthographicCamera,_clearColor=new Color$1;let _oldTarget=null;const PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,PHI,INV_PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(INV_PHI,0,PHI),new Vector3(-INV_PHI,0,PHI),new Vector3(PHI,INV_PHI,0),new Vector3(-PHI,INV_PHI,0)];class PMREMGenerator{constructor(et){this._renderer=et,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(et,nt=0,it=.1,rt=100){_oldTarget=this._renderer.getRenderTarget(),this._setSize(256);const ot=this._allocateTargets();return ot.depthBuffer=!0,this._sceneToCubeUV(et,it,rt,ot),nt>0&&this._blur(ot,0,0,nt),this._applyPMREM(ot),this._cleanup(ot),ot}fromEquirectangular(et,nt=null){return this._fromTexture(et,nt)}fromCubemap(et,nt=null){return this._fromTexture(et,nt)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(et){this._lodMax=Math.floor(Math.log2(et)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let et=0;et2?vt:0,vt,vt),ut.setRenderTarget(rt),gt&&ut.render(mt,st),ut.render(et,st)}mt.geometry.dispose(),mt.material.dispose(),ut.toneMapping=dt,ut.autoClear=ht,et.background=bt}_textureToCubeUV(et,nt){const it=this._renderer,rt=et.mapping===CubeReflectionMapping||et.mapping===CubeRefractionMapping;rt?(this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=et.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial());const ot=rt?this._cubemapMaterial:this._equirectMaterial,at=new Mesh(this._lodPlanes[0],ot),st=ot.uniforms;st.envMap.value=et;const lt=this._cubeSize;_setViewport(nt,0,0,3*lt,2*lt),it.setRenderTarget(nt),it.render(at,_flatCamera)}_applyPMREM(et){const nt=this._renderer,it=nt.autoClear;nt.autoClear=!1;for(let rt=1;rtMAX_SAMPLES&&console.warn(`sigmaRadians, ${ot}, is too large and will clip, as it requested ${bt} samples when the maximum is set to ${MAX_SAMPLES}`);const yt=[];let wt=0;for(let It=0;Itvt-LOD_MIN?rt-vt+LOD_MIN:0),Et=4*(this._cubeSize-xt);_setViewport(nt,St,Et,3*xt,2*xt),lt.setRenderTarget(nt),lt.render(ht,_flatCamera)}}function _createPlanes(tt){const et=[],nt=[],it=[];let rt=tt;const ot=tt-LOD_MIN+1+EXTRA_LOD_SIGMA.length;for(let at=0;attt-LOD_MIN?lt=EXTRA_LOD_SIGMA[at-tt+LOD_MIN-1]:at===0&&(lt=0),it.push(lt);const ct=1/(st-2),ut=-ct,ht=1+ct,dt=[ut,ut,ht,ut,ht,ht,ut,ut,ht,ht,ut,ht],pt=6,mt=6,gt=3,bt=2,yt=1,wt=new Float32Array(gt*mt*pt),vt=new Float32Array(bt*mt*pt),xt=new Float32Array(yt*mt*pt);for(let Et=0;Et2?0:-1,$t=[It,Tt,0,It+2/3,Tt,0,It+2/3,Tt+1,0,It,Tt,0,It+2/3,Tt+1,0,It,Tt+1,0];wt.set($t,gt*mt*Et),vt.set(dt,bt*mt*Et);const Ut=[Et,Et,Et,Et,Et,Et];xt.set(Ut,yt*mt*Et)}const St=new BufferGeometry;St.setAttribute("position",new BufferAttribute(wt,gt)),St.setAttribute("uv",new BufferAttribute(vt,bt)),St.setAttribute("faceIndex",new BufferAttribute(xt,yt)),et.push(St),rt>LOD_MIN&&rt--}return{lodPlanes:et,sizeLods:nt,sigmas:it}}function _createRenderTarget(tt,et,nt){const it=new WebGLRenderTarget(tt,et,nt);return it.texture.mapping=CubeUVReflectionMapping,it.texture.name="PMREM.cubeUv",it.scissorTest=!0,it}function _setViewport(tt,et,nt,it,rt){tt.viewport.set(et,nt,it,rt),tt.scissor.set(et,nt,it,rt)}function _getBlurShader(tt,et,nt){const it=new Float32Array(MAX_SAMPLES),rt=new Vector3(0,1,0);return new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:MAX_SAMPLES,CUBEUV_TEXEL_WIDTH:1/et,CUBEUV_TEXEL_HEIGHT:1/nt,CUBEUV_MAX_MIP:`${tt}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:it},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:rt}},vertexShader:_getCommonVertexShader(),fragmentShader:` +}`,ShaderChunk={alphamap_fragment,alphamap_pars_fragment,alphatest_fragment,alphatest_pars_fragment,aomap_fragment,aomap_pars_fragment,begin_vertex,beginnormal_vertex,bsdfs,iridescence_fragment,bumpmap_pars_fragment,clipping_planes_fragment,clipping_planes_pars_fragment,clipping_planes_pars_vertex,clipping_planes_vertex,color_fragment,color_pars_fragment,color_pars_vertex,color_vertex,common:common$8,cube_uv_reflection_fragment,defaultnormal_vertex,displacementmap_pars_vertex,displacementmap_vertex,emissivemap_fragment,emissivemap_pars_fragment,encodings_fragment,encodings_pars_fragment,envmap_fragment,envmap_common_pars_fragment,envmap_pars_fragment,envmap_pars_vertex,envmap_physical_pars_fragment,envmap_vertex,fog_vertex,fog_pars_vertex,fog_fragment,fog_pars_fragment,gradientmap_pars_fragment,lightmap_fragment,lightmap_pars_fragment,lights_lambert_vertex,lights_pars_begin,lights_toon_fragment,lights_toon_pars_fragment,lights_phong_fragment,lights_phong_pars_fragment,lights_physical_fragment,lights_physical_pars_fragment,lights_fragment_begin,lights_fragment_maps,lights_fragment_end,logdepthbuf_fragment,logdepthbuf_pars_fragment,logdepthbuf_pars_vertex,logdepthbuf_vertex,map_fragment,map_pars_fragment,map_particle_fragment,map_particle_pars_fragment,metalnessmap_fragment,metalnessmap_pars_fragment,morphcolor_vertex,morphnormal_vertex,morphtarget_pars_vertex,morphtarget_vertex,normal_fragment_begin,normal_fragment_maps,normal_pars_fragment,normal_pars_vertex,normal_vertex,normalmap_pars_fragment,clearcoat_normal_fragment_begin,clearcoat_normal_fragment_maps,clearcoat_pars_fragment,iridescence_pars_fragment,output_fragment,packing,premultiplied_alpha_fragment,project_vertex,dithering_fragment,dithering_pars_fragment,roughnessmap_fragment,roughnessmap_pars_fragment,shadowmap_pars_fragment,shadowmap_pars_vertex,shadowmap_vertex,shadowmask_pars_fragment,skinbase_vertex,skinning_pars_vertex,skinning_vertex,skinnormal_vertex,specularmap_fragment,specularmap_pars_fragment,tonemapping_fragment,tonemapping_pars_fragment,transmission_fragment,transmission_pars_fragment,uv_pars_fragment,uv_pars_vertex,uv_vertex,uv2_pars_fragment,uv2_pars_vertex,uv2_vertex,worldpos_vertex,background_vert:vertex$g,background_frag:fragment$g,cube_vert:vertex$f,cube_frag:fragment$f,depth_vert:vertex$e,depth_frag:fragment$e,distanceRGBA_vert:vertex$d,distanceRGBA_frag:fragment$d,equirect_vert:vertex$c,equirect_frag:fragment$c,linedashed_vert:vertex$b,linedashed_frag:fragment$b,meshbasic_vert:vertex$a,meshbasic_frag:fragment$a,meshlambert_vert:vertex$9,meshlambert_frag:fragment$9,meshmatcap_vert:vertex$8,meshmatcap_frag:fragment$8,meshnormal_vert:vertex$7,meshnormal_frag:fragment$7,meshphong_vert:vertex$6,meshphong_frag:fragment$6,meshphysical_vert:vertex$5,meshphysical_frag:fragment$5,meshtoon_vert:vertex$4,meshtoon_frag:fragment$4,points_vert:vertex$3,points_frag:fragment$3,shadow_vert:vertex$2,shadow_frag:fragment$2,sprite_vert:vertex$1,sprite_frag:fragment$1},UniformsLib={common:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Matrix3},uv2Transform:{value:new Matrix3},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color$1(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color$1(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Matrix3}}},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)},specular:{value:new Color$1(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color$1(0)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},cube:{uniforms:mergeUniforms([UniformsLib.envmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color$1(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Color$1(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Color$1(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Color$1(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};function WebGLBackground(tt,et,nt,it,rt,ot){const at=new Color$1(0);let st=rt===!0?0:1,lt,ct,ut=null,ht=0,dt=null;function pt(gt,bt){let yt=!1,wt=bt.isScene===!0?bt.background:null;wt&&wt.isTexture&&(wt=et.get(wt));const vt=tt.xr,xt=vt.getSession&&vt.getSession();xt&&xt.environmentBlendMode==="additive"&&(wt=null),wt===null?mt(at,st):wt&&wt.isColor&&(mt(wt,1),yt=!0),(tt.autoClear||yt)&&tt.clear(tt.autoClearColor,tt.autoClearDepth,tt.autoClearStencil),wt&&(wt.isCubeTexture||wt.mapping===CubeUVReflectionMapping)?(ct===void 0&&(ct=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.cube.uniforms),vertexShader:ShaderLib.cube.vertexShader,fragmentShader:ShaderLib.cube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1})),ct.geometry.deleteAttribute("normal"),ct.geometry.deleteAttribute("uv"),ct.onBeforeRender=function(St,Et,$t){this.matrixWorld.copyPosition($t.matrixWorld)},Object.defineProperty(ct.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),it.update(ct)),ct.material.uniforms.envMap.value=wt,ct.material.uniforms.flipEnvMap.value=wt.isCubeTexture&&wt.isRenderTargetTexture===!1?-1:1,(ut!==wt||ht!==wt.version||dt!==tt.toneMapping)&&(ct.material.needsUpdate=!0,ut=wt,ht=wt.version,dt=tt.toneMapping),ct.layers.enableAll(),gt.unshift(ct,ct.geometry,ct.material,0,0,null)):wt&&wt.isTexture&&(lt===void 0&&(lt=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1})),lt.geometry.deleteAttribute("normal"),Object.defineProperty(lt.material,"map",{get:function(){return this.uniforms.t2D.value}}),it.update(lt)),lt.material.uniforms.t2D.value=wt,wt.matrixAutoUpdate===!0&&wt.updateMatrix(),lt.material.uniforms.uvTransform.value.copy(wt.matrix),(ut!==wt||ht!==wt.version||dt!==tt.toneMapping)&&(lt.material.needsUpdate=!0,ut=wt,ht=wt.version,dt=tt.toneMapping),lt.layers.enableAll(),gt.unshift(lt,lt.geometry,lt.material,0,0,null))}function mt(gt,bt){nt.buffers.color.setClear(gt.r,gt.g,gt.b,bt,ot)}return{getClearColor:function(){return at},setClearColor:function(gt,bt=1){at.set(gt),st=bt,mt(at,st)},getClearAlpha:function(){return st},setClearAlpha:function(gt){st=gt,mt(at,st)},render:pt}}function WebGLBindingStates(tt,et,nt,it){const rt=tt.getParameter(34921),ot=it.isWebGL2?null:et.get("OES_vertex_array_object"),at=it.isWebGL2||ot!==null,st={},lt=bt(null);let ct=lt,ut=!1;function ht(kt,Tt,Ct,Ut,Nt){let Bt=!1;if(at){const Mt=gt(Ut,Ct,Tt);ct!==Mt&&(ct=Mt,pt(ct.object)),Bt=yt(kt,Ut,Ct,Nt),Bt&&wt(kt,Ut,Ct,Nt)}else{const Mt=Tt.wireframe===!0;(ct.geometry!==Ut.id||ct.program!==Ct.id||ct.wireframe!==Mt)&&(ct.geometry=Ut.id,ct.program=Ct.id,ct.wireframe=Mt,Bt=!0)}Nt!==null&&nt.update(Nt,34963),(Bt||ut)&&(ut=!1,It(kt,Tt,Ct,Ut),Nt!==null&&tt.bindBuffer(34963,nt.get(Nt).buffer))}function dt(){return it.isWebGL2?tt.createVertexArray():ot.createVertexArrayOES()}function pt(kt){return it.isWebGL2?tt.bindVertexArray(kt):ot.bindVertexArrayOES(kt)}function mt(kt){return it.isWebGL2?tt.deleteVertexArray(kt):ot.deleteVertexArrayOES(kt)}function gt(kt,Tt,Ct){const Ut=Ct.wireframe===!0;let Nt=st[kt.id];Nt===void 0&&(Nt={},st[kt.id]=Nt);let Bt=Nt[Tt.id];Bt===void 0&&(Bt={},Nt[Tt.id]=Bt);let Mt=Bt[Ut];return Mt===void 0&&(Mt=bt(dt()),Bt[Ut]=Mt),Mt}function bt(kt){const Tt=[],Ct=[],Ut=[];for(let Nt=0;Nt=0){const nn=Nt[Pt];let cn=Bt[Pt];if(cn===void 0&&(Pt==="instanceMatrix"&&kt.instanceMatrix&&(cn=kt.instanceMatrix),Pt==="instanceColor"&&kt.instanceColor&&(cn=kt.instanceColor)),nn===void 0||nn.attribute!==cn||cn&&nn.data!==cn.data)return!0;Mt++}return ct.attributesNum!==Mt||ct.index!==Ut}function wt(kt,Tt,Ct,Ut){const Nt={},Bt=Tt.attributes;let Mt=0;const Dt=Ct.getAttributes();for(const Pt in Dt)if(Dt[Pt].location>=0){let nn=Bt[Pt];nn===void 0&&(Pt==="instanceMatrix"&&kt.instanceMatrix&&(nn=kt.instanceMatrix),Pt==="instanceColor"&&kt.instanceColor&&(nn=kt.instanceColor));const cn={};cn.attribute=nn,nn&&nn.data&&(cn.data=nn.data),Nt[Pt]=cn,Mt++}ct.attributes=Nt,ct.attributesNum=Mt,ct.index=Ut}function vt(){const kt=ct.newAttributes;for(let Tt=0,Ct=kt.length;Tt=0){let Vt=Nt[Dt];if(Vt===void 0&&(Dt==="instanceMatrix"&&kt.instanceMatrix&&(Vt=kt.instanceMatrix),Dt==="instanceColor"&&kt.instanceColor&&(Vt=kt.instanceColor)),Vt!==void 0){const nn=Vt.normalized,cn=Vt.itemSize,Xt=nt.get(Vt);if(Xt===void 0)continue;const un=Xt.buffer,en=Xt.type,fn=Xt.bytesPerElement;if(Vt.isInterleavedBufferAttribute){const xn=Vt.data,an=xn.stride,Zt=Vt.offset;if(xn.isInstancedInterleavedBuffer){for(let En=0;En0&&tt.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";$t="mediump"}return $t==="mediump"&&tt.getShaderPrecisionFormat(35633,36337).precision>0&&tt.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const at=typeof WebGL2RenderingContext<"u"&&tt instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&tt instanceof WebGL2ComputeRenderingContext;let st=nt.precision!==void 0?nt.precision:"highp";const lt=ot(st);lt!==st&&(console.warn("THREE.WebGLRenderer:",st,"not supported, using",lt,"instead."),st=lt);const ct=at||et.has("WEBGL_draw_buffers"),ut=nt.logarithmicDepthBuffer===!0,ht=tt.getParameter(34930),dt=tt.getParameter(35660),pt=tt.getParameter(3379),mt=tt.getParameter(34076),gt=tt.getParameter(34921),bt=tt.getParameter(36347),yt=tt.getParameter(36348),wt=tt.getParameter(36349),vt=dt>0,xt=at||et.has("OES_texture_float"),St=vt&&xt,Et=at?tt.getParameter(36183):0;return{isWebGL2:at,drawBuffers:ct,getMaxAnisotropy:rt,getMaxPrecision:ot,precision:st,logarithmicDepthBuffer:ut,maxTextures:ht,maxVertexTextures:dt,maxTextureSize:pt,maxCubemapSize:mt,maxAttributes:gt,maxVertexUniforms:bt,maxVaryings:yt,maxFragmentUniforms:wt,vertexTextures:vt,floatFragmentTextures:xt,floatVertexTextures:St,maxSamples:Et}}function WebGLClipping(tt){const et=this;let nt=null,it=0,rt=!1,ot=!1;const at=new Plane,st=new Matrix3,lt={value:null,needsUpdate:!1};this.uniform=lt,this.numPlanes=0,this.numIntersection=0,this.init=function(ht,dt,pt){const mt=ht.length!==0||dt||it!==0||rt;return rt=dt,nt=ut(ht,pt,0),it=ht.length,mt},this.beginShadows=function(){ot=!0,ut(null)},this.endShadows=function(){ot=!1,ct()},this.setState=function(ht,dt,pt){const mt=ht.clippingPlanes,gt=ht.clipIntersection,bt=ht.clipShadows,yt=tt.get(ht);if(!rt||mt===null||mt.length===0||ot&&!bt)ot?ut(null):ct();else{const wt=ot?0:it,vt=wt*4;let xt=yt.clippingState||null;lt.value=xt,xt=ut(mt,dt,vt,pt);for(let St=0;St!==vt;++St)xt[St]=nt[St];yt.clippingState=xt,this.numIntersection=gt?this.numPlanes:0,this.numPlanes+=wt}};function ct(){lt.value!==nt&&(lt.value=nt,lt.needsUpdate=it>0),et.numPlanes=it,et.numIntersection=0}function ut(ht,dt,pt,mt){const gt=ht!==null?ht.length:0;let bt=null;if(gt!==0){if(bt=lt.value,mt!==!0||bt===null){const yt=pt+gt*4,wt=dt.matrixWorldInverse;st.getNormalMatrix(wt),(bt===null||bt.length0){const ct=new WebGLCubeRenderTarget(lt.height/2);return ct.fromEquirectangularTexture(tt,at),et.set(at,ct),at.addEventListener("dispose",rt),nt(ct.texture,at.mapping)}else return null}}return at}function rt(at){const st=at.target;st.removeEventListener("dispose",rt);const lt=et.get(st);lt!==void 0&&(et.delete(st),lt.dispose())}function ot(){et=new WeakMap}return{get:it,dispose:ot}}class OrthographicCamera extends Camera{constructor(et=-1,nt=1,it=1,rt=-1,ot=.1,at=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=et,this.right=nt,this.top=it,this.bottom=rt,this.near=ot,this.far=at,this.updateProjectionMatrix()}copy(et,nt){return super.copy(et,nt),this.left=et.left,this.right=et.right,this.top=et.top,this.bottom=et.bottom,this.near=et.near,this.far=et.far,this.zoom=et.zoom,this.view=et.view===null?null:Object.assign({},et.view),this}setViewOffset(et,nt,it,rt,ot,at){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=et,this.view.fullHeight=nt,this.view.offsetX=it,this.view.offsetY=rt,this.view.width=ot,this.view.height=at,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const et=(this.right-this.left)/(2*this.zoom),nt=(this.top-this.bottom)/(2*this.zoom),it=(this.right+this.left)/2,rt=(this.top+this.bottom)/2;let ot=it-et,at=it+et,st=rt+nt,lt=rt-nt;if(this.view!==null&&this.view.enabled){const ct=(this.right-this.left)/this.view.fullWidth/this.zoom,ut=(this.top-this.bottom)/this.view.fullHeight/this.zoom;ot+=ct*this.view.offsetX,at=ot+ct*this.view.width,st-=ut*this.view.offsetY,lt=st-ut*this.view.height}this.projectionMatrix.makeOrthographic(ot,at,st,lt,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(et){const nt=super.toJSON(et);return nt.object.zoom=this.zoom,nt.object.left=this.left,nt.object.right=this.right,nt.object.top=this.top,nt.object.bottom=this.bottom,nt.object.near=this.near,nt.object.far=this.far,this.view!==null&&(nt.object.view=Object.assign({},this.view)),nt}}const LOD_MIN=4,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],MAX_SAMPLES=20,_flatCamera=new OrthographicCamera,_clearColor=new Color$1;let _oldTarget=null;const PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[new Vector3(1,1,1),new Vector3(-1,1,1),new Vector3(1,1,-1),new Vector3(-1,1,-1),new Vector3(0,PHI,INV_PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(INV_PHI,0,PHI),new Vector3(-INV_PHI,0,PHI),new Vector3(PHI,INV_PHI,0),new Vector3(-PHI,INV_PHI,0)];class PMREMGenerator{constructor(et){this._renderer=et,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(et,nt=0,it=.1,rt=100){_oldTarget=this._renderer.getRenderTarget(),this._setSize(256);const ot=this._allocateTargets();return ot.depthBuffer=!0,this._sceneToCubeUV(et,it,rt,ot),nt>0&&this._blur(ot,0,0,nt),this._applyPMREM(ot),this._cleanup(ot),ot}fromEquirectangular(et,nt=null){return this._fromTexture(et,nt)}fromCubemap(et,nt=null){return this._fromTexture(et,nt)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(et){this._lodMax=Math.floor(Math.log2(et)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let et=0;et2?vt:0,vt,vt),ut.setRenderTarget(rt),gt&&ut.render(mt,st),ut.render(et,st)}mt.geometry.dispose(),mt.material.dispose(),ut.toneMapping=dt,ut.autoClear=ht,et.background=bt}_textureToCubeUV(et,nt){const it=this._renderer,rt=et.mapping===CubeReflectionMapping||et.mapping===CubeRefractionMapping;rt?(this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=et.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial());const ot=rt?this._cubemapMaterial:this._equirectMaterial,at=new Mesh(this._lodPlanes[0],ot),st=ot.uniforms;st.envMap.value=et;const lt=this._cubeSize;_setViewport(nt,0,0,3*lt,2*lt),it.setRenderTarget(nt),it.render(at,_flatCamera)}_applyPMREM(et){const nt=this._renderer,it=nt.autoClear;nt.autoClear=!1;for(let rt=1;rtMAX_SAMPLES&&console.warn(`sigmaRadians, ${ot}, is too large and will clip, as it requested ${bt} samples when the maximum is set to ${MAX_SAMPLES}`);const yt=[];let wt=0;for(let $t=0;$tvt-LOD_MIN?rt-vt+LOD_MIN:0),Et=4*(this._cubeSize-xt);_setViewport(nt,St,Et,3*xt,2*xt),lt.setRenderTarget(nt),lt.render(ht,_flatCamera)}}function _createPlanes(tt){const et=[],nt=[],it=[];let rt=tt;const ot=tt-LOD_MIN+1+EXTRA_LOD_SIGMA.length;for(let at=0;attt-LOD_MIN?lt=EXTRA_LOD_SIGMA[at-tt+LOD_MIN-1]:at===0&&(lt=0),it.push(lt);const ct=1/(st-2),ut=-ct,ht=1+ct,dt=[ut,ut,ht,ut,ht,ht,ut,ut,ht,ht,ut,ht],pt=6,mt=6,gt=3,bt=2,yt=1,wt=new Float32Array(gt*mt*pt),vt=new Float32Array(bt*mt*pt),xt=new Float32Array(yt*mt*pt);for(let Et=0;Et2?0:-1,Ft=[$t,It,0,$t+2/3,It,0,$t+2/3,It+1,0,$t,It,0,$t+2/3,It+1,0,$t,It+1,0];wt.set(Ft,gt*mt*Et),vt.set(dt,bt*mt*Et);const Ht=[Et,Et,Et,Et,Et,Et];xt.set(Ht,yt*mt*Et)}const St=new BufferGeometry;St.setAttribute("position",new BufferAttribute(wt,gt)),St.setAttribute("uv",new BufferAttribute(vt,bt)),St.setAttribute("faceIndex",new BufferAttribute(xt,yt)),et.push(St),rt>LOD_MIN&&rt--}return{lodPlanes:et,sizeLods:nt,sigmas:it}}function _createRenderTarget(tt,et,nt){const it=new WebGLRenderTarget(tt,et,nt);return it.texture.mapping=CubeUVReflectionMapping,it.texture.name="PMREM.cubeUv",it.scissorTest=!0,it}function _setViewport(tt,et,nt,it,rt){tt.viewport.set(et,nt,it,rt),tt.scissor.set(et,nt,it,rt)}function _getBlurShader(tt,et,nt){const it=new Float32Array(MAX_SAMPLES),rt=new Vector3(0,1,0);return new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:MAX_SAMPLES,CUBEUV_TEXEL_WIDTH:1/et,CUBEUV_TEXEL_HEIGHT:1/nt,CUBEUV_MAX_MIP:`${tt}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:it},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:rt}},vertexShader:_getCommonVertexShader(),fragmentShader:` precision mediump float; precision mediump int; @@ -3263,7 +3263,7 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function WebGLCubeUVMaps(tt){let et=new WeakMap,nt=null;function it(st){if(st&&st.isTexture){const lt=st.mapping,ct=lt===EquirectangularReflectionMapping||lt===EquirectangularRefractionMapping,ut=lt===CubeReflectionMapping||lt===CubeRefractionMapping;if(ct||ut)if(st.isRenderTargetTexture&&st.needsPMREMUpdate===!0){st.needsPMREMUpdate=!1;let ht=et.get(st);return nt===null&&(nt=new PMREMGenerator(tt)),ht=ct?nt.fromEquirectangular(st,ht):nt.fromCubemap(st,ht),et.set(st,ht),ht.texture}else{if(et.has(st))return et.get(st).texture;{const ht=st.image;if(ct&&ht&&ht.height>0||ut&&ht&&rt(ht)){nt===null&&(nt=new PMREMGenerator(tt));const dt=ct?nt.fromEquirectangular(st):nt.fromCubemap(st);return et.set(st,dt),st.addEventListener("dispose",ot),dt.texture}else return null}}}return st}function rt(st){let lt=0;const ct=6;for(let ut=0;utet.maxTextureSize&&(Bt=Math.ceil(Lt/et.maxTextureSize),Lt=et.maxTextureSize);const Pt=new Float32Array(Lt*Bt*4*bt),kt=new DataArrayTexture(Pt,Lt,Bt,bt);kt.type=FloatType,kt.needsUpdate=!0;const At=Ut*4;for(let Wt=0;Wt0)return tt;const rt=et*nt;let ot=arrayCacheF32[rt];if(ot===void 0&&(ot=new Float32Array(rt),arrayCacheF32[rt]=ot),et!==0){it.toArray(ot,0);for(let at=1,st=0;at!==et;++at)st+=nt,tt[at].toArray(ot,st)}return ot}function arraysEqual(tt,et){if(tt.length!==et.length)return!1;for(let nt=0,it=tt.length;nt0||ut&&ht&&rt(ht)){nt===null&&(nt=new PMREMGenerator(tt));const dt=ct?nt.fromEquirectangular(st):nt.fromCubemap(st);return et.set(st,dt),st.addEventListener("dispose",ot),dt.texture}else return null}}}return st}function rt(st){let lt=0;const ct=6;for(let ut=0;utet.maxTextureSize&&(zt=Math.ceil(Ht/et.maxTextureSize),Ht=et.maxTextureSize);const Ot=new Float32Array(Ht*zt*4*gt),jt=new DataArrayTexture(Ot,Ht,zt,gt);jt.type=FloatType,jt.needsUpdate=!0;const kt=Ft*4;for(let Ct=0;Ct0)return tt;const rt=et*nt;let ot=arrayCacheF32[rt];if(ot===void 0&&(ot=new Float32Array(rt),arrayCacheF32[rt]=ot),et!==0){it.toArray(ot,0);for(let at=1,st=0;at!==et;++at)st+=nt,tt[at].toArray(ot,st)}return ot}function arraysEqual(tt,et){if(tt.length!==et.length)return!1;for(let nt=0,it=tt.length;nt":" "} ${st}: ${nt[at]}`)}return it.join(` `)}function getEncodingComponents(tt){switch(tt){case LinearEncoding:return["Linear","( value )"];case sRGBEncoding:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",tt),["Linear","( value )"]}}function getShaderErrors(tt,et,nt){const it=tt.getShaderParameter(et,35713),rt=tt.getShaderInfoLog(et).trim();if(it&&rt==="")return"";const ot=/ERROR: 0:(\d+)/.exec(rt);if(ot){const at=parseInt(ot[1]);return nt.toUpperCase()+` @@ -3289,11 +3289,11 @@ precision `+tt.precision+" int;";return tt.precision==="highp"?et+=` `)+` `+bt,yt=["#define varying in",nt.glslVersion===GLSL3?"":"layout(location = 0) out highp vec4 pc_fragColor;",nt.glslVersion===GLSL3?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+yt);const vt=wt+bt+at,xt=wt+yt+st,St=WebGLShader(rt,35633,vt),Et=WebGLShader(rt,35632,xt);if(rt.attachShader(gt,St),rt.attachShader(gt,Et),nt.index0AttributeName!==void 0?rt.bindAttribLocation(gt,0,nt.index0AttributeName):nt.morphTargets===!0&&rt.bindAttribLocation(gt,0,"position"),rt.linkProgram(gt),tt.debug.checkShaderErrors){const $t=rt.getProgramInfoLog(gt).trim(),Ut=rt.getShaderInfoLog(St).trim(),Lt=rt.getShaderInfoLog(Et).trim();let Bt=!0,Pt=!0;if(rt.getProgramParameter(gt,35714)===!1){Bt=!1;const kt=getShaderErrors(rt,St,"vertex"),At=getShaderErrors(rt,Et,"fragment");console.error("THREE.WebGLProgram: Shader Error "+rt.getError()+" - VALIDATE_STATUS "+rt.getProgramParameter(gt,35715)+` +`+yt);const vt=wt+bt+at,xt=wt+yt+st,St=WebGLShader(rt,35633,vt),Et=WebGLShader(rt,35632,xt);if(rt.attachShader(gt,St),rt.attachShader(gt,Et),nt.index0AttributeName!==void 0?rt.bindAttribLocation(gt,0,nt.index0AttributeName):nt.morphTargets===!0&&rt.bindAttribLocation(gt,0,"position"),rt.linkProgram(gt),tt.debug.checkShaderErrors){const Ft=rt.getProgramInfoLog(gt).trim(),Ht=rt.getShaderInfoLog(St).trim(),zt=rt.getShaderInfoLog(Et).trim();let Ot=!0,jt=!0;if(rt.getProgramParameter(gt,35714)===!1){Ot=!1;const kt=getShaderErrors(rt,St,"vertex"),Tt=getShaderErrors(rt,Et,"fragment");console.error("THREE.WebGLProgram: Shader Error "+rt.getError()+" - VALIDATE_STATUS "+rt.getProgramParameter(gt,35715)+` -Program Info Log: `+$t+` +Program Info Log: `+Ft+` `+kt+` -`+At)}else $t!==""?console.warn("THREE.WebGLProgram: Program Info Log:",$t):(Ut===""||Lt==="")&&(Pt=!1);Pt&&(this.diagnostics={runnable:Bt,programLog:$t,vertexShader:{log:Ut,prefix:bt},fragmentShader:{log:Lt,prefix:yt}})}rt.deleteShader(St),rt.deleteShader(Et);let It;this.getUniforms=function(){return It===void 0&&(It=new WebGLUniforms(rt,gt)),It};let Tt;return this.getAttributes=function(){return Tt===void 0&&(Tt=fetchAttributeLocations(rt,gt)),Tt},this.destroy=function(){it.releaseStatesOfProgram(this),rt.deleteProgram(gt),this.program=void 0},this.name=nt.shaderName,this.id=programIdCount++,this.cacheKey=et,this.usedTimes=1,this.program=gt,this.vertexShader=St,this.fragmentShader=Et,this}let _id=0;class WebGLShaderCache{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(et){const nt=et.vertexShader,it=et.fragmentShader,rt=this._getShaderStage(nt),ot=this._getShaderStage(it),at=this._getShaderCacheForMaterial(et);return at.has(rt)===!1&&(at.add(rt),rt.usedTimes++),at.has(ot)===!1&&(at.add(ot),ot.usedTimes++),this}remove(et){const nt=this.materialCache.get(et);for(const it of nt)it.usedTimes--,it.usedTimes===0&&this.shaderCache.delete(it.code);return this.materialCache.delete(et),this}getVertexShaderID(et){return this._getShaderStage(et.vertexShader).id}getFragmentShaderID(et){return this._getShaderStage(et.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(et){const nt=this.materialCache;return nt.has(et)===!1&&nt.set(et,new Set),nt.get(et)}_getShaderStage(et){const nt=this.shaderCache;if(nt.has(et)===!1){const it=new WebGLShaderStage(et);nt.set(et,it)}return nt.get(et)}}class WebGLShaderStage{constructor(et){this.id=_id++,this.code=et,this.usedTimes=0}}function WebGLPrograms(tt,et,nt,it,rt,ot,at){const st=new Layers,lt=new WebGLShaderCache,ct=[],ut=rt.isWebGL2,ht=rt.logarithmicDepthBuffer,dt=rt.vertexTextures;let pt=rt.precision;const mt={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function gt(Tt,$t,Ut,Lt,Bt){const Pt=Lt.fog,kt=Bt.geometry,At=Tt.isMeshStandardMaterial?Lt.environment:null,Rt=(Tt.isMeshStandardMaterial?nt:et).get(Tt.envMap||At),Wt=Rt&&Rt.mapping===CubeUVReflectionMapping?Rt.image.height:null,jt=mt[Tt.type];Tt.precision!==null&&(pt=rt.getMaxPrecision(Tt.precision),pt!==Tt.precision&&console.warn("THREE.WebGLProgram.getParameters:",Tt.precision,"not supported, using",pt,"instead."));const Ot=kt.morphAttributes.position||kt.morphAttributes.normal||kt.morphAttributes.color,Ct=Ot!==void 0?Ot.length:0;let Dt=0;kt.morphAttributes.position!==void 0&&(Dt=1),kt.morphAttributes.normal!==void 0&&(Dt=2),kt.morphAttributes.color!==void 0&&(Dt=3);let Mt,Vt,Qt,rn;if(jt){const sn=ShaderLib[jt];Mt=sn.vertexShader,Vt=sn.fragmentShader}else Mt=Tt.vertexShader,Vt=Tt.fragmentShader,lt.update(Tt),Qt=lt.getVertexShaderID(Tt),rn=lt.getFragmentShaderID(Tt);const Xt=tt.getRenderTarget(),an=Tt.alphaTest>0,tn=Tt.clearcoat>0,pn=Tt.iridescence>0;return{isWebGL2:ut,shaderID:jt,shaderName:Tt.type,vertexShader:Mt,fragmentShader:Vt,defines:Tt.defines,customVertexShaderID:Qt,customFragmentShaderID:rn,isRawShaderMaterial:Tt.isRawShaderMaterial===!0,glslVersion:Tt.glslVersion,precision:pt,instancing:Bt.isInstancedMesh===!0,instancingColor:Bt.isInstancedMesh===!0&&Bt.instanceColor!==null,supportsVertexTextures:dt,outputEncoding:Xt===null?tt.outputEncoding:Xt.isXRRenderTarget===!0?Xt.texture.encoding:LinearEncoding,map:!!Tt.map,matcap:!!Tt.matcap,envMap:!!Rt,envMapMode:Rt&&Rt.mapping,envMapCubeUVHeight:Wt,lightMap:!!Tt.lightMap,aoMap:!!Tt.aoMap,emissiveMap:!!Tt.emissiveMap,bumpMap:!!Tt.bumpMap,normalMap:!!Tt.normalMap,objectSpaceNormalMap:Tt.normalMapType===ObjectSpaceNormalMap,tangentSpaceNormalMap:Tt.normalMapType===TangentSpaceNormalMap,decodeVideoTexture:!!Tt.map&&Tt.map.isVideoTexture===!0&&Tt.map.encoding===sRGBEncoding,clearcoat:tn,clearcoatMap:tn&&!!Tt.clearcoatMap,clearcoatRoughnessMap:tn&&!!Tt.clearcoatRoughnessMap,clearcoatNormalMap:tn&&!!Tt.clearcoatNormalMap,iridescence:pn,iridescenceMap:pn&&!!Tt.iridescenceMap,iridescenceThicknessMap:pn&&!!Tt.iridescenceThicknessMap,displacementMap:!!Tt.displacementMap,roughnessMap:!!Tt.roughnessMap,metalnessMap:!!Tt.metalnessMap,specularMap:!!Tt.specularMap,specularIntensityMap:!!Tt.specularIntensityMap,specularColorMap:!!Tt.specularColorMap,opaque:Tt.transparent===!1&&Tt.blending===NormalBlending,alphaMap:!!Tt.alphaMap,alphaTest:an,gradientMap:!!Tt.gradientMap,sheen:Tt.sheen>0,sheenColorMap:!!Tt.sheenColorMap,sheenRoughnessMap:!!Tt.sheenRoughnessMap,transmission:Tt.transmission>0,transmissionMap:!!Tt.transmissionMap,thicknessMap:!!Tt.thicknessMap,combine:Tt.combine,vertexTangents:!!Tt.normalMap&&!!kt.attributes.tangent,vertexColors:Tt.vertexColors,vertexAlphas:Tt.vertexColors===!0&&!!kt.attributes.color&&kt.attributes.color.itemSize===4,vertexUvs:!!Tt.map||!!Tt.bumpMap||!!Tt.normalMap||!!Tt.specularMap||!!Tt.alphaMap||!!Tt.emissiveMap||!!Tt.roughnessMap||!!Tt.metalnessMap||!!Tt.clearcoatMap||!!Tt.clearcoatRoughnessMap||!!Tt.clearcoatNormalMap||!!Tt.iridescenceMap||!!Tt.iridescenceThicknessMap||!!Tt.displacementMap||!!Tt.transmissionMap||!!Tt.thicknessMap||!!Tt.specularIntensityMap||!!Tt.specularColorMap||!!Tt.sheenColorMap||!!Tt.sheenRoughnessMap,uvsVertexOnly:!(Tt.map||Tt.bumpMap||Tt.normalMap||Tt.specularMap||Tt.alphaMap||Tt.emissiveMap||Tt.roughnessMap||Tt.metalnessMap||Tt.clearcoatNormalMap||Tt.iridescenceMap||Tt.iridescenceThicknessMap||Tt.transmission>0||Tt.transmissionMap||Tt.thicknessMap||Tt.specularIntensityMap||Tt.specularColorMap||Tt.sheen>0||Tt.sheenColorMap||Tt.sheenRoughnessMap)&&!!Tt.displacementMap,fog:!!Pt,useFog:Tt.fog===!0,fogExp2:Pt&&Pt.isFogExp2,flatShading:!!Tt.flatShading,sizeAttenuation:Tt.sizeAttenuation,logarithmicDepthBuffer:ht,skinning:Bt.isSkinnedMesh===!0,morphTargets:kt.morphAttributes.position!==void 0,morphNormals:kt.morphAttributes.normal!==void 0,morphColors:kt.morphAttributes.color!==void 0,morphTargetsCount:Ct,morphTextureStride:Dt,numDirLights:$t.directional.length,numPointLights:$t.point.length,numSpotLights:$t.spot.length,numRectAreaLights:$t.rectArea.length,numHemiLights:$t.hemi.length,numDirLightShadows:$t.directionalShadowMap.length,numPointLightShadows:$t.pointShadowMap.length,numSpotLightShadows:$t.spotShadowMap.length,numClippingPlanes:at.numPlanes,numClipIntersection:at.numIntersection,dithering:Tt.dithering,shadowMapEnabled:tt.shadowMap.enabled&&Ut.length>0,shadowMapType:tt.shadowMap.type,toneMapping:Tt.toneMapped?tt.toneMapping:NoToneMapping,physicallyCorrectLights:tt.physicallyCorrectLights,premultipliedAlpha:Tt.premultipliedAlpha,doubleSided:Tt.side===DoubleSide,flipSided:Tt.side===BackSide,useDepthPacking:!!Tt.depthPacking,depthPacking:Tt.depthPacking||0,index0AttributeName:Tt.index0AttributeName,extensionDerivatives:Tt.extensions&&Tt.extensions.derivatives,extensionFragDepth:Tt.extensions&&Tt.extensions.fragDepth,extensionDrawBuffers:Tt.extensions&&Tt.extensions.drawBuffers,extensionShaderTextureLOD:Tt.extensions&&Tt.extensions.shaderTextureLOD,rendererExtensionFragDepth:ut||it.has("EXT_frag_depth"),rendererExtensionDrawBuffers:ut||it.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:ut||it.has("EXT_shader_texture_lod"),customProgramCacheKey:Tt.customProgramCacheKey()}}function bt(Tt){const $t=[];if(Tt.shaderID?$t.push(Tt.shaderID):($t.push(Tt.customVertexShaderID),$t.push(Tt.customFragmentShaderID)),Tt.defines!==void 0)for(const Ut in Tt.defines)$t.push(Ut),$t.push(Tt.defines[Ut]);return Tt.isRawShaderMaterial===!1&&(yt($t,Tt),wt($t,Tt),$t.push(tt.outputEncoding)),$t.push(Tt.customProgramCacheKey),$t.join()}function yt(Tt,$t){Tt.push($t.precision),Tt.push($t.outputEncoding),Tt.push($t.envMapMode),Tt.push($t.envMapCubeUVHeight),Tt.push($t.combine),Tt.push($t.vertexUvs),Tt.push($t.fogExp2),Tt.push($t.sizeAttenuation),Tt.push($t.morphTargetsCount),Tt.push($t.morphAttributeCount),Tt.push($t.numDirLights),Tt.push($t.numPointLights),Tt.push($t.numSpotLights),Tt.push($t.numHemiLights),Tt.push($t.numRectAreaLights),Tt.push($t.numDirLightShadows),Tt.push($t.numPointLightShadows),Tt.push($t.numSpotLightShadows),Tt.push($t.shadowMapType),Tt.push($t.toneMapping),Tt.push($t.numClippingPlanes),Tt.push($t.numClipIntersection),Tt.push($t.depthPacking)}function wt(Tt,$t){st.disableAll(),$t.isWebGL2&&st.enable(0),$t.supportsVertexTextures&&st.enable(1),$t.instancing&&st.enable(2),$t.instancingColor&&st.enable(3),$t.map&&st.enable(4),$t.matcap&&st.enable(5),$t.envMap&&st.enable(6),$t.lightMap&&st.enable(7),$t.aoMap&&st.enable(8),$t.emissiveMap&&st.enable(9),$t.bumpMap&&st.enable(10),$t.normalMap&&st.enable(11),$t.objectSpaceNormalMap&&st.enable(12),$t.tangentSpaceNormalMap&&st.enable(13),$t.clearcoat&&st.enable(14),$t.clearcoatMap&&st.enable(15),$t.clearcoatRoughnessMap&&st.enable(16),$t.clearcoatNormalMap&&st.enable(17),$t.iridescence&&st.enable(18),$t.iridescenceMap&&st.enable(19),$t.iridescenceThicknessMap&&st.enable(20),$t.displacementMap&&st.enable(21),$t.specularMap&&st.enable(22),$t.roughnessMap&&st.enable(23),$t.metalnessMap&&st.enable(24),$t.gradientMap&&st.enable(25),$t.alphaMap&&st.enable(26),$t.alphaTest&&st.enable(27),$t.vertexColors&&st.enable(28),$t.vertexAlphas&&st.enable(29),$t.vertexUvs&&st.enable(30),$t.vertexTangents&&st.enable(31),$t.uvsVertexOnly&&st.enable(32),$t.fog&&st.enable(33),Tt.push(st.mask),st.disableAll(),$t.useFog&&st.enable(0),$t.flatShading&&st.enable(1),$t.logarithmicDepthBuffer&&st.enable(2),$t.skinning&&st.enable(3),$t.morphTargets&&st.enable(4),$t.morphNormals&&st.enable(5),$t.morphColors&&st.enable(6),$t.premultipliedAlpha&&st.enable(7),$t.shadowMapEnabled&&st.enable(8),$t.physicallyCorrectLights&&st.enable(9),$t.doubleSided&&st.enable(10),$t.flipSided&&st.enable(11),$t.useDepthPacking&&st.enable(12),$t.dithering&&st.enable(13),$t.specularIntensityMap&&st.enable(14),$t.specularColorMap&&st.enable(15),$t.transmission&&st.enable(16),$t.transmissionMap&&st.enable(17),$t.thicknessMap&&st.enable(18),$t.sheen&&st.enable(19),$t.sheenColorMap&&st.enable(20),$t.sheenRoughnessMap&&st.enable(21),$t.decodeVideoTexture&&st.enable(22),$t.opaque&&st.enable(23),Tt.push(st.mask)}function vt(Tt){const $t=mt[Tt.type];let Ut;if($t){const Lt=ShaderLib[$t];Ut=UniformsUtils.clone(Lt.uniforms)}else Ut=Tt.uniforms;return Ut}function xt(Tt,$t){let Ut;for(let Lt=0,Bt=ct.length;Lt0?it.push(yt):pt.transparent===!0?rt.push(yt):nt.push(yt)}function lt(ht,dt,pt,mt,gt,bt){const yt=at(ht,dt,pt,mt,gt,bt);pt.transmission>0?it.unshift(yt):pt.transparent===!0?rt.unshift(yt):nt.unshift(yt)}function ct(ht,dt){nt.length>1&&nt.sort(ht||painterSortStable),it.length>1&&it.sort(dt||reversePainterSortStable),rt.length>1&&rt.sort(dt||reversePainterSortStable)}function ut(){for(let ht=et,dt=tt.length;ht=tt.get(it).length?(ot=new WebGLRenderList,tt.get(it).push(ot)):ot=tt.get(it)[rt],ot}function nt(){tt=new WeakMap}return{get:et,dispose:nt}}function UniformsCache(){const tt={};return{get:function(et){if(tt[et.id]!==void 0)return tt[et.id];let nt;switch(et.type){case"DirectionalLight":nt={direction:new Vector3,color:new Color$1};break;case"SpotLight":nt={position:new Vector3,direction:new Vector3,color:new Color$1,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":nt={position:new Vector3,color:new Color$1,distance:0,decay:0};break;case"HemisphereLight":nt={direction:new Vector3,skyColor:new Color$1,groundColor:new Color$1};break;case"RectAreaLight":nt={color:new Color$1,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3};break}return tt[et.id]=nt,nt}}}function ShadowUniformsCache(){const tt={};return{get:function(et){if(tt[et.id]!==void 0)return tt[et.id];let nt;switch(et.type){case"DirectionalLight":nt={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"SpotLight":nt={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":nt={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3};break}return tt[et.id]=nt,nt}}}let nextVersion=0;function shadowCastingLightsFirst(tt,et){return(et.castShadow?1:0)-(tt.castShadow?1:0)}function WebGLLights(tt,et){const nt=new UniformsCache,it=ShadowUniformsCache(),rt={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let ut=0;ut<9;ut++)rt.probe.push(new Vector3);const ot=new Vector3,at=new Matrix4,st=new Matrix4;function lt(ut,ht){let dt=0,pt=0,mt=0;for(let $t=0;$t<9;$t++)rt.probe[$t].set(0,0,0);let gt=0,bt=0,yt=0,wt=0,vt=0,xt=0,St=0,Et=0;ut.sort(shadowCastingLightsFirst);const It=ht!==!0?Math.PI:1;for(let $t=0,Ut=ut.length;$t0&&(et.isWebGL2||tt.has("OES_texture_float_linear")===!0?(rt.rectAreaLTC1=UniformsLib.LTC_FLOAT_1,rt.rectAreaLTC2=UniformsLib.LTC_FLOAT_2):tt.has("OES_texture_half_float_linear")===!0?(rt.rectAreaLTC1=UniformsLib.LTC_HALF_1,rt.rectAreaLTC2=UniformsLib.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),rt.ambient[0]=dt,rt.ambient[1]=pt,rt.ambient[2]=mt;const Tt=rt.hash;(Tt.directionalLength!==gt||Tt.pointLength!==bt||Tt.spotLength!==yt||Tt.rectAreaLength!==wt||Tt.hemiLength!==vt||Tt.numDirectionalShadows!==xt||Tt.numPointShadows!==St||Tt.numSpotShadows!==Et)&&(rt.directional.length=gt,rt.spot.length=yt,rt.rectArea.length=wt,rt.point.length=bt,rt.hemi.length=vt,rt.directionalShadow.length=xt,rt.directionalShadowMap.length=xt,rt.pointShadow.length=St,rt.pointShadowMap.length=St,rt.spotShadow.length=Et,rt.spotShadowMap.length=Et,rt.directionalShadowMatrix.length=xt,rt.pointShadowMatrix.length=St,rt.spotShadowMatrix.length=Et,Tt.directionalLength=gt,Tt.pointLength=bt,Tt.spotLength=yt,Tt.rectAreaLength=wt,Tt.hemiLength=vt,Tt.numDirectionalShadows=xt,Tt.numPointShadows=St,Tt.numSpotShadows=Et,rt.version=nextVersion++)}function ct(ut,ht){let dt=0,pt=0,mt=0,gt=0,bt=0;const yt=ht.matrixWorldInverse;for(let wt=0,vt=ut.length;wt=nt.get(ot).length?(st=new WebGLRenderState(tt,et),nt.get(ot).push(st)):st=nt.get(ot)[at],st}function rt(){nt=new WeakMap}return{get:it,dispose:rt}}class MeshDepthMaterial extends Material{constructor(et){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BasicDepthPacking,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(et)}copy(et){return super.copy(et),this.depthPacking=et.depthPacking,this.map=et.map,this.alphaMap=et.alphaMap,this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(et){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Vector3,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(et)}copy(et){return super.copy(et),this.referencePosition.copy(et.referencePosition),this.nearDistance=et.nearDistance,this.farDistance=et.farDistance,this.map=et.map,this.alphaMap=et.alphaMap,this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this}}const vertex=`void main() { +`+Tt)}else Ft!==""?console.warn("THREE.WebGLProgram: Program Info Log:",Ft):(Ht===""||zt==="")&&(jt=!1);jt&&(this.diagnostics={runnable:Ot,programLog:Ft,vertexShader:{log:Ht,prefix:bt},fragmentShader:{log:zt,prefix:yt}})}rt.deleteShader(St),rt.deleteShader(Et);let $t;this.getUniforms=function(){return $t===void 0&&($t=new WebGLUniforms(rt,gt)),$t};let It;return this.getAttributes=function(){return It===void 0&&(It=fetchAttributeLocations(rt,gt)),It},this.destroy=function(){it.releaseStatesOfProgram(this),rt.deleteProgram(gt),this.program=void 0},this.name=nt.shaderName,this.id=programIdCount++,this.cacheKey=et,this.usedTimes=1,this.program=gt,this.vertexShader=St,this.fragmentShader=Et,this}let _id=0;class WebGLShaderCache{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(et){const nt=et.vertexShader,it=et.fragmentShader,rt=this._getShaderStage(nt),ot=this._getShaderStage(it),at=this._getShaderCacheForMaterial(et);return at.has(rt)===!1&&(at.add(rt),rt.usedTimes++),at.has(ot)===!1&&(at.add(ot),ot.usedTimes++),this}remove(et){const nt=this.materialCache.get(et);for(const it of nt)it.usedTimes--,it.usedTimes===0&&this.shaderCache.delete(it.code);return this.materialCache.delete(et),this}getVertexShaderID(et){return this._getShaderStage(et.vertexShader).id}getFragmentShaderID(et){return this._getShaderStage(et.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(et){const nt=this.materialCache;return nt.has(et)===!1&&nt.set(et,new Set),nt.get(et)}_getShaderStage(et){const nt=this.shaderCache;if(nt.has(et)===!1){const it=new WebGLShaderStage(et);nt.set(et,it)}return nt.get(et)}}class WebGLShaderStage{constructor(et){this.id=_id++,this.code=et,this.usedTimes=0}}function WebGLPrograms(tt,et,nt,it,rt,ot,at){const st=new Layers,lt=new WebGLShaderCache,ct=[],ut=rt.isWebGL2,ht=rt.logarithmicDepthBuffer,dt=rt.vertexTextures;let pt=rt.precision;const mt={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function gt(It,Ft,Ht,zt,Ot){const jt=zt.fog,kt=Ot.geometry,Tt=It.isMeshStandardMaterial?zt.environment:null,Ct=(It.isMeshStandardMaterial?nt:et).get(It.envMap||Tt),Ut=Ct&&Ct.mapping===CubeUVReflectionMapping?Ct.image.height:null,Nt=mt[It.type];It.precision!==null&&(pt=rt.getMaxPrecision(It.precision),pt!==It.precision&&console.warn("THREE.WebGLProgram.getParameters:",It.precision,"not supported, using",pt,"instead."));const Bt=kt.morphAttributes.position||kt.morphAttributes.normal||kt.morphAttributes.color,Mt=Bt!==void 0?Bt.length:0;let Dt=0;kt.morphAttributes.position!==void 0&&(Dt=1),kt.morphAttributes.normal!==void 0&&(Dt=2),kt.morphAttributes.color!==void 0&&(Dt=3);let Pt,Vt,nn,cn;if(Nt){const an=ShaderLib[Nt];Pt=an.vertexShader,Vt=an.fragmentShader}else Pt=It.vertexShader,Vt=It.fragmentShader,lt.update(It),nn=lt.getVertexShaderID(It),cn=lt.getFragmentShaderID(It);const Xt=tt.getRenderTarget(),un=It.alphaTest>0,en=It.clearcoat>0,fn=It.iridescence>0;return{isWebGL2:ut,shaderID:Nt,shaderName:It.type,vertexShader:Pt,fragmentShader:Vt,defines:It.defines,customVertexShaderID:nn,customFragmentShaderID:cn,isRawShaderMaterial:It.isRawShaderMaterial===!0,glslVersion:It.glslVersion,precision:pt,instancing:Ot.isInstancedMesh===!0,instancingColor:Ot.isInstancedMesh===!0&&Ot.instanceColor!==null,supportsVertexTextures:dt,outputEncoding:Xt===null?tt.outputEncoding:Xt.isXRRenderTarget===!0?Xt.texture.encoding:LinearEncoding,map:!!It.map,matcap:!!It.matcap,envMap:!!Ct,envMapMode:Ct&&Ct.mapping,envMapCubeUVHeight:Ut,lightMap:!!It.lightMap,aoMap:!!It.aoMap,emissiveMap:!!It.emissiveMap,bumpMap:!!It.bumpMap,normalMap:!!It.normalMap,objectSpaceNormalMap:It.normalMapType===ObjectSpaceNormalMap,tangentSpaceNormalMap:It.normalMapType===TangentSpaceNormalMap,decodeVideoTexture:!!It.map&&It.map.isVideoTexture===!0&&It.map.encoding===sRGBEncoding,clearcoat:en,clearcoatMap:en&&!!It.clearcoatMap,clearcoatRoughnessMap:en&&!!It.clearcoatRoughnessMap,clearcoatNormalMap:en&&!!It.clearcoatNormalMap,iridescence:fn,iridescenceMap:fn&&!!It.iridescenceMap,iridescenceThicknessMap:fn&&!!It.iridescenceThicknessMap,displacementMap:!!It.displacementMap,roughnessMap:!!It.roughnessMap,metalnessMap:!!It.metalnessMap,specularMap:!!It.specularMap,specularIntensityMap:!!It.specularIntensityMap,specularColorMap:!!It.specularColorMap,opaque:It.transparent===!1&&It.blending===NormalBlending,alphaMap:!!It.alphaMap,alphaTest:un,gradientMap:!!It.gradientMap,sheen:It.sheen>0,sheenColorMap:!!It.sheenColorMap,sheenRoughnessMap:!!It.sheenRoughnessMap,transmission:It.transmission>0,transmissionMap:!!It.transmissionMap,thicknessMap:!!It.thicknessMap,combine:It.combine,vertexTangents:!!It.normalMap&&!!kt.attributes.tangent,vertexColors:It.vertexColors,vertexAlphas:It.vertexColors===!0&&!!kt.attributes.color&&kt.attributes.color.itemSize===4,vertexUvs:!!It.map||!!It.bumpMap||!!It.normalMap||!!It.specularMap||!!It.alphaMap||!!It.emissiveMap||!!It.roughnessMap||!!It.metalnessMap||!!It.clearcoatMap||!!It.clearcoatRoughnessMap||!!It.clearcoatNormalMap||!!It.iridescenceMap||!!It.iridescenceThicknessMap||!!It.displacementMap||!!It.transmissionMap||!!It.thicknessMap||!!It.specularIntensityMap||!!It.specularColorMap||!!It.sheenColorMap||!!It.sheenRoughnessMap,uvsVertexOnly:!(It.map||It.bumpMap||It.normalMap||It.specularMap||It.alphaMap||It.emissiveMap||It.roughnessMap||It.metalnessMap||It.clearcoatNormalMap||It.iridescenceMap||It.iridescenceThicknessMap||It.transmission>0||It.transmissionMap||It.thicknessMap||It.specularIntensityMap||It.specularColorMap||It.sheen>0||It.sheenColorMap||It.sheenRoughnessMap)&&!!It.displacementMap,fog:!!jt,useFog:It.fog===!0,fogExp2:jt&&jt.isFogExp2,flatShading:!!It.flatShading,sizeAttenuation:It.sizeAttenuation,logarithmicDepthBuffer:ht,skinning:Ot.isSkinnedMesh===!0,morphTargets:kt.morphAttributes.position!==void 0,morphNormals:kt.morphAttributes.normal!==void 0,morphColors:kt.morphAttributes.color!==void 0,morphTargetsCount:Mt,morphTextureStride:Dt,numDirLights:Ft.directional.length,numPointLights:Ft.point.length,numSpotLights:Ft.spot.length,numRectAreaLights:Ft.rectArea.length,numHemiLights:Ft.hemi.length,numDirLightShadows:Ft.directionalShadowMap.length,numPointLightShadows:Ft.pointShadowMap.length,numSpotLightShadows:Ft.spotShadowMap.length,numClippingPlanes:at.numPlanes,numClipIntersection:at.numIntersection,dithering:It.dithering,shadowMapEnabled:tt.shadowMap.enabled&&Ht.length>0,shadowMapType:tt.shadowMap.type,toneMapping:It.toneMapped?tt.toneMapping:NoToneMapping,physicallyCorrectLights:tt.physicallyCorrectLights,premultipliedAlpha:It.premultipliedAlpha,doubleSided:It.side===DoubleSide,flipSided:It.side===BackSide,useDepthPacking:!!It.depthPacking,depthPacking:It.depthPacking||0,index0AttributeName:It.index0AttributeName,extensionDerivatives:It.extensions&&It.extensions.derivatives,extensionFragDepth:It.extensions&&It.extensions.fragDepth,extensionDrawBuffers:It.extensions&&It.extensions.drawBuffers,extensionShaderTextureLOD:It.extensions&&It.extensions.shaderTextureLOD,rendererExtensionFragDepth:ut||it.has("EXT_frag_depth"),rendererExtensionDrawBuffers:ut||it.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:ut||it.has("EXT_shader_texture_lod"),customProgramCacheKey:It.customProgramCacheKey()}}function bt(It){const Ft=[];if(It.shaderID?Ft.push(It.shaderID):(Ft.push(It.customVertexShaderID),Ft.push(It.customFragmentShaderID)),It.defines!==void 0)for(const Ht in It.defines)Ft.push(Ht),Ft.push(It.defines[Ht]);return It.isRawShaderMaterial===!1&&(yt(Ft,It),wt(Ft,It),Ft.push(tt.outputEncoding)),Ft.push(It.customProgramCacheKey),Ft.join()}function yt(It,Ft){It.push(Ft.precision),It.push(Ft.outputEncoding),It.push(Ft.envMapMode),It.push(Ft.envMapCubeUVHeight),It.push(Ft.combine),It.push(Ft.vertexUvs),It.push(Ft.fogExp2),It.push(Ft.sizeAttenuation),It.push(Ft.morphTargetsCount),It.push(Ft.morphAttributeCount),It.push(Ft.numDirLights),It.push(Ft.numPointLights),It.push(Ft.numSpotLights),It.push(Ft.numHemiLights),It.push(Ft.numRectAreaLights),It.push(Ft.numDirLightShadows),It.push(Ft.numPointLightShadows),It.push(Ft.numSpotLightShadows),It.push(Ft.shadowMapType),It.push(Ft.toneMapping),It.push(Ft.numClippingPlanes),It.push(Ft.numClipIntersection),It.push(Ft.depthPacking)}function wt(It,Ft){st.disableAll(),Ft.isWebGL2&&st.enable(0),Ft.supportsVertexTextures&&st.enable(1),Ft.instancing&&st.enable(2),Ft.instancingColor&&st.enable(3),Ft.map&&st.enable(4),Ft.matcap&&st.enable(5),Ft.envMap&&st.enable(6),Ft.lightMap&&st.enable(7),Ft.aoMap&&st.enable(8),Ft.emissiveMap&&st.enable(9),Ft.bumpMap&&st.enable(10),Ft.normalMap&&st.enable(11),Ft.objectSpaceNormalMap&&st.enable(12),Ft.tangentSpaceNormalMap&&st.enable(13),Ft.clearcoat&&st.enable(14),Ft.clearcoatMap&&st.enable(15),Ft.clearcoatRoughnessMap&&st.enable(16),Ft.clearcoatNormalMap&&st.enable(17),Ft.iridescence&&st.enable(18),Ft.iridescenceMap&&st.enable(19),Ft.iridescenceThicknessMap&&st.enable(20),Ft.displacementMap&&st.enable(21),Ft.specularMap&&st.enable(22),Ft.roughnessMap&&st.enable(23),Ft.metalnessMap&&st.enable(24),Ft.gradientMap&&st.enable(25),Ft.alphaMap&&st.enable(26),Ft.alphaTest&&st.enable(27),Ft.vertexColors&&st.enable(28),Ft.vertexAlphas&&st.enable(29),Ft.vertexUvs&&st.enable(30),Ft.vertexTangents&&st.enable(31),Ft.uvsVertexOnly&&st.enable(32),Ft.fog&&st.enable(33),It.push(st.mask),st.disableAll(),Ft.useFog&&st.enable(0),Ft.flatShading&&st.enable(1),Ft.logarithmicDepthBuffer&&st.enable(2),Ft.skinning&&st.enable(3),Ft.morphTargets&&st.enable(4),Ft.morphNormals&&st.enable(5),Ft.morphColors&&st.enable(6),Ft.premultipliedAlpha&&st.enable(7),Ft.shadowMapEnabled&&st.enable(8),Ft.physicallyCorrectLights&&st.enable(9),Ft.doubleSided&&st.enable(10),Ft.flipSided&&st.enable(11),Ft.useDepthPacking&&st.enable(12),Ft.dithering&&st.enable(13),Ft.specularIntensityMap&&st.enable(14),Ft.specularColorMap&&st.enable(15),Ft.transmission&&st.enable(16),Ft.transmissionMap&&st.enable(17),Ft.thicknessMap&&st.enable(18),Ft.sheen&&st.enable(19),Ft.sheenColorMap&&st.enable(20),Ft.sheenRoughnessMap&&st.enable(21),Ft.decodeVideoTexture&&st.enable(22),Ft.opaque&&st.enable(23),It.push(st.mask)}function vt(It){const Ft=mt[It.type];let Ht;if(Ft){const zt=ShaderLib[Ft];Ht=UniformsUtils.clone(zt.uniforms)}else Ht=It.uniforms;return Ht}function xt(It,Ft){let Ht;for(let zt=0,Ot=ct.length;zt0?it.push(yt):pt.transparent===!0?rt.push(yt):nt.push(yt)}function lt(ht,dt,pt,mt,gt,bt){const yt=at(ht,dt,pt,mt,gt,bt);pt.transmission>0?it.unshift(yt):pt.transparent===!0?rt.unshift(yt):nt.unshift(yt)}function ct(ht,dt){nt.length>1&&nt.sort(ht||painterSortStable),it.length>1&&it.sort(dt||reversePainterSortStable),rt.length>1&&rt.sort(dt||reversePainterSortStable)}function ut(){for(let ht=et,dt=tt.length;ht=tt.get(it).length?(ot=new WebGLRenderList,tt.get(it).push(ot)):ot=tt.get(it)[rt],ot}function nt(){tt=new WeakMap}return{get:et,dispose:nt}}function UniformsCache(){const tt={};return{get:function(et){if(tt[et.id]!==void 0)return tt[et.id];let nt;switch(et.type){case"DirectionalLight":nt={direction:new Vector3,color:new Color$1};break;case"SpotLight":nt={position:new Vector3,direction:new Vector3,color:new Color$1,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":nt={position:new Vector3,color:new Color$1,distance:0,decay:0};break;case"HemisphereLight":nt={direction:new Vector3,skyColor:new Color$1,groundColor:new Color$1};break;case"RectAreaLight":nt={color:new Color$1,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3};break}return tt[et.id]=nt,nt}}}function ShadowUniformsCache(){const tt={};return{get:function(et){if(tt[et.id]!==void 0)return tt[et.id];let nt;switch(et.type){case"DirectionalLight":nt={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"SpotLight":nt={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":nt={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3};break}return tt[et.id]=nt,nt}}}let nextVersion=0;function shadowCastingLightsFirst(tt,et){return(et.castShadow?1:0)-(tt.castShadow?1:0)}function WebGLLights(tt,et){const nt=new UniformsCache,it=ShadowUniformsCache(),rt={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let ut=0;ut<9;ut++)rt.probe.push(new Vector3);const ot=new Vector3,at=new Matrix4,st=new Matrix4;function lt(ut,ht){let dt=0,pt=0,mt=0;for(let Ft=0;Ft<9;Ft++)rt.probe[Ft].set(0,0,0);let gt=0,bt=0,yt=0,wt=0,vt=0,xt=0,St=0,Et=0;ut.sort(shadowCastingLightsFirst);const $t=ht!==!0?Math.PI:1;for(let Ft=0,Ht=ut.length;Ft0&&(et.isWebGL2||tt.has("OES_texture_float_linear")===!0?(rt.rectAreaLTC1=UniformsLib.LTC_FLOAT_1,rt.rectAreaLTC2=UniformsLib.LTC_FLOAT_2):tt.has("OES_texture_half_float_linear")===!0?(rt.rectAreaLTC1=UniformsLib.LTC_HALF_1,rt.rectAreaLTC2=UniformsLib.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),rt.ambient[0]=dt,rt.ambient[1]=pt,rt.ambient[2]=mt;const It=rt.hash;(It.directionalLength!==gt||It.pointLength!==bt||It.spotLength!==yt||It.rectAreaLength!==wt||It.hemiLength!==vt||It.numDirectionalShadows!==xt||It.numPointShadows!==St||It.numSpotShadows!==Et)&&(rt.directional.length=gt,rt.spot.length=yt,rt.rectArea.length=wt,rt.point.length=bt,rt.hemi.length=vt,rt.directionalShadow.length=xt,rt.directionalShadowMap.length=xt,rt.pointShadow.length=St,rt.pointShadowMap.length=St,rt.spotShadow.length=Et,rt.spotShadowMap.length=Et,rt.directionalShadowMatrix.length=xt,rt.pointShadowMatrix.length=St,rt.spotShadowMatrix.length=Et,It.directionalLength=gt,It.pointLength=bt,It.spotLength=yt,It.rectAreaLength=wt,It.hemiLength=vt,It.numDirectionalShadows=xt,It.numPointShadows=St,It.numSpotShadows=Et,rt.version=nextVersion++)}function ct(ut,ht){let dt=0,pt=0,mt=0,gt=0,bt=0;const yt=ht.matrixWorldInverse;for(let wt=0,vt=ut.length;wt=nt.get(ot).length?(st=new WebGLRenderState(tt,et),nt.get(ot).push(st)):st=nt.get(ot)[at],st}function rt(){nt=new WeakMap}return{get:it,dispose:rt}}class MeshDepthMaterial extends Material{constructor(et){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BasicDepthPacking,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(et)}copy(et){return super.copy(et),this.depthPacking=et.depthPacking,this.map=et.map,this.alphaMap=et.alphaMap,this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(et){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Vector3,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(et)}copy(et){return super.copy(et),this.referencePosition.copy(et.referencePosition),this.nearDistance=et.nearDistance,this.farDistance=et.farDistance,this.map=et.map,this.alphaMap=et.alphaMap,this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this}}const vertex=`void main() { gl_Position = vec4( position, 1.0 ); }`,fragment=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -3321,7 +3321,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function WebGLShadowMap(tt,et,nt){let it=new Frustum;const rt=new Vector2,ot=new Vector2,at=new Vector4,st=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),lt=new MeshDistanceMaterial,ct={},ut=nt.maxTextureSize,ht={0:BackSide,1:FrontSide,2:DoubleSide},dt=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:vertex,fragmentShader:fragment}),pt=dt.clone();pt.defines.HORIZONTAL_PASS=1;const mt=new BufferGeometry;mt.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const gt=new Mesh(mt,dt),bt=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap,this.render=function(xt,St,Et){if(bt.enabled===!1||bt.autoUpdate===!1&&bt.needsUpdate===!1||xt.length===0)return;const It=tt.getRenderTarget(),Tt=tt.getActiveCubeFace(),$t=tt.getActiveMipmapLevel(),Ut=tt.state;Ut.setBlending(NoBlending),Ut.buffers.color.setClear(1,1,1,1),Ut.buffers.depth.setTest(!0),Ut.setScissorTest(!1);for(let Lt=0,Bt=xt.length;Ltut||rt.y>ut)&&(rt.x>ut&&(ot.x=Math.floor(ut/At.x),rt.x=ot.x*At.x,kt.mapSize.x=ot.x),rt.y>ut&&(ot.y=Math.floor(ut/At.y),rt.y=ot.y*At.y,kt.mapSize.y=ot.y)),kt.map===null){const Wt=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};kt.map=new WebGLRenderTarget(rt.x,rt.y,Wt),kt.map.texture.name=Pt.name+".shadowMap",kt.camera.updateProjectionMatrix()}tt.setRenderTarget(kt.map),tt.clear();const Rt=kt.getViewportCount();for(let Wt=0;Wt0){const Bt=Ut.uuid,Pt=St.uuid;let kt=ct[Bt];kt===void 0&&(kt={},ct[Bt]=kt);let At=kt[Pt];At===void 0&&(At=Ut.clone(),kt[Pt]=At),Ut=At}return Ut.visible=St.visible,Ut.wireframe=St.wireframe,$t===VSMShadowMap?Ut.side=St.shadowSide!==null?St.shadowSide:St.side:Ut.side=St.shadowSide!==null?St.shadowSide:ht[St.side],Ut.alphaMap=St.alphaMap,Ut.alphaTest=St.alphaTest,Ut.clipShadows=St.clipShadows,Ut.clippingPlanes=St.clippingPlanes,Ut.clipIntersection=St.clipIntersection,Ut.displacementMap=St.displacementMap,Ut.displacementScale=St.displacementScale,Ut.displacementBias=St.displacementBias,Ut.wireframeLinewidth=St.wireframeLinewidth,Ut.linewidth=St.linewidth,Et.isPointLight===!0&&Ut.isMeshDistanceMaterial===!0&&(Ut.referencePosition.setFromMatrixPosition(Et.matrixWorld),Ut.nearDistance=It,Ut.farDistance=Tt),Ut}function vt(xt,St,Et,It,Tt){if(xt.visible===!1)return;if(xt.layers.test(St.layers)&&(xt.isMesh||xt.isLine||xt.isPoints)&&(xt.castShadow||xt.receiveShadow&&Tt===VSMShadowMap)&&(!xt.frustumCulled||it.intersectsObject(xt))){xt.modelViewMatrix.multiplyMatrices(Et.matrixWorldInverse,xt.matrixWorld);const Lt=et.update(xt),Bt=xt.material;if(Array.isArray(Bt)){const Pt=Lt.groups;for(let kt=0,At=Pt.length;kt=1):jt.indexOf("OpenGL ES")!==-1&&(Wt=parseFloat(/^OpenGL ES (\d)/.exec(jt)[1]),Rt=Wt>=2);let Ot=null,Ct={};const Dt=tt.getParameter(3088),Mt=tt.getParameter(2978),Vt=new Vector4().fromArray(Dt),Qt=new Vector4().fromArray(Mt);function rn(Fn,Jn,Hn){const dr=new Uint8Array(4),ur=tt.createTexture();tt.bindTexture(Fn,ur),tt.texParameteri(Fn,10241,9728),tt.texParameteri(Fn,10240,9728);for(let _r=0;_rhn||xn.height>hn)&&($n=hn/Math.max(xn.width,xn.height)),$n<1||dn===!0)if(typeof HTMLImageElement<"u"&&xn instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&xn instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&xn instanceof ImageBitmap){const nn=dn?floorPowerOfTwo:Math.floor,Kt=nn($n*xn.width),Yt=nn($n*xn.height);gt===void 0&&(gt=wt(Kt,Yt));const _n=cn?wt(Kt,Yt):gt;return _n.width=Kt,_n.height=Yt,_n.getContext("2d").drawImage(xn,0,0,Kt,Yt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+xn.width+"x"+xn.height+") to ("+Kt+"x"+Yt+")."),_n}else return"data"in xn&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+xn.width+"x"+xn.height+")."),xn;return xn}function xt(xn){return isPowerOfTwo(xn.width)&&isPowerOfTwo(xn.height)}function St(xn){return st?!1:xn.wrapS!==ClampToEdgeWrapping||xn.wrapT!==ClampToEdgeWrapping||xn.minFilter!==NearestFilter&&xn.minFilter!==LinearFilter}function Et(xn,dn){return xn.generateMipmaps&&dn&&xn.minFilter!==NearestFilter&&xn.minFilter!==LinearFilter}function It(xn){tt.generateMipmap(xn)}function Tt(xn,dn,cn,hn,$n=!1){if(st===!1)return dn;if(xn!==null){if(tt[xn]!==void 0)return tt[xn];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+xn+"'")}let nn=dn;return dn===6403&&(cn===5126&&(nn=33326),cn===5131&&(nn=33325),cn===5121&&(nn=33321)),dn===33319&&(cn===5126&&(nn=33328),cn===5131&&(nn=33327),cn===5121&&(nn=33323)),dn===6408&&(cn===5126&&(nn=34836),cn===5131&&(nn=34842),cn===5121&&(nn=hn===sRGBEncoding&&$n===!1?35907:32856),cn===32819&&(nn=32854),cn===32820&&(nn=32855)),(nn===33325||nn===33326||nn===33327||nn===33328||nn===34842||nn===34836)&&et.get("EXT_color_buffer_float"),nn}function $t(xn,dn,cn){return Et(xn,cn)===!0||xn.isFramebufferTexture&&xn.minFilter!==NearestFilter&&xn.minFilter!==LinearFilter?Math.log2(Math.max(dn.width,dn.height))+1:xn.mipmaps!==void 0&&xn.mipmaps.length>0?xn.mipmaps.length:xn.isCompressedTexture&&Array.isArray(xn.image)?dn.mipmaps.length:1}function Ut(xn){return xn===NearestFilter||xn===NearestMipmapNearestFilter||xn===NearestMipmapLinearFilter?9728:9729}function Lt(xn){const dn=xn.target;dn.removeEventListener("dispose",Lt),Pt(dn),dn.isVideoTexture&&mt.delete(dn)}function Bt(xn){const dn=xn.target;dn.removeEventListener("dispose",Bt),At(dn)}function Pt(xn){const dn=it.get(xn);if(dn.__webglInit===void 0)return;const cn=xn.source,hn=bt.get(cn);if(hn){const $n=hn[dn.__cacheKey];$n.usedTimes--,$n.usedTimes===0&&kt(xn),Object.keys(hn).length===0&&bt.delete(cn)}it.remove(xn)}function kt(xn){const dn=it.get(xn);tt.deleteTexture(dn.__webglTexture);const cn=xn.source,hn=bt.get(cn);delete hn[dn.__cacheKey],at.memory.textures--}function At(xn){const dn=xn.texture,cn=it.get(xn),hn=it.get(dn);if(hn.__webglTexture!==void 0&&(tt.deleteTexture(hn.__webglTexture),at.memory.textures--),xn.depthTexture&&xn.depthTexture.dispose(),xn.isWebGLCubeRenderTarget)for(let $n=0;$n<6;$n++)tt.deleteFramebuffer(cn.__webglFramebuffer[$n]),cn.__webglDepthbuffer&&tt.deleteRenderbuffer(cn.__webglDepthbuffer[$n]);else{if(tt.deleteFramebuffer(cn.__webglFramebuffer),cn.__webglDepthbuffer&&tt.deleteRenderbuffer(cn.__webglDepthbuffer),cn.__webglMultisampledFramebuffer&&tt.deleteFramebuffer(cn.__webglMultisampledFramebuffer),cn.__webglColorRenderbuffer)for(let $n=0;$n=lt&&console.warn("THREE.WebGLTextures: Trying to use "+xn+" texture units while this GPU supports only "+lt),Rt+=1,xn}function Ot(xn){const dn=[];return dn.push(xn.wrapS),dn.push(xn.wrapT),dn.push(xn.magFilter),dn.push(xn.minFilter),dn.push(xn.anisotropy),dn.push(xn.internalFormat),dn.push(xn.format),dn.push(xn.type),dn.push(xn.generateMipmaps),dn.push(xn.premultiplyAlpha),dn.push(xn.flipY),dn.push(xn.unpackAlignment),dn.push(xn.encoding),dn.join()}function Ct(xn,dn){const cn=it.get(xn);if(xn.isVideoTexture&&En(xn),xn.isRenderTargetTexture===!1&&xn.version>0&&cn.__version!==xn.version){const hn=xn.image;if(hn===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(hn.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{tn(cn,xn,dn);return}}nt.activeTexture(33984+dn),nt.bindTexture(3553,cn.__webglTexture)}function Dt(xn,dn){const cn=it.get(xn);if(xn.version>0&&cn.__version!==xn.version){tn(cn,xn,dn);return}nt.activeTexture(33984+dn),nt.bindTexture(35866,cn.__webglTexture)}function Mt(xn,dn){const cn=it.get(xn);if(xn.version>0&&cn.__version!==xn.version){tn(cn,xn,dn);return}nt.activeTexture(33984+dn),nt.bindTexture(32879,cn.__webglTexture)}function Vt(xn,dn){const cn=it.get(xn);if(xn.version>0&&cn.__version!==xn.version){pn(cn,xn,dn);return}nt.activeTexture(33984+dn),nt.bindTexture(34067,cn.__webglTexture)}const Qt={[RepeatWrapping]:10497,[ClampToEdgeWrapping]:33071,[MirroredRepeatWrapping]:33648},rn={[NearestFilter]:9728,[NearestMipmapNearestFilter]:9984,[NearestMipmapLinearFilter]:9986,[LinearFilter]:9729,[LinearMipmapNearestFilter]:9985,[LinearMipmapLinearFilter]:9987};function Xt(xn,dn,cn){if(cn?(tt.texParameteri(xn,10242,Qt[dn.wrapS]),tt.texParameteri(xn,10243,Qt[dn.wrapT]),(xn===32879||xn===35866)&&tt.texParameteri(xn,32882,Qt[dn.wrapR]),tt.texParameteri(xn,10240,rn[dn.magFilter]),tt.texParameteri(xn,10241,rn[dn.minFilter])):(tt.texParameteri(xn,10242,33071),tt.texParameteri(xn,10243,33071),(xn===32879||xn===35866)&&tt.texParameteri(xn,32882,33071),(dn.wrapS!==ClampToEdgeWrapping||dn.wrapT!==ClampToEdgeWrapping)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),tt.texParameteri(xn,10240,Ut(dn.magFilter)),tt.texParameteri(xn,10241,Ut(dn.minFilter)),dn.minFilter!==NearestFilter&&dn.minFilter!==LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),et.has("EXT_texture_filter_anisotropic")===!0){const hn=et.get("EXT_texture_filter_anisotropic");if(dn.type===FloatType&&et.has("OES_texture_float_linear")===!1||st===!1&&dn.type===HalfFloatType&&et.has("OES_texture_half_float_linear")===!1)return;(dn.anisotropy>1||it.get(dn).__currentAnisotropy)&&(tt.texParameterf(xn,hn.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(dn.anisotropy,rt.getMaxAnisotropy())),it.get(dn).__currentAnisotropy=dn.anisotropy)}}function an(xn,dn){let cn=!1;xn.__webglInit===void 0&&(xn.__webglInit=!0,dn.addEventListener("dispose",Lt));const hn=dn.source;let $n=bt.get(hn);$n===void 0&&($n={},bt.set(hn,$n));const nn=Ot(dn);if(nn!==xn.__cacheKey){$n[nn]===void 0&&($n[nn]={texture:tt.createTexture(),usedTimes:0},at.memory.textures++,cn=!0),$n[nn].usedTimes++;const Kt=$n[xn.__cacheKey];Kt!==void 0&&($n[xn.__cacheKey].usedTimes--,Kt.usedTimes===0&&kt(dn)),xn.__cacheKey=nn,xn.__webglTexture=$n[nn].texture}return cn}function tn(xn,dn,cn){let hn=3553;dn.isDataArrayTexture&&(hn=35866),dn.isData3DTexture&&(hn=32879);const $n=an(xn,dn),nn=dn.source;if(nt.activeTexture(33984+cn),nt.bindTexture(hn,xn.__webglTexture),nn.version!==nn.__currentVersion||$n===!0){tt.pixelStorei(37440,dn.flipY),tt.pixelStorei(37441,dn.premultiplyAlpha),tt.pixelStorei(3317,dn.unpackAlignment),tt.pixelStorei(37443,0);const Kt=St(dn)&&xt(dn.image)===!1;let Yt=vt(dn.image,Kt,!1,ut);Yt=In(dn,Yt);const _n=xt(Yt)||st,Mn=ot.convert(dn.format,dn.encoding);let Bn=ot.convert(dn.type),Nn=Tt(dn.internalFormat,Mn,Bn,dn.encoding,dn.isVideoTexture);Xt(hn,dn,_n);let qn;const Wn=dn.mipmaps,Vn=st&&dn.isVideoTexture!==!0,Fn=nn.__currentVersion===void 0||$n===!0,Jn=$t(dn,Yt,_n);if(dn.isDepthTexture)Nn=6402,st?dn.type===FloatType?Nn=36012:dn.type===UnsignedIntType?Nn=33190:dn.type===UnsignedInt248Type?Nn=35056:Nn=33189:dn.type===FloatType&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),dn.format===DepthFormat&&Nn===6402&&dn.type!==UnsignedShortType&&dn.type!==UnsignedIntType&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),dn.type=UnsignedIntType,Bn=ot.convert(dn.type)),dn.format===DepthStencilFormat&&Nn===6402&&(Nn=34041,dn.type!==UnsignedInt248Type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),dn.type=UnsignedInt248Type,Bn=ot.convert(dn.type))),Fn&&(Vn?nt.texStorage2D(3553,1,Nn,Yt.width,Yt.height):nt.texImage2D(3553,0,Nn,Yt.width,Yt.height,0,Mn,Bn,null));else if(dn.isDataTexture)if(Wn.length>0&&_n){Vn&&Fn&&nt.texStorage2D(3553,Jn,Nn,Wn[0].width,Wn[0].height);for(let Hn=0,dr=Wn.length;Hn>=1,dr>>=1}}else if(Wn.length>0&&_n){Vn&&Fn&&nt.texStorage2D(3553,Jn,Nn,Wn[0].width,Wn[0].height);for(let Hn=0,dr=Wn.length;Hn0&&Fn++,nt.texStorage2D(34067,Fn,qn,Yt[0].width,Yt[0].height));for(let Hn=0;Hn<6;Hn++)if(Kt){Wn?nt.texSubImage2D(34069+Hn,0,0,0,Yt[Hn].width,Yt[Hn].height,Bn,Nn,Yt[Hn].data):nt.texImage2D(34069+Hn,0,qn,Yt[Hn].width,Yt[Hn].height,0,Bn,Nn,Yt[Hn].data);for(let dr=0;dr0&&un(xn)===!1){const Yt=nn?dn:[dn];cn.__webglMultisampledFramebuffer=tt.createFramebuffer(),cn.__webglColorRenderbuffer=[],nt.bindFramebuffer(36160,cn.__webglMultisampledFramebuffer);for(let _n=0;_n0&&un(xn)===!1){const dn=xn.isWebGLMultipleRenderTargets?xn.texture:[xn.texture],cn=xn.width,hn=xn.height;let $n=16384;const nn=[],Kt=xn.stencilBuffer?33306:36096,Yt=it.get(xn),_n=xn.isWebGLMultipleRenderTargets===!0;if(_n)for(let Mn=0;Mn0&&et.has("WEBGL_multisampled_render_to_texture")===!0&&dn.__useRenderToTexture!==!1}function En(xn){const dn=at.render.frame;mt.get(xn)!==dn&&(mt.set(xn,dn),xn.update())}function In(xn,dn){const cn=xn.encoding,hn=xn.format,$n=xn.type;return xn.isCompressedTexture===!0||xn.isVideoTexture===!0||xn.format===_SRGBAFormat||cn!==LinearEncoding&&(cn===sRGBEncoding?st===!1?et.has("EXT_sRGB")===!0&&hn===RGBAFormat?(xn.format=_SRGBAFormat,xn.minFilter=LinearFilter,xn.generateMipmaps=!1):dn=ImageUtils.sRGBToLinear(dn):(hn!==RGBAFormat||$n!==UnsignedByteType)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",cn)),dn}this.allocateTextureUnit=jt,this.resetTextureUnits=Wt,this.setTexture2D=Ct,this.setTexture2DArray=Dt,this.setTexture3D=Mt,this.setTextureCube=Vt,this.rebindTextures=Tn,this.setupRenderTarget=Cn,this.updateRenderTargetMipmap=jn,this.updateMultisampleRenderTarget=Un,this.setupDepthRenderbuffer=Sn,this.setupFrameBufferTexture=vn,this.useMultisampledRTT=un}function WebGLUtils(tt,et,nt){const it=nt.isWebGL2;function rt(ot,at=null){let st;if(ot===UnsignedByteType)return 5121;if(ot===UnsignedShort4444Type)return 32819;if(ot===UnsignedShort5551Type)return 32820;if(ot===ByteType)return 5120;if(ot===ShortType)return 5122;if(ot===UnsignedShortType)return 5123;if(ot===IntType)return 5124;if(ot===UnsignedIntType)return 5125;if(ot===FloatType)return 5126;if(ot===HalfFloatType)return it?5131:(st=et.get("OES_texture_half_float"),st!==null?st.HALF_FLOAT_OES:null);if(ot===AlphaFormat)return 6406;if(ot===RGBAFormat)return 6408;if(ot===LuminanceFormat)return 6409;if(ot===LuminanceAlphaFormat)return 6410;if(ot===DepthFormat)return 6402;if(ot===DepthStencilFormat)return 34041;if(ot===RedFormat)return 6403;if(ot===RGBFormat)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(ot===_SRGBAFormat)return st=et.get("EXT_sRGB"),st!==null?st.SRGB_ALPHA_EXT:null;if(ot===RedIntegerFormat)return 36244;if(ot===RGFormat)return 33319;if(ot===RGIntegerFormat)return 33320;if(ot===RGBAIntegerFormat)return 36249;if(ot===RGB_S3TC_DXT1_Format||ot===RGBA_S3TC_DXT1_Format||ot===RGBA_S3TC_DXT3_Format||ot===RGBA_S3TC_DXT5_Format)if(at===sRGBEncoding)if(st=et.get("WEBGL_compressed_texture_s3tc_srgb"),st!==null){if(ot===RGB_S3TC_DXT1_Format)return st.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT1_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT3_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(ot===RGBA_S3TC_DXT5_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(st=et.get("WEBGL_compressed_texture_s3tc"),st!==null){if(ot===RGB_S3TC_DXT1_Format)return st.COMPRESSED_RGB_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT1_Format)return st.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT3_Format)return st.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(ot===RGBA_S3TC_DXT5_Format)return st.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(ot===RGB_PVRTC_4BPPV1_Format||ot===RGB_PVRTC_2BPPV1_Format||ot===RGBA_PVRTC_4BPPV1_Format||ot===RGBA_PVRTC_2BPPV1_Format)if(st=et.get("WEBGL_compressed_texture_pvrtc"),st!==null){if(ot===RGB_PVRTC_4BPPV1_Format)return st.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(ot===RGB_PVRTC_2BPPV1_Format)return st.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(ot===RGBA_PVRTC_4BPPV1_Format)return st.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(ot===RGBA_PVRTC_2BPPV1_Format)return st.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(ot===RGB_ETC1_Format)return st=et.get("WEBGL_compressed_texture_etc1"),st!==null?st.COMPRESSED_RGB_ETC1_WEBGL:null;if(ot===RGB_ETC2_Format||ot===RGBA_ETC2_EAC_Format)if(st=et.get("WEBGL_compressed_texture_etc"),st!==null){if(ot===RGB_ETC2_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ETC2:st.COMPRESSED_RGB8_ETC2;if(ot===RGBA_ETC2_EAC_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:st.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(ot===RGBA_ASTC_4x4_Format||ot===RGBA_ASTC_5x4_Format||ot===RGBA_ASTC_5x5_Format||ot===RGBA_ASTC_6x5_Format||ot===RGBA_ASTC_6x6_Format||ot===RGBA_ASTC_8x5_Format||ot===RGBA_ASTC_8x6_Format||ot===RGBA_ASTC_8x8_Format||ot===RGBA_ASTC_10x5_Format||ot===RGBA_ASTC_10x6_Format||ot===RGBA_ASTC_10x8_Format||ot===RGBA_ASTC_10x10_Format||ot===RGBA_ASTC_12x10_Format||ot===RGBA_ASTC_12x12_Format)if(st=et.get("WEBGL_compressed_texture_astc"),st!==null){if(ot===RGBA_ASTC_4x4_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:st.COMPRESSED_RGBA_ASTC_4x4_KHR;if(ot===RGBA_ASTC_5x4_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:st.COMPRESSED_RGBA_ASTC_5x4_KHR;if(ot===RGBA_ASTC_5x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:st.COMPRESSED_RGBA_ASTC_5x5_KHR;if(ot===RGBA_ASTC_6x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:st.COMPRESSED_RGBA_ASTC_6x5_KHR;if(ot===RGBA_ASTC_6x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:st.COMPRESSED_RGBA_ASTC_6x6_KHR;if(ot===RGBA_ASTC_8x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:st.COMPRESSED_RGBA_ASTC_8x5_KHR;if(ot===RGBA_ASTC_8x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:st.COMPRESSED_RGBA_ASTC_8x6_KHR;if(ot===RGBA_ASTC_8x8_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:st.COMPRESSED_RGBA_ASTC_8x8_KHR;if(ot===RGBA_ASTC_10x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:st.COMPRESSED_RGBA_ASTC_10x5_KHR;if(ot===RGBA_ASTC_10x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:st.COMPRESSED_RGBA_ASTC_10x6_KHR;if(ot===RGBA_ASTC_10x8_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:st.COMPRESSED_RGBA_ASTC_10x8_KHR;if(ot===RGBA_ASTC_10x10_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:st.COMPRESSED_RGBA_ASTC_10x10_KHR;if(ot===RGBA_ASTC_12x10_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:st.COMPRESSED_RGBA_ASTC_12x10_KHR;if(ot===RGBA_ASTC_12x12_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:st.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(ot===RGBA_BPTC_Format)if(st=et.get("EXT_texture_compression_bptc"),st!==null){if(ot===RGBA_BPTC_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:st.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return ot===UnsignedInt248Type?it?34042:(st=et.get("WEBGL_depth_texture"),st!==null?st.UNSIGNED_INT_24_8_WEBGL:null):tt[ot]!==void 0?tt[ot]:null}return{convert:rt}}class ArrayCamera extends PerspectiveCamera{constructor(et=[]){super(),this.isArrayCamera=!0,this.cameras=et}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const _moveEvent={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Group,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 Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(et){return this._targetRay!==null&&this._targetRay.dispatchEvent(et),this._grip!==null&&this._grip.dispatchEvent(et),this._hand!==null&&this._hand.dispatchEvent(et),this}disconnect(et){return this.dispatchEvent({type:"disconnected",data:et}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(et,nt,it){let rt=null,ot=null,at=null;const st=this._targetRay,lt=this._grip,ct=this._hand;if(et&&nt.session.visibilityState!=="visible-blurred"){if(ct&&et.hand){at=!0;for(const gt of et.hand.values()){const bt=nt.getJointPose(gt,it);if(ct.joints[gt.jointName]===void 0){const wt=new Group;wt.matrixAutoUpdate=!1,wt.visible=!1,ct.joints[gt.jointName]=wt,ct.add(wt)}const yt=ct.joints[gt.jointName];bt!==null&&(yt.matrix.fromArray(bt.transform.matrix),yt.matrix.decompose(yt.position,yt.rotation,yt.scale),yt.jointRadius=bt.radius),yt.visible=bt!==null}const ut=ct.joints["index-finger-tip"],ht=ct.joints["thumb-tip"],dt=ut.position.distanceTo(ht.position),pt=.02,mt=.005;ct.inputState.pinching&&dt>pt+mt?(ct.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:et.handedness,target:this})):!ct.inputState.pinching&&dt<=pt-mt&&(ct.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:et.handedness,target:this}))}else lt!==null&&et.gripSpace&&(ot=nt.getPose(et.gripSpace,it),ot!==null&&(lt.matrix.fromArray(ot.transform.matrix),lt.matrix.decompose(lt.position,lt.rotation,lt.scale),ot.linearVelocity?(lt.hasLinearVelocity=!0,lt.linearVelocity.copy(ot.linearVelocity)):lt.hasLinearVelocity=!1,ot.angularVelocity?(lt.hasAngularVelocity=!0,lt.angularVelocity.copy(ot.angularVelocity)):lt.hasAngularVelocity=!1));st!==null&&(rt=nt.getPose(et.targetRaySpace,it),rt===null&&ot!==null&&(rt=ot),rt!==null&&(st.matrix.fromArray(rt.transform.matrix),st.matrix.decompose(st.position,st.rotation,st.scale),rt.linearVelocity?(st.hasLinearVelocity=!0,st.linearVelocity.copy(rt.linearVelocity)):st.hasLinearVelocity=!1,rt.angularVelocity?(st.hasAngularVelocity=!0,st.angularVelocity.copy(rt.angularVelocity)):st.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent)))}return st!==null&&(st.visible=rt!==null),lt!==null&&(lt.visible=ot!==null),ct!==null&&(ct.visible=at!==null),this}}class DepthTexture extends Texture{constructor(et,nt,it,rt,ot,at,st,lt,ct,ut){if(ut=ut!==void 0?ut:DepthFormat,ut!==DepthFormat&&ut!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");it===void 0&&ut===DepthFormat&&(it=UnsignedIntType),it===void 0&&ut===DepthStencilFormat&&(it=UnsignedInt248Type),super(null,rt,ot,at,st,lt,ut,it,ct),this.isDepthTexture=!0,this.image={width:et,height:nt},this.magFilter=st!==void 0?st:NearestFilter,this.minFilter=lt!==void 0?lt:NearestFilter,this.flipY=!1,this.generateMipmaps=!1}}class WebXRManager extends EventDispatcher$1{constructor(et,nt){super();const it=this;let rt=null,ot=1,at=null,st="local-floor",lt=null,ct=null,ut=null,ht=null,dt=null,pt=null;const mt=nt.getContextAttributes();let gt=null,bt=null;const yt=[],wt=[],vt=new PerspectiveCamera;vt.layers.enable(1),vt.viewport=new Vector4;const xt=new PerspectiveCamera;xt.layers.enable(2),xt.viewport=new Vector4;const St=[vt,xt],Et=new ArrayCamera;Et.layers.enable(1),Et.layers.enable(2);let It=null,Tt=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Ot){let Ct=yt[Ot];return Ct===void 0&&(Ct=new WebXRController,yt[Ot]=Ct),Ct.getTargetRaySpace()},this.getControllerGrip=function(Ot){let Ct=yt[Ot];return Ct===void 0&&(Ct=new WebXRController,yt[Ot]=Ct),Ct.getGripSpace()},this.getHand=function(Ot){let Ct=yt[Ot];return Ct===void 0&&(Ct=new WebXRController,yt[Ot]=Ct),Ct.getHandSpace()};function $t(Ot){const Ct=wt.indexOf(Ot.inputSource);if(Ct===-1)return;const Dt=yt[Ct];Dt!==void 0&&Dt.dispatchEvent({type:Ot.type,data:Ot.inputSource})}function Ut(){rt.removeEventListener("select",$t),rt.removeEventListener("selectstart",$t),rt.removeEventListener("selectend",$t),rt.removeEventListener("squeeze",$t),rt.removeEventListener("squeezestart",$t),rt.removeEventListener("squeezeend",$t),rt.removeEventListener("end",Ut),rt.removeEventListener("inputsourceschange",Lt);for(let Ot=0;Ot=0&&(wt[Mt]=null,yt[Mt].dispatchEvent({type:"disconnected",data:Dt}))}for(let Ct=0;Ct=wt.length){wt.push(Dt),Mt=Qt;break}else if(wt[Qt]===null){wt[Qt]=Dt,Mt=Qt;break}if(Mt===-1)break}const Vt=yt[Mt];Vt&&Vt.dispatchEvent({type:"connected",data:Dt})}}const Bt=new Vector3,Pt=new Vector3;function kt(Ot,Ct,Dt){Bt.setFromMatrixPosition(Ct.matrixWorld),Pt.setFromMatrixPosition(Dt.matrixWorld);const Mt=Bt.distanceTo(Pt),Vt=Ct.projectionMatrix.elements,Qt=Dt.projectionMatrix.elements,rn=Vt[14]/(Vt[10]-1),Xt=Vt[14]/(Vt[10]+1),an=(Vt[9]+1)/Vt[5],tn=(Vt[9]-1)/Vt[5],pn=(Vt[8]-1)/Vt[0],vn=(Qt[8]+1)/Qt[0],sn=rn*pn,Zt=rn*vn,Sn=Mt/(-pn+vn),Tn=Sn*-pn;Ct.matrixWorld.decompose(Ot.position,Ot.quaternion,Ot.scale),Ot.translateX(Tn),Ot.translateZ(Sn),Ot.matrixWorld.compose(Ot.position,Ot.quaternion,Ot.scale),Ot.matrixWorldInverse.copy(Ot.matrixWorld).invert();const Cn=rn+Sn,jn=Xt+Sn,Un=sn-Tn,yn=Zt+(Mt-Tn),un=an*Xt/jn*Cn,En=tn*Xt/jn*Cn;Ot.projectionMatrix.makePerspective(Un,yn,un,En,Cn,jn)}function At(Ot,Ct){Ct===null?Ot.matrixWorld.copy(Ot.matrix):Ot.matrixWorld.multiplyMatrices(Ct.matrixWorld,Ot.matrix),Ot.matrixWorldInverse.copy(Ot.matrixWorld).invert()}this.updateCamera=function(Ot){if(rt===null)return;Et.near=xt.near=vt.near=Ot.near,Et.far=xt.far=vt.far=Ot.far,(It!==Et.near||Tt!==Et.far)&&(rt.updateRenderState({depthNear:Et.near,depthFar:Et.far}),It=Et.near,Tt=Et.far);const Ct=Ot.parent,Dt=Et.cameras;At(Et,Ct);for(let Vt=0;Vt0&&(gt.alphaTest.value=bt.alphaTest);const yt=et.get(bt).envMap;if(yt&&(gt.envMap.value=yt,gt.flipEnvMap.value=yt.isCubeTexture&&yt.isRenderTargetTexture===!1?-1:1,gt.reflectivity.value=bt.reflectivity,gt.ior.value=bt.ior,gt.refractionRatio.value=bt.refractionRatio),bt.lightMap){gt.lightMap.value=bt.lightMap;const xt=tt.physicallyCorrectLights!==!0?Math.PI:1;gt.lightMapIntensity.value=bt.lightMapIntensity*xt}bt.aoMap&&(gt.aoMap.value=bt.aoMap,gt.aoMapIntensity.value=bt.aoMapIntensity);let wt;bt.map?wt=bt.map:bt.specularMap?wt=bt.specularMap:bt.displacementMap?wt=bt.displacementMap:bt.normalMap?wt=bt.normalMap:bt.bumpMap?wt=bt.bumpMap:bt.roughnessMap?wt=bt.roughnessMap:bt.metalnessMap?wt=bt.metalnessMap:bt.alphaMap?wt=bt.alphaMap:bt.emissiveMap?wt=bt.emissiveMap:bt.clearcoatMap?wt=bt.clearcoatMap:bt.clearcoatNormalMap?wt=bt.clearcoatNormalMap:bt.clearcoatRoughnessMap?wt=bt.clearcoatRoughnessMap:bt.iridescenceMap?wt=bt.iridescenceMap:bt.iridescenceThicknessMap?wt=bt.iridescenceThicknessMap:bt.specularIntensityMap?wt=bt.specularIntensityMap:bt.specularColorMap?wt=bt.specularColorMap:bt.transmissionMap?wt=bt.transmissionMap:bt.thicknessMap?wt=bt.thicknessMap:bt.sheenColorMap?wt=bt.sheenColorMap:bt.sheenRoughnessMap&&(wt=bt.sheenRoughnessMap),wt!==void 0&&(wt.isWebGLRenderTarget&&(wt=wt.texture),wt.matrixAutoUpdate===!0&&wt.updateMatrix(),gt.uvTransform.value.copy(wt.matrix));let vt;bt.aoMap?vt=bt.aoMap:bt.lightMap&&(vt=bt.lightMap),vt!==void 0&&(vt.isWebGLRenderTarget&&(vt=vt.texture),vt.matrixAutoUpdate===!0&&vt.updateMatrix(),gt.uv2Transform.value.copy(vt.matrix))}function ot(gt,bt){gt.diffuse.value.copy(bt.color),gt.opacity.value=bt.opacity}function at(gt,bt){gt.dashSize.value=bt.dashSize,gt.totalSize.value=bt.dashSize+bt.gapSize,gt.scale.value=bt.scale}function st(gt,bt,yt,wt){gt.diffuse.value.copy(bt.color),gt.opacity.value=bt.opacity,gt.size.value=bt.size*yt,gt.scale.value=wt*.5,bt.map&&(gt.map.value=bt.map),bt.alphaMap&&(gt.alphaMap.value=bt.alphaMap),bt.alphaTest>0&&(gt.alphaTest.value=bt.alphaTest);let vt;bt.map?vt=bt.map:bt.alphaMap&&(vt=bt.alphaMap),vt!==void 0&&(vt.matrixAutoUpdate===!0&&vt.updateMatrix(),gt.uvTransform.value.copy(vt.matrix))}function lt(gt,bt){gt.diffuse.value.copy(bt.color),gt.opacity.value=bt.opacity,gt.rotation.value=bt.rotation,bt.map&&(gt.map.value=bt.map),bt.alphaMap&&(gt.alphaMap.value=bt.alphaMap),bt.alphaTest>0&&(gt.alphaTest.value=bt.alphaTest);let yt;bt.map?yt=bt.map:bt.alphaMap&&(yt=bt.alphaMap),yt!==void 0&&(yt.matrixAutoUpdate===!0&&yt.updateMatrix(),gt.uvTransform.value.copy(yt.matrix))}function ct(gt,bt){gt.specular.value.copy(bt.specular),gt.shininess.value=Math.max(bt.shininess,1e-4)}function ut(gt,bt){bt.gradientMap&&(gt.gradientMap.value=bt.gradientMap)}function ht(gt,bt){gt.roughness.value=bt.roughness,gt.metalness.value=bt.metalness,bt.roughnessMap&&(gt.roughnessMap.value=bt.roughnessMap),bt.metalnessMap&&(gt.metalnessMap.value=bt.metalnessMap),et.get(bt).envMap&&(gt.envMapIntensity.value=bt.envMapIntensity)}function dt(gt,bt,yt){gt.ior.value=bt.ior,bt.sheen>0&&(gt.sheenColor.value.copy(bt.sheenColor).multiplyScalar(bt.sheen),gt.sheenRoughness.value=bt.sheenRoughness,bt.sheenColorMap&&(gt.sheenColorMap.value=bt.sheenColorMap),bt.sheenRoughnessMap&&(gt.sheenRoughnessMap.value=bt.sheenRoughnessMap)),bt.clearcoat>0&&(gt.clearcoat.value=bt.clearcoat,gt.clearcoatRoughness.value=bt.clearcoatRoughness,bt.clearcoatMap&&(gt.clearcoatMap.value=bt.clearcoatMap),bt.clearcoatRoughnessMap&&(gt.clearcoatRoughnessMap.value=bt.clearcoatRoughnessMap),bt.clearcoatNormalMap&&(gt.clearcoatNormalScale.value.copy(bt.clearcoatNormalScale),gt.clearcoatNormalMap.value=bt.clearcoatNormalMap,bt.side===BackSide&>.clearcoatNormalScale.value.negate())),bt.iridescence>0&&(gt.iridescence.value=bt.iridescence,gt.iridescenceIOR.value=bt.iridescenceIOR,gt.iridescenceThicknessMinimum.value=bt.iridescenceThicknessRange[0],gt.iridescenceThicknessMaximum.value=bt.iridescenceThicknessRange[1],bt.iridescenceMap&&(gt.iridescenceMap.value=bt.iridescenceMap),bt.iridescenceThicknessMap&&(gt.iridescenceThicknessMap.value=bt.iridescenceThicknessMap)),bt.transmission>0&&(gt.transmission.value=bt.transmission,gt.transmissionSamplerMap.value=yt.texture,gt.transmissionSamplerSize.value.set(yt.width,yt.height),bt.transmissionMap&&(gt.transmissionMap.value=bt.transmissionMap),gt.thickness.value=bt.thickness,bt.thicknessMap&&(gt.thicknessMap.value=bt.thicknessMap),gt.attenuationDistance.value=bt.attenuationDistance,gt.attenuationColor.value.copy(bt.attenuationColor)),gt.specularIntensity.value=bt.specularIntensity,gt.specularColor.value.copy(bt.specularColor),bt.specularIntensityMap&&(gt.specularIntensityMap.value=bt.specularIntensityMap),bt.specularColorMap&&(gt.specularColorMap.value=bt.specularColorMap)}function pt(gt,bt){bt.matcap&&(gt.matcap.value=bt.matcap)}function mt(gt,bt){gt.referencePosition.value.copy(bt.referencePosition),gt.nearDistance.value=bt.nearDistance,gt.farDistance.value=bt.farDistance}return{refreshFogUniforms:nt,refreshMaterialUniforms:it}}function WebGLUniformsGroups(tt,et,nt,it){let rt={},ot={},at=[];const st=nt.isWebGL2?tt.getParameter(35375):0;function lt(wt,vt){const xt=vt.program;it.uniformBlockBinding(wt,xt)}function ct(wt,vt){let xt=rt[wt.id];xt===void 0&&(mt(wt),xt=ut(wt),rt[wt.id]=xt,wt.addEventListener("dispose",bt));const St=vt.program;it.updateUBOMapping(wt,St);const Et=et.render.frame;ot[wt.id]!==Et&&(dt(wt),ot[wt.id]=Et)}function ut(wt){const vt=ht();wt.__bindingPointIndex=vt;const xt=tt.createBuffer(),St=wt.__size,Et=wt.usage;return tt.bindBuffer(35345,xt),tt.bufferData(35345,St,Et),tt.bindBuffer(35345,null),tt.bindBufferBase(35345,vt,xt),xt}function ht(){for(let wt=0;wt0){Et=xt%St;const Lt=St-Et;Et!==0&&Lt-Ut.boundary<0&&(xt+=St-Et,$t.__offset=xt)}xt+=Ut.storage}return Et=xt%St,Et>0&&(xt+=St-Et),wt.__size=xt,wt.__cache={},this}function gt(wt){const vt=wt.value,xt={boundary:0,storage:0};return typeof vt=="number"?(xt.boundary=4,xt.storage=4):vt.isVector2?(xt.boundary=8,xt.storage=8):vt.isVector3||vt.isColor?(xt.boundary=16,xt.storage=12):vt.isVector4?(xt.boundary=16,xt.storage=16):vt.isMatrix3?(xt.boundary=48,xt.storage=48):vt.isMatrix4?(xt.boundary=64,xt.storage=64):vt.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",vt),xt}function bt(wt){const vt=wt.target;vt.removeEventListener("dispose",bt);const xt=at.indexOf(vt.__bindingPointIndex);at.splice(xt,1),tt.deleteBuffer(rt[vt.id]),delete rt[vt.id],delete ot[vt.id]}function yt(){for(const wt in rt)tt.deleteBuffer(rt[wt]);at=[],rt={},ot={}}return{bind:lt,update:ct,dispose:yt}}function createCanvasElement(){const tt=createElementNS("canvas");return tt.style.display="block",tt}function WebGLRenderer(tt={}){this.isWebGLRenderer=!0;const et=tt.canvas!==void 0?tt.canvas:createCanvasElement(),nt=tt.context!==void 0?tt.context:null,it=tt.depth!==void 0?tt.depth:!0,rt=tt.stencil!==void 0?tt.stencil:!0,ot=tt.antialias!==void 0?tt.antialias:!1,at=tt.premultipliedAlpha!==void 0?tt.premultipliedAlpha:!0,st=tt.preserveDrawingBuffer!==void 0?tt.preserveDrawingBuffer:!1,lt=tt.powerPreference!==void 0?tt.powerPreference:"default",ct=tt.failIfMajorPerformanceCaveat!==void 0?tt.failIfMajorPerformanceCaveat:!1;let ut;nt!==null?ut=nt.getContextAttributes().alpha:ut=tt.alpha!==void 0?tt.alpha:!1;let ht=null,dt=null;const pt=[],mt=[];this.domElement=et,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=LinearEncoding,this.physicallyCorrectLights=!1,this.toneMapping=NoToneMapping,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 gt=this;let bt=!1,yt=0,wt=0,vt=null,xt=-1,St=null;const Et=new Vector4,It=new Vector4;let Tt=null,$t=et.width,Ut=et.height,Lt=1,Bt=null,Pt=null;const kt=new Vector4(0,0,$t,Ut),At=new Vector4(0,0,$t,Ut);let Rt=!1;const Wt=new Frustum;let jt=!1,Ot=!1,Ct=null;const Dt=new Matrix4,Mt=new Vector2,Vt=new Vector3,Qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function rn(){return vt===null?Lt:1}let Xt=nt;function an(fn,Jt){for(let kn=0;kn0?dt=mt[mt.length-1]:dt=null,pt.pop(),pt.length>0?ht=pt[pt.length-1]:ht=null};function Mr(fn,Jt,kn,On){if(fn.visible===!1)return;if(fn.layers.test(Jt.layers)){if(fn.isGroup)kn=fn.renderOrder;else if(fn.isLOD)fn.autoUpdate===!0&&fn.update(Jt);else if(fn.isLight)dt.pushLight(fn),fn.castShadow&&dt.pushShadow(fn);else if(fn.isSprite){if(!fn.frustumCulled||Wt.intersectsSprite(fn)){On&&Vt.setFromMatrixPosition(fn.matrixWorld).applyMatrix4(Dt);const er=yn.update(fn),or=fn.material;or.visible&&ht.push(fn,er,or,kn,Vt.z,null)}}else if((fn.isMesh||fn.isLine||fn.isPoints)&&(fn.isSkinnedMesh&&fn.skeleton.frame!==sn.render.frame&&(fn.skeleton.update(),fn.skeleton.frame=sn.render.frame),!fn.frustumCulled||Wt.intersectsObject(fn))){On&&Vt.setFromMatrixPosition(fn.matrixWorld).applyMatrix4(Dt);const er=yn.update(fn),or=fn.material;if(Array.isArray(or)){const ar=er.groups;for(let Vr=0,wr=ar.length;Vr0&&Ur(Dn,Jt,kn),On&&vn.viewport(Et.copy(On)),Dn.length>0&&Lr(Dn,Jt,kn),Kn.length>0&&Lr(Kn,Jt,kn),er.length>0&&Lr(er,Jt,kn),vn.buffers.depth.setTest(!0),vn.buffers.depth.setMask(!0),vn.buffers.color.setMask(!0),vn.setPolygonOffset(!1)}function Ur(fn,Jt,kn){const On=pn.isWebGL2;Ct===null&&(Ct=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:tn.has("EXT_color_buffer_half_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:On&&ot===!0?4:0})),gt.getDrawingBufferSize(Mt),On?Ct.setSize(Mt.x,Mt.y):Ct.setSize(floorPowerOfTwo(Mt.x),floorPowerOfTwo(Mt.y));const Dn=gt.getRenderTarget();gt.setRenderTarget(Ct),gt.clear();const Kn=gt.toneMapping;gt.toneMapping=NoToneMapping,Lr(fn,Jt,kn),gt.toneMapping=Kn,Sn.updateMultisampleRenderTarget(Ct),Sn.updateRenderTargetMipmap(Ct),gt.setRenderTarget(Dn)}function Lr(fn,Jt,kn){const On=Jt.isScene===!0?Jt.overrideMaterial:null;for(let Dn=0,Kn=fn.length;Dn0&&Sn.useMultisampledRTT(fn)===!1?Dn=Zt.get(fn).__webglMultisampledFramebuffer:Dn=Vr,Et.copy(fn.viewport),It.copy(fn.scissor),Tt=fn.scissorTest}else Et.copy(kt).multiplyScalar(Lt).floor(),It.copy(At).multiplyScalar(Lt).floor(),Tt=Rt;if(vn.bindFramebuffer(36160,Dn)&&pn.drawBuffers&&On&&vn.drawBuffers(fn,Dn),vn.viewport(Et),vn.scissor(It),vn.setScissorTest(Tt),Kn){const ar=Zt.get(fn.texture);Xt.framebufferTexture2D(36160,36064,34069+Jt,ar.__webglTexture,kn)}else if(er){const ar=Zt.get(fn.texture),Vr=Jt||0;Xt.framebufferTextureLayer(36160,36064,ar.__webglTexture,kn||0,Vr)}xt=-1},this.readRenderTargetPixels=function(fn,Jt,kn,On,Dn,Kn,er){if(!(fn&&fn.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let or=Zt.get(fn).__webglFramebuffer;if(fn.isWebGLCubeRenderTarget&&er!==void 0&&(or=or[er]),or){vn.bindFramebuffer(36160,or);try{const ar=fn.texture,Vr=ar.format,wr=ar.type;if(Vr!==RGBAFormat&&Yt.convert(Vr)!==Xt.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Or=wr===HalfFloatType&&(tn.has("EXT_color_buffer_half_float")||pn.isWebGL2&&tn.has("EXT_color_buffer_float"));if(wr!==UnsignedByteType&&Yt.convert(wr)!==Xt.getParameter(35738)&&!(wr===FloatType&&(pn.isWebGL2||tn.has("OES_texture_float")||tn.has("WEBGL_color_buffer_float")))&&!Or){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Jt>=0&&Jt<=fn.width-On&&kn>=0&&kn<=fn.height-Dn&&Xt.readPixels(Jt,kn,On,Dn,Yt.convert(Vr),Yt.convert(wr),Kn)}finally{const ar=vt!==null?Zt.get(vt).__webglFramebuffer:null;vn.bindFramebuffer(36160,ar)}}},this.copyFramebufferToTexture=function(fn,Jt,kn=0){const On=Math.pow(2,-kn),Dn=Math.floor(Jt.image.width*On),Kn=Math.floor(Jt.image.height*On);Sn.setTexture2D(Jt,0),Xt.copyTexSubImage2D(3553,kn,0,0,fn.x,fn.y,Dn,Kn),vn.unbindTexture()},this.copyTextureToTexture=function(fn,Jt,kn,On=0){const Dn=Jt.image.width,Kn=Jt.image.height,er=Yt.convert(kn.format),or=Yt.convert(kn.type);Sn.setTexture2D(kn,0),Xt.pixelStorei(37440,kn.flipY),Xt.pixelStorei(37441,kn.premultiplyAlpha),Xt.pixelStorei(3317,kn.unpackAlignment),Jt.isDataTexture?Xt.texSubImage2D(3553,On,fn.x,fn.y,Dn,Kn,er,or,Jt.image.data):Jt.isCompressedTexture?Xt.compressedTexSubImage2D(3553,On,fn.x,fn.y,Jt.mipmaps[0].width,Jt.mipmaps[0].height,er,Jt.mipmaps[0].data):Xt.texSubImage2D(3553,On,fn.x,fn.y,er,or,Jt.image),On===0&&kn.generateMipmaps&&Xt.generateMipmap(3553),vn.unbindTexture()},this.copyTextureToTexture3D=function(fn,Jt,kn,On,Dn=0){if(gt.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Kn=fn.max.x-fn.min.x+1,er=fn.max.y-fn.min.y+1,or=fn.max.z-fn.min.z+1,ar=Yt.convert(On.format),Vr=Yt.convert(On.type);let wr;if(On.isData3DTexture)Sn.setTexture3D(On,0),wr=32879;else if(On.isDataArrayTexture)Sn.setTexture2DArray(On,0),wr=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Xt.pixelStorei(37440,On.flipY),Xt.pixelStorei(37441,On.premultiplyAlpha),Xt.pixelStorei(3317,On.unpackAlignment);const Or=Xt.getParameter(3314),Hr=Xt.getParameter(32878),no=Xt.getParameter(3316),Xr=Xt.getParameter(3315),Jr=Xt.getParameter(32877),br=kn.isCompressedTexture?kn.mipmaps[0]:kn.image;Xt.pixelStorei(3314,br.width),Xt.pixelStorei(32878,br.height),Xt.pixelStorei(3316,fn.min.x),Xt.pixelStorei(3315,fn.min.y),Xt.pixelStorei(32877,fn.min.z),kn.isDataTexture||kn.isData3DTexture?Xt.texSubImage3D(wr,Dn,Jt.x,Jt.y,Jt.z,Kn,er,or,ar,Vr,br.data):kn.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Xt.compressedTexSubImage3D(wr,Dn,Jt.x,Jt.y,Jt.z,Kn,er,or,ar,br.data)):Xt.texSubImage3D(wr,Dn,Jt.x,Jt.y,Jt.z,Kn,er,or,ar,Vr,br),Xt.pixelStorei(3314,Or),Xt.pixelStorei(32878,Hr),Xt.pixelStorei(3316,no),Xt.pixelStorei(3315,Xr),Xt.pixelStorei(32877,Jr),Dn===0&&On.generateMipmaps&&Xt.generateMipmap(wr),vn.unbindTexture()},this.initTexture=function(fn){fn.isCubeTexture?Sn.setTextureCube(fn,0):fn.isData3DTexture?Sn.setTexture3D(fn,0):fn.isDataArrayTexture?Sn.setTexture2DArray(fn,0):Sn.setTexture2D(fn,0),vn.unbindTexture()},this.resetState=function(){yt=0,wt=0,vt=null,vn.reset(),_n.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class WebGL1Renderer extends WebGLRenderer{}WebGL1Renderer.prototype.isWebGL1Renderer=!0;class FogExp2{constructor(et,nt=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color$1(et),this.density=nt}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Fog{constructor(et,nt=1,it=1e3){this.isFog=!0,this.name="",this.color=new Color$1(et),this.near=nt,this.far=it}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{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(et,nt){return super.copy(et,nt),et.background!==null&&(this.background=et.background.clone()),et.environment!==null&&(this.environment=et.environment.clone()),et.fog!==null&&(this.fog=et.fog.clone()),et.overrideMaterial!==null&&(this.overrideMaterial=et.overrideMaterial.clone()),this.autoUpdate=et.autoUpdate,this.matrixAutoUpdate=et.matrixAutoUpdate,this}toJSON(et){const nt=super.toJSON(et);return this.fog!==null&&(nt.object.fog=this.fog.toJSON()),nt}}class InterleavedBuffer{constructor(et,nt){this.isInterleavedBuffer=!0,this.array=et,this.stride=nt,this.count=et!==void 0?et.length/nt:0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=generateUUID$1()}onUploadCallback(){}set needsUpdate(et){et===!0&&this.version++}setUsage(et){return this.usage=et,this}copy(et){return this.array=new et.array.constructor(et.array),this.count=et.count,this.stride=et.stride,this.usage=et.usage,this}copyAt(et,nt,it){et*=this.stride,it*=nt.stride;for(let rt=0,ot=this.stride;rtet.far||nt.push({distance:lt,point:_intersectPoint.clone(),uv:Triangle.getUV(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),face:null,object:this})}copy(et,nt){return super.copy(et,nt),et.center!==void 0&&this.center.copy(et.center),this.material=et.material,this}}function transformVertex(tt,et,nt,it,rt,ot){_alignedPosition.subVectors(tt,nt).addScalar(.5).multiply(it),rt!==void 0?(_rotatedPosition.x=ot*_alignedPosition.x-rt*_alignedPosition.y,_rotatedPosition.y=rt*_alignedPosition.x+ot*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),tt.copy(et),tt.x+=_rotatedPosition.x,tt.y+=_rotatedPosition.y,tt.applyMatrix4(_viewWorldMatrix)}const _v1$2=new Vector3,_v2$1=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(et){super.copy(et,!1);const nt=et.levels;for(let it=0,rt=nt.length;it0){let it,rt;for(it=1,rt=nt.length;it0){_v1$2.setFromMatrixPosition(this.matrixWorld);const rt=et.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(rt).raycast(et,nt)}}update(et){const nt=this.levels;if(nt.length>1){_v1$2.setFromMatrixPosition(et.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const it=_v1$2.distanceTo(_v2$1)/et.zoom;nt[0].object.visible=!0;let rt,ot;for(rt=1,ot=nt.length;rt=nt[rt].distance;rt++)nt[rt-1].object.visible=!1,nt[rt].object.visible=!0;for(this._currentLevel=rt-1;rtlt)continue;dt.applyMatrix4(this.matrixWorld);const Tt=et.ray.origin.distanceTo(dt);Ttet.far||nt.push({distance:Tt,point:ht.clone().applyMatrix4(this.matrixWorld),index:vt,face:null,faceIndex:null,object:this})}}else{const yt=Math.max(0,at.start),wt=Math.min(bt.count,at.start+at.count);for(let vt=yt,xt=wt-1;vtlt)continue;dt.applyMatrix4(this.matrixWorld);const Et=et.ray.origin.distanceTo(dt);Etet.far||nt.push({distance:Et,point:ht.clone().applyMatrix4(this.matrixWorld),index:vt,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const nt=this.geometry.morphAttributes,it=Object.keys(nt);if(it.length>0){const rt=nt[it[0]];if(rt!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=rt.length;ot0){const rt=nt[it[0]];if(rt!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=rt.length;otrt.far)return;ot.push({distance:ct,distanceToRay:Math.sqrt(st),point:lt,index:et,face:null,object:at})}}class VideoTexture extends Texture{constructor(et,nt,it,rt,ot,at,st,lt,ct){super(et,nt,it,rt,ot,at,st,lt,ct),this.isVideoTexture=!0,this.minFilter=at!==void 0?at:LinearFilter,this.magFilter=ot!==void 0?ot:LinearFilter,this.generateMipmaps=!1;const ut=this;function ht(){ut.needsUpdate=!0,et.requestVideoFrameCallback(ht)}"requestVideoFrameCallback"in et&&et.requestVideoFrameCallback(ht)}clone(){return new this.constructor(this.image).copy(this)}update(){const et=this.image;"requestVideoFrameCallback"in et===!1&&et.readyState>=et.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(et,nt,it){super({width:et,height:nt}),this.isFramebufferTexture=!0,this.format=it,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt){super(null,at,st,lt,ct,ut,rt,ot,ht,dt),this.isCompressedTexture=!0,this.image={width:nt,height:it},this.mipmaps=et,this.flipY=!1,this.generateMipmaps=!1}}class CanvasTexture extends Texture{constructor(et,nt,it,rt,ot,at,st,lt,ct){super(et,nt,it,rt,ot,at,st,lt,ct),this.isCanvasTexture=!0,this.needsUpdate=!0}}let Curve$1=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(et,nt){const it=this.getUtoTmapping(et);return this.getPoint(it,nt)}getPoints(et=5){const nt=[];for(let it=0;it<=et;it++)nt.push(this.getPoint(it/et));return nt}getSpacedPoints(et=5){const nt=[];for(let it=0;it<=et;it++)nt.push(this.getPointAt(it/et));return nt}getLength(){const et=this.getLengths();return et[et.length-1]}getLengths(et=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===et+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const nt=[];let it,rt=this.getPoint(0),ot=0;nt.push(0);for(let at=1;at<=et;at++)it=this.getPoint(at/et),ot+=it.distanceTo(rt),nt.push(ot),rt=it;return this.cacheArcLengths=nt,nt}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(et,nt){const it=this.getLengths();let rt=0;const ot=it.length;let at;nt?at=nt:at=et*it[ot-1];let st=0,lt=ot-1,ct;for(;st<=lt;)if(rt=Math.floor(st+(lt-st)/2),ct=it[rt]-at,ct<0)st=rt+1;else if(ct>0)lt=rt-1;else{lt=rt;break}if(rt=lt,it[rt]===at)return rt/(ot-1);const ut=it[rt],dt=it[rt+1]-ut,pt=(at-ut)/dt;return(rt+pt)/(ot-1)}getTangent(et,nt){let rt=et-1e-4,ot=et+1e-4;rt<0&&(rt=0),ot>1&&(ot=1);const at=this.getPoint(rt),st=this.getPoint(ot),lt=nt||(at.isVector2?new Vector2:new Vector3);return lt.copy(st).sub(at).normalize(),lt}getTangentAt(et,nt){const it=this.getUtoTmapping(et);return this.getTangent(it,nt)}computeFrenetFrames(et,nt){const it=new Vector3,rt=[],ot=[],at=[],st=new Vector3,lt=new Matrix4;for(let pt=0;pt<=et;pt++){const mt=pt/et;rt[pt]=this.getTangentAt(mt,new Vector3)}ot[0]=new Vector3,at[0]=new Vector3;let ct=Number.MAX_VALUE;const ut=Math.abs(rt[0].x),ht=Math.abs(rt[0].y),dt=Math.abs(rt[0].z);ut<=ct&&(ct=ut,it.set(1,0,0)),ht<=ct&&(ct=ht,it.set(0,1,0)),dt<=ct&&it.set(0,0,1),st.crossVectors(rt[0],it).normalize(),ot[0].crossVectors(rt[0],st),at[0].crossVectors(rt[0],ot[0]);for(let pt=1;pt<=et;pt++){if(ot[pt]=ot[pt-1].clone(),at[pt]=at[pt-1].clone(),st.crossVectors(rt[pt-1],rt[pt]),st.length()>Number.EPSILON){st.normalize();const mt=Math.acos(clamp$6(rt[pt-1].dot(rt[pt]),-1,1));ot[pt].applyMatrix4(lt.makeRotationAxis(st,mt))}at[pt].crossVectors(rt[pt],ot[pt])}if(nt===!0){let pt=Math.acos(clamp$6(ot[0].dot(ot[et]),-1,1));pt/=et,rt[0].dot(st.crossVectors(ot[0],ot[et]))>0&&(pt=-pt);for(let mt=1;mt<=et;mt++)ot[mt].applyMatrix4(lt.makeRotationAxis(rt[mt],pt*mt)),at[mt].crossVectors(rt[mt],ot[mt])}return{tangents:rt,normals:ot,binormals:at}}clone(){return new this.constructor().copy(this)}copy(et){return this.arcLengthDivisions=et.arcLengthDivisions,this}toJSON(){const et={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return et.arcLengthDivisions=this.arcLengthDivisions,et.type=this.type,et}fromJSON(et){return this.arcLengthDivisions=et.arcLengthDivisions,this}};class EllipseCurve extends Curve$1{constructor(et=0,nt=0,it=1,rt=1,ot=0,at=Math.PI*2,st=!1,lt=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=et,this.aY=nt,this.xRadius=it,this.yRadius=rt,this.aStartAngle=ot,this.aEndAngle=at,this.aClockwise=st,this.aRotation=lt}getPoint(et,nt){const it=nt||new Vector2,rt=Math.PI*2;let ot=this.aEndAngle-this.aStartAngle;const at=Math.abs(ot)rt;)ot-=rt;ot0?0:(Math.floor(Math.abs(st)/ot)+1)*ot:lt===0&&st===ot-1&&(st=ot-2,lt=1);let ct,ut;this.closed||st>0?ct=rt[(st-1)%ot]:(tmp.subVectors(rt[0],rt[1]).add(rt[0]),ct=tmp);const ht=rt[st%ot],dt=rt[(st+1)%ot];if(this.closed||st+2rt.length-2?rt.length-1:at+1],ht=rt[at>rt.length-3?rt.length-1:at+2];return it.set(CatmullRom(st,lt.x,ct.x,ut.x,ht.x),CatmullRom(st,lt.y,ct.y,ut.y,ht.y)),it}copy(et){super.copy(et),this.points=[];for(let nt=0,it=et.points.length;nt=it){const at=rt[ot]-it,st=this.curves[ot],lt=st.getLength(),ct=lt===0?0:1-at/lt;return st.getPointAt(ct,nt)}ot++}return null}getLength(){const et=this.getCurveLengths();return et[et.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 et=[];let nt=0;for(let it=0,rt=this.curves.length;it1&&!nt[nt.length-1].equals(nt[0])&&nt.push(nt[0]),nt}copy(et){super.copy(et),this.curves=[];for(let nt=0,it=et.curves.length;nt0){const ht=ct.getPoint(0);ht.equals(this.currentPoint)||this.lineTo(ht.x,ht.y)}this.curves.push(ct);const ut=ct.getPoint(1);return this.currentPoint.copy(ut),this}copy(et){return super.copy(et),this.currentPoint.copy(et.currentPoint),this}toJSON(){const et=super.toJSON();return et.currentPoint=this.currentPoint.toArray(),et}fromJSON(et){return super.fromJSON(et),this.currentPoint.fromArray(et.currentPoint),this}};class LatheGeometry extends BufferGeometry{constructor(et=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],nt=12,it=0,rt=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:et,segments:nt,phiStart:it,phiLength:rt},nt=Math.floor(nt),rt=clamp$6(rt,0,Math.PI*2);const ot=[],at=[],st=[],lt=[],ct=[],ut=1/nt,ht=new Vector3,dt=new Vector2,pt=new Vector3,mt=new Vector3,gt=new Vector3;let bt=0,yt=0;for(let wt=0;wt<=et.length-1;wt++)switch(wt){case 0:bt=et[wt+1].x-et[wt].x,yt=et[wt+1].y-et[wt].y,pt.x=yt*1,pt.y=-bt,pt.z=yt*0,gt.copy(pt),pt.normalize(),lt.push(pt.x,pt.y,pt.z);break;case et.length-1:lt.push(gt.x,gt.y,gt.z);break;default:bt=et[wt+1].x-et[wt].x,yt=et[wt+1].y-et[wt].y,pt.x=yt*1,pt.y=-bt,pt.z=yt*0,mt.copy(pt),pt.x+=gt.x,pt.y+=gt.y,pt.z+=gt.z,pt.normalize(),lt.push(pt.x,pt.y,pt.z),gt.copy(mt)}for(let wt=0;wt<=nt;wt++){const vt=it+wt*ut*rt,xt=Math.sin(vt),St=Math.cos(vt);for(let Et=0;Et<=et.length-1;Et++){ht.x=et[Et].x*xt,ht.y=et[Et].y,ht.z=et[Et].x*St,at.push(ht.x,ht.y,ht.z),dt.x=wt/nt,dt.y=Et/(et.length-1),st.push(dt.x,dt.y);const It=lt[3*Et+0]*xt,Tt=lt[3*Et+1],$t=lt[3*Et+0]*St;ct.push(It,Tt,$t)}}for(let wt=0;wt0&&vt(!0),nt>0&&vt(!1)),this.setIndex(ut),this.setAttribute("position",new Float32BufferAttribute(ht,3)),this.setAttribute("normal",new Float32BufferAttribute(dt,3)),this.setAttribute("uv",new Float32BufferAttribute(pt,2));function wt(){const xt=new Vector3,St=new Vector3;let Et=0;const It=(nt-et)/it;for(let Tt=0;Tt<=ot;Tt++){const $t=[],Ut=Tt/ot,Lt=Ut*(nt-et)+et;for(let Bt=0;Bt<=rt;Bt++){const Pt=Bt/rt,kt=Pt*lt+st,At=Math.sin(kt),Rt=Math.cos(kt);St.x=Lt*At,St.y=-Ut*it+bt,St.z=Lt*Rt,ht.push(St.x,St.y,St.z),xt.set(At,It,Rt).normalize(),dt.push(xt.x,xt.y,xt.z),pt.push(Pt,1-Ut),$t.push(mt++)}gt.push($t)}for(let Tt=0;Tt.9&&It<.1&&(vt<.2&&(at[wt+0]+=1),xt<.2&&(at[wt+2]+=1),St<.2&&(at[wt+4]+=1))}}function dt(wt){ot.push(wt.x,wt.y,wt.z)}function pt(wt,vt){const xt=wt*3;vt.x=et[xt+0],vt.y=et[xt+1],vt.z=et[xt+2]}function mt(){const wt=new Vector3,vt=new Vector3,xt=new Vector3,St=new Vector3,Et=new Vector2,It=new Vector2,Tt=new Vector2;for(let $t=0,Ut=0;$t80*nt){st=ct=tt[0],lt=ut=tt[1];for(let mt=nt;mtct&&(ct=ht),dt>ut&&(ut=dt);pt=Math.max(ct-st,ut-lt),pt=pt!==0?1/pt:0}return earcutLinked(ot,at,nt,st,lt,pt),at}};function linkedList(tt,et,nt,it,rt){let ot,at;if(rt===signedArea(tt,et,nt,it)>0)for(ot=et;ot=et;ot-=it)at=insertNode(ot,tt[ot],tt[ot+1],at);return at&&equals(at,at.next)&&(removeNode(at),at=at.next),at}function filterPoints(tt,et){if(!tt)return tt;et||(et=tt);let nt=tt,it;do if(it=!1,!nt.steiner&&(equals(nt,nt.next)||area(nt.prev,nt,nt.next)===0)){if(removeNode(nt),nt=et=nt.prev,nt===nt.next)break;it=!0}else nt=nt.next;while(it||nt!==et);return et}function earcutLinked(tt,et,nt,it,rt,ot,at){if(!tt)return;!at&&ot&&indexCurve(tt,it,rt,ot);let st=tt,lt,ct;for(;tt.prev!==tt.next;){if(lt=tt.prev,ct=tt.next,ot?isEarHashed(tt,it,rt,ot):isEar(tt)){et.push(lt.i/nt),et.push(tt.i/nt),et.push(ct.i/nt),removeNode(tt),tt=ct.next,st=ct.next;continue}if(tt=ct,tt===st){at?at===1?(tt=cureLocalIntersections(filterPoints(tt),et,nt),earcutLinked(tt,et,nt,it,rt,ot,2)):at===2&&splitEarcut(tt,et,nt,it,rt,ot):earcutLinked(filterPoints(tt),et,nt,it,rt,ot,1);break}}}function isEar(tt){const et=tt.prev,nt=tt,it=tt.next;if(area(et,nt,it)>=0)return!1;let rt=tt.next.next;for(;rt!==tt.prev;){if(pointInTriangle(et.x,et.y,nt.x,nt.y,it.x,it.y,rt.x,rt.y)&&area(rt.prev,rt,rt.next)>=0)return!1;rt=rt.next}return!0}function isEarHashed(tt,et,nt,it){const rt=tt.prev,ot=tt,at=tt.next;if(area(rt,ot,at)>=0)return!1;const st=rt.xot.x?rt.x>at.x?rt.x:at.x:ot.x>at.x?ot.x:at.x,ut=rt.y>ot.y?rt.y>at.y?rt.y:at.y:ot.y>at.y?ot.y:at.y,ht=zOrder(st,lt,et,nt,it),dt=zOrder(ct,ut,et,nt,it);let pt=tt.prevZ,mt=tt.nextZ;for(;pt&&pt.z>=ht&&mt&&mt.z<=dt;){if(pt!==tt.prev&&pt!==tt.next&&pointInTriangle(rt.x,rt.y,ot.x,ot.y,at.x,at.y,pt.x,pt.y)&&area(pt.prev,pt,pt.next)>=0||(pt=pt.prevZ,mt!==tt.prev&&mt!==tt.next&&pointInTriangle(rt.x,rt.y,ot.x,ot.y,at.x,at.y,mt.x,mt.y)&&area(mt.prev,mt,mt.next)>=0))return!1;mt=mt.nextZ}for(;pt&&pt.z>=ht;){if(pt!==tt.prev&&pt!==tt.next&&pointInTriangle(rt.x,rt.y,ot.x,ot.y,at.x,at.y,pt.x,pt.y)&&area(pt.prev,pt,pt.next)>=0)return!1;pt=pt.prevZ}for(;mt&&mt.z<=dt;){if(mt!==tt.prev&&mt!==tt.next&&pointInTriangle(rt.x,rt.y,ot.x,ot.y,at.x,at.y,mt.x,mt.y)&&area(mt.prev,mt,mt.next)>=0)return!1;mt=mt.nextZ}return!0}function cureLocalIntersections(tt,et,nt){let it=tt;do{const rt=it.prev,ot=it.next.next;!equals(rt,ot)&&intersects(rt,it,it.next,ot)&&locallyInside(rt,ot)&&locallyInside(ot,rt)&&(et.push(rt.i/nt),et.push(it.i/nt),et.push(ot.i/nt),removeNode(it),removeNode(it.next),it=tt=ot),it=it.next}while(it!==tt);return filterPoints(it)}function splitEarcut(tt,et,nt,it,rt,ot){let at=tt;do{let st=at.next.next;for(;st!==at.prev;){if(at.i!==st.i&&isValidDiagonal(at,st)){let lt=splitPolygon(at,st);at=filterPoints(at,at.next),lt=filterPoints(lt,lt.next),earcutLinked(at,et,nt,it,rt,ot),earcutLinked(lt,et,nt,it,rt,ot);return}st=st.next}at=at.next}while(at!==tt)}function eliminateHoles(tt,et,nt,it){const rt=[];let ot,at,st,lt,ct;for(ot=0,at=et.length;ot=nt.next.y&&nt.next.y!==nt.y){const dt=nt.x+(rt-nt.y)*(nt.next.x-nt.x)/(nt.next.y-nt.y);if(dt<=it&&dt>ot){if(ot=dt,dt===it){if(rt===nt.y)return nt;if(rt===nt.next.y)return nt.next}at=nt.x=nt.x&&nt.x>=lt&&it!==nt.x&&pointInTriangle(rtat.x||nt.x===at.x&§orContainsSector(at,nt)))&&(at=nt,ut=ht)),nt=nt.next;while(nt!==st);return at}function sectorContainsSector(tt,et){return area(tt.prev,tt,et.prev)<0&&area(et.next,tt,tt.next)<0}function indexCurve(tt,et,nt,it){let rt=tt;do rt.z===null&&(rt.z=zOrder(rt.x,rt.y,et,nt,it)),rt.prevZ=rt.prev,rt.nextZ=rt.next,rt=rt.next;while(rt!==tt);rt.prevZ.nextZ=null,rt.prevZ=null,sortLinked(rt)}function sortLinked(tt){let et,nt,it,rt,ot,at,st,lt,ct=1;do{for(nt=tt,tt=null,ot=null,at=0;nt;){for(at++,it=nt,st=0,et=0;et0||lt>0&⁢)st!==0&&(lt===0||!it||nt.z<=it.z)?(rt=nt,nt=nt.nextZ,st--):(rt=it,it=it.nextZ,lt--),ot?ot.nextZ=rt:tt=rt,rt.prevZ=ot,ot=rt;nt=it}ot.nextZ=null,ct*=2}while(at>1);return tt}function zOrder(tt,et,nt,it,rt){return tt=32767*(tt-nt)*rt,et=32767*(et-it)*rt,tt=(tt|tt<<8)&16711935,tt=(tt|tt<<4)&252645135,tt=(tt|tt<<2)&858993459,tt=(tt|tt<<1)&1431655765,et=(et|et<<8)&16711935,et=(et|et<<4)&252645135,et=(et|et<<2)&858993459,et=(et|et<<1)&1431655765,tt|et<<1}function getLeftmost(tt){let et=tt,nt=tt;do(et.x=0&&(tt-at)*(it-st)-(nt-at)*(et-st)>=0&&(nt-at)*(ot-st)-(rt-at)*(it-st)>=0}function isValidDiagonal(tt,et){return tt.next.i!==et.i&&tt.prev.i!==et.i&&!intersectsPolygon(tt,et)&&(locallyInside(tt,et)&&locallyInside(et,tt)&&middleInside(tt,et)&&(area(tt.prev,tt,et.prev)||area(tt,et.prev,et))||equals(tt,et)&&area(tt.prev,tt,tt.next)>0&&area(et.prev,et,et.next)>0)}function area(tt,et,nt){return(et.y-tt.y)*(nt.x-et.x)-(et.x-tt.x)*(nt.y-et.y)}function equals(tt,et){return tt.x===et.x&&tt.y===et.y}function intersects(tt,et,nt,it){const rt=sign$4(area(tt,et,nt)),ot=sign$4(area(tt,et,it)),at=sign$4(area(nt,it,tt)),st=sign$4(area(nt,it,et));return!!(rt!==ot&&at!==st||rt===0&&onSegment(tt,nt,et)||ot===0&&onSegment(tt,it,et)||at===0&&onSegment(nt,tt,it)||st===0&&onSegment(nt,et,it))}function onSegment(tt,et,nt){return et.x<=Math.max(tt.x,nt.x)&&et.x>=Math.min(tt.x,nt.x)&&et.y<=Math.max(tt.y,nt.y)&&et.y>=Math.min(tt.y,nt.y)}function sign$4(tt){return tt>0?1:tt<0?-1:0}function intersectsPolygon(tt,et){let nt=tt;do{if(nt.i!==tt.i&&nt.next.i!==tt.i&&nt.i!==et.i&&nt.next.i!==et.i&&intersects(nt,nt.next,tt,et))return!0;nt=nt.next}while(nt!==tt);return!1}function locallyInside(tt,et){return area(tt.prev,tt,tt.next)<0?area(tt,et,tt.next)>=0&&area(tt,tt.prev,et)>=0:area(tt,et,tt.prev)<0||area(tt,tt.next,et)<0}function middleInside(tt,et){let nt=tt,it=!1;const rt=(tt.x+et.x)/2,ot=(tt.y+et.y)/2;do nt.y>ot!=nt.next.y>ot&&nt.next.y!==nt.y&&rt<(nt.next.x-nt.x)*(ot-nt.y)/(nt.next.y-nt.y)+nt.x&&(it=!it),nt=nt.next;while(nt!==tt);return it}function splitPolygon(tt,et){const nt=new Node$4(tt.i,tt.x,tt.y),it=new Node$4(et.i,et.x,et.y),rt=tt.next,ot=et.prev;return tt.next=et,et.prev=tt,nt.next=rt,rt.prev=nt,it.next=nt,nt.prev=it,ot.next=it,it.prev=ot,it}function insertNode(tt,et,nt,it){const rt=new Node$4(tt,et,nt);return it?(rt.next=it.next,rt.prev=it,it.next.prev=rt,it.next=rt):(rt.prev=rt,rt.next=rt),rt}function removeNode(tt){tt.next.prev=tt.prev,tt.prev.next=tt.next,tt.prevZ&&(tt.prevZ.nextZ=tt.nextZ),tt.nextZ&&(tt.nextZ.prevZ=tt.prevZ)}function Node$4(tt,et,nt){this.i=tt,this.x=et,this.y=nt,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(tt,et,nt,it){let rt=0;for(let ot=et,at=nt-it;ot2&&tt[et-1].equals(tt[0])&&tt.pop()}function addContour(tt,et){for(let nt=0;ntNumber.EPSILON){const cn=Math.sqrt(xn),hn=Math.sqrt(En*En+In*In),$n=Sn.x-un/cn,nn=Sn.y+yn/cn,Kt=Tn.x-In/hn,Yt=Tn.y+En/hn,_n=((Kt-$n)*In-(Yt-nn)*En)/(yn*In-un*En);Cn=$n+yn*_n-Zt.x,jn=nn+un*_n-Zt.y;const Mn=Cn*Cn+jn*jn;if(Mn<=2)return new Vector2(Cn,jn);Un=Math.sqrt(Mn/2)}else{let cn=!1;yn>Number.EPSILON?En>Number.EPSILON&&(cn=!0):yn<-Number.EPSILON?En<-Number.EPSILON&&(cn=!0):Math.sign(un)===Math.sign(In)&&(cn=!0),cn?(Cn=-un,jn=yn,Un=Math.sqrt(xn)):(Cn=yn,jn=un,Un=Math.sqrt(xn/2))}return new Vector2(Cn/Un,jn/Un)}const Ot=[];for(let Zt=0,Sn=kt.length,Tn=Sn-1,Cn=Zt+1;Zt=0;Zt--){const Sn=Zt/bt,Tn=pt*Math.cos(Sn*Math.PI/2),Cn=mt*Math.sin(Sn*Math.PI/2)+gt;for(let jn=0,Un=kt.length;jn=0;){const Cn=Tn;let jn=Tn-1;jn<0&&(jn=Zt.length-1);for(let Un=0,yn=ut+bt*2;Un0)&&pt.push(vt,xt,Et),(yt!==it-1||lt0!=et>0&&this.version++,this._sheen=et}get clearcoat(){return this._clearcoat}set clearcoat(et){this._clearcoat>0!=et>0&&this.version++,this._clearcoat=et}get iridescence(){return this._iridescence}set iridescence(et){this._iridescence>0!=et>0&&this.version++,this._iridescence=et}get transmission(){return this._transmission}set transmission(et){this._transmission>0!=et>0&&this.version++,this._transmission=et}copy(et){return super.copy(et),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=et.clearcoat,this.clearcoatMap=et.clearcoatMap,this.clearcoatRoughness=et.clearcoatRoughness,this.clearcoatRoughnessMap=et.clearcoatRoughnessMap,this.clearcoatNormalMap=et.clearcoatNormalMap,this.clearcoatNormalScale.copy(et.clearcoatNormalScale),this.ior=et.ior,this.iridescence=et.iridescence,this.iridescenceMap=et.iridescenceMap,this.iridescenceIOR=et.iridescenceIOR,this.iridescenceThicknessRange=[...et.iridescenceThicknessRange],this.iridescenceThicknessMap=et.iridescenceThicknessMap,this.sheen=et.sheen,this.sheenColor.copy(et.sheenColor),this.sheenColorMap=et.sheenColorMap,this.sheenRoughness=et.sheenRoughness,this.sheenRoughnessMap=et.sheenRoughnessMap,this.transmission=et.transmission,this.transmissionMap=et.transmissionMap,this.thickness=et.thickness,this.thicknessMap=et.thicknessMap,this.attenuationDistance=et.attenuationDistance,this.attenuationColor.copy(et.attenuationColor),this.specularIntensity=et.specularIntensity,this.specularIntensityMap=et.specularIntensityMap,this.specularColor.copy(et.specularColor),this.specularColorMap=et.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(et){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color$1(16777215),this.specular=new Color$1(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,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(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.specular.copy(et.specular),this.shininess=et.shininess,this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.flatShading=et.flatShading,this.fog=et.fog,this}}class MeshToonMaterial extends Material{constructor(et){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color$1(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(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(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.gradientMap=et.gradientMap,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.alphaMap=et.alphaMap,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}class MeshNormalMaterial extends Material{constructor(et){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(et)}copy(et){return super.copy(et),this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.flatShading=et.flatShading,this}}class MeshLambertMaterial extends Material{constructor(et){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color$1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}class MeshMatcapMaterial extends Material{constructor(et){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color$1(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.defines={MATCAP:""},this.color.copy(et.color),this.matcap=et.matcap,this.map=et.map,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.alphaMap=et.alphaMap,this.flatShading=et.flatShading,this.fog=et.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(et){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(et)}copy(et){return super.copy(et),this.scale=et.scale,this.dashSize=et.dashSize,this.gapSize=et.gapSize,this}}function arraySlice(tt,et,nt){return isTypedArray$5(tt)?new tt.constructor(tt.subarray(et,nt!==void 0?nt:tt.length)):tt.slice(et,nt)}function convertArray(tt,et,nt){return!tt||!nt&&tt.constructor===et?tt:typeof et.BYTES_PER_ELEMENT=="number"?new et(tt):Array.prototype.slice.call(tt)}function isTypedArray$5(tt){return ArrayBuffer.isView(tt)&&!(tt instanceof DataView)}function getKeyframeOrder(tt){function et(rt,ot){return tt[rt]-tt[ot]}const nt=tt.length,it=new Array(nt);for(let rt=0;rt!==nt;++rt)it[rt]=rt;return it.sort(et),it}function sortedArray(tt,et,nt){const it=tt.length,rt=new tt.constructor(it);for(let ot=0,at=0;at!==it;++ot){const st=nt[ot]*et;for(let lt=0;lt!==et;++lt)rt[at++]=tt[st+lt]}return rt}function flattenJSON(tt,et,nt,it){let rt=1,ot=tt[0];for(;ot!==void 0&&ot[it]===void 0;)ot=tt[rt++];if(ot===void 0)return;let at=ot[it];if(at!==void 0)if(Array.isArray(at))do at=ot[it],at!==void 0&&(et.push(ot.time),nt.push.apply(nt,at)),ot=tt[rt++];while(ot!==void 0);else if(at.toArray!==void 0)do at=ot[it],at!==void 0&&(et.push(ot.time),at.toArray(nt,nt.length)),ot=tt[rt++];while(ot!==void 0);else do at=ot[it],at!==void 0&&(et.push(ot.time),nt.push(at)),ot=tt[rt++];while(ot!==void 0)}function subclip(tt,et,nt,it,rt=30){const ot=tt.clone();ot.name=et;const at=[];for(let lt=0;lt=it)){ht.push(ct.times[pt]);for(let gt=0;gtot.tracks[lt].times[0]&&(st=ot.tracks[lt].times[0]);for(let lt=0;lt=st.times[mt]){const yt=mt*ht+ut,wt=yt+ht-ut;gt=arraySlice(st.values,yt,wt)}else{const yt=st.createInterpolant(),wt=ut,vt=ht-ut;yt.evaluate(ot),gt=arraySlice(yt.resultBuffer,wt,vt)}lt==="quaternion"&&new Quaternion().fromArray(gt).normalize().conjugate().toArray(gt);const bt=ct.times.length;for(let yt=0;yt=ot)){const st=nt[1];et=ot)break t}at=it,it=0;break n}break e}for(;it>>1;etnt;)--at;if(++at,ot!==0||at!==rt){ot>=at&&(at=Math.max(at,1),ot=at-1);const st=this.getValueSize();this.times=arraySlice(it,ot,at),this.values=arraySlice(this.values,ot*st,at*st)}return this}validate(){let et=!0;const nt=this.getValueSize();nt-Math.floor(nt)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),et=!1);const it=this.times,rt=this.values,ot=it.length;ot===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),et=!1);let at=null;for(let st=0;st!==ot;st++){const lt=it[st];if(typeof lt=="number"&&isNaN(lt)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,st,lt),et=!1;break}if(at!==null&&at>lt){console.error("THREE.KeyframeTrack: Out of order keys.",this,st,lt,at),et=!1;break}at=lt}if(rt!==void 0&&isTypedArray$5(rt))for(let st=0,lt=rt.length;st!==lt;++st){const ct=rt[st];if(isNaN(ct)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,st,ct),et=!1;break}}return et}optimize(){const et=arraySlice(this.times),nt=arraySlice(this.values),it=this.getValueSize(),rt=this.getInterpolation()===InterpolateSmooth,ot=et.length-1;let at=1;for(let st=1;st0){et[at]=et[ot];for(let st=ot*it,lt=at*it,ct=0;ct!==it;++ct)nt[lt+ct]=nt[st+ct];++at}return at!==et.length?(this.times=arraySlice(et,0,at),this.values=arraySlice(nt,0,at*it)):(this.times=et,this.values=nt),this}clone(){const et=arraySlice(this.times,0),nt=arraySlice(this.values,0),it=this.constructor,rt=new it(this.name,et,nt);return rt.createInterpolant=this.createInterpolant,rt}}KeyframeTrack.prototype.TimeBufferType=Float32Array;KeyframeTrack.prototype.ValueBufferType=Float32Array;KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool";BooleanKeyframeTrack.prototype.ValueBufferType=Array;BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(et,nt,it,rt){super(et,nt,it,rt)}interpolate_(et,nt,it,rt){const ot=this.resultBuffer,at=this.sampleValues,st=this.valueSize,lt=(it-nt)/(rt-nt);let ct=et*st;for(let ut=ct+st;ct!==ut;ct+=4)Quaternion.slerpFlat(ot,0,at,ct-st,at,ct,lt);return ot}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(et){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),et)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion";QuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string";StringKeyframeTrack.prototype.ValueBufferType=Array;StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(et,nt=-1,it,rt=NormalAnimationBlendMode){this.name=et,this.tracks=it,this.duration=nt,this.blendMode=rt,this.uuid=generateUUID$1(),this.duration<0&&this.resetDuration()}static parse(et){const nt=[],it=et.tracks,rt=1/(et.fps||1);for(let at=0,st=it.length;at!==st;++at)nt.push(parseKeyframeTrack(it[at]).scale(rt));const ot=new this(et.name,et.duration,nt,et.blendMode);return ot.uuid=et.uuid,ot}static toJSON(et){const nt=[],it=et.tracks,rt={name:et.name,duration:et.duration,tracks:nt,uuid:et.uuid,blendMode:et.blendMode};for(let ot=0,at=it.length;ot!==at;++ot)nt.push(KeyframeTrack.toJSON(it[ot]));return rt}static CreateFromMorphTargetSequence(et,nt,it,rt){const ot=nt.length,at=[];for(let st=0;st1){const ht=ut[1];let dt=rt[ht];dt||(rt[ht]=dt=[]),dt.push(ct)}}const at=[];for(const st in rt)at.push(this.CreateFromMorphTargetSequence(st,rt[st],nt,it));return at}static parseAnimation(et,nt){if(!et)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const it=function(ht,dt,pt,mt,gt){if(pt.length!==0){const bt=[],yt=[];flattenJSON(pt,bt,yt,mt),bt.length!==0&>.push(new ht(dt,bt,yt))}},rt=[],ot=et.name||"default",at=et.fps||30,st=et.blendMode;let lt=et.length||-1;const ct=et.hierarchy||[];for(let ht=0;ht{nt&&nt(ot),this.manager.itemEnd(et)},0),ot;if(loading[et]!==void 0){loading[et].push({onLoad:nt,onProgress:it,onError:rt});return}loading[et]=[],loading[et].push({onLoad:nt,onProgress:it,onError:rt});const at=new Request(et,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),st=this.mimeType,lt=this.responseType;fetch(at).then(ct=>{if(ct.status===200||ct.status===0){if(ct.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||ct.body===void 0||ct.body.getReader===void 0)return ct;const ut=loading[et],ht=ct.body.getReader(),dt=ct.headers.get("Content-Length"),pt=dt?parseInt(dt):0,mt=pt!==0;let gt=0;const bt=new ReadableStream({start(yt){wt();function wt(){ht.read().then(({done:vt,value:xt})=>{if(vt)yt.close();else{gt+=xt.byteLength;const St=new ProgressEvent("progress",{lengthComputable:mt,loaded:gt,total:pt});for(let Et=0,It=ut.length;Et{switch(lt){case"arraybuffer":return ct.arrayBuffer();case"blob":return ct.blob();case"document":return ct.text().then(ut=>new DOMParser().parseFromString(ut,st));case"json":return ct.json();default:if(st===void 0)return ct.text();{const ht=/charset="?([^;"\s]*)"?/i.exec(st),dt=ht&&ht[1]?ht[1].toLowerCase():void 0,pt=new TextDecoder(dt);return ct.arrayBuffer().then(mt=>pt.decode(mt))}}}).then(ct=>{Cache.add(et,ct);const ut=loading[et];delete loading[et];for(let ht=0,dt=ut.length;ht{const ut=loading[et];if(ut===void 0)throw this.manager.itemError(et),ct;delete loading[et];for(let ht=0,dt=ut.length;ht{this.manager.itemEnd(et)}),this.manager.itemStart(et)}setResponseType(et){return this.responseType=et,this}setMimeType(et){return this.mimeType=et,this}}class AnimationLoader extends Loader$2{constructor(et){super(et)}load(et,nt,it,rt){const ot=this,at=new FileLoader(this.manager);at.setPath(this.path),at.setRequestHeader(this.requestHeader),at.setWithCredentials(this.withCredentials),at.load(et,function(st){try{nt(ot.parse(JSON.parse(st)))}catch(lt){rt?rt(lt):console.error(lt),ot.manager.itemError(et)}},it,rt)}parse(et){const nt=[];for(let it=0;it0:rt.vertexColors=et.vertexColors),et.uniforms!==void 0)for(const ot in et.uniforms){const at=et.uniforms[ot];switch(rt.uniforms[ot]={},at.type){case"t":rt.uniforms[ot].value=it(at.value);break;case"c":rt.uniforms[ot].value=new Color$1().setHex(at.value);break;case"v2":rt.uniforms[ot].value=new Vector2().fromArray(at.value);break;case"v3":rt.uniforms[ot].value=new Vector3().fromArray(at.value);break;case"v4":rt.uniforms[ot].value=new Vector4().fromArray(at.value);break;case"m3":rt.uniforms[ot].value=new Matrix3().fromArray(at.value);break;case"m4":rt.uniforms[ot].value=new Matrix4().fromArray(at.value);break;default:rt.uniforms[ot].value=at.value}}if(et.defines!==void 0&&(rt.defines=et.defines),et.vertexShader!==void 0&&(rt.vertexShader=et.vertexShader),et.fragmentShader!==void 0&&(rt.fragmentShader=et.fragmentShader),et.extensions!==void 0)for(const ot in et.extensions)rt.extensions[ot]=et.extensions[ot];if(et.shading!==void 0&&(rt.flatShading=et.shading===1),et.size!==void 0&&(rt.size=et.size),et.sizeAttenuation!==void 0&&(rt.sizeAttenuation=et.sizeAttenuation),et.map!==void 0&&(rt.map=it(et.map)),et.matcap!==void 0&&(rt.matcap=it(et.matcap)),et.alphaMap!==void 0&&(rt.alphaMap=it(et.alphaMap)),et.bumpMap!==void 0&&(rt.bumpMap=it(et.bumpMap)),et.bumpScale!==void 0&&(rt.bumpScale=et.bumpScale),et.normalMap!==void 0&&(rt.normalMap=it(et.normalMap)),et.normalMapType!==void 0&&(rt.normalMapType=et.normalMapType),et.normalScale!==void 0){let ot=et.normalScale;Array.isArray(ot)===!1&&(ot=[ot,ot]),rt.normalScale=new Vector2().fromArray(ot)}return et.displacementMap!==void 0&&(rt.displacementMap=it(et.displacementMap)),et.displacementScale!==void 0&&(rt.displacementScale=et.displacementScale),et.displacementBias!==void 0&&(rt.displacementBias=et.displacementBias),et.roughnessMap!==void 0&&(rt.roughnessMap=it(et.roughnessMap)),et.metalnessMap!==void 0&&(rt.metalnessMap=it(et.metalnessMap)),et.emissiveMap!==void 0&&(rt.emissiveMap=it(et.emissiveMap)),et.emissiveIntensity!==void 0&&(rt.emissiveIntensity=et.emissiveIntensity),et.specularMap!==void 0&&(rt.specularMap=it(et.specularMap)),et.specularIntensityMap!==void 0&&(rt.specularIntensityMap=it(et.specularIntensityMap)),et.specularColorMap!==void 0&&(rt.specularColorMap=it(et.specularColorMap)),et.envMap!==void 0&&(rt.envMap=it(et.envMap)),et.envMapIntensity!==void 0&&(rt.envMapIntensity=et.envMapIntensity),et.reflectivity!==void 0&&(rt.reflectivity=et.reflectivity),et.refractionRatio!==void 0&&(rt.refractionRatio=et.refractionRatio),et.lightMap!==void 0&&(rt.lightMap=it(et.lightMap)),et.lightMapIntensity!==void 0&&(rt.lightMapIntensity=et.lightMapIntensity),et.aoMap!==void 0&&(rt.aoMap=it(et.aoMap)),et.aoMapIntensity!==void 0&&(rt.aoMapIntensity=et.aoMapIntensity),et.gradientMap!==void 0&&(rt.gradientMap=it(et.gradientMap)),et.clearcoatMap!==void 0&&(rt.clearcoatMap=it(et.clearcoatMap)),et.clearcoatRoughnessMap!==void 0&&(rt.clearcoatRoughnessMap=it(et.clearcoatRoughnessMap)),et.clearcoatNormalMap!==void 0&&(rt.clearcoatNormalMap=it(et.clearcoatNormalMap)),et.clearcoatNormalScale!==void 0&&(rt.clearcoatNormalScale=new Vector2().fromArray(et.clearcoatNormalScale)),et.iridescenceMap!==void 0&&(rt.iridescenceMap=it(et.iridescenceMap)),et.iridescenceThicknessMap!==void 0&&(rt.iridescenceThicknessMap=it(et.iridescenceThicknessMap)),et.transmissionMap!==void 0&&(rt.transmissionMap=it(et.transmissionMap)),et.thicknessMap!==void 0&&(rt.thicknessMap=it(et.thicknessMap)),et.sheenColorMap!==void 0&&(rt.sheenColorMap=it(et.sheenColorMap)),et.sheenRoughnessMap!==void 0&&(rt.sheenRoughnessMap=it(et.sheenRoughnessMap)),rt}setTextures(et){return this.textures=et,this}static createMaterialFromType(et){const nt={ShadowMaterial,SpriteMaterial,RawShaderMaterial,ShaderMaterial,PointsMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshPhongMaterial,MeshToonMaterial,MeshNormalMaterial,MeshLambertMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshBasicMaterial,MeshMatcapMaterial,LineDashedMaterial,LineBasicMaterial,Material};return new nt[et]}}class LoaderUtils{static decodeText(et){if(typeof TextDecoder<"u")return new TextDecoder().decode(et);let nt="";for(let it=0,rt=et.length;it0){const lt=new LoadingManager(nt);ot=new ImageLoader(lt),ot.setCrossOrigin(this.crossOrigin);for(let ct=0,ut=et.length;ct0){rt=new ImageLoader(this.manager),rt.setCrossOrigin(this.crossOrigin);for(let at=0,st=et.length;at"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(et){return this.options=et,this}load(et,nt,it,rt){et===void 0&&(et=""),this.path!==void 0&&(et=this.path+et),et=this.manager.resolveURL(et);const ot=this,at=Cache.get(et);if(at!==void 0)return ot.manager.itemStart(et),setTimeout(function(){nt&&nt(at),ot.manager.itemEnd(et)},0),at;const st={};st.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",st.headers=this.requestHeader,fetch(et,st).then(function(lt){return lt.blob()}).then(function(lt){return createImageBitmap(lt,Object.assign(ot.options,{colorSpaceConversion:"none"}))}).then(function(lt){Cache.add(et,lt),nt&&nt(lt),ot.manager.itemEnd(et)}).catch(function(lt){rt&&rt(lt),ot.manager.itemError(et),ot.manager.itemEnd(et)}),ot.manager.itemStart(et)}}let _context$1;const AudioContext={getContext:function(){return _context$1===void 0&&(_context$1=new(window.AudioContext||window.webkitAudioContext)),_context$1},setContext:function(tt){_context$1=tt}};class AudioLoader extends Loader$2{constructor(et){super(et)}load(et,nt,it,rt){const ot=this,at=new FileLoader(this.manager);at.setResponseType("arraybuffer"),at.setPath(this.path),at.setRequestHeader(this.requestHeader),at.setWithCredentials(this.withCredentials),at.load(et,function(st){try{const lt=st.slice(0);AudioContext.getContext().decodeAudioData(lt,function(ut){nt(ut)})}catch(lt){rt?rt(lt):console.error(lt),ot.manager.itemError(et)}},it,rt)}}class HemisphereLightProbe extends LightProbe{constructor(et,nt,it=1){super(void 0,it),this.isHemisphereLightProbe=!0;const rt=new Color$1().set(et),ot=new Color$1().set(nt),at=new Vector3(rt.r,rt.g,rt.b),st=new Vector3(ot.r,ot.g,ot.b),lt=Math.sqrt(Math.PI),ct=lt*Math.sqrt(.75);this.sh.coefficients[0].copy(at).add(st).multiplyScalar(lt),this.sh.coefficients[1].copy(at).sub(st).multiplyScalar(ct)}}class AmbientLightProbe extends LightProbe{constructor(et,nt=1){super(void 0,nt),this.isAmbientLightProbe=!0;const it=new Color$1().set(et);this.sh.coefficients[0].set(it.r,it.g,it.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const _eyeRight=new Matrix4,_eyeLeft=new Matrix4,_projectionMatrix=new Matrix4;class StereoCamera{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,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(et){const nt=this._cache;if(nt.focus!==et.focus||nt.fov!==et.fov||nt.aspect!==et.aspect*this.aspect||nt.near!==et.near||nt.far!==et.far||nt.zoom!==et.zoom||nt.eyeSep!==this.eyeSep){nt.focus=et.focus,nt.fov=et.fov,nt.aspect=et.aspect*this.aspect,nt.near=et.near,nt.far=et.far,nt.zoom=et.zoom,nt.eyeSep=this.eyeSep,_projectionMatrix.copy(et.projectionMatrix);const rt=nt.eyeSep/2,ot=rt*nt.near/nt.focus,at=nt.near*Math.tan(DEG2RAD$1*nt.fov*.5)/nt.zoom;let st,lt;_eyeLeft.elements[12]=-rt,_eyeRight.elements[12]=rt,st=-at*nt.aspect+ot,lt=at*nt.aspect+ot,_projectionMatrix.elements[0]=2*nt.near/(lt-st),_projectionMatrix.elements[8]=(lt+st)/(lt-st),this.cameraL.projectionMatrix.copy(_projectionMatrix),st=-at*nt.aspect-ot,lt=at*nt.aspect-ot,_projectionMatrix.elements[0]=2*nt.near/(lt-st),_projectionMatrix.elements[8]=(lt+st)/(lt-st),this.cameraR.projectionMatrix.copy(_projectionMatrix)}this.cameraL.matrixWorld.copy(et.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(et.matrixWorld).multiply(_eyeRight)}}let Clock$1=class{constructor(et=!0){this.autoStart=et,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now$5(),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 et=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const nt=now$5();et=(nt-this.oldTime)/1e3,this.oldTime=nt,this.elapsedTime+=et}return et}};function now$5(){return(typeof performance>"u"?Date:performance).now()}const _position$1=new Vector3,_quaternion$1=new Quaternion,_scale$1=new Vector3,_orientation$1=new Vector3;class AudioListener extends Object3D{constructor(){super(),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock$1}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(et){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=et,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(et){return this.gain.gain.setTargetAtTime(et,this.context.currentTime,.01),this}updateMatrixWorld(et){super.updateMatrixWorld(et);const nt=this.context.listener,it=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$1,_quaternion$1,_scale$1),_orientation$1.set(0,0,-1).applyQuaternion(_quaternion$1),nt.positionX){const rt=this.context.currentTime+this.timeDelta;nt.positionX.linearRampToValueAtTime(_position$1.x,rt),nt.positionY.linearRampToValueAtTime(_position$1.y,rt),nt.positionZ.linearRampToValueAtTime(_position$1.z,rt),nt.forwardX.linearRampToValueAtTime(_orientation$1.x,rt),nt.forwardY.linearRampToValueAtTime(_orientation$1.y,rt),nt.forwardZ.linearRampToValueAtTime(_orientation$1.z,rt),nt.upX.linearRampToValueAtTime(it.x,rt),nt.upY.linearRampToValueAtTime(it.y,rt),nt.upZ.linearRampToValueAtTime(it.z,rt)}else nt.setPosition(_position$1.x,_position$1.y,_position$1.z),nt.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z,it.x,it.y,it.z)}}class Audio extends Object3D{constructor(et){super(),this.type="Audio",this.listener=et,this.context=et.context,this.gain=this.context.createGain(),this.gain.connect(et.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(et){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=et,this.connect(),this}setMediaElementSource(et){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(et),this.connect(),this}setMediaStreamSource(et){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(et),this.connect(),this}setBuffer(et){return this.buffer=et,this.sourceType="buffer",this.autoplay&&this.play(),this}play(et=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+et;const nt=this.context.createBufferSource();return nt.buffer=this.buffer,nt.loop=this.loop,nt.loopStart=this.loopStart,nt.loopEnd=this.loopEnd,nt.onended=this.onEnded.bind(this),nt.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=nt,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 et=1,nt=this.filters.length;et0){this.source.disconnect(this.filters[0]);for(let et=1,nt=this.filters.length;et0&&this._mixBufferRegionAdditive(it,rt,this._addIndex*nt,1,nt);for(let lt=nt,ct=nt+nt;lt!==ct;++lt)if(it[lt]!==it[lt+nt]){st.setValue(it,rt);break}}saveOriginalState(){const et=this.binding,nt=this.buffer,it=this.valueSize,rt=it*this._origIndex;et.getValue(nt,rt);for(let ot=it,at=rt;ot!==at;++ot)nt[ot]=nt[rt+ot%it];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const et=this.valueSize*3;this.binding.setValue(this.buffer,et)}_setAdditiveIdentityNumeric(){const et=this._addIndex*this.valueSize,nt=et+this.valueSize;for(let it=et;it=.5)for(let at=0;at!==ot;++at)et[nt+at]=et[it+at]}_slerp(et,nt,it,rt){Quaternion.slerpFlat(et,nt,et,nt,et,it,rt)}_slerpAdditive(et,nt,it,rt,ot){const at=this._workIndex*ot;Quaternion.multiplyQuaternionsFlat(et,at,et,nt,et,it),Quaternion.slerpFlat(et,nt,et,nt,et,at,rt)}_lerp(et,nt,it,rt,ot){const at=1-rt;for(let st=0;st!==ot;++st){const lt=nt+st;et[lt]=et[lt]*at+et[it+st]*rt}}_lerpAdditive(et,nt,it,rt,ot){for(let at=0;at!==ot;++at){const st=nt+at;et[st]=et[st]+et[it+at]*rt}}}const _RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones"];class Composite{constructor(et,nt,it){const rt=it||PropertyBinding.parseTrackName(nt);this._targetGroup=et,this._bindings=et.subscribe_(nt,rt)}getValue(et,nt){this.bind();const it=this._targetGroup.nCachedObjects_,rt=this._bindings[it];rt!==void 0&&rt.getValue(et,nt)}setValue(et,nt){const it=this._bindings;for(let rt=this._targetGroup.nCachedObjects_,ot=it.length;rt!==ot;++rt)it[rt].setValue(et,nt)}bind(){const et=this._bindings;for(let nt=this._targetGroup.nCachedObjects_,it=et.length;nt!==it;++nt)et[nt].bind()}unbind(){const et=this._bindings;for(let nt=this._targetGroup.nCachedObjects_,it=et.length;nt!==it;++nt)et[nt].unbind()}}class PropertyBinding{constructor(et,nt,it){this.path=nt,this.parsedPath=it||PropertyBinding.parseTrackName(nt),this.node=PropertyBinding.findNode(et,this.parsedPath.nodeName)||et,this.rootNode=et,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(et,nt,it){return et&&et.isAnimationObjectGroup?new PropertyBinding.Composite(et,nt,it):new PropertyBinding(et,nt,it)}static sanitizeNodeName(et){return et.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(et){const nt=_trackRe.exec(et);if(nt===null)throw new Error("PropertyBinding: Cannot parse trackName: "+et);const it={nodeName:nt[2],objectName:nt[3],objectIndex:nt[4],propertyName:nt[5],propertyIndex:nt[6]},rt=it.nodeName&&it.nodeName.lastIndexOf(".");if(rt!==void 0&&rt!==-1){const ot=it.nodeName.substring(rt+1);_supportedObjectNames.indexOf(ot)!==-1&&(it.nodeName=it.nodeName.substring(0,rt),it.objectName=ot)}if(it.propertyName===null||it.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+et);return it}static findNode(et,nt){if(nt===void 0||nt===""||nt==="."||nt===-1||nt===et.name||nt===et.uuid)return et;if(et.skeleton){const it=et.skeleton.getBoneByName(nt);if(it!==void 0)return it}if(et.children){const it=function(ot){for(let at=0;at=ot){const ht=ot++,dt=et[ht];nt[dt.uuid]=ut,et[ut]=dt,nt[ct]=ht,et[ht]=lt;for(let pt=0,mt=rt;pt!==mt;++pt){const gt=it[pt],bt=gt[ht],yt=gt[ut];gt[ut]=bt,gt[ht]=yt}}}this.nCachedObjects_=ot}uncache(){const et=this._objects,nt=this._indicesByUUID,it=this._bindings,rt=it.length;let ot=this.nCachedObjects_,at=et.length;for(let st=0,lt=arguments.length;st!==lt;++st){const ct=arguments[st],ut=ct.uuid,ht=nt[ut];if(ht!==void 0)if(delete nt[ut],ht0&&(nt[pt.uuid]=ht),et[ht]=pt,et.pop();for(let mt=0,gt=rt;mt!==gt;++mt){const bt=it[mt];bt[ht]=bt[dt],bt.pop()}}}this.nCachedObjects_=ot}subscribe_(et,nt){const it=this._bindingsIndicesByPath;let rt=it[et];const ot=this._bindings;if(rt!==void 0)return ot[rt];const at=this._paths,st=this._parsedPaths,lt=this._objects,ct=lt.length,ut=this.nCachedObjects_,ht=new Array(ct);rt=ot.length,it[et]=rt,at.push(et),st.push(nt),ot.push(ht);for(let dt=ut,pt=lt.length;dt!==pt;++dt){const mt=lt[dt];ht[dt]=new PropertyBinding(mt,et,nt)}return ht}unsubscribe_(et){const nt=this._bindingsIndicesByPath,it=nt[et];if(it!==void 0){const rt=this._paths,ot=this._parsedPaths,at=this._bindings,st=at.length-1,lt=at[st],ct=et[st];nt[ct]=it,at[it]=lt,at.pop(),ot[it]=ot[st],ot.pop(),rt[it]=rt[st],rt.pop()}}}class AnimationAction{constructor(et,nt,it=null,rt=nt.blendMode){this._mixer=et,this._clip=nt,this._localRoot=it,this.blendMode=rt;const ot=nt.tracks,at=ot.length,st=new Array(at),lt={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let ct=0;ct!==at;++ct){const ut=ot[ct].createInterpolant(null);st[ct]=ut,ut.settings=lt}this._interpolantSettings=lt,this._interpolants=st,this._propertyBindings=new Array(at),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat,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(et){return this._startTime=et,this}setLoop(et,nt){return this.loop=et,this.repetitions=nt,this}setEffectiveWeight(et){return this.weight=et,this._effectiveWeight=this.enabled?et:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(et){return this._scheduleFading(et,0,1)}fadeOut(et){return this._scheduleFading(et,1,0)}crossFadeFrom(et,nt,it){if(et.fadeOut(nt),this.fadeIn(nt),it){const rt=this._clip.duration,ot=et._clip.duration,at=ot/rt,st=rt/ot;et.warp(1,at,nt),this.warp(st,1,nt)}return this}crossFadeTo(et,nt,it){return et.crossFadeFrom(this,nt,it)}stopFading(){const et=this._weightInterpolant;return et!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(et)),this}setEffectiveTimeScale(et){return this.timeScale=et,this._effectiveTimeScale=this.paused?0:et,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(et){return this.timeScale=this._clip.duration/et,this.stopWarping()}syncWith(et){return this.time=et.time,this.timeScale=et.timeScale,this.stopWarping()}halt(et){return this.warp(this._effectiveTimeScale,0,et)}warp(et,nt,it){const rt=this._mixer,ot=rt.time,at=this.timeScale;let st=this._timeScaleInterpolant;st===null&&(st=rt._lendControlInterpolant(),this._timeScaleInterpolant=st);const lt=st.parameterPositions,ct=st.sampleValues;return lt[0]=ot,lt[1]=ot+it,ct[0]=et/at,ct[1]=nt/at,this}stopWarping(){const et=this._timeScaleInterpolant;return et!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(et)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(et,nt,it,rt){if(!this.enabled){this._updateWeight(et);return}const ot=this._startTime;if(ot!==null){const lt=(et-ot)*it;if(lt<0||it===0)return;this._startTime=null,nt=it*lt}nt*=this._updateTimeScale(et);const at=this._updateTime(nt),st=this._updateWeight(et);if(st>0){const lt=this._interpolants,ct=this._propertyBindings;switch(this.blendMode){case AdditiveAnimationBlendMode:for(let ut=0,ht=lt.length;ut!==ht;++ut)lt[ut].evaluate(at),ct[ut].accumulateAdditive(st);break;case NormalAnimationBlendMode:default:for(let ut=0,ht=lt.length;ut!==ht;++ut)lt[ut].evaluate(at),ct[ut].accumulate(rt,st)}}}_updateWeight(et){let nt=0;if(this.enabled){nt=this.weight;const it=this._weightInterpolant;if(it!==null){const rt=it.evaluate(et)[0];nt*=rt,et>it.parameterPositions[1]&&(this.stopFading(),rt===0&&(this.enabled=!1))}}return this._effectiveWeight=nt,nt}_updateTimeScale(et){let nt=0;if(!this.paused){nt=this.timeScale;const it=this._timeScaleInterpolant;if(it!==null){const rt=it.evaluate(et)[0];nt*=rt,et>it.parameterPositions[1]&&(this.stopWarping(),nt===0?this.paused=!0:this.timeScale=nt)}}return this._effectiveTimeScale=nt,nt}_updateTime(et){const nt=this._clip.duration,it=this.loop;let rt=this.time+et,ot=this._loopCount;const at=it===LoopPingPong;if(et===0)return ot===-1?rt:at&&(ot&1)===1?nt-rt:rt;if(it===LoopOnce){ot===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(rt>=nt)rt=nt;else if(rt<0)rt=0;else{this.time=rt;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=rt,this._mixer.dispatchEvent({type:"finished",action:this,direction:et<0?-1:1})}}else{if(ot===-1&&(et>=0?(ot=0,this._setEndings(!0,this.repetitions===0,at)):this._setEndings(this.repetitions===0,!0,at)),rt>=nt||rt<0){const st=Math.floor(rt/nt);rt-=nt*st,ot+=Math.abs(st);const lt=this.repetitions-ot;if(lt<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,rt=et>0?nt:0,this.time=rt,this._mixer.dispatchEvent({type:"finished",action:this,direction:et>0?1:-1});else{if(lt===1){const ct=et<0;this._setEndings(ct,!ct,at)}else this._setEndings(!1,!1,at);this._loopCount=ot,this.time=rt,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:st})}}else this.time=rt;if(at&&(ot&1)===1)return nt-rt}return rt}_setEndings(et,nt,it){const rt=this._interpolantSettings;it?(rt.endingStart=ZeroSlopeEnding,rt.endingEnd=ZeroSlopeEnding):(et?rt.endingStart=this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:rt.endingStart=WrapAroundEnding,nt?rt.endingEnd=this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:rt.endingEnd=WrapAroundEnding)}_scheduleFading(et,nt,it){const rt=this._mixer,ot=rt.time;let at=this._weightInterpolant;at===null&&(at=rt._lendControlInterpolant(),this._weightInterpolant=at);const st=at.parameterPositions,lt=at.sampleValues;return st[0]=ot,lt[0]=nt,st[1]=ot+et,lt[1]=it,this}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends EventDispatcher$1{constructor(et){super(),this._root=et,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(et,nt){const it=et._localRoot||this._root,rt=et._clip.tracks,ot=rt.length,at=et._propertyBindings,st=et._interpolants,lt=it.uuid,ct=this._bindingsByRootAndName;let ut=ct[lt];ut===void 0&&(ut={},ct[lt]=ut);for(let ht=0;ht!==ot;++ht){const dt=rt[ht],pt=dt.name;let mt=ut[pt];if(mt!==void 0)++mt.referenceCount,at[ht]=mt;else{if(mt=at[ht],mt!==void 0){mt._cacheIndex===null&&(++mt.referenceCount,this._addInactiveBinding(mt,lt,pt));continue}const gt=nt&&nt._propertyBindings[ht].binding.parsedPath;mt=new PropertyMixer(PropertyBinding.create(it,pt,gt),dt.ValueTypeName,dt.getValueSize()),++mt.referenceCount,this._addInactiveBinding(mt,lt,pt),at[ht]=mt}st[ht].resultBuffer=mt.buffer}}_activateAction(et){if(!this._isActiveAction(et)){if(et._cacheIndex===null){const it=(et._localRoot||this._root).uuid,rt=et._clip.uuid,ot=this._actionsByClip[rt];this._bindAction(et,ot&&ot.knownActions[0]),this._addInactiveAction(et,rt,it)}const nt=et._propertyBindings;for(let it=0,rt=nt.length;it!==rt;++it){const ot=nt[it];ot.useCount++===0&&(this._lendBinding(ot),ot.saveOriginalState())}this._lendAction(et)}}_deactivateAction(et){if(this._isActiveAction(et)){const nt=et._propertyBindings;for(let it=0,rt=nt.length;it!==rt;++it){const ot=nt[it];--ot.useCount===0&&(ot.restoreOriginalState(),this._takeBackBinding(ot))}this._takeBackAction(et)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const et=this;this.stats={actions:{get total(){return et._actions.length},get inUse(){return et._nActiveActions}},bindings:{get total(){return et._bindings.length},get inUse(){return et._nActiveBindings}},controlInterpolants:{get total(){return et._controlInterpolants.length},get inUse(){return et._nActiveControlInterpolants}}}}_isActiveAction(et){const nt=et._cacheIndex;return nt!==null&&nt=0;--it)et[it].stop();return this}update(et){et*=this.timeScale;const nt=this._actions,it=this._nActiveActions,rt=this.time+=et,ot=Math.sign(et),at=this._accuIndex^=1;for(let ct=0;ct!==it;++ct)nt[ct]._update(rt,et,ot,at);const st=this._bindings,lt=this._nActiveBindings;for(let ct=0;ct!==lt;++ct)st[ct].apply(at);return this}setTime(et){this.time=0;for(let nt=0;ntthis.max.x||et.ythis.max.y)}containsBox(et){return this.min.x<=et.min.x&&et.max.x<=this.max.x&&this.min.y<=et.min.y&&et.max.y<=this.max.y}getParameter(et,nt){return nt.set((et.x-this.min.x)/(this.max.x-this.min.x),(et.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(et){return!(et.max.xthis.max.x||et.max.ythis.max.y)}clampPoint(et,nt){return nt.copy(et).clamp(this.min,this.max)}distanceToPoint(et){return _vector$4.copy(et).clamp(this.min,this.max).sub(et).length()}intersect(et){return this.min.max(et.min),this.max.min(et.max),this}union(et){return this.min.min(et.min),this.max.max(et.max),this}translate(et){return this.min.add(et),this.max.add(et),this}equals(et){return et.min.equals(this.min)&&et.max.equals(this.max)}}const _startP=new Vector3,_startEnd=new Vector3;class Line3{constructor(et=new Vector3,nt=new Vector3){this.start=et,this.end=nt}set(et,nt){return this.start.copy(et),this.end.copy(nt),this}copy(et){return this.start.copy(et.start),this.end.copy(et.end),this}getCenter(et){return et.addVectors(this.start,this.end).multiplyScalar(.5)}delta(et){return et.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(et,nt){return this.delta(nt).multiplyScalar(et).add(this.start)}closestPointToPointParameter(et,nt){_startP.subVectors(et,this.start),_startEnd.subVectors(this.end,this.start);const it=_startEnd.dot(_startEnd);let ot=_startEnd.dot(_startP)/it;return nt&&(ot=clamp$6(ot,0,1)),ot}closestPointToPoint(et,nt,it){const rt=this.closestPointToPointParameter(et,nt);return this.delta(it).multiplyScalar(rt).add(this.start)}applyMatrix4(et){return this.start.applyMatrix4(et),this.end.applyMatrix4(et),this}equals(et){return et.start.equals(this.start)&&et.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const _vector$3=new Vector3;class SpotLightHelper extends Object3D{constructor(et,nt){super(),this.light=et,this.light.updateMatrixWorld(),this.matrix=et.matrixWorld,this.matrixAutoUpdate=!1,this.color=nt;const it=new BufferGeometry,rt=[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 at=0,st=1,lt=32;at.99999)this.quaternion.set(0,0,0,1);else if(et.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(et.z,0,-et.x).normalize();const nt=Math.acos(et.y);this.quaternion.setFromAxisAngle(_axis,nt)}}setLength(et,nt=et*.2,it=nt*.2){this.line.scale.set(1,Math.max(1e-4,et-nt),1),this.line.updateMatrix(),this.cone.scale.set(it,nt,it),this.cone.position.y=et,this.cone.updateMatrix()}setColor(et){this.line.material.color.set(et),this.cone.material.color.set(et)}copy(et){return super.copy(et,!1),this.line.copy(et.line),this.cone.copy(et.cone),this}}class AxesHelper extends LineSegments{constructor(et=1){const nt=[0,0,0,et,0,0,0,0,0,0,et,0,0,0,0,0,0,et],it=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],rt=new BufferGeometry;rt.setAttribute("position",new Float32BufferAttribute(nt,3)),rt.setAttribute("color",new Float32BufferAttribute(it,3));const ot=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super(rt,ot),this.type="AxesHelper"}setColors(et,nt,it){const rt=new Color$1,ot=this.geometry.attributes.color.array;return rt.set(et),rt.toArray(ot,0),rt.toArray(ot,3),rt.set(nt),rt.toArray(ot,6),rt.toArray(ot,9),rt.set(it),rt.toArray(ot,12),rt.toArray(ot,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color$1,this.subPaths=[],this.currentPath=null}moveTo(et,nt){return this.currentPath=new Path$1,this.subPaths.push(this.currentPath),this.currentPath.moveTo(et,nt),this}lineTo(et,nt){return this.currentPath.lineTo(et,nt),this}quadraticCurveTo(et,nt,it,rt){return this.currentPath.quadraticCurveTo(et,nt,it,rt),this}bezierCurveTo(et,nt,it,rt,ot,at){return this.currentPath.bezierCurveTo(et,nt,it,rt,ot,at),this}splineThru(et){return this.currentPath.splineThru(et),this}toShapes(et,nt){function it(wt){const vt=[];for(let xt=0,St=wt.length;xtNumber.EPSILON){if(Lt<0&&(Tt=vt[It],Ut=-Ut,$t=vt[Et],Lt=-Lt),wt.y$t.y)continue;if(wt.y===Tt.y){if(wt.x===Tt.x)return!0}else{const Bt=Lt*(wt.x-Tt.x)-Ut*(wt.y-Tt.y);if(Bt===0)return!0;if(Bt<0)continue;St=!St}}else{if(wt.y!==Tt.y)continue;if($t.x<=wt.x&&wt.x<=Tt.x||Tt.x<=wt.x&&wt.x<=$t.x)return!0}}return St}const ot=ShapeUtils.isClockWise,at=this.subPaths;if(at.length===0)return[];if(nt===!0)return it(at);let st,lt,ct;const ut=[];if(at.length===1)return lt=at[0],ct=new Shape$1,ct.curves=lt.curves,ut.push(ct),ut;let ht=!ot(at[0].getPoints());ht=et?!ht:ht;const dt=[],pt=[];let mt=[],gt=0,bt;pt[gt]=void 0,mt[gt]=[];for(let wt=0,vt=at.length;wt1){let wt=!1,vt=0;for(let xt=0,St=pt.length;xt0&&wt===!1&&(mt=dt)}let yt;for(let wt=0,vt=pt.length;wt>-ct-14,it[lt|256]=1024>>-ct-14|32768,rt[lt]=-ct-1,rt[lt|256]=-ct-1):ct<=15?(it[lt]=ct+15<<10,it[lt|256]=ct+15<<10|32768,rt[lt]=13,rt[lt|256]=13):ct<128?(it[lt]=31744,it[lt|256]=64512,rt[lt]=24,rt[lt|256]=24):(it[lt]=31744,it[lt|256]=64512,rt[lt]=13,rt[lt|256]=13)}const ot=new Uint32Array(2048),at=new Uint32Array(64),st=new Uint32Array(64);for(let lt=1;lt<1024;++lt){let ct=lt<<13,ut=0;for(;!(ct&8388608);)ct<<=1,ut-=8388608;ct&=-8388609,ut+=947912704,ot[lt]=ct|ut}for(let lt=1024;lt<2048;++lt)ot[lt]=939524096+(lt-1024<<13);for(let lt=1;lt<31;++lt)at[lt]=lt<<23;at[31]=1199570944,at[32]=2147483648;for(let lt=33;lt<63;++lt)at[lt]=2147483648+(lt-32<<23);at[63]=3347054592;for(let lt=1;lt<64;++lt)lt!==32&&(st[lt]=1024);return{floatView:et,uint32View:nt,baseTable:it,shiftTable:rt,mantissaTable:ot,exponentTable:at,offsetTable:st}}function toHalfFloat(tt){Math.abs(tt)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),tt=clamp$6(tt,-65504,65504),_tables.floatView[0]=tt;const et=_tables.uint32View[0],nt=et>>23&511;return _tables.baseTable[nt]+((et&8388607)>>_tables.shiftTable[nt])}function fromHalfFloat(tt){const et=tt>>10;return _tables.uint32View[0]=_tables.mantissaTable[_tables.offsetTable[et]+(tt&1023)]+_tables.exponentTable[et],_tables.floatView[0]}var DataUtils=Object.freeze({__proto__:null,toHalfFloat,fromHalfFloat});class ParametricGeometry extends BufferGeometry{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class TextGeometry extends BufferGeometry{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function FontLoader(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function Font(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function ImmediateRenderObject(){console.error("THREE.ImmediateRenderObject has been removed.")}class WebGLMultisampleRenderTarget extends WebGLRenderTarget{constructor(et,nt,it){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(et,nt,it),this.samples=4}}class DataTexture2DArray extends DataArrayTexture{constructor(et,nt,it,rt){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(et,nt,it,rt)}}class DataTexture3D extends Data3DTexture{constructor(et,nt,it,rt){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(et,nt,it,rt)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION);const THREE$1=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping,AddEquation,AddOperation,AdditiveAnimationBlendMode,AdditiveBlending,AlphaFormat,AlwaysDepth,AlwaysStencilFunc,AmbientLight,AmbientLightProbe,AnimationClip,AnimationLoader,AnimationMixer,AnimationObjectGroup,AnimationUtils,ArcCurve,ArrayCamera,ArrowHelper,Audio,AudioAnalyser,AudioContext,AudioListener,AudioLoader,AxesHelper,BackSide,BasicDepthPacking,BasicShadowMap,Bone,BooleanKeyframeTrack,Box2,Box3,Box3Helper,BoxBufferGeometry:BoxGeometry,BoxGeometry,BoxHelper,BufferAttribute,BufferGeometry,BufferGeometryLoader,ByteType,Cache,Camera,CameraHelper,CanvasTexture,CapsuleBufferGeometry:CapsuleGeometry,CapsuleGeometry,CatmullRomCurve3,CineonToneMapping,CircleBufferGeometry:CircleGeometry,CircleGeometry,ClampToEdgeWrapping,Clock:Clock$1,Color:Color$1,ColorKeyframeTrack,ColorManagement,CompressedTexture,CompressedTextureLoader,ConeBufferGeometry:ConeGeometry,ConeGeometry,CubeCamera,CubeReflectionMapping,CubeRefractionMapping,CubeTexture,CubeTextureLoader,CubeUVReflectionMapping,CubicBezierCurve,CubicBezierCurve3,CubicInterpolant,CullFaceBack,CullFaceFront,CullFaceFrontBack,CullFaceNone,Curve:Curve$1,CurvePath,CustomBlending,CustomToneMapping,CylinderBufferGeometry:CylinderGeometry,CylinderGeometry,Cylindrical,Data3DTexture,DataArrayTexture,DataTexture,DataTexture2DArray,DataTexture3D,DataTextureLoader,DataUtils,DecrementStencilOp,DecrementWrapStencilOp,DefaultLoadingManager,DepthFormat,DepthStencilFormat,DepthTexture,DirectionalLight,DirectionalLightHelper,DiscreteInterpolant,DodecahedronBufferGeometry:DodecahedronGeometry,DodecahedronGeometry,DoubleSide,DstAlphaFactor,DstColorFactor,DynamicCopyUsage,DynamicDrawUsage,DynamicReadUsage,EdgesGeometry,EllipseCurve,EqualDepth,EqualStencilFunc,EquirectangularReflectionMapping,EquirectangularRefractionMapping,Euler,EventDispatcher:EventDispatcher$1,ExtrudeBufferGeometry:ExtrudeGeometry,ExtrudeGeometry,FileLoader,FlatShading,Float16BufferAttribute,Float32BufferAttribute,Float64BufferAttribute,FloatType,Fog,FogExp2,Font,FontLoader,FramebufferTexture,FrontSide,Frustum,GLBufferAttribute,GLSL1,GLSL3,GreaterDepth,GreaterEqualDepth,GreaterEqualStencilFunc,GreaterStencilFunc,GridHelper,Group,HalfFloatType,HemisphereLight,HemisphereLightHelper,HemisphereLightProbe,IcosahedronBufferGeometry:IcosahedronGeometry,IcosahedronGeometry,ImageBitmapLoader,ImageLoader,ImageUtils,ImmediateRenderObject,IncrementStencilOp,IncrementWrapStencilOp,InstancedBufferAttribute,InstancedBufferGeometry,InstancedInterleavedBuffer,InstancedMesh,Int16BufferAttribute,Int32BufferAttribute,Int8BufferAttribute,IntType,InterleavedBuffer,InterleavedBufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,InterpolateSmooth,InvertStencilOp,KeepStencilOp,KeyframeTrack,LOD,LatheBufferGeometry:LatheGeometry,LatheGeometry,Layers,LessDepth,LessEqualDepth,LessEqualStencilFunc,LessStencilFunc,Light,LightProbe,Line:Line$2,Line3,LineBasicMaterial,LineCurve,LineCurve3,LineDashedMaterial,LineLoop,LineSegments,LinearEncoding,LinearFilter,LinearInterpolant,LinearMipMapLinearFilter,LinearMipMapNearestFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,LinearSRGBColorSpace:LinearSRGBColorSpace$1,LinearToneMapping,Loader:Loader$2,LoaderUtils,LoadingManager,LoopOnce,LoopPingPong,LoopRepeat,LuminanceAlphaFormat,LuminanceFormat,MOUSE,Material,MaterialLoader,MathUtils,Matrix3,Matrix4,MaxEquation,Mesh,MeshBasicMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshLambertMaterial,MeshMatcapMaterial,MeshNormalMaterial,MeshPhongMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshToonMaterial,MinEquation,MirroredRepeatWrapping,MixOperation,MultiplyBlending,MultiplyOperation,NearestFilter,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,NeverDepth,NeverStencilFunc,NoBlending,NoColorSpace:NoColorSpace$1,NoToneMapping,NormalAnimationBlendMode,NormalBlending,NotEqualDepth,NotEqualStencilFunc,NumberKeyframeTrack,Object3D,ObjectLoader,ObjectSpaceNormalMap,OctahedronBufferGeometry:OctahedronGeometry,OctahedronGeometry,OneFactor,OneMinusDstAlphaFactor,OneMinusDstColorFactor,OneMinusSrcAlphaFactor,OneMinusSrcColorFactor,OrthographicCamera,PCFShadowMap,PCFSoftShadowMap,PMREMGenerator,ParametricGeometry,Path:Path$1,PerspectiveCamera,Plane,PlaneBufferGeometry:PlaneGeometry,PlaneGeometry,PlaneHelper,PointLight,PointLightHelper,Points,PointsMaterial,PolarGridHelper,PolyhedronBufferGeometry:PolyhedronGeometry,PolyhedronGeometry,PositionalAudio,PropertyBinding,PropertyMixer,QuadraticBezierCurve,QuadraticBezierCurve3,Quaternion,QuaternionKeyframeTrack,QuaternionLinearInterpolant,REVISION,RGBADepthPacking,RGBAFormat,RGBAIntegerFormat,RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format,RGBA_BPTC_Format,RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format,RGBFormat,RGB_ETC1_Format,RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format,RGFormat,RGIntegerFormat,RawShaderMaterial,Ray,Raycaster,RectAreaLight,RedFormat,RedIntegerFormat,ReinhardToneMapping,RepeatWrapping,ReplaceStencilOp,ReverseSubtractEquation,RingBufferGeometry:RingGeometry,RingGeometry,SRGBColorSpace:SRGBColorSpace$1,Scene,ShaderChunk,ShaderLib,ShaderMaterial,ShadowMaterial,Shape:Shape$1,ShapeBufferGeometry:ShapeGeometry,ShapeGeometry,ShapePath,ShapeUtils,ShortType,Skeleton:Skeleton$2,SkeletonHelper,SkinnedMesh,SmoothShading,Source:Source$1,Sphere,SphereBufferGeometry:SphereGeometry,SphereGeometry,Spherical,SphericalHarmonics3,SplineCurve,SpotLight,SpotLightHelper,Sprite,SpriteMaterial,SrcAlphaFactor,SrcAlphaSaturateFactor,SrcColorFactor,StaticCopyUsage,StaticDrawUsage,StaticReadUsage,StereoCamera,StreamCopyUsage,StreamDrawUsage,StreamReadUsage,StringKeyframeTrack,SubtractEquation,SubtractiveBlending,TOUCH,TangentSpaceNormalMap,TetrahedronBufferGeometry:TetrahedronGeometry,TetrahedronGeometry,TextGeometry,Texture,TextureLoader,TorusBufferGeometry:TorusGeometry,TorusGeometry,TorusKnotBufferGeometry:TorusKnotGeometry,TorusKnotGeometry,Triangle,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,TubeBufferGeometry:TubeGeometry,TubeGeometry,UVMapping,Uint16BufferAttribute,Uint32BufferAttribute,Uint8BufferAttribute,Uint8ClampedBufferAttribute,Uniform,UniformsGroup,UniformsLib,UniformsUtils,UnsignedByteType,UnsignedInt248Type,UnsignedIntType,UnsignedShort4444Type,UnsignedShort5551Type,UnsignedShortType,VSMShadowMap,Vector2,Vector3,Vector4,VectorKeyframeTrack,VideoTexture,WebGL1Renderer,WebGL3DRenderTarget,WebGLArrayRenderTarget,WebGLCubeRenderTarget,WebGLMultipleRenderTargets,WebGLMultisampleRenderTarget,WebGLRenderTarget,WebGLRenderer,WebGLUtils,WireframeGeometry,WrapAroundEnding,ZeroCurvatureEnding,ZeroFactor,ZeroSlopeEnding,ZeroStencilOp,_SRGBAFormat,sRGBEncoding},Symbol.toStringTag,{value:"Module"})),createStoreImpl=tt=>{let et;const nt=new Set,it=(lt,ct)=>{const ut=typeof lt=="function"?lt(et):lt;if(!Object.is(ut,et)){const ht=et;et=ct??(typeof ut!="object"||ut===null)?ut:Object.assign({},et,ut),nt.forEach(dt=>dt(et,ht))}},rt=()=>et,st={setState:it,getState:rt,subscribe:lt=>(nt.add(lt),()=>nt.delete(lt)),destroy:()=>{nt.clear()}};return et=tt(it,rt,st),st},createStore$3=tt=>tt?createStoreImpl(tt):createStoreImpl;var withSelector={exports:{}},withSelector_production_min={},shim$2={exports:{}},useSyncExternalStoreShim_production_min={};/** +}`;function WebGLShadowMap(tt,et,nt){let it=new Frustum;const rt=new Vector2,ot=new Vector2,at=new Vector4,st=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),lt=new MeshDistanceMaterial,ct={},ut=nt.maxTextureSize,ht={0:BackSide,1:FrontSide,2:DoubleSide},dt=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:vertex,fragmentShader:fragment}),pt=dt.clone();pt.defines.HORIZONTAL_PASS=1;const mt=new BufferGeometry;mt.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const gt=new Mesh(mt,dt),bt=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap,this.render=function(xt,St,Et){if(bt.enabled===!1||bt.autoUpdate===!1&&bt.needsUpdate===!1||xt.length===0)return;const $t=tt.getRenderTarget(),It=tt.getActiveCubeFace(),Ft=tt.getActiveMipmapLevel(),Ht=tt.state;Ht.setBlending(NoBlending),Ht.buffers.color.setClear(1,1,1,1),Ht.buffers.depth.setTest(!0),Ht.setScissorTest(!1);for(let zt=0,Ot=xt.length;ztut||rt.y>ut)&&(rt.x>ut&&(ot.x=Math.floor(ut/Tt.x),rt.x=ot.x*Tt.x,kt.mapSize.x=ot.x),rt.y>ut&&(ot.y=Math.floor(ut/Tt.y),rt.y=ot.y*Tt.y,kt.mapSize.y=ot.y)),kt.map===null){const Ut=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};kt.map=new WebGLRenderTarget(rt.x,rt.y,Ut),kt.map.texture.name=jt.name+".shadowMap",kt.camera.updateProjectionMatrix()}tt.setRenderTarget(kt.map),tt.clear();const Ct=kt.getViewportCount();for(let Ut=0;Ut0){const Ot=Ht.uuid,jt=St.uuid;let kt=ct[Ot];kt===void 0&&(kt={},ct[Ot]=kt);let Tt=kt[jt];Tt===void 0&&(Tt=Ht.clone(),kt[jt]=Tt),Ht=Tt}return Ht.visible=St.visible,Ht.wireframe=St.wireframe,Ft===VSMShadowMap?Ht.side=St.shadowSide!==null?St.shadowSide:St.side:Ht.side=St.shadowSide!==null?St.shadowSide:ht[St.side],Ht.alphaMap=St.alphaMap,Ht.alphaTest=St.alphaTest,Ht.clipShadows=St.clipShadows,Ht.clippingPlanes=St.clippingPlanes,Ht.clipIntersection=St.clipIntersection,Ht.displacementMap=St.displacementMap,Ht.displacementScale=St.displacementScale,Ht.displacementBias=St.displacementBias,Ht.wireframeLinewidth=St.wireframeLinewidth,Ht.linewidth=St.linewidth,Et.isPointLight===!0&&Ht.isMeshDistanceMaterial===!0&&(Ht.referencePosition.setFromMatrixPosition(Et.matrixWorld),Ht.nearDistance=$t,Ht.farDistance=It),Ht}function vt(xt,St,Et,$t,It){if(xt.visible===!1)return;if(xt.layers.test(St.layers)&&(xt.isMesh||xt.isLine||xt.isPoints)&&(xt.castShadow||xt.receiveShadow&&It===VSMShadowMap)&&(!xt.frustumCulled||it.intersectsObject(xt))){xt.modelViewMatrix.multiplyMatrices(Et.matrixWorldInverse,xt.matrixWorld);const zt=et.update(xt),Ot=xt.material;if(Array.isArray(Ot)){const jt=zt.groups;for(let kt=0,Tt=jt.length;kt=1):Nt.indexOf("OpenGL ES")!==-1&&(Ut=parseFloat(/^OpenGL ES (\d)/.exec(Nt)[1]),Ct=Ut>=2);let Bt=null,Mt={};const Dt=tt.getParameter(3088),Pt=tt.getParameter(2978),Vt=new Vector4().fromArray(Dt),nn=new Vector4().fromArray(Pt);function cn(Fn,Jn,Vn){const dr=new Uint8Array(4),ur=tt.createTexture();tt.bindTexture(Fn,ur),tt.texParameteri(Fn,10241,9728),tt.texParameteri(Fn,10240,9728);for(let _r=0;_rrn||yn.height>rn)&&(Sn=rn/Math.max(yn.width,yn.height)),Sn<1||dn===!0)if(typeof HTMLImageElement<"u"&&yn instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&yn instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&yn instanceof ImageBitmap){const tn=dn?floorPowerOfTwo:Math.floor,qt=tn(Sn*yn.width),Kt=tn(Sn*yn.height);gt===void 0&&(gt=wt(qt,Kt));const wn=sn?wt(qt,Kt):gt;return wn.width=qt,wn.height=Kt,wn.getContext("2d").drawImage(yn,0,0,qt,Kt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+yn.width+"x"+yn.height+") to ("+qt+"x"+Kt+")."),wn}else return"data"in yn&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+yn.width+"x"+yn.height+")."),yn;return yn}function xt(yn){return isPowerOfTwo(yn.width)&&isPowerOfTwo(yn.height)}function St(yn){return st?!1:yn.wrapS!==ClampToEdgeWrapping||yn.wrapT!==ClampToEdgeWrapping||yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter}function Et(yn,dn){return yn.generateMipmaps&&dn&&yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter}function $t(yn){tt.generateMipmap(yn)}function It(yn,dn,sn,rn,Sn=!1){if(st===!1)return dn;if(yn!==null){if(tt[yn]!==void 0)return tt[yn];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+yn+"'")}let tn=dn;return dn===6403&&(sn===5126&&(tn=33326),sn===5131&&(tn=33325),sn===5121&&(tn=33321)),dn===33319&&(sn===5126&&(tn=33328),sn===5131&&(tn=33327),sn===5121&&(tn=33323)),dn===6408&&(sn===5126&&(tn=34836),sn===5131&&(tn=34842),sn===5121&&(tn=rn===sRGBEncoding&&Sn===!1?35907:32856),sn===32819&&(tn=32854),sn===32820&&(tn=32855)),(tn===33325||tn===33326||tn===33327||tn===33328||tn===34842||tn===34836)&&et.get("EXT_color_buffer_float"),tn}function Ft(yn,dn,sn){return Et(yn,sn)===!0||yn.isFramebufferTexture&&yn.minFilter!==NearestFilter&&yn.minFilter!==LinearFilter?Math.log2(Math.max(dn.width,dn.height))+1:yn.mipmaps!==void 0&&yn.mipmaps.length>0?yn.mipmaps.length:yn.isCompressedTexture&&Array.isArray(yn.image)?dn.mipmaps.length:1}function Ht(yn){return yn===NearestFilter||yn===NearestMipmapNearestFilter||yn===NearestMipmapLinearFilter?9728:9729}function zt(yn){const dn=yn.target;dn.removeEventListener("dispose",zt),jt(dn),dn.isVideoTexture&&mt.delete(dn)}function Ot(yn){const dn=yn.target;dn.removeEventListener("dispose",Ot),Tt(dn)}function jt(yn){const dn=it.get(yn);if(dn.__webglInit===void 0)return;const sn=yn.source,rn=bt.get(sn);if(rn){const Sn=rn[dn.__cacheKey];Sn.usedTimes--,Sn.usedTimes===0&&kt(yn),Object.keys(rn).length===0&&bt.delete(sn)}it.remove(yn)}function kt(yn){const dn=it.get(yn);tt.deleteTexture(dn.__webglTexture);const sn=yn.source,rn=bt.get(sn);delete rn[dn.__cacheKey],at.memory.textures--}function Tt(yn){const dn=yn.texture,sn=it.get(yn),rn=it.get(dn);if(rn.__webglTexture!==void 0&&(tt.deleteTexture(rn.__webglTexture),at.memory.textures--),yn.depthTexture&&yn.depthTexture.dispose(),yn.isWebGLCubeRenderTarget)for(let Sn=0;Sn<6;Sn++)tt.deleteFramebuffer(sn.__webglFramebuffer[Sn]),sn.__webglDepthbuffer&&tt.deleteRenderbuffer(sn.__webglDepthbuffer[Sn]);else{if(tt.deleteFramebuffer(sn.__webglFramebuffer),sn.__webglDepthbuffer&&tt.deleteRenderbuffer(sn.__webglDepthbuffer),sn.__webglMultisampledFramebuffer&&tt.deleteFramebuffer(sn.__webglMultisampledFramebuffer),sn.__webglColorRenderbuffer)for(let Sn=0;Sn=lt&&console.warn("THREE.WebGLTextures: Trying to use "+yn+" texture units while this GPU supports only "+lt),Ct+=1,yn}function Bt(yn){const dn=[];return dn.push(yn.wrapS),dn.push(yn.wrapT),dn.push(yn.magFilter),dn.push(yn.minFilter),dn.push(yn.anisotropy),dn.push(yn.internalFormat),dn.push(yn.format),dn.push(yn.type),dn.push(yn.generateMipmaps),dn.push(yn.premultiplyAlpha),dn.push(yn.flipY),dn.push(yn.unpackAlignment),dn.push(yn.encoding),dn.join()}function Mt(yn,dn){const sn=it.get(yn);if(yn.isVideoTexture&&gn(yn),yn.isRenderTargetTexture===!1&&yn.version>0&&sn.__version!==yn.version){const rn=yn.image;if(rn===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(rn.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{en(sn,yn,dn);return}}nt.activeTexture(33984+dn),nt.bindTexture(3553,sn.__webglTexture)}function Dt(yn,dn){const sn=it.get(yn);if(yn.version>0&&sn.__version!==yn.version){en(sn,yn,dn);return}nt.activeTexture(33984+dn),nt.bindTexture(35866,sn.__webglTexture)}function Pt(yn,dn){const sn=it.get(yn);if(yn.version>0&&sn.__version!==yn.version){en(sn,yn,dn);return}nt.activeTexture(33984+dn),nt.bindTexture(32879,sn.__webglTexture)}function Vt(yn,dn){const sn=it.get(yn);if(yn.version>0&&sn.__version!==yn.version){fn(sn,yn,dn);return}nt.activeTexture(33984+dn),nt.bindTexture(34067,sn.__webglTexture)}const nn={[RepeatWrapping]:10497,[ClampToEdgeWrapping]:33071,[MirroredRepeatWrapping]:33648},cn={[NearestFilter]:9728,[NearestMipmapNearestFilter]:9984,[NearestMipmapLinearFilter]:9986,[LinearFilter]:9729,[LinearMipmapNearestFilter]:9985,[LinearMipmapLinearFilter]:9987};function Xt(yn,dn,sn){if(sn?(tt.texParameteri(yn,10242,nn[dn.wrapS]),tt.texParameteri(yn,10243,nn[dn.wrapT]),(yn===32879||yn===35866)&&tt.texParameteri(yn,32882,nn[dn.wrapR]),tt.texParameteri(yn,10240,cn[dn.magFilter]),tt.texParameteri(yn,10241,cn[dn.minFilter])):(tt.texParameteri(yn,10242,33071),tt.texParameteri(yn,10243,33071),(yn===32879||yn===35866)&&tt.texParameteri(yn,32882,33071),(dn.wrapS!==ClampToEdgeWrapping||dn.wrapT!==ClampToEdgeWrapping)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),tt.texParameteri(yn,10240,Ht(dn.magFilter)),tt.texParameteri(yn,10241,Ht(dn.minFilter)),dn.minFilter!==NearestFilter&&dn.minFilter!==LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),et.has("EXT_texture_filter_anisotropic")===!0){const rn=et.get("EXT_texture_filter_anisotropic");if(dn.type===FloatType&&et.has("OES_texture_float_linear")===!1||st===!1&&dn.type===HalfFloatType&&et.has("OES_texture_half_float_linear")===!1)return;(dn.anisotropy>1||it.get(dn).__currentAnisotropy)&&(tt.texParameterf(yn,rn.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(dn.anisotropy,rt.getMaxAnisotropy())),it.get(dn).__currentAnisotropy=dn.anisotropy)}}function un(yn,dn){let sn=!1;yn.__webglInit===void 0&&(yn.__webglInit=!0,dn.addEventListener("dispose",zt));const rn=dn.source;let Sn=bt.get(rn);Sn===void 0&&(Sn={},bt.set(rn,Sn));const tn=Bt(dn);if(tn!==yn.__cacheKey){Sn[tn]===void 0&&(Sn[tn]={texture:tt.createTexture(),usedTimes:0},at.memory.textures++,sn=!0),Sn[tn].usedTimes++;const qt=Sn[yn.__cacheKey];qt!==void 0&&(Sn[yn.__cacheKey].usedTimes--,qt.usedTimes===0&&kt(dn)),yn.__cacheKey=tn,yn.__webglTexture=Sn[tn].texture}return sn}function en(yn,dn,sn){let rn=3553;dn.isDataArrayTexture&&(rn=35866),dn.isData3DTexture&&(rn=32879);const Sn=un(yn,dn),tn=dn.source;if(nt.activeTexture(33984+sn),nt.bindTexture(rn,yn.__webglTexture),tn.version!==tn.__currentVersion||Sn===!0){tt.pixelStorei(37440,dn.flipY),tt.pixelStorei(37441,dn.premultiplyAlpha),tt.pixelStorei(3317,dn.unpackAlignment),tt.pixelStorei(37443,0);const qt=St(dn)&&xt(dn.image)===!1;let Kt=vt(dn.image,qt,!1,ut);Kt=Tn(dn,Kt);const wn=xt(Kt)||st,Rn=ot.convert(dn.format,dn.encoding);let jn=ot.convert(dn.type),Bn=It(dn.internalFormat,Rn,jn,dn.encoding,dn.isVideoTexture);Xt(rn,dn,wn);let Xn;const Wn=dn.mipmaps,Gn=st&&dn.isVideoTexture!==!0,Fn=tn.__currentVersion===void 0||Sn===!0,Jn=Ft(dn,Kt,wn);if(dn.isDepthTexture)Bn=6402,st?dn.type===FloatType?Bn=36012:dn.type===UnsignedIntType?Bn=33190:dn.type===UnsignedInt248Type?Bn=35056:Bn=33189:dn.type===FloatType&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),dn.format===DepthFormat&&Bn===6402&&dn.type!==UnsignedShortType&&dn.type!==UnsignedIntType&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),dn.type=UnsignedIntType,jn=ot.convert(dn.type)),dn.format===DepthStencilFormat&&Bn===6402&&(Bn=34041,dn.type!==UnsignedInt248Type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),dn.type=UnsignedInt248Type,jn=ot.convert(dn.type))),Fn&&(Gn?nt.texStorage2D(3553,1,Bn,Kt.width,Kt.height):nt.texImage2D(3553,0,Bn,Kt.width,Kt.height,0,Rn,jn,null));else if(dn.isDataTexture)if(Wn.length>0&&wn){Gn&&Fn&&nt.texStorage2D(3553,Jn,Bn,Wn[0].width,Wn[0].height);for(let Vn=0,dr=Wn.length;Vn>=1,dr>>=1}}else if(Wn.length>0&&wn){Gn&&Fn&&nt.texStorage2D(3553,Jn,Bn,Wn[0].width,Wn[0].height);for(let Vn=0,dr=Wn.length;Vn0&&Fn++,nt.texStorage2D(34067,Fn,Xn,Kt[0].width,Kt[0].height));for(let Vn=0;Vn<6;Vn++)if(qt){Wn?nt.texSubImage2D(34069+Vn,0,0,0,Kt[Vn].width,Kt[Vn].height,jn,Bn,Kt[Vn].data):nt.texImage2D(34069+Vn,0,Xn,Kt[Vn].width,Kt[Vn].height,0,jn,Bn,Kt[Vn].data);for(let dr=0;dr0&&An(yn)===!1){const Kt=tn?dn:[dn];sn.__webglMultisampledFramebuffer=tt.createFramebuffer(),sn.__webglColorRenderbuffer=[],nt.bindFramebuffer(36160,sn.__webglMultisampledFramebuffer);for(let wn=0;wn0&&An(yn)===!1){const dn=yn.isWebGLMultipleRenderTargets?yn.texture:[yn.texture],sn=yn.width,rn=yn.height;let Sn=16384;const tn=[],qt=yn.stencilBuffer?33306:36096,Kt=it.get(yn),wn=yn.isWebGLMultipleRenderTargets===!0;if(wn)for(let Rn=0;Rn0&&et.has("WEBGL_multisampled_render_to_texture")===!0&&dn.__useRenderToTexture!==!1}function gn(yn){const dn=at.render.frame;mt.get(yn)!==dn&&(mt.set(yn,dn),yn.update())}function Tn(yn,dn){const sn=yn.encoding,rn=yn.format,Sn=yn.type;return yn.isCompressedTexture===!0||yn.isVideoTexture===!0||yn.format===_SRGBAFormat||sn!==LinearEncoding&&(sn===sRGBEncoding?st===!1?et.has("EXT_sRGB")===!0&&rn===RGBAFormat?(yn.format=_SRGBAFormat,yn.minFilter=LinearFilter,yn.generateMipmaps=!1):dn=ImageUtils.sRGBToLinear(dn):(rn!==RGBAFormat||Sn!==UnsignedByteType)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",sn)),dn}this.allocateTextureUnit=Nt,this.resetTextureUnits=Ut,this.setTexture2D=Mt,this.setTexture2DArray=Dt,this.setTexture3D=Pt,this.setTextureCube=Vt,this.rebindTextures=In,this.setupRenderTarget=Cn,this.updateRenderTargetMipmap=Nn,this.updateMultisampleRenderTarget=Un,this.setupDepthRenderbuffer=En,this.setupFrameBufferTexture=xn,this.useMultisampledRTT=An}function WebGLUtils(tt,et,nt){const it=nt.isWebGL2;function rt(ot,at=null){let st;if(ot===UnsignedByteType)return 5121;if(ot===UnsignedShort4444Type)return 32819;if(ot===UnsignedShort5551Type)return 32820;if(ot===ByteType)return 5120;if(ot===ShortType)return 5122;if(ot===UnsignedShortType)return 5123;if(ot===IntType)return 5124;if(ot===UnsignedIntType)return 5125;if(ot===FloatType)return 5126;if(ot===HalfFloatType)return it?5131:(st=et.get("OES_texture_half_float"),st!==null?st.HALF_FLOAT_OES:null);if(ot===AlphaFormat)return 6406;if(ot===RGBAFormat)return 6408;if(ot===LuminanceFormat)return 6409;if(ot===LuminanceAlphaFormat)return 6410;if(ot===DepthFormat)return 6402;if(ot===DepthStencilFormat)return 34041;if(ot===RedFormat)return 6403;if(ot===RGBFormat)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(ot===_SRGBAFormat)return st=et.get("EXT_sRGB"),st!==null?st.SRGB_ALPHA_EXT:null;if(ot===RedIntegerFormat)return 36244;if(ot===RGFormat)return 33319;if(ot===RGIntegerFormat)return 33320;if(ot===RGBAIntegerFormat)return 36249;if(ot===RGB_S3TC_DXT1_Format||ot===RGBA_S3TC_DXT1_Format||ot===RGBA_S3TC_DXT3_Format||ot===RGBA_S3TC_DXT5_Format)if(at===sRGBEncoding)if(st=et.get("WEBGL_compressed_texture_s3tc_srgb"),st!==null){if(ot===RGB_S3TC_DXT1_Format)return st.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT1_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT3_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(ot===RGBA_S3TC_DXT5_Format)return st.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(st=et.get("WEBGL_compressed_texture_s3tc"),st!==null){if(ot===RGB_S3TC_DXT1_Format)return st.COMPRESSED_RGB_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT1_Format)return st.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(ot===RGBA_S3TC_DXT3_Format)return st.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(ot===RGBA_S3TC_DXT5_Format)return st.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(ot===RGB_PVRTC_4BPPV1_Format||ot===RGB_PVRTC_2BPPV1_Format||ot===RGBA_PVRTC_4BPPV1_Format||ot===RGBA_PVRTC_2BPPV1_Format)if(st=et.get("WEBGL_compressed_texture_pvrtc"),st!==null){if(ot===RGB_PVRTC_4BPPV1_Format)return st.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(ot===RGB_PVRTC_2BPPV1_Format)return st.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(ot===RGBA_PVRTC_4BPPV1_Format)return st.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(ot===RGBA_PVRTC_2BPPV1_Format)return st.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(ot===RGB_ETC1_Format)return st=et.get("WEBGL_compressed_texture_etc1"),st!==null?st.COMPRESSED_RGB_ETC1_WEBGL:null;if(ot===RGB_ETC2_Format||ot===RGBA_ETC2_EAC_Format)if(st=et.get("WEBGL_compressed_texture_etc"),st!==null){if(ot===RGB_ETC2_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ETC2:st.COMPRESSED_RGB8_ETC2;if(ot===RGBA_ETC2_EAC_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:st.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(ot===RGBA_ASTC_4x4_Format||ot===RGBA_ASTC_5x4_Format||ot===RGBA_ASTC_5x5_Format||ot===RGBA_ASTC_6x5_Format||ot===RGBA_ASTC_6x6_Format||ot===RGBA_ASTC_8x5_Format||ot===RGBA_ASTC_8x6_Format||ot===RGBA_ASTC_8x8_Format||ot===RGBA_ASTC_10x5_Format||ot===RGBA_ASTC_10x6_Format||ot===RGBA_ASTC_10x8_Format||ot===RGBA_ASTC_10x10_Format||ot===RGBA_ASTC_12x10_Format||ot===RGBA_ASTC_12x12_Format)if(st=et.get("WEBGL_compressed_texture_astc"),st!==null){if(ot===RGBA_ASTC_4x4_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:st.COMPRESSED_RGBA_ASTC_4x4_KHR;if(ot===RGBA_ASTC_5x4_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:st.COMPRESSED_RGBA_ASTC_5x4_KHR;if(ot===RGBA_ASTC_5x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:st.COMPRESSED_RGBA_ASTC_5x5_KHR;if(ot===RGBA_ASTC_6x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:st.COMPRESSED_RGBA_ASTC_6x5_KHR;if(ot===RGBA_ASTC_6x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:st.COMPRESSED_RGBA_ASTC_6x6_KHR;if(ot===RGBA_ASTC_8x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:st.COMPRESSED_RGBA_ASTC_8x5_KHR;if(ot===RGBA_ASTC_8x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:st.COMPRESSED_RGBA_ASTC_8x6_KHR;if(ot===RGBA_ASTC_8x8_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:st.COMPRESSED_RGBA_ASTC_8x8_KHR;if(ot===RGBA_ASTC_10x5_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:st.COMPRESSED_RGBA_ASTC_10x5_KHR;if(ot===RGBA_ASTC_10x6_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:st.COMPRESSED_RGBA_ASTC_10x6_KHR;if(ot===RGBA_ASTC_10x8_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:st.COMPRESSED_RGBA_ASTC_10x8_KHR;if(ot===RGBA_ASTC_10x10_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:st.COMPRESSED_RGBA_ASTC_10x10_KHR;if(ot===RGBA_ASTC_12x10_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:st.COMPRESSED_RGBA_ASTC_12x10_KHR;if(ot===RGBA_ASTC_12x12_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:st.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(ot===RGBA_BPTC_Format)if(st=et.get("EXT_texture_compression_bptc"),st!==null){if(ot===RGBA_BPTC_Format)return at===sRGBEncoding?st.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:st.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return ot===UnsignedInt248Type?it?34042:(st=et.get("WEBGL_depth_texture"),st!==null?st.UNSIGNED_INT_24_8_WEBGL:null):tt[ot]!==void 0?tt[ot]:null}return{convert:rt}}class ArrayCamera extends PerspectiveCamera{constructor(et=[]){super(),this.isArrayCamera=!0,this.cameras=et}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const _moveEvent={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Group,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 Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(et){return this._targetRay!==null&&this._targetRay.dispatchEvent(et),this._grip!==null&&this._grip.dispatchEvent(et),this._hand!==null&&this._hand.dispatchEvent(et),this}disconnect(et){return this.dispatchEvent({type:"disconnected",data:et}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(et,nt,it){let rt=null,ot=null,at=null;const st=this._targetRay,lt=this._grip,ct=this._hand;if(et&&nt.session.visibilityState!=="visible-blurred"){if(ct&&et.hand){at=!0;for(const gt of et.hand.values()){const bt=nt.getJointPose(gt,it);if(ct.joints[gt.jointName]===void 0){const wt=new Group;wt.matrixAutoUpdate=!1,wt.visible=!1,ct.joints[gt.jointName]=wt,ct.add(wt)}const yt=ct.joints[gt.jointName];bt!==null&&(yt.matrix.fromArray(bt.transform.matrix),yt.matrix.decompose(yt.position,yt.rotation,yt.scale),yt.jointRadius=bt.radius),yt.visible=bt!==null}const ut=ct.joints["index-finger-tip"],ht=ct.joints["thumb-tip"],dt=ut.position.distanceTo(ht.position),pt=.02,mt=.005;ct.inputState.pinching&&dt>pt+mt?(ct.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:et.handedness,target:this})):!ct.inputState.pinching&&dt<=pt-mt&&(ct.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:et.handedness,target:this}))}else lt!==null&&et.gripSpace&&(ot=nt.getPose(et.gripSpace,it),ot!==null&&(lt.matrix.fromArray(ot.transform.matrix),lt.matrix.decompose(lt.position,lt.rotation,lt.scale),ot.linearVelocity?(lt.hasLinearVelocity=!0,lt.linearVelocity.copy(ot.linearVelocity)):lt.hasLinearVelocity=!1,ot.angularVelocity?(lt.hasAngularVelocity=!0,lt.angularVelocity.copy(ot.angularVelocity)):lt.hasAngularVelocity=!1));st!==null&&(rt=nt.getPose(et.targetRaySpace,it),rt===null&&ot!==null&&(rt=ot),rt!==null&&(st.matrix.fromArray(rt.transform.matrix),st.matrix.decompose(st.position,st.rotation,st.scale),rt.linearVelocity?(st.hasLinearVelocity=!0,st.linearVelocity.copy(rt.linearVelocity)):st.hasLinearVelocity=!1,rt.angularVelocity?(st.hasAngularVelocity=!0,st.angularVelocity.copy(rt.angularVelocity)):st.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent)))}return st!==null&&(st.visible=rt!==null),lt!==null&&(lt.visible=ot!==null),ct!==null&&(ct.visible=at!==null),this}}class DepthTexture extends Texture{constructor(et,nt,it,rt,ot,at,st,lt,ct,ut){if(ut=ut!==void 0?ut:DepthFormat,ut!==DepthFormat&&ut!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");it===void 0&&ut===DepthFormat&&(it=UnsignedIntType),it===void 0&&ut===DepthStencilFormat&&(it=UnsignedInt248Type),super(null,rt,ot,at,st,lt,ut,it,ct),this.isDepthTexture=!0,this.image={width:et,height:nt},this.magFilter=st!==void 0?st:NearestFilter,this.minFilter=lt!==void 0?lt:NearestFilter,this.flipY=!1,this.generateMipmaps=!1}}class WebXRManager extends EventDispatcher$1{constructor(et,nt){super();const it=this;let rt=null,ot=1,at=null,st="local-floor",lt=null,ct=null,ut=null,ht=null,dt=null,pt=null;const mt=nt.getContextAttributes();let gt=null,bt=null;const yt=[],wt=[],vt=new PerspectiveCamera;vt.layers.enable(1),vt.viewport=new Vector4;const xt=new PerspectiveCamera;xt.layers.enable(2),xt.viewport=new Vector4;const St=[vt,xt],Et=new ArrayCamera;Et.layers.enable(1),Et.layers.enable(2);let $t=null,It=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Bt){let Mt=yt[Bt];return Mt===void 0&&(Mt=new WebXRController,yt[Bt]=Mt),Mt.getTargetRaySpace()},this.getControllerGrip=function(Bt){let Mt=yt[Bt];return Mt===void 0&&(Mt=new WebXRController,yt[Bt]=Mt),Mt.getGripSpace()},this.getHand=function(Bt){let Mt=yt[Bt];return Mt===void 0&&(Mt=new WebXRController,yt[Bt]=Mt),Mt.getHandSpace()};function Ft(Bt){const Mt=wt.indexOf(Bt.inputSource);if(Mt===-1)return;const Dt=yt[Mt];Dt!==void 0&&Dt.dispatchEvent({type:Bt.type,data:Bt.inputSource})}function Ht(){rt.removeEventListener("select",Ft),rt.removeEventListener("selectstart",Ft),rt.removeEventListener("selectend",Ft),rt.removeEventListener("squeeze",Ft),rt.removeEventListener("squeezestart",Ft),rt.removeEventListener("squeezeend",Ft),rt.removeEventListener("end",Ht),rt.removeEventListener("inputsourceschange",zt);for(let Bt=0;Bt=0&&(wt[Pt]=null,yt[Pt].dispatchEvent({type:"disconnected",data:Dt}))}for(let Mt=0;Mt=wt.length){wt.push(Dt),Pt=nn;break}else if(wt[nn]===null){wt[nn]=Dt,Pt=nn;break}if(Pt===-1)break}const Vt=yt[Pt];Vt&&Vt.dispatchEvent({type:"connected",data:Dt})}}const Ot=new Vector3,jt=new Vector3;function kt(Bt,Mt,Dt){Ot.setFromMatrixPosition(Mt.matrixWorld),jt.setFromMatrixPosition(Dt.matrixWorld);const Pt=Ot.distanceTo(jt),Vt=Mt.projectionMatrix.elements,nn=Dt.projectionMatrix.elements,cn=Vt[14]/(Vt[10]-1),Xt=Vt[14]/(Vt[10]+1),un=(Vt[9]+1)/Vt[5],en=(Vt[9]-1)/Vt[5],fn=(Vt[8]-1)/Vt[0],xn=(nn[8]+1)/nn[0],an=cn*fn,Zt=cn*xn,En=Pt/(-fn+xn),In=En*-fn;Mt.matrixWorld.decompose(Bt.position,Bt.quaternion,Bt.scale),Bt.translateX(In),Bt.translateZ(En),Bt.matrixWorld.compose(Bt.position,Bt.quaternion,Bt.scale),Bt.matrixWorldInverse.copy(Bt.matrixWorld).invert();const Cn=cn+En,Nn=Xt+En,Un=an-In,_n=Zt+(Pt-In),An=un*Xt/Nn*Cn,gn=en*Xt/Nn*Cn;Bt.projectionMatrix.makePerspective(Un,_n,An,gn,Cn,Nn)}function Tt(Bt,Mt){Mt===null?Bt.matrixWorld.copy(Bt.matrix):Bt.matrixWorld.multiplyMatrices(Mt.matrixWorld,Bt.matrix),Bt.matrixWorldInverse.copy(Bt.matrixWorld).invert()}this.updateCamera=function(Bt){if(rt===null)return;Et.near=xt.near=vt.near=Bt.near,Et.far=xt.far=vt.far=Bt.far,($t!==Et.near||It!==Et.far)&&(rt.updateRenderState({depthNear:Et.near,depthFar:Et.far}),$t=Et.near,It=Et.far);const Mt=Bt.parent,Dt=Et.cameras;Tt(Et,Mt);for(let Vt=0;Vt0&&(gt.alphaTest.value=bt.alphaTest);const yt=et.get(bt).envMap;if(yt&&(gt.envMap.value=yt,gt.flipEnvMap.value=yt.isCubeTexture&&yt.isRenderTargetTexture===!1?-1:1,gt.reflectivity.value=bt.reflectivity,gt.ior.value=bt.ior,gt.refractionRatio.value=bt.refractionRatio),bt.lightMap){gt.lightMap.value=bt.lightMap;const xt=tt.physicallyCorrectLights!==!0?Math.PI:1;gt.lightMapIntensity.value=bt.lightMapIntensity*xt}bt.aoMap&&(gt.aoMap.value=bt.aoMap,gt.aoMapIntensity.value=bt.aoMapIntensity);let wt;bt.map?wt=bt.map:bt.specularMap?wt=bt.specularMap:bt.displacementMap?wt=bt.displacementMap:bt.normalMap?wt=bt.normalMap:bt.bumpMap?wt=bt.bumpMap:bt.roughnessMap?wt=bt.roughnessMap:bt.metalnessMap?wt=bt.metalnessMap:bt.alphaMap?wt=bt.alphaMap:bt.emissiveMap?wt=bt.emissiveMap:bt.clearcoatMap?wt=bt.clearcoatMap:bt.clearcoatNormalMap?wt=bt.clearcoatNormalMap:bt.clearcoatRoughnessMap?wt=bt.clearcoatRoughnessMap:bt.iridescenceMap?wt=bt.iridescenceMap:bt.iridescenceThicknessMap?wt=bt.iridescenceThicknessMap:bt.specularIntensityMap?wt=bt.specularIntensityMap:bt.specularColorMap?wt=bt.specularColorMap:bt.transmissionMap?wt=bt.transmissionMap:bt.thicknessMap?wt=bt.thicknessMap:bt.sheenColorMap?wt=bt.sheenColorMap:bt.sheenRoughnessMap&&(wt=bt.sheenRoughnessMap),wt!==void 0&&(wt.isWebGLRenderTarget&&(wt=wt.texture),wt.matrixAutoUpdate===!0&&wt.updateMatrix(),gt.uvTransform.value.copy(wt.matrix));let vt;bt.aoMap?vt=bt.aoMap:bt.lightMap&&(vt=bt.lightMap),vt!==void 0&&(vt.isWebGLRenderTarget&&(vt=vt.texture),vt.matrixAutoUpdate===!0&&vt.updateMatrix(),gt.uv2Transform.value.copy(vt.matrix))}function ot(gt,bt){gt.diffuse.value.copy(bt.color),gt.opacity.value=bt.opacity}function at(gt,bt){gt.dashSize.value=bt.dashSize,gt.totalSize.value=bt.dashSize+bt.gapSize,gt.scale.value=bt.scale}function st(gt,bt,yt,wt){gt.diffuse.value.copy(bt.color),gt.opacity.value=bt.opacity,gt.size.value=bt.size*yt,gt.scale.value=wt*.5,bt.map&&(gt.map.value=bt.map),bt.alphaMap&&(gt.alphaMap.value=bt.alphaMap),bt.alphaTest>0&&(gt.alphaTest.value=bt.alphaTest);let vt;bt.map?vt=bt.map:bt.alphaMap&&(vt=bt.alphaMap),vt!==void 0&&(vt.matrixAutoUpdate===!0&&vt.updateMatrix(),gt.uvTransform.value.copy(vt.matrix))}function lt(gt,bt){gt.diffuse.value.copy(bt.color),gt.opacity.value=bt.opacity,gt.rotation.value=bt.rotation,bt.map&&(gt.map.value=bt.map),bt.alphaMap&&(gt.alphaMap.value=bt.alphaMap),bt.alphaTest>0&&(gt.alphaTest.value=bt.alphaTest);let yt;bt.map?yt=bt.map:bt.alphaMap&&(yt=bt.alphaMap),yt!==void 0&&(yt.matrixAutoUpdate===!0&&yt.updateMatrix(),gt.uvTransform.value.copy(yt.matrix))}function ct(gt,bt){gt.specular.value.copy(bt.specular),gt.shininess.value=Math.max(bt.shininess,1e-4)}function ut(gt,bt){bt.gradientMap&&(gt.gradientMap.value=bt.gradientMap)}function ht(gt,bt){gt.roughness.value=bt.roughness,gt.metalness.value=bt.metalness,bt.roughnessMap&&(gt.roughnessMap.value=bt.roughnessMap),bt.metalnessMap&&(gt.metalnessMap.value=bt.metalnessMap),et.get(bt).envMap&&(gt.envMapIntensity.value=bt.envMapIntensity)}function dt(gt,bt,yt){gt.ior.value=bt.ior,bt.sheen>0&&(gt.sheenColor.value.copy(bt.sheenColor).multiplyScalar(bt.sheen),gt.sheenRoughness.value=bt.sheenRoughness,bt.sheenColorMap&&(gt.sheenColorMap.value=bt.sheenColorMap),bt.sheenRoughnessMap&&(gt.sheenRoughnessMap.value=bt.sheenRoughnessMap)),bt.clearcoat>0&&(gt.clearcoat.value=bt.clearcoat,gt.clearcoatRoughness.value=bt.clearcoatRoughness,bt.clearcoatMap&&(gt.clearcoatMap.value=bt.clearcoatMap),bt.clearcoatRoughnessMap&&(gt.clearcoatRoughnessMap.value=bt.clearcoatRoughnessMap),bt.clearcoatNormalMap&&(gt.clearcoatNormalScale.value.copy(bt.clearcoatNormalScale),gt.clearcoatNormalMap.value=bt.clearcoatNormalMap,bt.side===BackSide&>.clearcoatNormalScale.value.negate())),bt.iridescence>0&&(gt.iridescence.value=bt.iridescence,gt.iridescenceIOR.value=bt.iridescenceIOR,gt.iridescenceThicknessMinimum.value=bt.iridescenceThicknessRange[0],gt.iridescenceThicknessMaximum.value=bt.iridescenceThicknessRange[1],bt.iridescenceMap&&(gt.iridescenceMap.value=bt.iridescenceMap),bt.iridescenceThicknessMap&&(gt.iridescenceThicknessMap.value=bt.iridescenceThicknessMap)),bt.transmission>0&&(gt.transmission.value=bt.transmission,gt.transmissionSamplerMap.value=yt.texture,gt.transmissionSamplerSize.value.set(yt.width,yt.height),bt.transmissionMap&&(gt.transmissionMap.value=bt.transmissionMap),gt.thickness.value=bt.thickness,bt.thicknessMap&&(gt.thicknessMap.value=bt.thicknessMap),gt.attenuationDistance.value=bt.attenuationDistance,gt.attenuationColor.value.copy(bt.attenuationColor)),gt.specularIntensity.value=bt.specularIntensity,gt.specularColor.value.copy(bt.specularColor),bt.specularIntensityMap&&(gt.specularIntensityMap.value=bt.specularIntensityMap),bt.specularColorMap&&(gt.specularColorMap.value=bt.specularColorMap)}function pt(gt,bt){bt.matcap&&(gt.matcap.value=bt.matcap)}function mt(gt,bt){gt.referencePosition.value.copy(bt.referencePosition),gt.nearDistance.value=bt.nearDistance,gt.farDistance.value=bt.farDistance}return{refreshFogUniforms:nt,refreshMaterialUniforms:it}}function WebGLUniformsGroups(tt,et,nt,it){let rt={},ot={},at=[];const st=nt.isWebGL2?tt.getParameter(35375):0;function lt(wt,vt){const xt=vt.program;it.uniformBlockBinding(wt,xt)}function ct(wt,vt){let xt=rt[wt.id];xt===void 0&&(mt(wt),xt=ut(wt),rt[wt.id]=xt,wt.addEventListener("dispose",bt));const St=vt.program;it.updateUBOMapping(wt,St);const Et=et.render.frame;ot[wt.id]!==Et&&(dt(wt),ot[wt.id]=Et)}function ut(wt){const vt=ht();wt.__bindingPointIndex=vt;const xt=tt.createBuffer(),St=wt.__size,Et=wt.usage;return tt.bindBuffer(35345,xt),tt.bufferData(35345,St,Et),tt.bindBuffer(35345,null),tt.bindBufferBase(35345,vt,xt),xt}function ht(){for(let wt=0;wt0){Et=xt%St;const zt=St-Et;Et!==0&&zt-Ht.boundary<0&&(xt+=St-Et,Ft.__offset=xt)}xt+=Ht.storage}return Et=xt%St,Et>0&&(xt+=St-Et),wt.__size=xt,wt.__cache={},this}function gt(wt){const vt=wt.value,xt={boundary:0,storage:0};return typeof vt=="number"?(xt.boundary=4,xt.storage=4):vt.isVector2?(xt.boundary=8,xt.storage=8):vt.isVector3||vt.isColor?(xt.boundary=16,xt.storage=12):vt.isVector4?(xt.boundary=16,xt.storage=16):vt.isMatrix3?(xt.boundary=48,xt.storage=48):vt.isMatrix4?(xt.boundary=64,xt.storage=64):vt.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",vt),xt}function bt(wt){const vt=wt.target;vt.removeEventListener("dispose",bt);const xt=at.indexOf(vt.__bindingPointIndex);at.splice(xt,1),tt.deleteBuffer(rt[vt.id]),delete rt[vt.id],delete ot[vt.id]}function yt(){for(const wt in rt)tt.deleteBuffer(rt[wt]);at=[],rt={},ot={}}return{bind:lt,update:ct,dispose:yt}}function createCanvasElement(){const tt=createElementNS("canvas");return tt.style.display="block",tt}function WebGLRenderer(tt={}){this.isWebGLRenderer=!0;const et=tt.canvas!==void 0?tt.canvas:createCanvasElement(),nt=tt.context!==void 0?tt.context:null,it=tt.depth!==void 0?tt.depth:!0,rt=tt.stencil!==void 0?tt.stencil:!0,ot=tt.antialias!==void 0?tt.antialias:!1,at=tt.premultipliedAlpha!==void 0?tt.premultipliedAlpha:!0,st=tt.preserveDrawingBuffer!==void 0?tt.preserveDrawingBuffer:!1,lt=tt.powerPreference!==void 0?tt.powerPreference:"default",ct=tt.failIfMajorPerformanceCaveat!==void 0?tt.failIfMajorPerformanceCaveat:!1;let ut;nt!==null?ut=nt.getContextAttributes().alpha:ut=tt.alpha!==void 0?tt.alpha:!1;let ht=null,dt=null;const pt=[],mt=[];this.domElement=et,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=LinearEncoding,this.physicallyCorrectLights=!1,this.toneMapping=NoToneMapping,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 gt=this;let bt=!1,yt=0,wt=0,vt=null,xt=-1,St=null;const Et=new Vector4,$t=new Vector4;let It=null,Ft=et.width,Ht=et.height,zt=1,Ot=null,jt=null;const kt=new Vector4(0,0,Ft,Ht),Tt=new Vector4(0,0,Ft,Ht);let Ct=!1;const Ut=new Frustum;let Nt=!1,Bt=!1,Mt=null;const Dt=new Matrix4,Pt=new Vector2,Vt=new Vector3,nn={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function cn(){return vt===null?zt:1}let Xt=nt;function un(hn,Jt){for(let kn=0;kn0?dt=mt[mt.length-1]:dt=null,pt.pop(),pt.length>0?ht=pt[pt.length-1]:ht=null};function Mr(hn,Jt,kn,On){if(hn.visible===!1)return;if(hn.layers.test(Jt.layers)){if(hn.isGroup)kn=hn.renderOrder;else if(hn.isLOD)hn.autoUpdate===!0&&hn.update(Jt);else if(hn.isLight)dt.pushLight(hn),hn.castShadow&&dt.pushShadow(hn);else if(hn.isSprite){if(!hn.frustumCulled||Ut.intersectsSprite(hn)){On&&Vt.setFromMatrixPosition(hn.matrixWorld).applyMatrix4(Dt);const er=_n.update(hn),or=hn.material;or.visible&&ht.push(hn,er,or,kn,Vt.z,null)}}else if((hn.isMesh||hn.isLine||hn.isPoints)&&(hn.isSkinnedMesh&&hn.skeleton.frame!==an.render.frame&&(hn.skeleton.update(),hn.skeleton.frame=an.render.frame),!hn.frustumCulled||Ut.intersectsObject(hn))){On&&Vt.setFromMatrixPosition(hn.matrixWorld).applyMatrix4(Dt);const er=_n.update(hn),or=hn.material;if(Array.isArray(or)){const ar=er.groups;for(let Vr=0,wr=ar.length;Vr0&&Ur(Dn,Jt,kn),On&&xn.viewport(Et.copy(On)),Dn.length>0&&Lr(Dn,Jt,kn),Yn.length>0&&Lr(Yn,Jt,kn),er.length>0&&Lr(er,Jt,kn),xn.buffers.depth.setTest(!0),xn.buffers.depth.setMask(!0),xn.buffers.color.setMask(!0),xn.setPolygonOffset(!1)}function Ur(hn,Jt,kn){const On=fn.isWebGL2;Mt===null&&(Mt=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:en.has("EXT_color_buffer_half_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:On&&ot===!0?4:0})),gt.getDrawingBufferSize(Pt),On?Mt.setSize(Pt.x,Pt.y):Mt.setSize(floorPowerOfTwo(Pt.x),floorPowerOfTwo(Pt.y));const Dn=gt.getRenderTarget();gt.setRenderTarget(Mt),gt.clear();const Yn=gt.toneMapping;gt.toneMapping=NoToneMapping,Lr(hn,Jt,kn),gt.toneMapping=Yn,En.updateMultisampleRenderTarget(Mt),En.updateRenderTargetMipmap(Mt),gt.setRenderTarget(Dn)}function Lr(hn,Jt,kn){const On=Jt.isScene===!0?Jt.overrideMaterial:null;for(let Dn=0,Yn=hn.length;Dn0&&En.useMultisampledRTT(hn)===!1?Dn=Zt.get(hn).__webglMultisampledFramebuffer:Dn=Vr,Et.copy(hn.viewport),$t.copy(hn.scissor),It=hn.scissorTest}else Et.copy(kt).multiplyScalar(zt).floor(),$t.copy(Tt).multiplyScalar(zt).floor(),It=Ct;if(xn.bindFramebuffer(36160,Dn)&&fn.drawBuffers&&On&&xn.drawBuffers(hn,Dn),xn.viewport(Et),xn.scissor($t),xn.setScissorTest(It),Yn){const ar=Zt.get(hn.texture);Xt.framebufferTexture2D(36160,36064,34069+Jt,ar.__webglTexture,kn)}else if(er){const ar=Zt.get(hn.texture),Vr=Jt||0;Xt.framebufferTextureLayer(36160,36064,ar.__webglTexture,kn||0,Vr)}xt=-1},this.readRenderTargetPixels=function(hn,Jt,kn,On,Dn,Yn,er){if(!(hn&&hn.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let or=Zt.get(hn).__webglFramebuffer;if(hn.isWebGLCubeRenderTarget&&er!==void 0&&(or=or[er]),or){xn.bindFramebuffer(36160,or);try{const ar=hn.texture,Vr=ar.format,wr=ar.type;if(Vr!==RGBAFormat&&Kt.convert(Vr)!==Xt.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const jr=wr===HalfFloatType&&(en.has("EXT_color_buffer_half_float")||fn.isWebGL2&&en.has("EXT_color_buffer_float"));if(wr!==UnsignedByteType&&Kt.convert(wr)!==Xt.getParameter(35738)&&!(wr===FloatType&&(fn.isWebGL2||en.has("OES_texture_float")||en.has("WEBGL_color_buffer_float")))&&!jr){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Jt>=0&&Jt<=hn.width-On&&kn>=0&&kn<=hn.height-Dn&&Xt.readPixels(Jt,kn,On,Dn,Kt.convert(Vr),Kt.convert(wr),Yn)}finally{const ar=vt!==null?Zt.get(vt).__webglFramebuffer:null;xn.bindFramebuffer(36160,ar)}}},this.copyFramebufferToTexture=function(hn,Jt,kn=0){const On=Math.pow(2,-kn),Dn=Math.floor(Jt.image.width*On),Yn=Math.floor(Jt.image.height*On);En.setTexture2D(Jt,0),Xt.copyTexSubImage2D(3553,kn,0,0,hn.x,hn.y,Dn,Yn),xn.unbindTexture()},this.copyTextureToTexture=function(hn,Jt,kn,On=0){const Dn=Jt.image.width,Yn=Jt.image.height,er=Kt.convert(kn.format),or=Kt.convert(kn.type);En.setTexture2D(kn,0),Xt.pixelStorei(37440,kn.flipY),Xt.pixelStorei(37441,kn.premultiplyAlpha),Xt.pixelStorei(3317,kn.unpackAlignment),Jt.isDataTexture?Xt.texSubImage2D(3553,On,hn.x,hn.y,Dn,Yn,er,or,Jt.image.data):Jt.isCompressedTexture?Xt.compressedTexSubImage2D(3553,On,hn.x,hn.y,Jt.mipmaps[0].width,Jt.mipmaps[0].height,er,Jt.mipmaps[0].data):Xt.texSubImage2D(3553,On,hn.x,hn.y,er,or,Jt.image),On===0&&kn.generateMipmaps&&Xt.generateMipmap(3553),xn.unbindTexture()},this.copyTextureToTexture3D=function(hn,Jt,kn,On,Dn=0){if(gt.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Yn=hn.max.x-hn.min.x+1,er=hn.max.y-hn.min.y+1,or=hn.max.z-hn.min.z+1,ar=Kt.convert(On.format),Vr=Kt.convert(On.type);let wr;if(On.isData3DTexture)En.setTexture3D(On,0),wr=32879;else if(On.isDataArrayTexture)En.setTexture2DArray(On,0),wr=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Xt.pixelStorei(37440,On.flipY),Xt.pixelStorei(37441,On.premultiplyAlpha),Xt.pixelStorei(3317,On.unpackAlignment);const jr=Xt.getParameter(3314),Hr=Xt.getParameter(32878),no=Xt.getParameter(3316),Xr=Xt.getParameter(3315),Jr=Xt.getParameter(32877),br=kn.isCompressedTexture?kn.mipmaps[0]:kn.image;Xt.pixelStorei(3314,br.width),Xt.pixelStorei(32878,br.height),Xt.pixelStorei(3316,hn.min.x),Xt.pixelStorei(3315,hn.min.y),Xt.pixelStorei(32877,hn.min.z),kn.isDataTexture||kn.isData3DTexture?Xt.texSubImage3D(wr,Dn,Jt.x,Jt.y,Jt.z,Yn,er,or,ar,Vr,br.data):kn.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Xt.compressedTexSubImage3D(wr,Dn,Jt.x,Jt.y,Jt.z,Yn,er,or,ar,br.data)):Xt.texSubImage3D(wr,Dn,Jt.x,Jt.y,Jt.z,Yn,er,or,ar,Vr,br),Xt.pixelStorei(3314,jr),Xt.pixelStorei(32878,Hr),Xt.pixelStorei(3316,no),Xt.pixelStorei(3315,Xr),Xt.pixelStorei(32877,Jr),Dn===0&&On.generateMipmaps&&Xt.generateMipmap(wr),xn.unbindTexture()},this.initTexture=function(hn){hn.isCubeTexture?En.setTextureCube(hn,0):hn.isData3DTexture?En.setTexture3D(hn,0):hn.isDataArrayTexture?En.setTexture2DArray(hn,0):En.setTexture2D(hn,0),xn.unbindTexture()},this.resetState=function(){yt=0,wt=0,vt=null,xn.reset(),wn.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class WebGL1Renderer extends WebGLRenderer{}WebGL1Renderer.prototype.isWebGL1Renderer=!0;class FogExp2{constructor(et,nt=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color$1(et),this.density=nt}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Fog{constructor(et,nt=1,it=1e3){this.isFog=!0,this.name="",this.color=new Color$1(et),this.near=nt,this.far=it}clone(){return new Fog(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Scene extends Object3D{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(et,nt){return super.copy(et,nt),et.background!==null&&(this.background=et.background.clone()),et.environment!==null&&(this.environment=et.environment.clone()),et.fog!==null&&(this.fog=et.fog.clone()),et.overrideMaterial!==null&&(this.overrideMaterial=et.overrideMaterial.clone()),this.autoUpdate=et.autoUpdate,this.matrixAutoUpdate=et.matrixAutoUpdate,this}toJSON(et){const nt=super.toJSON(et);return this.fog!==null&&(nt.object.fog=this.fog.toJSON()),nt}}class InterleavedBuffer{constructor(et,nt){this.isInterleavedBuffer=!0,this.array=et,this.stride=nt,this.count=et!==void 0?et.length/nt:0,this.usage=StaticDrawUsage,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=generateUUID$1()}onUploadCallback(){}set needsUpdate(et){et===!0&&this.version++}setUsage(et){return this.usage=et,this}copy(et){return this.array=new et.array.constructor(et.array),this.count=et.count,this.stride=et.stride,this.usage=et.usage,this}copyAt(et,nt,it){et*=this.stride,it*=nt.stride;for(let rt=0,ot=this.stride;rtet.far||nt.push({distance:lt,point:_intersectPoint.clone(),uv:Triangle.getUV(_intersectPoint,_vA,_vB,_vC,_uvA,_uvB,_uvC,new Vector2),face:null,object:this})}copy(et,nt){return super.copy(et,nt),et.center!==void 0&&this.center.copy(et.center),this.material=et.material,this}}function transformVertex(tt,et,nt,it,rt,ot){_alignedPosition.subVectors(tt,nt).addScalar(.5).multiply(it),rt!==void 0?(_rotatedPosition.x=ot*_alignedPosition.x-rt*_alignedPosition.y,_rotatedPosition.y=rt*_alignedPosition.x+ot*_alignedPosition.y):_rotatedPosition.copy(_alignedPosition),tt.copy(et),tt.x+=_rotatedPosition.x,tt.y+=_rotatedPosition.y,tt.applyMatrix4(_viewWorldMatrix)}const _v1$2=new Vector3,_v2$1=new Vector3;class LOD extends Object3D{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(et){super.copy(et,!1);const nt=et.levels;for(let it=0,rt=nt.length;it0){let it,rt;for(it=1,rt=nt.length;it0){_v1$2.setFromMatrixPosition(this.matrixWorld);const rt=et.ray.origin.distanceTo(_v1$2);this.getObjectForDistance(rt).raycast(et,nt)}}update(et){const nt=this.levels;if(nt.length>1){_v1$2.setFromMatrixPosition(et.matrixWorld),_v2$1.setFromMatrixPosition(this.matrixWorld);const it=_v1$2.distanceTo(_v2$1)/et.zoom;nt[0].object.visible=!0;let rt,ot;for(rt=1,ot=nt.length;rt=nt[rt].distance;rt++)nt[rt-1].object.visible=!1,nt[rt].object.visible=!0;for(this._currentLevel=rt-1;rtlt)continue;dt.applyMatrix4(this.matrixWorld);const It=et.ray.origin.distanceTo(dt);Itet.far||nt.push({distance:It,point:ht.clone().applyMatrix4(this.matrixWorld),index:vt,face:null,faceIndex:null,object:this})}}else{const yt=Math.max(0,at.start),wt=Math.min(bt.count,at.start+at.count);for(let vt=yt,xt=wt-1;vtlt)continue;dt.applyMatrix4(this.matrixWorld);const Et=et.ray.origin.distanceTo(dt);Etet.far||nt.push({distance:Et,point:ht.clone().applyMatrix4(this.matrixWorld),index:vt,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const nt=this.geometry.morphAttributes,it=Object.keys(nt);if(it.length>0){const rt=nt[it[0]];if(rt!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=rt.length;ot0){const rt=nt[it[0]];if(rt!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let ot=0,at=rt.length;otrt.far)return;ot.push({distance:ct,distanceToRay:Math.sqrt(st),point:lt,index:et,face:null,object:at})}}class VideoTexture extends Texture{constructor(et,nt,it,rt,ot,at,st,lt,ct){super(et,nt,it,rt,ot,at,st,lt,ct),this.isVideoTexture=!0,this.minFilter=at!==void 0?at:LinearFilter,this.magFilter=ot!==void 0?ot:LinearFilter,this.generateMipmaps=!1;const ut=this;function ht(){ut.needsUpdate=!0,et.requestVideoFrameCallback(ht)}"requestVideoFrameCallback"in et&&et.requestVideoFrameCallback(ht)}clone(){return new this.constructor(this.image).copy(this)}update(){const et=this.image;"requestVideoFrameCallback"in et===!1&&et.readyState>=et.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class FramebufferTexture extends Texture{constructor(et,nt,it){super({width:et,height:nt}),this.isFramebufferTexture=!0,this.format=it,this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.generateMipmaps=!1,this.needsUpdate=!0}}class CompressedTexture extends Texture{constructor(et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt){super(null,at,st,lt,ct,ut,rt,ot,ht,dt),this.isCompressedTexture=!0,this.image={width:nt,height:it},this.mipmaps=et,this.flipY=!1,this.generateMipmaps=!1}}class CanvasTexture extends Texture{constructor(et,nt,it,rt,ot,at,st,lt,ct){super(et,nt,it,rt,ot,at,st,lt,ct),this.isCanvasTexture=!0,this.needsUpdate=!0}}let Curve$1=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(et,nt){const it=this.getUtoTmapping(et);return this.getPoint(it,nt)}getPoints(et=5){const nt=[];for(let it=0;it<=et;it++)nt.push(this.getPoint(it/et));return nt}getSpacedPoints(et=5){const nt=[];for(let it=0;it<=et;it++)nt.push(this.getPointAt(it/et));return nt}getLength(){const et=this.getLengths();return et[et.length-1]}getLengths(et=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===et+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const nt=[];let it,rt=this.getPoint(0),ot=0;nt.push(0);for(let at=1;at<=et;at++)it=this.getPoint(at/et),ot+=it.distanceTo(rt),nt.push(ot),rt=it;return this.cacheArcLengths=nt,nt}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(et,nt){const it=this.getLengths();let rt=0;const ot=it.length;let at;nt?at=nt:at=et*it[ot-1];let st=0,lt=ot-1,ct;for(;st<=lt;)if(rt=Math.floor(st+(lt-st)/2),ct=it[rt]-at,ct<0)st=rt+1;else if(ct>0)lt=rt-1;else{lt=rt;break}if(rt=lt,it[rt]===at)return rt/(ot-1);const ut=it[rt],dt=it[rt+1]-ut,pt=(at-ut)/dt;return(rt+pt)/(ot-1)}getTangent(et,nt){let rt=et-1e-4,ot=et+1e-4;rt<0&&(rt=0),ot>1&&(ot=1);const at=this.getPoint(rt),st=this.getPoint(ot),lt=nt||(at.isVector2?new Vector2:new Vector3);return lt.copy(st).sub(at).normalize(),lt}getTangentAt(et,nt){const it=this.getUtoTmapping(et);return this.getTangent(it,nt)}computeFrenetFrames(et,nt){const it=new Vector3,rt=[],ot=[],at=[],st=new Vector3,lt=new Matrix4;for(let pt=0;pt<=et;pt++){const mt=pt/et;rt[pt]=this.getTangentAt(mt,new Vector3)}ot[0]=new Vector3,at[0]=new Vector3;let ct=Number.MAX_VALUE;const ut=Math.abs(rt[0].x),ht=Math.abs(rt[0].y),dt=Math.abs(rt[0].z);ut<=ct&&(ct=ut,it.set(1,0,0)),ht<=ct&&(ct=ht,it.set(0,1,0)),dt<=ct&&it.set(0,0,1),st.crossVectors(rt[0],it).normalize(),ot[0].crossVectors(rt[0],st),at[0].crossVectors(rt[0],ot[0]);for(let pt=1;pt<=et;pt++){if(ot[pt]=ot[pt-1].clone(),at[pt]=at[pt-1].clone(),st.crossVectors(rt[pt-1],rt[pt]),st.length()>Number.EPSILON){st.normalize();const mt=Math.acos(clamp$6(rt[pt-1].dot(rt[pt]),-1,1));ot[pt].applyMatrix4(lt.makeRotationAxis(st,mt))}at[pt].crossVectors(rt[pt],ot[pt])}if(nt===!0){let pt=Math.acos(clamp$6(ot[0].dot(ot[et]),-1,1));pt/=et,rt[0].dot(st.crossVectors(ot[0],ot[et]))>0&&(pt=-pt);for(let mt=1;mt<=et;mt++)ot[mt].applyMatrix4(lt.makeRotationAxis(rt[mt],pt*mt)),at[mt].crossVectors(rt[mt],ot[mt])}return{tangents:rt,normals:ot,binormals:at}}clone(){return new this.constructor().copy(this)}copy(et){return this.arcLengthDivisions=et.arcLengthDivisions,this}toJSON(){const et={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return et.arcLengthDivisions=this.arcLengthDivisions,et.type=this.type,et}fromJSON(et){return this.arcLengthDivisions=et.arcLengthDivisions,this}};class EllipseCurve extends Curve$1{constructor(et=0,nt=0,it=1,rt=1,ot=0,at=Math.PI*2,st=!1,lt=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=et,this.aY=nt,this.xRadius=it,this.yRadius=rt,this.aStartAngle=ot,this.aEndAngle=at,this.aClockwise=st,this.aRotation=lt}getPoint(et,nt){const it=nt||new Vector2,rt=Math.PI*2;let ot=this.aEndAngle-this.aStartAngle;const at=Math.abs(ot)rt;)ot-=rt;ot0?0:(Math.floor(Math.abs(st)/ot)+1)*ot:lt===0&&st===ot-1&&(st=ot-2,lt=1);let ct,ut;this.closed||st>0?ct=rt[(st-1)%ot]:(tmp.subVectors(rt[0],rt[1]).add(rt[0]),ct=tmp);const ht=rt[st%ot],dt=rt[(st+1)%ot];if(this.closed||st+2rt.length-2?rt.length-1:at+1],ht=rt[at>rt.length-3?rt.length-1:at+2];return it.set(CatmullRom(st,lt.x,ct.x,ut.x,ht.x),CatmullRom(st,lt.y,ct.y,ut.y,ht.y)),it}copy(et){super.copy(et),this.points=[];for(let nt=0,it=et.points.length;nt=it){const at=rt[ot]-it,st=this.curves[ot],lt=st.getLength(),ct=lt===0?0:1-at/lt;return st.getPointAt(ct,nt)}ot++}return null}getLength(){const et=this.getCurveLengths();return et[et.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 et=[];let nt=0;for(let it=0,rt=this.curves.length;it1&&!nt[nt.length-1].equals(nt[0])&&nt.push(nt[0]),nt}copy(et){super.copy(et),this.curves=[];for(let nt=0,it=et.curves.length;nt0){const ht=ct.getPoint(0);ht.equals(this.currentPoint)||this.lineTo(ht.x,ht.y)}this.curves.push(ct);const ut=ct.getPoint(1);return this.currentPoint.copy(ut),this}copy(et){return super.copy(et),this.currentPoint.copy(et.currentPoint),this}toJSON(){const et=super.toJSON();return et.currentPoint=this.currentPoint.toArray(),et}fromJSON(et){return super.fromJSON(et),this.currentPoint.fromArray(et.currentPoint),this}};class LatheGeometry extends BufferGeometry{constructor(et=[new Vector2(0,-.5),new Vector2(.5,0),new Vector2(0,.5)],nt=12,it=0,rt=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:et,segments:nt,phiStart:it,phiLength:rt},nt=Math.floor(nt),rt=clamp$6(rt,0,Math.PI*2);const ot=[],at=[],st=[],lt=[],ct=[],ut=1/nt,ht=new Vector3,dt=new Vector2,pt=new Vector3,mt=new Vector3,gt=new Vector3;let bt=0,yt=0;for(let wt=0;wt<=et.length-1;wt++)switch(wt){case 0:bt=et[wt+1].x-et[wt].x,yt=et[wt+1].y-et[wt].y,pt.x=yt*1,pt.y=-bt,pt.z=yt*0,gt.copy(pt),pt.normalize(),lt.push(pt.x,pt.y,pt.z);break;case et.length-1:lt.push(gt.x,gt.y,gt.z);break;default:bt=et[wt+1].x-et[wt].x,yt=et[wt+1].y-et[wt].y,pt.x=yt*1,pt.y=-bt,pt.z=yt*0,mt.copy(pt),pt.x+=gt.x,pt.y+=gt.y,pt.z+=gt.z,pt.normalize(),lt.push(pt.x,pt.y,pt.z),gt.copy(mt)}for(let wt=0;wt<=nt;wt++){const vt=it+wt*ut*rt,xt=Math.sin(vt),St=Math.cos(vt);for(let Et=0;Et<=et.length-1;Et++){ht.x=et[Et].x*xt,ht.y=et[Et].y,ht.z=et[Et].x*St,at.push(ht.x,ht.y,ht.z),dt.x=wt/nt,dt.y=Et/(et.length-1),st.push(dt.x,dt.y);const $t=lt[3*Et+0]*xt,It=lt[3*Et+1],Ft=lt[3*Et+0]*St;ct.push($t,It,Ft)}}for(let wt=0;wt0&&vt(!0),nt>0&&vt(!1)),this.setIndex(ut),this.setAttribute("position",new Float32BufferAttribute(ht,3)),this.setAttribute("normal",new Float32BufferAttribute(dt,3)),this.setAttribute("uv",new Float32BufferAttribute(pt,2));function wt(){const xt=new Vector3,St=new Vector3;let Et=0;const $t=(nt-et)/it;for(let It=0;It<=ot;It++){const Ft=[],Ht=It/ot,zt=Ht*(nt-et)+et;for(let Ot=0;Ot<=rt;Ot++){const jt=Ot/rt,kt=jt*lt+st,Tt=Math.sin(kt),Ct=Math.cos(kt);St.x=zt*Tt,St.y=-Ht*it+bt,St.z=zt*Ct,ht.push(St.x,St.y,St.z),xt.set(Tt,$t,Ct).normalize(),dt.push(xt.x,xt.y,xt.z),pt.push(jt,1-Ht),Ft.push(mt++)}gt.push(Ft)}for(let It=0;It.9&&$t<.1&&(vt<.2&&(at[wt+0]+=1),xt<.2&&(at[wt+2]+=1),St<.2&&(at[wt+4]+=1))}}function dt(wt){ot.push(wt.x,wt.y,wt.z)}function pt(wt,vt){const xt=wt*3;vt.x=et[xt+0],vt.y=et[xt+1],vt.z=et[xt+2]}function mt(){const wt=new Vector3,vt=new Vector3,xt=new Vector3,St=new Vector3,Et=new Vector2,$t=new Vector2,It=new Vector2;for(let Ft=0,Ht=0;Ft80*nt){st=ct=tt[0],lt=ut=tt[1];for(let mt=nt;mtct&&(ct=ht),dt>ut&&(ut=dt);pt=Math.max(ct-st,ut-lt),pt=pt!==0?1/pt:0}return earcutLinked(ot,at,nt,st,lt,pt),at}};function linkedList(tt,et,nt,it,rt){let ot,at;if(rt===signedArea(tt,et,nt,it)>0)for(ot=et;ot=et;ot-=it)at=insertNode(ot,tt[ot],tt[ot+1],at);return at&&equals(at,at.next)&&(removeNode(at),at=at.next),at}function filterPoints(tt,et){if(!tt)return tt;et||(et=tt);let nt=tt,it;do if(it=!1,!nt.steiner&&(equals(nt,nt.next)||area(nt.prev,nt,nt.next)===0)){if(removeNode(nt),nt=et=nt.prev,nt===nt.next)break;it=!0}else nt=nt.next;while(it||nt!==et);return et}function earcutLinked(tt,et,nt,it,rt,ot,at){if(!tt)return;!at&&ot&&indexCurve(tt,it,rt,ot);let st=tt,lt,ct;for(;tt.prev!==tt.next;){if(lt=tt.prev,ct=tt.next,ot?isEarHashed(tt,it,rt,ot):isEar(tt)){et.push(lt.i/nt),et.push(tt.i/nt),et.push(ct.i/nt),removeNode(tt),tt=ct.next,st=ct.next;continue}if(tt=ct,tt===st){at?at===1?(tt=cureLocalIntersections(filterPoints(tt),et,nt),earcutLinked(tt,et,nt,it,rt,ot,2)):at===2&&splitEarcut(tt,et,nt,it,rt,ot):earcutLinked(filterPoints(tt),et,nt,it,rt,ot,1);break}}}function isEar(tt){const et=tt.prev,nt=tt,it=tt.next;if(area(et,nt,it)>=0)return!1;let rt=tt.next.next;for(;rt!==tt.prev;){if(pointInTriangle(et.x,et.y,nt.x,nt.y,it.x,it.y,rt.x,rt.y)&&area(rt.prev,rt,rt.next)>=0)return!1;rt=rt.next}return!0}function isEarHashed(tt,et,nt,it){const rt=tt.prev,ot=tt,at=tt.next;if(area(rt,ot,at)>=0)return!1;const st=rt.xot.x?rt.x>at.x?rt.x:at.x:ot.x>at.x?ot.x:at.x,ut=rt.y>ot.y?rt.y>at.y?rt.y:at.y:ot.y>at.y?ot.y:at.y,ht=zOrder(st,lt,et,nt,it),dt=zOrder(ct,ut,et,nt,it);let pt=tt.prevZ,mt=tt.nextZ;for(;pt&&pt.z>=ht&&mt&&mt.z<=dt;){if(pt!==tt.prev&&pt!==tt.next&&pointInTriangle(rt.x,rt.y,ot.x,ot.y,at.x,at.y,pt.x,pt.y)&&area(pt.prev,pt,pt.next)>=0||(pt=pt.prevZ,mt!==tt.prev&&mt!==tt.next&&pointInTriangle(rt.x,rt.y,ot.x,ot.y,at.x,at.y,mt.x,mt.y)&&area(mt.prev,mt,mt.next)>=0))return!1;mt=mt.nextZ}for(;pt&&pt.z>=ht;){if(pt!==tt.prev&&pt!==tt.next&&pointInTriangle(rt.x,rt.y,ot.x,ot.y,at.x,at.y,pt.x,pt.y)&&area(pt.prev,pt,pt.next)>=0)return!1;pt=pt.prevZ}for(;mt&&mt.z<=dt;){if(mt!==tt.prev&&mt!==tt.next&&pointInTriangle(rt.x,rt.y,ot.x,ot.y,at.x,at.y,mt.x,mt.y)&&area(mt.prev,mt,mt.next)>=0)return!1;mt=mt.nextZ}return!0}function cureLocalIntersections(tt,et,nt){let it=tt;do{const rt=it.prev,ot=it.next.next;!equals(rt,ot)&&intersects(rt,it,it.next,ot)&&locallyInside(rt,ot)&&locallyInside(ot,rt)&&(et.push(rt.i/nt),et.push(it.i/nt),et.push(ot.i/nt),removeNode(it),removeNode(it.next),it=tt=ot),it=it.next}while(it!==tt);return filterPoints(it)}function splitEarcut(tt,et,nt,it,rt,ot){let at=tt;do{let st=at.next.next;for(;st!==at.prev;){if(at.i!==st.i&&isValidDiagonal(at,st)){let lt=splitPolygon(at,st);at=filterPoints(at,at.next),lt=filterPoints(lt,lt.next),earcutLinked(at,et,nt,it,rt,ot),earcutLinked(lt,et,nt,it,rt,ot);return}st=st.next}at=at.next}while(at!==tt)}function eliminateHoles(tt,et,nt,it){const rt=[];let ot,at,st,lt,ct;for(ot=0,at=et.length;ot=nt.next.y&&nt.next.y!==nt.y){const dt=nt.x+(rt-nt.y)*(nt.next.x-nt.x)/(nt.next.y-nt.y);if(dt<=it&&dt>ot){if(ot=dt,dt===it){if(rt===nt.y)return nt;if(rt===nt.next.y)return nt.next}at=nt.x=nt.x&&nt.x>=lt&&it!==nt.x&&pointInTriangle(rtat.x||nt.x===at.x&§orContainsSector(at,nt)))&&(at=nt,ut=ht)),nt=nt.next;while(nt!==st);return at}function sectorContainsSector(tt,et){return area(tt.prev,tt,et.prev)<0&&area(et.next,tt,tt.next)<0}function indexCurve(tt,et,nt,it){let rt=tt;do rt.z===null&&(rt.z=zOrder(rt.x,rt.y,et,nt,it)),rt.prevZ=rt.prev,rt.nextZ=rt.next,rt=rt.next;while(rt!==tt);rt.prevZ.nextZ=null,rt.prevZ=null,sortLinked(rt)}function sortLinked(tt){let et,nt,it,rt,ot,at,st,lt,ct=1;do{for(nt=tt,tt=null,ot=null,at=0;nt;){for(at++,it=nt,st=0,et=0;et0||lt>0&⁢)st!==0&&(lt===0||!it||nt.z<=it.z)?(rt=nt,nt=nt.nextZ,st--):(rt=it,it=it.nextZ,lt--),ot?ot.nextZ=rt:tt=rt,rt.prevZ=ot,ot=rt;nt=it}ot.nextZ=null,ct*=2}while(at>1);return tt}function zOrder(tt,et,nt,it,rt){return tt=32767*(tt-nt)*rt,et=32767*(et-it)*rt,tt=(tt|tt<<8)&16711935,tt=(tt|tt<<4)&252645135,tt=(tt|tt<<2)&858993459,tt=(tt|tt<<1)&1431655765,et=(et|et<<8)&16711935,et=(et|et<<4)&252645135,et=(et|et<<2)&858993459,et=(et|et<<1)&1431655765,tt|et<<1}function getLeftmost(tt){let et=tt,nt=tt;do(et.x=0&&(tt-at)*(it-st)-(nt-at)*(et-st)>=0&&(nt-at)*(ot-st)-(rt-at)*(it-st)>=0}function isValidDiagonal(tt,et){return tt.next.i!==et.i&&tt.prev.i!==et.i&&!intersectsPolygon(tt,et)&&(locallyInside(tt,et)&&locallyInside(et,tt)&&middleInside(tt,et)&&(area(tt.prev,tt,et.prev)||area(tt,et.prev,et))||equals(tt,et)&&area(tt.prev,tt,tt.next)>0&&area(et.prev,et,et.next)>0)}function area(tt,et,nt){return(et.y-tt.y)*(nt.x-et.x)-(et.x-tt.x)*(nt.y-et.y)}function equals(tt,et){return tt.x===et.x&&tt.y===et.y}function intersects(tt,et,nt,it){const rt=sign$4(area(tt,et,nt)),ot=sign$4(area(tt,et,it)),at=sign$4(area(nt,it,tt)),st=sign$4(area(nt,it,et));return!!(rt!==ot&&at!==st||rt===0&&onSegment(tt,nt,et)||ot===0&&onSegment(tt,it,et)||at===0&&onSegment(nt,tt,it)||st===0&&onSegment(nt,et,it))}function onSegment(tt,et,nt){return et.x<=Math.max(tt.x,nt.x)&&et.x>=Math.min(tt.x,nt.x)&&et.y<=Math.max(tt.y,nt.y)&&et.y>=Math.min(tt.y,nt.y)}function sign$4(tt){return tt>0?1:tt<0?-1:0}function intersectsPolygon(tt,et){let nt=tt;do{if(nt.i!==tt.i&&nt.next.i!==tt.i&&nt.i!==et.i&&nt.next.i!==et.i&&intersects(nt,nt.next,tt,et))return!0;nt=nt.next}while(nt!==tt);return!1}function locallyInside(tt,et){return area(tt.prev,tt,tt.next)<0?area(tt,et,tt.next)>=0&&area(tt,tt.prev,et)>=0:area(tt,et,tt.prev)<0||area(tt,tt.next,et)<0}function middleInside(tt,et){let nt=tt,it=!1;const rt=(tt.x+et.x)/2,ot=(tt.y+et.y)/2;do nt.y>ot!=nt.next.y>ot&&nt.next.y!==nt.y&&rt<(nt.next.x-nt.x)*(ot-nt.y)/(nt.next.y-nt.y)+nt.x&&(it=!it),nt=nt.next;while(nt!==tt);return it}function splitPolygon(tt,et){const nt=new Node$4(tt.i,tt.x,tt.y),it=new Node$4(et.i,et.x,et.y),rt=tt.next,ot=et.prev;return tt.next=et,et.prev=tt,nt.next=rt,rt.prev=nt,it.next=nt,nt.prev=it,ot.next=it,it.prev=ot,it}function insertNode(tt,et,nt,it){const rt=new Node$4(tt,et,nt);return it?(rt.next=it.next,rt.prev=it,it.next.prev=rt,it.next=rt):(rt.prev=rt,rt.next=rt),rt}function removeNode(tt){tt.next.prev=tt.prev,tt.prev.next=tt.next,tt.prevZ&&(tt.prevZ.nextZ=tt.nextZ),tt.nextZ&&(tt.nextZ.prevZ=tt.prevZ)}function Node$4(tt,et,nt){this.i=tt,this.x=et,this.y=nt,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(tt,et,nt,it){let rt=0;for(let ot=et,at=nt-it;ot2&&tt[et-1].equals(tt[0])&&tt.pop()}function addContour(tt,et){for(let nt=0;ntNumber.EPSILON){const sn=Math.sqrt(yn),rn=Math.sqrt(gn*gn+Tn*Tn),Sn=En.x-An/sn,tn=En.y+_n/sn,qt=In.x-Tn/rn,Kt=In.y+gn/rn,wn=((qt-Sn)*Tn-(Kt-tn)*gn)/(_n*Tn-An*gn);Cn=Sn+_n*wn-Zt.x,Nn=tn+An*wn-Zt.y;const Rn=Cn*Cn+Nn*Nn;if(Rn<=2)return new Vector2(Cn,Nn);Un=Math.sqrt(Rn/2)}else{let sn=!1;_n>Number.EPSILON?gn>Number.EPSILON&&(sn=!0):_n<-Number.EPSILON?gn<-Number.EPSILON&&(sn=!0):Math.sign(An)===Math.sign(Tn)&&(sn=!0),sn?(Cn=-An,Nn=_n,Un=Math.sqrt(yn)):(Cn=_n,Nn=An,Un=Math.sqrt(yn/2))}return new Vector2(Cn/Un,Nn/Un)}const Bt=[];for(let Zt=0,En=kt.length,In=En-1,Cn=Zt+1;Zt=0;Zt--){const En=Zt/bt,In=pt*Math.cos(En*Math.PI/2),Cn=mt*Math.sin(En*Math.PI/2)+gt;for(let Nn=0,Un=kt.length;Nn=0;){const Cn=In;let Nn=In-1;Nn<0&&(Nn=Zt.length-1);for(let Un=0,_n=ut+bt*2;Un<_n;Un++){const An=Ct*Un,gn=Ct*(Un+1),Tn=En+Cn+An,yn=En+Nn+An,dn=En+Nn+gn,sn=En+Cn+gn;fn(Tn,yn,dn,sn)}}}function un(Zt,En,In){lt.push(Zt),lt.push(En),lt.push(In)}function en(Zt,En,In){xn(Zt),xn(En),xn(In);const Cn=rt.length/3,Nn=wt.generateTopUV(it,rt,Cn-3,Cn-2,Cn-1);an(Nn[0]),an(Nn[1]),an(Nn[2])}function fn(Zt,En,In,Cn){xn(Zt),xn(En),xn(Cn),xn(En),xn(In),xn(Cn);const Nn=rt.length/3,Un=wt.generateSideWallUV(it,rt,Nn-6,Nn-3,Nn-2,Nn-1);an(Un[0]),an(Un[1]),an(Un[3]),an(Un[1]),an(Un[2]),an(Un[3])}function xn(Zt){rt.push(lt[Zt*3+0]),rt.push(lt[Zt*3+1]),rt.push(lt[Zt*3+2])}function an(Zt){ot.push(Zt.x),ot.push(Zt.y)}}}toJSON(){const et=super.toJSON(),nt=this.parameters.shapes,it=this.parameters.options;return toJSON$1(nt,it,et)}static fromJSON(et,nt){const it=[];for(let ot=0,at=et.shapes.length;ot0)&&pt.push(vt,xt,Et),(yt!==it-1||lt0!=et>0&&this.version++,this._sheen=et}get clearcoat(){return this._clearcoat}set clearcoat(et){this._clearcoat>0!=et>0&&this.version++,this._clearcoat=et}get iridescence(){return this._iridescence}set iridescence(et){this._iridescence>0!=et>0&&this.version++,this._iridescence=et}get transmission(){return this._transmission}set transmission(et){this._transmission>0!=et>0&&this.version++,this._transmission=et}copy(et){return super.copy(et),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=et.clearcoat,this.clearcoatMap=et.clearcoatMap,this.clearcoatRoughness=et.clearcoatRoughness,this.clearcoatRoughnessMap=et.clearcoatRoughnessMap,this.clearcoatNormalMap=et.clearcoatNormalMap,this.clearcoatNormalScale.copy(et.clearcoatNormalScale),this.ior=et.ior,this.iridescence=et.iridescence,this.iridescenceMap=et.iridescenceMap,this.iridescenceIOR=et.iridescenceIOR,this.iridescenceThicknessRange=[...et.iridescenceThicknessRange],this.iridescenceThicknessMap=et.iridescenceThicknessMap,this.sheen=et.sheen,this.sheenColor.copy(et.sheenColor),this.sheenColorMap=et.sheenColorMap,this.sheenRoughness=et.sheenRoughness,this.sheenRoughnessMap=et.sheenRoughnessMap,this.transmission=et.transmission,this.transmissionMap=et.transmissionMap,this.thickness=et.thickness,this.thicknessMap=et.thicknessMap,this.attenuationDistance=et.attenuationDistance,this.attenuationColor.copy(et.attenuationColor),this.specularIntensity=et.specularIntensity,this.specularIntensityMap=et.specularIntensityMap,this.specularColor.copy(et.specularColor),this.specularColorMap=et.specularColorMap,this}}class MeshPhongMaterial extends Material{constructor(et){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Color$1(16777215),this.specular=new Color$1(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,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(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.specular.copy(et.specular),this.shininess=et.shininess,this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.flatShading=et.flatShading,this.fog=et.fog,this}}class MeshToonMaterial extends Material{constructor(et){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Color$1(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(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(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.gradientMap=et.gradientMap,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.alphaMap=et.alphaMap,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}class MeshNormalMaterial extends Material{constructor(et){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(et)}copy(et){return super.copy(et),this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.flatShading=et.flatShading,this}}class MeshLambertMaterial extends Material{constructor(et){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Color$1(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Color$1(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.color.copy(et.color),this.map=et.map,this.lightMap=et.lightMap,this.lightMapIntensity=et.lightMapIntensity,this.aoMap=et.aoMap,this.aoMapIntensity=et.aoMapIntensity,this.emissive.copy(et.emissive),this.emissiveMap=et.emissiveMap,this.emissiveIntensity=et.emissiveIntensity,this.specularMap=et.specularMap,this.alphaMap=et.alphaMap,this.envMap=et.envMap,this.combine=et.combine,this.reflectivity=et.reflectivity,this.refractionRatio=et.refractionRatio,this.wireframe=et.wireframe,this.wireframeLinewidth=et.wireframeLinewidth,this.wireframeLinecap=et.wireframeLinecap,this.wireframeLinejoin=et.wireframeLinejoin,this.fog=et.fog,this}}class MeshMatcapMaterial extends Material{constructor(et){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Color$1(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=TangentSpaceNormalMap,this.normalScale=new Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(et)}copy(et){return super.copy(et),this.defines={MATCAP:""},this.color.copy(et.color),this.matcap=et.matcap,this.map=et.map,this.bumpMap=et.bumpMap,this.bumpScale=et.bumpScale,this.normalMap=et.normalMap,this.normalMapType=et.normalMapType,this.normalScale.copy(et.normalScale),this.displacementMap=et.displacementMap,this.displacementScale=et.displacementScale,this.displacementBias=et.displacementBias,this.alphaMap=et.alphaMap,this.flatShading=et.flatShading,this.fog=et.fog,this}}class LineDashedMaterial extends LineBasicMaterial{constructor(et){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(et)}copy(et){return super.copy(et),this.scale=et.scale,this.dashSize=et.dashSize,this.gapSize=et.gapSize,this}}function arraySlice(tt,et,nt){return isTypedArray$5(tt)?new tt.constructor(tt.subarray(et,nt!==void 0?nt:tt.length)):tt.slice(et,nt)}function convertArray(tt,et,nt){return!tt||!nt&&tt.constructor===et?tt:typeof et.BYTES_PER_ELEMENT=="number"?new et(tt):Array.prototype.slice.call(tt)}function isTypedArray$5(tt){return ArrayBuffer.isView(tt)&&!(tt instanceof DataView)}function getKeyframeOrder(tt){function et(rt,ot){return tt[rt]-tt[ot]}const nt=tt.length,it=new Array(nt);for(let rt=0;rt!==nt;++rt)it[rt]=rt;return it.sort(et),it}function sortedArray(tt,et,nt){const it=tt.length,rt=new tt.constructor(it);for(let ot=0,at=0;at!==it;++ot){const st=nt[ot]*et;for(let lt=0;lt!==et;++lt)rt[at++]=tt[st+lt]}return rt}function flattenJSON(tt,et,nt,it){let rt=1,ot=tt[0];for(;ot!==void 0&&ot[it]===void 0;)ot=tt[rt++];if(ot===void 0)return;let at=ot[it];if(at!==void 0)if(Array.isArray(at))do at=ot[it],at!==void 0&&(et.push(ot.time),nt.push.apply(nt,at)),ot=tt[rt++];while(ot!==void 0);else if(at.toArray!==void 0)do at=ot[it],at!==void 0&&(et.push(ot.time),at.toArray(nt,nt.length)),ot=tt[rt++];while(ot!==void 0);else do at=ot[it],at!==void 0&&(et.push(ot.time),nt.push(at)),ot=tt[rt++];while(ot!==void 0)}function subclip(tt,et,nt,it,rt=30){const ot=tt.clone();ot.name=et;const at=[];for(let lt=0;lt=it)){ht.push(ct.times[pt]);for(let gt=0;gtot.tracks[lt].times[0]&&(st=ot.tracks[lt].times[0]);for(let lt=0;lt=st.times[mt]){const yt=mt*ht+ut,wt=yt+ht-ut;gt=arraySlice(st.values,yt,wt)}else{const yt=st.createInterpolant(),wt=ut,vt=ht-ut;yt.evaluate(ot),gt=arraySlice(yt.resultBuffer,wt,vt)}lt==="quaternion"&&new Quaternion().fromArray(gt).normalize().conjugate().toArray(gt);const bt=ct.times.length;for(let yt=0;yt=ot)){const st=nt[1];et=ot)break t}at=it,it=0;break n}break e}for(;it>>1;etnt;)--at;if(++at,ot!==0||at!==rt){ot>=at&&(at=Math.max(at,1),ot=at-1);const st=this.getValueSize();this.times=arraySlice(it,ot,at),this.values=arraySlice(this.values,ot*st,at*st)}return this}validate(){let et=!0;const nt=this.getValueSize();nt-Math.floor(nt)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),et=!1);const it=this.times,rt=this.values,ot=it.length;ot===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),et=!1);let at=null;for(let st=0;st!==ot;st++){const lt=it[st];if(typeof lt=="number"&&isNaN(lt)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,st,lt),et=!1;break}if(at!==null&&at>lt){console.error("THREE.KeyframeTrack: Out of order keys.",this,st,lt,at),et=!1;break}at=lt}if(rt!==void 0&&isTypedArray$5(rt))for(let st=0,lt=rt.length;st!==lt;++st){const ct=rt[st];if(isNaN(ct)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,st,ct),et=!1;break}}return et}optimize(){const et=arraySlice(this.times),nt=arraySlice(this.values),it=this.getValueSize(),rt=this.getInterpolation()===InterpolateSmooth,ot=et.length-1;let at=1;for(let st=1;st0){et[at]=et[ot];for(let st=ot*it,lt=at*it,ct=0;ct!==it;++ct)nt[lt+ct]=nt[st+ct];++at}return at!==et.length?(this.times=arraySlice(et,0,at),this.values=arraySlice(nt,0,at*it)):(this.times=et,this.values=nt),this}clone(){const et=arraySlice(this.times,0),nt=arraySlice(this.values,0),it=this.constructor,rt=new it(this.name,et,nt);return rt.createInterpolant=this.createInterpolant,rt}}KeyframeTrack.prototype.TimeBufferType=Float32Array;KeyframeTrack.prototype.ValueBufferType=Float32Array;KeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;class BooleanKeyframeTrack extends KeyframeTrack{}BooleanKeyframeTrack.prototype.ValueTypeName="bool";BooleanKeyframeTrack.prototype.ValueBufferType=Array;BooleanKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(et,nt,it,rt){super(et,nt,it,rt)}interpolate_(et,nt,it,rt){const ot=this.resultBuffer,at=this.sampleValues,st=this.valueSize,lt=(it-nt)/(rt-nt);let ct=et*st;for(let ut=ct+st;ct!==ut;ct+=4)Quaternion.slerpFlat(ot,0,at,ct-st,at,ct,lt);return ot}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(et){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),et)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion";QuaternionKeyframeTrack.prototype.DefaultInterpolation=InterpolateLinear;QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{}StringKeyframeTrack.prototype.ValueTypeName="string";StringKeyframeTrack.prototype.ValueBufferType=Array;StringKeyframeTrack.prototype.DefaultInterpolation=InterpolateDiscrete;StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0;StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";class AnimationClip{constructor(et,nt=-1,it,rt=NormalAnimationBlendMode){this.name=et,this.tracks=it,this.duration=nt,this.blendMode=rt,this.uuid=generateUUID$1(),this.duration<0&&this.resetDuration()}static parse(et){const nt=[],it=et.tracks,rt=1/(et.fps||1);for(let at=0,st=it.length;at!==st;++at)nt.push(parseKeyframeTrack(it[at]).scale(rt));const ot=new this(et.name,et.duration,nt,et.blendMode);return ot.uuid=et.uuid,ot}static toJSON(et){const nt=[],it=et.tracks,rt={name:et.name,duration:et.duration,tracks:nt,uuid:et.uuid,blendMode:et.blendMode};for(let ot=0,at=it.length;ot!==at;++ot)nt.push(KeyframeTrack.toJSON(it[ot]));return rt}static CreateFromMorphTargetSequence(et,nt,it,rt){const ot=nt.length,at=[];for(let st=0;st1){const ht=ut[1];let dt=rt[ht];dt||(rt[ht]=dt=[]),dt.push(ct)}}const at=[];for(const st in rt)at.push(this.CreateFromMorphTargetSequence(st,rt[st],nt,it));return at}static parseAnimation(et,nt){if(!et)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const it=function(ht,dt,pt,mt,gt){if(pt.length!==0){const bt=[],yt=[];flattenJSON(pt,bt,yt,mt),bt.length!==0&>.push(new ht(dt,bt,yt))}},rt=[],ot=et.name||"default",at=et.fps||30,st=et.blendMode;let lt=et.length||-1;const ct=et.hierarchy||[];for(let ht=0;ht{nt&&nt(ot),this.manager.itemEnd(et)},0),ot;if(loading[et]!==void 0){loading[et].push({onLoad:nt,onProgress:it,onError:rt});return}loading[et]=[],loading[et].push({onLoad:nt,onProgress:it,onError:rt});const at=new Request(et,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),st=this.mimeType,lt=this.responseType;fetch(at).then(ct=>{if(ct.status===200||ct.status===0){if(ct.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||ct.body===void 0||ct.body.getReader===void 0)return ct;const ut=loading[et],ht=ct.body.getReader(),dt=ct.headers.get("Content-Length"),pt=dt?parseInt(dt):0,mt=pt!==0;let gt=0;const bt=new ReadableStream({start(yt){wt();function wt(){ht.read().then(({done:vt,value:xt})=>{if(vt)yt.close();else{gt+=xt.byteLength;const St=new ProgressEvent("progress",{lengthComputable:mt,loaded:gt,total:pt});for(let Et=0,$t=ut.length;Et<$t;Et++){const It=ut[Et];It.onProgress&&It.onProgress(St)}yt.enqueue(xt),wt()}})}}});return new Response(bt)}else throw new HttpError(`fetch for "${ct.url}" responded with ${ct.status}: ${ct.statusText}`,ct)}).then(ct=>{switch(lt){case"arraybuffer":return ct.arrayBuffer();case"blob":return ct.blob();case"document":return ct.text().then(ut=>new DOMParser().parseFromString(ut,st));case"json":return ct.json();default:if(st===void 0)return ct.text();{const ht=/charset="?([^;"\s]*)"?/i.exec(st),dt=ht&&ht[1]?ht[1].toLowerCase():void 0,pt=new TextDecoder(dt);return ct.arrayBuffer().then(mt=>pt.decode(mt))}}}).then(ct=>{Cache.add(et,ct);const ut=loading[et];delete loading[et];for(let ht=0,dt=ut.length;ht{const ut=loading[et];if(ut===void 0)throw this.manager.itemError(et),ct;delete loading[et];for(let ht=0,dt=ut.length;ht{this.manager.itemEnd(et)}),this.manager.itemStart(et)}setResponseType(et){return this.responseType=et,this}setMimeType(et){return this.mimeType=et,this}}class AnimationLoader extends Loader$2{constructor(et){super(et)}load(et,nt,it,rt){const ot=this,at=new FileLoader(this.manager);at.setPath(this.path),at.setRequestHeader(this.requestHeader),at.setWithCredentials(this.withCredentials),at.load(et,function(st){try{nt(ot.parse(JSON.parse(st)))}catch(lt){rt?rt(lt):console.error(lt),ot.manager.itemError(et)}},it,rt)}parse(et){const nt=[];for(let it=0;it0:rt.vertexColors=et.vertexColors),et.uniforms!==void 0)for(const ot in et.uniforms){const at=et.uniforms[ot];switch(rt.uniforms[ot]={},at.type){case"t":rt.uniforms[ot].value=it(at.value);break;case"c":rt.uniforms[ot].value=new Color$1().setHex(at.value);break;case"v2":rt.uniforms[ot].value=new Vector2().fromArray(at.value);break;case"v3":rt.uniforms[ot].value=new Vector3().fromArray(at.value);break;case"v4":rt.uniforms[ot].value=new Vector4().fromArray(at.value);break;case"m3":rt.uniforms[ot].value=new Matrix3().fromArray(at.value);break;case"m4":rt.uniforms[ot].value=new Matrix4().fromArray(at.value);break;default:rt.uniforms[ot].value=at.value}}if(et.defines!==void 0&&(rt.defines=et.defines),et.vertexShader!==void 0&&(rt.vertexShader=et.vertexShader),et.fragmentShader!==void 0&&(rt.fragmentShader=et.fragmentShader),et.extensions!==void 0)for(const ot in et.extensions)rt.extensions[ot]=et.extensions[ot];if(et.shading!==void 0&&(rt.flatShading=et.shading===1),et.size!==void 0&&(rt.size=et.size),et.sizeAttenuation!==void 0&&(rt.sizeAttenuation=et.sizeAttenuation),et.map!==void 0&&(rt.map=it(et.map)),et.matcap!==void 0&&(rt.matcap=it(et.matcap)),et.alphaMap!==void 0&&(rt.alphaMap=it(et.alphaMap)),et.bumpMap!==void 0&&(rt.bumpMap=it(et.bumpMap)),et.bumpScale!==void 0&&(rt.bumpScale=et.bumpScale),et.normalMap!==void 0&&(rt.normalMap=it(et.normalMap)),et.normalMapType!==void 0&&(rt.normalMapType=et.normalMapType),et.normalScale!==void 0){let ot=et.normalScale;Array.isArray(ot)===!1&&(ot=[ot,ot]),rt.normalScale=new Vector2().fromArray(ot)}return et.displacementMap!==void 0&&(rt.displacementMap=it(et.displacementMap)),et.displacementScale!==void 0&&(rt.displacementScale=et.displacementScale),et.displacementBias!==void 0&&(rt.displacementBias=et.displacementBias),et.roughnessMap!==void 0&&(rt.roughnessMap=it(et.roughnessMap)),et.metalnessMap!==void 0&&(rt.metalnessMap=it(et.metalnessMap)),et.emissiveMap!==void 0&&(rt.emissiveMap=it(et.emissiveMap)),et.emissiveIntensity!==void 0&&(rt.emissiveIntensity=et.emissiveIntensity),et.specularMap!==void 0&&(rt.specularMap=it(et.specularMap)),et.specularIntensityMap!==void 0&&(rt.specularIntensityMap=it(et.specularIntensityMap)),et.specularColorMap!==void 0&&(rt.specularColorMap=it(et.specularColorMap)),et.envMap!==void 0&&(rt.envMap=it(et.envMap)),et.envMapIntensity!==void 0&&(rt.envMapIntensity=et.envMapIntensity),et.reflectivity!==void 0&&(rt.reflectivity=et.reflectivity),et.refractionRatio!==void 0&&(rt.refractionRatio=et.refractionRatio),et.lightMap!==void 0&&(rt.lightMap=it(et.lightMap)),et.lightMapIntensity!==void 0&&(rt.lightMapIntensity=et.lightMapIntensity),et.aoMap!==void 0&&(rt.aoMap=it(et.aoMap)),et.aoMapIntensity!==void 0&&(rt.aoMapIntensity=et.aoMapIntensity),et.gradientMap!==void 0&&(rt.gradientMap=it(et.gradientMap)),et.clearcoatMap!==void 0&&(rt.clearcoatMap=it(et.clearcoatMap)),et.clearcoatRoughnessMap!==void 0&&(rt.clearcoatRoughnessMap=it(et.clearcoatRoughnessMap)),et.clearcoatNormalMap!==void 0&&(rt.clearcoatNormalMap=it(et.clearcoatNormalMap)),et.clearcoatNormalScale!==void 0&&(rt.clearcoatNormalScale=new Vector2().fromArray(et.clearcoatNormalScale)),et.iridescenceMap!==void 0&&(rt.iridescenceMap=it(et.iridescenceMap)),et.iridescenceThicknessMap!==void 0&&(rt.iridescenceThicknessMap=it(et.iridescenceThicknessMap)),et.transmissionMap!==void 0&&(rt.transmissionMap=it(et.transmissionMap)),et.thicknessMap!==void 0&&(rt.thicknessMap=it(et.thicknessMap)),et.sheenColorMap!==void 0&&(rt.sheenColorMap=it(et.sheenColorMap)),et.sheenRoughnessMap!==void 0&&(rt.sheenRoughnessMap=it(et.sheenRoughnessMap)),rt}setTextures(et){return this.textures=et,this}static createMaterialFromType(et){const nt={ShadowMaterial,SpriteMaterial,RawShaderMaterial,ShaderMaterial,PointsMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshPhongMaterial,MeshToonMaterial,MeshNormalMaterial,MeshLambertMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshBasicMaterial,MeshMatcapMaterial,LineDashedMaterial,LineBasicMaterial,Material};return new nt[et]}}class LoaderUtils{static decodeText(et){if(typeof TextDecoder<"u")return new TextDecoder().decode(et);let nt="";for(let it=0,rt=et.length;it0){const lt=new LoadingManager(nt);ot=new ImageLoader(lt),ot.setCrossOrigin(this.crossOrigin);for(let ct=0,ut=et.length;ct0){rt=new ImageLoader(this.manager),rt.setCrossOrigin(this.crossOrigin);for(let at=0,st=et.length;at"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(et){return this.options=et,this}load(et,nt,it,rt){et===void 0&&(et=""),this.path!==void 0&&(et=this.path+et),et=this.manager.resolveURL(et);const ot=this,at=Cache.get(et);if(at!==void 0)return ot.manager.itemStart(et),setTimeout(function(){nt&&nt(at),ot.manager.itemEnd(et)},0),at;const st={};st.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",st.headers=this.requestHeader,fetch(et,st).then(function(lt){return lt.blob()}).then(function(lt){return createImageBitmap(lt,Object.assign(ot.options,{colorSpaceConversion:"none"}))}).then(function(lt){Cache.add(et,lt),nt&&nt(lt),ot.manager.itemEnd(et)}).catch(function(lt){rt&&rt(lt),ot.manager.itemError(et),ot.manager.itemEnd(et)}),ot.manager.itemStart(et)}}let _context$1;const AudioContext={getContext:function(){return _context$1===void 0&&(_context$1=new(window.AudioContext||window.webkitAudioContext)),_context$1},setContext:function(tt){_context$1=tt}};class AudioLoader extends Loader$2{constructor(et){super(et)}load(et,nt,it,rt){const ot=this,at=new FileLoader(this.manager);at.setResponseType("arraybuffer"),at.setPath(this.path),at.setRequestHeader(this.requestHeader),at.setWithCredentials(this.withCredentials),at.load(et,function(st){try{const lt=st.slice(0);AudioContext.getContext().decodeAudioData(lt,function(ut){nt(ut)})}catch(lt){rt?rt(lt):console.error(lt),ot.manager.itemError(et)}},it,rt)}}class HemisphereLightProbe extends LightProbe{constructor(et,nt,it=1){super(void 0,it),this.isHemisphereLightProbe=!0;const rt=new Color$1().set(et),ot=new Color$1().set(nt),at=new Vector3(rt.r,rt.g,rt.b),st=new Vector3(ot.r,ot.g,ot.b),lt=Math.sqrt(Math.PI),ct=lt*Math.sqrt(.75);this.sh.coefficients[0].copy(at).add(st).multiplyScalar(lt),this.sh.coefficients[1].copy(at).sub(st).multiplyScalar(ct)}}class AmbientLightProbe extends LightProbe{constructor(et,nt=1){super(void 0,nt),this.isAmbientLightProbe=!0;const it=new Color$1().set(et);this.sh.coefficients[0].set(it.r,it.g,it.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const _eyeRight=new Matrix4,_eyeLeft=new Matrix4,_projectionMatrix=new Matrix4;class StereoCamera{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,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(et){const nt=this._cache;if(nt.focus!==et.focus||nt.fov!==et.fov||nt.aspect!==et.aspect*this.aspect||nt.near!==et.near||nt.far!==et.far||nt.zoom!==et.zoom||nt.eyeSep!==this.eyeSep){nt.focus=et.focus,nt.fov=et.fov,nt.aspect=et.aspect*this.aspect,nt.near=et.near,nt.far=et.far,nt.zoom=et.zoom,nt.eyeSep=this.eyeSep,_projectionMatrix.copy(et.projectionMatrix);const rt=nt.eyeSep/2,ot=rt*nt.near/nt.focus,at=nt.near*Math.tan(DEG2RAD$1*nt.fov*.5)/nt.zoom;let st,lt;_eyeLeft.elements[12]=-rt,_eyeRight.elements[12]=rt,st=-at*nt.aspect+ot,lt=at*nt.aspect+ot,_projectionMatrix.elements[0]=2*nt.near/(lt-st),_projectionMatrix.elements[8]=(lt+st)/(lt-st),this.cameraL.projectionMatrix.copy(_projectionMatrix),st=-at*nt.aspect-ot,lt=at*nt.aspect-ot,_projectionMatrix.elements[0]=2*nt.near/(lt-st),_projectionMatrix.elements[8]=(lt+st)/(lt-st),this.cameraR.projectionMatrix.copy(_projectionMatrix)}this.cameraL.matrixWorld.copy(et.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(et.matrixWorld).multiply(_eyeRight)}}let Clock$1=class{constructor(et=!0){this.autoStart=et,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now$5(),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 et=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const nt=now$5();et=(nt-this.oldTime)/1e3,this.oldTime=nt,this.elapsedTime+=et}return et}};function now$5(){return(typeof performance>"u"?Date:performance).now()}const _position$1=new Vector3,_quaternion$1=new Quaternion,_scale$1=new Vector3,_orientation$1=new Vector3;class AudioListener extends Object3D{constructor(){super(),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock$1}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(et){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=et,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(et){return this.gain.gain.setTargetAtTime(et,this.context.currentTime,.01),this}updateMatrixWorld(et){super.updateMatrixWorld(et);const nt=this.context.listener,it=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$1,_quaternion$1,_scale$1),_orientation$1.set(0,0,-1).applyQuaternion(_quaternion$1),nt.positionX){const rt=this.context.currentTime+this.timeDelta;nt.positionX.linearRampToValueAtTime(_position$1.x,rt),nt.positionY.linearRampToValueAtTime(_position$1.y,rt),nt.positionZ.linearRampToValueAtTime(_position$1.z,rt),nt.forwardX.linearRampToValueAtTime(_orientation$1.x,rt),nt.forwardY.linearRampToValueAtTime(_orientation$1.y,rt),nt.forwardZ.linearRampToValueAtTime(_orientation$1.z,rt),nt.upX.linearRampToValueAtTime(it.x,rt),nt.upY.linearRampToValueAtTime(it.y,rt),nt.upZ.linearRampToValueAtTime(it.z,rt)}else nt.setPosition(_position$1.x,_position$1.y,_position$1.z),nt.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z,it.x,it.y,it.z)}}class Audio extends Object3D{constructor(et){super(),this.type="Audio",this.listener=et,this.context=et.context,this.gain=this.context.createGain(),this.gain.connect(et.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(et){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=et,this.connect(),this}setMediaElementSource(et){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(et),this.connect(),this}setMediaStreamSource(et){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(et),this.connect(),this}setBuffer(et){return this.buffer=et,this.sourceType="buffer",this.autoplay&&this.play(),this}play(et=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+et;const nt=this.context.createBufferSource();return nt.buffer=this.buffer,nt.loop=this.loop,nt.loopStart=this.loopStart,nt.loopEnd=this.loopEnd,nt.onended=this.onEnded.bind(this),nt.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=nt,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 et=1,nt=this.filters.length;et0){this.source.disconnect(this.filters[0]);for(let et=1,nt=this.filters.length;et0&&this._mixBufferRegionAdditive(it,rt,this._addIndex*nt,1,nt);for(let lt=nt,ct=nt+nt;lt!==ct;++lt)if(it[lt]!==it[lt+nt]){st.setValue(it,rt);break}}saveOriginalState(){const et=this.binding,nt=this.buffer,it=this.valueSize,rt=it*this._origIndex;et.getValue(nt,rt);for(let ot=it,at=rt;ot!==at;++ot)nt[ot]=nt[rt+ot%it];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const et=this.valueSize*3;this.binding.setValue(this.buffer,et)}_setAdditiveIdentityNumeric(){const et=this._addIndex*this.valueSize,nt=et+this.valueSize;for(let it=et;it=.5)for(let at=0;at!==ot;++at)et[nt+at]=et[it+at]}_slerp(et,nt,it,rt){Quaternion.slerpFlat(et,nt,et,nt,et,it,rt)}_slerpAdditive(et,nt,it,rt,ot){const at=this._workIndex*ot;Quaternion.multiplyQuaternionsFlat(et,at,et,nt,et,it),Quaternion.slerpFlat(et,nt,et,nt,et,at,rt)}_lerp(et,nt,it,rt,ot){const at=1-rt;for(let st=0;st!==ot;++st){const lt=nt+st;et[lt]=et[lt]*at+et[it+st]*rt}}_lerpAdditive(et,nt,it,rt,ot){for(let at=0;at!==ot;++at){const st=nt+at;et[st]=et[st]+et[it+at]*rt}}}const _RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones"];class Composite{constructor(et,nt,it){const rt=it||PropertyBinding.parseTrackName(nt);this._targetGroup=et,this._bindings=et.subscribe_(nt,rt)}getValue(et,nt){this.bind();const it=this._targetGroup.nCachedObjects_,rt=this._bindings[it];rt!==void 0&&rt.getValue(et,nt)}setValue(et,nt){const it=this._bindings;for(let rt=this._targetGroup.nCachedObjects_,ot=it.length;rt!==ot;++rt)it[rt].setValue(et,nt)}bind(){const et=this._bindings;for(let nt=this._targetGroup.nCachedObjects_,it=et.length;nt!==it;++nt)et[nt].bind()}unbind(){const et=this._bindings;for(let nt=this._targetGroup.nCachedObjects_,it=et.length;nt!==it;++nt)et[nt].unbind()}}class PropertyBinding{constructor(et,nt,it){this.path=nt,this.parsedPath=it||PropertyBinding.parseTrackName(nt),this.node=PropertyBinding.findNode(et,this.parsedPath.nodeName)||et,this.rootNode=et,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(et,nt,it){return et&&et.isAnimationObjectGroup?new PropertyBinding.Composite(et,nt,it):new PropertyBinding(et,nt,it)}static sanitizeNodeName(et){return et.replace(/\s/g,"_").replace(_reservedRe,"")}static parseTrackName(et){const nt=_trackRe.exec(et);if(nt===null)throw new Error("PropertyBinding: Cannot parse trackName: "+et);const it={nodeName:nt[2],objectName:nt[3],objectIndex:nt[4],propertyName:nt[5],propertyIndex:nt[6]},rt=it.nodeName&&it.nodeName.lastIndexOf(".");if(rt!==void 0&&rt!==-1){const ot=it.nodeName.substring(rt+1);_supportedObjectNames.indexOf(ot)!==-1&&(it.nodeName=it.nodeName.substring(0,rt),it.objectName=ot)}if(it.propertyName===null||it.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+et);return it}static findNode(et,nt){if(nt===void 0||nt===""||nt==="."||nt===-1||nt===et.name||nt===et.uuid)return et;if(et.skeleton){const it=et.skeleton.getBoneByName(nt);if(it!==void 0)return it}if(et.children){const it=function(ot){for(let at=0;at=ot){const ht=ot++,dt=et[ht];nt[dt.uuid]=ut,et[ut]=dt,nt[ct]=ht,et[ht]=lt;for(let pt=0,mt=rt;pt!==mt;++pt){const gt=it[pt],bt=gt[ht],yt=gt[ut];gt[ut]=bt,gt[ht]=yt}}}this.nCachedObjects_=ot}uncache(){const et=this._objects,nt=this._indicesByUUID,it=this._bindings,rt=it.length;let ot=this.nCachedObjects_,at=et.length;for(let st=0,lt=arguments.length;st!==lt;++st){const ct=arguments[st],ut=ct.uuid,ht=nt[ut];if(ht!==void 0)if(delete nt[ut],ht0&&(nt[pt.uuid]=ht),et[ht]=pt,et.pop();for(let mt=0,gt=rt;mt!==gt;++mt){const bt=it[mt];bt[ht]=bt[dt],bt.pop()}}}this.nCachedObjects_=ot}subscribe_(et,nt){const it=this._bindingsIndicesByPath;let rt=it[et];const ot=this._bindings;if(rt!==void 0)return ot[rt];const at=this._paths,st=this._parsedPaths,lt=this._objects,ct=lt.length,ut=this.nCachedObjects_,ht=new Array(ct);rt=ot.length,it[et]=rt,at.push(et),st.push(nt),ot.push(ht);for(let dt=ut,pt=lt.length;dt!==pt;++dt){const mt=lt[dt];ht[dt]=new PropertyBinding(mt,et,nt)}return ht}unsubscribe_(et){const nt=this._bindingsIndicesByPath,it=nt[et];if(it!==void 0){const rt=this._paths,ot=this._parsedPaths,at=this._bindings,st=at.length-1,lt=at[st],ct=et[st];nt[ct]=it,at[it]=lt,at.pop(),ot[it]=ot[st],ot.pop(),rt[it]=rt[st],rt.pop()}}}class AnimationAction{constructor(et,nt,it=null,rt=nt.blendMode){this._mixer=et,this._clip=nt,this._localRoot=it,this.blendMode=rt;const ot=nt.tracks,at=ot.length,st=new Array(at),lt={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding};for(let ct=0;ct!==at;++ct){const ut=ot[ct].createInterpolant(null);st[ct]=ut,ut.settings=lt}this._interpolantSettings=lt,this._interpolants=st,this._propertyBindings=new Array(at),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat,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(et){return this._startTime=et,this}setLoop(et,nt){return this.loop=et,this.repetitions=nt,this}setEffectiveWeight(et){return this.weight=et,this._effectiveWeight=this.enabled?et:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(et){return this._scheduleFading(et,0,1)}fadeOut(et){return this._scheduleFading(et,1,0)}crossFadeFrom(et,nt,it){if(et.fadeOut(nt),this.fadeIn(nt),it){const rt=this._clip.duration,ot=et._clip.duration,at=ot/rt,st=rt/ot;et.warp(1,at,nt),this.warp(st,1,nt)}return this}crossFadeTo(et,nt,it){return et.crossFadeFrom(this,nt,it)}stopFading(){const et=this._weightInterpolant;return et!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(et)),this}setEffectiveTimeScale(et){return this.timeScale=et,this._effectiveTimeScale=this.paused?0:et,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(et){return this.timeScale=this._clip.duration/et,this.stopWarping()}syncWith(et){return this.time=et.time,this.timeScale=et.timeScale,this.stopWarping()}halt(et){return this.warp(this._effectiveTimeScale,0,et)}warp(et,nt,it){const rt=this._mixer,ot=rt.time,at=this.timeScale;let st=this._timeScaleInterpolant;st===null&&(st=rt._lendControlInterpolant(),this._timeScaleInterpolant=st);const lt=st.parameterPositions,ct=st.sampleValues;return lt[0]=ot,lt[1]=ot+it,ct[0]=et/at,ct[1]=nt/at,this}stopWarping(){const et=this._timeScaleInterpolant;return et!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(et)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(et,nt,it,rt){if(!this.enabled){this._updateWeight(et);return}const ot=this._startTime;if(ot!==null){const lt=(et-ot)*it;if(lt<0||it===0)return;this._startTime=null,nt=it*lt}nt*=this._updateTimeScale(et);const at=this._updateTime(nt),st=this._updateWeight(et);if(st>0){const lt=this._interpolants,ct=this._propertyBindings;switch(this.blendMode){case AdditiveAnimationBlendMode:for(let ut=0,ht=lt.length;ut!==ht;++ut)lt[ut].evaluate(at),ct[ut].accumulateAdditive(st);break;case NormalAnimationBlendMode:default:for(let ut=0,ht=lt.length;ut!==ht;++ut)lt[ut].evaluate(at),ct[ut].accumulate(rt,st)}}}_updateWeight(et){let nt=0;if(this.enabled){nt=this.weight;const it=this._weightInterpolant;if(it!==null){const rt=it.evaluate(et)[0];nt*=rt,et>it.parameterPositions[1]&&(this.stopFading(),rt===0&&(this.enabled=!1))}}return this._effectiveWeight=nt,nt}_updateTimeScale(et){let nt=0;if(!this.paused){nt=this.timeScale;const it=this._timeScaleInterpolant;if(it!==null){const rt=it.evaluate(et)[0];nt*=rt,et>it.parameterPositions[1]&&(this.stopWarping(),nt===0?this.paused=!0:this.timeScale=nt)}}return this._effectiveTimeScale=nt,nt}_updateTime(et){const nt=this._clip.duration,it=this.loop;let rt=this.time+et,ot=this._loopCount;const at=it===LoopPingPong;if(et===0)return ot===-1?rt:at&&(ot&1)===1?nt-rt:rt;if(it===LoopOnce){ot===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(rt>=nt)rt=nt;else if(rt<0)rt=0;else{this.time=rt;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=rt,this._mixer.dispatchEvent({type:"finished",action:this,direction:et<0?-1:1})}}else{if(ot===-1&&(et>=0?(ot=0,this._setEndings(!0,this.repetitions===0,at)):this._setEndings(this.repetitions===0,!0,at)),rt>=nt||rt<0){const st=Math.floor(rt/nt);rt-=nt*st,ot+=Math.abs(st);const lt=this.repetitions-ot;if(lt<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,rt=et>0?nt:0,this.time=rt,this._mixer.dispatchEvent({type:"finished",action:this,direction:et>0?1:-1});else{if(lt===1){const ct=et<0;this._setEndings(ct,!ct,at)}else this._setEndings(!1,!1,at);this._loopCount=ot,this.time=rt,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:st})}}else this.time=rt;if(at&&(ot&1)===1)return nt-rt}return rt}_setEndings(et,nt,it){const rt=this._interpolantSettings;it?(rt.endingStart=ZeroSlopeEnding,rt.endingEnd=ZeroSlopeEnding):(et?rt.endingStart=this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:rt.endingStart=WrapAroundEnding,nt?rt.endingEnd=this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:rt.endingEnd=WrapAroundEnding)}_scheduleFading(et,nt,it){const rt=this._mixer,ot=rt.time;let at=this._weightInterpolant;at===null&&(at=rt._lendControlInterpolant(),this._weightInterpolant=at);const st=at.parameterPositions,lt=at.sampleValues;return st[0]=ot,lt[0]=nt,st[1]=ot+et,lt[1]=it,this}}const _controlInterpolantsResultBuffer=new Float32Array(1);class AnimationMixer extends EventDispatcher$1{constructor(et){super(),this._root=et,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(et,nt){const it=et._localRoot||this._root,rt=et._clip.tracks,ot=rt.length,at=et._propertyBindings,st=et._interpolants,lt=it.uuid,ct=this._bindingsByRootAndName;let ut=ct[lt];ut===void 0&&(ut={},ct[lt]=ut);for(let ht=0;ht!==ot;++ht){const dt=rt[ht],pt=dt.name;let mt=ut[pt];if(mt!==void 0)++mt.referenceCount,at[ht]=mt;else{if(mt=at[ht],mt!==void 0){mt._cacheIndex===null&&(++mt.referenceCount,this._addInactiveBinding(mt,lt,pt));continue}const gt=nt&&nt._propertyBindings[ht].binding.parsedPath;mt=new PropertyMixer(PropertyBinding.create(it,pt,gt),dt.ValueTypeName,dt.getValueSize()),++mt.referenceCount,this._addInactiveBinding(mt,lt,pt),at[ht]=mt}st[ht].resultBuffer=mt.buffer}}_activateAction(et){if(!this._isActiveAction(et)){if(et._cacheIndex===null){const it=(et._localRoot||this._root).uuid,rt=et._clip.uuid,ot=this._actionsByClip[rt];this._bindAction(et,ot&&ot.knownActions[0]),this._addInactiveAction(et,rt,it)}const nt=et._propertyBindings;for(let it=0,rt=nt.length;it!==rt;++it){const ot=nt[it];ot.useCount++===0&&(this._lendBinding(ot),ot.saveOriginalState())}this._lendAction(et)}}_deactivateAction(et){if(this._isActiveAction(et)){const nt=et._propertyBindings;for(let it=0,rt=nt.length;it!==rt;++it){const ot=nt[it];--ot.useCount===0&&(ot.restoreOriginalState(),this._takeBackBinding(ot))}this._takeBackAction(et)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const et=this;this.stats={actions:{get total(){return et._actions.length},get inUse(){return et._nActiveActions}},bindings:{get total(){return et._bindings.length},get inUse(){return et._nActiveBindings}},controlInterpolants:{get total(){return et._controlInterpolants.length},get inUse(){return et._nActiveControlInterpolants}}}}_isActiveAction(et){const nt=et._cacheIndex;return nt!==null&&nt=0;--it)et[it].stop();return this}update(et){et*=this.timeScale;const nt=this._actions,it=this._nActiveActions,rt=this.time+=et,ot=Math.sign(et),at=this._accuIndex^=1;for(let ct=0;ct!==it;++ct)nt[ct]._update(rt,et,ot,at);const st=this._bindings,lt=this._nActiveBindings;for(let ct=0;ct!==lt;++ct)st[ct].apply(at);return this}setTime(et){this.time=0;for(let nt=0;ntthis.max.x||et.ythis.max.y)}containsBox(et){return this.min.x<=et.min.x&&et.max.x<=this.max.x&&this.min.y<=et.min.y&&et.max.y<=this.max.y}getParameter(et,nt){return nt.set((et.x-this.min.x)/(this.max.x-this.min.x),(et.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(et){return!(et.max.xthis.max.x||et.max.ythis.max.y)}clampPoint(et,nt){return nt.copy(et).clamp(this.min,this.max)}distanceToPoint(et){return _vector$4.copy(et).clamp(this.min,this.max).sub(et).length()}intersect(et){return this.min.max(et.min),this.max.min(et.max),this}union(et){return this.min.min(et.min),this.max.max(et.max),this}translate(et){return this.min.add(et),this.max.add(et),this}equals(et){return et.min.equals(this.min)&&et.max.equals(this.max)}}const _startP=new Vector3,_startEnd=new Vector3;class Line3{constructor(et=new Vector3,nt=new Vector3){this.start=et,this.end=nt}set(et,nt){return this.start.copy(et),this.end.copy(nt),this}copy(et){return this.start.copy(et.start),this.end.copy(et.end),this}getCenter(et){return et.addVectors(this.start,this.end).multiplyScalar(.5)}delta(et){return et.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(et,nt){return this.delta(nt).multiplyScalar(et).add(this.start)}closestPointToPointParameter(et,nt){_startP.subVectors(et,this.start),_startEnd.subVectors(this.end,this.start);const it=_startEnd.dot(_startEnd);let ot=_startEnd.dot(_startP)/it;return nt&&(ot=clamp$6(ot,0,1)),ot}closestPointToPoint(et,nt,it){const rt=this.closestPointToPointParameter(et,nt);return this.delta(it).multiplyScalar(rt).add(this.start)}applyMatrix4(et){return this.start.applyMatrix4(et),this.end.applyMatrix4(et),this}equals(et){return et.start.equals(this.start)&&et.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const _vector$3=new Vector3;class SpotLightHelper extends Object3D{constructor(et,nt){super(),this.light=et,this.light.updateMatrixWorld(),this.matrix=et.matrixWorld,this.matrixAutoUpdate=!1,this.color=nt;const it=new BufferGeometry,rt=[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 at=0,st=1,lt=32;at.99999)this.quaternion.set(0,0,0,1);else if(et.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(et.z,0,-et.x).normalize();const nt=Math.acos(et.y);this.quaternion.setFromAxisAngle(_axis,nt)}}setLength(et,nt=et*.2,it=nt*.2){this.line.scale.set(1,Math.max(1e-4,et-nt),1),this.line.updateMatrix(),this.cone.scale.set(it,nt,it),this.cone.position.y=et,this.cone.updateMatrix()}setColor(et){this.line.material.color.set(et),this.cone.material.color.set(et)}copy(et){return super.copy(et,!1),this.line.copy(et.line),this.cone.copy(et.cone),this}}class AxesHelper extends LineSegments{constructor(et=1){const nt=[0,0,0,et,0,0,0,0,0,0,et,0,0,0,0,0,0,et],it=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],rt=new BufferGeometry;rt.setAttribute("position",new Float32BufferAttribute(nt,3)),rt.setAttribute("color",new Float32BufferAttribute(it,3));const ot=new LineBasicMaterial({vertexColors:!0,toneMapped:!1});super(rt,ot),this.type="AxesHelper"}setColors(et,nt,it){const rt=new Color$1,ot=this.geometry.attributes.color.array;return rt.set(et),rt.toArray(ot,0),rt.toArray(ot,3),rt.set(nt),rt.toArray(ot,6),rt.toArray(ot,9),rt.set(it),rt.toArray(ot,12),rt.toArray(ot,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class ShapePath{constructor(){this.type="ShapePath",this.color=new Color$1,this.subPaths=[],this.currentPath=null}moveTo(et,nt){return this.currentPath=new Path$1,this.subPaths.push(this.currentPath),this.currentPath.moveTo(et,nt),this}lineTo(et,nt){return this.currentPath.lineTo(et,nt),this}quadraticCurveTo(et,nt,it,rt){return this.currentPath.quadraticCurveTo(et,nt,it,rt),this}bezierCurveTo(et,nt,it,rt,ot,at){return this.currentPath.bezierCurveTo(et,nt,it,rt,ot,at),this}splineThru(et){return this.currentPath.splineThru(et),this}toShapes(et,nt){function it(wt){const vt=[];for(let xt=0,St=wt.length;xtNumber.EPSILON){if(zt<0&&(It=vt[$t],Ht=-Ht,Ft=vt[Et],zt=-zt),wt.yFt.y)continue;if(wt.y===It.y){if(wt.x===It.x)return!0}else{const Ot=zt*(wt.x-It.x)-Ht*(wt.y-It.y);if(Ot===0)return!0;if(Ot<0)continue;St=!St}}else{if(wt.y!==It.y)continue;if(Ft.x<=wt.x&&wt.x<=It.x||It.x<=wt.x&&wt.x<=Ft.x)return!0}}return St}const ot=ShapeUtils.isClockWise,at=this.subPaths;if(at.length===0)return[];if(nt===!0)return it(at);let st,lt,ct;const ut=[];if(at.length===1)return lt=at[0],ct=new Shape$1,ct.curves=lt.curves,ut.push(ct),ut;let ht=!ot(at[0].getPoints());ht=et?!ht:ht;const dt=[],pt=[];let mt=[],gt=0,bt;pt[gt]=void 0,mt[gt]=[];for(let wt=0,vt=at.length;wt1){let wt=!1,vt=0;for(let xt=0,St=pt.length;xt0&&wt===!1&&(mt=dt)}let yt;for(let wt=0,vt=pt.length;wt>-ct-14,it[lt|256]=1024>>-ct-14|32768,rt[lt]=-ct-1,rt[lt|256]=-ct-1):ct<=15?(it[lt]=ct+15<<10,it[lt|256]=ct+15<<10|32768,rt[lt]=13,rt[lt|256]=13):ct<128?(it[lt]=31744,it[lt|256]=64512,rt[lt]=24,rt[lt|256]=24):(it[lt]=31744,it[lt|256]=64512,rt[lt]=13,rt[lt|256]=13)}const ot=new Uint32Array(2048),at=new Uint32Array(64),st=new Uint32Array(64);for(let lt=1;lt<1024;++lt){let ct=lt<<13,ut=0;for(;!(ct&8388608);)ct<<=1,ut-=8388608;ct&=-8388609,ut+=947912704,ot[lt]=ct|ut}for(let lt=1024;lt<2048;++lt)ot[lt]=939524096+(lt-1024<<13);for(let lt=1;lt<31;++lt)at[lt]=lt<<23;at[31]=1199570944,at[32]=2147483648;for(let lt=33;lt<63;++lt)at[lt]=2147483648+(lt-32<<23);at[63]=3347054592;for(let lt=1;lt<64;++lt)lt!==32&&(st[lt]=1024);return{floatView:et,uint32View:nt,baseTable:it,shiftTable:rt,mantissaTable:ot,exponentTable:at,offsetTable:st}}function toHalfFloat(tt){Math.abs(tt)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),tt=clamp$6(tt,-65504,65504),_tables.floatView[0]=tt;const et=_tables.uint32View[0],nt=et>>23&511;return _tables.baseTable[nt]+((et&8388607)>>_tables.shiftTable[nt])}function fromHalfFloat(tt){const et=tt>>10;return _tables.uint32View[0]=_tables.mantissaTable[_tables.offsetTable[et]+(tt&1023)]+_tables.exponentTable[et],_tables.floatView[0]}var DataUtils=Object.freeze({__proto__:null,toHalfFloat,fromHalfFloat});class ParametricGeometry extends BufferGeometry{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class TextGeometry extends BufferGeometry{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function FontLoader(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function Font(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function ImmediateRenderObject(){console.error("THREE.ImmediateRenderObject has been removed.")}class WebGLMultisampleRenderTarget extends WebGLRenderTarget{constructor(et,nt,it){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(et,nt,it),this.samples=4}}class DataTexture2DArray extends DataArrayTexture{constructor(et,nt,it,rt){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(et,nt,it,rt)}}class DataTexture3D extends Data3DTexture{constructor(et,nt,it,rt){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(et,nt,it,rt)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION);const THREE$1=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping,AddEquation,AddOperation,AdditiveAnimationBlendMode,AdditiveBlending,AlphaFormat,AlwaysDepth,AlwaysStencilFunc,AmbientLight,AmbientLightProbe,AnimationClip,AnimationLoader,AnimationMixer,AnimationObjectGroup,AnimationUtils,ArcCurve,ArrayCamera,ArrowHelper,Audio,AudioAnalyser,AudioContext,AudioListener,AudioLoader,AxesHelper,BackSide,BasicDepthPacking,BasicShadowMap,Bone,BooleanKeyframeTrack,Box2,Box3,Box3Helper,BoxBufferGeometry:BoxGeometry,BoxGeometry,BoxHelper,BufferAttribute,BufferGeometry,BufferGeometryLoader,ByteType,Cache,Camera,CameraHelper,CanvasTexture,CapsuleBufferGeometry:CapsuleGeometry,CapsuleGeometry,CatmullRomCurve3,CineonToneMapping,CircleBufferGeometry:CircleGeometry,CircleGeometry,ClampToEdgeWrapping,Clock:Clock$1,Color:Color$1,ColorKeyframeTrack,ColorManagement,CompressedTexture,CompressedTextureLoader,ConeBufferGeometry:ConeGeometry,ConeGeometry,CubeCamera,CubeReflectionMapping,CubeRefractionMapping,CubeTexture,CubeTextureLoader,CubeUVReflectionMapping,CubicBezierCurve,CubicBezierCurve3,CubicInterpolant,CullFaceBack,CullFaceFront,CullFaceFrontBack,CullFaceNone,Curve:Curve$1,CurvePath,CustomBlending,CustomToneMapping,CylinderBufferGeometry:CylinderGeometry,CylinderGeometry,Cylindrical,Data3DTexture,DataArrayTexture,DataTexture,DataTexture2DArray,DataTexture3D,DataTextureLoader,DataUtils,DecrementStencilOp,DecrementWrapStencilOp,DefaultLoadingManager,DepthFormat,DepthStencilFormat,DepthTexture,DirectionalLight,DirectionalLightHelper,DiscreteInterpolant,DodecahedronBufferGeometry:DodecahedronGeometry,DodecahedronGeometry,DoubleSide,DstAlphaFactor,DstColorFactor,DynamicCopyUsage,DynamicDrawUsage,DynamicReadUsage,EdgesGeometry,EllipseCurve,EqualDepth,EqualStencilFunc,EquirectangularReflectionMapping,EquirectangularRefractionMapping,Euler,EventDispatcher:EventDispatcher$1,ExtrudeBufferGeometry:ExtrudeGeometry,ExtrudeGeometry,FileLoader,FlatShading,Float16BufferAttribute,Float32BufferAttribute,Float64BufferAttribute,FloatType,Fog,FogExp2,Font,FontLoader,FramebufferTexture,FrontSide,Frustum,GLBufferAttribute,GLSL1,GLSL3,GreaterDepth,GreaterEqualDepth,GreaterEqualStencilFunc,GreaterStencilFunc,GridHelper,Group,HalfFloatType,HemisphereLight,HemisphereLightHelper,HemisphereLightProbe,IcosahedronBufferGeometry:IcosahedronGeometry,IcosahedronGeometry,ImageBitmapLoader,ImageLoader,ImageUtils,ImmediateRenderObject,IncrementStencilOp,IncrementWrapStencilOp,InstancedBufferAttribute,InstancedBufferGeometry,InstancedInterleavedBuffer,InstancedMesh,Int16BufferAttribute,Int32BufferAttribute,Int8BufferAttribute,IntType,InterleavedBuffer,InterleavedBufferAttribute,Interpolant,InterpolateDiscrete,InterpolateLinear,InterpolateSmooth,InvertStencilOp,KeepStencilOp,KeyframeTrack,LOD,LatheBufferGeometry:LatheGeometry,LatheGeometry,Layers,LessDepth,LessEqualDepth,LessEqualStencilFunc,LessStencilFunc,Light,LightProbe,Line:Line$2,Line3,LineBasicMaterial,LineCurve,LineCurve3,LineDashedMaterial,LineLoop,LineSegments,LinearEncoding,LinearFilter,LinearInterpolant,LinearMipMapLinearFilter,LinearMipMapNearestFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,LinearSRGBColorSpace:LinearSRGBColorSpace$1,LinearToneMapping,Loader:Loader$2,LoaderUtils,LoadingManager,LoopOnce,LoopPingPong,LoopRepeat,LuminanceAlphaFormat,LuminanceFormat,MOUSE,Material,MaterialLoader,MathUtils,Matrix3,Matrix4,MaxEquation,Mesh,MeshBasicMaterial,MeshDepthMaterial,MeshDistanceMaterial,MeshLambertMaterial,MeshMatcapMaterial,MeshNormalMaterial,MeshPhongMaterial,MeshPhysicalMaterial,MeshStandardMaterial,MeshToonMaterial,MinEquation,MirroredRepeatWrapping,MixOperation,MultiplyBlending,MultiplyOperation,NearestFilter,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,NeverDepth,NeverStencilFunc,NoBlending,NoColorSpace:NoColorSpace$1,NoToneMapping,NormalAnimationBlendMode,NormalBlending,NotEqualDepth,NotEqualStencilFunc,NumberKeyframeTrack,Object3D,ObjectLoader,ObjectSpaceNormalMap,OctahedronBufferGeometry:OctahedronGeometry,OctahedronGeometry,OneFactor,OneMinusDstAlphaFactor,OneMinusDstColorFactor,OneMinusSrcAlphaFactor,OneMinusSrcColorFactor,OrthographicCamera,PCFShadowMap,PCFSoftShadowMap,PMREMGenerator,ParametricGeometry,Path:Path$1,PerspectiveCamera,Plane,PlaneBufferGeometry:PlaneGeometry,PlaneGeometry,PlaneHelper,PointLight,PointLightHelper,Points,PointsMaterial,PolarGridHelper,PolyhedronBufferGeometry:PolyhedronGeometry,PolyhedronGeometry,PositionalAudio,PropertyBinding,PropertyMixer,QuadraticBezierCurve,QuadraticBezierCurve3,Quaternion,QuaternionKeyframeTrack,QuaternionLinearInterpolant,REVISION,RGBADepthPacking,RGBAFormat,RGBAIntegerFormat,RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format,RGBA_BPTC_Format,RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format,RGBFormat,RGB_ETC1_Format,RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format,RGFormat,RGIntegerFormat,RawShaderMaterial,Ray,Raycaster,RectAreaLight,RedFormat,RedIntegerFormat,ReinhardToneMapping,RepeatWrapping,ReplaceStencilOp,ReverseSubtractEquation,RingBufferGeometry:RingGeometry,RingGeometry,SRGBColorSpace:SRGBColorSpace$1,Scene,ShaderChunk,ShaderLib,ShaderMaterial,ShadowMaterial,Shape:Shape$1,ShapeBufferGeometry:ShapeGeometry,ShapeGeometry,ShapePath,ShapeUtils,ShortType,Skeleton:Skeleton$2,SkeletonHelper,SkinnedMesh,SmoothShading,Source:Source$1,Sphere,SphereBufferGeometry:SphereGeometry,SphereGeometry,Spherical,SphericalHarmonics3,SplineCurve,SpotLight,SpotLightHelper,Sprite,SpriteMaterial,SrcAlphaFactor,SrcAlphaSaturateFactor,SrcColorFactor,StaticCopyUsage,StaticDrawUsage,StaticReadUsage,StereoCamera,StreamCopyUsage,StreamDrawUsage,StreamReadUsage,StringKeyframeTrack,SubtractEquation,SubtractiveBlending,TOUCH,TangentSpaceNormalMap,TetrahedronBufferGeometry:TetrahedronGeometry,TetrahedronGeometry,TextGeometry,Texture,TextureLoader,TorusBufferGeometry:TorusGeometry,TorusGeometry,TorusKnotBufferGeometry:TorusKnotGeometry,TorusKnotGeometry,Triangle,TriangleFanDrawMode,TriangleStripDrawMode,TrianglesDrawMode,TubeBufferGeometry:TubeGeometry,TubeGeometry,UVMapping,Uint16BufferAttribute,Uint32BufferAttribute,Uint8BufferAttribute,Uint8ClampedBufferAttribute,Uniform,UniformsGroup,UniformsLib,UniformsUtils,UnsignedByteType,UnsignedInt248Type,UnsignedIntType,UnsignedShort4444Type,UnsignedShort5551Type,UnsignedShortType,VSMShadowMap,Vector2,Vector3,Vector4,VectorKeyframeTrack,VideoTexture,WebGL1Renderer,WebGL3DRenderTarget,WebGLArrayRenderTarget,WebGLCubeRenderTarget,WebGLMultipleRenderTargets,WebGLMultisampleRenderTarget,WebGLRenderTarget,WebGLRenderer,WebGLUtils,WireframeGeometry,WrapAroundEnding,ZeroCurvatureEnding,ZeroFactor,ZeroSlopeEnding,ZeroStencilOp,_SRGBAFormat,sRGBEncoding},Symbol.toStringTag,{value:"Module"})),createStoreImpl=tt=>{let et;const nt=new Set,it=(lt,ct)=>{const ut=typeof lt=="function"?lt(et):lt;if(!Object.is(ut,et)){const ht=et;et=ct??(typeof ut!="object"||ut===null)?ut:Object.assign({},et,ut),nt.forEach(dt=>dt(et,ht))}},rt=()=>et,st={setState:it,getState:rt,subscribe:lt=>(nt.add(lt),()=>nt.delete(lt)),destroy:()=>{nt.clear()}};return et=tt(it,rt,st),st},createStore$3=tt=>tt?createStoreImpl(tt):createStoreImpl;var withSelector={exports:{}},withSelector_production_min={},shim$2={exports:{}},useSyncExternalStoreShim_production_min={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -3379,77 +3379,77 @@ A Bitcoin Podcast. `},{children:["1ba72c1d-ff22-4572-ad24-8171bfce9de3","5efbc2c3-e67a-4b16-9c9d-285bdd37e906"],episode_title:"Bitcoin Charlotte Book Club - Sovereign Individual Ch 1-7",guests:[{name:"Bolt",profile_picture:"https://pbs.twimg.com/profile_images/1352721439879786496/wfevZ8bG_400x400.jpg",ref_id:"b165e497-f255-4ce5-9762-30c90dcf776d",twitter_handle:"Bitcoin_CLT"},{name:"Victor",profile_picture:"https://pbs.twimg.com/profile_images/1519726025013350400/GHxSzgA3_400x400.jpg",ref_id:"d91fff8d-e4c6-4aeb-9f32-021e4a4ff9a6",twitter_handle:"victorwong"},{name:"George",profile_picture:"https://pbs.twimg.com/profile_images/1173474608856608768/vEBnPUdm_400x400.jpg",ref_id:"5946bdf6-8feb-43aa-b2ca-46b2944b0572",twitter_handle:"GeorgeNotFound"},{name:"Mark",profile_picture:"https://pbs.twimg.com/profile_images/1511102924310544387/j6E29xq6_400x400.jpg",ref_id:"c8cd0c95-c105-41c4-8fae-9dbfa76d84f2",twitter_handle:"markiplier"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/fe6bdbce-e91d-43cf-ab33-0e98bffabecc.jpg",node_type:"episode",ref_id:"9dcca755-0a20-45e5-8e4d-dfe2800b9c6f",show_title:"Bitcoin Charlotte"},{children:["821f7b5c-c6ad-422b-b4e1-ed34f915e4af"],episode_title:"TABConf Mixtape Vol 2: Sound Bites from TABConf",guests:[{name:"Michael",profile_picture:"https://pbs.twimg.com/profile_images/1558687629599657990/vf-bU14b_400x400.jpg",ref_id:"c7b4faa1-db77-4459-b03f-0e41e15efae7",twitter_handle:"MichaelHawaii"},{name:"Ben",profile_picture:"https://pbs.twimg.com/profile_images/1580596905721171969/0NnLeJWA_400x400.jpg",ref_id:"da0132b9-0d19-43e6-bc1a-9c7818c79ba4",twitter_handle:"benshapiro"},{name:"brandon",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"8a27da7a-c05c-44da-8247-3c5f68bc3164",twitter_handle:"ThrillerBitcoin"},{name:"shane",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"2e5ce678-7d04-4a48-8bd1-281329ea9424",twitter_handle:"ThrillerBitcoin"},{name:"exfrog",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"d0dc102c-404e-4753-9290-9a3fe27fe2ee",twitter_handle:"ThrillerBitcoin"},{name:"josh",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"34eb29e3-da86-485f-b20a-059f7d41f6ad",twitter_handle:"ThrillerBitcoin"},{name:"autumn",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"3224f2ec-3e77-485f-88b8-6930e19f8ac6",twitter_handle:"ThrillerBitcoin"},{name:"buck",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"00a55ec0-9b1a-482a-893a-345d350a33a0",twitter_handle:"ThrillerBitcoin"},{name:"stephen",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"9dc56711-eacc-4691-821e-fe2a26855ea9",twitter_handle:"ThrillerBitcoin"},{name:"hodl",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"b012eda0-b78c-46e7-ab46-6a7139584fc7",twitter_handle:"ThrillerBitcoin"},{name:"evan",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"9a8418e9-8976-425c-95ce-ed2fe307e380",twitter_handle:"ThrillerBitcoin"},{name:"muzz",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"444b8330-caa1-4bcf-8144-7d9110ae2242",twitter_handle:"ThrillerBitcoin"},{name:"thomas",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"e2140e58-314d-4425-bc97-20f52f951866",twitter_handle:"ThrillerBitcoin"},{name:"justin",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"2ce04090-b9b1-4e84-a87f-9c9dc9ececec",twitter_handle:"ThrillerBitcoin"},{name:"stakamoto",profile_picture:"https://pbs.twimg.com/profile_images/1575598727812812803/4FkPb0vt_400x400.jpg",ref_id:"8b249d9b-8521-4e0e-bf24-2d8b8721d26b",twitter_handle:"ThrillerBitcoin"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/4240c90e-0086-4ece-bfe5-84a282c5059e.jpg",node_type:"episode",ref_id:"b8289cbb-ec69-49a8-b6ab-c1fd808acc09",show_title:"Thriller Bitcoin"},{children:["c13cad10-b242-4812-ad19-3bce525dfeb0"],episode_title:"Pieter Wuille and Tim Ruffing - Nesting, ROAST, Half-Aggregation, Adaptor Signatures (part 2)",guests:[{name:"Tim Ruffing",profile_picture:"https://pbs.twimg.com/profile_images/925128264502439936/XcmMIk8k_400x400.jpg",ref_id:"222f7374-6d68-4934-81ed-37567c515b59",twitter_handle:"real_or_random"},{name:"Pieter Wuille",profile_picture:"https://pbs.twimg.com/profile_images/1264051937172836353/n7gHdLbB_400x400.jpg",ref_id:"40260d2f-3480-47d6-8515-d2e780901273",twitter_handle:"pwuille"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/24a144b0-7ca3-40e9-9c42-86b9fce0b662.jpg",node_type:"episode",ref_id:"daddd93e-7bc6-4c50-a150-5199b437afc9",show_title:"The Chaincode Podcast"},{children:["2a01dc8c-19f7-47a8-bfa8-92645a7314c0","1510e150-aee2-42cb-ac57-79b4997bb6cb","9abcd65c-f311-4a4a-ae65-bbef89f36fc7"],episode_title:"BR023 - OP_VAULT for Bitcoin Covenants Panel ft. James O'Beirne, Rijndael, Antoine Poinsot & Carman",guests:[{name:"Carman",profile_picture:"https://pbs.twimg.com/profile_images/1609775498971725824/5vyAafE3_400x400.jpg",ref_id:"09405d70-6fa6-4f2c-92f1-a2951ad56447",twitter_handle:"benthecarman"},{name:"Antoine Poinsot",profile_picture:"https://pbs.twimg.com/profile_images/1108377445936316423/ArRDGbr5_400x400.jpg",ref_id:"1ba10809-b3e6-4e37-a906-697a0368b814",twitter_handle:"darosior"},{name:"Rijndael",profile_picture:"https://pbs.twimg.com/profile_images/1542705395873058817/0zsy4Yur_400x400.jpg",ref_id:"861d5324-8ede-4059-826f-f29abca5d7e6",twitter_handle:"rot13maxi"},{name:"James O'Beirne",profile_picture:"https://pbs.twimg.com/profile_images/1542173995650408450/iDxrdmuj_400x400.jpg",ref_id:"e8e48fcf-9e54-4c66-9b20-aacf5c5b504e",twitter_handle:"jamesob"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/f1879df9-9bc6-4a76-951f-24548da768ef.jpg",node_type:"episode",ref_id:"56bf65e9-41d5-42e1-95d6-239e4c835781",show_title:"Bitcoin.Review Podcast with NVK & Guests"},{children:["62034201-203b-42ff-9884-a850d6298caf"],episode_title:"BR020 - Zeus, Alby, Bitcoin Knots Keys Leaked +MORE ft. Sjors, Schmidty, Evan Kaloudis & Justin Moon",guests:[{name:"Sjors",profile_picture:"",ref_id:"fa5c587a-09ef-4cbd-b470-cfc78163f749",twitter_handle:""},{name:"Evan Kaloudis",profile_picture:"https://pbs.twimg.com/profile_images/1596923848997445633/DqxrGpkW_400x400.jpg",ref_id:"420172fa-9431-4ba4-965c-adab17648d1b",twitter_handle:"evankaloudis"},{name:"Schmidty",profile_picture:"https://pbs.twimg.com/profile_images/1334879848280494083/A6ssSEfV_400x400.jpg",ref_id:"28f55137-e733-4f5b-b988-7cb60ef0d330",twitter_handle:"bitschmidty"},{name:"Justin Moon",profile_picture:"https://pbs.twimg.com/profile_images/1512674225651335169/iYHDJQcy_400x400.jpg",ref_id:"1d2cdf64-358f-4b00-8f2b-0c94f798dc2c",twitter_handle:"_JustinMoon_"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/f1879df9-9bc6-4a76-951f-24548da768ef.jpg",node_type:"episode",ref_id:"ff88a8b8-bcd6-4d86-8a65-8a68def35b9f",show_title:"Bitcoin.Review Podcast with NVK & Guests"},{children:["08600eb8-a8b1-4be4-b505-3adc409da2f8","1958362b-b149-4466-b873-4d22a36d67d8"],episode_title:"BR019 - Proof of Keys Day Twitter Space ft. Lopp, Craig Raw, Lazy Ninja, mshodl, Rijndael & guests",guests:[],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/f1879df9-9bc6-4a76-951f-24548da768ef.jpg",node_type:"episode",ref_id:"810a3acb-e30e-46bc-8c67-1d504b2e7c09",show_title:"Bitcoin.Review Podcast with NVK & Guests"},{children:["f9d1d228-19db-4a2d-bfb3-7853fd745ea0","88a4665a-7414-4ccd-96e4-3fb43f93d9bc"],episode_title:"Taproot Activation Q&A with Bitcoin Devs - TABConf 2021",guests:[{name:"Andrew Chow",profile_picture:"https://pbs.twimg.com/profile_images/1452266201770496010/44FHCtZM_400x400.jpg",ref_id:"f96d87ca-5060-4021-aeb9-61db03312027",twitter_handle:"andrewrchow"},{name:"Ben Carman",profile_picture:"https://pbs.twimg.com/profile_images/1550704386007089152/pLwUSeff_400x400.jpg",ref_id:"1d1e95ba-b4af-415f-aafe-85c6dd7571b8",twitter_handle:"benthecarman"},{name:"Matt Corallo",profile_picture:"https://pbs.twimg.com/profile_images/697361498587451394/_rX0-O0W_400x400.png",ref_id:"08cb3c45-c0bc-4a60-ae5b-a1283d352c8b",twitter_handle:"TheBlueMatt"},{name:"Pieter Wuille",profile_picture:"https://pbs.twimg.com/profile_images/1264051937172836353/n7gHdLbB_400x400.jpg",ref_id:"40260d2f-3480-47d6-8515-d2e780901273",twitter_handle:"pwuille"},{name:"Vivek Kasarabada",profile_picture:"",ref_id:"60ed22d0-8cf3-410e-8a7c-9c343ae109ca",twitter_handle:""},{name:"Murch",profile_picture:"https://pbs.twimg.com/profile_images/1269477743525130241/-U843Cmt_400x400.png",ref_id:"3e2c1c73-a057-4475-9782-3bb0d3d8cc62",twitter_handle:"murchandamus"},{name:"Andrew Poelstra",profile_picture:"https://pbs.twimg.com/profile_images/1316562683009921024/FSscAYvJ_400x400.jpg",ref_id:"15fb9c53-c988-4af1-bbf0-4832d71b0a01",twitter_handle:"Blockstream"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e7d2a4ca-6b44-4a45-a94c-6f48987979f7.jpg",node_type:"episode",ref_id:"f7e75069-adf6-41b0-9bb7-a6a2aa846493",show_title:"TABConf (The Atlanta Bitcoin Conference)"},{children:["cd29b1a1-f94b-4eee-84ce-ddf8a4fcb0c5"],episode_title:"Lightning for Plebs - TABConf 2021",guests:[{name:"ketominer",profile_picture:"https://pbs.twimg.com/profile_images/1245972079528329218/YDUD9N2Q_400x400.jpg",ref_id:"2f8b0b59-6f23-4c89-973c-668cc7666998",twitter_handle:"ketominer"},{name:"Ryan Gentry",profile_picture:"https://pbs.twimg.com/profile_images/1362751223217160203/ekMa_yY-_400x400.jpg",ref_id:"8fe78b55-bc38-40df-9cb5-ffd5c84166a2",twitter_handle:"RyanTheGentry"},{name:"Dread",profile_picture:"https://pbs.twimg.com/profile_images/1532557131819491328/vvs1cD-7_400x400.jpg",ref_id:"e61af76b-8fbd-4719-b753-0a70edd22fa8",twitter_handle:"PoleVaultDream"},{name:"Andre Neves",profile_picture:"https://pbs.twimg.com/profile_images/1604172627550969856/bYCGb7Ev_400x400.jpg",ref_id:"227e071d-f8a6-4137-8078-729fa9eb3a13",twitter_handle:"andreneves"},{name:"Nate G",profile_picture:"https://pbs.twimg.com/profile_images/1542983032507858944/9w_UUx5Z_400x400.jpg",ref_id:"bda29551-f17f-452c-9204-4d6cafdf4f3b",twitter_handle:"natecgriffin"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e7d2a4ca-6b44-4a45-a94c-6f48987979f7.jpg",node_type:"episode",ref_id:"6eb2a481-408f-4989-9f28-67789651259a",show_title:"TABConf (The Atlanta Bitcoin Conference)"},{children:["6731ba0c-c57b-4fb1-a2f6-6e1ec641e830"],episode_title:"Brink Projects: Research and Improvements for Bitcoin - TABConf 2021",guests:[{name:"Gloria Zhao",profile_picture:"https://pbs.twimg.com/profile_images/1144496084330266631/aPKPfoX3_400x400.png",ref_id:"cebd71c3-4ccf-452d-8ba7-4982f49fd060",twitter_handle:"GloriaHuiZhao"},{name:"Mike Schmidt",profile_picture:"https://pbs.twimg.com/profile_images/1320935020589158400/gFovyRlj_400x400.jpg",ref_id:"d503db9b-a7b1-49e1-8ef6-7541df3c2473",twitter_handle:"nytmike"},{name:"Jesse Posner",profile_picture:"https://pbs.twimg.com/profile_images/1467067234484830213/T6PtLZq1_400x400.jpg",ref_id:"bb55767f-dfbb-4182-8dd8-e1b08e0c6ad6",twitter_handle:"jesseposner"},{name:"Larry Ruane",profile_picture:"https://pbs.twimg.com/profile_images/1226076521/bike_crop_400x400.JPG",ref_id:"ce38f2dd-d41f-4957-ad83-671c3dc29cc5",twitter_handle:"larryruane"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e7d2a4ca-6b44-4a45-a94c-6f48987979f7.jpg",node_type:"episode",ref_id:"89049a1c-0171-4999-b003-57e1b57d92b2",show_title:"TABConf (The Atlanta Bitcoin Conference)"},{children:["acdb65ab-789f-480c-9f88-414599d19a43"],episode_title:"Scaling Bitcoin Off-Chain - TABConf 2021",guests:[{name:"Graham Krizek",profile_picture:"https://pbs.twimg.com/profile_images/1600169182347288582/yNztRz0g_400x400.jpg",ref_id:"186974f3-37dd-4d62-9d88-1b7fa88c6cce",twitter_handle:"gkrizek"},{name:"Stephen Livera",profile_picture:"https://pbs.twimg.com/profile_images/1362551718110580740/v-W5Q2uo_400x400.jpg",ref_id:"9c9974bd-6a59-480f-8d5a-12b634b15b39",twitter_handle:"stephanlivera"},{name:"Alex Bosworth",profile_picture:"https://pbs.twimg.com/profile_images/1364274244960481281/G5gNi3di_400x400.jpg",ref_id:"2389663a-f7f8-42a7-99da-551089a9ea6a",twitter_handle:"alexbosworth"},{name:"Matt Corallo",profile_picture:"https://pbs.twimg.com/profile_images/697361498587451394/_rX0-O0W_400x400.png",ref_id:"08cb3c45-c0bc-4a60-ae5b-a1283d352c8b",twitter_handle:"TheBlueMatt"},{name:"Niftynei",profile_picture:"https://pbs.twimg.com/profile_images/1594756549162975240/J-4dbH6W_400x400.jpg",ref_id:"5e9f617b-cc12-4e3d-9fb5-ad058f14b171",twitter_handle:"niftynei"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e7d2a4ca-6b44-4a45-a94c-6f48987979f7.jpg",node_type:"episode",ref_id:"d842ce17-a4c0-49a6-bdc5-5268f1d61779",show_title:"TABConf (The Atlanta Bitcoin Conference)"},{children:["65a9d9c6-3211-444a-a49f-f4a34b9ab5fb","d96fca70-c1c7-4b71-9d35-9aadf2820909"],episode_title:"Scaling Bitcoin On-Chain - TABConf 2021",guests:[{name:"Andrew Chow",profile_picture:"https://pbs.twimg.com/profile_images/1452266201770496010/44FHCtZM_400x400.jpg",ref_id:"f96d87ca-5060-4021-aeb9-61db03312027",twitter_handle:"andrewrchow"},{name:"Mark Erhardt Murch",profile_picture:"https://pbs.twimg.com/profile_images/1269477743525130241/-U843Cmt_400x400.png",ref_id:"ef2f2f68-ae16-4e78-80cb-0be9bd156988",twitter_handle:"Murchandamus"},{name:"Andrew Poelstra",profile_picture:"https://pbs.twimg.com/profile_images/1316562683009921024/FSscAYvJ_400x400.jpg",ref_id:"15fb9c53-c988-4af1-bbf0-4832d71b0a01",twitter_handle:"Blockstream"},{name:"Peter Wuille",profile_picture:"https://pbs.twimg.com/profile_images/1264051937172836353/n7gHdLbB_400x400.jpg",ref_id:"fb836ce4-a933-4419-99d8-932fe65219a1",twitter_handle:"pwuille"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e7d2a4ca-6b44-4a45-a94c-6f48987979f7.jpg",node_type:"episode",ref_id:"8d9b0689-2e69-44c1-afe2-3519e999390a",show_title:"TABConf (The Atlanta Bitcoin Conference)"},{children:["9f69933d-69fe-47a0-af4d-9d80726e60aa","f507641d-2514-41d3-a4f3-9b218136fa98","addee850-119f-472c-87c2-05fc0642abeb"],episode_title:"Cool Apps Built on Lightning - March 16, 2022 - Voltage Twitter Spaces",guests:[{name:"Chad Atkins",profile_picture:"https://pbs.twimg.com/profile_images/1200611447979544576/W9ocRJTb_400x400.jpg",ref_id:"62da3c50-0a46-400b-81a3-5f482f5b8fee",twitter_handle:"Chemchad"},{name:"Michael Atwood",profile_picture:"https://pbs.twimg.com/profile_images/1362207977470521345/Jy2_Ge60_400x400.jpg",ref_id:"16359ade-afb9-4a37-be0b-0844a6134327",twitter_handle:"Dooowta"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/2ec62250-4755-4616-8342-096a2cfab95f.jpg",node_type:"episode",ref_id:"3b818893-4605-499c-a467-5abcc23f9483",show_title:"Voltage"},{children:["c7beffcd-bb44-4cf9-a04a-a26f6439114c","3db5f375-817e-4275-980c-6475803c430b"],episode_title:"Lightning Networks Impact on Music w/ Michael Rhee, Founder of Wavlake - Voltage Twitter Spaces",guests:[{name:"Michael Rhee",profile_picture:"https://pbs.twimg.com/profile_images/1348612450/IMG_0298_400x400.JPG",ref_id:"91302fb9-2d08-400e-bd1f-2d52e0af5508",twitter_handle:"rheedio"},{name:"@rheedio",profile_picture:"https://pbs.twimg.com/profile_images/1348612450/IMG_0298_400x400.JPG",ref_id:"a20f5e1f-5969-47a6-b986-faf29c0c4da0",twitter_handle:"rheedio"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/2ec62250-4755-4616-8342-096a2cfab95f.jpg",node_type:"episode",ref_id:"a44e78cd-dc66-4b67-9523-7ddff0d3655f",show_title:"Voltage"},{children:["f10270d7-1cdc-4922-853a-1f8247750382","d2d3e71f-24ad-4cf3-b516-f63ac5283d50"],episode_title:"TRUBIT bringing Digital Loyalty Assets to Bitcoin - Voltage Twitter Spaces",guests:[{name:"@0xLinden",profile_picture:"https://pbs.twimg.com/profile_images/1439365331202437125/JBiXogun_400x400.jpg",ref_id:"b8bb4402-8f86-4220-9dee-0fa28ff8de72",twitter_handle:"0xLinden"},{name:"Stephen Doge",profile_picture:"https://pbs.twimg.com/profile_images/1215979900387184641/nZXkhgoP_400x400.jpg",ref_id:"076972a2-cdab-4766-8c66-618472b80772",twitter_handle:"StephenDodge20"},{name:"@617a7a",profile_picture:"https://pbs.twimg.com/profile_images/1548336437308715016/FUZFJf9k_400x400.jpg",ref_id:"148d77a5-6e95-4855-9e17-19e68f648898",twitter_handle:"617a7a"},{name:"@ian__major",profile_picture:"https://pbs.twimg.com/profile_images/1427414299169984517/Hw0ux6ie_400x400.jpg",ref_id:"7ed41a74-21a4-43a4-9a05-e977c981b6d3",twitter_handle:"ian__major"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/2ec62250-4755-4616-8342-096a2cfab95f.jpg",node_type:"episode",ref_id:"0c4f330b-a39d-4312-9775-58b42c7c9723",show_title:"Voltage"},{children:["076eecc3-0553-4bb7-8fe2-9f43a6d54f79","4310fd96-1c4f-42a7-b72f-60fc5968c75d","3d451e38-8616-43bc-8269-c3b8ce7d9b15","ca89bac3-188b-4e90-8d0b-fe42d0abf067","d0f57eb5-87ba-4180-ad39-96589093a0f0"],episode_title:"Small Businesses Embracing Bitcoin w/ Michael from Oshi App - Voltage Twitter Spaces",guests:[{name:"Michael Atwood",profile_picture:"https://pbs.twimg.com/profile_images/1362207977470521345/Jy2_Ge60_400x400.jpg",ref_id:"16359ade-afb9-4a37-be0b-0844a6134327",twitter_handle:"Dooowta"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/2ec62250-4755-4616-8342-096a2cfab95f.jpg",node_type:"episode",ref_id:"205a0650-fefe-4aaf-a894-faa8b72d966a",show_title:"Voltage"},{children:["e9443306-25af-42d3-830d-ed6a26721103"],episode_title:"Austin Bitcoin Design Club Interview w/ Sahil, FuturePaul, and Car",guests:[{name:"Car Gonzalez",profile_picture:"https://pbs.twimg.com/profile_images/1541855444720836608/F4v02BuD_400x400.jpg",ref_id:"b554604d-47eb-4c7c-b6c9-87a062e6a844",twitter_handle:"Car_mdq_2010"},{name:"Sahil Chaturvedi",profile_picture:"https://pbs.twimg.com/profile_images/1362511727066107904/yP4o43cz_400x400.jpg",ref_id:"8b56eaa4-c9d6-46e8-a313-fbccd0ee86b5",twitter_handle:"SahilC0"},{name:"Future Paul",profile_picture:"https://pbs.twimg.com/profile_images/1508452962917666821/1QheRD09_400x400.jpg",ref_id:"ec933e22-f395-4817-b608-4337eaaf60a4",twitter_handle:"futurepaul"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/2ec62250-4755-4616-8342-096a2cfab95f.jpg",node_type:"episode",ref_id:"a60dc641-5d14-4960-ab73-66ff199edd1d",show_title:"Voltage"},{children:["f3d0a35e-3e21-4c0c-874c-d6f2b1f37eed"],episode_title:"The Future of Bitcoin Technology with Pierre Rochard, Dhruv Bansal, Warren Togami and Guy Swann",guests:[{name:"Warren Togami",profile_picture:"https://pbs.twimg.com/profile_images/1577819570039128065/bBmumEx9_400x400.jpg",ref_id:"f082b94a-673f-4b99-b46e-49a342b5792a",twitter_handle:"wtogami"},{name:"Dhruv Bansal",profile_picture:"https://pbs.twimg.com/profile_images/908397811284172800/kR9kKNsE_400x400.jpg",ref_id:"6ed2b14a-d97d-4a3f-b5b5-4c3222d85624",twitter_handle:"dhruvbansal"},{name:"Pierre Rochard",profile_picture:"https://pbs.twimg.com/profile_images/1567258180861792256/EEEBkvQR_400x400.jpg",ref_id:"426b30ba-7c24-4558-b926-ec307756a876",twitter_handle:"BitcoinPierre"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/492cbcce-3744-4d8b-b2ca-3a7f063e798a.jpg",node_type:"episode",ref_id:"3af98dc1-5e7c-4ef3-ad74-b9b6afaee8b9",show_title:"Swan Bitcoin"},{children:["6e890ef3-7358-40d6-a01f-44f444dbabfc"],episode_title:"#Bitcoin Mining Saves the World - Brought to you by Marathon",guests:[{name:"Steve Barbour",profile_picture:"https://pbs.twimg.com/profile_images/1592714173469065216/q8kXPyQI_400x400.jpg",ref_id:"63a731b8-4759-4360-9e9d-d66f884e12d8",twitter_handle:"SGBarbour"},{name:"Nathaniel Harmon",profile_picture:"https://pbs.twimg.com/profile_images/1578090357102780416/etXW-RA9_400x400.jpg",ref_id:"9105fb4e-4150-4c25-90f1-8ea770585749",twitter_handle:"NateHawaii"},{name:"Taylor Monnig",profile_picture:"https://pbs.twimg.com/profile_images/1599563776621219840/mvb8y3zY_400x400.jpg",ref_id:"b8513b01-ff94-4d7f-944f-5c92e1126885",twitter_handle:"taylorbmonnig"},{name:"Harry Suddock",profile_picture:"",ref_id:"6440ea0f-c982-4b76-b7c2-9c6bf7e9a4a9",twitter_handle:""}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/492cbcce-3744-4d8b-b2ca-3a7f063e798a.jpg",node_type:"episode",ref_id:"625d9252-2f5e-4f53-b577-dd2dfd4d4749",show_title:"Swan Bitcoin"},{children:["876e20ef-be1b-44e6-a77d-4af5beb33ad4"],episode_title:"Austin Bitcoin Club: August - Value for Value Panel",guests:[{name:"Justin Rezvani",profile_picture:"https://pbs.twimg.com/profile_images/1574666257781104641/hWG0vkSQ_400x400.jpg",ref_id:"b00877d0-ccbe-4c77-9c8c-88ab15063150",twitter_handle:"justin_rezvani"},{name:"Lyle Pratt",profile_picture:"https://pbs.twimg.com/profile_images/1477702801962721285/KqnrA7oU_400x400.jpg",ref_id:"ab752a01-84bb-4260-a683-2eb5798b1dce",twitter_handle:"lylepratt"},{name:"Keyan Kousha",profile_picture:"https://pbs.twimg.com/profile_images/1403763601391951878/ybuppfHt_400x400.jpg",ref_id:"7ef39c9b-63ba-4dd0-989e-2230afb45129",twitter_handle:"k00bideh"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/b29c81c8-cccd-4a6b-b78f-3c1591a54d27.jpg",node_type:"episode",ref_id:"8eef2f82-bbf9-4fef-ba3d-102679d4a1a5",show_title:"Austin Bitcoin Club"},{children:["b9fd54d3-49e8-44e1-a208-7780d50a3b3a"],episode_title:"Synonym Spaces Lightning Tokens",guests:[{name:"Paolo Ardoino",profile_picture:"https://pbs.twimg.com/profile_images/1583467513198923781/nCWMWFIn_400x400.jpg",ref_id:"9bb3e215-6065-4fe2-aac5-2b1d5545d48c",twitter_handle:"paoloardoino"},{name:"John Carvalho",profile_picture:"https://pbs.twimg.com/profile_images/1601964735016177676/c1mAfspt_400x400.jpg",ref_id:"f28f037f-a3af-48af-bdd3-28023219b524",twitter_handle:"BitcoinErrorLog"},{name:"Reza Bandegi",profile_picture:"https://pbs.twimg.com/profile_images/1446675390370500614/4LGHNSkl_400x400.jpg",ref_id:"ead50c13-2f13-4ffc-86b5-5a3eb49a5804",twitter_handle:"r32a_"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/63e0cbc0-731d-4ea0-9dd2-2b8b841eb28a.jpg",node_type:"episode",ref_id:"a1e3c3cf-2045-4c33-8152-0e162b7ca729",show_title:"Synonym"},{children:["d98bc278-4c35-4325-992c-78437ccf3569","144eff69-fd7a-48da-b92f-bb5b13e0b4f7","9f9305dd-fff2-4bb3-9e3f-698a55090999"],episode_title:"Blockware Intelligence Podcast: 2022 Highlights",guests:[{name:"Michael",profile_picture:"https://pbs.twimg.com/profile_images/1558687629599657990/vf-bU14b_400x400.jpg",ref_id:"c7b4faa1-db77-4459-b03f-0e41e15efae7",twitter_handle:"MichaelHawaii"},{name:"Cory Klippsten",profile_picture:"https://pbs.twimg.com/profile_images/1569687200857755648/fxiCeaqc_400x400.jpg",ref_id:"ddfb9b4c-4e6a-4f4c-a01b-e6bb1bc55464",twitter_handle:"coryklippsten"},{name:"Joe Consorti",profile_picture:"https://pbs.twimg.com/profile_images/1596902707511664640/GYGWVDts_400x400.jpg",ref_id:"8d2024b2-03bb-454d-9bd6-bb121904b76a",twitter_handle:"JoeConsorti"},{name:"Jeff Booth",profile_picture:"https://pbs.twimg.com/profile_images/1362957991410954241/spiaMAg2_400x400.jpg",ref_id:"f1143bcc-9ab9-4716-8259-0e5b026f8039",twitter_handle:"JeffBooth"},{name:"James Lavish",profile_picture:"https://pbs.twimg.com/profile_images/1466279082157502464/flD6cWI3_400x400.jpg",ref_id:"cf06ab2d-2ff3-4d7b-bef6-b996ae68517a",twitter_handle:"jameslavish"},{name:"Adam O",profile_picture:"https://pbs.twimg.com/profile_images/1395896857990160391/tJpgS2_p_400x400.jpg",ref_id:"95af0dd3-1e27-41b9-a36b-8a2c44438e85",twitter_handle:"denverbitcoin"},{name:"Jack Mallers",profile_picture:"https://pbs.twimg.com/profile_images/1599778945699909632/O0qc9ykA_400x400.jpg",ref_id:"d2e4aac5-e5e1-42fc-8f08-b3a77c076a64",twitter_handle:"jackmallers"},{name:"Lyn Alden",profile_picture:"https://pbs.twimg.com/profile_images/1521181379677073414/bm4LcJTr_400x400.jpg",ref_id:"903381dd-4b8a-4b59-8ecd-3281ae3ba297",twitter_handle:"LynAldenContact"},{name:"Dylan LeClair",profile_picture:"https://pbs.twimg.com/profile_images/1508157904913899522/3l7ctauV_400x400.jpg",ref_id:"283edea0-55cf-4245-95df-8d6d3dcb1851",twitter_handle:"DylanLeClair_"},{name:"Jeff Ross",profile_picture:"https://pbs.twimg.com/profile_images/1475554600094552064/DSlPG1lx_400x400.jpg",ref_id:"ae6ee2a2-1cf7-41a0-8366-ff6e94a6403c",twitter_handle:"VailshireCap"},{name:"Stacy Herbert",profile_picture:"https://pbs.twimg.com/profile_images/1546484196750905346/5WYPz-bc_400x400.jpg",ref_id:"7477463b-1f3a-4b83-94c3-9d5a63b576c0",twitter_handle:"Stacyherbert"},{name:"Greg Foss",profile_picture:"https://pbs.twimg.com/profile_images/1552599670945464320/3OgqRHNo_400x400.jpg",ref_id:"853d9f80-f6cf-490f-9d1e-f29cdc6acc6f",twitter_handle:"FossGregfoss"},{name:"Preston Pysh",profile_picture:"https://pbs.twimg.com/profile_images/1408783276081299462/f4Ye5n7-_400x400.jpg",ref_id:"01ad2c81-2d0c-44a9-93a1-42c07287aa80",twitter_handle:"PrestonPysh"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/ea2cf2ae-76de-4185-818c-384b3b06228b.jpg",node_type:"episode",ref_id:"e06b030a-063e-4894-9914-d326220f75f8",show_title:"Blockware Intelligence"},{children:["87520be0-ad60-48d0-aba6-44aec1452a09"],episode_title:"A Christmas Trip! | EP 20",guests:[{name:"Erik Cason",profile_picture:"https://pbs.twimg.com/profile_images/1528431738145361921/roDCkAUy_400x400.jpg",ref_id:"345e1da8-42ed-442b-8b90-ecb44bab61a1",twitter_handle:"Erikcason"},{name:"FractalEncrypt",profile_picture:"https://pbs.twimg.com/profile_images/1588218887807680512/lFJArP4n_400x400.jpg",ref_id:"888ea071-8312-4aca-b229-7447217e59f0",twitter_handle:"FractalEncrypt"}],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e79b1a57-ecd0-4df3-b8ec-1a1a55d047e7.jpg",node_type:"episode",ref_id:"b707bbd8-1a9e-4aee-8e0e-2fe0be24c851",show_title:"Pleb UnderGround"},{children:["d4948551-6ec5-4649-a700-364592e09edd","25e36282-297b-4f9d-b6e9-da65731be8a8","53cab9be-0f22-42a2-aef5-87920c2431cf","6028f484-d0b9-424a-87e5-d0dcb39f9fc7","092e9794-afc9-41fe-a635-4802777415a1","092e9794-afc9-41fe-a635-4802777415a1","36f1f7e1-df70-4528-8474-4bba448b1ed0","36f1f7e1-df70-4528-8474-4bba448b1ed0","6d267cc1-22b1-42fc-9b60-9701e64a75d0","6d267cc1-22b1-42fc-9b60-9701e64a75d0"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/7de0d293-8ae3-4362-8500-8f7300f3fe41.jpg",node_type:"show",ref_id:"7de0d293-8ae3-4362-8500-8f7300f3fe41",show_title:"Unchained"},{children:["a7afaa66-6878-40c2-97fd-88a20ae007fd","910f5aab-7896-4c19-8649-64dcef44c369"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/4e607036-8fde-48ef-ab76-9c2ac4bab031.jpg",node_type:"show",ref_id:"4e607036-8fde-48ef-ab76-9c2ac4bab031",show_title:"What Bitcoin Did with Peter McCormack"},{children:["47c54384-785c-4a4b-bad1-cac242d8f190","aa033894-120f-494e-9d6b-c6d62dfb0a69","aa033894-120f-494e-9d6b-c6d62dfb0a69","53402b84-7b30-4fec-a741-d9ef8fa03389","53402b84-7b30-4fec-a741-d9ef8fa03389","53402b84-7b30-4fec-a741-d9ef8fa03389","3a9db5f7-6722-469c-a0c6-6b157f44f33f","3a9db5f7-6722-469c-a0c6-6b157f44f33f","3a9db5f7-6722-469c-a0c6-6b157f44f33f"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/9e7e229f-2631-4542-b5d7-7fcd502798dc.jpg",node_type:"show",ref_id:"9e7e229f-2631-4542-b5d7-7fcd502798dc",show_title:"Bitcoin Audible"},{children:["fccdc763-2b69-4418-9a7a-78cdfe615ba9"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/b6c52903-5124-43f4-8632-bc9aeb941f2e.jpg",node_type:"show",ref_id:"b6c52903-5124-43f4-8632-bc9aeb941f2e",show_title:"The Kevin Rooke Show"},{children:["ae631d96-3b81-4308-bcc1-a57f81339b5c","ae631d96-3b81-4308-bcc1-a57f81339b5c","4bea6c89-43b4-4e5e-9fea-0662d9ee7c00","4bea6c89-43b4-4e5e-9fea-0662d9ee7c00"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/b79a3eb8-bcd0-4338-b979-d32aef360785.jpg",node_type:"show",ref_id:"b79a3eb8-bcd0-4338-b979-d32aef360785",show_title:"Stephan Livera Podcast"},{children:["46277681-3564-4504-9ca8-e2f41d658d28","b05fa33c-fc91-4b55-a592-85eaa1a5b3fd","b723d81b-9c99-4797-b3a8-67f824924f0c","eaeec64e-8e03-4826-a7c5-e1969a71ca2d","922ae599-5631-4ffe-977e-a9174fc028bb","b534755c-92b6-4df1-b1f9-a28578661f48","b317d76a-25e6-42f6-bc97-3de9f6c3f081","94e1df77-e561-4361-b8ad-e98862d6e51a","94e1df77-e561-4361-b8ad-e98862d6e51a","94e1df77-e561-4361-b8ad-e98862d6e51a","10c6d370-de6e-4a37-9981-d2c27e69d9e0","a52e09df-91bc-4997-ad65-725ee971af2b","a52e09df-91bc-4997-ad65-725ee971af2b","95403824-42d5-4fe8-b50b-72e08ab368c8","2e6613fa-ef17-413b-9158-0e3be5d5ae51","2e6613fa-ef17-413b-9158-0e3be5d5ae51","2e6613fa-ef17-413b-9158-0e3be5d5ae51","c0895c34-042b-4f51-a884-2330d9f83bc7","638c47da-8592-4d7b-aa1a-20e28fa0499f","638c47da-8592-4d7b-aa1a-20e28fa0499f","2e84c98a-d7d8-4341-a129-3f4eaebe1e3e","6b8fbd46-fa4a-4d07-a142-9aeb242d249f","f3b67780-d9c2-4a20-ab5c-115032a05b3a","f3b67780-d9c2-4a20-ab5c-115032a05b3a","1bf7b1ea-f717-4c0f-ae66-0e00b26603df","7070839d-051e-48e4-bd9a-95c09b310db2","728d91e9-025d-43a7-8467-2c8d264ddf59","728d91e9-025d-43a7-8467-2c8d264ddf59","c8ae0def-c33c-4d17-af4e-31ddaeedaf8a","c8ae0def-c33c-4d17-af4e-31ddaeedaf8a","c8ae0def-c33c-4d17-af4e-31ddaeedaf8a","c8ae0def-c33c-4d17-af4e-31ddaeedaf8a","b87feb17-6926-4295-b2c2-d1c2e9d49ca8","b87feb17-6926-4295-b2c2-d1c2e9d49ca8","b87feb17-6926-4295-b2c2-d1c2e9d49ca8","f29a41a4-6764-439e-9fcf-74fefaffc681","065c0900-4e3c-48a0-87b8-4068dc441c82","87cd8227-9464-45ed-8512-4e545d3812c2","2f714adf-e499-4c1f-9864-016a00737153","bbf0a536-990b-49b4-a9c3-a2a40fa38f88","bbf0a536-990b-49b4-a9c3-a2a40fa38f88","0ade0cc4-6303-4e28-8b00-6b3e659c1e3a","9523aa00-daf4-42af-b25b-75d9682bc5a6"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/419512c2-e309-4b25-bfe2-cd481d53f66d.jpg",node_type:"show",ref_id:"419512c2-e309-4b25-bfe2-cd481d53f66d",show_title:"BTC Sessions"},{children:["919ca76f-b3c7-48f1-9f5f-872537d43632"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/7934bd86-9344-4f1a-9c36-ea5f63ae418e.jpg",node_type:"show",ref_id:"7934bd86-9344-4f1a-9c36-ea5f63ae418e",show_title:"The Pomp Podcast"},{children:["ded2e35d-9fec-4bad-90f7-f3102d4eebd5"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/5fc9c8b0-687f-487e-bde3-bea15e155e3e.jpg",node_type:"show",ref_id:"5fc9c8b0-687f-487e-bde3-bea15e155e3e",show_title:"Bitcoin Takeover Podcast"},{children:["2536a974-d668-4ac2-8613-0b37aa0ca08c","2536a974-d668-4ac2-8613-0b37aa0ca08c","2536a974-d668-4ac2-8613-0b37aa0ca08c","2536a974-d668-4ac2-8613-0b37aa0ca08c","2536a974-d668-4ac2-8613-0b37aa0ca08c"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/3e178b7d-b8b9-4fd4-ba36-017b834537da.jpg",node_type:"show",ref_id:"3e178b7d-b8b9-4fd4-ba36-017b834537da",show_title:"Bitcoin Fixes This"},{children:["43dd10a8-c5d5-4643-9432-93868289f163","6e8b01d5-df4f-4124-a13a-3ee9c93c8eb2","3475140b-3e58-494f-b929-59e6ec5f1636"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/1583c7c4-f4f2-4e52-8f27-a1eaeb6289fd.jpg",node_type:"show",ref_id:"1583c7c4-f4f2-4e52-8f27-a1eaeb6289fd",show_title:"Bitcoin Magazine Podcast"},{children:["68309686-0bf0-4156-8f95-615ba255fdc4","52f31c46-14c5-49f1-9836-70862c6f6567","665facde-c1bd-4091-a071-09e28606b863"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/a09a2c49-84f1-4d0b-b150-6e6103f4ee41.jpg",node_type:"show",ref_id:"a09a2c49-84f1-4d0b-b150-6e6103f4ee41",show_title:"Citadel Dispatch"},{children:["274ecab4-c5d8-4ad7-9e16-b1cb5dd39d13","274ecab4-c5d8-4ad7-9e16-b1cb5dd39d13","933d3953-2983-4a8b-a4dc-e9615eeecb88","8a89a96d-5877-4d00-9e11-c33d19ed7264","8a89a96d-5877-4d00-9e11-c33d19ed7264","8a89a96d-5877-4d00-9e11-c33d19ed7264","249e2426-55d6-473c-bbe0-4bebf74594e9","249e2426-55d6-473c-bbe0-4bebf74594e9","0f13f1e8-6031-4920-86bf-c2fbcaaed641","0f13f1e8-6031-4920-86bf-c2fbcaaed641"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/cd6b8d64-bd52-4f1e-86b3-ca8ba2eb169f.jpg",node_type:"show",ref_id:"cd6b8d64-bd52-4f1e-86b3-ca8ba2eb169f",show_title:"Bitcoin.Review"},{children:["993787ca-ce29-4d5b-b834-37a83ea2125a"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/afa24463-19f7-4875-b6f4-b261d1d6c648.jpg",node_type:"show",ref_id:"afa24463-19f7-4875-b6f4-b261d1d6c648",show_title:"Orange Pill Podcast"},{children:["72c4dd20-64fa-4d68-a0bd-ac50207ae1c0","cc447ce2-af39-4938-8ec8-2d70a6cfd851"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/99d17d22-4448-4267-9065-f55b341f43d2.jpg",node_type:"show",ref_id:"99d17d22-4448-4267-9065-f55b341f43d2",show_title:"The Money Movement"},{children:["337981db-17c3-4c4e-8195-26cda6855ead","337981db-17c3-4c4e-8195-26cda6855ead"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/ca3ab815-dc2e-408a-a0c5-8bbe50270a97.jpg",node_type:"show",ref_id:"ca3ab815-dc2e-408a-a0c5-8bbe50270a97",show_title:'The "What is Money?" Show'},{children:["b43f377d-6599-421b-af45-a8ecee409420","b43f377d-6599-421b-af45-a8ecee409420"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/abd94520-1490-42aa-b349-9e861494a654.jpg",node_type:"show",ref_id:"abd94520-1490-42aa-b349-9e861494a654",show_title:"Economy Guy"},{children:["705db675-bc09-4cba-b578-e9904f339f55"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/58189b3c-aa25-408d-8c5e-76f97c9501da.jpg",node_type:"show",ref_id:"58189b3c-aa25-408d-8c5e-76f97c9501da",show_title:"Mises University 2017"},{children:["a12faf50-f4fb-472d-b3a1-030747594fa5","a12faf50-f4fb-472d-b3a1-030747594fa5"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/5cdd0aef-f1a7-4d3b-8336-7f81c2db4a40.jpg",node_type:"show",ref_id:"5cdd0aef-f1a7-4d3b-8336-7f81c2db4a40",show_title:"The Bitcoin Standard Podcast"},{children:["87054fe7-6a5c-471a-b518-5e9414d0c644"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/4bb9069b-a373-4b1c-9cda-024b2bf4dc84.jpg",node_type:"show",ref_id:"4bb9069b-a373-4b1c-9cda-024b2bf4dc84",show_title:"We Study Billionaires - The Investor’s Podcast Network"},{children:["04dd4023-ed42-4259-921c-e305af656389"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/3325efce-80a8-490c-8645-cad1b9a22d94.jpg",node_type:"show",ref_id:"3325efce-80a8-490c-8645-cad1b9a22d94",show_title:"Crypto Voices"},{children:["c6ecd519-ce8f-45b5-89ca-30a6a017f5d6"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/357dc2db-2643-49f0-9393-5a20ed21d0fe.jpg",node_type:"show",ref_id:"357dc2db-2643-49f0-9393-5a20ed21d0fe",show_title:"The Anita Posch Show: A Bitcoin only podcast"},{children:["b94dbd49-6ac1-497c-8f5b-d13140968920"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/710ac70a-11fc-40ec-a2a2-01b92fb8015e.jpg",node_type:"show",ref_id:"710ac70a-11fc-40ec-a2a2-01b92fb8015e",show_title:"Quoth the Raven"},{children:["406ce1e1-5f39-4c94-907c-eb5e501d2c64"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/da1bbdc0-4d0a-43ed-8345-ee43102db244.jpg",node_type:"show",ref_id:"da1bbdc0-4d0a-43ed-8345-ee43102db244",show_title:"Mercatus Policy Download"},{children:["9585c916-c55a-4284-b348-f8a52c24dc8d","9585c916-c55a-4284-b348-f8a52c24dc8d","9585c916-c55a-4284-b348-f8a52c24dc8d","1d938eb2-3bc2-4268-85d1-8967a1292a18","1d938eb2-3bc2-4268-85d1-8967a1292a18"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/93a6fe5b-364c-43f4-9f38-7da3e811460b.jpg",node_type:"show",ref_id:"93a6fe5b-364c-43f4-9f38-7da3e811460b",show_title:"CRYPTO 101"},{children:["50ab3e37-ccb3-4902-825b-a9da36579707","50ab3e37-ccb3-4902-825b-a9da36579707","50ab3e37-ccb3-4902-825b-a9da36579707"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/6ec51741-3d93-4116-a619-d62a7cee1feb.jpg",node_type:"show",ref_id:"6ec51741-3d93-4116-a619-d62a7cee1feb",show_title:"Radio Rothbard"},{children:["8ec14282-c5bc-4da6-b516-3140efaf6b8f","8ec14282-c5bc-4da6-b516-3140efaf6b8f","8ec14282-c5bc-4da6-b516-3140efaf6b8f","8ec14282-c5bc-4da6-b516-3140efaf6b8f","2fee3ffd-e6f5-4fbf-9cac-2b8977b93b79"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/f2b2a2b2-8869-4256-94b9-a91c91c1ce7e.jpg",node_type:"show",ref_id:"f2b2a2b2-8869-4256-94b9-a91c91c1ce7e",show_title:"Economics For Business"},{children:["a77be405-8402-477a-9d72-b96d1e7ea63b","32aad837-d99a-4b5a-b6ea-e12c590b925a"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/ef62c7ab-ef09-47b7-9af4-2ebe2384a72f.jpg",node_type:"show",ref_id:"ef62c7ab-ef09-47b7-9af4-2ebe2384a72f",show_title:"Austrian Economics: An Introductory Course"},{children:["62e4eee0-25ba-495a-a7e6-dd0685a75d13","23ea78f2-8e21-42fe-980a-8c6ff04c2748","23ea78f2-8e21-42fe-980a-8c6ff04c2748","b51b127d-9641-42a7-aac5-bd5b1228f52a"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/8e52e9c4-52e8-4dea-8ed9-8c6a7fcef25a.jpg",node_type:"show",ref_id:"8e52e9c4-52e8-4dea-8ed9-8c6a7fcef25a",show_title:"The Macro View"},{children:["f18bb143-9582-41f3-b65b-1dbe8de6cfc3"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/3ab6c599-bbcd-4c8f-beef-bcf509ed4afa.jpg",node_type:"show",ref_id:"3ab6c599-bbcd-4c8f-beef-bcf509ed4afa",show_title:"Voices of the Data Economy"},{children:["14dbb9b7-ec35-49e5-bbb9-1f2d626a5d6f"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/5e0220b3-7c70-4423-bb76-3b75bc132fad.jpg",node_type:"show",ref_id:"5e0220b3-7c70-4423-bb76-3b75bc132fad",show_title:"Carnivore Cast"},{children:["c6996d2f-8541-4622-968f-4e4dee7f78e4","41f7e1a4-f5b9-4a7e-8dbd-ee3fcb15260f"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/a8e3517b-b44d-4270-adaa-57587896b1e7.jpg",node_type:"show",ref_id:"a8e3517b-b44d-4270-adaa-57587896b1e7",show_title:"Keto Life Support"},{children:["4b228b78-99c7-4884-b91d-9dc711bde8e6"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/4ae5cf53-106f-4ba8-9a77-3ef1de3b44b6.jpg",node_type:"show",ref_id:"4ae5cf53-106f-4ba8-9a77-3ef1de3b44b6",show_title:"Trading Bitcoin: The Tone Vays Podcast"},{children:["556a9506-357d-4dea-a6bb-75f391f7340d"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/1c3fe064-f637-41ea-8a4b-a533ef5985b1.jpg",node_type:"show",ref_id:"1c3fe064-f637-41ea-8a4b-a533ef5985b1",show_title:"aantonop"},{children:["1b47b05f-8f86-4e19-9694-d4255e9e89ac","1b47b05f-8f86-4e19-9694-d4255e9e89ac"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/56bbafde-60ef-4e4b-b930-978429c6a635.jpg",node_type:"show",ref_id:"56bbafde-60ef-4e4b-b930-978429c6a635",show_title:"Global Bitcoin Fest"},{children:["a0826cdb-6198-4416-bd12-1dd5aa09a075","c6447277-9a58-411f-85e1-5ac166884ce5","c6447277-9a58-411f-85e1-5ac166884ce5","c6447277-9a58-411f-85e1-5ac166884ce5","c6447277-9a58-411f-85e1-5ac166884ce5","8418f2a4-1874-403a-9e58-7a76a8e09d4f","a7dcf3bf-b9f2-41f1-a3f3-ffd2db3a0b96","a7dcf3bf-b9f2-41f1-a3f3-ffd2db3a0b96","a7dcf3bf-b9f2-41f1-a3f3-ffd2db3a0b96","47406d36-917a-47f7-b89e-26181d6070bc","47406d36-917a-47f7-b89e-26181d6070bc","47406d36-917a-47f7-b89e-26181d6070bc","dc7b8177-4cef-4da2-bb05-b12dfe4c05bb","dc7b8177-4cef-4da2-bb05-b12dfe4c05bb","dc7b8177-4cef-4da2-bb05-b12dfe4c05bb","dc7b8177-4cef-4da2-bb05-b12dfe4c05bb"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/9b2e17f2-71c5-4f1e-a3e7-720d06dab810.jpg",node_type:"show",ref_id:"9b2e17f2-71c5-4f1e-a3e7-720d06dab810",show_title:"Satoshi’s Journal"},{children:["fb60247a-9b2e-41d4-83f4-f4cf92eb20f4","fb60247a-9b2e-41d4-83f4-f4cf92eb20f4","fb60247a-9b2e-41d4-83f4-f4cf92eb20f4","87a2efa8-6b4c-486d-8511-d6a95cb84514","87a2efa8-6b4c-486d-8511-d6a95cb84514","87a2efa8-6b4c-486d-8511-d6a95cb84514","87a2efa8-6b4c-486d-8511-d6a95cb84514","87a2efa8-6b4c-486d-8511-d6a95cb84514","de9ef389-d0ee-4ce1-ad23-38bfafa28a35","de9ef389-d0ee-4ce1-ad23-38bfafa28a35"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/0c42d408-e518-4ecf-b282-d864a8c14002.jpg",node_type:"show",ref_id:"0c42d408-e518-4ecf-b282-d864a8c14002",show_title:"PUBLORD"},{children:["94726593-cead-47f6-8029-6848f277358c","2c2ac736-0711-4418-8a44-6f9de54cbe6f","2c2ac736-0711-4418-8a44-6f9de54cbe6f","2c2ac736-0711-4418-8a44-6f9de54cbe6f","883300ba-aeb4-42e5-bbd2-7c989e481a3b","883300ba-aeb4-42e5-bbd2-7c989e481a3b","883300ba-aeb4-42e5-bbd2-7c989e481a3b","883300ba-aeb4-42e5-bbd2-7c989e481a3b","a41902c1-9f41-4ea4-b135-0d2078f6074b","6334a91f-b1db-4f05-a381-bc68b121dfb3","3b7e4cc5-bc15-45e9-bb7a-373fa4cca6f1","3b7e4cc5-bc15-45e9-bb7a-373fa4cca6f1","3b7e4cc5-bc15-45e9-bb7a-373fa4cca6f1","3b7e4cc5-bc15-45e9-bb7a-373fa4cca6f1","3b7e4cc5-bc15-45e9-bb7a-373fa4cca6f1","f8a66979-3fac-4793-bad0-8ede604e211b","1d671494-3407-4619-92b0-99c7d6f95f86","9ae3fabe-5d43-47bc-9ab0-541df990773a","a119635b-a66a-4a90-a7e3-2a7929666a82","a119635b-a66a-4a90-a7e3-2a7929666a82","a119635b-a66a-4a90-a7e3-2a7929666a82","a119635b-a66a-4a90-a7e3-2a7929666a82","6fe2326f-7cad-4efb-abed-206db564556e","6fe2326f-7cad-4efb-abed-206db564556e","141ef1e6-e6ec-4d29-a52a-01be662b21ae","141ef1e6-e6ec-4d29-a52a-01be662b21ae","141ef1e6-e6ec-4d29-a52a-01be662b21ae","15cae8e2-7cb3-4c60-9b3a-32cb4b231c26","15cae8e2-7cb3-4c60-9b3a-32cb4b231c26","3bc946bc-82f4-48d3-9bd2-fab82353774d","3bc946bc-82f4-48d3-9bd2-fab82353774d","3bc946bc-82f4-48d3-9bd2-fab82353774d","3bc946bc-82f4-48d3-9bd2-fab82353774d","3bc946bc-82f4-48d3-9bd2-fab82353774d","80617a1c-8bf7-404d-928c-86fc32d643fe","80617a1c-8bf7-404d-928c-86fc32d643fe","d28e279c-4539-4ec8-b187-1b6447bdb6be"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/239722cb-4216-414a-a17b-5adf9d52e15a.jpg",node_type:"show",ref_id:"239722cb-4216-414a-a17b-5adf9d52e15a",show_title:"Swan.com"},{children:["aba10d42-f204-4853-99c4-c8a22f846945","6c6c782e-382c-44c3-9b0a-5c598ef73ddc"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/f3a55dda-3dd5-4f62-99c1-bab3a88c27c1.jpg",node_type:"show",ref_id:"f3a55dda-3dd5-4f62-99c1-bab3a88c27c1",show_title:"Bitcoin Magazine"},{children:["7bebf6d3-5f24-4988-9141-7ed42c826983","7bebf6d3-5f24-4988-9141-7ed42c826983"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/7c53ad3c-1ce2-4661-8896-4c40dcc23b4d.jpg",node_type:"show",ref_id:"7c53ad3c-1ce2-4661-8896-4c40dcc23b4d",show_title:"Blockware Solutions"},{children:["de789489-56bc-4012-b7c3-9dc92a937161","62ca7c93-e509-438e-87b3-43400a320f8d","62ca7c93-e509-438e-87b3-43400a320f8d","62ca7c93-e509-438e-87b3-43400a320f8d"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/624262ef-b30f-4114-8061-e310187e6bb4.jpg",node_type:"show",ref_id:"624262ef-b30f-4114-8061-e310187e6bb4",show_title:"Property and Freedom Society"},{children:["0992287c-f653-4032-b06c-e8d65e2536e7","0992287c-f653-4032-b06c-e8d65e2536e7","0992287c-f653-4032-b06c-e8d65e2536e7","0992287c-f653-4032-b06c-e8d65e2536e7","0992287c-f653-4032-b06c-e8d65e2536e7","0992287c-f653-4032-b06c-e8d65e2536e7","0992287c-f653-4032-b06c-e8d65e2536e7"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/c9bb5d58-c781-464d-878a-8b6c469ba198.jpg",node_type:"show",ref_id:"c9bb5d58-c781-464d-878a-8b6c469ba198",show_title:"Geyser 🌊"},{children:["79ea2957-1161-4729-aacb-1981d9237e22","79ea2957-1161-4729-aacb-1981d9237e22","79ea2957-1161-4729-aacb-1981d9237e22","79ea2957-1161-4729-aacb-1981d9237e22"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/75ec86b1-cb6d-467f-a66e-5e642e5c126a.jpg",node_type:"show",ref_id:"75ec86b1-cb6d-467f-a66e-5e642e5c126a",show_title:"Bitcoin Venetians Book Club"},{children:["c0dabc11-aced-4078-93be-bca753fc2b14","c0dabc11-aced-4078-93be-bca753fc2b14","c0dabc11-aced-4078-93be-bca753fc2b14","c0dabc11-aced-4078-93be-bca753fc2b14","c0dabc11-aced-4078-93be-bca753fc2b14","d2e9db27-864c-4ee5-a7ae-abcf895bda98","d2e9db27-864c-4ee5-a7ae-abcf895bda98","d2e9db27-864c-4ee5-a7ae-abcf895bda98","d2e9db27-864c-4ee5-a7ae-abcf895bda98","d2e9db27-864c-4ee5-a7ae-abcf895bda98","6e8c90dc-12fa-415d-bf33-f286a4c5d1b1","6e8c90dc-12fa-415d-bf33-f286a4c5d1b1"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/ae91fac6-a1af-4877-9a92-e793d556ee66.jpg",node_type:"show",ref_id:"ae91fac6-a1af-4877-9a92-e793d556ee66",show_title:"Compass Mining"},{children:["5c8bc8cf-4d41-4c71-8154-aafbd1ed20c1","f7310238-67ab-4a2d-8679-72f6511934be","f7310238-67ab-4a2d-8679-72f6511934be","f7310238-67ab-4a2d-8679-72f6511934be","f7310238-67ab-4a2d-8679-72f6511934be","99f0ab76-b0f5-4947-8341-759b5dff5341","99f0ab76-b0f5-4947-8341-759b5dff5341","99f0ab76-b0f5-4947-8341-759b5dff5341","c775e780-43ca-46c6-b5ef-e65b0103ee61","c775e780-43ca-46c6-b5ef-e65b0103ee61"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/965489b4-a414-4fd0-ab8c-55911b1596aa.jpg",node_type:"show",ref_id:"965489b4-a414-4fd0-ab8c-55911b1596aa",show_title:"BOLT FUN"},{children:["54fa34c9-0729-42ab-92d5-e5f8289ed32a","54fa34c9-0729-42ab-92d5-e5f8289ed32a","54fa34c9-0729-42ab-92d5-e5f8289ed32a"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/2a1450bc-0649-4dc5-8ec9-1474af1ea1c3.jpg",node_type:"show",ref_id:"2a1450bc-0649-4dc5-8ec9-1474af1ea1c3",show_title:"Anders_🍆"},{children:["258c5ca5-52a6-4ce3-9994-e629263123d8"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/4127f08c-505a-4a7d-935f-e93e87204089.jpg",node_type:"show",ref_id:"4127f08c-505a-4a7d-935f-e93e87204089",show_title:"Wicked Smart Bitcoin ∞/21M"},{children:["08c3748a-a85d-4d4f-a702-1fc3f1c46f33"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/b2dd8be4-74b5-47b2-b470-e568657f3a0d.jpg",node_type:"show",ref_id:"b2dd8be4-74b5-47b2-b470-e568657f3a0d",show_title:"Art of Tomas"},{children:["d862511e-6330-48b3-9d4a-44e8f754f0a5","d862511e-6330-48b3-9d4a-44e8f754f0a5","d862511e-6330-48b3-9d4a-44e8f754f0a5"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e8ad867b-9cbe-4126-9f37-313b4d2329a5.jpg",node_type:"show",ref_id:"e8ad867b-9cbe-4126-9f37-313b4d2329a5",show_title:"Dr Karl Goldkamp - Keto Naturopath"},{children:["21d1d401-626c-4ec2-ba30-3c08f08ec3ea","21d1d401-626c-4ec2-ba30-3c08f08ec3ea"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/046c6869-0627-4825-8ecf-45ff0aed97b6.jpg",node_type:"show",ref_id:"046c6869-0627-4825-8ecf-45ff0aed97b6",show_title:"Alexandria The Great 🌋⛏🇿🇼"},{children:["18e340ea-90ef-4200-a19d-dc82e1e18e21"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/30180c4d-27f9-4215-81e0-6a22b16aba43.jpg",node_type:"show",ref_id:"30180c4d-27f9-4215-81e0-6a22b16aba43",show_title:"okin@8333.mobi ⚡️ 🏰"},{children:["9f12b8c2-175e-4078-9871-99a2edf2e0f3","9f12b8c2-175e-4078-9871-99a2edf2e0f3","9f12b8c2-175e-4078-9871-99a2edf2e0f3","9f12b8c2-175e-4078-9871-99a2edf2e0f3"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/99046513-2614-4eae-9de4-5781ba4b330a.jpg",node_type:"show",ref_id:"99046513-2614-4eae-9de4-5781ba4b330a",show_title:"STX:LDN"},{children:["03b5ca12-0aeb-4f04-aed0-746681d93b56"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/da64b29e-c2c0-41a6-ba29-acbaa2d022e8.jpg",node_type:"show",ref_id:"da64b29e-c2c0-41a6-ba29-acbaa2d022e8",show_title:"Rabbit Hole Recap"},{children:["70bb863d-7226-4b9e-b13e-673f94a3eb86","06494953-4c8e-4376-9450-9efb8b00acc3","06494953-4c8e-4376-9450-9efb8b00acc3","06494953-4c8e-4376-9450-9efb8b00acc3","06494953-4c8e-4376-9450-9efb8b00acc3","06494953-4c8e-4376-9450-9efb8b00acc3","06494953-4c8e-4376-9450-9efb8b00acc3","06494953-4c8e-4376-9450-9efb8b00acc3"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e1eca67b-d372-4031-bf1f-8f0ff7fe6092.jpg",node_type:"show",ref_id:"e1eca67b-d372-4031-bf1f-8f0ff7fe6092",show_title:`Once Bitten! A Bitcoin Podcast. -`},{children:["9dcca755-0a20-45e5-8e4d-dfe2800b9c6f","9dcca755-0a20-45e5-8e4d-dfe2800b9c6f"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/fe6bdbce-e91d-43cf-ab33-0e98bffabecc.jpg",node_type:"show",ref_id:"fe6bdbce-e91d-43cf-ab33-0e98bffabecc",show_title:"Bitcoin Charlotte"},{children:["b8289cbb-ec69-49a8-b6ab-c1fd808acc09"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/4240c90e-0086-4ece-bfe5-84a282c5059e.jpg",node_type:"show",ref_id:"4240c90e-0086-4ece-bfe5-84a282c5059e",show_title:"Thriller Bitcoin"},{children:["daddd93e-7bc6-4c50-a150-5199b437afc9"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/24a144b0-7ca3-40e9-9c42-86b9fce0b662.jpg",node_type:"show",ref_id:"24a144b0-7ca3-40e9-9c42-86b9fce0b662",show_title:"The Chaincode Podcast"},{children:["56bf65e9-41d5-42e1-95d6-239e4c835781","56bf65e9-41d5-42e1-95d6-239e4c835781","56bf65e9-41d5-42e1-95d6-239e4c835781","ff88a8b8-bcd6-4d86-8a65-8a68def35b9f","810a3acb-e30e-46bc-8c67-1d504b2e7c09","810a3acb-e30e-46bc-8c67-1d504b2e7c09"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/f1879df9-9bc6-4a76-951f-24548da768ef.jpg",node_type:"show",ref_id:"f1879df9-9bc6-4a76-951f-24548da768ef",show_title:"Bitcoin.Review Podcast with NVK & Guests"},{children:["f7e75069-adf6-41b0-9bb7-a6a2aa846493","f7e75069-adf6-41b0-9bb7-a6a2aa846493","6eb2a481-408f-4989-9f28-67789651259a","89049a1c-0171-4999-b003-57e1b57d92b2","d842ce17-a4c0-49a6-bdc5-5268f1d61779","8d9b0689-2e69-44c1-afe2-3519e999390a","8d9b0689-2e69-44c1-afe2-3519e999390a"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e7d2a4ca-6b44-4a45-a94c-6f48987979f7.jpg",node_type:"show",ref_id:"e7d2a4ca-6b44-4a45-a94c-6f48987979f7",show_title:"TABConf (The Atlanta Bitcoin Conference)"},{children:["3b818893-4605-499c-a467-5abcc23f9483","3b818893-4605-499c-a467-5abcc23f9483","3b818893-4605-499c-a467-5abcc23f9483","a44e78cd-dc66-4b67-9523-7ddff0d3655f","a44e78cd-dc66-4b67-9523-7ddff0d3655f","0c4f330b-a39d-4312-9775-58b42c7c9723","0c4f330b-a39d-4312-9775-58b42c7c9723","205a0650-fefe-4aaf-a894-faa8b72d966a","205a0650-fefe-4aaf-a894-faa8b72d966a","205a0650-fefe-4aaf-a894-faa8b72d966a","205a0650-fefe-4aaf-a894-faa8b72d966a","205a0650-fefe-4aaf-a894-faa8b72d966a","a60dc641-5d14-4960-ab73-66ff199edd1d"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/2ec62250-4755-4616-8342-096a2cfab95f.jpg",node_type:"show",ref_id:"2ec62250-4755-4616-8342-096a2cfab95f",show_title:"Voltage"},{children:["3af98dc1-5e7c-4ef3-ad74-b9b6afaee8b9","625d9252-2f5e-4f53-b577-dd2dfd4d4749"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/492cbcce-3744-4d8b-b2ca-3a7f063e798a.jpg",node_type:"show",ref_id:"492cbcce-3744-4d8b-b2ca-3a7f063e798a",show_title:"Swan Bitcoin"},{children:["8eef2f82-bbf9-4fef-ba3d-102679d4a1a5"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/b29c81c8-cccd-4a6b-b78f-3c1591a54d27.jpg",node_type:"show",ref_id:"b29c81c8-cccd-4a6b-b78f-3c1591a54d27",show_title:"Austin Bitcoin Club"},{children:["a1e3c3cf-2045-4c33-8152-0e162b7ca729"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/63e0cbc0-731d-4ea0-9dd2-2b8b841eb28a.jpg",node_type:"show",ref_id:"63e0cbc0-731d-4ea0-9dd2-2b8b841eb28a",show_title:"Synonym"},{children:["e06b030a-063e-4894-9914-d326220f75f8","e06b030a-063e-4894-9914-d326220f75f8","e06b030a-063e-4894-9914-d326220f75f8"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/ea2cf2ae-76de-4185-818c-384b3b06228b.jpg",node_type:"show",ref_id:"ea2cf2ae-76de-4185-818c-384b3b06228b",show_title:"Blockware Intelligence"},{children:["b707bbd8-1a9e-4aee-8e0e-2fe0be24c851"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e79b1a57-ecd0-4df3-b8ec-1a1a55d047e7.jpg",node_type:"show",ref_id:"e79b1a57-ecd0-4df3-b8ec-1a1a55d047e7",show_title:"Pleb UnderGround"}],related:[{episode_title:"The Orange Sun ☀️ #Bitcoin vs. Fiat",ref_id:"e5b1ad5b-2ce2-4192-a6d9-e99f0e3e88b5",show_title:"Satoshi’s Journal"},{episode_title:"Orange Sun 🌞 Why Ethereum is a shitcoin/scam & Bitcoin News",ref_id:"0645c5a3-b511-471d-9d8e-ef63b4dfe340",show_title:"Satoshi’s Journal"},{episode_title:"#Bitcoin Beats⚡🎶 by @SatoshisJournal Genesis Block walkthrough",ref_id:"aba7b4db-77bb-40c4-a0d4-4ce20da7b9ba",show_title:"Satoshi’s Journal"},{episode_title:"The Orange Sun 🌞 Does Price = Value? #Bitcoin",ref_id:"a0826cdb-6198-4416-bd12-1dd5aa09a075",show_title:"Satoshi’s Journal"},{episode_title:"#Bitcoin Beats⚡🎶 by @SatoshisJournal w @NEEDcreations & @DJSATOSHI18",ref_id:"fd00f285-c11e-40ba-8af9-b67265ac321b",show_title:"Satoshi’s Journal"},{episode_title:'The Orange Sun ☀️ Reading/Discussion of "The Book of Satoshi."',ref_id:"fcbe1196-c55d-476f-92d6-4dcba954eaf3",show_title:"Satoshi’s Journal"},{episode_title:'The Orange 🌞 Reading/Discussion "The Book of Satoshi" & Bitcoin News',ref_id:"c6447277-9a58-411f-85e1-5ac166884ce5",show_title:"Satoshi’s Journal"},{episode_title:"The Orange Sun 🌞 Bitcoin News and Talk - Happy Holidays!",ref_id:"d0b59017-ae64-47d4-be5c-c1531c9d480f",show_title:"Satoshi’s Journal"},{episode_title:`The Orange Sun 🌞 Reading/Discussion Tomer Strolight's "Why Bitcoin?"`,ref_id:"95848760-3863-4595-b049-f25826eba2d3",show_title:"Satoshi’s Journal"}]},request=async(tt,et)=>{const nt=await fetch(tt,et);if(!nt.ok)throw nt;return nt.json()},api$1={delete:(tt,et)=>request(`${API_URL}${tt}`,{headers:{...et,"Content-Type":"application/json"},method:"DELETE"}),get:(tt,et)=>request(`${API_URL}${tt}`,et?{headers:et}:void 0),post:(tt,et,nt)=>request(`${API_URL}${tt}`,{body:et,headers:{...nt,"Content-Type":"application/json"},method:"POST"}),put:(tt,et,nt)=>request(`${API_URL}${tt}`,{body:et,headers:{...nt,"Content-Type":"application/json"},method:"PUT"})},getLSat=async()=>{var tt;try{const et=(tt=window.localStorage)==null?void 0:tt.getItem("lsat");if(et){const it=JSON.parse(et);return lsatToken(it.macaroon,it.preimage)}if(await distExports$1.enable()){const it=await distExports$1.getLsat(window.location.host);return it.macaroon?(window.localStorage.setItem("lsat",JSON.stringify({macaroon:it.macaroon,identifier:it.identifier,preimage:it.preimage})),lsatToken(it.macaroon,it.preimage)):""}return""}catch(et){return console.warn(et),""}};function lsatToken(tt,et){return`LSAT ${tt}:${et}`}const typesWeighedByChildren=["show","episode"],getSuperficialNodeWeight=(tt,et)=>{var it;return tt.weight?tt.weight:typesWeighedByChildren.includes(tt.node_type)?((it=tt==null?void 0:tt.children)==null?void 0:it.length)||0:et.filter(rt=>rt.sourceRef===tt.ref_id||rt.targetRef===tt.ref_id).length},getMaxSuperficialWeightPerNodeType=(tt,et)=>{const nt={};return tt.forEach(it=>{const rt=getSuperficialNodeWeight(it,et);(!nt[it.node_type]||nt[it.node_type]"u"||!getProto$1?undefined$1:getProto$1(Uint8Array),INTRINSICS={"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(getProto$1([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols$1?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$2,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto$1)try{null.error}catch(tt){var errorProto=getProto$1(getProto$1(tt));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function tt(et){var nt;if(et==="%AsyncFunction%")nt=getEvalledConstructor("async function () {}");else if(et==="%GeneratorFunction%")nt=getEvalledConstructor("function* () {}");else if(et==="%AsyncGeneratorFunction%")nt=getEvalledConstructor("async function* () {}");else if(et==="%AsyncGenerator%"){var it=tt("%AsyncGeneratorFunction%");it&&(nt=it.prototype)}else if(et==="%AsyncIteratorPrototype%"){var rt=tt("%AsyncGenerator%");rt&&getProto$1&&(nt=getProto$1(rt.prototype))}return INTRINSICS[et]=nt,nt},LEGACY_ALIASES={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn$2=hasown,$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName$1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar$1=/\\(\\)?/g,stringToPath$2=function(et){var nt=$strSlice(et,0,1),it=$strSlice(et,-1);if(nt==="%"&&it!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(it==="%"&&nt!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var rt=[];return $replace(et,rePropName$1,function(ot,at,st,lt){rt[rt.length]=st?$replace(lt,reEscapeChar$1,"$1"):at||ot}),rt},getBaseIntrinsic=function(et,nt){var it=et,rt;if(hasOwn$2(LEGACY_ALIASES,it)&&(rt=LEGACY_ALIASES[it],it="%"+rt[0]+"%"),hasOwn$2(INTRINSICS,it)){var ot=INTRINSICS[it];if(ot===needsEval&&(ot=doEval(it)),typeof ot>"u"&&!nt)throw new $TypeError$2("intrinsic "+et+" exists, but is not available. Please file an issue!");return{alias:rt,name:it,value:ot}}throw new $SyntaxError$1("intrinsic "+et+" does not exist!")},getIntrinsic=function(et,nt){if(typeof et!="string"||et.length===0)throw new $TypeError$2("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof nt!="boolean")throw new $TypeError$2('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,et)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var it=stringToPath$2(et),rt=it.length>0?it[0]:"",ot=getBaseIntrinsic("%"+rt+"%",nt),at=ot.name,st=ot.value,lt=!1,ct=ot.alias;ct&&(rt=ct[0],$spliceApply(it,$concat([0,1],ct)));for(var ut=1,ht=!0;ut=it.length){var gt=$gOPD$1(st,dt);ht=!!gt,ht&&"get"in gt&&!("originalValue"in gt.get)?st=gt.get:st=st[dt]}else ht=hasOwn$2(st,dt),st=st[dt];ht&&!lt&&(INTRINSICS[at]=st)}}return st},callBind$2={exports:{}},GetIntrinsic$4=getIntrinsic,$defineProperty$2=GetIntrinsic$4("%Object.defineProperty%",!0),hasPropertyDescriptors$1=function(){if($defineProperty$2)try{return $defineProperty$2({},"a",{value:1}),!0}catch{return!1}return!1};hasPropertyDescriptors$1.hasArrayLengthDefineBug=function(){if(!hasPropertyDescriptors$1())return null;try{return $defineProperty$2([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors$1,GetIntrinsic$3=getIntrinsic,$gOPD=GetIntrinsic$3("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd$1=$gOPD,hasPropertyDescriptors=hasPropertyDescriptors_1(),GetIntrinsic$2=getIntrinsic,$defineProperty$1=hasPropertyDescriptors&&GetIntrinsic$2("%Object.defineProperty%",!0);if($defineProperty$1)try{$defineProperty$1({},"a",{value:1})}catch{$defineProperty$1=!1}var $SyntaxError=GetIntrinsic$2("%SyntaxError%"),$TypeError$1=GetIntrinsic$2("%TypeError%"),gopd=gopd$1,defineDataProperty=function(et,nt,it){if(!et||typeof et!="object"&&typeof et!="function")throw new $TypeError$1("`obj` must be an object or a function`");if(typeof nt!="string"&&typeof nt!="symbol")throw new $TypeError$1("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $TypeError$1("`loose`, if provided, must be a boolean");var rt=arguments.length>3?arguments[3]:null,ot=arguments.length>4?arguments[4]:null,at=arguments.length>5?arguments[5]:null,st=arguments.length>6?arguments[6]:!1,lt=!!gopd&&gopd(et,nt);if($defineProperty$1)$defineProperty$1(et,nt,{configurable:at===null&<?lt.configurable:!at,enumerable:rt===null&<?lt.enumerable:!rt,value:it,writable:ot===null&<?lt.writable:!ot});else if(st||!rt&&!ot&&!at)et[nt]=it;else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},GetIntrinsic$1=getIntrinsic,define$1=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD$4=gopd$1,$TypeError=GetIntrinsic$1("%TypeError%"),$floor=GetIntrinsic$1("%Math.floor%"),setFunctionLength=function(et,nt){if(typeof et!="function")throw new $TypeError("`fn` is not a function");if(typeof nt!="number"||nt<0||nt>4294967295||$floor(nt)!==nt)throw new $TypeError("`length` must be a positive 32-bit integer");var it=arguments.length>2&&!!arguments[2],rt=!0,ot=!0;if("length"in et&&gOPD$4){var at=gOPD$4(et,"length");at&&!at.configurable&&(rt=!1),at&&!at.writable&&(ot=!1)}return(rt||ot||!it)&&(hasDescriptors?define$1(et,"length",nt,!0,!0):define$1(et,"length",nt)),et};(function(tt){var et=functionBind,nt=getIntrinsic,it=setFunctionLength,rt=nt("%TypeError%"),ot=nt("%Function.prototype.apply%"),at=nt("%Function.prototype.call%"),st=nt("%Reflect.apply%",!0)||et.call(at,ot),lt=nt("%Object.defineProperty%",!0),ct=nt("%Math.max%");if(lt)try{lt({},"a",{value:1})}catch{lt=null}tt.exports=function(dt){if(typeof dt!="function")throw new rt("a function is required");var pt=st(et,at,arguments);return it(pt,1+ct(0,dt.length-(arguments.length-1)),!0)};var ut=function(){return st(et,ot,arguments)};lt?lt(tt.exports,"apply",{value:ut}):tt.exports.apply=ut})(callBind$2);var callBindExports=callBind$2.exports,GetIntrinsic=getIntrinsic,callBind$1=callBindExports,$indexOf$1=callBind$1(GetIntrinsic("String.prototype.indexOf")),callBound$3=function(et,nt){var it=GetIntrinsic(et,!!nt);return typeof it=="function"&&$indexOf$1(et,".prototype.")>-1?callBind$1(it):it},hasToStringTag$3=shams(),callBound$2=callBound$3,$toString$1=callBound$2("Object.prototype.toString"),isStandardArguments=function(et){return hasToStringTag$3&&et&&typeof et=="object"&&Symbol.toStringTag in et?!1:$toString$1(et)==="[object Arguments]"},isLegacyArguments=function(et){return isStandardArguments(et)?!0:et!==null&&typeof et=="object"&&typeof et.length=="number"&&et.length>=0&&$toString$1(et)!=="[object Array]"&&$toString$1(et.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments$5=supportsStandardArguments?isStandardArguments:isLegacyArguments,toStr$4=Object.prototype.toString,fnToStr$1=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag$2=shams(),getProto=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag$2)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(et){if(typeof et!="function")return!1;if(isFnRegex.test(fnToStr$1.call(et)))return!0;if(!hasToStringTag$2){var nt=toStr$4.call(et);return nt==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var it=getGeneratorFunc();GeneratorFunction=it?getProto(it):!1}return getProto(et)===GeneratorFunction},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(tt){tt!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(et){try{var nt=fnToStr.call(et);return constructorRegex.test(nt)}catch{return!1}},tryFunctionObject=function(et){try{return isES6ClassFn(et)?!1:(fnToStr.call(et),!0)}catch{return!1}},toStr$3=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$1=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all$1=document.all;toStr$3.call(all$1)===toStr$3.call(document.all)&&(isDDA=function(et){if((isIE68||!et)&&(typeof et>"u"||typeof et=="object"))try{var nt=toStr$3.call(et);return(nt===ddaClass||nt===ddaClass2||nt===ddaClass3||nt===objectClass)&&et("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(et){if(isDDA(et))return!0;if(!et||typeof et!="function"&&typeof et!="object")return!1;try{reflectApply(et,null,badArrayLike)}catch(nt){if(nt!==isCallableMarker)return!1}return!isES6ClassFn(et)&&tryFunctionObject(et)}:function(et){if(isDDA(et))return!0;if(!et||typeof et!="function"&&typeof et!="object")return!1;if(hasToStringTag$1)return tryFunctionObject(et);if(isES6ClassFn(et))return!1;var nt=toStr$3.call(et);return nt!==fnClass&&nt!==genClass&&!/^\[object HTML/.test(nt)?!1:tryFunctionObject(et)},isCallable=isCallable$1,toStr$2=Object.prototype.toString,hasOwnProperty$g=Object.prototype.hasOwnProperty,forEachArray=function(et,nt,it){for(var rt=0,ot=et.length;rt=3&&(rt=it),toStr$2.call(et)==="[object Array]"?forEachArray(et,nt,rt):typeof et=="string"?forEachString(et,nt,rt):forEachObject(et,nt,rt)},forEach_1=forEach$1,possibleNames=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],g$3=typeof globalThis>"u"?commonjsGlobal:globalThis,availableTypedArrays$1=function(){for(var et=[],nt=0;nt"u"?commonjsGlobal:globalThis,typedArrays=availableTypedArrays(),$slice=callBound$1("String.prototype.slice"),getPrototypeOf$3=Object.getPrototypeOf,$indexOf=callBound$1("Array.prototype.indexOf",!0)||function(et,nt){for(var it=0;it-1?nt:nt!=="Object"?!1:trySlices(et)}return gOPD$3?tryTypedArrays(et):null},whichTypedArray=whichTypedArray$1,isTypedArray$4=function(et){return!!whichTypedArray(et)};(function(tt){var et=isArguments$5,nt=isGeneratorFunction,it=whichTypedArray$1,rt=isTypedArray$4;function ot(un){return un.call.bind(un)}var at=typeof BigInt<"u",st=typeof Symbol<"u",lt=ot(Object.prototype.toString),ct=ot(Number.prototype.valueOf),ut=ot(String.prototype.valueOf),ht=ot(Boolean.prototype.valueOf);if(at)var dt=ot(BigInt.prototype.valueOf);if(st)var pt=ot(Symbol.prototype.valueOf);function mt(un,En){if(typeof un!="object")return!1;try{return En(un),!0}catch{return!1}}tt.isArgumentsObject=et,tt.isGeneratorFunction=nt,tt.isTypedArray=rt;function gt(un){return typeof Promise<"u"&&un instanceof Promise||un!==null&&typeof un=="object"&&typeof un.then=="function"&&typeof un.catch=="function"}tt.isPromise=gt;function bt(un){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(un):rt(un)||Vt(un)}tt.isArrayBufferView=bt;function yt(un){return it(un)==="Uint8Array"}tt.isUint8Array=yt;function wt(un){return it(un)==="Uint8ClampedArray"}tt.isUint8ClampedArray=wt;function vt(un){return it(un)==="Uint16Array"}tt.isUint16Array=vt;function xt(un){return it(un)==="Uint32Array"}tt.isUint32Array=xt;function St(un){return it(un)==="Int8Array"}tt.isInt8Array=St;function Et(un){return it(un)==="Int16Array"}tt.isInt16Array=Et;function It(un){return it(un)==="Int32Array"}tt.isInt32Array=It;function Tt(un){return it(un)==="Float32Array"}tt.isFloat32Array=Tt;function $t(un){return it(un)==="Float64Array"}tt.isFloat64Array=$t;function Ut(un){return it(un)==="BigInt64Array"}tt.isBigInt64Array=Ut;function Lt(un){return it(un)==="BigUint64Array"}tt.isBigUint64Array=Lt;function Bt(un){return lt(un)==="[object Map]"}Bt.working=typeof Map<"u"&&Bt(new Map);function Pt(un){return typeof Map>"u"?!1:Bt.working?Bt(un):un instanceof Map}tt.isMap=Pt;function kt(un){return lt(un)==="[object Set]"}kt.working=typeof Set<"u"&&kt(new Set);function At(un){return typeof Set>"u"?!1:kt.working?kt(un):un instanceof Set}tt.isSet=At;function Rt(un){return lt(un)==="[object WeakMap]"}Rt.working=typeof WeakMap<"u"&&Rt(new WeakMap);function Wt(un){return typeof WeakMap>"u"?!1:Rt.working?Rt(un):un instanceof WeakMap}tt.isWeakMap=Wt;function jt(un){return lt(un)==="[object WeakSet]"}jt.working=typeof WeakSet<"u"&&jt(new WeakSet);function Ot(un){return jt(un)}tt.isWeakSet=Ot;function Ct(un){return lt(un)==="[object ArrayBuffer]"}Ct.working=typeof ArrayBuffer<"u"&&Ct(new ArrayBuffer);function Dt(un){return typeof ArrayBuffer>"u"?!1:Ct.working?Ct(un):un instanceof ArrayBuffer}tt.isArrayBuffer=Dt;function Mt(un){return lt(un)==="[object DataView]"}Mt.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Mt(new DataView(new ArrayBuffer(1),0,1));function Vt(un){return typeof DataView>"u"?!1:Mt.working?Mt(un):un instanceof DataView}tt.isDataView=Vt;var Qt=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function rn(un){return lt(un)==="[object SharedArrayBuffer]"}function Xt(un){return typeof Qt>"u"?!1:(typeof rn.working>"u"&&(rn.working=rn(new Qt)),rn.working?rn(un):un instanceof Qt)}tt.isSharedArrayBuffer=Xt;function an(un){return lt(un)==="[object AsyncFunction]"}tt.isAsyncFunction=an;function tn(un){return lt(un)==="[object Map Iterator]"}tt.isMapIterator=tn;function pn(un){return lt(un)==="[object Set Iterator]"}tt.isSetIterator=pn;function vn(un){return lt(un)==="[object Generator]"}tt.isGeneratorObject=vn;function sn(un){return lt(un)==="[object WebAssembly.Module]"}tt.isWebAssemblyCompiledModule=sn;function Zt(un){return mt(un,ct)}tt.isNumberObject=Zt;function Sn(un){return mt(un,ut)}tt.isStringObject=Sn;function Tn(un){return mt(un,ht)}tt.isBooleanObject=Tn;function Cn(un){return at&&mt(un,dt)}tt.isBigIntObject=Cn;function jn(un){return st&&mt(un,pt)}tt.isSymbolObject=jn;function Un(un){return Zt(un)||Sn(un)||Tn(un)||Cn(un)||jn(un)}tt.isBoxedPrimitive=Un;function yn(un){return typeof Uint8Array<"u"&&(Dt(un)||Xt(un))}tt.isAnyArrayBuffer=yn,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(un){Object.defineProperty(tt,un,{enumerable:!1,value:function(){throw new Error(un+" is not supported in userland")}})})})(types$8);var isBufferBrowser=function(et){return et&&typeof et=="object"&&typeof et.copy=="function"&&typeof et.fill=="function"&&typeof et.readUInt8=="function"},inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(et,nt){nt&&(et.super_=nt,et.prototype=Object.create(nt.prototype,{constructor:{value:et,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(et,nt){if(nt){et.super_=nt;var it=function(){};it.prototype=nt.prototype,et.prototype=new it,et.prototype.constructor=et}};var inherits_browserExports=inherits_browser.exports;(function(tt){var et=Object.getOwnPropertyDescriptors||function(Vt){for(var Qt=Object.keys(Vt),rn={},Xt=0;Xt=Xt)return pn;switch(pn){case"%s":return String(rn[Qt++]);case"%d":return Number(rn[Qt++]);case"%j":try{return JSON.stringify(rn[Qt++])}catch{return"[Circular]"}default:return pn}}),tn=rn[Qt];Qt"u")return function(){return tt.deprecate(Mt,Vt).apply(this,arguments)};var Qt=!1;function rn(){if(!Qt){if(process.throwDeprecation)throw new Error(Vt);process.traceDeprecation?console.trace(Vt):console.error(Vt),Qt=!0}return Mt.apply(this,arguments)}return rn};var it={},rt=/^$/;if({}.NODE_DEBUG){var ot={}.NODE_DEBUG;ot=ot.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),rt=new RegExp("^"+ot+"$","i")}tt.debuglog=function(Mt){if(Mt=Mt.toUpperCase(),!it[Mt])if(rt.test(Mt)){var Vt=process.pid;it[Mt]=function(){var Qt=tt.format.apply(tt,arguments);console.error("%s %d: %s",Mt,Vt,Qt)}}else it[Mt]=function(){};return it[Mt]};function at(Mt,Vt){var Qt={seen:[],stylize:lt};return arguments.length>=3&&(Qt.depth=arguments[2]),arguments.length>=4&&(Qt.colors=arguments[3]),yt(Vt)?Qt.showHidden=Vt:Vt&&tt._extend(Qt,Vt),It(Qt.showHidden)&&(Qt.showHidden=!1),It(Qt.depth)&&(Qt.depth=2),It(Qt.colors)&&(Qt.colors=!1),It(Qt.customInspect)&&(Qt.customInspect=!0),Qt.colors&&(Qt.stylize=st),ut(Qt,Mt,Qt.depth)}tt.inspect=at,at.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},at.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function st(Mt,Vt){var Qt=at.styles[Vt];return Qt?"\x1B["+at.colors[Qt][0]+"m"+Mt+"\x1B["+at.colors[Qt][1]+"m":Mt}function lt(Mt,Vt){return Mt}function ct(Mt){var Vt={};return Mt.forEach(function(Qt,rn){Vt[Qt]=!0}),Vt}function ut(Mt,Vt,Qt){if(Mt.customInspect&&Vt&&Bt(Vt.inspect)&&Vt.inspect!==tt.inspect&&!(Vt.constructor&&Vt.constructor.prototype===Vt)){var rn=Vt.inspect(Qt,Mt);return St(rn)||(rn=ut(Mt,rn,Qt)),rn}var Xt=ht(Mt,Vt);if(Xt)return Xt;var an=Object.keys(Vt),tn=ct(an);if(Mt.showHidden&&(an=Object.getOwnPropertyNames(Vt)),Lt(Vt)&&(an.indexOf("message")>=0||an.indexOf("description")>=0))return dt(Vt);if(an.length===0){if(Bt(Vt)){var pn=Vt.name?": "+Vt.name:"";return Mt.stylize("[Function"+pn+"]","special")}if(Tt(Vt))return Mt.stylize(RegExp.prototype.toString.call(Vt),"regexp");if(Ut(Vt))return Mt.stylize(Date.prototype.toString.call(Vt),"date");if(Lt(Vt))return dt(Vt)}var vn="",sn=!1,Zt=["{","}"];if(bt(Vt)&&(sn=!0,Zt=["[","]"]),Bt(Vt)){var Sn=Vt.name?": "+Vt.name:"";vn=" [Function"+Sn+"]"}if(Tt(Vt)&&(vn=" "+RegExp.prototype.toString.call(Vt)),Ut(Vt)&&(vn=" "+Date.prototype.toUTCString.call(Vt)),Lt(Vt)&&(vn=" "+dt(Vt)),an.length===0&&(!sn||Vt.length==0))return Zt[0]+vn+Zt[1];if(Qt<0)return Tt(Vt)?Mt.stylize(RegExp.prototype.toString.call(Vt),"regexp"):Mt.stylize("[Object]","special");Mt.seen.push(Vt);var Tn;return sn?Tn=pt(Mt,Vt,Qt,tn,an):Tn=an.map(function(Cn){return mt(Mt,Vt,Qt,tn,Cn,sn)}),Mt.seen.pop(),gt(Tn,vn,Zt)}function ht(Mt,Vt){if(It(Vt))return Mt.stylize("undefined","undefined");if(St(Vt)){var Qt="'"+JSON.stringify(Vt).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Mt.stylize(Qt,"string")}if(xt(Vt))return Mt.stylize(""+Vt,"number");if(yt(Vt))return Mt.stylize(""+Vt,"boolean");if(wt(Vt))return Mt.stylize("null","null")}function dt(Mt){return"["+Error.prototype.toString.call(Mt)+"]"}function pt(Mt,Vt,Qt,rn,Xt){for(var an=[],tn=0,pn=Vt.length;tn-1&&(an?pn=pn.split(` -`).map(function(sn){return" "+sn}).join(` -`).slice(2):pn=` -`+pn.split(` -`).map(function(sn){return" "+sn}).join(` -`))):pn=Mt.stylize("[Circular]","special")),It(tn)){if(an&&Xt.match(/^\d+$/))return pn;tn=JSON.stringify(""+Xt),tn.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(tn=tn.slice(1,-1),tn=Mt.stylize(tn,"name")):(tn=tn.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),tn=Mt.stylize(tn,"string"))}return tn+": "+pn}function gt(Mt,Vt,Qt){var rn=Mt.reduce(function(Xt,an){return an.indexOf(` -`)>=0,Xt+an.replace(/\u001b\[\d\d?m/g,"").length+1},0);return rn>60?Qt[0]+(Vt===""?"":Vt+` - `)+" "+Mt.join(`, - `)+" "+Qt[1]:Qt[0]+Vt+" "+Mt.join(", ")+" "+Qt[1]}tt.types=types$8;function bt(Mt){return Array.isArray(Mt)}tt.isArray=bt;function yt(Mt){return typeof Mt=="boolean"}tt.isBoolean=yt;function wt(Mt){return Mt===null}tt.isNull=wt;function vt(Mt){return Mt==null}tt.isNullOrUndefined=vt;function xt(Mt){return typeof Mt=="number"}tt.isNumber=xt;function St(Mt){return typeof Mt=="string"}tt.isString=St;function Et(Mt){return typeof Mt=="symbol"}tt.isSymbol=Et;function It(Mt){return Mt===void 0}tt.isUndefined=It;function Tt(Mt){return $t(Mt)&&kt(Mt)==="[object RegExp]"}tt.isRegExp=Tt,tt.types.isRegExp=Tt;function $t(Mt){return typeof Mt=="object"&&Mt!==null}tt.isObject=$t;function Ut(Mt){return $t(Mt)&&kt(Mt)==="[object Date]"}tt.isDate=Ut,tt.types.isDate=Ut;function Lt(Mt){return $t(Mt)&&(kt(Mt)==="[object Error]"||Mt instanceof Error)}tt.isError=Lt,tt.types.isNativeError=Lt;function Bt(Mt){return typeof Mt=="function"}tt.isFunction=Bt;function Pt(Mt){return Mt===null||typeof Mt=="boolean"||typeof Mt=="number"||typeof Mt=="string"||typeof Mt=="symbol"||typeof Mt>"u"}tt.isPrimitive=Pt,tt.isBuffer=isBufferBrowser;function kt(Mt){return Object.prototype.toString.call(Mt)}function At(Mt){return Mt<10?"0"+Mt.toString(10):Mt.toString(10)}var Rt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Wt(){var Mt=new Date,Vt=[At(Mt.getHours()),At(Mt.getMinutes()),At(Mt.getSeconds())].join(":");return[Mt.getDate(),Rt[Mt.getMonth()],Vt].join(" ")}tt.log=function(){console.log("%s - %s",Wt(),tt.format.apply(tt,arguments))},tt.inherits=inherits_browserExports,tt._extend=function(Mt,Vt){if(!Vt||!$t(Vt))return Mt;for(var Qt=Object.keys(Vt),rn=Qt.length;rn--;)Mt[Qt[rn]]=Vt[Qt[rn]];return Mt};function jt(Mt,Vt){return Object.prototype.hasOwnProperty.call(Mt,Vt)}var Ot=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;tt.promisify=function(Vt){if(typeof Vt!="function")throw new TypeError('The "original" argument must be of type Function');if(Ot&&Vt[Ot]){var Qt=Vt[Ot];if(typeof Qt!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Qt,Ot,{value:Qt,enumerable:!1,writable:!1,configurable:!0}),Qt}function Qt(){for(var rn,Xt,an=new Promise(function(vn,sn){rn=vn,Xt=sn}),tn=[],pn=0;pn"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dt(St){return dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(It){return It.__proto__||Object.getPrototypeOf(It)},dt(St)}var pt={},mt,gt;function bt(St,Et,It){It||(It=Error);function Tt(Ut,Lt,Bt){return typeof Et=="string"?Et:Et(Ut,Lt,Bt)}var $t=function(Ut){at(Bt,Ut);var Lt=lt(Bt);function Bt(Pt,kt,At){var Rt;return ot(this,Bt),Rt=Lt.call(this,Tt(Pt,kt,At)),Rt.code=St,Rt}return nt(Bt)}(It);pt[St]=$t}function yt(St,Et){if(Array.isArray(St)){var It=St.length;return St=St.map(function(Tt){return String(Tt)}),It>2?"one of ".concat(Et," ").concat(St.slice(0,It-1).join(", "),", or ")+St[It-1]:It===2?"one of ".concat(Et," ").concat(St[0]," or ").concat(St[1]):"of ".concat(Et," ").concat(St[0])}else return"of ".concat(Et," ").concat(String(St))}function wt(St,Et,It){return St.substr(!It||It<0?0:+It,Et.length)===Et}function vt(St,Et,It){return(It===void 0||It>St.length)&&(It=St.length),St.substring(It-Et.length,It)===Et}function xt(St,Et,It){return typeof It!="number"&&(It=0),It+Et.length>St.length?!1:St.indexOf(Et,It)!==-1}return bt("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),bt("ERR_INVALID_ARG_TYPE",function(St,Et,It){mt===void 0&&(mt=requireAssert()),mt(typeof St=="string","'name' must be a string");var Tt;typeof Et=="string"&&wt(Et,"not ")?(Tt="must not be",Et=Et.replace(/^not /,"")):Tt="must be";var $t;if(vt(St," argument"))$t="The ".concat(St," ").concat(Tt," ").concat(yt(Et,"type"));else{var Ut=xt(St,".")?"property":"argument";$t='The "'.concat(St,'" ').concat(Ut," ").concat(Tt," ").concat(yt(Et,"type"))}return $t+=". Received type ".concat(tt(It)),$t},TypeError),bt("ERR_INVALID_ARG_VALUE",function(St,Et){var It=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";gt===void 0&&(gt=util);var Tt=gt.inspect(Et);return Tt.length>128&&(Tt="".concat(Tt.slice(0,128),"...")),"The argument '".concat(St,"' ").concat(It,". Received ").concat(Tt)},TypeError),bt("ERR_INVALID_RETURN_VALUE",function(St,Et,It){var Tt;return It&&It.constructor&&It.constructor.name?Tt="instance of ".concat(It.constructor.name):Tt="type ".concat(tt(It)),"Expected ".concat(St,' to be returned from the "').concat(Et,'"')+" function but got ".concat(Tt,".")},TypeError),bt("ERR_MISSING_ARGS",function(){for(var St=arguments.length,Et=new Array(St),It=0;It0,"At least one arg needs to be specified");var Tt="The ",$t=Et.length;switch(Et=Et.map(function(Ut){return'"'.concat(Ut,'"')}),$t){case 1:Tt+="".concat(Et[0]," argument");break;case 2:Tt+="".concat(Et[0]," and ").concat(Et[1]," arguments");break;default:Tt+=Et.slice(0,$t-1).join(", "),Tt+=", and ".concat(Et[$t-1]," arguments");break}return"".concat(Tt," must be specified")},TypeError),errors$3.codes=pt,errors$3}var assertion_error,hasRequiredAssertion_error;function requireAssertion_error(){if(hasRequiredAssertion_error)return assertion_error;hasRequiredAssertion_error=1;function tt(Ot,Ct){var Dt=Object.keys(Ot);if(Object.getOwnPropertySymbols){var Mt=Object.getOwnPropertySymbols(Ot);Ct&&(Mt=Mt.filter(function(Vt){return Object.getOwnPropertyDescriptor(Ot,Vt).enumerable})),Dt.push.apply(Dt,Mt)}return Dt}function et(Ot){for(var Ct=1;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gt(Ot){return Function.toString.call(Ot).indexOf("[native code]")!==-1}function bt(Ot,Ct){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Mt,Vt){return Mt.__proto__=Vt,Mt},bt(Ot,Ct)}function yt(Ot){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Dt){return Dt.__proto__||Object.getPrototypeOf(Dt)},yt(Ot)}function wt(Ot){"@babel/helpers - typeof";return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ct){return typeof Ct}:function(Ct){return Ct&&typeof Symbol=="function"&&Ct.constructor===Symbol&&Ct!==Symbol.prototype?"symbol":typeof Ct},wt(Ot)}var vt=util,xt=vt.inspect,St=requireErrors(),Et=St.codes.ERR_INVALID_ARG_TYPE;function It(Ot,Ct,Dt){return(Dt===void 0||Dt>Ot.length)&&(Dt=Ot.length),Ot.substring(Dt-Ct.length,Dt)===Ct}function Tt(Ot,Ct){if(Ct=Math.floor(Ct),Ot.length==0||Ct==0)return"";var Dt=Ot.length*Ct;for(Ct=Math.floor(Math.log(Ct)/Math.log(2));Ct;)Ot+=Ot,Ct--;return Ot+=Ot.substring(0,Dt-Ot.length),Ot}var $t="",Ut="",Lt="",Bt="",Pt={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},kt=10;function At(Ot){var Ct=Object.keys(Ot),Dt=Object.create(Object.getPrototypeOf(Ot));return Ct.forEach(function(Mt){Dt[Mt]=Ot[Mt]}),Object.defineProperty(Dt,"message",{value:Ot.message}),Dt}function Rt(Ot){return xt(Ot,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Wt(Ot,Ct,Dt){var Mt="",Vt="",Qt=0,rn="",Xt=!1,an=Rt(Ot),tn=an.split(` -`),pn=Rt(Ct).split(` -`),vn=0,sn="";if(Dt==="strictEqual"&&wt(Ot)==="object"&&wt(Ct)==="object"&&Ot!==null&&Ct!==null&&(Dt="strictEqualObject"),tn.length===1&&pn.length===1&&tn[0]!==pn[0]){var Zt=tn[0].length+pn[0].length;if(Zt<=kt){if((wt(Ot)!=="object"||Ot===null)&&(wt(Ct)!=="object"||Ct===null)&&(Ot!==0||Ct!==0))return"".concat(Pt[Dt],` - -`)+"".concat(tn[0]," !== ").concat(pn[0],` -`)}else if(Dt!=="strictEqualObject"){var Sn=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(Zt2&&(sn=` - `.concat(Tt(" ",vn),"^"),vn=0)}}}for(var Tn=tn[tn.length-1],Cn=pn[pn.length-1];Tn===Cn&&(vn++<2?rn=` - `.concat(Tn).concat(rn):Mt=Tn,tn.pop(),pn.pop(),!(tn.length===0||pn.length===0));)Tn=tn[tn.length-1],Cn=pn[pn.length-1];var jn=Math.max(tn.length,pn.length);if(jn===0){var Un=an.split(` -`);if(Un.length>30)for(Un[26]="".concat($t,"...").concat(Bt);Un.length>27;)Un.pop();return"".concat(Pt.notIdentical,` +`},{children:["9dcca755-0a20-45e5-8e4d-dfe2800b9c6f","9dcca755-0a20-45e5-8e4d-dfe2800b9c6f"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/fe6bdbce-e91d-43cf-ab33-0e98bffabecc.jpg",node_type:"show",ref_id:"fe6bdbce-e91d-43cf-ab33-0e98bffabecc",show_title:"Bitcoin Charlotte"},{children:["b8289cbb-ec69-49a8-b6ab-c1fd808acc09"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/4240c90e-0086-4ece-bfe5-84a282c5059e.jpg",node_type:"show",ref_id:"4240c90e-0086-4ece-bfe5-84a282c5059e",show_title:"Thriller Bitcoin"},{children:["daddd93e-7bc6-4c50-a150-5199b437afc9"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/24a144b0-7ca3-40e9-9c42-86b9fce0b662.jpg",node_type:"show",ref_id:"24a144b0-7ca3-40e9-9c42-86b9fce0b662",show_title:"The Chaincode Podcast"},{children:["56bf65e9-41d5-42e1-95d6-239e4c835781","56bf65e9-41d5-42e1-95d6-239e4c835781","56bf65e9-41d5-42e1-95d6-239e4c835781","ff88a8b8-bcd6-4d86-8a65-8a68def35b9f","810a3acb-e30e-46bc-8c67-1d504b2e7c09","810a3acb-e30e-46bc-8c67-1d504b2e7c09"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/f1879df9-9bc6-4a76-951f-24548da768ef.jpg",node_type:"show",ref_id:"f1879df9-9bc6-4a76-951f-24548da768ef",show_title:"Bitcoin.Review Podcast with NVK & Guests"},{children:["f7e75069-adf6-41b0-9bb7-a6a2aa846493","f7e75069-adf6-41b0-9bb7-a6a2aa846493","6eb2a481-408f-4989-9f28-67789651259a","89049a1c-0171-4999-b003-57e1b57d92b2","d842ce17-a4c0-49a6-bdc5-5268f1d61779","8d9b0689-2e69-44c1-afe2-3519e999390a","8d9b0689-2e69-44c1-afe2-3519e999390a"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e7d2a4ca-6b44-4a45-a94c-6f48987979f7.jpg",node_type:"show",ref_id:"e7d2a4ca-6b44-4a45-a94c-6f48987979f7",show_title:"TABConf (The Atlanta Bitcoin Conference)"},{children:["3b818893-4605-499c-a467-5abcc23f9483","3b818893-4605-499c-a467-5abcc23f9483","3b818893-4605-499c-a467-5abcc23f9483","a44e78cd-dc66-4b67-9523-7ddff0d3655f","a44e78cd-dc66-4b67-9523-7ddff0d3655f","0c4f330b-a39d-4312-9775-58b42c7c9723","0c4f330b-a39d-4312-9775-58b42c7c9723","205a0650-fefe-4aaf-a894-faa8b72d966a","205a0650-fefe-4aaf-a894-faa8b72d966a","205a0650-fefe-4aaf-a894-faa8b72d966a","205a0650-fefe-4aaf-a894-faa8b72d966a","205a0650-fefe-4aaf-a894-faa8b72d966a","a60dc641-5d14-4960-ab73-66ff199edd1d"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/2ec62250-4755-4616-8342-096a2cfab95f.jpg",node_type:"show",ref_id:"2ec62250-4755-4616-8342-096a2cfab95f",show_title:"Voltage"},{children:["3af98dc1-5e7c-4ef3-ad74-b9b6afaee8b9","625d9252-2f5e-4f53-b577-dd2dfd4d4749"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/492cbcce-3744-4d8b-b2ca-3a7f063e798a.jpg",node_type:"show",ref_id:"492cbcce-3744-4d8b-b2ca-3a7f063e798a",show_title:"Swan Bitcoin"},{children:["8eef2f82-bbf9-4fef-ba3d-102679d4a1a5"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/b29c81c8-cccd-4a6b-b78f-3c1591a54d27.jpg",node_type:"show",ref_id:"b29c81c8-cccd-4a6b-b78f-3c1591a54d27",show_title:"Austin Bitcoin Club"},{children:["a1e3c3cf-2045-4c33-8152-0e162b7ca729"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/63e0cbc0-731d-4ea0-9dd2-2b8b841eb28a.jpg",node_type:"show",ref_id:"63e0cbc0-731d-4ea0-9dd2-2b8b841eb28a",show_title:"Synonym"},{children:["e06b030a-063e-4894-9914-d326220f75f8","e06b030a-063e-4894-9914-d326220f75f8","e06b030a-063e-4894-9914-d326220f75f8"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/ea2cf2ae-76de-4185-818c-384b3b06228b.jpg",node_type:"show",ref_id:"ea2cf2ae-76de-4185-818c-384b3b06228b",show_title:"Blockware Intelligence"},{children:["b707bbd8-1a9e-4aee-8e0e-2fe0be24c851"],image_url:"https://stakwork-uploads.s3.amazonaws.com/knowledge-graph-joe/content-images/e79b1a57-ecd0-4df3-b8ec-1a1a55d047e7.jpg",node_type:"show",ref_id:"e79b1a57-ecd0-4df3-b8ec-1a1a55d047e7",show_title:"Pleb UnderGround"}],related:[{episode_title:"The Orange Sun ☀️ #Bitcoin vs. Fiat",ref_id:"e5b1ad5b-2ce2-4192-a6d9-e99f0e3e88b5",show_title:"Satoshi’s Journal"},{episode_title:"Orange Sun 🌞 Why Ethereum is a shitcoin/scam & Bitcoin News",ref_id:"0645c5a3-b511-471d-9d8e-ef63b4dfe340",show_title:"Satoshi’s Journal"},{episode_title:"#Bitcoin Beats⚡🎶 by @SatoshisJournal Genesis Block walkthrough",ref_id:"aba7b4db-77bb-40c4-a0d4-4ce20da7b9ba",show_title:"Satoshi’s Journal"},{episode_title:"The Orange Sun 🌞 Does Price = Value? #Bitcoin",ref_id:"a0826cdb-6198-4416-bd12-1dd5aa09a075",show_title:"Satoshi’s Journal"},{episode_title:"#Bitcoin Beats⚡🎶 by @SatoshisJournal w @NEEDcreations & @DJSATOSHI18",ref_id:"fd00f285-c11e-40ba-8af9-b67265ac321b",show_title:"Satoshi’s Journal"},{episode_title:'The Orange Sun ☀️ Reading/Discussion of "The Book of Satoshi."',ref_id:"fcbe1196-c55d-476f-92d6-4dcba954eaf3",show_title:"Satoshi’s Journal"},{episode_title:'The Orange 🌞 Reading/Discussion "The Book of Satoshi" & Bitcoin News',ref_id:"c6447277-9a58-411f-85e1-5ac166884ce5",show_title:"Satoshi’s Journal"},{episode_title:"The Orange Sun 🌞 Bitcoin News and Talk - Happy Holidays!",ref_id:"d0b59017-ae64-47d4-be5c-c1531c9d480f",show_title:"Satoshi’s Journal"},{episode_title:`The Orange Sun 🌞 Reading/Discussion Tomer Strolight's "Why Bitcoin?"`,ref_id:"95848760-3863-4595-b049-f25826eba2d3",show_title:"Satoshi’s Journal"}]},request=async(tt,et)=>{const nt=await fetch(tt,et);if(!nt.ok)throw nt;return nt.json()},api$1={delete:(tt,et)=>request(`${API_URL}${tt}`,{headers:{...et,"Content-Type":"application/json"},method:"DELETE"}),get:(tt,et)=>request(`${API_URL}${tt}`,et?{headers:et}:void 0),post:(tt,et,nt)=>request(`${API_URL}${tt}`,{body:et,headers:{...nt,"Content-Type":"application/json"},method:"POST"}),put:(tt,et,nt)=>request(`${API_URL}${tt}`,{body:et,headers:{...nt,"Content-Type":"application/json"},method:"PUT"})},getLSat=async()=>{var tt;try{const et=(tt=window.localStorage)==null?void 0:tt.getItem("lsat");if(et){const it=JSON.parse(et);return lsatToken(it.macaroon,it.preimage)}if(await distExports$1.enable()){const it=await distExports$1.getLsat(window.location.host);return it.macaroon?(window.localStorage.setItem("lsat",JSON.stringify({macaroon:it.macaroon,identifier:it.identifier,preimage:it.preimage})),lsatToken(it.macaroon,it.preimage)):""}return""}catch(et){return console.warn(et),""}};function lsatToken(tt,et){return`LSAT ${tt}:${et}`}const typesWeighedByChildren=["show","episode"],getSuperficialNodeWeight=(tt,et)=>{var it;return tt.weight?tt.weight:typesWeighedByChildren.includes(tt.node_type)?((it=tt==null?void 0:tt.children)==null?void 0:it.length)||0:et.filter(rt=>rt.sourceRef===tt.ref_id||rt.targetRef===tt.ref_id).length},getMaxSuperficialWeightPerNodeType=(tt,et)=>{const nt={};return tt.forEach(it=>{const rt=getSuperficialNodeWeight(it,et);(!nt[it.node_type]||nt[it.node_type]"u"||!getProto$1?undefined$1:getProto$1(Uint8Array),INTRINSICS={"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(getProto$1([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols$1?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$2,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto$1)try{null.error}catch(tt){var errorProto=getProto$1(getProto$1(tt));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function tt(et){var nt;if(et==="%AsyncFunction%")nt=getEvalledConstructor("async function () {}");else if(et==="%GeneratorFunction%")nt=getEvalledConstructor("function* () {}");else if(et==="%AsyncGeneratorFunction%")nt=getEvalledConstructor("async function* () {}");else if(et==="%AsyncGenerator%"){var it=tt("%AsyncGeneratorFunction%");it&&(nt=it.prototype)}else if(et==="%AsyncIteratorPrototype%"){var rt=tt("%AsyncGenerator%");rt&&getProto$1&&(nt=getProto$1(rt.prototype))}return INTRINSICS[et]=nt,nt},LEGACY_ALIASES={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn$2=hasown,$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName$1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar$1=/\\(\\)?/g,stringToPath$2=function(et){var nt=$strSlice(et,0,1),it=$strSlice(et,-1);if(nt==="%"&&it!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(it==="%"&&nt!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var rt=[];return $replace(et,rePropName$1,function(ot,at,st,lt){rt[rt.length]=st?$replace(lt,reEscapeChar$1,"$1"):at||ot}),rt},getBaseIntrinsic=function(et,nt){var it=et,rt;if(hasOwn$2(LEGACY_ALIASES,it)&&(rt=LEGACY_ALIASES[it],it="%"+rt[0]+"%"),hasOwn$2(INTRINSICS,it)){var ot=INTRINSICS[it];if(ot===needsEval&&(ot=doEval(it)),typeof ot>"u"&&!nt)throw new $TypeError$2("intrinsic "+et+" exists, but is not available. Please file an issue!");return{alias:rt,name:it,value:ot}}throw new $SyntaxError$1("intrinsic "+et+" does not exist!")},getIntrinsic=function(et,nt){if(typeof et!="string"||et.length===0)throw new $TypeError$2("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof nt!="boolean")throw new $TypeError$2('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,et)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var it=stringToPath$2(et),rt=it.length>0?it[0]:"",ot=getBaseIntrinsic("%"+rt+"%",nt),at=ot.name,st=ot.value,lt=!1,ct=ot.alias;ct&&(rt=ct[0],$spliceApply(it,$concat([0,1],ct)));for(var ut=1,ht=!0;ut=it.length){var gt=$gOPD$1(st,dt);ht=!!gt,ht&&"get"in gt&&!("originalValue"in gt.get)?st=gt.get:st=st[dt]}else ht=hasOwn$2(st,dt),st=st[dt];ht&&!lt&&(INTRINSICS[at]=st)}}return st},callBind$2={exports:{}},GetIntrinsic$4=getIntrinsic,$defineProperty$2=GetIntrinsic$4("%Object.defineProperty%",!0),hasPropertyDescriptors$1=function(){if($defineProperty$2)try{return $defineProperty$2({},"a",{value:1}),!0}catch{return!1}return!1};hasPropertyDescriptors$1.hasArrayLengthDefineBug=function(){if(!hasPropertyDescriptors$1())return null;try{return $defineProperty$2([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors$1,GetIntrinsic$3=getIntrinsic,$gOPD=GetIntrinsic$3("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd$1=$gOPD,hasPropertyDescriptors=hasPropertyDescriptors_1(),GetIntrinsic$2=getIntrinsic,$defineProperty$1=hasPropertyDescriptors&&GetIntrinsic$2("%Object.defineProperty%",!0);if($defineProperty$1)try{$defineProperty$1({},"a",{value:1})}catch{$defineProperty$1=!1}var $SyntaxError=GetIntrinsic$2("%SyntaxError%"),$TypeError$1=GetIntrinsic$2("%TypeError%"),gopd=gopd$1,defineDataProperty=function(et,nt,it){if(!et||typeof et!="object"&&typeof et!="function")throw new $TypeError$1("`obj` must be an object or a function`");if(typeof nt!="string"&&typeof nt!="symbol")throw new $TypeError$1("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $TypeError$1("`loose`, if provided, must be a boolean");var rt=arguments.length>3?arguments[3]:null,ot=arguments.length>4?arguments[4]:null,at=arguments.length>5?arguments[5]:null,st=arguments.length>6?arguments[6]:!1,lt=!!gopd&&gopd(et,nt);if($defineProperty$1)$defineProperty$1(et,nt,{configurable:at===null&<?lt.configurable:!at,enumerable:rt===null&<?lt.enumerable:!rt,value:it,writable:ot===null&<?lt.writable:!ot});else if(st||!rt&&!ot&&!at)et[nt]=it;else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},GetIntrinsic$1=getIntrinsic,define$1=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD$4=gopd$1,$TypeError=GetIntrinsic$1("%TypeError%"),$floor=GetIntrinsic$1("%Math.floor%"),setFunctionLength=function(et,nt){if(typeof et!="function")throw new $TypeError("`fn` is not a function");if(typeof nt!="number"||nt<0||nt>4294967295||$floor(nt)!==nt)throw new $TypeError("`length` must be a positive 32-bit integer");var it=arguments.length>2&&!!arguments[2],rt=!0,ot=!0;if("length"in et&&gOPD$4){var at=gOPD$4(et,"length");at&&!at.configurable&&(rt=!1),at&&!at.writable&&(ot=!1)}return(rt||ot||!it)&&(hasDescriptors?define$1(et,"length",nt,!0,!0):define$1(et,"length",nt)),et};(function(tt){var et=functionBind,nt=getIntrinsic,it=setFunctionLength,rt=nt("%TypeError%"),ot=nt("%Function.prototype.apply%"),at=nt("%Function.prototype.call%"),st=nt("%Reflect.apply%",!0)||et.call(at,ot),lt=nt("%Object.defineProperty%",!0),ct=nt("%Math.max%");if(lt)try{lt({},"a",{value:1})}catch{lt=null}tt.exports=function(dt){if(typeof dt!="function")throw new rt("a function is required");var pt=st(et,at,arguments);return it(pt,1+ct(0,dt.length-(arguments.length-1)),!0)};var ut=function(){return st(et,ot,arguments)};lt?lt(tt.exports,"apply",{value:ut}):tt.exports.apply=ut})(callBind$2);var callBindExports=callBind$2.exports,GetIntrinsic=getIntrinsic,callBind$1=callBindExports,$indexOf$1=callBind$1(GetIntrinsic("String.prototype.indexOf")),callBound$3=function(et,nt){var it=GetIntrinsic(et,!!nt);return typeof it=="function"&&$indexOf$1(et,".prototype.")>-1?callBind$1(it):it},hasToStringTag$3=shams(),callBound$2=callBound$3,$toString$1=callBound$2("Object.prototype.toString"),isStandardArguments=function(et){return hasToStringTag$3&&et&&typeof et=="object"&&Symbol.toStringTag in et?!1:$toString$1(et)==="[object Arguments]"},isLegacyArguments=function(et){return isStandardArguments(et)?!0:et!==null&&typeof et=="object"&&typeof et.length=="number"&&et.length>=0&&$toString$1(et)!=="[object Array]"&&$toString$1(et.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments$5=supportsStandardArguments?isStandardArguments:isLegacyArguments,toStr$4=Object.prototype.toString,fnToStr$1=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag$2=shams(),getProto=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag$2)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(et){if(typeof et!="function")return!1;if(isFnRegex.test(fnToStr$1.call(et)))return!0;if(!hasToStringTag$2){var nt=toStr$4.call(et);return nt==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var it=getGeneratorFunc();GeneratorFunction=it?getProto(it):!1}return getProto(et)===GeneratorFunction},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(tt){tt!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(et){try{var nt=fnToStr.call(et);return constructorRegex.test(nt)}catch{return!1}},tryFunctionObject=function(et){try{return isES6ClassFn(et)?!1:(fnToStr.call(et),!0)}catch{return!1}},toStr$3=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$1=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all$1=document.all;toStr$3.call(all$1)===toStr$3.call(document.all)&&(isDDA=function(et){if((isIE68||!et)&&(typeof et>"u"||typeof et=="object"))try{var nt=toStr$3.call(et);return(nt===ddaClass||nt===ddaClass2||nt===ddaClass3||nt===objectClass)&&et("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(et){if(isDDA(et))return!0;if(!et||typeof et!="function"&&typeof et!="object")return!1;try{reflectApply(et,null,badArrayLike)}catch(nt){if(nt!==isCallableMarker)return!1}return!isES6ClassFn(et)&&tryFunctionObject(et)}:function(et){if(isDDA(et))return!0;if(!et||typeof et!="function"&&typeof et!="object")return!1;if(hasToStringTag$1)return tryFunctionObject(et);if(isES6ClassFn(et))return!1;var nt=toStr$3.call(et);return nt!==fnClass&&nt!==genClass&&!/^\[object HTML/.test(nt)?!1:tryFunctionObject(et)},isCallable=isCallable$1,toStr$2=Object.prototype.toString,hasOwnProperty$g=Object.prototype.hasOwnProperty,forEachArray=function(et,nt,it){for(var rt=0,ot=et.length;rt=3&&(rt=it),toStr$2.call(et)==="[object Array]"?forEachArray(et,nt,rt):typeof et=="string"?forEachString(et,nt,rt):forEachObject(et,nt,rt)},forEach_1=forEach$1,possibleNames=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],g$3=typeof globalThis>"u"?commonjsGlobal:globalThis,availableTypedArrays$1=function(){for(var et=[],nt=0;nt"u"?commonjsGlobal:globalThis,typedArrays=availableTypedArrays(),$slice=callBound$1("String.prototype.slice"),getPrototypeOf$3=Object.getPrototypeOf,$indexOf=callBound$1("Array.prototype.indexOf",!0)||function(et,nt){for(var it=0;it-1?nt:nt!=="Object"?!1:trySlices(et)}return gOPD$3?tryTypedArrays(et):null},whichTypedArray=whichTypedArray$1,isTypedArray$4=function(et){return!!whichTypedArray(et)};(function(tt){var et=isArguments$5,nt=isGeneratorFunction,it=whichTypedArray$1,rt=isTypedArray$4;function ot(An){return An.call.bind(An)}var at=typeof BigInt<"u",st=typeof Symbol<"u",lt=ot(Object.prototype.toString),ct=ot(Number.prototype.valueOf),ut=ot(String.prototype.valueOf),ht=ot(Boolean.prototype.valueOf);if(at)var dt=ot(BigInt.prototype.valueOf);if(st)var pt=ot(Symbol.prototype.valueOf);function mt(An,gn){if(typeof An!="object")return!1;try{return gn(An),!0}catch{return!1}}tt.isArgumentsObject=et,tt.isGeneratorFunction=nt,tt.isTypedArray=rt;function gt(An){return typeof Promise<"u"&&An instanceof Promise||An!==null&&typeof An=="object"&&typeof An.then=="function"&&typeof An.catch=="function"}tt.isPromise=gt;function bt(An){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(An):rt(An)||Vt(An)}tt.isArrayBufferView=bt;function yt(An){return it(An)==="Uint8Array"}tt.isUint8Array=yt;function wt(An){return it(An)==="Uint8ClampedArray"}tt.isUint8ClampedArray=wt;function vt(An){return it(An)==="Uint16Array"}tt.isUint16Array=vt;function xt(An){return it(An)==="Uint32Array"}tt.isUint32Array=xt;function St(An){return it(An)==="Int8Array"}tt.isInt8Array=St;function Et(An){return it(An)==="Int16Array"}tt.isInt16Array=Et;function $t(An){return it(An)==="Int32Array"}tt.isInt32Array=$t;function It(An){return it(An)==="Float32Array"}tt.isFloat32Array=It;function Ft(An){return it(An)==="Float64Array"}tt.isFloat64Array=Ft;function Ht(An){return it(An)==="BigInt64Array"}tt.isBigInt64Array=Ht;function zt(An){return it(An)==="BigUint64Array"}tt.isBigUint64Array=zt;function Ot(An){return lt(An)==="[object Map]"}Ot.working=typeof Map<"u"&&Ot(new Map);function jt(An){return typeof Map>"u"?!1:Ot.working?Ot(An):An instanceof Map}tt.isMap=jt;function kt(An){return lt(An)==="[object Set]"}kt.working=typeof Set<"u"&&kt(new Set);function Tt(An){return typeof Set>"u"?!1:kt.working?kt(An):An instanceof Set}tt.isSet=Tt;function Ct(An){return lt(An)==="[object WeakMap]"}Ct.working=typeof WeakMap<"u"&&Ct(new WeakMap);function Ut(An){return typeof WeakMap>"u"?!1:Ct.working?Ct(An):An instanceof WeakMap}tt.isWeakMap=Ut;function Nt(An){return lt(An)==="[object WeakSet]"}Nt.working=typeof WeakSet<"u"&&Nt(new WeakSet);function Bt(An){return Nt(An)}tt.isWeakSet=Bt;function Mt(An){return lt(An)==="[object ArrayBuffer]"}Mt.working=typeof ArrayBuffer<"u"&&Mt(new ArrayBuffer);function Dt(An){return typeof ArrayBuffer>"u"?!1:Mt.working?Mt(An):An instanceof ArrayBuffer}tt.isArrayBuffer=Dt;function Pt(An){return lt(An)==="[object DataView]"}Pt.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Pt(new DataView(new ArrayBuffer(1),0,1));function Vt(An){return typeof DataView>"u"?!1:Pt.working?Pt(An):An instanceof DataView}tt.isDataView=Vt;var nn=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function cn(An){return lt(An)==="[object SharedArrayBuffer]"}function Xt(An){return typeof nn>"u"?!1:(typeof cn.working>"u"&&(cn.working=cn(new nn)),cn.working?cn(An):An instanceof nn)}tt.isSharedArrayBuffer=Xt;function un(An){return lt(An)==="[object AsyncFunction]"}tt.isAsyncFunction=un;function en(An){return lt(An)==="[object Map Iterator]"}tt.isMapIterator=en;function fn(An){return lt(An)==="[object Set Iterator]"}tt.isSetIterator=fn;function xn(An){return lt(An)==="[object Generator]"}tt.isGeneratorObject=xn;function an(An){return lt(An)==="[object WebAssembly.Module]"}tt.isWebAssemblyCompiledModule=an;function Zt(An){return mt(An,ct)}tt.isNumberObject=Zt;function En(An){return mt(An,ut)}tt.isStringObject=En;function In(An){return mt(An,ht)}tt.isBooleanObject=In;function Cn(An){return at&&mt(An,dt)}tt.isBigIntObject=Cn;function Nn(An){return st&&mt(An,pt)}tt.isSymbolObject=Nn;function Un(An){return Zt(An)||En(An)||In(An)||Cn(An)||Nn(An)}tt.isBoxedPrimitive=Un;function _n(An){return typeof Uint8Array<"u"&&(Dt(An)||Xt(An))}tt.isAnyArrayBuffer=_n,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(An){Object.defineProperty(tt,An,{enumerable:!1,value:function(){throw new Error(An+" is not supported in userland")}})})})(types$8);var isBufferBrowser=function(et){return et&&typeof et=="object"&&typeof et.copy=="function"&&typeof et.fill=="function"&&typeof et.readUInt8=="function"},inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(et,nt){nt&&(et.super_=nt,et.prototype=Object.create(nt.prototype,{constructor:{value:et,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(et,nt){if(nt){et.super_=nt;var it=function(){};it.prototype=nt.prototype,et.prototype=new it,et.prototype.constructor=et}};var inherits_browserExports=inherits_browser.exports;(function(tt){var et=Object.getOwnPropertyDescriptors||function(Vt){for(var nn=Object.keys(Vt),cn={},Xt=0;Xt=Xt)return fn;switch(fn){case"%s":return String(cn[nn++]);case"%d":return Number(cn[nn++]);case"%j":try{return JSON.stringify(cn[nn++])}catch{return"[Circular]"}default:return fn}}),en=cn[nn];nn"u")return function(){return tt.deprecate(Pt,Vt).apply(this,arguments)};var nn=!1;function cn(){if(!nn){if(process.throwDeprecation)throw new Error(Vt);process.traceDeprecation?console.trace(Vt):console.error(Vt),nn=!0}return Pt.apply(this,arguments)}return cn};var it={},rt=/^$/;if({}.NODE_DEBUG){var ot={}.NODE_DEBUG;ot=ot.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),rt=new RegExp("^"+ot+"$","i")}tt.debuglog=function(Pt){if(Pt=Pt.toUpperCase(),!it[Pt])if(rt.test(Pt)){var Vt=process.pid;it[Pt]=function(){var nn=tt.format.apply(tt,arguments);console.error("%s %d: %s",Pt,Vt,nn)}}else it[Pt]=function(){};return it[Pt]};function at(Pt,Vt){var nn={seen:[],stylize:lt};return arguments.length>=3&&(nn.depth=arguments[2]),arguments.length>=4&&(nn.colors=arguments[3]),yt(Vt)?nn.showHidden=Vt:Vt&&tt._extend(nn,Vt),$t(nn.showHidden)&&(nn.showHidden=!1),$t(nn.depth)&&(nn.depth=2),$t(nn.colors)&&(nn.colors=!1),$t(nn.customInspect)&&(nn.customInspect=!0),nn.colors&&(nn.stylize=st),ut(nn,Pt,nn.depth)}tt.inspect=at,at.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},at.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function st(Pt,Vt){var nn=at.styles[Vt];return nn?"\x1B["+at.colors[nn][0]+"m"+Pt+"\x1B["+at.colors[nn][1]+"m":Pt}function lt(Pt,Vt){return Pt}function ct(Pt){var Vt={};return Pt.forEach(function(nn,cn){Vt[nn]=!0}),Vt}function ut(Pt,Vt,nn){if(Pt.customInspect&&Vt&&Ot(Vt.inspect)&&Vt.inspect!==tt.inspect&&!(Vt.constructor&&Vt.constructor.prototype===Vt)){var cn=Vt.inspect(nn,Pt);return St(cn)||(cn=ut(Pt,cn,nn)),cn}var Xt=ht(Pt,Vt);if(Xt)return Xt;var un=Object.keys(Vt),en=ct(un);if(Pt.showHidden&&(un=Object.getOwnPropertyNames(Vt)),zt(Vt)&&(un.indexOf("message")>=0||un.indexOf("description")>=0))return dt(Vt);if(un.length===0){if(Ot(Vt)){var fn=Vt.name?": "+Vt.name:"";return Pt.stylize("[Function"+fn+"]","special")}if(It(Vt))return Pt.stylize(RegExp.prototype.toString.call(Vt),"regexp");if(Ht(Vt))return Pt.stylize(Date.prototype.toString.call(Vt),"date");if(zt(Vt))return dt(Vt)}var xn="",an=!1,Zt=["{","}"];if(bt(Vt)&&(an=!0,Zt=["[","]"]),Ot(Vt)){var En=Vt.name?": "+Vt.name:"";xn=" [Function"+En+"]"}if(It(Vt)&&(xn=" "+RegExp.prototype.toString.call(Vt)),Ht(Vt)&&(xn=" "+Date.prototype.toUTCString.call(Vt)),zt(Vt)&&(xn=" "+dt(Vt)),un.length===0&&(!an||Vt.length==0))return Zt[0]+xn+Zt[1];if(nn<0)return It(Vt)?Pt.stylize(RegExp.prototype.toString.call(Vt),"regexp"):Pt.stylize("[Object]","special");Pt.seen.push(Vt);var In;return an?In=pt(Pt,Vt,nn,en,un):In=un.map(function(Cn){return mt(Pt,Vt,nn,en,Cn,an)}),Pt.seen.pop(),gt(In,xn,Zt)}function ht(Pt,Vt){if($t(Vt))return Pt.stylize("undefined","undefined");if(St(Vt)){var nn="'"+JSON.stringify(Vt).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Pt.stylize(nn,"string")}if(xt(Vt))return Pt.stylize(""+Vt,"number");if(yt(Vt))return Pt.stylize(""+Vt,"boolean");if(wt(Vt))return Pt.stylize("null","null")}function dt(Pt){return"["+Error.prototype.toString.call(Pt)+"]"}function pt(Pt,Vt,nn,cn,Xt){for(var un=[],en=0,fn=Vt.length;en-1&&(un?fn=fn.split(` +`).map(function(an){return" "+an}).join(` +`).slice(2):fn=` +`+fn.split(` +`).map(function(an){return" "+an}).join(` +`))):fn=Pt.stylize("[Circular]","special")),$t(en)){if(un&&Xt.match(/^\d+$/))return fn;en=JSON.stringify(""+Xt),en.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(en=en.slice(1,-1),en=Pt.stylize(en,"name")):(en=en.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),en=Pt.stylize(en,"string"))}return en+": "+fn}function gt(Pt,Vt,nn){var cn=Pt.reduce(function(Xt,un){return un.indexOf(` +`)>=0,Xt+un.replace(/\u001b\[\d\d?m/g,"").length+1},0);return cn>60?nn[0]+(Vt===""?"":Vt+` + `)+" "+Pt.join(`, + `)+" "+nn[1]:nn[0]+Vt+" "+Pt.join(", ")+" "+nn[1]}tt.types=types$8;function bt(Pt){return Array.isArray(Pt)}tt.isArray=bt;function yt(Pt){return typeof Pt=="boolean"}tt.isBoolean=yt;function wt(Pt){return Pt===null}tt.isNull=wt;function vt(Pt){return Pt==null}tt.isNullOrUndefined=vt;function xt(Pt){return typeof Pt=="number"}tt.isNumber=xt;function St(Pt){return typeof Pt=="string"}tt.isString=St;function Et(Pt){return typeof Pt=="symbol"}tt.isSymbol=Et;function $t(Pt){return Pt===void 0}tt.isUndefined=$t;function It(Pt){return Ft(Pt)&&kt(Pt)==="[object RegExp]"}tt.isRegExp=It,tt.types.isRegExp=It;function Ft(Pt){return typeof Pt=="object"&&Pt!==null}tt.isObject=Ft;function Ht(Pt){return Ft(Pt)&&kt(Pt)==="[object Date]"}tt.isDate=Ht,tt.types.isDate=Ht;function zt(Pt){return Ft(Pt)&&(kt(Pt)==="[object Error]"||Pt instanceof Error)}tt.isError=zt,tt.types.isNativeError=zt;function Ot(Pt){return typeof Pt=="function"}tt.isFunction=Ot;function jt(Pt){return Pt===null||typeof Pt=="boolean"||typeof Pt=="number"||typeof Pt=="string"||typeof Pt=="symbol"||typeof Pt>"u"}tt.isPrimitive=jt,tt.isBuffer=isBufferBrowser;function kt(Pt){return Object.prototype.toString.call(Pt)}function Tt(Pt){return Pt<10?"0"+Pt.toString(10):Pt.toString(10)}var Ct=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ut(){var Pt=new Date,Vt=[Tt(Pt.getHours()),Tt(Pt.getMinutes()),Tt(Pt.getSeconds())].join(":");return[Pt.getDate(),Ct[Pt.getMonth()],Vt].join(" ")}tt.log=function(){console.log("%s - %s",Ut(),tt.format.apply(tt,arguments))},tt.inherits=inherits_browserExports,tt._extend=function(Pt,Vt){if(!Vt||!Ft(Vt))return Pt;for(var nn=Object.keys(Vt),cn=nn.length;cn--;)Pt[nn[cn]]=Vt[nn[cn]];return Pt};function Nt(Pt,Vt){return Object.prototype.hasOwnProperty.call(Pt,Vt)}var Bt=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;tt.promisify=function(Vt){if(typeof Vt!="function")throw new TypeError('The "original" argument must be of type Function');if(Bt&&Vt[Bt]){var nn=Vt[Bt];if(typeof nn!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(nn,Bt,{value:nn,enumerable:!1,writable:!1,configurable:!0}),nn}function nn(){for(var cn,Xt,un=new Promise(function(xn,an){cn=xn,Xt=an}),en=[],fn=0;fn"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dt(St){return dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function($t){return $t.__proto__||Object.getPrototypeOf($t)},dt(St)}var pt={},mt,gt;function bt(St,Et,$t){$t||($t=Error);function It(Ht,zt,Ot){return typeof Et=="string"?Et:Et(Ht,zt,Ot)}var Ft=function(Ht){at(Ot,Ht);var zt=lt(Ot);function Ot(jt,kt,Tt){var Ct;return ot(this,Ot),Ct=zt.call(this,It(jt,kt,Tt)),Ct.code=St,Ct}return nt(Ot)}($t);pt[St]=Ft}function yt(St,Et){if(Array.isArray(St)){var $t=St.length;return St=St.map(function(It){return String(It)}),$t>2?"one of ".concat(Et," ").concat(St.slice(0,$t-1).join(", "),", or ")+St[$t-1]:$t===2?"one of ".concat(Et," ").concat(St[0]," or ").concat(St[1]):"of ".concat(Et," ").concat(St[0])}else return"of ".concat(Et," ").concat(String(St))}function wt(St,Et,$t){return St.substr(!$t||$t<0?0:+$t,Et.length)===Et}function vt(St,Et,$t){return($t===void 0||$t>St.length)&&($t=St.length),St.substring($t-Et.length,$t)===Et}function xt(St,Et,$t){return typeof $t!="number"&&($t=0),$t+Et.length>St.length?!1:St.indexOf(Et,$t)!==-1}return bt("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),bt("ERR_INVALID_ARG_TYPE",function(St,Et,$t){mt===void 0&&(mt=requireAssert()),mt(typeof St=="string","'name' must be a string");var It;typeof Et=="string"&&wt(Et,"not ")?(It="must not be",Et=Et.replace(/^not /,"")):It="must be";var Ft;if(vt(St," argument"))Ft="The ".concat(St," ").concat(It," ").concat(yt(Et,"type"));else{var Ht=xt(St,".")?"property":"argument";Ft='The "'.concat(St,'" ').concat(Ht," ").concat(It," ").concat(yt(Et,"type"))}return Ft+=". Received type ".concat(tt($t)),Ft},TypeError),bt("ERR_INVALID_ARG_VALUE",function(St,Et){var $t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";gt===void 0&&(gt=util);var It=gt.inspect(Et);return It.length>128&&(It="".concat(It.slice(0,128),"...")),"The argument '".concat(St,"' ").concat($t,". Received ").concat(It)},TypeError),bt("ERR_INVALID_RETURN_VALUE",function(St,Et,$t){var It;return $t&&$t.constructor&&$t.constructor.name?It="instance of ".concat($t.constructor.name):It="type ".concat(tt($t)),"Expected ".concat(St,' to be returned from the "').concat(Et,'"')+" function but got ".concat(It,".")},TypeError),bt("ERR_MISSING_ARGS",function(){for(var St=arguments.length,Et=new Array(St),$t=0;$t0,"At least one arg needs to be specified");var It="The ",Ft=Et.length;switch(Et=Et.map(function(Ht){return'"'.concat(Ht,'"')}),Ft){case 1:It+="".concat(Et[0]," argument");break;case 2:It+="".concat(Et[0]," and ").concat(Et[1]," arguments");break;default:It+=Et.slice(0,Ft-1).join(", "),It+=", and ".concat(Et[Ft-1]," arguments");break}return"".concat(It," must be specified")},TypeError),errors$3.codes=pt,errors$3}var assertion_error,hasRequiredAssertion_error;function requireAssertion_error(){if(hasRequiredAssertion_error)return assertion_error;hasRequiredAssertion_error=1;function tt(Bt,Mt){var Dt=Object.keys(Bt);if(Object.getOwnPropertySymbols){var Pt=Object.getOwnPropertySymbols(Bt);Mt&&(Pt=Pt.filter(function(Vt){return Object.getOwnPropertyDescriptor(Bt,Vt).enumerable})),Dt.push.apply(Dt,Pt)}return Dt}function et(Bt){for(var Mt=1;Mt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gt(Bt){return Function.toString.call(Bt).indexOf("[native code]")!==-1}function bt(Bt,Mt){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Pt,Vt){return Pt.__proto__=Vt,Pt},bt(Bt,Mt)}function yt(Bt){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Dt){return Dt.__proto__||Object.getPrototypeOf(Dt)},yt(Bt)}function wt(Bt){"@babel/helpers - typeof";return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Mt){return typeof Mt}:function(Mt){return Mt&&typeof Symbol=="function"&&Mt.constructor===Symbol&&Mt!==Symbol.prototype?"symbol":typeof Mt},wt(Bt)}var vt=util,xt=vt.inspect,St=requireErrors(),Et=St.codes.ERR_INVALID_ARG_TYPE;function $t(Bt,Mt,Dt){return(Dt===void 0||Dt>Bt.length)&&(Dt=Bt.length),Bt.substring(Dt-Mt.length,Dt)===Mt}function It(Bt,Mt){if(Mt=Math.floor(Mt),Bt.length==0||Mt==0)return"";var Dt=Bt.length*Mt;for(Mt=Math.floor(Math.log(Mt)/Math.log(2));Mt;)Bt+=Bt,Mt--;return Bt+=Bt.substring(0,Dt-Bt.length),Bt}var Ft="",Ht="",zt="",Ot="",jt={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},kt=10;function Tt(Bt){var Mt=Object.keys(Bt),Dt=Object.create(Object.getPrototypeOf(Bt));return Mt.forEach(function(Pt){Dt[Pt]=Bt[Pt]}),Object.defineProperty(Dt,"message",{value:Bt.message}),Dt}function Ct(Bt){return xt(Bt,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function Ut(Bt,Mt,Dt){var Pt="",Vt="",nn=0,cn="",Xt=!1,un=Ct(Bt),en=un.split(` +`),fn=Ct(Mt).split(` +`),xn=0,an="";if(Dt==="strictEqual"&&wt(Bt)==="object"&&wt(Mt)==="object"&&Bt!==null&&Mt!==null&&(Dt="strictEqualObject"),en.length===1&&fn.length===1&&en[0]!==fn[0]){var Zt=en[0].length+fn[0].length;if(Zt<=kt){if((wt(Bt)!=="object"||Bt===null)&&(wt(Mt)!=="object"||Mt===null)&&(Bt!==0||Mt!==0))return"".concat(jt[Dt],` + +`)+"".concat(en[0]," !== ").concat(fn[0],` +`)}else if(Dt!=="strictEqualObject"){var En=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(Zt2&&(an=` + `.concat(It(" ",xn),"^"),xn=0)}}}for(var In=en[en.length-1],Cn=fn[fn.length-1];In===Cn&&(xn++<2?cn=` + `.concat(In).concat(cn):Pt=In,en.pop(),fn.pop(),!(en.length===0||fn.length===0));)In=en[en.length-1],Cn=fn[fn.length-1];var Nn=Math.max(en.length,fn.length);if(Nn===0){var Un=un.split(` +`);if(Un.length>30)for(Un[26]="".concat(Ft,"...").concat(Ot);Un.length>27;)Un.pop();return"".concat(jt.notIdentical,` `).concat(Un.join(` `),` -`)}vn>3&&(rn=` -`.concat($t,"...").concat(Bt).concat(rn),Xt=!0),Mt!==""&&(rn=` - `.concat(Mt).concat(rn),Mt="");var yn=0,un=Pt[Dt]+` -`.concat(Ut,"+ actual").concat(Bt," ").concat(Lt,"- expected").concat(Bt),En=" ".concat($t,"...").concat(Bt," Lines skipped");for(vn=0;vn1&&vn>2&&(In>4?(Vt+=` -`.concat($t,"...").concat(Bt),Xt=!0):In>3&&(Vt+=` - `.concat(pn[vn-2]),yn++),Vt+=` - `.concat(pn[vn-1]),yn++),Qt=vn,Mt+=` -`.concat(Lt,"-").concat(Bt," ").concat(pn[vn]),yn++;else if(pn.length1&&vn>2&&(In>4?(Vt+=` -`.concat($t,"...").concat(Bt),Xt=!0):In>3&&(Vt+=` - `.concat(tn[vn-2]),yn++),Vt+=` - `.concat(tn[vn-1]),yn++),Qt=vn,Vt+=` -`.concat(Ut,"+").concat(Bt," ").concat(tn[vn]),yn++;else{var xn=pn[vn],dn=tn[vn],cn=dn!==xn&&(!It(dn,",")||dn.slice(0,-1)!==xn);cn&&It(xn,",")&&xn.slice(0,-1)===dn&&(cn=!1,dn+=","),cn?(In>1&&vn>2&&(In>4?(Vt+=` -`.concat($t,"...").concat(Bt),Xt=!0):In>3&&(Vt+=` - `.concat(tn[vn-2]),yn++),Vt+=` - `.concat(tn[vn-1]),yn++),Qt=vn,Vt+=` -`.concat(Ut,"+").concat(Bt," ").concat(dn),Mt+=` -`.concat(Lt,"-").concat(Bt," ").concat(xn),yn+=2):(Vt+=Mt,Mt="",(In===1||vn===0)&&(Vt+=` - `.concat(dn),yn++))}if(yn>20&&vn3&&(cn=` +`.concat(Ft,"...").concat(Ot).concat(cn),Xt=!0),Pt!==""&&(cn=` + `.concat(Pt).concat(cn),Pt="");var _n=0,An=jt[Dt]+` +`.concat(Ht,"+ actual").concat(Ot," ").concat(zt,"- expected").concat(Ot),gn=" ".concat(Ft,"...").concat(Ot," Lines skipped");for(xn=0;xn1&&xn>2&&(Tn>4?(Vt+=` +`.concat(Ft,"...").concat(Ot),Xt=!0):Tn>3&&(Vt+=` + `.concat(fn[xn-2]),_n++),Vt+=` + `.concat(fn[xn-1]),_n++),nn=xn,Pt+=` +`.concat(zt,"-").concat(Ot," ").concat(fn[xn]),_n++;else if(fn.length1&&xn>2&&(Tn>4?(Vt+=` +`.concat(Ft,"...").concat(Ot),Xt=!0):Tn>3&&(Vt+=` + `.concat(en[xn-2]),_n++),Vt+=` + `.concat(en[xn-1]),_n++),nn=xn,Vt+=` +`.concat(Ht,"+").concat(Ot," ").concat(en[xn]),_n++;else{var yn=fn[xn],dn=en[xn],sn=dn!==yn&&(!$t(dn,",")||dn.slice(0,-1)!==yn);sn&&$t(yn,",")&&yn.slice(0,-1)===dn&&(sn=!1,dn+=","),sn?(Tn>1&&xn>2&&(Tn>4?(Vt+=` +`.concat(Ft,"...").concat(Ot),Xt=!0):Tn>3&&(Vt+=` + `.concat(en[xn-2]),_n++),Vt+=` + `.concat(en[xn-1]),_n++),nn=xn,Vt+=` +`.concat(Ht,"+").concat(Ot," ").concat(dn),Pt+=` +`.concat(zt,"-").concat(Ot," ").concat(yn),_n+=2):(Vt+=Pt,Pt="",(Tn===1||xn===0)&&(Vt+=` + `.concat(dn),_n++))}if(_n>20&&xn30)for(Zt[26]="".concat($t,"...").concat(Bt);Zt.length>27;)Zt.pop();Zt.length===1?Qt=Dt.call(this,"".concat(sn," ").concat(Zt[0])):Qt=Dt.call(this,"".concat(sn,` +`).concat(Ft,"...").concat(Ot).concat(Pt,` +`)+"".concat(Ft,"...").concat(Ot)}return"".concat(An).concat(Xt?gn:"",` +`).concat(Vt).concat(Pt).concat(cn).concat(an)}var Nt=function(Bt,Mt){lt(Pt,Bt);var Dt=ct(Pt);function Pt(Vt){var nn;if(it(this,Pt),wt(Vt)!=="object"||Vt===null)throw new Et("options","Object",Vt);var cn=Vt.message,Xt=Vt.operator,un=Vt.stackStartFn,en=Vt.actual,fn=Vt.expected,xn=Error.stackTraceLimit;if(Error.stackTraceLimit=0,cn!=null)nn=Dt.call(this,String(cn));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(Ft="\x1B[34m",Ht="\x1B[32m",Ot="\x1B[39m",zt="\x1B[31m"):(Ft="",Ht="",Ot="",zt="")),wt(en)==="object"&&en!==null&&wt(fn)==="object"&&fn!==null&&"stack"in en&&en instanceof Error&&"stack"in fn&&fn instanceof Error&&(en=Tt(en),fn=Tt(fn)),Xt==="deepStrictEqual"||Xt==="strictEqual")nn=Dt.call(this,Ut(en,fn,Xt));else if(Xt==="notDeepStrictEqual"||Xt==="notStrictEqual"){var an=jt[Xt],Zt=Ct(en).split(` +`);if(Xt==="notStrictEqual"&&wt(en)==="object"&&en!==null&&(an=jt.notStrictEqualObject),Zt.length>30)for(Zt[26]="".concat(Ft,"...").concat(Ot);Zt.length>27;)Zt.pop();Zt.length===1?nn=Dt.call(this,"".concat(an," ").concat(Zt[0])):nn=Dt.call(this,"".concat(an,` `).concat(Zt.join(` `),` -`))}else{var Sn=Rt(tn),Tn="",Cn=Pt[Xt];Xt==="notDeepEqual"||Xt==="notEqual"?(Sn="".concat(Pt[Xt],` +`))}else{var En=Ct(en),In="",Cn=jt[Xt];Xt==="notDeepEqual"||Xt==="notEqual"?(En="".concat(jt[Xt],` -`).concat(Sn),Sn.length>1024&&(Sn="".concat(Sn.slice(0,1021),"..."))):(Tn="".concat(Rt(pn)),Sn.length>512&&(Sn="".concat(Sn.slice(0,509),"...")),Tn.length>512&&(Tn="".concat(Tn.slice(0,509),"...")),Xt==="deepEqual"||Xt==="equal"?Sn="".concat(Cn,` +`).concat(En),En.length>1024&&(En="".concat(En.slice(0,1021),"..."))):(In="".concat(Ct(fn)),En.length>512&&(En="".concat(En.slice(0,509),"...")),In.length>512&&(In="".concat(In.slice(0,509),"...")),Xt==="deepEqual"||Xt==="equal"?En="".concat(Cn,` -`).concat(Sn,` +`).concat(En,` should equal -`):Tn=" ".concat(Xt," ").concat(Tn)),Qt=Dt.call(this,"".concat(Sn).concat(Tn))}return Error.stackTraceLimit=vn,Qt.generatedMessage=!rn,Object.defineProperty(ht(Qt),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),Qt.code="ERR_ASSERTION",Qt.actual=tn,Qt.expected=pn,Qt.operator=Xt,Error.captureStackTrace&&Error.captureStackTrace(ht(Qt),an),Qt.stack,Qt.name="AssertionError",ut(Qt)}return ot(Mt,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:Ct,value:function(Qt,rn){return xt(this,et(et({},rn),{},{customInspect:!1,depth:0}))}}]),Mt}(dt(Error),xt.custom);return assertion_error=jt,assertion_error}var toStr$1=Object.prototype.toString,isArguments$4=function(et){var nt=toStr$1.call(et),it=nt==="[object Arguments]";return it||(it=nt!=="[object Array]"&&et!==null&&typeof et=="object"&&typeof et.length=="number"&&et.length>=0&&toStr$1.call(et.callee)==="[object Function]"),it},implementation$5,hasRequiredImplementation$1;function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$5;hasRequiredImplementation$1=1;var tt;if(!Object.keys){var et=Object.prototype.hasOwnProperty,nt=Object.prototype.toString,it=isArguments$4,rt=Object.prototype.propertyIsEnumerable,ot=!rt.call({toString:null},"toString"),at=rt.call(function(){},"prototype"),st=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],lt=function(dt){var pt=dt.constructor;return pt&&pt.prototype===dt},ct={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},ut=function(){if(typeof window>"u")return!1;for(var dt in window)try{if(!ct["$"+dt]&&et.call(window,dt)&&window[dt]!==null&&typeof window[dt]=="object")try{lt(window[dt])}catch{return!0}}catch{return!0}return!1}(),ht=function(dt){if(typeof window>"u"||!ut)return lt(dt);try{return lt(dt)}catch{return!1}};tt=function(pt){var mt=pt!==null&&typeof pt=="object",gt=nt.call(pt)==="[object Function]",bt=it(pt),yt=mt&&nt.call(pt)==="[object String]",wt=[];if(!mt&&!gt&&!bt)throw new TypeError("Object.keys called on a non-object");var vt=at&>if(yt&&pt.length>0&&!et.call(pt,0))for(var xt=0;xt0)for(var St=0;St2?arguments[2]:{},dt=tt(ut);et&&(dt=it.call(dt,Object.getOwnPropertySymbols(ut)));for(var pt=0;ptcn.length)&&(hn=cn.length);for(var $n=0,nn=new Array(hn);$n10)return!0;for(var hn=0;hn57)return!0}return cn.length===10&&cn>=Math.pow(2,32)}function jt(cn){return Object.keys(cn).filter(Wt).concat(ht(cn).filter(Object.prototype.propertyIsEnumerable.bind(cn)))}/*! +`):In=" ".concat(Xt," ").concat(In)),nn=Dt.call(this,"".concat(En).concat(In))}return Error.stackTraceLimit=xn,nn.generatedMessage=!cn,Object.defineProperty(ht(nn),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),nn.code="ERR_ASSERTION",nn.actual=en,nn.expected=fn,nn.operator=Xt,Error.captureStackTrace&&Error.captureStackTrace(ht(nn),un),nn.stack,nn.name="AssertionError",ut(nn)}return ot(Pt,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:Mt,value:function(nn,cn){return xt(this,et(et({},cn),{},{customInspect:!1,depth:0}))}}]),Pt}(dt(Error),xt.custom);return assertion_error=Nt,assertion_error}var toStr$1=Object.prototype.toString,isArguments$4=function(et){var nt=toStr$1.call(et),it=nt==="[object Arguments]";return it||(it=nt!=="[object Array]"&&et!==null&&typeof et=="object"&&typeof et.length=="number"&&et.length>=0&&toStr$1.call(et.callee)==="[object Function]"),it},implementation$5,hasRequiredImplementation$1;function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$5;hasRequiredImplementation$1=1;var tt;if(!Object.keys){var et=Object.prototype.hasOwnProperty,nt=Object.prototype.toString,it=isArguments$4,rt=Object.prototype.propertyIsEnumerable,ot=!rt.call({toString:null},"toString"),at=rt.call(function(){},"prototype"),st=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],lt=function(dt){var pt=dt.constructor;return pt&&pt.prototype===dt},ct={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},ut=function(){if(typeof window>"u")return!1;for(var dt in window)try{if(!ct["$"+dt]&&et.call(window,dt)&&window[dt]!==null&&typeof window[dt]=="object")try{lt(window[dt])}catch{return!0}}catch{return!0}return!1}(),ht=function(dt){if(typeof window>"u"||!ut)return lt(dt);try{return lt(dt)}catch{return!1}};tt=function(pt){var mt=pt!==null&&typeof pt=="object",gt=nt.call(pt)==="[object Function]",bt=it(pt),yt=mt&&nt.call(pt)==="[object String]",wt=[];if(!mt&&!gt&&!bt)throw new TypeError("Object.keys called on a non-object");var vt=at&>if(yt&&pt.length>0&&!et.call(pt,0))for(var xt=0;xt0)for(var St=0;St2?arguments[2]:{},dt=tt(ut);et&&(dt=it.call(dt,Object.getOwnPropertySymbols(ut)));for(var pt=0;ptsn.length)&&(rn=sn.length);for(var Sn=0,tn=new Array(rn);Sn10)return!0;for(var rn=0;rn57)return!0}return sn.length===10&&sn>=Math.pow(2,32)}function Nt(sn){return Object.keys(sn).filter(Ut).concat(ht(sn).filter(Object.prototype.propertyIsEnumerable.bind(sn)))}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function Ot(cn,hn){if(cn===hn)return 0;for(var $n=cn.length,nn=hn.length,Kt=0,Yt=Math.min($n,nn);Kt1?pn-1:0),sn=1;sn1?pn-1:0),sn=1;sn1?pn-1:0),sn=1;sn1?pn-1:0),sn=1;sn1?fn-1:0),an=1;an1?fn-1:0),an=1;an1?fn-1:0),an=1;an1?fn-1:0),an=1;an>>0===it,"off","integer"),it+et>nt.length)throw new EncodingError(it,"Out of bounds read");return tt(nt,it)}}function _readn(tt){return function(et,nt,it){if(enforce$1(Buffer.isBuffer(et),"data","buffer"),enforce$1(nt>>>0===nt,"off","integer"),enforce$1(it>>>0===it,"len","integer"),nt+it>et.length)throw new EncodingError(nt,"Out of bounds read");return tt(et,nt,it)}}function _readvar(tt){return function(et,nt){return enforce$1(Buffer.isBuffer(et),"data","buffer"),enforce$1(nt>>>0===nt,"off","integer"),tt(et,nt)}}function _write(tt,et){return function(nt,it,rt){if(enforce$1(Buffer.isBuffer(nt),"data","buffer"),enforce$1(rt>>>0===rt,"off","integer"),rt+et>nt.length)throw new EncodingError(rt,"Out of bounds write");return tt(nt,it,rt)}}function _writen(tt){return function(et,nt,it,rt){if(enforce$1(Buffer.isBuffer(et),"data","buffer"),enforce$1(it>>>0===it,"off","integer"),enforce$1(rt>>>0===rt,"len","integer"),it+rt>et.length)throw new EncodingError(it,"Out of bounds write");return tt(et,nt,it,rt)}}function _writecb(tt,et){return function(nt,it,rt){if(enforce$1(Buffer.isBuffer(nt),"data","buffer"),enforce$1(rt>>>0===rt,"off","integer"),rt+et(it)>nt.length)throw new EncodingError(rt,"Out of bounds write");return tt(nt,it,rt)}}bufio.readU=_readn(encoding.readU);bufio.readBigU256=_read(encoding.readBigU256,32);bufio.readBigU128=_read(encoding.readBigU128,16);bufio.readBigU64=_read(encoding.readBigU64,8);bufio.readBigU56=_read(encoding.readBigU56,7);bufio.readU64=_read(encoding.readU64,8);bufio.readU56=_read(encoding.readU56,7);bufio.readU48=_read(encoding.readU48,6);bufio.readU40=_read(encoding.readU40,5);bufio.readU32=_read(encoding.readU32,4);bufio.readU24=_read(encoding.readU24,3);bufio.readU16=_read(encoding.readU16,2);bufio.readU8=_read(encoding.readU8,1);bufio.readUBE=_readn(encoding.readUBE);bufio.readBigU256BE=_read(encoding.readBigU256BE,32);bufio.readBigU128BE=_read(encoding.readBigU128BE,16);bufio.readBigU64BE=_read(encoding.readBigU64BE,8);bufio.readBigU56BE=_read(encoding.readBigU56BE,7);bufio.readU64BE=_read(encoding.readU64BE,8);bufio.readU56BE=_read(encoding.readU56BE,7);bufio.readU48BE=_read(encoding.readU48BE,6);bufio.readU40BE=_read(encoding.readU40BE,5);bufio.readU32BE=_read(encoding.readU32BE,4);bufio.readU24BE=_read(encoding.readU24BE,3);bufio.readU16BE=_read(encoding.readU16BE,2);bufio.readI=_readn(encoding.readI);bufio.readBigI64=_read(encoding.readBigI64,8);bufio.readBigI56=_read(encoding.readBigI56,7);bufio.readI64=_read(encoding.readI64,8);bufio.readI56=_read(encoding.readI56,7);bufio.readI48=_read(encoding.readI48,6);bufio.readI40=_read(encoding.readI40,5);bufio.readI32=_read(encoding.readI32,4);bufio.readI24=_read(encoding.readI24,3);bufio.readI16=_read(encoding.readI16,2);bufio.readI8=_read(encoding.readI8,1);bufio.readIBE=_readn(encoding.readIBE);bufio.readBigI64BE=_read(encoding.readBigI64BE,8);bufio.readBigI56BE=_read(encoding.readBigI56BE,7);bufio.readI64BE=_read(encoding.readI64BE,8);bufio.readI56BE=_read(encoding.readI56BE,7);bufio.readI48BE=_read(encoding.readI48BE,6);bufio.readI40BE=_read(encoding.readI40BE,5);bufio.readI32BE=_read(encoding.readI32BE,4);bufio.readI24BE=_read(encoding.readI24BE,3);bufio.readI16BE=_read(encoding.readI16BE,2);bufio.readFloat=_read(encoding.readFloat,4);bufio.readFloatBE=_read(encoding.readFloatBE,4);bufio.readDouble=_read(encoding.readDouble,8);bufio.readDoubleBE=_read(encoding.readDoubleBE,8);bufio.writeU=_writen(encoding.writeU);bufio.writeBigU256=_write(encoding.writeBigU256,32);bufio.writeBigU128=_write(encoding.writeBigU128,16);bufio.writeBigU64=_write(encoding.writeBigU64,8);bufio.writeBigU56=_write(encoding.writeBigU56,7);bufio.writeU64=_write(encoding.writeU64,8);bufio.writeU56=_write(encoding.writeU56,7);bufio.writeU48=_write(encoding.writeU48,6);bufio.writeU40=_write(encoding.writeU40,5);bufio.writeU32=_write(encoding.writeU32,4);bufio.writeU24=_write(encoding.writeU24,3);bufio.writeU16=_write(encoding.writeU16,2);bufio.writeU8=_write(encoding.writeU8,1);bufio.writeUBE=_writen(encoding.writeUBE);bufio.writeBigU256BE=_write(encoding.writeBigU256BE,32);bufio.writeBigU128BE=_write(encoding.writeBigU128BE,16);bufio.writeBigU64BE=_write(encoding.writeBigU64BE,8);bufio.writeBigU56BE=_write(encoding.writeBigU56BE,7);bufio.writeU64BE=_write(encoding.writeU64BE,8);bufio.writeU56BE=_write(encoding.writeU56BE,7);bufio.writeU48BE=_write(encoding.writeU48BE,6);bufio.writeU40BE=_write(encoding.writeU40BE,5);bufio.writeU32BE=_write(encoding.writeU32BE,4);bufio.writeU24BE=_write(encoding.writeU24BE,3);bufio.writeU16BE=_write(encoding.writeU16BE,2);bufio.writeI=_writen(encoding.writeI);bufio.writeBigI64=_write(encoding.writeBigI64,8);bufio.writeBigI56=_write(encoding.writeBigI56,7);bufio.writeI64=_write(encoding.writeI64,8);bufio.writeI56=_write(encoding.writeI56,7);bufio.writeI48=_write(encoding.writeI48,6);bufio.writeI40=_write(encoding.writeI40,5);bufio.writeI32=_write(encoding.writeI32,4);bufio.writeI24=_write(encoding.writeI24,3);bufio.writeI16=_write(encoding.writeI16,2);bufio.writeI8=_write(encoding.writeI8,1);bufio.writeIBE=_writen(encoding.writeIBE);bufio.writeBigI64BE=_write(encoding.writeBigI64BE,8);bufio.writeBigI56BE=_write(encoding.writeBigI56BE,7);bufio.writeI64BE=_write(encoding.writeI64BE,8);bufio.writeI56BE=_write(encoding.writeI56BE,7);bufio.writeI48BE=_write(encoding.writeI48BE,6);bufio.writeI40BE=_write(encoding.writeI40BE,5);bufio.writeI32BE=_write(encoding.writeI32BE,4);bufio.writeI24BE=_write(encoding.writeI24BE,3);bufio.writeI16BE=_write(encoding.writeI16BE,2);bufio.writeFloat=_write(encoding.writeFloat,4);bufio.writeFloatBE=_write(encoding.writeFloatBE,4);bufio.writeDouble=_write(encoding.writeDouble,8);bufio.writeDoubleBE=_write(encoding.writeDoubleBE,8);bufio.readVarint=_readvar(encoding.readVarint);bufio.writeVarint=_writecb(encoding.writeVarint,encoding.sizeVarint);bufio.sizeVarint=encoding.sizeVarint;bufio.readVarint2=_readvar(encoding.readVarint2);bufio.writeVarint2=_writecb(encoding.writeVarint2,encoding.sizeVarint2);bufio.sizeVarint2=encoding.sizeVarint2;bufio.sliceBytes=encoding.sliceBytes;bufio.readBytes=encoding.readBytes;bufio.writeBytes=encoding.writeBytes;bufio.readString=encoding.readString;bufio.writeString=encoding.writeString;bufio.realloc=encoding.realloc;bufio.copy=encoding.copy;bufio.concat=encoding.concat;bufio.sizeVarBytes=encoding.sizeVarBytes;bufio.sizeVarlen=encoding.sizeVarlen;bufio.sizeVarString=encoding.sizeVarString;var cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(tt,et){var nt=buffer$2,it=nt.Buffer;function rt(at,st){for(var lt in at)st[lt]=at[lt]}it.from&&it.alloc&&it.allocUnsafe&&it.allocUnsafeSlow?tt.exports=nt:(rt(nt,et),et.Buffer=ot);function ot(at,st,lt){return it(at,st,lt)}ot.prototype=Object.create(it.prototype),rt(it,ot),ot.from=function(at,st,lt){if(typeof at=="number")throw new TypeError("Argument must not be a number");return it(at,st,lt)},ot.alloc=function(at,st,lt){if(typeof at!="number")throw new TypeError("Argument must be a number");var ct=it(at);return st!==void 0?typeof lt=="string"?ct.fill(st,lt):ct.fill(st):ct.fill(0),ct},ot.allocUnsafe=function(at){if(typeof at!="number")throw new TypeError("Argument must be a number");return it(at)},ot.allocUnsafeSlow=function(at){if(typeof at!="number")throw new TypeError("Argument must be a number");return nt.SlowBuffer(at)}})(safeBuffer$1,safeBuffer$1.exports);var safeBufferExports=safeBuffer$1.exports,MAX_BYTES=65536,MAX_UINT32=4294967295;function oldBrowser$1(){throw new Error(`Secure random number generation is not supported by this browser. -Use Chrome, Firefox or Internet Explorer 11`)}var Buffer$H=safeBufferExports.Buffer,crypto$4=commonjsGlobal.crypto||commonjsGlobal.msCrypto;crypto$4&&crypto$4.getRandomValues?browser$b.exports=randomBytes$2:browser$b.exports=oldBrowser$1;function randomBytes$2(tt,et){if(tt>MAX_UINT32)throw new RangeError("requested too many random bytes");var nt=Buffer$H.allocUnsafe(tt);if(tt>0)if(tt>MAX_BYTES)for(var it=0;it0&&(at=nt[0]),at instanceof Error)throw at;var st=new Error("Unhandled error."+(at?" ("+at.message+")":""));throw st.context=at,st}var lt=ot[et];if(lt===void 0)return!1;if(typeof lt=="function")ReflectApply(lt,this,nt);else for(var ct=lt.length,ut=arrayClone(lt,ct),it=0;it0&&at.length>rt&&!at.warned){at.warned=!0;var st=new Error("Possible EventEmitter memory leak detected. "+at.length+" "+String(et)+" listeners added. Use emitter.setMaxListeners() to increase limit");st.name="MaxListenersExceededWarning",st.emitter=tt,st.type=et,st.count=at.length,ProcessEmitWarning(st)}return tt}EventEmitter$1.prototype.addListener=function(et,nt){return _addListener(this,et,nt,!1)};EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener;EventEmitter$1.prototype.prependListener=function(et,nt){return _addListener(this,et,nt,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(tt,et,nt){var it={fired:!1,wrapFn:void 0,target:tt,type:et,listener:nt},rt=onceWrapper.bind(it);return rt.listener=nt,it.wrapFn=rt,rt}EventEmitter$1.prototype.once=function(et,nt){return checkListener(nt),this.on(et,_onceWrap(this,et,nt)),this};EventEmitter$1.prototype.prependOnceListener=function(et,nt){return checkListener(nt),this.prependListener(et,_onceWrap(this,et,nt)),this};EventEmitter$1.prototype.removeListener=function(et,nt){var it,rt,ot,at,st;if(checkListener(nt),rt=this._events,rt===void 0)return this;if(it=rt[et],it===void 0)return this;if(it===nt||it.listener===nt)--this._eventsCount===0?this._events=Object.create(null):(delete rt[et],rt.removeListener&&this.emit("removeListener",et,it.listener||nt));else if(typeof it!="function"){for(ot=-1,at=it.length-1;at>=0;at--)if(it[at]===nt||it[at].listener===nt){st=it[at].listener,ot=at;break}if(ot<0)return this;ot===0?it.shift():spliceOne(it,ot),it.length===1&&(rt[et]=it[0]),rt.removeListener!==void 0&&this.emit("removeListener",et,st||nt)}return this};EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener;EventEmitter$1.prototype.removeAllListeners=function(et){var nt,it,rt;if(it=this._events,it===void 0)return this;if(it.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):it[et]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete it[et]),this;if(arguments.length===0){var ot=Object.keys(it),at;for(rt=0;rt=0;rt--)this.removeListener(et,nt[rt]);return this};function _listeners$1(tt,et,nt){var it=tt._events;if(it===void 0)return[];var rt=it[et];return rt===void 0?[]:typeof rt=="function"?nt?[rt.listener||rt]:[rt]:nt?unwrapListeners(rt):arrayClone(rt,rt.length)}EventEmitter$1.prototype.listeners=function(et){return _listeners$1(this,et,!0)};EventEmitter$1.prototype.rawListeners=function(et){return _listeners$1(this,et,!1)};EventEmitter$1.listenerCount=function(tt,et){return typeof tt.listenerCount=="function"?tt.listenerCount(et):listenerCount.call(tt,et)};EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(tt){var et=this._events;if(et!==void 0){var nt=et[tt];if(typeof nt=="function")return 1;if(nt!==void 0)return nt.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(tt,et){for(var nt=new Array(et),it=0;it0?this.tail.next=yt:this.head=yt,this.tail=yt,++this.length}},{key:"unshift",value:function(bt){var yt={data:bt,next:this.head};this.length===0&&(this.tail=yt),this.head=yt,++this.length}},{key:"shift",value:function(){if(this.length!==0){var bt=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,bt}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(bt){if(this.length===0)return"";for(var yt=this.head,wt=""+yt.data;yt=yt.next;)wt+=bt+yt.data;return wt}},{key:"concat",value:function(bt){if(this.length===0)return ct.alloc(0);for(var yt=ct.allocUnsafe(bt>>>0),wt=this.head,vt=0;wt;)pt(wt.data,yt,vt),vt+=wt.data.length,wt=wt.next;return yt}},{key:"consume",value:function(bt,yt){var wt;return btxt.length?xt.length:bt;if(St===xt.length?vt+=xt:vt+=xt.slice(0,bt),bt-=St,bt===0){St===xt.length?(++wt,yt.next?this.head=yt.next:this.head=this.tail=null):(this.head=yt,yt.data=xt.slice(St));break}++wt}return this.length-=wt,vt}},{key:"_getBuffer",value:function(bt){var yt=ct.allocUnsafe(bt),wt=this.head,vt=1;for(wt.data.copy(yt),bt-=wt.data.length;wt=wt.next;){var xt=wt.data,St=bt>xt.length?xt.length:bt;if(xt.copy(yt,yt.length-bt,0,St),bt-=St,bt===0){St===xt.length?(++vt,wt.next?this.head=wt.next:this.head=this.tail=null):(this.head=wt,wt.data=xt.slice(St));break}++vt}return this.length-=vt,yt}},{key:dt,value:function(bt,yt){return ht(this,et(et({},yt),{},{depth:0,customInspect:!1}))}}]),mt}(),buffer_list}function destroy(tt,et){var nt=this,it=this._readableState&&this._readableState.destroyed,rt=this._writableState&&this._writableState.destroyed;return it||rt?(et?et(tt):tt&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(emitErrorNT,this,tt)):process.nextTick(emitErrorNT,this,tt)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(tt||null,function(ot){!et&&ot?nt._writableState?nt._writableState.errorEmitted?process.nextTick(emitCloseNT,nt):(nt._writableState.errorEmitted=!0,process.nextTick(emitErrorAndCloseNT,nt,ot)):process.nextTick(emitErrorAndCloseNT,nt,ot):et?(process.nextTick(emitCloseNT,nt),et(ot)):process.nextTick(emitCloseNT,nt)}),this)}function emitErrorAndCloseNT(tt,et){emitErrorNT(tt,et),emitCloseNT(tt)}function emitCloseNT(tt){tt._writableState&&!tt._writableState.emitClose||tt._readableState&&!tt._readableState.emitClose||tt.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(tt,et){tt.emit("error",et)}function errorOrDestroy(tt,et){var nt=tt._readableState,it=tt._writableState;nt&&nt.autoDestroy||it&&it.autoDestroy?tt.destroy(et):tt.emit("error",et)}var destroy_1={destroy,undestroy,errorOrDestroy},errorsBrowser={};function _inheritsLoose$2(tt,et){tt.prototype=Object.create(et.prototype),tt.prototype.constructor=tt,tt.__proto__=et}var codes={};function createErrorType(tt,et,nt){nt||(nt=Error);function it(ot,at,st){return typeof et=="string"?et:et(ot,at,st)}var rt=function(ot){_inheritsLoose$2(at,ot);function at(st,lt,ct){return ot.call(this,it(st,lt,ct))||this}return at}(nt);rt.prototype.name=nt.name,rt.prototype.code=tt,codes[tt]=rt}function oneOf(tt,et){if(Array.isArray(tt)){var nt=tt.length;return tt=tt.map(function(it){return String(it)}),nt>2?"one of ".concat(et," ").concat(tt.slice(0,nt-1).join(", "),", or ")+tt[nt-1]:nt===2?"one of ".concat(et," ").concat(tt[0]," or ").concat(tt[1]):"of ".concat(et," ").concat(tt[0])}else return"of ".concat(et," ").concat(String(tt))}function startsWith(tt,et,nt){return tt.substr(!nt||nt<0?0:+nt,et.length)===et}function endsWith(tt,et,nt){return(nt===void 0||nt>tt.length)&&(nt=tt.length),tt.substring(nt-et.length,nt)===et}function includes(tt,et,nt){return typeof nt!="number"&&(nt=0),nt+et.length>tt.length?!1:tt.indexOf(et,nt)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(tt,et){return'The value "'+et+'" is invalid for option "'+tt+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(tt,et,nt){var it;typeof et=="string"&&startsWith(et,"not ")?(it="must not be",et=et.replace(/^not /,"")):it="must be";var rt;if(endsWith(tt," argument"))rt="The ".concat(tt," ").concat(it," ").concat(oneOf(et,"type"));else{var ot=includes(tt,".")?"property":"argument";rt='The "'.concat(tt,'" ').concat(ot," ").concat(it," ").concat(oneOf(et,"type"))}return rt+=". Received type ".concat(typeof nt),rt},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(tt){return"The "+tt+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(tt){return"Cannot call "+tt+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(tt){return"Unknown encoding: "+tt},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");errorsBrowser.codes=codes;var ERR_INVALID_OPT_VALUE=errorsBrowser.codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(tt,et,nt){return tt.highWaterMark!=null?tt.highWaterMark:et?tt[nt]:null}function getHighWaterMark(tt,et,nt,it){var rt=highWaterMarkFrom(et,it,nt);if(rt!=null){if(!(isFinite(rt)&&Math.floor(rt)===rt)||rt<0){var ot=it?nt:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(ot,rt)}return Math.floor(rt)}return tt.objectMode?16:16*1024}var state={getHighWaterMark},browser$a=deprecate;function deprecate(tt,et){if(config$2("noDeprecation"))return tt;var nt=!1;function it(){if(!nt){if(config$2("throwDeprecation"))throw new Error(et);config$2("traceDeprecation")?console.trace(et):console.warn(et),nt=!0}return tt.apply(this,arguments)}return it}function config$2(tt){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var et=commonjsGlobal.localStorage[tt];return et==null?!1:String(et).toLowerCase()==="true"}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1,_stream_writable=Tt;function tt(Xt){var an=this;this.next=null,this.entry=null,this.finish=function(){rn(an,Xt)}}var et;Tt.WritableState=Et;var nt={deprecate:browser$a},it=streamBrowser,rt=buffer$2.Buffer,ot=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function at(Xt){return rt.from(Xt)}function st(Xt){return rt.isBuffer(Xt)||Xt instanceof ot}var lt=destroy_1,ct=state,ut=ct.getHighWaterMark,ht=errorsBrowser.codes,dt=ht.ERR_INVALID_ARG_TYPE,pt=ht.ERR_METHOD_NOT_IMPLEMENTED,mt=ht.ERR_MULTIPLE_CALLBACK,gt=ht.ERR_STREAM_CANNOT_PIPE,bt=ht.ERR_STREAM_DESTROYED,yt=ht.ERR_STREAM_NULL_VALUES,wt=ht.ERR_STREAM_WRITE_AFTER_END,vt=ht.ERR_UNKNOWN_ENCODING,xt=lt.errorOrDestroy;inherits_browserExports(Tt,it);function St(){}function Et(Xt,an,tn){et=et||require_stream_duplex(),Xt=Xt||{},typeof tn!="boolean"&&(tn=an instanceof et),this.objectMode=!!Xt.objectMode,tn&&(this.objectMode=this.objectMode||!!Xt.writableObjectMode),this.highWaterMark=ut(this,Xt,"writableHighWaterMark",tn),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var pn=Xt.decodeStrings===!1;this.decodeStrings=!pn,this.defaultEncoding=Xt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(vn){Rt(an,vn)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Xt.emitClose!==!1,this.autoDestroy=!!Xt.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new tt(this)}Et.prototype.getBuffer=function(){for(var an=this.bufferedRequest,tn=[];an;)tn.push(an),an=an.next;return tn},function(){try{Object.defineProperty(Et.prototype,"buffer",{get:nt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var It;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(It=Function.prototype[Symbol.hasInstance],Object.defineProperty(Tt,Symbol.hasInstance,{value:function(an){return It.call(this,an)?!0:this!==Tt?!1:an&&an._writableState instanceof Et}})):It=function(an){return an instanceof this};function Tt(Xt){et=et||require_stream_duplex();var an=this instanceof et;if(!an&&!It.call(Tt,this))return new Tt(Xt);this._writableState=new Et(Xt,this,an),this.writable=!0,Xt&&(typeof Xt.write=="function"&&(this._write=Xt.write),typeof Xt.writev=="function"&&(this._writev=Xt.writev),typeof Xt.destroy=="function"&&(this._destroy=Xt.destroy),typeof Xt.final=="function"&&(this._final=Xt.final)),it.call(this)}Tt.prototype.pipe=function(){xt(this,new gt)};function $t(Xt,an){var tn=new wt;xt(Xt,tn),process.nextTick(an,tn)}function Ut(Xt,an,tn,pn){var vn;return tn===null?vn=new yt:typeof tn!="string"&&!an.objectMode&&(vn=new dt("chunk",["string","Buffer"],tn)),vn?(xt(Xt,vn),process.nextTick(pn,vn),!1):!0}Tt.prototype.write=function(Xt,an,tn){var pn=this._writableState,vn=!1,sn=!pn.objectMode&&st(Xt);return sn&&!rt.isBuffer(Xt)&&(Xt=at(Xt)),typeof an=="function"&&(tn=an,an=null),sn?an="buffer":an||(an=pn.defaultEncoding),typeof tn!="function"&&(tn=St),pn.ending?$t(this,tn):(sn||Ut(this,pn,Xt,tn))&&(pn.pendingcb++,vn=Bt(this,pn,sn,Xt,an,tn)),vn},Tt.prototype.cork=function(){this._writableState.corked++},Tt.prototype.uncork=function(){var Xt=this._writableState;Xt.corked&&(Xt.corked--,!Xt.writing&&!Xt.corked&&!Xt.bufferProcessing&&Xt.bufferedRequest&&Ot(this,Xt))},Tt.prototype.setDefaultEncoding=function(an){if(typeof an=="string"&&(an=an.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((an+"").toLowerCase())>-1))throw new vt(an);return this._writableState.defaultEncoding=an,this},Object.defineProperty(Tt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Lt(Xt,an,tn){return!Xt.objectMode&&Xt.decodeStrings!==!1&&typeof an=="string"&&(an=rt.from(an,tn)),an}Object.defineProperty(Tt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Bt(Xt,an,tn,pn,vn,sn){if(!tn){var Zt=Lt(an,pn,vn);pn!==Zt&&(tn=!0,vn="buffer",pn=Zt)}var Sn=an.objectMode?1:pn.length;an.length+=Sn;var Tn=an.length>5===6?2:tt>>4===14?3:tt>>3===30?4:tt>>6===2?-1:-2}function utf8CheckIncomplete(tt,et,nt){var it=et.length-1;if(it=0?(rt>0&&(tt.lastNeed=rt-1),rt):--it=0?(rt>0&&(tt.lastNeed=rt-2),rt):--it=0?(rt>0&&(rt===2?rt=0:tt.lastNeed=rt-3),rt):0))}function utf8CheckExtraBytes(tt,et,nt){if((et[0]&192)!==128)return tt.lastNeed=0,"�";if(tt.lastNeed>1&&et.length>1){if((et[1]&192)!==128)return tt.lastNeed=1,"�";if(tt.lastNeed>2&&et.length>2&&(et[2]&192)!==128)return tt.lastNeed=2,"�"}}function utf8FillLast(tt){var et=this.lastTotal-this.lastNeed,nt=utf8CheckExtraBytes(this,tt);if(nt!==void 0)return nt;if(this.lastNeed<=tt.length)return tt.copy(this.lastChar,et,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);tt.copy(this.lastChar,et,0,tt.length),this.lastNeed-=tt.length}function utf8Text(tt,et){var nt=utf8CheckIncomplete(this,tt,et);if(!this.lastNeed)return tt.toString("utf8",et);this.lastTotal=nt;var it=tt.length-(nt-this.lastNeed);return tt.copy(this.lastChar,0,it),tt.toString("utf8",et,it)}function utf8End(tt){var et=tt&&tt.length?this.write(tt):"";return this.lastNeed?et+"�":et}function utf16Text(tt,et){if((tt.length-et)%2===0){var nt=tt.toString("utf16le",et);if(nt){var it=nt.charCodeAt(nt.length-1);if(it>=55296&&it<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=tt[tt.length-2],this.lastChar[1]=tt[tt.length-1],nt.slice(0,-1)}return nt}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=tt[tt.length-1],tt.toString("utf16le",et,tt.length-1)}function utf16End(tt){var et=tt&&tt.length?this.write(tt):"";if(this.lastNeed){var nt=this.lastTotal-this.lastNeed;return et+this.lastChar.toString("utf16le",0,nt)}return et}function base64Text(tt,et){var nt=(tt.length-et)%3;return nt===0?tt.toString("base64",et):(this.lastNeed=3-nt,this.lastTotal=3,nt===1?this.lastChar[0]=tt[tt.length-1]:(this.lastChar[0]=tt[tt.length-2],this.lastChar[1]=tt[tt.length-1]),tt.toString("base64",et,tt.length-nt))}function base64End(tt){var et=tt&&tt.length?this.write(tt):"";return this.lastNeed?et+this.lastChar.toString("base64",0,3-this.lastNeed):et}function simpleWrite(tt){return tt.toString(this.encoding)}function simpleEnd(tt){return tt&&tt.length?this.write(tt):""}var ERR_STREAM_PREMATURE_CLOSE=errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;function once$1(tt){var et=!1;return function(){if(!et){et=!0;for(var nt=arguments.length,it=new Array(nt),rt=0;rt0)if(typeof Zt!="string"&&!jn.objectMode&&Object.getPrototypeOf(Zt)!==it.prototype&&(Zt=ot(Zt)),Tn)jn.endEmitted?St(sn,new yt):Lt(sn,jn,Zt,!0);else if(jn.ended)St(sn,new gt);else{if(jn.destroyed)return!1;jn.reading=!1,jn.decoder&&!Sn?(Zt=jn.decoder.write(Zt),jn.objectMode||Zt.length!==0?Lt(sn,jn,Zt,!1):Ot(sn,jn)):Lt(sn,jn,Zt,!1)}else Tn||(jn.reading=!1,Ot(sn,jn))}return!jn.ended&&(jn.length=Pt?sn=Pt:(sn--,sn|=sn>>>1,sn|=sn>>>2,sn|=sn>>>4,sn|=sn>>>8,sn|=sn>>>16,sn++),sn}function At(sn,Zt){return sn<=0||Zt.length===0&&Zt.ended?0:Zt.objectMode?1:sn!==sn?Zt.flowing&&Zt.length?Zt.buffer.head.data.length:Zt.length:(sn>Zt.highWaterMark&&(Zt.highWaterMark=kt(sn)),sn<=Zt.length?sn:Zt.ended?Zt.length:(Zt.needReadable=!0,0))}$t.prototype.read=function(sn){lt("read",sn),sn=parseInt(sn,10);var Zt=this._readableState,Sn=sn;if(sn!==0&&(Zt.emittedReadable=!1),sn===0&&Zt.needReadable&&((Zt.highWaterMark!==0?Zt.length>=Zt.highWaterMark:Zt.length>0)||Zt.ended))return lt("read: emitReadable",Zt.length,Zt.ended),Zt.length===0&&Zt.ended?tn(this):Wt(this),null;if(sn=At(sn,Zt),sn===0&&Zt.ended)return Zt.length===0&&tn(this),null;var Tn=Zt.needReadable;lt("need readable",Tn),(Zt.length===0||Zt.length-sn0?Cn=an(sn,Zt):Cn=null,Cn===null?(Zt.needReadable=Zt.length<=Zt.highWaterMark,sn=0):(Zt.length-=sn,Zt.awaitDrain=0),Zt.length===0&&(Zt.ended||(Zt.needReadable=!0),Sn!==sn&&Zt.ended&&tn(this)),Cn!==null&&this.emit("data",Cn),Cn};function Rt(sn,Zt){if(lt("onEofChunk"),!Zt.ended){if(Zt.decoder){var Sn=Zt.decoder.end();Sn&&Sn.length&&(Zt.buffer.push(Sn),Zt.length+=Zt.objectMode?1:Sn.length)}Zt.ended=!0,Zt.sync?Wt(sn):(Zt.needReadable=!1,Zt.emittedReadable||(Zt.emittedReadable=!0,jt(sn)))}}function Wt(sn){var Zt=sn._readableState;lt("emitReadable",Zt.needReadable,Zt.emittedReadable),Zt.needReadable=!1,Zt.emittedReadable||(lt("emitReadable",Zt.flowing),Zt.emittedReadable=!0,process.nextTick(jt,sn))}function jt(sn){var Zt=sn._readableState;lt("emitReadable_",Zt.destroyed,Zt.length,Zt.ended),!Zt.destroyed&&(Zt.length||Zt.ended)&&(sn.emit("readable"),Zt.emittedReadable=!1),Zt.needReadable=!Zt.flowing&&!Zt.ended&&Zt.length<=Zt.highWaterMark,Xt(sn)}function Ot(sn,Zt){Zt.readingMore||(Zt.readingMore=!0,process.nextTick(Ct,sn,Zt))}function Ct(sn,Zt){for(;!Zt.reading&&!Zt.ended&&(Zt.length1&&vn(Tn.pipes,sn)!==-1)&&!En&&(lt("false write response, pause",Tn.awaitDrain),Tn.awaitDrain++),Sn.pause())}function dn(nn){lt("onerror",nn),$n(),sn.removeListener("error",dn),et(sn,"error")===0&&St(sn,nn)}It(sn,"error",dn);function cn(){sn.removeListener("finish",hn),$n()}sn.once("close",cn);function hn(){lt("onfinish"),sn.removeListener("close",cn),$n()}sn.once("finish",hn);function $n(){lt("unpipe"),Sn.unpipe(sn)}return sn.emit("pipe",Sn),Tn.flowing||(lt("pipe resume"),Sn.resume()),sn};function Dt(sn){return function(){var Sn=sn._readableState;lt("pipeOnDrain",Sn.awaitDrain),Sn.awaitDrain&&Sn.awaitDrain--,Sn.awaitDrain===0&&et(sn,"data")&&(Sn.flowing=!0,Xt(sn))}}$t.prototype.unpipe=function(sn){var Zt=this._readableState,Sn={hasUnpiped:!1};if(Zt.pipesCount===0)return this;if(Zt.pipesCount===1)return sn&&sn!==Zt.pipes?this:(sn||(sn=Zt.pipes),Zt.pipes=null,Zt.pipesCount=0,Zt.flowing=!1,sn&&sn.emit("unpipe",this,Sn),this);if(!sn){var Tn=Zt.pipes,Cn=Zt.pipesCount;Zt.pipes=null,Zt.pipesCount=0,Zt.flowing=!1;for(var jn=0;jn0,Tn.flowing!==!1&&this.resume()):sn==="readable"&&!Tn.endEmitted&&!Tn.readableListening&&(Tn.readableListening=Tn.needReadable=!0,Tn.flowing=!1,Tn.emittedReadable=!1,lt("on readable",Tn.length,Tn.reading),Tn.length?Wt(this):Tn.reading||process.nextTick(Vt,this)),Sn},$t.prototype.addListener=$t.prototype.on,$t.prototype.removeListener=function(sn,Zt){var Sn=nt.prototype.removeListener.call(this,sn,Zt);return sn==="readable"&&process.nextTick(Mt,this),Sn},$t.prototype.removeAllListeners=function(sn){var Zt=nt.prototype.removeAllListeners.apply(this,arguments);return(sn==="readable"||sn===void 0)&&process.nextTick(Mt,this),Zt};function Mt(sn){var Zt=sn._readableState;Zt.readableListening=sn.listenerCount("readable")>0,Zt.resumeScheduled&&!Zt.paused?Zt.flowing=!0:sn.listenerCount("data")>0&&sn.resume()}function Vt(sn){lt("readable nexttick read 0"),sn.read(0)}$t.prototype.resume=function(){var sn=this._readableState;return sn.flowing||(lt("resume"),sn.flowing=!sn.readableListening,Qt(this,sn)),sn.paused=!1,this};function Qt(sn,Zt){Zt.resumeScheduled||(Zt.resumeScheduled=!0,process.nextTick(rn,sn,Zt))}function rn(sn,Zt){lt("resume",Zt.reading),Zt.reading||sn.read(0),Zt.resumeScheduled=!1,sn.emit("resume"),Xt(sn),Zt.flowing&&!Zt.reading&&sn.read(0)}$t.prototype.pause=function(){return lt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(lt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Xt(sn){var Zt=sn._readableState;for(lt("flow",Zt.flowing);Zt.flowing&&sn.read()!==null;);}$t.prototype.wrap=function(sn){var Zt=this,Sn=this._readableState,Tn=!1;sn.on("end",function(){if(lt("wrapped end"),Sn.decoder&&!Sn.ended){var Un=Sn.decoder.end();Un&&Un.length&&Zt.push(Un)}Zt.push(null)}),sn.on("data",function(Un){if(lt("wrapped data"),Sn.decoder&&(Un=Sn.decoder.write(Un)),!(Sn.objectMode&&Un==null)&&!(!Sn.objectMode&&(!Un||!Un.length))){var yn=Zt.push(Un);yn||(Tn=!0,sn.pause())}});for(var Cn in sn)this[Cn]===void 0&&typeof sn[Cn]=="function"&&(this[Cn]=function(yn){return function(){return sn[yn].apply(sn,arguments)}}(Cn));for(var jn=0;jn=Zt.length?(Zt.decoder?Sn=Zt.buffer.join(""):Zt.buffer.length===1?Sn=Zt.buffer.first():Sn=Zt.buffer.concat(Zt.length),Zt.buffer.clear()):Sn=Zt.buffer.consume(sn,Zt.decoder),Sn}function tn(sn){var Zt=sn._readableState;lt("endReadable",Zt.endEmitted),Zt.endEmitted||(Zt.ended=!0,process.nextTick(pn,Zt,sn))}function pn(sn,Zt){if(lt("endReadableNT",sn.endEmitted,sn.length),!sn.endEmitted&&sn.length===0&&(sn.endEmitted=!0,Zt.readable=!1,Zt.emit("end"),sn.autoDestroy)){var Sn=Zt._writableState;(!Sn||Sn.autoDestroy&&Sn.finished)&&Zt.destroy()}}typeof Symbol=="function"&&($t.from=function(sn,Zt){return xt===void 0&&(xt=requireFromBrowser()),xt($t,sn,Zt)});function vn(sn,Zt){for(var Sn=0,Tn=sn.length;Sn0;return destroyer(at,lt,ct,function(ut){rt||(rt=ut),ut&&ot.forEach(call),!lt&&(ot.forEach(call),it(rt))})});return et.reduce(pipe$1)}var pipeline_1=pipeline;(function(tt,et){et=tt.exports=require_stream_readable(),et.Stream=et,et.Readable=et,et.Writable=require_stream_writable(),et.Duplex=require_stream_duplex(),et.Transform=_stream_transform,et.PassThrough=_stream_passthrough,et.finished=endOfStream,et.pipeline=pipeline_1})(readableBrowser,readableBrowser.exports);var readableBrowserExports=readableBrowser.exports,Buffer$F=safeBufferExports.Buffer,Transform$6=readableBrowserExports.Transform,inherits$w=inherits_browserExports;function throwIfNotStringOrBuffer(tt,et){if(!Buffer$F.isBuffer(tt)&&typeof tt!="string")throw new TypeError(et+" must be a string or a buffer")}function HashBase$2(tt){Transform$6.call(this),this._block=Buffer$F.allocUnsafe(tt),this._blockSize=tt,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits$w(HashBase$2,Transform$6);HashBase$2.prototype._transform=function(tt,et,nt){var it=null;try{this.update(tt,et)}catch(rt){it=rt}nt(it)};HashBase$2.prototype._flush=function(tt){var et=null;try{this.push(this.digest())}catch(nt){et=nt}tt(et)};HashBase$2.prototype.update=function(tt,et){if(throwIfNotStringOrBuffer(tt,"Data"),this._finalized)throw new Error("Digest already called");Buffer$F.isBuffer(tt)||(tt=Buffer$F.from(tt,et));for(var nt=this._block,it=0;this._blockOffset+tt.length-it>=this._blockSize;){for(var rt=this._blockOffset;rt0;++ot)this._length[ot]+=at,at=this._length[ot]/4294967296|0,at>0&&(this._length[ot]-=4294967296*at);return this};HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")};HashBase$2.prototype.digest=function(tt){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var et=this._digest();tt!==void 0&&(et=et.toString(tt)),this._block.fill(0),this._blockOffset=0;for(var nt=0;nt<4;++nt)this._length[nt]=0;return et};HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase$2,inherits$v=inherits_browserExports,HashBase$1=hashBase,Buffer$E=safeBufferExports.Buffer,ARRAY16$1=new Array(16);function MD5$3(){HashBase$1.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}inherits$v(MD5$3,HashBase$1);MD5$3.prototype._update=function(){for(var tt=ARRAY16$1,et=0;et<16;++et)tt[et]=this._block.readInt32LE(et*4);var nt=this._a,it=this._b,rt=this._c,ot=this._d;nt=fnF(nt,it,rt,ot,tt[0],3614090360,7),ot=fnF(ot,nt,it,rt,tt[1],3905402710,12),rt=fnF(rt,ot,nt,it,tt[2],606105819,17),it=fnF(it,rt,ot,nt,tt[3],3250441966,22),nt=fnF(nt,it,rt,ot,tt[4],4118548399,7),ot=fnF(ot,nt,it,rt,tt[5],1200080426,12),rt=fnF(rt,ot,nt,it,tt[6],2821735955,17),it=fnF(it,rt,ot,nt,tt[7],4249261313,22),nt=fnF(nt,it,rt,ot,tt[8],1770035416,7),ot=fnF(ot,nt,it,rt,tt[9],2336552879,12),rt=fnF(rt,ot,nt,it,tt[10],4294925233,17),it=fnF(it,rt,ot,nt,tt[11],2304563134,22),nt=fnF(nt,it,rt,ot,tt[12],1804603682,7),ot=fnF(ot,nt,it,rt,tt[13],4254626195,12),rt=fnF(rt,ot,nt,it,tt[14],2792965006,17),it=fnF(it,rt,ot,nt,tt[15],1236535329,22),nt=fnG(nt,it,rt,ot,tt[1],4129170786,5),ot=fnG(ot,nt,it,rt,tt[6],3225465664,9),rt=fnG(rt,ot,nt,it,tt[11],643717713,14),it=fnG(it,rt,ot,nt,tt[0],3921069994,20),nt=fnG(nt,it,rt,ot,tt[5],3593408605,5),ot=fnG(ot,nt,it,rt,tt[10],38016083,9),rt=fnG(rt,ot,nt,it,tt[15],3634488961,14),it=fnG(it,rt,ot,nt,tt[4],3889429448,20),nt=fnG(nt,it,rt,ot,tt[9],568446438,5),ot=fnG(ot,nt,it,rt,tt[14],3275163606,9),rt=fnG(rt,ot,nt,it,tt[3],4107603335,14),it=fnG(it,rt,ot,nt,tt[8],1163531501,20),nt=fnG(nt,it,rt,ot,tt[13],2850285829,5),ot=fnG(ot,nt,it,rt,tt[2],4243563512,9),rt=fnG(rt,ot,nt,it,tt[7],1735328473,14),it=fnG(it,rt,ot,nt,tt[12],2368359562,20),nt=fnH(nt,it,rt,ot,tt[5],4294588738,4),ot=fnH(ot,nt,it,rt,tt[8],2272392833,11),rt=fnH(rt,ot,nt,it,tt[11],1839030562,16),it=fnH(it,rt,ot,nt,tt[14],4259657740,23),nt=fnH(nt,it,rt,ot,tt[1],2763975236,4),ot=fnH(ot,nt,it,rt,tt[4],1272893353,11),rt=fnH(rt,ot,nt,it,tt[7],4139469664,16),it=fnH(it,rt,ot,nt,tt[10],3200236656,23),nt=fnH(nt,it,rt,ot,tt[13],681279174,4),ot=fnH(ot,nt,it,rt,tt[0],3936430074,11),rt=fnH(rt,ot,nt,it,tt[3],3572445317,16),it=fnH(it,rt,ot,nt,tt[6],76029189,23),nt=fnH(nt,it,rt,ot,tt[9],3654602809,4),ot=fnH(ot,nt,it,rt,tt[12],3873151461,11),rt=fnH(rt,ot,nt,it,tt[15],530742520,16),it=fnH(it,rt,ot,nt,tt[2],3299628645,23),nt=fnI(nt,it,rt,ot,tt[0],4096336452,6),ot=fnI(ot,nt,it,rt,tt[7],1126891415,10),rt=fnI(rt,ot,nt,it,tt[14],2878612391,15),it=fnI(it,rt,ot,nt,tt[5],4237533241,21),nt=fnI(nt,it,rt,ot,tt[12],1700485571,6),ot=fnI(ot,nt,it,rt,tt[3],2399980690,10),rt=fnI(rt,ot,nt,it,tt[10],4293915773,15),it=fnI(it,rt,ot,nt,tt[1],2240044497,21),nt=fnI(nt,it,rt,ot,tt[8],1873313359,6),ot=fnI(ot,nt,it,rt,tt[15],4264355552,10),rt=fnI(rt,ot,nt,it,tt[6],2734768916,15),it=fnI(it,rt,ot,nt,tt[13],1309151649,21),nt=fnI(nt,it,rt,ot,tt[4],4149444226,6),ot=fnI(ot,nt,it,rt,tt[11],3174756917,10),rt=fnI(rt,ot,nt,it,tt[2],718787259,15),it=fnI(it,rt,ot,nt,tt[9],3951481745,21),this._a=this._a+nt|0,this._b=this._b+it|0,this._c=this._c+rt|0,this._d=this._d+ot|0};MD5$3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var tt=Buffer$E.allocUnsafe(16);return tt.writeInt32LE(this._a,0),tt.writeInt32LE(this._b,4),tt.writeInt32LE(this._c,8),tt.writeInt32LE(this._d,12),tt};function rotl$3(tt,et){return tt<>>32-et}function fnF(tt,et,nt,it,rt,ot,at){return rotl$3(tt+(et&nt|~et&it)+rt+ot|0,at)+et|0}function fnG(tt,et,nt,it,rt,ot,at){return rotl$3(tt+(et&it|nt&~it)+rt+ot|0,at)+et|0}function fnH(tt,et,nt,it,rt,ot,at){return rotl$3(tt+(et^nt^it)+rt+ot|0,at)+et|0}function fnI(tt,et,nt,it,rt,ot,at){return rotl$3(tt+(nt^(et|~it))+rt+ot|0,at)+et|0}var md5_js=MD5$3,Buffer$D=buffer$2.Buffer,inherits$u=inherits_browserExports,HashBase=hashBase,ARRAY16=new Array(16),zl=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],zr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],sl=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}inherits$u(RIPEMD160$5,HashBase);RIPEMD160$5.prototype._update=function(){for(var tt=ARRAY16,et=0;et<16;++et)tt[et]=this._block.readInt32LE(et*4);for(var nt=this._a|0,it=this._b|0,rt=this._c|0,ot=this._d|0,at=this._e|0,st=this._a|0,lt=this._b|0,ct=this._c|0,ut=this._d|0,ht=this._e|0,dt=0;dt<80;dt+=1){var pt,mt;dt<16?(pt=fn1(nt,it,rt,ot,at,tt[zl[dt]],hl[0],sl[dt]),mt=fn5(st,lt,ct,ut,ht,tt[zr[dt]],hr[0],sr[dt])):dt<32?(pt=fn2(nt,it,rt,ot,at,tt[zl[dt]],hl[1],sl[dt]),mt=fn4(st,lt,ct,ut,ht,tt[zr[dt]],hr[1],sr[dt])):dt<48?(pt=fn3(nt,it,rt,ot,at,tt[zl[dt]],hl[2],sl[dt]),mt=fn3(st,lt,ct,ut,ht,tt[zr[dt]],hr[2],sr[dt])):dt<64?(pt=fn4(nt,it,rt,ot,at,tt[zl[dt]],hl[3],sl[dt]),mt=fn2(st,lt,ct,ut,ht,tt[zr[dt]],hr[3],sr[dt])):(pt=fn5(nt,it,rt,ot,at,tt[zl[dt]],hl[4],sl[dt]),mt=fn1(st,lt,ct,ut,ht,tt[zr[dt]],hr[4],sr[dt])),nt=at,at=ot,ot=rotl$2(rt,10),rt=it,it=pt,st=ht,ht=ut,ut=rotl$2(ct,10),ct=lt,lt=mt}var gt=this._b+rt+ut|0;this._b=this._c+ot+ht|0,this._c=this._d+at+st|0,this._d=this._e+nt+lt|0,this._e=this._a+it+ct|0,this._a=gt};RIPEMD160$5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var tt=Buffer$D.alloc?Buffer$D.alloc(20):new Buffer$D(20);return tt.writeInt32LE(this._a,0),tt.writeInt32LE(this._b,4),tt.writeInt32LE(this._c,8),tt.writeInt32LE(this._d,12),tt.writeInt32LE(this._e,16),tt};function rotl$2(tt,et){return tt<>>32-et}function fn1(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+(et^nt^it)+ot+at|0,st)+rt|0}function fn2(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+(et&nt|~et&it)+ot+at|0,st)+rt|0}function fn3(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+((et|~nt)^it)+ot+at|0,st)+rt|0}function fn4(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+(et&it|nt&~it)+ot+at|0,st)+rt|0}function fn5(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+(et^(nt|~it))+ot+at|0,st)+rt|0}var ripemd160$1=RIPEMD160$5,sha_js={exports:{}},Buffer$C=safeBufferExports.Buffer;function Hash$9(tt,et){this._block=Buffer$C.alloc(tt),this._finalSize=et,this._blockSize=tt,this._len=0}Hash$9.prototype.update=function(tt,et){typeof tt=="string"&&(et=et||"utf8",tt=Buffer$C.from(tt,et));for(var nt=this._block,it=this._blockSize,rt=tt.length,ot=this._len,at=0;at=this._finalSize&&(this._update(this._block),this._block.fill(0));var nt=this._len*8;if(nt<=4294967295)this._block.writeUInt32BE(nt,this._blockSize-4);else{var it=(nt&4294967295)>>>0,rt=(nt-it)/4294967296;this._block.writeUInt32BE(rt,this._blockSize-8),this._block.writeUInt32BE(it,this._blockSize-4)}this._update(this._block);var ot=this._hash();return tt?ot.toString(tt):ot};Hash$9.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash$7=Hash$9,inherits$t=inherits_browserExports,Hash$8=hash$7,Buffer$B=safeBufferExports.Buffer,K$4=[1518500249,1859775393,-1894007588,-899497514],W$5=new Array(80);function Sha(){this.init(),this._w=W$5,Hash$8.call(this,64,56)}inherits$t(Sha,Hash$8);Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl5$1(tt){return tt<<5|tt>>>27}function rotl30$1(tt){return tt<<30|tt>>>2}function ft$1(tt,et,nt,it){return tt===0?et&nt|~et&it:tt===2?et&nt|et&it|nt&it:et^nt^it}Sha.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,it=this._b|0,rt=this._c|0,ot=this._d|0,at=this._e|0,st=0;st<16;++st)et[st]=tt.readInt32BE(st*4);for(;st<80;++st)et[st]=et[st-3]^et[st-8]^et[st-14]^et[st-16];for(var lt=0;lt<80;++lt){var ct=~~(lt/20),ut=rotl5$1(nt)+ft$1(ct,it,rt,ot)+at+et[lt]+K$4[ct]|0;at=ot,ot=rt,rt=rotl30$1(it),it=nt,nt=ut}this._a=nt+this._a|0,this._b=it+this._b|0,this._c=rt+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0};Sha.prototype._hash=function(){var tt=Buffer$B.allocUnsafe(20);return tt.writeInt32BE(this._a|0,0),tt.writeInt32BE(this._b|0,4),tt.writeInt32BE(this._c|0,8),tt.writeInt32BE(this._d|0,12),tt.writeInt32BE(this._e|0,16),tt};var sha$4=Sha,inherits$s=inherits_browserExports,Hash$7=hash$7,Buffer$A=safeBufferExports.Buffer,K$3=[1518500249,1859775393,-1894007588,-899497514],W$4=new Array(80);function Sha1(){this.init(),this._w=W$4,Hash$7.call(this,64,56)}inherits$s(Sha1,Hash$7);Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl1(tt){return tt<<1|tt>>>31}function rotl5(tt){return tt<<5|tt>>>27}function rotl30(tt){return tt<<30|tt>>>2}function ft(tt,et,nt,it){return tt===0?et&nt|~et&it:tt===2?et&nt|et&it|nt&it:et^nt^it}Sha1.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,it=this._b|0,rt=this._c|0,ot=this._d|0,at=this._e|0,st=0;st<16;++st)et[st]=tt.readInt32BE(st*4);for(;st<80;++st)et[st]=rotl1(et[st-3]^et[st-8]^et[st-14]^et[st-16]);for(var lt=0;lt<80;++lt){var ct=~~(lt/20),ut=rotl5(nt)+ft(ct,it,rt,ot)+at+et[lt]+K$3[ct]|0;at=ot,ot=rt,rt=rotl30(it),it=nt,nt=ut}this._a=nt+this._a|0,this._b=it+this._b|0,this._c=rt+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0};Sha1.prototype._hash=function(){var tt=Buffer$A.allocUnsafe(20);return tt.writeInt32BE(this._a|0,0),tt.writeInt32BE(this._b|0,4),tt.writeInt32BE(this._c|0,8),tt.writeInt32BE(this._d|0,12),tt.writeInt32BE(this._e|0,16),tt};var sha1$1=Sha1,inherits$r=inherits_browserExports,Hash$6=hash$7,Buffer$z=safeBufferExports.Buffer,K$2=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W$3=new Array(64);function Sha256$1(){this.init(),this._w=W$3,Hash$6.call(this,64,56)}inherits$r(Sha256$1,Hash$6);Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ch(tt,et,nt){return nt^tt&(et^nt)}function maj$1(tt,et,nt){return tt&et|nt&(tt|et)}function sigma0$1(tt){return(tt>>>2|tt<<30)^(tt>>>13|tt<<19)^(tt>>>22|tt<<10)}function sigma1$1(tt){return(tt>>>6|tt<<26)^(tt>>>11|tt<<21)^(tt>>>25|tt<<7)}function gamma0(tt){return(tt>>>7|tt<<25)^(tt>>>18|tt<<14)^tt>>>3}function gamma1(tt){return(tt>>>17|tt<<15)^(tt>>>19|tt<<13)^tt>>>10}Sha256$1.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,it=this._b|0,rt=this._c|0,ot=this._d|0,at=this._e|0,st=this._f|0,lt=this._g|0,ct=this._h|0,ut=0;ut<16;++ut)et[ut]=tt.readInt32BE(ut*4);for(;ut<64;++ut)et[ut]=gamma1(et[ut-2])+et[ut-7]+gamma0(et[ut-15])+et[ut-16]|0;for(var ht=0;ht<64;++ht){var dt=ct+sigma1$1(at)+ch(at,st,lt)+K$2[ht]+et[ht]|0,pt=sigma0$1(nt)+maj$1(nt,it,rt)|0;ct=lt,lt=st,st=at,at=ot+dt|0,ot=rt,rt=it,it=nt,nt=dt+pt|0}this._a=nt+this._a|0,this._b=it+this._b|0,this._c=rt+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0,this._f=st+this._f|0,this._g=lt+this._g|0,this._h=ct+this._h|0};Sha256$1.prototype._hash=function(){var tt=Buffer$z.allocUnsafe(32);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt.writeInt32BE(this._h,28),tt};var sha256$4=Sha256$1,inherits$q=inherits_browserExports,Sha256=sha256$4,Hash$5=hash$7,Buffer$y=safeBufferExports.Buffer,W$2=new Array(64);function Sha224(){this.init(),this._w=W$2,Hash$5.call(this,64,56)}inherits$q(Sha224,Sha256);Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Sha224.prototype._hash=function(){var tt=Buffer$y.allocUnsafe(28);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt};var sha224$1=Sha224,inherits$p=inherits_browserExports,Hash$4=hash$7,Buffer$x=safeBufferExports.Buffer,K$1=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W$1=new Array(160);function Sha512(){this.init(),this._w=W$1,Hash$4.call(this,128,112)}inherits$p(Sha512,Hash$4);Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ch(tt,et,nt){return nt^tt&(et^nt)}function maj(tt,et,nt){return tt&et|nt&(tt|et)}function sigma0(tt,et){return(tt>>>28|et<<4)^(et>>>2|tt<<30)^(et>>>7|tt<<25)}function sigma1(tt,et){return(tt>>>14|et<<18)^(tt>>>18|et<<14)^(et>>>9|tt<<23)}function Gamma0(tt,et){return(tt>>>1|et<<31)^(tt>>>8|et<<24)^tt>>>7}function Gamma0l(tt,et){return(tt>>>1|et<<31)^(tt>>>8|et<<24)^(tt>>>7|et<<25)}function Gamma1(tt,et){return(tt>>>19|et<<13)^(et>>>29|tt<<3)^tt>>>6}function Gamma1l(tt,et){return(tt>>>19|et<<13)^(et>>>29|tt<<3)^(tt>>>6|et<<26)}function getCarry(tt,et){return tt>>>0>>0?1:0}Sha512.prototype._update=function(tt){for(var et=this._w,nt=this._ah|0,it=this._bh|0,rt=this._ch|0,ot=this._dh|0,at=this._eh|0,st=this._fh|0,lt=this._gh|0,ct=this._hh|0,ut=this._al|0,ht=this._bl|0,dt=this._cl|0,pt=this._dl|0,mt=this._el|0,gt=this._fl|0,bt=this._gl|0,yt=this._hl|0,wt=0;wt<32;wt+=2)et[wt]=tt.readInt32BE(wt*4),et[wt+1]=tt.readInt32BE(wt*4+4);for(;wt<160;wt+=2){var vt=et[wt-30],xt=et[wt-15*2+1],St=Gamma0(vt,xt),Et=Gamma0l(xt,vt);vt=et[wt-2*2],xt=et[wt-2*2+1];var It=Gamma1(vt,xt),Tt=Gamma1l(xt,vt),$t=et[wt-7*2],Ut=et[wt-7*2+1],Lt=et[wt-16*2],Bt=et[wt-16*2+1],Pt=Et+Ut|0,kt=St+$t+getCarry(Pt,Et)|0;Pt=Pt+Tt|0,kt=kt+It+getCarry(Pt,Tt)|0,Pt=Pt+Bt|0,kt=kt+Lt+getCarry(Pt,Bt)|0,et[wt]=kt,et[wt+1]=Pt}for(var At=0;At<160;At+=2){kt=et[At],Pt=et[At+1];var Rt=maj(nt,it,rt),Wt=maj(ut,ht,dt),jt=sigma0(nt,ut),Ot=sigma0(ut,nt),Ct=sigma1(at,mt),Dt=sigma1(mt,at),Mt=K$1[At],Vt=K$1[At+1],Qt=Ch(at,st,lt),rn=Ch(mt,gt,bt),Xt=yt+Dt|0,an=ct+Ct+getCarry(Xt,yt)|0;Xt=Xt+rn|0,an=an+Qt+getCarry(Xt,rn)|0,Xt=Xt+Vt|0,an=an+Mt+getCarry(Xt,Vt)|0,Xt=Xt+Pt|0,an=an+kt+getCarry(Xt,Pt)|0;var tn=Ot+Wt|0,pn=jt+Rt+getCarry(tn,Ot)|0;ct=lt,yt=bt,lt=st,bt=gt,st=at,gt=mt,mt=pt+Xt|0,at=ot+an+getCarry(mt,pt)|0,ot=rt,pt=dt,rt=it,dt=ht,it=nt,ht=ut,ut=Xt+tn|0,nt=an+pn+getCarry(ut,Xt)|0}this._al=this._al+ut|0,this._bl=this._bl+ht|0,this._cl=this._cl+dt|0,this._dl=this._dl+pt|0,this._el=this._el+mt|0,this._fl=this._fl+gt|0,this._gl=this._gl+bt|0,this._hl=this._hl+yt|0,this._ah=this._ah+nt+getCarry(this._al,ut)|0,this._bh=this._bh+it+getCarry(this._bl,ht)|0,this._ch=this._ch+rt+getCarry(this._cl,dt)|0,this._dh=this._dh+ot+getCarry(this._dl,pt)|0,this._eh=this._eh+at+getCarry(this._el,mt)|0,this._fh=this._fh+st+getCarry(this._fl,gt)|0,this._gh=this._gh+lt+getCarry(this._gl,bt)|0,this._hh=this._hh+ct+getCarry(this._hl,yt)|0};Sha512.prototype._hash=function(){var tt=Buffer$x.allocUnsafe(64);function et(nt,it,rt){tt.writeInt32BE(nt,rt),tt.writeInt32BE(it,rt+4)}return et(this._ah,this._al,0),et(this._bh,this._bl,8),et(this._ch,this._cl,16),et(this._dh,this._dl,24),et(this._eh,this._el,32),et(this._fh,this._fl,40),et(this._gh,this._gl,48),et(this._hh,this._hl,56),tt};var sha512$1=Sha512,inherits$o=inherits_browserExports,SHA512$2=sha512$1,Hash$3=hash$7,Buffer$w=safeBufferExports.Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash$3.call(this,128,112)}inherits$o(Sha384,SHA512$2);Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Sha384.prototype._hash=function(){var tt=Buffer$w.allocUnsafe(48);function et(nt,it,rt){tt.writeInt32BE(nt,rt),tt.writeInt32BE(it,rt+4)}return et(this._ah,this._al,0),et(this._bh,this._bl,8),et(this._ch,this._cl,16),et(this._dh,this._dl,24),et(this._eh,this._el,32),et(this._fh,this._fl,40),tt};var sha384$1=Sha384,exports=sha_js.exports=function(et){et=et.toLowerCase();var nt=exports[et];if(!nt)throw new Error(et+" is not supported (we accept pull requests)");return new nt};exports.sha=sha$4;exports.sha1=sha1$1;exports.sha224=sha224$1;exports.sha256=sha256$4;exports.sha384=sha384$1;exports.sha512=sha512$1;var sha_jsExports=sha_js.exports,streamBrowserify=Stream,EE=eventsExports.EventEmitter,inherits$n=inherits_browserExports;inherits$n(Stream,EE);Stream.Readable=require_stream_readable();Stream.Writable=require_stream_writable();Stream.Duplex=require_stream_duplex();Stream.Transform=_stream_transform;Stream.PassThrough=_stream_passthrough;Stream.finished=endOfStream;Stream.pipeline=pipeline_1;Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(tt,et){var nt=this;function it(ut){tt.writable&&tt.write(ut)===!1&&nt.pause&&nt.pause()}nt.on("data",it);function rt(){nt.readable&&nt.resume&&nt.resume()}tt.on("drain",rt),!tt._isStdio&&(!et||et.end!==!1)&&(nt.on("end",at),nt.on("close",st));var ot=!1;function at(){ot||(ot=!0,tt.end())}function st(){ot||(ot=!0,typeof tt.destroy=="function"&&tt.destroy())}function lt(ut){if(ct(),EE.listenerCount(this,"error")===0)throw ut}nt.on("error",lt),tt.on("error",lt);function ct(){nt.removeListener("data",it),tt.removeListener("drain",rt),nt.removeListener("end",at),nt.removeListener("close",st),nt.removeListener("error",lt),tt.removeListener("error",lt),nt.removeListener("end",ct),nt.removeListener("close",ct),tt.removeListener("close",ct)}return nt.on("end",ct),nt.on("close",ct),tt.on("close",ct),tt.emit("pipe",nt),tt};var Buffer$v=safeBufferExports.Buffer,Transform$5=streamBrowserify.Transform,StringDecoder=string_decoder.StringDecoder,inherits$m=inherits_browserExports;function CipherBase$1(tt){Transform$5.call(this),this.hashMode=typeof tt=="string",this.hashMode?this[tt]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits$m(CipherBase$1,Transform$5);CipherBase$1.prototype.update=function(tt,et,nt){typeof tt=="string"&&(tt=Buffer$v.from(tt,et));var it=this._update(tt);return this.hashMode?this:(nt&&(it=this._toString(it,nt)),it)};CipherBase$1.prototype.setAutoPadding=function(){};CipherBase$1.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};CipherBase$1.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};CipherBase$1.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};CipherBase$1.prototype._transform=function(tt,et,nt){var it;try{this.hashMode?this._update(tt):this.push(this._update(tt))}catch(rt){it=rt}finally{nt(it)}};CipherBase$1.prototype._flush=function(tt){var et;try{this.push(this.__final())}catch(nt){et=nt}tt(et)};CipherBase$1.prototype._finalOrDigest=function(tt){var et=this.__final()||Buffer$v.alloc(0);return tt&&(et=this._toString(et,tt,!0)),et};CipherBase$1.prototype._toString=function(tt,et,nt){if(this._decoder||(this._decoder=new StringDecoder(et),this._encoding=et),this._encoding!==et)throw new Error("can't switch encodings");var it=this._decoder.write(tt);return nt&&(it+=this._decoder.end()),it};var cipherBase=CipherBase$1,inherits$l=inherits_browserExports,MD5$2=md5_js,RIPEMD160$4=ripemd160$1,sha$3=sha_jsExports,Base$5=cipherBase;function Hash$2(tt){Base$5.call(this,"digest"),this._hash=tt}inherits$l(Hash$2,Base$5);Hash$2.prototype._update=function(tt){this._hash.update(tt)};Hash$2.prototype._final=function(){return this._hash.digest()};var browser$9=function(et){return et=et.toLowerCase(),et==="md5"?new MD5$2:et==="rmd160"||et==="ripemd160"?new RIPEMD160$4:new Hash$2(sha$3(et))},inherits$k=inherits_browserExports,Buffer$u=safeBufferExports.Buffer,Base$4=cipherBase,ZEROS$2=Buffer$u.alloc(128),blocksize=64;function Hmac$3(tt,et){Base$4.call(this,"digest"),typeof et=="string"&&(et=Buffer$u.from(et)),this._alg=tt,this._key=et,et.length>blocksize?et=tt(et):et.lengthnt){var it=tt==="rmd160"?new RIPEMD160$3:sha$2(tt);et=it.update(et).digest()}else et.lengthMAX_ALLOC||et!==et)throw new TypeError("Bad key length")},defaultEncoding$2;if(commonjsGlobal.process&&commonjsGlobal.process.browser)defaultEncoding$2="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var pVersionMajor=parseInt(process.version.split(".")[0].slice(1),10);defaultEncoding$2=pVersionMajor>=6?"utf-8":"binary"}else defaultEncoding$2="utf-8";var defaultEncoding_1=defaultEncoding$2,Buffer$s=safeBufferExports.Buffer,toBuffer$3=function(tt,et,nt){if(Buffer$s.isBuffer(tt))return tt;if(typeof tt=="string")return Buffer$s.from(tt,et);if(ArrayBuffer.isView(tt))return Buffer$s.from(tt.buffer);throw new TypeError(nt+" must be a string, a Buffer, a typed array or a DataView")},md5=md5$2,RIPEMD160$2=ripemd160$1,sha$1=sha_jsExports,Buffer$r=safeBufferExports.Buffer,checkParameters$1=precondition,defaultEncoding$1=defaultEncoding_1,toBuffer$2=toBuffer$3,ZEROS=Buffer$r.alloc(128),sizes={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac$1(tt,et,nt){var it=getDigest(tt),rt=tt==="sha512"||tt==="sha384"?128:64;et.length>rt?et=it(et):et.length>>0};utils$q.writeUInt32BE=function(et,nt,it){et[0+it]=nt>>>24,et[1+it]=nt>>>16&255,et[2+it]=nt>>>8&255,et[3+it]=nt&255};utils$q.ip=function(et,nt,it,rt){for(var ot=0,at=0,st=6;st>=0;st-=2){for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>>lt+st&1;for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=et>>>lt+st&1}for(var st=6;st>=0;st-=2){for(var lt=1;lt<=25;lt+=8)at<<=1,at|=nt>>>lt+st&1;for(var lt=1;lt<=25;lt+=8)at<<=1,at|=et>>>lt+st&1}it[rt+0]=ot>>>0,it[rt+1]=at>>>0};utils$q.rip=function(et,nt,it,rt){for(var ot=0,at=0,st=0;st<4;st++)for(var lt=24;lt>=0;lt-=8)ot<<=1,ot|=nt>>>lt+st&1,ot<<=1,ot|=et>>>lt+st&1;for(var st=4;st<8;st++)for(var lt=24;lt>=0;lt-=8)at<<=1,at|=nt>>>lt+st&1,at<<=1,at|=et>>>lt+st&1;it[rt+0]=ot>>>0,it[rt+1]=at>>>0};utils$q.pc1=function(et,nt,it,rt){for(var ot=0,at=0,st=7;st>=5;st--){for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>lt+st&1;for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=et>>lt+st&1}for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>lt+st&1;for(var st=1;st<=3;st++){for(var lt=0;lt<=24;lt+=8)at<<=1,at|=nt>>lt+st&1;for(var lt=0;lt<=24;lt+=8)at<<=1,at|=et>>lt+st&1}for(var lt=0;lt<=24;lt+=8)at<<=1,at|=et>>lt+st&1;it[rt+0]=ot>>>0,it[rt+1]=at>>>0};utils$q.r28shl=function(et,nt){return et<>>28-nt};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$q.pc2=function(et,nt,it,rt){for(var ot=0,at=0,st=pc2table.length>>>1,lt=0;lt>>pc2table[lt]&1;for(var lt=st;lt>>pc2table[lt]&1;it[rt+0]=ot>>>0,it[rt+1]=at>>>0};utils$q.expand=function(et,nt,it){var rt=0,ot=0;rt=(et&1)<<5|et>>>27;for(var at=23;at>=15;at-=4)rt<<=6,rt|=et>>>at&63;for(var at=11;at>=3;at-=4)ot|=et>>>at&63,ot<<=6;ot|=(et&31)<<1|et>>>31,nt[it+0]=rt>>>0,nt[it+1]=ot>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$q.substitute=function(et,nt){for(var it=0,rt=0;rt<4;rt++){var ot=et>>>18-rt*6&63,at=sTable[rt*64+ot];it<<=4,it|=at}for(var rt=0;rt<4;rt++){var ot=nt>>>18-rt*6&63,at=sTable[4*64+rt*64+ot];it<<=4,it|=at}return it>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];utils$q.permute=function(et){for(var nt=0,it=0;it>>permuteTable[it]&1;return nt>>>0};utils$q.padSplit=function(et,nt,it){for(var rt=et.toString(2);rt.length0;rt--)nt+=this._buffer(et,nt),it+=this._flushBuffer(ot,it);return nt+=this._buffer(et,nt),ot};Cipher$3.prototype.final=function(et){var nt;et&&(nt=this.update(et));var it;return this.type==="encrypt"?it=this._finalEncrypt():it=this._finalDecrypt(),nt?nt.concat(it):it};Cipher$3.prototype._pad=function(et,nt){if(nt===0)return!1;for(;nt>>1];it=utils$p.r28shl(it,at),rt=utils$p.r28shl(rt,at),utils$p.pc2(it,rt,et.keys,ot)}};DES$3.prototype._update=function(et,nt,it,rt){var ot=this._desState,at=utils$p.readUInt32BE(et,nt),st=utils$p.readUInt32BE(et,nt+4);utils$p.ip(at,st,ot.tmp,0),at=ot.tmp[0],st=ot.tmp[1],this.type==="encrypt"?this._encrypt(ot,at,st,ot.tmp,0):this._decrypt(ot,at,st,ot.tmp,0),at=ot.tmp[0],st=ot.tmp[1],utils$p.writeUInt32BE(it,at,rt),utils$p.writeUInt32BE(it,st,rt+4)};DES$3.prototype._pad=function(et,nt){if(this.padding===!1)return!1;for(var it=et.length-nt,rt=nt;rt>>0,at=pt}utils$p.rip(st,at,rt,ot)};DES$3.prototype._decrypt=function(et,nt,it,rt,ot){for(var at=it,st=nt,lt=et.keys.length-2;lt>=0;lt-=2){var ct=et.keys[lt],ut=et.keys[lt+1];utils$p.expand(at,et.tmp,0),ct^=et.tmp[0],ut^=et.tmp[1];var ht=utils$p.substitute(ct,ut),dt=utils$p.permute(ht),pt=at;at=(st^dt)>>>0,st=pt}utils$p.rip(at,st,rt,ot)};var cbc$1={},assert$l=minimalisticAssert,inherits$h=inherits_browserExports,proto$1={};function CBCState(tt){assert$l.equal(tt.length,8,"Invalid IV length"),this.iv=new Array(8);for(var et=0;et>rt%8,tt._prev=shiftIn(tt._prev,nt?st:lt);return at}function shiftIn(tt,et){var nt=tt.length,it=-1,rt=Buffer$m.allocUnsafe(tt.length);for(tt=Buffer$m.concat([tt,Buffer$m.from([et])]);++it>7;return rt}cfb1.encrypt=function(tt,et,nt){for(var it=et.length,rt=Buffer$m.allocUnsafe(it),ot=-1;++ot>>24]^at[ut>>>16&255]^st[ht>>>8&255]^lt[dt&255]^et[yt++],mt=ot[ut>>>24]^at[ht>>>16&255]^st[dt>>>8&255]^lt[ct&255]^et[yt++],gt=ot[ht>>>24]^at[dt>>>16&255]^st[ct>>>8&255]^lt[ut&255]^et[yt++],bt=ot[dt>>>24]^at[ct>>>16&255]^st[ut>>>8&255]^lt[ht&255]^et[yt++],ct=pt,ut=mt,ht=gt,dt=bt;return pt=(it[ct>>>24]<<24|it[ut>>>16&255]<<16|it[ht>>>8&255]<<8|it[dt&255])^et[yt++],mt=(it[ut>>>24]<<24|it[ht>>>16&255]<<16|it[dt>>>8&255]<<8|it[ct&255])^et[yt++],gt=(it[ht>>>24]<<24|it[dt>>>16&255]<<16|it[ct>>>8&255]<<8|it[ut&255])^et[yt++],bt=(it[dt>>>24]<<24|it[ct>>>16&255]<<16|it[ut>>>8&255]<<8|it[ht&255])^et[yt++],pt=pt>>>0,mt=mt>>>0,gt=gt>>>0,bt=bt>>>0,[pt,mt,gt,bt]}var RCON=[0,1,2,4,8,16,32,64,128,27,54],G=function(){for(var tt=new Array(256),et=0;et<256;et++)et<128?tt[et]=et<<1:tt[et]=et<<1^283;for(var nt=[],it=[],rt=[[],[],[],[]],ot=[[],[],[],[]],at=0,st=0,lt=0;lt<256;++lt){var ct=st^st<<1^st<<2^st<<3^st<<4;ct=ct>>>8^ct&255^99,nt[at]=ct,it[ct]=at;var ut=tt[at],ht=tt[ut],dt=tt[ht],pt=tt[ct]*257^ct*16843008;rt[0][at]=pt<<24|pt>>>8,rt[1][at]=pt<<16|pt>>>16,rt[2][at]=pt<<8|pt>>>24,rt[3][at]=pt,pt=dt*16843009^ht*65537^ut*257^at*16843008,ot[0][ct]=pt<<24|pt>>>8,ot[1][ct]=pt<<16|pt>>>16,ot[2][ct]=pt<<8|pt>>>24,ot[3][ct]=pt,at===0?at=st=1:(at=ut^tt[tt[tt[dt^ut]]],st^=tt[tt[st]])}return{SBOX:nt,INV_SBOX:it,SUB_MIX:rt,INV_SUB_MIX:ot}}();function AES(tt){this._key=asUInt32Array(tt),this._reset()}AES.blockSize=4*4;AES.keySize=256/8;AES.prototype.blockSize=AES.blockSize;AES.prototype.keySize=AES.keySize;AES.prototype._reset=function(){for(var tt=this._key,et=tt.length,nt=et+6,it=(nt+1)*4,rt=[],ot=0;ot>>24,at=G.SBOX[at>>>24]<<24|G.SBOX[at>>>16&255]<<16|G.SBOX[at>>>8&255]<<8|G.SBOX[at&255],at^=RCON[ot/et|0]<<24):et>6&&ot%et===4&&(at=G.SBOX[at>>>24]<<24|G.SBOX[at>>>16&255]<<16|G.SBOX[at>>>8&255]<<8|G.SBOX[at&255]),rt[ot]=rt[ot-et]^at}for(var st=[],lt=0;lt>>24]]^G.INV_SUB_MIX[1][G.SBOX[ut>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[ut>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[ut&255]]}this._nRounds=nt,this._keySchedule=rt,this._invKeySchedule=st};AES.prototype.encryptBlockRaw=function(tt){return tt=asUInt32Array(tt),cryptBlock(tt,this._keySchedule,G.SUB_MIX,G.SBOX,this._nRounds)};AES.prototype.encryptBlock=function(tt){var et=this.encryptBlockRaw(tt),nt=Buffer$k.allocUnsafe(16);return nt.writeUInt32BE(et[0],0),nt.writeUInt32BE(et[1],4),nt.writeUInt32BE(et[2],8),nt.writeUInt32BE(et[3],12),nt};AES.prototype.decryptBlock=function(tt){tt=asUInt32Array(tt);var et=tt[1];tt[1]=tt[3],tt[3]=et;var nt=cryptBlock(tt,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX,this._nRounds),it=Buffer$k.allocUnsafe(16);return it.writeUInt32BE(nt[0],0),it.writeUInt32BE(nt[3],4),it.writeUInt32BE(nt[2],8),it.writeUInt32BE(nt[1],12),it};AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)};aes$5.AES=AES;var Buffer$j=safeBufferExports.Buffer,ZEROES=Buffer$j.alloc(16,0);function toArray$4(tt){return[tt.readUInt32BE(0),tt.readUInt32BE(4),tt.readUInt32BE(8),tt.readUInt32BE(12)]}function fromArray(tt){var et=Buffer$j.allocUnsafe(16);return et.writeUInt32BE(tt[0]>>>0,0),et.writeUInt32BE(tt[1]>>>0,4),et.writeUInt32BE(tt[2]>>>0,8),et.writeUInt32BE(tt[3]>>>0,12),et}function GHASH$1(tt){this.h=tt,this.state=Buffer$j.alloc(16,0),this.cache=Buffer$j.allocUnsafe(0)}GHASH$1.prototype.ghash=function(tt){for(var et=-1;++et0;nt--)tt[nt]=tt[nt]>>>1|(tt[nt-1]&1)<<31;tt[0]=tt[0]>>>1,rt&&(tt[0]=tt[0]^225<<24)}this.state=fromArray(et)};GHASH$1.prototype.update=function(tt){this.cache=Buffer$j.concat([this.cache,tt]);for(var et;this.cache.length>=16;)et=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(et)};GHASH$1.prototype.final=function(tt,et){return this.cache.length&&this.ghash(Buffer$j.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,tt,0,et])),this.state};var ghash=GHASH$1,aes$4=aes$5,Buffer$i=safeBufferExports.Buffer,Transform$4=cipherBase,inherits$e=inherits_browserExports,GHASH=ghash,xor$3=bufferXor,incr32=incr32_1;function xorTest(tt,et){var nt=0;tt.length!==et.length&&nt++;for(var it=Math.min(tt.length,et.length),rt=0;rt0||it>0;){var lt=new MD5;lt.update(st),lt.update(tt),et&<.update(et),st=lt.digest();var ct=0;if(rt>0){var ut=ot.length-rt;ct=Math.min(rt,st.length),st.copy(ot,ut,0,ct),rt-=ct}if(ct0){var ht=at.length-it,dt=Math.min(it,st.length-ct);st.copy(at,ht,ct,ct+dt),it-=dt}}return st.fill(0),{key:ot,iv:at}}var evp_bytestokey=EVP_BytesToKey,MODES$1=modes_1,AuthCipher$1=authCipher,Buffer$f=safeBufferExports.Buffer,StreamCipher$1=streamCipher,Transform$2=cipherBase,aes$2=aes$5,ebtk$2=evp_bytestokey,inherits$c=inherits_browserExports;function Cipher(tt,et,nt){Transform$2.call(this),this._cache=new Splitter$1,this._cipher=new aes$2.AES(et),this._prev=Buffer$f.from(nt),this._mode=tt,this._autopadding=!0}inherits$c(Cipher,Transform$2);Cipher.prototype._update=function(tt){this._cache.add(tt);for(var et,nt,it=[];et=this._cache.get();)nt=this._mode.encrypt(this,et),it.push(nt);return Buffer$f.concat(it)};var PADDING=Buffer$f.alloc(16,16);Cipher.prototype._final=function(){var tt=this._cache.flush();if(this._autopadding)return tt=this._mode.encrypt(this,tt),this._cipher.scrub(),tt;if(!tt.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")};Cipher.prototype.setAutoPadding=function(tt){return this._autopadding=!!tt,this};function Splitter$1(){this.cache=Buffer$f.allocUnsafe(0)}Splitter$1.prototype.add=function(tt){this.cache=Buffer$f.concat([this.cache,tt])};Splitter$1.prototype.get=function(){if(this.cache.length>15){var tt=this.cache.slice(0,16);return this.cache=this.cache.slice(16),tt}return null};Splitter$1.prototype.flush=function(){for(var tt=16-this.cache.length,et=Buffer$f.allocUnsafe(tt),nt=-1;++nt16)return et=this.cache.slice(0,16),this.cache=this.cache.slice(16),et}else if(this.cache.length>=16)return et=this.cache.slice(0,16),this.cache=this.cache.slice(16),et;return null};Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(tt){var et=tt[15];if(et<1||et>16)throw new Error("unable to decrypt data");for(var nt=-1;++nt0?Bt:Pt},ot.min=function(Bt,Pt){return Bt.cmp(Pt)<0?Bt:Pt},ot.prototype._init=function(Bt,Pt,kt){if(typeof Bt=="number")return this._initNumber(Bt,Pt,kt);if(typeof Bt=="object")return this._initArray(Bt,Pt,kt);Pt==="hex"&&(Pt=16),it(Pt===(Pt|0)&&Pt>=2&&Pt<=36),Bt=Bt.toString().replace(/\s+/g,"");var At=0;Bt[0]==="-"&&(At++,this.negative=1),At=0;At-=3)Wt=Bt[At]|Bt[At-1]<<8|Bt[At-2]<<16,this.words[Rt]|=Wt<>>26-jt&67108863,jt+=24,jt>=26&&(jt-=26,Rt++);else if(kt==="le")for(At=0,Rt=0;At>>26-jt&67108863,jt+=24,jt>=26&&(jt-=26,Rt++);return this.strip()};function st(Lt,Bt){var Pt=Lt.charCodeAt(Bt);return Pt>=65&&Pt<=70?Pt-55:Pt>=97&&Pt<=102?Pt-87:Pt-48&15}function lt(Lt,Bt,Pt){var kt=st(Lt,Pt);return Pt-1>=Bt&&(kt|=st(Lt,Pt-1)<<4),kt}ot.prototype._parseHex=function(Bt,Pt,kt){this.length=Math.ceil((Bt.length-Pt)/6),this.words=new Array(this.length);for(var At=0;At=Pt;At-=2)jt=lt(Bt,Pt,At)<=18?(Rt-=18,Wt+=1,this.words[Wt]|=jt>>>26):Rt+=8;else{var Ot=Bt.length-Pt;for(At=Ot%2===0?Pt+1:Pt;At=18?(Rt-=18,Wt+=1,this.words[Wt]|=jt>>>26):Rt+=8}this.strip()};function ct(Lt,Bt,Pt,kt){for(var At=0,Rt=Math.min(Lt.length,Pt),Wt=Bt;Wt=49?At+=jt-49+10:jt>=17?At+=jt-17+10:At+=jt}return At}ot.prototype._parseBase=function(Bt,Pt,kt){this.words=[0],this.length=1;for(var At=0,Rt=1;Rt<=67108863;Rt*=Pt)At++;At--,Rt=Rt/Pt|0;for(var Wt=Bt.length-kt,jt=Wt%At,Ot=Math.min(Wt,Wt-jt)+kt,Ct=0,Dt=kt;Dt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},ot.prototype.inspect=function(){return(this.red?""};var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],dt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(Bt,Pt){Bt=Bt||10,Pt=Pt|0||1;var kt;if(Bt===16||Bt==="hex"){kt="";for(var At=0,Rt=0,Wt=0;Wt>>24-At&16777215,Rt!==0||Wt!==this.length-1?kt=ut[6-Ot.length]+Ot+kt:kt=Ot+kt,At+=2,At>=26&&(At-=26,Wt--)}for(Rt!==0&&(kt=Rt.toString(16)+kt);kt.length%Pt!==0;)kt="0"+kt;return this.negative!==0&&(kt="-"+kt),kt}if(Bt===(Bt|0)&&Bt>=2&&Bt<=36){var Ct=ht[Bt],Dt=dt[Bt];kt="";var Mt=this.clone();for(Mt.negative=0;!Mt.isZero();){var Vt=Mt.modn(Dt).toString(Bt);Mt=Mt.idivn(Dt),Mt.isZero()?kt=Vt+kt:kt=ut[Ct-Vt.length]+Vt+kt}for(this.isZero()&&(kt="0"+kt);kt.length%Pt!==0;)kt="0"+kt;return this.negative!==0&&(kt="-"+kt),kt}it(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var Bt=this.words[0];return this.length===2?Bt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Bt+=4503599627370496+this.words[1]*67108864:this.length>2&&it(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Bt:Bt},ot.prototype.toJSON=function(){return this.toString(16)},ot.prototype.toBuffer=function(Bt,Pt){return it(typeof at<"u"),this.toArrayLike(at,Bt,Pt)},ot.prototype.toArray=function(Bt,Pt){return this.toArrayLike(Array,Bt,Pt)},ot.prototype.toArrayLike=function(Bt,Pt,kt){var At=this.byteLength(),Rt=kt||Math.max(1,At);it(At<=Rt,"byte array longer than desired length"),it(Rt>0,"Requested array length <= 0"),this.strip();var Wt=Pt==="le",jt=new Bt(Rt),Ot,Ct,Dt=this.clone();if(Wt){for(Ct=0;!Dt.isZero();Ct++)Ot=Dt.andln(255),Dt.iushrn(8),jt[Ct]=Ot;for(;Ct=4096&&(kt+=13,Pt>>>=13),Pt>=64&&(kt+=7,Pt>>>=7),Pt>=8&&(kt+=4,Pt>>>=4),Pt>=2&&(kt+=2,Pt>>>=2),kt+Pt},ot.prototype._zeroBits=function(Bt){if(Bt===0)return 26;var Pt=Bt,kt=0;return Pt&8191||(kt+=13,Pt>>>=13),Pt&127||(kt+=7,Pt>>>=7),Pt&15||(kt+=4,Pt>>>=4),Pt&3||(kt+=2,Pt>>>=2),Pt&1||kt++,kt},ot.prototype.bitLength=function(){var Bt=this.words[this.length-1],Pt=this._countBits(Bt);return(this.length-1)*26+Pt};function pt(Lt){for(var Bt=new Array(Lt.bitLength()),Pt=0;Pt>>At}return Bt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Bt=0,Pt=0;PtBt.length?this.clone().ior(Bt):Bt.clone().ior(this)},ot.prototype.uor=function(Bt){return this.length>Bt.length?this.clone().iuor(Bt):Bt.clone().iuor(this)},ot.prototype.iuand=function(Bt){var Pt;this.length>Bt.length?Pt=Bt:Pt=this;for(var kt=0;ktBt.length?this.clone().iand(Bt):Bt.clone().iand(this)},ot.prototype.uand=function(Bt){return this.length>Bt.length?this.clone().iuand(Bt):Bt.clone().iuand(this)},ot.prototype.iuxor=function(Bt){var Pt,kt;this.length>Bt.length?(Pt=this,kt=Bt):(Pt=Bt,kt=this);for(var At=0;AtBt.length?this.clone().ixor(Bt):Bt.clone().ixor(this)},ot.prototype.uxor=function(Bt){return this.length>Bt.length?this.clone().iuxor(Bt):Bt.clone().iuxor(this)},ot.prototype.inotn=function(Bt){it(typeof Bt=="number"&&Bt>=0);var Pt=Math.ceil(Bt/26)|0,kt=Bt%26;this._expand(Pt),kt>0&&Pt--;for(var At=0;At0&&(this.words[At]=~this.words[At]&67108863>>26-kt),this.strip()},ot.prototype.notn=function(Bt){return this.clone().inotn(Bt)},ot.prototype.setn=function(Bt,Pt){it(typeof Bt=="number"&&Bt>=0);var kt=Bt/26|0,At=Bt%26;return this._expand(kt+1),Pt?this.words[kt]=this.words[kt]|1<Bt.length?(kt=this,At=Bt):(kt=Bt,At=this);for(var Rt=0,Wt=0;Wt>>26;for(;Rt!==0&&Wt>>26;if(this.length=kt.length,Rt!==0)this.words[this.length]=Rt,this.length++;else if(kt!==this)for(;WtBt.length?this.clone().iadd(Bt):Bt.clone().iadd(this)},ot.prototype.isub=function(Bt){if(Bt.negative!==0){Bt.negative=0;var Pt=this.iadd(Bt);return Bt.negative=1,Pt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Bt),this.negative=1,this._normSign();var kt=this.cmp(Bt);if(kt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var At,Rt;kt>0?(At=this,Rt=Bt):(At=Bt,Rt=this);for(var Wt=0,jt=0;jt>26,this.words[jt]=Pt&67108863;for(;Wt!==0&&jt>26,this.words[jt]=Pt&67108863;if(Wt===0&&jt>>26,Mt=Ot&67108863,Vt=Math.min(Ct,Bt.length-1),Qt=Math.max(0,Ct-Lt.length+1);Qt<=Vt;Qt++){var rn=Ct-Qt|0;At=Lt.words[rn]|0,Rt=Bt.words[Qt]|0,Wt=At*Rt+Mt,Dt+=Wt/67108864|0,Mt=Wt&67108863}Pt.words[Ct]=Mt|0,Ot=Dt|0}return Ot!==0?Pt.words[Ct]=Ot|0:Pt.length--,Pt.strip()}var gt=function(Bt,Pt,kt){var At=Bt.words,Rt=Pt.words,Wt=kt.words,jt=0,Ot,Ct,Dt,Mt=At[0]|0,Vt=Mt&8191,Qt=Mt>>>13,rn=At[1]|0,Xt=rn&8191,an=rn>>>13,tn=At[2]|0,pn=tn&8191,vn=tn>>>13,sn=At[3]|0,Zt=sn&8191,Sn=sn>>>13,Tn=At[4]|0,Cn=Tn&8191,jn=Tn>>>13,Un=At[5]|0,yn=Un&8191,un=Un>>>13,En=At[6]|0,In=En&8191,xn=En>>>13,dn=At[7]|0,cn=dn&8191,hn=dn>>>13,$n=At[8]|0,nn=$n&8191,Kt=$n>>>13,Yt=At[9]|0,_n=Yt&8191,Mn=Yt>>>13,Bn=Rt[0]|0,Nn=Bn&8191,qn=Bn>>>13,Wn=Rt[1]|0,Vn=Wn&8191,Fn=Wn>>>13,Jn=Rt[2]|0,Hn=Jn&8191,dr=Jn>>>13,ur=Rt[3]|0,_r=ur&8191,Qr=ur>>>13,jr=Rt[4]|0,Mr=jr&8191,qr=jr>>>13,Ur=Rt[5]|0,Lr=Ur&8191,ao=Ur>>>13,Gr=Rt[6]|0,Br=Gr&8191,go=Gr>>>13,wn=Rt[7]|0,Pn=wn&8191,fn=wn>>>13,Jt=Rt[8]|0,kn=Jt&8191,On=Jt>>>13,Dn=Rt[9]|0,Kn=Dn&8191,er=Dn>>>13;kt.negative=Bt.negative^Pt.negative,kt.length=19,Ot=Math.imul(Vt,Nn),Ct=Math.imul(Vt,qn),Ct=Ct+Math.imul(Qt,Nn)|0,Dt=Math.imul(Qt,qn);var or=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(or>>>26)|0,or&=67108863,Ot=Math.imul(Xt,Nn),Ct=Math.imul(Xt,qn),Ct=Ct+Math.imul(an,Nn)|0,Dt=Math.imul(an,qn),Ot=Ot+Math.imul(Vt,Vn)|0,Ct=Ct+Math.imul(Vt,Fn)|0,Ct=Ct+Math.imul(Qt,Vn)|0,Dt=Dt+Math.imul(Qt,Fn)|0;var ar=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(ar>>>26)|0,ar&=67108863,Ot=Math.imul(pn,Nn),Ct=Math.imul(pn,qn),Ct=Ct+Math.imul(vn,Nn)|0,Dt=Math.imul(vn,qn),Ot=Ot+Math.imul(Xt,Vn)|0,Ct=Ct+Math.imul(Xt,Fn)|0,Ct=Ct+Math.imul(an,Vn)|0,Dt=Dt+Math.imul(an,Fn)|0,Ot=Ot+Math.imul(Vt,Hn)|0,Ct=Ct+Math.imul(Vt,dr)|0,Ct=Ct+Math.imul(Qt,Hn)|0,Dt=Dt+Math.imul(Qt,dr)|0;var Vr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Ot=Math.imul(Zt,Nn),Ct=Math.imul(Zt,qn),Ct=Ct+Math.imul(Sn,Nn)|0,Dt=Math.imul(Sn,qn),Ot=Ot+Math.imul(pn,Vn)|0,Ct=Ct+Math.imul(pn,Fn)|0,Ct=Ct+Math.imul(vn,Vn)|0,Dt=Dt+Math.imul(vn,Fn)|0,Ot=Ot+Math.imul(Xt,Hn)|0,Ct=Ct+Math.imul(Xt,dr)|0,Ct=Ct+Math.imul(an,Hn)|0,Dt=Dt+Math.imul(an,dr)|0,Ot=Ot+Math.imul(Vt,_r)|0,Ct=Ct+Math.imul(Vt,Qr)|0,Ct=Ct+Math.imul(Qt,_r)|0,Dt=Dt+Math.imul(Qt,Qr)|0;var wr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(wr>>>26)|0,wr&=67108863,Ot=Math.imul(Cn,Nn),Ct=Math.imul(Cn,qn),Ct=Ct+Math.imul(jn,Nn)|0,Dt=Math.imul(jn,qn),Ot=Ot+Math.imul(Zt,Vn)|0,Ct=Ct+Math.imul(Zt,Fn)|0,Ct=Ct+Math.imul(Sn,Vn)|0,Dt=Dt+Math.imul(Sn,Fn)|0,Ot=Ot+Math.imul(pn,Hn)|0,Ct=Ct+Math.imul(pn,dr)|0,Ct=Ct+Math.imul(vn,Hn)|0,Dt=Dt+Math.imul(vn,dr)|0,Ot=Ot+Math.imul(Xt,_r)|0,Ct=Ct+Math.imul(Xt,Qr)|0,Ct=Ct+Math.imul(an,_r)|0,Dt=Dt+Math.imul(an,Qr)|0,Ot=Ot+Math.imul(Vt,Mr)|0,Ct=Ct+Math.imul(Vt,qr)|0,Ct=Ct+Math.imul(Qt,Mr)|0,Dt=Dt+Math.imul(Qt,qr)|0;var Or=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Or>>>26)|0,Or&=67108863,Ot=Math.imul(yn,Nn),Ct=Math.imul(yn,qn),Ct=Ct+Math.imul(un,Nn)|0,Dt=Math.imul(un,qn),Ot=Ot+Math.imul(Cn,Vn)|0,Ct=Ct+Math.imul(Cn,Fn)|0,Ct=Ct+Math.imul(jn,Vn)|0,Dt=Dt+Math.imul(jn,Fn)|0,Ot=Ot+Math.imul(Zt,Hn)|0,Ct=Ct+Math.imul(Zt,dr)|0,Ct=Ct+Math.imul(Sn,Hn)|0,Dt=Dt+Math.imul(Sn,dr)|0,Ot=Ot+Math.imul(pn,_r)|0,Ct=Ct+Math.imul(pn,Qr)|0,Ct=Ct+Math.imul(vn,_r)|0,Dt=Dt+Math.imul(vn,Qr)|0,Ot=Ot+Math.imul(Xt,Mr)|0,Ct=Ct+Math.imul(Xt,qr)|0,Ct=Ct+Math.imul(an,Mr)|0,Dt=Dt+Math.imul(an,qr)|0,Ot=Ot+Math.imul(Vt,Lr)|0,Ct=Ct+Math.imul(Vt,ao)|0,Ct=Ct+Math.imul(Qt,Lr)|0,Dt=Dt+Math.imul(Qt,ao)|0;var Hr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Ot=Math.imul(In,Nn),Ct=Math.imul(In,qn),Ct=Ct+Math.imul(xn,Nn)|0,Dt=Math.imul(xn,qn),Ot=Ot+Math.imul(yn,Vn)|0,Ct=Ct+Math.imul(yn,Fn)|0,Ct=Ct+Math.imul(un,Vn)|0,Dt=Dt+Math.imul(un,Fn)|0,Ot=Ot+Math.imul(Cn,Hn)|0,Ct=Ct+Math.imul(Cn,dr)|0,Ct=Ct+Math.imul(jn,Hn)|0,Dt=Dt+Math.imul(jn,dr)|0,Ot=Ot+Math.imul(Zt,_r)|0,Ct=Ct+Math.imul(Zt,Qr)|0,Ct=Ct+Math.imul(Sn,_r)|0,Dt=Dt+Math.imul(Sn,Qr)|0,Ot=Ot+Math.imul(pn,Mr)|0,Ct=Ct+Math.imul(pn,qr)|0,Ct=Ct+Math.imul(vn,Mr)|0,Dt=Dt+Math.imul(vn,qr)|0,Ot=Ot+Math.imul(Xt,Lr)|0,Ct=Ct+Math.imul(Xt,ao)|0,Ct=Ct+Math.imul(an,Lr)|0,Dt=Dt+Math.imul(an,ao)|0,Ot=Ot+Math.imul(Vt,Br)|0,Ct=Ct+Math.imul(Vt,go)|0,Ct=Ct+Math.imul(Qt,Br)|0,Dt=Dt+Math.imul(Qt,go)|0;var no=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(no>>>26)|0,no&=67108863,Ot=Math.imul(cn,Nn),Ct=Math.imul(cn,qn),Ct=Ct+Math.imul(hn,Nn)|0,Dt=Math.imul(hn,qn),Ot=Ot+Math.imul(In,Vn)|0,Ct=Ct+Math.imul(In,Fn)|0,Ct=Ct+Math.imul(xn,Vn)|0,Dt=Dt+Math.imul(xn,Fn)|0,Ot=Ot+Math.imul(yn,Hn)|0,Ct=Ct+Math.imul(yn,dr)|0,Ct=Ct+Math.imul(un,Hn)|0,Dt=Dt+Math.imul(un,dr)|0,Ot=Ot+Math.imul(Cn,_r)|0,Ct=Ct+Math.imul(Cn,Qr)|0,Ct=Ct+Math.imul(jn,_r)|0,Dt=Dt+Math.imul(jn,Qr)|0,Ot=Ot+Math.imul(Zt,Mr)|0,Ct=Ct+Math.imul(Zt,qr)|0,Ct=Ct+Math.imul(Sn,Mr)|0,Dt=Dt+Math.imul(Sn,qr)|0,Ot=Ot+Math.imul(pn,Lr)|0,Ct=Ct+Math.imul(pn,ao)|0,Ct=Ct+Math.imul(vn,Lr)|0,Dt=Dt+Math.imul(vn,ao)|0,Ot=Ot+Math.imul(Xt,Br)|0,Ct=Ct+Math.imul(Xt,go)|0,Ct=Ct+Math.imul(an,Br)|0,Dt=Dt+Math.imul(an,go)|0,Ot=Ot+Math.imul(Vt,Pn)|0,Ct=Ct+Math.imul(Vt,fn)|0,Ct=Ct+Math.imul(Qt,Pn)|0,Dt=Dt+Math.imul(Qt,fn)|0;var Xr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,Ot=Math.imul(nn,Nn),Ct=Math.imul(nn,qn),Ct=Ct+Math.imul(Kt,Nn)|0,Dt=Math.imul(Kt,qn),Ot=Ot+Math.imul(cn,Vn)|0,Ct=Ct+Math.imul(cn,Fn)|0,Ct=Ct+Math.imul(hn,Vn)|0,Dt=Dt+Math.imul(hn,Fn)|0,Ot=Ot+Math.imul(In,Hn)|0,Ct=Ct+Math.imul(In,dr)|0,Ct=Ct+Math.imul(xn,Hn)|0,Dt=Dt+Math.imul(xn,dr)|0,Ot=Ot+Math.imul(yn,_r)|0,Ct=Ct+Math.imul(yn,Qr)|0,Ct=Ct+Math.imul(un,_r)|0,Dt=Dt+Math.imul(un,Qr)|0,Ot=Ot+Math.imul(Cn,Mr)|0,Ct=Ct+Math.imul(Cn,qr)|0,Ct=Ct+Math.imul(jn,Mr)|0,Dt=Dt+Math.imul(jn,qr)|0,Ot=Ot+Math.imul(Zt,Lr)|0,Ct=Ct+Math.imul(Zt,ao)|0,Ct=Ct+Math.imul(Sn,Lr)|0,Dt=Dt+Math.imul(Sn,ao)|0,Ot=Ot+Math.imul(pn,Br)|0,Ct=Ct+Math.imul(pn,go)|0,Ct=Ct+Math.imul(vn,Br)|0,Dt=Dt+Math.imul(vn,go)|0,Ot=Ot+Math.imul(Xt,Pn)|0,Ct=Ct+Math.imul(Xt,fn)|0,Ct=Ct+Math.imul(an,Pn)|0,Dt=Dt+Math.imul(an,fn)|0,Ot=Ot+Math.imul(Vt,kn)|0,Ct=Ct+Math.imul(Vt,On)|0,Ct=Ct+Math.imul(Qt,kn)|0,Dt=Dt+Math.imul(Qt,On)|0;var Jr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Ot=Math.imul(_n,Nn),Ct=Math.imul(_n,qn),Ct=Ct+Math.imul(Mn,Nn)|0,Dt=Math.imul(Mn,qn),Ot=Ot+Math.imul(nn,Vn)|0,Ct=Ct+Math.imul(nn,Fn)|0,Ct=Ct+Math.imul(Kt,Vn)|0,Dt=Dt+Math.imul(Kt,Fn)|0,Ot=Ot+Math.imul(cn,Hn)|0,Ct=Ct+Math.imul(cn,dr)|0,Ct=Ct+Math.imul(hn,Hn)|0,Dt=Dt+Math.imul(hn,dr)|0,Ot=Ot+Math.imul(In,_r)|0,Ct=Ct+Math.imul(In,Qr)|0,Ct=Ct+Math.imul(xn,_r)|0,Dt=Dt+Math.imul(xn,Qr)|0,Ot=Ot+Math.imul(yn,Mr)|0,Ct=Ct+Math.imul(yn,qr)|0,Ct=Ct+Math.imul(un,Mr)|0,Dt=Dt+Math.imul(un,qr)|0,Ot=Ot+Math.imul(Cn,Lr)|0,Ct=Ct+Math.imul(Cn,ao)|0,Ct=Ct+Math.imul(jn,Lr)|0,Dt=Dt+Math.imul(jn,ao)|0,Ot=Ot+Math.imul(Zt,Br)|0,Ct=Ct+Math.imul(Zt,go)|0,Ct=Ct+Math.imul(Sn,Br)|0,Dt=Dt+Math.imul(Sn,go)|0,Ot=Ot+Math.imul(pn,Pn)|0,Ct=Ct+Math.imul(pn,fn)|0,Ct=Ct+Math.imul(vn,Pn)|0,Dt=Dt+Math.imul(vn,fn)|0,Ot=Ot+Math.imul(Xt,kn)|0,Ct=Ct+Math.imul(Xt,On)|0,Ct=Ct+Math.imul(an,kn)|0,Dt=Dt+Math.imul(an,On)|0,Ot=Ot+Math.imul(Vt,Kn)|0,Ct=Ct+Math.imul(Vt,er)|0,Ct=Ct+Math.imul(Qt,Kn)|0,Dt=Dt+Math.imul(Qt,er)|0;var br=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(br>>>26)|0,br&=67108863,Ot=Math.imul(_n,Vn),Ct=Math.imul(_n,Fn),Ct=Ct+Math.imul(Mn,Vn)|0,Dt=Math.imul(Mn,Fn),Ot=Ot+Math.imul(nn,Hn)|0,Ct=Ct+Math.imul(nn,dr)|0,Ct=Ct+Math.imul(Kt,Hn)|0,Dt=Dt+Math.imul(Kt,dr)|0,Ot=Ot+Math.imul(cn,_r)|0,Ct=Ct+Math.imul(cn,Qr)|0,Ct=Ct+Math.imul(hn,_r)|0,Dt=Dt+Math.imul(hn,Qr)|0,Ot=Ot+Math.imul(In,Mr)|0,Ct=Ct+Math.imul(In,qr)|0,Ct=Ct+Math.imul(xn,Mr)|0,Dt=Dt+Math.imul(xn,qr)|0,Ot=Ot+Math.imul(yn,Lr)|0,Ct=Ct+Math.imul(yn,ao)|0,Ct=Ct+Math.imul(un,Lr)|0,Dt=Dt+Math.imul(un,ao)|0,Ot=Ot+Math.imul(Cn,Br)|0,Ct=Ct+Math.imul(Cn,go)|0,Ct=Ct+Math.imul(jn,Br)|0,Dt=Dt+Math.imul(jn,go)|0,Ot=Ot+Math.imul(Zt,Pn)|0,Ct=Ct+Math.imul(Zt,fn)|0,Ct=Ct+Math.imul(Sn,Pn)|0,Dt=Dt+Math.imul(Sn,fn)|0,Ot=Ot+Math.imul(pn,kn)|0,Ct=Ct+Math.imul(pn,On)|0,Ct=Ct+Math.imul(vn,kn)|0,Dt=Dt+Math.imul(vn,On)|0,Ot=Ot+Math.imul(Xt,Kn)|0,Ct=Ct+Math.imul(Xt,er)|0,Ct=Ct+Math.imul(an,Kn)|0,Dt=Dt+Math.imul(an,er)|0;var $r=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+($r>>>26)|0,$r&=67108863,Ot=Math.imul(_n,Hn),Ct=Math.imul(_n,dr),Ct=Ct+Math.imul(Mn,Hn)|0,Dt=Math.imul(Mn,dr),Ot=Ot+Math.imul(nn,_r)|0,Ct=Ct+Math.imul(nn,Qr)|0,Ct=Ct+Math.imul(Kt,_r)|0,Dt=Dt+Math.imul(Kt,Qr)|0,Ot=Ot+Math.imul(cn,Mr)|0,Ct=Ct+Math.imul(cn,qr)|0,Ct=Ct+Math.imul(hn,Mr)|0,Dt=Dt+Math.imul(hn,qr)|0,Ot=Ot+Math.imul(In,Lr)|0,Ct=Ct+Math.imul(In,ao)|0,Ct=Ct+Math.imul(xn,Lr)|0,Dt=Dt+Math.imul(xn,ao)|0,Ot=Ot+Math.imul(yn,Br)|0,Ct=Ct+Math.imul(yn,go)|0,Ct=Ct+Math.imul(un,Br)|0,Dt=Dt+Math.imul(un,go)|0,Ot=Ot+Math.imul(Cn,Pn)|0,Ct=Ct+Math.imul(Cn,fn)|0,Ct=Ct+Math.imul(jn,Pn)|0,Dt=Dt+Math.imul(jn,fn)|0,Ot=Ot+Math.imul(Zt,kn)|0,Ct=Ct+Math.imul(Zt,On)|0,Ct=Ct+Math.imul(Sn,kn)|0,Dt=Dt+Math.imul(Sn,On)|0,Ot=Ot+Math.imul(pn,Kn)|0,Ct=Ct+Math.imul(pn,er)|0,Ct=Ct+Math.imul(vn,Kn)|0,Dt=Dt+Math.imul(vn,er)|0;var Dr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Ot=Math.imul(_n,_r),Ct=Math.imul(_n,Qr),Ct=Ct+Math.imul(Mn,_r)|0,Dt=Math.imul(Mn,Qr),Ot=Ot+Math.imul(nn,Mr)|0,Ct=Ct+Math.imul(nn,qr)|0,Ct=Ct+Math.imul(Kt,Mr)|0,Dt=Dt+Math.imul(Kt,qr)|0,Ot=Ot+Math.imul(cn,Lr)|0,Ct=Ct+Math.imul(cn,ao)|0,Ct=Ct+Math.imul(hn,Lr)|0,Dt=Dt+Math.imul(hn,ao)|0,Ot=Ot+Math.imul(In,Br)|0,Ct=Ct+Math.imul(In,go)|0,Ct=Ct+Math.imul(xn,Br)|0,Dt=Dt+Math.imul(xn,go)|0,Ot=Ot+Math.imul(yn,Pn)|0,Ct=Ct+Math.imul(yn,fn)|0,Ct=Ct+Math.imul(un,Pn)|0,Dt=Dt+Math.imul(un,fn)|0,Ot=Ot+Math.imul(Cn,kn)|0,Ct=Ct+Math.imul(Cn,On)|0,Ct=Ct+Math.imul(jn,kn)|0,Dt=Dt+Math.imul(jn,On)|0,Ot=Ot+Math.imul(Zt,Kn)|0,Ct=Ct+Math.imul(Zt,er)|0,Ct=Ct+Math.imul(Sn,Kn)|0,Dt=Dt+Math.imul(Sn,er)|0;var Cr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Ot=Math.imul(_n,Mr),Ct=Math.imul(_n,qr),Ct=Ct+Math.imul(Mn,Mr)|0,Dt=Math.imul(Mn,qr),Ot=Ot+Math.imul(nn,Lr)|0,Ct=Ct+Math.imul(nn,ao)|0,Ct=Ct+Math.imul(Kt,Lr)|0,Dt=Dt+Math.imul(Kt,ao)|0,Ot=Ot+Math.imul(cn,Br)|0,Ct=Ct+Math.imul(cn,go)|0,Ct=Ct+Math.imul(hn,Br)|0,Dt=Dt+Math.imul(hn,go)|0,Ot=Ot+Math.imul(In,Pn)|0,Ct=Ct+Math.imul(In,fn)|0,Ct=Ct+Math.imul(xn,Pn)|0,Dt=Dt+Math.imul(xn,fn)|0,Ot=Ot+Math.imul(yn,kn)|0,Ct=Ct+Math.imul(yn,On)|0,Ct=Ct+Math.imul(un,kn)|0,Dt=Dt+Math.imul(un,On)|0,Ot=Ot+Math.imul(Cn,Kn)|0,Ct=Ct+Math.imul(Cn,er)|0,Ct=Ct+Math.imul(jn,Kn)|0,Dt=Dt+Math.imul(jn,er)|0;var Ar=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,Ot=Math.imul(_n,Lr),Ct=Math.imul(_n,ao),Ct=Ct+Math.imul(Mn,Lr)|0,Dt=Math.imul(Mn,ao),Ot=Ot+Math.imul(nn,Br)|0,Ct=Ct+Math.imul(nn,go)|0,Ct=Ct+Math.imul(Kt,Br)|0,Dt=Dt+Math.imul(Kt,go)|0,Ot=Ot+Math.imul(cn,Pn)|0,Ct=Ct+Math.imul(cn,fn)|0,Ct=Ct+Math.imul(hn,Pn)|0,Dt=Dt+Math.imul(hn,fn)|0,Ot=Ot+Math.imul(In,kn)|0,Ct=Ct+Math.imul(In,On)|0,Ct=Ct+Math.imul(xn,kn)|0,Dt=Dt+Math.imul(xn,On)|0,Ot=Ot+Math.imul(yn,Kn)|0,Ct=Ct+Math.imul(yn,er)|0,Ct=Ct+Math.imul(un,Kn)|0,Dt=Dt+Math.imul(un,er)|0;var Nr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Ot=Math.imul(_n,Br),Ct=Math.imul(_n,go),Ct=Ct+Math.imul(Mn,Br)|0,Dt=Math.imul(Mn,go),Ot=Ot+Math.imul(nn,Pn)|0,Ct=Ct+Math.imul(nn,fn)|0,Ct=Ct+Math.imul(Kt,Pn)|0,Dt=Dt+Math.imul(Kt,fn)|0,Ot=Ot+Math.imul(cn,kn)|0,Ct=Ct+Math.imul(cn,On)|0,Ct=Ct+Math.imul(hn,kn)|0,Dt=Dt+Math.imul(hn,On)|0,Ot=Ot+Math.imul(In,Kn)|0,Ct=Ct+Math.imul(In,er)|0,Ct=Ct+Math.imul(xn,Kn)|0,Dt=Dt+Math.imul(xn,er)|0;var Fr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Ot=Math.imul(_n,Pn),Ct=Math.imul(_n,fn),Ct=Ct+Math.imul(Mn,Pn)|0,Dt=Math.imul(Mn,fn),Ot=Ot+Math.imul(nn,kn)|0,Ct=Ct+Math.imul(nn,On)|0,Ct=Ct+Math.imul(Kt,kn)|0,Dt=Dt+Math.imul(Kt,On)|0,Ot=Ot+Math.imul(cn,Kn)|0,Ct=Ct+Math.imul(cn,er)|0,Ct=Ct+Math.imul(hn,Kn)|0,Dt=Dt+Math.imul(hn,er)|0;var Pr=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Ot=Math.imul(_n,kn),Ct=Math.imul(_n,On),Ct=Ct+Math.imul(Mn,kn)|0,Dt=Math.imul(Mn,On),Ot=Ot+Math.imul(nn,Kn)|0,Ct=Ct+Math.imul(nn,er)|0,Ct=Ct+Math.imul(Kt,Kn)|0,Dt=Dt+Math.imul(Kt,er)|0;var _i=(jt+Ot|0)+((Ct&8191)<<13)|0;jt=(Dt+(Ct>>>13)|0)+(_i>>>26)|0,_i&=67108863,Ot=Math.imul(_n,Kn),Ct=Math.imul(_n,er),Ct=Ct+Math.imul(Mn,Kn)|0,Dt=Math.imul(Mn,er);var nr=(jt+Ot|0)+((Ct&8191)<<13)|0;return jt=(Dt+(Ct>>>13)|0)+(nr>>>26)|0,nr&=67108863,Wt[0]=or,Wt[1]=ar,Wt[2]=Vr,Wt[3]=wr,Wt[4]=Or,Wt[5]=Hr,Wt[6]=no,Wt[7]=Xr,Wt[8]=Jr,Wt[9]=br,Wt[10]=$r,Wt[11]=Dr,Wt[12]=Cr,Wt[13]=Ar,Wt[14]=Nr,Wt[15]=Fr,Wt[16]=Pr,Wt[17]=_i,Wt[18]=nr,jt!==0&&(Wt[19]=jt,kt.length++),kt};Math.imul||(gt=mt);function bt(Lt,Bt,Pt){Pt.negative=Bt.negative^Lt.negative,Pt.length=Lt.length+Bt.length;for(var kt=0,At=0,Rt=0;Rt>>26)|0,At+=Wt>>>26,Wt&=67108863}Pt.words[Rt]=jt,kt=Wt,Wt=At}return kt!==0?Pt.words[Rt]=kt:Pt.length--,Pt.strip()}function yt(Lt,Bt,Pt){var kt=new wt;return kt.mulp(Lt,Bt,Pt)}ot.prototype.mulTo=function(Bt,Pt){var kt,At=this.length+Bt.length;return this.length===10&&Bt.length===10?kt=gt(this,Bt,Pt):At<63?kt=mt(this,Bt,Pt):At<1024?kt=bt(this,Bt,Pt):kt=yt(this,Bt,Pt),kt};function wt(Lt,Bt){this.x=Lt,this.y=Bt}wt.prototype.makeRBT=function(Bt){for(var Pt=new Array(Bt),kt=ot.prototype._countBits(Bt)-1,At=0;At>=1;return At},wt.prototype.permute=function(Bt,Pt,kt,At,Rt,Wt){for(var jt=0;jt>>1)Rt++;return 1<>>13,kt[2*Wt+1]=Rt&8191,Rt=Rt>>>13;for(Wt=2*Pt;Wt>=26,Pt+=At/67108864|0,Pt+=Rt>>>26,this.words[kt]=Rt&67108863}return Pt!==0&&(this.words[kt]=Pt,this.length++),this},ot.prototype.muln=function(Bt){return this.clone().imuln(Bt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(Bt){var Pt=pt(Bt);if(Pt.length===0)return new ot(1);for(var kt=this,At=0;At=0);var Pt=Bt%26,kt=(Bt-Pt)/26,At=67108863>>>26-Pt<<26-Pt,Rt;if(Pt!==0){var Wt=0;for(Rt=0;Rt>>26-Pt}Wt&&(this.words[Rt]=Wt,this.length++)}if(kt!==0){for(Rt=this.length-1;Rt>=0;Rt--)this.words[Rt+kt]=this.words[Rt];for(Rt=0;Rt=0);var At;Pt?At=(Pt-Pt%26)/26:At=0;var Rt=Bt%26,Wt=Math.min((Bt-Rt)/26,this.length),jt=67108863^67108863>>>Rt<Wt)for(this.length-=Wt,Ct=0;Ct=0&&(Dt!==0||Ct>=At);Ct--){var Mt=this.words[Ct]|0;this.words[Ct]=Dt<<26-Rt|Mt>>>Rt,Dt=Mt&jt}return Ot&&Dt!==0&&(Ot.words[Ot.length++]=Dt),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},ot.prototype.ishrn=function(Bt,Pt,kt){return it(this.negative===0),this.iushrn(Bt,Pt,kt)},ot.prototype.shln=function(Bt){return this.clone().ishln(Bt)},ot.prototype.ushln=function(Bt){return this.clone().iushln(Bt)},ot.prototype.shrn=function(Bt){return this.clone().ishrn(Bt)},ot.prototype.ushrn=function(Bt){return this.clone().iushrn(Bt)},ot.prototype.testn=function(Bt){it(typeof Bt=="number"&&Bt>=0);var Pt=Bt%26,kt=(Bt-Pt)/26,At=1<=0);var Pt=Bt%26,kt=(Bt-Pt)/26;if(it(this.negative===0,"imaskn works only with positive numbers"),this.length<=kt)return this;if(Pt!==0&&kt++,this.length=Math.min(kt,this.length),Pt!==0){var At=67108863^67108863>>>Pt<=67108864;Pt++)this.words[Pt]-=67108864,Pt===this.length-1?this.words[Pt+1]=1:this.words[Pt+1]++;return this.length=Math.max(this.length,Pt+1),this},ot.prototype.isubn=function(Bt){if(it(typeof Bt=="number"),it(Bt<67108864),Bt<0)return this.iaddn(-Bt);if(this.negative!==0)return this.negative=0,this.iaddn(Bt),this.negative=1,this;if(this.words[0]-=Bt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Pt=0;Pt>26)-(Ot/67108864|0),this.words[Rt+kt]=Wt&67108863}for(;Rt>26,this.words[Rt+kt]=Wt&67108863;if(jt===0)return this.strip();for(it(jt===-1),jt=0,Rt=0;Rt>26,this.words[Rt]=Wt&67108863;return this.negative=1,this.strip()},ot.prototype._wordDiv=function(Bt,Pt){var kt=this.length-Bt.length,At=this.clone(),Rt=Bt,Wt=Rt.words[Rt.length-1]|0,jt=this._countBits(Wt);kt=26-jt,kt!==0&&(Rt=Rt.ushln(kt),At.iushln(kt),Wt=Rt.words[Rt.length-1]|0);var Ot=At.length-Rt.length,Ct;if(Pt!=="mod"){Ct=new ot(null),Ct.length=Ot+1,Ct.words=new Array(Ct.length);for(var Dt=0;Dt=0;Vt--){var Qt=(At.words[Rt.length+Vt]|0)*67108864+(At.words[Rt.length+Vt-1]|0);for(Qt=Math.min(Qt/Wt|0,67108863),At._ishlnsubmul(Rt,Qt,Vt);At.negative!==0;)Qt--,At.negative=0,At._ishlnsubmul(Rt,1,Vt),At.isZero()||(At.negative^=1);Ct&&(Ct.words[Vt]=Qt)}return Ct&&Ct.strip(),At.strip(),Pt!=="div"&&kt!==0&&At.iushrn(kt),{div:Ct||null,mod:At}},ot.prototype.divmod=function(Bt,Pt,kt){if(it(!Bt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var At,Rt,Wt;return this.negative!==0&&Bt.negative===0?(Wt=this.neg().divmod(Bt,Pt),Pt!=="mod"&&(At=Wt.div.neg()),Pt!=="div"&&(Rt=Wt.mod.neg(),kt&&Rt.negative!==0&&Rt.iadd(Bt)),{div:At,mod:Rt}):this.negative===0&&Bt.negative!==0?(Wt=this.divmod(Bt.neg(),Pt),Pt!=="mod"&&(At=Wt.div.neg()),{div:At,mod:Wt.mod}):this.negative&Bt.negative?(Wt=this.neg().divmod(Bt.neg(),Pt),Pt!=="div"&&(Rt=Wt.mod.neg(),kt&&Rt.negative!==0&&Rt.isub(Bt)),{div:Wt.div,mod:Rt}):Bt.length>this.length||this.cmp(Bt)<0?{div:new ot(0),mod:this}:Bt.length===1?Pt==="div"?{div:this.divn(Bt.words[0]),mod:null}:Pt==="mod"?{div:null,mod:new ot(this.modn(Bt.words[0]))}:{div:this.divn(Bt.words[0]),mod:new ot(this.modn(Bt.words[0]))}:this._wordDiv(Bt,Pt)},ot.prototype.div=function(Bt){return this.divmod(Bt,"div",!1).div},ot.prototype.mod=function(Bt){return this.divmod(Bt,"mod",!1).mod},ot.prototype.umod=function(Bt){return this.divmod(Bt,"mod",!0).mod},ot.prototype.divRound=function(Bt){var Pt=this.divmod(Bt);if(Pt.mod.isZero())return Pt.div;var kt=Pt.div.negative!==0?Pt.mod.isub(Bt):Pt.mod,At=Bt.ushrn(1),Rt=Bt.andln(1),Wt=kt.cmp(At);return Wt<0||Rt===1&&Wt===0?Pt.div:Pt.div.negative!==0?Pt.div.isubn(1):Pt.div.iaddn(1)},ot.prototype.modn=function(Bt){it(Bt<=67108863);for(var Pt=(1<<26)%Bt,kt=0,At=this.length-1;At>=0;At--)kt=(Pt*kt+(this.words[At]|0))%Bt;return kt},ot.prototype.idivn=function(Bt){it(Bt<=67108863);for(var Pt=0,kt=this.length-1;kt>=0;kt--){var At=(this.words[kt]|0)+Pt*67108864;this.words[kt]=At/Bt|0,Pt=At%Bt}return this.strip()},ot.prototype.divn=function(Bt){return this.clone().idivn(Bt)},ot.prototype.egcd=function(Bt){it(Bt.negative===0),it(!Bt.isZero());var Pt=this,kt=Bt.clone();Pt.negative!==0?Pt=Pt.umod(Bt):Pt=Pt.clone();for(var At=new ot(1),Rt=new ot(0),Wt=new ot(0),jt=new ot(1),Ot=0;Pt.isEven()&&kt.isEven();)Pt.iushrn(1),kt.iushrn(1),++Ot;for(var Ct=kt.clone(),Dt=Pt.clone();!Pt.isZero();){for(var Mt=0,Vt=1;!(Pt.words[0]&Vt)&&Mt<26;++Mt,Vt<<=1);if(Mt>0)for(Pt.iushrn(Mt);Mt-- >0;)(At.isOdd()||Rt.isOdd())&&(At.iadd(Ct),Rt.isub(Dt)),At.iushrn(1),Rt.iushrn(1);for(var Qt=0,rn=1;!(kt.words[0]&rn)&&Qt<26;++Qt,rn<<=1);if(Qt>0)for(kt.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||jt.isOdd())&&(Wt.iadd(Ct),jt.isub(Dt)),Wt.iushrn(1),jt.iushrn(1);Pt.cmp(kt)>=0?(Pt.isub(kt),At.isub(Wt),Rt.isub(jt)):(kt.isub(Pt),Wt.isub(At),jt.isub(Rt))}return{a:Wt,b:jt,gcd:kt.iushln(Ot)}},ot.prototype._invmp=function(Bt){it(Bt.negative===0),it(!Bt.isZero());var Pt=this,kt=Bt.clone();Pt.negative!==0?Pt=Pt.umod(Bt):Pt=Pt.clone();for(var At=new ot(1),Rt=new ot(0),Wt=kt.clone();Pt.cmpn(1)>0&&kt.cmpn(1)>0;){for(var jt=0,Ot=1;!(Pt.words[0]&Ot)&&jt<26;++jt,Ot<<=1);if(jt>0)for(Pt.iushrn(jt);jt-- >0;)At.isOdd()&&At.iadd(Wt),At.iushrn(1);for(var Ct=0,Dt=1;!(kt.words[0]&Dt)&&Ct<26;++Ct,Dt<<=1);if(Ct>0)for(kt.iushrn(Ct);Ct-- >0;)Rt.isOdd()&&Rt.iadd(Wt),Rt.iushrn(1);Pt.cmp(kt)>=0?(Pt.isub(kt),At.isub(Rt)):(kt.isub(Pt),Rt.isub(At))}var Mt;return Pt.cmpn(1)===0?Mt=At:Mt=Rt,Mt.cmpn(0)<0&&Mt.iadd(Bt),Mt},ot.prototype.gcd=function(Bt){if(this.isZero())return Bt.abs();if(Bt.isZero())return this.abs();var Pt=this.clone(),kt=Bt.clone();Pt.negative=0,kt.negative=0;for(var At=0;Pt.isEven()&&kt.isEven();At++)Pt.iushrn(1),kt.iushrn(1);do{for(;Pt.isEven();)Pt.iushrn(1);for(;kt.isEven();)kt.iushrn(1);var Rt=Pt.cmp(kt);if(Rt<0){var Wt=Pt;Pt=kt,kt=Wt}else if(Rt===0||kt.cmpn(1)===0)break;Pt.isub(kt)}while(!0);return kt.iushln(At)},ot.prototype.invm=function(Bt){return this.egcd(Bt).a.umod(Bt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(Bt){return this.words[0]&Bt},ot.prototype.bincn=function(Bt){it(typeof Bt=="number");var Pt=Bt%26,kt=(Bt-Pt)/26,At=1<>>26,jt&=67108863,this.words[Wt]=jt}return Rt!==0&&(this.words[Wt]=Rt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(Bt){var Pt=Bt<0;if(this.negative!==0&&!Pt)return-1;if(this.negative===0&&Pt)return 1;this.strip();var kt;if(this.length>1)kt=1;else{Pt&&(Bt=-Bt),it(Bt<=67108863,"Number is too big");var At=this.words[0]|0;kt=At===Bt?0:AtBt.length)return 1;if(this.length=0;kt--){var At=this.words[kt]|0,Rt=Bt.words[kt]|0;if(At!==Rt){AtRt&&(Pt=1);break}}return Pt},ot.prototype.gtn=function(Bt){return this.cmpn(Bt)===1},ot.prototype.gt=function(Bt){return this.cmp(Bt)===1},ot.prototype.gten=function(Bt){return this.cmpn(Bt)>=0},ot.prototype.gte=function(Bt){return this.cmp(Bt)>=0},ot.prototype.ltn=function(Bt){return this.cmpn(Bt)===-1},ot.prototype.lt=function(Bt){return this.cmp(Bt)===-1},ot.prototype.lten=function(Bt){return this.cmpn(Bt)<=0},ot.prototype.lte=function(Bt){return this.cmp(Bt)<=0},ot.prototype.eqn=function(Bt){return this.cmpn(Bt)===0},ot.prototype.eq=function(Bt){return this.cmp(Bt)===0},ot.red=function(Bt){return new $t(Bt)},ot.prototype.toRed=function(Bt){return it(!this.red,"Already a number in reduction context"),it(this.negative===0,"red works only with positives"),Bt.convertTo(this)._forceRed(Bt)},ot.prototype.fromRed=function(){return it(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(Bt){return this.red=Bt,this},ot.prototype.forceRed=function(Bt){return it(!this.red,"Already a number in reduction context"),this._forceRed(Bt)},ot.prototype.redAdd=function(Bt){return it(this.red,"redAdd works only with red numbers"),this.red.add(this,Bt)},ot.prototype.redIAdd=function(Bt){return it(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Bt)},ot.prototype.redSub=function(Bt){return it(this.red,"redSub works only with red numbers"),this.red.sub(this,Bt)},ot.prototype.redISub=function(Bt){return it(this.red,"redISub works only with red numbers"),this.red.isub(this,Bt)},ot.prototype.redShl=function(Bt){return it(this.red,"redShl works only with red numbers"),this.red.shl(this,Bt)},ot.prototype.redMul=function(Bt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,Bt),this.red.mul(this,Bt)},ot.prototype.redIMul=function(Bt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,Bt),this.red.imul(this,Bt)},ot.prototype.redSqr=function(){return it(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return it(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return it(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return it(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return it(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(Bt){return it(this.red&&!Bt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Bt)};var vt={k256:null,p224:null,p192:null,p25519:null};function xt(Lt,Bt){this.name=Lt,this.p=new ot(Bt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}xt.prototype._tmp=function(){var Bt=new ot(null);return Bt.words=new Array(Math.ceil(this.n/13)),Bt},xt.prototype.ireduce=function(Bt){var Pt=Bt,kt;do this.split(Pt,this.tmp),Pt=this.imulK(Pt),Pt=Pt.iadd(this.tmp),kt=Pt.bitLength();while(kt>this.n);var At=kt0?Pt.isub(this.p):Pt.strip!==void 0?Pt.strip():Pt._strip(),Pt},xt.prototype.split=function(Bt,Pt){Bt.iushrn(this.n,0,Pt)},xt.prototype.imulK=function(Bt){return Bt.imul(this.k)};function St(){xt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}rt(St,xt),St.prototype.split=function(Bt,Pt){for(var kt=4194303,At=Math.min(Bt.length,9),Rt=0;Rt>>22,Wt=jt}Wt>>>=22,Bt.words[Rt-10]=Wt,Wt===0&&Bt.length>10?Bt.length-=10:Bt.length-=9},St.prototype.imulK=function(Bt){Bt.words[Bt.length]=0,Bt.words[Bt.length+1]=0,Bt.length+=2;for(var Pt=0,kt=0;kt>>=26,Bt.words[kt]=Rt,Pt=At}return Pt!==0&&(Bt.words[Bt.length++]=Pt),Bt},ot._prime=function(Bt){if(vt[Bt])return vt[Bt];var Pt;if(Bt==="k256")Pt=new St;else if(Bt==="p224")Pt=new Et;else if(Bt==="p192")Pt=new It;else if(Bt==="p25519")Pt=new Tt;else throw new Error("Unknown prime "+Bt);return vt[Bt]=Pt,Pt};function $t(Lt){if(typeof Lt=="string"){var Bt=ot._prime(Lt);this.m=Bt.p,this.prime=Bt}else it(Lt.gtn(1),"modulus must be greater than 1"),this.m=Lt,this.prime=null}$t.prototype._verify1=function(Bt){it(Bt.negative===0,"red works only with positives"),it(Bt.red,"red works only with red numbers")},$t.prototype._verify2=function(Bt,Pt){it((Bt.negative|Pt.negative)===0,"red works only with positives"),it(Bt.red&&Bt.red===Pt.red,"red works only with red numbers")},$t.prototype.imod=function(Bt){return this.prime?this.prime.ireduce(Bt)._forceRed(this):Bt.umod(this.m)._forceRed(this)},$t.prototype.neg=function(Bt){return Bt.isZero()?Bt.clone():this.m.sub(Bt)._forceRed(this)},$t.prototype.add=function(Bt,Pt){this._verify2(Bt,Pt);var kt=Bt.add(Pt);return kt.cmp(this.m)>=0&&kt.isub(this.m),kt._forceRed(this)},$t.prototype.iadd=function(Bt,Pt){this._verify2(Bt,Pt);var kt=Bt.iadd(Pt);return kt.cmp(this.m)>=0&&kt.isub(this.m),kt},$t.prototype.sub=function(Bt,Pt){this._verify2(Bt,Pt);var kt=Bt.sub(Pt);return kt.cmpn(0)<0&&kt.iadd(this.m),kt._forceRed(this)},$t.prototype.isub=function(Bt,Pt){this._verify2(Bt,Pt);var kt=Bt.isub(Pt);return kt.cmpn(0)<0&&kt.iadd(this.m),kt},$t.prototype.shl=function(Bt,Pt){return this._verify1(Bt),this.imod(Bt.ushln(Pt))},$t.prototype.imul=function(Bt,Pt){return this._verify2(Bt,Pt),this.imod(Bt.imul(Pt))},$t.prototype.mul=function(Bt,Pt){return this._verify2(Bt,Pt),this.imod(Bt.mul(Pt))},$t.prototype.isqr=function(Bt){return this.imul(Bt,Bt.clone())},$t.prototype.sqr=function(Bt){return this.mul(Bt,Bt)},$t.prototype.sqrt=function(Bt){if(Bt.isZero())return Bt.clone();var Pt=this.m.andln(3);if(it(Pt%2===1),Pt===3){var kt=this.m.add(new ot(1)).iushrn(2);return this.pow(Bt,kt)}for(var At=this.m.subn(1),Rt=0;!At.isZero()&&At.andln(1)===0;)Rt++,At.iushrn(1);it(!At.isZero());var Wt=new ot(1).toRed(this),jt=Wt.redNeg(),Ot=this.m.subn(1).iushrn(1),Ct=this.m.bitLength();for(Ct=new ot(2*Ct*Ct).toRed(this);this.pow(Ct,Ot).cmp(jt)!==0;)Ct.redIAdd(jt);for(var Dt=this.pow(Ct,At),Mt=this.pow(Bt,At.addn(1).iushrn(1)),Vt=this.pow(Bt,At),Qt=Rt;Vt.cmp(Wt)!==0;){for(var rn=Vt,Xt=0;rn.cmp(Wt)!==0;Xt++)rn=rn.redSqr();it(Xt=0;Rt--){for(var Dt=Pt.words[Rt],Mt=Ct-1;Mt>=0;Mt--){var Vt=Dt>>Mt&1;if(Wt!==At[0]&&(Wt=this.sqr(Wt)),Vt===0&&jt===0){Ot=0;continue}jt<<=1,jt|=Vt,Ot++,!(Ot!==kt&&(Rt!==0||Mt!==0))&&(Wt=this.mul(Wt,At[jt]),Ot=0,jt=0)}Ct=26}return Wt},$t.prototype.convertTo=function(Bt){var Pt=Bt.umod(this.m);return Pt===Bt?Pt.clone():Pt},$t.prototype.convertFrom=function(Bt){var Pt=Bt.clone();return Pt.red=null,Pt},ot.mont=function(Bt){return new Ut(Bt)};function Ut(Lt){$t.call(this,Lt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}rt(Ut,$t),Ut.prototype.convertTo=function(Bt){return this.imod(Bt.ushln(this.shift))},Ut.prototype.convertFrom=function(Bt){var Pt=this.imod(Bt.mul(this.rinv));return Pt.red=null,Pt},Ut.prototype.imul=function(Bt,Pt){if(Bt.isZero()||Pt.isZero())return Bt.words[0]=0,Bt.length=1,Bt;var kt=Bt.imul(Pt),At=kt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Rt=kt.isub(At).iushrn(this.shift),Wt=Rt;return Rt.cmp(this.m)>=0?Wt=Rt.isub(this.m):Rt.cmpn(0)<0&&(Wt=Rt.iadd(this.m)),Wt._forceRed(this)},Ut.prototype.mul=function(Bt,Pt){if(Bt.isZero()||Pt.isZero())return new ot(0)._forceRed(this);var kt=Bt.mul(Pt),At=kt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Rt=kt.isub(At).iushrn(this.shift),Wt=Rt;return Rt.cmp(this.m)>=0?Wt=Rt.isub(this.m):Rt.cmpn(0)<0&&(Wt=Rt.iadd(this.m)),Wt._forceRed(this)},Ut.prototype.invm=function(Bt){var Pt=this.imod(Bt._invmp(this.m).mul(this.r2));return Pt._forceRed(this)}})(tt,commonjsGlobal)})(bn$2);var bnExports$2=bn$2.exports,brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var tt;brorand.exports=function(rt){return tt||(tt=new et(null)),tt.generate(rt)};function et(it){this.rand=it}if(brorand.exports.Rand=et,et.prototype.generate=function(rt){return this._rand(rt)},et.prototype._rand=function(rt){if(this.rand.getBytes)return this.rand.getBytes(rt);for(var ot=new Uint8Array(rt),at=0;at=0);return st},nt.prototype._randrange=function(rt,ot){var at=ot.sub(rt);return rt.add(this._randbelow(at))},nt.prototype.test=function(rt,ot,at){var st=rt.bitLength(),lt=tt.mont(rt),ct=new tt(1).toRed(lt);ot||(ot=Math.max(1,st/48|0));for(var ut=rt.subn(1),ht=0;!ut.testn(ht);ht++);for(var dt=rt.shrn(ht),pt=ut.toRed(lt),mt=!0;ot>0;ot--){var gt=this._randrange(new tt(2),ut);at&&at(gt);var bt=gt.toRed(lt).redPow(dt);if(!(bt.cmp(ct)===0||bt.cmp(pt)===0)){for(var yt=1;yt0;ot--){var pt=this._randrange(new tt(2),ct),mt=rt.gcd(pt);if(mt.cmpn(1)!==0)return mt;var gt=pt.toRed(st).redPow(ht);if(!(gt.cmp(lt)===0||gt.cmp(dt)===0)){for(var bt=1;btyt;)vt.ishrn(1);if(vt.isEven()&&vt.iadd(ot),vt.testn(1)||vt.iadd(at),wt.cmp(at)){if(!wt.cmp(st))for(;vt.mod(lt).cmp(ct);)vt.iadd(ht)}else for(;vt.mod(nt).cmp(ut);)vt.iadd(ht);if(xt=vt.shrn(1),mt(xt)&&mt(vt)&>(xt)&>(vt)&&rt.test(xt)&&rt.test(vt))return vt}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var tt=bnExports$2,et=requireMr(),nt=new et,it=new tt(24),rt=new tt(11),ot=new tt(10),at=new tt(3),st=new tt(7),lt=requireGeneratePrime(),ct=browserExports;dh=mt;function ut(bt,yt){return yt=yt||"utf8",Buffer.isBuffer(bt)||(bt=new Buffer(bt,yt)),this._pub=new tt(bt),this}function ht(bt,yt){return yt=yt||"utf8",Buffer.isBuffer(bt)||(bt=new Buffer(bt,yt)),this._priv=new tt(bt),this}var dt={};function pt(bt,yt){var wt=yt.toString("hex"),vt=[wt,bt.toString(16)].join("_");if(vt in dt)return dt[vt];var xt=0;if(bt.isEven()||!lt.simpleSieve||!lt.fermatTest(bt)||!nt.test(bt))return xt+=1,wt==="02"||wt==="05"?xt+=8:xt+=4,dt[vt]=xt,xt;nt.test(bt.shrn(1))||(xt+=2);var St;switch(wt){case"02":bt.mod(it).cmp(rt)&&(xt+=8);break;case"05":St=bt.mod(ot),St.cmp(at)&&St.cmp(st)&&(xt+=8);break;default:xt+=4}return dt[vt]=xt,xt}function mt(bt,yt,wt){this.setGenerator(yt),this.__prime=new tt(bt),this._prime=tt.mont(this.__prime),this._primeLen=bt.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,wt?(this.setPublicKey=ut,this.setPrivateKey=ht):this._primeCode=8}Object.defineProperty(mt.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=pt(this.__prime,this.__gen)),this._primeCode}}),mt.prototype.generateKeys=function(){return this._priv||(this._priv=new tt(ct(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},mt.prototype.computeSecret=function(bt){bt=new tt(bt),bt=bt.toRed(this._prime);var yt=bt.redPow(this._priv).fromRed(),wt=new Buffer(yt.toArray()),vt=this.getPrime();if(wt.length0?kt:At},ot.min=function(kt,At){return kt.cmp(At)<0?kt:At},ot.prototype._init=function(kt,At,Rt){if(typeof kt=="number")return this._initNumber(kt,At,Rt);if(typeof kt=="object")return this._initArray(kt,At,Rt);At==="hex"&&(At=16),it(At===(At|0)&&At>=2&&At<=36),kt=kt.toString().replace(/\s+/g,"");var Wt=0;kt[0]==="-"&&(Wt++,this.negative=1),Wt=0;Wt-=3)Ot=kt[Wt]|kt[Wt-1]<<8|kt[Wt-2]<<16,this.words[jt]|=Ot<>>26-Ct&67108863,Ct+=24,Ct>=26&&(Ct-=26,jt++);else if(Rt==="le")for(Wt=0,jt=0;Wt>>26-Ct&67108863,Ct+=24,Ct>=26&&(Ct-=26,jt++);return this._strip()};function st(Pt,kt){var At=Pt.charCodeAt(kt);if(At>=48&&At<=57)return At-48;if(At>=65&&At<=70)return At-55;if(At>=97&&At<=102)return At-87;it(!1,"Invalid character in "+Pt)}function lt(Pt,kt,At){var Rt=st(Pt,At);return At-1>=kt&&(Rt|=st(Pt,At-1)<<4),Rt}ot.prototype._parseHex=function(kt,At,Rt){this.length=Math.ceil((kt.length-At)/6),this.words=new Array(this.length);for(var Wt=0;Wt=At;Wt-=2)Ct=lt(kt,At,Wt)<=18?(jt-=18,Ot+=1,this.words[Ot]|=Ct>>>26):jt+=8;else{var Dt=kt.length-At;for(Wt=Dt%2===0?At+1:At;Wt=18?(jt-=18,Ot+=1,this.words[Ot]|=Ct>>>26):jt+=8}this._strip()};function ct(Pt,kt,At,Rt){for(var Wt=0,jt=0,Ot=Math.min(Pt.length,At),Ct=kt;Ct=49?jt=Dt-49+10:Dt>=17?jt=Dt-17+10:jt=Dt,it(Dt>=0&&jt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ot.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht}catch{ot.prototype.inspect=ht}else ot.prototype.inspect=ht;function ht(){return(this.red?""}var dt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],pt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(kt,At){kt=kt||10,At=At|0||1;var Rt;if(kt===16||kt==="hex"){Rt="";for(var Wt=0,jt=0,Ot=0;Ot>>24-Wt&16777215,Wt+=2,Wt>=26&&(Wt-=26,Ot--),jt!==0||Ot!==this.length-1?Rt=dt[6-Dt.length]+Dt+Rt:Rt=Dt+Rt}for(jt!==0&&(Rt=jt.toString(16)+Rt);Rt.length%At!==0;)Rt="0"+Rt;return this.negative!==0&&(Rt="-"+Rt),Rt}if(kt===(kt|0)&&kt>=2&&kt<=36){var Mt=pt[kt],Vt=mt[kt];Rt="";var Qt=this.clone();for(Qt.negative=0;!Qt.isZero();){var rn=Qt.modrn(Vt).toString(kt);Qt=Qt.idivn(Vt),Qt.isZero()?Rt=rn+Rt:Rt=dt[Mt-rn.length]+rn+Rt}for(this.isZero()&&(Rt="0"+Rt);Rt.length%At!==0;)Rt="0"+Rt;return this.negative!==0&&(Rt="-"+Rt),Rt}it(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var kt=this.words[0];return this.length===2?kt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?kt+=4503599627370496+this.words[1]*67108864:this.length>2&&it(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-kt:kt},ot.prototype.toJSON=function(){return this.toString(16,2)},at&&(ot.prototype.toBuffer=function(kt,At){return this.toArrayLike(at,kt,At)}),ot.prototype.toArray=function(kt,At){return this.toArrayLike(Array,kt,At)};var gt=function(kt,At){return kt.allocUnsafe?kt.allocUnsafe(At):new kt(At)};ot.prototype.toArrayLike=function(kt,At,Rt){this._strip();var Wt=this.byteLength(),jt=Rt||Math.max(1,Wt);it(Wt<=jt,"byte array longer than desired length"),it(jt>0,"Requested array length <= 0");var Ot=gt(kt,jt),Ct=At==="le"?"LE":"BE";return this["_toArrayLike"+Ct](Ot,Wt),Ot},ot.prototype._toArrayLikeLE=function(kt,At){for(var Rt=0,Wt=0,jt=0,Ot=0;jt>8&255),Rt>16&255),Ot===6?(Rt>24&255),Wt=0,Ot=0):(Wt=Ct>>>24,Ot+=2)}if(Rt=0&&(kt[Rt--]=Ct>>8&255),Rt>=0&&(kt[Rt--]=Ct>>16&255),Ot===6?(Rt>=0&&(kt[Rt--]=Ct>>24&255),Wt=0,Ot=0):(Wt=Ct>>>24,Ot+=2)}if(Rt>=0)for(kt[Rt--]=Wt;Rt>=0;)kt[Rt--]=0},Math.clz32?ot.prototype._countBits=function(kt){return 32-Math.clz32(kt)}:ot.prototype._countBits=function(kt){var At=kt,Rt=0;return At>=4096&&(Rt+=13,At>>>=13),At>=64&&(Rt+=7,At>>>=7),At>=8&&(Rt+=4,At>>>=4),At>=2&&(Rt+=2,At>>>=2),Rt+At},ot.prototype._zeroBits=function(kt){if(kt===0)return 26;var At=kt,Rt=0;return At&8191||(Rt+=13,At>>>=13),At&127||(Rt+=7,At>>>=7),At&15||(Rt+=4,At>>>=4),At&3||(Rt+=2,At>>>=2),At&1||Rt++,Rt},ot.prototype.bitLength=function(){var kt=this.words[this.length-1],At=this._countBits(kt);return(this.length-1)*26+At};function bt(Pt){for(var kt=new Array(Pt.bitLength()),At=0;At>>Wt&1}return kt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var kt=0,At=0;Atkt.length?this.clone().ior(kt):kt.clone().ior(this)},ot.prototype.uor=function(kt){return this.length>kt.length?this.clone().iuor(kt):kt.clone().iuor(this)},ot.prototype.iuand=function(kt){var At;this.length>kt.length?At=kt:At=this;for(var Rt=0;Rtkt.length?this.clone().iand(kt):kt.clone().iand(this)},ot.prototype.uand=function(kt){return this.length>kt.length?this.clone().iuand(kt):kt.clone().iuand(this)},ot.prototype.iuxor=function(kt){var At,Rt;this.length>kt.length?(At=this,Rt=kt):(At=kt,Rt=this);for(var Wt=0;Wtkt.length?this.clone().ixor(kt):kt.clone().ixor(this)},ot.prototype.uxor=function(kt){return this.length>kt.length?this.clone().iuxor(kt):kt.clone().iuxor(this)},ot.prototype.inotn=function(kt){it(typeof kt=="number"&&kt>=0);var At=Math.ceil(kt/26)|0,Rt=kt%26;this._expand(At),Rt>0&&At--;for(var Wt=0;Wt0&&(this.words[Wt]=~this.words[Wt]&67108863>>26-Rt),this._strip()},ot.prototype.notn=function(kt){return this.clone().inotn(kt)},ot.prototype.setn=function(kt,At){it(typeof kt=="number"&&kt>=0);var Rt=kt/26|0,Wt=kt%26;return this._expand(Rt+1),At?this.words[Rt]=this.words[Rt]|1<kt.length?(Rt=this,Wt=kt):(Rt=kt,Wt=this);for(var jt=0,Ot=0;Ot>>26;for(;jt!==0&&Ot>>26;if(this.length=Rt.length,jt!==0)this.words[this.length]=jt,this.length++;else if(Rt!==this)for(;Otkt.length?this.clone().iadd(kt):kt.clone().iadd(this)},ot.prototype.isub=function(kt){if(kt.negative!==0){kt.negative=0;var At=this.iadd(kt);return kt.negative=1,At._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(kt),this.negative=1,this._normSign();var Rt=this.cmp(kt);if(Rt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Wt,jt;Rt>0?(Wt=this,jt=kt):(Wt=kt,jt=this);for(var Ot=0,Ct=0;Ct>26,this.words[Ct]=At&67108863;for(;Ot!==0&&Ct>26,this.words[Ct]=At&67108863;if(Ot===0&&Ct>>26,Qt=Dt&67108863,rn=Math.min(Mt,kt.length-1),Xt=Math.max(0,Mt-Pt.length+1);Xt<=rn;Xt++){var an=Mt-Xt|0;Wt=Pt.words[an]|0,jt=kt.words[Xt]|0,Ot=Wt*jt+Qt,Vt+=Ot/67108864|0,Qt=Ot&67108863}At.words[Mt]=Qt|0,Dt=Vt|0}return Dt!==0?At.words[Mt]=Dt|0:At.length--,At._strip()}var wt=function(kt,At,Rt){var Wt=kt.words,jt=At.words,Ot=Rt.words,Ct=0,Dt,Mt,Vt,Qt=Wt[0]|0,rn=Qt&8191,Xt=Qt>>>13,an=Wt[1]|0,tn=an&8191,pn=an>>>13,vn=Wt[2]|0,sn=vn&8191,Zt=vn>>>13,Sn=Wt[3]|0,Tn=Sn&8191,Cn=Sn>>>13,jn=Wt[4]|0,Un=jn&8191,yn=jn>>>13,un=Wt[5]|0,En=un&8191,In=un>>>13,xn=Wt[6]|0,dn=xn&8191,cn=xn>>>13,hn=Wt[7]|0,$n=hn&8191,nn=hn>>>13,Kt=Wt[8]|0,Yt=Kt&8191,_n=Kt>>>13,Mn=Wt[9]|0,Bn=Mn&8191,Nn=Mn>>>13,qn=jt[0]|0,Wn=qn&8191,Vn=qn>>>13,Fn=jt[1]|0,Jn=Fn&8191,Hn=Fn>>>13,dr=jt[2]|0,ur=dr&8191,_r=dr>>>13,Qr=jt[3]|0,jr=Qr&8191,Mr=Qr>>>13,qr=jt[4]|0,Ur=qr&8191,Lr=qr>>>13,ao=jt[5]|0,Gr=ao&8191,Br=ao>>>13,go=jt[6]|0,wn=go&8191,Pn=go>>>13,fn=jt[7]|0,Jt=fn&8191,kn=fn>>>13,On=jt[8]|0,Dn=On&8191,Kn=On>>>13,er=jt[9]|0,or=er&8191,ar=er>>>13;Rt.negative=kt.negative^At.negative,Rt.length=19,Dt=Math.imul(rn,Wn),Mt=Math.imul(rn,Vn),Mt=Mt+Math.imul(Xt,Wn)|0,Vt=Math.imul(Xt,Vn);var Vr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Dt=Math.imul(tn,Wn),Mt=Math.imul(tn,Vn),Mt=Mt+Math.imul(pn,Wn)|0,Vt=Math.imul(pn,Vn),Dt=Dt+Math.imul(rn,Jn)|0,Mt=Mt+Math.imul(rn,Hn)|0,Mt=Mt+Math.imul(Xt,Jn)|0,Vt=Vt+Math.imul(Xt,Hn)|0;var wr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(wr>>>26)|0,wr&=67108863,Dt=Math.imul(sn,Wn),Mt=Math.imul(sn,Vn),Mt=Mt+Math.imul(Zt,Wn)|0,Vt=Math.imul(Zt,Vn),Dt=Dt+Math.imul(tn,Jn)|0,Mt=Mt+Math.imul(tn,Hn)|0,Mt=Mt+Math.imul(pn,Jn)|0,Vt=Vt+Math.imul(pn,Hn)|0,Dt=Dt+Math.imul(rn,ur)|0,Mt=Mt+Math.imul(rn,_r)|0,Mt=Mt+Math.imul(Xt,ur)|0,Vt=Vt+Math.imul(Xt,_r)|0;var Or=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Or>>>26)|0,Or&=67108863,Dt=Math.imul(Tn,Wn),Mt=Math.imul(Tn,Vn),Mt=Mt+Math.imul(Cn,Wn)|0,Vt=Math.imul(Cn,Vn),Dt=Dt+Math.imul(sn,Jn)|0,Mt=Mt+Math.imul(sn,Hn)|0,Mt=Mt+Math.imul(Zt,Jn)|0,Vt=Vt+Math.imul(Zt,Hn)|0,Dt=Dt+Math.imul(tn,ur)|0,Mt=Mt+Math.imul(tn,_r)|0,Mt=Mt+Math.imul(pn,ur)|0,Vt=Vt+Math.imul(pn,_r)|0,Dt=Dt+Math.imul(rn,jr)|0,Mt=Mt+Math.imul(rn,Mr)|0,Mt=Mt+Math.imul(Xt,jr)|0,Vt=Vt+Math.imul(Xt,Mr)|0;var Hr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Dt=Math.imul(Un,Wn),Mt=Math.imul(Un,Vn),Mt=Mt+Math.imul(yn,Wn)|0,Vt=Math.imul(yn,Vn),Dt=Dt+Math.imul(Tn,Jn)|0,Mt=Mt+Math.imul(Tn,Hn)|0,Mt=Mt+Math.imul(Cn,Jn)|0,Vt=Vt+Math.imul(Cn,Hn)|0,Dt=Dt+Math.imul(sn,ur)|0,Mt=Mt+Math.imul(sn,_r)|0,Mt=Mt+Math.imul(Zt,ur)|0,Vt=Vt+Math.imul(Zt,_r)|0,Dt=Dt+Math.imul(tn,jr)|0,Mt=Mt+Math.imul(tn,Mr)|0,Mt=Mt+Math.imul(pn,jr)|0,Vt=Vt+Math.imul(pn,Mr)|0,Dt=Dt+Math.imul(rn,Ur)|0,Mt=Mt+Math.imul(rn,Lr)|0,Mt=Mt+Math.imul(Xt,Ur)|0,Vt=Vt+Math.imul(Xt,Lr)|0;var no=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(no>>>26)|0,no&=67108863,Dt=Math.imul(En,Wn),Mt=Math.imul(En,Vn),Mt=Mt+Math.imul(In,Wn)|0,Vt=Math.imul(In,Vn),Dt=Dt+Math.imul(Un,Jn)|0,Mt=Mt+Math.imul(Un,Hn)|0,Mt=Mt+Math.imul(yn,Jn)|0,Vt=Vt+Math.imul(yn,Hn)|0,Dt=Dt+Math.imul(Tn,ur)|0,Mt=Mt+Math.imul(Tn,_r)|0,Mt=Mt+Math.imul(Cn,ur)|0,Vt=Vt+Math.imul(Cn,_r)|0,Dt=Dt+Math.imul(sn,jr)|0,Mt=Mt+Math.imul(sn,Mr)|0,Mt=Mt+Math.imul(Zt,jr)|0,Vt=Vt+Math.imul(Zt,Mr)|0,Dt=Dt+Math.imul(tn,Ur)|0,Mt=Mt+Math.imul(tn,Lr)|0,Mt=Mt+Math.imul(pn,Ur)|0,Vt=Vt+Math.imul(pn,Lr)|0,Dt=Dt+Math.imul(rn,Gr)|0,Mt=Mt+Math.imul(rn,Br)|0,Mt=Mt+Math.imul(Xt,Gr)|0,Vt=Vt+Math.imul(Xt,Br)|0;var Xr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,Dt=Math.imul(dn,Wn),Mt=Math.imul(dn,Vn),Mt=Mt+Math.imul(cn,Wn)|0,Vt=Math.imul(cn,Vn),Dt=Dt+Math.imul(En,Jn)|0,Mt=Mt+Math.imul(En,Hn)|0,Mt=Mt+Math.imul(In,Jn)|0,Vt=Vt+Math.imul(In,Hn)|0,Dt=Dt+Math.imul(Un,ur)|0,Mt=Mt+Math.imul(Un,_r)|0,Mt=Mt+Math.imul(yn,ur)|0,Vt=Vt+Math.imul(yn,_r)|0,Dt=Dt+Math.imul(Tn,jr)|0,Mt=Mt+Math.imul(Tn,Mr)|0,Mt=Mt+Math.imul(Cn,jr)|0,Vt=Vt+Math.imul(Cn,Mr)|0,Dt=Dt+Math.imul(sn,Ur)|0,Mt=Mt+Math.imul(sn,Lr)|0,Mt=Mt+Math.imul(Zt,Ur)|0,Vt=Vt+Math.imul(Zt,Lr)|0,Dt=Dt+Math.imul(tn,Gr)|0,Mt=Mt+Math.imul(tn,Br)|0,Mt=Mt+Math.imul(pn,Gr)|0,Vt=Vt+Math.imul(pn,Br)|0,Dt=Dt+Math.imul(rn,wn)|0,Mt=Mt+Math.imul(rn,Pn)|0,Mt=Mt+Math.imul(Xt,wn)|0,Vt=Vt+Math.imul(Xt,Pn)|0;var Jr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Dt=Math.imul($n,Wn),Mt=Math.imul($n,Vn),Mt=Mt+Math.imul(nn,Wn)|0,Vt=Math.imul(nn,Vn),Dt=Dt+Math.imul(dn,Jn)|0,Mt=Mt+Math.imul(dn,Hn)|0,Mt=Mt+Math.imul(cn,Jn)|0,Vt=Vt+Math.imul(cn,Hn)|0,Dt=Dt+Math.imul(En,ur)|0,Mt=Mt+Math.imul(En,_r)|0,Mt=Mt+Math.imul(In,ur)|0,Vt=Vt+Math.imul(In,_r)|0,Dt=Dt+Math.imul(Un,jr)|0,Mt=Mt+Math.imul(Un,Mr)|0,Mt=Mt+Math.imul(yn,jr)|0,Vt=Vt+Math.imul(yn,Mr)|0,Dt=Dt+Math.imul(Tn,Ur)|0,Mt=Mt+Math.imul(Tn,Lr)|0,Mt=Mt+Math.imul(Cn,Ur)|0,Vt=Vt+Math.imul(Cn,Lr)|0,Dt=Dt+Math.imul(sn,Gr)|0,Mt=Mt+Math.imul(sn,Br)|0,Mt=Mt+Math.imul(Zt,Gr)|0,Vt=Vt+Math.imul(Zt,Br)|0,Dt=Dt+Math.imul(tn,wn)|0,Mt=Mt+Math.imul(tn,Pn)|0,Mt=Mt+Math.imul(pn,wn)|0,Vt=Vt+Math.imul(pn,Pn)|0,Dt=Dt+Math.imul(rn,Jt)|0,Mt=Mt+Math.imul(rn,kn)|0,Mt=Mt+Math.imul(Xt,Jt)|0,Vt=Vt+Math.imul(Xt,kn)|0;var br=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(br>>>26)|0,br&=67108863,Dt=Math.imul(Yt,Wn),Mt=Math.imul(Yt,Vn),Mt=Mt+Math.imul(_n,Wn)|0,Vt=Math.imul(_n,Vn),Dt=Dt+Math.imul($n,Jn)|0,Mt=Mt+Math.imul($n,Hn)|0,Mt=Mt+Math.imul(nn,Jn)|0,Vt=Vt+Math.imul(nn,Hn)|0,Dt=Dt+Math.imul(dn,ur)|0,Mt=Mt+Math.imul(dn,_r)|0,Mt=Mt+Math.imul(cn,ur)|0,Vt=Vt+Math.imul(cn,_r)|0,Dt=Dt+Math.imul(En,jr)|0,Mt=Mt+Math.imul(En,Mr)|0,Mt=Mt+Math.imul(In,jr)|0,Vt=Vt+Math.imul(In,Mr)|0,Dt=Dt+Math.imul(Un,Ur)|0,Mt=Mt+Math.imul(Un,Lr)|0,Mt=Mt+Math.imul(yn,Ur)|0,Vt=Vt+Math.imul(yn,Lr)|0,Dt=Dt+Math.imul(Tn,Gr)|0,Mt=Mt+Math.imul(Tn,Br)|0,Mt=Mt+Math.imul(Cn,Gr)|0,Vt=Vt+Math.imul(Cn,Br)|0,Dt=Dt+Math.imul(sn,wn)|0,Mt=Mt+Math.imul(sn,Pn)|0,Mt=Mt+Math.imul(Zt,wn)|0,Vt=Vt+Math.imul(Zt,Pn)|0,Dt=Dt+Math.imul(tn,Jt)|0,Mt=Mt+Math.imul(tn,kn)|0,Mt=Mt+Math.imul(pn,Jt)|0,Vt=Vt+Math.imul(pn,kn)|0,Dt=Dt+Math.imul(rn,Dn)|0,Mt=Mt+Math.imul(rn,Kn)|0,Mt=Mt+Math.imul(Xt,Dn)|0,Vt=Vt+Math.imul(Xt,Kn)|0;var $r=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+($r>>>26)|0,$r&=67108863,Dt=Math.imul(Bn,Wn),Mt=Math.imul(Bn,Vn),Mt=Mt+Math.imul(Nn,Wn)|0,Vt=Math.imul(Nn,Vn),Dt=Dt+Math.imul(Yt,Jn)|0,Mt=Mt+Math.imul(Yt,Hn)|0,Mt=Mt+Math.imul(_n,Jn)|0,Vt=Vt+Math.imul(_n,Hn)|0,Dt=Dt+Math.imul($n,ur)|0,Mt=Mt+Math.imul($n,_r)|0,Mt=Mt+Math.imul(nn,ur)|0,Vt=Vt+Math.imul(nn,_r)|0,Dt=Dt+Math.imul(dn,jr)|0,Mt=Mt+Math.imul(dn,Mr)|0,Mt=Mt+Math.imul(cn,jr)|0,Vt=Vt+Math.imul(cn,Mr)|0,Dt=Dt+Math.imul(En,Ur)|0,Mt=Mt+Math.imul(En,Lr)|0,Mt=Mt+Math.imul(In,Ur)|0,Vt=Vt+Math.imul(In,Lr)|0,Dt=Dt+Math.imul(Un,Gr)|0,Mt=Mt+Math.imul(Un,Br)|0,Mt=Mt+Math.imul(yn,Gr)|0,Vt=Vt+Math.imul(yn,Br)|0,Dt=Dt+Math.imul(Tn,wn)|0,Mt=Mt+Math.imul(Tn,Pn)|0,Mt=Mt+Math.imul(Cn,wn)|0,Vt=Vt+Math.imul(Cn,Pn)|0,Dt=Dt+Math.imul(sn,Jt)|0,Mt=Mt+Math.imul(sn,kn)|0,Mt=Mt+Math.imul(Zt,Jt)|0,Vt=Vt+Math.imul(Zt,kn)|0,Dt=Dt+Math.imul(tn,Dn)|0,Mt=Mt+Math.imul(tn,Kn)|0,Mt=Mt+Math.imul(pn,Dn)|0,Vt=Vt+Math.imul(pn,Kn)|0,Dt=Dt+Math.imul(rn,or)|0,Mt=Mt+Math.imul(rn,ar)|0,Mt=Mt+Math.imul(Xt,or)|0,Vt=Vt+Math.imul(Xt,ar)|0;var Dr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Dt=Math.imul(Bn,Jn),Mt=Math.imul(Bn,Hn),Mt=Mt+Math.imul(Nn,Jn)|0,Vt=Math.imul(Nn,Hn),Dt=Dt+Math.imul(Yt,ur)|0,Mt=Mt+Math.imul(Yt,_r)|0,Mt=Mt+Math.imul(_n,ur)|0,Vt=Vt+Math.imul(_n,_r)|0,Dt=Dt+Math.imul($n,jr)|0,Mt=Mt+Math.imul($n,Mr)|0,Mt=Mt+Math.imul(nn,jr)|0,Vt=Vt+Math.imul(nn,Mr)|0,Dt=Dt+Math.imul(dn,Ur)|0,Mt=Mt+Math.imul(dn,Lr)|0,Mt=Mt+Math.imul(cn,Ur)|0,Vt=Vt+Math.imul(cn,Lr)|0,Dt=Dt+Math.imul(En,Gr)|0,Mt=Mt+Math.imul(En,Br)|0,Mt=Mt+Math.imul(In,Gr)|0,Vt=Vt+Math.imul(In,Br)|0,Dt=Dt+Math.imul(Un,wn)|0,Mt=Mt+Math.imul(Un,Pn)|0,Mt=Mt+Math.imul(yn,wn)|0,Vt=Vt+Math.imul(yn,Pn)|0,Dt=Dt+Math.imul(Tn,Jt)|0,Mt=Mt+Math.imul(Tn,kn)|0,Mt=Mt+Math.imul(Cn,Jt)|0,Vt=Vt+Math.imul(Cn,kn)|0,Dt=Dt+Math.imul(sn,Dn)|0,Mt=Mt+Math.imul(sn,Kn)|0,Mt=Mt+Math.imul(Zt,Dn)|0,Vt=Vt+Math.imul(Zt,Kn)|0,Dt=Dt+Math.imul(tn,or)|0,Mt=Mt+Math.imul(tn,ar)|0,Mt=Mt+Math.imul(pn,or)|0,Vt=Vt+Math.imul(pn,ar)|0;var Cr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Dt=Math.imul(Bn,ur),Mt=Math.imul(Bn,_r),Mt=Mt+Math.imul(Nn,ur)|0,Vt=Math.imul(Nn,_r),Dt=Dt+Math.imul(Yt,jr)|0,Mt=Mt+Math.imul(Yt,Mr)|0,Mt=Mt+Math.imul(_n,jr)|0,Vt=Vt+Math.imul(_n,Mr)|0,Dt=Dt+Math.imul($n,Ur)|0,Mt=Mt+Math.imul($n,Lr)|0,Mt=Mt+Math.imul(nn,Ur)|0,Vt=Vt+Math.imul(nn,Lr)|0,Dt=Dt+Math.imul(dn,Gr)|0,Mt=Mt+Math.imul(dn,Br)|0,Mt=Mt+Math.imul(cn,Gr)|0,Vt=Vt+Math.imul(cn,Br)|0,Dt=Dt+Math.imul(En,wn)|0,Mt=Mt+Math.imul(En,Pn)|0,Mt=Mt+Math.imul(In,wn)|0,Vt=Vt+Math.imul(In,Pn)|0,Dt=Dt+Math.imul(Un,Jt)|0,Mt=Mt+Math.imul(Un,kn)|0,Mt=Mt+Math.imul(yn,Jt)|0,Vt=Vt+Math.imul(yn,kn)|0,Dt=Dt+Math.imul(Tn,Dn)|0,Mt=Mt+Math.imul(Tn,Kn)|0,Mt=Mt+Math.imul(Cn,Dn)|0,Vt=Vt+Math.imul(Cn,Kn)|0,Dt=Dt+Math.imul(sn,or)|0,Mt=Mt+Math.imul(sn,ar)|0,Mt=Mt+Math.imul(Zt,or)|0,Vt=Vt+Math.imul(Zt,ar)|0;var Ar=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,Dt=Math.imul(Bn,jr),Mt=Math.imul(Bn,Mr),Mt=Mt+Math.imul(Nn,jr)|0,Vt=Math.imul(Nn,Mr),Dt=Dt+Math.imul(Yt,Ur)|0,Mt=Mt+Math.imul(Yt,Lr)|0,Mt=Mt+Math.imul(_n,Ur)|0,Vt=Vt+Math.imul(_n,Lr)|0,Dt=Dt+Math.imul($n,Gr)|0,Mt=Mt+Math.imul($n,Br)|0,Mt=Mt+Math.imul(nn,Gr)|0,Vt=Vt+Math.imul(nn,Br)|0,Dt=Dt+Math.imul(dn,wn)|0,Mt=Mt+Math.imul(dn,Pn)|0,Mt=Mt+Math.imul(cn,wn)|0,Vt=Vt+Math.imul(cn,Pn)|0,Dt=Dt+Math.imul(En,Jt)|0,Mt=Mt+Math.imul(En,kn)|0,Mt=Mt+Math.imul(In,Jt)|0,Vt=Vt+Math.imul(In,kn)|0,Dt=Dt+Math.imul(Un,Dn)|0,Mt=Mt+Math.imul(Un,Kn)|0,Mt=Mt+Math.imul(yn,Dn)|0,Vt=Vt+Math.imul(yn,Kn)|0,Dt=Dt+Math.imul(Tn,or)|0,Mt=Mt+Math.imul(Tn,ar)|0,Mt=Mt+Math.imul(Cn,or)|0,Vt=Vt+Math.imul(Cn,ar)|0;var Nr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Dt=Math.imul(Bn,Ur),Mt=Math.imul(Bn,Lr),Mt=Mt+Math.imul(Nn,Ur)|0,Vt=Math.imul(Nn,Lr),Dt=Dt+Math.imul(Yt,Gr)|0,Mt=Mt+Math.imul(Yt,Br)|0,Mt=Mt+Math.imul(_n,Gr)|0,Vt=Vt+Math.imul(_n,Br)|0,Dt=Dt+Math.imul($n,wn)|0,Mt=Mt+Math.imul($n,Pn)|0,Mt=Mt+Math.imul(nn,wn)|0,Vt=Vt+Math.imul(nn,Pn)|0,Dt=Dt+Math.imul(dn,Jt)|0,Mt=Mt+Math.imul(dn,kn)|0,Mt=Mt+Math.imul(cn,Jt)|0,Vt=Vt+Math.imul(cn,kn)|0,Dt=Dt+Math.imul(En,Dn)|0,Mt=Mt+Math.imul(En,Kn)|0,Mt=Mt+Math.imul(In,Dn)|0,Vt=Vt+Math.imul(In,Kn)|0,Dt=Dt+Math.imul(Un,or)|0,Mt=Mt+Math.imul(Un,ar)|0,Mt=Mt+Math.imul(yn,or)|0,Vt=Vt+Math.imul(yn,ar)|0;var Fr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Dt=Math.imul(Bn,Gr),Mt=Math.imul(Bn,Br),Mt=Mt+Math.imul(Nn,Gr)|0,Vt=Math.imul(Nn,Br),Dt=Dt+Math.imul(Yt,wn)|0,Mt=Mt+Math.imul(Yt,Pn)|0,Mt=Mt+Math.imul(_n,wn)|0,Vt=Vt+Math.imul(_n,Pn)|0,Dt=Dt+Math.imul($n,Jt)|0,Mt=Mt+Math.imul($n,kn)|0,Mt=Mt+Math.imul(nn,Jt)|0,Vt=Vt+Math.imul(nn,kn)|0,Dt=Dt+Math.imul(dn,Dn)|0,Mt=Mt+Math.imul(dn,Kn)|0,Mt=Mt+Math.imul(cn,Dn)|0,Vt=Vt+Math.imul(cn,Kn)|0,Dt=Dt+Math.imul(En,or)|0,Mt=Mt+Math.imul(En,ar)|0,Mt=Mt+Math.imul(In,or)|0,Vt=Vt+Math.imul(In,ar)|0;var Pr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Dt=Math.imul(Bn,wn),Mt=Math.imul(Bn,Pn),Mt=Mt+Math.imul(Nn,wn)|0,Vt=Math.imul(Nn,Pn),Dt=Dt+Math.imul(Yt,Jt)|0,Mt=Mt+Math.imul(Yt,kn)|0,Mt=Mt+Math.imul(_n,Jt)|0,Vt=Vt+Math.imul(_n,kn)|0,Dt=Dt+Math.imul($n,Dn)|0,Mt=Mt+Math.imul($n,Kn)|0,Mt=Mt+Math.imul(nn,Dn)|0,Vt=Vt+Math.imul(nn,Kn)|0,Dt=Dt+Math.imul(dn,or)|0,Mt=Mt+Math.imul(dn,ar)|0,Mt=Mt+Math.imul(cn,or)|0,Vt=Vt+Math.imul(cn,ar)|0;var _i=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(_i>>>26)|0,_i&=67108863,Dt=Math.imul(Bn,Jt),Mt=Math.imul(Bn,kn),Mt=Mt+Math.imul(Nn,Jt)|0,Vt=Math.imul(Nn,kn),Dt=Dt+Math.imul(Yt,Dn)|0,Mt=Mt+Math.imul(Yt,Kn)|0,Mt=Mt+Math.imul(_n,Dn)|0,Vt=Vt+Math.imul(_n,Kn)|0,Dt=Dt+Math.imul($n,or)|0,Mt=Mt+Math.imul($n,ar)|0,Mt=Mt+Math.imul(nn,or)|0,Vt=Vt+Math.imul(nn,ar)|0;var nr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(nr>>>26)|0,nr&=67108863,Dt=Math.imul(Bn,Dn),Mt=Math.imul(Bn,Kn),Mt=Mt+Math.imul(Nn,Dn)|0,Vt=Math.imul(Nn,Kn),Dt=Dt+Math.imul(Yt,or)|0,Mt=Mt+Math.imul(Yt,ar)|0,Mt=Mt+Math.imul(_n,or)|0,Vt=Vt+Math.imul(_n,ar)|0;var xr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(xr>>>26)|0,xr&=67108863,Dt=Math.imul(Bn,or),Mt=Math.imul(Bn,ar),Mt=Mt+Math.imul(Nn,or)|0,Vt=Math.imul(Nn,ar);var cr=(Ct+Dt|0)+((Mt&8191)<<13)|0;return Ct=(Vt+(Mt>>>13)|0)+(cr>>>26)|0,cr&=67108863,Ot[0]=Vr,Ot[1]=wr,Ot[2]=Or,Ot[3]=Hr,Ot[4]=no,Ot[5]=Xr,Ot[6]=Jr,Ot[7]=br,Ot[8]=$r,Ot[9]=Dr,Ot[10]=Cr,Ot[11]=Ar,Ot[12]=Nr,Ot[13]=Fr,Ot[14]=Pr,Ot[15]=_i,Ot[16]=nr,Ot[17]=xr,Ot[18]=cr,Ct!==0&&(Ot[19]=Ct,Rt.length++),Rt};Math.imul||(wt=yt);function vt(Pt,kt,At){At.negative=kt.negative^Pt.negative,At.length=Pt.length+kt.length;for(var Rt=0,Wt=0,jt=0;jt>>26)|0,Wt+=Ot>>>26,Ot&=67108863}At.words[jt]=Ct,Rt=Ot,Ot=Wt}return Rt!==0?At.words[jt]=Rt:At.length--,At._strip()}function xt(Pt,kt,At){return vt(Pt,kt,At)}ot.prototype.mulTo=function(kt,At){var Rt,Wt=this.length+kt.length;return this.length===10&&kt.length===10?Rt=wt(this,kt,At):Wt<63?Rt=yt(this,kt,At):Wt<1024?Rt=vt(this,kt,At):Rt=xt(this,kt,At),Rt},ot.prototype.mul=function(kt){var At=new ot(null);return At.words=new Array(this.length+kt.length),this.mulTo(kt,At)},ot.prototype.mulf=function(kt){var At=new ot(null);return At.words=new Array(this.length+kt.length),xt(this,kt,At)},ot.prototype.imul=function(kt){return this.clone().mulTo(kt,this)},ot.prototype.imuln=function(kt){var At=kt<0;At&&(kt=-kt),it(typeof kt=="number"),it(kt<67108864);for(var Rt=0,Wt=0;Wt>=26,Rt+=jt/67108864|0,Rt+=Ot>>>26,this.words[Wt]=Ot&67108863}return Rt!==0&&(this.words[Wt]=Rt,this.length++),At?this.ineg():this},ot.prototype.muln=function(kt){return this.clone().imuln(kt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(kt){var At=bt(kt);if(At.length===0)return new ot(1);for(var Rt=this,Wt=0;Wt=0);var At=kt%26,Rt=(kt-At)/26,Wt=67108863>>>26-At<<26-At,jt;if(At!==0){var Ot=0;for(jt=0;jt>>26-At}Ot&&(this.words[jt]=Ot,this.length++)}if(Rt!==0){for(jt=this.length-1;jt>=0;jt--)this.words[jt+Rt]=this.words[jt];for(jt=0;jt=0);var Wt;At?Wt=(At-At%26)/26:Wt=0;var jt=kt%26,Ot=Math.min((kt-jt)/26,this.length),Ct=67108863^67108863>>>jt<Ot)for(this.length-=Ot,Mt=0;Mt=0&&(Vt!==0||Mt>=Wt);Mt--){var Qt=this.words[Mt]|0;this.words[Mt]=Vt<<26-jt|Qt>>>jt,Vt=Qt&Ct}return Dt&&Vt!==0&&(Dt.words[Dt.length++]=Vt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ot.prototype.ishrn=function(kt,At,Rt){return it(this.negative===0),this.iushrn(kt,At,Rt)},ot.prototype.shln=function(kt){return this.clone().ishln(kt)},ot.prototype.ushln=function(kt){return this.clone().iushln(kt)},ot.prototype.shrn=function(kt){return this.clone().ishrn(kt)},ot.prototype.ushrn=function(kt){return this.clone().iushrn(kt)},ot.prototype.testn=function(kt){it(typeof kt=="number"&&kt>=0);var At=kt%26,Rt=(kt-At)/26,Wt=1<=0);var At=kt%26,Rt=(kt-At)/26;if(it(this.negative===0,"imaskn works only with positive numbers"),this.length<=Rt)return this;if(At!==0&&Rt++,this.length=Math.min(Rt,this.length),At!==0){var Wt=67108863^67108863>>>At<=67108864;At++)this.words[At]-=67108864,At===this.length-1?this.words[At+1]=1:this.words[At+1]++;return this.length=Math.max(this.length,At+1),this},ot.prototype.isubn=function(kt){if(it(typeof kt=="number"),it(kt<67108864),kt<0)return this.iaddn(-kt);if(this.negative!==0)return this.negative=0,this.iaddn(kt),this.negative=1,this;if(this.words[0]-=kt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var At=0;At>26)-(Dt/67108864|0),this.words[jt+Rt]=Ot&67108863}for(;jt>26,this.words[jt+Rt]=Ot&67108863;if(Ct===0)return this._strip();for(it(Ct===-1),Ct=0,jt=0;jt>26,this.words[jt]=Ot&67108863;return this.negative=1,this._strip()},ot.prototype._wordDiv=function(kt,At){var Rt=this.length-kt.length,Wt=this.clone(),jt=kt,Ot=jt.words[jt.length-1]|0,Ct=this._countBits(Ot);Rt=26-Ct,Rt!==0&&(jt=jt.ushln(Rt),Wt.iushln(Rt),Ot=jt.words[jt.length-1]|0);var Dt=Wt.length-jt.length,Mt;if(At!=="mod"){Mt=new ot(null),Mt.length=Dt+1,Mt.words=new Array(Mt.length);for(var Vt=0;Vt=0;rn--){var Xt=(Wt.words[jt.length+rn]|0)*67108864+(Wt.words[jt.length+rn-1]|0);for(Xt=Math.min(Xt/Ot|0,67108863),Wt._ishlnsubmul(jt,Xt,rn);Wt.negative!==0;)Xt--,Wt.negative=0,Wt._ishlnsubmul(jt,1,rn),Wt.isZero()||(Wt.negative^=1);Mt&&(Mt.words[rn]=Xt)}return Mt&&Mt._strip(),Wt._strip(),At!=="div"&&Rt!==0&&Wt.iushrn(Rt),{div:Mt||null,mod:Wt}},ot.prototype.divmod=function(kt,At,Rt){if(it(!kt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Wt,jt,Ot;return this.negative!==0&&kt.negative===0?(Ot=this.neg().divmod(kt,At),At!=="mod"&&(Wt=Ot.div.neg()),At!=="div"&&(jt=Ot.mod.neg(),Rt&&jt.negative!==0&&jt.iadd(kt)),{div:Wt,mod:jt}):this.negative===0&&kt.negative!==0?(Ot=this.divmod(kt.neg(),At),At!=="mod"&&(Wt=Ot.div.neg()),{div:Wt,mod:Ot.mod}):this.negative&kt.negative?(Ot=this.neg().divmod(kt.neg(),At),At!=="div"&&(jt=Ot.mod.neg(),Rt&&jt.negative!==0&&jt.isub(kt)),{div:Ot.div,mod:jt}):kt.length>this.length||this.cmp(kt)<0?{div:new ot(0),mod:this}:kt.length===1?At==="div"?{div:this.divn(kt.words[0]),mod:null}:At==="mod"?{div:null,mod:new ot(this.modrn(kt.words[0]))}:{div:this.divn(kt.words[0]),mod:new ot(this.modrn(kt.words[0]))}:this._wordDiv(kt,At)},ot.prototype.div=function(kt){return this.divmod(kt,"div",!1).div},ot.prototype.mod=function(kt){return this.divmod(kt,"mod",!1).mod},ot.prototype.umod=function(kt){return this.divmod(kt,"mod",!0).mod},ot.prototype.divRound=function(kt){var At=this.divmod(kt);if(At.mod.isZero())return At.div;var Rt=At.div.negative!==0?At.mod.isub(kt):At.mod,Wt=kt.ushrn(1),jt=kt.andln(1),Ot=Rt.cmp(Wt);return Ot<0||jt===1&&Ot===0?At.div:At.div.negative!==0?At.div.isubn(1):At.div.iaddn(1)},ot.prototype.modrn=function(kt){var At=kt<0;At&&(kt=-kt),it(kt<=67108863);for(var Rt=(1<<26)%kt,Wt=0,jt=this.length-1;jt>=0;jt--)Wt=(Rt*Wt+(this.words[jt]|0))%kt;return At?-Wt:Wt},ot.prototype.modn=function(kt){return this.modrn(kt)},ot.prototype.idivn=function(kt){var At=kt<0;At&&(kt=-kt),it(kt<=67108863);for(var Rt=0,Wt=this.length-1;Wt>=0;Wt--){var jt=(this.words[Wt]|0)+Rt*67108864;this.words[Wt]=jt/kt|0,Rt=jt%kt}return this._strip(),At?this.ineg():this},ot.prototype.divn=function(kt){return this.clone().idivn(kt)},ot.prototype.egcd=function(kt){it(kt.negative===0),it(!kt.isZero());var At=this,Rt=kt.clone();At.negative!==0?At=At.umod(kt):At=At.clone();for(var Wt=new ot(1),jt=new ot(0),Ot=new ot(0),Ct=new ot(1),Dt=0;At.isEven()&&Rt.isEven();)At.iushrn(1),Rt.iushrn(1),++Dt;for(var Mt=Rt.clone(),Vt=At.clone();!At.isZero();){for(var Qt=0,rn=1;!(At.words[0]&rn)&&Qt<26;++Qt,rn<<=1);if(Qt>0)for(At.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||jt.isOdd())&&(Wt.iadd(Mt),jt.isub(Vt)),Wt.iushrn(1),jt.iushrn(1);for(var Xt=0,an=1;!(Rt.words[0]&an)&&Xt<26;++Xt,an<<=1);if(Xt>0)for(Rt.iushrn(Xt);Xt-- >0;)(Ot.isOdd()||Ct.isOdd())&&(Ot.iadd(Mt),Ct.isub(Vt)),Ot.iushrn(1),Ct.iushrn(1);At.cmp(Rt)>=0?(At.isub(Rt),Wt.isub(Ot),jt.isub(Ct)):(Rt.isub(At),Ot.isub(Wt),Ct.isub(jt))}return{a:Ot,b:Ct,gcd:Rt.iushln(Dt)}},ot.prototype._invmp=function(kt){it(kt.negative===0),it(!kt.isZero());var At=this,Rt=kt.clone();At.negative!==0?At=At.umod(kt):At=At.clone();for(var Wt=new ot(1),jt=new ot(0),Ot=Rt.clone();At.cmpn(1)>0&&Rt.cmpn(1)>0;){for(var Ct=0,Dt=1;!(At.words[0]&Dt)&&Ct<26;++Ct,Dt<<=1);if(Ct>0)for(At.iushrn(Ct);Ct-- >0;)Wt.isOdd()&&Wt.iadd(Ot),Wt.iushrn(1);for(var Mt=0,Vt=1;!(Rt.words[0]&Vt)&&Mt<26;++Mt,Vt<<=1);if(Mt>0)for(Rt.iushrn(Mt);Mt-- >0;)jt.isOdd()&&jt.iadd(Ot),jt.iushrn(1);At.cmp(Rt)>=0?(At.isub(Rt),Wt.isub(jt)):(Rt.isub(At),jt.isub(Wt))}var Qt;return At.cmpn(1)===0?Qt=Wt:Qt=jt,Qt.cmpn(0)<0&&Qt.iadd(kt),Qt},ot.prototype.gcd=function(kt){if(this.isZero())return kt.abs();if(kt.isZero())return this.abs();var At=this.clone(),Rt=kt.clone();At.negative=0,Rt.negative=0;for(var Wt=0;At.isEven()&&Rt.isEven();Wt++)At.iushrn(1),Rt.iushrn(1);do{for(;At.isEven();)At.iushrn(1);for(;Rt.isEven();)Rt.iushrn(1);var jt=At.cmp(Rt);if(jt<0){var Ot=At;At=Rt,Rt=Ot}else if(jt===0||Rt.cmpn(1)===0)break;At.isub(Rt)}while(!0);return Rt.iushln(Wt)},ot.prototype.invm=function(kt){return this.egcd(kt).a.umod(kt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(kt){return this.words[0]&kt},ot.prototype.bincn=function(kt){it(typeof kt=="number");var At=kt%26,Rt=(kt-At)/26,Wt=1<>>26,Ct&=67108863,this.words[Ot]=Ct}return jt!==0&&(this.words[Ot]=jt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(kt){var At=kt<0;if(this.negative!==0&&!At)return-1;if(this.negative===0&&At)return 1;this._strip();var Rt;if(this.length>1)Rt=1;else{At&&(kt=-kt),it(kt<=67108863,"Number is too big");var Wt=this.words[0]|0;Rt=Wt===kt?0:Wtkt.length)return 1;if(this.length=0;Rt--){var Wt=this.words[Rt]|0,jt=kt.words[Rt]|0;if(Wt!==jt){Wtjt&&(At=1);break}}return At},ot.prototype.gtn=function(kt){return this.cmpn(kt)===1},ot.prototype.gt=function(kt){return this.cmp(kt)===1},ot.prototype.gten=function(kt){return this.cmpn(kt)>=0},ot.prototype.gte=function(kt){return this.cmp(kt)>=0},ot.prototype.ltn=function(kt){return this.cmpn(kt)===-1},ot.prototype.lt=function(kt){return this.cmp(kt)===-1},ot.prototype.lten=function(kt){return this.cmpn(kt)<=0},ot.prototype.lte=function(kt){return this.cmp(kt)<=0},ot.prototype.eqn=function(kt){return this.cmpn(kt)===0},ot.prototype.eq=function(kt){return this.cmp(kt)===0},ot.red=function(kt){return new Lt(kt)},ot.prototype.toRed=function(kt){return it(!this.red,"Already a number in reduction context"),it(this.negative===0,"red works only with positives"),kt.convertTo(this)._forceRed(kt)},ot.prototype.fromRed=function(){return it(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(kt){return this.red=kt,this},ot.prototype.forceRed=function(kt){return it(!this.red,"Already a number in reduction context"),this._forceRed(kt)},ot.prototype.redAdd=function(kt){return it(this.red,"redAdd works only with red numbers"),this.red.add(this,kt)},ot.prototype.redIAdd=function(kt){return it(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,kt)},ot.prototype.redSub=function(kt){return it(this.red,"redSub works only with red numbers"),this.red.sub(this,kt)},ot.prototype.redISub=function(kt){return it(this.red,"redISub works only with red numbers"),this.red.isub(this,kt)},ot.prototype.redShl=function(kt){return it(this.red,"redShl works only with red numbers"),this.red.shl(this,kt)},ot.prototype.redMul=function(kt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,kt),this.red.mul(this,kt)},ot.prototype.redIMul=function(kt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,kt),this.red.imul(this,kt)},ot.prototype.redSqr=function(){return it(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return it(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return it(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return it(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return it(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(kt){return it(this.red&&!kt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,kt)};var St={k256:null,p224:null,p192:null,p25519:null};function Et(Pt,kt){this.name=Pt,this.p=new ot(kt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Et.prototype._tmp=function(){var kt=new ot(null);return kt.words=new Array(Math.ceil(this.n/13)),kt},Et.prototype.ireduce=function(kt){var At=kt,Rt;do this.split(At,this.tmp),At=this.imulK(At),At=At.iadd(this.tmp),Rt=At.bitLength();while(Rt>this.n);var Wt=Rt0?At.isub(this.p):At.strip!==void 0?At.strip():At._strip(),At},Et.prototype.split=function(kt,At){kt.iushrn(this.n,0,At)},Et.prototype.imulK=function(kt){return kt.imul(this.k)};function It(){Et.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}rt(It,Et),It.prototype.split=function(kt,At){for(var Rt=4194303,Wt=Math.min(kt.length,9),jt=0;jt>>22,Ot=Ct}Ot>>>=22,kt.words[jt-10]=Ot,Ot===0&&kt.length>10?kt.length-=10:kt.length-=9},It.prototype.imulK=function(kt){kt.words[kt.length]=0,kt.words[kt.length+1]=0,kt.length+=2;for(var At=0,Rt=0;Rt>>=26,kt.words[Rt]=jt,At=Wt}return At!==0&&(kt.words[kt.length++]=At),kt},ot._prime=function(kt){if(St[kt])return St[kt];var At;if(kt==="k256")At=new It;else if(kt==="p224")At=new Tt;else if(kt==="p192")At=new $t;else if(kt==="p25519")At=new Ut;else throw new Error("Unknown prime "+kt);return St[kt]=At,At};function Lt(Pt){if(typeof Pt=="string"){var kt=ot._prime(Pt);this.m=kt.p,this.prime=kt}else it(Pt.gtn(1),"modulus must be greater than 1"),this.m=Pt,this.prime=null}Lt.prototype._verify1=function(kt){it(kt.negative===0,"red works only with positives"),it(kt.red,"red works only with red numbers")},Lt.prototype._verify2=function(kt,At){it((kt.negative|At.negative)===0,"red works only with positives"),it(kt.red&&kt.red===At.red,"red works only with red numbers")},Lt.prototype.imod=function(kt){return this.prime?this.prime.ireduce(kt)._forceRed(this):(ut(kt,kt.umod(this.m)._forceRed(this)),kt)},Lt.prototype.neg=function(kt){return kt.isZero()?kt.clone():this.m.sub(kt)._forceRed(this)},Lt.prototype.add=function(kt,At){this._verify2(kt,At);var Rt=kt.add(At);return Rt.cmp(this.m)>=0&&Rt.isub(this.m),Rt._forceRed(this)},Lt.prototype.iadd=function(kt,At){this._verify2(kt,At);var Rt=kt.iadd(At);return Rt.cmp(this.m)>=0&&Rt.isub(this.m),Rt},Lt.prototype.sub=function(kt,At){this._verify2(kt,At);var Rt=kt.sub(At);return Rt.cmpn(0)<0&&Rt.iadd(this.m),Rt._forceRed(this)},Lt.prototype.isub=function(kt,At){this._verify2(kt,At);var Rt=kt.isub(At);return Rt.cmpn(0)<0&&Rt.iadd(this.m),Rt},Lt.prototype.shl=function(kt,At){return this._verify1(kt),this.imod(kt.ushln(At))},Lt.prototype.imul=function(kt,At){return this._verify2(kt,At),this.imod(kt.imul(At))},Lt.prototype.mul=function(kt,At){return this._verify2(kt,At),this.imod(kt.mul(At))},Lt.prototype.isqr=function(kt){return this.imul(kt,kt.clone())},Lt.prototype.sqr=function(kt){return this.mul(kt,kt)},Lt.prototype.sqrt=function(kt){if(kt.isZero())return kt.clone();var At=this.m.andln(3);if(it(At%2===1),At===3){var Rt=this.m.add(new ot(1)).iushrn(2);return this.pow(kt,Rt)}for(var Wt=this.m.subn(1),jt=0;!Wt.isZero()&&Wt.andln(1)===0;)jt++,Wt.iushrn(1);it(!Wt.isZero());var Ot=new ot(1).toRed(this),Ct=Ot.redNeg(),Dt=this.m.subn(1).iushrn(1),Mt=this.m.bitLength();for(Mt=new ot(2*Mt*Mt).toRed(this);this.pow(Mt,Dt).cmp(Ct)!==0;)Mt.redIAdd(Ct);for(var Vt=this.pow(Mt,Wt),Qt=this.pow(kt,Wt.addn(1).iushrn(1)),rn=this.pow(kt,Wt),Xt=jt;rn.cmp(Ot)!==0;){for(var an=rn,tn=0;an.cmp(Ot)!==0;tn++)an=an.redSqr();it(tn=0;jt--){for(var Vt=At.words[jt],Qt=Mt-1;Qt>=0;Qt--){var rn=Vt>>Qt&1;if(Ot!==Wt[0]&&(Ot=this.sqr(Ot)),rn===0&&Ct===0){Dt=0;continue}Ct<<=1,Ct|=rn,Dt++,!(Dt!==Rt&&(jt!==0||Qt!==0))&&(Ot=this.mul(Ot,Wt[Ct]),Dt=0,Ct=0)}Mt=26}return Ot},Lt.prototype.convertTo=function(kt){var At=kt.umod(this.m);return At===kt?At.clone():At},Lt.prototype.convertFrom=function(kt){var At=kt.clone();return At.red=null,At},ot.mont=function(kt){return new Bt(kt)};function Bt(Pt){Lt.call(this,Pt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}rt(Bt,Lt),Bt.prototype.convertTo=function(kt){return this.imod(kt.ushln(this.shift))},Bt.prototype.convertFrom=function(kt){var At=this.imod(kt.mul(this.rinv));return At.red=null,At},Bt.prototype.imul=function(kt,At){if(kt.isZero()||At.isZero())return kt.words[0]=0,kt.length=1,kt;var Rt=kt.imul(At),Wt=Rt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),jt=Rt.isub(Wt).iushrn(this.shift),Ot=jt;return jt.cmp(this.m)>=0?Ot=jt.isub(this.m):jt.cmpn(0)<0&&(Ot=jt.iadd(this.m)),Ot._forceRed(this)},Bt.prototype.mul=function(kt,At){if(kt.isZero()||At.isZero())return new ot(0)._forceRed(this);var Rt=kt.mul(At),Wt=Rt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),jt=Rt.isub(Wt).iushrn(this.shift),Ot=jt;return jt.cmp(this.m)>=0?Ot=jt.isub(this.m):jt.cmpn(0)<0&&(Ot=jt.iadd(this.m)),Ot._forceRed(this)},Bt.prototype.invm=function(kt){var At=this.imod(kt._invmp(this.m).mul(this.r2));return At._forceRed(this)}})(tt,commonjsGlobal)})(bn$1);var bnExports$1=bn$1.exports,BN$c=bnExports$1,randomBytes$1=browserExports;function blind(tt){var et=getr(tt),nt=et.toRed(BN$c.mont(tt.modulus)).redPow(new BN$c(tt.publicExponent)).fromRed();return{blinder:nt,unblinder:et.invm(tt.modulus)}}function getr(tt){var et=tt.modulus.byteLength(),nt;do nt=new BN$c(randomBytes$1(et));while(nt.cmp(tt.modulus)>=0||!nt.umod(tt.prime1)||!nt.umod(tt.prime2));return nt}function crt$2(tt,et){var nt=blind(et),it=et.modulus.byteLength(),rt=new BN$c(tt).mul(nt.blinder).umod(et.modulus),ot=rt.toRed(BN$c.mont(et.prime1)),at=rt.toRed(BN$c.mont(et.prime2)),st=et.coefficient,lt=et.prime1,ct=et.prime2,ut=ot.redPow(et.exponent1).fromRed(),ht=at.redPow(et.exponent2).fromRed(),dt=ut.isub(ht).imul(st).umod(lt).imul(ct);return ht.iadd(dt).imul(nt.unblinder).umod(et.modulus).toArrayLike(Buffer,"be",it)}crt$2.getr=getr;var browserifyRsa=crt$2,elliptic$2={};const name="elliptic",version$2="6.5.4",description="EC cryptography",main$1="lib/elliptic.js",files=["lib"],scripts={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository={type:"git",url:"git@github.com:indutny/elliptic"},keywords=["EC","Elliptic","curve","Cryptography"],author="Fedor Indutny ",license="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage="https://github.com/indutny/elliptic",devDependencies={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0={name,version:version$2,description,main:main$1,files,scripts,repository,keywords,author,license,bugs,homepage,devDependencies,dependencies};var utils$o={},utils$n={};(function(tt){var et=tt;function nt(ot,at){if(Array.isArray(ot))return ot.slice();if(!ot)return[];var st=[];if(typeof ot!="string"){for(var lt=0;lt>8,ht=ct&255;ut?st.push(ut,ht):st.push(ht)}return st}et.toArray=nt;function it(ot){return ot.length===1?"0"+ot:ot}et.zero2=it;function rt(ot){for(var at="",st=0;st(mt>>1)-1?yt=(mt>>1)-wt:yt=wt,gt.isubn(yt)):yt=0,pt[bt]=yt,gt.iushrn(1)}return pt}et.getNAF=ot;function at(ut,ht){var dt=[[],[]];ut=ut.clone(),ht=ht.clone();for(var pt=0,mt=0,gt;ut.cmpn(-pt)>0||ht.cmpn(-mt)>0;){var bt=ut.andln(3)+pt&3,yt=ht.andln(3)+mt&3;bt===3&&(bt=-1),yt===3&&(yt=-1);var wt;bt&1?(gt=ut.andln(7)+pt&7,(gt===3||gt===5)&&yt===2?wt=-bt:wt=bt):wt=0,dt[0].push(wt);var vt;yt&1?(gt=ht.andln(7)+mt&7,(gt===3||gt===5)&&bt===2?vt=-yt:vt=yt):vt=0,dt[1].push(vt),2*pt===wt+1&&(pt=1-pt),2*mt===vt+1&&(mt=1-mt),ut.iushrn(1),ht.iushrn(1)}return dt}et.getJSF=at;function st(ut,ht,dt){var pt="_"+ht;ut.prototype[ht]=function(){return this[pt]!==void 0?this[pt]:this[pt]=dt.call(this)}}et.cachedProperty=st;function lt(ut){return typeof ut=="string"?et.toArray(ut,"hex"):ut}et.parseBytes=lt;function ct(ut){return new nt(ut,"hex","le")}et.intFromLE=ct})(utils$o);var curve={},BN$b=bnExports$2,utils$m=utils$o,getNAF=utils$m.getNAF,getJSF=utils$m.getJSF,assert$j=utils$m.assert;function BaseCurve(tt,et){this.type=tt,this.p=new BN$b(et.p,16),this.red=et.prime?BN$b.red(et.prime):BN$b.mont(this.p),this.zero=new BN$b(0).toRed(this.red),this.one=new BN$b(1).toRed(this.red),this.two=new BN$b(2).toRed(this.red),this.n=et.n&&new BN$b(et.n,16),this.g=et.g&&this.pointFromJSON(et.g,et.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var nt=this.n&&this.p.div(this.n);!nt||nt.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$3=BaseCurve;BaseCurve.prototype.point=function(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function(et,nt){assert$j(et.precomputed);var it=et._getDoubles(),rt=getNAF(nt,1,this._bitLength),ot=(1<=st;ct--)lt=(lt<<1)+rt[ct];at.push(lt)}for(var ut=this.jpoint(null,null,null),ht=this.jpoint(null,null,null),dt=ot;dt>0;dt--){for(st=0;st=0;lt--){for(var ct=0;lt>=0&&at[lt]===0;lt--)ct++;if(lt>=0&&ct++,st=st.dblp(ct),lt<0)break;var ut=at[lt];assert$j(ut!==0),et.type==="affine"?ut>0?st=st.mixedAdd(ot[ut-1>>1]):st=st.mixedAdd(ot[-ut-1>>1].neg()):ut>0?st=st.add(ot[ut-1>>1]):st=st.add(ot[-ut-1>>1].neg())}return et.type==="affine"?st.toP():st};BaseCurve.prototype._wnafMulAdd=function(et,nt,it,rt,ot){var at=this._wnafT1,st=this._wnafT2,lt=this._wnafT3,ct=0,ut,ht,dt;for(ut=0;ut=1;ut-=2){var mt=ut-1,gt=ut;if(at[mt]!==1||at[gt]!==1){lt[mt]=getNAF(it[mt],at[mt],this._bitLength),lt[gt]=getNAF(it[gt],at[gt],this._bitLength),ct=Math.max(lt[mt].length,ct),ct=Math.max(lt[gt].length,ct);continue}var bt=[nt[mt],null,null,nt[gt]];nt[mt].y.cmp(nt[gt].y)===0?(bt[1]=nt[mt].add(nt[gt]),bt[2]=nt[mt].toJ().mixedAdd(nt[gt].neg())):nt[mt].y.cmp(nt[gt].y.redNeg())===0?(bt[1]=nt[mt].toJ().mixedAdd(nt[gt]),bt[2]=nt[mt].add(nt[gt].neg())):(bt[1]=nt[mt].toJ().mixedAdd(nt[gt]),bt[2]=nt[mt].toJ().mixedAdd(nt[gt].neg()));var yt=[-3,-1,-5,-7,0,7,5,1,3],wt=getJSF(it[mt],it[gt]);for(ct=Math.max(wt[0].length,ct),lt[mt]=new Array(ct),lt[gt]=new Array(ct),ht=0;ht=0;ut--){for(var It=0;ut>=0;){var Tt=!0;for(ht=0;ht=0&&It++,St=St.dblp(It),ut<0)break;for(ht=0;ht0?dt=st[ht][$t-1>>1]:$t<0&&(dt=st[ht][-$t-1>>1].neg()),dt.type==="affine"?St=St.mixedAdd(dt):St=St.add(dt))}}for(ut=0;ut=Math.ceil((et.bitLength()+1)/nt.step):!1};BasePoint.prototype._getDoubles=function(et,nt){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var it=[this],rt=this,ot=0;ot=0&&(pt=ct,mt=ut),ht.negative&&(ht=ht.neg(),dt=dt.neg()),pt.negative&&(pt=pt.neg(),mt=mt.neg()),[{a:ht,b:dt},{a:pt,b:mt}]};ShortCurve.prototype._endoSplit=function(et){var nt=this.endo.basis,it=nt[0],rt=nt[1],ot=rt.b.mul(et).divRound(this.n),at=it.b.neg().mul(et).divRound(this.n),st=ot.mul(it.a),lt=at.mul(rt.a),ct=ot.mul(it.b),ut=at.mul(rt.b),ht=et.sub(st).sub(lt),dt=ct.add(ut).neg();return{k1:ht,k2:dt}};ShortCurve.prototype.pointFromX=function(et,nt){et=new BN$a(et,16),et.red||(et=et.toRed(this.red));var it=et.redSqr().redMul(et).redIAdd(et.redMul(this.a)).redIAdd(this.b),rt=it.redSqrt();if(rt.redSqr().redSub(it).cmp(this.zero)!==0)throw new Error("invalid point");var ot=rt.fromRed().isOdd();return(nt&&!ot||!nt&&ot)&&(rt=rt.redNeg()),this.point(et,rt)};ShortCurve.prototype.validate=function(et){if(et.inf)return!0;var nt=et.x,it=et.y,rt=this.a.redMul(nt),ot=nt.redSqr().redMul(nt).redIAdd(rt).redIAdd(this.b);return it.redSqr().redISub(ot).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function(et,nt,it){for(var rt=this._endoWnafT1,ot=this._endoWnafT2,at=0;at":""};Point$2.prototype.isInfinity=function(){return this.inf};Point$2.prototype.add=function(et){if(this.inf)return et;if(et.inf)return this;if(this.eq(et))return this.dbl();if(this.neg().eq(et))return this.curve.point(null,null);if(this.x.cmp(et.x)===0)return this.curve.point(null,null);var nt=this.y.redSub(et.y);nt.cmpn(0)!==0&&(nt=nt.redMul(this.x.redSub(et.x).redInvm()));var it=nt.redSqr().redISub(this.x).redISub(et.x),rt=nt.redMul(this.x.redSub(it)).redISub(this.y);return this.curve.point(it,rt)};Point$2.prototype.dbl=function(){if(this.inf)return this;var et=this.y.redAdd(this.y);if(et.cmpn(0)===0)return this.curve.point(null,null);var nt=this.curve.a,it=this.x.redSqr(),rt=et.redInvm(),ot=it.redAdd(it).redIAdd(it).redIAdd(nt).redMul(rt),at=ot.redSqr().redISub(this.x.redAdd(this.x)),st=ot.redMul(this.x.redSub(at)).redISub(this.y);return this.curve.point(at,st)};Point$2.prototype.getX=function(){return this.x.fromRed()};Point$2.prototype.getY=function(){return this.y.fromRed()};Point$2.prototype.mul=function(et){return et=new BN$a(et,16),this.isInfinity()?this:this._hasDoubles(et)?this.curve._fixedNafMul(this,et):this.curve.endo?this.curve._endoWnafMulAdd([this],[et]):this.curve._wnafMul(this,et)};Point$2.prototype.mulAdd=function(et,nt,it){var rt=[this,nt],ot=[et,it];return this.curve.endo?this.curve._endoWnafMulAdd(rt,ot):this.curve._wnafMulAdd(1,rt,ot,2)};Point$2.prototype.jmulAdd=function(et,nt,it){var rt=[this,nt],ot=[et,it];return this.curve.endo?this.curve._endoWnafMulAdd(rt,ot,!0):this.curve._wnafMulAdd(1,rt,ot,2,!0)};Point$2.prototype.eq=function(et){return this===et||this.inf===et.inf&&(this.inf||this.x.cmp(et.x)===0&&this.y.cmp(et.y)===0)};Point$2.prototype.neg=function(et){if(this.inf)return this;var nt=this.curve.point(this.x,this.y.redNeg());if(et&&this.precomputed){var it=this.precomputed,rt=function(ot){return ot.neg()};nt.precomputed={naf:it.naf&&{wnd:it.naf.wnd,points:it.naf.points.map(rt)},doubles:it.doubles&&{step:it.doubles.step,points:it.doubles.points.map(rt)}}}return nt};Point$2.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var et=this.curve.jpoint(this.x,this.y,this.curve.one);return et};function JPoint(tt,et,nt,it){Base$2.BasePoint.call(this,tt,"jacobian"),et===null&&nt===null&&it===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$a(0)):(this.x=new BN$a(et,16),this.y=new BN$a(nt,16),this.z=new BN$a(it,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$a(JPoint,Base$2.BasePoint);ShortCurve.prototype.jpoint=function(et,nt,it){return new JPoint(this,et,nt,it)};JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var et=this.z.redInvm(),nt=et.redSqr(),it=this.x.redMul(nt),rt=this.y.redMul(nt).redMul(et);return this.curve.point(it,rt)};JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function(et){if(this.isInfinity())return et;if(et.isInfinity())return this;var nt=et.z.redSqr(),it=this.z.redSqr(),rt=this.x.redMul(nt),ot=et.x.redMul(it),at=this.y.redMul(nt.redMul(et.z)),st=et.y.redMul(it.redMul(this.z)),lt=rt.redSub(ot),ct=at.redSub(st);if(lt.cmpn(0)===0)return ct.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ut=lt.redSqr(),ht=ut.redMul(lt),dt=rt.redMul(ut),pt=ct.redSqr().redIAdd(ht).redISub(dt).redISub(dt),mt=ct.redMul(dt.redISub(pt)).redISub(at.redMul(ht)),gt=this.z.redMul(et.z).redMul(lt);return this.curve.jpoint(pt,mt,gt)};JPoint.prototype.mixedAdd=function(et){if(this.isInfinity())return et.toJ();if(et.isInfinity())return this;var nt=this.z.redSqr(),it=this.x,rt=et.x.redMul(nt),ot=this.y,at=et.y.redMul(nt).redMul(this.z),st=it.redSub(rt),lt=ot.redSub(at);if(st.cmpn(0)===0)return lt.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ct=st.redSqr(),ut=ct.redMul(st),ht=it.redMul(ct),dt=lt.redSqr().redIAdd(ut).redISub(ht).redISub(ht),pt=lt.redMul(ht.redISub(dt)).redISub(ot.redMul(ut)),mt=this.z.redMul(st);return this.curve.jpoint(dt,pt,mt)};JPoint.prototype.dblp=function(et){if(et===0)return this;if(this.isInfinity())return this;if(!et)return this.dbl();var nt;if(this.curve.zeroA||this.curve.threeA){var it=this;for(nt=0;nt=0)return!1;if(it.redIAdd(ot),this.x.cmp(it)===0)return!0}};JPoint.prototype.inspect=function(){return this.isInfinity()?"":""};JPoint.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var BN$9=bnExports$2,inherits$9=inherits_browserExports,Base$1=base$3,utils$k=utils$o;function MontCurve(tt){Base$1.call(this,"mont",tt),this.a=new BN$9(tt.a,16).toRed(this.red),this.b=new BN$9(tt.b,16).toRed(this.red),this.i4=new BN$9(4).toRed(this.red).redInvm(),this.two=new BN$9(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$9(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function(et){var nt=et.normalize().x,it=nt.redSqr(),rt=it.redMul(nt).redAdd(it.redMul(this.a)).redAdd(nt),ot=rt.redSqrt();return ot.redSqr().cmp(rt)===0};function Point$1(tt,et,nt){Base$1.BasePoint.call(this,tt,"projective"),et===null&&nt===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$9(et,16),this.z=new BN$9(nt,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$9(Point$1,Base$1.BasePoint);MontCurve.prototype.decodePoint=function(et,nt){return this.point(utils$k.toArray(et,nt),1)};MontCurve.prototype.point=function(et,nt){return new Point$1(this,et,nt)};MontCurve.prototype.pointFromJSON=function(et){return Point$1.fromJSON(this,et)};Point$1.prototype.precompute=function(){};Point$1.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$1.fromJSON=function(et,nt){return new Point$1(et,nt[0],nt[1]||et.one)};Point$1.prototype.inspect=function(){return this.isInfinity()?"":""};Point$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Point$1.prototype.dbl=function(){var et=this.x.redAdd(this.z),nt=et.redSqr(),it=this.x.redSub(this.z),rt=it.redSqr(),ot=nt.redSub(rt),at=nt.redMul(rt),st=ot.redMul(rt.redAdd(this.curve.a24.redMul(ot)));return this.curve.point(at,st)};Point$1.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.diffAdd=function(et,nt){var it=this.x.redAdd(this.z),rt=this.x.redSub(this.z),ot=et.x.redAdd(et.z),at=et.x.redSub(et.z),st=at.redMul(it),lt=ot.redMul(rt),ct=nt.z.redMul(st.redAdd(lt).redSqr()),ut=nt.x.redMul(st.redISub(lt).redSqr());return this.curve.point(ct,ut)};Point$1.prototype.mul=function(et){for(var nt=et.clone(),it=this,rt=this.curve.point(null,null),ot=this,at=[];nt.cmpn(0)!==0;nt.iushrn(1))at.push(nt.andln(1));for(var st=at.length-1;st>=0;st--)at[st]===0?(it=it.diffAdd(rt,ot),rt=rt.dbl()):(rt=it.diffAdd(rt,ot),it=it.dbl());return rt};Point$1.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.eq=function(et){return this.getX().cmp(et.getX())===0};Point$1.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$1.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var utils$j=utils$o,BN$8=bnExports$2,inherits$8=inherits_browserExports,Base=base$3,assert$h=utils$j.assert;function EdwardsCurve(tt){this.twisted=(tt.a|0)!==1,this.mOneA=this.twisted&&(tt.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",tt),this.a=new BN$8(tt.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$8(tt.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$8(tt.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$h(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(tt.c|0)===1}inherits$8(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function(et){return this.mOneA?et.redNeg():this.a.redMul(et)};EdwardsCurve.prototype._mulC=function(et){return this.oneC?et:this.c.redMul(et)};EdwardsCurve.prototype.jpoint=function(et,nt,it,rt){return this.point(et,nt,it,rt)};EdwardsCurve.prototype.pointFromX=function(et,nt){et=new BN$8(et,16),et.red||(et=et.toRed(this.red));var it=et.redSqr(),rt=this.c2.redSub(this.a.redMul(it)),ot=this.one.redSub(this.c2.redMul(this.d).redMul(it)),at=rt.redMul(ot.redInvm()),st=at.redSqrt();if(st.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");var lt=st.fromRed().isOdd();return(nt&&!lt||!nt&<)&&(st=st.redNeg()),this.point(et,st)};EdwardsCurve.prototype.pointFromY=function(et,nt){et=new BN$8(et,16),et.red||(et=et.toRed(this.red));var it=et.redSqr(),rt=it.redSub(this.c2),ot=it.redMul(this.d).redMul(this.c2).redSub(this.a),at=rt.redMul(ot.redInvm());if(at.cmp(this.zero)===0){if(nt)throw new Error("invalid point");return this.point(this.zero,et)}var st=at.redSqrt();if(st.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");return st.fromRed().isOdd()!==nt&&(st=st.redNeg()),this.point(st,et)};EdwardsCurve.prototype.validate=function(et){if(et.isInfinity())return!0;et.normalize();var nt=et.x.redSqr(),it=et.y.redSqr(),rt=nt.redMul(this.a).redAdd(it),ot=this.c2.redMul(this.one.redAdd(this.d.redMul(nt).redMul(it)));return rt.cmp(ot)===0};function Point(tt,et,nt,it,rt){Base.BasePoint.call(this,tt,"projective"),et===null&&nt===null&&it===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$8(et,16),this.y=new BN$8(nt,16),this.z=it?new BN$8(it,16):this.curve.one,this.t=rt&&new BN$8(rt,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits$8(Point,Base.BasePoint);EdwardsCurve.prototype.pointFromJSON=function(et){return Point.fromJSON(this,et)};EdwardsCurve.prototype.point=function(et,nt,it,rt){return new Point(this,et,nt,it,rt)};Point.fromJSON=function(et,nt){return new Point(et,nt[0],nt[1],nt[2])};Point.prototype.inspect=function(){return this.isInfinity()?"":""};Point.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function(){var et=this.x.redSqr(),nt=this.y.redSqr(),it=this.z.redSqr();it=it.redIAdd(it);var rt=this.curve._mulA(et),ot=this.x.redAdd(this.y).redSqr().redISub(et).redISub(nt),at=rt.redAdd(nt),st=at.redSub(it),lt=rt.redSub(nt),ct=ot.redMul(st),ut=at.redMul(lt),ht=ot.redMul(lt),dt=st.redMul(at);return this.curve.point(ct,ut,dt,ht)};Point.prototype._projDbl=function(){var et=this.x.redAdd(this.y).redSqr(),nt=this.x.redSqr(),it=this.y.redSqr(),rt,ot,at,st,lt,ct;if(this.curve.twisted){st=this.curve._mulA(nt);var ut=st.redAdd(it);this.zOne?(rt=et.redSub(nt).redSub(it).redMul(ut.redSub(this.curve.two)),ot=ut.redMul(st.redSub(it)),at=ut.redSqr().redSub(ut).redSub(ut)):(lt=this.z.redSqr(),ct=ut.redSub(lt).redISub(lt),rt=et.redSub(nt).redISub(it).redMul(ct),ot=ut.redMul(st.redSub(it)),at=ut.redMul(ct))}else st=nt.redAdd(it),lt=this.curve._mulC(this.z).redSqr(),ct=st.redSub(lt).redSub(lt),rt=this.curve._mulC(et.redISub(st)).redMul(ct),ot=this.curve._mulC(st).redMul(nt.redISub(it)),at=st.redMul(ct);return this.curve.point(rt,ot,at)};Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point.prototype._extAdd=function(et){var nt=this.y.redSub(this.x).redMul(et.y.redSub(et.x)),it=this.y.redAdd(this.x).redMul(et.y.redAdd(et.x)),rt=this.t.redMul(this.curve.dd).redMul(et.t),ot=this.z.redMul(et.z.redAdd(et.z)),at=it.redSub(nt),st=ot.redSub(rt),lt=ot.redAdd(rt),ct=it.redAdd(nt),ut=at.redMul(st),ht=lt.redMul(ct),dt=at.redMul(ct),pt=st.redMul(lt);return this.curve.point(ut,ht,pt,dt)};Point.prototype._projAdd=function(et){var nt=this.z.redMul(et.z),it=nt.redSqr(),rt=this.x.redMul(et.x),ot=this.y.redMul(et.y),at=this.curve.d.redMul(rt).redMul(ot),st=it.redSub(at),lt=it.redAdd(at),ct=this.x.redAdd(this.y).redMul(et.x.redAdd(et.y)).redISub(rt).redISub(ot),ut=nt.redMul(st).redMul(ct),ht,dt;return this.curve.twisted?(ht=nt.redMul(lt).redMul(ot.redSub(this.curve._mulA(rt))),dt=st.redMul(lt)):(ht=nt.redMul(lt).redMul(ot.redSub(rt)),dt=this.curve._mulC(st).redMul(lt)),this.curve.point(ut,ht,dt)};Point.prototype.add=function(et){return this.isInfinity()?et:et.isInfinity()?this:this.curve.extended?this._extAdd(et):this._projAdd(et)};Point.prototype.mul=function(et){return this._hasDoubles(et)?this.curve._fixedNafMul(this,et):this.curve._wnafMul(this,et)};Point.prototype.mulAdd=function(et,nt,it){return this.curve._wnafMulAdd(1,[this,nt],[et,it],2,!1)};Point.prototype.jmulAdd=function(et,nt,it){return this.curve._wnafMulAdd(1,[this,nt],[et,it],2,!0)};Point.prototype.normalize=function(){if(this.zOne)return this;var et=this.z.redInvm();return this.x=this.x.redMul(et),this.y=this.y.redMul(et),this.t&&(this.t=this.t.redMul(et)),this.z=this.curve.one,this.zOne=!0,this};Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Point.prototype.eq=function(et){return this===et||this.getX().cmp(et.getX())===0&&this.getY().cmp(et.getY())===0};Point.prototype.eqXToP=function(et){var nt=et.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(nt)===0)return!0;for(var it=et.clone(),rt=this.curve.redN.redMul(this.z);;){if(it.iadd(this.curve.n),it.cmp(this.curve.p)>=0)return!1;if(nt.redIAdd(rt),this.x.cmp(nt)===0)return!0}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;(function(tt){var et=tt;et.base=base$3,et.short=short,et.mont=mont,et.edwards=edwards})(curve);var curves$1={},hash$6={},utils$i={},assert$g=minimalisticAssert,inherits$7=inherits_browserExports;utils$i.inherits=inherits$7;function isSurrogatePair(tt,et){return(tt.charCodeAt(et)&64512)!==55296||et<0||et+1>=tt.length?!1:(tt.charCodeAt(et+1)&64512)===56320}function toArray$3(tt,et){if(Array.isArray(tt))return tt.slice();if(!tt)return[];var nt=[];if(typeof tt=="string")if(et){if(et==="hex")for(tt=tt.replace(/[^a-z0-9]+/ig,""),tt.length%2!==0&&(tt="0"+tt),rt=0;rt>6|192,nt[it++]=ot&63|128):isSurrogatePair(tt,rt)?(ot=65536+((ot&1023)<<10)+(tt.charCodeAt(++rt)&1023),nt[it++]=ot>>18|240,nt[it++]=ot>>12&63|128,nt[it++]=ot>>6&63|128,nt[it++]=ot&63|128):(nt[it++]=ot>>12|224,nt[it++]=ot>>6&63|128,nt[it++]=ot&63|128)}else for(rt=0;rt>>24|tt>>>8&65280|tt<<8&16711680|(tt&255)<<24;return et>>>0}utils$i.htonl=htonl;function toHex32(tt,et){for(var nt="",it=0;it>>0}return ot}utils$i.join32=join32;function split32(tt,et){for(var nt=new Array(tt.length*4),it=0,rt=0;it>>24,nt[rt+1]=ot>>>16&255,nt[rt+2]=ot>>>8&255,nt[rt+3]=ot&255):(nt[rt+3]=ot>>>24,nt[rt+2]=ot>>>16&255,nt[rt+1]=ot>>>8&255,nt[rt]=ot&255)}return nt}utils$i.split32=split32;function rotr32$1(tt,et){return tt>>>et|tt<<32-et}utils$i.rotr32=rotr32$1;function rotl32$2(tt,et){return tt<>>32-et}utils$i.rotl32=rotl32$2;function sum32$3(tt,et){return tt+et>>>0}utils$i.sum32=sum32$3;function sum32_3$1(tt,et,nt){return tt+et+nt>>>0}utils$i.sum32_3=sum32_3$1;function sum32_4$2(tt,et,nt,it){return tt+et+nt+it>>>0}utils$i.sum32_4=sum32_4$2;function sum32_5$2(tt,et,nt,it,rt){return tt+et+nt+it+rt>>>0}utils$i.sum32_5=sum32_5$2;function sum64$1(tt,et,nt,it){var rt=tt[et],ot=tt[et+1],at=it+ot>>>0,st=(at>>0,tt[et+1]=at}utils$i.sum64=sum64$1;function sum64_hi$1(tt,et,nt,it){var rt=et+it>>>0,ot=(rt>>0}utils$i.sum64_hi=sum64_hi$1;function sum64_lo$1(tt,et,nt,it){var rt=et+it;return rt>>>0}utils$i.sum64_lo=sum64_lo$1;function sum64_4_hi$1(tt,et,nt,it,rt,ot,at,st){var lt=0,ct=et;ct=ct+it>>>0,lt+=ct>>0,lt+=ct>>0,lt+=ct>>0}utils$i.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(tt,et,nt,it,rt,ot,at,st){var lt=et+it+ot+st;return lt>>>0}utils$i.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(tt,et,nt,it,rt,ot,at,st,lt,ct){var ut=0,ht=et;ht=ht+it>>>0,ut+=ht>>0,ut+=ht>>0,ut+=ht>>0,ut+=ht>>0}utils$i.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(tt,et,nt,it,rt,ot,at,st,lt,ct){var ut=et+it+ot+st+ct;return ut>>>0}utils$i.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(tt,et,nt){var it=et<<32-nt|tt>>>nt;return it>>>0}utils$i.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(tt,et,nt){var it=tt<<32-nt|et>>>nt;return it>>>0}utils$i.rotr64_lo=rotr64_lo$1;function shr64_hi$1(tt,et,nt){return tt>>>nt}utils$i.shr64_hi=shr64_hi$1;function shr64_lo$1(tt,et,nt){var it=tt<<32-nt|et>>>nt;return it>>>0}utils$i.shr64_lo=shr64_lo$1;var common$7={},utils$h=utils$i,assert$f=minimalisticAssert;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$7.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(et,nt){if(et=utils$h.toArray(et,nt),this.pending?this.pending=this.pending.concat(et):this.pending=et,this.pendingTotal+=et.length,this.pending.length>=this._delta8){et=this.pending;var it=et.length%this._delta8;this.pending=et.slice(et.length-it,et.length),this.pending.length===0&&(this.pending=null),et=utils$h.join32(et,0,et.length-it,this.endian);for(var rt=0;rt>>24&255,rt[ot++]=et>>>16&255,rt[ot++]=et>>>8&255,rt[ot++]=et&255}else for(rt[ot++]=et&255,rt[ot++]=et>>>8&255,rt[ot++]=et>>>16&255,rt[ot++]=et>>>24&255,rt[ot++]=0,rt[ot++]=0,rt[ot++]=0,rt[ot++]=0,at=8;at>>3}common$6.g0_256=g0_256$1;function g1_256$1(tt){return rotr32(tt,17)^rotr32(tt,19)^tt>>>10}common$6.g1_256=g1_256$1;var utils$f=utils$i,common$5=common$7,shaCommon$1=common$6,rotl32$1=utils$f.rotl32,sum32$2=utils$f.sum32,sum32_5$1=utils$f.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$5.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1$1(){if(!(this instanceof SHA1$1))return new SHA1$1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$f.inherits(SHA1$1,BlockHash$3);var _1=SHA1$1;SHA1$1.blockSize=512;SHA1$1.outSize=160;SHA1$1.hmacStrength=80;SHA1$1.padLength=64;SHA1$1.prototype._update=function(et,nt){for(var it=this.W,rt=0;rt<16;rt++)it[rt]=et[nt+rt];for(;rtthis.blockSize&&(et=new this.Hash().update(et).digest()),assert$c(et.length<=this.blockSize);for(var nt=et.length;nt=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(et,nt,it)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function(et,nt,it){var rt=et.concat(nt).concat(it);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var ot=0;ot=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(et.concat(it||[])),this._reseed=1};HmacDRBG.prototype.generate=function(et,nt,it,rt){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof nt!="string"&&(rt=it,it=nt,nt=null),it&&(it=utils$8.toArray(it,rt||"hex"),this._update(it));for(var ot=[];ot.length"};var BN$6=bnExports$2,utils$6=utils$o,assert$9=utils$6.assert;function Signature$2(tt,et){if(tt instanceof Signature$2)return tt;this._importDER(tt,et)||(assert$9(tt.r&&tt.s,"Signature without r or s"),this.r=new BN$6(tt.r,16),this.s=new BN$6(tt.s,16),tt.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=tt.recoveryParam)}var signature$1=Signature$2;function Position$1(){this.place=0}function getLength(tt,et){var nt=tt[et.place++];if(!(nt&128))return nt;var it=nt&15;if(it===0||it>4)return!1;for(var rt=0,ot=0,at=et.place;ot>>=0;return rt<=127?!1:(et.place=at,rt)}function rmPadding(tt){for(var et=0,nt=tt.length-1;!tt[et]&&!(tt[et+1]&128)&&et>>3);for(tt.push(nt|128);--nt;)tt.push(et>>>(nt<<3)&255);tt.push(et)}Signature$2.prototype.toDER=function(et){var nt=this.r.toArray(),it=this.s.toArray();for(nt[0]&128&&(nt=[0].concat(nt)),it[0]&128&&(it=[0].concat(it)),nt=rmPadding(nt),it=rmPadding(it);!it[0]&&!(it[1]&128);)it=it.slice(1);var rt=[2];constructLength(rt,nt.length),rt=rt.concat(nt),rt.push(2),constructLength(rt,it.length);var ot=rt.concat(it),at=[48];return constructLength(at,ot.length),at=at.concat(ot),utils$6.encode(at,et)};var ec$1,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$1;hasRequiredEc=1;var tt=bnExports$2,et=hmacDrbg,nt=utils$o,it=curves$1,rt=requireBrorand(),ot=nt.assert,at=key$2,st=signature$1;function lt(ct){if(!(this instanceof lt))return new lt(ct);typeof ct=="string"&&(ot(Object.prototype.hasOwnProperty.call(it,ct),"Unknown curve "+ct),ct=it[ct]),ct instanceof it.PresetCurve&&(ct={curve:ct}),this.curve=ct.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=ct.curve.g,this.g.precompute(ct.curve.n.bitLength()+1),this.hash=ct.hash||ct.curve.hash}return ec$1=lt,lt.prototype.keyPair=function(ut){return new at(this,ut)},lt.prototype.keyFromPrivate=function(ut,ht){return at.fromPrivate(this,ut,ht)},lt.prototype.keyFromPublic=function(ut,ht){return at.fromPublic(this,ut,ht)},lt.prototype.genKeyPair=function(ut){ut||(ut={});for(var ht=new et({hash:this.hash,pers:ut.pers,persEnc:ut.persEnc||"utf8",entropy:ut.entropy||rt(this.hash.hmacStrength),entropyEnc:ut.entropy&&ut.entropyEnc||"utf8",nonce:this.n.toArray()}),dt=this.n.byteLength(),pt=this.n.sub(new tt(2));;){var mt=new tt(ht.generate(dt));if(!(mt.cmp(pt)>0))return mt.iaddn(1),this.keyFromPrivate(mt)}},lt.prototype._truncateToN=function(ut,ht){var dt=ut.byteLength()*8-this.n.bitLength();return dt>0&&(ut=ut.ushrn(dt)),!ht&&ut.cmp(this.n)>=0?ut.sub(this.n):ut},lt.prototype.sign=function(ut,ht,dt,pt){typeof dt=="object"&&(pt=dt,dt=null),pt||(pt={}),ht=this.keyFromPrivate(ht,dt),ut=this._truncateToN(new tt(ut,16));for(var mt=this.n.byteLength(),gt=ht.getPrivate().toArray("be",mt),bt=ut.toArray("be",mt),yt=new et({hash:this.hash,entropy:gt,nonce:bt,pers:pt.pers,persEnc:pt.persEnc||"utf8"}),wt=this.n.sub(new tt(1)),vt=0;;vt++){var xt=pt.k?pt.k(vt):new tt(yt.generate(this.n.byteLength()));if(xt=this._truncateToN(xt,!0),!(xt.cmpn(1)<=0||xt.cmp(wt)>=0)){var St=this.g.mul(xt);if(!St.isInfinity()){var Et=St.getX(),It=Et.umod(this.n);if(It.cmpn(0)!==0){var Tt=xt.invm(this.n).mul(It.mul(ht.getPrivate()).iadd(ut));if(Tt=Tt.umod(this.n),Tt.cmpn(0)!==0){var $t=(St.getY().isOdd()?1:0)|(Et.cmp(It)!==0?2:0);return pt.canonical&&Tt.cmp(this.nh)>0&&(Tt=this.n.sub(Tt),$t^=1),new st({r:It,s:Tt,recoveryParam:$t})}}}}}},lt.prototype.verify=function(ut,ht,dt,pt){ut=this._truncateToN(new tt(ut,16)),dt=this.keyFromPublic(dt,pt),ht=new st(ht,"hex");var mt=ht.r,gt=ht.s;if(mt.cmpn(1)<0||mt.cmp(this.n)>=0||gt.cmpn(1)<0||gt.cmp(this.n)>=0)return!1;var bt=gt.invm(this.n),yt=bt.mul(ut).umod(this.n),wt=bt.mul(mt).umod(this.n),vt;return this.curve._maxwellTrick?(vt=this.g.jmulAdd(yt,dt.getPublic(),wt),vt.isInfinity()?!1:vt.eqXToP(mt)):(vt=this.g.mulAdd(yt,dt.getPublic(),wt),vt.isInfinity()?!1:vt.getX().umod(this.n).cmp(mt)===0)},lt.prototype.recoverPubKey=function(ct,ut,ht,dt){ot((3&ht)===ht,"The recovery param is more than two bits"),ut=new st(ut,dt);var pt=this.n,mt=new tt(ct),gt=ut.r,bt=ut.s,yt=ht&1,wt=ht>>1;if(gt.cmp(this.curve.p.umod(this.curve.n))>=0&&wt)throw new Error("Unable to find sencond key candinate");wt?gt=this.curve.pointFromX(gt.add(this.curve.n),yt):gt=this.curve.pointFromX(gt,yt);var vt=ut.r.invm(pt),xt=pt.sub(mt).mul(vt).umod(pt),St=bt.mul(vt).umod(pt);return this.g.mulAdd(xt,gt,St)},lt.prototype.getKeyRecoveryParam=function(ct,ut,ht,dt){if(ut=new st(ut,dt),ut.recoveryParam!==null)return ut.recoveryParam;for(var pt=0;pt<4;pt++){var mt;try{mt=this.recoverPubKey(ct,ut,pt)}catch{continue}if(mt.eq(ht))return pt}throw new Error("Unable to find valid recovery factor")},ec$1}var utils$5=utils$o,assert$8=utils$5.assert,parseBytes$2=utils$5.parseBytes,cachedProperty$1=utils$5.cachedProperty;function KeyPair$1(tt,et){this.eddsa=tt,this._secret=parseBytes$2(et.secret),tt.isPoint(et.pub)?this._pub=et.pub:this._pubBytes=parseBytes$2(et.pub)}KeyPair$1.fromPublic=function(et,nt){return nt instanceof KeyPair$1?nt:new KeyPair$1(et,{pub:nt})};KeyPair$1.fromSecret=function(et,nt){return nt instanceof KeyPair$1?nt:new KeyPair$1(et,{secret:nt})};KeyPair$1.prototype.secret=function(){return this._secret};cachedProperty$1(KeyPair$1,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});cachedProperty$1(KeyPair$1,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$1(KeyPair$1,"privBytes",function(){var et=this.eddsa,nt=this.hash(),it=et.encodingLength-1,rt=nt.slice(0,et.encodingLength);return rt[0]&=248,rt[it]&=127,rt[it]|=64,rt});cachedProperty$1(KeyPair$1,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$1(KeyPair$1,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$1(KeyPair$1,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$1.prototype.sign=function(et){return assert$8(this._secret,"KeyPair can only verify"),this.eddsa.sign(et,this)};KeyPair$1.prototype.verify=function(et,nt){return this.eddsa.verify(et,nt,this)};KeyPair$1.prototype.getSecret=function(et){return assert$8(this._secret,"KeyPair is public only"),utils$5.encode(this.secret(),et)};KeyPair$1.prototype.getPublic=function(et){return utils$5.encode(this.pubBytes(),et)};var key$1=KeyPair$1,BN$5=bnExports$2,utils$4=utils$o,assert$7=utils$4.assert,cachedProperty=utils$4.cachedProperty,parseBytes$1=utils$4.parseBytes;function Signature$1(tt,et){this.eddsa=tt,typeof et!="object"&&(et=parseBytes$1(et)),Array.isArray(et)&&(et={R:et.slice(0,tt.encodingLength),S:et.slice(tt.encodingLength)}),assert$7(et.R&&et.S,"Signature without R or S"),tt.isPoint(et.R)&&(this._R=et.R),et.S instanceof BN$5&&(this._S=et.S),this._Rencoded=Array.isArray(et.R)?et.R:et.Rencoded,this._Sencoded=Array.isArray(et.S)?et.S:et.Sencoded}cachedProperty(Signature$1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature$1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature$1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});cachedProperty(Signature$1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Signature$1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Signature$1.prototype.toHex=function(){return utils$4.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash$4=hash$6,curves=curves$1,utils$3=utils$o,assert$6=utils$3.assert,parseBytes=utils$3.parseBytes,KeyPair=key$1,Signature=signature;function EDDSA(tt){if(assert$6(tt==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(tt);tt=curves[tt].curve,this.curve=tt,this.g=tt.g,this.g.precompute(tt.n.bitLength()+1),this.pointClass=tt.point().constructor,this.encodingLength=Math.ceil(tt.n.bitLength()/8),this.hash=hash$4.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function(et,nt){et=parseBytes(et);var it=this.keyFromSecret(nt),rt=this.hashInt(it.messagePrefix(),et),ot=this.g.mul(rt),at=this.encodePoint(ot),st=this.hashInt(at,it.pubBytes(),et).mul(it.priv()),lt=rt.add(st).umod(this.curve.n);return this.makeSignature({R:ot,S:lt,Rencoded:at})};EDDSA.prototype.verify=function(et,nt,it){et=parseBytes(et),nt=this.makeSignature(nt);var rt=this.keyFromPublic(it),ot=this.hashInt(nt.Rencoded(),rt.pubBytes(),et),at=this.g.mul(nt.S()),st=nt.R().add(rt.pub().mul(ot));return st.eq(at)};EDDSA.prototype.hashInt=function(){for(var et=this.hash(),nt=0;nt0?kt:At},ot.min=function(kt,At){return kt.cmp(At)<0?kt:At},ot.prototype._init=function(kt,At,Rt){if(typeof kt=="number")return this._initNumber(kt,At,Rt);if(typeof kt=="object")return this._initArray(kt,At,Rt);At==="hex"&&(At=16),it(At===(At|0)&&At>=2&&At<=36),kt=kt.toString().replace(/\s+/g,"");var Wt=0;kt[0]==="-"&&(Wt++,this.negative=1),Wt=0;Wt-=3)Ot=kt[Wt]|kt[Wt-1]<<8|kt[Wt-2]<<16,this.words[jt]|=Ot<>>26-Ct&67108863,Ct+=24,Ct>=26&&(Ct-=26,jt++);else if(Rt==="le")for(Wt=0,jt=0;Wt>>26-Ct&67108863,Ct+=24,Ct>=26&&(Ct-=26,jt++);return this._strip()};function st(Pt,kt){var At=Pt.charCodeAt(kt);if(At>=48&&At<=57)return At-48;if(At>=65&&At<=70)return At-55;if(At>=97&&At<=102)return At-87;it(!1,"Invalid character in "+Pt)}function lt(Pt,kt,At){var Rt=st(Pt,At);return At-1>=kt&&(Rt|=st(Pt,At-1)<<4),Rt}ot.prototype._parseHex=function(kt,At,Rt){this.length=Math.ceil((kt.length-At)/6),this.words=new Array(this.length);for(var Wt=0;Wt=At;Wt-=2)Ct=lt(kt,At,Wt)<=18?(jt-=18,Ot+=1,this.words[Ot]|=Ct>>>26):jt+=8;else{var Dt=kt.length-At;for(Wt=Dt%2===0?At+1:At;Wt=18?(jt-=18,Ot+=1,this.words[Ot]|=Ct>>>26):jt+=8}this._strip()};function ct(Pt,kt,At,Rt){for(var Wt=0,jt=0,Ot=Math.min(Pt.length,At),Ct=kt;Ct=49?jt=Dt-49+10:Dt>=17?jt=Dt-17+10:jt=Dt,it(Dt>=0&&jt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ot.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht}catch{ot.prototype.inspect=ht}else ot.prototype.inspect=ht;function ht(){return(this.red?""}var dt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],pt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(kt,At){kt=kt||10,At=At|0||1;var Rt;if(kt===16||kt==="hex"){Rt="";for(var Wt=0,jt=0,Ot=0;Ot>>24-Wt&16777215,Wt+=2,Wt>=26&&(Wt-=26,Ot--),jt!==0||Ot!==this.length-1?Rt=dt[6-Dt.length]+Dt+Rt:Rt=Dt+Rt}for(jt!==0&&(Rt=jt.toString(16)+Rt);Rt.length%At!==0;)Rt="0"+Rt;return this.negative!==0&&(Rt="-"+Rt),Rt}if(kt===(kt|0)&&kt>=2&&kt<=36){var Mt=pt[kt],Vt=mt[kt];Rt="";var Qt=this.clone();for(Qt.negative=0;!Qt.isZero();){var rn=Qt.modrn(Vt).toString(kt);Qt=Qt.idivn(Vt),Qt.isZero()?Rt=rn+Rt:Rt=dt[Mt-rn.length]+rn+Rt}for(this.isZero()&&(Rt="0"+Rt);Rt.length%At!==0;)Rt="0"+Rt;return this.negative!==0&&(Rt="-"+Rt),Rt}it(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var kt=this.words[0];return this.length===2?kt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?kt+=4503599627370496+this.words[1]*67108864:this.length>2&&it(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-kt:kt},ot.prototype.toJSON=function(){return this.toString(16,2)},at&&(ot.prototype.toBuffer=function(kt,At){return this.toArrayLike(at,kt,At)}),ot.prototype.toArray=function(kt,At){return this.toArrayLike(Array,kt,At)};var gt=function(kt,At){return kt.allocUnsafe?kt.allocUnsafe(At):new kt(At)};ot.prototype.toArrayLike=function(kt,At,Rt){this._strip();var Wt=this.byteLength(),jt=Rt||Math.max(1,Wt);it(Wt<=jt,"byte array longer than desired length"),it(jt>0,"Requested array length <= 0");var Ot=gt(kt,jt),Ct=At==="le"?"LE":"BE";return this["_toArrayLike"+Ct](Ot,Wt),Ot},ot.prototype._toArrayLikeLE=function(kt,At){for(var Rt=0,Wt=0,jt=0,Ot=0;jt>8&255),Rt>16&255),Ot===6?(Rt>24&255),Wt=0,Ot=0):(Wt=Ct>>>24,Ot+=2)}if(Rt=0&&(kt[Rt--]=Ct>>8&255),Rt>=0&&(kt[Rt--]=Ct>>16&255),Ot===6?(Rt>=0&&(kt[Rt--]=Ct>>24&255),Wt=0,Ot=0):(Wt=Ct>>>24,Ot+=2)}if(Rt>=0)for(kt[Rt--]=Wt;Rt>=0;)kt[Rt--]=0},Math.clz32?ot.prototype._countBits=function(kt){return 32-Math.clz32(kt)}:ot.prototype._countBits=function(kt){var At=kt,Rt=0;return At>=4096&&(Rt+=13,At>>>=13),At>=64&&(Rt+=7,At>>>=7),At>=8&&(Rt+=4,At>>>=4),At>=2&&(Rt+=2,At>>>=2),Rt+At},ot.prototype._zeroBits=function(kt){if(kt===0)return 26;var At=kt,Rt=0;return At&8191||(Rt+=13,At>>>=13),At&127||(Rt+=7,At>>>=7),At&15||(Rt+=4,At>>>=4),At&3||(Rt+=2,At>>>=2),At&1||Rt++,Rt},ot.prototype.bitLength=function(){var kt=this.words[this.length-1],At=this._countBits(kt);return(this.length-1)*26+At};function bt(Pt){for(var kt=new Array(Pt.bitLength()),At=0;At>>Wt&1}return kt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var kt=0,At=0;Atkt.length?this.clone().ior(kt):kt.clone().ior(this)},ot.prototype.uor=function(kt){return this.length>kt.length?this.clone().iuor(kt):kt.clone().iuor(this)},ot.prototype.iuand=function(kt){var At;this.length>kt.length?At=kt:At=this;for(var Rt=0;Rtkt.length?this.clone().iand(kt):kt.clone().iand(this)},ot.prototype.uand=function(kt){return this.length>kt.length?this.clone().iuand(kt):kt.clone().iuand(this)},ot.prototype.iuxor=function(kt){var At,Rt;this.length>kt.length?(At=this,Rt=kt):(At=kt,Rt=this);for(var Wt=0;Wtkt.length?this.clone().ixor(kt):kt.clone().ixor(this)},ot.prototype.uxor=function(kt){return this.length>kt.length?this.clone().iuxor(kt):kt.clone().iuxor(this)},ot.prototype.inotn=function(kt){it(typeof kt=="number"&&kt>=0);var At=Math.ceil(kt/26)|0,Rt=kt%26;this._expand(At),Rt>0&&At--;for(var Wt=0;Wt0&&(this.words[Wt]=~this.words[Wt]&67108863>>26-Rt),this._strip()},ot.prototype.notn=function(kt){return this.clone().inotn(kt)},ot.prototype.setn=function(kt,At){it(typeof kt=="number"&&kt>=0);var Rt=kt/26|0,Wt=kt%26;return this._expand(Rt+1),At?this.words[Rt]=this.words[Rt]|1<kt.length?(Rt=this,Wt=kt):(Rt=kt,Wt=this);for(var jt=0,Ot=0;Ot>>26;for(;jt!==0&&Ot>>26;if(this.length=Rt.length,jt!==0)this.words[this.length]=jt,this.length++;else if(Rt!==this)for(;Otkt.length?this.clone().iadd(kt):kt.clone().iadd(this)},ot.prototype.isub=function(kt){if(kt.negative!==0){kt.negative=0;var At=this.iadd(kt);return kt.negative=1,At._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(kt),this.negative=1,this._normSign();var Rt=this.cmp(kt);if(Rt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Wt,jt;Rt>0?(Wt=this,jt=kt):(Wt=kt,jt=this);for(var Ot=0,Ct=0;Ct>26,this.words[Ct]=At&67108863;for(;Ot!==0&&Ct>26,this.words[Ct]=At&67108863;if(Ot===0&&Ct>>26,Qt=Dt&67108863,rn=Math.min(Mt,kt.length-1),Xt=Math.max(0,Mt-Pt.length+1);Xt<=rn;Xt++){var an=Mt-Xt|0;Wt=Pt.words[an]|0,jt=kt.words[Xt]|0,Ot=Wt*jt+Qt,Vt+=Ot/67108864|0,Qt=Ot&67108863}At.words[Mt]=Qt|0,Dt=Vt|0}return Dt!==0?At.words[Mt]=Dt|0:At.length--,At._strip()}var wt=function(kt,At,Rt){var Wt=kt.words,jt=At.words,Ot=Rt.words,Ct=0,Dt,Mt,Vt,Qt=Wt[0]|0,rn=Qt&8191,Xt=Qt>>>13,an=Wt[1]|0,tn=an&8191,pn=an>>>13,vn=Wt[2]|0,sn=vn&8191,Zt=vn>>>13,Sn=Wt[3]|0,Tn=Sn&8191,Cn=Sn>>>13,jn=Wt[4]|0,Un=jn&8191,yn=jn>>>13,un=Wt[5]|0,En=un&8191,In=un>>>13,xn=Wt[6]|0,dn=xn&8191,cn=xn>>>13,hn=Wt[7]|0,$n=hn&8191,nn=hn>>>13,Kt=Wt[8]|0,Yt=Kt&8191,_n=Kt>>>13,Mn=Wt[9]|0,Bn=Mn&8191,Nn=Mn>>>13,qn=jt[0]|0,Wn=qn&8191,Vn=qn>>>13,Fn=jt[1]|0,Jn=Fn&8191,Hn=Fn>>>13,dr=jt[2]|0,ur=dr&8191,_r=dr>>>13,Qr=jt[3]|0,jr=Qr&8191,Mr=Qr>>>13,qr=jt[4]|0,Ur=qr&8191,Lr=qr>>>13,ao=jt[5]|0,Gr=ao&8191,Br=ao>>>13,go=jt[6]|0,wn=go&8191,Pn=go>>>13,fn=jt[7]|0,Jt=fn&8191,kn=fn>>>13,On=jt[8]|0,Dn=On&8191,Kn=On>>>13,er=jt[9]|0,or=er&8191,ar=er>>>13;Rt.negative=kt.negative^At.negative,Rt.length=19,Dt=Math.imul(rn,Wn),Mt=Math.imul(rn,Vn),Mt=Mt+Math.imul(Xt,Wn)|0,Vt=Math.imul(Xt,Vn);var Vr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Dt=Math.imul(tn,Wn),Mt=Math.imul(tn,Vn),Mt=Mt+Math.imul(pn,Wn)|0,Vt=Math.imul(pn,Vn),Dt=Dt+Math.imul(rn,Jn)|0,Mt=Mt+Math.imul(rn,Hn)|0,Mt=Mt+Math.imul(Xt,Jn)|0,Vt=Vt+Math.imul(Xt,Hn)|0;var wr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(wr>>>26)|0,wr&=67108863,Dt=Math.imul(sn,Wn),Mt=Math.imul(sn,Vn),Mt=Mt+Math.imul(Zt,Wn)|0,Vt=Math.imul(Zt,Vn),Dt=Dt+Math.imul(tn,Jn)|0,Mt=Mt+Math.imul(tn,Hn)|0,Mt=Mt+Math.imul(pn,Jn)|0,Vt=Vt+Math.imul(pn,Hn)|0,Dt=Dt+Math.imul(rn,ur)|0,Mt=Mt+Math.imul(rn,_r)|0,Mt=Mt+Math.imul(Xt,ur)|0,Vt=Vt+Math.imul(Xt,_r)|0;var Or=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Or>>>26)|0,Or&=67108863,Dt=Math.imul(Tn,Wn),Mt=Math.imul(Tn,Vn),Mt=Mt+Math.imul(Cn,Wn)|0,Vt=Math.imul(Cn,Vn),Dt=Dt+Math.imul(sn,Jn)|0,Mt=Mt+Math.imul(sn,Hn)|0,Mt=Mt+Math.imul(Zt,Jn)|0,Vt=Vt+Math.imul(Zt,Hn)|0,Dt=Dt+Math.imul(tn,ur)|0,Mt=Mt+Math.imul(tn,_r)|0,Mt=Mt+Math.imul(pn,ur)|0,Vt=Vt+Math.imul(pn,_r)|0,Dt=Dt+Math.imul(rn,jr)|0,Mt=Mt+Math.imul(rn,Mr)|0,Mt=Mt+Math.imul(Xt,jr)|0,Vt=Vt+Math.imul(Xt,Mr)|0;var Hr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Dt=Math.imul(Un,Wn),Mt=Math.imul(Un,Vn),Mt=Mt+Math.imul(yn,Wn)|0,Vt=Math.imul(yn,Vn),Dt=Dt+Math.imul(Tn,Jn)|0,Mt=Mt+Math.imul(Tn,Hn)|0,Mt=Mt+Math.imul(Cn,Jn)|0,Vt=Vt+Math.imul(Cn,Hn)|0,Dt=Dt+Math.imul(sn,ur)|0,Mt=Mt+Math.imul(sn,_r)|0,Mt=Mt+Math.imul(Zt,ur)|0,Vt=Vt+Math.imul(Zt,_r)|0,Dt=Dt+Math.imul(tn,jr)|0,Mt=Mt+Math.imul(tn,Mr)|0,Mt=Mt+Math.imul(pn,jr)|0,Vt=Vt+Math.imul(pn,Mr)|0,Dt=Dt+Math.imul(rn,Ur)|0,Mt=Mt+Math.imul(rn,Lr)|0,Mt=Mt+Math.imul(Xt,Ur)|0,Vt=Vt+Math.imul(Xt,Lr)|0;var no=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(no>>>26)|0,no&=67108863,Dt=Math.imul(En,Wn),Mt=Math.imul(En,Vn),Mt=Mt+Math.imul(In,Wn)|0,Vt=Math.imul(In,Vn),Dt=Dt+Math.imul(Un,Jn)|0,Mt=Mt+Math.imul(Un,Hn)|0,Mt=Mt+Math.imul(yn,Jn)|0,Vt=Vt+Math.imul(yn,Hn)|0,Dt=Dt+Math.imul(Tn,ur)|0,Mt=Mt+Math.imul(Tn,_r)|0,Mt=Mt+Math.imul(Cn,ur)|0,Vt=Vt+Math.imul(Cn,_r)|0,Dt=Dt+Math.imul(sn,jr)|0,Mt=Mt+Math.imul(sn,Mr)|0,Mt=Mt+Math.imul(Zt,jr)|0,Vt=Vt+Math.imul(Zt,Mr)|0,Dt=Dt+Math.imul(tn,Ur)|0,Mt=Mt+Math.imul(tn,Lr)|0,Mt=Mt+Math.imul(pn,Ur)|0,Vt=Vt+Math.imul(pn,Lr)|0,Dt=Dt+Math.imul(rn,Gr)|0,Mt=Mt+Math.imul(rn,Br)|0,Mt=Mt+Math.imul(Xt,Gr)|0,Vt=Vt+Math.imul(Xt,Br)|0;var Xr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,Dt=Math.imul(dn,Wn),Mt=Math.imul(dn,Vn),Mt=Mt+Math.imul(cn,Wn)|0,Vt=Math.imul(cn,Vn),Dt=Dt+Math.imul(En,Jn)|0,Mt=Mt+Math.imul(En,Hn)|0,Mt=Mt+Math.imul(In,Jn)|0,Vt=Vt+Math.imul(In,Hn)|0,Dt=Dt+Math.imul(Un,ur)|0,Mt=Mt+Math.imul(Un,_r)|0,Mt=Mt+Math.imul(yn,ur)|0,Vt=Vt+Math.imul(yn,_r)|0,Dt=Dt+Math.imul(Tn,jr)|0,Mt=Mt+Math.imul(Tn,Mr)|0,Mt=Mt+Math.imul(Cn,jr)|0,Vt=Vt+Math.imul(Cn,Mr)|0,Dt=Dt+Math.imul(sn,Ur)|0,Mt=Mt+Math.imul(sn,Lr)|0,Mt=Mt+Math.imul(Zt,Ur)|0,Vt=Vt+Math.imul(Zt,Lr)|0,Dt=Dt+Math.imul(tn,Gr)|0,Mt=Mt+Math.imul(tn,Br)|0,Mt=Mt+Math.imul(pn,Gr)|0,Vt=Vt+Math.imul(pn,Br)|0,Dt=Dt+Math.imul(rn,wn)|0,Mt=Mt+Math.imul(rn,Pn)|0,Mt=Mt+Math.imul(Xt,wn)|0,Vt=Vt+Math.imul(Xt,Pn)|0;var Jr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Dt=Math.imul($n,Wn),Mt=Math.imul($n,Vn),Mt=Mt+Math.imul(nn,Wn)|0,Vt=Math.imul(nn,Vn),Dt=Dt+Math.imul(dn,Jn)|0,Mt=Mt+Math.imul(dn,Hn)|0,Mt=Mt+Math.imul(cn,Jn)|0,Vt=Vt+Math.imul(cn,Hn)|0,Dt=Dt+Math.imul(En,ur)|0,Mt=Mt+Math.imul(En,_r)|0,Mt=Mt+Math.imul(In,ur)|0,Vt=Vt+Math.imul(In,_r)|0,Dt=Dt+Math.imul(Un,jr)|0,Mt=Mt+Math.imul(Un,Mr)|0,Mt=Mt+Math.imul(yn,jr)|0,Vt=Vt+Math.imul(yn,Mr)|0,Dt=Dt+Math.imul(Tn,Ur)|0,Mt=Mt+Math.imul(Tn,Lr)|0,Mt=Mt+Math.imul(Cn,Ur)|0,Vt=Vt+Math.imul(Cn,Lr)|0,Dt=Dt+Math.imul(sn,Gr)|0,Mt=Mt+Math.imul(sn,Br)|0,Mt=Mt+Math.imul(Zt,Gr)|0,Vt=Vt+Math.imul(Zt,Br)|0,Dt=Dt+Math.imul(tn,wn)|0,Mt=Mt+Math.imul(tn,Pn)|0,Mt=Mt+Math.imul(pn,wn)|0,Vt=Vt+Math.imul(pn,Pn)|0,Dt=Dt+Math.imul(rn,Jt)|0,Mt=Mt+Math.imul(rn,kn)|0,Mt=Mt+Math.imul(Xt,Jt)|0,Vt=Vt+Math.imul(Xt,kn)|0;var br=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(br>>>26)|0,br&=67108863,Dt=Math.imul(Yt,Wn),Mt=Math.imul(Yt,Vn),Mt=Mt+Math.imul(_n,Wn)|0,Vt=Math.imul(_n,Vn),Dt=Dt+Math.imul($n,Jn)|0,Mt=Mt+Math.imul($n,Hn)|0,Mt=Mt+Math.imul(nn,Jn)|0,Vt=Vt+Math.imul(nn,Hn)|0,Dt=Dt+Math.imul(dn,ur)|0,Mt=Mt+Math.imul(dn,_r)|0,Mt=Mt+Math.imul(cn,ur)|0,Vt=Vt+Math.imul(cn,_r)|0,Dt=Dt+Math.imul(En,jr)|0,Mt=Mt+Math.imul(En,Mr)|0,Mt=Mt+Math.imul(In,jr)|0,Vt=Vt+Math.imul(In,Mr)|0,Dt=Dt+Math.imul(Un,Ur)|0,Mt=Mt+Math.imul(Un,Lr)|0,Mt=Mt+Math.imul(yn,Ur)|0,Vt=Vt+Math.imul(yn,Lr)|0,Dt=Dt+Math.imul(Tn,Gr)|0,Mt=Mt+Math.imul(Tn,Br)|0,Mt=Mt+Math.imul(Cn,Gr)|0,Vt=Vt+Math.imul(Cn,Br)|0,Dt=Dt+Math.imul(sn,wn)|0,Mt=Mt+Math.imul(sn,Pn)|0,Mt=Mt+Math.imul(Zt,wn)|0,Vt=Vt+Math.imul(Zt,Pn)|0,Dt=Dt+Math.imul(tn,Jt)|0,Mt=Mt+Math.imul(tn,kn)|0,Mt=Mt+Math.imul(pn,Jt)|0,Vt=Vt+Math.imul(pn,kn)|0,Dt=Dt+Math.imul(rn,Dn)|0,Mt=Mt+Math.imul(rn,Kn)|0,Mt=Mt+Math.imul(Xt,Dn)|0,Vt=Vt+Math.imul(Xt,Kn)|0;var $r=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+($r>>>26)|0,$r&=67108863,Dt=Math.imul(Bn,Wn),Mt=Math.imul(Bn,Vn),Mt=Mt+Math.imul(Nn,Wn)|0,Vt=Math.imul(Nn,Vn),Dt=Dt+Math.imul(Yt,Jn)|0,Mt=Mt+Math.imul(Yt,Hn)|0,Mt=Mt+Math.imul(_n,Jn)|0,Vt=Vt+Math.imul(_n,Hn)|0,Dt=Dt+Math.imul($n,ur)|0,Mt=Mt+Math.imul($n,_r)|0,Mt=Mt+Math.imul(nn,ur)|0,Vt=Vt+Math.imul(nn,_r)|0,Dt=Dt+Math.imul(dn,jr)|0,Mt=Mt+Math.imul(dn,Mr)|0,Mt=Mt+Math.imul(cn,jr)|0,Vt=Vt+Math.imul(cn,Mr)|0,Dt=Dt+Math.imul(En,Ur)|0,Mt=Mt+Math.imul(En,Lr)|0,Mt=Mt+Math.imul(In,Ur)|0,Vt=Vt+Math.imul(In,Lr)|0,Dt=Dt+Math.imul(Un,Gr)|0,Mt=Mt+Math.imul(Un,Br)|0,Mt=Mt+Math.imul(yn,Gr)|0,Vt=Vt+Math.imul(yn,Br)|0,Dt=Dt+Math.imul(Tn,wn)|0,Mt=Mt+Math.imul(Tn,Pn)|0,Mt=Mt+Math.imul(Cn,wn)|0,Vt=Vt+Math.imul(Cn,Pn)|0,Dt=Dt+Math.imul(sn,Jt)|0,Mt=Mt+Math.imul(sn,kn)|0,Mt=Mt+Math.imul(Zt,Jt)|0,Vt=Vt+Math.imul(Zt,kn)|0,Dt=Dt+Math.imul(tn,Dn)|0,Mt=Mt+Math.imul(tn,Kn)|0,Mt=Mt+Math.imul(pn,Dn)|0,Vt=Vt+Math.imul(pn,Kn)|0,Dt=Dt+Math.imul(rn,or)|0,Mt=Mt+Math.imul(rn,ar)|0,Mt=Mt+Math.imul(Xt,or)|0,Vt=Vt+Math.imul(Xt,ar)|0;var Dr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Dt=Math.imul(Bn,Jn),Mt=Math.imul(Bn,Hn),Mt=Mt+Math.imul(Nn,Jn)|0,Vt=Math.imul(Nn,Hn),Dt=Dt+Math.imul(Yt,ur)|0,Mt=Mt+Math.imul(Yt,_r)|0,Mt=Mt+Math.imul(_n,ur)|0,Vt=Vt+Math.imul(_n,_r)|0,Dt=Dt+Math.imul($n,jr)|0,Mt=Mt+Math.imul($n,Mr)|0,Mt=Mt+Math.imul(nn,jr)|0,Vt=Vt+Math.imul(nn,Mr)|0,Dt=Dt+Math.imul(dn,Ur)|0,Mt=Mt+Math.imul(dn,Lr)|0,Mt=Mt+Math.imul(cn,Ur)|0,Vt=Vt+Math.imul(cn,Lr)|0,Dt=Dt+Math.imul(En,Gr)|0,Mt=Mt+Math.imul(En,Br)|0,Mt=Mt+Math.imul(In,Gr)|0,Vt=Vt+Math.imul(In,Br)|0,Dt=Dt+Math.imul(Un,wn)|0,Mt=Mt+Math.imul(Un,Pn)|0,Mt=Mt+Math.imul(yn,wn)|0,Vt=Vt+Math.imul(yn,Pn)|0,Dt=Dt+Math.imul(Tn,Jt)|0,Mt=Mt+Math.imul(Tn,kn)|0,Mt=Mt+Math.imul(Cn,Jt)|0,Vt=Vt+Math.imul(Cn,kn)|0,Dt=Dt+Math.imul(sn,Dn)|0,Mt=Mt+Math.imul(sn,Kn)|0,Mt=Mt+Math.imul(Zt,Dn)|0,Vt=Vt+Math.imul(Zt,Kn)|0,Dt=Dt+Math.imul(tn,or)|0,Mt=Mt+Math.imul(tn,ar)|0,Mt=Mt+Math.imul(pn,or)|0,Vt=Vt+Math.imul(pn,ar)|0;var Cr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Dt=Math.imul(Bn,ur),Mt=Math.imul(Bn,_r),Mt=Mt+Math.imul(Nn,ur)|0,Vt=Math.imul(Nn,_r),Dt=Dt+Math.imul(Yt,jr)|0,Mt=Mt+Math.imul(Yt,Mr)|0,Mt=Mt+Math.imul(_n,jr)|0,Vt=Vt+Math.imul(_n,Mr)|0,Dt=Dt+Math.imul($n,Ur)|0,Mt=Mt+Math.imul($n,Lr)|0,Mt=Mt+Math.imul(nn,Ur)|0,Vt=Vt+Math.imul(nn,Lr)|0,Dt=Dt+Math.imul(dn,Gr)|0,Mt=Mt+Math.imul(dn,Br)|0,Mt=Mt+Math.imul(cn,Gr)|0,Vt=Vt+Math.imul(cn,Br)|0,Dt=Dt+Math.imul(En,wn)|0,Mt=Mt+Math.imul(En,Pn)|0,Mt=Mt+Math.imul(In,wn)|0,Vt=Vt+Math.imul(In,Pn)|0,Dt=Dt+Math.imul(Un,Jt)|0,Mt=Mt+Math.imul(Un,kn)|0,Mt=Mt+Math.imul(yn,Jt)|0,Vt=Vt+Math.imul(yn,kn)|0,Dt=Dt+Math.imul(Tn,Dn)|0,Mt=Mt+Math.imul(Tn,Kn)|0,Mt=Mt+Math.imul(Cn,Dn)|0,Vt=Vt+Math.imul(Cn,Kn)|0,Dt=Dt+Math.imul(sn,or)|0,Mt=Mt+Math.imul(sn,ar)|0,Mt=Mt+Math.imul(Zt,or)|0,Vt=Vt+Math.imul(Zt,ar)|0;var Ar=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,Dt=Math.imul(Bn,jr),Mt=Math.imul(Bn,Mr),Mt=Mt+Math.imul(Nn,jr)|0,Vt=Math.imul(Nn,Mr),Dt=Dt+Math.imul(Yt,Ur)|0,Mt=Mt+Math.imul(Yt,Lr)|0,Mt=Mt+Math.imul(_n,Ur)|0,Vt=Vt+Math.imul(_n,Lr)|0,Dt=Dt+Math.imul($n,Gr)|0,Mt=Mt+Math.imul($n,Br)|0,Mt=Mt+Math.imul(nn,Gr)|0,Vt=Vt+Math.imul(nn,Br)|0,Dt=Dt+Math.imul(dn,wn)|0,Mt=Mt+Math.imul(dn,Pn)|0,Mt=Mt+Math.imul(cn,wn)|0,Vt=Vt+Math.imul(cn,Pn)|0,Dt=Dt+Math.imul(En,Jt)|0,Mt=Mt+Math.imul(En,kn)|0,Mt=Mt+Math.imul(In,Jt)|0,Vt=Vt+Math.imul(In,kn)|0,Dt=Dt+Math.imul(Un,Dn)|0,Mt=Mt+Math.imul(Un,Kn)|0,Mt=Mt+Math.imul(yn,Dn)|0,Vt=Vt+Math.imul(yn,Kn)|0,Dt=Dt+Math.imul(Tn,or)|0,Mt=Mt+Math.imul(Tn,ar)|0,Mt=Mt+Math.imul(Cn,or)|0,Vt=Vt+Math.imul(Cn,ar)|0;var Nr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Dt=Math.imul(Bn,Ur),Mt=Math.imul(Bn,Lr),Mt=Mt+Math.imul(Nn,Ur)|0,Vt=Math.imul(Nn,Lr),Dt=Dt+Math.imul(Yt,Gr)|0,Mt=Mt+Math.imul(Yt,Br)|0,Mt=Mt+Math.imul(_n,Gr)|0,Vt=Vt+Math.imul(_n,Br)|0,Dt=Dt+Math.imul($n,wn)|0,Mt=Mt+Math.imul($n,Pn)|0,Mt=Mt+Math.imul(nn,wn)|0,Vt=Vt+Math.imul(nn,Pn)|0,Dt=Dt+Math.imul(dn,Jt)|0,Mt=Mt+Math.imul(dn,kn)|0,Mt=Mt+Math.imul(cn,Jt)|0,Vt=Vt+Math.imul(cn,kn)|0,Dt=Dt+Math.imul(En,Dn)|0,Mt=Mt+Math.imul(En,Kn)|0,Mt=Mt+Math.imul(In,Dn)|0,Vt=Vt+Math.imul(In,Kn)|0,Dt=Dt+Math.imul(Un,or)|0,Mt=Mt+Math.imul(Un,ar)|0,Mt=Mt+Math.imul(yn,or)|0,Vt=Vt+Math.imul(yn,ar)|0;var Fr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Dt=Math.imul(Bn,Gr),Mt=Math.imul(Bn,Br),Mt=Mt+Math.imul(Nn,Gr)|0,Vt=Math.imul(Nn,Br),Dt=Dt+Math.imul(Yt,wn)|0,Mt=Mt+Math.imul(Yt,Pn)|0,Mt=Mt+Math.imul(_n,wn)|0,Vt=Vt+Math.imul(_n,Pn)|0,Dt=Dt+Math.imul($n,Jt)|0,Mt=Mt+Math.imul($n,kn)|0,Mt=Mt+Math.imul(nn,Jt)|0,Vt=Vt+Math.imul(nn,kn)|0,Dt=Dt+Math.imul(dn,Dn)|0,Mt=Mt+Math.imul(dn,Kn)|0,Mt=Mt+Math.imul(cn,Dn)|0,Vt=Vt+Math.imul(cn,Kn)|0,Dt=Dt+Math.imul(En,or)|0,Mt=Mt+Math.imul(En,ar)|0,Mt=Mt+Math.imul(In,or)|0,Vt=Vt+Math.imul(In,ar)|0;var Pr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Dt=Math.imul(Bn,wn),Mt=Math.imul(Bn,Pn),Mt=Mt+Math.imul(Nn,wn)|0,Vt=Math.imul(Nn,Pn),Dt=Dt+Math.imul(Yt,Jt)|0,Mt=Mt+Math.imul(Yt,kn)|0,Mt=Mt+Math.imul(_n,Jt)|0,Vt=Vt+Math.imul(_n,kn)|0,Dt=Dt+Math.imul($n,Dn)|0,Mt=Mt+Math.imul($n,Kn)|0,Mt=Mt+Math.imul(nn,Dn)|0,Vt=Vt+Math.imul(nn,Kn)|0,Dt=Dt+Math.imul(dn,or)|0,Mt=Mt+Math.imul(dn,ar)|0,Mt=Mt+Math.imul(cn,or)|0,Vt=Vt+Math.imul(cn,ar)|0;var _i=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(_i>>>26)|0,_i&=67108863,Dt=Math.imul(Bn,Jt),Mt=Math.imul(Bn,kn),Mt=Mt+Math.imul(Nn,Jt)|0,Vt=Math.imul(Nn,kn),Dt=Dt+Math.imul(Yt,Dn)|0,Mt=Mt+Math.imul(Yt,Kn)|0,Mt=Mt+Math.imul(_n,Dn)|0,Vt=Vt+Math.imul(_n,Kn)|0,Dt=Dt+Math.imul($n,or)|0,Mt=Mt+Math.imul($n,ar)|0,Mt=Mt+Math.imul(nn,or)|0,Vt=Vt+Math.imul(nn,ar)|0;var nr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(nr>>>26)|0,nr&=67108863,Dt=Math.imul(Bn,Dn),Mt=Math.imul(Bn,Kn),Mt=Mt+Math.imul(Nn,Dn)|0,Vt=Math.imul(Nn,Kn),Dt=Dt+Math.imul(Yt,or)|0,Mt=Mt+Math.imul(Yt,ar)|0,Mt=Mt+Math.imul(_n,or)|0,Vt=Vt+Math.imul(_n,ar)|0;var xr=(Ct+Dt|0)+((Mt&8191)<<13)|0;Ct=(Vt+(Mt>>>13)|0)+(xr>>>26)|0,xr&=67108863,Dt=Math.imul(Bn,or),Mt=Math.imul(Bn,ar),Mt=Mt+Math.imul(Nn,or)|0,Vt=Math.imul(Nn,ar);var cr=(Ct+Dt|0)+((Mt&8191)<<13)|0;return Ct=(Vt+(Mt>>>13)|0)+(cr>>>26)|0,cr&=67108863,Ot[0]=Vr,Ot[1]=wr,Ot[2]=Or,Ot[3]=Hr,Ot[4]=no,Ot[5]=Xr,Ot[6]=Jr,Ot[7]=br,Ot[8]=$r,Ot[9]=Dr,Ot[10]=Cr,Ot[11]=Ar,Ot[12]=Nr,Ot[13]=Fr,Ot[14]=Pr,Ot[15]=_i,Ot[16]=nr,Ot[17]=xr,Ot[18]=cr,Ct!==0&&(Ot[19]=Ct,Rt.length++),Rt};Math.imul||(wt=yt);function vt(Pt,kt,At){At.negative=kt.negative^Pt.negative,At.length=Pt.length+kt.length;for(var Rt=0,Wt=0,jt=0;jt>>26)|0,Wt+=Ot>>>26,Ot&=67108863}At.words[jt]=Ct,Rt=Ot,Ot=Wt}return Rt!==0?At.words[jt]=Rt:At.length--,At._strip()}function xt(Pt,kt,At){return vt(Pt,kt,At)}ot.prototype.mulTo=function(kt,At){var Rt,Wt=this.length+kt.length;return this.length===10&&kt.length===10?Rt=wt(this,kt,At):Wt<63?Rt=yt(this,kt,At):Wt<1024?Rt=vt(this,kt,At):Rt=xt(this,kt,At),Rt},ot.prototype.mul=function(kt){var At=new ot(null);return At.words=new Array(this.length+kt.length),this.mulTo(kt,At)},ot.prototype.mulf=function(kt){var At=new ot(null);return At.words=new Array(this.length+kt.length),xt(this,kt,At)},ot.prototype.imul=function(kt){return this.clone().mulTo(kt,this)},ot.prototype.imuln=function(kt){var At=kt<0;At&&(kt=-kt),it(typeof kt=="number"),it(kt<67108864);for(var Rt=0,Wt=0;Wt>=26,Rt+=jt/67108864|0,Rt+=Ot>>>26,this.words[Wt]=Ot&67108863}return Rt!==0&&(this.words[Wt]=Rt,this.length++),At?this.ineg():this},ot.prototype.muln=function(kt){return this.clone().imuln(kt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(kt){var At=bt(kt);if(At.length===0)return new ot(1);for(var Rt=this,Wt=0;Wt=0);var At=kt%26,Rt=(kt-At)/26,Wt=67108863>>>26-At<<26-At,jt;if(At!==0){var Ot=0;for(jt=0;jt>>26-At}Ot&&(this.words[jt]=Ot,this.length++)}if(Rt!==0){for(jt=this.length-1;jt>=0;jt--)this.words[jt+Rt]=this.words[jt];for(jt=0;jt=0);var Wt;At?Wt=(At-At%26)/26:Wt=0;var jt=kt%26,Ot=Math.min((kt-jt)/26,this.length),Ct=67108863^67108863>>>jt<Ot)for(this.length-=Ot,Mt=0;Mt=0&&(Vt!==0||Mt>=Wt);Mt--){var Qt=this.words[Mt]|0;this.words[Mt]=Vt<<26-jt|Qt>>>jt,Vt=Qt&Ct}return Dt&&Vt!==0&&(Dt.words[Dt.length++]=Vt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ot.prototype.ishrn=function(kt,At,Rt){return it(this.negative===0),this.iushrn(kt,At,Rt)},ot.prototype.shln=function(kt){return this.clone().ishln(kt)},ot.prototype.ushln=function(kt){return this.clone().iushln(kt)},ot.prototype.shrn=function(kt){return this.clone().ishrn(kt)},ot.prototype.ushrn=function(kt){return this.clone().iushrn(kt)},ot.prototype.testn=function(kt){it(typeof kt=="number"&&kt>=0);var At=kt%26,Rt=(kt-At)/26,Wt=1<=0);var At=kt%26,Rt=(kt-At)/26;if(it(this.negative===0,"imaskn works only with positive numbers"),this.length<=Rt)return this;if(At!==0&&Rt++,this.length=Math.min(Rt,this.length),At!==0){var Wt=67108863^67108863>>>At<=67108864;At++)this.words[At]-=67108864,At===this.length-1?this.words[At+1]=1:this.words[At+1]++;return this.length=Math.max(this.length,At+1),this},ot.prototype.isubn=function(kt){if(it(typeof kt=="number"),it(kt<67108864),kt<0)return this.iaddn(-kt);if(this.negative!==0)return this.negative=0,this.iaddn(kt),this.negative=1,this;if(this.words[0]-=kt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var At=0;At>26)-(Dt/67108864|0),this.words[jt+Rt]=Ot&67108863}for(;jt>26,this.words[jt+Rt]=Ot&67108863;if(Ct===0)return this._strip();for(it(Ct===-1),Ct=0,jt=0;jt>26,this.words[jt]=Ot&67108863;return this.negative=1,this._strip()},ot.prototype._wordDiv=function(kt,At){var Rt=this.length-kt.length,Wt=this.clone(),jt=kt,Ot=jt.words[jt.length-1]|0,Ct=this._countBits(Ot);Rt=26-Ct,Rt!==0&&(jt=jt.ushln(Rt),Wt.iushln(Rt),Ot=jt.words[jt.length-1]|0);var Dt=Wt.length-jt.length,Mt;if(At!=="mod"){Mt=new ot(null),Mt.length=Dt+1,Mt.words=new Array(Mt.length);for(var Vt=0;Vt=0;rn--){var Xt=(Wt.words[jt.length+rn]|0)*67108864+(Wt.words[jt.length+rn-1]|0);for(Xt=Math.min(Xt/Ot|0,67108863),Wt._ishlnsubmul(jt,Xt,rn);Wt.negative!==0;)Xt--,Wt.negative=0,Wt._ishlnsubmul(jt,1,rn),Wt.isZero()||(Wt.negative^=1);Mt&&(Mt.words[rn]=Xt)}return Mt&&Mt._strip(),Wt._strip(),At!=="div"&&Rt!==0&&Wt.iushrn(Rt),{div:Mt||null,mod:Wt}},ot.prototype.divmod=function(kt,At,Rt){if(it(!kt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Wt,jt,Ot;return this.negative!==0&&kt.negative===0?(Ot=this.neg().divmod(kt,At),At!=="mod"&&(Wt=Ot.div.neg()),At!=="div"&&(jt=Ot.mod.neg(),Rt&&jt.negative!==0&&jt.iadd(kt)),{div:Wt,mod:jt}):this.negative===0&&kt.negative!==0?(Ot=this.divmod(kt.neg(),At),At!=="mod"&&(Wt=Ot.div.neg()),{div:Wt,mod:Ot.mod}):this.negative&kt.negative?(Ot=this.neg().divmod(kt.neg(),At),At!=="div"&&(jt=Ot.mod.neg(),Rt&&jt.negative!==0&&jt.isub(kt)),{div:Ot.div,mod:jt}):kt.length>this.length||this.cmp(kt)<0?{div:new ot(0),mod:this}:kt.length===1?At==="div"?{div:this.divn(kt.words[0]),mod:null}:At==="mod"?{div:null,mod:new ot(this.modrn(kt.words[0]))}:{div:this.divn(kt.words[0]),mod:new ot(this.modrn(kt.words[0]))}:this._wordDiv(kt,At)},ot.prototype.div=function(kt){return this.divmod(kt,"div",!1).div},ot.prototype.mod=function(kt){return this.divmod(kt,"mod",!1).mod},ot.prototype.umod=function(kt){return this.divmod(kt,"mod",!0).mod},ot.prototype.divRound=function(kt){var At=this.divmod(kt);if(At.mod.isZero())return At.div;var Rt=At.div.negative!==0?At.mod.isub(kt):At.mod,Wt=kt.ushrn(1),jt=kt.andln(1),Ot=Rt.cmp(Wt);return Ot<0||jt===1&&Ot===0?At.div:At.div.negative!==0?At.div.isubn(1):At.div.iaddn(1)},ot.prototype.modrn=function(kt){var At=kt<0;At&&(kt=-kt),it(kt<=67108863);for(var Rt=(1<<26)%kt,Wt=0,jt=this.length-1;jt>=0;jt--)Wt=(Rt*Wt+(this.words[jt]|0))%kt;return At?-Wt:Wt},ot.prototype.modn=function(kt){return this.modrn(kt)},ot.prototype.idivn=function(kt){var At=kt<0;At&&(kt=-kt),it(kt<=67108863);for(var Rt=0,Wt=this.length-1;Wt>=0;Wt--){var jt=(this.words[Wt]|0)+Rt*67108864;this.words[Wt]=jt/kt|0,Rt=jt%kt}return this._strip(),At?this.ineg():this},ot.prototype.divn=function(kt){return this.clone().idivn(kt)},ot.prototype.egcd=function(kt){it(kt.negative===0),it(!kt.isZero());var At=this,Rt=kt.clone();At.negative!==0?At=At.umod(kt):At=At.clone();for(var Wt=new ot(1),jt=new ot(0),Ot=new ot(0),Ct=new ot(1),Dt=0;At.isEven()&&Rt.isEven();)At.iushrn(1),Rt.iushrn(1),++Dt;for(var Mt=Rt.clone(),Vt=At.clone();!At.isZero();){for(var Qt=0,rn=1;!(At.words[0]&rn)&&Qt<26;++Qt,rn<<=1);if(Qt>0)for(At.iushrn(Qt);Qt-- >0;)(Wt.isOdd()||jt.isOdd())&&(Wt.iadd(Mt),jt.isub(Vt)),Wt.iushrn(1),jt.iushrn(1);for(var Xt=0,an=1;!(Rt.words[0]&an)&&Xt<26;++Xt,an<<=1);if(Xt>0)for(Rt.iushrn(Xt);Xt-- >0;)(Ot.isOdd()||Ct.isOdd())&&(Ot.iadd(Mt),Ct.isub(Vt)),Ot.iushrn(1),Ct.iushrn(1);At.cmp(Rt)>=0?(At.isub(Rt),Wt.isub(Ot),jt.isub(Ct)):(Rt.isub(At),Ot.isub(Wt),Ct.isub(jt))}return{a:Ot,b:Ct,gcd:Rt.iushln(Dt)}},ot.prototype._invmp=function(kt){it(kt.negative===0),it(!kt.isZero());var At=this,Rt=kt.clone();At.negative!==0?At=At.umod(kt):At=At.clone();for(var Wt=new ot(1),jt=new ot(0),Ot=Rt.clone();At.cmpn(1)>0&&Rt.cmpn(1)>0;){for(var Ct=0,Dt=1;!(At.words[0]&Dt)&&Ct<26;++Ct,Dt<<=1);if(Ct>0)for(At.iushrn(Ct);Ct-- >0;)Wt.isOdd()&&Wt.iadd(Ot),Wt.iushrn(1);for(var Mt=0,Vt=1;!(Rt.words[0]&Vt)&&Mt<26;++Mt,Vt<<=1);if(Mt>0)for(Rt.iushrn(Mt);Mt-- >0;)jt.isOdd()&&jt.iadd(Ot),jt.iushrn(1);At.cmp(Rt)>=0?(At.isub(Rt),Wt.isub(jt)):(Rt.isub(At),jt.isub(Wt))}var Qt;return At.cmpn(1)===0?Qt=Wt:Qt=jt,Qt.cmpn(0)<0&&Qt.iadd(kt),Qt},ot.prototype.gcd=function(kt){if(this.isZero())return kt.abs();if(kt.isZero())return this.abs();var At=this.clone(),Rt=kt.clone();At.negative=0,Rt.negative=0;for(var Wt=0;At.isEven()&&Rt.isEven();Wt++)At.iushrn(1),Rt.iushrn(1);do{for(;At.isEven();)At.iushrn(1);for(;Rt.isEven();)Rt.iushrn(1);var jt=At.cmp(Rt);if(jt<0){var Ot=At;At=Rt,Rt=Ot}else if(jt===0||Rt.cmpn(1)===0)break;At.isub(Rt)}while(!0);return Rt.iushln(Wt)},ot.prototype.invm=function(kt){return this.egcd(kt).a.umod(kt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(kt){return this.words[0]&kt},ot.prototype.bincn=function(kt){it(typeof kt=="number");var At=kt%26,Rt=(kt-At)/26,Wt=1<>>26,Ct&=67108863,this.words[Ot]=Ct}return jt!==0&&(this.words[Ot]=jt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(kt){var At=kt<0;if(this.negative!==0&&!At)return-1;if(this.negative===0&&At)return 1;this._strip();var Rt;if(this.length>1)Rt=1;else{At&&(kt=-kt),it(kt<=67108863,"Number is too big");var Wt=this.words[0]|0;Rt=Wt===kt?0:Wtkt.length)return 1;if(this.length=0;Rt--){var Wt=this.words[Rt]|0,jt=kt.words[Rt]|0;if(Wt!==jt){Wtjt&&(At=1);break}}return At},ot.prototype.gtn=function(kt){return this.cmpn(kt)===1},ot.prototype.gt=function(kt){return this.cmp(kt)===1},ot.prototype.gten=function(kt){return this.cmpn(kt)>=0},ot.prototype.gte=function(kt){return this.cmp(kt)>=0},ot.prototype.ltn=function(kt){return this.cmpn(kt)===-1},ot.prototype.lt=function(kt){return this.cmp(kt)===-1},ot.prototype.lten=function(kt){return this.cmpn(kt)<=0},ot.prototype.lte=function(kt){return this.cmp(kt)<=0},ot.prototype.eqn=function(kt){return this.cmpn(kt)===0},ot.prototype.eq=function(kt){return this.cmp(kt)===0},ot.red=function(kt){return new Lt(kt)},ot.prototype.toRed=function(kt){return it(!this.red,"Already a number in reduction context"),it(this.negative===0,"red works only with positives"),kt.convertTo(this)._forceRed(kt)},ot.prototype.fromRed=function(){return it(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(kt){return this.red=kt,this},ot.prototype.forceRed=function(kt){return it(!this.red,"Already a number in reduction context"),this._forceRed(kt)},ot.prototype.redAdd=function(kt){return it(this.red,"redAdd works only with red numbers"),this.red.add(this,kt)},ot.prototype.redIAdd=function(kt){return it(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,kt)},ot.prototype.redSub=function(kt){return it(this.red,"redSub works only with red numbers"),this.red.sub(this,kt)},ot.prototype.redISub=function(kt){return it(this.red,"redISub works only with red numbers"),this.red.isub(this,kt)},ot.prototype.redShl=function(kt){return it(this.red,"redShl works only with red numbers"),this.red.shl(this,kt)},ot.prototype.redMul=function(kt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,kt),this.red.mul(this,kt)},ot.prototype.redIMul=function(kt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,kt),this.red.imul(this,kt)},ot.prototype.redSqr=function(){return it(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return it(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return it(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return it(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return it(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(kt){return it(this.red&&!kt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,kt)};var St={k256:null,p224:null,p192:null,p25519:null};function Et(Pt,kt){this.name=Pt,this.p=new ot(kt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Et.prototype._tmp=function(){var kt=new ot(null);return kt.words=new Array(Math.ceil(this.n/13)),kt},Et.prototype.ireduce=function(kt){var At=kt,Rt;do this.split(At,this.tmp),At=this.imulK(At),At=At.iadd(this.tmp),Rt=At.bitLength();while(Rt>this.n);var Wt=Rt0?At.isub(this.p):At.strip!==void 0?At.strip():At._strip(),At},Et.prototype.split=function(kt,At){kt.iushrn(this.n,0,At)},Et.prototype.imulK=function(kt){return kt.imul(this.k)};function It(){Et.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}rt(It,Et),It.prototype.split=function(kt,At){for(var Rt=4194303,Wt=Math.min(kt.length,9),jt=0;jt>>22,Ot=Ct}Ot>>>=22,kt.words[jt-10]=Ot,Ot===0&&kt.length>10?kt.length-=10:kt.length-=9},It.prototype.imulK=function(kt){kt.words[kt.length]=0,kt.words[kt.length+1]=0,kt.length+=2;for(var At=0,Rt=0;Rt>>=26,kt.words[Rt]=jt,At=Wt}return At!==0&&(kt.words[kt.length++]=At),kt},ot._prime=function(kt){if(St[kt])return St[kt];var At;if(kt==="k256")At=new It;else if(kt==="p224")At=new Tt;else if(kt==="p192")At=new $t;else if(kt==="p25519")At=new Ut;else throw new Error("Unknown prime "+kt);return St[kt]=At,At};function Lt(Pt){if(typeof Pt=="string"){var kt=ot._prime(Pt);this.m=kt.p,this.prime=kt}else it(Pt.gtn(1),"modulus must be greater than 1"),this.m=Pt,this.prime=null}Lt.prototype._verify1=function(kt){it(kt.negative===0,"red works only with positives"),it(kt.red,"red works only with red numbers")},Lt.prototype._verify2=function(kt,At){it((kt.negative|At.negative)===0,"red works only with positives"),it(kt.red&&kt.red===At.red,"red works only with red numbers")},Lt.prototype.imod=function(kt){return this.prime?this.prime.ireduce(kt)._forceRed(this):(ut(kt,kt.umod(this.m)._forceRed(this)),kt)},Lt.prototype.neg=function(kt){return kt.isZero()?kt.clone():this.m.sub(kt)._forceRed(this)},Lt.prototype.add=function(kt,At){this._verify2(kt,At);var Rt=kt.add(At);return Rt.cmp(this.m)>=0&&Rt.isub(this.m),Rt._forceRed(this)},Lt.prototype.iadd=function(kt,At){this._verify2(kt,At);var Rt=kt.iadd(At);return Rt.cmp(this.m)>=0&&Rt.isub(this.m),Rt},Lt.prototype.sub=function(kt,At){this._verify2(kt,At);var Rt=kt.sub(At);return Rt.cmpn(0)<0&&Rt.iadd(this.m),Rt._forceRed(this)},Lt.prototype.isub=function(kt,At){this._verify2(kt,At);var Rt=kt.isub(At);return Rt.cmpn(0)<0&&Rt.iadd(this.m),Rt},Lt.prototype.shl=function(kt,At){return this._verify1(kt),this.imod(kt.ushln(At))},Lt.prototype.imul=function(kt,At){return this._verify2(kt,At),this.imod(kt.imul(At))},Lt.prototype.mul=function(kt,At){return this._verify2(kt,At),this.imod(kt.mul(At))},Lt.prototype.isqr=function(kt){return this.imul(kt,kt.clone())},Lt.prototype.sqr=function(kt){return this.mul(kt,kt)},Lt.prototype.sqrt=function(kt){if(kt.isZero())return kt.clone();var At=this.m.andln(3);if(it(At%2===1),At===3){var Rt=this.m.add(new ot(1)).iushrn(2);return this.pow(kt,Rt)}for(var Wt=this.m.subn(1),jt=0;!Wt.isZero()&&Wt.andln(1)===0;)jt++,Wt.iushrn(1);it(!Wt.isZero());var Ot=new ot(1).toRed(this),Ct=Ot.redNeg(),Dt=this.m.subn(1).iushrn(1),Mt=this.m.bitLength();for(Mt=new ot(2*Mt*Mt).toRed(this);this.pow(Mt,Dt).cmp(Ct)!==0;)Mt.redIAdd(Ct);for(var Vt=this.pow(Mt,Wt),Qt=this.pow(kt,Wt.addn(1).iushrn(1)),rn=this.pow(kt,Wt),Xt=jt;rn.cmp(Ot)!==0;){for(var an=rn,tn=0;an.cmp(Ot)!==0;tn++)an=an.redSqr();it(tn=0;jt--){for(var Vt=At.words[jt],Qt=Mt-1;Qt>=0;Qt--){var rn=Vt>>Qt&1;if(Ot!==Wt[0]&&(Ot=this.sqr(Ot)),rn===0&&Ct===0){Dt=0;continue}Ct<<=1,Ct|=rn,Dt++,!(Dt!==Rt&&(jt!==0||Qt!==0))&&(Ot=this.mul(Ot,Wt[Ct]),Dt=0,Ct=0)}Mt=26}return Ot},Lt.prototype.convertTo=function(kt){var At=kt.umod(this.m);return At===kt?At.clone():At},Lt.prototype.convertFrom=function(kt){var At=kt.clone();return At.red=null,At},ot.mont=function(kt){return new Bt(kt)};function Bt(Pt){Lt.call(this,Pt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}rt(Bt,Lt),Bt.prototype.convertTo=function(kt){return this.imod(kt.ushln(this.shift))},Bt.prototype.convertFrom=function(kt){var At=this.imod(kt.mul(this.rinv));return At.red=null,At},Bt.prototype.imul=function(kt,At){if(kt.isZero()||At.isZero())return kt.words[0]=0,kt.length=1,kt;var Rt=kt.imul(At),Wt=Rt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),jt=Rt.isub(Wt).iushrn(this.shift),Ot=jt;return jt.cmp(this.m)>=0?Ot=jt.isub(this.m):jt.cmpn(0)<0&&(Ot=jt.iadd(this.m)),Ot._forceRed(this)},Bt.prototype.mul=function(kt,At){if(kt.isZero()||At.isZero())return new ot(0)._forceRed(this);var Rt=kt.mul(At),Wt=Rt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),jt=Rt.isub(Wt).iushrn(this.shift),Ot=jt;return jt.cmp(this.m)>=0?Ot=jt.isub(this.m):jt.cmpn(0)<0&&(Ot=jt.iadd(this.m)),Ot._forceRed(this)},Bt.prototype.invm=function(kt){var At=this.imod(kt._invmp(this.m).mul(this.r2));return At._forceRed(this)}})(tt,commonjsGlobal)})(bn);var bnExports=bn.exports,asn1$3={},asn1$2={},api={},encoders={},buffer$1=buffer$2,Buffer$d=buffer$1.Buffer,safer={},key;for(key in buffer$1)buffer$1.hasOwnProperty(key)&&(key==="SlowBuffer"||key==="Buffer"||(safer[key]=buffer$1[key]));var Safer=safer.Buffer={};for(key in Buffer$d)Buffer$d.hasOwnProperty(key)&&(key==="allocUnsafe"||key==="allocUnsafeSlow"||(Safer[key]=Buffer$d[key]));safer.Buffer.prototype=Buffer$d.prototype;(!Safer.from||Safer.from===Uint8Array.from)&&(Safer.from=function(tt,et,nt){if(typeof tt=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof tt);if(tt&&typeof tt.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof tt);return Buffer$d(tt,et,nt)});Safer.alloc||(Safer.alloc=function(tt,et,nt){if(typeof tt!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof tt);if(tt<0||tt>=2*(1<<30))throw new RangeError('The value "'+tt+'" is invalid for option "size"');var it=Buffer$d(tt);return!et||et.length===0?it.fill(0):typeof nt=="string"?it.fill(et,nt):it.fill(et),it});if(!safer.kStringMaxLength)try{safer.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}safer.constants||(safer.constants={MAX_LENGTH:safer.kMaxLength},safer.kStringMaxLength&&(safer.constants.MAX_STRING_LENGTH=safer.kStringMaxLength));var safer_1=safer,reporter={};const inherits$6=inherits_browserExports;function Reporter$2(tt){this._reporterState={obj:null,path:[],options:tt||{},errors:[]}}reporter.Reporter=Reporter$2;Reporter$2.prototype.isError=function(et){return et instanceof ReporterError};Reporter$2.prototype.save=function(){const et=this._reporterState;return{obj:et.obj,pathLen:et.path.length}};Reporter$2.prototype.restore=function(et){const nt=this._reporterState;nt.obj=et.obj,nt.path=nt.path.slice(0,et.pathLen)};Reporter$2.prototype.enterKey=function(et){return this._reporterState.path.push(et)};Reporter$2.prototype.exitKey=function(et){const nt=this._reporterState;nt.path=nt.path.slice(0,et-1)};Reporter$2.prototype.leaveKey=function(et,nt,it){const rt=this._reporterState;this.exitKey(et),rt.obj!==null&&(rt.obj[nt]=it)};Reporter$2.prototype.path=function(){return this._reporterState.path.join("/")};Reporter$2.prototype.enterObject=function(){const et=this._reporterState,nt=et.obj;return et.obj={},nt};Reporter$2.prototype.leaveObject=function(et){const nt=this._reporterState,it=nt.obj;return nt.obj=et,it};Reporter$2.prototype.error=function(et){let nt;const it=this._reporterState,rt=et instanceof ReporterError;if(rt?nt=et:nt=new ReporterError(it.path.map(function(ot){return"["+JSON.stringify(ot)+"]"}).join(""),et.message||et,et.stack),!it.options.partial)throw nt;return rt||it.errors.push(nt),nt};Reporter$2.prototype.wrapResult=function(et){const nt=this._reporterState;return nt.options.partial?{result:this.isError(et)?null:et,errors:nt.errors}:et};function ReporterError(tt,et){this.path=tt,this.rethrow(et)}inherits$6(ReporterError,Error);ReporterError.prototype.rethrow=function(et){if(this.message=et+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(nt){this.stack=nt.stack}return this};var buffer={};const inherits$5=inherits_browserExports,Reporter$1=reporter.Reporter,Buffer$c=safer_1.Buffer;function DecoderBuffer$2(tt,et){if(Reporter$1.call(this,et),!Buffer$c.isBuffer(tt)){this.error("Input not Buffer");return}this.base=tt,this.offset=0,this.length=tt.length}inherits$5(DecoderBuffer$2,Reporter$1);buffer.DecoderBuffer=DecoderBuffer$2;DecoderBuffer$2.isDecoderBuffer=function(et){return et instanceof DecoderBuffer$2?!0:typeof et=="object"&&Buffer$c.isBuffer(et.base)&&et.constructor.name==="DecoderBuffer"&&typeof et.offset=="number"&&typeof et.length=="number"&&typeof et.save=="function"&&typeof et.restore=="function"&&typeof et.isEmpty=="function"&&typeof et.readUInt8=="function"&&typeof et.skip=="function"&&typeof et.raw=="function"};DecoderBuffer$2.prototype.save=function(){return{offset:this.offset,reporter:Reporter$1.prototype.save.call(this)}};DecoderBuffer$2.prototype.restore=function(et){const nt=new DecoderBuffer$2(this.base);return nt.offset=et.offset,nt.length=this.offset,this.offset=et.offset,Reporter$1.prototype.restore.call(this,et.reporter),nt};DecoderBuffer$2.prototype.isEmpty=function(){return this.offset===this.length};DecoderBuffer$2.prototype.readUInt8=function(et){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(et||"DecoderBuffer overrun")};DecoderBuffer$2.prototype.skip=function(et,nt){if(!(this.offset+et<=this.length))return this.error(nt||"DecoderBuffer overrun");const it=new DecoderBuffer$2(this.base);return it._reporterState=this._reporterState,it.offset=this.offset,it.length=this.offset+et,this.offset+=et,it};DecoderBuffer$2.prototype.raw=function(et){return this.base.slice(et?et.offset:this.offset,this.length)};function EncoderBuffer$1(tt,et){if(Array.isArray(tt))this.length=0,this.value=tt.map(function(nt){return EncoderBuffer$1.isEncoderBuffer(nt)||(nt=new EncoderBuffer$1(nt,et)),this.length+=nt.length,nt},this);else if(typeof tt=="number"){if(!(0<=tt&&tt<=255))return et.error("non-byte EncoderBuffer value");this.value=tt,this.length=1}else if(typeof tt=="string")this.value=tt,this.length=Buffer$c.byteLength(tt);else if(Buffer$c.isBuffer(tt))this.value=tt,this.length=tt.length;else return et.error("Unsupported type: "+typeof tt)}buffer.EncoderBuffer=EncoderBuffer$1;EncoderBuffer$1.isEncoderBuffer=function(et){return et instanceof EncoderBuffer$1?!0:typeof et=="object"&&et.constructor.name==="EncoderBuffer"&&typeof et.length=="number"&&typeof et.join=="function"};EncoderBuffer$1.prototype.join=function(et,nt){return et||(et=Buffer$c.alloc(this.length)),nt||(nt=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(it){it.join(et,nt),nt+=it.length}):(typeof this.value=="number"?et[nt]=this.value:typeof this.value=="string"?et.write(this.value,nt):Buffer$c.isBuffer(this.value)&&this.value.copy(et,nt),nt+=this.length)),et};const Reporter=reporter.Reporter,EncoderBuffer=buffer.EncoderBuffer,DecoderBuffer$1=buffer.DecoderBuffer,assert$5=minimalisticAssert,tags$1=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags$1),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node$3(tt,et,nt){const it={};this._baseState=it,it.name=nt,it.enc=tt,it.parent=et||null,it.children=null,it.tag=null,it.args=null,it.reverseArgs=null,it.choice=null,it.optional=!1,it.any=!1,it.obj=!1,it.use=null,it.useDecoder=null,it.key=null,it.default=null,it.explicit=null,it.implicit=null,it.contains=null,it.parent||(it.children=[],this._wrap())}var node$3=Node$3;const stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node$3.prototype.clone=function(){const et=this._baseState,nt={};stateProps.forEach(function(rt){nt[rt]=et[rt]});const it=new this.constructor(nt.parent);return it._baseState=nt,it};Node$3.prototype._wrap=function(){const et=this._baseState;methods.forEach(function(nt){this[nt]=function(){const rt=new this.constructor(this);return et.children.push(rt),rt[nt].apply(rt,arguments)}},this)};Node$3.prototype._init=function(et){const nt=this._baseState;assert$5(nt.parent===null),et.call(this),nt.children=nt.children.filter(function(it){return it._baseState.parent===this},this),assert$5.equal(nt.children.length,1,"Root node can have only one child")};Node$3.prototype._useArgs=function(et){const nt=this._baseState,it=et.filter(function(rt){return rt instanceof this.constructor},this);et=et.filter(function(rt){return!(rt instanceof this.constructor)},this),it.length!==0&&(assert$5(nt.children===null),nt.children=it,it.forEach(function(rt){rt._baseState.parent=this},this)),et.length!==0&&(assert$5(nt.args===null),nt.args=et,nt.reverseArgs=et.map(function(rt){if(typeof rt!="object"||rt.constructor!==Object)return rt;const ot={};return Object.keys(rt).forEach(function(at){at==(at|0)&&(at|=0);const st=rt[at];ot[st]=at}),ot}))};overrided.forEach(function(tt){Node$3.prototype[tt]=function(){const nt=this._baseState;throw new Error(tt+" not implemented for encoding: "+nt.enc)}});tags$1.forEach(function(tt){Node$3.prototype[tt]=function(){const nt=this._baseState,it=Array.prototype.slice.call(arguments);return assert$5(nt.tag===null),nt.tag=tt,this._useArgs(it),this}});Node$3.prototype.use=function(et){assert$5(et);const nt=this._baseState;return assert$5(nt.use===null),nt.use=et,this};Node$3.prototype.optional=function(){const et=this._baseState;return et.optional=!0,this};Node$3.prototype.def=function(et){const nt=this._baseState;return assert$5(nt.default===null),nt.default=et,nt.optional=!0,this};Node$3.prototype.explicit=function(et){const nt=this._baseState;return assert$5(nt.explicit===null&&nt.implicit===null),nt.explicit=et,this};Node$3.prototype.implicit=function(et){const nt=this._baseState;return assert$5(nt.explicit===null&&nt.implicit===null),nt.implicit=et,this};Node$3.prototype.obj=function(){const et=this._baseState,nt=Array.prototype.slice.call(arguments);return et.obj=!0,nt.length!==0&&this._useArgs(nt),this};Node$3.prototype.key=function(et){const nt=this._baseState;return assert$5(nt.key===null),nt.key=et,this};Node$3.prototype.any=function(){const et=this._baseState;return et.any=!0,this};Node$3.prototype.choice=function(et){const nt=this._baseState;return assert$5(nt.choice===null),nt.choice=et,this._useArgs(Object.keys(et).map(function(it){return et[it]})),this};Node$3.prototype.contains=function(et){const nt=this._baseState;return assert$5(nt.use===null),nt.contains=et,this};Node$3.prototype._decode=function(et,nt){const it=this._baseState;if(it.parent===null)return et.wrapResult(it.children[0]._decode(et,nt));let rt=it.default,ot=!0,at=null;if(it.key!==null&&(at=et.enterKey(it.key)),it.optional){let lt=null;if(it.explicit!==null?lt=it.explicit:it.implicit!==null?lt=it.implicit:it.tag!==null&&(lt=it.tag),lt===null&&!it.any){const ct=et.save();try{it.choice===null?this._decodeGeneric(it.tag,et,nt):this._decodeChoice(et,nt),ot=!0}catch{ot=!1}et.restore(ct)}else if(ot=this._peekTag(et,lt,it.any),et.isError(ot))return ot}let st;if(it.obj&&ot&&(st=et.enterObject()),ot){if(it.explicit!==null){const ct=this._decodeTag(et,it.explicit);if(et.isError(ct))return ct;et=ct}const lt=et.offset;if(it.use===null&&it.choice===null){let ct;it.any&&(ct=et.save());const ut=this._decodeTag(et,it.implicit!==null?it.implicit:it.tag,it.any);if(et.isError(ut))return ut;it.any?rt=et.raw(ct):et=ut}if(nt&&nt.track&&it.tag!==null&&nt.track(et.path(),lt,et.length,"tagged"),nt&&nt.track&&it.tag!==null&&nt.track(et.path(),et.offset,et.length,"content"),it.any||(it.choice===null?rt=this._decodeGeneric(it.tag,et,nt):rt=this._decodeChoice(et,nt)),et.isError(rt))return rt;if(!it.any&&it.choice===null&&it.children!==null&&it.children.forEach(function(ut){ut._decode(et,nt)}),it.contains&&(it.tag==="octstr"||it.tag==="bitstr")){const ct=new DecoderBuffer$1(rt);rt=this._getUse(it.contains,et._reporterState.obj)._decode(ct,nt)}}return it.obj&&ot&&(rt=et.leaveObject(st)),it.key!==null&&(rt!==null||ot===!0)?et.leaveKey(at,it.key,rt):at!==null&&et.exitKey(at),rt};Node$3.prototype._decodeGeneric=function(et,nt,it){const rt=this._baseState;return et==="seq"||et==="set"?null:et==="seqof"||et==="setof"?this._decodeList(nt,et,rt.args[0],it):/str$/.test(et)?this._decodeStr(nt,et,it):et==="objid"&&rt.args?this._decodeObjid(nt,rt.args[0],rt.args[1],it):et==="objid"?this._decodeObjid(nt,null,null,it):et==="gentime"||et==="utctime"?this._decodeTime(nt,et,it):et==="null_"?this._decodeNull(nt,it):et==="bool"?this._decodeBool(nt,it):et==="objDesc"?this._decodeStr(nt,et,it):et==="int"||et==="enum"?this._decodeInt(nt,rt.args&&rt.args[0],it):rt.use!==null?this._getUse(rt.use,nt._reporterState.obj)._decode(nt,it):nt.error("unknown tag: "+et)};Node$3.prototype._getUse=function(et,nt){const it=this._baseState;return it.useDecoder=this._use(et,nt),assert$5(it.useDecoder._baseState.parent===null),it.useDecoder=it.useDecoder._baseState.children[0],it.implicit!==it.useDecoder._baseState.implicit&&(it.useDecoder=it.useDecoder.clone(),it.useDecoder._baseState.implicit=it.implicit),it.useDecoder};Node$3.prototype._decodeChoice=function(et,nt){const it=this._baseState;let rt=null,ot=!1;return Object.keys(it.choice).some(function(at){const st=et.save(),lt=it.choice[at];try{const ct=lt._decode(et,nt);if(et.isError(ct))return!1;rt={type:at,value:ct},ot=!0}catch{return et.restore(st),!1}return!0},this),ot?rt:et.error("Choice not matched")};Node$3.prototype._createEncoderBuffer=function(et){return new EncoderBuffer(et,this.reporter)};Node$3.prototype._encode=function(et,nt,it){const rt=this._baseState;if(rt.default!==null&&rt.default===et)return;const ot=this._encodeValue(et,nt,it);if(ot!==void 0&&!this._skipDefault(ot,nt,it))return ot};Node$3.prototype._encodeValue=function(et,nt,it){const rt=this._baseState;if(rt.parent===null)return rt.children[0]._encode(et,nt||new Reporter);let ot=null;if(this.reporter=nt,rt.optional&&et===void 0)if(rt.default!==null)et=rt.default;else return;let at=null,st=!1;if(rt.any)ot=this._createEncoderBuffer(et);else if(rt.choice)ot=this._encodeChoice(et,nt);else if(rt.contains)at=this._getUse(rt.contains,it)._encode(et,nt),st=!0;else if(rt.children)at=rt.children.map(function(lt){if(lt._baseState.tag==="null_")return lt._encode(null,nt,et);if(lt._baseState.key===null)return nt.error("Child should have a key");const ct=nt.enterKey(lt._baseState.key);if(typeof et!="object")return nt.error("Child expected, but input is not object");const ut=lt._encode(et[lt._baseState.key],nt,et);return nt.leaveKey(ct),ut},this).filter(function(lt){return lt}),at=this._createEncoderBuffer(at);else if(rt.tag==="seqof"||rt.tag==="setof"){if(!(rt.args&&rt.args.length===1))return nt.error("Too many args for : "+rt.tag);if(!Array.isArray(et))return nt.error("seqof/setof, but data is not Array");const lt=this.clone();lt._baseState.implicit=null,at=this._createEncoderBuffer(et.map(function(ct){const ut=this._baseState;return this._getUse(ut.args[0],et)._encode(ct,nt)},lt))}else rt.use!==null?ot=this._getUse(rt.use,it)._encode(et,nt):(at=this._encodePrimitive(rt.tag,et),st=!0);if(!rt.any&&rt.choice===null){const lt=rt.implicit!==null?rt.implicit:rt.tag,ct=rt.implicit===null?"universal":"context";lt===null?rt.use===null&&nt.error("Tag could be omitted only for .use()"):rt.use===null&&(ot=this._encodeComposite(lt,st,ct,at))}return rt.explicit!==null&&(ot=this._encodeComposite(rt.explicit,!1,"context",ot)),ot};Node$3.prototype._encodeChoice=function(et,nt){const it=this._baseState,rt=it.choice[et.type];return rt||assert$5(!1,et.type+" not found in "+JSON.stringify(Object.keys(it.choice))),rt._encode(et.value,nt)};Node$3.prototype._encodePrimitive=function(et,nt){const it=this._baseState;if(/str$/.test(et))return this._encodeStr(nt,et);if(et==="objid"&&it.args)return this._encodeObjid(nt,it.reverseArgs[0],it.args[1]);if(et==="objid")return this._encodeObjid(nt,null,null);if(et==="gentime"||et==="utctime")return this._encodeTime(nt,et);if(et==="null_")return this._encodeNull();if(et==="int"||et==="enum")return this._encodeInt(nt,it.args&&it.reverseArgs[0]);if(et==="bool")return this._encodeBool(nt);if(et==="objDesc")return this._encodeStr(nt,et);throw new Error("Unsupported tag: "+et)};Node$3.prototype._isNumstr=function(et){return/^[0-9 ]*$/.test(et)};Node$3.prototype._isPrintstr=function(et){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(et)};var der$2={};(function(tt){function et(nt){const it={};return Object.keys(nt).forEach(function(rt){(rt|0)==rt&&(rt=rt|0);const ot=nt[rt];it[ot]=rt}),it}tt.tagClass={0:"universal",1:"application",2:"context",3:"private"},tt.tagClassByName=et(tt.tagClass),tt.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},tt.tagByName=et(tt.tag)})(der$2);const inherits$4=inherits_browserExports,Buffer$b=safer_1.Buffer,Node$2=node$3,der$1=der$2;function DEREncoder$1(tt){this.enc="der",this.name=tt.name,this.entity=tt,this.tree=new DERNode$1,this.tree._init(tt.body)}var der_1$1=DEREncoder$1;DEREncoder$1.prototype.encode=function(et,nt){return this.tree._encode(et,nt).join()};function DERNode$1(tt){Node$2.call(this,"der",tt)}inherits$4(DERNode$1,Node$2);DERNode$1.prototype._encodeComposite=function(et,nt,it,rt){const ot=encodeTag(et,nt,it,this.reporter);if(rt.length<128){const lt=Buffer$b.alloc(2);return lt[0]=ot,lt[1]=rt.length,this._createEncoderBuffer([lt,rt])}let at=1;for(let lt=rt.length;lt>=256;lt>>=8)at++;const st=Buffer$b.alloc(1+1+at);st[0]=ot,st[1]=128|at;for(let lt=1+at,ct=rt.length;ct>0;lt--,ct>>=8)st[lt]=ct&255;return this._createEncoderBuffer([st,rt])};DERNode$1.prototype._encodeStr=function(et,nt){if(nt==="bitstr")return this._createEncoderBuffer([et.unused|0,et.data]);if(nt==="bmpstr"){const it=Buffer$b.alloc(et.length*2);for(let rt=0;rt=40)return this.reporter.error("Second objid identifier OOB");et.splice(0,2,et[0]*40+et[1])}let rt=0;for(let st=0;st=128;lt>>=7)rt++}const ot=Buffer$b.alloc(rt);let at=ot.length-1;for(let st=et.length-1;st>=0;st--){let lt=et[st];for(ot[at--]=lt&127;(lt>>=7)>0;)ot[at--]=128|lt&127}return this._createEncoderBuffer(ot)};function two(tt){return tt<10?"0"+tt:tt}DERNode$1.prototype._encodeTime=function(et,nt){let it;const rt=new Date(et);return nt==="gentime"?it=[two(rt.getUTCFullYear()),two(rt.getUTCMonth()+1),two(rt.getUTCDate()),two(rt.getUTCHours()),two(rt.getUTCMinutes()),two(rt.getUTCSeconds()),"Z"].join(""):nt==="utctime"?it=[two(rt.getUTCFullYear()%100),two(rt.getUTCMonth()+1),two(rt.getUTCDate()),two(rt.getUTCHours()),two(rt.getUTCMinutes()),two(rt.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+nt+" time is not supported yet"),this._encodeStr(it,"octstr")};DERNode$1.prototype._encodeNull=function(){return this._createEncoderBuffer("")};DERNode$1.prototype._encodeInt=function(et,nt){if(typeof et=="string"){if(!nt)return this.reporter.error("String int or enum given, but no values map");if(!nt.hasOwnProperty(et))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(et));et=nt[et]}if(typeof et!="number"&&!Buffer$b.isBuffer(et)){const ot=et.toArray();!et.sign&&ot[0]&128&&ot.unshift(0),et=Buffer$b.from(ot)}if(Buffer$b.isBuffer(et)){let ot=et.length;et.length===0&&ot++;const at=Buffer$b.alloc(ot);return et.copy(at),et.length===0&&(at[0]=0),this._createEncoderBuffer(at)}if(et<128)return this._createEncoderBuffer(et);if(et<256)return this._createEncoderBuffer([0,et]);let it=1;for(let ot=et;ot>=256;ot>>=8)it++;const rt=new Array(it);for(let ot=rt.length-1;ot>=0;ot--)rt[ot]=et&255,et>>=8;return rt[0]&128&&rt.unshift(0),this._createEncoderBuffer(Buffer$b.from(rt))};DERNode$1.prototype._encodeBool=function(et){return this._createEncoderBuffer(et?255:0)};DERNode$1.prototype._use=function(et,nt){return typeof et=="function"&&(et=et(nt)),et._getEncoder("der").tree};DERNode$1.prototype._skipDefault=function(et,nt,it){const rt=this._baseState;let ot;if(rt.default===null)return!1;const at=et.join();if(rt.defaultBuffer===void 0&&(rt.defaultBuffer=this._encodeValue(rt.default,nt,it).join()),at.length!==rt.defaultBuffer.length)return!1;for(ot=0;ot=31?it.error("Multi-octet tag encoding unsupported"):(et||(rt|=32),rt|=der$1.tagClassByName[nt||"universal"]<<6,rt)}const inherits$3=inherits_browserExports,DEREncoder=der_1$1;function PEMEncoder(tt){DEREncoder.call(this,tt),this.enc="pem"}inherits$3(PEMEncoder,DEREncoder);var pem$1=PEMEncoder;PEMEncoder.prototype.encode=function(et,nt){const rt=DEREncoder.prototype.encode.call(this,et).toString("base64"),ot=["-----BEGIN "+nt.label+"-----"];for(let at=0;at>6],rt=(nt&32)===0;if((nt&31)===31){let at=nt;for(nt=0;(at&128)===128;){if(at=tt.readUInt8(et),tt.isError(at))return at;nt<<=7,nt|=at&127}}else nt&=31;const ot=der.tag[nt];return{cls:it,primitive:rt,tag:nt,tagStr:ot}}function derDecodeLen(tt,et,nt){let it=tt.readUInt8(nt);if(tt.isError(it))return it;if(!et&&it===128)return null;if(!(it&128))return it;const rt=it&127;if(rt>4)return tt.error("length octect is too long");it=0;for(let ot=0;ot0&&vt.ishrn(xt),vt}function mt(yt,wt){yt=pt(yt,wt),yt=yt.mod(wt);var vt=tt.from(yt.toArray());if(vt.length=0)throw new Error("invalid sig")}return verify_1=ot,verify_1}var browser$3,hasRequiredBrowser$1;function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$3;hasRequiredBrowser$1=1;var tt=safeBufferExports.Buffer,et=browser$9,nt=readableBrowserExports,it=inherits_browserExports,rt=requireSign(),ot=requireVerify(),at=require$$6;Object.keys(at).forEach(function(ht){at[ht].id=tt.from(at[ht].id,"hex"),at[ht.toLowerCase()]=at[ht]});function st(ht){nt.Writable.call(this);var dt=at[ht];if(!dt)throw new Error("Unknown message digest");this._hashType=dt.hash,this._hash=et(dt.hash),this._tag=dt.id,this._signType=dt.sign}it(st,nt.Writable),st.prototype._write=function(dt,pt,mt){this._hash.update(dt),mt()},st.prototype.update=function(dt,pt){return this._hash.update(typeof dt=="string"?tt.from(dt,pt):dt),this},st.prototype.sign=function(dt,pt){this.end();var mt=this._hash.digest(),gt=rt(mt,dt,this._hashType,this._signType,this._tag);return pt?gt.toString(pt):gt};function lt(ht){nt.Writable.call(this);var dt=at[ht];if(!dt)throw new Error("Unknown message digest");this._hash=et(dt.hash),this._tag=dt.id,this._signType=dt.sign}it(lt,nt.Writable),lt.prototype._write=function(dt,pt,mt){this._hash.update(dt),mt()},lt.prototype.update=function(dt,pt){return this._hash.update(typeof dt=="string"?tt.from(dt,pt):dt),this},lt.prototype.verify=function(dt,pt,mt){var gt=typeof pt=="string"?tt.from(pt,mt):pt;this.end();var bt=this._hash.digest();return ot(gt,bt,dt,this._signType,this._tag)};function ct(ht){return new st(ht)}function ut(ht){return new lt(ht)}return browser$3={Sign:ct,Verify:ut,createSign:ct,createVerify:ut},browser$3}var browser$2,hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser$2;hasRequiredBrowser=1;var tt=requireElliptic(),et=bnExports$2;browser$2=function(at){return new it(at)};var nt={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};nt.p224=nt.secp224r1,nt.p256=nt.secp256r1=nt.prime256v1,nt.p192=nt.secp192r1=nt.prime192v1,nt.p384=nt.secp384r1,nt.p521=nt.secp521r1;function it(ot){this.curveType=nt[ot],this.curveType||(this.curveType={name:ot}),this.curve=new tt.ec(this.curveType.name),this.keys=void 0}it.prototype.generateKeys=function(ot,at){return this.keys=this.curve.genKeyPair(),this.getPublicKey(ot,at)},it.prototype.computeSecret=function(ot,at,st){at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at));var lt=this.curve.keyFromPublic(ot).getPublic(),ct=lt.mul(this.keys.getPrivate()).getX();return rt(ct,st,this.curveType.byteLength)},it.prototype.getPublicKey=function(ot,at){var st=this.keys.getPublic(at==="compressed",!0);return at==="hybrid"&&(st[st.length-1]%2?st[0]=7:st[0]=6),rt(st,ot)},it.prototype.getPrivateKey=function(ot){return rt(this.keys.getPrivate(),ot)},it.prototype.setPublicKey=function(ot,at){return at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at)),this.keys._importPublic(ot),this},it.prototype.setPrivateKey=function(ot,at){at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at));var st=new et(ot);return st=st.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(st),this};function rt(ot,at,st){Array.isArray(ot)||(ot=ot.toArray());var lt=new Buffer(ot);if(st&<.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return it?crt$1(at,ot):withPublic$1(at,ot)};function oaep$1(tt,et){var nt=tt.modulus.byteLength(),it=et.length,rt=createHash$2("sha1").update(Buffer$5.alloc(0)).digest(),ot=rt.length,at=2*ot;if(it>nt-at-2)throw new Error("message too long");var st=Buffer$5.alloc(nt-it-at-2),lt=nt-ot-1,ct=randomBytes(ot),ut=xor$1(Buffer$5.concat([rt,st,Buffer$5.alloc(1,1),et],lt),mgf$1(ct,lt)),ht=xor$1(ct,mgf$1(ut,ot));return new BN$3(Buffer$5.concat([Buffer$5.alloc(1),ht,ut],nt))}function pkcs1$1(tt,et,nt){var it=et.length,rt=tt.modulus.byteLength();if(it>rt-11)throw new Error("message too long");var ot;return nt?ot=Buffer$5.alloc(rt-it-3,255):ot=nonZero(rt-it-3),new BN$3(Buffer$5.concat([Buffer$5.from([0,nt?1:2]),ot,Buffer$5.alloc(1),et],rt))}function nonZero(tt){for(var et=Buffer$5.allocUnsafe(tt),nt=0,it=randomBytes(tt*2),rt=0,ot;ntat||new BN$2(nt).cmp(ot.modulus)>=0)throw new Error("decryption error");var st;it?st=withPublic(new BN$2(nt),ot):st=crt(nt,ot);var lt=Buffer$4.alloc(at-st.length);if(st=Buffer$4.concat([lt,st],at),rt===4)return oaep(ot,st);if(rt===1)return pkcs1(ot,st,it);if(rt===3)return st;throw new Error("unknown padding")};function oaep(tt,et){var nt=tt.modulus.byteLength(),it=createHash$1("sha1").update(Buffer$4.alloc(0)).digest(),rt=it.length;if(et[0]!==0)throw new Error("decryption error");var ot=et.slice(1,rt+1),at=et.slice(rt+1),st=xor(ot,mgf(at,rt)),lt=xor(at,mgf(st,nt-rt-1));if(compare$1(it,lt.slice(0,rt)))throw new Error("decryption error");for(var ct=rt;lt[ct]===0;)ct++;if(lt[ct++]!==1)throw new Error("decryption error");return lt.slice(ct)}function pkcs1(tt,et,nt){for(var it=et.slice(0,2),rt=2,ot=0;et[rt++]!==0;)if(rt>=et.length){ot++;break}var at=et.slice(2,rt-1);if((it.toString("hex")!=="0002"&&!nt||it.toString("hex")!=="0001"&&nt)&&ot++,at.length<8&&ot++,ot)throw new Error("decryption error");return et.slice(rt)}function compare$1(tt,et){tt=Buffer$4.from(tt),et=Buffer$4.from(et);var nt=0,it=tt.length;tt.length!==et.length&&(nt++,it=Math.min(tt.length,et.length));for(var rt=-1;++rtMAX_UINT32)throw new RangeError("requested too many random bytes");var nt=Buffer$H.allocUnsafe(tt);if(tt>0)if(tt>MAX_BYTES)for(var it=0;it0&&(at=nt[0]),at instanceof Error)throw at;var st=new Error("Unhandled error."+(at?" ("+at.message+")":""));throw st.context=at,st}var lt=ot[et];if(lt===void 0)return!1;if(typeof lt=="function")ReflectApply(lt,this,nt);else for(var ct=lt.length,ut=arrayClone(lt,ct),it=0;it0&&at.length>rt&&!at.warned){at.warned=!0;var st=new Error("Possible EventEmitter memory leak detected. "+at.length+" "+String(et)+" listeners added. Use emitter.setMaxListeners() to increase limit");st.name="MaxListenersExceededWarning",st.emitter=tt,st.type=et,st.count=at.length,ProcessEmitWarning(st)}return tt}EventEmitter$1.prototype.addListener=function(et,nt){return _addListener(this,et,nt,!1)};EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener;EventEmitter$1.prototype.prependListener=function(et,nt){return _addListener(this,et,nt,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(tt,et,nt){var it={fired:!1,wrapFn:void 0,target:tt,type:et,listener:nt},rt=onceWrapper.bind(it);return rt.listener=nt,it.wrapFn=rt,rt}EventEmitter$1.prototype.once=function(et,nt){return checkListener(nt),this.on(et,_onceWrap(this,et,nt)),this};EventEmitter$1.prototype.prependOnceListener=function(et,nt){return checkListener(nt),this.prependListener(et,_onceWrap(this,et,nt)),this};EventEmitter$1.prototype.removeListener=function(et,nt){var it,rt,ot,at,st;if(checkListener(nt),rt=this._events,rt===void 0)return this;if(it=rt[et],it===void 0)return this;if(it===nt||it.listener===nt)--this._eventsCount===0?this._events=Object.create(null):(delete rt[et],rt.removeListener&&this.emit("removeListener",et,it.listener||nt));else if(typeof it!="function"){for(ot=-1,at=it.length-1;at>=0;at--)if(it[at]===nt||it[at].listener===nt){st=it[at].listener,ot=at;break}if(ot<0)return this;ot===0?it.shift():spliceOne(it,ot),it.length===1&&(rt[et]=it[0]),rt.removeListener!==void 0&&this.emit("removeListener",et,st||nt)}return this};EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener;EventEmitter$1.prototype.removeAllListeners=function(et){var nt,it,rt;if(it=this._events,it===void 0)return this;if(it.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):it[et]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete it[et]),this;if(arguments.length===0){var ot=Object.keys(it),at;for(rt=0;rt=0;rt--)this.removeListener(et,nt[rt]);return this};function _listeners$1(tt,et,nt){var it=tt._events;if(it===void 0)return[];var rt=it[et];return rt===void 0?[]:typeof rt=="function"?nt?[rt.listener||rt]:[rt]:nt?unwrapListeners(rt):arrayClone(rt,rt.length)}EventEmitter$1.prototype.listeners=function(et){return _listeners$1(this,et,!0)};EventEmitter$1.prototype.rawListeners=function(et){return _listeners$1(this,et,!1)};EventEmitter$1.listenerCount=function(tt,et){return typeof tt.listenerCount=="function"?tt.listenerCount(et):listenerCount.call(tt,et)};EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(tt){var et=this._events;if(et!==void 0){var nt=et[tt];if(typeof nt=="function")return 1;if(nt!==void 0)return nt.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(tt,et){for(var nt=new Array(et),it=0;it0?this.tail.next=yt:this.head=yt,this.tail=yt,++this.length}},{key:"unshift",value:function(bt){var yt={data:bt,next:this.head};this.length===0&&(this.tail=yt),this.head=yt,++this.length}},{key:"shift",value:function(){if(this.length!==0){var bt=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,bt}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(bt){if(this.length===0)return"";for(var yt=this.head,wt=""+yt.data;yt=yt.next;)wt+=bt+yt.data;return wt}},{key:"concat",value:function(bt){if(this.length===0)return ct.alloc(0);for(var yt=ct.allocUnsafe(bt>>>0),wt=this.head,vt=0;wt;)pt(wt.data,yt,vt),vt+=wt.data.length,wt=wt.next;return yt}},{key:"consume",value:function(bt,yt){var wt;return btxt.length?xt.length:bt;if(St===xt.length?vt+=xt:vt+=xt.slice(0,bt),bt-=St,bt===0){St===xt.length?(++wt,yt.next?this.head=yt.next:this.head=this.tail=null):(this.head=yt,yt.data=xt.slice(St));break}++wt}return this.length-=wt,vt}},{key:"_getBuffer",value:function(bt){var yt=ct.allocUnsafe(bt),wt=this.head,vt=1;for(wt.data.copy(yt),bt-=wt.data.length;wt=wt.next;){var xt=wt.data,St=bt>xt.length?xt.length:bt;if(xt.copy(yt,yt.length-bt,0,St),bt-=St,bt===0){St===xt.length?(++vt,wt.next?this.head=wt.next:this.head=this.tail=null):(this.head=wt,wt.data=xt.slice(St));break}++vt}return this.length-=vt,yt}},{key:dt,value:function(bt,yt){return ht(this,et(et({},yt),{},{depth:0,customInspect:!1}))}}]),mt}(),buffer_list}function destroy(tt,et){var nt=this,it=this._readableState&&this._readableState.destroyed,rt=this._writableState&&this._writableState.destroyed;return it||rt?(et?et(tt):tt&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(emitErrorNT,this,tt)):process.nextTick(emitErrorNT,this,tt)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(tt||null,function(ot){!et&&ot?nt._writableState?nt._writableState.errorEmitted?process.nextTick(emitCloseNT,nt):(nt._writableState.errorEmitted=!0,process.nextTick(emitErrorAndCloseNT,nt,ot)):process.nextTick(emitErrorAndCloseNT,nt,ot):et?(process.nextTick(emitCloseNT,nt),et(ot)):process.nextTick(emitCloseNT,nt)}),this)}function emitErrorAndCloseNT(tt,et){emitErrorNT(tt,et),emitCloseNT(tt)}function emitCloseNT(tt){tt._writableState&&!tt._writableState.emitClose||tt._readableState&&!tt._readableState.emitClose||tt.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(tt,et){tt.emit("error",et)}function errorOrDestroy(tt,et){var nt=tt._readableState,it=tt._writableState;nt&&nt.autoDestroy||it&&it.autoDestroy?tt.destroy(et):tt.emit("error",et)}var destroy_1={destroy,undestroy,errorOrDestroy},errorsBrowser={};function _inheritsLoose$2(tt,et){tt.prototype=Object.create(et.prototype),tt.prototype.constructor=tt,tt.__proto__=et}var codes={};function createErrorType(tt,et,nt){nt||(nt=Error);function it(ot,at,st){return typeof et=="string"?et:et(ot,at,st)}var rt=function(ot){_inheritsLoose$2(at,ot);function at(st,lt,ct){return ot.call(this,it(st,lt,ct))||this}return at}(nt);rt.prototype.name=nt.name,rt.prototype.code=tt,codes[tt]=rt}function oneOf(tt,et){if(Array.isArray(tt)){var nt=tt.length;return tt=tt.map(function(it){return String(it)}),nt>2?"one of ".concat(et," ").concat(tt.slice(0,nt-1).join(", "),", or ")+tt[nt-1]:nt===2?"one of ".concat(et," ").concat(tt[0]," or ").concat(tt[1]):"of ".concat(et," ").concat(tt[0])}else return"of ".concat(et," ").concat(String(tt))}function startsWith(tt,et,nt){return tt.substr(!nt||nt<0?0:+nt,et.length)===et}function endsWith(tt,et,nt){return(nt===void 0||nt>tt.length)&&(nt=tt.length),tt.substring(nt-et.length,nt)===et}function includes(tt,et,nt){return typeof nt!="number"&&(nt=0),nt+et.length>tt.length?!1:tt.indexOf(et,nt)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(tt,et){return'The value "'+et+'" is invalid for option "'+tt+'"'},TypeError);createErrorType("ERR_INVALID_ARG_TYPE",function(tt,et,nt){var it;typeof et=="string"&&startsWith(et,"not ")?(it="must not be",et=et.replace(/^not /,"")):it="must be";var rt;if(endsWith(tt," argument"))rt="The ".concat(tt," ").concat(it," ").concat(oneOf(et,"type"));else{var ot=includes(tt,".")?"property":"argument";rt='The "'.concat(tt,'" ').concat(ot," ").concat(it," ").concat(oneOf(et,"type"))}return rt+=". Received type ".concat(typeof nt),rt},TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(tt){return"The "+tt+" method is not implemented"});createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",function(tt){return"Cannot call "+tt+" after a stream was destroyed"});createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",function(tt){return"Unknown encoding: "+tt},TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");errorsBrowser.codes=codes;var ERR_INVALID_OPT_VALUE=errorsBrowser.codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(tt,et,nt){return tt.highWaterMark!=null?tt.highWaterMark:et?tt[nt]:null}function getHighWaterMark(tt,et,nt,it){var rt=highWaterMarkFrom(et,it,nt);if(rt!=null){if(!(isFinite(rt)&&Math.floor(rt)===rt)||rt<0){var ot=it?nt:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(ot,rt)}return Math.floor(rt)}return tt.objectMode?16:16*1024}var state={getHighWaterMark},browser$a=deprecate;function deprecate(tt,et){if(config$2("noDeprecation"))return tt;var nt=!1;function it(){if(!nt){if(config$2("throwDeprecation"))throw new Error(et);config$2("traceDeprecation")?console.trace(et):console.warn(et),nt=!0}return tt.apply(this,arguments)}return it}function config$2(tt){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var et=commonjsGlobal.localStorage[tt];return et==null?!1:String(et).toLowerCase()==="true"}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1,_stream_writable=It;function tt(Xt){var un=this;this.next=null,this.entry=null,this.finish=function(){cn(un,Xt)}}var et;It.WritableState=Et;var nt={deprecate:browser$a},it=streamBrowser,rt=buffer$2.Buffer,ot=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function at(Xt){return rt.from(Xt)}function st(Xt){return rt.isBuffer(Xt)||Xt instanceof ot}var lt=destroy_1,ct=state,ut=ct.getHighWaterMark,ht=errorsBrowser.codes,dt=ht.ERR_INVALID_ARG_TYPE,pt=ht.ERR_METHOD_NOT_IMPLEMENTED,mt=ht.ERR_MULTIPLE_CALLBACK,gt=ht.ERR_STREAM_CANNOT_PIPE,bt=ht.ERR_STREAM_DESTROYED,yt=ht.ERR_STREAM_NULL_VALUES,wt=ht.ERR_STREAM_WRITE_AFTER_END,vt=ht.ERR_UNKNOWN_ENCODING,xt=lt.errorOrDestroy;inherits_browserExports(It,it);function St(){}function Et(Xt,un,en){et=et||require_stream_duplex(),Xt=Xt||{},typeof en!="boolean"&&(en=un instanceof et),this.objectMode=!!Xt.objectMode,en&&(this.objectMode=this.objectMode||!!Xt.writableObjectMode),this.highWaterMark=ut(this,Xt,"writableHighWaterMark",en),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var fn=Xt.decodeStrings===!1;this.decodeStrings=!fn,this.defaultEncoding=Xt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(xn){Ct(un,xn)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Xt.emitClose!==!1,this.autoDestroy=!!Xt.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new tt(this)}Et.prototype.getBuffer=function(){for(var un=this.bufferedRequest,en=[];un;)en.push(un),un=un.next;return en},function(){try{Object.defineProperty(Et.prototype,"buffer",{get:nt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var $t;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?($t=Function.prototype[Symbol.hasInstance],Object.defineProperty(It,Symbol.hasInstance,{value:function(un){return $t.call(this,un)?!0:this!==It?!1:un&&un._writableState instanceof Et}})):$t=function(un){return un instanceof this};function It(Xt){et=et||require_stream_duplex();var un=this instanceof et;if(!un&&!$t.call(It,this))return new It(Xt);this._writableState=new Et(Xt,this,un),this.writable=!0,Xt&&(typeof Xt.write=="function"&&(this._write=Xt.write),typeof Xt.writev=="function"&&(this._writev=Xt.writev),typeof Xt.destroy=="function"&&(this._destroy=Xt.destroy),typeof Xt.final=="function"&&(this._final=Xt.final)),it.call(this)}It.prototype.pipe=function(){xt(this,new gt)};function Ft(Xt,un){var en=new wt;xt(Xt,en),process.nextTick(un,en)}function Ht(Xt,un,en,fn){var xn;return en===null?xn=new yt:typeof en!="string"&&!un.objectMode&&(xn=new dt("chunk",["string","Buffer"],en)),xn?(xt(Xt,xn),process.nextTick(fn,xn),!1):!0}It.prototype.write=function(Xt,un,en){var fn=this._writableState,xn=!1,an=!fn.objectMode&&st(Xt);return an&&!rt.isBuffer(Xt)&&(Xt=at(Xt)),typeof un=="function"&&(en=un,un=null),an?un="buffer":un||(un=fn.defaultEncoding),typeof en!="function"&&(en=St),fn.ending?Ft(this,en):(an||Ht(this,fn,Xt,en))&&(fn.pendingcb++,xn=Ot(this,fn,an,Xt,un,en)),xn},It.prototype.cork=function(){this._writableState.corked++},It.prototype.uncork=function(){var Xt=this._writableState;Xt.corked&&(Xt.corked--,!Xt.writing&&!Xt.corked&&!Xt.bufferProcessing&&Xt.bufferedRequest&&Bt(this,Xt))},It.prototype.setDefaultEncoding=function(un){if(typeof un=="string"&&(un=un.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((un+"").toLowerCase())>-1))throw new vt(un);return this._writableState.defaultEncoding=un,this},Object.defineProperty(It.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function zt(Xt,un,en){return!Xt.objectMode&&Xt.decodeStrings!==!1&&typeof un=="string"&&(un=rt.from(un,en)),un}Object.defineProperty(It.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Ot(Xt,un,en,fn,xn,an){if(!en){var Zt=zt(un,fn,xn);fn!==Zt&&(en=!0,xn="buffer",fn=Zt)}var En=un.objectMode?1:fn.length;un.length+=En;var In=un.length>5===6?2:tt>>4===14?3:tt>>3===30?4:tt>>6===2?-1:-2}function utf8CheckIncomplete(tt,et,nt){var it=et.length-1;if(it=0?(rt>0&&(tt.lastNeed=rt-1),rt):--it=0?(rt>0&&(tt.lastNeed=rt-2),rt):--it=0?(rt>0&&(rt===2?rt=0:tt.lastNeed=rt-3),rt):0))}function utf8CheckExtraBytes(tt,et,nt){if((et[0]&192)!==128)return tt.lastNeed=0,"�";if(tt.lastNeed>1&&et.length>1){if((et[1]&192)!==128)return tt.lastNeed=1,"�";if(tt.lastNeed>2&&et.length>2&&(et[2]&192)!==128)return tt.lastNeed=2,"�"}}function utf8FillLast(tt){var et=this.lastTotal-this.lastNeed,nt=utf8CheckExtraBytes(this,tt);if(nt!==void 0)return nt;if(this.lastNeed<=tt.length)return tt.copy(this.lastChar,et,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);tt.copy(this.lastChar,et,0,tt.length),this.lastNeed-=tt.length}function utf8Text(tt,et){var nt=utf8CheckIncomplete(this,tt,et);if(!this.lastNeed)return tt.toString("utf8",et);this.lastTotal=nt;var it=tt.length-(nt-this.lastNeed);return tt.copy(this.lastChar,0,it),tt.toString("utf8",et,it)}function utf8End(tt){var et=tt&&tt.length?this.write(tt):"";return this.lastNeed?et+"�":et}function utf16Text(tt,et){if((tt.length-et)%2===0){var nt=tt.toString("utf16le",et);if(nt){var it=nt.charCodeAt(nt.length-1);if(it>=55296&&it<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=tt[tt.length-2],this.lastChar[1]=tt[tt.length-1],nt.slice(0,-1)}return nt}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=tt[tt.length-1],tt.toString("utf16le",et,tt.length-1)}function utf16End(tt){var et=tt&&tt.length?this.write(tt):"";if(this.lastNeed){var nt=this.lastTotal-this.lastNeed;return et+this.lastChar.toString("utf16le",0,nt)}return et}function base64Text(tt,et){var nt=(tt.length-et)%3;return nt===0?tt.toString("base64",et):(this.lastNeed=3-nt,this.lastTotal=3,nt===1?this.lastChar[0]=tt[tt.length-1]:(this.lastChar[0]=tt[tt.length-2],this.lastChar[1]=tt[tt.length-1]),tt.toString("base64",et,tt.length-nt))}function base64End(tt){var et=tt&&tt.length?this.write(tt):"";return this.lastNeed?et+this.lastChar.toString("base64",0,3-this.lastNeed):et}function simpleWrite(tt){return tt.toString(this.encoding)}function simpleEnd(tt){return tt&&tt.length?this.write(tt):""}var ERR_STREAM_PREMATURE_CLOSE=errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;function once$1(tt){var et=!1;return function(){if(!et){et=!0;for(var nt=arguments.length,it=new Array(nt),rt=0;rt0)if(typeof Zt!="string"&&!Nn.objectMode&&Object.getPrototypeOf(Zt)!==it.prototype&&(Zt=ot(Zt)),In)Nn.endEmitted?St(an,new yt):zt(an,Nn,Zt,!0);else if(Nn.ended)St(an,new gt);else{if(Nn.destroyed)return!1;Nn.reading=!1,Nn.decoder&&!En?(Zt=Nn.decoder.write(Zt),Nn.objectMode||Zt.length!==0?zt(an,Nn,Zt,!1):Bt(an,Nn)):zt(an,Nn,Zt,!1)}else In||(Nn.reading=!1,Bt(an,Nn))}return!Nn.ended&&(Nn.length=jt?an=jt:(an--,an|=an>>>1,an|=an>>>2,an|=an>>>4,an|=an>>>8,an|=an>>>16,an++),an}function Tt(an,Zt){return an<=0||Zt.length===0&&Zt.ended?0:Zt.objectMode?1:an!==an?Zt.flowing&&Zt.length?Zt.buffer.head.data.length:Zt.length:(an>Zt.highWaterMark&&(Zt.highWaterMark=kt(an)),an<=Zt.length?an:Zt.ended?Zt.length:(Zt.needReadable=!0,0))}Ft.prototype.read=function(an){lt("read",an),an=parseInt(an,10);var Zt=this._readableState,En=an;if(an!==0&&(Zt.emittedReadable=!1),an===0&&Zt.needReadable&&((Zt.highWaterMark!==0?Zt.length>=Zt.highWaterMark:Zt.length>0)||Zt.ended))return lt("read: emitReadable",Zt.length,Zt.ended),Zt.length===0&&Zt.ended?en(this):Ut(this),null;if(an=Tt(an,Zt),an===0&&Zt.ended)return Zt.length===0&&en(this),null;var In=Zt.needReadable;lt("need readable",In),(Zt.length===0||Zt.length-an0?Cn=un(an,Zt):Cn=null,Cn===null?(Zt.needReadable=Zt.length<=Zt.highWaterMark,an=0):(Zt.length-=an,Zt.awaitDrain=0),Zt.length===0&&(Zt.ended||(Zt.needReadable=!0),En!==an&&Zt.ended&&en(this)),Cn!==null&&this.emit("data",Cn),Cn};function Ct(an,Zt){if(lt("onEofChunk"),!Zt.ended){if(Zt.decoder){var En=Zt.decoder.end();En&&En.length&&(Zt.buffer.push(En),Zt.length+=Zt.objectMode?1:En.length)}Zt.ended=!0,Zt.sync?Ut(an):(Zt.needReadable=!1,Zt.emittedReadable||(Zt.emittedReadable=!0,Nt(an)))}}function Ut(an){var Zt=an._readableState;lt("emitReadable",Zt.needReadable,Zt.emittedReadable),Zt.needReadable=!1,Zt.emittedReadable||(lt("emitReadable",Zt.flowing),Zt.emittedReadable=!0,process.nextTick(Nt,an))}function Nt(an){var Zt=an._readableState;lt("emitReadable_",Zt.destroyed,Zt.length,Zt.ended),!Zt.destroyed&&(Zt.length||Zt.ended)&&(an.emit("readable"),Zt.emittedReadable=!1),Zt.needReadable=!Zt.flowing&&!Zt.ended&&Zt.length<=Zt.highWaterMark,Xt(an)}function Bt(an,Zt){Zt.readingMore||(Zt.readingMore=!0,process.nextTick(Mt,an,Zt))}function Mt(an,Zt){for(;!Zt.reading&&!Zt.ended&&(Zt.length1&&xn(In.pipes,an)!==-1)&&!gn&&(lt("false write response, pause",In.awaitDrain),In.awaitDrain++),En.pause())}function dn(tn){lt("onerror",tn),Sn(),an.removeListener("error",dn),et(an,"error")===0&&St(an,tn)}$t(an,"error",dn);function sn(){an.removeListener("finish",rn),Sn()}an.once("close",sn);function rn(){lt("onfinish"),an.removeListener("close",sn),Sn()}an.once("finish",rn);function Sn(){lt("unpipe"),En.unpipe(an)}return an.emit("pipe",En),In.flowing||(lt("pipe resume"),En.resume()),an};function Dt(an){return function(){var En=an._readableState;lt("pipeOnDrain",En.awaitDrain),En.awaitDrain&&En.awaitDrain--,En.awaitDrain===0&&et(an,"data")&&(En.flowing=!0,Xt(an))}}Ft.prototype.unpipe=function(an){var Zt=this._readableState,En={hasUnpiped:!1};if(Zt.pipesCount===0)return this;if(Zt.pipesCount===1)return an&&an!==Zt.pipes?this:(an||(an=Zt.pipes),Zt.pipes=null,Zt.pipesCount=0,Zt.flowing=!1,an&&an.emit("unpipe",this,En),this);if(!an){var In=Zt.pipes,Cn=Zt.pipesCount;Zt.pipes=null,Zt.pipesCount=0,Zt.flowing=!1;for(var Nn=0;Nn0,In.flowing!==!1&&this.resume()):an==="readable"&&!In.endEmitted&&!In.readableListening&&(In.readableListening=In.needReadable=!0,In.flowing=!1,In.emittedReadable=!1,lt("on readable",In.length,In.reading),In.length?Ut(this):In.reading||process.nextTick(Vt,this)),En},Ft.prototype.addListener=Ft.prototype.on,Ft.prototype.removeListener=function(an,Zt){var En=nt.prototype.removeListener.call(this,an,Zt);return an==="readable"&&process.nextTick(Pt,this),En},Ft.prototype.removeAllListeners=function(an){var Zt=nt.prototype.removeAllListeners.apply(this,arguments);return(an==="readable"||an===void 0)&&process.nextTick(Pt,this),Zt};function Pt(an){var Zt=an._readableState;Zt.readableListening=an.listenerCount("readable")>0,Zt.resumeScheduled&&!Zt.paused?Zt.flowing=!0:an.listenerCount("data")>0&&an.resume()}function Vt(an){lt("readable nexttick read 0"),an.read(0)}Ft.prototype.resume=function(){var an=this._readableState;return an.flowing||(lt("resume"),an.flowing=!an.readableListening,nn(this,an)),an.paused=!1,this};function nn(an,Zt){Zt.resumeScheduled||(Zt.resumeScheduled=!0,process.nextTick(cn,an,Zt))}function cn(an,Zt){lt("resume",Zt.reading),Zt.reading||an.read(0),Zt.resumeScheduled=!1,an.emit("resume"),Xt(an),Zt.flowing&&!Zt.reading&&an.read(0)}Ft.prototype.pause=function(){return lt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(lt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Xt(an){var Zt=an._readableState;for(lt("flow",Zt.flowing);Zt.flowing&&an.read()!==null;);}Ft.prototype.wrap=function(an){var Zt=this,En=this._readableState,In=!1;an.on("end",function(){if(lt("wrapped end"),En.decoder&&!En.ended){var Un=En.decoder.end();Un&&Un.length&&Zt.push(Un)}Zt.push(null)}),an.on("data",function(Un){if(lt("wrapped data"),En.decoder&&(Un=En.decoder.write(Un)),!(En.objectMode&&Un==null)&&!(!En.objectMode&&(!Un||!Un.length))){var _n=Zt.push(Un);_n||(In=!0,an.pause())}});for(var Cn in an)this[Cn]===void 0&&typeof an[Cn]=="function"&&(this[Cn]=function(_n){return function(){return an[_n].apply(an,arguments)}}(Cn));for(var Nn=0;Nn=Zt.length?(Zt.decoder?En=Zt.buffer.join(""):Zt.buffer.length===1?En=Zt.buffer.first():En=Zt.buffer.concat(Zt.length),Zt.buffer.clear()):En=Zt.buffer.consume(an,Zt.decoder),En}function en(an){var Zt=an._readableState;lt("endReadable",Zt.endEmitted),Zt.endEmitted||(Zt.ended=!0,process.nextTick(fn,Zt,an))}function fn(an,Zt){if(lt("endReadableNT",an.endEmitted,an.length),!an.endEmitted&&an.length===0&&(an.endEmitted=!0,Zt.readable=!1,Zt.emit("end"),an.autoDestroy)){var En=Zt._writableState;(!En||En.autoDestroy&&En.finished)&&Zt.destroy()}}typeof Symbol=="function"&&(Ft.from=function(an,Zt){return xt===void 0&&(xt=requireFromBrowser()),xt(Ft,an,Zt)});function xn(an,Zt){for(var En=0,In=an.length;En0;return destroyer(at,lt,ct,function(ut){rt||(rt=ut),ut&&ot.forEach(call),!lt&&(ot.forEach(call),it(rt))})});return et.reduce(pipe$1)}var pipeline_1=pipeline;(function(tt,et){et=tt.exports=require_stream_readable(),et.Stream=et,et.Readable=et,et.Writable=require_stream_writable(),et.Duplex=require_stream_duplex(),et.Transform=_stream_transform,et.PassThrough=_stream_passthrough,et.finished=endOfStream,et.pipeline=pipeline_1})(readableBrowser,readableBrowser.exports);var readableBrowserExports=readableBrowser.exports,Buffer$F=safeBufferExports.Buffer,Transform$6=readableBrowserExports.Transform,inherits$w=inherits_browserExports;function throwIfNotStringOrBuffer(tt,et){if(!Buffer$F.isBuffer(tt)&&typeof tt!="string")throw new TypeError(et+" must be a string or a buffer")}function HashBase$2(tt){Transform$6.call(this),this._block=Buffer$F.allocUnsafe(tt),this._blockSize=tt,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits$w(HashBase$2,Transform$6);HashBase$2.prototype._transform=function(tt,et,nt){var it=null;try{this.update(tt,et)}catch(rt){it=rt}nt(it)};HashBase$2.prototype._flush=function(tt){var et=null;try{this.push(this.digest())}catch(nt){et=nt}tt(et)};HashBase$2.prototype.update=function(tt,et){if(throwIfNotStringOrBuffer(tt,"Data"),this._finalized)throw new Error("Digest already called");Buffer$F.isBuffer(tt)||(tt=Buffer$F.from(tt,et));for(var nt=this._block,it=0;this._blockOffset+tt.length-it>=this._blockSize;){for(var rt=this._blockOffset;rt0;++ot)this._length[ot]+=at,at=this._length[ot]/4294967296|0,at>0&&(this._length[ot]-=4294967296*at);return this};HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")};HashBase$2.prototype.digest=function(tt){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var et=this._digest();tt!==void 0&&(et=et.toString(tt)),this._block.fill(0),this._blockOffset=0;for(var nt=0;nt<4;++nt)this._length[nt]=0;return et};HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase$2,inherits$v=inherits_browserExports,HashBase$1=hashBase,Buffer$E=safeBufferExports.Buffer,ARRAY16$1=new Array(16);function MD5$3(){HashBase$1.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}inherits$v(MD5$3,HashBase$1);MD5$3.prototype._update=function(){for(var tt=ARRAY16$1,et=0;et<16;++et)tt[et]=this._block.readInt32LE(et*4);var nt=this._a,it=this._b,rt=this._c,ot=this._d;nt=fnF(nt,it,rt,ot,tt[0],3614090360,7),ot=fnF(ot,nt,it,rt,tt[1],3905402710,12),rt=fnF(rt,ot,nt,it,tt[2],606105819,17),it=fnF(it,rt,ot,nt,tt[3],3250441966,22),nt=fnF(nt,it,rt,ot,tt[4],4118548399,7),ot=fnF(ot,nt,it,rt,tt[5],1200080426,12),rt=fnF(rt,ot,nt,it,tt[6],2821735955,17),it=fnF(it,rt,ot,nt,tt[7],4249261313,22),nt=fnF(nt,it,rt,ot,tt[8],1770035416,7),ot=fnF(ot,nt,it,rt,tt[9],2336552879,12),rt=fnF(rt,ot,nt,it,tt[10],4294925233,17),it=fnF(it,rt,ot,nt,tt[11],2304563134,22),nt=fnF(nt,it,rt,ot,tt[12],1804603682,7),ot=fnF(ot,nt,it,rt,tt[13],4254626195,12),rt=fnF(rt,ot,nt,it,tt[14],2792965006,17),it=fnF(it,rt,ot,nt,tt[15],1236535329,22),nt=fnG(nt,it,rt,ot,tt[1],4129170786,5),ot=fnG(ot,nt,it,rt,tt[6],3225465664,9),rt=fnG(rt,ot,nt,it,tt[11],643717713,14),it=fnG(it,rt,ot,nt,tt[0],3921069994,20),nt=fnG(nt,it,rt,ot,tt[5],3593408605,5),ot=fnG(ot,nt,it,rt,tt[10],38016083,9),rt=fnG(rt,ot,nt,it,tt[15],3634488961,14),it=fnG(it,rt,ot,nt,tt[4],3889429448,20),nt=fnG(nt,it,rt,ot,tt[9],568446438,5),ot=fnG(ot,nt,it,rt,tt[14],3275163606,9),rt=fnG(rt,ot,nt,it,tt[3],4107603335,14),it=fnG(it,rt,ot,nt,tt[8],1163531501,20),nt=fnG(nt,it,rt,ot,tt[13],2850285829,5),ot=fnG(ot,nt,it,rt,tt[2],4243563512,9),rt=fnG(rt,ot,nt,it,tt[7],1735328473,14),it=fnG(it,rt,ot,nt,tt[12],2368359562,20),nt=fnH(nt,it,rt,ot,tt[5],4294588738,4),ot=fnH(ot,nt,it,rt,tt[8],2272392833,11),rt=fnH(rt,ot,nt,it,tt[11],1839030562,16),it=fnH(it,rt,ot,nt,tt[14],4259657740,23),nt=fnH(nt,it,rt,ot,tt[1],2763975236,4),ot=fnH(ot,nt,it,rt,tt[4],1272893353,11),rt=fnH(rt,ot,nt,it,tt[7],4139469664,16),it=fnH(it,rt,ot,nt,tt[10],3200236656,23),nt=fnH(nt,it,rt,ot,tt[13],681279174,4),ot=fnH(ot,nt,it,rt,tt[0],3936430074,11),rt=fnH(rt,ot,nt,it,tt[3],3572445317,16),it=fnH(it,rt,ot,nt,tt[6],76029189,23),nt=fnH(nt,it,rt,ot,tt[9],3654602809,4),ot=fnH(ot,nt,it,rt,tt[12],3873151461,11),rt=fnH(rt,ot,nt,it,tt[15],530742520,16),it=fnH(it,rt,ot,nt,tt[2],3299628645,23),nt=fnI(nt,it,rt,ot,tt[0],4096336452,6),ot=fnI(ot,nt,it,rt,tt[7],1126891415,10),rt=fnI(rt,ot,nt,it,tt[14],2878612391,15),it=fnI(it,rt,ot,nt,tt[5],4237533241,21),nt=fnI(nt,it,rt,ot,tt[12],1700485571,6),ot=fnI(ot,nt,it,rt,tt[3],2399980690,10),rt=fnI(rt,ot,nt,it,tt[10],4293915773,15),it=fnI(it,rt,ot,nt,tt[1],2240044497,21),nt=fnI(nt,it,rt,ot,tt[8],1873313359,6),ot=fnI(ot,nt,it,rt,tt[15],4264355552,10),rt=fnI(rt,ot,nt,it,tt[6],2734768916,15),it=fnI(it,rt,ot,nt,tt[13],1309151649,21),nt=fnI(nt,it,rt,ot,tt[4],4149444226,6),ot=fnI(ot,nt,it,rt,tt[11],3174756917,10),rt=fnI(rt,ot,nt,it,tt[2],718787259,15),it=fnI(it,rt,ot,nt,tt[9],3951481745,21),this._a=this._a+nt|0,this._b=this._b+it|0,this._c=this._c+rt|0,this._d=this._d+ot|0};MD5$3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var tt=Buffer$E.allocUnsafe(16);return tt.writeInt32LE(this._a,0),tt.writeInt32LE(this._b,4),tt.writeInt32LE(this._c,8),tt.writeInt32LE(this._d,12),tt};function rotl$3(tt,et){return tt<>>32-et}function fnF(tt,et,nt,it,rt,ot,at){return rotl$3(tt+(et&nt|~et&it)+rt+ot|0,at)+et|0}function fnG(tt,et,nt,it,rt,ot,at){return rotl$3(tt+(et&it|nt&~it)+rt+ot|0,at)+et|0}function fnH(tt,et,nt,it,rt,ot,at){return rotl$3(tt+(et^nt^it)+rt+ot|0,at)+et|0}function fnI(tt,et,nt,it,rt,ot,at){return rotl$3(tt+(nt^(et|~it))+rt+ot|0,at)+et|0}var md5_js=MD5$3,Buffer$D=buffer$2.Buffer,inherits$u=inherits_browserExports,HashBase=hashBase,ARRAY16=new Array(16),zl=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],zr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],sl=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}inherits$u(RIPEMD160$5,HashBase);RIPEMD160$5.prototype._update=function(){for(var tt=ARRAY16,et=0;et<16;++et)tt[et]=this._block.readInt32LE(et*4);for(var nt=this._a|0,it=this._b|0,rt=this._c|0,ot=this._d|0,at=this._e|0,st=this._a|0,lt=this._b|0,ct=this._c|0,ut=this._d|0,ht=this._e|0,dt=0;dt<80;dt+=1){var pt,mt;dt<16?(pt=fn1(nt,it,rt,ot,at,tt[zl[dt]],hl[0],sl[dt]),mt=fn5(st,lt,ct,ut,ht,tt[zr[dt]],hr[0],sr[dt])):dt<32?(pt=fn2(nt,it,rt,ot,at,tt[zl[dt]],hl[1],sl[dt]),mt=fn4(st,lt,ct,ut,ht,tt[zr[dt]],hr[1],sr[dt])):dt<48?(pt=fn3(nt,it,rt,ot,at,tt[zl[dt]],hl[2],sl[dt]),mt=fn3(st,lt,ct,ut,ht,tt[zr[dt]],hr[2],sr[dt])):dt<64?(pt=fn4(nt,it,rt,ot,at,tt[zl[dt]],hl[3],sl[dt]),mt=fn2(st,lt,ct,ut,ht,tt[zr[dt]],hr[3],sr[dt])):(pt=fn5(nt,it,rt,ot,at,tt[zl[dt]],hl[4],sl[dt]),mt=fn1(st,lt,ct,ut,ht,tt[zr[dt]],hr[4],sr[dt])),nt=at,at=ot,ot=rotl$2(rt,10),rt=it,it=pt,st=ht,ht=ut,ut=rotl$2(ct,10),ct=lt,lt=mt}var gt=this._b+rt+ut|0;this._b=this._c+ot+ht|0,this._c=this._d+at+st|0,this._d=this._e+nt+lt|0,this._e=this._a+it+ct|0,this._a=gt};RIPEMD160$5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var tt=Buffer$D.alloc?Buffer$D.alloc(20):new Buffer$D(20);return tt.writeInt32LE(this._a,0),tt.writeInt32LE(this._b,4),tt.writeInt32LE(this._c,8),tt.writeInt32LE(this._d,12),tt.writeInt32LE(this._e,16),tt};function rotl$2(tt,et){return tt<>>32-et}function fn1(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+(et^nt^it)+ot+at|0,st)+rt|0}function fn2(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+(et&nt|~et&it)+ot+at|0,st)+rt|0}function fn3(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+((et|~nt)^it)+ot+at|0,st)+rt|0}function fn4(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+(et&it|nt&~it)+ot+at|0,st)+rt|0}function fn5(tt,et,nt,it,rt,ot,at,st){return rotl$2(tt+(et^(nt|~it))+ot+at|0,st)+rt|0}var ripemd160$1=RIPEMD160$5,sha_js={exports:{}},Buffer$C=safeBufferExports.Buffer;function Hash$9(tt,et){this._block=Buffer$C.alloc(tt),this._finalSize=et,this._blockSize=tt,this._len=0}Hash$9.prototype.update=function(tt,et){typeof tt=="string"&&(et=et||"utf8",tt=Buffer$C.from(tt,et));for(var nt=this._block,it=this._blockSize,rt=tt.length,ot=this._len,at=0;at=this._finalSize&&(this._update(this._block),this._block.fill(0));var nt=this._len*8;if(nt<=4294967295)this._block.writeUInt32BE(nt,this._blockSize-4);else{var it=(nt&4294967295)>>>0,rt=(nt-it)/4294967296;this._block.writeUInt32BE(rt,this._blockSize-8),this._block.writeUInt32BE(it,this._blockSize-4)}this._update(this._block);var ot=this._hash();return tt?ot.toString(tt):ot};Hash$9.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash$7=Hash$9,inherits$t=inherits_browserExports,Hash$8=hash$7,Buffer$B=safeBufferExports.Buffer,K$4=[1518500249,1859775393,-1894007588,-899497514],W$5=new Array(80);function Sha(){this.init(),this._w=W$5,Hash$8.call(this,64,56)}inherits$t(Sha,Hash$8);Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl5$1(tt){return tt<<5|tt>>>27}function rotl30$1(tt){return tt<<30|tt>>>2}function ft$1(tt,et,nt,it){return tt===0?et&nt|~et&it:tt===2?et&nt|et&it|nt&it:et^nt^it}Sha.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,it=this._b|0,rt=this._c|0,ot=this._d|0,at=this._e|0,st=0;st<16;++st)et[st]=tt.readInt32BE(st*4);for(;st<80;++st)et[st]=et[st-3]^et[st-8]^et[st-14]^et[st-16];for(var lt=0;lt<80;++lt){var ct=~~(lt/20),ut=rotl5$1(nt)+ft$1(ct,it,rt,ot)+at+et[lt]+K$4[ct]|0;at=ot,ot=rt,rt=rotl30$1(it),it=nt,nt=ut}this._a=nt+this._a|0,this._b=it+this._b|0,this._c=rt+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0};Sha.prototype._hash=function(){var tt=Buffer$B.allocUnsafe(20);return tt.writeInt32BE(this._a|0,0),tt.writeInt32BE(this._b|0,4),tt.writeInt32BE(this._c|0,8),tt.writeInt32BE(this._d|0,12),tt.writeInt32BE(this._e|0,16),tt};var sha$4=Sha,inherits$s=inherits_browserExports,Hash$7=hash$7,Buffer$A=safeBufferExports.Buffer,K$3=[1518500249,1859775393,-1894007588,-899497514],W$4=new Array(80);function Sha1(){this.init(),this._w=W$4,Hash$7.call(this,64,56)}inherits$s(Sha1,Hash$7);Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl1(tt){return tt<<1|tt>>>31}function rotl5(tt){return tt<<5|tt>>>27}function rotl30(tt){return tt<<30|tt>>>2}function ft(tt,et,nt,it){return tt===0?et&nt|~et&it:tt===2?et&nt|et&it|nt&it:et^nt^it}Sha1.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,it=this._b|0,rt=this._c|0,ot=this._d|0,at=this._e|0,st=0;st<16;++st)et[st]=tt.readInt32BE(st*4);for(;st<80;++st)et[st]=rotl1(et[st-3]^et[st-8]^et[st-14]^et[st-16]);for(var lt=0;lt<80;++lt){var ct=~~(lt/20),ut=rotl5(nt)+ft(ct,it,rt,ot)+at+et[lt]+K$3[ct]|0;at=ot,ot=rt,rt=rotl30(it),it=nt,nt=ut}this._a=nt+this._a|0,this._b=it+this._b|0,this._c=rt+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0};Sha1.prototype._hash=function(){var tt=Buffer$A.allocUnsafe(20);return tt.writeInt32BE(this._a|0,0),tt.writeInt32BE(this._b|0,4),tt.writeInt32BE(this._c|0,8),tt.writeInt32BE(this._d|0,12),tt.writeInt32BE(this._e|0,16),tt};var sha1$1=Sha1,inherits$r=inherits_browserExports,Hash$6=hash$7,Buffer$z=safeBufferExports.Buffer,K$2=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W$3=new Array(64);function Sha256$1(){this.init(),this._w=W$3,Hash$6.call(this,64,56)}inherits$r(Sha256$1,Hash$6);Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ch(tt,et,nt){return nt^tt&(et^nt)}function maj$1(tt,et,nt){return tt&et|nt&(tt|et)}function sigma0$1(tt){return(tt>>>2|tt<<30)^(tt>>>13|tt<<19)^(tt>>>22|tt<<10)}function sigma1$1(tt){return(tt>>>6|tt<<26)^(tt>>>11|tt<<21)^(tt>>>25|tt<<7)}function gamma0(tt){return(tt>>>7|tt<<25)^(tt>>>18|tt<<14)^tt>>>3}function gamma1(tt){return(tt>>>17|tt<<15)^(tt>>>19|tt<<13)^tt>>>10}Sha256$1.prototype._update=function(tt){for(var et=this._w,nt=this._a|0,it=this._b|0,rt=this._c|0,ot=this._d|0,at=this._e|0,st=this._f|0,lt=this._g|0,ct=this._h|0,ut=0;ut<16;++ut)et[ut]=tt.readInt32BE(ut*4);for(;ut<64;++ut)et[ut]=gamma1(et[ut-2])+et[ut-7]+gamma0(et[ut-15])+et[ut-16]|0;for(var ht=0;ht<64;++ht){var dt=ct+sigma1$1(at)+ch(at,st,lt)+K$2[ht]+et[ht]|0,pt=sigma0$1(nt)+maj$1(nt,it,rt)|0;ct=lt,lt=st,st=at,at=ot+dt|0,ot=rt,rt=it,it=nt,nt=dt+pt|0}this._a=nt+this._a|0,this._b=it+this._b|0,this._c=rt+this._c|0,this._d=ot+this._d|0,this._e=at+this._e|0,this._f=st+this._f|0,this._g=lt+this._g|0,this._h=ct+this._h|0};Sha256$1.prototype._hash=function(){var tt=Buffer$z.allocUnsafe(32);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt.writeInt32BE(this._h,28),tt};var sha256$4=Sha256$1,inherits$q=inherits_browserExports,Sha256=sha256$4,Hash$5=hash$7,Buffer$y=safeBufferExports.Buffer,W$2=new Array(64);function Sha224(){this.init(),this._w=W$2,Hash$5.call(this,64,56)}inherits$q(Sha224,Sha256);Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Sha224.prototype._hash=function(){var tt=Buffer$y.allocUnsafe(28);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt};var sha224$1=Sha224,inherits$p=inherits_browserExports,Hash$4=hash$7,Buffer$x=safeBufferExports.Buffer,K$1=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W$1=new Array(160);function Sha512(){this.init(),this._w=W$1,Hash$4.call(this,128,112)}inherits$p(Sha512,Hash$4);Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ch(tt,et,nt){return nt^tt&(et^nt)}function maj(tt,et,nt){return tt&et|nt&(tt|et)}function sigma0(tt,et){return(tt>>>28|et<<4)^(et>>>2|tt<<30)^(et>>>7|tt<<25)}function sigma1(tt,et){return(tt>>>14|et<<18)^(tt>>>18|et<<14)^(et>>>9|tt<<23)}function Gamma0(tt,et){return(tt>>>1|et<<31)^(tt>>>8|et<<24)^tt>>>7}function Gamma0l(tt,et){return(tt>>>1|et<<31)^(tt>>>8|et<<24)^(tt>>>7|et<<25)}function Gamma1(tt,et){return(tt>>>19|et<<13)^(et>>>29|tt<<3)^tt>>>6}function Gamma1l(tt,et){return(tt>>>19|et<<13)^(et>>>29|tt<<3)^(tt>>>6|et<<26)}function getCarry(tt,et){return tt>>>0>>0?1:0}Sha512.prototype._update=function(tt){for(var et=this._w,nt=this._ah|0,it=this._bh|0,rt=this._ch|0,ot=this._dh|0,at=this._eh|0,st=this._fh|0,lt=this._gh|0,ct=this._hh|0,ut=this._al|0,ht=this._bl|0,dt=this._cl|0,pt=this._dl|0,mt=this._el|0,gt=this._fl|0,bt=this._gl|0,yt=this._hl|0,wt=0;wt<32;wt+=2)et[wt]=tt.readInt32BE(wt*4),et[wt+1]=tt.readInt32BE(wt*4+4);for(;wt<160;wt+=2){var vt=et[wt-30],xt=et[wt-15*2+1],St=Gamma0(vt,xt),Et=Gamma0l(xt,vt);vt=et[wt-2*2],xt=et[wt-2*2+1];var $t=Gamma1(vt,xt),It=Gamma1l(xt,vt),Ft=et[wt-7*2],Ht=et[wt-7*2+1],zt=et[wt-16*2],Ot=et[wt-16*2+1],jt=Et+Ht|0,kt=St+Ft+getCarry(jt,Et)|0;jt=jt+It|0,kt=kt+$t+getCarry(jt,It)|0,jt=jt+Ot|0,kt=kt+zt+getCarry(jt,Ot)|0,et[wt]=kt,et[wt+1]=jt}for(var Tt=0;Tt<160;Tt+=2){kt=et[Tt],jt=et[Tt+1];var Ct=maj(nt,it,rt),Ut=maj(ut,ht,dt),Nt=sigma0(nt,ut),Bt=sigma0(ut,nt),Mt=sigma1(at,mt),Dt=sigma1(mt,at),Pt=K$1[Tt],Vt=K$1[Tt+1],nn=Ch(at,st,lt),cn=Ch(mt,gt,bt),Xt=yt+Dt|0,un=ct+Mt+getCarry(Xt,yt)|0;Xt=Xt+cn|0,un=un+nn+getCarry(Xt,cn)|0,Xt=Xt+Vt|0,un=un+Pt+getCarry(Xt,Vt)|0,Xt=Xt+jt|0,un=un+kt+getCarry(Xt,jt)|0;var en=Bt+Ut|0,fn=Nt+Ct+getCarry(en,Bt)|0;ct=lt,yt=bt,lt=st,bt=gt,st=at,gt=mt,mt=pt+Xt|0,at=ot+un+getCarry(mt,pt)|0,ot=rt,pt=dt,rt=it,dt=ht,it=nt,ht=ut,ut=Xt+en|0,nt=un+fn+getCarry(ut,Xt)|0}this._al=this._al+ut|0,this._bl=this._bl+ht|0,this._cl=this._cl+dt|0,this._dl=this._dl+pt|0,this._el=this._el+mt|0,this._fl=this._fl+gt|0,this._gl=this._gl+bt|0,this._hl=this._hl+yt|0,this._ah=this._ah+nt+getCarry(this._al,ut)|0,this._bh=this._bh+it+getCarry(this._bl,ht)|0,this._ch=this._ch+rt+getCarry(this._cl,dt)|0,this._dh=this._dh+ot+getCarry(this._dl,pt)|0,this._eh=this._eh+at+getCarry(this._el,mt)|0,this._fh=this._fh+st+getCarry(this._fl,gt)|0,this._gh=this._gh+lt+getCarry(this._gl,bt)|0,this._hh=this._hh+ct+getCarry(this._hl,yt)|0};Sha512.prototype._hash=function(){var tt=Buffer$x.allocUnsafe(64);function et(nt,it,rt){tt.writeInt32BE(nt,rt),tt.writeInt32BE(it,rt+4)}return et(this._ah,this._al,0),et(this._bh,this._bl,8),et(this._ch,this._cl,16),et(this._dh,this._dl,24),et(this._eh,this._el,32),et(this._fh,this._fl,40),et(this._gh,this._gl,48),et(this._hh,this._hl,56),tt};var sha512$1=Sha512,inherits$o=inherits_browserExports,SHA512$2=sha512$1,Hash$3=hash$7,Buffer$w=safeBufferExports.Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash$3.call(this,128,112)}inherits$o(Sha384,SHA512$2);Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Sha384.prototype._hash=function(){var tt=Buffer$w.allocUnsafe(48);function et(nt,it,rt){tt.writeInt32BE(nt,rt),tt.writeInt32BE(it,rt+4)}return et(this._ah,this._al,0),et(this._bh,this._bl,8),et(this._ch,this._cl,16),et(this._dh,this._dl,24),et(this._eh,this._el,32),et(this._fh,this._fl,40),tt};var sha384$1=Sha384,exports=sha_js.exports=function(et){et=et.toLowerCase();var nt=exports[et];if(!nt)throw new Error(et+" is not supported (we accept pull requests)");return new nt};exports.sha=sha$4;exports.sha1=sha1$1;exports.sha224=sha224$1;exports.sha256=sha256$4;exports.sha384=sha384$1;exports.sha512=sha512$1;var sha_jsExports=sha_js.exports,streamBrowserify=Stream,EE=eventsExports.EventEmitter,inherits$n=inherits_browserExports;inherits$n(Stream,EE);Stream.Readable=require_stream_readable();Stream.Writable=require_stream_writable();Stream.Duplex=require_stream_duplex();Stream.Transform=_stream_transform;Stream.PassThrough=_stream_passthrough;Stream.finished=endOfStream;Stream.pipeline=pipeline_1;Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(tt,et){var nt=this;function it(ut){tt.writable&&tt.write(ut)===!1&&nt.pause&&nt.pause()}nt.on("data",it);function rt(){nt.readable&&nt.resume&&nt.resume()}tt.on("drain",rt),!tt._isStdio&&(!et||et.end!==!1)&&(nt.on("end",at),nt.on("close",st));var ot=!1;function at(){ot||(ot=!0,tt.end())}function st(){ot||(ot=!0,typeof tt.destroy=="function"&&tt.destroy())}function lt(ut){if(ct(),EE.listenerCount(this,"error")===0)throw ut}nt.on("error",lt),tt.on("error",lt);function ct(){nt.removeListener("data",it),tt.removeListener("drain",rt),nt.removeListener("end",at),nt.removeListener("close",st),nt.removeListener("error",lt),tt.removeListener("error",lt),nt.removeListener("end",ct),nt.removeListener("close",ct),tt.removeListener("close",ct)}return nt.on("end",ct),nt.on("close",ct),tt.on("close",ct),tt.emit("pipe",nt),tt};var Buffer$v=safeBufferExports.Buffer,Transform$5=streamBrowserify.Transform,StringDecoder=string_decoder.StringDecoder,inherits$m=inherits_browserExports;function CipherBase$1(tt){Transform$5.call(this),this.hashMode=typeof tt=="string",this.hashMode?this[tt]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits$m(CipherBase$1,Transform$5);CipherBase$1.prototype.update=function(tt,et,nt){typeof tt=="string"&&(tt=Buffer$v.from(tt,et));var it=this._update(tt);return this.hashMode?this:(nt&&(it=this._toString(it,nt)),it)};CipherBase$1.prototype.setAutoPadding=function(){};CipherBase$1.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};CipherBase$1.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};CipherBase$1.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};CipherBase$1.prototype._transform=function(tt,et,nt){var it;try{this.hashMode?this._update(tt):this.push(this._update(tt))}catch(rt){it=rt}finally{nt(it)}};CipherBase$1.prototype._flush=function(tt){var et;try{this.push(this.__final())}catch(nt){et=nt}tt(et)};CipherBase$1.prototype._finalOrDigest=function(tt){var et=this.__final()||Buffer$v.alloc(0);return tt&&(et=this._toString(et,tt,!0)),et};CipherBase$1.prototype._toString=function(tt,et,nt){if(this._decoder||(this._decoder=new StringDecoder(et),this._encoding=et),this._encoding!==et)throw new Error("can't switch encodings");var it=this._decoder.write(tt);return nt&&(it+=this._decoder.end()),it};var cipherBase=CipherBase$1,inherits$l=inherits_browserExports,MD5$2=md5_js,RIPEMD160$4=ripemd160$1,sha$3=sha_jsExports,Base$5=cipherBase;function Hash$2(tt){Base$5.call(this,"digest"),this._hash=tt}inherits$l(Hash$2,Base$5);Hash$2.prototype._update=function(tt){this._hash.update(tt)};Hash$2.prototype._final=function(){return this._hash.digest()};var browser$9=function(et){return et=et.toLowerCase(),et==="md5"?new MD5$2:et==="rmd160"||et==="ripemd160"?new RIPEMD160$4:new Hash$2(sha$3(et))},inherits$k=inherits_browserExports,Buffer$u=safeBufferExports.Buffer,Base$4=cipherBase,ZEROS$2=Buffer$u.alloc(128),blocksize=64;function Hmac$3(tt,et){Base$4.call(this,"digest"),typeof et=="string"&&(et=Buffer$u.from(et)),this._alg=tt,this._key=et,et.length>blocksize?et=tt(et):et.lengthnt){var it=tt==="rmd160"?new RIPEMD160$3:sha$2(tt);et=it.update(et).digest()}else et.lengthMAX_ALLOC||et!==et)throw new TypeError("Bad key length")},defaultEncoding$2;if(commonjsGlobal.process&&commonjsGlobal.process.browser)defaultEncoding$2="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var pVersionMajor=parseInt(process.version.split(".")[0].slice(1),10);defaultEncoding$2=pVersionMajor>=6?"utf-8":"binary"}else defaultEncoding$2="utf-8";var defaultEncoding_1=defaultEncoding$2,Buffer$s=safeBufferExports.Buffer,toBuffer$3=function(tt,et,nt){if(Buffer$s.isBuffer(tt))return tt;if(typeof tt=="string")return Buffer$s.from(tt,et);if(ArrayBuffer.isView(tt))return Buffer$s.from(tt.buffer);throw new TypeError(nt+" must be a string, a Buffer, a typed array or a DataView")},md5=md5$2,RIPEMD160$2=ripemd160$1,sha$1=sha_jsExports,Buffer$r=safeBufferExports.Buffer,checkParameters$1=precondition,defaultEncoding$1=defaultEncoding_1,toBuffer$2=toBuffer$3,ZEROS=Buffer$r.alloc(128),sizes={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac$1(tt,et,nt){var it=getDigest(tt),rt=tt==="sha512"||tt==="sha384"?128:64;et.length>rt?et=it(et):et.length>>0};utils$q.writeUInt32BE=function(et,nt,it){et[0+it]=nt>>>24,et[1+it]=nt>>>16&255,et[2+it]=nt>>>8&255,et[3+it]=nt&255};utils$q.ip=function(et,nt,it,rt){for(var ot=0,at=0,st=6;st>=0;st-=2){for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>>lt+st&1;for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=et>>>lt+st&1}for(var st=6;st>=0;st-=2){for(var lt=1;lt<=25;lt+=8)at<<=1,at|=nt>>>lt+st&1;for(var lt=1;lt<=25;lt+=8)at<<=1,at|=et>>>lt+st&1}it[rt+0]=ot>>>0,it[rt+1]=at>>>0};utils$q.rip=function(et,nt,it,rt){for(var ot=0,at=0,st=0;st<4;st++)for(var lt=24;lt>=0;lt-=8)ot<<=1,ot|=nt>>>lt+st&1,ot<<=1,ot|=et>>>lt+st&1;for(var st=4;st<8;st++)for(var lt=24;lt>=0;lt-=8)at<<=1,at|=nt>>>lt+st&1,at<<=1,at|=et>>>lt+st&1;it[rt+0]=ot>>>0,it[rt+1]=at>>>0};utils$q.pc1=function(et,nt,it,rt){for(var ot=0,at=0,st=7;st>=5;st--){for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>lt+st&1;for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=et>>lt+st&1}for(var lt=0;lt<=24;lt+=8)ot<<=1,ot|=nt>>lt+st&1;for(var st=1;st<=3;st++){for(var lt=0;lt<=24;lt+=8)at<<=1,at|=nt>>lt+st&1;for(var lt=0;lt<=24;lt+=8)at<<=1,at|=et>>lt+st&1}for(var lt=0;lt<=24;lt+=8)at<<=1,at|=et>>lt+st&1;it[rt+0]=ot>>>0,it[rt+1]=at>>>0};utils$q.r28shl=function(et,nt){return et<>>28-nt};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$q.pc2=function(et,nt,it,rt){for(var ot=0,at=0,st=pc2table.length>>>1,lt=0;lt>>pc2table[lt]&1;for(var lt=st;lt>>pc2table[lt]&1;it[rt+0]=ot>>>0,it[rt+1]=at>>>0};utils$q.expand=function(et,nt,it){var rt=0,ot=0;rt=(et&1)<<5|et>>>27;for(var at=23;at>=15;at-=4)rt<<=6,rt|=et>>>at&63;for(var at=11;at>=3;at-=4)ot|=et>>>at&63,ot<<=6;ot|=(et&31)<<1|et>>>31,nt[it+0]=rt>>>0,nt[it+1]=ot>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$q.substitute=function(et,nt){for(var it=0,rt=0;rt<4;rt++){var ot=et>>>18-rt*6&63,at=sTable[rt*64+ot];it<<=4,it|=at}for(var rt=0;rt<4;rt++){var ot=nt>>>18-rt*6&63,at=sTable[4*64+rt*64+ot];it<<=4,it|=at}return it>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];utils$q.permute=function(et){for(var nt=0,it=0;it>>permuteTable[it]&1;return nt>>>0};utils$q.padSplit=function(et,nt,it){for(var rt=et.toString(2);rt.length0;rt--)nt+=this._buffer(et,nt),it+=this._flushBuffer(ot,it);return nt+=this._buffer(et,nt),ot};Cipher$3.prototype.final=function(et){var nt;et&&(nt=this.update(et));var it;return this.type==="encrypt"?it=this._finalEncrypt():it=this._finalDecrypt(),nt?nt.concat(it):it};Cipher$3.prototype._pad=function(et,nt){if(nt===0)return!1;for(;nt>>1];it=utils$p.r28shl(it,at),rt=utils$p.r28shl(rt,at),utils$p.pc2(it,rt,et.keys,ot)}};DES$3.prototype._update=function(et,nt,it,rt){var ot=this._desState,at=utils$p.readUInt32BE(et,nt),st=utils$p.readUInt32BE(et,nt+4);utils$p.ip(at,st,ot.tmp,0),at=ot.tmp[0],st=ot.tmp[1],this.type==="encrypt"?this._encrypt(ot,at,st,ot.tmp,0):this._decrypt(ot,at,st,ot.tmp,0),at=ot.tmp[0],st=ot.tmp[1],utils$p.writeUInt32BE(it,at,rt),utils$p.writeUInt32BE(it,st,rt+4)};DES$3.prototype._pad=function(et,nt){if(this.padding===!1)return!1;for(var it=et.length-nt,rt=nt;rt>>0,at=pt}utils$p.rip(st,at,rt,ot)};DES$3.prototype._decrypt=function(et,nt,it,rt,ot){for(var at=it,st=nt,lt=et.keys.length-2;lt>=0;lt-=2){var ct=et.keys[lt],ut=et.keys[lt+1];utils$p.expand(at,et.tmp,0),ct^=et.tmp[0],ut^=et.tmp[1];var ht=utils$p.substitute(ct,ut),dt=utils$p.permute(ht),pt=at;at=(st^dt)>>>0,st=pt}utils$p.rip(at,st,rt,ot)};var cbc$1={},assert$l=minimalisticAssert,inherits$h=inherits_browserExports,proto$1={};function CBCState(tt){assert$l.equal(tt.length,8,"Invalid IV length"),this.iv=new Array(8);for(var et=0;et>rt%8,tt._prev=shiftIn(tt._prev,nt?st:lt);return at}function shiftIn(tt,et){var nt=tt.length,it=-1,rt=Buffer$m.allocUnsafe(tt.length);for(tt=Buffer$m.concat([tt,Buffer$m.from([et])]);++it>7;return rt}cfb1.encrypt=function(tt,et,nt){for(var it=et.length,rt=Buffer$m.allocUnsafe(it),ot=-1;++ot>>24]^at[ut>>>16&255]^st[ht>>>8&255]^lt[dt&255]^et[yt++],mt=ot[ut>>>24]^at[ht>>>16&255]^st[dt>>>8&255]^lt[ct&255]^et[yt++],gt=ot[ht>>>24]^at[dt>>>16&255]^st[ct>>>8&255]^lt[ut&255]^et[yt++],bt=ot[dt>>>24]^at[ct>>>16&255]^st[ut>>>8&255]^lt[ht&255]^et[yt++],ct=pt,ut=mt,ht=gt,dt=bt;return pt=(it[ct>>>24]<<24|it[ut>>>16&255]<<16|it[ht>>>8&255]<<8|it[dt&255])^et[yt++],mt=(it[ut>>>24]<<24|it[ht>>>16&255]<<16|it[dt>>>8&255]<<8|it[ct&255])^et[yt++],gt=(it[ht>>>24]<<24|it[dt>>>16&255]<<16|it[ct>>>8&255]<<8|it[ut&255])^et[yt++],bt=(it[dt>>>24]<<24|it[ct>>>16&255]<<16|it[ut>>>8&255]<<8|it[ht&255])^et[yt++],pt=pt>>>0,mt=mt>>>0,gt=gt>>>0,bt=bt>>>0,[pt,mt,gt,bt]}var RCON=[0,1,2,4,8,16,32,64,128,27,54],G=function(){for(var tt=new Array(256),et=0;et<256;et++)et<128?tt[et]=et<<1:tt[et]=et<<1^283;for(var nt=[],it=[],rt=[[],[],[],[]],ot=[[],[],[],[]],at=0,st=0,lt=0;lt<256;++lt){var ct=st^st<<1^st<<2^st<<3^st<<4;ct=ct>>>8^ct&255^99,nt[at]=ct,it[ct]=at;var ut=tt[at],ht=tt[ut],dt=tt[ht],pt=tt[ct]*257^ct*16843008;rt[0][at]=pt<<24|pt>>>8,rt[1][at]=pt<<16|pt>>>16,rt[2][at]=pt<<8|pt>>>24,rt[3][at]=pt,pt=dt*16843009^ht*65537^ut*257^at*16843008,ot[0][ct]=pt<<24|pt>>>8,ot[1][ct]=pt<<16|pt>>>16,ot[2][ct]=pt<<8|pt>>>24,ot[3][ct]=pt,at===0?at=st=1:(at=ut^tt[tt[tt[dt^ut]]],st^=tt[tt[st]])}return{SBOX:nt,INV_SBOX:it,SUB_MIX:rt,INV_SUB_MIX:ot}}();function AES(tt){this._key=asUInt32Array(tt),this._reset()}AES.blockSize=4*4;AES.keySize=256/8;AES.prototype.blockSize=AES.blockSize;AES.prototype.keySize=AES.keySize;AES.prototype._reset=function(){for(var tt=this._key,et=tt.length,nt=et+6,it=(nt+1)*4,rt=[],ot=0;ot>>24,at=G.SBOX[at>>>24]<<24|G.SBOX[at>>>16&255]<<16|G.SBOX[at>>>8&255]<<8|G.SBOX[at&255],at^=RCON[ot/et|0]<<24):et>6&&ot%et===4&&(at=G.SBOX[at>>>24]<<24|G.SBOX[at>>>16&255]<<16|G.SBOX[at>>>8&255]<<8|G.SBOX[at&255]),rt[ot]=rt[ot-et]^at}for(var st=[],lt=0;lt>>24]]^G.INV_SUB_MIX[1][G.SBOX[ut>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[ut>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[ut&255]]}this._nRounds=nt,this._keySchedule=rt,this._invKeySchedule=st};AES.prototype.encryptBlockRaw=function(tt){return tt=asUInt32Array(tt),cryptBlock(tt,this._keySchedule,G.SUB_MIX,G.SBOX,this._nRounds)};AES.prototype.encryptBlock=function(tt){var et=this.encryptBlockRaw(tt),nt=Buffer$k.allocUnsafe(16);return nt.writeUInt32BE(et[0],0),nt.writeUInt32BE(et[1],4),nt.writeUInt32BE(et[2],8),nt.writeUInt32BE(et[3],12),nt};AES.prototype.decryptBlock=function(tt){tt=asUInt32Array(tt);var et=tt[1];tt[1]=tt[3],tt[3]=et;var nt=cryptBlock(tt,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX,this._nRounds),it=Buffer$k.allocUnsafe(16);return it.writeUInt32BE(nt[0],0),it.writeUInt32BE(nt[3],4),it.writeUInt32BE(nt[2],8),it.writeUInt32BE(nt[1],12),it};AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)};aes$5.AES=AES;var Buffer$j=safeBufferExports.Buffer,ZEROES=Buffer$j.alloc(16,0);function toArray$4(tt){return[tt.readUInt32BE(0),tt.readUInt32BE(4),tt.readUInt32BE(8),tt.readUInt32BE(12)]}function fromArray(tt){var et=Buffer$j.allocUnsafe(16);return et.writeUInt32BE(tt[0]>>>0,0),et.writeUInt32BE(tt[1]>>>0,4),et.writeUInt32BE(tt[2]>>>0,8),et.writeUInt32BE(tt[3]>>>0,12),et}function GHASH$1(tt){this.h=tt,this.state=Buffer$j.alloc(16,0),this.cache=Buffer$j.allocUnsafe(0)}GHASH$1.prototype.ghash=function(tt){for(var et=-1;++et0;nt--)tt[nt]=tt[nt]>>>1|(tt[nt-1]&1)<<31;tt[0]=tt[0]>>>1,rt&&(tt[0]=tt[0]^225<<24)}this.state=fromArray(et)};GHASH$1.prototype.update=function(tt){this.cache=Buffer$j.concat([this.cache,tt]);for(var et;this.cache.length>=16;)et=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(et)};GHASH$1.prototype.final=function(tt,et){return this.cache.length&&this.ghash(Buffer$j.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,tt,0,et])),this.state};var ghash=GHASH$1,aes$4=aes$5,Buffer$i=safeBufferExports.Buffer,Transform$4=cipherBase,inherits$e=inherits_browserExports,GHASH=ghash,xor$3=bufferXor,incr32=incr32_1;function xorTest(tt,et){var nt=0;tt.length!==et.length&&nt++;for(var it=Math.min(tt.length,et.length),rt=0;rt0||it>0;){var lt=new MD5;lt.update(st),lt.update(tt),et&<.update(et),st=lt.digest();var ct=0;if(rt>0){var ut=ot.length-rt;ct=Math.min(rt,st.length),st.copy(ot,ut,0,ct),rt-=ct}if(ct0){var ht=at.length-it,dt=Math.min(it,st.length-ct);st.copy(at,ht,ct,ct+dt),it-=dt}}return st.fill(0),{key:ot,iv:at}}var evp_bytestokey=EVP_BytesToKey,MODES$1=modes_1,AuthCipher$1=authCipher,Buffer$f=safeBufferExports.Buffer,StreamCipher$1=streamCipher,Transform$2=cipherBase,aes$2=aes$5,ebtk$2=evp_bytestokey,inherits$c=inherits_browserExports;function Cipher(tt,et,nt){Transform$2.call(this),this._cache=new Splitter$1,this._cipher=new aes$2.AES(et),this._prev=Buffer$f.from(nt),this._mode=tt,this._autopadding=!0}inherits$c(Cipher,Transform$2);Cipher.prototype._update=function(tt){this._cache.add(tt);for(var et,nt,it=[];et=this._cache.get();)nt=this._mode.encrypt(this,et),it.push(nt);return Buffer$f.concat(it)};var PADDING=Buffer$f.alloc(16,16);Cipher.prototype._final=function(){var tt=this._cache.flush();if(this._autopadding)return tt=this._mode.encrypt(this,tt),this._cipher.scrub(),tt;if(!tt.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")};Cipher.prototype.setAutoPadding=function(tt){return this._autopadding=!!tt,this};function Splitter$1(){this.cache=Buffer$f.allocUnsafe(0)}Splitter$1.prototype.add=function(tt){this.cache=Buffer$f.concat([this.cache,tt])};Splitter$1.prototype.get=function(){if(this.cache.length>15){var tt=this.cache.slice(0,16);return this.cache=this.cache.slice(16),tt}return null};Splitter$1.prototype.flush=function(){for(var tt=16-this.cache.length,et=Buffer$f.allocUnsafe(tt),nt=-1;++nt16)return et=this.cache.slice(0,16),this.cache=this.cache.slice(16),et}else if(this.cache.length>=16)return et=this.cache.slice(0,16),this.cache=this.cache.slice(16),et;return null};Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(tt){var et=tt[15];if(et<1||et>16)throw new Error("unable to decrypt data");for(var nt=-1;++nt0?Ot:jt},ot.min=function(Ot,jt){return Ot.cmp(jt)<0?Ot:jt},ot.prototype._init=function(Ot,jt,kt){if(typeof Ot=="number")return this._initNumber(Ot,jt,kt);if(typeof Ot=="object")return this._initArray(Ot,jt,kt);jt==="hex"&&(jt=16),it(jt===(jt|0)&&jt>=2&&jt<=36),Ot=Ot.toString().replace(/\s+/g,"");var Tt=0;Ot[0]==="-"&&(Tt++,this.negative=1),Tt=0;Tt-=3)Ut=Ot[Tt]|Ot[Tt-1]<<8|Ot[Tt-2]<<16,this.words[Ct]|=Ut<>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,Ct++);else if(kt==="le")for(Tt=0,Ct=0;Tt>>26-Nt&67108863,Nt+=24,Nt>=26&&(Nt-=26,Ct++);return this.strip()};function st(zt,Ot){var jt=zt.charCodeAt(Ot);return jt>=65&&jt<=70?jt-55:jt>=97&&jt<=102?jt-87:jt-48&15}function lt(zt,Ot,jt){var kt=st(zt,jt);return jt-1>=Ot&&(kt|=st(zt,jt-1)<<4),kt}ot.prototype._parseHex=function(Ot,jt,kt){this.length=Math.ceil((Ot.length-jt)/6),this.words=new Array(this.length);for(var Tt=0;Tt=jt;Tt-=2)Nt=lt(Ot,jt,Tt)<=18?(Ct-=18,Ut+=1,this.words[Ut]|=Nt>>>26):Ct+=8;else{var Bt=Ot.length-jt;for(Tt=Bt%2===0?jt+1:jt;Tt=18?(Ct-=18,Ut+=1,this.words[Ut]|=Nt>>>26):Ct+=8}this.strip()};function ct(zt,Ot,jt,kt){for(var Tt=0,Ct=Math.min(zt.length,jt),Ut=Ot;Ut=49?Tt+=Nt-49+10:Nt>=17?Tt+=Nt-17+10:Tt+=Nt}return Tt}ot.prototype._parseBase=function(Ot,jt,kt){this.words=[0],this.length=1;for(var Tt=0,Ct=1;Ct<=67108863;Ct*=jt)Tt++;Tt--,Ct=Ct/jt|0;for(var Ut=Ot.length-kt,Nt=Ut%Tt,Bt=Math.min(Ut,Ut-Nt)+kt,Mt=0,Dt=kt;Dt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},ot.prototype.inspect=function(){return(this.red?""};var ut=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],ht=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],dt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(Ot,jt){Ot=Ot||10,jt=jt|0||1;var kt;if(Ot===16||Ot==="hex"){kt="";for(var Tt=0,Ct=0,Ut=0;Ut>>24-Tt&16777215,Ct!==0||Ut!==this.length-1?kt=ut[6-Bt.length]+Bt+kt:kt=Bt+kt,Tt+=2,Tt>=26&&(Tt-=26,Ut--)}for(Ct!==0&&(kt=Ct.toString(16)+kt);kt.length%jt!==0;)kt="0"+kt;return this.negative!==0&&(kt="-"+kt),kt}if(Ot===(Ot|0)&&Ot>=2&&Ot<=36){var Mt=ht[Ot],Dt=dt[Ot];kt="";var Pt=this.clone();for(Pt.negative=0;!Pt.isZero();){var Vt=Pt.modn(Dt).toString(Ot);Pt=Pt.idivn(Dt),Pt.isZero()?kt=Vt+kt:kt=ut[Mt-Vt.length]+Vt+kt}for(this.isZero()&&(kt="0"+kt);kt.length%jt!==0;)kt="0"+kt;return this.negative!==0&&(kt="-"+kt),kt}it(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var Ot=this.words[0];return this.length===2?Ot+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Ot+=4503599627370496+this.words[1]*67108864:this.length>2&&it(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Ot:Ot},ot.prototype.toJSON=function(){return this.toString(16)},ot.prototype.toBuffer=function(Ot,jt){return it(typeof at<"u"),this.toArrayLike(at,Ot,jt)},ot.prototype.toArray=function(Ot,jt){return this.toArrayLike(Array,Ot,jt)},ot.prototype.toArrayLike=function(Ot,jt,kt){var Tt=this.byteLength(),Ct=kt||Math.max(1,Tt);it(Tt<=Ct,"byte array longer than desired length"),it(Ct>0,"Requested array length <= 0"),this.strip();var Ut=jt==="le",Nt=new Ot(Ct),Bt,Mt,Dt=this.clone();if(Ut){for(Mt=0;!Dt.isZero();Mt++)Bt=Dt.andln(255),Dt.iushrn(8),Nt[Mt]=Bt;for(;Mt=4096&&(kt+=13,jt>>>=13),jt>=64&&(kt+=7,jt>>>=7),jt>=8&&(kt+=4,jt>>>=4),jt>=2&&(kt+=2,jt>>>=2),kt+jt},ot.prototype._zeroBits=function(Ot){if(Ot===0)return 26;var jt=Ot,kt=0;return jt&8191||(kt+=13,jt>>>=13),jt&127||(kt+=7,jt>>>=7),jt&15||(kt+=4,jt>>>=4),jt&3||(kt+=2,jt>>>=2),jt&1||kt++,kt},ot.prototype.bitLength=function(){var Ot=this.words[this.length-1],jt=this._countBits(Ot);return(this.length-1)*26+jt};function pt(zt){for(var Ot=new Array(zt.bitLength()),jt=0;jt>>Tt}return Ot}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Ot=0,jt=0;jtOt.length?this.clone().ior(Ot):Ot.clone().ior(this)},ot.prototype.uor=function(Ot){return this.length>Ot.length?this.clone().iuor(Ot):Ot.clone().iuor(this)},ot.prototype.iuand=function(Ot){var jt;this.length>Ot.length?jt=Ot:jt=this;for(var kt=0;ktOt.length?this.clone().iand(Ot):Ot.clone().iand(this)},ot.prototype.uand=function(Ot){return this.length>Ot.length?this.clone().iuand(Ot):Ot.clone().iuand(this)},ot.prototype.iuxor=function(Ot){var jt,kt;this.length>Ot.length?(jt=this,kt=Ot):(jt=Ot,kt=this);for(var Tt=0;TtOt.length?this.clone().ixor(Ot):Ot.clone().ixor(this)},ot.prototype.uxor=function(Ot){return this.length>Ot.length?this.clone().iuxor(Ot):Ot.clone().iuxor(this)},ot.prototype.inotn=function(Ot){it(typeof Ot=="number"&&Ot>=0);var jt=Math.ceil(Ot/26)|0,kt=Ot%26;this._expand(jt),kt>0&&jt--;for(var Tt=0;Tt0&&(this.words[Tt]=~this.words[Tt]&67108863>>26-kt),this.strip()},ot.prototype.notn=function(Ot){return this.clone().inotn(Ot)},ot.prototype.setn=function(Ot,jt){it(typeof Ot=="number"&&Ot>=0);var kt=Ot/26|0,Tt=Ot%26;return this._expand(kt+1),jt?this.words[kt]=this.words[kt]|1<Ot.length?(kt=this,Tt=Ot):(kt=Ot,Tt=this);for(var Ct=0,Ut=0;Ut>>26;for(;Ct!==0&&Ut>>26;if(this.length=kt.length,Ct!==0)this.words[this.length]=Ct,this.length++;else if(kt!==this)for(;UtOt.length?this.clone().iadd(Ot):Ot.clone().iadd(this)},ot.prototype.isub=function(Ot){if(Ot.negative!==0){Ot.negative=0;var jt=this.iadd(Ot);return Ot.negative=1,jt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Ot),this.negative=1,this._normSign();var kt=this.cmp(Ot);if(kt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Tt,Ct;kt>0?(Tt=this,Ct=Ot):(Tt=Ot,Ct=this);for(var Ut=0,Nt=0;Nt>26,this.words[Nt]=jt&67108863;for(;Ut!==0&&Nt>26,this.words[Nt]=jt&67108863;if(Ut===0&&Nt>>26,Pt=Bt&67108863,Vt=Math.min(Mt,Ot.length-1),nn=Math.max(0,Mt-zt.length+1);nn<=Vt;nn++){var cn=Mt-nn|0;Tt=zt.words[cn]|0,Ct=Ot.words[nn]|0,Ut=Tt*Ct+Pt,Dt+=Ut/67108864|0,Pt=Ut&67108863}jt.words[Mt]=Pt|0,Bt=Dt|0}return Bt!==0?jt.words[Mt]=Bt|0:jt.length--,jt.strip()}var gt=function(Ot,jt,kt){var Tt=Ot.words,Ct=jt.words,Ut=kt.words,Nt=0,Bt,Mt,Dt,Pt=Tt[0]|0,Vt=Pt&8191,nn=Pt>>>13,cn=Tt[1]|0,Xt=cn&8191,un=cn>>>13,en=Tt[2]|0,fn=en&8191,xn=en>>>13,an=Tt[3]|0,Zt=an&8191,En=an>>>13,In=Tt[4]|0,Cn=In&8191,Nn=In>>>13,Un=Tt[5]|0,_n=Un&8191,An=Un>>>13,gn=Tt[6]|0,Tn=gn&8191,yn=gn>>>13,dn=Tt[7]|0,sn=dn&8191,rn=dn>>>13,Sn=Tt[8]|0,tn=Sn&8191,qt=Sn>>>13,Kt=Tt[9]|0,wn=Kt&8191,Rn=Kt>>>13,jn=Ct[0]|0,Bn=jn&8191,Xn=jn>>>13,Wn=Ct[1]|0,Gn=Wn&8191,Fn=Wn>>>13,Jn=Ct[2]|0,Vn=Jn&8191,dr=Jn>>>13,ur=Ct[3]|0,_r=ur&8191,Qr=ur>>>13,Or=Ct[4]|0,Mr=Or&8191,qr=Or>>>13,Ur=Ct[5]|0,Lr=Ur&8191,ao=Ur>>>13,Gr=Ct[6]|0,Br=Gr&8191,go=Gr>>>13,vn=Ct[7]|0,Pn=vn&8191,hn=vn>>>13,Jt=Ct[8]|0,kn=Jt&8191,On=Jt>>>13,Dn=Ct[9]|0,Yn=Dn&8191,er=Dn>>>13;kt.negative=Ot.negative^jt.negative,kt.length=19,Bt=Math.imul(Vt,Bn),Mt=Math.imul(Vt,Xn),Mt=Mt+Math.imul(nn,Bn)|0,Dt=Math.imul(nn,Xn);var or=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(or>>>26)|0,or&=67108863,Bt=Math.imul(Xt,Bn),Mt=Math.imul(Xt,Xn),Mt=Mt+Math.imul(un,Bn)|0,Dt=Math.imul(un,Xn),Bt=Bt+Math.imul(Vt,Gn)|0,Mt=Mt+Math.imul(Vt,Fn)|0,Mt=Mt+Math.imul(nn,Gn)|0,Dt=Dt+Math.imul(nn,Fn)|0;var ar=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(ar>>>26)|0,ar&=67108863,Bt=Math.imul(fn,Bn),Mt=Math.imul(fn,Xn),Mt=Mt+Math.imul(xn,Bn)|0,Dt=Math.imul(xn,Xn),Bt=Bt+Math.imul(Xt,Gn)|0,Mt=Mt+Math.imul(Xt,Fn)|0,Mt=Mt+Math.imul(un,Gn)|0,Dt=Dt+Math.imul(un,Fn)|0,Bt=Bt+Math.imul(Vt,Vn)|0,Mt=Mt+Math.imul(Vt,dr)|0,Mt=Mt+Math.imul(nn,Vn)|0,Dt=Dt+Math.imul(nn,dr)|0;var Vr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Bt=Math.imul(Zt,Bn),Mt=Math.imul(Zt,Xn),Mt=Mt+Math.imul(En,Bn)|0,Dt=Math.imul(En,Xn),Bt=Bt+Math.imul(fn,Gn)|0,Mt=Mt+Math.imul(fn,Fn)|0,Mt=Mt+Math.imul(xn,Gn)|0,Dt=Dt+Math.imul(xn,Fn)|0,Bt=Bt+Math.imul(Xt,Vn)|0,Mt=Mt+Math.imul(Xt,dr)|0,Mt=Mt+Math.imul(un,Vn)|0,Dt=Dt+Math.imul(un,dr)|0,Bt=Bt+Math.imul(Vt,_r)|0,Mt=Mt+Math.imul(Vt,Qr)|0,Mt=Mt+Math.imul(nn,_r)|0,Dt=Dt+Math.imul(nn,Qr)|0;var wr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(wr>>>26)|0,wr&=67108863,Bt=Math.imul(Cn,Bn),Mt=Math.imul(Cn,Xn),Mt=Mt+Math.imul(Nn,Bn)|0,Dt=Math.imul(Nn,Xn),Bt=Bt+Math.imul(Zt,Gn)|0,Mt=Mt+Math.imul(Zt,Fn)|0,Mt=Mt+Math.imul(En,Gn)|0,Dt=Dt+Math.imul(En,Fn)|0,Bt=Bt+Math.imul(fn,Vn)|0,Mt=Mt+Math.imul(fn,dr)|0,Mt=Mt+Math.imul(xn,Vn)|0,Dt=Dt+Math.imul(xn,dr)|0,Bt=Bt+Math.imul(Xt,_r)|0,Mt=Mt+Math.imul(Xt,Qr)|0,Mt=Mt+Math.imul(un,_r)|0,Dt=Dt+Math.imul(un,Qr)|0,Bt=Bt+Math.imul(Vt,Mr)|0,Mt=Mt+Math.imul(Vt,qr)|0,Mt=Mt+Math.imul(nn,Mr)|0,Dt=Dt+Math.imul(nn,qr)|0;var jr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(jr>>>26)|0,jr&=67108863,Bt=Math.imul(_n,Bn),Mt=Math.imul(_n,Xn),Mt=Mt+Math.imul(An,Bn)|0,Dt=Math.imul(An,Xn),Bt=Bt+Math.imul(Cn,Gn)|0,Mt=Mt+Math.imul(Cn,Fn)|0,Mt=Mt+Math.imul(Nn,Gn)|0,Dt=Dt+Math.imul(Nn,Fn)|0,Bt=Bt+Math.imul(Zt,Vn)|0,Mt=Mt+Math.imul(Zt,dr)|0,Mt=Mt+Math.imul(En,Vn)|0,Dt=Dt+Math.imul(En,dr)|0,Bt=Bt+Math.imul(fn,_r)|0,Mt=Mt+Math.imul(fn,Qr)|0,Mt=Mt+Math.imul(xn,_r)|0,Dt=Dt+Math.imul(xn,Qr)|0,Bt=Bt+Math.imul(Xt,Mr)|0,Mt=Mt+Math.imul(Xt,qr)|0,Mt=Mt+Math.imul(un,Mr)|0,Dt=Dt+Math.imul(un,qr)|0,Bt=Bt+Math.imul(Vt,Lr)|0,Mt=Mt+Math.imul(Vt,ao)|0,Mt=Mt+Math.imul(nn,Lr)|0,Dt=Dt+Math.imul(nn,ao)|0;var Hr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Bt=Math.imul(Tn,Bn),Mt=Math.imul(Tn,Xn),Mt=Mt+Math.imul(yn,Bn)|0,Dt=Math.imul(yn,Xn),Bt=Bt+Math.imul(_n,Gn)|0,Mt=Mt+Math.imul(_n,Fn)|0,Mt=Mt+Math.imul(An,Gn)|0,Dt=Dt+Math.imul(An,Fn)|0,Bt=Bt+Math.imul(Cn,Vn)|0,Mt=Mt+Math.imul(Cn,dr)|0,Mt=Mt+Math.imul(Nn,Vn)|0,Dt=Dt+Math.imul(Nn,dr)|0,Bt=Bt+Math.imul(Zt,_r)|0,Mt=Mt+Math.imul(Zt,Qr)|0,Mt=Mt+Math.imul(En,_r)|0,Dt=Dt+Math.imul(En,Qr)|0,Bt=Bt+Math.imul(fn,Mr)|0,Mt=Mt+Math.imul(fn,qr)|0,Mt=Mt+Math.imul(xn,Mr)|0,Dt=Dt+Math.imul(xn,qr)|0,Bt=Bt+Math.imul(Xt,Lr)|0,Mt=Mt+Math.imul(Xt,ao)|0,Mt=Mt+Math.imul(un,Lr)|0,Dt=Dt+Math.imul(un,ao)|0,Bt=Bt+Math.imul(Vt,Br)|0,Mt=Mt+Math.imul(Vt,go)|0,Mt=Mt+Math.imul(nn,Br)|0,Dt=Dt+Math.imul(nn,go)|0;var no=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(no>>>26)|0,no&=67108863,Bt=Math.imul(sn,Bn),Mt=Math.imul(sn,Xn),Mt=Mt+Math.imul(rn,Bn)|0,Dt=Math.imul(rn,Xn),Bt=Bt+Math.imul(Tn,Gn)|0,Mt=Mt+Math.imul(Tn,Fn)|0,Mt=Mt+Math.imul(yn,Gn)|0,Dt=Dt+Math.imul(yn,Fn)|0,Bt=Bt+Math.imul(_n,Vn)|0,Mt=Mt+Math.imul(_n,dr)|0,Mt=Mt+Math.imul(An,Vn)|0,Dt=Dt+Math.imul(An,dr)|0,Bt=Bt+Math.imul(Cn,_r)|0,Mt=Mt+Math.imul(Cn,Qr)|0,Mt=Mt+Math.imul(Nn,_r)|0,Dt=Dt+Math.imul(Nn,Qr)|0,Bt=Bt+Math.imul(Zt,Mr)|0,Mt=Mt+Math.imul(Zt,qr)|0,Mt=Mt+Math.imul(En,Mr)|0,Dt=Dt+Math.imul(En,qr)|0,Bt=Bt+Math.imul(fn,Lr)|0,Mt=Mt+Math.imul(fn,ao)|0,Mt=Mt+Math.imul(xn,Lr)|0,Dt=Dt+Math.imul(xn,ao)|0,Bt=Bt+Math.imul(Xt,Br)|0,Mt=Mt+Math.imul(Xt,go)|0,Mt=Mt+Math.imul(un,Br)|0,Dt=Dt+Math.imul(un,go)|0,Bt=Bt+Math.imul(Vt,Pn)|0,Mt=Mt+Math.imul(Vt,hn)|0,Mt=Mt+Math.imul(nn,Pn)|0,Dt=Dt+Math.imul(nn,hn)|0;var Xr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,Bt=Math.imul(tn,Bn),Mt=Math.imul(tn,Xn),Mt=Mt+Math.imul(qt,Bn)|0,Dt=Math.imul(qt,Xn),Bt=Bt+Math.imul(sn,Gn)|0,Mt=Mt+Math.imul(sn,Fn)|0,Mt=Mt+Math.imul(rn,Gn)|0,Dt=Dt+Math.imul(rn,Fn)|0,Bt=Bt+Math.imul(Tn,Vn)|0,Mt=Mt+Math.imul(Tn,dr)|0,Mt=Mt+Math.imul(yn,Vn)|0,Dt=Dt+Math.imul(yn,dr)|0,Bt=Bt+Math.imul(_n,_r)|0,Mt=Mt+Math.imul(_n,Qr)|0,Mt=Mt+Math.imul(An,_r)|0,Dt=Dt+Math.imul(An,Qr)|0,Bt=Bt+Math.imul(Cn,Mr)|0,Mt=Mt+Math.imul(Cn,qr)|0,Mt=Mt+Math.imul(Nn,Mr)|0,Dt=Dt+Math.imul(Nn,qr)|0,Bt=Bt+Math.imul(Zt,Lr)|0,Mt=Mt+Math.imul(Zt,ao)|0,Mt=Mt+Math.imul(En,Lr)|0,Dt=Dt+Math.imul(En,ao)|0,Bt=Bt+Math.imul(fn,Br)|0,Mt=Mt+Math.imul(fn,go)|0,Mt=Mt+Math.imul(xn,Br)|0,Dt=Dt+Math.imul(xn,go)|0,Bt=Bt+Math.imul(Xt,Pn)|0,Mt=Mt+Math.imul(Xt,hn)|0,Mt=Mt+Math.imul(un,Pn)|0,Dt=Dt+Math.imul(un,hn)|0,Bt=Bt+Math.imul(Vt,kn)|0,Mt=Mt+Math.imul(Vt,On)|0,Mt=Mt+Math.imul(nn,kn)|0,Dt=Dt+Math.imul(nn,On)|0;var Jr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Bt=Math.imul(wn,Bn),Mt=Math.imul(wn,Xn),Mt=Mt+Math.imul(Rn,Bn)|0,Dt=Math.imul(Rn,Xn),Bt=Bt+Math.imul(tn,Gn)|0,Mt=Mt+Math.imul(tn,Fn)|0,Mt=Mt+Math.imul(qt,Gn)|0,Dt=Dt+Math.imul(qt,Fn)|0,Bt=Bt+Math.imul(sn,Vn)|0,Mt=Mt+Math.imul(sn,dr)|0,Mt=Mt+Math.imul(rn,Vn)|0,Dt=Dt+Math.imul(rn,dr)|0,Bt=Bt+Math.imul(Tn,_r)|0,Mt=Mt+Math.imul(Tn,Qr)|0,Mt=Mt+Math.imul(yn,_r)|0,Dt=Dt+Math.imul(yn,Qr)|0,Bt=Bt+Math.imul(_n,Mr)|0,Mt=Mt+Math.imul(_n,qr)|0,Mt=Mt+Math.imul(An,Mr)|0,Dt=Dt+Math.imul(An,qr)|0,Bt=Bt+Math.imul(Cn,Lr)|0,Mt=Mt+Math.imul(Cn,ao)|0,Mt=Mt+Math.imul(Nn,Lr)|0,Dt=Dt+Math.imul(Nn,ao)|0,Bt=Bt+Math.imul(Zt,Br)|0,Mt=Mt+Math.imul(Zt,go)|0,Mt=Mt+Math.imul(En,Br)|0,Dt=Dt+Math.imul(En,go)|0,Bt=Bt+Math.imul(fn,Pn)|0,Mt=Mt+Math.imul(fn,hn)|0,Mt=Mt+Math.imul(xn,Pn)|0,Dt=Dt+Math.imul(xn,hn)|0,Bt=Bt+Math.imul(Xt,kn)|0,Mt=Mt+Math.imul(Xt,On)|0,Mt=Mt+Math.imul(un,kn)|0,Dt=Dt+Math.imul(un,On)|0,Bt=Bt+Math.imul(Vt,Yn)|0,Mt=Mt+Math.imul(Vt,er)|0,Mt=Mt+Math.imul(nn,Yn)|0,Dt=Dt+Math.imul(nn,er)|0;var br=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(br>>>26)|0,br&=67108863,Bt=Math.imul(wn,Gn),Mt=Math.imul(wn,Fn),Mt=Mt+Math.imul(Rn,Gn)|0,Dt=Math.imul(Rn,Fn),Bt=Bt+Math.imul(tn,Vn)|0,Mt=Mt+Math.imul(tn,dr)|0,Mt=Mt+Math.imul(qt,Vn)|0,Dt=Dt+Math.imul(qt,dr)|0,Bt=Bt+Math.imul(sn,_r)|0,Mt=Mt+Math.imul(sn,Qr)|0,Mt=Mt+Math.imul(rn,_r)|0,Dt=Dt+Math.imul(rn,Qr)|0,Bt=Bt+Math.imul(Tn,Mr)|0,Mt=Mt+Math.imul(Tn,qr)|0,Mt=Mt+Math.imul(yn,Mr)|0,Dt=Dt+Math.imul(yn,qr)|0,Bt=Bt+Math.imul(_n,Lr)|0,Mt=Mt+Math.imul(_n,ao)|0,Mt=Mt+Math.imul(An,Lr)|0,Dt=Dt+Math.imul(An,ao)|0,Bt=Bt+Math.imul(Cn,Br)|0,Mt=Mt+Math.imul(Cn,go)|0,Mt=Mt+Math.imul(Nn,Br)|0,Dt=Dt+Math.imul(Nn,go)|0,Bt=Bt+Math.imul(Zt,Pn)|0,Mt=Mt+Math.imul(Zt,hn)|0,Mt=Mt+Math.imul(En,Pn)|0,Dt=Dt+Math.imul(En,hn)|0,Bt=Bt+Math.imul(fn,kn)|0,Mt=Mt+Math.imul(fn,On)|0,Mt=Mt+Math.imul(xn,kn)|0,Dt=Dt+Math.imul(xn,On)|0,Bt=Bt+Math.imul(Xt,Yn)|0,Mt=Mt+Math.imul(Xt,er)|0,Mt=Mt+Math.imul(un,Yn)|0,Dt=Dt+Math.imul(un,er)|0;var $r=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+($r>>>26)|0,$r&=67108863,Bt=Math.imul(wn,Vn),Mt=Math.imul(wn,dr),Mt=Mt+Math.imul(Rn,Vn)|0,Dt=Math.imul(Rn,dr),Bt=Bt+Math.imul(tn,_r)|0,Mt=Mt+Math.imul(tn,Qr)|0,Mt=Mt+Math.imul(qt,_r)|0,Dt=Dt+Math.imul(qt,Qr)|0,Bt=Bt+Math.imul(sn,Mr)|0,Mt=Mt+Math.imul(sn,qr)|0,Mt=Mt+Math.imul(rn,Mr)|0,Dt=Dt+Math.imul(rn,qr)|0,Bt=Bt+Math.imul(Tn,Lr)|0,Mt=Mt+Math.imul(Tn,ao)|0,Mt=Mt+Math.imul(yn,Lr)|0,Dt=Dt+Math.imul(yn,ao)|0,Bt=Bt+Math.imul(_n,Br)|0,Mt=Mt+Math.imul(_n,go)|0,Mt=Mt+Math.imul(An,Br)|0,Dt=Dt+Math.imul(An,go)|0,Bt=Bt+Math.imul(Cn,Pn)|0,Mt=Mt+Math.imul(Cn,hn)|0,Mt=Mt+Math.imul(Nn,Pn)|0,Dt=Dt+Math.imul(Nn,hn)|0,Bt=Bt+Math.imul(Zt,kn)|0,Mt=Mt+Math.imul(Zt,On)|0,Mt=Mt+Math.imul(En,kn)|0,Dt=Dt+Math.imul(En,On)|0,Bt=Bt+Math.imul(fn,Yn)|0,Mt=Mt+Math.imul(fn,er)|0,Mt=Mt+Math.imul(xn,Yn)|0,Dt=Dt+Math.imul(xn,er)|0;var Dr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Bt=Math.imul(wn,_r),Mt=Math.imul(wn,Qr),Mt=Mt+Math.imul(Rn,_r)|0,Dt=Math.imul(Rn,Qr),Bt=Bt+Math.imul(tn,Mr)|0,Mt=Mt+Math.imul(tn,qr)|0,Mt=Mt+Math.imul(qt,Mr)|0,Dt=Dt+Math.imul(qt,qr)|0,Bt=Bt+Math.imul(sn,Lr)|0,Mt=Mt+Math.imul(sn,ao)|0,Mt=Mt+Math.imul(rn,Lr)|0,Dt=Dt+Math.imul(rn,ao)|0,Bt=Bt+Math.imul(Tn,Br)|0,Mt=Mt+Math.imul(Tn,go)|0,Mt=Mt+Math.imul(yn,Br)|0,Dt=Dt+Math.imul(yn,go)|0,Bt=Bt+Math.imul(_n,Pn)|0,Mt=Mt+Math.imul(_n,hn)|0,Mt=Mt+Math.imul(An,Pn)|0,Dt=Dt+Math.imul(An,hn)|0,Bt=Bt+Math.imul(Cn,kn)|0,Mt=Mt+Math.imul(Cn,On)|0,Mt=Mt+Math.imul(Nn,kn)|0,Dt=Dt+Math.imul(Nn,On)|0,Bt=Bt+Math.imul(Zt,Yn)|0,Mt=Mt+Math.imul(Zt,er)|0,Mt=Mt+Math.imul(En,Yn)|0,Dt=Dt+Math.imul(En,er)|0;var Cr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Bt=Math.imul(wn,Mr),Mt=Math.imul(wn,qr),Mt=Mt+Math.imul(Rn,Mr)|0,Dt=Math.imul(Rn,qr),Bt=Bt+Math.imul(tn,Lr)|0,Mt=Mt+Math.imul(tn,ao)|0,Mt=Mt+Math.imul(qt,Lr)|0,Dt=Dt+Math.imul(qt,ao)|0,Bt=Bt+Math.imul(sn,Br)|0,Mt=Mt+Math.imul(sn,go)|0,Mt=Mt+Math.imul(rn,Br)|0,Dt=Dt+Math.imul(rn,go)|0,Bt=Bt+Math.imul(Tn,Pn)|0,Mt=Mt+Math.imul(Tn,hn)|0,Mt=Mt+Math.imul(yn,Pn)|0,Dt=Dt+Math.imul(yn,hn)|0,Bt=Bt+Math.imul(_n,kn)|0,Mt=Mt+Math.imul(_n,On)|0,Mt=Mt+Math.imul(An,kn)|0,Dt=Dt+Math.imul(An,On)|0,Bt=Bt+Math.imul(Cn,Yn)|0,Mt=Mt+Math.imul(Cn,er)|0,Mt=Mt+Math.imul(Nn,Yn)|0,Dt=Dt+Math.imul(Nn,er)|0;var Ar=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,Bt=Math.imul(wn,Lr),Mt=Math.imul(wn,ao),Mt=Mt+Math.imul(Rn,Lr)|0,Dt=Math.imul(Rn,ao),Bt=Bt+Math.imul(tn,Br)|0,Mt=Mt+Math.imul(tn,go)|0,Mt=Mt+Math.imul(qt,Br)|0,Dt=Dt+Math.imul(qt,go)|0,Bt=Bt+Math.imul(sn,Pn)|0,Mt=Mt+Math.imul(sn,hn)|0,Mt=Mt+Math.imul(rn,Pn)|0,Dt=Dt+Math.imul(rn,hn)|0,Bt=Bt+Math.imul(Tn,kn)|0,Mt=Mt+Math.imul(Tn,On)|0,Mt=Mt+Math.imul(yn,kn)|0,Dt=Dt+Math.imul(yn,On)|0,Bt=Bt+Math.imul(_n,Yn)|0,Mt=Mt+Math.imul(_n,er)|0,Mt=Mt+Math.imul(An,Yn)|0,Dt=Dt+Math.imul(An,er)|0;var Nr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Bt=Math.imul(wn,Br),Mt=Math.imul(wn,go),Mt=Mt+Math.imul(Rn,Br)|0,Dt=Math.imul(Rn,go),Bt=Bt+Math.imul(tn,Pn)|0,Mt=Mt+Math.imul(tn,hn)|0,Mt=Mt+Math.imul(qt,Pn)|0,Dt=Dt+Math.imul(qt,hn)|0,Bt=Bt+Math.imul(sn,kn)|0,Mt=Mt+Math.imul(sn,On)|0,Mt=Mt+Math.imul(rn,kn)|0,Dt=Dt+Math.imul(rn,On)|0,Bt=Bt+Math.imul(Tn,Yn)|0,Mt=Mt+Math.imul(Tn,er)|0,Mt=Mt+Math.imul(yn,Yn)|0,Dt=Dt+Math.imul(yn,er)|0;var Fr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Bt=Math.imul(wn,Pn),Mt=Math.imul(wn,hn),Mt=Mt+Math.imul(Rn,Pn)|0,Dt=Math.imul(Rn,hn),Bt=Bt+Math.imul(tn,kn)|0,Mt=Mt+Math.imul(tn,On)|0,Mt=Mt+Math.imul(qt,kn)|0,Dt=Dt+Math.imul(qt,On)|0,Bt=Bt+Math.imul(sn,Yn)|0,Mt=Mt+Math.imul(sn,er)|0,Mt=Mt+Math.imul(rn,Yn)|0,Dt=Dt+Math.imul(rn,er)|0;var Pr=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Bt=Math.imul(wn,kn),Mt=Math.imul(wn,On),Mt=Mt+Math.imul(Rn,kn)|0,Dt=Math.imul(Rn,On),Bt=Bt+Math.imul(tn,Yn)|0,Mt=Mt+Math.imul(tn,er)|0,Mt=Mt+Math.imul(qt,Yn)|0,Dt=Dt+Math.imul(qt,er)|0;var _i=(Nt+Bt|0)+((Mt&8191)<<13)|0;Nt=(Dt+(Mt>>>13)|0)+(_i>>>26)|0,_i&=67108863,Bt=Math.imul(wn,Yn),Mt=Math.imul(wn,er),Mt=Mt+Math.imul(Rn,Yn)|0,Dt=Math.imul(Rn,er);var nr=(Nt+Bt|0)+((Mt&8191)<<13)|0;return Nt=(Dt+(Mt>>>13)|0)+(nr>>>26)|0,nr&=67108863,Ut[0]=or,Ut[1]=ar,Ut[2]=Vr,Ut[3]=wr,Ut[4]=jr,Ut[5]=Hr,Ut[6]=no,Ut[7]=Xr,Ut[8]=Jr,Ut[9]=br,Ut[10]=$r,Ut[11]=Dr,Ut[12]=Cr,Ut[13]=Ar,Ut[14]=Nr,Ut[15]=Fr,Ut[16]=Pr,Ut[17]=_i,Ut[18]=nr,Nt!==0&&(Ut[19]=Nt,kt.length++),kt};Math.imul||(gt=mt);function bt(zt,Ot,jt){jt.negative=Ot.negative^zt.negative,jt.length=zt.length+Ot.length;for(var kt=0,Tt=0,Ct=0;Ct>>26)|0,Tt+=Ut>>>26,Ut&=67108863}jt.words[Ct]=Nt,kt=Ut,Ut=Tt}return kt!==0?jt.words[Ct]=kt:jt.length--,jt.strip()}function yt(zt,Ot,jt){var kt=new wt;return kt.mulp(zt,Ot,jt)}ot.prototype.mulTo=function(Ot,jt){var kt,Tt=this.length+Ot.length;return this.length===10&&Ot.length===10?kt=gt(this,Ot,jt):Tt<63?kt=mt(this,Ot,jt):Tt<1024?kt=bt(this,Ot,jt):kt=yt(this,Ot,jt),kt};function wt(zt,Ot){this.x=zt,this.y=Ot}wt.prototype.makeRBT=function(Ot){for(var jt=new Array(Ot),kt=ot.prototype._countBits(Ot)-1,Tt=0;Tt>=1;return Tt},wt.prototype.permute=function(Ot,jt,kt,Tt,Ct,Ut){for(var Nt=0;Nt>>1)Ct++;return 1<>>13,kt[2*Ut+1]=Ct&8191,Ct=Ct>>>13;for(Ut=2*jt;Ut>=26,jt+=Tt/67108864|0,jt+=Ct>>>26,this.words[kt]=Ct&67108863}return jt!==0&&(this.words[kt]=jt,this.length++),this},ot.prototype.muln=function(Ot){return this.clone().imuln(Ot)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(Ot){var jt=pt(Ot);if(jt.length===0)return new ot(1);for(var kt=this,Tt=0;Tt=0);var jt=Ot%26,kt=(Ot-jt)/26,Tt=67108863>>>26-jt<<26-jt,Ct;if(jt!==0){var Ut=0;for(Ct=0;Ct>>26-jt}Ut&&(this.words[Ct]=Ut,this.length++)}if(kt!==0){for(Ct=this.length-1;Ct>=0;Ct--)this.words[Ct+kt]=this.words[Ct];for(Ct=0;Ct=0);var Tt;jt?Tt=(jt-jt%26)/26:Tt=0;var Ct=Ot%26,Ut=Math.min((Ot-Ct)/26,this.length),Nt=67108863^67108863>>>Ct<Ut)for(this.length-=Ut,Mt=0;Mt=0&&(Dt!==0||Mt>=Tt);Mt--){var Pt=this.words[Mt]|0;this.words[Mt]=Dt<<26-Ct|Pt>>>Ct,Dt=Pt&Nt}return Bt&&Dt!==0&&(Bt.words[Bt.length++]=Dt),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},ot.prototype.ishrn=function(Ot,jt,kt){return it(this.negative===0),this.iushrn(Ot,jt,kt)},ot.prototype.shln=function(Ot){return this.clone().ishln(Ot)},ot.prototype.ushln=function(Ot){return this.clone().iushln(Ot)},ot.prototype.shrn=function(Ot){return this.clone().ishrn(Ot)},ot.prototype.ushrn=function(Ot){return this.clone().iushrn(Ot)},ot.prototype.testn=function(Ot){it(typeof Ot=="number"&&Ot>=0);var jt=Ot%26,kt=(Ot-jt)/26,Tt=1<=0);var jt=Ot%26,kt=(Ot-jt)/26;if(it(this.negative===0,"imaskn works only with positive numbers"),this.length<=kt)return this;if(jt!==0&&kt++,this.length=Math.min(kt,this.length),jt!==0){var Tt=67108863^67108863>>>jt<=67108864;jt++)this.words[jt]-=67108864,jt===this.length-1?this.words[jt+1]=1:this.words[jt+1]++;return this.length=Math.max(this.length,jt+1),this},ot.prototype.isubn=function(Ot){if(it(typeof Ot=="number"),it(Ot<67108864),Ot<0)return this.iaddn(-Ot);if(this.negative!==0)return this.negative=0,this.iaddn(Ot),this.negative=1,this;if(this.words[0]-=Ot,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var jt=0;jt>26)-(Bt/67108864|0),this.words[Ct+kt]=Ut&67108863}for(;Ct>26,this.words[Ct+kt]=Ut&67108863;if(Nt===0)return this.strip();for(it(Nt===-1),Nt=0,Ct=0;Ct>26,this.words[Ct]=Ut&67108863;return this.negative=1,this.strip()},ot.prototype._wordDiv=function(Ot,jt){var kt=this.length-Ot.length,Tt=this.clone(),Ct=Ot,Ut=Ct.words[Ct.length-1]|0,Nt=this._countBits(Ut);kt=26-Nt,kt!==0&&(Ct=Ct.ushln(kt),Tt.iushln(kt),Ut=Ct.words[Ct.length-1]|0);var Bt=Tt.length-Ct.length,Mt;if(jt!=="mod"){Mt=new ot(null),Mt.length=Bt+1,Mt.words=new Array(Mt.length);for(var Dt=0;Dt=0;Vt--){var nn=(Tt.words[Ct.length+Vt]|0)*67108864+(Tt.words[Ct.length+Vt-1]|0);for(nn=Math.min(nn/Ut|0,67108863),Tt._ishlnsubmul(Ct,nn,Vt);Tt.negative!==0;)nn--,Tt.negative=0,Tt._ishlnsubmul(Ct,1,Vt),Tt.isZero()||(Tt.negative^=1);Mt&&(Mt.words[Vt]=nn)}return Mt&&Mt.strip(),Tt.strip(),jt!=="div"&&kt!==0&&Tt.iushrn(kt),{div:Mt||null,mod:Tt}},ot.prototype.divmod=function(Ot,jt,kt){if(it(!Ot.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Tt,Ct,Ut;return this.negative!==0&&Ot.negative===0?(Ut=this.neg().divmod(Ot,jt),jt!=="mod"&&(Tt=Ut.div.neg()),jt!=="div"&&(Ct=Ut.mod.neg(),kt&&Ct.negative!==0&&Ct.iadd(Ot)),{div:Tt,mod:Ct}):this.negative===0&&Ot.negative!==0?(Ut=this.divmod(Ot.neg(),jt),jt!=="mod"&&(Tt=Ut.div.neg()),{div:Tt,mod:Ut.mod}):this.negative&Ot.negative?(Ut=this.neg().divmod(Ot.neg(),jt),jt!=="div"&&(Ct=Ut.mod.neg(),kt&&Ct.negative!==0&&Ct.isub(Ot)),{div:Ut.div,mod:Ct}):Ot.length>this.length||this.cmp(Ot)<0?{div:new ot(0),mod:this}:Ot.length===1?jt==="div"?{div:this.divn(Ot.words[0]),mod:null}:jt==="mod"?{div:null,mod:new ot(this.modn(Ot.words[0]))}:{div:this.divn(Ot.words[0]),mod:new ot(this.modn(Ot.words[0]))}:this._wordDiv(Ot,jt)},ot.prototype.div=function(Ot){return this.divmod(Ot,"div",!1).div},ot.prototype.mod=function(Ot){return this.divmod(Ot,"mod",!1).mod},ot.prototype.umod=function(Ot){return this.divmod(Ot,"mod",!0).mod},ot.prototype.divRound=function(Ot){var jt=this.divmod(Ot);if(jt.mod.isZero())return jt.div;var kt=jt.div.negative!==0?jt.mod.isub(Ot):jt.mod,Tt=Ot.ushrn(1),Ct=Ot.andln(1),Ut=kt.cmp(Tt);return Ut<0||Ct===1&&Ut===0?jt.div:jt.div.negative!==0?jt.div.isubn(1):jt.div.iaddn(1)},ot.prototype.modn=function(Ot){it(Ot<=67108863);for(var jt=(1<<26)%Ot,kt=0,Tt=this.length-1;Tt>=0;Tt--)kt=(jt*kt+(this.words[Tt]|0))%Ot;return kt},ot.prototype.idivn=function(Ot){it(Ot<=67108863);for(var jt=0,kt=this.length-1;kt>=0;kt--){var Tt=(this.words[kt]|0)+jt*67108864;this.words[kt]=Tt/Ot|0,jt=Tt%Ot}return this.strip()},ot.prototype.divn=function(Ot){return this.clone().idivn(Ot)},ot.prototype.egcd=function(Ot){it(Ot.negative===0),it(!Ot.isZero());var jt=this,kt=Ot.clone();jt.negative!==0?jt=jt.umod(Ot):jt=jt.clone();for(var Tt=new ot(1),Ct=new ot(0),Ut=new ot(0),Nt=new ot(1),Bt=0;jt.isEven()&&kt.isEven();)jt.iushrn(1),kt.iushrn(1),++Bt;for(var Mt=kt.clone(),Dt=jt.clone();!jt.isZero();){for(var Pt=0,Vt=1;!(jt.words[0]&Vt)&&Pt<26;++Pt,Vt<<=1);if(Pt>0)for(jt.iushrn(Pt);Pt-- >0;)(Tt.isOdd()||Ct.isOdd())&&(Tt.iadd(Mt),Ct.isub(Dt)),Tt.iushrn(1),Ct.iushrn(1);for(var nn=0,cn=1;!(kt.words[0]&cn)&&nn<26;++nn,cn<<=1);if(nn>0)for(kt.iushrn(nn);nn-- >0;)(Ut.isOdd()||Nt.isOdd())&&(Ut.iadd(Mt),Nt.isub(Dt)),Ut.iushrn(1),Nt.iushrn(1);jt.cmp(kt)>=0?(jt.isub(kt),Tt.isub(Ut),Ct.isub(Nt)):(kt.isub(jt),Ut.isub(Tt),Nt.isub(Ct))}return{a:Ut,b:Nt,gcd:kt.iushln(Bt)}},ot.prototype._invmp=function(Ot){it(Ot.negative===0),it(!Ot.isZero());var jt=this,kt=Ot.clone();jt.negative!==0?jt=jt.umod(Ot):jt=jt.clone();for(var Tt=new ot(1),Ct=new ot(0),Ut=kt.clone();jt.cmpn(1)>0&&kt.cmpn(1)>0;){for(var Nt=0,Bt=1;!(jt.words[0]&Bt)&&Nt<26;++Nt,Bt<<=1);if(Nt>0)for(jt.iushrn(Nt);Nt-- >0;)Tt.isOdd()&&Tt.iadd(Ut),Tt.iushrn(1);for(var Mt=0,Dt=1;!(kt.words[0]&Dt)&&Mt<26;++Mt,Dt<<=1);if(Mt>0)for(kt.iushrn(Mt);Mt-- >0;)Ct.isOdd()&&Ct.iadd(Ut),Ct.iushrn(1);jt.cmp(kt)>=0?(jt.isub(kt),Tt.isub(Ct)):(kt.isub(jt),Ct.isub(Tt))}var Pt;return jt.cmpn(1)===0?Pt=Tt:Pt=Ct,Pt.cmpn(0)<0&&Pt.iadd(Ot),Pt},ot.prototype.gcd=function(Ot){if(this.isZero())return Ot.abs();if(Ot.isZero())return this.abs();var jt=this.clone(),kt=Ot.clone();jt.negative=0,kt.negative=0;for(var Tt=0;jt.isEven()&&kt.isEven();Tt++)jt.iushrn(1),kt.iushrn(1);do{for(;jt.isEven();)jt.iushrn(1);for(;kt.isEven();)kt.iushrn(1);var Ct=jt.cmp(kt);if(Ct<0){var Ut=jt;jt=kt,kt=Ut}else if(Ct===0||kt.cmpn(1)===0)break;jt.isub(kt)}while(!0);return kt.iushln(Tt)},ot.prototype.invm=function(Ot){return this.egcd(Ot).a.umod(Ot)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(Ot){return this.words[0]&Ot},ot.prototype.bincn=function(Ot){it(typeof Ot=="number");var jt=Ot%26,kt=(Ot-jt)/26,Tt=1<>>26,Nt&=67108863,this.words[Ut]=Nt}return Ct!==0&&(this.words[Ut]=Ct,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(Ot){var jt=Ot<0;if(this.negative!==0&&!jt)return-1;if(this.negative===0&&jt)return 1;this.strip();var kt;if(this.length>1)kt=1;else{jt&&(Ot=-Ot),it(Ot<=67108863,"Number is too big");var Tt=this.words[0]|0;kt=Tt===Ot?0:TtOt.length)return 1;if(this.length=0;kt--){var Tt=this.words[kt]|0,Ct=Ot.words[kt]|0;if(Tt!==Ct){TtCt&&(jt=1);break}}return jt},ot.prototype.gtn=function(Ot){return this.cmpn(Ot)===1},ot.prototype.gt=function(Ot){return this.cmp(Ot)===1},ot.prototype.gten=function(Ot){return this.cmpn(Ot)>=0},ot.prototype.gte=function(Ot){return this.cmp(Ot)>=0},ot.prototype.ltn=function(Ot){return this.cmpn(Ot)===-1},ot.prototype.lt=function(Ot){return this.cmp(Ot)===-1},ot.prototype.lten=function(Ot){return this.cmpn(Ot)<=0},ot.prototype.lte=function(Ot){return this.cmp(Ot)<=0},ot.prototype.eqn=function(Ot){return this.cmpn(Ot)===0},ot.prototype.eq=function(Ot){return this.cmp(Ot)===0},ot.red=function(Ot){return new Ft(Ot)},ot.prototype.toRed=function(Ot){return it(!this.red,"Already a number in reduction context"),it(this.negative===0,"red works only with positives"),Ot.convertTo(this)._forceRed(Ot)},ot.prototype.fromRed=function(){return it(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(Ot){return this.red=Ot,this},ot.prototype.forceRed=function(Ot){return it(!this.red,"Already a number in reduction context"),this._forceRed(Ot)},ot.prototype.redAdd=function(Ot){return it(this.red,"redAdd works only with red numbers"),this.red.add(this,Ot)},ot.prototype.redIAdd=function(Ot){return it(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Ot)},ot.prototype.redSub=function(Ot){return it(this.red,"redSub works only with red numbers"),this.red.sub(this,Ot)},ot.prototype.redISub=function(Ot){return it(this.red,"redISub works only with red numbers"),this.red.isub(this,Ot)},ot.prototype.redShl=function(Ot){return it(this.red,"redShl works only with red numbers"),this.red.shl(this,Ot)},ot.prototype.redMul=function(Ot){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ot),this.red.mul(this,Ot)},ot.prototype.redIMul=function(Ot){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,Ot),this.red.imul(this,Ot)},ot.prototype.redSqr=function(){return it(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return it(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return it(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return it(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return it(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(Ot){return it(this.red&&!Ot.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Ot)};var vt={k256:null,p224:null,p192:null,p25519:null};function xt(zt,Ot){this.name=zt,this.p=new ot(Ot,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}xt.prototype._tmp=function(){var Ot=new ot(null);return Ot.words=new Array(Math.ceil(this.n/13)),Ot},xt.prototype.ireduce=function(Ot){var jt=Ot,kt;do this.split(jt,this.tmp),jt=this.imulK(jt),jt=jt.iadd(this.tmp),kt=jt.bitLength();while(kt>this.n);var Tt=kt0?jt.isub(this.p):jt.strip!==void 0?jt.strip():jt._strip(),jt},xt.prototype.split=function(Ot,jt){Ot.iushrn(this.n,0,jt)},xt.prototype.imulK=function(Ot){return Ot.imul(this.k)};function St(){xt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}rt(St,xt),St.prototype.split=function(Ot,jt){for(var kt=4194303,Tt=Math.min(Ot.length,9),Ct=0;Ct>>22,Ut=Nt}Ut>>>=22,Ot.words[Ct-10]=Ut,Ut===0&&Ot.length>10?Ot.length-=10:Ot.length-=9},St.prototype.imulK=function(Ot){Ot.words[Ot.length]=0,Ot.words[Ot.length+1]=0,Ot.length+=2;for(var jt=0,kt=0;kt>>=26,Ot.words[kt]=Ct,jt=Tt}return jt!==0&&(Ot.words[Ot.length++]=jt),Ot},ot._prime=function(Ot){if(vt[Ot])return vt[Ot];var jt;if(Ot==="k256")jt=new St;else if(Ot==="p224")jt=new Et;else if(Ot==="p192")jt=new $t;else if(Ot==="p25519")jt=new It;else throw new Error("Unknown prime "+Ot);return vt[Ot]=jt,jt};function Ft(zt){if(typeof zt=="string"){var Ot=ot._prime(zt);this.m=Ot.p,this.prime=Ot}else it(zt.gtn(1),"modulus must be greater than 1"),this.m=zt,this.prime=null}Ft.prototype._verify1=function(Ot){it(Ot.negative===0,"red works only with positives"),it(Ot.red,"red works only with red numbers")},Ft.prototype._verify2=function(Ot,jt){it((Ot.negative|jt.negative)===0,"red works only with positives"),it(Ot.red&&Ot.red===jt.red,"red works only with red numbers")},Ft.prototype.imod=function(Ot){return this.prime?this.prime.ireduce(Ot)._forceRed(this):Ot.umod(this.m)._forceRed(this)},Ft.prototype.neg=function(Ot){return Ot.isZero()?Ot.clone():this.m.sub(Ot)._forceRed(this)},Ft.prototype.add=function(Ot,jt){this._verify2(Ot,jt);var kt=Ot.add(jt);return kt.cmp(this.m)>=0&&kt.isub(this.m),kt._forceRed(this)},Ft.prototype.iadd=function(Ot,jt){this._verify2(Ot,jt);var kt=Ot.iadd(jt);return kt.cmp(this.m)>=0&&kt.isub(this.m),kt},Ft.prototype.sub=function(Ot,jt){this._verify2(Ot,jt);var kt=Ot.sub(jt);return kt.cmpn(0)<0&&kt.iadd(this.m),kt._forceRed(this)},Ft.prototype.isub=function(Ot,jt){this._verify2(Ot,jt);var kt=Ot.isub(jt);return kt.cmpn(0)<0&&kt.iadd(this.m),kt},Ft.prototype.shl=function(Ot,jt){return this._verify1(Ot),this.imod(Ot.ushln(jt))},Ft.prototype.imul=function(Ot,jt){return this._verify2(Ot,jt),this.imod(Ot.imul(jt))},Ft.prototype.mul=function(Ot,jt){return this._verify2(Ot,jt),this.imod(Ot.mul(jt))},Ft.prototype.isqr=function(Ot){return this.imul(Ot,Ot.clone())},Ft.prototype.sqr=function(Ot){return this.mul(Ot,Ot)},Ft.prototype.sqrt=function(Ot){if(Ot.isZero())return Ot.clone();var jt=this.m.andln(3);if(it(jt%2===1),jt===3){var kt=this.m.add(new ot(1)).iushrn(2);return this.pow(Ot,kt)}for(var Tt=this.m.subn(1),Ct=0;!Tt.isZero()&&Tt.andln(1)===0;)Ct++,Tt.iushrn(1);it(!Tt.isZero());var Ut=new ot(1).toRed(this),Nt=Ut.redNeg(),Bt=this.m.subn(1).iushrn(1),Mt=this.m.bitLength();for(Mt=new ot(2*Mt*Mt).toRed(this);this.pow(Mt,Bt).cmp(Nt)!==0;)Mt.redIAdd(Nt);for(var Dt=this.pow(Mt,Tt),Pt=this.pow(Ot,Tt.addn(1).iushrn(1)),Vt=this.pow(Ot,Tt),nn=Ct;Vt.cmp(Ut)!==0;){for(var cn=Vt,Xt=0;cn.cmp(Ut)!==0;Xt++)cn=cn.redSqr();it(Xt=0;Ct--){for(var Dt=jt.words[Ct],Pt=Mt-1;Pt>=0;Pt--){var Vt=Dt>>Pt&1;if(Ut!==Tt[0]&&(Ut=this.sqr(Ut)),Vt===0&&Nt===0){Bt=0;continue}Nt<<=1,Nt|=Vt,Bt++,!(Bt!==kt&&(Ct!==0||Pt!==0))&&(Ut=this.mul(Ut,Tt[Nt]),Bt=0,Nt=0)}Mt=26}return Ut},Ft.prototype.convertTo=function(Ot){var jt=Ot.umod(this.m);return jt===Ot?jt.clone():jt},Ft.prototype.convertFrom=function(Ot){var jt=Ot.clone();return jt.red=null,jt},ot.mont=function(Ot){return new Ht(Ot)};function Ht(zt){Ft.call(this,zt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}rt(Ht,Ft),Ht.prototype.convertTo=function(Ot){return this.imod(Ot.ushln(this.shift))},Ht.prototype.convertFrom=function(Ot){var jt=this.imod(Ot.mul(this.rinv));return jt.red=null,jt},Ht.prototype.imul=function(Ot,jt){if(Ot.isZero()||jt.isZero())return Ot.words[0]=0,Ot.length=1,Ot;var kt=Ot.imul(jt),Tt=kt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ct=kt.isub(Tt).iushrn(this.shift),Ut=Ct;return Ct.cmp(this.m)>=0?Ut=Ct.isub(this.m):Ct.cmpn(0)<0&&(Ut=Ct.iadd(this.m)),Ut._forceRed(this)},Ht.prototype.mul=function(Ot,jt){if(Ot.isZero()||jt.isZero())return new ot(0)._forceRed(this);var kt=Ot.mul(jt),Tt=kt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ct=kt.isub(Tt).iushrn(this.shift),Ut=Ct;return Ct.cmp(this.m)>=0?Ut=Ct.isub(this.m):Ct.cmpn(0)<0&&(Ut=Ct.iadd(this.m)),Ut._forceRed(this)},Ht.prototype.invm=function(Ot){var jt=this.imod(Ot._invmp(this.m).mul(this.r2));return jt._forceRed(this)}})(tt,commonjsGlobal)})(bn$2);var bnExports$2=bn$2.exports,brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var tt;brorand.exports=function(rt){return tt||(tt=new et(null)),tt.generate(rt)};function et(it){this.rand=it}if(brorand.exports.Rand=et,et.prototype.generate=function(rt){return this._rand(rt)},et.prototype._rand=function(rt){if(this.rand.getBytes)return this.rand.getBytes(rt);for(var ot=new Uint8Array(rt),at=0;at=0);return st},nt.prototype._randrange=function(rt,ot){var at=ot.sub(rt);return rt.add(this._randbelow(at))},nt.prototype.test=function(rt,ot,at){var st=rt.bitLength(),lt=tt.mont(rt),ct=new tt(1).toRed(lt);ot||(ot=Math.max(1,st/48|0));for(var ut=rt.subn(1),ht=0;!ut.testn(ht);ht++);for(var dt=rt.shrn(ht),pt=ut.toRed(lt),mt=!0;ot>0;ot--){var gt=this._randrange(new tt(2),ut);at&&at(gt);var bt=gt.toRed(lt).redPow(dt);if(!(bt.cmp(ct)===0||bt.cmp(pt)===0)){for(var yt=1;yt0;ot--){var pt=this._randrange(new tt(2),ct),mt=rt.gcd(pt);if(mt.cmpn(1)!==0)return mt;var gt=pt.toRed(st).redPow(ht);if(!(gt.cmp(lt)===0||gt.cmp(dt)===0)){for(var bt=1;btyt;)vt.ishrn(1);if(vt.isEven()&&vt.iadd(ot),vt.testn(1)||vt.iadd(at),wt.cmp(at)){if(!wt.cmp(st))for(;vt.mod(lt).cmp(ct);)vt.iadd(ht)}else for(;vt.mod(nt).cmp(ut);)vt.iadd(ht);if(xt=vt.shrn(1),mt(xt)&&mt(vt)&>(xt)&>(vt)&&rt.test(xt)&&rt.test(vt))return vt}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var tt=bnExports$2,et=requireMr(),nt=new et,it=new tt(24),rt=new tt(11),ot=new tt(10),at=new tt(3),st=new tt(7),lt=requireGeneratePrime(),ct=browserExports;dh=mt;function ut(bt,yt){return yt=yt||"utf8",Buffer.isBuffer(bt)||(bt=new Buffer(bt,yt)),this._pub=new tt(bt),this}function ht(bt,yt){return yt=yt||"utf8",Buffer.isBuffer(bt)||(bt=new Buffer(bt,yt)),this._priv=new tt(bt),this}var dt={};function pt(bt,yt){var wt=yt.toString("hex"),vt=[wt,bt.toString(16)].join("_");if(vt in dt)return dt[vt];var xt=0;if(bt.isEven()||!lt.simpleSieve||!lt.fermatTest(bt)||!nt.test(bt))return xt+=1,wt==="02"||wt==="05"?xt+=8:xt+=4,dt[vt]=xt,xt;nt.test(bt.shrn(1))||(xt+=2);var St;switch(wt){case"02":bt.mod(it).cmp(rt)&&(xt+=8);break;case"05":St=bt.mod(ot),St.cmp(at)&&St.cmp(st)&&(xt+=8);break;default:xt+=4}return dt[vt]=xt,xt}function mt(bt,yt,wt){this.setGenerator(yt),this.__prime=new tt(bt),this._prime=tt.mont(this.__prime),this._primeLen=bt.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,wt?(this.setPublicKey=ut,this.setPrivateKey=ht):this._primeCode=8}Object.defineProperty(mt.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=pt(this.__prime,this.__gen)),this._primeCode}}),mt.prototype.generateKeys=function(){return this._priv||(this._priv=new tt(ct(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},mt.prototype.computeSecret=function(bt){bt=new tt(bt),bt=bt.toRed(this._prime);var yt=bt.redPow(this._priv).fromRed(),wt=new Buffer(yt.toArray()),vt=this.getPrime();if(wt.length0?kt:Tt},ot.min=function(kt,Tt){return kt.cmp(Tt)<0?kt:Tt},ot.prototype._init=function(kt,Tt,Ct){if(typeof kt=="number")return this._initNumber(kt,Tt,Ct);if(typeof kt=="object")return this._initArray(kt,Tt,Ct);Tt==="hex"&&(Tt=16),it(Tt===(Tt|0)&&Tt>=2&&Tt<=36),kt=kt.toString().replace(/\s+/g,"");var Ut=0;kt[0]==="-"&&(Ut++,this.negative=1),Ut=0;Ut-=3)Bt=kt[Ut]|kt[Ut-1]<<8|kt[Ut-2]<<16,this.words[Nt]|=Bt<>>26-Mt&67108863,Mt+=24,Mt>=26&&(Mt-=26,Nt++);else if(Ct==="le")for(Ut=0,Nt=0;Ut>>26-Mt&67108863,Mt+=24,Mt>=26&&(Mt-=26,Nt++);return this._strip()};function st(jt,kt){var Tt=jt.charCodeAt(kt);if(Tt>=48&&Tt<=57)return Tt-48;if(Tt>=65&&Tt<=70)return Tt-55;if(Tt>=97&&Tt<=102)return Tt-87;it(!1,"Invalid character in "+jt)}function lt(jt,kt,Tt){var Ct=st(jt,Tt);return Tt-1>=kt&&(Ct|=st(jt,Tt-1)<<4),Ct}ot.prototype._parseHex=function(kt,Tt,Ct){this.length=Math.ceil((kt.length-Tt)/6),this.words=new Array(this.length);for(var Ut=0;Ut=Tt;Ut-=2)Mt=lt(kt,Tt,Ut)<=18?(Nt-=18,Bt+=1,this.words[Bt]|=Mt>>>26):Nt+=8;else{var Dt=kt.length-Tt;for(Ut=Dt%2===0?Tt+1:Tt;Ut=18?(Nt-=18,Bt+=1,this.words[Bt]|=Mt>>>26):Nt+=8}this._strip()};function ct(jt,kt,Tt,Ct){for(var Ut=0,Nt=0,Bt=Math.min(jt.length,Tt),Mt=kt;Mt=49?Nt=Dt-49+10:Dt>=17?Nt=Dt-17+10:Nt=Dt,it(Dt>=0&&Nt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ot.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht}catch{ot.prototype.inspect=ht}else ot.prototype.inspect=ht;function ht(){return(this.red?""}var dt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],pt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(kt,Tt){kt=kt||10,Tt=Tt|0||1;var Ct;if(kt===16||kt==="hex"){Ct="";for(var Ut=0,Nt=0,Bt=0;Bt>>24-Ut&16777215,Ut+=2,Ut>=26&&(Ut-=26,Bt--),Nt!==0||Bt!==this.length-1?Ct=dt[6-Dt.length]+Dt+Ct:Ct=Dt+Ct}for(Nt!==0&&(Ct=Nt.toString(16)+Ct);Ct.length%Tt!==0;)Ct="0"+Ct;return this.negative!==0&&(Ct="-"+Ct),Ct}if(kt===(kt|0)&&kt>=2&&kt<=36){var Pt=pt[kt],Vt=mt[kt];Ct="";var nn=this.clone();for(nn.negative=0;!nn.isZero();){var cn=nn.modrn(Vt).toString(kt);nn=nn.idivn(Vt),nn.isZero()?Ct=cn+Ct:Ct=dt[Pt-cn.length]+cn+Ct}for(this.isZero()&&(Ct="0"+Ct);Ct.length%Tt!==0;)Ct="0"+Ct;return this.negative!==0&&(Ct="-"+Ct),Ct}it(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var kt=this.words[0];return this.length===2?kt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?kt+=4503599627370496+this.words[1]*67108864:this.length>2&&it(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-kt:kt},ot.prototype.toJSON=function(){return this.toString(16,2)},at&&(ot.prototype.toBuffer=function(kt,Tt){return this.toArrayLike(at,kt,Tt)}),ot.prototype.toArray=function(kt,Tt){return this.toArrayLike(Array,kt,Tt)};var gt=function(kt,Tt){return kt.allocUnsafe?kt.allocUnsafe(Tt):new kt(Tt)};ot.prototype.toArrayLike=function(kt,Tt,Ct){this._strip();var Ut=this.byteLength(),Nt=Ct||Math.max(1,Ut);it(Ut<=Nt,"byte array longer than desired length"),it(Nt>0,"Requested array length <= 0");var Bt=gt(kt,Nt),Mt=Tt==="le"?"LE":"BE";return this["_toArrayLike"+Mt](Bt,Ut),Bt},ot.prototype._toArrayLikeLE=function(kt,Tt){for(var Ct=0,Ut=0,Nt=0,Bt=0;Nt>8&255),Ct>16&255),Bt===6?(Ct>24&255),Ut=0,Bt=0):(Ut=Mt>>>24,Bt+=2)}if(Ct=0&&(kt[Ct--]=Mt>>8&255),Ct>=0&&(kt[Ct--]=Mt>>16&255),Bt===6?(Ct>=0&&(kt[Ct--]=Mt>>24&255),Ut=0,Bt=0):(Ut=Mt>>>24,Bt+=2)}if(Ct>=0)for(kt[Ct--]=Ut;Ct>=0;)kt[Ct--]=0},Math.clz32?ot.prototype._countBits=function(kt){return 32-Math.clz32(kt)}:ot.prototype._countBits=function(kt){var Tt=kt,Ct=0;return Tt>=4096&&(Ct+=13,Tt>>>=13),Tt>=64&&(Ct+=7,Tt>>>=7),Tt>=8&&(Ct+=4,Tt>>>=4),Tt>=2&&(Ct+=2,Tt>>>=2),Ct+Tt},ot.prototype._zeroBits=function(kt){if(kt===0)return 26;var Tt=kt,Ct=0;return Tt&8191||(Ct+=13,Tt>>>=13),Tt&127||(Ct+=7,Tt>>>=7),Tt&15||(Ct+=4,Tt>>>=4),Tt&3||(Ct+=2,Tt>>>=2),Tt&1||Ct++,Ct},ot.prototype.bitLength=function(){var kt=this.words[this.length-1],Tt=this._countBits(kt);return(this.length-1)*26+Tt};function bt(jt){for(var kt=new Array(jt.bitLength()),Tt=0;Tt>>Ut&1}return kt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var kt=0,Tt=0;Ttkt.length?this.clone().ior(kt):kt.clone().ior(this)},ot.prototype.uor=function(kt){return this.length>kt.length?this.clone().iuor(kt):kt.clone().iuor(this)},ot.prototype.iuand=function(kt){var Tt;this.length>kt.length?Tt=kt:Tt=this;for(var Ct=0;Ctkt.length?this.clone().iand(kt):kt.clone().iand(this)},ot.prototype.uand=function(kt){return this.length>kt.length?this.clone().iuand(kt):kt.clone().iuand(this)},ot.prototype.iuxor=function(kt){var Tt,Ct;this.length>kt.length?(Tt=this,Ct=kt):(Tt=kt,Ct=this);for(var Ut=0;Utkt.length?this.clone().ixor(kt):kt.clone().ixor(this)},ot.prototype.uxor=function(kt){return this.length>kt.length?this.clone().iuxor(kt):kt.clone().iuxor(this)},ot.prototype.inotn=function(kt){it(typeof kt=="number"&&kt>=0);var Tt=Math.ceil(kt/26)|0,Ct=kt%26;this._expand(Tt),Ct>0&&Tt--;for(var Ut=0;Ut0&&(this.words[Ut]=~this.words[Ut]&67108863>>26-Ct),this._strip()},ot.prototype.notn=function(kt){return this.clone().inotn(kt)},ot.prototype.setn=function(kt,Tt){it(typeof kt=="number"&&kt>=0);var Ct=kt/26|0,Ut=kt%26;return this._expand(Ct+1),Tt?this.words[Ct]=this.words[Ct]|1<kt.length?(Ct=this,Ut=kt):(Ct=kt,Ut=this);for(var Nt=0,Bt=0;Bt>>26;for(;Nt!==0&&Bt>>26;if(this.length=Ct.length,Nt!==0)this.words[this.length]=Nt,this.length++;else if(Ct!==this)for(;Btkt.length?this.clone().iadd(kt):kt.clone().iadd(this)},ot.prototype.isub=function(kt){if(kt.negative!==0){kt.negative=0;var Tt=this.iadd(kt);return kt.negative=1,Tt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(kt),this.negative=1,this._normSign();var Ct=this.cmp(kt);if(Ct===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Ut,Nt;Ct>0?(Ut=this,Nt=kt):(Ut=kt,Nt=this);for(var Bt=0,Mt=0;Mt>26,this.words[Mt]=Tt&67108863;for(;Bt!==0&&Mt>26,this.words[Mt]=Tt&67108863;if(Bt===0&&Mt>>26,nn=Dt&67108863,cn=Math.min(Pt,kt.length-1),Xt=Math.max(0,Pt-jt.length+1);Xt<=cn;Xt++){var un=Pt-Xt|0;Ut=jt.words[un]|0,Nt=kt.words[Xt]|0,Bt=Ut*Nt+nn,Vt+=Bt/67108864|0,nn=Bt&67108863}Tt.words[Pt]=nn|0,Dt=Vt|0}return Dt!==0?Tt.words[Pt]=Dt|0:Tt.length--,Tt._strip()}var wt=function(kt,Tt,Ct){var Ut=kt.words,Nt=Tt.words,Bt=Ct.words,Mt=0,Dt,Pt,Vt,nn=Ut[0]|0,cn=nn&8191,Xt=nn>>>13,un=Ut[1]|0,en=un&8191,fn=un>>>13,xn=Ut[2]|0,an=xn&8191,Zt=xn>>>13,En=Ut[3]|0,In=En&8191,Cn=En>>>13,Nn=Ut[4]|0,Un=Nn&8191,_n=Nn>>>13,An=Ut[5]|0,gn=An&8191,Tn=An>>>13,yn=Ut[6]|0,dn=yn&8191,sn=yn>>>13,rn=Ut[7]|0,Sn=rn&8191,tn=rn>>>13,qt=Ut[8]|0,Kt=qt&8191,wn=qt>>>13,Rn=Ut[9]|0,jn=Rn&8191,Bn=Rn>>>13,Xn=Nt[0]|0,Wn=Xn&8191,Gn=Xn>>>13,Fn=Nt[1]|0,Jn=Fn&8191,Vn=Fn>>>13,dr=Nt[2]|0,ur=dr&8191,_r=dr>>>13,Qr=Nt[3]|0,Or=Qr&8191,Mr=Qr>>>13,qr=Nt[4]|0,Ur=qr&8191,Lr=qr>>>13,ao=Nt[5]|0,Gr=ao&8191,Br=ao>>>13,go=Nt[6]|0,vn=go&8191,Pn=go>>>13,hn=Nt[7]|0,Jt=hn&8191,kn=hn>>>13,On=Nt[8]|0,Dn=On&8191,Yn=On>>>13,er=Nt[9]|0,or=er&8191,ar=er>>>13;Ct.negative=kt.negative^Tt.negative,Ct.length=19,Dt=Math.imul(cn,Wn),Pt=Math.imul(cn,Gn),Pt=Pt+Math.imul(Xt,Wn)|0,Vt=Math.imul(Xt,Gn);var Vr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Dt=Math.imul(en,Wn),Pt=Math.imul(en,Gn),Pt=Pt+Math.imul(fn,Wn)|0,Vt=Math.imul(fn,Gn),Dt=Dt+Math.imul(cn,Jn)|0,Pt=Pt+Math.imul(cn,Vn)|0,Pt=Pt+Math.imul(Xt,Jn)|0,Vt=Vt+Math.imul(Xt,Vn)|0;var wr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(wr>>>26)|0,wr&=67108863,Dt=Math.imul(an,Wn),Pt=Math.imul(an,Gn),Pt=Pt+Math.imul(Zt,Wn)|0,Vt=Math.imul(Zt,Gn),Dt=Dt+Math.imul(en,Jn)|0,Pt=Pt+Math.imul(en,Vn)|0,Pt=Pt+Math.imul(fn,Jn)|0,Vt=Vt+Math.imul(fn,Vn)|0,Dt=Dt+Math.imul(cn,ur)|0,Pt=Pt+Math.imul(cn,_r)|0,Pt=Pt+Math.imul(Xt,ur)|0,Vt=Vt+Math.imul(Xt,_r)|0;var jr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(jr>>>26)|0,jr&=67108863,Dt=Math.imul(In,Wn),Pt=Math.imul(In,Gn),Pt=Pt+Math.imul(Cn,Wn)|0,Vt=Math.imul(Cn,Gn),Dt=Dt+Math.imul(an,Jn)|0,Pt=Pt+Math.imul(an,Vn)|0,Pt=Pt+Math.imul(Zt,Jn)|0,Vt=Vt+Math.imul(Zt,Vn)|0,Dt=Dt+Math.imul(en,ur)|0,Pt=Pt+Math.imul(en,_r)|0,Pt=Pt+Math.imul(fn,ur)|0,Vt=Vt+Math.imul(fn,_r)|0,Dt=Dt+Math.imul(cn,Or)|0,Pt=Pt+Math.imul(cn,Mr)|0,Pt=Pt+Math.imul(Xt,Or)|0,Vt=Vt+Math.imul(Xt,Mr)|0;var Hr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Dt=Math.imul(Un,Wn),Pt=Math.imul(Un,Gn),Pt=Pt+Math.imul(_n,Wn)|0,Vt=Math.imul(_n,Gn),Dt=Dt+Math.imul(In,Jn)|0,Pt=Pt+Math.imul(In,Vn)|0,Pt=Pt+Math.imul(Cn,Jn)|0,Vt=Vt+Math.imul(Cn,Vn)|0,Dt=Dt+Math.imul(an,ur)|0,Pt=Pt+Math.imul(an,_r)|0,Pt=Pt+Math.imul(Zt,ur)|0,Vt=Vt+Math.imul(Zt,_r)|0,Dt=Dt+Math.imul(en,Or)|0,Pt=Pt+Math.imul(en,Mr)|0,Pt=Pt+Math.imul(fn,Or)|0,Vt=Vt+Math.imul(fn,Mr)|0,Dt=Dt+Math.imul(cn,Ur)|0,Pt=Pt+Math.imul(cn,Lr)|0,Pt=Pt+Math.imul(Xt,Ur)|0,Vt=Vt+Math.imul(Xt,Lr)|0;var no=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(no>>>26)|0,no&=67108863,Dt=Math.imul(gn,Wn),Pt=Math.imul(gn,Gn),Pt=Pt+Math.imul(Tn,Wn)|0,Vt=Math.imul(Tn,Gn),Dt=Dt+Math.imul(Un,Jn)|0,Pt=Pt+Math.imul(Un,Vn)|0,Pt=Pt+Math.imul(_n,Jn)|0,Vt=Vt+Math.imul(_n,Vn)|0,Dt=Dt+Math.imul(In,ur)|0,Pt=Pt+Math.imul(In,_r)|0,Pt=Pt+Math.imul(Cn,ur)|0,Vt=Vt+Math.imul(Cn,_r)|0,Dt=Dt+Math.imul(an,Or)|0,Pt=Pt+Math.imul(an,Mr)|0,Pt=Pt+Math.imul(Zt,Or)|0,Vt=Vt+Math.imul(Zt,Mr)|0,Dt=Dt+Math.imul(en,Ur)|0,Pt=Pt+Math.imul(en,Lr)|0,Pt=Pt+Math.imul(fn,Ur)|0,Vt=Vt+Math.imul(fn,Lr)|0,Dt=Dt+Math.imul(cn,Gr)|0,Pt=Pt+Math.imul(cn,Br)|0,Pt=Pt+Math.imul(Xt,Gr)|0,Vt=Vt+Math.imul(Xt,Br)|0;var Xr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,Dt=Math.imul(dn,Wn),Pt=Math.imul(dn,Gn),Pt=Pt+Math.imul(sn,Wn)|0,Vt=Math.imul(sn,Gn),Dt=Dt+Math.imul(gn,Jn)|0,Pt=Pt+Math.imul(gn,Vn)|0,Pt=Pt+Math.imul(Tn,Jn)|0,Vt=Vt+Math.imul(Tn,Vn)|0,Dt=Dt+Math.imul(Un,ur)|0,Pt=Pt+Math.imul(Un,_r)|0,Pt=Pt+Math.imul(_n,ur)|0,Vt=Vt+Math.imul(_n,_r)|0,Dt=Dt+Math.imul(In,Or)|0,Pt=Pt+Math.imul(In,Mr)|0,Pt=Pt+Math.imul(Cn,Or)|0,Vt=Vt+Math.imul(Cn,Mr)|0,Dt=Dt+Math.imul(an,Ur)|0,Pt=Pt+Math.imul(an,Lr)|0,Pt=Pt+Math.imul(Zt,Ur)|0,Vt=Vt+Math.imul(Zt,Lr)|0,Dt=Dt+Math.imul(en,Gr)|0,Pt=Pt+Math.imul(en,Br)|0,Pt=Pt+Math.imul(fn,Gr)|0,Vt=Vt+Math.imul(fn,Br)|0,Dt=Dt+Math.imul(cn,vn)|0,Pt=Pt+Math.imul(cn,Pn)|0,Pt=Pt+Math.imul(Xt,vn)|0,Vt=Vt+Math.imul(Xt,Pn)|0;var Jr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Dt=Math.imul(Sn,Wn),Pt=Math.imul(Sn,Gn),Pt=Pt+Math.imul(tn,Wn)|0,Vt=Math.imul(tn,Gn),Dt=Dt+Math.imul(dn,Jn)|0,Pt=Pt+Math.imul(dn,Vn)|0,Pt=Pt+Math.imul(sn,Jn)|0,Vt=Vt+Math.imul(sn,Vn)|0,Dt=Dt+Math.imul(gn,ur)|0,Pt=Pt+Math.imul(gn,_r)|0,Pt=Pt+Math.imul(Tn,ur)|0,Vt=Vt+Math.imul(Tn,_r)|0,Dt=Dt+Math.imul(Un,Or)|0,Pt=Pt+Math.imul(Un,Mr)|0,Pt=Pt+Math.imul(_n,Or)|0,Vt=Vt+Math.imul(_n,Mr)|0,Dt=Dt+Math.imul(In,Ur)|0,Pt=Pt+Math.imul(In,Lr)|0,Pt=Pt+Math.imul(Cn,Ur)|0,Vt=Vt+Math.imul(Cn,Lr)|0,Dt=Dt+Math.imul(an,Gr)|0,Pt=Pt+Math.imul(an,Br)|0,Pt=Pt+Math.imul(Zt,Gr)|0,Vt=Vt+Math.imul(Zt,Br)|0,Dt=Dt+Math.imul(en,vn)|0,Pt=Pt+Math.imul(en,Pn)|0,Pt=Pt+Math.imul(fn,vn)|0,Vt=Vt+Math.imul(fn,Pn)|0,Dt=Dt+Math.imul(cn,Jt)|0,Pt=Pt+Math.imul(cn,kn)|0,Pt=Pt+Math.imul(Xt,Jt)|0,Vt=Vt+Math.imul(Xt,kn)|0;var br=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(br>>>26)|0,br&=67108863,Dt=Math.imul(Kt,Wn),Pt=Math.imul(Kt,Gn),Pt=Pt+Math.imul(wn,Wn)|0,Vt=Math.imul(wn,Gn),Dt=Dt+Math.imul(Sn,Jn)|0,Pt=Pt+Math.imul(Sn,Vn)|0,Pt=Pt+Math.imul(tn,Jn)|0,Vt=Vt+Math.imul(tn,Vn)|0,Dt=Dt+Math.imul(dn,ur)|0,Pt=Pt+Math.imul(dn,_r)|0,Pt=Pt+Math.imul(sn,ur)|0,Vt=Vt+Math.imul(sn,_r)|0,Dt=Dt+Math.imul(gn,Or)|0,Pt=Pt+Math.imul(gn,Mr)|0,Pt=Pt+Math.imul(Tn,Or)|0,Vt=Vt+Math.imul(Tn,Mr)|0,Dt=Dt+Math.imul(Un,Ur)|0,Pt=Pt+Math.imul(Un,Lr)|0,Pt=Pt+Math.imul(_n,Ur)|0,Vt=Vt+Math.imul(_n,Lr)|0,Dt=Dt+Math.imul(In,Gr)|0,Pt=Pt+Math.imul(In,Br)|0,Pt=Pt+Math.imul(Cn,Gr)|0,Vt=Vt+Math.imul(Cn,Br)|0,Dt=Dt+Math.imul(an,vn)|0,Pt=Pt+Math.imul(an,Pn)|0,Pt=Pt+Math.imul(Zt,vn)|0,Vt=Vt+Math.imul(Zt,Pn)|0,Dt=Dt+Math.imul(en,Jt)|0,Pt=Pt+Math.imul(en,kn)|0,Pt=Pt+Math.imul(fn,Jt)|0,Vt=Vt+Math.imul(fn,kn)|0,Dt=Dt+Math.imul(cn,Dn)|0,Pt=Pt+Math.imul(cn,Yn)|0,Pt=Pt+Math.imul(Xt,Dn)|0,Vt=Vt+Math.imul(Xt,Yn)|0;var $r=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+($r>>>26)|0,$r&=67108863,Dt=Math.imul(jn,Wn),Pt=Math.imul(jn,Gn),Pt=Pt+Math.imul(Bn,Wn)|0,Vt=Math.imul(Bn,Gn),Dt=Dt+Math.imul(Kt,Jn)|0,Pt=Pt+Math.imul(Kt,Vn)|0,Pt=Pt+Math.imul(wn,Jn)|0,Vt=Vt+Math.imul(wn,Vn)|0,Dt=Dt+Math.imul(Sn,ur)|0,Pt=Pt+Math.imul(Sn,_r)|0,Pt=Pt+Math.imul(tn,ur)|0,Vt=Vt+Math.imul(tn,_r)|0,Dt=Dt+Math.imul(dn,Or)|0,Pt=Pt+Math.imul(dn,Mr)|0,Pt=Pt+Math.imul(sn,Or)|0,Vt=Vt+Math.imul(sn,Mr)|0,Dt=Dt+Math.imul(gn,Ur)|0,Pt=Pt+Math.imul(gn,Lr)|0,Pt=Pt+Math.imul(Tn,Ur)|0,Vt=Vt+Math.imul(Tn,Lr)|0,Dt=Dt+Math.imul(Un,Gr)|0,Pt=Pt+Math.imul(Un,Br)|0,Pt=Pt+Math.imul(_n,Gr)|0,Vt=Vt+Math.imul(_n,Br)|0,Dt=Dt+Math.imul(In,vn)|0,Pt=Pt+Math.imul(In,Pn)|0,Pt=Pt+Math.imul(Cn,vn)|0,Vt=Vt+Math.imul(Cn,Pn)|0,Dt=Dt+Math.imul(an,Jt)|0,Pt=Pt+Math.imul(an,kn)|0,Pt=Pt+Math.imul(Zt,Jt)|0,Vt=Vt+Math.imul(Zt,kn)|0,Dt=Dt+Math.imul(en,Dn)|0,Pt=Pt+Math.imul(en,Yn)|0,Pt=Pt+Math.imul(fn,Dn)|0,Vt=Vt+Math.imul(fn,Yn)|0,Dt=Dt+Math.imul(cn,or)|0,Pt=Pt+Math.imul(cn,ar)|0,Pt=Pt+Math.imul(Xt,or)|0,Vt=Vt+Math.imul(Xt,ar)|0;var Dr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Dt=Math.imul(jn,Jn),Pt=Math.imul(jn,Vn),Pt=Pt+Math.imul(Bn,Jn)|0,Vt=Math.imul(Bn,Vn),Dt=Dt+Math.imul(Kt,ur)|0,Pt=Pt+Math.imul(Kt,_r)|0,Pt=Pt+Math.imul(wn,ur)|0,Vt=Vt+Math.imul(wn,_r)|0,Dt=Dt+Math.imul(Sn,Or)|0,Pt=Pt+Math.imul(Sn,Mr)|0,Pt=Pt+Math.imul(tn,Or)|0,Vt=Vt+Math.imul(tn,Mr)|0,Dt=Dt+Math.imul(dn,Ur)|0,Pt=Pt+Math.imul(dn,Lr)|0,Pt=Pt+Math.imul(sn,Ur)|0,Vt=Vt+Math.imul(sn,Lr)|0,Dt=Dt+Math.imul(gn,Gr)|0,Pt=Pt+Math.imul(gn,Br)|0,Pt=Pt+Math.imul(Tn,Gr)|0,Vt=Vt+Math.imul(Tn,Br)|0,Dt=Dt+Math.imul(Un,vn)|0,Pt=Pt+Math.imul(Un,Pn)|0,Pt=Pt+Math.imul(_n,vn)|0,Vt=Vt+Math.imul(_n,Pn)|0,Dt=Dt+Math.imul(In,Jt)|0,Pt=Pt+Math.imul(In,kn)|0,Pt=Pt+Math.imul(Cn,Jt)|0,Vt=Vt+Math.imul(Cn,kn)|0,Dt=Dt+Math.imul(an,Dn)|0,Pt=Pt+Math.imul(an,Yn)|0,Pt=Pt+Math.imul(Zt,Dn)|0,Vt=Vt+Math.imul(Zt,Yn)|0,Dt=Dt+Math.imul(en,or)|0,Pt=Pt+Math.imul(en,ar)|0,Pt=Pt+Math.imul(fn,or)|0,Vt=Vt+Math.imul(fn,ar)|0;var Cr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Dt=Math.imul(jn,ur),Pt=Math.imul(jn,_r),Pt=Pt+Math.imul(Bn,ur)|0,Vt=Math.imul(Bn,_r),Dt=Dt+Math.imul(Kt,Or)|0,Pt=Pt+Math.imul(Kt,Mr)|0,Pt=Pt+Math.imul(wn,Or)|0,Vt=Vt+Math.imul(wn,Mr)|0,Dt=Dt+Math.imul(Sn,Ur)|0,Pt=Pt+Math.imul(Sn,Lr)|0,Pt=Pt+Math.imul(tn,Ur)|0,Vt=Vt+Math.imul(tn,Lr)|0,Dt=Dt+Math.imul(dn,Gr)|0,Pt=Pt+Math.imul(dn,Br)|0,Pt=Pt+Math.imul(sn,Gr)|0,Vt=Vt+Math.imul(sn,Br)|0,Dt=Dt+Math.imul(gn,vn)|0,Pt=Pt+Math.imul(gn,Pn)|0,Pt=Pt+Math.imul(Tn,vn)|0,Vt=Vt+Math.imul(Tn,Pn)|0,Dt=Dt+Math.imul(Un,Jt)|0,Pt=Pt+Math.imul(Un,kn)|0,Pt=Pt+Math.imul(_n,Jt)|0,Vt=Vt+Math.imul(_n,kn)|0,Dt=Dt+Math.imul(In,Dn)|0,Pt=Pt+Math.imul(In,Yn)|0,Pt=Pt+Math.imul(Cn,Dn)|0,Vt=Vt+Math.imul(Cn,Yn)|0,Dt=Dt+Math.imul(an,or)|0,Pt=Pt+Math.imul(an,ar)|0,Pt=Pt+Math.imul(Zt,or)|0,Vt=Vt+Math.imul(Zt,ar)|0;var Ar=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,Dt=Math.imul(jn,Or),Pt=Math.imul(jn,Mr),Pt=Pt+Math.imul(Bn,Or)|0,Vt=Math.imul(Bn,Mr),Dt=Dt+Math.imul(Kt,Ur)|0,Pt=Pt+Math.imul(Kt,Lr)|0,Pt=Pt+Math.imul(wn,Ur)|0,Vt=Vt+Math.imul(wn,Lr)|0,Dt=Dt+Math.imul(Sn,Gr)|0,Pt=Pt+Math.imul(Sn,Br)|0,Pt=Pt+Math.imul(tn,Gr)|0,Vt=Vt+Math.imul(tn,Br)|0,Dt=Dt+Math.imul(dn,vn)|0,Pt=Pt+Math.imul(dn,Pn)|0,Pt=Pt+Math.imul(sn,vn)|0,Vt=Vt+Math.imul(sn,Pn)|0,Dt=Dt+Math.imul(gn,Jt)|0,Pt=Pt+Math.imul(gn,kn)|0,Pt=Pt+Math.imul(Tn,Jt)|0,Vt=Vt+Math.imul(Tn,kn)|0,Dt=Dt+Math.imul(Un,Dn)|0,Pt=Pt+Math.imul(Un,Yn)|0,Pt=Pt+Math.imul(_n,Dn)|0,Vt=Vt+Math.imul(_n,Yn)|0,Dt=Dt+Math.imul(In,or)|0,Pt=Pt+Math.imul(In,ar)|0,Pt=Pt+Math.imul(Cn,or)|0,Vt=Vt+Math.imul(Cn,ar)|0;var Nr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Dt=Math.imul(jn,Ur),Pt=Math.imul(jn,Lr),Pt=Pt+Math.imul(Bn,Ur)|0,Vt=Math.imul(Bn,Lr),Dt=Dt+Math.imul(Kt,Gr)|0,Pt=Pt+Math.imul(Kt,Br)|0,Pt=Pt+Math.imul(wn,Gr)|0,Vt=Vt+Math.imul(wn,Br)|0,Dt=Dt+Math.imul(Sn,vn)|0,Pt=Pt+Math.imul(Sn,Pn)|0,Pt=Pt+Math.imul(tn,vn)|0,Vt=Vt+Math.imul(tn,Pn)|0,Dt=Dt+Math.imul(dn,Jt)|0,Pt=Pt+Math.imul(dn,kn)|0,Pt=Pt+Math.imul(sn,Jt)|0,Vt=Vt+Math.imul(sn,kn)|0,Dt=Dt+Math.imul(gn,Dn)|0,Pt=Pt+Math.imul(gn,Yn)|0,Pt=Pt+Math.imul(Tn,Dn)|0,Vt=Vt+Math.imul(Tn,Yn)|0,Dt=Dt+Math.imul(Un,or)|0,Pt=Pt+Math.imul(Un,ar)|0,Pt=Pt+Math.imul(_n,or)|0,Vt=Vt+Math.imul(_n,ar)|0;var Fr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Dt=Math.imul(jn,Gr),Pt=Math.imul(jn,Br),Pt=Pt+Math.imul(Bn,Gr)|0,Vt=Math.imul(Bn,Br),Dt=Dt+Math.imul(Kt,vn)|0,Pt=Pt+Math.imul(Kt,Pn)|0,Pt=Pt+Math.imul(wn,vn)|0,Vt=Vt+Math.imul(wn,Pn)|0,Dt=Dt+Math.imul(Sn,Jt)|0,Pt=Pt+Math.imul(Sn,kn)|0,Pt=Pt+Math.imul(tn,Jt)|0,Vt=Vt+Math.imul(tn,kn)|0,Dt=Dt+Math.imul(dn,Dn)|0,Pt=Pt+Math.imul(dn,Yn)|0,Pt=Pt+Math.imul(sn,Dn)|0,Vt=Vt+Math.imul(sn,Yn)|0,Dt=Dt+Math.imul(gn,or)|0,Pt=Pt+Math.imul(gn,ar)|0,Pt=Pt+Math.imul(Tn,or)|0,Vt=Vt+Math.imul(Tn,ar)|0;var Pr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Dt=Math.imul(jn,vn),Pt=Math.imul(jn,Pn),Pt=Pt+Math.imul(Bn,vn)|0,Vt=Math.imul(Bn,Pn),Dt=Dt+Math.imul(Kt,Jt)|0,Pt=Pt+Math.imul(Kt,kn)|0,Pt=Pt+Math.imul(wn,Jt)|0,Vt=Vt+Math.imul(wn,kn)|0,Dt=Dt+Math.imul(Sn,Dn)|0,Pt=Pt+Math.imul(Sn,Yn)|0,Pt=Pt+Math.imul(tn,Dn)|0,Vt=Vt+Math.imul(tn,Yn)|0,Dt=Dt+Math.imul(dn,or)|0,Pt=Pt+Math.imul(dn,ar)|0,Pt=Pt+Math.imul(sn,or)|0,Vt=Vt+Math.imul(sn,ar)|0;var _i=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(_i>>>26)|0,_i&=67108863,Dt=Math.imul(jn,Jt),Pt=Math.imul(jn,kn),Pt=Pt+Math.imul(Bn,Jt)|0,Vt=Math.imul(Bn,kn),Dt=Dt+Math.imul(Kt,Dn)|0,Pt=Pt+Math.imul(Kt,Yn)|0,Pt=Pt+Math.imul(wn,Dn)|0,Vt=Vt+Math.imul(wn,Yn)|0,Dt=Dt+Math.imul(Sn,or)|0,Pt=Pt+Math.imul(Sn,ar)|0,Pt=Pt+Math.imul(tn,or)|0,Vt=Vt+Math.imul(tn,ar)|0;var nr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(nr>>>26)|0,nr&=67108863,Dt=Math.imul(jn,Dn),Pt=Math.imul(jn,Yn),Pt=Pt+Math.imul(Bn,Dn)|0,Vt=Math.imul(Bn,Yn),Dt=Dt+Math.imul(Kt,or)|0,Pt=Pt+Math.imul(Kt,ar)|0,Pt=Pt+Math.imul(wn,or)|0,Vt=Vt+Math.imul(wn,ar)|0;var xr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(xr>>>26)|0,xr&=67108863,Dt=Math.imul(jn,or),Pt=Math.imul(jn,ar),Pt=Pt+Math.imul(Bn,or)|0,Vt=Math.imul(Bn,ar);var cr=(Mt+Dt|0)+((Pt&8191)<<13)|0;return Mt=(Vt+(Pt>>>13)|0)+(cr>>>26)|0,cr&=67108863,Bt[0]=Vr,Bt[1]=wr,Bt[2]=jr,Bt[3]=Hr,Bt[4]=no,Bt[5]=Xr,Bt[6]=Jr,Bt[7]=br,Bt[8]=$r,Bt[9]=Dr,Bt[10]=Cr,Bt[11]=Ar,Bt[12]=Nr,Bt[13]=Fr,Bt[14]=Pr,Bt[15]=_i,Bt[16]=nr,Bt[17]=xr,Bt[18]=cr,Mt!==0&&(Bt[19]=Mt,Ct.length++),Ct};Math.imul||(wt=yt);function vt(jt,kt,Tt){Tt.negative=kt.negative^jt.negative,Tt.length=jt.length+kt.length;for(var Ct=0,Ut=0,Nt=0;Nt>>26)|0,Ut+=Bt>>>26,Bt&=67108863}Tt.words[Nt]=Mt,Ct=Bt,Bt=Ut}return Ct!==0?Tt.words[Nt]=Ct:Tt.length--,Tt._strip()}function xt(jt,kt,Tt){return vt(jt,kt,Tt)}ot.prototype.mulTo=function(kt,Tt){var Ct,Ut=this.length+kt.length;return this.length===10&&kt.length===10?Ct=wt(this,kt,Tt):Ut<63?Ct=yt(this,kt,Tt):Ut<1024?Ct=vt(this,kt,Tt):Ct=xt(this,kt,Tt),Ct},ot.prototype.mul=function(kt){var Tt=new ot(null);return Tt.words=new Array(this.length+kt.length),this.mulTo(kt,Tt)},ot.prototype.mulf=function(kt){var Tt=new ot(null);return Tt.words=new Array(this.length+kt.length),xt(this,kt,Tt)},ot.prototype.imul=function(kt){return this.clone().mulTo(kt,this)},ot.prototype.imuln=function(kt){var Tt=kt<0;Tt&&(kt=-kt),it(typeof kt=="number"),it(kt<67108864);for(var Ct=0,Ut=0;Ut>=26,Ct+=Nt/67108864|0,Ct+=Bt>>>26,this.words[Ut]=Bt&67108863}return Ct!==0&&(this.words[Ut]=Ct,this.length++),Tt?this.ineg():this},ot.prototype.muln=function(kt){return this.clone().imuln(kt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(kt){var Tt=bt(kt);if(Tt.length===0)return new ot(1);for(var Ct=this,Ut=0;Ut=0);var Tt=kt%26,Ct=(kt-Tt)/26,Ut=67108863>>>26-Tt<<26-Tt,Nt;if(Tt!==0){var Bt=0;for(Nt=0;Nt>>26-Tt}Bt&&(this.words[Nt]=Bt,this.length++)}if(Ct!==0){for(Nt=this.length-1;Nt>=0;Nt--)this.words[Nt+Ct]=this.words[Nt];for(Nt=0;Nt=0);var Ut;Tt?Ut=(Tt-Tt%26)/26:Ut=0;var Nt=kt%26,Bt=Math.min((kt-Nt)/26,this.length),Mt=67108863^67108863>>>Nt<Bt)for(this.length-=Bt,Pt=0;Pt=0&&(Vt!==0||Pt>=Ut);Pt--){var nn=this.words[Pt]|0;this.words[Pt]=Vt<<26-Nt|nn>>>Nt,Vt=nn&Mt}return Dt&&Vt!==0&&(Dt.words[Dt.length++]=Vt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ot.prototype.ishrn=function(kt,Tt,Ct){return it(this.negative===0),this.iushrn(kt,Tt,Ct)},ot.prototype.shln=function(kt){return this.clone().ishln(kt)},ot.prototype.ushln=function(kt){return this.clone().iushln(kt)},ot.prototype.shrn=function(kt){return this.clone().ishrn(kt)},ot.prototype.ushrn=function(kt){return this.clone().iushrn(kt)},ot.prototype.testn=function(kt){it(typeof kt=="number"&&kt>=0);var Tt=kt%26,Ct=(kt-Tt)/26,Ut=1<=0);var Tt=kt%26,Ct=(kt-Tt)/26;if(it(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ct)return this;if(Tt!==0&&Ct++,this.length=Math.min(Ct,this.length),Tt!==0){var Ut=67108863^67108863>>>Tt<=67108864;Tt++)this.words[Tt]-=67108864,Tt===this.length-1?this.words[Tt+1]=1:this.words[Tt+1]++;return this.length=Math.max(this.length,Tt+1),this},ot.prototype.isubn=function(kt){if(it(typeof kt=="number"),it(kt<67108864),kt<0)return this.iaddn(-kt);if(this.negative!==0)return this.negative=0,this.iaddn(kt),this.negative=1,this;if(this.words[0]-=kt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Tt=0;Tt>26)-(Dt/67108864|0),this.words[Nt+Ct]=Bt&67108863}for(;Nt>26,this.words[Nt+Ct]=Bt&67108863;if(Mt===0)return this._strip();for(it(Mt===-1),Mt=0,Nt=0;Nt>26,this.words[Nt]=Bt&67108863;return this.negative=1,this._strip()},ot.prototype._wordDiv=function(kt,Tt){var Ct=this.length-kt.length,Ut=this.clone(),Nt=kt,Bt=Nt.words[Nt.length-1]|0,Mt=this._countBits(Bt);Ct=26-Mt,Ct!==0&&(Nt=Nt.ushln(Ct),Ut.iushln(Ct),Bt=Nt.words[Nt.length-1]|0);var Dt=Ut.length-Nt.length,Pt;if(Tt!=="mod"){Pt=new ot(null),Pt.length=Dt+1,Pt.words=new Array(Pt.length);for(var Vt=0;Vt=0;cn--){var Xt=(Ut.words[Nt.length+cn]|0)*67108864+(Ut.words[Nt.length+cn-1]|0);for(Xt=Math.min(Xt/Bt|0,67108863),Ut._ishlnsubmul(Nt,Xt,cn);Ut.negative!==0;)Xt--,Ut.negative=0,Ut._ishlnsubmul(Nt,1,cn),Ut.isZero()||(Ut.negative^=1);Pt&&(Pt.words[cn]=Xt)}return Pt&&Pt._strip(),Ut._strip(),Tt!=="div"&&Ct!==0&&Ut.iushrn(Ct),{div:Pt||null,mod:Ut}},ot.prototype.divmod=function(kt,Tt,Ct){if(it(!kt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Ut,Nt,Bt;return this.negative!==0&&kt.negative===0?(Bt=this.neg().divmod(kt,Tt),Tt!=="mod"&&(Ut=Bt.div.neg()),Tt!=="div"&&(Nt=Bt.mod.neg(),Ct&&Nt.negative!==0&&Nt.iadd(kt)),{div:Ut,mod:Nt}):this.negative===0&&kt.negative!==0?(Bt=this.divmod(kt.neg(),Tt),Tt!=="mod"&&(Ut=Bt.div.neg()),{div:Ut,mod:Bt.mod}):this.negative&kt.negative?(Bt=this.neg().divmod(kt.neg(),Tt),Tt!=="div"&&(Nt=Bt.mod.neg(),Ct&&Nt.negative!==0&&Nt.isub(kt)),{div:Bt.div,mod:Nt}):kt.length>this.length||this.cmp(kt)<0?{div:new ot(0),mod:this}:kt.length===1?Tt==="div"?{div:this.divn(kt.words[0]),mod:null}:Tt==="mod"?{div:null,mod:new ot(this.modrn(kt.words[0]))}:{div:this.divn(kt.words[0]),mod:new ot(this.modrn(kt.words[0]))}:this._wordDiv(kt,Tt)},ot.prototype.div=function(kt){return this.divmod(kt,"div",!1).div},ot.prototype.mod=function(kt){return this.divmod(kt,"mod",!1).mod},ot.prototype.umod=function(kt){return this.divmod(kt,"mod",!0).mod},ot.prototype.divRound=function(kt){var Tt=this.divmod(kt);if(Tt.mod.isZero())return Tt.div;var Ct=Tt.div.negative!==0?Tt.mod.isub(kt):Tt.mod,Ut=kt.ushrn(1),Nt=kt.andln(1),Bt=Ct.cmp(Ut);return Bt<0||Nt===1&&Bt===0?Tt.div:Tt.div.negative!==0?Tt.div.isubn(1):Tt.div.iaddn(1)},ot.prototype.modrn=function(kt){var Tt=kt<0;Tt&&(kt=-kt),it(kt<=67108863);for(var Ct=(1<<26)%kt,Ut=0,Nt=this.length-1;Nt>=0;Nt--)Ut=(Ct*Ut+(this.words[Nt]|0))%kt;return Tt?-Ut:Ut},ot.prototype.modn=function(kt){return this.modrn(kt)},ot.prototype.idivn=function(kt){var Tt=kt<0;Tt&&(kt=-kt),it(kt<=67108863);for(var Ct=0,Ut=this.length-1;Ut>=0;Ut--){var Nt=(this.words[Ut]|0)+Ct*67108864;this.words[Ut]=Nt/kt|0,Ct=Nt%kt}return this._strip(),Tt?this.ineg():this},ot.prototype.divn=function(kt){return this.clone().idivn(kt)},ot.prototype.egcd=function(kt){it(kt.negative===0),it(!kt.isZero());var Tt=this,Ct=kt.clone();Tt.negative!==0?Tt=Tt.umod(kt):Tt=Tt.clone();for(var Ut=new ot(1),Nt=new ot(0),Bt=new ot(0),Mt=new ot(1),Dt=0;Tt.isEven()&&Ct.isEven();)Tt.iushrn(1),Ct.iushrn(1),++Dt;for(var Pt=Ct.clone(),Vt=Tt.clone();!Tt.isZero();){for(var nn=0,cn=1;!(Tt.words[0]&cn)&&nn<26;++nn,cn<<=1);if(nn>0)for(Tt.iushrn(nn);nn-- >0;)(Ut.isOdd()||Nt.isOdd())&&(Ut.iadd(Pt),Nt.isub(Vt)),Ut.iushrn(1),Nt.iushrn(1);for(var Xt=0,un=1;!(Ct.words[0]&un)&&Xt<26;++Xt,un<<=1);if(Xt>0)for(Ct.iushrn(Xt);Xt-- >0;)(Bt.isOdd()||Mt.isOdd())&&(Bt.iadd(Pt),Mt.isub(Vt)),Bt.iushrn(1),Mt.iushrn(1);Tt.cmp(Ct)>=0?(Tt.isub(Ct),Ut.isub(Bt),Nt.isub(Mt)):(Ct.isub(Tt),Bt.isub(Ut),Mt.isub(Nt))}return{a:Bt,b:Mt,gcd:Ct.iushln(Dt)}},ot.prototype._invmp=function(kt){it(kt.negative===0),it(!kt.isZero());var Tt=this,Ct=kt.clone();Tt.negative!==0?Tt=Tt.umod(kt):Tt=Tt.clone();for(var Ut=new ot(1),Nt=new ot(0),Bt=Ct.clone();Tt.cmpn(1)>0&&Ct.cmpn(1)>0;){for(var Mt=0,Dt=1;!(Tt.words[0]&Dt)&&Mt<26;++Mt,Dt<<=1);if(Mt>0)for(Tt.iushrn(Mt);Mt-- >0;)Ut.isOdd()&&Ut.iadd(Bt),Ut.iushrn(1);for(var Pt=0,Vt=1;!(Ct.words[0]&Vt)&&Pt<26;++Pt,Vt<<=1);if(Pt>0)for(Ct.iushrn(Pt);Pt-- >0;)Nt.isOdd()&&Nt.iadd(Bt),Nt.iushrn(1);Tt.cmp(Ct)>=0?(Tt.isub(Ct),Ut.isub(Nt)):(Ct.isub(Tt),Nt.isub(Ut))}var nn;return Tt.cmpn(1)===0?nn=Ut:nn=Nt,nn.cmpn(0)<0&&nn.iadd(kt),nn},ot.prototype.gcd=function(kt){if(this.isZero())return kt.abs();if(kt.isZero())return this.abs();var Tt=this.clone(),Ct=kt.clone();Tt.negative=0,Ct.negative=0;for(var Ut=0;Tt.isEven()&&Ct.isEven();Ut++)Tt.iushrn(1),Ct.iushrn(1);do{for(;Tt.isEven();)Tt.iushrn(1);for(;Ct.isEven();)Ct.iushrn(1);var Nt=Tt.cmp(Ct);if(Nt<0){var Bt=Tt;Tt=Ct,Ct=Bt}else if(Nt===0||Ct.cmpn(1)===0)break;Tt.isub(Ct)}while(!0);return Ct.iushln(Ut)},ot.prototype.invm=function(kt){return this.egcd(kt).a.umod(kt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(kt){return this.words[0]&kt},ot.prototype.bincn=function(kt){it(typeof kt=="number");var Tt=kt%26,Ct=(kt-Tt)/26,Ut=1<>>26,Mt&=67108863,this.words[Bt]=Mt}return Nt!==0&&(this.words[Bt]=Nt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(kt){var Tt=kt<0;if(this.negative!==0&&!Tt)return-1;if(this.negative===0&&Tt)return 1;this._strip();var Ct;if(this.length>1)Ct=1;else{Tt&&(kt=-kt),it(kt<=67108863,"Number is too big");var Ut=this.words[0]|0;Ct=Ut===kt?0:Utkt.length)return 1;if(this.length=0;Ct--){var Ut=this.words[Ct]|0,Nt=kt.words[Ct]|0;if(Ut!==Nt){UtNt&&(Tt=1);break}}return Tt},ot.prototype.gtn=function(kt){return this.cmpn(kt)===1},ot.prototype.gt=function(kt){return this.cmp(kt)===1},ot.prototype.gten=function(kt){return this.cmpn(kt)>=0},ot.prototype.gte=function(kt){return this.cmp(kt)>=0},ot.prototype.ltn=function(kt){return this.cmpn(kt)===-1},ot.prototype.lt=function(kt){return this.cmp(kt)===-1},ot.prototype.lten=function(kt){return this.cmpn(kt)<=0},ot.prototype.lte=function(kt){return this.cmp(kt)<=0},ot.prototype.eqn=function(kt){return this.cmpn(kt)===0},ot.prototype.eq=function(kt){return this.cmp(kt)===0},ot.red=function(kt){return new zt(kt)},ot.prototype.toRed=function(kt){return it(!this.red,"Already a number in reduction context"),it(this.negative===0,"red works only with positives"),kt.convertTo(this)._forceRed(kt)},ot.prototype.fromRed=function(){return it(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(kt){return this.red=kt,this},ot.prototype.forceRed=function(kt){return it(!this.red,"Already a number in reduction context"),this._forceRed(kt)},ot.prototype.redAdd=function(kt){return it(this.red,"redAdd works only with red numbers"),this.red.add(this,kt)},ot.prototype.redIAdd=function(kt){return it(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,kt)},ot.prototype.redSub=function(kt){return it(this.red,"redSub works only with red numbers"),this.red.sub(this,kt)},ot.prototype.redISub=function(kt){return it(this.red,"redISub works only with red numbers"),this.red.isub(this,kt)},ot.prototype.redShl=function(kt){return it(this.red,"redShl works only with red numbers"),this.red.shl(this,kt)},ot.prototype.redMul=function(kt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,kt),this.red.mul(this,kt)},ot.prototype.redIMul=function(kt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,kt),this.red.imul(this,kt)},ot.prototype.redSqr=function(){return it(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return it(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return it(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return it(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return it(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(kt){return it(this.red&&!kt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,kt)};var St={k256:null,p224:null,p192:null,p25519:null};function Et(jt,kt){this.name=jt,this.p=new ot(kt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Et.prototype._tmp=function(){var kt=new ot(null);return kt.words=new Array(Math.ceil(this.n/13)),kt},Et.prototype.ireduce=function(kt){var Tt=kt,Ct;do this.split(Tt,this.tmp),Tt=this.imulK(Tt),Tt=Tt.iadd(this.tmp),Ct=Tt.bitLength();while(Ct>this.n);var Ut=Ct0?Tt.isub(this.p):Tt.strip!==void 0?Tt.strip():Tt._strip(),Tt},Et.prototype.split=function(kt,Tt){kt.iushrn(this.n,0,Tt)},Et.prototype.imulK=function(kt){return kt.imul(this.k)};function $t(){Et.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}rt($t,Et),$t.prototype.split=function(kt,Tt){for(var Ct=4194303,Ut=Math.min(kt.length,9),Nt=0;Nt>>22,Bt=Mt}Bt>>>=22,kt.words[Nt-10]=Bt,Bt===0&&kt.length>10?kt.length-=10:kt.length-=9},$t.prototype.imulK=function(kt){kt.words[kt.length]=0,kt.words[kt.length+1]=0,kt.length+=2;for(var Tt=0,Ct=0;Ct>>=26,kt.words[Ct]=Nt,Tt=Ut}return Tt!==0&&(kt.words[kt.length++]=Tt),kt},ot._prime=function(kt){if(St[kt])return St[kt];var Tt;if(kt==="k256")Tt=new $t;else if(kt==="p224")Tt=new It;else if(kt==="p192")Tt=new Ft;else if(kt==="p25519")Tt=new Ht;else throw new Error("Unknown prime "+kt);return St[kt]=Tt,Tt};function zt(jt){if(typeof jt=="string"){var kt=ot._prime(jt);this.m=kt.p,this.prime=kt}else it(jt.gtn(1),"modulus must be greater than 1"),this.m=jt,this.prime=null}zt.prototype._verify1=function(kt){it(kt.negative===0,"red works only with positives"),it(kt.red,"red works only with red numbers")},zt.prototype._verify2=function(kt,Tt){it((kt.negative|Tt.negative)===0,"red works only with positives"),it(kt.red&&kt.red===Tt.red,"red works only with red numbers")},zt.prototype.imod=function(kt){return this.prime?this.prime.ireduce(kt)._forceRed(this):(ut(kt,kt.umod(this.m)._forceRed(this)),kt)},zt.prototype.neg=function(kt){return kt.isZero()?kt.clone():this.m.sub(kt)._forceRed(this)},zt.prototype.add=function(kt,Tt){this._verify2(kt,Tt);var Ct=kt.add(Tt);return Ct.cmp(this.m)>=0&&Ct.isub(this.m),Ct._forceRed(this)},zt.prototype.iadd=function(kt,Tt){this._verify2(kt,Tt);var Ct=kt.iadd(Tt);return Ct.cmp(this.m)>=0&&Ct.isub(this.m),Ct},zt.prototype.sub=function(kt,Tt){this._verify2(kt,Tt);var Ct=kt.sub(Tt);return Ct.cmpn(0)<0&&Ct.iadd(this.m),Ct._forceRed(this)},zt.prototype.isub=function(kt,Tt){this._verify2(kt,Tt);var Ct=kt.isub(Tt);return Ct.cmpn(0)<0&&Ct.iadd(this.m),Ct},zt.prototype.shl=function(kt,Tt){return this._verify1(kt),this.imod(kt.ushln(Tt))},zt.prototype.imul=function(kt,Tt){return this._verify2(kt,Tt),this.imod(kt.imul(Tt))},zt.prototype.mul=function(kt,Tt){return this._verify2(kt,Tt),this.imod(kt.mul(Tt))},zt.prototype.isqr=function(kt){return this.imul(kt,kt.clone())},zt.prototype.sqr=function(kt){return this.mul(kt,kt)},zt.prototype.sqrt=function(kt){if(kt.isZero())return kt.clone();var Tt=this.m.andln(3);if(it(Tt%2===1),Tt===3){var Ct=this.m.add(new ot(1)).iushrn(2);return this.pow(kt,Ct)}for(var Ut=this.m.subn(1),Nt=0;!Ut.isZero()&&Ut.andln(1)===0;)Nt++,Ut.iushrn(1);it(!Ut.isZero());var Bt=new ot(1).toRed(this),Mt=Bt.redNeg(),Dt=this.m.subn(1).iushrn(1),Pt=this.m.bitLength();for(Pt=new ot(2*Pt*Pt).toRed(this);this.pow(Pt,Dt).cmp(Mt)!==0;)Pt.redIAdd(Mt);for(var Vt=this.pow(Pt,Ut),nn=this.pow(kt,Ut.addn(1).iushrn(1)),cn=this.pow(kt,Ut),Xt=Nt;cn.cmp(Bt)!==0;){for(var un=cn,en=0;un.cmp(Bt)!==0;en++)un=un.redSqr();it(en=0;Nt--){for(var Vt=Tt.words[Nt],nn=Pt-1;nn>=0;nn--){var cn=Vt>>nn&1;if(Bt!==Ut[0]&&(Bt=this.sqr(Bt)),cn===0&&Mt===0){Dt=0;continue}Mt<<=1,Mt|=cn,Dt++,!(Dt!==Ct&&(Nt!==0||nn!==0))&&(Bt=this.mul(Bt,Ut[Mt]),Dt=0,Mt=0)}Pt=26}return Bt},zt.prototype.convertTo=function(kt){var Tt=kt.umod(this.m);return Tt===kt?Tt.clone():Tt},zt.prototype.convertFrom=function(kt){var Tt=kt.clone();return Tt.red=null,Tt},ot.mont=function(kt){return new Ot(kt)};function Ot(jt){zt.call(this,jt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}rt(Ot,zt),Ot.prototype.convertTo=function(kt){return this.imod(kt.ushln(this.shift))},Ot.prototype.convertFrom=function(kt){var Tt=this.imod(kt.mul(this.rinv));return Tt.red=null,Tt},Ot.prototype.imul=function(kt,Tt){if(kt.isZero()||Tt.isZero())return kt.words[0]=0,kt.length=1,kt;var Ct=kt.imul(Tt),Ut=Ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Nt=Ct.isub(Ut).iushrn(this.shift),Bt=Nt;return Nt.cmp(this.m)>=0?Bt=Nt.isub(this.m):Nt.cmpn(0)<0&&(Bt=Nt.iadd(this.m)),Bt._forceRed(this)},Ot.prototype.mul=function(kt,Tt){if(kt.isZero()||Tt.isZero())return new ot(0)._forceRed(this);var Ct=kt.mul(Tt),Ut=Ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Nt=Ct.isub(Ut).iushrn(this.shift),Bt=Nt;return Nt.cmp(this.m)>=0?Bt=Nt.isub(this.m):Nt.cmpn(0)<0&&(Bt=Nt.iadd(this.m)),Bt._forceRed(this)},Ot.prototype.invm=function(kt){var Tt=this.imod(kt._invmp(this.m).mul(this.r2));return Tt._forceRed(this)}})(tt,commonjsGlobal)})(bn$1);var bnExports$1=bn$1.exports,BN$c=bnExports$1,randomBytes$1=browserExports;function blind(tt){var et=getr(tt),nt=et.toRed(BN$c.mont(tt.modulus)).redPow(new BN$c(tt.publicExponent)).fromRed();return{blinder:nt,unblinder:et.invm(tt.modulus)}}function getr(tt){var et=tt.modulus.byteLength(),nt;do nt=new BN$c(randomBytes$1(et));while(nt.cmp(tt.modulus)>=0||!nt.umod(tt.prime1)||!nt.umod(tt.prime2));return nt}function crt$2(tt,et){var nt=blind(et),it=et.modulus.byteLength(),rt=new BN$c(tt).mul(nt.blinder).umod(et.modulus),ot=rt.toRed(BN$c.mont(et.prime1)),at=rt.toRed(BN$c.mont(et.prime2)),st=et.coefficient,lt=et.prime1,ct=et.prime2,ut=ot.redPow(et.exponent1).fromRed(),ht=at.redPow(et.exponent2).fromRed(),dt=ut.isub(ht).imul(st).umod(lt).imul(ct);return ht.iadd(dt).imul(nt.unblinder).umod(et.modulus).toArrayLike(Buffer,"be",it)}crt$2.getr=getr;var browserifyRsa=crt$2,elliptic$2={};const name$1="elliptic",version$2="6.5.4",description="EC cryptography",main$1="lib/elliptic.js",files=["lib"],scripts={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository={type:"git",url:"git@github.com:indutny/elliptic"},keywords=["EC","Elliptic","curve","Cryptography"],author="Fedor Indutny ",license="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage="https://github.com/indutny/elliptic",devDependencies={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0={name:name$1,version:version$2,description,main:main$1,files,scripts,repository,keywords,author,license,bugs,homepage,devDependencies,dependencies};var utils$o={},utils$n={};(function(tt){var et=tt;function nt(ot,at){if(Array.isArray(ot))return ot.slice();if(!ot)return[];var st=[];if(typeof ot!="string"){for(var lt=0;lt>8,ht=ct&255;ut?st.push(ut,ht):st.push(ht)}return st}et.toArray=nt;function it(ot){return ot.length===1?"0"+ot:ot}et.zero2=it;function rt(ot){for(var at="",st=0;st(mt>>1)-1?yt=(mt>>1)-wt:yt=wt,gt.isubn(yt)):yt=0,pt[bt]=yt,gt.iushrn(1)}return pt}et.getNAF=ot;function at(ut,ht){var dt=[[],[]];ut=ut.clone(),ht=ht.clone();for(var pt=0,mt=0,gt;ut.cmpn(-pt)>0||ht.cmpn(-mt)>0;){var bt=ut.andln(3)+pt&3,yt=ht.andln(3)+mt&3;bt===3&&(bt=-1),yt===3&&(yt=-1);var wt;bt&1?(gt=ut.andln(7)+pt&7,(gt===3||gt===5)&&yt===2?wt=-bt:wt=bt):wt=0,dt[0].push(wt);var vt;yt&1?(gt=ht.andln(7)+mt&7,(gt===3||gt===5)&&bt===2?vt=-yt:vt=yt):vt=0,dt[1].push(vt),2*pt===wt+1&&(pt=1-pt),2*mt===vt+1&&(mt=1-mt),ut.iushrn(1),ht.iushrn(1)}return dt}et.getJSF=at;function st(ut,ht,dt){var pt="_"+ht;ut.prototype[ht]=function(){return this[pt]!==void 0?this[pt]:this[pt]=dt.call(this)}}et.cachedProperty=st;function lt(ut){return typeof ut=="string"?et.toArray(ut,"hex"):ut}et.parseBytes=lt;function ct(ut){return new nt(ut,"hex","le")}et.intFromLE=ct})(utils$o);var curve={},BN$b=bnExports$2,utils$m=utils$o,getNAF=utils$m.getNAF,getJSF=utils$m.getJSF,assert$j=utils$m.assert;function BaseCurve(tt,et){this.type=tt,this.p=new BN$b(et.p,16),this.red=et.prime?BN$b.red(et.prime):BN$b.mont(this.p),this.zero=new BN$b(0).toRed(this.red),this.one=new BN$b(1).toRed(this.red),this.two=new BN$b(2).toRed(this.red),this.n=et.n&&new BN$b(et.n,16),this.g=et.g&&this.pointFromJSON(et.g,et.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var nt=this.n&&this.p.div(this.n);!nt||nt.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$3=BaseCurve;BaseCurve.prototype.point=function(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function(et,nt){assert$j(et.precomputed);var it=et._getDoubles(),rt=getNAF(nt,1,this._bitLength),ot=(1<=st;ct--)lt=(lt<<1)+rt[ct];at.push(lt)}for(var ut=this.jpoint(null,null,null),ht=this.jpoint(null,null,null),dt=ot;dt>0;dt--){for(st=0;st=0;lt--){for(var ct=0;lt>=0&&at[lt]===0;lt--)ct++;if(lt>=0&&ct++,st=st.dblp(ct),lt<0)break;var ut=at[lt];assert$j(ut!==0),et.type==="affine"?ut>0?st=st.mixedAdd(ot[ut-1>>1]):st=st.mixedAdd(ot[-ut-1>>1].neg()):ut>0?st=st.add(ot[ut-1>>1]):st=st.add(ot[-ut-1>>1].neg())}return et.type==="affine"?st.toP():st};BaseCurve.prototype._wnafMulAdd=function(et,nt,it,rt,ot){var at=this._wnafT1,st=this._wnafT2,lt=this._wnafT3,ct=0,ut,ht,dt;for(ut=0;ut=1;ut-=2){var mt=ut-1,gt=ut;if(at[mt]!==1||at[gt]!==1){lt[mt]=getNAF(it[mt],at[mt],this._bitLength),lt[gt]=getNAF(it[gt],at[gt],this._bitLength),ct=Math.max(lt[mt].length,ct),ct=Math.max(lt[gt].length,ct);continue}var bt=[nt[mt],null,null,nt[gt]];nt[mt].y.cmp(nt[gt].y)===0?(bt[1]=nt[mt].add(nt[gt]),bt[2]=nt[mt].toJ().mixedAdd(nt[gt].neg())):nt[mt].y.cmp(nt[gt].y.redNeg())===0?(bt[1]=nt[mt].toJ().mixedAdd(nt[gt]),bt[2]=nt[mt].add(nt[gt].neg())):(bt[1]=nt[mt].toJ().mixedAdd(nt[gt]),bt[2]=nt[mt].toJ().mixedAdd(nt[gt].neg()));var yt=[-3,-1,-5,-7,0,7,5,1,3],wt=getJSF(it[mt],it[gt]);for(ct=Math.max(wt[0].length,ct),lt[mt]=new Array(ct),lt[gt]=new Array(ct),ht=0;ht=0;ut--){for(var $t=0;ut>=0;){var It=!0;for(ht=0;ht=0&&$t++,St=St.dblp($t),ut<0)break;for(ht=0;ht0?dt=st[ht][Ft-1>>1]:Ft<0&&(dt=st[ht][-Ft-1>>1].neg()),dt.type==="affine"?St=St.mixedAdd(dt):St=St.add(dt))}}for(ut=0;ut=Math.ceil((et.bitLength()+1)/nt.step):!1};BasePoint.prototype._getDoubles=function(et,nt){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var it=[this],rt=this,ot=0;ot=0&&(pt=ct,mt=ut),ht.negative&&(ht=ht.neg(),dt=dt.neg()),pt.negative&&(pt=pt.neg(),mt=mt.neg()),[{a:ht,b:dt},{a:pt,b:mt}]};ShortCurve.prototype._endoSplit=function(et){var nt=this.endo.basis,it=nt[0],rt=nt[1],ot=rt.b.mul(et).divRound(this.n),at=it.b.neg().mul(et).divRound(this.n),st=ot.mul(it.a),lt=at.mul(rt.a),ct=ot.mul(it.b),ut=at.mul(rt.b),ht=et.sub(st).sub(lt),dt=ct.add(ut).neg();return{k1:ht,k2:dt}};ShortCurve.prototype.pointFromX=function(et,nt){et=new BN$a(et,16),et.red||(et=et.toRed(this.red));var it=et.redSqr().redMul(et).redIAdd(et.redMul(this.a)).redIAdd(this.b),rt=it.redSqrt();if(rt.redSqr().redSub(it).cmp(this.zero)!==0)throw new Error("invalid point");var ot=rt.fromRed().isOdd();return(nt&&!ot||!nt&&ot)&&(rt=rt.redNeg()),this.point(et,rt)};ShortCurve.prototype.validate=function(et){if(et.inf)return!0;var nt=et.x,it=et.y,rt=this.a.redMul(nt),ot=nt.redSqr().redMul(nt).redIAdd(rt).redIAdd(this.b);return it.redSqr().redISub(ot).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function(et,nt,it){for(var rt=this._endoWnafT1,ot=this._endoWnafT2,at=0;at":""};Point$2.prototype.isInfinity=function(){return this.inf};Point$2.prototype.add=function(et){if(this.inf)return et;if(et.inf)return this;if(this.eq(et))return this.dbl();if(this.neg().eq(et))return this.curve.point(null,null);if(this.x.cmp(et.x)===0)return this.curve.point(null,null);var nt=this.y.redSub(et.y);nt.cmpn(0)!==0&&(nt=nt.redMul(this.x.redSub(et.x).redInvm()));var it=nt.redSqr().redISub(this.x).redISub(et.x),rt=nt.redMul(this.x.redSub(it)).redISub(this.y);return this.curve.point(it,rt)};Point$2.prototype.dbl=function(){if(this.inf)return this;var et=this.y.redAdd(this.y);if(et.cmpn(0)===0)return this.curve.point(null,null);var nt=this.curve.a,it=this.x.redSqr(),rt=et.redInvm(),ot=it.redAdd(it).redIAdd(it).redIAdd(nt).redMul(rt),at=ot.redSqr().redISub(this.x.redAdd(this.x)),st=ot.redMul(this.x.redSub(at)).redISub(this.y);return this.curve.point(at,st)};Point$2.prototype.getX=function(){return this.x.fromRed()};Point$2.prototype.getY=function(){return this.y.fromRed()};Point$2.prototype.mul=function(et){return et=new BN$a(et,16),this.isInfinity()?this:this._hasDoubles(et)?this.curve._fixedNafMul(this,et):this.curve.endo?this.curve._endoWnafMulAdd([this],[et]):this.curve._wnafMul(this,et)};Point$2.prototype.mulAdd=function(et,nt,it){var rt=[this,nt],ot=[et,it];return this.curve.endo?this.curve._endoWnafMulAdd(rt,ot):this.curve._wnafMulAdd(1,rt,ot,2)};Point$2.prototype.jmulAdd=function(et,nt,it){var rt=[this,nt],ot=[et,it];return this.curve.endo?this.curve._endoWnafMulAdd(rt,ot,!0):this.curve._wnafMulAdd(1,rt,ot,2,!0)};Point$2.prototype.eq=function(et){return this===et||this.inf===et.inf&&(this.inf||this.x.cmp(et.x)===0&&this.y.cmp(et.y)===0)};Point$2.prototype.neg=function(et){if(this.inf)return this;var nt=this.curve.point(this.x,this.y.redNeg());if(et&&this.precomputed){var it=this.precomputed,rt=function(ot){return ot.neg()};nt.precomputed={naf:it.naf&&{wnd:it.naf.wnd,points:it.naf.points.map(rt)},doubles:it.doubles&&{step:it.doubles.step,points:it.doubles.points.map(rt)}}}return nt};Point$2.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var et=this.curve.jpoint(this.x,this.y,this.curve.one);return et};function JPoint(tt,et,nt,it){Base$2.BasePoint.call(this,tt,"jacobian"),et===null&&nt===null&&it===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$a(0)):(this.x=new BN$a(et,16),this.y=new BN$a(nt,16),this.z=new BN$a(it,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$a(JPoint,Base$2.BasePoint);ShortCurve.prototype.jpoint=function(et,nt,it){return new JPoint(this,et,nt,it)};JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var et=this.z.redInvm(),nt=et.redSqr(),it=this.x.redMul(nt),rt=this.y.redMul(nt).redMul(et);return this.curve.point(it,rt)};JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function(et){if(this.isInfinity())return et;if(et.isInfinity())return this;var nt=et.z.redSqr(),it=this.z.redSqr(),rt=this.x.redMul(nt),ot=et.x.redMul(it),at=this.y.redMul(nt.redMul(et.z)),st=et.y.redMul(it.redMul(this.z)),lt=rt.redSub(ot),ct=at.redSub(st);if(lt.cmpn(0)===0)return ct.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ut=lt.redSqr(),ht=ut.redMul(lt),dt=rt.redMul(ut),pt=ct.redSqr().redIAdd(ht).redISub(dt).redISub(dt),mt=ct.redMul(dt.redISub(pt)).redISub(at.redMul(ht)),gt=this.z.redMul(et.z).redMul(lt);return this.curve.jpoint(pt,mt,gt)};JPoint.prototype.mixedAdd=function(et){if(this.isInfinity())return et.toJ();if(et.isInfinity())return this;var nt=this.z.redSqr(),it=this.x,rt=et.x.redMul(nt),ot=this.y,at=et.y.redMul(nt).redMul(this.z),st=it.redSub(rt),lt=ot.redSub(at);if(st.cmpn(0)===0)return lt.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ct=st.redSqr(),ut=ct.redMul(st),ht=it.redMul(ct),dt=lt.redSqr().redIAdd(ut).redISub(ht).redISub(ht),pt=lt.redMul(ht.redISub(dt)).redISub(ot.redMul(ut)),mt=this.z.redMul(st);return this.curve.jpoint(dt,pt,mt)};JPoint.prototype.dblp=function(et){if(et===0)return this;if(this.isInfinity())return this;if(!et)return this.dbl();var nt;if(this.curve.zeroA||this.curve.threeA){var it=this;for(nt=0;nt=0)return!1;if(it.redIAdd(ot),this.x.cmp(it)===0)return!0}};JPoint.prototype.inspect=function(){return this.isInfinity()?"":""};JPoint.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var BN$9=bnExports$2,inherits$9=inherits_browserExports,Base$1=base$3,utils$k=utils$o;function MontCurve(tt){Base$1.call(this,"mont",tt),this.a=new BN$9(tt.a,16).toRed(this.red),this.b=new BN$9(tt.b,16).toRed(this.red),this.i4=new BN$9(4).toRed(this.red).redInvm(),this.two=new BN$9(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$9(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function(et){var nt=et.normalize().x,it=nt.redSqr(),rt=it.redMul(nt).redAdd(it.redMul(this.a)).redAdd(nt),ot=rt.redSqrt();return ot.redSqr().cmp(rt)===0};function Point$1(tt,et,nt){Base$1.BasePoint.call(this,tt,"projective"),et===null&&nt===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$9(et,16),this.z=new BN$9(nt,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$9(Point$1,Base$1.BasePoint);MontCurve.prototype.decodePoint=function(et,nt){return this.point(utils$k.toArray(et,nt),1)};MontCurve.prototype.point=function(et,nt){return new Point$1(this,et,nt)};MontCurve.prototype.pointFromJSON=function(et){return Point$1.fromJSON(this,et)};Point$1.prototype.precompute=function(){};Point$1.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$1.fromJSON=function(et,nt){return new Point$1(et,nt[0],nt[1]||et.one)};Point$1.prototype.inspect=function(){return this.isInfinity()?"":""};Point$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Point$1.prototype.dbl=function(){var et=this.x.redAdd(this.z),nt=et.redSqr(),it=this.x.redSub(this.z),rt=it.redSqr(),ot=nt.redSub(rt),at=nt.redMul(rt),st=ot.redMul(rt.redAdd(this.curve.a24.redMul(ot)));return this.curve.point(at,st)};Point$1.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.diffAdd=function(et,nt){var it=this.x.redAdd(this.z),rt=this.x.redSub(this.z),ot=et.x.redAdd(et.z),at=et.x.redSub(et.z),st=at.redMul(it),lt=ot.redMul(rt),ct=nt.z.redMul(st.redAdd(lt).redSqr()),ut=nt.x.redMul(st.redISub(lt).redSqr());return this.curve.point(ct,ut)};Point$1.prototype.mul=function(et){for(var nt=et.clone(),it=this,rt=this.curve.point(null,null),ot=this,at=[];nt.cmpn(0)!==0;nt.iushrn(1))at.push(nt.andln(1));for(var st=at.length-1;st>=0;st--)at[st]===0?(it=it.diffAdd(rt,ot),rt=rt.dbl()):(rt=it.diffAdd(rt,ot),it=it.dbl());return rt};Point$1.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.eq=function(et){return this.getX().cmp(et.getX())===0};Point$1.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$1.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var utils$j=utils$o,BN$8=bnExports$2,inherits$8=inherits_browserExports,Base=base$3,assert$h=utils$j.assert;function EdwardsCurve(tt){this.twisted=(tt.a|0)!==1,this.mOneA=this.twisted&&(tt.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",tt),this.a=new BN$8(tt.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$8(tt.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$8(tt.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$h(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(tt.c|0)===1}inherits$8(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function(et){return this.mOneA?et.redNeg():this.a.redMul(et)};EdwardsCurve.prototype._mulC=function(et){return this.oneC?et:this.c.redMul(et)};EdwardsCurve.prototype.jpoint=function(et,nt,it,rt){return this.point(et,nt,it,rt)};EdwardsCurve.prototype.pointFromX=function(et,nt){et=new BN$8(et,16),et.red||(et=et.toRed(this.red));var it=et.redSqr(),rt=this.c2.redSub(this.a.redMul(it)),ot=this.one.redSub(this.c2.redMul(this.d).redMul(it)),at=rt.redMul(ot.redInvm()),st=at.redSqrt();if(st.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");var lt=st.fromRed().isOdd();return(nt&&!lt||!nt&<)&&(st=st.redNeg()),this.point(et,st)};EdwardsCurve.prototype.pointFromY=function(et,nt){et=new BN$8(et,16),et.red||(et=et.toRed(this.red));var it=et.redSqr(),rt=it.redSub(this.c2),ot=it.redMul(this.d).redMul(this.c2).redSub(this.a),at=rt.redMul(ot.redInvm());if(at.cmp(this.zero)===0){if(nt)throw new Error("invalid point");return this.point(this.zero,et)}var st=at.redSqrt();if(st.redSqr().redSub(at).cmp(this.zero)!==0)throw new Error("invalid point");return st.fromRed().isOdd()!==nt&&(st=st.redNeg()),this.point(st,et)};EdwardsCurve.prototype.validate=function(et){if(et.isInfinity())return!0;et.normalize();var nt=et.x.redSqr(),it=et.y.redSqr(),rt=nt.redMul(this.a).redAdd(it),ot=this.c2.redMul(this.one.redAdd(this.d.redMul(nt).redMul(it)));return rt.cmp(ot)===0};function Point(tt,et,nt,it,rt){Base.BasePoint.call(this,tt,"projective"),et===null&&nt===null&&it===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$8(et,16),this.y=new BN$8(nt,16),this.z=it?new BN$8(it,16):this.curve.one,this.t=rt&&new BN$8(rt,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits$8(Point,Base.BasePoint);EdwardsCurve.prototype.pointFromJSON=function(et){return Point.fromJSON(this,et)};EdwardsCurve.prototype.point=function(et,nt,it,rt){return new Point(this,et,nt,it,rt)};Point.fromJSON=function(et,nt){return new Point(et,nt[0],nt[1],nt[2])};Point.prototype.inspect=function(){return this.isInfinity()?"":""};Point.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function(){var et=this.x.redSqr(),nt=this.y.redSqr(),it=this.z.redSqr();it=it.redIAdd(it);var rt=this.curve._mulA(et),ot=this.x.redAdd(this.y).redSqr().redISub(et).redISub(nt),at=rt.redAdd(nt),st=at.redSub(it),lt=rt.redSub(nt),ct=ot.redMul(st),ut=at.redMul(lt),ht=ot.redMul(lt),dt=st.redMul(at);return this.curve.point(ct,ut,dt,ht)};Point.prototype._projDbl=function(){var et=this.x.redAdd(this.y).redSqr(),nt=this.x.redSqr(),it=this.y.redSqr(),rt,ot,at,st,lt,ct;if(this.curve.twisted){st=this.curve._mulA(nt);var ut=st.redAdd(it);this.zOne?(rt=et.redSub(nt).redSub(it).redMul(ut.redSub(this.curve.two)),ot=ut.redMul(st.redSub(it)),at=ut.redSqr().redSub(ut).redSub(ut)):(lt=this.z.redSqr(),ct=ut.redSub(lt).redISub(lt),rt=et.redSub(nt).redISub(it).redMul(ct),ot=ut.redMul(st.redSub(it)),at=ut.redMul(ct))}else st=nt.redAdd(it),lt=this.curve._mulC(this.z).redSqr(),ct=st.redSub(lt).redSub(lt),rt=this.curve._mulC(et.redISub(st)).redMul(ct),ot=this.curve._mulC(st).redMul(nt.redISub(it)),at=st.redMul(ct);return this.curve.point(rt,ot,at)};Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point.prototype._extAdd=function(et){var nt=this.y.redSub(this.x).redMul(et.y.redSub(et.x)),it=this.y.redAdd(this.x).redMul(et.y.redAdd(et.x)),rt=this.t.redMul(this.curve.dd).redMul(et.t),ot=this.z.redMul(et.z.redAdd(et.z)),at=it.redSub(nt),st=ot.redSub(rt),lt=ot.redAdd(rt),ct=it.redAdd(nt),ut=at.redMul(st),ht=lt.redMul(ct),dt=at.redMul(ct),pt=st.redMul(lt);return this.curve.point(ut,ht,pt,dt)};Point.prototype._projAdd=function(et){var nt=this.z.redMul(et.z),it=nt.redSqr(),rt=this.x.redMul(et.x),ot=this.y.redMul(et.y),at=this.curve.d.redMul(rt).redMul(ot),st=it.redSub(at),lt=it.redAdd(at),ct=this.x.redAdd(this.y).redMul(et.x.redAdd(et.y)).redISub(rt).redISub(ot),ut=nt.redMul(st).redMul(ct),ht,dt;return this.curve.twisted?(ht=nt.redMul(lt).redMul(ot.redSub(this.curve._mulA(rt))),dt=st.redMul(lt)):(ht=nt.redMul(lt).redMul(ot.redSub(rt)),dt=this.curve._mulC(st).redMul(lt)),this.curve.point(ut,ht,dt)};Point.prototype.add=function(et){return this.isInfinity()?et:et.isInfinity()?this:this.curve.extended?this._extAdd(et):this._projAdd(et)};Point.prototype.mul=function(et){return this._hasDoubles(et)?this.curve._fixedNafMul(this,et):this.curve._wnafMul(this,et)};Point.prototype.mulAdd=function(et,nt,it){return this.curve._wnafMulAdd(1,[this,nt],[et,it],2,!1)};Point.prototype.jmulAdd=function(et,nt,it){return this.curve._wnafMulAdd(1,[this,nt],[et,it],2,!0)};Point.prototype.normalize=function(){if(this.zOne)return this;var et=this.z.redInvm();return this.x=this.x.redMul(et),this.y=this.y.redMul(et),this.t&&(this.t=this.t.redMul(et)),this.z=this.curve.one,this.zOne=!0,this};Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Point.prototype.eq=function(et){return this===et||this.getX().cmp(et.getX())===0&&this.getY().cmp(et.getY())===0};Point.prototype.eqXToP=function(et){var nt=et.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(nt)===0)return!0;for(var it=et.clone(),rt=this.curve.redN.redMul(this.z);;){if(it.iadd(this.curve.n),it.cmp(this.curve.p)>=0)return!1;if(nt.redIAdd(rt),this.x.cmp(nt)===0)return!0}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;(function(tt){var et=tt;et.base=base$3,et.short=short,et.mont=mont,et.edwards=edwards})(curve);var curves$1={},hash$6={},utils$i={},assert$g=minimalisticAssert,inherits$7=inherits_browserExports;utils$i.inherits=inherits$7;function isSurrogatePair(tt,et){return(tt.charCodeAt(et)&64512)!==55296||et<0||et+1>=tt.length?!1:(tt.charCodeAt(et+1)&64512)===56320}function toArray$3(tt,et){if(Array.isArray(tt))return tt.slice();if(!tt)return[];var nt=[];if(typeof tt=="string")if(et){if(et==="hex")for(tt=tt.replace(/[^a-z0-9]+/ig,""),tt.length%2!==0&&(tt="0"+tt),rt=0;rt>6|192,nt[it++]=ot&63|128):isSurrogatePair(tt,rt)?(ot=65536+((ot&1023)<<10)+(tt.charCodeAt(++rt)&1023),nt[it++]=ot>>18|240,nt[it++]=ot>>12&63|128,nt[it++]=ot>>6&63|128,nt[it++]=ot&63|128):(nt[it++]=ot>>12|224,nt[it++]=ot>>6&63|128,nt[it++]=ot&63|128)}else for(rt=0;rt>>24|tt>>>8&65280|tt<<8&16711680|(tt&255)<<24;return et>>>0}utils$i.htonl=htonl;function toHex32(tt,et){for(var nt="",it=0;it>>0}return ot}utils$i.join32=join32;function split32(tt,et){for(var nt=new Array(tt.length*4),it=0,rt=0;it>>24,nt[rt+1]=ot>>>16&255,nt[rt+2]=ot>>>8&255,nt[rt+3]=ot&255):(nt[rt+3]=ot>>>24,nt[rt+2]=ot>>>16&255,nt[rt+1]=ot>>>8&255,nt[rt]=ot&255)}return nt}utils$i.split32=split32;function rotr32$1(tt,et){return tt>>>et|tt<<32-et}utils$i.rotr32=rotr32$1;function rotl32$2(tt,et){return tt<>>32-et}utils$i.rotl32=rotl32$2;function sum32$3(tt,et){return tt+et>>>0}utils$i.sum32=sum32$3;function sum32_3$1(tt,et,nt){return tt+et+nt>>>0}utils$i.sum32_3=sum32_3$1;function sum32_4$2(tt,et,nt,it){return tt+et+nt+it>>>0}utils$i.sum32_4=sum32_4$2;function sum32_5$2(tt,et,nt,it,rt){return tt+et+nt+it+rt>>>0}utils$i.sum32_5=sum32_5$2;function sum64$1(tt,et,nt,it){var rt=tt[et],ot=tt[et+1],at=it+ot>>>0,st=(at>>0,tt[et+1]=at}utils$i.sum64=sum64$1;function sum64_hi$1(tt,et,nt,it){var rt=et+it>>>0,ot=(rt>>0}utils$i.sum64_hi=sum64_hi$1;function sum64_lo$1(tt,et,nt,it){var rt=et+it;return rt>>>0}utils$i.sum64_lo=sum64_lo$1;function sum64_4_hi$1(tt,et,nt,it,rt,ot,at,st){var lt=0,ct=et;ct=ct+it>>>0,lt+=ct>>0,lt+=ct>>0,lt+=ct>>0}utils$i.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(tt,et,nt,it,rt,ot,at,st){var lt=et+it+ot+st;return lt>>>0}utils$i.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(tt,et,nt,it,rt,ot,at,st,lt,ct){var ut=0,ht=et;ht=ht+it>>>0,ut+=ht>>0,ut+=ht>>0,ut+=ht>>0,ut+=ht>>0}utils$i.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(tt,et,nt,it,rt,ot,at,st,lt,ct){var ut=et+it+ot+st+ct;return ut>>>0}utils$i.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(tt,et,nt){var it=et<<32-nt|tt>>>nt;return it>>>0}utils$i.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(tt,et,nt){var it=tt<<32-nt|et>>>nt;return it>>>0}utils$i.rotr64_lo=rotr64_lo$1;function shr64_hi$1(tt,et,nt){return tt>>>nt}utils$i.shr64_hi=shr64_hi$1;function shr64_lo$1(tt,et,nt){var it=tt<<32-nt|et>>>nt;return it>>>0}utils$i.shr64_lo=shr64_lo$1;var common$7={},utils$h=utils$i,assert$f=minimalisticAssert;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$7.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(et,nt){if(et=utils$h.toArray(et,nt),this.pending?this.pending=this.pending.concat(et):this.pending=et,this.pendingTotal+=et.length,this.pending.length>=this._delta8){et=this.pending;var it=et.length%this._delta8;this.pending=et.slice(et.length-it,et.length),this.pending.length===0&&(this.pending=null),et=utils$h.join32(et,0,et.length-it,this.endian);for(var rt=0;rt>>24&255,rt[ot++]=et>>>16&255,rt[ot++]=et>>>8&255,rt[ot++]=et&255}else for(rt[ot++]=et&255,rt[ot++]=et>>>8&255,rt[ot++]=et>>>16&255,rt[ot++]=et>>>24&255,rt[ot++]=0,rt[ot++]=0,rt[ot++]=0,rt[ot++]=0,at=8;at>>3}common$6.g0_256=g0_256$1;function g1_256$1(tt){return rotr32(tt,17)^rotr32(tt,19)^tt>>>10}common$6.g1_256=g1_256$1;var utils$f=utils$i,common$5=common$7,shaCommon$1=common$6,rotl32$1=utils$f.rotl32,sum32$2=utils$f.sum32,sum32_5$1=utils$f.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$5.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1$1(){if(!(this instanceof SHA1$1))return new SHA1$1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$f.inherits(SHA1$1,BlockHash$3);var _1=SHA1$1;SHA1$1.blockSize=512;SHA1$1.outSize=160;SHA1$1.hmacStrength=80;SHA1$1.padLength=64;SHA1$1.prototype._update=function(et,nt){for(var it=this.W,rt=0;rt<16;rt++)it[rt]=et[nt+rt];for(;rtthis.blockSize&&(et=new this.Hash().update(et).digest()),assert$c(et.length<=this.blockSize);for(var nt=et.length;nt=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(et,nt,it)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function(et,nt,it){var rt=et.concat(nt).concat(it);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var ot=0;ot=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(et.concat(it||[])),this._reseed=1};HmacDRBG.prototype.generate=function(et,nt,it,rt){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof nt!="string"&&(rt=it,it=nt,nt=null),it&&(it=utils$8.toArray(it,rt||"hex"),this._update(it));for(var ot=[];ot.length"};var BN$6=bnExports$2,utils$6=utils$o,assert$9=utils$6.assert;function Signature$2(tt,et){if(tt instanceof Signature$2)return tt;this._importDER(tt,et)||(assert$9(tt.r&&tt.s,"Signature without r or s"),this.r=new BN$6(tt.r,16),this.s=new BN$6(tt.s,16),tt.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=tt.recoveryParam)}var signature$1=Signature$2;function Position$1(){this.place=0}function getLength(tt,et){var nt=tt[et.place++];if(!(nt&128))return nt;var it=nt&15;if(it===0||it>4)return!1;for(var rt=0,ot=0,at=et.place;ot>>=0;return rt<=127?!1:(et.place=at,rt)}function rmPadding(tt){for(var et=0,nt=tt.length-1;!tt[et]&&!(tt[et+1]&128)&&et>>3);for(tt.push(nt|128);--nt;)tt.push(et>>>(nt<<3)&255);tt.push(et)}Signature$2.prototype.toDER=function(et){var nt=this.r.toArray(),it=this.s.toArray();for(nt[0]&128&&(nt=[0].concat(nt)),it[0]&128&&(it=[0].concat(it)),nt=rmPadding(nt),it=rmPadding(it);!it[0]&&!(it[1]&128);)it=it.slice(1);var rt=[2];constructLength(rt,nt.length),rt=rt.concat(nt),rt.push(2),constructLength(rt,it.length);var ot=rt.concat(it),at=[48];return constructLength(at,ot.length),at=at.concat(ot),utils$6.encode(at,et)};var ec$1,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$1;hasRequiredEc=1;var tt=bnExports$2,et=hmacDrbg,nt=utils$o,it=curves$1,rt=requireBrorand(),ot=nt.assert,at=key$2,st=signature$1;function lt(ct){if(!(this instanceof lt))return new lt(ct);typeof ct=="string"&&(ot(Object.prototype.hasOwnProperty.call(it,ct),"Unknown curve "+ct),ct=it[ct]),ct instanceof it.PresetCurve&&(ct={curve:ct}),this.curve=ct.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=ct.curve.g,this.g.precompute(ct.curve.n.bitLength()+1),this.hash=ct.hash||ct.curve.hash}return ec$1=lt,lt.prototype.keyPair=function(ut){return new at(this,ut)},lt.prototype.keyFromPrivate=function(ut,ht){return at.fromPrivate(this,ut,ht)},lt.prototype.keyFromPublic=function(ut,ht){return at.fromPublic(this,ut,ht)},lt.prototype.genKeyPair=function(ut){ut||(ut={});for(var ht=new et({hash:this.hash,pers:ut.pers,persEnc:ut.persEnc||"utf8",entropy:ut.entropy||rt(this.hash.hmacStrength),entropyEnc:ut.entropy&&ut.entropyEnc||"utf8",nonce:this.n.toArray()}),dt=this.n.byteLength(),pt=this.n.sub(new tt(2));;){var mt=new tt(ht.generate(dt));if(!(mt.cmp(pt)>0))return mt.iaddn(1),this.keyFromPrivate(mt)}},lt.prototype._truncateToN=function(ut,ht){var dt=ut.byteLength()*8-this.n.bitLength();return dt>0&&(ut=ut.ushrn(dt)),!ht&&ut.cmp(this.n)>=0?ut.sub(this.n):ut},lt.prototype.sign=function(ut,ht,dt,pt){typeof dt=="object"&&(pt=dt,dt=null),pt||(pt={}),ht=this.keyFromPrivate(ht,dt),ut=this._truncateToN(new tt(ut,16));for(var mt=this.n.byteLength(),gt=ht.getPrivate().toArray("be",mt),bt=ut.toArray("be",mt),yt=new et({hash:this.hash,entropy:gt,nonce:bt,pers:pt.pers,persEnc:pt.persEnc||"utf8"}),wt=this.n.sub(new tt(1)),vt=0;;vt++){var xt=pt.k?pt.k(vt):new tt(yt.generate(this.n.byteLength()));if(xt=this._truncateToN(xt,!0),!(xt.cmpn(1)<=0||xt.cmp(wt)>=0)){var St=this.g.mul(xt);if(!St.isInfinity()){var Et=St.getX(),$t=Et.umod(this.n);if($t.cmpn(0)!==0){var It=xt.invm(this.n).mul($t.mul(ht.getPrivate()).iadd(ut));if(It=It.umod(this.n),It.cmpn(0)!==0){var Ft=(St.getY().isOdd()?1:0)|(Et.cmp($t)!==0?2:0);return pt.canonical&&It.cmp(this.nh)>0&&(It=this.n.sub(It),Ft^=1),new st({r:$t,s:It,recoveryParam:Ft})}}}}}},lt.prototype.verify=function(ut,ht,dt,pt){ut=this._truncateToN(new tt(ut,16)),dt=this.keyFromPublic(dt,pt),ht=new st(ht,"hex");var mt=ht.r,gt=ht.s;if(mt.cmpn(1)<0||mt.cmp(this.n)>=0||gt.cmpn(1)<0||gt.cmp(this.n)>=0)return!1;var bt=gt.invm(this.n),yt=bt.mul(ut).umod(this.n),wt=bt.mul(mt).umod(this.n),vt;return this.curve._maxwellTrick?(vt=this.g.jmulAdd(yt,dt.getPublic(),wt),vt.isInfinity()?!1:vt.eqXToP(mt)):(vt=this.g.mulAdd(yt,dt.getPublic(),wt),vt.isInfinity()?!1:vt.getX().umod(this.n).cmp(mt)===0)},lt.prototype.recoverPubKey=function(ct,ut,ht,dt){ot((3&ht)===ht,"The recovery param is more than two bits"),ut=new st(ut,dt);var pt=this.n,mt=new tt(ct),gt=ut.r,bt=ut.s,yt=ht&1,wt=ht>>1;if(gt.cmp(this.curve.p.umod(this.curve.n))>=0&&wt)throw new Error("Unable to find sencond key candinate");wt?gt=this.curve.pointFromX(gt.add(this.curve.n),yt):gt=this.curve.pointFromX(gt,yt);var vt=ut.r.invm(pt),xt=pt.sub(mt).mul(vt).umod(pt),St=bt.mul(vt).umod(pt);return this.g.mulAdd(xt,gt,St)},lt.prototype.getKeyRecoveryParam=function(ct,ut,ht,dt){if(ut=new st(ut,dt),ut.recoveryParam!==null)return ut.recoveryParam;for(var pt=0;pt<4;pt++){var mt;try{mt=this.recoverPubKey(ct,ut,pt)}catch{continue}if(mt.eq(ht))return pt}throw new Error("Unable to find valid recovery factor")},ec$1}var utils$5=utils$o,assert$8=utils$5.assert,parseBytes$2=utils$5.parseBytes,cachedProperty$1=utils$5.cachedProperty;function KeyPair$1(tt,et){this.eddsa=tt,this._secret=parseBytes$2(et.secret),tt.isPoint(et.pub)?this._pub=et.pub:this._pubBytes=parseBytes$2(et.pub)}KeyPair$1.fromPublic=function(et,nt){return nt instanceof KeyPair$1?nt:new KeyPair$1(et,{pub:nt})};KeyPair$1.fromSecret=function(et,nt){return nt instanceof KeyPair$1?nt:new KeyPair$1(et,{secret:nt})};KeyPair$1.prototype.secret=function(){return this._secret};cachedProperty$1(KeyPair$1,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});cachedProperty$1(KeyPair$1,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$1(KeyPair$1,"privBytes",function(){var et=this.eddsa,nt=this.hash(),it=et.encodingLength-1,rt=nt.slice(0,et.encodingLength);return rt[0]&=248,rt[it]&=127,rt[it]|=64,rt});cachedProperty$1(KeyPair$1,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$1(KeyPair$1,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$1(KeyPair$1,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$1.prototype.sign=function(et){return assert$8(this._secret,"KeyPair can only verify"),this.eddsa.sign(et,this)};KeyPair$1.prototype.verify=function(et,nt){return this.eddsa.verify(et,nt,this)};KeyPair$1.prototype.getSecret=function(et){return assert$8(this._secret,"KeyPair is public only"),utils$5.encode(this.secret(),et)};KeyPair$1.prototype.getPublic=function(et){return utils$5.encode(this.pubBytes(),et)};var key$1=KeyPair$1,BN$5=bnExports$2,utils$4=utils$o,assert$7=utils$4.assert,cachedProperty=utils$4.cachedProperty,parseBytes$1=utils$4.parseBytes;function Signature$1(tt,et){this.eddsa=tt,typeof et!="object"&&(et=parseBytes$1(et)),Array.isArray(et)&&(et={R:et.slice(0,tt.encodingLength),S:et.slice(tt.encodingLength)}),assert$7(et.R&&et.S,"Signature without R or S"),tt.isPoint(et.R)&&(this._R=et.R),et.S instanceof BN$5&&(this._S=et.S),this._Rencoded=Array.isArray(et.R)?et.R:et.Rencoded,this._Sencoded=Array.isArray(et.S)?et.S:et.Sencoded}cachedProperty(Signature$1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature$1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature$1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});cachedProperty(Signature$1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Signature$1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Signature$1.prototype.toHex=function(){return utils$4.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash$4=hash$6,curves=curves$1,utils$3=utils$o,assert$6=utils$3.assert,parseBytes=utils$3.parseBytes,KeyPair=key$1,Signature=signature;function EDDSA(tt){if(assert$6(tt==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(tt);tt=curves[tt].curve,this.curve=tt,this.g=tt.g,this.g.precompute(tt.n.bitLength()+1),this.pointClass=tt.point().constructor,this.encodingLength=Math.ceil(tt.n.bitLength()/8),this.hash=hash$4.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function(et,nt){et=parseBytes(et);var it=this.keyFromSecret(nt),rt=this.hashInt(it.messagePrefix(),et),ot=this.g.mul(rt),at=this.encodePoint(ot),st=this.hashInt(at,it.pubBytes(),et).mul(it.priv()),lt=rt.add(st).umod(this.curve.n);return this.makeSignature({R:ot,S:lt,Rencoded:at})};EDDSA.prototype.verify=function(et,nt,it){et=parseBytes(et),nt=this.makeSignature(nt);var rt=this.keyFromPublic(it),ot=this.hashInt(nt.Rencoded(),rt.pubBytes(),et),at=this.g.mul(nt.S()),st=nt.R().add(rt.pub().mul(ot));return st.eq(at)};EDDSA.prototype.hashInt=function(){for(var et=this.hash(),nt=0;nt0?kt:Tt},ot.min=function(kt,Tt){return kt.cmp(Tt)<0?kt:Tt},ot.prototype._init=function(kt,Tt,Ct){if(typeof kt=="number")return this._initNumber(kt,Tt,Ct);if(typeof kt=="object")return this._initArray(kt,Tt,Ct);Tt==="hex"&&(Tt=16),it(Tt===(Tt|0)&&Tt>=2&&Tt<=36),kt=kt.toString().replace(/\s+/g,"");var Ut=0;kt[0]==="-"&&(Ut++,this.negative=1),Ut=0;Ut-=3)Bt=kt[Ut]|kt[Ut-1]<<8|kt[Ut-2]<<16,this.words[Nt]|=Bt<>>26-Mt&67108863,Mt+=24,Mt>=26&&(Mt-=26,Nt++);else if(Ct==="le")for(Ut=0,Nt=0;Ut>>26-Mt&67108863,Mt+=24,Mt>=26&&(Mt-=26,Nt++);return this._strip()};function st(jt,kt){var Tt=jt.charCodeAt(kt);if(Tt>=48&&Tt<=57)return Tt-48;if(Tt>=65&&Tt<=70)return Tt-55;if(Tt>=97&&Tt<=102)return Tt-87;it(!1,"Invalid character in "+jt)}function lt(jt,kt,Tt){var Ct=st(jt,Tt);return Tt-1>=kt&&(Ct|=st(jt,Tt-1)<<4),Ct}ot.prototype._parseHex=function(kt,Tt,Ct){this.length=Math.ceil((kt.length-Tt)/6),this.words=new Array(this.length);for(var Ut=0;Ut=Tt;Ut-=2)Mt=lt(kt,Tt,Ut)<=18?(Nt-=18,Bt+=1,this.words[Bt]|=Mt>>>26):Nt+=8;else{var Dt=kt.length-Tt;for(Ut=Dt%2===0?Tt+1:Tt;Ut=18?(Nt-=18,Bt+=1,this.words[Bt]|=Mt>>>26):Nt+=8}this._strip()};function ct(jt,kt,Tt,Ct){for(var Ut=0,Nt=0,Bt=Math.min(jt.length,Tt),Mt=kt;Mt=49?Nt=Dt-49+10:Dt>=17?Nt=Dt-17+10:Nt=Dt,it(Dt>=0&&Nt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},ot.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{ot.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht}catch{ot.prototype.inspect=ht}else ot.prototype.inspect=ht;function ht(){return(this.red?""}var dt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],pt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mt=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];ot.prototype.toString=function(kt,Tt){kt=kt||10,Tt=Tt|0||1;var Ct;if(kt===16||kt==="hex"){Ct="";for(var Ut=0,Nt=0,Bt=0;Bt>>24-Ut&16777215,Ut+=2,Ut>=26&&(Ut-=26,Bt--),Nt!==0||Bt!==this.length-1?Ct=dt[6-Dt.length]+Dt+Ct:Ct=Dt+Ct}for(Nt!==0&&(Ct=Nt.toString(16)+Ct);Ct.length%Tt!==0;)Ct="0"+Ct;return this.negative!==0&&(Ct="-"+Ct),Ct}if(kt===(kt|0)&&kt>=2&&kt<=36){var Pt=pt[kt],Vt=mt[kt];Ct="";var nn=this.clone();for(nn.negative=0;!nn.isZero();){var cn=nn.modrn(Vt).toString(kt);nn=nn.idivn(Vt),nn.isZero()?Ct=cn+Ct:Ct=dt[Pt-cn.length]+cn+Ct}for(this.isZero()&&(Ct="0"+Ct);Ct.length%Tt!==0;)Ct="0"+Ct;return this.negative!==0&&(Ct="-"+Ct),Ct}it(!1,"Base should be between 2 and 36")},ot.prototype.toNumber=function(){var kt=this.words[0];return this.length===2?kt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?kt+=4503599627370496+this.words[1]*67108864:this.length>2&&it(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-kt:kt},ot.prototype.toJSON=function(){return this.toString(16,2)},at&&(ot.prototype.toBuffer=function(kt,Tt){return this.toArrayLike(at,kt,Tt)}),ot.prototype.toArray=function(kt,Tt){return this.toArrayLike(Array,kt,Tt)};var gt=function(kt,Tt){return kt.allocUnsafe?kt.allocUnsafe(Tt):new kt(Tt)};ot.prototype.toArrayLike=function(kt,Tt,Ct){this._strip();var Ut=this.byteLength(),Nt=Ct||Math.max(1,Ut);it(Ut<=Nt,"byte array longer than desired length"),it(Nt>0,"Requested array length <= 0");var Bt=gt(kt,Nt),Mt=Tt==="le"?"LE":"BE";return this["_toArrayLike"+Mt](Bt,Ut),Bt},ot.prototype._toArrayLikeLE=function(kt,Tt){for(var Ct=0,Ut=0,Nt=0,Bt=0;Nt>8&255),Ct>16&255),Bt===6?(Ct>24&255),Ut=0,Bt=0):(Ut=Mt>>>24,Bt+=2)}if(Ct=0&&(kt[Ct--]=Mt>>8&255),Ct>=0&&(kt[Ct--]=Mt>>16&255),Bt===6?(Ct>=0&&(kt[Ct--]=Mt>>24&255),Ut=0,Bt=0):(Ut=Mt>>>24,Bt+=2)}if(Ct>=0)for(kt[Ct--]=Ut;Ct>=0;)kt[Ct--]=0},Math.clz32?ot.prototype._countBits=function(kt){return 32-Math.clz32(kt)}:ot.prototype._countBits=function(kt){var Tt=kt,Ct=0;return Tt>=4096&&(Ct+=13,Tt>>>=13),Tt>=64&&(Ct+=7,Tt>>>=7),Tt>=8&&(Ct+=4,Tt>>>=4),Tt>=2&&(Ct+=2,Tt>>>=2),Ct+Tt},ot.prototype._zeroBits=function(kt){if(kt===0)return 26;var Tt=kt,Ct=0;return Tt&8191||(Ct+=13,Tt>>>=13),Tt&127||(Ct+=7,Tt>>>=7),Tt&15||(Ct+=4,Tt>>>=4),Tt&3||(Ct+=2,Tt>>>=2),Tt&1||Ct++,Ct},ot.prototype.bitLength=function(){var kt=this.words[this.length-1],Tt=this._countBits(kt);return(this.length-1)*26+Tt};function bt(jt){for(var kt=new Array(jt.bitLength()),Tt=0;Tt>>Ut&1}return kt}ot.prototype.zeroBits=function(){if(this.isZero())return 0;for(var kt=0,Tt=0;Ttkt.length?this.clone().ior(kt):kt.clone().ior(this)},ot.prototype.uor=function(kt){return this.length>kt.length?this.clone().iuor(kt):kt.clone().iuor(this)},ot.prototype.iuand=function(kt){var Tt;this.length>kt.length?Tt=kt:Tt=this;for(var Ct=0;Ctkt.length?this.clone().iand(kt):kt.clone().iand(this)},ot.prototype.uand=function(kt){return this.length>kt.length?this.clone().iuand(kt):kt.clone().iuand(this)},ot.prototype.iuxor=function(kt){var Tt,Ct;this.length>kt.length?(Tt=this,Ct=kt):(Tt=kt,Ct=this);for(var Ut=0;Utkt.length?this.clone().ixor(kt):kt.clone().ixor(this)},ot.prototype.uxor=function(kt){return this.length>kt.length?this.clone().iuxor(kt):kt.clone().iuxor(this)},ot.prototype.inotn=function(kt){it(typeof kt=="number"&&kt>=0);var Tt=Math.ceil(kt/26)|0,Ct=kt%26;this._expand(Tt),Ct>0&&Tt--;for(var Ut=0;Ut0&&(this.words[Ut]=~this.words[Ut]&67108863>>26-Ct),this._strip()},ot.prototype.notn=function(kt){return this.clone().inotn(kt)},ot.prototype.setn=function(kt,Tt){it(typeof kt=="number"&&kt>=0);var Ct=kt/26|0,Ut=kt%26;return this._expand(Ct+1),Tt?this.words[Ct]=this.words[Ct]|1<kt.length?(Ct=this,Ut=kt):(Ct=kt,Ut=this);for(var Nt=0,Bt=0;Bt>>26;for(;Nt!==0&&Bt>>26;if(this.length=Ct.length,Nt!==0)this.words[this.length]=Nt,this.length++;else if(Ct!==this)for(;Btkt.length?this.clone().iadd(kt):kt.clone().iadd(this)},ot.prototype.isub=function(kt){if(kt.negative!==0){kt.negative=0;var Tt=this.iadd(kt);return kt.negative=1,Tt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(kt),this.negative=1,this._normSign();var Ct=this.cmp(kt);if(Ct===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Ut,Nt;Ct>0?(Ut=this,Nt=kt):(Ut=kt,Nt=this);for(var Bt=0,Mt=0;Mt>26,this.words[Mt]=Tt&67108863;for(;Bt!==0&&Mt>26,this.words[Mt]=Tt&67108863;if(Bt===0&&Mt>>26,nn=Dt&67108863,cn=Math.min(Pt,kt.length-1),Xt=Math.max(0,Pt-jt.length+1);Xt<=cn;Xt++){var un=Pt-Xt|0;Ut=jt.words[un]|0,Nt=kt.words[Xt]|0,Bt=Ut*Nt+nn,Vt+=Bt/67108864|0,nn=Bt&67108863}Tt.words[Pt]=nn|0,Dt=Vt|0}return Dt!==0?Tt.words[Pt]=Dt|0:Tt.length--,Tt._strip()}var wt=function(kt,Tt,Ct){var Ut=kt.words,Nt=Tt.words,Bt=Ct.words,Mt=0,Dt,Pt,Vt,nn=Ut[0]|0,cn=nn&8191,Xt=nn>>>13,un=Ut[1]|0,en=un&8191,fn=un>>>13,xn=Ut[2]|0,an=xn&8191,Zt=xn>>>13,En=Ut[3]|0,In=En&8191,Cn=En>>>13,Nn=Ut[4]|0,Un=Nn&8191,_n=Nn>>>13,An=Ut[5]|0,gn=An&8191,Tn=An>>>13,yn=Ut[6]|0,dn=yn&8191,sn=yn>>>13,rn=Ut[7]|0,Sn=rn&8191,tn=rn>>>13,qt=Ut[8]|0,Kt=qt&8191,wn=qt>>>13,Rn=Ut[9]|0,jn=Rn&8191,Bn=Rn>>>13,Xn=Nt[0]|0,Wn=Xn&8191,Gn=Xn>>>13,Fn=Nt[1]|0,Jn=Fn&8191,Vn=Fn>>>13,dr=Nt[2]|0,ur=dr&8191,_r=dr>>>13,Qr=Nt[3]|0,Or=Qr&8191,Mr=Qr>>>13,qr=Nt[4]|0,Ur=qr&8191,Lr=qr>>>13,ao=Nt[5]|0,Gr=ao&8191,Br=ao>>>13,go=Nt[6]|0,vn=go&8191,Pn=go>>>13,hn=Nt[7]|0,Jt=hn&8191,kn=hn>>>13,On=Nt[8]|0,Dn=On&8191,Yn=On>>>13,er=Nt[9]|0,or=er&8191,ar=er>>>13;Ct.negative=kt.negative^Tt.negative,Ct.length=19,Dt=Math.imul(cn,Wn),Pt=Math.imul(cn,Gn),Pt=Pt+Math.imul(Xt,Wn)|0,Vt=Math.imul(Xt,Gn);var Vr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,Dt=Math.imul(en,Wn),Pt=Math.imul(en,Gn),Pt=Pt+Math.imul(fn,Wn)|0,Vt=Math.imul(fn,Gn),Dt=Dt+Math.imul(cn,Jn)|0,Pt=Pt+Math.imul(cn,Vn)|0,Pt=Pt+Math.imul(Xt,Jn)|0,Vt=Vt+Math.imul(Xt,Vn)|0;var wr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(wr>>>26)|0,wr&=67108863,Dt=Math.imul(an,Wn),Pt=Math.imul(an,Gn),Pt=Pt+Math.imul(Zt,Wn)|0,Vt=Math.imul(Zt,Gn),Dt=Dt+Math.imul(en,Jn)|0,Pt=Pt+Math.imul(en,Vn)|0,Pt=Pt+Math.imul(fn,Jn)|0,Vt=Vt+Math.imul(fn,Vn)|0,Dt=Dt+Math.imul(cn,ur)|0,Pt=Pt+Math.imul(cn,_r)|0,Pt=Pt+Math.imul(Xt,ur)|0,Vt=Vt+Math.imul(Xt,_r)|0;var jr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(jr>>>26)|0,jr&=67108863,Dt=Math.imul(In,Wn),Pt=Math.imul(In,Gn),Pt=Pt+Math.imul(Cn,Wn)|0,Vt=Math.imul(Cn,Gn),Dt=Dt+Math.imul(an,Jn)|0,Pt=Pt+Math.imul(an,Vn)|0,Pt=Pt+Math.imul(Zt,Jn)|0,Vt=Vt+Math.imul(Zt,Vn)|0,Dt=Dt+Math.imul(en,ur)|0,Pt=Pt+Math.imul(en,_r)|0,Pt=Pt+Math.imul(fn,ur)|0,Vt=Vt+Math.imul(fn,_r)|0,Dt=Dt+Math.imul(cn,Or)|0,Pt=Pt+Math.imul(cn,Mr)|0,Pt=Pt+Math.imul(Xt,Or)|0,Vt=Vt+Math.imul(Xt,Mr)|0;var Hr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,Dt=Math.imul(Un,Wn),Pt=Math.imul(Un,Gn),Pt=Pt+Math.imul(_n,Wn)|0,Vt=Math.imul(_n,Gn),Dt=Dt+Math.imul(In,Jn)|0,Pt=Pt+Math.imul(In,Vn)|0,Pt=Pt+Math.imul(Cn,Jn)|0,Vt=Vt+Math.imul(Cn,Vn)|0,Dt=Dt+Math.imul(an,ur)|0,Pt=Pt+Math.imul(an,_r)|0,Pt=Pt+Math.imul(Zt,ur)|0,Vt=Vt+Math.imul(Zt,_r)|0,Dt=Dt+Math.imul(en,Or)|0,Pt=Pt+Math.imul(en,Mr)|0,Pt=Pt+Math.imul(fn,Or)|0,Vt=Vt+Math.imul(fn,Mr)|0,Dt=Dt+Math.imul(cn,Ur)|0,Pt=Pt+Math.imul(cn,Lr)|0,Pt=Pt+Math.imul(Xt,Ur)|0,Vt=Vt+Math.imul(Xt,Lr)|0;var no=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(no>>>26)|0,no&=67108863,Dt=Math.imul(gn,Wn),Pt=Math.imul(gn,Gn),Pt=Pt+Math.imul(Tn,Wn)|0,Vt=Math.imul(Tn,Gn),Dt=Dt+Math.imul(Un,Jn)|0,Pt=Pt+Math.imul(Un,Vn)|0,Pt=Pt+Math.imul(_n,Jn)|0,Vt=Vt+Math.imul(_n,Vn)|0,Dt=Dt+Math.imul(In,ur)|0,Pt=Pt+Math.imul(In,_r)|0,Pt=Pt+Math.imul(Cn,ur)|0,Vt=Vt+Math.imul(Cn,_r)|0,Dt=Dt+Math.imul(an,Or)|0,Pt=Pt+Math.imul(an,Mr)|0,Pt=Pt+Math.imul(Zt,Or)|0,Vt=Vt+Math.imul(Zt,Mr)|0,Dt=Dt+Math.imul(en,Ur)|0,Pt=Pt+Math.imul(en,Lr)|0,Pt=Pt+Math.imul(fn,Ur)|0,Vt=Vt+Math.imul(fn,Lr)|0,Dt=Dt+Math.imul(cn,Gr)|0,Pt=Pt+Math.imul(cn,Br)|0,Pt=Pt+Math.imul(Xt,Gr)|0,Vt=Vt+Math.imul(Xt,Br)|0;var Xr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,Dt=Math.imul(dn,Wn),Pt=Math.imul(dn,Gn),Pt=Pt+Math.imul(sn,Wn)|0,Vt=Math.imul(sn,Gn),Dt=Dt+Math.imul(gn,Jn)|0,Pt=Pt+Math.imul(gn,Vn)|0,Pt=Pt+Math.imul(Tn,Jn)|0,Vt=Vt+Math.imul(Tn,Vn)|0,Dt=Dt+Math.imul(Un,ur)|0,Pt=Pt+Math.imul(Un,_r)|0,Pt=Pt+Math.imul(_n,ur)|0,Vt=Vt+Math.imul(_n,_r)|0,Dt=Dt+Math.imul(In,Or)|0,Pt=Pt+Math.imul(In,Mr)|0,Pt=Pt+Math.imul(Cn,Or)|0,Vt=Vt+Math.imul(Cn,Mr)|0,Dt=Dt+Math.imul(an,Ur)|0,Pt=Pt+Math.imul(an,Lr)|0,Pt=Pt+Math.imul(Zt,Ur)|0,Vt=Vt+Math.imul(Zt,Lr)|0,Dt=Dt+Math.imul(en,Gr)|0,Pt=Pt+Math.imul(en,Br)|0,Pt=Pt+Math.imul(fn,Gr)|0,Vt=Vt+Math.imul(fn,Br)|0,Dt=Dt+Math.imul(cn,vn)|0,Pt=Pt+Math.imul(cn,Pn)|0,Pt=Pt+Math.imul(Xt,vn)|0,Vt=Vt+Math.imul(Xt,Pn)|0;var Jr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Dt=Math.imul(Sn,Wn),Pt=Math.imul(Sn,Gn),Pt=Pt+Math.imul(tn,Wn)|0,Vt=Math.imul(tn,Gn),Dt=Dt+Math.imul(dn,Jn)|0,Pt=Pt+Math.imul(dn,Vn)|0,Pt=Pt+Math.imul(sn,Jn)|0,Vt=Vt+Math.imul(sn,Vn)|0,Dt=Dt+Math.imul(gn,ur)|0,Pt=Pt+Math.imul(gn,_r)|0,Pt=Pt+Math.imul(Tn,ur)|0,Vt=Vt+Math.imul(Tn,_r)|0,Dt=Dt+Math.imul(Un,Or)|0,Pt=Pt+Math.imul(Un,Mr)|0,Pt=Pt+Math.imul(_n,Or)|0,Vt=Vt+Math.imul(_n,Mr)|0,Dt=Dt+Math.imul(In,Ur)|0,Pt=Pt+Math.imul(In,Lr)|0,Pt=Pt+Math.imul(Cn,Ur)|0,Vt=Vt+Math.imul(Cn,Lr)|0,Dt=Dt+Math.imul(an,Gr)|0,Pt=Pt+Math.imul(an,Br)|0,Pt=Pt+Math.imul(Zt,Gr)|0,Vt=Vt+Math.imul(Zt,Br)|0,Dt=Dt+Math.imul(en,vn)|0,Pt=Pt+Math.imul(en,Pn)|0,Pt=Pt+Math.imul(fn,vn)|0,Vt=Vt+Math.imul(fn,Pn)|0,Dt=Dt+Math.imul(cn,Jt)|0,Pt=Pt+Math.imul(cn,kn)|0,Pt=Pt+Math.imul(Xt,Jt)|0,Vt=Vt+Math.imul(Xt,kn)|0;var br=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(br>>>26)|0,br&=67108863,Dt=Math.imul(Kt,Wn),Pt=Math.imul(Kt,Gn),Pt=Pt+Math.imul(wn,Wn)|0,Vt=Math.imul(wn,Gn),Dt=Dt+Math.imul(Sn,Jn)|0,Pt=Pt+Math.imul(Sn,Vn)|0,Pt=Pt+Math.imul(tn,Jn)|0,Vt=Vt+Math.imul(tn,Vn)|0,Dt=Dt+Math.imul(dn,ur)|0,Pt=Pt+Math.imul(dn,_r)|0,Pt=Pt+Math.imul(sn,ur)|0,Vt=Vt+Math.imul(sn,_r)|0,Dt=Dt+Math.imul(gn,Or)|0,Pt=Pt+Math.imul(gn,Mr)|0,Pt=Pt+Math.imul(Tn,Or)|0,Vt=Vt+Math.imul(Tn,Mr)|0,Dt=Dt+Math.imul(Un,Ur)|0,Pt=Pt+Math.imul(Un,Lr)|0,Pt=Pt+Math.imul(_n,Ur)|0,Vt=Vt+Math.imul(_n,Lr)|0,Dt=Dt+Math.imul(In,Gr)|0,Pt=Pt+Math.imul(In,Br)|0,Pt=Pt+Math.imul(Cn,Gr)|0,Vt=Vt+Math.imul(Cn,Br)|0,Dt=Dt+Math.imul(an,vn)|0,Pt=Pt+Math.imul(an,Pn)|0,Pt=Pt+Math.imul(Zt,vn)|0,Vt=Vt+Math.imul(Zt,Pn)|0,Dt=Dt+Math.imul(en,Jt)|0,Pt=Pt+Math.imul(en,kn)|0,Pt=Pt+Math.imul(fn,Jt)|0,Vt=Vt+Math.imul(fn,kn)|0,Dt=Dt+Math.imul(cn,Dn)|0,Pt=Pt+Math.imul(cn,Yn)|0,Pt=Pt+Math.imul(Xt,Dn)|0,Vt=Vt+Math.imul(Xt,Yn)|0;var $r=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+($r>>>26)|0,$r&=67108863,Dt=Math.imul(jn,Wn),Pt=Math.imul(jn,Gn),Pt=Pt+Math.imul(Bn,Wn)|0,Vt=Math.imul(Bn,Gn),Dt=Dt+Math.imul(Kt,Jn)|0,Pt=Pt+Math.imul(Kt,Vn)|0,Pt=Pt+Math.imul(wn,Jn)|0,Vt=Vt+Math.imul(wn,Vn)|0,Dt=Dt+Math.imul(Sn,ur)|0,Pt=Pt+Math.imul(Sn,_r)|0,Pt=Pt+Math.imul(tn,ur)|0,Vt=Vt+Math.imul(tn,_r)|0,Dt=Dt+Math.imul(dn,Or)|0,Pt=Pt+Math.imul(dn,Mr)|0,Pt=Pt+Math.imul(sn,Or)|0,Vt=Vt+Math.imul(sn,Mr)|0,Dt=Dt+Math.imul(gn,Ur)|0,Pt=Pt+Math.imul(gn,Lr)|0,Pt=Pt+Math.imul(Tn,Ur)|0,Vt=Vt+Math.imul(Tn,Lr)|0,Dt=Dt+Math.imul(Un,Gr)|0,Pt=Pt+Math.imul(Un,Br)|0,Pt=Pt+Math.imul(_n,Gr)|0,Vt=Vt+Math.imul(_n,Br)|0,Dt=Dt+Math.imul(In,vn)|0,Pt=Pt+Math.imul(In,Pn)|0,Pt=Pt+Math.imul(Cn,vn)|0,Vt=Vt+Math.imul(Cn,Pn)|0,Dt=Dt+Math.imul(an,Jt)|0,Pt=Pt+Math.imul(an,kn)|0,Pt=Pt+Math.imul(Zt,Jt)|0,Vt=Vt+Math.imul(Zt,kn)|0,Dt=Dt+Math.imul(en,Dn)|0,Pt=Pt+Math.imul(en,Yn)|0,Pt=Pt+Math.imul(fn,Dn)|0,Vt=Vt+Math.imul(fn,Yn)|0,Dt=Dt+Math.imul(cn,or)|0,Pt=Pt+Math.imul(cn,ar)|0,Pt=Pt+Math.imul(Xt,or)|0,Vt=Vt+Math.imul(Xt,ar)|0;var Dr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,Dt=Math.imul(jn,Jn),Pt=Math.imul(jn,Vn),Pt=Pt+Math.imul(Bn,Jn)|0,Vt=Math.imul(Bn,Vn),Dt=Dt+Math.imul(Kt,ur)|0,Pt=Pt+Math.imul(Kt,_r)|0,Pt=Pt+Math.imul(wn,ur)|0,Vt=Vt+Math.imul(wn,_r)|0,Dt=Dt+Math.imul(Sn,Or)|0,Pt=Pt+Math.imul(Sn,Mr)|0,Pt=Pt+Math.imul(tn,Or)|0,Vt=Vt+Math.imul(tn,Mr)|0,Dt=Dt+Math.imul(dn,Ur)|0,Pt=Pt+Math.imul(dn,Lr)|0,Pt=Pt+Math.imul(sn,Ur)|0,Vt=Vt+Math.imul(sn,Lr)|0,Dt=Dt+Math.imul(gn,Gr)|0,Pt=Pt+Math.imul(gn,Br)|0,Pt=Pt+Math.imul(Tn,Gr)|0,Vt=Vt+Math.imul(Tn,Br)|0,Dt=Dt+Math.imul(Un,vn)|0,Pt=Pt+Math.imul(Un,Pn)|0,Pt=Pt+Math.imul(_n,vn)|0,Vt=Vt+Math.imul(_n,Pn)|0,Dt=Dt+Math.imul(In,Jt)|0,Pt=Pt+Math.imul(In,kn)|0,Pt=Pt+Math.imul(Cn,Jt)|0,Vt=Vt+Math.imul(Cn,kn)|0,Dt=Dt+Math.imul(an,Dn)|0,Pt=Pt+Math.imul(an,Yn)|0,Pt=Pt+Math.imul(Zt,Dn)|0,Vt=Vt+Math.imul(Zt,Yn)|0,Dt=Dt+Math.imul(en,or)|0,Pt=Pt+Math.imul(en,ar)|0,Pt=Pt+Math.imul(fn,or)|0,Vt=Vt+Math.imul(fn,ar)|0;var Cr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,Dt=Math.imul(jn,ur),Pt=Math.imul(jn,_r),Pt=Pt+Math.imul(Bn,ur)|0,Vt=Math.imul(Bn,_r),Dt=Dt+Math.imul(Kt,Or)|0,Pt=Pt+Math.imul(Kt,Mr)|0,Pt=Pt+Math.imul(wn,Or)|0,Vt=Vt+Math.imul(wn,Mr)|0,Dt=Dt+Math.imul(Sn,Ur)|0,Pt=Pt+Math.imul(Sn,Lr)|0,Pt=Pt+Math.imul(tn,Ur)|0,Vt=Vt+Math.imul(tn,Lr)|0,Dt=Dt+Math.imul(dn,Gr)|0,Pt=Pt+Math.imul(dn,Br)|0,Pt=Pt+Math.imul(sn,Gr)|0,Vt=Vt+Math.imul(sn,Br)|0,Dt=Dt+Math.imul(gn,vn)|0,Pt=Pt+Math.imul(gn,Pn)|0,Pt=Pt+Math.imul(Tn,vn)|0,Vt=Vt+Math.imul(Tn,Pn)|0,Dt=Dt+Math.imul(Un,Jt)|0,Pt=Pt+Math.imul(Un,kn)|0,Pt=Pt+Math.imul(_n,Jt)|0,Vt=Vt+Math.imul(_n,kn)|0,Dt=Dt+Math.imul(In,Dn)|0,Pt=Pt+Math.imul(In,Yn)|0,Pt=Pt+Math.imul(Cn,Dn)|0,Vt=Vt+Math.imul(Cn,Yn)|0,Dt=Dt+Math.imul(an,or)|0,Pt=Pt+Math.imul(an,ar)|0,Pt=Pt+Math.imul(Zt,or)|0,Vt=Vt+Math.imul(Zt,ar)|0;var Ar=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,Dt=Math.imul(jn,Or),Pt=Math.imul(jn,Mr),Pt=Pt+Math.imul(Bn,Or)|0,Vt=Math.imul(Bn,Mr),Dt=Dt+Math.imul(Kt,Ur)|0,Pt=Pt+Math.imul(Kt,Lr)|0,Pt=Pt+Math.imul(wn,Ur)|0,Vt=Vt+Math.imul(wn,Lr)|0,Dt=Dt+Math.imul(Sn,Gr)|0,Pt=Pt+Math.imul(Sn,Br)|0,Pt=Pt+Math.imul(tn,Gr)|0,Vt=Vt+Math.imul(tn,Br)|0,Dt=Dt+Math.imul(dn,vn)|0,Pt=Pt+Math.imul(dn,Pn)|0,Pt=Pt+Math.imul(sn,vn)|0,Vt=Vt+Math.imul(sn,Pn)|0,Dt=Dt+Math.imul(gn,Jt)|0,Pt=Pt+Math.imul(gn,kn)|0,Pt=Pt+Math.imul(Tn,Jt)|0,Vt=Vt+Math.imul(Tn,kn)|0,Dt=Dt+Math.imul(Un,Dn)|0,Pt=Pt+Math.imul(Un,Yn)|0,Pt=Pt+Math.imul(_n,Dn)|0,Vt=Vt+Math.imul(_n,Yn)|0,Dt=Dt+Math.imul(In,or)|0,Pt=Pt+Math.imul(In,ar)|0,Pt=Pt+Math.imul(Cn,or)|0,Vt=Vt+Math.imul(Cn,ar)|0;var Nr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,Dt=Math.imul(jn,Ur),Pt=Math.imul(jn,Lr),Pt=Pt+Math.imul(Bn,Ur)|0,Vt=Math.imul(Bn,Lr),Dt=Dt+Math.imul(Kt,Gr)|0,Pt=Pt+Math.imul(Kt,Br)|0,Pt=Pt+Math.imul(wn,Gr)|0,Vt=Vt+Math.imul(wn,Br)|0,Dt=Dt+Math.imul(Sn,vn)|0,Pt=Pt+Math.imul(Sn,Pn)|0,Pt=Pt+Math.imul(tn,vn)|0,Vt=Vt+Math.imul(tn,Pn)|0,Dt=Dt+Math.imul(dn,Jt)|0,Pt=Pt+Math.imul(dn,kn)|0,Pt=Pt+Math.imul(sn,Jt)|0,Vt=Vt+Math.imul(sn,kn)|0,Dt=Dt+Math.imul(gn,Dn)|0,Pt=Pt+Math.imul(gn,Yn)|0,Pt=Pt+Math.imul(Tn,Dn)|0,Vt=Vt+Math.imul(Tn,Yn)|0,Dt=Dt+Math.imul(Un,or)|0,Pt=Pt+Math.imul(Un,ar)|0,Pt=Pt+Math.imul(_n,or)|0,Vt=Vt+Math.imul(_n,ar)|0;var Fr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,Dt=Math.imul(jn,Gr),Pt=Math.imul(jn,Br),Pt=Pt+Math.imul(Bn,Gr)|0,Vt=Math.imul(Bn,Br),Dt=Dt+Math.imul(Kt,vn)|0,Pt=Pt+Math.imul(Kt,Pn)|0,Pt=Pt+Math.imul(wn,vn)|0,Vt=Vt+Math.imul(wn,Pn)|0,Dt=Dt+Math.imul(Sn,Jt)|0,Pt=Pt+Math.imul(Sn,kn)|0,Pt=Pt+Math.imul(tn,Jt)|0,Vt=Vt+Math.imul(tn,kn)|0,Dt=Dt+Math.imul(dn,Dn)|0,Pt=Pt+Math.imul(dn,Yn)|0,Pt=Pt+Math.imul(sn,Dn)|0,Vt=Vt+Math.imul(sn,Yn)|0,Dt=Dt+Math.imul(gn,or)|0,Pt=Pt+Math.imul(gn,ar)|0,Pt=Pt+Math.imul(Tn,or)|0,Vt=Vt+Math.imul(Tn,ar)|0;var Pr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,Dt=Math.imul(jn,vn),Pt=Math.imul(jn,Pn),Pt=Pt+Math.imul(Bn,vn)|0,Vt=Math.imul(Bn,Pn),Dt=Dt+Math.imul(Kt,Jt)|0,Pt=Pt+Math.imul(Kt,kn)|0,Pt=Pt+Math.imul(wn,Jt)|0,Vt=Vt+Math.imul(wn,kn)|0,Dt=Dt+Math.imul(Sn,Dn)|0,Pt=Pt+Math.imul(Sn,Yn)|0,Pt=Pt+Math.imul(tn,Dn)|0,Vt=Vt+Math.imul(tn,Yn)|0,Dt=Dt+Math.imul(dn,or)|0,Pt=Pt+Math.imul(dn,ar)|0,Pt=Pt+Math.imul(sn,or)|0,Vt=Vt+Math.imul(sn,ar)|0;var _i=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(_i>>>26)|0,_i&=67108863,Dt=Math.imul(jn,Jt),Pt=Math.imul(jn,kn),Pt=Pt+Math.imul(Bn,Jt)|0,Vt=Math.imul(Bn,kn),Dt=Dt+Math.imul(Kt,Dn)|0,Pt=Pt+Math.imul(Kt,Yn)|0,Pt=Pt+Math.imul(wn,Dn)|0,Vt=Vt+Math.imul(wn,Yn)|0,Dt=Dt+Math.imul(Sn,or)|0,Pt=Pt+Math.imul(Sn,ar)|0,Pt=Pt+Math.imul(tn,or)|0,Vt=Vt+Math.imul(tn,ar)|0;var nr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(nr>>>26)|0,nr&=67108863,Dt=Math.imul(jn,Dn),Pt=Math.imul(jn,Yn),Pt=Pt+Math.imul(Bn,Dn)|0,Vt=Math.imul(Bn,Yn),Dt=Dt+Math.imul(Kt,or)|0,Pt=Pt+Math.imul(Kt,ar)|0,Pt=Pt+Math.imul(wn,or)|0,Vt=Vt+Math.imul(wn,ar)|0;var xr=(Mt+Dt|0)+((Pt&8191)<<13)|0;Mt=(Vt+(Pt>>>13)|0)+(xr>>>26)|0,xr&=67108863,Dt=Math.imul(jn,or),Pt=Math.imul(jn,ar),Pt=Pt+Math.imul(Bn,or)|0,Vt=Math.imul(Bn,ar);var cr=(Mt+Dt|0)+((Pt&8191)<<13)|0;return Mt=(Vt+(Pt>>>13)|0)+(cr>>>26)|0,cr&=67108863,Bt[0]=Vr,Bt[1]=wr,Bt[2]=jr,Bt[3]=Hr,Bt[4]=no,Bt[5]=Xr,Bt[6]=Jr,Bt[7]=br,Bt[8]=$r,Bt[9]=Dr,Bt[10]=Cr,Bt[11]=Ar,Bt[12]=Nr,Bt[13]=Fr,Bt[14]=Pr,Bt[15]=_i,Bt[16]=nr,Bt[17]=xr,Bt[18]=cr,Mt!==0&&(Bt[19]=Mt,Ct.length++),Ct};Math.imul||(wt=yt);function vt(jt,kt,Tt){Tt.negative=kt.negative^jt.negative,Tt.length=jt.length+kt.length;for(var Ct=0,Ut=0,Nt=0;Nt>>26)|0,Ut+=Bt>>>26,Bt&=67108863}Tt.words[Nt]=Mt,Ct=Bt,Bt=Ut}return Ct!==0?Tt.words[Nt]=Ct:Tt.length--,Tt._strip()}function xt(jt,kt,Tt){return vt(jt,kt,Tt)}ot.prototype.mulTo=function(kt,Tt){var Ct,Ut=this.length+kt.length;return this.length===10&&kt.length===10?Ct=wt(this,kt,Tt):Ut<63?Ct=yt(this,kt,Tt):Ut<1024?Ct=vt(this,kt,Tt):Ct=xt(this,kt,Tt),Ct},ot.prototype.mul=function(kt){var Tt=new ot(null);return Tt.words=new Array(this.length+kt.length),this.mulTo(kt,Tt)},ot.prototype.mulf=function(kt){var Tt=new ot(null);return Tt.words=new Array(this.length+kt.length),xt(this,kt,Tt)},ot.prototype.imul=function(kt){return this.clone().mulTo(kt,this)},ot.prototype.imuln=function(kt){var Tt=kt<0;Tt&&(kt=-kt),it(typeof kt=="number"),it(kt<67108864);for(var Ct=0,Ut=0;Ut>=26,Ct+=Nt/67108864|0,Ct+=Bt>>>26,this.words[Ut]=Bt&67108863}return Ct!==0&&(this.words[Ut]=Ct,this.length++),Tt?this.ineg():this},ot.prototype.muln=function(kt){return this.clone().imuln(kt)},ot.prototype.sqr=function(){return this.mul(this)},ot.prototype.isqr=function(){return this.imul(this.clone())},ot.prototype.pow=function(kt){var Tt=bt(kt);if(Tt.length===0)return new ot(1);for(var Ct=this,Ut=0;Ut=0);var Tt=kt%26,Ct=(kt-Tt)/26,Ut=67108863>>>26-Tt<<26-Tt,Nt;if(Tt!==0){var Bt=0;for(Nt=0;Nt>>26-Tt}Bt&&(this.words[Nt]=Bt,this.length++)}if(Ct!==0){for(Nt=this.length-1;Nt>=0;Nt--)this.words[Nt+Ct]=this.words[Nt];for(Nt=0;Nt=0);var Ut;Tt?Ut=(Tt-Tt%26)/26:Ut=0;var Nt=kt%26,Bt=Math.min((kt-Nt)/26,this.length),Mt=67108863^67108863>>>Nt<Bt)for(this.length-=Bt,Pt=0;Pt=0&&(Vt!==0||Pt>=Ut);Pt--){var nn=this.words[Pt]|0;this.words[Pt]=Vt<<26-Nt|nn>>>Nt,Vt=nn&Mt}return Dt&&Vt!==0&&(Dt.words[Dt.length++]=Vt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},ot.prototype.ishrn=function(kt,Tt,Ct){return it(this.negative===0),this.iushrn(kt,Tt,Ct)},ot.prototype.shln=function(kt){return this.clone().ishln(kt)},ot.prototype.ushln=function(kt){return this.clone().iushln(kt)},ot.prototype.shrn=function(kt){return this.clone().ishrn(kt)},ot.prototype.ushrn=function(kt){return this.clone().iushrn(kt)},ot.prototype.testn=function(kt){it(typeof kt=="number"&&kt>=0);var Tt=kt%26,Ct=(kt-Tt)/26,Ut=1<=0);var Tt=kt%26,Ct=(kt-Tt)/26;if(it(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ct)return this;if(Tt!==0&&Ct++,this.length=Math.min(Ct,this.length),Tt!==0){var Ut=67108863^67108863>>>Tt<=67108864;Tt++)this.words[Tt]-=67108864,Tt===this.length-1?this.words[Tt+1]=1:this.words[Tt+1]++;return this.length=Math.max(this.length,Tt+1),this},ot.prototype.isubn=function(kt){if(it(typeof kt=="number"),it(kt<67108864),kt<0)return this.iaddn(-kt);if(this.negative!==0)return this.negative=0,this.iaddn(kt),this.negative=1,this;if(this.words[0]-=kt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Tt=0;Tt>26)-(Dt/67108864|0),this.words[Nt+Ct]=Bt&67108863}for(;Nt>26,this.words[Nt+Ct]=Bt&67108863;if(Mt===0)return this._strip();for(it(Mt===-1),Mt=0,Nt=0;Nt>26,this.words[Nt]=Bt&67108863;return this.negative=1,this._strip()},ot.prototype._wordDiv=function(kt,Tt){var Ct=this.length-kt.length,Ut=this.clone(),Nt=kt,Bt=Nt.words[Nt.length-1]|0,Mt=this._countBits(Bt);Ct=26-Mt,Ct!==0&&(Nt=Nt.ushln(Ct),Ut.iushln(Ct),Bt=Nt.words[Nt.length-1]|0);var Dt=Ut.length-Nt.length,Pt;if(Tt!=="mod"){Pt=new ot(null),Pt.length=Dt+1,Pt.words=new Array(Pt.length);for(var Vt=0;Vt=0;cn--){var Xt=(Ut.words[Nt.length+cn]|0)*67108864+(Ut.words[Nt.length+cn-1]|0);for(Xt=Math.min(Xt/Bt|0,67108863),Ut._ishlnsubmul(Nt,Xt,cn);Ut.negative!==0;)Xt--,Ut.negative=0,Ut._ishlnsubmul(Nt,1,cn),Ut.isZero()||(Ut.negative^=1);Pt&&(Pt.words[cn]=Xt)}return Pt&&Pt._strip(),Ut._strip(),Tt!=="div"&&Ct!==0&&Ut.iushrn(Ct),{div:Pt||null,mod:Ut}},ot.prototype.divmod=function(kt,Tt,Ct){if(it(!kt.isZero()),this.isZero())return{div:new ot(0),mod:new ot(0)};var Ut,Nt,Bt;return this.negative!==0&&kt.negative===0?(Bt=this.neg().divmod(kt,Tt),Tt!=="mod"&&(Ut=Bt.div.neg()),Tt!=="div"&&(Nt=Bt.mod.neg(),Ct&&Nt.negative!==0&&Nt.iadd(kt)),{div:Ut,mod:Nt}):this.negative===0&&kt.negative!==0?(Bt=this.divmod(kt.neg(),Tt),Tt!=="mod"&&(Ut=Bt.div.neg()),{div:Ut,mod:Bt.mod}):this.negative&kt.negative?(Bt=this.neg().divmod(kt.neg(),Tt),Tt!=="div"&&(Nt=Bt.mod.neg(),Ct&&Nt.negative!==0&&Nt.isub(kt)),{div:Bt.div,mod:Nt}):kt.length>this.length||this.cmp(kt)<0?{div:new ot(0),mod:this}:kt.length===1?Tt==="div"?{div:this.divn(kt.words[0]),mod:null}:Tt==="mod"?{div:null,mod:new ot(this.modrn(kt.words[0]))}:{div:this.divn(kt.words[0]),mod:new ot(this.modrn(kt.words[0]))}:this._wordDiv(kt,Tt)},ot.prototype.div=function(kt){return this.divmod(kt,"div",!1).div},ot.prototype.mod=function(kt){return this.divmod(kt,"mod",!1).mod},ot.prototype.umod=function(kt){return this.divmod(kt,"mod",!0).mod},ot.prototype.divRound=function(kt){var Tt=this.divmod(kt);if(Tt.mod.isZero())return Tt.div;var Ct=Tt.div.negative!==0?Tt.mod.isub(kt):Tt.mod,Ut=kt.ushrn(1),Nt=kt.andln(1),Bt=Ct.cmp(Ut);return Bt<0||Nt===1&&Bt===0?Tt.div:Tt.div.negative!==0?Tt.div.isubn(1):Tt.div.iaddn(1)},ot.prototype.modrn=function(kt){var Tt=kt<0;Tt&&(kt=-kt),it(kt<=67108863);for(var Ct=(1<<26)%kt,Ut=0,Nt=this.length-1;Nt>=0;Nt--)Ut=(Ct*Ut+(this.words[Nt]|0))%kt;return Tt?-Ut:Ut},ot.prototype.modn=function(kt){return this.modrn(kt)},ot.prototype.idivn=function(kt){var Tt=kt<0;Tt&&(kt=-kt),it(kt<=67108863);for(var Ct=0,Ut=this.length-1;Ut>=0;Ut--){var Nt=(this.words[Ut]|0)+Ct*67108864;this.words[Ut]=Nt/kt|0,Ct=Nt%kt}return this._strip(),Tt?this.ineg():this},ot.prototype.divn=function(kt){return this.clone().idivn(kt)},ot.prototype.egcd=function(kt){it(kt.negative===0),it(!kt.isZero());var Tt=this,Ct=kt.clone();Tt.negative!==0?Tt=Tt.umod(kt):Tt=Tt.clone();for(var Ut=new ot(1),Nt=new ot(0),Bt=new ot(0),Mt=new ot(1),Dt=0;Tt.isEven()&&Ct.isEven();)Tt.iushrn(1),Ct.iushrn(1),++Dt;for(var Pt=Ct.clone(),Vt=Tt.clone();!Tt.isZero();){for(var nn=0,cn=1;!(Tt.words[0]&cn)&&nn<26;++nn,cn<<=1);if(nn>0)for(Tt.iushrn(nn);nn-- >0;)(Ut.isOdd()||Nt.isOdd())&&(Ut.iadd(Pt),Nt.isub(Vt)),Ut.iushrn(1),Nt.iushrn(1);for(var Xt=0,un=1;!(Ct.words[0]&un)&&Xt<26;++Xt,un<<=1);if(Xt>0)for(Ct.iushrn(Xt);Xt-- >0;)(Bt.isOdd()||Mt.isOdd())&&(Bt.iadd(Pt),Mt.isub(Vt)),Bt.iushrn(1),Mt.iushrn(1);Tt.cmp(Ct)>=0?(Tt.isub(Ct),Ut.isub(Bt),Nt.isub(Mt)):(Ct.isub(Tt),Bt.isub(Ut),Mt.isub(Nt))}return{a:Bt,b:Mt,gcd:Ct.iushln(Dt)}},ot.prototype._invmp=function(kt){it(kt.negative===0),it(!kt.isZero());var Tt=this,Ct=kt.clone();Tt.negative!==0?Tt=Tt.umod(kt):Tt=Tt.clone();for(var Ut=new ot(1),Nt=new ot(0),Bt=Ct.clone();Tt.cmpn(1)>0&&Ct.cmpn(1)>0;){for(var Mt=0,Dt=1;!(Tt.words[0]&Dt)&&Mt<26;++Mt,Dt<<=1);if(Mt>0)for(Tt.iushrn(Mt);Mt-- >0;)Ut.isOdd()&&Ut.iadd(Bt),Ut.iushrn(1);for(var Pt=0,Vt=1;!(Ct.words[0]&Vt)&&Pt<26;++Pt,Vt<<=1);if(Pt>0)for(Ct.iushrn(Pt);Pt-- >0;)Nt.isOdd()&&Nt.iadd(Bt),Nt.iushrn(1);Tt.cmp(Ct)>=0?(Tt.isub(Ct),Ut.isub(Nt)):(Ct.isub(Tt),Nt.isub(Ut))}var nn;return Tt.cmpn(1)===0?nn=Ut:nn=Nt,nn.cmpn(0)<0&&nn.iadd(kt),nn},ot.prototype.gcd=function(kt){if(this.isZero())return kt.abs();if(kt.isZero())return this.abs();var Tt=this.clone(),Ct=kt.clone();Tt.negative=0,Ct.negative=0;for(var Ut=0;Tt.isEven()&&Ct.isEven();Ut++)Tt.iushrn(1),Ct.iushrn(1);do{for(;Tt.isEven();)Tt.iushrn(1);for(;Ct.isEven();)Ct.iushrn(1);var Nt=Tt.cmp(Ct);if(Nt<0){var Bt=Tt;Tt=Ct,Ct=Bt}else if(Nt===0||Ct.cmpn(1)===0)break;Tt.isub(Ct)}while(!0);return Ct.iushln(Ut)},ot.prototype.invm=function(kt){return this.egcd(kt).a.umod(kt)},ot.prototype.isEven=function(){return(this.words[0]&1)===0},ot.prototype.isOdd=function(){return(this.words[0]&1)===1},ot.prototype.andln=function(kt){return this.words[0]&kt},ot.prototype.bincn=function(kt){it(typeof kt=="number");var Tt=kt%26,Ct=(kt-Tt)/26,Ut=1<>>26,Mt&=67108863,this.words[Bt]=Mt}return Nt!==0&&(this.words[Bt]=Nt,this.length++),this},ot.prototype.isZero=function(){return this.length===1&&this.words[0]===0},ot.prototype.cmpn=function(kt){var Tt=kt<0;if(this.negative!==0&&!Tt)return-1;if(this.negative===0&&Tt)return 1;this._strip();var Ct;if(this.length>1)Ct=1;else{Tt&&(kt=-kt),it(kt<=67108863,"Number is too big");var Ut=this.words[0]|0;Ct=Ut===kt?0:Utkt.length)return 1;if(this.length=0;Ct--){var Ut=this.words[Ct]|0,Nt=kt.words[Ct]|0;if(Ut!==Nt){UtNt&&(Tt=1);break}}return Tt},ot.prototype.gtn=function(kt){return this.cmpn(kt)===1},ot.prototype.gt=function(kt){return this.cmp(kt)===1},ot.prototype.gten=function(kt){return this.cmpn(kt)>=0},ot.prototype.gte=function(kt){return this.cmp(kt)>=0},ot.prototype.ltn=function(kt){return this.cmpn(kt)===-1},ot.prototype.lt=function(kt){return this.cmp(kt)===-1},ot.prototype.lten=function(kt){return this.cmpn(kt)<=0},ot.prototype.lte=function(kt){return this.cmp(kt)<=0},ot.prototype.eqn=function(kt){return this.cmpn(kt)===0},ot.prototype.eq=function(kt){return this.cmp(kt)===0},ot.red=function(kt){return new zt(kt)},ot.prototype.toRed=function(kt){return it(!this.red,"Already a number in reduction context"),it(this.negative===0,"red works only with positives"),kt.convertTo(this)._forceRed(kt)},ot.prototype.fromRed=function(){return it(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},ot.prototype._forceRed=function(kt){return this.red=kt,this},ot.prototype.forceRed=function(kt){return it(!this.red,"Already a number in reduction context"),this._forceRed(kt)},ot.prototype.redAdd=function(kt){return it(this.red,"redAdd works only with red numbers"),this.red.add(this,kt)},ot.prototype.redIAdd=function(kt){return it(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,kt)},ot.prototype.redSub=function(kt){return it(this.red,"redSub works only with red numbers"),this.red.sub(this,kt)},ot.prototype.redISub=function(kt){return it(this.red,"redISub works only with red numbers"),this.red.isub(this,kt)},ot.prototype.redShl=function(kt){return it(this.red,"redShl works only with red numbers"),this.red.shl(this,kt)},ot.prototype.redMul=function(kt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,kt),this.red.mul(this,kt)},ot.prototype.redIMul=function(kt){return it(this.red,"redMul works only with red numbers"),this.red._verify2(this,kt),this.red.imul(this,kt)},ot.prototype.redSqr=function(){return it(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},ot.prototype.redISqr=function(){return it(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},ot.prototype.redSqrt=function(){return it(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},ot.prototype.redInvm=function(){return it(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},ot.prototype.redNeg=function(){return it(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},ot.prototype.redPow=function(kt){return it(this.red&&!kt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,kt)};var St={k256:null,p224:null,p192:null,p25519:null};function Et(jt,kt){this.name=jt,this.p=new ot(kt,16),this.n=this.p.bitLength(),this.k=new ot(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Et.prototype._tmp=function(){var kt=new ot(null);return kt.words=new Array(Math.ceil(this.n/13)),kt},Et.prototype.ireduce=function(kt){var Tt=kt,Ct;do this.split(Tt,this.tmp),Tt=this.imulK(Tt),Tt=Tt.iadd(this.tmp),Ct=Tt.bitLength();while(Ct>this.n);var Ut=Ct0?Tt.isub(this.p):Tt.strip!==void 0?Tt.strip():Tt._strip(),Tt},Et.prototype.split=function(kt,Tt){kt.iushrn(this.n,0,Tt)},Et.prototype.imulK=function(kt){return kt.imul(this.k)};function $t(){Et.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}rt($t,Et),$t.prototype.split=function(kt,Tt){for(var Ct=4194303,Ut=Math.min(kt.length,9),Nt=0;Nt>>22,Bt=Mt}Bt>>>=22,kt.words[Nt-10]=Bt,Bt===0&&kt.length>10?kt.length-=10:kt.length-=9},$t.prototype.imulK=function(kt){kt.words[kt.length]=0,kt.words[kt.length+1]=0,kt.length+=2;for(var Tt=0,Ct=0;Ct>>=26,kt.words[Ct]=Nt,Tt=Ut}return Tt!==0&&(kt.words[kt.length++]=Tt),kt},ot._prime=function(kt){if(St[kt])return St[kt];var Tt;if(kt==="k256")Tt=new $t;else if(kt==="p224")Tt=new It;else if(kt==="p192")Tt=new Ft;else if(kt==="p25519")Tt=new Ht;else throw new Error("Unknown prime "+kt);return St[kt]=Tt,Tt};function zt(jt){if(typeof jt=="string"){var kt=ot._prime(jt);this.m=kt.p,this.prime=kt}else it(jt.gtn(1),"modulus must be greater than 1"),this.m=jt,this.prime=null}zt.prototype._verify1=function(kt){it(kt.negative===0,"red works only with positives"),it(kt.red,"red works only with red numbers")},zt.prototype._verify2=function(kt,Tt){it((kt.negative|Tt.negative)===0,"red works only with positives"),it(kt.red&&kt.red===Tt.red,"red works only with red numbers")},zt.prototype.imod=function(kt){return this.prime?this.prime.ireduce(kt)._forceRed(this):(ut(kt,kt.umod(this.m)._forceRed(this)),kt)},zt.prototype.neg=function(kt){return kt.isZero()?kt.clone():this.m.sub(kt)._forceRed(this)},zt.prototype.add=function(kt,Tt){this._verify2(kt,Tt);var Ct=kt.add(Tt);return Ct.cmp(this.m)>=0&&Ct.isub(this.m),Ct._forceRed(this)},zt.prototype.iadd=function(kt,Tt){this._verify2(kt,Tt);var Ct=kt.iadd(Tt);return Ct.cmp(this.m)>=0&&Ct.isub(this.m),Ct},zt.prototype.sub=function(kt,Tt){this._verify2(kt,Tt);var Ct=kt.sub(Tt);return Ct.cmpn(0)<0&&Ct.iadd(this.m),Ct._forceRed(this)},zt.prototype.isub=function(kt,Tt){this._verify2(kt,Tt);var Ct=kt.isub(Tt);return Ct.cmpn(0)<0&&Ct.iadd(this.m),Ct},zt.prototype.shl=function(kt,Tt){return this._verify1(kt),this.imod(kt.ushln(Tt))},zt.prototype.imul=function(kt,Tt){return this._verify2(kt,Tt),this.imod(kt.imul(Tt))},zt.prototype.mul=function(kt,Tt){return this._verify2(kt,Tt),this.imod(kt.mul(Tt))},zt.prototype.isqr=function(kt){return this.imul(kt,kt.clone())},zt.prototype.sqr=function(kt){return this.mul(kt,kt)},zt.prototype.sqrt=function(kt){if(kt.isZero())return kt.clone();var Tt=this.m.andln(3);if(it(Tt%2===1),Tt===3){var Ct=this.m.add(new ot(1)).iushrn(2);return this.pow(kt,Ct)}for(var Ut=this.m.subn(1),Nt=0;!Ut.isZero()&&Ut.andln(1)===0;)Nt++,Ut.iushrn(1);it(!Ut.isZero());var Bt=new ot(1).toRed(this),Mt=Bt.redNeg(),Dt=this.m.subn(1).iushrn(1),Pt=this.m.bitLength();for(Pt=new ot(2*Pt*Pt).toRed(this);this.pow(Pt,Dt).cmp(Mt)!==0;)Pt.redIAdd(Mt);for(var Vt=this.pow(Pt,Ut),nn=this.pow(kt,Ut.addn(1).iushrn(1)),cn=this.pow(kt,Ut),Xt=Nt;cn.cmp(Bt)!==0;){for(var un=cn,en=0;un.cmp(Bt)!==0;en++)un=un.redSqr();it(en=0;Nt--){for(var Vt=Tt.words[Nt],nn=Pt-1;nn>=0;nn--){var cn=Vt>>nn&1;if(Bt!==Ut[0]&&(Bt=this.sqr(Bt)),cn===0&&Mt===0){Dt=0;continue}Mt<<=1,Mt|=cn,Dt++,!(Dt!==Ct&&(Nt!==0||nn!==0))&&(Bt=this.mul(Bt,Ut[Mt]),Dt=0,Mt=0)}Pt=26}return Bt},zt.prototype.convertTo=function(kt){var Tt=kt.umod(this.m);return Tt===kt?Tt.clone():Tt},zt.prototype.convertFrom=function(kt){var Tt=kt.clone();return Tt.red=null,Tt},ot.mont=function(kt){return new Ot(kt)};function Ot(jt){zt.call(this,jt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new ot(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}rt(Ot,zt),Ot.prototype.convertTo=function(kt){return this.imod(kt.ushln(this.shift))},Ot.prototype.convertFrom=function(kt){var Tt=this.imod(kt.mul(this.rinv));return Tt.red=null,Tt},Ot.prototype.imul=function(kt,Tt){if(kt.isZero()||Tt.isZero())return kt.words[0]=0,kt.length=1,kt;var Ct=kt.imul(Tt),Ut=Ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Nt=Ct.isub(Ut).iushrn(this.shift),Bt=Nt;return Nt.cmp(this.m)>=0?Bt=Nt.isub(this.m):Nt.cmpn(0)<0&&(Bt=Nt.iadd(this.m)),Bt._forceRed(this)},Ot.prototype.mul=function(kt,Tt){if(kt.isZero()||Tt.isZero())return new ot(0)._forceRed(this);var Ct=kt.mul(Tt),Ut=Ct.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Nt=Ct.isub(Ut).iushrn(this.shift),Bt=Nt;return Nt.cmp(this.m)>=0?Bt=Nt.isub(this.m):Nt.cmpn(0)<0&&(Bt=Nt.iadd(this.m)),Bt._forceRed(this)},Ot.prototype.invm=function(kt){var Tt=this.imod(kt._invmp(this.m).mul(this.r2));return Tt._forceRed(this)}})(tt,commonjsGlobal)})(bn);var bnExports=bn.exports,asn1$3={},asn1$2={},api={},encoders={},buffer$1=buffer$2,Buffer$d=buffer$1.Buffer,safer={},key;for(key in buffer$1)buffer$1.hasOwnProperty(key)&&(key==="SlowBuffer"||key==="Buffer"||(safer[key]=buffer$1[key]));var Safer=safer.Buffer={};for(key in Buffer$d)Buffer$d.hasOwnProperty(key)&&(key==="allocUnsafe"||key==="allocUnsafeSlow"||(Safer[key]=Buffer$d[key]));safer.Buffer.prototype=Buffer$d.prototype;(!Safer.from||Safer.from===Uint8Array.from)&&(Safer.from=function(tt,et,nt){if(typeof tt=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof tt);if(tt&&typeof tt.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof tt);return Buffer$d(tt,et,nt)});Safer.alloc||(Safer.alloc=function(tt,et,nt){if(typeof tt!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof tt);if(tt<0||tt>=2*(1<<30))throw new RangeError('The value "'+tt+'" is invalid for option "size"');var it=Buffer$d(tt);return!et||et.length===0?it.fill(0):typeof nt=="string"?it.fill(et,nt):it.fill(et),it});if(!safer.kStringMaxLength)try{safer.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}safer.constants||(safer.constants={MAX_LENGTH:safer.kMaxLength},safer.kStringMaxLength&&(safer.constants.MAX_STRING_LENGTH=safer.kStringMaxLength));var safer_1=safer,reporter={};const inherits$6=inherits_browserExports;function Reporter$2(tt){this._reporterState={obj:null,path:[],options:tt||{},errors:[]}}reporter.Reporter=Reporter$2;Reporter$2.prototype.isError=function(et){return et instanceof ReporterError};Reporter$2.prototype.save=function(){const et=this._reporterState;return{obj:et.obj,pathLen:et.path.length}};Reporter$2.prototype.restore=function(et){const nt=this._reporterState;nt.obj=et.obj,nt.path=nt.path.slice(0,et.pathLen)};Reporter$2.prototype.enterKey=function(et){return this._reporterState.path.push(et)};Reporter$2.prototype.exitKey=function(et){const nt=this._reporterState;nt.path=nt.path.slice(0,et-1)};Reporter$2.prototype.leaveKey=function(et,nt,it){const rt=this._reporterState;this.exitKey(et),rt.obj!==null&&(rt.obj[nt]=it)};Reporter$2.prototype.path=function(){return this._reporterState.path.join("/")};Reporter$2.prototype.enterObject=function(){const et=this._reporterState,nt=et.obj;return et.obj={},nt};Reporter$2.prototype.leaveObject=function(et){const nt=this._reporterState,it=nt.obj;return nt.obj=et,it};Reporter$2.prototype.error=function(et){let nt;const it=this._reporterState,rt=et instanceof ReporterError;if(rt?nt=et:nt=new ReporterError(it.path.map(function(ot){return"["+JSON.stringify(ot)+"]"}).join(""),et.message||et,et.stack),!it.options.partial)throw nt;return rt||it.errors.push(nt),nt};Reporter$2.prototype.wrapResult=function(et){const nt=this._reporterState;return nt.options.partial?{result:this.isError(et)?null:et,errors:nt.errors}:et};function ReporterError(tt,et){this.path=tt,this.rethrow(et)}inherits$6(ReporterError,Error);ReporterError.prototype.rethrow=function(et){if(this.message=et+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(nt){this.stack=nt.stack}return this};var buffer={};const inherits$5=inherits_browserExports,Reporter$1=reporter.Reporter,Buffer$c=safer_1.Buffer;function DecoderBuffer$2(tt,et){if(Reporter$1.call(this,et),!Buffer$c.isBuffer(tt)){this.error("Input not Buffer");return}this.base=tt,this.offset=0,this.length=tt.length}inherits$5(DecoderBuffer$2,Reporter$1);buffer.DecoderBuffer=DecoderBuffer$2;DecoderBuffer$2.isDecoderBuffer=function(et){return et instanceof DecoderBuffer$2?!0:typeof et=="object"&&Buffer$c.isBuffer(et.base)&&et.constructor.name==="DecoderBuffer"&&typeof et.offset=="number"&&typeof et.length=="number"&&typeof et.save=="function"&&typeof et.restore=="function"&&typeof et.isEmpty=="function"&&typeof et.readUInt8=="function"&&typeof et.skip=="function"&&typeof et.raw=="function"};DecoderBuffer$2.prototype.save=function(){return{offset:this.offset,reporter:Reporter$1.prototype.save.call(this)}};DecoderBuffer$2.prototype.restore=function(et){const nt=new DecoderBuffer$2(this.base);return nt.offset=et.offset,nt.length=this.offset,this.offset=et.offset,Reporter$1.prototype.restore.call(this,et.reporter),nt};DecoderBuffer$2.prototype.isEmpty=function(){return this.offset===this.length};DecoderBuffer$2.prototype.readUInt8=function(et){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(et||"DecoderBuffer overrun")};DecoderBuffer$2.prototype.skip=function(et,nt){if(!(this.offset+et<=this.length))return this.error(nt||"DecoderBuffer overrun");const it=new DecoderBuffer$2(this.base);return it._reporterState=this._reporterState,it.offset=this.offset,it.length=this.offset+et,this.offset+=et,it};DecoderBuffer$2.prototype.raw=function(et){return this.base.slice(et?et.offset:this.offset,this.length)};function EncoderBuffer$1(tt,et){if(Array.isArray(tt))this.length=0,this.value=tt.map(function(nt){return EncoderBuffer$1.isEncoderBuffer(nt)||(nt=new EncoderBuffer$1(nt,et)),this.length+=nt.length,nt},this);else if(typeof tt=="number"){if(!(0<=tt&&tt<=255))return et.error("non-byte EncoderBuffer value");this.value=tt,this.length=1}else if(typeof tt=="string")this.value=tt,this.length=Buffer$c.byteLength(tt);else if(Buffer$c.isBuffer(tt))this.value=tt,this.length=tt.length;else return et.error("Unsupported type: "+typeof tt)}buffer.EncoderBuffer=EncoderBuffer$1;EncoderBuffer$1.isEncoderBuffer=function(et){return et instanceof EncoderBuffer$1?!0:typeof et=="object"&&et.constructor.name==="EncoderBuffer"&&typeof et.length=="number"&&typeof et.join=="function"};EncoderBuffer$1.prototype.join=function(et,nt){return et||(et=Buffer$c.alloc(this.length)),nt||(nt=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(it){it.join(et,nt),nt+=it.length}):(typeof this.value=="number"?et[nt]=this.value:typeof this.value=="string"?et.write(this.value,nt):Buffer$c.isBuffer(this.value)&&this.value.copy(et,nt),nt+=this.length)),et};const Reporter=reporter.Reporter,EncoderBuffer=buffer.EncoderBuffer,DecoderBuffer$1=buffer.DecoderBuffer,assert$5=minimalisticAssert,tags$1=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags$1),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node$3(tt,et,nt){const it={};this._baseState=it,it.name=nt,it.enc=tt,it.parent=et||null,it.children=null,it.tag=null,it.args=null,it.reverseArgs=null,it.choice=null,it.optional=!1,it.any=!1,it.obj=!1,it.use=null,it.useDecoder=null,it.key=null,it.default=null,it.explicit=null,it.implicit=null,it.contains=null,it.parent||(it.children=[],this._wrap())}var node$3=Node$3;const stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node$3.prototype.clone=function(){const et=this._baseState,nt={};stateProps.forEach(function(rt){nt[rt]=et[rt]});const it=new this.constructor(nt.parent);return it._baseState=nt,it};Node$3.prototype._wrap=function(){const et=this._baseState;methods.forEach(function(nt){this[nt]=function(){const rt=new this.constructor(this);return et.children.push(rt),rt[nt].apply(rt,arguments)}},this)};Node$3.prototype._init=function(et){const nt=this._baseState;assert$5(nt.parent===null),et.call(this),nt.children=nt.children.filter(function(it){return it._baseState.parent===this},this),assert$5.equal(nt.children.length,1,"Root node can have only one child")};Node$3.prototype._useArgs=function(et){const nt=this._baseState,it=et.filter(function(rt){return rt instanceof this.constructor},this);et=et.filter(function(rt){return!(rt instanceof this.constructor)},this),it.length!==0&&(assert$5(nt.children===null),nt.children=it,it.forEach(function(rt){rt._baseState.parent=this},this)),et.length!==0&&(assert$5(nt.args===null),nt.args=et,nt.reverseArgs=et.map(function(rt){if(typeof rt!="object"||rt.constructor!==Object)return rt;const ot={};return Object.keys(rt).forEach(function(at){at==(at|0)&&(at|=0);const st=rt[at];ot[st]=at}),ot}))};overrided.forEach(function(tt){Node$3.prototype[tt]=function(){const nt=this._baseState;throw new Error(tt+" not implemented for encoding: "+nt.enc)}});tags$1.forEach(function(tt){Node$3.prototype[tt]=function(){const nt=this._baseState,it=Array.prototype.slice.call(arguments);return assert$5(nt.tag===null),nt.tag=tt,this._useArgs(it),this}});Node$3.prototype.use=function(et){assert$5(et);const nt=this._baseState;return assert$5(nt.use===null),nt.use=et,this};Node$3.prototype.optional=function(){const et=this._baseState;return et.optional=!0,this};Node$3.prototype.def=function(et){const nt=this._baseState;return assert$5(nt.default===null),nt.default=et,nt.optional=!0,this};Node$3.prototype.explicit=function(et){const nt=this._baseState;return assert$5(nt.explicit===null&&nt.implicit===null),nt.explicit=et,this};Node$3.prototype.implicit=function(et){const nt=this._baseState;return assert$5(nt.explicit===null&&nt.implicit===null),nt.implicit=et,this};Node$3.prototype.obj=function(){const et=this._baseState,nt=Array.prototype.slice.call(arguments);return et.obj=!0,nt.length!==0&&this._useArgs(nt),this};Node$3.prototype.key=function(et){const nt=this._baseState;return assert$5(nt.key===null),nt.key=et,this};Node$3.prototype.any=function(){const et=this._baseState;return et.any=!0,this};Node$3.prototype.choice=function(et){const nt=this._baseState;return assert$5(nt.choice===null),nt.choice=et,this._useArgs(Object.keys(et).map(function(it){return et[it]})),this};Node$3.prototype.contains=function(et){const nt=this._baseState;return assert$5(nt.use===null),nt.contains=et,this};Node$3.prototype._decode=function(et,nt){const it=this._baseState;if(it.parent===null)return et.wrapResult(it.children[0]._decode(et,nt));let rt=it.default,ot=!0,at=null;if(it.key!==null&&(at=et.enterKey(it.key)),it.optional){let lt=null;if(it.explicit!==null?lt=it.explicit:it.implicit!==null?lt=it.implicit:it.tag!==null&&(lt=it.tag),lt===null&&!it.any){const ct=et.save();try{it.choice===null?this._decodeGeneric(it.tag,et,nt):this._decodeChoice(et,nt),ot=!0}catch{ot=!1}et.restore(ct)}else if(ot=this._peekTag(et,lt,it.any),et.isError(ot))return ot}let st;if(it.obj&&ot&&(st=et.enterObject()),ot){if(it.explicit!==null){const ct=this._decodeTag(et,it.explicit);if(et.isError(ct))return ct;et=ct}const lt=et.offset;if(it.use===null&&it.choice===null){let ct;it.any&&(ct=et.save());const ut=this._decodeTag(et,it.implicit!==null?it.implicit:it.tag,it.any);if(et.isError(ut))return ut;it.any?rt=et.raw(ct):et=ut}if(nt&&nt.track&&it.tag!==null&&nt.track(et.path(),lt,et.length,"tagged"),nt&&nt.track&&it.tag!==null&&nt.track(et.path(),et.offset,et.length,"content"),it.any||(it.choice===null?rt=this._decodeGeneric(it.tag,et,nt):rt=this._decodeChoice(et,nt)),et.isError(rt))return rt;if(!it.any&&it.choice===null&&it.children!==null&&it.children.forEach(function(ut){ut._decode(et,nt)}),it.contains&&(it.tag==="octstr"||it.tag==="bitstr")){const ct=new DecoderBuffer$1(rt);rt=this._getUse(it.contains,et._reporterState.obj)._decode(ct,nt)}}return it.obj&&ot&&(rt=et.leaveObject(st)),it.key!==null&&(rt!==null||ot===!0)?et.leaveKey(at,it.key,rt):at!==null&&et.exitKey(at),rt};Node$3.prototype._decodeGeneric=function(et,nt,it){const rt=this._baseState;return et==="seq"||et==="set"?null:et==="seqof"||et==="setof"?this._decodeList(nt,et,rt.args[0],it):/str$/.test(et)?this._decodeStr(nt,et,it):et==="objid"&&rt.args?this._decodeObjid(nt,rt.args[0],rt.args[1],it):et==="objid"?this._decodeObjid(nt,null,null,it):et==="gentime"||et==="utctime"?this._decodeTime(nt,et,it):et==="null_"?this._decodeNull(nt,it):et==="bool"?this._decodeBool(nt,it):et==="objDesc"?this._decodeStr(nt,et,it):et==="int"||et==="enum"?this._decodeInt(nt,rt.args&&rt.args[0],it):rt.use!==null?this._getUse(rt.use,nt._reporterState.obj)._decode(nt,it):nt.error("unknown tag: "+et)};Node$3.prototype._getUse=function(et,nt){const it=this._baseState;return it.useDecoder=this._use(et,nt),assert$5(it.useDecoder._baseState.parent===null),it.useDecoder=it.useDecoder._baseState.children[0],it.implicit!==it.useDecoder._baseState.implicit&&(it.useDecoder=it.useDecoder.clone(),it.useDecoder._baseState.implicit=it.implicit),it.useDecoder};Node$3.prototype._decodeChoice=function(et,nt){const it=this._baseState;let rt=null,ot=!1;return Object.keys(it.choice).some(function(at){const st=et.save(),lt=it.choice[at];try{const ct=lt._decode(et,nt);if(et.isError(ct))return!1;rt={type:at,value:ct},ot=!0}catch{return et.restore(st),!1}return!0},this),ot?rt:et.error("Choice not matched")};Node$3.prototype._createEncoderBuffer=function(et){return new EncoderBuffer(et,this.reporter)};Node$3.prototype._encode=function(et,nt,it){const rt=this._baseState;if(rt.default!==null&&rt.default===et)return;const ot=this._encodeValue(et,nt,it);if(ot!==void 0&&!this._skipDefault(ot,nt,it))return ot};Node$3.prototype._encodeValue=function(et,nt,it){const rt=this._baseState;if(rt.parent===null)return rt.children[0]._encode(et,nt||new Reporter);let ot=null;if(this.reporter=nt,rt.optional&&et===void 0)if(rt.default!==null)et=rt.default;else return;let at=null,st=!1;if(rt.any)ot=this._createEncoderBuffer(et);else if(rt.choice)ot=this._encodeChoice(et,nt);else if(rt.contains)at=this._getUse(rt.contains,it)._encode(et,nt),st=!0;else if(rt.children)at=rt.children.map(function(lt){if(lt._baseState.tag==="null_")return lt._encode(null,nt,et);if(lt._baseState.key===null)return nt.error("Child should have a key");const ct=nt.enterKey(lt._baseState.key);if(typeof et!="object")return nt.error("Child expected, but input is not object");const ut=lt._encode(et[lt._baseState.key],nt,et);return nt.leaveKey(ct),ut},this).filter(function(lt){return lt}),at=this._createEncoderBuffer(at);else if(rt.tag==="seqof"||rt.tag==="setof"){if(!(rt.args&&rt.args.length===1))return nt.error("Too many args for : "+rt.tag);if(!Array.isArray(et))return nt.error("seqof/setof, but data is not Array");const lt=this.clone();lt._baseState.implicit=null,at=this._createEncoderBuffer(et.map(function(ct){const ut=this._baseState;return this._getUse(ut.args[0],et)._encode(ct,nt)},lt))}else rt.use!==null?ot=this._getUse(rt.use,it)._encode(et,nt):(at=this._encodePrimitive(rt.tag,et),st=!0);if(!rt.any&&rt.choice===null){const lt=rt.implicit!==null?rt.implicit:rt.tag,ct=rt.implicit===null?"universal":"context";lt===null?rt.use===null&&nt.error("Tag could be omitted only for .use()"):rt.use===null&&(ot=this._encodeComposite(lt,st,ct,at))}return rt.explicit!==null&&(ot=this._encodeComposite(rt.explicit,!1,"context",ot)),ot};Node$3.prototype._encodeChoice=function(et,nt){const it=this._baseState,rt=it.choice[et.type];return rt||assert$5(!1,et.type+" not found in "+JSON.stringify(Object.keys(it.choice))),rt._encode(et.value,nt)};Node$3.prototype._encodePrimitive=function(et,nt){const it=this._baseState;if(/str$/.test(et))return this._encodeStr(nt,et);if(et==="objid"&&it.args)return this._encodeObjid(nt,it.reverseArgs[0],it.args[1]);if(et==="objid")return this._encodeObjid(nt,null,null);if(et==="gentime"||et==="utctime")return this._encodeTime(nt,et);if(et==="null_")return this._encodeNull();if(et==="int"||et==="enum")return this._encodeInt(nt,it.args&&it.reverseArgs[0]);if(et==="bool")return this._encodeBool(nt);if(et==="objDesc")return this._encodeStr(nt,et);throw new Error("Unsupported tag: "+et)};Node$3.prototype._isNumstr=function(et){return/^[0-9 ]*$/.test(et)};Node$3.prototype._isPrintstr=function(et){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(et)};var der$2={};(function(tt){function et(nt){const it={};return Object.keys(nt).forEach(function(rt){(rt|0)==rt&&(rt=rt|0);const ot=nt[rt];it[ot]=rt}),it}tt.tagClass={0:"universal",1:"application",2:"context",3:"private"},tt.tagClassByName=et(tt.tagClass),tt.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},tt.tagByName=et(tt.tag)})(der$2);const inherits$4=inherits_browserExports,Buffer$b=safer_1.Buffer,Node$2=node$3,der$1=der$2;function DEREncoder$1(tt){this.enc="der",this.name=tt.name,this.entity=tt,this.tree=new DERNode$1,this.tree._init(tt.body)}var der_1$1=DEREncoder$1;DEREncoder$1.prototype.encode=function(et,nt){return this.tree._encode(et,nt).join()};function DERNode$1(tt){Node$2.call(this,"der",tt)}inherits$4(DERNode$1,Node$2);DERNode$1.prototype._encodeComposite=function(et,nt,it,rt){const ot=encodeTag(et,nt,it,this.reporter);if(rt.length<128){const lt=Buffer$b.alloc(2);return lt[0]=ot,lt[1]=rt.length,this._createEncoderBuffer([lt,rt])}let at=1;for(let lt=rt.length;lt>=256;lt>>=8)at++;const st=Buffer$b.alloc(1+1+at);st[0]=ot,st[1]=128|at;for(let lt=1+at,ct=rt.length;ct>0;lt--,ct>>=8)st[lt]=ct&255;return this._createEncoderBuffer([st,rt])};DERNode$1.prototype._encodeStr=function(et,nt){if(nt==="bitstr")return this._createEncoderBuffer([et.unused|0,et.data]);if(nt==="bmpstr"){const it=Buffer$b.alloc(et.length*2);for(let rt=0;rt=40)return this.reporter.error("Second objid identifier OOB");et.splice(0,2,et[0]*40+et[1])}let rt=0;for(let st=0;st=128;lt>>=7)rt++}const ot=Buffer$b.alloc(rt);let at=ot.length-1;for(let st=et.length-1;st>=0;st--){let lt=et[st];for(ot[at--]=lt&127;(lt>>=7)>0;)ot[at--]=128|lt&127}return this._createEncoderBuffer(ot)};function two(tt){return tt<10?"0"+tt:tt}DERNode$1.prototype._encodeTime=function(et,nt){let it;const rt=new Date(et);return nt==="gentime"?it=[two(rt.getUTCFullYear()),two(rt.getUTCMonth()+1),two(rt.getUTCDate()),two(rt.getUTCHours()),two(rt.getUTCMinutes()),two(rt.getUTCSeconds()),"Z"].join(""):nt==="utctime"?it=[two(rt.getUTCFullYear()%100),two(rt.getUTCMonth()+1),two(rt.getUTCDate()),two(rt.getUTCHours()),two(rt.getUTCMinutes()),two(rt.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+nt+" time is not supported yet"),this._encodeStr(it,"octstr")};DERNode$1.prototype._encodeNull=function(){return this._createEncoderBuffer("")};DERNode$1.prototype._encodeInt=function(et,nt){if(typeof et=="string"){if(!nt)return this.reporter.error("String int or enum given, but no values map");if(!nt.hasOwnProperty(et))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(et));et=nt[et]}if(typeof et!="number"&&!Buffer$b.isBuffer(et)){const ot=et.toArray();!et.sign&&ot[0]&128&&ot.unshift(0),et=Buffer$b.from(ot)}if(Buffer$b.isBuffer(et)){let ot=et.length;et.length===0&&ot++;const at=Buffer$b.alloc(ot);return et.copy(at),et.length===0&&(at[0]=0),this._createEncoderBuffer(at)}if(et<128)return this._createEncoderBuffer(et);if(et<256)return this._createEncoderBuffer([0,et]);let it=1;for(let ot=et;ot>=256;ot>>=8)it++;const rt=new Array(it);for(let ot=rt.length-1;ot>=0;ot--)rt[ot]=et&255,et>>=8;return rt[0]&128&&rt.unshift(0),this._createEncoderBuffer(Buffer$b.from(rt))};DERNode$1.prototype._encodeBool=function(et){return this._createEncoderBuffer(et?255:0)};DERNode$1.prototype._use=function(et,nt){return typeof et=="function"&&(et=et(nt)),et._getEncoder("der").tree};DERNode$1.prototype._skipDefault=function(et,nt,it){const rt=this._baseState;let ot;if(rt.default===null)return!1;const at=et.join();if(rt.defaultBuffer===void 0&&(rt.defaultBuffer=this._encodeValue(rt.default,nt,it).join()),at.length!==rt.defaultBuffer.length)return!1;for(ot=0;ot=31?it.error("Multi-octet tag encoding unsupported"):(et||(rt|=32),rt|=der$1.tagClassByName[nt||"universal"]<<6,rt)}const inherits$3=inherits_browserExports,DEREncoder=der_1$1;function PEMEncoder(tt){DEREncoder.call(this,tt),this.enc="pem"}inherits$3(PEMEncoder,DEREncoder);var pem$1=PEMEncoder;PEMEncoder.prototype.encode=function(et,nt){const rt=DEREncoder.prototype.encode.call(this,et).toString("base64"),ot=["-----BEGIN "+nt.label+"-----"];for(let at=0;at>6],rt=(nt&32)===0;if((nt&31)===31){let at=nt;for(nt=0;(at&128)===128;){if(at=tt.readUInt8(et),tt.isError(at))return at;nt<<=7,nt|=at&127}}else nt&=31;const ot=der.tag[nt];return{cls:it,primitive:rt,tag:nt,tagStr:ot}}function derDecodeLen(tt,et,nt){let it=tt.readUInt8(nt);if(tt.isError(it))return it;if(!et&&it===128)return null;if(!(it&128))return it;const rt=it&127;if(rt>4)return tt.error("length octect is too long");it=0;for(let ot=0;ot0&&vt.ishrn(xt),vt}function mt(yt,wt){yt=pt(yt,wt),yt=yt.mod(wt);var vt=tt.from(yt.toArray());if(vt.length=0)throw new Error("invalid sig")}return verify_1=ot,verify_1}var browser$3,hasRequiredBrowser$1;function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$3;hasRequiredBrowser$1=1;var tt=safeBufferExports.Buffer,et=browser$9,nt=readableBrowserExports,it=inherits_browserExports,rt=requireSign(),ot=requireVerify(),at=require$$6;Object.keys(at).forEach(function(ht){at[ht].id=tt.from(at[ht].id,"hex"),at[ht.toLowerCase()]=at[ht]});function st(ht){nt.Writable.call(this);var dt=at[ht];if(!dt)throw new Error("Unknown message digest");this._hashType=dt.hash,this._hash=et(dt.hash),this._tag=dt.id,this._signType=dt.sign}it(st,nt.Writable),st.prototype._write=function(dt,pt,mt){this._hash.update(dt),mt()},st.prototype.update=function(dt,pt){return this._hash.update(typeof dt=="string"?tt.from(dt,pt):dt),this},st.prototype.sign=function(dt,pt){this.end();var mt=this._hash.digest(),gt=rt(mt,dt,this._hashType,this._signType,this._tag);return pt?gt.toString(pt):gt};function lt(ht){nt.Writable.call(this);var dt=at[ht];if(!dt)throw new Error("Unknown message digest");this._hash=et(dt.hash),this._tag=dt.id,this._signType=dt.sign}it(lt,nt.Writable),lt.prototype._write=function(dt,pt,mt){this._hash.update(dt),mt()},lt.prototype.update=function(dt,pt){return this._hash.update(typeof dt=="string"?tt.from(dt,pt):dt),this},lt.prototype.verify=function(dt,pt,mt){var gt=typeof pt=="string"?tt.from(pt,mt):pt;this.end();var bt=this._hash.digest();return ot(gt,bt,dt,this._signType,this._tag)};function ct(ht){return new st(ht)}function ut(ht){return new lt(ht)}return browser$3={Sign:ct,Verify:ut,createSign:ct,createVerify:ut},browser$3}var browser$2,hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser$2;hasRequiredBrowser=1;var tt=requireElliptic(),et=bnExports$2;browser$2=function(at){return new it(at)};var nt={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};nt.p224=nt.secp224r1,nt.p256=nt.secp256r1=nt.prime256v1,nt.p192=nt.secp192r1=nt.prime192v1,nt.p384=nt.secp384r1,nt.p521=nt.secp521r1;function it(ot){this.curveType=nt[ot],this.curveType||(this.curveType={name:ot}),this.curve=new tt.ec(this.curveType.name),this.keys=void 0}it.prototype.generateKeys=function(ot,at){return this.keys=this.curve.genKeyPair(),this.getPublicKey(ot,at)},it.prototype.computeSecret=function(ot,at,st){at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at));var lt=this.curve.keyFromPublic(ot).getPublic(),ct=lt.mul(this.keys.getPrivate()).getX();return rt(ct,st,this.curveType.byteLength)},it.prototype.getPublicKey=function(ot,at){var st=this.keys.getPublic(at==="compressed",!0);return at==="hybrid"&&(st[st.length-1]%2?st[0]=7:st[0]=6),rt(st,ot)},it.prototype.getPrivateKey=function(ot){return rt(this.keys.getPrivate(),ot)},it.prototype.setPublicKey=function(ot,at){return at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at)),this.keys._importPublic(ot),this},it.prototype.setPrivateKey=function(ot,at){at=at||"utf8",Buffer.isBuffer(ot)||(ot=new Buffer(ot,at));var st=new et(ot);return st=st.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(st),this};function rt(ot,at,st){Array.isArray(ot)||(ot=ot.toArray());var lt=new Buffer(ot);if(st&<.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return it?crt$1(at,ot):withPublic$1(at,ot)};function oaep$1(tt,et){var nt=tt.modulus.byteLength(),it=et.length,rt=createHash$2("sha1").update(Buffer$5.alloc(0)).digest(),ot=rt.length,at=2*ot;if(it>nt-at-2)throw new Error("message too long");var st=Buffer$5.alloc(nt-it-at-2),lt=nt-ot-1,ct=randomBytes(ot),ut=xor$1(Buffer$5.concat([rt,st,Buffer$5.alloc(1,1),et],lt),mgf$1(ct,lt)),ht=xor$1(ct,mgf$1(ut,ot));return new BN$3(Buffer$5.concat([Buffer$5.alloc(1),ht,ut],nt))}function pkcs1$1(tt,et,nt){var it=et.length,rt=tt.modulus.byteLength();if(it>rt-11)throw new Error("message too long");var ot;return nt?ot=Buffer$5.alloc(rt-it-3,255):ot=nonZero(rt-it-3),new BN$3(Buffer$5.concat([Buffer$5.from([0,nt?1:2]),ot,Buffer$5.alloc(1),et],rt))}function nonZero(tt){for(var et=Buffer$5.allocUnsafe(tt),nt=0,it=randomBytes(tt*2),rt=0,ot;ntat||new BN$2(nt).cmp(ot.modulus)>=0)throw new Error("decryption error");var st;it?st=withPublic(new BN$2(nt),ot):st=crt(nt,ot);var lt=Buffer$4.alloc(at-st.length);if(st=Buffer$4.concat([lt,st],at),rt===4)return oaep(ot,st);if(rt===1)return pkcs1(ot,st,it);if(rt===3)return st;throw new Error("unknown padding")};function oaep(tt,et){var nt=tt.modulus.byteLength(),it=createHash$1("sha1").update(Buffer$4.alloc(0)).digest(),rt=it.length;if(et[0]!==0)throw new Error("decryption error");var ot=et.slice(1,rt+1),at=et.slice(rt+1),st=xor(ot,mgf(at,rt)),lt=xor(at,mgf(st,nt-rt-1));if(compare$1(it,lt.slice(0,rt)))throw new Error("decryption error");for(var ct=rt;lt[ct]===0;)ct++;if(lt[ct++]!==1)throw new Error("decryption error");return lt.slice(ct)}function pkcs1(tt,et,nt){for(var it=et.slice(0,2),rt=2,ot=0;et[rt++]!==0;)if(rt>=et.length){ot++;break}var at=et.slice(2,rt-1);if((it.toString("hex")!=="0002"&&!nt||it.toString("hex")!=="0001"&&nt)&&ot++,at.length<8&&ot++,ot)throw new Error("decryption error");return et.slice(rt)}function compare$1(tt,et){tt=Buffer$4.from(tt),et=Buffer$4.from(et);var nt=0,it=tt.length;tt.length!==et.length&&(nt++,it=Math.min(tt.length,et.length));for(var rt=-1;++rtkMaxUint32||tt<0)throw new TypeError("offset must be a uint32");if(tt>kBufferMaxLength||tt>et)throw new RangeError("offset out of range")}function assertSize(tt,et,nt){if(typeof tt!="number"||tt!==tt)throw new TypeError("size must be a number");if(tt>kMaxUint32||tt<0)throw new TypeError("size must be a uint32");if(tt+et>nt||tt>kBufferMaxLength)throw new RangeError("buffer too small")}crypto$3&&crypto$3.getRandomValues||!process.browser?(browser.randomFill=randomFill,browser.randomFillSync=randomFillSync):(browser.randomFill=oldBrowser,browser.randomFillSync=oldBrowser);function randomFill(tt,et,nt,it){if(!Buffer$3.isBuffer(tt)&&!(tt instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof et=="function")it=et,et=0,nt=tt.length;else if(typeof nt=="function")it=nt,nt=tt.length-et;else if(typeof it!="function")throw new TypeError('"cb" argument must be a function');return assertOffset(et,tt.length),assertSize(nt,et,tt.length),actualFill(tt,et,nt,it)}function actualFill(tt,et,nt,it){if(process.browser){var rt=tt.buffer,ot=new Uint8Array(rt,et,nt);if(crypto$3.getRandomValues(ot),it){process.nextTick(function(){it(null,tt)});return}return tt}if(it){randombytes(nt,function(st,lt){if(st)return it(st);lt.copy(tt,et),it(null,tt)});return}var at=randombytes(nt);return at.copy(tt,et),tt}function randomFillSync(tt,et,nt){if(typeof et>"u"&&(et=0),!Buffer$3.isBuffer(tt)&&!(tt instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return assertOffset(et,tt.length),nt===void 0&&(nt=tt.length-et),assertSize(nt,et,tt.length),actualFill(tt,et,nt)}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=browserExports,cryptoBrowserify.createHash=cryptoBrowserify.Hash=browser$9,cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=browser$8;var tt=algos,et=Object.keys(tt),nt=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(et);cryptoBrowserify.getHashes=function(){return nt};var it=browser$7;cryptoBrowserify.pbkdf2=it.pbkdf2,cryptoBrowserify.pbkdf2Sync=it.pbkdf2Sync;var rt=browser$6;cryptoBrowserify.Cipher=rt.Cipher,cryptoBrowserify.createCipher=rt.createCipher,cryptoBrowserify.Cipheriv=rt.Cipheriv,cryptoBrowserify.createCipheriv=rt.createCipheriv,cryptoBrowserify.Decipher=rt.Decipher,cryptoBrowserify.createDecipher=rt.createDecipher,cryptoBrowserify.Decipheriv=rt.Decipheriv,cryptoBrowserify.createDecipheriv=rt.createDecipheriv,cryptoBrowserify.getCiphers=rt.getCiphers,cryptoBrowserify.listCiphers=rt.listCiphers;var ot=requireBrowser$2();cryptoBrowserify.DiffieHellmanGroup=ot.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=ot.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=ot.getDiffieHellman,cryptoBrowserify.createDiffieHellman=ot.createDiffieHellman,cryptoBrowserify.DiffieHellman=ot.DiffieHellman;var at=requireBrowser$1();cryptoBrowserify.createSign=at.createSign,cryptoBrowserify.Sign=at.Sign,cryptoBrowserify.createVerify=at.createVerify,cryptoBrowserify.Verify=at.Verify,cryptoBrowserify.createECDH=requireBrowser();var st=browser$1;cryptoBrowserify.publicEncrypt=st.publicEncrypt,cryptoBrowserify.privateEncrypt=st.privateEncrypt,cryptoBrowserify.publicDecrypt=st.publicDecrypt,cryptoBrowserify.privateDecrypt=st.privateDecrypt;var lt=browser;return cryptoBrowserify.randomFill=lt.randomFill,cryptoBrowserify.randomFillSync=lt.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` -`))},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var rngBrowser={exports:{}},getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues){var rnds8=new Uint8Array(16);rngBrowser.exports=function(){return getRandomValues(rnds8),rnds8}}else{var rnds=new Array(16);rngBrowser.exports=function(){for(var et=0,nt;et<16;et++)et&3||(nt=Math.random()*4294967296),rnds[et]=nt>>>((et&3)<<3)&255;return rnds}}var rngBrowserExports=rngBrowser.exports,byteToHex=[];for(var i$5=0;i$5<256;++i$5)byteToHex[i$5]=(i$5+256).toString(16).substr(1);function bytesToUuid$1(tt,et){var nt=et||0,it=byteToHex;return[it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],"-",it[tt[nt++]],it[tt[nt++]],"-",it[tt[nt++]],it[tt[nt++]],"-",it[tt[nt++]],it[tt[nt++]],"-",it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],it[tt[nt++]]].join("")}var bytesToUuid_1=bytesToUuid$1,rng=rngBrowserExports,bytesToUuid=bytesToUuid_1;function v4(tt,et,nt){var it=et&&nt||0;typeof tt=="string"&&(et=tt==="binary"?new Array(16):null,tt=null),tt=tt||{};var rt=tt.random||(tt.rng||rng)();if(rt[6]=rt[6]&15|64,rt[8]=rt[8]&63|128,et)for(var ot=0;ot<16;++ot)et[it+ot]=rt[ot];return et||bytesToUuid(rt)}var v4_1=v4,macaroon$1={},sjcl={exports:{}};(function(tt){var et={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(mt){this.toString=function(){return"CORRUPT: "+this.message},this.message=mt},invalid:function(mt){this.toString=function(){return"INVALID: "+this.message},this.message=mt},bug:function(mt){this.toString=function(){return"BUG: "+this.message},this.message=mt},notReady:function(mt){this.toString=function(){return"NOT READY: "+this.message},this.message=mt}}};et.cipher.aes=function(mt){this.s[0][0][0]||this.O();var gt,bt,yt,wt,vt=this.s[0][4],xt=this.s[1];gt=mt.length;var St=1;if(gt!==4&>!==6&>!==8)throw new et.exception.invalid("invalid aes key size");for(this.b=[yt=mt.slice(0),wt=[]],mt=gt;mt<4*gt+28;mt++)bt=yt[mt-1],(mt%gt===0||gt===8&&mt%gt===4)&&(bt=vt[bt>>>24]<<24^vt[bt>>16&255]<<16^vt[bt>>8&255]<<8^vt[bt&255],mt%gt===0&&(bt=bt<<8^bt>>>24^St<<24,St=St<<1^283*(St>>7))),yt[mt]=yt[mt-gt]^bt;for(gt=0;mt;gt++,mt--)bt=yt[gt&3?mt:mt-4],wt[gt]=4>=mt||4>gt?bt:xt[0][vt[bt>>>24]]^xt[1][vt[bt>>16&255]]^xt[2][vt[bt>>8&255]]^xt[3][vt[bt&255]]},et.cipher.aes.prototype={encrypt:function(mt){return nt(this,mt,0)},decrypt:function(mt){return nt(this,mt,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var mt=this.s[0],gt=this.s[1],bt=mt[4],yt=gt[4],wt,vt,xt,St=[],Et=[],It,Tt,$t,Ut;for(wt=0;256>wt;wt++)Et[(St[wt]=wt<<1^283*(wt>>7))^wt]=wt;for(vt=xt=0;!bt[vt];vt^=It||1,xt=Et[xt]||1)for($t=xt^xt<<1^xt<<2^xt<<3^xt<<4,$t=$t>>8^$t&255^99,bt[vt]=$t,yt[$t]=vt,Tt=St[wt=St[It=St[vt]]],Ut=16843009*Tt^65537*wt^257*It^16843008*vt,Tt=257*St[$t]^16843008*$t,wt=0;4>wt;wt++)mt[wt][vt]=Tt=Tt<<24^Tt>>>8,gt[wt][$t]=Ut=Ut<<24^Ut>>>8;for(wt=0;5>wt;wt++)mt[wt]=mt[wt].slice(0),gt[wt]=gt[wt].slice(0)}};function nt(mt,gt,bt){if(gt.length!==4)throw new et.exception.invalid("invalid aes block size");var yt=mt.b[bt],wt=gt[0]^yt[0],vt=gt[bt?3:1]^yt[1],xt=gt[2]^yt[2];gt=gt[bt?1:3]^yt[3];var St,Et,It,Tt=yt.length/4-2,$t,Ut=4,Lt=[0,0,0,0];St=mt.s[bt],mt=St[0];var Bt=St[1],Pt=St[2],kt=St[3],At=St[4];for($t=0;$t>>24]^Bt[vt>>16&255]^Pt[xt>>8&255]^kt[gt&255]^yt[Ut],Et=mt[vt>>>24]^Bt[xt>>16&255]^Pt[gt>>8&255]^kt[wt&255]^yt[Ut+1],It=mt[xt>>>24]^Bt[gt>>16&255]^Pt[wt>>8&255]^kt[vt&255]^yt[Ut+2],gt=mt[gt>>>24]^Bt[wt>>16&255]^Pt[vt>>8&255]^kt[xt&255]^yt[Ut+3],Ut+=4,wt=St,vt=Et,xt=It;for($t=0;4>$t;$t++)Lt[bt?3&-$t:$t]=At[wt>>>24]<<24^At[vt>>16&255]<<16^At[xt>>8&255]<<8^At[gt&255]^yt[Ut++],St=wt,wt=vt,vt=xt,xt=gt,gt=St;return Lt}et.bitArray={bitSlice:function(mt,gt,bt){return mt=et.bitArray.$(mt.slice(gt/32),32-(gt&31)).slice(1),bt===void 0?mt:et.bitArray.clamp(mt,bt-gt)},extract:function(mt,gt,bt){var yt=Math.floor(-gt-bt&31);return((gt+bt-1^gt)&-32?mt[gt/32|0]<<32-yt^mt[gt/32+1|0]>>>yt:mt[gt/32|0]>>>yt)&(1<>gt-1,1)),mt},partial:function(mt,gt,bt){return mt===32?gt:(bt?gt|0:gt<<32-mt)+1099511627776*mt},getPartial:function(mt){return Math.round(mt/1099511627776)||32},equal:function(mt,gt){if(et.bitArray.bitLength(mt)!==et.bitArray.bitLength(gt))return!1;var bt=0,yt;for(yt=0;yt>>gt),bt=mt[wt]<<32-gt;return wt=mt.length?mt[mt.length-1]:0,mt=et.bitArray.getPartial(wt),yt.push(et.bitArray.partial(gt+mt&31,32>>24|bt>>>8&65280|(bt&65280)<<8|bt<<24;return mt}},et.codec.utf8String={fromBits:function(mt){var gt="",bt=et.bitArray.bitLength(mt),yt,wt;for(yt=0;yt>>8>>>8>>>8),wt<<=8;return decodeURIComponent(escape(gt))},toBits:function(mt){mt=unescape(encodeURIComponent(mt));var gt=[],bt,yt=0;for(bt=0;bt>>xt)>>>wt),xtTt){if(!gt)try{return et.codec.base32hex.toBits(mt)}catch{}throw new et.exception.invalid("this isn't "+$t+"!")}St>wt?(St-=wt,vt.push(It^Tt>>>St),It=Tt<>>wt)>>>26),6>wt?(xt=mt[bt]<<6-wt,wt+=26,bt++):(xt<<=6,wt-=6);for(;yt.length&3&&!gt;)yt+="=";return yt},toBits:function(mt,gt){mt=mt.replace(/\s|=/g,"");var bt=[],yt,wt=0,vt=et.codec.base64.B,xt=0,St;for(gt&&(vt=vt.substr(0,62)+"-_"),yt=0;ytSt)throw new et.exception.invalid("this isn't base64!");26>>wt),xt=St<<32-wt):(wt+=6,xt^=St<<32-wt)}return wt&56&&bt.push(et.bitArray.partial(wt&56,xt,1)),bt}},et.codec.base64url={fromBits:function(mt){return et.codec.base64.fromBits(mt,1,1)},toBits:function(mt){return et.codec.base64.toBits(mt,1)}},et.hash.sha256=function(mt){this.b[0]||this.O(),mt?(this.F=mt.F.slice(0),this.A=mt.A.slice(0),this.l=mt.l):this.reset()},et.hash.sha256.hash=function(mt){return new et.hash.sha256().update(mt).finalize()},et.hash.sha256.prototype={blockSize:512,reset:function(){return this.F=this.Y.slice(0),this.A=[],this.l=0,this},update:function(mt){typeof mt=="string"&&(mt=et.codec.utf8String.toBits(mt));var gt,bt=this.A=et.bitArray.concat(this.A,mt);if(gt=this.l,mt=this.l=gt+et.bitArray.bitLength(mt),9007199254740991gt;bt++){for(wt=!0,yt=2;yt*yt<=bt;yt++)if(bt%yt===0){wt=!1;break}wt&&(8>gt&&(this.Y[gt]=mt(Math.pow(bt,.5))),this.b[gt]=mt(Math.pow(bt,1/3)),gt++)}}};function it(mt,gt){var bt,yt,wt,vt=mt.F,xt=mt.b,St=vt[0],Et=vt[1],It=vt[2],Tt=vt[3],$t=vt[4],Ut=vt[5],Lt=vt[6],Bt=vt[7];for(bt=0;64>bt;bt++)16>bt?yt=gt[bt]:(yt=gt[bt+1&15],wt=gt[bt+14&15],yt=gt[bt&15]=(yt>>>7^yt>>>18^yt>>>3^yt<<25^yt<<14)+(wt>>>17^wt>>>19^wt>>>10^wt<<15^wt<<13)+gt[bt&15]+gt[bt+9&15]|0),yt=yt+Bt+($t>>>6^$t>>>11^$t>>>25^$t<<26^$t<<21^$t<<7)+(Lt^$t&(Ut^Lt))+xt[bt],Bt=Lt,Lt=Ut,Ut=$t,$t=Tt+yt|0,Tt=It,It=Et,Et=St,St=yt+(Et&It^Tt&(Et^It))+(Et>>>2^Et>>>13^Et>>>22^Et<<30^Et<<19^Et<<10)|0;vt[0]=vt[0]+St|0,vt[1]=vt[1]+Et|0,vt[2]=vt[2]+It|0,vt[3]=vt[3]+Tt|0,vt[4]=vt[4]+$t|0,vt[5]=vt[5]+Ut|0,vt[6]=vt[6]+Lt|0,vt[7]=vt[7]+Bt|0}et.mode.ccm={name:"ccm",G:[],listenProgress:function(mt){et.mode.ccm.G.push(mt)},unListenProgress:function(mt){mt=et.mode.ccm.G.indexOf(mt),-1Et)throw new et.exception.invalid("ccm: iv must be at least 7 bytes");for(vt=2;4>vt&&It>>>8*vt;vt++);return vt<15-Et&&(vt=15-Et),bt=St.clamp(bt,8*(15-vt)),gt=et.mode.ccm.V(mt,gt,bt,yt,wt,vt),xt=et.mode.ccm.C(mt,xt,bt,gt,wt,vt),St.concat(xt.data,xt.tag)},decrypt:function(mt,gt,bt,yt,wt){wt=wt||64,yt=yt||[];var vt=et.bitArray,xt=vt.bitLength(bt)/8,It=vt.bitLength(gt),St=vt.clamp(gt,It-wt),Et=vt.bitSlice(gt,It-wt),It=(It-wt)/8;if(7>xt)throw new et.exception.invalid("ccm: iv must be at least 7 bytes");for(gt=2;4>gt&&It>>>8*gt;gt++);if(gt<15-xt&&(gt=15-xt),bt=vt.clamp(bt,8*(15-gt)),St=et.mode.ccm.C(mt,St,bt,Et,wt,gt),mt=et.mode.ccm.V(mt,St.data,bt,yt,wt,gt),!vt.equal(St.tag,mt))throw new et.exception.corrupt("ccm: tag doesn't match");return St.data},na:function(mt,gt,bt,yt,wt,vt){var xt=[],St=et.bitArray,Et=St.i;if(yt=[St.partial(8,(gt.length?64:0)|yt-2<<2|vt-1)],yt=St.concat(yt,bt),yt[3]|=wt,yt=mt.encrypt(yt),gt.length)for(bt=St.bitLength(gt)/8,65279>=bt?xt=[St.partial(16,bt)]:4294967295>=bt&&(xt=St.concat([St.partial(16,65534)],[bt])),xt=St.concat(xt,gt),gt=0;gtwt||16Tt&&(et.mode.ccm.fa(xt/Et),Tt+=$t),bt[3]++,wt=mt.encrypt(bt),gt[xt]^=wt[0],gt[xt+1]^=wt[1],gt[xt+2]^=wt[2],gt[xt+3]^=wt[3];return{tag:yt,data:St.clamp(gt,It)}}},et.mode.ocb2={name:"ocb2",encrypt:function(mt,gt,bt,yt,wt,vt){if(et.bitArray.bitLength(bt)!==128)throw new et.exception.invalid("ocb iv must be 128 bits");var xt,St=et.mode.ocb2.S,Et=et.bitArray,It=Et.i,Tt=[0,0,0,0];bt=St(mt.encrypt(bt));var $t,Ut=[];for(yt=yt||[],wt=wt||64,xt=0;xt+4wt.bitLength(bt)&&(St=vt(St,yt(St)),bt=wt.concat(bt,[-2147483648,0,0,0])),xt=vt(xt,bt),mt.encrypt(vt(yt(vt(St,yt(St))),xt))},S:function(mt){return[mt[0]<<1^mt[1]>>>31,mt[1]<<1^mt[2]>>>31,mt[2]<<1^mt[3]>>>31,mt[3]<<1^135*(mt[0]>>>31)]}},et.mode.gcm={name:"gcm",encrypt:function(mt,gt,bt,yt,wt){var vt=gt.slice(0);return gt=et.bitArray,yt=yt||[],mt=et.mode.gcm.C(!0,mt,vt,yt,bt,wt||128),gt.concat(mt.data,mt.tag)},decrypt:function(mt,gt,bt,yt,wt){var vt=gt.slice(0),xt=et.bitArray,St=xt.bitLength(vt);if(wt=wt||128,yt=yt||[],wt<=St?(gt=xt.bitSlice(vt,St-wt),vt=xt.bitSlice(vt,0,St-wt)):(gt=vt,vt=[]),mt=et.mode.gcm.C(!1,mt,vt,yt,bt,wt),!xt.equal(mt.tag,gt))throw new et.exception.corrupt("gcm: tag doesn't match");return mt.data},ka:function(mt,gt){var bt,yt,wt,vt,xt,St=et.bitArray.i;for(wt=[0,0,0,0],vt=gt.slice(0),bt=0;128>bt;bt++){for((yt=(mt[Math.floor(bt/32)]&1<<31-bt%32)!==0)&&(wt=St(wt,vt)),xt=(vt[3]&1)!==0,yt=3;0>>1|(vt[yt-1]&1)<<31;vt[0]>>>=1,xt&&(vt[0]^=-520093696)}return wt},j:function(mt,gt,bt){var yt,wt=bt.length;for(gt=gt.slice(0),yt=0;ytwt&&(mt=gt.hash(mt)),yt=0;ytyt||0>bt)throw new et.exception.invalid("invalid params to pbkdf2");typeof mt=="string"&&(mt=et.codec.utf8String.toBits(mt)),typeof gt=="string"&&(gt=et.codec.utf8String.toBits(gt)),wt=wt||et.misc.hmac,mt=new wt(mt);var vt,xt,St,Et,It=[],Tt=et.bitArray;for(Et=1;32*It.length<(yt||1);Et++){for(wt=vt=mt.encrypt(Tt.concat(gt,[Et])),xt=1;xtxt;xt++)wt.push(4294967296*Math.random()|0);for(xt=0;xt=1<this.o&&(this.o=vt),this.P++,this.b=et.hash.sha256.hash(this.b.concat(wt)),this.L=new et.cipher.aes(this.b),yt=0;4>yt&&(this.h[yt]=this.h[yt]+1|0,!this.h[yt]);yt++);}for(yt=0;yt>>1;this.c[xt].update([yt,this.N++,2,gt,vt,mt.length].concat(mt))}break;case"string":gt===void 0&&(gt=mt.length),this.c[xt].update([yt,this.N++,3,gt,vt,mt.length]),this.c[xt].update(mt);break;default:Et=1}if(Et)throw new et.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[xt]+=gt,this.f+=gt,St===this.u&&(this.isReady()!==this.u&&rt("seeded",Math.max(this.o,this.f)),rt("progress",this.getProgress()))},isReady:function(mt){return mt=this.T[mt!==void 0?mt:this.M],this.o&&this.o>=mt?this.m[0]>this.ba&&new Date().valueOf()>this.Z?this.J|this.I:this.I:this.f>=mt?this.J|this.u:this.u},getProgress:function(mt){return mt=this.T[mt||this.M],this.o>=mt||this.f>mt?1:this.f/mt},startCollectors:function(){if(!this.D){if(this.a={loadTimeCollector:lt(this,this.ma),mouseCollector:lt(this,this.oa),keyboardCollector:lt(this,this.la),accelerometerCollector:lt(this,this.ea),touchCollector:lt(this,this.qa)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else if(document.attachEvent)document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector);else throw new et.exception.bug("can't attach event");this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(mt,gt){this.K[mt][this.ga++]=gt},removeEventListener:function(mt,gt){var bt,yt,wt=this.K[mt],vt=[];for(yt in wt)wt.hasOwnProperty(yt)&&wt[yt]===gt&&vt.push(yt);for(bt=0;btgt&&(mt.h[gt]=mt.h[gt]+1|0,!mt.h[gt]);gt++);return mt.L.encrypt(mt.h)}function lt(mt,gt){return function(){gt.apply(mt,arguments)}}et.random=new et.prng(6);e:try{var ct,ut,ht,dt;if(dt=tt.exports){var pt;try{pt=requireCryptoBrowserify()}catch{pt=null}dt=ut=pt}if(dt&&ut.randomBytes)ct=ut.randomBytes(128),ct=new Uint32Array(new Uint8Array(ct).buffer),et.random.addEntropy(ct,1024,"crypto['randomBytes']");else if(typeof window<"u"&&typeof Uint32Array<"u"){if(ht=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(ht);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(ht);else break e;et.random.addEntropy(ht,1024,"crypto['getRandomValues']")}}catch(mt){typeof window<"u"&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(mt))}et.json={defaults:{v:1,iter:1e4,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},ja:function(mt,gt,bt,yt){bt=bt||{},yt=yt||{};var wt=et.json,vt=wt.g({iv:et.random.randomWords(4,0)},wt.defaults),xt;if(wt.g(vt,bt),bt=vt.adata,typeof vt.salt=="string"&&(vt.salt=et.codec.base64.toBits(vt.salt)),typeof vt.iv=="string"&&(vt.iv=et.codec.base64.toBits(vt.iv)),!et.mode[vt.mode]||!et.cipher[vt.cipher]||typeof mt=="string"&&100>=vt.iter||vt.ts!==64&&vt.ts!==96&&vt.ts!==128||vt.ks!==128&&vt.ks!==192&&vt.ks!==256||2>vt.iv.length||4=gt.iter||gt.ts!==64&>.ts!==96&>.ts!==128||gt.ks!==128&>.ks!==192&>.ks!==256||!gt.iv||2>gt.iv.length||4>24&255,wn[Pn+1]=fn>>16&255,wn[Pn+2]=fn>>8&255,wn[Pn+3]=fn&255,wn[Pn+4]=Jt>>24&255,wn[Pn+5]=Jt>>16&255,wn[Pn+6]=Jt>>8&255,wn[Pn+7]=Jt&255}function gt(wn,Pn,fn,Jt,kn){var On,Dn=0;for(On=0;On>>8)-1}function bt(wn,Pn,fn,Jt){return gt(wn,Pn,fn,Jt,16)}function yt(wn,Pn,fn,Jt){return gt(wn,Pn,fn,Jt,32)}function wt(wn,Pn,fn,Jt){for(var kn=Jt[0]&255|(Jt[1]&255)<<8|(Jt[2]&255)<<16|(Jt[3]&255)<<24,On=fn[0]&255|(fn[1]&255)<<8|(fn[2]&255)<<16|(fn[3]&255)<<24,Dn=fn[4]&255|(fn[5]&255)<<8|(fn[6]&255)<<16|(fn[7]&255)<<24,Kn=fn[8]&255|(fn[9]&255)<<8|(fn[10]&255)<<16|(fn[11]&255)<<24,er=fn[12]&255|(fn[13]&255)<<8|(fn[14]&255)<<16|(fn[15]&255)<<24,or=Jt[4]&255|(Jt[5]&255)<<8|(Jt[6]&255)<<16|(Jt[7]&255)<<24,ar=Pn[0]&255|(Pn[1]&255)<<8|(Pn[2]&255)<<16|(Pn[3]&255)<<24,Vr=Pn[4]&255|(Pn[5]&255)<<8|(Pn[6]&255)<<16|(Pn[7]&255)<<24,wr=Pn[8]&255|(Pn[9]&255)<<8|(Pn[10]&255)<<16|(Pn[11]&255)<<24,Or=Pn[12]&255|(Pn[13]&255)<<8|(Pn[14]&255)<<16|(Pn[15]&255)<<24,Hr=Jt[8]&255|(Jt[9]&255)<<8|(Jt[10]&255)<<16|(Jt[11]&255)<<24,no=fn[16]&255|(fn[17]&255)<<8|(fn[18]&255)<<16|(fn[19]&255)<<24,Xr=fn[20]&255|(fn[21]&255)<<8|(fn[22]&255)<<16|(fn[23]&255)<<24,Jr=fn[24]&255|(fn[25]&255)<<8|(fn[26]&255)<<16|(fn[27]&255)<<24,br=fn[28]&255|(fn[29]&255)<<8|(fn[30]&255)<<16|(fn[31]&255)<<24,$r=Jt[12]&255|(Jt[13]&255)<<8|(Jt[14]&255)<<16|(Jt[15]&255)<<24,Dr=kn,Cr=On,Ar=Dn,Nr=Kn,Fr=er,Pr=or,_i=ar,nr=Vr,xr=wr,cr=Or,yr=Hr,Ir=no,io=Xr,so=Jr,fo=br,po=$r,Yn,vo=0;vo<20;vo+=2)Yn=Dr+io|0,Fr^=Yn<<7|Yn>>>32-7,Yn=Fr+Dr|0,xr^=Yn<<9|Yn>>>32-9,Yn=xr+Fr|0,io^=Yn<<13|Yn>>>32-13,Yn=io+xr|0,Dr^=Yn<<18|Yn>>>32-18,Yn=Pr+Cr|0,cr^=Yn<<7|Yn>>>32-7,Yn=cr+Pr|0,so^=Yn<<9|Yn>>>32-9,Yn=so+cr|0,Cr^=Yn<<13|Yn>>>32-13,Yn=Cr+so|0,Pr^=Yn<<18|Yn>>>32-18,Yn=yr+_i|0,fo^=Yn<<7|Yn>>>32-7,Yn=fo+yr|0,Ar^=Yn<<9|Yn>>>32-9,Yn=Ar+fo|0,_i^=Yn<<13|Yn>>>32-13,Yn=_i+Ar|0,yr^=Yn<<18|Yn>>>32-18,Yn=po+Ir|0,Nr^=Yn<<7|Yn>>>32-7,Yn=Nr+po|0,nr^=Yn<<9|Yn>>>32-9,Yn=nr+Nr|0,Ir^=Yn<<13|Yn>>>32-13,Yn=Ir+nr|0,po^=Yn<<18|Yn>>>32-18,Yn=Dr+Nr|0,Cr^=Yn<<7|Yn>>>32-7,Yn=Cr+Dr|0,Ar^=Yn<<9|Yn>>>32-9,Yn=Ar+Cr|0,Nr^=Yn<<13|Yn>>>32-13,Yn=Nr+Ar|0,Dr^=Yn<<18|Yn>>>32-18,Yn=Pr+Fr|0,_i^=Yn<<7|Yn>>>32-7,Yn=_i+Pr|0,nr^=Yn<<9|Yn>>>32-9,Yn=nr+_i|0,Fr^=Yn<<13|Yn>>>32-13,Yn=Fr+nr|0,Pr^=Yn<<18|Yn>>>32-18,Yn=yr+cr|0,Ir^=Yn<<7|Yn>>>32-7,Yn=Ir+yr|0,xr^=Yn<<9|Yn>>>32-9,Yn=xr+Ir|0,cr^=Yn<<13|Yn>>>32-13,Yn=cr+xr|0,yr^=Yn<<18|Yn>>>32-18,Yn=po+fo|0,io^=Yn<<7|Yn>>>32-7,Yn=io+po|0,so^=Yn<<9|Yn>>>32-9,Yn=so+io|0,fo^=Yn<<13|Yn>>>32-13,Yn=fo+so|0,po^=Yn<<18|Yn>>>32-18;Dr=Dr+kn|0,Cr=Cr+On|0,Ar=Ar+Dn|0,Nr=Nr+Kn|0,Fr=Fr+er|0,Pr=Pr+or|0,_i=_i+ar|0,nr=nr+Vr|0,xr=xr+wr|0,cr=cr+Or|0,yr=yr+Hr|0,Ir=Ir+no|0,io=io+Xr|0,so=so+Jr|0,fo=fo+br|0,po=po+$r|0,wn[0]=Dr>>>0&255,wn[1]=Dr>>>8&255,wn[2]=Dr>>>16&255,wn[3]=Dr>>>24&255,wn[4]=Cr>>>0&255,wn[5]=Cr>>>8&255,wn[6]=Cr>>>16&255,wn[7]=Cr>>>24&255,wn[8]=Ar>>>0&255,wn[9]=Ar>>>8&255,wn[10]=Ar>>>16&255,wn[11]=Ar>>>24&255,wn[12]=Nr>>>0&255,wn[13]=Nr>>>8&255,wn[14]=Nr>>>16&255,wn[15]=Nr>>>24&255,wn[16]=Fr>>>0&255,wn[17]=Fr>>>8&255,wn[18]=Fr>>>16&255,wn[19]=Fr>>>24&255,wn[20]=Pr>>>0&255,wn[21]=Pr>>>8&255,wn[22]=Pr>>>16&255,wn[23]=Pr>>>24&255,wn[24]=_i>>>0&255,wn[25]=_i>>>8&255,wn[26]=_i>>>16&255,wn[27]=_i>>>24&255,wn[28]=nr>>>0&255,wn[29]=nr>>>8&255,wn[30]=nr>>>16&255,wn[31]=nr>>>24&255,wn[32]=xr>>>0&255,wn[33]=xr>>>8&255,wn[34]=xr>>>16&255,wn[35]=xr>>>24&255,wn[36]=cr>>>0&255,wn[37]=cr>>>8&255,wn[38]=cr>>>16&255,wn[39]=cr>>>24&255,wn[40]=yr>>>0&255,wn[41]=yr>>>8&255,wn[42]=yr>>>16&255,wn[43]=yr>>>24&255,wn[44]=Ir>>>0&255,wn[45]=Ir>>>8&255,wn[46]=Ir>>>16&255,wn[47]=Ir>>>24&255,wn[48]=io>>>0&255,wn[49]=io>>>8&255,wn[50]=io>>>16&255,wn[51]=io>>>24&255,wn[52]=so>>>0&255,wn[53]=so>>>8&255,wn[54]=so>>>16&255,wn[55]=so>>>24&255,wn[56]=fo>>>0&255,wn[57]=fo>>>8&255,wn[58]=fo>>>16&255,wn[59]=fo>>>24&255,wn[60]=po>>>0&255,wn[61]=po>>>8&255,wn[62]=po>>>16&255,wn[63]=po>>>24&255}function vt(wn,Pn,fn,Jt){for(var kn=Jt[0]&255|(Jt[1]&255)<<8|(Jt[2]&255)<<16|(Jt[3]&255)<<24,On=fn[0]&255|(fn[1]&255)<<8|(fn[2]&255)<<16|(fn[3]&255)<<24,Dn=fn[4]&255|(fn[5]&255)<<8|(fn[6]&255)<<16|(fn[7]&255)<<24,Kn=fn[8]&255|(fn[9]&255)<<8|(fn[10]&255)<<16|(fn[11]&255)<<24,er=fn[12]&255|(fn[13]&255)<<8|(fn[14]&255)<<16|(fn[15]&255)<<24,or=Jt[4]&255|(Jt[5]&255)<<8|(Jt[6]&255)<<16|(Jt[7]&255)<<24,ar=Pn[0]&255|(Pn[1]&255)<<8|(Pn[2]&255)<<16|(Pn[3]&255)<<24,Vr=Pn[4]&255|(Pn[5]&255)<<8|(Pn[6]&255)<<16|(Pn[7]&255)<<24,wr=Pn[8]&255|(Pn[9]&255)<<8|(Pn[10]&255)<<16|(Pn[11]&255)<<24,Or=Pn[12]&255|(Pn[13]&255)<<8|(Pn[14]&255)<<16|(Pn[15]&255)<<24,Hr=Jt[8]&255|(Jt[9]&255)<<8|(Jt[10]&255)<<16|(Jt[11]&255)<<24,no=fn[16]&255|(fn[17]&255)<<8|(fn[18]&255)<<16|(fn[19]&255)<<24,Xr=fn[20]&255|(fn[21]&255)<<8|(fn[22]&255)<<16|(fn[23]&255)<<24,Jr=fn[24]&255|(fn[25]&255)<<8|(fn[26]&255)<<16|(fn[27]&255)<<24,br=fn[28]&255|(fn[29]&255)<<8|(fn[30]&255)<<16|(fn[31]&255)<<24,$r=Jt[12]&255|(Jt[13]&255)<<8|(Jt[14]&255)<<16|(Jt[15]&255)<<24,Dr=kn,Cr=On,Ar=Dn,Nr=Kn,Fr=er,Pr=or,_i=ar,nr=Vr,xr=wr,cr=Or,yr=Hr,Ir=no,io=Xr,so=Jr,fo=br,po=$r,Yn,vo=0;vo<20;vo+=2)Yn=Dr+io|0,Fr^=Yn<<7|Yn>>>32-7,Yn=Fr+Dr|0,xr^=Yn<<9|Yn>>>32-9,Yn=xr+Fr|0,io^=Yn<<13|Yn>>>32-13,Yn=io+xr|0,Dr^=Yn<<18|Yn>>>32-18,Yn=Pr+Cr|0,cr^=Yn<<7|Yn>>>32-7,Yn=cr+Pr|0,so^=Yn<<9|Yn>>>32-9,Yn=so+cr|0,Cr^=Yn<<13|Yn>>>32-13,Yn=Cr+so|0,Pr^=Yn<<18|Yn>>>32-18,Yn=yr+_i|0,fo^=Yn<<7|Yn>>>32-7,Yn=fo+yr|0,Ar^=Yn<<9|Yn>>>32-9,Yn=Ar+fo|0,_i^=Yn<<13|Yn>>>32-13,Yn=_i+Ar|0,yr^=Yn<<18|Yn>>>32-18,Yn=po+Ir|0,Nr^=Yn<<7|Yn>>>32-7,Yn=Nr+po|0,nr^=Yn<<9|Yn>>>32-9,Yn=nr+Nr|0,Ir^=Yn<<13|Yn>>>32-13,Yn=Ir+nr|0,po^=Yn<<18|Yn>>>32-18,Yn=Dr+Nr|0,Cr^=Yn<<7|Yn>>>32-7,Yn=Cr+Dr|0,Ar^=Yn<<9|Yn>>>32-9,Yn=Ar+Cr|0,Nr^=Yn<<13|Yn>>>32-13,Yn=Nr+Ar|0,Dr^=Yn<<18|Yn>>>32-18,Yn=Pr+Fr|0,_i^=Yn<<7|Yn>>>32-7,Yn=_i+Pr|0,nr^=Yn<<9|Yn>>>32-9,Yn=nr+_i|0,Fr^=Yn<<13|Yn>>>32-13,Yn=Fr+nr|0,Pr^=Yn<<18|Yn>>>32-18,Yn=yr+cr|0,Ir^=Yn<<7|Yn>>>32-7,Yn=Ir+yr|0,xr^=Yn<<9|Yn>>>32-9,Yn=xr+Ir|0,cr^=Yn<<13|Yn>>>32-13,Yn=cr+xr|0,yr^=Yn<<18|Yn>>>32-18,Yn=po+fo|0,io^=Yn<<7|Yn>>>32-7,Yn=io+po|0,so^=Yn<<9|Yn>>>32-9,Yn=so+io|0,fo^=Yn<<13|Yn>>>32-13,Yn=fo+so|0,po^=Yn<<18|Yn>>>32-18;wn[0]=Dr>>>0&255,wn[1]=Dr>>>8&255,wn[2]=Dr>>>16&255,wn[3]=Dr>>>24&255,wn[4]=Pr>>>0&255,wn[5]=Pr>>>8&255,wn[6]=Pr>>>16&255,wn[7]=Pr>>>24&255,wn[8]=yr>>>0&255,wn[9]=yr>>>8&255,wn[10]=yr>>>16&255,wn[11]=yr>>>24&255,wn[12]=po>>>0&255,wn[13]=po>>>8&255,wn[14]=po>>>16&255,wn[15]=po>>>24&255,wn[16]=_i>>>0&255,wn[17]=_i>>>8&255,wn[18]=_i>>>16&255,wn[19]=_i>>>24&255,wn[20]=nr>>>0&255,wn[21]=nr>>>8&255,wn[22]=nr>>>16&255,wn[23]=nr>>>24&255,wn[24]=xr>>>0&255,wn[25]=xr>>>8&255,wn[26]=xr>>>16&255,wn[27]=xr>>>24&255,wn[28]=cr>>>0&255,wn[29]=cr>>>8&255,wn[30]=cr>>>16&255,wn[31]=cr>>>24&255}function xt(wn,Pn,fn,Jt){wt(wn,Pn,fn,Jt)}function St(wn,Pn,fn,Jt){vt(wn,Pn,fn,Jt)}var Et=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function It(wn,Pn,fn,Jt,kn,On,Dn){var Kn=new Uint8Array(16),er=new Uint8Array(64),or,ar;for(ar=0;ar<16;ar++)Kn[ar]=0;for(ar=0;ar<8;ar++)Kn[ar]=On[ar];for(;kn>=64;){for(xt(er,Kn,Dn,Et),ar=0;ar<64;ar++)wn[Pn+ar]=fn[Jt+ar]^er[ar];for(or=1,ar=8;ar<16;ar++)or=or+(Kn[ar]&255)|0,Kn[ar]=or&255,or>>>=8;kn-=64,Pn+=64,Jt+=64}if(kn>0)for(xt(er,Kn,Dn,Et),ar=0;ar=64;){for(xt(Dn,On,kn,Et),er=0;er<64;er++)wn[Pn+er]=Dn[er];for(Kn=1,er=8;er<16;er++)Kn=Kn+(On[er]&255)|0,On[er]=Kn&255,Kn>>>=8;fn-=64,Pn+=64}if(fn>0)for(xt(Dn,On,kn,Et),er=0;er>>13|fn<<3)&8191,Jt=wn[4]&255|(wn[5]&255)<<8,this.r[2]=(fn>>>10|Jt<<6)&7939,kn=wn[6]&255|(wn[7]&255)<<8,this.r[3]=(Jt>>>7|kn<<9)&8191,On=wn[8]&255|(wn[9]&255)<<8,this.r[4]=(kn>>>4|On<<12)&255,this.r[5]=On>>>1&8190,Dn=wn[10]&255|(wn[11]&255)<<8,this.r[6]=(On>>>14|Dn<<2)&8191,Kn=wn[12]&255|(wn[13]&255)<<8,this.r[7]=(Dn>>>11|Kn<<5)&8065,er=wn[14]&255|(wn[15]&255)<<8,this.r[8]=(Kn>>>8|er<<8)&8191,this.r[9]=er>>>5&127,this.pad[0]=wn[16]&255|(wn[17]&255)<<8,this.pad[1]=wn[18]&255|(wn[19]&255)<<8,this.pad[2]=wn[20]&255|(wn[21]&255)<<8,this.pad[3]=wn[22]&255|(wn[23]&255)<<8,this.pad[4]=wn[24]&255|(wn[25]&255)<<8,this.pad[5]=wn[26]&255|(wn[27]&255)<<8,this.pad[6]=wn[28]&255|(wn[29]&255)<<8,this.pad[7]=wn[30]&255|(wn[31]&255)<<8};Lt.prototype.blocks=function(wn,Pn,fn){for(var Jt=this.fin?0:2048,kn,On,Dn,Kn,er,or,ar,Vr,wr,Or,Hr,no,Xr,Jr,br,$r,Dr,Cr,Ar,Nr=this.h[0],Fr=this.h[1],Pr=this.h[2],_i=this.h[3],nr=this.h[4],xr=this.h[5],cr=this.h[6],yr=this.h[7],Ir=this.h[8],io=this.h[9],so=this.r[0],fo=this.r[1],po=this.r[2],Yn=this.r[3],vo=this.r[4],_o=this.r[5],xo=this.r[6],bo=this.r[7],$o=this.r[8],Ro=this.r[9];fn>=16;)kn=wn[Pn+0]&255|(wn[Pn+1]&255)<<8,Nr+=kn&8191,On=wn[Pn+2]&255|(wn[Pn+3]&255)<<8,Fr+=(kn>>>13|On<<3)&8191,Dn=wn[Pn+4]&255|(wn[Pn+5]&255)<<8,Pr+=(On>>>10|Dn<<6)&8191,Kn=wn[Pn+6]&255|(wn[Pn+7]&255)<<8,_i+=(Dn>>>7|Kn<<9)&8191,er=wn[Pn+8]&255|(wn[Pn+9]&255)<<8,nr+=(Kn>>>4|er<<12)&8191,xr+=er>>>1&8191,or=wn[Pn+10]&255|(wn[Pn+11]&255)<<8,cr+=(er>>>14|or<<2)&8191,ar=wn[Pn+12]&255|(wn[Pn+13]&255)<<8,yr+=(or>>>11|ar<<5)&8191,Vr=wn[Pn+14]&255|(wn[Pn+15]&255)<<8,Ir+=(ar>>>8|Vr<<8)&8191,io+=Vr>>>5|Jt,wr=0,Or=wr,Or+=Nr*so,Or+=Fr*(5*Ro),Or+=Pr*(5*$o),Or+=_i*(5*bo),Or+=nr*(5*xo),wr=Or>>>13,Or&=8191,Or+=xr*(5*_o),Or+=cr*(5*vo),Or+=yr*(5*Yn),Or+=Ir*(5*po),Or+=io*(5*fo),wr+=Or>>>13,Or&=8191,Hr=wr,Hr+=Nr*fo,Hr+=Fr*so,Hr+=Pr*(5*Ro),Hr+=_i*(5*$o),Hr+=nr*(5*bo),wr=Hr>>>13,Hr&=8191,Hr+=xr*(5*xo),Hr+=cr*(5*_o),Hr+=yr*(5*vo),Hr+=Ir*(5*Yn),Hr+=io*(5*po),wr+=Hr>>>13,Hr&=8191,no=wr,no+=Nr*po,no+=Fr*fo,no+=Pr*so,no+=_i*(5*Ro),no+=nr*(5*$o),wr=no>>>13,no&=8191,no+=xr*(5*bo),no+=cr*(5*xo),no+=yr*(5*_o),no+=Ir*(5*vo),no+=io*(5*Yn),wr+=no>>>13,no&=8191,Xr=wr,Xr+=Nr*Yn,Xr+=Fr*po,Xr+=Pr*fo,Xr+=_i*so,Xr+=nr*(5*Ro),wr=Xr>>>13,Xr&=8191,Xr+=xr*(5*$o),Xr+=cr*(5*bo),Xr+=yr*(5*xo),Xr+=Ir*(5*_o),Xr+=io*(5*vo),wr+=Xr>>>13,Xr&=8191,Jr=wr,Jr+=Nr*vo,Jr+=Fr*Yn,Jr+=Pr*po,Jr+=_i*fo,Jr+=nr*so,wr=Jr>>>13,Jr&=8191,Jr+=xr*(5*Ro),Jr+=cr*(5*$o),Jr+=yr*(5*bo),Jr+=Ir*(5*xo),Jr+=io*(5*_o),wr+=Jr>>>13,Jr&=8191,br=wr,br+=Nr*_o,br+=Fr*vo,br+=Pr*Yn,br+=_i*po,br+=nr*fo,wr=br>>>13,br&=8191,br+=xr*so,br+=cr*(5*Ro),br+=yr*(5*$o),br+=Ir*(5*bo),br+=io*(5*xo),wr+=br>>>13,br&=8191,$r=wr,$r+=Nr*xo,$r+=Fr*_o,$r+=Pr*vo,$r+=_i*Yn,$r+=nr*po,wr=$r>>>13,$r&=8191,$r+=xr*fo,$r+=cr*so,$r+=yr*(5*Ro),$r+=Ir*(5*$o),$r+=io*(5*bo),wr+=$r>>>13,$r&=8191,Dr=wr,Dr+=Nr*bo,Dr+=Fr*xo,Dr+=Pr*_o,Dr+=_i*vo,Dr+=nr*Yn,wr=Dr>>>13,Dr&=8191,Dr+=xr*po,Dr+=cr*fo,Dr+=yr*so,Dr+=Ir*(5*Ro),Dr+=io*(5*$o),wr+=Dr>>>13,Dr&=8191,Cr=wr,Cr+=Nr*$o,Cr+=Fr*bo,Cr+=Pr*xo,Cr+=_i*_o,Cr+=nr*vo,wr=Cr>>>13,Cr&=8191,Cr+=xr*Yn,Cr+=cr*po,Cr+=yr*fo,Cr+=Ir*so,Cr+=io*(5*Ro),wr+=Cr>>>13,Cr&=8191,Ar=wr,Ar+=Nr*Ro,Ar+=Fr*$o,Ar+=Pr*bo,Ar+=_i*xo,Ar+=nr*_o,wr=Ar>>>13,Ar&=8191,Ar+=xr*vo,Ar+=cr*Yn,Ar+=yr*po,Ar+=Ir*fo,Ar+=io*so,wr+=Ar>>>13,Ar&=8191,wr=(wr<<2)+wr|0,wr=wr+Or|0,Or=wr&8191,wr=wr>>>13,Hr+=wr,Nr=Or,Fr=Hr,Pr=no,_i=Xr,nr=Jr,xr=br,cr=$r,yr=Dr,Ir=Cr,io=Ar,Pn+=16,fn-=16;this.h[0]=Nr,this.h[1]=Fr,this.h[2]=Pr,this.h[3]=_i,this.h[4]=nr,this.h[5]=xr,this.h[6]=cr,this.h[7]=yr,this.h[8]=Ir,this.h[9]=io},Lt.prototype.finish=function(wn,Pn){var fn=new Uint16Array(10),Jt,kn,On,Dn;if(this.leftover){for(Dn=this.leftover,this.buffer[Dn++]=1;Dn<16;Dn++)this.buffer[Dn]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(Jt=this.h[1]>>>13,this.h[1]&=8191,Dn=2;Dn<10;Dn++)this.h[Dn]+=Jt,Jt=this.h[Dn]>>>13,this.h[Dn]&=8191;for(this.h[0]+=Jt*5,Jt=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=Jt,Jt=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=Jt,fn[0]=this.h[0]+5,Jt=fn[0]>>>13,fn[0]&=8191,Dn=1;Dn<10;Dn++)fn[Dn]=this.h[Dn]+Jt,Jt=fn[Dn]>>>13,fn[Dn]&=8191;for(fn[9]-=8192,kn=(Jt^1)-1,Dn=0;Dn<10;Dn++)fn[Dn]&=kn;for(kn=~kn,Dn=0;Dn<10;Dn++)this.h[Dn]=this.h[Dn]&kn|fn[Dn];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,On=this.h[0]+this.pad[0],this.h[0]=On&65535,Dn=1;Dn<8;Dn++)On=(this.h[Dn]+this.pad[Dn]|0)+(On>>>16)|0,this.h[Dn]=On&65535;wn[Pn+0]=this.h[0]>>>0&255,wn[Pn+1]=this.h[0]>>>8&255,wn[Pn+2]=this.h[1]>>>0&255,wn[Pn+3]=this.h[1]>>>8&255,wn[Pn+4]=this.h[2]>>>0&255,wn[Pn+5]=this.h[2]>>>8&255,wn[Pn+6]=this.h[3]>>>0&255,wn[Pn+7]=this.h[3]>>>8&255,wn[Pn+8]=this.h[4]>>>0&255,wn[Pn+9]=this.h[4]>>>8&255,wn[Pn+10]=this.h[5]>>>0&255,wn[Pn+11]=this.h[5]>>>8&255,wn[Pn+12]=this.h[6]>>>0&255,wn[Pn+13]=this.h[6]>>>8&255,wn[Pn+14]=this.h[7]>>>0&255,wn[Pn+15]=this.h[7]>>>8&255},Lt.prototype.update=function(wn,Pn,fn){var Jt,kn;if(this.leftover){for(kn=16-this.leftover,kn>fn&&(kn=fn),Jt=0;Jt=16&&(kn=fn-fn%16,this.blocks(wn,Pn,kn),Pn+=kn,fn-=kn),fn){for(Jt=0;Jt>16&1),On[fn-1]&=65535;On[15]=Dn[15]-32767-(On[14]>>16&1),kn=On[15]>>16&1,On[14]&=65535,jt(Dn,On,1-kn)}for(fn=0;fn<16;fn++)wn[2*fn]=Dn[fn]&255,wn[2*fn+1]=Dn[fn]>>8}function Ct(wn,Pn){var fn=new Uint8Array(32),Jt=new Uint8Array(32);return Ot(fn,wn),Ot(Jt,Pn),yt(fn,0,Jt,0)}function Dt(wn){var Pn=new Uint8Array(32);return Ot(Pn,wn),Pn[0]&1}function Mt(wn,Pn){var fn;for(fn=0;fn<16;fn++)wn[fn]=Pn[2*fn]+(Pn[2*fn+1]<<8);wn[15]&=32767}function Vt(wn,Pn,fn){for(var Jt=0;Jt<16;Jt++)wn[Jt]=Pn[Jt]+fn[Jt]}function Qt(wn,Pn,fn){for(var Jt=0;Jt<16;Jt++)wn[Jt]=Pn[Jt]-fn[Jt]}function rn(wn,Pn,fn){var Jt,kn,On=0,Dn=0,Kn=0,er=0,or=0,ar=0,Vr=0,wr=0,Or=0,Hr=0,no=0,Xr=0,Jr=0,br=0,$r=0,Dr=0,Cr=0,Ar=0,Nr=0,Fr=0,Pr=0,_i=0,nr=0,xr=0,cr=0,yr=0,Ir=0,io=0,so=0,fo=0,po=0,Yn=fn[0],vo=fn[1],_o=fn[2],xo=fn[3],bo=fn[4],$o=fn[5],Ro=fn[6],Wo=fn[7],Po=fn[8],Fo=fn[9],Go=fn[10],Xo=fn[11],ga=fn[12],na=fn[13],$a=fn[14],Jo=fn[15];Jt=Pn[0],On+=Jt*Yn,Dn+=Jt*vo,Kn+=Jt*_o,er+=Jt*xo,or+=Jt*bo,ar+=Jt*$o,Vr+=Jt*Ro,wr+=Jt*Wo,Or+=Jt*Po,Hr+=Jt*Fo,no+=Jt*Go,Xr+=Jt*Xo,Jr+=Jt*ga,br+=Jt*na,$r+=Jt*$a,Dr+=Jt*Jo,Jt=Pn[1],Dn+=Jt*Yn,Kn+=Jt*vo,er+=Jt*_o,or+=Jt*xo,ar+=Jt*bo,Vr+=Jt*$o,wr+=Jt*Ro,Or+=Jt*Wo,Hr+=Jt*Po,no+=Jt*Fo,Xr+=Jt*Go,Jr+=Jt*Xo,br+=Jt*ga,$r+=Jt*na,Dr+=Jt*$a,Cr+=Jt*Jo,Jt=Pn[2],Kn+=Jt*Yn,er+=Jt*vo,or+=Jt*_o,ar+=Jt*xo,Vr+=Jt*bo,wr+=Jt*$o,Or+=Jt*Ro,Hr+=Jt*Wo,no+=Jt*Po,Xr+=Jt*Fo,Jr+=Jt*Go,br+=Jt*Xo,$r+=Jt*ga,Dr+=Jt*na,Cr+=Jt*$a,Ar+=Jt*Jo,Jt=Pn[3],er+=Jt*Yn,or+=Jt*vo,ar+=Jt*_o,Vr+=Jt*xo,wr+=Jt*bo,Or+=Jt*$o,Hr+=Jt*Ro,no+=Jt*Wo,Xr+=Jt*Po,Jr+=Jt*Fo,br+=Jt*Go,$r+=Jt*Xo,Dr+=Jt*ga,Cr+=Jt*na,Ar+=Jt*$a,Nr+=Jt*Jo,Jt=Pn[4],or+=Jt*Yn,ar+=Jt*vo,Vr+=Jt*_o,wr+=Jt*xo,Or+=Jt*bo,Hr+=Jt*$o,no+=Jt*Ro,Xr+=Jt*Wo,Jr+=Jt*Po,br+=Jt*Fo,$r+=Jt*Go,Dr+=Jt*Xo,Cr+=Jt*ga,Ar+=Jt*na,Nr+=Jt*$a,Fr+=Jt*Jo,Jt=Pn[5],ar+=Jt*Yn,Vr+=Jt*vo,wr+=Jt*_o,Or+=Jt*xo,Hr+=Jt*bo,no+=Jt*$o,Xr+=Jt*Ro,Jr+=Jt*Wo,br+=Jt*Po,$r+=Jt*Fo,Dr+=Jt*Go,Cr+=Jt*Xo,Ar+=Jt*ga,Nr+=Jt*na,Fr+=Jt*$a,Pr+=Jt*Jo,Jt=Pn[6],Vr+=Jt*Yn,wr+=Jt*vo,Or+=Jt*_o,Hr+=Jt*xo,no+=Jt*bo,Xr+=Jt*$o,Jr+=Jt*Ro,br+=Jt*Wo,$r+=Jt*Po,Dr+=Jt*Fo,Cr+=Jt*Go,Ar+=Jt*Xo,Nr+=Jt*ga,Fr+=Jt*na,Pr+=Jt*$a,_i+=Jt*Jo,Jt=Pn[7],wr+=Jt*Yn,Or+=Jt*vo,Hr+=Jt*_o,no+=Jt*xo,Xr+=Jt*bo,Jr+=Jt*$o,br+=Jt*Ro,$r+=Jt*Wo,Dr+=Jt*Po,Cr+=Jt*Fo,Ar+=Jt*Go,Nr+=Jt*Xo,Fr+=Jt*ga,Pr+=Jt*na,_i+=Jt*$a,nr+=Jt*Jo,Jt=Pn[8],Or+=Jt*Yn,Hr+=Jt*vo,no+=Jt*_o,Xr+=Jt*xo,Jr+=Jt*bo,br+=Jt*$o,$r+=Jt*Ro,Dr+=Jt*Wo,Cr+=Jt*Po,Ar+=Jt*Fo,Nr+=Jt*Go,Fr+=Jt*Xo,Pr+=Jt*ga,_i+=Jt*na,nr+=Jt*$a,xr+=Jt*Jo,Jt=Pn[9],Hr+=Jt*Yn,no+=Jt*vo,Xr+=Jt*_o,Jr+=Jt*xo,br+=Jt*bo,$r+=Jt*$o,Dr+=Jt*Ro,Cr+=Jt*Wo,Ar+=Jt*Po,Nr+=Jt*Fo,Fr+=Jt*Go,Pr+=Jt*Xo,_i+=Jt*ga,nr+=Jt*na,xr+=Jt*$a,cr+=Jt*Jo,Jt=Pn[10],no+=Jt*Yn,Xr+=Jt*vo,Jr+=Jt*_o,br+=Jt*xo,$r+=Jt*bo,Dr+=Jt*$o,Cr+=Jt*Ro,Ar+=Jt*Wo,Nr+=Jt*Po,Fr+=Jt*Fo,Pr+=Jt*Go,_i+=Jt*Xo,nr+=Jt*ga,xr+=Jt*na,cr+=Jt*$a,yr+=Jt*Jo,Jt=Pn[11],Xr+=Jt*Yn,Jr+=Jt*vo,br+=Jt*_o,$r+=Jt*xo,Dr+=Jt*bo,Cr+=Jt*$o,Ar+=Jt*Ro,Nr+=Jt*Wo,Fr+=Jt*Po,Pr+=Jt*Fo,_i+=Jt*Go,nr+=Jt*Xo,xr+=Jt*ga,cr+=Jt*na,yr+=Jt*$a,Ir+=Jt*Jo,Jt=Pn[12],Jr+=Jt*Yn,br+=Jt*vo,$r+=Jt*_o,Dr+=Jt*xo,Cr+=Jt*bo,Ar+=Jt*$o,Nr+=Jt*Ro,Fr+=Jt*Wo,Pr+=Jt*Po,_i+=Jt*Fo,nr+=Jt*Go,xr+=Jt*Xo,cr+=Jt*ga,yr+=Jt*na,Ir+=Jt*$a,io+=Jt*Jo,Jt=Pn[13],br+=Jt*Yn,$r+=Jt*vo,Dr+=Jt*_o,Cr+=Jt*xo,Ar+=Jt*bo,Nr+=Jt*$o,Fr+=Jt*Ro,Pr+=Jt*Wo,_i+=Jt*Po,nr+=Jt*Fo,xr+=Jt*Go,cr+=Jt*Xo,yr+=Jt*ga,Ir+=Jt*na,io+=Jt*$a,so+=Jt*Jo,Jt=Pn[14],$r+=Jt*Yn,Dr+=Jt*vo,Cr+=Jt*_o,Ar+=Jt*xo,Nr+=Jt*bo,Fr+=Jt*$o,Pr+=Jt*Ro,_i+=Jt*Wo,nr+=Jt*Po,xr+=Jt*Fo,cr+=Jt*Go,yr+=Jt*Xo,Ir+=Jt*ga,io+=Jt*na,so+=Jt*$a,fo+=Jt*Jo,Jt=Pn[15],Dr+=Jt*Yn,Cr+=Jt*vo,Ar+=Jt*_o,Nr+=Jt*xo,Fr+=Jt*bo,Pr+=Jt*$o,_i+=Jt*Ro,nr+=Jt*Wo,xr+=Jt*Po,cr+=Jt*Fo,yr+=Jt*Go,Ir+=Jt*Xo,io+=Jt*ga,so+=Jt*na,fo+=Jt*$a,po+=Jt*Jo,On+=38*Cr,Dn+=38*Ar,Kn+=38*Nr,er+=38*Fr,or+=38*Pr,ar+=38*_i,Vr+=38*nr,wr+=38*xr,Or+=38*cr,Hr+=38*yr,no+=38*Ir,Xr+=38*io,Jr+=38*so,br+=38*fo,$r+=38*po,kn=1,Jt=On+kn+65535,kn=Math.floor(Jt/65536),On=Jt-kn*65536,Jt=Dn+kn+65535,kn=Math.floor(Jt/65536),Dn=Jt-kn*65536,Jt=Kn+kn+65535,kn=Math.floor(Jt/65536),Kn=Jt-kn*65536,Jt=er+kn+65535,kn=Math.floor(Jt/65536),er=Jt-kn*65536,Jt=or+kn+65535,kn=Math.floor(Jt/65536),or=Jt-kn*65536,Jt=ar+kn+65535,kn=Math.floor(Jt/65536),ar=Jt-kn*65536,Jt=Vr+kn+65535,kn=Math.floor(Jt/65536),Vr=Jt-kn*65536,Jt=wr+kn+65535,kn=Math.floor(Jt/65536),wr=Jt-kn*65536,Jt=Or+kn+65535,kn=Math.floor(Jt/65536),Or=Jt-kn*65536,Jt=Hr+kn+65535,kn=Math.floor(Jt/65536),Hr=Jt-kn*65536,Jt=no+kn+65535,kn=Math.floor(Jt/65536),no=Jt-kn*65536,Jt=Xr+kn+65535,kn=Math.floor(Jt/65536),Xr=Jt-kn*65536,Jt=Jr+kn+65535,kn=Math.floor(Jt/65536),Jr=Jt-kn*65536,Jt=br+kn+65535,kn=Math.floor(Jt/65536),br=Jt-kn*65536,Jt=$r+kn+65535,kn=Math.floor(Jt/65536),$r=Jt-kn*65536,Jt=Dr+kn+65535,kn=Math.floor(Jt/65536),Dr=Jt-kn*65536,On+=kn-1+37*(kn-1),kn=1,Jt=On+kn+65535,kn=Math.floor(Jt/65536),On=Jt-kn*65536,Jt=Dn+kn+65535,kn=Math.floor(Jt/65536),Dn=Jt-kn*65536,Jt=Kn+kn+65535,kn=Math.floor(Jt/65536),Kn=Jt-kn*65536,Jt=er+kn+65535,kn=Math.floor(Jt/65536),er=Jt-kn*65536,Jt=or+kn+65535,kn=Math.floor(Jt/65536),or=Jt-kn*65536,Jt=ar+kn+65535,kn=Math.floor(Jt/65536),ar=Jt-kn*65536,Jt=Vr+kn+65535,kn=Math.floor(Jt/65536),Vr=Jt-kn*65536,Jt=wr+kn+65535,kn=Math.floor(Jt/65536),wr=Jt-kn*65536,Jt=Or+kn+65535,kn=Math.floor(Jt/65536),Or=Jt-kn*65536,Jt=Hr+kn+65535,kn=Math.floor(Jt/65536),Hr=Jt-kn*65536,Jt=no+kn+65535,kn=Math.floor(Jt/65536),no=Jt-kn*65536,Jt=Xr+kn+65535,kn=Math.floor(Jt/65536),Xr=Jt-kn*65536,Jt=Jr+kn+65535,kn=Math.floor(Jt/65536),Jr=Jt-kn*65536,Jt=br+kn+65535,kn=Math.floor(Jt/65536),br=Jt-kn*65536,Jt=$r+kn+65535,kn=Math.floor(Jt/65536),$r=Jt-kn*65536,Jt=Dr+kn+65535,kn=Math.floor(Jt/65536),Dr=Jt-kn*65536,On+=kn-1+37*(kn-1),wn[0]=On,wn[1]=Dn,wn[2]=Kn,wn[3]=er,wn[4]=or,wn[5]=ar,wn[6]=Vr,wn[7]=wr,wn[8]=Or,wn[9]=Hr,wn[10]=no,wn[11]=Xr,wn[12]=Jr,wn[13]=br,wn[14]=$r,wn[15]=Dr}function Xt(wn,Pn){rn(wn,Pn,Pn)}function an(wn,Pn){var fn=nt(),Jt;for(Jt=0;Jt<16;Jt++)fn[Jt]=Pn[Jt];for(Jt=253;Jt>=0;Jt--)Xt(fn,fn),Jt!==2&&Jt!==4&&rn(fn,fn,Pn);for(Jt=0;Jt<16;Jt++)wn[Jt]=fn[Jt]}function tn(wn,Pn){var fn=nt(),Jt;for(Jt=0;Jt<16;Jt++)fn[Jt]=Pn[Jt];for(Jt=250;Jt>=0;Jt--)Xt(fn,fn),Jt!==1&&rn(fn,fn,Pn);for(Jt=0;Jt<16;Jt++)wn[Jt]=fn[Jt]}function pn(wn,Pn,fn){var Jt=new Uint8Array(32),kn=new Float64Array(80),On,Dn,Kn=nt(),er=nt(),or=nt(),ar=nt(),Vr=nt(),wr=nt();for(Dn=0;Dn<31;Dn++)Jt[Dn]=Pn[Dn];for(Jt[31]=Pn[31]&127|64,Jt[0]&=248,Mt(kn,fn),Dn=0;Dn<16;Dn++)er[Dn]=kn[Dn],ar[Dn]=Kn[Dn]=or[Dn]=0;for(Kn[0]=ar[0]=1,Dn=254;Dn>=0;--Dn)On=Jt[Dn>>>3]>>>(Dn&7)&1,jt(Kn,er,On),jt(or,ar,On),Vt(Vr,Kn,or),Qt(Kn,Kn,or),Vt(or,er,ar),Qt(er,er,ar),Xt(ar,Vr),Xt(wr,Kn),rn(Kn,or,Kn),rn(or,er,Vr),Vt(Vr,Kn,or),Qt(Kn,Kn,or),Xt(er,Kn),Qt(or,ar,wr),rn(Kn,or,lt),Vt(Kn,Kn,ar),rn(or,or,Kn),rn(Kn,ar,wr),rn(ar,er,kn),Xt(er,Vr),jt(Kn,er,On),jt(or,ar,On);for(Dn=0;Dn<16;Dn++)kn[Dn+16]=Kn[Dn],kn[Dn+32]=or[Dn],kn[Dn+48]=er[Dn],kn[Dn+64]=ar[Dn];var Or=kn.subarray(32),Hr=kn.subarray(16);return an(Or,Or),rn(Hr,Hr,Or),Ot(wn,Hr),0}function vn(wn,Pn){return pn(wn,Pn,ot)}function sn(wn,Pn){return it(Pn,32),vn(wn,Pn)}function Zt(wn,Pn,fn){var Jt=new Uint8Array(32);return pn(Jt,fn,Pn),St(wn,rt,Jt,Et)}var Sn=kt,Tn=At;function Cn(wn,Pn,fn,Jt,kn,On){var Dn=new Uint8Array(32);return Zt(Dn,kn,On),Sn(wn,Pn,fn,Jt,Dn)}function jn(wn,Pn,fn,Jt,kn,On){var Dn=new Uint8Array(32);return Zt(Dn,kn,On),Tn(wn,Pn,fn,Jt,Dn)}var Un=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function yn(wn,Pn,fn,Jt){for(var kn=new Int32Array(16),On=new Int32Array(16),Dn,Kn,er,or,ar,Vr,wr,Or,Hr,no,Xr,Jr,br,$r,Dr,Cr,Ar,Nr,Fr,Pr,_i,nr,xr,cr,yr,Ir,io=wn[0],so=wn[1],fo=wn[2],po=wn[3],Yn=wn[4],vo=wn[5],_o=wn[6],xo=wn[7],bo=Pn[0],$o=Pn[1],Ro=Pn[2],Wo=Pn[3],Po=Pn[4],Fo=Pn[5],Go=Pn[6],Xo=Pn[7],ga=0;Jt>=128;){for(Fr=0;Fr<16;Fr++)Pr=8*Fr+ga,kn[Fr]=fn[Pr+0]<<24|fn[Pr+1]<<16|fn[Pr+2]<<8|fn[Pr+3],On[Fr]=fn[Pr+4]<<24|fn[Pr+5]<<16|fn[Pr+6]<<8|fn[Pr+7];for(Fr=0;Fr<80;Fr++)if(Dn=io,Kn=so,er=fo,or=po,ar=Yn,Vr=vo,wr=_o,Or=xo,Hr=bo,no=$o,Xr=Ro,Jr=Wo,br=Po,$r=Fo,Dr=Go,Cr=Xo,_i=xo,nr=Xo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=(Yn>>>14|Po<<32-14)^(Yn>>>18|Po<<32-18)^(Po>>>41-32|Yn<<32-(41-32)),nr=(Po>>>14|Yn<<32-14)^(Po>>>18|Yn<<32-18)^(Yn>>>41-32|Po<<32-(41-32)),xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,_i=Yn&vo^~Yn&_o,nr=Po&Fo^~Po&Go,xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,_i=Un[Fr*2],nr=Un[Fr*2+1],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,_i=kn[Fr%16],nr=On[Fr%16],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,Ar=yr&65535|Ir<<16,Nr=xr&65535|cr<<16,_i=Ar,nr=Nr,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=(io>>>28|bo<<32-28)^(bo>>>34-32|io<<32-(34-32))^(bo>>>39-32|io<<32-(39-32)),nr=(bo>>>28|io<<32-28)^(io>>>34-32|bo<<32-(34-32))^(io>>>39-32|bo<<32-(39-32)),xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,_i=io&so^io&fo^so&fo,nr=bo&$o^bo&Ro^$o&Ro,xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,Or=yr&65535|Ir<<16,Cr=xr&65535|cr<<16,_i=or,nr=Jr,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=Ar,nr=Nr,xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,or=yr&65535|Ir<<16,Jr=xr&65535|cr<<16,so=Dn,fo=Kn,po=er,Yn=or,vo=ar,_o=Vr,xo=wr,io=Or,$o=Hr,Ro=no,Wo=Xr,Po=Jr,Fo=br,Go=$r,Xo=Dr,bo=Cr,Fr%16===15)for(Pr=0;Pr<16;Pr++)_i=kn[Pr],nr=On[Pr],xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=kn[(Pr+9)%16],nr=On[(Pr+9)%16],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,Ar=kn[(Pr+1)%16],Nr=On[(Pr+1)%16],_i=(Ar>>>1|Nr<<32-1)^(Ar>>>8|Nr<<32-8)^Ar>>>7,nr=(Nr>>>1|Ar<<32-1)^(Nr>>>8|Ar<<32-8)^(Nr>>>7|Ar<<32-7),xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,Ar=kn[(Pr+14)%16],Nr=On[(Pr+14)%16],_i=(Ar>>>19|Nr<<32-19)^(Nr>>>61-32|Ar<<32-(61-32))^Ar>>>6,nr=(Nr>>>19|Ar<<32-19)^(Ar>>>61-32|Nr<<32-(61-32))^(Nr>>>6|Ar<<32-6),xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,kn[Pr]=yr&65535|Ir<<16,On[Pr]=xr&65535|cr<<16;_i=io,nr=bo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=wn[0],nr=Pn[0],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,wn[0]=io=yr&65535|Ir<<16,Pn[0]=bo=xr&65535|cr<<16,_i=so,nr=$o,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=wn[1],nr=Pn[1],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,wn[1]=so=yr&65535|Ir<<16,Pn[1]=$o=xr&65535|cr<<16,_i=fo,nr=Ro,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=wn[2],nr=Pn[2],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,wn[2]=fo=yr&65535|Ir<<16,Pn[2]=Ro=xr&65535|cr<<16,_i=po,nr=Wo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=wn[3],nr=Pn[3],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,wn[3]=po=yr&65535|Ir<<16,Pn[3]=Wo=xr&65535|cr<<16,_i=Yn,nr=Po,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=wn[4],nr=Pn[4],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,wn[4]=Yn=yr&65535|Ir<<16,Pn[4]=Po=xr&65535|cr<<16,_i=vo,nr=Fo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=wn[5],nr=Pn[5],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,wn[5]=vo=yr&65535|Ir<<16,Pn[5]=Fo=xr&65535|cr<<16,_i=_o,nr=Go,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=wn[6],nr=Pn[6],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,wn[6]=_o=yr&65535|Ir<<16,Pn[6]=Go=xr&65535|cr<<16,_i=xo,nr=Xo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=wn[7],nr=Pn[7],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,wn[7]=xo=yr&65535|Ir<<16,Pn[7]=Xo=xr&65535|cr<<16,ga+=128,Jt-=128}return Jt}function un(wn,Pn,fn){var Jt=new Int32Array(8),kn=new Int32Array(8),On=new Uint8Array(256),Dn,Kn=fn;for(Jt[0]=1779033703,Jt[1]=3144134277,Jt[2]=1013904242,Jt[3]=2773480762,Jt[4]=1359893119,Jt[5]=2600822924,Jt[6]=528734635,Jt[7]=1541459225,kn[0]=4089235720,kn[1]=2227873595,kn[2]=4271175723,kn[3]=1595750129,kn[4]=2917565137,kn[5]=725511199,kn[6]=4215389547,kn[7]=327033209,yn(Jt,kn,Pn,fn),fn%=128,Dn=0;Dn=0;--kn)Jt=fn[kn/8|0]>>(kn&7)&1,In(wn,Pn,Jt),En(Pn,wn),En(wn,wn),In(wn,Pn,Jt)}function cn(wn,Pn){var fn=[nt(),nt(),nt(),nt()];Rt(fn[0],ht),Rt(fn[1],dt),Rt(fn[2],st),rn(fn[3],ht,dt),dn(wn,fn,Pn)}function hn(wn,Pn,fn){var Jt=new Uint8Array(64),kn=[nt(),nt(),nt(),nt()],On;for(fn||it(Pn,32),un(Jt,Pn,32),Jt[0]&=248,Jt[31]&=127,Jt[31]|=64,cn(kn,Jt),xn(wn,kn),On=0;On<32;On++)Pn[On+32]=wn[On];return 0}var $n=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function nn(wn,Pn){var fn,Jt,kn,On;for(Jt=63;Jt>=32;--Jt){for(fn=0,kn=Jt-32,On=Jt-12;kn>4)*$n[kn],fn=Pn[kn]>>8,Pn[kn]&=255;for(kn=0;kn<32;kn++)Pn[kn]-=fn*$n[kn];for(Jt=0;Jt<32;Jt++)Pn[Jt+1]+=Pn[Jt]>>8,wn[Jt]=Pn[Jt]&255}function Kt(wn){var Pn=new Float64Array(64),fn;for(fn=0;fn<64;fn++)Pn[fn]=wn[fn];for(fn=0;fn<64;fn++)wn[fn]=0;nn(wn,Pn)}function Yt(wn,Pn,fn,Jt){var kn=new Uint8Array(64),On=new Uint8Array(64),Dn=new Uint8Array(64),Kn,er,or=new Float64Array(64),ar=[nt(),nt(),nt(),nt()];un(kn,Jt,32),kn[0]&=248,kn[31]&=127,kn[31]|=64;var Vr=fn+64;for(Kn=0;Kn>7&&Qt(wn[0],at,wn[0]),rn(wn[3],wn[0],wn[1]),0)}function Mn(wn,Pn,fn,Jt){var kn,On=new Uint8Array(32),Dn=new Uint8Array(64),Kn=[nt(),nt(),nt(),nt()],er=[nt(),nt(),nt(),nt()];if(fn<64||_n(er,Jt))return-1;for(kn=0;kn=0},et.sign.keyPair=function(){var wn=new Uint8Array(Mr),Pn=new Uint8Array(qr);return hn(wn,Pn),{publicKey:wn,secretKey:Pn}},et.sign.keyPair.fromSecretKey=function(wn){if(Br(wn),wn.length!==qr)throw new Error("bad secret key size");for(var Pn=new Uint8Array(Mr),fn=0;fn"u"?typeof Buffer.from<"u"?(et.encodeBase64=function(it){return Buffer.from(it).toString("base64")},et.decodeBase64=function(it){return nt(it),new Uint8Array(Array.prototype.slice.call(Buffer.from(it,"base64"),0))}):(et.encodeBase64=function(it){return new Buffer(it).toString("base64")},et.decodeBase64=function(it){return nt(it),new Uint8Array(Array.prototype.slice.call(new Buffer(it,"base64"),0))}):(et.encodeBase64=function(it){var rt,ot=[],at=it.length;for(rt=0;rtgt||un<0)throw new RangeError(`varint ${un} out of range`);this._grow(this._length+wt);let En=this._length;for(;un>=128;)this._buf[En++]=un&255|128,un>>>=7;this._buf[En++]=un|0,this._length=En}get bytes(){return this._buf.subarray(0,this._length)}_grow(un){const En=this._buf.length;if(un<=En)return;const In=En*2,xn=un>In?un:In,dn=new Uint8Array(xn);dn.set(this._buf.subarray(0,this._length)),this._buf=dn}}const wt=5;class vt{constructor(un){this._buf=un,this._index=0}readByte(){if(this.length<=0)throw new RangeError("Read past end of buffer");return this._buf[this._index++]}peekByte(){if(this.length<=0)throw new RangeError("Read past end of buffer");return this._buf[this._index]}readN(un){if(this.lengthwt||cn===wt&&dn>1)throw new RangeError("Overflow error decoding varint");return(En|dn<>>0}En|=(dn&127)<yn!=null,St=yn=>xt(yn)?st.encode(yn):yn,Et=yn=>xt(yn)?lt.decode(yn):yn,It=yn=>nt.default.codec.utf8String.fromBits(yn);tt.base64ToBytes=function(yn){return yn=yn.replace(/-/g,"+").replace(/_/g,"/"),yn.length%4!==0&&!yn.match(/=$/)&&(yn+="=".repeat(4-yn.length%4)),rt.default.decodeBase64(yn)},tt.bytesToBase64=function(yn){return rt.default.encodeBase64(yn).replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")};const Tt=function(yn){return nt.default.codec.base64.toBits(rt.default.encodeBase64(yn))},$t=function(yn){return rt.default.decodeBase64(nt.default.codec.base64.fromBits(yn))},Ut=function(yn){const un=new Uint8Array(Math.ceil(yn.length/2));for(let En=0;Enxt(yn)?Bt(yn,un):"",kt=function(yn,un){if(yn instanceof Uint8Array)return yn;if(typeof yn=="string")return St(yn);throw new TypeError(`${un} has the wrong type; want string or Uint8Array, got ${typeof yn}.`)},At=new Uint8Array,Rt=function(yn,un){const En=yn.readByte();if(En!==un)throw new Error(`Unexpected field type, got ${En} want ${un}`);return En===ut?At:yn.readN(yn.readUvarint())},Wt=function(yn,un,En){yn.appendByte(un),un!==ut&&(yn.appendUvarint(En.length),yn.appendBytes(En))},jt=function(yn,un){return yn.peekByte()!==un?null:Rt(yn,un)},Ot=function(yn,un,En){Lt(En)?yn[un]=Et(En):yn[un+"64"]=tt.bytesToBase64(En)},Ct=function(yn,un){const En=new nt.default.misc.hmac(yn,nt.default.hash.sha256);return En.update(un),En.digest()},Dt=function(yn,un,En){const In=Ct(yn,un),xn=Ct(yn,En);return Ct(yn,nt.default.bitArray.concat(In,xn))},Mt=Tt(St("macaroons-key-generator")),Vt=function(yn){return Ct(Mt,yn)},Qt=function(){return it.default.randomBytes(ct)},rn=function(yn,un){const En=$t(yn),In=$t(un),xn=Qt(),dn=it.default.secretbox(In,xn,En),cn=new Uint8Array(xn.length+dn.length);return cn.set(xn,0),cn.set(dn,xn.length),Tt(cn)},Xt=function(yn,un){const En=$t(yn),In=$t(un),xn=In.slice(0,ct),dn=In.slice(ct);let cn=it.default.secretbox.open(dn,xn,En);if(!cn)throw new Error("decryption failed");return Tt(cn)},an=Tt(St("\0".repeat(32))),tn=function(yn,un){return nt.default.bitArray.equal(yn,un)?yn:Dt(an,yn,un)};class pn{constructor(un){if(!un)return;let{version:En,identifierBytes:In,locationStr:xn,caveats:dn,signatureBytes:cn}=un;if(En!==1&&En!==2)throw new Error(`Unexpected version ${En}`);if(this._version=En,this._locationStr=xn,In=kt(In,"Identifier"),En===1&&!Lt(In))throw new Error("Version 1 macaroon identifier must be well-formed UTF-8");this._identifierBits=In&&Tt(In),this._signatureBits=cn&&Tt(kt(cn,"Signature")),this._caveats=dn?dn.map(hn=>{const $n=kt(hn.identifierBytes,"Caveat identifier");if(En===1&&!Lt($n))throw new Error("Version 1 caveat identifier must be well-formed UTF-8");return{_locationStr:Pt(hn.locationStr),_identifierBits:Tt($n),_vidBits:hn.vidBytes&&Tt(kt(hn.vidBytes,"Verification ID"))}}):[]}get caveats(){return this._caveats.map(un=>xt(un._vidBits)?{identifier:$t(un._identifierBits),location:un._locationStr,vid:$t(un._vidBits)}:{identifier:$t(un._identifierBits)})}get location(){return this._locationStr}get identifier(){return $t(this._identifierBits)}get signature(){return $t(this._signatureBits)}addThirdPartyCaveat(un,En,In){const xn={_identifierBits:Tt(kt(En,"Caveat id")),_vidBits:rn(this._signatureBits,Vt(Tt(kt(un,"Caveat root key")))),_locationStr:Pt(In)};this._signatureBits=Dt(this._signatureBits,xn._vidBits,xn._identifierBits),this._caveats.push(xn)}addFirstPartyCaveat(un){const En=Tt(kt(un,"Condition"));this._caveats.push({_identifierBits:En}),this._signatureBits=Ct(this._signatureBits,En)}bindToRoot(un){const En=Tt(kt(un,"Primary macaroon signature"));this._signatureBits=tn(En,this._signatureBits)}clone(){const un=new pn;return un._version=this._version,un._signatureBits=this._signatureBits,un._identifierBits=this._identifierBits,un._locationStr=this._locationStr,un._caveats=this._caveats.slice(),un}verify(un,En,In=[]){const xn=Vt(Tt(kt(un,"Root key"))),dn=In.map(cn=>0);this._verify(this._signatureBits,xn,En,In,dn),In.forEach((cn,hn)=>{if(dn[hn]===0)throw new Error(`discharge macaroon ${bt(cn.identifier)} was not used`);if(dn[hn]!==1)throw new Error(`discharge macaroon ${bt(cn.identifier)} was used more than once`)})}_verify(un,En,In,xn,dn){let cn=Ct(En,this._identifierBits);this._caveats.forEach($n=>{if($n._vidBits){const nn=Xt(cn,$n._vidBits);let Kt=!1,Yt,_n;for(Yt=0;Yt1)throw new Error(`discharge macaroon ${bt(_n.identifier)} was used more than once`);_n._verify(un,nn,In,xn,dn);break}if(!Kt)throw new Error(`cannot find discharge macaroon for caveat ${bt($n._identifierBits)}`);cn=Dt(cn,$n._vidBits,$n._identifierBits)}else{const nn=It($n._identifierBits),Kt=In(nn);if(Kt)throw new Error(`caveat check failed (${nn}): ${Kt}`);cn=Ct(cn,$n._identifierBits)}});const hn=tn(un,cn);if(!nt.default.bitArray.equal(hn,this._signatureBits))throw new Error("signature mismatch after caveat verification")}exportJSON(){switch(this._version){case 1:return this._exportAsJSONObjectV1();case 2:return this._exportAsJSONObjectV2();default:throw new Error(`unexpected macaroon version ${this._version}`)}}_exportAsJSONObjectV1(){const un={identifier:It(this._identifierBits),signature:nt.default.codec.hex.fromBits(this._signatureBits)};return this._locationStr&&(un.location=this._locationStr),this._caveats.length>0&&(un.caveats=this._caveats.map(En=>{const In={cid:It(En._identifierBits)};return En._vidBits&&(In.vid=nt.default.codec.base64.fromBits(En._vidBits,!0,!0),In.cl=En._locationStr),In})),un}_exportAsJSONObjectV2(){const un={v:2};return Ot(un,"s",$t(this._signatureBits)),Ot(un,"i",$t(this._identifierBits)),this._locationStr&&(un.l=this._locationStr),this._caveats&&this._caveats.length>0&&(un.c=this._caveats.map(En=>{const In={};return Ot(In,"i",$t(En._identifierBits)),En._vidBits&&(Ot(In,"v",$t(En._vidBits)),In.l=En._locationStr),In})),un}_exportBinaryV1(){throw new Error("V1 binary export not supported")}_exportBinaryV2(){const un=new yt(200);return un.appendByte(2),this._locationStr&&Wt(un,ht,St(this._locationStr)),Wt(un,dt,$t(this._identifierBits)),Wt(un,ut),this._caveats.forEach(function(En){En._locationStr&&Wt(un,ht,St(En._locationStr)),Wt(un,dt,$t(En._identifierBits)),En._vidBits&&Wt(un,pt,$t(En._vidBits)),Wt(un,ut)}),Wt(un,ut),Wt(un,mt,$t(this._signatureBits)),un.bytes}exportBinary(){switch(this._version){case 1:return this._exportBinaryV1();case 2:return this._exportBinaryV2();default:throw new Error(`unexpected macaroon version ${this._version}`)}}}tt.importMacaroon=function(yn){if(typeof yn=="string"&&(yn=tt.base64ToBytes(yn)),yn instanceof Uint8Array){const un=new vt(yn),En=Un(un);if(un.length!==0)throw new TypeError("extra data found at end of serialized macaroon");return En}if(Array.isArray(yn))throw new TypeError("cannot import an array of macaroons as a single macaroon");return vn(yn)},tt.importMacaroons=function(yn){if(typeof yn=="string"&&(yn=tt.base64ToBytes(yn)),yn instanceof Uint8Array){if(yn.length===0)throw new TypeError("empty macaroon data");const un=new vt(yn),En=[];do En.push(Un(un));while(un.length>0);return En}return Array.isArray(yn)?yn.map(un=>vn(un)):[vn(yn)]};const vn=function(yn){return sn(yn)?Zt(yn):Sn(yn)};function sn(yn){return xt(yn.signature)}const Zt=function(yn){const un=yn.caveats&&yn.caveats.map(En=>{const In={identifierBytes:St(Bt(En.cid,"Caveat id")),locationStr:Pt(En.cl,"Caveat location")};return En.vid&&(In.vidBytes=tt.base64ToBytes(Bt(En.vid,"Caveat verification id"))),In});return new pn({version:1,locationStr:Pt(yn.location,"Macaroon location"),identifierBytes:St(Bt(yn.identifier,"Macaroon identifier")),caveats:un,signatureBytes:Ut(yn.signature)})},Sn=function(yn){if(yn.v!==2&&yn.v!==void 0)throw new Error(`Unsupported macaroon version ${yn.v}`);const un={version:2,signatureBytes:Tn(yn,"s",!0),locationStr:Et(Tn(yn,"l",!1)),identifierBytes:Tn(yn,"i",!0)};if(yn.c){if(!Array.isArray(yn.c))throw new Error("caveats field does not hold an array");un.caveats=yn.c.map(En=>({identifierBytes:Tn(En,"i",!0),locationStr:Et(Tn(En,"l")),vidBytes:Tn(En,"v",!1)}))}return new pn(un)};function Tn(yn,un,En){if(yn.hasOwnProperty(un))return St(yn[un]);const In=un+"64";if(yn.hasOwnProperty(In))return tt.base64ToBytes(yn[In]);if(En)throw new Error("Expected key: "+un);return null}const Cn=function(yn){const un=yn.readByte();if(un!==2)throw new Error(`Only version 2 is supported, found version ${un}`);const En=Et(jt(yn,ht)),In=Rt(yn,dt),xn=[];for(Rt(yn,ut);!jt(yn,ut);){const cn={locationStr:Et(jt(yn,ht)),identifierBytes:Rt(yn,dt),vidBytes:jt(yn,pt)};Rt(yn,ut),xn.push(cn)}const dn=Rt(yn,mt);if(yn.length!==0)throw new Error("unexpected extra data at end of macaroon");return new pn({version:un,locationStr:En,identifierBytes:In,signatureBytes:dn,caveats:xn})},jn=function(yn){return 48<=yn&&yn<=58||97<=yn&&yn<=102},Un=function(yn){if(yn.length===0)throw new Error("Empty macaroon data");const un=yn.peekByte();if(un===2)return Cn(yn);throw jn(un)?new Error("Version 1 binary format not supported"):new Error("Cannot determine data format of binary-encoded macaroon")};tt.newMacaroon=function({identifier:yn,location:un,rootKey:En,version:In}){const xn=kt(yn,"Macaroon identifier"),dn=kt(En,"Macaroon root key");return new pn({version:In===void 0?2:In,identifierBytes:xn,locationStr:Pt(un,"Macaroon location"),signatureBytes:$t(Ct(Vt(Tt(dn)),Tt(xn)))})},tt.dischargeMacaroon=function(yn,un,En,In){const xn=yn.signature,dn=[yn];let cn=0,hn=!1;const $n=yn.location,nn=_n=>{hn||(_n.bindToRoot(xn),dn.push(_n),cn--,Yt(_n))},Kt=_n=>{hn||(In(_n),hn=!0)},Yt=_n=>{let Mn,Bn;for(Bn=0;Bn<_n._caveats.length;Bn++)Mn=_n._caveats[Bn],Mn._vidBits&&(un($n,Mn._locationStr,$t(Mn._identifierBits),nn,Kt),cn++);if(cn===0){En(dn);return}};Yt(yn)}})(macaroon$1);(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(pt,mt,gt,bt){bt===void 0&&(bt=gt);var yt=Object.getOwnPropertyDescriptor(mt,gt);(!yt||("get"in yt?!mt.__esModule:yt.writable||yt.configurable))&&(yt={enumerable:!0,get:function(){return mt[gt]}}),Object.defineProperty(pt,bt,yt)}:function(pt,mt,gt,bt){bt===void 0&&(bt=gt),pt[bt]=mt[gt]}),nt=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(pt,mt){Object.defineProperty(pt,"default",{enumerable:!0,value:mt})}:function(pt,mt){pt.default=mt}),it=commonjsGlobal&&commonjsGlobal.__importStar||function(pt){if(pt&&pt.__esModule)return pt;var mt={};if(pt!=null)for(var gt in pt)gt!=="default"&&Object.prototype.hasOwnProperty.call(pt,gt)&&et(mt,pt,gt);return nt(mt,pt),mt},rt=commonjsGlobal&&commonjsGlobal.__importDefault||function(pt){return pt&&pt.__esModule?pt:{default:pt}};Object.defineProperty(tt,"__esModule",{value:!0}),tt.decodeIdentifierFromMacaroon=tt.Identifier=tt.ErrUnknownVersion=tt.TOKEN_ID_SIZE=tt.LATEST_VERSION=void 0;const ot=requireAssert(),at=bufio,st=rt(requireCryptoBrowserify()),lt=rt(v4_1),ct=it(macaroon$1);tt.LATEST_VERSION=0,tt.TOKEN_ID_SIZE=32;class ut extends Error{constructor(mt,...gt){super(...gt),Error.captureStackTrace&&Error.captureStackTrace(this,ut),this.name="ErrUnknownVersion",this.message=`${this.name}:${mt}`}}tt.ErrUnknownVersion=ut;class ht extends at.Struct{constructor(mt){super(mt),this.version=tt.LATEST_VERSION,this.paymentHash=null,this.tokenId=null,mt&&this.fromOptions(mt)}fromOptions(mt){if(mt.version&&mt.version>tt.LATEST_VERSION)throw new ut(mt.version);if(mt.version&&(this.version=mt.version),ot(typeof this.version=="number","Identifier version must be a number"),ot(mt.paymentHash.length===32,`Expected 32-byte hash, instead got ${mt.paymentHash.length}`),this.paymentHash=mt.paymentHash,mt.tokenId)this.tokenId=mt.tokenId;else{const gt=(0,lt.default)();this.tokenId=st.default.createHash("sha256").update(Buffer.from(gt)).digest()}return ot(this.tokenId.length===tt.TOKEN_ID_SIZE,"Token Id of unexpected size"),this}toString(){return this.toHex()}static fromString(mt){try{return new this().fromHex(mt)}catch{return new this().fromBase64(mt)}}write(mt){switch(mt.writeU16BE(this.version),this.version){case 0:return mt.writeHash(this.paymentHash),ot(Buffer.isBuffer(this.tokenId)&&this.tokenId.length===tt.TOKEN_ID_SIZE,`Token ID must be ${tt.TOKEN_ID_SIZE}-byte hash`),mt.writeBytes(this.tokenId),this;default:throw new ut(this.version)}}read(mt){switch(this.version=mt.readU16BE(),this.version){case 0:return this.paymentHash=mt.readHash(),this.tokenId=mt.readBytes(tt.TOKEN_ID_SIZE),this;default:throw new ut(this.version)}}}tt.Identifier=ht;const dt=pt=>{const mt=ct.importMacaroon(pt);let gt=mt._exportAsJSONObjectV2().i;if(gt==null&&(gt=mt._exportAsJSONObjectV2().i64,gt==null))throw new Error("Problem parsing macaroon identifier");return gt};tt.decodeIdentifierFromMacaroon=dt})(identifier$1);var caveat={};/*! +`))},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var rngBrowser={exports:{}},getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues){var rnds8=new Uint8Array(16);rngBrowser.exports=function(){return getRandomValues(rnds8),rnds8}}else{var rnds=new Array(16);rngBrowser.exports=function(){for(var et=0,nt;et<16;et++)et&3||(nt=Math.random()*4294967296),rnds[et]=nt>>>((et&3)<<3)&255;return rnds}}var rngBrowserExports=rngBrowser.exports,byteToHex=[];for(var i$5=0;i$5<256;++i$5)byteToHex[i$5]=(i$5+256).toString(16).substr(1);function bytesToUuid$1(tt,et){var nt=et||0,it=byteToHex;return[it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],"-",it[tt[nt++]],it[tt[nt++]],"-",it[tt[nt++]],it[tt[nt++]],"-",it[tt[nt++]],it[tt[nt++]],"-",it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],it[tt[nt++]],it[tt[nt++]]].join("")}var bytesToUuid_1=bytesToUuid$1,rng=rngBrowserExports,bytesToUuid=bytesToUuid_1;function v4(tt,et,nt){var it=et&&nt||0;typeof tt=="string"&&(et=tt==="binary"?new Array(16):null,tt=null),tt=tt||{};var rt=tt.random||(tt.rng||rng)();if(rt[6]=rt[6]&15|64,rt[8]=rt[8]&63|128,et)for(var ot=0;ot<16;++ot)et[it+ot]=rt[ot];return et||bytesToUuid(rt)}var v4_1=v4,macaroon$1={},sjcl={exports:{}};(function(tt){var et={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(mt){this.toString=function(){return"CORRUPT: "+this.message},this.message=mt},invalid:function(mt){this.toString=function(){return"INVALID: "+this.message},this.message=mt},bug:function(mt){this.toString=function(){return"BUG: "+this.message},this.message=mt},notReady:function(mt){this.toString=function(){return"NOT READY: "+this.message},this.message=mt}}};et.cipher.aes=function(mt){this.s[0][0][0]||this.O();var gt,bt,yt,wt,vt=this.s[0][4],xt=this.s[1];gt=mt.length;var St=1;if(gt!==4&>!==6&>!==8)throw new et.exception.invalid("invalid aes key size");for(this.b=[yt=mt.slice(0),wt=[]],mt=gt;mt<4*gt+28;mt++)bt=yt[mt-1],(mt%gt===0||gt===8&&mt%gt===4)&&(bt=vt[bt>>>24]<<24^vt[bt>>16&255]<<16^vt[bt>>8&255]<<8^vt[bt&255],mt%gt===0&&(bt=bt<<8^bt>>>24^St<<24,St=St<<1^283*(St>>7))),yt[mt]=yt[mt-gt]^bt;for(gt=0;mt;gt++,mt--)bt=yt[gt&3?mt:mt-4],wt[gt]=4>=mt||4>gt?bt:xt[0][vt[bt>>>24]]^xt[1][vt[bt>>16&255]]^xt[2][vt[bt>>8&255]]^xt[3][vt[bt&255]]},et.cipher.aes.prototype={encrypt:function(mt){return nt(this,mt,0)},decrypt:function(mt){return nt(this,mt,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var mt=this.s[0],gt=this.s[1],bt=mt[4],yt=gt[4],wt,vt,xt,St=[],Et=[],$t,It,Ft,Ht;for(wt=0;256>wt;wt++)Et[(St[wt]=wt<<1^283*(wt>>7))^wt]=wt;for(vt=xt=0;!bt[vt];vt^=$t||1,xt=Et[xt]||1)for(Ft=xt^xt<<1^xt<<2^xt<<3^xt<<4,Ft=Ft>>8^Ft&255^99,bt[vt]=Ft,yt[Ft]=vt,It=St[wt=St[$t=St[vt]]],Ht=16843009*It^65537*wt^257*$t^16843008*vt,It=257*St[Ft]^16843008*Ft,wt=0;4>wt;wt++)mt[wt][vt]=It=It<<24^It>>>8,gt[wt][Ft]=Ht=Ht<<24^Ht>>>8;for(wt=0;5>wt;wt++)mt[wt]=mt[wt].slice(0),gt[wt]=gt[wt].slice(0)}};function nt(mt,gt,bt){if(gt.length!==4)throw new et.exception.invalid("invalid aes block size");var yt=mt.b[bt],wt=gt[0]^yt[0],vt=gt[bt?3:1]^yt[1],xt=gt[2]^yt[2];gt=gt[bt?1:3]^yt[3];var St,Et,$t,It=yt.length/4-2,Ft,Ht=4,zt=[0,0,0,0];St=mt.s[bt],mt=St[0];var Ot=St[1],jt=St[2],kt=St[3],Tt=St[4];for(Ft=0;Ft>>24]^Ot[vt>>16&255]^jt[xt>>8&255]^kt[gt&255]^yt[Ht],Et=mt[vt>>>24]^Ot[xt>>16&255]^jt[gt>>8&255]^kt[wt&255]^yt[Ht+1],$t=mt[xt>>>24]^Ot[gt>>16&255]^jt[wt>>8&255]^kt[vt&255]^yt[Ht+2],gt=mt[gt>>>24]^Ot[wt>>16&255]^jt[vt>>8&255]^kt[xt&255]^yt[Ht+3],Ht+=4,wt=St,vt=Et,xt=$t;for(Ft=0;4>Ft;Ft++)zt[bt?3&-Ft:Ft]=Tt[wt>>>24]<<24^Tt[vt>>16&255]<<16^Tt[xt>>8&255]<<8^Tt[gt&255]^yt[Ht++],St=wt,wt=vt,vt=xt,xt=gt,gt=St;return zt}et.bitArray={bitSlice:function(mt,gt,bt){return mt=et.bitArray.$(mt.slice(gt/32),32-(gt&31)).slice(1),bt===void 0?mt:et.bitArray.clamp(mt,bt-gt)},extract:function(mt,gt,bt){var yt=Math.floor(-gt-bt&31);return((gt+bt-1^gt)&-32?mt[gt/32|0]<<32-yt^mt[gt/32+1|0]>>>yt:mt[gt/32|0]>>>yt)&(1<>gt-1,1)),mt},partial:function(mt,gt,bt){return mt===32?gt:(bt?gt|0:gt<<32-mt)+1099511627776*mt},getPartial:function(mt){return Math.round(mt/1099511627776)||32},equal:function(mt,gt){if(et.bitArray.bitLength(mt)!==et.bitArray.bitLength(gt))return!1;var bt=0,yt;for(yt=0;yt>>gt),bt=mt[wt]<<32-gt;return wt=mt.length?mt[mt.length-1]:0,mt=et.bitArray.getPartial(wt),yt.push(et.bitArray.partial(gt+mt&31,32>>24|bt>>>8&65280|(bt&65280)<<8|bt<<24;return mt}},et.codec.utf8String={fromBits:function(mt){var gt="",bt=et.bitArray.bitLength(mt),yt,wt;for(yt=0;yt>>8>>>8>>>8),wt<<=8;return decodeURIComponent(escape(gt))},toBits:function(mt){mt=unescape(encodeURIComponent(mt));var gt=[],bt,yt=0;for(bt=0;bt>>xt)>>>wt),xtIt){if(!gt)try{return et.codec.base32hex.toBits(mt)}catch{}throw new et.exception.invalid("this isn't "+Ft+"!")}St>wt?(St-=wt,vt.push($t^It>>>St),$t=It<>>wt)>>>26),6>wt?(xt=mt[bt]<<6-wt,wt+=26,bt++):(xt<<=6,wt-=6);for(;yt.length&3&&!gt;)yt+="=";return yt},toBits:function(mt,gt){mt=mt.replace(/\s|=/g,"");var bt=[],yt,wt=0,vt=et.codec.base64.B,xt=0,St;for(gt&&(vt=vt.substr(0,62)+"-_"),yt=0;ytSt)throw new et.exception.invalid("this isn't base64!");26>>wt),xt=St<<32-wt):(wt+=6,xt^=St<<32-wt)}return wt&56&&bt.push(et.bitArray.partial(wt&56,xt,1)),bt}},et.codec.base64url={fromBits:function(mt){return et.codec.base64.fromBits(mt,1,1)},toBits:function(mt){return et.codec.base64.toBits(mt,1)}},et.hash.sha256=function(mt){this.b[0]||this.O(),mt?(this.F=mt.F.slice(0),this.A=mt.A.slice(0),this.l=mt.l):this.reset()},et.hash.sha256.hash=function(mt){return new et.hash.sha256().update(mt).finalize()},et.hash.sha256.prototype={blockSize:512,reset:function(){return this.F=this.Y.slice(0),this.A=[],this.l=0,this},update:function(mt){typeof mt=="string"&&(mt=et.codec.utf8String.toBits(mt));var gt,bt=this.A=et.bitArray.concat(this.A,mt);if(gt=this.l,mt=this.l=gt+et.bitArray.bitLength(mt),9007199254740991gt;bt++){for(wt=!0,yt=2;yt*yt<=bt;yt++)if(bt%yt===0){wt=!1;break}wt&&(8>gt&&(this.Y[gt]=mt(Math.pow(bt,.5))),this.b[gt]=mt(Math.pow(bt,1/3)),gt++)}}};function it(mt,gt){var bt,yt,wt,vt=mt.F,xt=mt.b,St=vt[0],Et=vt[1],$t=vt[2],It=vt[3],Ft=vt[4],Ht=vt[5],zt=vt[6],Ot=vt[7];for(bt=0;64>bt;bt++)16>bt?yt=gt[bt]:(yt=gt[bt+1&15],wt=gt[bt+14&15],yt=gt[bt&15]=(yt>>>7^yt>>>18^yt>>>3^yt<<25^yt<<14)+(wt>>>17^wt>>>19^wt>>>10^wt<<15^wt<<13)+gt[bt&15]+gt[bt+9&15]|0),yt=yt+Ot+(Ft>>>6^Ft>>>11^Ft>>>25^Ft<<26^Ft<<21^Ft<<7)+(zt^Ft&(Ht^zt))+xt[bt],Ot=zt,zt=Ht,Ht=Ft,Ft=It+yt|0,It=$t,$t=Et,Et=St,St=yt+(Et&$t^It&(Et^$t))+(Et>>>2^Et>>>13^Et>>>22^Et<<30^Et<<19^Et<<10)|0;vt[0]=vt[0]+St|0,vt[1]=vt[1]+Et|0,vt[2]=vt[2]+$t|0,vt[3]=vt[3]+It|0,vt[4]=vt[4]+Ft|0,vt[5]=vt[5]+Ht|0,vt[6]=vt[6]+zt|0,vt[7]=vt[7]+Ot|0}et.mode.ccm={name:"ccm",G:[],listenProgress:function(mt){et.mode.ccm.G.push(mt)},unListenProgress:function(mt){mt=et.mode.ccm.G.indexOf(mt),-1Et)throw new et.exception.invalid("ccm: iv must be at least 7 bytes");for(vt=2;4>vt&&$t>>>8*vt;vt++);return vt<15-Et&&(vt=15-Et),bt=St.clamp(bt,8*(15-vt)),gt=et.mode.ccm.V(mt,gt,bt,yt,wt,vt),xt=et.mode.ccm.C(mt,xt,bt,gt,wt,vt),St.concat(xt.data,xt.tag)},decrypt:function(mt,gt,bt,yt,wt){wt=wt||64,yt=yt||[];var vt=et.bitArray,xt=vt.bitLength(bt)/8,$t=vt.bitLength(gt),St=vt.clamp(gt,$t-wt),Et=vt.bitSlice(gt,$t-wt),$t=($t-wt)/8;if(7>xt)throw new et.exception.invalid("ccm: iv must be at least 7 bytes");for(gt=2;4>gt&&$t>>>8*gt;gt++);if(gt<15-xt&&(gt=15-xt),bt=vt.clamp(bt,8*(15-gt)),St=et.mode.ccm.C(mt,St,bt,Et,wt,gt),mt=et.mode.ccm.V(mt,St.data,bt,yt,wt,gt),!vt.equal(St.tag,mt))throw new et.exception.corrupt("ccm: tag doesn't match");return St.data},na:function(mt,gt,bt,yt,wt,vt){var xt=[],St=et.bitArray,Et=St.i;if(yt=[St.partial(8,(gt.length?64:0)|yt-2<<2|vt-1)],yt=St.concat(yt,bt),yt[3]|=wt,yt=mt.encrypt(yt),gt.length)for(bt=St.bitLength(gt)/8,65279>=bt?xt=[St.partial(16,bt)]:4294967295>=bt&&(xt=St.concat([St.partial(16,65534)],[bt])),xt=St.concat(xt,gt),gt=0;gtwt||16It&&(et.mode.ccm.fa(xt/Et),It+=Ft),bt[3]++,wt=mt.encrypt(bt),gt[xt]^=wt[0],gt[xt+1]^=wt[1],gt[xt+2]^=wt[2],gt[xt+3]^=wt[3];return{tag:yt,data:St.clamp(gt,$t)}}},et.mode.ocb2={name:"ocb2",encrypt:function(mt,gt,bt,yt,wt,vt){if(et.bitArray.bitLength(bt)!==128)throw new et.exception.invalid("ocb iv must be 128 bits");var xt,St=et.mode.ocb2.S,Et=et.bitArray,$t=Et.i,It=[0,0,0,0];bt=St(mt.encrypt(bt));var Ft,Ht=[];for(yt=yt||[],wt=wt||64,xt=0;xt+4wt.bitLength(bt)&&(St=vt(St,yt(St)),bt=wt.concat(bt,[-2147483648,0,0,0])),xt=vt(xt,bt),mt.encrypt(vt(yt(vt(St,yt(St))),xt))},S:function(mt){return[mt[0]<<1^mt[1]>>>31,mt[1]<<1^mt[2]>>>31,mt[2]<<1^mt[3]>>>31,mt[3]<<1^135*(mt[0]>>>31)]}},et.mode.gcm={name:"gcm",encrypt:function(mt,gt,bt,yt,wt){var vt=gt.slice(0);return gt=et.bitArray,yt=yt||[],mt=et.mode.gcm.C(!0,mt,vt,yt,bt,wt||128),gt.concat(mt.data,mt.tag)},decrypt:function(mt,gt,bt,yt,wt){var vt=gt.slice(0),xt=et.bitArray,St=xt.bitLength(vt);if(wt=wt||128,yt=yt||[],wt<=St?(gt=xt.bitSlice(vt,St-wt),vt=xt.bitSlice(vt,0,St-wt)):(gt=vt,vt=[]),mt=et.mode.gcm.C(!1,mt,vt,yt,bt,wt),!xt.equal(mt.tag,gt))throw new et.exception.corrupt("gcm: tag doesn't match");return mt.data},ka:function(mt,gt){var bt,yt,wt,vt,xt,St=et.bitArray.i;for(wt=[0,0,0,0],vt=gt.slice(0),bt=0;128>bt;bt++){for((yt=(mt[Math.floor(bt/32)]&1<<31-bt%32)!==0)&&(wt=St(wt,vt)),xt=(vt[3]&1)!==0,yt=3;0>>1|(vt[yt-1]&1)<<31;vt[0]>>>=1,xt&&(vt[0]^=-520093696)}return wt},j:function(mt,gt,bt){var yt,wt=bt.length;for(gt=gt.slice(0),yt=0;ytwt&&(mt=gt.hash(mt)),yt=0;ytyt||0>bt)throw new et.exception.invalid("invalid params to pbkdf2");typeof mt=="string"&&(mt=et.codec.utf8String.toBits(mt)),typeof gt=="string"&&(gt=et.codec.utf8String.toBits(gt)),wt=wt||et.misc.hmac,mt=new wt(mt);var vt,xt,St,Et,$t=[],It=et.bitArray;for(Et=1;32*$t.length<(yt||1);Et++){for(wt=vt=mt.encrypt(It.concat(gt,[Et])),xt=1;xtxt;xt++)wt.push(4294967296*Math.random()|0);for(xt=0;xt=1<this.o&&(this.o=vt),this.P++,this.b=et.hash.sha256.hash(this.b.concat(wt)),this.L=new et.cipher.aes(this.b),yt=0;4>yt&&(this.h[yt]=this.h[yt]+1|0,!this.h[yt]);yt++);}for(yt=0;yt>>1;this.c[xt].update([yt,this.N++,2,gt,vt,mt.length].concat(mt))}break;case"string":gt===void 0&&(gt=mt.length),this.c[xt].update([yt,this.N++,3,gt,vt,mt.length]),this.c[xt].update(mt);break;default:Et=1}if(Et)throw new et.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[xt]+=gt,this.f+=gt,St===this.u&&(this.isReady()!==this.u&&rt("seeded",Math.max(this.o,this.f)),rt("progress",this.getProgress()))},isReady:function(mt){return mt=this.T[mt!==void 0?mt:this.M],this.o&&this.o>=mt?this.m[0]>this.ba&&new Date().valueOf()>this.Z?this.J|this.I:this.I:this.f>=mt?this.J|this.u:this.u},getProgress:function(mt){return mt=this.T[mt||this.M],this.o>=mt||this.f>mt?1:this.f/mt},startCollectors:function(){if(!this.D){if(this.a={loadTimeCollector:lt(this,this.ma),mouseCollector:lt(this,this.oa),keyboardCollector:lt(this,this.la),accelerometerCollector:lt(this,this.ea),touchCollector:lt(this,this.qa)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else if(document.attachEvent)document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector);else throw new et.exception.bug("can't attach event");this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(mt,gt){this.K[mt][this.ga++]=gt},removeEventListener:function(mt,gt){var bt,yt,wt=this.K[mt],vt=[];for(yt in wt)wt.hasOwnProperty(yt)&&wt[yt]===gt&&vt.push(yt);for(bt=0;btgt&&(mt.h[gt]=mt.h[gt]+1|0,!mt.h[gt]);gt++);return mt.L.encrypt(mt.h)}function lt(mt,gt){return function(){gt.apply(mt,arguments)}}et.random=new et.prng(6);e:try{var ct,ut,ht,dt;if(dt=tt.exports){var pt;try{pt=requireCryptoBrowserify()}catch{pt=null}dt=ut=pt}if(dt&&ut.randomBytes)ct=ut.randomBytes(128),ct=new Uint32Array(new Uint8Array(ct).buffer),et.random.addEntropy(ct,1024,"crypto['randomBytes']");else if(typeof window<"u"&&typeof Uint32Array<"u"){if(ht=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(ht);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(ht);else break e;et.random.addEntropy(ht,1024,"crypto['getRandomValues']")}}catch(mt){typeof window<"u"&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(mt))}et.json={defaults:{v:1,iter:1e4,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},ja:function(mt,gt,bt,yt){bt=bt||{},yt=yt||{};var wt=et.json,vt=wt.g({iv:et.random.randomWords(4,0)},wt.defaults),xt;if(wt.g(vt,bt),bt=vt.adata,typeof vt.salt=="string"&&(vt.salt=et.codec.base64.toBits(vt.salt)),typeof vt.iv=="string"&&(vt.iv=et.codec.base64.toBits(vt.iv)),!et.mode[vt.mode]||!et.cipher[vt.cipher]||typeof mt=="string"&&100>=vt.iter||vt.ts!==64&&vt.ts!==96&&vt.ts!==128||vt.ks!==128&&vt.ks!==192&&vt.ks!==256||2>vt.iv.length||4=gt.iter||gt.ts!==64&>.ts!==96&>.ts!==128||gt.ks!==128&>.ks!==192&>.ks!==256||!gt.iv||2>gt.iv.length||4>24&255,vn[Pn+1]=hn>>16&255,vn[Pn+2]=hn>>8&255,vn[Pn+3]=hn&255,vn[Pn+4]=Jt>>24&255,vn[Pn+5]=Jt>>16&255,vn[Pn+6]=Jt>>8&255,vn[Pn+7]=Jt&255}function gt(vn,Pn,hn,Jt,kn){var On,Dn=0;for(On=0;On>>8)-1}function bt(vn,Pn,hn,Jt){return gt(vn,Pn,hn,Jt,16)}function yt(vn,Pn,hn,Jt){return gt(vn,Pn,hn,Jt,32)}function wt(vn,Pn,hn,Jt){for(var kn=Jt[0]&255|(Jt[1]&255)<<8|(Jt[2]&255)<<16|(Jt[3]&255)<<24,On=hn[0]&255|(hn[1]&255)<<8|(hn[2]&255)<<16|(hn[3]&255)<<24,Dn=hn[4]&255|(hn[5]&255)<<8|(hn[6]&255)<<16|(hn[7]&255)<<24,Yn=hn[8]&255|(hn[9]&255)<<8|(hn[10]&255)<<16|(hn[11]&255)<<24,er=hn[12]&255|(hn[13]&255)<<8|(hn[14]&255)<<16|(hn[15]&255)<<24,or=Jt[4]&255|(Jt[5]&255)<<8|(Jt[6]&255)<<16|(Jt[7]&255)<<24,ar=Pn[0]&255|(Pn[1]&255)<<8|(Pn[2]&255)<<16|(Pn[3]&255)<<24,Vr=Pn[4]&255|(Pn[5]&255)<<8|(Pn[6]&255)<<16|(Pn[7]&255)<<24,wr=Pn[8]&255|(Pn[9]&255)<<8|(Pn[10]&255)<<16|(Pn[11]&255)<<24,jr=Pn[12]&255|(Pn[13]&255)<<8|(Pn[14]&255)<<16|(Pn[15]&255)<<24,Hr=Jt[8]&255|(Jt[9]&255)<<8|(Jt[10]&255)<<16|(Jt[11]&255)<<24,no=hn[16]&255|(hn[17]&255)<<8|(hn[18]&255)<<16|(hn[19]&255)<<24,Xr=hn[20]&255|(hn[21]&255)<<8|(hn[22]&255)<<16|(hn[23]&255)<<24,Jr=hn[24]&255|(hn[25]&255)<<8|(hn[26]&255)<<16|(hn[27]&255)<<24,br=hn[28]&255|(hn[29]&255)<<8|(hn[30]&255)<<16|(hn[31]&255)<<24,$r=Jt[12]&255|(Jt[13]&255)<<8|(Jt[14]&255)<<16|(Jt[15]&255)<<24,Dr=kn,Cr=On,Ar=Dn,Nr=Yn,Fr=er,Pr=or,_i=ar,nr=Vr,xr=wr,cr=jr,yr=Hr,Ir=no,io=Xr,so=Jr,fo=br,po=$r,qn,vo=0;vo<20;vo+=2)qn=Dr+io|0,Fr^=qn<<7|qn>>>32-7,qn=Fr+Dr|0,xr^=qn<<9|qn>>>32-9,qn=xr+Fr|0,io^=qn<<13|qn>>>32-13,qn=io+xr|0,Dr^=qn<<18|qn>>>32-18,qn=Pr+Cr|0,cr^=qn<<7|qn>>>32-7,qn=cr+Pr|0,so^=qn<<9|qn>>>32-9,qn=so+cr|0,Cr^=qn<<13|qn>>>32-13,qn=Cr+so|0,Pr^=qn<<18|qn>>>32-18,qn=yr+_i|0,fo^=qn<<7|qn>>>32-7,qn=fo+yr|0,Ar^=qn<<9|qn>>>32-9,qn=Ar+fo|0,_i^=qn<<13|qn>>>32-13,qn=_i+Ar|0,yr^=qn<<18|qn>>>32-18,qn=po+Ir|0,Nr^=qn<<7|qn>>>32-7,qn=Nr+po|0,nr^=qn<<9|qn>>>32-9,qn=nr+Nr|0,Ir^=qn<<13|qn>>>32-13,qn=Ir+nr|0,po^=qn<<18|qn>>>32-18,qn=Dr+Nr|0,Cr^=qn<<7|qn>>>32-7,qn=Cr+Dr|0,Ar^=qn<<9|qn>>>32-9,qn=Ar+Cr|0,Nr^=qn<<13|qn>>>32-13,qn=Nr+Ar|0,Dr^=qn<<18|qn>>>32-18,qn=Pr+Fr|0,_i^=qn<<7|qn>>>32-7,qn=_i+Pr|0,nr^=qn<<9|qn>>>32-9,qn=nr+_i|0,Fr^=qn<<13|qn>>>32-13,qn=Fr+nr|0,Pr^=qn<<18|qn>>>32-18,qn=yr+cr|0,Ir^=qn<<7|qn>>>32-7,qn=Ir+yr|0,xr^=qn<<9|qn>>>32-9,qn=xr+Ir|0,cr^=qn<<13|qn>>>32-13,qn=cr+xr|0,yr^=qn<<18|qn>>>32-18,qn=po+fo|0,io^=qn<<7|qn>>>32-7,qn=io+po|0,so^=qn<<9|qn>>>32-9,qn=so+io|0,fo^=qn<<13|qn>>>32-13,qn=fo+so|0,po^=qn<<18|qn>>>32-18;Dr=Dr+kn|0,Cr=Cr+On|0,Ar=Ar+Dn|0,Nr=Nr+Yn|0,Fr=Fr+er|0,Pr=Pr+or|0,_i=_i+ar|0,nr=nr+Vr|0,xr=xr+wr|0,cr=cr+jr|0,yr=yr+Hr|0,Ir=Ir+no|0,io=io+Xr|0,so=so+Jr|0,fo=fo+br|0,po=po+$r|0,vn[0]=Dr>>>0&255,vn[1]=Dr>>>8&255,vn[2]=Dr>>>16&255,vn[3]=Dr>>>24&255,vn[4]=Cr>>>0&255,vn[5]=Cr>>>8&255,vn[6]=Cr>>>16&255,vn[7]=Cr>>>24&255,vn[8]=Ar>>>0&255,vn[9]=Ar>>>8&255,vn[10]=Ar>>>16&255,vn[11]=Ar>>>24&255,vn[12]=Nr>>>0&255,vn[13]=Nr>>>8&255,vn[14]=Nr>>>16&255,vn[15]=Nr>>>24&255,vn[16]=Fr>>>0&255,vn[17]=Fr>>>8&255,vn[18]=Fr>>>16&255,vn[19]=Fr>>>24&255,vn[20]=Pr>>>0&255,vn[21]=Pr>>>8&255,vn[22]=Pr>>>16&255,vn[23]=Pr>>>24&255,vn[24]=_i>>>0&255,vn[25]=_i>>>8&255,vn[26]=_i>>>16&255,vn[27]=_i>>>24&255,vn[28]=nr>>>0&255,vn[29]=nr>>>8&255,vn[30]=nr>>>16&255,vn[31]=nr>>>24&255,vn[32]=xr>>>0&255,vn[33]=xr>>>8&255,vn[34]=xr>>>16&255,vn[35]=xr>>>24&255,vn[36]=cr>>>0&255,vn[37]=cr>>>8&255,vn[38]=cr>>>16&255,vn[39]=cr>>>24&255,vn[40]=yr>>>0&255,vn[41]=yr>>>8&255,vn[42]=yr>>>16&255,vn[43]=yr>>>24&255,vn[44]=Ir>>>0&255,vn[45]=Ir>>>8&255,vn[46]=Ir>>>16&255,vn[47]=Ir>>>24&255,vn[48]=io>>>0&255,vn[49]=io>>>8&255,vn[50]=io>>>16&255,vn[51]=io>>>24&255,vn[52]=so>>>0&255,vn[53]=so>>>8&255,vn[54]=so>>>16&255,vn[55]=so>>>24&255,vn[56]=fo>>>0&255,vn[57]=fo>>>8&255,vn[58]=fo>>>16&255,vn[59]=fo>>>24&255,vn[60]=po>>>0&255,vn[61]=po>>>8&255,vn[62]=po>>>16&255,vn[63]=po>>>24&255}function vt(vn,Pn,hn,Jt){for(var kn=Jt[0]&255|(Jt[1]&255)<<8|(Jt[2]&255)<<16|(Jt[3]&255)<<24,On=hn[0]&255|(hn[1]&255)<<8|(hn[2]&255)<<16|(hn[3]&255)<<24,Dn=hn[4]&255|(hn[5]&255)<<8|(hn[6]&255)<<16|(hn[7]&255)<<24,Yn=hn[8]&255|(hn[9]&255)<<8|(hn[10]&255)<<16|(hn[11]&255)<<24,er=hn[12]&255|(hn[13]&255)<<8|(hn[14]&255)<<16|(hn[15]&255)<<24,or=Jt[4]&255|(Jt[5]&255)<<8|(Jt[6]&255)<<16|(Jt[7]&255)<<24,ar=Pn[0]&255|(Pn[1]&255)<<8|(Pn[2]&255)<<16|(Pn[3]&255)<<24,Vr=Pn[4]&255|(Pn[5]&255)<<8|(Pn[6]&255)<<16|(Pn[7]&255)<<24,wr=Pn[8]&255|(Pn[9]&255)<<8|(Pn[10]&255)<<16|(Pn[11]&255)<<24,jr=Pn[12]&255|(Pn[13]&255)<<8|(Pn[14]&255)<<16|(Pn[15]&255)<<24,Hr=Jt[8]&255|(Jt[9]&255)<<8|(Jt[10]&255)<<16|(Jt[11]&255)<<24,no=hn[16]&255|(hn[17]&255)<<8|(hn[18]&255)<<16|(hn[19]&255)<<24,Xr=hn[20]&255|(hn[21]&255)<<8|(hn[22]&255)<<16|(hn[23]&255)<<24,Jr=hn[24]&255|(hn[25]&255)<<8|(hn[26]&255)<<16|(hn[27]&255)<<24,br=hn[28]&255|(hn[29]&255)<<8|(hn[30]&255)<<16|(hn[31]&255)<<24,$r=Jt[12]&255|(Jt[13]&255)<<8|(Jt[14]&255)<<16|(Jt[15]&255)<<24,Dr=kn,Cr=On,Ar=Dn,Nr=Yn,Fr=er,Pr=or,_i=ar,nr=Vr,xr=wr,cr=jr,yr=Hr,Ir=no,io=Xr,so=Jr,fo=br,po=$r,qn,vo=0;vo<20;vo+=2)qn=Dr+io|0,Fr^=qn<<7|qn>>>32-7,qn=Fr+Dr|0,xr^=qn<<9|qn>>>32-9,qn=xr+Fr|0,io^=qn<<13|qn>>>32-13,qn=io+xr|0,Dr^=qn<<18|qn>>>32-18,qn=Pr+Cr|0,cr^=qn<<7|qn>>>32-7,qn=cr+Pr|0,so^=qn<<9|qn>>>32-9,qn=so+cr|0,Cr^=qn<<13|qn>>>32-13,qn=Cr+so|0,Pr^=qn<<18|qn>>>32-18,qn=yr+_i|0,fo^=qn<<7|qn>>>32-7,qn=fo+yr|0,Ar^=qn<<9|qn>>>32-9,qn=Ar+fo|0,_i^=qn<<13|qn>>>32-13,qn=_i+Ar|0,yr^=qn<<18|qn>>>32-18,qn=po+Ir|0,Nr^=qn<<7|qn>>>32-7,qn=Nr+po|0,nr^=qn<<9|qn>>>32-9,qn=nr+Nr|0,Ir^=qn<<13|qn>>>32-13,qn=Ir+nr|0,po^=qn<<18|qn>>>32-18,qn=Dr+Nr|0,Cr^=qn<<7|qn>>>32-7,qn=Cr+Dr|0,Ar^=qn<<9|qn>>>32-9,qn=Ar+Cr|0,Nr^=qn<<13|qn>>>32-13,qn=Nr+Ar|0,Dr^=qn<<18|qn>>>32-18,qn=Pr+Fr|0,_i^=qn<<7|qn>>>32-7,qn=_i+Pr|0,nr^=qn<<9|qn>>>32-9,qn=nr+_i|0,Fr^=qn<<13|qn>>>32-13,qn=Fr+nr|0,Pr^=qn<<18|qn>>>32-18,qn=yr+cr|0,Ir^=qn<<7|qn>>>32-7,qn=Ir+yr|0,xr^=qn<<9|qn>>>32-9,qn=xr+Ir|0,cr^=qn<<13|qn>>>32-13,qn=cr+xr|0,yr^=qn<<18|qn>>>32-18,qn=po+fo|0,io^=qn<<7|qn>>>32-7,qn=io+po|0,so^=qn<<9|qn>>>32-9,qn=so+io|0,fo^=qn<<13|qn>>>32-13,qn=fo+so|0,po^=qn<<18|qn>>>32-18;vn[0]=Dr>>>0&255,vn[1]=Dr>>>8&255,vn[2]=Dr>>>16&255,vn[3]=Dr>>>24&255,vn[4]=Pr>>>0&255,vn[5]=Pr>>>8&255,vn[6]=Pr>>>16&255,vn[7]=Pr>>>24&255,vn[8]=yr>>>0&255,vn[9]=yr>>>8&255,vn[10]=yr>>>16&255,vn[11]=yr>>>24&255,vn[12]=po>>>0&255,vn[13]=po>>>8&255,vn[14]=po>>>16&255,vn[15]=po>>>24&255,vn[16]=_i>>>0&255,vn[17]=_i>>>8&255,vn[18]=_i>>>16&255,vn[19]=_i>>>24&255,vn[20]=nr>>>0&255,vn[21]=nr>>>8&255,vn[22]=nr>>>16&255,vn[23]=nr>>>24&255,vn[24]=xr>>>0&255,vn[25]=xr>>>8&255,vn[26]=xr>>>16&255,vn[27]=xr>>>24&255,vn[28]=cr>>>0&255,vn[29]=cr>>>8&255,vn[30]=cr>>>16&255,vn[31]=cr>>>24&255}function xt(vn,Pn,hn,Jt){wt(vn,Pn,hn,Jt)}function St(vn,Pn,hn,Jt){vt(vn,Pn,hn,Jt)}var Et=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function $t(vn,Pn,hn,Jt,kn,On,Dn){var Yn=new Uint8Array(16),er=new Uint8Array(64),or,ar;for(ar=0;ar<16;ar++)Yn[ar]=0;for(ar=0;ar<8;ar++)Yn[ar]=On[ar];for(;kn>=64;){for(xt(er,Yn,Dn,Et),ar=0;ar<64;ar++)vn[Pn+ar]=hn[Jt+ar]^er[ar];for(or=1,ar=8;ar<16;ar++)or=or+(Yn[ar]&255)|0,Yn[ar]=or&255,or>>>=8;kn-=64,Pn+=64,Jt+=64}if(kn>0)for(xt(er,Yn,Dn,Et),ar=0;ar=64;){for(xt(Dn,On,kn,Et),er=0;er<64;er++)vn[Pn+er]=Dn[er];for(Yn=1,er=8;er<16;er++)Yn=Yn+(On[er]&255)|0,On[er]=Yn&255,Yn>>>=8;hn-=64,Pn+=64}if(hn>0)for(xt(Dn,On,kn,Et),er=0;er>>13|hn<<3)&8191,Jt=vn[4]&255|(vn[5]&255)<<8,this.r[2]=(hn>>>10|Jt<<6)&7939,kn=vn[6]&255|(vn[7]&255)<<8,this.r[3]=(Jt>>>7|kn<<9)&8191,On=vn[8]&255|(vn[9]&255)<<8,this.r[4]=(kn>>>4|On<<12)&255,this.r[5]=On>>>1&8190,Dn=vn[10]&255|(vn[11]&255)<<8,this.r[6]=(On>>>14|Dn<<2)&8191,Yn=vn[12]&255|(vn[13]&255)<<8,this.r[7]=(Dn>>>11|Yn<<5)&8065,er=vn[14]&255|(vn[15]&255)<<8,this.r[8]=(Yn>>>8|er<<8)&8191,this.r[9]=er>>>5&127,this.pad[0]=vn[16]&255|(vn[17]&255)<<8,this.pad[1]=vn[18]&255|(vn[19]&255)<<8,this.pad[2]=vn[20]&255|(vn[21]&255)<<8,this.pad[3]=vn[22]&255|(vn[23]&255)<<8,this.pad[4]=vn[24]&255|(vn[25]&255)<<8,this.pad[5]=vn[26]&255|(vn[27]&255)<<8,this.pad[6]=vn[28]&255|(vn[29]&255)<<8,this.pad[7]=vn[30]&255|(vn[31]&255)<<8};zt.prototype.blocks=function(vn,Pn,hn){for(var Jt=this.fin?0:2048,kn,On,Dn,Yn,er,or,ar,Vr,wr,jr,Hr,no,Xr,Jr,br,$r,Dr,Cr,Ar,Nr=this.h[0],Fr=this.h[1],Pr=this.h[2],_i=this.h[3],nr=this.h[4],xr=this.h[5],cr=this.h[6],yr=this.h[7],Ir=this.h[8],io=this.h[9],so=this.r[0],fo=this.r[1],po=this.r[2],qn=this.r[3],vo=this.r[4],_o=this.r[5],xo=this.r[6],bo=this.r[7],$o=this.r[8],Ro=this.r[9];hn>=16;)kn=vn[Pn+0]&255|(vn[Pn+1]&255)<<8,Nr+=kn&8191,On=vn[Pn+2]&255|(vn[Pn+3]&255)<<8,Fr+=(kn>>>13|On<<3)&8191,Dn=vn[Pn+4]&255|(vn[Pn+5]&255)<<8,Pr+=(On>>>10|Dn<<6)&8191,Yn=vn[Pn+6]&255|(vn[Pn+7]&255)<<8,_i+=(Dn>>>7|Yn<<9)&8191,er=vn[Pn+8]&255|(vn[Pn+9]&255)<<8,nr+=(Yn>>>4|er<<12)&8191,xr+=er>>>1&8191,or=vn[Pn+10]&255|(vn[Pn+11]&255)<<8,cr+=(er>>>14|or<<2)&8191,ar=vn[Pn+12]&255|(vn[Pn+13]&255)<<8,yr+=(or>>>11|ar<<5)&8191,Vr=vn[Pn+14]&255|(vn[Pn+15]&255)<<8,Ir+=(ar>>>8|Vr<<8)&8191,io+=Vr>>>5|Jt,wr=0,jr=wr,jr+=Nr*so,jr+=Fr*(5*Ro),jr+=Pr*(5*$o),jr+=_i*(5*bo),jr+=nr*(5*xo),wr=jr>>>13,jr&=8191,jr+=xr*(5*_o),jr+=cr*(5*vo),jr+=yr*(5*qn),jr+=Ir*(5*po),jr+=io*(5*fo),wr+=jr>>>13,jr&=8191,Hr=wr,Hr+=Nr*fo,Hr+=Fr*so,Hr+=Pr*(5*Ro),Hr+=_i*(5*$o),Hr+=nr*(5*bo),wr=Hr>>>13,Hr&=8191,Hr+=xr*(5*xo),Hr+=cr*(5*_o),Hr+=yr*(5*vo),Hr+=Ir*(5*qn),Hr+=io*(5*po),wr+=Hr>>>13,Hr&=8191,no=wr,no+=Nr*po,no+=Fr*fo,no+=Pr*so,no+=_i*(5*Ro),no+=nr*(5*$o),wr=no>>>13,no&=8191,no+=xr*(5*bo),no+=cr*(5*xo),no+=yr*(5*_o),no+=Ir*(5*vo),no+=io*(5*qn),wr+=no>>>13,no&=8191,Xr=wr,Xr+=Nr*qn,Xr+=Fr*po,Xr+=Pr*fo,Xr+=_i*so,Xr+=nr*(5*Ro),wr=Xr>>>13,Xr&=8191,Xr+=xr*(5*$o),Xr+=cr*(5*bo),Xr+=yr*(5*xo),Xr+=Ir*(5*_o),Xr+=io*(5*vo),wr+=Xr>>>13,Xr&=8191,Jr=wr,Jr+=Nr*vo,Jr+=Fr*qn,Jr+=Pr*po,Jr+=_i*fo,Jr+=nr*so,wr=Jr>>>13,Jr&=8191,Jr+=xr*(5*Ro),Jr+=cr*(5*$o),Jr+=yr*(5*bo),Jr+=Ir*(5*xo),Jr+=io*(5*_o),wr+=Jr>>>13,Jr&=8191,br=wr,br+=Nr*_o,br+=Fr*vo,br+=Pr*qn,br+=_i*po,br+=nr*fo,wr=br>>>13,br&=8191,br+=xr*so,br+=cr*(5*Ro),br+=yr*(5*$o),br+=Ir*(5*bo),br+=io*(5*xo),wr+=br>>>13,br&=8191,$r=wr,$r+=Nr*xo,$r+=Fr*_o,$r+=Pr*vo,$r+=_i*qn,$r+=nr*po,wr=$r>>>13,$r&=8191,$r+=xr*fo,$r+=cr*so,$r+=yr*(5*Ro),$r+=Ir*(5*$o),$r+=io*(5*bo),wr+=$r>>>13,$r&=8191,Dr=wr,Dr+=Nr*bo,Dr+=Fr*xo,Dr+=Pr*_o,Dr+=_i*vo,Dr+=nr*qn,wr=Dr>>>13,Dr&=8191,Dr+=xr*po,Dr+=cr*fo,Dr+=yr*so,Dr+=Ir*(5*Ro),Dr+=io*(5*$o),wr+=Dr>>>13,Dr&=8191,Cr=wr,Cr+=Nr*$o,Cr+=Fr*bo,Cr+=Pr*xo,Cr+=_i*_o,Cr+=nr*vo,wr=Cr>>>13,Cr&=8191,Cr+=xr*qn,Cr+=cr*po,Cr+=yr*fo,Cr+=Ir*so,Cr+=io*(5*Ro),wr+=Cr>>>13,Cr&=8191,Ar=wr,Ar+=Nr*Ro,Ar+=Fr*$o,Ar+=Pr*bo,Ar+=_i*xo,Ar+=nr*_o,wr=Ar>>>13,Ar&=8191,Ar+=xr*vo,Ar+=cr*qn,Ar+=yr*po,Ar+=Ir*fo,Ar+=io*so,wr+=Ar>>>13,Ar&=8191,wr=(wr<<2)+wr|0,wr=wr+jr|0,jr=wr&8191,wr=wr>>>13,Hr+=wr,Nr=jr,Fr=Hr,Pr=no,_i=Xr,nr=Jr,xr=br,cr=$r,yr=Dr,Ir=Cr,io=Ar,Pn+=16,hn-=16;this.h[0]=Nr,this.h[1]=Fr,this.h[2]=Pr,this.h[3]=_i,this.h[4]=nr,this.h[5]=xr,this.h[6]=cr,this.h[7]=yr,this.h[8]=Ir,this.h[9]=io},zt.prototype.finish=function(vn,Pn){var hn=new Uint16Array(10),Jt,kn,On,Dn;if(this.leftover){for(Dn=this.leftover,this.buffer[Dn++]=1;Dn<16;Dn++)this.buffer[Dn]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(Jt=this.h[1]>>>13,this.h[1]&=8191,Dn=2;Dn<10;Dn++)this.h[Dn]+=Jt,Jt=this.h[Dn]>>>13,this.h[Dn]&=8191;for(this.h[0]+=Jt*5,Jt=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=Jt,Jt=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=Jt,hn[0]=this.h[0]+5,Jt=hn[0]>>>13,hn[0]&=8191,Dn=1;Dn<10;Dn++)hn[Dn]=this.h[Dn]+Jt,Jt=hn[Dn]>>>13,hn[Dn]&=8191;for(hn[9]-=8192,kn=(Jt^1)-1,Dn=0;Dn<10;Dn++)hn[Dn]&=kn;for(kn=~kn,Dn=0;Dn<10;Dn++)this.h[Dn]=this.h[Dn]&kn|hn[Dn];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,On=this.h[0]+this.pad[0],this.h[0]=On&65535,Dn=1;Dn<8;Dn++)On=(this.h[Dn]+this.pad[Dn]|0)+(On>>>16)|0,this.h[Dn]=On&65535;vn[Pn+0]=this.h[0]>>>0&255,vn[Pn+1]=this.h[0]>>>8&255,vn[Pn+2]=this.h[1]>>>0&255,vn[Pn+3]=this.h[1]>>>8&255,vn[Pn+4]=this.h[2]>>>0&255,vn[Pn+5]=this.h[2]>>>8&255,vn[Pn+6]=this.h[3]>>>0&255,vn[Pn+7]=this.h[3]>>>8&255,vn[Pn+8]=this.h[4]>>>0&255,vn[Pn+9]=this.h[4]>>>8&255,vn[Pn+10]=this.h[5]>>>0&255,vn[Pn+11]=this.h[5]>>>8&255,vn[Pn+12]=this.h[6]>>>0&255,vn[Pn+13]=this.h[6]>>>8&255,vn[Pn+14]=this.h[7]>>>0&255,vn[Pn+15]=this.h[7]>>>8&255},zt.prototype.update=function(vn,Pn,hn){var Jt,kn;if(this.leftover){for(kn=16-this.leftover,kn>hn&&(kn=hn),Jt=0;Jt=16&&(kn=hn-hn%16,this.blocks(vn,Pn,kn),Pn+=kn,hn-=kn),hn){for(Jt=0;Jt>16&1),On[hn-1]&=65535;On[15]=Dn[15]-32767-(On[14]>>16&1),kn=On[15]>>16&1,On[14]&=65535,Nt(Dn,On,1-kn)}for(hn=0;hn<16;hn++)vn[2*hn]=Dn[hn]&255,vn[2*hn+1]=Dn[hn]>>8}function Mt(vn,Pn){var hn=new Uint8Array(32),Jt=new Uint8Array(32);return Bt(hn,vn),Bt(Jt,Pn),yt(hn,0,Jt,0)}function Dt(vn){var Pn=new Uint8Array(32);return Bt(Pn,vn),Pn[0]&1}function Pt(vn,Pn){var hn;for(hn=0;hn<16;hn++)vn[hn]=Pn[2*hn]+(Pn[2*hn+1]<<8);vn[15]&=32767}function Vt(vn,Pn,hn){for(var Jt=0;Jt<16;Jt++)vn[Jt]=Pn[Jt]+hn[Jt]}function nn(vn,Pn,hn){for(var Jt=0;Jt<16;Jt++)vn[Jt]=Pn[Jt]-hn[Jt]}function cn(vn,Pn,hn){var Jt,kn,On=0,Dn=0,Yn=0,er=0,or=0,ar=0,Vr=0,wr=0,jr=0,Hr=0,no=0,Xr=0,Jr=0,br=0,$r=0,Dr=0,Cr=0,Ar=0,Nr=0,Fr=0,Pr=0,_i=0,nr=0,xr=0,cr=0,yr=0,Ir=0,io=0,so=0,fo=0,po=0,qn=hn[0],vo=hn[1],_o=hn[2],xo=hn[3],bo=hn[4],$o=hn[5],Ro=hn[6],Wo=hn[7],Po=hn[8],Fo=hn[9],Go=hn[10],Xo=hn[11],ga=hn[12],na=hn[13],$a=hn[14],Jo=hn[15];Jt=Pn[0],On+=Jt*qn,Dn+=Jt*vo,Yn+=Jt*_o,er+=Jt*xo,or+=Jt*bo,ar+=Jt*$o,Vr+=Jt*Ro,wr+=Jt*Wo,jr+=Jt*Po,Hr+=Jt*Fo,no+=Jt*Go,Xr+=Jt*Xo,Jr+=Jt*ga,br+=Jt*na,$r+=Jt*$a,Dr+=Jt*Jo,Jt=Pn[1],Dn+=Jt*qn,Yn+=Jt*vo,er+=Jt*_o,or+=Jt*xo,ar+=Jt*bo,Vr+=Jt*$o,wr+=Jt*Ro,jr+=Jt*Wo,Hr+=Jt*Po,no+=Jt*Fo,Xr+=Jt*Go,Jr+=Jt*Xo,br+=Jt*ga,$r+=Jt*na,Dr+=Jt*$a,Cr+=Jt*Jo,Jt=Pn[2],Yn+=Jt*qn,er+=Jt*vo,or+=Jt*_o,ar+=Jt*xo,Vr+=Jt*bo,wr+=Jt*$o,jr+=Jt*Ro,Hr+=Jt*Wo,no+=Jt*Po,Xr+=Jt*Fo,Jr+=Jt*Go,br+=Jt*Xo,$r+=Jt*ga,Dr+=Jt*na,Cr+=Jt*$a,Ar+=Jt*Jo,Jt=Pn[3],er+=Jt*qn,or+=Jt*vo,ar+=Jt*_o,Vr+=Jt*xo,wr+=Jt*bo,jr+=Jt*$o,Hr+=Jt*Ro,no+=Jt*Wo,Xr+=Jt*Po,Jr+=Jt*Fo,br+=Jt*Go,$r+=Jt*Xo,Dr+=Jt*ga,Cr+=Jt*na,Ar+=Jt*$a,Nr+=Jt*Jo,Jt=Pn[4],or+=Jt*qn,ar+=Jt*vo,Vr+=Jt*_o,wr+=Jt*xo,jr+=Jt*bo,Hr+=Jt*$o,no+=Jt*Ro,Xr+=Jt*Wo,Jr+=Jt*Po,br+=Jt*Fo,$r+=Jt*Go,Dr+=Jt*Xo,Cr+=Jt*ga,Ar+=Jt*na,Nr+=Jt*$a,Fr+=Jt*Jo,Jt=Pn[5],ar+=Jt*qn,Vr+=Jt*vo,wr+=Jt*_o,jr+=Jt*xo,Hr+=Jt*bo,no+=Jt*$o,Xr+=Jt*Ro,Jr+=Jt*Wo,br+=Jt*Po,$r+=Jt*Fo,Dr+=Jt*Go,Cr+=Jt*Xo,Ar+=Jt*ga,Nr+=Jt*na,Fr+=Jt*$a,Pr+=Jt*Jo,Jt=Pn[6],Vr+=Jt*qn,wr+=Jt*vo,jr+=Jt*_o,Hr+=Jt*xo,no+=Jt*bo,Xr+=Jt*$o,Jr+=Jt*Ro,br+=Jt*Wo,$r+=Jt*Po,Dr+=Jt*Fo,Cr+=Jt*Go,Ar+=Jt*Xo,Nr+=Jt*ga,Fr+=Jt*na,Pr+=Jt*$a,_i+=Jt*Jo,Jt=Pn[7],wr+=Jt*qn,jr+=Jt*vo,Hr+=Jt*_o,no+=Jt*xo,Xr+=Jt*bo,Jr+=Jt*$o,br+=Jt*Ro,$r+=Jt*Wo,Dr+=Jt*Po,Cr+=Jt*Fo,Ar+=Jt*Go,Nr+=Jt*Xo,Fr+=Jt*ga,Pr+=Jt*na,_i+=Jt*$a,nr+=Jt*Jo,Jt=Pn[8],jr+=Jt*qn,Hr+=Jt*vo,no+=Jt*_o,Xr+=Jt*xo,Jr+=Jt*bo,br+=Jt*$o,$r+=Jt*Ro,Dr+=Jt*Wo,Cr+=Jt*Po,Ar+=Jt*Fo,Nr+=Jt*Go,Fr+=Jt*Xo,Pr+=Jt*ga,_i+=Jt*na,nr+=Jt*$a,xr+=Jt*Jo,Jt=Pn[9],Hr+=Jt*qn,no+=Jt*vo,Xr+=Jt*_o,Jr+=Jt*xo,br+=Jt*bo,$r+=Jt*$o,Dr+=Jt*Ro,Cr+=Jt*Wo,Ar+=Jt*Po,Nr+=Jt*Fo,Fr+=Jt*Go,Pr+=Jt*Xo,_i+=Jt*ga,nr+=Jt*na,xr+=Jt*$a,cr+=Jt*Jo,Jt=Pn[10],no+=Jt*qn,Xr+=Jt*vo,Jr+=Jt*_o,br+=Jt*xo,$r+=Jt*bo,Dr+=Jt*$o,Cr+=Jt*Ro,Ar+=Jt*Wo,Nr+=Jt*Po,Fr+=Jt*Fo,Pr+=Jt*Go,_i+=Jt*Xo,nr+=Jt*ga,xr+=Jt*na,cr+=Jt*$a,yr+=Jt*Jo,Jt=Pn[11],Xr+=Jt*qn,Jr+=Jt*vo,br+=Jt*_o,$r+=Jt*xo,Dr+=Jt*bo,Cr+=Jt*$o,Ar+=Jt*Ro,Nr+=Jt*Wo,Fr+=Jt*Po,Pr+=Jt*Fo,_i+=Jt*Go,nr+=Jt*Xo,xr+=Jt*ga,cr+=Jt*na,yr+=Jt*$a,Ir+=Jt*Jo,Jt=Pn[12],Jr+=Jt*qn,br+=Jt*vo,$r+=Jt*_o,Dr+=Jt*xo,Cr+=Jt*bo,Ar+=Jt*$o,Nr+=Jt*Ro,Fr+=Jt*Wo,Pr+=Jt*Po,_i+=Jt*Fo,nr+=Jt*Go,xr+=Jt*Xo,cr+=Jt*ga,yr+=Jt*na,Ir+=Jt*$a,io+=Jt*Jo,Jt=Pn[13],br+=Jt*qn,$r+=Jt*vo,Dr+=Jt*_o,Cr+=Jt*xo,Ar+=Jt*bo,Nr+=Jt*$o,Fr+=Jt*Ro,Pr+=Jt*Wo,_i+=Jt*Po,nr+=Jt*Fo,xr+=Jt*Go,cr+=Jt*Xo,yr+=Jt*ga,Ir+=Jt*na,io+=Jt*$a,so+=Jt*Jo,Jt=Pn[14],$r+=Jt*qn,Dr+=Jt*vo,Cr+=Jt*_o,Ar+=Jt*xo,Nr+=Jt*bo,Fr+=Jt*$o,Pr+=Jt*Ro,_i+=Jt*Wo,nr+=Jt*Po,xr+=Jt*Fo,cr+=Jt*Go,yr+=Jt*Xo,Ir+=Jt*ga,io+=Jt*na,so+=Jt*$a,fo+=Jt*Jo,Jt=Pn[15],Dr+=Jt*qn,Cr+=Jt*vo,Ar+=Jt*_o,Nr+=Jt*xo,Fr+=Jt*bo,Pr+=Jt*$o,_i+=Jt*Ro,nr+=Jt*Wo,xr+=Jt*Po,cr+=Jt*Fo,yr+=Jt*Go,Ir+=Jt*Xo,io+=Jt*ga,so+=Jt*na,fo+=Jt*$a,po+=Jt*Jo,On+=38*Cr,Dn+=38*Ar,Yn+=38*Nr,er+=38*Fr,or+=38*Pr,ar+=38*_i,Vr+=38*nr,wr+=38*xr,jr+=38*cr,Hr+=38*yr,no+=38*Ir,Xr+=38*io,Jr+=38*so,br+=38*fo,$r+=38*po,kn=1,Jt=On+kn+65535,kn=Math.floor(Jt/65536),On=Jt-kn*65536,Jt=Dn+kn+65535,kn=Math.floor(Jt/65536),Dn=Jt-kn*65536,Jt=Yn+kn+65535,kn=Math.floor(Jt/65536),Yn=Jt-kn*65536,Jt=er+kn+65535,kn=Math.floor(Jt/65536),er=Jt-kn*65536,Jt=or+kn+65535,kn=Math.floor(Jt/65536),or=Jt-kn*65536,Jt=ar+kn+65535,kn=Math.floor(Jt/65536),ar=Jt-kn*65536,Jt=Vr+kn+65535,kn=Math.floor(Jt/65536),Vr=Jt-kn*65536,Jt=wr+kn+65535,kn=Math.floor(Jt/65536),wr=Jt-kn*65536,Jt=jr+kn+65535,kn=Math.floor(Jt/65536),jr=Jt-kn*65536,Jt=Hr+kn+65535,kn=Math.floor(Jt/65536),Hr=Jt-kn*65536,Jt=no+kn+65535,kn=Math.floor(Jt/65536),no=Jt-kn*65536,Jt=Xr+kn+65535,kn=Math.floor(Jt/65536),Xr=Jt-kn*65536,Jt=Jr+kn+65535,kn=Math.floor(Jt/65536),Jr=Jt-kn*65536,Jt=br+kn+65535,kn=Math.floor(Jt/65536),br=Jt-kn*65536,Jt=$r+kn+65535,kn=Math.floor(Jt/65536),$r=Jt-kn*65536,Jt=Dr+kn+65535,kn=Math.floor(Jt/65536),Dr=Jt-kn*65536,On+=kn-1+37*(kn-1),kn=1,Jt=On+kn+65535,kn=Math.floor(Jt/65536),On=Jt-kn*65536,Jt=Dn+kn+65535,kn=Math.floor(Jt/65536),Dn=Jt-kn*65536,Jt=Yn+kn+65535,kn=Math.floor(Jt/65536),Yn=Jt-kn*65536,Jt=er+kn+65535,kn=Math.floor(Jt/65536),er=Jt-kn*65536,Jt=or+kn+65535,kn=Math.floor(Jt/65536),or=Jt-kn*65536,Jt=ar+kn+65535,kn=Math.floor(Jt/65536),ar=Jt-kn*65536,Jt=Vr+kn+65535,kn=Math.floor(Jt/65536),Vr=Jt-kn*65536,Jt=wr+kn+65535,kn=Math.floor(Jt/65536),wr=Jt-kn*65536,Jt=jr+kn+65535,kn=Math.floor(Jt/65536),jr=Jt-kn*65536,Jt=Hr+kn+65535,kn=Math.floor(Jt/65536),Hr=Jt-kn*65536,Jt=no+kn+65535,kn=Math.floor(Jt/65536),no=Jt-kn*65536,Jt=Xr+kn+65535,kn=Math.floor(Jt/65536),Xr=Jt-kn*65536,Jt=Jr+kn+65535,kn=Math.floor(Jt/65536),Jr=Jt-kn*65536,Jt=br+kn+65535,kn=Math.floor(Jt/65536),br=Jt-kn*65536,Jt=$r+kn+65535,kn=Math.floor(Jt/65536),$r=Jt-kn*65536,Jt=Dr+kn+65535,kn=Math.floor(Jt/65536),Dr=Jt-kn*65536,On+=kn-1+37*(kn-1),vn[0]=On,vn[1]=Dn,vn[2]=Yn,vn[3]=er,vn[4]=or,vn[5]=ar,vn[6]=Vr,vn[7]=wr,vn[8]=jr,vn[9]=Hr,vn[10]=no,vn[11]=Xr,vn[12]=Jr,vn[13]=br,vn[14]=$r,vn[15]=Dr}function Xt(vn,Pn){cn(vn,Pn,Pn)}function un(vn,Pn){var hn=nt(),Jt;for(Jt=0;Jt<16;Jt++)hn[Jt]=Pn[Jt];for(Jt=253;Jt>=0;Jt--)Xt(hn,hn),Jt!==2&&Jt!==4&&cn(hn,hn,Pn);for(Jt=0;Jt<16;Jt++)vn[Jt]=hn[Jt]}function en(vn,Pn){var hn=nt(),Jt;for(Jt=0;Jt<16;Jt++)hn[Jt]=Pn[Jt];for(Jt=250;Jt>=0;Jt--)Xt(hn,hn),Jt!==1&&cn(hn,hn,Pn);for(Jt=0;Jt<16;Jt++)vn[Jt]=hn[Jt]}function fn(vn,Pn,hn){var Jt=new Uint8Array(32),kn=new Float64Array(80),On,Dn,Yn=nt(),er=nt(),or=nt(),ar=nt(),Vr=nt(),wr=nt();for(Dn=0;Dn<31;Dn++)Jt[Dn]=Pn[Dn];for(Jt[31]=Pn[31]&127|64,Jt[0]&=248,Pt(kn,hn),Dn=0;Dn<16;Dn++)er[Dn]=kn[Dn],ar[Dn]=Yn[Dn]=or[Dn]=0;for(Yn[0]=ar[0]=1,Dn=254;Dn>=0;--Dn)On=Jt[Dn>>>3]>>>(Dn&7)&1,Nt(Yn,er,On),Nt(or,ar,On),Vt(Vr,Yn,or),nn(Yn,Yn,or),Vt(or,er,ar),nn(er,er,ar),Xt(ar,Vr),Xt(wr,Yn),cn(Yn,or,Yn),cn(or,er,Vr),Vt(Vr,Yn,or),nn(Yn,Yn,or),Xt(er,Yn),nn(or,ar,wr),cn(Yn,or,lt),Vt(Yn,Yn,ar),cn(or,or,Yn),cn(Yn,ar,wr),cn(ar,er,kn),Xt(er,Vr),Nt(Yn,er,On),Nt(or,ar,On);for(Dn=0;Dn<16;Dn++)kn[Dn+16]=Yn[Dn],kn[Dn+32]=or[Dn],kn[Dn+48]=er[Dn],kn[Dn+64]=ar[Dn];var jr=kn.subarray(32),Hr=kn.subarray(16);return un(jr,jr),cn(Hr,Hr,jr),Bt(vn,Hr),0}function xn(vn,Pn){return fn(vn,Pn,ot)}function an(vn,Pn){return it(Pn,32),xn(vn,Pn)}function Zt(vn,Pn,hn){var Jt=new Uint8Array(32);return fn(Jt,hn,Pn),St(vn,rt,Jt,Et)}var En=kt,In=Tt;function Cn(vn,Pn,hn,Jt,kn,On){var Dn=new Uint8Array(32);return Zt(Dn,kn,On),En(vn,Pn,hn,Jt,Dn)}function Nn(vn,Pn,hn,Jt,kn,On){var Dn=new Uint8Array(32);return Zt(Dn,kn,On),In(vn,Pn,hn,Jt,Dn)}var Un=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _n(vn,Pn,hn,Jt){for(var kn=new Int32Array(16),On=new Int32Array(16),Dn,Yn,er,or,ar,Vr,wr,jr,Hr,no,Xr,Jr,br,$r,Dr,Cr,Ar,Nr,Fr,Pr,_i,nr,xr,cr,yr,Ir,io=vn[0],so=vn[1],fo=vn[2],po=vn[3],qn=vn[4],vo=vn[5],_o=vn[6],xo=vn[7],bo=Pn[0],$o=Pn[1],Ro=Pn[2],Wo=Pn[3],Po=Pn[4],Fo=Pn[5],Go=Pn[6],Xo=Pn[7],ga=0;Jt>=128;){for(Fr=0;Fr<16;Fr++)Pr=8*Fr+ga,kn[Fr]=hn[Pr+0]<<24|hn[Pr+1]<<16|hn[Pr+2]<<8|hn[Pr+3],On[Fr]=hn[Pr+4]<<24|hn[Pr+5]<<16|hn[Pr+6]<<8|hn[Pr+7];for(Fr=0;Fr<80;Fr++)if(Dn=io,Yn=so,er=fo,or=po,ar=qn,Vr=vo,wr=_o,jr=xo,Hr=bo,no=$o,Xr=Ro,Jr=Wo,br=Po,$r=Fo,Dr=Go,Cr=Xo,_i=xo,nr=Xo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=(qn>>>14|Po<<32-14)^(qn>>>18|Po<<32-18)^(Po>>>41-32|qn<<32-(41-32)),nr=(Po>>>14|qn<<32-14)^(Po>>>18|qn<<32-18)^(qn>>>41-32|Po<<32-(41-32)),xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,_i=qn&vo^~qn&_o,nr=Po&Fo^~Po&Go,xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,_i=Un[Fr*2],nr=Un[Fr*2+1],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,_i=kn[Fr%16],nr=On[Fr%16],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,Ar=yr&65535|Ir<<16,Nr=xr&65535|cr<<16,_i=Ar,nr=Nr,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=(io>>>28|bo<<32-28)^(bo>>>34-32|io<<32-(34-32))^(bo>>>39-32|io<<32-(39-32)),nr=(bo>>>28|io<<32-28)^(io>>>34-32|bo<<32-(34-32))^(io>>>39-32|bo<<32-(39-32)),xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,_i=io&so^io&fo^so&fo,nr=bo&$o^bo&Ro^$o&Ro,xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,jr=yr&65535|Ir<<16,Cr=xr&65535|cr<<16,_i=or,nr=Jr,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=Ar,nr=Nr,xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,or=yr&65535|Ir<<16,Jr=xr&65535|cr<<16,so=Dn,fo=Yn,po=er,qn=or,vo=ar,_o=Vr,xo=wr,io=jr,$o=Hr,Ro=no,Wo=Xr,Po=Jr,Fo=br,Go=$r,Xo=Dr,bo=Cr,Fr%16===15)for(Pr=0;Pr<16;Pr++)_i=kn[Pr],nr=On[Pr],xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=kn[(Pr+9)%16],nr=On[(Pr+9)%16],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,Ar=kn[(Pr+1)%16],Nr=On[(Pr+1)%16],_i=(Ar>>>1|Nr<<32-1)^(Ar>>>8|Nr<<32-8)^Ar>>>7,nr=(Nr>>>1|Ar<<32-1)^(Nr>>>8|Ar<<32-8)^(Nr>>>7|Ar<<32-7),xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,Ar=kn[(Pr+14)%16],Nr=On[(Pr+14)%16],_i=(Ar>>>19|Nr<<32-19)^(Nr>>>61-32|Ar<<32-(61-32))^Ar>>>6,nr=(Nr>>>19|Ar<<32-19)^(Ar>>>61-32|Nr<<32-(61-32))^(Nr>>>6|Ar<<32-6),xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,kn[Pr]=yr&65535|Ir<<16,On[Pr]=xr&65535|cr<<16;_i=io,nr=bo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=vn[0],nr=Pn[0],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,vn[0]=io=yr&65535|Ir<<16,Pn[0]=bo=xr&65535|cr<<16,_i=so,nr=$o,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=vn[1],nr=Pn[1],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,vn[1]=so=yr&65535|Ir<<16,Pn[1]=$o=xr&65535|cr<<16,_i=fo,nr=Ro,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=vn[2],nr=Pn[2],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,vn[2]=fo=yr&65535|Ir<<16,Pn[2]=Ro=xr&65535|cr<<16,_i=po,nr=Wo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=vn[3],nr=Pn[3],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,vn[3]=po=yr&65535|Ir<<16,Pn[3]=Wo=xr&65535|cr<<16,_i=qn,nr=Po,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=vn[4],nr=Pn[4],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,vn[4]=qn=yr&65535|Ir<<16,Pn[4]=Po=xr&65535|cr<<16,_i=vo,nr=Fo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=vn[5],nr=Pn[5],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,vn[5]=vo=yr&65535|Ir<<16,Pn[5]=Fo=xr&65535|cr<<16,_i=_o,nr=Go,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=vn[6],nr=Pn[6],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,vn[6]=_o=yr&65535|Ir<<16,Pn[6]=Go=xr&65535|cr<<16,_i=xo,nr=Xo,xr=nr&65535,cr=nr>>>16,yr=_i&65535,Ir=_i>>>16,_i=vn[7],nr=Pn[7],xr+=nr&65535,cr+=nr>>>16,yr+=_i&65535,Ir+=_i>>>16,cr+=xr>>>16,yr+=cr>>>16,Ir+=yr>>>16,vn[7]=xo=yr&65535|Ir<<16,Pn[7]=Xo=xr&65535|cr<<16,ga+=128,Jt-=128}return Jt}function An(vn,Pn,hn){var Jt=new Int32Array(8),kn=new Int32Array(8),On=new Uint8Array(256),Dn,Yn=hn;for(Jt[0]=1779033703,Jt[1]=3144134277,Jt[2]=1013904242,Jt[3]=2773480762,Jt[4]=1359893119,Jt[5]=2600822924,Jt[6]=528734635,Jt[7]=1541459225,kn[0]=4089235720,kn[1]=2227873595,kn[2]=4271175723,kn[3]=1595750129,kn[4]=2917565137,kn[5]=725511199,kn[6]=4215389547,kn[7]=327033209,_n(Jt,kn,Pn,hn),hn%=128,Dn=0;Dn=0;--kn)Jt=hn[kn/8|0]>>(kn&7)&1,Tn(vn,Pn,Jt),gn(Pn,vn),gn(vn,vn),Tn(vn,Pn,Jt)}function sn(vn,Pn){var hn=[nt(),nt(),nt(),nt()];Ct(hn[0],ht),Ct(hn[1],dt),Ct(hn[2],st),cn(hn[3],ht,dt),dn(vn,hn,Pn)}function rn(vn,Pn,hn){var Jt=new Uint8Array(64),kn=[nt(),nt(),nt(),nt()],On;for(hn||it(Pn,32),An(Jt,Pn,32),Jt[0]&=248,Jt[31]&=127,Jt[31]|=64,sn(kn,Jt),yn(vn,kn),On=0;On<32;On++)Pn[On+32]=vn[On];return 0}var Sn=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function tn(vn,Pn){var hn,Jt,kn,On;for(Jt=63;Jt>=32;--Jt){for(hn=0,kn=Jt-32,On=Jt-12;kn>4)*Sn[kn],hn=Pn[kn]>>8,Pn[kn]&=255;for(kn=0;kn<32;kn++)Pn[kn]-=hn*Sn[kn];for(Jt=0;Jt<32;Jt++)Pn[Jt+1]+=Pn[Jt]>>8,vn[Jt]=Pn[Jt]&255}function qt(vn){var Pn=new Float64Array(64),hn;for(hn=0;hn<64;hn++)Pn[hn]=vn[hn];for(hn=0;hn<64;hn++)vn[hn]=0;tn(vn,Pn)}function Kt(vn,Pn,hn,Jt){var kn=new Uint8Array(64),On=new Uint8Array(64),Dn=new Uint8Array(64),Yn,er,or=new Float64Array(64),ar=[nt(),nt(),nt(),nt()];An(kn,Jt,32),kn[0]&=248,kn[31]&=127,kn[31]|=64;var Vr=hn+64;for(Yn=0;Yn>7&&nn(vn[0],at,vn[0]),cn(vn[3],vn[0],vn[1]),0)}function Rn(vn,Pn,hn,Jt){var kn,On=new Uint8Array(32),Dn=new Uint8Array(64),Yn=[nt(),nt(),nt(),nt()],er=[nt(),nt(),nt(),nt()];if(hn<64||wn(er,Jt))return-1;for(kn=0;kn=0},et.sign.keyPair=function(){var vn=new Uint8Array(Mr),Pn=new Uint8Array(qr);return rn(vn,Pn),{publicKey:vn,secretKey:Pn}},et.sign.keyPair.fromSecretKey=function(vn){if(Br(vn),vn.length!==qr)throw new Error("bad secret key size");for(var Pn=new Uint8Array(Mr),hn=0;hn"u"?typeof Buffer.from<"u"?(et.encodeBase64=function(it){return Buffer.from(it).toString("base64")},et.decodeBase64=function(it){return nt(it),new Uint8Array(Array.prototype.slice.call(Buffer.from(it,"base64"),0))}):(et.encodeBase64=function(it){return new Buffer(it).toString("base64")},et.decodeBase64=function(it){return nt(it),new Uint8Array(Array.prototype.slice.call(new Buffer(it,"base64"),0))}):(et.encodeBase64=function(it){var rt,ot=[],at=it.length;for(rt=0;rtgt||An<0)throw new RangeError(`varint ${An} out of range`);this._grow(this._length+wt);let gn=this._length;for(;An>=128;)this._buf[gn++]=An&255|128,An>>>=7;this._buf[gn++]=An|0,this._length=gn}get bytes(){return this._buf.subarray(0,this._length)}_grow(An){const gn=this._buf.length;if(An<=gn)return;const Tn=gn*2,yn=An>Tn?An:Tn,dn=new Uint8Array(yn);dn.set(this._buf.subarray(0,this._length)),this._buf=dn}}const wt=5;class vt{constructor(An){this._buf=An,this._index=0}readByte(){if(this.length<=0)throw new RangeError("Read past end of buffer");return this._buf[this._index++]}peekByte(){if(this.length<=0)throw new RangeError("Read past end of buffer");return this._buf[this._index]}readN(An){if(this.lengthwt||sn===wt&&dn>1)throw new RangeError("Overflow error decoding varint");return(gn|dn<>>0}gn|=(dn&127)<_n!=null,St=_n=>xt(_n)?st.encode(_n):_n,Et=_n=>xt(_n)?lt.decode(_n):_n,$t=_n=>nt.default.codec.utf8String.fromBits(_n);tt.base64ToBytes=function(_n){return _n=_n.replace(/-/g,"+").replace(/_/g,"/"),_n.length%4!==0&&!_n.match(/=$/)&&(_n+="=".repeat(4-_n.length%4)),rt.default.decodeBase64(_n)},tt.bytesToBase64=function(_n){return rt.default.encodeBase64(_n).replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")};const It=function(_n){return nt.default.codec.base64.toBits(rt.default.encodeBase64(_n))},Ft=function(_n){return rt.default.decodeBase64(nt.default.codec.base64.fromBits(_n))},Ht=function(_n){const An=new Uint8Array(Math.ceil(_n.length/2));for(let gn=0;gnxt(_n)?Ot(_n,An):"",kt=function(_n,An){if(_n instanceof Uint8Array)return _n;if(typeof _n=="string")return St(_n);throw new TypeError(`${An} has the wrong type; want string or Uint8Array, got ${typeof _n}.`)},Tt=new Uint8Array,Ct=function(_n,An){const gn=_n.readByte();if(gn!==An)throw new Error(`Unexpected field type, got ${gn} want ${An}`);return gn===ut?Tt:_n.readN(_n.readUvarint())},Ut=function(_n,An,gn){_n.appendByte(An),An!==ut&&(_n.appendUvarint(gn.length),_n.appendBytes(gn))},Nt=function(_n,An){return _n.peekByte()!==An?null:Ct(_n,An)},Bt=function(_n,An,gn){zt(gn)?_n[An]=Et(gn):_n[An+"64"]=tt.bytesToBase64(gn)},Mt=function(_n,An){const gn=new nt.default.misc.hmac(_n,nt.default.hash.sha256);return gn.update(An),gn.digest()},Dt=function(_n,An,gn){const Tn=Mt(_n,An),yn=Mt(_n,gn);return Mt(_n,nt.default.bitArray.concat(Tn,yn))},Pt=It(St("macaroons-key-generator")),Vt=function(_n){return Mt(Pt,_n)},nn=function(){return it.default.randomBytes(ct)},cn=function(_n,An){const gn=Ft(_n),Tn=Ft(An),yn=nn(),dn=it.default.secretbox(Tn,yn,gn),sn=new Uint8Array(yn.length+dn.length);return sn.set(yn,0),sn.set(dn,yn.length),It(sn)},Xt=function(_n,An){const gn=Ft(_n),Tn=Ft(An),yn=Tn.slice(0,ct),dn=Tn.slice(ct);let sn=it.default.secretbox.open(dn,yn,gn);if(!sn)throw new Error("decryption failed");return It(sn)},un=It(St("\0".repeat(32))),en=function(_n,An){return nt.default.bitArray.equal(_n,An)?_n:Dt(un,_n,An)};class fn{constructor(An){if(!An)return;let{version:gn,identifierBytes:Tn,locationStr:yn,caveats:dn,signatureBytes:sn}=An;if(gn!==1&&gn!==2)throw new Error(`Unexpected version ${gn}`);if(this._version=gn,this._locationStr=yn,Tn=kt(Tn,"Identifier"),gn===1&&!zt(Tn))throw new Error("Version 1 macaroon identifier must be well-formed UTF-8");this._identifierBits=Tn&&It(Tn),this._signatureBits=sn&&It(kt(sn,"Signature")),this._caveats=dn?dn.map(rn=>{const Sn=kt(rn.identifierBytes,"Caveat identifier");if(gn===1&&!zt(Sn))throw new Error("Version 1 caveat identifier must be well-formed UTF-8");return{_locationStr:jt(rn.locationStr),_identifierBits:It(Sn),_vidBits:rn.vidBytes&&It(kt(rn.vidBytes,"Verification ID"))}}):[]}get caveats(){return this._caveats.map(An=>xt(An._vidBits)?{identifier:Ft(An._identifierBits),location:An._locationStr,vid:Ft(An._vidBits)}:{identifier:Ft(An._identifierBits)})}get location(){return this._locationStr}get identifier(){return Ft(this._identifierBits)}get signature(){return Ft(this._signatureBits)}addThirdPartyCaveat(An,gn,Tn){const yn={_identifierBits:It(kt(gn,"Caveat id")),_vidBits:cn(this._signatureBits,Vt(It(kt(An,"Caveat root key")))),_locationStr:jt(Tn)};this._signatureBits=Dt(this._signatureBits,yn._vidBits,yn._identifierBits),this._caveats.push(yn)}addFirstPartyCaveat(An){const gn=It(kt(An,"Condition"));this._caveats.push({_identifierBits:gn}),this._signatureBits=Mt(this._signatureBits,gn)}bindToRoot(An){const gn=It(kt(An,"Primary macaroon signature"));this._signatureBits=en(gn,this._signatureBits)}clone(){const An=new fn;return An._version=this._version,An._signatureBits=this._signatureBits,An._identifierBits=this._identifierBits,An._locationStr=this._locationStr,An._caveats=this._caveats.slice(),An}verify(An,gn,Tn=[]){const yn=Vt(It(kt(An,"Root key"))),dn=Tn.map(sn=>0);this._verify(this._signatureBits,yn,gn,Tn,dn),Tn.forEach((sn,rn)=>{if(dn[rn]===0)throw new Error(`discharge macaroon ${bt(sn.identifier)} was not used`);if(dn[rn]!==1)throw new Error(`discharge macaroon ${bt(sn.identifier)} was used more than once`)})}_verify(An,gn,Tn,yn,dn){let sn=Mt(gn,this._identifierBits);this._caveats.forEach(Sn=>{if(Sn._vidBits){const tn=Xt(sn,Sn._vidBits);let qt=!1,Kt,wn;for(Kt=0;Kt1)throw new Error(`discharge macaroon ${bt(wn.identifier)} was used more than once`);wn._verify(An,tn,Tn,yn,dn);break}if(!qt)throw new Error(`cannot find discharge macaroon for caveat ${bt(Sn._identifierBits)}`);sn=Dt(sn,Sn._vidBits,Sn._identifierBits)}else{const tn=$t(Sn._identifierBits),qt=Tn(tn);if(qt)throw new Error(`caveat check failed (${tn}): ${qt}`);sn=Mt(sn,Sn._identifierBits)}});const rn=en(An,sn);if(!nt.default.bitArray.equal(rn,this._signatureBits))throw new Error("signature mismatch after caveat verification")}exportJSON(){switch(this._version){case 1:return this._exportAsJSONObjectV1();case 2:return this._exportAsJSONObjectV2();default:throw new Error(`unexpected macaroon version ${this._version}`)}}_exportAsJSONObjectV1(){const An={identifier:$t(this._identifierBits),signature:nt.default.codec.hex.fromBits(this._signatureBits)};return this._locationStr&&(An.location=this._locationStr),this._caveats.length>0&&(An.caveats=this._caveats.map(gn=>{const Tn={cid:$t(gn._identifierBits)};return gn._vidBits&&(Tn.vid=nt.default.codec.base64.fromBits(gn._vidBits,!0,!0),Tn.cl=gn._locationStr),Tn})),An}_exportAsJSONObjectV2(){const An={v:2};return Bt(An,"s",Ft(this._signatureBits)),Bt(An,"i",Ft(this._identifierBits)),this._locationStr&&(An.l=this._locationStr),this._caveats&&this._caveats.length>0&&(An.c=this._caveats.map(gn=>{const Tn={};return Bt(Tn,"i",Ft(gn._identifierBits)),gn._vidBits&&(Bt(Tn,"v",Ft(gn._vidBits)),Tn.l=gn._locationStr),Tn})),An}_exportBinaryV1(){throw new Error("V1 binary export not supported")}_exportBinaryV2(){const An=new yt(200);return An.appendByte(2),this._locationStr&&Ut(An,ht,St(this._locationStr)),Ut(An,dt,Ft(this._identifierBits)),Ut(An,ut),this._caveats.forEach(function(gn){gn._locationStr&&Ut(An,ht,St(gn._locationStr)),Ut(An,dt,Ft(gn._identifierBits)),gn._vidBits&&Ut(An,pt,Ft(gn._vidBits)),Ut(An,ut)}),Ut(An,ut),Ut(An,mt,Ft(this._signatureBits)),An.bytes}exportBinary(){switch(this._version){case 1:return this._exportBinaryV1();case 2:return this._exportBinaryV2();default:throw new Error(`unexpected macaroon version ${this._version}`)}}}tt.importMacaroon=function(_n){if(typeof _n=="string"&&(_n=tt.base64ToBytes(_n)),_n instanceof Uint8Array){const An=new vt(_n),gn=Un(An);if(An.length!==0)throw new TypeError("extra data found at end of serialized macaroon");return gn}if(Array.isArray(_n))throw new TypeError("cannot import an array of macaroons as a single macaroon");return xn(_n)},tt.importMacaroons=function(_n){if(typeof _n=="string"&&(_n=tt.base64ToBytes(_n)),_n instanceof Uint8Array){if(_n.length===0)throw new TypeError("empty macaroon data");const An=new vt(_n),gn=[];do gn.push(Un(An));while(An.length>0);return gn}return Array.isArray(_n)?_n.map(An=>xn(An)):[xn(_n)]};const xn=function(_n){return an(_n)?Zt(_n):En(_n)};function an(_n){return xt(_n.signature)}const Zt=function(_n){const An=_n.caveats&&_n.caveats.map(gn=>{const Tn={identifierBytes:St(Ot(gn.cid,"Caveat id")),locationStr:jt(gn.cl,"Caveat location")};return gn.vid&&(Tn.vidBytes=tt.base64ToBytes(Ot(gn.vid,"Caveat verification id"))),Tn});return new fn({version:1,locationStr:jt(_n.location,"Macaroon location"),identifierBytes:St(Ot(_n.identifier,"Macaroon identifier")),caveats:An,signatureBytes:Ht(_n.signature)})},En=function(_n){if(_n.v!==2&&_n.v!==void 0)throw new Error(`Unsupported macaroon version ${_n.v}`);const An={version:2,signatureBytes:In(_n,"s",!0),locationStr:Et(In(_n,"l",!1)),identifierBytes:In(_n,"i",!0)};if(_n.c){if(!Array.isArray(_n.c))throw new Error("caveats field does not hold an array");An.caveats=_n.c.map(gn=>({identifierBytes:In(gn,"i",!0),locationStr:Et(In(gn,"l")),vidBytes:In(gn,"v",!1)}))}return new fn(An)};function In(_n,An,gn){if(_n.hasOwnProperty(An))return St(_n[An]);const Tn=An+"64";if(_n.hasOwnProperty(Tn))return tt.base64ToBytes(_n[Tn]);if(gn)throw new Error("Expected key: "+An);return null}const Cn=function(_n){const An=_n.readByte();if(An!==2)throw new Error(`Only version 2 is supported, found version ${An}`);const gn=Et(Nt(_n,ht)),Tn=Ct(_n,dt),yn=[];for(Ct(_n,ut);!Nt(_n,ut);){const sn={locationStr:Et(Nt(_n,ht)),identifierBytes:Ct(_n,dt),vidBytes:Nt(_n,pt)};Ct(_n,ut),yn.push(sn)}const dn=Ct(_n,mt);if(_n.length!==0)throw new Error("unexpected extra data at end of macaroon");return new fn({version:An,locationStr:gn,identifierBytes:Tn,signatureBytes:dn,caveats:yn})},Nn=function(_n){return 48<=_n&&_n<=58||97<=_n&&_n<=102},Un=function(_n){if(_n.length===0)throw new Error("Empty macaroon data");const An=_n.peekByte();if(An===2)return Cn(_n);throw Nn(An)?new Error("Version 1 binary format not supported"):new Error("Cannot determine data format of binary-encoded macaroon")};tt.newMacaroon=function({identifier:_n,location:An,rootKey:gn,version:Tn}){const yn=kt(_n,"Macaroon identifier"),dn=kt(gn,"Macaroon root key");return new fn({version:Tn===void 0?2:Tn,identifierBytes:yn,locationStr:jt(An,"Macaroon location"),signatureBytes:Ft(Mt(Vt(It(dn)),It(yn)))})},tt.dischargeMacaroon=function(_n,An,gn,Tn){const yn=_n.signature,dn=[_n];let sn=0,rn=!1;const Sn=_n.location,tn=wn=>{rn||(wn.bindToRoot(yn),dn.push(wn),sn--,Kt(wn))},qt=wn=>{rn||(Tn(wn),rn=!0)},Kt=wn=>{let Rn,jn;for(jn=0;jntt.LATEST_VERSION)throw new ut(mt.version);if(mt.version&&(this.version=mt.version),ot(typeof this.version=="number","Identifier version must be a number"),ot(mt.paymentHash.length===32,`Expected 32-byte hash, instead got ${mt.paymentHash.length}`),this.paymentHash=mt.paymentHash,mt.tokenId)this.tokenId=mt.tokenId;else{const gt=(0,lt.default)();this.tokenId=st.default.createHash("sha256").update(Buffer.from(gt)).digest()}return ot(this.tokenId.length===tt.TOKEN_ID_SIZE,"Token Id of unexpected size"),this}toString(){return this.toHex()}static fromString(mt){try{return new this().fromHex(mt)}catch{return new this().fromBase64(mt)}}write(mt){switch(mt.writeU16BE(this.version),this.version){case 0:return mt.writeHash(this.paymentHash),ot(Buffer.isBuffer(this.tokenId)&&this.tokenId.length===tt.TOKEN_ID_SIZE,`Token ID must be ${tt.TOKEN_ID_SIZE}-byte hash`),mt.writeBytes(this.tokenId),this;default:throw new ut(this.version)}}read(mt){switch(this.version=mt.readU16BE(),this.version){case 0:return this.paymentHash=mt.readHash(),this.tokenId=mt.readBytes(tt.TOKEN_ID_SIZE),this;default:throw new ut(this.version)}}}tt.Identifier=ht;const dt=pt=>{const mt=ct.importMacaroon(pt);let gt=mt._exportAsJSONObjectV2().i;if(gt==null&&(gt=mt._exportAsJSONObjectV2().i64,gt==null))throw new Error("Problem parsing macaroon identifier");return gt};tt.decodeIdentifierFromMacaroon=dt})(identifier$1);var caveat={};/*! * assert.js - assertions for javascript * Copyright (c) 2018, Christopher Jeffrey (MIT License). * https://github.com/chjj/bsert - */class AssertionError extends Error{constructor(et){typeof et=="string"&&(et={message:et}),(et===null||typeof et!="object")&&(et={});let nt=null,it="fail",rt=!!et.generatedMessage;if(et.message!=null&&(nt=toString$9(et.message)),typeof et.operator=="string"&&(it=et.operator),nt==null){if(it==="fail")nt="Assertion failed.";else{const at=stringify$3(et.actual),st=stringify$3(et.expected);nt=`${at} ${it} ${st}`}rt=!0}super(nt);let ot=this.constructor;typeof et.stackStartFunction=="function"?ot=et.stackStartFunction:typeof et.stackStartFn=="function"&&(ot=et.stackStartFn),this.type="AssertionError",this.name="AssertionError [ERR_ASSERTION]",this.code="ERR_ASSERTION",this.generatedMessage=rt,this.actual=et.actual,this.expected=et.expected,this.operator=it,Error.captureStackTrace&&Error.captureStackTrace(this,ot)}}function assert$4(tt,et){if(!tt){let nt=!1;if(arguments.length===0)et="No value argument passed to `assert()`.",nt=!0;else if(et==null)et="Assertion failed.",nt=!0;else if(isError(et))throw et;throw new AssertionError({message:et,actual:tt,expected:!0,operator:"==",generatedMessage:nt,stackStartFn:assert$4})}}function equal$1(tt,et,nt){if(!Object.is(tt,et))throw isError(nt)?nt:new AssertionError({message:nt,actual:tt,expected:et,operator:"strictEqual",stackStartFn:equal$1})}function notEqual(tt,et,nt){if(Object.is(tt,et))throw isError(nt)?nt:new AssertionError({message:nt,actual:tt,expected:et,operator:"notStrictEqual",stackStartFn:notEqual})}function fail(tt){let et=!1;throw isError(tt)?tt:(tt==null&&(tt="Assertion failed.",et=!0),new AssertionError({message:tt,actual:!1,expected:!0,operator:"fail",generatedMessage:et,stackStartFn:fail}))}function throws(tt,et,nt){typeof et=="string"&&(nt=et,et=void 0);let it=!1,rt=null;enforce(typeof tt=="function","func","function");try{tt()}catch(ot){it=!0,rt=ot}if(!it){let ot=!1;throw nt==null&&(nt="Missing expected exception.",ot=!0),new AssertionError({message:nt,actual:void 0,expected:et,operator:"throws",generatedMessage:ot,stackStartFn:throws})}if(!testError(rt,et,nt,throws))throw rt}function doesNotThrow(tt,et,nt){typeof et=="string"&&(nt=et,et=void 0);let it=!1,rt=null;enforce(typeof tt=="function","func","function");try{tt()}catch(ot){it=!0,rt=ot}if(it){if(testError(rt,et,nt,doesNotThrow)){let ot=!1;throw nt==null&&(nt="Got unwanted exception.",ot=!0),new AssertionError({message:nt,actual:rt,expected:et,operator:"doesNotThrow",generatedMessage:ot,stackStartFn:doesNotThrow})}throw rt}}async function rejects(tt,et,nt){typeof et=="string"&&(nt=et,et=void 0);let it=!1,rt=null;typeof tt!="function"&&enforce(isPromise$1(tt),"func","promise");try{isPromise$1(tt)?await tt:await tt()}catch(ot){it=!0,rt=ot}if(!it){let ot=!1;throw nt==null&&(nt="Missing expected rejection.",ot=!0),new AssertionError({message:nt,actual:void 0,expected:et,operator:"rejects",generatedMessage:ot,stackStartFn:rejects})}if(!testError(rt,et,nt,rejects))throw rt}async function doesNotReject(tt,et,nt){typeof et=="string"&&(nt=et,et=void 0);let it=!1,rt=null;typeof tt!="function"&&enforce(isPromise$1(tt),"func","promise");try{isPromise$1(tt)?await tt:await tt()}catch(ot){it=!0,rt=ot}if(it){if(testError(rt,et,nt,doesNotReject)){let ot=!1;throw nt==null&&(nt="Got unwanted rejection.",ot=!0),new AssertionError({message:nt,actual:void 0,expected:et,operator:"doesNotReject",generatedMessage:ot,stackStartFn:doesNotReject})}throw rt}}function ifError(tt){if(tt!=null){let et="ifError got unwanted exception: ";throw typeof tt=="object"&&typeof tt.message=="string"?tt.message.length===0&&tt.constructor?et+=tt.constructor.name:et+=tt.message:et+=stringify$3(tt),new AssertionError({message:et,actual:tt,expected:null,operator:"ifError",generatedMessage:!0,stackStartFn:ifError})}}function deepEqual$1(tt,et,nt){if(!isDeepEqual(tt,et,!1))throw isError(nt)?nt:new AssertionError({message:nt,actual:tt,expected:et,operator:"deepStrictEqual",stackStartFn:deepEqual$1})}function notDeepEqual(tt,et,nt){if(isDeepEqual(tt,et,!0))throw isError(nt)?nt:new AssertionError({message:nt,actual:tt,expected:et,operator:"notDeepStrictEqual",stackStartFn:notDeepEqual})}function bufferEqual(tt,et,nt,it){if(isEncoding(nt)||(it=nt,nt=null),nt==null&&(nt="hex"),et=bufferize(tt,et,nt),enforce(isBuffer$4(tt),"actual","buffer"),enforce(isBuffer$4(et),"expected","buffer"),tt!==et&&!tt.equals(et))throw isError(it)?it:new AssertionError({message:it,actual:tt.toString(nt),expected:et.toString(nt),operator:"bufferEqual",stackStartFn:bufferEqual})}function notBufferEqual(tt,et,nt,it){if(isEncoding(nt)||(it=nt,nt=null),nt==null&&(nt="hex"),et=bufferize(tt,et,nt),enforce(isBuffer$4(tt),"actual","buffer"),enforce(isBuffer$4(et),"expected","buffer"),tt===et||tt.equals(et))throw isError(it)?it:new AssertionError({message:it,actual:tt.toString(nt),expected:et.toString(nt),operator:"notBufferEqual",stackStartFn:notBufferEqual})}function enforce(tt,et,nt){if(!tt){let it;et==null?it="Invalid type for parameter.":nt==null?it=`Invalid type for "${et}".`:it=`"${et}" must be a(n) ${nt}.`;const rt=new TypeError(it);throw Error.captureStackTrace&&Error.captureStackTrace(rt,enforce),rt}}function range$8(tt,et){if(!tt){const nt=et!=null?`"${et}" is out of range.`:"Parameter is out of range.",it=new RangeError(nt);throw Error.captureStackTrace&&Error.captureStackTrace(it,range$8),it}}function stringify$3(tt){switch(typeof tt){case"undefined":return"undefined";case"object":return tt===null?"null":`[${objectName(tt)}]`;case"boolean":return`${tt}`;case"number":return`${tt}`;case"string":return tt.length>80&&(tt=`${tt.substring(0,77)}...`),JSON.stringify(tt);case"symbol":return tryString(tt);case"function":return`[${funcName(tt)}]`;case"bigint":return`${tt}n`;default:return`[${typeof tt}]`}}function toString$9(tt){return typeof tt=="string"?tt:isError(tt)?tryString(tt):stringify$3(tt)}function tryString(tt){try{return String(tt)}catch{return"Object"}}function testError(tt,et,nt,it){if(et==null)return!0;if(isRegExp(et))return et.test(tt);if(typeof et!="function"){if(it===doesNotThrow||it===doesNotReject)throw new TypeError('"expected" must not be an object.');if(typeof et!="object")throw new TypeError('"expected" must be an object.');let rt=!1;if(nt==null&&(nt=`Missing expected ${it===rejects?"rejection":"exception"}.`,rt=!0),tt==null||typeof tt!="object")throw new AssertionError({actual:tt,expected:et,message:nt,operator:it.name,generatedMessage:rt,stackStartFn:it});const ot=Object.keys(et);if(isError(et)&&ot.push("name","message"),ot.length===0)throw new TypeError('"expected" may not be an empty object.');for(const at of ot){const st=et[at],lt=tt[at];if(!(typeof lt=="string"&&isRegExp(st)&&st.test(lt))&&!(at in tt&&isDeepEqual(lt,st,!1)))throw new AssertionError({actual:tt,expected:et,message:nt,operator:it.name,generatedMessage:rt,stackStartFn:it})}return!0}return et.prototype!==void 0&&tt instanceof et?!0:Error.isPrototypeOf(et)?!1:et.call({},tt)===!0}function isDeepEqual(tt,et,nt){try{return compare(tt,et,null)}catch{return nt}}function compare(tt,et,nt){if(Object.is(tt,et))return!0;if(!isObject$i(tt)||!isObject$i(et)||objectString(tt)!==objectString(et)||Object.getPrototypeOf(tt)!==Object.getPrototypeOf(et))return!1;if(isBuffer$4(tt)&&isBuffer$4(et))return tt.equals(et);if(isDate(tt))return Object.is(tt.getTime(),et.getTime());if(isRegExp(tt))return tt.source===et.source&&tt.global===et.global&&tt.multiline===et.multiline&&tt.lastIndex===et.lastIndex&&tt.ignoreCase===et.ignoreCase;if(isError(tt)&&tt.message!==et.message)return!1;if(isArrayBuffer(tt)&&(tt=new Uint8Array(tt),et=new Uint8Array(et)),isView$2(tt)&&!isBuffer$4(tt)){if(isBuffer$4(et))return!1;const rt=new Uint8Array(tt.buffer),ot=new Uint8Array(et.buffer);if(rt.length!==ot.length)return!1;for(let at=0;at>>1?null:rt}return et}assert$4.AssertionError=AssertionError;assert$4.assert=assert$4;assert$4.strict=assert$4;assert$4.ok=assert$4;assert$4.equal=equal$1;assert$4.notEqual=notEqual;assert$4.strictEqual=equal$1;assert$4.notStrictEqual=notEqual;assert$4.fail=fail;assert$4.throws=throws;assert$4.doesNotThrow=doesNotThrow;assert$4.rejects=rejects;assert$4.doesNotReject=doesNotReject;assert$4.ifError=ifError;assert$4.deepEqual=deepEqual$1;assert$4.notDeepEqual=notDeepEqual;assert$4.deepStrictEqual=deepEqual$1;assert$4.notDeepStrictEqual=notDeepEqual;assert$4.bufferEqual=bufferEqual;assert$4.notBufferEqual=notBufferEqual;assert$4.enforce=enforce;assert$4.range=range$8;var assert_1=assert$4,__createBinding$2=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(tt,et,nt,it){it===void 0&&(it=nt);var rt=Object.getOwnPropertyDescriptor(et,nt);(!rt||("get"in rt?!et.__esModule:rt.writable||rt.configurable))&&(rt={enumerable:!0,get:function(){return et[nt]}}),Object.defineProperty(tt,it,rt)}:function(tt,et,nt,it){it===void 0&&(it=nt),tt[it]=et[nt]}),__setModuleDefault$2=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(tt,et){Object.defineProperty(tt,"default",{enumerable:!0,value:et})}:function(tt,et){tt.default=et}),__importStar$2=commonjsGlobal&&commonjsGlobal.__importStar||function(tt){if(tt&&tt.__esModule)return tt;var et={};if(tt!=null)for(var nt in tt)nt!=="default"&&Object.prototype.hasOwnProperty.call(tt,nt)&&__createBinding$2(et,tt,nt);return __setModuleDefault$2(et,tt),et},__importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(tt){return tt&&tt.__esModule?tt:{default:tt}};Object.defineProperty(caveat,"__esModule",{value:!0});caveat.verifyCaveats=caveat.hasCaveat=caveat.Caveat=caveat.ErrInvalidCaveat=void 0;const bsert_1=__importDefault(assert_1),Macaroon$1=__importStar$2(macaroon$1);class ErrInvalidCaveat extends Error{constructor(...et){super(...et),Error.captureStackTrace&&Error.captureStackTrace(this,ErrInvalidCaveat),this.name="ErrInvalidCaveat",this.message='Caveat must be of the form "condition[<,=,>]value"'}}caveat.ErrInvalidCaveat=ErrInvalidCaveat;const validComp=new Set(["<",">","="]);class Caveat{constructor(et){this.condition="",this.value="",this.comp="=",et&&this.fromOptions(et)}fromOptions(et){if((0,bsert_1.default)(et,"Data required to create new caveat"),(0,bsert_1.default)(typeof et.condition=="string"&&et.condition.length,"Require a condition"),this.condition=et.condition,et.value.toString(),this.value=et.value,et.comp){if(!validComp.has(et.comp))throw new ErrInvalidCaveat;this.comp=et.comp}return this}encode(){return`${this.condition}${this.comp}${this.value}`}static decode(et){let nt;for(let at=0;at{try{if(at.i!=null){const st=Caveat.decode(at.i);rt===st.condition&&(ot=st.value)}}catch{}}),ot||!1}caveat.hasCaveat=hasCaveat;function verifyCaveats(tt,et,nt={}){if(et)Array.isArray(et)||(et=[et]);else return!0;const it=new Map;for(const ot of et)it.set(ot.condition,ot);const rt=new Map;for(const ot of tt){const at=ot.condition;if(!it.has(at))continue;rt.has(at)||rt.set(at,[]);const st=rt.get(at);st.push(ot),rt.set(at,st)}for(const[ot,at]of rt){const st=it.get(ot);for(let lt=0;lt>25;return(tt&33554431)<<5^-(et>>0&1)&996825010^-(et>>1&1)&642813549^-(et>>2&1)&513874426^-(et>>3&1)&1027748829^-(et>>4&1)&705979059}function prefixChk$1(tt){for(var et=1,nt=0;nt126)return"Invalid prefix ("+tt+")";et=polymodStep$1(et)^it>>5}for(et=polymodStep$1(et),nt=0;ntnt)throw new TypeError("Exceeds length limit");tt=tt.toLowerCase();var it=prefixChk$1(tt);if(typeof it=="string")throw new Error(it);for(var rt=tt+"1",ot=0;ot>5)throw new Error("Non 5-bit word");it=polymodStep$1(it)^at,rt+=ALPHABET$2.charAt(at)}for(ot=0;ot<6;++ot)it=polymodStep$1(it);for(it^=1,ot=0;ot<6;++ot){var st=it>>(5-ot)*5&31;rt+=ALPHABET$2.charAt(st)}return rt}function __decode(tt,et){if(et=et||90,tt.length<8)return tt+" too short";if(tt.length>et)return"Exceeds length limit";var nt=tt.toLowerCase(),it=tt.toUpperCase();if(tt!==nt&&tt!==it)return"Mixed-case string "+tt;tt=nt;var rt=tt.lastIndexOf("1");if(rt===-1)return"No separator character for "+tt;if(rt===0)return"Missing prefix for "+tt;var ot=tt.slice(0,rt),at=tt.slice(rt+1);if(at.length<6)return"Data too short";var st=prefixChk$1(ot);if(typeof st=="string")return st;for(var lt=[],ct=0;ct=at.length)&<.push(ht)}return st!==1?"Invalid checksum for "+tt:{prefix:ot,words:lt}}function decodeUnsafe(){var tt=__decode.apply(null,arguments);if(typeof tt=="object")return tt}function decode$o(tt){var et=__decode.apply(null,arguments);if(typeof et=="object")return et;throw new Error(et)}function convert$5(tt,et,nt,it){for(var rt=0,ot=0,at=(1<=nt;)ot-=nt,st.push(rt>>ot&at);if(it)ot>0&&st.push(rt<=et)return"Excess padding";if(rt<new Uint8Array(nt),et){return typeof tt=="function"&&(tt=tt(et)),isUint8Array$2("output",tt,et),tt}function toTypeString(tt){return Object.prototype.toString.call(tt).slice(8,-1)}var lib$2=tt=>({contextRandomize(et){switch(assert$3(et===null||et instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),et!==null&&isUint8Array$2("seed",et,32),tt.contextRandomize(et)){case 1:throw new Error(errors$2.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(et){return isUint8Array$2("private key",et,32),tt.privateKeyVerify(et)===0},privateKeyNegate(et){switch(isUint8Array$2("private key",et,32),tt.privateKeyNegate(et)){case 0:return et;case 1:throw new Error(errors$2.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(et,nt){switch(isUint8Array$2("private key",et,32),isUint8Array$2("tweak",nt,32),tt.privateKeyTweakAdd(et,nt)){case 0:return et;case 1:throw new Error(errors$2.TWEAK_ADD)}},privateKeyTweakMul(et,nt){switch(isUint8Array$2("private key",et,32),isUint8Array$2("tweak",nt,32),tt.privateKeyTweakMul(et,nt)){case 0:return et;case 1:throw new Error(errors$2.TWEAK_MUL)}},publicKeyVerify(et){return isUint8Array$2("public key",et,[33,65]),tt.publicKeyVerify(et)===0},publicKeyCreate(et,nt=!0,it){switch(isUint8Array$2("private key",et,32),isCompressed(nt),it=getAssertedOutput(it,nt?33:65),tt.publicKeyCreate(it,et)){case 0:return it;case 1:throw new Error(errors$2.SECKEY_INVALID);case 2:throw new Error(errors$2.PUBKEY_SERIALIZE)}},publicKeyConvert(et,nt=!0,it){switch(isUint8Array$2("public key",et,[33,65]),isCompressed(nt),it=getAssertedOutput(it,nt?33:65),tt.publicKeyConvert(it,et)){case 0:return it;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.PUBKEY_SERIALIZE)}},publicKeyNegate(et,nt=!0,it){switch(isUint8Array$2("public key",et,[33,65]),isCompressed(nt),it=getAssertedOutput(it,nt?33:65),tt.publicKeyNegate(it,et)){case 0:return it;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.IMPOSSIBLE_CASE);case 3:throw new Error(errors$2.PUBKEY_SERIALIZE)}},publicKeyCombine(et,nt=!0,it){assert$3(Array.isArray(et),"Expected public keys to be an Array"),assert$3(et.length>0,"Expected public keys array will have more than zero items");for(const rt of et)isUint8Array$2("public key",rt,[33,65]);switch(isCompressed(nt),it=getAssertedOutput(it,nt?33:65),tt.publicKeyCombine(it,et)){case 0:return it;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.PUBKEY_COMBINE);case 3:throw new Error(errors$2.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(et,nt,it=!0,rt){switch(isUint8Array$2("public key",et,[33,65]),isUint8Array$2("tweak",nt,32),isCompressed(it),rt=getAssertedOutput(rt,it?33:65),tt.publicKeyTweakAdd(rt,et,nt)){case 0:return rt;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.TWEAK_ADD)}},publicKeyTweakMul(et,nt,it=!0,rt){switch(isUint8Array$2("public key",et,[33,65]),isUint8Array$2("tweak",nt,32),isCompressed(it),rt=getAssertedOutput(rt,it?33:65),tt.publicKeyTweakMul(rt,et,nt)){case 0:return rt;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.TWEAK_MUL)}},signatureNormalize(et){switch(isUint8Array$2("signature",et,64),tt.signatureNormalize(et)){case 0:return et;case 1:throw new Error(errors$2.SIG_PARSE)}},signatureExport(et,nt){isUint8Array$2("signature",et,64),nt=getAssertedOutput(nt,72);const it={output:nt,outputlen:72};switch(tt.signatureExport(it,et)){case 0:return nt.slice(0,it.outputlen);case 1:throw new Error(errors$2.SIG_PARSE);case 2:throw new Error(errors$2.IMPOSSIBLE_CASE)}},signatureImport(et,nt){switch(isUint8Array$2("signature",et),nt=getAssertedOutput(nt,64),tt.signatureImport(nt,et)){case 0:return nt;case 1:throw new Error(errors$2.SIG_PARSE);case 2:throw new Error(errors$2.IMPOSSIBLE_CASE)}},ecdsaSign(et,nt,it={},rt){isUint8Array$2("message",et,32),isUint8Array$2("private key",nt,32),assert$3(toTypeString(it)==="Object","Expected options to be an Object"),it.data!==void 0&&isUint8Array$2("options.data",it.data),it.noncefn!==void 0&&assert$3(toTypeString(it.noncefn)==="Function","Expected options.noncefn to be a Function"),rt=getAssertedOutput(rt,64);const ot={signature:rt,recid:null};switch(tt.ecdsaSign(ot,et,nt,it.data,it.noncefn)){case 0:return ot;case 1:throw new Error(errors$2.SIGN);case 2:throw new Error(errors$2.IMPOSSIBLE_CASE)}},ecdsaVerify(et,nt,it){switch(isUint8Array$2("signature",et,64),isUint8Array$2("message",nt,32),isUint8Array$2("public key",it,[33,65]),tt.ecdsaVerify(et,nt,it)){case 0:return!0;case 3:return!1;case 1:throw new Error(errors$2.SIG_PARSE);case 2:throw new Error(errors$2.PUBKEY_PARSE)}},ecdsaRecover(et,nt,it,rt=!0,ot){switch(isUint8Array$2("signature",et,64),assert$3(toTypeString(nt)==="Number"&&nt>=0&&nt<=3,"Expected recovery id to be a Number within interval [0, 3]"),isUint8Array$2("message",it,32),isCompressed(rt),ot=getAssertedOutput(ot,rt?33:65),tt.ecdsaRecover(ot,et,nt,it)){case 0:return ot;case 1:throw new Error(errors$2.SIG_PARSE);case 2:throw new Error(errors$2.RECOVER);case 3:throw new Error(errors$2.IMPOSSIBLE_CASE)}},ecdh(et,nt,it={},rt){switch(isUint8Array$2("public key",et,[33,65]),isUint8Array$2("private key",nt,32),assert$3(toTypeString(it)==="Object","Expected options to be an Object"),it.data!==void 0&&isUint8Array$2("options.data",it.data),it.hashfn!==void 0?(assert$3(toTypeString(it.hashfn)==="Function","Expected options.hashfn to be a Function"),it.xbuf!==void 0&&isUint8Array$2("options.xbuf",it.xbuf,32),it.ybuf!==void 0&&isUint8Array$2("options.ybuf",it.ybuf,32),isUint8Array$2("output",rt)):rt=getAssertedOutput(rt,32),tt.ecdh(rt,et,nt,it.data,it.hashfn,it.xbuf,it.ybuf)){case 0:return rt;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.ECDH)}}});const EC=requireElliptic().ec,ec=new EC("secp256k1"),ecparams=ec.curve,BN$1=ecparams.n.constructor;function loadCompressedPublicKey(tt,et){let nt=new BN$1(et);if(nt.cmp(ecparams.p)>=0)return null;nt=nt.toRed(ecparams.red);let it=nt.redSqr().redIMul(nt).redIAdd(ecparams.b).redSqrt();return tt===3!==it.isOdd()&&(it=it.redNeg()),ec.keyPair({pub:{x:nt,y:it}})}function loadUncompressedPublicKey(tt,et,nt){let it=new BN$1(et),rt=new BN$1(nt);if(it.cmp(ecparams.p)>=0||rt.cmp(ecparams.p)>=0||(it=it.toRed(ecparams.red),rt=rt.toRed(ecparams.red),(tt===6||tt===7)&&rt.isOdd()!==(tt===7)))return null;const ot=it.redSqr().redIMul(it);return rt.redSqr().redISub(ot.redIAdd(ecparams.b)).isZero()?ec.keyPair({pub:{x:it,y:rt}}):null}function loadPublicKey(tt){const et=tt[0];switch(et){case 2:case 3:return tt.length!==33?null:loadCompressedPublicKey(et,tt.subarray(1,33));case 4:case 6:case 7:return tt.length!==65?null:loadUncompressedPublicKey(et,tt.subarray(1,33),tt.subarray(33,65));default:return null}}function savePublicKey(tt,et){const nt=et.encode(null,tt.length===33);for(let it=0;it=0||(nt.iadd(new BN$1(tt)),nt.cmp(ecparams.n)>=0&&nt.isub(ecparams.n),nt.isZero()))return 1;const it=nt.toArrayLike(Uint8Array,"be",32);return tt.set(it),0},privateKeyTweakMul(tt,et){let nt=new BN$1(et);if(nt.cmp(ecparams.n)>=0||nt.isZero())return 1;nt.imul(new BN$1(tt)),nt.cmp(ecparams.n)>=0&&(nt=nt.umod(ecparams.n));const it=nt.toArrayLike(Uint8Array,"be",32);return tt.set(it),0},publicKeyVerify(tt){return loadPublicKey(tt)===null?1:0},publicKeyCreate(tt,et){const nt=new BN$1(et);if(nt.cmp(ecparams.n)>=0||nt.isZero())return 1;const it=ec.keyFromPrivate(et).getPublic();return savePublicKey(tt,it),0},publicKeyConvert(tt,et){const nt=loadPublicKey(et);if(nt===null)return 1;const it=nt.getPublic();return savePublicKey(tt,it),0},publicKeyNegate(tt,et){const nt=loadPublicKey(et);if(nt===null)return 1;const it=nt.getPublic();return it.y=it.y.redNeg(),savePublicKey(tt,it),0},publicKeyCombine(tt,et){const nt=new Array(et.length);for(let rt=0;rt=0)return 2;const rt=it.getPublic().add(ecparams.g.mul(nt));return rt.isInfinity()?2:(savePublicKey(tt,rt),0)},publicKeyTweakMul(tt,et,nt){const it=loadPublicKey(et);if(it===null)return 1;if(nt=new BN$1(nt),nt.cmp(ecparams.n)>=0||nt.isZero())return 2;const rt=it.getPublic().mul(nt);return savePublicKey(tt,rt),0},signatureNormalize(tt){const et=new BN$1(tt.subarray(0,32)),nt=new BN$1(tt.subarray(32,64));return et.cmp(ecparams.n)>=0||nt.cmp(ecparams.n)>=0?1:(nt.cmp(ec.nh)===1&&tt.set(ecparams.n.sub(nt).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(tt,et){const nt=et.subarray(0,32),it=et.subarray(32,64);if(new BN$1(nt).cmp(ecparams.n)>=0||new BN$1(it).cmp(ecparams.n)>=0)return 1;const{output:rt}=tt;let ot=rt.subarray(4,4+33);ot[0]=0,ot.set(nt,1);let at=33,st=0;for(;at>1&&ot[st]===0&&!(ot[st+1]&128);--at,++st);if(ot=ot.subarray(st),ot[0]&128||at>1&&ot[0]===0&&!(ot[1]&128))return 1;let lt=rt.subarray(6+33,6+33+33);lt[0]=0,lt.set(it,1);let ct=33,ut=0;for(;ct>1&<[ut]===0&&!(lt[ut+1]&128);--ct,++ut);return lt=lt.subarray(ut),lt[0]&128||ct>1&<[0]===0&&!(lt[1]&128)?1:(tt.outputlen=6+at+ct,rt[0]=48,rt[1]=tt.outputlen-2,rt[2]=2,rt[3]=ot.length,rt.set(ot,4),rt[4+at]=2,rt[5+at]=lt.length,rt.set(lt,6+at),0)},signatureImport(tt,et){if(et.length<8||et.length>72||et[0]!==48||et[1]!==et.length-2||et[2]!==2)return 1;const nt=et[3];if(nt===0||5+nt>=et.length||et[4+nt]!==2)return 1;const it=et[5+nt];if(it===0||6+nt+it!==et.length||et[4]&128||nt>1&&et[4]===0&&!(et[5]&128)||et[nt+6]&128||it>1&&et[nt+6]===0&&!(et[nt+7]&128))return 1;let rt=et.subarray(4,4+nt);if(rt.length===33&&rt[0]===0&&(rt=rt.subarray(1)),rt.length>32)return 1;let ot=et.subarray(6+nt);if(ot.length===33&&ot[0]===0&&(ot=ot.slice(1)),ot.length>32)throw new Error("S length is too long");let at=new BN$1(rt);at.cmp(ecparams.n)>=0&&(at=new BN$1(0));let st=new BN$1(et.subarray(6+nt));return st.cmp(ecparams.n)>=0&&(st=new BN$1(0)),tt.set(at.toArrayLike(Uint8Array,"be",32),0),tt.set(st.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(tt,et,nt,it,rt){if(rt){const st=rt;rt=lt=>{const ct=st(et,nt,null,it,lt);if(!(ct instanceof Uint8Array&&ct.length===32))throw new Error("This is the way");return new BN$1(ct)}}const ot=new BN$1(nt);if(ot.cmp(ecparams.n)>=0||ot.isZero())return 1;let at;try{at=ec.sign(et,nt,{canonical:!0,k:rt,pers:it})}catch{return 1}return tt.signature.set(at.r.toArrayLike(Uint8Array,"be",32),0),tt.signature.set(at.s.toArrayLike(Uint8Array,"be",32),32),tt.recid=at.recoveryParam,0},ecdsaVerify(tt,et,nt){const it={r:tt.subarray(0,32),s:tt.subarray(32,64)},rt=new BN$1(it.r),ot=new BN$1(it.s);if(rt.cmp(ecparams.n)>=0||ot.cmp(ecparams.n)>=0)return 1;if(ot.cmp(ec.nh)===1||rt.isZero()||ot.isZero())return 3;const at=loadPublicKey(nt);if(at===null)return 2;const st=at.getPublic();return ec.verify(et,it,st)?0:3},ecdsaRecover(tt,et,nt,it){const rt={r:et.slice(0,32),s:et.slice(32,64)},ot=new BN$1(rt.r),at=new BN$1(rt.s);if(ot.cmp(ecparams.n)>=0||at.cmp(ecparams.n)>=0)return 1;if(ot.isZero()||at.isZero())return 2;let st;try{st=ec.recoverPubKey(it,rt,nt)}catch{return 2}return savePublicKey(tt,st),0},ecdh(tt,et,nt,it,rt,ot,at){const st=loadPublicKey(et);if(st===null)return 1;const lt=new BN$1(nt);if(lt.cmp(ecparams.n)>=0||lt.isZero())return 2;const ct=st.getPublic().mul(lt);if(rt===void 0){const ut=ct.encode(null,!0),ht=ec.hash().update(ut).digest();for(let dt=0;dt<32;++dt)tt[dt]=ht[dt]}else{ot||(ot=new Uint8Array(32));const ut=ct.getX().toArray("be",32);for(let mt=0;mt<32;++mt)ot[mt]=ut[mt];at||(at=new Uint8Array(32));const ht=ct.getY().toArray("be",32);for(let mt=0;mt<32;++mt)at[mt]=ht[mt];const dt=rt(ot,at,it);if(!(dt instanceof Uint8Array&&dt.length===tt.length))return 2;tt.set(dt)}return 0}},elliptic=lib$2(elliptic$1),src$1={},address={},networks$1={};Object.defineProperty(networks$1,"__esModule",{value:!0});networks$1.testnet=networks$1.regtest=networks$1.bitcoin=void 0;networks$1.bitcoin={messagePrefix:`Bitcoin Signed Message: + */class AssertionError extends Error{constructor(et){typeof et=="string"&&(et={message:et}),(et===null||typeof et!="object")&&(et={});let nt=null,it="fail",rt=!!et.generatedMessage;if(et.message!=null&&(nt=toString$9(et.message)),typeof et.operator=="string"&&(it=et.operator),nt==null){if(it==="fail")nt="Assertion failed.";else{const at=stringify$3(et.actual),st=stringify$3(et.expected);nt=`${at} ${it} ${st}`}rt=!0}super(nt);let ot=this.constructor;typeof et.stackStartFunction=="function"?ot=et.stackStartFunction:typeof et.stackStartFn=="function"&&(ot=et.stackStartFn),this.type="AssertionError",this.name="AssertionError [ERR_ASSERTION]",this.code="ERR_ASSERTION",this.generatedMessage=rt,this.actual=et.actual,this.expected=et.expected,this.operator=it,Error.captureStackTrace&&Error.captureStackTrace(this,ot)}}function assert$4(tt,et){if(!tt){let nt=!1;if(arguments.length===0)et="No value argument passed to `assert()`.",nt=!0;else if(et==null)et="Assertion failed.",nt=!0;else if(isError(et))throw et;throw new AssertionError({message:et,actual:tt,expected:!0,operator:"==",generatedMessage:nt,stackStartFn:assert$4})}}function equal$1(tt,et,nt){if(!Object.is(tt,et))throw isError(nt)?nt:new AssertionError({message:nt,actual:tt,expected:et,operator:"strictEqual",stackStartFn:equal$1})}function notEqual(tt,et,nt){if(Object.is(tt,et))throw isError(nt)?nt:new AssertionError({message:nt,actual:tt,expected:et,operator:"notStrictEqual",stackStartFn:notEqual})}function fail(tt){let et=!1;throw isError(tt)?tt:(tt==null&&(tt="Assertion failed.",et=!0),new AssertionError({message:tt,actual:!1,expected:!0,operator:"fail",generatedMessage:et,stackStartFn:fail}))}function throws(tt,et,nt){typeof et=="string"&&(nt=et,et=void 0);let it=!1,rt=null;enforce(typeof tt=="function","func","function");try{tt()}catch(ot){it=!0,rt=ot}if(!it){let ot=!1;throw nt==null&&(nt="Missing expected exception.",ot=!0),new AssertionError({message:nt,actual:void 0,expected:et,operator:"throws",generatedMessage:ot,stackStartFn:throws})}if(!testError(rt,et,nt,throws))throw rt}function doesNotThrow(tt,et,nt){typeof et=="string"&&(nt=et,et=void 0);let it=!1,rt=null;enforce(typeof tt=="function","func","function");try{tt()}catch(ot){it=!0,rt=ot}if(it){if(testError(rt,et,nt,doesNotThrow)){let ot=!1;throw nt==null&&(nt="Got unwanted exception.",ot=!0),new AssertionError({message:nt,actual:rt,expected:et,operator:"doesNotThrow",generatedMessage:ot,stackStartFn:doesNotThrow})}throw rt}}async function rejects(tt,et,nt){typeof et=="string"&&(nt=et,et=void 0);let it=!1,rt=null;typeof tt!="function"&&enforce(isPromise$1(tt),"func","promise");try{isPromise$1(tt)?await tt:await tt()}catch(ot){it=!0,rt=ot}if(!it){let ot=!1;throw nt==null&&(nt="Missing expected rejection.",ot=!0),new AssertionError({message:nt,actual:void 0,expected:et,operator:"rejects",generatedMessage:ot,stackStartFn:rejects})}if(!testError(rt,et,nt,rejects))throw rt}async function doesNotReject(tt,et,nt){typeof et=="string"&&(nt=et,et=void 0);let it=!1,rt=null;typeof tt!="function"&&enforce(isPromise$1(tt),"func","promise");try{isPromise$1(tt)?await tt:await tt()}catch(ot){it=!0,rt=ot}if(it){if(testError(rt,et,nt,doesNotReject)){let ot=!1;throw nt==null&&(nt="Got unwanted rejection.",ot=!0),new AssertionError({message:nt,actual:void 0,expected:et,operator:"doesNotReject",generatedMessage:ot,stackStartFn:doesNotReject})}throw rt}}function ifError(tt){if(tt!=null){let et="ifError got unwanted exception: ";throw typeof tt=="object"&&typeof tt.message=="string"?tt.message.length===0&&tt.constructor?et+=tt.constructor.name:et+=tt.message:et+=stringify$3(tt),new AssertionError({message:et,actual:tt,expected:null,operator:"ifError",generatedMessage:!0,stackStartFn:ifError})}}function deepEqual$1(tt,et,nt){if(!isDeepEqual(tt,et,!1))throw isError(nt)?nt:new AssertionError({message:nt,actual:tt,expected:et,operator:"deepStrictEqual",stackStartFn:deepEqual$1})}function notDeepEqual(tt,et,nt){if(isDeepEqual(tt,et,!0))throw isError(nt)?nt:new AssertionError({message:nt,actual:tt,expected:et,operator:"notDeepStrictEqual",stackStartFn:notDeepEqual})}function bufferEqual(tt,et,nt,it){if(isEncoding(nt)||(it=nt,nt=null),nt==null&&(nt="hex"),et=bufferize(tt,et,nt),enforce(isBuffer$4(tt),"actual","buffer"),enforce(isBuffer$4(et),"expected","buffer"),tt!==et&&!tt.equals(et))throw isError(it)?it:new AssertionError({message:it,actual:tt.toString(nt),expected:et.toString(nt),operator:"bufferEqual",stackStartFn:bufferEqual})}function notBufferEqual(tt,et,nt,it){if(isEncoding(nt)||(it=nt,nt=null),nt==null&&(nt="hex"),et=bufferize(tt,et,nt),enforce(isBuffer$4(tt),"actual","buffer"),enforce(isBuffer$4(et),"expected","buffer"),tt===et||tt.equals(et))throw isError(it)?it:new AssertionError({message:it,actual:tt.toString(nt),expected:et.toString(nt),operator:"notBufferEqual",stackStartFn:notBufferEqual})}function enforce(tt,et,nt){if(!tt){let it;et==null?it="Invalid type for parameter.":nt==null?it=`Invalid type for "${et}".`:it=`"${et}" must be a(n) ${nt}.`;const rt=new TypeError(it);throw Error.captureStackTrace&&Error.captureStackTrace(rt,enforce),rt}}function range$8(tt,et){if(!tt){const nt=et!=null?`"${et}" is out of range.`:"Parameter is out of range.",it=new RangeError(nt);throw Error.captureStackTrace&&Error.captureStackTrace(it,range$8),it}}function stringify$3(tt){switch(typeof tt){case"undefined":return"undefined";case"object":return tt===null?"null":`[${objectName(tt)}]`;case"boolean":return`${tt}`;case"number":return`${tt}`;case"string":return tt.length>80&&(tt=`${tt.substring(0,77)}...`),JSON.stringify(tt);case"symbol":return tryString(tt);case"function":return`[${funcName(tt)}]`;case"bigint":return`${tt}n`;default:return`[${typeof tt}]`}}function toString$9(tt){return typeof tt=="string"?tt:isError(tt)?tryString(tt):stringify$3(tt)}function tryString(tt){try{return String(tt)}catch{return"Object"}}function testError(tt,et,nt,it){if(et==null)return!0;if(isRegExp(et))return et.test(tt);if(typeof et!="function"){if(it===doesNotThrow||it===doesNotReject)throw new TypeError('"expected" must not be an object.');if(typeof et!="object")throw new TypeError('"expected" must be an object.');let rt=!1;if(nt==null&&(nt=`Missing expected ${it===rejects?"rejection":"exception"}.`,rt=!0),tt==null||typeof tt!="object")throw new AssertionError({actual:tt,expected:et,message:nt,operator:it.name,generatedMessage:rt,stackStartFn:it});const ot=Object.keys(et);if(isError(et)&&ot.push("name","message"),ot.length===0)throw new TypeError('"expected" may not be an empty object.');for(const at of ot){const st=et[at],lt=tt[at];if(!(typeof lt=="string"&&isRegExp(st)&&st.test(lt))&&!(at in tt&&isDeepEqual(lt,st,!1)))throw new AssertionError({actual:tt,expected:et,message:nt,operator:it.name,generatedMessage:rt,stackStartFn:it})}return!0}return et.prototype!==void 0&&tt instanceof et?!0:Error.isPrototypeOf(et)?!1:et.call({},tt)===!0}function isDeepEqual(tt,et,nt){try{return compare(tt,et,null)}catch{return nt}}function compare(tt,et,nt){if(Object.is(tt,et))return!0;if(!isObject$i(tt)||!isObject$i(et)||objectString(tt)!==objectString(et)||Object.getPrototypeOf(tt)!==Object.getPrototypeOf(et))return!1;if(isBuffer$4(tt)&&isBuffer$4(et))return tt.equals(et);if(isDate(tt))return Object.is(tt.getTime(),et.getTime());if(isRegExp(tt))return tt.source===et.source&&tt.global===et.global&&tt.multiline===et.multiline&&tt.lastIndex===et.lastIndex&&tt.ignoreCase===et.ignoreCase;if(isError(tt)&&tt.message!==et.message)return!1;if(isArrayBuffer(tt)&&(tt=new Uint8Array(tt),et=new Uint8Array(et)),isView$2(tt)&&!isBuffer$4(tt)){if(isBuffer$4(et))return!1;const rt=new Uint8Array(tt.buffer),ot=new Uint8Array(et.buffer);if(rt.length!==ot.length)return!1;for(let at=0;at>>1?null:rt}return et}assert$4.AssertionError=AssertionError;assert$4.assert=assert$4;assert$4.strict=assert$4;assert$4.ok=assert$4;assert$4.equal=equal$1;assert$4.notEqual=notEqual;assert$4.strictEqual=equal$1;assert$4.notStrictEqual=notEqual;assert$4.fail=fail;assert$4.throws=throws;assert$4.doesNotThrow=doesNotThrow;assert$4.rejects=rejects;assert$4.doesNotReject=doesNotReject;assert$4.ifError=ifError;assert$4.deepEqual=deepEqual$1;assert$4.notDeepEqual=notDeepEqual;assert$4.deepStrictEqual=deepEqual$1;assert$4.notDeepStrictEqual=notDeepEqual;assert$4.bufferEqual=bufferEqual;assert$4.notBufferEqual=notBufferEqual;assert$4.enforce=enforce;assert$4.range=range$8;var assert_1=assert$4,__createBinding$2=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(tt,et,nt,it){it===void 0&&(it=nt);var rt=Object.getOwnPropertyDescriptor(et,nt);(!rt||("get"in rt?!et.__esModule:rt.writable||rt.configurable))&&(rt={enumerable:!0,get:function(){return et[nt]}}),Object.defineProperty(tt,it,rt)}:function(tt,et,nt,it){it===void 0&&(it=nt),tt[it]=et[nt]}),__setModuleDefault$2=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(tt,et){Object.defineProperty(tt,"default",{enumerable:!0,value:et})}:function(tt,et){tt.default=et}),__importStar$2=commonjsGlobal&&commonjsGlobal.__importStar||function(tt){if(tt&&tt.__esModule)return tt;var et={};if(tt!=null)for(var nt in tt)nt!=="default"&&Object.prototype.hasOwnProperty.call(tt,nt)&&__createBinding$2(et,tt,nt);return __setModuleDefault$2(et,tt),et},__importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(tt){return tt&&tt.__esModule?tt:{default:tt}};Object.defineProperty(caveat,"__esModule",{value:!0});caveat.verifyCaveats=caveat.hasCaveat=caveat.Caveat=caveat.ErrInvalidCaveat=void 0;const bsert_1=__importDefault$1(assert_1),Macaroon$1=__importStar$2(macaroon$1);class ErrInvalidCaveat extends Error{constructor(...et){super(...et),Error.captureStackTrace&&Error.captureStackTrace(this,ErrInvalidCaveat),this.name="ErrInvalidCaveat",this.message='Caveat must be of the form "condition[<,=,>]value"'}}caveat.ErrInvalidCaveat=ErrInvalidCaveat;const validComp=new Set(["<",">","="]);class Caveat{constructor(et){this.condition="",this.value="",this.comp="=",et&&this.fromOptions(et)}fromOptions(et){if((0,bsert_1.default)(et,"Data required to create new caveat"),(0,bsert_1.default)(typeof et.condition=="string"&&et.condition.length,"Require a condition"),this.condition=et.condition,et.value.toString(),this.value=et.value,et.comp){if(!validComp.has(et.comp))throw new ErrInvalidCaveat;this.comp=et.comp}return this}encode(){return`${this.condition}${this.comp}${this.value}`}static decode(et){let nt;for(let at=0;at{try{if(at.i!=null){const st=Caveat.decode(at.i);rt===st.condition&&(ot=st.value)}}catch{}}),ot||!1}caveat.hasCaveat=hasCaveat;function verifyCaveats(tt,et,nt={}){if(et)Array.isArray(et)||(et=[et]);else return!0;const it=new Map;for(const ot of et)it.set(ot.condition,ot);const rt=new Map;for(const ot of tt){const at=ot.condition;if(!it.has(at))continue;rt.has(at)||rt.set(at,[]);const st=rt.get(at);st.push(ot),rt.set(at,st)}for(const[ot,at]of rt){const st=it.get(ot);for(let lt=0;lt>25;return(tt&33554431)<<5^-(et>>0&1)&996825010^-(et>>1&1)&642813549^-(et>>2&1)&513874426^-(et>>3&1)&1027748829^-(et>>4&1)&705979059}function prefixChk$1(tt){for(var et=1,nt=0;nt126)return"Invalid prefix ("+tt+")";et=polymodStep$1(et)^it>>5}for(et=polymodStep$1(et),nt=0;ntnt)throw new TypeError("Exceeds length limit");tt=tt.toLowerCase();var it=prefixChk$1(tt);if(typeof it=="string")throw new Error(it);for(var rt=tt+"1",ot=0;ot>5)throw new Error("Non 5-bit word");it=polymodStep$1(it)^at,rt+=ALPHABET$2.charAt(at)}for(ot=0;ot<6;++ot)it=polymodStep$1(it);for(it^=1,ot=0;ot<6;++ot){var st=it>>(5-ot)*5&31;rt+=ALPHABET$2.charAt(st)}return rt}function __decode(tt,et){if(et=et||90,tt.length<8)return tt+" too short";if(tt.length>et)return"Exceeds length limit";var nt=tt.toLowerCase(),it=tt.toUpperCase();if(tt!==nt&&tt!==it)return"Mixed-case string "+tt;tt=nt;var rt=tt.lastIndexOf("1");if(rt===-1)return"No separator character for "+tt;if(rt===0)return"Missing prefix for "+tt;var ot=tt.slice(0,rt),at=tt.slice(rt+1);if(at.length<6)return"Data too short";var st=prefixChk$1(ot);if(typeof st=="string")return st;for(var lt=[],ct=0;ct=at.length)&<.push(ht)}return st!==1?"Invalid checksum for "+tt:{prefix:ot,words:lt}}function decodeUnsafe(){var tt=__decode.apply(null,arguments);if(typeof tt=="object")return tt}function decode$o(tt){var et=__decode.apply(null,arguments);if(typeof et=="object")return et;throw new Error(et)}function convert$5(tt,et,nt,it){for(var rt=0,ot=0,at=(1<=nt;)ot-=nt,st.push(rt>>ot&at);if(it)ot>0&&st.push(rt<=et)return"Excess padding";if(rt<new Uint8Array(nt),et){return typeof tt=="function"&&(tt=tt(et)),isUint8Array$2("output",tt,et),tt}function toTypeString(tt){return Object.prototype.toString.call(tt).slice(8,-1)}var lib$2=tt=>({contextRandomize(et){switch(assert$3(et===null||et instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),et!==null&&isUint8Array$2("seed",et,32),tt.contextRandomize(et)){case 1:throw new Error(errors$2.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(et){return isUint8Array$2("private key",et,32),tt.privateKeyVerify(et)===0},privateKeyNegate(et){switch(isUint8Array$2("private key",et,32),tt.privateKeyNegate(et)){case 0:return et;case 1:throw new Error(errors$2.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(et,nt){switch(isUint8Array$2("private key",et,32),isUint8Array$2("tweak",nt,32),tt.privateKeyTweakAdd(et,nt)){case 0:return et;case 1:throw new Error(errors$2.TWEAK_ADD)}},privateKeyTweakMul(et,nt){switch(isUint8Array$2("private key",et,32),isUint8Array$2("tweak",nt,32),tt.privateKeyTweakMul(et,nt)){case 0:return et;case 1:throw new Error(errors$2.TWEAK_MUL)}},publicKeyVerify(et){return isUint8Array$2("public key",et,[33,65]),tt.publicKeyVerify(et)===0},publicKeyCreate(et,nt=!0,it){switch(isUint8Array$2("private key",et,32),isCompressed(nt),it=getAssertedOutput(it,nt?33:65),tt.publicKeyCreate(it,et)){case 0:return it;case 1:throw new Error(errors$2.SECKEY_INVALID);case 2:throw new Error(errors$2.PUBKEY_SERIALIZE)}},publicKeyConvert(et,nt=!0,it){switch(isUint8Array$2("public key",et,[33,65]),isCompressed(nt),it=getAssertedOutput(it,nt?33:65),tt.publicKeyConvert(it,et)){case 0:return it;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.PUBKEY_SERIALIZE)}},publicKeyNegate(et,nt=!0,it){switch(isUint8Array$2("public key",et,[33,65]),isCompressed(nt),it=getAssertedOutput(it,nt?33:65),tt.publicKeyNegate(it,et)){case 0:return it;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.IMPOSSIBLE_CASE);case 3:throw new Error(errors$2.PUBKEY_SERIALIZE)}},publicKeyCombine(et,nt=!0,it){assert$3(Array.isArray(et),"Expected public keys to be an Array"),assert$3(et.length>0,"Expected public keys array will have more than zero items");for(const rt of et)isUint8Array$2("public key",rt,[33,65]);switch(isCompressed(nt),it=getAssertedOutput(it,nt?33:65),tt.publicKeyCombine(it,et)){case 0:return it;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.PUBKEY_COMBINE);case 3:throw new Error(errors$2.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(et,nt,it=!0,rt){switch(isUint8Array$2("public key",et,[33,65]),isUint8Array$2("tweak",nt,32),isCompressed(it),rt=getAssertedOutput(rt,it?33:65),tt.publicKeyTweakAdd(rt,et,nt)){case 0:return rt;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.TWEAK_ADD)}},publicKeyTweakMul(et,nt,it=!0,rt){switch(isUint8Array$2("public key",et,[33,65]),isUint8Array$2("tweak",nt,32),isCompressed(it),rt=getAssertedOutput(rt,it?33:65),tt.publicKeyTweakMul(rt,et,nt)){case 0:return rt;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.TWEAK_MUL)}},signatureNormalize(et){switch(isUint8Array$2("signature",et,64),tt.signatureNormalize(et)){case 0:return et;case 1:throw new Error(errors$2.SIG_PARSE)}},signatureExport(et,nt){isUint8Array$2("signature",et,64),nt=getAssertedOutput(nt,72);const it={output:nt,outputlen:72};switch(tt.signatureExport(it,et)){case 0:return nt.slice(0,it.outputlen);case 1:throw new Error(errors$2.SIG_PARSE);case 2:throw new Error(errors$2.IMPOSSIBLE_CASE)}},signatureImport(et,nt){switch(isUint8Array$2("signature",et),nt=getAssertedOutput(nt,64),tt.signatureImport(nt,et)){case 0:return nt;case 1:throw new Error(errors$2.SIG_PARSE);case 2:throw new Error(errors$2.IMPOSSIBLE_CASE)}},ecdsaSign(et,nt,it={},rt){isUint8Array$2("message",et,32),isUint8Array$2("private key",nt,32),assert$3(toTypeString(it)==="Object","Expected options to be an Object"),it.data!==void 0&&isUint8Array$2("options.data",it.data),it.noncefn!==void 0&&assert$3(toTypeString(it.noncefn)==="Function","Expected options.noncefn to be a Function"),rt=getAssertedOutput(rt,64);const ot={signature:rt,recid:null};switch(tt.ecdsaSign(ot,et,nt,it.data,it.noncefn)){case 0:return ot;case 1:throw new Error(errors$2.SIGN);case 2:throw new Error(errors$2.IMPOSSIBLE_CASE)}},ecdsaVerify(et,nt,it){switch(isUint8Array$2("signature",et,64),isUint8Array$2("message",nt,32),isUint8Array$2("public key",it,[33,65]),tt.ecdsaVerify(et,nt,it)){case 0:return!0;case 3:return!1;case 1:throw new Error(errors$2.SIG_PARSE);case 2:throw new Error(errors$2.PUBKEY_PARSE)}},ecdsaRecover(et,nt,it,rt=!0,ot){switch(isUint8Array$2("signature",et,64),assert$3(toTypeString(nt)==="Number"&&nt>=0&&nt<=3,"Expected recovery id to be a Number within interval [0, 3]"),isUint8Array$2("message",it,32),isCompressed(rt),ot=getAssertedOutput(ot,rt?33:65),tt.ecdsaRecover(ot,et,nt,it)){case 0:return ot;case 1:throw new Error(errors$2.SIG_PARSE);case 2:throw new Error(errors$2.RECOVER);case 3:throw new Error(errors$2.IMPOSSIBLE_CASE)}},ecdh(et,nt,it={},rt){switch(isUint8Array$2("public key",et,[33,65]),isUint8Array$2("private key",nt,32),assert$3(toTypeString(it)==="Object","Expected options to be an Object"),it.data!==void 0&&isUint8Array$2("options.data",it.data),it.hashfn!==void 0?(assert$3(toTypeString(it.hashfn)==="Function","Expected options.hashfn to be a Function"),it.xbuf!==void 0&&isUint8Array$2("options.xbuf",it.xbuf,32),it.ybuf!==void 0&&isUint8Array$2("options.ybuf",it.ybuf,32),isUint8Array$2("output",rt)):rt=getAssertedOutput(rt,32),tt.ecdh(rt,et,nt,it.data,it.hashfn,it.xbuf,it.ybuf)){case 0:return rt;case 1:throw new Error(errors$2.PUBKEY_PARSE);case 2:throw new Error(errors$2.ECDH)}}});const EC=requireElliptic().ec,ec=new EC("secp256k1"),ecparams=ec.curve,BN$1=ecparams.n.constructor;function loadCompressedPublicKey(tt,et){let nt=new BN$1(et);if(nt.cmp(ecparams.p)>=0)return null;nt=nt.toRed(ecparams.red);let it=nt.redSqr().redIMul(nt).redIAdd(ecparams.b).redSqrt();return tt===3!==it.isOdd()&&(it=it.redNeg()),ec.keyPair({pub:{x:nt,y:it}})}function loadUncompressedPublicKey(tt,et,nt){let it=new BN$1(et),rt=new BN$1(nt);if(it.cmp(ecparams.p)>=0||rt.cmp(ecparams.p)>=0||(it=it.toRed(ecparams.red),rt=rt.toRed(ecparams.red),(tt===6||tt===7)&&rt.isOdd()!==(tt===7)))return null;const ot=it.redSqr().redIMul(it);return rt.redSqr().redISub(ot.redIAdd(ecparams.b)).isZero()?ec.keyPair({pub:{x:it,y:rt}}):null}function loadPublicKey(tt){const et=tt[0];switch(et){case 2:case 3:return tt.length!==33?null:loadCompressedPublicKey(et,tt.subarray(1,33));case 4:case 6:case 7:return tt.length!==65?null:loadUncompressedPublicKey(et,tt.subarray(1,33),tt.subarray(33,65));default:return null}}function savePublicKey(tt,et){const nt=et.encode(null,tt.length===33);for(let it=0;it=0||(nt.iadd(new BN$1(tt)),nt.cmp(ecparams.n)>=0&&nt.isub(ecparams.n),nt.isZero()))return 1;const it=nt.toArrayLike(Uint8Array,"be",32);return tt.set(it),0},privateKeyTweakMul(tt,et){let nt=new BN$1(et);if(nt.cmp(ecparams.n)>=0||nt.isZero())return 1;nt.imul(new BN$1(tt)),nt.cmp(ecparams.n)>=0&&(nt=nt.umod(ecparams.n));const it=nt.toArrayLike(Uint8Array,"be",32);return tt.set(it),0},publicKeyVerify(tt){return loadPublicKey(tt)===null?1:0},publicKeyCreate(tt,et){const nt=new BN$1(et);if(nt.cmp(ecparams.n)>=0||nt.isZero())return 1;const it=ec.keyFromPrivate(et).getPublic();return savePublicKey(tt,it),0},publicKeyConvert(tt,et){const nt=loadPublicKey(et);if(nt===null)return 1;const it=nt.getPublic();return savePublicKey(tt,it),0},publicKeyNegate(tt,et){const nt=loadPublicKey(et);if(nt===null)return 1;const it=nt.getPublic();return it.y=it.y.redNeg(),savePublicKey(tt,it),0},publicKeyCombine(tt,et){const nt=new Array(et.length);for(let rt=0;rt=0)return 2;const rt=it.getPublic().add(ecparams.g.mul(nt));return rt.isInfinity()?2:(savePublicKey(tt,rt),0)},publicKeyTweakMul(tt,et,nt){const it=loadPublicKey(et);if(it===null)return 1;if(nt=new BN$1(nt),nt.cmp(ecparams.n)>=0||nt.isZero())return 2;const rt=it.getPublic().mul(nt);return savePublicKey(tt,rt),0},signatureNormalize(tt){const et=new BN$1(tt.subarray(0,32)),nt=new BN$1(tt.subarray(32,64));return et.cmp(ecparams.n)>=0||nt.cmp(ecparams.n)>=0?1:(nt.cmp(ec.nh)===1&&tt.set(ecparams.n.sub(nt).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(tt,et){const nt=et.subarray(0,32),it=et.subarray(32,64);if(new BN$1(nt).cmp(ecparams.n)>=0||new BN$1(it).cmp(ecparams.n)>=0)return 1;const{output:rt}=tt;let ot=rt.subarray(4,4+33);ot[0]=0,ot.set(nt,1);let at=33,st=0;for(;at>1&&ot[st]===0&&!(ot[st+1]&128);--at,++st);if(ot=ot.subarray(st),ot[0]&128||at>1&&ot[0]===0&&!(ot[1]&128))return 1;let lt=rt.subarray(6+33,6+33+33);lt[0]=0,lt.set(it,1);let ct=33,ut=0;for(;ct>1&<[ut]===0&&!(lt[ut+1]&128);--ct,++ut);return lt=lt.subarray(ut),lt[0]&128||ct>1&<[0]===0&&!(lt[1]&128)?1:(tt.outputlen=6+at+ct,rt[0]=48,rt[1]=tt.outputlen-2,rt[2]=2,rt[3]=ot.length,rt.set(ot,4),rt[4+at]=2,rt[5+at]=lt.length,rt.set(lt,6+at),0)},signatureImport(tt,et){if(et.length<8||et.length>72||et[0]!==48||et[1]!==et.length-2||et[2]!==2)return 1;const nt=et[3];if(nt===0||5+nt>=et.length||et[4+nt]!==2)return 1;const it=et[5+nt];if(it===0||6+nt+it!==et.length||et[4]&128||nt>1&&et[4]===0&&!(et[5]&128)||et[nt+6]&128||it>1&&et[nt+6]===0&&!(et[nt+7]&128))return 1;let rt=et.subarray(4,4+nt);if(rt.length===33&&rt[0]===0&&(rt=rt.subarray(1)),rt.length>32)return 1;let ot=et.subarray(6+nt);if(ot.length===33&&ot[0]===0&&(ot=ot.slice(1)),ot.length>32)throw new Error("S length is too long");let at=new BN$1(rt);at.cmp(ecparams.n)>=0&&(at=new BN$1(0));let st=new BN$1(et.subarray(6+nt));return st.cmp(ecparams.n)>=0&&(st=new BN$1(0)),tt.set(at.toArrayLike(Uint8Array,"be",32),0),tt.set(st.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(tt,et,nt,it,rt){if(rt){const st=rt;rt=lt=>{const ct=st(et,nt,null,it,lt);if(!(ct instanceof Uint8Array&&ct.length===32))throw new Error("This is the way");return new BN$1(ct)}}const ot=new BN$1(nt);if(ot.cmp(ecparams.n)>=0||ot.isZero())return 1;let at;try{at=ec.sign(et,nt,{canonical:!0,k:rt,pers:it})}catch{return 1}return tt.signature.set(at.r.toArrayLike(Uint8Array,"be",32),0),tt.signature.set(at.s.toArrayLike(Uint8Array,"be",32),32),tt.recid=at.recoveryParam,0},ecdsaVerify(tt,et,nt){const it={r:tt.subarray(0,32),s:tt.subarray(32,64)},rt=new BN$1(it.r),ot=new BN$1(it.s);if(rt.cmp(ecparams.n)>=0||ot.cmp(ecparams.n)>=0)return 1;if(ot.cmp(ec.nh)===1||rt.isZero()||ot.isZero())return 3;const at=loadPublicKey(nt);if(at===null)return 2;const st=at.getPublic();return ec.verify(et,it,st)?0:3},ecdsaRecover(tt,et,nt,it){const rt={r:et.slice(0,32),s:et.slice(32,64)},ot=new BN$1(rt.r),at=new BN$1(rt.s);if(ot.cmp(ecparams.n)>=0||at.cmp(ecparams.n)>=0)return 1;if(ot.isZero()||at.isZero())return 2;let st;try{st=ec.recoverPubKey(it,rt,nt)}catch{return 2}return savePublicKey(tt,st),0},ecdh(tt,et,nt,it,rt,ot,at){const st=loadPublicKey(et);if(st===null)return 1;const lt=new BN$1(nt);if(lt.cmp(ecparams.n)>=0||lt.isZero())return 2;const ct=st.getPublic().mul(lt);if(rt===void 0){const ut=ct.encode(null,!0),ht=ec.hash().update(ut).digest();for(let dt=0;dt<32;++dt)tt[dt]=ht[dt]}else{ot||(ot=new Uint8Array(32));const ut=ct.getX().toArray("be",32);for(let mt=0;mt<32;++mt)ot[mt]=ut[mt];at||(at=new Uint8Array(32));const ht=ct.getY().toArray("be",32);for(let mt=0;mt<32;++mt)at[mt]=ht[mt];const dt=rt(ot,at,it);if(!(dt instanceof Uint8Array&&dt.length===tt.length))return 2;tt.set(dt)}return 0}},elliptic=lib$2(elliptic$1),src$1={},address={},networks$1={};Object.defineProperty(networks$1,"__esModule",{value:!0});networks$1.testnet=networks$1.regtest=networks$1.bitcoin=void 0;networks$1.bitcoin={messagePrefix:`Bitcoin Signed Message: `,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128};networks$1.regtest={messagePrefix:`Bitcoin Signed Message: `,bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239};networks$1.testnet={messagePrefix:`Bitcoin Signed Message: -`,bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239};var payments$3={},embed={},script={},bip66$1={};Object.defineProperty(bip66$1,"__esModule",{value:!0});bip66$1.encode=bip66$1.decode=bip66$1.check=void 0;function check$d(tt){if(tt.length<8||tt.length>72||tt[0]!==48||tt[1]!==tt.length-2||tt[2]!==2)return!1;const et=tt[3];if(et===0||5+et>=tt.length||tt[4+et]!==2)return!1;const nt=tt[5+et];return!(nt===0||6+et+nt!==tt.length||tt[4]&128||et>1&&tt[4]===0&&!(tt[5]&128)||tt[et+6]&128||nt>1&&tt[et+6]===0&&!(tt[et+7]&128))}bip66$1.check=check$d;function decode$n(tt){if(tt.length<8)throw new Error("DER sequence length is too short");if(tt.length>72)throw new Error("DER sequence length is too long");if(tt[0]!==48)throw new Error("Expected DER sequence");if(tt[1]!==tt.length-2)throw new Error("DER sequence length is invalid");if(tt[2]!==2)throw new Error("Expected DER integer");const et=tt[3];if(et===0)throw new Error("R length is zero");if(5+et>=tt.length)throw new Error("R length is too long");if(tt[4+et]!==2)throw new Error("Expected DER integer (2)");const nt=tt[5+et];if(nt===0)throw new Error("S length is zero");if(6+et+nt!==tt.length)throw new Error("S length is invalid");if(tt[4]&128)throw new Error("R value is negative");if(et>1&&tt[4]===0&&!(tt[5]&128))throw new Error("R value excessively padded");if(tt[et+6]&128)throw new Error("S value is negative");if(nt>1&&tt[et+6]===0&&!(tt[et+7]&128))throw new Error("S value excessively padded");return{r:tt.slice(4,4+et),s:tt.slice(6+et)}}bip66$1.decode=decode$n;function encode$n(tt,et){const nt=tt.length,it=et.length;if(nt===0)throw new Error("R length is zero");if(it===0)throw new Error("S length is zero");if(nt>33)throw new Error("R length is too long");if(it>33)throw new Error("S length is too long");if(tt[0]&128)throw new Error("R value is negative");if(et[0]&128)throw new Error("S value is negative");if(nt>1&&tt[0]===0&&!(tt[1]&128))throw new Error("R value excessively padded");if(it>1&&et[0]===0&&!(et[1]&128))throw new Error("S value excessively padded");const rt=Buffer.allocUnsafe(6+nt+it);return rt[0]=48,rt[1]=rt.length-2,rt[2]=2,rt[3]=tt.length,tt.copy(rt,4),rt[4+nt]=2,rt[5+nt]=et.length,et.copy(rt,6+nt),rt}bip66$1.encode=encode$n;var ops={};Object.defineProperty(ops,"__esModule",{value:!0});ops.REVERSE_OPS=ops.OPS=void 0;const OPS$8={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKSIGADD:186,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};ops.OPS=OPS$8;const REVERSE_OPS={};ops.REVERSE_OPS=REVERSE_OPS;for(const tt of Object.keys(OPS$8)){const et=OPS$8[tt];REVERSE_OPS[et]=tt}var push_data={};Object.defineProperty(push_data,"__esModule",{value:!0});push_data.decode=push_data.encode=push_data.encodingLength=void 0;const ops_1=ops;function encodingLength$2(tt){return tttt.length)return null;it=tt.readUInt8(et+1),rt=2}else if(nt===ops_1.OPS.OP_PUSHDATA2){if(et+3>tt.length)return null;it=tt.readUInt16LE(et+1),rt=3}else{if(et+5>tt.length)return null;if(nt!==ops_1.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");it=tt.readUInt32LE(et+1),rt=5}return{opcode:nt,number:it,size:rt}}push_data.decode=decode$m;var script_number={};Object.defineProperty(script_number,"__esModule",{value:!0});script_number.encode=script_number.decode=void 0;function decode$l(tt,et,nt){et=et||4,nt=nt===void 0?!0:nt;const it=tt.length;if(it===0)return 0;if(it>et)throw new TypeError("Script number overflow");if(nt&&!(tt[it-1]&127)&&(it<=1||!(tt[it-2]&128)))throw new Error("Non-minimally encoded script number");if(it===5){const ot=tt.readUInt32LE(0),at=tt.readUInt8(4);return at&128?-((at&-129)*4294967296+ot):at*4294967296+ot}let rt=0;for(let ot=0;ot2147483647?5:tt>8388607?4:tt>32767?3:tt>127?2:tt>0?1:0}function encode$l(tt){let et=Math.abs(tt);const nt=scriptNumSize(et),it=Buffer.allocUnsafe(nt),rt=tt<0;for(let ot=0;ot>=8;return it[nt-1]&128?it.writeUInt8(rt?128:0,nt-1):rt&&(it[nt-1]|=128),it}script_number.encode=encode$l;var script_signature={},types$7={},types$6={Array:function(tt){return tt!=null&&tt.constructor===Array},Boolean:function(tt){return typeof tt=="boolean"},Function:function(tt){return typeof tt=="function"},Nil:function(tt){return tt==null},Number:function(tt){return typeof tt=="number"},Object:function(tt){return typeof tt=="object"},String:function(tt){return typeof tt=="string"},"":function(){return!0}};types$6.Null=types$6.Nil;for(var typeName$1 in types$6)types$6[typeName$1].toJSON=(function(tt){return tt}).bind(null,typeName$1);var native$1=types$6,native=native$1;function getTypeName(tt){return tt.name||tt.toString().match(/function (.*?)\s*\(/)[1]}function getValueTypeName$1(tt){return native.Nil(tt)?"":getTypeName(tt.constructor)}function getValue$3(tt){return native.Function(tt)?"":native.String(tt)?JSON.stringify(tt):tt&&native.Object(tt)?"":tt}function captureStackTrace(tt,et){Error.captureStackTrace&&Error.captureStackTrace(tt,et)}function tfJSON$1(tt){return native.Function(tt)?tt.toJSON?tt.toJSON():getTypeName(tt):native.Array(tt)?"Array":tt&&native.Object(tt)?"Object":tt!==void 0?tt:""}function tfErrorString(tt,et,nt){var it=getValue$3(et);return"Expected "+tfJSON$1(tt)+", got"+(nt!==""?" "+nt:"")+(it!==""?" "+it:"")}function TfTypeError$1(tt,et,nt){nt=nt||getValueTypeName$1(et),this.message=tfErrorString(tt,et,nt),captureStackTrace(this,TfTypeError$1),this.__type=tt,this.__value=et,this.__valueTypeName=nt}TfTypeError$1.prototype=Object.create(Error.prototype);TfTypeError$1.prototype.constructor=TfTypeError$1;function tfPropertyErrorString(tt,et,nt,it,rt){var ot='" of type ';return et==="key"&&(ot='" with key type '),tfErrorString('property "'+tfJSON$1(nt)+ot+tfJSON$1(tt),it,rt)}function TfPropertyTypeError$1(tt,et,nt,it,rt){tt?(rt=rt||getValueTypeName$1(it),this.message=tfPropertyErrorString(tt,nt,et,it,rt)):this.message='Unexpected property "'+et+'"',captureStackTrace(this,TfTypeError$1),this.__label=nt,this.__property=et,this.__type=tt,this.__value=it,this.__valueTypeName=rt}TfPropertyTypeError$1.prototype=Object.create(Error.prototype);TfPropertyTypeError$1.prototype.constructor=TfTypeError$1;function tfCustomError(tt,et){return new TfTypeError$1(tt,{},et)}function tfSubError$1(tt,et,nt){return tt instanceof TfPropertyTypeError$1?(et=et+"."+tt.__property,tt=new TfPropertyTypeError$1(tt.__type,et,tt.__label,tt.__value,tt.__valueTypeName)):tt instanceof TfTypeError$1&&(tt=new TfPropertyTypeError$1(tt.__type,et,nt,tt.__value,tt.__valueTypeName)),captureStackTrace(tt),tt}var errors$1={TfTypeError:TfTypeError$1,TfPropertyTypeError:TfPropertyTypeError$1,tfCustomError,tfSubError:tfSubError$1,tfJSON:tfJSON$1,getValueTypeName:getValueTypeName$1},extra,hasRequiredExtra;function requireExtra(){if(hasRequiredExtra)return extra;hasRequiredExtra=1;var tt=native$1,et=errors$1;function nt(Et){return Buffer.isBuffer(Et)}function it(Et){return typeof Et=="string"&&/^([0-9a-f]{2})+$/i.test(Et)}function rt(Et,It){var Tt=Et.toJSON();function $t(Ut){if(!Et(Ut))return!1;if(Ut.length===It)return!0;throw et.tfCustomError(Tt+"(Length: "+It+")",Tt+"(Length: "+Ut.length+")")}return $t.toJSON=function(){return Tt},$t}var ot=rt.bind(null,tt.Array),at=rt.bind(null,nt),st=rt.bind(null,it),lt=rt.bind(null,tt.String);function ct(Et,It,Tt){Tt=Tt||tt.Number;function $t(Ut,Lt){return Tt(Ut,Lt)&&Ut>Et&&Ut>24===Et}function pt(Et){return Et<<16>>16===Et}function mt(Et){return(Et|0)===Et}function gt(Et){return typeof Et=="number"&&Et>=-ut&&Et<=ut&&Math.floor(Et)===Et}function bt(Et){return(Et&255)===Et}function yt(Et){return(Et&65535)===Et}function wt(Et){return Et>>>0===Et}function vt(Et){return typeof Et=="number"&&Et>=0&&Et<=ut&&Math.floor(Et)===Et}var xt={ArrayN:ot,Buffer:nt,BufferN:at,Finite:ht,Hex:it,HexN:st,Int8:dt,Int16:pt,Int32:mt,Int53:gt,Range:ct,StringN:lt,UInt8:bt,UInt16:yt,UInt32:wt,UInt53:vt};for(var St in xt)xt[St].toJSON=(function(Et){return Et}).bind(null,St);return extra=xt,extra}var ERRORS=errors$1,NATIVE=native$1,tfJSON=ERRORS.tfJSON,TfTypeError=ERRORS.TfTypeError,TfPropertyTypeError=ERRORS.TfPropertyTypeError,tfSubError=ERRORS.tfSubError,getValueTypeName=ERRORS.getValueTypeName,TYPES={arrayOf:function(et,nt){et=compile$1(et),nt=nt||{};function it(rt,ot){return!NATIVE.Array(rt)||NATIVE.Nil(rt)||nt.minLength!==void 0&&rt.lengthnt.maxLength||nt.length!==void 0&&rt.length!==nt.length?!1:rt.every(function(at,st){try{return typeforce$4(et,at,ot)}catch(lt){throw tfSubError(lt,st)}})}return it.toJSON=function(){var rt="["+tfJSON(et)+"]";return nt.length!==void 0?rt+="{"+nt.length+"}":(nt.minLength!==void 0||nt.maxLength!==void 0)&&(rt+="{"+(nt.minLength===void 0?0:nt.minLength)+","+(nt.maxLength===void 0?1/0:nt.maxLength)+"}"),rt},it},maybe:function tt(et){et=compile$1(et);function nt(it,rt){return NATIVE.Nil(it)||et(it,rt,tt)}return nt.toJSON=function(){return"?"+tfJSON(et)},nt},map:function(et,nt){et=compile$1(et),nt&&(nt=compile$1(nt));function it(rt,ot){if(!NATIVE.Object(rt)||NATIVE.Nil(rt))return!1;for(var at in rt){try{nt&&typeforce$4(nt,at,ot)}catch(lt){throw tfSubError(lt,at,"key")}try{var st=rt[at];typeforce$4(et,st,ot)}catch(lt){throw tfSubError(lt,at)}}return!0}return nt?it.toJSON=function(){return"{"+tfJSON(nt)+": "+tfJSON(et)+"}"}:it.toJSON=function(){return"{"+tfJSON(et)+"}"},it},object:function(et){var nt={};for(var it in et)nt[it]=compile$1(et[it]);function rt(ot,at){if(!NATIVE.Object(ot)||NATIVE.Nil(ot))return!1;var st;try{for(st in nt){var lt=nt[st],ct=ot[st];typeforce$4(lt,ct,at)}}catch(ut){throw tfSubError(ut,st)}if(at){for(st in ot)if(!nt[st])throw new TfPropertyTypeError(void 0,st)}return!0}return rt.toJSON=function(){return tfJSON(nt)},rt},anyOf:function(){var et=[].slice.call(arguments).map(compile$1);function nt(it,rt){return et.some(function(ot){try{return typeforce$4(ot,it,rt)}catch{return!1}})}return nt.toJSON=function(){return et.map(tfJSON).join("|")},nt},allOf:function(){var et=[].slice.call(arguments).map(compile$1);function nt(it,rt){return et.every(function(ot){try{return typeforce$4(ot,it,rt)}catch{return!1}})}return nt.toJSON=function(){return et.map(tfJSON).join(" & ")},nt},quacksLike:function(et){function nt(it){return et===getValueTypeName(it)}return nt.toJSON=function(){return et},nt},tuple:function(){var et=[].slice.call(arguments).map(compile$1);function nt(it,rt){return NATIVE.Nil(it)||NATIVE.Nil(it.length)||rt&&it.length!==et.length?!1:et.every(function(ot,at){try{return typeforce$4(ot,it[at],rt)}catch(st){throw tfSubError(st,at)}})}return nt.toJSON=function(){return"("+et.map(tfJSON).join(", ")+")"},nt},value:function(et){function nt(it){return it===et}return nt.toJSON=function(){return et},nt}};TYPES.oneOf=TYPES.anyOf;function compile$1(tt){if(NATIVE.String(tt))return tt[0]==="?"?TYPES.maybe(tt.slice(1)):NATIVE[tt]||TYPES.quacksLike(tt);if(tt&&NATIVE.Object(tt)){if(NATIVE.Array(tt)){if(tt.length!==1)throw new TypeError("Expected compile() parameter of type Array of length 1");return TYPES.arrayOf(tt[0])}return TYPES.object(tt)}else if(NATIVE.Function(tt))return tt;return TYPES.value(tt)}function typeforce$4(tt,et,nt,it){if(NATIVE.Function(tt)){if(tt(et,nt))return!0;throw new TfTypeError(it||tt,et)}return typeforce$4(compile$1(tt),et,nt)}for(var typeName in NATIVE)typeforce$4[typeName]=NATIVE[typeName];for(typeName in TYPES)typeforce$4[typeName]=TYPES[typeName];var EXTRA=requireExtra();for(typeName in EXTRA)typeforce$4[typeName]=EXTRA[typeName];typeforce$4.compile=compile$1;typeforce$4.TfTypeError=TfTypeError;typeforce$4.TfPropertyTypeError=TfPropertyTypeError;var typeforce_1=typeforce$4;(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.oneOf=tt.Null=tt.BufferN=tt.Function=tt.UInt32=tt.UInt8=tt.tuple=tt.maybe=tt.Hex=tt.Buffer=tt.String=tt.Boolean=tt.Array=tt.Number=tt.Hash256bit=tt.Hash160bit=tt.Buffer256bit=tt.isTaptree=tt.isTapleaf=tt.TAPLEAF_VERSION_MASK=tt.Network=tt.ECPoint=tt.Satoshi=tt.Signer=tt.BIP32Path=tt.UInt31=tt.isPoint=tt.typeforce=void 0;const et=buffer$2;tt.typeforce=typeforce_1;const nt=et.Buffer.alloc(32,0),it=et.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");function rt(pt){if(!et.Buffer.isBuffer(pt)||pt.length<33)return!1;const mt=pt[0],gt=pt.slice(1,33);if(gt.compare(nt)===0||gt.compare(it)>=0)return!1;if((mt===2||mt===3)&&pt.length===33)return!0;const bt=pt.slice(33);return bt.compare(nt)===0||bt.compare(it)>=0?!1:mt===4&&pt.length===65}tt.isPoint=rt;const ot=Math.pow(2,31)-1;function at(pt){return tt.typeforce.UInt32(pt)&&pt<=ot}tt.UInt31=at;function st(pt){return tt.typeforce.String(pt)&&!!pt.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}tt.BIP32Path=st,st.toJSON=()=>"BIP32 derivation path";function lt(pt){return(tt.typeforce.Buffer(pt.publicKey)||typeof pt.getPublicKey=="function")&&typeof pt.sign=="function"}tt.Signer=lt;const ct=21*1e14;function ut(pt){return tt.typeforce.UInt53(pt)&&pt<=ct}tt.Satoshi=ut,tt.ECPoint=tt.typeforce.quacksLike("Point"),tt.Network=tt.typeforce.compile({messagePrefix:tt.typeforce.oneOf(tt.typeforce.Buffer,tt.typeforce.String),bip32:{public:tt.typeforce.UInt32,private:tt.typeforce.UInt32},pubKeyHash:tt.typeforce.UInt8,scriptHash:tt.typeforce.UInt8,wif:tt.typeforce.UInt8}),tt.TAPLEAF_VERSION_MASK=254;function ht(pt){return!pt||!("output"in pt)||!et.Buffer.isBuffer(pt.output)?!1:pt.version!==void 0?(pt.version&tt.TAPLEAF_VERSION_MASK)===pt.version:!0}tt.isTapleaf=ht;function dt(pt){return(0,tt.Array)(pt)?pt.length!==2?!1:pt.every(mt=>dt(mt)):ht(pt)}tt.isTaptree=dt,tt.Buffer256bit=tt.typeforce.BufferN(32),tt.Hash160bit=tt.typeforce.BufferN(20),tt.Hash256bit=tt.typeforce.BufferN(32),tt.Number=tt.typeforce.Number,tt.Array=tt.typeforce.Array,tt.Boolean=tt.typeforce.Boolean,tt.String=tt.typeforce.String,tt.Buffer=tt.typeforce.Buffer,tt.Hex=tt.typeforce.Hex,tt.maybe=tt.typeforce.maybe,tt.tuple=tt.typeforce.tuple,tt.UInt8=tt.typeforce.UInt8,tt.UInt32=tt.typeforce.UInt32,tt.Function=tt.typeforce.Function,tt.BufferN=tt.typeforce.BufferN,tt.Null=tt.typeforce.Null,tt.oneOf=tt.typeforce.oneOf})(types$7);Object.defineProperty(script_signature,"__esModule",{value:!0});script_signature.encode=script_signature.decode=void 0;const bip66=bip66$1,types$5=types$7,{typeforce:typeforce$3}=types$5,ZERO$1=Buffer.alloc(1,0);function toDER(tt){let et=0;for(;tt[et]===0;)++et;return et===tt.length?ZERO$1:(tt=tt.slice(et),tt[0]&128?Buffer.concat([ZERO$1,tt],1+tt.length):tt)}function fromDER(tt){tt[0]===0&&(tt=tt.slice(1));const et=Buffer.alloc(32,0),nt=Math.max(0,32-tt.length);return tt.copy(et,nt),et}function decode$k(tt){const et=tt.readUInt8(tt.length-1),nt=et&-129;if(nt<=0||nt>=4)throw new Error("Invalid hashType "+et);const it=bip66.decode(tt.slice(0,-1)),rt=fromDER(it.r),ot=fromDER(it.s);return{signature:Buffer.concat([rt,ot],64),hashType:et}}script_signature.decode=decode$k;function encode$k(tt,et){typeforce$3({signature:types$5.BufferN(64),hashType:types$5.UInt8},{signature:tt,hashType:et});const nt=et&-129;if(nt<=0||nt>=4)throw new Error("Invalid hashType "+et);const it=Buffer.allocUnsafe(1);it.writeUInt8(et,0);const rt=toDER(tt.slice(0,32)),ot=toDER(tt.slice(32,64));return Buffer.concat([bip66.encode(rt,ot),it])}script_signature.encode=encode$k;(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.signature=tt.number=tt.isCanonicalScriptSignature=tt.isDefinedHashType=tt.isCanonicalPubKey=tt.toStack=tt.fromASM=tt.toASM=tt.decompile=tt.compile=tt.countNonPushOnlyOPs=tt.isPushOnly=tt.OPS=void 0;const et=bip66$1,nt=ops;Object.defineProperty(tt,"OPS",{enumerable:!0,get:function(){return nt.OPS}});const it=push_data,rt=script_number,ot=script_signature,at=types$7,{typeforce:st}=at,lt=nt.OPS.OP_RESERVED;function ct($t){return at.Number($t)&&($t===nt.OPS.OP_0||$t>=nt.OPS.OP_1&&$t<=nt.OPS.OP_16||$t===nt.OPS.OP_1NEGATE)}function ut($t){return at.Buffer($t)||ct($t)}function ht($t){return at.Array($t)&&$t.every(ut)}tt.isPushOnly=ht;function dt($t){return $t.length-$t.filter(ut).length}tt.countNonPushOnlyOPs=dt;function pt($t){if($t.length===0)return nt.OPS.OP_0;if($t.length===1){if($t[0]>=1&&$t[0]<=16)return lt+$t[0];if($t[0]===129)return nt.OPS.OP_1NEGATE}}function mt($t){return Buffer.isBuffer($t)}function gt($t){return at.Array($t)}function bt($t){return Buffer.isBuffer($t)}function yt($t){if(mt($t))return $t;st(at.Array,$t);const Ut=$t.reduce((Pt,kt)=>bt(kt)?kt.length===1&&pt(kt)!==void 0?Pt+1:Pt+it.encodingLength(kt.length)+kt.length:Pt+1,0),Lt=Buffer.allocUnsafe(Ut);let Bt=0;if($t.forEach(Pt=>{if(bt(Pt)){const kt=pt(Pt);if(kt!==void 0){Lt.writeUInt8(kt,Bt),Bt+=1;return}Bt+=it.encode(Lt,Pt.length,Bt),Pt.copy(Lt,Bt),Bt+=Pt.length}else Lt.writeUInt8(Pt,Bt),Bt+=1}),Bt!==Lt.length)throw new Error("Could not decode chunks");return Lt}tt.compile=yt;function wt($t){if(gt($t))return $t;st(at.Buffer,$t);const Ut=[];let Lt=0;for(;Lt<$t.length;){const Bt=$t[Lt];if(Bt>nt.OPS.OP_0&&Bt<=nt.OPS.OP_PUSHDATA4){const Pt=it.decode($t,Lt);if(Pt===null||(Lt+=Pt.size,Lt+Pt.number>$t.length))return null;const kt=$t.slice(Lt,Lt+Pt.number);Lt+=Pt.number;const At=pt(kt);At!==void 0?Ut.push(At):Ut.push(kt)}else Ut.push(Bt),Lt+=1}return Ut}tt.decompile=wt;function vt($t){return mt($t)&&($t=wt($t)),$t.map(Ut=>{if(bt(Ut)){const Lt=pt(Ut);if(Lt===void 0)return Ut.toString("hex");Ut=Lt}return nt.REVERSE_OPS[Ut]}).join(" ")}tt.toASM=vt;function xt($t){return st(at.String,$t),yt($t.split(" ").map(Ut=>nt.OPS[Ut]!==void 0?nt.OPS[Ut]:(st(at.Hex,Ut),Buffer.from(Ut,"hex"))))}tt.fromASM=xt;function St($t){return $t=wt($t),st(ht,$t),$t.map(Ut=>bt(Ut)?Ut:Ut===nt.OPS.OP_0?Buffer.allocUnsafe(0):rt.encode(Ut-lt))}tt.toStack=St;function Et($t){return at.isPoint($t)}tt.isCanonicalPubKey=Et;function It($t){const Ut=$t&-129;return Ut>0&&Ut<4}tt.isDefinedHashType=It;function Tt($t){return!Buffer.isBuffer($t)||!It($t[$t.length-1])?!1:et.check($t.slice(0,-1))}tt.isCanonicalScriptSignature=Tt,tt.number=rt,tt.signature=ot})(script);var lazy$9={};Object.defineProperty(lazy$9,"__esModule",{value:!0});lazy$9.value=lazy$9.prop=void 0;function prop(tt,et,nt){Object.defineProperty(tt,et,{configurable:!0,enumerable:!0,get(){const it=nt.call(this);return this[et]=it,it},set(it){Object.defineProperty(this,et,{configurable:!0,enumerable:!0,value:it,writable:!0})}})}lazy$9.prop=prop;function value$1(tt){let et;return()=>(et!==void 0||(et=tt()),et)}lazy$9.value=value$1;Object.defineProperty(embed,"__esModule",{value:!0});embed.p2data=void 0;const networks_1$8=networks$1,bscript$b=script,types_1$9=types$7,lazy$8=lazy$9,OPS$7=bscript$b.OPS;function stacksEqual$4(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}function p2data(tt,et){if(!tt.data&&!tt.output)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$9.typeforce)({network:types_1$9.typeforce.maybe(types_1$9.typeforce.Object),output:types_1$9.typeforce.maybe(types_1$9.typeforce.Buffer),data:types_1$9.typeforce.maybe(types_1$9.typeforce.arrayOf(types_1$9.typeforce.Buffer))},tt);const it={name:"embed",network:tt.network||networks_1$8.bitcoin};if(lazy$8.prop(it,"output",()=>{if(tt.data)return bscript$b.compile([OPS$7.OP_RETURN].concat(tt.data))}),lazy$8.prop(it,"data",()=>{if(tt.output)return bscript$b.decompile(tt.output).slice(1)}),et.validate&&tt.output){const rt=bscript$b.decompile(tt.output);if(rt[0]!==OPS$7.OP_RETURN)throw new TypeError("Output is invalid");if(!rt.slice(1).every(types_1$9.typeforce.Buffer))throw new TypeError("Output is invalid");if(tt.data&&!stacksEqual$4(tt.data,it.data))throw new TypeError("Data mismatch")}return Object.assign(it,tt)}embed.p2data=p2data;var p2ms$1={};Object.defineProperty(p2ms$1,"__esModule",{value:!0});p2ms$1.p2ms=void 0;const networks_1$7=networks$1,bscript$a=script,types_1$8=types$7,lazy$7=lazy$9,OPS$6=bscript$a.OPS,OP_INT_BASE=OPS$6.OP_RESERVED;function stacksEqual$3(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}function p2ms(tt,et){if(!tt.input&&!tt.output&&!(tt.pubkeys&&tt.m!==void 0)&&!tt.signatures)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{});function nt(lt){return bscript$a.isCanonicalScriptSignature(lt)||(et.allowIncomplete&<===OPS$6.OP_0)!==void 0}(0,types_1$8.typeforce)({network:types_1$8.typeforce.maybe(types_1$8.typeforce.Object),m:types_1$8.typeforce.maybe(types_1$8.typeforce.Number),n:types_1$8.typeforce.maybe(types_1$8.typeforce.Number),output:types_1$8.typeforce.maybe(types_1$8.typeforce.Buffer),pubkeys:types_1$8.typeforce.maybe(types_1$8.typeforce.arrayOf(types_1$8.isPoint)),signatures:types_1$8.typeforce.maybe(types_1$8.typeforce.arrayOf(nt)),input:types_1$8.typeforce.maybe(types_1$8.typeforce.Buffer)},tt);const rt={network:tt.network||networks_1$7.bitcoin};let ot=[],at=!1;function st(lt){at||(at=!0,ot=bscript$a.decompile(lt),rt.m=ot[0]-OP_INT_BASE,rt.n=ot[ot.length-2]-OP_INT_BASE,rt.pubkeys=ot.slice(1,-2))}if(lazy$7.prop(rt,"output",()=>{if(tt.m&&rt.n&&tt.pubkeys)return bscript$a.compile([].concat(OP_INT_BASE+tt.m,tt.pubkeys,OP_INT_BASE+rt.n,OPS$6.OP_CHECKMULTISIG))}),lazy$7.prop(rt,"m",()=>{if(rt.output)return st(rt.output),rt.m}),lazy$7.prop(rt,"n",()=>{if(rt.pubkeys)return rt.pubkeys.length}),lazy$7.prop(rt,"pubkeys",()=>{if(tt.output)return st(tt.output),rt.pubkeys}),lazy$7.prop(rt,"signatures",()=>{if(tt.input)return bscript$a.decompile(tt.input).slice(1)}),lazy$7.prop(rt,"input",()=>{if(tt.signatures)return bscript$a.compile([OPS$6.OP_0].concat(tt.signatures))}),lazy$7.prop(rt,"witness",()=>{if(rt.input)return[]}),lazy$7.prop(rt,"name",()=>{if(!(!rt.m||!rt.n))return`p2ms(${rt.m} of ${rt.n})`}),et.validate){if(tt.output){if(st(tt.output),!types_1$8.typeforce.Number(ot[0]))throw new TypeError("Output is invalid");if(!types_1$8.typeforce.Number(ot[ot.length-2]))throw new TypeError("Output is invalid");if(ot[ot.length-1]!==OPS$6.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(rt.m<=0||rt.n>16||rt.m>rt.n||rt.n!==ot.length-3)throw new TypeError("Output is invalid");if(!rt.pubkeys.every(lt=>(0,types_1$8.isPoint)(lt)))throw new TypeError("Output is invalid");if(tt.m!==void 0&&tt.m!==rt.m)throw new TypeError("m mismatch");if(tt.n!==void 0&&tt.n!==rt.n)throw new TypeError("n mismatch");if(tt.pubkeys&&!stacksEqual$3(tt.pubkeys,rt.pubkeys))throw new TypeError("Pubkeys mismatch")}if(tt.pubkeys){if(tt.n!==void 0&&tt.n!==tt.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(rt.n=tt.pubkeys.length,rt.nrt.m)throw new TypeError("Too many signatures provided")}if(tt.input){if(tt.input[0]!==OPS$6.OP_0)throw new TypeError("Input is invalid");if(rt.signatures.length===0||!rt.signatures.every(nt))throw new TypeError("Input has invalid signature(s)");if(tt.signatures&&!stacksEqual$3(tt.signatures,rt.signatures))throw new TypeError("Signature mismatch");if(tt.m!==void 0&&tt.m!==tt.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(rt,tt)}p2ms$1.p2ms=p2ms;var p2pk$1={};Object.defineProperty(p2pk$1,"__esModule",{value:!0});p2pk$1.p2pk=void 0;const networks_1$6=networks$1,bscript$9=script,types_1$7=types$7,lazy$6=lazy$9,OPS$5=bscript$9.OPS;function p2pk(tt,et){if(!tt.input&&!tt.output&&!tt.pubkey&&!tt.input&&!tt.signature)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$7.typeforce)({network:types_1$7.typeforce.maybe(types_1$7.typeforce.Object),output:types_1$7.typeforce.maybe(types_1$7.typeforce.Buffer),pubkey:types_1$7.typeforce.maybe(types_1$7.isPoint),signature:types_1$7.typeforce.maybe(bscript$9.isCanonicalScriptSignature),input:types_1$7.typeforce.maybe(types_1$7.typeforce.Buffer)},tt);const nt=lazy$6.value(()=>bscript$9.decompile(tt.input)),rt={name:"p2pk",network:tt.network||networks_1$6.bitcoin};if(lazy$6.prop(rt,"output",()=>{if(tt.pubkey)return bscript$9.compile([tt.pubkey,OPS$5.OP_CHECKSIG])}),lazy$6.prop(rt,"pubkey",()=>{if(tt.output)return tt.output.slice(1,-1)}),lazy$6.prop(rt,"signature",()=>{if(tt.input)return nt()[0]}),lazy$6.prop(rt,"input",()=>{if(tt.signature)return bscript$9.compile([tt.signature])}),lazy$6.prop(rt,"witness",()=>{if(rt.input)return[]}),et.validate){if(tt.output){if(tt.output[tt.output.length-1]!==OPS$5.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,types_1$7.isPoint)(rt.pubkey))throw new TypeError("Output pubkey is invalid");if(tt.pubkey&&!tt.pubkey.equals(rt.pubkey))throw new TypeError("Pubkey mismatch")}if(tt.signature&&tt.input&&!tt.input.equals(rt.input))throw new TypeError("Signature mismatch");if(tt.input){if(nt().length!==1)throw new TypeError("Input is invalid");if(!bscript$9.isCanonicalScriptSignature(rt.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(rt,tt)}p2pk$1.p2pk=p2pk;var p2pkh$1={},crypto$2={},ripemd160={},_sha2={},_assert={};Object.defineProperty(_assert,"__esModule",{value:!0});_assert.output=_assert.exists=_assert.hash=_assert.bytes=_assert.bool=_assert.number=void 0;function number$5(tt){if(!Number.isSafeInteger(tt)||tt<0)throw new Error(`Wrong positive integer: ${tt}`)}_assert.number=number$5;function bool$1(tt){if(typeof tt!="boolean")throw new Error(`Expected boolean, not ${tt}`)}_assert.bool=bool$1;function bytes(tt,...et){if(!(tt instanceof Uint8Array))throw new Error("Expected Uint8Array");if(et.length>0&&!et.includes(tt.length))throw new Error(`Expected Uint8Array of length ${et}, not of length=${tt.length}`)}_assert.bytes=bytes;function hash$3(tt){if(typeof tt!="function"||typeof tt.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$5(tt.outputLen),number$5(tt.blockLen)}_assert.hash=hash$3;function exists(tt,et=!0){if(tt.destroyed)throw new Error("Hash instance has been destroyed");if(et&&tt.finished)throw new Error("Hash#digest() has already been called")}_assert.exists=exists;function output(tt,et){bytes(tt);const nt=et.outputLen;if(tt.lengthEt instanceof Uint8Array,it=Et=>new Uint8Array(Et.buffer,Et.byteOffset,Et.byteLength);tt.u8=it;const rt=Et=>new Uint32Array(Et.buffer,Et.byteOffset,Math.floor(Et.byteLength/4));tt.u32=rt;const ot=Et=>new DataView(Et.buffer,Et.byteOffset,Et.byteLength);tt.createView=ot;const at=(Et,It)=>Et<<32-It|Et>>>It;if(tt.rotr=at,tt.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!tt.isLE)throw new Error("Non little-endian hardware is not supported");const st=Array.from({length:256},(Et,It)=>It.toString(16).padStart(2,"0"));function lt(Et){if(!nt(Et))throw new Error("Uint8Array expected");let It="";for(let Tt=0;Tt{};tt.nextTick=ut;async function ht(Et,It,Tt){let $t=Date.now();for(let Ut=0;Ut=0&&Lt$t+Ut.length,0));let Tt=0;return Et.forEach($t=>{if(!nt($t))throw new Error("Uint8Array expected");It.set($t,Tt),Tt+=$t.length}),It}tt.concatBytes=mt;class gt{clone(){return this._cloneInto()}}tt.Hash=gt;const bt={}.toString;function yt(Et,It){if(It!==void 0&&bt.call(It)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(Et,It)}tt.checkOpts=yt;function wt(Et){const It=$t=>Et().update(pt($t)).digest(),Tt=Et();return It.outputLen=Tt.outputLen,It.blockLen=Tt.blockLen,It.create=()=>Et(),It}tt.wrapConstructor=wt;function vt(Et){const It=($t,Ut)=>Et(Ut).update(pt($t)).digest(),Tt=Et({});return It.outputLen=Tt.outputLen,It.blockLen=Tt.blockLen,It.create=$t=>Et($t),It}tt.wrapConstructorWithOpts=vt;function xt(Et){const It=($t,Ut)=>Et(Ut).update(pt($t)).digest(),Tt=Et({});return It.outputLen=Tt.outputLen,It.blockLen=Tt.blockLen,It.create=$t=>Et($t),It}tt.wrapXOFConstructorWithOpts=xt;function St(Et=32){if(et.crypto&&typeof et.crypto.getRandomValues=="function")return et.crypto.getRandomValues(new Uint8Array(Et));throw new Error("crypto.getRandomValues must be defined")}tt.randomBytes=St})(utils$2);Object.defineProperty(_sha2,"__esModule",{value:!0});_sha2.SHA2=void 0;const _assert_js_1=_assert,utils_js_1$3=utils$2;function setBigUint64(tt,et,nt,it){if(typeof tt.setBigUint64=="function")return tt.setBigUint64(et,nt,it);const rt=BigInt(32),ot=BigInt(4294967295),at=Number(nt>>rt&ot),st=Number(nt&ot),lt=it?4:0,ct=it?0:4;tt.setUint32(et+lt,at,it),tt.setUint32(et+ct,st,it)}class SHA2 extends utils_js_1$3.Hash{constructor(et,nt,it,rt){super(),this.blockLen=et,this.outputLen=nt,this.padOffset=it,this.isLE=rt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(et),this.view=(0,utils_js_1$3.createView)(this.buffer)}update(et){(0,_assert_js_1.exists)(this);const{view:nt,buffer:it,blockLen:rt}=this;et=(0,utils_js_1$3.toBytes)(et);const ot=et.length;for(let at=0;atrt-at&&(this.process(it,0),at=0);for(let ht=at;htut.length)throw new Error("_sha2: outputLen bigger than state");for(let ht=0;htet),Pi=Id.map(tt=>(9*tt+5)%16);let idxL=[Id],idxR=[Pi];for(let tt=0;tt<4;tt++)for(let et of[idxL,idxR])et.push(et[tt].map(nt=>Rho[nt]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(tt=>new Uint8Array(tt)),shiftsL=idxL.map((tt,et)=>tt.map(nt=>shifts[et][nt])),shiftsR=idxR.map((tt,et)=>tt.map(nt=>shifts[et][nt])),Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),rotl$1=(tt,et)=>tt<>>32-et;function f$2(tt,et,nt,it){return tt===0?et^nt^it:tt===1?et&nt|~et&it:tt===2?(et|~nt)^it:tt===3?et&it|nt&~it:et^(nt|~it)}const BUF=new Uint32Array(16);class RIPEMD160 extends _sha2_js_1$2.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:et,h1:nt,h2:it,h3:rt,h4:ot}=this;return[et,nt,it,rt,ot]}set(et,nt,it,rt,ot){this.h0=et|0,this.h1=nt|0,this.h2=it|0,this.h3=rt|0,this.h4=ot|0}process(et,nt){for(let pt=0;pt<16;pt++,nt+=4)BUF[pt]=et.getUint32(nt,!0);let it=this.h0|0,rt=it,ot=this.h1|0,at=ot,st=this.h2|0,lt=st,ct=this.h3|0,ut=ct,ht=this.h4|0,dt=ht;for(let pt=0;pt<5;pt++){const mt=4-pt,gt=Kl[pt],bt=Kr[pt],yt=idxL[pt],wt=idxR[pt],vt=shiftsL[pt],xt=shiftsR[pt];for(let St=0;St<16;St++){const Et=rotl$1(it+f$2(pt,ot,st,ct)+BUF[yt[St]]+gt,vt[St])+ht|0;it=ht,ht=ct,ct=rotl$1(st,10)|0,st=ot,ot=Et}for(let St=0;St<16;St++){const Et=rotl$1(rt+f$2(mt,at,lt,ut)+BUF[wt[St]]+bt,xt[St])+dt|0;rt=dt,dt=ut,ut=rotl$1(lt,10)|0,lt=at,at=Et}}this.set(this.h1+st+ut|0,this.h2+ct+dt|0,this.h3+ht+rt|0,this.h4+it+at|0,this.h0+ot+lt|0)}roundClean(){BUF.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}ripemd160.RIPEMD160=RIPEMD160;ripemd160.ripemd160=(0,utils_js_1$2.wrapConstructor)(()=>new RIPEMD160);var sha1={};Object.defineProperty(sha1,"__esModule",{value:!0});sha1.sha1=void 0;const _sha2_js_1$1=_sha2,utils_js_1$1=utils$2,rotl=(tt,et)=>tt<>>32-et>>>0,Chi$1=(tt,et,nt)=>tt&et^~tt&nt,Maj$1=(tt,et,nt)=>tt&et^tt&nt^et&nt,IV$1=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),SHA1_W=new Uint32Array(80);class SHA1 extends _sha2_js_1$1.SHA2{constructor(){super(64,20,8,!1),this.A=IV$1[0]|0,this.B=IV$1[1]|0,this.C=IV$1[2]|0,this.D=IV$1[3]|0,this.E=IV$1[4]|0}get(){const{A:et,B:nt,C:it,D:rt,E:ot}=this;return[et,nt,it,rt,ot]}set(et,nt,it,rt,ot){this.A=et|0,this.B=nt|0,this.C=it|0,this.D=rt|0,this.E=ot|0}process(et,nt){for(let lt=0;lt<16;lt++,nt+=4)SHA1_W[lt]=et.getUint32(nt,!1);for(let lt=16;lt<80;lt++)SHA1_W[lt]=rotl(SHA1_W[lt-3]^SHA1_W[lt-8]^SHA1_W[lt-14]^SHA1_W[lt-16],1);let{A:it,B:rt,C:ot,D:at,E:st}=this;for(let lt=0;lt<80;lt++){let ct,ut;lt<20?(ct=Chi$1(rt,ot,at),ut=1518500249):lt<40?(ct=rt^ot^at,ut=1859775393):lt<60?(ct=Maj$1(rt,ot,at),ut=2400959708):(ct=rt^ot^at,ut=3395469782);const ht=rotl(it,5)+ct+st+ut+SHA1_W[lt]|0;st=at,at=ot,ot=rotl(rt,30),rt=it,it=ht}it=it+this.A|0,rt=rt+this.B|0,ot=ot+this.C|0,at=at+this.D|0,st=st+this.E|0,this.set(it,rt,ot,at,st)}roundClean(){SHA1_W.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}}sha1.sha1=(0,utils_js_1$1.wrapConstructor)(()=>new SHA1);var sha256$2={};Object.defineProperty(sha256$2,"__esModule",{value:!0});sha256$2.sha224=sha256$2.sha256=void 0;const _sha2_js_1=_sha2,utils_js_1=utils$2,Chi=(tt,et,nt)=>tt&et^~tt&nt,Maj=(tt,et,nt)=>tt&et^tt&nt^et&nt,SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends _sha2_js_1.SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:et,B:nt,C:it,D:rt,E:ot,F:at,G:st,H:lt}=this;return[et,nt,it,rt,ot,at,st,lt]}set(et,nt,it,rt,ot,at,st,lt){this.A=et|0,this.B=nt|0,this.C=it|0,this.D=rt|0,this.E=ot|0,this.F=at|0,this.G=st|0,this.H=lt|0}process(et,nt){for(let ht=0;ht<16;ht++,nt+=4)SHA256_W[ht]=et.getUint32(nt,!1);for(let ht=16;ht<64;ht++){const dt=SHA256_W[ht-15],pt=SHA256_W[ht-2],mt=(0,utils_js_1.rotr)(dt,7)^(0,utils_js_1.rotr)(dt,18)^dt>>>3,gt=(0,utils_js_1.rotr)(pt,17)^(0,utils_js_1.rotr)(pt,19)^pt>>>10;SHA256_W[ht]=gt+SHA256_W[ht-7]+mt+SHA256_W[ht-16]|0}let{A:it,B:rt,C:ot,D:at,E:st,F:lt,G:ct,H:ut}=this;for(let ht=0;ht<64;ht++){const dt=(0,utils_js_1.rotr)(st,6)^(0,utils_js_1.rotr)(st,11)^(0,utils_js_1.rotr)(st,25),pt=ut+dt+Chi(st,lt,ct)+SHA256_K[ht]+SHA256_W[ht]|0,gt=((0,utils_js_1.rotr)(it,2)^(0,utils_js_1.rotr)(it,13)^(0,utils_js_1.rotr)(it,22))+Maj(it,rt,ot)|0;ut=ct,ct=lt,lt=st,st=at+pt|0,at=ot,ot=rt,rt=it,it=pt+gt|0}it=it+this.A|0,rt=rt+this.B|0,ot=ot+this.C|0,at=at+this.D|0,st=st+this.E|0,lt=lt+this.F|0,ct=ct+this.G|0,ut=ut+this.H|0,this.set(it,rt,ot,at,st,lt,ct,ut)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}sha256$2.sha256=(0,utils_js_1.wrapConstructor)(()=>new SHA256);sha256$2.sha224=(0,utils_js_1.wrapConstructor)(()=>new SHA224);(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.taggedHash=tt.TAGGED_HASH_PREFIXES=tt.TAGS=tt.hash256=tt.hash160=tt.sha256=tt.sha1=tt.ripemd160=void 0;const et=ripemd160,nt=sha1,it=sha256$2;function rt(ut){return Buffer.from((0,et.ripemd160)(Uint8Array.from(ut)))}tt.ripemd160=rt;function ot(ut){return Buffer.from((0,nt.sha1)(Uint8Array.from(ut)))}tt.sha1=ot;function at(ut){return Buffer.from((0,it.sha256)(Uint8Array.from(ut)))}tt.sha256=at;function st(ut){return Buffer.from((0,et.ripemd160)((0,it.sha256)(Uint8Array.from(ut))))}tt.hash160=st;function lt(ut){return Buffer.from((0,it.sha256)((0,it.sha256)(Uint8Array.from(ut))))}tt.hash256=lt,tt.TAGS=["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"],tt.TAGGED_HASH_PREFIXES={"BIP0340/challenge":Buffer.from([123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124,123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124]),"BIP0340/aux":Buffer.from([241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144,241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144]),"BIP0340/nonce":Buffer.from([7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47,7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47]),TapLeaf:Buffer.from([174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238,174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238]),TapBranch:Buffer.from([25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21,25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21]),TapSighash:Buffer.from([244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49,244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49]),TapTweak:Buffer.from([232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233,232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233]),"KeyAgg list":Buffer.from([72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240,72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240]),"KeyAgg coefficient":Buffer.from([191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129,191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129])};function ct(ut,ht){return at(Buffer.concat([tt.TAGGED_HASH_PREFIXES[ut],ht]))}tt.taggedHash=ct})(crypto$2);function base$1(tt){if(tt.length>=255)throw new TypeError("Alphabet too long");for(var et=new Uint8Array(256),nt=0;nt>>0,vt=new Uint8Array(wt);bt!==yt;){for(var xt=pt[bt],St=0,Et=wt-1;(xt!==0||St>>0,vt[Et]=xt%at>>>0,xt=xt/at>>>0;if(xt!==0)throw new Error("Non-zero carry");gt=St,bt++}for(var It=wt-gt;It!==wt&&vt[It]===0;)It++;for(var Tt=st.repeat(mt);It>>0,wt=new Uint8Array(yt);pt[mt];){var vt=et[pt.charCodeAt(mt)];if(vt===255)return;for(var xt=0,St=yt-1;(vt!==0||xt>>0,wt[St]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");bt=xt,mt++}for(var Et=yt-bt;Et!==yt&&wt[Et]===0;)Et++;for(var It=new Uint8Array(gt+(yt-Et)),Tt=gt;Et!==yt;)It[Tt++]=wt[Et++];return It}function dt(pt){var mt=ht(pt);if(mt)return mt;throw new Error("Non-base"+at+" character")}return{encode:ut,decodeUnsafe:ht,decode:dt}}var src=base$1;const basex=src,ALPHABET$1="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var bs58=basex(ALPHABET$1),base58=bs58,base=function(tt){function et(ot){var at=Uint8Array.from(ot),st=tt(at),lt=at.length+4,ct=new Uint8Array(lt);return ct.set(at,0),ct.set(st.subarray(0,4),at.length),base58.encode(ct,lt)}function nt(ot){var at=ot.slice(0,-4),st=ot.slice(-4),lt=tt(at);if(!(st[0]^lt[0]|st[1]^lt[1]|st[2]^lt[2]|st[3]^lt[3]))return at}function it(ot){var at=base58.decodeUnsafe(ot);if(at)return nt(at)}function rt(ot){var at=base58.decode(ot),st=nt(at);if(!st)throw new Error("Invalid checksum");return st}return{encode:et,decode:rt,decodeUnsafe:it}},{sha256:sha256$1}=sha256$2,bs58checkBase=base;function sha256x2(tt){return sha256$1(sha256$1(tt))}var bs58check$3=bs58checkBase(sha256x2);Object.defineProperty(p2pkh$1,"__esModule",{value:!0});p2pkh$1.p2pkh=void 0;const bcrypto$5=crypto$2,networks_1$5=networks$1,bscript$8=script,types_1$6=types$7,lazy$5=lazy$9,bs58check$2=bs58check$3,OPS$4=bscript$8.OPS;function p2pkh(tt,et){if(!tt.address&&!tt.hash&&!tt.output&&!tt.pubkey&&!tt.input)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$6.typeforce)({network:types_1$6.typeforce.maybe(types_1$6.typeforce.Object),address:types_1$6.typeforce.maybe(types_1$6.typeforce.String),hash:types_1$6.typeforce.maybe(types_1$6.typeforce.BufferN(20)),output:types_1$6.typeforce.maybe(types_1$6.typeforce.BufferN(25)),pubkey:types_1$6.typeforce.maybe(types_1$6.isPoint),signature:types_1$6.typeforce.maybe(bscript$8.isCanonicalScriptSignature),input:types_1$6.typeforce.maybe(types_1$6.typeforce.Buffer)},tt);const nt=lazy$5.value(()=>{const at=Buffer.from(bs58check$2.decode(tt.address)),st=at.readUInt8(0),lt=at.slice(1);return{version:st,hash:lt}}),it=lazy$5.value(()=>bscript$8.decompile(tt.input)),rt=tt.network||networks_1$5.bitcoin,ot={name:"p2pkh",network:rt};if(lazy$5.prop(ot,"address",()=>{if(!ot.hash)return;const at=Buffer.allocUnsafe(21);return at.writeUInt8(rt.pubKeyHash,0),ot.hash.copy(at,1),bs58check$2.encode(at)}),lazy$5.prop(ot,"hash",()=>{if(tt.output)return tt.output.slice(3,23);if(tt.address)return nt().hash;if(tt.pubkey||ot.pubkey)return bcrypto$5.hash160(tt.pubkey||ot.pubkey)}),lazy$5.prop(ot,"output",()=>{if(ot.hash)return bscript$8.compile([OPS$4.OP_DUP,OPS$4.OP_HASH160,ot.hash,OPS$4.OP_EQUALVERIFY,OPS$4.OP_CHECKSIG])}),lazy$5.prop(ot,"pubkey",()=>{if(tt.input)return it()[1]}),lazy$5.prop(ot,"signature",()=>{if(tt.input)return it()[0]}),lazy$5.prop(ot,"input",()=>{if(tt.pubkey&&tt.signature)return bscript$8.compile([tt.signature,tt.pubkey])}),lazy$5.prop(ot,"witness",()=>{if(ot.input)return[]}),et.validate){let at=Buffer.from([]);if(tt.address){if(nt().version!==rt.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(nt().hash.length!==20)throw new TypeError("Invalid address");at=nt().hash}if(tt.hash){if(at.length>0&&!at.equals(tt.hash))throw new TypeError("Hash mismatch");at=tt.hash}if(tt.output){if(tt.output.length!==25||tt.output[0]!==OPS$4.OP_DUP||tt.output[1]!==OPS$4.OP_HASH160||tt.output[2]!==20||tt.output[23]!==OPS$4.OP_EQUALVERIFY||tt.output[24]!==OPS$4.OP_CHECKSIG)throw new TypeError("Output is invalid");const st=tt.output.slice(3,23);if(at.length>0&&!at.equals(st))throw new TypeError("Hash mismatch");at=st}if(tt.pubkey){const st=bcrypto$5.hash160(tt.pubkey);if(at.length>0&&!at.equals(st))throw new TypeError("Hash mismatch");at=st}if(tt.input){const st=it();if(st.length!==2)throw new TypeError("Input is invalid");if(!bscript$8.isCanonicalScriptSignature(st[0]))throw new TypeError("Input has invalid signature");if(!(0,types_1$6.isPoint)(st[1]))throw new TypeError("Input has invalid pubkey");if(tt.signature&&!tt.signature.equals(st[0]))throw new TypeError("Signature mismatch");if(tt.pubkey&&!tt.pubkey.equals(st[1]))throw new TypeError("Pubkey mismatch");const lt=bcrypto$5.hash160(st[1]);if(at.length>0&&!at.equals(lt))throw new TypeError("Hash mismatch")}}return Object.assign(ot,tt)}p2pkh$1.p2pkh=p2pkh;var p2sh$1={};Object.defineProperty(p2sh$1,"__esModule",{value:!0});p2sh$1.p2sh=void 0;const bcrypto$4=crypto$2,networks_1$4=networks$1,bscript$7=script,types_1$5=types$7,lazy$4=lazy$9,bs58check$1=bs58check$3,OPS$3=bscript$7.OPS;function stacksEqual$2(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}function p2sh(tt,et){if(!tt.address&&!tt.hash&&!tt.output&&!tt.redeem&&!tt.input)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$5.typeforce)({network:types_1$5.typeforce.maybe(types_1$5.typeforce.Object),address:types_1$5.typeforce.maybe(types_1$5.typeforce.String),hash:types_1$5.typeforce.maybe(types_1$5.typeforce.BufferN(20)),output:types_1$5.typeforce.maybe(types_1$5.typeforce.BufferN(23)),redeem:types_1$5.typeforce.maybe({network:types_1$5.typeforce.maybe(types_1$5.typeforce.Object),output:types_1$5.typeforce.maybe(types_1$5.typeforce.Buffer),input:types_1$5.typeforce.maybe(types_1$5.typeforce.Buffer),witness:types_1$5.typeforce.maybe(types_1$5.typeforce.arrayOf(types_1$5.typeforce.Buffer))}),input:types_1$5.typeforce.maybe(types_1$5.typeforce.Buffer),witness:types_1$5.typeforce.maybe(types_1$5.typeforce.arrayOf(types_1$5.typeforce.Buffer))},tt);let nt=tt.network;nt||(nt=tt.redeem&&tt.redeem.network||networks_1$4.bitcoin);const it={network:nt},rt=lazy$4.value(()=>{const st=Buffer.from(bs58check$1.decode(tt.address)),lt=st.readUInt8(0),ct=st.slice(1);return{version:lt,hash:ct}}),ot=lazy$4.value(()=>bscript$7.decompile(tt.input)),at=lazy$4.value(()=>{const st=ot(),lt=st[st.length-1];return{network:nt,output:lt===OPS$3.OP_FALSE?Buffer.from([]):lt,input:bscript$7.compile(st.slice(0,-1)),witness:tt.witness||[]}});if(lazy$4.prop(it,"address",()=>{if(!it.hash)return;const st=Buffer.allocUnsafe(21);return st.writeUInt8(it.network.scriptHash,0),it.hash.copy(st,1),bs58check$1.encode(st)}),lazy$4.prop(it,"hash",()=>{if(tt.output)return tt.output.slice(2,22);if(tt.address)return rt().hash;if(it.redeem&&it.redeem.output)return bcrypto$4.hash160(it.redeem.output)}),lazy$4.prop(it,"output",()=>{if(it.hash)return bscript$7.compile([OPS$3.OP_HASH160,it.hash,OPS$3.OP_EQUAL])}),lazy$4.prop(it,"redeem",()=>{if(tt.input)return at()}),lazy$4.prop(it,"input",()=>{if(!(!tt.redeem||!tt.redeem.input||!tt.redeem.output))return bscript$7.compile([].concat(bscript$7.decompile(tt.redeem.input),tt.redeem.output))}),lazy$4.prop(it,"witness",()=>{if(it.redeem&&it.redeem.witness)return it.redeem.witness;if(it.input)return[]}),lazy$4.prop(it,"name",()=>{const st=["p2sh"];return it.redeem!==void 0&&it.redeem.name!==void 0&&st.push(it.redeem.name),st.join("-")}),et.validate){let st=Buffer.from([]);if(tt.address){if(rt().version!==nt.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(rt().hash.length!==20)throw new TypeError("Invalid address");st=rt().hash}if(tt.hash){if(st.length>0&&!st.equals(tt.hash))throw new TypeError("Hash mismatch");st=tt.hash}if(tt.output){if(tt.output.length!==23||tt.output[0]!==OPS$3.OP_HASH160||tt.output[1]!==20||tt.output[22]!==OPS$3.OP_EQUAL)throw new TypeError("Output is invalid");const ct=tt.output.slice(2,22);if(st.length>0&&!st.equals(ct))throw new TypeError("Hash mismatch");st=ct}const lt=ct=>{if(ct.output){const ut=bscript$7.decompile(ct.output);if(!ut||ut.length<1)throw new TypeError("Redeem.output too short");if(ct.output.byteLength>520)throw new TypeError("Redeem.output unspendable if larger than 520 bytes");if(bscript$7.countNonPushOnlyOPs(ut)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const ht=bcrypto$4.hash160(ct.output);if(st.length>0&&!st.equals(ht))throw new TypeError("Hash mismatch");st=ht}if(ct.input){const ut=ct.input.length>0,ht=ct.witness&&ct.witness.length>0;if(!ut&&!ht)throw new TypeError("Empty input");if(ut&&ht)throw new TypeError("Input and witness provided");if(ut){const dt=bscript$7.decompile(ct.input);if(!bscript$7.isPushOnly(dt))throw new TypeError("Non push-only scriptSig")}}};if(tt.input){const ct=ot();if(!ct||ct.length<1)throw new TypeError("Input too short");if(!Buffer.isBuffer(at().output))throw new TypeError("Input is invalid");lt(at())}if(tt.redeem){if(tt.redeem.network&&tt.redeem.network!==nt)throw new TypeError("Network mismatch");if(tt.input){const ct=at();if(tt.redeem.output&&!tt.redeem.output.equals(ct.output))throw new TypeError("Redeem.output mismatch");if(tt.redeem.input&&!tt.redeem.input.equals(ct.input))throw new TypeError("Redeem.input mismatch")}lt(tt.redeem)}if(tt.witness&&tt.redeem&&tt.redeem.witness&&!stacksEqual$2(tt.redeem.witness,tt.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(it,tt)}p2sh$1.p2sh=p2sh;var p2wpkh$1={},dist$1={};Object.defineProperty(dist$1,"__esModule",{value:!0});dist$1.bech32m=dist$1.bech32=void 0;const ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={};for(let tt=0;tt>25;return(tt&33554431)<<5^-(et>>0&1)&996825010^-(et>>1&1)&642813549^-(et>>2&1)&513874426^-(et>>3&1)&1027748829^-(et>>4&1)&705979059}function prefixChk(tt){let et=1;for(let nt=0;nt126)return"Invalid prefix ("+tt+")";et=polymodStep(et)^it>>5}et=polymodStep(et);for(let nt=0;nt=nt;)ot-=nt,st.push(rt>>ot&at);if(it)ot>0&&st.push(rt<=et)return"Excess padding";if(rt<lt)throw new TypeError("Exceeds length limit");at=at.toLowerCase();let ct=prefixChk(at);if(typeof ct=="string")throw new Error(ct);let ut=at+"1";for(let ht=0;ht>5)throw new Error("Non 5-bit word");ct=polymodStep(ct)^dt,ut+=ALPHABET.charAt(dt)}for(let ht=0;ht<6;++ht)ct=polymodStep(ct);ct^=et;for(let ht=0;ht<6;++ht){const dt=ct>>(5-ht)*5&31;ut+=ALPHABET.charAt(dt)}return ut}function it(at,st){if(st=st||90,at.length<8)return at+" too short";if(at.length>st)return"Exceeds length limit";const lt=at.toLowerCase(),ct=at.toUpperCase();if(at!==lt&&at!==ct)return"Mixed-case string "+at;at=lt;const ut=at.lastIndexOf("1");if(ut===-1)return"No separator character for "+at;if(ut===0)return"Missing prefix for "+at;const ht=at.slice(0,ut),dt=at.slice(ut+1);if(dt.length<6)return"Data too short";let pt=prefixChk(ht);if(typeof pt=="string")return pt;const mt=[];for(let gt=0;gt=dt.length)&&mt.push(yt)}return pt!==et?"Invalid checksum for "+at:{prefix:ht,words:mt}}function rt(at,st){const lt=it(at,st);if(typeof lt=="object")return lt}function ot(at,st){const lt=it(at,st);if(typeof lt=="object")return lt;throw new Error(lt)}return{decodeUnsafe:rt,decode:ot,encode:nt,toWords,fromWordsUnsafe,fromWords}}dist$1.bech32=getLibraryFromEncoding("bech32");dist$1.bech32m=getLibraryFromEncoding("bech32m");Object.defineProperty(p2wpkh$1,"__esModule",{value:!0});p2wpkh$1.p2wpkh=void 0;const bcrypto$3=crypto$2,networks_1$3=networks$1,bscript$6=script,types_1$4=types$7,lazy$3=lazy$9,bech32_1$3=dist$1,OPS$2=bscript$6.OPS,EMPTY_BUFFER$2=Buffer.alloc(0);function p2wpkh(tt,et){if(!tt.address&&!tt.hash&&!tt.output&&!tt.pubkey&&!tt.witness)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$4.typeforce)({address:types_1$4.typeforce.maybe(types_1$4.typeforce.String),hash:types_1$4.typeforce.maybe(types_1$4.typeforce.BufferN(20)),input:types_1$4.typeforce.maybe(types_1$4.typeforce.BufferN(0)),network:types_1$4.typeforce.maybe(types_1$4.typeforce.Object),output:types_1$4.typeforce.maybe(types_1$4.typeforce.BufferN(22)),pubkey:types_1$4.typeforce.maybe(types_1$4.isPoint),signature:types_1$4.typeforce.maybe(bscript$6.isCanonicalScriptSignature),witness:types_1$4.typeforce.maybe(types_1$4.typeforce.arrayOf(types_1$4.typeforce.Buffer))},tt);const nt=lazy$3.value(()=>{const ot=bech32_1$3.bech32.decode(tt.address),at=ot.words.shift(),st=bech32_1$3.bech32.fromWords(ot.words);return{version:at,prefix:ot.prefix,data:Buffer.from(st)}}),it=tt.network||networks_1$3.bitcoin,rt={name:"p2wpkh",network:it};if(lazy$3.prop(rt,"address",()=>{if(!rt.hash)return;const ot=bech32_1$3.bech32.toWords(rt.hash);return ot.unshift(0),bech32_1$3.bech32.encode(it.bech32,ot)}),lazy$3.prop(rt,"hash",()=>{if(tt.output)return tt.output.slice(2,22);if(tt.address)return nt().data;if(tt.pubkey||rt.pubkey)return bcrypto$3.hash160(tt.pubkey||rt.pubkey)}),lazy$3.prop(rt,"output",()=>{if(rt.hash)return bscript$6.compile([OPS$2.OP_0,rt.hash])}),lazy$3.prop(rt,"pubkey",()=>{if(tt.pubkey)return tt.pubkey;if(tt.witness)return tt.witness[1]}),lazy$3.prop(rt,"signature",()=>{if(tt.witness)return tt.witness[0]}),lazy$3.prop(rt,"input",()=>{if(rt.witness)return EMPTY_BUFFER$2}),lazy$3.prop(rt,"witness",()=>{if(tt.pubkey&&tt.signature)return[tt.signature,tt.pubkey]}),et.validate){let ot=Buffer.from([]);if(tt.address){if(it&&it.bech32!==nt().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(nt().version!==0)throw new TypeError("Invalid address version");if(nt().data.length!==20)throw new TypeError("Invalid address data");ot=nt().data}if(tt.hash){if(ot.length>0&&!ot.equals(tt.hash))throw new TypeError("Hash mismatch");ot=tt.hash}if(tt.output){if(tt.output.length!==22||tt.output[0]!==OPS$2.OP_0||tt.output[1]!==20)throw new TypeError("Output is invalid");if(ot.length>0&&!ot.equals(tt.output.slice(2)))throw new TypeError("Hash mismatch");ot=tt.output.slice(2)}if(tt.pubkey){const at=bcrypto$3.hash160(tt.pubkey);if(ot.length>0&&!ot.equals(at))throw new TypeError("Hash mismatch");if(ot=at,!(0,types_1$4.isPoint)(tt.pubkey)||tt.pubkey.length!==33)throw new TypeError("Invalid pubkey for p2wpkh")}if(tt.witness){if(tt.witness.length!==2)throw new TypeError("Witness is invalid");if(!bscript$6.isCanonicalScriptSignature(tt.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,types_1$4.isPoint)(tt.witness[1])||tt.witness[1].length!==33)throw new TypeError("Witness has invalid pubkey");if(tt.signature&&!tt.signature.equals(tt.witness[0]))throw new TypeError("Signature mismatch");if(tt.pubkey&&!tt.pubkey.equals(tt.witness[1]))throw new TypeError("Pubkey mismatch");const at=bcrypto$3.hash160(tt.witness[1]);if(ot.length>0&&!ot.equals(at))throw new TypeError("Hash mismatch")}}return Object.assign(rt,tt)}p2wpkh$1.p2wpkh=p2wpkh;var p2wsh$1={};Object.defineProperty(p2wsh$1,"__esModule",{value:!0});p2wsh$1.p2wsh=void 0;const bcrypto$2=crypto$2,networks_1$2=networks$1,bscript$5=script,types_1$3=types$7,lazy$2=lazy$9,bech32_1$2=dist$1,OPS$1=bscript$5.OPS,EMPTY_BUFFER$1=Buffer.alloc(0);function stacksEqual$1(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}function chunkHasUncompressedPubkey(tt){return!!(Buffer.isBuffer(tt)&&tt.length===65&&tt[0]===4&&(0,types_1$3.isPoint)(tt))}function p2wsh(tt,et){if(!tt.address&&!tt.hash&&!tt.output&&!tt.redeem&&!tt.witness)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$3.typeforce)({network:types_1$3.typeforce.maybe(types_1$3.typeforce.Object),address:types_1$3.typeforce.maybe(types_1$3.typeforce.String),hash:types_1$3.typeforce.maybe(types_1$3.typeforce.BufferN(32)),output:types_1$3.typeforce.maybe(types_1$3.typeforce.BufferN(34)),redeem:types_1$3.typeforce.maybe({input:types_1$3.typeforce.maybe(types_1$3.typeforce.Buffer),network:types_1$3.typeforce.maybe(types_1$3.typeforce.Object),output:types_1$3.typeforce.maybe(types_1$3.typeforce.Buffer),witness:types_1$3.typeforce.maybe(types_1$3.typeforce.arrayOf(types_1$3.typeforce.Buffer))}),input:types_1$3.typeforce.maybe(types_1$3.typeforce.BufferN(0)),witness:types_1$3.typeforce.maybe(types_1$3.typeforce.arrayOf(types_1$3.typeforce.Buffer))},tt);const nt=lazy$2.value(()=>{const at=bech32_1$2.bech32.decode(tt.address),st=at.words.shift(),lt=bech32_1$2.bech32.fromWords(at.words);return{version:st,prefix:at.prefix,data:Buffer.from(lt)}}),it=lazy$2.value(()=>bscript$5.decompile(tt.redeem.input));let rt=tt.network;rt||(rt=tt.redeem&&tt.redeem.network||networks_1$2.bitcoin);const ot={network:rt};if(lazy$2.prop(ot,"address",()=>{if(!ot.hash)return;const at=bech32_1$2.bech32.toWords(ot.hash);return at.unshift(0),bech32_1$2.bech32.encode(rt.bech32,at)}),lazy$2.prop(ot,"hash",()=>{if(tt.output)return tt.output.slice(2);if(tt.address)return nt().data;if(ot.redeem&&ot.redeem.output)return bcrypto$2.sha256(ot.redeem.output)}),lazy$2.prop(ot,"output",()=>{if(ot.hash)return bscript$5.compile([OPS$1.OP_0,ot.hash])}),lazy$2.prop(ot,"redeem",()=>{if(tt.witness)return{output:tt.witness[tt.witness.length-1],input:EMPTY_BUFFER$1,witness:tt.witness.slice(0,-1)}}),lazy$2.prop(ot,"input",()=>{if(ot.witness)return EMPTY_BUFFER$1}),lazy$2.prop(ot,"witness",()=>{if(tt.redeem&&tt.redeem.input&&tt.redeem.input.length>0&&tt.redeem.output&&tt.redeem.output.length>0){const at=bscript$5.toStack(it());return ot.redeem=Object.assign({witness:at},tt.redeem),ot.redeem.input=EMPTY_BUFFER$1,[].concat(at,tt.redeem.output)}if(tt.redeem&&tt.redeem.output&&tt.redeem.witness)return[].concat(tt.redeem.witness,tt.redeem.output)}),lazy$2.prop(ot,"name",()=>{const at=["p2wsh"];return ot.redeem!==void 0&&ot.redeem.name!==void 0&&at.push(ot.redeem.name),at.join("-")}),et.validate){let at=Buffer.from([]);if(tt.address){if(nt().prefix!==rt.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(nt().version!==0)throw new TypeError("Invalid address version");if(nt().data.length!==32)throw new TypeError("Invalid address data");at=nt().data}if(tt.hash){if(at.length>0&&!at.equals(tt.hash))throw new TypeError("Hash mismatch");at=tt.hash}if(tt.output){if(tt.output.length!==34||tt.output[0]!==OPS$1.OP_0||tt.output[1]!==32)throw new TypeError("Output is invalid");const st=tt.output.slice(2);if(at.length>0&&!at.equals(st))throw new TypeError("Hash mismatch");at=st}if(tt.redeem){if(tt.redeem.network&&tt.redeem.network!==rt)throw new TypeError("Network mismatch");if(tt.redeem.input&&tt.redeem.input.length>0&&tt.redeem.witness&&tt.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(tt.redeem.output){const st=bscript$5.decompile(tt.redeem.output);if(!st||st.length<1)throw new TypeError("Redeem.output is invalid");if(tt.redeem.output.byteLength>3600)throw new TypeError("Redeem.output unspendable if larger than 3600 bytes");if(bscript$5.countNonPushOnlyOPs(st)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const lt=bcrypto$2.sha256(tt.redeem.output);if(at.length>0&&!at.equals(lt))throw new TypeError("Hash mismatch");at=lt}if(tt.redeem.input&&!bscript$5.isPushOnly(it()))throw new TypeError("Non push-only scriptSig");if(tt.witness&&tt.redeem.witness&&!stacksEqual$1(tt.witness,tt.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(tt.redeem.input&&it().some(chunkHasUncompressedPubkey)||tt.redeem.output&&(bscript$5.decompile(tt.redeem.output)||[]).some(chunkHasUncompressedPubkey))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(tt.witness&&tt.witness.length>0){const st=tt.witness[tt.witness.length-1];if(tt.redeem&&tt.redeem.output&&!tt.redeem.output.equals(st))throw new TypeError("Witness and redeem.output mismatch");if(tt.witness.some(chunkHasUncompressedPubkey)||(bscript$5.decompile(st)||[]).some(chunkHasUncompressedPubkey))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(ot,tt)}p2wsh$1.p2wsh=p2wsh;var p2tr$1={},ecc_lib={};Object.defineProperty(ecc_lib,"__esModule",{value:!0});ecc_lib.getEccLib=ecc_lib.initEccLib=void 0;const _ECCLIB_CACHE={};function initEccLib(tt){tt?tt!==_ECCLIB_CACHE.eccLib&&(verifyEcc(tt),_ECCLIB_CACHE.eccLib=tt):_ECCLIB_CACHE.eccLib=tt}ecc_lib.initEccLib=initEccLib;function getEccLib(){if(!_ECCLIB_CACHE.eccLib)throw new Error("No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance");return _ECCLIB_CACHE.eccLib}ecc_lib.getEccLib=getEccLib;const h$4=tt=>Buffer.from(tt,"hex");function verifyEcc(tt){assert$1(typeof tt.isXOnlyPoint=="function"),assert$1(tt.isXOnlyPoint(h$4("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),assert$1(tt.isXOnlyPoint(h$4("fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e"))),assert$1(tt.isXOnlyPoint(h$4("f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"))),assert$1(tt.isXOnlyPoint(h$4("0000000000000000000000000000000000000000000000000000000000000001"))),assert$1(!tt.isXOnlyPoint(h$4("0000000000000000000000000000000000000000000000000000000000000000"))),assert$1(!tt.isXOnlyPoint(h$4("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"))),assert$1(typeof tt.xOnlyPointAddTweak=="function"),tweakAddVectors.forEach(et=>{const nt=tt.xOnlyPointAddTweak(h$4(et.pubkey),h$4(et.tweak));et.result===null?assert$1(nt===null):(assert$1(nt!==null),assert$1(nt.parity===et.parity),assert$1(Buffer.from(nt.xOnlyPubkey).equals(h$4(et.result))))})}function assert$1(tt){if(!tt)throw new Error("ecc library invalid")}const tweakAddVectors=[{pubkey:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",tweak:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",parity:-1,result:null},{pubkey:"1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b",tweak:"a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac",parity:1,result:"e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"},{pubkey:"2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991",tweak:"823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47",parity:0,result:"9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"}];var bip341={},bufferutils={},Buffer$2=safeBufferExports.Buffer,MAX_SAFE_INTEGER$4=9007199254740991;function checkUInt53$1(tt){if(tt<0||tt>MAX_SAFE_INTEGER$4||tt%1!==0)throw new RangeError("value out of range")}function encode$j(tt,et,nt){if(checkUInt53$1(tt),et||(et=Buffer$2.allocUnsafe(encodingLength$1(tt))),!Buffer$2.isBuffer(et))throw new TypeError("buffer must be a Buffer instance");return nt||(nt=0),tt<253?(et.writeUInt8(tt,nt),encode$j.bytes=1):tt<=65535?(et.writeUInt8(253,nt),et.writeUInt16LE(tt,nt+1),encode$j.bytes=3):tt<=4294967295?(et.writeUInt8(254,nt),et.writeUInt32LE(tt,nt+1),encode$j.bytes=5):(et.writeUInt8(255,nt),et.writeUInt32LE(tt>>>0,nt+1),et.writeUInt32LE(tt/4294967296|0,nt+5),encode$j.bytes=9),et}function decode$j(tt,et){if(!Buffer$2.isBuffer(tt))throw new TypeError("buffer must be a Buffer instance");et||(et=0);var nt=tt.readUInt8(et);if(nt<253)return decode$j.bytes=1,nt;if(nt===253)return decode$j.bytes=3,tt.readUInt16LE(et+1);if(nt===254)return decode$j.bytes=5,tt.readUInt32LE(et+1);decode$j.bytes=9;var it=tt.readUInt32LE(et+1),rt=tt.readUInt32LE(et+5),ot=rt*4294967296+it;return checkUInt53$1(ot),ot}function encodingLength$1(tt){return checkUInt53$1(tt),tt<253?1:tt<=65535?3:tt<=4294967295?5:9}var varuintBitcoin={encode:encode$j,decode:decode$j,encodingLength:encodingLength$1};Object.defineProperty(bufferutils,"__esModule",{value:!0});bufferutils.BufferReader=bufferutils.BufferWriter=bufferutils.cloneBuffer=bufferutils.reverseBuffer=bufferutils.writeUInt64LE=bufferutils.readUInt64LE=bufferutils.varuint=void 0;const types$4=types$7,{typeforce:typeforce$2}=types$4,varuint$7=varuintBitcoin;bufferutils.varuint=varuint$7;function verifuint$1(tt,et){if(typeof tt!="number")throw new Error("cannot write a non-number as a number");if(tt<0)throw new Error("specified a negative value for writing an unsigned value");if(tt>et)throw new Error("RangeError: value out of range");if(Math.floor(tt)!==tt)throw new Error("value has a fractional component")}function readUInt64LE$1(tt,et){const nt=tt.readUInt32LE(et);let it=tt.readUInt32LE(et+4);return it*=4294967296,verifuint$1(it+nt,9007199254740991),it+nt}bufferutils.readUInt64LE=readUInt64LE$1;function writeUInt64LE$1(tt,et,nt){return verifuint$1(et,9007199254740991),tt.writeInt32LE(et&-1,nt),tt.writeUInt32LE(Math.floor(et/4294967296),nt+4),nt+8}bufferutils.writeUInt64LE=writeUInt64LE$1;function reverseBuffer$1(tt){if(tt.length<1)return tt;let et=tt.length-1,nt=0;for(let it=0;itthis.writeVarSlice(nt))}end(){if(this.buffer.length===this.offset)return this.buffer;throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`)}}bufferutils.BufferWriter=BufferWriter;class BufferReader{constructor(et,nt=0){this.buffer=et,this.offset=nt,typeforce$2(types$4.tuple(types$4.Buffer,types$4.UInt32),[et,nt])}readUInt8(){const et=this.buffer.readUInt8(this.offset);return this.offset++,et}readInt32(){const et=this.buffer.readInt32LE(this.offset);return this.offset+=4,et}readUInt32(){const et=this.buffer.readUInt32LE(this.offset);return this.offset+=4,et}readUInt64(){const et=readUInt64LE$1(this.buffer,this.offset);return this.offset+=8,et}readVarInt(){const et=varuint$7.decode(this.buffer,this.offset);return this.offset+=varuint$7.decode.bytes,et}readSlice(et){if(this.buffer.length"left"in gt&&"right"in gt;function st(gt,bt){if(gt.length<33)throw new TypeError(`The control-block length is too small. Got ${gt.length}, expected min 33.`);const yt=(gt.length-33)/32;let wt=bt;for(let vt=0;vtvt.hash.compare(xt.hash));const[yt,wt]=bt;return{hash:pt(yt.hash,wt.hash),left:yt,right:wt}}tt.toHashTree=lt;function ct(gt,bt){if(at(gt)){const yt=ct(gt.left,bt);if(yt!==void 0)return[...yt,gt.right.hash];const wt=ct(gt.right,bt);if(wt!==void 0)return[...wt,gt.left.hash]}else if(gt.hash.equals(bt))return[]}tt.findScriptPath=ct;function ut(gt){const bt=gt.version||tt.LEAF_VERSION_TAPSCRIPT;return it.taggedHash("TapLeaf",et.Buffer.concat([et.Buffer.from([bt]),mt(gt.output)]))}tt.tapleafHash=ut;function ht(gt,bt){return it.taggedHash("TapTweak",et.Buffer.concat(bt?[gt,bt]:[gt]))}tt.tapTweakHash=ht;function dt(gt,bt){if(!et.Buffer.isBuffer(gt)||gt.length!==32||bt&&bt.length!==32)return null;const yt=ht(gt,bt),wt=(0,nt.getEccLib)().xOnlyPointAddTweak(gt,yt);return!wt||wt.xOnlyPubkey===null?null:{parity:wt.parity,x:et.Buffer.from(wt.xOnlyPubkey)}}tt.tweakKey=dt;function pt(gt,bt){return it.taggedHash("TapBranch",et.Buffer.concat([gt,bt]))}function mt(gt){const bt=rt.varuint.encodingLength(gt.length),yt=et.Buffer.allocUnsafe(bt);return rt.varuint.encode(gt.length,yt),et.Buffer.concat([yt,gt])}})(bip341);Object.defineProperty(p2tr$1,"__esModule",{value:!0});p2tr$1.p2tr=void 0;const buffer_1=buffer$2,networks_1$1=networks$1,bscript$4=script,types_1$2=types$7,ecc_lib_1=ecc_lib,bip341_1$2=bip341,lazy$1=lazy$9,bech32_1$1=dist$1,OPS=bscript$4.OPS,TAPROOT_WITNESS_VERSION=1,ANNEX_PREFIX=80;function p2tr(tt,et){if(!tt.address&&!tt.output&&!tt.pubkey&&!tt.internalPubkey&&!(tt.witness&&tt.witness.length>1))throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$2.typeforce)({address:types_1$2.typeforce.maybe(types_1$2.typeforce.String),input:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(0)),network:types_1$2.typeforce.maybe(types_1$2.typeforce.Object),output:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(34)),internalPubkey:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(32)),hash:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(32)),pubkey:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(32)),signature:types_1$2.typeforce.maybe(types_1$2.typeforce.anyOf(types_1$2.typeforce.BufferN(64),types_1$2.typeforce.BufferN(65))),witness:types_1$2.typeforce.maybe(types_1$2.typeforce.arrayOf(types_1$2.typeforce.Buffer)),scriptTree:types_1$2.typeforce.maybe(types_1$2.isTaptree),redeem:types_1$2.typeforce.maybe({output:types_1$2.typeforce.maybe(types_1$2.typeforce.Buffer),redeemVersion:types_1$2.typeforce.maybe(types_1$2.typeforce.Number),witness:types_1$2.typeforce.maybe(types_1$2.typeforce.arrayOf(types_1$2.typeforce.Buffer))}),redeemVersion:types_1$2.typeforce.maybe(types_1$2.typeforce.Number)},tt);const nt=lazy$1.value(()=>{const st=bech32_1$1.bech32m.decode(tt.address),lt=st.words.shift(),ct=bech32_1$1.bech32m.fromWords(st.words);return{version:lt,prefix:st.prefix,data:buffer_1.Buffer.from(ct)}}),it=lazy$1.value(()=>{if(!(!tt.witness||!tt.witness.length))return tt.witness.length>=2&&tt.witness[tt.witness.length-1][0]===ANNEX_PREFIX?tt.witness.slice(0,-1):tt.witness.slice()}),rt=lazy$1.value(()=>{if(tt.scriptTree)return(0,bip341_1$2.toHashTree)(tt.scriptTree);if(tt.hash)return{hash:tt.hash}}),ot=tt.network||networks_1$1.bitcoin,at={name:"p2tr",network:ot};if(lazy$1.prop(at,"address",()=>{if(!at.pubkey)return;const st=bech32_1$1.bech32m.toWords(at.pubkey);return st.unshift(TAPROOT_WITNESS_VERSION),bech32_1$1.bech32m.encode(ot.bech32,st)}),lazy$1.prop(at,"hash",()=>{const st=rt();if(st)return st.hash;const lt=it();if(lt&<.length>1){const ct=lt[lt.length-1],ut=ct[0]&types_1$2.TAPLEAF_VERSION_MASK,ht=lt[lt.length-2],dt=(0,bip341_1$2.tapleafHash)({output:ht,version:ut});return(0,bip341_1$2.rootHashFromPath)(ct,dt)}return null}),lazy$1.prop(at,"output",()=>{if(at.pubkey)return bscript$4.compile([OPS.OP_1,at.pubkey])}),lazy$1.prop(at,"redeemVersion",()=>tt.redeemVersion?tt.redeemVersion:tt.redeem&&tt.redeem.redeemVersion!==void 0&&tt.redeem.redeemVersion!==null?tt.redeem.redeemVersion:bip341_1$2.LEAF_VERSION_TAPSCRIPT),lazy$1.prop(at,"redeem",()=>{const st=it();if(!(!st||st.length<2))return{output:st[st.length-2],witness:st.slice(0,-2),redeemVersion:st[st.length-1][0]&types_1$2.TAPLEAF_VERSION_MASK}}),lazy$1.prop(at,"pubkey",()=>{if(tt.pubkey)return tt.pubkey;if(tt.output)return tt.output.slice(2);if(tt.address)return nt().data;if(at.internalPubkey){const st=(0,bip341_1$2.tweakKey)(at.internalPubkey,at.hash);if(st)return st.x}}),lazy$1.prop(at,"internalPubkey",()=>{if(tt.internalPubkey)return tt.internalPubkey;const st=it();if(st&&st.length>1)return st[st.length-1].slice(1,33)}),lazy$1.prop(at,"signature",()=>{if(tt.signature)return tt.signature;const st=it();if(!(!st||st.length!==1))return st[0]}),lazy$1.prop(at,"witness",()=>{if(tt.witness)return tt.witness;const st=rt();if(st&&tt.redeem&&tt.redeem.output&&tt.internalPubkey){const lt=(0,bip341_1$2.tapleafHash)({output:tt.redeem.output,version:at.redeemVersion}),ct=(0,bip341_1$2.findScriptPath)(st,lt);if(!ct)return;const ut=(0,bip341_1$2.tweakKey)(tt.internalPubkey,st.hash);if(!ut)return;const ht=buffer_1.Buffer.concat([buffer_1.Buffer.from([at.redeemVersion|ut.parity]),tt.internalPubkey].concat(ct));return[tt.redeem.output,ht]}if(tt.signature)return[tt.signature]}),et.validate){let st=buffer_1.Buffer.from([]);if(tt.address){if(ot&&ot.bech32!==nt().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(nt().version!==TAPROOT_WITNESS_VERSION)throw new TypeError("Invalid address version");if(nt().data.length!==32)throw new TypeError("Invalid address data");st=nt().data}if(tt.pubkey){if(st.length>0&&!st.equals(tt.pubkey))throw new TypeError("Pubkey mismatch");st=tt.pubkey}if(tt.output){if(tt.output.length!==34||tt.output[0]!==OPS.OP_1||tt.output[1]!==32)throw new TypeError("Output is invalid");if(st.length>0&&!st.equals(tt.output.slice(2)))throw new TypeError("Pubkey mismatch");st=tt.output.slice(2)}if(tt.internalPubkey){const ut=(0,bip341_1$2.tweakKey)(tt.internalPubkey,at.hash);if(st.length>0&&!st.equals(ut.x))throw new TypeError("Pubkey mismatch");st=ut.x}if(st&&st.length&&!(0,ecc_lib_1.getEccLib)().isXOnlyPoint(st))throw new TypeError("Invalid pubkey for p2tr");const lt=rt();if(tt.hash&<&&!tt.hash.equals(lt.hash))throw new TypeError("Hash mismatch");if(tt.redeem&&tt.redeem.output&<){const ut=(0,bip341_1$2.tapleafHash)({output:tt.redeem.output,version:at.redeemVersion});if(!(0,bip341_1$2.findScriptPath)(lt,ut))throw new TypeError("Redeem script not in tree")}const ct=it();if(tt.redeem&&at.redeem){if(tt.redeem.redeemVersion&&tt.redeem.redeemVersion!==at.redeem.redeemVersion)throw new TypeError("Redeem.redeemVersion and witness mismatch");if(tt.redeem.output){if(bscript$4.decompile(tt.redeem.output).length===0)throw new TypeError("Redeem.output is invalid");if(at.redeem.output&&!tt.redeem.output.equals(at.redeem.output))throw new TypeError("Redeem.output and witness mismatch")}if(tt.redeem.witness&&at.redeem.witness&&!stacksEqual(tt.redeem.witness,at.redeem.witness))throw new TypeError("Redeem.witness and witness mismatch")}if(ct&&ct.length)if(ct.length===1){if(tt.signature&&!tt.signature.equals(ct[0]))throw new TypeError("Signature mismatch")}else{const ut=ct[ct.length-1];if(ut.length<33)throw new TypeError(`The control-block length is too small. Got ${ut.length}, expected min 33.`);if((ut.length-33)%32!==0)throw new TypeError(`The control-block length of ${ut.length} is incorrect!`);const ht=(ut.length-33)/32;if(ht>128)throw new TypeError(`The script path is too long. Got ${ht}, expected max 128.`);const dt=ut.slice(1,33);if(tt.internalPubkey&&!tt.internalPubkey.equals(dt))throw new TypeError("Internal pubkey mismatch");if(!(0,ecc_lib_1.getEccLib)().isXOnlyPoint(dt))throw new TypeError("Invalid internalPubkey for p2tr witness");const pt=ut[0]&types_1$2.TAPLEAF_VERSION_MASK,mt=ct[ct.length-2],gt=(0,bip341_1$2.tapleafHash)({output:mt,version:pt}),bt=(0,bip341_1$2.rootHashFromPath)(ut,gt),yt=(0,bip341_1$2.tweakKey)(dt,bt);if(!yt)throw new TypeError("Invalid outputKey for p2tr witness");if(st.length&&!st.equals(yt.x))throw new TypeError("Pubkey mismatch for p2tr witness");if(yt.parity!==(ut[0]&1))throw new Error("Incorrect parity")}}return Object.assign(at,tt)}p2tr$1.p2tr=p2tr;function stacksEqual(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.p2tr=tt.p2wsh=tt.p2wpkh=tt.p2sh=tt.p2pkh=tt.p2pk=tt.p2ms=tt.embed=void 0;const et=embed;Object.defineProperty(tt,"embed",{enumerable:!0,get:function(){return et.p2data}});const nt=p2ms$1;Object.defineProperty(tt,"p2ms",{enumerable:!0,get:function(){return nt.p2ms}});const it=p2pk$1;Object.defineProperty(tt,"p2pk",{enumerable:!0,get:function(){return it.p2pk}});const rt=p2pkh$1;Object.defineProperty(tt,"p2pkh",{enumerable:!0,get:function(){return rt.p2pkh}});const ot=p2sh$1;Object.defineProperty(tt,"p2sh",{enumerable:!0,get:function(){return ot.p2sh}});const at=p2wpkh$1;Object.defineProperty(tt,"p2wpkh",{enumerable:!0,get:function(){return at.p2wpkh}});const st=p2wsh$1;Object.defineProperty(tt,"p2wsh",{enumerable:!0,get:function(){return st.p2wsh}});const lt=p2tr$1;Object.defineProperty(tt,"p2tr",{enumerable:!0,get:function(){return lt.p2tr}})})(payments$3);Object.defineProperty(address,"__esModule",{value:!0});address.toOutputScript=address.fromOutputScript=address.toBech32=address.toBase58Check=address.fromBech32=address.fromBase58Check=void 0;const networks=networks$1,payments$2=payments$3,bscript$3=script,types_1$1=types$7,bech32_1=dist$1,bs58check=bs58check$3,FUTURE_SEGWIT_MAX_SIZE=40,FUTURE_SEGWIT_MIN_SIZE=2,FUTURE_SEGWIT_MAX_VERSION=16,FUTURE_SEGWIT_MIN_VERSION=2,FUTURE_SEGWIT_VERSION_DIFF=80,FUTURE_SEGWIT_VERSION_WARNING="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function _toFutureSegwitAddress(tt,et){const nt=tt.slice(2);if(nt.lengthFUTURE_SEGWIT_MAX_SIZE)throw new TypeError("Invalid program length for segwit address");const it=tt[0]-FUTURE_SEGWIT_VERSION_DIFF;if(itFUTURE_SEGWIT_MAX_VERSION)throw new TypeError("Invalid version for segwit address");if(tt[1]!==nt.length)throw new TypeError("Invalid script for segwit address");return console.warn(FUTURE_SEGWIT_VERSION_WARNING),toBech32(nt,it,et.bech32)}function fromBase58Check(tt){const et=Buffer.from(bs58check.decode(tt));if(et.length<21)throw new TypeError(tt+" is too short");if(et.length>21)throw new TypeError(tt+" is too long");const nt=et.readUInt8(0),it=et.slice(1);return{version:nt,hash:it}}address.fromBase58Check=fromBase58Check;function fromBech32(tt){let et,nt;try{et=bech32_1.bech32.decode(tt)}catch{}if(et){if(nt=et.words[0],nt!==0)throw new TypeError(tt+" uses wrong encoding")}else if(et=bech32_1.bech32m.decode(tt),nt=et.words[0],nt===0)throw new TypeError(tt+" uses wrong encoding");const it=bech32_1.bech32.fromWords(et.words.slice(1));return{version:nt,prefix:et.prefix,data:Buffer.from(it)}}address.fromBech32=fromBech32;function toBase58Check(tt,et){(0,types_1$1.typeforce)((0,types_1$1.tuple)(types_1$1.Hash160bit,types_1$1.UInt8),arguments);const nt=Buffer.allocUnsafe(21);return nt.writeUInt8(et,0),tt.copy(nt,1),bs58check.encode(nt)}address.toBase58Check=toBase58Check;function toBech32(tt,et,nt){const it=bech32_1.bech32.toWords(tt);return it.unshift(et),et===0?bech32_1.bech32.encode(nt,it):bech32_1.bech32m.encode(nt,it)}address.toBech32=toBech32;function fromOutputScript(tt,et){et=et||networks.bitcoin;try{return payments$2.p2pkh({output:tt,network:et}).address}catch{}try{return payments$2.p2sh({output:tt,network:et}).address}catch{}try{return payments$2.p2wpkh({output:tt,network:et}).address}catch{}try{return payments$2.p2wsh({output:tt,network:et}).address}catch{}try{return payments$2.p2tr({output:tt,network:et}).address}catch{}try{return _toFutureSegwitAddress(tt,et)}catch{}throw new Error(bscript$3.toASM(tt)+" has no matching Address")}address.fromOutputScript=fromOutputScript;function toOutputScript(tt,et){et=et||networks.bitcoin;let nt,it;try{nt=fromBase58Check(tt)}catch{}if(nt){if(nt.version===et.pubKeyHash)return payments$2.p2pkh({hash:nt.hash}).output;if(nt.version===et.scriptHash)return payments$2.p2sh({hash:nt.hash}).output}else{try{it=fromBech32(tt)}catch{}if(it){if(it.prefix!==et.bech32)throw new Error(tt+" has an invalid prefix");if(it.version===0){if(it.data.length===20)return payments$2.p2wpkh({hash:it.data}).output;if(it.data.length===32)return payments$2.p2wsh({hash:it.data}).output}else if(it.version===1){if(it.data.length===32)return payments$2.p2tr({pubkey:it.data}).output}else if(it.version>=FUTURE_SEGWIT_MIN_VERSION&&it.version<=FUTURE_SEGWIT_MAX_VERSION&&it.data.length>=FUTURE_SEGWIT_MIN_SIZE&&it.data.length<=FUTURE_SEGWIT_MAX_SIZE)return console.warn(FUTURE_SEGWIT_VERSION_WARNING),bscript$3.compile([it.version+FUTURE_SEGWIT_VERSION_DIFF,it.data])}}throw new Error(tt+" has no matching Script")}address.toOutputScript=toOutputScript;var block={},merkle={};Object.defineProperty(merkle,"__esModule",{value:!0});merkle.fastMerkleRoot=void 0;function fastMerkleRoot(tt,et){if(!Array.isArray(tt))throw TypeError("Expected values Array");if(typeof et!="function")throw TypeError("Expected digest Function");let nt=tt.length;const it=tt.concat();for(;nt>1;){let rt=0;for(let ot=0;otnt+varSliceSize(it),0)}const EMPTY_BUFFER=Buffer.allocUnsafe(0),EMPTY_WITNESS=[],ZERO=Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),ONE$1=Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),VALUE_UINT64_MAX=Buffer.from("ffffffffffffffff","hex"),BLANK_OUTPUT={script:EMPTY_BUFFER,valueBuffer:VALUE_UINT64_MAX};function isOutput(tt){return tt.value!==void 0}class Transaction{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(et,nt){const it=new bufferutils_1$2.BufferReader(et),rt=new Transaction;rt.version=it.readInt32();const ot=it.readUInt8(),at=it.readUInt8();let st=!1;ot===Transaction.ADVANCED_TRANSACTION_MARKER&&at===Transaction.ADVANCED_TRANSACTION_FLAG?st=!0:it.offset-=2;const lt=it.readVarInt();for(let ut=0;utet.witness.length!==0)}weight(){const et=this.byteLength(!1),nt=this.byteLength(!0);return et*3+nt}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(et=!0){const nt=et&&this.hasWitnesses();return(nt?10:8)+bufferutils_1$2.varuint.encodingLength(this.ins.length)+bufferutils_1$2.varuint.encodingLength(this.outs.length)+this.ins.reduce((it,rt)=>it+40+varSliceSize(rt.script),0)+this.outs.reduce((it,rt)=>it+8+varSliceSize(rt.script),0)+(nt?this.ins.reduce((it,rt)=>it+vectorSize(rt.witness),0):0)}clone(){const et=new Transaction;return et.version=this.version,et.locktime=this.locktime,et.ins=this.ins.map(nt=>({hash:nt.hash,index:nt.index,script:nt.script,sequence:nt.sequence,witness:nt.witness})),et.outs=this.outs.map(nt=>({script:nt.script,value:nt.value})),et}hashForSignature(et,nt,it){if(typeforce$1(types$3.tuple(types$3.UInt32,types$3.Buffer,types$3.Number),arguments),et>=this.ins.length)return ONE$1;const rt=bscript$2.compile(bscript$2.decompile(nt).filter(st=>st!==script_1.OPS.OP_CODESEPARATOR)),ot=this.clone();if((it&31)===Transaction.SIGHASH_NONE)ot.outs=[],ot.ins.forEach((st,lt)=>{lt!==et&&(st.sequence=0)});else if((it&31)===Transaction.SIGHASH_SINGLE){if(et>=this.outs.length)return ONE$1;ot.outs.length=et+1;for(let st=0;st{lt!==et&&(st.sequence=0)})}it&Transaction.SIGHASH_ANYONECANPAY?(ot.ins=[ot.ins[et]],ot.ins[0].script=rt):(ot.ins.forEach(st=>{st.script=EMPTY_BUFFER}),ot.ins[et].script=rt);const at=Buffer.allocUnsafe(ot.byteLength(!1)+4);return at.writeInt32LE(it,at.length-4),ot.__toBuffer(at,0,!1),bcrypto$1.hash256(at)}hashForWitnessV1(et,nt,it,rt,ot,at){if(typeforce$1(types$3.tuple(types$3.UInt32,typeforce$1.arrayOf(types$3.Buffer),typeforce$1.arrayOf(types$3.Satoshi),types$3.UInt32),arguments),it.length!==this.ins.length||nt.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");const st=rt===Transaction.SIGHASH_DEFAULT?Transaction.SIGHASH_ALL:rt&Transaction.SIGHASH_OUTPUT_MASK,ct=(rt&Transaction.SIGHASH_INPUT_MASK)===Transaction.SIGHASH_ANYONECANPAY,ut=st===Transaction.SIGHASH_NONE,ht=st===Transaction.SIGHASH_SINGLE;let dt=EMPTY_BUFFER,pt=EMPTY_BUFFER,mt=EMPTY_BUFFER,gt=EMPTY_BUFFER,bt=EMPTY_BUFFER;if(!ct){let xt=bufferutils_1$2.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach(St=>{xt.writeSlice(St.hash),xt.writeUInt32(St.index)}),dt=bcrypto$1.sha256(xt.end()),xt=bufferutils_1$2.BufferWriter.withCapacity(8*this.ins.length),it.forEach(St=>xt.writeUInt64(St)),pt=bcrypto$1.sha256(xt.end()),xt=bufferutils_1$2.BufferWriter.withCapacity(nt.map(varSliceSize).reduce((St,Et)=>St+Et)),nt.forEach(St=>xt.writeVarSlice(St)),mt=bcrypto$1.sha256(xt.end()),xt=bufferutils_1$2.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach(St=>xt.writeUInt32(St.sequence)),gt=bcrypto$1.sha256(xt.end())}if(ut||ht){if(ht&&et8+varSliceSize(Et.script)).reduce((Et,It)=>Et+It),St=bufferutils_1$2.BufferWriter.withCapacity(xt);this.outs.forEach(Et=>{St.writeUInt64(Et.value),St.writeVarSlice(Et.script)}),bt=bcrypto$1.sha256(St.end())}const yt=(ot?2:0)+(at?1:0),wt=174-(ct?49:0)-(ut?32:0)+(at?32:0)+(ot?37:0),vt=bufferutils_1$2.BufferWriter.withCapacity(wt);if(vt.writeUInt8(rt),vt.writeInt32(this.version),vt.writeUInt32(this.locktime),vt.writeSlice(dt),vt.writeSlice(pt),vt.writeSlice(mt),vt.writeSlice(gt),ut||ht||vt.writeSlice(bt),vt.writeUInt8(yt),ct){const xt=this.ins[et];vt.writeSlice(xt.hash),vt.writeUInt32(xt.index),vt.writeUInt64(it[et]),vt.writeVarSlice(nt[et]),vt.writeUInt32(xt.sequence)}else vt.writeUInt32(et);if(at){const xt=bufferutils_1$2.BufferWriter.withCapacity(varSliceSize(at));xt.writeVarSlice(at),vt.writeSlice(bcrypto$1.sha256(xt.end()))}return ht&&vt.writeSlice(bt),ot&&(vt.writeSlice(ot),vt.writeUInt8(0),vt.writeUInt32(4294967295)),bcrypto$1.taggedHash("TapSighash",Buffer.concat([Buffer.from([0]),vt.end()]))}hashForWitnessV0(et,nt,it,rt){typeforce$1(types$3.tuple(types$3.UInt32,types$3.Buffer,types$3.Satoshi,types$3.UInt32),arguments);let ot=Buffer.from([]),at,st=ZERO,lt=ZERO,ct=ZERO;if(rt&Transaction.SIGHASH_ANYONECANPAY||(ot=Buffer.allocUnsafe(36*this.ins.length),at=new bufferutils_1$2.BufferWriter(ot,0),this.ins.forEach(ht=>{at.writeSlice(ht.hash),at.writeUInt32(ht.index)}),lt=bcrypto$1.hash256(ot)),!(rt&Transaction.SIGHASH_ANYONECANPAY)&&(rt&31)!==Transaction.SIGHASH_SINGLE&&(rt&31)!==Transaction.SIGHASH_NONE&&(ot=Buffer.allocUnsafe(4*this.ins.length),at=new bufferutils_1$2.BufferWriter(ot,0),this.ins.forEach(ht=>{at.writeUInt32(ht.sequence)}),ct=bcrypto$1.hash256(ot)),(rt&31)!==Transaction.SIGHASH_SINGLE&&(rt&31)!==Transaction.SIGHASH_NONE){const ht=this.outs.reduce((dt,pt)=>dt+8+varSliceSize(pt.script),0);ot=Buffer.allocUnsafe(ht),at=new bufferutils_1$2.BufferWriter(ot,0),this.outs.forEach(dt=>{at.writeUInt64(dt.value),at.writeVarSlice(dt.script)}),st=bcrypto$1.hash256(ot)}else if((rt&31)===Transaction.SIGHASH_SINGLE&&et{rt.writeSlice(at.hash),rt.writeUInt32(at.index),rt.writeVarSlice(at.script),rt.writeUInt32(at.sequence)}),rt.writeVarInt(this.outs.length),this.outs.forEach(at=>{isOutput(at)?rt.writeUInt64(at.value):rt.writeSlice(at.valueBuffer),rt.writeVarSlice(at.script)}),ot&&this.ins.forEach(at=>{rt.writeVector(at.witness)}),rt.writeUInt32(this.locktime),nt!==void 0?et.slice(nt,rt.offset):et}}transaction.Transaction=Transaction;Transaction.DEFAULT_SEQUENCE=4294967295;Transaction.SIGHASH_DEFAULT=0;Transaction.SIGHASH_ALL=1;Transaction.SIGHASH_NONE=2;Transaction.SIGHASH_SINGLE=3;Transaction.SIGHASH_ANYONECANPAY=128;Transaction.SIGHASH_OUTPUT_MASK=3;Transaction.SIGHASH_INPUT_MASK=128;Transaction.ADVANCED_TRANSACTION_MARKER=0;Transaction.ADVANCED_TRANSACTION_FLAG=1;Object.defineProperty(block,"__esModule",{value:!0});block.Block=void 0;const bufferutils_1$1=bufferutils,bcrypto=crypto$2,merkle_1=merkle,transaction_1$3=transaction,types$2=types$7,{typeforce}=types$2,errorMerkleNoTxes=new TypeError("Cannot compute merkle root for zero transactions"),errorWitnessNotSegwit=new TypeError("Cannot compute witness commit for non-segwit block");let Block$1=class Y0{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(et){if(et.length<80)throw new Error("Buffer too small (< 80 bytes)");const nt=new bufferutils_1$1.BufferReader(et),it=new Y0;if(it.version=nt.readInt32(),it.prevHash=nt.readSlice(32),it.merkleRoot=nt.readSlice(32),it.timestamp=nt.readUInt32(),it.bits=nt.readUInt32(),it.nonce=nt.readUInt32(),et.length===80)return it;const rt=()=>{const st=transaction_1$3.Transaction.fromBuffer(nt.buffer.slice(nt.offset),!0);return nt.offset+=st.byteLength(),st},ot=nt.readVarInt();it.transactions=[];for(let st=0;st>24)-3,it=et&8388607,rt=Buffer.alloc(32,0);return rt.writeUIntBE(it,29-nt,3),rt}static calculateMerkleRoot(et,nt){if(typeforce([{getHash:types$2.Function}],et),et.length===0)throw errorMerkleNoTxes;if(nt&&!txesHaveWitnessCommit(et))throw errorWitnessNotSegwit;const it=et.map(ot=>ot.getHash(nt)),rt=(0,merkle_1.fastMerkleRoot)(it,bcrypto.hash256);return nt?bcrypto.hash256(Buffer.concat([rt,et[0].ins[0].witness[0]])):rt}getWitnessCommit(){if(!txesHaveWitnessCommit(this.transactions))return null;const et=this.transactions[0].outs.filter(it=>it.script.slice(0,6).equals(Buffer.from("6a24aa21a9ed","hex"))).map(it=>it.script.slice(6,38));if(et.length===0)return null;const nt=et[et.length-1];return nt instanceof Buffer&&nt.length===32?nt:null}hasWitnessCommit(){return this.witnessCommit instanceof Buffer&&this.witnessCommit.length===32||this.getWitnessCommit()!==null}hasWitness(){return anyTxHasWitness(this.transactions)}weight(){const et=this.byteLength(!1,!1),nt=this.byteLength(!1,!0);return et*3+nt}byteLength(et,nt=!0){return et||!this.transactions?80:80+bufferutils_1$1.varuint.encodingLength(this.transactions.length)+this.transactions.reduce((it,rt)=>it+rt.byteLength(nt),0)}getHash(){return bcrypto.hash256(this.toBuffer(!0))}getId(){return(0,bufferutils_1$1.reverseBuffer)(this.getHash()).toString("hex")}getUTCDate(){const et=new Date(0);return et.setUTCSeconds(this.timestamp),et}toBuffer(et){const nt=Buffer.allocUnsafe(this.byteLength(et)),it=new bufferutils_1$1.BufferWriter(nt);return it.writeInt32(this.version),it.writeSlice(this.prevHash),it.writeSlice(this.merkleRoot),it.writeUInt32(this.timestamp),it.writeUInt32(this.bits),it.writeUInt32(this.nonce),et||!this.transactions||(bufferutils_1$1.varuint.encode(this.transactions.length,nt,it.offset),it.offset+=bufferutils_1$1.varuint.encode.bytes,this.transactions.forEach(rt=>{const ot=rt.byteLength();rt.toBuffer(nt,it.offset),it.offset+=ot})),nt}toHex(et){return this.toBuffer(et).toString("hex")}checkTxRoots(){const et=this.hasWitnessCommit();return!et&&this.hasWitness()?!1:this.__checkMerkleRoot()&&(et?this.__checkWitnessCommit():!0)}checkProofOfWork(){const et=(0,bufferutils_1$1.reverseBuffer)(this.getHash()),nt=Y0.calculateTarget(this.bits);return et.compare(nt)<=0}__checkMerkleRoot(){if(!this.transactions)throw errorMerkleNoTxes;const et=Y0.calculateMerkleRoot(this.transactions);return this.merkleRoot.compare(et)===0}__checkWitnessCommit(){if(!this.transactions)throw errorMerkleNoTxes;if(!this.hasWitnessCommit())throw errorWitnessNotSegwit;const et=Y0.calculateMerkleRoot(this.transactions,!0);return this.witnessCommit.compare(et)===0}};block.Block=Block$1;function txesHaveWitnessCommit(tt){return tt instanceof Array&&tt[0]&&tt[0].ins&&tt[0].ins instanceof Array&&tt[0].ins[0]&&tt[0].ins[0].witness&&tt[0].ins[0].witness instanceof Array&&tt[0].ins[0].witness.length>0}function anyTxHasWitness(tt){return tt instanceof Array&&tt.some(et=>typeof et=="object"&&et.ins instanceof Array&&et.ins.some(nt=>typeof nt=="object"&&nt.witness instanceof Array&&nt.witness.length>0))}var psbt$1={},psbt={},combiner={},parser$1={},fromBuffer={},converter={},typeFields={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),function(et){et[et.UNSIGNED_TX=0]="UNSIGNED_TX",et[et.GLOBAL_XPUB=1]="GLOBAL_XPUB"}(tt.GlobalTypes||(tt.GlobalTypes={})),tt.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],function(et){et[et.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",et[et.WITNESS_UTXO=1]="WITNESS_UTXO",et[et.PARTIAL_SIG=2]="PARTIAL_SIG",et[et.SIGHASH_TYPE=3]="SIGHASH_TYPE",et[et.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",et[et.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",et[et.BIP32_DERIVATION=6]="BIP32_DERIVATION",et[et.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",et[et.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",et[et.POR_COMMITMENT=9]="POR_COMMITMENT",et[et.TAP_KEY_SIG=19]="TAP_KEY_SIG",et[et.TAP_SCRIPT_SIG=20]="TAP_SCRIPT_SIG",et[et.TAP_LEAF_SCRIPT=21]="TAP_LEAF_SCRIPT",et[et.TAP_BIP32_DERIVATION=22]="TAP_BIP32_DERIVATION",et[et.TAP_INTERNAL_KEY=23]="TAP_INTERNAL_KEY",et[et.TAP_MERKLE_ROOT=24]="TAP_MERKLE_ROOT"}(tt.InputTypes||(tt.InputTypes={})),tt.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment","tapKeySig","tapScriptSig","tapLeafScript","tapBip32Derivation","tapInternalKey","tapMerkleRoot"],function(et){et[et.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",et[et.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",et[et.BIP32_DERIVATION=2]="BIP32_DERIVATION",et[et.TAP_INTERNAL_KEY=5]="TAP_INTERNAL_KEY",et[et.TAP_TREE=6]="TAP_TREE",et[et.TAP_BIP32_DERIVATION=7]="TAP_BIP32_DERIVATION"}(tt.OutputTypes||(tt.OutputTypes={})),tt.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation","tapInternalKey","tapTree","tapBip32Derivation"]})(typeFields);var globalXpub$1={};Object.defineProperty(globalXpub$1,"__esModule",{value:!0});const typeFields_1$g=typeFields,range$7=tt=>[...Array(tt).keys()];function decode$i(tt){if(tt.key[0]!==typeFields_1$g.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+tt.key.toString("hex"));if(tt.key.length!==79||![2,3].includes(tt.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+tt.key.toString("hex"));if(tt.value.length/4%1!==0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const et=tt.key.slice(1),nt={masterFingerprint:tt.value.slice(0,4),extendedPubkey:et,path:"m"};for(const it of range$7(tt.value.length/4-1)){const rt=tt.value.readUInt32LE(it*4+4),ot=!!(rt&2147483648),at=rt&2147483647;nt.path+="/"+at.toString(10)+(ot?"'":"")}return nt}globalXpub$1.decode=decode$i;function encode$i(tt){const et=Buffer.from([typeFields_1$g.GlobalTypes.GLOBAL_XPUB]),nt=Buffer.concat([et,tt.extendedPubkey]),it=tt.path.split("/"),rt=Buffer.allocUnsafe(it.length*4);tt.masterFingerprint.copy(rt,0);let ot=4;return it.slice(1).forEach(at=>{const st=at.slice(-1)==="'";let lt=2147483647&parseInt(st?at.slice(0,-1):at,10);st&&(lt+=2147483648),rt.writeUInt32LE(lt,ot),ot+=4}),{key:nt,value:rt}}globalXpub$1.encode=encode$i;globalXpub$1.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }";function check$c(tt){const et=tt.extendedPubkey,nt=tt.masterFingerprint,it=tt.path;return Buffer.isBuffer(et)&&et.length===78&&[2,3].indexOf(et[45])>-1&&Buffer.isBuffer(nt)&&nt.length===4&&typeof it=="string"&&!!it.match(/^m(\/\d+'?)*$/)}globalXpub$1.check=check$c;function canAddToArray$3(tt,et,nt){const it=et.extendedPubkey.toString("hex");return nt.has(it)?!1:(nt.add(it),tt.filter(rt=>rt.extendedPubkey.equals(et.extendedPubkey)).length===0)}globalXpub$1.canAddToArray=canAddToArray$3;var unsignedTx$1={};Object.defineProperty(unsignedTx$1,"__esModule",{value:!0});const typeFields_1$f=typeFields;function encode$h(tt){return{key:Buffer.from([typeFields_1$f.GlobalTypes.UNSIGNED_TX]),value:tt.toBuffer()}}unsignedTx$1.encode=encode$h;var finalScriptSig$1={};Object.defineProperty(finalScriptSig$1,"__esModule",{value:!0});const typeFields_1$e=typeFields;function decode$h(tt){if(tt.key[0]!==typeFields_1$e.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+tt.key.toString("hex"));return tt.value}finalScriptSig$1.decode=decode$h;function encode$g(tt){return{key:Buffer.from([typeFields_1$e.InputTypes.FINAL_SCRIPTSIG]),value:tt}}finalScriptSig$1.encode=encode$g;finalScriptSig$1.expected="Buffer";function check$b(tt){return Buffer.isBuffer(tt)}finalScriptSig$1.check=check$b;function canAdd$8(tt,et){return!!tt&&!!et&&tt.finalScriptSig===void 0}finalScriptSig$1.canAdd=canAdd$8;var finalScriptWitness$1={};Object.defineProperty(finalScriptWitness$1,"__esModule",{value:!0});const typeFields_1$d=typeFields;function decode$g(tt){if(tt.key[0]!==typeFields_1$d.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+tt.key.toString("hex"));return tt.value}finalScriptWitness$1.decode=decode$g;function encode$f(tt){return{key:Buffer.from([typeFields_1$d.InputTypes.FINAL_SCRIPTWITNESS]),value:tt}}finalScriptWitness$1.encode=encode$f;finalScriptWitness$1.expected="Buffer";function check$a(tt){return Buffer.isBuffer(tt)}finalScriptWitness$1.check=check$a;function canAdd$7(tt,et){return!!tt&&!!et&&tt.finalScriptWitness===void 0}finalScriptWitness$1.canAdd=canAdd$7;var nonWitnessUtxo$1={};Object.defineProperty(nonWitnessUtxo$1,"__esModule",{value:!0});const typeFields_1$c=typeFields;function decode$f(tt){if(tt.key[0]!==typeFields_1$c.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+tt.key.toString("hex"));return tt.value}nonWitnessUtxo$1.decode=decode$f;function encode$e(tt){return{key:Buffer.from([typeFields_1$c.InputTypes.NON_WITNESS_UTXO]),value:tt}}nonWitnessUtxo$1.encode=encode$e;nonWitnessUtxo$1.expected="Buffer";function check$9(tt){return Buffer.isBuffer(tt)}nonWitnessUtxo$1.check=check$9;function canAdd$6(tt,et){return!!tt&&!!et&&tt.nonWitnessUtxo===void 0}nonWitnessUtxo$1.canAdd=canAdd$6;var partialSig$1={};Object.defineProperty(partialSig$1,"__esModule",{value:!0});const typeFields_1$b=typeFields;function decode$e(tt){if(tt.key[0]!==typeFields_1$b.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+tt.key.toString("hex"));if(!(tt.key.length===34||tt.key.length===66)||![2,3,4].includes(tt.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+tt.key.toString("hex"));return{pubkey:tt.key.slice(1),signature:tt.value}}partialSig$1.decode=decode$e;function encode$d(tt){const et=Buffer.from([typeFields_1$b.InputTypes.PARTIAL_SIG]);return{key:Buffer.concat([et,tt.pubkey]),value:tt.signature}}partialSig$1.encode=encode$d;partialSig$1.expected="{ pubkey: Buffer; signature: Buffer; }";function check$8(tt){return Buffer.isBuffer(tt.pubkey)&&Buffer.isBuffer(tt.signature)&&[33,65].includes(tt.pubkey.length)&&[2,3,4].includes(tt.pubkey[0])&&isDerSigWithSighash(tt.signature)}partialSig$1.check=check$8;function isDerSigWithSighash(tt){if(!Buffer.isBuffer(tt)||tt.length<9||tt[0]!==48||tt.length!==tt[1]+3||tt[2]!==2)return!1;const et=tt[3];if(et>33||et<1||tt[3+et+1]!==2)return!1;const nt=tt[3+et+2];return!(nt>33||nt<1||tt.length!==3+et+2+nt+2)}function canAddToArray$2(tt,et,nt){const it=et.pubkey.toString("hex");return nt.has(it)?!1:(nt.add(it),tt.filter(rt=>rt.pubkey.equals(et.pubkey)).length===0)}partialSig$1.canAddToArray=canAddToArray$2;var porCommitment$1={};Object.defineProperty(porCommitment$1,"__esModule",{value:!0});const typeFields_1$a=typeFields;function decode$d(tt){if(tt.key[0]!==typeFields_1$a.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+tt.key.toString("hex"));return tt.value.toString("utf8")}porCommitment$1.decode=decode$d;function encode$c(tt){return{key:Buffer.from([typeFields_1$a.InputTypes.POR_COMMITMENT]),value:Buffer.from(tt,"utf8")}}porCommitment$1.encode=encode$c;porCommitment$1.expected="string";function check$7(tt){return typeof tt=="string"}porCommitment$1.check=check$7;function canAdd$5(tt,et){return!!tt&&!!et&&tt.porCommitment===void 0}porCommitment$1.canAdd=canAdd$5;var sighashType$1={};Object.defineProperty(sighashType$1,"__esModule",{value:!0});const typeFields_1$9=typeFields;function decode$c(tt){if(tt.key[0]!==typeFields_1$9.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+tt.key.toString("hex"));return tt.value.readUInt32LE(0)}sighashType$1.decode=decode$c;function encode$b(tt){const et=Buffer.from([typeFields_1$9.InputTypes.SIGHASH_TYPE]),nt=Buffer.allocUnsafe(4);return nt.writeUInt32LE(tt,0),{key:et,value:nt}}sighashType$1.encode=encode$b;sighashType$1.expected="number";function check$6(tt){return typeof tt=="number"}sighashType$1.check=check$6;function canAdd$4(tt,et){return!!tt&&!!et&&tt.sighashType===void 0}sighashType$1.canAdd=canAdd$4;var tapKeySig$1={};Object.defineProperty(tapKeySig$1,"__esModule",{value:!0});const typeFields_1$8=typeFields;function decode$b(tt){if(tt.key[0]!==typeFields_1$8.InputTypes.TAP_KEY_SIG||tt.key.length!==1)throw new Error("Decode Error: could not decode tapKeySig with key 0x"+tt.key.toString("hex"));if(!check$5(tt.value))throw new Error("Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature");return tt.value}tapKeySig$1.decode=decode$b;function encode$a(tt){return{key:Buffer.from([typeFields_1$8.InputTypes.TAP_KEY_SIG]),value:tt}}tapKeySig$1.encode=encode$a;tapKeySig$1.expected="Buffer";function check$5(tt){return Buffer.isBuffer(tt)&&(tt.length===64||tt.length===65)}tapKeySig$1.check=check$5;function canAdd$3(tt,et){return!!tt&&!!et&&tt.tapKeySig===void 0}tapKeySig$1.canAdd=canAdd$3;var tapLeafScript$1={};Object.defineProperty(tapLeafScript$1,"__esModule",{value:!0});const typeFields_1$7=typeFields;function decode$a(tt){if(tt.key[0]!==typeFields_1$7.InputTypes.TAP_LEAF_SCRIPT)throw new Error("Decode Error: could not decode tapLeafScript with key 0x"+tt.key.toString("hex"));if((tt.key.length-2)%32!==0)throw new Error("Decode Error: tapLeafScript has invalid control block in key 0x"+tt.key.toString("hex"));const et=tt.value[tt.value.length-1];if((tt.key[1]&254)!==et)throw new Error("Decode Error: tapLeafScript bad leaf version in key 0x"+tt.key.toString("hex"));const nt=tt.value.slice(0,-1);return{controlBlock:tt.key.slice(1),script:nt,leafVersion:et}}tapLeafScript$1.decode=decode$a;function encode$9(tt){const et=Buffer.from([typeFields_1$7.InputTypes.TAP_LEAF_SCRIPT]),nt=Buffer.from([tt.leafVersion]);return{key:Buffer.concat([et,tt.controlBlock]),value:Buffer.concat([tt.script,nt])}}tapLeafScript$1.encode=encode$9;tapLeafScript$1.expected="{ controlBlock: Buffer; leafVersion: number, script: Buffer; }";function check$4(tt){return Buffer.isBuffer(tt.controlBlock)&&(tt.controlBlock.length-1)%32===0&&(tt.controlBlock[0]&254)===tt.leafVersion&&Buffer.isBuffer(tt.script)}tapLeafScript$1.check=check$4;function canAddToArray$1(tt,et,nt){const it=et.controlBlock.toString("hex");return nt.has(it)?!1:(nt.add(it),tt.filter(rt=>rt.controlBlock.equals(et.controlBlock)).length===0)}tapLeafScript$1.canAddToArray=canAddToArray$1;var tapMerkleRoot$1={};Object.defineProperty(tapMerkleRoot$1,"__esModule",{value:!0});const typeFields_1$6=typeFields;function decode$9(tt){if(tt.key[0]!==typeFields_1$6.InputTypes.TAP_MERKLE_ROOT||tt.key.length!==1)throw new Error("Decode Error: could not decode tapMerkleRoot with key 0x"+tt.key.toString("hex"));if(!check$3(tt.value))throw new Error("Decode Error: tapMerkleRoot not a 32-byte hash");return tt.value}tapMerkleRoot$1.decode=decode$9;function encode$8(tt){return{key:Buffer.from([typeFields_1$6.InputTypes.TAP_MERKLE_ROOT]),value:tt}}tapMerkleRoot$1.encode=encode$8;tapMerkleRoot$1.expected="Buffer";function check$3(tt){return Buffer.isBuffer(tt)&&tt.length===32}tapMerkleRoot$1.check=check$3;function canAdd$2(tt,et){return!!tt&&!!et&&tt.tapMerkleRoot===void 0}tapMerkleRoot$1.canAdd=canAdd$2;var tapScriptSig$1={};Object.defineProperty(tapScriptSig$1,"__esModule",{value:!0});const typeFields_1$5=typeFields;function decode$8(tt){if(tt.key[0]!==typeFields_1$5.InputTypes.TAP_SCRIPT_SIG)throw new Error("Decode Error: could not decode tapScriptSig with key 0x"+tt.key.toString("hex"));if(tt.key.length!==65)throw new Error("Decode Error: tapScriptSig has invalid key 0x"+tt.key.toString("hex"));if(tt.value.length!==64&&tt.value.length!==65)throw new Error("Decode Error: tapScriptSig has invalid signature in key 0x"+tt.key.toString("hex"));const et=tt.key.slice(1,33),nt=tt.key.slice(33);return{pubkey:et,leafHash:nt,signature:tt.value}}tapScriptSig$1.decode=decode$8;function encode$7(tt){const et=Buffer.from([typeFields_1$5.InputTypes.TAP_SCRIPT_SIG]);return{key:Buffer.concat([et,tt.pubkey,tt.leafHash]),value:tt.signature}}tapScriptSig$1.encode=encode$7;tapScriptSig$1.expected="{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }";function check$2(tt){return Buffer.isBuffer(tt.pubkey)&&Buffer.isBuffer(tt.leafHash)&&Buffer.isBuffer(tt.signature)&&tt.pubkey.length===32&&tt.leafHash.length===32&&(tt.signature.length===64||tt.signature.length===65)}tapScriptSig$1.check=check$2;function canAddToArray(tt,et,nt){const it=et.pubkey.toString("hex")+et.leafHash.toString("hex");return nt.has(it)?!1:(nt.add(it),tt.filter(rt=>rt.pubkey.equals(et.pubkey)&&rt.leafHash.equals(et.leafHash)).length===0)}tapScriptSig$1.canAddToArray=canAddToArray;var witnessUtxo$1={},tools={},varint={};Object.defineProperty(varint,"__esModule",{value:!0});const MAX_SAFE_INTEGER$3=9007199254740991;function checkUInt53(tt){if(tt<0||tt>MAX_SAFE_INTEGER$3||tt%1!==0)throw new RangeError("value out of range")}function encode$6(tt,et,nt){if(checkUInt53(tt),et||(et=Buffer.allocUnsafe(encodingLength(tt))),!Buffer.isBuffer(et))throw new TypeError("buffer must be a Buffer instance");return nt||(nt=0),tt<253?(et.writeUInt8(tt,nt),Object.assign(encode$6,{bytes:1})):tt<=65535?(et.writeUInt8(253,nt),et.writeUInt16LE(tt,nt+1),Object.assign(encode$6,{bytes:3})):tt<=4294967295?(et.writeUInt8(254,nt),et.writeUInt32LE(tt,nt+1),Object.assign(encode$6,{bytes:5})):(et.writeUInt8(255,nt),et.writeUInt32LE(tt>>>0,nt+1),et.writeUInt32LE(tt/4294967296|0,nt+5),Object.assign(encode$6,{bytes:9})),et}varint.encode=encode$6;function decode$7(tt,et){if(!Buffer.isBuffer(tt))throw new TypeError("buffer must be a Buffer instance");et||(et=0);const nt=tt.readUInt8(et);if(nt<253)return Object.assign(decode$7,{bytes:1}),nt;if(nt===253)return Object.assign(decode$7,{bytes:3}),tt.readUInt16LE(et+1);if(nt===254)return Object.assign(decode$7,{bytes:5}),tt.readUInt32LE(et+1);{Object.assign(decode$7,{bytes:9});const it=tt.readUInt32LE(et+1),ot=tt.readUInt32LE(et+5)*4294967296+it;return checkUInt53(ot),ot}}varint.decode=decode$7;function encodingLength(tt){return checkUInt53(tt),tt<253?1:tt<=65535?3:tt<=4294967295?5:9}varint.encodingLength=encodingLength;Object.defineProperty(tools,"__esModule",{value:!0});const varuint$6=varint;tools.range=tt=>[...Array(tt).keys()];function reverseBuffer(tt){if(tt.length<1)return tt;let et=tt.length-1,nt=0;for(let it=0;itet)throw new Error("RangeError: value out of range");if(Math.floor(tt)!==tt)throw new Error("value has a fractional component")}function readUInt64LE(tt,et){const nt=tt.readUInt32LE(et);let it=tt.readUInt32LE(et+4);return it*=4294967296,verifuint(it+nt,9007199254740991),it+nt}tools.readUInt64LE=readUInt64LE;function writeUInt64LE(tt,et,nt){return verifuint(et,9007199254740991),tt.writeInt32LE(et&-1,nt),tt.writeUInt32LE(Math.floor(et/4294967296),nt+4),nt+8}tools.writeUInt64LE=writeUInt64LE;Object.defineProperty(witnessUtxo$1,"__esModule",{value:!0});const typeFields_1$4=typeFields,tools_1$2=tools,varuint$5=varint;function decode$6(tt){if(tt.key[0]!==typeFields_1$4.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+tt.key.toString("hex"));const et=tools_1$2.readUInt64LE(tt.value,0);let nt=8;const it=varuint$5.decode(tt.value,nt);nt+=varuint$5.encodingLength(it);const rt=tt.value.slice(nt);if(rt.length!==it)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:rt,value:et}}witnessUtxo$1.decode=decode$6;function encode$5(tt){const{script:et,value:nt}=tt,it=varuint$5.encodingLength(et.length),rt=Buffer.allocUnsafe(8+it+et.length);return tools_1$2.writeUInt64LE(rt,nt,0),varuint$5.encode(et.length,rt,8),et.copy(rt,8+it),{key:Buffer.from([typeFields_1$4.InputTypes.WITNESS_UTXO]),value:rt}}witnessUtxo$1.encode=encode$5;witnessUtxo$1.expected="{ script: Buffer; value: number; }";function check$1(tt){return Buffer.isBuffer(tt.script)&&typeof tt.value=="number"}witnessUtxo$1.check=check$1;function canAdd$1(tt,et){return!!tt&&!!et&&tt.witnessUtxo===void 0}witnessUtxo$1.canAdd=canAdd$1;var tapTree$1={};Object.defineProperty(tapTree$1,"__esModule",{value:!0});const typeFields_1$3=typeFields,varuint$4=varint;function decode$5(tt){if(tt.key[0]!==typeFields_1$3.OutputTypes.TAP_TREE||tt.key.length!==1)throw new Error("Decode Error: could not decode tapTree with key 0x"+tt.key.toString("hex"));let et=0;const nt=[];for(;et[Buffer.of(it.depth,it.leafVersion),varuint$4.encode(it.script.length),it.script]));return{key:et,value:Buffer.concat(nt)}}tapTree$1.encode=encode$4;tapTree$1.expected="{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }";function check(tt){return Array.isArray(tt.leaves)&&tt.leaves.every(et=>et.depth>=0&&et.depth<=128&&(et.leafVersion&254)===et.leafVersion&&Buffer.isBuffer(et.script))}tapTree$1.check=check;function canAdd(tt,et){return!!tt&&!!et&&tt.tapTree===void 0}tapTree$1.canAdd=canAdd;var bip32Derivation$2={};Object.defineProperty(bip32Derivation$2,"__esModule",{value:!0});const range$6=tt=>[...Array(tt).keys()],isValidDERKey=tt=>tt.length===33&&[2,3].includes(tt[0])||tt.length===65&&tt[0]===4;function makeConverter$4(tt,et=isValidDERKey){function nt(st){if(st.key[0]!==tt)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+st.key.toString("hex"));const lt=st.key.slice(1);if(!et(lt))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+st.key.toString("hex"));if(st.value.length/4%1!==0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const ct={masterFingerprint:st.value.slice(0,4),pubkey:lt,path:"m"};for(const ut of range$6(st.value.length/4-1)){const ht=st.value.readUInt32LE(ut*4+4),dt=!!(ht&2147483648),pt=ht&2147483647;ct.path+="/"+pt.toString(10)+(dt?"'":"")}return ct}function it(st){const lt=Buffer.from([tt]),ct=Buffer.concat([lt,st.pubkey]),ut=st.path.split("/"),ht=Buffer.allocUnsafe(ut.length*4);st.masterFingerprint.copy(ht,0);let dt=4;return ut.slice(1).forEach(pt=>{const mt=pt.slice(-1)==="'";let gt=2147483647&parseInt(mt?pt.slice(0,-1):pt,10);mt&&(gt+=2147483648),ht.writeUInt32LE(gt,dt),dt+=4}),{key:ct,value:ht}}const rt="{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }";function ot(st){return Buffer.isBuffer(st.pubkey)&&Buffer.isBuffer(st.masterFingerprint)&&typeof st.path=="string"&&et(st.pubkey)&&st.masterFingerprint.length===4}function at(st,lt,ct){const ut=lt.pubkey.toString("hex");return ct.has(ut)?!1:(ct.add(ut),st.filter(ht=>ht.pubkey.equals(lt.pubkey)).length===0)}return{decode:nt,encode:it,check:ot,expected:rt,canAddToArray:at}}bip32Derivation$2.makeConverter=makeConverter$4;var checkPubkey$1={};Object.defineProperty(checkPubkey$1,"__esModule",{value:!0});function makeChecker(tt){return et;function et(nt){let it;if(tt.includes(nt.key[0])&&(it=nt.key.slice(1),!(it.length===33||it.length===65)||![2,3,4].includes(it[0])))throw new Error("Format Error: invalid pubkey in key 0x"+nt.key.toString("hex"));return it}}checkPubkey$1.makeChecker=makeChecker;var redeemScript$1={};Object.defineProperty(redeemScript$1,"__esModule",{value:!0});function makeConverter$3(tt){function et(at){if(at.key[0]!==tt)throw new Error("Decode Error: could not decode redeemScript with key 0x"+at.key.toString("hex"));return at.value}function nt(at){return{key:Buffer.from([tt]),value:at}}const it="Buffer";function rt(at){return Buffer.isBuffer(at)}function ot(at,st){return!!at&&!!st&&at.redeemScript===void 0}return{decode:et,encode:nt,check:rt,expected:it,canAdd:ot}}redeemScript$1.makeConverter=makeConverter$3;var tapBip32Derivation$1={};Object.defineProperty(tapBip32Derivation$1,"__esModule",{value:!0});const varuint$3=varint,bip32Derivation$1=bip32Derivation$2,isValidBIP340Key=tt=>tt.length===32;function makeConverter$2(tt){const et=bip32Derivation$1.makeConverter(tt,isValidBIP340Key);function nt(at){const st=varuint$3.decode(at.value),lt=varuint$3.encodingLength(st),ct=et.decode({key:at.key,value:at.value.slice(lt+st*32)}),ut=new Array(st);for(let ht=0,dt=lt;htBuffer.isBuffer(st)&&st.length===32)&&et.check(at)}return{decode:nt,encode:it,check:ot,expected:rt,canAddToArray:et.canAddToArray}}tapBip32Derivation$1.makeConverter=makeConverter$2;var tapInternalKey$1={};Object.defineProperty(tapInternalKey$1,"__esModule",{value:!0});function makeConverter$1(tt){function et(at){if(at.key[0]!==tt||at.key.length!==1)throw new Error("Decode Error: could not decode tapInternalKey with key 0x"+at.key.toString("hex"));if(at.value.length!==32)throw new Error("Decode Error: tapInternalKey not a 32-byte x-only pubkey");return at.value}function nt(at){return{key:Buffer.from([tt]),value:at}}const it="Buffer";function rt(at){return Buffer.isBuffer(at)&&at.length===32}function ot(at,st){return!!at&&!!st&&at.tapInternalKey===void 0}return{decode:et,encode:nt,check:rt,expected:it,canAdd:ot}}tapInternalKey$1.makeConverter=makeConverter$1;var witnessScript$1={};Object.defineProperty(witnessScript$1,"__esModule",{value:!0});function makeConverter(tt){function et(at){if(at.key[0]!==tt)throw new Error("Decode Error: could not decode witnessScript with key 0x"+at.key.toString("hex"));return at.value}function nt(at){return{key:Buffer.from([tt]),value:at}}const it="Buffer";function rt(at){return Buffer.isBuffer(at)}function ot(at,st){return!!at&&!!st&&at.witnessScript===void 0}return{decode:et,encode:nt,check:rt,expected:it,canAdd:ot}}witnessScript$1.makeConverter=makeConverter;Object.defineProperty(converter,"__esModule",{value:!0});const typeFields_1$2=typeFields,globalXpub=globalXpub$1,unsignedTx=unsignedTx$1,finalScriptSig=finalScriptSig$1,finalScriptWitness=finalScriptWitness$1,nonWitnessUtxo=nonWitnessUtxo$1,partialSig=partialSig$1,porCommitment=porCommitment$1,sighashType=sighashType$1,tapKeySig=tapKeySig$1,tapLeafScript=tapLeafScript$1,tapMerkleRoot=tapMerkleRoot$1,tapScriptSig=tapScriptSig$1,witnessUtxo=witnessUtxo$1,tapTree=tapTree$1,bip32Derivation=bip32Derivation$2,checkPubkey=checkPubkey$1,redeemScript=redeemScript$1,tapBip32Derivation=tapBip32Derivation$1,tapInternalKey=tapInternalKey$1,witnessScript=witnessScript$1,globals={unsignedTx,globalXpub,checkPubkey:checkPubkey.makeChecker([])};converter.globals=globals;const inputs={nonWitnessUtxo,partialSig,sighashType,finalScriptSig,finalScriptWitness,porCommitment,witnessUtxo,bip32Derivation:bip32Derivation.makeConverter(typeFields_1$2.InputTypes.BIP32_DERIVATION),redeemScript:redeemScript.makeConverter(typeFields_1$2.InputTypes.REDEEM_SCRIPT),witnessScript:witnessScript.makeConverter(typeFields_1$2.InputTypes.WITNESS_SCRIPT),checkPubkey:checkPubkey.makeChecker([typeFields_1$2.InputTypes.PARTIAL_SIG,typeFields_1$2.InputTypes.BIP32_DERIVATION]),tapKeySig,tapScriptSig,tapLeafScript,tapBip32Derivation:tapBip32Derivation.makeConverter(typeFields_1$2.InputTypes.TAP_BIP32_DERIVATION),tapInternalKey:tapInternalKey.makeConverter(typeFields_1$2.InputTypes.TAP_INTERNAL_KEY),tapMerkleRoot};converter.inputs=inputs;const outputs={bip32Derivation:bip32Derivation.makeConverter(typeFields_1$2.OutputTypes.BIP32_DERIVATION),redeemScript:redeemScript.makeConverter(typeFields_1$2.OutputTypes.REDEEM_SCRIPT),witnessScript:witnessScript.makeConverter(typeFields_1$2.OutputTypes.WITNESS_SCRIPT),checkPubkey:checkPubkey.makeChecker([typeFields_1$2.OutputTypes.BIP32_DERIVATION]),tapBip32Derivation:tapBip32Derivation.makeConverter(typeFields_1$2.OutputTypes.TAP_BIP32_DERIVATION),tapTree,tapInternalKey:tapInternalKey.makeConverter(typeFields_1$2.OutputTypes.TAP_INTERNAL_KEY)};converter.outputs=outputs;Object.defineProperty(fromBuffer,"__esModule",{value:!0});const convert$3=converter,tools_1$1=tools,varuint$2=varint,typeFields_1$1=typeFields;function psbtFromBuffer(tt,et){let nt=0;function it(){const bt=varuint$2.decode(tt,nt);nt+=varuint$2.encodingLength(bt);const yt=tt.slice(nt,nt+bt);return nt+=bt,yt}function rt(){const bt=tt.readUInt32BE(nt);return nt+=4,bt}function ot(){const bt=tt.readUInt8(nt);return nt+=1,bt}function at(){const bt=it(),yt=it();return{key:bt,value:yt}}function st(){if(nt>=tt.length)throw new Error("Format Error: Unexpected End of PSBT");const bt=tt.readUInt8(nt)===0;return bt&&nt++,bt}if(rt()!==1886610036)throw new Error("Format Error: Invalid Magic Number");if(ot()!==255)throw new Error("Format Error: Magic Number must be followed by 0xff separator");const lt=[],ct={};for(;!st();){const bt=at(),yt=bt.key.toString("hex");if(ct[yt])throw new Error("Format Error: Keys must be unique for global keymap: key "+yt);ct[yt]=1,lt.push(bt)}const ut=lt.filter(bt=>bt.key[0]===typeFields_1$1.GlobalTypes.UNSIGNED_TX);if(ut.length!==1)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const ht=et(ut[0].value),{inputCount:dt,outputCount:pt}=ht.getInputOutputCounts(),mt=[],gt=[];for(const bt of tools_1$1.range(dt)){const yt={},wt=[];for(;!st();){const vt=at(),xt=vt.key.toString("hex");if(yt[xt])throw new Error("Format Error: Keys must be unique for each input: input index "+bt+" key "+xt);yt[xt]=1,wt.push(vt)}mt.push(wt)}for(const bt of tools_1$1.range(pt)){const yt={},wt=[];for(;!st();){const vt=at(),xt=vt.key.toString("hex");if(yt[xt])throw new Error("Format Error: Keys must be unique for each output: output index "+bt+" key "+xt);yt[xt]=1,wt.push(vt)}gt.push(wt)}return psbtFromKeyVals(ht,{globalMapKeyVals:lt,inputKeyVals:mt,outputKeyVals:gt})}fromBuffer.psbtFromBuffer=psbtFromBuffer;function checkKeyBuffer(tt,et,nt){if(!et.equals(Buffer.from([nt])))throw new Error(`Format Error: Invalid ${tt} key: ${et.toString("hex")}`)}fromBuffer.checkKeyBuffer=checkKeyBuffer;function psbtFromKeyVals(tt,{globalMapKeyVals:et,inputKeyVals:nt,outputKeyVals:it}){const rt={unsignedTx:tt};let ot=0;for(const ut of et)switch(ut.key[0]){case typeFields_1$1.GlobalTypes.UNSIGNED_TX:if(checkKeyBuffer("global",ut.key,typeFields_1$1.GlobalTypes.UNSIGNED_TX),ot>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");ot++;break;case typeFields_1$1.GlobalTypes.GLOBAL_XPUB:rt.globalXpub===void 0&&(rt.globalXpub=[]),rt.globalXpub.push(convert$3.globals.globalXpub.decode(ut));break;default:rt.unknownKeyVals||(rt.unknownKeyVals=[]),rt.unknownKeyVals.push(ut)}const at=nt.length,st=it.length,lt=[],ct=[];for(const ut of tools_1$1.range(at)){const ht={};for(const dt of nt[ut])switch(convert$3.inputs.checkPubkey(dt),dt.key[0]){case typeFields_1$1.InputTypes.NON_WITNESS_UTXO:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.NON_WITNESS_UTXO),ht.nonWitnessUtxo!==void 0)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");ht.nonWitnessUtxo=convert$3.inputs.nonWitnessUtxo.decode(dt);break;case typeFields_1$1.InputTypes.WITNESS_UTXO:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.WITNESS_UTXO),ht.witnessUtxo!==void 0)throw new Error("Format Error: Input has multiple WITNESS_UTXO");ht.witnessUtxo=convert$3.inputs.witnessUtxo.decode(dt);break;case typeFields_1$1.InputTypes.PARTIAL_SIG:ht.partialSig===void 0&&(ht.partialSig=[]),ht.partialSig.push(convert$3.inputs.partialSig.decode(dt));break;case typeFields_1$1.InputTypes.SIGHASH_TYPE:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.SIGHASH_TYPE),ht.sighashType!==void 0)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");ht.sighashType=convert$3.inputs.sighashType.decode(dt);break;case typeFields_1$1.InputTypes.REDEEM_SCRIPT:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.REDEEM_SCRIPT),ht.redeemScript!==void 0)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");ht.redeemScript=convert$3.inputs.redeemScript.decode(dt);break;case typeFields_1$1.InputTypes.WITNESS_SCRIPT:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.WITNESS_SCRIPT),ht.witnessScript!==void 0)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");ht.witnessScript=convert$3.inputs.witnessScript.decode(dt);break;case typeFields_1$1.InputTypes.BIP32_DERIVATION:ht.bip32Derivation===void 0&&(ht.bip32Derivation=[]),ht.bip32Derivation.push(convert$3.inputs.bip32Derivation.decode(dt));break;case typeFields_1$1.InputTypes.FINAL_SCRIPTSIG:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.FINAL_SCRIPTSIG),ht.finalScriptSig=convert$3.inputs.finalScriptSig.decode(dt);break;case typeFields_1$1.InputTypes.FINAL_SCRIPTWITNESS:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.FINAL_SCRIPTWITNESS),ht.finalScriptWitness=convert$3.inputs.finalScriptWitness.decode(dt);break;case typeFields_1$1.InputTypes.POR_COMMITMENT:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.POR_COMMITMENT),ht.porCommitment=convert$3.inputs.porCommitment.decode(dt);break;case typeFields_1$1.InputTypes.TAP_KEY_SIG:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.TAP_KEY_SIG),ht.tapKeySig=convert$3.inputs.tapKeySig.decode(dt);break;case typeFields_1$1.InputTypes.TAP_SCRIPT_SIG:ht.tapScriptSig===void 0&&(ht.tapScriptSig=[]),ht.tapScriptSig.push(convert$3.inputs.tapScriptSig.decode(dt));break;case typeFields_1$1.InputTypes.TAP_LEAF_SCRIPT:ht.tapLeafScript===void 0&&(ht.tapLeafScript=[]),ht.tapLeafScript.push(convert$3.inputs.tapLeafScript.decode(dt));break;case typeFields_1$1.InputTypes.TAP_BIP32_DERIVATION:ht.tapBip32Derivation===void 0&&(ht.tapBip32Derivation=[]),ht.tapBip32Derivation.push(convert$3.inputs.tapBip32Derivation.decode(dt));break;case typeFields_1$1.InputTypes.TAP_INTERNAL_KEY:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.TAP_INTERNAL_KEY),ht.tapInternalKey=convert$3.inputs.tapInternalKey.decode(dt);break;case typeFields_1$1.InputTypes.TAP_MERKLE_ROOT:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.TAP_MERKLE_ROOT),ht.tapMerkleRoot=convert$3.inputs.tapMerkleRoot.decode(dt);break;default:ht.unknownKeyVals||(ht.unknownKeyVals=[]),ht.unknownKeyVals.push(dt)}lt.push(ht)}for(const ut of tools_1$1.range(st)){const ht={};for(const dt of it[ut])switch(convert$3.outputs.checkPubkey(dt),dt.key[0]){case typeFields_1$1.OutputTypes.REDEEM_SCRIPT:if(checkKeyBuffer("output",dt.key,typeFields_1$1.OutputTypes.REDEEM_SCRIPT),ht.redeemScript!==void 0)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");ht.redeemScript=convert$3.outputs.redeemScript.decode(dt);break;case typeFields_1$1.OutputTypes.WITNESS_SCRIPT:if(checkKeyBuffer("output",dt.key,typeFields_1$1.OutputTypes.WITNESS_SCRIPT),ht.witnessScript!==void 0)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");ht.witnessScript=convert$3.outputs.witnessScript.decode(dt);break;case typeFields_1$1.OutputTypes.BIP32_DERIVATION:ht.bip32Derivation===void 0&&(ht.bip32Derivation=[]),ht.bip32Derivation.push(convert$3.outputs.bip32Derivation.decode(dt));break;case typeFields_1$1.OutputTypes.TAP_INTERNAL_KEY:checkKeyBuffer("output",dt.key,typeFields_1$1.OutputTypes.TAP_INTERNAL_KEY),ht.tapInternalKey=convert$3.outputs.tapInternalKey.decode(dt);break;case typeFields_1$1.OutputTypes.TAP_TREE:checkKeyBuffer("output",dt.key,typeFields_1$1.OutputTypes.TAP_TREE),ht.tapTree=convert$3.outputs.tapTree.decode(dt);break;case typeFields_1$1.OutputTypes.TAP_BIP32_DERIVATION:ht.tapBip32Derivation===void 0&&(ht.tapBip32Derivation=[]),ht.tapBip32Derivation.push(convert$3.outputs.tapBip32Derivation.decode(dt));break;default:ht.unknownKeyVals||(ht.unknownKeyVals=[]),ht.unknownKeyVals.push(dt)}ct.push(ht)}return{globalMap:rt,inputs:lt,outputs:ct}}fromBuffer.psbtFromKeyVals=psbtFromKeyVals;var toBuffer={};Object.defineProperty(toBuffer,"__esModule",{value:!0});const convert$2=converter,tools_1=tools;function psbtToBuffer({globalMap:tt,inputs:et,outputs:nt}){const{globalKeyVals:it,inputKeyVals:rt,outputKeyVals:ot}=psbtToKeyVals({globalMap:tt,inputs:et,outputs:nt}),at=tools_1.keyValsToBuffer(it),st=ht=>ht.length===0?[Buffer.from([0])]:ht.map(tools_1.keyValsToBuffer),lt=st(rt),ct=st(ot),ut=Buffer.allocUnsafe(5);return ut.writeUIntBE(482972169471,0,5),Buffer.concat([ut,at].concat(lt,ct))}toBuffer.psbtToBuffer=psbtToBuffer;const sortKeyVals=(tt,et)=>tt.key.compare(et.key);function keyValsFromMap(tt,et){const nt=new Set,it=Object.entries(tt).reduce((ot,[at,st])=>{if(at==="unknownKeyVals")return ot;const lt=et[at];if(lt===void 0)return ot;const ct=(Array.isArray(st)?st:[st]).map(lt.encode);return ct.map(ht=>ht.key.toString("hex")).forEach(ht=>{if(nt.has(ht))throw new Error("Serialize Error: Duplicate key: "+ht);nt.add(ht)}),ot.concat(ct)},[]),rt=tt.unknownKeyVals?tt.unknownKeyVals.filter(ot=>!nt.has(ot.key.toString("hex"))):[];return it.concat(rt).sort(sortKeyVals)}function psbtToKeyVals({globalMap:tt,inputs:et,outputs:nt}){return{globalKeyVals:keyValsFromMap(tt,convert$2.globals),inputKeyVals:et.map(it=>keyValsFromMap(it,convert$2.inputs)),outputKeyVals:nt.map(it=>keyValsFromMap(it,convert$2.outputs))}}toBuffer.psbtToKeyVals=psbtToKeyVals;(function(tt){function et(nt){for(var it in nt)tt.hasOwnProperty(it)||(tt[it]=nt[it])}Object.defineProperty(tt,"__esModule",{value:!0}),et(fromBuffer),et(toBuffer)})(parser$1);Object.defineProperty(combiner,"__esModule",{value:!0});const parser_1$1=parser$1;function combine$1(tt){const et=tt[0],nt=parser_1$1.psbtToKeyVals(et),it=tt.slice(1);if(it.length===0)throw new Error("Combine: Nothing to combine");const rt=getTx(et);if(rt===void 0)throw new Error("Combine: Self missing transaction");const ot=getKeySet(nt.globalKeyVals),at=nt.inputKeyVals.map(getKeySet),st=nt.outputKeyVals.map(getKeySet);for(const lt of it){const ct=getTx(lt);if(ct===void 0||!ct.toBuffer().equals(rt.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const ut=parser_1$1.psbtToKeyVals(lt);getKeySet(ut.globalKeyVals).forEach(keyPusher(ot,nt.globalKeyVals,ut.globalKeyVals)),ut.inputKeyVals.map(getKeySet).forEach((mt,gt)=>mt.forEach(keyPusher(at[gt],nt.inputKeyVals[gt],ut.inputKeyVals[gt]))),ut.outputKeyVals.map(getKeySet).forEach((mt,gt)=>mt.forEach(keyPusher(st[gt],nt.outputKeyVals[gt],ut.outputKeyVals[gt])))}return parser_1$1.psbtFromKeyVals(rt,{globalMapKeyVals:nt.globalKeyVals,inputKeyVals:nt.inputKeyVals,outputKeyVals:nt.outputKeyVals})}combiner.combine=combine$1;function keyPusher(tt,et,nt){return it=>{if(tt.has(it))return;const rt=nt.filter(ot=>ot.key.toString("hex")===it)[0];et.push(rt),tt.add(it)}}function getTx(tt){return tt.globalMap.unsignedTx}function getKeySet(tt){const et=new Set;return tt.forEach(nt=>{const it=nt.key.toString("hex");if(et.has(it))throw new Error("Combine: KeyValue Map keys should be unique");et.add(it)}),et}var utils$1={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0});const et=converter;function nt(pt,mt){const gt=pt[mt];if(gt===void 0)throw new Error(`No input #${mt}`);return gt}tt.checkForInput=nt;function it(pt,mt){const gt=pt[mt];if(gt===void 0)throw new Error(`No output #${mt}`);return gt}tt.checkForOutput=it;function rt(pt,mt,gt){if(pt.key[0]bt.key.equals(pt.key)).length!==0)throw new Error(`Duplicate Key: ${pt.key.toString("hex")}`)}tt.checkHasKey=rt;function ot(pt){let mt=0;return Object.keys(pt).forEach(gt=>{Number(isNaN(Number(gt)))&&mt++}),mt}tt.getEnumLength=ot;function at(pt,mt){let gt=!1;if(mt.nonWitnessUtxo||mt.witnessUtxo){const bt=!!mt.redeemScript,yt=!!mt.witnessScript,wt=!bt||!!mt.finalScriptSig,vt=!yt||!!mt.finalScriptWitness,xt=!!mt.finalScriptSig||!!mt.finalScriptWitness;gt=wt&&vt&&xt}if(gt===!1)throw new Error(`Input #${pt} has too much or too little data to clean`)}tt.inputCheckUncleanFinalized=at;function st(pt,mt,gt,bt){throw new Error(`Data for ${pt} key ${mt} is incorrect: Expected ${gt} and got ${JSON.stringify(bt)}`)}function lt(pt){return(mt,gt)=>{for(const bt of Object.keys(mt)){const yt=mt[bt],{canAdd:wt,canAddToArray:vt,check:xt,expected:St}=et[pt+"s"][bt]||{},Et=!!vt;if(xt)if(Et){if(!Array.isArray(yt)||gt[bt]&&!Array.isArray(gt[bt]))throw new Error(`Key type ${bt} must be an array`);yt.every(xt)||st(pt,bt,St,yt);const It=gt[bt]||[],Tt=new Set;if(!yt.every($t=>vt(It,$t,Tt)))throw new Error("Can not add duplicate data to array");gt[bt]=It.concat(yt)}else{if(xt(yt)||st(pt,bt,St,yt),!wt(gt,yt))throw new Error(`Can not add duplicate data to ${pt}`);gt[bt]=yt}}}}tt.updateGlobal=lt("global"),tt.updateInput=lt("input"),tt.updateOutput=lt("output");function ct(pt,mt){const gt=pt.length-1,bt=nt(pt,gt);tt.updateInput(mt,bt)}tt.addInputAttributes=ct;function ut(pt,mt){const gt=pt.length-1,bt=it(pt,gt);tt.updateOutput(mt,bt)}tt.addOutputAttributes=ut;function ht(pt,mt){if(!Buffer.isBuffer(mt)||mt.length<4)throw new Error("Set Version: Invalid Transaction");return mt.writeUInt32LE(pt,0),mt}tt.defaultVersionSetter=ht;function dt(pt,mt){if(!Buffer.isBuffer(mt)||mt.length<4)throw new Error("Set Locktime: Invalid Transaction");return mt.writeUInt32LE(pt,mt.length-4),mt}tt.defaultLocktimeSetter=dt})(utils$1);Object.defineProperty(psbt,"__esModule",{value:!0});const combiner_1=combiner,parser_1=parser$1,typeFields_1=typeFields,utils_1$1=utils$1;let Psbt$1=class{constructor(et){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:et}}static fromBase64(et,nt){const it=Buffer.from(et,"base64");return this.fromBuffer(it,nt)}static fromHex(et,nt){const it=Buffer.from(et,"hex");return this.fromBuffer(it,nt)}static fromBuffer(et,nt){const it=parser_1.psbtFromBuffer(et,nt),rt=new this(it.globalMap.unsignedTx);return Object.assign(rt,it),rt}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return parser_1.psbtToBuffer(this)}updateGlobal(et){return utils_1$1.updateGlobal(et,this.globalMap),this}updateInput(et,nt){const it=utils_1$1.checkForInput(this.inputs,et);return utils_1$1.updateInput(nt,it),this}updateOutput(et,nt){const it=utils_1$1.checkForOutput(this.outputs,et);return utils_1$1.updateOutput(nt,it),this}addUnknownKeyValToGlobal(et){return utils_1$1.checkHasKey(et,this.globalMap.unknownKeyVals,utils_1$1.getEnumLength(typeFields_1.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(et),this}addUnknownKeyValToInput(et,nt){const it=utils_1$1.checkForInput(this.inputs,et);return utils_1$1.checkHasKey(nt,it.unknownKeyVals,utils_1$1.getEnumLength(typeFields_1.InputTypes)),it.unknownKeyVals||(it.unknownKeyVals=[]),it.unknownKeyVals.push(nt),this}addUnknownKeyValToOutput(et,nt){const it=utils_1$1.checkForOutput(this.outputs,et);return utils_1$1.checkHasKey(nt,it.unknownKeyVals,utils_1$1.getEnumLength(typeFields_1.OutputTypes)),it.unknownKeyVals||(it.unknownKeyVals=[]),it.unknownKeyVals.push(nt),this}addInput(et){this.globalMap.unsignedTx.addInput(et),this.inputs.push({unknownKeyVals:[]});const nt=et.unknownKeyVals||[],it=this.inputs.length-1;if(!Array.isArray(nt))throw new Error("unknownKeyVals must be an Array");return nt.forEach(rt=>this.addUnknownKeyValToInput(it,rt)),utils_1$1.addInputAttributes(this.inputs,et),this}addOutput(et){this.globalMap.unsignedTx.addOutput(et),this.outputs.push({unknownKeyVals:[]});const nt=et.unknownKeyVals||[],it=this.outputs.length-1;if(!Array.isArray(nt))throw new Error("unknownKeyVals must be an Array");return nt.forEach(rt=>this.addUnknownKeyValToOutput(it,rt)),utils_1$1.addOutputAttributes(this.outputs,et),this}clearFinalizedInput(et){const nt=utils_1$1.checkForInput(this.inputs,et);utils_1$1.inputCheckUncleanFinalized(et,nt);for(const it of Object.keys(nt))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(it)||delete nt[it];return this}combine(...et){const nt=combiner_1.combine([this].concat(et));return Object.assign(this,nt),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}};psbt.Psbt=Psbt$1;var bip371={},psbtutils={};Object.defineProperty(psbtutils,"__esModule",{value:!0});psbtutils.signatureBlocksAction=psbtutils.checkInputForSig=psbtutils.pubkeyInScript=psbtutils.pubkeyPositionInScript=psbtutils.witnessStackToScriptWitness=psbtutils.isP2TR=psbtutils.isP2SHScript=psbtutils.isP2WSHScript=psbtutils.isP2WPKH=psbtutils.isP2PKH=psbtutils.isP2PK=psbtutils.isP2MS=void 0;const varuint$1=varint,bscript$1=script,transaction_1$2=transaction,crypto_1=crypto$2,payments$1=payments$3;function isPaymentFactory(tt){return et=>{try{return tt({output:et}),!0}catch{return!1}}}psbtutils.isP2MS=isPaymentFactory(payments$1.p2ms);psbtutils.isP2PK=isPaymentFactory(payments$1.p2pk);psbtutils.isP2PKH=isPaymentFactory(payments$1.p2pkh);psbtutils.isP2WPKH=isPaymentFactory(payments$1.p2wpkh);psbtutils.isP2WSHScript=isPaymentFactory(payments$1.p2wsh);psbtutils.isP2SHScript=isPaymentFactory(payments$1.p2sh);psbtutils.isP2TR=isPaymentFactory(payments$1.p2tr);function witnessStackToScriptWitness(tt){let et=Buffer.allocUnsafe(0);function nt(at){et=Buffer.concat([et,Buffer.from(at)])}function it(at){const st=et.length,lt=varuint$1.encodingLength(at);et=Buffer.concat([et,Buffer.allocUnsafe(lt)]),varuint$1.encode(at,et,st)}function rt(at){it(at.length),nt(at)}function ot(at){it(at.length),at.forEach(rt)}return ot(tt),et}psbtutils.witnessStackToScriptWitness=witnessStackToScriptWitness;function pubkeyPositionInScript(tt,et){const nt=(0,crypto_1.hash160)(tt),it=tt.slice(1,33),rt=bscript$1.decompile(et);if(rt===null)throw new Error("Unknown script error");return rt.findIndex(ot=>typeof ot=="number"?!1:ot.equals(tt)||ot.equals(nt)||ot.equals(it))}psbtutils.pubkeyPositionInScript=pubkeyPositionInScript;function pubkeyInScript(tt,et){return pubkeyPositionInScript(tt,et)!==-1}psbtutils.pubkeyInScript=pubkeyInScript;function checkInputForSig(tt,et){return extractPartialSigs(tt).some(it=>signatureBlocksAction(it,bscript$1.signature.decode,et))}psbtutils.checkInputForSig=checkInputForSig;function signatureBlocksAction(tt,et,nt){const{hashType:it}=et(tt),rt=[];switch(it&transaction_1$2.Transaction.SIGHASH_ANYONECANPAY&&rt.push("addInput"),it&31){case transaction_1$2.Transaction.SIGHASH_ALL:break;case transaction_1$2.Transaction.SIGHASH_SINGLE:case transaction_1$2.Transaction.SIGHASH_NONE:rt.push("addOutput"),rt.push("setInputSequence");break}return rt.indexOf(nt)===-1}psbtutils.signatureBlocksAction=signatureBlocksAction;function extractPartialSigs(tt){let et=[];if((tt.partialSig||[]).length===0){if(!tt.finalScriptSig&&!tt.finalScriptWitness)return[];et=getPsigsFromInputFinalScripts(tt)}else et=tt.partialSig;return et.map(nt=>nt.signature)}function getPsigsFromInputFinalScripts(tt){const et=tt.finalScriptSig?bscript$1.decompile(tt.finalScriptSig)||[]:[],nt=tt.finalScriptWitness?bscript$1.decompile(tt.finalScriptWitness)||[]:[];return et.concat(nt).filter(it=>Buffer.isBuffer(it)&&bscript$1.isCanonicalScriptSignature(it)).map(it=>({signature:it}))}Object.defineProperty(bip371,"__esModule",{value:!0});bip371.checkTaprootInputForSigs=bip371.tapTreeFromList=bip371.tapTreeToList=bip371.tweakInternalPubKey=bip371.checkTaprootOutputFields=bip371.checkTaprootInputFields=bip371.isTaprootOutput=bip371.isTaprootInput=bip371.serializeTaprootSignature=bip371.tapScriptFinalizer=bip371.toXOnly=void 0;const types_1=types$7,transaction_1$1=transaction,psbtutils_1$1=psbtutils,bip341_1$1=bip341,payments_1=payments$3,psbtutils_2=psbtutils,toXOnly=tt=>tt.length===32?tt:tt.slice(1,33);bip371.toXOnly=toXOnly;function tapScriptFinalizer(tt,et,nt){const it=findTapLeafToFinalize(et,tt,nt);try{const ot=sortSignatures(et,it).concat(it.script).concat(it.controlBlock);return{finalScriptWitness:(0,psbtutils_1$1.witnessStackToScriptWitness)(ot)}}catch(rt){throw new Error(`Can not finalize taproot input #${tt}: ${rt}`)}}bip371.tapScriptFinalizer=tapScriptFinalizer;function serializeTaprootSignature(tt,et){const nt=et?Buffer.from([et]):Buffer.from([]);return Buffer.concat([tt,nt])}bip371.serializeTaprootSignature=serializeTaprootSignature;function isTaprootInput(tt){return tt&&!!(tt.tapInternalKey||tt.tapMerkleRoot||tt.tapLeafScript&&tt.tapLeafScript.length||tt.tapBip32Derivation&&tt.tapBip32Derivation.length||tt.witnessUtxo&&(0,psbtutils_1$1.isP2TR)(tt.witnessUtxo.script))}bip371.isTaprootInput=isTaprootInput;function isTaprootOutput(tt,et){return tt&&!!(tt.tapInternalKey||tt.tapTree||tt.tapBip32Derivation&&tt.tapBip32Derivation.length||et&&(0,psbtutils_1$1.isP2TR)(et))}bip371.isTaprootOutput=isTaprootOutput;function checkTaprootInputFields(tt,et,nt){checkMixedTaprootAndNonTaprootInputFields(tt,et,nt),checkIfTapLeafInTree(tt,et,nt)}bip371.checkTaprootInputFields=checkTaprootInputFields;function checkTaprootOutputFields(tt,et,nt){checkMixedTaprootAndNonTaprootOutputFields(tt,et,nt),checkTaprootScriptPubkey(tt,et)}bip371.checkTaprootOutputFields=checkTaprootOutputFields;function checkTaprootScriptPubkey(tt,et){if(!et.tapTree&&!et.tapInternalKey)return;const nt=et.tapInternalKey||tt.tapInternalKey,it=et.tapTree||tt.tapTree;if(nt){const{script:rt}=tt,ot=getTaprootScripPubkey(nt,it);if(rt&&!rt.equals(ot))throw new Error("Error adding output. Script or address missmatch.")}}function getTaprootScripPubkey(tt,et){const nt=et&&tapTreeFromList(et.leaves),{output:it}=(0,payments_1.p2tr)({internalPubkey:tt,scriptTree:nt});return it}function tweakInternalPubKey(tt,et){const nt=et.tapInternalKey,it=nt&&(0,bip341_1$1.tweakKey)(nt,et.tapMerkleRoot);if(!it)throw new Error(`Cannot tweak tap internal key for input #${tt}. Public key: ${nt&&nt.toString("hex")}`);return it.x}bip371.tweakInternalPubKey=tweakInternalPubKey;function tapTreeToList(tt){if(!(0,types_1.isTaptree)(tt))throw new Error("Cannot convert taptree to tapleaf list. Expecting a tapree structure.");return _tapTreeToList(tt)}bip371.tapTreeToList=tapTreeToList;function tapTreeFromList(tt=[]){return tt.length===1&&tt[0].depth===0?{output:tt[0].script,version:tt[0].leafVersion}:instertLeavesInTree(tt)}bip371.tapTreeFromList=tapTreeFromList;function checkTaprootInputForSigs(tt,et){return extractTaprootSigs(tt).some(it=>(0,psbtutils_2.signatureBlocksAction)(it,decodeSchnorrSignature,et))}bip371.checkTaprootInputForSigs=checkTaprootInputForSigs;function decodeSchnorrSignature(tt){return{signature:tt.slice(0,64),hashType:tt.slice(64)[0]||transaction_1$1.Transaction.SIGHASH_DEFAULT}}function extractTaprootSigs(tt){const et=[];if(tt.tapKeySig&&et.push(tt.tapKeySig),tt.tapScriptSig&&et.push(...tt.tapScriptSig.map(nt=>nt.signature)),!et.length){const nt=getTapKeySigFromWithness(tt.finalScriptWitness);nt&&et.push(nt)}return et}function getTapKeySigFromWithness(tt){if(!tt)return;const et=tt.slice(2);if(et.length===64||et.length===65)return et}function _tapTreeToList(tt,et=[],nt=0){if(nt>bip341_1$1.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");return tt?(0,types_1.isTapleaf)(tt)?(et.push({depth:nt,leafVersion:tt.version||bip341_1$1.LEAF_VERSION_TAPSCRIPT,script:tt.output}),et):(tt[0]&&_tapTreeToList(tt[0],et,nt+1),tt[1]&&_tapTreeToList(tt[1],et,nt+1),et):[]}function instertLeavesInTree(tt){let et;for(const nt of tt)if(et=instertLeafInTree(nt,et),!et)throw new Error("No room left to insert tapleaf in tree");return et}function instertLeafInTree(tt,et,nt=0){if(nt>bip341_1$1.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");if(tt.depth===nt)return et?void 0:{output:tt.script,version:tt.leafVersion};if((0,types_1.isTapleaf)(et))return;const it=instertLeafInTree(tt,et&&et[0],nt+1);if(it)return[it,et&&et[1]];const rt=instertLeafInTree(tt,et&&et[1],nt+1);if(rt)return[et&&et[0],rt]}function checkMixedTaprootAndNonTaprootInputFields(tt,et,nt){const it=isTaprootInput(tt)&&hasNonTaprootFields(et),rt=hasNonTaprootFields(tt)&&isTaprootInput(et),ot=tt===et&&isTaprootInput(et)&&hasNonTaprootFields(et);if(it||rt||ot)throw new Error(`Invalid arguments for Psbt.${nt}. Cannot use both taproot and non-taproot fields.`)}function checkMixedTaprootAndNonTaprootOutputFields(tt,et,nt){const it=isTaprootOutput(tt)&&hasNonTaprootFields(et),rt=hasNonTaprootFields(tt)&&isTaprootOutput(et),ot=tt===et&&isTaprootOutput(et)&&hasNonTaprootFields(et);if(it||rt||ot)throw new Error(`Invalid arguments for Psbt.${nt}. Cannot use both taproot and non-taproot fields.`)}function checkIfTapLeafInTree(tt,et,nt){if(et.tapMerkleRoot){const it=(et.tapLeafScript||[]).every(ot=>isTapLeafInTree(ot,et.tapMerkleRoot)),rt=(tt.tapLeafScript||[]).every(ot=>isTapLeafInTree(ot,et.tapMerkleRoot));if(!it||!rt)throw new Error(`Invalid arguments for Psbt.${nt}. Tapleaf not part of taptree.`)}else if(tt.tapMerkleRoot&&!(et.tapLeafScript||[]).every(rt=>isTapLeafInTree(rt,tt.tapMerkleRoot)))throw new Error(`Invalid arguments for Psbt.${nt}. Tapleaf not part of taptree.`)}function isTapLeafInTree(tt,et){if(!et)return!0;const nt=(0,bip341_1$1.tapleafHash)({output:tt.script,version:tt.leafVersion});return(0,bip341_1$1.rootHashFromPath)(tt.controlBlock,nt).equals(et)}function sortSignatures(tt,et){const nt=(0,bip341_1$1.tapleafHash)({output:et.script,version:et.leafVersion});return(tt.tapScriptSig||[]).filter(it=>it.leafHash.equals(nt)).map(it=>addPubkeyPositionInScript(et.script,it)).sort((it,rt)=>rt.positionInScript-it.positionInScript).map(it=>it.signature)}function addPubkeyPositionInScript(tt,et){return Object.assign({positionInScript:(0,psbtutils_1$1.pubkeyPositionInScript)(et.pubkey,tt)},et)}function findTapLeafToFinalize(tt,et,nt){if(!tt.tapScriptSig||!tt.tapScriptSig.length)throw new Error(`Can not finalize taproot input #${et}. No tapleaf script signature provided.`);const it=(tt.tapLeafScript||[]).sort((rt,ot)=>rt.controlBlock.length-ot.controlBlock.length).find(rt=>canFinalizeLeaf(rt,tt.tapScriptSig,nt));if(!it)throw new Error(`Can not finalize taproot input #${et}. Signature for tapleaf script not found.`);return it}function canFinalizeLeaf(tt,et,nt){const it=(0,bip341_1$1.tapleafHash)({output:tt.script,version:tt.leafVersion});return(!nt||nt.equals(it))&&et.find(ot=>ot.leafHash.equals(it))!==void 0}function hasNonTaprootFields(tt){return tt&&!!(tt.redeemScript||tt.witnessScript||tt.bip32Derivation&&tt.bip32Derivation.length)}Object.defineProperty(psbt$1,"__esModule",{value:!0});psbt$1.Psbt=void 0;const bip174_1=psbt,varuint=varint,utils_1=utils$1,address_1=address,bufferutils_1=bufferutils,networks_1=networks$1,payments=payments$3,bip341_1=bip341,bscript=script,transaction_1=transaction,bip371_1=bip371,psbtutils_1=psbtutils,DEFAULT_OPTS={network:networks_1.bitcoin,maximumFeeRate:5e3};class Psbt{static fromBase64(et,nt={}){const it=Buffer.from(et,"base64");return this.fromBuffer(it,nt)}static fromHex(et,nt={}){const it=Buffer.from(et,"hex");return this.fromBuffer(it,nt)}static fromBuffer(et,nt={}){const it=bip174_1.Psbt.fromBuffer(et,transactionFromBuffer),rt=new Psbt(nt,it);return checkTxForDupeIns(rt.__CACHE.__TX,rt.__CACHE),rt}constructor(et={},nt=new bip174_1.Psbt(new PsbtTransaction)){this.data=nt,this.opts=Object.assign({},DEFAULT_OPTS,et),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},this.data.inputs.length===0&&this.setVersion(2);const it=(rt,ot,at,st)=>Object.defineProperty(rt,ot,{enumerable:at,writable:st});it(this,"__CACHE",!1,!0),it(this,"opts",!1,!0)}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(et){this.setVersion(et)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(et){this.setLocktime(et)}get txInputs(){return this.__CACHE.__TX.ins.map(et=>({hash:(0,bufferutils_1.cloneBuffer)(et.hash),index:et.index,sequence:et.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(et=>{let nt;try{nt=(0,address_1.fromOutputScript)(et.script,this.opts.network)}catch{}return{script:(0,bufferutils_1.cloneBuffer)(et.script),value:et.value,address:nt}})}combine(...et){return this.data.combine(...et.map(nt=>nt.data)),this}clone(){const et=Psbt.fromBuffer(this.data.toBuffer());return et.opts=JSON.parse(JSON.stringify(this.opts)),et}setMaximumFeeRate(et){check32Bit(et),this.opts.maximumFeeRate=et}setVersion(et){check32Bit(et),checkInputsForPartialSig(this.data.inputs,"setVersion");const nt=this.__CACHE;return nt.__TX.version=et,nt.__EXTRACTED_TX=void 0,this}setLocktime(et){check32Bit(et),checkInputsForPartialSig(this.data.inputs,"setLocktime");const nt=this.__CACHE;return nt.__TX.locktime=et,nt.__EXTRACTED_TX=void 0,this}setInputSequence(et,nt){check32Bit(nt),checkInputsForPartialSig(this.data.inputs,"setInputSequence");const it=this.__CACHE;if(it.__TX.ins.length<=et)throw new Error("Input index too high");return it.__TX.ins[et].sequence=nt,it.__EXTRACTED_TX=void 0,this}addInputs(et){return et.forEach(nt=>this.addInput(nt)),this}addInput(et){if(arguments.length>1||!et||et.hash===void 0||et.index===void 0)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");(0,bip371_1.checkTaprootInputFields)(et,et,"addInput"),checkInputsForPartialSig(this.data.inputs,"addInput"),et.witnessScript&&checkInvalidP2WSH(et.witnessScript);const nt=this.__CACHE;this.data.addInput(et);const it=nt.__TX.ins[nt.__TX.ins.length-1];checkTxInputCache(nt,it);const rt=this.data.inputs.length-1,ot=this.data.inputs[rt];return ot.nonWitnessUtxo&&addNonWitnessTxCache(this.__CACHE,ot,rt),nt.__FEE=void 0,nt.__FEE_RATE=void 0,nt.__EXTRACTED_TX=void 0,this}addOutputs(et){return et.forEach(nt=>this.addOutput(nt)),this}addOutput(et){if(arguments.length>1||!et||et.value===void 0||et.address===void 0&&et.script===void 0)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");checkInputsForPartialSig(this.data.inputs,"addOutput");const{address:nt}=et;if(typeof nt=="string"){const{network:rt}=this.opts,ot=(0,address_1.toOutputScript)(nt,rt);et=Object.assign(et,{script:ot})}(0,bip371_1.checkTaprootOutputFields)(et,et,"addOutput");const it=this.__CACHE;return this.data.addOutput(et),it.__FEE=void 0,it.__FEE_RATE=void 0,it.__EXTRACTED_TX=void 0,this}extractTransaction(et){if(!this.data.inputs.every(isFinalized))throw new Error("Not finalized");const nt=this.__CACHE;if(et||checkFees(this,nt,this.opts),nt.__EXTRACTED_TX)return nt.__EXTRACTED_TX;const it=nt.__TX.clone();return inputFinalizeGetAmts(this.data.inputs,it,nt,!0),it}getFeeRate(){return getTxCacheValue("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return getTxCacheValue("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return(0,utils_1.checkForInput)(this.data.inputs,0),range$5(this.data.inputs.length).forEach(et=>this.finalizeInput(et)),this}finalizeInput(et,nt){const it=(0,utils_1.checkForInput)(this.data.inputs,et);return(0,bip371_1.isTaprootInput)(it)?this._finalizeTaprootInput(et,it,void 0,nt):this._finalizeInput(et,it,nt)}finalizeTaprootInput(et,nt,it=bip371_1.tapScriptFinalizer){const rt=(0,utils_1.checkForInput)(this.data.inputs,et);if((0,bip371_1.isTaprootInput)(rt))return this._finalizeTaprootInput(et,rt,nt,it);throw new Error(`Cannot finalize input #${et}. Not Taproot.`)}_finalizeInput(et,nt,it=getFinalScripts){const{script:rt,isP2SH:ot,isP2WSH:at,isSegwit:st}=getScriptFromInput(et,nt,this.__CACHE);if(!rt)throw new Error(`No script found for input #${et}`);checkPartialSigSighashes(nt);const{finalScriptSig:lt,finalScriptWitness:ct}=it(et,nt,rt,st,ot,at);if(lt&&this.data.updateInput(et,{finalScriptSig:lt}),ct&&this.data.updateInput(et,{finalScriptWitness:ct}),!lt&&!ct)throw new Error(`Unknown error finalizing input #${et}`);return this.data.clearFinalizedInput(et),this}_finalizeTaprootInput(et,nt,it,rt=bip371_1.tapScriptFinalizer){if(!nt.witnessUtxo)throw new Error(`Cannot finalize input #${et}. Missing withness utxo.`);if(nt.tapKeySig){const ot=payments.p2tr({output:nt.witnessUtxo.script,signature:nt.tapKeySig}),at=(0,psbtutils_1.witnessStackToScriptWitness)(ot.witness);this.data.updateInput(et,{finalScriptWitness:at})}else{const{finalScriptWitness:ot}=rt(et,nt,it);this.data.updateInput(et,{finalScriptWitness:ot})}return this.data.clearFinalizedInput(et),this}getInputType(et){const nt=(0,utils_1.checkForInput)(this.data.inputs,et),it=getScriptFromUtxo(et,nt,this.__CACHE),rt=getMeaningfulScript(it,et,"input",nt.redeemScript||redeemFromFinalScriptSig(nt.finalScriptSig),nt.witnessScript||redeemFromFinalWitnessScript(nt.finalScriptWitness)),ot=rt.type==="raw"?"":rt.type+"-",at=classifyScript(rt.meaningfulScript);return ot+at}inputHasPubkey(et,nt){const it=(0,utils_1.checkForInput)(this.data.inputs,et);return pubkeyInInput(nt,it,et,this.__CACHE)}inputHasHDKey(et,nt){const it=(0,utils_1.checkForInput)(this.data.inputs,et),rt=bip32DerivationIsMine(nt);return!!it.bip32Derivation&&it.bip32Derivation.some(rt)}outputHasPubkey(et,nt){const it=(0,utils_1.checkForOutput)(this.data.outputs,et);return pubkeyInOutput(nt,it,et,this.__CACHE)}outputHasHDKey(et,nt){const it=(0,utils_1.checkForOutput)(this.data.outputs,et),rt=bip32DerivationIsMine(nt);return!!it.bip32Derivation&&it.bip32Derivation.some(rt)}validateSignaturesOfAllInputs(et){return(0,utils_1.checkForInput)(this.data.inputs,0),range$5(this.data.inputs.length).map(it=>this.validateSignaturesOfInput(it,et)).reduce((it,rt)=>rt===!0&&it,!0)}validateSignaturesOfInput(et,nt,it){const rt=this.data.inputs[et];return(0,bip371_1.isTaprootInput)(rt)?this.validateSignaturesOfTaprootInput(et,nt,it):this._validateSignaturesOfInput(et,nt,it)}_validateSignaturesOfInput(et,nt,it){const rt=this.data.inputs[et],ot=(rt||{}).partialSig;if(!rt||!ot||ot.length<1)throw new Error("No signatures to validate");if(typeof nt!="function")throw new Error("Need validator function to validate signatures");const at=it?ot.filter(ht=>ht.pubkey.equals(it)):ot;if(at.length<1)throw new Error("No signatures for this pubkey");const st=[];let lt,ct,ut;for(const ht of at){const dt=bscript.signature.decode(ht.signature),{hash:pt,script:mt}=ut!==dt.hashType?getHashForSig(et,Object.assign({},rt,{sighashType:dt.hashType}),this.__CACHE,!0):{hash:lt,script:ct};ut=dt.hashType,lt=pt,ct=mt,checkScriptForPubkey(ht.pubkey,mt,"verify"),st.push(nt(ht.pubkey,pt,dt.signature))}return st.every(ht=>ht===!0)}validateSignaturesOfTaprootInput(et,nt,it){const rt=this.data.inputs[et],ot=(rt||{}).tapKeySig,at=(rt||{}).tapScriptSig;if(!rt&&!ot&&!(at&&!at.length))throw new Error("No signatures to validate");if(typeof nt!="function")throw new Error("Need validator function to validate signatures");it=it&&(0,bip371_1.toXOnly)(it);const st=it?getTaprootHashesForSig(et,rt,this.data.inputs,it,this.__CACHE):getAllTaprootHashesForSig(et,rt,this.data.inputs,this.__CACHE);if(!st.length)throw new Error("No signatures for this pubkey");const lt=st.find(ut=>!ut.leafHash);let ct=0;if(ot&<){if(!nt(lt.pubkey,lt.hash,trimTaprootSig(ot)))return!1;ct++}if(at)for(const ut of at){const ht=st.find(dt=>ut.pubkey.equals(dt.pubkey));if(ht){if(!nt(ut.pubkey,ht.hash,trimTaprootSig(ut.signature)))return!1;ct++}}return ct>0}signAllInputsHD(et,nt=[transaction_1.Transaction.SIGHASH_ALL]){if(!et||!et.publicKey||!et.fingerprint)throw new Error("Need HDSigner to sign input");const it=[];for(const rt of range$5(this.data.inputs.length))try{this.signInputHD(rt,et,nt),it.push(!0)}catch{it.push(!1)}if(it.every(rt=>rt===!1))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(et,nt=[transaction_1.Transaction.SIGHASH_ALL]){return new Promise((it,rt)=>{if(!et||!et.publicKey||!et.fingerprint)return rt(new Error("Need HDSigner to sign input"));const ot=[],at=[];for(const st of range$5(this.data.inputs.length))at.push(this.signInputHDAsync(st,et,nt).then(()=>{ot.push(!0)},()=>{ot.push(!1)}));return Promise.all(at).then(()=>{if(ot.every(st=>st===!1))return rt(new Error("No inputs were signed"));it()})})}signInputHD(et,nt,it=[transaction_1.Transaction.SIGHASH_ALL]){if(!nt||!nt.publicKey||!nt.fingerprint)throw new Error("Need HDSigner to sign input");return getSignersFromHD(et,this.data.inputs,nt).forEach(ot=>this.signInput(et,ot,it)),this}signInputHDAsync(et,nt,it=[transaction_1.Transaction.SIGHASH_ALL]){return new Promise((rt,ot)=>{if(!nt||!nt.publicKey||!nt.fingerprint)return ot(new Error("Need HDSigner to sign input"));const st=getSignersFromHD(et,this.data.inputs,nt).map(lt=>this.signInputAsync(et,lt,it));return Promise.all(st).then(()=>{rt()}).catch(ot)})}signAllInputs(et,nt){if(!et||!et.publicKey)throw new Error("Need Signer to sign input");const it=[];for(const rt of range$5(this.data.inputs.length))try{this.signInput(rt,et,nt),it.push(!0)}catch{it.push(!1)}if(it.every(rt=>rt===!1))throw new Error("No inputs were signed");return this}signAllInputsAsync(et,nt){return new Promise((it,rt)=>{if(!et||!et.publicKey)return rt(new Error("Need Signer to sign input"));const ot=[],at=[];for(const[st]of this.data.inputs.entries())at.push(this.signInputAsync(st,et,nt).then(()=>{ot.push(!0)},()=>{ot.push(!1)}));return Promise.all(at).then(()=>{if(ot.every(st=>st===!1))return rt(new Error("No inputs were signed"));it()})})}signInput(et,nt,it){if(!nt||!nt.publicKey)throw new Error("Need Signer to sign input");const rt=(0,utils_1.checkForInput)(this.data.inputs,et);return(0,bip371_1.isTaprootInput)(rt)?this._signTaprootInput(et,rt,nt,void 0,it):this._signInput(et,nt,it)}signTaprootInput(et,nt,it,rt){if(!nt||!nt.publicKey)throw new Error("Need Signer to sign input");const ot=(0,utils_1.checkForInput)(this.data.inputs,et);if((0,bip371_1.isTaprootInput)(ot))return this._signTaprootInput(et,ot,nt,it,rt);throw new Error(`Input #${et} is not of type Taproot.`)}_signInput(et,nt,it=[transaction_1.Transaction.SIGHASH_ALL]){const{hash:rt,sighashType:ot}=getHashAndSighashType(this.data.inputs,et,nt.publicKey,this.__CACHE,it),at=[{pubkey:nt.publicKey,signature:bscript.signature.encode(nt.sign(rt),ot)}];return this.data.updateInput(et,{partialSig:at}),this}_signTaprootInput(et,nt,it,rt,ot=[transaction_1.Transaction.SIGHASH_DEFAULT]){const at=this.checkTaprootHashesForSig(et,nt,it,rt,ot),st=at.filter(ct=>!ct.leafHash).map(ct=>(0,bip371_1.serializeTaprootSignature)(it.signSchnorr(ct.hash),nt.sighashType))[0],lt=at.filter(ct=>!!ct.leafHash).map(ct=>({pubkey:(0,bip371_1.toXOnly)(it.publicKey),signature:(0,bip371_1.serializeTaprootSignature)(it.signSchnorr(ct.hash),nt.sighashType),leafHash:ct.leafHash}));return st&&this.data.updateInput(et,{tapKeySig:st}),lt.length&&this.data.updateInput(et,{tapScriptSig:lt}),this}signInputAsync(et,nt,it){return Promise.resolve().then(()=>{if(!nt||!nt.publicKey)throw new Error("Need Signer to sign input");const rt=(0,utils_1.checkForInput)(this.data.inputs,et);return(0,bip371_1.isTaprootInput)(rt)?this._signTaprootInputAsync(et,rt,nt,void 0,it):this._signInputAsync(et,nt,it)})}signTaprootInputAsync(et,nt,it,rt){return Promise.resolve().then(()=>{if(!nt||!nt.publicKey)throw new Error("Need Signer to sign input");const ot=(0,utils_1.checkForInput)(this.data.inputs,et);if((0,bip371_1.isTaprootInput)(ot))return this._signTaprootInputAsync(et,ot,nt,it,rt);throw new Error(`Input #${et} is not of type Taproot.`)})}_signInputAsync(et,nt,it=[transaction_1.Transaction.SIGHASH_ALL]){const{hash:rt,sighashType:ot}=getHashAndSighashType(this.data.inputs,et,nt.publicKey,this.__CACHE,it);return Promise.resolve(nt.sign(rt)).then(at=>{const st=[{pubkey:nt.publicKey,signature:bscript.signature.encode(at,ot)}];this.data.updateInput(et,{partialSig:st})})}async _signTaprootInputAsync(et,nt,it,rt,ot=[transaction_1.Transaction.SIGHASH_DEFAULT]){const at=this.checkTaprootHashesForSig(et,nt,it,rt,ot),st=[],lt=at.filter(ut=>!ut.leafHash)[0];if(lt){const ut=Promise.resolve(it.signSchnorr(lt.hash)).then(ht=>({tapKeySig:(0,bip371_1.serializeTaprootSignature)(ht,nt.sighashType)}));st.push(ut)}const ct=at.filter(ut=>!!ut.leafHash);if(ct.length){const ut=ct.map(ht=>Promise.resolve(it.signSchnorr(ht.hash)).then(dt=>({tapScriptSig:[{pubkey:(0,bip371_1.toXOnly)(it.publicKey),signature:(0,bip371_1.serializeTaprootSignature)(dt,nt.sighashType),leafHash:ht.leafHash}]})));st.push(...ut)}return Promise.all(st).then(ut=>{ut.forEach(ht=>this.data.updateInput(et,ht))})}checkTaprootHashesForSig(et,nt,it,rt,ot){if(typeof it.signSchnorr!="function")throw new Error(`Need Schnorr Signer to sign taproot input #${et}.`);const at=getTaprootHashesForSig(et,nt,this.data.inputs,it.publicKey,this.__CACHE,rt,ot);if(!at||!at.length)throw new Error(`Can not sign for input #${et} with the key ${it.publicKey.toString("hex")}`);return at}toBuffer(){return checkCache(this.__CACHE),this.data.toBuffer()}toHex(){return checkCache(this.__CACHE),this.data.toHex()}toBase64(){return checkCache(this.__CACHE),this.data.toBase64()}updateGlobal(et){return this.data.updateGlobal(et),this}updateInput(et,nt){return nt.witnessScript&&checkInvalidP2WSH(nt.witnessScript),(0,bip371_1.checkTaprootInputFields)(this.data.inputs[et],nt,"updateInput"),this.data.updateInput(et,nt),nt.nonWitnessUtxo&&addNonWitnessTxCache(this.__CACHE,this.data.inputs[et],et),this}updateOutput(et,nt){const it=this.data.outputs[et];return(0,bip371_1.checkTaprootOutputFields)(it,nt,"updateOutput"),this.data.updateOutput(et,nt),this}addUnknownKeyValToGlobal(et){return this.data.addUnknownKeyValToGlobal(et),this}addUnknownKeyValToInput(et,nt){return this.data.addUnknownKeyValToInput(et,nt),this}addUnknownKeyValToOutput(et,nt){return this.data.addUnknownKeyValToOutput(et,nt),this}clearFinalizedInput(et){return this.data.clearFinalizedInput(et),this}}psbt$1.Psbt=Psbt;const transactionFromBuffer=tt=>new PsbtTransaction(tt);class PsbtTransaction{constructor(et=Buffer.from([2,0,0,0,0,0,0,0,0,0])){this.tx=transaction_1.Transaction.fromBuffer(et),checkTxEmpty(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(et){if(et.hash===void 0||et.index===void 0||!Buffer.isBuffer(et.hash)&&typeof et.hash!="string"||typeof et.index!="number")throw new Error("Error adding input.");const nt=typeof et.hash=="string"?(0,bufferutils_1.reverseBuffer)(Buffer.from(et.hash,"hex")):et.hash;this.tx.addInput(nt,et.index,et.sequence)}addOutput(et){if(et.script===void 0||et.value===void 0||!Buffer.isBuffer(et.script)||typeof et.value!="number")throw new Error("Error adding output.");this.tx.addOutput(et.script,et.value)}toBuffer(){return this.tx.toBuffer()}}function canFinalize(tt,et,nt){switch(nt){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return hasSigs(1,tt.partialSig);case"multisig":const it=payments.p2ms({output:et});return hasSigs(it.m,tt.partialSig,it.pubkeys);default:return!1}}function checkCache(tt){if(tt.__UNSAFE_SIGN_NONSEGWIT!==!1)throw new Error("Not BIP174 compliant, can not export")}function hasSigs(tt,et,nt){if(!et)return!1;let it;if(nt?it=nt.map(rt=>{const ot=compressPubkey(rt);return et.find(at=>at.pubkey.equals(ot))}).filter(rt=>!!rt):it=et,it.length>tt)throw new Error("Too many signatures");return it.length===tt}function isFinalized(tt){return!!tt.finalScriptSig||!!tt.finalScriptWitness}function bip32DerivationIsMine(tt){return et=>!(!et.masterFingerprint.equals(tt.fingerprint)||!tt.derivePath(et.path).publicKey.equals(et.pubkey))}function check32Bit(tt){if(typeof tt!="number"||tt!==Math.floor(tt)||tt>4294967295||tt<0)throw new Error("Invalid 32 bit integer")}function checkFees(tt,et,nt){const it=et.__FEE_RATE||tt.getFeeRate(),rt=et.__EXTRACTED_TX.virtualSize(),ot=it*rt;if(it>=nt.maximumFeeRate)throw new Error(`Warning: You are paying around ${(ot/1e8).toFixed(8)} in fees, which is ${it} satoshi per byte for a transaction with a VSize of ${rt} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}function checkInputsForPartialSig(tt,et){tt.forEach(nt=>{if((0,bip371_1.isTaprootInput)(nt)?(0,bip371_1.checkTaprootInputForSigs)(nt,et):(0,psbtutils_1.checkInputForSig)(nt,et))throw new Error("Can not modify transaction, signatures exist.")})}function checkPartialSigSighashes(tt){if(!tt.sighashType||!tt.partialSig)return;const{partialSig:et,sighashType:nt}=tt;et.forEach(it=>{const{hashType:rt}=bscript.signature.decode(it.signature);if(nt!==rt)throw new Error("Signature sighash does not match input sighash type")})}function checkScriptForPubkey(tt,et,nt){if(!(0,psbtutils_1.pubkeyInScript)(tt,et))throw new Error(`Can not ${nt} for this input with the key ${tt.toString("hex")}`)}function checkTxEmpty(tt){if(!tt.ins.every(nt=>nt.script&&nt.script.length===0&&nt.witness&&nt.witness.length===0))throw new Error("Format Error: Transaction ScriptSigs are not empty")}function checkTxForDupeIns(tt,et){tt.ins.forEach(nt=>{checkTxInputCache(et,nt)})}function checkTxInputCache(tt,et){const nt=(0,bufferutils_1.reverseBuffer)(Buffer.from(et.hash)).toString("hex")+":"+et.index;if(tt.__TX_IN_CACHE[nt])throw new Error("Duplicate input detected.");tt.__TX_IN_CACHE[nt]=1}function scriptCheckerFactory(tt,et){return(nt,it,rt,ot)=>{const at=tt({redeem:{output:rt}}).output;if(!it.equals(at))throw new Error(`${et} for ${ot} #${nt} doesn't match the scriptPubKey in the prevout`)}}const checkRedeemScript=scriptCheckerFactory(payments.p2sh,"Redeem script"),checkWitnessScript=scriptCheckerFactory(payments.p2wsh,"Witness script");function getTxCacheValue(tt,et,nt,it){if(!nt.every(isFinalized))throw new Error(`PSBT must be finalized to calculate ${et}`);if(tt==="__FEE_RATE"&&it.__FEE_RATE)return it.__FEE_RATE;if(tt==="__FEE"&&it.__FEE)return it.__FEE;let rt,ot=!0;if(it.__EXTRACTED_TX?(rt=it.__EXTRACTED_TX,ot=!1):rt=it.__TX.clone(),inputFinalizeGetAmts(nt,rt,it,ot),tt==="__FEE_RATE")return it.__FEE_RATE;if(tt==="__FEE")return it.__FEE}function getFinalScripts(tt,et,nt,it,rt,ot){const at=classifyScript(nt);if(!canFinalize(et,nt,at))throw new Error(`Can not finalize input #${tt}`);return prepareFinalScripts(nt,at,et.partialSig,it,rt,ot)}function prepareFinalScripts(tt,et,nt,it,rt,ot){let at,st;const lt=getPayment(tt,et,nt),ct=ot?payments.p2wsh({redeem:lt}):null,ut=rt?payments.p2sh({redeem:ct||lt}):null;return it?(ct?st=(0,psbtutils_1.witnessStackToScriptWitness)(ct.witness):st=(0,psbtutils_1.witnessStackToScriptWitness)(lt.witness),ut&&(at=ut.input)):ut?at=ut.input:at=lt.input,{finalScriptSig:at,finalScriptWitness:st}}function getHashAndSighashType(tt,et,nt,it,rt){const ot=(0,utils_1.checkForInput)(tt,et),{hash:at,sighashType:st,script:lt}=getHashForSig(et,ot,it,!1,rt);return checkScriptForPubkey(nt,lt,"sign"),{hash:at,sighashType:st}}function getHashForSig(tt,et,nt,it,rt){const ot=nt.__TX,at=et.sighashType||transaction_1.Transaction.SIGHASH_ALL;checkSighashTypeAllowed(at,rt);let st,lt;if(et.nonWitnessUtxo){const ht=nonWitnessUtxoTxFromCache(nt,et,tt),dt=ot.ins[tt].hash,pt=ht.getHash();if(!dt.equals(pt))throw new Error(`Non-witness UTXO hash for input #${tt} doesn't match the hash specified in the prevout`);const mt=ot.ins[tt].index;lt=ht.outs[mt]}else if(et.witnessUtxo)lt=et.witnessUtxo;else throw new Error("Need a Utxo input item for signing");const{meaningfulScript:ct,type:ut}=getMeaningfulScript(lt.script,tt,"input",et.redeemScript,et.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(ut)>=0)st=ot.hashForWitnessV0(tt,ct,lt.value,at);else if((0,psbtutils_1.isP2WPKH)(ct)){const ht=payments.p2pkh({hash:ct.slice(2)}).output;st=ot.hashForWitnessV0(tt,ht,lt.value,at)}else{if(et.nonWitnessUtxo===void 0&&nt.__UNSAFE_SIGN_NONSEGWIT===!1)throw new Error(`Input #${tt} has witnessUtxo but non-segwit script: ${ct.toString("hex")}`);!it&&nt.__UNSAFE_SIGN_NONSEGWIT!==!1&&console.warn(`Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant. +`,bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239};var payments$3={},embed={},script={},bip66$1={};Object.defineProperty(bip66$1,"__esModule",{value:!0});bip66$1.encode=bip66$1.decode=bip66$1.check=void 0;function check$d(tt){if(tt.length<8||tt.length>72||tt[0]!==48||tt[1]!==tt.length-2||tt[2]!==2)return!1;const et=tt[3];if(et===0||5+et>=tt.length||tt[4+et]!==2)return!1;const nt=tt[5+et];return!(nt===0||6+et+nt!==tt.length||tt[4]&128||et>1&&tt[4]===0&&!(tt[5]&128)||tt[et+6]&128||nt>1&&tt[et+6]===0&&!(tt[et+7]&128))}bip66$1.check=check$d;function decode$n(tt){if(tt.length<8)throw new Error("DER sequence length is too short");if(tt.length>72)throw new Error("DER sequence length is too long");if(tt[0]!==48)throw new Error("Expected DER sequence");if(tt[1]!==tt.length-2)throw new Error("DER sequence length is invalid");if(tt[2]!==2)throw new Error("Expected DER integer");const et=tt[3];if(et===0)throw new Error("R length is zero");if(5+et>=tt.length)throw new Error("R length is too long");if(tt[4+et]!==2)throw new Error("Expected DER integer (2)");const nt=tt[5+et];if(nt===0)throw new Error("S length is zero");if(6+et+nt!==tt.length)throw new Error("S length is invalid");if(tt[4]&128)throw new Error("R value is negative");if(et>1&&tt[4]===0&&!(tt[5]&128))throw new Error("R value excessively padded");if(tt[et+6]&128)throw new Error("S value is negative");if(nt>1&&tt[et+6]===0&&!(tt[et+7]&128))throw new Error("S value excessively padded");return{r:tt.slice(4,4+et),s:tt.slice(6+et)}}bip66$1.decode=decode$n;function encode$n(tt,et){const nt=tt.length,it=et.length;if(nt===0)throw new Error("R length is zero");if(it===0)throw new Error("S length is zero");if(nt>33)throw new Error("R length is too long");if(it>33)throw new Error("S length is too long");if(tt[0]&128)throw new Error("R value is negative");if(et[0]&128)throw new Error("S value is negative");if(nt>1&&tt[0]===0&&!(tt[1]&128))throw new Error("R value excessively padded");if(it>1&&et[0]===0&&!(et[1]&128))throw new Error("S value excessively padded");const rt=Buffer.allocUnsafe(6+nt+it);return rt[0]=48,rt[1]=rt.length-2,rt[2]=2,rt[3]=tt.length,tt.copy(rt,4),rt[4+nt]=2,rt[5+nt]=et.length,et.copy(rt,6+nt),rt}bip66$1.encode=encode$n;var ops={};Object.defineProperty(ops,"__esModule",{value:!0});ops.REVERSE_OPS=ops.OPS=void 0;const OPS$8={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKSIGADD:186,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};ops.OPS=OPS$8;const REVERSE_OPS={};ops.REVERSE_OPS=REVERSE_OPS;for(const tt of Object.keys(OPS$8)){const et=OPS$8[tt];REVERSE_OPS[et]=tt}var push_data={};Object.defineProperty(push_data,"__esModule",{value:!0});push_data.decode=push_data.encode=push_data.encodingLength=void 0;const ops_1=ops;function encodingLength$2(tt){return tttt.length)return null;it=tt.readUInt8(et+1),rt=2}else if(nt===ops_1.OPS.OP_PUSHDATA2){if(et+3>tt.length)return null;it=tt.readUInt16LE(et+1),rt=3}else{if(et+5>tt.length)return null;if(nt!==ops_1.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");it=tt.readUInt32LE(et+1),rt=5}return{opcode:nt,number:it,size:rt}}push_data.decode=decode$m;var script_number={};Object.defineProperty(script_number,"__esModule",{value:!0});script_number.encode=script_number.decode=void 0;function decode$l(tt,et,nt){et=et||4,nt=nt===void 0?!0:nt;const it=tt.length;if(it===0)return 0;if(it>et)throw new TypeError("Script number overflow");if(nt&&!(tt[it-1]&127)&&(it<=1||!(tt[it-2]&128)))throw new Error("Non-minimally encoded script number");if(it===5){const ot=tt.readUInt32LE(0),at=tt.readUInt8(4);return at&128?-((at&-129)*4294967296+ot):at*4294967296+ot}let rt=0;for(let ot=0;ot2147483647?5:tt>8388607?4:tt>32767?3:tt>127?2:tt>0?1:0}function encode$l(tt){let et=Math.abs(tt);const nt=scriptNumSize(et),it=Buffer.allocUnsafe(nt),rt=tt<0;for(let ot=0;ot>=8;return it[nt-1]&128?it.writeUInt8(rt?128:0,nt-1):rt&&(it[nt-1]|=128),it}script_number.encode=encode$l;var script_signature={},types$7={},types$6={Array:function(tt){return tt!=null&&tt.constructor===Array},Boolean:function(tt){return typeof tt=="boolean"},Function:function(tt){return typeof tt=="function"},Nil:function(tt){return tt==null},Number:function(tt){return typeof tt=="number"},Object:function(tt){return typeof tt=="object"},String:function(tt){return typeof tt=="string"},"":function(){return!0}};types$6.Null=types$6.Nil;for(var typeName$1 in types$6)types$6[typeName$1].toJSON=(function(tt){return tt}).bind(null,typeName$1);var native$1=types$6,native=native$1;function getTypeName(tt){return tt.name||tt.toString().match(/function (.*?)\s*\(/)[1]}function getValueTypeName$1(tt){return native.Nil(tt)?"":getTypeName(tt.constructor)}function getValue$3(tt){return native.Function(tt)?"":native.String(tt)?JSON.stringify(tt):tt&&native.Object(tt)?"":tt}function captureStackTrace(tt,et){Error.captureStackTrace&&Error.captureStackTrace(tt,et)}function tfJSON$1(tt){return native.Function(tt)?tt.toJSON?tt.toJSON():getTypeName(tt):native.Array(tt)?"Array":tt&&native.Object(tt)?"Object":tt!==void 0?tt:""}function tfErrorString(tt,et,nt){var it=getValue$3(et);return"Expected "+tfJSON$1(tt)+", got"+(nt!==""?" "+nt:"")+(it!==""?" "+it:"")}function TfTypeError$1(tt,et,nt){nt=nt||getValueTypeName$1(et),this.message=tfErrorString(tt,et,nt),captureStackTrace(this,TfTypeError$1),this.__type=tt,this.__value=et,this.__valueTypeName=nt}TfTypeError$1.prototype=Object.create(Error.prototype);TfTypeError$1.prototype.constructor=TfTypeError$1;function tfPropertyErrorString(tt,et,nt,it,rt){var ot='" of type ';return et==="key"&&(ot='" with key type '),tfErrorString('property "'+tfJSON$1(nt)+ot+tfJSON$1(tt),it,rt)}function TfPropertyTypeError$1(tt,et,nt,it,rt){tt?(rt=rt||getValueTypeName$1(it),this.message=tfPropertyErrorString(tt,nt,et,it,rt)):this.message='Unexpected property "'+et+'"',captureStackTrace(this,TfTypeError$1),this.__label=nt,this.__property=et,this.__type=tt,this.__value=it,this.__valueTypeName=rt}TfPropertyTypeError$1.prototype=Object.create(Error.prototype);TfPropertyTypeError$1.prototype.constructor=TfTypeError$1;function tfCustomError(tt,et){return new TfTypeError$1(tt,{},et)}function tfSubError$1(tt,et,nt){return tt instanceof TfPropertyTypeError$1?(et=et+"."+tt.__property,tt=new TfPropertyTypeError$1(tt.__type,et,tt.__label,tt.__value,tt.__valueTypeName)):tt instanceof TfTypeError$1&&(tt=new TfPropertyTypeError$1(tt.__type,et,nt,tt.__value,tt.__valueTypeName)),captureStackTrace(tt),tt}var errors$1={TfTypeError:TfTypeError$1,TfPropertyTypeError:TfPropertyTypeError$1,tfCustomError,tfSubError:tfSubError$1,tfJSON:tfJSON$1,getValueTypeName:getValueTypeName$1},extra,hasRequiredExtra;function requireExtra(){if(hasRequiredExtra)return extra;hasRequiredExtra=1;var tt=native$1,et=errors$1;function nt(Et){return Buffer.isBuffer(Et)}function it(Et){return typeof Et=="string"&&/^([0-9a-f]{2})+$/i.test(Et)}function rt(Et,$t){var It=Et.toJSON();function Ft(Ht){if(!Et(Ht))return!1;if(Ht.length===$t)return!0;throw et.tfCustomError(It+"(Length: "+$t+")",It+"(Length: "+Ht.length+")")}return Ft.toJSON=function(){return It},Ft}var ot=rt.bind(null,tt.Array),at=rt.bind(null,nt),st=rt.bind(null,it),lt=rt.bind(null,tt.String);function ct(Et,$t,It){It=It||tt.Number;function Ft(Ht,zt){return It(Ht,zt)&&Ht>Et&&Ht<$t}return Ft.toJSON=function(){return`${It.toJSON()} between [${Et}, ${$t}]`},Ft}var ut=Math.pow(2,53)-1;function ht(Et){return typeof Et=="number"&&isFinite(Et)}function dt(Et){return Et<<24>>24===Et}function pt(Et){return Et<<16>>16===Et}function mt(Et){return(Et|0)===Et}function gt(Et){return typeof Et=="number"&&Et>=-ut&&Et<=ut&&Math.floor(Et)===Et}function bt(Et){return(Et&255)===Et}function yt(Et){return(Et&65535)===Et}function wt(Et){return Et>>>0===Et}function vt(Et){return typeof Et=="number"&&Et>=0&&Et<=ut&&Math.floor(Et)===Et}var xt={ArrayN:ot,Buffer:nt,BufferN:at,Finite:ht,Hex:it,HexN:st,Int8:dt,Int16:pt,Int32:mt,Int53:gt,Range:ct,StringN:lt,UInt8:bt,UInt16:yt,UInt32:wt,UInt53:vt};for(var St in xt)xt[St].toJSON=(function(Et){return Et}).bind(null,St);return extra=xt,extra}var ERRORS=errors$1,NATIVE=native$1,tfJSON=ERRORS.tfJSON,TfTypeError=ERRORS.TfTypeError,TfPropertyTypeError=ERRORS.TfPropertyTypeError,tfSubError=ERRORS.tfSubError,getValueTypeName=ERRORS.getValueTypeName,TYPES={arrayOf:function(et,nt){et=compile$1(et),nt=nt||{};function it(rt,ot){return!NATIVE.Array(rt)||NATIVE.Nil(rt)||nt.minLength!==void 0&&rt.lengthnt.maxLength||nt.length!==void 0&&rt.length!==nt.length?!1:rt.every(function(at,st){try{return typeforce$4(et,at,ot)}catch(lt){throw tfSubError(lt,st)}})}return it.toJSON=function(){var rt="["+tfJSON(et)+"]";return nt.length!==void 0?rt+="{"+nt.length+"}":(nt.minLength!==void 0||nt.maxLength!==void 0)&&(rt+="{"+(nt.minLength===void 0?0:nt.minLength)+","+(nt.maxLength===void 0?1/0:nt.maxLength)+"}"),rt},it},maybe:function tt(et){et=compile$1(et);function nt(it,rt){return NATIVE.Nil(it)||et(it,rt,tt)}return nt.toJSON=function(){return"?"+tfJSON(et)},nt},map:function(et,nt){et=compile$1(et),nt&&(nt=compile$1(nt));function it(rt,ot){if(!NATIVE.Object(rt)||NATIVE.Nil(rt))return!1;for(var at in rt){try{nt&&typeforce$4(nt,at,ot)}catch(lt){throw tfSubError(lt,at,"key")}try{var st=rt[at];typeforce$4(et,st,ot)}catch(lt){throw tfSubError(lt,at)}}return!0}return nt?it.toJSON=function(){return"{"+tfJSON(nt)+": "+tfJSON(et)+"}"}:it.toJSON=function(){return"{"+tfJSON(et)+"}"},it},object:function(et){var nt={};for(var it in et)nt[it]=compile$1(et[it]);function rt(ot,at){if(!NATIVE.Object(ot)||NATIVE.Nil(ot))return!1;var st;try{for(st in nt){var lt=nt[st],ct=ot[st];typeforce$4(lt,ct,at)}}catch(ut){throw tfSubError(ut,st)}if(at){for(st in ot)if(!nt[st])throw new TfPropertyTypeError(void 0,st)}return!0}return rt.toJSON=function(){return tfJSON(nt)},rt},anyOf:function(){var et=[].slice.call(arguments).map(compile$1);function nt(it,rt){return et.some(function(ot){try{return typeforce$4(ot,it,rt)}catch{return!1}})}return nt.toJSON=function(){return et.map(tfJSON).join("|")},nt},allOf:function(){var et=[].slice.call(arguments).map(compile$1);function nt(it,rt){return et.every(function(ot){try{return typeforce$4(ot,it,rt)}catch{return!1}})}return nt.toJSON=function(){return et.map(tfJSON).join(" & ")},nt},quacksLike:function(et){function nt(it){return et===getValueTypeName(it)}return nt.toJSON=function(){return et},nt},tuple:function(){var et=[].slice.call(arguments).map(compile$1);function nt(it,rt){return NATIVE.Nil(it)||NATIVE.Nil(it.length)||rt&&it.length!==et.length?!1:et.every(function(ot,at){try{return typeforce$4(ot,it[at],rt)}catch(st){throw tfSubError(st,at)}})}return nt.toJSON=function(){return"("+et.map(tfJSON).join(", ")+")"},nt},value:function(et){function nt(it){return it===et}return nt.toJSON=function(){return et},nt}};TYPES.oneOf=TYPES.anyOf;function compile$1(tt){if(NATIVE.String(tt))return tt[0]==="?"?TYPES.maybe(tt.slice(1)):NATIVE[tt]||TYPES.quacksLike(tt);if(tt&&NATIVE.Object(tt)){if(NATIVE.Array(tt)){if(tt.length!==1)throw new TypeError("Expected compile() parameter of type Array of length 1");return TYPES.arrayOf(tt[0])}return TYPES.object(tt)}else if(NATIVE.Function(tt))return tt;return TYPES.value(tt)}function typeforce$4(tt,et,nt,it){if(NATIVE.Function(tt)){if(tt(et,nt))return!0;throw new TfTypeError(it||tt,et)}return typeforce$4(compile$1(tt),et,nt)}for(var typeName in NATIVE)typeforce$4[typeName]=NATIVE[typeName];for(typeName in TYPES)typeforce$4[typeName]=TYPES[typeName];var EXTRA=requireExtra();for(typeName in EXTRA)typeforce$4[typeName]=EXTRA[typeName];typeforce$4.compile=compile$1;typeforce$4.TfTypeError=TfTypeError;typeforce$4.TfPropertyTypeError=TfPropertyTypeError;var typeforce_1=typeforce$4;(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.oneOf=tt.Null=tt.BufferN=tt.Function=tt.UInt32=tt.UInt8=tt.tuple=tt.maybe=tt.Hex=tt.Buffer=tt.String=tt.Boolean=tt.Array=tt.Number=tt.Hash256bit=tt.Hash160bit=tt.Buffer256bit=tt.isTaptree=tt.isTapleaf=tt.TAPLEAF_VERSION_MASK=tt.Network=tt.ECPoint=tt.Satoshi=tt.Signer=tt.BIP32Path=tt.UInt31=tt.isPoint=tt.typeforce=void 0;const et=buffer$2;tt.typeforce=typeforce_1;const nt=et.Buffer.alloc(32,0),it=et.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");function rt(pt){if(!et.Buffer.isBuffer(pt)||pt.length<33)return!1;const mt=pt[0],gt=pt.slice(1,33);if(gt.compare(nt)===0||gt.compare(it)>=0)return!1;if((mt===2||mt===3)&&pt.length===33)return!0;const bt=pt.slice(33);return bt.compare(nt)===0||bt.compare(it)>=0?!1:mt===4&&pt.length===65}tt.isPoint=rt;const ot=Math.pow(2,31)-1;function at(pt){return tt.typeforce.UInt32(pt)&&pt<=ot}tt.UInt31=at;function st(pt){return tt.typeforce.String(pt)&&!!pt.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}tt.BIP32Path=st,st.toJSON=()=>"BIP32 derivation path";function lt(pt){return(tt.typeforce.Buffer(pt.publicKey)||typeof pt.getPublicKey=="function")&&typeof pt.sign=="function"}tt.Signer=lt;const ct=21*1e14;function ut(pt){return tt.typeforce.UInt53(pt)&&pt<=ct}tt.Satoshi=ut,tt.ECPoint=tt.typeforce.quacksLike("Point"),tt.Network=tt.typeforce.compile({messagePrefix:tt.typeforce.oneOf(tt.typeforce.Buffer,tt.typeforce.String),bip32:{public:tt.typeforce.UInt32,private:tt.typeforce.UInt32},pubKeyHash:tt.typeforce.UInt8,scriptHash:tt.typeforce.UInt8,wif:tt.typeforce.UInt8}),tt.TAPLEAF_VERSION_MASK=254;function ht(pt){return!pt||!("output"in pt)||!et.Buffer.isBuffer(pt.output)?!1:pt.version!==void 0?(pt.version&tt.TAPLEAF_VERSION_MASK)===pt.version:!0}tt.isTapleaf=ht;function dt(pt){return(0,tt.Array)(pt)?pt.length!==2?!1:pt.every(mt=>dt(mt)):ht(pt)}tt.isTaptree=dt,tt.Buffer256bit=tt.typeforce.BufferN(32),tt.Hash160bit=tt.typeforce.BufferN(20),tt.Hash256bit=tt.typeforce.BufferN(32),tt.Number=tt.typeforce.Number,tt.Array=tt.typeforce.Array,tt.Boolean=tt.typeforce.Boolean,tt.String=tt.typeforce.String,tt.Buffer=tt.typeforce.Buffer,tt.Hex=tt.typeforce.Hex,tt.maybe=tt.typeforce.maybe,tt.tuple=tt.typeforce.tuple,tt.UInt8=tt.typeforce.UInt8,tt.UInt32=tt.typeforce.UInt32,tt.Function=tt.typeforce.Function,tt.BufferN=tt.typeforce.BufferN,tt.Null=tt.typeforce.Null,tt.oneOf=tt.typeforce.oneOf})(types$7);Object.defineProperty(script_signature,"__esModule",{value:!0});script_signature.encode=script_signature.decode=void 0;const bip66=bip66$1,types$5=types$7,{typeforce:typeforce$3}=types$5,ZERO$1=Buffer.alloc(1,0);function toDER(tt){let et=0;for(;tt[et]===0;)++et;return et===tt.length?ZERO$1:(tt=tt.slice(et),tt[0]&128?Buffer.concat([ZERO$1,tt],1+tt.length):tt)}function fromDER(tt){tt[0]===0&&(tt=tt.slice(1));const et=Buffer.alloc(32,0),nt=Math.max(0,32-tt.length);return tt.copy(et,nt),et}function decode$k(tt){const et=tt.readUInt8(tt.length-1),nt=et&-129;if(nt<=0||nt>=4)throw new Error("Invalid hashType "+et);const it=bip66.decode(tt.slice(0,-1)),rt=fromDER(it.r),ot=fromDER(it.s);return{signature:Buffer.concat([rt,ot],64),hashType:et}}script_signature.decode=decode$k;function encode$k(tt,et){typeforce$3({signature:types$5.BufferN(64),hashType:types$5.UInt8},{signature:tt,hashType:et});const nt=et&-129;if(nt<=0||nt>=4)throw new Error("Invalid hashType "+et);const it=Buffer.allocUnsafe(1);it.writeUInt8(et,0);const rt=toDER(tt.slice(0,32)),ot=toDER(tt.slice(32,64));return Buffer.concat([bip66.encode(rt,ot),it])}script_signature.encode=encode$k;(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.signature=tt.number=tt.isCanonicalScriptSignature=tt.isDefinedHashType=tt.isCanonicalPubKey=tt.toStack=tt.fromASM=tt.toASM=tt.decompile=tt.compile=tt.countNonPushOnlyOPs=tt.isPushOnly=tt.OPS=void 0;const et=bip66$1,nt=ops;Object.defineProperty(tt,"OPS",{enumerable:!0,get:function(){return nt.OPS}});const it=push_data,rt=script_number,ot=script_signature,at=types$7,{typeforce:st}=at,lt=nt.OPS.OP_RESERVED;function ct(Ft){return at.Number(Ft)&&(Ft===nt.OPS.OP_0||Ft>=nt.OPS.OP_1&&Ft<=nt.OPS.OP_16||Ft===nt.OPS.OP_1NEGATE)}function ut(Ft){return at.Buffer(Ft)||ct(Ft)}function ht(Ft){return at.Array(Ft)&&Ft.every(ut)}tt.isPushOnly=ht;function dt(Ft){return Ft.length-Ft.filter(ut).length}tt.countNonPushOnlyOPs=dt;function pt(Ft){if(Ft.length===0)return nt.OPS.OP_0;if(Ft.length===1){if(Ft[0]>=1&&Ft[0]<=16)return lt+Ft[0];if(Ft[0]===129)return nt.OPS.OP_1NEGATE}}function mt(Ft){return Buffer.isBuffer(Ft)}function gt(Ft){return at.Array(Ft)}function bt(Ft){return Buffer.isBuffer(Ft)}function yt(Ft){if(mt(Ft))return Ft;st(at.Array,Ft);const Ht=Ft.reduce((jt,kt)=>bt(kt)?kt.length===1&&pt(kt)!==void 0?jt+1:jt+it.encodingLength(kt.length)+kt.length:jt+1,0),zt=Buffer.allocUnsafe(Ht);let Ot=0;if(Ft.forEach(jt=>{if(bt(jt)){const kt=pt(jt);if(kt!==void 0){zt.writeUInt8(kt,Ot),Ot+=1;return}Ot+=it.encode(zt,jt.length,Ot),jt.copy(zt,Ot),Ot+=jt.length}else zt.writeUInt8(jt,Ot),Ot+=1}),Ot!==zt.length)throw new Error("Could not decode chunks");return zt}tt.compile=yt;function wt(Ft){if(gt(Ft))return Ft;st(at.Buffer,Ft);const Ht=[];let zt=0;for(;ztnt.OPS.OP_0&&Ot<=nt.OPS.OP_PUSHDATA4){const jt=it.decode(Ft,zt);if(jt===null||(zt+=jt.size,zt+jt.number>Ft.length))return null;const kt=Ft.slice(zt,zt+jt.number);zt+=jt.number;const Tt=pt(kt);Tt!==void 0?Ht.push(Tt):Ht.push(kt)}else Ht.push(Ot),zt+=1}return Ht}tt.decompile=wt;function vt(Ft){return mt(Ft)&&(Ft=wt(Ft)),Ft.map(Ht=>{if(bt(Ht)){const zt=pt(Ht);if(zt===void 0)return Ht.toString("hex");Ht=zt}return nt.REVERSE_OPS[Ht]}).join(" ")}tt.toASM=vt;function xt(Ft){return st(at.String,Ft),yt(Ft.split(" ").map(Ht=>nt.OPS[Ht]!==void 0?nt.OPS[Ht]:(st(at.Hex,Ht),Buffer.from(Ht,"hex"))))}tt.fromASM=xt;function St(Ft){return Ft=wt(Ft),st(ht,Ft),Ft.map(Ht=>bt(Ht)?Ht:Ht===nt.OPS.OP_0?Buffer.allocUnsafe(0):rt.encode(Ht-lt))}tt.toStack=St;function Et(Ft){return at.isPoint(Ft)}tt.isCanonicalPubKey=Et;function $t(Ft){const Ht=Ft&-129;return Ht>0&&Ht<4}tt.isDefinedHashType=$t;function It(Ft){return!Buffer.isBuffer(Ft)||!$t(Ft[Ft.length-1])?!1:et.check(Ft.slice(0,-1))}tt.isCanonicalScriptSignature=It,tt.number=rt,tt.signature=ot})(script);var lazy$a={};Object.defineProperty(lazy$a,"__esModule",{value:!0});lazy$a.value=lazy$a.prop=void 0;function prop(tt,et,nt){Object.defineProperty(tt,et,{configurable:!0,enumerable:!0,get(){const it=nt.call(this);return this[et]=it,it},set(it){Object.defineProperty(this,et,{configurable:!0,enumerable:!0,value:it,writable:!0})}})}lazy$a.prop=prop;function value$1(tt){let et;return()=>(et!==void 0||(et=tt()),et)}lazy$a.value=value$1;Object.defineProperty(embed,"__esModule",{value:!0});embed.p2data=void 0;const networks_1$8=networks$1,bscript$b=script,types_1$9=types$7,lazy$9=lazy$a,OPS$7=bscript$b.OPS;function stacksEqual$4(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}function p2data(tt,et){if(!tt.data&&!tt.output)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$9.typeforce)({network:types_1$9.typeforce.maybe(types_1$9.typeforce.Object),output:types_1$9.typeforce.maybe(types_1$9.typeforce.Buffer),data:types_1$9.typeforce.maybe(types_1$9.typeforce.arrayOf(types_1$9.typeforce.Buffer))},tt);const it={name:"embed",network:tt.network||networks_1$8.bitcoin};if(lazy$9.prop(it,"output",()=>{if(tt.data)return bscript$b.compile([OPS$7.OP_RETURN].concat(tt.data))}),lazy$9.prop(it,"data",()=>{if(tt.output)return bscript$b.decompile(tt.output).slice(1)}),et.validate&&tt.output){const rt=bscript$b.decompile(tt.output);if(rt[0]!==OPS$7.OP_RETURN)throw new TypeError("Output is invalid");if(!rt.slice(1).every(types_1$9.typeforce.Buffer))throw new TypeError("Output is invalid");if(tt.data&&!stacksEqual$4(tt.data,it.data))throw new TypeError("Data mismatch")}return Object.assign(it,tt)}embed.p2data=p2data;var p2ms$1={};Object.defineProperty(p2ms$1,"__esModule",{value:!0});p2ms$1.p2ms=void 0;const networks_1$7=networks$1,bscript$a=script,types_1$8=types$7,lazy$8=lazy$a,OPS$6=bscript$a.OPS,OP_INT_BASE=OPS$6.OP_RESERVED;function stacksEqual$3(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}function p2ms(tt,et){if(!tt.input&&!tt.output&&!(tt.pubkeys&&tt.m!==void 0)&&!tt.signatures)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{});function nt(lt){return bscript$a.isCanonicalScriptSignature(lt)||(et.allowIncomplete&<===OPS$6.OP_0)!==void 0}(0,types_1$8.typeforce)({network:types_1$8.typeforce.maybe(types_1$8.typeforce.Object),m:types_1$8.typeforce.maybe(types_1$8.typeforce.Number),n:types_1$8.typeforce.maybe(types_1$8.typeforce.Number),output:types_1$8.typeforce.maybe(types_1$8.typeforce.Buffer),pubkeys:types_1$8.typeforce.maybe(types_1$8.typeforce.arrayOf(types_1$8.isPoint)),signatures:types_1$8.typeforce.maybe(types_1$8.typeforce.arrayOf(nt)),input:types_1$8.typeforce.maybe(types_1$8.typeforce.Buffer)},tt);const rt={network:tt.network||networks_1$7.bitcoin};let ot=[],at=!1;function st(lt){at||(at=!0,ot=bscript$a.decompile(lt),rt.m=ot[0]-OP_INT_BASE,rt.n=ot[ot.length-2]-OP_INT_BASE,rt.pubkeys=ot.slice(1,-2))}if(lazy$8.prop(rt,"output",()=>{if(tt.m&&rt.n&&tt.pubkeys)return bscript$a.compile([].concat(OP_INT_BASE+tt.m,tt.pubkeys,OP_INT_BASE+rt.n,OPS$6.OP_CHECKMULTISIG))}),lazy$8.prop(rt,"m",()=>{if(rt.output)return st(rt.output),rt.m}),lazy$8.prop(rt,"n",()=>{if(rt.pubkeys)return rt.pubkeys.length}),lazy$8.prop(rt,"pubkeys",()=>{if(tt.output)return st(tt.output),rt.pubkeys}),lazy$8.prop(rt,"signatures",()=>{if(tt.input)return bscript$a.decompile(tt.input).slice(1)}),lazy$8.prop(rt,"input",()=>{if(tt.signatures)return bscript$a.compile([OPS$6.OP_0].concat(tt.signatures))}),lazy$8.prop(rt,"witness",()=>{if(rt.input)return[]}),lazy$8.prop(rt,"name",()=>{if(!(!rt.m||!rt.n))return`p2ms(${rt.m} of ${rt.n})`}),et.validate){if(tt.output){if(st(tt.output),!types_1$8.typeforce.Number(ot[0]))throw new TypeError("Output is invalid");if(!types_1$8.typeforce.Number(ot[ot.length-2]))throw new TypeError("Output is invalid");if(ot[ot.length-1]!==OPS$6.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(rt.m<=0||rt.n>16||rt.m>rt.n||rt.n!==ot.length-3)throw new TypeError("Output is invalid");if(!rt.pubkeys.every(lt=>(0,types_1$8.isPoint)(lt)))throw new TypeError("Output is invalid");if(tt.m!==void 0&&tt.m!==rt.m)throw new TypeError("m mismatch");if(tt.n!==void 0&&tt.n!==rt.n)throw new TypeError("n mismatch");if(tt.pubkeys&&!stacksEqual$3(tt.pubkeys,rt.pubkeys))throw new TypeError("Pubkeys mismatch")}if(tt.pubkeys){if(tt.n!==void 0&&tt.n!==tt.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(rt.n=tt.pubkeys.length,rt.nrt.m)throw new TypeError("Too many signatures provided")}if(tt.input){if(tt.input[0]!==OPS$6.OP_0)throw new TypeError("Input is invalid");if(rt.signatures.length===0||!rt.signatures.every(nt))throw new TypeError("Input has invalid signature(s)");if(tt.signatures&&!stacksEqual$3(tt.signatures,rt.signatures))throw new TypeError("Signature mismatch");if(tt.m!==void 0&&tt.m!==tt.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(rt,tt)}p2ms$1.p2ms=p2ms;var p2pk$1={};Object.defineProperty(p2pk$1,"__esModule",{value:!0});p2pk$1.p2pk=void 0;const networks_1$6=networks$1,bscript$9=script,types_1$7=types$7,lazy$7=lazy$a,OPS$5=bscript$9.OPS;function p2pk(tt,et){if(!tt.input&&!tt.output&&!tt.pubkey&&!tt.input&&!tt.signature)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$7.typeforce)({network:types_1$7.typeforce.maybe(types_1$7.typeforce.Object),output:types_1$7.typeforce.maybe(types_1$7.typeforce.Buffer),pubkey:types_1$7.typeforce.maybe(types_1$7.isPoint),signature:types_1$7.typeforce.maybe(bscript$9.isCanonicalScriptSignature),input:types_1$7.typeforce.maybe(types_1$7.typeforce.Buffer)},tt);const nt=lazy$7.value(()=>bscript$9.decompile(tt.input)),rt={name:"p2pk",network:tt.network||networks_1$6.bitcoin};if(lazy$7.prop(rt,"output",()=>{if(tt.pubkey)return bscript$9.compile([tt.pubkey,OPS$5.OP_CHECKSIG])}),lazy$7.prop(rt,"pubkey",()=>{if(tt.output)return tt.output.slice(1,-1)}),lazy$7.prop(rt,"signature",()=>{if(tt.input)return nt()[0]}),lazy$7.prop(rt,"input",()=>{if(tt.signature)return bscript$9.compile([tt.signature])}),lazy$7.prop(rt,"witness",()=>{if(rt.input)return[]}),et.validate){if(tt.output){if(tt.output[tt.output.length-1]!==OPS$5.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,types_1$7.isPoint)(rt.pubkey))throw new TypeError("Output pubkey is invalid");if(tt.pubkey&&!tt.pubkey.equals(rt.pubkey))throw new TypeError("Pubkey mismatch")}if(tt.signature&&tt.input&&!tt.input.equals(rt.input))throw new TypeError("Signature mismatch");if(tt.input){if(nt().length!==1)throw new TypeError("Input is invalid");if(!bscript$9.isCanonicalScriptSignature(rt.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(rt,tt)}p2pk$1.p2pk=p2pk;var p2pkh$1={},crypto$2={},ripemd160={},_sha2={},_assert={};Object.defineProperty(_assert,"__esModule",{value:!0});_assert.output=_assert.exists=_assert.hash=_assert.bytes=_assert.bool=_assert.number=void 0;function number$5(tt){if(!Number.isSafeInteger(tt)||tt<0)throw new Error(`Wrong positive integer: ${tt}`)}_assert.number=number$5;function bool$1(tt){if(typeof tt!="boolean")throw new Error(`Expected boolean, not ${tt}`)}_assert.bool=bool$1;function isBytes(tt){return tt instanceof Uint8Array||tt!=null&&typeof tt=="object"&&tt.constructor.name==="Uint8Array"}function bytes(tt,...et){if(!isBytes(tt))throw new Error("Expected Uint8Array");if(et.length>0&&!et.includes(tt.length))throw new Error(`Expected Uint8Array of length ${et}, not of length=${tt.length}`)}_assert.bytes=bytes;function hash$3(tt){if(typeof tt!="function"||typeof tt.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$5(tt.outputLen),number$5(tt.blockLen)}_assert.hash=hash$3;function exists(tt,et=!0){if(tt.destroyed)throw new Error("Hash instance has been destroyed");if(et&&tt.finished)throw new Error("Hash#digest() has already been called")}_assert.exists=exists;function output(tt,et){bytes(tt);const nt=et.outputLen;if(tt.lengthnew Uint8Array(It.buffer,It.byteOffset,It.byteLength);tt.u8=nt;const it=It=>new Uint32Array(It.buffer,It.byteOffset,Math.floor(It.byteLength/4));tt.u32=it;function rt(It){return It instanceof Uint8Array||It!=null&&typeof It=="object"&&It.constructor.name==="Uint8Array"}const ot=It=>new DataView(It.buffer,It.byteOffset,It.byteLength);tt.createView=ot;const at=(It,Ft)=>It<<32-Ft|It>>>Ft;if(tt.rotr=at,tt.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!tt.isLE)throw new Error("Non little-endian hardware is not supported");const st=Array.from({length:256},(It,Ft)=>Ft.toString(16).padStart(2,"0"));function lt(It){if(!rt(It))throw new Error("Uint8Array expected");let Ft="";for(let Ht=0;Ht=ct._0&&It<=ct._9)return It-ct._0;if(It>=ct._A&&It<=ct._F)return It-(ct._A-10);if(It>=ct._a&&It<=ct._f)return It-(ct._a-10)}function ht(It){if(typeof It!="string")throw new Error("hex string expected, got "+typeof It);const Ft=It.length,Ht=Ft/2;if(Ft%2)throw new Error("padded hex string expected, got unpadded hex of length "+Ft);const zt=new Uint8Array(Ht);for(let Ot=0,jt=0;Ot{};tt.nextTick=dt;async function pt(It,Ft,Ht){let zt=Date.now();for(let Ot=0;Ot=0&&jtIt().update(gt(zt)).digest(),Ht=It();return Ft.outputLen=Ht.outputLen,Ft.blockLen=Ht.blockLen,Ft.create=()=>It(),Ft}tt.wrapConstructor=xt;function St(It){const Ft=(zt,Ot)=>It(Ot).update(gt(zt)).digest(),Ht=It({});return Ft.outputLen=Ht.outputLen,Ft.blockLen=Ht.blockLen,Ft.create=zt=>It(zt),Ft}tt.wrapConstructorWithOpts=St;function Et(It){const Ft=(zt,Ot)=>It(Ot).update(gt(zt)).digest(),Ht=It({});return Ft.outputLen=Ht.outputLen,Ft.blockLen=Ht.blockLen,Ft.create=zt=>It(zt),Ft}tt.wrapXOFConstructorWithOpts=Et;function $t(It=32){if(et.crypto&&typeof et.crypto.getRandomValues=="function")return et.crypto.getRandomValues(new Uint8Array(It));throw new Error("crypto.getRandomValues must be defined")}tt.randomBytes=$t})(utils$2);Object.defineProperty(_sha2,"__esModule",{value:!0});_sha2.SHA2=void 0;const _assert_js_1=_assert,utils_js_1$3=utils$2;function setBigUint64(tt,et,nt,it){if(typeof tt.setBigUint64=="function")return tt.setBigUint64(et,nt,it);const rt=BigInt(32),ot=BigInt(4294967295),at=Number(nt>>rt&ot),st=Number(nt&ot),lt=it?4:0,ct=it?0:4;tt.setUint32(et+lt,at,it),tt.setUint32(et+ct,st,it)}class SHA2 extends utils_js_1$3.Hash{constructor(et,nt,it,rt){super(),this.blockLen=et,this.outputLen=nt,this.padOffset=it,this.isLE=rt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(et),this.view=(0,utils_js_1$3.createView)(this.buffer)}update(et){(0,_assert_js_1.exists)(this);const{view:nt,buffer:it,blockLen:rt}=this;et=(0,utils_js_1$3.toBytes)(et);const ot=et.length;for(let at=0;atrt-at&&(this.process(it,0),at=0);for(let ht=at;htut.length)throw new Error("_sha2: outputLen bigger than state");for(let ht=0;htet),Pi=Id.map(tt=>(9*tt+5)%16);let idxL=[Id],idxR=[Pi];for(let tt=0;tt<4;tt++)for(let et of[idxL,idxR])et.push(et[tt].map(nt=>Rho[nt]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(tt=>new Uint8Array(tt)),shiftsL=idxL.map((tt,et)=>tt.map(nt=>shifts[et][nt])),shiftsR=idxR.map((tt,et)=>tt.map(nt=>shifts[et][nt])),Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),rotl$1=(tt,et)=>tt<>>32-et;function f$2(tt,et,nt,it){return tt===0?et^nt^it:tt===1?et&nt|~et&it:tt===2?(et|~nt)^it:tt===3?et&it|nt&~it:et^(nt|~it)}const BUF=new Uint32Array(16);class RIPEMD160 extends _sha2_js_1$2.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:et,h1:nt,h2:it,h3:rt,h4:ot}=this;return[et,nt,it,rt,ot]}set(et,nt,it,rt,ot){this.h0=et|0,this.h1=nt|0,this.h2=it|0,this.h3=rt|0,this.h4=ot|0}process(et,nt){for(let pt=0;pt<16;pt++,nt+=4)BUF[pt]=et.getUint32(nt,!0);let it=this.h0|0,rt=it,ot=this.h1|0,at=ot,st=this.h2|0,lt=st,ct=this.h3|0,ut=ct,ht=this.h4|0,dt=ht;for(let pt=0;pt<5;pt++){const mt=4-pt,gt=Kl[pt],bt=Kr[pt],yt=idxL[pt],wt=idxR[pt],vt=shiftsL[pt],xt=shiftsR[pt];for(let St=0;St<16;St++){const Et=rotl$1(it+f$2(pt,ot,st,ct)+BUF[yt[St]]+gt,vt[St])+ht|0;it=ht,ht=ct,ct=rotl$1(st,10)|0,st=ot,ot=Et}for(let St=0;St<16;St++){const Et=rotl$1(rt+f$2(mt,at,lt,ut)+BUF[wt[St]]+bt,xt[St])+dt|0;rt=dt,dt=ut,ut=rotl$1(lt,10)|0,lt=at,at=Et}}this.set(this.h1+st+ut|0,this.h2+ct+dt|0,this.h3+ht+rt|0,this.h4+it+at|0,this.h0+ot+lt|0)}roundClean(){BUF.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}ripemd160.RIPEMD160=RIPEMD160;ripemd160.ripemd160=(0,utils_js_1$2.wrapConstructor)(()=>new RIPEMD160);var sha1={};Object.defineProperty(sha1,"__esModule",{value:!0});sha1.sha1=void 0;const _sha2_js_1$1=_sha2,utils_js_1$1=utils$2,rotl=(tt,et)=>tt<>>32-et>>>0,Chi$1=(tt,et,nt)=>tt&et^~tt&nt,Maj$1=(tt,et,nt)=>tt&et^tt&nt^et&nt,IV$1=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),SHA1_W=new Uint32Array(80);class SHA1 extends _sha2_js_1$1.SHA2{constructor(){super(64,20,8,!1),this.A=IV$1[0]|0,this.B=IV$1[1]|0,this.C=IV$1[2]|0,this.D=IV$1[3]|0,this.E=IV$1[4]|0}get(){const{A:et,B:nt,C:it,D:rt,E:ot}=this;return[et,nt,it,rt,ot]}set(et,nt,it,rt,ot){this.A=et|0,this.B=nt|0,this.C=it|0,this.D=rt|0,this.E=ot|0}process(et,nt){for(let lt=0;lt<16;lt++,nt+=4)SHA1_W[lt]=et.getUint32(nt,!1);for(let lt=16;lt<80;lt++)SHA1_W[lt]=rotl(SHA1_W[lt-3]^SHA1_W[lt-8]^SHA1_W[lt-14]^SHA1_W[lt-16],1);let{A:it,B:rt,C:ot,D:at,E:st}=this;for(let lt=0;lt<80;lt++){let ct,ut;lt<20?(ct=Chi$1(rt,ot,at),ut=1518500249):lt<40?(ct=rt^ot^at,ut=1859775393):lt<60?(ct=Maj$1(rt,ot,at),ut=2400959708):(ct=rt^ot^at,ut=3395469782);const ht=rotl(it,5)+ct+st+ut+SHA1_W[lt]|0;st=at,at=ot,ot=rotl(rt,30),rt=it,it=ht}it=it+this.A|0,rt=rt+this.B|0,ot=ot+this.C|0,at=at+this.D|0,st=st+this.E|0,this.set(it,rt,ot,at,st)}roundClean(){SHA1_W.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}}sha1.sha1=(0,utils_js_1$1.wrapConstructor)(()=>new SHA1);var sha256$2={};Object.defineProperty(sha256$2,"__esModule",{value:!0});sha256$2.sha224=sha256$2.sha256=void 0;const _sha2_js_1=_sha2,utils_js_1=utils$2,Chi=(tt,et,nt)=>tt&et^~tt&nt,Maj=(tt,et,nt)=>tt&et^tt&nt^et&nt,SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends _sha2_js_1.SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:et,B:nt,C:it,D:rt,E:ot,F:at,G:st,H:lt}=this;return[et,nt,it,rt,ot,at,st,lt]}set(et,nt,it,rt,ot,at,st,lt){this.A=et|0,this.B=nt|0,this.C=it|0,this.D=rt|0,this.E=ot|0,this.F=at|0,this.G=st|0,this.H=lt|0}process(et,nt){for(let ht=0;ht<16;ht++,nt+=4)SHA256_W[ht]=et.getUint32(nt,!1);for(let ht=16;ht<64;ht++){const dt=SHA256_W[ht-15],pt=SHA256_W[ht-2],mt=(0,utils_js_1.rotr)(dt,7)^(0,utils_js_1.rotr)(dt,18)^dt>>>3,gt=(0,utils_js_1.rotr)(pt,17)^(0,utils_js_1.rotr)(pt,19)^pt>>>10;SHA256_W[ht]=gt+SHA256_W[ht-7]+mt+SHA256_W[ht-16]|0}let{A:it,B:rt,C:ot,D:at,E:st,F:lt,G:ct,H:ut}=this;for(let ht=0;ht<64;ht++){const dt=(0,utils_js_1.rotr)(st,6)^(0,utils_js_1.rotr)(st,11)^(0,utils_js_1.rotr)(st,25),pt=ut+dt+Chi(st,lt,ct)+SHA256_K[ht]+SHA256_W[ht]|0,gt=((0,utils_js_1.rotr)(it,2)^(0,utils_js_1.rotr)(it,13)^(0,utils_js_1.rotr)(it,22))+Maj(it,rt,ot)|0;ut=ct,ct=lt,lt=st,st=at+pt|0,at=ot,ot=rt,rt=it,it=pt+gt|0}it=it+this.A|0,rt=rt+this.B|0,ot=ot+this.C|0,at=at+this.D|0,st=st+this.E|0,lt=lt+this.F|0,ct=ct+this.G|0,ut=ut+this.H|0,this.set(it,rt,ot,at,st,lt,ct,ut)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}sha256$2.sha256=(0,utils_js_1.wrapConstructor)(()=>new SHA256);sha256$2.sha224=(0,utils_js_1.wrapConstructor)(()=>new SHA224);(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.taggedHash=tt.TAGGED_HASH_PREFIXES=tt.TAGS=tt.hash256=tt.hash160=tt.sha256=tt.sha1=tt.ripemd160=void 0;const et=ripemd160,nt=sha1,it=sha256$2;function rt(ut){return Buffer.from((0,et.ripemd160)(Uint8Array.from(ut)))}tt.ripemd160=rt;function ot(ut){return Buffer.from((0,nt.sha1)(Uint8Array.from(ut)))}tt.sha1=ot;function at(ut){return Buffer.from((0,it.sha256)(Uint8Array.from(ut)))}tt.sha256=at;function st(ut){return Buffer.from((0,et.ripemd160)((0,it.sha256)(Uint8Array.from(ut))))}tt.hash160=st;function lt(ut){return Buffer.from((0,it.sha256)((0,it.sha256)(Uint8Array.from(ut))))}tt.hash256=lt,tt.TAGS=["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"],tt.TAGGED_HASH_PREFIXES={"BIP0340/challenge":Buffer.from([123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124,123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124]),"BIP0340/aux":Buffer.from([241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144,241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144]),"BIP0340/nonce":Buffer.from([7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47,7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47]),TapLeaf:Buffer.from([174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238,174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238]),TapBranch:Buffer.from([25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21,25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21]),TapSighash:Buffer.from([244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49,244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49]),TapTweak:Buffer.from([232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233,232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233]),"KeyAgg list":Buffer.from([72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240,72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240]),"KeyAgg coefficient":Buffer.from([191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129,191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129])};function ct(ut,ht){return at(Buffer.concat([tt.TAGGED_HASH_PREFIXES[ut],ht]))}tt.taggedHash=ct})(crypto$2);function base$1(tt){if(tt.length>=255)throw new TypeError("Alphabet too long");for(var et=new Uint8Array(256),nt=0;nt>>0,vt=new Uint8Array(wt);bt!==yt;){for(var xt=pt[bt],St=0,Et=wt-1;(xt!==0||St>>0,vt[Et]=xt%at>>>0,xt=xt/at>>>0;if(xt!==0)throw new Error("Non-zero carry");gt=St,bt++}for(var $t=wt-gt;$t!==wt&&vt[$t]===0;)$t++;for(var It=st.repeat(mt);$t>>0,wt=new Uint8Array(yt);pt[mt];){var vt=et[pt.charCodeAt(mt)];if(vt===255)return;for(var xt=0,St=yt-1;(vt!==0||xt>>0,wt[St]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");bt=xt,mt++}for(var Et=yt-bt;Et!==yt&&wt[Et]===0;)Et++;for(var $t=new Uint8Array(gt+(yt-Et)),It=gt;Et!==yt;)$t[It++]=wt[Et++];return $t}function dt(pt){var mt=ht(pt);if(mt)return mt;throw new Error("Non-base"+at+" character")}return{encode:ut,decodeUnsafe:ht,decode:dt}}var src=base$1;const basex=src,ALPHABET$1="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var bs58=basex(ALPHABET$1),base58=bs58,base=function(tt){function et(ot){var at=Uint8Array.from(ot),st=tt(at),lt=at.length+4,ct=new Uint8Array(lt);return ct.set(at,0),ct.set(st.subarray(0,4),at.length),base58.encode(ct,lt)}function nt(ot){var at=ot.slice(0,-4),st=ot.slice(-4),lt=tt(at);if(!(st[0]^lt[0]|st[1]^lt[1]|st[2]^lt[2]|st[3]^lt[3]))return at}function it(ot){var at=base58.decodeUnsafe(ot);if(at)return nt(at)}function rt(ot){var at=base58.decode(ot),st=nt(at);if(!st)throw new Error("Invalid checksum");return st}return{encode:et,decode:rt,decodeUnsafe:it}},{sha256:sha256$1}=sha256$2,bs58checkBase=base;function sha256x2(tt){return sha256$1(sha256$1(tt))}var bs58check$3=bs58checkBase(sha256x2);Object.defineProperty(p2pkh$1,"__esModule",{value:!0});p2pkh$1.p2pkh=void 0;const bcrypto$5=crypto$2,networks_1$5=networks$1,bscript$8=script,types_1$6=types$7,lazy$6=lazy$a,bs58check$2=bs58check$3,OPS$4=bscript$8.OPS;function p2pkh(tt,et){if(!tt.address&&!tt.hash&&!tt.output&&!tt.pubkey&&!tt.input)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$6.typeforce)({network:types_1$6.typeforce.maybe(types_1$6.typeforce.Object),address:types_1$6.typeforce.maybe(types_1$6.typeforce.String),hash:types_1$6.typeforce.maybe(types_1$6.typeforce.BufferN(20)),output:types_1$6.typeforce.maybe(types_1$6.typeforce.BufferN(25)),pubkey:types_1$6.typeforce.maybe(types_1$6.isPoint),signature:types_1$6.typeforce.maybe(bscript$8.isCanonicalScriptSignature),input:types_1$6.typeforce.maybe(types_1$6.typeforce.Buffer)},tt);const nt=lazy$6.value(()=>{const at=Buffer.from(bs58check$2.decode(tt.address)),st=at.readUInt8(0),lt=at.slice(1);return{version:st,hash:lt}}),it=lazy$6.value(()=>bscript$8.decompile(tt.input)),rt=tt.network||networks_1$5.bitcoin,ot={name:"p2pkh",network:rt};if(lazy$6.prop(ot,"address",()=>{if(!ot.hash)return;const at=Buffer.allocUnsafe(21);return at.writeUInt8(rt.pubKeyHash,0),ot.hash.copy(at,1),bs58check$2.encode(at)}),lazy$6.prop(ot,"hash",()=>{if(tt.output)return tt.output.slice(3,23);if(tt.address)return nt().hash;if(tt.pubkey||ot.pubkey)return bcrypto$5.hash160(tt.pubkey||ot.pubkey)}),lazy$6.prop(ot,"output",()=>{if(ot.hash)return bscript$8.compile([OPS$4.OP_DUP,OPS$4.OP_HASH160,ot.hash,OPS$4.OP_EQUALVERIFY,OPS$4.OP_CHECKSIG])}),lazy$6.prop(ot,"pubkey",()=>{if(tt.input)return it()[1]}),lazy$6.prop(ot,"signature",()=>{if(tt.input)return it()[0]}),lazy$6.prop(ot,"input",()=>{if(tt.pubkey&&tt.signature)return bscript$8.compile([tt.signature,tt.pubkey])}),lazy$6.prop(ot,"witness",()=>{if(ot.input)return[]}),et.validate){let at=Buffer.from([]);if(tt.address){if(nt().version!==rt.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(nt().hash.length!==20)throw new TypeError("Invalid address");at=nt().hash}if(tt.hash){if(at.length>0&&!at.equals(tt.hash))throw new TypeError("Hash mismatch");at=tt.hash}if(tt.output){if(tt.output.length!==25||tt.output[0]!==OPS$4.OP_DUP||tt.output[1]!==OPS$4.OP_HASH160||tt.output[2]!==20||tt.output[23]!==OPS$4.OP_EQUALVERIFY||tt.output[24]!==OPS$4.OP_CHECKSIG)throw new TypeError("Output is invalid");const st=tt.output.slice(3,23);if(at.length>0&&!at.equals(st))throw new TypeError("Hash mismatch");at=st}if(tt.pubkey){const st=bcrypto$5.hash160(tt.pubkey);if(at.length>0&&!at.equals(st))throw new TypeError("Hash mismatch");at=st}if(tt.input){const st=it();if(st.length!==2)throw new TypeError("Input is invalid");if(!bscript$8.isCanonicalScriptSignature(st[0]))throw new TypeError("Input has invalid signature");if(!(0,types_1$6.isPoint)(st[1]))throw new TypeError("Input has invalid pubkey");if(tt.signature&&!tt.signature.equals(st[0]))throw new TypeError("Signature mismatch");if(tt.pubkey&&!tt.pubkey.equals(st[1]))throw new TypeError("Pubkey mismatch");const lt=bcrypto$5.hash160(st[1]);if(at.length>0&&!at.equals(lt))throw new TypeError("Hash mismatch")}}return Object.assign(ot,tt)}p2pkh$1.p2pkh=p2pkh;var p2sh$1={};Object.defineProperty(p2sh$1,"__esModule",{value:!0});p2sh$1.p2sh=void 0;const bcrypto$4=crypto$2,networks_1$4=networks$1,bscript$7=script,types_1$5=types$7,lazy$5=lazy$a,bs58check$1=bs58check$3,OPS$3=bscript$7.OPS;function stacksEqual$2(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}function p2sh(tt,et){if(!tt.address&&!tt.hash&&!tt.output&&!tt.redeem&&!tt.input)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$5.typeforce)({network:types_1$5.typeforce.maybe(types_1$5.typeforce.Object),address:types_1$5.typeforce.maybe(types_1$5.typeforce.String),hash:types_1$5.typeforce.maybe(types_1$5.typeforce.BufferN(20)),output:types_1$5.typeforce.maybe(types_1$5.typeforce.BufferN(23)),redeem:types_1$5.typeforce.maybe({network:types_1$5.typeforce.maybe(types_1$5.typeforce.Object),output:types_1$5.typeforce.maybe(types_1$5.typeforce.Buffer),input:types_1$5.typeforce.maybe(types_1$5.typeforce.Buffer),witness:types_1$5.typeforce.maybe(types_1$5.typeforce.arrayOf(types_1$5.typeforce.Buffer))}),input:types_1$5.typeforce.maybe(types_1$5.typeforce.Buffer),witness:types_1$5.typeforce.maybe(types_1$5.typeforce.arrayOf(types_1$5.typeforce.Buffer))},tt);let nt=tt.network;nt||(nt=tt.redeem&&tt.redeem.network||networks_1$4.bitcoin);const it={network:nt},rt=lazy$5.value(()=>{const st=Buffer.from(bs58check$1.decode(tt.address)),lt=st.readUInt8(0),ct=st.slice(1);return{version:lt,hash:ct}}),ot=lazy$5.value(()=>bscript$7.decompile(tt.input)),at=lazy$5.value(()=>{const st=ot(),lt=st[st.length-1];return{network:nt,output:lt===OPS$3.OP_FALSE?Buffer.from([]):lt,input:bscript$7.compile(st.slice(0,-1)),witness:tt.witness||[]}});if(lazy$5.prop(it,"address",()=>{if(!it.hash)return;const st=Buffer.allocUnsafe(21);return st.writeUInt8(it.network.scriptHash,0),it.hash.copy(st,1),bs58check$1.encode(st)}),lazy$5.prop(it,"hash",()=>{if(tt.output)return tt.output.slice(2,22);if(tt.address)return rt().hash;if(it.redeem&&it.redeem.output)return bcrypto$4.hash160(it.redeem.output)}),lazy$5.prop(it,"output",()=>{if(it.hash)return bscript$7.compile([OPS$3.OP_HASH160,it.hash,OPS$3.OP_EQUAL])}),lazy$5.prop(it,"redeem",()=>{if(tt.input)return at()}),lazy$5.prop(it,"input",()=>{if(!(!tt.redeem||!tt.redeem.input||!tt.redeem.output))return bscript$7.compile([].concat(bscript$7.decompile(tt.redeem.input),tt.redeem.output))}),lazy$5.prop(it,"witness",()=>{if(it.redeem&&it.redeem.witness)return it.redeem.witness;if(it.input)return[]}),lazy$5.prop(it,"name",()=>{const st=["p2sh"];return it.redeem!==void 0&&it.redeem.name!==void 0&&st.push(it.redeem.name),st.join("-")}),et.validate){let st=Buffer.from([]);if(tt.address){if(rt().version!==nt.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(rt().hash.length!==20)throw new TypeError("Invalid address");st=rt().hash}if(tt.hash){if(st.length>0&&!st.equals(tt.hash))throw new TypeError("Hash mismatch");st=tt.hash}if(tt.output){if(tt.output.length!==23||tt.output[0]!==OPS$3.OP_HASH160||tt.output[1]!==20||tt.output[22]!==OPS$3.OP_EQUAL)throw new TypeError("Output is invalid");const ct=tt.output.slice(2,22);if(st.length>0&&!st.equals(ct))throw new TypeError("Hash mismatch");st=ct}const lt=ct=>{if(ct.output){const ut=bscript$7.decompile(ct.output);if(!ut||ut.length<1)throw new TypeError("Redeem.output too short");if(ct.output.byteLength>520)throw new TypeError("Redeem.output unspendable if larger than 520 bytes");if(bscript$7.countNonPushOnlyOPs(ut)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const ht=bcrypto$4.hash160(ct.output);if(st.length>0&&!st.equals(ht))throw new TypeError("Hash mismatch");st=ht}if(ct.input){const ut=ct.input.length>0,ht=ct.witness&&ct.witness.length>0;if(!ut&&!ht)throw new TypeError("Empty input");if(ut&&ht)throw new TypeError("Input and witness provided");if(ut){const dt=bscript$7.decompile(ct.input);if(!bscript$7.isPushOnly(dt))throw new TypeError("Non push-only scriptSig")}}};if(tt.input){const ct=ot();if(!ct||ct.length<1)throw new TypeError("Input too short");if(!Buffer.isBuffer(at().output))throw new TypeError("Input is invalid");lt(at())}if(tt.redeem){if(tt.redeem.network&&tt.redeem.network!==nt)throw new TypeError("Network mismatch");if(tt.input){const ct=at();if(tt.redeem.output&&!tt.redeem.output.equals(ct.output))throw new TypeError("Redeem.output mismatch");if(tt.redeem.input&&!tt.redeem.input.equals(ct.input))throw new TypeError("Redeem.input mismatch")}lt(tt.redeem)}if(tt.witness&&tt.redeem&&tt.redeem.witness&&!stacksEqual$2(tt.redeem.witness,tt.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(it,tt)}p2sh$1.p2sh=p2sh;var p2wpkh$1={},dist$1={};Object.defineProperty(dist$1,"__esModule",{value:!0});dist$1.bech32m=dist$1.bech32=void 0;const ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={};for(let tt=0;tt>25;return(tt&33554431)<<5^-(et>>0&1)&996825010^-(et>>1&1)&642813549^-(et>>2&1)&513874426^-(et>>3&1)&1027748829^-(et>>4&1)&705979059}function prefixChk(tt){let et=1;for(let nt=0;nt126)return"Invalid prefix ("+tt+")";et=polymodStep(et)^it>>5}et=polymodStep(et);for(let nt=0;nt=nt;)ot-=nt,st.push(rt>>ot&at);if(it)ot>0&&st.push(rt<=et)return"Excess padding";if(rt<lt)throw new TypeError("Exceeds length limit");at=at.toLowerCase();let ct=prefixChk(at);if(typeof ct=="string")throw new Error(ct);let ut=at+"1";for(let ht=0;ht>5)throw new Error("Non 5-bit word");ct=polymodStep(ct)^dt,ut+=ALPHABET.charAt(dt)}for(let ht=0;ht<6;++ht)ct=polymodStep(ct);ct^=et;for(let ht=0;ht<6;++ht){const dt=ct>>(5-ht)*5&31;ut+=ALPHABET.charAt(dt)}return ut}function it(at,st){if(st=st||90,at.length<8)return at+" too short";if(at.length>st)return"Exceeds length limit";const lt=at.toLowerCase(),ct=at.toUpperCase();if(at!==lt&&at!==ct)return"Mixed-case string "+at;at=lt;const ut=at.lastIndexOf("1");if(ut===-1)return"No separator character for "+at;if(ut===0)return"Missing prefix for "+at;const ht=at.slice(0,ut),dt=at.slice(ut+1);if(dt.length<6)return"Data too short";let pt=prefixChk(ht);if(typeof pt=="string")return pt;const mt=[];for(let gt=0;gt=dt.length)&&mt.push(yt)}return pt!==et?"Invalid checksum for "+at:{prefix:ht,words:mt}}function rt(at,st){const lt=it(at,st);if(typeof lt=="object")return lt}function ot(at,st){const lt=it(at,st);if(typeof lt=="object")return lt;throw new Error(lt)}return{decodeUnsafe:rt,decode:ot,encode:nt,toWords,fromWordsUnsafe,fromWords}}dist$1.bech32=getLibraryFromEncoding("bech32");dist$1.bech32m=getLibraryFromEncoding("bech32m");Object.defineProperty(p2wpkh$1,"__esModule",{value:!0});p2wpkh$1.p2wpkh=void 0;const bcrypto$3=crypto$2,networks_1$3=networks$1,bscript$6=script,types_1$4=types$7,lazy$4=lazy$a,bech32_1$3=dist$1,OPS$2=bscript$6.OPS,EMPTY_BUFFER$2=Buffer.alloc(0);function p2wpkh(tt,et){if(!tt.address&&!tt.hash&&!tt.output&&!tt.pubkey&&!tt.witness)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$4.typeforce)({address:types_1$4.typeforce.maybe(types_1$4.typeforce.String),hash:types_1$4.typeforce.maybe(types_1$4.typeforce.BufferN(20)),input:types_1$4.typeforce.maybe(types_1$4.typeforce.BufferN(0)),network:types_1$4.typeforce.maybe(types_1$4.typeforce.Object),output:types_1$4.typeforce.maybe(types_1$4.typeforce.BufferN(22)),pubkey:types_1$4.typeforce.maybe(types_1$4.isPoint),signature:types_1$4.typeforce.maybe(bscript$6.isCanonicalScriptSignature),witness:types_1$4.typeforce.maybe(types_1$4.typeforce.arrayOf(types_1$4.typeforce.Buffer))},tt);const nt=lazy$4.value(()=>{const ot=bech32_1$3.bech32.decode(tt.address),at=ot.words.shift(),st=bech32_1$3.bech32.fromWords(ot.words);return{version:at,prefix:ot.prefix,data:Buffer.from(st)}}),it=tt.network||networks_1$3.bitcoin,rt={name:"p2wpkh",network:it};if(lazy$4.prop(rt,"address",()=>{if(!rt.hash)return;const ot=bech32_1$3.bech32.toWords(rt.hash);return ot.unshift(0),bech32_1$3.bech32.encode(it.bech32,ot)}),lazy$4.prop(rt,"hash",()=>{if(tt.output)return tt.output.slice(2,22);if(tt.address)return nt().data;if(tt.pubkey||rt.pubkey)return bcrypto$3.hash160(tt.pubkey||rt.pubkey)}),lazy$4.prop(rt,"output",()=>{if(rt.hash)return bscript$6.compile([OPS$2.OP_0,rt.hash])}),lazy$4.prop(rt,"pubkey",()=>{if(tt.pubkey)return tt.pubkey;if(tt.witness)return tt.witness[1]}),lazy$4.prop(rt,"signature",()=>{if(tt.witness)return tt.witness[0]}),lazy$4.prop(rt,"input",()=>{if(rt.witness)return EMPTY_BUFFER$2}),lazy$4.prop(rt,"witness",()=>{if(tt.pubkey&&tt.signature)return[tt.signature,tt.pubkey]}),et.validate){let ot=Buffer.from([]);if(tt.address){if(it&&it.bech32!==nt().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(nt().version!==0)throw new TypeError("Invalid address version");if(nt().data.length!==20)throw new TypeError("Invalid address data");ot=nt().data}if(tt.hash){if(ot.length>0&&!ot.equals(tt.hash))throw new TypeError("Hash mismatch");ot=tt.hash}if(tt.output){if(tt.output.length!==22||tt.output[0]!==OPS$2.OP_0||tt.output[1]!==20)throw new TypeError("Output is invalid");if(ot.length>0&&!ot.equals(tt.output.slice(2)))throw new TypeError("Hash mismatch");ot=tt.output.slice(2)}if(tt.pubkey){const at=bcrypto$3.hash160(tt.pubkey);if(ot.length>0&&!ot.equals(at))throw new TypeError("Hash mismatch");if(ot=at,!(0,types_1$4.isPoint)(tt.pubkey)||tt.pubkey.length!==33)throw new TypeError("Invalid pubkey for p2wpkh")}if(tt.witness){if(tt.witness.length!==2)throw new TypeError("Witness is invalid");if(!bscript$6.isCanonicalScriptSignature(tt.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,types_1$4.isPoint)(tt.witness[1])||tt.witness[1].length!==33)throw new TypeError("Witness has invalid pubkey");if(tt.signature&&!tt.signature.equals(tt.witness[0]))throw new TypeError("Signature mismatch");if(tt.pubkey&&!tt.pubkey.equals(tt.witness[1]))throw new TypeError("Pubkey mismatch");const at=bcrypto$3.hash160(tt.witness[1]);if(ot.length>0&&!ot.equals(at))throw new TypeError("Hash mismatch")}}return Object.assign(rt,tt)}p2wpkh$1.p2wpkh=p2wpkh;var p2wsh$1={};Object.defineProperty(p2wsh$1,"__esModule",{value:!0});p2wsh$1.p2wsh=void 0;const bcrypto$2=crypto$2,networks_1$2=networks$1,bscript$5=script,types_1$3=types$7,lazy$3=lazy$a,bech32_1$2=dist$1,OPS$1=bscript$5.OPS,EMPTY_BUFFER$1=Buffer.alloc(0);function stacksEqual$1(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}function chunkHasUncompressedPubkey(tt){return!!(Buffer.isBuffer(tt)&&tt.length===65&&tt[0]===4&&(0,types_1$3.isPoint)(tt))}function p2wsh(tt,et){if(!tt.address&&!tt.hash&&!tt.output&&!tt.redeem&&!tt.witness)throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$3.typeforce)({network:types_1$3.typeforce.maybe(types_1$3.typeforce.Object),address:types_1$3.typeforce.maybe(types_1$3.typeforce.String),hash:types_1$3.typeforce.maybe(types_1$3.typeforce.BufferN(32)),output:types_1$3.typeforce.maybe(types_1$3.typeforce.BufferN(34)),redeem:types_1$3.typeforce.maybe({input:types_1$3.typeforce.maybe(types_1$3.typeforce.Buffer),network:types_1$3.typeforce.maybe(types_1$3.typeforce.Object),output:types_1$3.typeforce.maybe(types_1$3.typeforce.Buffer),witness:types_1$3.typeforce.maybe(types_1$3.typeforce.arrayOf(types_1$3.typeforce.Buffer))}),input:types_1$3.typeforce.maybe(types_1$3.typeforce.BufferN(0)),witness:types_1$3.typeforce.maybe(types_1$3.typeforce.arrayOf(types_1$3.typeforce.Buffer))},tt);const nt=lazy$3.value(()=>{const at=bech32_1$2.bech32.decode(tt.address),st=at.words.shift(),lt=bech32_1$2.bech32.fromWords(at.words);return{version:st,prefix:at.prefix,data:Buffer.from(lt)}}),it=lazy$3.value(()=>bscript$5.decompile(tt.redeem.input));let rt=tt.network;rt||(rt=tt.redeem&&tt.redeem.network||networks_1$2.bitcoin);const ot={network:rt};if(lazy$3.prop(ot,"address",()=>{if(!ot.hash)return;const at=bech32_1$2.bech32.toWords(ot.hash);return at.unshift(0),bech32_1$2.bech32.encode(rt.bech32,at)}),lazy$3.prop(ot,"hash",()=>{if(tt.output)return tt.output.slice(2);if(tt.address)return nt().data;if(ot.redeem&&ot.redeem.output)return bcrypto$2.sha256(ot.redeem.output)}),lazy$3.prop(ot,"output",()=>{if(ot.hash)return bscript$5.compile([OPS$1.OP_0,ot.hash])}),lazy$3.prop(ot,"redeem",()=>{if(tt.witness)return{output:tt.witness[tt.witness.length-1],input:EMPTY_BUFFER$1,witness:tt.witness.slice(0,-1)}}),lazy$3.prop(ot,"input",()=>{if(ot.witness)return EMPTY_BUFFER$1}),lazy$3.prop(ot,"witness",()=>{if(tt.redeem&&tt.redeem.input&&tt.redeem.input.length>0&&tt.redeem.output&&tt.redeem.output.length>0){const at=bscript$5.toStack(it());return ot.redeem=Object.assign({witness:at},tt.redeem),ot.redeem.input=EMPTY_BUFFER$1,[].concat(at,tt.redeem.output)}if(tt.redeem&&tt.redeem.output&&tt.redeem.witness)return[].concat(tt.redeem.witness,tt.redeem.output)}),lazy$3.prop(ot,"name",()=>{const at=["p2wsh"];return ot.redeem!==void 0&&ot.redeem.name!==void 0&&at.push(ot.redeem.name),at.join("-")}),et.validate){let at=Buffer.from([]);if(tt.address){if(nt().prefix!==rt.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(nt().version!==0)throw new TypeError("Invalid address version");if(nt().data.length!==32)throw new TypeError("Invalid address data");at=nt().data}if(tt.hash){if(at.length>0&&!at.equals(tt.hash))throw new TypeError("Hash mismatch");at=tt.hash}if(tt.output){if(tt.output.length!==34||tt.output[0]!==OPS$1.OP_0||tt.output[1]!==32)throw new TypeError("Output is invalid");const st=tt.output.slice(2);if(at.length>0&&!at.equals(st))throw new TypeError("Hash mismatch");at=st}if(tt.redeem){if(tt.redeem.network&&tt.redeem.network!==rt)throw new TypeError("Network mismatch");if(tt.redeem.input&&tt.redeem.input.length>0&&tt.redeem.witness&&tt.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(tt.redeem.output){const st=bscript$5.decompile(tt.redeem.output);if(!st||st.length<1)throw new TypeError("Redeem.output is invalid");if(tt.redeem.output.byteLength>3600)throw new TypeError("Redeem.output unspendable if larger than 3600 bytes");if(bscript$5.countNonPushOnlyOPs(st)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const lt=bcrypto$2.sha256(tt.redeem.output);if(at.length>0&&!at.equals(lt))throw new TypeError("Hash mismatch");at=lt}if(tt.redeem.input&&!bscript$5.isPushOnly(it()))throw new TypeError("Non push-only scriptSig");if(tt.witness&&tt.redeem.witness&&!stacksEqual$1(tt.witness,tt.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(tt.redeem.input&&it().some(chunkHasUncompressedPubkey)||tt.redeem.output&&(bscript$5.decompile(tt.redeem.output)||[]).some(chunkHasUncompressedPubkey))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(tt.witness&&tt.witness.length>0){const st=tt.witness[tt.witness.length-1];if(tt.redeem&&tt.redeem.output&&!tt.redeem.output.equals(st))throw new TypeError("Witness and redeem.output mismatch");if(tt.witness.some(chunkHasUncompressedPubkey)||(bscript$5.decompile(st)||[]).some(chunkHasUncompressedPubkey))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(ot,tt)}p2wsh$1.p2wsh=p2wsh;var p2tr$1={},ecc_lib={};Object.defineProperty(ecc_lib,"__esModule",{value:!0});ecc_lib.getEccLib=ecc_lib.initEccLib=void 0;const _ECCLIB_CACHE={};function initEccLib(tt){tt?tt!==_ECCLIB_CACHE.eccLib&&(verifyEcc(tt),_ECCLIB_CACHE.eccLib=tt):_ECCLIB_CACHE.eccLib=tt}ecc_lib.initEccLib=initEccLib;function getEccLib(){if(!_ECCLIB_CACHE.eccLib)throw new Error("No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance");return _ECCLIB_CACHE.eccLib}ecc_lib.getEccLib=getEccLib;const h$4=tt=>Buffer.from(tt,"hex");function verifyEcc(tt){assert$1(typeof tt.isXOnlyPoint=="function"),assert$1(tt.isXOnlyPoint(h$4("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),assert$1(tt.isXOnlyPoint(h$4("fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e"))),assert$1(tt.isXOnlyPoint(h$4("f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"))),assert$1(tt.isXOnlyPoint(h$4("0000000000000000000000000000000000000000000000000000000000000001"))),assert$1(!tt.isXOnlyPoint(h$4("0000000000000000000000000000000000000000000000000000000000000000"))),assert$1(!tt.isXOnlyPoint(h$4("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"))),assert$1(typeof tt.xOnlyPointAddTweak=="function"),tweakAddVectors.forEach(et=>{const nt=tt.xOnlyPointAddTweak(h$4(et.pubkey),h$4(et.tweak));et.result===null?assert$1(nt===null):(assert$1(nt!==null),assert$1(nt.parity===et.parity),assert$1(Buffer.from(nt.xOnlyPubkey).equals(h$4(et.result))))})}function assert$1(tt){if(!tt)throw new Error("ecc library invalid")}const tweakAddVectors=[{pubkey:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",tweak:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",parity:-1,result:null},{pubkey:"1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b",tweak:"a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac",parity:1,result:"e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"},{pubkey:"2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991",tweak:"823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47",parity:0,result:"9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"}];var bip341={},bufferutils={},Buffer$2=safeBufferExports.Buffer,MAX_SAFE_INTEGER$4=9007199254740991;function checkUInt53$1(tt){if(tt<0||tt>MAX_SAFE_INTEGER$4||tt%1!==0)throw new RangeError("value out of range")}function encode$j(tt,et,nt){if(checkUInt53$1(tt),et||(et=Buffer$2.allocUnsafe(encodingLength$1(tt))),!Buffer$2.isBuffer(et))throw new TypeError("buffer must be a Buffer instance");return nt||(nt=0),tt<253?(et.writeUInt8(tt,nt),encode$j.bytes=1):tt<=65535?(et.writeUInt8(253,nt),et.writeUInt16LE(tt,nt+1),encode$j.bytes=3):tt<=4294967295?(et.writeUInt8(254,nt),et.writeUInt32LE(tt,nt+1),encode$j.bytes=5):(et.writeUInt8(255,nt),et.writeUInt32LE(tt>>>0,nt+1),et.writeUInt32LE(tt/4294967296|0,nt+5),encode$j.bytes=9),et}function decode$j(tt,et){if(!Buffer$2.isBuffer(tt))throw new TypeError("buffer must be a Buffer instance");et||(et=0);var nt=tt.readUInt8(et);if(nt<253)return decode$j.bytes=1,nt;if(nt===253)return decode$j.bytes=3,tt.readUInt16LE(et+1);if(nt===254)return decode$j.bytes=5,tt.readUInt32LE(et+1);decode$j.bytes=9;var it=tt.readUInt32LE(et+1),rt=tt.readUInt32LE(et+5),ot=rt*4294967296+it;return checkUInt53$1(ot),ot}function encodingLength$1(tt){return checkUInt53$1(tt),tt<253?1:tt<=65535?3:tt<=4294967295?5:9}var varuintBitcoin={encode:encode$j,decode:decode$j,encodingLength:encodingLength$1};Object.defineProperty(bufferutils,"__esModule",{value:!0});bufferutils.BufferReader=bufferutils.BufferWriter=bufferutils.cloneBuffer=bufferutils.reverseBuffer=bufferutils.writeUInt64LE=bufferutils.readUInt64LE=bufferutils.varuint=void 0;const types$4=types$7,{typeforce:typeforce$2}=types$4,varuint$7=varuintBitcoin;bufferutils.varuint=varuint$7;function verifuint$1(tt,et){if(typeof tt!="number")throw new Error("cannot write a non-number as a number");if(tt<0)throw new Error("specified a negative value for writing an unsigned value");if(tt>et)throw new Error("RangeError: value out of range");if(Math.floor(tt)!==tt)throw new Error("value has a fractional component")}function readUInt64LE$1(tt,et){const nt=tt.readUInt32LE(et);let it=tt.readUInt32LE(et+4);return it*=4294967296,verifuint$1(it+nt,9007199254740991),it+nt}bufferutils.readUInt64LE=readUInt64LE$1;function writeUInt64LE$1(tt,et,nt){return verifuint$1(et,9007199254740991),tt.writeInt32LE(et&-1,nt),tt.writeUInt32LE(Math.floor(et/4294967296),nt+4),nt+8}bufferutils.writeUInt64LE=writeUInt64LE$1;function reverseBuffer$1(tt){if(tt.length<1)return tt;let et=tt.length-1,nt=0;for(let it=0;itthis.writeVarSlice(nt))}end(){if(this.buffer.length===this.offset)return this.buffer;throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`)}}bufferutils.BufferWriter=BufferWriter;class BufferReader{constructor(et,nt=0){this.buffer=et,this.offset=nt,typeforce$2(types$4.tuple(types$4.Buffer,types$4.UInt32),[et,nt])}readUInt8(){const et=this.buffer.readUInt8(this.offset);return this.offset++,et}readInt32(){const et=this.buffer.readInt32LE(this.offset);return this.offset+=4,et}readUInt32(){const et=this.buffer.readUInt32LE(this.offset);return this.offset+=4,et}readUInt64(){const et=readUInt64LE$1(this.buffer,this.offset);return this.offset+=8,et}readVarInt(){const et=varuint$7.decode(this.buffer,this.offset);return this.offset+=varuint$7.decode.bytes,et}readSlice(et){if(this.buffer.length"left"in gt&&"right"in gt;function st(gt,bt){if(gt.length<33)throw new TypeError(`The control-block length is too small. Got ${gt.length}, expected min 33.`);const yt=(gt.length-33)/32;let wt=bt;for(let vt=0;vtvt.hash.compare(xt.hash));const[yt,wt]=bt;return{hash:pt(yt.hash,wt.hash),left:yt,right:wt}}tt.toHashTree=lt;function ct(gt,bt){if(at(gt)){const yt=ct(gt.left,bt);if(yt!==void 0)return[...yt,gt.right.hash];const wt=ct(gt.right,bt);if(wt!==void 0)return[...wt,gt.left.hash]}else if(gt.hash.equals(bt))return[]}tt.findScriptPath=ct;function ut(gt){const bt=gt.version||tt.LEAF_VERSION_TAPSCRIPT;return it.taggedHash("TapLeaf",et.Buffer.concat([et.Buffer.from([bt]),mt(gt.output)]))}tt.tapleafHash=ut;function ht(gt,bt){return it.taggedHash("TapTweak",et.Buffer.concat(bt?[gt,bt]:[gt]))}tt.tapTweakHash=ht;function dt(gt,bt){if(!et.Buffer.isBuffer(gt)||gt.length!==32||bt&&bt.length!==32)return null;const yt=ht(gt,bt),wt=(0,nt.getEccLib)().xOnlyPointAddTweak(gt,yt);return!wt||wt.xOnlyPubkey===null?null:{parity:wt.parity,x:et.Buffer.from(wt.xOnlyPubkey)}}tt.tweakKey=dt;function pt(gt,bt){return it.taggedHash("TapBranch",et.Buffer.concat([gt,bt]))}function mt(gt){const bt=rt.varuint.encodingLength(gt.length),yt=et.Buffer.allocUnsafe(bt);return rt.varuint.encode(gt.length,yt),et.Buffer.concat([yt,gt])}})(bip341);Object.defineProperty(p2tr$1,"__esModule",{value:!0});p2tr$1.p2tr=void 0;const buffer_1=buffer$2,networks_1$1=networks$1,bscript$4=script,types_1$2=types$7,ecc_lib_1=ecc_lib,bip341_1$2=bip341,lazy$2=lazy$a,bech32_1$1=dist$1,OPS=bscript$4.OPS,TAPROOT_WITNESS_VERSION=1,ANNEX_PREFIX=80;function p2tr(tt,et){if(!tt.address&&!tt.output&&!tt.pubkey&&!tt.internalPubkey&&!(tt.witness&&tt.witness.length>1))throw new TypeError("Not enough data");et=Object.assign({validate:!0},et||{}),(0,types_1$2.typeforce)({address:types_1$2.typeforce.maybe(types_1$2.typeforce.String),input:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(0)),network:types_1$2.typeforce.maybe(types_1$2.typeforce.Object),output:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(34)),internalPubkey:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(32)),hash:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(32)),pubkey:types_1$2.typeforce.maybe(types_1$2.typeforce.BufferN(32)),signature:types_1$2.typeforce.maybe(types_1$2.typeforce.anyOf(types_1$2.typeforce.BufferN(64),types_1$2.typeforce.BufferN(65))),witness:types_1$2.typeforce.maybe(types_1$2.typeforce.arrayOf(types_1$2.typeforce.Buffer)),scriptTree:types_1$2.typeforce.maybe(types_1$2.isTaptree),redeem:types_1$2.typeforce.maybe({output:types_1$2.typeforce.maybe(types_1$2.typeforce.Buffer),redeemVersion:types_1$2.typeforce.maybe(types_1$2.typeforce.Number),witness:types_1$2.typeforce.maybe(types_1$2.typeforce.arrayOf(types_1$2.typeforce.Buffer))}),redeemVersion:types_1$2.typeforce.maybe(types_1$2.typeforce.Number)},tt);const nt=lazy$2.value(()=>{const st=bech32_1$1.bech32m.decode(tt.address),lt=st.words.shift(),ct=bech32_1$1.bech32m.fromWords(st.words);return{version:lt,prefix:st.prefix,data:buffer_1.Buffer.from(ct)}}),it=lazy$2.value(()=>{if(!(!tt.witness||!tt.witness.length))return tt.witness.length>=2&&tt.witness[tt.witness.length-1][0]===ANNEX_PREFIX?tt.witness.slice(0,-1):tt.witness.slice()}),rt=lazy$2.value(()=>{if(tt.scriptTree)return(0,bip341_1$2.toHashTree)(tt.scriptTree);if(tt.hash)return{hash:tt.hash}}),ot=tt.network||networks_1$1.bitcoin,at={name:"p2tr",network:ot};if(lazy$2.prop(at,"address",()=>{if(!at.pubkey)return;const st=bech32_1$1.bech32m.toWords(at.pubkey);return st.unshift(TAPROOT_WITNESS_VERSION),bech32_1$1.bech32m.encode(ot.bech32,st)}),lazy$2.prop(at,"hash",()=>{const st=rt();if(st)return st.hash;const lt=it();if(lt&<.length>1){const ct=lt[lt.length-1],ut=ct[0]&types_1$2.TAPLEAF_VERSION_MASK,ht=lt[lt.length-2],dt=(0,bip341_1$2.tapleafHash)({output:ht,version:ut});return(0,bip341_1$2.rootHashFromPath)(ct,dt)}return null}),lazy$2.prop(at,"output",()=>{if(at.pubkey)return bscript$4.compile([OPS.OP_1,at.pubkey])}),lazy$2.prop(at,"redeemVersion",()=>tt.redeemVersion?tt.redeemVersion:tt.redeem&&tt.redeem.redeemVersion!==void 0&&tt.redeem.redeemVersion!==null?tt.redeem.redeemVersion:bip341_1$2.LEAF_VERSION_TAPSCRIPT),lazy$2.prop(at,"redeem",()=>{const st=it();if(!(!st||st.length<2))return{output:st[st.length-2],witness:st.slice(0,-2),redeemVersion:st[st.length-1][0]&types_1$2.TAPLEAF_VERSION_MASK}}),lazy$2.prop(at,"pubkey",()=>{if(tt.pubkey)return tt.pubkey;if(tt.output)return tt.output.slice(2);if(tt.address)return nt().data;if(at.internalPubkey){const st=(0,bip341_1$2.tweakKey)(at.internalPubkey,at.hash);if(st)return st.x}}),lazy$2.prop(at,"internalPubkey",()=>{if(tt.internalPubkey)return tt.internalPubkey;const st=it();if(st&&st.length>1)return st[st.length-1].slice(1,33)}),lazy$2.prop(at,"signature",()=>{if(tt.signature)return tt.signature;const st=it();if(!(!st||st.length!==1))return st[0]}),lazy$2.prop(at,"witness",()=>{if(tt.witness)return tt.witness;const st=rt();if(st&&tt.redeem&&tt.redeem.output&&tt.internalPubkey){const lt=(0,bip341_1$2.tapleafHash)({output:tt.redeem.output,version:at.redeemVersion}),ct=(0,bip341_1$2.findScriptPath)(st,lt);if(!ct)return;const ut=(0,bip341_1$2.tweakKey)(tt.internalPubkey,st.hash);if(!ut)return;const ht=buffer_1.Buffer.concat([buffer_1.Buffer.from([at.redeemVersion|ut.parity]),tt.internalPubkey].concat(ct));return[tt.redeem.output,ht]}if(tt.signature)return[tt.signature]}),et.validate){let st=buffer_1.Buffer.from([]);if(tt.address){if(ot&&ot.bech32!==nt().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(nt().version!==TAPROOT_WITNESS_VERSION)throw new TypeError("Invalid address version");if(nt().data.length!==32)throw new TypeError("Invalid address data");st=nt().data}if(tt.pubkey){if(st.length>0&&!st.equals(tt.pubkey))throw new TypeError("Pubkey mismatch");st=tt.pubkey}if(tt.output){if(tt.output.length!==34||tt.output[0]!==OPS.OP_1||tt.output[1]!==32)throw new TypeError("Output is invalid");if(st.length>0&&!st.equals(tt.output.slice(2)))throw new TypeError("Pubkey mismatch");st=tt.output.slice(2)}if(tt.internalPubkey){const ut=(0,bip341_1$2.tweakKey)(tt.internalPubkey,at.hash);if(st.length>0&&!st.equals(ut.x))throw new TypeError("Pubkey mismatch");st=ut.x}if(st&&st.length&&!(0,ecc_lib_1.getEccLib)().isXOnlyPoint(st))throw new TypeError("Invalid pubkey for p2tr");const lt=rt();if(tt.hash&<&&!tt.hash.equals(lt.hash))throw new TypeError("Hash mismatch");if(tt.redeem&&tt.redeem.output&<){const ut=(0,bip341_1$2.tapleafHash)({output:tt.redeem.output,version:at.redeemVersion});if(!(0,bip341_1$2.findScriptPath)(lt,ut))throw new TypeError("Redeem script not in tree")}const ct=it();if(tt.redeem&&at.redeem){if(tt.redeem.redeemVersion&&tt.redeem.redeemVersion!==at.redeem.redeemVersion)throw new TypeError("Redeem.redeemVersion and witness mismatch");if(tt.redeem.output){if(bscript$4.decompile(tt.redeem.output).length===0)throw new TypeError("Redeem.output is invalid");if(at.redeem.output&&!tt.redeem.output.equals(at.redeem.output))throw new TypeError("Redeem.output and witness mismatch")}if(tt.redeem.witness&&at.redeem.witness&&!stacksEqual(tt.redeem.witness,at.redeem.witness))throw new TypeError("Redeem.witness and witness mismatch")}if(ct&&ct.length)if(ct.length===1){if(tt.signature&&!tt.signature.equals(ct[0]))throw new TypeError("Signature mismatch")}else{const ut=ct[ct.length-1];if(ut.length<33)throw new TypeError(`The control-block length is too small. Got ${ut.length}, expected min 33.`);if((ut.length-33)%32!==0)throw new TypeError(`The control-block length of ${ut.length} is incorrect!`);const ht=(ut.length-33)/32;if(ht>128)throw new TypeError(`The script path is too long. Got ${ht}, expected max 128.`);const dt=ut.slice(1,33);if(tt.internalPubkey&&!tt.internalPubkey.equals(dt))throw new TypeError("Internal pubkey mismatch");if(!(0,ecc_lib_1.getEccLib)().isXOnlyPoint(dt))throw new TypeError("Invalid internalPubkey for p2tr witness");const pt=ut[0]&types_1$2.TAPLEAF_VERSION_MASK,mt=ct[ct.length-2],gt=(0,bip341_1$2.tapleafHash)({output:mt,version:pt}),bt=(0,bip341_1$2.rootHashFromPath)(ut,gt),yt=(0,bip341_1$2.tweakKey)(dt,bt);if(!yt)throw new TypeError("Invalid outputKey for p2tr witness");if(st.length&&!st.equals(yt.x))throw new TypeError("Pubkey mismatch for p2tr witness");if(yt.parity!==(ut[0]&1))throw new Error("Incorrect parity")}}return Object.assign(at,tt)}p2tr$1.p2tr=p2tr;function stacksEqual(tt,et){return tt.length!==et.length?!1:tt.every((nt,it)=>nt.equals(et[it]))}(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.p2tr=tt.p2wsh=tt.p2wpkh=tt.p2sh=tt.p2pkh=tt.p2pk=tt.p2ms=tt.embed=void 0;const et=embed;Object.defineProperty(tt,"embed",{enumerable:!0,get:function(){return et.p2data}});const nt=p2ms$1;Object.defineProperty(tt,"p2ms",{enumerable:!0,get:function(){return nt.p2ms}});const it=p2pk$1;Object.defineProperty(tt,"p2pk",{enumerable:!0,get:function(){return it.p2pk}});const rt=p2pkh$1;Object.defineProperty(tt,"p2pkh",{enumerable:!0,get:function(){return rt.p2pkh}});const ot=p2sh$1;Object.defineProperty(tt,"p2sh",{enumerable:!0,get:function(){return ot.p2sh}});const at=p2wpkh$1;Object.defineProperty(tt,"p2wpkh",{enumerable:!0,get:function(){return at.p2wpkh}});const st=p2wsh$1;Object.defineProperty(tt,"p2wsh",{enumerable:!0,get:function(){return st.p2wsh}});const lt=p2tr$1;Object.defineProperty(tt,"p2tr",{enumerable:!0,get:function(){return lt.p2tr}})})(payments$3);Object.defineProperty(address,"__esModule",{value:!0});address.toOutputScript=address.fromOutputScript=address.toBech32=address.toBase58Check=address.fromBech32=address.fromBase58Check=void 0;const networks=networks$1,payments$2=payments$3,bscript$3=script,types_1$1=types$7,bech32_1=dist$1,bs58check=bs58check$3,FUTURE_SEGWIT_MAX_SIZE=40,FUTURE_SEGWIT_MIN_SIZE=2,FUTURE_SEGWIT_MAX_VERSION=16,FUTURE_SEGWIT_MIN_VERSION=2,FUTURE_SEGWIT_VERSION_DIFF=80,FUTURE_SEGWIT_VERSION_WARNING="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function _toFutureSegwitAddress(tt,et){const nt=tt.slice(2);if(nt.lengthFUTURE_SEGWIT_MAX_SIZE)throw new TypeError("Invalid program length for segwit address");const it=tt[0]-FUTURE_SEGWIT_VERSION_DIFF;if(itFUTURE_SEGWIT_MAX_VERSION)throw new TypeError("Invalid version for segwit address");if(tt[1]!==nt.length)throw new TypeError("Invalid script for segwit address");return console.warn(FUTURE_SEGWIT_VERSION_WARNING),toBech32(nt,it,et.bech32)}function fromBase58Check(tt){const et=Buffer.from(bs58check.decode(tt));if(et.length<21)throw new TypeError(tt+" is too short");if(et.length>21)throw new TypeError(tt+" is too long");const nt=et.readUInt8(0),it=et.slice(1);return{version:nt,hash:it}}address.fromBase58Check=fromBase58Check;function fromBech32(tt){let et,nt;try{et=bech32_1.bech32.decode(tt)}catch{}if(et){if(nt=et.words[0],nt!==0)throw new TypeError(tt+" uses wrong encoding")}else if(et=bech32_1.bech32m.decode(tt),nt=et.words[0],nt===0)throw new TypeError(tt+" uses wrong encoding");const it=bech32_1.bech32.fromWords(et.words.slice(1));return{version:nt,prefix:et.prefix,data:Buffer.from(it)}}address.fromBech32=fromBech32;function toBase58Check(tt,et){(0,types_1$1.typeforce)((0,types_1$1.tuple)(types_1$1.Hash160bit,types_1$1.UInt8),arguments);const nt=Buffer.allocUnsafe(21);return nt.writeUInt8(et,0),tt.copy(nt,1),bs58check.encode(nt)}address.toBase58Check=toBase58Check;function toBech32(tt,et,nt){const it=bech32_1.bech32.toWords(tt);return it.unshift(et),et===0?bech32_1.bech32.encode(nt,it):bech32_1.bech32m.encode(nt,it)}address.toBech32=toBech32;function fromOutputScript(tt,et){et=et||networks.bitcoin;try{return payments$2.p2pkh({output:tt,network:et}).address}catch{}try{return payments$2.p2sh({output:tt,network:et}).address}catch{}try{return payments$2.p2wpkh({output:tt,network:et}).address}catch{}try{return payments$2.p2wsh({output:tt,network:et}).address}catch{}try{return payments$2.p2tr({output:tt,network:et}).address}catch{}try{return _toFutureSegwitAddress(tt,et)}catch{}throw new Error(bscript$3.toASM(tt)+" has no matching Address")}address.fromOutputScript=fromOutputScript;function toOutputScript(tt,et){et=et||networks.bitcoin;let nt,it;try{nt=fromBase58Check(tt)}catch{}if(nt){if(nt.version===et.pubKeyHash)return payments$2.p2pkh({hash:nt.hash}).output;if(nt.version===et.scriptHash)return payments$2.p2sh({hash:nt.hash}).output}else{try{it=fromBech32(tt)}catch{}if(it){if(it.prefix!==et.bech32)throw new Error(tt+" has an invalid prefix");if(it.version===0){if(it.data.length===20)return payments$2.p2wpkh({hash:it.data}).output;if(it.data.length===32)return payments$2.p2wsh({hash:it.data}).output}else if(it.version===1){if(it.data.length===32)return payments$2.p2tr({pubkey:it.data}).output}else if(it.version>=FUTURE_SEGWIT_MIN_VERSION&&it.version<=FUTURE_SEGWIT_MAX_VERSION&&it.data.length>=FUTURE_SEGWIT_MIN_SIZE&&it.data.length<=FUTURE_SEGWIT_MAX_SIZE)return console.warn(FUTURE_SEGWIT_VERSION_WARNING),bscript$3.compile([it.version+FUTURE_SEGWIT_VERSION_DIFF,it.data])}}throw new Error(tt+" has no matching Script")}address.toOutputScript=toOutputScript;var block={},merkle={};Object.defineProperty(merkle,"__esModule",{value:!0});merkle.fastMerkleRoot=void 0;function fastMerkleRoot(tt,et){if(!Array.isArray(tt))throw TypeError("Expected values Array");if(typeof et!="function")throw TypeError("Expected digest Function");let nt=tt.length;const it=tt.concat();for(;nt>1;){let rt=0;for(let ot=0;otnt+varSliceSize(it),0)}const EMPTY_BUFFER=Buffer.allocUnsafe(0),EMPTY_WITNESS=[],ZERO=Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),ONE$1=Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),VALUE_UINT64_MAX=Buffer.from("ffffffffffffffff","hex"),BLANK_OUTPUT={script:EMPTY_BUFFER,valueBuffer:VALUE_UINT64_MAX};function isOutput(tt){return tt.value!==void 0}class Transaction{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(et,nt){const it=new bufferutils_1$2.BufferReader(et),rt=new Transaction;rt.version=it.readInt32();const ot=it.readUInt8(),at=it.readUInt8();let st=!1;ot===Transaction.ADVANCED_TRANSACTION_MARKER&&at===Transaction.ADVANCED_TRANSACTION_FLAG?st=!0:it.offset-=2;const lt=it.readVarInt();for(let ut=0;utet.witness.length!==0)}weight(){const et=this.byteLength(!1),nt=this.byteLength(!0);return et*3+nt}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(et=!0){const nt=et&&this.hasWitnesses();return(nt?10:8)+bufferutils_1$2.varuint.encodingLength(this.ins.length)+bufferutils_1$2.varuint.encodingLength(this.outs.length)+this.ins.reduce((it,rt)=>it+40+varSliceSize(rt.script),0)+this.outs.reduce((it,rt)=>it+8+varSliceSize(rt.script),0)+(nt?this.ins.reduce((it,rt)=>it+vectorSize(rt.witness),0):0)}clone(){const et=new Transaction;return et.version=this.version,et.locktime=this.locktime,et.ins=this.ins.map(nt=>({hash:nt.hash,index:nt.index,script:nt.script,sequence:nt.sequence,witness:nt.witness})),et.outs=this.outs.map(nt=>({script:nt.script,value:nt.value})),et}hashForSignature(et,nt,it){if(typeforce$1(types$3.tuple(types$3.UInt32,types$3.Buffer,types$3.Number),arguments),et>=this.ins.length)return ONE$1;const rt=bscript$2.compile(bscript$2.decompile(nt).filter(st=>st!==script_1.OPS.OP_CODESEPARATOR)),ot=this.clone();if((it&31)===Transaction.SIGHASH_NONE)ot.outs=[],ot.ins.forEach((st,lt)=>{lt!==et&&(st.sequence=0)});else if((it&31)===Transaction.SIGHASH_SINGLE){if(et>=this.outs.length)return ONE$1;ot.outs.length=et+1;for(let st=0;st{lt!==et&&(st.sequence=0)})}it&Transaction.SIGHASH_ANYONECANPAY?(ot.ins=[ot.ins[et]],ot.ins[0].script=rt):(ot.ins.forEach(st=>{st.script=EMPTY_BUFFER}),ot.ins[et].script=rt);const at=Buffer.allocUnsafe(ot.byteLength(!1)+4);return at.writeInt32LE(it,at.length-4),ot.__toBuffer(at,0,!1),bcrypto$1.hash256(at)}hashForWitnessV1(et,nt,it,rt,ot,at){if(typeforce$1(types$3.tuple(types$3.UInt32,typeforce$1.arrayOf(types$3.Buffer),typeforce$1.arrayOf(types$3.Satoshi),types$3.UInt32),arguments),it.length!==this.ins.length||nt.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");const st=rt===Transaction.SIGHASH_DEFAULT?Transaction.SIGHASH_ALL:rt&Transaction.SIGHASH_OUTPUT_MASK,ct=(rt&Transaction.SIGHASH_INPUT_MASK)===Transaction.SIGHASH_ANYONECANPAY,ut=st===Transaction.SIGHASH_NONE,ht=st===Transaction.SIGHASH_SINGLE;let dt=EMPTY_BUFFER,pt=EMPTY_BUFFER,mt=EMPTY_BUFFER,gt=EMPTY_BUFFER,bt=EMPTY_BUFFER;if(!ct){let xt=bufferutils_1$2.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach(St=>{xt.writeSlice(St.hash),xt.writeUInt32(St.index)}),dt=bcrypto$1.sha256(xt.end()),xt=bufferutils_1$2.BufferWriter.withCapacity(8*this.ins.length),it.forEach(St=>xt.writeUInt64(St)),pt=bcrypto$1.sha256(xt.end()),xt=bufferutils_1$2.BufferWriter.withCapacity(nt.map(varSliceSize).reduce((St,Et)=>St+Et)),nt.forEach(St=>xt.writeVarSlice(St)),mt=bcrypto$1.sha256(xt.end()),xt=bufferutils_1$2.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach(St=>xt.writeUInt32(St.sequence)),gt=bcrypto$1.sha256(xt.end())}if(ut||ht){if(ht&&et8+varSliceSize(Et.script)).reduce((Et,$t)=>Et+$t),St=bufferutils_1$2.BufferWriter.withCapacity(xt);this.outs.forEach(Et=>{St.writeUInt64(Et.value),St.writeVarSlice(Et.script)}),bt=bcrypto$1.sha256(St.end())}const yt=(ot?2:0)+(at?1:0),wt=174-(ct?49:0)-(ut?32:0)+(at?32:0)+(ot?37:0),vt=bufferutils_1$2.BufferWriter.withCapacity(wt);if(vt.writeUInt8(rt),vt.writeInt32(this.version),vt.writeUInt32(this.locktime),vt.writeSlice(dt),vt.writeSlice(pt),vt.writeSlice(mt),vt.writeSlice(gt),ut||ht||vt.writeSlice(bt),vt.writeUInt8(yt),ct){const xt=this.ins[et];vt.writeSlice(xt.hash),vt.writeUInt32(xt.index),vt.writeUInt64(it[et]),vt.writeVarSlice(nt[et]),vt.writeUInt32(xt.sequence)}else vt.writeUInt32(et);if(at){const xt=bufferutils_1$2.BufferWriter.withCapacity(varSliceSize(at));xt.writeVarSlice(at),vt.writeSlice(bcrypto$1.sha256(xt.end()))}return ht&&vt.writeSlice(bt),ot&&(vt.writeSlice(ot),vt.writeUInt8(0),vt.writeUInt32(4294967295)),bcrypto$1.taggedHash("TapSighash",Buffer.concat([Buffer.from([0]),vt.end()]))}hashForWitnessV0(et,nt,it,rt){typeforce$1(types$3.tuple(types$3.UInt32,types$3.Buffer,types$3.Satoshi,types$3.UInt32),arguments);let ot=Buffer.from([]),at,st=ZERO,lt=ZERO,ct=ZERO;if(rt&Transaction.SIGHASH_ANYONECANPAY||(ot=Buffer.allocUnsafe(36*this.ins.length),at=new bufferutils_1$2.BufferWriter(ot,0),this.ins.forEach(ht=>{at.writeSlice(ht.hash),at.writeUInt32(ht.index)}),lt=bcrypto$1.hash256(ot)),!(rt&Transaction.SIGHASH_ANYONECANPAY)&&(rt&31)!==Transaction.SIGHASH_SINGLE&&(rt&31)!==Transaction.SIGHASH_NONE&&(ot=Buffer.allocUnsafe(4*this.ins.length),at=new bufferutils_1$2.BufferWriter(ot,0),this.ins.forEach(ht=>{at.writeUInt32(ht.sequence)}),ct=bcrypto$1.hash256(ot)),(rt&31)!==Transaction.SIGHASH_SINGLE&&(rt&31)!==Transaction.SIGHASH_NONE){const ht=this.outs.reduce((dt,pt)=>dt+8+varSliceSize(pt.script),0);ot=Buffer.allocUnsafe(ht),at=new bufferutils_1$2.BufferWriter(ot,0),this.outs.forEach(dt=>{at.writeUInt64(dt.value),at.writeVarSlice(dt.script)}),st=bcrypto$1.hash256(ot)}else if((rt&31)===Transaction.SIGHASH_SINGLE&&et{rt.writeSlice(at.hash),rt.writeUInt32(at.index),rt.writeVarSlice(at.script),rt.writeUInt32(at.sequence)}),rt.writeVarInt(this.outs.length),this.outs.forEach(at=>{isOutput(at)?rt.writeUInt64(at.value):rt.writeSlice(at.valueBuffer),rt.writeVarSlice(at.script)}),ot&&this.ins.forEach(at=>{rt.writeVector(at.witness)}),rt.writeUInt32(this.locktime),nt!==void 0?et.slice(nt,rt.offset):et}}transaction.Transaction=Transaction;Transaction.DEFAULT_SEQUENCE=4294967295;Transaction.SIGHASH_DEFAULT=0;Transaction.SIGHASH_ALL=1;Transaction.SIGHASH_NONE=2;Transaction.SIGHASH_SINGLE=3;Transaction.SIGHASH_ANYONECANPAY=128;Transaction.SIGHASH_OUTPUT_MASK=3;Transaction.SIGHASH_INPUT_MASK=128;Transaction.ADVANCED_TRANSACTION_MARKER=0;Transaction.ADVANCED_TRANSACTION_FLAG=1;Object.defineProperty(block,"__esModule",{value:!0});block.Block=void 0;const bufferutils_1$1=bufferutils,bcrypto=crypto$2,merkle_1=merkle,transaction_1$3=transaction,types$2=types$7,{typeforce}=types$2,errorMerkleNoTxes=new TypeError("Cannot compute merkle root for zero transactions"),errorWitnessNotSegwit=new TypeError("Cannot compute witness commit for non-segwit block");let Block$1=class Y0{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(et){if(et.length<80)throw new Error("Buffer too small (< 80 bytes)");const nt=new bufferutils_1$1.BufferReader(et),it=new Y0;if(it.version=nt.readInt32(),it.prevHash=nt.readSlice(32),it.merkleRoot=nt.readSlice(32),it.timestamp=nt.readUInt32(),it.bits=nt.readUInt32(),it.nonce=nt.readUInt32(),et.length===80)return it;const rt=()=>{const st=transaction_1$3.Transaction.fromBuffer(nt.buffer.slice(nt.offset),!0);return nt.offset+=st.byteLength(),st},ot=nt.readVarInt();it.transactions=[];for(let st=0;st>24)-3,it=et&8388607,rt=Buffer.alloc(32,0);return rt.writeUIntBE(it,29-nt,3),rt}static calculateMerkleRoot(et,nt){if(typeforce([{getHash:types$2.Function}],et),et.length===0)throw errorMerkleNoTxes;if(nt&&!txesHaveWitnessCommit(et))throw errorWitnessNotSegwit;const it=et.map(ot=>ot.getHash(nt)),rt=(0,merkle_1.fastMerkleRoot)(it,bcrypto.hash256);return nt?bcrypto.hash256(Buffer.concat([rt,et[0].ins[0].witness[0]])):rt}getWitnessCommit(){if(!txesHaveWitnessCommit(this.transactions))return null;const et=this.transactions[0].outs.filter(it=>it.script.slice(0,6).equals(Buffer.from("6a24aa21a9ed","hex"))).map(it=>it.script.slice(6,38));if(et.length===0)return null;const nt=et[et.length-1];return nt instanceof Buffer&&nt.length===32?nt:null}hasWitnessCommit(){return this.witnessCommit instanceof Buffer&&this.witnessCommit.length===32||this.getWitnessCommit()!==null}hasWitness(){return anyTxHasWitness(this.transactions)}weight(){const et=this.byteLength(!1,!1),nt=this.byteLength(!1,!0);return et*3+nt}byteLength(et,nt=!0){return et||!this.transactions?80:80+bufferutils_1$1.varuint.encodingLength(this.transactions.length)+this.transactions.reduce((it,rt)=>it+rt.byteLength(nt),0)}getHash(){return bcrypto.hash256(this.toBuffer(!0))}getId(){return(0,bufferutils_1$1.reverseBuffer)(this.getHash()).toString("hex")}getUTCDate(){const et=new Date(0);return et.setUTCSeconds(this.timestamp),et}toBuffer(et){const nt=Buffer.allocUnsafe(this.byteLength(et)),it=new bufferutils_1$1.BufferWriter(nt);return it.writeInt32(this.version),it.writeSlice(this.prevHash),it.writeSlice(this.merkleRoot),it.writeUInt32(this.timestamp),it.writeUInt32(this.bits),it.writeUInt32(this.nonce),et||!this.transactions||(bufferutils_1$1.varuint.encode(this.transactions.length,nt,it.offset),it.offset+=bufferutils_1$1.varuint.encode.bytes,this.transactions.forEach(rt=>{const ot=rt.byteLength();rt.toBuffer(nt,it.offset),it.offset+=ot})),nt}toHex(et){return this.toBuffer(et).toString("hex")}checkTxRoots(){const et=this.hasWitnessCommit();return!et&&this.hasWitness()?!1:this.__checkMerkleRoot()&&(et?this.__checkWitnessCommit():!0)}checkProofOfWork(){const et=(0,bufferutils_1$1.reverseBuffer)(this.getHash()),nt=Y0.calculateTarget(this.bits);return et.compare(nt)<=0}__checkMerkleRoot(){if(!this.transactions)throw errorMerkleNoTxes;const et=Y0.calculateMerkleRoot(this.transactions);return this.merkleRoot.compare(et)===0}__checkWitnessCommit(){if(!this.transactions)throw errorMerkleNoTxes;if(!this.hasWitnessCommit())throw errorWitnessNotSegwit;const et=Y0.calculateMerkleRoot(this.transactions,!0);return this.witnessCommit.compare(et)===0}};block.Block=Block$1;function txesHaveWitnessCommit(tt){return tt instanceof Array&&tt[0]&&tt[0].ins&&tt[0].ins instanceof Array&&tt[0].ins[0]&&tt[0].ins[0].witness&&tt[0].ins[0].witness instanceof Array&&tt[0].ins[0].witness.length>0}function anyTxHasWitness(tt){return tt instanceof Array&&tt.some(et=>typeof et=="object"&&et.ins instanceof Array&&et.ins.some(nt=>typeof nt=="object"&&nt.witness instanceof Array&&nt.witness.length>0))}var psbt$1={},psbt={},combiner={},parser$1={},fromBuffer={},converter={},typeFields={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),function(et){et[et.UNSIGNED_TX=0]="UNSIGNED_TX",et[et.GLOBAL_XPUB=1]="GLOBAL_XPUB"}(tt.GlobalTypes||(tt.GlobalTypes={})),tt.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],function(et){et[et.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",et[et.WITNESS_UTXO=1]="WITNESS_UTXO",et[et.PARTIAL_SIG=2]="PARTIAL_SIG",et[et.SIGHASH_TYPE=3]="SIGHASH_TYPE",et[et.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",et[et.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",et[et.BIP32_DERIVATION=6]="BIP32_DERIVATION",et[et.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",et[et.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",et[et.POR_COMMITMENT=9]="POR_COMMITMENT",et[et.TAP_KEY_SIG=19]="TAP_KEY_SIG",et[et.TAP_SCRIPT_SIG=20]="TAP_SCRIPT_SIG",et[et.TAP_LEAF_SCRIPT=21]="TAP_LEAF_SCRIPT",et[et.TAP_BIP32_DERIVATION=22]="TAP_BIP32_DERIVATION",et[et.TAP_INTERNAL_KEY=23]="TAP_INTERNAL_KEY",et[et.TAP_MERKLE_ROOT=24]="TAP_MERKLE_ROOT"}(tt.InputTypes||(tt.InputTypes={})),tt.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment","tapKeySig","tapScriptSig","tapLeafScript","tapBip32Derivation","tapInternalKey","tapMerkleRoot"],function(et){et[et.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",et[et.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",et[et.BIP32_DERIVATION=2]="BIP32_DERIVATION",et[et.TAP_INTERNAL_KEY=5]="TAP_INTERNAL_KEY",et[et.TAP_TREE=6]="TAP_TREE",et[et.TAP_BIP32_DERIVATION=7]="TAP_BIP32_DERIVATION"}(tt.OutputTypes||(tt.OutputTypes={})),tt.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation","tapInternalKey","tapTree","tapBip32Derivation"]})(typeFields);var globalXpub$1={};Object.defineProperty(globalXpub$1,"__esModule",{value:!0});const typeFields_1$g=typeFields,range$7=tt=>[...Array(tt).keys()];function decode$i(tt){if(tt.key[0]!==typeFields_1$g.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+tt.key.toString("hex"));if(tt.key.length!==79||![2,3].includes(tt.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+tt.key.toString("hex"));if(tt.value.length/4%1!==0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const et=tt.key.slice(1),nt={masterFingerprint:tt.value.slice(0,4),extendedPubkey:et,path:"m"};for(const it of range$7(tt.value.length/4-1)){const rt=tt.value.readUInt32LE(it*4+4),ot=!!(rt&2147483648),at=rt&2147483647;nt.path+="/"+at.toString(10)+(ot?"'":"")}return nt}globalXpub$1.decode=decode$i;function encode$i(tt){const et=Buffer.from([typeFields_1$g.GlobalTypes.GLOBAL_XPUB]),nt=Buffer.concat([et,tt.extendedPubkey]),it=tt.path.split("/"),rt=Buffer.allocUnsafe(it.length*4);tt.masterFingerprint.copy(rt,0);let ot=4;return it.slice(1).forEach(at=>{const st=at.slice(-1)==="'";let lt=2147483647&parseInt(st?at.slice(0,-1):at,10);st&&(lt+=2147483648),rt.writeUInt32LE(lt,ot),ot+=4}),{key:nt,value:rt}}globalXpub$1.encode=encode$i;globalXpub$1.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }";function check$c(tt){const et=tt.extendedPubkey,nt=tt.masterFingerprint,it=tt.path;return Buffer.isBuffer(et)&&et.length===78&&[2,3].indexOf(et[45])>-1&&Buffer.isBuffer(nt)&&nt.length===4&&typeof it=="string"&&!!it.match(/^m(\/\d+'?)*$/)}globalXpub$1.check=check$c;function canAddToArray$3(tt,et,nt){const it=et.extendedPubkey.toString("hex");return nt.has(it)?!1:(nt.add(it),tt.filter(rt=>rt.extendedPubkey.equals(et.extendedPubkey)).length===0)}globalXpub$1.canAddToArray=canAddToArray$3;var unsignedTx$1={};Object.defineProperty(unsignedTx$1,"__esModule",{value:!0});const typeFields_1$f=typeFields;function encode$h(tt){return{key:Buffer.from([typeFields_1$f.GlobalTypes.UNSIGNED_TX]),value:tt.toBuffer()}}unsignedTx$1.encode=encode$h;var finalScriptSig$1={};Object.defineProperty(finalScriptSig$1,"__esModule",{value:!0});const typeFields_1$e=typeFields;function decode$h(tt){if(tt.key[0]!==typeFields_1$e.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+tt.key.toString("hex"));return tt.value}finalScriptSig$1.decode=decode$h;function encode$g(tt){return{key:Buffer.from([typeFields_1$e.InputTypes.FINAL_SCRIPTSIG]),value:tt}}finalScriptSig$1.encode=encode$g;finalScriptSig$1.expected="Buffer";function check$b(tt){return Buffer.isBuffer(tt)}finalScriptSig$1.check=check$b;function canAdd$8(tt,et){return!!tt&&!!et&&tt.finalScriptSig===void 0}finalScriptSig$1.canAdd=canAdd$8;var finalScriptWitness$1={};Object.defineProperty(finalScriptWitness$1,"__esModule",{value:!0});const typeFields_1$d=typeFields;function decode$g(tt){if(tt.key[0]!==typeFields_1$d.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+tt.key.toString("hex"));return tt.value}finalScriptWitness$1.decode=decode$g;function encode$f(tt){return{key:Buffer.from([typeFields_1$d.InputTypes.FINAL_SCRIPTWITNESS]),value:tt}}finalScriptWitness$1.encode=encode$f;finalScriptWitness$1.expected="Buffer";function check$a(tt){return Buffer.isBuffer(tt)}finalScriptWitness$1.check=check$a;function canAdd$7(tt,et){return!!tt&&!!et&&tt.finalScriptWitness===void 0}finalScriptWitness$1.canAdd=canAdd$7;var nonWitnessUtxo$1={};Object.defineProperty(nonWitnessUtxo$1,"__esModule",{value:!0});const typeFields_1$c=typeFields;function decode$f(tt){if(tt.key[0]!==typeFields_1$c.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+tt.key.toString("hex"));return tt.value}nonWitnessUtxo$1.decode=decode$f;function encode$e(tt){return{key:Buffer.from([typeFields_1$c.InputTypes.NON_WITNESS_UTXO]),value:tt}}nonWitnessUtxo$1.encode=encode$e;nonWitnessUtxo$1.expected="Buffer";function check$9(tt){return Buffer.isBuffer(tt)}nonWitnessUtxo$1.check=check$9;function canAdd$6(tt,et){return!!tt&&!!et&&tt.nonWitnessUtxo===void 0}nonWitnessUtxo$1.canAdd=canAdd$6;var partialSig$1={};Object.defineProperty(partialSig$1,"__esModule",{value:!0});const typeFields_1$b=typeFields;function decode$e(tt){if(tt.key[0]!==typeFields_1$b.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+tt.key.toString("hex"));if(!(tt.key.length===34||tt.key.length===66)||![2,3,4].includes(tt.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+tt.key.toString("hex"));return{pubkey:tt.key.slice(1),signature:tt.value}}partialSig$1.decode=decode$e;function encode$d(tt){const et=Buffer.from([typeFields_1$b.InputTypes.PARTIAL_SIG]);return{key:Buffer.concat([et,tt.pubkey]),value:tt.signature}}partialSig$1.encode=encode$d;partialSig$1.expected="{ pubkey: Buffer; signature: Buffer; }";function check$8(tt){return Buffer.isBuffer(tt.pubkey)&&Buffer.isBuffer(tt.signature)&&[33,65].includes(tt.pubkey.length)&&[2,3,4].includes(tt.pubkey[0])&&isDerSigWithSighash(tt.signature)}partialSig$1.check=check$8;function isDerSigWithSighash(tt){if(!Buffer.isBuffer(tt)||tt.length<9||tt[0]!==48||tt.length!==tt[1]+3||tt[2]!==2)return!1;const et=tt[3];if(et>33||et<1||tt[3+et+1]!==2)return!1;const nt=tt[3+et+2];return!(nt>33||nt<1||tt.length!==3+et+2+nt+2)}function canAddToArray$2(tt,et,nt){const it=et.pubkey.toString("hex");return nt.has(it)?!1:(nt.add(it),tt.filter(rt=>rt.pubkey.equals(et.pubkey)).length===0)}partialSig$1.canAddToArray=canAddToArray$2;var porCommitment$1={};Object.defineProperty(porCommitment$1,"__esModule",{value:!0});const typeFields_1$a=typeFields;function decode$d(tt){if(tt.key[0]!==typeFields_1$a.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+tt.key.toString("hex"));return tt.value.toString("utf8")}porCommitment$1.decode=decode$d;function encode$c(tt){return{key:Buffer.from([typeFields_1$a.InputTypes.POR_COMMITMENT]),value:Buffer.from(tt,"utf8")}}porCommitment$1.encode=encode$c;porCommitment$1.expected="string";function check$7(tt){return typeof tt=="string"}porCommitment$1.check=check$7;function canAdd$5(tt,et){return!!tt&&!!et&&tt.porCommitment===void 0}porCommitment$1.canAdd=canAdd$5;var sighashType$1={};Object.defineProperty(sighashType$1,"__esModule",{value:!0});const typeFields_1$9=typeFields;function decode$c(tt){if(tt.key[0]!==typeFields_1$9.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+tt.key.toString("hex"));return tt.value.readUInt32LE(0)}sighashType$1.decode=decode$c;function encode$b(tt){const et=Buffer.from([typeFields_1$9.InputTypes.SIGHASH_TYPE]),nt=Buffer.allocUnsafe(4);return nt.writeUInt32LE(tt,0),{key:et,value:nt}}sighashType$1.encode=encode$b;sighashType$1.expected="number";function check$6(tt){return typeof tt=="number"}sighashType$1.check=check$6;function canAdd$4(tt,et){return!!tt&&!!et&&tt.sighashType===void 0}sighashType$1.canAdd=canAdd$4;var tapKeySig$1={};Object.defineProperty(tapKeySig$1,"__esModule",{value:!0});const typeFields_1$8=typeFields;function decode$b(tt){if(tt.key[0]!==typeFields_1$8.InputTypes.TAP_KEY_SIG||tt.key.length!==1)throw new Error("Decode Error: could not decode tapKeySig with key 0x"+tt.key.toString("hex"));if(!check$5(tt.value))throw new Error("Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature");return tt.value}tapKeySig$1.decode=decode$b;function encode$a(tt){return{key:Buffer.from([typeFields_1$8.InputTypes.TAP_KEY_SIG]),value:tt}}tapKeySig$1.encode=encode$a;tapKeySig$1.expected="Buffer";function check$5(tt){return Buffer.isBuffer(tt)&&(tt.length===64||tt.length===65)}tapKeySig$1.check=check$5;function canAdd$3(tt,et){return!!tt&&!!et&&tt.tapKeySig===void 0}tapKeySig$1.canAdd=canAdd$3;var tapLeafScript$1={};Object.defineProperty(tapLeafScript$1,"__esModule",{value:!0});const typeFields_1$7=typeFields;function decode$a(tt){if(tt.key[0]!==typeFields_1$7.InputTypes.TAP_LEAF_SCRIPT)throw new Error("Decode Error: could not decode tapLeafScript with key 0x"+tt.key.toString("hex"));if((tt.key.length-2)%32!==0)throw new Error("Decode Error: tapLeafScript has invalid control block in key 0x"+tt.key.toString("hex"));const et=tt.value[tt.value.length-1];if((tt.key[1]&254)!==et)throw new Error("Decode Error: tapLeafScript bad leaf version in key 0x"+tt.key.toString("hex"));const nt=tt.value.slice(0,-1);return{controlBlock:tt.key.slice(1),script:nt,leafVersion:et}}tapLeafScript$1.decode=decode$a;function encode$9(tt){const et=Buffer.from([typeFields_1$7.InputTypes.TAP_LEAF_SCRIPT]),nt=Buffer.from([tt.leafVersion]);return{key:Buffer.concat([et,tt.controlBlock]),value:Buffer.concat([tt.script,nt])}}tapLeafScript$1.encode=encode$9;tapLeafScript$1.expected="{ controlBlock: Buffer; leafVersion: number, script: Buffer; }";function check$4(tt){return Buffer.isBuffer(tt.controlBlock)&&(tt.controlBlock.length-1)%32===0&&(tt.controlBlock[0]&254)===tt.leafVersion&&Buffer.isBuffer(tt.script)}tapLeafScript$1.check=check$4;function canAddToArray$1(tt,et,nt){const it=et.controlBlock.toString("hex");return nt.has(it)?!1:(nt.add(it),tt.filter(rt=>rt.controlBlock.equals(et.controlBlock)).length===0)}tapLeafScript$1.canAddToArray=canAddToArray$1;var tapMerkleRoot$1={};Object.defineProperty(tapMerkleRoot$1,"__esModule",{value:!0});const typeFields_1$6=typeFields;function decode$9(tt){if(tt.key[0]!==typeFields_1$6.InputTypes.TAP_MERKLE_ROOT||tt.key.length!==1)throw new Error("Decode Error: could not decode tapMerkleRoot with key 0x"+tt.key.toString("hex"));if(!check$3(tt.value))throw new Error("Decode Error: tapMerkleRoot not a 32-byte hash");return tt.value}tapMerkleRoot$1.decode=decode$9;function encode$8(tt){return{key:Buffer.from([typeFields_1$6.InputTypes.TAP_MERKLE_ROOT]),value:tt}}tapMerkleRoot$1.encode=encode$8;tapMerkleRoot$1.expected="Buffer";function check$3(tt){return Buffer.isBuffer(tt)&&tt.length===32}tapMerkleRoot$1.check=check$3;function canAdd$2(tt,et){return!!tt&&!!et&&tt.tapMerkleRoot===void 0}tapMerkleRoot$1.canAdd=canAdd$2;var tapScriptSig$1={};Object.defineProperty(tapScriptSig$1,"__esModule",{value:!0});const typeFields_1$5=typeFields;function decode$8(tt){if(tt.key[0]!==typeFields_1$5.InputTypes.TAP_SCRIPT_SIG)throw new Error("Decode Error: could not decode tapScriptSig with key 0x"+tt.key.toString("hex"));if(tt.key.length!==65)throw new Error("Decode Error: tapScriptSig has invalid key 0x"+tt.key.toString("hex"));if(tt.value.length!==64&&tt.value.length!==65)throw new Error("Decode Error: tapScriptSig has invalid signature in key 0x"+tt.key.toString("hex"));const et=tt.key.slice(1,33),nt=tt.key.slice(33);return{pubkey:et,leafHash:nt,signature:tt.value}}tapScriptSig$1.decode=decode$8;function encode$7(tt){const et=Buffer.from([typeFields_1$5.InputTypes.TAP_SCRIPT_SIG]);return{key:Buffer.concat([et,tt.pubkey,tt.leafHash]),value:tt.signature}}tapScriptSig$1.encode=encode$7;tapScriptSig$1.expected="{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }";function check$2(tt){return Buffer.isBuffer(tt.pubkey)&&Buffer.isBuffer(tt.leafHash)&&Buffer.isBuffer(tt.signature)&&tt.pubkey.length===32&&tt.leafHash.length===32&&(tt.signature.length===64||tt.signature.length===65)}tapScriptSig$1.check=check$2;function canAddToArray(tt,et,nt){const it=et.pubkey.toString("hex")+et.leafHash.toString("hex");return nt.has(it)?!1:(nt.add(it),tt.filter(rt=>rt.pubkey.equals(et.pubkey)&&rt.leafHash.equals(et.leafHash)).length===0)}tapScriptSig$1.canAddToArray=canAddToArray;var witnessUtxo$1={},tools={},varint={};Object.defineProperty(varint,"__esModule",{value:!0});const MAX_SAFE_INTEGER$3=9007199254740991;function checkUInt53(tt){if(tt<0||tt>MAX_SAFE_INTEGER$3||tt%1!==0)throw new RangeError("value out of range")}function encode$6(tt,et,nt){if(checkUInt53(tt),et||(et=Buffer.allocUnsafe(encodingLength(tt))),!Buffer.isBuffer(et))throw new TypeError("buffer must be a Buffer instance");return nt||(nt=0),tt<253?(et.writeUInt8(tt,nt),Object.assign(encode$6,{bytes:1})):tt<=65535?(et.writeUInt8(253,nt),et.writeUInt16LE(tt,nt+1),Object.assign(encode$6,{bytes:3})):tt<=4294967295?(et.writeUInt8(254,nt),et.writeUInt32LE(tt,nt+1),Object.assign(encode$6,{bytes:5})):(et.writeUInt8(255,nt),et.writeUInt32LE(tt>>>0,nt+1),et.writeUInt32LE(tt/4294967296|0,nt+5),Object.assign(encode$6,{bytes:9})),et}varint.encode=encode$6;function decode$7(tt,et){if(!Buffer.isBuffer(tt))throw new TypeError("buffer must be a Buffer instance");et||(et=0);const nt=tt.readUInt8(et);if(nt<253)return Object.assign(decode$7,{bytes:1}),nt;if(nt===253)return Object.assign(decode$7,{bytes:3}),tt.readUInt16LE(et+1);if(nt===254)return Object.assign(decode$7,{bytes:5}),tt.readUInt32LE(et+1);{Object.assign(decode$7,{bytes:9});const it=tt.readUInt32LE(et+1),ot=tt.readUInt32LE(et+5)*4294967296+it;return checkUInt53(ot),ot}}varint.decode=decode$7;function encodingLength(tt){return checkUInt53(tt),tt<253?1:tt<=65535?3:tt<=4294967295?5:9}varint.encodingLength=encodingLength;Object.defineProperty(tools,"__esModule",{value:!0});const varuint$6=varint;tools.range=tt=>[...Array(tt).keys()];function reverseBuffer(tt){if(tt.length<1)return tt;let et=tt.length-1,nt=0;for(let it=0;itet)throw new Error("RangeError: value out of range");if(Math.floor(tt)!==tt)throw new Error("value has a fractional component")}function readUInt64LE(tt,et){const nt=tt.readUInt32LE(et);let it=tt.readUInt32LE(et+4);return it*=4294967296,verifuint(it+nt,9007199254740991),it+nt}tools.readUInt64LE=readUInt64LE;function writeUInt64LE(tt,et,nt){return verifuint(et,9007199254740991),tt.writeInt32LE(et&-1,nt),tt.writeUInt32LE(Math.floor(et/4294967296),nt+4),nt+8}tools.writeUInt64LE=writeUInt64LE;Object.defineProperty(witnessUtxo$1,"__esModule",{value:!0});const typeFields_1$4=typeFields,tools_1$2=tools,varuint$5=varint;function decode$6(tt){if(tt.key[0]!==typeFields_1$4.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+tt.key.toString("hex"));const et=tools_1$2.readUInt64LE(tt.value,0);let nt=8;const it=varuint$5.decode(tt.value,nt);nt+=varuint$5.encodingLength(it);const rt=tt.value.slice(nt);if(rt.length!==it)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:rt,value:et}}witnessUtxo$1.decode=decode$6;function encode$5(tt){const{script:et,value:nt}=tt,it=varuint$5.encodingLength(et.length),rt=Buffer.allocUnsafe(8+it+et.length);return tools_1$2.writeUInt64LE(rt,nt,0),varuint$5.encode(et.length,rt,8),et.copy(rt,8+it),{key:Buffer.from([typeFields_1$4.InputTypes.WITNESS_UTXO]),value:rt}}witnessUtxo$1.encode=encode$5;witnessUtxo$1.expected="{ script: Buffer; value: number; }";function check$1(tt){return Buffer.isBuffer(tt.script)&&typeof tt.value=="number"}witnessUtxo$1.check=check$1;function canAdd$1(tt,et){return!!tt&&!!et&&tt.witnessUtxo===void 0}witnessUtxo$1.canAdd=canAdd$1;var tapTree$1={};Object.defineProperty(tapTree$1,"__esModule",{value:!0});const typeFields_1$3=typeFields,varuint$4=varint;function decode$5(tt){if(tt.key[0]!==typeFields_1$3.OutputTypes.TAP_TREE||tt.key.length!==1)throw new Error("Decode Error: could not decode tapTree with key 0x"+tt.key.toString("hex"));let et=0;const nt=[];for(;et[Buffer.of(it.depth,it.leafVersion),varuint$4.encode(it.script.length),it.script]));return{key:et,value:Buffer.concat(nt)}}tapTree$1.encode=encode$4;tapTree$1.expected="{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }";function check(tt){return Array.isArray(tt.leaves)&&tt.leaves.every(et=>et.depth>=0&&et.depth<=128&&(et.leafVersion&254)===et.leafVersion&&Buffer.isBuffer(et.script))}tapTree$1.check=check;function canAdd(tt,et){return!!tt&&!!et&&tt.tapTree===void 0}tapTree$1.canAdd=canAdd;var bip32Derivation$2={};Object.defineProperty(bip32Derivation$2,"__esModule",{value:!0});const range$6=tt=>[...Array(tt).keys()],isValidDERKey=tt=>tt.length===33&&[2,3].includes(tt[0])||tt.length===65&&tt[0]===4;function makeConverter$4(tt,et=isValidDERKey){function nt(st){if(st.key[0]!==tt)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+st.key.toString("hex"));const lt=st.key.slice(1);if(!et(lt))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+st.key.toString("hex"));if(st.value.length/4%1!==0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const ct={masterFingerprint:st.value.slice(0,4),pubkey:lt,path:"m"};for(const ut of range$6(st.value.length/4-1)){const ht=st.value.readUInt32LE(ut*4+4),dt=!!(ht&2147483648),pt=ht&2147483647;ct.path+="/"+pt.toString(10)+(dt?"'":"")}return ct}function it(st){const lt=Buffer.from([tt]),ct=Buffer.concat([lt,st.pubkey]),ut=st.path.split("/"),ht=Buffer.allocUnsafe(ut.length*4);st.masterFingerprint.copy(ht,0);let dt=4;return ut.slice(1).forEach(pt=>{const mt=pt.slice(-1)==="'";let gt=2147483647&parseInt(mt?pt.slice(0,-1):pt,10);mt&&(gt+=2147483648),ht.writeUInt32LE(gt,dt),dt+=4}),{key:ct,value:ht}}const rt="{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }";function ot(st){return Buffer.isBuffer(st.pubkey)&&Buffer.isBuffer(st.masterFingerprint)&&typeof st.path=="string"&&et(st.pubkey)&&st.masterFingerprint.length===4}function at(st,lt,ct){const ut=lt.pubkey.toString("hex");return ct.has(ut)?!1:(ct.add(ut),st.filter(ht=>ht.pubkey.equals(lt.pubkey)).length===0)}return{decode:nt,encode:it,check:ot,expected:rt,canAddToArray:at}}bip32Derivation$2.makeConverter=makeConverter$4;var checkPubkey$1={};Object.defineProperty(checkPubkey$1,"__esModule",{value:!0});function makeChecker(tt){return et;function et(nt){let it;if(tt.includes(nt.key[0])&&(it=nt.key.slice(1),!(it.length===33||it.length===65)||![2,3,4].includes(it[0])))throw new Error("Format Error: invalid pubkey in key 0x"+nt.key.toString("hex"));return it}}checkPubkey$1.makeChecker=makeChecker;var redeemScript$1={};Object.defineProperty(redeemScript$1,"__esModule",{value:!0});function makeConverter$3(tt){function et(at){if(at.key[0]!==tt)throw new Error("Decode Error: could not decode redeemScript with key 0x"+at.key.toString("hex"));return at.value}function nt(at){return{key:Buffer.from([tt]),value:at}}const it="Buffer";function rt(at){return Buffer.isBuffer(at)}function ot(at,st){return!!at&&!!st&&at.redeemScript===void 0}return{decode:et,encode:nt,check:rt,expected:it,canAdd:ot}}redeemScript$1.makeConverter=makeConverter$3;var tapBip32Derivation$1={};Object.defineProperty(tapBip32Derivation$1,"__esModule",{value:!0});const varuint$3=varint,bip32Derivation$1=bip32Derivation$2,isValidBIP340Key=tt=>tt.length===32;function makeConverter$2(tt){const et=bip32Derivation$1.makeConverter(tt,isValidBIP340Key);function nt(at){const st=varuint$3.decode(at.value),lt=varuint$3.encodingLength(st),ct=et.decode({key:at.key,value:at.value.slice(lt+st*32)}),ut=new Array(st);for(let ht=0,dt=lt;htBuffer.isBuffer(st)&&st.length===32)&&et.check(at)}return{decode:nt,encode:it,check:ot,expected:rt,canAddToArray:et.canAddToArray}}tapBip32Derivation$1.makeConverter=makeConverter$2;var tapInternalKey$1={};Object.defineProperty(tapInternalKey$1,"__esModule",{value:!0});function makeConverter$1(tt){function et(at){if(at.key[0]!==tt||at.key.length!==1)throw new Error("Decode Error: could not decode tapInternalKey with key 0x"+at.key.toString("hex"));if(at.value.length!==32)throw new Error("Decode Error: tapInternalKey not a 32-byte x-only pubkey");return at.value}function nt(at){return{key:Buffer.from([tt]),value:at}}const it="Buffer";function rt(at){return Buffer.isBuffer(at)&&at.length===32}function ot(at,st){return!!at&&!!st&&at.tapInternalKey===void 0}return{decode:et,encode:nt,check:rt,expected:it,canAdd:ot}}tapInternalKey$1.makeConverter=makeConverter$1;var witnessScript$1={};Object.defineProperty(witnessScript$1,"__esModule",{value:!0});function makeConverter(tt){function et(at){if(at.key[0]!==tt)throw new Error("Decode Error: could not decode witnessScript with key 0x"+at.key.toString("hex"));return at.value}function nt(at){return{key:Buffer.from([tt]),value:at}}const it="Buffer";function rt(at){return Buffer.isBuffer(at)}function ot(at,st){return!!at&&!!st&&at.witnessScript===void 0}return{decode:et,encode:nt,check:rt,expected:it,canAdd:ot}}witnessScript$1.makeConverter=makeConverter;Object.defineProperty(converter,"__esModule",{value:!0});const typeFields_1$2=typeFields,globalXpub=globalXpub$1,unsignedTx=unsignedTx$1,finalScriptSig=finalScriptSig$1,finalScriptWitness=finalScriptWitness$1,nonWitnessUtxo=nonWitnessUtxo$1,partialSig=partialSig$1,porCommitment=porCommitment$1,sighashType=sighashType$1,tapKeySig=tapKeySig$1,tapLeafScript=tapLeafScript$1,tapMerkleRoot=tapMerkleRoot$1,tapScriptSig=tapScriptSig$1,witnessUtxo=witnessUtxo$1,tapTree=tapTree$1,bip32Derivation=bip32Derivation$2,checkPubkey=checkPubkey$1,redeemScript=redeemScript$1,tapBip32Derivation=tapBip32Derivation$1,tapInternalKey=tapInternalKey$1,witnessScript=witnessScript$1,globals={unsignedTx,globalXpub,checkPubkey:checkPubkey.makeChecker([])};converter.globals=globals;const inputs={nonWitnessUtxo,partialSig,sighashType,finalScriptSig,finalScriptWitness,porCommitment,witnessUtxo,bip32Derivation:bip32Derivation.makeConverter(typeFields_1$2.InputTypes.BIP32_DERIVATION),redeemScript:redeemScript.makeConverter(typeFields_1$2.InputTypes.REDEEM_SCRIPT),witnessScript:witnessScript.makeConverter(typeFields_1$2.InputTypes.WITNESS_SCRIPT),checkPubkey:checkPubkey.makeChecker([typeFields_1$2.InputTypes.PARTIAL_SIG,typeFields_1$2.InputTypes.BIP32_DERIVATION]),tapKeySig,tapScriptSig,tapLeafScript,tapBip32Derivation:tapBip32Derivation.makeConverter(typeFields_1$2.InputTypes.TAP_BIP32_DERIVATION),tapInternalKey:tapInternalKey.makeConverter(typeFields_1$2.InputTypes.TAP_INTERNAL_KEY),tapMerkleRoot};converter.inputs=inputs;const outputs={bip32Derivation:bip32Derivation.makeConverter(typeFields_1$2.OutputTypes.BIP32_DERIVATION),redeemScript:redeemScript.makeConverter(typeFields_1$2.OutputTypes.REDEEM_SCRIPT),witnessScript:witnessScript.makeConverter(typeFields_1$2.OutputTypes.WITNESS_SCRIPT),checkPubkey:checkPubkey.makeChecker([typeFields_1$2.OutputTypes.BIP32_DERIVATION]),tapBip32Derivation:tapBip32Derivation.makeConverter(typeFields_1$2.OutputTypes.TAP_BIP32_DERIVATION),tapTree,tapInternalKey:tapInternalKey.makeConverter(typeFields_1$2.OutputTypes.TAP_INTERNAL_KEY)};converter.outputs=outputs;Object.defineProperty(fromBuffer,"__esModule",{value:!0});const convert$3=converter,tools_1$1=tools,varuint$2=varint,typeFields_1$1=typeFields;function psbtFromBuffer(tt,et){let nt=0;function it(){const bt=varuint$2.decode(tt,nt);nt+=varuint$2.encodingLength(bt);const yt=tt.slice(nt,nt+bt);return nt+=bt,yt}function rt(){const bt=tt.readUInt32BE(nt);return nt+=4,bt}function ot(){const bt=tt.readUInt8(nt);return nt+=1,bt}function at(){const bt=it(),yt=it();return{key:bt,value:yt}}function st(){if(nt>=tt.length)throw new Error("Format Error: Unexpected End of PSBT");const bt=tt.readUInt8(nt)===0;return bt&&nt++,bt}if(rt()!==1886610036)throw new Error("Format Error: Invalid Magic Number");if(ot()!==255)throw new Error("Format Error: Magic Number must be followed by 0xff separator");const lt=[],ct={};for(;!st();){const bt=at(),yt=bt.key.toString("hex");if(ct[yt])throw new Error("Format Error: Keys must be unique for global keymap: key "+yt);ct[yt]=1,lt.push(bt)}const ut=lt.filter(bt=>bt.key[0]===typeFields_1$1.GlobalTypes.UNSIGNED_TX);if(ut.length!==1)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const ht=et(ut[0].value),{inputCount:dt,outputCount:pt}=ht.getInputOutputCounts(),mt=[],gt=[];for(const bt of tools_1$1.range(dt)){const yt={},wt=[];for(;!st();){const vt=at(),xt=vt.key.toString("hex");if(yt[xt])throw new Error("Format Error: Keys must be unique for each input: input index "+bt+" key "+xt);yt[xt]=1,wt.push(vt)}mt.push(wt)}for(const bt of tools_1$1.range(pt)){const yt={},wt=[];for(;!st();){const vt=at(),xt=vt.key.toString("hex");if(yt[xt])throw new Error("Format Error: Keys must be unique for each output: output index "+bt+" key "+xt);yt[xt]=1,wt.push(vt)}gt.push(wt)}return psbtFromKeyVals(ht,{globalMapKeyVals:lt,inputKeyVals:mt,outputKeyVals:gt})}fromBuffer.psbtFromBuffer=psbtFromBuffer;function checkKeyBuffer(tt,et,nt){if(!et.equals(Buffer.from([nt])))throw new Error(`Format Error: Invalid ${tt} key: ${et.toString("hex")}`)}fromBuffer.checkKeyBuffer=checkKeyBuffer;function psbtFromKeyVals(tt,{globalMapKeyVals:et,inputKeyVals:nt,outputKeyVals:it}){const rt={unsignedTx:tt};let ot=0;for(const ut of et)switch(ut.key[0]){case typeFields_1$1.GlobalTypes.UNSIGNED_TX:if(checkKeyBuffer("global",ut.key,typeFields_1$1.GlobalTypes.UNSIGNED_TX),ot>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");ot++;break;case typeFields_1$1.GlobalTypes.GLOBAL_XPUB:rt.globalXpub===void 0&&(rt.globalXpub=[]),rt.globalXpub.push(convert$3.globals.globalXpub.decode(ut));break;default:rt.unknownKeyVals||(rt.unknownKeyVals=[]),rt.unknownKeyVals.push(ut)}const at=nt.length,st=it.length,lt=[],ct=[];for(const ut of tools_1$1.range(at)){const ht={};for(const dt of nt[ut])switch(convert$3.inputs.checkPubkey(dt),dt.key[0]){case typeFields_1$1.InputTypes.NON_WITNESS_UTXO:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.NON_WITNESS_UTXO),ht.nonWitnessUtxo!==void 0)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");ht.nonWitnessUtxo=convert$3.inputs.nonWitnessUtxo.decode(dt);break;case typeFields_1$1.InputTypes.WITNESS_UTXO:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.WITNESS_UTXO),ht.witnessUtxo!==void 0)throw new Error("Format Error: Input has multiple WITNESS_UTXO");ht.witnessUtxo=convert$3.inputs.witnessUtxo.decode(dt);break;case typeFields_1$1.InputTypes.PARTIAL_SIG:ht.partialSig===void 0&&(ht.partialSig=[]),ht.partialSig.push(convert$3.inputs.partialSig.decode(dt));break;case typeFields_1$1.InputTypes.SIGHASH_TYPE:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.SIGHASH_TYPE),ht.sighashType!==void 0)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");ht.sighashType=convert$3.inputs.sighashType.decode(dt);break;case typeFields_1$1.InputTypes.REDEEM_SCRIPT:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.REDEEM_SCRIPT),ht.redeemScript!==void 0)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");ht.redeemScript=convert$3.inputs.redeemScript.decode(dt);break;case typeFields_1$1.InputTypes.WITNESS_SCRIPT:if(checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.WITNESS_SCRIPT),ht.witnessScript!==void 0)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");ht.witnessScript=convert$3.inputs.witnessScript.decode(dt);break;case typeFields_1$1.InputTypes.BIP32_DERIVATION:ht.bip32Derivation===void 0&&(ht.bip32Derivation=[]),ht.bip32Derivation.push(convert$3.inputs.bip32Derivation.decode(dt));break;case typeFields_1$1.InputTypes.FINAL_SCRIPTSIG:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.FINAL_SCRIPTSIG),ht.finalScriptSig=convert$3.inputs.finalScriptSig.decode(dt);break;case typeFields_1$1.InputTypes.FINAL_SCRIPTWITNESS:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.FINAL_SCRIPTWITNESS),ht.finalScriptWitness=convert$3.inputs.finalScriptWitness.decode(dt);break;case typeFields_1$1.InputTypes.POR_COMMITMENT:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.POR_COMMITMENT),ht.porCommitment=convert$3.inputs.porCommitment.decode(dt);break;case typeFields_1$1.InputTypes.TAP_KEY_SIG:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.TAP_KEY_SIG),ht.tapKeySig=convert$3.inputs.tapKeySig.decode(dt);break;case typeFields_1$1.InputTypes.TAP_SCRIPT_SIG:ht.tapScriptSig===void 0&&(ht.tapScriptSig=[]),ht.tapScriptSig.push(convert$3.inputs.tapScriptSig.decode(dt));break;case typeFields_1$1.InputTypes.TAP_LEAF_SCRIPT:ht.tapLeafScript===void 0&&(ht.tapLeafScript=[]),ht.tapLeafScript.push(convert$3.inputs.tapLeafScript.decode(dt));break;case typeFields_1$1.InputTypes.TAP_BIP32_DERIVATION:ht.tapBip32Derivation===void 0&&(ht.tapBip32Derivation=[]),ht.tapBip32Derivation.push(convert$3.inputs.tapBip32Derivation.decode(dt));break;case typeFields_1$1.InputTypes.TAP_INTERNAL_KEY:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.TAP_INTERNAL_KEY),ht.tapInternalKey=convert$3.inputs.tapInternalKey.decode(dt);break;case typeFields_1$1.InputTypes.TAP_MERKLE_ROOT:checkKeyBuffer("input",dt.key,typeFields_1$1.InputTypes.TAP_MERKLE_ROOT),ht.tapMerkleRoot=convert$3.inputs.tapMerkleRoot.decode(dt);break;default:ht.unknownKeyVals||(ht.unknownKeyVals=[]),ht.unknownKeyVals.push(dt)}lt.push(ht)}for(const ut of tools_1$1.range(st)){const ht={};for(const dt of it[ut])switch(convert$3.outputs.checkPubkey(dt),dt.key[0]){case typeFields_1$1.OutputTypes.REDEEM_SCRIPT:if(checkKeyBuffer("output",dt.key,typeFields_1$1.OutputTypes.REDEEM_SCRIPT),ht.redeemScript!==void 0)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");ht.redeemScript=convert$3.outputs.redeemScript.decode(dt);break;case typeFields_1$1.OutputTypes.WITNESS_SCRIPT:if(checkKeyBuffer("output",dt.key,typeFields_1$1.OutputTypes.WITNESS_SCRIPT),ht.witnessScript!==void 0)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");ht.witnessScript=convert$3.outputs.witnessScript.decode(dt);break;case typeFields_1$1.OutputTypes.BIP32_DERIVATION:ht.bip32Derivation===void 0&&(ht.bip32Derivation=[]),ht.bip32Derivation.push(convert$3.outputs.bip32Derivation.decode(dt));break;case typeFields_1$1.OutputTypes.TAP_INTERNAL_KEY:checkKeyBuffer("output",dt.key,typeFields_1$1.OutputTypes.TAP_INTERNAL_KEY),ht.tapInternalKey=convert$3.outputs.tapInternalKey.decode(dt);break;case typeFields_1$1.OutputTypes.TAP_TREE:checkKeyBuffer("output",dt.key,typeFields_1$1.OutputTypes.TAP_TREE),ht.tapTree=convert$3.outputs.tapTree.decode(dt);break;case typeFields_1$1.OutputTypes.TAP_BIP32_DERIVATION:ht.tapBip32Derivation===void 0&&(ht.tapBip32Derivation=[]),ht.tapBip32Derivation.push(convert$3.outputs.tapBip32Derivation.decode(dt));break;default:ht.unknownKeyVals||(ht.unknownKeyVals=[]),ht.unknownKeyVals.push(dt)}ct.push(ht)}return{globalMap:rt,inputs:lt,outputs:ct}}fromBuffer.psbtFromKeyVals=psbtFromKeyVals;var toBuffer={};Object.defineProperty(toBuffer,"__esModule",{value:!0});const convert$2=converter,tools_1=tools;function psbtToBuffer({globalMap:tt,inputs:et,outputs:nt}){const{globalKeyVals:it,inputKeyVals:rt,outputKeyVals:ot}=psbtToKeyVals({globalMap:tt,inputs:et,outputs:nt}),at=tools_1.keyValsToBuffer(it),st=ht=>ht.length===0?[Buffer.from([0])]:ht.map(tools_1.keyValsToBuffer),lt=st(rt),ct=st(ot),ut=Buffer.allocUnsafe(5);return ut.writeUIntBE(482972169471,0,5),Buffer.concat([ut,at].concat(lt,ct))}toBuffer.psbtToBuffer=psbtToBuffer;const sortKeyVals=(tt,et)=>tt.key.compare(et.key);function keyValsFromMap(tt,et){const nt=new Set,it=Object.entries(tt).reduce((ot,[at,st])=>{if(at==="unknownKeyVals")return ot;const lt=et[at];if(lt===void 0)return ot;const ct=(Array.isArray(st)?st:[st]).map(lt.encode);return ct.map(ht=>ht.key.toString("hex")).forEach(ht=>{if(nt.has(ht))throw new Error("Serialize Error: Duplicate key: "+ht);nt.add(ht)}),ot.concat(ct)},[]),rt=tt.unknownKeyVals?tt.unknownKeyVals.filter(ot=>!nt.has(ot.key.toString("hex"))):[];return it.concat(rt).sort(sortKeyVals)}function psbtToKeyVals({globalMap:tt,inputs:et,outputs:nt}){return{globalKeyVals:keyValsFromMap(tt,convert$2.globals),inputKeyVals:et.map(it=>keyValsFromMap(it,convert$2.inputs)),outputKeyVals:nt.map(it=>keyValsFromMap(it,convert$2.outputs))}}toBuffer.psbtToKeyVals=psbtToKeyVals;(function(tt){function et(nt){for(var it in nt)tt.hasOwnProperty(it)||(tt[it]=nt[it])}Object.defineProperty(tt,"__esModule",{value:!0}),et(fromBuffer),et(toBuffer)})(parser$1);Object.defineProperty(combiner,"__esModule",{value:!0});const parser_1$1=parser$1;function combine$1(tt){const et=tt[0],nt=parser_1$1.psbtToKeyVals(et),it=tt.slice(1);if(it.length===0)throw new Error("Combine: Nothing to combine");const rt=getTx(et);if(rt===void 0)throw new Error("Combine: Self missing transaction");const ot=getKeySet(nt.globalKeyVals),at=nt.inputKeyVals.map(getKeySet),st=nt.outputKeyVals.map(getKeySet);for(const lt of it){const ct=getTx(lt);if(ct===void 0||!ct.toBuffer().equals(rt.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const ut=parser_1$1.psbtToKeyVals(lt);getKeySet(ut.globalKeyVals).forEach(keyPusher(ot,nt.globalKeyVals,ut.globalKeyVals)),ut.inputKeyVals.map(getKeySet).forEach((mt,gt)=>mt.forEach(keyPusher(at[gt],nt.inputKeyVals[gt],ut.inputKeyVals[gt]))),ut.outputKeyVals.map(getKeySet).forEach((mt,gt)=>mt.forEach(keyPusher(st[gt],nt.outputKeyVals[gt],ut.outputKeyVals[gt])))}return parser_1$1.psbtFromKeyVals(rt,{globalMapKeyVals:nt.globalKeyVals,inputKeyVals:nt.inputKeyVals,outputKeyVals:nt.outputKeyVals})}combiner.combine=combine$1;function keyPusher(tt,et,nt){return it=>{if(tt.has(it))return;const rt=nt.filter(ot=>ot.key.toString("hex")===it)[0];et.push(rt),tt.add(it)}}function getTx(tt){return tt.globalMap.unsignedTx}function getKeySet(tt){const et=new Set;return tt.forEach(nt=>{const it=nt.key.toString("hex");if(et.has(it))throw new Error("Combine: KeyValue Map keys should be unique");et.add(it)}),et}var utils$1={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0});const et=converter;function nt(pt,mt){const gt=pt[mt];if(gt===void 0)throw new Error(`No input #${mt}`);return gt}tt.checkForInput=nt;function it(pt,mt){const gt=pt[mt];if(gt===void 0)throw new Error(`No output #${mt}`);return gt}tt.checkForOutput=it;function rt(pt,mt,gt){if(pt.key[0]bt.key.equals(pt.key)).length!==0)throw new Error(`Duplicate Key: ${pt.key.toString("hex")}`)}tt.checkHasKey=rt;function ot(pt){let mt=0;return Object.keys(pt).forEach(gt=>{Number(isNaN(Number(gt)))&&mt++}),mt}tt.getEnumLength=ot;function at(pt,mt){let gt=!1;if(mt.nonWitnessUtxo||mt.witnessUtxo){const bt=!!mt.redeemScript,yt=!!mt.witnessScript,wt=!bt||!!mt.finalScriptSig,vt=!yt||!!mt.finalScriptWitness,xt=!!mt.finalScriptSig||!!mt.finalScriptWitness;gt=wt&&vt&&xt}if(gt===!1)throw new Error(`Input #${pt} has too much or too little data to clean`)}tt.inputCheckUncleanFinalized=at;function st(pt,mt,gt,bt){throw new Error(`Data for ${pt} key ${mt} is incorrect: Expected ${gt} and got ${JSON.stringify(bt)}`)}function lt(pt){return(mt,gt)=>{for(const bt of Object.keys(mt)){const yt=mt[bt],{canAdd:wt,canAddToArray:vt,check:xt,expected:St}=et[pt+"s"][bt]||{},Et=!!vt;if(xt)if(Et){if(!Array.isArray(yt)||gt[bt]&&!Array.isArray(gt[bt]))throw new Error(`Key type ${bt} must be an array`);yt.every(xt)||st(pt,bt,St,yt);const $t=gt[bt]||[],It=new Set;if(!yt.every(Ft=>vt($t,Ft,It)))throw new Error("Can not add duplicate data to array");gt[bt]=$t.concat(yt)}else{if(xt(yt)||st(pt,bt,St,yt),!wt(gt,yt))throw new Error(`Can not add duplicate data to ${pt}`);gt[bt]=yt}}}}tt.updateGlobal=lt("global"),tt.updateInput=lt("input"),tt.updateOutput=lt("output");function ct(pt,mt){const gt=pt.length-1,bt=nt(pt,gt);tt.updateInput(mt,bt)}tt.addInputAttributes=ct;function ut(pt,mt){const gt=pt.length-1,bt=it(pt,gt);tt.updateOutput(mt,bt)}tt.addOutputAttributes=ut;function ht(pt,mt){if(!Buffer.isBuffer(mt)||mt.length<4)throw new Error("Set Version: Invalid Transaction");return mt.writeUInt32LE(pt,0),mt}tt.defaultVersionSetter=ht;function dt(pt,mt){if(!Buffer.isBuffer(mt)||mt.length<4)throw new Error("Set Locktime: Invalid Transaction");return mt.writeUInt32LE(pt,mt.length-4),mt}tt.defaultLocktimeSetter=dt})(utils$1);Object.defineProperty(psbt,"__esModule",{value:!0});const combiner_1=combiner,parser_1=parser$1,typeFields_1=typeFields,utils_1$1=utils$1;let Psbt$1=class{constructor(et){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:et}}static fromBase64(et,nt){const it=Buffer.from(et,"base64");return this.fromBuffer(it,nt)}static fromHex(et,nt){const it=Buffer.from(et,"hex");return this.fromBuffer(it,nt)}static fromBuffer(et,nt){const it=parser_1.psbtFromBuffer(et,nt),rt=new this(it.globalMap.unsignedTx);return Object.assign(rt,it),rt}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return parser_1.psbtToBuffer(this)}updateGlobal(et){return utils_1$1.updateGlobal(et,this.globalMap),this}updateInput(et,nt){const it=utils_1$1.checkForInput(this.inputs,et);return utils_1$1.updateInput(nt,it),this}updateOutput(et,nt){const it=utils_1$1.checkForOutput(this.outputs,et);return utils_1$1.updateOutput(nt,it),this}addUnknownKeyValToGlobal(et){return utils_1$1.checkHasKey(et,this.globalMap.unknownKeyVals,utils_1$1.getEnumLength(typeFields_1.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(et),this}addUnknownKeyValToInput(et,nt){const it=utils_1$1.checkForInput(this.inputs,et);return utils_1$1.checkHasKey(nt,it.unknownKeyVals,utils_1$1.getEnumLength(typeFields_1.InputTypes)),it.unknownKeyVals||(it.unknownKeyVals=[]),it.unknownKeyVals.push(nt),this}addUnknownKeyValToOutput(et,nt){const it=utils_1$1.checkForOutput(this.outputs,et);return utils_1$1.checkHasKey(nt,it.unknownKeyVals,utils_1$1.getEnumLength(typeFields_1.OutputTypes)),it.unknownKeyVals||(it.unknownKeyVals=[]),it.unknownKeyVals.push(nt),this}addInput(et){this.globalMap.unsignedTx.addInput(et),this.inputs.push({unknownKeyVals:[]});const nt=et.unknownKeyVals||[],it=this.inputs.length-1;if(!Array.isArray(nt))throw new Error("unknownKeyVals must be an Array");return nt.forEach(rt=>this.addUnknownKeyValToInput(it,rt)),utils_1$1.addInputAttributes(this.inputs,et),this}addOutput(et){this.globalMap.unsignedTx.addOutput(et),this.outputs.push({unknownKeyVals:[]});const nt=et.unknownKeyVals||[],it=this.outputs.length-1;if(!Array.isArray(nt))throw new Error("unknownKeyVals must be an Array");return nt.forEach(rt=>this.addUnknownKeyValToOutput(it,rt)),utils_1$1.addOutputAttributes(this.outputs,et),this}clearFinalizedInput(et){const nt=utils_1$1.checkForInput(this.inputs,et);utils_1$1.inputCheckUncleanFinalized(et,nt);for(const it of Object.keys(nt))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(it)||delete nt[it];return this}combine(...et){const nt=combiner_1.combine([this].concat(et));return Object.assign(this,nt),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}};psbt.Psbt=Psbt$1;var bip371={},psbtutils={};Object.defineProperty(psbtutils,"__esModule",{value:!0});psbtutils.signatureBlocksAction=psbtutils.checkInputForSig=psbtutils.pubkeyInScript=psbtutils.pubkeyPositionInScript=psbtutils.witnessStackToScriptWitness=psbtutils.isP2TR=psbtutils.isP2SHScript=psbtutils.isP2WSHScript=psbtutils.isP2WPKH=psbtutils.isP2PKH=psbtutils.isP2PK=psbtutils.isP2MS=void 0;const varuint$1=varint,bscript$1=script,transaction_1$2=transaction,crypto_1=crypto$2,payments$1=payments$3;function isPaymentFactory(tt){return et=>{try{return tt({output:et}),!0}catch{return!1}}}psbtutils.isP2MS=isPaymentFactory(payments$1.p2ms);psbtutils.isP2PK=isPaymentFactory(payments$1.p2pk);psbtutils.isP2PKH=isPaymentFactory(payments$1.p2pkh);psbtutils.isP2WPKH=isPaymentFactory(payments$1.p2wpkh);psbtutils.isP2WSHScript=isPaymentFactory(payments$1.p2wsh);psbtutils.isP2SHScript=isPaymentFactory(payments$1.p2sh);psbtutils.isP2TR=isPaymentFactory(payments$1.p2tr);function witnessStackToScriptWitness(tt){let et=Buffer.allocUnsafe(0);function nt(at){et=Buffer.concat([et,Buffer.from(at)])}function it(at){const st=et.length,lt=varuint$1.encodingLength(at);et=Buffer.concat([et,Buffer.allocUnsafe(lt)]),varuint$1.encode(at,et,st)}function rt(at){it(at.length),nt(at)}function ot(at){it(at.length),at.forEach(rt)}return ot(tt),et}psbtutils.witnessStackToScriptWitness=witnessStackToScriptWitness;function pubkeyPositionInScript(tt,et){const nt=(0,crypto_1.hash160)(tt),it=tt.slice(1,33),rt=bscript$1.decompile(et);if(rt===null)throw new Error("Unknown script error");return rt.findIndex(ot=>typeof ot=="number"?!1:ot.equals(tt)||ot.equals(nt)||ot.equals(it))}psbtutils.pubkeyPositionInScript=pubkeyPositionInScript;function pubkeyInScript(tt,et){return pubkeyPositionInScript(tt,et)!==-1}psbtutils.pubkeyInScript=pubkeyInScript;function checkInputForSig(tt,et){return extractPartialSigs(tt).some(it=>signatureBlocksAction(it,bscript$1.signature.decode,et))}psbtutils.checkInputForSig=checkInputForSig;function signatureBlocksAction(tt,et,nt){const{hashType:it}=et(tt),rt=[];switch(it&transaction_1$2.Transaction.SIGHASH_ANYONECANPAY&&rt.push("addInput"),it&31){case transaction_1$2.Transaction.SIGHASH_ALL:break;case transaction_1$2.Transaction.SIGHASH_SINGLE:case transaction_1$2.Transaction.SIGHASH_NONE:rt.push("addOutput"),rt.push("setInputSequence");break}return rt.indexOf(nt)===-1}psbtutils.signatureBlocksAction=signatureBlocksAction;function extractPartialSigs(tt){let et=[];if((tt.partialSig||[]).length===0){if(!tt.finalScriptSig&&!tt.finalScriptWitness)return[];et=getPsigsFromInputFinalScripts(tt)}else et=tt.partialSig;return et.map(nt=>nt.signature)}function getPsigsFromInputFinalScripts(tt){const et=tt.finalScriptSig?bscript$1.decompile(tt.finalScriptSig)||[]:[],nt=tt.finalScriptWitness?bscript$1.decompile(tt.finalScriptWitness)||[]:[];return et.concat(nt).filter(it=>Buffer.isBuffer(it)&&bscript$1.isCanonicalScriptSignature(it)).map(it=>({signature:it}))}Object.defineProperty(bip371,"__esModule",{value:!0});bip371.checkTaprootInputForSigs=bip371.tapTreeFromList=bip371.tapTreeToList=bip371.tweakInternalPubKey=bip371.checkTaprootOutputFields=bip371.checkTaprootInputFields=bip371.isTaprootOutput=bip371.isTaprootInput=bip371.serializeTaprootSignature=bip371.tapScriptFinalizer=bip371.toXOnly=void 0;const types_1=types$7,transaction_1$1=transaction,psbtutils_1$1=psbtutils,bip341_1$1=bip341,payments_1=payments$3,psbtutils_2=psbtutils,toXOnly=tt=>tt.length===32?tt:tt.slice(1,33);bip371.toXOnly=toXOnly;function tapScriptFinalizer(tt,et,nt){const it=findTapLeafToFinalize(et,tt,nt);try{const ot=sortSignatures(et,it).concat(it.script).concat(it.controlBlock);return{finalScriptWitness:(0,psbtutils_1$1.witnessStackToScriptWitness)(ot)}}catch(rt){throw new Error(`Can not finalize taproot input #${tt}: ${rt}`)}}bip371.tapScriptFinalizer=tapScriptFinalizer;function serializeTaprootSignature(tt,et){const nt=et?Buffer.from([et]):Buffer.from([]);return Buffer.concat([tt,nt])}bip371.serializeTaprootSignature=serializeTaprootSignature;function isTaprootInput(tt){return tt&&!!(tt.tapInternalKey||tt.tapMerkleRoot||tt.tapLeafScript&&tt.tapLeafScript.length||tt.tapBip32Derivation&&tt.tapBip32Derivation.length||tt.witnessUtxo&&(0,psbtutils_1$1.isP2TR)(tt.witnessUtxo.script))}bip371.isTaprootInput=isTaprootInput;function isTaprootOutput(tt,et){return tt&&!!(tt.tapInternalKey||tt.tapTree||tt.tapBip32Derivation&&tt.tapBip32Derivation.length||et&&(0,psbtutils_1$1.isP2TR)(et))}bip371.isTaprootOutput=isTaprootOutput;function checkTaprootInputFields(tt,et,nt){checkMixedTaprootAndNonTaprootInputFields(tt,et,nt),checkIfTapLeafInTree(tt,et,nt)}bip371.checkTaprootInputFields=checkTaprootInputFields;function checkTaprootOutputFields(tt,et,nt){checkMixedTaprootAndNonTaprootOutputFields(tt,et,nt),checkTaprootScriptPubkey(tt,et)}bip371.checkTaprootOutputFields=checkTaprootOutputFields;function checkTaprootScriptPubkey(tt,et){if(!et.tapTree&&!et.tapInternalKey)return;const nt=et.tapInternalKey||tt.tapInternalKey,it=et.tapTree||tt.tapTree;if(nt){const{script:rt}=tt,ot=getTaprootScripPubkey(nt,it);if(rt&&!rt.equals(ot))throw new Error("Error adding output. Script or address missmatch.")}}function getTaprootScripPubkey(tt,et){const nt=et&&tapTreeFromList(et.leaves),{output:it}=(0,payments_1.p2tr)({internalPubkey:tt,scriptTree:nt});return it}function tweakInternalPubKey(tt,et){const nt=et.tapInternalKey,it=nt&&(0,bip341_1$1.tweakKey)(nt,et.tapMerkleRoot);if(!it)throw new Error(`Cannot tweak tap internal key for input #${tt}. Public key: ${nt&&nt.toString("hex")}`);return it.x}bip371.tweakInternalPubKey=tweakInternalPubKey;function tapTreeToList(tt){if(!(0,types_1.isTaptree)(tt))throw new Error("Cannot convert taptree to tapleaf list. Expecting a tapree structure.");return _tapTreeToList(tt)}bip371.tapTreeToList=tapTreeToList;function tapTreeFromList(tt=[]){return tt.length===1&&tt[0].depth===0?{output:tt[0].script,version:tt[0].leafVersion}:instertLeavesInTree(tt)}bip371.tapTreeFromList=tapTreeFromList;function checkTaprootInputForSigs(tt,et){return extractTaprootSigs(tt).some(it=>(0,psbtutils_2.signatureBlocksAction)(it,decodeSchnorrSignature,et))}bip371.checkTaprootInputForSigs=checkTaprootInputForSigs;function decodeSchnorrSignature(tt){return{signature:tt.slice(0,64),hashType:tt.slice(64)[0]||transaction_1$1.Transaction.SIGHASH_DEFAULT}}function extractTaprootSigs(tt){const et=[];if(tt.tapKeySig&&et.push(tt.tapKeySig),tt.tapScriptSig&&et.push(...tt.tapScriptSig.map(nt=>nt.signature)),!et.length){const nt=getTapKeySigFromWithness(tt.finalScriptWitness);nt&&et.push(nt)}return et}function getTapKeySigFromWithness(tt){if(!tt)return;const et=tt.slice(2);if(et.length===64||et.length===65)return et}function _tapTreeToList(tt,et=[],nt=0){if(nt>bip341_1$1.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");return tt?(0,types_1.isTapleaf)(tt)?(et.push({depth:nt,leafVersion:tt.version||bip341_1$1.LEAF_VERSION_TAPSCRIPT,script:tt.output}),et):(tt[0]&&_tapTreeToList(tt[0],et,nt+1),tt[1]&&_tapTreeToList(tt[1],et,nt+1),et):[]}function instertLeavesInTree(tt){let et;for(const nt of tt)if(et=instertLeafInTree(nt,et),!et)throw new Error("No room left to insert tapleaf in tree");return et}function instertLeafInTree(tt,et,nt=0){if(nt>bip341_1$1.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");if(tt.depth===nt)return et?void 0:{output:tt.script,version:tt.leafVersion};if((0,types_1.isTapleaf)(et))return;const it=instertLeafInTree(tt,et&&et[0],nt+1);if(it)return[it,et&&et[1]];const rt=instertLeafInTree(tt,et&&et[1],nt+1);if(rt)return[et&&et[0],rt]}function checkMixedTaprootAndNonTaprootInputFields(tt,et,nt){const it=isTaprootInput(tt)&&hasNonTaprootFields(et),rt=hasNonTaprootFields(tt)&&isTaprootInput(et),ot=tt===et&&isTaprootInput(et)&&hasNonTaprootFields(et);if(it||rt||ot)throw new Error(`Invalid arguments for Psbt.${nt}. Cannot use both taproot and non-taproot fields.`)}function checkMixedTaprootAndNonTaprootOutputFields(tt,et,nt){const it=isTaprootOutput(tt)&&hasNonTaprootFields(et),rt=hasNonTaprootFields(tt)&&isTaprootOutput(et),ot=tt===et&&isTaprootOutput(et)&&hasNonTaprootFields(et);if(it||rt||ot)throw new Error(`Invalid arguments for Psbt.${nt}. Cannot use both taproot and non-taproot fields.`)}function checkIfTapLeafInTree(tt,et,nt){if(et.tapMerkleRoot){const it=(et.tapLeafScript||[]).every(ot=>isTapLeafInTree(ot,et.tapMerkleRoot)),rt=(tt.tapLeafScript||[]).every(ot=>isTapLeafInTree(ot,et.tapMerkleRoot));if(!it||!rt)throw new Error(`Invalid arguments for Psbt.${nt}. Tapleaf not part of taptree.`)}else if(tt.tapMerkleRoot&&!(et.tapLeafScript||[]).every(rt=>isTapLeafInTree(rt,tt.tapMerkleRoot)))throw new Error(`Invalid arguments for Psbt.${nt}. Tapleaf not part of taptree.`)}function isTapLeafInTree(tt,et){if(!et)return!0;const nt=(0,bip341_1$1.tapleafHash)({output:tt.script,version:tt.leafVersion});return(0,bip341_1$1.rootHashFromPath)(tt.controlBlock,nt).equals(et)}function sortSignatures(tt,et){const nt=(0,bip341_1$1.tapleafHash)({output:et.script,version:et.leafVersion});return(tt.tapScriptSig||[]).filter(it=>it.leafHash.equals(nt)).map(it=>addPubkeyPositionInScript(et.script,it)).sort((it,rt)=>rt.positionInScript-it.positionInScript).map(it=>it.signature)}function addPubkeyPositionInScript(tt,et){return Object.assign({positionInScript:(0,psbtutils_1$1.pubkeyPositionInScript)(et.pubkey,tt)},et)}function findTapLeafToFinalize(tt,et,nt){if(!tt.tapScriptSig||!tt.tapScriptSig.length)throw new Error(`Can not finalize taproot input #${et}. No tapleaf script signature provided.`);const it=(tt.tapLeafScript||[]).sort((rt,ot)=>rt.controlBlock.length-ot.controlBlock.length).find(rt=>canFinalizeLeaf(rt,tt.tapScriptSig,nt));if(!it)throw new Error(`Can not finalize taproot input #${et}. Signature for tapleaf script not found.`);return it}function canFinalizeLeaf(tt,et,nt){const it=(0,bip341_1$1.tapleafHash)({output:tt.script,version:tt.leafVersion});return(!nt||nt.equals(it))&&et.find(ot=>ot.leafHash.equals(it))!==void 0}function hasNonTaprootFields(tt){return tt&&!!(tt.redeemScript||tt.witnessScript||tt.bip32Derivation&&tt.bip32Derivation.length)}Object.defineProperty(psbt$1,"__esModule",{value:!0});psbt$1.Psbt=void 0;const bip174_1=psbt,varuint=varint,utils_1=utils$1,address_1=address,bufferutils_1=bufferutils,networks_1=networks$1,payments=payments$3,bip341_1=bip341,bscript=script,transaction_1=transaction,bip371_1=bip371,psbtutils_1=psbtutils,DEFAULT_OPTS={network:networks_1.bitcoin,maximumFeeRate:5e3};class Psbt{static fromBase64(et,nt={}){const it=Buffer.from(et,"base64");return this.fromBuffer(it,nt)}static fromHex(et,nt={}){const it=Buffer.from(et,"hex");return this.fromBuffer(it,nt)}static fromBuffer(et,nt={}){const it=bip174_1.Psbt.fromBuffer(et,transactionFromBuffer),rt=new Psbt(nt,it);return checkTxForDupeIns(rt.__CACHE.__TX,rt.__CACHE),rt}constructor(et={},nt=new bip174_1.Psbt(new PsbtTransaction)){this.data=nt,this.opts=Object.assign({},DEFAULT_OPTS,et),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},this.data.inputs.length===0&&this.setVersion(2);const it=(rt,ot,at,st)=>Object.defineProperty(rt,ot,{enumerable:at,writable:st});it(this,"__CACHE",!1,!0),it(this,"opts",!1,!0)}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(et){this.setVersion(et)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(et){this.setLocktime(et)}get txInputs(){return this.__CACHE.__TX.ins.map(et=>({hash:(0,bufferutils_1.cloneBuffer)(et.hash),index:et.index,sequence:et.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(et=>{let nt;try{nt=(0,address_1.fromOutputScript)(et.script,this.opts.network)}catch{}return{script:(0,bufferutils_1.cloneBuffer)(et.script),value:et.value,address:nt}})}combine(...et){return this.data.combine(...et.map(nt=>nt.data)),this}clone(){const et=Psbt.fromBuffer(this.data.toBuffer());return et.opts=JSON.parse(JSON.stringify(this.opts)),et}setMaximumFeeRate(et){check32Bit(et),this.opts.maximumFeeRate=et}setVersion(et){check32Bit(et),checkInputsForPartialSig(this.data.inputs,"setVersion");const nt=this.__CACHE;return nt.__TX.version=et,nt.__EXTRACTED_TX=void 0,this}setLocktime(et){check32Bit(et),checkInputsForPartialSig(this.data.inputs,"setLocktime");const nt=this.__CACHE;return nt.__TX.locktime=et,nt.__EXTRACTED_TX=void 0,this}setInputSequence(et,nt){check32Bit(nt),checkInputsForPartialSig(this.data.inputs,"setInputSequence");const it=this.__CACHE;if(it.__TX.ins.length<=et)throw new Error("Input index too high");return it.__TX.ins[et].sequence=nt,it.__EXTRACTED_TX=void 0,this}addInputs(et){return et.forEach(nt=>this.addInput(nt)),this}addInput(et){if(arguments.length>1||!et||et.hash===void 0||et.index===void 0)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");(0,bip371_1.checkTaprootInputFields)(et,et,"addInput"),checkInputsForPartialSig(this.data.inputs,"addInput"),et.witnessScript&&checkInvalidP2WSH(et.witnessScript);const nt=this.__CACHE;this.data.addInput(et);const it=nt.__TX.ins[nt.__TX.ins.length-1];checkTxInputCache(nt,it);const rt=this.data.inputs.length-1,ot=this.data.inputs[rt];return ot.nonWitnessUtxo&&addNonWitnessTxCache(this.__CACHE,ot,rt),nt.__FEE=void 0,nt.__FEE_RATE=void 0,nt.__EXTRACTED_TX=void 0,this}addOutputs(et){return et.forEach(nt=>this.addOutput(nt)),this}addOutput(et){if(arguments.length>1||!et||et.value===void 0||et.address===void 0&&et.script===void 0)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");checkInputsForPartialSig(this.data.inputs,"addOutput");const{address:nt}=et;if(typeof nt=="string"){const{network:rt}=this.opts,ot=(0,address_1.toOutputScript)(nt,rt);et=Object.assign(et,{script:ot})}(0,bip371_1.checkTaprootOutputFields)(et,et,"addOutput");const it=this.__CACHE;return this.data.addOutput(et),it.__FEE=void 0,it.__FEE_RATE=void 0,it.__EXTRACTED_TX=void 0,this}extractTransaction(et){if(!this.data.inputs.every(isFinalized))throw new Error("Not finalized");const nt=this.__CACHE;if(et||checkFees(this,nt,this.opts),nt.__EXTRACTED_TX)return nt.__EXTRACTED_TX;const it=nt.__TX.clone();return inputFinalizeGetAmts(this.data.inputs,it,nt,!0),it}getFeeRate(){return getTxCacheValue("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return getTxCacheValue("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return(0,utils_1.checkForInput)(this.data.inputs,0),range$5(this.data.inputs.length).forEach(et=>this.finalizeInput(et)),this}finalizeInput(et,nt){const it=(0,utils_1.checkForInput)(this.data.inputs,et);return(0,bip371_1.isTaprootInput)(it)?this._finalizeTaprootInput(et,it,void 0,nt):this._finalizeInput(et,it,nt)}finalizeTaprootInput(et,nt,it=bip371_1.tapScriptFinalizer){const rt=(0,utils_1.checkForInput)(this.data.inputs,et);if((0,bip371_1.isTaprootInput)(rt))return this._finalizeTaprootInput(et,rt,nt,it);throw new Error(`Cannot finalize input #${et}. Not Taproot.`)}_finalizeInput(et,nt,it=getFinalScripts){const{script:rt,isP2SH:ot,isP2WSH:at,isSegwit:st}=getScriptFromInput(et,nt,this.__CACHE);if(!rt)throw new Error(`No script found for input #${et}`);checkPartialSigSighashes(nt);const{finalScriptSig:lt,finalScriptWitness:ct}=it(et,nt,rt,st,ot,at);if(lt&&this.data.updateInput(et,{finalScriptSig:lt}),ct&&this.data.updateInput(et,{finalScriptWitness:ct}),!lt&&!ct)throw new Error(`Unknown error finalizing input #${et}`);return this.data.clearFinalizedInput(et),this}_finalizeTaprootInput(et,nt,it,rt=bip371_1.tapScriptFinalizer){if(!nt.witnessUtxo)throw new Error(`Cannot finalize input #${et}. Missing withness utxo.`);if(nt.tapKeySig){const ot=payments.p2tr({output:nt.witnessUtxo.script,signature:nt.tapKeySig}),at=(0,psbtutils_1.witnessStackToScriptWitness)(ot.witness);this.data.updateInput(et,{finalScriptWitness:at})}else{const{finalScriptWitness:ot}=rt(et,nt,it);this.data.updateInput(et,{finalScriptWitness:ot})}return this.data.clearFinalizedInput(et),this}getInputType(et){const nt=(0,utils_1.checkForInput)(this.data.inputs,et),it=getScriptFromUtxo(et,nt,this.__CACHE),rt=getMeaningfulScript(it,et,"input",nt.redeemScript||redeemFromFinalScriptSig(nt.finalScriptSig),nt.witnessScript||redeemFromFinalWitnessScript(nt.finalScriptWitness)),ot=rt.type==="raw"?"":rt.type+"-",at=classifyScript(rt.meaningfulScript);return ot+at}inputHasPubkey(et,nt){const it=(0,utils_1.checkForInput)(this.data.inputs,et);return pubkeyInInput(nt,it,et,this.__CACHE)}inputHasHDKey(et,nt){const it=(0,utils_1.checkForInput)(this.data.inputs,et),rt=bip32DerivationIsMine(nt);return!!it.bip32Derivation&&it.bip32Derivation.some(rt)}outputHasPubkey(et,nt){const it=(0,utils_1.checkForOutput)(this.data.outputs,et);return pubkeyInOutput(nt,it,et,this.__CACHE)}outputHasHDKey(et,nt){const it=(0,utils_1.checkForOutput)(this.data.outputs,et),rt=bip32DerivationIsMine(nt);return!!it.bip32Derivation&&it.bip32Derivation.some(rt)}validateSignaturesOfAllInputs(et){return(0,utils_1.checkForInput)(this.data.inputs,0),range$5(this.data.inputs.length).map(it=>this.validateSignaturesOfInput(it,et)).reduce((it,rt)=>rt===!0&&it,!0)}validateSignaturesOfInput(et,nt,it){const rt=this.data.inputs[et];return(0,bip371_1.isTaprootInput)(rt)?this.validateSignaturesOfTaprootInput(et,nt,it):this._validateSignaturesOfInput(et,nt,it)}_validateSignaturesOfInput(et,nt,it){const rt=this.data.inputs[et],ot=(rt||{}).partialSig;if(!rt||!ot||ot.length<1)throw new Error("No signatures to validate");if(typeof nt!="function")throw new Error("Need validator function to validate signatures");const at=it?ot.filter(ht=>ht.pubkey.equals(it)):ot;if(at.length<1)throw new Error("No signatures for this pubkey");const st=[];let lt,ct,ut;for(const ht of at){const dt=bscript.signature.decode(ht.signature),{hash:pt,script:mt}=ut!==dt.hashType?getHashForSig(et,Object.assign({},rt,{sighashType:dt.hashType}),this.__CACHE,!0):{hash:lt,script:ct};ut=dt.hashType,lt=pt,ct=mt,checkScriptForPubkey(ht.pubkey,mt,"verify"),st.push(nt(ht.pubkey,pt,dt.signature))}return st.every(ht=>ht===!0)}validateSignaturesOfTaprootInput(et,nt,it){const rt=this.data.inputs[et],ot=(rt||{}).tapKeySig,at=(rt||{}).tapScriptSig;if(!rt&&!ot&&!(at&&!at.length))throw new Error("No signatures to validate");if(typeof nt!="function")throw new Error("Need validator function to validate signatures");it=it&&(0,bip371_1.toXOnly)(it);const st=it?getTaprootHashesForSig(et,rt,this.data.inputs,it,this.__CACHE):getAllTaprootHashesForSig(et,rt,this.data.inputs,this.__CACHE);if(!st.length)throw new Error("No signatures for this pubkey");const lt=st.find(ut=>!ut.leafHash);let ct=0;if(ot&<){if(!nt(lt.pubkey,lt.hash,trimTaprootSig(ot)))return!1;ct++}if(at)for(const ut of at){const ht=st.find(dt=>ut.pubkey.equals(dt.pubkey));if(ht){if(!nt(ut.pubkey,ht.hash,trimTaprootSig(ut.signature)))return!1;ct++}}return ct>0}signAllInputsHD(et,nt=[transaction_1.Transaction.SIGHASH_ALL]){if(!et||!et.publicKey||!et.fingerprint)throw new Error("Need HDSigner to sign input");const it=[];for(const rt of range$5(this.data.inputs.length))try{this.signInputHD(rt,et,nt),it.push(!0)}catch{it.push(!1)}if(it.every(rt=>rt===!1))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(et,nt=[transaction_1.Transaction.SIGHASH_ALL]){return new Promise((it,rt)=>{if(!et||!et.publicKey||!et.fingerprint)return rt(new Error("Need HDSigner to sign input"));const ot=[],at=[];for(const st of range$5(this.data.inputs.length))at.push(this.signInputHDAsync(st,et,nt).then(()=>{ot.push(!0)},()=>{ot.push(!1)}));return Promise.all(at).then(()=>{if(ot.every(st=>st===!1))return rt(new Error("No inputs were signed"));it()})})}signInputHD(et,nt,it=[transaction_1.Transaction.SIGHASH_ALL]){if(!nt||!nt.publicKey||!nt.fingerprint)throw new Error("Need HDSigner to sign input");return getSignersFromHD(et,this.data.inputs,nt).forEach(ot=>this.signInput(et,ot,it)),this}signInputHDAsync(et,nt,it=[transaction_1.Transaction.SIGHASH_ALL]){return new Promise((rt,ot)=>{if(!nt||!nt.publicKey||!nt.fingerprint)return ot(new Error("Need HDSigner to sign input"));const st=getSignersFromHD(et,this.data.inputs,nt).map(lt=>this.signInputAsync(et,lt,it));return Promise.all(st).then(()=>{rt()}).catch(ot)})}signAllInputs(et,nt){if(!et||!et.publicKey)throw new Error("Need Signer to sign input");const it=[];for(const rt of range$5(this.data.inputs.length))try{this.signInput(rt,et,nt),it.push(!0)}catch{it.push(!1)}if(it.every(rt=>rt===!1))throw new Error("No inputs were signed");return this}signAllInputsAsync(et,nt){return new Promise((it,rt)=>{if(!et||!et.publicKey)return rt(new Error("Need Signer to sign input"));const ot=[],at=[];for(const[st]of this.data.inputs.entries())at.push(this.signInputAsync(st,et,nt).then(()=>{ot.push(!0)},()=>{ot.push(!1)}));return Promise.all(at).then(()=>{if(ot.every(st=>st===!1))return rt(new Error("No inputs were signed"));it()})})}signInput(et,nt,it){if(!nt||!nt.publicKey)throw new Error("Need Signer to sign input");const rt=(0,utils_1.checkForInput)(this.data.inputs,et);return(0,bip371_1.isTaprootInput)(rt)?this._signTaprootInput(et,rt,nt,void 0,it):this._signInput(et,nt,it)}signTaprootInput(et,nt,it,rt){if(!nt||!nt.publicKey)throw new Error("Need Signer to sign input");const ot=(0,utils_1.checkForInput)(this.data.inputs,et);if((0,bip371_1.isTaprootInput)(ot))return this._signTaprootInput(et,ot,nt,it,rt);throw new Error(`Input #${et} is not of type Taproot.`)}_signInput(et,nt,it=[transaction_1.Transaction.SIGHASH_ALL]){const{hash:rt,sighashType:ot}=getHashAndSighashType(this.data.inputs,et,nt.publicKey,this.__CACHE,it),at=[{pubkey:nt.publicKey,signature:bscript.signature.encode(nt.sign(rt),ot)}];return this.data.updateInput(et,{partialSig:at}),this}_signTaprootInput(et,nt,it,rt,ot=[transaction_1.Transaction.SIGHASH_DEFAULT]){const at=this.checkTaprootHashesForSig(et,nt,it,rt,ot),st=at.filter(ct=>!ct.leafHash).map(ct=>(0,bip371_1.serializeTaprootSignature)(it.signSchnorr(ct.hash),nt.sighashType))[0],lt=at.filter(ct=>!!ct.leafHash).map(ct=>({pubkey:(0,bip371_1.toXOnly)(it.publicKey),signature:(0,bip371_1.serializeTaprootSignature)(it.signSchnorr(ct.hash),nt.sighashType),leafHash:ct.leafHash}));return st&&this.data.updateInput(et,{tapKeySig:st}),lt.length&&this.data.updateInput(et,{tapScriptSig:lt}),this}signInputAsync(et,nt,it){return Promise.resolve().then(()=>{if(!nt||!nt.publicKey)throw new Error("Need Signer to sign input");const rt=(0,utils_1.checkForInput)(this.data.inputs,et);return(0,bip371_1.isTaprootInput)(rt)?this._signTaprootInputAsync(et,rt,nt,void 0,it):this._signInputAsync(et,nt,it)})}signTaprootInputAsync(et,nt,it,rt){return Promise.resolve().then(()=>{if(!nt||!nt.publicKey)throw new Error("Need Signer to sign input");const ot=(0,utils_1.checkForInput)(this.data.inputs,et);if((0,bip371_1.isTaprootInput)(ot))return this._signTaprootInputAsync(et,ot,nt,it,rt);throw new Error(`Input #${et} is not of type Taproot.`)})}_signInputAsync(et,nt,it=[transaction_1.Transaction.SIGHASH_ALL]){const{hash:rt,sighashType:ot}=getHashAndSighashType(this.data.inputs,et,nt.publicKey,this.__CACHE,it);return Promise.resolve(nt.sign(rt)).then(at=>{const st=[{pubkey:nt.publicKey,signature:bscript.signature.encode(at,ot)}];this.data.updateInput(et,{partialSig:st})})}async _signTaprootInputAsync(et,nt,it,rt,ot=[transaction_1.Transaction.SIGHASH_DEFAULT]){const at=this.checkTaprootHashesForSig(et,nt,it,rt,ot),st=[],lt=at.filter(ut=>!ut.leafHash)[0];if(lt){const ut=Promise.resolve(it.signSchnorr(lt.hash)).then(ht=>({tapKeySig:(0,bip371_1.serializeTaprootSignature)(ht,nt.sighashType)}));st.push(ut)}const ct=at.filter(ut=>!!ut.leafHash);if(ct.length){const ut=ct.map(ht=>Promise.resolve(it.signSchnorr(ht.hash)).then(dt=>({tapScriptSig:[{pubkey:(0,bip371_1.toXOnly)(it.publicKey),signature:(0,bip371_1.serializeTaprootSignature)(dt,nt.sighashType),leafHash:ht.leafHash}]})));st.push(...ut)}return Promise.all(st).then(ut=>{ut.forEach(ht=>this.data.updateInput(et,ht))})}checkTaprootHashesForSig(et,nt,it,rt,ot){if(typeof it.signSchnorr!="function")throw new Error(`Need Schnorr Signer to sign taproot input #${et}.`);const at=getTaprootHashesForSig(et,nt,this.data.inputs,it.publicKey,this.__CACHE,rt,ot);if(!at||!at.length)throw new Error(`Can not sign for input #${et} with the key ${it.publicKey.toString("hex")}`);return at}toBuffer(){return checkCache(this.__CACHE),this.data.toBuffer()}toHex(){return checkCache(this.__CACHE),this.data.toHex()}toBase64(){return checkCache(this.__CACHE),this.data.toBase64()}updateGlobal(et){return this.data.updateGlobal(et),this}updateInput(et,nt){return nt.witnessScript&&checkInvalidP2WSH(nt.witnessScript),(0,bip371_1.checkTaprootInputFields)(this.data.inputs[et],nt,"updateInput"),this.data.updateInput(et,nt),nt.nonWitnessUtxo&&addNonWitnessTxCache(this.__CACHE,this.data.inputs[et],et),this}updateOutput(et,nt){const it=this.data.outputs[et];return(0,bip371_1.checkTaprootOutputFields)(it,nt,"updateOutput"),this.data.updateOutput(et,nt),this}addUnknownKeyValToGlobal(et){return this.data.addUnknownKeyValToGlobal(et),this}addUnknownKeyValToInput(et,nt){return this.data.addUnknownKeyValToInput(et,nt),this}addUnknownKeyValToOutput(et,nt){return this.data.addUnknownKeyValToOutput(et,nt),this}clearFinalizedInput(et){return this.data.clearFinalizedInput(et),this}}psbt$1.Psbt=Psbt;const transactionFromBuffer=tt=>new PsbtTransaction(tt);class PsbtTransaction{constructor(et=Buffer.from([2,0,0,0,0,0,0,0,0,0])){this.tx=transaction_1.Transaction.fromBuffer(et),checkTxEmpty(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(et){if(et.hash===void 0||et.index===void 0||!Buffer.isBuffer(et.hash)&&typeof et.hash!="string"||typeof et.index!="number")throw new Error("Error adding input.");const nt=typeof et.hash=="string"?(0,bufferutils_1.reverseBuffer)(Buffer.from(et.hash,"hex")):et.hash;this.tx.addInput(nt,et.index,et.sequence)}addOutput(et){if(et.script===void 0||et.value===void 0||!Buffer.isBuffer(et.script)||typeof et.value!="number")throw new Error("Error adding output.");this.tx.addOutput(et.script,et.value)}toBuffer(){return this.tx.toBuffer()}}function canFinalize(tt,et,nt){switch(nt){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return hasSigs(1,tt.partialSig);case"multisig":const it=payments.p2ms({output:et});return hasSigs(it.m,tt.partialSig,it.pubkeys);default:return!1}}function checkCache(tt){if(tt.__UNSAFE_SIGN_NONSEGWIT!==!1)throw new Error("Not BIP174 compliant, can not export")}function hasSigs(tt,et,nt){if(!et)return!1;let it;if(nt?it=nt.map(rt=>{const ot=compressPubkey(rt);return et.find(at=>at.pubkey.equals(ot))}).filter(rt=>!!rt):it=et,it.length>tt)throw new Error("Too many signatures");return it.length===tt}function isFinalized(tt){return!!tt.finalScriptSig||!!tt.finalScriptWitness}function bip32DerivationIsMine(tt){return et=>!(!et.masterFingerprint.equals(tt.fingerprint)||!tt.derivePath(et.path).publicKey.equals(et.pubkey))}function check32Bit(tt){if(typeof tt!="number"||tt!==Math.floor(tt)||tt>4294967295||tt<0)throw new Error("Invalid 32 bit integer")}function checkFees(tt,et,nt){const it=et.__FEE_RATE||tt.getFeeRate(),rt=et.__EXTRACTED_TX.virtualSize(),ot=it*rt;if(it>=nt.maximumFeeRate)throw new Error(`Warning: You are paying around ${(ot/1e8).toFixed(8)} in fees, which is ${it} satoshi per byte for a transaction with a VSize of ${rt} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}function checkInputsForPartialSig(tt,et){tt.forEach(nt=>{if((0,bip371_1.isTaprootInput)(nt)?(0,bip371_1.checkTaprootInputForSigs)(nt,et):(0,psbtutils_1.checkInputForSig)(nt,et))throw new Error("Can not modify transaction, signatures exist.")})}function checkPartialSigSighashes(tt){if(!tt.sighashType||!tt.partialSig)return;const{partialSig:et,sighashType:nt}=tt;et.forEach(it=>{const{hashType:rt}=bscript.signature.decode(it.signature);if(nt!==rt)throw new Error("Signature sighash does not match input sighash type")})}function checkScriptForPubkey(tt,et,nt){if(!(0,psbtutils_1.pubkeyInScript)(tt,et))throw new Error(`Can not ${nt} for this input with the key ${tt.toString("hex")}`)}function checkTxEmpty(tt){if(!tt.ins.every(nt=>nt.script&&nt.script.length===0&&nt.witness&&nt.witness.length===0))throw new Error("Format Error: Transaction ScriptSigs are not empty")}function checkTxForDupeIns(tt,et){tt.ins.forEach(nt=>{checkTxInputCache(et,nt)})}function checkTxInputCache(tt,et){const nt=(0,bufferutils_1.reverseBuffer)(Buffer.from(et.hash)).toString("hex")+":"+et.index;if(tt.__TX_IN_CACHE[nt])throw new Error("Duplicate input detected.");tt.__TX_IN_CACHE[nt]=1}function scriptCheckerFactory(tt,et){return(nt,it,rt,ot)=>{const at=tt({redeem:{output:rt}}).output;if(!it.equals(at))throw new Error(`${et} for ${ot} #${nt} doesn't match the scriptPubKey in the prevout`)}}const checkRedeemScript=scriptCheckerFactory(payments.p2sh,"Redeem script"),checkWitnessScript=scriptCheckerFactory(payments.p2wsh,"Witness script");function getTxCacheValue(tt,et,nt,it){if(!nt.every(isFinalized))throw new Error(`PSBT must be finalized to calculate ${et}`);if(tt==="__FEE_RATE"&&it.__FEE_RATE)return it.__FEE_RATE;if(tt==="__FEE"&&it.__FEE)return it.__FEE;let rt,ot=!0;if(it.__EXTRACTED_TX?(rt=it.__EXTRACTED_TX,ot=!1):rt=it.__TX.clone(),inputFinalizeGetAmts(nt,rt,it,ot),tt==="__FEE_RATE")return it.__FEE_RATE;if(tt==="__FEE")return it.__FEE}function getFinalScripts(tt,et,nt,it,rt,ot){const at=classifyScript(nt);if(!canFinalize(et,nt,at))throw new Error(`Can not finalize input #${tt}`);return prepareFinalScripts(nt,at,et.partialSig,it,rt,ot)}function prepareFinalScripts(tt,et,nt,it,rt,ot){let at,st;const lt=getPayment(tt,et,nt),ct=ot?payments.p2wsh({redeem:lt}):null,ut=rt?payments.p2sh({redeem:ct||lt}):null;return it?(ct?st=(0,psbtutils_1.witnessStackToScriptWitness)(ct.witness):st=(0,psbtutils_1.witnessStackToScriptWitness)(lt.witness),ut&&(at=ut.input)):ut?at=ut.input:at=lt.input,{finalScriptSig:at,finalScriptWitness:st}}function getHashAndSighashType(tt,et,nt,it,rt){const ot=(0,utils_1.checkForInput)(tt,et),{hash:at,sighashType:st,script:lt}=getHashForSig(et,ot,it,!1,rt);return checkScriptForPubkey(nt,lt,"sign"),{hash:at,sighashType:st}}function getHashForSig(tt,et,nt,it,rt){const ot=nt.__TX,at=et.sighashType||transaction_1.Transaction.SIGHASH_ALL;checkSighashTypeAllowed(at,rt);let st,lt;if(et.nonWitnessUtxo){const ht=nonWitnessUtxoTxFromCache(nt,et,tt),dt=ot.ins[tt].hash,pt=ht.getHash();if(!dt.equals(pt))throw new Error(`Non-witness UTXO hash for input #${tt} doesn't match the hash specified in the prevout`);const mt=ot.ins[tt].index;lt=ht.outs[mt]}else if(et.witnessUtxo)lt=et.witnessUtxo;else throw new Error("Need a Utxo input item for signing");const{meaningfulScript:ct,type:ut}=getMeaningfulScript(lt.script,tt,"input",et.redeemScript,et.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(ut)>=0)st=ot.hashForWitnessV0(tt,ct,lt.value,at);else if((0,psbtutils_1.isP2WPKH)(ct)){const ht=payments.p2pkh({hash:ct.slice(2)}).output;st=ot.hashForWitnessV0(tt,ht,lt.value,at)}else{if(et.nonWitnessUtxo===void 0&&nt.__UNSAFE_SIGN_NONSEGWIT===!1)throw new Error(`Input #${tt} has witnessUtxo but non-segwit script: ${ct.toString("hex")}`);!it&&nt.__UNSAFE_SIGN_NONSEGWIT!==!1&&console.warn(`Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant. ********************* PROCEED WITH CAUTION! -*********************`),st=ot.hashForSignature(tt,ct,at)}return{script:ct,sighashType:at,hash:st}}function getAllTaprootHashesForSig(tt,et,nt,it){const rt=[];if(et.tapInternalKey){const at=getPrevoutTaprootKey(tt,et,it);at&&rt.push(at)}if(et.tapScriptSig){const at=et.tapScriptSig.map(st=>st.pubkey);rt.push(...at)}return rt.map(at=>getTaprootHashesForSig(tt,et,nt,at,it)).flat()}function getPrevoutTaprootKey(tt,et,nt){const{script:it}=getScriptAndAmountFromUtxo(tt,et,nt);return(0,psbtutils_1.isP2TR)(it)?it.subarray(2,34):null}function trimTaprootSig(tt){return tt.length===64?tt:tt.subarray(0,64)}function getTaprootHashesForSig(tt,et,nt,it,rt,ot,at){const st=rt.__TX,lt=et.sighashType||transaction_1.Transaction.SIGHASH_DEFAULT;checkSighashTypeAllowed(lt,at);const ct=nt.map((mt,gt)=>getScriptAndAmountFromUtxo(gt,mt,rt)),ut=ct.map(mt=>mt.script),ht=ct.map(mt=>mt.value),dt=[];if(et.tapInternalKey&&!ot){const mt=getPrevoutTaprootKey(tt,et,rt)||Buffer.from([]);if((0,bip371_1.toXOnly)(it).equals(mt)){const gt=st.hashForWitnessV1(tt,ut,ht,lt);dt.push({pubkey:it,hash:gt})}}const pt=(et.tapLeafScript||[]).filter(mt=>(0,psbtutils_1.pubkeyInScript)(it,mt.script)).map(mt=>{const gt=(0,bip341_1.tapleafHash)({output:mt.script,version:mt.leafVersion});return Object.assign({hash:gt},mt)}).filter(mt=>!ot||ot.equals(mt.hash)).map(mt=>{const gt=st.hashForWitnessV1(tt,ut,ht,transaction_1.Transaction.SIGHASH_DEFAULT,mt.hash);return{pubkey:it,hash:gt,leafHash:mt.hash}});return dt.concat(pt)}function checkSighashTypeAllowed(tt,et){if(et&&et.indexOf(tt)<0){const nt=sighashTypeToString(tt);throw new Error(`Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ${nt}`)}}function getPayment(tt,et,nt){let it;switch(et){case"multisig":const rt=getSortedSigs(tt,nt);it=payments.p2ms({output:tt,signatures:rt});break;case"pubkey":it=payments.p2pk({output:tt,signature:nt[0].signature});break;case"pubkeyhash":it=payments.p2pkh({output:tt,pubkey:nt[0].pubkey,signature:nt[0].signature});break;case"witnesspubkeyhash":it=payments.p2wpkh({output:tt,pubkey:nt[0].pubkey,signature:nt[0].signature});break}return it}function getScriptFromInput(tt,et,nt){const it=nt.__TX,rt={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(rt.isP2SH=!!et.redeemScript,rt.isP2WSH=!!et.witnessScript,et.witnessScript)rt.script=et.witnessScript;else if(et.redeemScript)rt.script=et.redeemScript;else if(et.nonWitnessUtxo){const ot=nonWitnessUtxoTxFromCache(nt,et,tt),at=it.ins[tt].index;rt.script=ot.outs[at].script}else et.witnessUtxo&&(rt.script=et.witnessUtxo.script);return(et.witnessScript||(0,psbtutils_1.isP2WPKH)(rt.script))&&(rt.isSegwit=!0),rt}function getSignersFromHD(tt,et,nt){const it=(0,utils_1.checkForInput)(et,tt);if(!it.bip32Derivation||it.bip32Derivation.length===0)throw new Error("Need bip32Derivation to sign with HD");const rt=it.bip32Derivation.map(at=>{if(at.masterFingerprint.equals(nt.fingerprint))return at}).filter(at=>!!at);if(rt.length===0)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return rt.map(at=>{const st=nt.derivePath(at.path);if(!at.pubkey.equals(st.publicKey))throw new Error("pubkey did not match bip32Derivation");return st})}function getSortedSigs(tt,et){return payments.p2ms({output:tt}).pubkeys.map(it=>(et.filter(rt=>rt.pubkey.equals(it))[0]||{}).signature).filter(it=>!!it)}function scriptWitnessToWitnessStack(tt){let et=0;function nt(at){return et+=at,tt.slice(et-at,et)}function it(){const at=varuint.decode(tt,et);return et+=varuint.decode.bytes,at}function rt(){return nt(it())}function ot(){const at=it(),st=[];for(let lt=0;lt{if(it&<.finalScriptSig&&(et.ins[ct].script=lt.finalScriptSig),it&<.finalScriptWitness&&(et.ins[ct].witness=scriptWitnessToWitnessStack(lt.finalScriptWitness)),lt.witnessUtxo)rt+=lt.witnessUtxo.value;else if(lt.nonWitnessUtxo){const ut=nonWitnessUtxoTxFromCache(nt,lt,ct),ht=et.ins[ct].index,dt=ut.outs[ht];rt+=dt.value}});const ot=et.outs.reduce((lt,ct)=>lt+ct.value,0),at=rt-ot;if(at<0)throw new Error("Outputs are spending more than Inputs");const st=et.virtualSize();nt.__FEE=at,nt.__EXTRACTED_TX=et,nt.__FEE_RATE=Math.floor(at/st)}function nonWitnessUtxoTxFromCache(tt,et,nt){const it=tt.__NON_WITNESS_UTXO_TX_CACHE;return it[nt]||addNonWitnessTxCache(tt,et,nt),it[nt]}function getScriptFromUtxo(tt,et,nt){const{script:it}=getScriptAndAmountFromUtxo(tt,et,nt);return it}function getScriptAndAmountFromUtxo(tt,et,nt){if(et.witnessUtxo!==void 0)return{script:et.witnessUtxo.script,value:et.witnessUtxo.value};if(et.nonWitnessUtxo!==void 0){const rt=nonWitnessUtxoTxFromCache(nt,et,tt).outs[nt.__TX.ins[tt].index];return{script:rt.script,value:rt.value}}else throw new Error("Can't find pubkey in input without Utxo data")}function pubkeyInInput(tt,et,nt,it){const rt=getScriptFromUtxo(nt,et,it),{meaningfulScript:ot}=getMeaningfulScript(rt,nt,"input",et.redeemScript,et.witnessScript);return(0,psbtutils_1.pubkeyInScript)(tt,ot)}function pubkeyInOutput(tt,et,nt,it){const rt=it.__TX.outs[nt].script,{meaningfulScript:ot}=getMeaningfulScript(rt,nt,"output",et.redeemScript,et.witnessScript);return(0,psbtutils_1.pubkeyInScript)(tt,ot)}function redeemFromFinalScriptSig(tt){if(!tt)return;const et=bscript.decompile(tt);if(!et)return;const nt=et[et.length-1];if(!(!Buffer.isBuffer(nt)||isPubkeyLike(nt)||isSigLike(nt)||!bscript.decompile(nt)))return nt}function redeemFromFinalWitnessScript(tt){if(!tt)return;const et=scriptWitnessToWitnessStack(tt),nt=et[et.length-1];if(!(isPubkeyLike(nt)||!bscript.decompile(nt)))return nt}function compressPubkey(tt){if(tt.length===65){const et=tt[64]&1,nt=tt.slice(0,33);return nt[0]=2|et,nt}return tt.slice()}function isPubkeyLike(tt){return tt.length===33&&bscript.isCanonicalPubKey(tt)}function isSigLike(tt){return bscript.isCanonicalScriptSignature(tt)}function getMeaningfulScript(tt,et,nt,it,rt){const ot=(0,psbtutils_1.isP2SHScript)(tt),at=ot&&it&&(0,psbtutils_1.isP2WSHScript)(it),st=(0,psbtutils_1.isP2WSHScript)(tt);if(ot&&it===void 0)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((st||at)&&rt===void 0)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let lt;return at?(lt=rt,checkRedeemScript(et,tt,it,nt),checkWitnessScript(et,it,rt,nt),checkInvalidP2WSH(lt)):st?(lt=rt,checkWitnessScript(et,tt,rt,nt),checkInvalidP2WSH(lt)):ot?(lt=it,checkRedeemScript(et,tt,it,nt)):lt=tt,{meaningfulScript:lt,type:at?"p2sh-p2wsh":ot?"p2sh":st?"p2wsh":"raw"}}function checkInvalidP2WSH(tt){if((0,psbtutils_1.isP2WPKH)(tt)||(0,psbtutils_1.isP2SHScript)(tt))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function classifyScript(tt){return(0,psbtutils_1.isP2WPKH)(tt)?"witnesspubkeyhash":(0,psbtutils_1.isP2PKH)(tt)?"pubkeyhash":(0,psbtutils_1.isP2MS)(tt)?"multisig":(0,psbtutils_1.isP2PK)(tt)?"pubkey":"nonstandard"}function range$5(tt){return[...Array(tt).keys()]}(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.initEccLib=tt.Transaction=tt.opcodes=tt.Psbt=tt.Block=tt.script=tt.payments=tt.networks=tt.crypto=tt.address=void 0;const et=address;tt.address=et;const nt=crypto$2;tt.crypto=nt;const it=networks$1;tt.networks=it;const rt=payments$3;tt.payments=rt;const ot=script;tt.script=ot;var at=block;Object.defineProperty(tt,"Block",{enumerable:!0,get:function(){return at.Block}});var st=psbt$1;Object.defineProperty(tt,"Psbt",{enumerable:!0,get:function(){return st.Psbt}});var lt=ops;Object.defineProperty(tt,"opcodes",{enumerable:!0,get:function(){return lt.OPS}});var ct=transaction;Object.defineProperty(tt,"Transaction",{enumerable:!0,get:function(){return ct.Transaction}});var ut=ecc_lib;Object.defineProperty(tt,"initEccLib",{enumerable:!0,get:function(){return ut.initEccLib}})})(src$1);function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$4(tt,et){return tt===et||tt!==tt&&et!==et}var eq_1=eq$4,eq$3=eq_1;function assocIndexOf$4(tt,et){for(var nt=tt.length;nt--;)if(eq$3(tt[nt][0],et))return nt;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice$1=arrayProto.splice;function listCacheDelete$1(tt){var et=this.__data__,nt=assocIndexOf$3(et,tt);if(nt<0)return!1;var it=et.length-1;return nt==it?et.pop():splice$1.call(et,nt,1),--this.size,!0}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(tt){var et=this.__data__,nt=assocIndexOf$2(et,tt);return nt<0?void 0:et[nt][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(tt){return assocIndexOf$1(this.__data__,tt)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(tt,et){var nt=this.__data__,it=assocIndexOf(nt,tt);return it<0?(++this.size,nt.push([tt,et])):nt[it][1]=et,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(tt){var et=-1,nt=tt==null?0:tt.length;for(this.clear();++et-1&&tt%1==0&&tt-1&&tt%1==0&&tt<=MAX_SAFE_INTEGER$1}var isLength_1=isLength$3,baseGetTag$6=_baseGetTag,isLength$2=isLength_1,isObjectLike$8=isObjectLike_1,argsTag$2="[object Arguments]",arrayTag$2="[object Array]",boolTag$4="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",funcTag$1="[object Function]",mapTag$5="[object Map]",numberTag$4="[object Number]",objectTag$4="[object Object]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$4="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0;typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$2]=typedArrayTags[arrayBufferTag$3]=typedArrayTags[boolTag$4]=typedArrayTags[dataViewTag$4]=typedArrayTags[dateTag$3]=typedArrayTags[errorTag$2]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$5]=typedArrayTags[numberTag$4]=typedArrayTags[objectTag$4]=typedArrayTags[regexpTag$3]=typedArrayTags[setTag$5]=typedArrayTags[stringTag$4]=typedArrayTags[weakMapTag$2]=!1;function baseIsTypedArray$1(tt){return isObjectLike$8(tt)&&isLength$2(tt.length)&&!!typedArrayTags[baseGetTag$6(tt)]}var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$4(tt){return function(et){return tt(et)}}var _baseUnary=baseUnary$4,_nodeUtil={exports:{}};_nodeUtil.exports;(function(tt,et){var nt=_freeGlobal,it=et&&!et.nodeType&&et,rt=it&&!0&&tt&&!tt.nodeType&&tt,ot=rt&&rt.exports===it,at=ot&&nt.process,st=function(){try{var lt=rt&&rt.require&&rt.require("util").types;return lt||at&&at.binding&&at.binding("util")}catch{}}();tt.exports=st})(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports,baseIsTypedArray=_baseIsTypedArray,baseUnary$3=_baseUnary,nodeUtil$2=_nodeUtilExports,nodeIsTypedArray=nodeUtil$2&&nodeUtil$2.isTypedArray,isTypedArray$3=nodeIsTypedArray?baseUnary$3(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$3,baseTimes=_baseTimes,isArguments$2=isArguments_1,isArray$i=isArray_1,isBuffer$2=isBufferExports,isIndex$2=_isIndex,isTypedArray$2=isTypedArray_1,objectProto$8=Object.prototype,hasOwnProperty$9=objectProto$8.hasOwnProperty;function arrayLikeKeys$2(tt,et){var nt=isArray$i(tt),it=!nt&&isArguments$2(tt),rt=!nt&&!it&&isBuffer$2(tt),ot=!nt&&!it&&!rt&&isTypedArray$2(tt),at=nt||it||rt||ot,st=at?baseTimes(tt.length,String):[],lt=st.length;for(var ct in tt)(et||hasOwnProperty$9.call(tt,ct))&&!(at&&(ct=="length"||rt&&(ct=="offset"||ct=="parent")||ot&&(ct=="buffer"||ct=="byteLength"||ct=="byteOffset")||isIndex$2(ct,lt)))&&st.push(ct);return st}var _arrayLikeKeys=arrayLikeKeys$2,objectProto$7=Object.prototype;function isPrototype$3(tt){var et=tt&&tt.constructor,nt=typeof et=="function"&&et.prototype||objectProto$7;return tt===nt}var _isPrototype=isPrototype$3;function overArg$2(tt,et){return function(nt){return tt(et(nt))}}var _overArg=overArg$2,overArg$1=_overArg,nativeKeys$1=overArg$1(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype$2=_isPrototype,nativeKeys=_nativeKeys,objectProto$6=Object.prototype,hasOwnProperty$8=objectProto$6.hasOwnProperty;function baseKeys$1(tt){if(!isPrototype$2(tt))return nativeKeys(tt);var et=[];for(var nt in Object(tt))hasOwnProperty$8.call(tt,nt)&&nt!="constructor"&&et.push(nt);return et}var _baseKeys=baseKeys$1,isFunction$1=isFunction_1,isLength$1=isLength_1;function isArrayLike$6(tt){return tt!=null&&isLength$1(tt.length)&&!isFunction$1(tt)}var isArrayLike_1=isArrayLike$6,arrayLikeKeys$1=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike$5=isArrayLike_1;function keys$9(tt){return isArrayLike$5(tt)?arrayLikeKeys$1(tt):baseKeys(tt)}var keys_1=keys$9,copyObject$3=_copyObject,keys$8=keys_1;function baseAssign$1(tt,et){return tt&©Object$3(et,keys$8(et),tt)}var _baseAssign=baseAssign$1;function nativeKeysIn$1(tt){var et=[];if(tt!=null)for(var nt in Object(tt))et.push(nt);return et}var _nativeKeysIn=nativeKeysIn$1,isObject$d=isObject_1,isPrototype$1=_isPrototype,nativeKeysIn=_nativeKeysIn,objectProto$5=Object.prototype,hasOwnProperty$7=objectProto$5.hasOwnProperty;function baseKeysIn$1(tt){if(!isObject$d(tt))return nativeKeysIn(tt);var et=isPrototype$1(tt),nt=[];for(var it in tt)it=="constructor"&&(et||!hasOwnProperty$7.call(tt,it))||nt.push(it);return nt}var _baseKeysIn=baseKeysIn$1,arrayLikeKeys=_arrayLikeKeys,baseKeysIn=_baseKeysIn,isArrayLike$4=isArrayLike_1;function keysIn$3(tt){return isArrayLike$4(tt)?arrayLikeKeys(tt,!0):baseKeysIn(tt)}var keysIn_1=keysIn$3,copyObject$2=_copyObject,keysIn$2=keysIn_1;function baseAssignIn$1(tt,et){return tt&©Object$2(et,keysIn$2(et),tt)}var _baseAssignIn=baseAssignIn$1,_cloneBuffer={exports:{}};_cloneBuffer.exports;(function(tt,et){var nt=_root,it=et&&!et.nodeType&&et,rt=it&&!0&&tt&&!tt.nodeType&&tt,ot=rt&&rt.exports===it,at=ot?nt.Buffer:void 0,st=at?at.allocUnsafe:void 0;function lt(ct,ut){if(ut)return ct.slice();var ht=ct.length,dt=st?st(ht):new ct.constructor(ht);return ct.copy(dt),dt}tt.exports=lt})(_cloneBuffer,_cloneBuffer.exports);var _cloneBufferExports=_cloneBuffer.exports;function copyArray$1(tt,et){var nt=-1,it=tt.length;for(et||(et=Array(it));++ntwordsToBuffer(tt,!0).toString("hex"),16:tt=>wordsToBuffer(tt,!0).toString("hex"),13:tt=>wordsToBuffer(tt,!0).toString("utf8"),19:tt=>wordsToBuffer(tt,!0).toString("hex"),23:tt=>wordsToBuffer(tt,!0).toString("hex"),6:wordsToIntBE,24:wordsToIntBE,9:fallbackAddressParser,3:routingInfoParser,5:featureBitsParser},unknownTagName="unknownTag";function unknownEncoder(tt){return tt.words=bech32.decode(tt.words,Number.MAX_SAFE_INTEGER).words,tt}function getUnknownParser(tt){return et=>({tagCode:parseInt(tt),words:bech32.encode("unknown",et,Number.MAX_SAFE_INTEGER)})}function wordsToIntBE(tt){return tt.reverse().reduce((et,nt,it)=>et+nt*Math.pow(32,it),0)}function intBEToWords(tt,et){const nt=[];if(et===void 0&&(et=5),tt=Math.floor(tt),tt===0)return[0];for(;tt>0;)nt.push(tt&Math.pow(2,et)-1),tt=Math.floor(tt/Math.pow(2,et));return nt.reverse()}function sha256(tt){return createHash("sha256").update(tt).digest()}function convert$1(tt,et,nt){let it=0,rt=0;const ot=(1<=nt;)rt-=nt,at.push(it>>rt&ot);return rt>0&&at.push(it<0;)nt=st.slice(0,33).toString("hex"),it=st.slice(33,41).toString("hex"),rt=parseInt(st.slice(41,45).toString("hex"),16),ot=parseInt(st.slice(45,49).toString("hex"),16),at=parseInt(st.slice(49,51).toString("hex"),16),st=st.slice(51),et.push({pubkey:nt,short_channel_id:it,fee_base_msat:rt,fee_proportional_millionths:ot,cltv_expiry_delta:at});return et}function featureBitsParser(tt){const et=tt.slice().reverse().map(it=>[!!(it&1),!!(it&2),!!(it&4),!!(it&8),!!(it&16)]).reduce((it,rt)=>it.concat(rt),[]);for(;et.length{nt[it]={required:et[rt*2],supported:et[rt*2+1]}}),et.length>FEATUREBIT_ORDER.length*2){const it=et.slice(FEATUREBIT_ORDER.length*2);nt.extra_bits={start_bit:FEATUREBIT_ORDER.length*2,bits:it,has_required:it.reduce((rt,ot,at)=>at%2!==0?rt||!1:rt||ot,!1)}}else nt.extra_bits={start_bit:FEATUREBIT_ORDER.length*2,bits:[],has_required:!1};return nt}function featureBitsEncoder(tt){let et=tt.word_length,nt=[];for(FEATUREBIT_ORDER.forEach(it=>{nt.push(!!(tt[it]||{}).required),nt.push(!!(tt[it]||{}).supported)});nt[nt.length-1]===!1;)nt.pop();for(;nt.length%5!==0;)nt.push(!1);if(tt.extra_bits&&Array.isArray(tt.extra_bits.bits)&&tt.extra_bits.bits.length>0){for(;nt.lengthet)throw new Error("word_length is too small to contain all featureBits");return et===void 0&&(et=Math.ceil(nt.length/5)),new Array(et).fill(0).map((it,rt)=>nt[rt*5+4]<<4|nt[rt*5+3]<<3|nt[rt*5+2]<<2|nt[rt*5+1]<<1|nt[rt*5]<<0).reverse()}function routingInfoEncoder(tt){let et=Buffer$1.from([]);return tt.forEach(nt=>{et=Buffer$1.concat([et,hexToBuffer(nt.pubkey)]),et=Buffer$1.concat([et,hexToBuffer(nt.short_channel_id)]),et=Buffer$1.concat([et,Buffer$1.from([0,0,0].concat(intBEToWords(nt.fee_base_msat,8)).slice(-4))]),et=Buffer$1.concat([et,Buffer$1.from([0,0,0].concat(intBEToWords(nt.fee_proportional_millionths,8)).slice(-4))]),et=Buffer$1.concat([et,Buffer$1.from([0].concat(intBEToWords(nt.cltv_expiry_delta,8)).slice(-2))])}),hexToWord(et)}function purposeCommitEncoder(tt){let et;if(tt!==void 0&&(typeof tt=="string"||tt instanceof String))tt.match(/^([a-zA-Z0-9]{2})*$/)?et=Buffer$1.from(tt,"hex"):et=sha256(Buffer$1.from(tt,"utf8"));else throw new Error("purpose or purpose commit must be a string or hex string");return bech32.toWords(et)}function tagsItems(tt,et){const nt=tt.filter(rt=>rt.tagName===et);return nt.length>0?nt[0].data:null}function tagsContainItem(tt,et){return tagsItems(tt,et)!==null}function orderKeys(tt,et){const nt={};if(Object.keys(tt).sort().forEach(it=>{nt[it]=tt[it]}),et===!0){const it="__tagsObject_cache";Object.defineProperty(nt,"tagsObject",{get(){return this[it]||Object.defineProperty(this,it,{value:getTagsObject(this.tags)}),this[it]}})}return nt}function satToHrp(tt){if(!tt.toString().match(/^\d+$/))throw new Error("satoshis must be an integer");const et=new BN(tt,10);return millisatToHrp(et.mul(new BN(1e3,10)))}function millisatToHrp(tt){if(!tt.toString().match(/^\d+$/))throw new Error("millisatoshis must be an integer");const et=new BN(tt,10),nt=et.toString(10),it=nt.length;let rt,ot;return it>11&&/0{11}$/.test(nt)?(rt="",ot=et.div(MILLISATS_PER_BTC).toString(10)):it>8&&/0{8}$/.test(nt)?(rt="m",ot=et.div(MILLISATS_PER_MILLIBTC).toString(10)):it>5&&/0{5}$/.test(nt)?(rt="u",ot=et.div(MILLISATS_PER_MICROBTC).toString(10)):it>2&&/0{2}$/.test(nt)?(rt="n",ot=et.div(MILLISATS_PER_NANOBTC).toString(10)):(rt="p",ot=et.mul(PICOBTC_PER_MILLISATS).toString(10)),ot+rt}function hrpToSat(tt,et){const nt=hrpToMillisat(tt,!1);if(!nt.mod(new BN(1e3,10)).eq(new BN(0,10)))throw new Error("Amount is outside of valid range");const it=nt.div(new BN(1e3,10));return et?it.toString():it}function hrpToMillisat(tt,et){let nt,it;if(tt.slice(-1).match(/^[munp]$/))nt=tt.slice(-1),it=tt.slice(0,-1);else{if(tt.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");it=tt}if(!it.match(/^\d+$/))throw new Error("Not a valid human readable amount");const rt=new BN(it,10),ot=nt?rt.mul(MILLISATS_PER_BTC).div(DIVISORS[nt]):rt.mul(MILLISATS_PER_BTC);if(nt==="p"&&!rt.mod(new BN(10,10)).eq(new BN(0,10))||ot.gt(MAX_MILLISATS))throw new Error("Amount is outside of valid range");return et?ot.toString():ot}function sign$1(tt,et){const nt=cloneDeep(tt),it=hexToBuffer(et);if(nt.complete&&nt.paymentRequest)return nt;if(it===void 0||it.length!==32||!secp256k1.privateKeyVerify(it))throw new Error("privateKey must be a 32 byte Buffer and valid private key");let rt,ot;if(tagsContainItem(nt.tags,TAGNAMES[19])&&(ot=hexToBuffer(tagsItems(nt.tags,TAGNAMES[19]))),nt.payeeNodeKey&&(rt=hexToBuffer(nt.payeeNodeKey)),rt&&ot&&!ot.equals(rt))throw new Error("payee node key tag and payeeNodeKey attribute must match");rt=ot||rt;const at=Buffer$1.from(secp256k1.publicKeyCreate(it));if(rt&&!at.equals(rt))throw new Error("The private key given is not the private key of the node public key given");const st=bech32.decode(nt.wordsTemp,Number.MAX_SAFE_INTEGER).words,lt=Buffer$1.concat([Buffer$1.from(nt.prefix,"utf8"),wordsToBuffer(st)]),ct=sha256(lt),ut=secp256k1.ecdsaSign(ct,it);ut.signature=Buffer$1.from(ut.signature);const ht=hexToWord(ut.signature.toString("hex")+"0"+ut.recid);return nt.payeeNodeKey=at.toString("hex"),nt.signature=ut.signature.toString("hex"),nt.recoveryFlag=ut.recid,nt.wordsTemp=bech32.encode("temp",st.concat(ht),Number.MAX_SAFE_INTEGER),nt.complete=!0,nt.paymentRequest=bech32.encode(nt.prefix,st.concat(ht),Number.MAX_SAFE_INTEGER),orderKeys(nt)}function encode$3(tt,et){const nt=cloneDeep(tt);et===void 0&&(et=!0);const it=!(nt.signature===void 0||nt.recoveryFlag===void 0);let rt;if(nt.network===void 0&&!it)nt.network=DEFAULTNETWORK,rt=DEFAULTNETWORK;else{if(nt.network===void 0&&it)throw new Error("Need network for proper payment request reconstruction");if(!nt.network.bech32||nt.network.pubKeyHash===void 0||nt.network.scriptHash===void 0||!Array.isArray(nt.network.validWitnessVersions))throw new Error("Invalid network");rt=nt.network}if(nt.timestamp===void 0&&!it)nt.timestamp=Math.floor(new Date().getTime()/1e3);else if(nt.timestamp===void 0&&it)throw new Error("Need timestamp for proper payment request reconstruction");if(nt.tags===void 0)throw new Error("Payment Requests need tags array");if(!tagsContainItem(nt.tags,TAGNAMES[1]))throw new Error("Lightning Payment Request needs a payment hash");if(tagsContainItem(nt.tags,TAGNAMES[16]))if(tagsContainItem(nt.tags,TAGNAMES[5])){const vt=tagsItems(nt.tags,TAGNAMES[5]);if(!vt.payment_secret||!vt.payment_secret.supported&&!vt.payment_secret.required)throw new Error("Payment request requires feature bits with at least payment secret support flagged if payment secret is included")}else if(et)nt.tags.push({tagName:TAGNAMES[5],data:DEFAULTFEATUREBITS});else throw new Error("Payment request requires feature bits with at least payment secret support flagged if payment secret is included");if(!tagsContainItem(nt.tags,TAGNAMES[13])&&!tagsContainItem(nt.tags,TAGNAMES[23]))if(et)nt.tags.push({tagName:TAGNAMES[13],data:DEFAULTDESCRIPTION});else throw new Error("Payment request requires description or purpose commit hash");if(tagsContainItem(nt.tags,TAGNAMES[13])&&Buffer$1.from(tagsItems(nt.tags,TAGNAMES[13]),"utf8").length>639)throw new Error("Description is too long: Max length 639 bytes");!tagsContainItem(nt.tags,TAGNAMES[6])&&!it&&et&&nt.tags.push({tagName:TAGNAMES[6],data:DEFAULTEXPIRETIME}),!tagsContainItem(nt.tags,TAGNAMES[24])&&!it&&et&&nt.tags.push({tagName:TAGNAMES[24],data:DEFAULTCLTVEXPIRY});let ot,at;if(tagsContainItem(nt.tags,TAGNAMES[19])&&(at=hexToBuffer(tagsItems(nt.tags,TAGNAMES[19]))),nt.payeeNodeKey&&(ot=hexToBuffer(nt.payeeNodeKey)),ot&&at&&!at.equals(ot))throw new Error("payeeNodeKey and tag payee node key do not match");ot=ot||at,ot&&(nt.payeeNodeKey=ot.toString("hex"));let st,lt,ct;if(tagsContainItem(nt.tags,TAGNAMES[9])){const vt=tagsItems(nt.tags,TAGNAMES[9]);if(ct=vt.address,lt=vt.addressHash,st=vt.code,lt===void 0||st===void 0){let xt,St;try{xt=bitcoinjsAddress.fromBech32(ct),lt=xt.data,st=xt.version}catch{try{St=bitcoinjsAddress.fromBase58Check(ct),St.version===rt.pubKeyHash?st=17:St.version===rt.scriptHash&&(st=18),lt=St.hash}catch{throw new Error("Fallback address type is unknown")}}if(xt&&!(xt.version in rt.validWitnessVersions))throw new Error("Fallback address witness version is unknown");if(xt&&xt.prefix!==rt.bech32)throw new Error("Fallback address network type does not match payment request network type");if(St&&St.version!==rt.pubKeyHash&&St.version!==rt.scriptHash)throw new Error("Fallback address version (base58) is unknown or the network type is incorrect");vt.addressHash=lt.toString("hex"),vt.code=st}}tagsContainItem(nt.tags,TAGNAMES[3])&&tagsItems(nt.tags,TAGNAMES[3]).forEach(xt=>{if(xt.pubkey===void 0||xt.short_channel_id===void 0||xt.fee_base_msat===void 0||xt.fee_proportional_millionths===void 0||xt.cltv_expiry_delta===void 0)throw new Error("Routing info is incomplete");if(!secp256k1.publicKeyVerify(hexToBuffer(xt.pubkey)))throw new Error("Routing info pubkey is not a valid pubkey");const St=hexToBuffer(xt.short_channel_id);if(!(St instanceof Buffer$1)||St.length!==8)throw new Error("Routing info short channel id must be 8 bytes");if(typeof xt.fee_base_msat!="number"||Math.floor(xt.fee_base_msat)!==xt.fee_base_msat)throw new Error("Routing info fee base msat is not an integer");if(typeof xt.fee_proportional_millionths!="number"||Math.floor(xt.fee_proportional_millionths)!==xt.fee_proportional_millionths)throw new Error("Routing info fee proportional millionths is not an integer");if(typeof xt.cltv_expiry_delta!="number"||Math.floor(xt.cltv_expiry_delta)!==xt.cltv_expiry_delta)throw new Error("Routing info cltv expiry delta is not an integer")});let ut="ln";ut+=rt.bech32;let ht;if(nt.millisatoshis&&nt.satoshis){if(ht=millisatToHrp(new BN(nt.millisatoshis,10)),satToHrp(new BN(nt.satoshis,10))!==ht)throw new Error("satoshis and millisatoshis do not match")}else nt.millisatoshis?ht=millisatToHrp(new BN(nt.millisatoshis,10)):nt.satoshis?ht=satToHrp(new BN(nt.satoshis,10)):ht="";ut+=ht;const dt=intBEToWords(nt.timestamp);for(;dt.length<7;)dt.unshift(0);const pt=nt.tags;let mt=[];pt.forEach(vt=>{const xt=Object.keys(TAGENCODERS);if(it&&xt.push(unknownTagName),xt.indexOf(vt.tagName)===-1)throw new Error("Unknown tag key: "+vt.tagName);let St;if(vt.tagName!==unknownTagName){mt.push(TAGCODES[vt.tagName]);const Et=TAGENCODERS[vt.tagName];St=Et(vt.data)}else{const Et=unknownEncoder(vt.data);mt.push(Et.tagCode),St=Et.words}mt=mt.concat([0].concat(intBEToWords(St.length)).slice(-2)),mt=mt.concat(St)});let gt=dt.concat(mt);const bt=Buffer$1.concat([Buffer$1.from(ut,"utf8"),Buffer$1.from(convert$1(gt,5,8))]),yt=sha256(bt);let wt;if(it)if(ot){const vt=Buffer$1.from(secp256k1.ecdsaRecover(Buffer$1.from(nt.signature,"hex"),nt.recoveryFlag,yt,!0));if(ot&&!ot.equals(vt))throw new Error("Signature, message, and recoveryID did not produce the same pubkey as payeeNodeKey");wt=hexToWord(nt.signature+"0"+nt.recoveryFlag)}else throw new Error("Reconstruction with signature and recoveryID requires payeeNodeKey to verify correctness of input data.");return wt&&(gt=gt.concat(wt)),tagsContainItem(nt.tags,TAGNAMES[6])&&(nt.timeExpireDate=nt.timestamp+tagsItems(nt.tags,TAGNAMES[6]),nt.timeExpireDateString=new Date(nt.timeExpireDate*1e3).toISOString()),nt.timestampString=new Date(nt.timestamp*1e3).toISOString(),nt.complete=!!wt,nt.paymentRequest=nt.complete?bech32.encode(ut,gt,Number.MAX_SAFE_INTEGER):"",nt.prefix=ut,nt.wordsTemp=bech32.encode("temp",gt,Number.MAX_SAFE_INTEGER),orderKeys(nt)}function decode$4(tt,et){if(typeof tt!="string")throw new Error("Lightning Payment Request must be string");if(tt.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const nt=bech32.decode(tt,Number.MAX_SAFE_INTEGER);tt=tt.toLowerCase();const it=nt.prefix;let rt=nt.words;const ot=rt.slice(-104),at=rt.slice(0,-104);rt=rt.slice(0,-104);let st=wordsToBuffer(ot,!0);const lt=st.slice(-1)[0];if(st=st.slice(0,-1),!(lt in[0,1,2,3])||st.length!==64)throw new Error("Signature is missing or incorrect");let ct=it.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(ct&&!ct[2]&&(ct=it.match(/^ln(\S+)$/)),!ct)throw new Error("Not a proper lightning payment request");const ut=ct[1];let ht;if(et){if(et.bech32===void 0||et.pubKeyHash===void 0||et.scriptHash===void 0||!Array.isArray(et.validWitnessVersions))throw new Error("Invalid network");ht=et}else switch(ut){case DEFAULTNETWORK.bech32:ht=DEFAULTNETWORK;break;case TESTNETWORK.bech32:ht=TESTNETWORK;break;case REGTESTNETWORK.bech32:ht=REGTESTNETWORK;break;case SIMNETWORK.bech32:ht=SIMNETWORK;break}if(!ht||ht.bech32!==ut)throw new Error("Unknown coin bech32 prefix");const dt=ct[2];let pt,mt,gt;if(dt){const Pt=ct[3];try{pt=parseInt(hrpToSat(dt+Pt,!0))}catch{pt=null,gt=!0}mt=hrpToMillisat(dt+Pt,!0)}else pt=null,mt=null;const bt=wordsToIntBE(rt.slice(0,7)),yt=new Date(bt*1e3).toISOString();rt=rt.slice(7);const wt=[];let vt,xt,St,Et;for(;rt.length>0;){const Pt=rt[0].toString();vt=TAGNAMES[Pt]||unknownTagName,xt=TAGPARSERS[Pt]||getUnknownParser(Pt),rt=rt.slice(1),St=wordsToIntBE(rt.slice(0,2)),rt=rt.slice(2),Et=rt.slice(0,St),rt=rt.slice(St),wt.push({tagName:vt,data:xt(Et,ht)})}let It,Tt;tagsContainItem(wt,TAGNAMES[6])&&(It=bt+tagsItems(wt,TAGNAMES[6]),Tt=new Date(It*1e3).toISOString());const $t=Buffer$1.concat([Buffer$1.from(it,"utf8"),Buffer$1.from(convert$1(at,5,8))]),Ut=sha256($t),Lt=Buffer$1.from(secp256k1.ecdsaRecover(st,lt,Ut,!0));if(tagsContainItem(wt,TAGNAMES[19])&&tagsItems(wt,TAGNAMES[19])!==Lt.toString("hex"))throw new Error("Lightning Payment Request signature pubkey does not match payee pubkey");let Bt={paymentRequest:tt,complete:!0,prefix:it,wordsTemp:bech32.encode("temp",at.concat(ot),Number.MAX_SAFE_INTEGER),network:ht,satoshis:pt,millisatoshis:mt,timestamp:bt,timestampString:yt,payeeNodeKey:Lt.toString("hex"),signature:st.toString("hex"),recoveryFlag:lt,tags:wt};return gt&&delete Bt.satoshis,It&&(Bt=Object.assign(Bt,{timeExpireDate:It,timeExpireDateString:Tt})),orderKeys(Bt,!0)}function getTagsObject(tt){const et={};return tt.forEach(nt=>{nt.tagName===unknownTagName?(et.unknownTags||(et.unknownTags=[]),et.unknownTags.push(nt.data)):et[nt.tagName]=nt.data}),et}var payreq={encode:encode$3,decode:decode$4,sign:sign$1,satToHrp,millisatToHrp,hrpToSat,hrpToMillisat};(function(tt){var et=commonjsGlobal&&commonjsGlobal.__importDefault||function(ut){return ut&&ut.__esModule?ut:{default:ut}};Object.defineProperty(tt,"__esModule",{value:!0}),tt.getIdFromRequest=tt.decode=tt.isHex=tt.stringToBytes=tt.isValue=tt.utf8Encoder=void 0;const nt=et(payreq),it=et(assert_1);let rt;typeof window<"u"&&window&&window.TextEncoder?rt=window.TextEncoder:rt=util.TextEncoder,tt.utf8Encoder=new rt;const ot=ut=>ut!=null;tt.isValue=ot;const at=ut=>(0,tt.isValue)(ut)?tt.utf8Encoder.encode(ut):ut;tt.stringToBytes=at;function st(ut){return Buffer.from(ut,"hex").toString("hex")===ut}tt.isHex=st;function lt(ut){let ht;return ut.indexOf("lnsb")===0&&(ht={bech32:"sb"}),nt.default.decode(ut,ht)}tt.decode=lt;function ct(ut){const dt=lt(ut).tags.find(mt=>mt.tagName==="payment_hash");(0,it.default)(dt&&dt.data,"Could not find payment hash on invoice request");const pt=dt==null?void 0:dt.data.toString();if(!pt||!pt.length)throw new Error("Could not get payment hash from payment request");return pt}tt.getIdFromRequest=ct})(helpers);var hasRequiredLsat;function requireLsat(){if(hasRequiredLsat)return lsat$1;hasRequiredLsat=1;var tt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(dt,pt,mt,gt){gt===void 0&&(gt=mt);var bt=Object.getOwnPropertyDescriptor(pt,mt);(!bt||("get"in bt?!pt.__esModule:bt.writable||bt.configurable))&&(bt={enumerable:!0,get:function(){return pt[mt]}}),Object.defineProperty(dt,gt,bt)}:function(dt,pt,mt,gt){gt===void 0&&(gt=mt),dt[gt]=pt[mt]}),et=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(dt,pt){Object.defineProperty(dt,"default",{enumerable:!0,value:pt})}:function(dt,pt){dt.default=pt}),nt=commonjsGlobal&&commonjsGlobal.__importStar||function(dt){if(dt&&dt.__esModule)return dt;var pt={};if(dt!=null)for(var mt in dt)mt!=="default"&&Object.prototype.hasOwnProperty.call(dt,mt)&&tt(pt,dt,mt);return et(pt,dt),pt},it=commonjsGlobal&&commonjsGlobal.__importDefault||function(dt){return dt&&dt.__esModule?dt:{default:dt}};Object.defineProperty(lsat$1,"__esModule",{value:!0}),lsat$1.Lsat=lsat$1.parseChallengePart=void 0;const rt=assert_1,ot=bufio,at=it(requireCryptoBrowserify()),st=nt(macaroon$1),lt=requireDist(),ct=helpers;function ut(dt){let pt;const mt=dt.indexOf("=");rt(mt>-1,'Incorrectly encoded challenge. Missing "=" separator.');const gt=dt.length-1-mt;return pt=dt.slice(-gt),rt(pt.length,"Incorrectly encoded macaroon challenge"),rt(pt[0]==='"'&&pt[pt.length-1]==='"',"Incorectly encoded challenge, challenges must be enclosed in double quotes."),pt=pt.slice(1,pt.length-1),pt}lsat$1.parseChallengePart=ut;class ht extends ot.Struct{constructor(pt){super(pt),this.id="",this.validUntil=0,this.invoice="",this.baseMacaroon="",this.paymentHash=Buffer.alloc(32).toString("hex"),this.timeCreated=Date.now(),this.paymentPreimage=null,this.amountPaid=0,this.routingFeePaid=0,this.invoiceAmount=0,pt&&this.fromOptions(pt)}fromOptions(pt){rt(typeof pt.baseMacaroon=="string","Require serialized macaroon"),this.baseMacaroon=pt.baseMacaroon,rt(typeof pt.id=="string","Require string id"),this.id=pt.id,rt(typeof pt.paymentHash=="string","Require paymentHash"),this.paymentHash=pt.paymentHash;const mt=this.getExpirationFromMacaroon(pt.baseMacaroon);return mt&&(this.validUntil=mt),pt.invoice&&this.addInvoice(pt.invoice),pt.timeCreated&&(this.timeCreated=pt.timeCreated),pt.paymentPreimage&&(this.paymentPreimage=pt.paymentPreimage),pt.amountPaid&&(this.amountPaid=pt.amountPaid),pt.routingFeePaid&&(this.routingFeePaid=pt.routingFeePaid),this}isExpired(){return this.validUntil===0?!1:this.validUntilwt.tagName==="payment_hash");rt(bt,"Could not find payment hash on invoice request");const yt=bt==null?void 0:bt.data;rt(yt===this.paymentHash,"paymentHash from invoice did not match LSAT"),this.invoiceAmount=gt||0,this.invoice=pt}catch(mt){throw new Error(`Problem adding invoice data to LSAT: ${mt.message}`)}}static fromMacaroon(pt,mt){rt(typeof pt=="string","Requires a raw macaroon string for macaroon to generate LSAT");let gt,bt;try{bt=(0,lt.decodeIdentifierFromMacaroon)(pt),gt=lt.Identifier.fromString(bt)}catch(vt){throw new Error(`Unexpected encoding for macaroon identifier: ${vt.message}`)}const yt={id:bt,baseMacaroon:pt,paymentHash:gt.paymentHash.toString("hex")},wt=new this(yt);return mt&&wt.addInvoice(mt),wt}static fromToken(pt,mt){rt(pt.includes(this.type),"Token must include LSAT prefix"),pt=pt.slice(this.type.length).trim();const[gt,bt]=pt.split(":"),yt=ht.fromMacaroon(gt,mt);return bt&&yt.setPreimage(bt),yt}static fromChallenge(pt){const mt="macaroon=",gt="invoice=";let bt;bt=pt.split(","),bt.length<2&&(bt=pt.split(" ")),rt(bt.length>=2,"Expected at least two challenges in the LSAT: invoice and macaroon");let yt="",wt="";for(const St of bt){if(!yt.length&&St.indexOf(mt)>-1)try{yt=ut(St)}catch(Et){throw new Error(`Problem parsing macaroon challenge: ${Et.message}`)}if(!wt.length&&St.indexOf(gt)>-1)try{wt=ut(St)}catch(Et){throw new Error(`Problem parsing macaroon challenge: ${Et.message}`)}if(wt.length&&yt.length)break}rt(wt.length&&yt.length,"Expected WWW-Authenticate challenge with macaroon and invoice data");const vt=(0,ct.getIdFromRequest)(wt),xt=(0,lt.decodeIdentifierFromMacaroon)(yt);return new this({id:xt,baseMacaroon:yt,paymentHash:vt,invoice:wt})}static fromHeader(pt){const mt=pt.slice(this.type.length).trim();return rt(pt.length!==mt.length,'header missing token type prefix "LSAT"'),ht.fromChallenge(mt)}}return lsat$1.Lsat=ht,ht.type="LSAT",lsat$1}var types$1={},lsat={};Object.defineProperty(lsat,"__esModule",{value:!0});var satisfier={};Object.defineProperty(satisfier,"__esModule",{value:!0});(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(it,rt,ot,at){at===void 0&&(at=ot);var st=Object.getOwnPropertyDescriptor(rt,ot);(!st||("get"in st?!rt.__esModule:st.writable||st.configurable))&&(st={enumerable:!0,get:function(){return rt[ot]}}),Object.defineProperty(it,at,st)}:function(it,rt,ot,at){at===void 0&&(at=ot),it[at]=rt[ot]}),nt=commonjsGlobal&&commonjsGlobal.__exportStar||function(it,rt){for(var ot in it)ot!=="default"&&!Object.prototype.hasOwnProperty.call(rt,ot)&&et(rt,it,ot)};Object.defineProperty(tt,"__esModule",{value:!0}),nt(lsat,tt),nt(satisfier,tt)})(types$1);var satisfiers={},hasRequiredSatisfiers;function requireSatisfiers(){if(hasRequiredSatisfiers)return satisfiers;hasRequiredSatisfiers=1,Object.defineProperty(satisfiers,"__esModule",{value:!0}),satisfiers.createCapabilitiesSatisfier=satisfiers.createServicesSatisfier=satisfiers.expirationSatisfier=void 0;const tt=requireDist();satisfiers.expirationSatisfier={condition:"expiration",satisfyPrevious:(it,rt)=>it.condition!=="expiration"||rt.condition!=="expiration"?!1:!(it.value!(it.condition!=="expiration"||it.value{if(typeof it!="string")throw new tt.InvalidServicesError;return{condition:tt.SERVICES_CAVEAT_CONDITION,satisfyPrevious:(rt,ot)=>{const at=(0,tt.decodeServicesCaveat)(rt.value.toString()),st=(0,tt.decodeServicesCaveat)(ot.value.toString());if(!Array.isArray(at)||!Array.isArray(st))throw new tt.InvalidServicesError;let lt=new Map;lt=at.reduce((ct,ut)=>ct.set(ut.name,ut.tier),lt);for(const ct of st)if(!lt.has(ct.name)||lt.get(ct.name)>ct.tier)return!1;return!0},satisfyFinal:rt=>{const ot=(0,tt.decodeServicesCaveat)(rt.value.toString());if(!Array.isArray(ot))throw new tt.InvalidServicesError;for(const at of ot)if(at.name===it)return!0;return!1}}};satisfiers.createServicesSatisfier=et;const nt=(it,rt)=>{if(typeof rt!="string")throw new tt.InvalidCapabilitiesError;if(typeof it!="string")throw new tt.InvalidCapabilitiesError;return{condition:it+tt.SERVICE_CAPABILITIES_SUFFIX,satisfyPrevious:(ot,at)=>{const st=(0,tt.decodeCapabilitiesValue)(ot.value.toString()),lt=(0,tt.decodeCapabilitiesValue)(at.value.toString());if(!Array.isArray(st)||!Array.isArray(lt))throw new tt.InvalidServicesError;let ct=new Set;ct=st.reduce((ut,ht)=>ut.add(ht),ct);for(const ut of lt)if(!ct.has(ut))return!1;return!0},satisfyFinal:ot=>{const at=(0,tt.decodeCapabilitiesValue)(ot.value.toString());if(!Array.isArray(at))throw new tt.InvalidServicesError;for(const st of at)if(st===rt)return!0;return!1}}};return satisfiers.createCapabilitiesSatisfier=nt,satisfiers}var macaroon={},base64={},__extends$1=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,nt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(it,rt){it.__proto__=rt}||function(it,rt){for(var ot in rt)rt.hasOwnProperty(ot)&&(it[ot]=rt[ot])},tt(et,nt)};return function(et,nt){tt(et,nt);function it(){this.constructor=et}et.prototype=nt===null?Object.create(nt):(it.prototype=nt.prototype,new it)}}();Object.defineProperty(base64,"__esModule",{value:!0});var INVALID_BYTE=256,Coder=function(){function tt(et){et===void 0&&(et="="),this._paddingCharacter=et}return tt.prototype.encodedLength=function(et){return this._paddingCharacter?(et+2)/3*4|0:(et*8+5)/6|0},tt.prototype.encode=function(et){for(var nt="",it=0;it>>3*6&63),nt+=this._encodeByte(rt>>>2*6&63),nt+=this._encodeByte(rt>>>1*6&63),nt+=this._encodeByte(rt>>>0*6&63)}var ot=et.length-it;if(ot>0){var rt=et[it]<<16|(ot===2?et[it+1]<<8:0);nt+=this._encodeByte(rt>>>3*6&63),nt+=this._encodeByte(rt>>>2*6&63),ot===2?nt+=this._encodeByte(rt>>>1*6&63):nt+=this._paddingCharacter||"",nt+=this._paddingCharacter||""}return nt},tt.prototype.maxDecodedLength=function(et){return this._paddingCharacter?et/4*3|0:(et*6+7)/8|0},tt.prototype.decodedLength=function(et){return this.maxDecodedLength(et.length-this._getPaddingLength(et))},tt.prototype.decode=function(et){if(et.length===0)return new Uint8Array(0);for(var nt=this._getPaddingLength(et),it=et.length-nt,rt=new Uint8Array(this.maxDecodedLength(it)),ot=0,at=0,st=0,lt=0,ct=0,ut=0,ht=0;at>>4,rt[ot++]=ct<<4|ut>>>2,rt[ot++]=ut<<6|ht,st|=lt&INVALID_BYTE,st|=ct&INVALID_BYTE,st|=ut&INVALID_BYTE,st|=ht&INVALID_BYTE;if(at>>4,st|=lt&INVALID_BYTE,st|=ct&INVALID_BYTE),at>>2,st|=ut&INVALID_BYTE),at>>8&0-65-26+97,nt+=51-et>>>8&26-97-52+48,nt+=61-et>>>8&52-48-62+43,nt+=62-et>>>8&62-43-63+47,String.fromCharCode(nt)},tt.prototype._decodeChar=function(et){var nt=INVALID_BYTE;return nt+=(42-et&et-44)>>>8&-INVALID_BYTE+et-43+62,nt+=(46-et&et-48)>>>8&-INVALID_BYTE+et-47+63,nt+=(47-et&et-58)>>>8&-INVALID_BYTE+et-48+52,nt+=(64-et&et-91)>>>8&-INVALID_BYTE+et-65+0,nt+=(96-et&et-123)>>>8&-INVALID_BYTE+et-97+26,nt},tt.prototype._getPaddingLength=function(et){var nt=0;if(this._paddingCharacter){for(var it=et.length-1;it>=0&&et[it]===this._paddingCharacter;it--)nt++;if(et.length<4||nt>2)throw new Error("Base64Coder: incorrect padding")}return nt},tt}();base64.Coder=Coder;var stdCoder=new Coder;function encode$2(tt){return stdCoder.encode(tt)}base64.encode=encode$2;function decode$3(tt){return stdCoder.decode(tt)}base64.decode=decode$3;var URLSafeCoder=function(tt){__extends$1(et,tt);function et(){return tt!==null&&tt.apply(this,arguments)||this}return et.prototype._encodeByte=function(nt){var it=nt;return it+=65,it+=25-nt>>>8&0-65-26+97,it+=51-nt>>>8&26-97-52+48,it+=61-nt>>>8&52-48-62+45,it+=62-nt>>>8&62-45-63+95,String.fromCharCode(it)},et.prototype._decodeChar=function(nt){var it=INVALID_BYTE;return it+=(44-nt&nt-46)>>>8&-INVALID_BYTE+nt-45+62,it+=(94-nt&nt-96)>>>8&-INVALID_BYTE+nt-95+63,it+=(47-nt&nt-58)>>>8&-INVALID_BYTE+nt-48+52,it+=(64-nt&nt-91)>>>8&-INVALID_BYTE+nt-65+0,it+=(96-nt&nt-123)>>>8&-INVALID_BYTE+nt-97+26,it},et}(Coder);base64.URLSafeCoder=URLSafeCoder;var urlSafeCoder=new URLSafeCoder;function encodeURLSafe(tt){return urlSafeCoder.encode(tt)}base64.encodeURLSafe=encodeURLSafe;function decodeURLSafe(tt){return urlSafeCoder.decode(tt)}base64.decodeURLSafe=decodeURLSafe;base64.encodedLength=function(tt){return stdCoder.encodedLength(tt)};base64.maxDecodedLength=function(tt){return stdCoder.maxDecodedLength(tt)};base64.decodedLength=function(tt){return stdCoder.decodedLength(tt)};var __createBinding$1=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(tt,et,nt,it){it===void 0&&(it=nt);var rt=Object.getOwnPropertyDescriptor(et,nt);(!rt||("get"in rt?!et.__esModule:rt.writable||rt.configurable))&&(rt={enumerable:!0,get:function(){return et[nt]}}),Object.defineProperty(tt,it,rt)}:function(tt,et,nt,it){it===void 0&&(it=nt),tt[it]=et[nt]}),__setModuleDefault$1=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(tt,et){Object.defineProperty(tt,"default",{enumerable:!0,value:et})}:function(tt,et){tt.default=et}),__importStar$1=commonjsGlobal&&commonjsGlobal.__importStar||function(tt){if(tt&&tt.__esModule)return tt;var et={};if(tt!=null)for(var nt in tt)nt!=="default"&&Object.prototype.hasOwnProperty.call(tt,nt)&&__createBinding$1(et,tt,nt);return __setModuleDefault$1(et,tt),et};Object.defineProperty(macaroon,"__esModule",{value:!0});macaroon.getRawMacaroon=macaroon.verifyMacaroonCaveats=macaroon.getCaveatsFromMacaroon=void 0;const caveat_1=caveat,helpers_1=helpers,Macaroon=__importStar$1(macaroon$1),base64_1=base64;function getCaveatsFromMacaroon(tt){var et;const nt=Macaroon.importMacaroon(tt),it=[],rt=(et=nt._exportAsJSONObjectV2())===null||et===void 0?void 0:et.c;if(rt)for(const ot of rt){if(!ot.i)continue;const at=caveat_1.Caveat.decode(ot.i);it.push(at)}return it}macaroon.getCaveatsFromMacaroon=getCaveatsFromMacaroon;function verifyMacaroonCaveats(tt,et,nt,it={}){try{const rt=Macaroon.importMacaroon(tt),ot=(0,helpers_1.stringToBytes)(et);rt.verify(ot,()=>null);const at=getCaveatsFromMacaroon(tt);return nt&&!Array.isArray(nt)&&(nt=[nt]),!at.length&&(!nt||!nt.length)?!0:(0,caveat_1.verifyCaveats)(at,nt,it)}catch{return!1}}macaroon.verifyMacaroonCaveats=verifyMacaroonCaveats;function getRawMacaroon(tt,et=!1){const nt=tt._exportBinaryV2();return et?(0,base64_1.encodeURLSafe)(nt):(0,base64_1.encode)(nt)}macaroon.getRawMacaroon=getRawMacaroon;var service={};(function(tt){var et=commonjsGlobal&&commonjsGlobal.__importDefault||function(dt){return dt&&dt.__esModule?dt:{default:dt}};Object.defineProperty(tt,"__esModule",{value:!0}),tt.decodeCapabilitiesValue=tt.createNewCapabilitiesCaveat=tt.SERVICE_CAPABILITIES_SUFFIX=tt.encodeServicesCaveatValue=tt.decodeServicesCaveat=tt.SERVICES_CAVEAT_CONDITION=tt.Service=tt.InvalidCapabilitiesError=tt.InvalidServicesError=tt.NoServicesError=void 0;const nt=et(bufio),it=caveat;class rt extends Error{constructor(...pt){super(...pt),this.name="NoServicesError",this.message="no services found",Error.captureStackTrace&&Error.captureStackTrace(this,rt)}}tt.NoServicesError=rt;class ot extends Error{constructor(pt){super(pt),this.name="InvalidServicesError",pt||(this.message='service must be of the form "name:tier"'),Error.captureStackTrace&&Error.captureStackTrace(this,ot)}}tt.InvalidServicesError=ot;class at extends Error{constructor(pt){super(pt),this.name="InvalidCapabilitiesError",pt||(this.message="capabilities must be a string or array of strings"),Error.captureStackTrace&&Error.captureStackTrace(this,ot)}}tt.InvalidCapabilitiesError=at;class st extends nt.default.Struct{constructor(pt){super(pt),this.name=pt.name,this.tier=pt.tier}}tt.Service=st,tt.SERVICES_CAVEAT_CONDITION="services";const lt=dt=>{if(!dt.length)throw new rt;const pt=[],mt=dt.split(",");for(const gt of mt){const[bt,yt]=gt.split(":");if(!bt||!yt)throw new ot;if(isNaN(+yt))throw new ot("tier must be a number");if(!isNaN(+bt))throw new ot("service name must be a string");pt.push(new st({name:bt,tier:+yt}))}return pt};tt.decodeServicesCaveat=lt;const ct=dt=>{if(!dt.length)throw new rt;let pt="";for(let mt=0;mt{let mt;if(!pt)mt="";else if(Array.isArray(pt))mt=pt.join(",");else{if(typeof pt!="string")throw new at;mt=pt}return new it.Caveat({condition:dt+tt.SERVICE_CAPABILITIES_SUFFIX,value:mt,comp:"="})};tt.createNewCapabilitiesCaveat=ut;const ht=dt=>{if(typeof dt!="string")throw new at;return dt.toString().split(",").map(pt=>pt.trim())};tt.decodeCapabilitiesValue=ht})(service);var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(it,rt,ot,at){at===void 0&&(at=ot);var st=Object.getOwnPropertyDescriptor(rt,ot);(!st||("get"in st?!rt.__esModule:st.writable||st.configurable))&&(st={enumerable:!0,get:function(){return rt[ot]}}),Object.defineProperty(it,at,st)}:function(it,rt,ot,at){at===void 0&&(at=ot),it[at]=rt[ot]}),nt=commonjsGlobal&&commonjsGlobal.__exportStar||function(it,rt){for(var ot in it)ot!=="default"&&!Object.prototype.hasOwnProperty.call(rt,ot)&&et(rt,it,ot)};Object.defineProperty(tt,"__esModule",{value:!0}),nt(identifier$1,tt),nt(caveat,tt),nt(requireLsat(),tt),nt(types$1,tt),nt(requireSatisfiers(),tt),nt(macaroon,tt),nt(service,tt)}(dist$2)),dist$2}var distExports=requireDist(),lib$1={},client={},errors={},__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,nt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(it,rt){it.__proto__=rt}||function(it,rt){for(var ot in rt)Object.prototype.hasOwnProperty.call(rt,ot)&&(it[ot]=rt[ot])},tt(et,nt)};return function(et,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Class extends value "+String(nt)+" is not a constructor or null");tt(et,nt);function it(){this.constructor=et}et.prototype=nt===null?Object.create(nt):(it.prototype=nt.prototype,new it)}}();Object.defineProperty(errors,"__esModule",{value:!0});errors.InternalError=errors.InvalidDataError=errors.RoutingError=errors.UnsupportedMethodError=errors.ConnectionError=errors.RejectionError=errors.MissingProviderError=void 0;function fixError(tt,et,nt){if(Object.setPrototypeOf(tt,nt.prototype),et===nt)if(tt.name=et.name,Error.captureStackTrace)Error.captureStackTrace(tt,nt);else{var it=new Error(tt.message).stack;it&&(tt.stack=fixStack(it,"new ".concat(et.name)))}}function fixStack(tt,et){if(!tt||!et)return tt;var nt=new RegExp("\\s+at\\s".concat(et,"\\s")),it=tt.split(` +*********************`),st=ot.hashForSignature(tt,ct,at)}return{script:ct,sighashType:at,hash:st}}function getAllTaprootHashesForSig(tt,et,nt,it){const rt=[];if(et.tapInternalKey){const at=getPrevoutTaprootKey(tt,et,it);at&&rt.push(at)}if(et.tapScriptSig){const at=et.tapScriptSig.map(st=>st.pubkey);rt.push(...at)}return rt.map(at=>getTaprootHashesForSig(tt,et,nt,at,it)).flat()}function getPrevoutTaprootKey(tt,et,nt){const{script:it}=getScriptAndAmountFromUtxo(tt,et,nt);return(0,psbtutils_1.isP2TR)(it)?it.subarray(2,34):null}function trimTaprootSig(tt){return tt.length===64?tt:tt.subarray(0,64)}function getTaprootHashesForSig(tt,et,nt,it,rt,ot,at){const st=rt.__TX,lt=et.sighashType||transaction_1.Transaction.SIGHASH_DEFAULT;checkSighashTypeAllowed(lt,at);const ct=nt.map((mt,gt)=>getScriptAndAmountFromUtxo(gt,mt,rt)),ut=ct.map(mt=>mt.script),ht=ct.map(mt=>mt.value),dt=[];if(et.tapInternalKey&&!ot){const mt=getPrevoutTaprootKey(tt,et,rt)||Buffer.from([]);if((0,bip371_1.toXOnly)(it).equals(mt)){const gt=st.hashForWitnessV1(tt,ut,ht,lt);dt.push({pubkey:it,hash:gt})}}const pt=(et.tapLeafScript||[]).filter(mt=>(0,psbtutils_1.pubkeyInScript)(it,mt.script)).map(mt=>{const gt=(0,bip341_1.tapleafHash)({output:mt.script,version:mt.leafVersion});return Object.assign({hash:gt},mt)}).filter(mt=>!ot||ot.equals(mt.hash)).map(mt=>{const gt=st.hashForWitnessV1(tt,ut,ht,transaction_1.Transaction.SIGHASH_DEFAULT,mt.hash);return{pubkey:it,hash:gt,leafHash:mt.hash}});return dt.concat(pt)}function checkSighashTypeAllowed(tt,et){if(et&&et.indexOf(tt)<0){const nt=sighashTypeToString(tt);throw new Error(`Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ${nt}`)}}function getPayment(tt,et,nt){let it;switch(et){case"multisig":const rt=getSortedSigs(tt,nt);it=payments.p2ms({output:tt,signatures:rt});break;case"pubkey":it=payments.p2pk({output:tt,signature:nt[0].signature});break;case"pubkeyhash":it=payments.p2pkh({output:tt,pubkey:nt[0].pubkey,signature:nt[0].signature});break;case"witnesspubkeyhash":it=payments.p2wpkh({output:tt,pubkey:nt[0].pubkey,signature:nt[0].signature});break}return it}function getScriptFromInput(tt,et,nt){const it=nt.__TX,rt={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(rt.isP2SH=!!et.redeemScript,rt.isP2WSH=!!et.witnessScript,et.witnessScript)rt.script=et.witnessScript;else if(et.redeemScript)rt.script=et.redeemScript;else if(et.nonWitnessUtxo){const ot=nonWitnessUtxoTxFromCache(nt,et,tt),at=it.ins[tt].index;rt.script=ot.outs[at].script}else et.witnessUtxo&&(rt.script=et.witnessUtxo.script);return(et.witnessScript||(0,psbtutils_1.isP2WPKH)(rt.script))&&(rt.isSegwit=!0),rt}function getSignersFromHD(tt,et,nt){const it=(0,utils_1.checkForInput)(et,tt);if(!it.bip32Derivation||it.bip32Derivation.length===0)throw new Error("Need bip32Derivation to sign with HD");const rt=it.bip32Derivation.map(at=>{if(at.masterFingerprint.equals(nt.fingerprint))return at}).filter(at=>!!at);if(rt.length===0)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return rt.map(at=>{const st=nt.derivePath(at.path);if(!at.pubkey.equals(st.publicKey))throw new Error("pubkey did not match bip32Derivation");return st})}function getSortedSigs(tt,et){return payments.p2ms({output:tt}).pubkeys.map(it=>(et.filter(rt=>rt.pubkey.equals(it))[0]||{}).signature).filter(it=>!!it)}function scriptWitnessToWitnessStack(tt){let et=0;function nt(at){return et+=at,tt.slice(et-at,et)}function it(){const at=varuint.decode(tt,et);return et+=varuint.decode.bytes,at}function rt(){return nt(it())}function ot(){const at=it(),st=[];for(let lt=0;lt{if(it&<.finalScriptSig&&(et.ins[ct].script=lt.finalScriptSig),it&<.finalScriptWitness&&(et.ins[ct].witness=scriptWitnessToWitnessStack(lt.finalScriptWitness)),lt.witnessUtxo)rt+=lt.witnessUtxo.value;else if(lt.nonWitnessUtxo){const ut=nonWitnessUtxoTxFromCache(nt,lt,ct),ht=et.ins[ct].index,dt=ut.outs[ht];rt+=dt.value}});const ot=et.outs.reduce((lt,ct)=>lt+ct.value,0),at=rt-ot;if(at<0)throw new Error("Outputs are spending more than Inputs");const st=et.virtualSize();nt.__FEE=at,nt.__EXTRACTED_TX=et,nt.__FEE_RATE=Math.floor(at/st)}function nonWitnessUtxoTxFromCache(tt,et,nt){const it=tt.__NON_WITNESS_UTXO_TX_CACHE;return it[nt]||addNonWitnessTxCache(tt,et,nt),it[nt]}function getScriptFromUtxo(tt,et,nt){const{script:it}=getScriptAndAmountFromUtxo(tt,et,nt);return it}function getScriptAndAmountFromUtxo(tt,et,nt){if(et.witnessUtxo!==void 0)return{script:et.witnessUtxo.script,value:et.witnessUtxo.value};if(et.nonWitnessUtxo!==void 0){const rt=nonWitnessUtxoTxFromCache(nt,et,tt).outs[nt.__TX.ins[tt].index];return{script:rt.script,value:rt.value}}else throw new Error("Can't find pubkey in input without Utxo data")}function pubkeyInInput(tt,et,nt,it){const rt=getScriptFromUtxo(nt,et,it),{meaningfulScript:ot}=getMeaningfulScript(rt,nt,"input",et.redeemScript,et.witnessScript);return(0,psbtutils_1.pubkeyInScript)(tt,ot)}function pubkeyInOutput(tt,et,nt,it){const rt=it.__TX.outs[nt].script,{meaningfulScript:ot}=getMeaningfulScript(rt,nt,"output",et.redeemScript,et.witnessScript);return(0,psbtutils_1.pubkeyInScript)(tt,ot)}function redeemFromFinalScriptSig(tt){if(!tt)return;const et=bscript.decompile(tt);if(!et)return;const nt=et[et.length-1];if(!(!Buffer.isBuffer(nt)||isPubkeyLike(nt)||isSigLike(nt)||!bscript.decompile(nt)))return nt}function redeemFromFinalWitnessScript(tt){if(!tt)return;const et=scriptWitnessToWitnessStack(tt),nt=et[et.length-1];if(!(isPubkeyLike(nt)||!bscript.decompile(nt)))return nt}function compressPubkey(tt){if(tt.length===65){const et=tt[64]&1,nt=tt.slice(0,33);return nt[0]=2|et,nt}return tt.slice()}function isPubkeyLike(tt){return tt.length===33&&bscript.isCanonicalPubKey(tt)}function isSigLike(tt){return bscript.isCanonicalScriptSignature(tt)}function getMeaningfulScript(tt,et,nt,it,rt){const ot=(0,psbtutils_1.isP2SHScript)(tt),at=ot&&it&&(0,psbtutils_1.isP2WSHScript)(it),st=(0,psbtutils_1.isP2WSHScript)(tt);if(ot&&it===void 0)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((st||at)&&rt===void 0)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let lt;return at?(lt=rt,checkRedeemScript(et,tt,it,nt),checkWitnessScript(et,it,rt,nt),checkInvalidP2WSH(lt)):st?(lt=rt,checkWitnessScript(et,tt,rt,nt),checkInvalidP2WSH(lt)):ot?(lt=it,checkRedeemScript(et,tt,it,nt)):lt=tt,{meaningfulScript:lt,type:at?"p2sh-p2wsh":ot?"p2sh":st?"p2wsh":"raw"}}function checkInvalidP2WSH(tt){if((0,psbtutils_1.isP2WPKH)(tt)||(0,psbtutils_1.isP2SHScript)(tt))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function classifyScript(tt){return(0,psbtutils_1.isP2WPKH)(tt)?"witnesspubkeyhash":(0,psbtutils_1.isP2PKH)(tt)?"pubkeyhash":(0,psbtutils_1.isP2MS)(tt)?"multisig":(0,psbtutils_1.isP2PK)(tt)?"pubkey":"nonstandard"}function range$5(tt){return[...Array(tt).keys()]}(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.initEccLib=tt.Transaction=tt.opcodes=tt.Psbt=tt.Block=tt.script=tt.payments=tt.networks=tt.crypto=tt.address=void 0;const et=address;tt.address=et;const nt=crypto$2;tt.crypto=nt;const it=networks$1;tt.networks=it;const rt=payments$3;tt.payments=rt;const ot=script;tt.script=ot;var at=block;Object.defineProperty(tt,"Block",{enumerable:!0,get:function(){return at.Block}});var st=psbt$1;Object.defineProperty(tt,"Psbt",{enumerable:!0,get:function(){return st.Psbt}});var lt=ops;Object.defineProperty(tt,"opcodes",{enumerable:!0,get:function(){return lt.OPS}});var ct=transaction;Object.defineProperty(tt,"Transaction",{enumerable:!0,get:function(){return ct.Transaction}});var ut=ecc_lib;Object.defineProperty(tt,"initEccLib",{enumerable:!0,get:function(){return ut.initEccLib}})})(src$1);function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$4(tt,et){return tt===et||tt!==tt&&et!==et}var eq_1=eq$4,eq$3=eq_1;function assocIndexOf$4(tt,et){for(var nt=tt.length;nt--;)if(eq$3(tt[nt][0],et))return nt;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice$1=arrayProto.splice;function listCacheDelete$1(tt){var et=this.__data__,nt=assocIndexOf$3(et,tt);if(nt<0)return!1;var it=et.length-1;return nt==it?et.pop():splice$1.call(et,nt,1),--this.size,!0}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(tt){var et=this.__data__,nt=assocIndexOf$2(et,tt);return nt<0?void 0:et[nt][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(tt){return assocIndexOf$1(this.__data__,tt)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(tt,et){var nt=this.__data__,it=assocIndexOf(nt,tt);return it<0?(++this.size,nt.push([tt,et])):nt[it][1]=et,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(tt){var et=-1,nt=tt==null?0:tt.length;for(this.clear();++et-1&&tt%1==0&&tt-1&&tt%1==0&&tt<=MAX_SAFE_INTEGER$1}var isLength_1=isLength$3,baseGetTag$6=_baseGetTag,isLength$2=isLength_1,isObjectLike$8=isObjectLike_1,argsTag$2="[object Arguments]",arrayTag$2="[object Array]",boolTag$4="[object Boolean]",dateTag$3="[object Date]",errorTag$2="[object Error]",funcTag$1="[object Function]",mapTag$5="[object Map]",numberTag$4="[object Number]",objectTag$4="[object Object]",regexpTag$3="[object RegExp]",setTag$5="[object Set]",stringTag$4="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$3="[object ArrayBuffer]",dataViewTag$4="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0;typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$2]=typedArrayTags[arrayBufferTag$3]=typedArrayTags[boolTag$4]=typedArrayTags[dataViewTag$4]=typedArrayTags[dateTag$3]=typedArrayTags[errorTag$2]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$5]=typedArrayTags[numberTag$4]=typedArrayTags[objectTag$4]=typedArrayTags[regexpTag$3]=typedArrayTags[setTag$5]=typedArrayTags[stringTag$4]=typedArrayTags[weakMapTag$2]=!1;function baseIsTypedArray$1(tt){return isObjectLike$8(tt)&&isLength$2(tt.length)&&!!typedArrayTags[baseGetTag$6(tt)]}var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$4(tt){return function(et){return tt(et)}}var _baseUnary=baseUnary$4,_nodeUtil={exports:{}};_nodeUtil.exports;(function(tt,et){var nt=_freeGlobal,it=et&&!et.nodeType&&et,rt=it&&!0&&tt&&!tt.nodeType&&tt,ot=rt&&rt.exports===it,at=ot&&nt.process,st=function(){try{var lt=rt&&rt.require&&rt.require("util").types;return lt||at&&at.binding&&at.binding("util")}catch{}}();tt.exports=st})(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports,baseIsTypedArray=_baseIsTypedArray,baseUnary$3=_baseUnary,nodeUtil$2=_nodeUtilExports,nodeIsTypedArray=nodeUtil$2&&nodeUtil$2.isTypedArray,isTypedArray$3=nodeIsTypedArray?baseUnary$3(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$3,baseTimes=_baseTimes,isArguments$2=isArguments_1,isArray$i=isArray_1,isBuffer$2=isBufferExports,isIndex$2=_isIndex,isTypedArray$2=isTypedArray_1,objectProto$8=Object.prototype,hasOwnProperty$9=objectProto$8.hasOwnProperty;function arrayLikeKeys$2(tt,et){var nt=isArray$i(tt),it=!nt&&isArguments$2(tt),rt=!nt&&!it&&isBuffer$2(tt),ot=!nt&&!it&&!rt&&isTypedArray$2(tt),at=nt||it||rt||ot,st=at?baseTimes(tt.length,String):[],lt=st.length;for(var ct in tt)(et||hasOwnProperty$9.call(tt,ct))&&!(at&&(ct=="length"||rt&&(ct=="offset"||ct=="parent")||ot&&(ct=="buffer"||ct=="byteLength"||ct=="byteOffset")||isIndex$2(ct,lt)))&&st.push(ct);return st}var _arrayLikeKeys=arrayLikeKeys$2,objectProto$7=Object.prototype;function isPrototype$3(tt){var et=tt&&tt.constructor,nt=typeof et=="function"&&et.prototype||objectProto$7;return tt===nt}var _isPrototype=isPrototype$3;function overArg$2(tt,et){return function(nt){return tt(et(nt))}}var _overArg=overArg$2,overArg$1=_overArg,nativeKeys$1=overArg$1(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype$2=_isPrototype,nativeKeys=_nativeKeys,objectProto$6=Object.prototype,hasOwnProperty$8=objectProto$6.hasOwnProperty;function baseKeys$1(tt){if(!isPrototype$2(tt))return nativeKeys(tt);var et=[];for(var nt in Object(tt))hasOwnProperty$8.call(tt,nt)&&nt!="constructor"&&et.push(nt);return et}var _baseKeys=baseKeys$1,isFunction$1=isFunction_1,isLength$1=isLength_1;function isArrayLike$6(tt){return tt!=null&&isLength$1(tt.length)&&!isFunction$1(tt)}var isArrayLike_1=isArrayLike$6,arrayLikeKeys$1=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike$5=isArrayLike_1;function keys$9(tt){return isArrayLike$5(tt)?arrayLikeKeys$1(tt):baseKeys(tt)}var keys_1=keys$9,copyObject$3=_copyObject,keys$8=keys_1;function baseAssign$1(tt,et){return tt&©Object$3(et,keys$8(et),tt)}var _baseAssign=baseAssign$1;function nativeKeysIn$1(tt){var et=[];if(tt!=null)for(var nt in Object(tt))et.push(nt);return et}var _nativeKeysIn=nativeKeysIn$1,isObject$d=isObject_1,isPrototype$1=_isPrototype,nativeKeysIn=_nativeKeysIn,objectProto$5=Object.prototype,hasOwnProperty$7=objectProto$5.hasOwnProperty;function baseKeysIn$1(tt){if(!isObject$d(tt))return nativeKeysIn(tt);var et=isPrototype$1(tt),nt=[];for(var it in tt)it=="constructor"&&(et||!hasOwnProperty$7.call(tt,it))||nt.push(it);return nt}var _baseKeysIn=baseKeysIn$1,arrayLikeKeys=_arrayLikeKeys,baseKeysIn=_baseKeysIn,isArrayLike$4=isArrayLike_1;function keysIn$3(tt){return isArrayLike$4(tt)?arrayLikeKeys(tt,!0):baseKeysIn(tt)}var keysIn_1=keysIn$3,copyObject$2=_copyObject,keysIn$2=keysIn_1;function baseAssignIn$1(tt,et){return tt&©Object$2(et,keysIn$2(et),tt)}var _baseAssignIn=baseAssignIn$1,_cloneBuffer={exports:{}};_cloneBuffer.exports;(function(tt,et){var nt=_root,it=et&&!et.nodeType&&et,rt=it&&!0&&tt&&!tt.nodeType&&tt,ot=rt&&rt.exports===it,at=ot?nt.Buffer:void 0,st=at?at.allocUnsafe:void 0;function lt(ct,ut){if(ut)return ct.slice();var ht=ct.length,dt=st?st(ht):new ct.constructor(ht);return ct.copy(dt),dt}tt.exports=lt})(_cloneBuffer,_cloneBuffer.exports);var _cloneBufferExports=_cloneBuffer.exports;function copyArray$1(tt,et){var nt=-1,it=tt.length;for(et||(et=Array(it));++ntwordsToBuffer(tt,!0).toString("hex"),16:tt=>wordsToBuffer(tt,!0).toString("hex"),13:tt=>wordsToBuffer(tt,!0).toString("utf8"),19:tt=>wordsToBuffer(tt,!0).toString("hex"),23:tt=>wordsToBuffer(tt,!0).toString("hex"),6:wordsToIntBE,24:wordsToIntBE,9:fallbackAddressParser,3:routingInfoParser,5:featureBitsParser},unknownTagName="unknownTag";function unknownEncoder(tt){return tt.words=bech32.decode(tt.words,Number.MAX_SAFE_INTEGER).words,tt}function getUnknownParser(tt){return et=>({tagCode:parseInt(tt),words:bech32.encode("unknown",et,Number.MAX_SAFE_INTEGER)})}function wordsToIntBE(tt){return tt.reverse().reduce((et,nt,it)=>et+nt*Math.pow(32,it),0)}function intBEToWords(tt,et){const nt=[];if(et===void 0&&(et=5),tt=Math.floor(tt),tt===0)return[0];for(;tt>0;)nt.push(tt&Math.pow(2,et)-1),tt=Math.floor(tt/Math.pow(2,et));return nt.reverse()}function sha256(tt){return createHash("sha256").update(tt).digest()}function convert$1(tt,et,nt){let it=0,rt=0;const ot=(1<=nt;)rt-=nt,at.push(it>>rt&ot);return rt>0&&at.push(it<0;)nt=st.slice(0,33).toString("hex"),it=st.slice(33,41).toString("hex"),rt=parseInt(st.slice(41,45).toString("hex"),16),ot=parseInt(st.slice(45,49).toString("hex"),16),at=parseInt(st.slice(49,51).toString("hex"),16),st=st.slice(51),et.push({pubkey:nt,short_channel_id:it,fee_base_msat:rt,fee_proportional_millionths:ot,cltv_expiry_delta:at});return et}function featureBitsParser(tt){const et=tt.slice().reverse().map(it=>[!!(it&1),!!(it&2),!!(it&4),!!(it&8),!!(it&16)]).reduce((it,rt)=>it.concat(rt),[]);for(;et.length{nt[it]={required:et[rt*2],supported:et[rt*2+1]}}),et.length>FEATUREBIT_ORDER.length*2){const it=et.slice(FEATUREBIT_ORDER.length*2);nt.extra_bits={start_bit:FEATUREBIT_ORDER.length*2,bits:it,has_required:it.reduce((rt,ot,at)=>at%2!==0?rt||!1:rt||ot,!1)}}else nt.extra_bits={start_bit:FEATUREBIT_ORDER.length*2,bits:[],has_required:!1};return nt}function featureBitsEncoder(tt){let et=tt.word_length,nt=[];for(FEATUREBIT_ORDER.forEach(it=>{nt.push(!!(tt[it]||{}).required),nt.push(!!(tt[it]||{}).supported)});nt[nt.length-1]===!1;)nt.pop();for(;nt.length%5!==0;)nt.push(!1);if(tt.extra_bits&&Array.isArray(tt.extra_bits.bits)&&tt.extra_bits.bits.length>0){for(;nt.lengthet)throw new Error("word_length is too small to contain all featureBits");return et===void 0&&(et=Math.ceil(nt.length/5)),new Array(et).fill(0).map((it,rt)=>nt[rt*5+4]<<4|nt[rt*5+3]<<3|nt[rt*5+2]<<2|nt[rt*5+1]<<1|nt[rt*5]<<0).reverse()}function routingInfoEncoder(tt){let et=Buffer$1.from([]);return tt.forEach(nt=>{et=Buffer$1.concat([et,hexToBuffer(nt.pubkey)]),et=Buffer$1.concat([et,hexToBuffer(nt.short_channel_id)]),et=Buffer$1.concat([et,Buffer$1.from([0,0,0].concat(intBEToWords(nt.fee_base_msat,8)).slice(-4))]),et=Buffer$1.concat([et,Buffer$1.from([0,0,0].concat(intBEToWords(nt.fee_proportional_millionths,8)).slice(-4))]),et=Buffer$1.concat([et,Buffer$1.from([0].concat(intBEToWords(nt.cltv_expiry_delta,8)).slice(-2))])}),hexToWord(et)}function purposeCommitEncoder(tt){let et;if(tt!==void 0&&(typeof tt=="string"||tt instanceof String))tt.match(/^([a-zA-Z0-9]{2})*$/)?et=Buffer$1.from(tt,"hex"):et=sha256(Buffer$1.from(tt,"utf8"));else throw new Error("purpose or purpose commit must be a string or hex string");return bech32.toWords(et)}function tagsItems(tt,et){const nt=tt.filter(rt=>rt.tagName===et);return nt.length>0?nt[0].data:null}function tagsContainItem(tt,et){return tagsItems(tt,et)!==null}function orderKeys(tt,et){const nt={};if(Object.keys(tt).sort().forEach(it=>{nt[it]=tt[it]}),et===!0){const it="__tagsObject_cache";Object.defineProperty(nt,"tagsObject",{get(){return this[it]||Object.defineProperty(this,it,{value:getTagsObject(this.tags)}),this[it]}})}return nt}function satToHrp(tt){if(!tt.toString().match(/^\d+$/))throw new Error("satoshis must be an integer");const et=new BN(tt,10);return millisatToHrp(et.mul(new BN(1e3,10)))}function millisatToHrp(tt){if(!tt.toString().match(/^\d+$/))throw new Error("millisatoshis must be an integer");const et=new BN(tt,10),nt=et.toString(10),it=nt.length;let rt,ot;return it>11&&/0{11}$/.test(nt)?(rt="",ot=et.div(MILLISATS_PER_BTC).toString(10)):it>8&&/0{8}$/.test(nt)?(rt="m",ot=et.div(MILLISATS_PER_MILLIBTC).toString(10)):it>5&&/0{5}$/.test(nt)?(rt="u",ot=et.div(MILLISATS_PER_MICROBTC).toString(10)):it>2&&/0{2}$/.test(nt)?(rt="n",ot=et.div(MILLISATS_PER_NANOBTC).toString(10)):(rt="p",ot=et.mul(PICOBTC_PER_MILLISATS).toString(10)),ot+rt}function hrpToSat(tt,et){const nt=hrpToMillisat(tt,!1);if(!nt.mod(new BN(1e3,10)).eq(new BN(0,10)))throw new Error("Amount is outside of valid range");const it=nt.div(new BN(1e3,10));return et?it.toString():it}function hrpToMillisat(tt,et){let nt,it;if(tt.slice(-1).match(/^[munp]$/))nt=tt.slice(-1),it=tt.slice(0,-1);else{if(tt.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");it=tt}if(!it.match(/^\d+$/))throw new Error("Not a valid human readable amount");const rt=new BN(it,10),ot=nt?rt.mul(MILLISATS_PER_BTC).div(DIVISORS[nt]):rt.mul(MILLISATS_PER_BTC);if(nt==="p"&&!rt.mod(new BN(10,10)).eq(new BN(0,10))||ot.gt(MAX_MILLISATS))throw new Error("Amount is outside of valid range");return et?ot.toString():ot}function sign$1(tt,et){const nt=cloneDeep(tt),it=hexToBuffer(et);if(nt.complete&&nt.paymentRequest)return nt;if(it===void 0||it.length!==32||!secp256k1.privateKeyVerify(it))throw new Error("privateKey must be a 32 byte Buffer and valid private key");let rt,ot;if(tagsContainItem(nt.tags,TAGNAMES[19])&&(ot=hexToBuffer(tagsItems(nt.tags,TAGNAMES[19]))),nt.payeeNodeKey&&(rt=hexToBuffer(nt.payeeNodeKey)),rt&&ot&&!ot.equals(rt))throw new Error("payee node key tag and payeeNodeKey attribute must match");rt=ot||rt;const at=Buffer$1.from(secp256k1.publicKeyCreate(it));if(rt&&!at.equals(rt))throw new Error("The private key given is not the private key of the node public key given");const st=bech32.decode(nt.wordsTemp,Number.MAX_SAFE_INTEGER).words,lt=Buffer$1.concat([Buffer$1.from(nt.prefix,"utf8"),wordsToBuffer(st)]),ct=sha256(lt),ut=secp256k1.ecdsaSign(ct,it);ut.signature=Buffer$1.from(ut.signature);const ht=hexToWord(ut.signature.toString("hex")+"0"+ut.recid);return nt.payeeNodeKey=at.toString("hex"),nt.signature=ut.signature.toString("hex"),nt.recoveryFlag=ut.recid,nt.wordsTemp=bech32.encode("temp",st.concat(ht),Number.MAX_SAFE_INTEGER),nt.complete=!0,nt.paymentRequest=bech32.encode(nt.prefix,st.concat(ht),Number.MAX_SAFE_INTEGER),orderKeys(nt)}function encode$3(tt,et){const nt=cloneDeep(tt);et===void 0&&(et=!0);const it=!(nt.signature===void 0||nt.recoveryFlag===void 0);let rt;if(nt.network===void 0&&!it)nt.network=DEFAULTNETWORK,rt=DEFAULTNETWORK;else{if(nt.network===void 0&&it)throw new Error("Need network for proper payment request reconstruction");if(!nt.network.bech32||nt.network.pubKeyHash===void 0||nt.network.scriptHash===void 0||!Array.isArray(nt.network.validWitnessVersions))throw new Error("Invalid network");rt=nt.network}if(nt.timestamp===void 0&&!it)nt.timestamp=Math.floor(new Date().getTime()/1e3);else if(nt.timestamp===void 0&&it)throw new Error("Need timestamp for proper payment request reconstruction");if(nt.tags===void 0)throw new Error("Payment Requests need tags array");if(!tagsContainItem(nt.tags,TAGNAMES[1]))throw new Error("Lightning Payment Request needs a payment hash");if(tagsContainItem(nt.tags,TAGNAMES[16]))if(tagsContainItem(nt.tags,TAGNAMES[5])){const vt=tagsItems(nt.tags,TAGNAMES[5]);if(!vt.payment_secret||!vt.payment_secret.supported&&!vt.payment_secret.required)throw new Error("Payment request requires feature bits with at least payment secret support flagged if payment secret is included")}else if(et)nt.tags.push({tagName:TAGNAMES[5],data:DEFAULTFEATUREBITS});else throw new Error("Payment request requires feature bits with at least payment secret support flagged if payment secret is included");if(!tagsContainItem(nt.tags,TAGNAMES[13])&&!tagsContainItem(nt.tags,TAGNAMES[23]))if(et)nt.tags.push({tagName:TAGNAMES[13],data:DEFAULTDESCRIPTION});else throw new Error("Payment request requires description or purpose commit hash");if(tagsContainItem(nt.tags,TAGNAMES[13])&&Buffer$1.from(tagsItems(nt.tags,TAGNAMES[13]),"utf8").length>639)throw new Error("Description is too long: Max length 639 bytes");!tagsContainItem(nt.tags,TAGNAMES[6])&&!it&&et&&nt.tags.push({tagName:TAGNAMES[6],data:DEFAULTEXPIRETIME}),!tagsContainItem(nt.tags,TAGNAMES[24])&&!it&&et&&nt.tags.push({tagName:TAGNAMES[24],data:DEFAULTCLTVEXPIRY});let ot,at;if(tagsContainItem(nt.tags,TAGNAMES[19])&&(at=hexToBuffer(tagsItems(nt.tags,TAGNAMES[19]))),nt.payeeNodeKey&&(ot=hexToBuffer(nt.payeeNodeKey)),ot&&at&&!at.equals(ot))throw new Error("payeeNodeKey and tag payee node key do not match");ot=ot||at,ot&&(nt.payeeNodeKey=ot.toString("hex"));let st,lt,ct;if(tagsContainItem(nt.tags,TAGNAMES[9])){const vt=tagsItems(nt.tags,TAGNAMES[9]);if(ct=vt.address,lt=vt.addressHash,st=vt.code,lt===void 0||st===void 0){let xt,St;try{xt=bitcoinjsAddress.fromBech32(ct),lt=xt.data,st=xt.version}catch{try{St=bitcoinjsAddress.fromBase58Check(ct),St.version===rt.pubKeyHash?st=17:St.version===rt.scriptHash&&(st=18),lt=St.hash}catch{throw new Error("Fallback address type is unknown")}}if(xt&&!(xt.version in rt.validWitnessVersions))throw new Error("Fallback address witness version is unknown");if(xt&&xt.prefix!==rt.bech32)throw new Error("Fallback address network type does not match payment request network type");if(St&&St.version!==rt.pubKeyHash&&St.version!==rt.scriptHash)throw new Error("Fallback address version (base58) is unknown or the network type is incorrect");vt.addressHash=lt.toString("hex"),vt.code=st}}tagsContainItem(nt.tags,TAGNAMES[3])&&tagsItems(nt.tags,TAGNAMES[3]).forEach(xt=>{if(xt.pubkey===void 0||xt.short_channel_id===void 0||xt.fee_base_msat===void 0||xt.fee_proportional_millionths===void 0||xt.cltv_expiry_delta===void 0)throw new Error("Routing info is incomplete");if(!secp256k1.publicKeyVerify(hexToBuffer(xt.pubkey)))throw new Error("Routing info pubkey is not a valid pubkey");const St=hexToBuffer(xt.short_channel_id);if(!(St instanceof Buffer$1)||St.length!==8)throw new Error("Routing info short channel id must be 8 bytes");if(typeof xt.fee_base_msat!="number"||Math.floor(xt.fee_base_msat)!==xt.fee_base_msat)throw new Error("Routing info fee base msat is not an integer");if(typeof xt.fee_proportional_millionths!="number"||Math.floor(xt.fee_proportional_millionths)!==xt.fee_proportional_millionths)throw new Error("Routing info fee proportional millionths is not an integer");if(typeof xt.cltv_expiry_delta!="number"||Math.floor(xt.cltv_expiry_delta)!==xt.cltv_expiry_delta)throw new Error("Routing info cltv expiry delta is not an integer")});let ut="ln";ut+=rt.bech32;let ht;if(nt.millisatoshis&&nt.satoshis){if(ht=millisatToHrp(new BN(nt.millisatoshis,10)),satToHrp(new BN(nt.satoshis,10))!==ht)throw new Error("satoshis and millisatoshis do not match")}else nt.millisatoshis?ht=millisatToHrp(new BN(nt.millisatoshis,10)):nt.satoshis?ht=satToHrp(new BN(nt.satoshis,10)):ht="";ut+=ht;const dt=intBEToWords(nt.timestamp);for(;dt.length<7;)dt.unshift(0);const pt=nt.tags;let mt=[];pt.forEach(vt=>{const xt=Object.keys(TAGENCODERS);if(it&&xt.push(unknownTagName),xt.indexOf(vt.tagName)===-1)throw new Error("Unknown tag key: "+vt.tagName);let St;if(vt.tagName!==unknownTagName){mt.push(TAGCODES[vt.tagName]);const Et=TAGENCODERS[vt.tagName];St=Et(vt.data)}else{const Et=unknownEncoder(vt.data);mt.push(Et.tagCode),St=Et.words}mt=mt.concat([0].concat(intBEToWords(St.length)).slice(-2)),mt=mt.concat(St)});let gt=dt.concat(mt);const bt=Buffer$1.concat([Buffer$1.from(ut,"utf8"),Buffer$1.from(convert$1(gt,5,8))]),yt=sha256(bt);let wt;if(it)if(ot){const vt=Buffer$1.from(secp256k1.ecdsaRecover(Buffer$1.from(nt.signature,"hex"),nt.recoveryFlag,yt,!0));if(ot&&!ot.equals(vt))throw new Error("Signature, message, and recoveryID did not produce the same pubkey as payeeNodeKey");wt=hexToWord(nt.signature+"0"+nt.recoveryFlag)}else throw new Error("Reconstruction with signature and recoveryID requires payeeNodeKey to verify correctness of input data.");return wt&&(gt=gt.concat(wt)),tagsContainItem(nt.tags,TAGNAMES[6])&&(nt.timeExpireDate=nt.timestamp+tagsItems(nt.tags,TAGNAMES[6]),nt.timeExpireDateString=new Date(nt.timeExpireDate*1e3).toISOString()),nt.timestampString=new Date(nt.timestamp*1e3).toISOString(),nt.complete=!!wt,nt.paymentRequest=nt.complete?bech32.encode(ut,gt,Number.MAX_SAFE_INTEGER):"",nt.prefix=ut,nt.wordsTemp=bech32.encode("temp",gt,Number.MAX_SAFE_INTEGER),orderKeys(nt)}function decode$4(tt,et){if(typeof tt!="string")throw new Error("Lightning Payment Request must be string");if(tt.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const nt=bech32.decode(tt,Number.MAX_SAFE_INTEGER);tt=tt.toLowerCase();const it=nt.prefix;let rt=nt.words;const ot=rt.slice(-104),at=rt.slice(0,-104);rt=rt.slice(0,-104);let st=wordsToBuffer(ot,!0);const lt=st.slice(-1)[0];if(st=st.slice(0,-1),!(lt in[0,1,2,3])||st.length!==64)throw new Error("Signature is missing or incorrect");let ct=it.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(ct&&!ct[2]&&(ct=it.match(/^ln(\S+)$/)),!ct)throw new Error("Not a proper lightning payment request");const ut=ct[1];let ht;if(et){if(et.bech32===void 0||et.pubKeyHash===void 0||et.scriptHash===void 0||!Array.isArray(et.validWitnessVersions))throw new Error("Invalid network");ht=et}else switch(ut){case DEFAULTNETWORK.bech32:ht=DEFAULTNETWORK;break;case TESTNETWORK.bech32:ht=TESTNETWORK;break;case REGTESTNETWORK.bech32:ht=REGTESTNETWORK;break;case SIMNETWORK.bech32:ht=SIMNETWORK;break}if(!ht||ht.bech32!==ut)throw new Error("Unknown coin bech32 prefix");const dt=ct[2];let pt,mt,gt;if(dt){const jt=ct[3];try{pt=parseInt(hrpToSat(dt+jt,!0))}catch{pt=null,gt=!0}mt=hrpToMillisat(dt+jt,!0)}else pt=null,mt=null;const bt=wordsToIntBE(rt.slice(0,7)),yt=new Date(bt*1e3).toISOString();rt=rt.slice(7);const wt=[];let vt,xt,St,Et;for(;rt.length>0;){const jt=rt[0].toString();vt=TAGNAMES[jt]||unknownTagName,xt=TAGPARSERS[jt]||getUnknownParser(jt),rt=rt.slice(1),St=wordsToIntBE(rt.slice(0,2)),rt=rt.slice(2),Et=rt.slice(0,St),rt=rt.slice(St),wt.push({tagName:vt,data:xt(Et,ht)})}let $t,It;tagsContainItem(wt,TAGNAMES[6])&&($t=bt+tagsItems(wt,TAGNAMES[6]),It=new Date($t*1e3).toISOString());const Ft=Buffer$1.concat([Buffer$1.from(it,"utf8"),Buffer$1.from(convert$1(at,5,8))]),Ht=sha256(Ft),zt=Buffer$1.from(secp256k1.ecdsaRecover(st,lt,Ht,!0));if(tagsContainItem(wt,TAGNAMES[19])&&tagsItems(wt,TAGNAMES[19])!==zt.toString("hex"))throw new Error("Lightning Payment Request signature pubkey does not match payee pubkey");let Ot={paymentRequest:tt,complete:!0,prefix:it,wordsTemp:bech32.encode("temp",at.concat(ot),Number.MAX_SAFE_INTEGER),network:ht,satoshis:pt,millisatoshis:mt,timestamp:bt,timestampString:yt,payeeNodeKey:zt.toString("hex"),signature:st.toString("hex"),recoveryFlag:lt,tags:wt};return gt&&delete Ot.satoshis,$t&&(Ot=Object.assign(Ot,{timeExpireDate:$t,timeExpireDateString:It})),orderKeys(Ot,!0)}function getTagsObject(tt){const et={};return tt.forEach(nt=>{nt.tagName===unknownTagName?(et.unknownTags||(et.unknownTags=[]),et.unknownTags.push(nt.data)):et[nt.tagName]=nt.data}),et}var payreq={encode:encode$3,decode:decode$4,sign:sign$1,satToHrp,millisatToHrp,hrpToSat,hrpToMillisat};(function(tt){var et=commonjsGlobal&&commonjsGlobal.__importDefault||function(ut){return ut&&ut.__esModule?ut:{default:ut}};Object.defineProperty(tt,"__esModule",{value:!0}),tt.getIdFromRequest=tt.decode=tt.isHex=tt.stringToBytes=tt.isValue=tt.utf8Encoder=void 0;const nt=et(payreq),it=et(assert_1);let rt;typeof window<"u"&&window&&window.TextEncoder?rt=window.TextEncoder:rt=util.TextEncoder,tt.utf8Encoder=new rt;const ot=ut=>ut!=null;tt.isValue=ot;const at=ut=>(0,tt.isValue)(ut)?tt.utf8Encoder.encode(ut):ut;tt.stringToBytes=at;function st(ut){return Buffer.from(ut,"hex").toString("hex")===ut}tt.isHex=st;function lt(ut){let ht;return ut.indexOf("lnsb")===0&&(ht={bech32:"sb"}),nt.default.decode(ut,ht)}tt.decode=lt;function ct(ut){const dt=lt(ut).tags.find(mt=>mt.tagName==="payment_hash");(0,it.default)(dt&&dt.data,"Could not find payment hash on invoice request");const pt=dt==null?void 0:dt.data.toString();if(!pt||!pt.length)throw new Error("Could not get payment hash from payment request");return pt}tt.getIdFromRequest=ct})(helpers);var hasRequiredLsat;function requireLsat(){if(hasRequiredLsat)return lsat$1;hasRequiredLsat=1;var tt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(dt,pt,mt,gt){gt===void 0&&(gt=mt);var bt=Object.getOwnPropertyDescriptor(pt,mt);(!bt||("get"in bt?!pt.__esModule:bt.writable||bt.configurable))&&(bt={enumerable:!0,get:function(){return pt[mt]}}),Object.defineProperty(dt,gt,bt)}:function(dt,pt,mt,gt){gt===void 0&&(gt=mt),dt[gt]=pt[mt]}),et=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(dt,pt){Object.defineProperty(dt,"default",{enumerable:!0,value:pt})}:function(dt,pt){dt.default=pt}),nt=commonjsGlobal&&commonjsGlobal.__importStar||function(dt){if(dt&&dt.__esModule)return dt;var pt={};if(dt!=null)for(var mt in dt)mt!=="default"&&Object.prototype.hasOwnProperty.call(dt,mt)&&tt(pt,dt,mt);return et(pt,dt),pt},it=commonjsGlobal&&commonjsGlobal.__importDefault||function(dt){return dt&&dt.__esModule?dt:{default:dt}};Object.defineProperty(lsat$1,"__esModule",{value:!0}),lsat$1.Lsat=lsat$1.parseChallengePart=void 0;const rt=assert_1,ot=bufio,at=it(requireCryptoBrowserify()),st=nt(macaroon$1),lt=requireDist(),ct=helpers;function ut(dt){let pt;const mt=dt.indexOf("=");rt(mt>-1,'Incorrectly encoded challenge. Missing "=" separator.');const gt=dt.length-1-mt;return pt=dt.slice(-gt),rt(pt.length,"Incorrectly encoded macaroon challenge"),rt(pt[0]==='"'&&pt[pt.length-1]==='"',"Incorectly encoded challenge, challenges must be enclosed in double quotes."),pt=pt.slice(1,pt.length-1),pt}lsat$1.parseChallengePart=ut;class ht extends ot.Struct{constructor(pt){super(pt),this.id="",this.validUntil=0,this.invoice="",this.baseMacaroon="",this.paymentHash=Buffer.alloc(32).toString("hex"),this.timeCreated=Date.now(),this.paymentPreimage=null,this.amountPaid=0,this.routingFeePaid=0,this.invoiceAmount=0,pt&&this.fromOptions(pt)}fromOptions(pt){rt(typeof pt.baseMacaroon=="string","Require serialized macaroon"),this.baseMacaroon=pt.baseMacaroon,rt(typeof pt.id=="string","Require string id"),this.id=pt.id,rt(typeof pt.paymentHash=="string","Require paymentHash"),this.paymentHash=pt.paymentHash;const mt=this.getExpirationFromMacaroon(pt.baseMacaroon);return mt&&(this.validUntil=mt),pt.invoice&&this.addInvoice(pt.invoice),pt.timeCreated&&(this.timeCreated=pt.timeCreated),pt.paymentPreimage&&(this.paymentPreimage=pt.paymentPreimage),pt.amountPaid&&(this.amountPaid=pt.amountPaid),pt.routingFeePaid&&(this.routingFeePaid=pt.routingFeePaid),this}isExpired(){return this.validUntil===0?!1:this.validUntilwt.tagName==="payment_hash");rt(bt,"Could not find payment hash on invoice request");const yt=bt==null?void 0:bt.data;rt(yt===this.paymentHash,"paymentHash from invoice did not match LSAT"),this.invoiceAmount=gt||0,this.invoice=pt}catch(mt){throw new Error(`Problem adding invoice data to LSAT: ${mt.message}`)}}static fromMacaroon(pt,mt){rt(typeof pt=="string","Requires a raw macaroon string for macaroon to generate LSAT");let gt,bt;try{bt=(0,lt.decodeIdentifierFromMacaroon)(pt),gt=lt.Identifier.fromString(bt)}catch(vt){throw new Error(`Unexpected encoding for macaroon identifier: ${vt.message}`)}const yt={id:bt,baseMacaroon:pt,paymentHash:gt.paymentHash.toString("hex")},wt=new this(yt);return mt&&wt.addInvoice(mt),wt}static fromToken(pt,mt){rt(pt.includes(this.type),"Token must include LSAT prefix"),pt=pt.slice(this.type.length).trim();const[gt,bt]=pt.split(":"),yt=ht.fromMacaroon(gt,mt);return bt&&yt.setPreimage(bt),yt}static fromChallenge(pt){const mt="macaroon=",gt="invoice=";let bt;bt=pt.split(","),bt.length<2&&(bt=pt.split(" ")),rt(bt.length>=2,"Expected at least two challenges in the LSAT: invoice and macaroon");let yt="",wt="";for(const St of bt){if(!yt.length&&St.indexOf(mt)>-1)try{yt=ut(St)}catch(Et){throw new Error(`Problem parsing macaroon challenge: ${Et.message}`)}if(!wt.length&&St.indexOf(gt)>-1)try{wt=ut(St)}catch(Et){throw new Error(`Problem parsing macaroon challenge: ${Et.message}`)}if(wt.length&&yt.length)break}rt(wt.length&&yt.length,"Expected WWW-Authenticate challenge with macaroon and invoice data");const vt=(0,ct.getIdFromRequest)(wt),xt=(0,lt.decodeIdentifierFromMacaroon)(yt);return new this({id:xt,baseMacaroon:yt,paymentHash:vt,invoice:wt})}static fromHeader(pt){const mt=pt.slice(this.type.length).trim();return rt(pt.length!==mt.length,'header missing token type prefix "LSAT"'),ht.fromChallenge(mt)}}return lsat$1.Lsat=ht,ht.type="LSAT",lsat$1}var types$1={},lsat={};Object.defineProperty(lsat,"__esModule",{value:!0});var satisfier={};Object.defineProperty(satisfier,"__esModule",{value:!0});(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(it,rt,ot,at){at===void 0&&(at=ot);var st=Object.getOwnPropertyDescriptor(rt,ot);(!st||("get"in st?!rt.__esModule:st.writable||st.configurable))&&(st={enumerable:!0,get:function(){return rt[ot]}}),Object.defineProperty(it,at,st)}:function(it,rt,ot,at){at===void 0&&(at=ot),it[at]=rt[ot]}),nt=commonjsGlobal&&commonjsGlobal.__exportStar||function(it,rt){for(var ot in it)ot!=="default"&&!Object.prototype.hasOwnProperty.call(rt,ot)&&et(rt,it,ot)};Object.defineProperty(tt,"__esModule",{value:!0}),nt(lsat,tt),nt(satisfier,tt)})(types$1);var satisfiers={},hasRequiredSatisfiers;function requireSatisfiers(){if(hasRequiredSatisfiers)return satisfiers;hasRequiredSatisfiers=1,Object.defineProperty(satisfiers,"__esModule",{value:!0}),satisfiers.createCapabilitiesSatisfier=satisfiers.createServicesSatisfier=satisfiers.expirationSatisfier=void 0;const tt=requireDist();satisfiers.expirationSatisfier={condition:"expiration",satisfyPrevious:(it,rt)=>it.condition!=="expiration"||rt.condition!=="expiration"?!1:!(it.value!(it.condition!=="expiration"||it.value{if(typeof it!="string")throw new tt.InvalidServicesError;return{condition:tt.SERVICES_CAVEAT_CONDITION,satisfyPrevious:(rt,ot)=>{const at=(0,tt.decodeServicesCaveat)(rt.value.toString()),st=(0,tt.decodeServicesCaveat)(ot.value.toString());if(!Array.isArray(at)||!Array.isArray(st))throw new tt.InvalidServicesError;let lt=new Map;lt=at.reduce((ct,ut)=>ct.set(ut.name,ut.tier),lt);for(const ct of st)if(!lt.has(ct.name)||lt.get(ct.name)>ct.tier)return!1;return!0},satisfyFinal:rt=>{const ot=(0,tt.decodeServicesCaveat)(rt.value.toString());if(!Array.isArray(ot))throw new tt.InvalidServicesError;for(const at of ot)if(at.name===it)return!0;return!1}}};satisfiers.createServicesSatisfier=et;const nt=(it,rt)=>{if(typeof rt!="string")throw new tt.InvalidCapabilitiesError;if(typeof it!="string")throw new tt.InvalidCapabilitiesError;return{condition:it+tt.SERVICE_CAPABILITIES_SUFFIX,satisfyPrevious:(ot,at)=>{const st=(0,tt.decodeCapabilitiesValue)(ot.value.toString()),lt=(0,tt.decodeCapabilitiesValue)(at.value.toString());if(!Array.isArray(st)||!Array.isArray(lt))throw new tt.InvalidServicesError;let ct=new Set;ct=st.reduce((ut,ht)=>ut.add(ht),ct);for(const ut of lt)if(!ct.has(ut))return!1;return!0},satisfyFinal:ot=>{const at=(0,tt.decodeCapabilitiesValue)(ot.value.toString());if(!Array.isArray(at))throw new tt.InvalidServicesError;for(const st of at)if(st===rt)return!0;return!1}}};return satisfiers.createCapabilitiesSatisfier=nt,satisfiers}var macaroon={},base64={},__extends$1=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,nt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(it,rt){it.__proto__=rt}||function(it,rt){for(var ot in rt)rt.hasOwnProperty(ot)&&(it[ot]=rt[ot])},tt(et,nt)};return function(et,nt){tt(et,nt);function it(){this.constructor=et}et.prototype=nt===null?Object.create(nt):(it.prototype=nt.prototype,new it)}}();Object.defineProperty(base64,"__esModule",{value:!0});var INVALID_BYTE=256,Coder=function(){function tt(et){et===void 0&&(et="="),this._paddingCharacter=et}return tt.prototype.encodedLength=function(et){return this._paddingCharacter?(et+2)/3*4|0:(et*8+5)/6|0},tt.prototype.encode=function(et){for(var nt="",it=0;it>>3*6&63),nt+=this._encodeByte(rt>>>2*6&63),nt+=this._encodeByte(rt>>>1*6&63),nt+=this._encodeByte(rt>>>0*6&63)}var ot=et.length-it;if(ot>0){var rt=et[it]<<16|(ot===2?et[it+1]<<8:0);nt+=this._encodeByte(rt>>>3*6&63),nt+=this._encodeByte(rt>>>2*6&63),ot===2?nt+=this._encodeByte(rt>>>1*6&63):nt+=this._paddingCharacter||"",nt+=this._paddingCharacter||""}return nt},tt.prototype.maxDecodedLength=function(et){return this._paddingCharacter?et/4*3|0:(et*6+7)/8|0},tt.prototype.decodedLength=function(et){return this.maxDecodedLength(et.length-this._getPaddingLength(et))},tt.prototype.decode=function(et){if(et.length===0)return new Uint8Array(0);for(var nt=this._getPaddingLength(et),it=et.length-nt,rt=new Uint8Array(this.maxDecodedLength(it)),ot=0,at=0,st=0,lt=0,ct=0,ut=0,ht=0;at>>4,rt[ot++]=ct<<4|ut>>>2,rt[ot++]=ut<<6|ht,st|=lt&INVALID_BYTE,st|=ct&INVALID_BYTE,st|=ut&INVALID_BYTE,st|=ht&INVALID_BYTE;if(at>>4,st|=lt&INVALID_BYTE,st|=ct&INVALID_BYTE),at>>2,st|=ut&INVALID_BYTE),at>>8&0-65-26+97,nt+=51-et>>>8&26-97-52+48,nt+=61-et>>>8&52-48-62+43,nt+=62-et>>>8&62-43-63+47,String.fromCharCode(nt)},tt.prototype._decodeChar=function(et){var nt=INVALID_BYTE;return nt+=(42-et&et-44)>>>8&-INVALID_BYTE+et-43+62,nt+=(46-et&et-48)>>>8&-INVALID_BYTE+et-47+63,nt+=(47-et&et-58)>>>8&-INVALID_BYTE+et-48+52,nt+=(64-et&et-91)>>>8&-INVALID_BYTE+et-65+0,nt+=(96-et&et-123)>>>8&-INVALID_BYTE+et-97+26,nt},tt.prototype._getPaddingLength=function(et){var nt=0;if(this._paddingCharacter){for(var it=et.length-1;it>=0&&et[it]===this._paddingCharacter;it--)nt++;if(et.length<4||nt>2)throw new Error("Base64Coder: incorrect padding")}return nt},tt}();base64.Coder=Coder;var stdCoder=new Coder;function encode$2(tt){return stdCoder.encode(tt)}base64.encode=encode$2;function decode$3(tt){return stdCoder.decode(tt)}base64.decode=decode$3;var URLSafeCoder=function(tt){__extends$1(et,tt);function et(){return tt!==null&&tt.apply(this,arguments)||this}return et.prototype._encodeByte=function(nt){var it=nt;return it+=65,it+=25-nt>>>8&0-65-26+97,it+=51-nt>>>8&26-97-52+48,it+=61-nt>>>8&52-48-62+45,it+=62-nt>>>8&62-45-63+95,String.fromCharCode(it)},et.prototype._decodeChar=function(nt){var it=INVALID_BYTE;return it+=(44-nt&nt-46)>>>8&-INVALID_BYTE+nt-45+62,it+=(94-nt&nt-96)>>>8&-INVALID_BYTE+nt-95+63,it+=(47-nt&nt-58)>>>8&-INVALID_BYTE+nt-48+52,it+=(64-nt&nt-91)>>>8&-INVALID_BYTE+nt-65+0,it+=(96-nt&nt-123)>>>8&-INVALID_BYTE+nt-97+26,it},et}(Coder);base64.URLSafeCoder=URLSafeCoder;var urlSafeCoder=new URLSafeCoder;function encodeURLSafe(tt){return urlSafeCoder.encode(tt)}base64.encodeURLSafe=encodeURLSafe;function decodeURLSafe(tt){return urlSafeCoder.decode(tt)}base64.decodeURLSafe=decodeURLSafe;base64.encodedLength=function(tt){return stdCoder.encodedLength(tt)};base64.maxDecodedLength=function(tt){return stdCoder.maxDecodedLength(tt)};base64.decodedLength=function(tt){return stdCoder.decodedLength(tt)};var __createBinding$1=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(tt,et,nt,it){it===void 0&&(it=nt);var rt=Object.getOwnPropertyDescriptor(et,nt);(!rt||("get"in rt?!et.__esModule:rt.writable||rt.configurable))&&(rt={enumerable:!0,get:function(){return et[nt]}}),Object.defineProperty(tt,it,rt)}:function(tt,et,nt,it){it===void 0&&(it=nt),tt[it]=et[nt]}),__setModuleDefault$1=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(tt,et){Object.defineProperty(tt,"default",{enumerable:!0,value:et})}:function(tt,et){tt.default=et}),__importStar$1=commonjsGlobal&&commonjsGlobal.__importStar||function(tt){if(tt&&tt.__esModule)return tt;var et={};if(tt!=null)for(var nt in tt)nt!=="default"&&Object.prototype.hasOwnProperty.call(tt,nt)&&__createBinding$1(et,tt,nt);return __setModuleDefault$1(et,tt),et};Object.defineProperty(macaroon,"__esModule",{value:!0});macaroon.getRawMacaroon=macaroon.verifyMacaroonCaveats=macaroon.getCaveatsFromMacaroon=void 0;const caveat_1=caveat,helpers_1=helpers,Macaroon=__importStar$1(macaroon$1),base64_1=base64;function getCaveatsFromMacaroon(tt){var et;const nt=Macaroon.importMacaroon(tt),it=[],rt=(et=nt._exportAsJSONObjectV2())===null||et===void 0?void 0:et.c;if(rt)for(const ot of rt){if(!ot.i)continue;const at=caveat_1.Caveat.decode(ot.i);it.push(at)}return it}macaroon.getCaveatsFromMacaroon=getCaveatsFromMacaroon;function verifyMacaroonCaveats(tt,et,nt,it={}){try{const rt=Macaroon.importMacaroon(tt),ot=(0,helpers_1.stringToBytes)(et);rt.verify(ot,()=>null);const at=getCaveatsFromMacaroon(tt);return nt&&!Array.isArray(nt)&&(nt=[nt]),!at.length&&(!nt||!nt.length)?!0:(0,caveat_1.verifyCaveats)(at,nt,it)}catch{return!1}}macaroon.verifyMacaroonCaveats=verifyMacaroonCaveats;function getRawMacaroon(tt,et=!1){const nt=tt._exportBinaryV2();return et?(0,base64_1.encodeURLSafe)(nt):(0,base64_1.encode)(nt)}macaroon.getRawMacaroon=getRawMacaroon;var service={};(function(tt){var et=commonjsGlobal&&commonjsGlobal.__importDefault||function(dt){return dt&&dt.__esModule?dt:{default:dt}};Object.defineProperty(tt,"__esModule",{value:!0}),tt.decodeCapabilitiesValue=tt.createNewCapabilitiesCaveat=tt.SERVICE_CAPABILITIES_SUFFIX=tt.encodeServicesCaveatValue=tt.decodeServicesCaveat=tt.SERVICES_CAVEAT_CONDITION=tt.Service=tt.InvalidCapabilitiesError=tt.InvalidServicesError=tt.NoServicesError=void 0;const nt=et(bufio),it=caveat;class rt extends Error{constructor(...pt){super(...pt),this.name="NoServicesError",this.message="no services found",Error.captureStackTrace&&Error.captureStackTrace(this,rt)}}tt.NoServicesError=rt;class ot extends Error{constructor(pt){super(pt),this.name="InvalidServicesError",pt||(this.message='service must be of the form "name:tier"'),Error.captureStackTrace&&Error.captureStackTrace(this,ot)}}tt.InvalidServicesError=ot;class at extends Error{constructor(pt){super(pt),this.name="InvalidCapabilitiesError",pt||(this.message="capabilities must be a string or array of strings"),Error.captureStackTrace&&Error.captureStackTrace(this,ot)}}tt.InvalidCapabilitiesError=at;class st extends nt.default.Struct{constructor(pt){super(pt),this.name=pt.name,this.tier=pt.tier}}tt.Service=st,tt.SERVICES_CAVEAT_CONDITION="services";const lt=dt=>{if(!dt.length)throw new rt;const pt=[],mt=dt.split(",");for(const gt of mt){const[bt,yt]=gt.split(":");if(!bt||!yt)throw new ot;if(isNaN(+yt))throw new ot("tier must be a number");if(!isNaN(+bt))throw new ot("service name must be a string");pt.push(new st({name:bt,tier:+yt}))}return pt};tt.decodeServicesCaveat=lt;const ct=dt=>{if(!dt.length)throw new rt;let pt="";for(let mt=0;mt{let mt;if(!pt)mt="";else if(Array.isArray(pt))mt=pt.join(",");else{if(typeof pt!="string")throw new at;mt=pt}return new it.Caveat({condition:dt+tt.SERVICE_CAPABILITIES_SUFFIX,value:mt,comp:"="})};tt.createNewCapabilitiesCaveat=ut;const ht=dt=>{if(typeof dt!="string")throw new at;return dt.toString().split(",").map(pt=>pt.trim())};tt.decodeCapabilitiesValue=ht})(service);var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(it,rt,ot,at){at===void 0&&(at=ot);var st=Object.getOwnPropertyDescriptor(rt,ot);(!st||("get"in st?!rt.__esModule:st.writable||st.configurable))&&(st={enumerable:!0,get:function(){return rt[ot]}}),Object.defineProperty(it,at,st)}:function(it,rt,ot,at){at===void 0&&(at=ot),it[at]=rt[ot]}),nt=commonjsGlobal&&commonjsGlobal.__exportStar||function(it,rt){for(var ot in it)ot!=="default"&&!Object.prototype.hasOwnProperty.call(rt,ot)&&et(rt,it,ot)};Object.defineProperty(tt,"__esModule",{value:!0}),nt(identifier$1,tt),nt(caveat,tt),nt(requireLsat(),tt),nt(types$1,tt),nt(requireSatisfiers(),tt),nt(macaroon,tt),nt(service,tt)}(dist$2)),dist$2}var distExports=requireDist(),lib$1={},client={},errors={},__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,nt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(it,rt){it.__proto__=rt}||function(it,rt){for(var ot in rt)Object.prototype.hasOwnProperty.call(rt,ot)&&(it[ot]=rt[ot])},tt(et,nt)};return function(et,nt){if(typeof nt!="function"&&nt!==null)throw new TypeError("Class extends value "+String(nt)+" is not a constructor or null");tt(et,nt);function it(){this.constructor=et}et.prototype=nt===null?Object.create(nt):(it.prototype=nt.prototype,new it)}}();Object.defineProperty(errors,"__esModule",{value:!0});errors.InternalError=errors.InvalidDataError=errors.RoutingError=errors.UnsupportedMethodError=errors.ConnectionError=errors.RejectionError=errors.MissingProviderError=void 0;function fixError(tt,et,nt){if(Object.setPrototypeOf(tt,nt.prototype),et===nt)if(tt.name=et.name,Error.captureStackTrace)Error.captureStackTrace(tt,nt);else{var it=new Error(tt.message).stack;it&&(tt.stack=fixStack(it,"new ".concat(et.name)))}}function fixStack(tt,et){if(!tt||!et)return tt;var nt=new RegExp("\\s+at\\s".concat(et,"\\s")),it=tt.split(` `),rt=it.filter(function(ot){return!ot.match(nt)});return rt.join(` -`)}var MissingProviderError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.MissingProviderError=MissingProviderError;var RejectionError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.RejectionError=RejectionError;var ConnectionError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.ConnectionError=ConnectionError;var UnsupportedMethodError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.UnsupportedMethodError=UnsupportedMethodError;var RoutingError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.RoutingError=RoutingError;var InvalidDataError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.InvalidDataError=InvalidDataError;var InternalError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.InternalError=InternalError;Object.defineProperty(client,"__esModule",{value:!0});client.requestProvider=void 0;var errors_1=errors;function requestProvider(tt){return new Promise(function(et,nt){if(typeof window>"u")return nt(new Error("Must be called in a browser context"));var it=window.webln;if(!it)return nt(new errors_1.MissingProviderError("Your browser has no WebLN provider"));it.enable().then(function(){return et(it)}).catch(function(rt){return nt(rt)})})}client.requestProvider=requestProvider;var provider={};Object.defineProperty(provider,"__esModule",{value:!0});(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(it,rt,ot,at){at===void 0&&(at=ot);var st=Object.getOwnPropertyDescriptor(rt,ot);(!st||("get"in st?!rt.__esModule:st.writable||st.configurable))&&(st={enumerable:!0,get:function(){return rt[ot]}}),Object.defineProperty(it,at,st)}:function(it,rt,ot,at){at===void 0&&(at=ot),it[at]=rt[ot]}),nt=commonjsGlobal&&commonjsGlobal.__exportStar||function(it,rt){for(var ot in it)ot!=="default"&&!Object.prototype.hasOwnProperty.call(rt,ot)&&et(rt,it,ot)};Object.defineProperty(tt,"__esModule",{value:!0}),nt(client,tt),nt(provider,tt),nt(errors,tt)})(lib$1);async function buyLsat(tt){const et={amount:tt};return api$1.post("/buy_lsat",JSON.stringify(et))}async function payLsat(){let tt;if(await distExports$1.enable()){const it=localStorage.getItem("lsat");if(it){localStorage.removeItem("lsat");const at=JSON.parse(it);await distExports$1.updateLsat(at.identifier,"expired")}const rt=await distExports$1.setBudget();let ot=rt==null?void 0:rt.budget;ot||(ot=(await distExports$1.authorize()).budget);try{await buyLsat(ot)}catch(at){if(at.status===402){tt=distExports.Lsat.fromHeader(at.headers.get("www-authenticate"));const st=await distExports$1.saveLsat(tt.invoice,tt.baseMacaroon,window.location.host);localStorage.setItem("lsat",JSON.stringify({macaroon:tt.baseMacaroon,identifier:tt.id,preimage:st.lsat.split(":")[1]}))}return}}localStorage.removeItem("lsat");const nt=await lib$1.requestProvider();try{await buyLsat(50)}catch(it){tt=distExports.Lsat.fromHeader(it.headers.get("www-authenticate"));const rt=await nt.sendPayment(tt.invoice);localStorage.setItem("lsat",JSON.stringify({macaroon:tt.baseMacaroon,identifier:tt.id,preimage:rt.preimage}))}}const EARTH_RADIUS=1800,EARTH_DATA_PADDING=50,dataRadius=EARTH_RADIUS+EARTH_DATA_PADDING;function getRandomLngLat(){return parseFloat((Math.random()*(180- -180)+-180).toFixed(4))}const getPointAbove=(tt,et)=>tt.clone().normalize().clone().negate().normalize().multiplyScalar(et).add(tt),getPositionFromLngLat=(tt,et,nt)=>{const it=et*Math.PI/180,rt=(tt-180)*Math.PI/180,ot=-nt*Math.cos(it)*Math.cos(rt),at=nt*Math.sin(it),st=nt*Math.cos(it)*Math.sin(rt);return new Vector3(ot,at,st)},generateEarthGraphPositions=tt=>{const et=tt.map(it=>{const{longitude:rt,latitude:ot}=it.longitude&&it.latitude?it:{longitude:getRandomLngLat(),latitude:getRandomLngLat()},at=getPositionFromLngLat(rt,ot,dataRadius);return{...it,...at}}),nt=generateLinksFromNodeData(et,!0,!0);return{nodes:et,links:nt}};function forceCenter(tt,et,nt){var it,rt=1;tt==null&&(tt=0),et==null&&(et=0),nt==null&&(nt=0);function ot(){var at,st=it.length,lt,ct=0,ut=0,ht=0;for(at=0;at=(lt=(at+st)/2))?at=lt:st=lt,it=rt,!(rt=rt[ht=+ut]))return it[ht]=ot,tt;if(ct=+tt._x.call(null,rt.data),et===ct)return ot.next=rt,it?it[ht]=ot:tt._root=ot,tt;do it=it?it[ht]=new Array(2):tt._root=new Array(2),(ut=et>=(lt=(at+st)/2))?at=lt:st=lt;while((ht=+ut)==(dt=+(ct>=lt)));return it[dt]=rt,it[ht]=ot,tt}function addAll$2(tt){Array.isArray(tt)||(tt=Array.from(tt));const et=tt.length,nt=new Float64Array(et);let it=1/0,rt=-1/0;for(let ot=0,at;otrt&&(rt=at));if(it>rt)return this;this.cover(it).cover(rt);for(let ot=0;ottt||tt>=nt;)switch(at=+(ttat||(ot=ct.x1)=ht))&&(ct=st[st.length-1],st[st.length-1]=st[st.length-1-ut],st[st.length-1-ut]=ct)}else{var dt=Math.abs(tt-+this._x.call(null,lt.data));dt=(ct=(at+st)/2))?at=ct:st=ct,et=nt,!(nt=nt[ht=+ut]))return this;if(!nt.length)break;et[ht+1&1]&&(it=et,dt=ht)}for(;nt.data!==tt;)if(rt=nt,!(nt=nt.next))return this;return(ot=nt.next)&&delete nt.next,rt?(ot?rt.next=ot:delete rt.next,this):et?(ot?et[ht]=ot:delete et[ht],(nt=et[0]||et[1])&&nt===(et[1]||et[0])&&!nt.length&&(it?it[dt]=nt:this._root=nt),this):(this._root=ot,this)}function removeAll$2(tt){for(var et=0,nt=tt.length;et=(ht=(st+ct)/2))?st=ht:ct=ht,(bt=nt>=(dt=(lt+ut)/2))?lt=dt:ut=dt,rt=ot,!(ot=ot[yt=bt<<1|gt]))return rt[yt]=at,tt;if(pt=+tt._x.call(null,ot.data),mt=+tt._y.call(null,ot.data),et===pt&&nt===mt)return at.next=ot,rt?rt[yt]=at:tt._root=at,tt;do rt=rt?rt[yt]=new Array(4):tt._root=new Array(4),(gt=et>=(ht=(st+ct)/2))?st=ht:ct=ht,(bt=nt>=(dt=(lt+ut)/2))?lt=dt:ut=dt;while((yt=bt<<1|gt)===(wt=(mt>=dt)<<1|pt>=ht));return rt[wt]=ot,rt[yt]=at,tt}function addAll$1(tt){var et,nt,it=tt.length,rt,ot,at=new Array(it),st=new Array(it),lt=1/0,ct=1/0,ut=-1/0,ht=-1/0;for(nt=0;ntut&&(ut=rt),otht&&(ht=ot));if(lt>ut||ct>ht)return this;for(this.cover(lt,ct).cover(ut,ht),nt=0;nttt||tt>=rt||it>et||et>=ot;)switch(ct=(etut||(st=mt.y0)>ht||(lt=mt.x1)=yt)<<1|tt>=bt)&&(mt=dt[dt.length-1],dt[dt.length-1]=dt[dt.length-1-gt],dt[dt.length-1-gt]=mt)}else{var wt=tt-+this._x.call(null,pt.data),vt=et-+this._y.call(null,pt.data),xt=wt*wt+vt*vt;if(xt=(dt=(at+lt)/2))?at=dt:lt=dt,(gt=ht>=(pt=(st+ct)/2))?st=pt:ct=pt,et=nt,!(nt=nt[bt=gt<<1|mt]))return this;if(!nt.length)break;(et[bt+1&3]||et[bt+2&3]||et[bt+3&3])&&(it=et,yt=bt)}for(;nt.data!==tt;)if(rt=nt,!(nt=nt.next))return this;return(ot=nt.next)&&delete nt.next,rt?(ot?rt.next=ot:delete rt.next,this):et?(ot?et[bt]=ot:delete et[bt],(nt=et[0]||et[1]||et[2]||et[3])&&nt===(et[3]||et[2]||et[1]||et[0])&&!nt.length&&(it?it[yt]=nt:this._root=nt),this):(this._root=ot,this)}function removeAll$1(tt){for(var et=0,nt=tt.length;et=(mt=(lt+ht)/2))?lt=mt:ht=mt,(St=nt>=(gt=(ct+dt)/2))?ct=gt:dt=gt,(Et=it>=(bt=(ut+pt)/2))?ut=bt:pt=bt,ot=at,!(at=at[It=Et<<2|St<<1|xt]))return ot[It]=st,tt;if(yt=+tt._x.call(null,at.data),wt=+tt._y.call(null,at.data),vt=+tt._z.call(null,at.data),et===yt&&nt===wt&&it===vt)return st.next=at,ot?ot[It]=st:tt._root=st,tt;do ot=ot?ot[It]=new Array(8):tt._root=new Array(8),(xt=et>=(mt=(lt+ht)/2))?lt=mt:ht=mt,(St=nt>=(gt=(ct+dt)/2))?ct=gt:dt=gt,(Et=it>=(bt=(ut+pt)/2))?ut=bt:pt=bt;while((It=Et<<2|St<<1|xt)===(Tt=(vt>=bt)<<2|(wt>=gt)<<1|yt>=mt));return ot[Tt]=at,ot[It]=st,tt}function addAll(tt){Array.isArray(tt)||(tt=Array.from(tt));const et=tt.length,nt=new Float64Array(et),it=new Float64Array(et),rt=new Float64Array(et);let ot=1/0,at=1/0,st=1/0,lt=-1/0,ct=-1/0,ut=-1/0;for(let ht=0,dt,pt,mt,gt;htlt&&(lt=pt),mtct&&(ct=mt),gtut&&(ut=gt));if(ot>lt||at>ct||st>ut)return this;this.cover(ot,at,st).cover(lt,ct,ut);for(let ht=0;httt||tt>=at||rt>et||et>=st||ot>nt||nt>=lt;)switch(dt=(ntmt||(ct=vt.y0)>gt||(ut=vt.z0)>bt||(ht=vt.x1)=It)<<2|(et>=Et)<<1|tt>=St)&&(vt=yt[yt.length-1],yt[yt.length-1]=yt[yt.length-1-xt],yt[yt.length-1-xt]=vt)}else{var Tt=tt-+this._x.call(null,wt.data),$t=et-+this._y.call(null,wt.data),Ut=nt-+this._z.call(null,wt.data),Lt=Tt*Tt+$t*$t+Ut*Ut;if(Lt=(gt=(at+ct)/2))?at=gt:ct=gt,(vt=pt>=(bt=(st+ut)/2))?st=bt:ut=bt,(xt=mt>=(yt=(lt+ht)/2))?lt=yt:ht=yt,et=nt,!(nt=nt[St=xt<<2|vt<<1|wt]))return this;if(!nt.length)break;(et[St+1&7]||et[St+2&7]||et[St+3&7]||et[St+4&7]||et[St+5&7]||et[St+6&7]||et[St+7&7])&&(it=et,Et=St)}for(;nt.data!==tt;)if(rt=nt,!(nt=nt.next))return this;return(ot=nt.next)&&delete nt.next,rt?(ot?rt.next=ot:delete rt.next,this):et?(ot?et[St]=ot:delete et[St],(nt=et[0]||et[1]||et[2]||et[3]||et[4]||et[5]||et[6]||et[7])&&nt===(et[7]||et[6]||et[5]||et[4]||et[3]||et[2]||et[1]||et[0])&&!nt.length&&(it?it[Et]=nt:this._root=nt),this):(this._root=ot,this)}function removeAll(tt){for(var et=0,nt=tt.length;et1&&(gt=pt.y+pt.vy),nt>2&&(bt=pt.z+pt.vz),dt.visit(xt);function xt(St,Et,It,Tt,$t,Ut,Lt){var Bt=[Et,It,Tt,$t,Ut,Lt],Pt=Bt[0],kt=Bt[1],At=Bt[2],Rt=Bt[nt],Wt=Bt[nt+1],jt=Bt[nt+2],Ot=St.data,Ct=St.r,Dt=yt+Ct;if(Ot){if(Ot.index>pt.index){var Mt=mt-Ot.x-Ot.vx,Vt=nt>1?gt-Ot.y-Ot.vy:0,Qt=nt>2?bt-Ot.z-Ot.vz:0,rn=Mt*Mt+Vt*Vt+Qt*Qt;rn1&&Vt===0&&(Vt=jiggle(rt),rn+=Vt*Vt),nt>2&&Qt===0&&(Qt=jiggle(rt),rn+=Qt*Qt),rn=(Dt-(rn=Math.sqrt(rn)))/rn*ot,pt.vx+=(Mt*=rn)*(Dt=(Ct*=Ct)/(wt+Ct)),nt>1&&(pt.vy+=(Vt*=rn)*Dt),nt>2&&(pt.vz+=(Qt*=rn)*Dt),Ot.vx-=Mt*(Dt=1-Dt),nt>1&&(Ot.vy-=Vt*Dt),nt>2&&(Ot.vz-=Qt*Dt))}return}return Pt>mt+Dt||Rt1&&(kt>gt+Dt||Wt2&&(At>bt+Dt||jtut.r&&(ut.r=ut[ht].r)}function ct(){if(et){var ut,ht=et.length,dt;for(it=new Array(ht),ut=0;uttypeof dt=="function")||Math.random,nt=ht.find(dt=>[1,2,3].includes(dt))||2,ct()},st.iterations=function(ut){return arguments.length?(at=+ut,st):at},st.strength=function(ut){return arguments.length?(ot=+ut,st):ot},st.radius=function(ut){return arguments.length?(tt=typeof ut=="function"?ut:constant$7(+ut),ct(),st):tt},st}function index$2(tt){return tt.index}function find$4(tt,et){var nt=tt.get(et);if(!nt)throw new Error("node not found: "+et);return nt}function forceLink(tt){var et=index$2,nt=dt,it,rt=constant$7(30),ot,at,st,lt,ct,ut,ht=1;tt==null&&(tt=[]);function dt(yt){return 1/Math.min(lt[yt.source.index],lt[yt.target.index])}function pt(yt){for(var wt=0,vt=tt.length;wt1&&($t=It.y+It.vy-Et.y-Et.vy||jiggle(ut)),st>2&&(Ut=It.z+It.vz-Et.z-Et.vz||jiggle(ut)),Lt=Math.sqrt(Tt*Tt+$t*$t+Ut*Ut),Lt=(Lt-ot[xt])/Lt*yt*it[xt],Tt*=Lt,$t*=Lt,Ut*=Lt,It.vx-=Tt*(Bt=ct[xt]),st>1&&(It.vy-=$t*Bt),st>2&&(It.vz-=Ut*Bt),Et.vx+=Tt*(Bt=1-Bt),st>1&&(Et.vy+=$t*Bt),st>2&&(Et.vz+=Ut*Bt)}function mt(){if(at){var yt,wt=at.length,vt=tt.length,xt=new Map(at.map((Et,It)=>[et(Et,It,at),Et])),St;for(yt=0,lt=new Array(wt);yttypeof vt=="function")||Math.random,st=wt.find(vt=>[1,2,3].includes(vt))||2,mt()},pt.links=function(yt){return arguments.length?(tt=yt,mt(),pt):tt},pt.id=function(yt){return arguments.length?(et=yt,pt):et},pt.iterations=function(yt){return arguments.length?(ht=+yt,pt):ht},pt.strength=function(yt){return arguments.length?(nt=typeof yt=="function"?yt:constant$7(+yt),gt(),pt):nt},pt.distance=function(yt){return arguments.length?(rt=typeof yt=="function"?yt:constant$7(+yt),bt(),pt):rt},pt}var noop$6={value:()=>{}};function dispatch(){for(var tt=0,et=arguments.length,nt={},it;tt=0&&(it=nt.slice(rt+1),nt=nt.slice(0,rt)),nt&&!et.hasOwnProperty(nt))throw new Error("unknown type: "+nt);return{type:nt,name:it}})}Dispatch.prototype=dispatch.prototype={constructor:Dispatch,on:function(tt,et){var nt=this._,it=parseTypenames$1(tt+"",nt),rt,ot=-1,at=it.length;if(arguments.length<2){for(;++ot0)for(var nt=new Array(rt),it=0,rt,ot;it=0&&tt._call.call(void 0,et),tt=tt._next;--frame}function wake(){clockNow=(clockLast=clock.now())+clockSkew,frame=timeout$1=0;try{timerFlush()}finally{frame=0,nap(),clockNow=0}}function poke(){var tt=clock.now(),et=tt-clockLast;et>pokeDelay&&(clockSkew-=et,clockLast=tt)}function nap(){for(var tt,et=taskHead,nt,it=1/0;et;)et._call?(it>et._time&&(it=et._time),tt=et,et=et._next):(nt=et._next,et._next=null,et=tt?tt._next=nt:taskHead=nt);taskTail=tt,sleep(it)}function sleep(tt){if(!frame){timeout$1&&(timeout$1=clearTimeout(timeout$1));var et=tt-clockNow;et>24?(tt<1/0&&(timeout$1=setTimeout(wake,tt-clock.now()-clockSkew)),interval&&(interval=clearInterval(interval))):(interval||(clockLast=clock.now(),interval=setInterval(poke,pokeDelay)),frame=1,setFrame(wake))}}function timeout(tt,et,nt){var it=new Timer$1;return et=et==null?0:+et,it.restart(rt=>{it.stop(),tt(rt+et)},et,nt),it}const a$2=1664525,c$3=1013904223,m$2=4294967296;function lcg(){let tt=1;return()=>(tt=(a$2*tt+c$3)%m$2)/m$2}var MAX_DIMENSIONS=3;function x$2(tt){return tt.x}function y$2(tt){return tt.y}function z$1(tt){return tt.z}var initialRadius=10,initialAngleRoll=Math.PI*(3-Math.sqrt(5)),initialAngleYaw=Math.PI*20/(9+Math.sqrt(221));function forceSimulation(tt,et){et=et||2;var nt=Math.min(MAX_DIMENSIONS,Math.max(1,Math.round(et))),it,rt=1,ot=.001,at=1-Math.pow(ot,1/300),st=0,lt=.6,ct=new Map,ut=timer$1(pt),ht=dispatch("tick","end"),dt=lcg();tt==null&&(tt=[]);function pt(){mt(),ht.call("tick",it),rt1&&(xt.fy==null?xt.y+=xt.vy*=lt:(xt.y=xt.fy,xt.vy=0)),nt>2&&(xt.fz==null?xt.z+=xt.vz*=lt:(xt.z=xt.fz,xt.vz=0));return it}function gt(){for(var yt=0,wt=tt.length,vt;yt1&&isNaN(vt.y)||nt>2&&isNaN(vt.z)){var xt=initialRadius*(nt>2?Math.cbrt(.5+yt):nt>1?Math.sqrt(.5+yt):yt),St=yt*initialAngleRoll,Et=yt*initialAngleYaw;nt===1?vt.x=xt:nt===2?(vt.x=xt*Math.cos(St),vt.y=xt*Math.sin(St)):(vt.x=xt*Math.sin(St)*Math.cos(Et),vt.y=xt*Math.cos(St),vt.z=xt*Math.sin(St)*Math.sin(Et))}(isNaN(vt.vx)||nt>1&&isNaN(vt.vy)||nt>2&&isNaN(vt.vz))&&(vt.vx=0,nt>1&&(vt.vy=0),nt>2&&(vt.vz=0))}}function bt(yt){return yt.initialize&&yt.initialize(tt,dt,nt),yt}return gt(),it={tick:mt,restart:function(){return ut.restart(pt),it},stop:function(){return ut.stop(),it},numDimensions:function(yt){return arguments.length?(nt=Math.min(MAX_DIMENSIONS,Math.max(1,Math.round(yt))),ct.forEach(bt),it):nt},nodes:function(yt){return arguments.length?(tt=yt,gt(),ct.forEach(bt),it):tt},alpha:function(yt){return arguments.length?(rt=+yt,it):rt},alphaMin:function(yt){return arguments.length?(ot=+yt,it):ot},alphaDecay:function(yt){return arguments.length?(at=+yt,it):+at},alphaTarget:function(yt){return arguments.length?(st=+yt,it):st},velocityDecay:function(yt){return arguments.length?(lt=1-yt,it):1-lt},randomSource:function(yt){return arguments.length?(dt=yt,ct.forEach(bt),it):dt},force:function(yt,wt){return arguments.length>1?(wt==null?ct.delete(yt):ct.set(yt,bt(wt)),it):ct.get(yt)},find:function(){var yt=Array.prototype.slice.call(arguments),wt=yt.shift()||0,vt=(nt>1?yt.shift():null)||0,xt=(nt>2?yt.shift():null)||0,St=yt.shift()||1/0,Et=0,It=tt.length,Tt,$t,Ut,Lt,Bt,Pt;for(St*=St,Et=0;Et1?(ht.on(yt,wt),it):ht.on(yt)}}}function forceManyBody(){var tt,et,nt,it,rt,ot=constant$7(-30),at,st=1,lt=1/0,ct=.81;function ut(mt){var gt,bt=tt.length,yt=(et===1?binarytree(tt,x$2):et===2?quadtree(tt,x$2,y$2):et===3?octree(tt,x$2,y$2,z$1):null).visitAfter(dt);for(rt=mt,gt=0;gt1&&(mt.y=xt/wt),et>2&&(mt.z=St/wt)}else{bt=mt,bt.x=bt.data.x,et>1&&(bt.y=bt.data.y),et>2&&(bt.z=bt.data.z);do gt+=at[bt.data.index];while(bt=bt.next)}mt.value=gt}function pt(mt,gt,bt,yt,wt){if(!mt.value)return!0;var vt=[bt,yt,wt][et-1],xt=mt.x-nt.x,St=et>1?mt.y-nt.y:0,Et=et>2?mt.z-nt.z:0,It=vt-gt,Tt=xt*xt+St*St+Et*Et;if(It*It/ct1&&St===0&&(St=jiggle(it),Tt+=St*St),et>2&&Et===0&&(Et=jiggle(it),Tt+=Et*Et),Tt1&&(nt.vy+=St*mt.value*rt/Tt),et>2&&(nt.vz+=Et*mt.value*rt/Tt)),!0;if(mt.length||Tt>=lt)return;(mt.data!==nt||mt.next)&&(xt===0&&(xt=jiggle(it),Tt+=xt*xt),et>1&&St===0&&(St=jiggle(it),Tt+=St*St),et>2&&Et===0&&(Et=jiggle(it),Tt+=Et*Et),Tt1&&(nt.vy+=St*It),et>2&&(nt.vz+=Et*It));while(mt=mt.next)}return ut.initialize=function(mt,...gt){tt=mt,it=gt.find(bt=>typeof bt=="function")||Math.random,et=gt.find(bt=>[1,2,3].includes(bt))||2,ht()},ut.strength=function(mt){return arguments.length?(ot=typeof mt=="function"?mt:constant$7(+mt),ht(),ut):ot},ut.distanceMin=function(mt){return arguments.length?(st=mt*mt,ut):Math.sqrt(st)},ut.distanceMax=function(mt){return arguments.length?(lt=mt*mt,ut):Math.sqrt(lt)},ut.theta=function(mt){return arguments.length?(ct=mt*mt,ut):Math.sqrt(ct)},ut}const simulation=forceSimulation().stop(),defaults$1={numDimensions:3,velocityDecay:.9,forceChargeStrength:-20,forceChargeMinDistance:10,forceChargeMaxDistance:8e3,forceLinkStrength:.04,forceCenterStrength:.85,disableCollide:!1,disableCenter:!1,disableLink:!1,disableCharge:!1,forceCollideRadiusMethod:tt=>(tt.scale||1)*6+200,forceLinkDistanceMethod:tt=>{const et=tt.source.node_type;let nt=50;switch(et){case"topic":nt=30;break;case"guest":nt=30;break;case"clip":nt=10;break;case"episode":nt=15;break}return nt*2}},runForceSimulation=(tt,et,{numDimensions:nt=defaults$1.numDimensions,velocityDecay:it=defaults$1.velocityDecay,forceChargeStrength:rt=defaults$1.forceChargeStrength,forceChargeMinDistance:ot=defaults$1.forceChargeMinDistance,forceChargeMaxDistance:at=defaults$1.forceChargeMaxDistance,forceLinkStrength:st=defaults$1.forceLinkStrength,forceCenterStrength:lt=defaults$1.forceCenterStrength,forceLinkDistanceMethod:ct=defaults$1.forceLinkDistanceMethod,forceCollideRadiusMethod:ut=defaults$1.forceCollideRadiusMethod,disableCollide:ht=defaults$1.disableCollide,disableCenter:dt=defaults$1.disableCenter,disableLink:pt=defaults$1.disableLink,disableCharge:mt=defaults$1.disableCharge})=>(simulation.alpha(1).stop().numDimensions(nt).velocityDecay(it).force("collide",ht?null:forceCollide().radius(ut).iterations(1)).force("center",dt?null:forceCenter().strength(lt)).force("charge",mt?null:forceManyBody().strength(rt).distanceMin(ot).distanceMax(at)).nodes(tt).force("link",pt?null:forceLink().distance(ct).strength(st).id(gt=>gt.id).links(et.filter(gt=>!gt.onlyVisibleOnSelect))).alpha(1).restart(),simulation),simulationTicks$1=60,collisionTicks$1=20,runSimulationPhase$1=tt=>{for(let et=0;et{tt.force("collide",forceCollide().radius(et=>(et.scale||1)*20).iterations(1));for(let et=0;et{const et=tt.map(ot=>({...ot,x:0,y:0,z:0})),nt=generateLinksFromNodeData(et,!1,!1),it=runForceSimulation(et,nt,{numDimensions:3,forceLinkStrength:.5,forceChargeStrength:-40,forceCenterStrength:.3,velocityDecay:.5});runSimulationPhase$1(it),runCollisionPhase$1(it),it.stop();const rt=nt.map(ot=>{const at=et.find(ht=>ht.ref_id===ot.sourceRef),st=et.find(ht=>ht.ref_id===ot.targetRef),lt=["guest","topic"].some(ht=>ht===(at==null?void 0:at.node_type)||ht===(st==null?void 0:st.node_type)),ct=new Vector3((at==null?void 0:at.x)||0,(at==null?void 0:at.y)||0,(at==null?void 0:at.z)||0),ut=new Vector3((st==null?void 0:st.x)||0,(st==null?void 0:st.y)||0,(st==null?void 0:st.z)||0);return{...ot,onlyVisibleOnSelect:lt,sourcePosition:ct,targetPosition:ut}});return{nodes:et,links:rt}},sortAB=(tt,et,nt)=>{let it=-2;return tt===nt&&et===nt?it=0:tt===nt&&et!==nt?it=-1:tt!==nt&&et===nt&&(it=1),it},sortNodesByHierarchy=tt=>tt.map(nt=>nt).sort((nt,it)=>{let rt=0;return nt.node_type==="show"||it.node_type==="show"?rt=sortAB(nt.node_type,it.node_type,"show"):nt.node_type==="episode"||it.node_type==="episode"?rt=sortAB(nt.node_type,it.node_type,"episode"):nt.node_type==="clip"||it.node_type==="clip"?rt=sortAB(nt.node_type,it.node_type,"clip"):nt.node_type!=="guest"&&it.node_type==="guest"?rt=sortAB(nt.node_type,it.node_type,"guest"):rt=0,rt});function getMyParents(tt,et){const{ref_id:nt}=tt;return!nt||!et?[]:et.filter(rt=>{var ot;return(ot=rt.children)==null?void 0:ot.includes(nt)})}function getMyChildren(tt,et){return et.filter(it=>it.ref_id&&tt.includes(it.ref_id))}const simulationTicks=60,collisionTicks=20,universeScale$1=5e3,universeCube={scale:universeScale$1/2,position:{x:0,y:0,z:0}};function generateNodePosition$1(tt,et){const{scale:nt,position:it}=universeCube,rt={x:it.x+Math.random()*nt-nt*.5,y:it.y+Math.random()*nt-nt*.5,z:it.z+Math.random()*nt-nt*.5},ot=getMyParents(tt,et),at=ot!=null&&ot.length?new Vector3(ot[0].x,ot[0].y,ot[0].z):null;return at&&(rt.x=at.x,rt.y=at.y,rt.z=at.z),new Vector3(rt.x,rt.y,rt.z)}const runSimulationPhase=tt=>{for(let et=0;et{tt.force("collide",forceCollide().radius(et=>(et.scale||1)*20).iterations(1));for(let et=0;et{const et=[],nt=tt.map(at=>{const st=generateNodePosition$1(at,et),lt={...at,...st};return et.push(lt),lt}),it=generateLinksFromNodeData(nt,!0,!0),rt=runForceSimulation(nt,it,{numDimensions:3,forceLinkStrength:.01,forceChargeStrength:-80,velocityDecay:.5,disableCenter:!0,disableCharge:!0});runSimulationPhase(rt),runCollisionPhase(rt),rt.stop();const ot=it.map(at=>{const st=nt.find(dt=>dt.ref_id===at.sourceRef),lt=nt.find(dt=>dt.ref_id===at.targetRef),ct=new Vector3((st==null?void 0:st.x)||0,(st==null?void 0:st.y)||0,(st==null?void 0:st.z)||0),ut=new Vector3((lt==null?void 0:lt.x)||0,(lt==null?void 0:lt.y)||0,(lt==null?void 0:lt.z)||0);return{...at,onlyVisibleOnSelect:!0,sourcePosition:ct,targetPosition:ut}});return{nodes:nt,links:ot}},universeScale=5e3,padding$1=300,guestCube={scale:universeScale/2,position:{x:0,y:0,z:universeScale/2+padding$1}},topicCube={scale:universeScale/2,position:{x:0,y:0,z:-(universeScale/2+padding$1)}},dataCube={scale:universeScale/2,position:{x:0,y:0,z:0}};function generateGuestNodePosition(){const{scale:tt,position:et}=guestCube,nt={x:et.x+Math.random()*tt-tt*.5,y:et.y+Math.random()*tt-tt*.5,z:et.z+Math.random()*tt-tt*.5},it=1,rt=10;return new Vector3(nt.x+it*rt,nt.y+it*rt,nt.z+it*rt)}function generateTopicNodePosition(){const{scale:tt,position:et}=topicCube,nt={x:et.x+Math.random()*tt-tt*.5,y:et.y+Math.random()*tt-tt*.5,z:et.z+Math.random()*tt-tt*.5},it=1,rt=10;return new Vector3(nt.x+it*rt,nt.y+it*rt,nt.z+it*rt)}function generateNearbyPosition(tt,et,nt=1){let rt=0,ot=10*1;const at=0;switch(et){case"episode":ot+=50*(nt||0);break;case"clip":ot=0,rt+=50*(nt||0);break}const st=new Vector3;return st.x=tt.x+rt,st.y=tt.y+ot,st.z=tt.z+at,st}function generateNodePosition(tt,et,nt){const{ref_id:it}=tt,{scale:rt,position:ot}=dataCube,at={x:ot.x+Math.random()*rt-rt*.5,y:ot.y+Math.random()*rt-rt*.5,z:ot.z+Math.random()*rt-rt*.5},st=getMyParents(tt,nt);let lt=null;if(st!=null&&st.length){const ht=st[0],pt=getMyChildren(ht.children||[],et).findIndex(mt=>mt.ref_id===it);lt=generateNearbyPosition(new Vector3(ht.x,ht.y,ht.z),tt.node_type,pt+1)}lt&&(at.x=lt.x,at.y=lt.y,at.z=lt.z);const ct=1,ut=1;return new Vector3(at.x+ct*ut,at.y+ct*ut,at.z+ct*ut)}const generateSplitGraphPositions=tt=>{const et=sortNodesByHierarchy(tt),nt=[],it=et.map(at=>{let st=new Vector3(0,0,0);switch(at.node_type){case"guest":st=generateGuestNodePosition();break;case"topic":st=generateTopicNodePosition();break;case"data_series":st=generateNodePosition({},et,nt);break;default:st=generateNodePosition(at,et,nt);break}const lt={...at,...st};return nt.push(lt),lt}),ot=generateLinksFromNodeData(it,!0,!0).map(at=>{const st=it.find(dt=>dt.ref_id===at.sourceRef),lt=it.find(dt=>dt.ref_id===at.targetRef);let ct=!1;((st==null?void 0:st.node_type)==="guest"||(st==null?void 0:st.node_type)==="topic"||(lt==null?void 0:lt.node_type)==="guest"||(lt==null?void 0:lt.node_type)==="topic")&&(ct=!0);const ut=new Vector3((st==null?void 0:st.x)||0,(st==null?void 0:st.y)||0,(st==null?void 0:st.z)||0),ht=new Vector3((lt==null?void 0:lt.x)||0,(lt==null?void 0:lt.y)||0,(lt==null?void 0:lt.z)||0);return{...at,onlyVisibleOnSelect:ct,sourcePosition:ut,targetPosition:ht}});return it.sort((at,st)=>(st.weight||0)-(at.weight||0)),{nodes:it,links:ot}},getGraphDataPositions=(tt,et)=>tt==="split"?generateSplitGraphPositions(et):tt==="sphere"?generateSphereGraphPositions(et):tt==="earth"?generateEarthGraphPositions(et):generateForceGraphPositions(et),defaultData$9={links:[],nodes:[]},maxScale=26,fetchGraphData=async(tt,et)=>{try{return getGraphData(tt,et)}catch{return defaultData$9}},fetchNodes=async tt=>{if(!tt)try{return await api$1.get("/prediction/content/latest")}catch(nt){return console.error(nt),mock}if(isDevelopment||isE2E)return await api$1.get(`/v2/search?word=${tt}&free=true`);const et=await getLSat();try{return await api$1.get(`/v2/search?word=${tt}`,{Authorization:et})}catch(nt){if(nt.status===402)return await payLsat(),fetchNodes(tt);throw nt}},getTrends=async()=>{const tt="/get_trends";return await api$1.get(tt)},getSentimentData=async tt=>{const et=tt&&new URLSearchParams(tt),nt=et?`/sentiments?${et.toString()}`:"/sentiments";if(isE2E)return await api$1.get(nt);const it=await getLSat();try{return await api$1.get(nt,{Authorization:it})}catch(rt){if(rt.status===402)return await payLsat(),getSentimentData(tt);throw rt}},postAskQuestion=async tt=>{const et=await getLSat();try{await api$1.post("/ask_question",JSON.stringify(tt),{Authorization:et})}catch(nt){if(nt.status===402){await payLsat(),await postAskQuestion(tt);return}throw nt}},getNodeScale=tt=>{switch(tt.node_type){case"guest":case"episode":case"document":return 2;case"show":return 3;default:return 1.5}};function generateTopicNodesFromMap(tt,et){Object.entries(tt).forEach(([nt,it],rt)=>{const{children:ot,position:at}=it,{x:st,y:lt,z:ct}=at,ut=ot.length*2>maxScale?maxScale:ot.length*2,ht=`topic_node_${rt}`;et({x:st,y:lt,z:ct,children:ot,colors:["#000"],id:ht,label:nt,name:nt,type:"topic",node_type:"topic",ref_id:ht,scale:ut,show_title:nt,text:nt,weight:0})})}function generateGuestNodesFromMap(tt,et){Object.entries(tt).forEach(([nt,it],rt)=>{const ot=it.children,at=ot.length*2>maxScale?maxScale:ot.length*2,st=nt||`guestnode_${rt}`,lt={...it,x:0,y:0,z:0,colors:["#000"],id:st,image_url:it.imageUrl,label:it.name,name:it.name,node_type:"guest",ref_id:st,scale:at,show_title:it.name,text:it.twitterHandle,type:"guest",weight:0};et(lt)})}const generateGuestsMap=(tt,et,nt={})=>{var rt;let it={...nt};return tt.name&&tt.ref_id&&et&&(it={...it,[tt.ref_id]:{children:[...((rt=it[tt.ref_id])==null?void 0:rt.children)||[],et],imageUrl:tt.profile_picture||"",name:tt.name,twitterHandle:tt.twitter_handle}}),it},getGraphData=async(tt,et)=>{try{const nt=await fetchNodes(tt);return formatFetchNodes(nt,tt,et)}catch(nt){return console.error(nt),defaultData$9}},getSegmentColor=(tt,et)=>tt==="topic"||et==="topic"?NODE_RELATIVE_HIGHLIGHT_COLORS.topics.segmentColor:tt==="guest"||et==="guest"?NODE_RELATIVE_HIGHLIGHT_COLORS.guests.segmentColor:NODE_RELATIVE_HIGHLIGHT_COLORS.children.segmentColor,generateLinksFromNodeData=(tt,et,nt)=>{const it=[];return tt.forEach(rt=>{const{children:ot,guests:at}=rt;ot==null||ot.forEach(st=>{if(rt.ref_id){const lt=tt.find(ht=>ht.ref_id===st)||null;if(!lt)return;const ct=new Vector3(rt.x||0,rt.y||0,rt.z||0),ut=new Vector3((lt==null?void 0:lt.x)||0,(lt==null?void 0:lt.y)||0,(lt==null?void 0:lt.z)||0);it.push({onlyVisibleOnSelect:et,color:getSegmentColor(rt.node_type,(lt==null?void 0:lt.node_type)||""),source:rt.ref_id,sourceRef:rt.ref_id,sourcePosition:ct,target:st,targetRef:st,targetPosition:ut})}}),at==null||at.forEach(st=>{if(st&&typeof st!="string"&&rt.ref_id){const lt=tt.find(ht=>ht.ref_id===(st==null?void 0:st.ref_id))||null;if(!lt)return;const ct=new Vector3(rt.x||0,rt.y||0,rt.z||0),ut=new Vector3((lt==null?void 0:lt.x)||0,(lt==null?void 0:lt.y)||0,(lt==null?void 0:lt.z)||0);it.push({onlyVisibleOnSelect:nt,color:getSegmentColor(rt.node_type,"guest"),source:rt.ref_id,sourceRef:rt.ref_id,sourcePosition:ct,target:st==null?void 0:st.ref_id,targetRef:st==null?void 0:st.ref_id,targetPosition:ut})}})}),it},formatFetchNodes=(tt,et,nt)=>{let it=[];const rt={};let ot={};const at=Array.isArray(tt.data_series)?tt.data_series:[],st=[...tt.exact,...tt.related,...at];let lt=0;st.length&&st.forEach((dt,pt)=>{var bt;if(dt.weight&<yt.ref_id===dt.ref_id))return;const gt=(bt=dt.image_url)==null?void 0:bt.replace(AWS_IMAGE_BUCKET_URL,CLOUDFRONT_IMAGE_BUCKET_URL).replace(".jpg","_s.jpg");it.push({...dt,scale:getNodeScale(dt),id:dt.ref_id||dt.id,image_url:gt,type:dt.type||dt.node_type}),dt.node_type==="episode"&&dt.ref_id&&(dt.guests||[]).forEach(wt=>{const xt=generateGuestsMap(wt,dt.ref_id,ot);ot={...ot,...xt}})}),generateGuestNodesFromMap(ot,dt=>{it.push(dt)}),st.forEach(dt=>{const{topics:pt,ref_id:mt,show_title:gt}=dt;pt&&pt.forEach(bt=>{if(bt===et)return;const yt=mt||gt;yt&&(rt[bt]&&!rt[bt].children.includes(yt)?rt[bt].children.push(yt):rt[bt]={position:new Vector3(0,0,0),children:[yt]})})}),generateTopicNodesFromMap(rt,dt=>{it.push(dt)});const ct=getGraphDataPositions(nt,it),{links:ut}=ct;it=ct.nodes,it.sort((dt,pt)=>(pt.weight||0)-(dt.weight||0));const ht=getMaxSuperficialWeightPerNodeType(it,ut);return it=addWeightNormalizationToNodes(lt,ht,it,ut),{links:ut,nodes:it}},addWeightNormalizationToNodes=(tt,et,nt,it)=>nt.map(rt=>{let ot=(rt.weight||0)/tt;return!rt.weight&&et[rt.node_type]&&(ot=getSuperficialNodeWeight(rt,it)/et[rt.node_type]),{...rt,weight:ot}}),defaultData$8={isAdmin:!1,pubKey:"",budget:0,nodeCount:0,tribeHost:"",tribeUuid:""},useUserStore=react(tt=>({...defaultData$8,setIsAdmin:et=>tt({isAdmin:et}),setPubKey:et=>tt({pubKey:et}),setBudget:et=>tt({budget:et}),setNodeCount:et=>tt(nt=>et==="INCREMENT"?{nodeCount:nt.nodeCount+1}:{nodeCount:0}),setTribeUuid:et=>tt({tribeUuid:et}),setTribeHost:et=>tt({tribeHost:et})})),executeIfTetsRunning=tt=>{isE2E&&tt()};function executeIfProd(tt){return isDevelopment||isE2E?null:tt()}function addToGlobalForE2e(tt,et){executeIfTetsRunning(()=>{window.e2e||(window.e2e={}),window.e2e[et]=tt})}const E2E=()=>{const tt=useUserStore();return reactExports.useEffect(()=>{isE2E&&addToGlobalForE2e(tt,"userStore")},[tt]),jsxRuntimeExports.jsx("div",{id:"e2e-check"})},E2ETests=reactExports.memo(()=>isE2E?jsxRuntimeExports.jsx(E2E,{}):null),saveConsumedContent=async tt=>{await executeIfProd(async()=>{try{await distExports$1.saveGraphData({metaData:{date:Math.floor(new Date().getTime()/1e3),...tt},type:"second_brain_consumed_content"})}catch(et){console.warn(et)}})},saveSearchTerm=async()=>{await executeIfProd(async()=>{await distExports$1.enable(!0)||console.log("Sphinx enable failed, means no pubkey and no budget (including budget of 0)")})},graphStyles=["split","force","sphere","earth"],defaultData$7={categoryFilter:null,data:null,selectionGraphData:{nodes:[],links:[]},scrollEventsDisabled:!1,disableCameraRotation:!1,graphRadius:isChileGraph?1600:3056,graphStyle:localStorage.getItem("graphStyle")||"split",isFetching:!1,isTimestampLoaded:!1,queuedSources:null,hoveredNode:null,selectedNode:null,selectedTimestamp:null,sources:null,sphinxModalIsOpen:!1,cameraFocusTrigger:!1,selectedNodeRelativeIds:[],nearbyNodeIds:[],showSelectionGraph:!1,showTeachMe:!1,hideNodeDetails:!1,sidebarFilter:"all",trendingTopics:[]},useDataStore=react((tt,et)=>({...defaultData$7,fetchData:async nt=>{if(et().isFetching)return;tt({isFetching:!0,sphinxModalIsOpen:!0});const it=await fetchGraphData(nt||"",et().graphStyle);nt&&await saveSearchTerm(),tt({data:it,isFetching:!1,sphinxModalIsOpen:!1,disableCameraRotation:!1,nearbyNodeIds:[],selectedNodeRelativeIds:[],showSelectionGraph:!1,showTeachMe:!1})},setTrendingTopics:nt=>tt({trendingTopics:nt}),setIsFetching:nt=>tt({isFetching:nt}),setData:nt=>tt({data:nt}),setSelectionData:nt=>tt({selectionGraphData:nt}),setScrollEventsDisabled:nt=>tt({scrollEventsDisabled:nt}),setCategoryFilter:nt=>tt({categoryFilter:nt}),setDisableCameraRotation:nt=>tt({disableCameraRotation:nt}),setGraphRadius:nt=>tt({graphRadius:nt}),setGraphStyle:nt=>tt({graphStyle:nt}),setQueuedSources:nt=>tt({queuedSources:nt}),setHoveredNode:nt=>tt({hoveredNode:nt}),setSelectedNode:nt=>{const it=et().selectedNode;if((it==null?void 0:it.ref_id)!==(nt==null?void 0:nt.ref_id)){const{data:rt}=et(),ot=(rt==null?void 0:rt.nodes.filter(at=>at.ref_id&&nodesAreRelatives(at,nt)).map(at=>(at==null?void 0:at.ref_id)||""))||[];tt({hoveredNode:null,isTimestampLoaded:!1,selectedNode:nt,disableCameraRotation:!0,selectedNodeRelativeIds:ot})}},setSidebarFilter:nt=>tt({sidebarFilter:nt}),setSelectedTimestamp:nt=>tt({selectedTimestamp:nt}),setSources:nt=>tt({sources:nt}),setSphinxModalOpen:nt=>tt({sphinxModalIsOpen:nt}),setCameraFocusTrigger:nt=>tt({cameraFocusTrigger:nt}),setNearbyNodeIds:nt=>{const it=et().nearbyNodeIds;(nt.length!==it.length||nt[0]!==it[0])&&tt({nearbyNodeIds:nt})},setShowSelectionGraph:nt=>tt({showSelectionGraph:nt}),setHideNodeDetails:nt=>tt({hideNodeDetails:nt}),setTeachMe:nt=>tt({showTeachMe:nt})})),useSelectedNode=()=>useDataStore(tt=>tt.selectedNode),useFilteredNodes=()=>useDataStore(tt=>{var et;return(((et=tt.data)==null?void 0:et.nodes)||[]).filter(nt=>tt.sidebarFilter==="all"?!0:nt.node_type===tt.sidebarFilter)}),common={black:"#000",white:"#fff"},common$1=common,red={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},red$1=red,purple={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},purple$1=purple,blue={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},blue$1=blue,lightBlue={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},lightBlue$1=lightBlue,green={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},green$1=green,orange={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},orange$1=orange,grey={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},grey$1=grey;function isPlainObject$4(tt){return tt!==null&&typeof tt=="object"&&tt.constructor===Object}function deepClone(tt){if(!isPlainObject$4(tt))return tt;const et={};return Object.keys(tt).forEach(nt=>{et[nt]=deepClone(tt[nt])}),et}function deepmerge$1(tt,et,nt={clone:!0}){const it=nt.clone?_extends$u({},tt):tt;return isPlainObject$4(tt)&&isPlainObject$4(et)&&Object.keys(et).forEach(rt=>{rt!=="__proto__"&&(isPlainObject$4(et[rt])&&rt in tt&&isPlainObject$4(tt[rt])?it[rt]=deepmerge$1(tt[rt],et[rt],nt):nt.clone?it[rt]=isPlainObject$4(et[rt])?deepClone(et[rt]):et[rt]:it[rt]=et[rt])}),it}function formatMuiErrorMessage(tt){let et="https://mui.com/production-error/?code="+tt;for(let nt=1;ntnt==null?et:function(...rt){et.apply(this,rt),nt.apply(this,rt)},()=>{})}function debounce$4(tt,et=166){let nt;function it(...rt){const ot=()=>{tt.apply(this,rt)};clearTimeout(nt),nt=setTimeout(ot,et)}return it.clear=()=>{clearTimeout(nt)},it}function isMuiElement(tt,et){var nt,it;return reactExports.isValidElement(tt)&&et.indexOf((nt=tt.type.muiName)!=null?nt:(it=tt.type)==null||(it=it._payload)==null||(it=it.value)==null?void 0:it.muiName)!==-1}function ownerDocument(tt){return tt&&tt.ownerDocument||document}function ownerWindow(tt){return ownerDocument(tt).defaultView||window}function setRef(tt,et){typeof tt=="function"?tt(et):tt&&(tt.current=et)}const useEnhancedEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,useEnhancedEffect$1=useEnhancedEffect;let globalId=0;function useGlobalId(tt){const[et,nt]=reactExports.useState(tt),it=tt||et;return reactExports.useEffect(()=>{et==null&&(globalId+=1,nt(`mui-${globalId}`))},[et]),it}const maybeReactUseId=React$2["useId".toString()];function useId(tt){if(maybeReactUseId!==void 0){const et=maybeReactUseId();return tt??et}return useGlobalId(tt)}function useControlled({controlled:tt,default:et,name:nt,state:it="value"}){const{current:rt}=reactExports.useRef(tt!==void 0),[ot,at]=reactExports.useState(et),st=rt?tt:ot,lt=reactExports.useCallback(ct=>{rt||at(ct)},[]);return[st,lt]}function useEventCallback(tt){const et=reactExports.useRef(tt);return useEnhancedEffect$1(()=>{et.current=tt}),reactExports.useRef((...nt)=>(0,et.current)(...nt)).current}function useForkRef(...tt){return reactExports.useMemo(()=>tt.every(et=>et==null)?null:et=>{tt.forEach(nt=>{setRef(nt,et)})},tt)}let hadKeyboardEvent=!0,hadFocusVisibleRecently=!1,hadFocusVisibleRecentlyTimeout;const inputTypesWhitelist={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 focusTriggersKeyboardModality(tt){const{type:et,tagName:nt}=tt;return!!(nt==="INPUT"&&inputTypesWhitelist[et]&&!tt.readOnly||nt==="TEXTAREA"&&!tt.readOnly||tt.isContentEditable)}function handleKeyDown(tt){tt.metaKey||tt.altKey||tt.ctrlKey||(hadKeyboardEvent=!0)}function handlePointerDown$1(){hadKeyboardEvent=!1}function handleVisibilityChange(){this.visibilityState==="hidden"&&hadFocusVisibleRecently&&(hadKeyboardEvent=!0)}function prepare$1(tt){tt.addEventListener("keydown",handleKeyDown,!0),tt.addEventListener("mousedown",handlePointerDown$1,!0),tt.addEventListener("pointerdown",handlePointerDown$1,!0),tt.addEventListener("touchstart",handlePointerDown$1,!0),tt.addEventListener("visibilitychange",handleVisibilityChange,!0)}function isFocusVisible(tt){const{target:et}=tt;try{return et.matches(":focus-visible")}catch{}return hadKeyboardEvent||focusTriggersKeyboardModality(et)}function useIsFocusVisible(){const tt=reactExports.useCallback(rt=>{rt!=null&&prepare$1(rt.ownerDocument)},[]),et=reactExports.useRef(!1);function nt(){return et.current?(hadFocusVisibleRecently=!0,window.clearTimeout(hadFocusVisibleRecentlyTimeout),hadFocusVisibleRecentlyTimeout=window.setTimeout(()=>{hadFocusVisibleRecently=!1},100),et.current=!1,!0):!1}function it(rt){return isFocusVisible(rt)?(et.current=!0,!0):!1}return{isFocusVisibleRef:et,onFocus:it,onBlur:nt,ref:tt}}function getScrollbarSize(tt){const et=tt.documentElement.clientWidth;return Math.abs(window.innerWidth-et)}let cachedType;function detectScrollType(){if(cachedType)return cachedType;const tt=document.createElement("div"),et=document.createElement("div");return et.style.width="10px",et.style.height="1px",tt.appendChild(et),tt.dir="rtl",tt.style.fontSize="14px",tt.style.width="4px",tt.style.height="1px",tt.style.position="absolute",tt.style.top="-1000px",tt.style.overflow="scroll",document.body.appendChild(tt),cachedType="reverse",tt.scrollLeft>0?cachedType="default":(tt.scrollLeft=1,tt.scrollLeft===0&&(cachedType="negative")),document.body.removeChild(tt),cachedType}function getNormalizedScrollLeft(tt,et){const nt=tt.scrollLeft;if(et!=="rtl")return nt;switch(detectScrollType()){case"negative":return tt.scrollWidth-tt.clientWidth+nt;case"reverse":return tt.scrollWidth-tt.clientWidth-nt;default:return nt}}const visuallyHidden={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},visuallyHidden$1=visuallyHidden;function resolveProps(tt,et){const nt=_extends$u({},et);return Object.keys(tt).forEach(it=>{if(it.toString().match(/^(components|slots)$/))nt[it]=_extends$u({},tt[it],nt[it]);else if(it.toString().match(/^(componentsProps|slotProps)$/)){const rt=tt[it]||{},ot=et[it];nt[it]={},!ot||!Object.keys(ot)?nt[it]=rt:!rt||!Object.keys(rt)?nt[it]=ot:(nt[it]=_extends$u({},ot),Object.keys(rt).forEach(at=>{nt[it][at]=resolveProps(rt[at],ot[at])}))}else nt[it]===void 0&&(nt[it]=tt[it])}),nt}function composeClasses(tt,et,nt=void 0){const it={};return Object.keys(tt).forEach(rt=>{it[rt]=tt[rt].reduce((ot,at)=>{if(at){const st=et(at);st!==""&&ot.push(st),nt&&nt[at]&&ot.push(nt[at])}return ot},[]).join(" ")}),it}const defaultGenerator=tt=>tt,createClassNameGenerator=()=>{let tt=defaultGenerator;return{configure(et){tt=et},generate(et){return tt(et)},reset(){tt=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator(),ClassNameGenerator$1=ClassNameGenerator,globalStateClassesMapping={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function generateUtilityClass(tt,et,nt="Mui"){const it=globalStateClassesMapping[et];return it?`${nt}-${it}`:`${ClassNameGenerator$1.generate(tt)}-${et}`}function generateUtilityClasses(tt,et,nt="Mui"){const it={};return et.forEach(rt=>{it[rt]=generateUtilityClass(tt,rt,nt)}),it}const THEME_ID="$$material";function _objectWithoutPropertiesLoose$m(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function sheetForTag(tt){if(tt.sheet)return tt.sheet;for(var et=0;et0?charat(characters,--position$2):0,column--,character===10&&(column=1,line--),character}function next(){return character=position$22||token(character)>3?"":" "}function escaping(tt,et){for(;--et&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(tt,caret()+(et<6&&peek()==32&&next()==32))}function delimiter(tt){for(;next();)switch(character){case tt:return position$2;case 34:case 39:tt!==34&&tt!==39&&delimiter(character);break;case 40:tt===41&&delimiter(tt);break;case 92:next();break}return position$2}function commenter(tt,et){for(;next()&&tt+character!==47+10;)if(tt+character===42+42&&peek()===47)break;return"/*"+slice(et,position$2-1)+"*"+from(tt===47?tt:next())}function identifier(tt){for(;!token(peek());)next();return slice(tt,position$2)}function compile(tt){return dealloc(parse$3("",null,null,null,[""],tt=alloc(tt),0,[0],tt))}function parse$3(tt,et,nt,it,rt,ot,at,st,lt){for(var ct=0,ut=0,ht=at,dt=0,pt=0,mt=0,gt=1,bt=1,yt=1,wt=0,vt="",xt=rt,St=ot,Et=it,It=vt;bt;)switch(mt=wt,wt=next()){case 40:if(mt!=108&&charat(It,ht-1)==58){indexof(It+=replace(delimit(wt),"&","&\f"),"&\f")!=-1&&(yt=-1);break}case 34:case 39:case 91:It+=delimit(wt);break;case 9:case 10:case 13:case 32:It+=whitespace$1(mt);break;case 92:It+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append$1(comment(commenter(next(),caret()),et,nt),lt);break;default:It+="/"}break;case 123*gt:st[ct++]=strlen(It)*yt;case 125*gt:case 59:case 0:switch(wt){case 0:case 125:bt=0;case 59+ut:yt==-1&&(It=replace(It,/\f/g,"")),pt>0&&strlen(It)-ht&&append$1(pt>32?declaration(It+";",it,nt,ht-1):declaration(replace(It," ","")+";",it,nt,ht-2),lt);break;case 59:It+=";";default:if(append$1(Et=ruleset(It,et,nt,ct,ut,rt,st,vt,xt=[],St=[],ht),ot),wt===123)if(ut===0)parse$3(It,et,Et,Et,xt,ot,ht,st,St);else switch(dt===99&&charat(It,3)===110?100:dt){case 100:case 108:case 109:case 115:parse$3(tt,Et,Et,it&&append$1(ruleset(tt,Et,Et,0,0,rt,st,vt,rt,xt=[],ht),St),rt,St,ht,st,it?xt:St);break;default:parse$3(It,Et,Et,Et,[""],St,0,st,St)}}ct=ut=pt=0,gt=yt=1,vt=It="",ht=at;break;case 58:ht=1+strlen(It),pt=mt;default:if(gt<1){if(wt==123)--gt;else if(wt==125&>++==0&&prev$1()==125)continue}switch(It+=from(wt),wt*gt){case 38:yt=ut>0?1:(It+="\f",-1);break;case 44:st[ct++]=(strlen(It)-1)*yt,yt=1;break;case 64:peek()===45&&(It+=delimit(next())),dt=peek(),ut=ht=strlen(vt=It+=identifier(caret())),wt++;break;case 45:mt===45&&strlen(It)==2&&(gt=0)}}return ot}function ruleset(tt,et,nt,it,rt,ot,at,st,lt,ct,ut){for(var ht=rt-1,dt=rt===0?ot:[""],pt=sizeof(dt),mt=0,gt=0,bt=0;mt0?dt[yt]+" "+wt:replace(wt,/&\f/g,dt[yt])))&&(lt[bt++]=vt);return node$2(tt,et,nt,rt===0?RULESET:st,lt,ct,ut)}function comment(tt,et,nt){return node$2(tt,et,nt,COMMENT,from(char()),substr(tt,2,-2),0)}function declaration(tt,et,nt,it){return node$2(tt,et,nt,DECLARATION,substr(tt,0,it),substr(tt,it+1,-1),it)}function serialize$1(tt,et){for(var nt="",it=sizeof(tt),rt=0;rt6)switch(charat(tt,et+1)){case 109:if(charat(tt,et+4)!==45)break;case 102:return replace(tt,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(tt,et+3)==108?"$3":"$2-$3"))+tt;case 115:return~indexof(tt,"stretch")?prefix$1(replace(tt,"stretch","fill-available"),et)+tt:tt}break;case 4949:if(charat(tt,et+1)!==115)break;case 6444:switch(charat(tt,strlen(tt)-3-(~indexof(tt,"!important")&&10))){case 107:return replace(tt,":",":"+WEBKIT)+tt;case 101:return replace(tt,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(tt,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+tt}break;case 5936:switch(charat(tt,et+11)){case 114:return WEBKIT+tt+MS+replace(tt,/[svh]\w+-[tblr]{2}/,"tb")+tt;case 108:return WEBKIT+tt+MS+replace(tt,/[svh]\w+-[tblr]{2}/,"tb-rl")+tt;case 45:return WEBKIT+tt+MS+replace(tt,/[svh]\w+-[tblr]{2}/,"lr")+tt}return WEBKIT+tt+MS+tt+tt}return tt}var prefixer=function(et,nt,it,rt){if(et.length>-1&&!et.return)switch(et.type){case DECLARATION:et.return=prefix$1(et.value,et.length);break;case KEYFRAMES:return serialize$1([copy$2(et,{value:replace(et.value,"@","@"+WEBKIT)})],rt);case RULESET:if(et.length)return combine(et.props,function(ot){switch(match(ot,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize$1([copy$2(et,{props:[replace(ot,/:(read-\w+)/,":"+MOZ+"$1")]})],rt);case"::placeholder":return serialize$1([copy$2(et,{props:[replace(ot,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy$2(et,{props:[replace(ot,/:(plac\w+)/,":"+MOZ+"$1")]}),copy$2(et,{props:[replace(ot,/:(plac\w+)/,MS+"input-$1")]})],rt)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(et){var nt=et.key;if(nt==="css"){var it=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(it,function(gt){var bt=gt.getAttribute("data-emotion");bt.indexOf(" ")!==-1&&(document.head.appendChild(gt),gt.setAttribute("data-s",""))})}var rt=et.stylisPlugins||defaultStylisPlugins,ot={},at,st=[];at=et.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+nt+' "]'),function(gt){for(var bt=gt.getAttribute("data-emotion").split(" "),yt=1;yt=4;++it,rt-=4)nt=tt.charCodeAt(it)&255|(tt.charCodeAt(++it)&255)<<8|(tt.charCodeAt(++it)&255)<<16|(tt.charCodeAt(++it)&255)<<24,nt=(nt&65535)*1540483477+((nt>>>16)*59797<<16),nt^=nt>>>24,et=(nt&65535)*1540483477+((nt>>>16)*59797<<16)^(et&65535)*1540483477+((et>>>16)*59797<<16);switch(rt){case 3:et^=(tt.charCodeAt(it+2)&255)<<16;case 2:et^=(tt.charCodeAt(it+1)&255)<<8;case 1:et^=tt.charCodeAt(it)&255,et=(et&65535)*1540483477+((et>>>16)*59797<<16)}return et^=et>>>13,et=(et&65535)*1540483477+((et>>>16)*59797<<16),((et^et>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(et){return et.charCodeAt(1)===45},isProcessableValue=function(et){return et!=null&&typeof et!="boolean"},processStyleName=memoize$4(function(tt){return isCustomProperty(tt)?tt:tt.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(et,nt){switch(et){case"animation":case"animationName":if(typeof nt=="string")return nt.replace(animationRegex,function(it,rt,ot){return cursor={name:rt,styles:ot,next:cursor},rt})}return unitlessKeys[et]!==1&&!isCustomProperty(et)&&typeof nt=="number"&&nt!==0?nt+"px":nt},noComponentSelectorMessage="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function handleInterpolation(tt,et,nt){if(nt==null)return"";if(nt.__emotion_styles!==void 0)return nt;switch(typeof nt){case"boolean":return"";case"object":{if(nt.anim===1)return cursor={name:nt.name,styles:nt.styles,next:cursor},nt.name;if(nt.styles!==void 0){var it=nt.next;if(it!==void 0)for(;it!==void 0;)cursor={name:it.name,styles:it.styles,next:cursor},it=it.next;var rt=nt.styles+";";return rt}return createStringFromObject(tt,et,nt)}case"function":{if(tt!==void 0){var ot=cursor,at=nt(tt);return cursor=ot,handleInterpolation(tt,et,at)}break}}if(et==null)return nt;var st=et[nt];return st!==void 0?st:nt}function createStringFromObject(tt,et,nt){var it="";if(Array.isArray(nt))for(var rt=0;rt96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(et,nt,it){var rt;if(nt){var ot=nt.shouldForwardProp;rt=et.__emotion_forwardProp&&ot?function(at){return et.__emotion_forwardProp(at)&&ot(at)}:ot}return typeof rt!="function"&&it&&(rt=et.__emotion_forwardProp),rt},Insertion=function(et){var nt=et.cache,it=et.serialized,rt=et.isStringTag;return registerStyles(nt,it,rt),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(nt,it,rt)}),null},createStyled$1=function tt(et,nt){var it=et.__emotion_real===et,rt=it&&et.__emotion_base||et,ot,at;nt!==void 0&&(ot=nt.label,at=nt.target);var st=composeShouldForwardProps(et,nt,it),lt=st||getDefaultShouldForwardProp(rt),ct=!lt("as");return function(){var ut=arguments,ht=it&&et.__emotion_styles!==void 0?et.__emotion_styles.slice(0):[];if(ot!==void 0&&ht.push("label:"+ot+";"),ut[0]==null||ut[0].raw===void 0)ht.push.apply(ht,ut);else{ht.push(ut[0][0]);for(var dt=ut.length,pt=1;ptet(isEmpty$4(rt)?nt:rt):et;return jsxRuntimeExports.jsx(Global$1,{styles:it})}/** - * @mui/styled-engine v5.14.19 +`)}var MissingProviderError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.MissingProviderError=MissingProviderError;var RejectionError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.RejectionError=RejectionError;var ConnectionError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.ConnectionError=ConnectionError;var UnsupportedMethodError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.UnsupportedMethodError=UnsupportedMethodError;var RoutingError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.RoutingError=RoutingError;var InvalidDataError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.InvalidDataError=InvalidDataError;var InternalError=function(tt){__extends(et,tt);function et(nt){var it=this.constructor,rt=tt.call(this,nt)||this;return fixError(rt,it,et),rt}return et}(Error);errors.InternalError=InternalError;Object.defineProperty(client,"__esModule",{value:!0});client.requestProvider=void 0;var errors_1=errors;function requestProvider(tt){return new Promise(function(et,nt){if(typeof window>"u")return nt(new Error("Must be called in a browser context"));var it=window.webln;if(!it)return nt(new errors_1.MissingProviderError("Your browser has no WebLN provider"));it.enable().then(function(){return et(it)}).catch(function(rt){return nt(rt)})})}client.requestProvider=requestProvider;var provider={};Object.defineProperty(provider,"__esModule",{value:!0});(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(it,rt,ot,at){at===void 0&&(at=ot);var st=Object.getOwnPropertyDescriptor(rt,ot);(!st||("get"in st?!rt.__esModule:st.writable||st.configurable))&&(st={enumerable:!0,get:function(){return rt[ot]}}),Object.defineProperty(it,at,st)}:function(it,rt,ot,at){at===void 0&&(at=ot),it[at]=rt[ot]}),nt=commonjsGlobal&&commonjsGlobal.__exportStar||function(it,rt){for(var ot in it)ot!=="default"&&!Object.prototype.hasOwnProperty.call(rt,ot)&&et(rt,it,ot)};Object.defineProperty(tt,"__esModule",{value:!0}),nt(client,tt),nt(provider,tt),nt(errors,tt)})(lib$1);async function buyLsat(tt){const et={amount:tt};return api$1.post("/buy_lsat",JSON.stringify(et))}async function payLsat(){let tt;if(await distExports$1.enable()){const it=localStorage.getItem("lsat");if(it){localStorage.removeItem("lsat");const at=JSON.parse(it);await distExports$1.updateLsat(at.identifier,"expired")}const rt=await distExports$1.setBudget();let ot=rt==null?void 0:rt.budget;ot||(ot=(await distExports$1.authorize()).budget);try{await buyLsat(ot)}catch(at){if(at.status===402){tt=distExports.Lsat.fromHeader(at.headers.get("www-authenticate"));const st=await distExports$1.saveLsat(tt.invoice,tt.baseMacaroon,window.location.host);localStorage.setItem("lsat",JSON.stringify({macaroon:tt.baseMacaroon,identifier:tt.id,preimage:st.lsat.split(":")[1]}))}return}}localStorage.removeItem("lsat");const nt=await lib$1.requestProvider();try{await buyLsat(50)}catch(it){tt=distExports.Lsat.fromHeader(it.headers.get("www-authenticate"));const rt=await nt.sendPayment(tt.invoice);localStorage.setItem("lsat",JSON.stringify({macaroon:tt.baseMacaroon,identifier:tt.id,preimage:rt.preimage}))}}const EARTH_RADIUS=1800,EARTH_DATA_PADDING=50,dataRadius=EARTH_RADIUS+EARTH_DATA_PADDING;function getRandomLngLat(){return parseFloat((Math.random()*(180- -180)+-180).toFixed(4))}const getPointAbove=(tt,et)=>tt.clone().normalize().clone().negate().normalize().multiplyScalar(et).add(tt),getPositionFromLngLat=(tt,et,nt)=>{const it=et*Math.PI/180,rt=(tt-180)*Math.PI/180,ot=-nt*Math.cos(it)*Math.cos(rt),at=nt*Math.sin(it),st=nt*Math.cos(it)*Math.sin(rt);return new Vector3(ot,at,st)},generateEarthGraphPositions=tt=>{const et=tt.map(it=>{const{longitude:rt,latitude:ot}=it.longitude&&it.latitude?it:{longitude:getRandomLngLat(),latitude:getRandomLngLat()},at=getPositionFromLngLat(rt,ot,dataRadius);return{...it,...at}}),nt=generateLinksFromNodeData(et,!0,!0);return{nodes:et,links:nt}};function forceCenter(tt,et,nt){var it,rt=1;tt==null&&(tt=0),et==null&&(et=0),nt==null&&(nt=0);function ot(){var at,st=it.length,lt,ct=0,ut=0,ht=0;for(at=0;at=(lt=(at+st)/2))?at=lt:st=lt,it=rt,!(rt=rt[ht=+ut]))return it[ht]=ot,tt;if(ct=+tt._x.call(null,rt.data),et===ct)return ot.next=rt,it?it[ht]=ot:tt._root=ot,tt;do it=it?it[ht]=new Array(2):tt._root=new Array(2),(ut=et>=(lt=(at+st)/2))?at=lt:st=lt;while((ht=+ut)==(dt=+(ct>=lt)));return it[dt]=rt,it[ht]=ot,tt}function addAll$2(tt){Array.isArray(tt)||(tt=Array.from(tt));const et=tt.length,nt=new Float64Array(et);let it=1/0,rt=-1/0;for(let ot=0,at;otrt&&(rt=at));if(it>rt)return this;this.cover(it).cover(rt);for(let ot=0;ottt||tt>=nt;)switch(at=+(ttat||(ot=ct.x1)=ht))&&(ct=st[st.length-1],st[st.length-1]=st[st.length-1-ut],st[st.length-1-ut]=ct)}else{var dt=Math.abs(tt-+this._x.call(null,lt.data));dt=(ct=(at+st)/2))?at=ct:st=ct,et=nt,!(nt=nt[ht=+ut]))return this;if(!nt.length)break;et[ht+1&1]&&(it=et,dt=ht)}for(;nt.data!==tt;)if(rt=nt,!(nt=nt.next))return this;return(ot=nt.next)&&delete nt.next,rt?(ot?rt.next=ot:delete rt.next,this):et?(ot?et[ht]=ot:delete et[ht],(nt=et[0]||et[1])&&nt===(et[1]||et[0])&&!nt.length&&(it?it[dt]=nt:this._root=nt),this):(this._root=ot,this)}function removeAll$2(tt){for(var et=0,nt=tt.length;et=(ht=(st+ct)/2))?st=ht:ct=ht,(bt=nt>=(dt=(lt+ut)/2))?lt=dt:ut=dt,rt=ot,!(ot=ot[yt=bt<<1|gt]))return rt[yt]=at,tt;if(pt=+tt._x.call(null,ot.data),mt=+tt._y.call(null,ot.data),et===pt&&nt===mt)return at.next=ot,rt?rt[yt]=at:tt._root=at,tt;do rt=rt?rt[yt]=new Array(4):tt._root=new Array(4),(gt=et>=(ht=(st+ct)/2))?st=ht:ct=ht,(bt=nt>=(dt=(lt+ut)/2))?lt=dt:ut=dt;while((yt=bt<<1|gt)===(wt=(mt>=dt)<<1|pt>=ht));return rt[wt]=ot,rt[yt]=at,tt}function addAll$1(tt){var et,nt,it=tt.length,rt,ot,at=new Array(it),st=new Array(it),lt=1/0,ct=1/0,ut=-1/0,ht=-1/0;for(nt=0;ntut&&(ut=rt),otht&&(ht=ot));if(lt>ut||ct>ht)return this;for(this.cover(lt,ct).cover(ut,ht),nt=0;nttt||tt>=rt||it>et||et>=ot;)switch(ct=(etut||(st=mt.y0)>ht||(lt=mt.x1)=yt)<<1|tt>=bt)&&(mt=dt[dt.length-1],dt[dt.length-1]=dt[dt.length-1-gt],dt[dt.length-1-gt]=mt)}else{var wt=tt-+this._x.call(null,pt.data),vt=et-+this._y.call(null,pt.data),xt=wt*wt+vt*vt;if(xt=(dt=(at+lt)/2))?at=dt:lt=dt,(gt=ht>=(pt=(st+ct)/2))?st=pt:ct=pt,et=nt,!(nt=nt[bt=gt<<1|mt]))return this;if(!nt.length)break;(et[bt+1&3]||et[bt+2&3]||et[bt+3&3])&&(it=et,yt=bt)}for(;nt.data!==tt;)if(rt=nt,!(nt=nt.next))return this;return(ot=nt.next)&&delete nt.next,rt?(ot?rt.next=ot:delete rt.next,this):et?(ot?et[bt]=ot:delete et[bt],(nt=et[0]||et[1]||et[2]||et[3])&&nt===(et[3]||et[2]||et[1]||et[0])&&!nt.length&&(it?it[yt]=nt:this._root=nt),this):(this._root=ot,this)}function removeAll$1(tt){for(var et=0,nt=tt.length;et=(mt=(lt+ht)/2))?lt=mt:ht=mt,(St=nt>=(gt=(ct+dt)/2))?ct=gt:dt=gt,(Et=it>=(bt=(ut+pt)/2))?ut=bt:pt=bt,ot=at,!(at=at[$t=Et<<2|St<<1|xt]))return ot[$t]=st,tt;if(yt=+tt._x.call(null,at.data),wt=+tt._y.call(null,at.data),vt=+tt._z.call(null,at.data),et===yt&&nt===wt&&it===vt)return st.next=at,ot?ot[$t]=st:tt._root=st,tt;do ot=ot?ot[$t]=new Array(8):tt._root=new Array(8),(xt=et>=(mt=(lt+ht)/2))?lt=mt:ht=mt,(St=nt>=(gt=(ct+dt)/2))?ct=gt:dt=gt,(Et=it>=(bt=(ut+pt)/2))?ut=bt:pt=bt;while(($t=Et<<2|St<<1|xt)===(It=(vt>=bt)<<2|(wt>=gt)<<1|yt>=mt));return ot[It]=at,ot[$t]=st,tt}function addAll(tt){Array.isArray(tt)||(tt=Array.from(tt));const et=tt.length,nt=new Float64Array(et),it=new Float64Array(et),rt=new Float64Array(et);let ot=1/0,at=1/0,st=1/0,lt=-1/0,ct=-1/0,ut=-1/0;for(let ht=0,dt,pt,mt,gt;htlt&&(lt=pt),mtct&&(ct=mt),gtut&&(ut=gt));if(ot>lt||at>ct||st>ut)return this;this.cover(ot,at,st).cover(lt,ct,ut);for(let ht=0;httt||tt>=at||rt>et||et>=st||ot>nt||nt>=lt;)switch(dt=(ntmt||(ct=vt.y0)>gt||(ut=vt.z0)>bt||(ht=vt.x1)=$t)<<2|(et>=Et)<<1|tt>=St)&&(vt=yt[yt.length-1],yt[yt.length-1]=yt[yt.length-1-xt],yt[yt.length-1-xt]=vt)}else{var It=tt-+this._x.call(null,wt.data),Ft=et-+this._y.call(null,wt.data),Ht=nt-+this._z.call(null,wt.data),zt=It*It+Ft*Ft+Ht*Ht;if(zt=(gt=(at+ct)/2))?at=gt:ct=gt,(vt=pt>=(bt=(st+ut)/2))?st=bt:ut=bt,(xt=mt>=(yt=(lt+ht)/2))?lt=yt:ht=yt,et=nt,!(nt=nt[St=xt<<2|vt<<1|wt]))return this;if(!nt.length)break;(et[St+1&7]||et[St+2&7]||et[St+3&7]||et[St+4&7]||et[St+5&7]||et[St+6&7]||et[St+7&7])&&(it=et,Et=St)}for(;nt.data!==tt;)if(rt=nt,!(nt=nt.next))return this;return(ot=nt.next)&&delete nt.next,rt?(ot?rt.next=ot:delete rt.next,this):et?(ot?et[St]=ot:delete et[St],(nt=et[0]||et[1]||et[2]||et[3]||et[4]||et[5]||et[6]||et[7])&&nt===(et[7]||et[6]||et[5]||et[4]||et[3]||et[2]||et[1]||et[0])&&!nt.length&&(it?it[Et]=nt:this._root=nt),this):(this._root=ot,this)}function removeAll(tt){for(var et=0,nt=tt.length;et1&&(gt=pt.y+pt.vy),nt>2&&(bt=pt.z+pt.vz),dt.visit(xt);function xt(St,Et,$t,It,Ft,Ht,zt){var Ot=[Et,$t,It,Ft,Ht,zt],jt=Ot[0],kt=Ot[1],Tt=Ot[2],Ct=Ot[nt],Ut=Ot[nt+1],Nt=Ot[nt+2],Bt=St.data,Mt=St.r,Dt=yt+Mt;if(Bt){if(Bt.index>pt.index){var Pt=mt-Bt.x-Bt.vx,Vt=nt>1?gt-Bt.y-Bt.vy:0,nn=nt>2?bt-Bt.z-Bt.vz:0,cn=Pt*Pt+Vt*Vt+nn*nn;cn1&&Vt===0&&(Vt=jiggle(rt),cn+=Vt*Vt),nt>2&&nn===0&&(nn=jiggle(rt),cn+=nn*nn),cn=(Dt-(cn=Math.sqrt(cn)))/cn*ot,pt.vx+=(Pt*=cn)*(Dt=(Mt*=Mt)/(wt+Mt)),nt>1&&(pt.vy+=(Vt*=cn)*Dt),nt>2&&(pt.vz+=(nn*=cn)*Dt),Bt.vx-=Pt*(Dt=1-Dt),nt>1&&(Bt.vy-=Vt*Dt),nt>2&&(Bt.vz-=nn*Dt))}return}return jt>mt+Dt||Ct1&&(kt>gt+Dt||Ut2&&(Tt>bt+Dt||Ntut.r&&(ut.r=ut[ht].r)}function ct(){if(et){var ut,ht=et.length,dt;for(it=new Array(ht),ut=0;uttypeof dt=="function")||Math.random,nt=ht.find(dt=>[1,2,3].includes(dt))||2,ct()},st.iterations=function(ut){return arguments.length?(at=+ut,st):at},st.strength=function(ut){return arguments.length?(ot=+ut,st):ot},st.radius=function(ut){return arguments.length?(tt=typeof ut=="function"?ut:constant$7(+ut),ct(),st):tt},st}function index$2(tt){return tt.index}function find$4(tt,et){var nt=tt.get(et);if(!nt)throw new Error("node not found: "+et);return nt}function forceLink(tt){var et=index$2,nt=dt,it,rt=constant$7(30),ot,at,st,lt,ct,ut,ht=1;tt==null&&(tt=[]);function dt(yt){return 1/Math.min(lt[yt.source.index],lt[yt.target.index])}function pt(yt){for(var wt=0,vt=tt.length;wt1&&(Ft=$t.y+$t.vy-Et.y-Et.vy||jiggle(ut)),st>2&&(Ht=$t.z+$t.vz-Et.z-Et.vz||jiggle(ut)),zt=Math.sqrt(It*It+Ft*Ft+Ht*Ht),zt=(zt-ot[xt])/zt*yt*it[xt],It*=zt,Ft*=zt,Ht*=zt,$t.vx-=It*(Ot=ct[xt]),st>1&&($t.vy-=Ft*Ot),st>2&&($t.vz-=Ht*Ot),Et.vx+=It*(Ot=1-Ot),st>1&&(Et.vy+=Ft*Ot),st>2&&(Et.vz+=Ht*Ot)}function mt(){if(at){var yt,wt=at.length,vt=tt.length,xt=new Map(at.map((Et,$t)=>[et(Et,$t,at),Et])),St;for(yt=0,lt=new Array(wt);yttypeof vt=="function")||Math.random,st=wt.find(vt=>[1,2,3].includes(vt))||2,mt()},pt.links=function(yt){return arguments.length?(tt=yt,mt(),pt):tt},pt.id=function(yt){return arguments.length?(et=yt,pt):et},pt.iterations=function(yt){return arguments.length?(ht=+yt,pt):ht},pt.strength=function(yt){return arguments.length?(nt=typeof yt=="function"?yt:constant$7(+yt),gt(),pt):nt},pt.distance=function(yt){return arguments.length?(rt=typeof yt=="function"?yt:constant$7(+yt),bt(),pt):rt},pt}var noop$6={value:()=>{}};function dispatch(){for(var tt=0,et=arguments.length,nt={},it;tt=0&&(it=nt.slice(rt+1),nt=nt.slice(0,rt)),nt&&!et.hasOwnProperty(nt))throw new Error("unknown type: "+nt);return{type:nt,name:it}})}Dispatch.prototype=dispatch.prototype={constructor:Dispatch,on:function(tt,et){var nt=this._,it=parseTypenames$1(tt+"",nt),rt,ot=-1,at=it.length;if(arguments.length<2){for(;++ot0)for(var nt=new Array(rt),it=0,rt,ot;it=0&&tt._call.call(void 0,et),tt=tt._next;--frame}function wake(){clockNow=(clockLast=clock.now())+clockSkew,frame=timeout$1=0;try{timerFlush()}finally{frame=0,nap(),clockNow=0}}function poke(){var tt=clock.now(),et=tt-clockLast;et>pokeDelay&&(clockSkew-=et,clockLast=tt)}function nap(){for(var tt,et=taskHead,nt,it=1/0;et;)et._call?(it>et._time&&(it=et._time),tt=et,et=et._next):(nt=et._next,et._next=null,et=tt?tt._next=nt:taskHead=nt);taskTail=tt,sleep(it)}function sleep(tt){if(!frame){timeout$1&&(timeout$1=clearTimeout(timeout$1));var et=tt-clockNow;et>24?(tt<1/0&&(timeout$1=setTimeout(wake,tt-clock.now()-clockSkew)),interval&&(interval=clearInterval(interval))):(interval||(clockLast=clock.now(),interval=setInterval(poke,pokeDelay)),frame=1,setFrame(wake))}}function timeout(tt,et,nt){var it=new Timer$1;return et=et==null?0:+et,it.restart(rt=>{it.stop(),tt(rt+et)},et,nt),it}const a$2=1664525,c$3=1013904223,m$2=4294967296;function lcg(){let tt=1;return()=>(tt=(a$2*tt+c$3)%m$2)/m$2}var MAX_DIMENSIONS=3;function x$2(tt){return tt.x}function y$2(tt){return tt.y}function z$1(tt){return tt.z}var initialRadius=10,initialAngleRoll=Math.PI*(3-Math.sqrt(5)),initialAngleYaw=Math.PI*20/(9+Math.sqrt(221));function forceSimulation(tt,et){et=et||2;var nt=Math.min(MAX_DIMENSIONS,Math.max(1,Math.round(et))),it,rt=1,ot=.001,at=1-Math.pow(ot,1/300),st=0,lt=.6,ct=new Map,ut=timer$1(pt),ht=dispatch("tick","end"),dt=lcg();tt==null&&(tt=[]);function pt(){mt(),ht.call("tick",it),rt1&&(xt.fy==null?xt.y+=xt.vy*=lt:(xt.y=xt.fy,xt.vy=0)),nt>2&&(xt.fz==null?xt.z+=xt.vz*=lt:(xt.z=xt.fz,xt.vz=0));return it}function gt(){for(var yt=0,wt=tt.length,vt;yt1&&isNaN(vt.y)||nt>2&&isNaN(vt.z)){var xt=initialRadius*(nt>2?Math.cbrt(.5+yt):nt>1?Math.sqrt(.5+yt):yt),St=yt*initialAngleRoll,Et=yt*initialAngleYaw;nt===1?vt.x=xt:nt===2?(vt.x=xt*Math.cos(St),vt.y=xt*Math.sin(St)):(vt.x=xt*Math.sin(St)*Math.cos(Et),vt.y=xt*Math.cos(St),vt.z=xt*Math.sin(St)*Math.sin(Et))}(isNaN(vt.vx)||nt>1&&isNaN(vt.vy)||nt>2&&isNaN(vt.vz))&&(vt.vx=0,nt>1&&(vt.vy=0),nt>2&&(vt.vz=0))}}function bt(yt){return yt.initialize&&yt.initialize(tt,dt,nt),yt}return gt(),it={tick:mt,restart:function(){return ut.restart(pt),it},stop:function(){return ut.stop(),it},numDimensions:function(yt){return arguments.length?(nt=Math.min(MAX_DIMENSIONS,Math.max(1,Math.round(yt))),ct.forEach(bt),it):nt},nodes:function(yt){return arguments.length?(tt=yt,gt(),ct.forEach(bt),it):tt},alpha:function(yt){return arguments.length?(rt=+yt,it):rt},alphaMin:function(yt){return arguments.length?(ot=+yt,it):ot},alphaDecay:function(yt){return arguments.length?(at=+yt,it):+at},alphaTarget:function(yt){return arguments.length?(st=+yt,it):st},velocityDecay:function(yt){return arguments.length?(lt=1-yt,it):1-lt},randomSource:function(yt){return arguments.length?(dt=yt,ct.forEach(bt),it):dt},force:function(yt,wt){return arguments.length>1?(wt==null?ct.delete(yt):ct.set(yt,bt(wt)),it):ct.get(yt)},find:function(){var yt=Array.prototype.slice.call(arguments),wt=yt.shift()||0,vt=(nt>1?yt.shift():null)||0,xt=(nt>2?yt.shift():null)||0,St=yt.shift()||1/0,Et=0,$t=tt.length,It,Ft,Ht,zt,Ot,jt;for(St*=St,Et=0;Et<$t;++Et)Ot=tt[Et],It=wt-Ot.x,Ft=vt-(Ot.y||0),Ht=xt-(Ot.z||0),zt=It*It+Ft*Ft+Ht*Ht,zt1?(ht.on(yt,wt),it):ht.on(yt)}}}function forceManyBody(){var tt,et,nt,it,rt,ot=constant$7(-30),at,st=1,lt=1/0,ct=.81;function ut(mt){var gt,bt=tt.length,yt=(et===1?binarytree(tt,x$2):et===2?quadtree(tt,x$2,y$2):et===3?octree(tt,x$2,y$2,z$1):null).visitAfter(dt);for(rt=mt,gt=0;gt1&&(mt.y=xt/wt),et>2&&(mt.z=St/wt)}else{bt=mt,bt.x=bt.data.x,et>1&&(bt.y=bt.data.y),et>2&&(bt.z=bt.data.z);do gt+=at[bt.data.index];while(bt=bt.next)}mt.value=gt}function pt(mt,gt,bt,yt,wt){if(!mt.value)return!0;var vt=[bt,yt,wt][et-1],xt=mt.x-nt.x,St=et>1?mt.y-nt.y:0,Et=et>2?mt.z-nt.z:0,$t=vt-gt,It=xt*xt+St*St+Et*Et;if($t*$t/ct1&&St===0&&(St=jiggle(it),It+=St*St),et>2&&Et===0&&(Et=jiggle(it),It+=Et*Et),It1&&(nt.vy+=St*mt.value*rt/It),et>2&&(nt.vz+=Et*mt.value*rt/It)),!0;if(mt.length||It>=lt)return;(mt.data!==nt||mt.next)&&(xt===0&&(xt=jiggle(it),It+=xt*xt),et>1&&St===0&&(St=jiggle(it),It+=St*St),et>2&&Et===0&&(Et=jiggle(it),It+=Et*Et),It1&&(nt.vy+=St*$t),et>2&&(nt.vz+=Et*$t));while(mt=mt.next)}return ut.initialize=function(mt,...gt){tt=mt,it=gt.find(bt=>typeof bt=="function")||Math.random,et=gt.find(bt=>[1,2,3].includes(bt))||2,ht()},ut.strength=function(mt){return arguments.length?(ot=typeof mt=="function"?mt:constant$7(+mt),ht(),ut):ot},ut.distanceMin=function(mt){return arguments.length?(st=mt*mt,ut):Math.sqrt(st)},ut.distanceMax=function(mt){return arguments.length?(lt=mt*mt,ut):Math.sqrt(lt)},ut.theta=function(mt){return arguments.length?(ct=mt*mt,ut):Math.sqrt(ct)},ut}const simulation=forceSimulation().stop(),defaults$1={numDimensions:3,velocityDecay:.9,forceChargeStrength:-20,forceChargeMinDistance:10,forceChargeMaxDistance:8e3,forceLinkStrength:.04,forceCenterStrength:.85,disableCollide:!1,disableCenter:!1,disableLink:!1,disableCharge:!1,forceCollideRadiusMethod:tt=>(tt.scale||1)*6+200,forceLinkDistanceMethod:tt=>{const et=tt.source.node_type;let nt=50;switch(et){case"topic":nt=30;break;case"guest":nt=30;break;case"clip":nt=10;break;case"episode":nt=15;break}return nt*2}},runForceSimulation=(tt,et,{numDimensions:nt=defaults$1.numDimensions,velocityDecay:it=defaults$1.velocityDecay,forceChargeStrength:rt=defaults$1.forceChargeStrength,forceChargeMinDistance:ot=defaults$1.forceChargeMinDistance,forceChargeMaxDistance:at=defaults$1.forceChargeMaxDistance,forceLinkStrength:st=defaults$1.forceLinkStrength,forceCenterStrength:lt=defaults$1.forceCenterStrength,forceLinkDistanceMethod:ct=defaults$1.forceLinkDistanceMethod,forceCollideRadiusMethod:ut=defaults$1.forceCollideRadiusMethod,disableCollide:ht=defaults$1.disableCollide,disableCenter:dt=defaults$1.disableCenter,disableLink:pt=defaults$1.disableLink,disableCharge:mt=defaults$1.disableCharge})=>(simulation.alpha(1).stop().numDimensions(nt).velocityDecay(it).force("collide",ht?null:forceCollide().radius(ut).iterations(1)).force("center",dt?null:forceCenter().strength(lt)).force("charge",mt?null:forceManyBody().strength(rt).distanceMin(ot).distanceMax(at)).nodes(tt).force("link",pt?null:forceLink().distance(ct).strength(st).id(gt=>gt.id).links(et.filter(gt=>!gt.onlyVisibleOnSelect))).alpha(1).restart(),simulation),simulationTicks$1=60,collisionTicks$1=20,runSimulationPhase$1=tt=>{for(let et=0;et{tt.force("collide",forceCollide().radius(et=>(et.scale||1)*20).iterations(1));for(let et=0;et{const et=tt.map(ot=>({...ot,x:0,y:0,z:0})),nt=generateLinksFromNodeData(et,!1,!1),it=runForceSimulation(et,nt,{numDimensions:3,forceLinkStrength:.5,forceChargeStrength:-40,forceCenterStrength:.3,velocityDecay:.5});runSimulationPhase$1(it),runCollisionPhase$1(it),it.stop();const rt=nt.map(ot=>{const at=et.find(ht=>ht.ref_id===ot.sourceRef),st=et.find(ht=>ht.ref_id===ot.targetRef),lt=["guest","topic"].some(ht=>ht===(at==null?void 0:at.node_type)||ht===(st==null?void 0:st.node_type)),ct=new Vector3((at==null?void 0:at.x)||0,(at==null?void 0:at.y)||0,(at==null?void 0:at.z)||0),ut=new Vector3((st==null?void 0:st.x)||0,(st==null?void 0:st.y)||0,(st==null?void 0:st.z)||0);return{...ot,onlyVisibleOnSelect:lt,sourcePosition:ct,targetPosition:ut}});return{nodes:et,links:rt}},sortAB=(tt,et,nt)=>{let it=-2;return tt===nt&&et===nt?it=0:tt===nt&&et!==nt?it=-1:tt!==nt&&et===nt&&(it=1),it},sortNodesByHierarchy=tt=>tt.map(nt=>nt).sort((nt,it)=>{let rt=0;return nt.node_type==="show"||it.node_type==="show"?rt=sortAB(nt.node_type,it.node_type,"show"):nt.node_type==="episode"||it.node_type==="episode"?rt=sortAB(nt.node_type,it.node_type,"episode"):nt.node_type==="clip"||it.node_type==="clip"?rt=sortAB(nt.node_type,it.node_type,"clip"):nt.node_type!=="guest"&&it.node_type==="guest"?rt=sortAB(nt.node_type,it.node_type,"guest"):rt=0,rt});function getMyParents(tt,et){const{ref_id:nt}=tt;return!nt||!et?[]:et.filter(rt=>{var ot;return(ot=rt.children)==null?void 0:ot.includes(nt)})}function getMyChildren(tt,et){return et.filter(it=>it.ref_id&&tt.includes(it.ref_id))}const simulationTicks=60,collisionTicks=20,universeScale$1=5e3,universeCube={scale:universeScale$1/2,position:{x:0,y:0,z:0}};function generateNodePosition$1(tt,et){const{scale:nt,position:it}=universeCube,rt={x:it.x+Math.random()*nt-nt*.5,y:it.y+Math.random()*nt-nt*.5,z:it.z+Math.random()*nt-nt*.5},ot=getMyParents(tt,et),at=ot!=null&&ot.length?new Vector3(ot[0].x,ot[0].y,ot[0].z):null;return at&&(rt.x=at.x,rt.y=at.y,rt.z=at.z),new Vector3(rt.x,rt.y,rt.z)}const runSimulationPhase=tt=>{for(let et=0;et{tt.force("collide",forceCollide().radius(et=>(et.scale||1)*20).iterations(1));for(let et=0;et{const et=[],nt=tt.map(at=>{const st=generateNodePosition$1(at,et),lt={...at,...st};return et.push(lt),lt}),it=generateLinksFromNodeData(nt,!0,!0),rt=runForceSimulation(nt,it,{numDimensions:3,forceLinkStrength:.01,forceChargeStrength:-80,velocityDecay:.5,disableCenter:!0,disableCharge:!0});runSimulationPhase(rt),runCollisionPhase(rt),rt.stop();const ot=it.map(at=>{const st=nt.find(dt=>dt.ref_id===at.sourceRef),lt=nt.find(dt=>dt.ref_id===at.targetRef),ct=new Vector3((st==null?void 0:st.x)||0,(st==null?void 0:st.y)||0,(st==null?void 0:st.z)||0),ut=new Vector3((lt==null?void 0:lt.x)||0,(lt==null?void 0:lt.y)||0,(lt==null?void 0:lt.z)||0);return{...at,onlyVisibleOnSelect:!0,sourcePosition:ct,targetPosition:ut}});return{nodes:nt,links:ot}},universeScale=5e3,padding$1=300,guestCube={scale:universeScale/2,position:{x:0,y:0,z:universeScale/2+padding$1}},topicCube={scale:universeScale/2,position:{x:0,y:0,z:-(universeScale/2+padding$1)}},dataCube={scale:universeScale/2,position:{x:0,y:0,z:0}};function generateGuestNodePosition(){const{scale:tt,position:et}=guestCube,nt={x:et.x+Math.random()*tt-tt*.5,y:et.y+Math.random()*tt-tt*.5,z:et.z+Math.random()*tt-tt*.5},it=1,rt=10;return new Vector3(nt.x+it*rt,nt.y+it*rt,nt.z+it*rt)}function generateTopicNodePosition(){const{scale:tt,position:et}=topicCube,nt={x:et.x+Math.random()*tt-tt*.5,y:et.y+Math.random()*tt-tt*.5,z:et.z+Math.random()*tt-tt*.5},it=1,rt=10;return new Vector3(nt.x+it*rt,nt.y+it*rt,nt.z+it*rt)}function generateNearbyPosition(tt,et,nt=1){let rt=0,ot=10*1;const at=0;switch(et){case"episode":ot+=50*(nt||0);break;case"clip":ot=0,rt+=50*(nt||0);break}const st=new Vector3;return st.x=tt.x+rt,st.y=tt.y+ot,st.z=tt.z+at,st}function generateNodePosition(tt,et,nt){const{ref_id:it}=tt,{scale:rt,position:ot}=dataCube,at={x:ot.x+Math.random()*rt-rt*.5,y:ot.y+Math.random()*rt-rt*.5,z:ot.z+Math.random()*rt-rt*.5},st=getMyParents(tt,nt);let lt=null;if(st!=null&&st.length){const ht=st[0],pt=getMyChildren(ht.children||[],et).findIndex(mt=>mt.ref_id===it);lt=generateNearbyPosition(new Vector3(ht.x,ht.y,ht.z),tt.node_type,pt+1)}lt&&(at.x=lt.x,at.y=lt.y,at.z=lt.z);const ct=1,ut=1;return new Vector3(at.x+ct*ut,at.y+ct*ut,at.z+ct*ut)}const generateSplitGraphPositions=tt=>{const et=sortNodesByHierarchy(tt),nt=[],it=et.map(at=>{let st=new Vector3(0,0,0);switch(at.node_type){case"guest":st=generateGuestNodePosition();break;case"topic":st=generateTopicNodePosition();break;case"data_series":st=generateNodePosition({},et,nt);break;default:st=generateNodePosition(at,et,nt);break}const lt={...at,...st};return nt.push(lt),lt}),ot=generateLinksFromNodeData(it,!0,!0).map(at=>{const st=it.find(dt=>dt.ref_id===at.sourceRef),lt=it.find(dt=>dt.ref_id===at.targetRef);let ct=!1;((st==null?void 0:st.node_type)==="guest"||(st==null?void 0:st.node_type)==="topic"||(lt==null?void 0:lt.node_type)==="guest"||(lt==null?void 0:lt.node_type)==="topic")&&(ct=!0);const ut=new Vector3((st==null?void 0:st.x)||0,(st==null?void 0:st.y)||0,(st==null?void 0:st.z)||0),ht=new Vector3((lt==null?void 0:lt.x)||0,(lt==null?void 0:lt.y)||0,(lt==null?void 0:lt.z)||0);return{...at,onlyVisibleOnSelect:ct,sourcePosition:ut,targetPosition:ht}});return it.sort((at,st)=>(st.weight||0)-(at.weight||0)),{nodes:it,links:ot}},getGraphDataPositions=(tt,et)=>tt==="split"?generateSplitGraphPositions(et):tt==="sphere"?generateSphereGraphPositions(et):tt==="earth"?generateEarthGraphPositions(et):generateForceGraphPositions(et),defaultData$9={links:[],nodes:[]},maxScale=26,fetchGraphData=async(tt,et)=>{try{return getGraphData(tt,et)}catch{return defaultData$9}},fetchNodes=async tt=>{if(!tt)try{return await api$1.get("/prediction/content/latest")}catch(nt){return console.error(nt),mock}if(isDevelopment||isE2E)return await api$1.get(`/v2/search?word=${tt}&free=true`);const et=await getLSat();try{return await api$1.get(`/v2/search?word=${tt}`,{Authorization:et})}catch(nt){if(nt.status===402)return await payLsat(),fetchNodes(tt);throw nt}},getTrends=async()=>{const tt="/get_trends";return await api$1.get(tt)},getSentimentData=async tt=>{const et=tt&&new URLSearchParams(tt),nt=et?`/sentiments?${et.toString()}`:"/sentiments";if(isE2E)return await api$1.get(nt);const it=await getLSat();try{return await api$1.get(nt,{Authorization:it})}catch(rt){if(rt.status===402)return await payLsat(),getSentimentData(tt);throw rt}},postAskQuestion=async tt=>{const et=await getLSat();try{await api$1.post("/ask_question",JSON.stringify(tt),{Authorization:et})}catch(nt){if(nt.status===402){await payLsat(),await postAskQuestion(tt);return}throw nt}},getNodeScale=tt=>{switch(tt.node_type){case"guest":case"episode":case"document":return 2;case"show":return 3;default:return 1.5}};function generateTopicNodesFromMap(tt,et){Object.entries(tt).forEach(([nt,it],rt)=>{const{children:ot,position:at}=it,{x:st,y:lt,z:ct}=at,ut=ot.length*2>maxScale?maxScale:ot.length*2,ht=`topic_node_${rt}`;et({x:st,y:lt,z:ct,children:ot,colors:["#000"],id:ht,label:nt,name:nt,type:"topic",node_type:"topic",ref_id:ht,scale:ut,show_title:nt,text:nt,weight:0})})}function generateGuestNodesFromMap(tt,et){Object.entries(tt).forEach(([nt,it],rt)=>{const ot=it.children,at=ot.length*2>maxScale?maxScale:ot.length*2,st=nt||`guestnode_${rt}`,lt={...it,x:0,y:0,z:0,colors:["#000"],id:st,image_url:it.imageUrl,label:it.name,name:it.name,node_type:"guest",ref_id:st,scale:at,show_title:it.name,text:it.twitterHandle,type:"guest",weight:0};et(lt)})}const generateGuestsMap=(tt,et,nt={})=>{var rt;let it={...nt};return tt.name&&tt.ref_id&&et&&(it={...it,[tt.ref_id]:{children:[...((rt=it[tt.ref_id])==null?void 0:rt.children)||[],et],imageUrl:tt.profile_picture||"",name:tt.name,twitterHandle:tt.twitter_handle}}),it},getGraphData=async(tt,et)=>{try{const nt=await fetchNodes(tt);return formatFetchNodes(nt,tt,et)}catch(nt){return console.error(nt),defaultData$9}},getSegmentColor=(tt,et)=>tt==="topic"||et==="topic"?NODE_RELATIVE_HIGHLIGHT_COLORS.topics.segmentColor:tt==="guest"||et==="guest"?NODE_RELATIVE_HIGHLIGHT_COLORS.guests.segmentColor:NODE_RELATIVE_HIGHLIGHT_COLORS.children.segmentColor,generateLinksFromNodeData=(tt,et,nt)=>{const it=[];return tt.forEach(rt=>{const{children:ot,guests:at}=rt;ot==null||ot.forEach(st=>{if(rt.ref_id){const lt=tt.find(ht=>ht.ref_id===st)||null;if(!lt)return;const ct=new Vector3(rt.x||0,rt.y||0,rt.z||0),ut=new Vector3((lt==null?void 0:lt.x)||0,(lt==null?void 0:lt.y)||0,(lt==null?void 0:lt.z)||0);it.push({onlyVisibleOnSelect:et,color:getSegmentColor(rt.node_type,(lt==null?void 0:lt.node_type)||""),source:rt.ref_id,sourceRef:rt.ref_id,sourcePosition:ct,target:st,targetRef:st,targetPosition:ut})}}),at==null||at.forEach(st=>{if(st&&typeof st!="string"&&rt.ref_id){const lt=tt.find(ht=>ht.ref_id===(st==null?void 0:st.ref_id))||null;if(!lt)return;const ct=new Vector3(rt.x||0,rt.y||0,rt.z||0),ut=new Vector3((lt==null?void 0:lt.x)||0,(lt==null?void 0:lt.y)||0,(lt==null?void 0:lt.z)||0);it.push({onlyVisibleOnSelect:nt,color:getSegmentColor(rt.node_type,"guest"),source:rt.ref_id,sourceRef:rt.ref_id,sourcePosition:ct,target:st==null?void 0:st.ref_id,targetRef:st==null?void 0:st.ref_id,targetPosition:ut})}})}),it},formatFetchNodes=(tt,et,nt)=>{let it=[];const rt={};let ot={};const at=Array.isArray(tt.data_series)?tt.data_series:[],st=[...tt.exact,...tt.related,...at];let lt=0;st.length&&st.forEach((dt,pt)=>{var bt;if(dt.weight&<yt.ref_id===dt.ref_id))return;const gt=(bt=dt.image_url)==null?void 0:bt.replace(AWS_IMAGE_BUCKET_URL,CLOUDFRONT_IMAGE_BUCKET_URL).replace(".jpg","_s.jpg");it.push({...dt,scale:getNodeScale(dt),id:dt.ref_id||dt.id,image_url:gt,type:dt.type||dt.node_type}),dt.node_type==="episode"&&dt.ref_id&&(dt.guests||[]).forEach(wt=>{const xt=generateGuestsMap(wt,dt.ref_id,ot);ot={...ot,...xt}})}),generateGuestNodesFromMap(ot,dt=>{it.push(dt)}),st.forEach(dt=>{const{topics:pt,ref_id:mt,show_title:gt}=dt;pt&&pt.forEach(bt=>{if(bt===et)return;const yt=mt||gt;yt&&(rt[bt]&&!rt[bt].children.includes(yt)?rt[bt].children.push(yt):rt[bt]={position:new Vector3(0,0,0),children:[yt]})})}),generateTopicNodesFromMap(rt,dt=>{it.push(dt)});const ct=getGraphDataPositions(nt,it),{links:ut}=ct;it=ct.nodes,it.sort((dt,pt)=>(pt.weight||0)-(dt.weight||0));const ht=getMaxSuperficialWeightPerNodeType(it,ut);return it=addWeightNormalizationToNodes(lt,ht,it,ut),{links:ut,nodes:it}},addWeightNormalizationToNodes=(tt,et,nt,it)=>nt.map(rt=>{let ot=(rt.weight||0)/tt;return!rt.weight&&et[rt.node_type]&&(ot=getSuperficialNodeWeight(rt,it)/et[rt.node_type]),{...rt,weight:ot}}),defaultData$8={isAdmin:!1,pubKey:"",budget:0,nodeCount:0,tribeHost:"",tribeUuid:""},useUserStore=react(tt=>({...defaultData$8,setIsAdmin:et=>tt({isAdmin:et}),setPubKey:et=>tt({pubKey:et}),setBudget:et=>tt({budget:et}),setNodeCount:et=>tt(nt=>et==="INCREMENT"?{nodeCount:nt.nodeCount+1}:{nodeCount:0}),setTribeUuid:et=>tt({tribeUuid:et}),setTribeHost:et=>tt({tribeHost:et})})),executeIfTetsRunning=tt=>{isE2E&&tt()};function executeIfProd(tt){return isDevelopment||isE2E?null:tt()}function addToGlobalForE2e(tt,et){executeIfTetsRunning(()=>{window.e2e||(window.e2e={}),window.e2e[et]=tt})}const E2E=()=>{const tt=useUserStore();return reactExports.useEffect(()=>{isE2E&&addToGlobalForE2e(tt,"userStore")},[tt]),jsxRuntimeExports.jsx("div",{id:"e2e-check"})},E2ETests=reactExports.memo(()=>isE2E?jsxRuntimeExports.jsx(E2E,{}):null),saveConsumedContent=async tt=>{await executeIfProd(async()=>{try{await distExports$1.saveGraphData({metaData:{date:Math.floor(new Date().getTime()/1e3),...tt},type:"second_brain_consumed_content"})}catch(et){console.warn(et)}})},saveSearchTerm=async()=>{await executeIfProd(async()=>{await distExports$1.enable(!0)||console.log("Sphinx enable failed, means no pubkey and no budget (including budget of 0)")})},graphStyles=["split","force","sphere","earth"],defaultData$7={categoryFilter:null,data:null,selectionGraphData:{nodes:[],links:[]},scrollEventsDisabled:!1,disableCameraRotation:!1,graphRadius:isChileGraph?1600:3056,graphStyle:localStorage.getItem("graphStyle")||"split",isFetching:!1,isTimestampLoaded:!1,queuedSources:null,hoveredNode:null,selectedNode:null,selectedTimestamp:null,sources:null,sphinxModalIsOpen:!1,cameraFocusTrigger:!1,selectedNodeRelativeIds:[],nearbyNodeIds:[],showSelectionGraph:!1,showTeachMe:!1,hideNodeDetails:!1,sidebarFilter:"all",trendingTopics:[]},useDataStore=react((tt,et)=>({...defaultData$7,fetchData:async nt=>{if(et().isFetching)return;tt({isFetching:!0,sphinxModalIsOpen:!0});const it=await fetchGraphData(nt||"",et().graphStyle);nt&&await saveSearchTerm(),tt({data:it,isFetching:!1,sphinxModalIsOpen:!1,disableCameraRotation:!1,nearbyNodeIds:[],selectedNodeRelativeIds:[],showSelectionGraph:!1,showTeachMe:!1})},setTrendingTopics:nt=>tt({trendingTopics:nt}),setIsFetching:nt=>tt({isFetching:nt}),setData:nt=>tt({data:nt}),setSelectionData:nt=>tt({selectionGraphData:nt}),setScrollEventsDisabled:nt=>tt({scrollEventsDisabled:nt}),setCategoryFilter:nt=>tt({categoryFilter:nt}),setDisableCameraRotation:nt=>tt({disableCameraRotation:nt}),setGraphRadius:nt=>tt({graphRadius:nt}),setGraphStyle:nt=>tt({graphStyle:nt}),setQueuedSources:nt=>tt({queuedSources:nt}),setHoveredNode:nt=>tt({hoveredNode:nt}),setSelectedNode:nt=>{const it=et().selectedNode;if((it==null?void 0:it.ref_id)!==(nt==null?void 0:nt.ref_id)){const{data:rt}=et(),ot=(rt==null?void 0:rt.nodes.filter(at=>at.ref_id&&nodesAreRelatives(at,nt)).map(at=>(at==null?void 0:at.ref_id)||""))||[];tt({hoveredNode:null,isTimestampLoaded:!1,selectedNode:nt,disableCameraRotation:!0,selectedNodeRelativeIds:ot})}},setSidebarFilter:nt=>tt({sidebarFilter:nt}),setSelectedTimestamp:nt=>tt({selectedTimestamp:nt}),setSources:nt=>tt({sources:nt}),setSphinxModalOpen:nt=>tt({sphinxModalIsOpen:nt}),setCameraFocusTrigger:nt=>tt({cameraFocusTrigger:nt}),setNearbyNodeIds:nt=>{const it=et().nearbyNodeIds;(nt.length!==it.length||nt[0]!==it[0])&&tt({nearbyNodeIds:nt})},setShowSelectionGraph:nt=>tt({showSelectionGraph:nt}),setHideNodeDetails:nt=>tt({hideNodeDetails:nt}),setTeachMe:nt=>tt({showTeachMe:nt})})),useSelectedNode=()=>useDataStore(tt=>tt.selectedNode),useFilteredNodes=()=>useDataStore(tt=>{var et;return(((et=tt.data)==null?void 0:et.nodes)||[]).filter(nt=>tt.sidebarFilter==="all"?!0:nt.node_type===tt.sidebarFilter)}),common={black:"#000",white:"#fff"},common$1=common,red={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},red$1=red,purple={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},purple$1=purple,blue={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},blue$1=blue,lightBlue={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},lightBlue$1=lightBlue,green={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},green$1=green,orange={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},orange$1=orange,grey={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},grey$1=grey;function isPlainObject$4(tt){return tt!==null&&typeof tt=="object"&&tt.constructor===Object}function deepClone(tt){if(!isPlainObject$4(tt))return tt;const et={};return Object.keys(tt).forEach(nt=>{et[nt]=deepClone(tt[nt])}),et}function deepmerge$1(tt,et,nt={clone:!0}){const it=nt.clone?_extends$t({},tt):tt;return isPlainObject$4(tt)&&isPlainObject$4(et)&&Object.keys(et).forEach(rt=>{rt!=="__proto__"&&(isPlainObject$4(et[rt])&&rt in tt&&isPlainObject$4(tt[rt])?it[rt]=deepmerge$1(tt[rt],et[rt],nt):nt.clone?it[rt]=isPlainObject$4(et[rt])?deepClone(et[rt]):et[rt]:it[rt]=et[rt])}),it}function formatMuiErrorMessage(tt){let et="https://mui.com/production-error/?code="+tt;for(let nt=1;ntnt==null?et:function(...rt){et.apply(this,rt),nt.apply(this,rt)},()=>{})}function debounce$4(tt,et=166){let nt;function it(...rt){const ot=()=>{tt.apply(this,rt)};clearTimeout(nt),nt=setTimeout(ot,et)}return it.clear=()=>{clearTimeout(nt)},it}function isMuiElement(tt,et){var nt,it;return reactExports.isValidElement(tt)&&et.indexOf((nt=tt.type.muiName)!=null?nt:(it=tt.type)==null||(it=it._payload)==null||(it=it.value)==null?void 0:it.muiName)!==-1}function ownerDocument(tt){return tt&&tt.ownerDocument||document}function ownerWindow(tt){return ownerDocument(tt).defaultView||window}function setRef(tt,et){typeof tt=="function"?tt(et):tt&&(tt.current=et)}const useEnhancedEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,useEnhancedEffect$1=useEnhancedEffect;let globalId=0;function useGlobalId(tt){const[et,nt]=reactExports.useState(tt),it=tt||et;return reactExports.useEffect(()=>{et==null&&(globalId+=1,nt(`mui-${globalId}`))},[et]),it}const maybeReactUseId=React$2["useId".toString()];function useId(tt){if(maybeReactUseId!==void 0){const et=maybeReactUseId();return tt??et}return useGlobalId(tt)}function useControlled({controlled:tt,default:et,name:nt,state:it="value"}){const{current:rt}=reactExports.useRef(tt!==void 0),[ot,at]=reactExports.useState(et),st=rt?tt:ot,lt=reactExports.useCallback(ct=>{rt||at(ct)},[]);return[st,lt]}function useEventCallback(tt){const et=reactExports.useRef(tt);return useEnhancedEffect$1(()=>{et.current=tt}),reactExports.useRef((...nt)=>(0,et.current)(...nt)).current}function useForkRef(...tt){return reactExports.useMemo(()=>tt.every(et=>et==null)?null:et=>{tt.forEach(nt=>{setRef(nt,et)})},tt)}let hadKeyboardEvent=!0,hadFocusVisibleRecently=!1,hadFocusVisibleRecentlyTimeout;const inputTypesWhitelist={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 focusTriggersKeyboardModality(tt){const{type:et,tagName:nt}=tt;return!!(nt==="INPUT"&&inputTypesWhitelist[et]&&!tt.readOnly||nt==="TEXTAREA"&&!tt.readOnly||tt.isContentEditable)}function handleKeyDown(tt){tt.metaKey||tt.altKey||tt.ctrlKey||(hadKeyboardEvent=!0)}function handlePointerDown$1(){hadKeyboardEvent=!1}function handleVisibilityChange(){this.visibilityState==="hidden"&&hadFocusVisibleRecently&&(hadKeyboardEvent=!0)}function prepare$1(tt){tt.addEventListener("keydown",handleKeyDown,!0),tt.addEventListener("mousedown",handlePointerDown$1,!0),tt.addEventListener("pointerdown",handlePointerDown$1,!0),tt.addEventListener("touchstart",handlePointerDown$1,!0),tt.addEventListener("visibilitychange",handleVisibilityChange,!0)}function isFocusVisible(tt){const{target:et}=tt;try{return et.matches(":focus-visible")}catch{}return hadKeyboardEvent||focusTriggersKeyboardModality(et)}function useIsFocusVisible(){const tt=reactExports.useCallback(rt=>{rt!=null&&prepare$1(rt.ownerDocument)},[]),et=reactExports.useRef(!1);function nt(){return et.current?(hadFocusVisibleRecently=!0,window.clearTimeout(hadFocusVisibleRecentlyTimeout),hadFocusVisibleRecentlyTimeout=window.setTimeout(()=>{hadFocusVisibleRecently=!1},100),et.current=!1,!0):!1}function it(rt){return isFocusVisible(rt)?(et.current=!0,!0):!1}return{isFocusVisibleRef:et,onFocus:it,onBlur:nt,ref:tt}}function getScrollbarSize(tt){const et=tt.documentElement.clientWidth;return Math.abs(window.innerWidth-et)}let cachedType;function detectScrollType(){if(cachedType)return cachedType;const tt=document.createElement("div"),et=document.createElement("div");return et.style.width="10px",et.style.height="1px",tt.appendChild(et),tt.dir="rtl",tt.style.fontSize="14px",tt.style.width="4px",tt.style.height="1px",tt.style.position="absolute",tt.style.top="-1000px",tt.style.overflow="scroll",document.body.appendChild(tt),cachedType="reverse",tt.scrollLeft>0?cachedType="default":(tt.scrollLeft=1,tt.scrollLeft===0&&(cachedType="negative")),document.body.removeChild(tt),cachedType}function getNormalizedScrollLeft(tt,et){const nt=tt.scrollLeft;if(et!=="rtl")return nt;switch(detectScrollType()){case"negative":return tt.scrollWidth-tt.clientWidth+nt;case"reverse":return tt.scrollWidth-tt.clientWidth-nt;default:return nt}}const visuallyHidden={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},visuallyHidden$1=visuallyHidden;function resolveProps(tt,et){const nt=_extends$t({},et);return Object.keys(tt).forEach(it=>{if(it.toString().match(/^(components|slots)$/))nt[it]=_extends$t({},tt[it],nt[it]);else if(it.toString().match(/^(componentsProps|slotProps)$/)){const rt=tt[it]||{},ot=et[it];nt[it]={},!ot||!Object.keys(ot)?nt[it]=rt:!rt||!Object.keys(rt)?nt[it]=ot:(nt[it]=_extends$t({},ot),Object.keys(rt).forEach(at=>{nt[it][at]=resolveProps(rt[at],ot[at])}))}else nt[it]===void 0&&(nt[it]=tt[it])}),nt}function composeClasses(tt,et,nt=void 0){const it={};return Object.keys(tt).forEach(rt=>{it[rt]=tt[rt].reduce((ot,at)=>{if(at){const st=et(at);st!==""&&ot.push(st),nt&&nt[at]&&ot.push(nt[at])}return ot},[]).join(" ")}),it}const defaultGenerator=tt=>tt,createClassNameGenerator=()=>{let tt=defaultGenerator;return{configure(et){tt=et},generate(et){return tt(et)},reset(){tt=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator(),ClassNameGenerator$1=ClassNameGenerator,globalStateClassesMapping={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function generateUtilityClass(tt,et,nt="Mui"){const it=globalStateClassesMapping[et];return it?`${nt}-${it}`:`${ClassNameGenerator$1.generate(tt)}-${et}`}function generateUtilityClasses(tt,et,nt="Mui"){const it={};return et.forEach(rt=>{it[rt]=generateUtilityClass(tt,rt,nt)}),it}const THEME_ID="$$material";function _objectWithoutPropertiesLoose$m(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function sheetForTag(tt){if(tt.sheet)return tt.sheet;for(var et=0;et0?charat(characters,--position$2):0,column--,character===10&&(column=1,line--),character}function next(){return character=position$22||token(character)>3?"":" "}function escaping(tt,et){for(;--et&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(tt,caret()+(et<6&&peek()==32&&next()==32))}function delimiter(tt){for(;next();)switch(character){case tt:return position$2;case 34:case 39:tt!==34&&tt!==39&&delimiter(character);break;case 40:tt===41&&delimiter(tt);break;case 92:next();break}return position$2}function commenter(tt,et){for(;next()&&tt+character!==47+10;)if(tt+character===42+42&&peek()===47)break;return"/*"+slice(et,position$2-1)+"*"+from(tt===47?tt:next())}function identifier(tt){for(;!token(peek());)next();return slice(tt,position$2)}function compile(tt){return dealloc(parse$2("",null,null,null,[""],tt=alloc(tt),0,[0],tt))}function parse$2(tt,et,nt,it,rt,ot,at,st,lt){for(var ct=0,ut=0,ht=at,dt=0,pt=0,mt=0,gt=1,bt=1,yt=1,wt=0,vt="",xt=rt,St=ot,Et=it,$t=vt;bt;)switch(mt=wt,wt=next()){case 40:if(mt!=108&&charat($t,ht-1)==58){indexof($t+=replace(delimit(wt),"&","&\f"),"&\f")!=-1&&(yt=-1);break}case 34:case 39:case 91:$t+=delimit(wt);break;case 9:case 10:case 13:case 32:$t+=whitespace$1(mt);break;case 92:$t+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append$1(comment(commenter(next(),caret()),et,nt),lt);break;default:$t+="/"}break;case 123*gt:st[ct++]=strlen($t)*yt;case 125*gt:case 59:case 0:switch(wt){case 0:case 125:bt=0;case 59+ut:yt==-1&&($t=replace($t,/\f/g,"")),pt>0&&strlen($t)-ht&&append$1(pt>32?declaration($t+";",it,nt,ht-1):declaration(replace($t," ","")+";",it,nt,ht-2),lt);break;case 59:$t+=";";default:if(append$1(Et=ruleset($t,et,nt,ct,ut,rt,st,vt,xt=[],St=[],ht),ot),wt===123)if(ut===0)parse$2($t,et,Et,Et,xt,ot,ht,st,St);else switch(dt===99&&charat($t,3)===110?100:dt){case 100:case 108:case 109:case 115:parse$2(tt,Et,Et,it&&append$1(ruleset(tt,Et,Et,0,0,rt,st,vt,rt,xt=[],ht),St),rt,St,ht,st,it?xt:St);break;default:parse$2($t,Et,Et,Et,[""],St,0,st,St)}}ct=ut=pt=0,gt=yt=1,vt=$t="",ht=at;break;case 58:ht=1+strlen($t),pt=mt;default:if(gt<1){if(wt==123)--gt;else if(wt==125&>++==0&&prev$1()==125)continue}switch($t+=from(wt),wt*gt){case 38:yt=ut>0?1:($t+="\f",-1);break;case 44:st[ct++]=(strlen($t)-1)*yt,yt=1;break;case 64:peek()===45&&($t+=delimit(next())),dt=peek(),ut=ht=strlen(vt=$t+=identifier(caret())),wt++;break;case 45:mt===45&&strlen($t)==2&&(gt=0)}}return ot}function ruleset(tt,et,nt,it,rt,ot,at,st,lt,ct,ut){for(var ht=rt-1,dt=rt===0?ot:[""],pt=sizeof(dt),mt=0,gt=0,bt=0;mt0?dt[yt]+" "+wt:replace(wt,/&\f/g,dt[yt])))&&(lt[bt++]=vt);return node$2(tt,et,nt,rt===0?RULESET:st,lt,ct,ut)}function comment(tt,et,nt){return node$2(tt,et,nt,COMMENT,from(char()),substr(tt,2,-2),0)}function declaration(tt,et,nt,it){return node$2(tt,et,nt,DECLARATION,substr(tt,0,it),substr(tt,it+1,-1),it)}function serialize$1(tt,et){for(var nt="",it=sizeof(tt),rt=0;rt6)switch(charat(tt,et+1)){case 109:if(charat(tt,et+4)!==45)break;case 102:return replace(tt,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(tt,et+3)==108?"$3":"$2-$3"))+tt;case 115:return~indexof(tt,"stretch")?prefix$1(replace(tt,"stretch","fill-available"),et)+tt:tt}break;case 4949:if(charat(tt,et+1)!==115)break;case 6444:switch(charat(tt,strlen(tt)-3-(~indexof(tt,"!important")&&10))){case 107:return replace(tt,":",":"+WEBKIT)+tt;case 101:return replace(tt,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(tt,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+tt}break;case 5936:switch(charat(tt,et+11)){case 114:return WEBKIT+tt+MS+replace(tt,/[svh]\w+-[tblr]{2}/,"tb")+tt;case 108:return WEBKIT+tt+MS+replace(tt,/[svh]\w+-[tblr]{2}/,"tb-rl")+tt;case 45:return WEBKIT+tt+MS+replace(tt,/[svh]\w+-[tblr]{2}/,"lr")+tt}return WEBKIT+tt+MS+tt+tt}return tt}var prefixer=function(et,nt,it,rt){if(et.length>-1&&!et.return)switch(et.type){case DECLARATION:et.return=prefix$1(et.value,et.length);break;case KEYFRAMES:return serialize$1([copy$2(et,{value:replace(et.value,"@","@"+WEBKIT)})],rt);case RULESET:if(et.length)return combine(et.props,function(ot){switch(match(ot,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize$1([copy$2(et,{props:[replace(ot,/:(read-\w+)/,":"+MOZ+"$1")]})],rt);case"::placeholder":return serialize$1([copy$2(et,{props:[replace(ot,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy$2(et,{props:[replace(ot,/:(plac\w+)/,":"+MOZ+"$1")]}),copy$2(et,{props:[replace(ot,/:(plac\w+)/,MS+"input-$1")]})],rt)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(et){var nt=et.key;if(nt==="css"){var it=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(it,function(gt){var bt=gt.getAttribute("data-emotion");bt.indexOf(" ")!==-1&&(document.head.appendChild(gt),gt.setAttribute("data-s",""))})}var rt=et.stylisPlugins||defaultStylisPlugins,ot={},at,st=[];at=et.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+nt+' "]'),function(gt){for(var bt=gt.getAttribute("data-emotion").split(" "),yt=1;yt=4;++it,rt-=4)nt=tt.charCodeAt(it)&255|(tt.charCodeAt(++it)&255)<<8|(tt.charCodeAt(++it)&255)<<16|(tt.charCodeAt(++it)&255)<<24,nt=(nt&65535)*1540483477+((nt>>>16)*59797<<16),nt^=nt>>>24,et=(nt&65535)*1540483477+((nt>>>16)*59797<<16)^(et&65535)*1540483477+((et>>>16)*59797<<16);switch(rt){case 3:et^=(tt.charCodeAt(it+2)&255)<<16;case 2:et^=(tt.charCodeAt(it+1)&255)<<8;case 1:et^=tt.charCodeAt(it)&255,et=(et&65535)*1540483477+((et>>>16)*59797<<16)}return et^=et>>>13,et=(et&65535)*1540483477+((et>>>16)*59797<<16),((et^et>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(et){return et.charCodeAt(1)===45},isProcessableValue=function(et){return et!=null&&typeof et!="boolean"},processStyleName=memoize$4(function(tt){return isCustomProperty(tt)?tt:tt.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(et,nt){switch(et){case"animation":case"animationName":if(typeof nt=="string")return nt.replace(animationRegex,function(it,rt,ot){return cursor={name:rt,styles:ot,next:cursor},rt})}return unitlessKeys[et]!==1&&!isCustomProperty(et)&&typeof nt=="number"&&nt!==0?nt+"px":nt},noComponentSelectorMessage="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function handleInterpolation(tt,et,nt){if(nt==null)return"";if(nt.__emotion_styles!==void 0)return nt;switch(typeof nt){case"boolean":return"";case"object":{if(nt.anim===1)return cursor={name:nt.name,styles:nt.styles,next:cursor},nt.name;if(nt.styles!==void 0){var it=nt.next;if(it!==void 0)for(;it!==void 0;)cursor={name:it.name,styles:it.styles,next:cursor},it=it.next;var rt=nt.styles+";";return rt}return createStringFromObject(tt,et,nt)}case"function":{if(tt!==void 0){var ot=cursor,at=nt(tt);return cursor=ot,handleInterpolation(tt,et,at)}break}}if(et==null)return nt;var st=et[nt];return st!==void 0?st:nt}function createStringFromObject(tt,et,nt){var it="";if(Array.isArray(nt))for(var rt=0;rt96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(et,nt,it){var rt;if(nt){var ot=nt.shouldForwardProp;rt=et.__emotion_forwardProp&&ot?function(at){return et.__emotion_forwardProp(at)&&ot(at)}:ot}return typeof rt!="function"&&it&&(rt=et.__emotion_forwardProp),rt},Insertion=function(et){var nt=et.cache,it=et.serialized,rt=et.isStringTag;return registerStyles(nt,it,rt),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(nt,it,rt)}),null},createStyled$1=function tt(et,nt){var it=et.__emotion_real===et,rt=it&&et.__emotion_base||et,ot,at;nt!==void 0&&(ot=nt.label,at=nt.target);var st=composeShouldForwardProps(et,nt,it),lt=st||getDefaultShouldForwardProp(rt),ct=!lt("as");return function(){var ut=arguments,ht=it&&et.__emotion_styles!==void 0?et.__emotion_styles.slice(0):[];if(ot!==void 0&&ht.push("label:"+ot+";"),ut[0]==null||ut[0].raw===void 0)ht.push.apply(ht,ut);else{ht.push(ut[0][0]);for(var dt=ut.length,pt=1;ptet(isEmpty$4(rt)?nt:rt):et;return jsxRuntimeExports.jsx(Global$1,{styles:it})}/** + * @mui/styled-engine v5.15.1 * * @license MIT * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function styled$3(tt,et){return newStyled(tt,et)}const internal_processStyles=(tt,et)=>{Array.isArray(tt.__emotion_styles)&&(tt.__emotion_styles=et(tt.__emotion_styles))},_excluded$1f=["values","unit","step"],sortBreakpointsValues=tt=>{const et=Object.keys(tt).map(nt=>({key:nt,val:tt[nt]}))||[];return et.sort((nt,it)=>nt.val-it.val),et.reduce((nt,it)=>_extends$u({},nt,{[it.key]:it.val}),{})};function createBreakpoints(tt){const{values:et={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:nt="px",step:it=5}=tt,rt=_objectWithoutPropertiesLoose$m(tt,_excluded$1f),ot=sortBreakpointsValues(et),at=Object.keys(ot);function st(dt){return`@media (min-width:${typeof et[dt]=="number"?et[dt]:dt}${nt})`}function lt(dt){return`@media (max-width:${(typeof et[dt]=="number"?et[dt]:dt)-it/100}${nt})`}function ct(dt,pt){const mt=at.indexOf(pt);return`@media (min-width:${typeof et[dt]=="number"?et[dt]:dt}${nt}) and (max-width:${(mt!==-1&&typeof et[at[mt]]=="number"?et[at[mt]]:pt)-it/100}${nt})`}function ut(dt){return at.indexOf(dt)+1`@media (min-width:${values$1[tt]}px)`};function handleBreakpoints(tt,et,nt){const it=tt.theme||{};if(Array.isArray(et)){const ot=it.breakpoints||defaultBreakpoints;return et.reduce((at,st,lt)=>(at[ot.up(ot.keys[lt])]=nt(et[lt]),at),{})}if(typeof et=="object"){const ot=it.breakpoints||defaultBreakpoints;return Object.keys(et).reduce((at,st)=>{if(Object.keys(ot.values||values$1).indexOf(st)!==-1){const lt=ot.up(st);at[lt]=nt(et[st],st)}else{const lt=st;at[lt]=et[lt]}return at},{})}return nt(et)}function createEmptyBreakpointObject(tt={}){var et;return((et=tt.keys)==null?void 0:et.reduce((it,rt)=>{const ot=tt.up(rt);return it[ot]={},it},{}))||{}}function removeUnusedBreakpoints(tt,et){return tt.reduce((nt,it)=>{const rt=nt[it];return(!rt||Object.keys(rt).length===0)&&delete nt[it],nt},et)}function mergeBreakpointsInOrder(tt,...et){const nt=createEmptyBreakpointObject(tt),it=[nt,...et].reduce((rt,ot)=>deepmerge$1(rt,ot),{});return removeUnusedBreakpoints(Object.keys(nt),it)}function computeBreakpointsBase(tt,et){if(typeof tt!="object")return{};const nt={},it=Object.keys(et);return Array.isArray(tt)?it.forEach((rt,ot)=>{ot{tt[rt]!=null&&(nt[rt]=!0)}),nt}function resolveBreakpointValues({values:tt,breakpoints:et,base:nt}){const it=nt||computeBreakpointsBase(tt,et),rt=Object.keys(it);if(rt.length===0)return tt;let ot;return rt.reduce((at,st,lt)=>(Array.isArray(tt)?(at[st]=tt[lt]!=null?tt[lt]:tt[ot],ot=lt):typeof tt=="object"?(at[st]=tt[st]!=null?tt[st]:tt[ot],ot=st):at[st]=tt,at),{})}function getPath$2(tt,et,nt=!0){if(!et||typeof et!="string")return null;if(tt&&tt.vars&&nt){const it=`vars.${et}`.split(".").reduce((rt,ot)=>rt&&rt[ot]?rt[ot]:null,tt);if(it!=null)return it}return et.split(".").reduce((it,rt)=>it&&it[rt]!=null?it[rt]:null,tt)}function getStyleValue$1(tt,et,nt,it=nt){let rt;return typeof tt=="function"?rt=tt(nt):Array.isArray(tt)?rt=tt[nt]||it:rt=getPath$2(tt,nt)||it,et&&(rt=et(rt,it,tt)),rt}function style$5(tt){const{prop:et,cssProperty:nt=tt.prop,themeKey:it,transform:rt}=tt,ot=at=>{if(at[et]==null)return null;const st=at[et],lt=at.theme,ct=getPath$2(lt,it)||{};return handleBreakpoints(at,st,ht=>{let dt=getStyleValue$1(ct,rt,ht);return ht===dt&&typeof ht=="string"&&(dt=getStyleValue$1(ct,rt,`${et}${ht==="default"?"":capitalize(ht)}`,ht)),nt===!1?dt:{[nt]:dt}})};return ot.propTypes={},ot.filterProps=[et],ot}function memoize$3(tt){const et={};return nt=>(et[nt]===void 0&&(et[nt]=tt(nt)),et[nt])}const properties={m:"margin",p:"padding"},directions={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},aliases={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},getCssProperties=memoize$3(tt=>{if(tt.length>2)if(aliases[tt])tt=aliases[tt];else return[tt];const[et,nt]=tt.split(""),it=properties[et],rt=directions[nt]||"";return Array.isArray(rt)?rt.map(ot=>it+ot):[it+rt]}),marginKeys=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],paddingKeys=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...marginKeys,...paddingKeys];function createUnaryUnit(tt,et,nt,it){var rt;const ot=(rt=getPath$2(tt,et,!1))!=null?rt:nt;return typeof ot=="number"?at=>typeof at=="string"?at:ot*at:Array.isArray(ot)?at=>typeof at=="string"?at:ot[at]:typeof ot=="function"?ot:()=>{}}function createUnarySpacing(tt){return createUnaryUnit(tt,"spacing",8)}function getValue(tt,et){if(typeof et=="string"||et==null)return et;const nt=Math.abs(et),it=tt(nt);return et>=0?it:typeof it=="number"?-it:`-${it}`}function getStyleFromPropValue(tt,et){return nt=>tt.reduce((it,rt)=>(it[rt]=getValue(et,nt),it),{})}function resolveCssProperty(tt,et,nt,it){if(et.indexOf(nt)===-1)return null;const rt=getCssProperties(nt),ot=getStyleFromPropValue(rt,it),at=tt[nt];return handleBreakpoints(tt,at,ot)}function style$4(tt,et){const nt=createUnarySpacing(tt.theme);return Object.keys(tt).map(it=>resolveCssProperty(tt,et,it,nt)).reduce(merge$1,{})}function margin(tt){return style$4(tt,marginKeys)}margin.propTypes={};margin.filterProps=marginKeys;function padding(tt){return style$4(tt,paddingKeys)}padding.propTypes={};padding.filterProps=paddingKeys;function createSpacing(tt=8){if(tt.mui)return tt;const et=createUnarySpacing({spacing:tt}),nt=(...it)=>(it.length===0?[1]:it).map(ot=>{const at=et(ot);return typeof at=="number"?`${at}px`:at}).join(" ");return nt.mui=!0,nt}function compose$1(...tt){const et=tt.reduce((it,rt)=>(rt.filterProps.forEach(ot=>{it[ot]=rt}),it),{}),nt=it=>Object.keys(it).reduce((rt,ot)=>et[ot]?merge$1(rt,et[ot](it)):rt,{});return nt.propTypes={},nt.filterProps=tt.reduce((it,rt)=>it.concat(rt.filterProps),[]),nt}function borderTransform(tt){return typeof tt!="number"?tt:`${tt}px solid`}function createBorderStyle(tt,et){return style$5({prop:tt,themeKey:"borders",transform:et})}const border=createBorderStyle("border",borderTransform),borderTop=createBorderStyle("borderTop",borderTransform),borderRight=createBorderStyle("borderRight",borderTransform),borderBottom=createBorderStyle("borderBottom",borderTransform),borderLeft=createBorderStyle("borderLeft",borderTransform),borderColor=createBorderStyle("borderColor"),borderTopColor=createBorderStyle("borderTopColor"),borderRightColor=createBorderStyle("borderRightColor"),borderBottomColor=createBorderStyle("borderBottomColor"),borderLeftColor=createBorderStyle("borderLeftColor"),outline=createBorderStyle("outline",borderTransform),outlineColor=createBorderStyle("outlineColor"),borderRadius=tt=>{if(tt.borderRadius!==void 0&&tt.borderRadius!==null){const et=createUnaryUnit(tt.theme,"shape.borderRadius",4),nt=it=>({borderRadius:getValue(et,it)});return handleBreakpoints(tt,tt.borderRadius,nt)}return null};borderRadius.propTypes={};borderRadius.filterProps=["borderRadius"];compose$1(border,borderTop,borderRight,borderBottom,borderLeft,borderColor,borderTopColor,borderRightColor,borderBottomColor,borderLeftColor,borderRadius,outline,outlineColor);const gap=tt=>{if(tt.gap!==void 0&&tt.gap!==null){const et=createUnaryUnit(tt.theme,"spacing",8),nt=it=>({gap:getValue(et,it)});return handleBreakpoints(tt,tt.gap,nt)}return null};gap.propTypes={};gap.filterProps=["gap"];const columnGap=tt=>{if(tt.columnGap!==void 0&&tt.columnGap!==null){const et=createUnaryUnit(tt.theme,"spacing",8),nt=it=>({columnGap:getValue(et,it)});return handleBreakpoints(tt,tt.columnGap,nt)}return null};columnGap.propTypes={};columnGap.filterProps=["columnGap"];const rowGap=tt=>{if(tt.rowGap!==void 0&&tt.rowGap!==null){const et=createUnaryUnit(tt.theme,"spacing",8),nt=it=>({rowGap:getValue(et,it)});return handleBreakpoints(tt,tt.rowGap,nt)}return null};rowGap.propTypes={};rowGap.filterProps=["rowGap"];const gridColumn=style$5({prop:"gridColumn"}),gridRow=style$5({prop:"gridRow"}),gridAutoFlow=style$5({prop:"gridAutoFlow"}),gridAutoColumns=style$5({prop:"gridAutoColumns"}),gridAutoRows=style$5({prop:"gridAutoRows"}),gridTemplateColumns=style$5({prop:"gridTemplateColumns"}),gridTemplateRows=style$5({prop:"gridTemplateRows"}),gridTemplateAreas=style$5({prop:"gridTemplateAreas"}),gridArea=style$5({prop:"gridArea"});compose$1(gap,columnGap,rowGap,gridColumn,gridRow,gridAutoFlow,gridAutoColumns,gridAutoRows,gridTemplateColumns,gridTemplateRows,gridTemplateAreas,gridArea);function paletteTransform(tt,et){return et==="grey"?et:tt}const color$3=style$5({prop:"color",themeKey:"palette",transform:paletteTransform}),bgcolor=style$5({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:paletteTransform}),backgroundColor=style$5({prop:"backgroundColor",themeKey:"palette",transform:paletteTransform});compose$1(color$3,bgcolor,backgroundColor);function sizingTransform(tt){return tt<=1&&tt!==0?`${tt*100}%`:tt}const width=style$5({prop:"width",transform:sizingTransform}),maxWidth=tt=>{if(tt.maxWidth!==void 0&&tt.maxWidth!==null){const et=nt=>{var it,rt;const ot=((it=tt.theme)==null||(it=it.breakpoints)==null||(it=it.values)==null?void 0:it[nt])||values$1[nt];return ot?((rt=tt.theme)==null||(rt=rt.breakpoints)==null?void 0:rt.unit)!=="px"?{maxWidth:`${ot}${tt.theme.breakpoints.unit}`}:{maxWidth:ot}:{maxWidth:sizingTransform(nt)}};return handleBreakpoints(tt,tt.maxWidth,et)}return null};maxWidth.filterProps=["maxWidth"];const minWidth=style$5({prop:"minWidth",transform:sizingTransform}),height=style$5({prop:"height",transform:sizingTransform}),maxHeight=style$5({prop:"maxHeight",transform:sizingTransform}),minHeight=style$5({prop:"minHeight",transform:sizingTransform});style$5({prop:"size",cssProperty:"width",transform:sizingTransform});style$5({prop:"size",cssProperty:"height",transform:sizingTransform});const boxSizing=style$5({prop:"boxSizing"});compose$1(width,maxWidth,minWidth,height,maxHeight,minHeight,boxSizing);const defaultSxConfig={border:{themeKey:"borders",transform:borderTransform},borderTop:{themeKey:"borders",transform:borderTransform},borderRight:{themeKey:"borders",transform:borderTransform},borderBottom:{themeKey:"borders",transform:borderTransform},borderLeft:{themeKey:"borders",transform:borderTransform},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:borderTransform},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:borderRadius},color:{themeKey:"palette",transform:paletteTransform},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:paletteTransform},backgroundColor:{themeKey:"palette",transform:paletteTransform},p:{style:padding},pt:{style:padding},pr:{style:padding},pb:{style:padding},pl:{style:padding},px:{style:padding},py:{style:padding},padding:{style:padding},paddingTop:{style:padding},paddingRight:{style:padding},paddingBottom:{style:padding},paddingLeft:{style:padding},paddingX:{style:padding},paddingY:{style:padding},paddingInline:{style:padding},paddingInlineStart:{style:padding},paddingInlineEnd:{style:padding},paddingBlock:{style:padding},paddingBlockStart:{style:padding},paddingBlockEnd:{style:padding},m:{style:margin},mt:{style:margin},mr:{style:margin},mb:{style:margin},ml:{style:margin},mx:{style:margin},my:{style:margin},margin:{style:margin},marginTop:{style:margin},marginRight:{style:margin},marginBottom:{style:margin},marginLeft:{style:margin},marginX:{style:margin},marginY:{style:margin},marginInline:{style:margin},marginInlineStart:{style:margin},marginInlineEnd:{style:margin},marginBlock:{style:margin},marginBlockStart:{style:margin},marginBlockEnd:{style:margin},displayPrint:{cssProperty:!1,transform:tt=>({"@media print":{display:tt}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:gap},rowGap:{style:rowGap},columnGap:{style:columnGap},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sizingTransform},maxWidth:{style:maxWidth},minWidth:{transform:sizingTransform},height:{transform:sizingTransform},maxHeight:{transform:sizingTransform},minHeight:{transform:sizingTransform},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},defaultSxConfig$1=defaultSxConfig;function objectsHaveSameKeys(...tt){const et=tt.reduce((it,rt)=>it.concat(Object.keys(rt)),[]),nt=new Set(et);return tt.every(it=>nt.size===Object.keys(it).length)}function callIfFn(tt,et){return typeof tt=="function"?tt(et):tt}function unstable_createStyleFunctionSx(){function tt(nt,it,rt,ot){const at={[nt]:it,theme:rt},st=ot[nt];if(!st)return{[nt]:it};const{cssProperty:lt=nt,themeKey:ct,transform:ut,style:ht}=st;if(it==null)return null;if(ct==="typography"&&it==="inherit")return{[nt]:it};const dt=getPath$2(rt,ct)||{};return ht?ht(at):handleBreakpoints(at,it,mt=>{let gt=getStyleValue$1(dt,ut,mt);return mt===gt&&typeof mt=="string"&&(gt=getStyleValue$1(dt,ut,`${nt}${mt==="default"?"":capitalize(mt)}`,mt)),lt===!1?gt:{[lt]:gt}})}function et(nt){var it;const{sx:rt,theme:ot={}}=nt||{};if(!rt)return null;const at=(it=ot.unstable_sxConfig)!=null?it:defaultSxConfig$1;function st(lt){let ct=lt;if(typeof lt=="function")ct=lt(ot);else if(typeof lt!="object")return lt;if(!ct)return null;const ut=createEmptyBreakpointObject(ot.breakpoints),ht=Object.keys(ut);let dt=ut;return Object.keys(ct).forEach(pt=>{const mt=callIfFn(ct[pt],ot);if(mt!=null)if(typeof mt=="object")if(at[pt])dt=merge$1(dt,tt(pt,mt,ot,at));else{const gt=handleBreakpoints({theme:ot},mt,bt=>({[pt]:bt}));objectsHaveSameKeys(gt,mt)?dt[pt]=et({sx:mt,theme:ot}):dt=merge$1(dt,gt)}else dt=merge$1(dt,tt(pt,mt,ot,at))}),removeUnusedBreakpoints(ht,dt)}return Array.isArray(rt)?rt.map(st):st(rt)}return et}const styleFunctionSx=unstable_createStyleFunctionSx();styleFunctionSx.filterProps=["sx"];const styleFunctionSx$1=styleFunctionSx,_excluded$1e=["breakpoints","palette","spacing","shape"];function createTheme$1(tt={},...et){const{breakpoints:nt={},palette:it={},spacing:rt,shape:ot={}}=tt,at=_objectWithoutPropertiesLoose$m(tt,_excluded$1e),st=createBreakpoints(nt),lt=createSpacing(rt);let ct=deepmerge$1({breakpoints:st,direction:"ltr",components:{},palette:_extends$u({mode:"light"},it),spacing:lt,shape:_extends$u({},shape$2,ot)},at);return ct=et.reduce((ut,ht)=>deepmerge$1(ut,ht),ct),ct.unstable_sxConfig=_extends$u({},defaultSxConfig$1,at==null?void 0:at.unstable_sxConfig),ct.unstable_sx=function(ht){return styleFunctionSx$1({sx:ht,theme:this})},ct}function isObjectEmpty(tt){return Object.keys(tt).length===0}function useTheme$3(tt=null){const et=reactExports.useContext(ThemeContext$2);return!et||isObjectEmpty(et)?tt:et}const systemDefaultTheme$1=createTheme$1();function useTheme$2(tt=systemDefaultTheme$1){return useTheme$3(tt)}function GlobalStyles$1({styles:tt,themeId:et,defaultTheme:nt={}}){const it=useTheme$2(nt),rt=typeof tt=="function"?tt(et&&it[et]||it):tt;return jsxRuntimeExports.jsx(GlobalStyles$2,{styles:rt})}const _excluded$1d=["sx"],splitProps=tt=>{var et,nt;const it={systemProps:{},otherProps:{}},rt=(et=tt==null||(nt=tt.theme)==null?void 0:nt.unstable_sxConfig)!=null?et:defaultSxConfig$1;return Object.keys(tt).forEach(ot=>{rt[ot]?it.systemProps[ot]=tt[ot]:it.otherProps[ot]=tt[ot]}),it};function extendSxProp(tt){const{sx:et}=tt,nt=_objectWithoutPropertiesLoose$m(tt,_excluded$1d),{systemProps:it,otherProps:rt}=splitProps(nt);let ot;return Array.isArray(et)?ot=[it,...et]:typeof et=="function"?ot=(...at)=>{const st=et(...at);return isPlainObject$4(st)?_extends$u({},it,st):it}:ot=_extends$u({},it,et),_extends$u({},rt,{sx:ot})}function r$6(tt){var et,nt,it="";if(typeof tt=="string"||typeof tt=="number")it+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et{rt==="color"?it+=isEmpty$3(it)?tt[rt]:capitalize(tt[rt]):it+=`${isEmpty$3(it)?rt:capitalize(rt)}${capitalize(tt[rt].toString())}`}),it}const _excluded$1b=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function isEmpty$2(tt){return Object.keys(tt).length===0}function isStringTag(tt){return typeof tt=="string"&&tt.charCodeAt(0)>96}const getStyleOverrides=(tt,et)=>et.components&&et.components[tt]&&et.components[tt].styleOverrides?et.components[tt].styleOverrides:null,transformVariants=tt=>{const et={};return tt&&tt.forEach(nt=>{const it=propsToClassKey(nt.props);et[it]=nt.style}),et},getVariantStyles=(tt,et)=>{let nt=[];return et&&et.components&&et.components[tt]&&et.components[tt].variants&&(nt=et.components[tt].variants),transformVariants(nt)},variantsResolver=(tt,et,nt)=>{const{ownerState:it={}}=tt,rt=[];return nt&&nt.forEach(ot=>{let at=!0;Object.keys(ot.props).forEach(st=>{it[st]!==ot.props[st]&&tt[st]!==ot.props[st]&&(at=!1)}),at&&rt.push(et[propsToClassKey(ot.props)])}),rt},themeVariantsResolver=(tt,et,nt,it)=>{var rt;const ot=nt==null||(rt=nt.components)==null||(rt=rt[it])==null?void 0:rt.variants;return variantsResolver(tt,et,ot)};function shouldForwardProp(tt){return tt!=="ownerState"&&tt!=="theme"&&tt!=="sx"&&tt!=="as"}const systemDefaultTheme=createTheme$1(),lowercaseFirstLetter=tt=>tt&&tt.charAt(0).toLowerCase()+tt.slice(1);function resolveTheme({defaultTheme:tt,theme:et,themeId:nt}){return isEmpty$2(et)?tt:et[nt]||et}function defaultOverridesResolver(tt){return tt?(et,nt)=>nt[tt]:null}const muiStyledFunctionResolver=({styledArg:tt,props:et,defaultTheme:nt,themeId:it})=>{const rt=tt(_extends$u({},et,{theme:resolveTheme(_extends$u({},et,{defaultTheme:nt,themeId:it}))}));let ot;if(rt&&rt.variants&&(ot=rt.variants,delete rt.variants),ot){const at=variantsResolver(et,transformVariants(ot),ot);return[rt,...at]}return rt};function createStyled(tt={}){const{themeId:et,defaultTheme:nt=systemDefaultTheme,rootShouldForwardProp:it=shouldForwardProp,slotShouldForwardProp:rt=shouldForwardProp}=tt,ot=at=>styleFunctionSx$1(_extends$u({},at,{theme:resolveTheme(_extends$u({},at,{defaultTheme:nt,themeId:et}))}));return ot.__mui_systemSx=!0,(at,st={})=>{internal_processStyles(at,xt=>xt.filter(St=>!(St!=null&&St.__mui_systemSx)));const{name:lt,slot:ct,skipVariantsResolver:ut,skipSx:ht,overridesResolver:dt=defaultOverridesResolver(lowercaseFirstLetter(ct))}=st,pt=_objectWithoutPropertiesLoose$m(st,_excluded$1b),mt=ut!==void 0?ut:ct&&ct!=="Root"&&ct!=="root"||!1,gt=ht||!1;let bt,yt=shouldForwardProp;ct==="Root"||ct==="root"?yt=it:ct?yt=rt:isStringTag(at)&&(yt=void 0);const wt=styled$3(at,_extends$u({shouldForwardProp:yt,label:bt},pt)),vt=(xt,...St)=>{const Et=St?St.map(Ut=>{if(typeof Ut=="function"&&Ut.__emotion_real!==Ut)return Lt=>muiStyledFunctionResolver({styledArg:Ut,props:Lt,defaultTheme:nt,themeId:et});if(isPlainObject$4(Ut)){let Lt=Ut,Bt;return Ut&&Ut.variants&&(Bt=Ut.variants,delete Lt.variants,Lt=Pt=>{let kt=Ut;return variantsResolver(Pt,transformVariants(Bt),Bt).forEach(Rt=>{kt=deepmerge$1(kt,Rt)}),kt}),Lt}return Ut}):[];let It=xt;if(isPlainObject$4(xt)){let Ut;xt&&xt.variants&&(Ut=xt.variants,delete It.variants,It=Lt=>{let Bt=xt;return variantsResolver(Lt,transformVariants(Ut),Ut).forEach(kt=>{Bt=deepmerge$1(Bt,kt)}),Bt})}else typeof xt=="function"&&xt.__emotion_real!==xt&&(It=Ut=>muiStyledFunctionResolver({styledArg:xt,props:Ut,defaultTheme:nt,themeId:et}));lt&&dt&&Et.push(Ut=>{const Lt=resolveTheme(_extends$u({},Ut,{defaultTheme:nt,themeId:et})),Bt=getStyleOverrides(lt,Lt);if(Bt){const Pt={};return Object.entries(Bt).forEach(([kt,At])=>{Pt[kt]=typeof At=="function"?At(_extends$u({},Ut,{theme:Lt})):At}),dt(Ut,Pt)}return null}),lt&&!mt&&Et.push(Ut=>{const Lt=resolveTheme(_extends$u({},Ut,{defaultTheme:nt,themeId:et}));return themeVariantsResolver(Ut,getVariantStyles(lt,Lt),Lt,lt)}),gt||Et.push(ot);const Tt=Et.length-St.length;if(Array.isArray(xt)&&Tt>0){const Ut=new Array(Tt).fill("");It=[...xt,...Ut],It.raw=[...xt.raw,...Ut]}const $t=wt(It,...Et);return at.muiName&&($t.muiName=at.muiName),$t};return wt.withConfig&&(vt.withConfig=wt.withConfig),vt}}const styled$2=createStyled(),systemStyled=styled$2;function getThemeProps(tt){const{theme:et,name:nt,props:it}=tt;return!et||!et.components||!et.components[nt]||!et.components[nt].defaultProps?it:resolveProps(et.components[nt].defaultProps,it)}function useThemeProps$1({props:tt,name:et,defaultTheme:nt,themeId:it}){let rt=useTheme$2(nt);return it&&(rt=rt[it]||rt),getThemeProps({theme:rt,name:et,props:tt})}function clamp$5(tt,et=0,nt=1){return Math.min(Math.max(et,tt),nt)}function hexToRgb(tt){tt=tt.slice(1);const et=new RegExp(`.{1,${tt.length>=6?2:1}}`,"g");let nt=tt.match(et);return nt&&nt[0].length===1&&(nt=nt.map(it=>it+it)),nt?`rgb${nt.length===4?"a":""}(${nt.map((it,rt)=>rt<3?parseInt(it,16):Math.round(parseInt(it,16)/255*1e3)/1e3).join(", ")})`:""}function decomposeColor(tt){if(tt.type)return tt;if(tt.charAt(0)==="#")return decomposeColor(hexToRgb(tt));const et=tt.indexOf("("),nt=tt.substring(0,et);if(["rgb","rgba","hsl","hsla","color"].indexOf(nt)===-1)throw new Error(formatMuiErrorMessage(9,tt));let it=tt.substring(et+1,tt.length-1),rt;if(nt==="color"){if(it=it.split(" "),rt=it.shift(),it.length===4&&it[3].charAt(0)==="/"&&(it[3]=it[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(rt)===-1)throw new Error(formatMuiErrorMessage(10,rt))}else it=it.split(",");return it=it.map(ot=>parseFloat(ot)),{type:nt,values:it,colorSpace:rt}}function recomposeColor(tt){const{type:et,colorSpace:nt}=tt;let{values:it}=tt;return et.indexOf("rgb")!==-1?it=it.map((rt,ot)=>ot<3?parseInt(rt,10):rt):et.indexOf("hsl")!==-1&&(it[1]=`${it[1]}%`,it[2]=`${it[2]}%`),et.indexOf("color")!==-1?it=`${nt} ${it.join(" ")}`:it=`${it.join(", ")}`,`${et}(${it})`}function hslToRgb(tt){tt=decomposeColor(tt);const{values:et}=tt,nt=et[0],it=et[1]/100,rt=et[2]/100,ot=it*Math.min(rt,1-rt),at=(ct,ut=(ct+nt/30)%12)=>rt-ot*Math.max(Math.min(ut-3,9-ut,1),-1);let st="rgb";const lt=[Math.round(at(0)*255),Math.round(at(8)*255),Math.round(at(4)*255)];return tt.type==="hsla"&&(st+="a",lt.push(et[3])),recomposeColor({type:st,values:lt})}function getLuminance(tt){tt=decomposeColor(tt);let et=tt.type==="hsl"||tt.type==="hsla"?decomposeColor(hslToRgb(tt)).values:tt.values;return et=et.map(nt=>(tt.type!=="color"&&(nt/=255),nt<=.03928?nt/12.92:((nt+.055)/1.055)**2.4)),Number((.2126*et[0]+.7152*et[1]+.0722*et[2]).toFixed(3))}function getContrastRatio(tt,et){const nt=getLuminance(tt),it=getLuminance(et);return(Math.max(nt,it)+.05)/(Math.min(nt,it)+.05)}function alpha$1(tt,et){return tt=decomposeColor(tt),et=clamp$5(et),(tt.type==="rgb"||tt.type==="hsl")&&(tt.type+="a"),tt.type==="color"?tt.values[3]=`/${et}`:tt.values[3]=et,recomposeColor(tt)}function darken(tt,et){if(tt=decomposeColor(tt),et=clamp$5(et),tt.type.indexOf("hsl")!==-1)tt.values[2]*=1-et;else if(tt.type.indexOf("rgb")!==-1||tt.type.indexOf("color")!==-1)for(let nt=0;nt<3;nt+=1)tt.values[nt]*=1-et;return recomposeColor(tt)}function lighten(tt,et){if(tt=decomposeColor(tt),et=clamp$5(et),tt.type.indexOf("hsl")!==-1)tt.values[2]+=(100-tt.values[2])*et;else if(tt.type.indexOf("rgb")!==-1)for(let nt=0;nt<3;nt+=1)tt.values[nt]+=(255-tt.values[nt])*et;else if(tt.type.indexOf("color")!==-1)for(let nt=0;nt<3;nt+=1)tt.values[nt]+=(1-tt.values[nt])*et;return recomposeColor(tt)}const ThemeContext=reactExports.createContext(null),ThemeContext$1=ThemeContext;function useTheme$1(){return reactExports.useContext(ThemeContext$1)}const hasSymbol=typeof Symbol=="function"&&Symbol.for,nested=hasSymbol?Symbol.for("mui.nested"):"__THEME_NESTED__";function mergeOuterLocalTheme(tt,et){return typeof et=="function"?et(tt):_extends$u({},tt,et)}function ThemeProvider$2(tt){const{children:et,theme:nt}=tt,it=useTheme$1(),rt=reactExports.useMemo(()=>{const ot=it===null?nt:mergeOuterLocalTheme(it,nt);return ot!=null&&(ot[nested]=it!==null),ot},[nt,it]);return jsxRuntimeExports.jsx(ThemeContext$1.Provider,{value:rt,children:et})}const EMPTY_THEME={};function useThemeScoping(tt,et,nt,it=!1){return reactExports.useMemo(()=>{const rt=tt&&et[tt]||et;if(typeof nt=="function"){const ot=nt(rt),at=tt?_extends$u({},et,{[tt]:ot}):ot;return it?()=>at:at}return tt?_extends$u({},et,{[tt]:nt}):_extends$u({},et,nt)},[tt,et,nt,it])}function ThemeProvider$1(tt){const{children:et,theme:nt,themeId:it}=tt,rt=useTheme$3(EMPTY_THEME),ot=useTheme$1()||EMPTY_THEME,at=useThemeScoping(it,rt,nt),st=useThemeScoping(it,ot,nt,!0);return jsxRuntimeExports.jsx(ThemeProvider$2,{theme:st,children:jsxRuntimeExports.jsx(ThemeContext$2.Provider,{value:at,children:et})})}const _excluded$1a=["component","direction","spacing","divider","children","className","useFlexGap"],defaultTheme$2=createTheme$1(),defaultCreateStyledComponent=systemStyled("div",{name:"MuiStack",slot:"Root",overridesResolver:(tt,et)=>et.root});function useThemePropsDefault(tt){return useThemeProps$1({props:tt,name:"MuiStack",defaultTheme:defaultTheme$2})}function joinChildren(tt,et){const nt=reactExports.Children.toArray(tt).filter(Boolean);return nt.reduce((it,rt,ot)=>(it.push(rt),ot({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[tt],style$3=({ownerState:tt,theme:et})=>{let nt=_extends$u({display:"flex",flexDirection:"column"},handleBreakpoints({theme:et},resolveBreakpointValues({values:tt.direction,breakpoints:et.breakpoints.values}),it=>({flexDirection:it})));if(tt.spacing){const it=createUnarySpacing(et),rt=Object.keys(et.breakpoints.values).reduce((lt,ct)=>((typeof tt.spacing=="object"&&tt.spacing[ct]!=null||typeof tt.direction=="object"&&tt.direction[ct]!=null)&&(lt[ct]=!0),lt),{}),ot=resolveBreakpointValues({values:tt.direction,base:rt}),at=resolveBreakpointValues({values:tt.spacing,base:rt});typeof ot=="object"&&Object.keys(ot).forEach((lt,ct,ut)=>{if(!ot[lt]){const dt=ct>0?ot[ut[ct-1]]:"column";ot[lt]=dt}}),nt=deepmerge$1(nt,handleBreakpoints({theme:et},at,(lt,ct)=>tt.useFlexGap?{gap:getValue(it,lt)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${getSideFromDirection(ct?ot[ct]:tt.direction)}`]:getValue(it,lt)}}))}return nt=mergeBreakpointsInOrder(et.breakpoints,nt),nt};function createStack(tt={}){const{createStyledComponent:et=defaultCreateStyledComponent,useThemeProps:nt=useThemePropsDefault,componentName:it="MuiStack"}=tt,rt=()=>composeClasses({root:["root"]},lt=>generateUtilityClass(it,lt),{}),ot=et(style$3);return reactExports.forwardRef(function(lt,ct){const ut=nt(lt),ht=extendSxProp(ut),{component:dt="div",direction:pt="column",spacing:mt=0,divider:gt,children:bt,className:yt,useFlexGap:wt=!1}=ht,vt=_objectWithoutPropertiesLoose$m(ht,_excluded$1a),xt={direction:pt,spacing:mt,useFlexGap:wt},St=rt();return jsxRuntimeExports.jsx(ot,_extends$u({as:dt,ownerState:xt,ref:ct,className:clsx$4(St.root,yt)},vt,{children:gt?joinChildren(bt,gt):bt}))})}function createMixins(tt,et){return _extends$u({toolbar:{minHeight:56,[tt.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[tt.up("sm")]:{minHeight:64}}},et)}const _excluded$19=["mode","contrastThreshold","tonalOffset"],light={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:common$1.white,default:common$1.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},dark={text:{primary:common$1.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:common$1.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function addLightOrDark(tt,et,nt,it){const rt=it.light||it,ot=it.dark||it*1.5;tt[et]||(tt.hasOwnProperty(nt)?tt[et]=tt[nt]:et==="light"?tt.light=lighten(tt.main,rt):et==="dark"&&(tt.dark=darken(tt.main,ot)))}function getDefaultPrimary(tt="light"){return tt==="dark"?{main:blue$1[200],light:blue$1[50],dark:blue$1[400]}:{main:blue$1[700],light:blue$1[400],dark:blue$1[800]}}function getDefaultSecondary(tt="light"){return tt==="dark"?{main:purple$1[200],light:purple$1[50],dark:purple$1[400]}:{main:purple$1[500],light:purple$1[300],dark:purple$1[700]}}function getDefaultError(tt="light"){return tt==="dark"?{main:red$1[500],light:red$1[300],dark:red$1[700]}:{main:red$1[700],light:red$1[400],dark:red$1[800]}}function getDefaultInfo(tt="light"){return tt==="dark"?{main:lightBlue$1[400],light:lightBlue$1[300],dark:lightBlue$1[700]}:{main:lightBlue$1[700],light:lightBlue$1[500],dark:lightBlue$1[900]}}function getDefaultSuccess(tt="light"){return tt==="dark"?{main:green$1[400],light:green$1[300],dark:green$1[700]}:{main:green$1[800],light:green$1[500],dark:green$1[900]}}function getDefaultWarning(tt="light"){return tt==="dark"?{main:orange$1[400],light:orange$1[300],dark:orange$1[700]}:{main:"#ed6c02",light:orange$1[500],dark:orange$1[900]}}function createPalette(tt){const{mode:et="light",contrastThreshold:nt=3,tonalOffset:it=.2}=tt,rt=_objectWithoutPropertiesLoose$m(tt,_excluded$19),ot=tt.primary||getDefaultPrimary(et),at=tt.secondary||getDefaultSecondary(et),st=tt.error||getDefaultError(et),lt=tt.info||getDefaultInfo(et),ct=tt.success||getDefaultSuccess(et),ut=tt.warning||getDefaultWarning(et);function ht(gt){return getContrastRatio(gt,dark.text.primary)>=nt?dark.text.primary:light.text.primary}const dt=({color:gt,name:bt,mainShade:yt=500,lightShade:wt=300,darkShade:vt=700})=>{if(gt=_extends$u({},gt),!gt.main&>[yt]&&(gt.main=gt[yt]),!gt.hasOwnProperty("main"))throw new Error(formatMuiErrorMessage(11,bt?` (${bt})`:"",yt));if(typeof gt.main!="string")throw new Error(formatMuiErrorMessage(12,bt?` (${bt})`:"",JSON.stringify(gt.main)));return addLightOrDark(gt,"light",wt,it),addLightOrDark(gt,"dark",vt,it),gt.contrastText||(gt.contrastText=ht(gt.main)),gt},pt={dark,light};return deepmerge$1(_extends$u({common:_extends$u({},common$1),mode:et,primary:dt({color:ot,name:"primary"}),secondary:dt({color:at,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:dt({color:st,name:"error"}),warning:dt({color:ut,name:"warning"}),info:dt({color:lt,name:"info"}),success:dt({color:ct,name:"success"}),grey:grey$1,contrastThreshold:nt,getContrastText:ht,augmentColor:dt,tonalOffset:it},pt[et]),rt)}const _excluded$18=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function round$2(tt){return Math.round(tt*1e5)/1e5}const caseAllCaps={textTransform:"uppercase"},defaultFontFamily='"Roboto", "Helvetica", "Arial", sans-serif';function createTypography(tt,et){const nt=typeof et=="function"?et(tt):et,{fontFamily:it=defaultFontFamily,fontSize:rt=14,fontWeightLight:ot=300,fontWeightRegular:at=400,fontWeightMedium:st=500,fontWeightBold:lt=700,htmlFontSize:ct=16,allVariants:ut,pxToRem:ht}=nt,dt=_objectWithoutPropertiesLoose$m(nt,_excluded$18),pt=rt/14,mt=ht||(yt=>`${yt/ct*pt}rem`),gt=(yt,wt,vt,xt,St)=>_extends$u({fontFamily:it,fontWeight:yt,fontSize:mt(wt),lineHeight:vt},it===defaultFontFamily?{letterSpacing:`${round$2(xt/wt)}em`}:{},St,ut),bt={h1:gt(ot,96,1.167,-1.5),h2:gt(ot,60,1.2,-.5),h3:gt(at,48,1.167,0),h4:gt(at,34,1.235,.25),h5:gt(at,24,1.334,0),h6:gt(st,20,1.6,.15),subtitle1:gt(at,16,1.75,.15),subtitle2:gt(st,14,1.57,.1),body1:gt(at,16,1.5,.15),body2:gt(at,14,1.43,.15),button:gt(st,14,1.75,.4,caseAllCaps),caption:gt(at,12,1.66,.4),overline:gt(at,12,2.66,1,caseAllCaps),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return deepmerge$1(_extends$u({htmlFontSize:ct,pxToRem:mt,fontFamily:it,fontSize:rt,fontWeightLight:ot,fontWeightRegular:at,fontWeightMedium:st,fontWeightBold:lt},bt),dt,{clone:!1})}const shadowKeyUmbraOpacity=.2,shadowKeyPenumbraOpacity=.14,shadowAmbientShadowOpacity=.12;function createShadow(...tt){return[`${tt[0]}px ${tt[1]}px ${tt[2]}px ${tt[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`,`${tt[4]}px ${tt[5]}px ${tt[6]}px ${tt[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`,`${tt[8]}px ${tt[9]}px ${tt[10]}px ${tt[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",")}const shadows=["none",createShadow(0,2,1,-1,0,1,1,0,0,1,3,0),createShadow(0,3,1,-2,0,2,2,0,0,1,5,0),createShadow(0,3,3,-2,0,3,4,0,0,1,8,0),createShadow(0,2,4,-1,0,4,5,0,0,1,10,0),createShadow(0,3,5,-1,0,5,8,0,0,1,14,0),createShadow(0,3,5,-1,0,6,10,0,0,1,18,0),createShadow(0,4,5,-2,0,7,10,1,0,2,16,1),createShadow(0,5,5,-3,0,8,10,1,0,3,14,2),createShadow(0,5,6,-3,0,9,12,1,0,3,16,2),createShadow(0,6,6,-3,0,10,14,1,0,4,18,3),createShadow(0,6,7,-4,0,11,15,1,0,4,20,3),createShadow(0,7,8,-4,0,12,17,2,0,5,22,4),createShadow(0,7,8,-4,0,13,19,2,0,5,24,4),createShadow(0,7,9,-4,0,14,21,2,0,5,26,4),createShadow(0,8,9,-5,0,15,22,2,0,6,28,5),createShadow(0,8,10,-5,0,16,24,2,0,6,30,5),createShadow(0,8,11,-5,0,17,26,2,0,6,32,5),createShadow(0,9,11,-5,0,18,28,2,0,7,34,6),createShadow(0,9,12,-6,0,19,29,2,0,7,36,6),createShadow(0,10,13,-6,0,20,31,3,0,8,38,7),createShadow(0,10,13,-6,0,21,33,3,0,8,40,7),createShadow(0,10,14,-6,0,22,35,3,0,8,42,7),createShadow(0,11,14,-7,0,23,36,3,0,9,44,8),createShadow(0,11,15,-7,0,24,38,3,0,9,46,8)],shadows$1=shadows,_excluded$17=["duration","easing","delay"],easing={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function formatMs(tt){return`${Math.round(tt)}ms`}function getAutoHeightDuration(tt){if(!tt)return 0;const et=tt/36;return Math.round((4+15*et**.25+et/5)*10)}function createTransitions(tt){const et=_extends$u({},easing,tt.easing),nt=_extends$u({},duration,tt.duration);return _extends$u({getAutoHeightDuration,create:(rt=["all"],ot={})=>{const{duration:at=nt.standard,easing:st=et.easeInOut,delay:lt=0}=ot;return _objectWithoutPropertiesLoose$m(ot,_excluded$17),(Array.isArray(rt)?rt:[rt]).map(ct=>`${ct} ${typeof at=="string"?at:formatMs(at)} ${st} ${typeof lt=="string"?lt:formatMs(lt)}`).join(",")}},tt,{easing:et,duration:nt})}const zIndex={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},zIndex$1=zIndex,_excluded$16=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function createTheme(tt={},...et){const{mixins:nt={},palette:it={},transitions:rt={},typography:ot={}}=tt,at=_objectWithoutPropertiesLoose$m(tt,_excluded$16);if(tt.vars)throw new Error(formatMuiErrorMessage(18));const st=createPalette(it),lt=createTheme$1(tt);let ct=deepmerge$1(lt,{mixins:createMixins(lt.breakpoints,nt),palette:st,shadows:shadows$1.slice(),typography:createTypography(st,ot),transitions:createTransitions(rt),zIndex:_extends$u({},zIndex$1)});return ct=deepmerge$1(ct,at),ct=et.reduce((ut,ht)=>deepmerge$1(ut,ht),ct),ct.unstable_sxConfig=_extends$u({},defaultSxConfig$1,at==null?void 0:at.unstable_sxConfig),ct.unstable_sx=function(ht){return styleFunctionSx$1({sx:ht,theme:this})},ct}function getUnit$1(tt){return String(tt).match(/[\d.\-+]*\s*(.*)/)[1]||""}function toUnitless(tt){return parseFloat(tt)}const defaultTheme=createTheme(),defaultTheme$1=defaultTheme;function useTheme(){const tt=useTheme$2(defaultTheme$1);return tt[THEME_ID]||tt}function useThemeProps({props:tt,name:et}){return useThemeProps$1({props:tt,name:et,defaultTheme:defaultTheme$1,themeId:THEME_ID})}const rootShouldForwardProp=tt=>shouldForwardProp(tt)&&tt!=="classes",slotShouldForwardProp=shouldForwardProp,styled=createStyled({themeId:THEME_ID,defaultTheme:defaultTheme$1,rootShouldForwardProp}),styled$1=styled,_excluded$15=["theme"];function ThemeProvider(tt){let{theme:et}=tt,nt=_objectWithoutPropertiesLoose$m(tt,_excluded$15);const it=et[THEME_ID];return jsxRuntimeExports.jsx(ThemeProvider$1,_extends$u({},nt,{themeId:it?THEME_ID:void 0,theme:it||et}))}const getOverlayAlpha=tt=>{let et;return tt<1?et=5.11916*tt**2:et=4.5*Math.log(tt+1)+2,(et/100).toFixed(2)},getOverlayAlpha$1=getOverlayAlpha;function r$5(tt){var et,nt,it="";if(typeof tt=="string"||typeof tt=="number")it+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et{const{color:et,fontSize:nt,classes:it}=tt,rt={root:["root",et!=="inherit"&&`color${capitalize(et)}`,`fontSize${capitalize(nt)}`]};return composeClasses(rt,getSvgIconUtilityClass,it)},SvgIconRoot=styled$1("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.color!=="inherit"&&et[`color${capitalize(nt.color)}`],et[`fontSize${capitalize(nt.fontSize)}`]]}})(({theme:tt,ownerState:et})=>{var nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:et.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(nt=tt.transitions)==null||(it=nt.create)==null?void 0:it.call(nt,"fill",{duration:(rt=tt.transitions)==null||(rt=rt.duration)==null?void 0:rt.shorter}),fontSize:{inherit:"inherit",small:((ot=tt.typography)==null||(at=ot.pxToRem)==null?void 0:at.call(ot,20))||"1.25rem",medium:((st=tt.typography)==null||(lt=st.pxToRem)==null?void 0:lt.call(st,24))||"1.5rem",large:((ct=tt.typography)==null||(ut=ct.pxToRem)==null?void 0:ut.call(ct,35))||"2.1875rem"}[et.fontSize],color:(ht=(dt=(tt.vars||tt).palette)==null||(dt=dt[et.color])==null?void 0:dt.main)!=null?ht:{action:(pt=(tt.vars||tt).palette)==null||(pt=pt.action)==null?void 0:pt.active,disabled:(mt=(tt.vars||tt).palette)==null||(mt=mt.action)==null?void 0:mt.disabled,inherit:void 0}[et.color]}}),SvgIcon=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiSvgIcon"}),{children:rt,className:ot,color:at="inherit",component:st="svg",fontSize:lt="medium",htmlColor:ct,inheritViewBox:ut=!1,titleAccess:ht,viewBox:dt="0 0 24 24"}=it,pt=_objectWithoutPropertiesLoose$m(it,_excluded$14),mt=reactExports.isValidElement(rt)&&rt.type==="svg",gt=_extends$u({},it,{color:at,component:st,fontSize:lt,instanceFontSize:et.fontSize,inheritViewBox:ut,viewBox:dt,hasSvgAsChild:mt}),bt={};ut||(bt.viewBox=dt);const yt=useUtilityClasses$y(gt);return jsxRuntimeExports.jsxs(SvgIconRoot,_extends$u({as:st,className:clsx$3(yt.root,ot),focusable:"false",color:ct,"aria-hidden":ht?void 0:!0,role:ht?"img":void 0,ref:nt},bt,pt,mt&&rt.props,{ownerState:gt,children:[mt?rt.props.children:rt,ht?jsxRuntimeExports.jsx("title",{children:ht}):null]}))});SvgIcon.muiName="SvgIcon";const SvgIcon$1=SvgIcon;function createSvgIcon(tt,et){function nt(it,rt){return jsxRuntimeExports.jsx(SvgIcon$1,_extends$u({"data-testid":`${et}Icon`,ref:rt},it,{children:tt}))}return nt.muiName=SvgIcon$1.muiName,reactExports.memo(reactExports.forwardRef(nt))}function _setPrototypeOf$e(tt,et){return _setPrototypeOf$e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(it,rt){return it.__proto__=rt,it},_setPrototypeOf$e(tt,et)}function _inheritsLoose$1(tt,et){tt.prototype=Object.create(et.prototype),tt.prototype.constructor=tt,_setPrototypeOf$e(tt,et)}const config$1={disabled:!1},TransitionGroupContext=React$1.createContext(null);var forceReflow=function(et){return et.scrollTop},UNMOUNTED="unmounted",EXITED="exited",ENTERING="entering",ENTERED="entered",EXITING="exiting",Transition$1=function(tt){_inheritsLoose$1(et,tt);function et(it,rt){var ot;ot=tt.call(this,it,rt)||this;var at=rt,st=at&&!at.isMounting?it.enter:it.appear,lt;return ot.appearStatus=null,it.in?st?(lt=EXITED,ot.appearStatus=ENTERING):lt=ENTERED:it.unmountOnExit||it.mountOnEnter?lt=UNMOUNTED:lt=EXITED,ot.state={status:lt},ot.nextCallback=null,ot}et.getDerivedStateFromProps=function(rt,ot){var at=rt.in;return at&&ot.status===UNMOUNTED?{status:EXITED}:null};var nt=et.prototype;return nt.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},nt.componentDidUpdate=function(rt){var ot=null;if(rt!==this.props){var at=this.state.status;this.props.in?at!==ENTERING&&at!==ENTERED&&(ot=ENTERING):(at===ENTERING||at===ENTERED)&&(ot=EXITING)}this.updateStatus(!1,ot)},nt.componentWillUnmount=function(){this.cancelNextCallback()},nt.getTimeouts=function(){var rt=this.props.timeout,ot,at,st;return ot=at=st=rt,rt!=null&&typeof rt!="number"&&(ot=rt.exit,at=rt.enter,st=rt.appear!==void 0?rt.appear:at),{exit:ot,enter:at,appear:st}},nt.updateStatus=function(rt,ot){if(rt===void 0&&(rt=!1),ot!==null)if(this.cancelNextCallback(),ot===ENTERING){if(this.props.unmountOnExit||this.props.mountOnEnter){var at=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this);at&&forceReflow(at)}this.performEnter(rt)}else this.performExit();else this.props.unmountOnExit&&this.state.status===EXITED&&this.setState({status:UNMOUNTED})},nt.performEnter=function(rt){var ot=this,at=this.props.enter,st=this.context?this.context.isMounting:rt,lt=this.props.nodeRef?[st]:[ReactDOM.findDOMNode(this),st],ct=lt[0],ut=lt[1],ht=this.getTimeouts(),dt=st?ht.appear:ht.enter;if(!rt&&!at||config$1.disabled){this.safeSetState({status:ENTERED},function(){ot.props.onEntered(ct)});return}this.props.onEnter(ct,ut),this.safeSetState({status:ENTERING},function(){ot.props.onEntering(ct,ut),ot.onTransitionEnd(dt,function(){ot.safeSetState({status:ENTERED},function(){ot.props.onEntered(ct,ut)})})})},nt.performExit=function(){var rt=this,ot=this.props.exit,at=this.getTimeouts(),st=this.props.nodeRef?void 0:ReactDOM.findDOMNode(this);if(!ot||config$1.disabled){this.safeSetState({status:EXITED},function(){rt.props.onExited(st)});return}this.props.onExit(st),this.safeSetState({status:EXITING},function(){rt.props.onExiting(st),rt.onTransitionEnd(at.exit,function(){rt.safeSetState({status:EXITED},function(){rt.props.onExited(st)})})})},nt.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},nt.safeSetState=function(rt,ot){ot=this.setNextCallback(ot),this.setState(rt,ot)},nt.setNextCallback=function(rt){var ot=this,at=!0;return this.nextCallback=function(st){at&&(at=!1,ot.nextCallback=null,rt(st))},this.nextCallback.cancel=function(){at=!1},this.nextCallback},nt.onTransitionEnd=function(rt,ot){this.setNextCallback(ot);var at=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this),st=rt==null&&!this.props.addEndListener;if(!at||st){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var lt=this.props.nodeRef?[this.nextCallback]:[at,this.nextCallback],ct=lt[0],ut=lt[1];this.props.addEndListener(ct,ut)}rt!=null&&setTimeout(this.nextCallback,rt)},nt.render=function(){var rt=this.state.status;if(rt===UNMOUNTED)return null;var ot=this.props,at=ot.children;ot.in,ot.mountOnEnter,ot.unmountOnExit,ot.appear,ot.enter,ot.exit,ot.timeout,ot.addEndListener,ot.onEnter,ot.onEntering,ot.onEntered,ot.onExit,ot.onExiting,ot.onExited,ot.nodeRef;var st=_objectWithoutPropertiesLoose$m(ot,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return React$1.createElement(TransitionGroupContext.Provider,{value:null},typeof at=="function"?at(rt,st):React$1.cloneElement(React$1.Children.only(at),st))},et}(React$1.Component);Transition$1.contextType=TransitionGroupContext;Transition$1.propTypes={};function noop$5(){}Transition$1.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop$5,onEntering:noop$5,onEntered:noop$5,onExit:noop$5,onExiting:noop$5,onExited:noop$5};Transition$1.UNMOUNTED=UNMOUNTED;Transition$1.EXITED=EXITED;Transition$1.ENTERING=ENTERING;Transition$1.ENTERED=ENTERED;Transition$1.EXITING=EXITING;const Transition$2=Transition$1;function _assertThisInitialized$e(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function getChildMapping(tt,et){var nt=function(ot){return et&&reactExports.isValidElement(ot)?et(ot):ot},it=Object.create(null);return tt&&reactExports.Children.map(tt,function(rt){return rt}).forEach(function(rt){it[rt.key]=nt(rt)}),it}function mergeChildMappings(tt,et){tt=tt||{},et=et||{};function nt(ut){return ut in et?et[ut]:tt[ut]}var it=Object.create(null),rt=[];for(var ot in tt)ot in et?rt.length&&(it[ot]=rt,rt=[]):rt.push(ot);var at,st={};for(var lt in et){if(it[lt])for(at=0;attt.scrollTop;function getTransitionProps(tt,et){var nt,it;const{timeout:rt,easing:ot,style:at={}}=tt;return{duration:(nt=at.transitionDuration)!=null?nt:typeof rt=="number"?rt:rt[et.mode]||0,easing:(it=at.transitionTimingFunction)!=null?it:typeof ot=="object"?ot[et.mode]:ot,delay:at.transitionDelay}}function getPaperUtilityClass(tt){return generateUtilityClass("MuiPaper",tt)}generateUtilityClasses("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 _excluded$13=["className","component","elevation","square","variant"],useUtilityClasses$x=tt=>{const{square:et,elevation:nt,variant:it,classes:rt}=tt,ot={root:["root",it,!et&&"rounded",it==="elevation"&&`elevation${nt}`]};return composeClasses(ot,getPaperUtilityClass,rt)},PaperRoot=styled$1("div",{name:"MuiPaper",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],!nt.square&&et.rounded,nt.variant==="elevation"&&et[`elevation${nt.elevation}`]]}})(({theme:tt,ownerState:et})=>{var nt;return _extends$u({backgroundColor:(tt.vars||tt).palette.background.paper,color:(tt.vars||tt).palette.text.primary,transition:tt.transitions.create("box-shadow")},!et.square&&{borderRadius:tt.shape.borderRadius},et.variant==="outlined"&&{border:`1px solid ${(tt.vars||tt).palette.divider}`},et.variant==="elevation"&&_extends$u({boxShadow:(tt.vars||tt).shadows[et.elevation]},!tt.vars&&tt.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${alpha$1("#fff",getOverlayAlpha$1(et.elevation))}, ${alpha$1("#fff",getOverlayAlpha$1(et.elevation))})`},tt.vars&&{backgroundImage:(nt=tt.vars.overlays)==null?void 0:nt[et.elevation]}))}),Paper=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiPaper"}),{className:rt,component:ot="div",elevation:at=1,square:st=!1,variant:lt="elevation"}=it,ct=_objectWithoutPropertiesLoose$m(it,_excluded$13),ut=_extends$u({},it,{component:ot,elevation:at,square:st,variant:lt}),ht=useUtilityClasses$x(ut);return jsxRuntimeExports.jsx(PaperRoot,_extends$u({as:ot,ownerState:ut,className:clsx$3(ht.root,rt),ref:nt},ct))}),MuiPaper=Paper;function Ripple(tt){const{className:et,classes:nt,pulsate:it=!1,rippleX:rt,rippleY:ot,rippleSize:at,in:st,onExited:lt,timeout:ct}=tt,[ut,ht]=reactExports.useState(!1),dt=clsx$3(et,nt.ripple,nt.rippleVisible,it&&nt.ripplePulsate),pt={width:at,height:at,top:-(at/2)+ot,left:-(at/2)+rt},mt=clsx$3(nt.child,ut&&nt.childLeaving,it&&nt.childPulsate);return!st&&!ut&&ht(!0),reactExports.useEffect(()=>{if(!st&<!=null){const gt=setTimeout(lt,ct);return()=>{clearTimeout(gt)}}},[lt,st,ct]),jsxRuntimeExports.jsx("span",{className:dt,style:pt,children:jsxRuntimeExports.jsx("span",{className:mt})})}const touchRippleClasses=generateUtilityClasses("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),touchRippleClasses$1=touchRippleClasses,_excluded$12=["center","classes","className"];let _$2=tt=>tt,_t$2,_t2$2,_t3$2,_t4$2;const DURATION=550,DELAY_RIPPLE=80,enterKeyframe=keyframes(_t$2||(_t$2=_$2` + */function styled$3(tt,et){return newStyled(tt,et)}const internal_processStyles=(tt,et)=>{Array.isArray(tt.__emotion_styles)&&(tt.__emotion_styles=et(tt.__emotion_styles))},_excluded$1f=["values","unit","step"],sortBreakpointsValues=tt=>{const et=Object.keys(tt).map(nt=>({key:nt,val:tt[nt]}))||[];return et.sort((nt,it)=>nt.val-it.val),et.reduce((nt,it)=>_extends$t({},nt,{[it.key]:it.val}),{})};function createBreakpoints(tt){const{values:et={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:nt="px",step:it=5}=tt,rt=_objectWithoutPropertiesLoose$m(tt,_excluded$1f),ot=sortBreakpointsValues(et),at=Object.keys(ot);function st(dt){return`@media (min-width:${typeof et[dt]=="number"?et[dt]:dt}${nt})`}function lt(dt){return`@media (max-width:${(typeof et[dt]=="number"?et[dt]:dt)-it/100}${nt})`}function ct(dt,pt){const mt=at.indexOf(pt);return`@media (min-width:${typeof et[dt]=="number"?et[dt]:dt}${nt}) and (max-width:${(mt!==-1&&typeof et[at[mt]]=="number"?et[at[mt]]:pt)-it/100}${nt})`}function ut(dt){return at.indexOf(dt)+1`@media (min-width:${values$1[tt]}px)`};function handleBreakpoints(tt,et,nt){const it=tt.theme||{};if(Array.isArray(et)){const ot=it.breakpoints||defaultBreakpoints;return et.reduce((at,st,lt)=>(at[ot.up(ot.keys[lt])]=nt(et[lt]),at),{})}if(typeof et=="object"){const ot=it.breakpoints||defaultBreakpoints;return Object.keys(et).reduce((at,st)=>{if(Object.keys(ot.values||values$1).indexOf(st)!==-1){const lt=ot.up(st);at[lt]=nt(et[st],st)}else{const lt=st;at[lt]=et[lt]}return at},{})}return nt(et)}function createEmptyBreakpointObject(tt={}){var et;return((et=tt.keys)==null?void 0:et.reduce((it,rt)=>{const ot=tt.up(rt);return it[ot]={},it},{}))||{}}function removeUnusedBreakpoints(tt,et){return tt.reduce((nt,it)=>{const rt=nt[it];return(!rt||Object.keys(rt).length===0)&&delete nt[it],nt},et)}function mergeBreakpointsInOrder(tt,...et){const nt=createEmptyBreakpointObject(tt),it=[nt,...et].reduce((rt,ot)=>deepmerge$1(rt,ot),{});return removeUnusedBreakpoints(Object.keys(nt),it)}function computeBreakpointsBase(tt,et){if(typeof tt!="object")return{};const nt={},it=Object.keys(et);return Array.isArray(tt)?it.forEach((rt,ot)=>{ot{tt[rt]!=null&&(nt[rt]=!0)}),nt}function resolveBreakpointValues({values:tt,breakpoints:et,base:nt}){const it=nt||computeBreakpointsBase(tt,et),rt=Object.keys(it);if(rt.length===0)return tt;let ot;return rt.reduce((at,st,lt)=>(Array.isArray(tt)?(at[st]=tt[lt]!=null?tt[lt]:tt[ot],ot=lt):typeof tt=="object"?(at[st]=tt[st]!=null?tt[st]:tt[ot],ot=st):at[st]=tt,at),{})}function getPath$2(tt,et,nt=!0){if(!et||typeof et!="string")return null;if(tt&&tt.vars&&nt){const it=`vars.${et}`.split(".").reduce((rt,ot)=>rt&&rt[ot]?rt[ot]:null,tt);if(it!=null)return it}return et.split(".").reduce((it,rt)=>it&&it[rt]!=null?it[rt]:null,tt)}function getStyleValue$1(tt,et,nt,it=nt){let rt;return typeof tt=="function"?rt=tt(nt):Array.isArray(tt)?rt=tt[nt]||it:rt=getPath$2(tt,nt)||it,et&&(rt=et(rt,it,tt)),rt}function style$5(tt){const{prop:et,cssProperty:nt=tt.prop,themeKey:it,transform:rt}=tt,ot=at=>{if(at[et]==null)return null;const st=at[et],lt=at.theme,ct=getPath$2(lt,it)||{};return handleBreakpoints(at,st,ht=>{let dt=getStyleValue$1(ct,rt,ht);return ht===dt&&typeof ht=="string"&&(dt=getStyleValue$1(ct,rt,`${et}${ht==="default"?"":capitalize(ht)}`,ht)),nt===!1?dt:{[nt]:dt}})};return ot.propTypes={},ot.filterProps=[et],ot}function memoize$3(tt){const et={};return nt=>(et[nt]===void 0&&(et[nt]=tt(nt)),et[nt])}const properties={m:"margin",p:"padding"},directions={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},aliases={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},getCssProperties=memoize$3(tt=>{if(tt.length>2)if(aliases[tt])tt=aliases[tt];else return[tt];const[et,nt]=tt.split(""),it=properties[et],rt=directions[nt]||"";return Array.isArray(rt)?rt.map(ot=>it+ot):[it+rt]}),marginKeys=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],paddingKeys=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...marginKeys,...paddingKeys];function createUnaryUnit(tt,et,nt,it){var rt;const ot=(rt=getPath$2(tt,et,!1))!=null?rt:nt;return typeof ot=="number"?at=>typeof at=="string"?at:ot*at:Array.isArray(ot)?at=>typeof at=="string"?at:ot[at]:typeof ot=="function"?ot:()=>{}}function createUnarySpacing(tt){return createUnaryUnit(tt,"spacing",8)}function getValue(tt,et){if(typeof et=="string"||et==null)return et;const nt=Math.abs(et),it=tt(nt);return et>=0?it:typeof it=="number"?-it:`-${it}`}function getStyleFromPropValue(tt,et){return nt=>tt.reduce((it,rt)=>(it[rt]=getValue(et,nt),it),{})}function resolveCssProperty(tt,et,nt,it){if(et.indexOf(nt)===-1)return null;const rt=getCssProperties(nt),ot=getStyleFromPropValue(rt,it),at=tt[nt];return handleBreakpoints(tt,at,ot)}function style$4(tt,et){const nt=createUnarySpacing(tt.theme);return Object.keys(tt).map(it=>resolveCssProperty(tt,et,it,nt)).reduce(merge$1,{})}function margin(tt){return style$4(tt,marginKeys)}margin.propTypes={};margin.filterProps=marginKeys;function padding(tt){return style$4(tt,paddingKeys)}padding.propTypes={};padding.filterProps=paddingKeys;function createSpacing(tt=8){if(tt.mui)return tt;const et=createUnarySpacing({spacing:tt}),nt=(...it)=>(it.length===0?[1]:it).map(ot=>{const at=et(ot);return typeof at=="number"?`${at}px`:at}).join(" ");return nt.mui=!0,nt}function compose$1(...tt){const et=tt.reduce((it,rt)=>(rt.filterProps.forEach(ot=>{it[ot]=rt}),it),{}),nt=it=>Object.keys(it).reduce((rt,ot)=>et[ot]?merge$1(rt,et[ot](it)):rt,{});return nt.propTypes={},nt.filterProps=tt.reduce((it,rt)=>it.concat(rt.filterProps),[]),nt}function borderTransform(tt){return typeof tt!="number"?tt:`${tt}px solid`}function createBorderStyle(tt,et){return style$5({prop:tt,themeKey:"borders",transform:et})}const border=createBorderStyle("border",borderTransform),borderTop=createBorderStyle("borderTop",borderTransform),borderRight=createBorderStyle("borderRight",borderTransform),borderBottom=createBorderStyle("borderBottom",borderTransform),borderLeft=createBorderStyle("borderLeft",borderTransform),borderColor=createBorderStyle("borderColor"),borderTopColor=createBorderStyle("borderTopColor"),borderRightColor=createBorderStyle("borderRightColor"),borderBottomColor=createBorderStyle("borderBottomColor"),borderLeftColor=createBorderStyle("borderLeftColor"),outline=createBorderStyle("outline",borderTransform),outlineColor=createBorderStyle("outlineColor"),borderRadius=tt=>{if(tt.borderRadius!==void 0&&tt.borderRadius!==null){const et=createUnaryUnit(tt.theme,"shape.borderRadius",4),nt=it=>({borderRadius:getValue(et,it)});return handleBreakpoints(tt,tt.borderRadius,nt)}return null};borderRadius.propTypes={};borderRadius.filterProps=["borderRadius"];compose$1(border,borderTop,borderRight,borderBottom,borderLeft,borderColor,borderTopColor,borderRightColor,borderBottomColor,borderLeftColor,borderRadius,outline,outlineColor);const gap=tt=>{if(tt.gap!==void 0&&tt.gap!==null){const et=createUnaryUnit(tt.theme,"spacing",8),nt=it=>({gap:getValue(et,it)});return handleBreakpoints(tt,tt.gap,nt)}return null};gap.propTypes={};gap.filterProps=["gap"];const columnGap=tt=>{if(tt.columnGap!==void 0&&tt.columnGap!==null){const et=createUnaryUnit(tt.theme,"spacing",8),nt=it=>({columnGap:getValue(et,it)});return handleBreakpoints(tt,tt.columnGap,nt)}return null};columnGap.propTypes={};columnGap.filterProps=["columnGap"];const rowGap=tt=>{if(tt.rowGap!==void 0&&tt.rowGap!==null){const et=createUnaryUnit(tt.theme,"spacing",8),nt=it=>({rowGap:getValue(et,it)});return handleBreakpoints(tt,tt.rowGap,nt)}return null};rowGap.propTypes={};rowGap.filterProps=["rowGap"];const gridColumn=style$5({prop:"gridColumn"}),gridRow=style$5({prop:"gridRow"}),gridAutoFlow=style$5({prop:"gridAutoFlow"}),gridAutoColumns=style$5({prop:"gridAutoColumns"}),gridAutoRows=style$5({prop:"gridAutoRows"}),gridTemplateColumns=style$5({prop:"gridTemplateColumns"}),gridTemplateRows=style$5({prop:"gridTemplateRows"}),gridTemplateAreas=style$5({prop:"gridTemplateAreas"}),gridArea=style$5({prop:"gridArea"});compose$1(gap,columnGap,rowGap,gridColumn,gridRow,gridAutoFlow,gridAutoColumns,gridAutoRows,gridTemplateColumns,gridTemplateRows,gridTemplateAreas,gridArea);function paletteTransform(tt,et){return et==="grey"?et:tt}const color$3=style$5({prop:"color",themeKey:"palette",transform:paletteTransform}),bgcolor=style$5({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:paletteTransform}),backgroundColor=style$5({prop:"backgroundColor",themeKey:"palette",transform:paletteTransform});compose$1(color$3,bgcolor,backgroundColor);function sizingTransform(tt){return tt<=1&&tt!==0?`${tt*100}%`:tt}const width=style$5({prop:"width",transform:sizingTransform}),maxWidth=tt=>{if(tt.maxWidth!==void 0&&tt.maxWidth!==null){const et=nt=>{var it,rt;const ot=((it=tt.theme)==null||(it=it.breakpoints)==null||(it=it.values)==null?void 0:it[nt])||values$1[nt];return ot?((rt=tt.theme)==null||(rt=rt.breakpoints)==null?void 0:rt.unit)!=="px"?{maxWidth:`${ot}${tt.theme.breakpoints.unit}`}:{maxWidth:ot}:{maxWidth:sizingTransform(nt)}};return handleBreakpoints(tt,tt.maxWidth,et)}return null};maxWidth.filterProps=["maxWidth"];const minWidth=style$5({prop:"minWidth",transform:sizingTransform}),height=style$5({prop:"height",transform:sizingTransform}),maxHeight=style$5({prop:"maxHeight",transform:sizingTransform}),minHeight=style$5({prop:"minHeight",transform:sizingTransform});style$5({prop:"size",cssProperty:"width",transform:sizingTransform});style$5({prop:"size",cssProperty:"height",transform:sizingTransform});const boxSizing=style$5({prop:"boxSizing"});compose$1(width,maxWidth,minWidth,height,maxHeight,minHeight,boxSizing);const defaultSxConfig={border:{themeKey:"borders",transform:borderTransform},borderTop:{themeKey:"borders",transform:borderTransform},borderRight:{themeKey:"borders",transform:borderTransform},borderBottom:{themeKey:"borders",transform:borderTransform},borderLeft:{themeKey:"borders",transform:borderTransform},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:borderTransform},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:borderRadius},color:{themeKey:"palette",transform:paletteTransform},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:paletteTransform},backgroundColor:{themeKey:"palette",transform:paletteTransform},p:{style:padding},pt:{style:padding},pr:{style:padding},pb:{style:padding},pl:{style:padding},px:{style:padding},py:{style:padding},padding:{style:padding},paddingTop:{style:padding},paddingRight:{style:padding},paddingBottom:{style:padding},paddingLeft:{style:padding},paddingX:{style:padding},paddingY:{style:padding},paddingInline:{style:padding},paddingInlineStart:{style:padding},paddingInlineEnd:{style:padding},paddingBlock:{style:padding},paddingBlockStart:{style:padding},paddingBlockEnd:{style:padding},m:{style:margin},mt:{style:margin},mr:{style:margin},mb:{style:margin},ml:{style:margin},mx:{style:margin},my:{style:margin},margin:{style:margin},marginTop:{style:margin},marginRight:{style:margin},marginBottom:{style:margin},marginLeft:{style:margin},marginX:{style:margin},marginY:{style:margin},marginInline:{style:margin},marginInlineStart:{style:margin},marginInlineEnd:{style:margin},marginBlock:{style:margin},marginBlockStart:{style:margin},marginBlockEnd:{style:margin},displayPrint:{cssProperty:!1,transform:tt=>({"@media print":{display:tt}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:gap},rowGap:{style:rowGap},columnGap:{style:columnGap},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sizingTransform},maxWidth:{style:maxWidth},minWidth:{transform:sizingTransform},height:{transform:sizingTransform},maxHeight:{transform:sizingTransform},minHeight:{transform:sizingTransform},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},defaultSxConfig$1=defaultSxConfig;function objectsHaveSameKeys(...tt){const et=tt.reduce((it,rt)=>it.concat(Object.keys(rt)),[]),nt=new Set(et);return tt.every(it=>nt.size===Object.keys(it).length)}function callIfFn(tt,et){return typeof tt=="function"?tt(et):tt}function unstable_createStyleFunctionSx(){function tt(nt,it,rt,ot){const at={[nt]:it,theme:rt},st=ot[nt];if(!st)return{[nt]:it};const{cssProperty:lt=nt,themeKey:ct,transform:ut,style:ht}=st;if(it==null)return null;if(ct==="typography"&&it==="inherit")return{[nt]:it};const dt=getPath$2(rt,ct)||{};return ht?ht(at):handleBreakpoints(at,it,mt=>{let gt=getStyleValue$1(dt,ut,mt);return mt===gt&&typeof mt=="string"&&(gt=getStyleValue$1(dt,ut,`${nt}${mt==="default"?"":capitalize(mt)}`,mt)),lt===!1?gt:{[lt]:gt}})}function et(nt){var it;const{sx:rt,theme:ot={}}=nt||{};if(!rt)return null;const at=(it=ot.unstable_sxConfig)!=null?it:defaultSxConfig$1;function st(lt){let ct=lt;if(typeof lt=="function")ct=lt(ot);else if(typeof lt!="object")return lt;if(!ct)return null;const ut=createEmptyBreakpointObject(ot.breakpoints),ht=Object.keys(ut);let dt=ut;return Object.keys(ct).forEach(pt=>{const mt=callIfFn(ct[pt],ot);if(mt!=null)if(typeof mt=="object")if(at[pt])dt=merge$1(dt,tt(pt,mt,ot,at));else{const gt=handleBreakpoints({theme:ot},mt,bt=>({[pt]:bt}));objectsHaveSameKeys(gt,mt)?dt[pt]=et({sx:mt,theme:ot}):dt=merge$1(dt,gt)}else dt=merge$1(dt,tt(pt,mt,ot,at))}),removeUnusedBreakpoints(ht,dt)}return Array.isArray(rt)?rt.map(st):st(rt)}return et}const styleFunctionSx=unstable_createStyleFunctionSx();styleFunctionSx.filterProps=["sx"];const styleFunctionSx$1=styleFunctionSx,_excluded$1e=["breakpoints","palette","spacing","shape"];function createTheme$1(tt={},...et){const{breakpoints:nt={},palette:it={},spacing:rt,shape:ot={}}=tt,at=_objectWithoutPropertiesLoose$m(tt,_excluded$1e),st=createBreakpoints(nt),lt=createSpacing(rt);let ct=deepmerge$1({breakpoints:st,direction:"ltr",components:{},palette:_extends$t({mode:"light"},it),spacing:lt,shape:_extends$t({},shape$2,ot)},at);return ct=et.reduce((ut,ht)=>deepmerge$1(ut,ht),ct),ct.unstable_sxConfig=_extends$t({},defaultSxConfig$1,at==null?void 0:at.unstable_sxConfig),ct.unstable_sx=function(ht){return styleFunctionSx$1({sx:ht,theme:this})},ct}function isObjectEmpty(tt){return Object.keys(tt).length===0}function useTheme$3(tt=null){const et=reactExports.useContext(ThemeContext$2);return!et||isObjectEmpty(et)?tt:et}const systemDefaultTheme$1=createTheme$1();function useTheme$2(tt=systemDefaultTheme$1){return useTheme$3(tt)}function GlobalStyles$1({styles:tt,themeId:et,defaultTheme:nt={}}){const it=useTheme$2(nt),rt=typeof tt=="function"?tt(et&&it[et]||it):tt;return jsxRuntimeExports.jsx(GlobalStyles$2,{styles:rt})}const _excluded$1d=["sx"],splitProps=tt=>{var et,nt;const it={systemProps:{},otherProps:{}},rt=(et=tt==null||(nt=tt.theme)==null?void 0:nt.unstable_sxConfig)!=null?et:defaultSxConfig$1;return Object.keys(tt).forEach(ot=>{rt[ot]?it.systemProps[ot]=tt[ot]:it.otherProps[ot]=tt[ot]}),it};function extendSxProp(tt){const{sx:et}=tt,nt=_objectWithoutPropertiesLoose$m(tt,_excluded$1d),{systemProps:it,otherProps:rt}=splitProps(nt);let ot;return Array.isArray(et)?ot=[it,...et]:typeof et=="function"?ot=(...at)=>{const st=et(...at);return isPlainObject$4(st)?_extends$t({},it,st):it}:ot=_extends$t({},it,et),_extends$t({},rt,{sx:ot})}function r$6(tt){var et,nt,it="";if(typeof tt=="string"||typeof tt=="number")it+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et{rt==="color"?it+=isEmpty$3(it)?tt[rt]:capitalize(tt[rt]):it+=`${isEmpty$3(it)?rt:capitalize(rt)}${capitalize(tt[rt].toString())}`}),it}const _excluded$1b=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function isEmpty$2(tt){return Object.keys(tt).length===0}function isStringTag(tt){return typeof tt=="string"&&tt.charCodeAt(0)>96}const getStyleOverrides=(tt,et)=>et.components&&et.components[tt]&&et.components[tt].styleOverrides?et.components[tt].styleOverrides:null,transformVariants=tt=>{const et={};return tt&&tt.forEach(nt=>{const it=propsToClassKey(nt.props);et[it]=nt.style}),et},getVariantStyles=(tt,et)=>{let nt=[];return et&&et.components&&et.components[tt]&&et.components[tt].variants&&(nt=et.components[tt].variants),transformVariants(nt)},variantsResolver=(tt,et,nt)=>{const{ownerState:it={}}=tt,rt=[];return nt&&nt.forEach(ot=>{let at=!0;Object.keys(ot.props).forEach(st=>{it[st]!==ot.props[st]&&tt[st]!==ot.props[st]&&(at=!1)}),at&&rt.push(et[propsToClassKey(ot.props)])}),rt},themeVariantsResolver=(tt,et,nt,it)=>{var rt;const ot=nt==null||(rt=nt.components)==null||(rt=rt[it])==null?void 0:rt.variants;return variantsResolver(tt,et,ot)};function shouldForwardProp(tt){return tt!=="ownerState"&&tt!=="theme"&&tt!=="sx"&&tt!=="as"}const systemDefaultTheme=createTheme$1(),lowercaseFirstLetter=tt=>tt&&tt.charAt(0).toLowerCase()+tt.slice(1);function resolveTheme({defaultTheme:tt,theme:et,themeId:nt}){return isEmpty$2(et)?tt:et[nt]||et}function defaultOverridesResolver(tt){return tt?(et,nt)=>nt[tt]:null}const muiStyledFunctionResolver=({styledArg:tt,props:et,defaultTheme:nt,themeId:it})=>{const rt=tt(_extends$t({},et,{theme:resolveTheme(_extends$t({},et,{defaultTheme:nt,themeId:it}))}));let ot;if(rt&&rt.variants&&(ot=rt.variants,delete rt.variants),ot){const at=variantsResolver(et,transformVariants(ot),ot);return[rt,...at]}return rt};function createStyled(tt={}){const{themeId:et,defaultTheme:nt=systemDefaultTheme,rootShouldForwardProp:it=shouldForwardProp,slotShouldForwardProp:rt=shouldForwardProp}=tt,ot=at=>styleFunctionSx$1(_extends$t({},at,{theme:resolveTheme(_extends$t({},at,{defaultTheme:nt,themeId:et}))}));return ot.__mui_systemSx=!0,(at,st={})=>{internal_processStyles(at,xt=>xt.filter(St=>!(St!=null&&St.__mui_systemSx)));const{name:lt,slot:ct,skipVariantsResolver:ut,skipSx:ht,overridesResolver:dt=defaultOverridesResolver(lowercaseFirstLetter(ct))}=st,pt=_objectWithoutPropertiesLoose$m(st,_excluded$1b),mt=ut!==void 0?ut:ct&&ct!=="Root"&&ct!=="root"||!1,gt=ht||!1;let bt,yt=shouldForwardProp;ct==="Root"||ct==="root"?yt=it:ct?yt=rt:isStringTag(at)&&(yt=void 0);const wt=styled$3(at,_extends$t({shouldForwardProp:yt,label:bt},pt)),vt=(xt,...St)=>{const Et=St?St.map(Ht=>{if(typeof Ht=="function"&&Ht.__emotion_real!==Ht)return zt=>muiStyledFunctionResolver({styledArg:Ht,props:zt,defaultTheme:nt,themeId:et});if(isPlainObject$4(Ht)){let zt=Ht,Ot;return Ht&&Ht.variants&&(Ot=Ht.variants,delete zt.variants,zt=jt=>{let kt=Ht;return variantsResolver(jt,transformVariants(Ot),Ot).forEach(Ct=>{kt=deepmerge$1(kt,Ct)}),kt}),zt}return Ht}):[];let $t=xt;if(isPlainObject$4(xt)){let Ht;xt&&xt.variants&&(Ht=xt.variants,delete $t.variants,$t=zt=>{let Ot=xt;return variantsResolver(zt,transformVariants(Ht),Ht).forEach(kt=>{Ot=deepmerge$1(Ot,kt)}),Ot})}else typeof xt=="function"&&xt.__emotion_real!==xt&&($t=Ht=>muiStyledFunctionResolver({styledArg:xt,props:Ht,defaultTheme:nt,themeId:et}));lt&&dt&&Et.push(Ht=>{const zt=resolveTheme(_extends$t({},Ht,{defaultTheme:nt,themeId:et})),Ot=getStyleOverrides(lt,zt);if(Ot){const jt={};return Object.entries(Ot).forEach(([kt,Tt])=>{jt[kt]=typeof Tt=="function"?Tt(_extends$t({},Ht,{theme:zt})):Tt}),dt(Ht,jt)}return null}),lt&&!mt&&Et.push(Ht=>{const zt=resolveTheme(_extends$t({},Ht,{defaultTheme:nt,themeId:et}));return themeVariantsResolver(Ht,getVariantStyles(lt,zt),zt,lt)}),gt||Et.push(ot);const It=Et.length-St.length;if(Array.isArray(xt)&&It>0){const Ht=new Array(It).fill("");$t=[...xt,...Ht],$t.raw=[...xt.raw,...Ht]}const Ft=wt($t,...Et);return at.muiName&&(Ft.muiName=at.muiName),Ft};return wt.withConfig&&(vt.withConfig=wt.withConfig),vt}}const styled$2=createStyled(),systemStyled=styled$2;function getThemeProps(tt){const{theme:et,name:nt,props:it}=tt;return!et||!et.components||!et.components[nt]||!et.components[nt].defaultProps?it:resolveProps(et.components[nt].defaultProps,it)}function useThemeProps$1({props:tt,name:et,defaultTheme:nt,themeId:it}){let rt=useTheme$2(nt);return it&&(rt=rt[it]||rt),getThemeProps({theme:rt,name:et,props:tt})}function clamp$5(tt,et=0,nt=1){return Math.min(Math.max(et,tt),nt)}function hexToRgb(tt){tt=tt.slice(1);const et=new RegExp(`.{1,${tt.length>=6?2:1}}`,"g");let nt=tt.match(et);return nt&&nt[0].length===1&&(nt=nt.map(it=>it+it)),nt?`rgb${nt.length===4?"a":""}(${nt.map((it,rt)=>rt<3?parseInt(it,16):Math.round(parseInt(it,16)/255*1e3)/1e3).join(", ")})`:""}function decomposeColor(tt){if(tt.type)return tt;if(tt.charAt(0)==="#")return decomposeColor(hexToRgb(tt));const et=tt.indexOf("("),nt=tt.substring(0,et);if(["rgb","rgba","hsl","hsla","color"].indexOf(nt)===-1)throw new Error(formatMuiErrorMessage(9,tt));let it=tt.substring(et+1,tt.length-1),rt;if(nt==="color"){if(it=it.split(" "),rt=it.shift(),it.length===4&&it[3].charAt(0)==="/"&&(it[3]=it[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(rt)===-1)throw new Error(formatMuiErrorMessage(10,rt))}else it=it.split(",");return it=it.map(ot=>parseFloat(ot)),{type:nt,values:it,colorSpace:rt}}function recomposeColor(tt){const{type:et,colorSpace:nt}=tt;let{values:it}=tt;return et.indexOf("rgb")!==-1?it=it.map((rt,ot)=>ot<3?parseInt(rt,10):rt):et.indexOf("hsl")!==-1&&(it[1]=`${it[1]}%`,it[2]=`${it[2]}%`),et.indexOf("color")!==-1?it=`${nt} ${it.join(" ")}`:it=`${it.join(", ")}`,`${et}(${it})`}function hslToRgb(tt){tt=decomposeColor(tt);const{values:et}=tt,nt=et[0],it=et[1]/100,rt=et[2]/100,ot=it*Math.min(rt,1-rt),at=(ct,ut=(ct+nt/30)%12)=>rt-ot*Math.max(Math.min(ut-3,9-ut,1),-1);let st="rgb";const lt=[Math.round(at(0)*255),Math.round(at(8)*255),Math.round(at(4)*255)];return tt.type==="hsla"&&(st+="a",lt.push(et[3])),recomposeColor({type:st,values:lt})}function getLuminance(tt){tt=decomposeColor(tt);let et=tt.type==="hsl"||tt.type==="hsla"?decomposeColor(hslToRgb(tt)).values:tt.values;return et=et.map(nt=>(tt.type!=="color"&&(nt/=255),nt<=.03928?nt/12.92:((nt+.055)/1.055)**2.4)),Number((.2126*et[0]+.7152*et[1]+.0722*et[2]).toFixed(3))}function getContrastRatio(tt,et){const nt=getLuminance(tt),it=getLuminance(et);return(Math.max(nt,it)+.05)/(Math.min(nt,it)+.05)}function alpha$1(tt,et){return tt=decomposeColor(tt),et=clamp$5(et),(tt.type==="rgb"||tt.type==="hsl")&&(tt.type+="a"),tt.type==="color"?tt.values[3]=`/${et}`:tt.values[3]=et,recomposeColor(tt)}function darken(tt,et){if(tt=decomposeColor(tt),et=clamp$5(et),tt.type.indexOf("hsl")!==-1)tt.values[2]*=1-et;else if(tt.type.indexOf("rgb")!==-1||tt.type.indexOf("color")!==-1)for(let nt=0;nt<3;nt+=1)tt.values[nt]*=1-et;return recomposeColor(tt)}function lighten(tt,et){if(tt=decomposeColor(tt),et=clamp$5(et),tt.type.indexOf("hsl")!==-1)tt.values[2]+=(100-tt.values[2])*et;else if(tt.type.indexOf("rgb")!==-1)for(let nt=0;nt<3;nt+=1)tt.values[nt]+=(255-tt.values[nt])*et;else if(tt.type.indexOf("color")!==-1)for(let nt=0;nt<3;nt+=1)tt.values[nt]+=(1-tt.values[nt])*et;return recomposeColor(tt)}const ThemeContext=reactExports.createContext(null),ThemeContext$1=ThemeContext;function useTheme$1(){return reactExports.useContext(ThemeContext$1)}const hasSymbol=typeof Symbol=="function"&&Symbol.for,nested=hasSymbol?Symbol.for("mui.nested"):"__THEME_NESTED__";function mergeOuterLocalTheme(tt,et){return typeof et=="function"?et(tt):_extends$t({},tt,et)}function ThemeProvider$2(tt){const{children:et,theme:nt}=tt,it=useTheme$1(),rt=reactExports.useMemo(()=>{const ot=it===null?nt:mergeOuterLocalTheme(it,nt);return ot!=null&&(ot[nested]=it!==null),ot},[nt,it]);return jsxRuntimeExports.jsx(ThemeContext$1.Provider,{value:rt,children:et})}const EMPTY_THEME={};function useThemeScoping(tt,et,nt,it=!1){return reactExports.useMemo(()=>{const rt=tt&&et[tt]||et;if(typeof nt=="function"){const ot=nt(rt),at=tt?_extends$t({},et,{[tt]:ot}):ot;return it?()=>at:at}return tt?_extends$t({},et,{[tt]:nt}):_extends$t({},et,nt)},[tt,et,nt,it])}function ThemeProvider$1(tt){const{children:et,theme:nt,themeId:it}=tt,rt=useTheme$3(EMPTY_THEME),ot=useTheme$1()||EMPTY_THEME,at=useThemeScoping(it,rt,nt),st=useThemeScoping(it,ot,nt,!0);return jsxRuntimeExports.jsx(ThemeProvider$2,{theme:st,children:jsxRuntimeExports.jsx(ThemeContext$2.Provider,{value:at,children:et})})}const _excluded$1a=["component","direction","spacing","divider","children","className","useFlexGap"],defaultTheme$2=createTheme$1(),defaultCreateStyledComponent=systemStyled("div",{name:"MuiStack",slot:"Root",overridesResolver:(tt,et)=>et.root});function useThemePropsDefault(tt){return useThemeProps$1({props:tt,name:"MuiStack",defaultTheme:defaultTheme$2})}function joinChildren(tt,et){const nt=reactExports.Children.toArray(tt).filter(Boolean);return nt.reduce((it,rt,ot)=>(it.push(rt),ot({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[tt],style$3=({ownerState:tt,theme:et})=>{let nt=_extends$t({display:"flex",flexDirection:"column"},handleBreakpoints({theme:et},resolveBreakpointValues({values:tt.direction,breakpoints:et.breakpoints.values}),it=>({flexDirection:it})));if(tt.spacing){const it=createUnarySpacing(et),rt=Object.keys(et.breakpoints.values).reduce((lt,ct)=>((typeof tt.spacing=="object"&&tt.spacing[ct]!=null||typeof tt.direction=="object"&&tt.direction[ct]!=null)&&(lt[ct]=!0),lt),{}),ot=resolveBreakpointValues({values:tt.direction,base:rt}),at=resolveBreakpointValues({values:tt.spacing,base:rt});typeof ot=="object"&&Object.keys(ot).forEach((lt,ct,ut)=>{if(!ot[lt]){const dt=ct>0?ot[ut[ct-1]]:"column";ot[lt]=dt}}),nt=deepmerge$1(nt,handleBreakpoints({theme:et},at,(lt,ct)=>tt.useFlexGap?{gap:getValue(it,lt)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${getSideFromDirection(ct?ot[ct]:tt.direction)}`]:getValue(it,lt)}}))}return nt=mergeBreakpointsInOrder(et.breakpoints,nt),nt};function createStack(tt={}){const{createStyledComponent:et=defaultCreateStyledComponent,useThemeProps:nt=useThemePropsDefault,componentName:it="MuiStack"}=tt,rt=()=>composeClasses({root:["root"]},lt=>generateUtilityClass(it,lt),{}),ot=et(style$3);return reactExports.forwardRef(function(lt,ct){const ut=nt(lt),ht=extendSxProp(ut),{component:dt="div",direction:pt="column",spacing:mt=0,divider:gt,children:bt,className:yt,useFlexGap:wt=!1}=ht,vt=_objectWithoutPropertiesLoose$m(ht,_excluded$1a),xt={direction:pt,spacing:mt,useFlexGap:wt},St=rt();return jsxRuntimeExports.jsx(ot,_extends$t({as:dt,ownerState:xt,ref:ct,className:clsx$4(St.root,yt)},vt,{children:gt?joinChildren(bt,gt):bt}))})}function createMixins(tt,et){return _extends$t({toolbar:{minHeight:56,[tt.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[tt.up("sm")]:{minHeight:64}}},et)}const _excluded$19=["mode","contrastThreshold","tonalOffset"],light={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:common$1.white,default:common$1.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},dark={text:{primary:common$1.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:common$1.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function addLightOrDark(tt,et,nt,it){const rt=it.light||it,ot=it.dark||it*1.5;tt[et]||(tt.hasOwnProperty(nt)?tt[et]=tt[nt]:et==="light"?tt.light=lighten(tt.main,rt):et==="dark"&&(tt.dark=darken(tt.main,ot)))}function getDefaultPrimary(tt="light"){return tt==="dark"?{main:blue$1[200],light:blue$1[50],dark:blue$1[400]}:{main:blue$1[700],light:blue$1[400],dark:blue$1[800]}}function getDefaultSecondary(tt="light"){return tt==="dark"?{main:purple$1[200],light:purple$1[50],dark:purple$1[400]}:{main:purple$1[500],light:purple$1[300],dark:purple$1[700]}}function getDefaultError(tt="light"){return tt==="dark"?{main:red$1[500],light:red$1[300],dark:red$1[700]}:{main:red$1[700],light:red$1[400],dark:red$1[800]}}function getDefaultInfo(tt="light"){return tt==="dark"?{main:lightBlue$1[400],light:lightBlue$1[300],dark:lightBlue$1[700]}:{main:lightBlue$1[700],light:lightBlue$1[500],dark:lightBlue$1[900]}}function getDefaultSuccess(tt="light"){return tt==="dark"?{main:green$1[400],light:green$1[300],dark:green$1[700]}:{main:green$1[800],light:green$1[500],dark:green$1[900]}}function getDefaultWarning(tt="light"){return tt==="dark"?{main:orange$1[400],light:orange$1[300],dark:orange$1[700]}:{main:"#ed6c02",light:orange$1[500],dark:orange$1[900]}}function createPalette(tt){const{mode:et="light",contrastThreshold:nt=3,tonalOffset:it=.2}=tt,rt=_objectWithoutPropertiesLoose$m(tt,_excluded$19),ot=tt.primary||getDefaultPrimary(et),at=tt.secondary||getDefaultSecondary(et),st=tt.error||getDefaultError(et),lt=tt.info||getDefaultInfo(et),ct=tt.success||getDefaultSuccess(et),ut=tt.warning||getDefaultWarning(et);function ht(gt){return getContrastRatio(gt,dark.text.primary)>=nt?dark.text.primary:light.text.primary}const dt=({color:gt,name:bt,mainShade:yt=500,lightShade:wt=300,darkShade:vt=700})=>{if(gt=_extends$t({},gt),!gt.main&>[yt]&&(gt.main=gt[yt]),!gt.hasOwnProperty("main"))throw new Error(formatMuiErrorMessage(11,bt?` (${bt})`:"",yt));if(typeof gt.main!="string")throw new Error(formatMuiErrorMessage(12,bt?` (${bt})`:"",JSON.stringify(gt.main)));return addLightOrDark(gt,"light",wt,it),addLightOrDark(gt,"dark",vt,it),gt.contrastText||(gt.contrastText=ht(gt.main)),gt},pt={dark,light};return deepmerge$1(_extends$t({common:_extends$t({},common$1),mode:et,primary:dt({color:ot,name:"primary"}),secondary:dt({color:at,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:dt({color:st,name:"error"}),warning:dt({color:ut,name:"warning"}),info:dt({color:lt,name:"info"}),success:dt({color:ct,name:"success"}),grey:grey$1,contrastThreshold:nt,getContrastText:ht,augmentColor:dt,tonalOffset:it},pt[et]),rt)}const _excluded$18=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function round$2(tt){return Math.round(tt*1e5)/1e5}const caseAllCaps={textTransform:"uppercase"},defaultFontFamily='"Roboto", "Helvetica", "Arial", sans-serif';function createTypography(tt,et){const nt=typeof et=="function"?et(tt):et,{fontFamily:it=defaultFontFamily,fontSize:rt=14,fontWeightLight:ot=300,fontWeightRegular:at=400,fontWeightMedium:st=500,fontWeightBold:lt=700,htmlFontSize:ct=16,allVariants:ut,pxToRem:ht}=nt,dt=_objectWithoutPropertiesLoose$m(nt,_excluded$18),pt=rt/14,mt=ht||(yt=>`${yt/ct*pt}rem`),gt=(yt,wt,vt,xt,St)=>_extends$t({fontFamily:it,fontWeight:yt,fontSize:mt(wt),lineHeight:vt},it===defaultFontFamily?{letterSpacing:`${round$2(xt/wt)}em`}:{},St,ut),bt={h1:gt(ot,96,1.167,-1.5),h2:gt(ot,60,1.2,-.5),h3:gt(at,48,1.167,0),h4:gt(at,34,1.235,.25),h5:gt(at,24,1.334,0),h6:gt(st,20,1.6,.15),subtitle1:gt(at,16,1.75,.15),subtitle2:gt(st,14,1.57,.1),body1:gt(at,16,1.5,.15),body2:gt(at,14,1.43,.15),button:gt(st,14,1.75,.4,caseAllCaps),caption:gt(at,12,1.66,.4),overline:gt(at,12,2.66,1,caseAllCaps),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return deepmerge$1(_extends$t({htmlFontSize:ct,pxToRem:mt,fontFamily:it,fontSize:rt,fontWeightLight:ot,fontWeightRegular:at,fontWeightMedium:st,fontWeightBold:lt},bt),dt,{clone:!1})}const shadowKeyUmbraOpacity=.2,shadowKeyPenumbraOpacity=.14,shadowAmbientShadowOpacity=.12;function createShadow(...tt){return[`${tt[0]}px ${tt[1]}px ${tt[2]}px ${tt[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`,`${tt[4]}px ${tt[5]}px ${tt[6]}px ${tt[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`,`${tt[8]}px ${tt[9]}px ${tt[10]}px ${tt[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",")}const shadows=["none",createShadow(0,2,1,-1,0,1,1,0,0,1,3,0),createShadow(0,3,1,-2,0,2,2,0,0,1,5,0),createShadow(0,3,3,-2,0,3,4,0,0,1,8,0),createShadow(0,2,4,-1,0,4,5,0,0,1,10,0),createShadow(0,3,5,-1,0,5,8,0,0,1,14,0),createShadow(0,3,5,-1,0,6,10,0,0,1,18,0),createShadow(0,4,5,-2,0,7,10,1,0,2,16,1),createShadow(0,5,5,-3,0,8,10,1,0,3,14,2),createShadow(0,5,6,-3,0,9,12,1,0,3,16,2),createShadow(0,6,6,-3,0,10,14,1,0,4,18,3),createShadow(0,6,7,-4,0,11,15,1,0,4,20,3),createShadow(0,7,8,-4,0,12,17,2,0,5,22,4),createShadow(0,7,8,-4,0,13,19,2,0,5,24,4),createShadow(0,7,9,-4,0,14,21,2,0,5,26,4),createShadow(0,8,9,-5,0,15,22,2,0,6,28,5),createShadow(0,8,10,-5,0,16,24,2,0,6,30,5),createShadow(0,8,11,-5,0,17,26,2,0,6,32,5),createShadow(0,9,11,-5,0,18,28,2,0,7,34,6),createShadow(0,9,12,-6,0,19,29,2,0,7,36,6),createShadow(0,10,13,-6,0,20,31,3,0,8,38,7),createShadow(0,10,13,-6,0,21,33,3,0,8,40,7),createShadow(0,10,14,-6,0,22,35,3,0,8,42,7),createShadow(0,11,14,-7,0,23,36,3,0,9,44,8),createShadow(0,11,15,-7,0,24,38,3,0,9,46,8)],shadows$1=shadows,_excluded$17=["duration","easing","delay"],easing={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function formatMs(tt){return`${Math.round(tt)}ms`}function getAutoHeightDuration(tt){if(!tt)return 0;const et=tt/36;return Math.round((4+15*et**.25+et/5)*10)}function createTransitions(tt){const et=_extends$t({},easing,tt.easing),nt=_extends$t({},duration,tt.duration);return _extends$t({getAutoHeightDuration,create:(rt=["all"],ot={})=>{const{duration:at=nt.standard,easing:st=et.easeInOut,delay:lt=0}=ot;return _objectWithoutPropertiesLoose$m(ot,_excluded$17),(Array.isArray(rt)?rt:[rt]).map(ct=>`${ct} ${typeof at=="string"?at:formatMs(at)} ${st} ${typeof lt=="string"?lt:formatMs(lt)}`).join(",")}},tt,{easing:et,duration:nt})}const zIndex={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},zIndex$1=zIndex,_excluded$16=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function createTheme(tt={},...et){const{mixins:nt={},palette:it={},transitions:rt={},typography:ot={}}=tt,at=_objectWithoutPropertiesLoose$m(tt,_excluded$16);if(tt.vars)throw new Error(formatMuiErrorMessage(18));const st=createPalette(it),lt=createTheme$1(tt);let ct=deepmerge$1(lt,{mixins:createMixins(lt.breakpoints,nt),palette:st,shadows:shadows$1.slice(),typography:createTypography(st,ot),transitions:createTransitions(rt),zIndex:_extends$t({},zIndex$1)});return ct=deepmerge$1(ct,at),ct=et.reduce((ut,ht)=>deepmerge$1(ut,ht),ct),ct.unstable_sxConfig=_extends$t({},defaultSxConfig$1,at==null?void 0:at.unstable_sxConfig),ct.unstable_sx=function(ht){return styleFunctionSx$1({sx:ht,theme:this})},ct}function getUnit$1(tt){return String(tt).match(/[\d.\-+]*\s*(.*)/)[1]||""}function toUnitless(tt){return parseFloat(tt)}const defaultTheme=createTheme(),defaultTheme$1=defaultTheme;function useTheme(){const tt=useTheme$2(defaultTheme$1);return tt[THEME_ID]||tt}function useThemeProps({props:tt,name:et}){return useThemeProps$1({props:tt,name:et,defaultTheme:defaultTheme$1,themeId:THEME_ID})}const rootShouldForwardProp=tt=>shouldForwardProp(tt)&&tt!=="classes",slotShouldForwardProp=shouldForwardProp,styled=createStyled({themeId:THEME_ID,defaultTheme:defaultTheme$1,rootShouldForwardProp}),styled$1=styled,_excluded$15=["theme"];function ThemeProvider(tt){let{theme:et}=tt,nt=_objectWithoutPropertiesLoose$m(tt,_excluded$15);const it=et[THEME_ID];return jsxRuntimeExports.jsx(ThemeProvider$1,_extends$t({},nt,{themeId:it?THEME_ID:void 0,theme:it||et}))}const getOverlayAlpha=tt=>{let et;return tt<1?et=5.11916*tt**2:et=4.5*Math.log(tt+1)+2,(et/100).toFixed(2)},getOverlayAlpha$1=getOverlayAlpha;function r$5(tt){var et,nt,it="";if(typeof tt=="string"||typeof tt=="number")it+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et{const{color:et,fontSize:nt,classes:it}=tt,rt={root:["root",et!=="inherit"&&`color${capitalize(et)}`,`fontSize${capitalize(nt)}`]};return composeClasses(rt,getSvgIconUtilityClass,it)},SvgIconRoot=styled$1("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.color!=="inherit"&&et[`color${capitalize(nt.color)}`],et[`fontSize${capitalize(nt.fontSize)}`]]}})(({theme:tt,ownerState:et})=>{var nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:et.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(nt=tt.transitions)==null||(it=nt.create)==null?void 0:it.call(nt,"fill",{duration:(rt=tt.transitions)==null||(rt=rt.duration)==null?void 0:rt.shorter}),fontSize:{inherit:"inherit",small:((ot=tt.typography)==null||(at=ot.pxToRem)==null?void 0:at.call(ot,20))||"1.25rem",medium:((st=tt.typography)==null||(lt=st.pxToRem)==null?void 0:lt.call(st,24))||"1.5rem",large:((ct=tt.typography)==null||(ut=ct.pxToRem)==null?void 0:ut.call(ct,35))||"2.1875rem"}[et.fontSize],color:(ht=(dt=(tt.vars||tt).palette)==null||(dt=dt[et.color])==null?void 0:dt.main)!=null?ht:{action:(pt=(tt.vars||tt).palette)==null||(pt=pt.action)==null?void 0:pt.active,disabled:(mt=(tt.vars||tt).palette)==null||(mt=mt.action)==null?void 0:mt.disabled,inherit:void 0}[et.color]}}),SvgIcon=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiSvgIcon"}),{children:rt,className:ot,color:at="inherit",component:st="svg",fontSize:lt="medium",htmlColor:ct,inheritViewBox:ut=!1,titleAccess:ht,viewBox:dt="0 0 24 24"}=it,pt=_objectWithoutPropertiesLoose$m(it,_excluded$14),mt=reactExports.isValidElement(rt)&&rt.type==="svg",gt=_extends$t({},it,{color:at,component:st,fontSize:lt,instanceFontSize:et.fontSize,inheritViewBox:ut,viewBox:dt,hasSvgAsChild:mt}),bt={};ut||(bt.viewBox=dt);const yt=useUtilityClasses$y(gt);return jsxRuntimeExports.jsxs(SvgIconRoot,_extends$t({as:st,className:clsx$3(yt.root,ot),focusable:"false",color:ct,"aria-hidden":ht?void 0:!0,role:ht?"img":void 0,ref:nt},bt,pt,mt&&rt.props,{ownerState:gt,children:[mt?rt.props.children:rt,ht?jsxRuntimeExports.jsx("title",{children:ht}):null]}))});SvgIcon.muiName="SvgIcon";const SvgIcon$1=SvgIcon;function createSvgIcon(tt,et){function nt(it,rt){return jsxRuntimeExports.jsx(SvgIcon$1,_extends$t({"data-testid":`${et}Icon`,ref:rt},it,{children:tt}))}return nt.muiName=SvgIcon$1.muiName,reactExports.memo(reactExports.forwardRef(nt))}function _setPrototypeOf$d(tt,et){return _setPrototypeOf$d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(it,rt){return it.__proto__=rt,it},_setPrototypeOf$d(tt,et)}function _inheritsLoose$1(tt,et){tt.prototype=Object.create(et.prototype),tt.prototype.constructor=tt,_setPrototypeOf$d(tt,et)}const config$1={disabled:!1},TransitionGroupContext=React$1.createContext(null);var forceReflow=function(et){return et.scrollTop},UNMOUNTED="unmounted",EXITED="exited",ENTERING="entering",ENTERED="entered",EXITING="exiting",Transition$1=function(tt){_inheritsLoose$1(et,tt);function et(it,rt){var ot;ot=tt.call(this,it,rt)||this;var at=rt,st=at&&!at.isMounting?it.enter:it.appear,lt;return ot.appearStatus=null,it.in?st?(lt=EXITED,ot.appearStatus=ENTERING):lt=ENTERED:it.unmountOnExit||it.mountOnEnter?lt=UNMOUNTED:lt=EXITED,ot.state={status:lt},ot.nextCallback=null,ot}et.getDerivedStateFromProps=function(rt,ot){var at=rt.in;return at&&ot.status===UNMOUNTED?{status:EXITED}:null};var nt=et.prototype;return nt.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},nt.componentDidUpdate=function(rt){var ot=null;if(rt!==this.props){var at=this.state.status;this.props.in?at!==ENTERING&&at!==ENTERED&&(ot=ENTERING):(at===ENTERING||at===ENTERED)&&(ot=EXITING)}this.updateStatus(!1,ot)},nt.componentWillUnmount=function(){this.cancelNextCallback()},nt.getTimeouts=function(){var rt=this.props.timeout,ot,at,st;return ot=at=st=rt,rt!=null&&typeof rt!="number"&&(ot=rt.exit,at=rt.enter,st=rt.appear!==void 0?rt.appear:at),{exit:ot,enter:at,appear:st}},nt.updateStatus=function(rt,ot){if(rt===void 0&&(rt=!1),ot!==null)if(this.cancelNextCallback(),ot===ENTERING){if(this.props.unmountOnExit||this.props.mountOnEnter){var at=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this);at&&forceReflow(at)}this.performEnter(rt)}else this.performExit();else this.props.unmountOnExit&&this.state.status===EXITED&&this.setState({status:UNMOUNTED})},nt.performEnter=function(rt){var ot=this,at=this.props.enter,st=this.context?this.context.isMounting:rt,lt=this.props.nodeRef?[st]:[ReactDOM.findDOMNode(this),st],ct=lt[0],ut=lt[1],ht=this.getTimeouts(),dt=st?ht.appear:ht.enter;if(!rt&&!at||config$1.disabled){this.safeSetState({status:ENTERED},function(){ot.props.onEntered(ct)});return}this.props.onEnter(ct,ut),this.safeSetState({status:ENTERING},function(){ot.props.onEntering(ct,ut),ot.onTransitionEnd(dt,function(){ot.safeSetState({status:ENTERED},function(){ot.props.onEntered(ct,ut)})})})},nt.performExit=function(){var rt=this,ot=this.props.exit,at=this.getTimeouts(),st=this.props.nodeRef?void 0:ReactDOM.findDOMNode(this);if(!ot||config$1.disabled){this.safeSetState({status:EXITED},function(){rt.props.onExited(st)});return}this.props.onExit(st),this.safeSetState({status:EXITING},function(){rt.props.onExiting(st),rt.onTransitionEnd(at.exit,function(){rt.safeSetState({status:EXITED},function(){rt.props.onExited(st)})})})},nt.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},nt.safeSetState=function(rt,ot){ot=this.setNextCallback(ot),this.setState(rt,ot)},nt.setNextCallback=function(rt){var ot=this,at=!0;return this.nextCallback=function(st){at&&(at=!1,ot.nextCallback=null,rt(st))},this.nextCallback.cancel=function(){at=!1},this.nextCallback},nt.onTransitionEnd=function(rt,ot){this.setNextCallback(ot);var at=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this),st=rt==null&&!this.props.addEndListener;if(!at||st){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var lt=this.props.nodeRef?[this.nextCallback]:[at,this.nextCallback],ct=lt[0],ut=lt[1];this.props.addEndListener(ct,ut)}rt!=null&&setTimeout(this.nextCallback,rt)},nt.render=function(){var rt=this.state.status;if(rt===UNMOUNTED)return null;var ot=this.props,at=ot.children;ot.in,ot.mountOnEnter,ot.unmountOnExit,ot.appear,ot.enter,ot.exit,ot.timeout,ot.addEndListener,ot.onEnter,ot.onEntering,ot.onEntered,ot.onExit,ot.onExiting,ot.onExited,ot.nodeRef;var st=_objectWithoutPropertiesLoose$m(ot,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return React$1.createElement(TransitionGroupContext.Provider,{value:null},typeof at=="function"?at(rt,st):React$1.cloneElement(React$1.Children.only(at),st))},et}(React$1.Component);Transition$1.contextType=TransitionGroupContext;Transition$1.propTypes={};function noop$5(){}Transition$1.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop$5,onEntering:noop$5,onEntered:noop$5,onExit:noop$5,onExiting:noop$5,onExited:noop$5};Transition$1.UNMOUNTED=UNMOUNTED;Transition$1.EXITED=EXITED;Transition$1.ENTERING=ENTERING;Transition$1.ENTERED=ENTERED;Transition$1.EXITING=EXITING;const Transition$2=Transition$1;function _assertThisInitialized$d(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function getChildMapping(tt,et){var nt=function(ot){return et&&reactExports.isValidElement(ot)?et(ot):ot},it=Object.create(null);return tt&&reactExports.Children.map(tt,function(rt){return rt}).forEach(function(rt){it[rt.key]=nt(rt)}),it}function mergeChildMappings(tt,et){tt=tt||{},et=et||{};function nt(ut){return ut in et?et[ut]:tt[ut]}var it=Object.create(null),rt=[];for(var ot in tt)ot in et?rt.length&&(it[ot]=rt,rt=[]):rt.push(ot);var at,st={};for(var lt in et){if(it[lt])for(at=0;attt.scrollTop;function getTransitionProps(tt,et){var nt,it;const{timeout:rt,easing:ot,style:at={}}=tt;return{duration:(nt=at.transitionDuration)!=null?nt:typeof rt=="number"?rt:rt[et.mode]||0,easing:(it=at.transitionTimingFunction)!=null?it:typeof ot=="object"?ot[et.mode]:ot,delay:at.transitionDelay}}function getPaperUtilityClass(tt){return generateUtilityClass("MuiPaper",tt)}generateUtilityClasses("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 _excluded$13=["className","component","elevation","square","variant"],useUtilityClasses$x=tt=>{const{square:et,elevation:nt,variant:it,classes:rt}=tt,ot={root:["root",it,!et&&"rounded",it==="elevation"&&`elevation${nt}`]};return composeClasses(ot,getPaperUtilityClass,rt)},PaperRoot=styled$1("div",{name:"MuiPaper",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],!nt.square&&et.rounded,nt.variant==="elevation"&&et[`elevation${nt.elevation}`]]}})(({theme:tt,ownerState:et})=>{var nt;return _extends$t({backgroundColor:(tt.vars||tt).palette.background.paper,color:(tt.vars||tt).palette.text.primary,transition:tt.transitions.create("box-shadow")},!et.square&&{borderRadius:tt.shape.borderRadius},et.variant==="outlined"&&{border:`1px solid ${(tt.vars||tt).palette.divider}`},et.variant==="elevation"&&_extends$t({boxShadow:(tt.vars||tt).shadows[et.elevation]},!tt.vars&&tt.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${alpha$1("#fff",getOverlayAlpha$1(et.elevation))}, ${alpha$1("#fff",getOverlayAlpha$1(et.elevation))})`},tt.vars&&{backgroundImage:(nt=tt.vars.overlays)==null?void 0:nt[et.elevation]}))}),Paper=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiPaper"}),{className:rt,component:ot="div",elevation:at=1,square:st=!1,variant:lt="elevation"}=it,ct=_objectWithoutPropertiesLoose$m(it,_excluded$13),ut=_extends$t({},it,{component:ot,elevation:at,square:st,variant:lt}),ht=useUtilityClasses$x(ut);return jsxRuntimeExports.jsx(PaperRoot,_extends$t({as:ot,ownerState:ut,className:clsx$3(ht.root,rt),ref:nt},ct))}),MuiPaper=Paper;function Ripple(tt){const{className:et,classes:nt,pulsate:it=!1,rippleX:rt,rippleY:ot,rippleSize:at,in:st,onExited:lt,timeout:ct}=tt,[ut,ht]=reactExports.useState(!1),dt=clsx$3(et,nt.ripple,nt.rippleVisible,it&&nt.ripplePulsate),pt={width:at,height:at,top:-(at/2)+ot,left:-(at/2)+rt},mt=clsx$3(nt.child,ut&&nt.childLeaving,it&&nt.childPulsate);return!st&&!ut&&ht(!0),reactExports.useEffect(()=>{if(!st&<!=null){const gt=setTimeout(lt,ct);return()=>{clearTimeout(gt)}}},[lt,st,ct]),jsxRuntimeExports.jsx("span",{className:dt,style:pt,children:jsxRuntimeExports.jsx("span",{className:mt})})}const touchRippleClasses=generateUtilityClasses("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),touchRippleClasses$1=touchRippleClasses,_excluded$12=["center","classes","className"];let _$2=tt=>tt,_t$2,_t2$2,_t3$2,_t4$2;const DURATION=550,DELAY_RIPPLE=80,enterKeyframe=keyframes(_t$2||(_t$2=_$2` 0% { transform: scale(0); opacity: 0.1; @@ -3580,8 +3580,8 @@ PROCEED WITH CAUTION! animation-iteration-count: infinite; animation-delay: 200ms; } -`),touchRippleClasses$1.rippleVisible,enterKeyframe,DURATION,({theme:tt})=>tt.transitions.easing.easeInOut,touchRippleClasses$1.ripplePulsate,({theme:tt})=>tt.transitions.duration.shorter,touchRippleClasses$1.child,touchRippleClasses$1.childLeaving,exitKeyframe,DURATION,({theme:tt})=>tt.transitions.easing.easeInOut,touchRippleClasses$1.childPulsate,pulsateKeyframe,({theme:tt})=>tt.transitions.easing.easeInOut),TouchRipple=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTouchRipple"}),{center:rt=!1,classes:ot={},className:at}=it,st=_objectWithoutPropertiesLoose$m(it,_excluded$12),[lt,ct]=reactExports.useState([]),ut=reactExports.useRef(0),ht=reactExports.useRef(null);reactExports.useEffect(()=>{ht.current&&(ht.current(),ht.current=null)},[lt]);const dt=reactExports.useRef(!1),pt=reactExports.useRef(0),mt=reactExports.useRef(null),gt=reactExports.useRef(null);reactExports.useEffect(()=>()=>{pt.current&&clearTimeout(pt.current)},[]);const bt=reactExports.useCallback(xt=>{const{pulsate:St,rippleX:Et,rippleY:It,rippleSize:Tt,cb:$t}=xt;ct(Ut=>[...Ut,jsxRuntimeExports.jsx(TouchRippleRipple,{classes:{ripple:clsx$3(ot.ripple,touchRippleClasses$1.ripple),rippleVisible:clsx$3(ot.rippleVisible,touchRippleClasses$1.rippleVisible),ripplePulsate:clsx$3(ot.ripplePulsate,touchRippleClasses$1.ripplePulsate),child:clsx$3(ot.child,touchRippleClasses$1.child),childLeaving:clsx$3(ot.childLeaving,touchRippleClasses$1.childLeaving),childPulsate:clsx$3(ot.childPulsate,touchRippleClasses$1.childPulsate)},timeout:DURATION,pulsate:St,rippleX:Et,rippleY:It,rippleSize:Tt},ut.current)]),ut.current+=1,ht.current=$t},[ot]),yt=reactExports.useCallback((xt={},St={},Et=()=>{})=>{const{pulsate:It=!1,center:Tt=rt||St.pulsate,fakeElement:$t=!1}=St;if((xt==null?void 0:xt.type)==="mousedown"&&dt.current){dt.current=!1;return}(xt==null?void 0:xt.type)==="touchstart"&&(dt.current=!0);const Ut=$t?null:gt.current,Lt=Ut?Ut.getBoundingClientRect():{width:0,height:0,left:0,top:0};let Bt,Pt,kt;if(Tt||xt===void 0||xt.clientX===0&&xt.clientY===0||!xt.clientX&&!xt.touches)Bt=Math.round(Lt.width/2),Pt=Math.round(Lt.height/2);else{const{clientX:At,clientY:Rt}=xt.touches&&xt.touches.length>0?xt.touches[0]:xt;Bt=Math.round(At-Lt.left),Pt=Math.round(Rt-Lt.top)}if(Tt)kt=Math.sqrt((2*Lt.width**2+Lt.height**2)/3),kt%2===0&&(kt+=1);else{const At=Math.max(Math.abs((Ut?Ut.clientWidth:0)-Bt),Bt)*2+2,Rt=Math.max(Math.abs((Ut?Ut.clientHeight:0)-Pt),Pt)*2+2;kt=Math.sqrt(At**2+Rt**2)}xt!=null&&xt.touches?mt.current===null&&(mt.current=()=>{bt({pulsate:It,rippleX:Bt,rippleY:Pt,rippleSize:kt,cb:Et})},pt.current=setTimeout(()=>{mt.current&&(mt.current(),mt.current=null)},DELAY_RIPPLE)):bt({pulsate:It,rippleX:Bt,rippleY:Pt,rippleSize:kt,cb:Et})},[rt,bt]),wt=reactExports.useCallback(()=>{yt({},{pulsate:!0})},[yt]),vt=reactExports.useCallback((xt,St)=>{if(clearTimeout(pt.current),(xt==null?void 0:xt.type)==="touchend"&&mt.current){mt.current(),mt.current=null,pt.current=setTimeout(()=>{vt(xt,St)});return}mt.current=null,ct(Et=>Et.length>0?Et.slice(1):Et),ht.current=St},[]);return reactExports.useImperativeHandle(nt,()=>({pulsate:wt,start:yt,stop:vt}),[wt,yt,vt]),jsxRuntimeExports.jsx(TouchRippleRoot,_extends$u({className:clsx$3(touchRippleClasses$1.root,ot.root,at),ref:gt},st,{children:jsxRuntimeExports.jsx(TransitionGroup$1,{component:null,exit:!0,children:lt})}))}),TouchRipple$1=TouchRipple;function getButtonBaseUtilityClass(tt){return generateUtilityClass("MuiButtonBase",tt)}const buttonBaseClasses=generateUtilityClasses("MuiButtonBase",["root","disabled","focusVisible"]),buttonBaseClasses$1=buttonBaseClasses,_excluded$11=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],useUtilityClasses$w=tt=>{const{disabled:et,focusVisible:nt,focusVisibleClassName:it,classes:rt}=tt,at=composeClasses({root:["root",et&&"disabled",nt&&"focusVisible"]},getButtonBaseUtilityClass,rt);return nt&&it&&(at.root+=` ${it}`),at},ButtonBaseRoot=styled$1("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${buttonBaseClasses$1.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ButtonBase=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiButtonBase"}),{action:rt,centerRipple:ot=!1,children:at,className:st,component:lt="button",disabled:ct=!1,disableRipple:ut=!1,disableTouchRipple:ht=!1,focusRipple:dt=!1,LinkComponent:pt="a",onBlur:mt,onClick:gt,onContextMenu:bt,onDragLeave:yt,onFocus:wt,onFocusVisible:vt,onKeyDown:xt,onKeyUp:St,onMouseDown:Et,onMouseLeave:It,onMouseUp:Tt,onTouchEnd:$t,onTouchMove:Ut,onTouchStart:Lt,tabIndex:Bt=0,TouchRippleProps:Pt,touchRippleRef:kt,type:At}=it,Rt=_objectWithoutPropertiesLoose$m(it,_excluded$11),Wt=reactExports.useRef(null),jt=reactExports.useRef(null),Ot=useForkRef(jt,kt),{isFocusVisibleRef:Ct,onFocus:Dt,onBlur:Mt,ref:Vt}=useIsFocusVisible(),[Qt,rn]=reactExports.useState(!1);ct&&Qt&&rn(!1),reactExports.useImperativeHandle(rt,()=>({focusVisible:()=>{rn(!0),Wt.current.focus()}}),[]);const[Xt,an]=reactExports.useState(!1);reactExports.useEffect(()=>{an(!0)},[]);const tn=Xt&&!ut&&!ct;reactExports.useEffect(()=>{Qt&&dt&&!ut&&Xt&&jt.current.pulsate()},[ut,dt,Qt,Xt]);function pn(Yt,_n,Mn=ht){return useEventCallback(Bn=>(_n&&_n(Bn),!Mn&&jt.current&&jt.current[Yt](Bn),!0))}const vn=pn("start",Et),sn=pn("stop",bt),Zt=pn("stop",yt),Sn=pn("stop",Tt),Tn=pn("stop",Yt=>{Qt&&Yt.preventDefault(),It&&It(Yt)}),Cn=pn("start",Lt),jn=pn("stop",$t),Un=pn("stop",Ut),yn=pn("stop",Yt=>{Mt(Yt),Ct.current===!1&&rn(!1),mt&&mt(Yt)},!1),un=useEventCallback(Yt=>{Wt.current||(Wt.current=Yt.currentTarget),Dt(Yt),Ct.current===!0&&(rn(!0),vt&&vt(Yt)),wt&&wt(Yt)}),En=()=>{const Yt=Wt.current;return lt&<!=="button"&&!(Yt.tagName==="A"&&Yt.href)},In=reactExports.useRef(!1),xn=useEventCallback(Yt=>{dt&&!In.current&&Qt&&jt.current&&Yt.key===" "&&(In.current=!0,jt.current.stop(Yt,()=>{jt.current.start(Yt)})),Yt.target===Yt.currentTarget&&En()&&Yt.key===" "&&Yt.preventDefault(),xt&&xt(Yt),Yt.target===Yt.currentTarget&&En()&&Yt.key==="Enter"&&!ct&&(Yt.preventDefault(),gt&>(Yt))}),dn=useEventCallback(Yt=>{dt&&Yt.key===" "&&jt.current&&Qt&&!Yt.defaultPrevented&&(In.current=!1,jt.current.stop(Yt,()=>{jt.current.pulsate(Yt)})),St&&St(Yt),gt&&Yt.target===Yt.currentTarget&&En()&&Yt.key===" "&&!Yt.defaultPrevented&>(Yt)});let cn=lt;cn==="button"&&(Rt.href||Rt.to)&&(cn=pt);const hn={};cn==="button"?(hn.type=At===void 0?"button":At,hn.disabled=ct):(!Rt.href&&!Rt.to&&(hn.role="button"),ct&&(hn["aria-disabled"]=ct));const $n=useForkRef(nt,Vt,Wt),nn=_extends$u({},it,{centerRipple:ot,component:lt,disabled:ct,disableRipple:ut,disableTouchRipple:ht,focusRipple:dt,tabIndex:Bt,focusVisible:Qt}),Kt=useUtilityClasses$w(nn);return jsxRuntimeExports.jsxs(ButtonBaseRoot,_extends$u({as:cn,className:clsx$3(Kt.root,st),ownerState:nn,onBlur:yn,onClick:gt,onContextMenu:sn,onFocus:un,onKeyDown:xn,onKeyUp:dn,onMouseDown:vn,onMouseLeave:Tn,onMouseUp:Sn,onDragLeave:Zt,onTouchEnd:jn,onTouchMove:Un,onTouchStart:Cn,ref:$n,tabIndex:ct?-1:Bt,type:At},hn,Rt,{children:[at,tn?jsxRuntimeExports.jsx(TouchRipple$1,_extends$u({ref:Ot,center:ot},Pt)):null]}))}),ButtonBase$1=ButtonBase;function getIconButtonUtilityClass(tt){return generateUtilityClass("MuiIconButton",tt)}const iconButtonClasses=generateUtilityClasses("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),iconButtonClasses$1=iconButtonClasses,_excluded$10=["edge","children","className","color","disabled","disableFocusRipple","size"],useUtilityClasses$v=tt=>{const{classes:et,disabled:nt,color:it,edge:rt,size:ot}=tt,at={root:["root",nt&&"disabled",it!=="default"&&`color${capitalize(it)}`,rt&&`edge${capitalize(rt)}`,`size${capitalize(ot)}`]};return composeClasses(at,getIconButtonUtilityClass,et)},IconButtonRoot=styled$1(ButtonBase$1,{name:"MuiIconButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.color!=="default"&&et[`color${capitalize(nt.color)}`],nt.edge&&et[`edge${capitalize(nt.edge)}`],et[`size${capitalize(nt.size)}`]]}})(({theme:tt,ownerState:et})=>_extends$u({textAlign:"center",flex:"0 0 auto",fontSize:tt.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(tt.vars||tt).palette.action.active,transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shortest})},!et.disableRipple&&{"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},et.edge==="start"&&{marginLeft:et.size==="small"?-3:-12},et.edge==="end"&&{marginRight:et.size==="small"?-3:-12}),({theme:tt,ownerState:et})=>{var nt;const it=(nt=(tt.vars||tt).palette)==null?void 0:nt[et.color];return _extends$u({},et.color==="inherit"&&{color:"inherit"},et.color!=="inherit"&&et.color!=="default"&&_extends$u({color:it==null?void 0:it.main},!et.disableRipple&&{"&:hover":_extends$u({},it&&{backgroundColor:tt.vars?`rgba(${it.mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(it.main,tt.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),et.size==="small"&&{padding:5,fontSize:tt.typography.pxToRem(18)},et.size==="large"&&{padding:12,fontSize:tt.typography.pxToRem(28)},{[`&.${iconButtonClasses$1.disabled}`]:{backgroundColor:"transparent",color:(tt.vars||tt).palette.action.disabled}})}),IconButton$1=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiIconButton"}),{edge:rt=!1,children:ot,className:at,color:st="default",disabled:lt=!1,disableFocusRipple:ct=!1,size:ut="medium"}=it,ht=_objectWithoutPropertiesLoose$m(it,_excluded$10),dt=_extends$u({},it,{edge:rt,color:st,disabled:lt,disableFocusRipple:ct,size:ut}),pt=useUtilityClasses$v(dt);return jsxRuntimeExports.jsx(IconButtonRoot,_extends$u({className:clsx$3(pt.root,at),centerRipple:!0,focusRipple:!ct,disabled:lt,ref:nt,ownerState:dt},ht,{children:ot}))}),IconButton$2=IconButton$1;function isHostComponent(tt){return typeof tt=="string"}function appendOwnerState(tt,et,nt){return tt===void 0||isHostComponent(tt)?et:_extends$u({},et,{ownerState:_extends$u({},et.ownerState,nt)})}function areArraysEqual$1(tt,et,nt=(it,rt)=>it===rt){return tt.length===et.length&&tt.every((it,rt)=>nt(it,et[rt]))}const defaultContextValue={disableDefaultClasses:!1},ClassNameConfiguratorContext=reactExports.createContext(defaultContextValue);function useClassNamesOverride(tt){const{disableDefaultClasses:et}=reactExports.useContext(ClassNameConfiguratorContext);return nt=>et?"":tt(nt)}function extractEventHandlers(tt,et=[]){if(tt===void 0)return{};const nt={};return Object.keys(tt).filter(it=>it.match(/^on[A-Z]/)&&typeof tt[it]=="function"&&!et.includes(it)).forEach(it=>{nt[it]=tt[it]}),nt}function resolveComponentProps(tt,et,nt){return typeof tt=="function"?tt(et,nt):tt}function r$4(tt){var et,nt,it="";if(typeof tt=="string"||typeof tt=="number")it+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et!(nt.match(/^on[A-Z]/)&&typeof tt[nt]=="function")).forEach(nt=>{et[nt]=tt[nt]}),et}function mergeSlotProps(tt){const{getSlotProps:et,additionalProps:nt,externalSlotProps:it,externalForwardedProps:rt,className:ot}=tt;if(!et){const pt=clsx$2(nt==null?void 0:nt.className,ot,rt==null?void 0:rt.className,it==null?void 0:it.className),mt=_extends$u({},nt==null?void 0:nt.style,rt==null?void 0:rt.style,it==null?void 0:it.style),gt=_extends$u({},nt,rt,it);return pt.length>0&&(gt.className=pt),Object.keys(mt).length>0&&(gt.style=mt),{props:gt,internalRef:void 0}}const at=extractEventHandlers(_extends$u({},rt,it)),st=omitEventHandlers(it),lt=omitEventHandlers(rt),ct=et(at),ut=clsx$2(ct==null?void 0:ct.className,nt==null?void 0:nt.className,ot,rt==null?void 0:rt.className,it==null?void 0:it.className),ht=_extends$u({},ct==null?void 0:ct.style,nt==null?void 0:nt.style,rt==null?void 0:rt.style,it==null?void 0:it.style),dt=_extends$u({},ct,nt,lt,st);return ut.length>0&&(dt.className=ut),Object.keys(ht).length>0&&(dt.style=ht),{props:dt,internalRef:ct.ref}}const _excluded$$=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function useSlotProps(tt){var et;const{elementType:nt,externalSlotProps:it,ownerState:rt,skipResolvingSlotProps:ot=!1}=tt,at=_objectWithoutPropertiesLoose$m(tt,_excluded$$),st=ot?{}:resolveComponentProps(it,rt),{props:lt,internalRef:ct}=mergeSlotProps(_extends$u({},at,{externalSlotProps:st})),ut=useForkRef(ct,st==null?void 0:st.ref,(et=tt.additionalProps)==null?void 0:et.ref);return appendOwnerState(nt,_extends$u({},lt,{ref:ut}),rt)}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(tt){const et=parseInt(tt.getAttribute("tabindex")||"",10);return Number.isNaN(et)?tt.contentEditable==="true"||(tt.nodeName==="AUDIO"||tt.nodeName==="VIDEO"||tt.nodeName==="DETAILS")&&tt.getAttribute("tabindex")===null?0:tt.tabIndex:et}function isNonTabbableRadio(tt){if(tt.tagName!=="INPUT"||tt.type!=="radio"||!tt.name)return!1;const et=it=>tt.ownerDocument.querySelector(`input[type="radio"]${it}`);let nt=et(`[name="${tt.name}"]:checked`);return nt||(nt=et(`[name="${tt.name}"]`)),nt!==tt}function isNodeMatchingSelectorFocusable(tt){return!(tt.disabled||tt.tagName==="INPUT"&&tt.type==="hidden"||isNonTabbableRadio(tt))}function defaultGetTabbable(tt){const et=[],nt=[];return Array.from(tt.querySelectorAll(candidatesSelector)).forEach((it,rt)=>{const ot=getTabIndex(it);ot===-1||!isNodeMatchingSelectorFocusable(it)||(ot===0?et.push(it):nt.push({documentOrder:rt,tabIndex:ot,node:it}))}),nt.sort((it,rt)=>it.tabIndex===rt.tabIndex?it.documentOrder-rt.documentOrder:it.tabIndex-rt.tabIndex).map(it=>it.node).concat(et)}function defaultIsEnabled(){return!0}function FocusTrap(tt){const{children:et,disableAutoFocus:nt=!1,disableEnforceFocus:it=!1,disableRestoreFocus:rt=!1,getTabbable:ot=defaultGetTabbable,isEnabled:at=defaultIsEnabled,open:st}=tt,lt=reactExports.useRef(!1),ct=reactExports.useRef(null),ut=reactExports.useRef(null),ht=reactExports.useRef(null),dt=reactExports.useRef(null),pt=reactExports.useRef(!1),mt=reactExports.useRef(null),gt=useForkRef(et.ref,mt),bt=reactExports.useRef(null);reactExports.useEffect(()=>{!st||!mt.current||(pt.current=!nt)},[nt,st]),reactExports.useEffect(()=>{if(!st||!mt.current)return;const vt=ownerDocument(mt.current);return mt.current.contains(vt.activeElement)||(mt.current.hasAttribute("tabIndex")||mt.current.setAttribute("tabIndex","-1"),pt.current&&mt.current.focus()),()=>{rt||(ht.current&&ht.current.focus&&(lt.current=!0,ht.current.focus()),ht.current=null)}},[st]),reactExports.useEffect(()=>{if(!st||!mt.current)return;const vt=ownerDocument(mt.current),xt=It=>{bt.current=It,!(it||!at()||It.key!=="Tab")&&vt.activeElement===mt.current&&It.shiftKey&&(lt.current=!0,ut.current&&ut.current.focus())},St=()=>{const It=mt.current;if(It===null)return;if(!vt.hasFocus()||!at()||lt.current){lt.current=!1;return}if(It.contains(vt.activeElement)||it&&vt.activeElement!==ct.current&&vt.activeElement!==ut.current)return;if(vt.activeElement!==dt.current)dt.current=null;else if(dt.current!==null)return;if(!pt.current)return;let Tt=[];if((vt.activeElement===ct.current||vt.activeElement===ut.current)&&(Tt=ot(mt.current)),Tt.length>0){var $t,Ut;const Lt=!!(($t=bt.current)!=null&&$t.shiftKey&&((Ut=bt.current)==null?void 0:Ut.key)==="Tab"),Bt=Tt[0],Pt=Tt[Tt.length-1];typeof Bt!="string"&&typeof Pt!="string"&&(Lt?Pt.focus():Bt.focus())}else It.focus()};vt.addEventListener("focusin",St),vt.addEventListener("keydown",xt,!0);const Et=setInterval(()=>{vt.activeElement&&vt.activeElement.tagName==="BODY"&&St()},50);return()=>{clearInterval(Et),vt.removeEventListener("focusin",St),vt.removeEventListener("keydown",xt,!0)}},[nt,it,rt,at,st,ot]);const yt=vt=>{ht.current===null&&(ht.current=vt.relatedTarget),pt.current=!0,dt.current=vt.target;const xt=et.props.onFocus;xt&&xt(vt)},wt=vt=>{ht.current===null&&(ht.current=vt.relatedTarget),pt.current=!0};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{tabIndex:st?0:-1,onFocus:wt,ref:ct,"data-testid":"sentinelStart"}),reactExports.cloneElement(et,{ref:gt,onFocus:yt}),jsxRuntimeExports.jsx("div",{tabIndex:st?0:-1,onFocus:wt,ref:ut,"data-testid":"sentinelEnd"})]})}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start$2="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(tt,et){return tt.concat([et+"-"+start$2,et+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(tt,et){return tt.concat([et,et+"-"+start$2,et+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(tt){return tt?(tt.nodeName||"").toLowerCase():null}function getWindow(tt){if(tt==null)return window;if(tt.toString()!=="[object Window]"){var et=tt.ownerDocument;return et&&et.defaultView||window}return tt}function isElement(tt){var et=getWindow(tt).Element;return tt instanceof et||tt instanceof Element}function isHTMLElement$1(tt){var et=getWindow(tt).HTMLElement;return tt instanceof et||tt instanceof HTMLElement}function isShadowRoot(tt){if(typeof ShadowRoot>"u")return!1;var et=getWindow(tt).ShadowRoot;return tt instanceof et||tt instanceof ShadowRoot}function applyStyles(tt){var et=tt.state;Object.keys(et.elements).forEach(function(nt){var it=et.styles[nt]||{},rt=et.attributes[nt]||{},ot=et.elements[nt];!isHTMLElement$1(ot)||!getNodeName(ot)||(Object.assign(ot.style,it),Object.keys(rt).forEach(function(at){var st=rt[at];st===!1?ot.removeAttribute(at):ot.setAttribute(at,st===!0?"":st)}))})}function effect$2(tt){var et=tt.state,nt={popper:{position:et.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(et.elements.popper.style,nt.popper),et.styles=nt,et.elements.arrow&&Object.assign(et.elements.arrow.style,nt.arrow),function(){Object.keys(et.elements).forEach(function(it){var rt=et.elements[it],ot=et.attributes[it]||{},at=Object.keys(et.styles.hasOwnProperty(it)?et.styles[it]:nt[it]),st=at.reduce(function(lt,ct){return lt[ct]="",lt},{});!isHTMLElement$1(rt)||!getNodeName(rt)||(Object.assign(rt.style,st),Object.keys(ot).forEach(function(lt){rt.removeAttribute(lt)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(tt){return tt.split("-")[0]}var max$4=Math.max,min$5=Math.min,round$1=Math.round;function getUAString(){var tt=navigator.userAgentData;return tt!=null&&tt.brands&&Array.isArray(tt.brands)?tt.brands.map(function(et){return et.brand+"/"+et.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(tt,et,nt){et===void 0&&(et=!1),nt===void 0&&(nt=!1);var it=tt.getBoundingClientRect(),rt=1,ot=1;et&&isHTMLElement$1(tt)&&(rt=tt.offsetWidth>0&&round$1(it.width)/tt.offsetWidth||1,ot=tt.offsetHeight>0&&round$1(it.height)/tt.offsetHeight||1);var at=isElement(tt)?getWindow(tt):window,st=at.visualViewport,lt=!isLayoutViewport()&&nt,ct=(it.left+(lt&&st?st.offsetLeft:0))/rt,ut=(it.top+(lt&&st?st.offsetTop:0))/ot,ht=it.width/rt,dt=it.height/ot;return{width:ht,height:dt,top:ut,right:ct+ht,bottom:ut+dt,left:ct,x:ct,y:ut}}function getLayoutRect(tt){var et=getBoundingClientRect(tt),nt=tt.offsetWidth,it=tt.offsetHeight;return Math.abs(et.width-nt)<=1&&(nt=et.width),Math.abs(et.height-it)<=1&&(it=et.height),{x:tt.offsetLeft,y:tt.offsetTop,width:nt,height:it}}function contains(tt,et){var nt=et.getRootNode&&et.getRootNode();if(tt.contains(et))return!0;if(nt&&isShadowRoot(nt)){var it=et;do{if(it&&tt.isSameNode(it))return!0;it=it.parentNode||it.host}while(it)}return!1}function getComputedStyle$1(tt){return getWindow(tt).getComputedStyle(tt)}function isTableElement(tt){return["table","td","th"].indexOf(getNodeName(tt))>=0}function getDocumentElement(tt){return((isElement(tt)?tt.ownerDocument:tt.document)||window.document).documentElement}function getParentNode(tt){return getNodeName(tt)==="html"?tt:tt.assignedSlot||tt.parentNode||(isShadowRoot(tt)?tt.host:null)||getDocumentElement(tt)}function getTrueOffsetParent(tt){return!isHTMLElement$1(tt)||getComputedStyle$1(tt).position==="fixed"?null:tt.offsetParent}function getContainingBlock(tt){var et=/firefox/i.test(getUAString()),nt=/Trident/i.test(getUAString());if(nt&&isHTMLElement$1(tt)){var it=getComputedStyle$1(tt);if(it.position==="fixed")return null}var rt=getParentNode(tt);for(isShadowRoot(rt)&&(rt=rt.host);isHTMLElement$1(rt)&&["html","body"].indexOf(getNodeName(rt))<0;){var ot=getComputedStyle$1(rt);if(ot.transform!=="none"||ot.perspective!=="none"||ot.contain==="paint"||["transform","perspective"].indexOf(ot.willChange)!==-1||et&&ot.willChange==="filter"||et&&ot.filter&&ot.filter!=="none")return rt;rt=rt.parentNode}return null}function getOffsetParent(tt){for(var et=getWindow(tt),nt=getTrueOffsetParent(tt);nt&&isTableElement(nt)&&getComputedStyle$1(nt).position==="static";)nt=getTrueOffsetParent(nt);return nt&&(getNodeName(nt)==="html"||getNodeName(nt)==="body"&&getComputedStyle$1(nt).position==="static")?et:nt||getContainingBlock(tt)||et}function getMainAxisFromPlacement(tt){return["top","bottom"].indexOf(tt)>=0?"x":"y"}function within(tt,et,nt){return max$4(tt,min$5(et,nt))}function withinMaxClamp(tt,et,nt){var it=within(tt,et,nt);return it>nt?nt:it}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(tt){return Object.assign({},getFreshSideObject(),tt)}function expandToHashMap(tt,et){return et.reduce(function(nt,it){return nt[it]=tt,nt},{})}var toPaddingObject=function(et,nt){return et=typeof et=="function"?et(Object.assign({},nt.rects,{placement:nt.placement})):et,mergePaddingObject(typeof et!="number"?et:expandToHashMap(et,basePlacements))};function arrow(tt){var et,nt=tt.state,it=tt.name,rt=tt.options,ot=nt.elements.arrow,at=nt.modifiersData.popperOffsets,st=getBasePlacement(nt.placement),lt=getMainAxisFromPlacement(st),ct=[left,right].indexOf(st)>=0,ut=ct?"height":"width";if(!(!ot||!at)){var ht=toPaddingObject(rt.padding,nt),dt=getLayoutRect(ot),pt=lt==="y"?top:left,mt=lt==="y"?bottom:right,gt=nt.rects.reference[ut]+nt.rects.reference[lt]-at[lt]-nt.rects.popper[ut],bt=at[lt]-nt.rects.reference[lt],yt=getOffsetParent(ot),wt=yt?lt==="y"?yt.clientHeight||0:yt.clientWidth||0:0,vt=gt/2-bt/2,xt=ht[pt],St=wt-dt[ut]-ht[mt],Et=wt/2-dt[ut]/2+vt,It=within(xt,Et,St),Tt=lt;nt.modifiersData[it]=(et={},et[Tt]=It,et.centerOffset=It-Et,et)}}function effect$1(tt){var et=tt.state,nt=tt.options,it=nt.element,rt=it===void 0?"[data-popper-arrow]":it;rt!=null&&(typeof rt=="string"&&(rt=et.elements.popper.querySelector(rt),!rt)||contains(et.elements.popper,rt)&&(et.elements.arrow=rt))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(tt){return tt.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(tt,et){var nt=tt.x,it=tt.y,rt=et.devicePixelRatio||1;return{x:round$1(nt*rt)/rt||0,y:round$1(it*rt)/rt||0}}function mapToStyles(tt){var et,nt=tt.popper,it=tt.popperRect,rt=tt.placement,ot=tt.variation,at=tt.offsets,st=tt.position,lt=tt.gpuAcceleration,ct=tt.adaptive,ut=tt.roundOffsets,ht=tt.isFixed,dt=at.x,pt=dt===void 0?0:dt,mt=at.y,gt=mt===void 0?0:mt,bt=typeof ut=="function"?ut({x:pt,y:gt}):{x:pt,y:gt};pt=bt.x,gt=bt.y;var yt=at.hasOwnProperty("x"),wt=at.hasOwnProperty("y"),vt=left,xt=top,St=window;if(ct){var Et=getOffsetParent(nt),It="clientHeight",Tt="clientWidth";if(Et===getWindow(nt)&&(Et=getDocumentElement(nt),getComputedStyle$1(Et).position!=="static"&&st==="absolute"&&(It="scrollHeight",Tt="scrollWidth")),Et=Et,rt===top||(rt===left||rt===right)&&ot===end){xt=bottom;var $t=ht&&Et===St&&St.visualViewport?St.visualViewport.height:Et[It];gt-=$t-it.height,gt*=lt?1:-1}if(rt===left||(rt===top||rt===bottom)&&ot===end){vt=right;var Ut=ht&&Et===St&&St.visualViewport?St.visualViewport.width:Et[Tt];pt-=Ut-it.width,pt*=lt?1:-1}}var Lt=Object.assign({position:st},ct&&unsetSides),Bt=ut===!0?roundOffsetsByDPR({x:pt,y:gt},getWindow(nt)):{x:pt,y:gt};if(pt=Bt.x,gt=Bt.y,lt){var Pt;return Object.assign({},Lt,(Pt={},Pt[xt]=wt?"0":"",Pt[vt]=yt?"0":"",Pt.transform=(St.devicePixelRatio||1)<=1?"translate("+pt+"px, "+gt+"px)":"translate3d("+pt+"px, "+gt+"px, 0)",Pt))}return Object.assign({},Lt,(et={},et[xt]=wt?gt+"px":"",et[vt]=yt?pt+"px":"",et.transform="",et))}function computeStyles(tt){var et=tt.state,nt=tt.options,it=nt.gpuAcceleration,rt=it===void 0?!0:it,ot=nt.adaptive,at=ot===void 0?!0:ot,st=nt.roundOffsets,lt=st===void 0?!0:st,ct={placement:getBasePlacement(et.placement),variation:getVariation(et.placement),popper:et.elements.popper,popperRect:et.rects.popper,gpuAcceleration:rt,isFixed:et.options.strategy==="fixed"};et.modifiersData.popperOffsets!=null&&(et.styles.popper=Object.assign({},et.styles.popper,mapToStyles(Object.assign({},ct,{offsets:et.modifiersData.popperOffsets,position:et.options.strategy,adaptive:at,roundOffsets:lt})))),et.modifiersData.arrow!=null&&(et.styles.arrow=Object.assign({},et.styles.arrow,mapToStyles(Object.assign({},ct,{offsets:et.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:lt})))),et.attributes.popper=Object.assign({},et.attributes.popper,{"data-popper-placement":et.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(tt){var et=tt.state,nt=tt.instance,it=tt.options,rt=it.scroll,ot=rt===void 0?!0:rt,at=it.resize,st=at===void 0?!0:at,lt=getWindow(et.elements.popper),ct=[].concat(et.scrollParents.reference,et.scrollParents.popper);return ot&&ct.forEach(function(ut){ut.addEventListener("scroll",nt.update,passive)}),st&<.addEventListener("resize",nt.update,passive),function(){ot&&ct.forEach(function(ut){ut.removeEventListener("scroll",nt.update,passive)}),st&<.removeEventListener("resize",nt.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(tt){return tt.replace(/left|right|bottom|top/g,function(et){return hash$1[et]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(tt){return tt.replace(/start|end/g,function(et){return hash[et]})}function getWindowScroll(tt){var et=getWindow(tt),nt=et.pageXOffset,it=et.pageYOffset;return{scrollLeft:nt,scrollTop:it}}function getWindowScrollBarX(tt){return getBoundingClientRect(getDocumentElement(tt)).left+getWindowScroll(tt).scrollLeft}function getViewportRect(tt,et){var nt=getWindow(tt),it=getDocumentElement(tt),rt=nt.visualViewport,ot=it.clientWidth,at=it.clientHeight,st=0,lt=0;if(rt){ot=rt.width,at=rt.height;var ct=isLayoutViewport();(ct||!ct&&et==="fixed")&&(st=rt.offsetLeft,lt=rt.offsetTop)}return{width:ot,height:at,x:st+getWindowScrollBarX(tt),y:lt}}function getDocumentRect(tt){var et,nt=getDocumentElement(tt),it=getWindowScroll(tt),rt=(et=tt.ownerDocument)==null?void 0:et.body,ot=max$4(nt.scrollWidth,nt.clientWidth,rt?rt.scrollWidth:0,rt?rt.clientWidth:0),at=max$4(nt.scrollHeight,nt.clientHeight,rt?rt.scrollHeight:0,rt?rt.clientHeight:0),st=-it.scrollLeft+getWindowScrollBarX(tt),lt=-it.scrollTop;return getComputedStyle$1(rt||nt).direction==="rtl"&&(st+=max$4(nt.clientWidth,rt?rt.clientWidth:0)-ot),{width:ot,height:at,x:st,y:lt}}function isScrollParent(tt){var et=getComputedStyle$1(tt),nt=et.overflow,it=et.overflowX,rt=et.overflowY;return/auto|scroll|overlay|hidden/.test(nt+rt+it)}function getScrollParent(tt){return["html","body","#document"].indexOf(getNodeName(tt))>=0?tt.ownerDocument.body:isHTMLElement$1(tt)&&isScrollParent(tt)?tt:getScrollParent(getParentNode(tt))}function listScrollParents(tt,et){var nt;et===void 0&&(et=[]);var it=getScrollParent(tt),rt=it===((nt=tt.ownerDocument)==null?void 0:nt.body),ot=getWindow(it),at=rt?[ot].concat(ot.visualViewport||[],isScrollParent(it)?it:[]):it,st=et.concat(at);return rt?st:st.concat(listScrollParents(getParentNode(at)))}function rectToClientRect(tt){return Object.assign({},tt,{left:tt.x,top:tt.y,right:tt.x+tt.width,bottom:tt.y+tt.height})}function getInnerBoundingClientRect(tt,et){var nt=getBoundingClientRect(tt,!1,et==="fixed");return nt.top=nt.top+tt.clientTop,nt.left=nt.left+tt.clientLeft,nt.bottom=nt.top+tt.clientHeight,nt.right=nt.left+tt.clientWidth,nt.width=tt.clientWidth,nt.height=tt.clientHeight,nt.x=nt.left,nt.y=nt.top,nt}function getClientRectFromMixedType(tt,et,nt){return et===viewport?rectToClientRect(getViewportRect(tt,nt)):isElement(et)?getInnerBoundingClientRect(et,nt):rectToClientRect(getDocumentRect(getDocumentElement(tt)))}function getClippingParents(tt){var et=listScrollParents(getParentNode(tt)),nt=["absolute","fixed"].indexOf(getComputedStyle$1(tt).position)>=0,it=nt&&isHTMLElement$1(tt)?getOffsetParent(tt):tt;return isElement(it)?et.filter(function(rt){return isElement(rt)&&contains(rt,it)&&getNodeName(rt)!=="body"}):[]}function getClippingRect(tt,et,nt,it){var rt=et==="clippingParents"?getClippingParents(tt):[].concat(et),ot=[].concat(rt,[nt]),at=ot[0],st=ot.reduce(function(lt,ct){var ut=getClientRectFromMixedType(tt,ct,it);return lt.top=max$4(ut.top,lt.top),lt.right=min$5(ut.right,lt.right),lt.bottom=min$5(ut.bottom,lt.bottom),lt.left=max$4(ut.left,lt.left),lt},getClientRectFromMixedType(tt,at,it));return st.width=st.right-st.left,st.height=st.bottom-st.top,st.x=st.left,st.y=st.top,st}function computeOffsets(tt){var et=tt.reference,nt=tt.element,it=tt.placement,rt=it?getBasePlacement(it):null,ot=it?getVariation(it):null,at=et.x+et.width/2-nt.width/2,st=et.y+et.height/2-nt.height/2,lt;switch(rt){case top:lt={x:at,y:et.y-nt.height};break;case bottom:lt={x:at,y:et.y+et.height};break;case right:lt={x:et.x+et.width,y:st};break;case left:lt={x:et.x-nt.width,y:st};break;default:lt={x:et.x,y:et.y}}var ct=rt?getMainAxisFromPlacement(rt):null;if(ct!=null){var ut=ct==="y"?"height":"width";switch(ot){case start$2:lt[ct]=lt[ct]-(et[ut]/2-nt[ut]/2);break;case end:lt[ct]=lt[ct]+(et[ut]/2-nt[ut]/2);break}}return lt}function detectOverflow(tt,et){et===void 0&&(et={});var nt=et,it=nt.placement,rt=it===void 0?tt.placement:it,ot=nt.strategy,at=ot===void 0?tt.strategy:ot,st=nt.boundary,lt=st===void 0?clippingParents:st,ct=nt.rootBoundary,ut=ct===void 0?viewport:ct,ht=nt.elementContext,dt=ht===void 0?popper:ht,pt=nt.altBoundary,mt=pt===void 0?!1:pt,gt=nt.padding,bt=gt===void 0?0:gt,yt=mergePaddingObject(typeof bt!="number"?bt:expandToHashMap(bt,basePlacements)),wt=dt===popper?reference:popper,vt=tt.rects.popper,xt=tt.elements[mt?wt:dt],St=getClippingRect(isElement(xt)?xt:xt.contextElement||getDocumentElement(tt.elements.popper),lt,ut,at),Et=getBoundingClientRect(tt.elements.reference),It=computeOffsets({reference:Et,element:vt,strategy:"absolute",placement:rt}),Tt=rectToClientRect(Object.assign({},vt,It)),$t=dt===popper?Tt:Et,Ut={top:St.top-$t.top+yt.top,bottom:$t.bottom-St.bottom+yt.bottom,left:St.left-$t.left+yt.left,right:$t.right-St.right+yt.right},Lt=tt.modifiersData.offset;if(dt===popper&&Lt){var Bt=Lt[rt];Object.keys(Ut).forEach(function(Pt){var kt=[right,bottom].indexOf(Pt)>=0?1:-1,At=[top,bottom].indexOf(Pt)>=0?"y":"x";Ut[Pt]+=Bt[At]*kt})}return Ut}function computeAutoPlacement(tt,et){et===void 0&&(et={});var nt=et,it=nt.placement,rt=nt.boundary,ot=nt.rootBoundary,at=nt.padding,st=nt.flipVariations,lt=nt.allowedAutoPlacements,ct=lt===void 0?placements:lt,ut=getVariation(it),ht=ut?st?variationPlacements:variationPlacements.filter(function(mt){return getVariation(mt)===ut}):basePlacements,dt=ht.filter(function(mt){return ct.indexOf(mt)>=0});dt.length===0&&(dt=ht);var pt=dt.reduce(function(mt,gt){return mt[gt]=detectOverflow(tt,{placement:gt,boundary:rt,rootBoundary:ot,padding:at})[getBasePlacement(gt)],mt},{});return Object.keys(pt).sort(function(mt,gt){return pt[mt]-pt[gt]})}function getExpandedFallbackPlacements(tt){if(getBasePlacement(tt)===auto)return[];var et=getOppositePlacement(tt);return[getOppositeVariationPlacement(tt),et,getOppositeVariationPlacement(et)]}function flip(tt){var et=tt.state,nt=tt.options,it=tt.name;if(!et.modifiersData[it]._skip){for(var rt=nt.mainAxis,ot=rt===void 0?!0:rt,at=nt.altAxis,st=at===void 0?!0:at,lt=nt.fallbackPlacements,ct=nt.padding,ut=nt.boundary,ht=nt.rootBoundary,dt=nt.altBoundary,pt=nt.flipVariations,mt=pt===void 0?!0:pt,gt=nt.allowedAutoPlacements,bt=et.options.placement,yt=getBasePlacement(bt),wt=yt===bt,vt=lt||(wt||!mt?[getOppositePlacement(bt)]:getExpandedFallbackPlacements(bt)),xt=[bt].concat(vt).reduce(function(Qt,rn){return Qt.concat(getBasePlacement(rn)===auto?computeAutoPlacement(et,{placement:rn,boundary:ut,rootBoundary:ht,padding:ct,flipVariations:mt,allowedAutoPlacements:gt}):rn)},[]),St=et.rects.reference,Et=et.rects.popper,It=new Map,Tt=!0,$t=xt[0],Ut=0;Ut=0,At=kt?"width":"height",Rt=detectOverflow(et,{placement:Lt,boundary:ut,rootBoundary:ht,altBoundary:dt,padding:ct}),Wt=kt?Pt?right:left:Pt?bottom:top;St[At]>Et[At]&&(Wt=getOppositePlacement(Wt));var jt=getOppositePlacement(Wt),Ot=[];if(ot&&Ot.push(Rt[Bt]<=0),st&&Ot.push(Rt[Wt]<=0,Rt[jt]<=0),Ot.every(function(Qt){return Qt})){$t=Lt,Tt=!1;break}It.set(Lt,Ot)}if(Tt)for(var Ct=mt?3:1,Dt=function(rn){var Xt=xt.find(function(an){var tn=It.get(an);if(tn)return tn.slice(0,rn).every(function(pn){return pn})});if(Xt)return $t=Xt,"break"},Mt=Ct;Mt>0;Mt--){var Vt=Dt(Mt);if(Vt==="break")break}et.placement!==$t&&(et.modifiersData[it]._skip=!0,et.placement=$t,et.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(tt,et,nt){return nt===void 0&&(nt={x:0,y:0}),{top:tt.top-et.height-nt.y,right:tt.right-et.width+nt.x,bottom:tt.bottom-et.height+nt.y,left:tt.left-et.width-nt.x}}function isAnySideFullyClipped(tt){return[top,right,bottom,left].some(function(et){return tt[et]>=0})}function hide$3(tt){var et=tt.state,nt=tt.name,it=et.rects.reference,rt=et.rects.popper,ot=et.modifiersData.preventOverflow,at=detectOverflow(et,{elementContext:"reference"}),st=detectOverflow(et,{altBoundary:!0}),lt=getSideOffsets(at,it),ct=getSideOffsets(st,rt,ot),ut=isAnySideFullyClipped(lt),ht=isAnySideFullyClipped(ct);et.modifiersData[nt]={referenceClippingOffsets:lt,popperEscapeOffsets:ct,isReferenceHidden:ut,hasPopperEscaped:ht},et.attributes.popper=Object.assign({},et.attributes.popper,{"data-popper-reference-hidden":ut,"data-popper-escaped":ht})}const hide$4={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide$3};function distanceAndSkiddingToXY(tt,et,nt){var it=getBasePlacement(tt),rt=[left,top].indexOf(it)>=0?-1:1,ot=typeof nt=="function"?nt(Object.assign({},et,{placement:tt})):nt,at=ot[0],st=ot[1];return at=at||0,st=(st||0)*rt,[left,right].indexOf(it)>=0?{x:st,y:at}:{x:at,y:st}}function offset(tt){var et=tt.state,nt=tt.options,it=tt.name,rt=nt.offset,ot=rt===void 0?[0,0]:rt,at=placements.reduce(function(ut,ht){return ut[ht]=distanceAndSkiddingToXY(ht,et.rects,ot),ut},{}),st=at[et.placement],lt=st.x,ct=st.y;et.modifiersData.popperOffsets!=null&&(et.modifiersData.popperOffsets.x+=lt,et.modifiersData.popperOffsets.y+=ct),et.modifiersData[it]=at}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(tt){var et=tt.state,nt=tt.name;et.modifiersData[nt]=computeOffsets({reference:et.rects.reference,element:et.rects.popper,strategy:"absolute",placement:et.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(tt){return tt==="x"?"y":"x"}function preventOverflow(tt){var et=tt.state,nt=tt.options,it=tt.name,rt=nt.mainAxis,ot=rt===void 0?!0:rt,at=nt.altAxis,st=at===void 0?!1:at,lt=nt.boundary,ct=nt.rootBoundary,ut=nt.altBoundary,ht=nt.padding,dt=nt.tether,pt=dt===void 0?!0:dt,mt=nt.tetherOffset,gt=mt===void 0?0:mt,bt=detectOverflow(et,{boundary:lt,rootBoundary:ct,padding:ht,altBoundary:ut}),yt=getBasePlacement(et.placement),wt=getVariation(et.placement),vt=!wt,xt=getMainAxisFromPlacement(yt),St=getAltAxis(xt),Et=et.modifiersData.popperOffsets,It=et.rects.reference,Tt=et.rects.popper,$t=typeof gt=="function"?gt(Object.assign({},et.rects,{placement:et.placement})):gt,Ut=typeof $t=="number"?{mainAxis:$t,altAxis:$t}:Object.assign({mainAxis:0,altAxis:0},$t),Lt=et.modifiersData.offset?et.modifiersData.offset[et.placement]:null,Bt={x:0,y:0};if(Et){if(ot){var Pt,kt=xt==="y"?top:left,At=xt==="y"?bottom:right,Rt=xt==="y"?"height":"width",Wt=Et[xt],jt=Wt+bt[kt],Ot=Wt-bt[At],Ct=pt?-Tt[Rt]/2:0,Dt=wt===start$2?It[Rt]:Tt[Rt],Mt=wt===start$2?-Tt[Rt]:-It[Rt],Vt=et.elements.arrow,Qt=pt&&Vt?getLayoutRect(Vt):{width:0,height:0},rn=et.modifiersData["arrow#persistent"]?et.modifiersData["arrow#persistent"].padding:getFreshSideObject(),Xt=rn[kt],an=rn[At],tn=within(0,It[Rt],Qt[Rt]),pn=vt?It[Rt]/2-Ct-tn-Xt-Ut.mainAxis:Dt-tn-Xt-Ut.mainAxis,vn=vt?-It[Rt]/2+Ct+tn+an+Ut.mainAxis:Mt+tn+an+Ut.mainAxis,sn=et.elements.arrow&&getOffsetParent(et.elements.arrow),Zt=sn?xt==="y"?sn.clientTop||0:sn.clientLeft||0:0,Sn=(Pt=Lt==null?void 0:Lt[xt])!=null?Pt:0,Tn=Wt+pn-Sn-Zt,Cn=Wt+vn-Sn,jn=within(pt?min$5(jt,Tn):jt,Wt,pt?max$4(Ot,Cn):Ot);Et[xt]=jn,Bt[xt]=jn-Wt}if(st){var Un,yn=xt==="x"?top:left,un=xt==="x"?bottom:right,En=Et[St],In=St==="y"?"height":"width",xn=En+bt[yn],dn=En-bt[un],cn=[top,left].indexOf(yt)!==-1,hn=(Un=Lt==null?void 0:Lt[St])!=null?Un:0,$n=cn?xn:En-It[In]-Tt[In]-hn+Ut.altAxis,nn=cn?En+It[In]+Tt[In]-hn-Ut.altAxis:dn,Kt=pt&&cn?withinMaxClamp($n,En,nn):within(pt?$n:xn,En,pt?nn:dn);Et[St]=Kt,Bt[St]=Kt-En}et.modifiersData[it]=Bt}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(tt){return{scrollLeft:tt.scrollLeft,scrollTop:tt.scrollTop}}function getNodeScroll(tt){return tt===getWindow(tt)||!isHTMLElement$1(tt)?getWindowScroll(tt):getHTMLElementScroll(tt)}function isElementScaled(tt){var et=tt.getBoundingClientRect(),nt=round$1(et.width)/tt.offsetWidth||1,it=round$1(et.height)/tt.offsetHeight||1;return nt!==1||it!==1}function getCompositeRect(tt,et,nt){nt===void 0&&(nt=!1);var it=isHTMLElement$1(et),rt=isHTMLElement$1(et)&&isElementScaled(et),ot=getDocumentElement(et),at=getBoundingClientRect(tt,rt,nt),st={scrollLeft:0,scrollTop:0},lt={x:0,y:0};return(it||!it&&!nt)&&((getNodeName(et)!=="body"||isScrollParent(ot))&&(st=getNodeScroll(et)),isHTMLElement$1(et)?(lt=getBoundingClientRect(et,!0),lt.x+=et.clientLeft,lt.y+=et.clientTop):ot&&(lt.x=getWindowScrollBarX(ot))),{x:at.left+st.scrollLeft-lt.x,y:at.top+st.scrollTop-lt.y,width:at.width,height:at.height}}function order$1(tt){var et=new Map,nt=new Set,it=[];tt.forEach(function(ot){et.set(ot.name,ot)});function rt(ot){nt.add(ot.name);var at=[].concat(ot.requires||[],ot.requiresIfExists||[]);at.forEach(function(st){if(!nt.has(st)){var lt=et.get(st);lt&&rt(lt)}}),it.push(ot)}return tt.forEach(function(ot){nt.has(ot.name)||rt(ot)}),it}function orderModifiers(tt){var et=order$1(tt);return modifierPhases.reduce(function(nt,it){return nt.concat(et.filter(function(rt){return rt.phase===it}))},[])}function debounce$3(tt){var et;return function(){return et||(et=new Promise(function(nt){Promise.resolve().then(function(){et=void 0,nt(tt())})})),et}}function mergeByName(tt){var et=tt.reduce(function(nt,it){var rt=nt[it.name];return nt[it.name]=rt?Object.assign({},rt,it,{options:Object.assign({},rt.options,it.options),data:Object.assign({},rt.data,it.data)}):it,nt},{});return Object.keys(et).map(function(nt){return et[nt]})}var DEFAULT_OPTIONS$k={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var tt=arguments.length,et=new Array(tt),nt=0;nt{ot||st(getContainer$1(rt)||document.body)},[rt,ot]),useEnhancedEffect$1(()=>{if(at&&!ot)return setRef(nt,at),()=>{setRef(nt,null)}},[nt,at,ot]),ot){if(reactExports.isValidElement(it)){const ct={ref:lt};return reactExports.cloneElement(it,ct)}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:it})}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:at&&reactDomExports.createPortal(it,at)})});function getPopperUtilityClass(tt){return generateUtilityClass("MuiPopper",tt)}generateUtilityClasses("MuiPopper",["root"]);const _excluded$_=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],_excluded2$9=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function flipPlacement(tt,et){if(et==="ltr")return tt;switch(tt){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return tt}}function resolveAnchorEl$1(tt){return typeof tt=="function"?tt():tt}function isHTMLElement(tt){return tt.nodeType!==void 0}const useUtilityClasses$u=()=>composeClasses({root:["root"]},useClassNamesOverride(getPopperUtilityClass)),defaultPopperOptions={},PopperTooltip=reactExports.forwardRef(function(et,nt){var it;const{anchorEl:rt,children:ot,direction:at,disablePortal:st,modifiers:lt,open:ct,placement:ut,popperOptions:ht,popperRef:dt,slotProps:pt={},slots:mt={},TransitionProps:gt}=et,bt=_objectWithoutPropertiesLoose$m(et,_excluded$_),yt=reactExports.useRef(null),wt=useForkRef(yt,nt),vt=reactExports.useRef(null),xt=useForkRef(vt,dt),St=reactExports.useRef(xt);useEnhancedEffect$1(()=>{St.current=xt},[xt]),reactExports.useImperativeHandle(dt,()=>vt.current,[]);const Et=flipPlacement(ut,at),[It,Tt]=reactExports.useState(Et),[$t,Ut]=reactExports.useState(resolveAnchorEl$1(rt));reactExports.useEffect(()=>{vt.current&&vt.current.forceUpdate()}),reactExports.useEffect(()=>{rt&&Ut(resolveAnchorEl$1(rt))},[rt]),useEnhancedEffect$1(()=>{if(!$t||!ct)return;const At=jt=>{Tt(jt.placement)};let Rt=[{name:"preventOverflow",options:{altBoundary:st}},{name:"flip",options:{altBoundary:st}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:jt})=>{At(jt)}}];lt!=null&&(Rt=Rt.concat(lt)),ht&&ht.modifiers!=null&&(Rt=Rt.concat(ht.modifiers));const Wt=createPopper($t,yt.current,_extends$u({placement:Et},ht,{modifiers:Rt}));return St.current(Wt),()=>{Wt.destroy(),St.current(null)}},[$t,st,lt,ct,ht,Et]);const Lt={placement:It};gt!==null&&(Lt.TransitionProps=gt);const Bt=useUtilityClasses$u(),Pt=(it=mt.root)!=null?it:"div",kt=useSlotProps({elementType:Pt,externalSlotProps:pt.root,externalForwardedProps:bt,additionalProps:{role:"tooltip",ref:wt},ownerState:et,className:Bt.root});return jsxRuntimeExports.jsx(Pt,_extends$u({},kt,{children:typeof ot=="function"?ot(Lt):ot}))}),Popper$1=reactExports.forwardRef(function(et,nt){const{anchorEl:it,children:rt,container:ot,direction:at="ltr",disablePortal:st=!1,keepMounted:lt=!1,modifiers:ct,open:ut,placement:ht="bottom",popperOptions:dt=defaultPopperOptions,popperRef:pt,style:mt,transition:gt=!1,slotProps:bt={},slots:yt={}}=et,wt=_objectWithoutPropertiesLoose$m(et,_excluded2$9),[vt,xt]=reactExports.useState(!0),St=()=>{xt(!1)},Et=()=>{xt(!0)};if(!lt&&!ut&&(!gt||vt))return null;let It;if(ot)It=ot;else if(it){const Ut=resolveAnchorEl$1(it);It=Ut&&isHTMLElement(Ut)?ownerDocument(Ut).body:ownerDocument(null).body}const Tt=!ut&<&&(!gt||vt)?"none":void 0,$t=gt?{in:ut,onEnter:St,onExited:Et}:void 0;return jsxRuntimeExports.jsx(Portal,{disablePortal:st,container:It,children:jsxRuntimeExports.jsx(PopperTooltip,_extends$u({anchorEl:it,direction:at,disablePortal:st,modifiers:ct,ref:nt,open:gt?!vt:ut,placement:ht,popperOptions:dt,popperRef:pt,slotProps:bt,slots:yt},wt,{style:_extends$u({position:"fixed",top:0,left:0,display:Tt},mt),TransitionProps:$t,children:rt}))})});function isOverflowing(tt){const et=ownerDocument(tt);return et.body===tt?ownerWindow(tt).innerWidth>et.documentElement.clientWidth:tt.scrollHeight>tt.clientHeight}function ariaHidden(tt,et){et?tt.setAttribute("aria-hidden","true"):tt.removeAttribute("aria-hidden")}function getPaddingRight(tt){return parseInt(ownerWindow(tt).getComputedStyle(tt).paddingRight,10)||0}function isAriaHiddenForbiddenOnElement(tt){const nt=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(tt.tagName)!==-1,it=tt.tagName==="INPUT"&&tt.getAttribute("type")==="hidden";return nt||it}function ariaHiddenSiblings(tt,et,nt,it,rt){const ot=[et,nt,...it];[].forEach.call(tt.children,at=>{const st=ot.indexOf(at)===-1,lt=!isAriaHiddenForbiddenOnElement(at);st&<&&ariaHidden(at,rt)})}function findIndexOf(tt,et){let nt=-1;return tt.some((it,rt)=>et(it)?(nt=rt,!0):!1),nt}function handleContainer(tt,et){const nt=[],it=tt.container;if(!et.disableScrollLock){if(isOverflowing(it)){const at=getScrollbarSize(ownerDocument(it));nt.push({value:it.style.paddingRight,property:"padding-right",el:it}),it.style.paddingRight=`${getPaddingRight(it)+at}px`;const st=ownerDocument(it).querySelectorAll(".mui-fixed");[].forEach.call(st,lt=>{nt.push({value:lt.style.paddingRight,property:"padding-right",el:lt}),lt.style.paddingRight=`${getPaddingRight(lt)+at}px`})}let ot;if(it.parentNode instanceof DocumentFragment)ot=ownerDocument(it).body;else{const at=it.parentElement,st=ownerWindow(it);ot=(at==null?void 0:at.nodeName)==="HTML"&&st.getComputedStyle(at).overflowY==="scroll"?at:it}nt.push({value:ot.style.overflow,property:"overflow",el:ot},{value:ot.style.overflowX,property:"overflow-x",el:ot},{value:ot.style.overflowY,property:"overflow-y",el:ot}),ot.style.overflow="hidden"}return()=>{nt.forEach(({value:ot,el:at,property:st})=>{ot?at.style.setProperty(st,ot):at.style.removeProperty(st)})}}function getHiddenSiblings(tt){const et=[];return[].forEach.call(tt.children,nt=>{nt.getAttribute("aria-hidden")==="true"&&et.push(nt)}),et}class ModalManager{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(et,nt){let it=this.modals.indexOf(et);if(it!==-1)return it;it=this.modals.length,this.modals.push(et),et.modalRef&&ariaHidden(et.modalRef,!1);const rt=getHiddenSiblings(nt);ariaHiddenSiblings(nt,et.mount,et.modalRef,rt,!0);const ot=findIndexOf(this.containers,at=>at.container===nt);return ot!==-1?(this.containers[ot].modals.push(et),it):(this.containers.push({modals:[et],container:nt,restore:null,hiddenSiblings:rt}),it)}mount(et,nt){const it=findIndexOf(this.containers,ot=>ot.modals.indexOf(et)!==-1),rt=this.containers[it];rt.restore||(rt.restore=handleContainer(rt,nt))}remove(et,nt=!0){const it=this.modals.indexOf(et);if(it===-1)return it;const rt=findIndexOf(this.containers,at=>at.modals.indexOf(et)!==-1),ot=this.containers[rt];if(ot.modals.splice(ot.modals.indexOf(et),1),this.modals.splice(it,1),ot.modals.length===0)ot.restore&&ot.restore(),et.modalRef&&ariaHidden(et.modalRef,nt),ariaHiddenSiblings(ot.container,et.mount,et.modalRef,ot.hiddenSiblings,!1),this.containers.splice(rt,1);else{const at=ot.modals[ot.modals.length-1];at.modalRef&&ariaHidden(at.modalRef,!1)}return it}isTopModal(et){return this.modals.length>0&&this.modals[this.modals.length-1]===et}}function getContainer(tt){return typeof tt=="function"?tt():tt}function getHasTransition(tt){return tt?tt.props.hasOwnProperty("in"):!1}const defaultManager=new ModalManager;function useModal$1(tt){const{container:et,disableEscapeKeyDown:nt=!1,disableScrollLock:it=!1,manager:rt=defaultManager,closeAfterTransition:ot=!1,onTransitionEnter:at,onTransitionExited:st,children:lt,onClose:ct,open:ut,rootRef:ht}=tt,dt=reactExports.useRef({}),pt=reactExports.useRef(null),mt=reactExports.useRef(null),gt=useForkRef(mt,ht),[bt,yt]=reactExports.useState(!ut),wt=getHasTransition(lt);let vt=!0;(tt["aria-hidden"]==="false"||tt["aria-hidden"]===!1)&&(vt=!1);const xt=()=>ownerDocument(pt.current),St=()=>(dt.current.modalRef=mt.current,dt.current.mount=pt.current,dt.current),Et=()=>{rt.mount(St(),{disableScrollLock:it}),mt.current&&(mt.current.scrollTop=0)},It=useEventCallback(()=>{const Rt=getContainer(et)||xt().body;rt.add(St(),Rt),mt.current&&Et()}),Tt=reactExports.useCallback(()=>rt.isTopModal(St()),[rt]),$t=useEventCallback(Rt=>{pt.current=Rt,Rt&&(ut&&Tt()?Et():mt.current&&ariaHidden(mt.current,vt))}),Ut=reactExports.useCallback(()=>{rt.remove(St(),vt)},[vt,rt]);reactExports.useEffect(()=>()=>{Ut()},[Ut]),reactExports.useEffect(()=>{ut?It():(!wt||!ot)&&Ut()},[ut,Ut,wt,ot,It]);const Lt=Rt=>Wt=>{var jt;(jt=Rt.onKeyDown)==null||jt.call(Rt,Wt),!(Wt.key!=="Escape"||Wt.which===229||!Tt())&&(nt||(Wt.stopPropagation(),ct&&ct(Wt,"escapeKeyDown")))},Bt=Rt=>Wt=>{var jt;(jt=Rt.onClick)==null||jt.call(Rt,Wt),Wt.target===Wt.currentTarget&&ct&&ct(Wt,"backdropClick")};return{getRootProps:(Rt={})=>{const Wt=extractEventHandlers(tt);delete Wt.onTransitionEnter,delete Wt.onTransitionExited;const jt=_extends$u({},Wt,Rt);return _extends$u({role:"presentation"},jt,{onKeyDown:Lt(jt),ref:gt})},getBackdropProps:(Rt={})=>{const Wt=Rt;return _extends$u({"aria-hidden":!0},Wt,{onClick:Bt(Wt),open:ut})},getTransitionProps:()=>{const Rt=()=>{yt(!1),at&&at()},Wt=()=>{yt(!0),st&&st(),ot&&Ut()};return{onEnter:createChainedFunction(Rt,lt==null?void 0:lt.props.onEnter),onExited:createChainedFunction(Wt,lt==null?void 0:lt.props.onExited)}},rootRef:gt,portalRef:$t,isTopModal:Tt,exited:bt,hasTransition:wt}}const INTENTIONAL_DRAG_COUNT_THRESHOLD=2;function asc(tt,et){return tt-et}function clamp$4(tt,et,nt){return tt==null?et:Math.min(Math.max(et,tt),nt)}function findClosest(tt,et){var nt;const{index:it}=(nt=tt.reduce((rt,ot,at)=>{const st=Math.abs(et-ot);return rt===null||st({left:`${tt}%`}),leap:tt=>({width:`${tt}%`})},"horizontal-reverse":{offset:tt=>({right:`${tt}%`}),leap:tt=>({width:`${tt}%`})},vertical:{offset:tt=>({bottom:`${tt}%`}),leap:tt=>({height:`${tt}%`})}},Identity$1=tt=>tt;let cachedSupportsTouchActionNone;function doesSupportTouchActionNone(){return cachedSupportsTouchActionNone===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?cachedSupportsTouchActionNone=CSS.supports("touch-action","none"):cachedSupportsTouchActionNone=!0),cachedSupportsTouchActionNone}function useSlider(tt){const{"aria-labelledby":et,defaultValue:nt,disabled:it=!1,disableSwap:rt=!1,isRtl:ot=!1,marks:at=!1,max:st=100,min:lt=0,name:ct,onChange:ut,onChangeCommitted:ht,orientation:dt="horizontal",rootRef:pt,scale:mt=Identity$1,step:gt=1,tabIndex:bt,value:yt}=tt,wt=reactExports.useRef(),[vt,xt]=reactExports.useState(-1),[St,Et]=reactExports.useState(-1),[It,Tt]=reactExports.useState(!1),$t=reactExports.useRef(0),[Ut,Lt]=useControlled({controlled:yt,default:nt??lt,name:"Slider"}),Bt=ut&&((hn,$n,nn)=>{const Kt=hn.nativeEvent||hn,Yt=new Kt.constructor(Kt.type,Kt);Object.defineProperty(Yt,"target",{writable:!0,value:{value:$n,name:ct}}),ut(Yt,$n,nn)}),Pt=Array.isArray(Ut);let kt=Pt?Ut.slice().sort(asc):[Ut];kt=kt.map(hn=>clamp$4(hn,lt,st));const At=at===!0&>!==null?[...Array(Math.floor((st-lt)/gt)+1)].map((hn,$n)=>({value:lt+gt*$n})):at||[],Rt=At.map(hn=>hn.value),{isFocusVisibleRef:Wt,onBlur:jt,onFocus:Ot,ref:Ct}=useIsFocusVisible(),[Dt,Mt]=reactExports.useState(-1),Vt=reactExports.useRef(),Qt=useForkRef(Ct,Vt),rn=useForkRef(pt,Qt),Xt=hn=>$n=>{var nn;const Kt=Number($n.currentTarget.getAttribute("data-index"));Ot($n),Wt.current===!0&&Mt(Kt),Et(Kt),hn==null||(nn=hn.onFocus)==null||nn.call(hn,$n)},an=hn=>$n=>{var nn;jt($n),Wt.current===!1&&Mt(-1),Et(-1),hn==null||(nn=hn.onBlur)==null||nn.call(hn,$n)};useEnhancedEffect$1(()=>{if(it&&Vt.current.contains(document.activeElement)){var hn;(hn=document.activeElement)==null||hn.blur()}},[it]),it&&vt!==-1&&xt(-1),it&&Dt!==-1&&Mt(-1);const tn=hn=>$n=>{var nn;(nn=hn.onChange)==null||nn.call(hn,$n);const Kt=Number($n.currentTarget.getAttribute("data-index")),Yt=kt[Kt],_n=Rt.indexOf(Yt);let Mn=$n.target.valueAsNumber;if(At&>==null){const Bn=Rt[Rt.length-1];Mn>Bn?Mn=Bn:Mn{const{current:nn}=Vt,{width:Kt,height:Yt,bottom:_n,left:Mn}=nn.getBoundingClientRect();let Bn;vn.indexOf("vertical")===0?Bn=(_n-hn.y)/Yt:Bn=(hn.x-Mn)/Kt,vn.indexOf("-reverse")!==-1&&(Bn=1-Bn);let Nn;if(Nn=percentToValue(Bn,lt,st),gt)Nn=roundValueToStep(Nn,gt,lt);else{const Wn=findClosest(Rt,Nn);Nn=Rt[Wn]}Nn=clamp$4(Nn,lt,st);let qn=0;if(Pt){$n?qn=pn.current:qn=findClosest(kt,Nn),rt&&(Nn=clamp$4(Nn,kt[qn-1]||-1/0,kt[qn+1]||1/0));const Wn=Nn;Nn=setValueIndex({values:kt,newValue:Nn,index:qn}),rt&&$n||(qn=Nn.indexOf(Wn),pn.current=qn)}return{newValue:Nn,activeIndex:qn}},Zt=useEventCallback(hn=>{const $n=trackFinger(hn,wt);if(!$n)return;if($t.current+=1,hn.type==="mousemove"&&hn.buttons===0){Sn(hn);return}const{newValue:nn,activeIndex:Kt}=sn({finger:$n,move:!0});focusThumb({sliderRef:Vt,activeIndex:Kt,setActive:xt}),Lt(nn),!It&&$t.current>INTENTIONAL_DRAG_COUNT_THRESHOLD&&Tt(!0),Bt&&!areValuesEqual(nn,Ut)&&Bt(hn,nn,Kt)}),Sn=useEventCallback(hn=>{const $n=trackFinger(hn,wt);if(Tt(!1),!$n)return;const{newValue:nn}=sn({finger:$n,move:!0});xt(-1),hn.type==="touchend"&&Et(-1),ht&&ht(hn,nn),wt.current=void 0,Cn()}),Tn=useEventCallback(hn=>{if(it)return;doesSupportTouchActionNone()||hn.preventDefault();const $n=hn.changedTouches[0];$n!=null&&(wt.current=$n.identifier);const nn=trackFinger(hn,wt);if(nn!==!1){const{newValue:Yt,activeIndex:_n}=sn({finger:nn});focusThumb({sliderRef:Vt,activeIndex:_n,setActive:xt}),Lt(Yt),Bt&&!areValuesEqual(Yt,Ut)&&Bt(hn,Yt,_n)}$t.current=0;const Kt=ownerDocument(Vt.current);Kt.addEventListener("touchmove",Zt),Kt.addEventListener("touchend",Sn)}),Cn=reactExports.useCallback(()=>{const hn=ownerDocument(Vt.current);hn.removeEventListener("mousemove",Zt),hn.removeEventListener("mouseup",Sn),hn.removeEventListener("touchmove",Zt),hn.removeEventListener("touchend",Sn)},[Sn,Zt]);reactExports.useEffect(()=>{const{current:hn}=Vt;return hn.addEventListener("touchstart",Tn,{passive:doesSupportTouchActionNone()}),()=>{hn.removeEventListener("touchstart",Tn,{passive:doesSupportTouchActionNone()}),Cn()}},[Cn,Tn]),reactExports.useEffect(()=>{it&&Cn()},[it,Cn]);const jn=hn=>$n=>{var nn;if((nn=hn.onMouseDown)==null||nn.call(hn,$n),it||$n.defaultPrevented||$n.button!==0)return;$n.preventDefault();const Kt=trackFinger($n,wt);if(Kt!==!1){const{newValue:_n,activeIndex:Mn}=sn({finger:Kt});focusThumb({sliderRef:Vt,activeIndex:Mn,setActive:xt}),Lt(_n),Bt&&!areValuesEqual(_n,Ut)&&Bt($n,_n,Mn)}$t.current=0;const Yt=ownerDocument(Vt.current);Yt.addEventListener("mousemove",Zt),Yt.addEventListener("mouseup",Sn)},Un=valueToPercent(Pt?kt[0]:lt,lt,st),yn=valueToPercent(kt[kt.length-1],lt,st)-Un,un=(hn={})=>{const $n=extractEventHandlers(hn),nn={onMouseDown:jn($n||{})},Kt=_extends$u({},$n,nn);return _extends$u({},hn,{ref:rn},Kt)},En=hn=>$n=>{var nn;(nn=hn.onMouseOver)==null||nn.call(hn,$n);const Kt=Number($n.currentTarget.getAttribute("data-index"));Et(Kt)},In=hn=>$n=>{var nn;(nn=hn.onMouseLeave)==null||nn.call(hn,$n),Et(-1)};return{active:vt,axis:vn,axisProps,dragging:It,focusedThumbIndex:Dt,getHiddenInputProps:(hn={})=>{var $n;const nn=extractEventHandlers(hn),Kt={onChange:tn(nn||{}),onFocus:Xt(nn||{}),onBlur:an(nn||{})},Yt=_extends$u({},nn,Kt);return _extends$u({tabIndex:bt,"aria-labelledby":et,"aria-orientation":dt,"aria-valuemax":mt(st),"aria-valuemin":mt(lt),name:ct,type:"range",min:tt.min,max:tt.max,step:tt.step===null&&tt.marks?"any":($n=tt.step)!=null?$n:void 0,disabled:it},hn,Yt,{style:_extends$u({},visuallyHidden$1,{direction:ot?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:un,getThumbProps:(hn={})=>{const $n=extractEventHandlers(hn),nn={onMouseOver:En($n||{}),onMouseLeave:In($n||{})};return _extends$u({},hn,$n,nn)},marks:At,open:St,range:Pt,rootRef:rn,trackLeap:yn,trackOffset:Un,values:kt,getThumbStyle:hn=>({pointerEvents:vt!==-1&&vt!==hn?"none":void 0})}}const _excluded$Z=["onChange","maxRows","minRows","style","value"];function getStyleValue(tt){return parseInt(tt,10)||0}const styles$5={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function isEmpty$1(tt){return tt==null||Object.keys(tt).length===0||tt.outerHeightStyle===0&&!tt.overflow}const TextareaAutosize=reactExports.forwardRef(function(et,nt){const{onChange:it,maxRows:rt,minRows:ot=1,style:at,value:st}=et,lt=_objectWithoutPropertiesLoose$m(et,_excluded$Z),{current:ct}=reactExports.useRef(st!=null),ut=reactExports.useRef(null),ht=useForkRef(nt,ut),dt=reactExports.useRef(null),pt=reactExports.useRef(0),[mt,gt]=reactExports.useState({outerHeightStyle:0}),bt=reactExports.useCallback(()=>{const xt=ut.current,Et=ownerWindow(xt).getComputedStyle(xt);if(Et.width==="0px")return{outerHeightStyle:0};const It=dt.current;It.style.width=Et.width,It.value=xt.value||et.placeholder||"x",It.value.slice(-1)===` -`&&(It.value+=" ");const Tt=Et.boxSizing,$t=getStyleValue(Et.paddingBottom)+getStyleValue(Et.paddingTop),Ut=getStyleValue(Et.borderBottomWidth)+getStyleValue(Et.borderTopWidth),Lt=It.scrollHeight;It.value="x";const Bt=It.scrollHeight;let Pt=Lt;ot&&(Pt=Math.max(Number(ot)*Bt,Pt)),rt&&(Pt=Math.min(Number(rt)*Bt,Pt)),Pt=Math.max(Pt,Bt);const kt=Pt+(Tt==="border-box"?$t+Ut:0),At=Math.abs(Pt-Lt)<=1;return{outerHeightStyle:kt,overflow:At}},[rt,ot,et.placeholder]),yt=(xt,St)=>{const{outerHeightStyle:Et,overflow:It}=St;return pt.current<20&&(Et>0&&Math.abs((xt.outerHeightStyle||0)-Et)>1||xt.overflow!==It)?(pt.current+=1,{overflow:It,outerHeightStyle:Et}):xt},wt=reactExports.useCallback(()=>{const xt=bt();isEmpty$1(xt)||gt(St=>yt(St,xt))},[bt]);useEnhancedEffect$1(()=>{const xt=()=>{const Lt=bt();isEmpty$1(Lt)||reactDomExports.flushSync(()=>{gt(Bt=>yt(Bt,Lt))})},St=()=>{pt.current=0,xt()};let Et;const It=debounce$4(St),Tt=ut.current,$t=ownerWindow(Tt);$t.addEventListener("resize",It);let Ut;return typeof ResizeObserver<"u"&&(Ut=new ResizeObserver(St),Ut.observe(Tt)),()=>{It.clear(),cancelAnimationFrame(Et),$t.removeEventListener("resize",It),Ut&&Ut.disconnect()}},[bt]),useEnhancedEffect$1(()=>{wt()}),reactExports.useEffect(()=>{pt.current=0},[st]);const vt=xt=>{pt.current=0,ct||wt(),it&&it(xt)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",_extends$u({value:st,onChange:vt,ref:ht,rows:ot,style:_extends$u({height:mt.outerHeightStyle,overflow:mt.overflow?"hidden":void 0},at)},lt)),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:et.className,readOnly:!0,ref:dt,tabIndex:-1,style:_extends$u({},styles$5.shadow,at,{paddingTop:0,paddingBottom:0})})]})}),_excluded$Y=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],PopperRoot=styled$1(Popper$1,{name:"MuiPopper",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),Popper=reactExports.forwardRef(function(et,nt){var it;const rt=useTheme$3(),ot=useThemeProps({props:et,name:"MuiPopper"}),{anchorEl:at,component:st,components:lt,componentsProps:ct,container:ut,disablePortal:ht,keepMounted:dt,modifiers:pt,open:mt,placement:gt,popperOptions:bt,popperRef:yt,transition:wt,slots:vt,slotProps:xt}=ot,St=_objectWithoutPropertiesLoose$m(ot,_excluded$Y),Et=(it=vt==null?void 0:vt.root)!=null?it:lt==null?void 0:lt.Root,It=_extends$u({anchorEl:at,container:ut,disablePortal:ht,keepMounted:dt,modifiers:pt,open:mt,placement:gt,popperOptions:bt,popperRef:yt,transition:wt},St);return jsxRuntimeExports.jsx(PopperRoot,_extends$u({as:st,direction:rt==null?void 0:rt.direction,slots:{root:Et},slotProps:xt??ct},It,{ref:nt}))}),MuiPopper=Popper;function formControlState({props:tt,states:et,muiFormControl:nt}){return et.reduce((it,rt)=>(it[rt]=tt[rt],nt&&typeof tt[rt]>"u"&&(it[rt]=nt[rt]),it),{})}const FormControlContext=reactExports.createContext(void 0),FormControlContext$1=FormControlContext;function useFormControl(){return reactExports.useContext(FormControlContext$1)}function GlobalStyles(tt){return jsxRuntimeExports.jsx(GlobalStyles$1,_extends$u({},tt,{defaultTheme:defaultTheme$1,themeId:THEME_ID}))}function hasValue(tt){return tt!=null&&!(Array.isArray(tt)&&tt.length===0)}function isFilled(tt,et=!1){return tt&&(hasValue(tt.value)&&tt.value!==""||et&&hasValue(tt.defaultValue)&&tt.defaultValue!=="")}function isAdornedStart(tt){return tt.startAdornment}function getInputBaseUtilityClass(tt){return generateUtilityClass("MuiInputBase",tt)}const inputBaseClasses=generateUtilityClasses("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),inputBaseClasses$1=inputBaseClasses,_excluded$X=["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"],rootOverridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.formControl&&et.formControl,nt.startAdornment&&et.adornedStart,nt.endAdornment&&et.adornedEnd,nt.error&&et.error,nt.size==="small"&&et.sizeSmall,nt.multiline&&et.multiline,nt.color&&et[`color${capitalize(nt.color)}`],nt.fullWidth&&et.fullWidth,nt.hiddenLabel&&et.hiddenLabel]},inputOverridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.input,nt.size==="small"&&et.inputSizeSmall,nt.multiline&&et.inputMultiline,nt.type==="search"&&et.inputTypeSearch,nt.startAdornment&&et.inputAdornedStart,nt.endAdornment&&et.inputAdornedEnd,nt.hiddenLabel&&et.inputHiddenLabel]},useUtilityClasses$t=tt=>{const{classes:et,color:nt,disabled:it,error:rt,endAdornment:ot,focused:at,formControl:st,fullWidth:lt,hiddenLabel:ct,multiline:ut,readOnly:ht,size:dt,startAdornment:pt,type:mt}=tt,gt={root:["root",`color${capitalize(nt)}`,it&&"disabled",rt&&"error",lt&&"fullWidth",at&&"focused",st&&"formControl",dt&&dt!=="medium"&&`size${capitalize(dt)}`,ut&&"multiline",pt&&"adornedStart",ot&&"adornedEnd",ct&&"hiddenLabel",ht&&"readOnly"],input:["input",it&&"disabled",mt==="search"&&"inputTypeSearch",ut&&"inputMultiline",dt==="small"&&"inputSizeSmall",ct&&"inputHiddenLabel",pt&&"inputAdornedStart",ot&&"inputAdornedEnd",ht&&"readOnly"]};return composeClasses(gt,getInputBaseUtilityClass,et)},InputBaseRoot=styled$1("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body1,{color:(tt.vars||tt).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled,cursor:"default"}},et.multiline&&_extends$u({padding:"4px 0 5px"},et.size==="small"&&{paddingTop:1}),et.fullWidth&&{width:"100%"})),InputBaseComponent=styled$1("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light",it=_extends$u({color:"currentColor"},tt.vars?{opacity:tt.vars.opacity.inputPlaceholder}:{opacity:nt?.42:.5},{transition:tt.transitions.create("opacity",{duration:tt.transitions.duration.shorter})}),rt={opacity:"0 !important"},ot=tt.vars?{opacity:tt.vars.opacity.inputPlaceholder}:{opacity:nt?.42:.5};return _extends$u({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":it,"&::-moz-placeholder":it,"&:-ms-input-placeholder":it,"&::-ms-input-placeholder":it,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses$1.formControl} &`]:{"&::-webkit-input-placeholder":rt,"&::-moz-placeholder":rt,"&:-ms-input-placeholder":rt,"&::-ms-input-placeholder":rt,"&:focus::-webkit-input-placeholder":ot,"&:focus::-moz-placeholder":ot,"&:focus:-ms-input-placeholder":ot,"&:focus::-ms-input-placeholder":ot},[`&.${inputBaseClasses$1.disabled}`]:{opacity:1,WebkitTextFillColor:(tt.vars||tt).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},et.size==="small"&&{paddingTop:1},et.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},et.type==="search"&&{MozAppearance:"textfield"})}),inputGlobalStyles=jsxRuntimeExports.jsx(GlobalStyles,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),InputBase=reactExports.forwardRef(function(et,nt){var it;const rt=useThemeProps({props:et,name:"MuiInputBase"}),{"aria-describedby":ot,autoComplete:at,autoFocus:st,className:lt,components:ct={},componentsProps:ut={},defaultValue:ht,disabled:dt,disableInjectingGlobalStyles:pt,endAdornment:mt,fullWidth:gt=!1,id:bt,inputComponent:yt="input",inputProps:wt={},inputRef:vt,maxRows:xt,minRows:St,multiline:Et=!1,name:It,onBlur:Tt,onChange:$t,onClick:Ut,onFocus:Lt,onKeyDown:Bt,onKeyUp:Pt,placeholder:kt,readOnly:At,renderSuffix:Rt,rows:Wt,slotProps:jt={},slots:Ot={},startAdornment:Ct,type:Dt="text",value:Mt}=rt,Vt=_objectWithoutPropertiesLoose$m(rt,_excluded$X),Qt=wt.value!=null?wt.value:Mt,{current:rn}=reactExports.useRef(Qt!=null),Xt=reactExports.useRef(),an=reactExports.useCallback(Kt=>{},[]),tn=useForkRef(Xt,vt,wt.ref,an),[pn,vn]=reactExports.useState(!1),sn=useFormControl(),Zt=formControlState({props:rt,muiFormControl:sn,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Zt.focused=sn?sn.focused:pn,reactExports.useEffect(()=>{!sn&&dt&&pn&&(vn(!1),Tt&&Tt())},[sn,dt,pn,Tt]);const Sn=sn&&sn.onFilled,Tn=sn&&sn.onEmpty,Cn=reactExports.useCallback(Kt=>{isFilled(Kt)?Sn&&Sn():Tn&&Tn()},[Sn,Tn]);useEnhancedEffect$1(()=>{rn&&Cn({value:Qt})},[Qt,Cn,rn]);const jn=Kt=>{if(Zt.disabled){Kt.stopPropagation();return}Lt&&Lt(Kt),wt.onFocus&&wt.onFocus(Kt),sn&&sn.onFocus?sn.onFocus(Kt):vn(!0)},Un=Kt=>{Tt&&Tt(Kt),wt.onBlur&&wt.onBlur(Kt),sn&&sn.onBlur?sn.onBlur(Kt):vn(!1)},yn=(Kt,...Yt)=>{if(!rn){const _n=Kt.target||Xt.current;if(_n==null)throw new Error(formatMuiErrorMessage(1));Cn({value:_n.value})}wt.onChange&&wt.onChange(Kt,...Yt),$t&&$t(Kt,...Yt)};reactExports.useEffect(()=>{Cn(Xt.current)},[]);const un=Kt=>{Xt.current&&Kt.currentTarget===Kt.target&&Xt.current.focus(),Ut&&Ut(Kt)};let En=yt,In=wt;Et&&En==="input"&&(Wt?In=_extends$u({type:void 0,minRows:Wt,maxRows:Wt},In):In=_extends$u({type:void 0,maxRows:xt,minRows:St},In),En=TextareaAutosize);const xn=Kt=>{Cn(Kt.animationName==="mui-auto-fill-cancel"?Xt.current:{value:"x"})};reactExports.useEffect(()=>{sn&&sn.setAdornedStart(!!Ct)},[sn,Ct]);const dn=_extends$u({},rt,{color:Zt.color||"primary",disabled:Zt.disabled,endAdornment:mt,error:Zt.error,focused:Zt.focused,formControl:sn,fullWidth:gt,hiddenLabel:Zt.hiddenLabel,multiline:Et,size:Zt.size,startAdornment:Ct,type:Dt}),cn=useUtilityClasses$t(dn),hn=Ot.root||ct.Root||InputBaseRoot,$n=jt.root||ut.root||{},nn=Ot.input||ct.Input||InputBaseComponent;return In=_extends$u({},In,(it=jt.input)!=null?it:ut.input),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!pt&&inputGlobalStyles,jsxRuntimeExports.jsxs(hn,_extends$u({},$n,!isHostComponent(hn)&&{ownerState:_extends$u({},dn,$n.ownerState)},{ref:nt,onClick:un},Vt,{className:clsx$3(cn.root,$n.className,lt,At&&"MuiInputBase-readOnly"),children:[Ct,jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:null,children:jsxRuntimeExports.jsx(nn,_extends$u({ownerState:dn,"aria-invalid":Zt.error,"aria-describedby":ot,autoComplete:at,autoFocus:st,defaultValue:ht,disabled:Zt.disabled,id:bt,onAnimationStart:xn,name:It,placeholder:kt,readOnly:At,required:Zt.required,rows:Wt,value:Qt,onKeyDown:Bt,onKeyUp:Pt,type:Dt},In,!isHostComponent(nn)&&{as:En,ownerState:_extends$u({},dn,In.ownerState)},{ref:tn,className:clsx$3(cn.input,In.className,At&&"MuiInputBase-readOnly"),onBlur:Un,onChange:yn,onFocus:jn}))}),mt,Rt?Rt(_extends$u({},Zt,{startAdornment:Ct})):null]}))]})}),InputBase$1=InputBase;function getInputUtilityClass(tt){return generateUtilityClass("MuiInput",tt)}const inputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiInput",["root","underline","input"])),inputClasses$1=inputClasses;function getOutlinedInputUtilityClass(tt){return generateUtilityClass("MuiOutlinedInput",tt)}const outlinedInputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiOutlinedInput",["root","notchedOutline","input"])),outlinedInputClasses$1=outlinedInputClasses;function getFilledInputUtilityClass(tt){return generateUtilityClass("MuiFilledInput",tt)}const filledInputClasses=_extends$u({},inputBaseClasses$1,generateUtilityClasses("MuiFilledInput",["root","underline","input"])),filledInputClasses$1=filledInputClasses,ArrowDropDownIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),_excluded$W=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],styles$4={entering:{opacity:1},entered:{opacity:1}},Fade=reactExports.forwardRef(function(et,nt){const it=useTheme(),rt={enter:it.transitions.duration.enteringScreen,exit:it.transitions.duration.leavingScreen},{addEndListener:ot,appear:at=!0,children:st,easing:lt,in:ct,onEnter:ut,onEntered:ht,onEntering:dt,onExit:pt,onExited:mt,onExiting:gt,style:bt,timeout:yt=rt,TransitionComponent:wt=Transition$2}=et,vt=_objectWithoutPropertiesLoose$m(et,_excluded$W),xt=reactExports.useRef(null),St=useForkRef(xt,st.ref,nt),Et=kt=>At=>{if(kt){const Rt=xt.current;At===void 0?kt(Rt):kt(Rt,At)}},It=Et(dt),Tt=Et((kt,At)=>{reflow(kt);const Rt=getTransitionProps({style:bt,timeout:yt,easing:lt},{mode:"enter"});kt.style.webkitTransition=it.transitions.create("opacity",Rt),kt.style.transition=it.transitions.create("opacity",Rt),ut&&ut(kt,At)}),$t=Et(ht),Ut=Et(gt),Lt=Et(kt=>{const At=getTransitionProps({style:bt,timeout:yt,easing:lt},{mode:"exit"});kt.style.webkitTransition=it.transitions.create("opacity",At),kt.style.transition=it.transitions.create("opacity",At),pt&&pt(kt)}),Bt=Et(mt),Pt=kt=>{ot&&ot(xt.current,kt)};return jsxRuntimeExports.jsx(wt,_extends$u({appear:at,in:ct,nodeRef:xt,onEnter:Tt,onEntered:$t,onEntering:It,onExit:Lt,onExited:Bt,onExiting:Ut,addEndListener:Pt,timeout:yt},vt,{children:(kt,At)=>reactExports.cloneElement(st,_extends$u({style:_extends$u({opacity:0,visibility:kt==="exited"&&!ct?"hidden":void 0},styles$4[kt],bt,st.props.style),ref:St},At))}))}),Fade$1=Fade;function getBackdropUtilityClass(tt){return generateUtilityClass("MuiBackdrop",tt)}generateUtilityClasses("MuiBackdrop",["root","invisible"]);const _excluded$V=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],useUtilityClasses$s=tt=>{const{classes:et,invisible:nt}=tt;return composeClasses({root:["root",nt&&"invisible"]},getBackdropUtilityClass,et)},BackdropRoot=styled$1("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.invisible&&et.invisible]}})(({ownerState:tt})=>_extends$u({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},tt.invisible&&{backgroundColor:"transparent"})),Backdrop=reactExports.forwardRef(function(et,nt){var it,rt,ot;const at=useThemeProps({props:et,name:"MuiBackdrop"}),{children:st,className:lt,component:ct="div",components:ut={},componentsProps:ht={},invisible:dt=!1,open:pt,slotProps:mt={},slots:gt={},TransitionComponent:bt=Fade$1,transitionDuration:yt}=at,wt=_objectWithoutPropertiesLoose$m(at,_excluded$V),vt=_extends$u({},at,{component:ct,invisible:dt}),xt=useUtilityClasses$s(vt),St=(it=mt.root)!=null?it:ht.root;return jsxRuntimeExports.jsx(bt,_extends$u({in:pt,timeout:yt},wt,{children:jsxRuntimeExports.jsx(BackdropRoot,_extends$u({"aria-hidden":!0},St,{as:(rt=(ot=gt.root)!=null?ot:ut.Root)!=null?rt:ct,className:clsx$3(xt.root,lt,St==null?void 0:St.className),ownerState:_extends$u({},vt,St==null?void 0:St.ownerState),classes:xt,ref:nt,children:st}))}))}),Backdrop$1=Backdrop;function getButtonUtilityClass(tt){return generateUtilityClass("MuiButton",tt)}const buttonClasses=generateUtilityClasses("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),buttonClasses$1=buttonClasses,ButtonGroupContext=reactExports.createContext({}),ButtonGroupContext$1=ButtonGroupContext,ButtonGroupButtonContext=reactExports.createContext(void 0),ButtonGroupButtonContext$1=ButtonGroupButtonContext,_excluded$U=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],useUtilityClasses$r=tt=>{const{color:et,disableElevation:nt,fullWidth:it,size:rt,variant:ot,classes:at}=tt,st={root:["root",ot,`${ot}${capitalize(et)}`,`size${capitalize(rt)}`,`${ot}Size${capitalize(rt)}`,et==="inherit"&&"colorInherit",nt&&"disableElevation",it&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${capitalize(rt)}`],endIcon:["endIcon",`iconSize${capitalize(rt)}`]},lt=composeClasses(st,getButtonUtilityClass,at);return _extends$u({},at,lt)},commonIconStyles=tt=>_extends$u({},tt.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},tt.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},tt.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),ButtonRoot=styled$1(ButtonBase$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],et[`${nt.variant}${capitalize(nt.color)}`],et[`size${capitalize(nt.size)}`],et[`${nt.variant}Size${capitalize(nt.size)}`],nt.color==="inherit"&&et.colorInherit,nt.disableElevation&&et.disableElevation,nt.fullWidth&&et.fullWidth]}})(({theme:tt,ownerState:et})=>{var nt,it;const rt=tt.palette.mode==="light"?tt.palette.grey[300]:tt.palette.grey[800],ot=tt.palette.mode==="light"?tt.palette.grey.A100:tt.palette.grey[700];return _extends$u({},tt.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(tt.vars||tt).shape.borderRadius,transition:tt.transitions.create(["background-color","box-shadow","border-color","color"],{duration:tt.transitions.duration.short}),"&:hover":_extends$u({textDecoration:"none",backgroundColor:tt.vars?`rgba(${tt.vars.palette.text.primaryChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.text.primary,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="text"&&et.color!=="inherit"&&{backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="outlined"&&et.color!=="inherit"&&{border:`1px solid ${(tt.vars||tt).palette[et.color].main}`,backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="contained"&&{backgroundColor:tt.vars?tt.vars.palette.Button.inheritContainedHoverBg:ot,boxShadow:(tt.vars||tt).shadows[4],"@media (hover: none)":{boxShadow:(tt.vars||tt).shadows[2],backgroundColor:(tt.vars||tt).palette.grey[300]}},et.variant==="contained"&&et.color!=="inherit"&&{backgroundColor:(tt.vars||tt).palette[et.color].dark,"@media (hover: none)":{backgroundColor:(tt.vars||tt).palette[et.color].main}}),"&:active":_extends$u({},et.variant==="contained"&&{boxShadow:(tt.vars||tt).shadows[8]}),[`&.${buttonClasses$1.focusVisible}`]:_extends$u({},et.variant==="contained"&&{boxShadow:(tt.vars||tt).shadows[6]}),[`&.${buttonClasses$1.disabled}`]:_extends$u({color:(tt.vars||tt).palette.action.disabled},et.variant==="outlined"&&{border:`1px solid ${(tt.vars||tt).palette.action.disabledBackground}`},et.variant==="contained"&&{color:(tt.vars||tt).palette.action.disabled,boxShadow:(tt.vars||tt).shadows[0],backgroundColor:(tt.vars||tt).palette.action.disabledBackground})},et.variant==="text"&&{padding:"6px 8px"},et.variant==="text"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].main},et.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},et.variant==="outlined"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].main,border:tt.vars?`1px solid rgba(${tt.vars.palette[et.color].mainChannel} / 0.5)`:`1px solid ${alpha$1(tt.palette[et.color].main,.5)}`},et.variant==="contained"&&{color:tt.vars?tt.vars.palette.text.primary:(nt=(it=tt.palette).getContrastText)==null?void 0:nt.call(it,tt.palette.grey[300]),backgroundColor:tt.vars?tt.vars.palette.Button.inheritContainedBg:rt,boxShadow:(tt.vars||tt).shadows[2]},et.variant==="contained"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].contrastText,backgroundColor:(tt.vars||tt).palette[et.color].main},et.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},et.size==="small"&&et.variant==="text"&&{padding:"4px 5px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="text"&&{padding:"8px 11px",fontSize:tt.typography.pxToRem(15)},et.size==="small"&&et.variant==="outlined"&&{padding:"3px 9px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="outlined"&&{padding:"7px 21px",fontSize:tt.typography.pxToRem(15)},et.size==="small"&&et.variant==="contained"&&{padding:"4px 10px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="contained"&&{padding:"8px 22px",fontSize:tt.typography.pxToRem(15)},et.fullWidth&&{width:"100%"})},({ownerState:tt})=>tt.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${buttonClasses$1.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${buttonClasses$1.disabled}`]:{boxShadow:"none"}}),ButtonStartIcon=styled$1("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.startIcon,et[`iconSize${capitalize(nt.size)}`]]}})(({ownerState:tt})=>_extends$u({display:"inherit",marginRight:8,marginLeft:-4},tt.size==="small"&&{marginLeft:-2},commonIconStyles(tt))),ButtonEndIcon=styled$1("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.endIcon,et[`iconSize${capitalize(nt.size)}`]]}})(({ownerState:tt})=>_extends$u({display:"inherit",marginRight:-4,marginLeft:8},tt.size==="small"&&{marginRight:-2},commonIconStyles(tt))),Button$1=reactExports.forwardRef(function(et,nt){const it=reactExports.useContext(ButtonGroupContext$1),rt=reactExports.useContext(ButtonGroupButtonContext$1),ot=resolveProps(it,et),at=useThemeProps({props:ot,name:"MuiButton"}),{children:st,color:lt="primary",component:ct="button",className:ut,disabled:ht=!1,disableElevation:dt=!1,disableFocusRipple:pt=!1,endIcon:mt,focusVisibleClassName:gt,fullWidth:bt=!1,size:yt="medium",startIcon:wt,type:vt,variant:xt="text"}=at,St=_objectWithoutPropertiesLoose$m(at,_excluded$U),Et=_extends$u({},at,{color:lt,component:ct,disabled:ht,disableElevation:dt,disableFocusRipple:pt,fullWidth:bt,size:yt,type:vt,variant:xt}),It=useUtilityClasses$r(Et),Tt=wt&&jsxRuntimeExports.jsx(ButtonStartIcon,{className:It.startIcon,ownerState:Et,children:wt}),$t=mt&&jsxRuntimeExports.jsx(ButtonEndIcon,{className:It.endIcon,ownerState:Et,children:mt}),Ut=rt||"";return jsxRuntimeExports.jsxs(ButtonRoot,_extends$u({ownerState:Et,className:clsx$3(it.className,It.root,ut,Ut),component:ct,disabled:ht,focusRipple:!pt,focusVisibleClassName:clsx$3(It.focusVisible,gt),ref:nt,type:vt},St,{classes:It,children:[Tt,st,$t]}))}),Button$2=Button$1;function getModalUtilityClass(tt){return generateUtilityClass("MuiModal",tt)}generateUtilityClasses("MuiModal",["root","hidden","backdrop"]);const _excluded$T=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],useUtilityClasses$q=tt=>{const{open:et,exited:nt,classes:it}=tt;return composeClasses({root:["root",!et&&nt&&"hidden"],backdrop:["backdrop"]},getModalUtilityClass,it)},ModalRoot=styled$1("div",{name:"MuiModal",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.open&&nt.exited&&et.hidden]}})(({theme:tt,ownerState:et})=>_extends$u({position:"fixed",zIndex:(tt.vars||tt).zIndex.modal,right:0,bottom:0,top:0,left:0},!et.open&&et.exited&&{visibility:"hidden"})),ModalBackdrop=styled$1(Backdrop$1,{name:"MuiModal",slot:"Backdrop",overridesResolver:(tt,et)=>et.backdrop})({zIndex:-1}),Modal=reactExports.forwardRef(function(et,nt){var it,rt,ot,at,st,lt;const ct=useThemeProps({name:"MuiModal",props:et}),{BackdropComponent:ut=ModalBackdrop,BackdropProps:ht,className:dt,closeAfterTransition:pt=!1,children:mt,container:gt,component:bt,components:yt={},componentsProps:wt={},disableAutoFocus:vt=!1,disableEnforceFocus:xt=!1,disableEscapeKeyDown:St=!1,disablePortal:Et=!1,disableRestoreFocus:It=!1,disableScrollLock:Tt=!1,hideBackdrop:$t=!1,keepMounted:Ut=!1,onBackdropClick:Lt,open:Bt,slotProps:Pt,slots:kt}=ct,At=_objectWithoutPropertiesLoose$m(ct,_excluded$T),Rt=_extends$u({},ct,{closeAfterTransition:pt,disableAutoFocus:vt,disableEnforceFocus:xt,disableEscapeKeyDown:St,disablePortal:Et,disableRestoreFocus:It,disableScrollLock:Tt,hideBackdrop:$t,keepMounted:Ut}),{getRootProps:Wt,getBackdropProps:jt,getTransitionProps:Ot,portalRef:Ct,isTopModal:Dt,exited:Mt,hasTransition:Vt}=useModal$1(_extends$u({},Rt,{rootRef:nt})),Qt=_extends$u({},Rt,{exited:Mt}),rn=useUtilityClasses$q(Qt),Xt={};if(mt.props.tabIndex===void 0&&(Xt.tabIndex="-1"),Vt){const{onEnter:Sn,onExited:Tn}=Ot();Xt.onEnter=Sn,Xt.onExited=Tn}const an=(it=(rt=kt==null?void 0:kt.root)!=null?rt:yt.Root)!=null?it:ModalRoot,tn=(ot=(at=kt==null?void 0:kt.backdrop)!=null?at:yt.Backdrop)!=null?ot:ut,pn=(st=Pt==null?void 0:Pt.root)!=null?st:wt.root,vn=(lt=Pt==null?void 0:Pt.backdrop)!=null?lt:wt.backdrop,sn=useSlotProps({elementType:an,externalSlotProps:pn,externalForwardedProps:At,getSlotProps:Wt,additionalProps:{ref:nt,as:bt},ownerState:Qt,className:clsx$3(dt,pn==null?void 0:pn.className,rn==null?void 0:rn.root,!Qt.open&&Qt.exited&&(rn==null?void 0:rn.hidden))}),Zt=useSlotProps({elementType:tn,externalSlotProps:vn,additionalProps:ht,getSlotProps:Sn=>jt(_extends$u({},Sn,{onClick:Tn=>{Lt&&Lt(Tn),Sn!=null&&Sn.onClick&&Sn.onClick(Tn)}})),className:clsx$3(vn==null?void 0:vn.className,ht==null?void 0:ht.className,rn==null?void 0:rn.backdrop),ownerState:Qt});return!Ut&&!Bt&&(!Vt||Mt)?null:jsxRuntimeExports.jsx(Portal,{ref:Ct,container:gt,disablePortal:Et,children:jsxRuntimeExports.jsxs(an,_extends$u({},sn,{children:[!$t&&ut?jsxRuntimeExports.jsx(tn,_extends$u({},Zt)):null,jsxRuntimeExports.jsx(FocusTrap,{disableEnforceFocus:xt,disableAutoFocus:vt,disableRestoreFocus:It,isEnabled:Dt,open:Bt,children:reactExports.cloneElement(mt,Xt)})]}))})}),Modal$1=Modal;function getDividerUtilityClass(tt){return generateUtilityClass("MuiDivider",tt)}const dividerClasses=generateUtilityClasses("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),_excluded$S=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],useUtilityClasses$p=tt=>{const{absolute:et,children:nt,classes:it,flexItem:rt,light:ot,orientation:at,textAlign:st,variant:lt}=tt;return composeClasses({root:["root",et&&"absolute",lt,ot&&"light",at==="vertical"&&"vertical",rt&&"flexItem",nt&&"withChildren",nt&&at==="vertical"&&"withChildrenVertical",st==="right"&&at!=="vertical"&&"textAlignRight",st==="left"&&at!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",at==="vertical"&&"wrapperVertical"]},getDividerUtilityClass,it)},DividerRoot=styled$1("div",{name:"MuiDivider",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.absolute&&et.absolute,et[nt.variant],nt.light&&et.light,nt.orientation==="vertical"&&et.vertical,nt.flexItem&&et.flexItem,nt.children&&et.withChildren,nt.children&&nt.orientation==="vertical"&&et.withChildrenVertical,nt.textAlign==="right"&&nt.orientation!=="vertical"&&et.textAlignRight,nt.textAlign==="left"&&nt.orientation!=="vertical"&&et.textAlignLeft]}})(({theme:tt,ownerState:et})=>_extends$u({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(tt.vars||tt).palette.divider,borderBottomWidth:"thin"},et.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},et.light&&{borderColor:tt.vars?`rgba(${tt.vars.palette.dividerChannel} / 0.08)`:alpha$1(tt.palette.divider,.08)},et.variant==="inset"&&{marginLeft:72},et.variant==="middle"&&et.orientation==="horizontal"&&{marginLeft:tt.spacing(2),marginRight:tt.spacing(2)},et.variant==="middle"&&et.orientation==="vertical"&&{marginTop:tt.spacing(1),marginBottom:tt.spacing(1)},et.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},et.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:tt})=>_extends$u({},tt.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:tt,ownerState:et})=>_extends$u({},et.children&&et.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(tt.vars||tt).palette.divider}`}}),({theme:tt,ownerState:et})=>_extends$u({},et.children&&et.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(tt.vars||tt).palette.divider}`}}),({ownerState:tt})=>_extends$u({},tt.textAlign==="right"&&tt.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},tt.textAlign==="left"&&tt.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),DividerWrapper=styled$1("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.wrapper,nt.orientation==="vertical"&&et.wrapperVertical]}})(({theme:tt,ownerState:et})=>_extends$u({display:"inline-block",paddingLeft:`calc(${tt.spacing(1)} * 1.2)`,paddingRight:`calc(${tt.spacing(1)} * 1.2)`},et.orientation==="vertical"&&{paddingTop:`calc(${tt.spacing(1)} * 1.2)`,paddingBottom:`calc(${tt.spacing(1)} * 1.2)`})),Divider$2=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiDivider"}),{absolute:rt=!1,children:ot,className:at,component:st=ot?"div":"hr",flexItem:lt=!1,light:ct=!1,orientation:ut="horizontal",role:ht=st!=="hr"?"separator":void 0,textAlign:dt="center",variant:pt="fullWidth"}=it,mt=_objectWithoutPropertiesLoose$m(it,_excluded$S),gt=_extends$u({},it,{absolute:rt,component:st,flexItem:lt,light:ct,orientation:ut,role:ht,textAlign:dt,variant:pt}),bt=useUtilityClasses$p(gt);return jsxRuntimeExports.jsx(DividerRoot,_extends$u({as:st,className:clsx$3(bt.root,at),role:ht,ref:nt,ownerState:gt},mt,{children:ot?jsxRuntimeExports.jsx(DividerWrapper,{className:bt.wrapper,ownerState:gt,children:ot}):null}))});Divider$2.muiSkipListHighlight=!0;const Divider$3=Divider$2,_excluded$R=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getTranslateValue(tt,et,nt){const it=et.getBoundingClientRect(),rt=nt&&nt.getBoundingClientRect(),ot=ownerWindow(et);let at;if(et.fakeTransform)at=et.fakeTransform;else{const ct=ot.getComputedStyle(et);at=ct.getPropertyValue("-webkit-transform")||ct.getPropertyValue("transform")}let st=0,lt=0;if(at&&at!=="none"&&typeof at=="string"){const ct=at.split("(")[1].split(")")[0].split(",");st=parseInt(ct[4],10),lt=parseInt(ct[5],10)}return tt==="left"?rt?`translateX(${rt.right+st-it.left}px)`:`translateX(${ot.innerWidth+st-it.left}px)`:tt==="right"?rt?`translateX(-${it.right-rt.left-st}px)`:`translateX(-${it.left+it.width-st}px)`:tt==="up"?rt?`translateY(${rt.bottom+lt-it.top}px)`:`translateY(${ot.innerHeight+lt-it.top}px)`:rt?`translateY(-${it.top-rt.top+it.height-lt}px)`:`translateY(-${it.top+it.height-lt}px)`}function resolveContainer(tt){return typeof tt=="function"?tt():tt}function setTranslateValue(tt,et,nt){const it=resolveContainer(nt),rt=getTranslateValue(tt,et,it);rt&&(et.style.webkitTransform=rt,et.style.transform=rt)}const Slide=reactExports.forwardRef(function(et,nt){const it=useTheme(),rt={enter:it.transitions.easing.easeOut,exit:it.transitions.easing.sharp},ot={enter:it.transitions.duration.enteringScreen,exit:it.transitions.duration.leavingScreen},{addEndListener:at,appear:st=!0,children:lt,container:ct,direction:ut="down",easing:ht=rt,in:dt,onEnter:pt,onEntered:mt,onEntering:gt,onExit:bt,onExited:yt,onExiting:wt,style:vt,timeout:xt=ot,TransitionComponent:St=Transition$2}=et,Et=_objectWithoutPropertiesLoose$m(et,_excluded$R),It=reactExports.useRef(null),Tt=useForkRef(lt.ref,It,nt),$t=jt=>Ot=>{jt&&(Ot===void 0?jt(It.current):jt(It.current,Ot))},Ut=$t((jt,Ot)=>{setTranslateValue(ut,jt,ct),reflow(jt),pt&&pt(jt,Ot)}),Lt=$t((jt,Ot)=>{const Ct=getTransitionProps({timeout:xt,style:vt,easing:ht},{mode:"enter"});jt.style.webkitTransition=it.transitions.create("-webkit-transform",_extends$u({},Ct)),jt.style.transition=it.transitions.create("transform",_extends$u({},Ct)),jt.style.webkitTransform="none",jt.style.transform="none",gt&>(jt,Ot)}),Bt=$t(mt),Pt=$t(wt),kt=$t(jt=>{const Ot=getTransitionProps({timeout:xt,style:vt,easing:ht},{mode:"exit"});jt.style.webkitTransition=it.transitions.create("-webkit-transform",Ot),jt.style.transition=it.transitions.create("transform",Ot),setTranslateValue(ut,jt,ct),bt&&bt(jt)}),At=$t(jt=>{jt.style.webkitTransition="",jt.style.transition="",yt&&yt(jt)}),Rt=jt=>{at&&at(It.current,jt)},Wt=reactExports.useCallback(()=>{It.current&&setTranslateValue(ut,It.current,ct)},[ut,ct]);return reactExports.useEffect(()=>{if(dt||ut==="down"||ut==="right")return;const jt=debounce$4(()=>{It.current&&setTranslateValue(ut,It.current,ct)}),Ot=ownerWindow(It.current);return Ot.addEventListener("resize",jt),()=>{jt.clear(),Ot.removeEventListener("resize",jt)}},[ut,dt,ct]),reactExports.useEffect(()=>{dt||Wt()},[dt,Wt]),jsxRuntimeExports.jsx(St,_extends$u({nodeRef:It,onEnter:Ut,onEntered:Bt,onEntering:Lt,onExit:kt,onExited:At,onExiting:Pt,addEndListener:Rt,appear:st,in:dt,timeout:xt},Et,{children:(jt,Ot)=>reactExports.cloneElement(lt,_extends$u({ref:Tt,style:_extends$u({visibility:jt==="exited"&&!dt?"hidden":void 0},vt,lt.props.style)},Ot))}))}),Slide$1=Slide,_excluded$Q=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$o=tt=>{const{classes:et,disableUnderline:nt}=tt,rt=composeClasses({root:["root",!nt&&"underline"],input:["input"]},getFilledInputUtilityClass,et);return _extends$u({},et,rt)},FilledInputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[...rootOverridesResolver(tt,et),!nt.disableUnderline&&et.underline]}})(({theme:tt,ownerState:et})=>{var nt;const it=tt.palette.mode==="light",rt=it?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",ot=it?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",at=it?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",st=it?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return _extends$u({position:"relative",backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot,borderTopLeftRadius:(tt.vars||tt).shape.borderRadius,borderTopRightRadius:(tt.vars||tt).shape.borderRadius,transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),"&:hover":{backgroundColor:tt.vars?tt.vars.palette.FilledInput.hoverBg:at,"@media (hover: none)":{backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot}},[`&.${filledInputClasses$1.focused}`]:{backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot},[`&.${filledInputClasses$1.disabled}`]:{backgroundColor:tt.vars?tt.vars.palette.FilledInput.disabledBg:st}},!et.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(nt=(tt.vars||tt).palette[et.color||"primary"])==null?void 0:nt.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:tt.transitions.create("transform",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses$1.error}`]:{"&:before, &:after":{borderBottomColor:(tt.vars||tt).palette.error.main}},"&:before":{borderBottom:`1px solid ${tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / ${tt.vars.opacity.inputUnderline})`:rt}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:tt.transitions.create("border-bottom-color",{duration:tt.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses$1.disabled}, .${filledInputClasses$1.error}):before`]:{borderBottom:`1px solid ${(tt.vars||tt).palette.text.primary}`},[`&.${filledInputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}},et.startAdornment&&{paddingLeft:12},et.endAdornment&&{paddingRight:12},et.multiline&&_extends$u({padding:"25px 12px 8px"},et.size==="small"&&{paddingTop:21,paddingBottom:4},et.hiddenLabel&&{paddingTop:16,paddingBottom:17},et.hiddenLabel&&et.size==="small"&&{paddingTop:8,paddingBottom:9}))}),FilledInputInput=styled$1(InputBaseComponent,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!tt.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:tt.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:tt.palette.mode==="light"?null:"#fff",caretColor:tt.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},tt.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[tt.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},et.size==="small"&&{paddingTop:21,paddingBottom:4},et.hiddenLabel&&{paddingTop:16,paddingBottom:17},et.startAdornment&&{paddingLeft:0},et.endAdornment&&{paddingRight:0},et.hiddenLabel&&et.size==="small"&&{paddingTop:8,paddingBottom:9},et.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),FilledInput=reactExports.forwardRef(function(et,nt){var it,rt,ot,at;const st=useThemeProps({props:et,name:"MuiFilledInput"}),{components:lt={},componentsProps:ct,fullWidth:ut=!1,inputComponent:ht="input",multiline:dt=!1,slotProps:pt,slots:mt={},type:gt="text"}=st,bt=_objectWithoutPropertiesLoose$m(st,_excluded$Q),yt=_extends$u({},st,{fullWidth:ut,inputComponent:ht,multiline:dt,type:gt}),wt=useUtilityClasses$o(st),vt={root:{ownerState:yt},input:{ownerState:yt}},xt=pt??ct?deepmerge$1(vt,pt??ct):vt,St=(it=(rt=mt.root)!=null?rt:lt.Root)!=null?it:FilledInputRoot,Et=(ot=(at=mt.input)!=null?at:lt.Input)!=null?ot:FilledInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:St,input:Et},componentsProps:xt,fullWidth:ut,inputComponent:ht,multiline:dt,ref:nt,type:gt},bt,{classes:wt}))});FilledInput.muiName="Input";const FilledInput$1=FilledInput;function getFormControlUtilityClasses(tt){return generateUtilityClass("MuiFormControl",tt)}generateUtilityClasses("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _excluded$P=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],useUtilityClasses$n=tt=>{const{classes:et,margin:nt,fullWidth:it}=tt,rt={root:["root",nt!=="none"&&`margin${capitalize(nt)}`,it&&"fullWidth"]};return composeClasses(rt,getFormControlUtilityClasses,et)},FormControlRoot=styled$1("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:tt},et)=>_extends$u({},et.root,et[`margin${capitalize(tt.margin)}`],tt.fullWidth&&et.fullWidth)})(({ownerState:tt})=>_extends$u({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},tt.margin==="normal"&&{marginTop:16,marginBottom:8},tt.margin==="dense"&&{marginTop:8,marginBottom:4},tt.fullWidth&&{width:"100%"})),FormControl=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiFormControl"}),{children:rt,className:ot,color:at="primary",component:st="div",disabled:lt=!1,error:ct=!1,focused:ut,fullWidth:ht=!1,hiddenLabel:dt=!1,margin:pt="none",required:mt=!1,size:gt="medium",variant:bt="outlined"}=it,yt=_objectWithoutPropertiesLoose$m(it,_excluded$P),wt=_extends$u({},it,{color:at,component:st,disabled:lt,error:ct,fullWidth:ht,hiddenLabel:dt,margin:pt,required:mt,size:gt,variant:bt}),vt=useUtilityClasses$n(wt),[xt,St]=reactExports.useState(()=>{let Pt=!1;return rt&&reactExports.Children.forEach(rt,kt=>{if(!isMuiElement(kt,["Input","Select"]))return;const At=isMuiElement(kt,["Select"])?kt.props.input:kt;At&&isAdornedStart(At.props)&&(Pt=!0)}),Pt}),[Et,It]=reactExports.useState(()=>{let Pt=!1;return rt&&reactExports.Children.forEach(rt,kt=>{isMuiElement(kt,["Input","Select"])&&(isFilled(kt.props,!0)||isFilled(kt.props.inputProps,!0))&&(Pt=!0)}),Pt}),[Tt,$t]=reactExports.useState(!1);lt&&Tt&&$t(!1);const Ut=ut!==void 0&&!lt?ut:Tt;let Lt;const Bt=reactExports.useMemo(()=>({adornedStart:xt,setAdornedStart:St,color:at,disabled:lt,error:ct,filled:Et,focused:Ut,fullWidth:ht,hiddenLabel:dt,size:gt,onBlur:()=>{$t(!1)},onEmpty:()=>{It(!1)},onFilled:()=>{It(!0)},onFocus:()=>{$t(!0)},registerEffect:Lt,required:mt,variant:bt}),[xt,at,lt,ct,Et,Ut,ht,dt,Lt,mt,gt,bt]);return jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:Bt,children:jsxRuntimeExports.jsx(FormControlRoot,_extends$u({as:st,ownerState:wt,className:clsx$3(vt.root,ot),ref:nt},yt,{children:rt}))})}),FormControl$1=FormControl,Stack$2=createStack({createStyledComponent:styled$1("div",{name:"MuiStack",slot:"Root",overridesResolver:(tt,et)=>et.root}),useThemeProps:tt=>useThemeProps({props:tt,name:"MuiStack"})}),Stack$3=Stack$2;function getFormLabelUtilityClasses(tt){return generateUtilityClass("MuiFormLabel",tt)}const formLabelClasses=generateUtilityClasses("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),formLabelClasses$1=formLabelClasses,_excluded$O=["children","className","color","component","disabled","error","filled","focused","required"],useUtilityClasses$m=tt=>{const{classes:et,color:nt,focused:it,disabled:rt,error:ot,filled:at,required:st}=tt,lt={root:["root",`color${capitalize(nt)}`,rt&&"disabled",ot&&"error",at&&"filled",it&&"focused",st&&"required"],asterisk:["asterisk",ot&&"error"]};return composeClasses(lt,getFormLabelUtilityClasses,et)},FormLabelRoot=styled$1("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:tt},et)=>_extends$u({},et.root,tt.color==="secondary"&&et.colorSecondary,tt.filled&&et.filled)})(({theme:tt,ownerState:et})=>_extends$u({color:(tt.vars||tt).palette.text.secondary},tt.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${formLabelClasses$1.focused}`]:{color:(tt.vars||tt).palette[et.color].main},[`&.${formLabelClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled},[`&.${formLabelClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}})),AsteriskComponent=styled$1("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(tt,et)=>et.asterisk})(({theme:tt})=>({[`&.${formLabelClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}})),FormLabel=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiFormLabel"}),{children:rt,className:ot,component:at="label"}=it,st=_objectWithoutPropertiesLoose$m(it,_excluded$O),lt=useFormControl(),ct=formControlState({props:it,muiFormControl:lt,states:["color","required","focused","disabled","error","filled"]}),ut=_extends$u({},it,{color:ct.color||"primary",component:at,disabled:ct.disabled,error:ct.error,filled:ct.filled,focused:ct.focused,required:ct.required}),ht=useUtilityClasses$m(ut);return jsxRuntimeExports.jsxs(FormLabelRoot,_extends$u({as:at,ownerState:ut,className:clsx$3(ht.root,ot),ref:nt},st,{children:[rt,ct.required&&jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:ut,"aria-hidden":!0,className:ht.asterisk,children:[" ","*"]})]}))}),FormLabel$1=FormLabel,_excluded$N=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getScale(tt){return`scale(${tt}, ${tt**2})`}const styles$3={entering:{opacity:1,transform:getScale(1)},entered:{opacity:1,transform:"none"}},isWebKit154=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Grow=reactExports.forwardRef(function(et,nt){const{addEndListener:it,appear:rt=!0,children:ot,easing:at,in:st,onEnter:lt,onEntered:ct,onEntering:ut,onExit:ht,onExited:dt,onExiting:pt,style:mt,timeout:gt="auto",TransitionComponent:bt=Transition$2}=et,yt=_objectWithoutPropertiesLoose$m(et,_excluded$N),wt=reactExports.useRef(),vt=reactExports.useRef(),xt=useTheme(),St=reactExports.useRef(null),Et=useForkRef(St,ot.ref,nt),It=At=>Rt=>{if(At){const Wt=St.current;Rt===void 0?At(Wt):At(Wt,Rt)}},Tt=It(ut),$t=It((At,Rt)=>{reflow(At);const{duration:Wt,delay:jt,easing:Ot}=getTransitionProps({style:mt,timeout:gt,easing:at},{mode:"enter"});let Ct;gt==="auto"?(Ct=xt.transitions.getAutoHeightDuration(At.clientHeight),vt.current=Ct):Ct=Wt,At.style.transition=[xt.transitions.create("opacity",{duration:Ct,delay:jt}),xt.transitions.create("transform",{duration:isWebKit154?Ct:Ct*.666,delay:jt,easing:Ot})].join(","),lt&<(At,Rt)}),Ut=It(ct),Lt=It(pt),Bt=It(At=>{const{duration:Rt,delay:Wt,easing:jt}=getTransitionProps({style:mt,timeout:gt,easing:at},{mode:"exit"});let Ot;gt==="auto"?(Ot=xt.transitions.getAutoHeightDuration(At.clientHeight),vt.current=Ot):Ot=Rt,At.style.transition=[xt.transitions.create("opacity",{duration:Ot,delay:Wt}),xt.transitions.create("transform",{duration:isWebKit154?Ot:Ot*.666,delay:isWebKit154?Wt:Wt||Ot*.333,easing:jt})].join(","),At.style.opacity=0,At.style.transform=getScale(.75),ht&&ht(At)}),Pt=It(dt),kt=At=>{gt==="auto"&&(wt.current=setTimeout(At,vt.current||0)),it&&it(St.current,At)};return reactExports.useEffect(()=>()=>{clearTimeout(wt.current)},[]),jsxRuntimeExports.jsx(bt,_extends$u({appear:rt,in:st,nodeRef:St,onEnter:$t,onEntered:Ut,onEntering:Tt,onExit:Bt,onExited:Pt,onExiting:Lt,addEndListener:kt,timeout:gt==="auto"?null:gt},yt,{children:(At,Rt)=>reactExports.cloneElement(ot,_extends$u({style:_extends$u({opacity:0,transform:getScale(.75),visibility:At==="exited"&&!st?"hidden":void 0},styles$3[At],mt,ot.props.style),ref:Et},Rt))}))});Grow.muiSupportAuto=!0;const Grow$1=Grow,_excluded$M=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$l=tt=>{const{classes:et,disableUnderline:nt}=tt,rt=composeClasses({root:["root",!nt&&"underline"],input:["input"]},getInputUtilityClass,et);return _extends$u({},et,rt)},InputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiInput",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[...rootOverridesResolver(tt,et),!nt.disableUnderline&&et.underline]}})(({theme:tt,ownerState:et})=>{let it=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return tt.vars&&(it=`rgba(${tt.vars.palette.common.onBackgroundChannel} / ${tt.vars.opacity.inputUnderline})`),_extends$u({position:"relative"},et.formControl&&{"label + &":{marginTop:16}},!et.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(tt.vars||tt).palette[et.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:tt.transitions.create("transform",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses$1.error}`]:{"&:before, &:after":{borderBottomColor:(tt.vars||tt).palette.error.main}},"&:before":{borderBottom:`1px solid ${it}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:tt.transitions.create("border-bottom-color",{duration:tt.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses$1.disabled}, .${inputClasses$1.error}):before`]:{borderBottom:`2px solid ${(tt.vars||tt).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${it}`}},[`&.${inputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}})}),InputInput=styled$1(InputBaseComponent,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input$1=reactExports.forwardRef(function(et,nt){var it,rt,ot,at;const st=useThemeProps({props:et,name:"MuiInput"}),{disableUnderline:lt,components:ct={},componentsProps:ut,fullWidth:ht=!1,inputComponent:dt="input",multiline:pt=!1,slotProps:mt,slots:gt={},type:bt="text"}=st,yt=_objectWithoutPropertiesLoose$m(st,_excluded$M),wt=useUtilityClasses$l(st),xt={root:{ownerState:{disableUnderline:lt}}},St=mt??ut?deepmerge$1(mt??ut,xt):xt,Et=(it=(rt=gt.root)!=null?rt:ct.Root)!=null?it:InputRoot,It=(ot=(at=gt.input)!=null?at:ct.Input)!=null?ot:InputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:Et,input:It},slotProps:St,fullWidth:ht,inputComponent:dt,multiline:pt,ref:nt,type:bt},yt,{classes:wt}))});Input$1.muiName="Input";const Input$2=Input$1;function getInputLabelUtilityClasses(tt){return generateUtilityClass("MuiInputLabel",tt)}generateUtilityClasses("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const _excluded$L=["disableAnimation","margin","shrink","variant","className"],useUtilityClasses$k=tt=>{const{classes:et,formControl:nt,size:it,shrink:rt,disableAnimation:ot,variant:at,required:st}=tt,lt={root:["root",nt&&"formControl",!ot&&"animated",rt&&"shrink",it&&it!=="normal"&&`size${capitalize(it)}`,at],asterisk:[st&&"asterisk"]},ct=composeClasses(lt,getInputLabelUtilityClasses,et);return _extends$u({},et,ct)},InputLabelRoot=styled$1(FormLabel$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`& .${formLabelClasses$1.asterisk}`]:et.asterisk},et.root,nt.formControl&&et.formControl,nt.size==="small"&&et.sizeSmall,nt.shrink&&et.shrink,!nt.disableAnimation&&et.animated,nt.focused&&et.focused,et[nt.variant]]}})(({theme:tt,ownerState:et})=>_extends$u({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},et.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},et.size==="small"&&{transform:"translate(0, 17px) scale(1)"},et.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!et.disableAnimation&&{transition:tt.transitions.create(["color","transform","max-width"],{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut})},et.variant==="filled"&&_extends$u({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},et.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},et.shrink&&_extends$u({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},et.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),et.variant==="outlined"&&_extends$u({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},et.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},et.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}),et.variant==="standard"&&{"&:not(label) + div":{marginTop:16}})),InputLabel=reactExports.forwardRef(function(et,nt){const it=useThemeProps({name:"MuiInputLabel",props:et}),{disableAnimation:rt=!1,shrink:ot,className:at}=it,st=_objectWithoutPropertiesLoose$m(it,_excluded$L),lt=useFormControl();let ct=ot;typeof ct>"u"&<&&(ct=lt.filled||lt.focused||lt.adornedStart);const ut=formControlState({props:it,muiFormControl:lt,states:["size","variant","required","focused"]}),ht=_extends$u({},it,{disableAnimation:rt,formControl:lt,shrink:ct,size:ut.size,variant:ut.variant,required:ut.required,focused:ut.focused}),dt=useUtilityClasses$k(ht);return jsxRuntimeExports.jsx(InputLabelRoot,_extends$u({"data-shrink":ct,ownerState:ht,ref:nt,className:clsx$3(dt.root,at)},st,{classes:dt}))}),InputLabel$1=InputLabel;function getLinearProgressUtilityClass(tt){return generateUtilityClass("MuiLinearProgress",tt)}generateUtilityClasses("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const _excluded$K=["className","color","value","valueBuffer","variant"];let _$1=tt=>tt,_t$1,_t2$1,_t3$1,_t4$1,_t5,_t6;const TRANSITION_DURATION=4,indeterminate1Keyframe=keyframes(_t$1||(_t$1=_$1` +`),touchRippleClasses$1.rippleVisible,enterKeyframe,DURATION,({theme:tt})=>tt.transitions.easing.easeInOut,touchRippleClasses$1.ripplePulsate,({theme:tt})=>tt.transitions.duration.shorter,touchRippleClasses$1.child,touchRippleClasses$1.childLeaving,exitKeyframe,DURATION,({theme:tt})=>tt.transitions.easing.easeInOut,touchRippleClasses$1.childPulsate,pulsateKeyframe,({theme:tt})=>tt.transitions.easing.easeInOut),TouchRipple=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTouchRipple"}),{center:rt=!1,classes:ot={},className:at}=it,st=_objectWithoutPropertiesLoose$m(it,_excluded$12),[lt,ct]=reactExports.useState([]),ut=reactExports.useRef(0),ht=reactExports.useRef(null);reactExports.useEffect(()=>{ht.current&&(ht.current(),ht.current=null)},[lt]);const dt=reactExports.useRef(!1),pt=reactExports.useRef(0),mt=reactExports.useRef(null),gt=reactExports.useRef(null);reactExports.useEffect(()=>()=>{pt.current&&clearTimeout(pt.current)},[]);const bt=reactExports.useCallback(xt=>{const{pulsate:St,rippleX:Et,rippleY:$t,rippleSize:It,cb:Ft}=xt;ct(Ht=>[...Ht,jsxRuntimeExports.jsx(TouchRippleRipple,{classes:{ripple:clsx$3(ot.ripple,touchRippleClasses$1.ripple),rippleVisible:clsx$3(ot.rippleVisible,touchRippleClasses$1.rippleVisible),ripplePulsate:clsx$3(ot.ripplePulsate,touchRippleClasses$1.ripplePulsate),child:clsx$3(ot.child,touchRippleClasses$1.child),childLeaving:clsx$3(ot.childLeaving,touchRippleClasses$1.childLeaving),childPulsate:clsx$3(ot.childPulsate,touchRippleClasses$1.childPulsate)},timeout:DURATION,pulsate:St,rippleX:Et,rippleY:$t,rippleSize:It},ut.current)]),ut.current+=1,ht.current=Ft},[ot]),yt=reactExports.useCallback((xt={},St={},Et=()=>{})=>{const{pulsate:$t=!1,center:It=rt||St.pulsate,fakeElement:Ft=!1}=St;if((xt==null?void 0:xt.type)==="mousedown"&&dt.current){dt.current=!1;return}(xt==null?void 0:xt.type)==="touchstart"&&(dt.current=!0);const Ht=Ft?null:gt.current,zt=Ht?Ht.getBoundingClientRect():{width:0,height:0,left:0,top:0};let Ot,jt,kt;if(It||xt===void 0||xt.clientX===0&&xt.clientY===0||!xt.clientX&&!xt.touches)Ot=Math.round(zt.width/2),jt=Math.round(zt.height/2);else{const{clientX:Tt,clientY:Ct}=xt.touches&&xt.touches.length>0?xt.touches[0]:xt;Ot=Math.round(Tt-zt.left),jt=Math.round(Ct-zt.top)}if(It)kt=Math.sqrt((2*zt.width**2+zt.height**2)/3),kt%2===0&&(kt+=1);else{const Tt=Math.max(Math.abs((Ht?Ht.clientWidth:0)-Ot),Ot)*2+2,Ct=Math.max(Math.abs((Ht?Ht.clientHeight:0)-jt),jt)*2+2;kt=Math.sqrt(Tt**2+Ct**2)}xt!=null&&xt.touches?mt.current===null&&(mt.current=()=>{bt({pulsate:$t,rippleX:Ot,rippleY:jt,rippleSize:kt,cb:Et})},pt.current=setTimeout(()=>{mt.current&&(mt.current(),mt.current=null)},DELAY_RIPPLE)):bt({pulsate:$t,rippleX:Ot,rippleY:jt,rippleSize:kt,cb:Et})},[rt,bt]),wt=reactExports.useCallback(()=>{yt({},{pulsate:!0})},[yt]),vt=reactExports.useCallback((xt,St)=>{if(clearTimeout(pt.current),(xt==null?void 0:xt.type)==="touchend"&&mt.current){mt.current(),mt.current=null,pt.current=setTimeout(()=>{vt(xt,St)});return}mt.current=null,ct(Et=>Et.length>0?Et.slice(1):Et),ht.current=St},[]);return reactExports.useImperativeHandle(nt,()=>({pulsate:wt,start:yt,stop:vt}),[wt,yt,vt]),jsxRuntimeExports.jsx(TouchRippleRoot,_extends$t({className:clsx$3(touchRippleClasses$1.root,ot.root,at),ref:gt},st,{children:jsxRuntimeExports.jsx(TransitionGroup$1,{component:null,exit:!0,children:lt})}))}),TouchRipple$1=TouchRipple;function getButtonBaseUtilityClass(tt){return generateUtilityClass("MuiButtonBase",tt)}const buttonBaseClasses=generateUtilityClasses("MuiButtonBase",["root","disabled","focusVisible"]),buttonBaseClasses$1=buttonBaseClasses,_excluded$11=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],useUtilityClasses$w=tt=>{const{disabled:et,focusVisible:nt,focusVisibleClassName:it,classes:rt}=tt,at=composeClasses({root:["root",et&&"disabled",nt&&"focusVisible"]},getButtonBaseUtilityClass,rt);return nt&&it&&(at.root+=` ${it}`),at},ButtonBaseRoot=styled$1("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${buttonBaseClasses$1.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ButtonBase=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiButtonBase"}),{action:rt,centerRipple:ot=!1,children:at,className:st,component:lt="button",disabled:ct=!1,disableRipple:ut=!1,disableTouchRipple:ht=!1,focusRipple:dt=!1,LinkComponent:pt="a",onBlur:mt,onClick:gt,onContextMenu:bt,onDragLeave:yt,onFocus:wt,onFocusVisible:vt,onKeyDown:xt,onKeyUp:St,onMouseDown:Et,onMouseLeave:$t,onMouseUp:It,onTouchEnd:Ft,onTouchMove:Ht,onTouchStart:zt,tabIndex:Ot=0,TouchRippleProps:jt,touchRippleRef:kt,type:Tt}=it,Ct=_objectWithoutPropertiesLoose$m(it,_excluded$11),Ut=reactExports.useRef(null),Nt=reactExports.useRef(null),Bt=useForkRef(Nt,kt),{isFocusVisibleRef:Mt,onFocus:Dt,onBlur:Pt,ref:Vt}=useIsFocusVisible(),[nn,cn]=reactExports.useState(!1);ct&&nn&&cn(!1),reactExports.useImperativeHandle(rt,()=>({focusVisible:()=>{cn(!0),Ut.current.focus()}}),[]);const[Xt,un]=reactExports.useState(!1);reactExports.useEffect(()=>{un(!0)},[]);const en=Xt&&!ut&&!ct;reactExports.useEffect(()=>{nn&&dt&&!ut&&Xt&&Nt.current.pulsate()},[ut,dt,nn,Xt]);function fn(Kt,wn,Rn=ht){return useEventCallback(jn=>(wn&&wn(jn),!Rn&&Nt.current&&Nt.current[Kt](jn),!0))}const xn=fn("start",Et),an=fn("stop",bt),Zt=fn("stop",yt),En=fn("stop",It),In=fn("stop",Kt=>{nn&&Kt.preventDefault(),$t&&$t(Kt)}),Cn=fn("start",zt),Nn=fn("stop",Ft),Un=fn("stop",Ht),_n=fn("stop",Kt=>{Pt(Kt),Mt.current===!1&&cn(!1),mt&&mt(Kt)},!1),An=useEventCallback(Kt=>{Ut.current||(Ut.current=Kt.currentTarget),Dt(Kt),Mt.current===!0&&(cn(!0),vt&&vt(Kt)),wt&&wt(Kt)}),gn=()=>{const Kt=Ut.current;return lt&<!=="button"&&!(Kt.tagName==="A"&&Kt.href)},Tn=reactExports.useRef(!1),yn=useEventCallback(Kt=>{dt&&!Tn.current&&nn&&Nt.current&&Kt.key===" "&&(Tn.current=!0,Nt.current.stop(Kt,()=>{Nt.current.start(Kt)})),Kt.target===Kt.currentTarget&&gn()&&Kt.key===" "&&Kt.preventDefault(),xt&&xt(Kt),Kt.target===Kt.currentTarget&&gn()&&Kt.key==="Enter"&&!ct&&(Kt.preventDefault(),gt&>(Kt))}),dn=useEventCallback(Kt=>{dt&&Kt.key===" "&&Nt.current&&nn&&!Kt.defaultPrevented&&(Tn.current=!1,Nt.current.stop(Kt,()=>{Nt.current.pulsate(Kt)})),St&&St(Kt),gt&&Kt.target===Kt.currentTarget&&gn()&&Kt.key===" "&&!Kt.defaultPrevented&>(Kt)});let sn=lt;sn==="button"&&(Ct.href||Ct.to)&&(sn=pt);const rn={};sn==="button"?(rn.type=Tt===void 0?"button":Tt,rn.disabled=ct):(!Ct.href&&!Ct.to&&(rn.role="button"),ct&&(rn["aria-disabled"]=ct));const Sn=useForkRef(nt,Vt,Ut),tn=_extends$t({},it,{centerRipple:ot,component:lt,disabled:ct,disableRipple:ut,disableTouchRipple:ht,focusRipple:dt,tabIndex:Ot,focusVisible:nn}),qt=useUtilityClasses$w(tn);return jsxRuntimeExports.jsxs(ButtonBaseRoot,_extends$t({as:sn,className:clsx$3(qt.root,st),ownerState:tn,onBlur:_n,onClick:gt,onContextMenu:an,onFocus:An,onKeyDown:yn,onKeyUp:dn,onMouseDown:xn,onMouseLeave:In,onMouseUp:En,onDragLeave:Zt,onTouchEnd:Nn,onTouchMove:Un,onTouchStart:Cn,ref:Sn,tabIndex:ct?-1:Ot,type:Tt},rn,Ct,{children:[at,en?jsxRuntimeExports.jsx(TouchRipple$1,_extends$t({ref:Bt,center:ot},jt)):null]}))}),ButtonBase$1=ButtonBase;function getIconButtonUtilityClass(tt){return generateUtilityClass("MuiIconButton",tt)}const iconButtonClasses=generateUtilityClasses("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),iconButtonClasses$1=iconButtonClasses,_excluded$10=["edge","children","className","color","disabled","disableFocusRipple","size"],useUtilityClasses$v=tt=>{const{classes:et,disabled:nt,color:it,edge:rt,size:ot}=tt,at={root:["root",nt&&"disabled",it!=="default"&&`color${capitalize(it)}`,rt&&`edge${capitalize(rt)}`,`size${capitalize(ot)}`]};return composeClasses(at,getIconButtonUtilityClass,et)},IconButtonRoot=styled$1(ButtonBase$1,{name:"MuiIconButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.color!=="default"&&et[`color${capitalize(nt.color)}`],nt.edge&&et[`edge${capitalize(nt.edge)}`],et[`size${capitalize(nt.size)}`]]}})(({theme:tt,ownerState:et})=>_extends$t({textAlign:"center",flex:"0 0 auto",fontSize:tt.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(tt.vars||tt).palette.action.active,transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shortest})},!et.disableRipple&&{"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.action.activeChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.action.active,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},et.edge==="start"&&{marginLeft:et.size==="small"?-3:-12},et.edge==="end"&&{marginRight:et.size==="small"?-3:-12}),({theme:tt,ownerState:et})=>{var nt;const it=(nt=(tt.vars||tt).palette)==null?void 0:nt[et.color];return _extends$t({},et.color==="inherit"&&{color:"inherit"},et.color!=="inherit"&&et.color!=="default"&&_extends$t({color:it==null?void 0:it.main},!et.disableRipple&&{"&:hover":_extends$t({},it&&{backgroundColor:tt.vars?`rgba(${it.mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(it.main,tt.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),et.size==="small"&&{padding:5,fontSize:tt.typography.pxToRem(18)},et.size==="large"&&{padding:12,fontSize:tt.typography.pxToRem(28)},{[`&.${iconButtonClasses$1.disabled}`]:{backgroundColor:"transparent",color:(tt.vars||tt).palette.action.disabled}})}),IconButton$1=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiIconButton"}),{edge:rt=!1,children:ot,className:at,color:st="default",disabled:lt=!1,disableFocusRipple:ct=!1,size:ut="medium"}=it,ht=_objectWithoutPropertiesLoose$m(it,_excluded$10),dt=_extends$t({},it,{edge:rt,color:st,disabled:lt,disableFocusRipple:ct,size:ut}),pt=useUtilityClasses$v(dt);return jsxRuntimeExports.jsx(IconButtonRoot,_extends$t({className:clsx$3(pt.root,at),centerRipple:!0,focusRipple:!ct,disabled:lt,ref:nt,ownerState:dt},ht,{children:ot}))}),IconButton$2=IconButton$1;function isHostComponent(tt){return typeof tt=="string"}function appendOwnerState(tt,et,nt){return tt===void 0||isHostComponent(tt)?et:_extends$t({},et,{ownerState:_extends$t({},et.ownerState,nt)})}function areArraysEqual$1(tt,et,nt=(it,rt)=>it===rt){return tt.length===et.length&&tt.every((it,rt)=>nt(it,et[rt]))}const defaultContextValue={disableDefaultClasses:!1},ClassNameConfiguratorContext=reactExports.createContext(defaultContextValue);function useClassNamesOverride(tt){const{disableDefaultClasses:et}=reactExports.useContext(ClassNameConfiguratorContext);return nt=>et?"":tt(nt)}function extractEventHandlers(tt,et=[]){if(tt===void 0)return{};const nt={};return Object.keys(tt).filter(it=>it.match(/^on[A-Z]/)&&typeof tt[it]=="function"&&!et.includes(it)).forEach(it=>{nt[it]=tt[it]}),nt}function resolveComponentProps(tt,et,nt){return typeof tt=="function"?tt(et,nt):tt}function r$4(tt){var et,nt,it="";if(typeof tt=="string"||typeof tt=="number")it+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et!(nt.match(/^on[A-Z]/)&&typeof tt[nt]=="function")).forEach(nt=>{et[nt]=tt[nt]}),et}function mergeSlotProps(tt){const{getSlotProps:et,additionalProps:nt,externalSlotProps:it,externalForwardedProps:rt,className:ot}=tt;if(!et){const pt=clsx$2(nt==null?void 0:nt.className,ot,rt==null?void 0:rt.className,it==null?void 0:it.className),mt=_extends$t({},nt==null?void 0:nt.style,rt==null?void 0:rt.style,it==null?void 0:it.style),gt=_extends$t({},nt,rt,it);return pt.length>0&&(gt.className=pt),Object.keys(mt).length>0&&(gt.style=mt),{props:gt,internalRef:void 0}}const at=extractEventHandlers(_extends$t({},rt,it)),st=omitEventHandlers(it),lt=omitEventHandlers(rt),ct=et(at),ut=clsx$2(ct==null?void 0:ct.className,nt==null?void 0:nt.className,ot,rt==null?void 0:rt.className,it==null?void 0:it.className),ht=_extends$t({},ct==null?void 0:ct.style,nt==null?void 0:nt.style,rt==null?void 0:rt.style,it==null?void 0:it.style),dt=_extends$t({},ct,nt,lt,st);return ut.length>0&&(dt.className=ut),Object.keys(ht).length>0&&(dt.style=ht),{props:dt,internalRef:ct.ref}}const _excluded$$=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function useSlotProps(tt){var et;const{elementType:nt,externalSlotProps:it,ownerState:rt,skipResolvingSlotProps:ot=!1}=tt,at=_objectWithoutPropertiesLoose$m(tt,_excluded$$),st=ot?{}:resolveComponentProps(it,rt),{props:lt,internalRef:ct}=mergeSlotProps(_extends$t({},at,{externalSlotProps:st})),ut=useForkRef(ct,st==null?void 0:st.ref,(et=tt.additionalProps)==null?void 0:et.ref);return appendOwnerState(nt,_extends$t({},lt,{ref:ut}),rt)}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(tt){const et=parseInt(tt.getAttribute("tabindex")||"",10);return Number.isNaN(et)?tt.contentEditable==="true"||(tt.nodeName==="AUDIO"||tt.nodeName==="VIDEO"||tt.nodeName==="DETAILS")&&tt.getAttribute("tabindex")===null?0:tt.tabIndex:et}function isNonTabbableRadio(tt){if(tt.tagName!=="INPUT"||tt.type!=="radio"||!tt.name)return!1;const et=it=>tt.ownerDocument.querySelector(`input[type="radio"]${it}`);let nt=et(`[name="${tt.name}"]:checked`);return nt||(nt=et(`[name="${tt.name}"]`)),nt!==tt}function isNodeMatchingSelectorFocusable(tt){return!(tt.disabled||tt.tagName==="INPUT"&&tt.type==="hidden"||isNonTabbableRadio(tt))}function defaultGetTabbable(tt){const et=[],nt=[];return Array.from(tt.querySelectorAll(candidatesSelector)).forEach((it,rt)=>{const ot=getTabIndex(it);ot===-1||!isNodeMatchingSelectorFocusable(it)||(ot===0?et.push(it):nt.push({documentOrder:rt,tabIndex:ot,node:it}))}),nt.sort((it,rt)=>it.tabIndex===rt.tabIndex?it.documentOrder-rt.documentOrder:it.tabIndex-rt.tabIndex).map(it=>it.node).concat(et)}function defaultIsEnabled(){return!0}function FocusTrap(tt){const{children:et,disableAutoFocus:nt=!1,disableEnforceFocus:it=!1,disableRestoreFocus:rt=!1,getTabbable:ot=defaultGetTabbable,isEnabled:at=defaultIsEnabled,open:st}=tt,lt=reactExports.useRef(!1),ct=reactExports.useRef(null),ut=reactExports.useRef(null),ht=reactExports.useRef(null),dt=reactExports.useRef(null),pt=reactExports.useRef(!1),mt=reactExports.useRef(null),gt=useForkRef(et.ref,mt),bt=reactExports.useRef(null);reactExports.useEffect(()=>{!st||!mt.current||(pt.current=!nt)},[nt,st]),reactExports.useEffect(()=>{if(!st||!mt.current)return;const vt=ownerDocument(mt.current);return mt.current.contains(vt.activeElement)||(mt.current.hasAttribute("tabIndex")||mt.current.setAttribute("tabIndex","-1"),pt.current&&mt.current.focus()),()=>{rt||(ht.current&&ht.current.focus&&(lt.current=!0,ht.current.focus()),ht.current=null)}},[st]),reactExports.useEffect(()=>{if(!st||!mt.current)return;const vt=ownerDocument(mt.current),xt=$t=>{bt.current=$t,!(it||!at()||$t.key!=="Tab")&&vt.activeElement===mt.current&&$t.shiftKey&&(lt.current=!0,ut.current&&ut.current.focus())},St=()=>{const $t=mt.current;if($t===null)return;if(!vt.hasFocus()||!at()||lt.current){lt.current=!1;return}if($t.contains(vt.activeElement)||it&&vt.activeElement!==ct.current&&vt.activeElement!==ut.current)return;if(vt.activeElement!==dt.current)dt.current=null;else if(dt.current!==null)return;if(!pt.current)return;let It=[];if((vt.activeElement===ct.current||vt.activeElement===ut.current)&&(It=ot(mt.current)),It.length>0){var Ft,Ht;const zt=!!((Ft=bt.current)!=null&&Ft.shiftKey&&((Ht=bt.current)==null?void 0:Ht.key)==="Tab"),Ot=It[0],jt=It[It.length-1];typeof Ot!="string"&&typeof jt!="string"&&(zt?jt.focus():Ot.focus())}else $t.focus()};vt.addEventListener("focusin",St),vt.addEventListener("keydown",xt,!0);const Et=setInterval(()=>{vt.activeElement&&vt.activeElement.tagName==="BODY"&&St()},50);return()=>{clearInterval(Et),vt.removeEventListener("focusin",St),vt.removeEventListener("keydown",xt,!0)}},[nt,it,rt,at,st,ot]);const yt=vt=>{ht.current===null&&(ht.current=vt.relatedTarget),pt.current=!0,dt.current=vt.target;const xt=et.props.onFocus;xt&&xt(vt)},wt=vt=>{ht.current===null&&(ht.current=vt.relatedTarget),pt.current=!0};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{tabIndex:st?0:-1,onFocus:wt,ref:ct,"data-testid":"sentinelStart"}),reactExports.cloneElement(et,{ref:gt,onFocus:yt}),jsxRuntimeExports.jsx("div",{tabIndex:st?0:-1,onFocus:wt,ref:ut,"data-testid":"sentinelEnd"})]})}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start$2="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(tt,et){return tt.concat([et+"-"+start$2,et+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(tt,et){return tt.concat([et,et+"-"+start$2,et+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(tt){return tt?(tt.nodeName||"").toLowerCase():null}function getWindow(tt){if(tt==null)return window;if(tt.toString()!=="[object Window]"){var et=tt.ownerDocument;return et&&et.defaultView||window}return tt}function isElement(tt){var et=getWindow(tt).Element;return tt instanceof et||tt instanceof Element}function isHTMLElement$1(tt){var et=getWindow(tt).HTMLElement;return tt instanceof et||tt instanceof HTMLElement}function isShadowRoot(tt){if(typeof ShadowRoot>"u")return!1;var et=getWindow(tt).ShadowRoot;return tt instanceof et||tt instanceof ShadowRoot}function applyStyles(tt){var et=tt.state;Object.keys(et.elements).forEach(function(nt){var it=et.styles[nt]||{},rt=et.attributes[nt]||{},ot=et.elements[nt];!isHTMLElement$1(ot)||!getNodeName(ot)||(Object.assign(ot.style,it),Object.keys(rt).forEach(function(at){var st=rt[at];st===!1?ot.removeAttribute(at):ot.setAttribute(at,st===!0?"":st)}))})}function effect$2(tt){var et=tt.state,nt={popper:{position:et.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(et.elements.popper.style,nt.popper),et.styles=nt,et.elements.arrow&&Object.assign(et.elements.arrow.style,nt.arrow),function(){Object.keys(et.elements).forEach(function(it){var rt=et.elements[it],ot=et.attributes[it]||{},at=Object.keys(et.styles.hasOwnProperty(it)?et.styles[it]:nt[it]),st=at.reduce(function(lt,ct){return lt[ct]="",lt},{});!isHTMLElement$1(rt)||!getNodeName(rt)||(Object.assign(rt.style,st),Object.keys(ot).forEach(function(lt){rt.removeAttribute(lt)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(tt){return tt.split("-")[0]}var max$4=Math.max,min$5=Math.min,round$1=Math.round;function getUAString(){var tt=navigator.userAgentData;return tt!=null&&tt.brands&&Array.isArray(tt.brands)?tt.brands.map(function(et){return et.brand+"/"+et.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(tt,et,nt){et===void 0&&(et=!1),nt===void 0&&(nt=!1);var it=tt.getBoundingClientRect(),rt=1,ot=1;et&&isHTMLElement$1(tt)&&(rt=tt.offsetWidth>0&&round$1(it.width)/tt.offsetWidth||1,ot=tt.offsetHeight>0&&round$1(it.height)/tt.offsetHeight||1);var at=isElement(tt)?getWindow(tt):window,st=at.visualViewport,lt=!isLayoutViewport()&&nt,ct=(it.left+(lt&&st?st.offsetLeft:0))/rt,ut=(it.top+(lt&&st?st.offsetTop:0))/ot,ht=it.width/rt,dt=it.height/ot;return{width:ht,height:dt,top:ut,right:ct+ht,bottom:ut+dt,left:ct,x:ct,y:ut}}function getLayoutRect(tt){var et=getBoundingClientRect(tt),nt=tt.offsetWidth,it=tt.offsetHeight;return Math.abs(et.width-nt)<=1&&(nt=et.width),Math.abs(et.height-it)<=1&&(it=et.height),{x:tt.offsetLeft,y:tt.offsetTop,width:nt,height:it}}function contains(tt,et){var nt=et.getRootNode&&et.getRootNode();if(tt.contains(et))return!0;if(nt&&isShadowRoot(nt)){var it=et;do{if(it&&tt.isSameNode(it))return!0;it=it.parentNode||it.host}while(it)}return!1}function getComputedStyle$1(tt){return getWindow(tt).getComputedStyle(tt)}function isTableElement(tt){return["table","td","th"].indexOf(getNodeName(tt))>=0}function getDocumentElement(tt){return((isElement(tt)?tt.ownerDocument:tt.document)||window.document).documentElement}function getParentNode(tt){return getNodeName(tt)==="html"?tt:tt.assignedSlot||tt.parentNode||(isShadowRoot(tt)?tt.host:null)||getDocumentElement(tt)}function getTrueOffsetParent(tt){return!isHTMLElement$1(tt)||getComputedStyle$1(tt).position==="fixed"?null:tt.offsetParent}function getContainingBlock(tt){var et=/firefox/i.test(getUAString()),nt=/Trident/i.test(getUAString());if(nt&&isHTMLElement$1(tt)){var it=getComputedStyle$1(tt);if(it.position==="fixed")return null}var rt=getParentNode(tt);for(isShadowRoot(rt)&&(rt=rt.host);isHTMLElement$1(rt)&&["html","body"].indexOf(getNodeName(rt))<0;){var ot=getComputedStyle$1(rt);if(ot.transform!=="none"||ot.perspective!=="none"||ot.contain==="paint"||["transform","perspective"].indexOf(ot.willChange)!==-1||et&&ot.willChange==="filter"||et&&ot.filter&&ot.filter!=="none")return rt;rt=rt.parentNode}return null}function getOffsetParent(tt){for(var et=getWindow(tt),nt=getTrueOffsetParent(tt);nt&&isTableElement(nt)&&getComputedStyle$1(nt).position==="static";)nt=getTrueOffsetParent(nt);return nt&&(getNodeName(nt)==="html"||getNodeName(nt)==="body"&&getComputedStyle$1(nt).position==="static")?et:nt||getContainingBlock(tt)||et}function getMainAxisFromPlacement(tt){return["top","bottom"].indexOf(tt)>=0?"x":"y"}function within(tt,et,nt){return max$4(tt,min$5(et,nt))}function withinMaxClamp(tt,et,nt){var it=within(tt,et,nt);return it>nt?nt:it}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(tt){return Object.assign({},getFreshSideObject(),tt)}function expandToHashMap(tt,et){return et.reduce(function(nt,it){return nt[it]=tt,nt},{})}var toPaddingObject=function(et,nt){return et=typeof et=="function"?et(Object.assign({},nt.rects,{placement:nt.placement})):et,mergePaddingObject(typeof et!="number"?et:expandToHashMap(et,basePlacements))};function arrow(tt){var et,nt=tt.state,it=tt.name,rt=tt.options,ot=nt.elements.arrow,at=nt.modifiersData.popperOffsets,st=getBasePlacement(nt.placement),lt=getMainAxisFromPlacement(st),ct=[left,right].indexOf(st)>=0,ut=ct?"height":"width";if(!(!ot||!at)){var ht=toPaddingObject(rt.padding,nt),dt=getLayoutRect(ot),pt=lt==="y"?top:left,mt=lt==="y"?bottom:right,gt=nt.rects.reference[ut]+nt.rects.reference[lt]-at[lt]-nt.rects.popper[ut],bt=at[lt]-nt.rects.reference[lt],yt=getOffsetParent(ot),wt=yt?lt==="y"?yt.clientHeight||0:yt.clientWidth||0:0,vt=gt/2-bt/2,xt=ht[pt],St=wt-dt[ut]-ht[mt],Et=wt/2-dt[ut]/2+vt,$t=within(xt,Et,St),It=lt;nt.modifiersData[it]=(et={},et[It]=$t,et.centerOffset=$t-Et,et)}}function effect$1(tt){var et=tt.state,nt=tt.options,it=nt.element,rt=it===void 0?"[data-popper-arrow]":it;rt!=null&&(typeof rt=="string"&&(rt=et.elements.popper.querySelector(rt),!rt)||contains(et.elements.popper,rt)&&(et.elements.arrow=rt))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(tt){return tt.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(tt,et){var nt=tt.x,it=tt.y,rt=et.devicePixelRatio||1;return{x:round$1(nt*rt)/rt||0,y:round$1(it*rt)/rt||0}}function mapToStyles(tt){var et,nt=tt.popper,it=tt.popperRect,rt=tt.placement,ot=tt.variation,at=tt.offsets,st=tt.position,lt=tt.gpuAcceleration,ct=tt.adaptive,ut=tt.roundOffsets,ht=tt.isFixed,dt=at.x,pt=dt===void 0?0:dt,mt=at.y,gt=mt===void 0?0:mt,bt=typeof ut=="function"?ut({x:pt,y:gt}):{x:pt,y:gt};pt=bt.x,gt=bt.y;var yt=at.hasOwnProperty("x"),wt=at.hasOwnProperty("y"),vt=left,xt=top,St=window;if(ct){var Et=getOffsetParent(nt),$t="clientHeight",It="clientWidth";if(Et===getWindow(nt)&&(Et=getDocumentElement(nt),getComputedStyle$1(Et).position!=="static"&&st==="absolute"&&($t="scrollHeight",It="scrollWidth")),Et=Et,rt===top||(rt===left||rt===right)&&ot===end){xt=bottom;var Ft=ht&&Et===St&&St.visualViewport?St.visualViewport.height:Et[$t];gt-=Ft-it.height,gt*=lt?1:-1}if(rt===left||(rt===top||rt===bottom)&&ot===end){vt=right;var Ht=ht&&Et===St&&St.visualViewport?St.visualViewport.width:Et[It];pt-=Ht-it.width,pt*=lt?1:-1}}var zt=Object.assign({position:st},ct&&unsetSides),Ot=ut===!0?roundOffsetsByDPR({x:pt,y:gt},getWindow(nt)):{x:pt,y:gt};if(pt=Ot.x,gt=Ot.y,lt){var jt;return Object.assign({},zt,(jt={},jt[xt]=wt?"0":"",jt[vt]=yt?"0":"",jt.transform=(St.devicePixelRatio||1)<=1?"translate("+pt+"px, "+gt+"px)":"translate3d("+pt+"px, "+gt+"px, 0)",jt))}return Object.assign({},zt,(et={},et[xt]=wt?gt+"px":"",et[vt]=yt?pt+"px":"",et.transform="",et))}function computeStyles(tt){var et=tt.state,nt=tt.options,it=nt.gpuAcceleration,rt=it===void 0?!0:it,ot=nt.adaptive,at=ot===void 0?!0:ot,st=nt.roundOffsets,lt=st===void 0?!0:st,ct={placement:getBasePlacement(et.placement),variation:getVariation(et.placement),popper:et.elements.popper,popperRect:et.rects.popper,gpuAcceleration:rt,isFixed:et.options.strategy==="fixed"};et.modifiersData.popperOffsets!=null&&(et.styles.popper=Object.assign({},et.styles.popper,mapToStyles(Object.assign({},ct,{offsets:et.modifiersData.popperOffsets,position:et.options.strategy,adaptive:at,roundOffsets:lt})))),et.modifiersData.arrow!=null&&(et.styles.arrow=Object.assign({},et.styles.arrow,mapToStyles(Object.assign({},ct,{offsets:et.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:lt})))),et.attributes.popper=Object.assign({},et.attributes.popper,{"data-popper-placement":et.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(tt){var et=tt.state,nt=tt.instance,it=tt.options,rt=it.scroll,ot=rt===void 0?!0:rt,at=it.resize,st=at===void 0?!0:at,lt=getWindow(et.elements.popper),ct=[].concat(et.scrollParents.reference,et.scrollParents.popper);return ot&&ct.forEach(function(ut){ut.addEventListener("scroll",nt.update,passive)}),st&<.addEventListener("resize",nt.update,passive),function(){ot&&ct.forEach(function(ut){ut.removeEventListener("scroll",nt.update,passive)}),st&<.removeEventListener("resize",nt.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(tt){return tt.replace(/left|right|bottom|top/g,function(et){return hash$1[et]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(tt){return tt.replace(/start|end/g,function(et){return hash[et]})}function getWindowScroll(tt){var et=getWindow(tt),nt=et.pageXOffset,it=et.pageYOffset;return{scrollLeft:nt,scrollTop:it}}function getWindowScrollBarX(tt){return getBoundingClientRect(getDocumentElement(tt)).left+getWindowScroll(tt).scrollLeft}function getViewportRect(tt,et){var nt=getWindow(tt),it=getDocumentElement(tt),rt=nt.visualViewport,ot=it.clientWidth,at=it.clientHeight,st=0,lt=0;if(rt){ot=rt.width,at=rt.height;var ct=isLayoutViewport();(ct||!ct&&et==="fixed")&&(st=rt.offsetLeft,lt=rt.offsetTop)}return{width:ot,height:at,x:st+getWindowScrollBarX(tt),y:lt}}function getDocumentRect(tt){var et,nt=getDocumentElement(tt),it=getWindowScroll(tt),rt=(et=tt.ownerDocument)==null?void 0:et.body,ot=max$4(nt.scrollWidth,nt.clientWidth,rt?rt.scrollWidth:0,rt?rt.clientWidth:0),at=max$4(nt.scrollHeight,nt.clientHeight,rt?rt.scrollHeight:0,rt?rt.clientHeight:0),st=-it.scrollLeft+getWindowScrollBarX(tt),lt=-it.scrollTop;return getComputedStyle$1(rt||nt).direction==="rtl"&&(st+=max$4(nt.clientWidth,rt?rt.clientWidth:0)-ot),{width:ot,height:at,x:st,y:lt}}function isScrollParent(tt){var et=getComputedStyle$1(tt),nt=et.overflow,it=et.overflowX,rt=et.overflowY;return/auto|scroll|overlay|hidden/.test(nt+rt+it)}function getScrollParent(tt){return["html","body","#document"].indexOf(getNodeName(tt))>=0?tt.ownerDocument.body:isHTMLElement$1(tt)&&isScrollParent(tt)?tt:getScrollParent(getParentNode(tt))}function listScrollParents(tt,et){var nt;et===void 0&&(et=[]);var it=getScrollParent(tt),rt=it===((nt=tt.ownerDocument)==null?void 0:nt.body),ot=getWindow(it),at=rt?[ot].concat(ot.visualViewport||[],isScrollParent(it)?it:[]):it,st=et.concat(at);return rt?st:st.concat(listScrollParents(getParentNode(at)))}function rectToClientRect(tt){return Object.assign({},tt,{left:tt.x,top:tt.y,right:tt.x+tt.width,bottom:tt.y+tt.height})}function getInnerBoundingClientRect(tt,et){var nt=getBoundingClientRect(tt,!1,et==="fixed");return nt.top=nt.top+tt.clientTop,nt.left=nt.left+tt.clientLeft,nt.bottom=nt.top+tt.clientHeight,nt.right=nt.left+tt.clientWidth,nt.width=tt.clientWidth,nt.height=tt.clientHeight,nt.x=nt.left,nt.y=nt.top,nt}function getClientRectFromMixedType(tt,et,nt){return et===viewport?rectToClientRect(getViewportRect(tt,nt)):isElement(et)?getInnerBoundingClientRect(et,nt):rectToClientRect(getDocumentRect(getDocumentElement(tt)))}function getClippingParents(tt){var et=listScrollParents(getParentNode(tt)),nt=["absolute","fixed"].indexOf(getComputedStyle$1(tt).position)>=0,it=nt&&isHTMLElement$1(tt)?getOffsetParent(tt):tt;return isElement(it)?et.filter(function(rt){return isElement(rt)&&contains(rt,it)&&getNodeName(rt)!=="body"}):[]}function getClippingRect(tt,et,nt,it){var rt=et==="clippingParents"?getClippingParents(tt):[].concat(et),ot=[].concat(rt,[nt]),at=ot[0],st=ot.reduce(function(lt,ct){var ut=getClientRectFromMixedType(tt,ct,it);return lt.top=max$4(ut.top,lt.top),lt.right=min$5(ut.right,lt.right),lt.bottom=min$5(ut.bottom,lt.bottom),lt.left=max$4(ut.left,lt.left),lt},getClientRectFromMixedType(tt,at,it));return st.width=st.right-st.left,st.height=st.bottom-st.top,st.x=st.left,st.y=st.top,st}function computeOffsets(tt){var et=tt.reference,nt=tt.element,it=tt.placement,rt=it?getBasePlacement(it):null,ot=it?getVariation(it):null,at=et.x+et.width/2-nt.width/2,st=et.y+et.height/2-nt.height/2,lt;switch(rt){case top:lt={x:at,y:et.y-nt.height};break;case bottom:lt={x:at,y:et.y+et.height};break;case right:lt={x:et.x+et.width,y:st};break;case left:lt={x:et.x-nt.width,y:st};break;default:lt={x:et.x,y:et.y}}var ct=rt?getMainAxisFromPlacement(rt):null;if(ct!=null){var ut=ct==="y"?"height":"width";switch(ot){case start$2:lt[ct]=lt[ct]-(et[ut]/2-nt[ut]/2);break;case end:lt[ct]=lt[ct]+(et[ut]/2-nt[ut]/2);break}}return lt}function detectOverflow(tt,et){et===void 0&&(et={});var nt=et,it=nt.placement,rt=it===void 0?tt.placement:it,ot=nt.strategy,at=ot===void 0?tt.strategy:ot,st=nt.boundary,lt=st===void 0?clippingParents:st,ct=nt.rootBoundary,ut=ct===void 0?viewport:ct,ht=nt.elementContext,dt=ht===void 0?popper:ht,pt=nt.altBoundary,mt=pt===void 0?!1:pt,gt=nt.padding,bt=gt===void 0?0:gt,yt=mergePaddingObject(typeof bt!="number"?bt:expandToHashMap(bt,basePlacements)),wt=dt===popper?reference:popper,vt=tt.rects.popper,xt=tt.elements[mt?wt:dt],St=getClippingRect(isElement(xt)?xt:xt.contextElement||getDocumentElement(tt.elements.popper),lt,ut,at),Et=getBoundingClientRect(tt.elements.reference),$t=computeOffsets({reference:Et,element:vt,strategy:"absolute",placement:rt}),It=rectToClientRect(Object.assign({},vt,$t)),Ft=dt===popper?It:Et,Ht={top:St.top-Ft.top+yt.top,bottom:Ft.bottom-St.bottom+yt.bottom,left:St.left-Ft.left+yt.left,right:Ft.right-St.right+yt.right},zt=tt.modifiersData.offset;if(dt===popper&&zt){var Ot=zt[rt];Object.keys(Ht).forEach(function(jt){var kt=[right,bottom].indexOf(jt)>=0?1:-1,Tt=[top,bottom].indexOf(jt)>=0?"y":"x";Ht[jt]+=Ot[Tt]*kt})}return Ht}function computeAutoPlacement(tt,et){et===void 0&&(et={});var nt=et,it=nt.placement,rt=nt.boundary,ot=nt.rootBoundary,at=nt.padding,st=nt.flipVariations,lt=nt.allowedAutoPlacements,ct=lt===void 0?placements:lt,ut=getVariation(it),ht=ut?st?variationPlacements:variationPlacements.filter(function(mt){return getVariation(mt)===ut}):basePlacements,dt=ht.filter(function(mt){return ct.indexOf(mt)>=0});dt.length===0&&(dt=ht);var pt=dt.reduce(function(mt,gt){return mt[gt]=detectOverflow(tt,{placement:gt,boundary:rt,rootBoundary:ot,padding:at})[getBasePlacement(gt)],mt},{});return Object.keys(pt).sort(function(mt,gt){return pt[mt]-pt[gt]})}function getExpandedFallbackPlacements(tt){if(getBasePlacement(tt)===auto)return[];var et=getOppositePlacement(tt);return[getOppositeVariationPlacement(tt),et,getOppositeVariationPlacement(et)]}function flip(tt){var et=tt.state,nt=tt.options,it=tt.name;if(!et.modifiersData[it]._skip){for(var rt=nt.mainAxis,ot=rt===void 0?!0:rt,at=nt.altAxis,st=at===void 0?!0:at,lt=nt.fallbackPlacements,ct=nt.padding,ut=nt.boundary,ht=nt.rootBoundary,dt=nt.altBoundary,pt=nt.flipVariations,mt=pt===void 0?!0:pt,gt=nt.allowedAutoPlacements,bt=et.options.placement,yt=getBasePlacement(bt),wt=yt===bt,vt=lt||(wt||!mt?[getOppositePlacement(bt)]:getExpandedFallbackPlacements(bt)),xt=[bt].concat(vt).reduce(function(nn,cn){return nn.concat(getBasePlacement(cn)===auto?computeAutoPlacement(et,{placement:cn,boundary:ut,rootBoundary:ht,padding:ct,flipVariations:mt,allowedAutoPlacements:gt}):cn)},[]),St=et.rects.reference,Et=et.rects.popper,$t=new Map,It=!0,Ft=xt[0],Ht=0;Ht=0,Tt=kt?"width":"height",Ct=detectOverflow(et,{placement:zt,boundary:ut,rootBoundary:ht,altBoundary:dt,padding:ct}),Ut=kt?jt?right:left:jt?bottom:top;St[Tt]>Et[Tt]&&(Ut=getOppositePlacement(Ut));var Nt=getOppositePlacement(Ut),Bt=[];if(ot&&Bt.push(Ct[Ot]<=0),st&&Bt.push(Ct[Ut]<=0,Ct[Nt]<=0),Bt.every(function(nn){return nn})){Ft=zt,It=!1;break}$t.set(zt,Bt)}if(It)for(var Mt=mt?3:1,Dt=function(cn){var Xt=xt.find(function(un){var en=$t.get(un);if(en)return en.slice(0,cn).every(function(fn){return fn})});if(Xt)return Ft=Xt,"break"},Pt=Mt;Pt>0;Pt--){var Vt=Dt(Pt);if(Vt==="break")break}et.placement!==Ft&&(et.modifiersData[it]._skip=!0,et.placement=Ft,et.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(tt,et,nt){return nt===void 0&&(nt={x:0,y:0}),{top:tt.top-et.height-nt.y,right:tt.right-et.width+nt.x,bottom:tt.bottom-et.height+nt.y,left:tt.left-et.width-nt.x}}function isAnySideFullyClipped(tt){return[top,right,bottom,left].some(function(et){return tt[et]>=0})}function hide$3(tt){var et=tt.state,nt=tt.name,it=et.rects.reference,rt=et.rects.popper,ot=et.modifiersData.preventOverflow,at=detectOverflow(et,{elementContext:"reference"}),st=detectOverflow(et,{altBoundary:!0}),lt=getSideOffsets(at,it),ct=getSideOffsets(st,rt,ot),ut=isAnySideFullyClipped(lt),ht=isAnySideFullyClipped(ct);et.modifiersData[nt]={referenceClippingOffsets:lt,popperEscapeOffsets:ct,isReferenceHidden:ut,hasPopperEscaped:ht},et.attributes.popper=Object.assign({},et.attributes.popper,{"data-popper-reference-hidden":ut,"data-popper-escaped":ht})}const hide$4={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide$3};function distanceAndSkiddingToXY(tt,et,nt){var it=getBasePlacement(tt),rt=[left,top].indexOf(it)>=0?-1:1,ot=typeof nt=="function"?nt(Object.assign({},et,{placement:tt})):nt,at=ot[0],st=ot[1];return at=at||0,st=(st||0)*rt,[left,right].indexOf(it)>=0?{x:st,y:at}:{x:at,y:st}}function offset(tt){var et=tt.state,nt=tt.options,it=tt.name,rt=nt.offset,ot=rt===void 0?[0,0]:rt,at=placements.reduce(function(ut,ht){return ut[ht]=distanceAndSkiddingToXY(ht,et.rects,ot),ut},{}),st=at[et.placement],lt=st.x,ct=st.y;et.modifiersData.popperOffsets!=null&&(et.modifiersData.popperOffsets.x+=lt,et.modifiersData.popperOffsets.y+=ct),et.modifiersData[it]=at}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(tt){var et=tt.state,nt=tt.name;et.modifiersData[nt]=computeOffsets({reference:et.rects.reference,element:et.rects.popper,strategy:"absolute",placement:et.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(tt){return tt==="x"?"y":"x"}function preventOverflow(tt){var et=tt.state,nt=tt.options,it=tt.name,rt=nt.mainAxis,ot=rt===void 0?!0:rt,at=nt.altAxis,st=at===void 0?!1:at,lt=nt.boundary,ct=nt.rootBoundary,ut=nt.altBoundary,ht=nt.padding,dt=nt.tether,pt=dt===void 0?!0:dt,mt=nt.tetherOffset,gt=mt===void 0?0:mt,bt=detectOverflow(et,{boundary:lt,rootBoundary:ct,padding:ht,altBoundary:ut}),yt=getBasePlacement(et.placement),wt=getVariation(et.placement),vt=!wt,xt=getMainAxisFromPlacement(yt),St=getAltAxis(xt),Et=et.modifiersData.popperOffsets,$t=et.rects.reference,It=et.rects.popper,Ft=typeof gt=="function"?gt(Object.assign({},et.rects,{placement:et.placement})):gt,Ht=typeof Ft=="number"?{mainAxis:Ft,altAxis:Ft}:Object.assign({mainAxis:0,altAxis:0},Ft),zt=et.modifiersData.offset?et.modifiersData.offset[et.placement]:null,Ot={x:0,y:0};if(Et){if(ot){var jt,kt=xt==="y"?top:left,Tt=xt==="y"?bottom:right,Ct=xt==="y"?"height":"width",Ut=Et[xt],Nt=Ut+bt[kt],Bt=Ut-bt[Tt],Mt=pt?-It[Ct]/2:0,Dt=wt===start$2?$t[Ct]:It[Ct],Pt=wt===start$2?-It[Ct]:-$t[Ct],Vt=et.elements.arrow,nn=pt&&Vt?getLayoutRect(Vt):{width:0,height:0},cn=et.modifiersData["arrow#persistent"]?et.modifiersData["arrow#persistent"].padding:getFreshSideObject(),Xt=cn[kt],un=cn[Tt],en=within(0,$t[Ct],nn[Ct]),fn=vt?$t[Ct]/2-Mt-en-Xt-Ht.mainAxis:Dt-en-Xt-Ht.mainAxis,xn=vt?-$t[Ct]/2+Mt+en+un+Ht.mainAxis:Pt+en+un+Ht.mainAxis,an=et.elements.arrow&&getOffsetParent(et.elements.arrow),Zt=an?xt==="y"?an.clientTop||0:an.clientLeft||0:0,En=(jt=zt==null?void 0:zt[xt])!=null?jt:0,In=Ut+fn-En-Zt,Cn=Ut+xn-En,Nn=within(pt?min$5(Nt,In):Nt,Ut,pt?max$4(Bt,Cn):Bt);Et[xt]=Nn,Ot[xt]=Nn-Ut}if(st){var Un,_n=xt==="x"?top:left,An=xt==="x"?bottom:right,gn=Et[St],Tn=St==="y"?"height":"width",yn=gn+bt[_n],dn=gn-bt[An],sn=[top,left].indexOf(yt)!==-1,rn=(Un=zt==null?void 0:zt[St])!=null?Un:0,Sn=sn?yn:gn-$t[Tn]-It[Tn]-rn+Ht.altAxis,tn=sn?gn+$t[Tn]+It[Tn]-rn-Ht.altAxis:dn,qt=pt&&sn?withinMaxClamp(Sn,gn,tn):within(pt?Sn:yn,gn,pt?tn:dn);Et[St]=qt,Ot[St]=qt-gn}et.modifiersData[it]=Ot}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(tt){return{scrollLeft:tt.scrollLeft,scrollTop:tt.scrollTop}}function getNodeScroll(tt){return tt===getWindow(tt)||!isHTMLElement$1(tt)?getWindowScroll(tt):getHTMLElementScroll(tt)}function isElementScaled(tt){var et=tt.getBoundingClientRect(),nt=round$1(et.width)/tt.offsetWidth||1,it=round$1(et.height)/tt.offsetHeight||1;return nt!==1||it!==1}function getCompositeRect(tt,et,nt){nt===void 0&&(nt=!1);var it=isHTMLElement$1(et),rt=isHTMLElement$1(et)&&isElementScaled(et),ot=getDocumentElement(et),at=getBoundingClientRect(tt,rt,nt),st={scrollLeft:0,scrollTop:0},lt={x:0,y:0};return(it||!it&&!nt)&&((getNodeName(et)!=="body"||isScrollParent(ot))&&(st=getNodeScroll(et)),isHTMLElement$1(et)?(lt=getBoundingClientRect(et,!0),lt.x+=et.clientLeft,lt.y+=et.clientTop):ot&&(lt.x=getWindowScrollBarX(ot))),{x:at.left+st.scrollLeft-lt.x,y:at.top+st.scrollTop-lt.y,width:at.width,height:at.height}}function order$1(tt){var et=new Map,nt=new Set,it=[];tt.forEach(function(ot){et.set(ot.name,ot)});function rt(ot){nt.add(ot.name);var at=[].concat(ot.requires||[],ot.requiresIfExists||[]);at.forEach(function(st){if(!nt.has(st)){var lt=et.get(st);lt&&rt(lt)}}),it.push(ot)}return tt.forEach(function(ot){nt.has(ot.name)||rt(ot)}),it}function orderModifiers(tt){var et=order$1(tt);return modifierPhases.reduce(function(nt,it){return nt.concat(et.filter(function(rt){return rt.phase===it}))},[])}function debounce$3(tt){var et;return function(){return et||(et=new Promise(function(nt){Promise.resolve().then(function(){et=void 0,nt(tt())})})),et}}function mergeByName(tt){var et=tt.reduce(function(nt,it){var rt=nt[it.name];return nt[it.name]=rt?Object.assign({},rt,it,{options:Object.assign({},rt.options,it.options),data:Object.assign({},rt.data,it.data)}):it,nt},{});return Object.keys(et).map(function(nt){return et[nt]})}var DEFAULT_OPTIONS$k={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var tt=arguments.length,et=new Array(tt),nt=0;nt{ot||st(getContainer$1(rt)||document.body)},[rt,ot]),useEnhancedEffect$1(()=>{if(at&&!ot)return setRef(nt,at),()=>{setRef(nt,null)}},[nt,at,ot]),ot){if(reactExports.isValidElement(it)){const ct={ref:lt};return reactExports.cloneElement(it,ct)}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:it})}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:at&&reactDomExports.createPortal(it,at)})});function getPopperUtilityClass(tt){return generateUtilityClass("MuiPopper",tt)}generateUtilityClasses("MuiPopper",["root"]);const _excluded$_=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],_excluded2$9=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function flipPlacement(tt,et){if(et==="ltr")return tt;switch(tt){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return tt}}function resolveAnchorEl$1(tt){return typeof tt=="function"?tt():tt}function isHTMLElement(tt){return tt.nodeType!==void 0}const useUtilityClasses$u=()=>composeClasses({root:["root"]},useClassNamesOverride(getPopperUtilityClass)),defaultPopperOptions={},PopperTooltip=reactExports.forwardRef(function(et,nt){var it;const{anchorEl:rt,children:ot,direction:at,disablePortal:st,modifiers:lt,open:ct,placement:ut,popperOptions:ht,popperRef:dt,slotProps:pt={},slots:mt={},TransitionProps:gt}=et,bt=_objectWithoutPropertiesLoose$m(et,_excluded$_),yt=reactExports.useRef(null),wt=useForkRef(yt,nt),vt=reactExports.useRef(null),xt=useForkRef(vt,dt),St=reactExports.useRef(xt);useEnhancedEffect$1(()=>{St.current=xt},[xt]),reactExports.useImperativeHandle(dt,()=>vt.current,[]);const Et=flipPlacement(ut,at),[$t,It]=reactExports.useState(Et),[Ft,Ht]=reactExports.useState(resolveAnchorEl$1(rt));reactExports.useEffect(()=>{vt.current&&vt.current.forceUpdate()}),reactExports.useEffect(()=>{rt&&Ht(resolveAnchorEl$1(rt))},[rt]),useEnhancedEffect$1(()=>{if(!Ft||!ct)return;const Tt=Nt=>{It(Nt.placement)};let Ct=[{name:"preventOverflow",options:{altBoundary:st}},{name:"flip",options:{altBoundary:st}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:Nt})=>{Tt(Nt)}}];lt!=null&&(Ct=Ct.concat(lt)),ht&&ht.modifiers!=null&&(Ct=Ct.concat(ht.modifiers));const Ut=createPopper(Ft,yt.current,_extends$t({placement:Et},ht,{modifiers:Ct}));return St.current(Ut),()=>{Ut.destroy(),St.current(null)}},[Ft,st,lt,ct,ht,Et]);const zt={placement:$t};gt!==null&&(zt.TransitionProps=gt);const Ot=useUtilityClasses$u(),jt=(it=mt.root)!=null?it:"div",kt=useSlotProps({elementType:jt,externalSlotProps:pt.root,externalForwardedProps:bt,additionalProps:{role:"tooltip",ref:wt},ownerState:et,className:Ot.root});return jsxRuntimeExports.jsx(jt,_extends$t({},kt,{children:typeof ot=="function"?ot(zt):ot}))}),Popper$1=reactExports.forwardRef(function(et,nt){const{anchorEl:it,children:rt,container:ot,direction:at="ltr",disablePortal:st=!1,keepMounted:lt=!1,modifiers:ct,open:ut,placement:ht="bottom",popperOptions:dt=defaultPopperOptions,popperRef:pt,style:mt,transition:gt=!1,slotProps:bt={},slots:yt={}}=et,wt=_objectWithoutPropertiesLoose$m(et,_excluded2$9),[vt,xt]=reactExports.useState(!0),St=()=>{xt(!1)},Et=()=>{xt(!0)};if(!lt&&!ut&&(!gt||vt))return null;let $t;if(ot)$t=ot;else if(it){const Ht=resolveAnchorEl$1(it);$t=Ht&&isHTMLElement(Ht)?ownerDocument(Ht).body:ownerDocument(null).body}const It=!ut&<&&(!gt||vt)?"none":void 0,Ft=gt?{in:ut,onEnter:St,onExited:Et}:void 0;return jsxRuntimeExports.jsx(Portal,{disablePortal:st,container:$t,children:jsxRuntimeExports.jsx(PopperTooltip,_extends$t({anchorEl:it,direction:at,disablePortal:st,modifiers:ct,ref:nt,open:gt?!vt:ut,placement:ht,popperOptions:dt,popperRef:pt,slotProps:bt,slots:yt},wt,{style:_extends$t({position:"fixed",top:0,left:0,display:It},mt),TransitionProps:Ft,children:rt}))})});function isOverflowing(tt){const et=ownerDocument(tt);return et.body===tt?ownerWindow(tt).innerWidth>et.documentElement.clientWidth:tt.scrollHeight>tt.clientHeight}function ariaHidden(tt,et){et?tt.setAttribute("aria-hidden","true"):tt.removeAttribute("aria-hidden")}function getPaddingRight(tt){return parseInt(ownerWindow(tt).getComputedStyle(tt).paddingRight,10)||0}function isAriaHiddenForbiddenOnElement(tt){const nt=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(tt.tagName)!==-1,it=tt.tagName==="INPUT"&&tt.getAttribute("type")==="hidden";return nt||it}function ariaHiddenSiblings(tt,et,nt,it,rt){const ot=[et,nt,...it];[].forEach.call(tt.children,at=>{const st=ot.indexOf(at)===-1,lt=!isAriaHiddenForbiddenOnElement(at);st&<&&ariaHidden(at,rt)})}function findIndexOf(tt,et){let nt=-1;return tt.some((it,rt)=>et(it)?(nt=rt,!0):!1),nt}function handleContainer(tt,et){const nt=[],it=tt.container;if(!et.disableScrollLock){if(isOverflowing(it)){const at=getScrollbarSize(ownerDocument(it));nt.push({value:it.style.paddingRight,property:"padding-right",el:it}),it.style.paddingRight=`${getPaddingRight(it)+at}px`;const st=ownerDocument(it).querySelectorAll(".mui-fixed");[].forEach.call(st,lt=>{nt.push({value:lt.style.paddingRight,property:"padding-right",el:lt}),lt.style.paddingRight=`${getPaddingRight(lt)+at}px`})}let ot;if(it.parentNode instanceof DocumentFragment)ot=ownerDocument(it).body;else{const at=it.parentElement,st=ownerWindow(it);ot=(at==null?void 0:at.nodeName)==="HTML"&&st.getComputedStyle(at).overflowY==="scroll"?at:it}nt.push({value:ot.style.overflow,property:"overflow",el:ot},{value:ot.style.overflowX,property:"overflow-x",el:ot},{value:ot.style.overflowY,property:"overflow-y",el:ot}),ot.style.overflow="hidden"}return()=>{nt.forEach(({value:ot,el:at,property:st})=>{ot?at.style.setProperty(st,ot):at.style.removeProperty(st)})}}function getHiddenSiblings(tt){const et=[];return[].forEach.call(tt.children,nt=>{nt.getAttribute("aria-hidden")==="true"&&et.push(nt)}),et}class ModalManager{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(et,nt){let it=this.modals.indexOf(et);if(it!==-1)return it;it=this.modals.length,this.modals.push(et),et.modalRef&&ariaHidden(et.modalRef,!1);const rt=getHiddenSiblings(nt);ariaHiddenSiblings(nt,et.mount,et.modalRef,rt,!0);const ot=findIndexOf(this.containers,at=>at.container===nt);return ot!==-1?(this.containers[ot].modals.push(et),it):(this.containers.push({modals:[et],container:nt,restore:null,hiddenSiblings:rt}),it)}mount(et,nt){const it=findIndexOf(this.containers,ot=>ot.modals.indexOf(et)!==-1),rt=this.containers[it];rt.restore||(rt.restore=handleContainer(rt,nt))}remove(et,nt=!0){const it=this.modals.indexOf(et);if(it===-1)return it;const rt=findIndexOf(this.containers,at=>at.modals.indexOf(et)!==-1),ot=this.containers[rt];if(ot.modals.splice(ot.modals.indexOf(et),1),this.modals.splice(it,1),ot.modals.length===0)ot.restore&&ot.restore(),et.modalRef&&ariaHidden(et.modalRef,nt),ariaHiddenSiblings(ot.container,et.mount,et.modalRef,ot.hiddenSiblings,!1),this.containers.splice(rt,1);else{const at=ot.modals[ot.modals.length-1];at.modalRef&&ariaHidden(at.modalRef,!1)}return it}isTopModal(et){return this.modals.length>0&&this.modals[this.modals.length-1]===et}}function getContainer(tt){return typeof tt=="function"?tt():tt}function getHasTransition(tt){return tt?tt.props.hasOwnProperty("in"):!1}const defaultManager=new ModalManager;function useModal$1(tt){const{container:et,disableEscapeKeyDown:nt=!1,disableScrollLock:it=!1,manager:rt=defaultManager,closeAfterTransition:ot=!1,onTransitionEnter:at,onTransitionExited:st,children:lt,onClose:ct,open:ut,rootRef:ht}=tt,dt=reactExports.useRef({}),pt=reactExports.useRef(null),mt=reactExports.useRef(null),gt=useForkRef(mt,ht),[bt,yt]=reactExports.useState(!ut),wt=getHasTransition(lt);let vt=!0;(tt["aria-hidden"]==="false"||tt["aria-hidden"]===!1)&&(vt=!1);const xt=()=>ownerDocument(pt.current),St=()=>(dt.current.modalRef=mt.current,dt.current.mount=pt.current,dt.current),Et=()=>{rt.mount(St(),{disableScrollLock:it}),mt.current&&(mt.current.scrollTop=0)},$t=useEventCallback(()=>{const Ct=getContainer(et)||xt().body;rt.add(St(),Ct),mt.current&&Et()}),It=reactExports.useCallback(()=>rt.isTopModal(St()),[rt]),Ft=useEventCallback(Ct=>{pt.current=Ct,Ct&&(ut&&It()?Et():mt.current&&ariaHidden(mt.current,vt))}),Ht=reactExports.useCallback(()=>{rt.remove(St(),vt)},[vt,rt]);reactExports.useEffect(()=>()=>{Ht()},[Ht]),reactExports.useEffect(()=>{ut?$t():(!wt||!ot)&&Ht()},[ut,Ht,wt,ot,$t]);const zt=Ct=>Ut=>{var Nt;(Nt=Ct.onKeyDown)==null||Nt.call(Ct,Ut),!(Ut.key!=="Escape"||Ut.which===229||!It())&&(nt||(Ut.stopPropagation(),ct&&ct(Ut,"escapeKeyDown")))},Ot=Ct=>Ut=>{var Nt;(Nt=Ct.onClick)==null||Nt.call(Ct,Ut),Ut.target===Ut.currentTarget&&ct&&ct(Ut,"backdropClick")};return{getRootProps:(Ct={})=>{const Ut=extractEventHandlers(tt);delete Ut.onTransitionEnter,delete Ut.onTransitionExited;const Nt=_extends$t({},Ut,Ct);return _extends$t({role:"presentation"},Nt,{onKeyDown:zt(Nt),ref:gt})},getBackdropProps:(Ct={})=>{const Ut=Ct;return _extends$t({"aria-hidden":!0},Ut,{onClick:Ot(Ut),open:ut})},getTransitionProps:()=>{const Ct=()=>{yt(!1),at&&at()},Ut=()=>{yt(!0),st&&st(),ot&&Ht()};return{onEnter:createChainedFunction(Ct,lt==null?void 0:lt.props.onEnter),onExited:createChainedFunction(Ut,lt==null?void 0:lt.props.onExited)}},rootRef:gt,portalRef:Ft,isTopModal:It,exited:bt,hasTransition:wt}}const INTENTIONAL_DRAG_COUNT_THRESHOLD=2;function asc(tt,et){return tt-et}function clamp$4(tt,et,nt){return tt==null?et:Math.min(Math.max(et,tt),nt)}function findClosest(tt,et){var nt;const{index:it}=(nt=tt.reduce((rt,ot,at)=>{const st=Math.abs(et-ot);return rt===null||st({left:`${tt}%`}),leap:tt=>({width:`${tt}%`})},"horizontal-reverse":{offset:tt=>({right:`${tt}%`}),leap:tt=>({width:`${tt}%`})},vertical:{offset:tt=>({bottom:`${tt}%`}),leap:tt=>({height:`${tt}%`})}},Identity$1=tt=>tt;let cachedSupportsTouchActionNone;function doesSupportTouchActionNone(){return cachedSupportsTouchActionNone===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?cachedSupportsTouchActionNone=CSS.supports("touch-action","none"):cachedSupportsTouchActionNone=!0),cachedSupportsTouchActionNone}function useSlider(tt){const{"aria-labelledby":et,defaultValue:nt,disabled:it=!1,disableSwap:rt=!1,isRtl:ot=!1,marks:at=!1,max:st=100,min:lt=0,name:ct,onChange:ut,onChangeCommitted:ht,orientation:dt="horizontal",rootRef:pt,scale:mt=Identity$1,step:gt=1,tabIndex:bt,value:yt}=tt,wt=reactExports.useRef(),[vt,xt]=reactExports.useState(-1),[St,Et]=reactExports.useState(-1),[$t,It]=reactExports.useState(!1),Ft=reactExports.useRef(0),[Ht,zt]=useControlled({controlled:yt,default:nt??lt,name:"Slider"}),Ot=ut&&((rn,Sn,tn)=>{const qt=rn.nativeEvent||rn,Kt=new qt.constructor(qt.type,qt);Object.defineProperty(Kt,"target",{writable:!0,value:{value:Sn,name:ct}}),ut(Kt,Sn,tn)}),jt=Array.isArray(Ht);let kt=jt?Ht.slice().sort(asc):[Ht];kt=kt.map(rn=>clamp$4(rn,lt,st));const Tt=at===!0&>!==null?[...Array(Math.floor((st-lt)/gt)+1)].map((rn,Sn)=>({value:lt+gt*Sn})):at||[],Ct=Tt.map(rn=>rn.value),{isFocusVisibleRef:Ut,onBlur:Nt,onFocus:Bt,ref:Mt}=useIsFocusVisible(),[Dt,Pt]=reactExports.useState(-1),Vt=reactExports.useRef(),nn=useForkRef(Mt,Vt),cn=useForkRef(pt,nn),Xt=rn=>Sn=>{var tn;const qt=Number(Sn.currentTarget.getAttribute("data-index"));Bt(Sn),Ut.current===!0&&Pt(qt),Et(qt),rn==null||(tn=rn.onFocus)==null||tn.call(rn,Sn)},un=rn=>Sn=>{var tn;Nt(Sn),Ut.current===!1&&Pt(-1),Et(-1),rn==null||(tn=rn.onBlur)==null||tn.call(rn,Sn)};useEnhancedEffect$1(()=>{if(it&&Vt.current.contains(document.activeElement)){var rn;(rn=document.activeElement)==null||rn.blur()}},[it]),it&&vt!==-1&&xt(-1),it&&Dt!==-1&&Pt(-1);const en=rn=>Sn=>{var tn;(tn=rn.onChange)==null||tn.call(rn,Sn);const qt=Number(Sn.currentTarget.getAttribute("data-index")),Kt=kt[qt],wn=Ct.indexOf(Kt);let Rn=Sn.target.valueAsNumber;if(Tt&>==null){const jn=Ct[Ct.length-1];Rn>jn?Rn=jn:Rn{const{current:tn}=Vt,{width:qt,height:Kt,bottom:wn,left:Rn}=tn.getBoundingClientRect();let jn;xn.indexOf("vertical")===0?jn=(wn-rn.y)/Kt:jn=(rn.x-Rn)/qt,xn.indexOf("-reverse")!==-1&&(jn=1-jn);let Bn;if(Bn=percentToValue(jn,lt,st),gt)Bn=roundValueToStep(Bn,gt,lt);else{const Wn=findClosest(Ct,Bn);Bn=Ct[Wn]}Bn=clamp$4(Bn,lt,st);let Xn=0;if(jt){Sn?Xn=fn.current:Xn=findClosest(kt,Bn),rt&&(Bn=clamp$4(Bn,kt[Xn-1]||-1/0,kt[Xn+1]||1/0));const Wn=Bn;Bn=setValueIndex({values:kt,newValue:Bn,index:Xn}),rt&&Sn||(Xn=Bn.indexOf(Wn),fn.current=Xn)}return{newValue:Bn,activeIndex:Xn}},Zt=useEventCallback(rn=>{const Sn=trackFinger(rn,wt);if(!Sn)return;if(Ft.current+=1,rn.type==="mousemove"&&rn.buttons===0){En(rn);return}const{newValue:tn,activeIndex:qt}=an({finger:Sn,move:!0});focusThumb({sliderRef:Vt,activeIndex:qt,setActive:xt}),zt(tn),!$t&&Ft.current>INTENTIONAL_DRAG_COUNT_THRESHOLD&&It(!0),Ot&&!areValuesEqual(tn,Ht)&&Ot(rn,tn,qt)}),En=useEventCallback(rn=>{const Sn=trackFinger(rn,wt);if(It(!1),!Sn)return;const{newValue:tn}=an({finger:Sn,move:!0});xt(-1),rn.type==="touchend"&&Et(-1),ht&&ht(rn,tn),wt.current=void 0,Cn()}),In=useEventCallback(rn=>{if(it)return;doesSupportTouchActionNone()||rn.preventDefault();const Sn=rn.changedTouches[0];Sn!=null&&(wt.current=Sn.identifier);const tn=trackFinger(rn,wt);if(tn!==!1){const{newValue:Kt,activeIndex:wn}=an({finger:tn});focusThumb({sliderRef:Vt,activeIndex:wn,setActive:xt}),zt(Kt),Ot&&!areValuesEqual(Kt,Ht)&&Ot(rn,Kt,wn)}Ft.current=0;const qt=ownerDocument(Vt.current);qt.addEventListener("touchmove",Zt),qt.addEventListener("touchend",En)}),Cn=reactExports.useCallback(()=>{const rn=ownerDocument(Vt.current);rn.removeEventListener("mousemove",Zt),rn.removeEventListener("mouseup",En),rn.removeEventListener("touchmove",Zt),rn.removeEventListener("touchend",En)},[En,Zt]);reactExports.useEffect(()=>{const{current:rn}=Vt;return rn.addEventListener("touchstart",In,{passive:doesSupportTouchActionNone()}),()=>{rn.removeEventListener("touchstart",In,{passive:doesSupportTouchActionNone()}),Cn()}},[Cn,In]),reactExports.useEffect(()=>{it&&Cn()},[it,Cn]);const Nn=rn=>Sn=>{var tn;if((tn=rn.onMouseDown)==null||tn.call(rn,Sn),it||Sn.defaultPrevented||Sn.button!==0)return;Sn.preventDefault();const qt=trackFinger(Sn,wt);if(qt!==!1){const{newValue:wn,activeIndex:Rn}=an({finger:qt});focusThumb({sliderRef:Vt,activeIndex:Rn,setActive:xt}),zt(wn),Ot&&!areValuesEqual(wn,Ht)&&Ot(Sn,wn,Rn)}Ft.current=0;const Kt=ownerDocument(Vt.current);Kt.addEventListener("mousemove",Zt),Kt.addEventListener("mouseup",En)},Un=valueToPercent(jt?kt[0]:lt,lt,st),_n=valueToPercent(kt[kt.length-1],lt,st)-Un,An=(rn={})=>{const Sn=extractEventHandlers(rn),tn={onMouseDown:Nn(Sn||{})},qt=_extends$t({},Sn,tn);return _extends$t({},rn,{ref:cn},qt)},gn=rn=>Sn=>{var tn;(tn=rn.onMouseOver)==null||tn.call(rn,Sn);const qt=Number(Sn.currentTarget.getAttribute("data-index"));Et(qt)},Tn=rn=>Sn=>{var tn;(tn=rn.onMouseLeave)==null||tn.call(rn,Sn),Et(-1)};return{active:vt,axis:xn,axisProps,dragging:$t,focusedThumbIndex:Dt,getHiddenInputProps:(rn={})=>{var Sn;const tn=extractEventHandlers(rn),qt={onChange:en(tn||{}),onFocus:Xt(tn||{}),onBlur:un(tn||{})},Kt=_extends$t({},tn,qt);return _extends$t({tabIndex:bt,"aria-labelledby":et,"aria-orientation":dt,"aria-valuemax":mt(st),"aria-valuemin":mt(lt),name:ct,type:"range",min:tt.min,max:tt.max,step:tt.step===null&&tt.marks?"any":(Sn=tt.step)!=null?Sn:void 0,disabled:it},rn,Kt,{style:_extends$t({},visuallyHidden$1,{direction:ot?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:An,getThumbProps:(rn={})=>{const Sn=extractEventHandlers(rn),tn={onMouseOver:gn(Sn||{}),onMouseLeave:Tn(Sn||{})};return _extends$t({},rn,Sn,tn)},marks:Tt,open:St,range:jt,rootRef:cn,trackLeap:_n,trackOffset:Un,values:kt,getThumbStyle:rn=>({pointerEvents:vt!==-1&&vt!==rn?"none":void 0})}}const _excluded$Z=["onChange","maxRows","minRows","style","value"];function getStyleValue(tt){return parseInt(tt,10)||0}const styles$5={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function isEmpty$1(tt){return tt==null||Object.keys(tt).length===0||tt.outerHeightStyle===0&&!tt.overflow}const TextareaAutosize=reactExports.forwardRef(function(et,nt){const{onChange:it,maxRows:rt,minRows:ot=1,style:at,value:st}=et,lt=_objectWithoutPropertiesLoose$m(et,_excluded$Z),{current:ct}=reactExports.useRef(st!=null),ut=reactExports.useRef(null),ht=useForkRef(nt,ut),dt=reactExports.useRef(null),pt=reactExports.useRef(0),[mt,gt]=reactExports.useState({outerHeightStyle:0}),bt=reactExports.useCallback(()=>{const xt=ut.current,Et=ownerWindow(xt).getComputedStyle(xt);if(Et.width==="0px")return{outerHeightStyle:0};const $t=dt.current;$t.style.width=Et.width,$t.value=xt.value||et.placeholder||"x",$t.value.slice(-1)===` +`&&($t.value+=" ");const It=Et.boxSizing,Ft=getStyleValue(Et.paddingBottom)+getStyleValue(Et.paddingTop),Ht=getStyleValue(Et.borderBottomWidth)+getStyleValue(Et.borderTopWidth),zt=$t.scrollHeight;$t.value="x";const Ot=$t.scrollHeight;let jt=zt;ot&&(jt=Math.max(Number(ot)*Ot,jt)),rt&&(jt=Math.min(Number(rt)*Ot,jt)),jt=Math.max(jt,Ot);const kt=jt+(It==="border-box"?Ft+Ht:0),Tt=Math.abs(jt-zt)<=1;return{outerHeightStyle:kt,overflow:Tt}},[rt,ot,et.placeholder]),yt=(xt,St)=>{const{outerHeightStyle:Et,overflow:$t}=St;return pt.current<20&&(Et>0&&Math.abs((xt.outerHeightStyle||0)-Et)>1||xt.overflow!==$t)?(pt.current+=1,{overflow:$t,outerHeightStyle:Et}):xt},wt=reactExports.useCallback(()=>{const xt=bt();isEmpty$1(xt)||gt(St=>yt(St,xt))},[bt]);useEnhancedEffect$1(()=>{const xt=()=>{const zt=bt();isEmpty$1(zt)||reactDomExports.flushSync(()=>{gt(Ot=>yt(Ot,zt))})},St=()=>{pt.current=0,xt()};let Et;const $t=debounce$4(St),It=ut.current,Ft=ownerWindow(It);Ft.addEventListener("resize",$t);let Ht;return typeof ResizeObserver<"u"&&(Ht=new ResizeObserver(St),Ht.observe(It)),()=>{$t.clear(),cancelAnimationFrame(Et),Ft.removeEventListener("resize",$t),Ht&&Ht.disconnect()}},[bt]),useEnhancedEffect$1(()=>{wt()}),reactExports.useEffect(()=>{pt.current=0},[st]);const vt=xt=>{pt.current=0,ct||wt(),it&&it(xt)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",_extends$t({value:st,onChange:vt,ref:ht,rows:ot,style:_extends$t({height:mt.outerHeightStyle,overflow:mt.overflow?"hidden":void 0},at)},lt)),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:et.className,readOnly:!0,ref:dt,tabIndex:-1,style:_extends$t({},styles$5.shadow,at,{paddingTop:0,paddingBottom:0})})]})}),_excluded$Y=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],PopperRoot=styled$1(Popper$1,{name:"MuiPopper",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),Popper=reactExports.forwardRef(function(et,nt){var it;const rt=useTheme$3(),ot=useThemeProps({props:et,name:"MuiPopper"}),{anchorEl:at,component:st,components:lt,componentsProps:ct,container:ut,disablePortal:ht,keepMounted:dt,modifiers:pt,open:mt,placement:gt,popperOptions:bt,popperRef:yt,transition:wt,slots:vt,slotProps:xt}=ot,St=_objectWithoutPropertiesLoose$m(ot,_excluded$Y),Et=(it=vt==null?void 0:vt.root)!=null?it:lt==null?void 0:lt.Root,$t=_extends$t({anchorEl:at,container:ut,disablePortal:ht,keepMounted:dt,modifiers:pt,open:mt,placement:gt,popperOptions:bt,popperRef:yt,transition:wt},St);return jsxRuntimeExports.jsx(PopperRoot,_extends$t({as:st,direction:rt==null?void 0:rt.direction,slots:{root:Et},slotProps:xt??ct},$t,{ref:nt}))}),MuiPopper=Popper;function formControlState({props:tt,states:et,muiFormControl:nt}){return et.reduce((it,rt)=>(it[rt]=tt[rt],nt&&typeof tt[rt]>"u"&&(it[rt]=nt[rt]),it),{})}const FormControlContext=reactExports.createContext(void 0),FormControlContext$1=FormControlContext;function useFormControl(){return reactExports.useContext(FormControlContext$1)}function GlobalStyles(tt){return jsxRuntimeExports.jsx(GlobalStyles$1,_extends$t({},tt,{defaultTheme:defaultTheme$1,themeId:THEME_ID}))}function hasValue(tt){return tt!=null&&!(Array.isArray(tt)&&tt.length===0)}function isFilled(tt,et=!1){return tt&&(hasValue(tt.value)&&tt.value!==""||et&&hasValue(tt.defaultValue)&&tt.defaultValue!=="")}function isAdornedStart(tt){return tt.startAdornment}function getInputBaseUtilityClass(tt){return generateUtilityClass("MuiInputBase",tt)}const inputBaseClasses=generateUtilityClasses("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),inputBaseClasses$1=inputBaseClasses,_excluded$X=["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"],rootOverridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.formControl&&et.formControl,nt.startAdornment&&et.adornedStart,nt.endAdornment&&et.adornedEnd,nt.error&&et.error,nt.size==="small"&&et.sizeSmall,nt.multiline&&et.multiline,nt.color&&et[`color${capitalize(nt.color)}`],nt.fullWidth&&et.fullWidth,nt.hiddenLabel&&et.hiddenLabel]},inputOverridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.input,nt.size==="small"&&et.inputSizeSmall,nt.multiline&&et.inputMultiline,nt.type==="search"&&et.inputTypeSearch,nt.startAdornment&&et.inputAdornedStart,nt.endAdornment&&et.inputAdornedEnd,nt.hiddenLabel&&et.inputHiddenLabel]},useUtilityClasses$t=tt=>{const{classes:et,color:nt,disabled:it,error:rt,endAdornment:ot,focused:at,formControl:st,fullWidth:lt,hiddenLabel:ct,multiline:ut,readOnly:ht,size:dt,startAdornment:pt,type:mt}=tt,gt={root:["root",`color${capitalize(nt)}`,it&&"disabled",rt&&"error",lt&&"fullWidth",at&&"focused",st&&"formControl",dt&&dt!=="medium"&&`size${capitalize(dt)}`,ut&&"multiline",pt&&"adornedStart",ot&&"adornedEnd",ct&&"hiddenLabel",ht&&"readOnly"],input:["input",it&&"disabled",mt==="search"&&"inputTypeSearch",ut&&"inputMultiline",dt==="small"&&"inputSizeSmall",ct&&"inputHiddenLabel",pt&&"inputAdornedStart",ot&&"inputAdornedEnd",ht&&"readOnly"]};return composeClasses(gt,getInputBaseUtilityClass,et)},InputBaseRoot=styled$1("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:tt,ownerState:et})=>_extends$t({},tt.typography.body1,{color:(tt.vars||tt).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled,cursor:"default"}},et.multiline&&_extends$t({padding:"4px 0 5px"},et.size==="small"&&{paddingTop:1}),et.fullWidth&&{width:"100%"})),InputBaseComponent=styled$1("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light",it=_extends$t({color:"currentColor"},tt.vars?{opacity:tt.vars.opacity.inputPlaceholder}:{opacity:nt?.42:.5},{transition:tt.transitions.create("opacity",{duration:tt.transitions.duration.shorter})}),rt={opacity:"0 !important"},ot=tt.vars?{opacity:tt.vars.opacity.inputPlaceholder}:{opacity:nt?.42:.5};return _extends$t({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":it,"&::-moz-placeholder":it,"&:-ms-input-placeholder":it,"&::-ms-input-placeholder":it,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses$1.formControl} &`]:{"&::-webkit-input-placeholder":rt,"&::-moz-placeholder":rt,"&:-ms-input-placeholder":rt,"&::-ms-input-placeholder":rt,"&:focus::-webkit-input-placeholder":ot,"&:focus::-moz-placeholder":ot,"&:focus:-ms-input-placeholder":ot,"&:focus::-ms-input-placeholder":ot},[`&.${inputBaseClasses$1.disabled}`]:{opacity:1,WebkitTextFillColor:(tt.vars||tt).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},et.size==="small"&&{paddingTop:1},et.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},et.type==="search"&&{MozAppearance:"textfield"})}),inputGlobalStyles=jsxRuntimeExports.jsx(GlobalStyles,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),InputBase=reactExports.forwardRef(function(et,nt){var it;const rt=useThemeProps({props:et,name:"MuiInputBase"}),{"aria-describedby":ot,autoComplete:at,autoFocus:st,className:lt,components:ct={},componentsProps:ut={},defaultValue:ht,disabled:dt,disableInjectingGlobalStyles:pt,endAdornment:mt,fullWidth:gt=!1,id:bt,inputComponent:yt="input",inputProps:wt={},inputRef:vt,maxRows:xt,minRows:St,multiline:Et=!1,name:$t,onBlur:It,onChange:Ft,onClick:Ht,onFocus:zt,onKeyDown:Ot,onKeyUp:jt,placeholder:kt,readOnly:Tt,renderSuffix:Ct,rows:Ut,slotProps:Nt={},slots:Bt={},startAdornment:Mt,type:Dt="text",value:Pt}=rt,Vt=_objectWithoutPropertiesLoose$m(rt,_excluded$X),nn=wt.value!=null?wt.value:Pt,{current:cn}=reactExports.useRef(nn!=null),Xt=reactExports.useRef(),un=reactExports.useCallback(qt=>{},[]),en=useForkRef(Xt,vt,wt.ref,un),[fn,xn]=reactExports.useState(!1),an=useFormControl(),Zt=formControlState({props:rt,muiFormControl:an,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Zt.focused=an?an.focused:fn,reactExports.useEffect(()=>{!an&&dt&&fn&&(xn(!1),It&&It())},[an,dt,fn,It]);const En=an&&an.onFilled,In=an&&an.onEmpty,Cn=reactExports.useCallback(qt=>{isFilled(qt)?En&&En():In&&In()},[En,In]);useEnhancedEffect$1(()=>{cn&&Cn({value:nn})},[nn,Cn,cn]);const Nn=qt=>{if(Zt.disabled){qt.stopPropagation();return}zt&&zt(qt),wt.onFocus&&wt.onFocus(qt),an&&an.onFocus?an.onFocus(qt):xn(!0)},Un=qt=>{It&&It(qt),wt.onBlur&&wt.onBlur(qt),an&&an.onBlur?an.onBlur(qt):xn(!1)},_n=(qt,...Kt)=>{if(!cn){const wn=qt.target||Xt.current;if(wn==null)throw new Error(formatMuiErrorMessage(1));Cn({value:wn.value})}wt.onChange&&wt.onChange(qt,...Kt),Ft&&Ft(qt,...Kt)};reactExports.useEffect(()=>{Cn(Xt.current)},[]);const An=qt=>{Xt.current&&qt.currentTarget===qt.target&&Xt.current.focus(),Ht&&Ht(qt)};let gn=yt,Tn=wt;Et&&gn==="input"&&(Ut?Tn=_extends$t({type:void 0,minRows:Ut,maxRows:Ut},Tn):Tn=_extends$t({type:void 0,maxRows:xt,minRows:St},Tn),gn=TextareaAutosize);const yn=qt=>{Cn(qt.animationName==="mui-auto-fill-cancel"?Xt.current:{value:"x"})};reactExports.useEffect(()=>{an&&an.setAdornedStart(!!Mt)},[an,Mt]);const dn=_extends$t({},rt,{color:Zt.color||"primary",disabled:Zt.disabled,endAdornment:mt,error:Zt.error,focused:Zt.focused,formControl:an,fullWidth:gt,hiddenLabel:Zt.hiddenLabel,multiline:Et,size:Zt.size,startAdornment:Mt,type:Dt}),sn=useUtilityClasses$t(dn),rn=Bt.root||ct.Root||InputBaseRoot,Sn=Nt.root||ut.root||{},tn=Bt.input||ct.Input||InputBaseComponent;return Tn=_extends$t({},Tn,(it=Nt.input)!=null?it:ut.input),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!pt&&inputGlobalStyles,jsxRuntimeExports.jsxs(rn,_extends$t({},Sn,!isHostComponent(rn)&&{ownerState:_extends$t({},dn,Sn.ownerState)},{ref:nt,onClick:An},Vt,{className:clsx$3(sn.root,Sn.className,lt,Tt&&"MuiInputBase-readOnly"),children:[Mt,jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:null,children:jsxRuntimeExports.jsx(tn,_extends$t({ownerState:dn,"aria-invalid":Zt.error,"aria-describedby":ot,autoComplete:at,autoFocus:st,defaultValue:ht,disabled:Zt.disabled,id:bt,onAnimationStart:yn,name:$t,placeholder:kt,readOnly:Tt,required:Zt.required,rows:Ut,value:nn,onKeyDown:Ot,onKeyUp:jt,type:Dt},Tn,!isHostComponent(tn)&&{as:gn,ownerState:_extends$t({},dn,Tn.ownerState)},{ref:en,className:clsx$3(sn.input,Tn.className,Tt&&"MuiInputBase-readOnly"),onBlur:Un,onChange:_n,onFocus:Nn}))}),mt,Ct?Ct(_extends$t({},Zt,{startAdornment:Mt})):null]}))]})}),InputBase$1=InputBase;function getInputUtilityClass(tt){return generateUtilityClass("MuiInput",tt)}const inputClasses=_extends$t({},inputBaseClasses$1,generateUtilityClasses("MuiInput",["root","underline","input"])),inputClasses$1=inputClasses;function getOutlinedInputUtilityClass(tt){return generateUtilityClass("MuiOutlinedInput",tt)}const outlinedInputClasses=_extends$t({},inputBaseClasses$1,generateUtilityClasses("MuiOutlinedInput",["root","notchedOutline","input"])),outlinedInputClasses$1=outlinedInputClasses;function getFilledInputUtilityClass(tt){return generateUtilityClass("MuiFilledInput",tt)}const filledInputClasses=_extends$t({},inputBaseClasses$1,generateUtilityClasses("MuiFilledInput",["root","underline","input"])),filledInputClasses$1=filledInputClasses,ArrowDropDownIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),_excluded$W=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],styles$4={entering:{opacity:1},entered:{opacity:1}},Fade=reactExports.forwardRef(function(et,nt){const it=useTheme(),rt={enter:it.transitions.duration.enteringScreen,exit:it.transitions.duration.leavingScreen},{addEndListener:ot,appear:at=!0,children:st,easing:lt,in:ct,onEnter:ut,onEntered:ht,onEntering:dt,onExit:pt,onExited:mt,onExiting:gt,style:bt,timeout:yt=rt,TransitionComponent:wt=Transition$2}=et,vt=_objectWithoutPropertiesLoose$m(et,_excluded$W),xt=reactExports.useRef(null),St=useForkRef(xt,st.ref,nt),Et=kt=>Tt=>{if(kt){const Ct=xt.current;Tt===void 0?kt(Ct):kt(Ct,Tt)}},$t=Et(dt),It=Et((kt,Tt)=>{reflow(kt);const Ct=getTransitionProps({style:bt,timeout:yt,easing:lt},{mode:"enter"});kt.style.webkitTransition=it.transitions.create("opacity",Ct),kt.style.transition=it.transitions.create("opacity",Ct),ut&&ut(kt,Tt)}),Ft=Et(ht),Ht=Et(gt),zt=Et(kt=>{const Tt=getTransitionProps({style:bt,timeout:yt,easing:lt},{mode:"exit"});kt.style.webkitTransition=it.transitions.create("opacity",Tt),kt.style.transition=it.transitions.create("opacity",Tt),pt&&pt(kt)}),Ot=Et(mt),jt=kt=>{ot&&ot(xt.current,kt)};return jsxRuntimeExports.jsx(wt,_extends$t({appear:at,in:ct,nodeRef:xt,onEnter:It,onEntered:Ft,onEntering:$t,onExit:zt,onExited:Ot,onExiting:Ht,addEndListener:jt,timeout:yt},vt,{children:(kt,Tt)=>reactExports.cloneElement(st,_extends$t({style:_extends$t({opacity:0,visibility:kt==="exited"&&!ct?"hidden":void 0},styles$4[kt],bt,st.props.style),ref:St},Tt))}))}),Fade$1=Fade;function getBackdropUtilityClass(tt){return generateUtilityClass("MuiBackdrop",tt)}generateUtilityClasses("MuiBackdrop",["root","invisible"]);const _excluded$V=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],useUtilityClasses$s=tt=>{const{classes:et,invisible:nt}=tt;return composeClasses({root:["root",nt&&"invisible"]},getBackdropUtilityClass,et)},BackdropRoot=styled$1("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.invisible&&et.invisible]}})(({ownerState:tt})=>_extends$t({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},tt.invisible&&{backgroundColor:"transparent"})),Backdrop=reactExports.forwardRef(function(et,nt){var it,rt,ot;const at=useThemeProps({props:et,name:"MuiBackdrop"}),{children:st,className:lt,component:ct="div",components:ut={},componentsProps:ht={},invisible:dt=!1,open:pt,slotProps:mt={},slots:gt={},TransitionComponent:bt=Fade$1,transitionDuration:yt}=at,wt=_objectWithoutPropertiesLoose$m(at,_excluded$V),vt=_extends$t({},at,{component:ct,invisible:dt}),xt=useUtilityClasses$s(vt),St=(it=mt.root)!=null?it:ht.root;return jsxRuntimeExports.jsx(bt,_extends$t({in:pt,timeout:yt},wt,{children:jsxRuntimeExports.jsx(BackdropRoot,_extends$t({"aria-hidden":!0},St,{as:(rt=(ot=gt.root)!=null?ot:ut.Root)!=null?rt:ct,className:clsx$3(xt.root,lt,St==null?void 0:St.className),ownerState:_extends$t({},vt,St==null?void 0:St.ownerState),classes:xt,ref:nt,children:st}))}))}),Backdrop$1=Backdrop;function getButtonUtilityClass(tt){return generateUtilityClass("MuiButton",tt)}const buttonClasses=generateUtilityClasses("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),buttonClasses$1=buttonClasses,ButtonGroupContext=reactExports.createContext({}),ButtonGroupContext$1=ButtonGroupContext,ButtonGroupButtonContext=reactExports.createContext(void 0),ButtonGroupButtonContext$1=ButtonGroupButtonContext,_excluded$U=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],useUtilityClasses$r=tt=>{const{color:et,disableElevation:nt,fullWidth:it,size:rt,variant:ot,classes:at}=tt,st={root:["root",ot,`${ot}${capitalize(et)}`,`size${capitalize(rt)}`,`${ot}Size${capitalize(rt)}`,et==="inherit"&&"colorInherit",nt&&"disableElevation",it&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${capitalize(rt)}`],endIcon:["endIcon",`iconSize${capitalize(rt)}`]},lt=composeClasses(st,getButtonUtilityClass,at);return _extends$t({},at,lt)},commonIconStyles=tt=>_extends$t({},tt.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},tt.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},tt.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),ButtonRoot=styled$1(ButtonBase$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],et[`${nt.variant}${capitalize(nt.color)}`],et[`size${capitalize(nt.size)}`],et[`${nt.variant}Size${capitalize(nt.size)}`],nt.color==="inherit"&&et.colorInherit,nt.disableElevation&&et.disableElevation,nt.fullWidth&&et.fullWidth]}})(({theme:tt,ownerState:et})=>{var nt,it;const rt=tt.palette.mode==="light"?tt.palette.grey[300]:tt.palette.grey[800],ot=tt.palette.mode==="light"?tt.palette.grey.A100:tt.palette.grey[700];return _extends$t({},tt.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(tt.vars||tt).shape.borderRadius,transition:tt.transitions.create(["background-color","box-shadow","border-color","color"],{duration:tt.transitions.duration.short}),"&:hover":_extends$t({textDecoration:"none",backgroundColor:tt.vars?`rgba(${tt.vars.palette.text.primaryChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette.text.primary,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="text"&&et.color!=="inherit"&&{backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="outlined"&&et.color!=="inherit"&&{border:`1px solid ${(tt.vars||tt).palette[et.color].main}`,backgroundColor:tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / ${tt.vars.palette.action.hoverOpacity})`:alpha$1(tt.palette[et.color].main,tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},et.variant==="contained"&&{backgroundColor:tt.vars?tt.vars.palette.Button.inheritContainedHoverBg:ot,boxShadow:(tt.vars||tt).shadows[4],"@media (hover: none)":{boxShadow:(tt.vars||tt).shadows[2],backgroundColor:(tt.vars||tt).palette.grey[300]}},et.variant==="contained"&&et.color!=="inherit"&&{backgroundColor:(tt.vars||tt).palette[et.color].dark,"@media (hover: none)":{backgroundColor:(tt.vars||tt).palette[et.color].main}}),"&:active":_extends$t({},et.variant==="contained"&&{boxShadow:(tt.vars||tt).shadows[8]}),[`&.${buttonClasses$1.focusVisible}`]:_extends$t({},et.variant==="contained"&&{boxShadow:(tt.vars||tt).shadows[6]}),[`&.${buttonClasses$1.disabled}`]:_extends$t({color:(tt.vars||tt).palette.action.disabled},et.variant==="outlined"&&{border:`1px solid ${(tt.vars||tt).palette.action.disabledBackground}`},et.variant==="contained"&&{color:(tt.vars||tt).palette.action.disabled,boxShadow:(tt.vars||tt).shadows[0],backgroundColor:(tt.vars||tt).palette.action.disabledBackground})},et.variant==="text"&&{padding:"6px 8px"},et.variant==="text"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].main},et.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},et.variant==="outlined"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].main,border:tt.vars?`1px solid rgba(${tt.vars.palette[et.color].mainChannel} / 0.5)`:`1px solid ${alpha$1(tt.palette[et.color].main,.5)}`},et.variant==="contained"&&{color:tt.vars?tt.vars.palette.text.primary:(nt=(it=tt.palette).getContrastText)==null?void 0:nt.call(it,tt.palette.grey[300]),backgroundColor:tt.vars?tt.vars.palette.Button.inheritContainedBg:rt,boxShadow:(tt.vars||tt).shadows[2]},et.variant==="contained"&&et.color!=="inherit"&&{color:(tt.vars||tt).palette[et.color].contrastText,backgroundColor:(tt.vars||tt).palette[et.color].main},et.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},et.size==="small"&&et.variant==="text"&&{padding:"4px 5px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="text"&&{padding:"8px 11px",fontSize:tt.typography.pxToRem(15)},et.size==="small"&&et.variant==="outlined"&&{padding:"3px 9px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="outlined"&&{padding:"7px 21px",fontSize:tt.typography.pxToRem(15)},et.size==="small"&&et.variant==="contained"&&{padding:"4px 10px",fontSize:tt.typography.pxToRem(13)},et.size==="large"&&et.variant==="contained"&&{padding:"8px 22px",fontSize:tt.typography.pxToRem(15)},et.fullWidth&&{width:"100%"})},({ownerState:tt})=>tt.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${buttonClasses$1.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${buttonClasses$1.disabled}`]:{boxShadow:"none"}}),ButtonStartIcon=styled$1("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.startIcon,et[`iconSize${capitalize(nt.size)}`]]}})(({ownerState:tt})=>_extends$t({display:"inherit",marginRight:8,marginLeft:-4},tt.size==="small"&&{marginLeft:-2},commonIconStyles(tt))),ButtonEndIcon=styled$1("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.endIcon,et[`iconSize${capitalize(nt.size)}`]]}})(({ownerState:tt})=>_extends$t({display:"inherit",marginRight:-4,marginLeft:8},tt.size==="small"&&{marginRight:-2},commonIconStyles(tt))),Button$1=reactExports.forwardRef(function(et,nt){const it=reactExports.useContext(ButtonGroupContext$1),rt=reactExports.useContext(ButtonGroupButtonContext$1),ot=resolveProps(it,et),at=useThemeProps({props:ot,name:"MuiButton"}),{children:st,color:lt="primary",component:ct="button",className:ut,disabled:ht=!1,disableElevation:dt=!1,disableFocusRipple:pt=!1,endIcon:mt,focusVisibleClassName:gt,fullWidth:bt=!1,size:yt="medium",startIcon:wt,type:vt,variant:xt="text"}=at,St=_objectWithoutPropertiesLoose$m(at,_excluded$U),Et=_extends$t({},at,{color:lt,component:ct,disabled:ht,disableElevation:dt,disableFocusRipple:pt,fullWidth:bt,size:yt,type:vt,variant:xt}),$t=useUtilityClasses$r(Et),It=wt&&jsxRuntimeExports.jsx(ButtonStartIcon,{className:$t.startIcon,ownerState:Et,children:wt}),Ft=mt&&jsxRuntimeExports.jsx(ButtonEndIcon,{className:$t.endIcon,ownerState:Et,children:mt}),Ht=rt||"";return jsxRuntimeExports.jsxs(ButtonRoot,_extends$t({ownerState:Et,className:clsx$3(it.className,$t.root,ut,Ht),component:ct,disabled:ht,focusRipple:!pt,focusVisibleClassName:clsx$3($t.focusVisible,gt),ref:nt,type:vt},St,{classes:$t,children:[It,st,Ft]}))}),Button$2=Button$1;function getModalUtilityClass(tt){return generateUtilityClass("MuiModal",tt)}generateUtilityClasses("MuiModal",["root","hidden","backdrop"]);const _excluded$T=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],useUtilityClasses$q=tt=>{const{open:et,exited:nt,classes:it}=tt;return composeClasses({root:["root",!et&&nt&&"hidden"],backdrop:["backdrop"]},getModalUtilityClass,it)},ModalRoot=styled$1("div",{name:"MuiModal",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.open&&nt.exited&&et.hidden]}})(({theme:tt,ownerState:et})=>_extends$t({position:"fixed",zIndex:(tt.vars||tt).zIndex.modal,right:0,bottom:0,top:0,left:0},!et.open&&et.exited&&{visibility:"hidden"})),ModalBackdrop=styled$1(Backdrop$1,{name:"MuiModal",slot:"Backdrop",overridesResolver:(tt,et)=>et.backdrop})({zIndex:-1}),Modal=reactExports.forwardRef(function(et,nt){var it,rt,ot,at,st,lt;const ct=useThemeProps({name:"MuiModal",props:et}),{BackdropComponent:ut=ModalBackdrop,BackdropProps:ht,className:dt,closeAfterTransition:pt=!1,children:mt,container:gt,component:bt,components:yt={},componentsProps:wt={},disableAutoFocus:vt=!1,disableEnforceFocus:xt=!1,disableEscapeKeyDown:St=!1,disablePortal:Et=!1,disableRestoreFocus:$t=!1,disableScrollLock:It=!1,hideBackdrop:Ft=!1,keepMounted:Ht=!1,onBackdropClick:zt,open:Ot,slotProps:jt,slots:kt}=ct,Tt=_objectWithoutPropertiesLoose$m(ct,_excluded$T),Ct=_extends$t({},ct,{closeAfterTransition:pt,disableAutoFocus:vt,disableEnforceFocus:xt,disableEscapeKeyDown:St,disablePortal:Et,disableRestoreFocus:$t,disableScrollLock:It,hideBackdrop:Ft,keepMounted:Ht}),{getRootProps:Ut,getBackdropProps:Nt,getTransitionProps:Bt,portalRef:Mt,isTopModal:Dt,exited:Pt,hasTransition:Vt}=useModal$1(_extends$t({},Ct,{rootRef:nt})),nn=_extends$t({},Ct,{exited:Pt}),cn=useUtilityClasses$q(nn),Xt={};if(mt.props.tabIndex===void 0&&(Xt.tabIndex="-1"),Vt){const{onEnter:En,onExited:In}=Bt();Xt.onEnter=En,Xt.onExited=In}const un=(it=(rt=kt==null?void 0:kt.root)!=null?rt:yt.Root)!=null?it:ModalRoot,en=(ot=(at=kt==null?void 0:kt.backdrop)!=null?at:yt.Backdrop)!=null?ot:ut,fn=(st=jt==null?void 0:jt.root)!=null?st:wt.root,xn=(lt=jt==null?void 0:jt.backdrop)!=null?lt:wt.backdrop,an=useSlotProps({elementType:un,externalSlotProps:fn,externalForwardedProps:Tt,getSlotProps:Ut,additionalProps:{ref:nt,as:bt},ownerState:nn,className:clsx$3(dt,fn==null?void 0:fn.className,cn==null?void 0:cn.root,!nn.open&&nn.exited&&(cn==null?void 0:cn.hidden))}),Zt=useSlotProps({elementType:en,externalSlotProps:xn,additionalProps:ht,getSlotProps:En=>Nt(_extends$t({},En,{onClick:In=>{zt&&zt(In),En!=null&&En.onClick&&En.onClick(In)}})),className:clsx$3(xn==null?void 0:xn.className,ht==null?void 0:ht.className,cn==null?void 0:cn.backdrop),ownerState:nn});return!Ht&&!Ot&&(!Vt||Pt)?null:jsxRuntimeExports.jsx(Portal,{ref:Mt,container:gt,disablePortal:Et,children:jsxRuntimeExports.jsxs(un,_extends$t({},an,{children:[!Ft&&ut?jsxRuntimeExports.jsx(en,_extends$t({},Zt)):null,jsxRuntimeExports.jsx(FocusTrap,{disableEnforceFocus:xt,disableAutoFocus:vt,disableRestoreFocus:$t,isEnabled:Dt,open:Ot,children:reactExports.cloneElement(mt,Xt)})]}))})}),Modal$1=Modal;function getDividerUtilityClass(tt){return generateUtilityClass("MuiDivider",tt)}const dividerClasses=generateUtilityClasses("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),_excluded$S=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],useUtilityClasses$p=tt=>{const{absolute:et,children:nt,classes:it,flexItem:rt,light:ot,orientation:at,textAlign:st,variant:lt}=tt;return composeClasses({root:["root",et&&"absolute",lt,ot&&"light",at==="vertical"&&"vertical",rt&&"flexItem",nt&&"withChildren",nt&&at==="vertical"&&"withChildrenVertical",st==="right"&&at!=="vertical"&&"textAlignRight",st==="left"&&at!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",at==="vertical"&&"wrapperVertical"]},getDividerUtilityClass,it)},DividerRoot=styled$1("div",{name:"MuiDivider",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.absolute&&et.absolute,et[nt.variant],nt.light&&et.light,nt.orientation==="vertical"&&et.vertical,nt.flexItem&&et.flexItem,nt.children&&et.withChildren,nt.children&&nt.orientation==="vertical"&&et.withChildrenVertical,nt.textAlign==="right"&&nt.orientation!=="vertical"&&et.textAlignRight,nt.textAlign==="left"&&nt.orientation!=="vertical"&&et.textAlignLeft]}})(({theme:tt,ownerState:et})=>_extends$t({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(tt.vars||tt).palette.divider,borderBottomWidth:"thin"},et.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},et.light&&{borderColor:tt.vars?`rgba(${tt.vars.palette.dividerChannel} / 0.08)`:alpha$1(tt.palette.divider,.08)},et.variant==="inset"&&{marginLeft:72},et.variant==="middle"&&et.orientation==="horizontal"&&{marginLeft:tt.spacing(2),marginRight:tt.spacing(2)},et.variant==="middle"&&et.orientation==="vertical"&&{marginTop:tt.spacing(1),marginBottom:tt.spacing(1)},et.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},et.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:tt})=>_extends$t({},tt.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:tt,ownerState:et})=>_extends$t({},et.children&&et.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(tt.vars||tt).palette.divider}`}}),({theme:tt,ownerState:et})=>_extends$t({},et.children&&et.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(tt.vars||tt).palette.divider}`}}),({ownerState:tt})=>_extends$t({},tt.textAlign==="right"&&tt.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},tt.textAlign==="left"&&tt.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),DividerWrapper=styled$1("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.wrapper,nt.orientation==="vertical"&&et.wrapperVertical]}})(({theme:tt,ownerState:et})=>_extends$t({display:"inline-block",paddingLeft:`calc(${tt.spacing(1)} * 1.2)`,paddingRight:`calc(${tt.spacing(1)} * 1.2)`},et.orientation==="vertical"&&{paddingTop:`calc(${tt.spacing(1)} * 1.2)`,paddingBottom:`calc(${tt.spacing(1)} * 1.2)`})),Divider$2=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiDivider"}),{absolute:rt=!1,children:ot,className:at,component:st=ot?"div":"hr",flexItem:lt=!1,light:ct=!1,orientation:ut="horizontal",role:ht=st!=="hr"?"separator":void 0,textAlign:dt="center",variant:pt="fullWidth"}=it,mt=_objectWithoutPropertiesLoose$m(it,_excluded$S),gt=_extends$t({},it,{absolute:rt,component:st,flexItem:lt,light:ct,orientation:ut,role:ht,textAlign:dt,variant:pt}),bt=useUtilityClasses$p(gt);return jsxRuntimeExports.jsx(DividerRoot,_extends$t({as:st,className:clsx$3(bt.root,at),role:ht,ref:nt,ownerState:gt},mt,{children:ot?jsxRuntimeExports.jsx(DividerWrapper,{className:bt.wrapper,ownerState:gt,children:ot}):null}))});Divider$2.muiSkipListHighlight=!0;const Divider$3=Divider$2,_excluded$R=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getTranslateValue(tt,et,nt){const it=et.getBoundingClientRect(),rt=nt&&nt.getBoundingClientRect(),ot=ownerWindow(et);let at;if(et.fakeTransform)at=et.fakeTransform;else{const ct=ot.getComputedStyle(et);at=ct.getPropertyValue("-webkit-transform")||ct.getPropertyValue("transform")}let st=0,lt=0;if(at&&at!=="none"&&typeof at=="string"){const ct=at.split("(")[1].split(")")[0].split(",");st=parseInt(ct[4],10),lt=parseInt(ct[5],10)}return tt==="left"?rt?`translateX(${rt.right+st-it.left}px)`:`translateX(${ot.innerWidth+st-it.left}px)`:tt==="right"?rt?`translateX(-${it.right-rt.left-st}px)`:`translateX(-${it.left+it.width-st}px)`:tt==="up"?rt?`translateY(${rt.bottom+lt-it.top}px)`:`translateY(${ot.innerHeight+lt-it.top}px)`:rt?`translateY(-${it.top-rt.top+it.height-lt}px)`:`translateY(-${it.top+it.height-lt}px)`}function resolveContainer(tt){return typeof tt=="function"?tt():tt}function setTranslateValue(tt,et,nt){const it=resolveContainer(nt),rt=getTranslateValue(tt,et,it);rt&&(et.style.webkitTransform=rt,et.style.transform=rt)}const Slide=reactExports.forwardRef(function(et,nt){const it=useTheme(),rt={enter:it.transitions.easing.easeOut,exit:it.transitions.easing.sharp},ot={enter:it.transitions.duration.enteringScreen,exit:it.transitions.duration.leavingScreen},{addEndListener:at,appear:st=!0,children:lt,container:ct,direction:ut="down",easing:ht=rt,in:dt,onEnter:pt,onEntered:mt,onEntering:gt,onExit:bt,onExited:yt,onExiting:wt,style:vt,timeout:xt=ot,TransitionComponent:St=Transition$2}=et,Et=_objectWithoutPropertiesLoose$m(et,_excluded$R),$t=reactExports.useRef(null),It=useForkRef(lt.ref,$t,nt),Ft=Nt=>Bt=>{Nt&&(Bt===void 0?Nt($t.current):Nt($t.current,Bt))},Ht=Ft((Nt,Bt)=>{setTranslateValue(ut,Nt,ct),reflow(Nt),pt&&pt(Nt,Bt)}),zt=Ft((Nt,Bt)=>{const Mt=getTransitionProps({timeout:xt,style:vt,easing:ht},{mode:"enter"});Nt.style.webkitTransition=it.transitions.create("-webkit-transform",_extends$t({},Mt)),Nt.style.transition=it.transitions.create("transform",_extends$t({},Mt)),Nt.style.webkitTransform="none",Nt.style.transform="none",gt&>(Nt,Bt)}),Ot=Ft(mt),jt=Ft(wt),kt=Ft(Nt=>{const Bt=getTransitionProps({timeout:xt,style:vt,easing:ht},{mode:"exit"});Nt.style.webkitTransition=it.transitions.create("-webkit-transform",Bt),Nt.style.transition=it.transitions.create("transform",Bt),setTranslateValue(ut,Nt,ct),bt&&bt(Nt)}),Tt=Ft(Nt=>{Nt.style.webkitTransition="",Nt.style.transition="",yt&&yt(Nt)}),Ct=Nt=>{at&&at($t.current,Nt)},Ut=reactExports.useCallback(()=>{$t.current&&setTranslateValue(ut,$t.current,ct)},[ut,ct]);return reactExports.useEffect(()=>{if(dt||ut==="down"||ut==="right")return;const Nt=debounce$4(()=>{$t.current&&setTranslateValue(ut,$t.current,ct)}),Bt=ownerWindow($t.current);return Bt.addEventListener("resize",Nt),()=>{Nt.clear(),Bt.removeEventListener("resize",Nt)}},[ut,dt,ct]),reactExports.useEffect(()=>{dt||Ut()},[dt,Ut]),jsxRuntimeExports.jsx(St,_extends$t({nodeRef:$t,onEnter:Ht,onEntered:Ot,onEntering:zt,onExit:kt,onExited:Tt,onExiting:jt,addEndListener:Ct,appear:st,in:dt,timeout:xt},Et,{children:(Nt,Bt)=>reactExports.cloneElement(lt,_extends$t({ref:It,style:_extends$t({visibility:Nt==="exited"&&!dt?"hidden":void 0},vt,lt.props.style)},Bt))}))}),Slide$1=Slide,_excluded$Q=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$o=tt=>{const{classes:et,disableUnderline:nt}=tt,rt=composeClasses({root:["root",!nt&&"underline"],input:["input"]},getFilledInputUtilityClass,et);return _extends$t({},et,rt)},FilledInputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[...rootOverridesResolver(tt,et),!nt.disableUnderline&&et.underline]}})(({theme:tt,ownerState:et})=>{var nt;const it=tt.palette.mode==="light",rt=it?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",ot=it?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",at=it?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",st=it?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return _extends$t({position:"relative",backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot,borderTopLeftRadius:(tt.vars||tt).shape.borderRadius,borderTopRightRadius:(tt.vars||tt).shape.borderRadius,transition:tt.transitions.create("background-color",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),"&:hover":{backgroundColor:tt.vars?tt.vars.palette.FilledInput.hoverBg:at,"@media (hover: none)":{backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot}},[`&.${filledInputClasses$1.focused}`]:{backgroundColor:tt.vars?tt.vars.palette.FilledInput.bg:ot},[`&.${filledInputClasses$1.disabled}`]:{backgroundColor:tt.vars?tt.vars.palette.FilledInput.disabledBg:st}},!et.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(nt=(tt.vars||tt).palette[et.color||"primary"])==null?void 0:nt.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:tt.transitions.create("transform",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses$1.error}`]:{"&:before, &:after":{borderBottomColor:(tt.vars||tt).palette.error.main}},"&:before":{borderBottom:`1px solid ${tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / ${tt.vars.opacity.inputUnderline})`:rt}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:tt.transitions.create("border-bottom-color",{duration:tt.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses$1.disabled}, .${filledInputClasses$1.error}):before`]:{borderBottom:`1px solid ${(tt.vars||tt).palette.text.primary}`},[`&.${filledInputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}},et.startAdornment&&{paddingLeft:12},et.endAdornment&&{paddingRight:12},et.multiline&&_extends$t({padding:"25px 12px 8px"},et.size==="small"&&{paddingTop:21,paddingBottom:4},et.hiddenLabel&&{paddingTop:16,paddingBottom:17},et.hiddenLabel&&et.size==="small"&&{paddingTop:8,paddingBottom:9}))}),FilledInputInput=styled$1(InputBaseComponent,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>_extends$t({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!tt.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:tt.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:tt.palette.mode==="light"?null:"#fff",caretColor:tt.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},tt.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[tt.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},et.size==="small"&&{paddingTop:21,paddingBottom:4},et.hiddenLabel&&{paddingTop:16,paddingBottom:17},et.startAdornment&&{paddingLeft:0},et.endAdornment&&{paddingRight:0},et.hiddenLabel&&et.size==="small"&&{paddingTop:8,paddingBottom:9},et.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),FilledInput=reactExports.forwardRef(function(et,nt){var it,rt,ot,at;const st=useThemeProps({props:et,name:"MuiFilledInput"}),{components:lt={},componentsProps:ct,fullWidth:ut=!1,inputComponent:ht="input",multiline:dt=!1,slotProps:pt,slots:mt={},type:gt="text"}=st,bt=_objectWithoutPropertiesLoose$m(st,_excluded$Q),yt=_extends$t({},st,{fullWidth:ut,inputComponent:ht,multiline:dt,type:gt}),wt=useUtilityClasses$o(st),vt={root:{ownerState:yt},input:{ownerState:yt}},xt=pt??ct?deepmerge$1(vt,pt??ct):vt,St=(it=(rt=mt.root)!=null?rt:lt.Root)!=null?it:FilledInputRoot,Et=(ot=(at=mt.input)!=null?at:lt.Input)!=null?ot:FilledInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$t({slots:{root:St,input:Et},componentsProps:xt,fullWidth:ut,inputComponent:ht,multiline:dt,ref:nt,type:gt},bt,{classes:wt}))});FilledInput.muiName="Input";const FilledInput$1=FilledInput;function getFormControlUtilityClasses(tt){return generateUtilityClass("MuiFormControl",tt)}generateUtilityClasses("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _excluded$P=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],useUtilityClasses$n=tt=>{const{classes:et,margin:nt,fullWidth:it}=tt,rt={root:["root",nt!=="none"&&`margin${capitalize(nt)}`,it&&"fullWidth"]};return composeClasses(rt,getFormControlUtilityClasses,et)},FormControlRoot=styled$1("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:tt},et)=>_extends$t({},et.root,et[`margin${capitalize(tt.margin)}`],tt.fullWidth&&et.fullWidth)})(({ownerState:tt})=>_extends$t({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},tt.margin==="normal"&&{marginTop:16,marginBottom:8},tt.margin==="dense"&&{marginTop:8,marginBottom:4},tt.fullWidth&&{width:"100%"})),FormControl=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiFormControl"}),{children:rt,className:ot,color:at="primary",component:st="div",disabled:lt=!1,error:ct=!1,focused:ut,fullWidth:ht=!1,hiddenLabel:dt=!1,margin:pt="none",required:mt=!1,size:gt="medium",variant:bt="outlined"}=it,yt=_objectWithoutPropertiesLoose$m(it,_excluded$P),wt=_extends$t({},it,{color:at,component:st,disabled:lt,error:ct,fullWidth:ht,hiddenLabel:dt,margin:pt,required:mt,size:gt,variant:bt}),vt=useUtilityClasses$n(wt),[xt,St]=reactExports.useState(()=>{let jt=!1;return rt&&reactExports.Children.forEach(rt,kt=>{if(!isMuiElement(kt,["Input","Select"]))return;const Tt=isMuiElement(kt,["Select"])?kt.props.input:kt;Tt&&isAdornedStart(Tt.props)&&(jt=!0)}),jt}),[Et,$t]=reactExports.useState(()=>{let jt=!1;return rt&&reactExports.Children.forEach(rt,kt=>{isMuiElement(kt,["Input","Select"])&&(isFilled(kt.props,!0)||isFilled(kt.props.inputProps,!0))&&(jt=!0)}),jt}),[It,Ft]=reactExports.useState(!1);lt&&It&&Ft(!1);const Ht=ut!==void 0&&!lt?ut:It;let zt;const Ot=reactExports.useMemo(()=>({adornedStart:xt,setAdornedStart:St,color:at,disabled:lt,error:ct,filled:Et,focused:Ht,fullWidth:ht,hiddenLabel:dt,size:gt,onBlur:()=>{Ft(!1)},onEmpty:()=>{$t(!1)},onFilled:()=>{$t(!0)},onFocus:()=>{Ft(!0)},registerEffect:zt,required:mt,variant:bt}),[xt,at,lt,ct,Et,Ht,ht,dt,zt,mt,gt,bt]);return jsxRuntimeExports.jsx(FormControlContext$1.Provider,{value:Ot,children:jsxRuntimeExports.jsx(FormControlRoot,_extends$t({as:st,ownerState:wt,className:clsx$3(vt.root,ot),ref:nt},yt,{children:rt}))})}),FormControl$1=FormControl,Stack$2=createStack({createStyledComponent:styled$1("div",{name:"MuiStack",slot:"Root",overridesResolver:(tt,et)=>et.root}),useThemeProps:tt=>useThemeProps({props:tt,name:"MuiStack"})}),Stack$3=Stack$2;function getFormLabelUtilityClasses(tt){return generateUtilityClass("MuiFormLabel",tt)}const formLabelClasses=generateUtilityClasses("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),formLabelClasses$1=formLabelClasses,_excluded$O=["children","className","color","component","disabled","error","filled","focused","required"],useUtilityClasses$m=tt=>{const{classes:et,color:nt,focused:it,disabled:rt,error:ot,filled:at,required:st}=tt,lt={root:["root",`color${capitalize(nt)}`,rt&&"disabled",ot&&"error",at&&"filled",it&&"focused",st&&"required"],asterisk:["asterisk",ot&&"error"]};return composeClasses(lt,getFormLabelUtilityClasses,et)},FormLabelRoot=styled$1("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:tt},et)=>_extends$t({},et.root,tt.color==="secondary"&&et.colorSecondary,tt.filled&&et.filled)})(({theme:tt,ownerState:et})=>_extends$t({color:(tt.vars||tt).palette.text.secondary},tt.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${formLabelClasses$1.focused}`]:{color:(tt.vars||tt).palette[et.color].main},[`&.${formLabelClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled},[`&.${formLabelClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}})),AsteriskComponent=styled$1("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(tt,et)=>et.asterisk})(({theme:tt})=>({[`&.${formLabelClasses$1.error}`]:{color:(tt.vars||tt).palette.error.main}})),FormLabel=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiFormLabel"}),{children:rt,className:ot,component:at="label"}=it,st=_objectWithoutPropertiesLoose$m(it,_excluded$O),lt=useFormControl(),ct=formControlState({props:it,muiFormControl:lt,states:["color","required","focused","disabled","error","filled"]}),ut=_extends$t({},it,{color:ct.color||"primary",component:at,disabled:ct.disabled,error:ct.error,filled:ct.filled,focused:ct.focused,required:ct.required}),ht=useUtilityClasses$m(ut);return jsxRuntimeExports.jsxs(FormLabelRoot,_extends$t({as:at,ownerState:ut,className:clsx$3(ht.root,ot),ref:nt},st,{children:[rt,ct.required&&jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:ut,"aria-hidden":!0,className:ht.asterisk,children:[" ","*"]})]}))}),FormLabel$1=FormLabel,_excluded$N=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getScale(tt){return`scale(${tt}, ${tt**2})`}const styles$3={entering:{opacity:1,transform:getScale(1)},entered:{opacity:1,transform:"none"}},isWebKit154=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Grow=reactExports.forwardRef(function(et,nt){const{addEndListener:it,appear:rt=!0,children:ot,easing:at,in:st,onEnter:lt,onEntered:ct,onEntering:ut,onExit:ht,onExited:dt,onExiting:pt,style:mt,timeout:gt="auto",TransitionComponent:bt=Transition$2}=et,yt=_objectWithoutPropertiesLoose$m(et,_excluded$N),wt=reactExports.useRef(),vt=reactExports.useRef(),xt=useTheme(),St=reactExports.useRef(null),Et=useForkRef(St,ot.ref,nt),$t=Tt=>Ct=>{if(Tt){const Ut=St.current;Ct===void 0?Tt(Ut):Tt(Ut,Ct)}},It=$t(ut),Ft=$t((Tt,Ct)=>{reflow(Tt);const{duration:Ut,delay:Nt,easing:Bt}=getTransitionProps({style:mt,timeout:gt,easing:at},{mode:"enter"});let Mt;gt==="auto"?(Mt=xt.transitions.getAutoHeightDuration(Tt.clientHeight),vt.current=Mt):Mt=Ut,Tt.style.transition=[xt.transitions.create("opacity",{duration:Mt,delay:Nt}),xt.transitions.create("transform",{duration:isWebKit154?Mt:Mt*.666,delay:Nt,easing:Bt})].join(","),lt&<(Tt,Ct)}),Ht=$t(ct),zt=$t(pt),Ot=$t(Tt=>{const{duration:Ct,delay:Ut,easing:Nt}=getTransitionProps({style:mt,timeout:gt,easing:at},{mode:"exit"});let Bt;gt==="auto"?(Bt=xt.transitions.getAutoHeightDuration(Tt.clientHeight),vt.current=Bt):Bt=Ct,Tt.style.transition=[xt.transitions.create("opacity",{duration:Bt,delay:Ut}),xt.transitions.create("transform",{duration:isWebKit154?Bt:Bt*.666,delay:isWebKit154?Ut:Ut||Bt*.333,easing:Nt})].join(","),Tt.style.opacity=0,Tt.style.transform=getScale(.75),ht&&ht(Tt)}),jt=$t(dt),kt=Tt=>{gt==="auto"&&(wt.current=setTimeout(Tt,vt.current||0)),it&&it(St.current,Tt)};return reactExports.useEffect(()=>()=>{clearTimeout(wt.current)},[]),jsxRuntimeExports.jsx(bt,_extends$t({appear:rt,in:st,nodeRef:St,onEnter:Ft,onEntered:Ht,onEntering:It,onExit:Ot,onExited:jt,onExiting:zt,addEndListener:kt,timeout:gt==="auto"?null:gt},yt,{children:(Tt,Ct)=>reactExports.cloneElement(ot,_extends$t({style:_extends$t({opacity:0,transform:getScale(.75),visibility:Tt==="exited"&&!st?"hidden":void 0},styles$3[Tt],mt,ot.props.style),ref:Et},Ct))}))});Grow.muiSupportAuto=!0;const Grow$1=Grow,_excluded$M=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$l=tt=>{const{classes:et,disableUnderline:nt}=tt,rt=composeClasses({root:["root",!nt&&"underline"],input:["input"]},getInputUtilityClass,et);return _extends$t({},et,rt)},InputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiInput",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[...rootOverridesResolver(tt,et),!nt.disableUnderline&&et.underline]}})(({theme:tt,ownerState:et})=>{let it=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return tt.vars&&(it=`rgba(${tt.vars.palette.common.onBackgroundChannel} / ${tt.vars.opacity.inputUnderline})`),_extends$t({position:"relative"},et.formControl&&{"label + &":{marginTop:16}},!et.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(tt.vars||tt).palette[et.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:tt.transitions.create("transform",{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses$1.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses$1.error}`]:{"&:before, &:after":{borderBottomColor:(tt.vars||tt).palette.error.main}},"&:before":{borderBottom:`1px solid ${it}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:tt.transitions.create("border-bottom-color",{duration:tt.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses$1.disabled}, .${inputClasses$1.error}):before`]:{borderBottom:`2px solid ${(tt.vars||tt).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${it}`}},[`&.${inputClasses$1.disabled}:before`]:{borderBottomStyle:"dotted"}})}),InputInput=styled$1(InputBaseComponent,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input$1=reactExports.forwardRef(function(et,nt){var it,rt,ot,at;const st=useThemeProps({props:et,name:"MuiInput"}),{disableUnderline:lt,components:ct={},componentsProps:ut,fullWidth:ht=!1,inputComponent:dt="input",multiline:pt=!1,slotProps:mt,slots:gt={},type:bt="text"}=st,yt=_objectWithoutPropertiesLoose$m(st,_excluded$M),wt=useUtilityClasses$l(st),xt={root:{ownerState:{disableUnderline:lt}}},St=mt??ut?deepmerge$1(mt??ut,xt):xt,Et=(it=(rt=gt.root)!=null?rt:ct.Root)!=null?it:InputRoot,$t=(ot=(at=gt.input)!=null?at:ct.Input)!=null?ot:InputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$t({slots:{root:Et,input:$t},slotProps:St,fullWidth:ht,inputComponent:dt,multiline:pt,ref:nt,type:bt},yt,{classes:wt}))});Input$1.muiName="Input";const Input$2=Input$1;function getInputLabelUtilityClasses(tt){return generateUtilityClass("MuiInputLabel",tt)}generateUtilityClasses("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const _excluded$L=["disableAnimation","margin","shrink","variant","className"],useUtilityClasses$k=tt=>{const{classes:et,formControl:nt,size:it,shrink:rt,disableAnimation:ot,variant:at,required:st}=tt,lt={root:["root",nt&&"formControl",!ot&&"animated",rt&&"shrink",it&&it!=="normal"&&`size${capitalize(it)}`,at],asterisk:[st&&"asterisk"]},ct=composeClasses(lt,getInputLabelUtilityClasses,et);return _extends$t({},et,ct)},InputLabelRoot=styled$1(FormLabel$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`& .${formLabelClasses$1.asterisk}`]:et.asterisk},et.root,nt.formControl&&et.formControl,nt.size==="small"&&et.sizeSmall,nt.shrink&&et.shrink,!nt.disableAnimation&&et.animated,nt.focused&&et.focused,et[nt.variant]]}})(({theme:tt,ownerState:et})=>_extends$t({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},et.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},et.size==="small"&&{transform:"translate(0, 17px) scale(1)"},et.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!et.disableAnimation&&{transition:tt.transitions.create(["color","transform","max-width"],{duration:tt.transitions.duration.shorter,easing:tt.transitions.easing.easeOut})},et.variant==="filled"&&_extends$t({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},et.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},et.shrink&&_extends$t({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},et.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),et.variant==="outlined"&&_extends$t({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},et.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},et.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),InputLabel=reactExports.forwardRef(function(et,nt){const it=useThemeProps({name:"MuiInputLabel",props:et}),{disableAnimation:rt=!1,shrink:ot,className:at}=it,st=_objectWithoutPropertiesLoose$m(it,_excluded$L),lt=useFormControl();let ct=ot;typeof ct>"u"&<&&(ct=lt.filled||lt.focused||lt.adornedStart);const ut=formControlState({props:it,muiFormControl:lt,states:["size","variant","required","focused"]}),ht=_extends$t({},it,{disableAnimation:rt,formControl:lt,shrink:ct,size:ut.size,variant:ut.variant,required:ut.required,focused:ut.focused}),dt=useUtilityClasses$k(ht);return jsxRuntimeExports.jsx(InputLabelRoot,_extends$t({"data-shrink":ct,ownerState:ht,ref:nt,className:clsx$3(dt.root,at)},st,{classes:dt}))}),InputLabel$1=InputLabel;function getLinearProgressUtilityClass(tt){return generateUtilityClass("MuiLinearProgress",tt)}generateUtilityClasses("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const _excluded$K=["className","color","value","valueBuffer","variant"];let _$1=tt=>tt,_t$1,_t2$1,_t3$1,_t4$1,_t5,_t6;const TRANSITION_DURATION=4,indeterminate1Keyframe=keyframes(_t$1||(_t$1=_$1` 0% { left: -35%; right: 100%; @@ -3626,15 +3626,15 @@ PROCEED WITH CAUTION! opacity: 1; background-position: -200px -23px; } -`)),useUtilityClasses$j=tt=>{const{classes:et,variant:nt,color:it}=tt,rt={root:["root",`color${capitalize(it)}`,nt],dashed:["dashed",`dashedColor${capitalize(it)}`],bar1:["bar",`barColor${capitalize(it)}`,(nt==="indeterminate"||nt==="query")&&"bar1Indeterminate",nt==="determinate"&&"bar1Determinate",nt==="buffer"&&"bar1Buffer"],bar2:["bar",nt!=="buffer"&&`barColor${capitalize(it)}`,nt==="buffer"&&`color${capitalize(it)}`,(nt==="indeterminate"||nt==="query")&&"bar2Indeterminate",nt==="buffer"&&"bar2Buffer"]};return composeClasses(rt,getLinearProgressUtilityClass,et)},getColorShade=(tt,et)=>et==="inherit"?"currentColor":tt.vars?tt.vars.palette.LinearProgress[`${et}Bg`]:tt.palette.mode==="light"?lighten(tt.palette[et].main,.62):darken(tt.palette[et].main,.5),LinearProgressRoot=styled$1("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[`color${capitalize(nt.color)}`],et[nt.variant]]}})(({ownerState:tt,theme:et})=>_extends$u({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:getColorShade(et,tt.color)},tt.color==="inherit"&&tt.variant!=="buffer"&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},tt.variant==="buffer"&&{backgroundColor:"transparent"},tt.variant==="query"&&{transform:"rotate(180deg)"})),LinearProgressDashed=styled$1("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.dashed,et[`dashedColor${capitalize(nt.color)}`]]}})(({ownerState:tt,theme:et})=>{const nt=getColorShade(et,tt.color);return _extends$u({position:"absolute",marginTop:0,height:"100%",width:"100%"},tt.color==="inherit"&&{opacity:.3},{backgroundImage:`radial-gradient(${nt} 0%, ${nt} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},css(_t4$1||(_t4$1=_$1` +`)),useUtilityClasses$j=tt=>{const{classes:et,variant:nt,color:it}=tt,rt={root:["root",`color${capitalize(it)}`,nt],dashed:["dashed",`dashedColor${capitalize(it)}`],bar1:["bar",`barColor${capitalize(it)}`,(nt==="indeterminate"||nt==="query")&&"bar1Indeterminate",nt==="determinate"&&"bar1Determinate",nt==="buffer"&&"bar1Buffer"],bar2:["bar",nt!=="buffer"&&`barColor${capitalize(it)}`,nt==="buffer"&&`color${capitalize(it)}`,(nt==="indeterminate"||nt==="query")&&"bar2Indeterminate",nt==="buffer"&&"bar2Buffer"]};return composeClasses(rt,getLinearProgressUtilityClass,et)},getColorShade=(tt,et)=>et==="inherit"?"currentColor":tt.vars?tt.vars.palette.LinearProgress[`${et}Bg`]:tt.palette.mode==="light"?lighten(tt.palette[et].main,.62):darken(tt.palette[et].main,.5),LinearProgressRoot=styled$1("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[`color${capitalize(nt.color)}`],et[nt.variant]]}})(({ownerState:tt,theme:et})=>_extends$t({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:getColorShade(et,tt.color)},tt.color==="inherit"&&tt.variant!=="buffer"&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},tt.variant==="buffer"&&{backgroundColor:"transparent"},tt.variant==="query"&&{transform:"rotate(180deg)"})),LinearProgressDashed=styled$1("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.dashed,et[`dashedColor${capitalize(nt.color)}`]]}})(({ownerState:tt,theme:et})=>{const nt=getColorShade(et,tt.color);return _extends$t({position:"absolute",marginTop:0,height:"100%",width:"100%"},tt.color==="inherit"&&{opacity:.3},{backgroundImage:`radial-gradient(${nt} 0%, ${nt} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},css(_t4$1||(_t4$1=_$1` animation: ${0} 3s infinite linear; - `),bufferKeyframe)),LinearProgressBar1=styled$1("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.bar,et[`barColor${capitalize(nt.color)}`],(nt.variant==="indeterminate"||nt.variant==="query")&&et.bar1Indeterminate,nt.variant==="determinate"&&et.bar1Determinate,nt.variant==="buffer"&&et.bar1Buffer]}})(({ownerState:tt,theme:et})=>_extends$u({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:tt.color==="inherit"?"currentColor":(et.vars||et).palette[tt.color].main},tt.variant==="determinate"&&{transition:`transform .${TRANSITION_DURATION}s linear`},tt.variant==="buffer"&&{zIndex:1,transition:`transform .${TRANSITION_DURATION}s linear`}),({ownerState:tt})=>(tt.variant==="indeterminate"||tt.variant==="query")&&css(_t5||(_t5=_$1` + `),bufferKeyframe)),LinearProgressBar1=styled$1("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.bar,et[`barColor${capitalize(nt.color)}`],(nt.variant==="indeterminate"||nt.variant==="query")&&et.bar1Indeterminate,nt.variant==="determinate"&&et.bar1Determinate,nt.variant==="buffer"&&et.bar1Buffer]}})(({ownerState:tt,theme:et})=>_extends$t({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:tt.color==="inherit"?"currentColor":(et.vars||et).palette[tt.color].main},tt.variant==="determinate"&&{transition:`transform .${TRANSITION_DURATION}s linear`},tt.variant==="buffer"&&{zIndex:1,transition:`transform .${TRANSITION_DURATION}s linear`}),({ownerState:tt})=>(tt.variant==="indeterminate"||tt.variant==="query")&&css(_t5||(_t5=_$1` width: auto; animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; - `),indeterminate1Keyframe)),LinearProgressBar2=styled$1("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.bar,et[`barColor${capitalize(nt.color)}`],(nt.variant==="indeterminate"||nt.variant==="query")&&et.bar2Indeterminate,nt.variant==="buffer"&&et.bar2Buffer]}})(({ownerState:tt,theme:et})=>_extends$u({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},tt.variant!=="buffer"&&{backgroundColor:tt.color==="inherit"?"currentColor":(et.vars||et).palette[tt.color].main},tt.color==="inherit"&&{opacity:.3},tt.variant==="buffer"&&{backgroundColor:getColorShade(et,tt.color),transition:`transform .${TRANSITION_DURATION}s linear`}),({ownerState:tt})=>(tt.variant==="indeterminate"||tt.variant==="query")&&css(_t6||(_t6=_$1` + `),indeterminate1Keyframe)),LinearProgressBar2=styled$1("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.bar,et[`barColor${capitalize(nt.color)}`],(nt.variant==="indeterminate"||nt.variant==="query")&&et.bar2Indeterminate,nt.variant==="buffer"&&et.bar2Buffer]}})(({ownerState:tt,theme:et})=>_extends$t({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},tt.variant!=="buffer"&&{backgroundColor:tt.color==="inherit"?"currentColor":(et.vars||et).palette[tt.color].main},tt.color==="inherit"&&{opacity:.3},tt.variant==="buffer"&&{backgroundColor:getColorShade(et,tt.color),transition:`transform .${TRANSITION_DURATION}s linear`}),({ownerState:tt})=>(tt.variant==="indeterminate"||tt.variant==="query")&&css(_t6||(_t6=_$1` width: auto; animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; - `),indeterminate2Keyframe)),LinearProgress=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiLinearProgress"}),{className:rt,color:ot="primary",value:at,valueBuffer:st,variant:lt="indeterminate"}=it,ct=_objectWithoutPropertiesLoose$m(it,_excluded$K),ut=_extends$u({},it,{color:ot,variant:lt}),ht=useUtilityClasses$j(ut),dt=useTheme(),pt={},mt={bar1:{},bar2:{}};if((lt==="determinate"||lt==="buffer")&&at!==void 0){pt["aria-valuenow"]=Math.round(at),pt["aria-valuemin"]=0,pt["aria-valuemax"]=100;let gt=at-100;dt.direction==="rtl"&&(gt=-gt),mt.bar1.transform=`translateX(${gt}%)`}if(lt==="buffer"&&st!==void 0){let gt=(st||0)-100;dt.direction==="rtl"&&(gt=-gt),mt.bar2.transform=`translateX(${gt}%)`}return jsxRuntimeExports.jsxs(LinearProgressRoot,_extends$u({className:clsx$3(ht.root,rt),ownerState:ut,role:"progressbar"},pt,{ref:nt},ct,{children:[lt==="buffer"?jsxRuntimeExports.jsx(LinearProgressDashed,{className:ht.dashed,ownerState:ut}):null,jsxRuntimeExports.jsx(LinearProgressBar1,{className:ht.bar1,ownerState:ut,style:mt.bar1}),lt==="determinate"?null:jsxRuntimeExports.jsx(LinearProgressBar2,{className:ht.bar2,ownerState:ut,style:mt.bar2})]}))}),LinearProgress$1=LinearProgress,ListContext=reactExports.createContext({}),ListContext$1=ListContext;function getListUtilityClass(tt){return generateUtilityClass("MuiList",tt)}generateUtilityClasses("MuiList",["root","padding","dense","subheader"]);const _excluded$J=["children","className","component","dense","disablePadding","subheader"],useUtilityClasses$i=tt=>{const{classes:et,disablePadding:nt,dense:it,subheader:rt}=tt;return composeClasses({root:["root",!nt&&"padding",it&&"dense",rt&&"subheader"]},getListUtilityClass,et)},ListRoot=styled$1("ul",{name:"MuiList",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.disablePadding&&et.padding,nt.dense&&et.dense,nt.subheader&&et.subheader]}})(({ownerState:tt})=>_extends$u({listStyle:"none",margin:0,padding:0,position:"relative"},!tt.disablePadding&&{paddingTop:8,paddingBottom:8},tt.subheader&&{paddingTop:0})),List=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiList"}),{children:rt,className:ot,component:at="ul",dense:st=!1,disablePadding:lt=!1,subheader:ct}=it,ut=_objectWithoutPropertiesLoose$m(it,_excluded$J),ht=reactExports.useMemo(()=>({dense:st}),[st]),dt=_extends$u({},it,{component:at,dense:st,disablePadding:lt}),pt=useUtilityClasses$i(dt);return jsxRuntimeExports.jsx(ListContext$1.Provider,{value:ht,children:jsxRuntimeExports.jsxs(ListRoot,_extends$u({as:at,className:clsx$3(pt.root,ot),ref:nt,ownerState:dt},ut,{children:[ct,rt]}))})}),List$1=List,listItemIconClasses=generateUtilityClasses("MuiListItemIcon",["root","alignItemsFlexStart"]),listItemIconClasses$1=listItemIconClasses,listItemTextClasses=generateUtilityClasses("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),listItemTextClasses$1=listItemTextClasses,_excluded$I=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function nextItem$1(tt,et,nt){return tt===et?tt.firstChild:et&&et.nextElementSibling?et.nextElementSibling:nt?null:tt.firstChild}function previousItem$1(tt,et,nt){return tt===et?nt?tt.firstChild:tt.lastChild:et&&et.previousElementSibling?et.previousElementSibling:nt?null:tt.lastChild}function textCriteriaMatches(tt,et){if(et===void 0)return!0;let nt=tt.innerText;return nt===void 0&&(nt=tt.textContent),nt=nt.trim().toLowerCase(),nt.length===0?!1:et.repeating?nt[0]===et.keys[0]:nt.indexOf(et.keys.join(""))===0}function moveFocus$1(tt,et,nt,it,rt,ot){let at=!1,st=rt(tt,et,et?nt:!1);for(;st;){if(st===tt.firstChild){if(at)return!1;at=!0}const lt=it?!1:st.disabled||st.getAttribute("aria-disabled")==="true";if(!st.hasAttribute("tabindex")||!textCriteriaMatches(st,ot)||lt)st=rt(tt,st,nt);else return st.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(et,nt){const{actions:it,autoFocus:rt=!1,autoFocusItem:ot=!1,children:at,className:st,disabledItemsFocusable:lt=!1,disableListWrap:ct=!1,onKeyDown:ut,variant:ht="selectedMenu"}=et,dt=_objectWithoutPropertiesLoose$m(et,_excluded$I),pt=reactExports.useRef(null),mt=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect$1(()=>{rt&&pt.current.focus()},[rt]),reactExports.useImperativeHandle(it,()=>({adjustStyleForScrollbar:(vt,xt)=>{const St=!pt.current.style.width;if(vt.clientHeight{const xt=pt.current,St=vt.key,Et=ownerDocument(xt).activeElement;if(St==="ArrowDown")vt.preventDefault(),moveFocus$1(xt,Et,ct,lt,nextItem$1);else if(St==="ArrowUp")vt.preventDefault(),moveFocus$1(xt,Et,ct,lt,previousItem$1);else if(St==="Home")vt.preventDefault(),moveFocus$1(xt,null,ct,lt,nextItem$1);else if(St==="End")vt.preventDefault(),moveFocus$1(xt,null,ct,lt,previousItem$1);else if(St.length===1){const It=mt.current,Tt=St.toLowerCase(),$t=performance.now();It.keys.length>0&&($t-It.lastTime>500?(It.keys=[],It.repeating=!0,It.previousKeyMatched=!0):It.repeating&&Tt!==It.keys[0]&&(It.repeating=!1)),It.lastTime=$t,It.keys.push(Tt);const Ut=Et&&!It.repeating&&textCriteriaMatches(Et,It);It.previousKeyMatched&&(Ut||moveFocus$1(xt,Et,!1,lt,nextItem$1,It))?vt.preventDefault():It.previousKeyMatched=!1}ut&&ut(vt)},bt=useForkRef(pt,nt);let yt=-1;reactExports.Children.forEach(at,(vt,xt)=>{if(!reactExports.isValidElement(vt)){yt===xt&&(yt+=1,yt>=at.length&&(yt=-1));return}vt.props.disabled||(ht==="selectedMenu"&&vt.props.selected||yt===-1)&&(yt=xt),yt===xt&&(vt.props.disabled||vt.props.muiSkipListHighlight||vt.type.muiSkipListHighlight)&&(yt+=1,yt>=at.length&&(yt=-1))});const wt=reactExports.Children.map(at,(vt,xt)=>{if(xt===yt){const St={};return ot&&(St.autoFocus=!0),vt.props.tabIndex===void 0&&ht==="selectedMenu"&&(St.tabIndex=0),reactExports.cloneElement(vt,St)}return vt});return jsxRuntimeExports.jsx(List$1,_extends$u({role:"menu",ref:bt,className:st,onKeyDown:gt,tabIndex:rt?0:-1},dt,{children:wt}))}),MenuList$1=MenuList;function getPopoverUtilityClass(tt){return generateUtilityClass("MuiPopover",tt)}generateUtilityClasses("MuiPopover",["root","paper"]);const _excluded$G=["onEntering"],_excluded2$8=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],_excluded3$1=["slotProps"];function getOffsetTop(tt,et){let nt=0;return typeof et=="number"?nt=et:et==="center"?nt=tt.height/2:et==="bottom"&&(nt=tt.height),nt}function getOffsetLeft(tt,et){let nt=0;return typeof et=="number"?nt=et:et==="center"?nt=tt.width/2:et==="right"&&(nt=tt.width),nt}function getTransformOriginValue(tt){return[tt.horizontal,tt.vertical].map(et=>typeof et=="number"?`${et}px`:et).join(" ")}function resolveAnchorEl(tt){return typeof tt=="function"?tt():tt}const useUtilityClasses$h=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,et)},PopoverRoot=styled$1(Modal$1,{name:"MuiPopover",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),PopoverPaper=styled$1(MuiPaper,{name:"MuiPopover",slot:"Paper",overridesResolver:(tt,et)=>et.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(et,nt){var it,rt,ot;const at=useThemeProps({props:et,name:"MuiPopover"}),{action:st,anchorEl:lt,anchorOrigin:ct={vertical:"top",horizontal:"left"},anchorPosition:ut,anchorReference:ht="anchorEl",children:dt,className:pt,container:mt,elevation:gt=8,marginThreshold:bt=16,open:yt,PaperProps:wt={},slots:vt,slotProps:xt,transformOrigin:St={vertical:"top",horizontal:"left"},TransitionComponent:Et=Grow$1,transitionDuration:It="auto",TransitionProps:{onEntering:Tt}={},disableScrollLock:$t=!1}=at,Ut=_objectWithoutPropertiesLoose$m(at.TransitionProps,_excluded$G),Lt=_objectWithoutPropertiesLoose$m(at,_excluded2$8),Bt=(it=xt==null?void 0:xt.paper)!=null?it:wt,Pt=reactExports.useRef(),kt=useForkRef(Pt,Bt.ref),At=_extends$u({},at,{anchorOrigin:ct,anchorReference:ht,elevation:gt,marginThreshold:bt,externalPaperSlotProps:Bt,transformOrigin:St,TransitionComponent:Et,transitionDuration:It,TransitionProps:Ut}),Rt=useUtilityClasses$h(At),Wt=reactExports.useCallback(()=>{if(ht==="anchorPosition")return ut;const Sn=resolveAnchorEl(lt),Cn=(Sn&&Sn.nodeType===1?Sn:ownerDocument(Pt.current).body).getBoundingClientRect();return{top:Cn.top+getOffsetTop(Cn,ct.vertical),left:Cn.left+getOffsetLeft(Cn,ct.horizontal)}},[lt,ct.horizontal,ct.vertical,ut,ht]),jt=reactExports.useCallback(Sn=>({vertical:getOffsetTop(Sn,St.vertical),horizontal:getOffsetLeft(Sn,St.horizontal)}),[St.horizontal,St.vertical]),Ot=reactExports.useCallback(Sn=>{const Tn={width:Sn.offsetWidth,height:Sn.offsetHeight},Cn=jt(Tn);if(ht==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue(Cn)};const jn=Wt();let Un=jn.top-Cn.vertical,yn=jn.left-Cn.horizontal;const un=Un+Tn.height,En=yn+Tn.width,In=ownerWindow(resolveAnchorEl(lt)),xn=In.innerHeight-bt,dn=In.innerWidth-bt;if(bt!==null&&Unxn){const cn=un-xn;Un-=cn,Cn.vertical+=cn}if(bt!==null&&yndn){const cn=En-dn;yn-=cn,Cn.horizontal+=cn}return{top:`${Math.round(Un)}px`,left:`${Math.round(yn)}px`,transformOrigin:getTransformOriginValue(Cn)}},[lt,ht,Wt,jt,bt]),[Ct,Dt]=reactExports.useState(yt),Mt=reactExports.useCallback(()=>{const Sn=Pt.current;if(!Sn)return;const Tn=Ot(Sn);Tn.top!==null&&(Sn.style.top=Tn.top),Tn.left!==null&&(Sn.style.left=Tn.left),Sn.style.transformOrigin=Tn.transformOrigin,Dt(!0)},[Ot]);reactExports.useEffect(()=>($t&&window.addEventListener("scroll",Mt),()=>window.removeEventListener("scroll",Mt)),[lt,$t,Mt]);const Vt=(Sn,Tn)=>{Tt&&Tt(Sn,Tn),Mt()},Qt=()=>{Dt(!1)};reactExports.useEffect(()=>{yt&&Mt()}),reactExports.useImperativeHandle(st,()=>yt?{updatePosition:()=>{Mt()}}:null,[yt,Mt]),reactExports.useEffect(()=>{if(!yt)return;const Sn=debounce$4(()=>{Mt()}),Tn=ownerWindow(lt);return Tn.addEventListener("resize",Sn),()=>{Sn.clear(),Tn.removeEventListener("resize",Sn)}},[lt,yt,Mt]);let rn=It;It==="auto"&&!Et.muiSupportAuto&&(rn=void 0);const Xt=mt||(lt?ownerDocument(resolveAnchorEl(lt)).body:void 0),an=(rt=vt==null?void 0:vt.root)!=null?rt:PopoverRoot,tn=(ot=vt==null?void 0:vt.paper)!=null?ot:PopoverPaper,pn=useSlotProps({elementType:tn,externalSlotProps:_extends$u({},Bt,{style:Ct?Bt.style:_extends$u({},Bt.style,{opacity:0})}),additionalProps:{elevation:gt,ref:kt},ownerState:At,className:clsx$3(Rt.paper,Bt==null?void 0:Bt.className)}),vn=useSlotProps({elementType:an,externalSlotProps:(xt==null?void 0:xt.root)||{},externalForwardedProps:Lt,additionalProps:{ref:nt,slotProps:{backdrop:{invisible:!0}},container:Xt,open:yt},ownerState:At,className:clsx$3(Rt.root,pt)}),{slotProps:sn}=vn,Zt=_objectWithoutPropertiesLoose$m(vn,_excluded3$1);return jsxRuntimeExports.jsx(an,_extends$u({},Zt,!isHostComponent(an)&&{slotProps:sn,disableScrollLock:$t},{children:jsxRuntimeExports.jsx(Et,_extends$u({appear:!0,in:yt,onEntering:Vt,onExited:Qt,timeout:rn},Ut,{children:jsxRuntimeExports.jsx(tn,_extends$u({},pn,{children:dt}))}))}))}),Popover$1=Popover;function getMenuUtilityClass(tt){return generateUtilityClass("MuiMenu",tt)}generateUtilityClasses("MuiMenu",["root","paper","list"]);const _excluded$F=["onEntering"],_excluded2$7=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$g=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,et)},MenuRoot=styled$1(Popover$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),MenuPaper=styled$1(PopoverPaper,{name:"MuiMenu",slot:"Paper",overridesResolver:(tt,et)=>et.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled$1(MenuList$1,{name:"MuiMenu",slot:"List",overridesResolver:(tt,et)=>et.list})({outline:0}),Menu=reactExports.forwardRef(function(et,nt){var it,rt;const ot=useThemeProps({props:et,name:"MuiMenu"}),{autoFocus:at=!0,children:st,className:lt,disableAutoFocusItem:ct=!1,MenuListProps:ut={},onClose:ht,open:dt,PaperProps:pt={},PopoverClasses:mt,transitionDuration:gt="auto",TransitionProps:{onEntering:bt}={},variant:yt="selectedMenu",slots:wt={},slotProps:vt={}}=ot,xt=_objectWithoutPropertiesLoose$m(ot.TransitionProps,_excluded$F),St=_objectWithoutPropertiesLoose$m(ot,_excluded2$7),Et=useTheme(),It=Et.direction==="rtl",Tt=_extends$u({},ot,{autoFocus:at,disableAutoFocusItem:ct,MenuListProps:ut,onEntering:bt,PaperProps:pt,transitionDuration:gt,TransitionProps:xt,variant:yt}),$t=useUtilityClasses$g(Tt),Ut=at&&!ct&&dt,Lt=reactExports.useRef(null),Bt=(Ot,Ct)=>{Lt.current&&Lt.current.adjustStyleForScrollbar(Ot,Et),bt&&bt(Ot,Ct)},Pt=Ot=>{Ot.key==="Tab"&&(Ot.preventDefault(),ht&&ht(Ot,"tabKeyDown"))};let kt=-1;reactExports.Children.map(st,(Ot,Ct)=>{reactExports.isValidElement(Ot)&&(Ot.props.disabled||(yt==="selectedMenu"&&Ot.props.selected||kt===-1)&&(kt=Ct))});const At=(it=wt.paper)!=null?it:MenuPaper,Rt=(rt=vt.paper)!=null?rt:pt,Wt=useSlotProps({elementType:wt.root,externalSlotProps:vt.root,ownerState:Tt,className:[$t.root,lt]}),jt=useSlotProps({elementType:At,externalSlotProps:Rt,ownerState:Tt,className:$t.paper});return jsxRuntimeExports.jsx(MenuRoot,_extends$u({onClose:ht,anchorOrigin:{vertical:"bottom",horizontal:It?"right":"left"},transformOrigin:It?RTL_ORIGIN:LTR_ORIGIN,slots:{paper:At,root:wt.root},slotProps:{root:Wt,paper:jt},open:dt,ref:nt,transitionDuration:gt,TransitionProps:_extends$u({onEntering:Bt},xt),ownerState:Tt},St,{classes:mt,children:jsxRuntimeExports.jsx(MenuMenuList,_extends$u({onKeyDown:Pt,actions:Lt,autoFocus:at&&(kt===-1||ct),autoFocusItem:Ut,variant:yt},ut,{className:clsx$3($t.list,ut.className),children:st}))}))}),Menu$1=Menu;function getMenuItemUtilityClass(tt){return generateUtilityClass("MuiMenuItem",tt)}const menuItemClasses=generateUtilityClasses("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),menuItemClasses$1=menuItemClasses,_excluded$E=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],overridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.dense&&et.dense,nt.divider&&et.divider,!nt.disableGutters&&et.gutters]},useUtilityClasses$f=tt=>{const{disabled:et,dense:nt,divider:it,disableGutters:rt,selected:ot,classes:at}=tt,lt=composeClasses({root:["root",nt&&"dense",et&&"disabled",!rt&&"gutters",it&&"divider",ot&&"selected"]},getMenuItemUtilityClass,at);return _extends$u({},at,lt)},MenuItemRoot=styled$1(ButtonBase$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!et.disableGutters&&{paddingLeft:16,paddingRight:16},et.divider&&{borderBottom:`1px solid ${(tt.vars||tt).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(tt.vars||tt).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${menuItemClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),[`&.${menuItemClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)}},[`&.${menuItemClasses$1.selected}:hover`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity)}},[`&.${menuItemClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette.action.focus},[`&.${menuItemClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity},[`& + .${dividerClasses.root}`]:{marginTop:tt.spacing(1),marginBottom:tt.spacing(1)},[`& + .${dividerClasses.inset}`]:{marginLeft:52},[`& .${listItemTextClasses$1.root}`]:{marginTop:0,marginBottom:0},[`& .${listItemTextClasses$1.inset}`]:{paddingLeft:36},[`& .${listItemIconClasses$1.root}`]:{minWidth:36}},!et.dense&&{[tt.breakpoints.up("sm")]:{minHeight:"auto"}},et.dense&&_extends$u({minHeight:32,paddingTop:4,paddingBottom:4},tt.typography.body2,{[`& .${listItemIconClasses$1.root} svg`]:{fontSize:"1.25rem"}}))),MenuItem$5=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiMenuItem"}),{autoFocus:rt=!1,component:ot="li",dense:at=!1,divider:st=!1,disableGutters:lt=!1,focusVisibleClassName:ct,role:ut="menuitem",tabIndex:ht,className:dt}=it,pt=_objectWithoutPropertiesLoose$m(it,_excluded$E),mt=reactExports.useContext(ListContext$1),gt=reactExports.useMemo(()=>({dense:at||mt.dense||!1,disableGutters:lt}),[mt.dense,at,lt]),bt=reactExports.useRef(null);useEnhancedEffect$1(()=>{rt&&bt.current&&bt.current.focus()},[rt]);const yt=_extends$u({},it,{dense:gt.dense,divider:st,disableGutters:lt}),wt=useUtilityClasses$f(it),vt=useForkRef(bt,nt);let xt;return it.disabled||(xt=ht!==void 0?ht:-1),jsxRuntimeExports.jsx(ListContext$1.Provider,{value:gt,children:jsxRuntimeExports.jsx(MenuItemRoot,_extends$u({ref:vt,role:ut,tabIndex:xt,component:ot,focusVisibleClassName:clsx$3(wt.focusVisible,ct),className:clsx$3(wt.root,dt)},pt,{ownerState:yt,classes:wt}))})}),MenuItem$6=MenuItem$5;function getNativeSelectUtilityClasses(tt){return generateUtilityClass("MuiNativeSelect",tt)}const nativeSelectClasses=generateUtilityClasses("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),nativeSelectClasses$1=nativeSelectClasses,_excluded$D=["className","disabled","error","IconComponent","inputRef","variant"],useUtilityClasses$e=tt=>{const{classes:et,variant:nt,disabled:it,multiple:rt,open:ot,error:at}=tt,st={select:["select",nt,it&&"disabled",rt&&"multiple",at&&"error"],icon:["icon",`icon${capitalize(nt)}`,ot&&"iconOpen",it&&"disabled"]};return composeClasses(st,getNativeSelectUtilityClasses,et)},nativeSelectSelectStyles=({ownerState:tt,theme:et})=>_extends$u({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":_extends$u({},et.vars?{backgroundColor:`rgba(${et.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:et.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nativeSelectClasses$1.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(et.vars||et).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},tt.variant==="filled"&&{"&&&":{paddingRight:32}},tt.variant==="outlined"&&{borderRadius:(et.vars||et).shape.borderRadius,"&:focus":{borderRadius:(et.vars||et).shape.borderRadius},"&&&":{paddingRight:32}}),NativeSelectSelect=styled$1("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.select,et[nt.variant],nt.error&&et.error,{[`&.${nativeSelectClasses$1.multiple}`]:et.multiple}]}})(nativeSelectSelectStyles),nativeSelectIconStyles=({ownerState:tt,theme:et})=>_extends$u({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(et.vars||et).palette.action.active,[`&.${nativeSelectClasses$1.disabled}`]:{color:(et.vars||et).palette.action.disabled}},tt.open&&{transform:"rotate(180deg)"},tt.variant==="filled"&&{right:7},tt.variant==="outlined"&&{right:7}),NativeSelectIcon=styled$1("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.icon,nt.variant&&et[`icon${capitalize(nt.variant)}`],nt.open&&et.iconOpen]}})(nativeSelectIconStyles),NativeSelectInput=reactExports.forwardRef(function(et,nt){const{className:it,disabled:rt,error:ot,IconComponent:at,inputRef:st,variant:lt="standard"}=et,ct=_objectWithoutPropertiesLoose$m(et,_excluded$D),ut=_extends$u({},et,{disabled:rt,variant:lt,error:ot}),ht=useUtilityClasses$e(ut);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,_extends$u({ownerState:ut,className:clsx$3(ht.select,it),disabled:rt,ref:st||nt},ct)),et.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:at,ownerState:ut,className:ht.icon})]})}),NativeSelectInput$1=NativeSelectInput;var _span$1;const _excluded$C=["children","classes","className","label","notched"],NotchedOutlineRoot$1=styled$1("fieldset",{shouldForwardProp:rootShouldForwardProp})({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%"}),NotchedOutlineLegend=styled$1("legend",{shouldForwardProp:rootShouldForwardProp})(({ownerState:tt,theme:et})=>_extends$u({float:"unset",width:"auto",overflow:"hidden"},!tt.withLabel&&{padding:0,lineHeight:"11px",transition:et.transitions.create("width",{duration:150,easing:et.transitions.easing.easeOut})},tt.withLabel&&_extends$u({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:et.transitions.create("max-width",{duration:50,easing:et.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},tt.notched&&{maxWidth:"100%",transition:et.transitions.create("max-width",{duration:100,easing:et.transitions.easing.easeOut,delay:50})})));function NotchedOutline(tt){const{className:et,label:nt,notched:it}=tt,rt=_objectWithoutPropertiesLoose$m(tt,_excluded$C),ot=nt!=null&&nt!=="",at=_extends$u({},tt,{notched:it,withLabel:ot});return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,_extends$u({"aria-hidden":!0,className:et,ownerState:at},rt,{children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:at,children:ot?jsxRuntimeExports.jsx("span",{children:nt}):_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"}))})}))}const _excluded$B=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],useUtilityClasses$d=tt=>{const{classes:et}=tt,it=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,et);return _extends$u({},et,it)},OutlinedInputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return _extends$u({position:"relative",borderRadius:(tt.vars||tt).shape.borderRadius,[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / 0.23)`:nt}},[`&.${outlinedInputClasses$1.focused} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette[et.color].main,borderWidth:2},[`&.${outlinedInputClasses$1.error} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.error.main},[`&.${outlinedInputClasses$1.disabled} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.action.disabled}},et.startAdornment&&{paddingLeft:14},et.endAdornment&&{paddingRight:14},et.multiline&&_extends$u({padding:"16.5px 14px"},et.size==="small"&&{padding:"8.5px 14px"}))}),NotchedOutlineRoot=styled$1(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(tt,et)=>et.notchedOutline})(({theme:tt})=>{const et=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / 0.23)`:et}}),OutlinedInputInput=styled$1(InputBaseComponent,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>_extends$u({padding:"16.5px 14px"},!tt.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:tt.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:tt.palette.mode==="light"?null:"#fff",caretColor:tt.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},tt.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[tt.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},et.size==="small"&&{padding:"8.5px 14px"},et.multiline&&{padding:0},et.startAdornment&&{paddingLeft:0},et.endAdornment&&{paddingRight:0})),OutlinedInput=reactExports.forwardRef(function(et,nt){var it,rt,ot,at,st;const lt=useThemeProps({props:et,name:"MuiOutlinedInput"}),{components:ct={},fullWidth:ut=!1,inputComponent:ht="input",label:dt,multiline:pt=!1,notched:mt,slots:gt={},type:bt="text"}=lt,yt=_objectWithoutPropertiesLoose$m(lt,_excluded$B),wt=useUtilityClasses$d(lt),vt=useFormControl(),xt=formControlState({props:lt,muiFormControl:vt,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),St=_extends$u({},lt,{color:xt.color||"primary",disabled:xt.disabled,error:xt.error,focused:xt.focused,formControl:vt,fullWidth:ut,hiddenLabel:xt.hiddenLabel,multiline:pt,size:xt.size,type:bt}),Et=(it=(rt=gt.root)!=null?rt:ct.Root)!=null?it:OutlinedInputRoot,It=(ot=(at=gt.input)!=null?at:ct.Input)!=null?ot:OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$u({slots:{root:Et,input:It},renderSuffix:Tt=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:St,className:wt.notchedOutline,label:dt!=null&&dt!==""&&xt.required?st||(st=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[dt," ","*"]})):dt,notched:typeof mt<"u"?mt:!!(Tt.startAdornment||Tt.filled||Tt.focused)}),fullWidth:ut,inputComponent:ht,multiline:pt,ref:nt,type:bt},yt,{classes:_extends$u({},wt,{notchedOutline:null})}))});OutlinedInput.muiName="Input";const OutlinedInput$1=OutlinedInput;function getSelectUtilityClasses(tt){return generateUtilityClass("MuiSelect",tt)}const selectClasses=generateUtilityClasses("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),selectClasses$1=selectClasses;var _span;const _excluded$A=["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"],SelectSelect=styled$1("div",{name:"MuiSelect",slot:"Select",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`&.${selectClasses$1.select}`]:et.select},{[`&.${selectClasses$1.select}`]:et[nt.variant]},{[`&.${selectClasses$1.error}`]:et.error},{[`&.${selectClasses$1.multiple}`]:et.multiple}]}})(nativeSelectSelectStyles,{[`&.${selectClasses$1.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled$1("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.icon,nt.variant&&et[`icon${capitalize(nt.variant)}`],nt.open&&et.iconOpen]}})(nativeSelectIconStyles),SelectNativeInput=styled$1("input",{shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(tt,et)=>et.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues(tt,et){return typeof et=="object"&&et!==null?tt===et:String(tt)===String(et)}function isEmpty(tt){return tt==null||typeof tt=="string"&&!tt.trim()}const useUtilityClasses$c=tt=>{const{classes:et,variant:nt,disabled:it,multiple:rt,open:ot,error:at}=tt,st={select:["select",nt,it&&"disabled",rt&&"multiple",at&&"error"],icon:["icon",`icon${capitalize(nt)}`,ot&&"iconOpen",it&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(st,getSelectUtilityClasses,et)},SelectInput=reactExports.forwardRef(function(et,nt){var it;const{"aria-describedby":rt,"aria-label":ot,autoFocus:at,autoWidth:st,children:lt,className:ct,defaultOpen:ut,defaultValue:ht,disabled:dt,displayEmpty:pt,error:mt=!1,IconComponent:gt,inputRef:bt,labelId:yt,MenuProps:wt={},multiple:vt,name:xt,onBlur:St,onChange:Et,onClose:It,onFocus:Tt,onOpen:$t,open:Ut,readOnly:Lt,renderValue:Bt,SelectDisplayProps:Pt={},tabIndex:kt,value:At,variant:Rt="standard"}=et,Wt=_objectWithoutPropertiesLoose$m(et,_excluded$A),[jt,Ot]=useControlled({controlled:At,default:ht,name:"Select"}),[Ct,Dt]=useControlled({controlled:Ut,default:ut,name:"Select"}),Mt=reactExports.useRef(null),Vt=reactExports.useRef(null),[Qt,rn]=reactExports.useState(null),{current:Xt}=reactExports.useRef(Ut!=null),[an,tn]=reactExports.useState(),pn=useForkRef(nt,bt),vn=reactExports.useCallback(qn=>{Vt.current=qn,qn&&rn(qn)},[]),sn=Qt==null?void 0:Qt.parentNode;reactExports.useImperativeHandle(pn,()=>({focus:()=>{Vt.current.focus()},node:Mt.current,value:jt}),[jt]),reactExports.useEffect(()=>{ut&&Ct&&Qt&&!Xt&&(tn(st?null:sn.clientWidth),Vt.current.focus())},[Qt,st]),reactExports.useEffect(()=>{at&&Vt.current.focus()},[at]),reactExports.useEffect(()=>{if(!yt)return;const qn=ownerDocument(Vt.current).getElementById(yt);if(qn){const Wn=()=>{getSelection().isCollapsed&&Vt.current.focus()};return qn.addEventListener("click",Wn),()=>{qn.removeEventListener("click",Wn)}}},[yt]);const Zt=(qn,Wn)=>{qn?$t&&$t(Wn):It&&It(Wn),Xt||(tn(st?null:sn.clientWidth),Dt(qn))},Sn=qn=>{qn.button===0&&(qn.preventDefault(),Vt.current.focus(),Zt(!0,qn))},Tn=qn=>{Zt(!1,qn)},Cn=reactExports.Children.toArray(lt),jn=qn=>{const Wn=Cn.find(Vn=>Vn.props.value===qn.target.value);Wn!==void 0&&(Ot(Wn.props.value),Et&&Et(qn,Wn))},Un=qn=>Wn=>{let Vn;if(Wn.currentTarget.hasAttribute("tabindex")){if(vt){Vn=Array.isArray(jt)?jt.slice():[];const Fn=jt.indexOf(qn.props.value);Fn===-1?Vn.push(qn.props.value):Vn.splice(Fn,1)}else Vn=qn.props.value;if(qn.props.onClick&&qn.props.onClick(Wn),jt!==Vn&&(Ot(Vn),Et)){const Fn=Wn.nativeEvent||Wn,Jn=new Fn.constructor(Fn.type,Fn);Object.defineProperty(Jn,"target",{writable:!0,value:{value:Vn,name:xt}}),Et(Jn,qn)}vt||Zt(!1,Wn)}},yn=qn=>{Lt||[" ","ArrowUp","ArrowDown","Enter"].indexOf(qn.key)!==-1&&(qn.preventDefault(),Zt(!0,qn))},un=Qt!==null&&Ct,En=qn=>{!un&&St&&(Object.defineProperty(qn,"target",{writable:!0,value:{value:jt,name:xt}}),St(qn))};delete Wt["aria-invalid"];let In,xn;const dn=[];let cn=!1;(isFilled({value:jt})||pt)&&(Bt?In=Bt(jt):cn=!0);const hn=Cn.map(qn=>{if(!reactExports.isValidElement(qn))return null;let Wn;if(vt){if(!Array.isArray(jt))throw new Error(formatMuiErrorMessage(2));Wn=jt.some(Vn=>areEqualValues(Vn,qn.props.value)),Wn&&cn&&dn.push(qn.props.children)}else Wn=areEqualValues(jt,qn.props.value),Wn&&cn&&(xn=qn.props.children);return reactExports.cloneElement(qn,{"aria-selected":Wn?"true":"false",onClick:Un(qn),onKeyUp:Vn=>{Vn.key===" "&&Vn.preventDefault(),qn.props.onKeyUp&&qn.props.onKeyUp(Vn)},role:"option",selected:Wn,value:void 0,"data-value":qn.props.value})});cn&&(vt?dn.length===0?In=null:In=dn.reduce((qn,Wn,Vn)=>(qn.push(Wn),Vn{const{classes:et}=tt;return et},styledRootConfig={name:"MuiSelect",overridesResolver:(tt,et)=>et.root,shouldForwardProp:tt=>rootShouldForwardProp(tt)&&tt!=="variant",slot:"Root"},StyledInput$1=styled$1(Input$2,styledRootConfig)(""),StyledOutlinedInput=styled$1(OutlinedInput$1,styledRootConfig)(""),StyledFilledInput=styled$1(FilledInput$1,styledRootConfig)(""),Select$2=reactExports.forwardRef(function(et,nt){const it=useThemeProps({name:"MuiSelect",props:et}),{autoWidth:rt=!1,children:ot,classes:at={},className:st,defaultOpen:lt=!1,displayEmpty:ct=!1,IconComponent:ut=ArrowDropDownIcon,id:ht,input:dt,inputProps:pt,label:mt,labelId:gt,MenuProps:bt,multiple:yt=!1,native:wt=!1,onClose:vt,onOpen:xt,open:St,renderValue:Et,SelectDisplayProps:It,variant:Tt="outlined"}=it,$t=_objectWithoutPropertiesLoose$m(it,_excluded$z),Ut=wt?NativeSelectInput$1:SelectInput$1,Lt=useFormControl(),Bt=formControlState({props:it,muiFormControl:Lt,states:["variant","error"]}),Pt=Bt.variant||Tt,kt=_extends$u({},it,{variant:Pt,classes:at}),At=useUtilityClasses$b(kt),Rt=_objectWithoutPropertiesLoose$m(At,_excluded2$6),Wt=dt||{standard:jsxRuntimeExports.jsx(StyledInput$1,{ownerState:kt}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:mt,ownerState:kt}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:kt})}[Pt],jt=useForkRef(nt,Wt.ref);return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(Wt,_extends$u({inputComponent:Ut,inputProps:_extends$u({children:ot,error:Bt.error,IconComponent:ut,variant:Pt,type:void 0,multiple:yt},wt?{id:ht}:{autoWidth:rt,defaultOpen:lt,displayEmpty:ct,labelId:gt,MenuProps:bt,onClose:vt,onOpen:xt,open:St,renderValue:Et,SelectDisplayProps:_extends$u({id:ht},It)},pt,{classes:pt?deepmerge$1(Rt,pt.classes):Rt},dt?dt.props.inputProps:{})},yt&&wt&&Pt==="outlined"?{notched:!0}:{},{ref:jt,className:clsx$3(Wt.props.className,st,At.root)},!dt&&{variant:Pt},$t))})});Select$2.muiName="Select";const Select$3=Select$2;function getSkeletonUtilityClass(tt){return generateUtilityClass("MuiSkeleton",tt)}generateUtilityClasses("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const _excluded$y=["animation","className","component","height","style","variant","width"];let _=tt=>tt,_t,_t2,_t3,_t4;const useUtilityClasses$a=tt=>{const{classes:et,variant:nt,animation:it,hasChildren:rt,width:ot,height:at}=tt;return composeClasses({root:["root",nt,it,rt&&"withChildren",rt&&!ot&&"fitContent",rt&&!at&&"heightAuto"]},getSkeletonUtilityClass,et)},pulseKeyframe=keyframes(_t||(_t=_` + `),indeterminate2Keyframe)),LinearProgress=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiLinearProgress"}),{className:rt,color:ot="primary",value:at,valueBuffer:st,variant:lt="indeterminate"}=it,ct=_objectWithoutPropertiesLoose$m(it,_excluded$K),ut=_extends$t({},it,{color:ot,variant:lt}),ht=useUtilityClasses$j(ut),dt=useTheme(),pt={},mt={bar1:{},bar2:{}};if((lt==="determinate"||lt==="buffer")&&at!==void 0){pt["aria-valuenow"]=Math.round(at),pt["aria-valuemin"]=0,pt["aria-valuemax"]=100;let gt=at-100;dt.direction==="rtl"&&(gt=-gt),mt.bar1.transform=`translateX(${gt}%)`}if(lt==="buffer"&&st!==void 0){let gt=(st||0)-100;dt.direction==="rtl"&&(gt=-gt),mt.bar2.transform=`translateX(${gt}%)`}return jsxRuntimeExports.jsxs(LinearProgressRoot,_extends$t({className:clsx$3(ht.root,rt),ownerState:ut,role:"progressbar"},pt,{ref:nt},ct,{children:[lt==="buffer"?jsxRuntimeExports.jsx(LinearProgressDashed,{className:ht.dashed,ownerState:ut}):null,jsxRuntimeExports.jsx(LinearProgressBar1,{className:ht.bar1,ownerState:ut,style:mt.bar1}),lt==="determinate"?null:jsxRuntimeExports.jsx(LinearProgressBar2,{className:ht.bar2,ownerState:ut,style:mt.bar2})]}))}),LinearProgress$1=LinearProgress,ListContext=reactExports.createContext({}),ListContext$1=ListContext;function getListUtilityClass(tt){return generateUtilityClass("MuiList",tt)}generateUtilityClasses("MuiList",["root","padding","dense","subheader"]);const _excluded$J=["children","className","component","dense","disablePadding","subheader"],useUtilityClasses$i=tt=>{const{classes:et,disablePadding:nt,dense:it,subheader:rt}=tt;return composeClasses({root:["root",!nt&&"padding",it&&"dense",rt&&"subheader"]},getListUtilityClass,et)},ListRoot=styled$1("ul",{name:"MuiList",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,!nt.disablePadding&&et.padding,nt.dense&&et.dense,nt.subheader&&et.subheader]}})(({ownerState:tt})=>_extends$t({listStyle:"none",margin:0,padding:0,position:"relative"},!tt.disablePadding&&{paddingTop:8,paddingBottom:8},tt.subheader&&{paddingTop:0})),List=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiList"}),{children:rt,className:ot,component:at="ul",dense:st=!1,disablePadding:lt=!1,subheader:ct}=it,ut=_objectWithoutPropertiesLoose$m(it,_excluded$J),ht=reactExports.useMemo(()=>({dense:st}),[st]),dt=_extends$t({},it,{component:at,dense:st,disablePadding:lt}),pt=useUtilityClasses$i(dt);return jsxRuntimeExports.jsx(ListContext$1.Provider,{value:ht,children:jsxRuntimeExports.jsxs(ListRoot,_extends$t({as:at,className:clsx$3(pt.root,ot),ref:nt,ownerState:dt},ut,{children:[ct,rt]}))})}),List$1=List,listItemIconClasses=generateUtilityClasses("MuiListItemIcon",["root","alignItemsFlexStart"]),listItemIconClasses$1=listItemIconClasses,listItemTextClasses=generateUtilityClasses("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),listItemTextClasses$1=listItemTextClasses,_excluded$I=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function nextItem$1(tt,et,nt){return tt===et?tt.firstChild:et&&et.nextElementSibling?et.nextElementSibling:nt?null:tt.firstChild}function previousItem$1(tt,et,nt){return tt===et?nt?tt.firstChild:tt.lastChild:et&&et.previousElementSibling?et.previousElementSibling:nt?null:tt.lastChild}function textCriteriaMatches(tt,et){if(et===void 0)return!0;let nt=tt.innerText;return nt===void 0&&(nt=tt.textContent),nt=nt.trim().toLowerCase(),nt.length===0?!1:et.repeating?nt[0]===et.keys[0]:nt.indexOf(et.keys.join(""))===0}function moveFocus$1(tt,et,nt,it,rt,ot){let at=!1,st=rt(tt,et,et?nt:!1);for(;st;){if(st===tt.firstChild){if(at)return!1;at=!0}const lt=it?!1:st.disabled||st.getAttribute("aria-disabled")==="true";if(!st.hasAttribute("tabindex")||!textCriteriaMatches(st,ot)||lt)st=rt(tt,st,nt);else return st.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(et,nt){const{actions:it,autoFocus:rt=!1,autoFocusItem:ot=!1,children:at,className:st,disabledItemsFocusable:lt=!1,disableListWrap:ct=!1,onKeyDown:ut,variant:ht="selectedMenu"}=et,dt=_objectWithoutPropertiesLoose$m(et,_excluded$I),pt=reactExports.useRef(null),mt=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect$1(()=>{rt&&pt.current.focus()},[rt]),reactExports.useImperativeHandle(it,()=>({adjustStyleForScrollbar:(vt,xt)=>{const St=!pt.current.style.width;if(vt.clientHeight{const xt=pt.current,St=vt.key,Et=ownerDocument(xt).activeElement;if(St==="ArrowDown")vt.preventDefault(),moveFocus$1(xt,Et,ct,lt,nextItem$1);else if(St==="ArrowUp")vt.preventDefault(),moveFocus$1(xt,Et,ct,lt,previousItem$1);else if(St==="Home")vt.preventDefault(),moveFocus$1(xt,null,ct,lt,nextItem$1);else if(St==="End")vt.preventDefault(),moveFocus$1(xt,null,ct,lt,previousItem$1);else if(St.length===1){const $t=mt.current,It=St.toLowerCase(),Ft=performance.now();$t.keys.length>0&&(Ft-$t.lastTime>500?($t.keys=[],$t.repeating=!0,$t.previousKeyMatched=!0):$t.repeating&&It!==$t.keys[0]&&($t.repeating=!1)),$t.lastTime=Ft,$t.keys.push(It);const Ht=Et&&!$t.repeating&&textCriteriaMatches(Et,$t);$t.previousKeyMatched&&(Ht||moveFocus$1(xt,Et,!1,lt,nextItem$1,$t))?vt.preventDefault():$t.previousKeyMatched=!1}ut&&ut(vt)},bt=useForkRef(pt,nt);let yt=-1;reactExports.Children.forEach(at,(vt,xt)=>{if(!reactExports.isValidElement(vt)){yt===xt&&(yt+=1,yt>=at.length&&(yt=-1));return}vt.props.disabled||(ht==="selectedMenu"&&vt.props.selected||yt===-1)&&(yt=xt),yt===xt&&(vt.props.disabled||vt.props.muiSkipListHighlight||vt.type.muiSkipListHighlight)&&(yt+=1,yt>=at.length&&(yt=-1))});const wt=reactExports.Children.map(at,(vt,xt)=>{if(xt===yt){const St={};return ot&&(St.autoFocus=!0),vt.props.tabIndex===void 0&&ht==="selectedMenu"&&(St.tabIndex=0),reactExports.cloneElement(vt,St)}return vt});return jsxRuntimeExports.jsx(List$1,_extends$t({role:"menu",ref:bt,className:st,onKeyDown:gt,tabIndex:rt?0:-1},dt,{children:wt}))}),MenuList$1=MenuList;function getPopoverUtilityClass(tt){return generateUtilityClass("MuiPopover",tt)}generateUtilityClasses("MuiPopover",["root","paper"]);const _excluded$G=["onEntering"],_excluded2$8=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],_excluded3$1=["slotProps"];function getOffsetTop(tt,et){let nt=0;return typeof et=="number"?nt=et:et==="center"?nt=tt.height/2:et==="bottom"&&(nt=tt.height),nt}function getOffsetLeft(tt,et){let nt=0;return typeof et=="number"?nt=et:et==="center"?nt=tt.width/2:et==="right"&&(nt=tt.width),nt}function getTransformOriginValue(tt){return[tt.horizontal,tt.vertical].map(et=>typeof et=="number"?`${et}px`:et).join(" ")}function resolveAnchorEl(tt){return typeof tt=="function"?tt():tt}const useUtilityClasses$h=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,et)},PopoverRoot=styled$1(Modal$1,{name:"MuiPopover",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),PopoverPaper=styled$1(MuiPaper,{name:"MuiPopover",slot:"Paper",overridesResolver:(tt,et)=>et.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(et,nt){var it,rt,ot;const at=useThemeProps({props:et,name:"MuiPopover"}),{action:st,anchorEl:lt,anchorOrigin:ct={vertical:"top",horizontal:"left"},anchorPosition:ut,anchorReference:ht="anchorEl",children:dt,className:pt,container:mt,elevation:gt=8,marginThreshold:bt=16,open:yt,PaperProps:wt={},slots:vt,slotProps:xt,transformOrigin:St={vertical:"top",horizontal:"left"},TransitionComponent:Et=Grow$1,transitionDuration:$t="auto",TransitionProps:{onEntering:It}={},disableScrollLock:Ft=!1}=at,Ht=_objectWithoutPropertiesLoose$m(at.TransitionProps,_excluded$G),zt=_objectWithoutPropertiesLoose$m(at,_excluded2$8),Ot=(it=xt==null?void 0:xt.paper)!=null?it:wt,jt=reactExports.useRef(),kt=useForkRef(jt,Ot.ref),Tt=_extends$t({},at,{anchorOrigin:ct,anchorReference:ht,elevation:gt,marginThreshold:bt,externalPaperSlotProps:Ot,transformOrigin:St,TransitionComponent:Et,transitionDuration:$t,TransitionProps:Ht}),Ct=useUtilityClasses$h(Tt),Ut=reactExports.useCallback(()=>{if(ht==="anchorPosition")return ut;const En=resolveAnchorEl(lt),Cn=(En&&En.nodeType===1?En:ownerDocument(jt.current).body).getBoundingClientRect();return{top:Cn.top+getOffsetTop(Cn,ct.vertical),left:Cn.left+getOffsetLeft(Cn,ct.horizontal)}},[lt,ct.horizontal,ct.vertical,ut,ht]),Nt=reactExports.useCallback(En=>({vertical:getOffsetTop(En,St.vertical),horizontal:getOffsetLeft(En,St.horizontal)}),[St.horizontal,St.vertical]),Bt=reactExports.useCallback(En=>{const In={width:En.offsetWidth,height:En.offsetHeight},Cn=Nt(In);if(ht==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue(Cn)};const Nn=Ut();let Un=Nn.top-Cn.vertical,_n=Nn.left-Cn.horizontal;const An=Un+In.height,gn=_n+In.width,Tn=ownerWindow(resolveAnchorEl(lt)),yn=Tn.innerHeight-bt,dn=Tn.innerWidth-bt;if(bt!==null&&Unyn){const sn=An-yn;Un-=sn,Cn.vertical+=sn}if(bt!==null&&_ndn){const sn=gn-dn;_n-=sn,Cn.horizontal+=sn}return{top:`${Math.round(Un)}px`,left:`${Math.round(_n)}px`,transformOrigin:getTransformOriginValue(Cn)}},[lt,ht,Ut,Nt,bt]),[Mt,Dt]=reactExports.useState(yt),Pt=reactExports.useCallback(()=>{const En=jt.current;if(!En)return;const In=Bt(En);In.top!==null&&(En.style.top=In.top),In.left!==null&&(En.style.left=In.left),En.style.transformOrigin=In.transformOrigin,Dt(!0)},[Bt]);reactExports.useEffect(()=>(Ft&&window.addEventListener("scroll",Pt),()=>window.removeEventListener("scroll",Pt)),[lt,Ft,Pt]);const Vt=(En,In)=>{It&&It(En,In),Pt()},nn=()=>{Dt(!1)};reactExports.useEffect(()=>{yt&&Pt()}),reactExports.useImperativeHandle(st,()=>yt?{updatePosition:()=>{Pt()}}:null,[yt,Pt]),reactExports.useEffect(()=>{if(!yt)return;const En=debounce$4(()=>{Pt()}),In=ownerWindow(lt);return In.addEventListener("resize",En),()=>{En.clear(),In.removeEventListener("resize",En)}},[lt,yt,Pt]);let cn=$t;$t==="auto"&&!Et.muiSupportAuto&&(cn=void 0);const Xt=mt||(lt?ownerDocument(resolveAnchorEl(lt)).body:void 0),un=(rt=vt==null?void 0:vt.root)!=null?rt:PopoverRoot,en=(ot=vt==null?void 0:vt.paper)!=null?ot:PopoverPaper,fn=useSlotProps({elementType:en,externalSlotProps:_extends$t({},Ot,{style:Mt?Ot.style:_extends$t({},Ot.style,{opacity:0})}),additionalProps:{elevation:gt,ref:kt},ownerState:Tt,className:clsx$3(Ct.paper,Ot==null?void 0:Ot.className)}),xn=useSlotProps({elementType:un,externalSlotProps:(xt==null?void 0:xt.root)||{},externalForwardedProps:zt,additionalProps:{ref:nt,slotProps:{backdrop:{invisible:!0}},container:Xt,open:yt},ownerState:Tt,className:clsx$3(Ct.root,pt)}),{slotProps:an}=xn,Zt=_objectWithoutPropertiesLoose$m(xn,_excluded3$1);return jsxRuntimeExports.jsx(un,_extends$t({},Zt,!isHostComponent(un)&&{slotProps:an,disableScrollLock:Ft},{children:jsxRuntimeExports.jsx(Et,_extends$t({appear:!0,in:yt,onEntering:Vt,onExited:nn,timeout:cn},Ht,{children:jsxRuntimeExports.jsx(en,_extends$t({},fn,{children:dt}))}))}))}),Popover$1=Popover;function getMenuUtilityClass(tt){return generateUtilityClass("MuiMenu",tt)}generateUtilityClasses("MuiMenu",["root","paper","list"]);const _excluded$F=["onEntering"],_excluded2$7=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$g=tt=>{const{classes:et}=tt;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,et)},MenuRoot=styled$1(Popover$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(tt,et)=>et.root})({}),MenuPaper=styled$1(PopoverPaper,{name:"MuiMenu",slot:"Paper",overridesResolver:(tt,et)=>et.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled$1(MenuList$1,{name:"MuiMenu",slot:"List",overridesResolver:(tt,et)=>et.list})({outline:0}),Menu=reactExports.forwardRef(function(et,nt){var it,rt;const ot=useThemeProps({props:et,name:"MuiMenu"}),{autoFocus:at=!0,children:st,className:lt,disableAutoFocusItem:ct=!1,MenuListProps:ut={},onClose:ht,open:dt,PaperProps:pt={},PopoverClasses:mt,transitionDuration:gt="auto",TransitionProps:{onEntering:bt}={},variant:yt="selectedMenu",slots:wt={},slotProps:vt={}}=ot,xt=_objectWithoutPropertiesLoose$m(ot.TransitionProps,_excluded$F),St=_objectWithoutPropertiesLoose$m(ot,_excluded2$7),Et=useTheme(),$t=Et.direction==="rtl",It=_extends$t({},ot,{autoFocus:at,disableAutoFocusItem:ct,MenuListProps:ut,onEntering:bt,PaperProps:pt,transitionDuration:gt,TransitionProps:xt,variant:yt}),Ft=useUtilityClasses$g(It),Ht=at&&!ct&&dt,zt=reactExports.useRef(null),Ot=(Bt,Mt)=>{zt.current&&zt.current.adjustStyleForScrollbar(Bt,Et),bt&&bt(Bt,Mt)},jt=Bt=>{Bt.key==="Tab"&&(Bt.preventDefault(),ht&&ht(Bt,"tabKeyDown"))};let kt=-1;reactExports.Children.map(st,(Bt,Mt)=>{reactExports.isValidElement(Bt)&&(Bt.props.disabled||(yt==="selectedMenu"&&Bt.props.selected||kt===-1)&&(kt=Mt))});const Tt=(it=wt.paper)!=null?it:MenuPaper,Ct=(rt=vt.paper)!=null?rt:pt,Ut=useSlotProps({elementType:wt.root,externalSlotProps:vt.root,ownerState:It,className:[Ft.root,lt]}),Nt=useSlotProps({elementType:Tt,externalSlotProps:Ct,ownerState:It,className:Ft.paper});return jsxRuntimeExports.jsx(MenuRoot,_extends$t({onClose:ht,anchorOrigin:{vertical:"bottom",horizontal:$t?"right":"left"},transformOrigin:$t?RTL_ORIGIN:LTR_ORIGIN,slots:{paper:Tt,root:wt.root},slotProps:{root:Ut,paper:Nt},open:dt,ref:nt,transitionDuration:gt,TransitionProps:_extends$t({onEntering:Ot},xt),ownerState:It},St,{classes:mt,children:jsxRuntimeExports.jsx(MenuMenuList,_extends$t({onKeyDown:jt,actions:zt,autoFocus:at&&(kt===-1||ct),autoFocusItem:Ht,variant:yt},ut,{className:clsx$3(Ft.list,ut.className),children:st}))}))}),Menu$1=Menu;function getMenuItemUtilityClass(tt){return generateUtilityClass("MuiMenuItem",tt)}const menuItemClasses=generateUtilityClasses("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),menuItemClasses$1=menuItemClasses,_excluded$E=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],overridesResolver=(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.dense&&et.dense,nt.divider&&et.divider,!nt.disableGutters&&et.gutters]},useUtilityClasses$f=tt=>{const{disabled:et,dense:nt,divider:it,disableGutters:rt,selected:ot,classes:at}=tt,lt=composeClasses({root:["root",nt&&"dense",et&&"disabled",!rt&&"gutters",it&&"divider",ot&&"selected"]},getMenuItemUtilityClass,at);return _extends$t({},at,lt)},MenuItemRoot=styled$1(ButtonBase$1,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver})(({theme:tt,ownerState:et})=>_extends$t({},tt.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!et.disableGutters&&{paddingLeft:16,paddingRight:16},et.divider&&{borderBottom:`1px solid ${(tt.vars||tt).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(tt.vars||tt).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${menuItemClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),[`&.${menuItemClasses$1.focusVisible}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.focusOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.focusOpacity)}},[`&.${menuItemClasses$1.selected}:hover`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity)}},[`&.${menuItemClasses$1.focusVisible}`]:{backgroundColor:(tt.vars||tt).palette.action.focus},[`&.${menuItemClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity},[`& + .${dividerClasses.root}`]:{marginTop:tt.spacing(1),marginBottom:tt.spacing(1)},[`& + .${dividerClasses.inset}`]:{marginLeft:52},[`& .${listItemTextClasses$1.root}`]:{marginTop:0,marginBottom:0},[`& .${listItemTextClasses$1.inset}`]:{paddingLeft:36},[`& .${listItemIconClasses$1.root}`]:{minWidth:36}},!et.dense&&{[tt.breakpoints.up("sm")]:{minHeight:"auto"}},et.dense&&_extends$t({minHeight:32,paddingTop:4,paddingBottom:4},tt.typography.body2,{[`& .${listItemIconClasses$1.root} svg`]:{fontSize:"1.25rem"}}))),MenuItem$5=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiMenuItem"}),{autoFocus:rt=!1,component:ot="li",dense:at=!1,divider:st=!1,disableGutters:lt=!1,focusVisibleClassName:ct,role:ut="menuitem",tabIndex:ht,className:dt}=it,pt=_objectWithoutPropertiesLoose$m(it,_excluded$E),mt=reactExports.useContext(ListContext$1),gt=reactExports.useMemo(()=>({dense:at||mt.dense||!1,disableGutters:lt}),[mt.dense,at,lt]),bt=reactExports.useRef(null);useEnhancedEffect$1(()=>{rt&&bt.current&&bt.current.focus()},[rt]);const yt=_extends$t({},it,{dense:gt.dense,divider:st,disableGutters:lt}),wt=useUtilityClasses$f(it),vt=useForkRef(bt,nt);let xt;return it.disabled||(xt=ht!==void 0?ht:-1),jsxRuntimeExports.jsx(ListContext$1.Provider,{value:gt,children:jsxRuntimeExports.jsx(MenuItemRoot,_extends$t({ref:vt,role:ut,tabIndex:xt,component:ot,focusVisibleClassName:clsx$3(wt.focusVisible,ct),className:clsx$3(wt.root,dt)},pt,{ownerState:yt,classes:wt}))})}),MenuItem$6=MenuItem$5;function getNativeSelectUtilityClasses(tt){return generateUtilityClass("MuiNativeSelect",tt)}const nativeSelectClasses=generateUtilityClasses("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),nativeSelectClasses$1=nativeSelectClasses,_excluded$D=["className","disabled","error","IconComponent","inputRef","variant"],useUtilityClasses$e=tt=>{const{classes:et,variant:nt,disabled:it,multiple:rt,open:ot,error:at}=tt,st={select:["select",nt,it&&"disabled",rt&&"multiple",at&&"error"],icon:["icon",`icon${capitalize(nt)}`,ot&&"iconOpen",it&&"disabled"]};return composeClasses(st,getNativeSelectUtilityClasses,et)},nativeSelectSelectStyles=({ownerState:tt,theme:et})=>_extends$t({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":_extends$t({},et.vars?{backgroundColor:`rgba(${et.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:et.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nativeSelectClasses$1.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(et.vars||et).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},tt.variant==="filled"&&{"&&&":{paddingRight:32}},tt.variant==="outlined"&&{borderRadius:(et.vars||et).shape.borderRadius,"&:focus":{borderRadius:(et.vars||et).shape.borderRadius},"&&&":{paddingRight:32}}),NativeSelectSelect=styled$1("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.select,et[nt.variant],nt.error&&et.error,{[`&.${nativeSelectClasses$1.multiple}`]:et.multiple}]}})(nativeSelectSelectStyles),nativeSelectIconStyles=({ownerState:tt,theme:et})=>_extends$t({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(et.vars||et).palette.action.active,[`&.${nativeSelectClasses$1.disabled}`]:{color:(et.vars||et).palette.action.disabled}},tt.open&&{transform:"rotate(180deg)"},tt.variant==="filled"&&{right:7},tt.variant==="outlined"&&{right:7}),NativeSelectIcon=styled$1("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.icon,nt.variant&&et[`icon${capitalize(nt.variant)}`],nt.open&&et.iconOpen]}})(nativeSelectIconStyles),NativeSelectInput=reactExports.forwardRef(function(et,nt){const{className:it,disabled:rt,error:ot,IconComponent:at,inputRef:st,variant:lt="standard"}=et,ct=_objectWithoutPropertiesLoose$m(et,_excluded$D),ut=_extends$t({},et,{disabled:rt,variant:lt,error:ot}),ht=useUtilityClasses$e(ut);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,_extends$t({ownerState:ut,className:clsx$3(ht.select,it),disabled:rt,ref:st||nt},ct)),et.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:at,ownerState:ut,className:ht.icon})]})}),NativeSelectInput$1=NativeSelectInput;var _span$1;const _excluded$C=["children","classes","className","label","notched"],NotchedOutlineRoot$1=styled$1("fieldset",{shouldForwardProp:rootShouldForwardProp})({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%"}),NotchedOutlineLegend=styled$1("legend",{shouldForwardProp:rootShouldForwardProp})(({ownerState:tt,theme:et})=>_extends$t({float:"unset",width:"auto",overflow:"hidden"},!tt.withLabel&&{padding:0,lineHeight:"11px",transition:et.transitions.create("width",{duration:150,easing:et.transitions.easing.easeOut})},tt.withLabel&&_extends$t({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:et.transitions.create("max-width",{duration:50,easing:et.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},tt.notched&&{maxWidth:"100%",transition:et.transitions.create("max-width",{duration:100,easing:et.transitions.easing.easeOut,delay:50})})));function NotchedOutline(tt){const{className:et,label:nt,notched:it}=tt,rt=_objectWithoutPropertiesLoose$m(tt,_excluded$C),ot=nt!=null&&nt!=="",at=_extends$t({},tt,{notched:it,withLabel:ot});return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,_extends$t({"aria-hidden":!0,className:et,ownerState:at},rt,{children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:at,children:ot?jsxRuntimeExports.jsx("span",{children:nt}):_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"​"}))})}))}const _excluded$B=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],useUtilityClasses$d=tt=>{const{classes:et}=tt,it=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,et);return _extends$t({},et,it)},OutlinedInputRoot=styled$1(InputBaseRoot,{shouldForwardProp:tt=>rootShouldForwardProp(tt)||tt==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return _extends$t({position:"relative",borderRadius:(tt.vars||tt).shape.borderRadius,[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / 0.23)`:nt}},[`&.${outlinedInputClasses$1.focused} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette[et.color].main,borderWidth:2},[`&.${outlinedInputClasses$1.error} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.error.main},[`&.${outlinedInputClasses$1.disabled} .${outlinedInputClasses$1.notchedOutline}`]:{borderColor:(tt.vars||tt).palette.action.disabled}},et.startAdornment&&{paddingLeft:14},et.endAdornment&&{paddingRight:14},et.multiline&&_extends$t({padding:"16.5px 14px"},et.size==="small"&&{padding:"8.5px 14px"}))}),NotchedOutlineRoot=styled$1(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(tt,et)=>et.notchedOutline})(({theme:tt})=>{const et=tt.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:tt.vars?`rgba(${tt.vars.palette.common.onBackgroundChannel} / 0.23)`:et}}),OutlinedInputInput=styled$1(InputBaseComponent,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:tt,ownerState:et})=>_extends$t({padding:"16.5px 14px"},!tt.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:tt.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:tt.palette.mode==="light"?null:"#fff",caretColor:tt.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},tt.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[tt.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},et.size==="small"&&{padding:"8.5px 14px"},et.multiline&&{padding:0},et.startAdornment&&{paddingLeft:0},et.endAdornment&&{paddingRight:0})),OutlinedInput=reactExports.forwardRef(function(et,nt){var it,rt,ot,at,st;const lt=useThemeProps({props:et,name:"MuiOutlinedInput"}),{components:ct={},fullWidth:ut=!1,inputComponent:ht="input",label:dt,multiline:pt=!1,notched:mt,slots:gt={},type:bt="text"}=lt,yt=_objectWithoutPropertiesLoose$m(lt,_excluded$B),wt=useUtilityClasses$d(lt),vt=useFormControl(),xt=formControlState({props:lt,muiFormControl:vt,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),St=_extends$t({},lt,{color:xt.color||"primary",disabled:xt.disabled,error:xt.error,focused:xt.focused,formControl:vt,fullWidth:ut,hiddenLabel:xt.hiddenLabel,multiline:pt,size:xt.size,type:bt}),Et=(it=(rt=gt.root)!=null?rt:ct.Root)!=null?it:OutlinedInputRoot,$t=(ot=(at=gt.input)!=null?at:ct.Input)!=null?ot:OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase$1,_extends$t({slots:{root:Et,input:$t},renderSuffix:It=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:St,className:wt.notchedOutline,label:dt!=null&&dt!==""&&xt.required?st||(st=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[dt," ","*"]})):dt,notched:typeof mt<"u"?mt:!!(It.startAdornment||It.filled||It.focused)}),fullWidth:ut,inputComponent:ht,multiline:pt,ref:nt,type:bt},yt,{classes:_extends$t({},wt,{notchedOutline:null})}))});OutlinedInput.muiName="Input";const OutlinedInput$1=OutlinedInput;function getSelectUtilityClasses(tt){return generateUtilityClass("MuiSelect",tt)}const selectClasses=generateUtilityClasses("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),selectClasses$1=selectClasses;var _span;const _excluded$A=["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"],SelectSelect=styled$1("div",{name:"MuiSelect",slot:"Select",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`&.${selectClasses$1.select}`]:et.select},{[`&.${selectClasses$1.select}`]:et[nt.variant]},{[`&.${selectClasses$1.error}`]:et.error},{[`&.${selectClasses$1.multiple}`]:et.multiple}]}})(nativeSelectSelectStyles,{[`&.${selectClasses$1.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled$1("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.icon,nt.variant&&et[`icon${capitalize(nt.variant)}`],nt.open&&et.iconOpen]}})(nativeSelectIconStyles),SelectNativeInput=styled$1("input",{shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(tt,et)=>et.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues(tt,et){return typeof et=="object"&&et!==null?tt===et:String(tt)===String(et)}function isEmpty(tt){return tt==null||typeof tt=="string"&&!tt.trim()}const useUtilityClasses$c=tt=>{const{classes:et,variant:nt,disabled:it,multiple:rt,open:ot,error:at}=tt,st={select:["select",nt,it&&"disabled",rt&&"multiple",at&&"error"],icon:["icon",`icon${capitalize(nt)}`,ot&&"iconOpen",it&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(st,getSelectUtilityClasses,et)},SelectInput=reactExports.forwardRef(function(et,nt){var it;const{"aria-describedby":rt,"aria-label":ot,autoFocus:at,autoWidth:st,children:lt,className:ct,defaultOpen:ut,defaultValue:ht,disabled:dt,displayEmpty:pt,error:mt=!1,IconComponent:gt,inputRef:bt,labelId:yt,MenuProps:wt={},multiple:vt,name:xt,onBlur:St,onChange:Et,onClose:$t,onFocus:It,onOpen:Ft,open:Ht,readOnly:zt,renderValue:Ot,SelectDisplayProps:jt={},tabIndex:kt,value:Tt,variant:Ct="standard"}=et,Ut=_objectWithoutPropertiesLoose$m(et,_excluded$A),[Nt,Bt]=useControlled({controlled:Tt,default:ht,name:"Select"}),[Mt,Dt]=useControlled({controlled:Ht,default:ut,name:"Select"}),Pt=reactExports.useRef(null),Vt=reactExports.useRef(null),[nn,cn]=reactExports.useState(null),{current:Xt}=reactExports.useRef(Ht!=null),[un,en]=reactExports.useState(),fn=useForkRef(nt,bt),xn=reactExports.useCallback(Bn=>{Vt.current=Bn,Bn&&cn(Bn)},[]),an=nn==null?void 0:nn.parentNode;reactExports.useImperativeHandle(fn,()=>({focus:()=>{Vt.current.focus()},node:Pt.current,value:Nt}),[Nt]),reactExports.useEffect(()=>{ut&&Mt&&nn&&!Xt&&(en(st?null:an.clientWidth),Vt.current.focus())},[nn,st]),reactExports.useEffect(()=>{at&&Vt.current.focus()},[at]),reactExports.useEffect(()=>{if(!yt)return;const Bn=ownerDocument(Vt.current).getElementById(yt);if(Bn){const Xn=()=>{getSelection().isCollapsed&&Vt.current.focus()};return Bn.addEventListener("click",Xn),()=>{Bn.removeEventListener("click",Xn)}}},[yt]);const Zt=(Bn,Xn)=>{Bn?Ft&&Ft(Xn):$t&&$t(Xn),Xt||(en(st?null:an.clientWidth),Dt(Bn))},En=Bn=>{Bn.button===0&&(Bn.preventDefault(),Vt.current.focus(),Zt(!0,Bn))},In=Bn=>{Zt(!1,Bn)},Cn=reactExports.Children.toArray(lt),Nn=Bn=>{const Xn=Cn.find(Wn=>Wn.props.value===Bn.target.value);Xn!==void 0&&(Bt(Xn.props.value),Et&&Et(Bn,Xn))},Un=Bn=>Xn=>{let Wn;if(Xn.currentTarget.hasAttribute("tabindex")){if(vt){Wn=Array.isArray(Nt)?Nt.slice():[];const Gn=Nt.indexOf(Bn.props.value);Gn===-1?Wn.push(Bn.props.value):Wn.splice(Gn,1)}else Wn=Bn.props.value;if(Bn.props.onClick&&Bn.props.onClick(Xn),Nt!==Wn&&(Bt(Wn),Et)){const Gn=Xn.nativeEvent||Xn,Fn=new Gn.constructor(Gn.type,Gn);Object.defineProperty(Fn,"target",{writable:!0,value:{value:Wn,name:xt}}),Et(Fn,Bn)}vt||Zt(!1,Xn)}},_n=Bn=>{zt||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Bn.key)!==-1&&(Bn.preventDefault(),Zt(!0,Bn))},An=nn!==null&&Mt,gn=Bn=>{!An&&St&&(Object.defineProperty(Bn,"target",{writable:!0,value:{value:Nt,name:xt}}),St(Bn))};delete Ut["aria-invalid"];let Tn,yn;const dn=[];let sn=!1;(isFilled({value:Nt})||pt)&&(Ot?Tn=Ot(Nt):sn=!0);const rn=Cn.map(Bn=>{if(!reactExports.isValidElement(Bn))return null;let Xn;if(vt){if(!Array.isArray(Nt))throw new Error(formatMuiErrorMessage(2));Xn=Nt.some(Wn=>areEqualValues(Wn,Bn.props.value)),Xn&&sn&&dn.push(Bn.props.children)}else Xn=areEqualValues(Nt,Bn.props.value),Xn&&sn&&(yn=Bn.props.children);return reactExports.cloneElement(Bn,{"aria-selected":Xn?"true":"false",onClick:Un(Bn),onKeyUp:Wn=>{Wn.key===" "&&Wn.preventDefault(),Bn.props.onKeyUp&&Bn.props.onKeyUp(Wn)},role:"option",selected:Xn,value:void 0,"data-value":Bn.props.value})});sn&&(vt?dn.length===0?Tn=null:Tn=dn.reduce((Bn,Xn,Wn)=>(Bn.push(Xn),Wn{const{classes:et}=tt;return et},styledRootConfig={name:"MuiSelect",overridesResolver:(tt,et)=>et.root,shouldForwardProp:tt=>rootShouldForwardProp(tt)&&tt!=="variant",slot:"Root"},StyledInput$1=styled$1(Input$2,styledRootConfig)(""),StyledOutlinedInput=styled$1(OutlinedInput$1,styledRootConfig)(""),StyledFilledInput=styled$1(FilledInput$1,styledRootConfig)(""),Select$2=reactExports.forwardRef(function(et,nt){const it=useThemeProps({name:"MuiSelect",props:et}),{autoWidth:rt=!1,children:ot,classes:at={},className:st,defaultOpen:lt=!1,displayEmpty:ct=!1,IconComponent:ut=ArrowDropDownIcon,id:ht,input:dt,inputProps:pt,label:mt,labelId:gt,MenuProps:bt,multiple:yt=!1,native:wt=!1,onClose:vt,onOpen:xt,open:St,renderValue:Et,SelectDisplayProps:$t,variant:It="outlined"}=it,Ft=_objectWithoutPropertiesLoose$m(it,_excluded$z),Ht=wt?NativeSelectInput$1:SelectInput$1,zt=useFormControl(),Ot=formControlState({props:it,muiFormControl:zt,states:["variant","error"]}),jt=Ot.variant||It,kt=_extends$t({},it,{variant:jt,classes:at}),Tt=useUtilityClasses$b(kt),Ct=_objectWithoutPropertiesLoose$m(Tt,_excluded2$6),Ut=dt||{standard:jsxRuntimeExports.jsx(StyledInput$1,{ownerState:kt}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:mt,ownerState:kt}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:kt})}[jt],Nt=useForkRef(nt,Ut.ref);return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(Ut,_extends$t({inputComponent:Ht,inputProps:_extends$t({children:ot,error:Ot.error,IconComponent:ut,variant:jt,type:void 0,multiple:yt},wt?{id:ht}:{autoWidth:rt,defaultOpen:lt,displayEmpty:ct,labelId:gt,MenuProps:bt,onClose:vt,onOpen:xt,open:St,renderValue:Et,SelectDisplayProps:_extends$t({id:ht},$t)},pt,{classes:pt?deepmerge$1(Ct,pt.classes):Ct},dt?dt.props.inputProps:{})},yt&&wt&&jt==="outlined"?{notched:!0}:{},{ref:Nt,className:clsx$3(Ut.props.className,st,Tt.root)},!dt&&{variant:jt},Ft))})});Select$2.muiName="Select";const Select$3=Select$2;function getSkeletonUtilityClass(tt){return generateUtilityClass("MuiSkeleton",tt)}generateUtilityClasses("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const _excluded$y=["animation","className","component","height","style","variant","width"];let _=tt=>tt,_t,_t2,_t3,_t4;const useUtilityClasses$a=tt=>{const{classes:et,variant:nt,animation:it,hasChildren:rt,width:ot,height:at}=tt;return composeClasses({root:["root",nt,it,rt&&"withChildren",rt&&!ot&&"fitContent",rt&&!at&&"heightAuto"]},getSkeletonUtilityClass,et)},pulseKeyframe=keyframes(_t||(_t=_` 0% { opacity: 1; } @@ -3659,7 +3659,7 @@ PROCEED WITH CAUTION! 100% { transform: translateX(100%); } -`)),SkeletonRoot=styled$1("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],nt.animation!==!1&&et[nt.animation],nt.hasChildren&&et.withChildren,nt.hasChildren&&!nt.width&&et.fitContent,nt.hasChildren&&!nt.height&&et.heightAuto]}})(({theme:tt,ownerState:et})=>{const nt=getUnit$1(tt.shape.borderRadius)||"px",it=toUnitless(tt.shape.borderRadius);return _extends$u({display:"block",backgroundColor:tt.vars?tt.vars.palette.Skeleton.bg:alpha$1(tt.palette.text.primary,tt.palette.mode==="light"?.11:.13),height:"1.2em"},et.variant==="text"&&{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${it}${nt}/${Math.round(it/.6*10)/10}${nt}`,"&:empty:before":{content:'"\\00a0"'}},et.variant==="circular"&&{borderRadius:"50%"},et.variant==="rounded"&&{borderRadius:(tt.vars||tt).shape.borderRadius},et.hasChildren&&{"& > *":{visibility:"hidden"}},et.hasChildren&&!et.width&&{maxWidth:"fit-content"},et.hasChildren&&!et.height&&{height:"auto"})},({ownerState:tt})=>tt.animation==="pulse"&&css(_t3||(_t3=_` +`)),SkeletonRoot=styled$1("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],nt.animation!==!1&&et[nt.animation],nt.hasChildren&&et.withChildren,nt.hasChildren&&!nt.width&&et.fitContent,nt.hasChildren&&!nt.height&&et.heightAuto]}})(({theme:tt,ownerState:et})=>{const nt=getUnit$1(tt.shape.borderRadius)||"px",it=toUnitless(tt.shape.borderRadius);return _extends$t({display:"block",backgroundColor:tt.vars?tt.vars.palette.Skeleton.bg:alpha$1(tt.palette.text.primary,tt.palette.mode==="light"?.11:.13),height:"1.2em"},et.variant==="text"&&{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${it}${nt}/${Math.round(it/.6*10)/10}${nt}`,"&:empty:before":{content:'"\\00a0"'}},et.variant==="circular"&&{borderRadius:"50%"},et.variant==="rounded"&&{borderRadius:(tt.vars||tt).shape.borderRadius},et.hasChildren&&{"& > *":{visibility:"hidden"}},et.hasChildren&&!et.width&&{maxWidth:"fit-content"},et.hasChildren&&!et.height&&{height:"auto"})},({ownerState:tt})=>tt.animation==="pulse"&&css(_t3||(_t3=_` animation: ${0} 2s ease-in-out 0.5s infinite; `),pulseKeyframe),({ownerState:tt,theme:et})=>tt.animation==="wave"&&css(_t4||(_t4=_` position: relative; @@ -3684,8 +3684,8 @@ PROCEED WITH CAUTION! right: 0; top: 0; } - `),waveKeyframe,(et.vars||et).palette.action.hover)),Skeleton=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiSkeleton"}),{animation:rt="pulse",className:ot,component:at="span",height:st,style:lt,variant:ct="text",width:ut}=it,ht=_objectWithoutPropertiesLoose$m(it,_excluded$y),dt=_extends$u({},it,{animation:rt,component:at,variant:ct,hasChildren:!!ht.children}),pt=useUtilityClasses$a(dt);return jsxRuntimeExports.jsx(SkeletonRoot,_extends$u({as:at,ref:nt,className:clsx$3(pt.root,ot),ownerState:dt},ht,{style:_extends$u({width:ut,height:st},lt)}))}),Skeleton$1=Skeleton,shouldSpreadAdditionalProps=tt=>!tt||!isHostComponent(tt),shouldSpreadAdditionalProps$1=shouldSpreadAdditionalProps;function getSliderUtilityClass(tt){return generateUtilityClass("MuiSlider",tt)}const sliderClasses=generateUtilityClasses("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"]),sliderClasses$1=sliderClasses,useValueLabelClasses=tt=>{const{open:et}=tt;return{offset:clsx$3(et&&sliderClasses$1.valueLabelOpen),circle:sliderClasses$1.valueLabelCircle,label:sliderClasses$1.valueLabelLabel}};function SliderValueLabel$1(tt){const{children:et,className:nt,value:it}=tt,rt=useValueLabelClasses(tt);return et?reactExports.cloneElement(et,{className:clsx$3(et.props.className)},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[et.props.children,jsxRuntimeExports.jsx("span",{className:clsx$3(rt.offset,nt),"aria-hidden":!0,children:jsxRuntimeExports.jsx("span",{className:rt.circle,children:jsxRuntimeExports.jsx("span",{className:rt.label,children:it})})})]})):null}const _excluded$x=["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 Identity(tt){return tt}const SliderRoot=styled$1("span",{name:"MuiSlider",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[`color${capitalize(nt.color)}`],nt.size!=="medium"&&et[`size${capitalize(nt.size)}`],nt.marked&&et.marked,nt.orientation==="vertical"&&et.vertical,nt.track==="inverted"&&et.trackInverted,nt.track===!1&&et.trackFalse]}})(({theme:tt,ownerState:et})=>_extends$u({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(tt.vars||tt).palette[et.color].main,WebkitTapHighlightColor:"transparent"},et.orientation==="horizontal"&&_extends$u({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},et.size==="small"&&{height:2},et.marked&&{marginBottom:20}),et.orientation==="vertical"&&_extends$u({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},et.size==="small"&&{width:2},et.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${sliderClasses$1.disabled}`]:{pointerEvents:"none",cursor:"default",color:(tt.vars||tt).palette.grey[400]},[`&.${sliderClasses$1.dragging}`]:{[`& .${sliderClasses$1.thumb}, & .${sliderClasses$1.track}`]:{transition:"none"}}})),SliderRail=styled$1("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(tt,et)=>et.rail})(({ownerState:tt})=>_extends$u({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},tt.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},tt.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},tt.track==="inverted"&&{opacity:1})),SliderTrack=styled$1("span",{name:"MuiSlider",slot:"Track",overridesResolver:(tt,et)=>et.track})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?lighten(tt.palette[et.color].main,.62):darken(tt.palette[et.color].main,.5);return _extends$u({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:tt.transitions.create(["left","width","bottom","height"],{duration:tt.transitions.duration.shortest})},et.size==="small"&&{border:"none"},et.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},et.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},et.track===!1&&{display:"none"},et.track==="inverted"&&{backgroundColor:tt.vars?tt.vars.palette.Slider[`${et.color}Track`]:nt,borderColor:tt.vars?tt.vars.palette.Slider[`${et.color}Track`]:nt})}),SliderThumb=styled$1("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.thumb,et[`thumbColor${capitalize(nt.color)}`],nt.size!=="medium"&&et[`thumbSize${capitalize(nt.size)}`]]}})(({theme:tt,ownerState:et})=>_extends$u({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:tt.transitions.create(["box-shadow","left","bottom"],{duration:tt.transitions.duration.shortest})},et.size==="small"&&{width:12,height:12},et.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},et.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&:before":_extends$u({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(tt.vars||tt).shadows[2]},et.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${sliderClasses$1.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.16)`:alpha$1(tt.palette[et.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${sliderClasses$1.active}`]:{boxShadow:`0px 0px 0px 14px ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.16)`:alpha$1(tt.palette[et.color].main,.16)}`},[`&.${sliderClasses$1.disabled}`]:{"&:hover":{boxShadow:"none"}}})),SliderValueLabel=styled$1(SliderValueLabel$1,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(tt,et)=>et.valueLabel})(({theme:tt,ownerState:et})=>_extends$u({[`&.${sliderClasses$1.valueLabelOpen}`]:{transform:`${et.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},tt.typography.body2,{fontWeight:500,transition:tt.transitions.create(["transform"],{duration:tt.transitions.duration.shortest}),transform:`${et.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(tt.vars||tt).palette.grey[600],borderRadius:2,color:(tt.vars||tt).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},et.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%"}},et.orientation==="vertical"&&{right:et.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%"}},et.size==="small"&&{fontSize:tt.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),SliderMark=styled$1("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="markActive",overridesResolver:(tt,et)=>{const{markActive:nt}=tt;return[et.mark,nt&&et.markActive]}})(({theme:tt,ownerState:et,markActive:nt})=>_extends$u({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},et.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},et.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},nt&&{backgroundColor:(tt.vars||tt).palette.background.paper,opacity:.8})),SliderMarkLabel=styled$1("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="markLabelActive",overridesResolver:(tt,et)=>et.markLabel})(({theme:tt,ownerState:et,markLabelActive:nt})=>_extends$u({},tt.typography.body2,{color:(tt.vars||tt).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},et.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},et.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},nt&&{color:(tt.vars||tt).palette.text.primary})),useUtilityClasses$9=tt=>{const{disabled:et,dragging:nt,marked:it,orientation:rt,track:ot,classes:at,color:st,size:lt}=tt,ct={root:["root",et&&"disabled",nt&&"dragging",it&&"marked",rt==="vertical"&&"vertical",ot==="inverted"&&"trackInverted",ot===!1&&"trackFalse",st&&`color${capitalize(st)}`,lt&&`size${capitalize(lt)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",et&&"disabled",lt&&`thumbSize${capitalize(lt)}`,st&&`thumbColor${capitalize(st)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return composeClasses(ct,getSliderUtilityClass,at)},Forward=({children:tt})=>tt,Slider=reactExports.forwardRef(function(et,nt){var it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,It,Tt,$t,Ut;const Lt=useThemeProps({props:et,name:"MuiSlider"}),Pt=useTheme().direction==="rtl",{"aria-label":kt,"aria-valuetext":At,"aria-labelledby":Rt,component:Wt="span",components:jt={},componentsProps:Ot={},color:Ct="primary",classes:Dt,className:Mt,disableSwap:Vt=!1,disabled:Qt=!1,getAriaLabel:rn,getAriaValueText:Xt,marks:an=!1,max:tn=100,min:pn=0,orientation:vn="horizontal",size:sn="medium",step:Zt=1,scale:Sn=Identity,slotProps:Tn,slots:Cn,track:jn="normal",valueLabelDisplay:Un="off",valueLabelFormat:yn=Identity}=Lt,un=_objectWithoutPropertiesLoose$m(Lt,_excluded$x),En=_extends$u({},Lt,{isRtl:Pt,max:tn,min:pn,classes:Dt,disabled:Qt,disableSwap:Vt,orientation:vn,marks:an,color:Ct,size:sn,step:Zt,scale:Sn,track:jn,valueLabelDisplay:Un,valueLabelFormat:yn}),{axisProps:In,getRootProps:xn,getHiddenInputProps:dn,getThumbProps:cn,open:hn,active:$n,axis:nn,focusedThumbIndex:Kt,range:Yt,dragging:_n,marks:Mn,values:Bn,trackOffset:Nn,trackLeap:qn,getThumbStyle:Wn}=useSlider(_extends$u({},En,{rootRef:nt}));En.marked=Mn.length>0&&Mn.some(er=>er.label),En.dragging=_n,En.focusedThumbIndex=Kt;const Vn=useUtilityClasses$9(En),Fn=(it=(rt=Cn==null?void 0:Cn.root)!=null?rt:jt.Root)!=null?it:SliderRoot,Jn=(ot=(at=Cn==null?void 0:Cn.rail)!=null?at:jt.Rail)!=null?ot:SliderRail,Hn=(st=(lt=Cn==null?void 0:Cn.track)!=null?lt:jt.Track)!=null?st:SliderTrack,dr=(ct=(ut=Cn==null?void 0:Cn.thumb)!=null?ut:jt.Thumb)!=null?ct:SliderThumb,ur=(ht=(dt=Cn==null?void 0:Cn.valueLabel)!=null?dt:jt.ValueLabel)!=null?ht:SliderValueLabel,_r=(pt=(mt=Cn==null?void 0:Cn.mark)!=null?mt:jt.Mark)!=null?pt:SliderMark,Qr=(gt=(bt=Cn==null?void 0:Cn.markLabel)!=null?bt:jt.MarkLabel)!=null?gt:SliderMarkLabel,jr=(yt=(wt=Cn==null?void 0:Cn.input)!=null?wt:jt.Input)!=null?yt:"input",Mr=(vt=Tn==null?void 0:Tn.root)!=null?vt:Ot.root,qr=(xt=Tn==null?void 0:Tn.rail)!=null?xt:Ot.rail,Ur=(St=Tn==null?void 0:Tn.track)!=null?St:Ot.track,Lr=(Et=Tn==null?void 0:Tn.thumb)!=null?Et:Ot.thumb,ao=(It=Tn==null?void 0:Tn.valueLabel)!=null?It:Ot.valueLabel,Gr=(Tt=Tn==null?void 0:Tn.mark)!=null?Tt:Ot.mark,Br=($t=Tn==null?void 0:Tn.markLabel)!=null?$t:Ot.markLabel,go=(Ut=Tn==null?void 0:Tn.input)!=null?Ut:Ot.input,wn=useSlotProps({elementType:Fn,getSlotProps:xn,externalSlotProps:Mr,externalForwardedProps:un,additionalProps:_extends$u({},shouldSpreadAdditionalProps$1(Fn)&&{as:Wt}),ownerState:_extends$u({},En,Mr==null?void 0:Mr.ownerState),className:[Vn.root,Mt]}),Pn=useSlotProps({elementType:Jn,externalSlotProps:qr,ownerState:En,className:Vn.rail}),fn=useSlotProps({elementType:Hn,externalSlotProps:Ur,additionalProps:{style:_extends$u({},In[nn].offset(Nn),In[nn].leap(qn))},ownerState:_extends$u({},En,Ur==null?void 0:Ur.ownerState),className:Vn.track}),Jt=useSlotProps({elementType:dr,getSlotProps:cn,externalSlotProps:Lr,ownerState:_extends$u({},En,Lr==null?void 0:Lr.ownerState),className:Vn.thumb}),kn=useSlotProps({elementType:ur,externalSlotProps:ao,ownerState:_extends$u({},En,ao==null?void 0:ao.ownerState),className:Vn.valueLabel}),On=useSlotProps({elementType:_r,externalSlotProps:Gr,ownerState:En,className:Vn.mark}),Dn=useSlotProps({elementType:Qr,externalSlotProps:Br,ownerState:En,className:Vn.markLabel}),Kn=useSlotProps({elementType:jr,getSlotProps:dn,externalSlotProps:go,ownerState:En});return jsxRuntimeExports.jsxs(Fn,_extends$u({},wn,{children:[jsxRuntimeExports.jsx(Jn,_extends$u({},Pn)),jsxRuntimeExports.jsx(Hn,_extends$u({},fn)),Mn.filter(er=>er.value>=pn&&er.value<=tn).map((er,or)=>{const ar=valueToPercent(er.value,pn,tn),Vr=In[nn].offset(ar);let wr;return jn===!1?wr=Bn.indexOf(er.value)!==-1:wr=jn==="normal"&&(Yt?er.value>=Bn[0]&&er.value<=Bn[Bn.length-1]:er.value<=Bn[0])||jn==="inverted"&&(Yt?er.value<=Bn[0]||er.value>=Bn[Bn.length-1]:er.value>=Bn[0]),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(_r,_extends$u({"data-index":or},On,!isHostComponent(_r)&&{markActive:wr},{style:_extends$u({},Vr,On.style),className:clsx$3(On.className,wr&&Vn.markActive)})),er.label!=null?jsxRuntimeExports.jsx(Qr,_extends$u({"aria-hidden":!0,"data-index":or},Dn,!isHostComponent(Qr)&&{markLabelActive:wr},{style:_extends$u({},Vr,Dn.style),className:clsx$3(Vn.markLabel,Dn.className,wr&&Vn.markLabelActive),children:er.label})):null]},or)}),Bn.map((er,or)=>{const ar=valueToPercent(er,pn,tn),Vr=In[nn].offset(ar),wr=Un==="off"?Forward:ur;return jsxRuntimeExports.jsx(wr,_extends$u({},!isHostComponent(wr)&&{valueLabelFormat:yn,valueLabelDisplay:Un,value:typeof yn=="function"?yn(Sn(er),or):yn,index:or,open:hn===or||$n===or||Un==="on",disabled:Qt},kn,{children:jsxRuntimeExports.jsx(dr,_extends$u({"data-index":or},Jt,{className:clsx$3(Vn.thumb,Jt.className,$n===or&&Vn.active,Kt===or&&Vn.focusVisible),style:_extends$u({},Vr,Wn(or),Jt.style),children:jsxRuntimeExports.jsx(jr,_extends$u({"data-index":or,"aria-label":rn?rn(or):kt,"aria-valuenow":Sn(er),"aria-labelledby":Rt,"aria-valuetext":Xt?Xt(Sn(er),or):At,value:Bn[or]},Kn))}))}),or)})]}))}),Slider$1=Slider;function getTabUtilityClass(tt){return generateUtilityClass("MuiTab",tt)}const tabClasses=generateUtilityClasses("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),tabClasses$1=tabClasses,_excluded$w=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],useUtilityClasses$8=tt=>{const{classes:et,textColor:nt,fullWidth:it,wrapped:rt,icon:ot,label:at,selected:st,disabled:lt}=tt,ct={root:["root",ot&&at&&"labelIcon",`textColor${capitalize(nt)}`,it&&"fullWidth",rt&&"wrapped",st&&"selected",lt&&"disabled"],iconWrapper:["iconWrapper"]};return composeClasses(ct,getTabUtilityClass,et)},TabRoot=styled$1(ButtonBase$1,{name:"MuiTab",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.label&&nt.icon&&et.labelIcon,et[`textColor${capitalize(nt.textColor)}`],nt.fullWidth&&et.fullWidth,nt.wrapped&&et.wrapped]}})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},et.label&&{flexDirection:et.iconPosition==="top"||et.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},et.icon&&et.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${tabClasses$1.iconWrapper}`]:_extends$u({},et.iconPosition==="top"&&{marginBottom:6},et.iconPosition==="bottom"&&{marginTop:6},et.iconPosition==="start"&&{marginRight:tt.spacing(1)},et.iconPosition==="end"&&{marginLeft:tt.spacing(1)})},et.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${tabClasses$1.selected}`]:{opacity:1},[`&.${tabClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity}},et.textColor==="primary"&&{color:(tt.vars||tt).palette.text.secondary,[`&.${tabClasses$1.selected}`]:{color:(tt.vars||tt).palette.primary.main},[`&.${tabClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled}},et.textColor==="secondary"&&{color:(tt.vars||tt).palette.text.secondary,[`&.${tabClasses$1.selected}`]:{color:(tt.vars||tt).palette.secondary.main},[`&.${tabClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled}},et.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},et.wrapped&&{fontSize:tt.typography.pxToRem(12)})),Tab$1=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTab"}),{className:rt,disabled:ot=!1,disableFocusRipple:at=!1,fullWidth:st,icon:lt,iconPosition:ct="top",indicator:ut,label:ht,onChange:dt,onClick:pt,onFocus:mt,selected:gt,selectionFollowsFocus:bt,textColor:yt="inherit",value:wt,wrapped:vt=!1}=it,xt=_objectWithoutPropertiesLoose$m(it,_excluded$w),St=_extends$u({},it,{disabled:ot,disableFocusRipple:at,selected:gt,icon:!!lt,iconPosition:ct,label:!!ht,fullWidth:st,textColor:yt,wrapped:vt}),Et=useUtilityClasses$8(St),It=lt&&ht&&reactExports.isValidElement(lt)?reactExports.cloneElement(lt,{className:clsx$3(Et.iconWrapper,lt.props.className)}):lt,Tt=Ut=>{!gt&&dt&&dt(Ut,wt),pt&&pt(Ut)},$t=Ut=>{bt&&!gt&&dt&&dt(Ut,wt),mt&&mt(Ut)};return jsxRuntimeExports.jsxs(TabRoot,_extends$u({focusRipple:!at,className:clsx$3(Et.root,rt),ref:nt,role:"tab","aria-selected":gt,disabled:ot,onClick:Tt,onFocus:$t,ownerState:St,tabIndex:gt?0:-1},xt,{children:[ct==="top"||ct==="start"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[It,ht]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ht,It]}),ut]}))}),Tab$2=Tab$1,TableContext=reactExports.createContext(),TableContext$1=TableContext;function getTableUtilityClass(tt){return generateUtilityClass("MuiTable",tt)}generateUtilityClasses("MuiTable",["root","stickyHeader"]);const _excluded$v=["className","component","padding","size","stickyHeader"],useUtilityClasses$7=tt=>{const{classes:et,stickyHeader:nt}=tt;return composeClasses({root:["root",nt&&"stickyHeader"]},getTableUtilityClass,et)},TableRoot=styled$1("table",{name:"MuiTable",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.stickyHeader&&et.stickyHeader]}})(({theme:tt,ownerState:et})=>_extends$u({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":_extends$u({},tt.typography.body2,{padding:tt.spacing(2),color:(tt.vars||tt).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},et.stickyHeader&&{borderCollapse:"separate"})),defaultComponent$3="table",Table$3=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTable"}),{className:rt,component:ot=defaultComponent$3,padding:at="normal",size:st="medium",stickyHeader:lt=!1}=it,ct=_objectWithoutPropertiesLoose$m(it,_excluded$v),ut=_extends$u({},it,{component:ot,padding:at,size:st,stickyHeader:lt}),ht=useUtilityClasses$7(ut),dt=reactExports.useMemo(()=>({padding:at,size:st,stickyHeader:lt}),[at,st,lt]);return jsxRuntimeExports.jsx(TableContext$1.Provider,{value:dt,children:jsxRuntimeExports.jsx(TableRoot,_extends$u({as:ot,role:ot===defaultComponent$3?null:"table",ref:nt,className:clsx$3(ht.root,rt),ownerState:ut},ct))})}),MaterialTable=Table$3,Tablelvl2Context=reactExports.createContext(),Tablelvl2Context$1=Tablelvl2Context;function getTableBodyUtilityClass(tt){return generateUtilityClass("MuiTableBody",tt)}generateUtilityClasses("MuiTableBody",["root"]);const _excluded$u=["className","component"],useUtilityClasses$6=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableBodyUtilityClass,et)},TableBodyRoot=styled$1("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"table-row-group"}),tablelvl2$1={variant:"body"},defaultComponent$2="tbody",TableBody=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableBody"}),{className:rt,component:ot=defaultComponent$2}=it,at=_objectWithoutPropertiesLoose$m(it,_excluded$u),st=_extends$u({},it,{component:ot}),lt=useUtilityClasses$6(st);return jsxRuntimeExports.jsx(Tablelvl2Context$1.Provider,{value:tablelvl2$1,children:jsxRuntimeExports.jsx(TableBodyRoot,_extends$u({className:clsx$3(lt.root,rt),as:ot,ref:nt,role:ot===defaultComponent$2?null:"rowgroup",ownerState:st},at))})}),TableBody$1=TableBody;function getTableCellUtilityClass(tt){return generateUtilityClass("MuiTableCell",tt)}const tableCellClasses=generateUtilityClasses("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),tableCellClasses$1=tableCellClasses,_excluded$t=["align","className","component","padding","scope","size","sortDirection","variant"],useUtilityClasses$5=tt=>{const{classes:et,variant:nt,align:it,padding:rt,size:ot,stickyHeader:at}=tt,st={root:["root",nt,at&&"stickyHeader",it!=="inherit"&&`align${capitalize(it)}`,rt!=="normal"&&`padding${capitalize(rt)}`,`size${capitalize(ot)}`]};return composeClasses(st,getTableCellUtilityClass,et)},TableCellRoot=styled$1("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],et[`size${capitalize(nt.size)}`],nt.padding!=="normal"&&et[`padding${capitalize(nt.padding)}`],nt.align!=="inherit"&&et[`align${capitalize(nt.align)}`],nt.stickyHeader&&et.stickyHeader]}})(({theme:tt,ownerState:et})=>_extends$u({},tt.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:tt.vars?`1px solid ${tt.vars.palette.TableCell.border}`:`1px solid - ${tt.palette.mode==="light"?lighten(alpha$1(tt.palette.divider,1),.88):darken(alpha$1(tt.palette.divider,1),.68)}`,textAlign:"left",padding:16},et.variant==="head"&&{color:(tt.vars||tt).palette.text.primary,lineHeight:tt.typography.pxToRem(24),fontWeight:tt.typography.fontWeightMedium},et.variant==="body"&&{color:(tt.vars||tt).palette.text.primary},et.variant==="footer"&&{color:(tt.vars||tt).palette.text.secondary,lineHeight:tt.typography.pxToRem(21),fontSize:tt.typography.pxToRem(12)},et.size==="small"&&{padding:"6px 16px",[`&.${tableCellClasses$1.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},et.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},et.padding==="none"&&{padding:0},et.align==="left"&&{textAlign:"left"},et.align==="center"&&{textAlign:"center"},et.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},et.align==="justify"&&{textAlign:"justify"},et.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(tt.vars||tt).palette.background.default})),TableCell=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableCell"}),{align:rt="inherit",className:ot,component:at,padding:st,scope:lt,size:ct,sortDirection:ut,variant:ht}=it,dt=_objectWithoutPropertiesLoose$m(it,_excluded$t),pt=reactExports.useContext(TableContext$1),mt=reactExports.useContext(Tablelvl2Context$1),gt=mt&&mt.variant==="head";let bt;at?bt=at:bt=gt?"th":"td";let yt=lt;bt==="td"?yt=void 0:!yt&>&&(yt="col");const wt=ht||mt&&mt.variant,vt=_extends$u({},it,{align:rt,component:bt,padding:st||(pt&&pt.padding?pt.padding:"normal"),size:ct||(pt&&pt.size?pt.size:"medium"),sortDirection:ut,stickyHeader:wt==="head"&&pt&&pt.stickyHeader,variant:wt}),xt=useUtilityClasses$5(vt);let St=null;return ut&&(St=ut==="asc"?"ascending":"descending"),jsxRuntimeExports.jsx(TableCellRoot,_extends$u({as:bt,ref:nt,className:clsx$3(xt.root,ot),"aria-sort":St,scope:yt,ownerState:vt},dt))}),TableCell$1=TableCell;function getTableContainerUtilityClass(tt){return generateUtilityClass("MuiTableContainer",tt)}generateUtilityClasses("MuiTableContainer",["root"]);const _excluded$s=["className","component"],useUtilityClasses$4=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableContainerUtilityClass,et)},TableContainerRoot=styled$1("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(tt,et)=>et.root})({width:"100%",overflowX:"auto"}),TableContainer=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableContainer"}),{className:rt,component:ot="div"}=it,at=_objectWithoutPropertiesLoose$m(it,_excluded$s),st=_extends$u({},it,{component:ot}),lt=useUtilityClasses$4(st);return jsxRuntimeExports.jsx(TableContainerRoot,_extends$u({ref:nt,as:ot,className:clsx$3(lt.root,rt),ownerState:st},at))}),TableContainer$1=TableContainer;function getTableHeadUtilityClass(tt){return generateUtilityClass("MuiTableHead",tt)}generateUtilityClasses("MuiTableHead",["root"]);const _excluded$r=["className","component"],useUtilityClasses$3=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableHeadUtilityClass,et)},TableHeadRoot=styled$1("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"table-header-group"}),tablelvl2={variant:"head"},defaultComponent$1="thead",TableHead=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableHead"}),{className:rt,component:ot=defaultComponent$1}=it,at=_objectWithoutPropertiesLoose$m(it,_excluded$r),st=_extends$u({},it,{component:ot}),lt=useUtilityClasses$3(st);return jsxRuntimeExports.jsx(Tablelvl2Context$1.Provider,{value:tablelvl2,children:jsxRuntimeExports.jsx(TableHeadRoot,_extends$u({as:ot,className:clsx$3(lt.root,rt),ref:nt,role:ot===defaultComponent$1?null:"rowgroup",ownerState:st},at))})}),TableHead$1=TableHead,KeyboardArrowLeft=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),KeyboardArrowRight=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function getTableRowUtilityClass(tt){return generateUtilityClass("MuiTableRow",tt)}const tableRowClasses=generateUtilityClasses("MuiTableRow",["root","selected","hover","head","footer"]),tableRowClasses$1=tableRowClasses,_excluded$q=["className","component","hover","selected"],useUtilityClasses$2=tt=>{const{classes:et,selected:nt,hover:it,head:rt,footer:ot}=tt;return composeClasses({root:["root",nt&&"selected",it&&"hover",rt&&"head",ot&&"footer"]},getTableRowUtilityClass,et)},TableRowRoot=styled$1("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.head&&et.head,nt.footer&&et.footer]}})(({theme:tt})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${tableRowClasses$1.hover}:hover`]:{backgroundColor:(tt.vars||tt).palette.action.hover},[`&.${tableRowClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity)}}})),defaultComponent="tr",TableRow=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableRow"}),{className:rt,component:ot=defaultComponent,hover:at=!1,selected:st=!1}=it,lt=_objectWithoutPropertiesLoose$m(it,_excluded$q),ct=reactExports.useContext(Tablelvl2Context$1),ut=_extends$u({},it,{component:ot,hover:at,selected:st,head:ct&&ct.variant==="head",footer:ct&&ct.variant==="footer"}),ht=useUtilityClasses$2(ut);return jsxRuntimeExports.jsx(TableRowRoot,_extends$u({as:ot,ref:nt,className:clsx$3(ht.root,rt),role:ot===defaultComponent?null:"row",ownerState:ut},lt))}),TableRow$1=TableRow;function easeInOutSin(tt){return(1+Math.sin(Math.PI*tt-Math.PI/2))/2}function animate(tt,et,nt,it={},rt=()=>{}){const{ease:ot=easeInOutSin,duration:at=300}=it;let st=null;const lt=et[tt];let ct=!1;const ut=()=>{ct=!0},ht=dt=>{if(ct){rt(new Error("Animation cancelled"));return}st===null&&(st=dt);const pt=Math.min(1,(dt-st)/at);if(et[tt]=ot(pt)*(nt-lt)+lt,pt>=1){requestAnimationFrame(()=>{rt(null)});return}requestAnimationFrame(ht)};return lt===nt?(rt(new Error("Element already at target position")),ut):(requestAnimationFrame(ht),ut)}const _excluded$p=["onChange"],styles$2={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ScrollbarSize(tt){const{onChange:et}=tt,nt=_objectWithoutPropertiesLoose$m(tt,_excluded$p),it=reactExports.useRef(),rt=reactExports.useRef(null),ot=()=>{it.current=rt.current.offsetHeight-rt.current.clientHeight};return useEnhancedEffect$1(()=>{const at=debounce$4(()=>{const lt=it.current;ot(),lt!==it.current&&et(it.current)}),st=ownerWindow(rt.current);return st.addEventListener("resize",at),()=>{at.clear(),st.removeEventListener("resize",at)}},[et]),reactExports.useEffect(()=>{ot(),et(it.current)},[et]),jsxRuntimeExports.jsx("div",_extends$u({style:styles$2,ref:rt},nt))}function getTabScrollButtonUtilityClass(tt){return generateUtilityClass("MuiTabScrollButton",tt)}const tabScrollButtonClasses=generateUtilityClasses("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),tabScrollButtonClasses$1=tabScrollButtonClasses,_excluded$n=["className","slots","slotProps","direction","orientation","disabled"],useUtilityClasses$1=tt=>{const{classes:et,orientation:nt,disabled:it}=tt;return composeClasses({root:["root",nt,it&&"disabled"]},getTabScrollButtonUtilityClass,et)},TabScrollButtonRoot=styled$1(ButtonBase$1,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.orientation&&et[nt.orientation]]}})(({ownerState:tt})=>_extends$u({width:40,flexShrink:0,opacity:.8,[`&.${tabScrollButtonClasses$1.disabled}`]:{opacity:0}},tt.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${tt.isRtl?-90:90}deg)`}})),TabScrollButton=reactExports.forwardRef(function(et,nt){var it,rt;const ot=useThemeProps({props:et,name:"MuiTabScrollButton"}),{className:at,slots:st={},slotProps:lt={},direction:ct}=ot,ut=_objectWithoutPropertiesLoose$m(ot,_excluded$n),dt=useTheme().direction==="rtl",pt=_extends$u({isRtl:dt},ot),mt=useUtilityClasses$1(pt),gt=(it=st.StartScrollButtonIcon)!=null?it:KeyboardArrowLeft,bt=(rt=st.EndScrollButtonIcon)!=null?rt:KeyboardArrowRight,yt=useSlotProps({elementType:gt,externalSlotProps:lt.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:pt}),wt=useSlotProps({elementType:bt,externalSlotProps:lt.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:pt});return jsxRuntimeExports.jsx(TabScrollButtonRoot,_extends$u({component:"div",className:clsx$3(mt.root,at),ref:nt,role:null,ownerState:pt,tabIndex:null},ut,{children:ct==="left"?jsxRuntimeExports.jsx(gt,_extends$u({},yt)):jsxRuntimeExports.jsx(bt,_extends$u({},wt))}))}),TabScrollButton$1=TabScrollButton;function getTabsUtilityClass(tt){return generateUtilityClass("MuiTabs",tt)}const tabsClasses=generateUtilityClasses("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),tabsClasses$1=tabsClasses,_excluded$m=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],nextItem=(tt,et)=>tt===et?tt.firstChild:et&&et.nextElementSibling?et.nextElementSibling:tt.firstChild,previousItem=(tt,et)=>tt===et?tt.lastChild:et&&et.previousElementSibling?et.previousElementSibling:tt.lastChild,moveFocus=(tt,et,nt)=>{let it=!1,rt=nt(tt,et);for(;rt;){if(rt===tt.firstChild){if(it)return;it=!0}const ot=rt.disabled||rt.getAttribute("aria-disabled")==="true";if(!rt.hasAttribute("tabindex")||ot)rt=nt(tt,rt);else{rt.focus();return}}},useUtilityClasses=tt=>{const{vertical:et,fixed:nt,hideScrollbar:it,scrollableX:rt,scrollableY:ot,centered:at,scrollButtonsHideMobile:st,classes:lt}=tt;return composeClasses({root:["root",et&&"vertical"],scroller:["scroller",nt&&"fixed",it&&"hideScrollbar",rt&&"scrollableX",ot&&"scrollableY"],flexContainer:["flexContainer",et&&"flexContainerVertical",at&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",st&&"scrollButtonsHideMobile"],scrollableX:[rt&&"scrollableX"],hideScrollbar:[it&&"hideScrollbar"]},getTabsUtilityClass,lt)},TabsRoot=styled$1("div",{name:"MuiTabs",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`& .${tabsClasses$1.scrollButtons}`]:et.scrollButtons},{[`& .${tabsClasses$1.scrollButtons}`]:nt.scrollButtonsHideMobile&&et.scrollButtonsHideMobile},et.root,nt.vertical&&et.vertical]}})(({ownerState:tt,theme:et})=>_extends$u({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},tt.vertical&&{flexDirection:"column"},tt.scrollButtonsHideMobile&&{[`& .${tabsClasses$1.scrollButtons}`]:{[et.breakpoints.down("sm")]:{display:"none"}}})),TabsScroller=styled$1("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.scroller,nt.fixed&&et.fixed,nt.hideScrollbar&&et.hideScrollbar,nt.scrollableX&&et.scrollableX,nt.scrollableY&&et.scrollableY]}})(({ownerState:tt})=>_extends$u({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},tt.fixed&&{overflowX:"hidden",width:"100%"},tt.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},tt.scrollableX&&{overflowX:"auto",overflowY:"hidden"},tt.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),FlexContainer=styled$1("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.flexContainer,nt.vertical&&et.flexContainerVertical,nt.centered&&et.centered]}})(({ownerState:tt})=>_extends$u({display:"flex"},tt.vertical&&{flexDirection:"column"},tt.centered&&{justifyContent:"center"})),TabsIndicator=styled$1("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(tt,et)=>et.indicator})(({ownerState:tt,theme:et})=>_extends$u({position:"absolute",height:2,bottom:0,width:"100%",transition:et.transitions.create()},tt.indicatorColor==="primary"&&{backgroundColor:(et.vars||et).palette.primary.main},tt.indicatorColor==="secondary"&&{backgroundColor:(et.vars||et).palette.secondary.main},tt.vertical&&{height:"100%",width:2,right:0})),TabsScrollbarSize=styled$1(ScrollbarSize)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),defaultIndicatorStyle={},Tabs=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTabs"}),rt=useTheme(),ot=rt.direction==="rtl",{"aria-label":at,"aria-labelledby":st,action:lt,centered:ct=!1,children:ut,className:ht,component:dt="div",allowScrollButtonsMobile:pt=!1,indicatorColor:mt="primary",onChange:gt,orientation:bt="horizontal",ScrollButtonComponent:yt=TabScrollButton$1,scrollButtons:wt="auto",selectionFollowsFocus:vt,slots:xt={},slotProps:St={},TabIndicatorProps:Et={},TabScrollButtonProps:It={},textColor:Tt="primary",value:$t,variant:Ut="standard",visibleScrollbar:Lt=!1}=it,Bt=_objectWithoutPropertiesLoose$m(it,_excluded$m),Pt=Ut==="scrollable",kt=bt==="vertical",At=kt?"scrollTop":"scrollLeft",Rt=kt?"top":"left",Wt=kt?"bottom":"right",jt=kt?"clientHeight":"clientWidth",Ot=kt?"height":"width",Ct=_extends$u({},it,{component:dt,allowScrollButtonsMobile:pt,indicatorColor:mt,orientation:bt,vertical:kt,scrollButtons:wt,textColor:Tt,variant:Ut,visibleScrollbar:Lt,fixed:!Pt,hideScrollbar:Pt&&!Lt,scrollableX:Pt&&!kt,scrollableY:Pt&&kt,centered:ct&&!Pt,scrollButtonsHideMobile:!pt}),Dt=useUtilityClasses(Ct),Mt=useSlotProps({elementType:xt.StartScrollButtonIcon,externalSlotProps:St.startScrollButtonIcon,ownerState:Ct}),Vt=useSlotProps({elementType:xt.EndScrollButtonIcon,externalSlotProps:St.endScrollButtonIcon,ownerState:Ct}),[Qt,rn]=reactExports.useState(!1),[Xt,an]=reactExports.useState(defaultIndicatorStyle),[tn,pn]=reactExports.useState(!1),[vn,sn]=reactExports.useState(!1),[Zt,Sn]=reactExports.useState(!1),[Tn,Cn]=reactExports.useState({overflow:"hidden",scrollbarWidth:0}),jn=new Map,Un=reactExports.useRef(null),yn=reactExports.useRef(null),un=()=>{const Wn=Un.current;let Vn;if(Wn){const Jn=Wn.getBoundingClientRect();Vn={clientWidth:Wn.clientWidth,scrollLeft:Wn.scrollLeft,scrollTop:Wn.scrollTop,scrollLeftNormalized:getNormalizedScrollLeft(Wn,rt.direction),scrollWidth:Wn.scrollWidth,top:Jn.top,bottom:Jn.bottom,left:Jn.left,right:Jn.right}}let Fn;if(Wn&&$t!==!1){const Jn=yn.current.children;if(Jn.length>0){const Hn=Jn[jn.get($t)];Fn=Hn?Hn.getBoundingClientRect():null}}return{tabsMeta:Vn,tabMeta:Fn}},En=useEventCallback(()=>{const{tabsMeta:Wn,tabMeta:Vn}=un();let Fn=0,Jn;if(kt)Jn="top",Vn&&Wn&&(Fn=Vn.top-Wn.top+Wn.scrollTop);else if(Jn=ot?"right":"left",Vn&&Wn){const dr=ot?Wn.scrollLeftNormalized+Wn.clientWidth-Wn.scrollWidth:Wn.scrollLeft;Fn=(ot?-1:1)*(Vn[Jn]-Wn[Jn]+dr)}const Hn={[Jn]:Fn,[Ot]:Vn?Vn[Ot]:0};if(isNaN(Xt[Jn])||isNaN(Xt[Ot]))an(Hn);else{const dr=Math.abs(Xt[Jn]-Hn[Jn]),ur=Math.abs(Xt[Ot]-Hn[Ot]);(dr>=1||ur>=1)&&an(Hn)}}),In=(Wn,{animation:Vn=!0}={})=>{Vn?animate(At,Un.current,Wn,{duration:rt.transitions.duration.standard}):Un.current[At]=Wn},xn=Wn=>{let Vn=Un.current[At];kt?Vn+=Wn:(Vn+=Wn*(ot?-1:1),Vn*=ot&&detectScrollType()==="reverse"?-1:1),In(Vn)},dn=()=>{const Wn=Un.current[jt];let Vn=0;const Fn=Array.from(yn.current.children);for(let Jn=0;JnWn){Jn===0&&(Vn=Wn);break}Vn+=Hn[jt]}return Vn},cn=()=>{xn(-1*dn())},hn=()=>{xn(dn())},$n=reactExports.useCallback(Wn=>{Cn({overflow:null,scrollbarWidth:Wn})},[]),nn=()=>{const Wn={};Wn.scrollbarSizeListener=Pt?jsxRuntimeExports.jsx(TabsScrollbarSize,{onChange:$n,className:clsx$3(Dt.scrollableX,Dt.hideScrollbar)}):null;const Fn=Pt&&(wt==="auto"&&(tn||vn)||wt===!0);return Wn.scrollButtonStart=Fn?jsxRuntimeExports.jsx(yt,_extends$u({slots:{StartScrollButtonIcon:xt.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Mt},orientation:bt,direction:ot?"right":"left",onClick:cn,disabled:!tn},It,{className:clsx$3(Dt.scrollButtons,It.className)})):null,Wn.scrollButtonEnd=Fn?jsxRuntimeExports.jsx(yt,_extends$u({slots:{EndScrollButtonIcon:xt.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Vt},orientation:bt,direction:ot?"left":"right",onClick:hn,disabled:!vn},It,{className:clsx$3(Dt.scrollButtons,It.className)})):null,Wn},Kt=useEventCallback(Wn=>{const{tabsMeta:Vn,tabMeta:Fn}=un();if(!(!Fn||!Vn)){if(Fn[Rt]Vn[Wt]){const Jn=Vn[At]+(Fn[Wt]-Vn[Wt]);In(Jn,{animation:Wn})}}}),Yt=useEventCallback(()=>{Pt&&wt!==!1&&Sn(!Zt)});reactExports.useEffect(()=>{const Wn=debounce$4(()=>{Un.current&&En()});let Vn;const Fn=dr=>{dr.forEach(ur=>{ur.removedNodes.forEach(_r=>{var Qr;(Qr=Vn)==null||Qr.unobserve(_r)}),ur.addedNodes.forEach(_r=>{var Qr;(Qr=Vn)==null||Qr.observe(_r)})}),Wn(),Yt()},Jn=ownerWindow(Un.current);Jn.addEventListener("resize",Wn);let Hn;return typeof ResizeObserver<"u"&&(Vn=new ResizeObserver(Wn),Array.from(yn.current.children).forEach(dr=>{Vn.observe(dr)})),typeof MutationObserver<"u"&&(Hn=new MutationObserver(Fn),Hn.observe(yn.current,{childList:!0})),()=>{var dr,ur;Wn.clear(),Jn.removeEventListener("resize",Wn),(dr=Hn)==null||dr.disconnect(),(ur=Vn)==null||ur.disconnect()}},[En,Yt]),reactExports.useEffect(()=>{const Wn=Array.from(yn.current.children),Vn=Wn.length;if(typeof IntersectionObserver<"u"&&Vn>0&&Pt&&wt!==!1){const Fn=Wn[0],Jn=Wn[Vn-1],Hn={root:Un.current,threshold:.99},dr=jr=>{pn(!jr[0].isIntersecting)},ur=new IntersectionObserver(dr,Hn);ur.observe(Fn);const _r=jr=>{sn(!jr[0].isIntersecting)},Qr=new IntersectionObserver(_r,Hn);return Qr.observe(Jn),()=>{ur.disconnect(),Qr.disconnect()}}},[Pt,wt,Zt,ut==null?void 0:ut.length]),reactExports.useEffect(()=>{rn(!0)},[]),reactExports.useEffect(()=>{En()}),reactExports.useEffect(()=>{Kt(defaultIndicatorStyle!==Xt)},[Kt,Xt]),reactExports.useImperativeHandle(lt,()=>({updateIndicator:En,updateScrollButtons:Yt}),[En,Yt]);const _n=jsxRuntimeExports.jsx(TabsIndicator,_extends$u({},Et,{className:clsx$3(Dt.indicator,Et.className),ownerState:Ct,style:_extends$u({},Xt,Et.style)}));let Mn=0;const Bn=reactExports.Children.map(ut,Wn=>{if(!reactExports.isValidElement(Wn))return null;const Vn=Wn.props.value===void 0?Mn:Wn.props.value;jn.set(Vn,Mn);const Fn=Vn===$t;return Mn+=1,reactExports.cloneElement(Wn,_extends$u({fullWidth:Ut==="fullWidth",indicator:Fn&&!Qt&&_n,selected:Fn,selectionFollowsFocus:vt,onChange:gt,textColor:Tt,value:Vn},Mn===1&&$t===!1&&!Wn.props.tabIndex?{tabIndex:0}:{}))}),Nn=Wn=>{const Vn=yn.current,Fn=ownerDocument(Vn).activeElement;if(Fn.getAttribute("role")!=="tab")return;let Hn=bt==="horizontal"?"ArrowLeft":"ArrowUp",dr=bt==="horizontal"?"ArrowRight":"ArrowDown";switch(bt==="horizontal"&&ot&&(Hn="ArrowRight",dr="ArrowLeft"),Wn.key){case Hn:Wn.preventDefault(),moveFocus(Vn,Fn,previousItem);break;case dr:Wn.preventDefault(),moveFocus(Vn,Fn,nextItem);break;case"Home":Wn.preventDefault(),moveFocus(Vn,null,nextItem);break;case"End":Wn.preventDefault(),moveFocus(Vn,null,previousItem);break}},qn=nn();return jsxRuntimeExports.jsxs(TabsRoot,_extends$u({className:clsx$3(Dt.root,ht),ownerState:Ct,ref:nt,as:dt},Bt,{children:[qn.scrollButtonStart,qn.scrollbarSizeListener,jsxRuntimeExports.jsxs(TabsScroller,{className:Dt.scroller,ownerState:Ct,style:{overflow:Tn.overflow,[kt?`margin${ot?"Left":"Right"}`:"marginBottom"]:Lt?void 0:-Tn.scrollbarWidth},ref:Un,children:[jsxRuntimeExports.jsx(FlexContainer,{"aria-label":at,"aria-labelledby":st,"aria-orientation":bt==="vertical"?"vertical":null,className:Dt.flexContainer,ownerState:Ct,onKeyDown:Nn,ref:yn,role:"tablist",children:Bn}),Qt&&_n]}),qn.scrollButtonEnd]}))}),Tabs$1=Tabs,cssWithMediaQuery=tt=>(et,...nt)=>{const it=Ae(et,...nt);return it.join("").trim()?Ae` + `),waveKeyframe,(et.vars||et).palette.action.hover)),Skeleton=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiSkeleton"}),{animation:rt="pulse",className:ot,component:at="span",height:st,style:lt,variant:ct="text",width:ut}=it,ht=_objectWithoutPropertiesLoose$m(it,_excluded$y),dt=_extends$t({},it,{animation:rt,component:at,variant:ct,hasChildren:!!ht.children}),pt=useUtilityClasses$a(dt);return jsxRuntimeExports.jsx(SkeletonRoot,_extends$t({as:at,ref:nt,className:clsx$3(pt.root,ot),ownerState:dt},ht,{style:_extends$t({width:ut,height:st},lt)}))}),Skeleton$1=Skeleton,shouldSpreadAdditionalProps=tt=>!tt||!isHostComponent(tt),shouldSpreadAdditionalProps$1=shouldSpreadAdditionalProps;function getSliderUtilityClass(tt){return generateUtilityClass("MuiSlider",tt)}const sliderClasses=generateUtilityClasses("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"]),sliderClasses$1=sliderClasses,useValueLabelClasses=tt=>{const{open:et}=tt;return{offset:clsx$3(et&&sliderClasses$1.valueLabelOpen),circle:sliderClasses$1.valueLabelCircle,label:sliderClasses$1.valueLabelLabel}};function SliderValueLabel$1(tt){const{children:et,className:nt,value:it}=tt,rt=useValueLabelClasses(tt);return et?reactExports.cloneElement(et,{className:clsx$3(et.props.className)},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[et.props.children,jsxRuntimeExports.jsx("span",{className:clsx$3(rt.offset,nt),"aria-hidden":!0,children:jsxRuntimeExports.jsx("span",{className:rt.circle,children:jsxRuntimeExports.jsx("span",{className:rt.label,children:it})})})]})):null}const _excluded$x=["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 Identity(tt){return tt}const SliderRoot=styled$1("span",{name:"MuiSlider",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[`color${capitalize(nt.color)}`],nt.size!=="medium"&&et[`size${capitalize(nt.size)}`],nt.marked&&et.marked,nt.orientation==="vertical"&&et.vertical,nt.track==="inverted"&&et.trackInverted,nt.track===!1&&et.trackFalse]}})(({theme:tt,ownerState:et})=>_extends$t({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(tt.vars||tt).palette[et.color].main,WebkitTapHighlightColor:"transparent"},et.orientation==="horizontal"&&_extends$t({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},et.size==="small"&&{height:2},et.marked&&{marginBottom:20}),et.orientation==="vertical"&&_extends$t({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},et.size==="small"&&{width:2},et.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${sliderClasses$1.disabled}`]:{pointerEvents:"none",cursor:"default",color:(tt.vars||tt).palette.grey[400]},[`&.${sliderClasses$1.dragging}`]:{[`& .${sliderClasses$1.thumb}, & .${sliderClasses$1.track}`]:{transition:"none"}}})),SliderRail=styled$1("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(tt,et)=>et.rail})(({ownerState:tt})=>_extends$t({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},tt.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},tt.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},tt.track==="inverted"&&{opacity:1})),SliderTrack=styled$1("span",{name:"MuiSlider",slot:"Track",overridesResolver:(tt,et)=>et.track})(({theme:tt,ownerState:et})=>{const nt=tt.palette.mode==="light"?lighten(tt.palette[et.color].main,.62):darken(tt.palette[et.color].main,.5);return _extends$t({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:tt.transitions.create(["left","width","bottom","height"],{duration:tt.transitions.duration.shortest})},et.size==="small"&&{border:"none"},et.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},et.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},et.track===!1&&{display:"none"},et.track==="inverted"&&{backgroundColor:tt.vars?tt.vars.palette.Slider[`${et.color}Track`]:nt,borderColor:tt.vars?tt.vars.palette.Slider[`${et.color}Track`]:nt})}),SliderThumb=styled$1("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.thumb,et[`thumbColor${capitalize(nt.color)}`],nt.size!=="medium"&&et[`thumbSize${capitalize(nt.size)}`]]}})(({theme:tt,ownerState:et})=>_extends$t({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:tt.transitions.create(["box-shadow","left","bottom"],{duration:tt.transitions.duration.shortest})},et.size==="small"&&{width:12,height:12},et.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},et.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&:before":_extends$t({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(tt.vars||tt).shadows[2]},et.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${sliderClasses$1.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.16)`:alpha$1(tt.palette[et.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${sliderClasses$1.active}`]:{boxShadow:`0px 0px 0px 14px ${tt.vars?`rgba(${tt.vars.palette[et.color].mainChannel} / 0.16)`:alpha$1(tt.palette[et.color].main,.16)}`},[`&.${sliderClasses$1.disabled}`]:{"&:hover":{boxShadow:"none"}}})),SliderValueLabel=styled$1(SliderValueLabel$1,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(tt,et)=>et.valueLabel})(({theme:tt,ownerState:et})=>_extends$t({[`&.${sliderClasses$1.valueLabelOpen}`]:{transform:`${et.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},tt.typography.body2,{fontWeight:500,transition:tt.transitions.create(["transform"],{duration:tt.transitions.duration.shortest}),transform:`${et.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(tt.vars||tt).palette.grey[600],borderRadius:2,color:(tt.vars||tt).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},et.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%"}},et.orientation==="vertical"&&{right:et.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%"}},et.size==="small"&&{fontSize:tt.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),SliderMark=styled$1("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="markActive",overridesResolver:(tt,et)=>{const{markActive:nt}=tt;return[et.mark,nt&&et.markActive]}})(({theme:tt,ownerState:et,markActive:nt})=>_extends$t({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},et.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},et.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},nt&&{backgroundColor:(tt.vars||tt).palette.background.paper,opacity:.8})),SliderMarkLabel=styled$1("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:tt=>slotShouldForwardProp(tt)&&tt!=="markLabelActive",overridesResolver:(tt,et)=>et.markLabel})(({theme:tt,ownerState:et,markLabelActive:nt})=>_extends$t({},tt.typography.body2,{color:(tt.vars||tt).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},et.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},et.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},nt&&{color:(tt.vars||tt).palette.text.primary})),useUtilityClasses$9=tt=>{const{disabled:et,dragging:nt,marked:it,orientation:rt,track:ot,classes:at,color:st,size:lt}=tt,ct={root:["root",et&&"disabled",nt&&"dragging",it&&"marked",rt==="vertical"&&"vertical",ot==="inverted"&&"trackInverted",ot===!1&&"trackFalse",st&&`color${capitalize(st)}`,lt&&`size${capitalize(lt)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",et&&"disabled",lt&&`thumbSize${capitalize(lt)}`,st&&`thumbColor${capitalize(st)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return composeClasses(ct,getSliderUtilityClass,at)},Forward=({children:tt})=>tt,Slider=reactExports.forwardRef(function(et,nt){var it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,$t,It,Ft,Ht;const zt=useThemeProps({props:et,name:"MuiSlider"}),jt=useTheme().direction==="rtl",{"aria-label":kt,"aria-valuetext":Tt,"aria-labelledby":Ct,component:Ut="span",components:Nt={},componentsProps:Bt={},color:Mt="primary",classes:Dt,className:Pt,disableSwap:Vt=!1,disabled:nn=!1,getAriaLabel:cn,getAriaValueText:Xt,marks:un=!1,max:en=100,min:fn=0,orientation:xn="horizontal",size:an="medium",step:Zt=1,scale:En=Identity,slotProps:In,slots:Cn,track:Nn="normal",valueLabelDisplay:Un="off",valueLabelFormat:_n=Identity}=zt,An=_objectWithoutPropertiesLoose$m(zt,_excluded$x),gn=_extends$t({},zt,{isRtl:jt,max:en,min:fn,classes:Dt,disabled:nn,disableSwap:Vt,orientation:xn,marks:un,color:Mt,size:an,step:Zt,scale:En,track:Nn,valueLabelDisplay:Un,valueLabelFormat:_n}),{axisProps:Tn,getRootProps:yn,getHiddenInputProps:dn,getThumbProps:sn,open:rn,active:Sn,axis:tn,focusedThumbIndex:qt,range:Kt,dragging:wn,marks:Rn,values:jn,trackOffset:Bn,trackLeap:Xn,getThumbStyle:Wn}=useSlider(_extends$t({},gn,{rootRef:nt}));gn.marked=Rn.length>0&&Rn.some(er=>er.label),gn.dragging=wn,gn.focusedThumbIndex=qt;const Gn=useUtilityClasses$9(gn),Fn=(it=(rt=Cn==null?void 0:Cn.root)!=null?rt:Nt.Root)!=null?it:SliderRoot,Jn=(ot=(at=Cn==null?void 0:Cn.rail)!=null?at:Nt.Rail)!=null?ot:SliderRail,Vn=(st=(lt=Cn==null?void 0:Cn.track)!=null?lt:Nt.Track)!=null?st:SliderTrack,dr=(ct=(ut=Cn==null?void 0:Cn.thumb)!=null?ut:Nt.Thumb)!=null?ct:SliderThumb,ur=(ht=(dt=Cn==null?void 0:Cn.valueLabel)!=null?dt:Nt.ValueLabel)!=null?ht:SliderValueLabel,_r=(pt=(mt=Cn==null?void 0:Cn.mark)!=null?mt:Nt.Mark)!=null?pt:SliderMark,Qr=(gt=(bt=Cn==null?void 0:Cn.markLabel)!=null?bt:Nt.MarkLabel)!=null?gt:SliderMarkLabel,Or=(yt=(wt=Cn==null?void 0:Cn.input)!=null?wt:Nt.Input)!=null?yt:"input",Mr=(vt=In==null?void 0:In.root)!=null?vt:Bt.root,qr=(xt=In==null?void 0:In.rail)!=null?xt:Bt.rail,Ur=(St=In==null?void 0:In.track)!=null?St:Bt.track,Lr=(Et=In==null?void 0:In.thumb)!=null?Et:Bt.thumb,ao=($t=In==null?void 0:In.valueLabel)!=null?$t:Bt.valueLabel,Gr=(It=In==null?void 0:In.mark)!=null?It:Bt.mark,Br=(Ft=In==null?void 0:In.markLabel)!=null?Ft:Bt.markLabel,go=(Ht=In==null?void 0:In.input)!=null?Ht:Bt.input,vn=useSlotProps({elementType:Fn,getSlotProps:yn,externalSlotProps:Mr,externalForwardedProps:An,additionalProps:_extends$t({},shouldSpreadAdditionalProps$1(Fn)&&{as:Ut}),ownerState:_extends$t({},gn,Mr==null?void 0:Mr.ownerState),className:[Gn.root,Pt]}),Pn=useSlotProps({elementType:Jn,externalSlotProps:qr,ownerState:gn,className:Gn.rail}),hn=useSlotProps({elementType:Vn,externalSlotProps:Ur,additionalProps:{style:_extends$t({},Tn[tn].offset(Bn),Tn[tn].leap(Xn))},ownerState:_extends$t({},gn,Ur==null?void 0:Ur.ownerState),className:Gn.track}),Jt=useSlotProps({elementType:dr,getSlotProps:sn,externalSlotProps:Lr,ownerState:_extends$t({},gn,Lr==null?void 0:Lr.ownerState),className:Gn.thumb}),kn=useSlotProps({elementType:ur,externalSlotProps:ao,ownerState:_extends$t({},gn,ao==null?void 0:ao.ownerState),className:Gn.valueLabel}),On=useSlotProps({elementType:_r,externalSlotProps:Gr,ownerState:gn,className:Gn.mark}),Dn=useSlotProps({elementType:Qr,externalSlotProps:Br,ownerState:gn,className:Gn.markLabel}),Yn=useSlotProps({elementType:Or,getSlotProps:dn,externalSlotProps:go,ownerState:gn});return jsxRuntimeExports.jsxs(Fn,_extends$t({},vn,{children:[jsxRuntimeExports.jsx(Jn,_extends$t({},Pn)),jsxRuntimeExports.jsx(Vn,_extends$t({},hn)),Rn.filter(er=>er.value>=fn&&er.value<=en).map((er,or)=>{const ar=valueToPercent(er.value,fn,en),Vr=Tn[tn].offset(ar);let wr;return Nn===!1?wr=jn.indexOf(er.value)!==-1:wr=Nn==="normal"&&(Kt?er.value>=jn[0]&&er.value<=jn[jn.length-1]:er.value<=jn[0])||Nn==="inverted"&&(Kt?er.value<=jn[0]||er.value>=jn[jn.length-1]:er.value>=jn[0]),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(_r,_extends$t({"data-index":or},On,!isHostComponent(_r)&&{markActive:wr},{style:_extends$t({},Vr,On.style),className:clsx$3(On.className,wr&&Gn.markActive)})),er.label!=null?jsxRuntimeExports.jsx(Qr,_extends$t({"aria-hidden":!0,"data-index":or},Dn,!isHostComponent(Qr)&&{markLabelActive:wr},{style:_extends$t({},Vr,Dn.style),className:clsx$3(Gn.markLabel,Dn.className,wr&&Gn.markLabelActive),children:er.label})):null]},or)}),jn.map((er,or)=>{const ar=valueToPercent(er,fn,en),Vr=Tn[tn].offset(ar),wr=Un==="off"?Forward:ur;return jsxRuntimeExports.jsx(wr,_extends$t({},!isHostComponent(wr)&&{valueLabelFormat:_n,valueLabelDisplay:Un,value:typeof _n=="function"?_n(En(er),or):_n,index:or,open:rn===or||Sn===or||Un==="on",disabled:nn},kn,{children:jsxRuntimeExports.jsx(dr,_extends$t({"data-index":or},Jt,{className:clsx$3(Gn.thumb,Jt.className,Sn===or&&Gn.active,qt===or&&Gn.focusVisible),style:_extends$t({},Vr,Wn(or),Jt.style),children:jsxRuntimeExports.jsx(Or,_extends$t({"data-index":or,"aria-label":cn?cn(or):kt,"aria-valuenow":En(er),"aria-labelledby":Ct,"aria-valuetext":Xt?Xt(En(er),or):Tt,value:jn[or]},Yn))}))}),or)})]}))}),Slider$1=Slider;function getTabUtilityClass(tt){return generateUtilityClass("MuiTab",tt)}const tabClasses=generateUtilityClasses("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),tabClasses$1=tabClasses,_excluded$w=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],useUtilityClasses$8=tt=>{const{classes:et,textColor:nt,fullWidth:it,wrapped:rt,icon:ot,label:at,selected:st,disabled:lt}=tt,ct={root:["root",ot&&at&&"labelIcon",`textColor${capitalize(nt)}`,it&&"fullWidth",rt&&"wrapped",st&&"selected",lt&&"disabled"],iconWrapper:["iconWrapper"]};return composeClasses(ct,getTabUtilityClass,et)},TabRoot=styled$1(ButtonBase$1,{name:"MuiTab",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.label&&nt.icon&&et.labelIcon,et[`textColor${capitalize(nt.textColor)}`],nt.fullWidth&&et.fullWidth,nt.wrapped&&et.wrapped]}})(({theme:tt,ownerState:et})=>_extends$t({},tt.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},et.label&&{flexDirection:et.iconPosition==="top"||et.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},et.icon&&et.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${tabClasses$1.iconWrapper}`]:_extends$t({},et.iconPosition==="top"&&{marginBottom:6},et.iconPosition==="bottom"&&{marginTop:6},et.iconPosition==="start"&&{marginRight:tt.spacing(1)},et.iconPosition==="end"&&{marginLeft:tt.spacing(1)})},et.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${tabClasses$1.selected}`]:{opacity:1},[`&.${tabClasses$1.disabled}`]:{opacity:(tt.vars||tt).palette.action.disabledOpacity}},et.textColor==="primary"&&{color:(tt.vars||tt).palette.text.secondary,[`&.${tabClasses$1.selected}`]:{color:(tt.vars||tt).palette.primary.main},[`&.${tabClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled}},et.textColor==="secondary"&&{color:(tt.vars||tt).palette.text.secondary,[`&.${tabClasses$1.selected}`]:{color:(tt.vars||tt).palette.secondary.main},[`&.${tabClasses$1.disabled}`]:{color:(tt.vars||tt).palette.text.disabled}},et.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},et.wrapped&&{fontSize:tt.typography.pxToRem(12)})),Tab$1=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTab"}),{className:rt,disabled:ot=!1,disableFocusRipple:at=!1,fullWidth:st,icon:lt,iconPosition:ct="top",indicator:ut,label:ht,onChange:dt,onClick:pt,onFocus:mt,selected:gt,selectionFollowsFocus:bt,textColor:yt="inherit",value:wt,wrapped:vt=!1}=it,xt=_objectWithoutPropertiesLoose$m(it,_excluded$w),St=_extends$t({},it,{disabled:ot,disableFocusRipple:at,selected:gt,icon:!!lt,iconPosition:ct,label:!!ht,fullWidth:st,textColor:yt,wrapped:vt}),Et=useUtilityClasses$8(St),$t=lt&&ht&&reactExports.isValidElement(lt)?reactExports.cloneElement(lt,{className:clsx$3(Et.iconWrapper,lt.props.className)}):lt,It=Ht=>{!gt&&dt&&dt(Ht,wt),pt&&pt(Ht)},Ft=Ht=>{bt&&!gt&&dt&&dt(Ht,wt),mt&&mt(Ht)};return jsxRuntimeExports.jsxs(TabRoot,_extends$t({focusRipple:!at,className:clsx$3(Et.root,rt),ref:nt,role:"tab","aria-selected":gt,disabled:ot,onClick:It,onFocus:Ft,ownerState:St,tabIndex:gt?0:-1},xt,{children:[ct==="top"||ct==="start"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[$t,ht]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ht,$t]}),ut]}))}),Tab$2=Tab$1,TableContext=reactExports.createContext(),TableContext$1=TableContext;function getTableUtilityClass(tt){return generateUtilityClass("MuiTable",tt)}generateUtilityClasses("MuiTable",["root","stickyHeader"]);const _excluded$v=["className","component","padding","size","stickyHeader"],useUtilityClasses$7=tt=>{const{classes:et,stickyHeader:nt}=tt;return composeClasses({root:["root",nt&&"stickyHeader"]},getTableUtilityClass,et)},TableRoot=styled$1("table",{name:"MuiTable",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.stickyHeader&&et.stickyHeader]}})(({theme:tt,ownerState:et})=>_extends$t({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":_extends$t({},tt.typography.body2,{padding:tt.spacing(2),color:(tt.vars||tt).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},et.stickyHeader&&{borderCollapse:"separate"})),defaultComponent$3="table",Table$3=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTable"}),{className:rt,component:ot=defaultComponent$3,padding:at="normal",size:st="medium",stickyHeader:lt=!1}=it,ct=_objectWithoutPropertiesLoose$m(it,_excluded$v),ut=_extends$t({},it,{component:ot,padding:at,size:st,stickyHeader:lt}),ht=useUtilityClasses$7(ut),dt=reactExports.useMemo(()=>({padding:at,size:st,stickyHeader:lt}),[at,st,lt]);return jsxRuntimeExports.jsx(TableContext$1.Provider,{value:dt,children:jsxRuntimeExports.jsx(TableRoot,_extends$t({as:ot,role:ot===defaultComponent$3?null:"table",ref:nt,className:clsx$3(ht.root,rt),ownerState:ut},ct))})}),MaterialTable=Table$3,Tablelvl2Context=reactExports.createContext(),Tablelvl2Context$1=Tablelvl2Context;function getTableBodyUtilityClass(tt){return generateUtilityClass("MuiTableBody",tt)}generateUtilityClasses("MuiTableBody",["root"]);const _excluded$u=["className","component"],useUtilityClasses$6=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableBodyUtilityClass,et)},TableBodyRoot=styled$1("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"table-row-group"}),tablelvl2$1={variant:"body"},defaultComponent$2="tbody",TableBody=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableBody"}),{className:rt,component:ot=defaultComponent$2}=it,at=_objectWithoutPropertiesLoose$m(it,_excluded$u),st=_extends$t({},it,{component:ot}),lt=useUtilityClasses$6(st);return jsxRuntimeExports.jsx(Tablelvl2Context$1.Provider,{value:tablelvl2$1,children:jsxRuntimeExports.jsx(TableBodyRoot,_extends$t({className:clsx$3(lt.root,rt),as:ot,ref:nt,role:ot===defaultComponent$2?null:"rowgroup",ownerState:st},at))})}),TableBody$1=TableBody;function getTableCellUtilityClass(tt){return generateUtilityClass("MuiTableCell",tt)}const tableCellClasses=generateUtilityClasses("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),tableCellClasses$1=tableCellClasses,_excluded$t=["align","className","component","padding","scope","size","sortDirection","variant"],useUtilityClasses$5=tt=>{const{classes:et,variant:nt,align:it,padding:rt,size:ot,stickyHeader:at}=tt,st={root:["root",nt,at&&"stickyHeader",it!=="inherit"&&`align${capitalize(it)}`,rt!=="normal"&&`padding${capitalize(rt)}`,`size${capitalize(ot)}`]};return composeClasses(st,getTableCellUtilityClass,et)},TableCellRoot=styled$1("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,et[nt.variant],et[`size${capitalize(nt.size)}`],nt.padding!=="normal"&&et[`padding${capitalize(nt.padding)}`],nt.align!=="inherit"&&et[`align${capitalize(nt.align)}`],nt.stickyHeader&&et.stickyHeader]}})(({theme:tt,ownerState:et})=>_extends$t({},tt.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:tt.vars?`1px solid ${tt.vars.palette.TableCell.border}`:`1px solid + ${tt.palette.mode==="light"?lighten(alpha$1(tt.palette.divider,1),.88):darken(alpha$1(tt.palette.divider,1),.68)}`,textAlign:"left",padding:16},et.variant==="head"&&{color:(tt.vars||tt).palette.text.primary,lineHeight:tt.typography.pxToRem(24),fontWeight:tt.typography.fontWeightMedium},et.variant==="body"&&{color:(tt.vars||tt).palette.text.primary},et.variant==="footer"&&{color:(tt.vars||tt).palette.text.secondary,lineHeight:tt.typography.pxToRem(21),fontSize:tt.typography.pxToRem(12)},et.size==="small"&&{padding:"6px 16px",[`&.${tableCellClasses$1.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},et.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},et.padding==="none"&&{padding:0},et.align==="left"&&{textAlign:"left"},et.align==="center"&&{textAlign:"center"},et.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},et.align==="justify"&&{textAlign:"justify"},et.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(tt.vars||tt).palette.background.default})),TableCell=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableCell"}),{align:rt="inherit",className:ot,component:at,padding:st,scope:lt,size:ct,sortDirection:ut,variant:ht}=it,dt=_objectWithoutPropertiesLoose$m(it,_excluded$t),pt=reactExports.useContext(TableContext$1),mt=reactExports.useContext(Tablelvl2Context$1),gt=mt&&mt.variant==="head";let bt;at?bt=at:bt=gt?"th":"td";let yt=lt;bt==="td"?yt=void 0:!yt&>&&(yt="col");const wt=ht||mt&&mt.variant,vt=_extends$t({},it,{align:rt,component:bt,padding:st||(pt&&pt.padding?pt.padding:"normal"),size:ct||(pt&&pt.size?pt.size:"medium"),sortDirection:ut,stickyHeader:wt==="head"&&pt&&pt.stickyHeader,variant:wt}),xt=useUtilityClasses$5(vt);let St=null;return ut&&(St=ut==="asc"?"ascending":"descending"),jsxRuntimeExports.jsx(TableCellRoot,_extends$t({as:bt,ref:nt,className:clsx$3(xt.root,ot),"aria-sort":St,scope:yt,ownerState:vt},dt))}),TableCell$1=TableCell;function getTableContainerUtilityClass(tt){return generateUtilityClass("MuiTableContainer",tt)}generateUtilityClasses("MuiTableContainer",["root"]);const _excluded$s=["className","component"],useUtilityClasses$4=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableContainerUtilityClass,et)},TableContainerRoot=styled$1("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(tt,et)=>et.root})({width:"100%",overflowX:"auto"}),TableContainer=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableContainer"}),{className:rt,component:ot="div"}=it,at=_objectWithoutPropertiesLoose$m(it,_excluded$s),st=_extends$t({},it,{component:ot}),lt=useUtilityClasses$4(st);return jsxRuntimeExports.jsx(TableContainerRoot,_extends$t({ref:nt,as:ot,className:clsx$3(lt.root,rt),ownerState:st},at))}),TableContainer$1=TableContainer;function getTableHeadUtilityClass(tt){return generateUtilityClass("MuiTableHead",tt)}generateUtilityClasses("MuiTableHead",["root"]);const _excluded$r=["className","component"],useUtilityClasses$3=tt=>{const{classes:et}=tt;return composeClasses({root:["root"]},getTableHeadUtilityClass,et)},TableHeadRoot=styled$1("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(tt,et)=>et.root})({display:"table-header-group"}),tablelvl2={variant:"head"},defaultComponent$1="thead",TableHead=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableHead"}),{className:rt,component:ot=defaultComponent$1}=it,at=_objectWithoutPropertiesLoose$m(it,_excluded$r),st=_extends$t({},it,{component:ot}),lt=useUtilityClasses$3(st);return jsxRuntimeExports.jsx(Tablelvl2Context$1.Provider,{value:tablelvl2,children:jsxRuntimeExports.jsx(TableHeadRoot,_extends$t({as:ot,className:clsx$3(lt.root,rt),ref:nt,role:ot===defaultComponent$1?null:"rowgroup",ownerState:st},at))})}),TableHead$1=TableHead,KeyboardArrowLeft=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),KeyboardArrowRight=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function getTableRowUtilityClass(tt){return generateUtilityClass("MuiTableRow",tt)}const tableRowClasses=generateUtilityClasses("MuiTableRow",["root","selected","hover","head","footer"]),tableRowClasses$1=tableRowClasses,_excluded$q=["className","component","hover","selected"],useUtilityClasses$2=tt=>{const{classes:et,selected:nt,hover:it,head:rt,footer:ot}=tt;return composeClasses({root:["root",nt&&"selected",it&&"hover",rt&&"head",ot&&"footer"]},getTableRowUtilityClass,et)},TableRowRoot=styled$1("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.head&&et.head,nt.footer&&et.footer]}})(({theme:tt})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${tableRowClasses$1.hover}:hover`]:{backgroundColor:(tt.vars||tt).palette.action.hover},[`&.${tableRowClasses$1.selected}`]:{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / ${tt.vars.palette.action.selectedOpacity})`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity),"&:hover":{backgroundColor:tt.vars?`rgba(${tt.vars.palette.primary.mainChannel} / calc(${tt.vars.palette.action.selectedOpacity} + ${tt.vars.palette.action.hoverOpacity}))`:alpha$1(tt.palette.primary.main,tt.palette.action.selectedOpacity+tt.palette.action.hoverOpacity)}}})),defaultComponent="tr",TableRow=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTableRow"}),{className:rt,component:ot=defaultComponent,hover:at=!1,selected:st=!1}=it,lt=_objectWithoutPropertiesLoose$m(it,_excluded$q),ct=reactExports.useContext(Tablelvl2Context$1),ut=_extends$t({},it,{component:ot,hover:at,selected:st,head:ct&&ct.variant==="head",footer:ct&&ct.variant==="footer"}),ht=useUtilityClasses$2(ut);return jsxRuntimeExports.jsx(TableRowRoot,_extends$t({as:ot,ref:nt,className:clsx$3(ht.root,rt),role:ot===defaultComponent?null:"row",ownerState:ut},lt))}),TableRow$1=TableRow;function easeInOutSin(tt){return(1+Math.sin(Math.PI*tt-Math.PI/2))/2}function animate(tt,et,nt,it={},rt=()=>{}){const{ease:ot=easeInOutSin,duration:at=300}=it;let st=null;const lt=et[tt];let ct=!1;const ut=()=>{ct=!0},ht=dt=>{if(ct){rt(new Error("Animation cancelled"));return}st===null&&(st=dt);const pt=Math.min(1,(dt-st)/at);if(et[tt]=ot(pt)*(nt-lt)+lt,pt>=1){requestAnimationFrame(()=>{rt(null)});return}requestAnimationFrame(ht)};return lt===nt?(rt(new Error("Element already at target position")),ut):(requestAnimationFrame(ht),ut)}const _excluded$p=["onChange"],styles$2={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ScrollbarSize(tt){const{onChange:et}=tt,nt=_objectWithoutPropertiesLoose$m(tt,_excluded$p),it=reactExports.useRef(),rt=reactExports.useRef(null),ot=()=>{it.current=rt.current.offsetHeight-rt.current.clientHeight};return useEnhancedEffect$1(()=>{const at=debounce$4(()=>{const lt=it.current;ot(),lt!==it.current&&et(it.current)}),st=ownerWindow(rt.current);return st.addEventListener("resize",at),()=>{at.clear(),st.removeEventListener("resize",at)}},[et]),reactExports.useEffect(()=>{ot(),et(it.current)},[et]),jsxRuntimeExports.jsx("div",_extends$t({style:styles$2,ref:rt},nt))}function getTabScrollButtonUtilityClass(tt){return generateUtilityClass("MuiTabScrollButton",tt)}const tabScrollButtonClasses=generateUtilityClasses("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),tabScrollButtonClasses$1=tabScrollButtonClasses,_excluded$n=["className","slots","slotProps","direction","orientation","disabled"],useUtilityClasses$1=tt=>{const{classes:et,orientation:nt,disabled:it}=tt;return composeClasses({root:["root",nt,it&&"disabled"]},getTabScrollButtonUtilityClass,et)},TabScrollButtonRoot=styled$1(ButtonBase$1,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.root,nt.orientation&&et[nt.orientation]]}})(({ownerState:tt})=>_extends$t({width:40,flexShrink:0,opacity:.8,[`&.${tabScrollButtonClasses$1.disabled}`]:{opacity:0}},tt.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${tt.isRtl?-90:90}deg)`}})),TabScrollButton=reactExports.forwardRef(function(et,nt){var it,rt;const ot=useThemeProps({props:et,name:"MuiTabScrollButton"}),{className:at,slots:st={},slotProps:lt={},direction:ct}=ot,ut=_objectWithoutPropertiesLoose$m(ot,_excluded$n),dt=useTheme().direction==="rtl",pt=_extends$t({isRtl:dt},ot),mt=useUtilityClasses$1(pt),gt=(it=st.StartScrollButtonIcon)!=null?it:KeyboardArrowLeft,bt=(rt=st.EndScrollButtonIcon)!=null?rt:KeyboardArrowRight,yt=useSlotProps({elementType:gt,externalSlotProps:lt.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:pt}),wt=useSlotProps({elementType:bt,externalSlotProps:lt.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:pt});return jsxRuntimeExports.jsx(TabScrollButtonRoot,_extends$t({component:"div",className:clsx$3(mt.root,at),ref:nt,role:null,ownerState:pt,tabIndex:null},ut,{children:ct==="left"?jsxRuntimeExports.jsx(gt,_extends$t({},yt)):jsxRuntimeExports.jsx(bt,_extends$t({},wt))}))}),TabScrollButton$1=TabScrollButton;function getTabsUtilityClass(tt){return generateUtilityClass("MuiTabs",tt)}const tabsClasses=generateUtilityClasses("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),tabsClasses$1=tabsClasses,_excluded$m=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],nextItem=(tt,et)=>tt===et?tt.firstChild:et&&et.nextElementSibling?et.nextElementSibling:tt.firstChild,previousItem=(tt,et)=>tt===et?tt.lastChild:et&&et.previousElementSibling?et.previousElementSibling:tt.lastChild,moveFocus=(tt,et,nt)=>{let it=!1,rt=nt(tt,et);for(;rt;){if(rt===tt.firstChild){if(it)return;it=!0}const ot=rt.disabled||rt.getAttribute("aria-disabled")==="true";if(!rt.hasAttribute("tabindex")||ot)rt=nt(tt,rt);else{rt.focus();return}}},useUtilityClasses=tt=>{const{vertical:et,fixed:nt,hideScrollbar:it,scrollableX:rt,scrollableY:ot,centered:at,scrollButtonsHideMobile:st,classes:lt}=tt;return composeClasses({root:["root",et&&"vertical"],scroller:["scroller",nt&&"fixed",it&&"hideScrollbar",rt&&"scrollableX",ot&&"scrollableY"],flexContainer:["flexContainer",et&&"flexContainerVertical",at&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",st&&"scrollButtonsHideMobile"],scrollableX:[rt&&"scrollableX"],hideScrollbar:[it&&"hideScrollbar"]},getTabsUtilityClass,lt)},TabsRoot=styled$1("div",{name:"MuiTabs",slot:"Root",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[{[`& .${tabsClasses$1.scrollButtons}`]:et.scrollButtons},{[`& .${tabsClasses$1.scrollButtons}`]:nt.scrollButtonsHideMobile&&et.scrollButtonsHideMobile},et.root,nt.vertical&&et.vertical]}})(({ownerState:tt,theme:et})=>_extends$t({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},tt.vertical&&{flexDirection:"column"},tt.scrollButtonsHideMobile&&{[`& .${tabsClasses$1.scrollButtons}`]:{[et.breakpoints.down("sm")]:{display:"none"}}})),TabsScroller=styled$1("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.scroller,nt.fixed&&et.fixed,nt.hideScrollbar&&et.hideScrollbar,nt.scrollableX&&et.scrollableX,nt.scrollableY&&et.scrollableY]}})(({ownerState:tt})=>_extends$t({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},tt.fixed&&{overflowX:"hidden",width:"100%"},tt.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},tt.scrollableX&&{overflowX:"auto",overflowY:"hidden"},tt.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),FlexContainer=styled$1("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(tt,et)=>{const{ownerState:nt}=tt;return[et.flexContainer,nt.vertical&&et.flexContainerVertical,nt.centered&&et.centered]}})(({ownerState:tt})=>_extends$t({display:"flex"},tt.vertical&&{flexDirection:"column"},tt.centered&&{justifyContent:"center"})),TabsIndicator=styled$1("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(tt,et)=>et.indicator})(({ownerState:tt,theme:et})=>_extends$t({position:"absolute",height:2,bottom:0,width:"100%",transition:et.transitions.create()},tt.indicatorColor==="primary"&&{backgroundColor:(et.vars||et).palette.primary.main},tt.indicatorColor==="secondary"&&{backgroundColor:(et.vars||et).palette.secondary.main},tt.vertical&&{height:"100%",width:2,right:0})),TabsScrollbarSize=styled$1(ScrollbarSize)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),defaultIndicatorStyle={},Tabs=reactExports.forwardRef(function(et,nt){const it=useThemeProps({props:et,name:"MuiTabs"}),rt=useTheme(),ot=rt.direction==="rtl",{"aria-label":at,"aria-labelledby":st,action:lt,centered:ct=!1,children:ut,className:ht,component:dt="div",allowScrollButtonsMobile:pt=!1,indicatorColor:mt="primary",onChange:gt,orientation:bt="horizontal",ScrollButtonComponent:yt=TabScrollButton$1,scrollButtons:wt="auto",selectionFollowsFocus:vt,slots:xt={},slotProps:St={},TabIndicatorProps:Et={},TabScrollButtonProps:$t={},textColor:It="primary",value:Ft,variant:Ht="standard",visibleScrollbar:zt=!1}=it,Ot=_objectWithoutPropertiesLoose$m(it,_excluded$m),jt=Ht==="scrollable",kt=bt==="vertical",Tt=kt?"scrollTop":"scrollLeft",Ct=kt?"top":"left",Ut=kt?"bottom":"right",Nt=kt?"clientHeight":"clientWidth",Bt=kt?"height":"width",Mt=_extends$t({},it,{component:dt,allowScrollButtonsMobile:pt,indicatorColor:mt,orientation:bt,vertical:kt,scrollButtons:wt,textColor:It,variant:Ht,visibleScrollbar:zt,fixed:!jt,hideScrollbar:jt&&!zt,scrollableX:jt&&!kt,scrollableY:jt&&kt,centered:ct&&!jt,scrollButtonsHideMobile:!pt}),Dt=useUtilityClasses(Mt),Pt=useSlotProps({elementType:xt.StartScrollButtonIcon,externalSlotProps:St.startScrollButtonIcon,ownerState:Mt}),Vt=useSlotProps({elementType:xt.EndScrollButtonIcon,externalSlotProps:St.endScrollButtonIcon,ownerState:Mt}),[nn,cn]=reactExports.useState(!1),[Xt,un]=reactExports.useState(defaultIndicatorStyle),[en,fn]=reactExports.useState(!1),[xn,an]=reactExports.useState(!1),[Zt,En]=reactExports.useState(!1),[In,Cn]=reactExports.useState({overflow:"hidden",scrollbarWidth:0}),Nn=new Map,Un=reactExports.useRef(null),_n=reactExports.useRef(null),An=()=>{const Wn=Un.current;let Gn;if(Wn){const Jn=Wn.getBoundingClientRect();Gn={clientWidth:Wn.clientWidth,scrollLeft:Wn.scrollLeft,scrollTop:Wn.scrollTop,scrollLeftNormalized:getNormalizedScrollLeft(Wn,rt.direction),scrollWidth:Wn.scrollWidth,top:Jn.top,bottom:Jn.bottom,left:Jn.left,right:Jn.right}}let Fn;if(Wn&&Ft!==!1){const Jn=_n.current.children;if(Jn.length>0){const Vn=Jn[Nn.get(Ft)];Fn=Vn?Vn.getBoundingClientRect():null}}return{tabsMeta:Gn,tabMeta:Fn}},gn=useEventCallback(()=>{const{tabsMeta:Wn,tabMeta:Gn}=An();let Fn=0,Jn;if(kt)Jn="top",Gn&&Wn&&(Fn=Gn.top-Wn.top+Wn.scrollTop);else if(Jn=ot?"right":"left",Gn&&Wn){const dr=ot?Wn.scrollLeftNormalized+Wn.clientWidth-Wn.scrollWidth:Wn.scrollLeft;Fn=(ot?-1:1)*(Gn[Jn]-Wn[Jn]+dr)}const Vn={[Jn]:Fn,[Bt]:Gn?Gn[Bt]:0};if(isNaN(Xt[Jn])||isNaN(Xt[Bt]))un(Vn);else{const dr=Math.abs(Xt[Jn]-Vn[Jn]),ur=Math.abs(Xt[Bt]-Vn[Bt]);(dr>=1||ur>=1)&&un(Vn)}}),Tn=(Wn,{animation:Gn=!0}={})=>{Gn?animate(Tt,Un.current,Wn,{duration:rt.transitions.duration.standard}):Un.current[Tt]=Wn},yn=Wn=>{let Gn=Un.current[Tt];kt?Gn+=Wn:(Gn+=Wn*(ot?-1:1),Gn*=ot&&detectScrollType()==="reverse"?-1:1),Tn(Gn)},dn=()=>{const Wn=Un.current[Nt];let Gn=0;const Fn=Array.from(_n.current.children);for(let Jn=0;JnWn){Jn===0&&(Gn=Wn);break}Gn+=Vn[Nt]}return Gn},sn=()=>{yn(-1*dn())},rn=()=>{yn(dn())},Sn=reactExports.useCallback(Wn=>{Cn({overflow:null,scrollbarWidth:Wn})},[]),tn=()=>{const Wn={};Wn.scrollbarSizeListener=jt?jsxRuntimeExports.jsx(TabsScrollbarSize,{onChange:Sn,className:clsx$3(Dt.scrollableX,Dt.hideScrollbar)}):null;const Fn=jt&&(wt==="auto"&&(en||xn)||wt===!0);return Wn.scrollButtonStart=Fn?jsxRuntimeExports.jsx(yt,_extends$t({slots:{StartScrollButtonIcon:xt.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Pt},orientation:bt,direction:ot?"right":"left",onClick:sn,disabled:!en},$t,{className:clsx$3(Dt.scrollButtons,$t.className)})):null,Wn.scrollButtonEnd=Fn?jsxRuntimeExports.jsx(yt,_extends$t({slots:{EndScrollButtonIcon:xt.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Vt},orientation:bt,direction:ot?"left":"right",onClick:rn,disabled:!xn},$t,{className:clsx$3(Dt.scrollButtons,$t.className)})):null,Wn},qt=useEventCallback(Wn=>{const{tabsMeta:Gn,tabMeta:Fn}=An();if(!(!Fn||!Gn)){if(Fn[Ct]Gn[Ut]){const Jn=Gn[Tt]+(Fn[Ut]-Gn[Ut]);Tn(Jn,{animation:Wn})}}}),Kt=useEventCallback(()=>{jt&&wt!==!1&&En(!Zt)});reactExports.useEffect(()=>{const Wn=debounce$4(()=>{Un.current&&gn()});let Gn;const Fn=dr=>{dr.forEach(ur=>{ur.removedNodes.forEach(_r=>{var Qr;(Qr=Gn)==null||Qr.unobserve(_r)}),ur.addedNodes.forEach(_r=>{var Qr;(Qr=Gn)==null||Qr.observe(_r)})}),Wn(),Kt()},Jn=ownerWindow(Un.current);Jn.addEventListener("resize",Wn);let Vn;return typeof ResizeObserver<"u"&&(Gn=new ResizeObserver(Wn),Array.from(_n.current.children).forEach(dr=>{Gn.observe(dr)})),typeof MutationObserver<"u"&&(Vn=new MutationObserver(Fn),Vn.observe(_n.current,{childList:!0})),()=>{var dr,ur;Wn.clear(),Jn.removeEventListener("resize",Wn),(dr=Vn)==null||dr.disconnect(),(ur=Gn)==null||ur.disconnect()}},[gn,Kt]),reactExports.useEffect(()=>{const Wn=Array.from(_n.current.children),Gn=Wn.length;if(typeof IntersectionObserver<"u"&&Gn>0&&jt&&wt!==!1){const Fn=Wn[0],Jn=Wn[Gn-1],Vn={root:Un.current,threshold:.99},dr=Or=>{fn(!Or[0].isIntersecting)},ur=new IntersectionObserver(dr,Vn);ur.observe(Fn);const _r=Or=>{an(!Or[0].isIntersecting)},Qr=new IntersectionObserver(_r,Vn);return Qr.observe(Jn),()=>{ur.disconnect(),Qr.disconnect()}}},[jt,wt,Zt,ut==null?void 0:ut.length]),reactExports.useEffect(()=>{cn(!0)},[]),reactExports.useEffect(()=>{gn()}),reactExports.useEffect(()=>{qt(defaultIndicatorStyle!==Xt)},[qt,Xt]),reactExports.useImperativeHandle(lt,()=>({updateIndicator:gn,updateScrollButtons:Kt}),[gn,Kt]);const wn=jsxRuntimeExports.jsx(TabsIndicator,_extends$t({},Et,{className:clsx$3(Dt.indicator,Et.className),ownerState:Mt,style:_extends$t({},Xt,Et.style)}));let Rn=0;const jn=reactExports.Children.map(ut,Wn=>{if(!reactExports.isValidElement(Wn))return null;const Gn=Wn.props.value===void 0?Rn:Wn.props.value;Nn.set(Gn,Rn);const Fn=Gn===Ft;return Rn+=1,reactExports.cloneElement(Wn,_extends$t({fullWidth:Ht==="fullWidth",indicator:Fn&&!nn&&wn,selected:Fn,selectionFollowsFocus:vt,onChange:gt,textColor:It,value:Gn},Rn===1&&Ft===!1&&!Wn.props.tabIndex?{tabIndex:0}:{}))}),Bn=Wn=>{const Gn=_n.current,Fn=ownerDocument(Gn).activeElement;if(Fn.getAttribute("role")!=="tab")return;let Vn=bt==="horizontal"?"ArrowLeft":"ArrowUp",dr=bt==="horizontal"?"ArrowRight":"ArrowDown";switch(bt==="horizontal"&&ot&&(Vn="ArrowRight",dr="ArrowLeft"),Wn.key){case Vn:Wn.preventDefault(),moveFocus(Gn,Fn,previousItem);break;case dr:Wn.preventDefault(),moveFocus(Gn,Fn,nextItem);break;case"Home":Wn.preventDefault(),moveFocus(Gn,null,nextItem);break;case"End":Wn.preventDefault(),moveFocus(Gn,null,previousItem);break}},Xn=tn();return jsxRuntimeExports.jsxs(TabsRoot,_extends$t({className:clsx$3(Dt.root,ht),ownerState:Mt,ref:nt,as:dt},Ot,{children:[Xn.scrollButtonStart,Xn.scrollbarSizeListener,jsxRuntimeExports.jsxs(TabsScroller,{className:Dt.scroller,ownerState:Mt,style:{overflow:In.overflow,[kt?`margin${ot?"Left":"Right"}`:"marginBottom"]:zt?void 0:-In.scrollbarWidth},ref:Un,children:[jsxRuntimeExports.jsx(FlexContainer,{"aria-label":at,"aria-labelledby":st,"aria-orientation":bt==="vertical"?"vertical":null,className:Dt.flexContainer,ownerState:Mt,onKeyDown:Bn,ref:_n,role:"tablist",children:jn}),nn&&wn]}),Xn.scrollButtonEnd]}))}),Tabs$1=Tabs,cssWithMediaQuery=tt=>(et,...nt)=>{const it=Ae(et,...nt);return it.join("").trim()?Ae` @media ${tt} { ${it} } @@ -3708,34 +3708,34 @@ PROCEED WITH CAUTION! * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */lodash.exports;(function(tt,et){(function(){var nt,it="4.17.21",rt=200,ot="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",at="Expected a function",st="Invalid `variable` option passed into `_.template`",lt="__lodash_hash_undefined__",ct=500,ut="__lodash_placeholder__",ht=1,dt=2,pt=4,mt=1,gt=2,bt=1,yt=2,wt=4,vt=8,xt=16,St=32,Et=64,It=128,Tt=256,$t=512,Ut=30,Lt="...",Bt=800,Pt=16,kt=1,At=2,Rt=3,Wt=1/0,jt=9007199254740991,Ot=17976931348623157e292,Ct=0/0,Dt=4294967295,Mt=Dt-1,Vt=Dt>>>1,Qt=[["ary",It],["bind",bt],["bindKey",yt],["curry",vt],["curryRight",xt],["flip",$t],["partial",St],["partialRight",Et],["rearg",Tt]],rn="[object Arguments]",Xt="[object Array]",an="[object AsyncFunction]",tn="[object Boolean]",pn="[object Date]",vn="[object DOMException]",sn="[object Error]",Zt="[object Function]",Sn="[object GeneratorFunction]",Tn="[object Map]",Cn="[object Number]",jn="[object Null]",Un="[object Object]",yn="[object Promise]",un="[object Proxy]",En="[object RegExp]",In="[object Set]",xn="[object String]",dn="[object Symbol]",cn="[object Undefined]",hn="[object WeakMap]",$n="[object WeakSet]",nn="[object ArrayBuffer]",Kt="[object DataView]",Yt="[object Float32Array]",_n="[object Float64Array]",Mn="[object Int8Array]",Bn="[object Int16Array]",Nn="[object Int32Array]",qn="[object Uint8Array]",Wn="[object Uint8ClampedArray]",Vn="[object Uint16Array]",Fn="[object Uint32Array]",Jn=/\b__p \+= '';/g,Hn=/\b(__p \+=) '' \+/g,dr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ur=/&(?:amp|lt|gt|quot|#39);/g,_r=/[&<>"']/g,Qr=RegExp(ur.source),jr=RegExp(_r.source),Mr=/<%-([\s\S]+?)%>/g,qr=/<%([\s\S]+?)%>/g,Ur=/<%=([\s\S]+?)%>/g,Lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ao=/^\w*$/,Gr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Br=/[\\^$.*+?()[\]{}|]/g,go=RegExp(Br.source),wn=/^\s+/,Pn=/\s/,fn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jt=/\{\n\/\* \[wrapped with (.+)\] \*/,kn=/,? & /,On=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dn=/[()=,{}\[\]\/\s]/,Kn=/\\(\\)?/g,er=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,or=/\w*$/,ar=/^[-+]0x[0-9a-f]+$/i,Vr=/^0b[01]+$/i,wr=/^\[object .+?Constructor\]$/,Or=/^0o[0-7]+$/i,Hr=/^(?:0|[1-9]\d*)$/,no=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xr=/($^)/,Jr=/['\n\r\u2028\u2029\\]/g,br="\\ud800-\\udfff",$r="\\u0300-\\u036f",Dr="\\ufe20-\\ufe2f",Cr="\\u20d0-\\u20ff",Ar=$r+Dr+Cr,Nr="\\u2700-\\u27bf",Fr="a-z\\xdf-\\xf6\\xf8-\\xff",Pr="\\xac\\xb1\\xd7\\xf7",_i="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nr="\\u2000-\\u206f",xr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",yr="\\ufe0e\\ufe0f",Ir=Pr+_i+nr+xr,io="['’]",so="["+br+"]",fo="["+Ir+"]",po="["+Ar+"]",Yn="\\d+",vo="["+Nr+"]",_o="["+Fr+"]",xo="[^"+br+Ir+Yn+Nr+Fr+cr+"]",bo="\\ud83c[\\udffb-\\udfff]",$o="(?:"+po+"|"+bo+")",Ro="[^"+br+"]",Wo="(?:\\ud83c[\\udde6-\\uddff]){2}",Po="[\\ud800-\\udbff][\\udc00-\\udfff]",Fo="["+cr+"]",Go="\\u200d",Xo="(?:"+_o+"|"+xo+")",ga="(?:"+Fo+"|"+xo+")",na="(?:"+io+"(?:d|ll|m|re|s|t|ve))?",$a="(?:"+io+"(?:D|LL|M|RE|S|T|VE))?",Jo=$o+"?",pu="["+yr+"]?",eu="(?:"+Go+"(?:"+[Ro,Wo,Po].join("|")+")"+pu+Jo+")*",Lo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tu=pu+Jo+eu,sp="(?:"+[vo,Wo,Po].join("|")+")"+tu,Op="(?:"+[Ro+po+"?",po,Wo,Po,so].join("|")+")",b0=RegExp(io,"g"),ts=RegExp(po,"g"),mu=RegExp(bo+"(?="+bo+")|"+Op+tu,"g"),w0=RegExp([Fo+"?"+_o+"+"+na+"(?="+[fo,Fo,"$"].join("|")+")",ga+"+"+$a+"(?="+[fo,Fo+Xo,"$"].join("|")+")",Fo+"?"+Xo+"+"+na,Fo+"+"+$a,Bp,Lo,Yn,sp].join("|"),"g"),Us=RegExp("["+Go+br+Ar+yr+"]"),jp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Vu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xs=-1,Yo={};Yo[Yt]=Yo[_n]=Yo[Mn]=Yo[Bn]=Yo[Nn]=Yo[qn]=Yo[Wn]=Yo[Vn]=Yo[Fn]=!0,Yo[rn]=Yo[Xt]=Yo[nn]=Yo[tn]=Yo[Kt]=Yo[pn]=Yo[sn]=Yo[Zt]=Yo[Tn]=Yo[Cn]=Yo[Un]=Yo[En]=Yo[In]=Yo[xn]=Yo[hn]=!1;var Ko={};Ko[rn]=Ko[Xt]=Ko[nn]=Ko[Kt]=Ko[tn]=Ko[pn]=Ko[Yt]=Ko[_n]=Ko[Mn]=Ko[Bn]=Ko[Nn]=Ko[Tn]=Ko[Cn]=Ko[Un]=Ko[En]=Ko[In]=Ko[xn]=Ko[dn]=Ko[qn]=Ko[Wn]=Ko[Vn]=Ko[Fn]=!0,Ko[sn]=Ko[Zt]=Ko[hn]=!1;var Js={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zs={"&":"&","<":"<",">":">",'"':""","'":"'"},nu={"&":"&","<":"<",">":">",""":'"',"'":"'"},$l={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Np=parseFloat,Lp=parseInt,Ws=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Hu=typeof self=="object"&&self&&self.Object===Object&&self,ns=Ws||Hu||Function("return this")(),gu=et&&!et.nodeType&&et,ls=gu&&!0&&tt&&!tt.nodeType&&tt,ys=ls&&ls.exports===gu,Iu=ys&&Ws.process,rs=function(){try{var Qn=ls&&ls.require&&ls.require("util").types;return Qn||Iu&&Iu.binding&&Iu.binding("util")}catch{}}(),yu=rs&&rs.isArrayBuffer,Gu=rs&&rs.isDate,Dp=rs&&rs.isMap,bs=rs&&rs.isRegExp,Cs=rs&&rs.isSet,os=rs&&rs.isTypedArray;function Vo(Qn,Sr,pr){switch(pr.length){case 0:return Qn.call(Sr);case 1:return Qn.call(Sr,pr[0]);case 2:return Qn.call(Sr,pr[0],pr[1]);case 3:return Qn.call(Sr,pr[0],pr[1],pr[2])}return Qn.apply(Sr,pr)}function Zs(Qn,Sr,pr,ro){for(var To=-1,Co=Qn==null?0:Qn.length;++To-1}function lp(Qn,Sr,pr){for(var ro=-1,To=Qn==null?0:Qn.length;++ro-1;);return pr}function hp(Qn,Sr){for(var pr=Qn.length;pr--&&Fl(Sr,Qn[pr],0)>-1;);return pr}function Wl(Qn,Sr){for(var pr=Qn.length,ro=0;pr--;)Qn[pr]===Sr&&++ro;return ro}var Fm=Ys(Js),Um=Ys(zs);function Q0(Qn){return"\\"+$l[Qn]}function em(Qn,Sr){return Qn==null?nt:Qn[Sr]}function qu(Qn){return Us.test(Qn)}function Wp(Qn){return jp.test(Qn)}function dp(Qn){for(var Sr,pr=[];!(Sr=Qn.next()).done;)pr.push(Sr.value);return pr}function Vp(Qn){var Sr=-1,pr=Array(Qn.size);return Qn.forEach(function(ro,To){pr[++Sr]=[To,ro]}),pr}function fp(Qn,Sr){return function(pr){return Qn(Sr(pr))}}function Vl(Qn,Sr){for(var pr=-1,ro=Qn.length,To=0,Co=[];++pr-1}function I0(Nt,Ht){var qt=this.__data__,gn=Bu(qt,Nt);return gn<0?(++this.size,qt.push([Nt,Ht])):qt[gn][1]=Ht,this}Hl.prototype.clear=ay,Hl.prototype.delete=um,Hl.prototype.get=sy,Hl.prototype.has=ly,Hl.prototype.set=I0;function Cl(Nt){var Ht=-1,qt=Nt==null?0:Nt.length;for(this.clear();++Ht=Ht?Nt:Ht)),Nt}function _l(Nt,Ht,qt,gn,Rn,zn){var Xn,Zn=Ht&ht,rr=Ht&dt,Er=Ht&pt;if(qt&&(Xn=Rn?qt(Nt,gn,Rn,zn):qt(Nt)),Xn!==nt)return Xn;if(!ds(Nt))return Nt;var Tr=Mo(Nt);if(Tr){if(Xn=Aw(Nt),!Zn)return Ls(Nt,Xn)}else{var Rr=Ks(Nt),Zr=Rr==Zt||Rr==Sn;if(Rp(Nt))return Cm(Nt,Zn);if(Rr==Un||Rr==rn||Zr&&!Rn){if(Xn=rr||Zr?{}:$1(Nt),!Zn)return rr?Iy(Nt,my(Xn,Nt)):Ky(Nt,gm(Xn,Nt))}else{if(!Ko[Rr])return Rn?Nt:{};Xn=$w(Nt,Rr,Zn)}}zn||(zn=new xs);var uo=zn.get(Nt);if(uo)return uo;zn.set(Nt,Xn),iw(Nt)?Nt.forEach(function(Eo){Xn.add(_l(Eo,Ht,qt,Eo,Nt,zn))}):tw(Nt)&&Nt.forEach(function(Eo,Uo){Xn.set(Uo,_l(Eo,Ht,qt,Uo,Nt,zn))});var So=Er?rr?zo:ms:rr?Ol:Fs,Do=Tr?nt:So(Nt);return ws(Do||Nt,function(Eo,Uo){Do&&(Uo=Eo,Eo=Nt[Uo]),Gl(Xn,Uo,_l(Eo,Ht,qt,Uo,Nt,zn))}),Xn}function ym(Nt){var Ht=Fs(Nt);return function(qt){return P0(qt,Nt,Ht)}}function P0(Nt,Ht,qt){var gn=qt.length;if(Nt==null)return!gn;for(Nt=ko(Nt);gn--;){var Rn=qt[gn],zn=Ht[Rn],Xn=Nt[Rn];if(Xn===nt&&!(Rn in Nt)||!zn(Xn))return!1}return!0}function bm(Nt,Ht,qt){if(typeof Nt!="function")throw new Gs(at);return Bm(function(){Nt.apply(nt,qt)},Ht)}function Qu(Nt,Ht,qt,gn){var Rn=-1,zn=Ll,Xn=!0,Zn=Nt.length,rr=[],Er=Ht.length;if(!Zn)return rr;qt&&(Ht=ba(Ht,Vs(qt))),gn?(zn=lp,Xn=!1):Ht.length>=rt&&(zn=As,Xn=!1,Ht=new Ru(Ht));e:for(;++RnRn?0:Rn+qt),gn=gn===nt||gn>Rn?Rn:No(gn),gn<0&&(gn+=Rn),gn=qt>gn?0:ow(gn);qt0&&qt(Zn)?Ht>1?Is(Zn,Ht-1,qt,gn,Rn):Dl(Rn,Zn):gn||(Rn[Rn.length]=Zn)}return Rn}var Sp=W0(),a0=W0(!0);function xl(Nt,Ht){return Nt&&Sp(Nt,Ht,Fs)}function Ep(Nt,Ht){return Nt&&a0(Nt,Ht,Fs)}function _h(Nt,Ht){return Ps(Ht,function(qt){return np(Nt[qt])})}function Xl(Nt,Ht){Ht=Fu(Ht,Nt);for(var qt=0,gn=Ht.length;Nt!=null&&qtHt}function by(Nt,Ht){return Nt!=null&&qo.call(Nt,Ht)}function vm(Nt,Ht){return Nt!=null&&Ht in ko(Nt)}function qy(Nt,Ht,qt){return Nt>=Ms(Ht,qt)&&Nt<_s(Ht,qt)}function Tp(Nt,Ht,qt){for(var gn=qt?lp:Ll,Rn=Nt[0].length,zn=Nt.length,Xn=zn,Zn=pr(zn),rr=1/0,Er=[];Xn--;){var Tr=Nt[Xn];Xn&&Ht&&(Tr=ba(Tr,Vs(Ht))),rr=Ms(Tr.length,rr),Zn[Xn]=!qt&&(Ht||Rn>=120&&Tr.length>=120)?new Ru(Xn&&Tr):nt}Tr=Nt[0];var Rr=-1,Zr=Zn[0];e:for(;++Rr-1;)Zn!==Nt&&Pu.call(Zn,rr,1),Pu.call(Nt,rr,1);return Nt}function Os(Nt,Ht){for(var qt=Nt?Ht.length:0,gn=qt-1;qt--;){var Rn=Ht[qt];if(qt==gn||Rn!==zn){var zn=Rn;tp(Rn)?Pu.call(Nt,Rn,1):Im(Nt,Rn)}}return Nt}function cu(Nt,Ht){return Nt+Zp(lm()*(Ht-Nt+1))}function Pl(Nt,Ht,qt,gn){for(var Rn=-1,zn=_s(Jp((Ht-Nt)/(qt||1)),0),Xn=pr(zn);zn--;)Xn[gn?zn:++Rn]=Nt,Nt+=qt;return Xn}function Mp(Nt,Ht){var qt="";if(!Nt||Ht<1||Ht>jt)return qt;do Ht%2&&(qt+=Nt),Ht=Zp(Ht/2),Ht&&(Nt+=Nt);while(Ht);return qt}function mo(Nt,Ht){return i1(M1(Nt,Ht,Nl),Nt+"")}function wy(Nt){return r0(q0(Nt))}function Sm(Nt,Ht){var qt=q0(Nt);return Cy(qt,Ou(Ht,0,qt.length))}function _f(Nt,Ht,qt,gn){if(!ds(Nt))return Nt;Ht=Fu(Ht,Nt);for(var Rn=-1,zn=Ht.length,Xn=zn-1,Zn=Nt;Zn!=null&&++RnRn?0:Rn+Ht),qt=qt>Rn?Rn:qt,qt<0&&(qt+=Rn),Rn=Ht>qt?0:qt-Ht>>>0,Ht>>>=0;for(var zn=pr(Rn);++gn>>1,Xn=Nt[zn];Xn!==null&&!Zl(Xn)&&(qt?Xn<=Ht:Xn=rt){var Er=Ht?null:Ds(Nt);if(Er)return Hp(Er);Xn=!1,Rn=As,rr=new Ru}else rr=Ht?[]:Zn;e:for(;++gn=gn?Nt:El(Nt,Ht,qt)}var Ey=Xp||function(Nt){return ns.clearTimeout(Nt)};function Cm(Nt,Ht){if(Ht)return Nt.slice();var qt=Nt.length,gn=rm?rm(qt):new Nt.constructor(qt);return Nt.copy(gn),gn}function U0(Nt){var Ht=new Nt.constructor(Nt.byteLength);return new Yp(Ht).set(new Yp(Nt)),Ht}function Yy(Nt,Ht){var qt=Ht?U0(Nt.buffer):Nt.buffer;return new Nt.constructor(qt,Nt.byteOffset,Nt.byteLength)}function Ml(Nt){var Ht=new Nt.constructor(Nt.source,or.exec(Nt));return Ht.lastIndex=Nt.lastIndex,Ht}function Pm(Nt){return _u?ko(_u.call(Nt)):{}}function Ty(Nt,Ht){var qt=Ht?U0(Nt.buffer):Nt.buffer;return new Nt.constructor(qt,Nt.byteOffset,Nt.length)}function Su(Nt,Ht){if(Nt!==Ht){var qt=Nt!==nt,gn=Nt===null,Rn=Nt===Nt,zn=Zl(Nt),Xn=Ht!==nt,Zn=Ht===null,rr=Ht===Ht,Er=Zl(Ht);if(!Zn&&!Er&&!zn&&Nt>Ht||zn&&Xn&&rr&&!Zn&&!Er||gn&&Xn&&rr||!qt&&rr||!Rn)return 1;if(!gn&&!zn&&!Er&&Nt=Zn)return rr;var Er=qt[gn];return rr*(Er=="desc"?-1:1)}}return Nt.index-Ht.index}function zu(Nt,Ht,qt,gn){for(var Rn=-1,zn=Nt.length,Xn=qt.length,Zn=-1,rr=Ht.length,Er=_s(zn-Xn,0),Tr=pr(rr+Er),Rr=!gn;++Zn1?qt[Rn-1]:nt,Xn=Rn>2?qt[2]:nt;for(zn=Nt.length>3&&typeof zn=="function"?(Rn--,zn):nt,Xn&&Il(qt[0],qt[1],Xn)&&(zn=Rn<3?nt:zn,Rn=1),Ht=ko(Ht);++gn-1?Rn[zn?Ht[Xn]:Xn]:nt}}function mn(Nt){return jo(function(Ht){var qt=Ht.length,gn=qt,Rn=Rs.prototype.thru;for(Nt&&Ht.reverse();gn--;){var zn=Ht[gn];if(typeof zn!="function")throw new Gs(at);if(Rn&&!Xn&&V0(zn)=="wrapper")var Xn=new Rs([],!0)}for(gn=Xn?gn:qt;++gn1&&Ho.reverse(),Tr&&rrZn))return!1;var Er=zn.get(Nt),Tr=zn.get(Ht);if(Er&&Tr)return Er==Ht&&Tr==Nt;var Rr=-1,Zr=!0,uo=qt>?new Ru:nt;for(zn.set(Nt,Ht),zn.set(Ht,Nt);++Rr1?"& ":"")+Ht[gn],Ht=Ht.join(qt>2?", ":" "),Nt.replace(fn,`{ -/* [wrapped with `+Ht+`] */ -`)}function Pw(Nt){return Mo(Nt)||y0(Nt)||!!(am&&Nt&&Nt[am])}function tp(Nt,Ht){var qt=typeof Nt;return Ht=Ht??jt,!!Ht&&(qt=="number"||qt!="symbol"&&Hr.test(Nt))&&Nt>-1&&Nt%1==0&&Nt0){if(++Ht>=Bt)return arguments[0]}else Ht=0;return Nt.apply(nt,arguments)}}function Cy(Nt,Ht){var qt=-1,gn=Nt.length,Rn=gn-1;for(Ht=Ht===nt?gn:Ht;++qt1?Nt[Ht-1]:nt;return qt=typeof qt=="function"?(Nt.pop(),qt):nt,V1(Nt,qt)});function H1(Nt){var Ht=Ln(Nt);return Ht.__chain__=!0,Ht}function zv(Nt,Ht){return Ht(Nt),Nt}function Py(Nt,Ht){return Ht(Nt)}var Wv=jo(function(Nt){var Ht=Nt.length,qt=Ht?Nt[0]:0,gn=this.__wrapped__,Rn=function(zn){return C0(zn,Nt)};return Ht>1||this.__actions__.length||!(gn instanceof yo)||!tp(qt)?this.thru(Rn):(gn=gn.slice(qt,+qt+(Ht?1:0)),gn.__actions__.push({func:Py,args:[Rn],thisArg:nt}),new Rs(gn,this.__chain__).thru(function(zn){return Ht&&!zn.length&&zn.push(nt),zn}))});function Vv(){return H1(this)}function Hv(){return new Rs(this.value(),this.__chain__)}function Gv(){this.__values__===nt&&(this.__values__=rw(this.value()));var Nt=this.__index__>=this.__values__.length,Ht=Nt?nt:this.__values__[this.__index__++];return{done:Nt,value:Ht}}function qv(){return this}function Yv(Nt){for(var Ht,qt=this;qt instanceof i0;){var gn=L1(qt);gn.__index__=0,gn.__values__=nt,Ht?Rn.__wrapped__=gn:Ht=gn;var Rn=gn;qt=qt.__wrapped__}return Rn.__wrapped__=Nt,Ht}function Kv(){var Nt=this.__wrapped__;if(Nt instanceof yo){var Ht=Nt;return this.__actions__.length&&(Ht=new yo(this)),Ht=Ht.reverse(),Ht.__actions__.push({func:Py,args:[r1],thisArg:nt}),new Rs(Ht,this.__chain__)}return this.thru(r1)}function Xv(){return Lu(this.__wrapped__,this.__actions__)}var Jv=p0(function(Nt,Ht,qt){qo.call(Nt,qt)?++Nt[qt]:lu(Nt,qt,1)});function Zv(Nt,Ht,qt){var gn=Mo(Nt)?J0:Gy;return qt&&Il(Nt,Ht,qt)&&(Ht=nt),gn(Nt,wo(Ht,3))}function Qv(Nt,Ht){var qt=Mo(Nt)?Ps:wm;return qt(Nt,wo(Ht,3))}var t2=en(D1),n2=en(F1);function i2(Nt,Ht){return Is(My(Nt,Ht),1)}function r2(Nt,Ht){return Is(My(Nt,Ht),Wt)}function o2(Nt,Ht,qt){return qt=qt===nt?1:No(qt),Is(My(Nt,Ht),qt)}function G1(Nt,Ht){var qt=Mo(Nt)?ws:Yl;return qt(Nt,wo(Ht,3))}function q1(Nt,Ht){var qt=Mo(Nt)?X0:gy;return qt(Nt,wo(Ht,3))}var a2=p0(function(Nt,Ht,qt){qo.call(Nt,qt)?Nt[qt].push(Ht):lu(Nt,qt,[Ht])});function s2(Nt,Ht,qt,gn){Nt=Bl(Nt)?Nt:q0(Nt),qt=qt&&!gn?No(qt):0;var Rn=Nt.length;return qt<0&&(qt=_s(Rn+qt,0)),Ny(Nt)?qt<=Rn&&Nt.indexOf(Ht,qt)>-1:!!Rn&&Fl(Nt,Ht,qt)>-1}var l2=mo(function(Nt,Ht,qt){var gn=-1,Rn=typeof Ht=="function",zn=Bl(Nt)?pr(Nt.length):[];return Yl(Nt,function(Xn){zn[++gn]=Rn?Vo(Ht,Xn,qt):xa(Xn,Ht,qt)}),zn}),c2=p0(function(Nt,Ht,qt){lu(Nt,qt,Ht)});function My(Nt,Ht){var qt=Mo(Nt)?ba:_d;return qt(Nt,wo(Ht,3))}function u2(Nt,Ht,qt,gn){return Nt==null?[]:(Mo(Ht)||(Ht=Ht==null?[]:[Ht]),qt=gn?nt:qt,Mo(qt)||(qt=qt==null?[]:[qt]),u0(Nt,Ht,qt))}var h2=p0(function(Nt,Ht,qt){Nt[qt?0:1].push(Ht)},function(){return[[],[]]});function d2(Nt,Ht,qt){var gn=Mo(Nt)?v0:Au,Rn=arguments.length<3;return gn(Nt,wo(Ht,4),qt,Rn,Yl)}function f2(Nt,Ht,qt){var gn=Mo(Nt)?jm:Au,Rn=arguments.length<3;return gn(Nt,wo(Ht,4),qt,Rn,gy)}function p2(Nt,Ht){var qt=Mo(Nt)?Ps:wm;return qt(Nt,Oy(wo(Ht,3)))}function m2(Nt){var Ht=Mo(Nt)?r0:wy;return Ht(Nt)}function g2(Nt,Ht,qt){(qt?Il(Nt,Ht,qt):Ht===nt)?Ht=1:Ht=No(Ht);var gn=Mo(Nt)?fm:Sm;return gn(Nt,Ht)}function y2(Nt){var Ht=Mo(Nt)?fy:xy;return Ht(Nt)}function b2(Nt){if(Nt==null)return 0;if(Bl(Nt))return Ny(Nt)?iu(Nt):Nt.length;var Ht=Ks(Nt);return Ht==Tn||Ht==In?Nt.size:Bs(Nt).length}function w2(Nt,Ht,qt){var gn=Mo(Nt)?Fp:Em;return qt&&Il(Nt,Ht,qt)&&(Ht=nt),gn(Nt,wo(Ht,3))}var _2=mo(function(Nt,Ht){if(Nt==null)return[];var qt=Ht.length;return qt>1&&Il(Nt,Ht[0],Ht[1])?Ht=[]:qt>2&&Il(Ht[0],Ht[1],Ht[2])&&(Ht=[Ht[0]]),u0(Nt,Is(Ht,1),[])}),Ry=Hm||function(){return ns.Date.now()};function x2(Nt,Ht){if(typeof Ht!="function")throw new Gs(at);return Nt=No(Nt),function(){if(--Nt<1)return Ht.apply(this,arguments)}}function Y1(Nt,Ht,qt){return Ht=qt?nt:Ht,Ht=Nt&&Ht==null?Nt.length:Ht,lr(Nt,It,nt,nt,nt,nt,Ht)}function K1(Nt,Ht){var qt;if(typeof Ht!="function")throw new Gs(at);return Nt=No(Nt),function(){return--Nt>0&&(qt=Ht.apply(this,arguments)),Nt<=1&&(Ht=nt),qt}}var a1=mo(function(Nt,Ht,qt){var gn=bt;if(qt.length){var Rn=Vl(qt,H0(a1));gn|=St}return lr(Nt,gn,Ht,qt,Rn)}),X1=mo(function(Nt,Ht,qt){var gn=bt|yt;if(qt.length){var Rn=Vl(qt,H0(X1));gn|=St}return lr(Ht,gn,Nt,qt,Rn)});function J1(Nt,Ht,qt){Ht=qt?nt:Ht;var gn=lr(Nt,vt,nt,nt,nt,nt,nt,Ht);return gn.placeholder=J1.placeholder,gn}function Z1(Nt,Ht,qt){Ht=qt?nt:Ht;var gn=lr(Nt,xt,nt,nt,nt,nt,nt,Ht);return gn.placeholder=Z1.placeholder,gn}function Q1(Nt,Ht,qt){var gn,Rn,zn,Xn,Zn,rr,Er=0,Tr=!1,Rr=!1,Zr=!0;if(typeof Nt!="function")throw new Gs(at);Ht=fu(Ht)||0,ds(qt)&&(Tr=!!qt.leading,Rr="maxWait"in qt,zn=Rr?_s(fu(qt.maxWait)||0,Ht):zn,Zr="trailing"in qt?!!qt.trailing:Zr);function uo(Ss){var Tu=gn,ap=Rn;return gn=Rn=nt,Er=Ss,Xn=Nt.apply(ap,Tu),Xn}function So(Ss){return Er=Ss,Zn=Bm(Uo,Ht),Tr?uo(Ss):Xn}function Do(Ss){var Tu=Ss-rr,ap=Ss-Er,yw=Ht-Tu;return Rr?Ms(yw,zn-ap):yw}function Eo(Ss){var Tu=Ss-rr,ap=Ss-Er;return rr===nt||Tu>=Ht||Tu<0||Rr&&ap>=zn}function Uo(){var Ss=Ry();if(Eo(Ss))return Ho(Ss);Zn=Bm(Uo,Do(Ss))}function Ho(Ss){return Zn=nt,Zr&&gn?uo(Ss):(gn=Rn=nt,Xn)}function Ql(){Zn!==nt&&Ey(Zn),Er=0,gn=rr=Rn=Zn=nt}function Al(){return Zn===nt?Xn:Ho(Ry())}function _c(){var Ss=Ry(),Tu=Eo(Ss);if(gn=arguments,Rn=this,rr=Ss,Tu){if(Zn===nt)return So(rr);if(Rr)return Ey(Zn),Zn=Bm(Uo,Ht),uo(rr)}return Zn===nt&&(Zn=Bm(Uo,Ht)),Xn}return _c.cancel=Ql,_c.flush=Al,_c}var k2=mo(function(Nt,Ht){return bm(Nt,1,Ht)}),S2=mo(function(Nt,Ht,qt){return bm(Nt,fu(Ht)||0,qt)});function E2(Nt){return lr(Nt,$t)}function By(Nt,Ht){if(typeof Nt!="function"||Ht!=null&&typeof Ht!="function")throw new Gs(at);var qt=function(){var gn=arguments,Rn=Ht?Ht.apply(this,gn):gn[0],zn=qt.cache;if(zn.has(Rn))return zn.get(Rn);var Xn=Nt.apply(this,gn);return qt.cache=zn.set(Rn,Xn)||zn,Xn};return qt.cache=new(By.Cache||Cl),qt}By.Cache=Cl;function Oy(Nt){if(typeof Nt!="function")throw new Gs(at);return function(){var Ht=arguments;switch(Ht.length){case 0:return!Nt.call(this);case 1:return!Nt.call(this,Ht[0]);case 2:return!Nt.call(this,Ht[0],Ht[1]);case 3:return!Nt.call(this,Ht[0],Ht[1],Ht[2])}return!Nt.apply(this,Ht)}}function T2(Nt){return K1(2,Nt)}var I2=Sy(function(Nt,Ht){Ht=Ht.length==1&&Mo(Ht[0])?ba(Ht[0],Vs(wo())):ba(Is(Ht,1),Vs(wo()));var qt=Ht.length;return mo(function(gn){for(var Rn=-1,zn=Ms(gn.length,qt);++Rn=Ht}),y0=Bo(function(){return arguments}())?Bo:function(Nt){return gs(Nt)&&qo.call(Nt,"callee")&&!E0.call(Nt,"callee")},Mo=pr.isArray,z2=yu?Vs(yu):fs;function Bl(Nt){return Nt!=null&&jy(Nt.length)&&!np(Nt)}function ks(Nt){return gs(Nt)&&Bl(Nt)}function W2(Nt){return Nt===!0||Nt===!1||gs(Nt)&&$s(Nt)==tn}var Rp=qm||b1,V2=Gu?Vs(Gu):ps;function H2(Nt){return gs(Nt)&&Nt.nodeType===1&&!Om(Nt)}function G2(Nt){if(Nt==null)return!0;if(Bl(Nt)&&(Mo(Nt)||typeof Nt=="string"||typeof Nt.splice=="function"||Rp(Nt)||G0(Nt)||y0(Nt)))return!Nt.length;var Ht=Ks(Nt);if(Ht==Tn||Ht==In)return!Nt.size;if(Rm(Nt))return!Bs(Nt).length;for(var qt in Nt)if(qo.call(Nt,qt))return!1;return!0}function q2(Nt,Ht){return us(Nt,Ht)}function Y2(Nt,Ht,qt){qt=typeof qt=="function"?qt:nt;var gn=qt?qt(Nt,Ht):nt;return gn===nt?us(Nt,Ht,nt,qt):!!gn}function l1(Nt){if(!gs(Nt))return!1;var Ht=$s(Nt);return Ht==sn||Ht==vn||typeof Nt.message=="string"&&typeof Nt.name=="string"&&!Om(Nt)}function K2(Nt){return typeof Nt=="number"&&sm(Nt)}function np(Nt){if(!ds(Nt))return!1;var Ht=$s(Nt);return Ht==Zt||Ht==Sn||Ht==an||Ht==un}function ew(Nt){return typeof Nt=="number"&&Nt==No(Nt)}function jy(Nt){return typeof Nt=="number"&&Nt>-1&&Nt%1==0&&Nt<=jt}function ds(Nt){var Ht=typeof Nt;return Nt!=null&&(Ht=="object"||Ht=="function")}function gs(Nt){return Nt!=null&&typeof Nt=="object"}var tw=Dp?Vs(Dp):Ip;function X2(Nt,Ht){return Nt===Ht||hs(Nt,Ht,Jy(Ht))}function J2(Nt,Ht,qt){return qt=typeof qt=="function"?qt:nt,hs(Nt,Ht,Jy(Ht),qt)}function Z2(Nt){return nw(Nt)&&Nt!=+Nt}function Q2(Nt){if(Bw(Nt))throw new To(ot);return Ap(Nt)}function e_(Nt){return Nt===null}function t_(Nt){return Nt==null}function nw(Nt){return typeof Nt=="number"||gs(Nt)&&$s(Nt)==Cn}function Om(Nt){if(!gs(Nt)||$s(Nt)!=Un)return!1;var Ht=Kp(Nt);if(Ht===null)return!0;var qt=qo.call(Ht,"constructor")&&Ht.constructor;return typeof qt=="function"&&qt instanceof qt&&wp.call(qt)==Yu}var c1=bs?Vs(bs):$p;function n_(Nt){return ew(Nt)&&Nt>=-jt&&Nt<=jt}var iw=Cs?Vs(Cs):R0;function Ny(Nt){return typeof Nt=="string"||!Mo(Nt)&&gs(Nt)&&$s(Nt)==xn}function Zl(Nt){return typeof Nt=="symbol"||gs(Nt)&&$s(Nt)==dn}var G0=os?Vs(os):xm;function i_(Nt){return Nt===nt}function r_(Nt){return gs(Nt)&&Ks(Nt)==hn}function o_(Nt){return gs(Nt)&&$s(Nt)==$n}var a_=ho(l0),s_=ho(function(Nt,Ht){return Nt<=Ht});function rw(Nt){if(!Nt)return[];if(Bl(Nt))return Ny(Nt)?ss(Nt):Ls(Nt);if(Mu&&Nt[Mu])return dp(Nt[Mu]());var Ht=Ks(Nt),qt=Ht==Tn?Vp:Ht==In?Hp:q0;return qt(Nt)}function rp(Nt){if(!Nt)return Nt===0?Nt:0;if(Nt=fu(Nt),Nt===Wt||Nt===-Wt){var Ht=Nt<0?-1:1;return Ht*Ot}return Nt===Nt?Nt:0}function No(Nt){var Ht=rp(Nt),qt=Ht%1;return Ht===Ht?qt?Ht-qt:Ht:0}function ow(Nt){return Nt?Ou(No(Nt),0,Dt):0}function fu(Nt){if(typeof Nt=="number")return Nt;if(Zl(Nt))return Ct;if(ds(Nt)){var Ht=typeof Nt.valueOf=="function"?Nt.valueOf():Nt;Nt=ds(Ht)?Ht+"":Ht}if(typeof Nt!="string")return Nt===0?Nt:+Nt;Nt=x0(Nt);var qt=Vr.test(Nt);return qt||Or.test(Nt)?Lp(Nt.slice(2),qt?2:8):ar.test(Nt)?Ct:+Nt}function aw(Nt){return Rl(Nt,Ol(Nt))}function l_(Nt){return Nt?Ou(No(Nt),-jt,jt):Nt===0?Nt:0}function Qo(Nt){return Nt==null?"":js(Nt)}var c_=ep(function(Nt,Ht){if(Rm(Ht)||Bl(Ht)){Rl(Ht,Fs(Ht),Nt);return}for(var qt in Ht)qo.call(Ht,qt)&&Gl(Nt,qt,Ht[qt])}),sw=ep(function(Nt,Ht){Rl(Ht,Ol(Ht),Nt)}),Ly=ep(function(Nt,Ht,qt,gn){Rl(Ht,Ol(Ht),Nt,gn)}),u_=ep(function(Nt,Ht,qt,gn){Rl(Ht,Fs(Ht),Nt,gn)}),h_=jo(C0);function d_(Nt,Ht){var qt=xu(Nt);return Ht==null?qt:gm(qt,Ht)}var f_=mo(function(Nt,Ht){Nt=ko(Nt);var qt=-1,gn=Ht.length,Rn=gn>2?Ht[2]:nt;for(Rn&&Il(Ht[0],Ht[1],Rn)&&(gn=1);++qt1),zn}),Rl(Nt,zo(Nt),qt),gn&&(qt=_l(qt,ht|dt|pt,eo));for(var Rn=Ht.length;Rn--;)Im(qt,Ht[Rn]);return qt});function P_(Nt,Ht){return cw(Nt,Oy(wo(Ht)))}var M_=jo(function(Nt,Ht){return Nt==null?{}:h0(Nt,Ht)});function cw(Nt,Ht){if(Nt==null)return{};var qt=ba(zo(Nt),function(gn){return[gn]});return Ht=wo(Ht),j0(Nt,qt,function(gn,Rn){return Ht(gn,Rn[0])})}function R_(Nt,Ht,qt){Ht=Fu(Ht,Nt);var gn=-1,Rn=Ht.length;for(Rn||(Rn=1,Nt=nt);++gnHt){var gn=Nt;Nt=Ht,Ht=gn}if(qt||Nt%1||Ht%1){var Rn=lm();return Ms(Nt+Rn*(Ht-Nt+Np("1e-"+((Rn+"").length-1))),Ht)}return cu(Nt,Ht)}var V_=Ft(function(Nt,Ht,qt){return Ht=Ht.toLowerCase(),Nt+(qt?dw(Ht):Ht)});function dw(Nt){return d1(Qo(Nt).toLowerCase())}function fw(Nt){return Nt=Qo(Nt),Nt&&Nt.replace(no,Fm).replace(ts,"")}function H_(Nt,Ht,qt){Nt=Qo(Nt),Ht=js(Ht);var gn=Nt.length;qt=qt===nt?gn:Ou(No(qt),0,gn);var Rn=qt;return qt-=Ht.length,qt>=0&&Nt.slice(qt,Rn)==Ht}function G_(Nt){return Nt=Qo(Nt),Nt&&jr.test(Nt)?Nt.replace(_r,Um):Nt}function q_(Nt){return Nt=Qo(Nt),Nt&&go.test(Nt)?Nt.replace(Br,"\\$&"):Nt}var Y_=Ft(function(Nt,Ht,qt){return Nt+(qt?"-":"")+Ht.toLowerCase()}),K_=Ft(function(Nt,Ht,qt){return Nt+(qt?" ":"")+Ht.toLowerCase()}),X_=Ay("toLowerCase");function J_(Nt,Ht,qt){Nt=Qo(Nt),Ht=No(Ht);var gn=Ht?iu(Nt):0;if(!Ht||gn>=Ht)return Nt;var Rn=(Ht-gn)/2;return Wr(Zp(Rn),qt)+Nt+Wr(Jp(Rn),qt)}function Z_(Nt,Ht,qt){Nt=Qo(Nt),Ht=No(Ht);var gn=Ht?iu(Nt):0;return Ht&&gn>>0,qt?(Nt=Qo(Nt),Nt&&(typeof Ht=="string"||Ht!=null&&!c1(Ht))&&(Ht=js(Ht),!Ht&&qu(Nt))?Uu(ss(Nt),0,qt):Nt.split(Ht,qt)):[]}var o4=Ft(function(Nt,Ht,qt){return Nt+(qt?" ":"")+d1(Ht)});function a4(Nt,Ht,qt){return Nt=Qo(Nt),qt=qt==null?0:Ou(No(qt),0,Nt.length),Ht=js(Ht),Nt.slice(qt,qt+Ht.length)==Ht}function s4(Nt,Ht,qt){var gn=Ln.templateSettings;qt&&Il(Nt,Ht,qt)&&(Ht=nt),Nt=Qo(Nt),Ht=Ly({},Ht,gn,ir);var Rn=Ly({},Ht.imports,gn.imports,ir),zn=Fs(Rn),Xn=Hs(Rn,zn),Zn,rr,Er=0,Tr=Ht.interpolate||Xr,Rr="__p += '",Zr=Es((Ht.escape||Xr).source+"|"+Tr.source+"|"+(Tr===Ur?er:Xr).source+"|"+(Ht.evaluate||Xr).source+"|$","g"),uo="//# sourceURL="+(qo.call(Ht,"sourceURL")?(Ht.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Xs+"]")+` -`;Nt.replace(Zr,function(Eo,Uo,Ho,Ql,Al,_c){return Ho||(Ho=Ql),Rr+=Nt.slice(Er,_c).replace(Jr,Q0),Uo&&(Zn=!0,Rr+=`' + + */lodash.exports;(function(tt,et){(function(){var nt,it="4.17.21",rt=200,ot="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",at="Expected a function",st="Invalid `variable` option passed into `_.template`",lt="__lodash_hash_undefined__",ct=500,ut="__lodash_placeholder__",ht=1,dt=2,pt=4,mt=1,gt=2,bt=1,yt=2,wt=4,vt=8,xt=16,St=32,Et=64,$t=128,It=256,Ft=512,Ht=30,zt="...",Ot=800,jt=16,kt=1,Tt=2,Ct=3,Ut=1/0,Nt=9007199254740991,Bt=17976931348623157e292,Mt=0/0,Dt=4294967295,Pt=Dt-1,Vt=Dt>>>1,nn=[["ary",$t],["bind",bt],["bindKey",yt],["curry",vt],["curryRight",xt],["flip",Ft],["partial",St],["partialRight",Et],["rearg",It]],cn="[object Arguments]",Xt="[object Array]",un="[object AsyncFunction]",en="[object Boolean]",fn="[object Date]",xn="[object DOMException]",an="[object Error]",Zt="[object Function]",En="[object GeneratorFunction]",In="[object Map]",Cn="[object Number]",Nn="[object Null]",Un="[object Object]",_n="[object Promise]",An="[object Proxy]",gn="[object RegExp]",Tn="[object Set]",yn="[object String]",dn="[object Symbol]",sn="[object Undefined]",rn="[object WeakMap]",Sn="[object WeakSet]",tn="[object ArrayBuffer]",qt="[object DataView]",Kt="[object Float32Array]",wn="[object Float64Array]",Rn="[object Int8Array]",jn="[object Int16Array]",Bn="[object Int32Array]",Xn="[object Uint8Array]",Wn="[object Uint8ClampedArray]",Gn="[object Uint16Array]",Fn="[object Uint32Array]",Jn=/\b__p \+= '';/g,Vn=/\b(__p \+=) '' \+/g,dr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ur=/&(?:amp|lt|gt|quot|#39);/g,_r=/[&<>"']/g,Qr=RegExp(ur.source),Or=RegExp(_r.source),Mr=/<%-([\s\S]+?)%>/g,qr=/<%([\s\S]+?)%>/g,Ur=/<%=([\s\S]+?)%>/g,Lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ao=/^\w*$/,Gr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Br=/[\\^$.*+?()[\]{}|]/g,go=RegExp(Br.source),vn=/^\s+/,Pn=/\s/,hn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jt=/\{\n\/\* \[wrapped with (.+)\] \*/,kn=/,? & /,On=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dn=/[()=,{}\[\]\/\s]/,Yn=/\\(\\)?/g,er=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,or=/\w*$/,ar=/^[-+]0x[0-9a-f]+$/i,Vr=/^0b[01]+$/i,wr=/^\[object .+?Constructor\]$/,jr=/^0o[0-7]+$/i,Hr=/^(?:0|[1-9]\d*)$/,no=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xr=/($^)/,Jr=/['\n\r\u2028\u2029\\]/g,br="\\ud800-\\udfff",$r="\\u0300-\\u036f",Dr="\\ufe20-\\ufe2f",Cr="\\u20d0-\\u20ff",Ar=$r+Dr+Cr,Nr="\\u2700-\\u27bf",Fr="a-z\\xdf-\\xf6\\xf8-\\xff",Pr="\\xac\\xb1\\xd7\\xf7",_i="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nr="\\u2000-\\u206f",xr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",yr="\\ufe0e\\ufe0f",Ir=Pr+_i+nr+xr,io="['’]",so="["+br+"]",fo="["+Ir+"]",po="["+Ar+"]",qn="\\d+",vo="["+Nr+"]",_o="["+Fr+"]",xo="[^"+br+Ir+qn+Nr+Fr+cr+"]",bo="\\ud83c[\\udffb-\\udfff]",$o="(?:"+po+"|"+bo+")",Ro="[^"+br+"]",Wo="(?:\\ud83c[\\udde6-\\uddff]){2}",Po="[\\ud800-\\udbff][\\udc00-\\udfff]",Fo="["+cr+"]",Go="\\u200d",Xo="(?:"+_o+"|"+xo+")",ga="(?:"+Fo+"|"+xo+")",na="(?:"+io+"(?:d|ll|m|re|s|t|ve))?",$a="(?:"+io+"(?:D|LL|M|RE|S|T|VE))?",Jo=$o+"?",pu="["+yr+"]?",eu="(?:"+Go+"(?:"+[Ro,Wo,Po].join("|")+")"+pu+Jo+")*",Lo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tu=pu+Jo+eu,sp="(?:"+[vo,Wo,Po].join("|")+")"+tu,jp="(?:"+[Ro+po+"?",po,Wo,Po,so].join("|")+")",b0=RegExp(io,"g"),ts=RegExp(po,"g"),mu=RegExp(bo+"(?="+bo+")|"+jp+tu,"g"),w0=RegExp([Fo+"?"+_o+"+"+na+"(?="+[fo,Fo,"$"].join("|")+")",ga+"+"+$a+"(?="+[fo,Fo+Xo,"$"].join("|")+")",Fo+"?"+Xo+"+"+na,Fo+"+"+$a,Bp,Lo,qn,sp].join("|"),"g"),Us=RegExp("["+Go+br+Ar+yr+"]"),Op=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Vu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xs=-1,Yo={};Yo[Kt]=Yo[wn]=Yo[Rn]=Yo[jn]=Yo[Bn]=Yo[Xn]=Yo[Wn]=Yo[Gn]=Yo[Fn]=!0,Yo[cn]=Yo[Xt]=Yo[tn]=Yo[en]=Yo[qt]=Yo[fn]=Yo[an]=Yo[Zt]=Yo[In]=Yo[Cn]=Yo[Un]=Yo[gn]=Yo[Tn]=Yo[yn]=Yo[rn]=!1;var Ko={};Ko[cn]=Ko[Xt]=Ko[tn]=Ko[qt]=Ko[en]=Ko[fn]=Ko[Kt]=Ko[wn]=Ko[Rn]=Ko[jn]=Ko[Bn]=Ko[In]=Ko[Cn]=Ko[Un]=Ko[gn]=Ko[Tn]=Ko[yn]=Ko[dn]=Ko[Xn]=Ko[Wn]=Ko[Gn]=Ko[Fn]=!0,Ko[an]=Ko[Zt]=Ko[rn]=!1;var Js={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zs={"&":"&","<":"<",">":">",'"':""","'":"'"},nu={"&":"&","<":"<",">":">",""":'"',"'":"'"},$l={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Np=parseFloat,Lp=parseInt,Ws=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Hu=typeof self=="object"&&self&&self.Object===Object&&self,ns=Ws||Hu||Function("return this")(),gu=et&&!et.nodeType&&et,ls=gu&&!0&&tt&&!tt.nodeType&&tt,ys=ls&&ls.exports===gu,Iu=ys&&Ws.process,rs=function(){try{var Qn=ls&&ls.require&&ls.require("util").types;return Qn||Iu&&Iu.binding&&Iu.binding("util")}catch{}}(),yu=rs&&rs.isArrayBuffer,Gu=rs&&rs.isDate,Dp=rs&&rs.isMap,bs=rs&&rs.isRegExp,Cs=rs&&rs.isSet,os=rs&&rs.isTypedArray;function Vo(Qn,Sr,pr){switch(pr.length){case 0:return Qn.call(Sr);case 1:return Qn.call(Sr,pr[0]);case 2:return Qn.call(Sr,pr[0],pr[1]);case 3:return Qn.call(Sr,pr[0],pr[1],pr[2])}return Qn.apply(Sr,pr)}function Zs(Qn,Sr,pr,ro){for(var To=-1,Co=Qn==null?0:Qn.length;++To-1}function lp(Qn,Sr,pr){for(var ro=-1,To=Qn==null?0:Qn.length;++ro-1;);return pr}function hp(Qn,Sr){for(var pr=Qn.length;pr--&&Fl(Sr,Qn[pr],0)>-1;);return pr}function Wl(Qn,Sr){for(var pr=Qn.length,ro=0;pr--;)Qn[pr]===Sr&&++ro;return ro}var Fm=Ys(Js),Um=Ys(zs);function Q0(Qn){return"\\"+$l[Qn]}function em(Qn,Sr){return Qn==null?nt:Qn[Sr]}function qu(Qn){return Us.test(Qn)}function Wp(Qn){return Op.test(Qn)}function dp(Qn){for(var Sr,pr=[];!(Sr=Qn.next()).done;)pr.push(Sr.value);return pr}function Vp(Qn){var Sr=-1,pr=Array(Qn.size);return Qn.forEach(function(ro,To){pr[++Sr]=[To,ro]}),pr}function fp(Qn,Sr){return function(pr){return Qn(Sr(pr))}}function Vl(Qn,Sr){for(var pr=-1,ro=Qn.length,To=0,Co=[];++pr-1}function I0(At,Wt){var Yt=this.__data__,mn=Bu(Yt,At);return mn<0?(++this.size,Yt.push([At,Wt])):Yt[mn][1]=Wt,this}Hl.prototype.clear=ay,Hl.prototype.delete=um,Hl.prototype.get=sy,Hl.prototype.has=ly,Hl.prototype.set=I0;function Cl(At){var Wt=-1,Yt=At==null?0:At.length;for(this.clear();++Wt=Wt?At:Wt)),At}function _l(At,Wt,Yt,mn,Mn,zn){var Kn,Zn=Wt&ht,rr=Wt&dt,Er=Wt&pt;if(Yt&&(Kn=Mn?Yt(At,mn,Mn,zn):Yt(At)),Kn!==nt)return Kn;if(!ds(At))return At;var Tr=Mo(At);if(Tr){if(Kn=Aw(At),!Zn)return Ls(At,Kn)}else{var Rr=Ks(At),Zr=Rr==Zt||Rr==En;if(Rp(At))return Cm(At,Zn);if(Rr==Un||Rr==cn||Zr&&!Mn){if(Kn=rr||Zr?{}:$1(At),!Zn)return rr?Iy(At,my(Kn,At)):Ky(At,gm(Kn,At))}else{if(!Ko[Rr])return Mn?At:{};Kn=$w(At,Rr,Zn)}}zn||(zn=new xs);var uo=zn.get(At);if(uo)return uo;zn.set(At,Kn),iw(At)?At.forEach(function(Eo){Kn.add(_l(Eo,Wt,Yt,Eo,At,zn))}):tw(At)&&At.forEach(function(Eo,Uo){Kn.set(Uo,_l(Eo,Wt,Yt,Uo,At,zn))});var So=Er?rr?zo:ms:rr?Ol:Fs,Do=Tr?nt:So(At);return ws(Do||At,function(Eo,Uo){Do&&(Uo=Eo,Eo=At[Uo]),Gl(Kn,Uo,_l(Eo,Wt,Yt,Uo,At,zn))}),Kn}function ym(At){var Wt=Fs(At);return function(Yt){return P0(Yt,At,Wt)}}function P0(At,Wt,Yt){var mn=Yt.length;if(At==null)return!mn;for(At=ko(At);mn--;){var Mn=Yt[mn],zn=Wt[Mn],Kn=At[Mn];if(Kn===nt&&!(Mn in At)||!zn(Kn))return!1}return!0}function bm(At,Wt,Yt){if(typeof At!="function")throw new Gs(at);return Bm(function(){At.apply(nt,Yt)},Wt)}function Qu(At,Wt,Yt,mn){var Mn=-1,zn=Ll,Kn=!0,Zn=At.length,rr=[],Er=Wt.length;if(!Zn)return rr;Yt&&(Wt=ba(Wt,Vs(Yt))),mn?(zn=lp,Kn=!1):Wt.length>=rt&&(zn=As,Kn=!1,Wt=new Ru(Wt));e:for(;++MnMn?0:Mn+Yt),mn=mn===nt||mn>Mn?Mn:No(mn),mn<0&&(mn+=Mn),mn=Yt>mn?0:ow(mn);Yt0&&Yt(Zn)?Wt>1?Is(Zn,Wt-1,Yt,mn,Mn):Dl(Mn,Zn):mn||(Mn[Mn.length]=Zn)}return Mn}var Sp=W0(),a0=W0(!0);function xl(At,Wt){return At&&Sp(At,Wt,Fs)}function Ep(At,Wt){return At&&a0(At,Wt,Fs)}function _h(At,Wt){return Ps(Wt,function(Yt){return np(At[Yt])})}function Xl(At,Wt){Wt=Fu(Wt,At);for(var Yt=0,mn=Wt.length;At!=null&&YtWt}function by(At,Wt){return At!=null&&qo.call(At,Wt)}function vm(At,Wt){return At!=null&&Wt in ko(At)}function qy(At,Wt,Yt){return At>=Ms(Wt,Yt)&&At<_s(Wt,Yt)}function Tp(At,Wt,Yt){for(var mn=Yt?lp:Ll,Mn=At[0].length,zn=At.length,Kn=zn,Zn=pr(zn),rr=1/0,Er=[];Kn--;){var Tr=At[Kn];Kn&&Wt&&(Tr=ba(Tr,Vs(Wt))),rr=Ms(Tr.length,rr),Zn[Kn]=!Yt&&(Wt||Mn>=120&&Tr.length>=120)?new Ru(Kn&&Tr):nt}Tr=At[0];var Rr=-1,Zr=Zn[0];e:for(;++Rr-1;)Zn!==At&&Pu.call(Zn,rr,1),Pu.call(At,rr,1);return At}function js(At,Wt){for(var Yt=At?Wt.length:0,mn=Yt-1;Yt--;){var Mn=Wt[Yt];if(Yt==mn||Mn!==zn){var zn=Mn;tp(Mn)?Pu.call(At,Mn,1):Im(At,Mn)}}return At}function cu(At,Wt){return At+Zp(lm()*(Wt-At+1))}function Pl(At,Wt,Yt,mn){for(var Mn=-1,zn=_s(Jp((Wt-At)/(Yt||1)),0),Kn=pr(zn);zn--;)Kn[mn?zn:++Mn]=At,At+=Yt;return Kn}function Mp(At,Wt){var Yt="";if(!At||Wt<1||Wt>Nt)return Yt;do Wt%2&&(Yt+=At),Wt=Zp(Wt/2),Wt&&(At+=At);while(Wt);return Yt}function mo(At,Wt){return i1(M1(At,Wt,Nl),At+"")}function wy(At){return r0(q0(At))}function Sm(At,Wt){var Yt=q0(At);return Cy(Yt,ju(Wt,0,Yt.length))}function _f(At,Wt,Yt,mn){if(!ds(At))return At;Wt=Fu(Wt,At);for(var Mn=-1,zn=Wt.length,Kn=zn-1,Zn=At;Zn!=null&&++MnMn?0:Mn+Wt),Yt=Yt>Mn?Mn:Yt,Yt<0&&(Yt+=Mn),Mn=Wt>Yt?0:Yt-Wt>>>0,Wt>>>=0;for(var zn=pr(Mn);++mn>>1,Kn=At[zn];Kn!==null&&!Zl(Kn)&&(Yt?Kn<=Wt:Kn=rt){var Er=Wt?null:Ds(At);if(Er)return Hp(Er);Kn=!1,Mn=As,rr=new Ru}else rr=Wt?[]:Zn;e:for(;++mn=mn?At:El(At,Wt,Yt)}var Ey=Xp||function(At){return ns.clearTimeout(At)};function Cm(At,Wt){if(Wt)return At.slice();var Yt=At.length,mn=rm?rm(Yt):new At.constructor(Yt);return At.copy(mn),mn}function U0(At){var Wt=new At.constructor(At.byteLength);return new Yp(Wt).set(new Yp(At)),Wt}function Yy(At,Wt){var Yt=Wt?U0(At.buffer):At.buffer;return new At.constructor(Yt,At.byteOffset,At.byteLength)}function Ml(At){var Wt=new At.constructor(At.source,or.exec(At));return Wt.lastIndex=At.lastIndex,Wt}function Pm(At){return _u?ko(_u.call(At)):{}}function Ty(At,Wt){var Yt=Wt?U0(At.buffer):At.buffer;return new At.constructor(Yt,At.byteOffset,At.length)}function Su(At,Wt){if(At!==Wt){var Yt=At!==nt,mn=At===null,Mn=At===At,zn=Zl(At),Kn=Wt!==nt,Zn=Wt===null,rr=Wt===Wt,Er=Zl(Wt);if(!Zn&&!Er&&!zn&&At>Wt||zn&&Kn&&rr&&!Zn&&!Er||mn&&Kn&&rr||!Yt&&rr||!Mn)return 1;if(!mn&&!zn&&!Er&&At=Zn)return rr;var Er=Yt[mn];return rr*(Er=="desc"?-1:1)}}return At.index-Wt.index}function zu(At,Wt,Yt,mn){for(var Mn=-1,zn=At.length,Kn=Yt.length,Zn=-1,rr=Wt.length,Er=_s(zn-Kn,0),Tr=pr(rr+Er),Rr=!mn;++Zn1?Yt[Mn-1]:nt,Kn=Mn>2?Yt[2]:nt;for(zn=At.length>3&&typeof zn=="function"?(Mn--,zn):nt,Kn&&Il(Yt[0],Yt[1],Kn)&&(zn=Mn<3?nt:zn,Mn=1),Wt=ko(Wt);++mn-1?Mn[zn?Wt[Kn]:Kn]:nt}}function pn(At){return Oo(function(Wt){var Yt=Wt.length,mn=Yt,Mn=Rs.prototype.thru;for(At&&Wt.reverse();mn--;){var zn=Wt[mn];if(typeof zn!="function")throw new Gs(at);if(Mn&&!Kn&&V0(zn)=="wrapper")var Kn=new Rs([],!0)}for(mn=Kn?mn:Yt;++mn1&&Ho.reverse(),Tr&&rrZn))return!1;var Er=zn.get(At),Tr=zn.get(Wt);if(Er&&Tr)return Er==Wt&&Tr==At;var Rr=-1,Zr=!0,uo=Yt>?new Ru:nt;for(zn.set(At,Wt),zn.set(Wt,At);++Rr1?"& ":"")+Wt[mn],Wt=Wt.join(Yt>2?", ":" "),At.replace(hn,`{ +/* [wrapped with `+Wt+`] */ +`)}function Pw(At){return Mo(At)||y0(At)||!!(am&&At&&At[am])}function tp(At,Wt){var Yt=typeof At;return Wt=Wt??Nt,!!Wt&&(Yt=="number"||Yt!="symbol"&&Hr.test(At))&&At>-1&&At%1==0&&At0){if(++Wt>=Ot)return arguments[0]}else Wt=0;return At.apply(nt,arguments)}}function Cy(At,Wt){var Yt=-1,mn=At.length,Mn=mn-1;for(Wt=Wt===nt?mn:Wt;++Yt1?At[Wt-1]:nt;return Yt=typeof Yt=="function"?(At.pop(),Yt):nt,V1(At,Yt)});function H1(At){var Wt=Ln(At);return Wt.__chain__=!0,Wt}function zv(At,Wt){return Wt(At),At}function Py(At,Wt){return Wt(At)}var Wv=Oo(function(At){var Wt=At.length,Yt=Wt?At[0]:0,mn=this.__wrapped__,Mn=function(zn){return C0(zn,At)};return Wt>1||this.__actions__.length||!(mn instanceof yo)||!tp(Yt)?this.thru(Mn):(mn=mn.slice(Yt,+Yt+(Wt?1:0)),mn.__actions__.push({func:Py,args:[Mn],thisArg:nt}),new Rs(mn,this.__chain__).thru(function(zn){return Wt&&!zn.length&&zn.push(nt),zn}))});function Vv(){return H1(this)}function Hv(){return new Rs(this.value(),this.__chain__)}function Gv(){this.__values__===nt&&(this.__values__=rw(this.value()));var At=this.__index__>=this.__values__.length,Wt=At?nt:this.__values__[this.__index__++];return{done:At,value:Wt}}function qv(){return this}function Yv(At){for(var Wt,Yt=this;Yt instanceof i0;){var mn=L1(Yt);mn.__index__=0,mn.__values__=nt,Wt?Mn.__wrapped__=mn:Wt=mn;var Mn=mn;Yt=Yt.__wrapped__}return Mn.__wrapped__=At,Wt}function Kv(){var At=this.__wrapped__;if(At instanceof yo){var Wt=At;return this.__actions__.length&&(Wt=new yo(this)),Wt=Wt.reverse(),Wt.__actions__.push({func:Py,args:[r1],thisArg:nt}),new Rs(Wt,this.__chain__)}return this.thru(r1)}function Xv(){return Lu(this.__wrapped__,this.__actions__)}var Jv=p0(function(At,Wt,Yt){qo.call(At,Yt)?++At[Yt]:lu(At,Yt,1)});function Zv(At,Wt,Yt){var mn=Mo(At)?J0:Gy;return Yt&&Il(At,Wt,Yt)&&(Wt=nt),mn(At,wo(Wt,3))}function Qv(At,Wt){var Yt=Mo(At)?Ps:wm;return Yt(At,wo(Wt,3))}var t2=Qt(D1),n2=Qt(F1);function i2(At,Wt){return Is(My(At,Wt),1)}function r2(At,Wt){return Is(My(At,Wt),Ut)}function o2(At,Wt,Yt){return Yt=Yt===nt?1:No(Yt),Is(My(At,Wt),Yt)}function G1(At,Wt){var Yt=Mo(At)?ws:Yl;return Yt(At,wo(Wt,3))}function q1(At,Wt){var Yt=Mo(At)?X0:gy;return Yt(At,wo(Wt,3))}var a2=p0(function(At,Wt,Yt){qo.call(At,Yt)?At[Yt].push(Wt):lu(At,Yt,[Wt])});function s2(At,Wt,Yt,mn){At=Bl(At)?At:q0(At),Yt=Yt&&!mn?No(Yt):0;var Mn=At.length;return Yt<0&&(Yt=_s(Mn+Yt,0)),Ny(At)?Yt<=Mn&&At.indexOf(Wt,Yt)>-1:!!Mn&&Fl(At,Wt,Yt)>-1}var l2=mo(function(At,Wt,Yt){var mn=-1,Mn=typeof Wt=="function",zn=Bl(At)?pr(At.length):[];return Yl(At,function(Kn){zn[++mn]=Mn?Vo(Wt,Kn,Yt):xa(Kn,Wt,Yt)}),zn}),c2=p0(function(At,Wt,Yt){lu(At,Yt,Wt)});function My(At,Wt){var Yt=Mo(At)?ba:_d;return Yt(At,wo(Wt,3))}function u2(At,Wt,Yt,mn){return At==null?[]:(Mo(Wt)||(Wt=Wt==null?[]:[Wt]),Yt=mn?nt:Yt,Mo(Yt)||(Yt=Yt==null?[]:[Yt]),u0(At,Wt,Yt))}var h2=p0(function(At,Wt,Yt){At[Yt?0:1].push(Wt)},function(){return[[],[]]});function d2(At,Wt,Yt){var mn=Mo(At)?v0:Au,Mn=arguments.length<3;return mn(At,wo(Wt,4),Yt,Mn,Yl)}function f2(At,Wt,Yt){var mn=Mo(At)?Om:Au,Mn=arguments.length<3;return mn(At,wo(Wt,4),Yt,Mn,gy)}function p2(At,Wt){var Yt=Mo(At)?Ps:wm;return Yt(At,jy(wo(Wt,3)))}function m2(At){var Wt=Mo(At)?r0:wy;return Wt(At)}function g2(At,Wt,Yt){(Yt?Il(At,Wt,Yt):Wt===nt)?Wt=1:Wt=No(Wt);var mn=Mo(At)?fm:Sm;return mn(At,Wt)}function y2(At){var Wt=Mo(At)?fy:xy;return Wt(At)}function b2(At){if(At==null)return 0;if(Bl(At))return Ny(At)?iu(At):At.length;var Wt=Ks(At);return Wt==In||Wt==Tn?At.size:Bs(At).length}function w2(At,Wt,Yt){var mn=Mo(At)?Fp:Em;return Yt&&Il(At,Wt,Yt)&&(Wt=nt),mn(At,wo(Wt,3))}var _2=mo(function(At,Wt){if(At==null)return[];var Yt=Wt.length;return Yt>1&&Il(At,Wt[0],Wt[1])?Wt=[]:Yt>2&&Il(Wt[0],Wt[1],Wt[2])&&(Wt=[Wt[0]]),u0(At,Is(Wt,1),[])}),Ry=Hm||function(){return ns.Date.now()};function x2(At,Wt){if(typeof Wt!="function")throw new Gs(at);return At=No(At),function(){if(--At<1)return Wt.apply(this,arguments)}}function Y1(At,Wt,Yt){return Wt=Yt?nt:Wt,Wt=At&&Wt==null?At.length:Wt,lr(At,$t,nt,nt,nt,nt,Wt)}function K1(At,Wt){var Yt;if(typeof Wt!="function")throw new Gs(at);return At=No(At),function(){return--At>0&&(Yt=Wt.apply(this,arguments)),At<=1&&(Wt=nt),Yt}}var a1=mo(function(At,Wt,Yt){var mn=bt;if(Yt.length){var Mn=Vl(Yt,H0(a1));mn|=St}return lr(At,mn,Wt,Yt,Mn)}),X1=mo(function(At,Wt,Yt){var mn=bt|yt;if(Yt.length){var Mn=Vl(Yt,H0(X1));mn|=St}return lr(Wt,mn,At,Yt,Mn)});function J1(At,Wt,Yt){Wt=Yt?nt:Wt;var mn=lr(At,vt,nt,nt,nt,nt,nt,Wt);return mn.placeholder=J1.placeholder,mn}function Z1(At,Wt,Yt){Wt=Yt?nt:Wt;var mn=lr(At,xt,nt,nt,nt,nt,nt,Wt);return mn.placeholder=Z1.placeholder,mn}function Q1(At,Wt,Yt){var mn,Mn,zn,Kn,Zn,rr,Er=0,Tr=!1,Rr=!1,Zr=!0;if(typeof At!="function")throw new Gs(at);Wt=fu(Wt)||0,ds(Yt)&&(Tr=!!Yt.leading,Rr="maxWait"in Yt,zn=Rr?_s(fu(Yt.maxWait)||0,Wt):zn,Zr="trailing"in Yt?!!Yt.trailing:Zr);function uo(Ss){var Tu=mn,ap=Mn;return mn=Mn=nt,Er=Ss,Kn=At.apply(ap,Tu),Kn}function So(Ss){return Er=Ss,Zn=Bm(Uo,Wt),Tr?uo(Ss):Kn}function Do(Ss){var Tu=Ss-rr,ap=Ss-Er,yw=Wt-Tu;return Rr?Ms(yw,zn-ap):yw}function Eo(Ss){var Tu=Ss-rr,ap=Ss-Er;return rr===nt||Tu>=Wt||Tu<0||Rr&&ap>=zn}function Uo(){var Ss=Ry();if(Eo(Ss))return Ho(Ss);Zn=Bm(Uo,Do(Ss))}function Ho(Ss){return Zn=nt,Zr&&mn?uo(Ss):(mn=Mn=nt,Kn)}function Ql(){Zn!==nt&&Ey(Zn),Er=0,mn=rr=Mn=Zn=nt}function Al(){return Zn===nt?Kn:Ho(Ry())}function _c(){var Ss=Ry(),Tu=Eo(Ss);if(mn=arguments,Mn=this,rr=Ss,Tu){if(Zn===nt)return So(rr);if(Rr)return Ey(Zn),Zn=Bm(Uo,Wt),uo(rr)}return Zn===nt&&(Zn=Bm(Uo,Wt)),Kn}return _c.cancel=Ql,_c.flush=Al,_c}var k2=mo(function(At,Wt){return bm(At,1,Wt)}),S2=mo(function(At,Wt,Yt){return bm(At,fu(Wt)||0,Yt)});function E2(At){return lr(At,Ft)}function By(At,Wt){if(typeof At!="function"||Wt!=null&&typeof Wt!="function")throw new Gs(at);var Yt=function(){var mn=arguments,Mn=Wt?Wt.apply(this,mn):mn[0],zn=Yt.cache;if(zn.has(Mn))return zn.get(Mn);var Kn=At.apply(this,mn);return Yt.cache=zn.set(Mn,Kn)||zn,Kn};return Yt.cache=new(By.Cache||Cl),Yt}By.Cache=Cl;function jy(At){if(typeof At!="function")throw new Gs(at);return function(){var Wt=arguments;switch(Wt.length){case 0:return!At.call(this);case 1:return!At.call(this,Wt[0]);case 2:return!At.call(this,Wt[0],Wt[1]);case 3:return!At.call(this,Wt[0],Wt[1],Wt[2])}return!At.apply(this,Wt)}}function T2(At){return K1(2,At)}var I2=Sy(function(At,Wt){Wt=Wt.length==1&&Mo(Wt[0])?ba(Wt[0],Vs(wo())):ba(Is(Wt,1),Vs(wo()));var Yt=Wt.length;return mo(function(mn){for(var Mn=-1,zn=Ms(mn.length,Yt);++Mn=Wt}),y0=Bo(function(){return arguments}())?Bo:function(At){return gs(At)&&qo.call(At,"callee")&&!E0.call(At,"callee")},Mo=pr.isArray,z2=yu?Vs(yu):fs;function Bl(At){return At!=null&&Oy(At.length)&&!np(At)}function ks(At){return gs(At)&&Bl(At)}function W2(At){return At===!0||At===!1||gs(At)&&$s(At)==en}var Rp=qm||b1,V2=Gu?Vs(Gu):ps;function H2(At){return gs(At)&&At.nodeType===1&&!jm(At)}function G2(At){if(At==null)return!0;if(Bl(At)&&(Mo(At)||typeof At=="string"||typeof At.splice=="function"||Rp(At)||G0(At)||y0(At)))return!At.length;var Wt=Ks(At);if(Wt==In||Wt==Tn)return!At.size;if(Rm(At))return!Bs(At).length;for(var Yt in At)if(qo.call(At,Yt))return!1;return!0}function q2(At,Wt){return us(At,Wt)}function Y2(At,Wt,Yt){Yt=typeof Yt=="function"?Yt:nt;var mn=Yt?Yt(At,Wt):nt;return mn===nt?us(At,Wt,nt,Yt):!!mn}function l1(At){if(!gs(At))return!1;var Wt=$s(At);return Wt==an||Wt==xn||typeof At.message=="string"&&typeof At.name=="string"&&!jm(At)}function K2(At){return typeof At=="number"&&sm(At)}function np(At){if(!ds(At))return!1;var Wt=$s(At);return Wt==Zt||Wt==En||Wt==un||Wt==An}function ew(At){return typeof At=="number"&&At==No(At)}function Oy(At){return typeof At=="number"&&At>-1&&At%1==0&&At<=Nt}function ds(At){var Wt=typeof At;return At!=null&&(Wt=="object"||Wt=="function")}function gs(At){return At!=null&&typeof At=="object"}var tw=Dp?Vs(Dp):Ip;function X2(At,Wt){return At===Wt||hs(At,Wt,Jy(Wt))}function J2(At,Wt,Yt){return Yt=typeof Yt=="function"?Yt:nt,hs(At,Wt,Jy(Wt),Yt)}function Z2(At){return nw(At)&&At!=+At}function Q2(At){if(Bw(At))throw new To(ot);return Ap(At)}function e_(At){return At===null}function t_(At){return At==null}function nw(At){return typeof At=="number"||gs(At)&&$s(At)==Cn}function jm(At){if(!gs(At)||$s(At)!=Un)return!1;var Wt=Kp(At);if(Wt===null)return!0;var Yt=qo.call(Wt,"constructor")&&Wt.constructor;return typeof Yt=="function"&&Yt instanceof Yt&&wp.call(Yt)==Yu}var c1=bs?Vs(bs):$p;function n_(At){return ew(At)&&At>=-Nt&&At<=Nt}var iw=Cs?Vs(Cs):R0;function Ny(At){return typeof At=="string"||!Mo(At)&&gs(At)&&$s(At)==yn}function Zl(At){return typeof At=="symbol"||gs(At)&&$s(At)==dn}var G0=os?Vs(os):xm;function i_(At){return At===nt}function r_(At){return gs(At)&&Ks(At)==rn}function o_(At){return gs(At)&&$s(At)==Sn}var a_=ho(l0),s_=ho(function(At,Wt){return At<=Wt});function rw(At){if(!At)return[];if(Bl(At))return Ny(At)?ss(At):Ls(At);if(Mu&&At[Mu])return dp(At[Mu]());var Wt=Ks(At),Yt=Wt==In?Vp:Wt==Tn?Hp:q0;return Yt(At)}function rp(At){if(!At)return At===0?At:0;if(At=fu(At),At===Ut||At===-Ut){var Wt=At<0?-1:1;return Wt*Bt}return At===At?At:0}function No(At){var Wt=rp(At),Yt=Wt%1;return Wt===Wt?Yt?Wt-Yt:Wt:0}function ow(At){return At?ju(No(At),0,Dt):0}function fu(At){if(typeof At=="number")return At;if(Zl(At))return Mt;if(ds(At)){var Wt=typeof At.valueOf=="function"?At.valueOf():At;At=ds(Wt)?Wt+"":Wt}if(typeof At!="string")return At===0?At:+At;At=x0(At);var Yt=Vr.test(At);return Yt||jr.test(At)?Lp(At.slice(2),Yt?2:8):ar.test(At)?Mt:+At}function aw(At){return Rl(At,Ol(At))}function l_(At){return At?ju(No(At),-Nt,Nt):At===0?At:0}function Qo(At){return At==null?"":Os(At)}var c_=ep(function(At,Wt){if(Rm(Wt)||Bl(Wt)){Rl(Wt,Fs(Wt),At);return}for(var Yt in Wt)qo.call(Wt,Yt)&&Gl(At,Yt,Wt[Yt])}),sw=ep(function(At,Wt){Rl(Wt,Ol(Wt),At)}),Ly=ep(function(At,Wt,Yt,mn){Rl(Wt,Ol(Wt),At,mn)}),u_=ep(function(At,Wt,Yt,mn){Rl(Wt,Fs(Wt),At,mn)}),h_=Oo(C0);function d_(At,Wt){var Yt=xu(At);return Wt==null?Yt:gm(Yt,Wt)}var f_=mo(function(At,Wt){At=ko(At);var Yt=-1,mn=Wt.length,Mn=mn>2?Wt[2]:nt;for(Mn&&Il(Wt[0],Wt[1],Mn)&&(mn=1);++Yt1),zn}),Rl(At,zo(At),Yt),mn&&(Yt=_l(Yt,ht|dt|pt,eo));for(var Mn=Wt.length;Mn--;)Im(Yt,Wt[Mn]);return Yt});function P_(At,Wt){return cw(At,jy(wo(Wt)))}var M_=Oo(function(At,Wt){return At==null?{}:h0(At,Wt)});function cw(At,Wt){if(At==null)return{};var Yt=ba(zo(At),function(mn){return[mn]});return Wt=wo(Wt),O0(At,Yt,function(mn,Mn){return Wt(mn,Mn[0])})}function R_(At,Wt,Yt){Wt=Fu(Wt,At);var mn=-1,Mn=Wt.length;for(Mn||(Mn=1,At=nt);++mnWt){var mn=At;At=Wt,Wt=mn}if(Yt||At%1||Wt%1){var Mn=lm();return Ms(At+Mn*(Wt-At+Np("1e-"+((Mn+"").length-1))),Wt)}return cu(At,Wt)}var V_=Rt(function(At,Wt,Yt){return Wt=Wt.toLowerCase(),At+(Yt?dw(Wt):Wt)});function dw(At){return d1(Qo(At).toLowerCase())}function fw(At){return At=Qo(At),At&&At.replace(no,Fm).replace(ts,"")}function H_(At,Wt,Yt){At=Qo(At),Wt=Os(Wt);var mn=At.length;Yt=Yt===nt?mn:ju(No(Yt),0,mn);var Mn=Yt;return Yt-=Wt.length,Yt>=0&&At.slice(Yt,Mn)==Wt}function G_(At){return At=Qo(At),At&&Or.test(At)?At.replace(_r,Um):At}function q_(At){return At=Qo(At),At&&go.test(At)?At.replace(Br,"\\$&"):At}var Y_=Rt(function(At,Wt,Yt){return At+(Yt?"-":"")+Wt.toLowerCase()}),K_=Rt(function(At,Wt,Yt){return At+(Yt?" ":"")+Wt.toLowerCase()}),X_=Ay("toLowerCase");function J_(At,Wt,Yt){At=Qo(At),Wt=No(Wt);var mn=Wt?iu(At):0;if(!Wt||mn>=Wt)return At;var Mn=(Wt-mn)/2;return Wr(Zp(Mn),Yt)+At+Wr(Jp(Mn),Yt)}function Z_(At,Wt,Yt){At=Qo(At),Wt=No(Wt);var mn=Wt?iu(At):0;return Wt&&mn>>0,Yt?(At=Qo(At),At&&(typeof Wt=="string"||Wt!=null&&!c1(Wt))&&(Wt=Os(Wt),!Wt&&qu(At))?Uu(ss(At),0,Yt):At.split(Wt,Yt)):[]}var o4=Rt(function(At,Wt,Yt){return At+(Yt?" ":"")+d1(Wt)});function a4(At,Wt,Yt){return At=Qo(At),Yt=Yt==null?0:ju(No(Yt),0,At.length),Wt=Os(Wt),At.slice(Yt,Yt+Wt.length)==Wt}function s4(At,Wt,Yt){var mn=Ln.templateSettings;Yt&&Il(At,Wt,Yt)&&(Wt=nt),At=Qo(At),Wt=Ly({},Wt,mn,ir);var Mn=Ly({},Wt.imports,mn.imports,ir),zn=Fs(Mn),Kn=Hs(Mn,zn),Zn,rr,Er=0,Tr=Wt.interpolate||Xr,Rr="__p += '",Zr=Es((Wt.escape||Xr).source+"|"+Tr.source+"|"+(Tr===Ur?er:Xr).source+"|"+(Wt.evaluate||Xr).source+"|$","g"),uo="//# sourceURL="+(qo.call(Wt,"sourceURL")?(Wt.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Xs+"]")+` +`;At.replace(Zr,function(Eo,Uo,Ho,Ql,Al,_c){return Ho||(Ho=Ql),Rr+=At.slice(Er,_c).replace(Jr,Q0),Uo&&(Zn=!0,Rr+=`' + __e(`+Uo+`) + '`),Al&&(rr=!0,Rr+=`'; `+Al+`; __p += '`),Ho&&(Rr+=`' + ((__t = (`+Ho+`)) == null ? '' : __t) + '`),Er=_c+Eo.length,Eo}),Rr+=`'; -`;var So=qo.call(Ht,"variable")&&Ht.variable;if(!So)Rr=`with (obj) { +`;var So=qo.call(Wt,"variable")&&Wt.variable;if(!So)Rr=`with (obj) { `+Rr+` } -`;else if(Dn.test(So))throw new To(st);Rr=(rr?Rr.replace(Jn,""):Rr).replace(Hn,"$1").replace(dr,"$1;"),Rr="function("+(So||"obj")+`) { +`;else if(Dn.test(So))throw new To(st);Rr=(rr?Rr.replace(Jn,""):Rr).replace(Vn,"$1").replace(dr,"$1;"),Rr="function("+(So||"obj")+`) { `+(So?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(Zn?", __e = _.escape":"")+(rr?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Rr+`return __p -}`;var Do=mw(function(){return Co(zn,uo+"return "+Rr).apply(nt,Xn)});if(Do.source=Rr,l1(Do))throw Do;return Do}function l4(Nt){return Qo(Nt).toLowerCase()}function c4(Nt){return Qo(Nt).toUpperCase()}function u4(Nt,Ht,qt){if(Nt=Qo(Nt),Nt&&(qt||Ht===nt))return x0(Nt);if(!Nt||!(Ht=js(Ht)))return Nt;var gn=ss(Nt),Rn=ss(Ht),zn=_a(gn,Rn),Xn=hp(gn,Rn)+1;return Uu(gn,zn,Xn).join("")}function h4(Nt,Ht,qt){if(Nt=Qo(Nt),Nt&&(qt||Ht===nt))return Nt.slice(0,mp(Nt)+1);if(!Nt||!(Ht=js(Ht)))return Nt;var gn=ss(Nt),Rn=hp(gn,ss(Ht))+1;return Uu(gn,0,Rn).join("")}function d4(Nt,Ht,qt){if(Nt=Qo(Nt),Nt&&(qt||Ht===nt))return Nt.replace(wn,"");if(!Nt||!(Ht=js(Ht)))return Nt;var gn=ss(Nt),Rn=_a(gn,ss(Ht));return Uu(gn,Rn).join("")}function f4(Nt,Ht){var qt=Ut,gn=Lt;if(ds(Ht)){var Rn="separator"in Ht?Ht.separator:Rn;qt="length"in Ht?No(Ht.length):qt,gn="omission"in Ht?js(Ht.omission):gn}Nt=Qo(Nt);var zn=Nt.length;if(qu(Nt)){var Xn=ss(Nt);zn=Xn.length}if(qt>=zn)return Nt;var Zn=qt-iu(gn);if(Zn<1)return gn;var rr=Xn?Uu(Xn,0,Zn).join(""):Nt.slice(0,Zn);if(Rn===nt)return rr+gn;if(Xn&&(Zn+=rr.length-Zn),c1(Rn)){if(Nt.slice(Zn).search(Rn)){var Er,Tr=rr;for(Rn.global||(Rn=Es(Rn.source,Qo(or.exec(Rn))+"g")),Rn.lastIndex=0;Er=Rn.exec(Tr);)var Rr=Er.index;rr=rr.slice(0,Rr===nt?Zn:Rr)}}else if(Nt.indexOf(js(Rn),Zn)!=Zn){var Zr=rr.lastIndexOf(Rn);Zr>-1&&(rr=rr.slice(0,Zr))}return rr+gn}function p4(Nt){return Nt=Qo(Nt),Nt&&Qr.test(Nt)?Nt.replace(ur,gp):Nt}var m4=Ft(function(Nt,Ht,qt){return Nt+(qt?" ":"")+Ht.toUpperCase()}),d1=Ay("toUpperCase");function pw(Nt,Ht,qt){return Nt=Qo(Nt),Ht=qt?nt:Ht,Ht===nt?Wp(Nt)?yp(Nt):Lm(Nt):Nt.match(Ht)||[]}var mw=mo(function(Nt,Ht){try{return Vo(Nt,nt,Ht)}catch(qt){return l1(qt)?qt:new To(qt)}}),g4=jo(function(Nt,Ht){return ws(Ht,function(qt){qt=Wu(qt),lu(Nt,qt,a1(Nt[qt],Nt))}),Nt});function y4(Nt){var Ht=Nt==null?0:Nt.length,qt=wo();return Nt=Ht?ba(Nt,function(gn){if(typeof gn[1]!="function")throw new Gs(at);return[qt(gn[0]),gn[1]]}):[],mo(function(gn){for(var Rn=-1;++Rnjt)return[];var qt=Dt,gn=Ms(Nt,Dt);Ht=wo(Ht),Nt-=Dt;for(var Rn=wu(gn,Ht);++qt0||Ht<0)?new yo(qt):(Nt<0?qt=qt.takeRight(-Nt):Nt&&(qt=qt.drop(Nt)),Ht!==nt&&(Ht=No(Ht),qt=Ht<0?qt.dropRight(-Ht):qt.take(Ht-Nt)),qt)},yo.prototype.takeRightWhile=function(Nt){return this.reverse().takeWhile(Nt).reverse()},yo.prototype.toArray=function(){return this.take(Dt)},xl(yo.prototype,function(Nt,Ht){var qt=/^(?:filter|find|map|reject)|While$/.test(Ht),gn=/^(?:head|last)$/.test(Ht),Rn=Ln[gn?"take"+(Ht=="last"?"Right":""):Ht],zn=gn||/^find/.test(Ht);Rn&&(Ln.prototype[Ht]=function(){var Xn=this.__wrapped__,Zn=gn?[1]:arguments,rr=Xn instanceof yo,Er=Zn[0],Tr=rr||Mo(Xn),Rr=function(Uo){var Ho=Rn.apply(Ln,Dl([Uo],Zn));return gn&&Zr?Ho[0]:Ho};Tr&&qt&&typeof Er=="function"&&Er.length!=1&&(rr=Tr=!1);var Zr=this.__chain__,uo=!!this.__actions__.length,So=zn&&!Zr,Do=rr&&!uo;if(!zn&&Tr){Xn=Do?Xn:new yo(this);var Eo=Nt.apply(Xn,Zn);return Eo.__actions__.push({func:Py,args:[Rr],thisArg:nt}),new Rs(Eo,Zr)}return So&&Do?Nt.apply(this,Zn):(Eo=this.thru(Rr),So?gn?Eo.value()[0]:Eo.value():Eo)})}),ws(["pop","push","shift","sort","splice","unshift"],function(Nt){var Ht=Cu[Nt],qt=/^(?:push|sort|unshift)$/.test(Nt)?"tap":"thru",gn=/^(?:pop|shift)$/.test(Nt);Ln.prototype[Nt]=function(){var Rn=arguments;if(gn&&!this.__chain__){var zn=this.value();return Ht.apply(Mo(zn)?zn:[],Rn)}return this[qt](function(Xn){return Ht.apply(Mo(Xn)?Xn:[],Rn)})}}),xl(yo.prototype,function(Nt,Ht){var qt=Ln[Ht];if(qt){var gn=qt.name+"";qo.call(Ju,gn)||(Ju[gn]=[]),Ju[gn].push({name:Ht,func:qt})}}),Ju[An(nt,yt).name]=[{name:"wrapper",func:nt}],yo.prototype.clone=Uy,yo.prototype.reverse=zy,yo.prototype.value=yl,Ln.prototype.at=Wv,Ln.prototype.chain=Vv,Ln.prototype.commit=Hv,Ln.prototype.next=Gv,Ln.prototype.plant=Yv,Ln.prototype.reverse=Kv,Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=Xv,Ln.prototype.first=Ln.prototype.head,Mu&&(Ln.prototype[Mu]=qv),Ln},$u=Vm();ls?((ls.exports=$u)._=$u,gu._=$u):ns._=$u}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports;const videoTimeToSeconds=tt=>{const[et,nt,it]=tt.split(":"),rt=parseInt(et,10),ot=parseInt(nt,10),at=parseInt(it,10);return rt*3600+ot*60+at},getSelectedNodeTimestamps=(tt,et)=>{if(!et)return null;const nt=tt.filter(ot=>ot.show_title&&ot.link&&ot.show_title===et.show_title||ot.show_title&&ot.link&&ot.show_title===et.show_title&&ot.episode_title===et.episode_title),it=lodashExports.groupBy(nt,ot=>ot.timestamp),rt=lodashExports.values(it).reduce((ot,at)=>(at[0]&&ot.push(at[0]),ot),[]);return rt.sort((ot,at)=>{var ht,dt;const[st]=((ht=ot.timestamp)==null?void 0:ht.split("-"))||[""],[lt]=((dt=at.timestamp)==null?void 0:dt.split("-"))||[""],ct=videoTimeToSeconds(st),ut=videoTimeToSeconds(lt);return ct-ut}),rt},styles$1="",getElementsMemoized=()=>{const tt={};return()=>{if(tt.inner&&tt.body)return tt;const et=document.querySelector("body"),nt=document.createElement("div"),it=document.createElement("div"),rt=document.createElement("div"),ot=document.createElement("div"),at=()=>{nt.classList.toggle("hide")};return rt.addEventListener("click",at),ot.addEventListener("click",at),nt.classList.add("loggerWrapper"),nt.classList.add("hide"),it.classList.add("loggerInner"),rt.classList.add("close"),ot.classList.add("open"),rt.textContent="X",ot.textContent="OPEN LOG",et==null||et.appendChild(nt),et==null||et.appendChild(ot),nt.appendChild(rt),nt.appendChild(it),tt.body=et,tt.inner=it,{body:et,inner:it}}},getElements=getElementsMemoized(),variants=["log","info","warn","error"],logMessage=(tt,et)=>{const{inner:nt}=getElements(),it=document.createElement("span");it.textContent=tt,it.classList.add("message"),it.classList.add(et),nt.appendChild(it)},overrideConsole=()=>{if(!window.location.hostname.includes("local"))return;const tt=function(et){const nt=variants.reduce((it,rt)=>({...it,[rt](...ot){et[rt](...ot),logMessage(JSON.stringify(ot,null," "),rt)}}),{});return{...et,...nt}}(window.console);window.console=tt};async function getBalance(tt){return api$1.get("/balance",{Authorization:tt})}async function updateBudget(tt){const et=await getLSat();if(!et){tt(0);return}try{const nt=await getBalance(et);tt(nt.balance)}catch{tt(0)}}const convertToChatMessage=tt=>{const et=/((http|https):\/\/[^\s]+)/g,nt=/@(\w+)/g;let it=tt.replace(/\\/g,"");return it=it.replace(/'/g,"’"),it=it.replace(/\n/g,"
"),it=it.replace(et,'$1'),it=it.replace(nt,'@$1'),it},useIsMatchBreakpoint=(tt,et="down")=>{const nt=useTheme(),[it,rt]=reactExports.useState(!1),ot=nt.breakpoints[et](tt).split("@media")[1].trim();return reactExports.useEffect(()=>{const at=()=>{const{matches:st}=window.matchMedia(ot);rt(st)};return at(),window.addEventListener("resize",at),()=>window.removeEventListener("resize",at)},[ot]),it};function extractUuidAndHost(tt){const et={host:"",uuid:""};let nt="";if(!tt)return et;tt[0]==="?"&&(nt=tt.substring(1,tt.length));const it=nt.split("&");for(let rt=0;rtawait api$1.get(`/radar?${new URLSearchParams({...defaultParams,...tt}).toString()}`),getTopicsData=async(tt=defaultParams)=>{const et=await generateAuthQueryParam();return await api$1.get(`/topics?${new URLSearchParams({...defaultParams,...tt}).toString()}${et}`)},getAboutData=async()=>await api$1.get("/about"),getStats=async()=>await api$1.get("/stats"),getEdgeTypes=async()=>{const tt=await generateAuthQueryParam();return await api$1.get(`curation/edge/type?${tt}`)},postEdgeType=async tt=>{const et=await generateAuthQueryParam();return await api$1.post(`/curation/edge?${et}`,JSON.stringify(tt))},postAboutData=async tt=>{const et=await generateAuthQueryParam();return await api$1.post(`/about?${et}`,JSON.stringify(tt))},postMergeTopics=async tt=>{const et=await generateAuthQueryParam();return await api$1.post(`/curation/merge?${et}`,JSON.stringify(tt))},putRadarData=async(tt,et)=>{const nt=await generateAuthQueryParam();return await api$1.put(`/radar/${tt}?${nt}`,JSON.stringify(et))},putNodeData=async tt=>{const et=await generateAuthQueryParam();return await api$1.put(`/node?${et}`,JSON.stringify(tt))},approveRadarData=async(tt,et)=>{const nt=await generateAuthQueryParam();return await api$1.put(`/radar/${tt}/approve?${nt}`,JSON.stringify({approve:"True",pubkey:et}))},deleteRadarData=async tt=>{const et=await generateAuthQueryParam();return await api$1.delete(`/radar/${tt}?${et}`)},initialAboutState={description:"",mission_statement:"",search_term:"",title:""},initialMessageData=[{label:"New Content",key:"num_daily",value:null},{label:"Audio Clips",key:"num_audio",value:null},{label:"Posts",key:"num_tweet",value:null}],defaultData$6={currentSearch:null,flagErrorIsOpen:!1,hasBudgetExplanationModalBeSeen:!1,relevanceIsSelected:!1,secondarySidebarActiveTab:"",sidebarIsOpen:!0,theme:"light",transcriptIsOpen:!1,appMetaData:initialAboutState},useAppStore=react((tt,et)=>({...defaultData$6,clearSearch:()=>tt({currentSearch:null}),setCurrentSearch:nt=>tt({currentSearch:nt}),setFlagErrorOpen:nt=>tt({flagErrorIsOpen:nt}),setRelevanceSelected:nt=>tt({relevanceIsSelected:nt}),setSecondarySidebarActiveTab:nt=>tt({secondarySidebarActiveTab:nt}),setSidebarOpen:nt=>tt({sidebarIsOpen:nt,transcriptIsOpen:nt?et().transcriptIsOpen:!1}),setTranscriptOpen:nt=>tt({transcriptIsOpen:nt}),setAppMetaData:nt=>tt({appMetaData:nt})}));var dist={},_extends$s={},_global={exports:{}},global$5=_global.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=global$5);var _globalExports=_global.exports,_core={exports:{}},core$4=_core.exports={version:"2.6.12"};typeof __e=="number"&&(__e=core$4);var _coreExports=_core.exports,_aFunction=function(tt){if(typeof tt!="function")throw TypeError(tt+" is not a function!");return tt},aFunction=_aFunction,_ctx=function(tt,et,nt){if(aFunction(tt),et===void 0)return tt;switch(nt){case 1:return function(it){return tt.call(et,it)};case 2:return function(it,rt){return tt.call(et,it,rt)};case 3:return function(it,rt,ot){return tt.call(et,it,rt,ot)}}return function(){return tt.apply(et,arguments)}},_objectDp={},_isObject$1=function(tt){return typeof tt=="object"?tt!==null:typeof tt=="function"},isObject$a=_isObject$1,_anObject=function(tt){if(!isObject$a(tt))throw TypeError(tt+" is not an object!");return tt},_fails=function(tt){try{return!!tt()}catch{return!0}},_descriptors,hasRequired_descriptors;function require_descriptors(){return hasRequired_descriptors||(hasRequired_descriptors=1,_descriptors=!_fails(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})),_descriptors}var _domCreate,hasRequired_domCreate;function require_domCreate(){if(hasRequired_domCreate)return _domCreate;hasRequired_domCreate=1;var tt=_isObject$1,et=_globalExports.document,nt=tt(et)&&tt(et.createElement);return _domCreate=function(it){return nt?et.createElement(it):{}},_domCreate}var _ie8DomDefine,hasRequired_ie8DomDefine;function require_ie8DomDefine(){return hasRequired_ie8DomDefine||(hasRequired_ie8DomDefine=1,_ie8DomDefine=!require_descriptors()&&!_fails(function(){return Object.defineProperty(require_domCreate()("div"),"a",{get:function(){return 7}}).a!=7})),_ie8DomDefine}var isObject$9=_isObject$1,_toPrimitive$E=function(tt,et){if(!isObject$9(tt))return tt;var nt,it;if(et&&typeof(nt=tt.toString)=="function"&&!isObject$9(it=nt.call(tt))||typeof(nt=tt.valueOf)=="function"&&!isObject$9(it=nt.call(tt))||!et&&typeof(nt=tt.toString)=="function"&&!isObject$9(it=nt.call(tt)))return it;throw TypeError("Can't convert object to primitive value")},hasRequired_objectDp;function require_objectDp(){if(hasRequired_objectDp)return _objectDp;hasRequired_objectDp=1;var tt=_anObject,et=require_ie8DomDefine(),nt=_toPrimitive$E,it=Object.defineProperty;return _objectDp.f=require_descriptors()?Object.defineProperty:function(ot,at,st){if(tt(ot),at=nt(at,!0),tt(st),et)try{return it(ot,at,st)}catch{}if("get"in st||"set"in st)throw TypeError("Accessors not supported!");return"value"in st&&(ot[at]=st.value),ot},_objectDp}var _propertyDesc=function(tt,et){return{enumerable:!(tt&1),configurable:!(tt&2),writable:!(tt&4),value:et}},dP$2=require_objectDp(),createDesc$2=_propertyDesc,_hide=require_descriptors()?function(tt,et,nt){return dP$2.f(tt,et,createDesc$2(1,nt))}:function(tt,et,nt){return tt[et]=nt,tt},hasOwnProperty$5={}.hasOwnProperty,_has=function(tt,et){return hasOwnProperty$5.call(tt,et)},global$4=_globalExports,core$3=_coreExports,ctx=_ctx,hide$2=_hide,has$6=_has,PROTOTYPE$2="prototype",$export$7=function(tt,et,nt){var it=tt&$export$7.F,rt=tt&$export$7.G,ot=tt&$export$7.S,at=tt&$export$7.P,st=tt&$export$7.B,lt=tt&$export$7.W,ct=rt?core$3:core$3[et]||(core$3[et]={}),ut=ct[PROTOTYPE$2],ht=rt?global$4:ot?global$4[et]:(global$4[et]||{})[PROTOTYPE$2],dt,pt,mt;rt&&(nt=et);for(dt in nt)pt=!it&&ht&&ht[dt]!==void 0,!(pt&&has$6(ct,dt))&&(mt=pt?ht[dt]:nt[dt],ct[dt]=rt&&typeof ht[dt]!="function"?nt[dt]:st&&pt?ctx(mt,global$4):lt&&ht[dt]==mt?function(gt){var bt=function(yt,wt,vt){if(this instanceof gt){switch(arguments.length){case 0:return new gt;case 1:return new gt(yt);case 2:return new gt(yt,wt)}return new gt(yt,wt,vt)}return gt.apply(this,arguments)};return bt[PROTOTYPE$2]=gt[PROTOTYPE$2],bt}(mt):at&&typeof mt=="function"?ctx(Function.call,mt):mt,at&&((ct.virtual||(ct.virtual={}))[dt]=mt,tt&$export$7.R&&ut&&!ut[dt]&&hide$2(ut,dt,mt)))};$export$7.F=1;$export$7.G=2;$export$7.S=4;$export$7.P=8;$export$7.B=16;$export$7.W=32;$export$7.U=64;$export$7.R=128;var _export=$export$7,toString$8={}.toString,_cof=function(tt){return toString$8.call(tt).slice(8,-1)},_iobject,hasRequired_iobject;function require_iobject(){if(hasRequired_iobject)return _iobject;hasRequired_iobject=1;var tt=_cof;return _iobject=Object("z").propertyIsEnumerable(0)?Object:function(et){return tt(et)=="String"?et.split(""):Object(et)},_iobject}var _defined=function(tt){if(tt==null)throw TypeError("Can't call method on "+tt);return tt},IObject=require_iobject(),defined$3=_defined,_toIobject=function(tt){return IObject(defined$3(tt))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(tt){return isNaN(tt=+tt)?0:(tt>0?floor:ceil)(tt)},toInteger$4=_toInteger,min$4=Math.min,_toLength=function(tt){return tt>0?min$4(toInteger$4(tt),9007199254740991):0},toInteger$3=_toInteger,max$3=Math.max,min$3=Math.min,_toAbsoluteIndex=function(tt,et){return tt=toInteger$3(tt),tt<0?max$3(tt+et,0):min$3(tt,et)},toIObject$5=_toIobject,toLength=_toLength,toAbsoluteIndex=_toAbsoluteIndex,_arrayIncludes$1=function(tt){return function(et,nt,it){var rt=toIObject$5(et),ot=toLength(rt.length),at=toAbsoluteIndex(it,ot),st;if(tt&&nt!=nt){for(;ot>at;)if(st=rt[at++],st!=st)return!0}else for(;ot>at;at++)if((tt||at in rt)&&rt[at]===nt)return tt||at||0;return!tt&&-1}},_shared={exports:{}},_library=!0,core$2=_coreExports,global$3=_globalExports,SHARED="__core-js_shared__",store$1=global$3[SHARED]||(global$3[SHARED]={});(_shared.exports=function(tt,et){return store$1[tt]||(store$1[tt]=et!==void 0?et:{})})("versions",[]).push({version:core$2.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var _sharedExports=_shared.exports,id$2=0,px=Math.random(),_uid=function(tt){return"Symbol(".concat(tt===void 0?"":tt,")_",(++id$2+px).toString(36))},shared$1=_sharedExports("keys"),uid$2=_uid,_sharedKey=function(tt){return shared$1[tt]||(shared$1[tt]=uid$2(tt))},has$5=_has,toIObject$4=_toIobject,arrayIndexOf=_arrayIncludes$1(!1),IE_PROTO$2=_sharedKey("IE_PROTO"),_objectKeysInternal=function(tt,et){var nt=toIObject$4(tt),it=0,rt=[],ot;for(ot in nt)ot!=IE_PROTO$2&&has$5(nt,ot)&&rt.push(ot);for(;et.length>it;)has$5(nt,ot=et[it++])&&(~arrayIndexOf(rt,ot)||rt.push(ot));return rt},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),$keys$2=_objectKeysInternal,enumBugKeys$1=_enumBugKeys,_objectKeys=Object.keys||function(et){return $keys$2(et,enumBugKeys$1)},_objectGops={};_objectGops.f=Object.getOwnPropertySymbols;var _objectPie={},hasRequired_objectPie;function require_objectPie(){return hasRequired_objectPie||(hasRequired_objectPie=1,_objectPie.f={}.propertyIsEnumerable),_objectPie}var defined$2=_defined,_toObject=function(tt){return Object(defined$2(tt))},_objectAssign,hasRequired_objectAssign;function require_objectAssign(){if(hasRequired_objectAssign)return _objectAssign;hasRequired_objectAssign=1;var tt=require_descriptors(),et=_objectKeys,nt=_objectGops,it=require_objectPie(),rt=_toObject,ot=require_iobject(),at=Object.assign;return _objectAssign=!at||_fails(function(){var st={},lt={},ct=Symbol(),ut="abcdefghijklmnopqrst";return st[ct]=7,ut.split("").forEach(function(ht){lt[ht]=ht}),at({},st)[ct]!=7||Object.keys(at({},lt)).join("")!=ut})?function(lt,ct){for(var ut=rt(lt),ht=arguments.length,dt=1,pt=nt.f,mt=it.f;ht>dt;)for(var gt=ot(arguments[dt++]),bt=pt?et(gt).concat(pt(gt)):et(gt),yt=bt.length,wt=0,vt;yt>wt;)vt=bt[wt++],(!tt||mt.call(gt,vt))&&(ut[vt]=gt[vt]);return ut}:at,_objectAssign}var $export$6=_export;$export$6($export$6.S+$export$6.F,"Object",{assign:require_objectAssign()});var assign$4=_coreExports.Object.assign,assign$3={default:assign$4,__esModule:!0};_extends$s.__esModule=!0;var _assign$1=assign$3,_assign2=_interopRequireDefault$8(_assign$1);function _interopRequireDefault$8(tt){return tt&&tt.__esModule?tt:{default:tt}}_extends$s.default=_assign2.default||function(tt){for(var et=1;et=ot?tt?"":void 0:(at=it.charCodeAt(rt),at<55296||at>56319||rt+1===ot||(st=it.charCodeAt(rt+1))<56320||st>57343?tt?it.charAt(rt):at:tt?it.slice(rt,rt+2):(at-55296<<10)+(st-56320)+65536)}},_redefine=_hide,_iterators={},dP$1=require_objectDp(),anObject$2=_anObject,getKeys$2=_objectKeys,_objectDps=require_descriptors()?Object.defineProperties:function(et,nt){anObject$2(et);for(var it=getKeys$2(nt),rt=it.length,ot=0,at;rt>ot;)dP$1.f(et,at=it[ot++],nt[at]);return et},_html,hasRequired_html;function require_html(){if(hasRequired_html)return _html;hasRequired_html=1;var tt=_globalExports.document;return _html=tt&&tt.documentElement,_html}var anObject$1=_anObject,dPs=_objectDps,enumBugKeys=_enumBugKeys,IE_PROTO=_sharedKey("IE_PROTO"),Empty=function(){},PROTOTYPE$1="prototype",createDict=function(){var tt=require_domCreate()("iframe"),et=enumBugKeys.length,nt="<",it=">",rt;for(tt.style.display="none",require_html().appendChild(tt),tt.src="javascript:",rt=tt.contentWindow.document,rt.open(),rt.write(nt+"script"+it+"document.F=Object"+nt+"/script"+it),rt.close(),createDict=rt.F;et--;)delete createDict[PROTOTYPE$1][enumBugKeys[et]];return createDict()},_objectCreate=Object.create||function(et,nt){var it;return et!==null?(Empty[PROTOTYPE$1]=anObject$1(et),it=new Empty,Empty[PROTOTYPE$1]=null,it[IE_PROTO]=et):it=createDict(),nt===void 0?it:dPs(it,nt)},_wks={exports:{}},store=_sharedExports("wks"),uid$1=_uid,Symbol$5=_globalExports.Symbol,USE_SYMBOL=typeof Symbol$5=="function",$exports=_wks.exports=function(tt){return store[tt]||(store[tt]=USE_SYMBOL&&Symbol$5[tt]||(USE_SYMBOL?Symbol$5:uid$1)("Symbol."+tt))};$exports.store=store;var _wksExports=_wks.exports,def=require_objectDp().f,has$3=_has,TAG=_wksExports("toStringTag"),_setToStringTag=function(tt,et,nt){tt&&!has$3(tt=nt?tt:tt.prototype,TAG)&&def(tt,TAG,{configurable:!0,value:et})},create$6=_objectCreate,descriptor=_propertyDesc,setToStringTag$2=_setToStringTag,IteratorPrototype={};_hide(IteratorPrototype,_wksExports("iterator"),function(){return this});var _iterCreate=function(tt,et,nt){tt.prototype=create$6(IteratorPrototype,{next:descriptor(1,nt)}),setToStringTag$2(tt,et+" Iterator")},$export$3=_export,redefine$1=_redefine,hide$1=_hide,Iterators$2=_iterators,$iterCreate=_iterCreate,setToStringTag$1=_setToStringTag,getPrototypeOf=_objectGpo,ITERATOR=_wksExports("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this},_iterDefine=function(tt,et,nt,it,rt,ot,at){$iterCreate(nt,et,it);var st=function(vt){if(!BUGGY&&vt in ht)return ht[vt];switch(vt){case KEYS:return function(){return new nt(this,vt)};case VALUES:return function(){return new nt(this,vt)}}return function(){return new nt(this,vt)}},lt=et+" Iterator",ct=rt==VALUES,ut=!1,ht=tt.prototype,dt=ht[ITERATOR]||ht[FF_ITERATOR]||rt&&ht[rt],pt=dt||st(rt),mt=rt?ct?st("entries"):pt:void 0,gt=et=="Array"&&ht.entries||dt,bt,yt,wt;if(gt&&(wt=getPrototypeOf(gt.call(new tt)),wt!==Object.prototype&&wt.next&&setToStringTag$1(wt,lt,!0)),ct&&dt&&dt.name!==VALUES&&(ut=!0,pt=function(){return dt.call(this)}),at&&(BUGGY||ut||!ht[ITERATOR])&&hide$1(ht,ITERATOR,pt),Iterators$2[et]=pt,Iterators$2[lt]=returnThis,rt)if(bt={values:ct?pt:st(VALUES),keys:ot?pt:st(KEYS),entries:mt},at)for(yt in bt)yt in ht||redefine$1(ht,yt,bt[yt]);else $export$3($export$3.P+$export$3.F*(BUGGY||ut),et,bt);return bt},$at=_stringAt(!0);_iterDefine(String,"String",function(tt){this._t=String(tt),this._i=0},function(){var tt=this._t,et=this._i,nt;return et>=tt.length?{value:void 0,done:!0}:(nt=$at(tt,et),this._i+=nt.length,{value:nt,done:!1})});var _iterStep=function(tt,et){return{value:et,done:!!tt}},step=_iterStep,Iterators$1=_iterators,toIObject$3=_toIobject;_iterDefine(Array,"Array",function(tt,et){this._t=toIObject$3(tt),this._i=0,this._k=et},function(){var tt=this._t,et=this._k,nt=this._i++;return!tt||nt>=tt.length?(this._t=void 0,step(1)):et=="keys"?step(0,nt):et=="values"?step(0,tt[nt]):step(0,[nt,tt[nt]])},"values");Iterators$1.Arguments=Iterators$1.Array;var global$2=_globalExports,hide=_hide,Iterators=_iterators,TO_STRING_TAG=_wksExports("toStringTag"),DOMIterables="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");for(var i$4=0;i$4ot;)rt.call(tt,at=it[ot++])&&et.push(at);return et},cof=_cof,_isArray$1=Array.isArray||function(et){return cof(et)=="Array"},_objectGopnExt={},_objectGopn={},$keys$1=_objectKeysInternal,hiddenKeys=_enumBugKeys.concat("length","prototype");_objectGopn.f=Object.getOwnPropertyNames||function(et){return $keys$1(et,hiddenKeys)};var toIObject$2=_toIobject,gOPN$1=_objectGopn.f,toString$7={}.toString,windowNames=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(tt){try{return gOPN$1(tt)}catch{return windowNames.slice()}};_objectGopnExt.f=function(et){return windowNames&&toString$7.call(et)=="[object Window]"?getWindowNames(et):gOPN$1(toIObject$2(et))};var _objectGopd={},pIE=require_objectPie(),createDesc$1=_propertyDesc,toIObject$1=_toIobject,toPrimitive$1=_toPrimitive$E,has$1=_has,IE8_DOM_DEFINE=require_ie8DomDefine(),gOPD$2=Object.getOwnPropertyDescriptor;_objectGopd.f=require_descriptors()?gOPD$2:function(et,nt){if(et=toIObject$1(et),nt=toPrimitive$1(nt,!0),IE8_DOM_DEFINE)try{return gOPD$2(et,nt)}catch{}if(has$1(et,nt))return createDesc$1(!pIE.f.call(et,nt),et[nt])};var global$1=_globalExports,has=_has,DESCRIPTORS=require_descriptors(),$export$2=_export,redefine=_redefine,META=_metaExports.KEY,$fails=_fails,shared=_sharedExports,setToStringTag=_setToStringTag,uid=_uid,wks=_wksExports,wksExt=_wksExt,wksDefine=_wksDefine,enumKeys=_enumKeys,isArray$f=_isArray$1,anObject=_anObject,isObject$7=_isObject$1,toObject=_toObject,toIObject=_toIobject,toPrimitive=_toPrimitive$E,createDesc=_propertyDesc,_create$1=_objectCreate,gOPNExt=_objectGopnExt,$GOPD=_objectGopd,$GOPS=_objectGops,$DP=require_objectDp(),$keys=_objectKeys,gOPD$1=$GOPD.f,dP=$DP.f,gOPN=gOPNExt.f,$Symbol=global$1.Symbol,$JSON=global$1.JSON,_stringify=$JSON&&$JSON.stringify,PROTOTYPE="prototype",HIDDEN=wks("_hidden"),TO_PRIMITIVE=wks("toPrimitive"),isEnum={}.propertyIsEnumerable,SymbolRegistry=shared("symbol-registry"),AllSymbols=shared("symbols"),OPSymbols=shared("op-symbols"),ObjectProto=Object[PROTOTYPE],USE_NATIVE=typeof $Symbol=="function"&&!!$GOPS.f,QObject=global$1.QObject,setter=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDesc=DESCRIPTORS&&$fails(function(){return _create$1(dP({},"a",{get:function(){return dP(this,"a",{value:7}).a}})).a!=7})?function(tt,et,nt){var it=gOPD$1(ObjectProto,et);it&&delete ObjectProto[et],dP(tt,et,nt),it&&tt!==ObjectProto&&dP(ObjectProto,et,it)}:dP,wrap$3=function(tt){var et=AllSymbols[tt]=_create$1($Symbol[PROTOTYPE]);return et._k=tt,et},isSymbol$7=USE_NATIVE&&typeof $Symbol.iterator=="symbol"?function(tt){return typeof tt=="symbol"}:function(tt){return tt instanceof $Symbol},$defineProperty=function(et,nt,it){return et===ObjectProto&&$defineProperty(OPSymbols,nt,it),anObject(et),nt=toPrimitive(nt,!0),anObject(it),has(AllSymbols,nt)?(it.enumerable?(has(et,HIDDEN)&&et[HIDDEN][nt]&&(et[HIDDEN][nt]=!1),it=_create$1(it,{enumerable:createDesc(0,!1)})):(has(et,HIDDEN)||dP(et,HIDDEN,createDesc(1,{})),et[HIDDEN][nt]=!0),setSymbolDesc(et,nt,it)):dP(et,nt,it)},$defineProperties=function(et,nt){anObject(et);for(var it=enumKeys(nt=toIObject(nt)),rt=0,ot=it.length,at;ot>rt;)$defineProperty(et,at=it[rt++],nt[at]);return et},$create=function(et,nt){return nt===void 0?_create$1(et):$defineProperties(_create$1(et),nt)},$propertyIsEnumerable=function(et){var nt=isEnum.call(this,et=toPrimitive(et,!0));return this===ObjectProto&&has(AllSymbols,et)&&!has(OPSymbols,et)?!1:nt||!has(this,et)||!has(AllSymbols,et)||has(this,HIDDEN)&&this[HIDDEN][et]?nt:!0},$getOwnPropertyDescriptor=function(et,nt){if(et=toIObject(et),nt=toPrimitive(nt,!0),!(et===ObjectProto&&has(AllSymbols,nt)&&!has(OPSymbols,nt))){var it=gOPD$1(et,nt);return it&&has(AllSymbols,nt)&&!(has(et,HIDDEN)&&et[HIDDEN][nt])&&(it.enumerable=!0),it}},$getOwnPropertyNames=function(et){for(var nt=gOPN(toIObject(et)),it=[],rt=0,ot;nt.length>rt;)!has(AllSymbols,ot=nt[rt++])&&ot!=HIDDEN&&ot!=META&&it.push(ot);return it},$getOwnPropertySymbols=function(et){for(var nt=et===ObjectProto,it=gOPN(nt?OPSymbols:toIObject(et)),rt=[],ot=0,at;it.length>ot;)has(AllSymbols,at=it[ot++])&&(!nt||has(ObjectProto,at))&&rt.push(AllSymbols[at]);return rt};USE_NATIVE||($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor!");var et=uid(arguments.length>0?arguments[0]:void 0),nt=function(it){this===ObjectProto&&nt.call(OPSymbols,it),has(this,HIDDEN)&&has(this[HIDDEN],et)&&(this[HIDDEN][et]=!1),setSymbolDesc(this,et,createDesc(1,it))};return DESCRIPTORS&&setter&&setSymbolDesc(ObjectProto,et,{configurable:!0,set:nt}),wrap$3(et)},redefine($Symbol[PROTOTYPE],"toString",function(){return this._k}),$GOPD.f=$getOwnPropertyDescriptor,$DP.f=$defineProperty,_objectGopn.f=gOPNExt.f=$getOwnPropertyNames,require_objectPie().f=$propertyIsEnumerable,$GOPS.f=$getOwnPropertySymbols,DESCRIPTORS&&!_library&&redefine(ObjectProto,"propertyIsEnumerable",$propertyIsEnumerable),wksExt.f=function(tt){return wrap$3(wks(tt))});$export$2($export$2.G+$export$2.W+$export$2.F*!USE_NATIVE,{Symbol:$Symbol});for(var es6Symbols="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),j=0;es6Symbols.length>j;)wks(es6Symbols[j++]);for(var wellKnownSymbols=$keys(wks.store),k$3=0;wellKnownSymbols.length>k$3;)wksDefine(wellKnownSymbols[k$3++]);$export$2($export$2.S+$export$2.F*!USE_NATIVE,"Symbol",{for:function(tt){return has(SymbolRegistry,tt+="")?SymbolRegistry[tt]:SymbolRegistry[tt]=$Symbol(tt)},keyFor:function(et){if(!isSymbol$7(et))throw TypeError(et+" is not a symbol!");for(var nt in SymbolRegistry)if(SymbolRegistry[nt]===et)return nt},useSetter:function(){setter=!0},useSimple:function(){setter=!1}});$export$2($export$2.S+$export$2.F*!USE_NATIVE,"Object",{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor,getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols});var FAILS_ON_PRIMITIVES=$fails(function(){$GOPS.f(1)});$export$2($export$2.S+$export$2.F*FAILS_ON_PRIMITIVES,"Object",{getOwnPropertySymbols:function(et){return $GOPS.f(toObject(et))}});$JSON&&$export$2($export$2.S+$export$2.F*(!USE_NATIVE||$fails(function(){var tt=$Symbol();return _stringify([tt])!="[null]"||_stringify({a:tt})!="{}"||_stringify(Object(tt))!="{}"})),"JSON",{stringify:function(et){for(var nt=[et],it=1,rt,ot;arguments.length>it;)nt.push(arguments[it++]);if(ot=rt=nt[1],!(!isObject$7(rt)&&et===void 0||isSymbol$7(et)))return isArray$f(rt)||(rt=function(at,st){if(typeof ot=="function"&&(st=ot.call(this,at,st)),!isSymbol$7(st))return st}),nt[1]=rt,_stringify.apply($JSON,nt)}});$Symbol[PROTOTYPE][TO_PRIMITIVE]||_hide($Symbol[PROTOTYPE],TO_PRIMITIVE,$Symbol[PROTOTYPE].valueOf);setToStringTag($Symbol,"Symbol");setToStringTag(Math,"Math",!0);setToStringTag(global$1.JSON,"JSON",!0);_wksDefine("asyncIterator");_wksDefine("observable");var symbol$1=_coreExports.Symbol,symbol={default:symbol$1,__esModule:!0};_typeof$I.__esModule=!0;var _iterator=iterator,_iterator2=_interopRequireDefault$6(_iterator),_symbol=symbol,_symbol2=_interopRequireDefault$6(_symbol),_typeof$H=typeof _symbol2.default=="function"&&typeof _iterator2.default=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof _symbol2.default=="function"&&tt.constructor===_symbol2.default&&tt!==_symbol2.default.prototype?"symbol":typeof tt};function _interopRequireDefault$6(tt){return tt&&tt.__esModule?tt:{default:tt}}_typeof$I.default=typeof _symbol2.default=="function"&&_typeof$H(_iterator2.default)==="symbol"?function(tt){return typeof tt>"u"?"undefined":_typeof$H(tt)}:function(tt){return tt&&typeof _symbol2.default=="function"&&tt.constructor===_symbol2.default&&tt!==_symbol2.default.prototype?"symbol":typeof tt>"u"?"undefined":_typeof$H(tt)};possibleConstructorReturn.__esModule=!0;var _typeof2$1=_typeof$I,_typeof3$1=_interopRequireDefault$5(_typeof2$1);function _interopRequireDefault$5(tt){return tt&&tt.__esModule?tt:{default:tt}}possibleConstructorReturn.default=function(tt,et){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return et&&((typeof et>"u"?"undefined":(0,_typeof3$1.default)(et))==="object"||typeof et=="function")?et:tt};var inherits={},_setProto,hasRequired_setProto;function require_setProto(){if(hasRequired_setProto)return _setProto;hasRequired_setProto=1;var tt=_isObject$1,et=_anObject,nt=function(it,rt){if(et(it),!tt(rt)&&rt!==null)throw TypeError(rt+": can't set as prototype!")};return _setProto={set:Object.setPrototypeOf||("__proto__"in{}?function(it,rt,ot){try{ot=_ctx(Function.call,_objectGopd.f(Object.prototype,"__proto__").set,2),ot(it,[]),rt=!(it instanceof Array)}catch{rt=!0}return function(st,lt){return nt(st,lt),rt?st.__proto__=lt:ot(st,lt),st}}({},!1):void 0),check:nt},_setProto}var $export$1=_export;$export$1($export$1.S,"Object",{setPrototypeOf:require_setProto().set});var setPrototypeOf$1=_coreExports.Object.setPrototypeOf,setPrototypeOf={default:setPrototypeOf$1,__esModule:!0},$export=_export;$export($export.S,"Object",{create:_objectCreate});var $Object=_coreExports.Object,create$5=function(et,nt){return $Object.create(et,nt)},create$4={default:create$5,__esModule:!0};inherits.__esModule=!0;var _setPrototypeOf$d=setPrototypeOf,_setPrototypeOf2=_interopRequireDefault$4(_setPrototypeOf$d),_create=create$4,_create2=_interopRequireDefault$4(_create),_typeof2=_typeof$I,_typeof3=_interopRequireDefault$4(_typeof2);function _interopRequireDefault$4(tt){return tt&&tt.__esModule?tt:{default:tt}}inherits.default=function(tt,et){if(typeof et!="function"&&et!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof et>"u"?"undefined":(0,_typeof3.default)(et)));tt.prototype=(0,_create2.default)(et&&et.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),et&&(_setPrototypeOf2.default?(0,_setPrototypeOf2.default)(tt,et):tt.__proto__=et)};var lottie$1={exports:{}};(function(module,exports){typeof navigator<"u"&&function(tt,et){module.exports=et()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(et){_useWebWorker=!!et},getWebWorker=function(){return _useWebWorker},setLocationHref=function(et){locationHref=et},getLocationHref=function(){return locationHref};function createTag(tt){return document.createElement(tt)}function extendPrototype(tt,et){var nt,it=tt.length,rt;for(nt=0;nt1?nt[1]=1:nt[1]<=0&&(nt[1]=0),HSVtoRGB(nt[0],nt[1],nt[2])}function addBrightnessToRGB(tt,et){var nt=RGBtoHSV(tt[0]*255,tt[1]*255,tt[2]*255);return nt[2]+=et,nt[2]>1?nt[2]=1:nt[2]<0&&(nt[2]=0),HSVtoRGB(nt[0],nt[1],nt[2])}function addHueToRGB(tt,et){var nt=RGBtoHSV(tt[0]*255,tt[1]*255,tt[2]*255);return nt[0]+=et/360,nt[0]>1?nt[0]-=1:nt[0]<0&&(nt[0]+=1),HSVtoRGB(nt[0],nt[1],nt[2])}var rgbToHex=function(){var tt=[],et,nt;for(et=0;et<256;et+=1)nt=et.toString(16),tt[et]=nt.length===1?"0"+nt:nt;return function(it,rt,ot){return it<0&&(it=0),rt<0&&(rt=0),ot<0&&(ot=0),"#"+tt[it]+tt[rt]+tt[ot]}}(),setSubframeEnabled=function(et){subframeEnabled=!!et},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(et){expressionsPlugin=et},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(et){expressionsInterfaces=et},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(et){defaultCurveSegments=et},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(et){idPrefix$1=et};function createNS(tt){return document.createElementNS(svgNS,tt)}function _typeof$5(tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(nt){return typeof nt}:_typeof$5=function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$5(tt)}var dataManager=function(){var tt=1,et=[],nt,it,rt={onmessage:function(){},postMessage:function(pt){nt({data:pt})}},ot={postMessage:function(pt){rt.onmessage({data:pt})}};function at(dt){if(window.Worker&&window.Blob&&getWebWorker()){var pt=new Blob(["var _workerSelf = self; self.onmessage = ",dt.toString()],{type:"text/javascript"}),mt=URL.createObjectURL(pt);return new Worker(mt)}return nt=dt,rt}function st(){it||(it=at(function(pt){function mt(){function bt(At,Rt){var Wt,jt,Ot=At.length,Ct,Dt,Mt,Vt;for(jt=0;jt=0;Rt-=1)if(At[Rt].ty==="sh")if(At[Rt].ks.k.i)St(At[Rt].ks.k);else for(Ot=At[Rt].ks.k.length,jt=0;jtWt[0]?!0:Wt[0]>At[0]?!1:At[1]>Wt[1]?!0:Wt[1]>At[1]?!1:At[2]>Wt[2]?!0:Wt[2]>At[2]?!1:null}var It=function(){var At=[4,4,14];function Rt(jt){var Ot=jt.t.d;jt.t.d={k:[{s:Ot,t:0}]}}function Wt(jt){var Ot,Ct=jt.length;for(Ot=0;Ot=0;Ot-=1)if(jt[Ot].ty==="sh")if(jt[Ot].ks.k.i)jt[Ot].ks.k.c=jt[Ot].closed;else for(Mt=jt[Ot].ks.k.length,Dt=0;Dt500)&&(this._imageLoaded(),clearInterval(vt)),wt+=1}).bind(this),50)}function ot(yt){var wt=it(yt,this.assetsPath,this.path),vt=createNS("image");isSafari?this.testImageLoaded(vt):vt.addEventListener("load",this._imageLoaded,!1),vt.addEventListener("error",(function(){xt.img=tt,this._imageLoaded()}).bind(this),!1),vt.setAttributeNS("http://www.w3.org/1999/xlink","href",wt),this._elementHelper.append?this._elementHelper.append(vt):this._elementHelper.appendChild(vt);var xt={img:vt,assetData:yt};return xt}function at(yt){var wt=it(yt,this.assetsPath,this.path),vt=createTag("img");vt.crossOrigin="anonymous",vt.addEventListener("load",this._imageLoaded,!1),vt.addEventListener("error",(function(){xt.img=tt,this._imageLoaded()}).bind(this),!1),vt.src=wt;var xt={img:vt,assetData:yt};return xt}function st(yt){var wt={assetData:yt},vt=it(yt,this.assetsPath,this.path);return dataManager.loadData(vt,(function(xt){wt.img=xt,this._footageLoaded()}).bind(this),(function(){wt.img={},this._footageLoaded()}).bind(this)),wt}function lt(yt,wt){this.imagesLoadedCb=wt;var vt,xt=yt.length;for(vt=0;vtthis.animationData.op&&(this.animationData.op=tt.op,this.totalFrames=Math.floor(tt.op-this.animationData.ip));var et=this.animationData.layers,nt,it=et.length,rt=tt.layers,ot,at=rt.length;for(ot=0;otthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(tt){this.triggerRenderFrameError(tt)}},AnimationItem.prototype.play=function(tt){tt&&this.name!==tt||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(tt){tt&&this.name!==tt||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(tt){tt&&this.name!==tt||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(tt){tt&&this.name!==tt||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(tt){for(var et,nt=0;nt=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(et>this.totalFrames?et%this.totalFrames:0)||(nt=!0,et=this.totalFrames-1):et>=this.totalFrames?(this.playCount+=1,this.checkSegments(et%this.totalFrames)||(this.setCurrentRawFrameValue(et%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(et):et<0?this.checkSegments(et%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+et%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(nt=!0,et=0)):this.setCurrentRawFrameValue(et),nt&&(this.setCurrentRawFrameValue(et),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(tt,et){this.playCount=0,tt[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=tt[0]-tt[1],this.timeCompleted=this.totalFrames,this.firstFrame=tt[1],this.setCurrentRawFrameValue(this.totalFrames-.001-et)):tt[1]>tt[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=tt[1]-tt[0],this.timeCompleted=this.totalFrames,this.firstFrame=tt[0],this.setCurrentRawFrameValue(.001+et)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(tt,et){var nt=-1;this.isPaused&&(this.currentRawFrame+this.firstFrameet&&(nt=et-tt)),this.firstFrame=tt,this.totalFrames=et-tt,this.timeCompleted=this.totalFrames,nt!==-1&&this.goToAndStop(nt,!0)},AnimationItem.prototype.playSegments=function(tt,et){if(et&&(this.segments.length=0),_typeof$4(tt[0])==="object"){var nt,it=tt.length;for(nt=0;nt=0;Wt-=1)et[Wt].animation.destroy(Rt)}function Tt(Rt,Wt,jt){var Ot=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),Ct,Dt=Ot.length;for(Ct=0;Ct0?xt=Tt:vt=Tt;while(Math.abs(It)>ot&&++$t=rt?bt(vt,Lt,xt,St):Bt===0?Lt:gt(vt,It,It+lt,xt,St)}},tt}(),pooling=function(){function tt(et){return et.concat(createSizedArray(et.length))}return{double:tt}}(),poolFactory=function(){return function(tt,et,nt){var it=0,rt=tt,ot=createSizedArray(rt),at={newElement:st,release:lt};function st(){var ct;return it?(it-=1,ct=ot[it]):ct=et(),ct}function lt(ct){it===rt&&(ot=pooling.double(ot),rt*=2),nt&&nt(ct),ot[it]=ct,it+=1}return at}}(),bezierLengthPool=function(){function tt(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,tt)}(),segmentsLengthPool=function(){function tt(){return{lengths:[],totalLength:0}}function et(nt){var it,rt=nt.lengths.length;for(it=0;it-.001&&wt<.001}function nt(dt,pt,mt,gt,bt,yt,wt,vt,xt){if(mt===0&&yt===0&&xt===0)return et(dt,pt,gt,bt,wt,vt);var St=tt.sqrt(tt.pow(gt-dt,2)+tt.pow(bt-pt,2)+tt.pow(yt-mt,2)),Et=tt.sqrt(tt.pow(wt-dt,2)+tt.pow(vt-pt,2)+tt.pow(xt-mt,2)),It=tt.sqrt(tt.pow(wt-gt,2)+tt.pow(vt-bt,2)+tt.pow(xt-yt,2)),Tt;return St>Et?St>It?Tt=St-Et-It:Tt=It-Et-St:It>Et?Tt=It-Et-St:Tt=Et-St-It,Tt>-1e-4&&Tt<1e-4}var it=function(){return function(dt,pt,mt,gt){var bt=getDefaultCurveSegments(),yt,wt,vt,xt,St,Et=0,It,Tt=[],$t=[],Ut=bezierLengthPool.newElement();for(vt=mt.length,yt=0;ytwt?-1:1,St=!0;St;)if(gt[yt]<=wt&>[yt+1]>wt?(vt=(wt-gt[yt])/(gt[yt+1]-gt[yt]),St=!1):yt+=xt,yt<0||yt>=bt-1){if(yt===bt-1)return mt[yt];St=!1}return mt[yt]+(mt[yt+1]-mt[yt])*vt}function ct(dt,pt,mt,gt,bt,yt){var wt=lt(bt,yt),vt=1-wt,xt=tt.round((vt*vt*vt*dt[0]+(wt*vt*vt+vt*wt*vt+vt*vt*wt)*mt[0]+(wt*wt*vt+vt*wt*wt+wt*vt*wt)*gt[0]+wt*wt*wt*pt[0])*1e3)/1e3,St=tt.round((vt*vt*vt*dt[1]+(wt*vt*vt+vt*wt*vt+vt*vt*wt)*mt[1]+(wt*wt*vt+vt*wt*wt+wt*vt*wt)*gt[1]+wt*wt*wt*pt[1])*1e3)/1e3;return[xt,St]}var ut=createTypedArray("float32",8);function ht(dt,pt,mt,gt,bt,yt,wt){bt<0?bt=0:bt>1&&(bt=1);var vt=lt(bt,wt);yt=yt>1?1:yt;var xt=lt(yt,wt),St,Et=dt.length,It=1-vt,Tt=1-xt,$t=It*It*It,Ut=vt*It*It*3,Lt=vt*vt*It*3,Bt=vt*vt*vt,Pt=It*It*Tt,kt=vt*It*Tt+It*vt*Tt+It*It*xt,At=vt*vt*Tt+It*vt*xt+vt*It*xt,Rt=vt*vt*xt,Wt=It*Tt*Tt,jt=vt*Tt*Tt+It*xt*Tt+It*Tt*xt,Ot=vt*xt*Tt+It*xt*xt+vt*Tt*xt,Ct=vt*xt*xt,Dt=Tt*Tt*Tt,Mt=xt*Tt*Tt+Tt*xt*Tt+Tt*Tt*xt,Vt=xt*xt*Tt+Tt*xt*xt+xt*Tt*xt,Qt=xt*xt*xt;for(St=0;St=ct.t-nt){lt.h&&(lt=ct),rt=0;break}if(ct.t-nt>tt){rt=ot;break}ot=yt||tt=yt?xt.points.length-1:0;for(dt=xt.points[St].point.length,ht=0;ht=Tt&&Et=yt)it[0]=vt[0],it[1]=vt[1],it[2]=vt[2];else if(tt<=wt)it[0]=lt.s[0],it[1]=lt.s[1],it[2]=lt.s[2];else{var kt=createQuaternion(lt.s),At=createQuaternion(vt),Rt=(tt-wt)/(yt-wt);quaternionToEuler(it,slerp(kt,At,Rt))}else for(ot=0;ot=yt?pt=1:tt1e-6?(dt=Math.acos(pt),mt=Math.sin(dt),gt=Math.sin((1-nt)*dt)/mt,bt=Math.sin(nt*dt)/mt):(gt=1-nt,bt=nt),it[0]=gt*rt+bt*lt,it[1]=gt*ot+bt*ct,it[2]=gt*at+bt*ut,it[3]=gt*st+bt*ht,it}function quaternionToEuler(tt,et){var nt=et[0],it=et[1],rt=et[2],ot=et[3],at=Math.atan2(2*it*ot-2*nt*rt,1-2*it*it-2*rt*rt),st=Math.asin(2*nt*it+2*rt*ot),lt=Math.atan2(2*nt*ot-2*it*rt,1-2*nt*nt-2*rt*rt);tt[0]=at/degToRads,tt[1]=st/degToRads,tt[2]=lt/degToRads}function createQuaternion(tt){var et=tt[0]*degToRads,nt=tt[1]*degToRads,it=tt[2]*degToRads,rt=Math.cos(et/2),ot=Math.cos(nt/2),at=Math.cos(it/2),st=Math.sin(et/2),lt=Math.sin(nt/2),ct=Math.sin(it/2),ut=rt*ot*at-st*lt*ct,ht=st*lt*at+rt*ot*ct,dt=st*ot*at+rt*lt*ct,pt=rt*lt*at-st*ot*ct;return[ht,dt,pt,ut]}function getValueAtCurrentTime(){var tt=this.comp.renderedFrame-this.offsetTime,et=this.keyframes[0].t-this.offsetTime,nt=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(tt===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=nt&&tt>=nt||this._caching.lastFrame=tt&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var it=this.interpolateValue(tt,this._caching);this.pv=it}return this._caching.lastFrame=tt,this.pv}function setVValue(tt){var et;if(this.propType==="unidimensional")et=tt*this.mult,mathAbs(this.v-et)>1e-5&&(this.v=et,this._mdf=!0);else for(var nt=0,it=this.v.length;nt1e-5&&(this.v[nt]=et,this._mdf=!0),nt+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var tt,et=this.effectsSequence.length,nt=this.kf?this.pv:this.data.k;for(tt=0;tt=this._maxLength&&this.doubleArrayLength(),nt){case"v":ot=this.v;break;case"i":ot=this.i;break;case"o":ot=this.o;break;default:ot=[];break}(!ot[it]||ot[it]&&!rt)&&(ot[it]=pointPool.newElement()),ot[it][0]=tt,ot[it][1]=et},ShapePath.prototype.setTripleAt=function(tt,et,nt,it,rt,ot,at,st){this.setXYAt(tt,et,"v",at,st),this.setXYAt(nt,it,"o",at,st),this.setXYAt(rt,ot,"i",at,st)},ShapePath.prototype.reverse=function(){var tt=new ShapePath;tt.setPathData(this.c,this._length);var et=this.v,nt=this.o,it=this.i,rt=0;this.c&&(tt.setTripleAt(et[0][0],et[0][1],it[0][0],it[0][1],nt[0][0],nt[0][1],0,!1),rt=1);var ot=this._length-1,at=this._length,st;for(st=rt;st=kt[kt.length-1].t-this.offsetTime)St=kt[kt.length-1].s?kt[kt.length-1].s[0]:kt[kt.length-2].e[0],It=!0;else{for(var At=xt,Rt=kt.length-1,Wt=!0,jt,Ot,Ct;Wt&&(jt=kt[At],Ot=kt[At+1],!(Ot.t-this.offsetTime>yt));)At=Ot.t-this.offsetTime)Bt=1;else if(ytvt&&yt>vt)||(this._caching.lastIndex=xt=zn)return At;var Zn=Yt-iu(mn);if(Zn<1)return mn;var rr=Kn?Uu(Kn,0,Zn).join(""):At.slice(0,Zn);if(Mn===nt)return rr+mn;if(Kn&&(Zn+=rr.length-Zn),c1(Mn)){if(At.slice(Zn).search(Mn)){var Er,Tr=rr;for(Mn.global||(Mn=Es(Mn.source,Qo(or.exec(Mn))+"g")),Mn.lastIndex=0;Er=Mn.exec(Tr);)var Rr=Er.index;rr=rr.slice(0,Rr===nt?Zn:Rr)}}else if(At.indexOf(Os(Mn),Zn)!=Zn){var Zr=rr.lastIndexOf(Mn);Zr>-1&&(rr=rr.slice(0,Zr))}return rr+mn}function p4(At){return At=Qo(At),At&&Qr.test(At)?At.replace(ur,gp):At}var m4=Rt(function(At,Wt,Yt){return At+(Yt?" ":"")+Wt.toUpperCase()}),d1=Ay("toUpperCase");function pw(At,Wt,Yt){return At=Qo(At),Wt=Yt?nt:Wt,Wt===nt?Wp(At)?yp(At):Lm(At):At.match(Wt)||[]}var mw=mo(function(At,Wt){try{return Vo(At,nt,Wt)}catch(Yt){return l1(Yt)?Yt:new To(Yt)}}),g4=Oo(function(At,Wt){return ws(Wt,function(Yt){Yt=Wu(Yt),lu(At,Yt,a1(At[Yt],At))}),At});function y4(At){var Wt=At==null?0:At.length,Yt=wo();return At=Wt?ba(At,function(mn){if(typeof mn[1]!="function")throw new Gs(at);return[Yt(mn[0]),mn[1]]}):[],mo(function(mn){for(var Mn=-1;++MnNt)return[];var Yt=Dt,mn=Ms(At,Dt);Wt=wo(Wt),At-=Dt;for(var Mn=wu(mn,Wt);++Yt0||Wt<0)?new yo(Yt):(At<0?Yt=Yt.takeRight(-At):At&&(Yt=Yt.drop(At)),Wt!==nt&&(Wt=No(Wt),Yt=Wt<0?Yt.dropRight(-Wt):Yt.take(Wt-At)),Yt)},yo.prototype.takeRightWhile=function(At){return this.reverse().takeWhile(At).reverse()},yo.prototype.toArray=function(){return this.take(Dt)},xl(yo.prototype,function(At,Wt){var Yt=/^(?:filter|find|map|reject)|While$/.test(Wt),mn=/^(?:head|last)$/.test(Wt),Mn=Ln[mn?"take"+(Wt=="last"?"Right":""):Wt],zn=mn||/^find/.test(Wt);Mn&&(Ln.prototype[Wt]=function(){var Kn=this.__wrapped__,Zn=mn?[1]:arguments,rr=Kn instanceof yo,Er=Zn[0],Tr=rr||Mo(Kn),Rr=function(Uo){var Ho=Mn.apply(Ln,Dl([Uo],Zn));return mn&&Zr?Ho[0]:Ho};Tr&&Yt&&typeof Er=="function"&&Er.length!=1&&(rr=Tr=!1);var Zr=this.__chain__,uo=!!this.__actions__.length,So=zn&&!Zr,Do=rr&&!uo;if(!zn&&Tr){Kn=Do?Kn:new yo(this);var Eo=At.apply(Kn,Zn);return Eo.__actions__.push({func:Py,args:[Rr],thisArg:nt}),new Rs(Eo,Zr)}return So&&Do?At.apply(this,Zn):(Eo=this.thru(Rr),So?mn?Eo.value()[0]:Eo.value():Eo)})}),ws(["pop","push","shift","sort","splice","unshift"],function(At){var Wt=Cu[At],Yt=/^(?:push|sort|unshift)$/.test(At)?"tap":"thru",mn=/^(?:pop|shift)$/.test(At);Ln.prototype[At]=function(){var Mn=arguments;if(mn&&!this.__chain__){var zn=this.value();return Wt.apply(Mo(zn)?zn:[],Mn)}return this[Yt](function(Kn){return Wt.apply(Mo(Kn)?Kn:[],Mn)})}}),xl(yo.prototype,function(At,Wt){var Yt=Ln[Wt];if(Yt){var mn=Yt.name+"";qo.call(Ju,mn)||(Ju[mn]=[]),Ju[mn].push({name:Wt,func:Yt})}}),Ju[$n(nt,yt).name]=[{name:"wrapper",func:nt}],yo.prototype.clone=Uy,yo.prototype.reverse=zy,yo.prototype.value=yl,Ln.prototype.at=Wv,Ln.prototype.chain=Vv,Ln.prototype.commit=Hv,Ln.prototype.next=Gv,Ln.prototype.plant=Yv,Ln.prototype.reverse=Kv,Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=Xv,Ln.prototype.first=Ln.prototype.head,Mu&&(Ln.prototype[Mu]=qv),Ln},$u=Vm();ls?((ls.exports=$u)._=$u,gu._=$u):ns._=$u}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports;const videoTimeToSeconds=tt=>{const[et,nt,it]=tt.split(":"),rt=parseInt(et,10),ot=parseInt(nt,10),at=parseInt(it,10);return rt*3600+ot*60+at},getSelectedNodeTimestamps=(tt,et)=>{if(!et)return null;const nt=tt.filter(ot=>ot.show_title&&ot.link&&ot.show_title===et.show_title||ot.show_title&&ot.link&&ot.show_title===et.show_title&&ot.episode_title===et.episode_title),it=lodashExports.groupBy(nt,ot=>ot.timestamp),rt=lodashExports.values(it).reduce((ot,at)=>(at[0]&&ot.push(at[0]),ot),[]);return rt.sort((ot,at)=>{var ht,dt;const[st]=((ht=ot.timestamp)==null?void 0:ht.split("-"))||[""],[lt]=((dt=at.timestamp)==null?void 0:dt.split("-"))||[""],ct=videoTimeToSeconds(st),ut=videoTimeToSeconds(lt);return ct-ut}),rt},styles$1="",getElementsMemoized=()=>{const tt={};return()=>{if(tt.inner&&tt.body)return tt;const et=document.querySelector("body"),nt=document.createElement("div"),it=document.createElement("div"),rt=document.createElement("div"),ot=document.createElement("div"),at=()=>{nt.classList.toggle("hide")};return rt.addEventListener("click",at),ot.addEventListener("click",at),nt.classList.add("loggerWrapper"),nt.classList.add("hide"),it.classList.add("loggerInner"),rt.classList.add("close"),ot.classList.add("open"),rt.textContent="X",ot.textContent="OPEN LOG",et==null||et.appendChild(nt),et==null||et.appendChild(ot),nt.appendChild(rt),nt.appendChild(it),tt.body=et,tt.inner=it,{body:et,inner:it}}},getElements=getElementsMemoized(),variants=["log","info","warn","error"],logMessage=(tt,et)=>{const{inner:nt}=getElements(),it=document.createElement("span");it.textContent=tt,it.classList.add("message"),it.classList.add(et),nt.appendChild(it)},overrideConsole=()=>{if(!window.location.hostname.includes("local"))return;const tt=function(et){const nt=variants.reduce((it,rt)=>({...it,[rt](...ot){et[rt](...ot),logMessage(JSON.stringify(ot,null," "),rt)}}),{});return{...et,...nt}}(window.console);window.console=tt};async function getBalance(tt){return api$1.get("/balance",{Authorization:tt})}async function updateBudget(tt){const et=await getLSat();if(!et){tt(0);return}try{const nt=await getBalance(et);tt(nt.balance)}catch{tt(0)}}const convertToChatMessage=tt=>{const et=/((http|https):\/\/[^\s]+)/g,nt=/@(\w+)/g;let it=tt.replace(/\\/g,"");return it=it.replace(/'/g,"’"),it=it.replace(/\n/g,"
"),it=it.replace(et,'$1'),it=it.replace(nt,'@$1'),it},useIsMatchBreakpoint=(tt,et="down")=>{const nt=useTheme(),[it,rt]=reactExports.useState(!1),ot=nt.breakpoints[et](tt).split("@media")[1].trim();return reactExports.useEffect(()=>{const at=()=>{const{matches:st}=window.matchMedia(ot);rt(st)};return at(),window.addEventListener("resize",at),()=>window.removeEventListener("resize",at)},[ot]),it};function extractUuidAndHost(tt){const et={host:"",uuid:""};let nt="";if(!tt)return et;tt[0]==="?"&&(nt=tt.substring(1,tt.length));const it=nt.split("&");for(let rt=0;rtawait api$1.get(`/radar?${new URLSearchParams({...defaultParams,...tt}).toString()}`),getTopicsData=async(tt=defaultParams)=>{const et=await generateAuthQueryParam();return await api$1.get(`/topics?${new URLSearchParams({...defaultParams,...tt}).toString()}${et}`)},getAboutData=async()=>await api$1.get("/about"),getStats=async()=>await api$1.get("/stats"),getEdgeTypes=async()=>{const tt=await generateAuthQueryParam();return await api$1.get(`curation/edge/type?${tt}`)},postEdgeType=async tt=>{const et=await generateAuthQueryParam();return await api$1.post(`/curation/edge?${et}`,JSON.stringify(tt))},postAboutData=async tt=>{const et=await generateAuthQueryParam();return await api$1.post(`/about?${et}`,JSON.stringify(tt))},postMergeTopics=async tt=>{const et=await generateAuthQueryParam();return await api$1.post(`/curation/merge?${et}`,JSON.stringify(tt))},putRadarData=async(tt,et)=>{const nt=await generateAuthQueryParam();return await api$1.put(`/radar/${tt}?${nt}`,JSON.stringify(et))},putNodeData=async tt=>{const et=await generateAuthQueryParam();return await api$1.put(`/node?${et}`,JSON.stringify(tt))},approveRadarData=async(tt,et)=>{const nt=await generateAuthQueryParam();return await api$1.put(`/radar/${tt}/approve?${nt}`,JSON.stringify({approve:"True",pubkey:et}))},deleteRadarData=async tt=>{const et=await generateAuthQueryParam();return await api$1.delete(`/radar/${tt}?${et}`)},initialAboutState={description:"",mission_statement:"",search_term:"",title:""},initialMessageData=[{label:"New Content",key:"num_daily",value:null},{label:"Audio Clips",key:"num_audio",value:null},{label:"Posts",key:"num_tweet",value:null}],defaultData$6={currentSearch:null,flagErrorIsOpen:!1,hasBudgetExplanationModalBeSeen:!1,relevanceIsSelected:!1,secondarySidebarActiveTab:"",sidebarIsOpen:!0,theme:"light",transcriptIsOpen:!1,appMetaData:initialAboutState},useAppStore=react((tt,et)=>({...defaultData$6,clearSearch:()=>tt({currentSearch:null}),setCurrentSearch:nt=>tt({currentSearch:nt}),setFlagErrorOpen:nt=>tt({flagErrorIsOpen:nt}),setRelevanceSelected:nt=>tt({relevanceIsSelected:nt}),setSecondarySidebarActiveTab:nt=>tt({secondarySidebarActiveTab:nt}),setSidebarOpen:nt=>tt({sidebarIsOpen:nt,transcriptIsOpen:nt?et().transcriptIsOpen:!1}),setTranscriptOpen:nt=>tt({transcriptIsOpen:nt}),setAppMetaData:nt=>tt({appMetaData:nt})}));var dist={},_extends$r={},_global={exports:{}},global$5=_global.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=global$5);var _globalExports=_global.exports,_core={exports:{}},core$4=_core.exports={version:"2.6.12"};typeof __e=="number"&&(__e=core$4);var _coreExports=_core.exports,_aFunction=function(tt){if(typeof tt!="function")throw TypeError(tt+" is not a function!");return tt},aFunction=_aFunction,_ctx=function(tt,et,nt){if(aFunction(tt),et===void 0)return tt;switch(nt){case 1:return function(it){return tt.call(et,it)};case 2:return function(it,rt){return tt.call(et,it,rt)};case 3:return function(it,rt,ot){return tt.call(et,it,rt,ot)}}return function(){return tt.apply(et,arguments)}},_objectDp={},_isObject$1=function(tt){return typeof tt=="object"?tt!==null:typeof tt=="function"},isObject$a=_isObject$1,_anObject=function(tt){if(!isObject$a(tt))throw TypeError(tt+" is not an object!");return tt},_fails=function(tt){try{return!!tt()}catch{return!0}},_descriptors,hasRequired_descriptors;function require_descriptors(){return hasRequired_descriptors||(hasRequired_descriptors=1,_descriptors=!_fails(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})),_descriptors}var _domCreate,hasRequired_domCreate;function require_domCreate(){if(hasRequired_domCreate)return _domCreate;hasRequired_domCreate=1;var tt=_isObject$1,et=_globalExports.document,nt=tt(et)&&tt(et.createElement);return _domCreate=function(it){return nt?et.createElement(it):{}},_domCreate}var _ie8DomDefine,hasRequired_ie8DomDefine;function require_ie8DomDefine(){return hasRequired_ie8DomDefine||(hasRequired_ie8DomDefine=1,_ie8DomDefine=!require_descriptors()&&!_fails(function(){return Object.defineProperty(require_domCreate()("div"),"a",{get:function(){return 7}}).a!=7})),_ie8DomDefine}var isObject$9=_isObject$1,_toPrimitive$E=function(tt,et){if(!isObject$9(tt))return tt;var nt,it;if(et&&typeof(nt=tt.toString)=="function"&&!isObject$9(it=nt.call(tt))||typeof(nt=tt.valueOf)=="function"&&!isObject$9(it=nt.call(tt))||!et&&typeof(nt=tt.toString)=="function"&&!isObject$9(it=nt.call(tt)))return it;throw TypeError("Can't convert object to primitive value")},hasRequired_objectDp;function require_objectDp(){if(hasRequired_objectDp)return _objectDp;hasRequired_objectDp=1;var tt=_anObject,et=require_ie8DomDefine(),nt=_toPrimitive$E,it=Object.defineProperty;return _objectDp.f=require_descriptors()?Object.defineProperty:function(ot,at,st){if(tt(ot),at=nt(at,!0),tt(st),et)try{return it(ot,at,st)}catch{}if("get"in st||"set"in st)throw TypeError("Accessors not supported!");return"value"in st&&(ot[at]=st.value),ot},_objectDp}var _propertyDesc=function(tt,et){return{enumerable:!(tt&1),configurable:!(tt&2),writable:!(tt&4),value:et}},dP$2=require_objectDp(),createDesc$2=_propertyDesc,_hide=require_descriptors()?function(tt,et,nt){return dP$2.f(tt,et,createDesc$2(1,nt))}:function(tt,et,nt){return tt[et]=nt,tt},hasOwnProperty$5={}.hasOwnProperty,_has=function(tt,et){return hasOwnProperty$5.call(tt,et)},global$4=_globalExports,core$3=_coreExports,ctx=_ctx,hide$2=_hide,has$6=_has,PROTOTYPE$2="prototype",$export$7=function(tt,et,nt){var it=tt&$export$7.F,rt=tt&$export$7.G,ot=tt&$export$7.S,at=tt&$export$7.P,st=tt&$export$7.B,lt=tt&$export$7.W,ct=rt?core$3:core$3[et]||(core$3[et]={}),ut=ct[PROTOTYPE$2],ht=rt?global$4:ot?global$4[et]:(global$4[et]||{})[PROTOTYPE$2],dt,pt,mt;rt&&(nt=et);for(dt in nt)pt=!it&&ht&&ht[dt]!==void 0,!(pt&&has$6(ct,dt))&&(mt=pt?ht[dt]:nt[dt],ct[dt]=rt&&typeof ht[dt]!="function"?nt[dt]:st&&pt?ctx(mt,global$4):lt&&ht[dt]==mt?function(gt){var bt=function(yt,wt,vt){if(this instanceof gt){switch(arguments.length){case 0:return new gt;case 1:return new gt(yt);case 2:return new gt(yt,wt)}return new gt(yt,wt,vt)}return gt.apply(this,arguments)};return bt[PROTOTYPE$2]=gt[PROTOTYPE$2],bt}(mt):at&&typeof mt=="function"?ctx(Function.call,mt):mt,at&&((ct.virtual||(ct.virtual={}))[dt]=mt,tt&$export$7.R&&ut&&!ut[dt]&&hide$2(ut,dt,mt)))};$export$7.F=1;$export$7.G=2;$export$7.S=4;$export$7.P=8;$export$7.B=16;$export$7.W=32;$export$7.U=64;$export$7.R=128;var _export=$export$7,toString$8={}.toString,_cof=function(tt){return toString$8.call(tt).slice(8,-1)},_iobject,hasRequired_iobject;function require_iobject(){if(hasRequired_iobject)return _iobject;hasRequired_iobject=1;var tt=_cof;return _iobject=Object("z").propertyIsEnumerable(0)?Object:function(et){return tt(et)=="String"?et.split(""):Object(et)},_iobject}var _defined=function(tt){if(tt==null)throw TypeError("Can't call method on "+tt);return tt},IObject=require_iobject(),defined$3=_defined,_toIobject=function(tt){return IObject(defined$3(tt))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(tt){return isNaN(tt=+tt)?0:(tt>0?floor:ceil)(tt)},toInteger$4=_toInteger,min$4=Math.min,_toLength=function(tt){return tt>0?min$4(toInteger$4(tt),9007199254740991):0},toInteger$3=_toInteger,max$3=Math.max,min$3=Math.min,_toAbsoluteIndex=function(tt,et){return tt=toInteger$3(tt),tt<0?max$3(tt+et,0):min$3(tt,et)},toIObject$5=_toIobject,toLength=_toLength,toAbsoluteIndex=_toAbsoluteIndex,_arrayIncludes$1=function(tt){return function(et,nt,it){var rt=toIObject$5(et),ot=toLength(rt.length),at=toAbsoluteIndex(it,ot),st;if(tt&&nt!=nt){for(;ot>at;)if(st=rt[at++],st!=st)return!0}else for(;ot>at;at++)if((tt||at in rt)&&rt[at]===nt)return tt||at||0;return!tt&&-1}},_shared={exports:{}},_library=!0,core$2=_coreExports,global$3=_globalExports,SHARED="__core-js_shared__",store$1=global$3[SHARED]||(global$3[SHARED]={});(_shared.exports=function(tt,et){return store$1[tt]||(store$1[tt]=et!==void 0?et:{})})("versions",[]).push({version:core$2.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var _sharedExports=_shared.exports,id$2=0,px=Math.random(),_uid=function(tt){return"Symbol(".concat(tt===void 0?"":tt,")_",(++id$2+px).toString(36))},shared$1=_sharedExports("keys"),uid$2=_uid,_sharedKey=function(tt){return shared$1[tt]||(shared$1[tt]=uid$2(tt))},has$5=_has,toIObject$4=_toIobject,arrayIndexOf=_arrayIncludes$1(!1),IE_PROTO$2=_sharedKey("IE_PROTO"),_objectKeysInternal=function(tt,et){var nt=toIObject$4(tt),it=0,rt=[],ot;for(ot in nt)ot!=IE_PROTO$2&&has$5(nt,ot)&&rt.push(ot);for(;et.length>it;)has$5(nt,ot=et[it++])&&(~arrayIndexOf(rt,ot)||rt.push(ot));return rt},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),$keys$2=_objectKeysInternal,enumBugKeys$1=_enumBugKeys,_objectKeys=Object.keys||function(et){return $keys$2(et,enumBugKeys$1)},_objectGops={};_objectGops.f=Object.getOwnPropertySymbols;var _objectPie={},hasRequired_objectPie;function require_objectPie(){return hasRequired_objectPie||(hasRequired_objectPie=1,_objectPie.f={}.propertyIsEnumerable),_objectPie}var defined$2=_defined,_toObject=function(tt){return Object(defined$2(tt))},_objectAssign,hasRequired_objectAssign;function require_objectAssign(){if(hasRequired_objectAssign)return _objectAssign;hasRequired_objectAssign=1;var tt=require_descriptors(),et=_objectKeys,nt=_objectGops,it=require_objectPie(),rt=_toObject,ot=require_iobject(),at=Object.assign;return _objectAssign=!at||_fails(function(){var st={},lt={},ct=Symbol(),ut="abcdefghijklmnopqrst";return st[ct]=7,ut.split("").forEach(function(ht){lt[ht]=ht}),at({},st)[ct]!=7||Object.keys(at({},lt)).join("")!=ut})?function(lt,ct){for(var ut=rt(lt),ht=arguments.length,dt=1,pt=nt.f,mt=it.f;ht>dt;)for(var gt=ot(arguments[dt++]),bt=pt?et(gt).concat(pt(gt)):et(gt),yt=bt.length,wt=0,vt;yt>wt;)vt=bt[wt++],(!tt||mt.call(gt,vt))&&(ut[vt]=gt[vt]);return ut}:at,_objectAssign}var $export$6=_export;$export$6($export$6.S+$export$6.F,"Object",{assign:require_objectAssign()});var assign$4=_coreExports.Object.assign,assign$3={default:assign$4,__esModule:!0};_extends$r.__esModule=!0;var _assign$1=assign$3,_assign2=_interopRequireDefault$5(_assign$1);function _interopRequireDefault$5(tt){return tt&&tt.__esModule?tt:{default:tt}}_extends$r.default=_assign2.default||function(tt){for(var et=1;et=ot?tt?"":void 0:(at=it.charCodeAt(rt),at<55296||at>56319||rt+1===ot||(st=it.charCodeAt(rt+1))<56320||st>57343?tt?it.charAt(rt):at:tt?it.slice(rt,rt+2):(at-55296<<10)+(st-56320)+65536)}},_redefine=_hide,_iterators={},dP$1=require_objectDp(),anObject$2=_anObject,getKeys$2=_objectKeys,_objectDps=require_descriptors()?Object.defineProperties:function(et,nt){anObject$2(et);for(var it=getKeys$2(nt),rt=it.length,ot=0,at;rt>ot;)dP$1.f(et,at=it[ot++],nt[at]);return et},_html,hasRequired_html;function require_html(){if(hasRequired_html)return _html;hasRequired_html=1;var tt=_globalExports.document;return _html=tt&&tt.documentElement,_html}var anObject$1=_anObject,dPs=_objectDps,enumBugKeys=_enumBugKeys,IE_PROTO=_sharedKey("IE_PROTO"),Empty=function(){},PROTOTYPE$1="prototype",createDict=function(){var tt=require_domCreate()("iframe"),et=enumBugKeys.length,nt="<",it=">",rt;for(tt.style.display="none",require_html().appendChild(tt),tt.src="javascript:",rt=tt.contentWindow.document,rt.open(),rt.write(nt+"script"+it+"document.F=Object"+nt+"/script"+it),rt.close(),createDict=rt.F;et--;)delete createDict[PROTOTYPE$1][enumBugKeys[et]];return createDict()},_objectCreate=Object.create||function(et,nt){var it;return et!==null?(Empty[PROTOTYPE$1]=anObject$1(et),it=new Empty,Empty[PROTOTYPE$1]=null,it[IE_PROTO]=et):it=createDict(),nt===void 0?it:dPs(it,nt)},_wks={exports:{}},store=_sharedExports("wks"),uid$1=_uid,Symbol$5=_globalExports.Symbol,USE_SYMBOL=typeof Symbol$5=="function",$exports=_wks.exports=function(tt){return store[tt]||(store[tt]=USE_SYMBOL&&Symbol$5[tt]||(USE_SYMBOL?Symbol$5:uid$1)("Symbol."+tt))};$exports.store=store;var _wksExports=_wks.exports,def=require_objectDp().f,has$3=_has,TAG=_wksExports("toStringTag"),_setToStringTag=function(tt,et,nt){tt&&!has$3(tt=nt?tt:tt.prototype,TAG)&&def(tt,TAG,{configurable:!0,value:et})},create$6=_objectCreate,descriptor=_propertyDesc,setToStringTag$2=_setToStringTag,IteratorPrototype={};_hide(IteratorPrototype,_wksExports("iterator"),function(){return this});var _iterCreate=function(tt,et,nt){tt.prototype=create$6(IteratorPrototype,{next:descriptor(1,nt)}),setToStringTag$2(tt,et+" Iterator")},$export$3=_export,redefine$1=_redefine,hide$1=_hide,Iterators$2=_iterators,$iterCreate=_iterCreate,setToStringTag$1=_setToStringTag,getPrototypeOf=_objectGpo,ITERATOR=_wksExports("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this},_iterDefine=function(tt,et,nt,it,rt,ot,at){$iterCreate(nt,et,it);var st=function(vt){if(!BUGGY&&vt in ht)return ht[vt];switch(vt){case KEYS:return function(){return new nt(this,vt)};case VALUES:return function(){return new nt(this,vt)}}return function(){return new nt(this,vt)}},lt=et+" Iterator",ct=rt==VALUES,ut=!1,ht=tt.prototype,dt=ht[ITERATOR]||ht[FF_ITERATOR]||rt&&ht[rt],pt=dt||st(rt),mt=rt?ct?st("entries"):pt:void 0,gt=et=="Array"&&ht.entries||dt,bt,yt,wt;if(gt&&(wt=getPrototypeOf(gt.call(new tt)),wt!==Object.prototype&&wt.next&&setToStringTag$1(wt,lt,!0)),ct&&dt&&dt.name!==VALUES&&(ut=!0,pt=function(){return dt.call(this)}),at&&(BUGGY||ut||!ht[ITERATOR])&&hide$1(ht,ITERATOR,pt),Iterators$2[et]=pt,Iterators$2[lt]=returnThis,rt)if(bt={values:ct?pt:st(VALUES),keys:ot?pt:st(KEYS),entries:mt},at)for(yt in bt)yt in ht||redefine$1(ht,yt,bt[yt]);else $export$3($export$3.P+$export$3.F*(BUGGY||ut),et,bt);return bt},$at=_stringAt(!0);_iterDefine(String,"String",function(tt){this._t=String(tt),this._i=0},function(){var tt=this._t,et=this._i,nt;return et>=tt.length?{value:void 0,done:!0}:(nt=$at(tt,et),this._i+=nt.length,{value:nt,done:!1})});var _iterStep=function(tt,et){return{value:et,done:!!tt}},step=_iterStep,Iterators$1=_iterators,toIObject$3=_toIobject;_iterDefine(Array,"Array",function(tt,et){this._t=toIObject$3(tt),this._i=0,this._k=et},function(){var tt=this._t,et=this._k,nt=this._i++;return!tt||nt>=tt.length?(this._t=void 0,step(1)):et=="keys"?step(0,nt):et=="values"?step(0,tt[nt]):step(0,[nt,tt[nt]])},"values");Iterators$1.Arguments=Iterators$1.Array;var global$2=_globalExports,hide=_hide,Iterators=_iterators,TO_STRING_TAG=_wksExports("toStringTag"),DOMIterables="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");for(var i$4=0;i$4ot;)rt.call(tt,at=it[ot++])&&et.push(at);return et},cof=_cof,_isArray$1=Array.isArray||function(et){return cof(et)=="Array"},_objectGopnExt={},_objectGopn={},$keys$1=_objectKeysInternal,hiddenKeys=_enumBugKeys.concat("length","prototype");_objectGopn.f=Object.getOwnPropertyNames||function(et){return $keys$1(et,hiddenKeys)};var toIObject$2=_toIobject,gOPN$1=_objectGopn.f,toString$7={}.toString,windowNames=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(tt){try{return gOPN$1(tt)}catch{return windowNames.slice()}};_objectGopnExt.f=function(et){return windowNames&&toString$7.call(et)=="[object Window]"?getWindowNames(et):gOPN$1(toIObject$2(et))};var _objectGopd={},pIE=require_objectPie(),createDesc$1=_propertyDesc,toIObject$1=_toIobject,toPrimitive$1=_toPrimitive$E,has$1=_has,IE8_DOM_DEFINE=require_ie8DomDefine(),gOPD$2=Object.getOwnPropertyDescriptor;_objectGopd.f=require_descriptors()?gOPD$2:function(et,nt){if(et=toIObject$1(et),nt=toPrimitive$1(nt,!0),IE8_DOM_DEFINE)try{return gOPD$2(et,nt)}catch{}if(has$1(et,nt))return createDesc$1(!pIE.f.call(et,nt),et[nt])};var global$1=_globalExports,has=_has,DESCRIPTORS=require_descriptors(),$export$2=_export,redefine=_redefine,META=_metaExports.KEY,$fails=_fails,shared=_sharedExports,setToStringTag=_setToStringTag,uid=_uid,wks=_wksExports,wksExt=_wksExt,wksDefine=_wksDefine,enumKeys=_enumKeys,isArray$f=_isArray$1,anObject=_anObject,isObject$7=_isObject$1,toObject=_toObject,toIObject=_toIobject,toPrimitive=_toPrimitive$E,createDesc=_propertyDesc,_create$1=_objectCreate,gOPNExt=_objectGopnExt,$GOPD=_objectGopd,$GOPS=_objectGops,$DP=require_objectDp(),$keys=_objectKeys,gOPD$1=$GOPD.f,dP=$DP.f,gOPN=gOPNExt.f,$Symbol=global$1.Symbol,$JSON=global$1.JSON,_stringify=$JSON&&$JSON.stringify,PROTOTYPE="prototype",HIDDEN=wks("_hidden"),TO_PRIMITIVE=wks("toPrimitive"),isEnum={}.propertyIsEnumerable,SymbolRegistry=shared("symbol-registry"),AllSymbols=shared("symbols"),OPSymbols=shared("op-symbols"),ObjectProto=Object[PROTOTYPE],USE_NATIVE=typeof $Symbol=="function"&&!!$GOPS.f,QObject=global$1.QObject,setter=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDesc=DESCRIPTORS&&$fails(function(){return _create$1(dP({},"a",{get:function(){return dP(this,"a",{value:7}).a}})).a!=7})?function(tt,et,nt){var it=gOPD$1(ObjectProto,et);it&&delete ObjectProto[et],dP(tt,et,nt),it&&tt!==ObjectProto&&dP(ObjectProto,et,it)}:dP,wrap$3=function(tt){var et=AllSymbols[tt]=_create$1($Symbol[PROTOTYPE]);return et._k=tt,et},isSymbol$7=USE_NATIVE&&typeof $Symbol.iterator=="symbol"?function(tt){return typeof tt=="symbol"}:function(tt){return tt instanceof $Symbol},$defineProperty=function(et,nt,it){return et===ObjectProto&&$defineProperty(OPSymbols,nt,it),anObject(et),nt=toPrimitive(nt,!0),anObject(it),has(AllSymbols,nt)?(it.enumerable?(has(et,HIDDEN)&&et[HIDDEN][nt]&&(et[HIDDEN][nt]=!1),it=_create$1(it,{enumerable:createDesc(0,!1)})):(has(et,HIDDEN)||dP(et,HIDDEN,createDesc(1,{})),et[HIDDEN][nt]=!0),setSymbolDesc(et,nt,it)):dP(et,nt,it)},$defineProperties=function(et,nt){anObject(et);for(var it=enumKeys(nt=toIObject(nt)),rt=0,ot=it.length,at;ot>rt;)$defineProperty(et,at=it[rt++],nt[at]);return et},$create=function(et,nt){return nt===void 0?_create$1(et):$defineProperties(_create$1(et),nt)},$propertyIsEnumerable=function(et){var nt=isEnum.call(this,et=toPrimitive(et,!0));return this===ObjectProto&&has(AllSymbols,et)&&!has(OPSymbols,et)?!1:nt||!has(this,et)||!has(AllSymbols,et)||has(this,HIDDEN)&&this[HIDDEN][et]?nt:!0},$getOwnPropertyDescriptor=function(et,nt){if(et=toIObject(et),nt=toPrimitive(nt,!0),!(et===ObjectProto&&has(AllSymbols,nt)&&!has(OPSymbols,nt))){var it=gOPD$1(et,nt);return it&&has(AllSymbols,nt)&&!(has(et,HIDDEN)&&et[HIDDEN][nt])&&(it.enumerable=!0),it}},$getOwnPropertyNames=function(et){for(var nt=gOPN(toIObject(et)),it=[],rt=0,ot;nt.length>rt;)!has(AllSymbols,ot=nt[rt++])&&ot!=HIDDEN&&ot!=META&&it.push(ot);return it},$getOwnPropertySymbols=function(et){for(var nt=et===ObjectProto,it=gOPN(nt?OPSymbols:toIObject(et)),rt=[],ot=0,at;it.length>ot;)has(AllSymbols,at=it[ot++])&&(!nt||has(ObjectProto,at))&&rt.push(AllSymbols[at]);return rt};USE_NATIVE||($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor!");var et=uid(arguments.length>0?arguments[0]:void 0),nt=function(it){this===ObjectProto&&nt.call(OPSymbols,it),has(this,HIDDEN)&&has(this[HIDDEN],et)&&(this[HIDDEN][et]=!1),setSymbolDesc(this,et,createDesc(1,it))};return DESCRIPTORS&&setter&&setSymbolDesc(ObjectProto,et,{configurable:!0,set:nt}),wrap$3(et)},redefine($Symbol[PROTOTYPE],"toString",function(){return this._k}),$GOPD.f=$getOwnPropertyDescriptor,$DP.f=$defineProperty,_objectGopn.f=gOPNExt.f=$getOwnPropertyNames,require_objectPie().f=$propertyIsEnumerable,$GOPS.f=$getOwnPropertySymbols,DESCRIPTORS&&!_library&&redefine(ObjectProto,"propertyIsEnumerable",$propertyIsEnumerable),wksExt.f=function(tt){return wrap$3(wks(tt))});$export$2($export$2.G+$export$2.W+$export$2.F*!USE_NATIVE,{Symbol:$Symbol});for(var es6Symbols="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),j=0;es6Symbols.length>j;)wks(es6Symbols[j++]);for(var wellKnownSymbols=$keys(wks.store),k$3=0;wellKnownSymbols.length>k$3;)wksDefine(wellKnownSymbols[k$3++]);$export$2($export$2.S+$export$2.F*!USE_NATIVE,"Symbol",{for:function(tt){return has(SymbolRegistry,tt+="")?SymbolRegistry[tt]:SymbolRegistry[tt]=$Symbol(tt)},keyFor:function(et){if(!isSymbol$7(et))throw TypeError(et+" is not a symbol!");for(var nt in SymbolRegistry)if(SymbolRegistry[nt]===et)return nt},useSetter:function(){setter=!0},useSimple:function(){setter=!1}});$export$2($export$2.S+$export$2.F*!USE_NATIVE,"Object",{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor,getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols});var FAILS_ON_PRIMITIVES=$fails(function(){$GOPS.f(1)});$export$2($export$2.S+$export$2.F*FAILS_ON_PRIMITIVES,"Object",{getOwnPropertySymbols:function(et){return $GOPS.f(toObject(et))}});$JSON&&$export$2($export$2.S+$export$2.F*(!USE_NATIVE||$fails(function(){var tt=$Symbol();return _stringify([tt])!="[null]"||_stringify({a:tt})!="{}"||_stringify(Object(tt))!="{}"})),"JSON",{stringify:function(et){for(var nt=[et],it=1,rt,ot;arguments.length>it;)nt.push(arguments[it++]);if(ot=rt=nt[1],!(!isObject$7(rt)&&et===void 0||isSymbol$7(et)))return isArray$f(rt)||(rt=function(at,st){if(typeof ot=="function"&&(st=ot.call(this,at,st)),!isSymbol$7(st))return st}),nt[1]=rt,_stringify.apply($JSON,nt)}});$Symbol[PROTOTYPE][TO_PRIMITIVE]||_hide($Symbol[PROTOTYPE],TO_PRIMITIVE,$Symbol[PROTOTYPE].valueOf);setToStringTag($Symbol,"Symbol");setToStringTag(Math,"Math",!0);setToStringTag(global$1.JSON,"JSON",!0);_wksDefine("asyncIterator");_wksDefine("observable");var symbol$1=_coreExports.Symbol,symbol={default:symbol$1,__esModule:!0};_typeof$H.__esModule=!0;var _iterator=iterator,_iterator2=_interopRequireDefault$3(_iterator),_symbol=symbol,_symbol2=_interopRequireDefault$3(_symbol),_typeof$G=typeof _symbol2.default=="function"&&typeof _iterator2.default=="symbol"?function(tt){return typeof tt}:function(tt){return tt&&typeof _symbol2.default=="function"&&tt.constructor===_symbol2.default&&tt!==_symbol2.default.prototype?"symbol":typeof tt};function _interopRequireDefault$3(tt){return tt&&tt.__esModule?tt:{default:tt}}_typeof$H.default=typeof _symbol2.default=="function"&&_typeof$G(_iterator2.default)==="symbol"?function(tt){return typeof tt>"u"?"undefined":_typeof$G(tt)}:function(tt){return tt&&typeof _symbol2.default=="function"&&tt.constructor===_symbol2.default&&tt!==_symbol2.default.prototype?"symbol":typeof tt>"u"?"undefined":_typeof$G(tt)};possibleConstructorReturn.__esModule=!0;var _typeof2$1=_typeof$H,_typeof3$1=_interopRequireDefault$2(_typeof2$1);function _interopRequireDefault$2(tt){return tt&&tt.__esModule?tt:{default:tt}}possibleConstructorReturn.default=function(tt,et){if(!tt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return et&&((typeof et>"u"?"undefined":(0,_typeof3$1.default)(et))==="object"||typeof et=="function")?et:tt};var inherits={},_setProto,hasRequired_setProto;function require_setProto(){if(hasRequired_setProto)return _setProto;hasRequired_setProto=1;var tt=_isObject$1,et=_anObject,nt=function(it,rt){if(et(it),!tt(rt)&&rt!==null)throw TypeError(rt+": can't set as prototype!")};return _setProto={set:Object.setPrototypeOf||("__proto__"in{}?function(it,rt,ot){try{ot=_ctx(Function.call,_objectGopd.f(Object.prototype,"__proto__").set,2),ot(it,[]),rt=!(it instanceof Array)}catch{rt=!0}return function(st,lt){return nt(st,lt),rt?st.__proto__=lt:ot(st,lt),st}}({},!1):void 0),check:nt},_setProto}var $export$1=_export;$export$1($export$1.S,"Object",{setPrototypeOf:require_setProto().set});var setPrototypeOf$1=_coreExports.Object.setPrototypeOf,setPrototypeOf={default:setPrototypeOf$1,__esModule:!0},$export=_export;$export($export.S,"Object",{create:_objectCreate});var $Object=_coreExports.Object,create$5=function(et,nt){return $Object.create(et,nt)},create$4={default:create$5,__esModule:!0};inherits.__esModule=!0;var _setPrototypeOf$c=setPrototypeOf,_setPrototypeOf2=_interopRequireDefault$1(_setPrototypeOf$c),_create=create$4,_create2=_interopRequireDefault$1(_create),_typeof2=_typeof$H,_typeof3=_interopRequireDefault$1(_typeof2);function _interopRequireDefault$1(tt){return tt&&tt.__esModule?tt:{default:tt}}inherits.default=function(tt,et){if(typeof et!="function"&&et!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof et>"u"?"undefined":(0,_typeof3.default)(et)));tt.prototype=(0,_create2.default)(et&&et.prototype,{constructor:{value:tt,enumerable:!1,writable:!0,configurable:!0}}),et&&(_setPrototypeOf2.default?(0,_setPrototypeOf2.default)(tt,et):tt.__proto__=et)};var lottie$1={exports:{}};(function(module,exports){typeof navigator<"u"&&function(tt,et){module.exports=et()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(et){_useWebWorker=!!et},getWebWorker=function(){return _useWebWorker},setLocationHref=function(et){locationHref=et},getLocationHref=function(){return locationHref};function createTag(tt){return document.createElement(tt)}function extendPrototype(tt,et){var nt,it=tt.length,rt;for(nt=0;nt1?nt[1]=1:nt[1]<=0&&(nt[1]=0),HSVtoRGB(nt[0],nt[1],nt[2])}function addBrightnessToRGB(tt,et){var nt=RGBtoHSV(tt[0]*255,tt[1]*255,tt[2]*255);return nt[2]+=et,nt[2]>1?nt[2]=1:nt[2]<0&&(nt[2]=0),HSVtoRGB(nt[0],nt[1],nt[2])}function addHueToRGB(tt,et){var nt=RGBtoHSV(tt[0]*255,tt[1]*255,tt[2]*255);return nt[0]+=et/360,nt[0]>1?nt[0]-=1:nt[0]<0&&(nt[0]+=1),HSVtoRGB(nt[0],nt[1],nt[2])}var rgbToHex=function(){var tt=[],et,nt;for(et=0;et<256;et+=1)nt=et.toString(16),tt[et]=nt.length===1?"0"+nt:nt;return function(it,rt,ot){return it<0&&(it=0),rt<0&&(rt=0),ot<0&&(ot=0),"#"+tt[it]+tt[rt]+tt[ot]}}(),setSubframeEnabled=function(et){subframeEnabled=!!et},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(et){expressionsPlugin=et},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(et){expressionsInterfaces=et},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(et){defaultCurveSegments=et},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(et){idPrefix$1=et};function createNS(tt){return document.createElementNS(svgNS,tt)}function _typeof$5(tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(nt){return typeof nt}:_typeof$5=function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$5(tt)}var dataManager=function(){var tt=1,et=[],nt,it,rt={onmessage:function(){},postMessage:function(pt){nt({data:pt})}},ot={postMessage:function(pt){rt.onmessage({data:pt})}};function at(dt){if(window.Worker&&window.Blob&&getWebWorker()){var pt=new Blob(["var _workerSelf = self; self.onmessage = ",dt.toString()],{type:"text/javascript"}),mt=URL.createObjectURL(pt);return new Worker(mt)}return nt=dt,rt}function st(){it||(it=at(function(pt){function mt(){function bt(Tt,Ct){var Ut,Nt,Bt=Tt.length,Mt,Dt,Pt,Vt;for(Nt=0;Nt=0;Ct-=1)if(Tt[Ct].ty==="sh")if(Tt[Ct].ks.k.i)St(Tt[Ct].ks.k);else for(Bt=Tt[Ct].ks.k.length,Nt=0;NtUt[0]?!0:Ut[0]>Tt[0]?!1:Tt[1]>Ut[1]?!0:Ut[1]>Tt[1]?!1:Tt[2]>Ut[2]?!0:Ut[2]>Tt[2]?!1:null}var $t=function(){var Tt=[4,4,14];function Ct(Nt){var Bt=Nt.t.d;Nt.t.d={k:[{s:Bt,t:0}]}}function Ut(Nt){var Bt,Mt=Nt.length;for(Bt=0;Bt=0;Bt-=1)if(Nt[Bt].ty==="sh")if(Nt[Bt].ks.k.i)Nt[Bt].ks.k.c=Nt[Bt].closed;else for(Pt=Nt[Bt].ks.k.length,Dt=0;Dt500)&&(this._imageLoaded(),clearInterval(vt)),wt+=1}).bind(this),50)}function ot(yt){var wt=it(yt,this.assetsPath,this.path),vt=createNS("image");isSafari?this.testImageLoaded(vt):vt.addEventListener("load",this._imageLoaded,!1),vt.addEventListener("error",(function(){xt.img=tt,this._imageLoaded()}).bind(this),!1),vt.setAttributeNS("http://www.w3.org/1999/xlink","href",wt),this._elementHelper.append?this._elementHelper.append(vt):this._elementHelper.appendChild(vt);var xt={img:vt,assetData:yt};return xt}function at(yt){var wt=it(yt,this.assetsPath,this.path),vt=createTag("img");vt.crossOrigin="anonymous",vt.addEventListener("load",this._imageLoaded,!1),vt.addEventListener("error",(function(){xt.img=tt,this._imageLoaded()}).bind(this),!1),vt.src=wt;var xt={img:vt,assetData:yt};return xt}function st(yt){var wt={assetData:yt},vt=it(yt,this.assetsPath,this.path);return dataManager.loadData(vt,(function(xt){wt.img=xt,this._footageLoaded()}).bind(this),(function(){wt.img={},this._footageLoaded()}).bind(this)),wt}function lt(yt,wt){this.imagesLoadedCb=wt;var vt,xt=yt.length;for(vt=0;vtthis.animationData.op&&(this.animationData.op=tt.op,this.totalFrames=Math.floor(tt.op-this.animationData.ip));var et=this.animationData.layers,nt,it=et.length,rt=tt.layers,ot,at=rt.length;for(ot=0;otthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(tt){this.triggerRenderFrameError(tt)}},AnimationItem.prototype.play=function(tt){tt&&this.name!==tt||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(tt){tt&&this.name!==tt||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(tt){tt&&this.name!==tt||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(tt){tt&&this.name!==tt||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(tt){for(var et,nt=0;nt=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(et>this.totalFrames?et%this.totalFrames:0)||(nt=!0,et=this.totalFrames-1):et>=this.totalFrames?(this.playCount+=1,this.checkSegments(et%this.totalFrames)||(this.setCurrentRawFrameValue(et%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(et):et<0?this.checkSegments(et%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+et%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(nt=!0,et=0)):this.setCurrentRawFrameValue(et),nt&&(this.setCurrentRawFrameValue(et),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(tt,et){this.playCount=0,tt[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=tt[0]-tt[1],this.timeCompleted=this.totalFrames,this.firstFrame=tt[1],this.setCurrentRawFrameValue(this.totalFrames-.001-et)):tt[1]>tt[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=tt[1]-tt[0],this.timeCompleted=this.totalFrames,this.firstFrame=tt[0],this.setCurrentRawFrameValue(.001+et)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(tt,et){var nt=-1;this.isPaused&&(this.currentRawFrame+this.firstFrameet&&(nt=et-tt)),this.firstFrame=tt,this.totalFrames=et-tt,this.timeCompleted=this.totalFrames,nt!==-1&&this.goToAndStop(nt,!0)},AnimationItem.prototype.playSegments=function(tt,et){if(et&&(this.segments.length=0),_typeof$4(tt[0])==="object"){var nt,it=tt.length;for(nt=0;nt=0;Ut-=1)et[Ut].animation.destroy(Ct)}function It(Ct,Ut,Nt){var Bt=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),Mt,Dt=Bt.length;for(Mt=0;Mt0?xt=It:vt=It;while(Math.abs($t)>ot&&++Ft=rt?bt(vt,zt,xt,St):Ot===0?zt:gt(vt,$t,$t+lt,xt,St)}},tt}(),pooling=function(){function tt(et){return et.concat(createSizedArray(et.length))}return{double:tt}}(),poolFactory=function(){return function(tt,et,nt){var it=0,rt=tt,ot=createSizedArray(rt),at={newElement:st,release:lt};function st(){var ct;return it?(it-=1,ct=ot[it]):ct=et(),ct}function lt(ct){it===rt&&(ot=pooling.double(ot),rt*=2),nt&&nt(ct),ot[it]=ct,it+=1}return at}}(),bezierLengthPool=function(){function tt(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,tt)}(),segmentsLengthPool=function(){function tt(){return{lengths:[],totalLength:0}}function et(nt){var it,rt=nt.lengths.length;for(it=0;it-.001&&wt<.001}function nt(dt,pt,mt,gt,bt,yt,wt,vt,xt){if(mt===0&&yt===0&&xt===0)return et(dt,pt,gt,bt,wt,vt);var St=tt.sqrt(tt.pow(gt-dt,2)+tt.pow(bt-pt,2)+tt.pow(yt-mt,2)),Et=tt.sqrt(tt.pow(wt-dt,2)+tt.pow(vt-pt,2)+tt.pow(xt-mt,2)),$t=tt.sqrt(tt.pow(wt-gt,2)+tt.pow(vt-bt,2)+tt.pow(xt-yt,2)),It;return St>Et?St>$t?It=St-Et-$t:It=$t-Et-St:$t>Et?It=$t-Et-St:It=Et-St-$t,It>-1e-4&&It<1e-4}var it=function(){return function(dt,pt,mt,gt){var bt=getDefaultCurveSegments(),yt,wt,vt,xt,St,Et=0,$t,It=[],Ft=[],Ht=bezierLengthPool.newElement();for(vt=mt.length,yt=0;ytwt?-1:1,St=!0;St;)if(gt[yt]<=wt&>[yt+1]>wt?(vt=(wt-gt[yt])/(gt[yt+1]-gt[yt]),St=!1):yt+=xt,yt<0||yt>=bt-1){if(yt===bt-1)return mt[yt];St=!1}return mt[yt]+(mt[yt+1]-mt[yt])*vt}function ct(dt,pt,mt,gt,bt,yt){var wt=lt(bt,yt),vt=1-wt,xt=tt.round((vt*vt*vt*dt[0]+(wt*vt*vt+vt*wt*vt+vt*vt*wt)*mt[0]+(wt*wt*vt+vt*wt*wt+wt*vt*wt)*gt[0]+wt*wt*wt*pt[0])*1e3)/1e3,St=tt.round((vt*vt*vt*dt[1]+(wt*vt*vt+vt*wt*vt+vt*vt*wt)*mt[1]+(wt*wt*vt+vt*wt*wt+wt*vt*wt)*gt[1]+wt*wt*wt*pt[1])*1e3)/1e3;return[xt,St]}var ut=createTypedArray("float32",8);function ht(dt,pt,mt,gt,bt,yt,wt){bt<0?bt=0:bt>1&&(bt=1);var vt=lt(bt,wt);yt=yt>1?1:yt;var xt=lt(yt,wt),St,Et=dt.length,$t=1-vt,It=1-xt,Ft=$t*$t*$t,Ht=vt*$t*$t*3,zt=vt*vt*$t*3,Ot=vt*vt*vt,jt=$t*$t*It,kt=vt*$t*It+$t*vt*It+$t*$t*xt,Tt=vt*vt*It+$t*vt*xt+vt*$t*xt,Ct=vt*vt*xt,Ut=$t*It*It,Nt=vt*It*It+$t*xt*It+$t*It*xt,Bt=vt*xt*It+$t*xt*xt+vt*It*xt,Mt=vt*xt*xt,Dt=It*It*It,Pt=xt*It*It+It*xt*It+It*It*xt,Vt=xt*xt*It+It*xt*xt+xt*It*xt,nn=xt*xt*xt;for(St=0;St=ct.t-nt){lt.h&&(lt=ct),rt=0;break}if(ct.t-nt>tt){rt=ot;break}ot=yt||tt=yt?xt.points.length-1:0;for(dt=xt.points[St].point.length,ht=0;ht=It&&Et=yt)it[0]=vt[0],it[1]=vt[1],it[2]=vt[2];else if(tt<=wt)it[0]=lt.s[0],it[1]=lt.s[1],it[2]=lt.s[2];else{var kt=createQuaternion(lt.s),Tt=createQuaternion(vt),Ct=(tt-wt)/(yt-wt);quaternionToEuler(it,slerp(kt,Tt,Ct))}else for(ot=0;ot=yt?pt=1:tt1e-6?(dt=Math.acos(pt),mt=Math.sin(dt),gt=Math.sin((1-nt)*dt)/mt,bt=Math.sin(nt*dt)/mt):(gt=1-nt,bt=nt),it[0]=gt*rt+bt*lt,it[1]=gt*ot+bt*ct,it[2]=gt*at+bt*ut,it[3]=gt*st+bt*ht,it}function quaternionToEuler(tt,et){var nt=et[0],it=et[1],rt=et[2],ot=et[3],at=Math.atan2(2*it*ot-2*nt*rt,1-2*it*it-2*rt*rt),st=Math.asin(2*nt*it+2*rt*ot),lt=Math.atan2(2*nt*ot-2*it*rt,1-2*nt*nt-2*rt*rt);tt[0]=at/degToRads,tt[1]=st/degToRads,tt[2]=lt/degToRads}function createQuaternion(tt){var et=tt[0]*degToRads,nt=tt[1]*degToRads,it=tt[2]*degToRads,rt=Math.cos(et/2),ot=Math.cos(nt/2),at=Math.cos(it/2),st=Math.sin(et/2),lt=Math.sin(nt/2),ct=Math.sin(it/2),ut=rt*ot*at-st*lt*ct,ht=st*lt*at+rt*ot*ct,dt=st*ot*at+rt*lt*ct,pt=rt*lt*at-st*ot*ct;return[ht,dt,pt,ut]}function getValueAtCurrentTime(){var tt=this.comp.renderedFrame-this.offsetTime,et=this.keyframes[0].t-this.offsetTime,nt=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(tt===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=nt&&tt>=nt||this._caching.lastFrame=tt&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var it=this.interpolateValue(tt,this._caching);this.pv=it}return this._caching.lastFrame=tt,this.pv}function setVValue(tt){var et;if(this.propType==="unidimensional")et=tt*this.mult,mathAbs(this.v-et)>1e-5&&(this.v=et,this._mdf=!0);else for(var nt=0,it=this.v.length;nt1e-5&&(this.v[nt]=et,this._mdf=!0),nt+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var tt,et=this.effectsSequence.length,nt=this.kf?this.pv:this.data.k;for(tt=0;tt=this._maxLength&&this.doubleArrayLength(),nt){case"v":ot=this.v;break;case"i":ot=this.i;break;case"o":ot=this.o;break;default:ot=[];break}(!ot[it]||ot[it]&&!rt)&&(ot[it]=pointPool.newElement()),ot[it][0]=tt,ot[it][1]=et},ShapePath.prototype.setTripleAt=function(tt,et,nt,it,rt,ot,at,st){this.setXYAt(tt,et,"v",at,st),this.setXYAt(nt,it,"o",at,st),this.setXYAt(rt,ot,"i",at,st)},ShapePath.prototype.reverse=function(){var tt=new ShapePath;tt.setPathData(this.c,this._length);var et=this.v,nt=this.o,it=this.i,rt=0;this.c&&(tt.setTripleAt(et[0][0],et[0][1],it[0][0],it[0][1],nt[0][0],nt[0][1],0,!1),rt=1);var ot=this._length-1,at=this._length,st;for(st=rt;st=kt[kt.length-1].t-this.offsetTime)St=kt[kt.length-1].s?kt[kt.length-1].s[0]:kt[kt.length-2].e[0],$t=!0;else{for(var Tt=xt,Ct=kt.length-1,Ut=!0,Nt,Bt,Mt;Ut&&(Nt=kt[Tt],Bt=kt[Tt+1],!(Bt.t-this.offsetTime>yt));)Tt=Bt.t-this.offsetTime)Ot=1;else if(ytvt&&yt>vt)||(this._caching.lastIndex=xt0||jt>-1e-6&&jt<0?it(jt*Ot)/Ot:jt}function Wt(){var jt=this.props,Ot=Rt(jt[0]),Ct=Rt(jt[1]),Dt=Rt(jt[4]),Mt=Rt(jt[5]),Vt=Rt(jt[12]),Qt=Rt(jt[13]);return"matrix("+Ot+","+Ct+","+Dt+","+Mt+","+Vt+","+Qt+")"}return function(){this.reset=rt,this.rotate=ot,this.rotateX=at,this.rotateY=st,this.rotateZ=lt,this.skew=ut,this.skewFromAxis=ht,this.shear=ct,this.scale=dt,this.setTransform=pt,this.translate=mt,this.transform=gt,this.multiply=bt,this.applyToPoint=St,this.applyToX=Et,this.applyToY=It,this.applyToZ=Tt,this.applyToPointArray=Pt,this.applyToTriplePoints=Bt,this.applyToPointStringified=kt,this.toCSS=At,this.to2dCSS=Wt,this.clone=vt,this.cloneFromProps=xt,this.equals=wt,this.inversePoints=Lt,this.inversePoint=Ut,this.getInverseMatrix=$t,this._t=this.transform,this.isIdentity=yt,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(nt){return typeof nt}:_typeof$3=function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$3(tt)}var lottie={};function setLocation(tt){setLocationHref(tt)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(tt){setSubframeEnabled(tt)}function setPrefix(tt){setIdPrefix(tt)}function loadAnimation(tt){return animationManager.loadAnimation(tt)}function setQuality(tt){if(typeof tt=="string")switch(tt){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else!isNaN(tt)&&tt>1&&setDefaultCurveSegments(tt)}function inBrowser(){return typeof navigator<"u"}function installPlugin(tt,et){tt==="expressions"&&setExpressionsPlugin(et)}function getFactory(tt){switch(tt){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(tt){for(var et=queryString.split("&"),nt=0;nt=1?ot.push({s:tt-1,e:et-1}):(ot.push({s:tt,e:1}),ot.push({s:0,e:et-1}));var at=[],st,lt=ot.length,ct;for(st=0;stit+nt)){var ut,ht;ct.s*rt<=it?ut=0:ut=(ct.s*rt-it)/nt,ct.e*rt>=it+nt?ht=1:ht=(ct.e*rt-it)/nt,at.push([ut,ht])}return at.length||at.push([0,0]),at},TrimModifier.prototype.releasePathsData=function(tt){var et,nt=tt.length;for(et=0;et1?et=1+it:this.s.v<0?et=0+it:et=this.s.v+it,this.e.v>1?nt=1+it:this.e.v<0?nt=0+it:nt=this.e.v+it,et>nt){var rt=et;et=nt,nt=rt}et=Math.round(et*1e4)*1e-4,nt=Math.round(nt*1e4)*1e-4,this.sValue=et,this.eValue=nt}else et=this.sValue,nt=this.eValue;var ot,at,st=this.shapes.length,lt,ct,ut,ht,dt,pt=0;if(nt===et)for(at=0;at=0;at-=1)if(gt=this.shapes[at],gt.shape._mdf){for(bt=gt.localShapeCollection,bt.releaseShapes(),this.m===2&&st>1?(xt=this.calculateShapeEdges(et,nt,gt.totalShapeLength,vt,pt),vt+=gt.totalShapeLength):xt=[[yt,wt]],ct=xt.length,lt=0;lt=1?mt.push({s:gt.totalShapeLength*(yt-1),e:gt.totalShapeLength*(wt-1)}):(mt.push({s:gt.totalShapeLength*yt,e:gt.totalShapeLength}),mt.push({s:0,e:gt.totalShapeLength*(wt-1)}));var St=this.addShapes(gt,mt[0]);if(mt[0].s!==mt[0].e){if(mt.length>1){var Et=gt.shape.paths.shapes[gt.shape.paths._length-1];if(Et.c){var It=St.pop();this.addPaths(St,bt),St=this.addShapes(gt,mt[1],It)}else this.addPaths(St,bt),St=this.addShapes(gt,mt[1])}this.addPaths(St,bt)}}gt.shape.paths=bt}}},TrimModifier.prototype.addPaths=function(tt,et){var nt,it=tt.length;for(nt=0;ntet.e){nt.c=!1;break}else et.s<=ct&&et.e>=ct+ut.addedLength?(this.addSegment(rt[ot].v[st-1],rt[ot].o[st-1],rt[ot].i[st],rt[ot].v[st],nt,ht,bt),bt=!1):(pt=bez.getNewSegment(rt[ot].v[st-1],rt[ot].v[st],rt[ot].o[st-1],rt[ot].i[st],(et.s-ct)/ut.addedLength,(et.e-ct)/ut.addedLength,dt[st-1]),this.addSegmentFromArray(pt,nt,ht,bt),bt=!1,nt.c=!1),ct+=ut.addedLength,ht+=1;if(rt[ot].c&&dt.length){if(ut=dt[st-1],ct<=et.e){var yt=dt[st-1].addedLength;et.s<=ct&&et.e>=ct+yt?(this.addSegment(rt[ot].v[st-1],rt[ot].o[st-1],rt[ot].i[0],rt[ot].v[0],nt,ht,bt),bt=!1):(pt=bez.getNewSegment(rt[ot].v[st-1],rt[ot].v[0],rt[ot].o[st-1],rt[ot].i[0],(et.s-ct)/yt,(et.e-ct)/yt,dt[st-1]),this.addSegmentFromArray(pt,nt,ht,bt),bt=!1,nt.c=!1)}else nt.c=!1;ct+=ut.addedLength,ht+=1}if(nt._length&&(nt.setXYAt(nt.v[gt][0],nt.v[gt][1],"i",gt),nt.setXYAt(nt.v[nt._length-1][0],nt.v[nt._length-1][1],"o",nt._length-1)),ct>et.e)break;ot=this.p.keyframes[this.p.keyframes.length-1].t?(ut=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/ct,0),ht=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/ct,0)):(ut=this.p.pv,ht=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/ct,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){ut=[],ht=[];var dt=this.px,pt=this.py;dt._caching.lastFrame+dt.offsetTime<=dt.keyframes[0].t?(ut[0]=dt.getValueAtTime((dt.keyframes[0].t+.01)/ct,0),ut[1]=pt.getValueAtTime((pt.keyframes[0].t+.01)/ct,0),ht[0]=dt.getValueAtTime(dt.keyframes[0].t/ct,0),ht[1]=pt.getValueAtTime(pt.keyframes[0].t/ct,0)):dt._caching.lastFrame+dt.offsetTime>=dt.keyframes[dt.keyframes.length-1].t?(ut[0]=dt.getValueAtTime(dt.keyframes[dt.keyframes.length-1].t/ct,0),ut[1]=pt.getValueAtTime(pt.keyframes[pt.keyframes.length-1].t/ct,0),ht[0]=dt.getValueAtTime((dt.keyframes[dt.keyframes.length-1].t-.01)/ct,0),ht[1]=pt.getValueAtTime((pt.keyframes[pt.keyframes.length-1].t-.01)/ct,0)):(ut=[dt.pv,pt.pv],ht[0]=dt.getValueAtTime((dt._caching.lastFrame+dt.offsetTime-.01)/ct,dt.offsetTime),ht[1]=pt.getValueAtTime((pt._caching.lastFrame+pt.offsetTime-.01)/ct,pt.offsetTime))}else ht=tt,ut=ht;this.v.rotate(-Math.atan2(ut[1]-ht[1],ut[0]-ht[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function it(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function rt(){}function ot(lt){this._addDynamicProperty(lt),this.elem.addDynamicProperty(lt),this._isDirty=!0}function at(lt,ct,ut){if(this.elem=lt,this.frameId=-1,this.propType="transform",this.data=ct,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(ut||lt),ct.p&&ct.p.s?(this.px=PropertyFactory.getProp(lt,ct.p.x,0,0,this),this.py=PropertyFactory.getProp(lt,ct.p.y,0,0,this),ct.p.z&&(this.pz=PropertyFactory.getProp(lt,ct.p.z,0,0,this))):this.p=PropertyFactory.getProp(lt,ct.p||{k:[0,0,0]},1,0,this),ct.rx){if(this.rx=PropertyFactory.getProp(lt,ct.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(lt,ct.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(lt,ct.rz,0,degToRads,this),ct.or.k[0].ti){var ht,dt=ct.or.k.length;for(ht=0;ht0;)nt-=1,this._elements.unshift(et[nt]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(tt){var et,nt=tt.length;for(et=0;et0?Math.floor(dt):Math.ceil(dt),gt=this.pMatrix.props,bt=this.rMatrix.props,yt=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var wt=0;if(dt>0){for(;wtmt;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),wt-=1;pt&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-pt,!0),wt-=pt)}it=this.data.m===1?0:this._currentCopies-1,rt=this.data.m===1?1:-1,ot=this._currentCopies;for(var vt,xt;ot;){if(et=this.elemsData[it].it,nt=et[et.length-1].transform.mProps.v.props,xt=nt.length,et[et.length-1].transform.mProps._mdf=!0,et[et.length-1].transform.op._mdf=!0,et[et.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(it/(this._currentCopies-1)),wt!==0){for((it!==0&&rt===1||it!==this._currentCopies-1&&rt===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(bt[0],bt[1],bt[2],bt[3],bt[4],bt[5],bt[6],bt[7],bt[8],bt[9],bt[10],bt[11],bt[12],bt[13],bt[14],bt[15]),this.matrix.transform(yt[0],yt[1],yt[2],yt[3],yt[4],yt[5],yt[6],yt[7],yt[8],yt[9],yt[10],yt[11],yt[12],yt[13],yt[14],yt[15]),this.matrix.transform(gt[0],gt[1],gt[2],gt[3],gt[4],gt[5],gt[6],gt[7],gt[8],gt[9],gt[10],gt[11],gt[12],gt[13],gt[14],gt[15]),vt=0;vt0&&it<1?[et]:[]:[et-it,et+it].filter(function(rt){return rt>0&&rt<1})},PolynomialBezier.prototype.split=function(tt){if(tt<=0)return[singlePoint(this.points[0]),this];if(tt>=1)return[this,singlePoint(this.points[this.points.length-1])];var et=lerpPoint(this.points[0],this.points[1],tt),nt=lerpPoint(this.points[1],this.points[2],tt),it=lerpPoint(this.points[2],this.points[3],tt),rt=lerpPoint(et,nt,tt),ot=lerpPoint(nt,it,tt),at=lerpPoint(rt,ot,tt);return[new PolynomialBezier(this.points[0],et,rt,at,!0),new PolynomialBezier(at,ot,it,this.points[3],!0)]};function extrema(tt,et){var nt=tt.points[0][et],it=tt.points[tt.points.length-1][et];if(nt>it){var rt=it;it=nt,nt=rt}for(var ot=quadRoots(3*tt.a[et],2*tt.b[et],tt.c[et]),at=0;at0&&ot[at]<1){var st=tt.point(ot[at])[et];stit&&(it=st)}return{min:nt,max:it}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var tt=this.bounds();return{left:tt.x.min,right:tt.x.max,top:tt.y.min,bottom:tt.y.max,width:tt.x.max-tt.x.min,height:tt.y.max-tt.y.min,cx:(tt.x.max+tt.x.min)/2,cy:(tt.y.max+tt.y.min)/2}};function intersectData(tt,et,nt){var it=tt.boundingBox();return{cx:it.cx,cy:it.cy,width:it.width,height:it.height,bez:tt,t:(et+nt)/2,t1:et,t2:nt}}function splitData(tt){var et=tt.bez.split(.5);return[intersectData(et[0],tt.t1,tt.t),intersectData(et[1],tt.t,tt.t2)]}function boxIntersect(tt,et){return Math.abs(tt.cx-et.cx)*2=ot||tt.width<=it&&tt.height<=it&&et.width<=it&&et.height<=it){rt.push([tt.t,et.t]);return}var at=splitData(tt),st=splitData(et);intersectsImpl(at[0],st[0],nt+1,it,rt,ot),intersectsImpl(at[0],st[1],nt+1,it,rt,ot),intersectsImpl(at[1],st[0],nt+1,it,rt,ot),intersectsImpl(at[1],st[1],nt+1,it,rt,ot)}}PolynomialBezier.prototype.intersections=function(tt,et,nt){et===void 0&&(et=2),nt===void 0&&(nt=7);var it=[];return intersectsImpl(intersectData(this,0,1),intersectData(tt,0,1),0,et,it,nt),it},PolynomialBezier.shapeSegment=function(tt,et){var nt=(et+1)%tt.length();return new PolynomialBezier(tt.v[et],tt.o[et],tt.i[nt],tt.v[nt],!0)},PolynomialBezier.shapeSegmentInverted=function(tt,et){var nt=(et+1)%tt.length();return new PolynomialBezier(tt.v[nt],tt.i[nt],tt.o[et],tt.v[et],!0)};function crossProduct(tt,et){return[tt[1]*et[2]-tt[2]*et[1],tt[2]*et[0]-tt[0]*et[2],tt[0]*et[1]-tt[1]*et[0]]}function lineIntersection(tt,et,nt,it){var rt=[tt[0],tt[1],1],ot=[et[0],et[1],1],at=[nt[0],nt[1],1],st=[it[0],it[1],1],lt=crossProduct(crossProduct(rt,ot),crossProduct(at,st));return floatZero(lt[2])?null:[lt[0]/lt[2],lt[1]/lt[2]]}function polarOffset(tt,et,nt){return[tt[0]+Math.cos(et)*nt,tt[1]-Math.sin(et)*nt]}function pointDistance(tt,et){return Math.hypot(tt[0]-et[0],tt[1]-et[1])}function pointEqual(tt,et){return floatEqual(tt[0],et[0])&&floatEqual(tt[1],et[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(tt,et){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(tt,et.s,0,null,this),this.frequency=PropertyFactory.getProp(tt,et.r,0,null,this),this.pointsType=PropertyFactory.getProp(tt,et.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(tt,et,nt,it,rt,ot,at){var st=nt-Math.PI/2,lt=nt+Math.PI/2,ct=et[0]+Math.cos(nt)*it*rt,ut=et[1]-Math.sin(nt)*it*rt;tt.setTripleAt(ct,ut,ct+Math.cos(st)*ot,ut-Math.sin(st)*ot,ct+Math.cos(lt)*at,ut-Math.sin(lt)*at,tt.length())}function getPerpendicularVector(tt,et){var nt=[et[0]-tt[0],et[1]-tt[1]],it=-Math.PI*.5,rt=[Math.cos(it)*nt[0]-Math.sin(it)*nt[1],Math.sin(it)*nt[0]+Math.cos(it)*nt[1]];return rt}function getProjectingAngle(tt,et){var nt=et===0?tt.length()-1:et-1,it=(et+1)%tt.length(),rt=tt.v[nt],ot=tt.v[it],at=getPerpendicularVector(rt,ot);return Math.atan2(0,1)-Math.atan2(at[1],at[0])}function zigZagCorner(tt,et,nt,it,rt,ot,at){var st=getProjectingAngle(et,nt),lt=et.v[nt%et._length],ct=et.v[nt===0?et._length-1:nt-1],ut=et.v[(nt+1)%et._length],ht=ot===2?Math.sqrt(Math.pow(lt[0]-ct[0],2)+Math.pow(lt[1]-ct[1],2)):0,dt=ot===2?Math.sqrt(Math.pow(lt[0]-ut[0],2)+Math.pow(lt[1]-ut[1],2)):0;setPoint(tt,et.v[nt%et._length],st,at,it,dt/((rt+1)*2),ht/((rt+1)*2))}function zigZagSegment(tt,et,nt,it,rt,ot){for(var at=0;at1&&et.length>1&&(rt=getIntersection(tt[0],et[et.length-1]),rt)?[[tt[0].split(rt[0])[0]],[et[et.length-1].split(rt[1])[1]]]:[nt,it]}function pruneIntersections(tt){for(var et,nt=1;nt1&&(et=pruneSegmentIntersection(tt[tt.length-1],tt[0]),tt[tt.length-1]=et[0],tt[0]=et[1]),tt}function offsetSegmentSplit(tt,et){var nt=tt.inflectionPoints(),it,rt,ot,at;if(nt.length===0)return[offsetSegment(tt,et)];if(nt.length===1||floatEqual(nt[1],1))return ot=tt.split(nt[0]),it=ot[0],rt=ot[1],[offsetSegment(it,et),offsetSegment(rt,et)];ot=tt.split(nt[0]),it=ot[0];var st=(nt[1]-nt[0])/(1-nt[0]);return ot=ot[1].split(st),at=ot[0],rt=ot[1],[offsetSegment(it,et),offsetSegment(at,et),offsetSegment(rt,et)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(tt,et){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(tt,et.a,0,null,this),this.miterLimit=PropertyFactory.getProp(tt,et.ml,0,null,this),this.lineJoin=et.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(tt,et,nt,it){var rt=shapePool.newElement();rt.c=tt.c;var ot=tt.length();tt.c||(ot-=1);var at,st,lt,ct=[];for(at=0;at=0;at-=1)lt=PolynomialBezier.shapeSegmentInverted(tt,at),ct.push(offsetSegmentSplit(lt,et));ct=pruneIntersections(ct);var ut=null,ht=null;for(at=0;at0&&(Mt=!1),Mt){var rn=createTag("style");rn.setAttribute("f-forigin",jt[Ot].fOrigin),rn.setAttribute("f-origin",jt[Ot].origin),rn.setAttribute("f-family",jt[Ot].fFamily),rn.type="text/css",rn.innerText="@font-face {font-family: "+jt[Ot].fFamily+"; font-style: normal; src: url('"+jt[Ot].fPath+"');}",Wt.appendChild(rn)}}else if(jt[Ot].fOrigin==="g"||jt[Ot].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Qt=0;Qt=55296&&jt<=56319){var Ot=Rt.charCodeAt(1);Ot>=56320&&Ot<=57343&&(Wt=(jt-55296)*1024+Ot-56320+65536)}return Wt}function Et(Rt,Wt){var jt=Rt.toString(16)+Wt.toString(16);return ht.indexOf(jt)!==-1}function It(Rt){return Rt===lt}function Tt(Rt){return Rt===st}function $t(Rt){var Wt=St(Rt);return Wt>=ct&&Wt<=ut}function Ut(Rt){return $t(Rt.substr(0,2))&&$t(Rt.substr(2,2))}function Lt(Rt){return nt.indexOf(Rt)!==-1}function Bt(Rt,Wt){var jt=St(Rt.substr(Wt,2));if(jt!==it)return!1;var Ot=0;for(Wt+=2;Ot<5;){if(jt=St(Rt.substr(Wt,2)),jtat)return!1;Ot+=1,Wt+=2}return St(Rt.substr(Wt,2))===rt}function Pt(){this.isLoaded=!0}var kt=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};kt.isModifier=Et,kt.isZeroWidthJoiner=It,kt.isFlagEmoji=Ut,kt.isRegionalCode=$t,kt.isCombinedCharacter=Lt,kt.isRegionalFlag=Bt,kt.isVariationSelector=Tt,kt.BLACK_FLAG_CODE_POINT=it;var At={addChars:yt,addFonts:bt,getCharData:wt,getFontByName:xt,measureText:vt,checkLoadedFonts:mt,setIsLoaded:Pt};return kt.prototype=At,kt}();function SlotManager(tt){this.animationData=tt}SlotManager.prototype.getProp=function(tt){return this.animationData.slots&&this.animationData.slots[tt.sid]?Object.assign(tt,this.animationData.slots[tt.sid].p):tt};function slotFactory(tt){return new SlotManager(tt)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(et){this.renderableComponents.indexOf(et)===-1&&this.renderableComponents.push(et)},removeRenderableComponent:function(et){this.renderableComponents.indexOf(et)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(et),1)},prepareRenderableFrame:function(et){this.checkLayerLimits(et)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(et){this.data.ip-this.data.st<=et&&this.data.op-this.data.st>et?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var et,nt=this.renderableComponents.length;for(et=0;et.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(tt){this.audio.rate(tt)},AudioElement.prototype.volume=function(tt){this._volumeMultiplier=tt,this._previousVolume=tt*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(tt){var et,nt=this.layers.length,it;for(this.completeLayers=!0,et=nt-1;et>=0;et-=1)this.elements[et]||(it=this.layers[et],it.ip-it.st<=tt-this.layers[et].st&&it.op-it.st>tt-this.layers[et].st&&this.buildItem(et)),this.completeLayers=this.elements[et]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(tt){switch(tt.ty){case 2:return this.createImage(tt);case 0:return this.createComp(tt);case 1:return this.createSolid(tt);case 3:return this.createNull(tt);case 4:return this.createShape(tt);case 5:return this.createText(tt);case 6:return this.createAudio(tt);case 13:return this.createCamera(tt);case 15:return this.createFootage(tt);default:return this.createNull(tt)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(tt){return new AudioElement(tt,this.globalData,this)},BaseRenderer.prototype.createFootage=function(tt){return new FootageElement(tt,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var tt,et=this.layers.length;for(tt=0;tt0&&(this.maskElement.setAttribute("id",dt),this.element.maskedElement.setAttribute(wt,"url("+getLocationHref()+"#"+dt+")"),it.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(tt){return this.viewData[tt].prop},MaskElement.prototype.renderFrame=function(tt){var et=this.element.finalTransform.mat,nt,it=this.masksProperties.length;for(nt=0;nt1&&(it+=" C"+et.o[rt-1][0]+","+et.o[rt-1][1]+" "+et.i[0][0]+","+et.i[0][1]+" "+et.v[0][0]+","+et.v[0][1]),nt.lastPath!==it){var at="";nt.elem&&(et.c&&(at=tt.inv?this.solidPath+it:it),nt.elem.setAttribute("d",at)),nt.lastPath=it}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var tt={};tt.createFilter=et,tt.createAlphaToLuminanceFilter=nt;function et(it,rt){var ot=createNS("filter");return ot.setAttribute("id",it),rt!==!0&&(ot.setAttribute("filterUnits","objectBoundingBox"),ot.setAttribute("x","0%"),ot.setAttribute("y","0%"),ot.setAttribute("width","100%"),ot.setAttribute("height","100%")),ot}function nt(){var it=createNS("feColorMatrix");return it.setAttribute("type","matrix"),it.setAttribute("color-interpolation-filters","sRGB"),it.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),it}return tt}(),featureSupport=function(){var tt={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(tt.maskType=!1),/firefox/i.test(navigator.userAgent)&&(tt.svgLumaHidden=!1),tt}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(tt){var et,nt="SourceGraphic",it=tt.data.ef?tt.data.ef.length:0,rt=createElementID(),ot=filtersFactory.createFilter(rt,!0),at=0;this.filters=[];var st;for(et=0;et=0&&(it=this.shapeModifiers[et].processShapes(this._isFirstFrame),!it);et-=1);}},searchProcessedElement:function(et){for(var nt=this.processedElements,it=0,rt=nt.length;it.01)return!1;nt+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var tt=0,et=this.data.k.k.length;tt0;)yt=dt.transformers[$t].mProps._mdf||yt,Tt-=1,$t-=1;if(yt)for(Tt=St-dt.styles[vt].lvl,$t=dt.transformers.length-1;Tt>0;)It.multiply(dt.transformers[$t].mProps.v),Tt-=1,$t-=1}else It=tt;if(Et=dt.sh.paths,gt=Et._length,yt){for(bt="",mt=0;mt=1?Pt=.99:Pt<=-1&&(Pt=-.99);var kt=Lt*Pt,At=Math.cos(Bt+dt.a.v)*kt+bt[0],Rt=Math.sin(Bt+dt.a.v)*kt+bt[1];mt.setAttribute("fx",At),mt.setAttribute("fy",Rt),gt&&!dt.g._collapsable&&(dt.of.setAttribute("fx",At),dt.of.setAttribute("fy",Rt))}}}function ut(ht,dt,pt){var mt=dt.style,gt=dt.d;gt&&(gt._mdf||pt)&>.dashStr&&(mt.pElem.setAttribute("stroke-dasharray",gt.dashStr),mt.pElem.setAttribute("stroke-dashoffset",gt.dashoffset[0])),dt.c&&(dt.c._mdf||pt)&&mt.pElem.setAttribute("stroke","rgb("+bmFloor(dt.c.v[0])+","+bmFloor(dt.c.v[1])+","+bmFloor(dt.c.v[2])+")"),(dt.o._mdf||pt)&&mt.pElem.setAttribute("stroke-opacity",dt.o.v),(dt.w._mdf||pt)&&(mt.pElem.setAttribute("stroke-width",dt.w.v),mt.msElem&&mt.msElem.setAttribute("stroke-width",dt.w.v))}return nt}();function SVGShapeElement(tt,et,nt){this.shapes=[],this.shapesData=tt.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(tt,et,nt),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var tt,et=this.shapes.length,nt,it,rt=this.stylesList.length,ot,at=[],st=!1;for(it=0;it1&&st&&this.setShapesAsAnimated(at)}},SVGShapeElement.prototype.setShapesAsAnimated=function(tt){var et,nt=tt.length;for(et=0;et=0;lt-=1){if(bt=this.searchProcessedElement(tt[lt]),bt?et[lt]=nt[bt-1]:tt[lt]._render=at,tt[lt].ty==="fl"||tt[lt].ty==="st"||tt[lt].ty==="gf"||tt[lt].ty==="gs"||tt[lt].ty==="no")bt?et[lt].style.closed=!1:et[lt]=this.createStyleElement(tt[lt],rt),tt[lt]._render&&et[lt].style.pElem.parentNode!==it&&it.appendChild(et[lt].style.pElem),dt.push(et[lt].style);else if(tt[lt].ty==="gr"){if(!bt)et[lt]=this.createGroupElement(tt[lt]);else for(ht=et[lt].it.length,ut=0;ut1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(tt){this.effectsSequence.push(tt),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(tt){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!tt)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var et=this.currentData,nt=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var it,rt=this.effectsSequence.length,ot=tt||this.data.d.k[this.keysIndex].s;for(it=0;itet);)nt+=1;return this.keysIndex!==nt&&(this.keysIndex=nt),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(tt){for(var et=[],nt=0,it=tt.length,rt,ot,at=!1,st=!1,lt="";nt=55296&&rt<=56319?FontManager.isRegionalFlag(tt,nt)?lt=tt.substr(nt,14):(ot=tt.charCodeAt(nt+1),ot>=56320&&ot<=57343&&(FontManager.isModifier(rt,ot)?(lt=tt.substr(nt,2),at=!0):FontManager.isFlagEmoji(tt.substr(nt,4))?lt=tt.substr(nt,4):lt=tt.substr(nt,2))):rt>56319?(ot=tt.charCodeAt(nt+1),FontManager.isVariationSelector(rt)&&(at=!0)):FontManager.isZeroWidthJoiner(rt)&&(at=!0,st=!0),at?(et[et.length-1]+=lt,at=!1):et.push(lt),nt+=lt.length;return et},TextProperty.prototype.completeTextData=function(tt){tt.__complete=!0;var et=this.elem.globalData.fontManager,nt=this.data,it=[],rt,ot,at,st=0,lt,ct=nt.m.g,ut=0,ht=0,dt=0,pt=[],mt=0,gt=0,bt,yt,wt=et.getFontByName(tt.f),vt,xt=0,St=getFontProperties(wt);tt.fWeight=St.weight,tt.fStyle=St.style,tt.finalSize=tt.s,tt.finalText=this.buildFinalText(tt.t),ot=tt.finalText.length,tt.finalLineHeight=tt.lh;var Et=tt.tr/1e3*tt.finalSize,It;if(tt.sz)for(var Tt=!0,$t=tt.sz[0],Ut=tt.sz[1],Lt,Bt;Tt;){Bt=this.buildFinalText(tt.t),Lt=0,mt=0,ot=Bt.length,Et=tt.tr/1e3*tt.finalSize;var Pt=-1;for(rt=0;rt$t&&Bt[rt]!==" "?(Pt===-1?ot+=1:rt=Pt,Lt+=tt.finalLineHeight||tt.finalSize*1.2,Bt.splice(rt,Pt===rt?1:0,"\r"),Pt=-1,mt=0):(mt+=xt,mt+=Et);Lt+=wt.ascent*tt.finalSize/100,this.canResize&&tt.finalSize>this.minimumFontSize&&Utgt?mt:gt,mt=-2*Et,lt="",at=!0,dt+=1):lt=At,et.chars?(vt=et.getCharData(At,wt.fStyle,et.getFontByName(tt.f).fFamily),xt=at?0:vt.w*tt.finalSize/100):xt=et.measureText(lt,tt.f,tt.finalSize),At===" "?kt+=xt+Et:(mt+=xt+Et+kt,kt=0),it.push({l:xt,an:xt,add:ut,n:at,anIndexes:[],val:lt,line:dt,animatorJustifyOffset:0}),ct==2){if(ut+=xt,lt===""||lt===" "||rt===ot-1){for((lt===""||lt===" ")&&(ut-=xt);ht<=rt;)it[ht].an=ut,it[ht].ind=st,it[ht].extra=xt,ht+=1;st+=1,ut=0}}else if(ct==3){if(ut+=xt,lt===""||rt===ot-1){for(lt===""&&(ut-=xt);ht<=rt;)it[ht].an=ut,it[ht].ind=st,it[ht].extra=xt,ht+=1;ut=0,st+=1}}else it[st].ind=st,it[st].extra=0,st+=1;if(tt.l=it,gt=mt>gt?mt:gt,pt.push(mt),tt.sz)tt.boxWidth=tt.sz[0],tt.justifyOffset=0;else switch(tt.boxWidth=gt,tt.j){case 1:tt.justifyOffset=-tt.boxWidth;break;case 2:tt.justifyOffset=-tt.boxWidth/2;break;default:tt.justifyOffset=0}tt.lineWidths=pt;var Rt=nt.a,Wt,jt;yt=Rt.length;var Ot,Ct,Dt=[];for(bt=0;bt0?st=this.ne.v/100:lt=-this.ne.v/100,this.xe.v>0?ct=1-this.xe.v/100:ut=1+this.xe.v/100;var ht=BezierFactory.getBezierEasing(st,lt,ct,ut).get,dt=0,pt=this.finalS,mt=this.finalE,gt=this.data.sh;if(gt===2)mt===pt?dt=at>=mt?1:0:dt=tt(0,et(.5/(mt-pt)+(at-pt)/(mt-pt),1)),dt=ht(dt);else if(gt===3)mt===pt?dt=at>=mt?0:1:dt=1-tt(0,et(.5/(mt-pt)+(at-pt)/(mt-pt),1)),dt=ht(dt);else if(gt===4)mt===pt?dt=0:(dt=tt(0,et(.5/(mt-pt)+(at-pt)/(mt-pt),1)),dt<.5?dt*=2:dt=1-2*(dt-.5)),dt=ht(dt);else if(gt===5){if(mt===pt)dt=0;else{var bt=mt-pt;at=et(tt(0,at+.5-pt),mt-pt);var yt=-bt/2+at,wt=bt/2;dt=Math.sqrt(1-yt*yt/(wt*wt))}dt=ht(dt)}else gt===6?(mt===pt?dt=0:(at=et(tt(0,at+.5-pt),mt-pt),dt=(1+Math.cos(Math.PI+Math.PI*2*at/(mt-pt)))/2),dt=ht(dt)):(at>=nt(pt)&&(at-pt<0?dt=tt(0,et(et(mt,1)-(pt-at),1)):dt=tt(0,et(mt-at,1))),dt=ht(dt));if(this.sm.v!==100){var vt=this.sm.v*.01;vt===0&&(vt=1e-8);var xt=.5-vt*.5;dt1&&(dt=1))}return dt*this.a.v},getValue:function(at){this.iterateDynamicProperties(),this._mdf=at||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,at&&this.data.r===2&&(this.e.v=this._currentTextLength);var st=this.data.r===2?1:100/this.data.totalChars,lt=this.o.v/st,ct=this.s.v/st+lt,ut=this.e.v/st+lt;if(ct>ut){var ht=ct;ct=ut,ut=ht}this.finalS=ct,this.finalE=ut}},extendPrototype([DynamicPropertyContainer],it);function rt(ot,at,st){return new it(ot,at)}return{getTextSelectorProp:rt}}();function TextAnimatorDataProperty(tt,et,nt){var it={propType:!1},rt=PropertyFactory.getProp,ot=et.a;this.a={r:ot.r?rt(tt,ot.r,0,degToRads,nt):it,rx:ot.rx?rt(tt,ot.rx,0,degToRads,nt):it,ry:ot.ry?rt(tt,ot.ry,0,degToRads,nt):it,sk:ot.sk?rt(tt,ot.sk,0,degToRads,nt):it,sa:ot.sa?rt(tt,ot.sa,0,degToRads,nt):it,s:ot.s?rt(tt,ot.s,1,.01,nt):it,a:ot.a?rt(tt,ot.a,1,0,nt):it,o:ot.o?rt(tt,ot.o,0,.01,nt):it,p:ot.p?rt(tt,ot.p,1,0,nt):it,sw:ot.sw?rt(tt,ot.sw,0,0,nt):it,sc:ot.sc?rt(tt,ot.sc,1,0,nt):it,fc:ot.fc?rt(tt,ot.fc,1,0,nt):it,fh:ot.fh?rt(tt,ot.fh,0,0,nt):it,fs:ot.fs?rt(tt,ot.fs,0,.01,nt):it,fb:ot.fb?rt(tt,ot.fb,0,.01,nt):it,t:ot.t?rt(tt,ot.t,0,0,nt):it},this.s=TextSelectorProp.getTextSelectorProp(tt,et.s,nt),this.s.t=et.s.t}function TextAnimatorProperty(tt,et,nt){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=tt,this._renderType=et,this._elem=nt,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(nt)}TextAnimatorProperty.prototype.searchProperties=function(){var tt,et=this._textData.a.length,nt,it=PropertyFactory.getProp;for(tt=0;tt=mt+$n||!St?($t=(mt+$n-bt)/gt.partialLength,Qt=xt.point[0]+(gt.point[0]-xt.point[0])*$t,rn=xt.point[1]+(gt.point[1]-xt.point[1])*$t,ot.translate(-nt[0]*dt[ut].an*.005,-(nt[1]*kt)*.01),yt=!1):St&&(bt+=gt.partialLength,wt+=1,wt>=St.length&&(wt=0,vt+=1,Et[vt]?St=Et[vt].points:Lt.v.c?(wt=0,vt=0,St=Et[vt].points):(bt-=gt.partialLength,St=null)),St&&(xt=gt,gt=St[wt],It=gt.partialLength));Vt=dt[ut].an/2-dt[ut].add,ot.translate(-Vt,0,0)}else Vt=dt[ut].an/2-dt[ut].add,ot.translate(-Vt,0,0),ot.translate(-nt[0]*dt[ut].an*.005,-nt[1]*kt*.01,0);for(jt=0;jttt?this.textSpans[tt].span:createNS(st?"g":"text"),vt<=tt){if(lt.setAttribute("stroke-linecap","butt"),lt.setAttribute("stroke-linejoin","round"),lt.setAttribute("stroke-miterlimit","4"),this.textSpans[tt].span=lt,st){var St=createNS("g");lt.appendChild(St),this.textSpans[tt].childSpan=St}this.textSpans[tt].span=lt,this.layerElement.appendChild(lt)}lt.style.display="inherit"}if(ct.reset(),ht&&(at[tt].n&&(dt=-gt,pt+=nt.yOffset,pt+=mt?1:0,mt=!1),this.applyTextPropertiesToMatrix(nt,ct,at[tt].line,dt,pt),dt+=at[tt].l||0,dt+=gt),st){xt=this.globalData.fontManager.getCharData(nt.finalText[tt],it.fStyle,this.globalData.fontManager.getFontByName(nt.f).fFamily);var Et;if(xt.t===1)Et=new SVGCompElement(xt.data,this.globalData,this);else{var It=emptyShapeData;xt.data&&xt.data.shapes&&(It=this.buildShapeData(xt.data,nt.finalSize)),Et=new SVGShapeElement(It,this.globalData,this)}if(this.textSpans[tt].glyph){var Tt=this.textSpans[tt].glyph;this.textSpans[tt].childSpan.removeChild(Tt.layerElement),Tt.destroy()}this.textSpans[tt].glyph=Et,Et._debug=!0,Et.prepareFrame(0),Et.renderFrame(),this.textSpans[tt].childSpan.appendChild(Et.layerElement),xt.t===1&&this.textSpans[tt].childSpan.setAttribute("transform","scale("+nt.finalSize/100+","+nt.finalSize/100+")")}else ht&<.setAttribute("transform","translate("+ct.props[12]+","+ct.props[13]+")"),lt.textContent=at[tt].val,lt.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}ht&<&<.setAttribute("d",ut)}for(;tt=0;et-=1)(this.completeLayers||this.elements[et])&&this.elements[et].prepareFrame(tt-this.layers[et].st);if(this.globalData._mdf)for(et=0;et=0;nt-=1)(this.completeLayers||this.elements[nt])&&(this.elements[nt].prepareFrame(this.renderedFrame-this.layers[nt].st),this.elements[nt]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var tt,et=this.layers.length;for(tt=0;tt=0;it-=1)et.finalTransform.multiply(et.transforms[it].transform.mProps.v);et._mdf=ot},processSequences:function(et){var nt,it=this.sequenceList.length;for(nt=0;nt=1){this.buffers=[];var et=this.globalData.canvasContext,nt=assetLoader.createCanvas(et.canvas.width,et.canvas.height);this.buffers.push(nt);var it=assetLoader.createCanvas(et.canvas.width,et.canvas.height);this.buffers.push(it),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var et=this.globalData;if(et.blendMode!==this.data.bm){et.blendMode=this.data.bm;var nt=getBlendMode(this.data.bm);et.canvasContext.globalCompositeOperation=nt}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(et){et.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var et=this.buffers[0],nt=et.getContext("2d");this.clearCanvas(nt),nt.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var et=this.buffers[1],nt=et.getContext("2d");this.clearCanvas(nt),nt.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var it=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(it.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var rt=assetLoader.getLumaCanvas(this.canvasContext.canvas),ot=rt.getContext("2d");ot.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(rt,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(et,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(et){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!et)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var nt=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(nt),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(nt),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(tt,et,nt,it){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var rt=4;et.ty==="rc"?rt=5:et.ty==="el"?rt=6:et.ty==="sr"&&(rt=7),this.sh=ShapePropertyFactory.getShapeProp(tt,et,rt,tt);var ot,at=nt.length,st;for(ot=0;ot=0;ot-=1){if(ht=this.searchProcessedElement(tt[ot]),ht?et[ot]=nt[ht-1]:tt[ot]._shouldRender=it,tt[ot].ty==="fl"||tt[ot].ty==="st"||tt[ot].ty==="gf"||tt[ot].ty==="gs")ht?et[ot].style.closed=!1:et[ot]=this.createStyleElement(tt[ot],mt),ct.push(et[ot].style);else if(tt[ot].ty==="gr"){if(!ht)et[ot]=this.createGroupElement(tt[ot]);else for(lt=et[ot].it.length,st=0;st=0;rt-=1)et[rt].ty==="tr"?(at=nt[rt].transform,this.renderShapeTransform(tt,at)):et[rt].ty==="sh"||et[rt].ty==="el"||et[rt].ty==="rc"||et[rt].ty==="sr"?this.renderPath(et[rt],nt[rt]):et[rt].ty==="fl"?this.renderFill(et[rt],nt[rt],at):et[rt].ty==="st"?this.renderStroke(et[rt],nt[rt],at):et[rt].ty==="gf"||et[rt].ty==="gs"?this.renderGradientFill(et[rt],nt[rt],at):et[rt].ty==="gr"?this.renderShape(at,et[rt].it,nt[rt].it):et[rt].ty;it&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(tt,et){if(this._isFirstFrame||et._mdf||tt.transforms._mdf){var nt=tt.trNodes,it=et.paths,rt,ot,at,st=it._length;nt.length=0;var lt=tt.transforms.finalTransform;for(at=0;at=1?ut=.99:ut<=-1&&(ut=-.99);var ht=lt*ut,dt=Math.cos(ct+et.a.v)*ht+at[0],pt=Math.sin(ct+et.a.v)*ht+at[1];rt=ot.createRadialGradient(dt,pt,0,at[0],at[1],lt)}var mt,gt=tt.g.p,bt=et.g.c,yt=1;for(mt=0;mtot&<==="xMidYMid slice"||rtrt&&st==="meet"||otrt&&st==="slice")?this.transformCanvas.tx=(nt-this.transformCanvas.w*(it/this.transformCanvas.h))/2*this.renderConfig.dpr:ct==="xMax"&&(otrt&&st==="slice")?this.transformCanvas.tx=(nt-this.transformCanvas.w*(it/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,ut==="YMid"&&(ot>rt&&st==="meet"||otrt&&st==="meet"||ot=0;tt-=1)this.elements[tt]&&this.elements[tt].destroy&&this.elements[tt].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(tt,et){if(!(this.renderedFrame===tt&&this.renderConfig.clearCanvas===!0&&!et||this.destroyed||tt===-1)){this.renderedFrame=tt,this.globalData.frameNum=tt-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||et,this.globalData.projectInterface.currentFrame=tt;var nt,it=this.layers.length;for(this.completeLayers||this.checkLayers(tt),nt=it-1;nt>=0;nt-=1)(this.completeLayers||this.elements[nt])&&this.elements[nt].prepareFrame(tt-this.layers[nt].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),nt=it-1;nt>=0;nt-=1)(this.completeLayers||this.elements[nt])&&this.elements[nt].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(tt){var et=this.elements;if(!(et[tt]||this.layers[tt].ty===99)){var nt=this.createItem(this.layers[tt],this,this.globalData);et[tt]=nt,nt.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var tt=this.pendingElements.pop();tt.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var tt,et=15;for(tt=0;tt=0;et-=1)(this.completeLayers||this.elements[et])&&this.elements[et].renderFrame()},CVCompElement.prototype.destroy=function(){var tt,et=this.layers.length;for(tt=et-1;tt>=0;tt-=1)this.elements[tt]&&this.elements[tt].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(tt){return new CVCompElement(tt,this.globalData,this)};function CanvasRenderer(tt,et){this.animationItem=tt,this.renderConfig={clearCanvas:et&&et.clearCanvas!==void 0?et.clearCanvas:!0,context:et&&et.context||null,progressiveLoad:et&&et.progressiveLoad||!1,preserveAspectRatio:et&&et.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:et&&et.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:et&&et.contentVisibility||"visible",className:et&&et.className||"",id:et&&et.id||"",runExpressions:!et||et.runExpressions===void 0||et.runExpressions},this.renderConfig.dpr=et&&et.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=et&&et.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(tt){return new CVCompElement(tt,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var et=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var nt=this.finalTransform.mat.toCSS();et.transform=nt,et.webkitTransform=nt}this.finalTransform._opMdf&&(et.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(tt,et,nt){this.initElement(tt,et,nt)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var tt;this.data.hasMask?(tt=createNS("rect"),tt.setAttribute("width",this.data.sw),tt.setAttribute("height",this.data.sh),tt.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(tt=createTag("div"),tt.style.width=this.data.sw+"px",tt.style.height=this.data.sh+"px",tt.style.backgroundColor=this.data.sc),this.layerElement.appendChild(tt)};function HShapeElement(tt,et,nt){this.shapes=[],this.shapesData=tt.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(tt,et,nt),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var tt;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),tt=this.svgElement;else{tt=createNS("svg");var et=this.comp.data?this.comp.data:this.globalData.compSize;tt.setAttribute("width",et.w),tt.setAttribute("height",et.h),tt.appendChild(this.shapesContainer),this.layerElement.appendChild(tt)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=tt},HShapeElement.prototype.getTransformedPoint=function(tt,et){var nt,it=tt.length;for(nt=0;nt0&<<1&&rt[dt].push(this.calculateF(lt,tt,et,nt,it,dt))):(ct=at*at-4*st*ot,ct>=0&&(ut=(-at+bmSqrt(ct))/(2*ot),ut>0&&ut<1&&rt[dt].push(this.calculateF(ut,tt,et,nt,it,dt)),ht=(-at-bmSqrt(ct))/(2*ot),ht>0&&ht<1&&rt[dt].push(this.calculateF(ht,tt,et,nt,it,dt)))));this.shapeBoundingBox.left=bmMin.apply(null,rt[0]),this.shapeBoundingBox.top=bmMin.apply(null,rt[1]),this.shapeBoundingBox.right=bmMax.apply(null,rt[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,rt[1])},HShapeElement.prototype.calculateF=function(tt,et,nt,it,rt,ot){return bmPow(1-tt,3)*et[ot]+3*bmPow(1-tt,2)*tt*nt[ot]+3*(1-tt)*bmPow(tt,2)*it[ot]+bmPow(tt,3)*rt[ot]},HShapeElement.prototype.calculateBoundingBox=function(tt,et){var nt,it=tt.length;for(nt=0;ntnt&&(nt=rt)}nt*=tt.mult}else nt=tt.v*tt.mult;et.x-=nt,et.xMax+=nt,et.y-=nt,et.yMax+=nt},HShapeElement.prototype.currentBoxContains=function(tt){return this.currentBBox.x<=tt.x&&this.currentBBox.y<=tt.y&&this.currentBBox.width+this.currentBBox.x>=tt.x+tt.width&&this.currentBBox.height+this.currentBBox.y>=tt.y+tt.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var tt=this.tempBoundingBox,et=999999;if(tt.x=et,tt.xMax=-et,tt.y=et,tt.yMax=-et,this.calculateBoundingBox(this.itemsData,tt),tt.width=tt.xMax=0;et-=1){var it=this.hierarchy[et].finalTransform.mProp;this.mat.translate(-it.p.v[0],-it.p.v[1],it.p.v[2]),this.mat.rotateX(-it.or.v[0]).rotateY(-it.or.v[1]).rotateZ(it.or.v[2]),this.mat.rotateX(-it.rx.v).rotateY(-it.ry.v).rotateZ(it.rz.v),this.mat.scale(1/it.s.v[0],1/it.s.v[1],1/it.s.v[2]),this.mat.translate(it.a.v[0],it.a.v[1],it.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var rt;this.p?rt=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:rt=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var ot=Math.sqrt(Math.pow(rt[0],2)+Math.pow(rt[1],2)+Math.pow(rt[2],2)),at=[rt[0]/ot,rt[1]/ot,rt[2]/ot],st=Math.sqrt(at[2]*at[2]+at[0]*at[0]),lt=Math.atan2(at[1],st),ct=Math.atan2(at[0],-at[2]);this.mat.rotateY(ct).rotateX(-lt)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var ut=!this._prevMat.equals(this.mat);if((ut||this.pe._mdf)&&this.comp.threeDElements){nt=this.comp.threeDElements.length;var ht,dt,pt;for(et=0;et=tt)return this.threeDElements[et].perspectiveElem;et+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(tt,et){var nt=createTag("div"),it,rt;styleDiv(nt);var ot=createTag("div");if(styleDiv(ot),et==="3d"){it=nt.style,it.width=this.globalData.compSize.w+"px",it.height=this.globalData.compSize.h+"px";var at="50% 50%";it.webkitTransformOrigin=at,it.mozTransformOrigin=at,it.transformOrigin=at,rt=ot.style;var st="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";rt.transform=st,rt.webkitTransform=st}nt.appendChild(ot);var lt={container:ot,perspectiveElem:nt,startPos:tt,endPos:tt,type:et};return this.threeDElements.push(lt),lt},HybridRendererBase.prototype.build3dContainers=function(){var tt,et=this.layers.length,nt,it="";for(tt=0;tt=0;tt-=1)this.resizerElem.appendChild(this.threeDElements[tt].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(tt,et){for(var nt=0,it=this.threeDElements.length;ntnt?(rt=tt/this.globalData.compSize.w,ot=tt/this.globalData.compSize.w,at=0,st=(et-this.globalData.compSize.h*(tt/this.globalData.compSize.w))/2):(rt=et/this.globalData.compSize.h,ot=et/this.globalData.compSize.h,at=(tt-this.globalData.compSize.w*(et/this.globalData.compSize.h))/2,st=0);var lt=this.resizerElem.style;lt.webkitTransform="matrix3d("+rt+",0,0,0,0,"+ot+",0,0,0,0,1,0,"+at+","+st+",0,1)",lt.transform=lt.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var tt=this.globalData.compSize.w,et=this.globalData.compSize.h,nt,it=this.threeDElements.length;for(nt=0;nt=ct;)Lt/=2,Bt/=2,Pt>>>=1;return(Lt+Pt)/Bt};return $t.int32=function(){return Tt.g(4)|0},$t.quick=function(){return Tt.g(4)/4294967296},$t.double=$t,bt(wt(Tt.S),tt),(xt.pass||St||function(Ut,Lt,Bt,Pt){return Pt&&(Pt.S&&mt(Pt,Tt),Ut.state=function(){return mt(Tt,{})}),Bt?(et[at]=Ut,Lt):Ut})($t,It,"global"in xt?xt.global:this==et,xt.state)}et["seed"+at]=dt;function pt(vt){var xt,St=vt.length,Et=this,It=0,Tt=Et.i=Et.j=0,$t=Et.S=[];for(St||(vt=[St++]);Itnt){var it=nt;nt=et,et=it}return Math.min(Math.max(tt,et),nt)}function radiansToDegrees(tt){return tt/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(tt){return tt*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(tt,et){if(typeof tt=="number"||tt instanceof Number)return et=et||0,Math.abs(tt-et);et||(et=helperLengthArray);var nt,it=Math.min(tt.length,et.length),rt=0;for(nt=0;nt.5?ct/(2-rt-ot):ct/(rt+ot),rt){case et:at=(nt-it)/ct+(nt1&&(nt-=1),nt<1/6?tt+(et-tt)*6*nt:nt<1/2?et:nt<2/3?tt+(et-tt)*(2/3-nt)*6:tt}function hslToRgb(tt){var et=tt[0],nt=tt[1],it=tt[2],rt,ot,at;if(nt===0)rt=it,at=it,ot=it;else{var st=it<.5?it*(1+nt):it+nt-it*nt,lt=2*it-st;rt=hue2rgb(lt,st,et+1/3),ot=hue2rgb(lt,st,et),at=hue2rgb(lt,st,et-1/3)}return[rt,ot,at,tt[3]]}function linear(tt,et,nt,it,rt){if((it===void 0||rt===void 0)&&(it=et,rt=nt,et=0,nt=1),nt=nt)return rt;var at=nt===et?0:(tt-et)/(nt-et);if(!it.length)return it+(rt-it)*at;var st,lt=it.length,ct=createTypedArray("float32",lt);for(st=0;st1){for(rt=0;rt1?et=1:et<0&&(et=0);var at=tt(et);if($bm_isInstanceOfArray(rt)){var st,lt=rt.length,ct=createTypedArray("float32",lt);for(st=0;stdata.k[et].t&&ttdata.k[et+1].t-tt?(it=et+2,rt=data.k[et+1].t):(it=et+1,rt=data.k[et].t);break}it===-1&&(it=et+1,rt=data.k[et].t)}var ot={};return ot.index=it,ot.time=rt/elem.comp.globalData.frameRate,ot}function key(tt){var et,nt,it;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+tt);tt-=1,et={time:data.k[tt].t/elem.comp.globalData.frameRate,value:[]};var rt=Object.prototype.hasOwnProperty.call(data.k[tt],"s")?data.k[tt].s:data.k[tt-1].e;for(it=rt.length,nt=0;ntbt.length-1)&&(pt=bt.length-1),vt=bt[bt.length-1-pt].t,wt=yt-vt);var xt,St,Et;if(dt==="pingpong"){var It=Math.floor((gt-vt)/wt);if(It%2!==0)return this.getValueAtTime((wt-(gt-vt)%wt+vt)/this.comp.globalData.frameRate,0)}else if(dt==="offset"){var Tt=this.getValueAtTime(vt/this.comp.globalData.frameRate,0),$t=this.getValueAtTime(yt/this.comp.globalData.frameRate,0),Ut=this.getValueAtTime(((gt-vt)%wt+vt)/this.comp.globalData.frameRate,0),Lt=Math.floor((gt-vt)/wt);if(this.pv.length){for(Et=new Array(Tt.length),St=Et.length,xt=0;xt=yt)return this.pv;var wt,vt;mt?(pt?wt=Math.abs(this.elem.comp.globalData.frameRate*pt):wt=Math.max(0,this.elem.data.op-yt),vt=yt+wt):((!pt||pt>bt.length-1)&&(pt=bt.length-1),vt=bt[pt].t,wt=vt-yt);var xt,St,Et;if(dt==="pingpong"){var It=Math.floor((yt-gt)/wt);if(It%2===0)return this.getValueAtTime(((yt-gt)%wt+yt)/this.comp.globalData.frameRate,0)}else if(dt==="offset"){var Tt=this.getValueAtTime(yt/this.comp.globalData.frameRate,0),$t=this.getValueAtTime(vt/this.comp.globalData.frameRate,0),Ut=this.getValueAtTime((wt-(yt-gt)%wt+yt)/this.comp.globalData.frameRate,0),Lt=Math.floor((yt-gt)/wt)+1;if(this.pv.length){for(Et=new Array(Tt.length),St=Et.length,xt=0;xt1?(bt-gt)/(pt-1):1,wt=0,vt=0,xt;this.pv.length?xt=createTypedArray("float32",this.pv.length):xt=0;for(var St;wtwt){var It=vt,Tt=gt.c&&vt===xt-1?0:vt+1,$t=(wt-St)/yt[vt].addedLength;Et=bez.getPointInSegment(gt.v[It],gt.v[Tt],gt.o[It],gt.i[Tt],$t,yt[vt]);break}else St+=yt[vt].addedLength;vt+=1}return Et||(Et=gt.c?[gt.v[0][0],gt.v[0][1]]:[gt.v[gt._length-1][0],gt.v[gt._length-1][1]]),Et},vectorOnPath:function(pt,mt,gt){pt==1?pt=this.v.c:pt==0&&(pt=.999);var bt=this.pointOnPath(pt,mt),yt=this.pointOnPath(pt+.001,mt),wt=yt[0]-bt[0],vt=yt[1]-bt[1],xt=Math.sqrt(Math.pow(wt,2)+Math.pow(vt,2));if(xt===0)return[0,0];var St=gt==="tangent"?[wt/xt,vt/xt]:[-vt/xt,wt/xt];return St},tangentOnPath:function(pt,mt){return this.vectorOnPath(pt,mt,"tangent")},normalOnPath:function(pt,mt){return this.vectorOnPath(pt,mt,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([ut],lt),extendPrototype([ut],ct),ct.prototype.getValueAtTime=st,ct.prototype.initiateExpression=ExpressionManager.initiateExpression;var ht=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(dt,pt,mt,gt,bt){var yt=ht(dt,pt,mt,gt,bt);return yt.propertyIndex=pt.ix,yt.lock=!1,mt===3?expressionHelpers.searchExpressions(dt,pt.pt,yt):mt===4&&expressionHelpers.searchExpressions(dt,pt.ks,yt),yt.k&&dt.addDynamicProperty(yt),yt}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function tt(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(et,nt){var it=this.calculateExpression(nt);if(et.t!==it){var rt={};return this.copyData(rt,et),rt.t=it.toString(),rt.__complete=!1,rt}return et},TextProperty.prototype.searchProperty=function(){var et=this.searchKeyframes(),nt=this.searchExpressions();return this.kf=et||nt,this.kf},TextProperty.prototype.searchExpressions=tt}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function tt(et,nt){var it=createNS("feMerge");it.setAttribute("result",et);var rt,ot;for(ot=0;ot=ct?ht=mt<0?it:rt:ht=it+pt*Math.pow((st-tt)/mt,1/nt),ut[dt]=ht,dt+=1,ot+=256/(at-1);return ut.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(tt){if(tt||this.filterManager._mdf){var et,nt=this.filterManager.effectElements;this.feFuncRComposed&&(tt||nt[3].p._mdf||nt[4].p._mdf||nt[5].p._mdf||nt[6].p._mdf||nt[7].p._mdf)&&(et=this.getTableValue(nt[3].p.v,nt[4].p.v,nt[5].p.v,nt[6].p.v,nt[7].p.v),this.feFuncRComposed.setAttribute("tableValues",et),this.feFuncGComposed.setAttribute("tableValues",et),this.feFuncBComposed.setAttribute("tableValues",et)),this.feFuncR&&(tt||nt[10].p._mdf||nt[11].p._mdf||nt[12].p._mdf||nt[13].p._mdf||nt[14].p._mdf)&&(et=this.getTableValue(nt[10].p.v,nt[11].p.v,nt[12].p.v,nt[13].p.v,nt[14].p.v),this.feFuncR.setAttribute("tableValues",et)),this.feFuncG&&(tt||nt[17].p._mdf||nt[18].p._mdf||nt[19].p._mdf||nt[20].p._mdf||nt[21].p._mdf)&&(et=this.getTableValue(nt[17].p.v,nt[18].p.v,nt[19].p.v,nt[20].p.v,nt[21].p.v),this.feFuncG.setAttribute("tableValues",et)),this.feFuncB&&(tt||nt[24].p._mdf||nt[25].p._mdf||nt[26].p._mdf||nt[27].p._mdf||nt[28].p._mdf)&&(et=this.getTableValue(nt[24].p.v,nt[25].p.v,nt[26].p.v,nt[27].p.v,nt[28].p.v),this.feFuncB.setAttribute("tableValues",et)),this.feFuncA&&(tt||nt[31].p._mdf||nt[32].p._mdf||nt[33].p._mdf||nt[34].p._mdf||nt[35].p._mdf)&&(et=this.getTableValue(nt[31].p.v,nt[32].p.v,nt[33].p.v,nt[34].p.v,nt[35].p.v),this.feFuncA.setAttribute("tableValues",et))}};function SVGDropShadowEffect(tt,et,nt,it,rt){var ot=et.container.globalData.renderConfig.filterSize,at=et.data.fs||ot;tt.setAttribute("x",at.x||ot.x),tt.setAttribute("y",at.y||ot.y),tt.setAttribute("width",at.width||ot.width),tt.setAttribute("height",at.height||ot.height),this.filterManager=et;var st=createNS("feGaussianBlur");st.setAttribute("in","SourceAlpha"),st.setAttribute("result",it+"_drop_shadow_1"),st.setAttribute("stdDeviation","0"),this.feGaussianBlur=st,tt.appendChild(st);var lt=createNS("feOffset");lt.setAttribute("dx","25"),lt.setAttribute("dy","0"),lt.setAttribute("in",it+"_drop_shadow_1"),lt.setAttribute("result",it+"_drop_shadow_2"),this.feOffset=lt,tt.appendChild(lt);var ct=createNS("feFlood");ct.setAttribute("flood-color","#00ff00"),ct.setAttribute("flood-opacity","1"),ct.setAttribute("result",it+"_drop_shadow_3"),this.feFlood=ct,tt.appendChild(ct);var ut=createNS("feComposite");ut.setAttribute("in",it+"_drop_shadow_3"),ut.setAttribute("in2",it+"_drop_shadow_2"),ut.setAttribute("operator","in"),ut.setAttribute("result",it+"_drop_shadow_4"),tt.appendChild(ut);var ht=this.createMergeNode(it,[it+"_drop_shadow_4",rt]);tt.appendChild(ht)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(tt){if(tt||this.filterManager._mdf){if((tt||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),tt||this.filterManager.effectElements[0].p._mdf){var et=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(et[0]*255),Math.round(et[1]*255),Math.round(et[2]*255)))}if((tt||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),tt||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var nt=this.filterManager.effectElements[3].p.v,it=(this.filterManager.effectElements[2].p.v-90)*degToRads,rt=nt*Math.cos(it),ot=nt*Math.sin(it);this.feOffset.setAttribute("dx",rt),this.feOffset.setAttribute("dy",ot)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(tt,et,nt){this.initialized=!1,this.filterManager=et,this.filterElem=tt,this.elem=nt,nt.matteElement=createNS("g"),nt.matteElement.appendChild(nt.layerElement),nt.matteElement.appendChild(nt.transformedElement),nt.baseElement=nt.matteElement}SVGMatte3Effect.prototype.findSymbol=function(tt){for(var et=0,nt=_svgMatteSymbols.length;etjsxRuntimeExports.jsx(Flex,{style:{width:"167px",height:"167px",opacity:.5},children:jsxRuntimeExports.jsx(_default$1,{height:167,options:{loop:!0,autoplay:!0,animationData:preloadData,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}},width:167})});function r$3(tt){var et,nt,it="";if(typeof tt=="string"||typeof tt=="number")it+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et{const[et,nt]=reactExports.useState(0);return reactExports.useEffect(()=>{const it=setInterval(()=>nt(rt=>(rt+1)%tt.length),1e3);return()=>clearInterval(it)},[et]),jsxRuntimeExports.jsxs(TextWrapper$2,{children:[jsxRuntimeExports.jsx(Text$4,{className:"loading",children:"LOADING"}),jsxRuntimeExports.jsx(Flex,{className:"value-wrapper",children:tt.map(({key:it,value:rt},ot)=>jsxRuntimeExports.jsx("div",{className:clsx$1("value",{show:et===ot}),children:rt},it))}),jsxRuntimeExports.jsx(Flex,{children:tt.map(({key:it,label:rt},ot)=>jsxRuntimeExports.jsx(Flex,{className:clsx$1("label-wrapper",{show:et===ot}),children:jsxRuntimeExports.jsx("div",{className:"label",children:rt})},it))})]})},TextWrapper$2=styled$4.div` + */var Matrix=function(){var tt=Math.cos,et=Math.sin,nt=Math.tan,it=Math.round;function rt(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function ot(Nt){if(Nt===0)return this;var Bt=tt(Nt),Mt=et(Nt);return this._t(Bt,-Mt,0,0,Mt,Bt,0,0,0,0,1,0,0,0,0,1)}function at(Nt){if(Nt===0)return this;var Bt=tt(Nt),Mt=et(Nt);return this._t(1,0,0,0,0,Bt,-Mt,0,0,Mt,Bt,0,0,0,0,1)}function st(Nt){if(Nt===0)return this;var Bt=tt(Nt),Mt=et(Nt);return this._t(Bt,0,Mt,0,0,1,0,0,-Mt,0,Bt,0,0,0,0,1)}function lt(Nt){if(Nt===0)return this;var Bt=tt(Nt),Mt=et(Nt);return this._t(Bt,-Mt,0,0,Mt,Bt,0,0,0,0,1,0,0,0,0,1)}function ct(Nt,Bt){return this._t(1,Bt,Nt,1,0,0)}function ut(Nt,Bt){return this.shear(nt(Nt),nt(Bt))}function ht(Nt,Bt){var Mt=tt(Bt),Dt=et(Bt);return this._t(Mt,Dt,0,0,-Dt,Mt,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,nt(Nt),1,0,0,0,0,1,0,0,0,0,1)._t(Mt,-Dt,0,0,Dt,Mt,0,0,0,0,1,0,0,0,0,1)}function dt(Nt,Bt,Mt){return!Mt&&Mt!==0&&(Mt=1),Nt===1&&Bt===1&&Mt===1?this:this._t(Nt,0,0,0,0,Bt,0,0,0,0,Mt,0,0,0,0,1)}function pt(Nt,Bt,Mt,Dt,Pt,Vt,nn,cn,Xt,un,en,fn,xn,an,Zt,En){return this.props[0]=Nt,this.props[1]=Bt,this.props[2]=Mt,this.props[3]=Dt,this.props[4]=Pt,this.props[5]=Vt,this.props[6]=nn,this.props[7]=cn,this.props[8]=Xt,this.props[9]=un,this.props[10]=en,this.props[11]=fn,this.props[12]=xn,this.props[13]=an,this.props[14]=Zt,this.props[15]=En,this}function mt(Nt,Bt,Mt){return Mt=Mt||0,Nt!==0||Bt!==0||Mt!==0?this._t(1,0,0,0,0,1,0,0,0,0,1,0,Nt,Bt,Mt,1):this}function gt(Nt,Bt,Mt,Dt,Pt,Vt,nn,cn,Xt,un,en,fn,xn,an,Zt,En){var In=this.props;if(Nt===1&&Bt===0&&Mt===0&&Dt===0&&Pt===0&&Vt===1&&nn===0&&cn===0&&Xt===0&&un===0&&en===1&&fn===0)return In[12]=In[12]*Nt+In[15]*xn,In[13]=In[13]*Vt+In[15]*an,In[14]=In[14]*en+In[15]*Zt,In[15]*=En,this._identityCalculated=!1,this;var Cn=In[0],Nn=In[1],Un=In[2],_n=In[3],An=In[4],gn=In[5],Tn=In[6],yn=In[7],dn=In[8],sn=In[9],rn=In[10],Sn=In[11],tn=In[12],qt=In[13],Kt=In[14],wn=In[15];return In[0]=Cn*Nt+Nn*Pt+Un*Xt+_n*xn,In[1]=Cn*Bt+Nn*Vt+Un*un+_n*an,In[2]=Cn*Mt+Nn*nn+Un*en+_n*Zt,In[3]=Cn*Dt+Nn*cn+Un*fn+_n*En,In[4]=An*Nt+gn*Pt+Tn*Xt+yn*xn,In[5]=An*Bt+gn*Vt+Tn*un+yn*an,In[6]=An*Mt+gn*nn+Tn*en+yn*Zt,In[7]=An*Dt+gn*cn+Tn*fn+yn*En,In[8]=dn*Nt+sn*Pt+rn*Xt+Sn*xn,In[9]=dn*Bt+sn*Vt+rn*un+Sn*an,In[10]=dn*Mt+sn*nn+rn*en+Sn*Zt,In[11]=dn*Dt+sn*cn+rn*fn+Sn*En,In[12]=tn*Nt+qt*Pt+Kt*Xt+wn*xn,In[13]=tn*Bt+qt*Vt+Kt*un+wn*an,In[14]=tn*Mt+qt*nn+Kt*en+wn*Zt,In[15]=tn*Dt+qt*cn+Kt*fn+wn*En,this._identityCalculated=!1,this}function bt(Nt){var Bt=Nt.props;return this.transform(Bt[0],Bt[1],Bt[2],Bt[3],Bt[4],Bt[5],Bt[6],Bt[7],Bt[8],Bt[9],Bt[10],Bt[11],Bt[12],Bt[13],Bt[14],Bt[15])}function yt(){return this._identityCalculated||(this._identity=!(this.props[0]!==1||this.props[1]!==0||this.props[2]!==0||this.props[3]!==0||this.props[4]!==0||this.props[5]!==1||this.props[6]!==0||this.props[7]!==0||this.props[8]!==0||this.props[9]!==0||this.props[10]!==1||this.props[11]!==0||this.props[12]!==0||this.props[13]!==0||this.props[14]!==0||this.props[15]!==1),this._identityCalculated=!0),this._identity}function wt(Nt){for(var Bt=0;Bt<16;){if(Nt.props[Bt]!==this.props[Bt])return!1;Bt+=1}return!0}function vt(Nt){var Bt;for(Bt=0;Bt<16;Bt+=1)Nt.props[Bt]=this.props[Bt];return Nt}function xt(Nt){var Bt;for(Bt=0;Bt<16;Bt+=1)this.props[Bt]=Nt[Bt]}function St(Nt,Bt,Mt){return{x:Nt*this.props[0]+Bt*this.props[4]+Mt*this.props[8]+this.props[12],y:Nt*this.props[1]+Bt*this.props[5]+Mt*this.props[9]+this.props[13],z:Nt*this.props[2]+Bt*this.props[6]+Mt*this.props[10]+this.props[14]}}function Et(Nt,Bt,Mt){return Nt*this.props[0]+Bt*this.props[4]+Mt*this.props[8]+this.props[12]}function $t(Nt,Bt,Mt){return Nt*this.props[1]+Bt*this.props[5]+Mt*this.props[9]+this.props[13]}function It(Nt,Bt,Mt){return Nt*this.props[2]+Bt*this.props[6]+Mt*this.props[10]+this.props[14]}function Ft(){var Nt=this.props[0]*this.props[5]-this.props[1]*this.props[4],Bt=this.props[5]/Nt,Mt=-this.props[1]/Nt,Dt=-this.props[4]/Nt,Pt=this.props[0]/Nt,Vt=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/Nt,nn=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/Nt,cn=new Matrix;return cn.props[0]=Bt,cn.props[1]=Mt,cn.props[4]=Dt,cn.props[5]=Pt,cn.props[12]=Vt,cn.props[13]=nn,cn}function Ht(Nt){var Bt=this.getInverseMatrix();return Bt.applyToPointArray(Nt[0],Nt[1],Nt[2]||0)}function zt(Nt){var Bt,Mt=Nt.length,Dt=[];for(Bt=0;Bt0||Nt>-1e-6&&Nt<0?it(Nt*Bt)/Bt:Nt}function Ut(){var Nt=this.props,Bt=Ct(Nt[0]),Mt=Ct(Nt[1]),Dt=Ct(Nt[4]),Pt=Ct(Nt[5]),Vt=Ct(Nt[12]),nn=Ct(Nt[13]);return"matrix("+Bt+","+Mt+","+Dt+","+Pt+","+Vt+","+nn+")"}return function(){this.reset=rt,this.rotate=ot,this.rotateX=at,this.rotateY=st,this.rotateZ=lt,this.skew=ut,this.skewFromAxis=ht,this.shear=ct,this.scale=dt,this.setTransform=pt,this.translate=mt,this.transform=gt,this.multiply=bt,this.applyToPoint=St,this.applyToX=Et,this.applyToY=$t,this.applyToZ=It,this.applyToPointArray=jt,this.applyToTriplePoints=Ot,this.applyToPointStringified=kt,this.toCSS=Tt,this.to2dCSS=Ut,this.clone=vt,this.cloneFromProps=xt,this.equals=wt,this.inversePoints=zt,this.inversePoint=Ht,this.getInverseMatrix=Ft,this._t=this.transform,this.isIdentity=yt,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(nt){return typeof nt}:_typeof$3=function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof$3(tt)}var lottie={};function setLocation(tt){setLocationHref(tt)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(tt){setSubframeEnabled(tt)}function setPrefix(tt){setIdPrefix(tt)}function loadAnimation(tt){return animationManager.loadAnimation(tt)}function setQuality(tt){if(typeof tt=="string")switch(tt){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else!isNaN(tt)&&tt>1&&setDefaultCurveSegments(tt)}function inBrowser(){return typeof navigator<"u"}function installPlugin(tt,et){tt==="expressions"&&setExpressionsPlugin(et)}function getFactory(tt){switch(tt){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(tt){for(var et=queryString.split("&"),nt=0;nt=1?ot.push({s:tt-1,e:et-1}):(ot.push({s:tt,e:1}),ot.push({s:0,e:et-1}));var at=[],st,lt=ot.length,ct;for(st=0;stit+nt)){var ut,ht;ct.s*rt<=it?ut=0:ut=(ct.s*rt-it)/nt,ct.e*rt>=it+nt?ht=1:ht=(ct.e*rt-it)/nt,at.push([ut,ht])}return at.length||at.push([0,0]),at},TrimModifier.prototype.releasePathsData=function(tt){var et,nt=tt.length;for(et=0;et1?et=1+it:this.s.v<0?et=0+it:et=this.s.v+it,this.e.v>1?nt=1+it:this.e.v<0?nt=0+it:nt=this.e.v+it,et>nt){var rt=et;et=nt,nt=rt}et=Math.round(et*1e4)*1e-4,nt=Math.round(nt*1e4)*1e-4,this.sValue=et,this.eValue=nt}else et=this.sValue,nt=this.eValue;var ot,at,st=this.shapes.length,lt,ct,ut,ht,dt,pt=0;if(nt===et)for(at=0;at=0;at-=1)if(gt=this.shapes[at],gt.shape._mdf){for(bt=gt.localShapeCollection,bt.releaseShapes(),this.m===2&&st>1?(xt=this.calculateShapeEdges(et,nt,gt.totalShapeLength,vt,pt),vt+=gt.totalShapeLength):xt=[[yt,wt]],ct=xt.length,lt=0;lt=1?mt.push({s:gt.totalShapeLength*(yt-1),e:gt.totalShapeLength*(wt-1)}):(mt.push({s:gt.totalShapeLength*yt,e:gt.totalShapeLength}),mt.push({s:0,e:gt.totalShapeLength*(wt-1)}));var St=this.addShapes(gt,mt[0]);if(mt[0].s!==mt[0].e){if(mt.length>1){var Et=gt.shape.paths.shapes[gt.shape.paths._length-1];if(Et.c){var $t=St.pop();this.addPaths(St,bt),St=this.addShapes(gt,mt[1],$t)}else this.addPaths(St,bt),St=this.addShapes(gt,mt[1])}this.addPaths(St,bt)}}gt.shape.paths=bt}}},TrimModifier.prototype.addPaths=function(tt,et){var nt,it=tt.length;for(nt=0;ntet.e){nt.c=!1;break}else et.s<=ct&&et.e>=ct+ut.addedLength?(this.addSegment(rt[ot].v[st-1],rt[ot].o[st-1],rt[ot].i[st],rt[ot].v[st],nt,ht,bt),bt=!1):(pt=bez.getNewSegment(rt[ot].v[st-1],rt[ot].v[st],rt[ot].o[st-1],rt[ot].i[st],(et.s-ct)/ut.addedLength,(et.e-ct)/ut.addedLength,dt[st-1]),this.addSegmentFromArray(pt,nt,ht,bt),bt=!1,nt.c=!1),ct+=ut.addedLength,ht+=1;if(rt[ot].c&&dt.length){if(ut=dt[st-1],ct<=et.e){var yt=dt[st-1].addedLength;et.s<=ct&&et.e>=ct+yt?(this.addSegment(rt[ot].v[st-1],rt[ot].o[st-1],rt[ot].i[0],rt[ot].v[0],nt,ht,bt),bt=!1):(pt=bez.getNewSegment(rt[ot].v[st-1],rt[ot].v[0],rt[ot].o[st-1],rt[ot].i[0],(et.s-ct)/yt,(et.e-ct)/yt,dt[st-1]),this.addSegmentFromArray(pt,nt,ht,bt),bt=!1,nt.c=!1)}else nt.c=!1;ct+=ut.addedLength,ht+=1}if(nt._length&&(nt.setXYAt(nt.v[gt][0],nt.v[gt][1],"i",gt),nt.setXYAt(nt.v[nt._length-1][0],nt.v[nt._length-1][1],"o",nt._length-1)),ct>et.e)break;ot=this.p.keyframes[this.p.keyframes.length-1].t?(ut=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/ct,0),ht=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/ct,0)):(ut=this.p.pv,ht=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/ct,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){ut=[],ht=[];var dt=this.px,pt=this.py;dt._caching.lastFrame+dt.offsetTime<=dt.keyframes[0].t?(ut[0]=dt.getValueAtTime((dt.keyframes[0].t+.01)/ct,0),ut[1]=pt.getValueAtTime((pt.keyframes[0].t+.01)/ct,0),ht[0]=dt.getValueAtTime(dt.keyframes[0].t/ct,0),ht[1]=pt.getValueAtTime(pt.keyframes[0].t/ct,0)):dt._caching.lastFrame+dt.offsetTime>=dt.keyframes[dt.keyframes.length-1].t?(ut[0]=dt.getValueAtTime(dt.keyframes[dt.keyframes.length-1].t/ct,0),ut[1]=pt.getValueAtTime(pt.keyframes[pt.keyframes.length-1].t/ct,0),ht[0]=dt.getValueAtTime((dt.keyframes[dt.keyframes.length-1].t-.01)/ct,0),ht[1]=pt.getValueAtTime((pt.keyframes[pt.keyframes.length-1].t-.01)/ct,0)):(ut=[dt.pv,pt.pv],ht[0]=dt.getValueAtTime((dt._caching.lastFrame+dt.offsetTime-.01)/ct,dt.offsetTime),ht[1]=pt.getValueAtTime((pt._caching.lastFrame+pt.offsetTime-.01)/ct,pt.offsetTime))}else ht=tt,ut=ht;this.v.rotate(-Math.atan2(ut[1]-ht[1],ut[0]-ht[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function it(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function rt(){}function ot(lt){this._addDynamicProperty(lt),this.elem.addDynamicProperty(lt),this._isDirty=!0}function at(lt,ct,ut){if(this.elem=lt,this.frameId=-1,this.propType="transform",this.data=ct,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(ut||lt),ct.p&&ct.p.s?(this.px=PropertyFactory.getProp(lt,ct.p.x,0,0,this),this.py=PropertyFactory.getProp(lt,ct.p.y,0,0,this),ct.p.z&&(this.pz=PropertyFactory.getProp(lt,ct.p.z,0,0,this))):this.p=PropertyFactory.getProp(lt,ct.p||{k:[0,0,0]},1,0,this),ct.rx){if(this.rx=PropertyFactory.getProp(lt,ct.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(lt,ct.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(lt,ct.rz,0,degToRads,this),ct.or.k[0].ti){var ht,dt=ct.or.k.length;for(ht=0;ht0;)nt-=1,this._elements.unshift(et[nt]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(tt){var et,nt=tt.length;for(et=0;et0?Math.floor(dt):Math.ceil(dt),gt=this.pMatrix.props,bt=this.rMatrix.props,yt=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var wt=0;if(dt>0){for(;wtmt;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),wt-=1;pt&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-pt,!0),wt-=pt)}it=this.data.m===1?0:this._currentCopies-1,rt=this.data.m===1?1:-1,ot=this._currentCopies;for(var vt,xt;ot;){if(et=this.elemsData[it].it,nt=et[et.length-1].transform.mProps.v.props,xt=nt.length,et[et.length-1].transform.mProps._mdf=!0,et[et.length-1].transform.op._mdf=!0,et[et.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(it/(this._currentCopies-1)),wt!==0){for((it!==0&&rt===1||it!==this._currentCopies-1&&rt===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(bt[0],bt[1],bt[2],bt[3],bt[4],bt[5],bt[6],bt[7],bt[8],bt[9],bt[10],bt[11],bt[12],bt[13],bt[14],bt[15]),this.matrix.transform(yt[0],yt[1],yt[2],yt[3],yt[4],yt[5],yt[6],yt[7],yt[8],yt[9],yt[10],yt[11],yt[12],yt[13],yt[14],yt[15]),this.matrix.transform(gt[0],gt[1],gt[2],gt[3],gt[4],gt[5],gt[6],gt[7],gt[8],gt[9],gt[10],gt[11],gt[12],gt[13],gt[14],gt[15]),vt=0;vt0&&it<1?[et]:[]:[et-it,et+it].filter(function(rt){return rt>0&&rt<1})},PolynomialBezier.prototype.split=function(tt){if(tt<=0)return[singlePoint(this.points[0]),this];if(tt>=1)return[this,singlePoint(this.points[this.points.length-1])];var et=lerpPoint(this.points[0],this.points[1],tt),nt=lerpPoint(this.points[1],this.points[2],tt),it=lerpPoint(this.points[2],this.points[3],tt),rt=lerpPoint(et,nt,tt),ot=lerpPoint(nt,it,tt),at=lerpPoint(rt,ot,tt);return[new PolynomialBezier(this.points[0],et,rt,at,!0),new PolynomialBezier(at,ot,it,this.points[3],!0)]};function extrema(tt,et){var nt=tt.points[0][et],it=tt.points[tt.points.length-1][et];if(nt>it){var rt=it;it=nt,nt=rt}for(var ot=quadRoots(3*tt.a[et],2*tt.b[et],tt.c[et]),at=0;at0&&ot[at]<1){var st=tt.point(ot[at])[et];stit&&(it=st)}return{min:nt,max:it}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var tt=this.bounds();return{left:tt.x.min,right:tt.x.max,top:tt.y.min,bottom:tt.y.max,width:tt.x.max-tt.x.min,height:tt.y.max-tt.y.min,cx:(tt.x.max+tt.x.min)/2,cy:(tt.y.max+tt.y.min)/2}};function intersectData(tt,et,nt){var it=tt.boundingBox();return{cx:it.cx,cy:it.cy,width:it.width,height:it.height,bez:tt,t:(et+nt)/2,t1:et,t2:nt}}function splitData(tt){var et=tt.bez.split(.5);return[intersectData(et[0],tt.t1,tt.t),intersectData(et[1],tt.t,tt.t2)]}function boxIntersect(tt,et){return Math.abs(tt.cx-et.cx)*2=ot||tt.width<=it&&tt.height<=it&&et.width<=it&&et.height<=it){rt.push([tt.t,et.t]);return}var at=splitData(tt),st=splitData(et);intersectsImpl(at[0],st[0],nt+1,it,rt,ot),intersectsImpl(at[0],st[1],nt+1,it,rt,ot),intersectsImpl(at[1],st[0],nt+1,it,rt,ot),intersectsImpl(at[1],st[1],nt+1,it,rt,ot)}}PolynomialBezier.prototype.intersections=function(tt,et,nt){et===void 0&&(et=2),nt===void 0&&(nt=7);var it=[];return intersectsImpl(intersectData(this,0,1),intersectData(tt,0,1),0,et,it,nt),it},PolynomialBezier.shapeSegment=function(tt,et){var nt=(et+1)%tt.length();return new PolynomialBezier(tt.v[et],tt.o[et],tt.i[nt],tt.v[nt],!0)},PolynomialBezier.shapeSegmentInverted=function(tt,et){var nt=(et+1)%tt.length();return new PolynomialBezier(tt.v[nt],tt.i[nt],tt.o[et],tt.v[et],!0)};function crossProduct(tt,et){return[tt[1]*et[2]-tt[2]*et[1],tt[2]*et[0]-tt[0]*et[2],tt[0]*et[1]-tt[1]*et[0]]}function lineIntersection(tt,et,nt,it){var rt=[tt[0],tt[1],1],ot=[et[0],et[1],1],at=[nt[0],nt[1],1],st=[it[0],it[1],1],lt=crossProduct(crossProduct(rt,ot),crossProduct(at,st));return floatZero(lt[2])?null:[lt[0]/lt[2],lt[1]/lt[2]]}function polarOffset(tt,et,nt){return[tt[0]+Math.cos(et)*nt,tt[1]-Math.sin(et)*nt]}function pointDistance(tt,et){return Math.hypot(tt[0]-et[0],tt[1]-et[1])}function pointEqual(tt,et){return floatEqual(tt[0],et[0])&&floatEqual(tt[1],et[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(tt,et){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(tt,et.s,0,null,this),this.frequency=PropertyFactory.getProp(tt,et.r,0,null,this),this.pointsType=PropertyFactory.getProp(tt,et.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(tt,et,nt,it,rt,ot,at){var st=nt-Math.PI/2,lt=nt+Math.PI/2,ct=et[0]+Math.cos(nt)*it*rt,ut=et[1]-Math.sin(nt)*it*rt;tt.setTripleAt(ct,ut,ct+Math.cos(st)*ot,ut-Math.sin(st)*ot,ct+Math.cos(lt)*at,ut-Math.sin(lt)*at,tt.length())}function getPerpendicularVector(tt,et){var nt=[et[0]-tt[0],et[1]-tt[1]],it=-Math.PI*.5,rt=[Math.cos(it)*nt[0]-Math.sin(it)*nt[1],Math.sin(it)*nt[0]+Math.cos(it)*nt[1]];return rt}function getProjectingAngle(tt,et){var nt=et===0?tt.length()-1:et-1,it=(et+1)%tt.length(),rt=tt.v[nt],ot=tt.v[it],at=getPerpendicularVector(rt,ot);return Math.atan2(0,1)-Math.atan2(at[1],at[0])}function zigZagCorner(tt,et,nt,it,rt,ot,at){var st=getProjectingAngle(et,nt),lt=et.v[nt%et._length],ct=et.v[nt===0?et._length-1:nt-1],ut=et.v[(nt+1)%et._length],ht=ot===2?Math.sqrt(Math.pow(lt[0]-ct[0],2)+Math.pow(lt[1]-ct[1],2)):0,dt=ot===2?Math.sqrt(Math.pow(lt[0]-ut[0],2)+Math.pow(lt[1]-ut[1],2)):0;setPoint(tt,et.v[nt%et._length],st,at,it,dt/((rt+1)*2),ht/((rt+1)*2))}function zigZagSegment(tt,et,nt,it,rt,ot){for(var at=0;at1&&et.length>1&&(rt=getIntersection(tt[0],et[et.length-1]),rt)?[[tt[0].split(rt[0])[0]],[et[et.length-1].split(rt[1])[1]]]:[nt,it]}function pruneIntersections(tt){for(var et,nt=1;nt1&&(et=pruneSegmentIntersection(tt[tt.length-1],tt[0]),tt[tt.length-1]=et[0],tt[0]=et[1]),tt}function offsetSegmentSplit(tt,et){var nt=tt.inflectionPoints(),it,rt,ot,at;if(nt.length===0)return[offsetSegment(tt,et)];if(nt.length===1||floatEqual(nt[1],1))return ot=tt.split(nt[0]),it=ot[0],rt=ot[1],[offsetSegment(it,et),offsetSegment(rt,et)];ot=tt.split(nt[0]),it=ot[0];var st=(nt[1]-nt[0])/(1-nt[0]);return ot=ot[1].split(st),at=ot[0],rt=ot[1],[offsetSegment(it,et),offsetSegment(at,et),offsetSegment(rt,et)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(tt,et){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(tt,et.a,0,null,this),this.miterLimit=PropertyFactory.getProp(tt,et.ml,0,null,this),this.lineJoin=et.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(tt,et,nt,it){var rt=shapePool.newElement();rt.c=tt.c;var ot=tt.length();tt.c||(ot-=1);var at,st,lt,ct=[];for(at=0;at=0;at-=1)lt=PolynomialBezier.shapeSegmentInverted(tt,at),ct.push(offsetSegmentSplit(lt,et));ct=pruneIntersections(ct);var ut=null,ht=null;for(at=0;at0&&(Pt=!1),Pt){var cn=createTag("style");cn.setAttribute("f-forigin",Nt[Bt].fOrigin),cn.setAttribute("f-origin",Nt[Bt].origin),cn.setAttribute("f-family",Nt[Bt].fFamily),cn.type="text/css",cn.innerText="@font-face {font-family: "+Nt[Bt].fFamily+"; font-style: normal; src: url('"+Nt[Bt].fPath+"');}",Ut.appendChild(cn)}}else if(Nt[Bt].fOrigin==="g"||Nt[Bt].origin===1){for(Vt=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),nn=0;nn=55296&&Nt<=56319){var Bt=Ct.charCodeAt(1);Bt>=56320&&Bt<=57343&&(Ut=(Nt-55296)*1024+Bt-56320+65536)}return Ut}function Et(Ct,Ut){var Nt=Ct.toString(16)+Ut.toString(16);return ht.indexOf(Nt)!==-1}function $t(Ct){return Ct===lt}function It(Ct){return Ct===st}function Ft(Ct){var Ut=St(Ct);return Ut>=ct&&Ut<=ut}function Ht(Ct){return Ft(Ct.substr(0,2))&&Ft(Ct.substr(2,2))}function zt(Ct){return nt.indexOf(Ct)!==-1}function Ot(Ct,Ut){var Nt=St(Ct.substr(Ut,2));if(Nt!==it)return!1;var Bt=0;for(Ut+=2;Bt<5;){if(Nt=St(Ct.substr(Ut,2)),Ntat)return!1;Bt+=1,Ut+=2}return St(Ct.substr(Ut,2))===rt}function jt(){this.isLoaded=!0}var kt=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};kt.isModifier=Et,kt.isZeroWidthJoiner=$t,kt.isFlagEmoji=Ht,kt.isRegionalCode=Ft,kt.isCombinedCharacter=zt,kt.isRegionalFlag=Ot,kt.isVariationSelector=It,kt.BLACK_FLAG_CODE_POINT=it;var Tt={addChars:yt,addFonts:bt,getCharData:wt,getFontByName:xt,measureText:vt,checkLoadedFonts:mt,setIsLoaded:jt};return kt.prototype=Tt,kt}();function SlotManager(tt){this.animationData=tt}SlotManager.prototype.getProp=function(tt){return this.animationData.slots&&this.animationData.slots[tt.sid]?Object.assign(tt,this.animationData.slots[tt.sid].p):tt};function slotFactory(tt){return new SlotManager(tt)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(et){this.renderableComponents.indexOf(et)===-1&&this.renderableComponents.push(et)},removeRenderableComponent:function(et){this.renderableComponents.indexOf(et)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(et),1)},prepareRenderableFrame:function(et){this.checkLayerLimits(et)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(et){this.data.ip-this.data.st<=et&&this.data.op-this.data.st>et?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var et,nt=this.renderableComponents.length;for(et=0;et.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(tt){this.audio.rate(tt)},AudioElement.prototype.volume=function(tt){this._volumeMultiplier=tt,this._previousVolume=tt*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(tt){var et,nt=this.layers.length,it;for(this.completeLayers=!0,et=nt-1;et>=0;et-=1)this.elements[et]||(it=this.layers[et],it.ip-it.st<=tt-this.layers[et].st&&it.op-it.st>tt-this.layers[et].st&&this.buildItem(et)),this.completeLayers=this.elements[et]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(tt){switch(tt.ty){case 2:return this.createImage(tt);case 0:return this.createComp(tt);case 1:return this.createSolid(tt);case 3:return this.createNull(tt);case 4:return this.createShape(tt);case 5:return this.createText(tt);case 6:return this.createAudio(tt);case 13:return this.createCamera(tt);case 15:return this.createFootage(tt);default:return this.createNull(tt)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(tt){return new AudioElement(tt,this.globalData,this)},BaseRenderer.prototype.createFootage=function(tt){return new FootageElement(tt,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var tt,et=this.layers.length;for(tt=0;tt0&&(this.maskElement.setAttribute("id",dt),this.element.maskedElement.setAttribute(wt,"url("+getLocationHref()+"#"+dt+")"),it.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(tt){return this.viewData[tt].prop},MaskElement.prototype.renderFrame=function(tt){var et=this.element.finalTransform.mat,nt,it=this.masksProperties.length;for(nt=0;nt1&&(it+=" C"+et.o[rt-1][0]+","+et.o[rt-1][1]+" "+et.i[0][0]+","+et.i[0][1]+" "+et.v[0][0]+","+et.v[0][1]),nt.lastPath!==it){var at="";nt.elem&&(et.c&&(at=tt.inv?this.solidPath+it:it),nt.elem.setAttribute("d",at)),nt.lastPath=it}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var tt={};tt.createFilter=et,tt.createAlphaToLuminanceFilter=nt;function et(it,rt){var ot=createNS("filter");return ot.setAttribute("id",it),rt!==!0&&(ot.setAttribute("filterUnits","objectBoundingBox"),ot.setAttribute("x","0%"),ot.setAttribute("y","0%"),ot.setAttribute("width","100%"),ot.setAttribute("height","100%")),ot}function nt(){var it=createNS("feColorMatrix");return it.setAttribute("type","matrix"),it.setAttribute("color-interpolation-filters","sRGB"),it.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),it}return tt}(),featureSupport=function(){var tt={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(tt.maskType=!1),/firefox/i.test(navigator.userAgent)&&(tt.svgLumaHidden=!1),tt}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(tt){var et,nt="SourceGraphic",it=tt.data.ef?tt.data.ef.length:0,rt=createElementID(),ot=filtersFactory.createFilter(rt,!0),at=0;this.filters=[];var st;for(et=0;et=0&&(it=this.shapeModifiers[et].processShapes(this._isFirstFrame),!it);et-=1);}},searchProcessedElement:function(et){for(var nt=this.processedElements,it=0,rt=nt.length;it.01)return!1;nt+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var tt=0,et=this.data.k.k.length;tt0;)yt=dt.transformers[Ft].mProps._mdf||yt,It-=1,Ft-=1;if(yt)for(It=St-dt.styles[vt].lvl,Ft=dt.transformers.length-1;It>0;)$t.multiply(dt.transformers[Ft].mProps.v),It-=1,Ft-=1}else $t=tt;if(Et=dt.sh.paths,gt=Et._length,yt){for(bt="",mt=0;mt=1?jt=.99:jt<=-1&&(jt=-.99);var kt=zt*jt,Tt=Math.cos(Ot+dt.a.v)*kt+bt[0],Ct=Math.sin(Ot+dt.a.v)*kt+bt[1];mt.setAttribute("fx",Tt),mt.setAttribute("fy",Ct),gt&&!dt.g._collapsable&&(dt.of.setAttribute("fx",Tt),dt.of.setAttribute("fy",Ct))}}}function ut(ht,dt,pt){var mt=dt.style,gt=dt.d;gt&&(gt._mdf||pt)&>.dashStr&&(mt.pElem.setAttribute("stroke-dasharray",gt.dashStr),mt.pElem.setAttribute("stroke-dashoffset",gt.dashoffset[0])),dt.c&&(dt.c._mdf||pt)&&mt.pElem.setAttribute("stroke","rgb("+bmFloor(dt.c.v[0])+","+bmFloor(dt.c.v[1])+","+bmFloor(dt.c.v[2])+")"),(dt.o._mdf||pt)&&mt.pElem.setAttribute("stroke-opacity",dt.o.v),(dt.w._mdf||pt)&&(mt.pElem.setAttribute("stroke-width",dt.w.v),mt.msElem&&mt.msElem.setAttribute("stroke-width",dt.w.v))}return nt}();function SVGShapeElement(tt,et,nt){this.shapes=[],this.shapesData=tt.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(tt,et,nt),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var tt,et=this.shapes.length,nt,it,rt=this.stylesList.length,ot,at=[],st=!1;for(it=0;it1&&st&&this.setShapesAsAnimated(at)}},SVGShapeElement.prototype.setShapesAsAnimated=function(tt){var et,nt=tt.length;for(et=0;et=0;lt-=1){if(bt=this.searchProcessedElement(tt[lt]),bt?et[lt]=nt[bt-1]:tt[lt]._render=at,tt[lt].ty==="fl"||tt[lt].ty==="st"||tt[lt].ty==="gf"||tt[lt].ty==="gs"||tt[lt].ty==="no")bt?et[lt].style.closed=!1:et[lt]=this.createStyleElement(tt[lt],rt),tt[lt]._render&&et[lt].style.pElem.parentNode!==it&&it.appendChild(et[lt].style.pElem),dt.push(et[lt].style);else if(tt[lt].ty==="gr"){if(!bt)et[lt]=this.createGroupElement(tt[lt]);else for(ht=et[lt].it.length,ut=0;ut1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(tt){this.effectsSequence.push(tt),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(tt){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!tt)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var et=this.currentData,nt=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var it,rt=this.effectsSequence.length,ot=tt||this.data.d.k[this.keysIndex].s;for(it=0;itet);)nt+=1;return this.keysIndex!==nt&&(this.keysIndex=nt),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(tt){for(var et=[],nt=0,it=tt.length,rt,ot,at=!1,st=!1,lt="";nt=55296&&rt<=56319?FontManager.isRegionalFlag(tt,nt)?lt=tt.substr(nt,14):(ot=tt.charCodeAt(nt+1),ot>=56320&&ot<=57343&&(FontManager.isModifier(rt,ot)?(lt=tt.substr(nt,2),at=!0):FontManager.isFlagEmoji(tt.substr(nt,4))?lt=tt.substr(nt,4):lt=tt.substr(nt,2))):rt>56319?(ot=tt.charCodeAt(nt+1),FontManager.isVariationSelector(rt)&&(at=!0)):FontManager.isZeroWidthJoiner(rt)&&(at=!0,st=!0),at?(et[et.length-1]+=lt,at=!1):et.push(lt),nt+=lt.length;return et},TextProperty.prototype.completeTextData=function(tt){tt.__complete=!0;var et=this.elem.globalData.fontManager,nt=this.data,it=[],rt,ot,at,st=0,lt,ct=nt.m.g,ut=0,ht=0,dt=0,pt=[],mt=0,gt=0,bt,yt,wt=et.getFontByName(tt.f),vt,xt=0,St=getFontProperties(wt);tt.fWeight=St.weight,tt.fStyle=St.style,tt.finalSize=tt.s,tt.finalText=this.buildFinalText(tt.t),ot=tt.finalText.length,tt.finalLineHeight=tt.lh;var Et=tt.tr/1e3*tt.finalSize,$t;if(tt.sz)for(var It=!0,Ft=tt.sz[0],Ht=tt.sz[1],zt,Ot;It;){Ot=this.buildFinalText(tt.t),zt=0,mt=0,ot=Ot.length,Et=tt.tr/1e3*tt.finalSize;var jt=-1;for(rt=0;rtFt&&Ot[rt]!==" "?(jt===-1?ot+=1:rt=jt,zt+=tt.finalLineHeight||tt.finalSize*1.2,Ot.splice(rt,jt===rt?1:0,"\r"),jt=-1,mt=0):(mt+=xt,mt+=Et);zt+=wt.ascent*tt.finalSize/100,this.canResize&&tt.finalSize>this.minimumFontSize&&Htgt?mt:gt,mt=-2*Et,lt="",at=!0,dt+=1):lt=Tt,et.chars?(vt=et.getCharData(Tt,wt.fStyle,et.getFontByName(tt.f).fFamily),xt=at?0:vt.w*tt.finalSize/100):xt=et.measureText(lt,tt.f,tt.finalSize),Tt===" "?kt+=xt+Et:(mt+=xt+Et+kt,kt=0),it.push({l:xt,an:xt,add:ut,n:at,anIndexes:[],val:lt,line:dt,animatorJustifyOffset:0}),ct==2){if(ut+=xt,lt===""||lt===" "||rt===ot-1){for((lt===""||lt===" ")&&(ut-=xt);ht<=rt;)it[ht].an=ut,it[ht].ind=st,it[ht].extra=xt,ht+=1;st+=1,ut=0}}else if(ct==3){if(ut+=xt,lt===""||rt===ot-1){for(lt===""&&(ut-=xt);ht<=rt;)it[ht].an=ut,it[ht].ind=st,it[ht].extra=xt,ht+=1;ut=0,st+=1}}else it[st].ind=st,it[st].extra=0,st+=1;if(tt.l=it,gt=mt>gt?mt:gt,pt.push(mt),tt.sz)tt.boxWidth=tt.sz[0],tt.justifyOffset=0;else switch(tt.boxWidth=gt,tt.j){case 1:tt.justifyOffset=-tt.boxWidth;break;case 2:tt.justifyOffset=-tt.boxWidth/2;break;default:tt.justifyOffset=0}tt.lineWidths=pt;var Ct=nt.a,Ut,Nt;yt=Ct.length;var Bt,Mt,Dt=[];for(bt=0;bt0?st=this.ne.v/100:lt=-this.ne.v/100,this.xe.v>0?ct=1-this.xe.v/100:ut=1+this.xe.v/100;var ht=BezierFactory.getBezierEasing(st,lt,ct,ut).get,dt=0,pt=this.finalS,mt=this.finalE,gt=this.data.sh;if(gt===2)mt===pt?dt=at>=mt?1:0:dt=tt(0,et(.5/(mt-pt)+(at-pt)/(mt-pt),1)),dt=ht(dt);else if(gt===3)mt===pt?dt=at>=mt?0:1:dt=1-tt(0,et(.5/(mt-pt)+(at-pt)/(mt-pt),1)),dt=ht(dt);else if(gt===4)mt===pt?dt=0:(dt=tt(0,et(.5/(mt-pt)+(at-pt)/(mt-pt),1)),dt<.5?dt*=2:dt=1-2*(dt-.5)),dt=ht(dt);else if(gt===5){if(mt===pt)dt=0;else{var bt=mt-pt;at=et(tt(0,at+.5-pt),mt-pt);var yt=-bt/2+at,wt=bt/2;dt=Math.sqrt(1-yt*yt/(wt*wt))}dt=ht(dt)}else gt===6?(mt===pt?dt=0:(at=et(tt(0,at+.5-pt),mt-pt),dt=(1+Math.cos(Math.PI+Math.PI*2*at/(mt-pt)))/2),dt=ht(dt)):(at>=nt(pt)&&(at-pt<0?dt=tt(0,et(et(mt,1)-(pt-at),1)):dt=tt(0,et(mt-at,1))),dt=ht(dt));if(this.sm.v!==100){var vt=this.sm.v*.01;vt===0&&(vt=1e-8);var xt=.5-vt*.5;dt1&&(dt=1))}return dt*this.a.v},getValue:function(at){this.iterateDynamicProperties(),this._mdf=at||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,at&&this.data.r===2&&(this.e.v=this._currentTextLength);var st=this.data.r===2?1:100/this.data.totalChars,lt=this.o.v/st,ct=this.s.v/st+lt,ut=this.e.v/st+lt;if(ct>ut){var ht=ct;ct=ut,ut=ht}this.finalS=ct,this.finalE=ut}},extendPrototype([DynamicPropertyContainer],it);function rt(ot,at,st){return new it(ot,at)}return{getTextSelectorProp:rt}}();function TextAnimatorDataProperty(tt,et,nt){var it={propType:!1},rt=PropertyFactory.getProp,ot=et.a;this.a={r:ot.r?rt(tt,ot.r,0,degToRads,nt):it,rx:ot.rx?rt(tt,ot.rx,0,degToRads,nt):it,ry:ot.ry?rt(tt,ot.ry,0,degToRads,nt):it,sk:ot.sk?rt(tt,ot.sk,0,degToRads,nt):it,sa:ot.sa?rt(tt,ot.sa,0,degToRads,nt):it,s:ot.s?rt(tt,ot.s,1,.01,nt):it,a:ot.a?rt(tt,ot.a,1,0,nt):it,o:ot.o?rt(tt,ot.o,0,.01,nt):it,p:ot.p?rt(tt,ot.p,1,0,nt):it,sw:ot.sw?rt(tt,ot.sw,0,0,nt):it,sc:ot.sc?rt(tt,ot.sc,1,0,nt):it,fc:ot.fc?rt(tt,ot.fc,1,0,nt):it,fh:ot.fh?rt(tt,ot.fh,0,0,nt):it,fs:ot.fs?rt(tt,ot.fs,0,.01,nt):it,fb:ot.fb?rt(tt,ot.fb,0,.01,nt):it,t:ot.t?rt(tt,ot.t,0,0,nt):it},this.s=TextSelectorProp.getTextSelectorProp(tt,et.s,nt),this.s.t=et.s.t}function TextAnimatorProperty(tt,et,nt){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=tt,this._renderType=et,this._elem=nt,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(nt)}TextAnimatorProperty.prototype.searchProperties=function(){var tt,et=this._textData.a.length,nt,it=PropertyFactory.getProp;for(tt=0;tt=mt+Sn||!St?(Ft=(mt+Sn-bt)/gt.partialLength,nn=xt.point[0]+(gt.point[0]-xt.point[0])*Ft,cn=xt.point[1]+(gt.point[1]-xt.point[1])*Ft,ot.translate(-nt[0]*dt[ut].an*.005,-(nt[1]*kt)*.01),yt=!1):St&&(bt+=gt.partialLength,wt+=1,wt>=St.length&&(wt=0,vt+=1,Et[vt]?St=Et[vt].points:zt.v.c?(wt=0,vt=0,St=Et[vt].points):(bt-=gt.partialLength,St=null)),St&&(xt=gt,gt=St[wt],$t=gt.partialLength));Vt=dt[ut].an/2-dt[ut].add,ot.translate(-Vt,0,0)}else Vt=dt[ut].an/2-dt[ut].add,ot.translate(-Vt,0,0),ot.translate(-nt[0]*dt[ut].an*.005,-nt[1]*kt*.01,0);for(Nt=0;Nttt?this.textSpans[tt].span:createNS(st?"g":"text"),vt<=tt){if(lt.setAttribute("stroke-linecap","butt"),lt.setAttribute("stroke-linejoin","round"),lt.setAttribute("stroke-miterlimit","4"),this.textSpans[tt].span=lt,st){var St=createNS("g");lt.appendChild(St),this.textSpans[tt].childSpan=St}this.textSpans[tt].span=lt,this.layerElement.appendChild(lt)}lt.style.display="inherit"}if(ct.reset(),ht&&(at[tt].n&&(dt=-gt,pt+=nt.yOffset,pt+=mt?1:0,mt=!1),this.applyTextPropertiesToMatrix(nt,ct,at[tt].line,dt,pt),dt+=at[tt].l||0,dt+=gt),st){xt=this.globalData.fontManager.getCharData(nt.finalText[tt],it.fStyle,this.globalData.fontManager.getFontByName(nt.f).fFamily);var Et;if(xt.t===1)Et=new SVGCompElement(xt.data,this.globalData,this);else{var $t=emptyShapeData;xt.data&&xt.data.shapes&&($t=this.buildShapeData(xt.data,nt.finalSize)),Et=new SVGShapeElement($t,this.globalData,this)}if(this.textSpans[tt].glyph){var It=this.textSpans[tt].glyph;this.textSpans[tt].childSpan.removeChild(It.layerElement),It.destroy()}this.textSpans[tt].glyph=Et,Et._debug=!0,Et.prepareFrame(0),Et.renderFrame(),this.textSpans[tt].childSpan.appendChild(Et.layerElement),xt.t===1&&this.textSpans[tt].childSpan.setAttribute("transform","scale("+nt.finalSize/100+","+nt.finalSize/100+")")}else ht&<.setAttribute("transform","translate("+ct.props[12]+","+ct.props[13]+")"),lt.textContent=at[tt].val,lt.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}ht&<&<.setAttribute("d",ut)}for(;tt=0;et-=1)(this.completeLayers||this.elements[et])&&this.elements[et].prepareFrame(tt-this.layers[et].st);if(this.globalData._mdf)for(et=0;et=0;nt-=1)(this.completeLayers||this.elements[nt])&&(this.elements[nt].prepareFrame(this.renderedFrame-this.layers[nt].st),this.elements[nt]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var tt,et=this.layers.length;for(tt=0;tt=0;it-=1)et.finalTransform.multiply(et.transforms[it].transform.mProps.v);et._mdf=ot},processSequences:function(et){var nt,it=this.sequenceList.length;for(nt=0;nt=1){this.buffers=[];var et=this.globalData.canvasContext,nt=assetLoader.createCanvas(et.canvas.width,et.canvas.height);this.buffers.push(nt);var it=assetLoader.createCanvas(et.canvas.width,et.canvas.height);this.buffers.push(it),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var et=this.globalData;if(et.blendMode!==this.data.bm){et.blendMode=this.data.bm;var nt=getBlendMode(this.data.bm);et.canvasContext.globalCompositeOperation=nt}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(et){et.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var et=this.buffers[0],nt=et.getContext("2d");this.clearCanvas(nt),nt.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var et=this.buffers[1],nt=et.getContext("2d");this.clearCanvas(nt),nt.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var it=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(it.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var rt=assetLoader.getLumaCanvas(this.canvasContext.canvas),ot=rt.getContext("2d");ot.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(rt,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(et,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(et){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!et)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var nt=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(nt),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(nt),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(tt,et,nt,it){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var rt=4;et.ty==="rc"?rt=5:et.ty==="el"?rt=6:et.ty==="sr"&&(rt=7),this.sh=ShapePropertyFactory.getShapeProp(tt,et,rt,tt);var ot,at=nt.length,st;for(ot=0;ot=0;ot-=1){if(ht=this.searchProcessedElement(tt[ot]),ht?et[ot]=nt[ht-1]:tt[ot]._shouldRender=it,tt[ot].ty==="fl"||tt[ot].ty==="st"||tt[ot].ty==="gf"||tt[ot].ty==="gs")ht?et[ot].style.closed=!1:et[ot]=this.createStyleElement(tt[ot],mt),ct.push(et[ot].style);else if(tt[ot].ty==="gr"){if(!ht)et[ot]=this.createGroupElement(tt[ot]);else for(lt=et[ot].it.length,st=0;st=0;rt-=1)et[rt].ty==="tr"?(at=nt[rt].transform,this.renderShapeTransform(tt,at)):et[rt].ty==="sh"||et[rt].ty==="el"||et[rt].ty==="rc"||et[rt].ty==="sr"?this.renderPath(et[rt],nt[rt]):et[rt].ty==="fl"?this.renderFill(et[rt],nt[rt],at):et[rt].ty==="st"?this.renderStroke(et[rt],nt[rt],at):et[rt].ty==="gf"||et[rt].ty==="gs"?this.renderGradientFill(et[rt],nt[rt],at):et[rt].ty==="gr"?this.renderShape(at,et[rt].it,nt[rt].it):et[rt].ty;it&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(tt,et){if(this._isFirstFrame||et._mdf||tt.transforms._mdf){var nt=tt.trNodes,it=et.paths,rt,ot,at,st=it._length;nt.length=0;var lt=tt.transforms.finalTransform;for(at=0;at=1?ut=.99:ut<=-1&&(ut=-.99);var ht=lt*ut,dt=Math.cos(ct+et.a.v)*ht+at[0],pt=Math.sin(ct+et.a.v)*ht+at[1];rt=ot.createRadialGradient(dt,pt,0,at[0],at[1],lt)}var mt,gt=tt.g.p,bt=et.g.c,yt=1;for(mt=0;mtot&<==="xMidYMid slice"||rtrt&&st==="meet"||otrt&&st==="slice")?this.transformCanvas.tx=(nt-this.transformCanvas.w*(it/this.transformCanvas.h))/2*this.renderConfig.dpr:ct==="xMax"&&(otrt&&st==="slice")?this.transformCanvas.tx=(nt-this.transformCanvas.w*(it/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,ut==="YMid"&&(ot>rt&&st==="meet"||otrt&&st==="meet"||ot=0;tt-=1)this.elements[tt]&&this.elements[tt].destroy&&this.elements[tt].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(tt,et){if(!(this.renderedFrame===tt&&this.renderConfig.clearCanvas===!0&&!et||this.destroyed||tt===-1)){this.renderedFrame=tt,this.globalData.frameNum=tt-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||et,this.globalData.projectInterface.currentFrame=tt;var nt,it=this.layers.length;for(this.completeLayers||this.checkLayers(tt),nt=it-1;nt>=0;nt-=1)(this.completeLayers||this.elements[nt])&&this.elements[nt].prepareFrame(tt-this.layers[nt].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),nt=it-1;nt>=0;nt-=1)(this.completeLayers||this.elements[nt])&&this.elements[nt].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(tt){var et=this.elements;if(!(et[tt]||this.layers[tt].ty===99)){var nt=this.createItem(this.layers[tt],this,this.globalData);et[tt]=nt,nt.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var tt=this.pendingElements.pop();tt.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var tt,et=15;for(tt=0;tt=0;et-=1)(this.completeLayers||this.elements[et])&&this.elements[et].renderFrame()},CVCompElement.prototype.destroy=function(){var tt,et=this.layers.length;for(tt=et-1;tt>=0;tt-=1)this.elements[tt]&&this.elements[tt].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(tt){return new CVCompElement(tt,this.globalData,this)};function CanvasRenderer(tt,et){this.animationItem=tt,this.renderConfig={clearCanvas:et&&et.clearCanvas!==void 0?et.clearCanvas:!0,context:et&&et.context||null,progressiveLoad:et&&et.progressiveLoad||!1,preserveAspectRatio:et&&et.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:et&&et.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:et&&et.contentVisibility||"visible",className:et&&et.className||"",id:et&&et.id||"",runExpressions:!et||et.runExpressions===void 0||et.runExpressions},this.renderConfig.dpr=et&&et.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=et&&et.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(tt){return new CVCompElement(tt,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var et=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var nt=this.finalTransform.mat.toCSS();et.transform=nt,et.webkitTransform=nt}this.finalTransform._opMdf&&(et.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(tt,et,nt){this.initElement(tt,et,nt)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var tt;this.data.hasMask?(tt=createNS("rect"),tt.setAttribute("width",this.data.sw),tt.setAttribute("height",this.data.sh),tt.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(tt=createTag("div"),tt.style.width=this.data.sw+"px",tt.style.height=this.data.sh+"px",tt.style.backgroundColor=this.data.sc),this.layerElement.appendChild(tt)};function HShapeElement(tt,et,nt){this.shapes=[],this.shapesData=tt.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(tt,et,nt),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var tt;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),tt=this.svgElement;else{tt=createNS("svg");var et=this.comp.data?this.comp.data:this.globalData.compSize;tt.setAttribute("width",et.w),tt.setAttribute("height",et.h),tt.appendChild(this.shapesContainer),this.layerElement.appendChild(tt)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=tt},HShapeElement.prototype.getTransformedPoint=function(tt,et){var nt,it=tt.length;for(nt=0;nt0&<<1&&rt[dt].push(this.calculateF(lt,tt,et,nt,it,dt))):(ct=at*at-4*st*ot,ct>=0&&(ut=(-at+bmSqrt(ct))/(2*ot),ut>0&&ut<1&&rt[dt].push(this.calculateF(ut,tt,et,nt,it,dt)),ht=(-at-bmSqrt(ct))/(2*ot),ht>0&&ht<1&&rt[dt].push(this.calculateF(ht,tt,et,nt,it,dt)))));this.shapeBoundingBox.left=bmMin.apply(null,rt[0]),this.shapeBoundingBox.top=bmMin.apply(null,rt[1]),this.shapeBoundingBox.right=bmMax.apply(null,rt[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,rt[1])},HShapeElement.prototype.calculateF=function(tt,et,nt,it,rt,ot){return bmPow(1-tt,3)*et[ot]+3*bmPow(1-tt,2)*tt*nt[ot]+3*(1-tt)*bmPow(tt,2)*it[ot]+bmPow(tt,3)*rt[ot]},HShapeElement.prototype.calculateBoundingBox=function(tt,et){var nt,it=tt.length;for(nt=0;ntnt&&(nt=rt)}nt*=tt.mult}else nt=tt.v*tt.mult;et.x-=nt,et.xMax+=nt,et.y-=nt,et.yMax+=nt},HShapeElement.prototype.currentBoxContains=function(tt){return this.currentBBox.x<=tt.x&&this.currentBBox.y<=tt.y&&this.currentBBox.width+this.currentBBox.x>=tt.x+tt.width&&this.currentBBox.height+this.currentBBox.y>=tt.y+tt.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var tt=this.tempBoundingBox,et=999999;if(tt.x=et,tt.xMax=-et,tt.y=et,tt.yMax=-et,this.calculateBoundingBox(this.itemsData,tt),tt.width=tt.xMax=0;et-=1){var it=this.hierarchy[et].finalTransform.mProp;this.mat.translate(-it.p.v[0],-it.p.v[1],it.p.v[2]),this.mat.rotateX(-it.or.v[0]).rotateY(-it.or.v[1]).rotateZ(it.or.v[2]),this.mat.rotateX(-it.rx.v).rotateY(-it.ry.v).rotateZ(it.rz.v),this.mat.scale(1/it.s.v[0],1/it.s.v[1],1/it.s.v[2]),this.mat.translate(it.a.v[0],it.a.v[1],it.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var rt;this.p?rt=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:rt=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var ot=Math.sqrt(Math.pow(rt[0],2)+Math.pow(rt[1],2)+Math.pow(rt[2],2)),at=[rt[0]/ot,rt[1]/ot,rt[2]/ot],st=Math.sqrt(at[2]*at[2]+at[0]*at[0]),lt=Math.atan2(at[1],st),ct=Math.atan2(at[0],-at[2]);this.mat.rotateY(ct).rotateX(-lt)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var ut=!this._prevMat.equals(this.mat);if((ut||this.pe._mdf)&&this.comp.threeDElements){nt=this.comp.threeDElements.length;var ht,dt,pt;for(et=0;et=tt)return this.threeDElements[et].perspectiveElem;et+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(tt,et){var nt=createTag("div"),it,rt;styleDiv(nt);var ot=createTag("div");if(styleDiv(ot),et==="3d"){it=nt.style,it.width=this.globalData.compSize.w+"px",it.height=this.globalData.compSize.h+"px";var at="50% 50%";it.webkitTransformOrigin=at,it.mozTransformOrigin=at,it.transformOrigin=at,rt=ot.style;var st="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";rt.transform=st,rt.webkitTransform=st}nt.appendChild(ot);var lt={container:ot,perspectiveElem:nt,startPos:tt,endPos:tt,type:et};return this.threeDElements.push(lt),lt},HybridRendererBase.prototype.build3dContainers=function(){var tt,et=this.layers.length,nt,it="";for(tt=0;tt=0;tt-=1)this.resizerElem.appendChild(this.threeDElements[tt].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(tt,et){for(var nt=0,it=this.threeDElements.length;ntnt?(rt=tt/this.globalData.compSize.w,ot=tt/this.globalData.compSize.w,at=0,st=(et-this.globalData.compSize.h*(tt/this.globalData.compSize.w))/2):(rt=et/this.globalData.compSize.h,ot=et/this.globalData.compSize.h,at=(tt-this.globalData.compSize.w*(et/this.globalData.compSize.h))/2,st=0);var lt=this.resizerElem.style;lt.webkitTransform="matrix3d("+rt+",0,0,0,0,"+ot+",0,0,0,0,1,0,"+at+","+st+",0,1)",lt.transform=lt.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var tt=this.globalData.compSize.w,et=this.globalData.compSize.h,nt,it=this.threeDElements.length;for(nt=0;nt=ct;)zt/=2,Ot/=2,jt>>>=1;return(zt+jt)/Ot};return Ft.int32=function(){return It.g(4)|0},Ft.quick=function(){return It.g(4)/4294967296},Ft.double=Ft,bt(wt(It.S),tt),(xt.pass||St||function(Ht,zt,Ot,jt){return jt&&(jt.S&&mt(jt,It),Ht.state=function(){return mt(It,{})}),Ot?(et[at]=Ht,zt):Ht})(Ft,$t,"global"in xt?xt.global:this==et,xt.state)}et["seed"+at]=dt;function pt(vt){var xt,St=vt.length,Et=this,$t=0,It=Et.i=Et.j=0,Ft=Et.S=[];for(St||(vt=[St++]);$tnt){var it=nt;nt=et,et=it}return Math.min(Math.max(tt,et),nt)}function radiansToDegrees(tt){return tt/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(tt){return tt*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(tt,et){if(typeof tt=="number"||tt instanceof Number)return et=et||0,Math.abs(tt-et);et||(et=helperLengthArray);var nt,it=Math.min(tt.length,et.length),rt=0;for(nt=0;nt.5?ct/(2-rt-ot):ct/(rt+ot),rt){case et:at=(nt-it)/ct+(nt1&&(nt-=1),nt<1/6?tt+(et-tt)*6*nt:nt<1/2?et:nt<2/3?tt+(et-tt)*(2/3-nt)*6:tt}function hslToRgb(tt){var et=tt[0],nt=tt[1],it=tt[2],rt,ot,at;if(nt===0)rt=it,at=it,ot=it;else{var st=it<.5?it*(1+nt):it+nt-it*nt,lt=2*it-st;rt=hue2rgb(lt,st,et+1/3),ot=hue2rgb(lt,st,et),at=hue2rgb(lt,st,et-1/3)}return[rt,ot,at,tt[3]]}function linear(tt,et,nt,it,rt){if((it===void 0||rt===void 0)&&(it=et,rt=nt,et=0,nt=1),nt=nt)return rt;var at=nt===et?0:(tt-et)/(nt-et);if(!it.length)return it+(rt-it)*at;var st,lt=it.length,ct=createTypedArray("float32",lt);for(st=0;st1){for(rt=0;rt1?et=1:et<0&&(et=0);var at=tt(et);if($bm_isInstanceOfArray(rt)){var st,lt=rt.length,ct=createTypedArray("float32",lt);for(st=0;stdata.k[et].t&&ttdata.k[et+1].t-tt?(it=et+2,rt=data.k[et+1].t):(it=et+1,rt=data.k[et].t);break}it===-1&&(it=et+1,rt=data.k[et].t)}var ot={};return ot.index=it,ot.time=rt/elem.comp.globalData.frameRate,ot}function key(tt){var et,nt,it;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+tt);tt-=1,et={time:data.k[tt].t/elem.comp.globalData.frameRate,value:[]};var rt=Object.prototype.hasOwnProperty.call(data.k[tt],"s")?data.k[tt].s:data.k[tt-1].e;for(it=rt.length,nt=0;ntbt.length-1)&&(pt=bt.length-1),vt=bt[bt.length-1-pt].t,wt=yt-vt);var xt,St,Et;if(dt==="pingpong"){var $t=Math.floor((gt-vt)/wt);if($t%2!==0)return this.getValueAtTime((wt-(gt-vt)%wt+vt)/this.comp.globalData.frameRate,0)}else if(dt==="offset"){var It=this.getValueAtTime(vt/this.comp.globalData.frameRate,0),Ft=this.getValueAtTime(yt/this.comp.globalData.frameRate,0),Ht=this.getValueAtTime(((gt-vt)%wt+vt)/this.comp.globalData.frameRate,0),zt=Math.floor((gt-vt)/wt);if(this.pv.length){for(Et=new Array(It.length),St=Et.length,xt=0;xt=yt)return this.pv;var wt,vt;mt?(pt?wt=Math.abs(this.elem.comp.globalData.frameRate*pt):wt=Math.max(0,this.elem.data.op-yt),vt=yt+wt):((!pt||pt>bt.length-1)&&(pt=bt.length-1),vt=bt[pt].t,wt=vt-yt);var xt,St,Et;if(dt==="pingpong"){var $t=Math.floor((yt-gt)/wt);if($t%2===0)return this.getValueAtTime(((yt-gt)%wt+yt)/this.comp.globalData.frameRate,0)}else if(dt==="offset"){var It=this.getValueAtTime(yt/this.comp.globalData.frameRate,0),Ft=this.getValueAtTime(vt/this.comp.globalData.frameRate,0),Ht=this.getValueAtTime((wt-(yt-gt)%wt+yt)/this.comp.globalData.frameRate,0),zt=Math.floor((yt-gt)/wt)+1;if(this.pv.length){for(Et=new Array(It.length),St=Et.length,xt=0;xt1?(bt-gt)/(pt-1):1,wt=0,vt=0,xt;this.pv.length?xt=createTypedArray("float32",this.pv.length):xt=0;for(var St;wtwt){var $t=vt,It=gt.c&&vt===xt-1?0:vt+1,Ft=(wt-St)/yt[vt].addedLength;Et=bez.getPointInSegment(gt.v[$t],gt.v[It],gt.o[$t],gt.i[It],Ft,yt[vt]);break}else St+=yt[vt].addedLength;vt+=1}return Et||(Et=gt.c?[gt.v[0][0],gt.v[0][1]]:[gt.v[gt._length-1][0],gt.v[gt._length-1][1]]),Et},vectorOnPath:function(pt,mt,gt){pt==1?pt=this.v.c:pt==0&&(pt=.999);var bt=this.pointOnPath(pt,mt),yt=this.pointOnPath(pt+.001,mt),wt=yt[0]-bt[0],vt=yt[1]-bt[1],xt=Math.sqrt(Math.pow(wt,2)+Math.pow(vt,2));if(xt===0)return[0,0];var St=gt==="tangent"?[wt/xt,vt/xt]:[-vt/xt,wt/xt];return St},tangentOnPath:function(pt,mt){return this.vectorOnPath(pt,mt,"tangent")},normalOnPath:function(pt,mt){return this.vectorOnPath(pt,mt,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([ut],lt),extendPrototype([ut],ct),ct.prototype.getValueAtTime=st,ct.prototype.initiateExpression=ExpressionManager.initiateExpression;var ht=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(dt,pt,mt,gt,bt){var yt=ht(dt,pt,mt,gt,bt);return yt.propertyIndex=pt.ix,yt.lock=!1,mt===3?expressionHelpers.searchExpressions(dt,pt.pt,yt):mt===4&&expressionHelpers.searchExpressions(dt,pt.ks,yt),yt.k&&dt.addDynamicProperty(yt),yt}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function tt(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(et,nt){var it=this.calculateExpression(nt);if(et.t!==it){var rt={};return this.copyData(rt,et),rt.t=it.toString(),rt.__complete=!1,rt}return et},TextProperty.prototype.searchProperty=function(){var et=this.searchKeyframes(),nt=this.searchExpressions();return this.kf=et||nt,this.kf},TextProperty.prototype.searchExpressions=tt}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function tt(et,nt){var it=createNS("feMerge");it.setAttribute("result",et);var rt,ot;for(ot=0;ot=ct?ht=mt<0?it:rt:ht=it+pt*Math.pow((st-tt)/mt,1/nt),ut[dt]=ht,dt+=1,ot+=256/(at-1);return ut.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(tt){if(tt||this.filterManager._mdf){var et,nt=this.filterManager.effectElements;this.feFuncRComposed&&(tt||nt[3].p._mdf||nt[4].p._mdf||nt[5].p._mdf||nt[6].p._mdf||nt[7].p._mdf)&&(et=this.getTableValue(nt[3].p.v,nt[4].p.v,nt[5].p.v,nt[6].p.v,nt[7].p.v),this.feFuncRComposed.setAttribute("tableValues",et),this.feFuncGComposed.setAttribute("tableValues",et),this.feFuncBComposed.setAttribute("tableValues",et)),this.feFuncR&&(tt||nt[10].p._mdf||nt[11].p._mdf||nt[12].p._mdf||nt[13].p._mdf||nt[14].p._mdf)&&(et=this.getTableValue(nt[10].p.v,nt[11].p.v,nt[12].p.v,nt[13].p.v,nt[14].p.v),this.feFuncR.setAttribute("tableValues",et)),this.feFuncG&&(tt||nt[17].p._mdf||nt[18].p._mdf||nt[19].p._mdf||nt[20].p._mdf||nt[21].p._mdf)&&(et=this.getTableValue(nt[17].p.v,nt[18].p.v,nt[19].p.v,nt[20].p.v,nt[21].p.v),this.feFuncG.setAttribute("tableValues",et)),this.feFuncB&&(tt||nt[24].p._mdf||nt[25].p._mdf||nt[26].p._mdf||nt[27].p._mdf||nt[28].p._mdf)&&(et=this.getTableValue(nt[24].p.v,nt[25].p.v,nt[26].p.v,nt[27].p.v,nt[28].p.v),this.feFuncB.setAttribute("tableValues",et)),this.feFuncA&&(tt||nt[31].p._mdf||nt[32].p._mdf||nt[33].p._mdf||nt[34].p._mdf||nt[35].p._mdf)&&(et=this.getTableValue(nt[31].p.v,nt[32].p.v,nt[33].p.v,nt[34].p.v,nt[35].p.v),this.feFuncA.setAttribute("tableValues",et))}};function SVGDropShadowEffect(tt,et,nt,it,rt){var ot=et.container.globalData.renderConfig.filterSize,at=et.data.fs||ot;tt.setAttribute("x",at.x||ot.x),tt.setAttribute("y",at.y||ot.y),tt.setAttribute("width",at.width||ot.width),tt.setAttribute("height",at.height||ot.height),this.filterManager=et;var st=createNS("feGaussianBlur");st.setAttribute("in","SourceAlpha"),st.setAttribute("result",it+"_drop_shadow_1"),st.setAttribute("stdDeviation","0"),this.feGaussianBlur=st,tt.appendChild(st);var lt=createNS("feOffset");lt.setAttribute("dx","25"),lt.setAttribute("dy","0"),lt.setAttribute("in",it+"_drop_shadow_1"),lt.setAttribute("result",it+"_drop_shadow_2"),this.feOffset=lt,tt.appendChild(lt);var ct=createNS("feFlood");ct.setAttribute("flood-color","#00ff00"),ct.setAttribute("flood-opacity","1"),ct.setAttribute("result",it+"_drop_shadow_3"),this.feFlood=ct,tt.appendChild(ct);var ut=createNS("feComposite");ut.setAttribute("in",it+"_drop_shadow_3"),ut.setAttribute("in2",it+"_drop_shadow_2"),ut.setAttribute("operator","in"),ut.setAttribute("result",it+"_drop_shadow_4"),tt.appendChild(ut);var ht=this.createMergeNode(it,[it+"_drop_shadow_4",rt]);tt.appendChild(ht)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(tt){if(tt||this.filterManager._mdf){if((tt||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),tt||this.filterManager.effectElements[0].p._mdf){var et=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(et[0]*255),Math.round(et[1]*255),Math.round(et[2]*255)))}if((tt||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),tt||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var nt=this.filterManager.effectElements[3].p.v,it=(this.filterManager.effectElements[2].p.v-90)*degToRads,rt=nt*Math.cos(it),ot=nt*Math.sin(it);this.feOffset.setAttribute("dx",rt),this.feOffset.setAttribute("dy",ot)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(tt,et,nt){this.initialized=!1,this.filterManager=et,this.filterElem=tt,this.elem=nt,nt.matteElement=createNS("g"),nt.matteElement.appendChild(nt.layerElement),nt.matteElement.appendChild(nt.transformedElement),nt.baseElement=nt.matteElement}SVGMatte3Effect.prototype.findSymbol=function(tt){for(var et=0,nt=_svgMatteSymbols.length;etjsxRuntimeExports.jsx(Flex,{style:{width:"167px",height:"167px",opacity:.5},children:jsxRuntimeExports.jsx(_default$2,{height:167,options:{loop:!0,autoplay:!0,animationData:preloadData,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}},width:167})});function r$3(tt){var et,nt,it="";if(typeof tt=="string"||typeof tt=="number")it+=tt;else if(typeof tt=="object")if(Array.isArray(tt))for(et=0;et{const[et,nt]=reactExports.useState(0);return reactExports.useEffect(()=>{const it=setInterval(()=>nt(rt=>(rt+1)%tt.length),1e3);return()=>clearInterval(it)},[et]),jsxRuntimeExports.jsxs(TextWrapper$2,{children:[jsxRuntimeExports.jsx(Text$4,{className:"loading",children:"LOADING"}),jsxRuntimeExports.jsx(Flex,{className:"value-wrapper",children:tt.map(({key:it,value:rt},ot)=>jsxRuntimeExports.jsx("div",{className:clsx$1("value",{show:et===ot}),children:rt},it))}),jsxRuntimeExports.jsx(Flex,{children:tt.map(({key:it,label:rt},ot)=>jsxRuntimeExports.jsx(Flex,{className:clsx$1("label-wrapper",{show:et===ot}),children:jsxRuntimeExports.jsx("div",{className:"label",children:rt})},it))})]})},TextWrapper$2=styled$4.div` height: 16px; display: flex; justify-content: space-between; @@ -3895,7 +3895,7 @@ function print() { __p += __j.call(arguments, '') } * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(tt){function et(jt,Ot){var Ct=jt.length;jt.push(Ot);e:for(;0>>1,Mt=jt[Dt];if(0>>1;Dtrt(rn,Ct))Xtrt(an,rn)?(jt[Dt]=an,jt[Xt]=Ct,Dt=Xt):(jt[Dt]=rn,jt[Qt]=Ct,Dt=Qt);else if(Xtrt(an,Ct))jt[Dt]=an,jt[Xt]=Ct,Dt=Xt;else break e}}return Ot}function rt(jt,Ot){var Ct=jt.sortIndex-Ot.sortIndex;return Ct!==0?Ct:jt.id-Ot.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ot=performance;tt.unstable_now=function(){return ot.now()}}else{var at=Date,st=at.now();tt.unstable_now=function(){return at.now()-st}}var lt=[],ct=[],ut=1,ht=null,dt=3,pt=!1,mt=!1,gt=!1,bt=typeof setTimeout=="function"?setTimeout:null,yt=typeof clearTimeout=="function"?clearTimeout:null,wt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vt(jt){for(var Ot=nt(ct);Ot!==null;){if(Ot.callback===null)it(ct);else if(Ot.startTime<=jt)it(ct),Ot.sortIndex=Ot.expirationTime,et(lt,Ot);else break;Ot=nt(ct)}}function xt(jt){if(gt=!1,vt(jt),!mt)if(nt(lt)!==null)mt=!0,Rt(St);else{var Ot=nt(ct);Ot!==null&&Wt(xt,Ot.startTime-jt)}}function St(jt,Ot){mt=!1,gt&&(gt=!1,yt(Tt),Tt=-1),pt=!0;var Ct=dt;try{for(vt(Ot),ht=nt(lt);ht!==null&&(!(ht.expirationTime>Ot)||jt&&!Lt());){var Dt=ht.callback;if(typeof Dt=="function"){ht.callback=null,dt=ht.priorityLevel;var Mt=Dt(ht.expirationTime<=Ot);Ot=tt.unstable_now(),typeof Mt=="function"?ht.callback=Mt:ht===nt(lt)&&it(lt),vt(Ot)}else it(lt);ht=nt(lt)}if(ht!==null)var Vt=!0;else{var Qt=nt(ct);Qt!==null&&Wt(xt,Qt.startTime-Ot),Vt=!1}return Vt}finally{ht=null,dt=Ct,pt=!1}}var Et=!1,It=null,Tt=-1,$t=5,Ut=-1;function Lt(){return!(tt.unstable_now()-Ut<$t)}function Bt(){if(It!==null){var jt=tt.unstable_now();Ut=jt;var Ot=!0;try{Ot=It(!0,jt)}finally{Ot?Pt():(Et=!1,It=null)}}else Et=!1}var Pt;if(typeof wt=="function")Pt=function(){wt(Bt)};else if(typeof MessageChannel<"u"){var kt=new MessageChannel,At=kt.port2;kt.port1.onmessage=Bt,Pt=function(){At.postMessage(null)}}else Pt=function(){bt(Bt,0)};function Rt(jt){It=jt,Et||(Et=!0,Pt())}function Wt(jt,Ot){Tt=bt(function(){jt(tt.unstable_now())},Ot)}tt.unstable_IdlePriority=5,tt.unstable_ImmediatePriority=1,tt.unstable_LowPriority=4,tt.unstable_NormalPriority=3,tt.unstable_Profiling=null,tt.unstable_UserBlockingPriority=2,tt.unstable_cancelCallback=function(jt){jt.callback=null},tt.unstable_continueExecution=function(){mt||pt||(mt=!0,Rt(St))},tt.unstable_forceFrameRate=function(jt){0>jt||125Dt?(jt.sortIndex=Ct,et(ct,jt),nt(lt)===null&&jt===nt(ct)&&(gt?(yt(Tt),Tt=-1):gt=!0,Wt(xt,Ct-Dt))):(jt.sortIndex=Mt,et(lt,jt),mt||pt||(mt=!0,Rt(St))),jt},tt.unstable_shouldYield=Lt,tt.unstable_wrapCallback=function(jt){var Ot=dt;return function(){var Ct=dt;dt=Ot;try{return jt.apply(this,arguments)}finally{dt=Ct}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** + */(function(tt){function et(Nt,Bt){var Mt=Nt.length;Nt.push(Bt);e:for(;0>>1,Pt=Nt[Dt];if(0>>1;Dtrt(cn,Mt))Xtrt(un,cn)?(Nt[Dt]=un,Nt[Xt]=Mt,Dt=Xt):(Nt[Dt]=cn,Nt[nn]=Mt,Dt=nn);else if(Xtrt(un,Mt))Nt[Dt]=un,Nt[Xt]=Mt,Dt=Xt;else break e}}return Bt}function rt(Nt,Bt){var Mt=Nt.sortIndex-Bt.sortIndex;return Mt!==0?Mt:Nt.id-Bt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ot=performance;tt.unstable_now=function(){return ot.now()}}else{var at=Date,st=at.now();tt.unstable_now=function(){return at.now()-st}}var lt=[],ct=[],ut=1,ht=null,dt=3,pt=!1,mt=!1,gt=!1,bt=typeof setTimeout=="function"?setTimeout:null,yt=typeof clearTimeout=="function"?clearTimeout:null,wt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vt(Nt){for(var Bt=nt(ct);Bt!==null;){if(Bt.callback===null)it(ct);else if(Bt.startTime<=Nt)it(ct),Bt.sortIndex=Bt.expirationTime,et(lt,Bt);else break;Bt=nt(ct)}}function xt(Nt){if(gt=!1,vt(Nt),!mt)if(nt(lt)!==null)mt=!0,Ct(St);else{var Bt=nt(ct);Bt!==null&&Ut(xt,Bt.startTime-Nt)}}function St(Nt,Bt){mt=!1,gt&&(gt=!1,yt(It),It=-1),pt=!0;var Mt=dt;try{for(vt(Bt),ht=nt(lt);ht!==null&&(!(ht.expirationTime>Bt)||Nt&&!zt());){var Dt=ht.callback;if(typeof Dt=="function"){ht.callback=null,dt=ht.priorityLevel;var Pt=Dt(ht.expirationTime<=Bt);Bt=tt.unstable_now(),typeof Pt=="function"?ht.callback=Pt:ht===nt(lt)&&it(lt),vt(Bt)}else it(lt);ht=nt(lt)}if(ht!==null)var Vt=!0;else{var nn=nt(ct);nn!==null&&Ut(xt,nn.startTime-Bt),Vt=!1}return Vt}finally{ht=null,dt=Mt,pt=!1}}var Et=!1,$t=null,It=-1,Ft=5,Ht=-1;function zt(){return!(tt.unstable_now()-HtNt||125Dt?(Nt.sortIndex=Mt,et(ct,Nt),nt(lt)===null&&Nt===nt(ct)&&(gt?(yt(It),It=-1):gt=!0,Ut(xt,Mt-Dt))):(Nt.sortIndex=Pt,et(lt,Nt),mt||pt||(mt=!0,Ct(St))),Nt},tt.unstable_shouldYield=zt,tt.unstable_wrapCallback=function(Nt){var Bt=dt;return function(){var Mt=dt;dt=Bt;try{return Nt.apply(this,arguments)}finally{dt=Mt}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** * @license React * react-reconciler.production.min.js * @@ -3903,17 +3903,17 @@ function print() { __p += __j.call(arguments, '') } * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var reactReconciler_production_min=function tt(et){var nt={},it=reactExports,rt=schedulerExports,ot=Object.assign;function at(Ft){for(var zt="https://reactjs.org/docs/error-decoder.html?invariant="+Ft,Gt=1;Gttr||mn[Gn]!==An[tr]){var vr=` -`+mn[Gn].replace(" at new "," at ");return Ft.displayName&&vr.includes("")&&(vr=vr.replace("",Ft.displayName)),vr}while(1<=Gn&&0<=tr);break}}}finally{Dr=!1,Error.prepareStackTrace=Gt}return(Ft=Ft?Ft.displayName||Ft.name:"")?$r(Ft):""}var Ar=Object.prototype.hasOwnProperty,Nr=[],Fr=-1;function Pr(Ft){return{current:Ft}}function _i(Ft){0>Fr||(Ft.current=Nr[Fr],Nr[Fr]=null,Fr--)}function nr(Ft,zt){Fr++,Nr[Fr]=Ft.current,Ft.current=zt}var xr={},cr=Pr(xr),yr=Pr(!1),Ir=xr;function io(Ft,zt){var Gt=Ft.type.contextTypes;if(!Gt)return xr;var en=Ft.stateNode;if(en&&en.__reactInternalMemoizedUnmaskedChildContext===zt)return en.__reactInternalMemoizedMaskedChildContext;var mn={},An;for(An in Gt)mn[An]=zt[An];return en&&(Ft=Ft.stateNode,Ft.__reactInternalMemoizedUnmaskedChildContext=zt,Ft.__reactInternalMemoizedMaskedChildContext=mn),mn}function so(Ft){return Ft=Ft.childContextTypes,Ft!=null}function fo(){_i(yr),_i(cr)}function po(Ft,zt,Gt){if(cr.current!==xr)throw Error(at(168));nr(cr,zt),nr(yr,Gt)}function Yn(Ft,zt,Gt){var en=Ft.stateNode;if(zt=zt.childContextTypes,typeof en.getChildContext!="function")return Gt;en=en.getChildContext();for(var mn in en)if(!(mn in zt))throw Error(at(108,Tt(Ft)||"Unknown",mn));return ot({},Gt,en)}function vo(Ft){return Ft=(Ft=Ft.stateNode)&&Ft.__reactInternalMemoizedMergedChildContext||xr,Ir=cr.current,nr(cr,Ft),nr(yr,yr.current),!0}function _o(Ft,zt,Gt){var en=Ft.stateNode;if(!en)throw Error(at(169));Gt?(Ft=Yn(Ft,zt,Ir),en.__reactInternalMemoizedMergedChildContext=Ft,_i(yr),_i(cr),nr(cr,Ft)):_i(yr),nr(yr,Gt)}var xo=Math.clz32?Math.clz32:Ro,bo=Math.log,$o=Math.LN2;function Ro(Ft){return Ft>>>=0,Ft===0?32:31-(bo(Ft)/$o|0)|0}var Wo=64,Po=4194304;function Fo(Ft){switch(Ft&-Ft){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 Ft&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return Ft&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return Ft}}function Go(Ft,zt){var Gt=Ft.pendingLanes;if(Gt===0)return 0;var en=0,mn=Ft.suspendedLanes,An=Ft.pingedLanes,Gn=Gt&268435455;if(Gn!==0){var tr=Gn&~mn;tr!==0?en=Fo(tr):(An&=Gn,An!==0&&(en=Fo(An)))}else Gn=Gt&~mn,Gn!==0?en=Fo(Gn):An!==0&&(en=Fo(An));if(en===0)return 0;if(zt!==0&&zt!==en&&!(zt&mn)&&(mn=en&-en,An=zt&-zt,mn>=An||mn===16&&(An&4194240)!==0))return zt;if(en&4&&(en|=Gt&16),zt=Ft.entangledLanes,zt!==0)for(Ft=Ft.entanglements,zt&=en;0Gt;Gt++)zt.push(Ft);return zt}function Jo(Ft,zt,Gt){Ft.pendingLanes|=zt,zt!==536870912&&(Ft.suspendedLanes=0,Ft.pingedLanes=0),Ft=Ft.eventTimes,zt=31-xo(zt),Ft[zt]=Gt}function pu(Ft,zt){var Gt=Ft.pendingLanes&~zt;Ft.pendingLanes=zt,Ft.suspendedLanes=0,Ft.pingedLanes=0,Ft.expiredLanes&=zt,Ft.mutableReadLanes&=zt,Ft.entangledLanes&=zt,zt=Ft.entanglements;var en=Ft.eventTimes;for(Ft=Ft.expirationTimes;0>=Gn,mn-=Gn,bu=1<<32-xo(zt)+mn|Gt<jo?(ms=Ao,Ao=null):ms=Ao.sibling;var zo=ho(lr,Ao,gr[jo],eo);if(zo===null){Ao===null&&(Ao=ms);break}Ft&&Ao&&zo.alternate===null&&zt(lr,Ao),ir=An(zo,ir,jo),Oo===null?co=zo:Oo.sibling=zo,Oo=zo,Ao=ms}if(jo===gr.length)return Gt(lr,Ao),_a&&wu(lr,jo),co;if(Ao===null){for(;jojo?(ms=Ao,Ao=null):ms=Ao.sibling;var hu=ho(lr,Ao,zo.value,eo);if(hu===null){Ao===null&&(Ao=ms);break}Ft&&Ao&&hu.alternate===null&&zt(lr,Ao),ir=An(hu,ir,jo),Oo===null?co=hu:Oo.sibling=hu,Oo=hu,Ao=ms}if(zo.done)return Gt(lr,Ao),_a&&wu(lr,jo),co;if(Ao===null){for(;!zo.done;jo++,zo=gr.next())zo=Io(lr,zo.value,eo),zo!==null&&(ir=An(zo,ir,jo),Oo===null?co=zo:Oo.sibling=zo,Oo=zo);return _a&&wu(lr,jo),co}for(Ao=en(lr,Ao);!zo.done;jo++,zo=gr.next())zo=Zo(Ao,lr,jo,zo.value,eo),zo!==null&&(Ft&&zo.alternate!==null&&Ao.delete(zo.key===null?jo:zo.key),ir=An(zo,ir,jo),Oo===null?co=zo:Oo.sibling=zo,Oo=zo);return Ft&&Ao.forEach(function(V0){return zt(lr,V0)}),_a&&wu(lr,jo),co}function Tl(lr,ir,gr,eo){if(typeof gr=="object"&&gr!==null&&gr.type===ut&&gr.key===null&&(gr=gr.props.children),typeof gr=="object"&&gr!==null){switch(gr.$$typeof){case lt:e:{for(var co=gr.key,Oo=ir;Oo!==null;){if(Oo.key===co){if(co=gr.type,co===ut){if(Oo.tag===7){Gt(lr,Oo.sibling),ir=mn(Oo,gr.props.children),ir.return=lr,lr=ir;break e}}else if(Oo.elementType===co||typeof co=="object"&&co!==null&&co.$$typeof===vt&&Hp(co)===Oo.type){Gt(lr,Oo.sibling),ir=mn(Oo,gr.props),ir.ref=fp(lr,Oo,gr),ir.return=lr,lr=ir;break e}Gt(lr,Oo);break}else zt(lr,Oo);Oo=Oo.sibling}gr.type===ut?(ir=zu(gr.props.children,lr.mode,eo,gr.key),ir.return=lr,lr=ir):(eo=z0(gr.type,gr.key,gr.props,null,lr.mode,eo),eo.ref=fp(lr,ir,gr),eo.return=lr,lr=eo)}return Gn(lr);case ct:e:{for(Oo=gr.key;ir!==null;){if(ir.key===Oo)if(ir.tag===4&&ir.stateNode.containerInfo===gr.containerInfo&&ir.stateNode.implementation===gr.implementation){Gt(lr,ir.sibling),ir=mn(ir,gr.children||[]),ir.return=lr,lr=ir;break e}else{Gt(lr,ir);break}else zt(lr,ir);ir=ir.sibling}ir=Rl(gr,lr.mode,eo),ir.return=lr,lr=ir}return Gn(lr);case vt:return Oo=gr._init,Tl(lr,ir,Oo(gr._payload),eo)}if(At(gr))return lo(lr,ir,gr,eo);if(Et(gr))return Ds(lr,ir,gr,eo);Vl(lr,gr)}return typeof gr=="string"&&gr!==""||typeof gr=="number"?(gr=""+gr,ir!==null&&ir.tag===6?(Gt(lr,ir.sibling),ir=mn(ir,gr),ir.return=lr,lr=ir):(Gt(lr,ir),ir=Ls(gr,lr.mode,eo),ir.return=lr,lr=ir),Gn(lr)):Gt(lr,ir)}return Tl}var pp=zm(!0),Wm=zm(!1),iu={},ss=Pr(iu),mp=Pr(iu),gp=Pr(iu);function ru(Ft){if(Ft===iu)throw Error(at(174));return Ft}function tm(Ft,zt){nr(gp,zt),nr(mp,Ft),nr(ss,iu),Ft=Wt(zt),_i(ss),nr(ss,Ft)}function yp(){_i(ss),_i(mp),_i(gp)}function Vm(Ft){var zt=ru(gp.current),Gt=ru(ss.current);zt=jt(Gt,Ft.type,zt),Gt!==zt&&(nr(mp,Ft),nr(ss,zt))}function $u(Ft){mp.current===Ft&&(_i(ss),_i(mp))}var Qn=Pr(0);function Sr(Ft){for(var zt=Ft;zt!==null;){if(zt.tag===13){var Gt=zt.memoizedState;if(Gt!==null&&(Gt=Gt.dehydrated,Gt===null||wn(Gt)||Pn(Gt)))return zt}else if(zt.tag===19&&zt.memoizedProps.revealOrder!==void 0){if(zt.flags&128)return zt}else if(zt.child!==null){zt.child.return=zt,zt=zt.child;continue}if(zt===Ft)break;for(;zt.sibling===null;){if(zt.return===null||zt.return===Ft)return null;zt=zt.return}zt.sibling.return=zt.return,zt=zt.sibling}return null}var pr=[];function ro(){for(var Ft=0;FtGt?Gt:4,Ft(!0);var en=Co.transition;Co.transition={};try{Ft(!1),zt()}finally{Lo=Gt,Co.transition=en}}function Ym(){return Qs().memoizedState}function _s(Ft,zt,Gt){var en=cu(Ft);Gt={lane:en,action:Gt,hasEagerState:!1,eagerState:null,next:null},Km(Ft)?Xm(zt,Gt):(lm(Ft,zt,Gt),Gt=Os(),Ft=Pl(Ft,en,Gt),Ft!==null&&Jm(Ft,zt,en))}function Ms(Ft,zt,Gt){var en=cu(Ft),mn={lane:en,action:Gt,hasEagerState:!1,eagerState:null,next:null};if(Km(Ft))Xm(zt,mn);else{lm(Ft,zt,mn);var An=Ft.alternate;if(Ft.lanes===0&&(An===null||An.lanes===0)&&(An=zt.lastRenderedReducer,An!==null))try{var Gn=zt.lastRenderedState,tr=An(Gn,Gt);if(mn.hasEagerState=!0,mn.eagerState=tr,Js(tr,Gn))return}catch{}finally{}Gt=Os(),Ft=Pl(Ft,en,Gt),Ft!==null&&Jm(Ft,zt,en)}}function Km(Ft){var zt=Ft.alternate;return Ft===ko||zt!==null&&zt===ko}function Xm(Ft,zt){Cu=Gs=!0;var Gt=Ft.pending;Gt===null?zt.next=zt:(zt.next=Gt.next,Gt.next=zt),Ft.pending=zt}function lm(Ft,zt,Gt){fs!==null&&Ft.mode&1&&!(Bo&2)?(Ft=zt.interleaved,Ft===null?(Gt.next=Gt,Zs===null?Zs=[zt]:Zs.push(zt)):(Gt.next=Ft.next,Ft.next=Gt),zt.interleaved=Gt):(Ft=zt.pending,Ft===null?Gt.next=Gt:(Gt.next=Ft.next,Ft.next=Gt),zt.pending=Gt)}function Jm(Ft,zt,Gt){if(Gt&4194240){var en=zt.lanes;en&=Ft.pendingLanes,Gt|=en,zt.lanes=Gt,eu(Ft,Gt)}}var _p={readContext:Vo,useCallback:vs,useContext:vs,useEffect:vs,useImperativeHandle:vs,useInsertionEffect:vs,useLayoutEffect:vs,useMemo:vs,useReducer:vs,useRef:vs,useState:vs,useDebugValue:vs,useDeferredValue:vs,useTransition:vs,useMutableSource:vs,useSyncExternalStore:vs,useId:vs,unstable_isNewReconciler:!1},e0={readContext:Vo,useCallback:function(Ft,zt){return ou().memoizedState=[Ft,zt===void 0?null:zt],Ft},useContext:Vo,useEffect:vp,useImperativeHandle:function(Ft,zt,Gt){return Gt=Gt!=null?Gt.concat([Ft]):null,Mu(4194308,4,Jp.bind(null,zt,Ft),Gt)},useLayoutEffect:function(Ft,zt){return Mu(4194308,4,Ft,zt)},useInsertionEffect:function(Ft,zt){return Mu(4,2,Ft,zt)},useMemo:function(Ft,zt){var Gt=ou();return zt=zt===void 0?null:zt,Ft=Ft(),Gt.memoizedState=[Ft,zt],Ft},useReducer:function(Ft,zt,Gt){var en=ou();return zt=Gt!==void 0?Gt(zt):zt,en.memoizedState=en.baseState=zt,Ft={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ft,lastRenderedState:zt},en.queue=Ft,Ft=Ft.dispatch=_s.bind(null,ko,Ft),[en.memoizedState,Ft]},useRef:function(Ft){var zt=ou();return Ft={current:Ft},zt.memoizedState=Ft},useState:E0,useDebugValue:Qp,useDeferredValue:function(Ft){var zt=E0(Ft),Gt=zt[0],en=zt[1];return vp(function(){var mn=Co.transition;Co.transition={};try{en(Ft)}finally{Co.transition=mn}},[Ft]),Gt},useTransition:function(){var Ft=E0(!1),zt=Ft[0];return Ft=Fy.bind(null,Ft[1]),ou().memoizedState=Ft,[zt,Ft]},useMutableSource:function(){},useSyncExternalStore:function(Ft,zt,Gt){var en=ko,mn=ou();if(_a){if(Gt===void 0)throw Error(at(407));Gt=Gt()}else{if(Gt=zt(),fs===null)throw Error(at(349));es&30||Yp(en,zt,Gt)}mn.memoizedState=Gt;var An={value:Gt,getSnapshot:zt};return mn.queue=An,vp(Kp.bind(null,en,An,Ft),[Ft]),en.flags|=2048,Pu(9,rm.bind(null,en,An,Gt,zt),void 0,null),Gt},useId:function(){var Ft=ou(),zt=fs.identifierPrefix;if(_a){var Gt=Ul,en=bu;Gt=(en&~(1<<32-xo(en)-1)).toString(32)+Gt,zt=":"+zt+"R"+Gt,Gt=Gp++,0l0&&(zt.flags|=128,en=!0,Rs(mn,!1),zt.lanes=4194304)}else{if(!en)if(Ft=Sr(An),Ft!==null){if(zt.flags|=128,en=!0,Ft=Ft.updateQueue,Ft!==null&&(zt.updateQueue=Ft,zt.flags|=4),Rs(mn,!0),mn.tail===null&&mn.tailMode==="hidden"&&!An.alternate&&!_a)return yo(zt),null}else 2*ts()-mn.renderingStartTime>l0&&Gt!==1073741824&&(zt.flags|=128,en=!0,Rs(mn,!1),zt.lanes=4194304);mn.isBackwards?(An.sibling=zt.child,zt.child=An):(Ft=mn.last,Ft!==null?Ft.sibling=An:zt.child=An,mn.last=An)}return mn.tail!==null?(zt=mn.tail,mn.rendering=zt,mn.tail=zt.sibling,mn.renderingStartTime=ts(),zt.sibling=null,Ft=Qn.current,nr(Qn,en?Ft&1|2:Ft&1),zt):(yo(zt),null);case 22:case 23:return Em(),en=zt.memoizedState!==null,Ft!==null&&Ft.memoizedState!==null!==en&&(zt.flags|=8192),en&&zt.mode&1?Sl&1073741824&&(yo(zt),sn&&zt.subtreeFlags&6&&(zt.flags|=8192)):yo(zt),null;case 24:return null;case 25:return null}throw Error(at(156,zt.tag))}var zy=st.ReactCurrentOwner,yl=!1;function cs(Ft,zt,Gt,en){zt.child=Ft===null?Wm(zt,null,Gt,en):pp(zt,Ft.child,Gt,en)}function ty(Ft,zt,Gt,en,mn){Gt=Gt.render;var An=zt.ref;return os(zt,mn),en=qo(Ft,zt,Gt,en,An,mn),Gt=im(),Ft!==null&&!yl?(zt.updateQueue=Ft.updateQueue,zt.flags&=-2053,Ft.lanes&=~mn,xs(Ft,zt,mn)):(_a&&Gt&&x0(zt),zt.flags|=1,cs(Ft,zt,en,mn),zt.child)}function ny(Ft,zt,Gt,en,mn){if(Ft===null){var An=Gt.type;return typeof An=="function"&&!Pm(An)&&An.defaultProps===void 0&&Gt.compare===null&&Gt.defaultProps===void 0?(zt.tag=15,zt.type=An,iy(Ft,zt,An,en,mn)):(Ft=z0(Gt.type,null,en,zt,zt.mode,mn),Ft.ref=zt.ref,Ft.return=zt,zt.child=Ft)}if(An=Ft.child,!(Ft.lanes&mn)){var Gn=An.memoizedProps;if(Gt=Gt.compare,Gt=Gt!==null?Gt:ns,Gt(Gn,en)&&Ft.ref===zt.ref)return xs(Ft,zt,mn)}return zt.flags|=1,Ft=Su(An,en),Ft.ref=zt.ref,Ft.return=zt,zt.child=Ft}function iy(Ft,zt,Gt,en,mn){if(Ft!==null&&ns(Ft.memoizedProps,en)&&Ft.ref===zt.ref)if(yl=!1,(Ft.lanes&mn)!==0)Ft.flags&131072&&(yl=!0);else return zt.lanes=Ft.lanes,xs(Ft,zt,mn);return Hl(Ft,zt,Gt,en,mn)}function ry(Ft,zt,Gt){var en=zt.pendingProps,mn=en.children,An=Ft!==null?Ft.memoizedState:null;if(en.mode==="hidden")if(!(zt.mode&1))zt.memoizedState={baseLanes:0,cachePool:null},nr(Ip,Sl),Sl|=Gt;else if(Gt&1073741824)zt.memoizedState={baseLanes:0,cachePool:null},en=An!==null?An.baseLanes:Gt,nr(Ip,Sl),Sl|=en;else return Ft=An!==null?An.baseLanes|Gt:Gt,zt.lanes=zt.childLanes=1073741824,zt.memoizedState={baseLanes:Ft,cachePool:null},zt.updateQueue=null,nr(Ip,Sl),Sl|=Ft,null;else An!==null?(en=An.baseLanes|Gt,zt.memoizedState=null):en=Gt,nr(Ip,Sl),Sl|=en;return cs(Ft,zt,mn,Gt),zt.child}function oy(Ft,zt){var Gt=zt.ref;(Ft===null&&Gt!==null||Ft!==null&&Ft.ref!==Gt)&&(zt.flags|=512,zt.flags|=2097152)}function Hl(Ft,zt,Gt,en,mn){var An=so(Gt)?Ir:cr.current;return An=io(zt,An),os(zt,mn),Gt=qo(Ft,zt,Gt,en,An,mn),en=im(),Ft!==null&&!yl?(zt.updateQueue=Ft.updateQueue,zt.flags&=-2053,Ft.lanes&=~mn,xs(Ft,zt,mn)):(_a&&en&&x0(zt),zt.flags|=1,cs(Ft,zt,Gt,mn),zt.child)}function ay(Ft,zt,Gt,en,mn){if(so(Gt)){var An=!0;vo(zt)}else An=!1;if(os(zt,mn),zt.stateNode===null)Ft!==null&&(Ft.alternate=null,zt.alternate=null,zt.flags|=2),Lm(zt,Gt,en),cp(zt,Gt,en,mn),en=!0;else if(Ft===null){var Gn=zt.stateNode,tr=zt.memoizedProps;Gn.props=tr;var vr=Gn.context,Wr=Gt.contextType;typeof Wr=="object"&&Wr!==null?Wr=Vo(Wr):(Wr=so(Gt)?Ir:cr.current,Wr=io(zt,Wr));var oo=Gt.getDerivedStateFromProps,Io=typeof oo=="function"||typeof Gn.getSnapshotBeforeUpdate=="function";Io||typeof Gn.UNSAFE_componentWillReceiveProps!="function"&&typeof Gn.componentWillReceiveProps!="function"||(tr!==en||vr!==Wr)&&Z0(zt,Gn,en,Wr),ws=!1;var ho=zt.memoizedState;Gn.state=ho,Dl(zt,en,Gn,mn),vr=zt.memoizedState,tr!==en||ho!==vr||yr.current||ws?(typeof oo=="function"&&(Fp(zt,Gt,oo,en),vr=zt.memoizedState),(tr=ws||Nm(zt,Gt,tr,en,ho,vr,Wr))?(Io||typeof Gn.UNSAFE_componentWillMount!="function"&&typeof Gn.componentWillMount!="function"||(typeof Gn.componentWillMount=="function"&&Gn.componentWillMount(),typeof Gn.UNSAFE_componentWillMount=="function"&&Gn.UNSAFE_componentWillMount()),typeof Gn.componentDidMount=="function"&&(zt.flags|=4194308)):(typeof Gn.componentDidMount=="function"&&(zt.flags|=4194308),zt.memoizedProps=en,zt.memoizedState=vr),Gn.props=en,Gn.state=vr,Gn.context=Wr,en=tr):(typeof Gn.componentDidMount=="function"&&(zt.flags|=4194308),en=!1)}else{Gn=zt.stateNode,J0(Ft,zt),tr=zt.memoizedProps,Wr=zt.type===zt.elementType?tr:ls(zt.type,tr),Gn.props=Wr,Io=zt.pendingProps,ho=Gn.context,vr=Gt.contextType,typeof vr=="object"&&vr!==null?vr=Vo(vr):(vr=so(Gt)?Ir:cr.current,vr=io(zt,vr));var Zo=Gt.getDerivedStateFromProps;(oo=typeof Zo=="function"||typeof Gn.getSnapshotBeforeUpdate=="function")||typeof Gn.UNSAFE_componentWillReceiveProps!="function"&&typeof Gn.componentWillReceiveProps!="function"||(tr!==Io||ho!==vr)&&Z0(zt,Gn,en,vr),ws=!1,ho=zt.memoizedState,Gn.state=ho,Dl(zt,en,Gn,mn);var lo=zt.memoizedState;tr!==Io||ho!==lo||yr.current||ws?(typeof Zo=="function"&&(Fp(zt,Gt,Zo,en),lo=zt.memoizedState),(Wr=ws||Nm(zt,Gt,Wr,en,ho,lo,vr)||!1)?(oo||typeof Gn.UNSAFE_componentWillUpdate!="function"&&typeof Gn.componentWillUpdate!="function"||(typeof Gn.componentWillUpdate=="function"&&Gn.componentWillUpdate(en,lo,vr),typeof Gn.UNSAFE_componentWillUpdate=="function"&&Gn.UNSAFE_componentWillUpdate(en,lo,vr)),typeof Gn.componentDidUpdate=="function"&&(zt.flags|=4),typeof Gn.getSnapshotBeforeUpdate=="function"&&(zt.flags|=1024)):(typeof Gn.componentDidUpdate!="function"||tr===Ft.memoizedProps&&ho===Ft.memoizedState||(zt.flags|=4),typeof Gn.getSnapshotBeforeUpdate!="function"||tr===Ft.memoizedProps&&ho===Ft.memoizedState||(zt.flags|=1024),zt.memoizedProps=en,zt.memoizedState=lo),Gn.props=en,Gn.state=lo,Gn.context=vr,en=Wr):(typeof Gn.componentDidUpdate!="function"||tr===Ft.memoizedProps&&ho===Ft.memoizedState||(zt.flags|=4),typeof Gn.getSnapshotBeforeUpdate!="function"||tr===Ft.memoizedProps&&ho===Ft.memoizedState||(zt.flags|=1024),en=!1)}return um(Ft,zt,Gt,en,An,mn)}function um(Ft,zt,Gt,en,mn,An){oy(Ft,zt);var Gn=(zt.flags&128)!==0;if(!en&&!Gn)return mn&&_o(zt,Gt,!1),xs(Ft,zt,An);en=zt.stateNode,zy.current=zt;var tr=Gn&&typeof Gt.getDerivedStateFromError!="function"?null:en.render();return zt.flags|=1,Ft!==null&&Gn?(zt.child=pp(zt,Ft.child,null,An),zt.child=pp(zt,null,tr,An)):cs(Ft,zt,tr,An),zt.memoizedState=en.state,mn&&_o(zt,Gt,!0),zt.child}function sy(Ft){var zt=Ft.stateNode;zt.pendingContext?po(Ft,zt.pendingContext,zt.pendingContext!==zt.context):zt.context&&po(Ft,zt.context,!1),tm(Ft,zt.containerInfo)}function ly(Ft,zt,Gt,en,mn){return dp(),Vp(mn),zt.flags|=256,cs(Ft,zt,Gt,en),zt.child}var I0={dehydrated:null,treeContext:null,retryLane:0};function Cl(Ft){return{baseLanes:Ft,cachePool:null}}function cy(Ft,zt,Gt){var en=zt.pendingProps,mn=Qn.current,An=!1,Gn=(zt.flags&128)!==0,tr;if((tr=Gn)||(tr=Ft!==null&&Ft.memoizedState===null?!1:(mn&2)!==0),tr?(An=!0,zt.flags&=-129):(Ft===null||Ft.memoizedState!==null)&&(mn|=1),nr(Qn,mn&1),Ft===null)return em(zt),Ft=zt.memoizedState,Ft!==null&&(Ft=Ft.dehydrated,Ft!==null)?(zt.mode&1?Pn(Ft)?zt.lanes=8:zt.lanes=1073741824:zt.lanes=1,null):(mn=en.children,Ft=en.fallback,An?(en=zt.mode,An=zt.child,mn={mode:"hidden",children:mn},!(en&1)&&An!==null?(An.childLanes=0,An.pendingProps=mn):An=f0(mn,en,0,null),Ft=zu(Ft,en,Gt,null),An.return=zt,Ft.return=zt,An.sibling=Ft,zt.child=An,zt.child.memoizedState=Cl(Gt),zt.memoizedState=I0,Ft):hm(zt,mn));if(mn=Ft.memoizedState,mn!==null){if(tr=mn.dehydrated,tr!==null){if(Gn)return zt.flags&256?(zt.flags&=-257,A0(Ft,zt,Gt,Error(at(422)))):zt.memoizedState!==null?(zt.child=Ft.child,zt.flags|=128,null):(An=en.fallback,mn=zt.mode,en=f0({mode:"visible",children:en.children},mn,0,null),An=zu(An,mn,Gt,null),An.flags|=2,en.return=zt,An.return=zt,en.sibling=An,zt.child=en,zt.mode&1&&pp(zt,Ft.child,null,Gt),zt.child.memoizedState=Cl(Gt),zt.memoizedState=I0,An);if(!(zt.mode&1))zt=A0(Ft,zt,Gt,null);else if(Pn(tr))zt=A0(Ft,zt,Gt,Error(at(419)));else if(en=(Gt&Ft.childLanes)!==0,yl||en){if(en=fs,en!==null){switch(Gt&-Gt){case 4:An=2;break;case 16:An=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:An=32;break;case 536870912:An=268435456;break;default:An=0}en=An&(en.suspendedLanes|Gt)?0:An,en!==0&&en!==mn.retryLane&&(mn.retryLane=en,Pl(Ft,en,-1))}D0(),zt=A0(Ft,zt,Gt,Error(at(421)))}else wn(tr)?(zt.flags|=128,zt.child=Ft.child,zt=Uu.bind(null,Ft),fn(tr,zt),zt=null):(Gt=mn.treeContext,Sn&&(As=Dn(tr),Hs=zt,_a=!0,Wl=null,hp=!1,Gt!==null&&(qs[Ys++]=bu,qs[Ys++]=Ul,qs[Ys++]=Au,bu=Gt.id,Ul=Gt.overflow,Au=zt)),zt=hm(zt,zt.pendingProps.children),zt.flags|=4096);return zt}return An?(en=hy(Ft,zt,en.children,en.fallback,Gt),An=zt.child,mn=Ft.child.memoizedState,An.memoizedState=mn===null?Cl(Gt):{baseLanes:mn.baseLanes|Gt,cachePool:null},An.childLanes=Ft.childLanes&~Gt,zt.memoizedState=I0,en):(Gt=uy(Ft,zt,en.children,Gt),zt.memoizedState=null,Gt)}return An?(en=hy(Ft,zt,en.children,en.fallback,Gt),An=zt.child,mn=Ft.child.memoizedState,An.memoizedState=mn===null?Cl(Gt):{baseLanes:mn.baseLanes|Gt,cachePool:null},An.childLanes=Ft.childLanes&~Gt,zt.memoizedState=I0,en):(Gt=uy(Ft,zt,en.children,Gt),zt.memoizedState=null,Gt)}function hm(Ft,zt){return zt=f0({mode:"visible",children:zt},Ft.mode,0,null),zt.return=Ft,Ft.child=zt}function uy(Ft,zt,Gt,en){var mn=Ft.child;return Ft=mn.sibling,Gt=Su(mn,{mode:"visible",children:Gt}),!(zt.mode&1)&&(Gt.lanes=en),Gt.return=zt,Gt.sibling=null,Ft!==null&&(en=zt.deletions,en===null?(zt.deletions=[Ft],zt.flags|=16):en.push(Ft)),zt.child=Gt}function hy(Ft,zt,Gt,en,mn){var An=zt.mode;Ft=Ft.child;var Gn=Ft.sibling,tr={mode:"hidden",children:Gt};return!(An&1)&&zt.child!==Ft?(Gt=zt.child,Gt.childLanes=0,Gt.pendingProps=tr,zt.deletions=null):(Gt=Su(Ft,tr),Gt.subtreeFlags=Ft.subtreeFlags&14680064),Gn!==null?en=Su(Gn,en):(en=zu(en,An,mn,null),en.flags|=2),en.return=zt,Gt.return=zt,Gt.sibling=en,zt.child=Gt,en}function A0(Ft,zt,Gt,en){return en!==null&&Vp(en),pp(zt,Ft.child,null,Gt),Ft=hm(zt,zt.pendingProps.children),Ft.flags|=2,zt.memoizedState=null,Ft}function Ru(Ft,zt,Gt){Ft.lanes|=zt;var en=Ft.alternate;en!==null&&(en.lanes|=zt),Cs(Ft.return,zt,Gt)}function dm(Ft,zt,Gt,en,mn){var An=Ft.memoizedState;An===null?Ft.memoizedState={isBackwards:zt,rendering:null,renderingStartTime:0,last:en,tail:Gt,tailMode:mn}:(An.isBackwards=zt,An.rendering=null,An.renderingStartTime=0,An.last=en,An.tail=Gt,An.tailMode=mn)}function dy(Ft,zt,Gt){var en=zt.pendingProps,mn=en.revealOrder,An=en.tail;if(cs(Ft,zt,en.children,Gt),en=Qn.current,en&2)en=en&1|2,zt.flags|=128;else{if(Ft!==null&&Ft.flags&128)e:for(Ft=zt.child;Ft!==null;){if(Ft.tag===13)Ft.memoizedState!==null&&Ru(Ft,Gt,zt);else if(Ft.tag===19)Ru(Ft,Gt,zt);else if(Ft.child!==null){Ft.child.return=Ft,Ft=Ft.child;continue}if(Ft===zt)break e;for(;Ft.sibling===null;){if(Ft.return===null||Ft.return===zt)break e;Ft=Ft.return}Ft.sibling.return=Ft.return,Ft=Ft.sibling}en&=1}if(nr(Qn,en),!(zt.mode&1))zt.memoizedState=null;else switch(mn){case"forwards":for(Gt=zt.child,mn=null;Gt!==null;)Ft=Gt.alternate,Ft!==null&&Sr(Ft)===null&&(mn=Gt),Gt=Gt.sibling;Gt=mn,Gt===null?(mn=zt.child,zt.child=null):(mn=Gt.sibling,Gt.sibling=null),dm(zt,!1,mn,Gt,An);break;case"backwards":for(Gt=null,mn=zt.child,zt.child=null;mn!==null;){if(Ft=mn.alternate,Ft!==null&&Sr(Ft)===null){zt.child=mn;break}Ft=mn.sibling,mn.sibling=Gt,Gt=mn,mn=Ft}dm(zt,!0,Gt,null,An);break;case"together":dm(zt,!1,null,null,void 0);break;default:zt.memoizedState=null}return zt.child}function xs(Ft,zt,Gt){if(Ft!==null&&(zt.dependencies=Ft.dependencies),$p|=zt.lanes,!(Gt&zt.childLanes))return null;if(Ft!==null&&zt.child!==Ft.child)throw Error(at(153));if(zt.child!==null){for(Ft=zt.child,Gt=Su(Ft,Ft.pendingProps),zt.child=Gt,Gt.return=zt;Ft.sibling!==null;)Ft=Ft.sibling,Gt=Gt.sibling=Su(Ft,Ft.pendingProps),Gt.return=zt;Gt.sibling=null}return zt.child}function Wy(Ft,zt,Gt){switch(zt.tag){case 3:sy(zt),dp();break;case 5:Vm(zt);break;case 1:so(zt.type)&&vo(zt);break;case 4:tm(zt,zt.stateNode.containerInfo);break;case 10:Dp(zt,zt.type._context,zt.memoizedProps.value);break;case 13:var en=zt.memoizedState;if(en!==null)return en.dehydrated!==null?(nr(Qn,Qn.current&1),zt.flags|=128,null):Gt&zt.child.childLanes?cy(Ft,zt,Gt):(nr(Qn,Qn.current&1),Ft=xs(Ft,zt,Gt),Ft!==null?Ft.sibling:null);nr(Qn,Qn.current&1);break;case 19:if(en=(Gt&zt.childLanes)!==0,Ft.flags&128){if(en)return dy(Ft,zt,Gt);zt.flags|=128}var mn=zt.memoizedState;if(mn!==null&&(mn.rendering=null,mn.tail=null,mn.lastEffect=null),nr(Qn,Qn.current),en)break;return null;case 22:case 23:return zt.lanes=0,ry(Ft,zt,Gt)}return xs(Ft,zt,Gt)}function Vy(Ft,zt){switch(Vs(zt),zt.tag){case 1:return so(zt.type)&&fo(),Ft=zt.flags,Ft&65536?(zt.flags=Ft&-65537|128,zt):null;case 3:return yp(),_i(yr),_i(cr),ro(),Ft=zt.flags,Ft&65536&&!(Ft&128)?(zt.flags=Ft&-65537|128,zt):null;case 5:return $u(zt),null;case 13:if(_i(Qn),Ft=zt.memoizedState,Ft!==null&&Ft.dehydrated!==null){if(zt.alternate===null)throw Error(at(340));dp()}return Ft=zt.flags,Ft&65536?(zt.flags=Ft&-65537|128,zt):null;case 19:return _i(Qn),null;case 4:return yp(),null;case 10:return bs(zt.type._context),null;case 22:case 23:return Em(),null;case 24:return null;default:return null}}var $0=!1,Zu=!1,Hy=typeof WeakSet=="function"?WeakSet:Set,Yr=null;function r0(Ft,zt){var Gt=Ft.ref;if(Gt!==null)if(typeof Gt=="function")try{Gt(null)}catch(en){Ns(Ft,zt,en)}else Gt.current=null}function fm(Ft,zt,Gt){try{Gt()}catch(en){Ns(Ft,zt,en)}}var fy=!1;function pm(Ft,zt){for(Ot(Ft.containerInfo),Yr=zt;Yr!==null;)if(Ft=Yr,zt=Ft.child,(Ft.subtreeFlags&1028)!==0&&zt!==null)zt.return=Ft,Yr=zt;else for(;Yr!==null;){Ft=Yr;try{var Gt=Ft.alternate;if(Ft.flags&1024)switch(Ft.tag){case 0:case 11:case 15:break;case 1:if(Gt!==null){var en=Gt.memoizedProps,mn=Gt.memoizedState,An=Ft.stateNode,Gn=An.getSnapshotBeforeUpdate(Ft.elementType===Ft.type?en:ls(Ft.type,en),mn);An.__reactInternalSnapshotBeforeUpdate=Gn}break;case 3:sn&&_r(Ft.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(at(163))}}catch(tr){Ns(Ft,Ft.return,tr)}if(zt=Ft.sibling,zt!==null){zt.return=Ft.return,Yr=zt;break}Yr=Ft.return}return Gt=fy,fy=!1,Gt}function Gl(Ft,zt,Gt){var en=zt.updateQueue;if(en=en!==null?en.lastEffect:null,en!==null){var mn=en=en.next;do{if((mn.tag&Ft)===Ft){var An=mn.destroy;mn.destroy=void 0,An!==void 0&&fm(zt,Gt,An)}mn=mn.next}while(mn!==en)}}function Bu(Ft,zt){if(zt=zt.updateQueue,zt=zt!==null?zt.lastEffect:null,zt!==null){var Gt=zt=zt.next;do{if((Gt.tag&Ft)===Ft){var en=Gt.create;Gt.destroy=en()}Gt=Gt.next}while(Gt!==zt)}}function mm(Ft){var zt=Ft.ref;if(zt!==null){var Gt=Ft.stateNode;switch(Ft.tag){case 5:Ft=Rt(Gt);break;default:Ft=Gt}typeof zt=="function"?zt(Ft):zt.current=Ft}}function gm(Ft,zt,Gt){if(Xs&&typeof Xs.onCommitFiberUnmount=="function")try{Xs.onCommitFiberUnmount(Vu,zt)}catch{}switch(zt.tag){case 0:case 11:case 14:case 15:if(Ft=zt.updateQueue,Ft!==null&&(Ft=Ft.lastEffect,Ft!==null)){var en=Ft=Ft.next;do{var mn=en,An=mn.destroy;mn=mn.tag,An!==void 0&&(mn&2||mn&4)&&fm(zt,Gt,An),en=en.next}while(en!==Ft)}break;case 1:if(r0(zt,Gt),Ft=zt.stateNode,typeof Ft.componentWillUnmount=="function")try{Ft.props=zt.memoizedProps,Ft.state=zt.memoizedState,Ft.componentWillUnmount()}catch(Gn){Ns(zt,Gt,Gn)}break;case 5:r0(zt,Gt);break;case 4:sn?bm(Ft,zt,Gt):Zt&&Zt&&(zt=zt.stateNode.containerInfo,Gt=jr(zt),Ur(zt,Gt))}}function my(Ft,zt,Gt){for(var en=zt;;)if(gm(Ft,en,Gt),en.child===null||sn&&en.tag===4){if(en===zt)break;for(;en.sibling===null;){if(en.return===null||en.return===zt)return;en=en.return}en.sibling.return=en.return,en=en.sibling}else en.child.return=en,en=en.child}function lu(Ft){var zt=Ft.alternate;zt!==null&&(Ft.alternate=null,lu(zt)),Ft.child=null,Ft.deletions=null,Ft.sibling=null,Ft.tag===5&&(zt=Ft.stateNode,zt!==null&&Un(zt)),Ft.stateNode=null,Ft.return=null,Ft.dependencies=null,Ft.memoizedProps=null,Ft.memoizedState=null,Ft.pendingProps=null,Ft.stateNode=null,Ft.updateQueue=null}function C0(Ft){return Ft.tag===5||Ft.tag===3||Ft.tag===4}function Ou(Ft){e:for(;;){for(;Ft.sibling===null;){if(Ft.return===null||C0(Ft.return))return null;Ft=Ft.return}for(Ft.sibling.return=Ft.return,Ft=Ft.sibling;Ft.tag!==5&&Ft.tag!==6&&Ft.tag!==18;){if(Ft.flags&2||Ft.child===null||Ft.tag===4)continue e;Ft.child.return=Ft,Ft=Ft.child}if(!(Ft.flags&2))return Ft.stateNode}}function _l(Ft){if(sn){e:{for(var zt=Ft.return;zt!==null;){if(C0(zt))break e;zt=zt.return}throw Error(at(160))}var Gt=zt;switch(Gt.tag){case 5:zt=Gt.stateNode,Gt.flags&32&&(Fn(zt),Gt.flags&=-33),Gt=Ou(Ft),P0(Ft,Gt,zt);break;case 3:case 4:zt=Gt.stateNode.containerInfo,Gt=Ou(Ft),ym(Ft,Gt,zt);break;default:throw Error(at(161))}}}function ym(Ft,zt,Gt){var en=Ft.tag;if(en===5||en===6)Ft=Ft.stateNode,zt?qn(Gt,Ft,zt):Yt(Gt,Ft);else if(en!==4&&(Ft=Ft.child,Ft!==null))for(ym(Ft,zt,Gt),Ft=Ft.sibling;Ft!==null;)ym(Ft,zt,Gt),Ft=Ft.sibling}function P0(Ft,zt,Gt){var en=Ft.tag;if(en===5||en===6)Ft=Ft.stateNode,zt?Nn(Gt,Ft,zt):Kt(Gt,Ft);else if(en!==4&&(Ft=Ft.child,Ft!==null))for(P0(Ft,zt,Gt),Ft=Ft.sibling;Ft!==null;)P0(Ft,zt,Gt),Ft=Ft.sibling}function bm(Ft,zt,Gt){for(var en=zt,mn=!1,An,Gn;;){if(!mn){mn=en.return;e:for(;;){if(mn===null)throw Error(at(160));switch(An=mn.stateNode,mn.tag){case 5:Gn=!1;break e;case 3:An=An.containerInfo,Gn=!0;break e;case 4:An=An.containerInfo,Gn=!0;break e}mn=mn.return}mn=!0}if(en.tag===5||en.tag===6)my(Ft,en,Gt),Gn?Vn(An,en.stateNode):Wn(An,en.stateNode);else if(en.tag===18)Gn?Hr(An,en.stateNode):Or(An,en.stateNode);else if(en.tag===4){if(en.child!==null){An=en.stateNode.containerInfo,Gn=!0,en.child.return=en,en=en.child;continue}}else if(gm(Ft,en,Gt),en.child!==null){en.child.return=en,en=en.child;continue}if(en===zt)break;for(;en.sibling===null;){if(en.return===null||en.return===zt)return;en=en.return,en.tag===4&&(mn=!1)}en.sibling.return=en.return,en=en.sibling}}function Qu(Ft,zt){if(sn){switch(zt.tag){case 0:case 11:case 14:case 15:Gl(3,zt,zt.return),Bu(3,zt),Gl(5,zt,zt.return);return;case 1:return;case 5:var Gt=zt.stateNode;if(Gt!=null){var en=zt.memoizedProps;Ft=Ft!==null?Ft.memoizedProps:en;var mn=zt.type,An=zt.updateQueue;zt.updateQueue=null,An!==null&&Bn(Gt,An,mn,Ft,en,zt)}return;case 6:if(zt.stateNode===null)throw Error(at(162));Gt=zt.memoizedProps,_n(zt.stateNode,Ft!==null?Ft.memoizedProps:Gt,Gt);return;case 3:Sn&&Ft!==null&&Ft.memoizedState.isDehydrated&&Vr(zt.stateNode.containerInfo);return;case 12:return;case 13:Yl(zt);return;case 19:Yl(zt);return;case 17:return}throw Error(at(163))}switch(zt.tag){case 0:case 11:case 14:case 15:Gl(3,zt,zt.return),Bu(3,zt),Gl(5,zt,zt.return);return;case 12:return;case 13:Yl(zt);return;case 19:Yl(zt);return;case 3:Sn&&Ft!==null&&Ft.memoizedState.isDehydrated&&Vr(zt.stateNode.containerInfo);break;case 22:case 23:return}e:if(Zt){switch(zt.tag){case 1:case 5:case 6:break e;case 3:case 4:zt=zt.stateNode,Ur(zt.containerInfo,zt.pendingChildren);break e}throw Error(at(163))}}function Yl(Ft){var zt=Ft.updateQueue;if(zt!==null){Ft.updateQueue=null;var Gt=Ft.stateNode;Gt===null&&(Gt=Ft.stateNode=new Hy),zt.forEach(function(en){var mn=Ey.bind(null,Ft,en);Gt.has(en)||(Gt.add(en),en.then(mn,mn))})}}function gy(Ft,zt){for(Yr=zt;Yr!==null;){zt=Yr;var Gt=zt.deletions;if(Gt!==null)for(var en=0;en";case a0:return":has("+(s0(Ft)||"")+")";case xl:return'[role="'+Ft.value+'"]';case _h:return'"'+Ft.value+'"';case Ep:return'[data-testname="'+Ft.value+'"]';default:throw Error(at(365))}}function by(Ft,zt){var Gt=[];Ft=[Ft,0];for(var en=0;enmn&&(mn=Gn),en&=~An}if(en=mn,en=ts()-en,en=(120>en?120:480>en?480:1080>en?1080:1920>en?1920:3e3>en?3e3:4320>en?4320:1960*qy(en/1960))-en,10Ft?16:Ft,ku===null)var en=!1;else{if(Ft=ku,ku=null,u0=0,Bo&6)throw Error(at(331));var mn=Bo;for(Bo|=4,Yr=Ft.current;Yr!==null;){var An=Yr,Gn=An.child;if(Yr.flags&16){var tr=An.deletions;if(tr!==null){for(var vr=0;vrts()-km?uu(Ft,0):xm|=Gt),mo(Ft,zt)}function Sy(Ft,zt){zt===0&&(Ft.mode&1?(zt=Po,Po<<=1,!(Po&130023424)&&(Po=4194304)):zt=1);var Gt=Os();Ft=Mp(Ft,zt),Ft!==null&&(Jo(Ft,zt,Gt),mo(Ft,Gt))}function Uu(Ft){var zt=Ft.memoizedState,Gt=0;zt!==null&&(Gt=zt.retryLane),Sy(Ft,Gt)}function Ey(Ft,zt){var Gt=0;switch(Ft.tag){case 13:var en=Ft.stateNode,mn=Ft.memoizedState;mn!==null&&(Gt=mn.retryLane);break;case 19:en=Ft.stateNode;break;default:throw Error(at(314))}en!==null&&en.delete(zt),Sy(Ft,Gt)}var Cm;Cm=function(Ft,zt,Gt){if(Ft!==null)if(Ft.memoizedProps!==zt.pendingProps||yr.current)yl=!0;else{if(!(Ft.lanes&Gt)&&!(zt.flags&128))return yl=!1,Wy(Ft,zt,Gt);yl=!!(Ft.flags&131072)}else yl=!1,_a&&zt.flags&1048576&&Dm(zt,zp,zt.index);switch(zt.lanes=0,zt.tag){case 2:var en=zt.type;Ft!==null&&(Ft.alternate=null,zt.alternate=null,zt.flags|=2),Ft=zt.pendingProps;var mn=io(zt,cr.current);os(zt,Gt),mn=qo(null,zt,en,Ft,mn,Gt);var An=im();return zt.flags|=1,typeof mn=="object"&&mn!==null&&typeof mn.render=="function"&&mn.$$typeof===void 0?(zt.tag=1,zt.memoizedState=null,zt.updateQueue=null,so(en)?(An=!0,vo(zt)):An=!1,zt.memoizedState=mn.state!==null&&mn.state!==void 0?mn.state:null,X0(zt),mn.updater=_0,zt.stateNode=mn,mn._reactInternals=zt,cp(zt,en,Ft,Gt),zt=um(null,zt,en,!0,An,Gt)):(zt.tag=0,_a&&An&&x0(zt),cs(null,zt,mn,Gt),zt=zt.child),zt;case 16:en=zt.elementType;e:{switch(Ft!==null&&(Ft.alternate=null,zt.alternate=null,zt.flags|=2),Ft=zt.pendingProps,mn=en._init,en=mn(en._payload),zt.type=en,mn=zt.tag=Ty(en),Ft=ls(en,Ft),mn){case 0:zt=Hl(null,zt,en,Ft,Gt);break e;case 1:zt=ay(null,zt,en,Ft,Gt);break e;case 11:zt=ty(null,zt,en,Ft,Gt);break e;case 14:zt=ny(null,zt,en,ls(en.type,Ft),Gt);break e}throw Error(at(306,en,""))}return zt;case 0:return en=zt.type,mn=zt.pendingProps,mn=zt.elementType===en?mn:ls(en,mn),Hl(Ft,zt,en,mn,Gt);case 1:return en=zt.type,mn=zt.pendingProps,mn=zt.elementType===en?mn:ls(en,mn),ay(Ft,zt,en,mn,Gt);case 3:e:{if(sy(zt),Ft===null)throw Error(at(387));en=zt.pendingProps,An=zt.memoizedState,mn=An.element,J0(Ft,zt),Dl(zt,en,null,Gt);var Gn=zt.memoizedState;if(en=Gn.element,Sn&&An.isDehydrated)if(An={element:en,isDehydrated:!1,cache:Gn.cache,transitions:Gn.transitions},zt.updateQueue.baseState=An,zt.memoizedState=An,zt.flags&256){mn=Error(at(423)),zt=ly(Ft,zt,en,Gt,mn);break e}else if(en!==mn){mn=Error(at(424)),zt=ly(Ft,zt,en,Gt,mn);break e}else for(Sn&&(As=On(zt.stateNode.containerInfo),Hs=zt,_a=!0,Wl=null,hp=!1),Gt=Wm(zt,null,en,Gt),zt.child=Gt;Gt;)Gt.flags=Gt.flags&-3|4096,Gt=Gt.sibling;else{if(dp(),en===mn){zt=xs(Ft,zt,Gt);break e}cs(Ft,zt,en,Gt)}zt=zt.child}return zt;case 5:return Vm(zt),Ft===null&&em(zt),en=zt.type,mn=zt.pendingProps,An=Ft!==null?Ft.memoizedProps:null,Gn=mn.children,rn(en,mn)?Gn=null:An!==null&&rn(en,An)&&(zt.flags|=32),oy(Ft,zt),cs(Ft,zt,Gn,Gt),zt.child;case 6:return Ft===null&&em(zt),null;case 13:return cy(Ft,zt,Gt);case 4:return tm(zt,zt.stateNode.containerInfo),en=zt.pendingProps,Ft===null?zt.child=pp(zt,null,en,Gt):cs(Ft,zt,en,Gt),zt.child;case 11:return en=zt.type,mn=zt.pendingProps,mn=zt.elementType===en?mn:ls(en,mn),ty(Ft,zt,en,mn,Gt);case 7:return cs(Ft,zt,zt.pendingProps,Gt),zt.child;case 8:return cs(Ft,zt,zt.pendingProps.children,Gt),zt.child;case 12:return cs(Ft,zt,zt.pendingProps.children,Gt),zt.child;case 10:e:{if(en=zt.type._context,mn=zt.pendingProps,An=zt.memoizedProps,Gn=mn.value,Dp(zt,en,Gn),An!==null)if(Js(An.value,Gn)){if(An.children===mn.children&&!yr.current){zt=xs(Ft,zt,Gt);break e}}else for(An=zt.child,An!==null&&(An.return=zt);An!==null;){var tr=An.dependencies;if(tr!==null){Gn=An.child;for(var vr=tr.firstContext;vr!==null;){if(vr.context===en){if(An.tag===1){vr=Ps(-1,Gt&-Gt),vr.tag=2;var Wr=An.updateQueue;if(Wr!==null){Wr=Wr.shared;var oo=Wr.pending;oo===null?vr.next=vr:(vr.next=oo.next,oo.next=vr),Wr.pending=vr}}An.lanes|=Gt,vr=An.alternate,vr!==null&&(vr.lanes|=Gt),Cs(An.return,Gt,zt),tr.lanes|=Gt;break}vr=vr.next}}else if(An.tag===10)Gn=An.type===zt.type?null:An.child;else if(An.tag===18){if(Gn=An.return,Gn===null)throw Error(at(341));Gn.lanes|=Gt,tr=Gn.alternate,tr!==null&&(tr.lanes|=Gt),Cs(Gn,Gt,zt),Gn=An.sibling}else Gn=An.child;if(Gn!==null)Gn.return=An;else for(Gn=An;Gn!==null;){if(Gn===zt){Gn=null;break}if(An=Gn.sibling,An!==null){An.return=Gn.return,Gn=An;break}Gn=Gn.return}An=Gn}cs(Ft,zt,mn.children,Gt),zt=zt.child}return zt;case 9:return mn=zt.type,en=zt.pendingProps.children,os(zt,Gt),mn=Vo(mn),en=en(mn),zt.flags|=1,cs(Ft,zt,en,Gt),zt.child;case 14:return en=zt.type,mn=ls(en,zt.pendingProps),mn=ls(en.type,mn),ny(Ft,zt,en,mn,Gt);case 15:return iy(Ft,zt,zt.type,zt.pendingProps,Gt);case 17:return en=zt.type,mn=zt.pendingProps,mn=zt.elementType===en?mn:ls(en,mn),Ft!==null&&(Ft.alternate=null,zt.alternate=null,zt.flags|=2),zt.tag=1,so(en)?(Ft=!0,vo(zt)):Ft=!1,os(zt,Gt),Lm(zt,en,mn),cp(zt,en,mn,Gt),um(null,zt,en,!0,Ft,Gt);case 19:return dy(Ft,zt,Gt);case 22:return ry(Ft,zt,Gt)}throw Error(at(156,zt.tag))};function U0(Ft,zt){return tu(Ft,zt)}function Yy(Ft,zt,Gt,en){this.tag=Ft,this.key=Gt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=zt,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=en,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ml(Ft,zt,Gt,en){return new Yy(Ft,zt,Gt,en)}function Pm(Ft){return Ft=Ft.prototype,!(!Ft||!Ft.isReactComponent)}function Ty(Ft){if(typeof Ft=="function")return Pm(Ft)?1:0;if(Ft!=null){if(Ft=Ft.$$typeof,Ft===gt)return 11;if(Ft===wt)return 14}return 2}function Su(Ft,zt){var Gt=Ft.alternate;return Gt===null?(Gt=Ml(Ft.tag,zt,Ft.key,Ft.mode),Gt.elementType=Ft.elementType,Gt.type=Ft.type,Gt.stateNode=Ft.stateNode,Gt.alternate=Ft,Ft.alternate=Gt):(Gt.pendingProps=zt,Gt.type=Ft.type,Gt.flags=0,Gt.subtreeFlags=0,Gt.deletions=null),Gt.flags=Ft.flags&14680064,Gt.childLanes=Ft.childLanes,Gt.lanes=Ft.lanes,Gt.child=Ft.child,Gt.memoizedProps=Ft.memoizedProps,Gt.memoizedState=Ft.memoizedState,Gt.updateQueue=Ft.updateQueue,zt=Ft.dependencies,Gt.dependencies=zt===null?null:{lanes:zt.lanes,firstContext:zt.firstContext},Gt.sibling=Ft.sibling,Gt.index=Ft.index,Gt.ref=Ft.ref,Gt}function z0(Ft,zt,Gt,en,mn,An){var Gn=2;if(en=Ft,typeof Ft=="function")Pm(Ft)&&(Gn=1);else if(typeof Ft=="string")Gn=5;else e:switch(Ft){case ut:return zu(Gt.children,mn,An,zt);case ht:Gn=8,mn|=8;break;case dt:return Ft=Ml(12,Gt,zt,mn|2),Ft.elementType=dt,Ft.lanes=An,Ft;case bt:return Ft=Ml(13,Gt,zt,mn),Ft.elementType=bt,Ft.lanes=An,Ft;case yt:return Ft=Ml(19,Gt,zt,mn),Ft.elementType=yt,Ft.lanes=An,Ft;case xt:return f0(Gt,mn,An,zt);default:if(typeof Ft=="object"&&Ft!==null)switch(Ft.$$typeof){case pt:Gn=10;break e;case mt:Gn=9;break e;case gt:Gn=11;break e;case wt:Gn=14;break e;case vt:Gn=16,en=null;break e}throw Error(at(130,Ft==null?Ft:typeof Ft,""))}return zt=Ml(Gn,Gt,zt,mn),zt.elementType=Ft,zt.type=en,zt.lanes=An,zt}function zu(Ft,zt,Gt,en){return Ft=Ml(7,Ft,en,zt),Ft.lanes=Gt,Ft}function f0(Ft,zt,Gt,en){return Ft=Ml(22,Ft,en,zt),Ft.elementType=xt,Ft.lanes=Gt,Ft.stateNode={},Ft}function Ls(Ft,zt,Gt){return Ft=Ml(6,Ft,null,zt),Ft.lanes=Gt,Ft}function Rl(Ft,zt,Gt){return zt=Ml(4,Ft.children!==null?Ft.children:[],Ft.key,zt),zt.lanes=Gt,zt.stateNode={containerInfo:Ft.containerInfo,pendingChildren:null,implementation:Ft.implementation},zt}function Ky(Ft,zt,Gt,en,mn){this.tag=zt,this.containerInfo=Ft,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=pn,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$a(0),this.expirationTimes=$a(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$a(0),this.identifierPrefix=en,this.onRecoverableError=mn,Sn&&(this.mutableSourceEagerHydrationData=null)}function Iy(Ft,zt,Gt,en,mn,An,Gn,tr,vr){return Ft=new Ky(Ft,zt,Gt,tr,vr),zt===1?(zt=1,An===!0&&(zt|=8)):zt=0,An=Ml(3,null,null,zt),Ft.current=An,An.stateNode=Ft,An.memoizedState={element:en,isDehydrated:Gt,cache:null,transitions:null},X0(An),Ft}function p0(Ft){if(!Ft)return xr;Ft=Ft._reactInternals;e:{if($t(Ft)!==Ft||Ft.tag!==1)throw Error(at(170));var zt=Ft;do{switch(zt.tag){case 3:zt=zt.stateNode.context;break e;case 1:if(so(zt.type)){zt=zt.stateNode.__reactInternalMemoizedMergedChildContext;break e}}zt=zt.return}while(zt!==null);throw Error(at(171))}if(Ft.tag===1){var Gt=Ft.type;if(so(Gt))return Yn(Ft,Gt,zt)}return zt}function ep(Ft){var zt=Ft._reactInternals;if(zt===void 0)throw typeof Ft.render=="function"?Error(at(188)):(Ft=Object.keys(Ft).join(","),Error(at(268,Ft)));return Ft=Bt(zt),Ft===null?null:Ft.stateNode}function Mm(Ft,zt){if(Ft=Ft.memoizedState,Ft!==null&&Ft.dehydrated!==null){var Gt=Ft.retryLane;Ft.retryLane=Gt!==0&&Gt=Wr&&An>=Io&&mn<=oo&&Gn<=ho){Ft.splice(zt,1);break}else if(en!==Wr||Gt.width!==vr.width||hoGn){if(!(An!==Io||Gt.height!==vr.height||oomn)){Wr>en&&(vr.width+=Wr-en,vr.x=en),ooAn&&(vr.height+=Io-An,vr.y=An),hoGt&&(Gt=Gn)),Gn ")+` + */var reactReconciler_production_min=function tt(et){var nt={},it=reactExports,rt=schedulerExports,ot=Object.assign;function at(Rt){for(var Lt="https://reactjs.org/docs/error-decoder.html?invariant="+Rt,Gt=1;Gttr||pn[Hn]!==$n[tr]){var vr=` +`+pn[Hn].replace(" at new "," at ");return Rt.displayName&&vr.includes("")&&(vr=vr.replace("",Rt.displayName)),vr}while(1<=Hn&&0<=tr);break}}}finally{Dr=!1,Error.prepareStackTrace=Gt}return(Rt=Rt?Rt.displayName||Rt.name:"")?$r(Rt):""}var Ar=Object.prototype.hasOwnProperty,Nr=[],Fr=-1;function Pr(Rt){return{current:Rt}}function _i(Rt){0>Fr||(Rt.current=Nr[Fr],Nr[Fr]=null,Fr--)}function nr(Rt,Lt){Fr++,Nr[Fr]=Rt.current,Rt.current=Lt}var xr={},cr=Pr(xr),yr=Pr(!1),Ir=xr;function io(Rt,Lt){var Gt=Rt.type.contextTypes;if(!Gt)return xr;var Qt=Rt.stateNode;if(Qt&&Qt.__reactInternalMemoizedUnmaskedChildContext===Lt)return Qt.__reactInternalMemoizedMaskedChildContext;var pn={},$n;for($n in Gt)pn[$n]=Lt[$n];return Qt&&(Rt=Rt.stateNode,Rt.__reactInternalMemoizedUnmaskedChildContext=Lt,Rt.__reactInternalMemoizedMaskedChildContext=pn),pn}function so(Rt){return Rt=Rt.childContextTypes,Rt!=null}function fo(){_i(yr),_i(cr)}function po(Rt,Lt,Gt){if(cr.current!==xr)throw Error(at(168));nr(cr,Lt),nr(yr,Gt)}function qn(Rt,Lt,Gt){var Qt=Rt.stateNode;if(Lt=Lt.childContextTypes,typeof Qt.getChildContext!="function")return Gt;Qt=Qt.getChildContext();for(var pn in Qt)if(!(pn in Lt))throw Error(at(108,It(Rt)||"Unknown",pn));return ot({},Gt,Qt)}function vo(Rt){return Rt=(Rt=Rt.stateNode)&&Rt.__reactInternalMemoizedMergedChildContext||xr,Ir=cr.current,nr(cr,Rt),nr(yr,yr.current),!0}function _o(Rt,Lt,Gt){var Qt=Rt.stateNode;if(!Qt)throw Error(at(169));Gt?(Rt=qn(Rt,Lt,Ir),Qt.__reactInternalMemoizedMergedChildContext=Rt,_i(yr),_i(cr),nr(cr,Rt)):_i(yr),nr(yr,Gt)}var xo=Math.clz32?Math.clz32:Ro,bo=Math.log,$o=Math.LN2;function Ro(Rt){return Rt>>>=0,Rt===0?32:31-(bo(Rt)/$o|0)|0}var Wo=64,Po=4194304;function Fo(Rt){switch(Rt&-Rt){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 Rt&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return Rt&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return Rt}}function Go(Rt,Lt){var Gt=Rt.pendingLanes;if(Gt===0)return 0;var Qt=0,pn=Rt.suspendedLanes,$n=Rt.pingedLanes,Hn=Gt&268435455;if(Hn!==0){var tr=Hn&~pn;tr!==0?Qt=Fo(tr):($n&=Hn,$n!==0&&(Qt=Fo($n)))}else Hn=Gt&~pn,Hn!==0?Qt=Fo(Hn):$n!==0&&(Qt=Fo($n));if(Qt===0)return 0;if(Lt!==0&&Lt!==Qt&&!(Lt&pn)&&(pn=Qt&-Qt,$n=Lt&-Lt,pn>=$n||pn===16&&($n&4194240)!==0))return Lt;if(Qt&4&&(Qt|=Gt&16),Lt=Rt.entangledLanes,Lt!==0)for(Rt=Rt.entanglements,Lt&=Qt;0Gt;Gt++)Lt.push(Rt);return Lt}function Jo(Rt,Lt,Gt){Rt.pendingLanes|=Lt,Lt!==536870912&&(Rt.suspendedLanes=0,Rt.pingedLanes=0),Rt=Rt.eventTimes,Lt=31-xo(Lt),Rt[Lt]=Gt}function pu(Rt,Lt){var Gt=Rt.pendingLanes&~Lt;Rt.pendingLanes=Lt,Rt.suspendedLanes=0,Rt.pingedLanes=0,Rt.expiredLanes&=Lt,Rt.mutableReadLanes&=Lt,Rt.entangledLanes&=Lt,Lt=Rt.entanglements;var Qt=Rt.eventTimes;for(Rt=Rt.expirationTimes;0>=Hn,pn-=Hn,bu=1<<32-xo(Lt)+pn|Gt<Oo?(ms=Ao,Ao=null):ms=Ao.sibling;var zo=ho(lr,Ao,gr[Oo],eo);if(zo===null){Ao===null&&(Ao=ms);break}Rt&&Ao&&zo.alternate===null&&Lt(lr,Ao),ir=$n(zo,ir,Oo),jo===null?co=zo:jo.sibling=zo,jo=zo,Ao=ms}if(Oo===gr.length)return Gt(lr,Ao),_a&&wu(lr,Oo),co;if(Ao===null){for(;OoOo?(ms=Ao,Ao=null):ms=Ao.sibling;var hu=ho(lr,Ao,zo.value,eo);if(hu===null){Ao===null&&(Ao=ms);break}Rt&&Ao&&hu.alternate===null&&Lt(lr,Ao),ir=$n(hu,ir,Oo),jo===null?co=hu:jo.sibling=hu,jo=hu,Ao=ms}if(zo.done)return Gt(lr,Ao),_a&&wu(lr,Oo),co;if(Ao===null){for(;!zo.done;Oo++,zo=gr.next())zo=Io(lr,zo.value,eo),zo!==null&&(ir=$n(zo,ir,Oo),jo===null?co=zo:jo.sibling=zo,jo=zo);return _a&&wu(lr,Oo),co}for(Ao=Qt(lr,Ao);!zo.done;Oo++,zo=gr.next())zo=Zo(Ao,lr,Oo,zo.value,eo),zo!==null&&(Rt&&zo.alternate!==null&&Ao.delete(zo.key===null?Oo:zo.key),ir=$n(zo,ir,Oo),jo===null?co=zo:jo.sibling=zo,jo=zo);return Rt&&Ao.forEach(function(V0){return Lt(lr,V0)}),_a&&wu(lr,Oo),co}function Tl(lr,ir,gr,eo){if(typeof gr=="object"&&gr!==null&&gr.type===ut&&gr.key===null&&(gr=gr.props.children),typeof gr=="object"&&gr!==null){switch(gr.$$typeof){case lt:e:{for(var co=gr.key,jo=ir;jo!==null;){if(jo.key===co){if(co=gr.type,co===ut){if(jo.tag===7){Gt(lr,jo.sibling),ir=pn(jo,gr.props.children),ir.return=lr,lr=ir;break e}}else if(jo.elementType===co||typeof co=="object"&&co!==null&&co.$$typeof===vt&&Hp(co)===jo.type){Gt(lr,jo.sibling),ir=pn(jo,gr.props),ir.ref=fp(lr,jo,gr),ir.return=lr,lr=ir;break e}Gt(lr,jo);break}else Lt(lr,jo);jo=jo.sibling}gr.type===ut?(ir=zu(gr.props.children,lr.mode,eo,gr.key),ir.return=lr,lr=ir):(eo=z0(gr.type,gr.key,gr.props,null,lr.mode,eo),eo.ref=fp(lr,ir,gr),eo.return=lr,lr=eo)}return Hn(lr);case ct:e:{for(jo=gr.key;ir!==null;){if(ir.key===jo)if(ir.tag===4&&ir.stateNode.containerInfo===gr.containerInfo&&ir.stateNode.implementation===gr.implementation){Gt(lr,ir.sibling),ir=pn(ir,gr.children||[]),ir.return=lr,lr=ir;break e}else{Gt(lr,ir);break}else Lt(lr,ir);ir=ir.sibling}ir=Rl(gr,lr.mode,eo),ir.return=lr,lr=ir}return Hn(lr);case vt:return jo=gr._init,Tl(lr,ir,jo(gr._payload),eo)}if(Tt(gr))return lo(lr,ir,gr,eo);if(Et(gr))return Ds(lr,ir,gr,eo);Vl(lr,gr)}return typeof gr=="string"&&gr!==""||typeof gr=="number"?(gr=""+gr,ir!==null&&ir.tag===6?(Gt(lr,ir.sibling),ir=pn(ir,gr),ir.return=lr,lr=ir):(Gt(lr,ir),ir=Ls(gr,lr.mode,eo),ir.return=lr,lr=ir),Hn(lr)):Gt(lr,ir)}return Tl}var pp=zm(!0),Wm=zm(!1),iu={},ss=Pr(iu),mp=Pr(iu),gp=Pr(iu);function ru(Rt){if(Rt===iu)throw Error(at(174));return Rt}function tm(Rt,Lt){nr(gp,Lt),nr(mp,Rt),nr(ss,iu),Rt=Ut(Lt),_i(ss),nr(ss,Rt)}function yp(){_i(ss),_i(mp),_i(gp)}function Vm(Rt){var Lt=ru(gp.current),Gt=ru(ss.current);Lt=Nt(Gt,Rt.type,Lt),Gt!==Lt&&(nr(mp,Rt),nr(ss,Lt))}function $u(Rt){mp.current===Rt&&(_i(ss),_i(mp))}var Qn=Pr(0);function Sr(Rt){for(var Lt=Rt;Lt!==null;){if(Lt.tag===13){var Gt=Lt.memoizedState;if(Gt!==null&&(Gt=Gt.dehydrated,Gt===null||vn(Gt)||Pn(Gt)))return Lt}else if(Lt.tag===19&&Lt.memoizedProps.revealOrder!==void 0){if(Lt.flags&128)return Lt}else if(Lt.child!==null){Lt.child.return=Lt,Lt=Lt.child;continue}if(Lt===Rt)break;for(;Lt.sibling===null;){if(Lt.return===null||Lt.return===Rt)return null;Lt=Lt.return}Lt.sibling.return=Lt.return,Lt=Lt.sibling}return null}var pr=[];function ro(){for(var Rt=0;RtGt?Gt:4,Rt(!0);var Qt=Co.transition;Co.transition={};try{Rt(!1),Lt()}finally{Lo=Gt,Co.transition=Qt}}function Ym(){return Qs().memoizedState}function _s(Rt,Lt,Gt){var Qt=cu(Rt);Gt={lane:Qt,action:Gt,hasEagerState:!1,eagerState:null,next:null},Km(Rt)?Xm(Lt,Gt):(lm(Rt,Lt,Gt),Gt=js(),Rt=Pl(Rt,Qt,Gt),Rt!==null&&Jm(Rt,Lt,Qt))}function Ms(Rt,Lt,Gt){var Qt=cu(Rt),pn={lane:Qt,action:Gt,hasEagerState:!1,eagerState:null,next:null};if(Km(Rt))Xm(Lt,pn);else{lm(Rt,Lt,pn);var $n=Rt.alternate;if(Rt.lanes===0&&($n===null||$n.lanes===0)&&($n=Lt.lastRenderedReducer,$n!==null))try{var Hn=Lt.lastRenderedState,tr=$n(Hn,Gt);if(pn.hasEagerState=!0,pn.eagerState=tr,Js(tr,Hn))return}catch{}finally{}Gt=js(),Rt=Pl(Rt,Qt,Gt),Rt!==null&&Jm(Rt,Lt,Qt)}}function Km(Rt){var Lt=Rt.alternate;return Rt===ko||Lt!==null&&Lt===ko}function Xm(Rt,Lt){Cu=Gs=!0;var Gt=Rt.pending;Gt===null?Lt.next=Lt:(Lt.next=Gt.next,Gt.next=Lt),Rt.pending=Lt}function lm(Rt,Lt,Gt){fs!==null&&Rt.mode&1&&!(Bo&2)?(Rt=Lt.interleaved,Rt===null?(Gt.next=Gt,Zs===null?Zs=[Lt]:Zs.push(Lt)):(Gt.next=Rt.next,Rt.next=Gt),Lt.interleaved=Gt):(Rt=Lt.pending,Rt===null?Gt.next=Gt:(Gt.next=Rt.next,Rt.next=Gt),Lt.pending=Gt)}function Jm(Rt,Lt,Gt){if(Gt&4194240){var Qt=Lt.lanes;Qt&=Rt.pendingLanes,Gt|=Qt,Lt.lanes=Gt,eu(Rt,Gt)}}var _p={readContext:Vo,useCallback:vs,useContext:vs,useEffect:vs,useImperativeHandle:vs,useInsertionEffect:vs,useLayoutEffect:vs,useMemo:vs,useReducer:vs,useRef:vs,useState:vs,useDebugValue:vs,useDeferredValue:vs,useTransition:vs,useMutableSource:vs,useSyncExternalStore:vs,useId:vs,unstable_isNewReconciler:!1},e0={readContext:Vo,useCallback:function(Rt,Lt){return ou().memoizedState=[Rt,Lt===void 0?null:Lt],Rt},useContext:Vo,useEffect:vp,useImperativeHandle:function(Rt,Lt,Gt){return Gt=Gt!=null?Gt.concat([Rt]):null,Mu(4194308,4,Jp.bind(null,Lt,Rt),Gt)},useLayoutEffect:function(Rt,Lt){return Mu(4194308,4,Rt,Lt)},useInsertionEffect:function(Rt,Lt){return Mu(4,2,Rt,Lt)},useMemo:function(Rt,Lt){var Gt=ou();return Lt=Lt===void 0?null:Lt,Rt=Rt(),Gt.memoizedState=[Rt,Lt],Rt},useReducer:function(Rt,Lt,Gt){var Qt=ou();return Lt=Gt!==void 0?Gt(Lt):Lt,Qt.memoizedState=Qt.baseState=Lt,Rt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Rt,lastRenderedState:Lt},Qt.queue=Rt,Rt=Rt.dispatch=_s.bind(null,ko,Rt),[Qt.memoizedState,Rt]},useRef:function(Rt){var Lt=ou();return Rt={current:Rt},Lt.memoizedState=Rt},useState:E0,useDebugValue:Qp,useDeferredValue:function(Rt){var Lt=E0(Rt),Gt=Lt[0],Qt=Lt[1];return vp(function(){var pn=Co.transition;Co.transition={};try{Qt(Rt)}finally{Co.transition=pn}},[Rt]),Gt},useTransition:function(){var Rt=E0(!1),Lt=Rt[0];return Rt=Fy.bind(null,Rt[1]),ou().memoizedState=Rt,[Lt,Rt]},useMutableSource:function(){},useSyncExternalStore:function(Rt,Lt,Gt){var Qt=ko,pn=ou();if(_a){if(Gt===void 0)throw Error(at(407));Gt=Gt()}else{if(Gt=Lt(),fs===null)throw Error(at(349));es&30||Yp(Qt,Lt,Gt)}pn.memoizedState=Gt;var $n={value:Gt,getSnapshot:Lt};return pn.queue=$n,vp(Kp.bind(null,Qt,$n,Rt),[Rt]),Qt.flags|=2048,Pu(9,rm.bind(null,Qt,$n,Gt,Lt),void 0,null),Gt},useId:function(){var Rt=ou(),Lt=fs.identifierPrefix;if(_a){var Gt=Ul,Qt=bu;Gt=(Qt&~(1<<32-xo(Qt)-1)).toString(32)+Gt,Lt=":"+Lt+"R"+Gt,Gt=Gp++,0l0&&(Lt.flags|=128,Qt=!0,Rs(pn,!1),Lt.lanes=4194304)}else{if(!Qt)if(Rt=Sr($n),Rt!==null){if(Lt.flags|=128,Qt=!0,Rt=Rt.updateQueue,Rt!==null&&(Lt.updateQueue=Rt,Lt.flags|=4),Rs(pn,!0),pn.tail===null&&pn.tailMode==="hidden"&&!$n.alternate&&!_a)return yo(Lt),null}else 2*ts()-pn.renderingStartTime>l0&&Gt!==1073741824&&(Lt.flags|=128,Qt=!0,Rs(pn,!1),Lt.lanes=4194304);pn.isBackwards?($n.sibling=Lt.child,Lt.child=$n):(Rt=pn.last,Rt!==null?Rt.sibling=$n:Lt.child=$n,pn.last=$n)}return pn.tail!==null?(Lt=pn.tail,pn.rendering=Lt,pn.tail=Lt.sibling,pn.renderingStartTime=ts(),Lt.sibling=null,Rt=Qn.current,nr(Qn,Qt?Rt&1|2:Rt&1),Lt):(yo(Lt),null);case 22:case 23:return Em(),Qt=Lt.memoizedState!==null,Rt!==null&&Rt.memoizedState!==null!==Qt&&(Lt.flags|=8192),Qt&&Lt.mode&1?Sl&1073741824&&(yo(Lt),an&&Lt.subtreeFlags&6&&(Lt.flags|=8192)):yo(Lt),null;case 24:return null;case 25:return null}throw Error(at(156,Lt.tag))}var zy=st.ReactCurrentOwner,yl=!1;function cs(Rt,Lt,Gt,Qt){Lt.child=Rt===null?Wm(Lt,null,Gt,Qt):pp(Lt,Rt.child,Gt,Qt)}function ty(Rt,Lt,Gt,Qt,pn){Gt=Gt.render;var $n=Lt.ref;return os(Lt,pn),Qt=qo(Rt,Lt,Gt,Qt,$n,pn),Gt=im(),Rt!==null&&!yl?(Lt.updateQueue=Rt.updateQueue,Lt.flags&=-2053,Rt.lanes&=~pn,xs(Rt,Lt,pn)):(_a&&Gt&&x0(Lt),Lt.flags|=1,cs(Rt,Lt,Qt,pn),Lt.child)}function ny(Rt,Lt,Gt,Qt,pn){if(Rt===null){var $n=Gt.type;return typeof $n=="function"&&!Pm($n)&&$n.defaultProps===void 0&&Gt.compare===null&&Gt.defaultProps===void 0?(Lt.tag=15,Lt.type=$n,iy(Rt,Lt,$n,Qt,pn)):(Rt=z0(Gt.type,null,Qt,Lt,Lt.mode,pn),Rt.ref=Lt.ref,Rt.return=Lt,Lt.child=Rt)}if($n=Rt.child,!(Rt.lanes&pn)){var Hn=$n.memoizedProps;if(Gt=Gt.compare,Gt=Gt!==null?Gt:ns,Gt(Hn,Qt)&&Rt.ref===Lt.ref)return xs(Rt,Lt,pn)}return Lt.flags|=1,Rt=Su($n,Qt),Rt.ref=Lt.ref,Rt.return=Lt,Lt.child=Rt}function iy(Rt,Lt,Gt,Qt,pn){if(Rt!==null&&ns(Rt.memoizedProps,Qt)&&Rt.ref===Lt.ref)if(yl=!1,(Rt.lanes&pn)!==0)Rt.flags&131072&&(yl=!0);else return Lt.lanes=Rt.lanes,xs(Rt,Lt,pn);return Hl(Rt,Lt,Gt,Qt,pn)}function ry(Rt,Lt,Gt){var Qt=Lt.pendingProps,pn=Qt.children,$n=Rt!==null?Rt.memoizedState:null;if(Qt.mode==="hidden")if(!(Lt.mode&1))Lt.memoizedState={baseLanes:0,cachePool:null},nr(Ip,Sl),Sl|=Gt;else if(Gt&1073741824)Lt.memoizedState={baseLanes:0,cachePool:null},Qt=$n!==null?$n.baseLanes:Gt,nr(Ip,Sl),Sl|=Qt;else return Rt=$n!==null?$n.baseLanes|Gt:Gt,Lt.lanes=Lt.childLanes=1073741824,Lt.memoizedState={baseLanes:Rt,cachePool:null},Lt.updateQueue=null,nr(Ip,Sl),Sl|=Rt,null;else $n!==null?(Qt=$n.baseLanes|Gt,Lt.memoizedState=null):Qt=Gt,nr(Ip,Sl),Sl|=Qt;return cs(Rt,Lt,pn,Gt),Lt.child}function oy(Rt,Lt){var Gt=Lt.ref;(Rt===null&&Gt!==null||Rt!==null&&Rt.ref!==Gt)&&(Lt.flags|=512,Lt.flags|=2097152)}function Hl(Rt,Lt,Gt,Qt,pn){var $n=so(Gt)?Ir:cr.current;return $n=io(Lt,$n),os(Lt,pn),Gt=qo(Rt,Lt,Gt,Qt,$n,pn),Qt=im(),Rt!==null&&!yl?(Lt.updateQueue=Rt.updateQueue,Lt.flags&=-2053,Rt.lanes&=~pn,xs(Rt,Lt,pn)):(_a&&Qt&&x0(Lt),Lt.flags|=1,cs(Rt,Lt,Gt,pn),Lt.child)}function ay(Rt,Lt,Gt,Qt,pn){if(so(Gt)){var $n=!0;vo(Lt)}else $n=!1;if(os(Lt,pn),Lt.stateNode===null)Rt!==null&&(Rt.alternate=null,Lt.alternate=null,Lt.flags|=2),Lm(Lt,Gt,Qt),cp(Lt,Gt,Qt,pn),Qt=!0;else if(Rt===null){var Hn=Lt.stateNode,tr=Lt.memoizedProps;Hn.props=tr;var vr=Hn.context,Wr=Gt.contextType;typeof Wr=="object"&&Wr!==null?Wr=Vo(Wr):(Wr=so(Gt)?Ir:cr.current,Wr=io(Lt,Wr));var oo=Gt.getDerivedStateFromProps,Io=typeof oo=="function"||typeof Hn.getSnapshotBeforeUpdate=="function";Io||typeof Hn.UNSAFE_componentWillReceiveProps!="function"&&typeof Hn.componentWillReceiveProps!="function"||(tr!==Qt||vr!==Wr)&&Z0(Lt,Hn,Qt,Wr),ws=!1;var ho=Lt.memoizedState;Hn.state=ho,Dl(Lt,Qt,Hn,pn),vr=Lt.memoizedState,tr!==Qt||ho!==vr||yr.current||ws?(typeof oo=="function"&&(Fp(Lt,Gt,oo,Qt),vr=Lt.memoizedState),(tr=ws||Nm(Lt,Gt,tr,Qt,ho,vr,Wr))?(Io||typeof Hn.UNSAFE_componentWillMount!="function"&&typeof Hn.componentWillMount!="function"||(typeof Hn.componentWillMount=="function"&&Hn.componentWillMount(),typeof Hn.UNSAFE_componentWillMount=="function"&&Hn.UNSAFE_componentWillMount()),typeof Hn.componentDidMount=="function"&&(Lt.flags|=4194308)):(typeof Hn.componentDidMount=="function"&&(Lt.flags|=4194308),Lt.memoizedProps=Qt,Lt.memoizedState=vr),Hn.props=Qt,Hn.state=vr,Hn.context=Wr,Qt=tr):(typeof Hn.componentDidMount=="function"&&(Lt.flags|=4194308),Qt=!1)}else{Hn=Lt.stateNode,J0(Rt,Lt),tr=Lt.memoizedProps,Wr=Lt.type===Lt.elementType?tr:ls(Lt.type,tr),Hn.props=Wr,Io=Lt.pendingProps,ho=Hn.context,vr=Gt.contextType,typeof vr=="object"&&vr!==null?vr=Vo(vr):(vr=so(Gt)?Ir:cr.current,vr=io(Lt,vr));var Zo=Gt.getDerivedStateFromProps;(oo=typeof Zo=="function"||typeof Hn.getSnapshotBeforeUpdate=="function")||typeof Hn.UNSAFE_componentWillReceiveProps!="function"&&typeof Hn.componentWillReceiveProps!="function"||(tr!==Io||ho!==vr)&&Z0(Lt,Hn,Qt,vr),ws=!1,ho=Lt.memoizedState,Hn.state=ho,Dl(Lt,Qt,Hn,pn);var lo=Lt.memoizedState;tr!==Io||ho!==lo||yr.current||ws?(typeof Zo=="function"&&(Fp(Lt,Gt,Zo,Qt),lo=Lt.memoizedState),(Wr=ws||Nm(Lt,Gt,Wr,Qt,ho,lo,vr)||!1)?(oo||typeof Hn.UNSAFE_componentWillUpdate!="function"&&typeof Hn.componentWillUpdate!="function"||(typeof Hn.componentWillUpdate=="function"&&Hn.componentWillUpdate(Qt,lo,vr),typeof Hn.UNSAFE_componentWillUpdate=="function"&&Hn.UNSAFE_componentWillUpdate(Qt,lo,vr)),typeof Hn.componentDidUpdate=="function"&&(Lt.flags|=4),typeof Hn.getSnapshotBeforeUpdate=="function"&&(Lt.flags|=1024)):(typeof Hn.componentDidUpdate!="function"||tr===Rt.memoizedProps&&ho===Rt.memoizedState||(Lt.flags|=4),typeof Hn.getSnapshotBeforeUpdate!="function"||tr===Rt.memoizedProps&&ho===Rt.memoizedState||(Lt.flags|=1024),Lt.memoizedProps=Qt,Lt.memoizedState=lo),Hn.props=Qt,Hn.state=lo,Hn.context=vr,Qt=Wr):(typeof Hn.componentDidUpdate!="function"||tr===Rt.memoizedProps&&ho===Rt.memoizedState||(Lt.flags|=4),typeof Hn.getSnapshotBeforeUpdate!="function"||tr===Rt.memoizedProps&&ho===Rt.memoizedState||(Lt.flags|=1024),Qt=!1)}return um(Rt,Lt,Gt,Qt,$n,pn)}function um(Rt,Lt,Gt,Qt,pn,$n){oy(Rt,Lt);var Hn=(Lt.flags&128)!==0;if(!Qt&&!Hn)return pn&&_o(Lt,Gt,!1),xs(Rt,Lt,$n);Qt=Lt.stateNode,zy.current=Lt;var tr=Hn&&typeof Gt.getDerivedStateFromError!="function"?null:Qt.render();return Lt.flags|=1,Rt!==null&&Hn?(Lt.child=pp(Lt,Rt.child,null,$n),Lt.child=pp(Lt,null,tr,$n)):cs(Rt,Lt,tr,$n),Lt.memoizedState=Qt.state,pn&&_o(Lt,Gt,!0),Lt.child}function sy(Rt){var Lt=Rt.stateNode;Lt.pendingContext?po(Rt,Lt.pendingContext,Lt.pendingContext!==Lt.context):Lt.context&&po(Rt,Lt.context,!1),tm(Rt,Lt.containerInfo)}function ly(Rt,Lt,Gt,Qt,pn){return dp(),Vp(pn),Lt.flags|=256,cs(Rt,Lt,Gt,Qt),Lt.child}var I0={dehydrated:null,treeContext:null,retryLane:0};function Cl(Rt){return{baseLanes:Rt,cachePool:null}}function cy(Rt,Lt,Gt){var Qt=Lt.pendingProps,pn=Qn.current,$n=!1,Hn=(Lt.flags&128)!==0,tr;if((tr=Hn)||(tr=Rt!==null&&Rt.memoizedState===null?!1:(pn&2)!==0),tr?($n=!0,Lt.flags&=-129):(Rt===null||Rt.memoizedState!==null)&&(pn|=1),nr(Qn,pn&1),Rt===null)return em(Lt),Rt=Lt.memoizedState,Rt!==null&&(Rt=Rt.dehydrated,Rt!==null)?(Lt.mode&1?Pn(Rt)?Lt.lanes=8:Lt.lanes=1073741824:Lt.lanes=1,null):(pn=Qt.children,Rt=Qt.fallback,$n?(Qt=Lt.mode,$n=Lt.child,pn={mode:"hidden",children:pn},!(Qt&1)&&$n!==null?($n.childLanes=0,$n.pendingProps=pn):$n=f0(pn,Qt,0,null),Rt=zu(Rt,Qt,Gt,null),$n.return=Lt,Rt.return=Lt,$n.sibling=Rt,Lt.child=$n,Lt.child.memoizedState=Cl(Gt),Lt.memoizedState=I0,Rt):hm(Lt,pn));if(pn=Rt.memoizedState,pn!==null){if(tr=pn.dehydrated,tr!==null){if(Hn)return Lt.flags&256?(Lt.flags&=-257,A0(Rt,Lt,Gt,Error(at(422)))):Lt.memoizedState!==null?(Lt.child=Rt.child,Lt.flags|=128,null):($n=Qt.fallback,pn=Lt.mode,Qt=f0({mode:"visible",children:Qt.children},pn,0,null),$n=zu($n,pn,Gt,null),$n.flags|=2,Qt.return=Lt,$n.return=Lt,Qt.sibling=$n,Lt.child=Qt,Lt.mode&1&&pp(Lt,Rt.child,null,Gt),Lt.child.memoizedState=Cl(Gt),Lt.memoizedState=I0,$n);if(!(Lt.mode&1))Lt=A0(Rt,Lt,Gt,null);else if(Pn(tr))Lt=A0(Rt,Lt,Gt,Error(at(419)));else if(Qt=(Gt&Rt.childLanes)!==0,yl||Qt){if(Qt=fs,Qt!==null){switch(Gt&-Gt){case 4:$n=2;break;case 16:$n=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:$n=32;break;case 536870912:$n=268435456;break;default:$n=0}Qt=$n&(Qt.suspendedLanes|Gt)?0:$n,Qt!==0&&Qt!==pn.retryLane&&(pn.retryLane=Qt,Pl(Rt,Qt,-1))}D0(),Lt=A0(Rt,Lt,Gt,Error(at(421)))}else vn(tr)?(Lt.flags|=128,Lt.child=Rt.child,Lt=Uu.bind(null,Rt),hn(tr,Lt),Lt=null):(Gt=pn.treeContext,En&&(As=Dn(tr),Hs=Lt,_a=!0,Wl=null,hp=!1,Gt!==null&&(qs[Ys++]=bu,qs[Ys++]=Ul,qs[Ys++]=Au,bu=Gt.id,Ul=Gt.overflow,Au=Lt)),Lt=hm(Lt,Lt.pendingProps.children),Lt.flags|=4096);return Lt}return $n?(Qt=hy(Rt,Lt,Qt.children,Qt.fallback,Gt),$n=Lt.child,pn=Rt.child.memoizedState,$n.memoizedState=pn===null?Cl(Gt):{baseLanes:pn.baseLanes|Gt,cachePool:null},$n.childLanes=Rt.childLanes&~Gt,Lt.memoizedState=I0,Qt):(Gt=uy(Rt,Lt,Qt.children,Gt),Lt.memoizedState=null,Gt)}return $n?(Qt=hy(Rt,Lt,Qt.children,Qt.fallback,Gt),$n=Lt.child,pn=Rt.child.memoizedState,$n.memoizedState=pn===null?Cl(Gt):{baseLanes:pn.baseLanes|Gt,cachePool:null},$n.childLanes=Rt.childLanes&~Gt,Lt.memoizedState=I0,Qt):(Gt=uy(Rt,Lt,Qt.children,Gt),Lt.memoizedState=null,Gt)}function hm(Rt,Lt){return Lt=f0({mode:"visible",children:Lt},Rt.mode,0,null),Lt.return=Rt,Rt.child=Lt}function uy(Rt,Lt,Gt,Qt){var pn=Rt.child;return Rt=pn.sibling,Gt=Su(pn,{mode:"visible",children:Gt}),!(Lt.mode&1)&&(Gt.lanes=Qt),Gt.return=Lt,Gt.sibling=null,Rt!==null&&(Qt=Lt.deletions,Qt===null?(Lt.deletions=[Rt],Lt.flags|=16):Qt.push(Rt)),Lt.child=Gt}function hy(Rt,Lt,Gt,Qt,pn){var $n=Lt.mode;Rt=Rt.child;var Hn=Rt.sibling,tr={mode:"hidden",children:Gt};return!($n&1)&&Lt.child!==Rt?(Gt=Lt.child,Gt.childLanes=0,Gt.pendingProps=tr,Lt.deletions=null):(Gt=Su(Rt,tr),Gt.subtreeFlags=Rt.subtreeFlags&14680064),Hn!==null?Qt=Su(Hn,Qt):(Qt=zu(Qt,$n,pn,null),Qt.flags|=2),Qt.return=Lt,Gt.return=Lt,Gt.sibling=Qt,Lt.child=Gt,Qt}function A0(Rt,Lt,Gt,Qt){return Qt!==null&&Vp(Qt),pp(Lt,Rt.child,null,Gt),Rt=hm(Lt,Lt.pendingProps.children),Rt.flags|=2,Lt.memoizedState=null,Rt}function Ru(Rt,Lt,Gt){Rt.lanes|=Lt;var Qt=Rt.alternate;Qt!==null&&(Qt.lanes|=Lt),Cs(Rt.return,Lt,Gt)}function dm(Rt,Lt,Gt,Qt,pn){var $n=Rt.memoizedState;$n===null?Rt.memoizedState={isBackwards:Lt,rendering:null,renderingStartTime:0,last:Qt,tail:Gt,tailMode:pn}:($n.isBackwards=Lt,$n.rendering=null,$n.renderingStartTime=0,$n.last=Qt,$n.tail=Gt,$n.tailMode=pn)}function dy(Rt,Lt,Gt){var Qt=Lt.pendingProps,pn=Qt.revealOrder,$n=Qt.tail;if(cs(Rt,Lt,Qt.children,Gt),Qt=Qn.current,Qt&2)Qt=Qt&1|2,Lt.flags|=128;else{if(Rt!==null&&Rt.flags&128)e:for(Rt=Lt.child;Rt!==null;){if(Rt.tag===13)Rt.memoizedState!==null&&Ru(Rt,Gt,Lt);else if(Rt.tag===19)Ru(Rt,Gt,Lt);else if(Rt.child!==null){Rt.child.return=Rt,Rt=Rt.child;continue}if(Rt===Lt)break e;for(;Rt.sibling===null;){if(Rt.return===null||Rt.return===Lt)break e;Rt=Rt.return}Rt.sibling.return=Rt.return,Rt=Rt.sibling}Qt&=1}if(nr(Qn,Qt),!(Lt.mode&1))Lt.memoizedState=null;else switch(pn){case"forwards":for(Gt=Lt.child,pn=null;Gt!==null;)Rt=Gt.alternate,Rt!==null&&Sr(Rt)===null&&(pn=Gt),Gt=Gt.sibling;Gt=pn,Gt===null?(pn=Lt.child,Lt.child=null):(pn=Gt.sibling,Gt.sibling=null),dm(Lt,!1,pn,Gt,$n);break;case"backwards":for(Gt=null,pn=Lt.child,Lt.child=null;pn!==null;){if(Rt=pn.alternate,Rt!==null&&Sr(Rt)===null){Lt.child=pn;break}Rt=pn.sibling,pn.sibling=Gt,Gt=pn,pn=Rt}dm(Lt,!0,Gt,null,$n);break;case"together":dm(Lt,!1,null,null,void 0);break;default:Lt.memoizedState=null}return Lt.child}function xs(Rt,Lt,Gt){if(Rt!==null&&(Lt.dependencies=Rt.dependencies),$p|=Lt.lanes,!(Gt&Lt.childLanes))return null;if(Rt!==null&&Lt.child!==Rt.child)throw Error(at(153));if(Lt.child!==null){for(Rt=Lt.child,Gt=Su(Rt,Rt.pendingProps),Lt.child=Gt,Gt.return=Lt;Rt.sibling!==null;)Rt=Rt.sibling,Gt=Gt.sibling=Su(Rt,Rt.pendingProps),Gt.return=Lt;Gt.sibling=null}return Lt.child}function Wy(Rt,Lt,Gt){switch(Lt.tag){case 3:sy(Lt),dp();break;case 5:Vm(Lt);break;case 1:so(Lt.type)&&vo(Lt);break;case 4:tm(Lt,Lt.stateNode.containerInfo);break;case 10:Dp(Lt,Lt.type._context,Lt.memoizedProps.value);break;case 13:var Qt=Lt.memoizedState;if(Qt!==null)return Qt.dehydrated!==null?(nr(Qn,Qn.current&1),Lt.flags|=128,null):Gt&Lt.child.childLanes?cy(Rt,Lt,Gt):(nr(Qn,Qn.current&1),Rt=xs(Rt,Lt,Gt),Rt!==null?Rt.sibling:null);nr(Qn,Qn.current&1);break;case 19:if(Qt=(Gt&Lt.childLanes)!==0,Rt.flags&128){if(Qt)return dy(Rt,Lt,Gt);Lt.flags|=128}var pn=Lt.memoizedState;if(pn!==null&&(pn.rendering=null,pn.tail=null,pn.lastEffect=null),nr(Qn,Qn.current),Qt)break;return null;case 22:case 23:return Lt.lanes=0,ry(Rt,Lt,Gt)}return xs(Rt,Lt,Gt)}function Vy(Rt,Lt){switch(Vs(Lt),Lt.tag){case 1:return so(Lt.type)&&fo(),Rt=Lt.flags,Rt&65536?(Lt.flags=Rt&-65537|128,Lt):null;case 3:return yp(),_i(yr),_i(cr),ro(),Rt=Lt.flags,Rt&65536&&!(Rt&128)?(Lt.flags=Rt&-65537|128,Lt):null;case 5:return $u(Lt),null;case 13:if(_i(Qn),Rt=Lt.memoizedState,Rt!==null&&Rt.dehydrated!==null){if(Lt.alternate===null)throw Error(at(340));dp()}return Rt=Lt.flags,Rt&65536?(Lt.flags=Rt&-65537|128,Lt):null;case 19:return _i(Qn),null;case 4:return yp(),null;case 10:return bs(Lt.type._context),null;case 22:case 23:return Em(),null;case 24:return null;default:return null}}var $0=!1,Zu=!1,Hy=typeof WeakSet=="function"?WeakSet:Set,Yr=null;function r0(Rt,Lt){var Gt=Rt.ref;if(Gt!==null)if(typeof Gt=="function")try{Gt(null)}catch(Qt){Ns(Rt,Lt,Qt)}else Gt.current=null}function fm(Rt,Lt,Gt){try{Gt()}catch(Qt){Ns(Rt,Lt,Qt)}}var fy=!1;function pm(Rt,Lt){for(Bt(Rt.containerInfo),Yr=Lt;Yr!==null;)if(Rt=Yr,Lt=Rt.child,(Rt.subtreeFlags&1028)!==0&&Lt!==null)Lt.return=Rt,Yr=Lt;else for(;Yr!==null;){Rt=Yr;try{var Gt=Rt.alternate;if(Rt.flags&1024)switch(Rt.tag){case 0:case 11:case 15:break;case 1:if(Gt!==null){var Qt=Gt.memoizedProps,pn=Gt.memoizedState,$n=Rt.stateNode,Hn=$n.getSnapshotBeforeUpdate(Rt.elementType===Rt.type?Qt:ls(Rt.type,Qt),pn);$n.__reactInternalSnapshotBeforeUpdate=Hn}break;case 3:an&&_r(Rt.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(at(163))}}catch(tr){Ns(Rt,Rt.return,tr)}if(Lt=Rt.sibling,Lt!==null){Lt.return=Rt.return,Yr=Lt;break}Yr=Rt.return}return Gt=fy,fy=!1,Gt}function Gl(Rt,Lt,Gt){var Qt=Lt.updateQueue;if(Qt=Qt!==null?Qt.lastEffect:null,Qt!==null){var pn=Qt=Qt.next;do{if((pn.tag&Rt)===Rt){var $n=pn.destroy;pn.destroy=void 0,$n!==void 0&&fm(Lt,Gt,$n)}pn=pn.next}while(pn!==Qt)}}function Bu(Rt,Lt){if(Lt=Lt.updateQueue,Lt=Lt!==null?Lt.lastEffect:null,Lt!==null){var Gt=Lt=Lt.next;do{if((Gt.tag&Rt)===Rt){var Qt=Gt.create;Gt.destroy=Qt()}Gt=Gt.next}while(Gt!==Lt)}}function mm(Rt){var Lt=Rt.ref;if(Lt!==null){var Gt=Rt.stateNode;switch(Rt.tag){case 5:Rt=Ct(Gt);break;default:Rt=Gt}typeof Lt=="function"?Lt(Rt):Lt.current=Rt}}function gm(Rt,Lt,Gt){if(Xs&&typeof Xs.onCommitFiberUnmount=="function")try{Xs.onCommitFiberUnmount(Vu,Lt)}catch{}switch(Lt.tag){case 0:case 11:case 14:case 15:if(Rt=Lt.updateQueue,Rt!==null&&(Rt=Rt.lastEffect,Rt!==null)){var Qt=Rt=Rt.next;do{var pn=Qt,$n=pn.destroy;pn=pn.tag,$n!==void 0&&(pn&2||pn&4)&&fm(Lt,Gt,$n),Qt=Qt.next}while(Qt!==Rt)}break;case 1:if(r0(Lt,Gt),Rt=Lt.stateNode,typeof Rt.componentWillUnmount=="function")try{Rt.props=Lt.memoizedProps,Rt.state=Lt.memoizedState,Rt.componentWillUnmount()}catch(Hn){Ns(Lt,Gt,Hn)}break;case 5:r0(Lt,Gt);break;case 4:an?bm(Rt,Lt,Gt):Zt&&Zt&&(Lt=Lt.stateNode.containerInfo,Gt=Or(Lt),Ur(Lt,Gt))}}function my(Rt,Lt,Gt){for(var Qt=Lt;;)if(gm(Rt,Qt,Gt),Qt.child===null||an&&Qt.tag===4){if(Qt===Lt)break;for(;Qt.sibling===null;){if(Qt.return===null||Qt.return===Lt)return;Qt=Qt.return}Qt.sibling.return=Qt.return,Qt=Qt.sibling}else Qt.child.return=Qt,Qt=Qt.child}function lu(Rt){var Lt=Rt.alternate;Lt!==null&&(Rt.alternate=null,lu(Lt)),Rt.child=null,Rt.deletions=null,Rt.sibling=null,Rt.tag===5&&(Lt=Rt.stateNode,Lt!==null&&Un(Lt)),Rt.stateNode=null,Rt.return=null,Rt.dependencies=null,Rt.memoizedProps=null,Rt.memoizedState=null,Rt.pendingProps=null,Rt.stateNode=null,Rt.updateQueue=null}function C0(Rt){return Rt.tag===5||Rt.tag===3||Rt.tag===4}function ju(Rt){e:for(;;){for(;Rt.sibling===null;){if(Rt.return===null||C0(Rt.return))return null;Rt=Rt.return}for(Rt.sibling.return=Rt.return,Rt=Rt.sibling;Rt.tag!==5&&Rt.tag!==6&&Rt.tag!==18;){if(Rt.flags&2||Rt.child===null||Rt.tag===4)continue e;Rt.child.return=Rt,Rt=Rt.child}if(!(Rt.flags&2))return Rt.stateNode}}function _l(Rt){if(an){e:{for(var Lt=Rt.return;Lt!==null;){if(C0(Lt))break e;Lt=Lt.return}throw Error(at(160))}var Gt=Lt;switch(Gt.tag){case 5:Lt=Gt.stateNode,Gt.flags&32&&(Fn(Lt),Gt.flags&=-33),Gt=ju(Rt),P0(Rt,Gt,Lt);break;case 3:case 4:Lt=Gt.stateNode.containerInfo,Gt=ju(Rt),ym(Rt,Gt,Lt);break;default:throw Error(at(161))}}}function ym(Rt,Lt,Gt){var Qt=Rt.tag;if(Qt===5||Qt===6)Rt=Rt.stateNode,Lt?Xn(Gt,Rt,Lt):Kt(Gt,Rt);else if(Qt!==4&&(Rt=Rt.child,Rt!==null))for(ym(Rt,Lt,Gt),Rt=Rt.sibling;Rt!==null;)ym(Rt,Lt,Gt),Rt=Rt.sibling}function P0(Rt,Lt,Gt){var Qt=Rt.tag;if(Qt===5||Qt===6)Rt=Rt.stateNode,Lt?Bn(Gt,Rt,Lt):qt(Gt,Rt);else if(Qt!==4&&(Rt=Rt.child,Rt!==null))for(P0(Rt,Lt,Gt),Rt=Rt.sibling;Rt!==null;)P0(Rt,Lt,Gt),Rt=Rt.sibling}function bm(Rt,Lt,Gt){for(var Qt=Lt,pn=!1,$n,Hn;;){if(!pn){pn=Qt.return;e:for(;;){if(pn===null)throw Error(at(160));switch($n=pn.stateNode,pn.tag){case 5:Hn=!1;break e;case 3:$n=$n.containerInfo,Hn=!0;break e;case 4:$n=$n.containerInfo,Hn=!0;break e}pn=pn.return}pn=!0}if(Qt.tag===5||Qt.tag===6)my(Rt,Qt,Gt),Hn?Gn($n,Qt.stateNode):Wn($n,Qt.stateNode);else if(Qt.tag===18)Hn?Hr($n,Qt.stateNode):jr($n,Qt.stateNode);else if(Qt.tag===4){if(Qt.child!==null){$n=Qt.stateNode.containerInfo,Hn=!0,Qt.child.return=Qt,Qt=Qt.child;continue}}else if(gm(Rt,Qt,Gt),Qt.child!==null){Qt.child.return=Qt,Qt=Qt.child;continue}if(Qt===Lt)break;for(;Qt.sibling===null;){if(Qt.return===null||Qt.return===Lt)return;Qt=Qt.return,Qt.tag===4&&(pn=!1)}Qt.sibling.return=Qt.return,Qt=Qt.sibling}}function Qu(Rt,Lt){if(an){switch(Lt.tag){case 0:case 11:case 14:case 15:Gl(3,Lt,Lt.return),Bu(3,Lt),Gl(5,Lt,Lt.return);return;case 1:return;case 5:var Gt=Lt.stateNode;if(Gt!=null){var Qt=Lt.memoizedProps;Rt=Rt!==null?Rt.memoizedProps:Qt;var pn=Lt.type,$n=Lt.updateQueue;Lt.updateQueue=null,$n!==null&&jn(Gt,$n,pn,Rt,Qt,Lt)}return;case 6:if(Lt.stateNode===null)throw Error(at(162));Gt=Lt.memoizedProps,wn(Lt.stateNode,Rt!==null?Rt.memoizedProps:Gt,Gt);return;case 3:En&&Rt!==null&&Rt.memoizedState.isDehydrated&&Vr(Lt.stateNode.containerInfo);return;case 12:return;case 13:Yl(Lt);return;case 19:Yl(Lt);return;case 17:return}throw Error(at(163))}switch(Lt.tag){case 0:case 11:case 14:case 15:Gl(3,Lt,Lt.return),Bu(3,Lt),Gl(5,Lt,Lt.return);return;case 12:return;case 13:Yl(Lt);return;case 19:Yl(Lt);return;case 3:En&&Rt!==null&&Rt.memoizedState.isDehydrated&&Vr(Lt.stateNode.containerInfo);break;case 22:case 23:return}e:if(Zt){switch(Lt.tag){case 1:case 5:case 6:break e;case 3:case 4:Lt=Lt.stateNode,Ur(Lt.containerInfo,Lt.pendingChildren);break e}throw Error(at(163))}}function Yl(Rt){var Lt=Rt.updateQueue;if(Lt!==null){Rt.updateQueue=null;var Gt=Rt.stateNode;Gt===null&&(Gt=Rt.stateNode=new Hy),Lt.forEach(function(Qt){var pn=Ey.bind(null,Rt,Qt);Gt.has(Qt)||(Gt.add(Qt),Qt.then(pn,pn))})}}function gy(Rt,Lt){for(Yr=Lt;Yr!==null;){Lt=Yr;var Gt=Lt.deletions;if(Gt!==null)for(var Qt=0;Qt";case a0:return":has("+(s0(Rt)||"")+")";case xl:return'[role="'+Rt.value+'"]';case _h:return'"'+Rt.value+'"';case Ep:return'[data-testname="'+Rt.value+'"]';default:throw Error(at(365))}}function by(Rt,Lt){var Gt=[];Rt=[Rt,0];for(var Qt=0;Qtpn&&(pn=Hn),Qt&=~$n}if(Qt=pn,Qt=ts()-Qt,Qt=(120>Qt?120:480>Qt?480:1080>Qt?1080:1920>Qt?1920:3e3>Qt?3e3:4320>Qt?4320:1960*qy(Qt/1960))-Qt,10Rt?16:Rt,ku===null)var Qt=!1;else{if(Rt=ku,ku=null,u0=0,Bo&6)throw Error(at(331));var pn=Bo;for(Bo|=4,Yr=Rt.current;Yr!==null;){var $n=Yr,Hn=$n.child;if(Yr.flags&16){var tr=$n.deletions;if(tr!==null){for(var vr=0;vrts()-km?uu(Rt,0):xm|=Gt),mo(Rt,Lt)}function Sy(Rt,Lt){Lt===0&&(Rt.mode&1?(Lt=Po,Po<<=1,!(Po&130023424)&&(Po=4194304)):Lt=1);var Gt=js();Rt=Mp(Rt,Lt),Rt!==null&&(Jo(Rt,Lt,Gt),mo(Rt,Gt))}function Uu(Rt){var Lt=Rt.memoizedState,Gt=0;Lt!==null&&(Gt=Lt.retryLane),Sy(Rt,Gt)}function Ey(Rt,Lt){var Gt=0;switch(Rt.tag){case 13:var Qt=Rt.stateNode,pn=Rt.memoizedState;pn!==null&&(Gt=pn.retryLane);break;case 19:Qt=Rt.stateNode;break;default:throw Error(at(314))}Qt!==null&&Qt.delete(Lt),Sy(Rt,Gt)}var Cm;Cm=function(Rt,Lt,Gt){if(Rt!==null)if(Rt.memoizedProps!==Lt.pendingProps||yr.current)yl=!0;else{if(!(Rt.lanes&Gt)&&!(Lt.flags&128))return yl=!1,Wy(Rt,Lt,Gt);yl=!!(Rt.flags&131072)}else yl=!1,_a&&Lt.flags&1048576&&Dm(Lt,zp,Lt.index);switch(Lt.lanes=0,Lt.tag){case 2:var Qt=Lt.type;Rt!==null&&(Rt.alternate=null,Lt.alternate=null,Lt.flags|=2),Rt=Lt.pendingProps;var pn=io(Lt,cr.current);os(Lt,Gt),pn=qo(null,Lt,Qt,Rt,pn,Gt);var $n=im();return Lt.flags|=1,typeof pn=="object"&&pn!==null&&typeof pn.render=="function"&&pn.$$typeof===void 0?(Lt.tag=1,Lt.memoizedState=null,Lt.updateQueue=null,so(Qt)?($n=!0,vo(Lt)):$n=!1,Lt.memoizedState=pn.state!==null&&pn.state!==void 0?pn.state:null,X0(Lt),pn.updater=_0,Lt.stateNode=pn,pn._reactInternals=Lt,cp(Lt,Qt,Rt,Gt),Lt=um(null,Lt,Qt,!0,$n,Gt)):(Lt.tag=0,_a&&$n&&x0(Lt),cs(null,Lt,pn,Gt),Lt=Lt.child),Lt;case 16:Qt=Lt.elementType;e:{switch(Rt!==null&&(Rt.alternate=null,Lt.alternate=null,Lt.flags|=2),Rt=Lt.pendingProps,pn=Qt._init,Qt=pn(Qt._payload),Lt.type=Qt,pn=Lt.tag=Ty(Qt),Rt=ls(Qt,Rt),pn){case 0:Lt=Hl(null,Lt,Qt,Rt,Gt);break e;case 1:Lt=ay(null,Lt,Qt,Rt,Gt);break e;case 11:Lt=ty(null,Lt,Qt,Rt,Gt);break e;case 14:Lt=ny(null,Lt,Qt,ls(Qt.type,Rt),Gt);break e}throw Error(at(306,Qt,""))}return Lt;case 0:return Qt=Lt.type,pn=Lt.pendingProps,pn=Lt.elementType===Qt?pn:ls(Qt,pn),Hl(Rt,Lt,Qt,pn,Gt);case 1:return Qt=Lt.type,pn=Lt.pendingProps,pn=Lt.elementType===Qt?pn:ls(Qt,pn),ay(Rt,Lt,Qt,pn,Gt);case 3:e:{if(sy(Lt),Rt===null)throw Error(at(387));Qt=Lt.pendingProps,$n=Lt.memoizedState,pn=$n.element,J0(Rt,Lt),Dl(Lt,Qt,null,Gt);var Hn=Lt.memoizedState;if(Qt=Hn.element,En&&$n.isDehydrated)if($n={element:Qt,isDehydrated:!1,cache:Hn.cache,transitions:Hn.transitions},Lt.updateQueue.baseState=$n,Lt.memoizedState=$n,Lt.flags&256){pn=Error(at(423)),Lt=ly(Rt,Lt,Qt,Gt,pn);break e}else if(Qt!==pn){pn=Error(at(424)),Lt=ly(Rt,Lt,Qt,Gt,pn);break e}else for(En&&(As=On(Lt.stateNode.containerInfo),Hs=Lt,_a=!0,Wl=null,hp=!1),Gt=Wm(Lt,null,Qt,Gt),Lt.child=Gt;Gt;)Gt.flags=Gt.flags&-3|4096,Gt=Gt.sibling;else{if(dp(),Qt===pn){Lt=xs(Rt,Lt,Gt);break e}cs(Rt,Lt,Qt,Gt)}Lt=Lt.child}return Lt;case 5:return Vm(Lt),Rt===null&&em(Lt),Qt=Lt.type,pn=Lt.pendingProps,$n=Rt!==null?Rt.memoizedProps:null,Hn=pn.children,cn(Qt,pn)?Hn=null:$n!==null&&cn(Qt,$n)&&(Lt.flags|=32),oy(Rt,Lt),cs(Rt,Lt,Hn,Gt),Lt.child;case 6:return Rt===null&&em(Lt),null;case 13:return cy(Rt,Lt,Gt);case 4:return tm(Lt,Lt.stateNode.containerInfo),Qt=Lt.pendingProps,Rt===null?Lt.child=pp(Lt,null,Qt,Gt):cs(Rt,Lt,Qt,Gt),Lt.child;case 11:return Qt=Lt.type,pn=Lt.pendingProps,pn=Lt.elementType===Qt?pn:ls(Qt,pn),ty(Rt,Lt,Qt,pn,Gt);case 7:return cs(Rt,Lt,Lt.pendingProps,Gt),Lt.child;case 8:return cs(Rt,Lt,Lt.pendingProps.children,Gt),Lt.child;case 12:return cs(Rt,Lt,Lt.pendingProps.children,Gt),Lt.child;case 10:e:{if(Qt=Lt.type._context,pn=Lt.pendingProps,$n=Lt.memoizedProps,Hn=pn.value,Dp(Lt,Qt,Hn),$n!==null)if(Js($n.value,Hn)){if($n.children===pn.children&&!yr.current){Lt=xs(Rt,Lt,Gt);break e}}else for($n=Lt.child,$n!==null&&($n.return=Lt);$n!==null;){var tr=$n.dependencies;if(tr!==null){Hn=$n.child;for(var vr=tr.firstContext;vr!==null;){if(vr.context===Qt){if($n.tag===1){vr=Ps(-1,Gt&-Gt),vr.tag=2;var Wr=$n.updateQueue;if(Wr!==null){Wr=Wr.shared;var oo=Wr.pending;oo===null?vr.next=vr:(vr.next=oo.next,oo.next=vr),Wr.pending=vr}}$n.lanes|=Gt,vr=$n.alternate,vr!==null&&(vr.lanes|=Gt),Cs($n.return,Gt,Lt),tr.lanes|=Gt;break}vr=vr.next}}else if($n.tag===10)Hn=$n.type===Lt.type?null:$n.child;else if($n.tag===18){if(Hn=$n.return,Hn===null)throw Error(at(341));Hn.lanes|=Gt,tr=Hn.alternate,tr!==null&&(tr.lanes|=Gt),Cs(Hn,Gt,Lt),Hn=$n.sibling}else Hn=$n.child;if(Hn!==null)Hn.return=$n;else for(Hn=$n;Hn!==null;){if(Hn===Lt){Hn=null;break}if($n=Hn.sibling,$n!==null){$n.return=Hn.return,Hn=$n;break}Hn=Hn.return}$n=Hn}cs(Rt,Lt,pn.children,Gt),Lt=Lt.child}return Lt;case 9:return pn=Lt.type,Qt=Lt.pendingProps.children,os(Lt,Gt),pn=Vo(pn),Qt=Qt(pn),Lt.flags|=1,cs(Rt,Lt,Qt,Gt),Lt.child;case 14:return Qt=Lt.type,pn=ls(Qt,Lt.pendingProps),pn=ls(Qt.type,pn),ny(Rt,Lt,Qt,pn,Gt);case 15:return iy(Rt,Lt,Lt.type,Lt.pendingProps,Gt);case 17:return Qt=Lt.type,pn=Lt.pendingProps,pn=Lt.elementType===Qt?pn:ls(Qt,pn),Rt!==null&&(Rt.alternate=null,Lt.alternate=null,Lt.flags|=2),Lt.tag=1,so(Qt)?(Rt=!0,vo(Lt)):Rt=!1,os(Lt,Gt),Lm(Lt,Qt,pn),cp(Lt,Qt,pn,Gt),um(null,Lt,Qt,!0,Rt,Gt);case 19:return dy(Rt,Lt,Gt);case 22:return ry(Rt,Lt,Gt)}throw Error(at(156,Lt.tag))};function U0(Rt,Lt){return tu(Rt,Lt)}function Yy(Rt,Lt,Gt,Qt){this.tag=Rt,this.key=Gt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=Lt,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=Qt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ml(Rt,Lt,Gt,Qt){return new Yy(Rt,Lt,Gt,Qt)}function Pm(Rt){return Rt=Rt.prototype,!(!Rt||!Rt.isReactComponent)}function Ty(Rt){if(typeof Rt=="function")return Pm(Rt)?1:0;if(Rt!=null){if(Rt=Rt.$$typeof,Rt===gt)return 11;if(Rt===wt)return 14}return 2}function Su(Rt,Lt){var Gt=Rt.alternate;return Gt===null?(Gt=Ml(Rt.tag,Lt,Rt.key,Rt.mode),Gt.elementType=Rt.elementType,Gt.type=Rt.type,Gt.stateNode=Rt.stateNode,Gt.alternate=Rt,Rt.alternate=Gt):(Gt.pendingProps=Lt,Gt.type=Rt.type,Gt.flags=0,Gt.subtreeFlags=0,Gt.deletions=null),Gt.flags=Rt.flags&14680064,Gt.childLanes=Rt.childLanes,Gt.lanes=Rt.lanes,Gt.child=Rt.child,Gt.memoizedProps=Rt.memoizedProps,Gt.memoizedState=Rt.memoizedState,Gt.updateQueue=Rt.updateQueue,Lt=Rt.dependencies,Gt.dependencies=Lt===null?null:{lanes:Lt.lanes,firstContext:Lt.firstContext},Gt.sibling=Rt.sibling,Gt.index=Rt.index,Gt.ref=Rt.ref,Gt}function z0(Rt,Lt,Gt,Qt,pn,$n){var Hn=2;if(Qt=Rt,typeof Rt=="function")Pm(Rt)&&(Hn=1);else if(typeof Rt=="string")Hn=5;else e:switch(Rt){case ut:return zu(Gt.children,pn,$n,Lt);case ht:Hn=8,pn|=8;break;case dt:return Rt=Ml(12,Gt,Lt,pn|2),Rt.elementType=dt,Rt.lanes=$n,Rt;case bt:return Rt=Ml(13,Gt,Lt,pn),Rt.elementType=bt,Rt.lanes=$n,Rt;case yt:return Rt=Ml(19,Gt,Lt,pn),Rt.elementType=yt,Rt.lanes=$n,Rt;case xt:return f0(Gt,pn,$n,Lt);default:if(typeof Rt=="object"&&Rt!==null)switch(Rt.$$typeof){case pt:Hn=10;break e;case mt:Hn=9;break e;case gt:Hn=11;break e;case wt:Hn=14;break e;case vt:Hn=16,Qt=null;break e}throw Error(at(130,Rt==null?Rt:typeof Rt,""))}return Lt=Ml(Hn,Gt,Lt,pn),Lt.elementType=Rt,Lt.type=Qt,Lt.lanes=$n,Lt}function zu(Rt,Lt,Gt,Qt){return Rt=Ml(7,Rt,Qt,Lt),Rt.lanes=Gt,Rt}function f0(Rt,Lt,Gt,Qt){return Rt=Ml(22,Rt,Qt,Lt),Rt.elementType=xt,Rt.lanes=Gt,Rt.stateNode={},Rt}function Ls(Rt,Lt,Gt){return Rt=Ml(6,Rt,null,Lt),Rt.lanes=Gt,Rt}function Rl(Rt,Lt,Gt){return Lt=Ml(4,Rt.children!==null?Rt.children:[],Rt.key,Lt),Lt.lanes=Gt,Lt.stateNode={containerInfo:Rt.containerInfo,pendingChildren:null,implementation:Rt.implementation},Lt}function Ky(Rt,Lt,Gt,Qt,pn){this.tag=Lt,this.containerInfo=Rt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=fn,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$a(0),this.expirationTimes=$a(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$a(0),this.identifierPrefix=Qt,this.onRecoverableError=pn,En&&(this.mutableSourceEagerHydrationData=null)}function Iy(Rt,Lt,Gt,Qt,pn,$n,Hn,tr,vr){return Rt=new Ky(Rt,Lt,Gt,tr,vr),Lt===1?(Lt=1,$n===!0&&(Lt|=8)):Lt=0,$n=Ml(3,null,null,Lt),Rt.current=$n,$n.stateNode=Rt,$n.memoizedState={element:Qt,isDehydrated:Gt,cache:null,transitions:null},X0($n),Rt}function p0(Rt){if(!Rt)return xr;Rt=Rt._reactInternals;e:{if(Ft(Rt)!==Rt||Rt.tag!==1)throw Error(at(170));var Lt=Rt;do{switch(Lt.tag){case 3:Lt=Lt.stateNode.context;break e;case 1:if(so(Lt.type)){Lt=Lt.stateNode.__reactInternalMemoizedMergedChildContext;break e}}Lt=Lt.return}while(Lt!==null);throw Error(at(171))}if(Rt.tag===1){var Gt=Rt.type;if(so(Gt))return qn(Rt,Gt,Lt)}return Lt}function ep(Rt){var Lt=Rt._reactInternals;if(Lt===void 0)throw typeof Rt.render=="function"?Error(at(188)):(Rt=Object.keys(Rt).join(","),Error(at(268,Rt)));return Rt=Ot(Lt),Rt===null?null:Rt.stateNode}function Mm(Rt,Lt){if(Rt=Rt.memoizedState,Rt!==null&&Rt.dehydrated!==null){var Gt=Rt.retryLane;Rt.retryLane=Gt!==0&&Gt=Wr&&$n>=Io&&pn<=oo&&Hn<=ho){Rt.splice(Lt,1);break}else if(Qt!==Wr||Gt.width!==vr.width||ho<$n||Io>Hn){if(!($n!==Io||Gt.height!==vr.height||oopn)){Wr>Qt&&(vr.width+=Wr-Qt,vr.x=Qt),oo$n&&(vr.height+=Io-$n,vr.y=$n),hoGt&&(Gt=Hn)),Hn ")+` No matching component was found for: - `)+Ft.join(" > ")}return null},nt.getPublicRootInstance=function(Ft){if(Ft=Ft.current,!Ft.child)return null;switch(Ft.child.tag){case 5:return Rt(Ft.child.stateNode);default:return Ft.child.stateNode}},nt.injectIntoDevTools=function(Ft){if(Ft={bundleType:Ft.bundleType,version:Ft.version,rendererPackageName:Ft.rendererPackageName,rendererConfig:Ft.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:st.ReactCurrentDispatcher,findHostInstanceByFiber:Xy,findFiberByHostInstance:Ft.findFiberByHostInstance||Ay,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")Ft=!1;else{var zt=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(zt.isDisabled||!zt.supportsFiber)Ft=!0;else{try{Vu=zt.inject(Ft),Xs=zt}catch{}Ft=!!zt.checkDCE}}return Ft},nt.isAlreadyRendering=function(){return!1},nt.observeVisibleRects=function(Ft,zt,Gt,en){if(!En)throw Error(at(363));Ft=vm(Ft,zt);var mn=nn(Ft,Gt,en).disconnect;return{disconnect:function(){mn()}}},nt.registerMutableSourceForHydration=function(Ft,zt){var Gt=zt._getVersion;Gt=Gt(zt._source),Ft.mutableSourceEagerHydrationData==null?Ft.mutableSourceEagerHydrationData=[zt,Gt]:Ft.mutableSourceEagerHydrationData.push(zt,Gt)},nt.runWithPriority=function(Ft,zt){var Gt=Lo;try{return Lo=Ft,zt()}finally{Lo=Gt}},nt.shouldError=function(){return null},nt.shouldSuspend=function(){return!1},nt.updateContainer=function(Ft,zt,Gt,en){var mn=zt.current,An=Os(),Gn=cu(mn);return Gt=p0(Gt),zt.context===null?zt.context=Gt:zt.pendingContext=Gt,zt=Ps(An,Gn),zt.payload={element:Ft},en=en===void 0?null:en,en!==null&&(zt.callback=en),Ll(mn,zt),Ft=Pl(mn,Gn,An),Ft!==null&&lp(Ft,mn,Gn),Gn},nt};reactReconciler.exports=reactReconciler_production_min;var reactReconcilerExports=reactReconciler.exports;const Reconciler=getDefaultExportFromCjs(reactReconcilerExports),isPromise=tt=>typeof tt=="object"&&typeof tt.then=="function",globalCache$1=[];function shallowEqualArrays$1(tt,et,nt=(it,rt)=>it===rt){if(tt===et)return!0;if(!tt||!et)return!1;const it=tt.length;if(et.length!==it)return!1;for(let rt=0;rt0&&(ot.timeout&&clearTimeout(ot.timeout),ot.timeout=setTimeout(ot.remove,it.lifespan)),ot.response;if(!nt)throw ot.promise}const rt={keys:et,equal:it.equal,remove:()=>{const ot=globalCache$1.indexOf(rt);ot!==-1&&globalCache$1.splice(ot,1)},promise:(isPromise(tt)?tt:tt(...et)).then(ot=>{rt.response=ot,it.lifespan&&it.lifespan>0&&(rt.timeout=setTimeout(rt.remove,it.lifespan))}).catch(ot=>rt.error=ot)};if(globalCache$1.push(rt),!nt)throw rt.promise}const suspend$1=(tt,et,nt)=>query$1(tt,et,!1,nt),preload=(tt,et,nt)=>void query$1(tt,et,!0,nt),clear=tt=>{if(tt===void 0||tt.length===0)globalCache$1.splice(0,globalCache$1.length);else{const et=globalCache$1.find(nt=>shallowEqualArrays$1(tt,nt.keys,nt.equal));et&&et.remove()}},catalogue={},extend$3=tt=>void Object.assign(catalogue,tt);function createRenderer(tt,et){function nt(ut,{args:ht=[],attach:dt,...pt},mt){let gt=`${ut[0].toUpperCase()}${ut.slice(1)}`,bt;if(ut==="primitive"){if(pt.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const yt=pt.object;bt=prepare(yt,{type:ut,root:mt,attach:dt,primitive:!0})}else{const yt=catalogue[gt];if(!yt)throw new Error(`R3F: ${gt} 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(ht))throw new Error("R3F: The args prop must be an array!");bt=prepare(new yt(...ht),{type:ut,root:mt,attach:dt,memoizedProps:{args:ht}})}return bt.__r3f.attach===void 0&&(bt instanceof BufferGeometry?bt.__r3f.attach="geometry":bt instanceof Material&&(bt.__r3f.attach="material")),gt!=="inject"&&applyProps$1(bt,pt),bt}function it(ut,ht){let dt=!1;if(ht){var pt,mt;(pt=ht.__r3f)!=null&&pt.attach?attach(ut,ht,ht.__r3f.attach):ht.isObject3D&&ut.isObject3D&&(ut.add(ht),dt=!0),dt||(mt=ut.__r3f)==null||mt.objects.push(ht),ht.__r3f||prepare(ht,{}),ht.__r3f.parent=ut,updateInstance(ht),invalidateInstance(ht)}}function rt(ut,ht,dt){let pt=!1;if(ht){var mt,gt;if((mt=ht.__r3f)!=null&&mt.attach)attach(ut,ht,ht.__r3f.attach);else if(ht.isObject3D&&ut.isObject3D){ht.parent=ut,ht.dispatchEvent({type:"added"});const bt=ut.children.filter(wt=>wt!==ht),yt=bt.indexOf(dt);ut.children=[...bt.slice(0,yt),ht,...bt.slice(yt)],pt=!0}pt||(gt=ut.__r3f)==null||gt.objects.push(ht),ht.__r3f||prepare(ht,{}),ht.__r3f.parent=ut,updateInstance(ht),invalidateInstance(ht)}}function ot(ut,ht,dt=!1){ut&&[...ut].forEach(pt=>at(ht,pt,dt))}function at(ut,ht,dt){if(ht){var pt,mt,gt;if(ht.__r3f&&(ht.__r3f.parent=null),(pt=ut.__r3f)!=null&&pt.objects&&(ut.__r3f.objects=ut.__r3f.objects.filter(xt=>xt!==ht)),(mt=ht.__r3f)!=null&&mt.attach)detach(ut,ht,ht.__r3f.attach);else if(ht.isObject3D&&ut.isObject3D){var bt;ut.remove(ht),(bt=ht.__r3f)!=null&&bt.root&&removeInteractivity(ht.__r3f.root,ht)}const wt=(gt=ht.__r3f)==null?void 0:gt.primitive,vt=!wt&&(dt===void 0?ht.dispose!==null:dt);if(!wt){var yt;ot((yt=ht.__r3f)==null?void 0:yt.objects,ht,vt),ot(ht.children,ht,vt)}if(delete ht.__r3f,vt&&ht.dispose&&ht.type!=="Scene"){const xt=()=>{try{ht.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?schedulerExports.unstable_scheduleCallback(schedulerExports.unstable_IdlePriority,xt):xt()}invalidateInstance(ut)}}function st(ut,ht,dt,pt){var mt;const gt=(mt=ut.__r3f)==null?void 0:mt.parent;if(!gt)return;const bt=nt(ht,dt,ut.__r3f.root);if(ut.children){for(const yt of ut.children)yt.__r3f&&it(bt,yt);ut.children=ut.children.filter(yt=>!yt.__r3f)}ut.__r3f.objects.forEach(yt=>it(bt,yt)),ut.__r3f.objects=[],ut.__r3f.autoRemovedBeforeAppend||at(gt,ut),bt.parent&&(bt.__r3f.autoRemovedBeforeAppend=!0),it(gt,bt),bt.raycast&&bt.__r3f.eventCount&&bt.__r3f.root.getState().internal.interaction.push(bt),[pt,pt.alternate].forEach(yt=>{yt!==null&&(yt.stateNode=bt,yt.ref&&(typeof yt.ref=="function"?yt.ref(bt):yt.ref.current=bt))})}const lt=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:Reconciler({createInstance:nt,removeChild:at,appendChild:it,appendInitialChild:it,insertBefore:rt,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(ut,ht)=>{if(!ht)return;const dt=ut.getState().scene;dt.__r3f&&(dt.__r3f.root=ut,it(dt,ht))},removeChildFromContainer:(ut,ht)=>{ht&&at(ut.getState().scene,ht)},insertInContainerBefore:(ut,ht,dt)=>{if(!ht||!dt)return;const pt=ut.getState().scene;pt.__r3f&&rt(pt,ht,dt)},getRootHostContext:()=>null,getChildHostContext:ut=>ut,finalizeInitialChildren(ut){var ht;return!!((ht=ut==null?void 0:ut.__r3f)!=null?ht:{}).handlers},prepareUpdate(ut,ht,dt,pt){var mt;if(((mt=ut==null?void 0:ut.__r3f)!=null?mt:{}).primitive&&pt.object&&pt.object!==ut)return[!0];{const{args:bt=[],children:yt,...wt}=pt,{args:vt=[],children:xt,...St}=dt;if(!Array.isArray(bt))throw new Error("R3F: the args prop must be an array!");if(bt.some((It,Tt)=>It!==vt[Tt]))return[!0];const Et=diffProps(ut,wt,St,!0);return Et.changes.length?[!1,Et]:null}},commitUpdate(ut,[ht,dt],pt,mt,gt,bt){ht?st(ut,pt,gt,bt):applyProps$1(ut,dt)},commitMount(ut,ht,dt,pt){var mt;const gt=(mt=ut.__r3f)!=null?mt:{};ut.raycast&>.handlers&>.eventCount&&ut.__r3f.root.getState().internal.interaction.push(ut)},getPublicInstance:ut=>ut,prepareForCommit:()=>null,preparePortalMount:ut=>prepare(ut.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(ut){var ht;const{attach:dt,parent:pt}=(ht=ut.__r3f)!=null?ht:{};dt&&pt&&detach(pt,ut,dt),ut.isObject3D&&(ut.visible=!1),invalidateInstance(ut)},unhideInstance(ut,ht){var dt;const{attach:pt,parent:mt}=(dt=ut.__r3f)!=null?dt:{};pt&&mt&&attach(mt,ut,pt),(ut.isObject3D&&ht.visible==null||ht.visible)&&(ut.visible=!0),invalidateInstance(ut)},createTextInstance:lt,hideTextInstance:lt,unhideTextInstance:lt,getCurrentEventPriority:()=>et?et():constantsExports.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&is$1.fun(performance.now)?performance.now:is$1.fun(Date.now)?Date.now:()=>0,scheduleTimeout:is$1.fun(setTimeout)?setTimeout:void 0,cancelTimeout:is$1.fun(clearTimeout)?clearTimeout:void 0}),applyProps:applyProps$1}}var _window$document,_window$navigator;const hasColorSpace=tt=>"colorSpace"in tt||"outputColorSpace"in tt,getColorManagement=()=>{var tt;return(tt=catalogue.ColorManagement)!=null?tt:null},isOrthographicCamera$1=tt=>tt&&tt.isOrthographicCamera,isRef=tt=>tt&&tt.hasOwnProperty("current"),useIsomorphicLayoutEffect$1=typeof window<"u"&&((_window$document=window.document)!=null&&_window$document.createElement||((_window$navigator=window.navigator)==null?void 0:_window$navigator.product)==="ReactNative")?reactExports.useLayoutEffect:reactExports.useEffect;function useMutableCallback(tt){const et=reactExports.useRef(tt);return useIsomorphicLayoutEffect$1(()=>void(et.current=tt),[tt]),et}function Block({set:tt}){return useIsomorphicLayoutEffect$1(()=>(tt(new Promise(()=>null)),()=>tt(!1)),[tt]),null}class ErrorBoundary extends reactExports.Component{constructor(...et){super(...et),this.state={error:!1}}componentDidCatch(et){this.props.set(et)}render(){return this.state.error?null:this.props.children}}ErrorBoundary.getDerivedStateFromError=()=>({error:!0});const DEFAULT="__default",DEFAULTS=new Map,isDiffSet=tt=>tt&&!!tt.memoized&&!!tt.changes;function calculateDpr(tt){var et;const nt=typeof window<"u"?(et=window.devicePixelRatio)!=null?et:2:1;return Array.isArray(tt)?Math.min(Math.max(tt[0],nt),tt[1]):tt}const getRootState=tt=>{var et;return(et=tt.__r3f)==null?void 0:et.root.getState()},is$1={obj:tt=>tt===Object(tt)&&!is$1.arr(tt)&&typeof tt!="function",fun:tt=>typeof tt=="function",str:tt=>typeof tt=="string",num:tt=>typeof tt=="number",boo:tt=>typeof tt=="boolean",und:tt=>tt===void 0,arr:tt=>Array.isArray(tt),equ(tt,et,{arrays:nt="shallow",objects:it="reference",strict:rt=!0}={}){if(typeof tt!=typeof et||!!tt!=!!et)return!1;if(is$1.str(tt)||is$1.num(tt))return tt===et;const ot=is$1.obj(tt);if(ot&&it==="reference")return tt===et;const at=is$1.arr(tt);if(at&&nt==="reference")return tt===et;if((at||ot)&&tt===et)return!0;let st;for(st in tt)if(!(st in et))return!1;if(ot&&nt==="shallow"&&it==="shallow"){for(st in rt?et:tt)if(!is$1.equ(tt[st],et[st],{strict:rt,objects:"reference"}))return!1}else for(st in rt?et:tt)if(tt[st]!==et[st])return!1;if(is$1.und(st)){if(at&&tt.length===0&&et.length===0||ot&&Object.keys(tt).length===0&&Object.keys(et).length===0)return!0;if(tt!==et)return!1}return!0}};function buildGraph(tt){const et={nodes:{},materials:{}};return tt&&tt.traverse(nt=>{nt.name&&(et.nodes[nt.name]=nt),nt.material&&!et.materials[nt.material.name]&&(et.materials[nt.material.name]=nt.material)}),et}function dispose(tt){tt.dispose&&tt.type!=="Scene"&&tt.dispose();for(const et in tt)et.dispose==null||et.dispose(),delete tt[et]}function prepare(tt,et){const nt=tt;return nt.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...et},tt}function resolve(tt,et){let nt=tt;if(et.includes("-")){const it=et.split("-"),rt=it.pop();return nt=it.reduce((ot,at)=>ot[at],tt),{target:nt,key:rt}}else return{target:nt,key:et}}const INDEX_REGEX=/-\d+$/;function attach(tt,et,nt){if(is$1.str(nt)){if(INDEX_REGEX.test(nt)){const ot=nt.replace(INDEX_REGEX,""),{target:at,key:st}=resolve(tt,ot);Array.isArray(at[st])||(at[st]=[])}const{target:it,key:rt}=resolve(tt,nt);et.__r3f.previousAttach=it[rt],it[rt]=et}else et.__r3f.previousAttach=nt(tt,et)}function detach(tt,et,nt){var it,rt;if(is$1.str(nt)){const{target:ot,key:at}=resolve(tt,nt),st=et.__r3f.previousAttach;st===void 0?delete ot[at]:ot[at]=st}else(it=et.__r3f)==null||it.previousAttach==null||it.previousAttach(tt,et);(rt=et.__r3f)==null||delete rt.previousAttach}function diffProps(tt,{children:et,key:nt,ref:it,...rt},{children:ot,key:at,ref:st,...lt}={},ct=!1){var ut;const ht=(ut=tt==null?void 0:tt.__r3f)!=null?ut:{},dt=Object.entries(rt),pt=[];if(ct){const gt=Object.keys(lt);for(let bt=0;bt{var yt;if((yt=tt.__r3f)!=null&&yt.primitive&>==="object"||is$1.equ(bt,lt[gt]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(gt))return pt.push([gt,bt,!0,[]]);let wt=[];gt.includes("-")&&(wt=gt.split("-")),pt.push([gt,bt,!1,wt]);for(const vt in rt){const xt=rt[vt];vt.startsWith(`${gt}-`)&&pt.push([vt,xt,!1,vt.split("-")])}});const mt={...rt};return ht.memoizedProps&&ht.memoizedProps.args&&(mt.args=ht.memoizedProps.args),ht.memoizedProps&&ht.memoizedProps.attach&&(mt.attach=ht.memoizedProps.attach),{memoized:mt,changes:pt}}const __DEV__=typeof process<"u"&&!1;function applyProps$1(tt,et){var nt,it,rt;const ot=(nt=tt.__r3f)!=null?nt:{},at=ot.root,st=(it=at==null||at.getState==null?void 0:at.getState())!=null?it:{},{memoized:lt,changes:ct}=isDiffSet(et)?et:diffProps(tt,et),ut=ot.eventCount;tt.__r3f&&(tt.__r3f.memoizedProps=lt);for(let dt=0;dtvt[xt],tt),!(wt&&wt.set))){const[vt,...xt]=bt.reverse();yt=xt.reverse().reduce((St,Et)=>St[Et],tt),pt=vt}if(mt===DEFAULT+"remove")if(yt.constructor){let vt=DEFAULTS.get(yt.constructor);vt||(vt=new yt.constructor,DEFAULTS.set(yt.constructor,vt)),mt=vt[pt]}else mt=0;if(gt)mt?ot.handlers[pt]=mt:delete ot.handlers[pt],ot.eventCount=Object.keys(ot.handlers).length;else if(wt&&wt.set&&(wt.copy||wt instanceof Layers)){if(Array.isArray(mt))wt.fromArray?wt.fromArray(mt):wt.set(...mt);else if(wt.copy&&mt&&mt.constructor&&(__DEV__?wt.constructor.name===mt.constructor.name:wt.constructor===mt.constructor))wt.copy(mt);else if(mt!==void 0){const vt=wt instanceof Color$1;!vt&&wt.setScalar?wt.setScalar(mt):wt instanceof Layers&&mt instanceof Layers?wt.mask=mt.mask:wt.set(mt),!getColorManagement()&&!st.linear&&vt&&wt.convertSRGBToLinear()}}else if(yt[pt]=mt,yt[pt]instanceof Texture&&yt[pt].format===RGBAFormat&&yt[pt].type===UnsignedByteType){const vt=yt[pt];hasColorSpace(vt)&&hasColorSpace(st.gl)?vt.colorSpace=st.gl.outputColorSpace:vt.encoding=st.gl.outputEncoding}invalidateInstance(tt)}if(ot.parent&&st.internal&&tt.raycast&&ut!==ot.eventCount){const dt=st.internal.interaction.indexOf(tt);dt>-1&&st.internal.interaction.splice(dt,1),ot.eventCount&&st.internal.interaction.push(tt)}return!(ct.length===1&&ct[0][0]==="onUpdate")&&ct.length&&(rt=tt.__r3f)!=null&&rt.parent&&updateInstance(tt),tt}function invalidateInstance(tt){var et,nt;const it=(et=tt.__r3f)==null||(nt=et.root)==null||nt.getState==null?void 0:nt.getState();it&&it.internal.frames===0&&it.invalidate()}function updateInstance(tt){tt.onUpdate==null||tt.onUpdate(tt)}function updateCamera(tt,et){tt.manual||(isOrthographicCamera$1(tt)?(tt.left=et.width/-2,tt.right=et.width/2,tt.top=et.height/2,tt.bottom=et.height/-2):tt.aspect=et.width/et.height,tt.updateProjectionMatrix(),tt.updateMatrixWorld())}function makeId(tt){return(tt.eventObject||tt.object).uuid+"/"+tt.index+tt.instanceId}function getEventPriority(){var tt;const et=typeof self<"u"&&self||typeof window<"u"&&window;if(!et)return constantsExports.DefaultEventPriority;switch((tt=et.event)==null?void 0:tt.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return constantsExports.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return constantsExports.ContinuousEventPriority;default:return constantsExports.DefaultEventPriority}}function releaseInternalPointerCapture(tt,et,nt,it){const rt=nt.get(et);rt&&(nt.delete(et),nt.size===0&&(tt.delete(it),rt.target.releasePointerCapture(it)))}function removeInteractivity(tt,et){const{internal:nt}=tt.getState();nt.interaction=nt.interaction.filter(it=>it!==et),nt.initialHits=nt.initialHits.filter(it=>it!==et),nt.hovered.forEach((it,rt)=>{(it.eventObject===et||it.object===et)&&nt.hovered.delete(rt)}),nt.capturedMap.forEach((it,rt)=>{releaseInternalPointerCapture(nt.capturedMap,et,it,rt)})}function createEvents(tt){function et(lt){const{internal:ct}=tt.getState(),ut=lt.offsetX-ct.initialClick[0],ht=lt.offsetY-ct.initialClick[1];return Math.round(Math.sqrt(ut*ut+ht*ht))}function nt(lt){return lt.filter(ct=>["Move","Over","Enter","Out","Leave"].some(ut=>{var ht;return(ht=ct.__r3f)==null?void 0:ht.handlers["onPointer"+ut]}))}function it(lt,ct){const ut=tt.getState(),ht=new Set,dt=[],pt=ct?ct(ut.internal.interaction):ut.internal.interaction;for(let yt=0;yt{const vt=getRootState(yt.object),xt=getRootState(wt.object);return!vt||!xt?yt.distance-wt.distance:xt.events.priority-vt.events.priority||yt.distance-wt.distance}).filter(yt=>{const wt=makeId(yt);return ht.has(wt)?!1:(ht.add(wt),!0)});ut.events.filter&&(gt=ut.events.filter(gt,ut));for(const yt of gt){let wt=yt.object;for(;wt;){var bt;(bt=wt.__r3f)!=null&&bt.eventCount&&dt.push({...yt,eventObject:wt}),wt=wt.parent}}if("pointerId"in lt&&ut.internal.capturedMap.has(lt.pointerId))for(let yt of ut.internal.capturedMap.get(lt.pointerId).values())ht.has(makeId(yt.intersection))||dt.push(yt.intersection);return dt}function rt(lt,ct,ut,ht){const dt=tt.getState();if(lt.length){const pt={stopped:!1};for(const mt of lt){const gt=getRootState(mt.object)||dt,{raycaster:bt,pointer:yt,camera:wt,internal:vt}=gt,xt=new Vector3(yt.x,yt.y,0).unproject(wt),St=Ut=>{var Lt,Bt;return(Lt=(Bt=vt.capturedMap.get(Ut))==null?void 0:Bt.has(mt.eventObject))!=null?Lt:!1},Et=Ut=>{const Lt={intersection:mt,target:ct.target};vt.capturedMap.has(Ut)?vt.capturedMap.get(Ut).set(mt.eventObject,Lt):vt.capturedMap.set(Ut,new Map([[mt.eventObject,Lt]])),ct.target.setPointerCapture(Ut)},It=Ut=>{const Lt=vt.capturedMap.get(Ut);Lt&&releaseInternalPointerCapture(vt.capturedMap,mt.eventObject,Lt,Ut)};let Tt={};for(let Ut in ct){let Lt=ct[Ut];typeof Lt!="function"&&(Tt[Ut]=Lt)}let $t={...mt,...Tt,pointer:yt,intersections:lt,stopped:pt.stopped,delta:ut,unprojectedPoint:xt,ray:bt.ray,camera:wt,stopPropagation(){const Ut="pointerId"in ct&&vt.capturedMap.get(ct.pointerId);if((!Ut||Ut.has(mt.eventObject))&&($t.stopped=pt.stopped=!0,vt.hovered.size&&Array.from(vt.hovered.values()).find(Lt=>Lt.eventObject===mt.eventObject))){const Lt=lt.slice(0,lt.indexOf(mt));ot([...Lt,mt])}},target:{hasPointerCapture:St,setPointerCapture:Et,releasePointerCapture:It},currentTarget:{hasPointerCapture:St,setPointerCapture:Et,releasePointerCapture:It},nativeEvent:ct};if(ht($t),pt.stopped===!0)break}}return lt}function ot(lt){const{internal:ct}=tt.getState();for(const ut of ct.hovered.values())if(!lt.length||!lt.find(ht=>ht.object===ut.object&&ht.index===ut.index&&ht.instanceId===ut.instanceId)){const dt=ut.eventObject.__r3f,pt=dt==null?void 0:dt.handlers;if(ct.hovered.delete(makeId(ut)),dt!=null&&dt.eventCount){const mt={...ut,intersections:lt};pt.onPointerOut==null||pt.onPointerOut(mt),pt.onPointerLeave==null||pt.onPointerLeave(mt)}}}function at(lt,ct){for(let ut=0;utot([]);case"onLostPointerCapture":return ct=>{const{internal:ut}=tt.getState();"pointerId"in ct&&ut.capturedMap.has(ct.pointerId)&&requestAnimationFrame(()=>{ut.capturedMap.has(ct.pointerId)&&(ut.capturedMap.delete(ct.pointerId),ot([]))})}}return function(ut){const{onPointerMissed:ht,internal:dt}=tt.getState();dt.lastEvent.current=ut;const pt=lt==="onPointerMove",mt=lt==="onClick"||lt==="onContextMenu"||lt==="onDoubleClick",bt=it(ut,pt?nt:void 0),yt=mt?et(ut):0;lt==="onPointerDown"&&(dt.initialClick=[ut.offsetX,ut.offsetY],dt.initialHits=bt.map(vt=>vt.eventObject)),mt&&!bt.length&&yt<=2&&(at(ut,dt.interaction),ht&&ht(ut)),pt&&ot(bt);function wt(vt){const xt=vt.eventObject,St=xt.__r3f,Et=St==null?void 0:St.handlers;if(St!=null&&St.eventCount)if(pt){if(Et.onPointerOver||Et.onPointerEnter||Et.onPointerOut||Et.onPointerLeave){const It=makeId(vt),Tt=dt.hovered.get(It);Tt?Tt.stopped&&vt.stopPropagation():(dt.hovered.set(It,vt),Et.onPointerOver==null||Et.onPointerOver(vt),Et.onPointerEnter==null||Et.onPointerEnter(vt))}Et.onPointerMove==null||Et.onPointerMove(vt)}else{const It=Et[lt];It?(!mt||dt.initialHits.includes(xt))&&(at(ut,dt.interaction.filter(Tt=>!dt.initialHits.includes(Tt))),It(vt)):mt&&dt.initialHits.includes(xt)&&at(ut,dt.interaction.filter(Tt=>!dt.initialHits.includes(Tt)))}}rt(bt,ut,yt,wt)}}return{handlePointer:st}}const isRenderer=tt=>!!(tt!=null&&tt.render),context$2=reactExports.createContext(null),createStore$1=(tt,et)=>{const nt=create$3((st,lt)=>{const ct=new Vector3,ut=new Vector3,ht=new Vector3;function dt(yt=lt().camera,wt=ut,vt=lt().size){const{width:xt,height:St,top:Et,left:It}=vt,Tt=xt/St;wt instanceof Vector3?ht.copy(wt):ht.set(...wt);const $t=yt.getWorldPosition(ct).distanceTo(ht);if(isOrthographicCamera$1(yt))return{width:xt/yt.zoom,height:St/yt.zoom,top:Et,left:It,factor:1,distance:$t,aspect:Tt};{const Ut=yt.fov*Math.PI/180,Lt=2*Math.tan(Ut/2)*$t,Bt=Lt*(xt/St);return{width:Bt,height:Lt,top:Et,left:It,factor:xt/Bt,distance:$t,aspect:Tt}}}let pt;const mt=yt=>st(wt=>({performance:{...wt.performance,current:yt}})),gt=new Vector2;return{set:st,get:lt,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(yt=1)=>tt(lt(),yt),advance:(yt,wt)=>et(yt,wt,lt()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Clock$1,pointer:gt,mouse:gt,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const yt=lt();pt&&clearTimeout(pt),yt.performance.current!==yt.performance.min&&mt(yt.performance.min),pt=setTimeout(()=>mt(lt().performance.max),yt.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:dt},setEvents:yt=>st(wt=>({...wt,events:{...wt.events,...yt}})),setSize:(yt,wt,vt,xt,St)=>{const Et=lt().camera,It={width:yt,height:wt,top:xt||0,left:St||0,updateStyle:vt};st(Tt=>({size:It,viewport:{...Tt.viewport,...dt(Et,ut,It)}}))},setDpr:yt=>st(wt=>{const vt=calculateDpr(yt);return{viewport:{...wt.viewport,dpr:vt,initialDpr:wt.viewport.initialDpr||vt}}}),setFrameloop:(yt="always")=>{const wt=lt().clock;wt.stop(),wt.elapsedTime=0,yt!=="never"&&(wt.start(),wt.elapsedTime=0),st(()=>({frameloop:yt}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:reactExports.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(yt,wt,vt)=>{const xt=lt().internal;return xt.priority=xt.priority+(wt>0?1:0),xt.subscribers.push({ref:yt,priority:wt,store:vt}),xt.subscribers=xt.subscribers.sort((St,Et)=>St.priority-Et.priority),()=>{const St=lt().internal;St!=null&&St.subscribers&&(St.priority=St.priority-(wt>0?1:0),St.subscribers=St.subscribers.filter(Et=>Et.ref!==yt))}}}}}),it=nt.getState();let rt=it.size,ot=it.viewport.dpr,at=it.camera;return nt.subscribe(()=>{const{camera:st,size:lt,viewport:ct,gl:ut,set:ht}=nt.getState();if(lt.width!==rt.width||lt.height!==rt.height||ct.dpr!==ot){var dt;rt=lt,ot=ct.dpr,updateCamera(st,lt),ut.setPixelRatio(ct.dpr);const pt=(dt=lt.updateStyle)!=null?dt:typeof HTMLCanvasElement<"u"&&ut.domElement instanceof HTMLCanvasElement;ut.setSize(lt.width,lt.height,pt)}st!==at&&(at=st,ht(pt=>({viewport:{...pt.viewport,...pt.viewport.getCurrentViewport(st)}})))}),nt.subscribe(st=>tt(st)),nt};function createSubs(tt,et){const nt={callback:tt};return et.add(nt),()=>void et.delete(nt)}let i$3,globalEffects=new Set,globalAfterEffects=new Set,globalTailEffects=new Set;const addEffect=tt=>createSubs(tt,globalEffects),addAfterEffect=tt=>createSubs(tt,globalAfterEffects),addTail=tt=>createSubs(tt,globalTailEffects);function run(tt,et){if(tt.size)for(const{callback:nt}of tt.values())nt(et)}function flushGlobalEffects(tt,et){switch(tt){case"before":return run(globalEffects,et);case"after":return run(globalAfterEffects,et);case"tail":return run(globalTailEffects,et)}}let subscribers,subscription;function render$1(tt,et,nt){let it=et.clock.getDelta();for(et.frameloop==="never"&&typeof tt=="number"&&(it=tt-et.clock.elapsedTime,et.clock.oldTime=et.clock.elapsedTime,et.clock.elapsedTime=tt),subscribers=et.internal.subscribers,i$3=0;i$30)&&!((ct=rt.gl.xr)!=null&&ct.isPresenting)&&(nt+=render$1(lt,rt))}if(flushGlobalEffects("after",lt),nt===0)return flushGlobalEffects("tail",lt),et=!1,cancelAnimationFrame(it)}function at(lt,ct=1){var ut;if(!lt)return tt.forEach(ht=>at(ht.store.getState()),ct);(ut=lt.gl.xr)!=null&&ut.isPresenting||!lt.internal.active||lt.frameloop==="never"||(lt.internal.frames=Math.min(60,lt.internal.frames+ct),et||(et=!0,requestAnimationFrame(ot)))}function st(lt,ct=!0,ut,ht){if(ct&&flushGlobalEffects("before",lt),ut)render$1(lt,ut,ht);else for(const dt of tt.values())render$1(lt,dt.store.getState());ct&&flushGlobalEffects("after",lt)}return{loop:ot,invalidate:at,advance:st}}function useInstanceHandle(tt){const et=reactExports.useRef(null);return useIsomorphicLayoutEffect$1(()=>void(et.current=tt.current.__r3f),[tt]),et}function useStore$1(){const tt=reactExports.useContext(context$2);if(!tt)throw new Error("R3F: Hooks can only be used within the Canvas component!");return tt}function useThree(tt=nt=>nt,et){return useStore$1()(tt,et)}function useFrame(tt,et=0){const nt=useStore$1(),it=nt.getState().internal.subscribe,rt=useMutableCallback(tt);return useIsomorphicLayoutEffect$1(()=>it(rt,et,nt),[et,it,nt]),null}const memoizedLoaders=new WeakMap;function loadingFn(tt,et){return function(nt,...it){let rt=memoizedLoaders.get(nt);return rt||(rt=new nt,memoizedLoaders.set(nt,rt)),tt&&tt(rt),Promise.all(it.map(ot=>new Promise((at,st)=>rt.load(ot,lt=>{lt.scene&&Object.assign(lt,buildGraph(lt.scene)),at(lt)},et,lt=>st(new Error(`Could not load ${ot}: ${lt==null?void 0:lt.message}`)))))).finally(()=>rt.dispose==null?void 0:rt.dispose())}}function useLoader(tt,et,nt,it){const rt=Array.isArray(et)?et:[et],ot=suspend$1(loadingFn(nt,it),[tt,...rt],{equal:is$1.equ});return Array.isArray(et)?ot:ot[0]}useLoader.preload=function(tt,et,nt){const it=Array.isArray(et)?et:[et];return preload(loadingFn(nt),[tt,...it])};useLoader.clear=function(tt,et){const nt=Array.isArray(et)?et:[et];return clear([tt,...nt])};const roots=new Map,{invalidate,advance}=createLoop(roots),{reconciler,applyProps}=createRenderer(roots,getEventPriority),shallowLoose={objects:"shallow",strict:!1},createRendererInstance=(tt,et)=>{const nt=typeof tt=="function"?tt(et):tt;return isRenderer(nt)?nt:new WebGLRenderer({powerPreference:"high-performance",canvas:et,antialias:!0,alpha:!0,...tt})};function computeInitialSize(tt,et){const nt=typeof HTMLCanvasElement<"u"&&tt instanceof HTMLCanvasElement;if(et){const{width:it,height:rt,top:ot,left:at,updateStyle:st=nt}=et;return{width:it,height:rt,top:ot,left:at,updateStyle:st}}else if(typeof HTMLCanvasElement<"u"&&tt instanceof HTMLCanvasElement&&tt.parentElement){const{width:it,height:rt,top:ot,left:at}=tt.parentElement.getBoundingClientRect();return{width:it,height:rt,top:ot,left:at,updateStyle:nt}}else if(typeof OffscreenCanvas<"u"&&tt instanceof OffscreenCanvas)return{width:tt.width,height:tt.height,top:0,left:0,updateStyle:nt};return{width:0,height:0,top:0,left:0}}function createRoot(tt){const et=roots.get(tt),nt=et==null?void 0:et.fiber,it=et==null?void 0:et.store;et&&console.warn("R3F.createRoot should only be called once!");const rt=typeof reportError=="function"?reportError:console.error,ot=it||createStore$1(invalidate,advance),at=nt||reconciler.createContainer(ot,constantsExports.ConcurrentRoot,null,!1,null,"",rt,null);et||roots.set(tt,{fiber:at,store:ot});let st,lt=!1,ct;return{configure(ut={}){let{gl:ht,size:dt,scene:pt,events:mt,onCreated:gt,shadows:bt=!1,linear:yt=!1,flat:wt=!1,legacy:vt=!1,orthographic:xt=!1,frameloop:St="always",dpr:Et=[1,2],performance:It,raycaster:Tt,camera:$t,onPointerMissed:Ut}=ut,Lt=ot.getState(),Bt=Lt.gl;Lt.gl||Lt.set({gl:Bt=createRendererInstance(ht,tt)});let Pt=Lt.raycaster;Pt||Lt.set({raycaster:Pt=new Raycaster});const{params:kt,...At}=Tt||{};if(is$1.equ(At,Pt,shallowLoose)||applyProps(Pt,{...At}),is$1.equ(kt,Pt.params,shallowLoose)||applyProps(Pt,{params:{...Pt.params,...kt}}),!Lt.camera||Lt.camera===ct&&!is$1.equ(ct,$t,shallowLoose)){ct=$t;const Mt=$t instanceof Camera,Vt=Mt?$t:xt?new OrthographicCamera(0,0,0,0,.1,1e3):new PerspectiveCamera(75,0,.1,1e3);Mt||(Vt.position.z=5,$t&&applyProps(Vt,$t),!Lt.camera&&!($t!=null&&$t.rotation)&&Vt.lookAt(0,0,0)),Lt.set({camera:Vt}),Pt.camera=Vt}if(!Lt.scene){let Mt;pt instanceof Scene?Mt=pt:(Mt=new Scene,pt&&applyProps(Mt,pt)),Lt.set({scene:prepare(Mt)})}if(!Lt.xr){var Rt;const Mt=(rn,Xt)=>{const an=ot.getState();an.frameloop!=="never"&&advance(rn,!0,an,Xt)},Vt=()=>{const rn=ot.getState();rn.gl.xr.enabled=rn.gl.xr.isPresenting,rn.gl.xr.setAnimationLoop(rn.gl.xr.isPresenting?Mt:null),rn.gl.xr.isPresenting||invalidate(rn)},Qt={connect(){const rn=ot.getState().gl;rn.xr.addEventListener("sessionstart",Vt),rn.xr.addEventListener("sessionend",Vt)},disconnect(){const rn=ot.getState().gl;rn.xr.removeEventListener("sessionstart",Vt),rn.xr.removeEventListener("sessionend",Vt)}};typeof((Rt=Bt.xr)==null?void 0:Rt.addEventListener)=="function"&&Qt.connect(),Lt.set({xr:Qt})}if(Bt.shadowMap){const Mt=Bt.shadowMap.enabled,Vt=Bt.shadowMap.type;if(Bt.shadowMap.enabled=!!bt,is$1.boo(bt))Bt.shadowMap.type=PCFSoftShadowMap;else if(is$1.str(bt)){var Wt;const Qt={basic:BasicShadowMap,percentage:PCFShadowMap,soft:PCFSoftShadowMap,variance:VSMShadowMap};Bt.shadowMap.type=(Wt=Qt[bt])!=null?Wt:PCFSoftShadowMap}else is$1.obj(bt)&&Object.assign(Bt.shadowMap,bt);(Mt!==Bt.shadowMap.enabled||Vt!==Bt.shadowMap.type)&&(Bt.shadowMap.needsUpdate=!0)}const jt=getColorManagement();jt&&("enabled"in jt?jt.enabled=!vt:"legacyMode"in jt&&(jt.legacyMode=vt)),applyProps(Bt,{outputEncoding:yt?3e3:3001,toneMapping:wt?NoToneMapping:ACESFilmicToneMapping}),Lt.legacy!==vt&&Lt.set(()=>({legacy:vt})),Lt.linear!==yt&&Lt.set(()=>({linear:yt})),Lt.flat!==wt&&Lt.set(()=>({flat:wt})),ht&&!is$1.fun(ht)&&!isRenderer(ht)&&!is$1.equ(ht,Bt,shallowLoose)&&applyProps(Bt,ht),mt&&!Lt.events.handlers&&Lt.set({events:mt(ot)});const Dt=computeInitialSize(tt,dt);return is$1.equ(Dt,Lt.size,shallowLoose)||Lt.setSize(Dt.width,Dt.height,Dt.updateStyle,Dt.top,Dt.left),Et&&Lt.viewport.dpr!==calculateDpr(Et)&&Lt.setDpr(Et),Lt.frameloop!==St&&Lt.setFrameloop(St),Lt.onPointerMissed||Lt.set({onPointerMissed:Ut}),It&&!is$1.equ(It,Lt.performance,shallowLoose)&&Lt.set(Mt=>({performance:{...Mt.performance,...It}})),st=gt,lt=!0,this},render(ut){return lt||this.configure(),reconciler.updateContainer(reactExports.createElement(Provider$2,{store:ot,children:ut,onCreated:st,rootElement:tt}),at,null,()=>{}),ot},unmount(){unmountComponentAtNode(tt)}}}function Provider$2({store:tt,children:et,onCreated:nt,rootElement:it}){return useIsomorphicLayoutEffect$1(()=>{const rt=tt.getState();rt.set(ot=>({internal:{...ot.internal,active:!0}})),nt&&nt(rt),tt.getState().events.connected||rt.events.connect==null||rt.events.connect(it)},[]),reactExports.createElement(context$2.Provider,{value:tt},et)}function unmountComponentAtNode(tt,et){const nt=roots.get(tt),it=nt==null?void 0:nt.fiber;if(it){const rt=nt==null?void 0:nt.store.getState();rt&&(rt.internal.active=!1),reconciler.updateContainer(null,it,null,()=>{rt&&setTimeout(()=>{try{var ot,at,st,lt;rt.events.disconnect==null||rt.events.disconnect(),(ot=rt.gl)==null||(at=ot.renderLists)==null||at.dispose==null||at.dispose(),(st=rt.gl)==null||st.forceContextLoss==null||st.forceContextLoss(),(lt=rt.gl)!=null&<.xr&&rt.xr.disconnect(),dispose(rt),roots.delete(tt),et&&et(tt)}catch{}},500)})}}reconciler.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:reactExports.version});function debounce$2(tt,et,nt){var it,rt,ot,at,st;et==null&&(et=100);function lt(){var ut=Date.now()-at;ut=0?it=setTimeout(lt,et-ut):(it=null,nt||(st=tt.apply(ot,rt),ot=rt=null))}var ct=function(){ot=this,rt=arguments,at=Date.now();var ut=nt&&!it;return it||(it=setTimeout(lt,et)),ut&&(st=tt.apply(ot,rt),ot=rt=null),st};return ct.clear=function(){it&&(clearTimeout(it),it=null)},ct.flush=function(){it&&(st=tt.apply(ot,rt),ot=rt=null,clearTimeout(it),it=null)},ct}debounce$2.debounce=debounce$2;var debounce_1$1=debounce$2;const createDebounce=getDefaultExportFromCjs(debounce_1$1);function useMeasure(tt){let{debounce:et,scroll:nt,polyfill:it,offsetSize:rt}=tt===void 0?{debounce:0,scroll:!1,offsetSize:!1}:tt;const ot=it||(typeof window>"u"?class{}:window.ResizeObserver);if(!ot)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[at,st]=reactExports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),lt=reactExports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:at}),ct=et?typeof et=="number"?et:et.scroll:null,ut=et?typeof et=="number"?et:et.resize:null,ht=reactExports.useRef(!1);reactExports.useEffect(()=>(ht.current=!0,()=>void(ht.current=!1)));const[dt,pt,mt]=reactExports.useMemo(()=>{const wt=()=>{if(!lt.current.element)return;const{left:vt,top:xt,width:St,height:Et,bottom:It,right:Tt,x:$t,y:Ut}=lt.current.element.getBoundingClientRect(),Lt={left:vt,top:xt,width:St,height:Et,bottom:It,right:Tt,x:$t,y:Ut};lt.current.element instanceof HTMLElement&&rt&&(Lt.height=lt.current.element.offsetHeight,Lt.width=lt.current.element.offsetWidth),Object.freeze(Lt),ht.current&&!areBoundsEqual(lt.current.lastBounds,Lt)&&st(lt.current.lastBounds=Lt)};return[wt,ut?createDebounce(wt,ut):wt,ct?createDebounce(wt,ct):wt]},[st,rt,ct,ut]);function gt(){lt.current.scrollContainers&&(lt.current.scrollContainers.forEach(wt=>wt.removeEventListener("scroll",mt,!0)),lt.current.scrollContainers=null),lt.current.resizeObserver&&(lt.current.resizeObserver.disconnect(),lt.current.resizeObserver=null)}function bt(){lt.current.element&&(lt.current.resizeObserver=new ot(mt),lt.current.resizeObserver.observe(lt.current.element),nt&<.current.scrollContainers&<.current.scrollContainers.forEach(wt=>wt.addEventListener("scroll",mt,{capture:!0,passive:!0})))}const yt=wt=>{!wt||wt===lt.current.element||(gt(),lt.current.element=wt,lt.current.scrollContainers=findScrollContainers(wt),bt())};return useOnWindowScroll(mt,!!nt),useOnWindowResize(pt),reactExports.useEffect(()=>{gt(),bt()},[nt,mt,pt]),reactExports.useEffect(()=>gt,[]),[yt,at,dt]}function useOnWindowResize(tt){reactExports.useEffect(()=>{const et=tt;return window.addEventListener("resize",et),()=>void window.removeEventListener("resize",et)},[tt])}function useOnWindowScroll(tt,et){reactExports.useEffect(()=>{if(et){const nt=tt;return window.addEventListener("scroll",nt,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",nt,!0)}},[tt,et])}function findScrollContainers(tt){const et=[];if(!tt||tt===document.body)return et;const{overflow:nt,overflowX:it,overflowY:rt}=window.getComputedStyle(tt);return[nt,it,rt].some(ot=>ot==="auto"||ot==="scroll")&&et.push(tt),[...et,...findScrollContainers(tt.parentElement)]}const keys$5=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(tt,et)=>keys$5.every(nt=>tt[nt]===et[nt]);var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(tt,et,nt)=>et in tt?__defProp(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):tt[et]=nt,__spreadValues=(tt,et)=>{for(var nt in et||(et={}))__hasOwnProp.call(et,nt)&&__defNormalProp(tt,nt,et[nt]);if(__getOwnPropSymbols)for(var nt of __getOwnPropSymbols(et))__propIsEnum.call(et,nt)&&__defNormalProp(tt,nt,et[nt]);return tt},__spreadProps=(tt,et)=>__defProps(tt,__getOwnPropDescs(et));function traverseFiber(tt,et,nt){if(!tt)return;if(nt(tt)===!0)return tt;let it=et?tt.return:tt.child;for(;it;){const rt=traverseFiber(it,et,nt);if(rt)return rt;it=et?null:it.sibling}}function wrapContext(tt){try{return Object.defineProperties(tt,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return tt}}const FiberContext=wrapContext(reactExports.createContext(null));class FiberProvider extends reactExports.Component{render(){return reactExports.createElement(FiberContext.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner,ReactCurrentDispatcher}=reactExports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function useFiber(){const tt=reactExports.useContext(FiberContext);if(tt===null)throw new Error("its-fine: useFiber must be called within a !");const et=reactExports.useId();return reactExports.useMemo(()=>{for(const it of[ReactCurrentOwner==null?void 0:ReactCurrentOwner.current,tt,tt==null?void 0:tt.alternate]){if(!it)continue;const rt=traverseFiber(it,!1,ot=>{let at=ot.memoizedState;for(;at;){if(at.memoizedState===et)return!0;at=at.next}});if(rt)return rt}},[tt,et])}function useContextMap(){var tt,et;const nt=useFiber(),[it]=reactExports.useState(()=>new Map);it.clear();let rt=nt;for(;rt;){const ot=(tt=rt.type)==null?void 0:tt._context;ot&&ot!==FiberContext&&!it.has(ot)&&it.set(ot,(et=ReactCurrentDispatcher==null?void 0:ReactCurrentDispatcher.current)==null?void 0:et.readContext(wrapContext(ot))),rt=rt.return}return it}function useContextBridge(){const tt=useContextMap();return reactExports.useMemo(()=>Array.from(tt.keys()).reduce((et,nt)=>it=>reactExports.createElement(et,null,reactExports.createElement(nt.Provider,__spreadProps(__spreadValues({},it),{value:tt.get(nt)}))),et=>reactExports.createElement(FiberProvider,__spreadValues({},et))),[tt])}const DOM_EVENTS={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 createPointerEvents(tt){const{handlePointer:et}=createEvents(tt);return{priority:1,enabled:!0,compute(nt,it,rt){it.pointer.set(nt.offsetX/it.size.width*2-1,-(nt.offsetY/it.size.height)*2+1),it.raycaster.setFromCamera(it.pointer,it.camera)},connected:void 0,handlers:Object.keys(DOM_EVENTS).reduce((nt,it)=>({...nt,[it]:et(it)}),{}),update:()=>{var nt;const{events:it,internal:rt}=tt.getState();(nt=rt.lastEvent)!=null&&nt.current&&it.handlers&&it.handlers.onPointerMove(rt.lastEvent.current)},connect:nt=>{var it;const{set:rt,events:ot}=tt.getState();ot.disconnect==null||ot.disconnect(),rt(at=>({events:{...at.events,connected:nt}})),Object.entries((it=ot.handlers)!=null?it:[]).forEach(([at,st])=>{const[lt,ct]=DOM_EVENTS[at];nt.addEventListener(lt,st,{passive:ct})})},disconnect:()=>{const{set:nt,events:it}=tt.getState();if(it.connected){var rt;Object.entries((rt=it.handlers)!=null?rt:[]).forEach(([ot,at])=>{if(it&&it.connected instanceof HTMLElement){const[st]=DOM_EVENTS[ot];it.connected.removeEventListener(st,at)}}),nt(ot=>({events:{...ot.events,connected:void 0}}))}}}}const CanvasImpl=reactExports.forwardRef(function tt({children:et,fallback:nt,resize:it,style:rt,gl:ot,events:at=createPointerEvents,eventSource:st,eventPrefix:lt,shadows:ct,linear:ut,flat:ht,legacy:dt,orthographic:pt,frameloop:mt,dpr:gt,performance:bt,raycaster:yt,camera:wt,scene:vt,onPointerMissed:xt,onCreated:St,...Et},It){reactExports.useMemo(()=>extend$3(THREE$1),[]);const Tt=useContextBridge(),[$t,Ut]=useMeasure({scroll:!0,debounce:{scroll:50,resize:0},...it}),Lt=reactExports.useRef(null),Bt=reactExports.useRef(null);reactExports.useImperativeHandle(It,()=>Lt.current);const Pt=useMutableCallback(xt),[kt,At]=reactExports.useState(!1),[Rt,Wt]=reactExports.useState(!1);if(kt)throw kt;if(Rt)throw Rt;const jt=reactExports.useRef(null);useIsomorphicLayoutEffect$1(()=>{const Ct=Lt.current;Ut.width>0&&Ut.height>0&&Ct&&(jt.current||(jt.current=createRoot(Ct)),jt.current.configure({gl:ot,events:at,shadows:ct,linear:ut,flat:ht,legacy:dt,orthographic:pt,frameloop:mt,dpr:gt,performance:bt,raycaster:yt,camera:wt,scene:vt,size:Ut,onPointerMissed:(...Dt)=>Pt.current==null?void 0:Pt.current(...Dt),onCreated:Dt=>{Dt.events.connect==null||Dt.events.connect(st?isRef(st)?st.current:st:Bt.current),lt&&Dt.setEvents({compute:(Mt,Vt)=>{const Qt=Mt[lt+"X"],rn=Mt[lt+"Y"];Vt.pointer.set(Qt/Vt.size.width*2-1,-(rn/Vt.size.height)*2+1),Vt.raycaster.setFromCamera(Vt.pointer,Vt.camera)}}),St==null||St(Dt)}}),jt.current.render(reactExports.createElement(Tt,null,reactExports.createElement(ErrorBoundary,{set:Wt},reactExports.createElement(reactExports.Suspense,{fallback:reactExports.createElement(Block,{set:At})},et)))))}),reactExports.useEffect(()=>{const Ct=Lt.current;if(Ct)return()=>unmountComponentAtNode(Ct)},[]);const Ot=st?"none":"auto";return reactExports.createElement("div",_extends$u({ref:Bt,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Ot,...rt}},Et),reactExports.createElement("div",{ref:$t,style:{width:"100%",height:"100%"}},reactExports.createElement("canvas",{ref:Lt,style:{display:"block"}},nt)))}),Canvas=reactExports.forwardRef(function tt(et,nt){return reactExports.createElement(FiberProvider,null,reactExports.createElement(CanvasImpl,_extends$u({},et,{ref:nt})))}),v1=new Vector3,v2=new Vector3,v3=new Vector3;function defaultCalculatePosition(tt,et,nt){const it=v1.setFromMatrixPosition(tt.matrixWorld);it.project(et);const rt=nt.width/2,ot=nt.height/2;return[it.x*rt+rt,-(it.y*ot)+ot]}function isObjectBehindCamera(tt,et){const nt=v1.setFromMatrixPosition(tt.matrixWorld),it=v2.setFromMatrixPosition(et.matrixWorld),rt=nt.sub(it),ot=et.getWorldDirection(v3);return rt.angleTo(ot)>Math.PI/2}function isObjectVisible(tt,et,nt,it){const rt=v1.setFromMatrixPosition(tt.matrixWorld),ot=rt.clone();ot.project(et),nt.setFromCamera(ot,et);const at=nt.intersectObjects(it,!0);if(at.length){const st=at[0].distance;return rt.distanceTo(nt.ray.origin)Math.abs(tt)<1e-10?0:tt;function getCSSMatrix(tt,et,nt=""){let it="matrix3d(";for(let rt=0;rt!==16;rt++)it+=epsilon$1(et[rt]*tt.elements[rt])+(rt!==15?",":")");return nt+it}const getCameraCSSMatrix=(tt=>et=>getCSSMatrix(et,tt))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),getObjectCSSMatrix=(tt=>(et,nt)=>getCSSMatrix(et,tt(nt),"translate(-50%,-50%)"))(tt=>[1/tt,1/tt,1/tt,1,-1/tt,-1/tt,-1/tt,-1,1/tt,1/tt,1/tt,1,1,1,1,1]);function isRefObject(tt){return tt&&typeof tt=="object"&&"current"in tt}const Html$1=reactExports.forwardRef(({children:tt,eps:et=.001,style:nt,className:it,prepend:rt,center:ot,fullscreen:at,portal:st,distanceFactor:lt,sprite:ct=!1,transform:ut=!1,occlude:ht,onOcclude:dt,castShadow:pt,receiveShadow:mt,material:gt,geometry:bt,zIndexRange:yt=[16777271,0],calculatePosition:wt=defaultCalculatePosition,as:vt="div",wrapperClass:xt,pointerEvents:St="auto",...Et},It)=>{const{gl:Tt,camera:$t,scene:Ut,size:Lt,raycaster:Bt,events:Pt,viewport:kt}=useThree(),[At]=reactExports.useState(()=>document.createElement(vt)),Rt=reactExports.useRef(),Wt=reactExports.useRef(null),jt=reactExports.useRef(0),Ot=reactExports.useRef([0,0]),Ct=reactExports.useRef(null),Dt=reactExports.useRef(null),Mt=(st==null?void 0:st.current)||Pt.connected||Tt.domElement.parentNode,Vt=reactExports.useRef(null),Qt=reactExports.useRef(!1),rn=reactExports.useMemo(()=>ht&&ht!=="blending"||Array.isArray(ht)&&ht.length&&isRefObject(ht[0]),[ht]);reactExports.useLayoutEffect(()=>{const vn=Tt.domElement;ht&&ht==="blending"?(vn.style.zIndex=`${Math.floor(yt[0]/2)}`,vn.style.position="absolute",vn.style.pointerEvents="none"):(vn.style.zIndex=null,vn.style.position=null,vn.style.pointerEvents=null)},[ht]),reactExports.useLayoutEffect(()=>{if(Wt.current){const vn=Rt.current=createRoot$1(At);if(Ut.updateMatrixWorld(),ut)At.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const sn=wt(Wt.current,$t,Lt);At.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${sn[0]}px,${sn[1]}px,0);transform-origin:0 0;`}return Mt&&(rt?Mt.prepend(At):Mt.appendChild(At)),()=>{Mt&&Mt.removeChild(At),vn.unmount()}}},[Mt,ut]),reactExports.useLayoutEffect(()=>{xt&&(At.className=xt)},[xt]);const Xt=reactExports.useMemo(()=>ut?{position:"absolute",top:0,left:0,width:Lt.width,height:Lt.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:ot?"translate3d(-50%,-50%,0)":"none",...at&&{top:-Lt.height/2,left:-Lt.width/2,width:Lt.width,height:Lt.height},...nt},[nt,ot,at,Lt,ut]),an=reactExports.useMemo(()=>({position:"absolute",pointerEvents:St}),[St]);reactExports.useLayoutEffect(()=>{if(Qt.current=!1,ut){var vn;(vn=Rt.current)==null||vn.render(reactExports.createElement("div",{ref:Ct,style:Xt},reactExports.createElement("div",{ref:Dt,style:an},reactExports.createElement("div",{ref:It,className:it,style:nt,children:tt}))))}else{var sn;(sn=Rt.current)==null||sn.render(reactExports.createElement("div",{ref:It,style:Xt,className:it,children:tt}))}});const tn=reactExports.useRef(!0);useFrame(vn=>{if(Wt.current){$t.updateMatrixWorld(),Wt.current.updateWorldMatrix(!0,!1);const sn=ut?Ot.current:wt(Wt.current,$t,Lt);if(ut||Math.abs(jt.current-$t.zoom)>et||Math.abs(Ot.current[0]-sn[0])>et||Math.abs(Ot.current[1]-sn[1])>et){const Zt=isObjectBehindCamera(Wt.current,$t);let Sn=!1;rn&&(ht!=="blending"?Sn=[Ut]:Array.isArray(ht)&&(Sn=ht.map(Un=>Un.current)));const Tn=tn.current;if(Sn){const Un=isObjectVisible(Wt.current,$t,Bt,Sn);tn.current=Un&&!Zt}else tn.current=!Zt;Tn!==tn.current&&(dt?dt(!tn.current):At.style.display=tn.current?"block":"none");const Cn=Math.floor(yt[0]/2),jn=ht?rn?[yt[0],Cn]:[Cn-1,0]:yt;if(At.style.zIndex=`${objectZIndex(Wt.current,$t,jn)}`,ut){const[Un,yn]=[Lt.width/2,Lt.height/2],un=$t.projectionMatrix.elements[5]*yn,{isOrthographicCamera:En,top:In,left:xn,bottom:dn,right:cn}=$t,hn=getCameraCSSMatrix($t.matrixWorldInverse),$n=En?`scale(${un})translate(${epsilon$1(-(cn+xn)/2)}px,${epsilon$1((In+dn)/2)}px)`:`translateZ(${un}px)`;let nn=Wt.current.matrixWorld;ct&&(nn=$t.matrixWorldInverse.clone().transpose().copyPosition(nn).scale(Wt.current.scale),nn.elements[3]=nn.elements[7]=nn.elements[11]=0,nn.elements[15]=1),At.style.width=Lt.width+"px",At.style.height=Lt.height+"px",At.style.perspective=En?"":`${un}px`,Ct.current&&Dt.current&&(Ct.current.style.transform=`${$n}${hn}translate(${Un}px,${yn}px)`,Dt.current.style.transform=getObjectCSSMatrix(nn,1/((lt||10)/400)))}else{const Un=lt===void 0?1:objectScale(Wt.current,$t)*lt;At.style.transform=`translate3d(${sn[0]}px,${sn[1]}px,0) scale(${Un})`}Ot.current=sn,jt.current=$t.zoom}}if(!rn&&Vt.current&&!Qt.current)if(ut){if(Ct.current){const sn=Ct.current.children[0];if(sn!=null&&sn.clientWidth&&sn!=null&&sn.clientHeight){const{isOrthographicCamera:Zt}=$t;if(Zt||bt)Et.scale&&(Array.isArray(Et.scale)?Et.scale instanceof Vector3?Vt.current.scale.copy(Et.scale.clone().divideScalar(1)):Vt.current.scale.set(1/Et.scale[0],1/Et.scale[1],1/Et.scale[2]):Vt.current.scale.setScalar(1/Et.scale));else{const Sn=(lt||10)/400,Tn=sn.clientWidth*Sn,Cn=sn.clientHeight*Sn;Vt.current.scale.set(Tn,Cn,1)}Qt.current=!0}}}else{const sn=At.children[0];if(sn!=null&&sn.clientWidth&&sn!=null&&sn.clientHeight){const Zt=1/kt.factor,Sn=sn.clientWidth*Zt,Tn=sn.clientHeight*Zt;Vt.current.scale.set(Sn,Tn,1),Qt.current=!0}Vt.current.lookAt(vn.camera.position)}});const pn=reactExports.useMemo(()=>({vertexShader:ut?void 0:` + `)+Rt.join(" > ")}return null},nt.getPublicRootInstance=function(Rt){if(Rt=Rt.current,!Rt.child)return null;switch(Rt.child.tag){case 5:return Ct(Rt.child.stateNode);default:return Rt.child.stateNode}},nt.injectIntoDevTools=function(Rt){if(Rt={bundleType:Rt.bundleType,version:Rt.version,rendererPackageName:Rt.rendererPackageName,rendererConfig:Rt.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:st.ReactCurrentDispatcher,findHostInstanceByFiber:Xy,findFiberByHostInstance:Rt.findFiberByHostInstance||Ay,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")Rt=!1;else{var Lt=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(Lt.isDisabled||!Lt.supportsFiber)Rt=!0;else{try{Vu=Lt.inject(Rt),Xs=Lt}catch{}Rt=!!Lt.checkDCE}}return Rt},nt.isAlreadyRendering=function(){return!1},nt.observeVisibleRects=function(Rt,Lt,Gt,Qt){if(!gn)throw Error(at(363));Rt=vm(Rt,Lt);var pn=tn(Rt,Gt,Qt).disconnect;return{disconnect:function(){pn()}}},nt.registerMutableSourceForHydration=function(Rt,Lt){var Gt=Lt._getVersion;Gt=Gt(Lt._source),Rt.mutableSourceEagerHydrationData==null?Rt.mutableSourceEagerHydrationData=[Lt,Gt]:Rt.mutableSourceEagerHydrationData.push(Lt,Gt)},nt.runWithPriority=function(Rt,Lt){var Gt=Lo;try{return Lo=Rt,Lt()}finally{Lo=Gt}},nt.shouldError=function(){return null},nt.shouldSuspend=function(){return!1},nt.updateContainer=function(Rt,Lt,Gt,Qt){var pn=Lt.current,$n=js(),Hn=cu(pn);return Gt=p0(Gt),Lt.context===null?Lt.context=Gt:Lt.pendingContext=Gt,Lt=Ps($n,Hn),Lt.payload={element:Rt},Qt=Qt===void 0?null:Qt,Qt!==null&&(Lt.callback=Qt),Ll(pn,Lt),Rt=Pl(pn,Hn,$n),Rt!==null&&lp(Rt,pn,Hn),Hn},nt};reactReconciler.exports=reactReconciler_production_min;var reactReconcilerExports=reactReconciler.exports;const Reconciler=getDefaultExportFromCjs(reactReconcilerExports),isPromise=tt=>typeof tt=="object"&&typeof tt.then=="function",globalCache$1=[];function shallowEqualArrays$1(tt,et,nt=(it,rt)=>it===rt){if(tt===et)return!0;if(!tt||!et)return!1;const it=tt.length;if(et.length!==it)return!1;for(let rt=0;rt0&&(ot.timeout&&clearTimeout(ot.timeout),ot.timeout=setTimeout(ot.remove,it.lifespan)),ot.response;if(!nt)throw ot.promise}const rt={keys:et,equal:it.equal,remove:()=>{const ot=globalCache$1.indexOf(rt);ot!==-1&&globalCache$1.splice(ot,1)},promise:(isPromise(tt)?tt:tt(...et)).then(ot=>{rt.response=ot,it.lifespan&&it.lifespan>0&&(rt.timeout=setTimeout(rt.remove,it.lifespan))}).catch(ot=>rt.error=ot)};if(globalCache$1.push(rt),!nt)throw rt.promise}const suspend$1=(tt,et,nt)=>query$1(tt,et,!1,nt),preload=(tt,et,nt)=>void query$1(tt,et,!0,nt),clear=tt=>{if(tt===void 0||tt.length===0)globalCache$1.splice(0,globalCache$1.length);else{const et=globalCache$1.find(nt=>shallowEqualArrays$1(tt,nt.keys,nt.equal));et&&et.remove()}},catalogue={},extend$3=tt=>void Object.assign(catalogue,tt);function createRenderer(tt,et){function nt(ut,{args:ht=[],attach:dt,...pt},mt){let gt=`${ut[0].toUpperCase()}${ut.slice(1)}`,bt;if(ut==="primitive"){if(pt.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const yt=pt.object;bt=prepare(yt,{type:ut,root:mt,attach:dt,primitive:!0})}else{const yt=catalogue[gt];if(!yt)throw new Error(`R3F: ${gt} 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(ht))throw new Error("R3F: The args prop must be an array!");bt=prepare(new yt(...ht),{type:ut,root:mt,attach:dt,memoizedProps:{args:ht}})}return bt.__r3f.attach===void 0&&(bt instanceof BufferGeometry?bt.__r3f.attach="geometry":bt instanceof Material&&(bt.__r3f.attach="material")),gt!=="inject"&&applyProps$1(bt,pt),bt}function it(ut,ht){let dt=!1;if(ht){var pt,mt;(pt=ht.__r3f)!=null&&pt.attach?attach(ut,ht,ht.__r3f.attach):ht.isObject3D&&ut.isObject3D&&(ut.add(ht),dt=!0),dt||(mt=ut.__r3f)==null||mt.objects.push(ht),ht.__r3f||prepare(ht,{}),ht.__r3f.parent=ut,updateInstance(ht),invalidateInstance(ht)}}function rt(ut,ht,dt){let pt=!1;if(ht){var mt,gt;if((mt=ht.__r3f)!=null&&mt.attach)attach(ut,ht,ht.__r3f.attach);else if(ht.isObject3D&&ut.isObject3D){ht.parent=ut,ht.dispatchEvent({type:"added"});const bt=ut.children.filter(wt=>wt!==ht),yt=bt.indexOf(dt);ut.children=[...bt.slice(0,yt),ht,...bt.slice(yt)],pt=!0}pt||(gt=ut.__r3f)==null||gt.objects.push(ht),ht.__r3f||prepare(ht,{}),ht.__r3f.parent=ut,updateInstance(ht),invalidateInstance(ht)}}function ot(ut,ht,dt=!1){ut&&[...ut].forEach(pt=>at(ht,pt,dt))}function at(ut,ht,dt){if(ht){var pt,mt,gt;if(ht.__r3f&&(ht.__r3f.parent=null),(pt=ut.__r3f)!=null&&pt.objects&&(ut.__r3f.objects=ut.__r3f.objects.filter(xt=>xt!==ht)),(mt=ht.__r3f)!=null&&mt.attach)detach(ut,ht,ht.__r3f.attach);else if(ht.isObject3D&&ut.isObject3D){var bt;ut.remove(ht),(bt=ht.__r3f)!=null&&bt.root&&removeInteractivity(ht.__r3f.root,ht)}const wt=(gt=ht.__r3f)==null?void 0:gt.primitive,vt=!wt&&(dt===void 0?ht.dispose!==null:dt);if(!wt){var yt;ot((yt=ht.__r3f)==null?void 0:yt.objects,ht,vt),ot(ht.children,ht,vt)}if(delete ht.__r3f,vt&&ht.dispose&&ht.type!=="Scene"){const xt=()=>{try{ht.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?schedulerExports.unstable_scheduleCallback(schedulerExports.unstable_IdlePriority,xt):xt()}invalidateInstance(ut)}}function st(ut,ht,dt,pt){var mt;const gt=(mt=ut.__r3f)==null?void 0:mt.parent;if(!gt)return;const bt=nt(ht,dt,ut.__r3f.root);if(ut.children){for(const yt of ut.children)yt.__r3f&&it(bt,yt);ut.children=ut.children.filter(yt=>!yt.__r3f)}ut.__r3f.objects.forEach(yt=>it(bt,yt)),ut.__r3f.objects=[],ut.__r3f.autoRemovedBeforeAppend||at(gt,ut),bt.parent&&(bt.__r3f.autoRemovedBeforeAppend=!0),it(gt,bt),bt.raycast&&bt.__r3f.eventCount&&bt.__r3f.root.getState().internal.interaction.push(bt),[pt,pt.alternate].forEach(yt=>{yt!==null&&(yt.stateNode=bt,yt.ref&&(typeof yt.ref=="function"?yt.ref(bt):yt.ref.current=bt))})}const lt=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:Reconciler({createInstance:nt,removeChild:at,appendChild:it,appendInitialChild:it,insertBefore:rt,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(ut,ht)=>{if(!ht)return;const dt=ut.getState().scene;dt.__r3f&&(dt.__r3f.root=ut,it(dt,ht))},removeChildFromContainer:(ut,ht)=>{ht&&at(ut.getState().scene,ht)},insertInContainerBefore:(ut,ht,dt)=>{if(!ht||!dt)return;const pt=ut.getState().scene;pt.__r3f&&rt(pt,ht,dt)},getRootHostContext:()=>null,getChildHostContext:ut=>ut,finalizeInitialChildren(ut){var ht;return!!((ht=ut==null?void 0:ut.__r3f)!=null?ht:{}).handlers},prepareUpdate(ut,ht,dt,pt){var mt;if(((mt=ut==null?void 0:ut.__r3f)!=null?mt:{}).primitive&&pt.object&&pt.object!==ut)return[!0];{const{args:bt=[],children:yt,...wt}=pt,{args:vt=[],children:xt,...St}=dt;if(!Array.isArray(bt))throw new Error("R3F: the args prop must be an array!");if(bt.some(($t,It)=>$t!==vt[It]))return[!0];const Et=diffProps(ut,wt,St,!0);return Et.changes.length?[!1,Et]:null}},commitUpdate(ut,[ht,dt],pt,mt,gt,bt){ht?st(ut,pt,gt,bt):applyProps$1(ut,dt)},commitMount(ut,ht,dt,pt){var mt;const gt=(mt=ut.__r3f)!=null?mt:{};ut.raycast&>.handlers&>.eventCount&&ut.__r3f.root.getState().internal.interaction.push(ut)},getPublicInstance:ut=>ut,prepareForCommit:()=>null,preparePortalMount:ut=>prepare(ut.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(ut){var ht;const{attach:dt,parent:pt}=(ht=ut.__r3f)!=null?ht:{};dt&&pt&&detach(pt,ut,dt),ut.isObject3D&&(ut.visible=!1),invalidateInstance(ut)},unhideInstance(ut,ht){var dt;const{attach:pt,parent:mt}=(dt=ut.__r3f)!=null?dt:{};pt&&mt&&attach(mt,ut,pt),(ut.isObject3D&&ht.visible==null||ht.visible)&&(ut.visible=!0),invalidateInstance(ut)},createTextInstance:lt,hideTextInstance:lt,unhideTextInstance:lt,getCurrentEventPriority:()=>et?et():constantsExports.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&is$1.fun(performance.now)?performance.now:is$1.fun(Date.now)?Date.now:()=>0,scheduleTimeout:is$1.fun(setTimeout)?setTimeout:void 0,cancelTimeout:is$1.fun(clearTimeout)?clearTimeout:void 0}),applyProps:applyProps$1}}var _window$document,_window$navigator;const hasColorSpace=tt=>"colorSpace"in tt||"outputColorSpace"in tt,getColorManagement=()=>{var tt;return(tt=catalogue.ColorManagement)!=null?tt:null},isOrthographicCamera$1=tt=>tt&&tt.isOrthographicCamera,isRef=tt=>tt&&tt.hasOwnProperty("current"),useIsomorphicLayoutEffect$1=typeof window<"u"&&((_window$document=window.document)!=null&&_window$document.createElement||((_window$navigator=window.navigator)==null?void 0:_window$navigator.product)==="ReactNative")?reactExports.useLayoutEffect:reactExports.useEffect;function useMutableCallback(tt){const et=reactExports.useRef(tt);return useIsomorphicLayoutEffect$1(()=>void(et.current=tt),[tt]),et}function Block({set:tt}){return useIsomorphicLayoutEffect$1(()=>(tt(new Promise(()=>null)),()=>tt(!1)),[tt]),null}class ErrorBoundary extends reactExports.Component{constructor(...et){super(...et),this.state={error:!1}}componentDidCatch(et){this.props.set(et)}render(){return this.state.error?null:this.props.children}}ErrorBoundary.getDerivedStateFromError=()=>({error:!0});const DEFAULT="__default",DEFAULTS=new Map,isDiffSet=tt=>tt&&!!tt.memoized&&!!tt.changes;function calculateDpr(tt){var et;const nt=typeof window<"u"?(et=window.devicePixelRatio)!=null?et:2:1;return Array.isArray(tt)?Math.min(Math.max(tt[0],nt),tt[1]):tt}const getRootState=tt=>{var et;return(et=tt.__r3f)==null?void 0:et.root.getState()},is$1={obj:tt=>tt===Object(tt)&&!is$1.arr(tt)&&typeof tt!="function",fun:tt=>typeof tt=="function",str:tt=>typeof tt=="string",num:tt=>typeof tt=="number",boo:tt=>typeof tt=="boolean",und:tt=>tt===void 0,arr:tt=>Array.isArray(tt),equ(tt,et,{arrays:nt="shallow",objects:it="reference",strict:rt=!0}={}){if(typeof tt!=typeof et||!!tt!=!!et)return!1;if(is$1.str(tt)||is$1.num(tt))return tt===et;const ot=is$1.obj(tt);if(ot&&it==="reference")return tt===et;const at=is$1.arr(tt);if(at&&nt==="reference")return tt===et;if((at||ot)&&tt===et)return!0;let st;for(st in tt)if(!(st in et))return!1;if(ot&&nt==="shallow"&&it==="shallow"){for(st in rt?et:tt)if(!is$1.equ(tt[st],et[st],{strict:rt,objects:"reference"}))return!1}else for(st in rt?et:tt)if(tt[st]!==et[st])return!1;if(is$1.und(st)){if(at&&tt.length===0&&et.length===0||ot&&Object.keys(tt).length===0&&Object.keys(et).length===0)return!0;if(tt!==et)return!1}return!0}};function buildGraph(tt){const et={nodes:{},materials:{}};return tt&&tt.traverse(nt=>{nt.name&&(et.nodes[nt.name]=nt),nt.material&&!et.materials[nt.material.name]&&(et.materials[nt.material.name]=nt.material)}),et}function dispose(tt){tt.dispose&&tt.type!=="Scene"&&tt.dispose();for(const et in tt)et.dispose==null||et.dispose(),delete tt[et]}function prepare(tt,et){const nt=tt;return nt.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...et},tt}function resolve(tt,et){let nt=tt;if(et.includes("-")){const it=et.split("-"),rt=it.pop();return nt=it.reduce((ot,at)=>ot[at],tt),{target:nt,key:rt}}else return{target:nt,key:et}}const INDEX_REGEX=/-\d+$/;function attach(tt,et,nt){if(is$1.str(nt)){if(INDEX_REGEX.test(nt)){const ot=nt.replace(INDEX_REGEX,""),{target:at,key:st}=resolve(tt,ot);Array.isArray(at[st])||(at[st]=[])}const{target:it,key:rt}=resolve(tt,nt);et.__r3f.previousAttach=it[rt],it[rt]=et}else et.__r3f.previousAttach=nt(tt,et)}function detach(tt,et,nt){var it,rt;if(is$1.str(nt)){const{target:ot,key:at}=resolve(tt,nt),st=et.__r3f.previousAttach;st===void 0?delete ot[at]:ot[at]=st}else(it=et.__r3f)==null||it.previousAttach==null||it.previousAttach(tt,et);(rt=et.__r3f)==null||delete rt.previousAttach}function diffProps(tt,{children:et,key:nt,ref:it,...rt},{children:ot,key:at,ref:st,...lt}={},ct=!1){var ut;const ht=(ut=tt==null?void 0:tt.__r3f)!=null?ut:{},dt=Object.entries(rt),pt=[];if(ct){const gt=Object.keys(lt);for(let bt=0;bt{var yt;if((yt=tt.__r3f)!=null&&yt.primitive&>==="object"||is$1.equ(bt,lt[gt]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(gt))return pt.push([gt,bt,!0,[]]);let wt=[];gt.includes("-")&&(wt=gt.split("-")),pt.push([gt,bt,!1,wt]);for(const vt in rt){const xt=rt[vt];vt.startsWith(`${gt}-`)&&pt.push([vt,xt,!1,vt.split("-")])}});const mt={...rt};return ht.memoizedProps&&ht.memoizedProps.args&&(mt.args=ht.memoizedProps.args),ht.memoizedProps&&ht.memoizedProps.attach&&(mt.attach=ht.memoizedProps.attach),{memoized:mt,changes:pt}}const __DEV__=typeof process<"u"&&!1;function applyProps$1(tt,et){var nt,it,rt;const ot=(nt=tt.__r3f)!=null?nt:{},at=ot.root,st=(it=at==null||at.getState==null?void 0:at.getState())!=null?it:{},{memoized:lt,changes:ct}=isDiffSet(et)?et:diffProps(tt,et),ut=ot.eventCount;tt.__r3f&&(tt.__r3f.memoizedProps=lt);for(let dt=0;dtvt[xt],tt),!(wt&&wt.set))){const[vt,...xt]=bt.reverse();yt=xt.reverse().reduce((St,Et)=>St[Et],tt),pt=vt}if(mt===DEFAULT+"remove")if(yt.constructor){let vt=DEFAULTS.get(yt.constructor);vt||(vt=new yt.constructor,DEFAULTS.set(yt.constructor,vt)),mt=vt[pt]}else mt=0;if(gt)mt?ot.handlers[pt]=mt:delete ot.handlers[pt],ot.eventCount=Object.keys(ot.handlers).length;else if(wt&&wt.set&&(wt.copy||wt instanceof Layers)){if(Array.isArray(mt))wt.fromArray?wt.fromArray(mt):wt.set(...mt);else if(wt.copy&&mt&&mt.constructor&&(__DEV__?wt.constructor.name===mt.constructor.name:wt.constructor===mt.constructor))wt.copy(mt);else if(mt!==void 0){const vt=wt instanceof Color$1;!vt&&wt.setScalar?wt.setScalar(mt):wt instanceof Layers&&mt instanceof Layers?wt.mask=mt.mask:wt.set(mt),!getColorManagement()&&!st.linear&&vt&&wt.convertSRGBToLinear()}}else if(yt[pt]=mt,yt[pt]instanceof Texture&&yt[pt].format===RGBAFormat&&yt[pt].type===UnsignedByteType){const vt=yt[pt];hasColorSpace(vt)&&hasColorSpace(st.gl)?vt.colorSpace=st.gl.outputColorSpace:vt.encoding=st.gl.outputEncoding}invalidateInstance(tt)}if(ot.parent&&st.internal&&tt.raycast&&ut!==ot.eventCount){const dt=st.internal.interaction.indexOf(tt);dt>-1&&st.internal.interaction.splice(dt,1),ot.eventCount&&st.internal.interaction.push(tt)}return!(ct.length===1&&ct[0][0]==="onUpdate")&&ct.length&&(rt=tt.__r3f)!=null&&rt.parent&&updateInstance(tt),tt}function invalidateInstance(tt){var et,nt;const it=(et=tt.__r3f)==null||(nt=et.root)==null||nt.getState==null?void 0:nt.getState();it&&it.internal.frames===0&&it.invalidate()}function updateInstance(tt){tt.onUpdate==null||tt.onUpdate(tt)}function updateCamera(tt,et){tt.manual||(isOrthographicCamera$1(tt)?(tt.left=et.width/-2,tt.right=et.width/2,tt.top=et.height/2,tt.bottom=et.height/-2):tt.aspect=et.width/et.height,tt.updateProjectionMatrix(),tt.updateMatrixWorld())}function makeId(tt){return(tt.eventObject||tt.object).uuid+"/"+tt.index+tt.instanceId}function getEventPriority(){var tt;const et=typeof self<"u"&&self||typeof window<"u"&&window;if(!et)return constantsExports.DefaultEventPriority;switch((tt=et.event)==null?void 0:tt.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return constantsExports.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return constantsExports.ContinuousEventPriority;default:return constantsExports.DefaultEventPriority}}function releaseInternalPointerCapture(tt,et,nt,it){const rt=nt.get(et);rt&&(nt.delete(et),nt.size===0&&(tt.delete(it),rt.target.releasePointerCapture(it)))}function removeInteractivity(tt,et){const{internal:nt}=tt.getState();nt.interaction=nt.interaction.filter(it=>it!==et),nt.initialHits=nt.initialHits.filter(it=>it!==et),nt.hovered.forEach((it,rt)=>{(it.eventObject===et||it.object===et)&&nt.hovered.delete(rt)}),nt.capturedMap.forEach((it,rt)=>{releaseInternalPointerCapture(nt.capturedMap,et,it,rt)})}function createEvents(tt){function et(lt){const{internal:ct}=tt.getState(),ut=lt.offsetX-ct.initialClick[0],ht=lt.offsetY-ct.initialClick[1];return Math.round(Math.sqrt(ut*ut+ht*ht))}function nt(lt){return lt.filter(ct=>["Move","Over","Enter","Out","Leave"].some(ut=>{var ht;return(ht=ct.__r3f)==null?void 0:ht.handlers["onPointer"+ut]}))}function it(lt,ct){const ut=tt.getState(),ht=new Set,dt=[],pt=ct?ct(ut.internal.interaction):ut.internal.interaction;for(let yt=0;yt{const vt=getRootState(yt.object),xt=getRootState(wt.object);return!vt||!xt?yt.distance-wt.distance:xt.events.priority-vt.events.priority||yt.distance-wt.distance}).filter(yt=>{const wt=makeId(yt);return ht.has(wt)?!1:(ht.add(wt),!0)});ut.events.filter&&(gt=ut.events.filter(gt,ut));for(const yt of gt){let wt=yt.object;for(;wt;){var bt;(bt=wt.__r3f)!=null&&bt.eventCount&&dt.push({...yt,eventObject:wt}),wt=wt.parent}}if("pointerId"in lt&&ut.internal.capturedMap.has(lt.pointerId))for(let yt of ut.internal.capturedMap.get(lt.pointerId).values())ht.has(makeId(yt.intersection))||dt.push(yt.intersection);return dt}function rt(lt,ct,ut,ht){const dt=tt.getState();if(lt.length){const pt={stopped:!1};for(const mt of lt){const gt=getRootState(mt.object)||dt,{raycaster:bt,pointer:yt,camera:wt,internal:vt}=gt,xt=new Vector3(yt.x,yt.y,0).unproject(wt),St=Ht=>{var zt,Ot;return(zt=(Ot=vt.capturedMap.get(Ht))==null?void 0:Ot.has(mt.eventObject))!=null?zt:!1},Et=Ht=>{const zt={intersection:mt,target:ct.target};vt.capturedMap.has(Ht)?vt.capturedMap.get(Ht).set(mt.eventObject,zt):vt.capturedMap.set(Ht,new Map([[mt.eventObject,zt]])),ct.target.setPointerCapture(Ht)},$t=Ht=>{const zt=vt.capturedMap.get(Ht);zt&&releaseInternalPointerCapture(vt.capturedMap,mt.eventObject,zt,Ht)};let It={};for(let Ht in ct){let zt=ct[Ht];typeof zt!="function"&&(It[Ht]=zt)}let Ft={...mt,...It,pointer:yt,intersections:lt,stopped:pt.stopped,delta:ut,unprojectedPoint:xt,ray:bt.ray,camera:wt,stopPropagation(){const Ht="pointerId"in ct&&vt.capturedMap.get(ct.pointerId);if((!Ht||Ht.has(mt.eventObject))&&(Ft.stopped=pt.stopped=!0,vt.hovered.size&&Array.from(vt.hovered.values()).find(zt=>zt.eventObject===mt.eventObject))){const zt=lt.slice(0,lt.indexOf(mt));ot([...zt,mt])}},target:{hasPointerCapture:St,setPointerCapture:Et,releasePointerCapture:$t},currentTarget:{hasPointerCapture:St,setPointerCapture:Et,releasePointerCapture:$t},nativeEvent:ct};if(ht(Ft),pt.stopped===!0)break}}return lt}function ot(lt){const{internal:ct}=tt.getState();for(const ut of ct.hovered.values())if(!lt.length||!lt.find(ht=>ht.object===ut.object&&ht.index===ut.index&&ht.instanceId===ut.instanceId)){const dt=ut.eventObject.__r3f,pt=dt==null?void 0:dt.handlers;if(ct.hovered.delete(makeId(ut)),dt!=null&&dt.eventCount){const mt={...ut,intersections:lt};pt.onPointerOut==null||pt.onPointerOut(mt),pt.onPointerLeave==null||pt.onPointerLeave(mt)}}}function at(lt,ct){for(let ut=0;utot([]);case"onLostPointerCapture":return ct=>{const{internal:ut}=tt.getState();"pointerId"in ct&&ut.capturedMap.has(ct.pointerId)&&requestAnimationFrame(()=>{ut.capturedMap.has(ct.pointerId)&&(ut.capturedMap.delete(ct.pointerId),ot([]))})}}return function(ut){const{onPointerMissed:ht,internal:dt}=tt.getState();dt.lastEvent.current=ut;const pt=lt==="onPointerMove",mt=lt==="onClick"||lt==="onContextMenu"||lt==="onDoubleClick",bt=it(ut,pt?nt:void 0),yt=mt?et(ut):0;lt==="onPointerDown"&&(dt.initialClick=[ut.offsetX,ut.offsetY],dt.initialHits=bt.map(vt=>vt.eventObject)),mt&&!bt.length&&yt<=2&&(at(ut,dt.interaction),ht&&ht(ut)),pt&&ot(bt);function wt(vt){const xt=vt.eventObject,St=xt.__r3f,Et=St==null?void 0:St.handlers;if(St!=null&&St.eventCount)if(pt){if(Et.onPointerOver||Et.onPointerEnter||Et.onPointerOut||Et.onPointerLeave){const $t=makeId(vt),It=dt.hovered.get($t);It?It.stopped&&vt.stopPropagation():(dt.hovered.set($t,vt),Et.onPointerOver==null||Et.onPointerOver(vt),Et.onPointerEnter==null||Et.onPointerEnter(vt))}Et.onPointerMove==null||Et.onPointerMove(vt)}else{const $t=Et[lt];$t?(!mt||dt.initialHits.includes(xt))&&(at(ut,dt.interaction.filter(It=>!dt.initialHits.includes(It))),$t(vt)):mt&&dt.initialHits.includes(xt)&&at(ut,dt.interaction.filter(It=>!dt.initialHits.includes(It)))}}rt(bt,ut,yt,wt)}}return{handlePointer:st}}const isRenderer=tt=>!!(tt!=null&&tt.render),context$2=reactExports.createContext(null),createStore$1=(tt,et)=>{const nt=create$3((st,lt)=>{const ct=new Vector3,ut=new Vector3,ht=new Vector3;function dt(yt=lt().camera,wt=ut,vt=lt().size){const{width:xt,height:St,top:Et,left:$t}=vt,It=xt/St;wt instanceof Vector3?ht.copy(wt):ht.set(...wt);const Ft=yt.getWorldPosition(ct).distanceTo(ht);if(isOrthographicCamera$1(yt))return{width:xt/yt.zoom,height:St/yt.zoom,top:Et,left:$t,factor:1,distance:Ft,aspect:It};{const Ht=yt.fov*Math.PI/180,zt=2*Math.tan(Ht/2)*Ft,Ot=zt*(xt/St);return{width:Ot,height:zt,top:Et,left:$t,factor:xt/Ot,distance:Ft,aspect:It}}}let pt;const mt=yt=>st(wt=>({performance:{...wt.performance,current:yt}})),gt=new Vector2;return{set:st,get:lt,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(yt=1)=>tt(lt(),yt),advance:(yt,wt)=>et(yt,wt,lt()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Clock$1,pointer:gt,mouse:gt,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const yt=lt();pt&&clearTimeout(pt),yt.performance.current!==yt.performance.min&&mt(yt.performance.min),pt=setTimeout(()=>mt(lt().performance.max),yt.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:dt},setEvents:yt=>st(wt=>({...wt,events:{...wt.events,...yt}})),setSize:(yt,wt,vt,xt,St)=>{const Et=lt().camera,$t={width:yt,height:wt,top:xt||0,left:St||0,updateStyle:vt};st(It=>({size:$t,viewport:{...It.viewport,...dt(Et,ut,$t)}}))},setDpr:yt=>st(wt=>{const vt=calculateDpr(yt);return{viewport:{...wt.viewport,dpr:vt,initialDpr:wt.viewport.initialDpr||vt}}}),setFrameloop:(yt="always")=>{const wt=lt().clock;wt.stop(),wt.elapsedTime=0,yt!=="never"&&(wt.start(),wt.elapsedTime=0),st(()=>({frameloop:yt}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:reactExports.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(yt,wt,vt)=>{const xt=lt().internal;return xt.priority=xt.priority+(wt>0?1:0),xt.subscribers.push({ref:yt,priority:wt,store:vt}),xt.subscribers=xt.subscribers.sort((St,Et)=>St.priority-Et.priority),()=>{const St=lt().internal;St!=null&&St.subscribers&&(St.priority=St.priority-(wt>0?1:0),St.subscribers=St.subscribers.filter(Et=>Et.ref!==yt))}}}}}),it=nt.getState();let rt=it.size,ot=it.viewport.dpr,at=it.camera;return nt.subscribe(()=>{const{camera:st,size:lt,viewport:ct,gl:ut,set:ht}=nt.getState();if(lt.width!==rt.width||lt.height!==rt.height||ct.dpr!==ot){var dt;rt=lt,ot=ct.dpr,updateCamera(st,lt),ut.setPixelRatio(ct.dpr);const pt=(dt=lt.updateStyle)!=null?dt:typeof HTMLCanvasElement<"u"&&ut.domElement instanceof HTMLCanvasElement;ut.setSize(lt.width,lt.height,pt)}st!==at&&(at=st,ht(pt=>({viewport:{...pt.viewport,...pt.viewport.getCurrentViewport(st)}})))}),nt.subscribe(st=>tt(st)),nt};function createSubs(tt,et){const nt={callback:tt};return et.add(nt),()=>void et.delete(nt)}let i$3,globalEffects=new Set,globalAfterEffects=new Set,globalTailEffects=new Set;const addEffect=tt=>createSubs(tt,globalEffects),addAfterEffect=tt=>createSubs(tt,globalAfterEffects),addTail=tt=>createSubs(tt,globalTailEffects);function run(tt,et){if(tt.size)for(const{callback:nt}of tt.values())nt(et)}function flushGlobalEffects(tt,et){switch(tt){case"before":return run(globalEffects,et);case"after":return run(globalAfterEffects,et);case"tail":return run(globalTailEffects,et)}}let subscribers,subscription;function render$1(tt,et,nt){let it=et.clock.getDelta();for(et.frameloop==="never"&&typeof tt=="number"&&(it=tt-et.clock.elapsedTime,et.clock.oldTime=et.clock.elapsedTime,et.clock.elapsedTime=tt),subscribers=et.internal.subscribers,i$3=0;i$30)&&!((ct=rt.gl.xr)!=null&&ct.isPresenting)&&(nt+=render$1(lt,rt))}if(flushGlobalEffects("after",lt),nt===0)return flushGlobalEffects("tail",lt),et=!1,cancelAnimationFrame(it)}function at(lt,ct=1){var ut;if(!lt)return tt.forEach(ht=>at(ht.store.getState()),ct);(ut=lt.gl.xr)!=null&&ut.isPresenting||!lt.internal.active||lt.frameloop==="never"||(lt.internal.frames=Math.min(60,lt.internal.frames+ct),et||(et=!0,requestAnimationFrame(ot)))}function st(lt,ct=!0,ut,ht){if(ct&&flushGlobalEffects("before",lt),ut)render$1(lt,ut,ht);else for(const dt of tt.values())render$1(lt,dt.store.getState());ct&&flushGlobalEffects("after",lt)}return{loop:ot,invalidate:at,advance:st}}function useInstanceHandle(tt){const et=reactExports.useRef(null);return useIsomorphicLayoutEffect$1(()=>void(et.current=tt.current.__r3f),[tt]),et}function useStore$1(){const tt=reactExports.useContext(context$2);if(!tt)throw new Error("R3F: Hooks can only be used within the Canvas component!");return tt}function useThree(tt=nt=>nt,et){return useStore$1()(tt,et)}function useFrame(tt,et=0){const nt=useStore$1(),it=nt.getState().internal.subscribe,rt=useMutableCallback(tt);return useIsomorphicLayoutEffect$1(()=>it(rt,et,nt),[et,it,nt]),null}const memoizedLoaders=new WeakMap;function loadingFn(tt,et){return function(nt,...it){let rt=memoizedLoaders.get(nt);return rt||(rt=new nt,memoizedLoaders.set(nt,rt)),tt&&tt(rt),Promise.all(it.map(ot=>new Promise((at,st)=>rt.load(ot,lt=>{lt.scene&&Object.assign(lt,buildGraph(lt.scene)),at(lt)},et,lt=>st(new Error(`Could not load ${ot}: ${lt==null?void 0:lt.message}`)))))).finally(()=>rt.dispose==null?void 0:rt.dispose())}}function useLoader(tt,et,nt,it){const rt=Array.isArray(et)?et:[et],ot=suspend$1(loadingFn(nt,it),[tt,...rt],{equal:is$1.equ});return Array.isArray(et)?ot:ot[0]}useLoader.preload=function(tt,et,nt){const it=Array.isArray(et)?et:[et];return preload(loadingFn(nt),[tt,...it])};useLoader.clear=function(tt,et){const nt=Array.isArray(et)?et:[et];return clear([tt,...nt])};const roots=new Map,{invalidate,advance}=createLoop(roots),{reconciler,applyProps}=createRenderer(roots,getEventPriority),shallowLoose={objects:"shallow",strict:!1},createRendererInstance=(tt,et)=>{const nt=typeof tt=="function"?tt(et):tt;return isRenderer(nt)?nt:new WebGLRenderer({powerPreference:"high-performance",canvas:et,antialias:!0,alpha:!0,...tt})};function computeInitialSize(tt,et){const nt=typeof HTMLCanvasElement<"u"&&tt instanceof HTMLCanvasElement;if(et){const{width:it,height:rt,top:ot,left:at,updateStyle:st=nt}=et;return{width:it,height:rt,top:ot,left:at,updateStyle:st}}else if(typeof HTMLCanvasElement<"u"&&tt instanceof HTMLCanvasElement&&tt.parentElement){const{width:it,height:rt,top:ot,left:at}=tt.parentElement.getBoundingClientRect();return{width:it,height:rt,top:ot,left:at,updateStyle:nt}}else if(typeof OffscreenCanvas<"u"&&tt instanceof OffscreenCanvas)return{width:tt.width,height:tt.height,top:0,left:0,updateStyle:nt};return{width:0,height:0,top:0,left:0}}function createRoot(tt){const et=roots.get(tt),nt=et==null?void 0:et.fiber,it=et==null?void 0:et.store;et&&console.warn("R3F.createRoot should only be called once!");const rt=typeof reportError=="function"?reportError:console.error,ot=it||createStore$1(invalidate,advance),at=nt||reconciler.createContainer(ot,constantsExports.ConcurrentRoot,null,!1,null,"",rt,null);et||roots.set(tt,{fiber:at,store:ot});let st,lt=!1,ct;return{configure(ut={}){let{gl:ht,size:dt,scene:pt,events:mt,onCreated:gt,shadows:bt=!1,linear:yt=!1,flat:wt=!1,legacy:vt=!1,orthographic:xt=!1,frameloop:St="always",dpr:Et=[1,2],performance:$t,raycaster:It,camera:Ft,onPointerMissed:Ht}=ut,zt=ot.getState(),Ot=zt.gl;zt.gl||zt.set({gl:Ot=createRendererInstance(ht,tt)});let jt=zt.raycaster;jt||zt.set({raycaster:jt=new Raycaster});const{params:kt,...Tt}=It||{};if(is$1.equ(Tt,jt,shallowLoose)||applyProps(jt,{...Tt}),is$1.equ(kt,jt.params,shallowLoose)||applyProps(jt,{params:{...jt.params,...kt}}),!zt.camera||zt.camera===ct&&!is$1.equ(ct,Ft,shallowLoose)){ct=Ft;const Pt=Ft instanceof Camera,Vt=Pt?Ft:xt?new OrthographicCamera(0,0,0,0,.1,1e3):new PerspectiveCamera(75,0,.1,1e3);Pt||(Vt.position.z=5,Ft&&applyProps(Vt,Ft),!zt.camera&&!(Ft!=null&&Ft.rotation)&&Vt.lookAt(0,0,0)),zt.set({camera:Vt}),jt.camera=Vt}if(!zt.scene){let Pt;pt instanceof Scene?Pt=pt:(Pt=new Scene,pt&&applyProps(Pt,pt)),zt.set({scene:prepare(Pt)})}if(!zt.xr){var Ct;const Pt=(cn,Xt)=>{const un=ot.getState();un.frameloop!=="never"&&advance(cn,!0,un,Xt)},Vt=()=>{const cn=ot.getState();cn.gl.xr.enabled=cn.gl.xr.isPresenting,cn.gl.xr.setAnimationLoop(cn.gl.xr.isPresenting?Pt:null),cn.gl.xr.isPresenting||invalidate(cn)},nn={connect(){const cn=ot.getState().gl;cn.xr.addEventListener("sessionstart",Vt),cn.xr.addEventListener("sessionend",Vt)},disconnect(){const cn=ot.getState().gl;cn.xr.removeEventListener("sessionstart",Vt),cn.xr.removeEventListener("sessionend",Vt)}};typeof((Ct=Ot.xr)==null?void 0:Ct.addEventListener)=="function"&&nn.connect(),zt.set({xr:nn})}if(Ot.shadowMap){const Pt=Ot.shadowMap.enabled,Vt=Ot.shadowMap.type;if(Ot.shadowMap.enabled=!!bt,is$1.boo(bt))Ot.shadowMap.type=PCFSoftShadowMap;else if(is$1.str(bt)){var Ut;const nn={basic:BasicShadowMap,percentage:PCFShadowMap,soft:PCFSoftShadowMap,variance:VSMShadowMap};Ot.shadowMap.type=(Ut=nn[bt])!=null?Ut:PCFSoftShadowMap}else is$1.obj(bt)&&Object.assign(Ot.shadowMap,bt);(Pt!==Ot.shadowMap.enabled||Vt!==Ot.shadowMap.type)&&(Ot.shadowMap.needsUpdate=!0)}const Nt=getColorManagement();Nt&&("enabled"in Nt?Nt.enabled=!vt:"legacyMode"in Nt&&(Nt.legacyMode=vt)),applyProps(Ot,{outputEncoding:yt?3e3:3001,toneMapping:wt?NoToneMapping:ACESFilmicToneMapping}),zt.legacy!==vt&&zt.set(()=>({legacy:vt})),zt.linear!==yt&&zt.set(()=>({linear:yt})),zt.flat!==wt&&zt.set(()=>({flat:wt})),ht&&!is$1.fun(ht)&&!isRenderer(ht)&&!is$1.equ(ht,Ot,shallowLoose)&&applyProps(Ot,ht),mt&&!zt.events.handlers&&zt.set({events:mt(ot)});const Dt=computeInitialSize(tt,dt);return is$1.equ(Dt,zt.size,shallowLoose)||zt.setSize(Dt.width,Dt.height,Dt.updateStyle,Dt.top,Dt.left),Et&&zt.viewport.dpr!==calculateDpr(Et)&&zt.setDpr(Et),zt.frameloop!==St&&zt.setFrameloop(St),zt.onPointerMissed||zt.set({onPointerMissed:Ht}),$t&&!is$1.equ($t,zt.performance,shallowLoose)&&zt.set(Pt=>({performance:{...Pt.performance,...$t}})),st=gt,lt=!0,this},render(ut){return lt||this.configure(),reconciler.updateContainer(reactExports.createElement(Provider$2,{store:ot,children:ut,onCreated:st,rootElement:tt}),at,null,()=>{}),ot},unmount(){unmountComponentAtNode(tt)}}}function Provider$2({store:tt,children:et,onCreated:nt,rootElement:it}){return useIsomorphicLayoutEffect$1(()=>{const rt=tt.getState();rt.set(ot=>({internal:{...ot.internal,active:!0}})),nt&&nt(rt),tt.getState().events.connected||rt.events.connect==null||rt.events.connect(it)},[]),reactExports.createElement(context$2.Provider,{value:tt},et)}function unmountComponentAtNode(tt,et){const nt=roots.get(tt),it=nt==null?void 0:nt.fiber;if(it){const rt=nt==null?void 0:nt.store.getState();rt&&(rt.internal.active=!1),reconciler.updateContainer(null,it,null,()=>{rt&&setTimeout(()=>{try{var ot,at,st,lt;rt.events.disconnect==null||rt.events.disconnect(),(ot=rt.gl)==null||(at=ot.renderLists)==null||at.dispose==null||at.dispose(),(st=rt.gl)==null||st.forceContextLoss==null||st.forceContextLoss(),(lt=rt.gl)!=null&<.xr&&rt.xr.disconnect(),dispose(rt),roots.delete(tt),et&&et(tt)}catch{}},500)})}}reconciler.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:reactExports.version});function debounce$2(tt,et,nt){var it,rt,ot,at,st;et==null&&(et=100);function lt(){var ut=Date.now()-at;ut=0?it=setTimeout(lt,et-ut):(it=null,nt||(st=tt.apply(ot,rt),ot=rt=null))}var ct=function(){ot=this,rt=arguments,at=Date.now();var ut=nt&&!it;return it||(it=setTimeout(lt,et)),ut&&(st=tt.apply(ot,rt),ot=rt=null),st};return ct.clear=function(){it&&(clearTimeout(it),it=null)},ct.flush=function(){it&&(st=tt.apply(ot,rt),ot=rt=null,clearTimeout(it),it=null)},ct}debounce$2.debounce=debounce$2;var debounce_1$1=debounce$2;const createDebounce=getDefaultExportFromCjs(debounce_1$1);function useMeasure(tt){let{debounce:et,scroll:nt,polyfill:it,offsetSize:rt}=tt===void 0?{debounce:0,scroll:!1,offsetSize:!1}:tt;const ot=it||(typeof window>"u"?class{}:window.ResizeObserver);if(!ot)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[at,st]=reactExports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),lt=reactExports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:at}),ct=et?typeof et=="number"?et:et.scroll:null,ut=et?typeof et=="number"?et:et.resize:null,ht=reactExports.useRef(!1);reactExports.useEffect(()=>(ht.current=!0,()=>void(ht.current=!1)));const[dt,pt,mt]=reactExports.useMemo(()=>{const wt=()=>{if(!lt.current.element)return;const{left:vt,top:xt,width:St,height:Et,bottom:$t,right:It,x:Ft,y:Ht}=lt.current.element.getBoundingClientRect(),zt={left:vt,top:xt,width:St,height:Et,bottom:$t,right:It,x:Ft,y:Ht};lt.current.element instanceof HTMLElement&&rt&&(zt.height=lt.current.element.offsetHeight,zt.width=lt.current.element.offsetWidth),Object.freeze(zt),ht.current&&!areBoundsEqual(lt.current.lastBounds,zt)&&st(lt.current.lastBounds=zt)};return[wt,ut?createDebounce(wt,ut):wt,ct?createDebounce(wt,ct):wt]},[st,rt,ct,ut]);function gt(){lt.current.scrollContainers&&(lt.current.scrollContainers.forEach(wt=>wt.removeEventListener("scroll",mt,!0)),lt.current.scrollContainers=null),lt.current.resizeObserver&&(lt.current.resizeObserver.disconnect(),lt.current.resizeObserver=null)}function bt(){lt.current.element&&(lt.current.resizeObserver=new ot(mt),lt.current.resizeObserver.observe(lt.current.element),nt&<.current.scrollContainers&<.current.scrollContainers.forEach(wt=>wt.addEventListener("scroll",mt,{capture:!0,passive:!0})))}const yt=wt=>{!wt||wt===lt.current.element||(gt(),lt.current.element=wt,lt.current.scrollContainers=findScrollContainers(wt),bt())};return useOnWindowScroll(mt,!!nt),useOnWindowResize(pt),reactExports.useEffect(()=>{gt(),bt()},[nt,mt,pt]),reactExports.useEffect(()=>gt,[]),[yt,at,dt]}function useOnWindowResize(tt){reactExports.useEffect(()=>{const et=tt;return window.addEventListener("resize",et),()=>void window.removeEventListener("resize",et)},[tt])}function useOnWindowScroll(tt,et){reactExports.useEffect(()=>{if(et){const nt=tt;return window.addEventListener("scroll",nt,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",nt,!0)}},[tt,et])}function findScrollContainers(tt){const et=[];if(!tt||tt===document.body)return et;const{overflow:nt,overflowX:it,overflowY:rt}=window.getComputedStyle(tt);return[nt,it,rt].some(ot=>ot==="auto"||ot==="scroll")&&et.push(tt),[...et,...findScrollContainers(tt.parentElement)]}const keys$5=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(tt,et)=>keys$5.every(nt=>tt[nt]===et[nt]);var __defProp$7=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp$7=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp$2=(tt,et,nt)=>et in tt?__defProp$7(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):tt[et]=nt,__spreadValues=(tt,et)=>{for(var nt in et||(et={}))__hasOwnProp$7.call(et,nt)&&__defNormalProp$2(tt,nt,et[nt]);if(__getOwnPropSymbols)for(var nt of __getOwnPropSymbols(et))__propIsEnum.call(et,nt)&&__defNormalProp$2(tt,nt,et[nt]);return tt},__spreadProps=(tt,et)=>__defProps(tt,__getOwnPropDescs(et));function traverseFiber(tt,et,nt){if(!tt)return;if(nt(tt)===!0)return tt;let it=et?tt.return:tt.child;for(;it;){const rt=traverseFiber(it,et,nt);if(rt)return rt;it=et?null:it.sibling}}function wrapContext(tt){try{return Object.defineProperties(tt,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return tt}}const FiberContext=wrapContext(reactExports.createContext(null));class FiberProvider extends reactExports.Component{render(){return reactExports.createElement(FiberContext.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner,ReactCurrentDispatcher}=reactExports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function useFiber(){const tt=reactExports.useContext(FiberContext);if(tt===null)throw new Error("its-fine: useFiber must be called within a !");const et=reactExports.useId();return reactExports.useMemo(()=>{for(const it of[ReactCurrentOwner==null?void 0:ReactCurrentOwner.current,tt,tt==null?void 0:tt.alternate]){if(!it)continue;const rt=traverseFiber(it,!1,ot=>{let at=ot.memoizedState;for(;at;){if(at.memoizedState===et)return!0;at=at.next}});if(rt)return rt}},[tt,et])}function useContextMap(){var tt,et;const nt=useFiber(),[it]=reactExports.useState(()=>new Map);it.clear();let rt=nt;for(;rt;){const ot=(tt=rt.type)==null?void 0:tt._context;ot&&ot!==FiberContext&&!it.has(ot)&&it.set(ot,(et=ReactCurrentDispatcher==null?void 0:ReactCurrentDispatcher.current)==null?void 0:et.readContext(wrapContext(ot))),rt=rt.return}return it}function useContextBridge(){const tt=useContextMap();return reactExports.useMemo(()=>Array.from(tt.keys()).reduce((et,nt)=>it=>reactExports.createElement(et,null,reactExports.createElement(nt.Provider,__spreadProps(__spreadValues({},it),{value:tt.get(nt)}))),et=>reactExports.createElement(FiberProvider,__spreadValues({},et))),[tt])}const DOM_EVENTS={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 createPointerEvents(tt){const{handlePointer:et}=createEvents(tt);return{priority:1,enabled:!0,compute(nt,it,rt){it.pointer.set(nt.offsetX/it.size.width*2-1,-(nt.offsetY/it.size.height)*2+1),it.raycaster.setFromCamera(it.pointer,it.camera)},connected:void 0,handlers:Object.keys(DOM_EVENTS).reduce((nt,it)=>({...nt,[it]:et(it)}),{}),update:()=>{var nt;const{events:it,internal:rt}=tt.getState();(nt=rt.lastEvent)!=null&&nt.current&&it.handlers&&it.handlers.onPointerMove(rt.lastEvent.current)},connect:nt=>{var it;const{set:rt,events:ot}=tt.getState();ot.disconnect==null||ot.disconnect(),rt(at=>({events:{...at.events,connected:nt}})),Object.entries((it=ot.handlers)!=null?it:[]).forEach(([at,st])=>{const[lt,ct]=DOM_EVENTS[at];nt.addEventListener(lt,st,{passive:ct})})},disconnect:()=>{const{set:nt,events:it}=tt.getState();if(it.connected){var rt;Object.entries((rt=it.handlers)!=null?rt:[]).forEach(([ot,at])=>{if(it&&it.connected instanceof HTMLElement){const[st]=DOM_EVENTS[ot];it.connected.removeEventListener(st,at)}}),nt(ot=>({events:{...ot.events,connected:void 0}}))}}}}const CanvasImpl=reactExports.forwardRef(function tt({children:et,fallback:nt,resize:it,style:rt,gl:ot,events:at=createPointerEvents,eventSource:st,eventPrefix:lt,shadows:ct,linear:ut,flat:ht,legacy:dt,orthographic:pt,frameloop:mt,dpr:gt,performance:bt,raycaster:yt,camera:wt,scene:vt,onPointerMissed:xt,onCreated:St,...Et},$t){reactExports.useMemo(()=>extend$3(THREE$1),[]);const It=useContextBridge(),[Ft,Ht]=useMeasure({scroll:!0,debounce:{scroll:50,resize:0},...it}),zt=reactExports.useRef(null),Ot=reactExports.useRef(null);reactExports.useImperativeHandle($t,()=>zt.current);const jt=useMutableCallback(xt),[kt,Tt]=reactExports.useState(!1),[Ct,Ut]=reactExports.useState(!1);if(kt)throw kt;if(Ct)throw Ct;const Nt=reactExports.useRef(null);useIsomorphicLayoutEffect$1(()=>{const Mt=zt.current;Ht.width>0&&Ht.height>0&&Mt&&(Nt.current||(Nt.current=createRoot(Mt)),Nt.current.configure({gl:ot,events:at,shadows:ct,linear:ut,flat:ht,legacy:dt,orthographic:pt,frameloop:mt,dpr:gt,performance:bt,raycaster:yt,camera:wt,scene:vt,size:Ht,onPointerMissed:(...Dt)=>jt.current==null?void 0:jt.current(...Dt),onCreated:Dt=>{Dt.events.connect==null||Dt.events.connect(st?isRef(st)?st.current:st:Ot.current),lt&&Dt.setEvents({compute:(Pt,Vt)=>{const nn=Pt[lt+"X"],cn=Pt[lt+"Y"];Vt.pointer.set(nn/Vt.size.width*2-1,-(cn/Vt.size.height)*2+1),Vt.raycaster.setFromCamera(Vt.pointer,Vt.camera)}}),St==null||St(Dt)}}),Nt.current.render(reactExports.createElement(It,null,reactExports.createElement(ErrorBoundary,{set:Ut},reactExports.createElement(reactExports.Suspense,{fallback:reactExports.createElement(Block,{set:Tt})},et)))))}),reactExports.useEffect(()=>{const Mt=zt.current;if(Mt)return()=>unmountComponentAtNode(Mt)},[]);const Bt=st?"none":"auto";return reactExports.createElement("div",_extends$t({ref:Ot,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Bt,...rt}},Et),reactExports.createElement("div",{ref:Ft,style:{width:"100%",height:"100%"}},reactExports.createElement("canvas",{ref:zt,style:{display:"block"}},nt)))}),Canvas=reactExports.forwardRef(function tt(et,nt){return reactExports.createElement(FiberProvider,null,reactExports.createElement(CanvasImpl,_extends$t({},et,{ref:nt})))}),v1=new Vector3,v2=new Vector3,v3=new Vector3;function defaultCalculatePosition(tt,et,nt){const it=v1.setFromMatrixPosition(tt.matrixWorld);it.project(et);const rt=nt.width/2,ot=nt.height/2;return[it.x*rt+rt,-(it.y*ot)+ot]}function isObjectBehindCamera(tt,et){const nt=v1.setFromMatrixPosition(tt.matrixWorld),it=v2.setFromMatrixPosition(et.matrixWorld),rt=nt.sub(it),ot=et.getWorldDirection(v3);return rt.angleTo(ot)>Math.PI/2}function isObjectVisible(tt,et,nt,it){const rt=v1.setFromMatrixPosition(tt.matrixWorld),ot=rt.clone();ot.project(et),nt.setFromCamera(ot,et);const at=nt.intersectObjects(it,!0);if(at.length){const st=at[0].distance;return rt.distanceTo(nt.ray.origin)Math.abs(tt)<1e-10?0:tt;function getCSSMatrix(tt,et,nt=""){let it="matrix3d(";for(let rt=0;rt!==16;rt++)it+=epsilon$1(et[rt]*tt.elements[rt])+(rt!==15?",":")");return nt+it}const getCameraCSSMatrix=(tt=>et=>getCSSMatrix(et,tt))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),getObjectCSSMatrix=(tt=>(et,nt)=>getCSSMatrix(et,tt(nt),"translate(-50%,-50%)"))(tt=>[1/tt,1/tt,1/tt,1,-1/tt,-1/tt,-1/tt,-1,1/tt,1/tt,1/tt,1,1,1,1,1]);function isRefObject(tt){return tt&&typeof tt=="object"&&"current"in tt}const Html$1=reactExports.forwardRef(({children:tt,eps:et=.001,style:nt,className:it,prepend:rt,center:ot,fullscreen:at,portal:st,distanceFactor:lt,sprite:ct=!1,transform:ut=!1,occlude:ht,onOcclude:dt,castShadow:pt,receiveShadow:mt,material:gt,geometry:bt,zIndexRange:yt=[16777271,0],calculatePosition:wt=defaultCalculatePosition,as:vt="div",wrapperClass:xt,pointerEvents:St="auto",...Et},$t)=>{const{gl:It,camera:Ft,scene:Ht,size:zt,raycaster:Ot,events:jt,viewport:kt}=useThree(),[Tt]=reactExports.useState(()=>document.createElement(vt)),Ct=reactExports.useRef(),Ut=reactExports.useRef(null),Nt=reactExports.useRef(0),Bt=reactExports.useRef([0,0]),Mt=reactExports.useRef(null),Dt=reactExports.useRef(null),Pt=(st==null?void 0:st.current)||jt.connected||It.domElement.parentNode,Vt=reactExports.useRef(null),nn=reactExports.useRef(!1),cn=reactExports.useMemo(()=>ht&&ht!=="blending"||Array.isArray(ht)&&ht.length&&isRefObject(ht[0]),[ht]);reactExports.useLayoutEffect(()=>{const xn=It.domElement;ht&&ht==="blending"?(xn.style.zIndex=`${Math.floor(yt[0]/2)}`,xn.style.position="absolute",xn.style.pointerEvents="none"):(xn.style.zIndex=null,xn.style.position=null,xn.style.pointerEvents=null)},[ht]),reactExports.useLayoutEffect(()=>{if(Ut.current){const xn=Ct.current=createRoot$1(Tt);if(Ht.updateMatrixWorld(),ut)Tt.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const an=wt(Ut.current,Ft,zt);Tt.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${an[0]}px,${an[1]}px,0);transform-origin:0 0;`}return Pt&&(rt?Pt.prepend(Tt):Pt.appendChild(Tt)),()=>{Pt&&Pt.removeChild(Tt),xn.unmount()}}},[Pt,ut]),reactExports.useLayoutEffect(()=>{xt&&(Tt.className=xt)},[xt]);const Xt=reactExports.useMemo(()=>ut?{position:"absolute",top:0,left:0,width:zt.width,height:zt.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:ot?"translate3d(-50%,-50%,0)":"none",...at&&{top:-zt.height/2,left:-zt.width/2,width:zt.width,height:zt.height},...nt},[nt,ot,at,zt,ut]),un=reactExports.useMemo(()=>({position:"absolute",pointerEvents:St}),[St]);reactExports.useLayoutEffect(()=>{if(nn.current=!1,ut){var xn;(xn=Ct.current)==null||xn.render(reactExports.createElement("div",{ref:Mt,style:Xt},reactExports.createElement("div",{ref:Dt,style:un},reactExports.createElement("div",{ref:$t,className:it,style:nt,children:tt}))))}else{var an;(an=Ct.current)==null||an.render(reactExports.createElement("div",{ref:$t,style:Xt,className:it,children:tt}))}});const en=reactExports.useRef(!0);useFrame(xn=>{if(Ut.current){Ft.updateMatrixWorld(),Ut.current.updateWorldMatrix(!0,!1);const an=ut?Bt.current:wt(Ut.current,Ft,zt);if(ut||Math.abs(Nt.current-Ft.zoom)>et||Math.abs(Bt.current[0]-an[0])>et||Math.abs(Bt.current[1]-an[1])>et){const Zt=isObjectBehindCamera(Ut.current,Ft);let En=!1;cn&&(ht!=="blending"?En=[Ht]:Array.isArray(ht)&&(En=ht.map(Un=>Un.current)));const In=en.current;if(En){const Un=isObjectVisible(Ut.current,Ft,Ot,En);en.current=Un&&!Zt}else en.current=!Zt;In!==en.current&&(dt?dt(!en.current):Tt.style.display=en.current?"block":"none");const Cn=Math.floor(yt[0]/2),Nn=ht?cn?[yt[0],Cn]:[Cn-1,0]:yt;if(Tt.style.zIndex=`${objectZIndex(Ut.current,Ft,Nn)}`,ut){const[Un,_n]=[zt.width/2,zt.height/2],An=Ft.projectionMatrix.elements[5]*_n,{isOrthographicCamera:gn,top:Tn,left:yn,bottom:dn,right:sn}=Ft,rn=getCameraCSSMatrix(Ft.matrixWorldInverse),Sn=gn?`scale(${An})translate(${epsilon$1(-(sn+yn)/2)}px,${epsilon$1((Tn+dn)/2)}px)`:`translateZ(${An}px)`;let tn=Ut.current.matrixWorld;ct&&(tn=Ft.matrixWorldInverse.clone().transpose().copyPosition(tn).scale(Ut.current.scale),tn.elements[3]=tn.elements[7]=tn.elements[11]=0,tn.elements[15]=1),Tt.style.width=zt.width+"px",Tt.style.height=zt.height+"px",Tt.style.perspective=gn?"":`${An}px`,Mt.current&&Dt.current&&(Mt.current.style.transform=`${Sn}${rn}translate(${Un}px,${_n}px)`,Dt.current.style.transform=getObjectCSSMatrix(tn,1/((lt||10)/400)))}else{const Un=lt===void 0?1:objectScale(Ut.current,Ft)*lt;Tt.style.transform=`translate3d(${an[0]}px,${an[1]}px,0) scale(${Un})`}Bt.current=an,Nt.current=Ft.zoom}}if(!cn&&Vt.current&&!nn.current)if(ut){if(Mt.current){const an=Mt.current.children[0];if(an!=null&&an.clientWidth&&an!=null&&an.clientHeight){const{isOrthographicCamera:Zt}=Ft;if(Zt||bt)Et.scale&&(Array.isArray(Et.scale)?Et.scale instanceof Vector3?Vt.current.scale.copy(Et.scale.clone().divideScalar(1)):Vt.current.scale.set(1/Et.scale[0],1/Et.scale[1],1/Et.scale[2]):Vt.current.scale.setScalar(1/Et.scale));else{const En=(lt||10)/400,In=an.clientWidth*En,Cn=an.clientHeight*En;Vt.current.scale.set(In,Cn,1)}nn.current=!0}}}else{const an=Tt.children[0];if(an!=null&&an.clientWidth&&an!=null&&an.clientHeight){const Zt=1/kt.factor,En=an.clientWidth*Zt,In=an.clientHeight*Zt;Vt.current.scale.set(En,In,1),nn.current=!0}Vt.current.lookAt(xn.camera.position)}});const fn=reactExports.useMemo(()=>({vertexShader:ut?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite @@ -3950,7 +3950,7 @@ No matching component was found for: void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } - `}),[ut]);return reactExports.createElement("group",_extends$u({},Et,{ref:Wt}),ht&&!rn&&reactExports.createElement("mesh",{castShadow:pt,receiveShadow:mt,ref:Vt},bt||reactExports.createElement("planeGeometry",null),gt||reactExports.createElement("shaderMaterial",{side:DoubleSide,vertexShader:pn.vertexShader,fragmentShader:pn.fragmentShader})))});function createStore(tt){let et;const nt=new Set,it=(ct,ut)=>{const ht=typeof ct=="function"?ct(et):ct;if(ht!==et){const dt=et;et=ut?ht:Object.assign({},et,ht),nt.forEach(pt=>pt(et,dt))}},rt=()=>et,ot=(ct,ut=rt,ht=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let dt=ut(et);function pt(){const mt=ut(et);if(!ht(dt,mt)){const gt=dt;ct(dt=mt,gt)}}return nt.add(pt),()=>nt.delete(pt)},lt={setState:it,getState:rt,subscribe:(ct,ut,ht)=>ut||ht?ot(ct,ut,ht):(nt.add(ct),()=>nt.delete(ct)),destroy:()=>nt.clear()};return et=tt(it,rt,lt),lt}const isSSR=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),useIsomorphicLayoutEffect=isSSR?reactExports.useEffect:reactExports.useLayoutEffect;function create$2(tt){const et=typeof tt=="function"?createStore(tt):tt,nt=(it=et.getState,rt=Object.is)=>{const[,ot]=reactExports.useReducer(bt=>bt+1,0),at=et.getState(),st=reactExports.useRef(at),lt=reactExports.useRef(it),ct=reactExports.useRef(rt),ut=reactExports.useRef(!1),ht=reactExports.useRef();ht.current===void 0&&(ht.current=it(at));let dt,pt=!1;(st.current!==at||lt.current!==it||ct.current!==rt||ut.current)&&(dt=it(at),pt=!rt(ht.current,dt)),useIsomorphicLayoutEffect(()=>{pt&&(ht.current=dt),st.current=at,lt.current=it,ct.current=rt,ut.current=!1});const mt=reactExports.useRef(at);useIsomorphicLayoutEffect(()=>{const bt=()=>{try{const wt=et.getState(),vt=lt.current(wt);ct.current(ht.current,vt)||(st.current=wt,ht.current=vt,ot())}catch{ut.current=!0,ot()}},yt=et.subscribe(bt);return et.getState()!==mt.current&&bt(),yt},[]);const gt=pt?dt:ht.current;return reactExports.useDebugValue(gt),gt};return Object.assign(nt,et),nt[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const it=[nt,et];return{next(){const rt=it.length<=0;return{value:it.shift(),done:rt}}}},nt}let saveLastTotalLoaded=0;const useProgress=create$2(tt=>(DefaultLoadingManager.onStart=(et,nt,it)=>{tt({active:!0,item:et,loaded:nt,total:it,progress:(nt-saveLastTotalLoaded)/(it-saveLastTotalLoaded)*100})},DefaultLoadingManager.onLoad=()=>{tt({active:!1})},DefaultLoadingManager.onError=et=>tt(nt=>({errors:[...nt.errors,et]})),DefaultLoadingManager.onProgress=(et,nt,it)=>{nt===it&&(saveLastTotalLoaded=it),tt({active:!0,item:et,loaded:nt,total:it,progress:(nt-saveLastTotalLoaded)/(it-saveLastTotalLoaded)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),defaultDataInterpolation=tt=>`Loading ${tt.toFixed(2)}%`;function Loader$1({containerStyles:tt,innerStyles:et,barStyles:nt,dataStyles:it,dataInterpolation:rt=defaultDataInterpolation,initialState:ot=at=>at}){const{active:at,progress:st}=useProgress(),lt=reactExports.useRef(0),ct=reactExports.useRef(0),ut=reactExports.useRef(null),[ht,dt]=reactExports.useState(ot(at));reactExports.useEffect(()=>{let mt;return at!==ht&&(mt=setTimeout(()=>dt(at),300)),()=>clearTimeout(mt)},[ht,at]);const pt=reactExports.useCallback(()=>{ut.current&&(lt.current+=(st-lt.current)/2,(lt.current>.95*st||st===100)&&(lt.current=st),ut.current.innerText=rt(lt.current),lt.current(pt(),()=>cancelAnimationFrame(ct.current)),[pt]),ht?reactExports.createElement("div",{style:{...styles.container,opacity:at?1:0,...tt}},reactExports.createElement("div",null,reactExports.createElement("div",{style:{...styles.inner,...et}},reactExports.createElement("div",{style:{...styles.bar,transform:`scaleX(${st/100})`,...nt}}),reactExports.createElement("span",{ref:ut,style:{...styles.data,...it}})))):null}const styles={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"}};function mergeRefs(tt){return function(et){tt.forEach(function(nt){typeof nt=="function"?nt(et):nt!=null&&(nt.current=et)})}}let webGL2Available;function isWebGL2Available(){var tt;if(webGL2Available!==void 0)return webGL2Available;try{let et;const nt=document.createElement("canvas");return webGL2Available=!!(window.WebGL2RenderingContext&&(et=nt.getContext("webgl2"))),et&&((tt=et.getExtension("WEBGL_lose_context"))==null||tt.loseContext()),webGL2Available}catch{return webGL2Available=!1}}function estimateBytesUsed(tt){let et=0;for(let it in tt.attributes){const rt=tt.getAttribute(it);et+=rt.count*rt.itemSize*rt.array.BYTES_PER_ELEMENT}const nt=tt.getIndex();return et+=nt?nt.count*nt.itemSize*nt.array.BYTES_PER_ELEMENT:0,et}const frustum=new Frustum,center$1=new Vector3,tmpPoint=new Vector3,vecNear=new Vector3,vecTopLeft=new Vector3,vecTopRight=new Vector3,vecDownRight=new Vector3,vecDownLeft=new Vector3,vecFarTopLeft=new Vector3,vecFarTopRight=new Vector3,vecFarDownRight=new Vector3,vecFarDownLeft=new Vector3,vectemp1=new Vector3,vectemp2=new Vector3,vectemp3=new Vector3;class SelectionBox{constructor(et,nt,it){this.camera=et,this.scene=nt,this.startPoint=new Vector3,this.endPoint=new Vector3,this.collection=[],this.deep=it||Number.MAX_VALUE}select(et,nt){return this.startPoint=et||this.startPoint,this.endPoint=nt||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(frustum,this.scene),this.collection}updateFrustum(et,nt){if(et=et||this.startPoint,nt=nt||this.endPoint,et.x===nt.x&&(nt.x+=Number.EPSILON),et.y===nt.y&&(nt.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){tmpPoint.copy(et),tmpPoint.x=Math.min(et.x,nt.x),tmpPoint.y=Math.max(et.y,nt.y),nt.x=Math.max(et.x,nt.x),nt.y=Math.min(et.y,nt.y),vecNear.setFromMatrixPosition(this.camera.matrixWorld),vecTopLeft.copy(tmpPoint),vecTopRight.set(nt.x,tmpPoint.y,0),vecDownRight.copy(nt),vecDownLeft.set(tmpPoint.x,nt.y,0),vecTopLeft.unproject(this.camera),vecTopRight.unproject(this.camera),vecDownRight.unproject(this.camera),vecDownLeft.unproject(this.camera),vectemp1.copy(vecTopLeft).sub(vecNear),vectemp2.copy(vecTopRight).sub(vecNear),vectemp3.copy(vecDownRight).sub(vecNear),vectemp1.normalize(),vectemp2.normalize(),vectemp3.normalize(),vectemp1.multiplyScalar(this.deep),vectemp2.multiplyScalar(this.deep),vectemp3.multiplyScalar(this.deep),vectemp1.add(vecNear),vectemp2.add(vecNear),vectemp3.add(vecNear);var it=frustum.planes;it[0].setFromCoplanarPoints(vecNear,vecTopLeft,vecTopRight),it[1].setFromCoplanarPoints(vecNear,vecTopRight,vecDownRight),it[2].setFromCoplanarPoints(vecDownRight,vecDownLeft,vecNear),it[3].setFromCoplanarPoints(vecDownLeft,vecTopLeft,vecNear),it[4].setFromCoplanarPoints(vecTopRight,vecDownRight,vecDownLeft),it[5].setFromCoplanarPoints(vectemp3,vectemp2,vectemp1),it[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const rt=Math.min(et.x,nt.x),ot=Math.max(et.y,nt.y),at=Math.max(et.x,nt.x),st=Math.min(et.y,nt.y);vecTopLeft.set(rt,ot,-1),vecTopRight.set(at,ot,-1),vecDownRight.set(at,st,-1),vecDownLeft.set(rt,st,-1),vecFarTopLeft.set(rt,ot,1),vecFarTopRight.set(at,ot,1),vecFarDownRight.set(at,st,1),vecFarDownLeft.set(rt,st,1),vecTopLeft.unproject(this.camera),vecTopRight.unproject(this.camera),vecDownRight.unproject(this.camera),vecDownLeft.unproject(this.camera),vecFarTopLeft.unproject(this.camera),vecFarTopRight.unproject(this.camera),vecFarDownRight.unproject(this.camera),vecFarDownLeft.unproject(this.camera);var it=frustum.planes;it[0].setFromCoplanarPoints(vecTopLeft,vecFarTopLeft,vecFarTopRight),it[1].setFromCoplanarPoints(vecTopRight,vecFarTopRight,vecFarDownRight),it[2].setFromCoplanarPoints(vecFarDownRight,vecFarDownLeft,vecDownLeft),it[3].setFromCoplanarPoints(vecFarDownLeft,vecFarTopLeft,vecTopLeft),it[4].setFromCoplanarPoints(vecTopRight,vecDownRight,vecDownLeft),it[5].setFromCoplanarPoints(vecFarDownRight,vecFarTopRight,vecFarTopLeft),it[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(et,nt){if((nt.isMesh||nt.isLine||nt.isPoints)&&nt.material!==void 0&&(nt.geometry.boundingSphere===null&&nt.geometry.computeBoundingSphere(),center$1.copy(nt.geometry.boundingSphere.center),center$1.applyMatrix4(nt.matrixWorld),et.containsPoint(center$1)&&this.collection.push(nt)),nt.children.length>0)for(let it=0;it{const ht=typeof ct=="function"?ct(et):ct;if(ht!==et){const dt=et;et=ut?ht:Object.assign({},et,ht),nt.forEach(pt=>pt(et,dt))}},rt=()=>et,ot=(ct,ut=rt,ht=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let dt=ut(et);function pt(){const mt=ut(et);if(!ht(dt,mt)){const gt=dt;ct(dt=mt,gt)}}return nt.add(pt),()=>nt.delete(pt)},lt={setState:it,getState:rt,subscribe:(ct,ut,ht)=>ut||ht?ot(ct,ut,ht):(nt.add(ct),()=>nt.delete(ct)),destroy:()=>nt.clear()};return et=tt(it,rt,lt),lt}const isSSR=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),useIsomorphicLayoutEffect=isSSR?reactExports.useEffect:reactExports.useLayoutEffect;function create$2(tt){const et=typeof tt=="function"?createStore(tt):tt,nt=(it=et.getState,rt=Object.is)=>{const[,ot]=reactExports.useReducer(bt=>bt+1,0),at=et.getState(),st=reactExports.useRef(at),lt=reactExports.useRef(it),ct=reactExports.useRef(rt),ut=reactExports.useRef(!1),ht=reactExports.useRef();ht.current===void 0&&(ht.current=it(at));let dt,pt=!1;(st.current!==at||lt.current!==it||ct.current!==rt||ut.current)&&(dt=it(at),pt=!rt(ht.current,dt)),useIsomorphicLayoutEffect(()=>{pt&&(ht.current=dt),st.current=at,lt.current=it,ct.current=rt,ut.current=!1});const mt=reactExports.useRef(at);useIsomorphicLayoutEffect(()=>{const bt=()=>{try{const wt=et.getState(),vt=lt.current(wt);ct.current(ht.current,vt)||(st.current=wt,ht.current=vt,ot())}catch{ut.current=!0,ot()}},yt=et.subscribe(bt);return et.getState()!==mt.current&&bt(),yt},[]);const gt=pt?dt:ht.current;return reactExports.useDebugValue(gt),gt};return Object.assign(nt,et),nt[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const it=[nt,et];return{next(){const rt=it.length<=0;return{value:it.shift(),done:rt}}}},nt}let saveLastTotalLoaded=0;const useProgress=create$2(tt=>(DefaultLoadingManager.onStart=(et,nt,it)=>{tt({active:!0,item:et,loaded:nt,total:it,progress:(nt-saveLastTotalLoaded)/(it-saveLastTotalLoaded)*100})},DefaultLoadingManager.onLoad=()=>{tt({active:!1})},DefaultLoadingManager.onError=et=>tt(nt=>({errors:[...nt.errors,et]})),DefaultLoadingManager.onProgress=(et,nt,it)=>{nt===it&&(saveLastTotalLoaded=it),tt({active:!0,item:et,loaded:nt,total:it,progress:(nt-saveLastTotalLoaded)/(it-saveLastTotalLoaded)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),defaultDataInterpolation=tt=>`Loading ${tt.toFixed(2)}%`;function Loader$1({containerStyles:tt,innerStyles:et,barStyles:nt,dataStyles:it,dataInterpolation:rt=defaultDataInterpolation,initialState:ot=at=>at}){const{active:at,progress:st}=useProgress(),lt=reactExports.useRef(0),ct=reactExports.useRef(0),ut=reactExports.useRef(null),[ht,dt]=reactExports.useState(ot(at));reactExports.useEffect(()=>{let mt;return at!==ht&&(mt=setTimeout(()=>dt(at),300)),()=>clearTimeout(mt)},[ht,at]);const pt=reactExports.useCallback(()=>{ut.current&&(lt.current+=(st-lt.current)/2,(lt.current>.95*st||st===100)&&(lt.current=st),ut.current.innerText=rt(lt.current),lt.current(pt(),()=>cancelAnimationFrame(ct.current)),[pt]),ht?reactExports.createElement("div",{style:{...styles.container,opacity:at?1:0,...tt}},reactExports.createElement("div",null,reactExports.createElement("div",{style:{...styles.inner,...et}},reactExports.createElement("div",{style:{...styles.bar,transform:`scaleX(${st/100})`,...nt}}),reactExports.createElement("span",{ref:ut,style:{...styles.data,...it}})))):null}const styles={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"}};function mergeRefs(tt){return function(et){tt.forEach(function(nt){typeof nt=="function"?nt(et):nt!=null&&(nt.current=et)})}}let webGL2Available;function isWebGL2Available(){var tt;if(webGL2Available!==void 0)return webGL2Available;try{let et;const nt=document.createElement("canvas");return webGL2Available=!!(window.WebGL2RenderingContext&&(et=nt.getContext("webgl2"))),et&&((tt=et.getExtension("WEBGL_lose_context"))==null||tt.loseContext()),webGL2Available}catch{return webGL2Available=!1}}function estimateBytesUsed(tt){let et=0;for(let it in tt.attributes){const rt=tt.getAttribute(it);et+=rt.count*rt.itemSize*rt.array.BYTES_PER_ELEMENT}const nt=tt.getIndex();return et+=nt?nt.count*nt.itemSize*nt.array.BYTES_PER_ELEMENT:0,et}const frustum=new Frustum,center$1=new Vector3,tmpPoint=new Vector3,vecNear=new Vector3,vecTopLeft=new Vector3,vecTopRight=new Vector3,vecDownRight=new Vector3,vecDownLeft=new Vector3,vecFarTopLeft=new Vector3,vecFarTopRight=new Vector3,vecFarDownRight=new Vector3,vecFarDownLeft=new Vector3,vectemp1=new Vector3,vectemp2=new Vector3,vectemp3=new Vector3;class SelectionBox{constructor(et,nt,it){this.camera=et,this.scene=nt,this.startPoint=new Vector3,this.endPoint=new Vector3,this.collection=[],this.deep=it||Number.MAX_VALUE}select(et,nt){return this.startPoint=et||this.startPoint,this.endPoint=nt||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(frustum,this.scene),this.collection}updateFrustum(et,nt){if(et=et||this.startPoint,nt=nt||this.endPoint,et.x===nt.x&&(nt.x+=Number.EPSILON),et.y===nt.y&&(nt.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){tmpPoint.copy(et),tmpPoint.x=Math.min(et.x,nt.x),tmpPoint.y=Math.max(et.y,nt.y),nt.x=Math.max(et.x,nt.x),nt.y=Math.min(et.y,nt.y),vecNear.setFromMatrixPosition(this.camera.matrixWorld),vecTopLeft.copy(tmpPoint),vecTopRight.set(nt.x,tmpPoint.y,0),vecDownRight.copy(nt),vecDownLeft.set(tmpPoint.x,nt.y,0),vecTopLeft.unproject(this.camera),vecTopRight.unproject(this.camera),vecDownRight.unproject(this.camera),vecDownLeft.unproject(this.camera),vectemp1.copy(vecTopLeft).sub(vecNear),vectemp2.copy(vecTopRight).sub(vecNear),vectemp3.copy(vecDownRight).sub(vecNear),vectemp1.normalize(),vectemp2.normalize(),vectemp3.normalize(),vectemp1.multiplyScalar(this.deep),vectemp2.multiplyScalar(this.deep),vectemp3.multiplyScalar(this.deep),vectemp1.add(vecNear),vectemp2.add(vecNear),vectemp3.add(vecNear);var it=frustum.planes;it[0].setFromCoplanarPoints(vecNear,vecTopLeft,vecTopRight),it[1].setFromCoplanarPoints(vecNear,vecTopRight,vecDownRight),it[2].setFromCoplanarPoints(vecDownRight,vecDownLeft,vecNear),it[3].setFromCoplanarPoints(vecDownLeft,vecTopLeft,vecNear),it[4].setFromCoplanarPoints(vecTopRight,vecDownRight,vecDownLeft),it[5].setFromCoplanarPoints(vectemp3,vectemp2,vectemp1),it[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const rt=Math.min(et.x,nt.x),ot=Math.max(et.y,nt.y),at=Math.max(et.x,nt.x),st=Math.min(et.y,nt.y);vecTopLeft.set(rt,ot,-1),vecTopRight.set(at,ot,-1),vecDownRight.set(at,st,-1),vecDownLeft.set(rt,st,-1),vecFarTopLeft.set(rt,ot,1),vecFarTopRight.set(at,ot,1),vecFarDownRight.set(at,st,1),vecFarDownLeft.set(rt,st,1),vecTopLeft.unproject(this.camera),vecTopRight.unproject(this.camera),vecDownRight.unproject(this.camera),vecDownLeft.unproject(this.camera),vecFarTopLeft.unproject(this.camera),vecFarTopRight.unproject(this.camera),vecFarDownRight.unproject(this.camera),vecFarDownLeft.unproject(this.camera);var it=frustum.planes;it[0].setFromCoplanarPoints(vecTopLeft,vecFarTopLeft,vecFarTopRight),it[1].setFromCoplanarPoints(vecTopRight,vecFarTopRight,vecFarDownRight),it[2].setFromCoplanarPoints(vecFarDownRight,vecFarDownLeft,vecDownLeft),it[3].setFromCoplanarPoints(vecFarDownLeft,vecFarTopLeft,vecTopLeft),it[4].setFromCoplanarPoints(vecTopRight,vecDownRight,vecDownLeft),it[5].setFromCoplanarPoints(vecFarDownRight,vecFarTopRight,vecFarTopLeft),it[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(et,nt){if((nt.isMesh||nt.isLine||nt.isPoints)&&nt.material!==void 0&&(nt.geometry.boundingSphere===null&&nt.geometry.computeBoundingSphere(),center$1.copy(nt.geometry.boundingSphere.center),center$1.applyMatrix4(nt.matrixWorld),et.containsPoint(center$1)&&this.collection.push(nt)),nt.children.length>0)for(let it=0;it #include #include @@ -4337,7 +4337,7 @@ 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(nt){this.uniforms.diffuse.value=nt}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(nt){nt===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(nt){this.uniforms.linewidth.value=nt}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(nt){!!nt!="USE_DASH"in this.defines&&(this.needsUpdate=!0),nt===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(nt){this.uniforms.dashScale.value=nt}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(nt){this.uniforms.dashSize.value=nt}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(nt){this.uniforms.dashOffset.value=nt}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(nt){this.uniforms.gapSize.value=nt}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(nt){this.uniforms.opacity.value=nt}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(nt){this.uniforms.resolution.value.copy(nt)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(nt){!!nt!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),nt===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(et)}}const _start=new Vector3,_end=new Vector3,_start4=new Vector4,_end4=new Vector4,_ssOrigin=new Vector4,_ssOrigin3=new Vector3,_mvMatrix=new Matrix4,_line=new Line3,_closestPoint=new Vector3,_box=new Box3,_sphere$1=new Sphere,_clipToWorldVector=new Vector4;let _ray,_instanceStart,_instanceEnd,_lineWidth;function getWorldSpaceHalfWidth(tt,et,nt){return _clipToWorldVector.set(0,0,-et,1).applyMatrix4(tt.projectionMatrix),_clipToWorldVector.multiplyScalar(1/_clipToWorldVector.w),_clipToWorldVector.x=_lineWidth/nt.width,_clipToWorldVector.y=_lineWidth/nt.height,_clipToWorldVector.applyMatrix4(tt.projectionMatrixInverse),_clipToWorldVector.multiplyScalar(1/_clipToWorldVector.w),Math.abs(Math.max(_clipToWorldVector.x,_clipToWorldVector.y))}function raycastWorldUnits(tt,et){for(let nt=0,it=_instanceStart.count;ntut&&_end4.z>ut)continue;if(_start4.z>ut){const wt=_start4.z-_end4.z,vt=(_start4.z-ut)/wt;_start4.lerp(_end4,vt)}else if(_end4.z>ut){const wt=_end4.z-_start4.z,vt=(_end4.z-ut)/wt;_end4.lerp(_start4,vt)}_start4.applyMatrix4(it),_end4.applyMatrix4(it),_start4.multiplyScalar(1/_start4.w),_end4.multiplyScalar(1/_end4.w),_start4.x*=ot.x/2,_start4.y*=ot.y/2,_end4.x*=ot.x/2,_end4.y*=ot.y/2,_line.start.copy(_start4),_line.start.z=0,_line.end.copy(_end4),_line.end.z=0;const mt=_line.closestPointToPointParameter(_ssOrigin3,!0);_line.at(mt,_closestPoint);const gt=MathUtils.lerp(_start4.z,_end4.z,mt),bt=gt>=-1&><=1,yt=_ssOrigin3.distanceTo(_closestPoint)<_lineWidth*.5;if(bt&&yt){_line.start.fromBufferAttribute(lt,ht),_line.end.fromBufferAttribute(ct,ht),_line.start.applyMatrix4(at),_line.end.applyMatrix4(at);const wt=new Vector3,vt=new Vector3;_ray.distanceSqToSegment(_line.start,_line.end,vt,wt),nt.push({point:vt,pointOnLine:wt,distance:_ray.origin.distanceTo(vt),object:tt,face:null,faceIndex:ht,uv:null,uv2:null})}}}class LineSegments2 extends Mesh{constructor(et=new LineSegmentsGeometry,nt=new LineMaterial({color:Math.random()*16777215})){super(et,nt),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const et=this.geometry,nt=et.attributes.instanceStart,it=et.attributes.instanceEnd,rt=new Float32Array(2*nt.count);for(let at=0,st=0,lt=nt.count;atlt,...st}){const{setEvents:lt,camera:ct,raycaster:ut,gl:ht,controls:dt,size:pt,get:mt}=useThree(),[gt,bt]=reactExports.useState(!1),[yt,wt]=reactExports.useReducer((Et,{object:It,shift:Tt})=>It===void 0?[]:Array.isArray(It)?It:Tt?Et.includes(It)?Et.filter($t=>$t!==It):[It,...Et]:Et[0]===It?[]:[It],[]);reactExports.useEffect(()=>void(it==null?void 0:it(yt)),[yt]);const vt=reactExports.useCallback(Et=>{Et.stopPropagation(),wt({object:at([Et.object])[0],shift:et&&Et.shiftKey})},[]),xt=reactExports.useCallback(Et=>!gt&&wt({}),[gt]),St=reactExports.useRef(null);return reactExports.useEffect(()=>{if(!tt||!et)return;const Et=new SelectionBox(ct,St.current),It=document.createElement("div");It.style.pointerEvents="none",It.style.border=rt,It.style.backgroundColor=ot,It.style.position="fixed";const Tt=new Vector2,$t=new Vector2,Ut=new Vector2,Lt=mt().events.enabled,Bt=dt==null?void 0:dt.enabled;let Pt=!1;function kt(Mt,Vt){const{offsetX:Qt,offsetY:rn}=Mt,{width:Xt,height:an}=pt;Vt.set(Qt/Xt*2-1,-(rn/an)*2+1)}function At(Mt){var Vt;dt&&(dt.enabled=!1),lt({enabled:!1}),Pt=!0,(Vt=ht.domElement.parentElement)==null||Vt.appendChild(It),It.style.left=`${Mt.clientX}px`,It.style.top=`${Mt.clientY}px`,It.style.width="0px",It.style.height="0px",Tt.x=Mt.clientX,Tt.y=Mt.clientY}function Rt(Mt){Ut.x=Math.max(Tt.x,Mt.clientX),Ut.y=Math.max(Tt.y,Mt.clientY),$t.x=Math.min(Tt.x,Mt.clientX),$t.y=Math.min(Tt.y,Mt.clientY),It.style.left=`${$t.x}px`,It.style.top=`${$t.y}px`,It.style.width=`${Ut.x-$t.x}px`,It.style.height=`${Ut.y-$t.y}px`}function Wt(){if(Pt){var Mt;dt&&(dt.enabled=Bt),lt({enabled:Lt}),Pt=!1,(Mt=It.parentElement)==null||Mt.removeChild(It)}}function jt(Mt){Mt.shiftKey&&(At(Mt),kt(Mt,Et.startPoint))}let Ot=[];function Ct(Mt){if(Pt){Rt(Mt),kt(Mt,Et.endPoint);const Vt=Et.select().sort(Qt=>Qt.uuid).filter(Qt=>Qt.isMesh);shallow(Vt,Ot)||(Ot=Vt,wt({object:at(Vt)}))}}function Dt(Mt){Pt&&Wt()}return document.addEventListener("pointerdown",jt,{passive:!0}),document.addEventListener("pointermove",Ct,{passive:!0,capture:!0}),document.addEventListener("pointerup",Dt,{passive:!0}),()=>{document.removeEventListener("pointerdown",jt),document.removeEventListener("pointermove",Ct),document.removeEventListener("pointerup",Dt)}},[pt.width,pt.height,ut,ct,dt,ht]),reactExports.createElement("group",_extends$u({ref:St,onClick:vt,onPointerOver:()=>bt(!0),onPointerOut:()=>bt(!1),onPointerMissed:xt},st),reactExports.createElement(context$1.Provider,{value:yt},nt))}const Line$1=reactExports.forwardRef(function tt({points:et,color:nt="black",vertexColors:it,linewidth:rt,lineWidth:ot,segments:at,dashed:st,...lt},ct){const ut=useThree(mt=>mt.size),ht=reactExports.useMemo(()=>at?new LineSegments2:new Line2,[at]),[dt]=reactExports.useState(()=>new LineMaterial),pt=reactExports.useMemo(()=>{const mt=at?new LineSegmentsGeometry:new LineGeometry,gt=et.map(bt=>{const yt=Array.isArray(bt);return bt instanceof Vector3?[bt.x,bt.y,bt.z]:bt instanceof Vector2?[bt.x,bt.y,0]:yt&&bt.length===3?[bt[0],bt[1],bt[2]]:yt&&bt.length===2?[bt[0],bt[1],0]:bt});if(mt.setPositions(gt.flat()),it){const bt=it.map(yt=>yt instanceof Color$1?yt.toArray():yt);mt.setColors(bt.flat())}return mt},[et,at,it]);return reactExports.useLayoutEffect(()=>{ht.computeLineDistances()},[et,ht]),reactExports.useLayoutEffect(()=>{st?dt.defines.USE_DASH="":delete dt.defines.USE_DASH,dt.needsUpdate=!0},[st,dt]),reactExports.useEffect(()=>()=>pt.dispose(),[pt]),reactExports.createElement("primitive",_extends$u({object:ht,ref:ct},lt),reactExports.createElement("primitive",{object:pt,attach:"geometry"}),reactExports.createElement("primitive",_extends$u({object:dt,attach:"material",color:nt,vertexColors:!!it,resolution:[ut.width,ut.height],linewidth:rt??ot,dashed:st},lt)))});function workerBootstrap(){var tt=Object.create(null);function et(rt,ot){var at=rt.id,st=rt.name,lt=rt.dependencies;lt===void 0&&(lt=[]);var ct=rt.init;ct===void 0&&(ct=function(){});var ut=rt.getTransferables;if(ut===void 0&&(ut=null),!tt[at])try{lt=lt.map(function(dt){return dt&&dt.isWorkerModule&&(et(dt,function(pt){if(pt instanceof Error)throw pt}),dt=tt[dt.id].value),dt}),ct=it("<"+st+">.init",ct),ut&&(ut=it("<"+st+">.getTransferables",ut));var ht=null;typeof ct=="function"?ht=ct.apply(void 0,lt):console.error("worker module init function failed to rehydrate"),tt[at]={id:at,value:ht,getTransferables:ut},ot(ht)}catch(dt){dt&&dt.noLog||console.error(dt),ot(dt)}}function nt(rt,ot){var at,st=rt.id,lt=rt.args;(!tt[st]||typeof tt[st].value!="function")&&ot(new Error("Worker module "+st+": not found or its 'init' did not return a function"));try{var ct=(at=tt[st]).value.apply(at,lt);ct&&typeof ct.then=="function"?ct.then(ut,function(ht){return ot(ht instanceof Error?ht:new Error(""+ht))}):ut(ct)}catch(ht){ot(ht)}function ut(ht){try{var dt=tt[st].getTransferables&&tt[st].getTransferables(ht);(!dt||!Array.isArray(dt)||!dt.length)&&(dt=void 0),ot(ht,dt)}catch(pt){console.error(pt),ot(pt)}}}function it(rt,ot){var at=void 0;self.troikaDefine=function(lt){return at=lt};var st=URL.createObjectURL(new Blob(["/** "+rt.replace(/\*/g,"")+` **/ + `,clipping:!0}),this.isLineMaterial=!0,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(nt){this.uniforms.diffuse.value=nt}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(nt){nt===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(nt){this.uniforms.linewidth.value=nt}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(nt){!!nt!="USE_DASH"in this.defines&&(this.needsUpdate=!0),nt===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(nt){this.uniforms.dashScale.value=nt}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(nt){this.uniforms.dashSize.value=nt}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(nt){this.uniforms.dashOffset.value=nt}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(nt){this.uniforms.gapSize.value=nt}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(nt){this.uniforms.opacity.value=nt}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(nt){this.uniforms.resolution.value.copy(nt)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(nt){!!nt!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),nt===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(et)}}const _start=new Vector3,_end=new Vector3,_start4=new Vector4,_end4=new Vector4,_ssOrigin=new Vector4,_ssOrigin3=new Vector3,_mvMatrix=new Matrix4,_line=new Line3,_closestPoint=new Vector3,_box=new Box3,_sphere$1=new Sphere,_clipToWorldVector=new Vector4;let _ray,_instanceStart,_instanceEnd,_lineWidth;function getWorldSpaceHalfWidth(tt,et,nt){return _clipToWorldVector.set(0,0,-et,1).applyMatrix4(tt.projectionMatrix),_clipToWorldVector.multiplyScalar(1/_clipToWorldVector.w),_clipToWorldVector.x=_lineWidth/nt.width,_clipToWorldVector.y=_lineWidth/nt.height,_clipToWorldVector.applyMatrix4(tt.projectionMatrixInverse),_clipToWorldVector.multiplyScalar(1/_clipToWorldVector.w),Math.abs(Math.max(_clipToWorldVector.x,_clipToWorldVector.y))}function raycastWorldUnits(tt,et){for(let nt=0,it=_instanceStart.count;ntut&&_end4.z>ut)continue;if(_start4.z>ut){const wt=_start4.z-_end4.z,vt=(_start4.z-ut)/wt;_start4.lerp(_end4,vt)}else if(_end4.z>ut){const wt=_end4.z-_start4.z,vt=(_end4.z-ut)/wt;_end4.lerp(_start4,vt)}_start4.applyMatrix4(it),_end4.applyMatrix4(it),_start4.multiplyScalar(1/_start4.w),_end4.multiplyScalar(1/_end4.w),_start4.x*=ot.x/2,_start4.y*=ot.y/2,_end4.x*=ot.x/2,_end4.y*=ot.y/2,_line.start.copy(_start4),_line.start.z=0,_line.end.copy(_end4),_line.end.z=0;const mt=_line.closestPointToPointParameter(_ssOrigin3,!0);_line.at(mt,_closestPoint);const gt=MathUtils.lerp(_start4.z,_end4.z,mt),bt=gt>=-1&><=1,yt=_ssOrigin3.distanceTo(_closestPoint)<_lineWidth*.5;if(bt&&yt){_line.start.fromBufferAttribute(lt,ht),_line.end.fromBufferAttribute(ct,ht),_line.start.applyMatrix4(at),_line.end.applyMatrix4(at);const wt=new Vector3,vt=new Vector3;_ray.distanceSqToSegment(_line.start,_line.end,vt,wt),nt.push({point:vt,pointOnLine:wt,distance:_ray.origin.distanceTo(vt),object:tt,face:null,faceIndex:ht,uv:null,uv2:null})}}}class LineSegments2 extends Mesh{constructor(et=new LineSegmentsGeometry,nt=new LineMaterial({color:Math.random()*16777215})){super(et,nt),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const et=this.geometry,nt=et.attributes.instanceStart,it=et.attributes.instanceEnd,rt=new Float32Array(2*nt.count);for(let at=0,st=0,lt=nt.count;atlt,...st}){const{setEvents:lt,camera:ct,raycaster:ut,gl:ht,controls:dt,size:pt,get:mt}=useThree(),[gt,bt]=reactExports.useState(!1),[yt,wt]=reactExports.useReducer((Et,{object:$t,shift:It})=>$t===void 0?[]:Array.isArray($t)?$t:It?Et.includes($t)?Et.filter(Ft=>Ft!==$t):[$t,...Et]:Et[0]===$t?[]:[$t],[]);reactExports.useEffect(()=>void(it==null?void 0:it(yt)),[yt]);const vt=reactExports.useCallback(Et=>{Et.stopPropagation(),wt({object:at([Et.object])[0],shift:et&&Et.shiftKey})},[]),xt=reactExports.useCallback(Et=>!gt&&wt({}),[gt]),St=reactExports.useRef(null);return reactExports.useEffect(()=>{if(!tt||!et)return;const Et=new SelectionBox(ct,St.current),$t=document.createElement("div");$t.style.pointerEvents="none",$t.style.border=rt,$t.style.backgroundColor=ot,$t.style.position="fixed";const It=new Vector2,Ft=new Vector2,Ht=new Vector2,zt=mt().events.enabled,Ot=dt==null?void 0:dt.enabled;let jt=!1;function kt(Pt,Vt){const{offsetX:nn,offsetY:cn}=Pt,{width:Xt,height:un}=pt;Vt.set(nn/Xt*2-1,-(cn/un)*2+1)}function Tt(Pt){var Vt;dt&&(dt.enabled=!1),lt({enabled:!1}),jt=!0,(Vt=ht.domElement.parentElement)==null||Vt.appendChild($t),$t.style.left=`${Pt.clientX}px`,$t.style.top=`${Pt.clientY}px`,$t.style.width="0px",$t.style.height="0px",It.x=Pt.clientX,It.y=Pt.clientY}function Ct(Pt){Ht.x=Math.max(It.x,Pt.clientX),Ht.y=Math.max(It.y,Pt.clientY),Ft.x=Math.min(It.x,Pt.clientX),Ft.y=Math.min(It.y,Pt.clientY),$t.style.left=`${Ft.x}px`,$t.style.top=`${Ft.y}px`,$t.style.width=`${Ht.x-Ft.x}px`,$t.style.height=`${Ht.y-Ft.y}px`}function Ut(){if(jt){var Pt;dt&&(dt.enabled=Ot),lt({enabled:zt}),jt=!1,(Pt=$t.parentElement)==null||Pt.removeChild($t)}}function Nt(Pt){Pt.shiftKey&&(Tt(Pt),kt(Pt,Et.startPoint))}let Bt=[];function Mt(Pt){if(jt){Ct(Pt),kt(Pt,Et.endPoint);const Vt=Et.select().sort(nn=>nn.uuid).filter(nn=>nn.isMesh);shallow(Vt,Bt)||(Bt=Vt,wt({object:at(Vt)}))}}function Dt(Pt){jt&&Ut()}return document.addEventListener("pointerdown",Nt,{passive:!0}),document.addEventListener("pointermove",Mt,{passive:!0,capture:!0}),document.addEventListener("pointerup",Dt,{passive:!0}),()=>{document.removeEventListener("pointerdown",Nt),document.removeEventListener("pointermove",Mt),document.removeEventListener("pointerup",Dt)}},[pt.width,pt.height,ut,ct,dt,ht]),reactExports.createElement("group",_extends$t({ref:St,onClick:vt,onPointerOver:()=>bt(!0),onPointerOut:()=>bt(!1),onPointerMissed:xt},st),reactExports.createElement(context$1.Provider,{value:yt},nt))}const Line$1=reactExports.forwardRef(function tt({points:et,color:nt="black",vertexColors:it,linewidth:rt,lineWidth:ot,segments:at,dashed:st,...lt},ct){const ut=useThree(mt=>mt.size),ht=reactExports.useMemo(()=>at?new LineSegments2:new Line2,[at]),[dt]=reactExports.useState(()=>new LineMaterial),pt=reactExports.useMemo(()=>{const mt=at?new LineSegmentsGeometry:new LineGeometry,gt=et.map(bt=>{const yt=Array.isArray(bt);return bt instanceof Vector3?[bt.x,bt.y,bt.z]:bt instanceof Vector2?[bt.x,bt.y,0]:yt&&bt.length===3?[bt[0],bt[1],bt[2]]:yt&&bt.length===2?[bt[0],bt[1],0]:bt});if(mt.setPositions(gt.flat()),it){const bt=it.map(yt=>yt instanceof Color$1?yt.toArray():yt);mt.setColors(bt.flat())}return mt},[et,at,it]);return reactExports.useLayoutEffect(()=>{ht.computeLineDistances()},[et,ht]),reactExports.useLayoutEffect(()=>{st?dt.defines.USE_DASH="":delete dt.defines.USE_DASH,dt.needsUpdate=!0},[st,dt]),reactExports.useEffect(()=>()=>pt.dispose(),[pt]),reactExports.createElement("primitive",_extends$t({object:ht,ref:ct},lt),reactExports.createElement("primitive",{object:pt,attach:"geometry"}),reactExports.createElement("primitive",_extends$t({object:dt,attach:"material",color:nt,vertexColors:!!it,resolution:[ut.width,ut.height],linewidth:rt??ot,dashed:st},lt)))});function workerBootstrap(){var tt=Object.create(null);function et(rt,ot){var at=rt.id,st=rt.name,lt=rt.dependencies;lt===void 0&&(lt=[]);var ct=rt.init;ct===void 0&&(ct=function(){});var ut=rt.getTransferables;if(ut===void 0&&(ut=null),!tt[at])try{lt=lt.map(function(dt){return dt&&dt.isWorkerModule&&(et(dt,function(pt){if(pt instanceof Error)throw pt}),dt=tt[dt.id].value),dt}),ct=it("<"+st+">.init",ct),ut&&(ut=it("<"+st+">.getTransferables",ut));var ht=null;typeof ct=="function"?ht=ct.apply(void 0,lt):console.error("worker module init function failed to rehydrate"),tt[at]={id:at,value:ht,getTransferables:ut},ot(ht)}catch(dt){dt&&dt.noLog||console.error(dt),ot(dt)}}function nt(rt,ot){var at,st=rt.id,lt=rt.args;(!tt[st]||typeof tt[st].value!="function")&&ot(new Error("Worker module "+st+": not found or its 'init' did not return a function"));try{var ct=(at=tt[st]).value.apply(at,lt);ct&&typeof ct.then=="function"?ct.then(ut,function(ht){return ot(ht instanceof Error?ht:new Error(""+ht))}):ut(ct)}catch(ht){ot(ht)}function ut(ht){try{var dt=tt[st].getTransferables&&tt[st].getTransferables(ht);(!dt||!Array.isArray(dt)||!dt.length)&&(dt=void 0),ot(ht,dt)}catch(pt){console.error(pt),ot(pt)}}}function it(rt,ot){var at=void 0;self.troikaDefine=function(lt){return at=lt};var st=URL.createObjectURL(new Blob(["/** "+rt.replace(/\*/g,"")+` **/ troikaDefine( `+ot+` @@ -4345,7 +4345,7 @@ troikaDefine( `+stringifyFunction(ct)+` )}`}),_allowInitAsString=!1),ct&&ct.workerModuleData&&(ct=ct.workerModuleData),ct});function lt(){for(var ct=[],ut=arguments.length;ut--;)ct[ut]=arguments[ut];if(!st){st=callWorker(rt,"registerModule",lt.workerModuleData);var ht=function(){st=null,registeredModules[rt].delete(ht)};(registeredModules[rt]||(registeredModules[rt]=new Set)).add(ht)}return st.then(function(dt){var pt=dt.isCallable;if(pt)return callWorker(rt,"callModule",{id:ot,args:ct});throw new Error("Worker module function was called but `init` did not return a callable function")})}return lt.workerModuleData={isWorkerModule:!0,id:ot,name:at,dependencies:et,init:stringifyFunction(nt),getTransferables:it&&stringifyFunction(it)},lt}function terminateWorker(tt){registeredModules[tt]&®isteredModules[tt].forEach(function(et){et()}),workers[tt]&&(workers[tt].terminate(),delete workers[tt])}function stringifyFunction(tt){var et=tt.toString();return!/^function/.test(et)&&/^\w+\s*\(/.test(et)&&(et="function "+et),et}function getWorker(tt){var et=workers[tt];if(!et){var nt=stringifyFunction(workerBootstrap);et=workers[tt]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+tt.replace(/\*/g,"")+` **/ -;(`+nt+")()"],{type:"application/javascript"}))),et.onmessage=function(it){var rt=it.data,ot=rt.messageId,at=openRequests[ot];if(!at)throw new Error("WorkerModule response with empty or unknown messageId");delete openRequests[ot],at(rt)}}return et}function callWorker(tt,et,nt){return new Promise(function(it,rt){var ot=++_messageId;openRequests[ot]=function(at){at.success?it(at.result):rt(new Error("Error in worker "+et+" call: "+at.error))},getWorker(tt).postMessage({messageId:ot,action:et,data:nt})})}function SDFGenerator(){var tt=function(et){function nt(Ot,Ct,Dt,Mt,Vt,Qt,rn,Xt){var an=1-rn;Xt.x=an*an*Ot+2*an*rn*Dt+rn*rn*Vt,Xt.y=an*an*Ct+2*an*rn*Mt+rn*rn*Qt}function it(Ot,Ct,Dt,Mt,Vt,Qt,rn,Xt,an,tn){var pn=1-an;tn.x=pn*pn*pn*Ot+3*pn*pn*an*Dt+3*pn*an*an*Vt+an*an*an*rn,tn.y=pn*pn*pn*Ct+3*pn*pn*an*Mt+3*pn*an*an*Qt+an*an*an*Xt}function rt(Ot,Ct){for(var Dt=/([MLQCZ])([^MLQCZ]*)/g,Mt,Vt,Qt,rn,Xt;Mt=Dt.exec(Ot);){var an=Mt[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(tn){return parseFloat(tn)});switch(Mt[1]){case"M":rn=Vt=an[0],Xt=Qt=an[1];break;case"L":(an[0]!==rn||an[1]!==Xt)&&Ct("L",rn,Xt,rn=an[0],Xt=an[1]);break;case"Q":{Ct("Q",rn,Xt,rn=an[2],Xt=an[3],an[0],an[1]);break}case"C":{Ct("C",rn,Xt,rn=an[4],Xt=an[5],an[0],an[1],an[2],an[3]);break}case"Z":(rn!==Vt||Xt!==Qt)&&Ct("L",rn,Xt,Vt,Qt);break}}}function ot(Ot,Ct,Dt){Dt===void 0&&(Dt=16);var Mt={x:0,y:0};rt(Ot,function(Vt,Qt,rn,Xt,an,tn,pn,vn,sn){switch(Vt){case"L":Ct(Qt,rn,Xt,an);break;case"Q":{for(var Zt=Qt,Sn=rn,Tn=1;Tn0;)Nn[qn]=arguments[qn+2];var Wn=$n[Bn]||($n[Bn]=Dt.getUniformLocation(nn,Bn));Dt["uniform"+Mn].apply(Dt,[Wn].concat(Nn))},setAttribute:function(Mn,Bn,Nn,qn,Wn){var Vn=hn[Mn];Vn||(Vn=hn[Mn]={buf:Dt.createBuffer(),loc:Dt.getAttribLocation(nn,Mn),data:null}),Dt.bindBuffer(Dt.ARRAY_BUFFER,Vn.buf),Dt.vertexAttribPointer(Vn.loc,Bn,Dt.FLOAT,!1,0,0),Dt.enableVertexAttribArray(Vn.loc),Vt?Dt.vertexAttribDivisor(Vn.loc,qn):Cn("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Vn.loc,qn),Wn!==Vn.data&&(Dt.bufferData(Dt.ARRAY_BUFFER,Wn,Nn),Vn.data=Wn)}})}}}rn[In].transaction(cn)},yn=function(In,xn){an++;try{Dt.activeTexture(Dt.TEXTURE0+an);var dn=Xt[In];dn||(dn=Xt[In]=Dt.createTexture(),Dt.bindTexture(Dt.TEXTURE_2D,dn),Dt.texParameteri(Dt.TEXTURE_2D,Dt.TEXTURE_MIN_FILTER,Dt.NEAREST),Dt.texParameteri(Dt.TEXTURE_2D,Dt.TEXTURE_MAG_FILTER,Dt.NEAREST)),Dt.bindTexture(Dt.TEXTURE_2D,dn),xn(dn,an)}finally{an--}},un=function(In,xn,dn){var cn=Dt.createFramebuffer();tn.push(cn),Dt.bindFramebuffer(Dt.FRAMEBUFFER,cn),Dt.activeTexture(Dt.TEXTURE0+xn),Dt.bindTexture(Dt.TEXTURE_2D,In),Dt.framebufferTexture2D(Dt.FRAMEBUFFER,Dt.COLOR_ATTACHMENT0,Dt.TEXTURE_2D,In,0);try{dn(cn)}finally{Dt.deleteFramebuffer(cn),Dt.bindFramebuffer(Dt.FRAMEBUFFER,tn[--tn.length-1]||null)}},En=function(){Qt={},rn={},Xt={},an=-1,tn.length=0};var pn=Cn,vn=jn,sn=Un,Zt=yn,Sn=un,Tn=En,Vt=typeof WebGL2RenderingContext<"u"&&Dt instanceof WebGL2RenderingContext,Qt={},rn={},Xt={},an=-1,tn=[];Dt.canvas.addEventListener("webglcontextlost",function(In){En(),In.preventDefault()},!1),lt.set(Dt,Mt={gl:Dt,isWebGL2:Vt,getExtension:Cn,withProgram:Un,withTexture:yn,withTextureFramebuffer:un,handleContextLoss:En})}Ct(Mt)}function ht(Ot,Ct,Dt,Mt,Vt,Qt,rn,Xt){rn===void 0&&(rn=15),Xt===void 0&&(Xt=null),ut(Ot,function(an){var tn=an.gl,pn=an.withProgram,vn=an.withTexture;vn("copy",function(sn,Zt){tn.texImage2D(tn.TEXTURE_2D,0,tn.RGBA,Vt,Qt,0,tn.RGBA,tn.UNSIGNED_BYTE,Ct),pn("copy",at,st,function(Sn){var Tn=Sn.setUniform,Cn=Sn.setAttribute;Cn("aUV",2,tn.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),Tn("1i","image",Zt),tn.bindFramebuffer(tn.FRAMEBUFFER,Xt||null),tn.disable(tn.BLEND),tn.colorMask(rn&8,rn&4,rn&2,rn&1),tn.viewport(Dt,Mt,Vt,Qt),tn.scissor(Dt,Mt,Vt,Qt),tn.drawArrays(tn.TRIANGLES,0,3)})})})}function dt(Ot,Ct,Dt){var Mt=Ot.width,Vt=Ot.height;ut(Ot,function(Qt){var rn=Qt.gl,Xt=new Uint8Array(Mt*Vt*4);rn.readPixels(0,0,Mt,Vt,rn.RGBA,rn.UNSIGNED_BYTE,Xt),Ot.width=Ct,Ot.height=Dt,ht(rn,Xt,0,0,Mt,Vt)})}var pt=Object.freeze({__proto__:null,withWebGLContext:ut,renderImageData:ht,resizeWebGLCanvasWithoutClearing:dt});function mt(Ot,Ct,Dt,Mt,Vt,Qt){Qt===void 0&&(Qt=1);var rn=new Uint8Array(Ot*Ct),Xt=Mt[2]-Mt[0],an=Mt[3]-Mt[1],tn=[];ot(Dt,function(Cn,jn,Un,yn){tn.push({x1:Cn,y1:jn,x2:Un,y2:yn,minX:Math.min(Cn,Un),minY:Math.min(jn,yn),maxX:Math.max(Cn,Un),maxY:Math.max(jn,yn)})}),tn.sort(function(Cn,jn){return Cn.maxX-jn.maxX});for(var pn=0;pnEn.minX&&jn-ynEn.minY){var In=yt(Cn,jn,En.x1,En.y1,En.x2,En.y2);Injn!=un.y2>jn&&Cn<(un.x2-un.x1)*(jn-un.y1)/(un.y2-un.y1)+un.x1;En&&(Un+=un.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 gt(yn,un){var En=36,In=0,xn=new Map,dn=un&&new Map,cn;return yn.split(",").forEach(function hn($n){if($n.indexOf("+")!==-1)for(var nn=+$n;nn--;)hn(cn);else{cn=$n;var Kt=$n.split(">"),Yt=Kt[0],_n=Kt[1];Yt=String.fromCodePoint(In+=parseInt(Yt,En)),_n=String.fromCodePoint(In+=parseInt(_n,En)),xn.set(Yt,_n),un&&dn.set(_n,Yt)}}),{map:xn,reverseMap:dn}}var bt,yt,wt;function vt(){if(!bt){var yn=gt(mt.pairs,!0),un=yn.map,En=yn.reverseMap;bt=un,yt=En,wt=gt(mt.canonical,!1).map}}function xt(yn){return vt(),bt.get(yn)||null}function St(yn){return vt(),yt.get(yn)||null}function Et(yn){return vt(),wt.get(yn)||null}var It=it.L,Tt=it.R,$t=it.EN,Ut=it.ES,Lt=it.ET,Bt=it.AN,Pt=it.CS,kt=it.B,At=it.S,Rt=it.ON,Wt=it.BN,jt=it.NSM,Ot=it.AL,Ct=it.LRO,Dt=it.RLO,Mt=it.LRE,Vt=it.RLE,Qt=it.PDF,rn=it.LRI,Xt=it.RLI,an=it.FSI,tn=it.PDI;function pn(yn,un){for(var En=125,In=new Uint32Array(yn.length),xn=0;xn0)Vn--;else if(Jn>0){for(Fn=0;!qn[qn.length-1]._isolate;)qn.pop();var jr=qn[qn.length-1]._isolInitIndex;jr!=null&&($n.set(jr,Hn),$n.set(Hn,jr)),qn.pop(),Jn--}Wn=qn[qn.length-1],hn[Hn]=Wn._level,Wn._override&&cn(Hn,Wn._override)}else dr&Qt?(Vn===0&&(Fn>0?Fn--:!Wn._isolate&&qn.length>1&&(qn.pop(),Wn=qn[qn.length-1])),hn[Hn]=Wn._level):dr&kt&&(hn[Hn]=Kt.level);else hn[Hn]=Wn._level,Wn._override&&dr!==Wt&&cn(Hn,Wn._override)}for(var Mr=[],qr=null,Ur=Kt.start;Ur<=Kt.end;Ur++){var Lr=In[Ur];if(!(Lr<)){var ao=hn[Ur],Gr=Lr&ot,Br=Lr===tn;qr&&ao===qr._level?(qr._end=Ur,qr._endsWithIsolInit=Gr):Mr.push(qr={_start:Ur,_end:Ur,_level:ao,_startsWithPDI:Br,_endsWithIsolInit:Gr})}}for(var go=[],wn=0;wn=0;Vr--)if(!(In[Vr]<)){ar=hn[Vr];break}var wr=On[On.length-1],Or=hn[wr],Hr=Kt.level;if(!(In[wr]&ot)){for(var no=wr+1;no<=Kt.end;no++)if(!(In[no]<)){Hr=hn[no];break}}go.push({_seqIndices:On,_sosType:Math.max(ar,or)%2?Tt:It,_eosType:Math.max(Hr,Or)%2?Tt:It})}}for(var Xr=0;Xr=0;Pr--)if(!(In[br[Pr]]<)){Fr=In[br[Pr]];break}cn(Nr,Fr&(ot|tn)?Rt:Fr)}}if(dn.get($t))for(var _i=0;_i=-1;xr--){var cr=xr===-1?$r:In[br[xr]];if(cr&at){cr===Ot&&cn(nr,Bt);break}}}if(dn.get(Ot))for(var yr=0;yr=0&&(fo=In[br[Yn]],!!(fo<));Yn--);for(var vo=io+1;vo=0&&In[br[bo]]&(Lt|lt);bo--)cn(br[bo],$t);for(_o++;_o=0&&In[br[Wo]]<Wo--)cn(br[Wo],Rt);for(var Po=$o+1;Po=0;tu--){var sp=pu[tu].char;if(sp===Bp||sp===St(Et(Lo))||xt(Et(sp))===Lo){Jo.push([pu[tu].seqIndex,eu]),pu.length=tu;break}}}Jo.sort(function(bs,Cs){return bs[0]-Cs[0]})}for(var Op=0;Op=0;Yo--){var Ko=br[Yo];if(In[Ko]&$a){var Js=In[Ko]&na?Tt:It;Js!==Cr?Us=Js:Us=Cr;break}}}if(Us){if(In[br[ts]]=In[br[mu]]=Us,Us!==Cr){for(var zs=ts+1;zs=0;Hu--)if(In[br[Hu]]<)Np=Hu;else{Ws=In[br[Hu]]&na?Tt:It;break}for(var ns=Dr,gu=$l+1;gu=0&&dt(yn[yu])&ct;yu--)hn[yu]=Kt.level}}return{levels:hn,paragraphs:nn};function Gu(bs,Cs){for(var os=bs;os=hn&&dt(yn[Kt])&ct;Kt--)nn[Kt]=cn.level;for(var Yt=cn.level,_n=1/0,Mn=0;MnYt&&(Yt=Bn),Bn<_n&&(_n=Bn|1)}for(var Nn=Yt;Nn>=_n;Nn--)for(var qn=0;qn=Nn){for(var Wn=qn;qn+1=Nn;)qn++;qn>Wn&&dn.push([Wn+hn,qn+hn])}}}),dn}function jn(yn,un,En,In){var xn=Un(yn,un,En,In),dn=[].concat(yn);return xn.forEach(function(cn,hn){dn[hn]=(un.levels[cn]&1?Sn(yn[cn]):null)||yn[cn]}),dn.join("")}function Un(yn,un,En,In){for(var xn=Cn(yn,un,En,In),dn=[],cn=0;cn/gm;function nt(it,rt){let ot=ShaderChunk[rt];return ot?expandShaderIncludes(ot):it}return tt.replace(et,nt)}const _lut=[];for(let tt=0;tt<256;tt++)_lut[tt]=(tt<16?"0":"")+tt.toString(16);function generateUUID(){const tt=Math.random()*4294967295|0,et=Math.random()*4294967295|0,nt=Math.random()*4294967295|0,it=Math.random()*4294967295|0;return(_lut[tt&255]+_lut[tt>>8&255]+_lut[tt>>16&255]+_lut[tt>>24&255]+"-"+_lut[et&255]+_lut[et>>8&255]+"-"+_lut[et>>16&15|64]+_lut[et>>24&255]+"-"+_lut[nt&63|128]+_lut[nt>>8&255]+"-"+_lut[nt>>16&255]+_lut[nt>>24&255]+_lut[it&255]+_lut[it>>8&255]+_lut[it>>16&255]+_lut[it>>24&255]).toUpperCase()}const assign$2=Object.assign||function(){let tt=arguments[0];for(let et=1,nt=arguments.length;et/gm,` +;(`+nt+")()"],{type:"application/javascript"}))),et.onmessage=function(it){var rt=it.data,ot=rt.messageId,at=openRequests[ot];if(!at)throw new Error("WorkerModule response with empty or unknown messageId");delete openRequests[ot],at(rt)}}return et}function callWorker(tt,et,nt){return new Promise(function(it,rt){var ot=++_messageId;openRequests[ot]=function(at){at.success?it(at.result):rt(new Error("Error in worker "+et+" call: "+at.error))},getWorker(tt).postMessage({messageId:ot,action:et,data:nt})})}function SDFGenerator(){var tt=function(et){function nt(Bt,Mt,Dt,Pt,Vt,nn,cn,Xt){var un=1-cn;Xt.x=un*un*Bt+2*un*cn*Dt+cn*cn*Vt,Xt.y=un*un*Mt+2*un*cn*Pt+cn*cn*nn}function it(Bt,Mt,Dt,Pt,Vt,nn,cn,Xt,un,en){var fn=1-un;en.x=fn*fn*fn*Bt+3*fn*fn*un*Dt+3*fn*un*un*Vt+un*un*un*cn,en.y=fn*fn*fn*Mt+3*fn*fn*un*Pt+3*fn*un*un*nn+un*un*un*Xt}function rt(Bt,Mt){for(var Dt=/([MLQCZ])([^MLQCZ]*)/g,Pt,Vt,nn,cn,Xt;Pt=Dt.exec(Bt);){var un=Pt[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(en){return parseFloat(en)});switch(Pt[1]){case"M":cn=Vt=un[0],Xt=nn=un[1];break;case"L":(un[0]!==cn||un[1]!==Xt)&&Mt("L",cn,Xt,cn=un[0],Xt=un[1]);break;case"Q":{Mt("Q",cn,Xt,cn=un[2],Xt=un[3],un[0],un[1]);break}case"C":{Mt("C",cn,Xt,cn=un[4],Xt=un[5],un[0],un[1],un[2],un[3]);break}case"Z":(cn!==Vt||Xt!==nn)&&Mt("L",cn,Xt,Vt,nn);break}}}function ot(Bt,Mt,Dt){Dt===void 0&&(Dt=16);var Pt={x:0,y:0};rt(Bt,function(Vt,nn,cn,Xt,un,en,fn,xn,an){switch(Vt){case"L":Mt(nn,cn,Xt,un);break;case"Q":{for(var Zt=nn,En=cn,In=1;In0;)tn[qt]=arguments[qt+2];var Kt=gn[Sn]||(gn[Sn]=Dt.getUniformLocation(Tn,Sn));Dt["uniform"+rn].apply(Dt,[Kt].concat(tn))},setAttribute:function(rn,Sn,tn,qt,Kt){var wn=An[rn];wn||(wn=An[rn]={buf:Dt.createBuffer(),loc:Dt.getAttribLocation(Tn,rn),data:null}),Dt.bindBuffer(Dt.ARRAY_BUFFER,wn.buf),Dt.vertexAttribPointer(wn.loc,Sn,Dt.FLOAT,!1,0,0),Dt.enableVertexAttribArray(wn.loc),Vt?Dt.vertexAttribDivisor(wn.loc,qt):fn("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(wn.loc,qt),Kt!==wn.data&&(Dt.bufferData(Dt.ARRAY_BUFFER,Kt,tn),wn.data=Kt)}})}}}cn[Cn].transaction(_n)},Zt=function(Cn,Nn){un++;try{Dt.activeTexture(Dt.TEXTURE0+un);var Un=Xt[Cn];Un||(Un=Xt[Cn]=Dt.createTexture(),Dt.bindTexture(Dt.TEXTURE_2D,Un),Dt.texParameteri(Dt.TEXTURE_2D,Dt.TEXTURE_MIN_FILTER,Dt.NEAREST),Dt.texParameteri(Dt.TEXTURE_2D,Dt.TEXTURE_MAG_FILTER,Dt.NEAREST)),Dt.bindTexture(Dt.TEXTURE_2D,Un),Nn(Un,un)}finally{un--}},En=function(Cn,Nn,Un){var _n=Dt.createFramebuffer();en.push(_n),Dt.bindFramebuffer(Dt.FRAMEBUFFER,_n),Dt.activeTexture(Dt.TEXTURE0+Nn),Dt.bindTexture(Dt.TEXTURE_2D,Cn),Dt.framebufferTexture2D(Dt.FRAMEBUFFER,Dt.COLOR_ATTACHMENT0,Dt.TEXTURE_2D,Cn,0);try{Un(_n)}finally{Dt.deleteFramebuffer(_n),Dt.bindFramebuffer(Dt.FRAMEBUFFER,en[--en.length-1]||null)}},In=function(){nn={},cn={},Xt={},un=-1,en.length=0};var Vt=typeof WebGL2RenderingContext<"u"&&Dt instanceof WebGL2RenderingContext,nn={},cn={},Xt={},un=-1,en=[];Dt.canvas.addEventListener("webglcontextlost",function(Cn){In(),Cn.preventDefault()},!1),lt.set(Dt,Pt={gl:Dt,isWebGL2:Vt,getExtension:fn,withProgram:an,withTexture:Zt,withTextureFramebuffer:En,handleContextLoss:In})}Mt(Pt)}function ht(Bt,Mt,Dt,Pt,Vt,nn,cn,Xt){cn===void 0&&(cn=15),Xt===void 0&&(Xt=null),ut(Bt,function(un){var en=un.gl,fn=un.withProgram,xn=un.withTexture;xn("copy",function(an,Zt){en.texImage2D(en.TEXTURE_2D,0,en.RGBA,Vt,nn,0,en.RGBA,en.UNSIGNED_BYTE,Mt),fn("copy",at,st,function(En){var In=En.setUniform,Cn=En.setAttribute;Cn("aUV",2,en.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),In("1i","image",Zt),en.bindFramebuffer(en.FRAMEBUFFER,Xt||null),en.disable(en.BLEND),en.colorMask(cn&8,cn&4,cn&2,cn&1),en.viewport(Dt,Pt,Vt,nn),en.scissor(Dt,Pt,Vt,nn),en.drawArrays(en.TRIANGLES,0,3)})})})}function dt(Bt,Mt,Dt){var Pt=Bt.width,Vt=Bt.height;ut(Bt,function(nn){var cn=nn.gl,Xt=new Uint8Array(Pt*Vt*4);cn.readPixels(0,0,Pt,Vt,cn.RGBA,cn.UNSIGNED_BYTE,Xt),Bt.width=Mt,Bt.height=Dt,ht(cn,Xt,0,0,Pt,Vt)})}var pt=Object.freeze({__proto__:null,withWebGLContext:ut,renderImageData:ht,resizeWebGLCanvasWithoutClearing:dt});function mt(Bt,Mt,Dt,Pt,Vt,nn){nn===void 0&&(nn=1);var cn=new Uint8Array(Bt*Mt),Xt=Pt[2]-Pt[0],un=Pt[3]-Pt[1],en=[];ot(Dt,function(Cn,Nn,Un,_n){en.push({x1:Cn,y1:Nn,x2:Un,y2:_n,minX:Math.min(Cn,Un),minY:Math.min(Nn,_n),maxX:Math.max(Cn,Un),maxY:Math.max(Nn,_n)})}),en.sort(function(Cn,Nn){return Cn.maxX-Nn.maxX});for(var fn=0;fngn.minX&&Nn-_ngn.minY){var Tn=yt(Cn,Nn,gn.x1,gn.y1,gn.x2,gn.y2);TnNn!=An.y2>Nn&&Cn<(An.x2-An.x1)*(Nn-An.y1)/(An.y2-An.y1)+An.x1;gn&&(Un+=An.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 gt(_n,An){var gn=36,Tn=0,yn=new Map,dn=An&&new Map,sn;return _n.split(",").forEach(function rn(Sn){if(Sn.indexOf("+")!==-1)for(var tn=+Sn;tn--;)rn(sn);else{sn=Sn;var qt=Sn.split(">"),Kt=qt[0],wn=qt[1];Kt=String.fromCodePoint(Tn+=parseInt(Kt,gn)),wn=String.fromCodePoint(Tn+=parseInt(wn,gn)),yn.set(Kt,wn),An&&dn.set(wn,Kt)}}),{map:yn,reverseMap:dn}}var bt,yt,wt;function vt(){if(!bt){var _n=gt(mt.pairs,!0),An=_n.map,gn=_n.reverseMap;bt=An,yt=gn,wt=gt(mt.canonical,!1).map}}function xt(_n){return vt(),bt.get(_n)||null}function St(_n){return vt(),yt.get(_n)||null}function Et(_n){return vt(),wt.get(_n)||null}var $t=it.L,It=it.R,Ft=it.EN,Ht=it.ES,zt=it.ET,Ot=it.AN,jt=it.CS,kt=it.B,Tt=it.S,Ct=it.ON,Ut=it.BN,Nt=it.NSM,Bt=it.AL,Mt=it.LRO,Dt=it.RLO,Pt=it.LRE,Vt=it.RLE,nn=it.PDF,cn=it.LRI,Xt=it.RLI,un=it.FSI,en=it.PDI;function fn(_n,An){for(var gn=125,Tn=new Uint32Array(_n.length),yn=0;yn<_n.length;yn++)Tn[yn]=dt(_n[yn]);var dn=new Map;function sn(bs,Cs){var os=Tn[bs];Tn[bs]=Cs,dn.set(os,dn.get(os)-1),os&st&&dn.set(st,dn.get(st)-1),dn.set(Cs,(dn.get(Cs)||0)+1),Cs&st&&dn.set(st,(dn.get(st)||0)+1)}for(var rn=new Uint8Array(_n.length),Sn=new Map,tn=[],qt=null,Kt=0;Kt<_n.length;Kt++)qt||tn.push(qt={start:Kt,end:_n.length-1,level:An==="rtl"?1:An==="ltr"?0:Gu(Kt,!1)}),Tn[Kt]&kt&&(qt.end=Kt,qt=null);for(var wn=Vt|Pt|Dt|Mt|ot|en|nn|kt,Rn=function(bs){return bs+(bs&1?1:2)},jn=function(bs){return bs+(bs&1?2:1)},Bn=0;Bn0)Gn--;else if(Jn>0){for(Fn=0;!Xn[Xn.length-1]._isolate;)Xn.pop();var Or=Xn[Xn.length-1]._isolInitIndex;Or!=null&&(Sn.set(Or,Vn),Sn.set(Vn,Or)),Xn.pop(),Jn--}Wn=Xn[Xn.length-1],rn[Vn]=Wn._level,Wn._override&&sn(Vn,Wn._override)}else dr&nn?(Gn===0&&(Fn>0?Fn--:!Wn._isolate&&Xn.length>1&&(Xn.pop(),Wn=Xn[Xn.length-1])),rn[Vn]=Wn._level):dr&kt&&(rn[Vn]=qt.level);else rn[Vn]=Wn._level,Wn._override&&dr!==Ut&&sn(Vn,Wn._override)}for(var Mr=[],qr=null,Ur=qt.start;Ur<=qt.end;Ur++){var Lr=Tn[Ur];if(!(Lr<)){var ao=rn[Ur],Gr=Lr&ot,Br=Lr===en;qr&&ao===qr._level?(qr._end=Ur,qr._endsWithIsolInit=Gr):Mr.push(qr={_start:Ur,_end:Ur,_level:ao,_startsWithPDI:Br,_endsWithIsolInit:Gr})}}for(var go=[],vn=0;vn=0;Vr--)if(!(Tn[Vr]<)){ar=rn[Vr];break}var wr=On[On.length-1],jr=rn[wr],Hr=qt.level;if(!(Tn[wr]&ot)){for(var no=wr+1;no<=qt.end;no++)if(!(Tn[no]<)){Hr=rn[no];break}}go.push({_seqIndices:On,_sosType:Math.max(ar,or)%2?It:$t,_eosType:Math.max(Hr,jr)%2?It:$t})}}for(var Xr=0;Xr=0;Pr--)if(!(Tn[br[Pr]]<)){Fr=Tn[br[Pr]];break}sn(Nr,Fr&(ot|en)?Ct:Fr)}}if(dn.get(Ft))for(var _i=0;_i=-1;xr--){var cr=xr===-1?$r:Tn[br[xr]];if(cr&at){cr===Bt&&sn(nr,Ot);break}}}if(dn.get(Bt))for(var yr=0;yr=0&&(fo=Tn[br[qn]],!!(fo<));qn--);for(var vo=io+1;vo=0&&Tn[br[bo]]&(zt|lt);bo--)sn(br[bo],Ft);for(_o++;_o=0&&Tn[br[Wo]]<Wo--)sn(br[Wo],Ct);for(var Po=$o+1;Po=0;tu--){var sp=pu[tu].char;if(sp===Bp||sp===St(Et(Lo))||xt(Et(sp))===Lo){Jo.push([pu[tu].seqIndex,eu]),pu.length=tu;break}}}Jo.sort(function(bs,Cs){return bs[0]-Cs[0]})}for(var jp=0;jp=0;Yo--){var Ko=br[Yo];if(Tn[Ko]&$a){var Js=Tn[Ko]&na?It:$t;Js!==Cr?Us=Js:Us=Cr;break}}}if(Us){if(Tn[br[ts]]=Tn[br[mu]]=Us,Us!==Cr){for(var zs=ts+1;zs=0;Hu--)if(Tn[br[Hu]]<)Np=Hu;else{Ws=Tn[br[Hu]]&na?It:$t;break}for(var ns=Dr,gu=$l+1;gu=0&&dt(_n[yu])&ct;yu--)rn[yu]=qt.level}}return{levels:rn,paragraphs:tn};function Gu(bs,Cs){for(var os=bs;os<_n.length;os++){var Vo=Tn[os];if(Vo&(It|Bt))return 1;if(Vo&(kt|$t)||Cs&&Vo===en)return 0;if(Vo&ot){var Zs=Dp(os);os=Zs===-1?_n.length:Zs}}return 0}function Dp(bs){for(var Cs=1,os=bs+1;os<_n.length;os++){var Vo=Tn[os];if(Vo&kt)break;if(Vo&en){if(--Cs===0)return os}else Vo&ot&&Cs++}return-1}}var xn="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",an;function Zt(){if(!an){var _n=gt(xn,!0),An=_n.map,gn=_n.reverseMap;gn.forEach(function(Tn,yn){An.set(yn,Tn)}),an=An}}function En(_n){return Zt(),an.get(_n)||null}function In(_n,An,gn,Tn){var yn=_n.length;gn=Math.max(0,gn==null?0:+gn),Tn=Math.min(yn-1,Tn==null?yn-1:+Tn);for(var dn=new Map,sn=gn;sn<=Tn;sn++)if(An[sn]&1){var rn=En(_n[sn]);rn!==null&&dn.set(sn,rn)}return dn}function Cn(_n,An,gn,Tn){var yn=_n.length;gn=Math.max(0,gn==null?0:+gn),Tn=Math.min(yn-1,Tn==null?yn-1:+Tn);var dn=[];return An.paragraphs.forEach(function(sn){var rn=Math.max(gn,sn.start),Sn=Math.min(Tn,sn.end);if(rn=rn&&dt(_n[qt])&ct;qt--)tn[qt]=sn.level;for(var Kt=sn.level,wn=1/0,Rn=0;RnKt&&(Kt=jn),jn=wn;Bn--)for(var Xn=0;Xn=Bn){for(var Wn=Xn;Xn+1=Bn;)Xn++;Xn>Wn&&dn.push([Wn+rn,Xn+rn])}}}),dn}function Nn(_n,An,gn,Tn){var yn=Un(_n,An,gn,Tn),dn=[].concat(_n);return yn.forEach(function(sn,rn){dn[rn]=(An.levels[sn]&1?En(_n[sn]):null)||_n[sn]}),dn.join("")}function Un(_n,An,gn,Tn){for(var yn=Cn(_n,An,gn,Tn),dn=[],sn=0;sn<_n.length;sn++)dn[sn]=sn;return yn.forEach(function(rn){for(var Sn=rn[0],tn=rn[1],qt=dn.slice(Sn,tn+1),Kt=qt.length;Kt--;)dn[tn-Kt]=qt[Kt]}),dn}return et.closingToOpeningBracket=St,et.getBidiCharType=dt,et.getBidiCharTypeName=pt,et.getCanonicalBracket=Et,et.getEmbeddingLevels=fn,et.getMirroredCharacter=En,et.getMirroredCharactersMap=In,et.getReorderSegments=Cn,et.getReorderedIndices=Un,et.getReorderedString=Nn,et.openingToClosingBracket=xt,Object.defineProperty(et,"__esModule",{value:!0}),et}({});return tt}const voidMainRegExp=/\bvoid\s+main\s*\(\s*\)\s*{/g;function expandShaderIncludes(tt){const et=/^[ \t]*#include +<([\w\d./]+)>/gm;function nt(it,rt){let ot=ShaderChunk[rt];return ot?expandShaderIncludes(ot):it}return tt.replace(et,nt)}const _lut=[];for(let tt=0;tt<256;tt++)_lut[tt]=(tt<16?"0":"")+tt.toString(16);function generateUUID(){const tt=Math.random()*4294967295|0,et=Math.random()*4294967295|0,nt=Math.random()*4294967295|0,it=Math.random()*4294967295|0;return(_lut[tt&255]+_lut[tt>>8&255]+_lut[tt>>16&255]+_lut[tt>>24&255]+"-"+_lut[et&255]+_lut[et>>8&255]+"-"+_lut[et>>16&15|64]+_lut[et>>24&255]+"-"+_lut[nt&63|128]+_lut[nt>>8&255]+"-"+_lut[nt>>16&255]+_lut[nt>>24&255]+_lut[it&255]+_lut[it>>8&255]+_lut[it>>16&255]+_lut[it>>24&255]).toUpperCase()}const assign$2=Object.assign||function(){let tt=arguments[0];for(let et=1,nt=arguments.length;et/gm,` //!BEGIN_POST_CHUNK $1 $& //!END_POST_CHUNK @@ -4375,19 +4375,19 @@ void main() { ${it} troikaOrigMain${et}(); ${rt} -}`),tt}function optionsJsonReplacer(tt,et){return tt==="uniforms"?void 0:typeof et=="function"?et.toString():et}let _idCtr=0;const optionsHashesToIds=new Map;function getKeyForOptions(tt){const et=JSON.stringify(tt,optionsJsonReplacer);let nt=optionsHashesToIds.get(et);return nt==null&&optionsHashesToIds.set(et,nt=++_idCtr),nt}function createTypesetter(tt,et,nt){const{defaultFontURL:it}=nt,rt=Object.create(null),ot=1/0,at=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,st="[^\\S\\u00A0]",lt=new RegExp(`${st}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function ct(wt,vt){function xt(){const St=Et=>{console.error(`Failure loading font ${wt}${wt===it?"":"; trying fallback"}`,Et),wt!==it&&(wt=it,xt())};try{const Et=new XMLHttpRequest;Et.open("get",wt,!0),Et.responseType="arraybuffer",Et.onload=function(){if(Et.status>=400)St(new Error(Et.statusText));else if(Et.status>0)try{const It=tt(Et.response);vt(It)}catch(It){St(It)}},Et.onerror=St,Et.send()}catch(Et){St(Et)}}xt()}function ut(wt,vt){wt||(wt=it);let xt=rt[wt];xt?xt.pending?xt.pending.push(vt):vt(xt):(rt[wt]={pending:[vt]},ct(wt,St=>{let Et=rt[wt].pending;rt[wt]=St,Et.forEach(It=>It(St))}))}function ht({text:wt="",font:vt=it,sdfGlyphSize:xt=64,fontSize:St=1,letterSpacing:Et=0,lineHeight:It="normal",maxWidth:Tt=ot,direction:$t,textAlign:Ut="left",textIndent:Lt=0,whiteSpace:Bt="normal",overflowWrap:Pt="normal",anchorX:kt=0,anchorY:At=0,includeCaretPositions:Rt=!1,chunkedBoundsSize:Wt=8192,colorRanges:jt=null},Ot,Ct=!1){const Dt=gt(),Mt={fontLoad:0,typesetting:0};wt.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),wt=wt.replace(/\r\n/g,` +}`),tt}function optionsJsonReplacer(tt,et){return tt==="uniforms"?void 0:typeof et=="function"?et.toString():et}let _idCtr=0;const optionsHashesToIds=new Map;function getKeyForOptions(tt){const et=JSON.stringify(tt,optionsJsonReplacer);let nt=optionsHashesToIds.get(et);return nt==null&&optionsHashesToIds.set(et,nt=++_idCtr),nt}function createTypesetter(tt,et,nt){const{defaultFontURL:it}=nt,rt=Object.create(null),ot=1/0,at=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,st="[^\\S\\u00A0]",lt=new RegExp(`${st}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function ct(wt,vt){function xt(){const St=Et=>{console.error(`Failure loading font ${wt}${wt===it?"":"; trying fallback"}`,Et),wt!==it&&(wt=it,xt())};try{const Et=new XMLHttpRequest;Et.open("get",wt,!0),Et.responseType="arraybuffer",Et.onload=function(){if(Et.status>=400)St(new Error(Et.statusText));else if(Et.status>0)try{const $t=tt(Et.response);vt($t)}catch($t){St($t)}},Et.onerror=St,Et.send()}catch(Et){St(Et)}}xt()}function ut(wt,vt){wt||(wt=it);let xt=rt[wt];xt?xt.pending?xt.pending.push(vt):vt(xt):(rt[wt]={pending:[vt]},ct(wt,St=>{let Et=rt[wt].pending;rt[wt]=St,Et.forEach($t=>$t(St))}))}function ht({text:wt="",font:vt=it,sdfGlyphSize:xt=64,fontSize:St=1,letterSpacing:Et=0,lineHeight:$t="normal",maxWidth:It=ot,direction:Ft,textAlign:Ht="left",textIndent:zt=0,whiteSpace:Ot="normal",overflowWrap:jt="normal",anchorX:kt=0,anchorY:Tt=0,includeCaretPositions:Ct=!1,chunkedBoundsSize:Ut=8192,colorRanges:Nt=null},Bt,Mt=!1){const Dt=gt(),Pt={fontLoad:0,typesetting:0};wt.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),wt=wt.replace(/\r\n/g,` `).replace(/\r/g,` -`)),St=+St,Et=+Et,Tt=+Tt,It=It||"normal",Lt=+Lt,ut(vt,Vt=>{const Qt=isFinite(Tt);let rn=null,Xt=null,an=null,tn=null,pn=null,vn=null,sn=null,Zt=0,Sn=0,Tn=Bt!=="nowrap";const{ascender:Cn,descender:jn,unitsPerEm:Un,lineGap:yn,capHeight:un,xHeight:En}=Vt;Mt.fontLoad=gt()-Dt;const In=gt(),xn=St/Un;It==="normal"&&(It=(Cn-jn+yn)/Un),It=It*St;const dn=(It-(Cn-jn)*xn)/2,cn=-(Cn*xn+dn),hn=Math.min(It,(Cn-jn)*xn),$n=(Cn+jn)/2*xn-hn/2;let nn=Lt,Kt=new bt;const Yt=[Kt];Vt.forEachGlyph(wt,St,Et,(Bn,Nn,qn)=>{const Wn=wt.charAt(qn),Vn=Bn.advanceWidth*xn,Fn=Kt.count;let Jn;if("isEmpty"in Bn||(Bn.isWhitespace=!!Wn&&new RegExp(st).test(Wn),Bn.canBreakAfter=!!Wn&<.test(Wn),Bn.isEmpty=Bn.xMin===Bn.xMax||Bn.yMin===Bn.yMax||at.test(Wn)),!Bn.isWhitespace&&!Bn.isEmpty&&Sn++,Tn&&Qt&&!Bn.isWhitespace&&Nn+Vn+nn>Tt&&Fn){if(Kt.glyphAt(Fn-1).glyphObj.canBreakAfter)Jn=new bt,nn=-Nn;else for(let dr=Fn;dr--;)if(dr===0&&Pt==="break-word"){Jn=new bt,nn=-Nn;break}else if(Kt.glyphAt(dr).glyphObj.canBreakAfter){Jn=Kt.splitAt(dr+1);const ur=Jn.glyphAt(0).x;nn-=ur;for(let _r=Jn.count;_r--;)Jn.glyphAt(_r).x-=ur;break}Jn&&(Kt.isSoftWrapped=!0,Kt=Jn,Yt.push(Kt),Zt=Tt)}let Hn=Kt.glyphAt(Kt.count);Hn.glyphObj=Bn,Hn.x=Nn+nn,Hn.width=Vn,Hn.charIndex=qn,Wn===` -`&&(Kt=new bt,Yt.push(Kt),nn=-(Nn+Vn+Et*St)+Lt)}),Yt.forEach(Bn=>{for(let Nn=Bn.count;Nn--;){let{glyphObj:qn,x:Wn,width:Vn}=Bn.glyphAt(Nn);if(!qn.isWhitespace){Bn.width=Wn+Vn,Bn.width>Zt&&(Zt=Bn.width);return}}});let _n=0,Mn=0;if(kt&&(typeof kt=="number"?_n=-kt:typeof kt=="string"&&(_n=-Zt*(kt==="left"?0:kt==="center"?.5:kt==="right"?1:pt(kt)))),At){if(typeof At=="number")Mn=-At;else if(typeof At=="string"){let Bn=Yt.length*It;Mn=At==="top"?0:At==="top-baseline"?-cn:At==="top-cap"?-cn-un*xn:At==="top-ex"?-cn-En*xn:At==="middle"?Bn/2:At==="bottom"?Bn:At==="bottom-baseline"?Bn-dn+jn*xn:pt(At)*Bn}}if(!Ct){const Bn=et.getEmbeddingLevels(wt,$t);rn=new Uint16Array(Sn),Xt=new Float32Array(Sn*2),an={},vn=[ot,ot,-ot,-ot],sn=[];let Nn=cn;Rt&&(pn=new Float32Array(wt.length*3)),jt&&(tn=new Uint8Array(Sn*3));let qn=0,Wn=-1,Vn=-1,Fn,Jn;if(Yt.forEach((Hn,dr)=>{let{count:ur,width:_r}=Hn;if(ur>0){let Qr=0;for(let ao=ur;ao--&&Hn.glyphAt(ao).glyphObj.isWhitespace;)Qr++;let jr=0,Mr=0;if(Ut==="center")jr=(Zt-_r)/2;else if(Ut==="right")jr=Zt-_r;else if(Ut==="justify"&&Hn.isSoftWrapped){let ao=0;for(let Gr=ur-Qr;Gr--;)Hn.glyphAt(Gr).glyphObj.isWhitespace&&ao++;Mr=(Zt-_r)/ao}if(Mr||jr){let ao=0;for(let Gr=0;Gr=Gr){let fn=Pn,Jt=Pn;for(;JtBr)break;JtUr=ao;for(let ao=0;ao1&&mt(pn,Wn,Jt),Wn=wn}if(jt){const{charIndex:wn}=Gr;for(;wn>Vn;)Vn++,jt.hasOwnProperty(Vn)&&(Jn=jt[Vn])}if(!Ur.isWhitespace&&!Ur.isEmpty){const wn=qn++;an[Br]||(an[Br]={path:Ur.path,pathBounds:[Ur.xMin,Ur.yMin,Ur.xMax,Ur.yMax]});const Pn=Gr.x+_n,fn=Nn+Mn;Xt[wn*2]=Pn,Xt[wn*2+1]=fn;const Jt=Pn+Ur.xMin*xn,kn=fn+Ur.yMin*xn,On=Pn+Ur.xMax*xn,Dn=fn+Ur.yMax*xn;Jtvn[2]&&(vn[2]=On),Dn>vn[3]&&(vn[3]=Dn),wn%Wt===0&&(Fn={start:wn,end:wn,rect:[ot,ot,-ot,-ot]},sn.push(Fn)),Fn.end++;const Kn=Fn.rect;if(JtKn[2]&&(Kn[2]=On),Dn>Kn[3]&&(Kn[3]=Dn),rn[wn]=Br,jt){const er=wn*3;tn[er]=Jn>>16&255,tn[er+1]=Jn>>8&255,tn[er+2]=Jn&255}}}}Nn-=It}),pn){const Hn=wt.length-Wn;Hn>1&&mt(pn,Wn,Hn)}}Mt.typesetting=gt()-In,Ot({glyphIds:rn,glyphPositions:Xt,glyphData:an,caretPositions:pn,caretHeight:hn,glyphColors:tn,chunkedBounds:sn,fontSize:St,unitsPerEm:Un,ascender:Cn*xn,descender:jn*xn,capHeight:un*xn,xHeight:En*xn,lineHeight:It,topBaseline:cn,blockBounds:[_n,Mn-Yt.length*It,_n+Zt,Mn],visibleBounds:vn,timings:Mt})})}function dt(wt,vt){ht(wt,xt=>{const[St,Et,It,Tt]=xt.blockBounds;vt({width:It-St,height:Tt-Et})},{metricsOnly:!0})}function pt(wt){let vt=wt.match(/^([\d.]+)%$/),xt=vt?parseFloat(vt[1]):NaN;return isNaN(xt)?0:xt/100}function mt(wt,vt,xt){const St=wt[vt*3],Et=wt[vt*3+1],It=wt[vt*3+2],Tt=(Et-St)/xt;for(let $t=0;$t(Object.defineProperty(wt,vt,{get(){return this.data[this.index*yt.length+xt]},set(Et){this.data[this.index*yt.length+xt]=Et}}),wt),{data:null,index:0}),{typeset:ht,measure:dt,loadFont:ut}}const now$2=()=>(self.performance||Date).now(),mainThreadGenerator=SDFGenerator();let warned;function generateSDF(tt,et,nt,it,rt,ot,at,st,lt,ct,ut=!0){return ut?generateSDF_GL(tt,et,nt,it,rt,ot,at,st,lt,ct).then(null,ht=>(warned||(console.warn("WebGL SDF generation failed, falling back to JS",ht),warned=!0),generateSDF_JS_Worker(tt,et,nt,it,rt,ot,at,st,lt,ct))):generateSDF_JS_Worker(tt,et,nt,it,rt,ot,at,st,lt,ct)}const queue$1=[],chunkTimeBudget=5;let timer=0;function nextChunk(){const tt=now$2();for(;queue$1.length&&now$2()-ttnew Promise((et,nt)=>{queue$1.push(()=>{const it=now$2();try{mainThreadGenerator.webgl.generateIntoCanvas(...tt),et({timing:now$2()-it})}catch(rt){nt(rt)}}),timer||(timer=setTimeout(nextChunk,0))}),threadCount=4,idleTimeout=2e3,threads={};let callNum=0;function generateSDF_JS_Worker(tt,et,nt,it,rt,ot,at,st,lt,ct){const ut="TroikaTextSDFGenerator_JS_"+callNum++%threadCount;let ht=threads[ut];return ht||(ht=threads[ut]={workerModule:defineWorkerModule({name:ut,workerId:ut,dependencies:[SDFGenerator,now$2],init(dt,pt){const mt=dt().javascript.generate;return function(...gt){const bt=pt();return{textureData:mt(...gt),timing:pt()-bt}}},getTransferables(dt){return[dt.textureData.buffer]}}),requests:0,idleTimer:null}),ht.requests++,clearTimeout(ht.idleTimer),ht.workerModule(tt,et,nt,it,rt,ot).then(({textureData:dt,timing:pt})=>{const mt=now$2(),gt=new Uint8Array(dt.length*4);for(let bt=0;bt{terminateWorker(ut)},idleTimeout)),{timing:pt}})}function warmUpSDFCanvas(tt){tt._warm||(mainThreadGenerator.webgl.isSupported(tt),tt._warm=!0)}const resizeWebGLCanvasWithoutClearing=mainThreadGenerator.webglUtils.resizeWebGLCanvasWithoutClearing;/*! +`)),St=+St,Et=+Et,It=+It,$t=$t||"normal",zt=+zt,ut(vt,Vt=>{const nn=isFinite(It);let cn=null,Xt=null,un=null,en=null,fn=null,xn=null,an=null,Zt=0,En=0,In=Ot!=="nowrap";const{ascender:Cn,descender:Nn,unitsPerEm:Un,lineGap:_n,capHeight:An,xHeight:gn}=Vt;Pt.fontLoad=gt()-Dt;const Tn=gt(),yn=St/Un;$t==="normal"&&($t=(Cn-Nn+_n)/Un),$t=$t*St;const dn=($t-(Cn-Nn)*yn)/2,sn=-(Cn*yn+dn),rn=Math.min($t,(Cn-Nn)*yn),Sn=(Cn+Nn)/2*yn-rn/2;let tn=zt,qt=new bt;const Kt=[qt];Vt.forEachGlyph(wt,St,Et,(jn,Bn,Xn)=>{const Wn=wt.charAt(Xn),Gn=jn.advanceWidth*yn,Fn=qt.count;let Jn;if("isEmpty"in jn||(jn.isWhitespace=!!Wn&&new RegExp(st).test(Wn),jn.canBreakAfter=!!Wn&<.test(Wn),jn.isEmpty=jn.xMin===jn.xMax||jn.yMin===jn.yMax||at.test(Wn)),!jn.isWhitespace&&!jn.isEmpty&&En++,In&&nn&&!jn.isWhitespace&&Bn+Gn+tn>It&&Fn){if(qt.glyphAt(Fn-1).glyphObj.canBreakAfter)Jn=new bt,tn=-Bn;else for(let dr=Fn;dr--;)if(dr===0&&jt==="break-word"){Jn=new bt,tn=-Bn;break}else if(qt.glyphAt(dr).glyphObj.canBreakAfter){Jn=qt.splitAt(dr+1);const ur=Jn.glyphAt(0).x;tn-=ur;for(let _r=Jn.count;_r--;)Jn.glyphAt(_r).x-=ur;break}Jn&&(qt.isSoftWrapped=!0,qt=Jn,Kt.push(qt),Zt=It)}let Vn=qt.glyphAt(qt.count);Vn.glyphObj=jn,Vn.x=Bn+tn,Vn.width=Gn,Vn.charIndex=Xn,Wn===` +`&&(qt=new bt,Kt.push(qt),tn=-(Bn+Gn+Et*St)+zt)}),Kt.forEach(jn=>{for(let Bn=jn.count;Bn--;){let{glyphObj:Xn,x:Wn,width:Gn}=jn.glyphAt(Bn);if(!Xn.isWhitespace){jn.width=Wn+Gn,jn.width>Zt&&(Zt=jn.width);return}}});let wn=0,Rn=0;if(kt&&(typeof kt=="number"?wn=-kt:typeof kt=="string"&&(wn=-Zt*(kt==="left"?0:kt==="center"?.5:kt==="right"?1:pt(kt)))),Tt){if(typeof Tt=="number")Rn=-Tt;else if(typeof Tt=="string"){let jn=Kt.length*$t;Rn=Tt==="top"?0:Tt==="top-baseline"?-sn:Tt==="top-cap"?-sn-An*yn:Tt==="top-ex"?-sn-gn*yn:Tt==="middle"?jn/2:Tt==="bottom"?jn:Tt==="bottom-baseline"?jn-dn+Nn*yn:pt(Tt)*jn}}if(!Mt){const jn=et.getEmbeddingLevels(wt,Ft);cn=new Uint16Array(En),Xt=new Float32Array(En*2),un={},xn=[ot,ot,-ot,-ot],an=[];let Bn=sn;Ct&&(fn=new Float32Array(wt.length*3)),Nt&&(en=new Uint8Array(En*3));let Xn=0,Wn=-1,Gn=-1,Fn,Jn;if(Kt.forEach((Vn,dr)=>{let{count:ur,width:_r}=Vn;if(ur>0){let Qr=0;for(let ao=ur;ao--&&Vn.glyphAt(ao).glyphObj.isWhitespace;)Qr++;let Or=0,Mr=0;if(Ht==="center")Or=(Zt-_r)/2;else if(Ht==="right")Or=Zt-_r;else if(Ht==="justify"&&Vn.isSoftWrapped){let ao=0;for(let Gr=ur-Qr;Gr--;)Vn.glyphAt(Gr).glyphObj.isWhitespace&&ao++;Mr=(Zt-_r)/ao}if(Mr||Or){let ao=0;for(let Gr=0;Gr=Gr){let hn=Pn,Jt=Pn;for(;JtBr)break;JtUr=ao;for(let ao=0;ao1&&mt(fn,Wn,Jt),Wn=vn}if(Nt){const{charIndex:vn}=Gr;for(;vn>Gn;)Gn++,Nt.hasOwnProperty(Gn)&&(Jn=Nt[Gn])}if(!Ur.isWhitespace&&!Ur.isEmpty){const vn=Xn++;un[Br]||(un[Br]={path:Ur.path,pathBounds:[Ur.xMin,Ur.yMin,Ur.xMax,Ur.yMax]});const Pn=Gr.x+wn,hn=Bn+Rn;Xt[vn*2]=Pn,Xt[vn*2+1]=hn;const Jt=Pn+Ur.xMin*yn,kn=hn+Ur.yMin*yn,On=Pn+Ur.xMax*yn,Dn=hn+Ur.yMax*yn;Jtxn[2]&&(xn[2]=On),Dn>xn[3]&&(xn[3]=Dn),vn%Ut===0&&(Fn={start:vn,end:vn,rect:[ot,ot,-ot,-ot]},an.push(Fn)),Fn.end++;const Yn=Fn.rect;if(JtYn[2]&&(Yn[2]=On),Dn>Yn[3]&&(Yn[3]=Dn),cn[vn]=Br,Nt){const er=vn*3;en[er]=Jn>>16&255,en[er+1]=Jn>>8&255,en[er+2]=Jn&255}}}}Bn-=$t}),fn){const Vn=wt.length-Wn;Vn>1&&mt(fn,Wn,Vn)}}Pt.typesetting=gt()-Tn,Bt({glyphIds:cn,glyphPositions:Xt,glyphData:un,caretPositions:fn,caretHeight:rn,glyphColors:en,chunkedBounds:an,fontSize:St,unitsPerEm:Un,ascender:Cn*yn,descender:Nn*yn,capHeight:An*yn,xHeight:gn*yn,lineHeight:$t,topBaseline:sn,blockBounds:[wn,Rn-Kt.length*$t,wn+Zt,Rn],visibleBounds:xn,timings:Pt})})}function dt(wt,vt){ht(wt,xt=>{const[St,Et,$t,It]=xt.blockBounds;vt({width:$t-St,height:It-Et})},{metricsOnly:!0})}function pt(wt){let vt=wt.match(/^([\d.]+)%$/),xt=vt?parseFloat(vt[1]):NaN;return isNaN(xt)?0:xt/100}function mt(wt,vt,xt){const St=wt[vt*3],Et=wt[vt*3+1],$t=wt[vt*3+2],It=(Et-St)/xt;for(let Ft=0;Ft(Object.defineProperty(wt,vt,{get(){return this.data[this.index*yt.length+xt]},set(Et){this.data[this.index*yt.length+xt]=Et}}),wt),{data:null,index:0}),{typeset:ht,measure:dt,loadFont:ut}}const now$2=()=>(self.performance||Date).now(),mainThreadGenerator=SDFGenerator();let warned;function generateSDF(tt,et,nt,it,rt,ot,at,st,lt,ct,ut=!0){return ut?generateSDF_GL(tt,et,nt,it,rt,ot,at,st,lt,ct).then(null,ht=>(warned||(console.warn("WebGL SDF generation failed, falling back to JS",ht),warned=!0),generateSDF_JS_Worker(tt,et,nt,it,rt,ot,at,st,lt,ct))):generateSDF_JS_Worker(tt,et,nt,it,rt,ot,at,st,lt,ct)}const queue$1=[],chunkTimeBudget=5;let timer=0;function nextChunk(){const tt=now$2();for(;queue$1.length&&now$2()-ttnew Promise((et,nt)=>{queue$1.push(()=>{const it=now$2();try{mainThreadGenerator.webgl.generateIntoCanvas(...tt),et({timing:now$2()-it})}catch(rt){nt(rt)}}),timer||(timer=setTimeout(nextChunk,0))}),threadCount=4,idleTimeout=2e3,threads={};let callNum=0;function generateSDF_JS_Worker(tt,et,nt,it,rt,ot,at,st,lt,ct){const ut="TroikaTextSDFGenerator_JS_"+callNum++%threadCount;let ht=threads[ut];return ht||(ht=threads[ut]={workerModule:defineWorkerModule({name:ut,workerId:ut,dependencies:[SDFGenerator,now$2],init(dt,pt){const mt=dt().javascript.generate;return function(...gt){const bt=pt();return{textureData:mt(...gt),timing:pt()-bt}}},getTransferables(dt){return[dt.textureData.buffer]}}),requests:0,idleTimer:null}),ht.requests++,clearTimeout(ht.idleTimer),ht.workerModule(tt,et,nt,it,rt,ot).then(({textureData:dt,timing:pt})=>{const mt=now$2(),gt=new Uint8Array(dt.length*4);for(let bt=0;bt{terminateWorker(ut)},idleTimeout)),{timing:pt}})}function warmUpSDFCanvas(tt){tt._warm||(mainThreadGenerator.webgl.isSupported(tt),tt._warm=!0)}const resizeWebGLCanvasWithoutClearing=mainThreadGenerator.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 typrFactory(){return typeof window>"u"&&(self.window=self),function(tt){var et={parse:function(rt){var ot=et._bin,at=new Uint8Array(rt);if(ot.readASCII(at,0,4)=="ttcf"){var st=4;ot.readUshort(at,st),st+=2,ot.readUshort(at,st),st+=2;var lt=ot.readUint(at,st);st+=4;for(var ct=[],ut=0;ut>>at&1&&ot++;return ot},et._lctf.readClassDef=function(rt,ot){var at=et._bin,st=[],lt=at.readUshort(rt,ot);if(ot+=2,lt==1){var ct=at.readUshort(rt,ot);ot+=2;var ut=at.readUshort(rt,ot);ot+=2;for(var ht=0;ht0&&(lt.featureParams=st+ct);var ut=at.readUshort(rt,ot);ot+=2,lt.tab=[];for(var ht=0;ht255?-1:et.CFF.glyphByUnicode(rt,et.CFF.tableSE[ot])},et.CFF.readEncoding=function(rt,ot,at){et._bin;var st=[".notdef"],lt=rt[ot];if(ot++,lt!=0)throw"error: unknown encoding format: "+lt;var ct=rt[ot];ot++;for(var ut=0;ut>4,wt=15&bt;if(yt!=15&>.push(yt),wt!=15&>.push(wt),wt==15)break}for(var vt="",xt=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],St=0;St=ct.xMax||ct.yMin>=ct.yMax)return null;if(ct.noc>0){ct.endPts=[];for(var ut=0;ut=1&&ut.fmt<=2){dt=lt.readUshort(rt,at),at+=2;var mt=lt.readUshort(rt,at);at+=2,pt=et._lctf.numOfOnes(dt);var gt=et._lctf.numOfOnes(mt);if(ut.fmt==1){ut.pairsets=[];var bt=lt.readUshort(rt,at);at+=2;for(var yt=0;yt=1&&ut.fmt<=2){if(ut.fmt==1)ut.delta=lt.readShort(rt,at),at+=2;else if(ut.fmt==2){var dt=lt.readUshort(rt,at);at+=2,ut.newg=lt.readUshorts(rt,at,dt),at+=2*ut.newg.length}}else if(ot==4){ut.vals=[],dt=lt.readUshort(rt,at),at+=2;for(var pt=0;pt>>8;if((mt&=15)!=0)throw"unknown kern table format: "+mt;ot=et.kern.readFormat0(rt,ot,ht)}return ht},et.kern.parseV1=function(rt,ot,at,st){var lt=et._bin;lt.readFixed(rt,ot),ot+=4;var ct=lt.readUint(rt,ot);ot+=4;for(var ut={glyph1:[],rval:[]},ht=0;ht>>8;if((pt&=15)!=0)throw"unknown kern table format: "+pt;ot=et.kern.readFormat0(rt,ot,ut)}return ut},et.kern.readFormat0=function(rt,ot,at){var st=et._bin,lt=-1,ct=st.readUshort(rt,ot);ot+=2,st.readUshort(rt,ot),ot+=2,st.readUshort(rt,ot),ot+=2,st.readUshort(rt,ot),ot+=2;for(var ut=0;ut=lt.map.length?0:lt.map[ot];if(lt.format==4){for(var ct=-1,ut=0;utot?0:65535&(lt.idRangeOffset[ct]!=0?lt.glyphIdArray[ot-lt.startCount[ct]+(lt.idRangeOffset[ct]>>1)-(lt.idRangeOffset.length-ct)]:ot+lt.idDelta[ct])}if(lt.format==12){if(ot>lt.groups[lt.groups.length-1][1])return 0;for(ut=0;ut-1?et.U._simpleGlyph(st,at):et.U._compoGlyph(st,ot,at))},et.U._simpleGlyph=function(rt,ot){for(var at=0;atlt)){for(var bt=!0,yt=0,wt=0;wtlt)){for(bt=!0,wt=0;wt>1,ct.length=0,ht=!0;else if(Bt=="o3"||Bt=="o23")ct.length%2!=0&&!ht&&(dt=ct.shift()+st.nominalWidthX),ut+=ct.length>>1,ct.length=0,ht=!0;else if(Bt=="o4")ct.length>1&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),pt&&et.U.P.closePath(lt),bt+=ct.pop(),et.U.P.moveTo(lt,gt,bt),pt=!0;else if(Bt=="o5")for(;ct.length>0;)gt+=ct.shift(),bt+=ct.shift(),et.U.P.lineTo(lt,gt,bt);else if(Bt=="o6"||Bt=="o7")for(var Pt=ct.length,kt=Bt=="o6",At=0;AtMath.abs(Tt-bt)?gt=It+ct.shift():bt=Tt+ct.shift(),et.U.P.curveTo(lt,yt,wt,vt,xt,$t,Ut),et.U.P.curveTo(lt,St,Et,It,Tt,gt,bt));else if(Bt=="o14"){if(ct.length>0&&!ht&&(dt=ct.shift()+at.nominalWidthX,ht=!0),ct.length==4){var jt=ct.shift(),Ot=ct.shift(),Ct=ct.shift(),Dt=ct.shift(),Mt=et.CFF.glyphBySE(at,Ct),Vt=et.CFF.glyphBySE(at,Dt);et.U._drawCFF(at.CharStrings[Mt],ot,at,st,lt),ot.x=jt,ot.y=Ot,et.U._drawCFF(at.CharStrings[Vt],ot,at,st,lt)}pt&&(et.U.P.closePath(lt),pt=!1)}else if(Bt=="o19"||Bt=="o20")ct.length%2!=0&&!ht&&(dt=ct.shift()+st.nominalWidthX),ut+=ct.length>>1,ct.length=0,ht=!0,mt+=ut+7>>3;else if(Bt=="o21")ct.length>2&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),bt+=ct.pop(),gt+=ct.pop(),pt&&et.U.P.closePath(lt),et.U.P.moveTo(lt,gt,bt),pt=!0;else if(Bt=="o22")ct.length>1&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),gt+=ct.pop(),pt&&et.U.P.closePath(lt),et.U.P.moveTo(lt,gt,bt),pt=!0;else if(Bt=="o25"){for(;ct.length>6;)gt+=ct.shift(),bt+=ct.shift(),et.U.P.lineTo(lt,gt,bt);yt=gt+ct.shift(),wt=bt+ct.shift(),vt=yt+ct.shift(),xt=wt+ct.shift(),gt=vt+ct.shift(),bt=xt+ct.shift(),et.U.P.curveTo(lt,yt,wt,vt,xt,gt,bt)}else if(Bt=="o26")for(ct.length%2&&(gt+=ct.shift());ct.length>0;)yt=gt,wt=bt+ct.shift(),gt=vt=yt+ct.shift(),bt=(xt=wt+ct.shift())+ct.shift(),et.U.P.curveTo(lt,yt,wt,vt,xt,gt,bt);else if(Bt=="o27")for(ct.length%2&&(bt+=ct.shift());ct.length>0;)wt=bt,vt=(yt=gt+ct.shift())+ct.shift(),xt=wt+ct.shift(),gt=vt+ct.shift(),bt=xt,et.U.P.curveTo(lt,yt,wt,vt,xt,gt,bt);else if(Bt=="o10"||Bt=="o29"){var Qt=Bt=="o10"?st:at;if(ct.length==0)console.debug("error: empty stack");else{var rn=ct.pop(),Xt=Qt.Subrs[rn+Qt.Bias];ot.x=gt,ot.y=bt,ot.nStems=ut,ot.haveWidth=ht,ot.width=dt,ot.open=pt,et.U._drawCFF(Xt,ot,at,st,lt),gt=ot.x,bt=ot.y,ut=ot.nStems,ht=ot.haveWidth,dt=ot.width,pt=ot.open}}else if(Bt=="o30"||Bt=="o31"){var an=ct.length,tn=(Wt=0,Bt=="o31");for(Wt+=an-(Pt=-3&an);Wt"u"&&(self.window=self),function(tt){var et={parse:function(rt){var ot=et._bin,at=new Uint8Array(rt);if(ot.readASCII(at,0,4)=="ttcf"){var st=4;ot.readUshort(at,st),st+=2,ot.readUshort(at,st),st+=2;var lt=ot.readUint(at,st);st+=4;for(var ct=[],ut=0;ut>>at&1&&ot++;return ot},et._lctf.readClassDef=function(rt,ot){var at=et._bin,st=[],lt=at.readUshort(rt,ot);if(ot+=2,lt==1){var ct=at.readUshort(rt,ot);ot+=2;var ut=at.readUshort(rt,ot);ot+=2;for(var ht=0;ht0&&(lt.featureParams=st+ct);var ut=at.readUshort(rt,ot);ot+=2,lt.tab=[];for(var ht=0;ht255?-1:et.CFF.glyphByUnicode(rt,et.CFF.tableSE[ot])},et.CFF.readEncoding=function(rt,ot,at){et._bin;var st=[".notdef"],lt=rt[ot];if(ot++,lt!=0)throw"error: unknown encoding format: "+lt;var ct=rt[ot];ot++;for(var ut=0;ut>4,wt=15&bt;if(yt!=15&>.push(yt),wt!=15&>.push(wt),wt==15)break}for(var vt="",xt=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],St=0;St=ct.xMax||ct.yMin>=ct.yMax)return null;if(ct.noc>0){ct.endPts=[];for(var ut=0;ut=1&&ut.fmt<=2){dt=lt.readUshort(rt,at),at+=2;var mt=lt.readUshort(rt,at);at+=2,pt=et._lctf.numOfOnes(dt);var gt=et._lctf.numOfOnes(mt);if(ut.fmt==1){ut.pairsets=[];var bt=lt.readUshort(rt,at);at+=2;for(var yt=0;yt=1&&ut.fmt<=2){if(ut.fmt==1)ut.delta=lt.readShort(rt,at),at+=2;else if(ut.fmt==2){var dt=lt.readUshort(rt,at);at+=2,ut.newg=lt.readUshorts(rt,at,dt),at+=2*ut.newg.length}}else if(ot==4){ut.vals=[],dt=lt.readUshort(rt,at),at+=2;for(var pt=0;pt>>8;if((mt&=15)!=0)throw"unknown kern table format: "+mt;ot=et.kern.readFormat0(rt,ot,ht)}return ht},et.kern.parseV1=function(rt,ot,at,st){var lt=et._bin;lt.readFixed(rt,ot),ot+=4;var ct=lt.readUint(rt,ot);ot+=4;for(var ut={glyph1:[],rval:[]},ht=0;ht>>8;if((pt&=15)!=0)throw"unknown kern table format: "+pt;ot=et.kern.readFormat0(rt,ot,ut)}return ut},et.kern.readFormat0=function(rt,ot,at){var st=et._bin,lt=-1,ct=st.readUshort(rt,ot);ot+=2,st.readUshort(rt,ot),ot+=2,st.readUshort(rt,ot),ot+=2,st.readUshort(rt,ot),ot+=2;for(var ut=0;ut=lt.map.length?0:lt.map[ot];if(lt.format==4){for(var ct=-1,ut=0;utot?0:65535&(lt.idRangeOffset[ct]!=0?lt.glyphIdArray[ot-lt.startCount[ct]+(lt.idRangeOffset[ct]>>1)-(lt.idRangeOffset.length-ct)]:ot+lt.idDelta[ct])}if(lt.format==12){if(ot>lt.groups[lt.groups.length-1][1])return 0;for(ut=0;ut-1?et.U._simpleGlyph(st,at):et.U._compoGlyph(st,ot,at))},et.U._simpleGlyph=function(rt,ot){for(var at=0;atlt)){for(var bt=!0,yt=0,wt=0;wtlt)){for(bt=!0,wt=0;wt>1,ct.length=0,ht=!0;else if(Ot=="o3"||Ot=="o23")ct.length%2!=0&&!ht&&(dt=ct.shift()+st.nominalWidthX),ut+=ct.length>>1,ct.length=0,ht=!0;else if(Ot=="o4")ct.length>1&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),pt&&et.U.P.closePath(lt),bt+=ct.pop(),et.U.P.moveTo(lt,gt,bt),pt=!0;else if(Ot=="o5")for(;ct.length>0;)gt+=ct.shift(),bt+=ct.shift(),et.U.P.lineTo(lt,gt,bt);else if(Ot=="o6"||Ot=="o7")for(var jt=ct.length,kt=Ot=="o6",Tt=0;TtMath.abs(It-bt)?gt=$t+ct.shift():bt=It+ct.shift(),et.U.P.curveTo(lt,yt,wt,vt,xt,Ft,Ht),et.U.P.curveTo(lt,St,Et,$t,It,gt,bt));else if(Ot=="o14"){if(ct.length>0&&!ht&&(dt=ct.shift()+at.nominalWidthX,ht=!0),ct.length==4){var Nt=ct.shift(),Bt=ct.shift(),Mt=ct.shift(),Dt=ct.shift(),Pt=et.CFF.glyphBySE(at,Mt),Vt=et.CFF.glyphBySE(at,Dt);et.U._drawCFF(at.CharStrings[Pt],ot,at,st,lt),ot.x=Nt,ot.y=Bt,et.U._drawCFF(at.CharStrings[Vt],ot,at,st,lt)}pt&&(et.U.P.closePath(lt),pt=!1)}else if(Ot=="o19"||Ot=="o20")ct.length%2!=0&&!ht&&(dt=ct.shift()+st.nominalWidthX),ut+=ct.length>>1,ct.length=0,ht=!0,mt+=ut+7>>3;else if(Ot=="o21")ct.length>2&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),bt+=ct.pop(),gt+=ct.pop(),pt&&et.U.P.closePath(lt),et.U.P.moveTo(lt,gt,bt),pt=!0;else if(Ot=="o22")ct.length>1&&!ht&&(dt=ct.shift()+st.nominalWidthX,ht=!0),gt+=ct.pop(),pt&&et.U.P.closePath(lt),et.U.P.moveTo(lt,gt,bt),pt=!0;else if(Ot=="o25"){for(;ct.length>6;)gt+=ct.shift(),bt+=ct.shift(),et.U.P.lineTo(lt,gt,bt);yt=gt+ct.shift(),wt=bt+ct.shift(),vt=yt+ct.shift(),xt=wt+ct.shift(),gt=vt+ct.shift(),bt=xt+ct.shift(),et.U.P.curveTo(lt,yt,wt,vt,xt,gt,bt)}else if(Ot=="o26")for(ct.length%2&&(gt+=ct.shift());ct.length>0;)yt=gt,wt=bt+ct.shift(),gt=vt=yt+ct.shift(),bt=(xt=wt+ct.shift())+ct.shift(),et.U.P.curveTo(lt,yt,wt,vt,xt,gt,bt);else if(Ot=="o27")for(ct.length%2&&(bt+=ct.shift());ct.length>0;)wt=bt,vt=(yt=gt+ct.shift())+ct.shift(),xt=wt+ct.shift(),gt=vt+ct.shift(),bt=xt,et.U.P.curveTo(lt,yt,wt,vt,xt,gt,bt);else if(Ot=="o10"||Ot=="o29"){var nn=Ot=="o10"?st:at;if(ct.length==0)console.debug("error: empty stack");else{var cn=ct.pop(),Xt=nn.Subrs[cn+nn.Bias];ot.x=gt,ot.y=bt,ot.nStems=ut,ot.haveWidth=ht,ot.width=dt,ot.open=pt,et.U._drawCFF(Xt,ot,at,st,lt),gt=ot.x,bt=ot.y,ut=ot.nStems,ht=ot.haveWidth,dt=ot.width,pt=ot.open}}else if(Ot=="o30"||Ot=="o31"){var un=ct.length,en=(Ut=0,Ot=="o31");for(Ut+=un-(jt=-3&un);Ut>>1|(21845&pt)<<1;mt=(61680&(mt=(52428&mt)>>>2|(13107&mt)<<2))>>>4|(3855&mt)<<4,dt[pt]=((65280&mt)>>>8|(255&mt)<<8)>>>1}var gt=function(Bt,Pt,kt){for(var At=Bt.length,Rt=0,Wt=new nt(Pt);Rt>>Ct]=Dt}else for(jt=new nt(At),Rt=0;Rt>>15-Bt[Rt]);return jt},bt=new et(288);for(pt=0;pt<144;++pt)bt[pt]=8;for(pt=144;pt<256;++pt)bt[pt]=9;for(pt=256;pt<280;++pt)bt[pt]=7;for(pt=280;pt<288;++pt)bt[pt]=8;var yt=new et(32);for(pt=0;pt<32;++pt)yt[pt]=5;var wt=gt(bt,9,1),vt=gt(yt,5,1),xt=function(Bt){for(var Pt=Bt[0],kt=1;ktPt&&(Pt=Bt[kt]);return Pt},St=function(Bt,Pt,kt){var At=Pt/8|0;return(Bt[At]|Bt[At+1]<<8)>>(7&Pt)&kt},Et=function(Bt,Pt){var kt=Pt/8|0;return(Bt[kt]|Bt[kt+1]<<8|Bt[kt+2]<<16)>>(7&Pt)},It=["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"],Tt=function(Bt,Pt,kt){var At=new Error(Pt||It[Bt]);if(At.code=Bt,Error.captureStackTrace&&Error.captureStackTrace(At,Tt),!kt)throw At;return At},$t=function(Bt,Pt,kt){var At=Bt.length;if(!At||kt&&!kt.l&&At<5)return Pt||new et(0);var Rt=!Pt||kt,Wt=!kt||kt.i;kt||(kt={}),Pt||(Pt=new et(3*At));var jt,Ot=function(Wn){var Vn=Pt.length;if(Wn>Vn){var Fn=new et(Math.max(2*Vn,Wn));Fn.set(Pt),Pt=Fn}},Ct=kt.f||0,Dt=kt.p||0,Mt=kt.b||0,Vt=kt.l,Qt=kt.d,rn=kt.m,Xt=kt.n,an=8*At;do{if(!Vt){kt.f=Ct=St(Bt,Dt,1);var tn=St(Bt,Dt+1,3);if(Dt+=3,!tn){var pn=Bt[(En=((jt=Dt)/8|0)+(7&jt&&1)+4)-4]|Bt[En-3]<<8,vn=En+pn;if(vn>At){Wt&&Tt(0);break}Rt&&Ot(Mt+pn),Pt.set(Bt.subarray(En,vn),Mt),kt.b=Mt+=pn,kt.p=Dt=8*vn;continue}if(tn==1)Vt=wt,Qt=vt,rn=9,Xt=5;else if(tn==2){var sn=St(Bt,Dt,31)+257,Zt=St(Bt,Dt+10,15)+4,Sn=sn+St(Bt,Dt+5,31)+1;Dt+=14;for(var Tn=new et(Sn),Cn=new et(19),jn=0;jn>>4)<16)Tn[jn++]=En;else{var xn=0,dn=0;for(En==16?(dn=3+St(Bt,Dt,3),Dt+=2,xn=Tn[jn-1]):En==17?(dn=3+St(Bt,Dt,7),Dt+=3):En==18&&(dn=11+St(Bt,Dt,127),Dt+=7);dn--;)Tn[jn++]=xn}}var cn=Tn.subarray(0,sn),hn=Tn.subarray(sn);rn=xt(cn),Xt=xt(hn),Vt=gt(cn,rn,1),Qt=gt(hn,Xt,1)}else Tt(1);if(Dt>an){Wt&&Tt(0);break}}Rt&&Ot(Mt+131072);for(var $n=(1<>>4;if((Dt+=15&xn)>an){Wt&&Tt(0);break}if(xn||Tt(2),Yt<256)Pt[Mt++]=Yt;else{if(Yt==256){Kt=Dt,Vt=null;break}var _n=Yt-254;if(Yt>264){var Mn=rt[jn=Yt-257];_n=St(Bt,Dt,(1<>>4;if(Bn||Tt(3),Dt+=15&Bn,hn=ht[Nn],Nn>3&&(Mn=ot[Nn],hn+=Et(Bt,Dt)&(1<an){Wt&&Tt(0);break}Rt&&Ot(Mt+131072);for(var qn=Mt+_n;MtWn.length)&&(Fn=Wn.length);var Jn=new(Wn instanceof nt?nt:Wn instanceof it?it:et)(Fn-Vn);return Jn.set(Wn.subarray(Vn,Fn)),Jn}(Pt,0,Mt)},Ut=new et(0),Lt=typeof TextDecoder<"u"&&new TextDecoder;try{Lt.decode(Ut,{stream:!0})}catch{}return tt.convert_streams=function(Bt){var Pt=new DataView(Bt),kt=0;function At(){var sn=Pt.getUint16(kt);return kt+=2,sn}function Rt(){var sn=Pt.getUint32(kt);return kt+=4,sn}function Wt(sn){pn.setUint16(vn,sn),vn+=2}function jt(sn){pn.setUint32(vn,sn),vn+=4}for(var Ot={signature:Rt(),flavor:Rt(),length:Rt(),numTables:At(),reserved:At(),totalSfntSize:Rt(),majorVersion:At(),minorVersion:At(),metaOffset:Rt(),metaLength:Rt(),metaOrigLength:Rt(),privOffset:Rt(),privLength:Rt()},Ct=0;Math.pow(2,Ct)<=Ot.numTables;)Ct++;Ct--;for(var Dt=16*Math.pow(2,Ct),Mt=16*Ot.numTables-Dt,Vt=12,Qt=[],rn=0;rn{let[Ut,Lt]=$t.split("+");Ut=parseInt(Ut,36),Lt=Lt?parseInt(Lt,36):0,ut.set(Tt+=Ut,Et[It]);for(let Bt=Lt;Bt--;)ut.set(++Tt,Et[It])})}}return ut.get(St)||ct}const dt=1,pt=2,mt=3,gt=4,bt=[null,"isol","init","fina","medi"];function yt(St){const Et=new Uint8Array(St.length);let It=ct,Tt=dt,$t=-1;for(let Ut=0;Ut65535&&Ut++)}return Et}function wt(St,Et){const It=[];for(let $t=0;$t65535&&$t++,It.push(tt.U.codeToGlyph(St,Ut))}const Tt=St.GSUB;if(Tt){const{lookupList:$t,featureList:Ut}=Tt;let Lt;const Bt=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,Pt=[];Ut.forEach(kt=>{if(Bt.test(kt.tag))for(let At=0;At{if(Dt!==-1){let Vt=Et[Dt];if(!Vt){const{cmds:Qt,crds:rn}=tt.U.glyphToPath(St,Dt);let Xt="",an=0;for(let Zt=0,Sn=Qt.length;Zt1?",":"")+rn[an++]}let tn,pn,vn,sn;if(rn.length){tn=pn=1/0,vn=sn=-1/0;for(let Zt=0,Sn=rn.length;Ztvn&&(vn=Tn),Cn>sn&&(sn=Cn)}}else tn=vn=pn=sn=0;Vt=Et[Dt]={index:Dt,advanceWidth:St.hmtx.aWidth[Dt],xMin:tn,yMin:pn,xMax:vn,yMax:sn,path:Xt,pathCommandCount:Qt.length}}Ct!==-1&&(Rt+=tt.U.getPairAdjustment(St,Ct,Dt)*Wt),At.call(null,Vt,Rt,Ot),Vt.advanceWidth&&(Rt+=Vt.advanceWidth*Wt),kt&&(Rt+=kt*Pt),Ct=Dt}Ot+=Bt.codePointAt(Ot)>65535?2:1}),Rt}};return Lt}return function(Et){const It=new Uint8Array(Et,0,4),Tt=tt._bin.readASCII(It,0,4);if(Tt==="wOFF")Et=et(Et);else if(Tt==="wOF2")throw new Error("woff2 fonts not supported");return xt(tt.parse(Et)[0])}}const workerModule=defineWorkerModule({name:"Typr Font Parser",dependencies:[typrFactory,woff2otfFactory,parserFactory],init(tt,et,nt){const it=tt(),rt=et();return nt(it,rt)}}),CONFIG={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},tempColor=new Color$1;function now$1$1(){return(self.performance||Date).now()}const atlases=Object.create(null);function getTextRenderInfo(tt,et){tt=assign$1({},tt);const nt=now$1$1();if(tt.font=toAbsoluteURL(tt.font||CONFIG.defaultFontURL),tt.text=""+tt.text,tt.sdfGlyphSize=tt.sdfGlyphSize||CONFIG.sdfGlyphSize,tt.colorRanges!=null){let ht={};for(let dt in tt.colorRanges)if(tt.colorRanges.hasOwnProperty(dt)){let pt=tt.colorRanges[dt];typeof pt!="number"&&(pt=tempColor.set(pt).getHex()),ht[dt]=pt}tt.colorRanges=ht}Object.freeze(tt);const{textureWidth:it,sdfExponent:rt}=CONFIG,{sdfGlyphSize:ot}=tt,at=it/ot*4;let st=atlases[ot];if(!st){const ht=document.createElement("canvas");ht.width=it,ht.height=ot*256/at,st=atlases[ot]={glyphCount:0,sdfGlyphSize:ot,sdfCanvas:ht,sdfTexture:new Texture(ht,void 0,void 0,void 0,LinearFilter,LinearFilter),contextLost:!1,glyphsByFont:new Map},st.sdfTexture.generateMipmaps=!1,initContextLossHandling(st)}const{sdfTexture:lt,sdfCanvas:ct}=st;let ut=st.glyphsByFont.get(tt.font);ut||st.glyphsByFont.set(tt.font,ut=new Map),typesetInWorker(tt).then(ht=>{const{glyphIds:dt,glyphPositions:pt,fontSize:mt,unitsPerEm:gt,timings:bt}=ht,yt=[],wt=new Float32Array(dt.length*4),vt=mt/gt;let xt=0,St=0;const Et=now$1$1();dt.forEach((Lt,Bt)=>{let Pt=ut.get(Lt);if(!Pt){const{path:Wt,pathBounds:jt}=ht.glyphData[Lt],Ot=Math.max(jt[2]-jt[0],jt[3]-jt[1])/ot*(CONFIG.sdfMargin*ot+.5),Ct=st.glyphCount++,Dt=[jt[0]-Ot,jt[1]-Ot,jt[2]+Ot,jt[3]+Ot];ut.set(Lt,Pt={path:Wt,atlasIndex:Ct,sdfViewBox:Dt}),yt.push(Pt)}const{sdfViewBox:kt}=Pt,At=pt[St++],Rt=pt[St++];wt[xt++]=At+kt[0]*vt,wt[xt++]=Rt+kt[1]*vt,wt[xt++]=At+kt[2]*vt,wt[xt++]=Rt+kt[3]*vt,dt[Bt]=Pt.atlasIndex}),bt.quads=(bt.quads||0)+(now$1$1()-Et);const It=now$1$1();bt.sdf={};const Tt=ct.height,$t=Math.ceil(st.glyphCount/at),Ut=Math.pow(2,Math.ceil(Math.log2($t*ot)));Ut>Tt&&(console.info(`Increasing SDF texture size ${Tt}->${Ut}`),resizeWebGLCanvasWithoutClearing(ct,it,Ut),lt.dispose()),Promise.all(yt.map(Lt=>generateGlyphSDF(Lt,st,tt.gpuAccelerateSDF).then(({timing:Bt})=>{bt.sdf[Lt.atlasIndex]=Bt}))).then(()=>{yt.length&&!st.contextLost&&(safariPre15Workaround(st),lt.needsUpdate=!0),bt.sdfTotal=now$1$1()-It,bt.total=now$1$1()-nt,et(Object.freeze({parameters:tt,sdfTexture:lt,sdfGlyphSize:ot,sdfExponent:rt,glyphBounds:wt,glyphAtlasIndices:dt,glyphColors:ht.glyphColors,caretPositions:ht.caretPositions,caretHeight:ht.caretHeight,chunkedBounds:ht.chunkedBounds,ascender:ht.ascender,descender:ht.descender,lineHeight:ht.lineHeight,capHeight:ht.capHeight,xHeight:ht.xHeight,topBaseline:ht.topBaseline,blockBounds:ht.blockBounds,visibleBounds:ht.visibleBounds,timings:ht.timings}))})}),Promise.resolve().then(()=>{st.contextLost||warmUpSDFCanvas(ct)})}function generateGlyphSDF({path:tt,atlasIndex:et,sdfViewBox:nt},{sdfGlyphSize:it,sdfCanvas:rt,contextLost:ot},at){if(ot)return Promise.resolve({timing:-1});const{textureWidth:st,sdfExponent:lt}=CONFIG,ct=Math.max(nt[2]-nt[0],nt[3]-nt[1]),ut=Math.floor(et/4),ht=ut%(st/it)*it,dt=Math.floor(ut/(st/it))*it,pt=et%4;return generateSDF(it,it,tt,nt,ct,lt,rt,ht,dt,pt,at)}function initContextLossHandling(tt){const et=tt.sdfCanvas;et.addEventListener("webglcontextlost",nt=>{console.log("Context Lost",nt),nt.preventDefault(),tt.contextLost=!0}),et.addEventListener("webglcontextrestored",nt=>{console.log("Context Restored",nt),tt.contextLost=!1;const it=[];tt.glyphsByFont.forEach(rt=>{rt.forEach(ot=>{it.push(generateGlyphSDF(ot,tt,!0))})}),Promise.all(it).then(()=>{safariPre15Workaround(tt),tt.sdfTexture.needsUpdate=!0})})}function preloadFont({font:tt,characters:et,sdfGlyphSize:nt},it){let rt=Array.isArray(et)?et.join(` +*/function woff2otfFactory(){return function(tt){var et=Uint8Array,nt=Uint16Array,it=Uint32Array,rt=new et([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]),ot=new et([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]),at=new et([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),st=function(Ot,jt){for(var kt=new nt(31),Tt=0;Tt<31;++Tt)kt[Tt]=jt+=1<>>1|(21845&pt)<<1;mt=(61680&(mt=(52428&mt)>>>2|(13107&mt)<<2))>>>4|(3855&mt)<<4,dt[pt]=((65280&mt)>>>8|(255&mt)<<8)>>>1}var gt=function(Ot,jt,kt){for(var Tt=Ot.length,Ct=0,Ut=new nt(jt);Ct>>Mt]=Dt}else for(Nt=new nt(Tt),Ct=0;Ct>>15-Ot[Ct]);return Nt},bt=new et(288);for(pt=0;pt<144;++pt)bt[pt]=8;for(pt=144;pt<256;++pt)bt[pt]=9;for(pt=256;pt<280;++pt)bt[pt]=7;for(pt=280;pt<288;++pt)bt[pt]=8;var yt=new et(32);for(pt=0;pt<32;++pt)yt[pt]=5;var wt=gt(bt,9,1),vt=gt(yt,5,1),xt=function(Ot){for(var jt=Ot[0],kt=1;ktjt&&(jt=Ot[kt]);return jt},St=function(Ot,jt,kt){var Tt=jt/8|0;return(Ot[Tt]|Ot[Tt+1]<<8)>>(7&jt)&kt},Et=function(Ot,jt){var kt=jt/8|0;return(Ot[kt]|Ot[kt+1]<<8|Ot[kt+2]<<16)>>(7&jt)},$t=["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"],It=function(Ot,jt,kt){var Tt=new Error(jt||$t[Ot]);if(Tt.code=Ot,Error.captureStackTrace&&Error.captureStackTrace(Tt,It),!kt)throw Tt;return Tt},Ft=function(Ot,jt,kt){var Tt=Ot.length;if(!Tt||kt&&!kt.l&&Tt<5)return jt||new et(0);var Ct=!jt||kt,Ut=!kt||kt.i;kt||(kt={}),jt||(jt=new et(3*Tt));var Nt,Bt=function(Wn){var Gn=jt.length;if(Wn>Gn){var Fn=new et(Math.max(2*Gn,Wn));Fn.set(jt),jt=Fn}},Mt=kt.f||0,Dt=kt.p||0,Pt=kt.b||0,Vt=kt.l,nn=kt.d,cn=kt.m,Xt=kt.n,un=8*Tt;do{if(!Vt){kt.f=Mt=St(Ot,Dt,1);var en=St(Ot,Dt+1,3);if(Dt+=3,!en){var fn=Ot[(gn=((Nt=Dt)/8|0)+(7&Nt&&1)+4)-4]|Ot[gn-3]<<8,xn=gn+fn;if(xn>Tt){Ut&&It(0);break}Ct&&Bt(Pt+fn),jt.set(Ot.subarray(gn,xn),Pt),kt.b=Pt+=fn,kt.p=Dt=8*xn;continue}if(en==1)Vt=wt,nn=vt,cn=9,Xt=5;else if(en==2){var an=St(Ot,Dt,31)+257,Zt=St(Ot,Dt+10,15)+4,En=an+St(Ot,Dt+5,31)+1;Dt+=14;for(var In=new et(En),Cn=new et(19),Nn=0;Nn>>4)<16)In[Nn++]=gn;else{var yn=0,dn=0;for(gn==16?(dn=3+St(Ot,Dt,3),Dt+=2,yn=In[Nn-1]):gn==17?(dn=3+St(Ot,Dt,7),Dt+=3):gn==18&&(dn=11+St(Ot,Dt,127),Dt+=7);dn--;)In[Nn++]=yn}}var sn=In.subarray(0,an),rn=In.subarray(an);cn=xt(sn),Xt=xt(rn),Vt=gt(sn,cn,1),nn=gt(rn,Xt,1)}else It(1);if(Dt>un){Ut&&It(0);break}}Ct&&Bt(Pt+131072);for(var Sn=(1<>>4;if((Dt+=15&yn)>un){Ut&&It(0);break}if(yn||It(2),Kt<256)jt[Pt++]=Kt;else{if(Kt==256){qt=Dt,Vt=null;break}var wn=Kt-254;if(Kt>264){var Rn=rt[Nn=Kt-257];wn=St(Ot,Dt,(1<>>4;if(jn||It(3),Dt+=15&jn,rn=ht[Bn],Bn>3&&(Rn=ot[Bn],rn+=Et(Ot,Dt)&(1<un){Ut&&It(0);break}Ct&&Bt(Pt+131072);for(var Xn=Pt+wn;PtWn.length)&&(Fn=Wn.length);var Jn=new(Wn instanceof nt?nt:Wn instanceof it?it:et)(Fn-Gn);return Jn.set(Wn.subarray(Gn,Fn)),Jn}(jt,0,Pt)},Ht=new et(0),zt=typeof TextDecoder<"u"&&new TextDecoder;try{zt.decode(Ht,{stream:!0})}catch{}return tt.convert_streams=function(Ot){var jt=new DataView(Ot),kt=0;function Tt(){var an=jt.getUint16(kt);return kt+=2,an}function Ct(){var an=jt.getUint32(kt);return kt+=4,an}function Ut(an){fn.setUint16(xn,an),xn+=2}function Nt(an){fn.setUint32(xn,an),xn+=4}for(var Bt={signature:Ct(),flavor:Ct(),length:Ct(),numTables:Tt(),reserved:Tt(),totalSfntSize:Ct(),majorVersion:Tt(),minorVersion:Tt(),metaOffset:Ct(),metaLength:Ct(),metaOrigLength:Ct(),privOffset:Ct(),privLength:Ct()},Mt=0;Math.pow(2,Mt)<=Bt.numTables;)Mt++;Mt--;for(var Dt=16*Math.pow(2,Mt),Pt=16*Bt.numTables-Dt,Vt=12,nn=[],cn=0;cn{let[Ht,zt]=Ft.split("+");Ht=parseInt(Ht,36),zt=zt?parseInt(zt,36):0,ut.set(It+=Ht,Et[$t]);for(let Ot=zt;Ot--;)ut.set(++It,Et[$t])})}}return ut.get(St)||ct}const dt=1,pt=2,mt=3,gt=4,bt=[null,"isol","init","fina","medi"];function yt(St){const Et=new Uint8Array(St.length);let $t=ct,It=dt,Ft=-1;for(let Ht=0;Ht65535&&Ht++)}return Et}function wt(St,Et){const $t=[];for(let Ft=0;Ft65535&&Ft++,$t.push(tt.U.codeToGlyph(St,Ht))}const It=St.GSUB;if(It){const{lookupList:Ft,featureList:Ht}=It;let zt;const Ot=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,jt=[];Ht.forEach(kt=>{if(Ot.test(kt.tag))for(let Tt=0;Tt{if(Dt!==-1){let Vt=Et[Dt];if(!Vt){const{cmds:nn,crds:cn}=tt.U.glyphToPath(St,Dt);let Xt="",un=0;for(let Zt=0,En=nn.length;Zt1?",":"")+cn[un++]}let en,fn,xn,an;if(cn.length){en=fn=1/0,xn=an=-1/0;for(let Zt=0,En=cn.length;Ztxn&&(xn=In),Cn>an&&(an=Cn)}}else en=xn=fn=an=0;Vt=Et[Dt]={index:Dt,advanceWidth:St.hmtx.aWidth[Dt],xMin:en,yMin:fn,xMax:xn,yMax:an,path:Xt,pathCommandCount:nn.length}}Mt!==-1&&(Ct+=tt.U.getPairAdjustment(St,Mt,Dt)*Ut),Tt.call(null,Vt,Ct,Bt),Vt.advanceWidth&&(Ct+=Vt.advanceWidth*Ut),kt&&(Ct+=kt*jt),Mt=Dt}Bt+=Ot.codePointAt(Bt)>65535?2:1}),Ct}};return zt}return function(Et){const $t=new Uint8Array(Et,0,4),It=tt._bin.readASCII($t,0,4);if(It==="wOFF")Et=et(Et);else if(It==="wOF2")throw new Error("woff2 fonts not supported");return xt(tt.parse(Et)[0])}}const workerModule=defineWorkerModule({name:"Typr Font Parser",dependencies:[typrFactory,woff2otfFactory,parserFactory],init(tt,et,nt){const it=tt(),rt=et();return nt(it,rt)}}),CONFIG={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},tempColor=new Color$1;function now$1$1(){return(self.performance||Date).now()}const atlases=Object.create(null);function getTextRenderInfo(tt,et){tt=assign$1({},tt);const nt=now$1$1();if(tt.font=toAbsoluteURL(tt.font||CONFIG.defaultFontURL),tt.text=""+tt.text,tt.sdfGlyphSize=tt.sdfGlyphSize||CONFIG.sdfGlyphSize,tt.colorRanges!=null){let ht={};for(let dt in tt.colorRanges)if(tt.colorRanges.hasOwnProperty(dt)){let pt=tt.colorRanges[dt];typeof pt!="number"&&(pt=tempColor.set(pt).getHex()),ht[dt]=pt}tt.colorRanges=ht}Object.freeze(tt);const{textureWidth:it,sdfExponent:rt}=CONFIG,{sdfGlyphSize:ot}=tt,at=it/ot*4;let st=atlases[ot];if(!st){const ht=document.createElement("canvas");ht.width=it,ht.height=ot*256/at,st=atlases[ot]={glyphCount:0,sdfGlyphSize:ot,sdfCanvas:ht,sdfTexture:new Texture(ht,void 0,void 0,void 0,LinearFilter,LinearFilter),contextLost:!1,glyphsByFont:new Map},st.sdfTexture.generateMipmaps=!1,initContextLossHandling(st)}const{sdfTexture:lt,sdfCanvas:ct}=st;let ut=st.glyphsByFont.get(tt.font);ut||st.glyphsByFont.set(tt.font,ut=new Map),typesetInWorker(tt).then(ht=>{const{glyphIds:dt,glyphPositions:pt,fontSize:mt,unitsPerEm:gt,timings:bt}=ht,yt=[],wt=new Float32Array(dt.length*4),vt=mt/gt;let xt=0,St=0;const Et=now$1$1();dt.forEach((zt,Ot)=>{let jt=ut.get(zt);if(!jt){const{path:Ut,pathBounds:Nt}=ht.glyphData[zt],Bt=Math.max(Nt[2]-Nt[0],Nt[3]-Nt[1])/ot*(CONFIG.sdfMargin*ot+.5),Mt=st.glyphCount++,Dt=[Nt[0]-Bt,Nt[1]-Bt,Nt[2]+Bt,Nt[3]+Bt];ut.set(zt,jt={path:Ut,atlasIndex:Mt,sdfViewBox:Dt}),yt.push(jt)}const{sdfViewBox:kt}=jt,Tt=pt[St++],Ct=pt[St++];wt[xt++]=Tt+kt[0]*vt,wt[xt++]=Ct+kt[1]*vt,wt[xt++]=Tt+kt[2]*vt,wt[xt++]=Ct+kt[3]*vt,dt[Ot]=jt.atlasIndex}),bt.quads=(bt.quads||0)+(now$1$1()-Et);const $t=now$1$1();bt.sdf={};const It=ct.height,Ft=Math.ceil(st.glyphCount/at),Ht=Math.pow(2,Math.ceil(Math.log2(Ft*ot)));Ht>It&&(console.info(`Increasing SDF texture size ${It}->${Ht}`),resizeWebGLCanvasWithoutClearing(ct,it,Ht),lt.dispose()),Promise.all(yt.map(zt=>generateGlyphSDF(zt,st,tt.gpuAccelerateSDF).then(({timing:Ot})=>{bt.sdf[zt.atlasIndex]=Ot}))).then(()=>{yt.length&&!st.contextLost&&(safariPre15Workaround(st),lt.needsUpdate=!0),bt.sdfTotal=now$1$1()-$t,bt.total=now$1$1()-nt,et(Object.freeze({parameters:tt,sdfTexture:lt,sdfGlyphSize:ot,sdfExponent:rt,glyphBounds:wt,glyphAtlasIndices:dt,glyphColors:ht.glyphColors,caretPositions:ht.caretPositions,caretHeight:ht.caretHeight,chunkedBounds:ht.chunkedBounds,ascender:ht.ascender,descender:ht.descender,lineHeight:ht.lineHeight,capHeight:ht.capHeight,xHeight:ht.xHeight,topBaseline:ht.topBaseline,blockBounds:ht.blockBounds,visibleBounds:ht.visibleBounds,timings:ht.timings}))})}),Promise.resolve().then(()=>{st.contextLost||warmUpSDFCanvas(ct)})}function generateGlyphSDF({path:tt,atlasIndex:et,sdfViewBox:nt},{sdfGlyphSize:it,sdfCanvas:rt,contextLost:ot},at){if(ot)return Promise.resolve({timing:-1});const{textureWidth:st,sdfExponent:lt}=CONFIG,ct=Math.max(nt[2]-nt[0],nt[3]-nt[1]),ut=Math.floor(et/4),ht=ut%(st/it)*it,dt=Math.floor(ut/(st/it))*it,pt=et%4;return generateSDF(it,it,tt,nt,ct,lt,rt,ht,dt,pt,at)}function initContextLossHandling(tt){const et=tt.sdfCanvas;et.addEventListener("webglcontextlost",nt=>{console.log("Context Lost",nt),nt.preventDefault(),tt.contextLost=!0}),et.addEventListener("webglcontextrestored",nt=>{console.log("Context Restored",nt),tt.contextLost=!1;const it=[];tt.glyphsByFont.forEach(rt=>{rt.forEach(ot=>{it.push(generateGlyphSDF(ot,tt,!0))})}),Promise.all(it).then(()=>{safariPre15Workaround(tt),tt.sdfTexture.needsUpdate=!0})})}function preloadFont({font:tt,characters:et,sdfGlyphSize:nt},it){let rt=Array.isArray(et)?et.join(` `):""+et;getTextRenderInfo({font:tt,sdfGlyphSize:nt,text:rt},it)}function assign$1(tt,et){for(let nt in et)et.hasOwnProperty(nt)&&(tt[nt]=et[nt]);return tt}let linkEl;function toAbsoluteURL(tt){return linkEl||(linkEl=typeof document>"u"?{}:document.createElement("a")),linkEl.href=tt,linkEl.href}function safariPre15Workaround(tt){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:et,sdfTexture:nt}=tt,{width:it,height:rt}=et,ot=tt.sdfCanvas.getContext("webgl");let at=nt.image.data;(!at||at.length!==it*rt*4)&&(at=new Uint8Array(it*rt*4),nt.image={width:it,height:rt,data:at},nt.flipY=!1,nt.isDataTexture=!0),ot.readPixels(0,0,it,rt,ot.RGBA,ot.UNSIGNED_BYTE,at)}}const typesetterWorkerModule=defineWorkerModule({name:"Typesetter",dependencies:[CONFIG,workerModule,createTypesetter,bidiFactory],init(tt,et,nt,it){const{defaultFontURL:rt}=tt;return nt(et,it(),{defaultFontURL:rt})}}),typesetInWorker=defineWorkerModule({name:"Typesetter",dependencies:[typesetterWorkerModule],init(tt){return function(et){return new Promise(nt=>{tt.typeset(et,nt)})}},getTransferables(tt){const et=[tt.glyphPositions.buffer,tt.glyphIds.buffer];return tt.caretPositions&&et.push(tt.caretPositions.buffer),tt.glyphColors&&et.push(tt.glyphColors.buffer),et}}),templateGeometries={};function getTemplateGeometry(tt){let et=templateGeometries[tt];if(!et){const nt=new PlaneGeometry(1,1,tt,tt),it=nt.clone(),rt=nt.attributes,ot=it.attributes,at=new BufferGeometry,st=rt.uv.count;for(let lt=0;lt{at.setAttribute(lt,new Float32BufferAttribute([...rt[lt].array,...ot[lt].array],rt[lt].itemSize))}),at.setIndex([...nt.index.array,...it.index.array.map(lt=>lt+st)]),at.translate(.5,.5,0),et=templateGeometries[tt]=at}return et}const glyphBoundsAttrName="aTroikaGlyphBounds",glyphIndexAttrName="aTroikaGlyphIndex",glyphColorAttrName="aTroikaGlyphColor";class GlyphsGeometry extends InstancedBufferGeometry{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 Sphere,this.boundingBox=new Box3}computeBoundingSphere(){}computeBoundingBox(){}setSide(et){const nt=this.getIndex().count;this.setDrawRange(et===BackSide?nt/2:0,et===DoubleSide?nt:nt/2)}set detail(et){if(et!==this._detail){this._detail=et,(typeof et!="number"||et<1)&&(et=1);let nt=getTemplateGeometry(et);["position","normal","uv"].forEach(it=>{this.attributes[it]=nt.attributes[it].clone()}),this.setIndex(nt.getIndex().clone())}}get detail(){return this._detail}set curveRadius(et){et!==this._curveRadius&&(this._curveRadius=et,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(et,nt,it,rt,ot){updateBufferAttr(this,glyphBoundsAttrName,et,4),updateBufferAttr(this,glyphIndexAttrName,nt,1),updateBufferAttr(this,glyphColorAttrName,ot,3),this._blockBounds=it,this._chunkedBounds=rt,this.instanceCount=nt.length,this._updateBounds()}_updateBounds(){const et=this._blockBounds;if(et){const{curveRadius:nt,boundingBox:it}=this;if(nt){const{PI:rt,floor:ot,min:at,max:st,sin:lt,cos:ct}=Math,ut=rt/2,ht=rt*2,dt=Math.abs(nt),pt=et[0]/dt,mt=et[2]/dt,gt=ot((pt+ut)/ht)!==ot((mt+ut)/ht)?-dt:at(lt(pt)*dt,lt(mt)*dt),bt=ot((pt-ut)/ht)!==ot((mt-ut)/ht)?dt:st(lt(pt)*dt,lt(mt)*dt),yt=ot((pt+rt)/ht)!==ot((mt+rt)/ht)?dt*2:st(dt-ct(pt)*dt,dt-ct(mt)*dt);it.min.set(gt,et[1],nt<0?-yt:0),it.max.set(bt,et[3],nt<0?0:yt)}else it.min.set(et[0],et[1],0),it.max.set(et[2],et[3],0);it.getBoundingSphere(this.boundingSphere)}}applyClipRect(et){let nt=this.getAttribute(glyphIndexAttrName).count,it=this._chunkedBounds;if(it)for(let rt=it.length;rt--;){nt=it[rt].end;let ot=it[rt].rect;if(ot[1]et.y&&ot[0]et.x)break}this.instanceCount=nt}}function updateBufferAttr(tt,et,nt,it){const rt=tt.getAttribute(et);nt?rt&&rt.array.length===nt.length?(rt.array.set(nt),rt.needsUpdate=!0):(tt.setAttribute(et,new InstancedBufferAttribute(nt,it)),delete tt._maxInstanceCount,tt.dispose()):rt&&tt.deleteAttribute(et)}const VERTEX_DEFS=` uniform vec2 uTroikaSDFTextureSize; uniform float uTroikaSDFGlyphSize; @@ -4549,13 +4549,13 @@ if (edgeAlpha == 0.0) { `;function createTextDerivedMaterial(tt){const et=createDerivedMaterial(tt,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Vector4(0,0,0,0)},uTroikaClipRect:{value:new Vector4(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Color$1},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:VERTEX_DEFS,vertexTransform:VERTEX_TRANSFORM,fragmentDefs:FRAGMENT_DEFS,fragmentColorTransform:FRAGMENT_TRANSFORM,customRewriter({vertexShader:nt,fragmentShader:it}){let rt=/\buniform\s+vec3\s+diffuse\b/;return rt.test(it)&&(it=it.replace(rt,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),rt.test(nt)||(nt=nt.replace(voidMainRegExp,`uniform vec3 diffuse; $& vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; -`))),{vertexShader:nt,fragmentShader:it}}});return et.transparent=!0,Object.defineProperties(et,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),et}const defaultMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,transparent:!0}),defaultStrokeColor=8421504,tempMat4=new Matrix4,tempVec3a=new Vector3,tempVec3b=new Vector3,tempArray=[],origin=new Vector3,defaultOrient="+x+y";function first(tt){return Array.isArray(tt)?tt[0]:tt}let getFlatRaycastMesh=()=>{const tt=new Mesh(new PlaneGeometry(1,1),defaultMaterial);return getFlatRaycastMesh=()=>tt,tt},getCurvedRaycastMesh=()=>{const tt=new Mesh(new PlaneGeometry(1,1,32,1),defaultMaterial);return getCurvedRaycastMesh=()=>tt,tt};const syncStartEvent={type:"syncstart"},syncCompleteEvent={type:"synccomplete"},SYNCABLE_PROPS=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],COPYABLE_PROPS=SYNCABLE_PROPS.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let Text$3=class extends Mesh{constructor(){const et=new GlyphsGeometry;super(et,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=defaultStrokeColor,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=defaultOrient,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(et){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(et):(this._isSyncing=!0,this.dispatchEvent(syncStartEvent),getTextRenderInfo({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},nt=>{this._isSyncing=!1,this._textRenderInfo=nt,this.geometry.updateGlyphs(nt.glyphBounds,nt.glyphAtlasIndices,nt.blockBounds,nt.chunkedBounds,nt.glyphColors);const it=this._queuedSyncs;it&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{it.forEach(rt=>rt&&rt())})),this.dispatchEvent(syncCompleteEvent),et&&et()})))}onBeforeRender(et,nt,it,rt,ot,at){this.sync(),ot.isTroikaTextMaterial&&this._prepareForRender(ot),ot._hadOwnSide=ot.hasOwnProperty("side"),this.geometry.setSide(ot._actualSide=ot.side),ot.side=FrontSide}onAfterRender(et,nt,it,rt,ot,at){ot._hadOwnSide?ot.side=ot._actualSide:delete ot.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let et=this._derivedMaterial;const nt=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=defaultMaterial.clone());if((!et||et.baseMaterial!==nt)&&(et=this._derivedMaterial=createTextDerivedMaterial(nt),nt.addEventListener("dispose",function it(){nt.removeEventListener("dispose",it),et.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let it=et._outlineMtl;return it||(it=et._outlineMtl=Object.create(et,{id:{value:et.id+.1}}),it.isTextOutlineMaterial=!0,it.depthWrite=!1,it.map=null,et.addEventListener("dispose",function rt(){et.removeEventListener("dispose",rt),it.dispose()})),[it,et]}else return et}set material(et){et&&et.isTroikaTextMaterial?(this._derivedMaterial=et,this._baseMaterial=et.baseMaterial):this._baseMaterial=et}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(et){this.geometry.detail=et}get curveRadius(){return this.geometry.curveRadius}set curveRadius(et){this.geometry.curveRadius=et}get customDepthMaterial(){return first(this.material).getDepthMaterial()}get customDistanceMaterial(){return first(this.material).getDistanceMaterial()}_prepareForRender(et){const nt=et.isTextOutlineMaterial,it=et.uniforms,rt=this.textRenderInfo;if(rt){const{sdfTexture:st,blockBounds:lt}=rt;it.uTroikaSDFTexture.value=st,it.uTroikaSDFTextureSize.value.set(st.image.width,st.image.height),it.uTroikaSDFGlyphSize.value=rt.sdfGlyphSize,it.uTroikaSDFExponent.value=rt.sdfExponent,it.uTroikaTotalBounds.value.fromArray(lt),it.uTroikaUseGlyphColors.value=!nt&&!!rt.glyphColors;let ct=0,ut=0,ht=0,dt,pt,mt,gt=0,bt=0;if(nt){let{outlineWidth:wt,outlineOffsetX:vt,outlineOffsetY:xt,outlineBlur:St,outlineOpacity:Et}=this;ct=this._parsePercent(wt)||0,ut=Math.max(0,this._parsePercent(St)||0),dt=Et,gt=this._parsePercent(vt)||0,bt=this._parsePercent(xt)||0}else ht=Math.max(0,this._parsePercent(this.strokeWidth)||0),ht&&(mt=this.strokeColor,it.uTroikaStrokeColor.value.set(mt??defaultStrokeColor),pt=this.strokeOpacity,pt==null&&(pt=1)),dt=this.fillOpacity;it.uTroikaDistanceOffset.value=ct,it.uTroikaPositionOffset.value.set(gt,bt),it.uTroikaBlurRadius.value=ut,it.uTroikaStrokeWidth.value=ht,it.uTroikaStrokeOpacity.value=pt,it.uTroikaFillOpacity.value=dt??1,it.uTroikaCurveRadius.value=this.curveRadius||0;let yt=this.clipRect;if(yt&&Array.isArray(yt)&&yt.length===4)it.uTroikaClipRect.value.fromArray(yt);else{const wt=(this.fontSize||.1)*100;it.uTroikaClipRect.value.set(lt[0]-wt,lt[1]-wt,lt[2]+wt,lt[3]+wt)}this.geometry.applyClipRect(it.uTroikaClipRect.value)}it.uTroikaSDFDebug.value=!!this.debugSDF,et.polygonOffset=!!this.depthOffset,et.polygonOffsetFactor=et.polygonOffsetUnits=this.depthOffset||0;const ot=nt?this.outlineColor||0:this.color;if(ot==null)delete et.color;else{const st=et.hasOwnProperty("color")?et.color:et.color=new Color$1;(ot!==st._input||typeof ot=="object")&&st.set(st._input=ot)}let at=this.orientation||defaultOrient;if(at!==et._orientation){let st=it.uTroikaOrient.value;at=at.replace(/[^-+xyz]/g,"");let lt=at!==defaultOrient&&at.match(/^([-+])([xyz])([-+])([xyz])$/);if(lt){let[,ct,ut,ht,dt]=lt;tempVec3a.set(0,0,0)[ut]=ct==="-"?1:-1,tempVec3b.set(0,0,0)[dt]=ht==="-"?-1:1,tempMat4.lookAt(origin,tempVec3a.cross(tempVec3b),tempVec3b),st.setFromMatrix4(tempMat4)}else st.identity();et._orientation=at}}_parsePercent(et){if(typeof et=="string"){let nt=et.match(/^(-?[\d.]+)%$/),it=nt?parseFloat(nt[1]):NaN;et=(isNaN(it)?0:it/100)*this.fontSize}return et}localPositionToTextCoords(et,nt=new Vector2){nt.copy(et);const it=this.curveRadius;return it&&(nt.x=Math.atan2(et.x,Math.abs(it)-Math.abs(et.z))*Math.abs(it)),nt}worldPositionToTextCoords(et,nt=new Vector2){return tempVec3a.copy(et),this.localPositionToTextCoords(this.worldToLocal(tempVec3a),nt)}raycast(et,nt){const{textRenderInfo:it,curveRadius:rt}=this;if(it){const ot=it.blockBounds,at=rt?getCurvedRaycastMesh():getFlatRaycastMesh(),st=at.geometry,{position:lt,uv:ct}=st.attributes;for(let ut=0;ut{this[it]=et[it]}),this}clone(){return new this.constructor().copy(this)}};SYNCABLE_PROPS.forEach(tt=>{const et="_private_"+tt;Object.defineProperty(Text$3.prototype,tt,{get(){return this[et]},set(nt){nt!==this[et]&&(this[et]=nt,this._needsSync=!0)}})});function shallowEqualArrays(tt,et,nt=(it,rt)=>it===rt){if(tt===et)return!0;if(!tt||!et)return!1;const it=tt.length;if(et.length!==it)return!1;for(let rt=0;rtrt.response=ot).then(()=>{it.lifespan&&it.lifespan>0&&setTimeout(()=>{const ot=globalCache.indexOf(rt);ot!==-1&&globalCache.splice(ot,1)},it.lifespan)}).catch(ot=>rt.error=ot)};if(globalCache.push(rt),!nt)throw rt.promise}const suspend=(tt,et,nt)=>query(tt,et,!1,nt),Text$2=reactExports.forwardRef(({anchorX:tt="center",anchorY:et="middle",font:nt,fontSize:it=1,children:rt,characters:ot,onSync:at,...st},lt)=>{const ct=useThree(({invalidate:pt})=>pt),[ut]=reactExports.useState(()=>new Text$3),[ht,dt]=reactExports.useMemo(()=>{const pt=[];let mt="";return reactExports.Children.forEach(rt,gt=>{typeof gt=="string"||typeof gt=="number"?mt+=gt:pt.push(gt)}),[pt,mt]},[rt]);return suspend(()=>new Promise(pt=>preloadFont({font:nt,characters:ot},pt)),["troika-text",nt,ot]),reactExports.useLayoutEffect(()=>void ut.sync(()=>{ct(),at&&at(ut)})),reactExports.useEffect(()=>()=>ut.dispose(),[ut]),reactExports.createElement("primitive",_extends$u({object:ut,ref:lt,font:nt,text:dt,anchorX:tt,anchorY:et,fontSize:it},st),ht)}),IsObject=tt=>tt===Object(tt)&&!Array.isArray(tt)&&typeof tt!="function";function useTexture(tt,et){const nt=useThree(rt=>rt.gl),it=useLoader(TextureLoader,IsObject(tt)?Object.values(tt):tt);if(reactExports.useLayoutEffect(()=>{et==null||et(it)},[et]),reactExports.useEffect(()=>{(Array.isArray(it)?it:[it]).forEach(nt.initTexture)},[nt,it]),IsObject(tt)){const rt=Object.keys(tt),ot={};return rt.forEach(at=>Object.assign(ot,{[at]:it[rt.indexOf(at)]})),ot}else return it}useTexture.preload=tt=>useLoader.preload(TextureLoader,tt);useTexture.clear=tt=>useLoader.clear(TextureLoader,tt);/*! +`))),{vertexShader:nt,fragmentShader:it}}});return et.transparent=!0,Object.defineProperties(et,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),et}const defaultMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,transparent:!0}),defaultStrokeColor=8421504,tempMat4=new Matrix4,tempVec3a=new Vector3,tempVec3b=new Vector3,tempArray=[],origin=new Vector3,defaultOrient="+x+y";function first(tt){return Array.isArray(tt)?tt[0]:tt}let getFlatRaycastMesh=()=>{const tt=new Mesh(new PlaneGeometry(1,1),defaultMaterial);return getFlatRaycastMesh=()=>tt,tt},getCurvedRaycastMesh=()=>{const tt=new Mesh(new PlaneGeometry(1,1,32,1),defaultMaterial);return getCurvedRaycastMesh=()=>tt,tt};const syncStartEvent={type:"syncstart"},syncCompleteEvent={type:"synccomplete"},SYNCABLE_PROPS=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],COPYABLE_PROPS=SYNCABLE_PROPS.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let Text$3=class extends Mesh{constructor(){const et=new GlyphsGeometry;super(et,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=defaultStrokeColor,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=defaultOrient,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(et){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(et):(this._isSyncing=!0,this.dispatchEvent(syncStartEvent),getTextRenderInfo({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},nt=>{this._isSyncing=!1,this._textRenderInfo=nt,this.geometry.updateGlyphs(nt.glyphBounds,nt.glyphAtlasIndices,nt.blockBounds,nt.chunkedBounds,nt.glyphColors);const it=this._queuedSyncs;it&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{it.forEach(rt=>rt&&rt())})),this.dispatchEvent(syncCompleteEvent),et&&et()})))}onBeforeRender(et,nt,it,rt,ot,at){this.sync(),ot.isTroikaTextMaterial&&this._prepareForRender(ot),ot._hadOwnSide=ot.hasOwnProperty("side"),this.geometry.setSide(ot._actualSide=ot.side),ot.side=FrontSide}onAfterRender(et,nt,it,rt,ot,at){ot._hadOwnSide?ot.side=ot._actualSide:delete ot.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let et=this._derivedMaterial;const nt=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=defaultMaterial.clone());if((!et||et.baseMaterial!==nt)&&(et=this._derivedMaterial=createTextDerivedMaterial(nt),nt.addEventListener("dispose",function it(){nt.removeEventListener("dispose",it),et.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let it=et._outlineMtl;return it||(it=et._outlineMtl=Object.create(et,{id:{value:et.id+.1}}),it.isTextOutlineMaterial=!0,it.depthWrite=!1,it.map=null,et.addEventListener("dispose",function rt(){et.removeEventListener("dispose",rt),it.dispose()})),[it,et]}else return et}set material(et){et&&et.isTroikaTextMaterial?(this._derivedMaterial=et,this._baseMaterial=et.baseMaterial):this._baseMaterial=et}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(et){this.geometry.detail=et}get curveRadius(){return this.geometry.curveRadius}set curveRadius(et){this.geometry.curveRadius=et}get customDepthMaterial(){return first(this.material).getDepthMaterial()}get customDistanceMaterial(){return first(this.material).getDistanceMaterial()}_prepareForRender(et){const nt=et.isTextOutlineMaterial,it=et.uniforms,rt=this.textRenderInfo;if(rt){const{sdfTexture:st,blockBounds:lt}=rt;it.uTroikaSDFTexture.value=st,it.uTroikaSDFTextureSize.value.set(st.image.width,st.image.height),it.uTroikaSDFGlyphSize.value=rt.sdfGlyphSize,it.uTroikaSDFExponent.value=rt.sdfExponent,it.uTroikaTotalBounds.value.fromArray(lt),it.uTroikaUseGlyphColors.value=!nt&&!!rt.glyphColors;let ct=0,ut=0,ht=0,dt,pt,mt,gt=0,bt=0;if(nt){let{outlineWidth:wt,outlineOffsetX:vt,outlineOffsetY:xt,outlineBlur:St,outlineOpacity:Et}=this;ct=this._parsePercent(wt)||0,ut=Math.max(0,this._parsePercent(St)||0),dt=Et,gt=this._parsePercent(vt)||0,bt=this._parsePercent(xt)||0}else ht=Math.max(0,this._parsePercent(this.strokeWidth)||0),ht&&(mt=this.strokeColor,it.uTroikaStrokeColor.value.set(mt??defaultStrokeColor),pt=this.strokeOpacity,pt==null&&(pt=1)),dt=this.fillOpacity;it.uTroikaDistanceOffset.value=ct,it.uTroikaPositionOffset.value.set(gt,bt),it.uTroikaBlurRadius.value=ut,it.uTroikaStrokeWidth.value=ht,it.uTroikaStrokeOpacity.value=pt,it.uTroikaFillOpacity.value=dt??1,it.uTroikaCurveRadius.value=this.curveRadius||0;let yt=this.clipRect;if(yt&&Array.isArray(yt)&&yt.length===4)it.uTroikaClipRect.value.fromArray(yt);else{const wt=(this.fontSize||.1)*100;it.uTroikaClipRect.value.set(lt[0]-wt,lt[1]-wt,lt[2]+wt,lt[3]+wt)}this.geometry.applyClipRect(it.uTroikaClipRect.value)}it.uTroikaSDFDebug.value=!!this.debugSDF,et.polygonOffset=!!this.depthOffset,et.polygonOffsetFactor=et.polygonOffsetUnits=this.depthOffset||0;const ot=nt?this.outlineColor||0:this.color;if(ot==null)delete et.color;else{const st=et.hasOwnProperty("color")?et.color:et.color=new Color$1;(ot!==st._input||typeof ot=="object")&&st.set(st._input=ot)}let at=this.orientation||defaultOrient;if(at!==et._orientation){let st=it.uTroikaOrient.value;at=at.replace(/[^-+xyz]/g,"");let lt=at!==defaultOrient&&at.match(/^([-+])([xyz])([-+])([xyz])$/);if(lt){let[,ct,ut,ht,dt]=lt;tempVec3a.set(0,0,0)[ut]=ct==="-"?1:-1,tempVec3b.set(0,0,0)[dt]=ht==="-"?-1:1,tempMat4.lookAt(origin,tempVec3a.cross(tempVec3b),tempVec3b),st.setFromMatrix4(tempMat4)}else st.identity();et._orientation=at}}_parsePercent(et){if(typeof et=="string"){let nt=et.match(/^(-?[\d.]+)%$/),it=nt?parseFloat(nt[1]):NaN;et=(isNaN(it)?0:it/100)*this.fontSize}return et}localPositionToTextCoords(et,nt=new Vector2){nt.copy(et);const it=this.curveRadius;return it&&(nt.x=Math.atan2(et.x,Math.abs(it)-Math.abs(et.z))*Math.abs(it)),nt}worldPositionToTextCoords(et,nt=new Vector2){return tempVec3a.copy(et),this.localPositionToTextCoords(this.worldToLocal(tempVec3a),nt)}raycast(et,nt){const{textRenderInfo:it,curveRadius:rt}=this;if(it){const ot=it.blockBounds,at=rt?getCurvedRaycastMesh():getFlatRaycastMesh(),st=at.geometry,{position:lt,uv:ct}=st.attributes;for(let ut=0;ut{this[it]=et[it]}),this}clone(){return new this.constructor().copy(this)}};SYNCABLE_PROPS.forEach(tt=>{const et="_private_"+tt;Object.defineProperty(Text$3.prototype,tt,{get(){return this[et]},set(nt){nt!==this[et]&&(this[et]=nt,this._needsSync=!0)}})});function shallowEqualArrays(tt,et,nt=(it,rt)=>it===rt){if(tt===et)return!0;if(!tt||!et)return!1;const it=tt.length;if(et.length!==it)return!1;for(let rt=0;rtrt.response=ot).then(()=>{it.lifespan&&it.lifespan>0&&setTimeout(()=>{const ot=globalCache.indexOf(rt);ot!==-1&&globalCache.splice(ot,1)},it.lifespan)}).catch(ot=>rt.error=ot)};if(globalCache.push(rt),!nt)throw rt.promise}const suspend=(tt,et,nt)=>query(tt,et,!1,nt),Text$2=reactExports.forwardRef(({anchorX:tt="center",anchorY:et="middle",font:nt,fontSize:it=1,children:rt,characters:ot,onSync:at,...st},lt)=>{const ct=useThree(({invalidate:pt})=>pt),[ut]=reactExports.useState(()=>new Text$3),[ht,dt]=reactExports.useMemo(()=>{const pt=[];let mt="";return reactExports.Children.forEach(rt,gt=>{typeof gt=="string"||typeof gt=="number"?mt+=gt:pt.push(gt)}),[pt,mt]},[rt]);return suspend(()=>new Promise(pt=>preloadFont({font:nt,characters:ot},pt)),["troika-text",nt,ot]),reactExports.useLayoutEffect(()=>void ut.sync(()=>{ct(),at&&at(ut)})),reactExports.useEffect(()=>()=>ut.dispose(),[ut]),reactExports.createElement("primitive",_extends$t({object:ut,ref:lt,font:nt,text:dt,anchorX:tt,anchorY:et,fontSize:it},st),ht)}),IsObject=tt=>tt===Object(tt)&&!Array.isArray(tt)&&typeof tt!="function";function useTexture(tt,et){const nt=useThree(rt=>rt.gl),it=useLoader(TextureLoader,IsObject(tt)?Object.values(tt):tt);if(reactExports.useLayoutEffect(()=>{et==null||et(it)},[et]),reactExports.useEffect(()=>{(Array.isArray(it)?it:[it]).forEach(nt.initTexture)},[nt,it]),IsObject(tt)){const rt=Object.keys(tt),ot={};return rt.forEach(at=>Object.assign(ot,{[at]:it[rt.indexOf(at)]})),ot}else return it}useTexture.preload=tt=>useLoader.preload(TextureLoader,tt);useTexture.clear=tt=>useLoader.clear(TextureLoader,tt);/*! * camera-controls * https://github.com/yomotsu/camera-controls * (c) 2017 @yomotsu * Released under the MIT License. - */const MOUSE_BUTTON={LEFT:1,RIGHT:2,MIDDLE:4},ACTION=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}),DOLLY_DIRECTION={NONE:0,IN:1,OUT:-1};function isPerspectiveCamera(tt){return tt.isPerspectiveCamera}function isOrthographicCamera(tt){return tt.isOrthographicCamera}const PI_2=Math.PI*2,PI_HALF=Math.PI/2,EPSILON$2=1e-5,DEG2RAD=Math.PI/180;function clamp$3(tt,et,nt){return Math.max(et,Math.min(nt,tt))}function approxZero(tt,et=EPSILON$2){return Math.abs(tt)0==pt>ut&&(pt=ut,nt.value=(pt-ut)/ot),pt}function smoothDampVec3(tt,et,nt,it,rt=1/0,ot,at){it=Math.max(1e-4,it);const st=2/it,lt=st*ot,ct=1/(1+lt+.48*lt*lt+.235*lt*lt*lt);let ut=et.x,ht=et.y,dt=et.z,pt=tt.x-ut,mt=tt.y-ht,gt=tt.z-dt;const bt=ut,yt=ht,wt=dt,vt=rt*it,xt=vt*vt,St=pt*pt+mt*mt+gt*gt;if(St>xt){const At=Math.sqrt(St);pt=pt/At*vt,mt=mt/At*vt,gt=gt/At*vt}ut=tt.x-pt,ht=tt.y-mt,dt=tt.z-gt;const Et=(nt.x+st*pt)*ot,It=(nt.y+st*mt)*ot,Tt=(nt.z+st*gt)*ot;nt.x=(nt.x-st*Et)*ct,nt.y=(nt.y-st*It)*ct,nt.z=(nt.z-st*Tt)*ct,at.x=ut+(pt+Et)*ct,at.y=ht+(mt+It)*ct,at.z=dt+(gt+Tt)*ct;const $t=bt-tt.x,Ut=yt-tt.y,Lt=wt-tt.z,Bt=at.x-bt,Pt=at.y-yt,kt=at.z-wt;return $t*Bt+Ut*Pt+Lt*kt>0&&(at.x=bt,at.y=yt,at.z=wt,nt.x=(at.x-bt)/ot,nt.y=(at.y-yt)/ot,nt.z=(at.z-wt)/ot),at}function extractClientCoordFromEvent(tt,et){et.set(0,0),tt.forEach(nt=>{et.x+=nt.clientX,et.y+=nt.clientY}),et.x/=tt.length,et.y/=tt.length}function notSupportedInOrthographicCamera(tt,et){return isOrthographicCamera(tt)?(console.warn(`${et} is not supported in OrthographicCamera`),!0):!1}class EventDispatcher{constructor(){this._listeners={}}addEventListener(et,nt){const it=this._listeners;it[et]===void 0&&(it[et]=[]),it[et].indexOf(nt)===-1&&it[et].push(nt)}hasEventListener(et,nt){const it=this._listeners;return it[et]!==void 0&&it[et].indexOf(nt)!==-1}removeEventListener(et,nt){const rt=this._listeners[et];if(rt!==void 0){const ot=rt.indexOf(nt);ot!==-1&&rt.splice(ot,1)}}removeAllEventListeners(et){if(!et){this._listeners={};return}Array.isArray(this._listeners[et])&&(this._listeners[et].length=0)}dispatchEvent(et){const it=this._listeners[et.type];if(it!==void 0){et.target=this;const rt=it.slice(0);for(let ot=0,at=rt.length;ot{},this._enabled=!0,this._state=ACTION.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=DOLLY_DIRECTION.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new THREE.Vector3,this._focalOffsetVelocity=new THREE.Vector3,this._zoomVelocity={value:0},this._truckInternal=(xt,St,Et)=>{let It,Tt;if(isPerspectiveCamera(this._camera)){const $t=_v3A.copy(this._camera.position).sub(this._target),Ut=this._camera.getEffectiveFOV()*DEG2RAD,Lt=$t.length()*Math.tan(Ut*.5);It=this.truckSpeed*xt*Lt/this._elementRect.height,Tt=this.truckSpeed*St*Lt/this._elementRect.height}else if(isOrthographicCamera(this._camera)){const $t=this._camera;It=xt*($t.right-$t.left)/$t.zoom/this._elementRect.width,Tt=St*($t.top-$t.bottom)/$t.zoom/this._elementRect.height}else return;this.verticalDragToForward?(Et?this.setFocalOffset(this._focalOffsetEnd.x+It,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(It,0,!0),this.forward(-Tt,!0)):Et?this.setFocalOffset(this._focalOffsetEnd.x+It,this._focalOffsetEnd.y+Tt,this._focalOffsetEnd.z,!0):this.truck(It,Tt,!0)},this._rotateInternal=(xt,St)=>{const Et=PI_2*this.azimuthRotateSpeed*xt/this._elementRect.height,It=PI_2*this.polarRotateSpeed*St/this._elementRect.height;this.rotate(Et,It,!0)},this._dollyInternal=(xt,St,Et)=>{const It=Math.pow(.95,-xt*this.dollySpeed),Tt=this._sphericalEnd.radius,$t=this._sphericalEnd.radius*It,Ut=clamp$3($t,this.minDistance,this.maxDistance),Lt=Ut-$t;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp($t,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(Lt,!0),this._dollyToNoClamp(Ut,!0)):this._dollyToNoClamp(Ut,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?$t:Ut)-Tt,this._dollyControlCoord.set(St,Et)),this._lastDollyDirection=Math.sign(-xt)},this._zoomInternal=(xt,St,Et)=>{const It=Math.pow(.95,xt*this.dollySpeed),Tt=this._zoom,$t=this._zoom*It;this.zoomTo($t,!0),this.dollyToCursor&&(this._changedZoom+=$t-Tt,this._dollyControlCoord.set(St,Et))},typeof THREE>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=et,this._yAxisUpSpace=new THREE.Quaternion().setFromUnitVectors(this._camera.up,_AXIS_Y),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=ACTION.NONE,this._target=new THREE.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new THREE.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new THREE.Spherical().setFromVector3(_v3A.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 THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this._updateNearPlaneCorners(),this._boundary=new THREE.Box3(new THREE.Vector3(-1/0,-1/0,-1/0),new THREE.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 THREE.Vector2,this.mouseButtons={left:ACTION.ROTATE,middle:ACTION.DOLLY,right:ACTION.TRUCK,wheel:isPerspectiveCamera(this._camera)?ACTION.DOLLY:isOrthographicCamera(this._camera)?ACTION.ZOOM:ACTION.NONE},this.touches={one:ACTION.TOUCH_ROTATE,two:isPerspectiveCamera(this._camera)?ACTION.TOUCH_DOLLY_TRUCK:isOrthographicCamera(this._camera)?ACTION.TOUCH_ZOOM_TRUCK:ACTION.NONE,three:ACTION.TOUCH_TRUCK};const it=new THREE.Vector2,rt=new THREE.Vector2,ot=new THREE.Vector2,at=xt=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const It=this._domElement.getBoundingClientRect(),Tt=xt.clientX/It.width,$t=xt.clientY/It.height;if(Ttthis._interactiveArea.right||$tthis._interactiveArea.bottom)return}const St=xt.pointerType!=="mouse"?null:(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.LEFT:(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE?MOUSE_BUTTON.MIDDLE:(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT?MOUSE_BUTTON.RIGHT:null;if(St!==null){const It=this._findPointerByMouseButton(St);It&&this._disposePointer(It)}if((xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT&&this._lockedPointer)return;const Et={pointerId:xt.pointerId,clientX:xt.clientX,clientY:xt.clientY,deltaX:0,deltaY:0,mouseButton:St};this._activePointers.push(Et),this._domElement.ownerDocument.removeEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.ownerDocument.addEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",ut),this._isDragging=!0,gt(xt)},st=xt=>{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 It=this._domElement.getBoundingClientRect(),Tt=xt.clientX/It.width,$t=xt.clientY/It.height;if(Ttthis._interactiveArea.right||$tthis._interactiveArea.bottom)return}const St=(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.LEFT:(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE?MOUSE_BUTTON.MIDDLE:(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT?MOUSE_BUTTON.RIGHT:null;if(St!==null){const It=this._findPointerByMouseButton(St);It&&this._disposePointer(It)}const Et={pointerId:1,clientX:xt.clientX,clientY:xt.clientY,deltaX:0,deltaY:0,mouseButton:(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.LEFT:(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.MIDDLE:(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.RIGHT:null};this._activePointers.push(Et),this._domElement.ownerDocument.removeEventListener("mousemove",ct),this._domElement.ownerDocument.removeEventListener("mouseup",ht),this._domElement.ownerDocument.addEventListener("mousemove",ct),this._domElement.ownerDocument.addEventListener("mouseup",ht),this._isDragging=!0,gt(xt)},lt=xt=>{xt.cancelable&&xt.preventDefault();const St=xt.pointerId,Et=this._lockedPointer||this._findPointerById(St);if(Et){if(Et.clientX=xt.clientX,Et.clientY=xt.clientY,Et.deltaX=xt.movementX,Et.deltaY=xt.movementY,this._state=0,xt.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&&(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right);bt()}},ct=xt=>{const St=this._lockedPointer||this._findPointerById(1);St&&(St.clientX=xt.clientX,St.clientY=xt.clientY,St.deltaX=xt.movementX,St.deltaY=xt.movementY,this._state=0,(this._lockedPointer||(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT)&&(this._state=this._state|this.mouseButtons.left),(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right),bt())},ut=xt=>{const St=this._findPointerById(xt.pointerId);if(!(St&&St===this._lockedPointer)){if(St&&this._disposePointer(St),xt.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=ACTION.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=ACTION.NONE;yt()}},ht=()=>{const xt=this._findPointerById(1);xt&&xt===this._lockedPointer||(xt&&this._disposePointer(xt),this._state=ACTION.NONE,yt())};let dt=-1;const pt=xt=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===ACTION.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const $t=this._domElement.getBoundingClientRect(),Ut=xt.clientX/$t.width,Lt=xt.clientY/$t.height;if(Utthis._interactiveArea.right||Ltthis._interactiveArea.bottom)return}if(xt.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===ACTION.ROTATE||this.mouseButtons.wheel===ACTION.TRUCK){const $t=performance.now();dt-$t<1e3&&this._getClientRect(this._elementRect),dt=$t}const St=isMac?-1:-3,Et=xt.deltaMode===1?xt.deltaY/St:xt.deltaY/(St*10),It=this.dollyToCursor?(xt.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,Tt=this.dollyToCursor?(xt.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case ACTION.ROTATE:{this._rotateInternal(xt.deltaX,xt.deltaY),this._isUserControllingRotate=!0;break}case ACTION.TRUCK:{this._truckInternal(xt.deltaX,xt.deltaY,!1),this._isUserControllingTruck=!0;break}case ACTION.OFFSET:{this._truckInternal(xt.deltaX,xt.deltaY,!0),this._isUserControllingOffset=!0;break}case ACTION.DOLLY:{this._dollyInternal(-Et,It,Tt),this._isUserControllingDolly=!0;break}case ACTION.ZOOM:{this._zoomInternal(-Et,It,Tt),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},mt=xt=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===x1.ACTION.NONE){const St=xt instanceof PointerEvent?xt.pointerId:(xt instanceof MouseEvent,0),Et=this._findPointerById(St);Et&&this._disposePointer(Et),this._domElement.ownerDocument.removeEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.ownerDocument.removeEventListener("mousemove",ct),this._domElement.ownerDocument.removeEventListener("mouseup",ht);return}xt.preventDefault()}},gt=xt=>{if(!this._enabled)return;if(extractClientCoordFromEvent(this._activePointers,_v2),this._getClientRect(this._elementRect),it.copy(_v2),rt.copy(_v2),this._activePointers.length>=2){const Et=_v2.x-this._activePointers[1].clientX,It=_v2.y-this._activePointers[1].clientY,Tt=Math.sqrt(Et*Et+It*It);ot.set(0,Tt);const $t=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,Ut=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;rt.set($t,Ut)}if(this._state=0,!xt)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in xt&&xt.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&&(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT&&(this._state=this._state|this.mouseButtons.left),(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&ACTION.ROTATE)===ACTION.ROTATE||(this._state&ACTION.TOUCH_ROTATE)===ACTION.TOUCH_ROTATE||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.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&ACTION.TRUCK)===ACTION.TRUCK||(this._state&ACTION.TOUCH_TRUCK)===ACTION.TOUCH_TRUCK||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&ACTION.DOLLY)===ACTION.DOLLY||(this._state&ACTION.TOUCH_DOLLY)===ACTION.TOUCH_DOLLY||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&ACTION.ZOOM)===ACTION.ZOOM||(this._state&ACTION.TOUCH_ZOOM)===ACTION.TOUCH_ZOOM||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&ACTION.OFFSET)===ACTION.OFFSET||(this._state&ACTION.TOUCH_OFFSET)===ACTION.TOUCH_OFFSET||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},bt=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,extractClientCoordFromEvent(this._activePointers,_v2);const St=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,Et=St?-St.deltaX:rt.x-_v2.x,It=St?-St.deltaY:rt.y-_v2.y;if(rt.copy(_v2),((this._state&ACTION.ROTATE)===ACTION.ROTATE||(this._state&ACTION.TOUCH_ROTATE)===ACTION.TOUCH_ROTATE||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(Et,It),this._isUserControllingRotate=!0),(this._state&ACTION.DOLLY)===ACTION.DOLLY||(this._state&ACTION.ZOOM)===ACTION.ZOOM){const Tt=this.dollyToCursor?(it.x-this._elementRect.x)/this._elementRect.width*2-1:0,$t=this.dollyToCursor?(it.y-this._elementRect.y)/this._elementRect.height*-2+1:0,Ut=this.dollyDragInverted?-1:1;(this._state&ACTION.DOLLY)===ACTION.DOLLY?(this._dollyInternal(Ut*It*TOUCH_DOLLY_FACTOR,Tt,$t),this._isUserControllingDolly=!0):(this._zoomInternal(Ut*It*TOUCH_DOLLY_FACTOR,Tt,$t),this._isUserControllingZoom=!0)}if((this._state&ACTION.TOUCH_DOLLY)===ACTION.TOUCH_DOLLY||(this._state&ACTION.TOUCH_ZOOM)===ACTION.TOUCH_ZOOM||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.TOUCH_ZOOM_ROTATE){const Tt=_v2.x-this._activePointers[1].clientX,$t=_v2.y-this._activePointers[1].clientY,Ut=Math.sqrt(Tt*Tt+$t*$t),Lt=ot.y-Ut;ot.set(0,Ut);const Bt=this.dollyToCursor?(rt.x-this._elementRect.x)/this._elementRect.width*2-1:0,Pt=this.dollyToCursor?(rt.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&ACTION.TOUCH_DOLLY)===ACTION.TOUCH_DOLLY||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET?(this._dollyInternal(Lt*TOUCH_DOLLY_FACTOR,Bt,Pt),this._isUserControllingDolly=!0):(this._zoomInternal(Lt*TOUCH_DOLLY_FACTOR,Bt,Pt),this._isUserControllingZoom=!0)}((this._state&ACTION.TRUCK)===ACTION.TRUCK||(this._state&ACTION.TOUCH_TRUCK)===ACTION.TOUCH_TRUCK||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(Et,It,!1),this._isUserControllingTruck=!0),((this._state&ACTION.OFFSET)===ACTION.OFFSET||(this._state&ACTION.TOUCH_OFFSET)===ACTION.TOUCH_OFFSET||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(Et,It,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},yt=()=>{extractClientCoordFromEvent(this._activePointers,_v2),rt.copy(_v2),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",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",ct),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.ownerDocument.removeEventListener("mouseup",ht),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",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",wt),this._domElement.ownerDocument.addEventListener("pointerlockerror",vt),this._domElement.ownerDocument.addEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",ut),gt())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",wt),this._domElement.ownerDocument.removeEventListener("pointerlockerror",vt))};const wt=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},vt=()=>{this.unlockPointer()};this._addAllEventListeners=xt=>{this._domElement=xt,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",at),isPointerEventsNotSupported&&this._domElement.addEventListener("mousedown",st),this._domElement.addEventListener("pointercancel",ut),this._domElement.addEventListener("wheel",pt,{passive:!1}),this._domElement.addEventListener("contextmenu",mt)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",at),this._domElement.removeEventListener("mousedown",st),this._domElement.removeEventListener("pointercancel",ut),this._domElement.removeEventListener("wheel",pt,{passive:!1}),this._domElement.removeEventListener("contextmenu",mt),this._domElement.ownerDocument.removeEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",ct),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.ownerDocument.removeEventListener("mouseup",ht),this._domElement.ownerDocument.removeEventListener("pointerlockchange",wt),this._domElement.ownerDocument.removeEventListener("pointerlockerror",vt))},this.cancel=()=>{this._state!==ACTION.NONE&&(this._state=ACTION.NONE,this._activePointers.length=0,yt())},nt&&this.connect(nt),this.update(0)}get camera(){return this._camera}set camera(et){this._camera=et,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(et){this._enabled=et,this._domElement&&(et?(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(et){this._spherical.radius===et&&this._sphericalEnd.radius===et||(this._spherical.radius=et,this._sphericalEnd.radius=et,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(et){this._spherical.theta===et&&this._sphericalEnd.theta===et||(this._spherical.theta=et,this._sphericalEnd.theta=et,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(et){this._spherical.phi===et&&this._sphericalEnd.phi===et||(this._spherical.phi=et,this._sphericalEnd.phi=et,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(et){this._boundaryEnclosesCamera=et,this._needsUpdate=!0}set interactiveArea(et){this._interactiveArea.width=clamp$3(et.width,0,1),this._interactiveArea.height=clamp$3(et.height,0,1),this._interactiveArea.x=clamp$3(et.x,0,1-this._interactiveArea.width),this._interactiveArea.y=clamp$3(et.y,0,1-this._interactiveArea.height)}addEventListener(et,nt){super.addEventListener(et,nt)}removeEventListener(et,nt){super.removeEventListener(et,nt)}rotate(et,nt,it=!1){return this.rotateTo(this._sphericalEnd.theta+et,this._sphericalEnd.phi+nt,it)}rotateAzimuthTo(et,nt=!1){return this.rotateTo(et,this._sphericalEnd.phi,nt)}rotatePolarTo(et,nt=!1){return this.rotateTo(this._sphericalEnd.theta,et,nt)}rotateTo(et,nt,it=!1){this._isUserControllingRotate=!1;const rt=clamp$3(et,this.minAzimuthAngle,this.maxAzimuthAngle),ot=clamp$3(nt,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=rt,this._sphericalEnd.phi=ot,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,it||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const at=!it||approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(at)}dolly(et,nt=!1){return this.dollyTo(this._sphericalEnd.radius-et,nt)}dollyTo(et,nt=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=DOLLY_DIRECTION.NONE,this._changedDolly=0,this._dollyToNoClamp(clamp$3(et,this.minDistance,this.maxDistance),nt)}_dollyToNoClamp(et,nt=!1){const it=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const at=this._collisionTest(),st=approxEquals(at,this._spherical.radius);if(!(it>et)&&st)return Promise.resolve();this._sphericalEnd.radius=Math.min(et,at)}else this._sphericalEnd.radius=et;this._needsUpdate=!0,nt||(this._spherical.radius=this._sphericalEnd.radius);const ot=!nt||approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(ot)}dollyInFixed(et,nt=!1){this._targetEnd.add(this._getCameraDirection(_cameraDirection).multiplyScalar(et)),nt||this._target.copy(this._targetEnd);const it=!nt||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(it)}zoom(et,nt=!1){return this.zoomTo(this._zoomEnd+et,nt)}zoomTo(et,nt=!1){this._isUserControllingZoom=!1,this._zoomEnd=clamp$3(et,this.minZoom,this.maxZoom),this._needsUpdate=!0,nt||(this._zoom=this._zoomEnd);const it=!nt||approxEquals(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(it)}pan(et,nt,it=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(et,nt,it)}truck(et,nt,it=!1){this._camera.updateMatrix(),_xColumn.setFromMatrixColumn(this._camera.matrix,0),_yColumn.setFromMatrixColumn(this._camera.matrix,1),_xColumn.multiplyScalar(et),_yColumn.multiplyScalar(-nt);const rt=_v3A.copy(_xColumn).add(_yColumn),ot=_v3B.copy(this._targetEnd).add(rt);return this.moveTo(ot.x,ot.y,ot.z,it)}forward(et,nt=!1){_v3A.setFromMatrixColumn(this._camera.matrix,0),_v3A.crossVectors(this._camera.up,_v3A),_v3A.multiplyScalar(et);const it=_v3B.copy(this._targetEnd).add(_v3A);return this.moveTo(it.x,it.y,it.z,nt)}elevate(et,nt=!1){return _v3A.copy(this._camera.up).multiplyScalar(et),this.moveTo(this._targetEnd.x+_v3A.x,this._targetEnd.y+_v3A.y,this._targetEnd.z+_v3A.z,nt)}moveTo(et,nt,it,rt=!1){this._isUserControllingTruck=!1;const ot=_v3A.set(et,nt,it).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,ot,this.boundaryFriction),this._needsUpdate=!0,rt||this._target.copy(this._targetEnd);const at=!rt||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(at)}lookInDirectionOf(et,nt,it,rt=!1){const st=_v3A.set(et,nt,it).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(st.x,st.y,st.z,rt)}fitToBox(et,nt,{cover:it=!1,paddingLeft:rt=0,paddingRight:ot=0,paddingBottom:at=0,paddingTop:st=0}={}){const lt=[],ct=et.isBox3?_box3A.copy(et):_box3A.setFromObject(et);ct.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const ut=roundToStep(this._sphericalEnd.theta,PI_HALF),ht=roundToStep(this._sphericalEnd.phi,PI_HALF);lt.push(this.rotateTo(ut,ht,nt));const dt=_v3A.setFromSpherical(this._sphericalEnd).normalize(),pt=_quaternionA.setFromUnitVectors(dt,_AXIS_Z),mt=approxEquals(Math.abs(dt.y),1);mt&&pt.multiply(_quaternionB.setFromAxisAngle(_AXIS_Y,ut)),pt.multiply(this._yAxisUpSpaceInverse);const gt=_box3B.makeEmpty();_v3B.copy(ct.min).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.min).setX(ct.max.x).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.min).setY(ct.max.y).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.max).setZ(ct.min.z).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.min).setZ(ct.max.z).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.max).setY(ct.min.y).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.max).setX(ct.min.x).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.max).applyQuaternion(pt),gt.expandByPoint(_v3B),gt.min.x-=rt,gt.min.y-=at,gt.max.x+=ot,gt.max.y+=st,pt.setFromUnitVectors(_AXIS_Z,dt),mt&&pt.premultiply(_quaternionB.invert()),pt.premultiply(this._yAxisUpSpace);const bt=gt.getSize(_v3A),yt=gt.getCenter(_v3B).applyQuaternion(pt);if(isPerspectiveCamera(this._camera)){const wt=this.getDistanceToFitBox(bt.x,bt.y,bt.z,it);lt.push(this.moveTo(yt.x,yt.y,yt.z,nt)),lt.push(this.dollyTo(wt,nt)),lt.push(this.setFocalOffset(0,0,0,nt))}else if(isOrthographicCamera(this._camera)){const wt=this._camera,vt=wt.right-wt.left,xt=wt.top-wt.bottom,St=it?Math.max(vt/bt.x,xt/bt.y):Math.min(vt/bt.x,xt/bt.y);lt.push(this.moveTo(yt.x,yt.y,yt.z,nt)),lt.push(this.zoomTo(St,nt)),lt.push(this.setFocalOffset(0,0,0,nt))}return Promise.all(lt)}fitToSphere(et,nt){const it=[],ot=et instanceof THREE.Sphere?_sphere.copy(et):x1.createBoundingSphere(et,_sphere);if(it.push(this.moveTo(ot.center.x,ot.center.y,ot.center.z,nt)),isPerspectiveCamera(this._camera)){const at=this.getDistanceToFitSphere(ot.radius);it.push(this.dollyTo(at,nt))}else if(isOrthographicCamera(this._camera)){const at=this._camera.right-this._camera.left,st=this._camera.top-this._camera.bottom,lt=2*ot.radius,ct=Math.min(at/lt,st/lt);it.push(this.zoomTo(ct,nt))}return it.push(this.setFocalOffset(0,0,0,nt)),Promise.all(it)}setLookAt(et,nt,it,rt,ot,at,st=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=DOLLY_DIRECTION.NONE,this._changedDolly=0;const lt=_v3B.set(rt,ot,at),ct=_v3A.set(et,nt,it);this._targetEnd.copy(lt),this._sphericalEnd.setFromVector3(ct.sub(lt).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,st||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const ut=!st||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold)&&approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(ut)}lerpLookAt(et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=DOLLY_DIRECTION.NONE,this._changedDolly=0;const gt=_v3A.set(rt,ot,at),bt=_v3B.set(et,nt,it);_sphericalA.setFromVector3(bt.sub(gt).applyQuaternion(this._yAxisUpSpace));const yt=_v3C.set(ut,ht,dt),wt=_v3B.set(st,lt,ct);_sphericalB.setFromVector3(wt.sub(yt).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(gt.lerp(yt,pt));const vt=_sphericalB.theta-_sphericalA.theta,xt=_sphericalB.phi-_sphericalA.phi,St=_sphericalB.radius-_sphericalA.radius;this._sphericalEnd.set(_sphericalA.radius+St*pt,_sphericalA.phi+xt*pt,_sphericalA.theta+vt*pt),this.normalizeRotations(),this._needsUpdate=!0,mt||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const Et=!mt||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold)&&approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(Et)}setPosition(et,nt,it,rt=!1){return this.setLookAt(et,nt,it,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,rt)}setTarget(et,nt,it,rt=!1){const ot=this.getPosition(_v3A),at=this.setLookAt(ot.x,ot.y,ot.z,et,nt,it,rt);return this._sphericalEnd.phi=clamp$3(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),at}setFocalOffset(et,nt,it,rt=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(et,nt,it),this._needsUpdate=!0,rt||this._focalOffset.copy(this._focalOffsetEnd);const ot=!rt||approxEquals(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&approxEquals(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&approxEquals(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(ot)}setOrbitPoint(et,nt,it){this._camera.updateMatrixWorld(),_xColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_yColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,1),_zColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const rt=_v3A.set(et,nt,it),ot=rt.distanceTo(this._camera.position),at=rt.sub(this._camera.position);_xColumn.multiplyScalar(at.x),_yColumn.multiplyScalar(at.y),_zColumn.multiplyScalar(at.z),_v3A.copy(_xColumn).add(_yColumn).add(_zColumn),_v3A.z=_v3A.z+ot,this.dollyTo(ot,!1),this.setFocalOffset(-_v3A.x,_v3A.y,-_v3A.z,!1),this.moveTo(et,nt,it,!1)}setBoundary(et){if(!et){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(et),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(et,nt,it,rt){if(et===null){this._viewport=null;return}this._viewport=this._viewport||new THREE.Vector4,typeof et=="number"?this._viewport.set(et,nt,it,rt):this._viewport.copy(et)}getDistanceToFitBox(et,nt,it,rt=!1){if(notSupportedInOrthographicCamera(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const ot=et/nt,at=this._camera.getEffectiveFOV()*DEG2RAD,st=this._camera.aspect;return((rt?ot>st:otnt.pointerId===et)}_findPointerByMouseButton(et){return this._activePointers.find(nt=>nt.mouseButton===et)}_disposePointer(et){this._activePointers.splice(this._activePointers.indexOf(et),1)}_encloseToBoundary(et,nt,it){const rt=nt.lengthSq();if(rt===0)return et;const ot=_v3B.copy(nt).add(et),st=this._boundary.clampPoint(ot,_v3C).sub(ot),lt=st.lengthSq();if(lt===0)return et.add(nt);if(lt===rt)return et;if(it===0)return et.add(nt).add(st);{const ct=1+it*lt/nt.dot(st);return et.add(_v3B.copy(nt).multiplyScalar(ct)).add(st.multiplyScalar(1-it))}}_updateNearPlaneCorners(){if(isPerspectiveCamera(this._camera)){const et=this._camera,nt=et.near,it=et.getEffectiveFOV()*DEG2RAD,rt=Math.tan(it*.5)*nt,ot=rt*et.aspect;this._nearPlaneCorners[0].set(-ot,-rt,0),this._nearPlaneCorners[1].set(ot,-rt,0),this._nearPlaneCorners[2].set(ot,rt,0),this._nearPlaneCorners[3].set(-ot,rt,0)}else if(isOrthographicCamera(this._camera)){const et=this._camera,nt=1/et.zoom,it=et.left*nt,rt=et.right*nt,ot=et.top*nt,at=et.bottom*nt;this._nearPlaneCorners[0].set(it,ot,0),this._nearPlaneCorners[1].set(rt,ot,0),this._nearPlaneCorners[2].set(rt,at,0),this._nearPlaneCorners[3].set(it,at,0)}}_collisionTest(){let et=1/0;if(!(this.colliderMeshes.length>=1)||notSupportedInOrthographicCamera(this._camera,"_collisionTest"))return et;const it=this._getTargetDirection(_cameraDirection);_rotationMatrix.lookAt(_ORIGIN,it,this._camera.up);for(let rt=0;rt<4;rt++){const ot=_v3B.copy(this._nearPlaneCorners[rt]);ot.applyMatrix4(_rotationMatrix);const at=_v3C.addVectors(this._target,ot);_raycaster.set(at,it),_raycaster.far=this._spherical.radius+1;const st=_raycaster.intersectObjects(this.colliderMeshes);st.length!==0&&st[0].distance{const it=()=>{this.removeEventListener("rest",it),nt()};this.addEventListener("rest",it)}))}_addAllEventListeners(et){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(et){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(et){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(et,nt=new THREE.Sphere){const it=nt,rt=it.center;_box3A.makeEmpty(),et.traverseVisible(at=>{at.isMesh&&_box3A.expandByObject(at)}),_box3A.getCenter(rt);let ot=0;return et.traverseVisible(at=>{if(!at.isMesh)return;const st=at,lt=st.geometry.clone();lt.applyMatrix4(st.matrixWorld);const ut=lt.attributes.position;for(let ht=0,dt=ut.count;ht{reactExports.useMemo(()=>{CameraControls$1.install({THREE:THREE$1}),extend$3({CameraControlsImpl:CameraControls$1})},[]);const{camera:nt,domElement:it,makeDefault:rt,onStart:ot,onEnd:at,onChange:st,regress:lt,...ct}=tt,ut=useThree(St=>St.camera),ht=useThree(St=>St.gl),dt=useThree(St=>St.invalidate),pt=useThree(St=>St.events),mt=useThree(St=>St.setEvents),gt=useThree(St=>St.set),bt=useThree(St=>St.get),yt=useThree(St=>St.performance),wt=nt||ut,vt=it||pt.connected||ht.domElement,xt=reactExports.useMemo(()=>new CameraControls$1(wt),[wt]);return useFrame((St,Et)=>{xt.enabled&&xt.update(Et)},-1),reactExports.useEffect(()=>(xt.connect(vt),()=>void xt.disconnect()),[vt,xt]),reactExports.useEffect(()=>{const St=Tt=>{dt(),lt&&yt.regress(),st&&st(Tt)},Et=Tt=>{ot&&ot(Tt)},It=Tt=>{at&&at(Tt)};return xt.addEventListener("update",St),xt.addEventListener("controlstart",Et),xt.addEventListener("controlend",It),()=>{xt.removeEventListener("update",St),xt.removeEventListener("controlstart",Et),xt.removeEventListener("controlend",It)}},[xt,ot,at,dt,mt,lt,st]),reactExports.useEffect(()=>{if(rt){const St=bt().controls;return gt({controls:xt}),()=>gt({controls:St})}},[rt,xt]),reactExports.createElement("primitive",_extends$u({ref:et,object:xt},ct))});PropTypes.func.isRequired,PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.element,PropTypes.func])).isRequired;const _instanceLocalMatrix=new Matrix4,_instanceWorldMatrix=new Matrix4,_instanceIntersects=[],_mesh=new Mesh;class PositionMesh extends Group{constructor(){super(),this.color=new Color$1("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var et;return(et=this.instance.current)==null?void 0:et.geometry}raycast(et,nt){const it=this.instance.current;if(!it||!it.geometry||!it.material)return;_mesh.geometry=it.geometry;const rt=it.matrixWorld,ot=it.userData.instances.indexOf(this.instanceKey);if(!(ot===-1||ot>it.count)){it.getMatrixAt(ot,_instanceLocalMatrix),_instanceWorldMatrix.multiplyMatrices(rt,_instanceLocalMatrix),_mesh.matrixWorld=_instanceWorldMatrix,it.material instanceof Material?_mesh.material.side=it.material.side:_mesh.material.side=it.material[0].side,_mesh.raycast(et,_instanceIntersects);for(let at=0,st=_instanceIntersects.length;at{reactExports.useMemo(()=>extend$3({PositionMesh}),[]);const rt=reactExports.useRef(),{subscribe:ot,getParent:at}=reactExports.useContext(tt||globalContext$1);return reactExports.useLayoutEffect(()=>ot(rt),[]),reactExports.createElement("positionMesh",_extends$u({instance:at(),instanceKey:rt,ref:mergeRefs([it,rt])},nt),et)}),Instances=reactExports.forwardRef(({children:tt,range:et,limit:nt=1e3,frames:it=1/0,...rt},ot)=>{const[{context:at,instance:st}]=reactExports.useState(()=>{const bt=reactExports.createContext(null);return{context:bt,instance:reactExports.forwardRef((yt,wt)=>reactExports.createElement(Instance,_extends$u({context:bt},yt,{ref:wt})))}}),lt=reactExports.useRef(null),[ct,ut]=reactExports.useState([]),[[ht,dt]]=reactExports.useState(()=>{const bt=new Float32Array(nt*16);for(let yt=0;yt1))]});reactExports.useEffect(()=>{lt.current.instanceMatrix.needsUpdate=!0});let pt=0,mt=0;useFrame(()=>{if(it===1/0||pt({getParent:()=>lt,subscribe:bt=>(ut(yt=>[...yt,bt]),()=>ut(yt=>yt.filter(wt=>wt.current!==bt.current)))}),[]);return reactExports.createElement("instancedMesh",_extends$u({userData:{instances:ct},matrixAutoUpdate:!1,ref:mergeRefs([ot,lt]),args:[null,null,0],raycast:()=>null},rt),reactExports.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:ht.length/16,array:ht,itemSize:16,usage:DynamicDrawUsage}),reactExports.createElement("instancedBufferAttribute",{attach:"instanceColor",count:dt.length/3,array:dt,itemSize:3,usage:DynamicDrawUsage}),typeof tt=="function"?reactExports.createElement(at.Provider,{value:gt},tt(st)):reactExports.createElement(globalContext$1.Provider,{value:gt},tt))}),context=reactExports.createContext(null),Segments=reactExports.forwardRef((tt,et)=>{reactExports.useMemo(()=>extend$3({SegmentObject}),[]);const{limit:nt=1e3,lineWidth:it=1,children:rt,...ot}=tt,[at,st]=reactExports.useState([]),[lt]=reactExports.useState(()=>new Line2),[ct]=reactExports.useState(()=>new LineMaterial),[ut]=reactExports.useState(()=>new LineSegmentsGeometry),[ht]=reactExports.useState(()=>new Vector2(512,512)),[dt]=reactExports.useState(()=>Array(nt*6).fill(0)),[pt]=reactExports.useState(()=>Array(nt*6).fill(0)),mt=reactExports.useMemo(()=>({subscribe:gt=>(st(bt=>[...bt,gt]),()=>st(bt=>bt.filter(yt=>yt.current!==gt.current)))}),[]);return useFrame(()=>{for(let bt=0;bttt instanceof Vector3?tt:new Vector3(...typeof tt=="number"?[tt,tt,tt]:tt),Segment$1=reactExports.forwardRef(({color:tt,start:et,end:nt},it)=>{const rt=reactExports.useContext(context);if(!rt)throw"Segment must used inside Segments component.";const ot=reactExports.useRef(null);return reactExports.useLayoutEffect(()=>rt.subscribe(ot),[]),reactExports.createElement("segmentObject",{ref:mergeRefs([ot,it]),color:tt,start:normPos(et),end:normPos(nt)})});function Preload({all:tt,scene:et,camera:nt}){const it=useThree(({gl:at})=>at),rt=useThree(({camera:at})=>at),ot=useThree(({scene:at})=>at);return reactExports.useLayoutEffect(()=>{const at=[];tt&&(et||ot).traverse(ct=>{ct.visible===!1&&(at.push(ct),ct.visible=!0)}),it.compile(et||ot,nt||rt);const st=new WebGLCubeRenderTarget(128);new CubeCamera(.01,1e5,st).update(it,et||ot),st.dispose(),at.forEach(ct=>ct.visible=!1)},[]),null}function AdaptiveDpr({pixelated:tt}){const et=useThree(at=>at.gl),nt=useThree(at=>at.internal.active),it=useThree(at=>at.performance.current),rt=useThree(at=>at.viewport.initialDpr),ot=useThree(at=>at.setDpr);return reactExports.useEffect(()=>{const at=et.domElement;return()=>{nt&&ot(rt),tt&&at&&(at.style.imageRendering="auto")}},[]),reactExports.useEffect(()=>{ot(it*rt),tt&&et.domElement&&(et.domElement.style.imageRendering=it===1?"auto":"pixelated")},[it]),null}function AdaptiveEvents(){const tt=useThree(it=>it.get),et=useThree(it=>it.setEvents),nt=useThree(it=>it.performance.current);return reactExports.useEffect(()=>{const it=tt().events.enabled;return()=>et({enabled:it})},[]),reactExports.useEffect(()=>et({enabled:nt===1}),[nt]),null}const selectionContext=reactExports.createContext(null);function Selection$3({children:tt,enabled:et=!0}){const[nt,it]=reactExports.useState([]),rt=reactExports.useMemo(()=>({selected:nt,select:it,enabled:et}),[nt,it,et]);return jsxRuntimeExports.jsx(selectionContext.Provider,{value:rt,children:tt})}function Select({enabled:tt=!1,children:et,...nt}){const it=reactExports.useRef(null),rt=reactExports.useContext(selectionContext);return reactExports.useEffect(()=>{if(rt&&tt){let ot=!1;const at=[];if(it.current.traverse(st=>{st.type==="Mesh"&&at.push(st),rt.selected.indexOf(st)===-1&&(ot=!0)}),ot)return rt.select(st=>[...st,...at]),()=>{rt.select(st=>st.filter(lt=>!at.includes(lt)))}}},[tt,et,rt]),jsxRuntimeExports.jsx("group",{ref:it,...nt,children:et})}/** - * postprocessing v6.33.3 build Mon Oct 30 2023 + */const MOUSE_BUTTON={LEFT:1,RIGHT:2,MIDDLE:4},ACTION=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}),DOLLY_DIRECTION={NONE:0,IN:1,OUT:-1};function isPerspectiveCamera(tt){return tt.isPerspectiveCamera}function isOrthographicCamera(tt){return tt.isOrthographicCamera}const PI_2=Math.PI*2,PI_HALF=Math.PI/2,EPSILON$2=1e-5,DEG2RAD=Math.PI/180;function clamp$3(tt,et,nt){return Math.max(et,Math.min(nt,tt))}function approxZero(tt,et=EPSILON$2){return Math.abs(tt)0==pt>ut&&(pt=ut,nt.value=(pt-ut)/ot),pt}function smoothDampVec3(tt,et,nt,it,rt=1/0,ot,at){it=Math.max(1e-4,it);const st=2/it,lt=st*ot,ct=1/(1+lt+.48*lt*lt+.235*lt*lt*lt);let ut=et.x,ht=et.y,dt=et.z,pt=tt.x-ut,mt=tt.y-ht,gt=tt.z-dt;const bt=ut,yt=ht,wt=dt,vt=rt*it,xt=vt*vt,St=pt*pt+mt*mt+gt*gt;if(St>xt){const Tt=Math.sqrt(St);pt=pt/Tt*vt,mt=mt/Tt*vt,gt=gt/Tt*vt}ut=tt.x-pt,ht=tt.y-mt,dt=tt.z-gt;const Et=(nt.x+st*pt)*ot,$t=(nt.y+st*mt)*ot,It=(nt.z+st*gt)*ot;nt.x=(nt.x-st*Et)*ct,nt.y=(nt.y-st*$t)*ct,nt.z=(nt.z-st*It)*ct,at.x=ut+(pt+Et)*ct,at.y=ht+(mt+$t)*ct,at.z=dt+(gt+It)*ct;const Ft=bt-tt.x,Ht=yt-tt.y,zt=wt-tt.z,Ot=at.x-bt,jt=at.y-yt,kt=at.z-wt;return Ft*Ot+Ht*jt+zt*kt>0&&(at.x=bt,at.y=yt,at.z=wt,nt.x=(at.x-bt)/ot,nt.y=(at.y-yt)/ot,nt.z=(at.z-wt)/ot),at}function extractClientCoordFromEvent(tt,et){et.set(0,0),tt.forEach(nt=>{et.x+=nt.clientX,et.y+=nt.clientY}),et.x/=tt.length,et.y/=tt.length}function notSupportedInOrthographicCamera(tt,et){return isOrthographicCamera(tt)?(console.warn(`${et} is not supported in OrthographicCamera`),!0):!1}class EventDispatcher{constructor(){this._listeners={}}addEventListener(et,nt){const it=this._listeners;it[et]===void 0&&(it[et]=[]),it[et].indexOf(nt)===-1&&it[et].push(nt)}hasEventListener(et,nt){const it=this._listeners;return it[et]!==void 0&&it[et].indexOf(nt)!==-1}removeEventListener(et,nt){const rt=this._listeners[et];if(rt!==void 0){const ot=rt.indexOf(nt);ot!==-1&&rt.splice(ot,1)}}removeAllEventListeners(et){if(!et){this._listeners={};return}Array.isArray(this._listeners[et])&&(this._listeners[et].length=0)}dispatchEvent(et){const it=this._listeners[et.type];if(it!==void 0){et.target=this;const rt=it.slice(0);for(let ot=0,at=rt.length;ot{},this._enabled=!0,this._state=ACTION.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=DOLLY_DIRECTION.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new THREE.Vector3,this._focalOffsetVelocity=new THREE.Vector3,this._zoomVelocity={value:0},this._truckInternal=(xt,St,Et)=>{let $t,It;if(isPerspectiveCamera(this._camera)){const Ft=_v3A.copy(this._camera.position).sub(this._target),Ht=this._camera.getEffectiveFOV()*DEG2RAD,zt=Ft.length()*Math.tan(Ht*.5);$t=this.truckSpeed*xt*zt/this._elementRect.height,It=this.truckSpeed*St*zt/this._elementRect.height}else if(isOrthographicCamera(this._camera)){const Ft=this._camera;$t=xt*(Ft.right-Ft.left)/Ft.zoom/this._elementRect.width,It=St*(Ft.top-Ft.bottom)/Ft.zoom/this._elementRect.height}else return;this.verticalDragToForward?(Et?this.setFocalOffset(this._focalOffsetEnd.x+$t,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck($t,0,!0),this.forward(-It,!0)):Et?this.setFocalOffset(this._focalOffsetEnd.x+$t,this._focalOffsetEnd.y+It,this._focalOffsetEnd.z,!0):this.truck($t,It,!0)},this._rotateInternal=(xt,St)=>{const Et=PI_2*this.azimuthRotateSpeed*xt/this._elementRect.height,$t=PI_2*this.polarRotateSpeed*St/this._elementRect.height;this.rotate(Et,$t,!0)},this._dollyInternal=(xt,St,Et)=>{const $t=Math.pow(.95,-xt*this.dollySpeed),It=this._sphericalEnd.radius,Ft=this._sphericalEnd.radius*$t,Ht=clamp$3(Ft,this.minDistance,this.maxDistance),zt=Ht-Ft;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(Ft,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(zt,!0),this._dollyToNoClamp(Ht,!0)):this._dollyToNoClamp(Ht,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?Ft:Ht)-It,this._dollyControlCoord.set(St,Et)),this._lastDollyDirection=Math.sign(-xt)},this._zoomInternal=(xt,St,Et)=>{const $t=Math.pow(.95,xt*this.dollySpeed),It=this._zoom,Ft=this._zoom*$t;this.zoomTo(Ft,!0),this.dollyToCursor&&(this._changedZoom+=Ft-It,this._dollyControlCoord.set(St,Et))},typeof THREE>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=et,this._yAxisUpSpace=new THREE.Quaternion().setFromUnitVectors(this._camera.up,_AXIS_Y),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=ACTION.NONE,this._target=new THREE.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new THREE.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new THREE.Spherical().setFromVector3(_v3A.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 THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this._updateNearPlaneCorners(),this._boundary=new THREE.Box3(new THREE.Vector3(-1/0,-1/0,-1/0),new THREE.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 THREE.Vector2,this.mouseButtons={left:ACTION.ROTATE,middle:ACTION.DOLLY,right:ACTION.TRUCK,wheel:isPerspectiveCamera(this._camera)?ACTION.DOLLY:isOrthographicCamera(this._camera)?ACTION.ZOOM:ACTION.NONE},this.touches={one:ACTION.TOUCH_ROTATE,two:isPerspectiveCamera(this._camera)?ACTION.TOUCH_DOLLY_TRUCK:isOrthographicCamera(this._camera)?ACTION.TOUCH_ZOOM_TRUCK:ACTION.NONE,three:ACTION.TOUCH_TRUCK};const it=new THREE.Vector2,rt=new THREE.Vector2,ot=new THREE.Vector2,at=xt=>{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(),It=xt.clientX/$t.width,Ft=xt.clientY/$t.height;if(Itthis._interactiveArea.right||Ftthis._interactiveArea.bottom)return}const St=xt.pointerType!=="mouse"?null:(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.LEFT:(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE?MOUSE_BUTTON.MIDDLE:(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT?MOUSE_BUTTON.RIGHT:null;if(St!==null){const $t=this._findPointerByMouseButton(St);$t&&this._disposePointer($t)}if((xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT&&this._lockedPointer)return;const Et={pointerId:xt.pointerId,clientX:xt.clientX,clientY:xt.clientY,deltaX:0,deltaY:0,mouseButton:St};this._activePointers.push(Et),this._domElement.ownerDocument.removeEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.ownerDocument.addEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",ut),this._isDragging=!0,gt(xt)},st=xt=>{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(),It=xt.clientX/$t.width,Ft=xt.clientY/$t.height;if(Itthis._interactiveArea.right||Ftthis._interactiveArea.bottom)return}const St=(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.LEFT:(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE?MOUSE_BUTTON.MIDDLE:(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT?MOUSE_BUTTON.RIGHT:null;if(St!==null){const $t=this._findPointerByMouseButton(St);$t&&this._disposePointer($t)}const Et={pointerId:1,clientX:xt.clientX,clientY:xt.clientY,deltaX:0,deltaY:0,mouseButton:(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.LEFT:(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.MIDDLE:(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.LEFT?MOUSE_BUTTON.RIGHT:null};this._activePointers.push(Et),this._domElement.ownerDocument.removeEventListener("mousemove",ct),this._domElement.ownerDocument.removeEventListener("mouseup",ht),this._domElement.ownerDocument.addEventListener("mousemove",ct),this._domElement.ownerDocument.addEventListener("mouseup",ht),this._isDragging=!0,gt(xt)},lt=xt=>{xt.cancelable&&xt.preventDefault();const St=xt.pointerId,Et=this._lockedPointer||this._findPointerById(St);if(Et){if(Et.clientX=xt.clientX,Et.clientY=xt.clientY,Et.deltaX=xt.movementX,Et.deltaY=xt.movementY,this._state=0,xt.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&&(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right);bt()}},ct=xt=>{const St=this._lockedPointer||this._findPointerById(1);St&&(St.clientX=xt.clientX,St.clientY=xt.clientY,St.deltaX=xt.movementX,St.deltaY=xt.movementY,this._state=0,(this._lockedPointer||(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT)&&(this._state=this._state|this.mouseButtons.left),(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right),bt())},ut=xt=>{const St=this._findPointerById(xt.pointerId);if(!(St&&St===this._lockedPointer)){if(St&&this._disposePointer(St),xt.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=ACTION.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=ACTION.NONE;yt()}},ht=()=>{const xt=this._findPointerById(1);xt&&xt===this._lockedPointer||(xt&&this._disposePointer(xt),this._state=ACTION.NONE,yt())};let dt=-1;const pt=xt=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===ACTION.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const Ft=this._domElement.getBoundingClientRect(),Ht=xt.clientX/Ft.width,zt=xt.clientY/Ft.height;if(Htthis._interactiveArea.right||ztthis._interactiveArea.bottom)return}if(xt.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===ACTION.ROTATE||this.mouseButtons.wheel===ACTION.TRUCK){const Ft=performance.now();dt-Ft<1e3&&this._getClientRect(this._elementRect),dt=Ft}const St=isMac?-1:-3,Et=xt.deltaMode===1?xt.deltaY/St:xt.deltaY/(St*10),$t=this.dollyToCursor?(xt.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,It=this.dollyToCursor?(xt.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case ACTION.ROTATE:{this._rotateInternal(xt.deltaX,xt.deltaY),this._isUserControllingRotate=!0;break}case ACTION.TRUCK:{this._truckInternal(xt.deltaX,xt.deltaY,!1),this._isUserControllingTruck=!0;break}case ACTION.OFFSET:{this._truckInternal(xt.deltaX,xt.deltaY,!0),this._isUserControllingOffset=!0;break}case ACTION.DOLLY:{this._dollyInternal(-Et,$t,It),this._isUserControllingDolly=!0;break}case ACTION.ZOOM:{this._zoomInternal(-Et,$t,It),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},mt=xt=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===x1.ACTION.NONE){const St=xt instanceof PointerEvent?xt.pointerId:(xt instanceof MouseEvent,0),Et=this._findPointerById(St);Et&&this._disposePointer(Et),this._domElement.ownerDocument.removeEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.ownerDocument.removeEventListener("mousemove",ct),this._domElement.ownerDocument.removeEventListener("mouseup",ht);return}xt.preventDefault()}},gt=xt=>{if(!this._enabled)return;if(extractClientCoordFromEvent(this._activePointers,_v2),this._getClientRect(this._elementRect),it.copy(_v2),rt.copy(_v2),this._activePointers.length>=2){const Et=_v2.x-this._activePointers[1].clientX,$t=_v2.y-this._activePointers[1].clientY,It=Math.sqrt(Et*Et+$t*$t);ot.set(0,It);const Ft=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,Ht=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;rt.set(Ft,Ht)}if(this._state=0,!xt)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in xt&&xt.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&&(xt.buttons&MOUSE_BUTTON.LEFT)===MOUSE_BUTTON.LEFT&&(this._state=this._state|this.mouseButtons.left),(xt.buttons&MOUSE_BUTTON.MIDDLE)===MOUSE_BUTTON.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(xt.buttons&MOUSE_BUTTON.RIGHT)===MOUSE_BUTTON.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&ACTION.ROTATE)===ACTION.ROTATE||(this._state&ACTION.TOUCH_ROTATE)===ACTION.TOUCH_ROTATE||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.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&ACTION.TRUCK)===ACTION.TRUCK||(this._state&ACTION.TOUCH_TRUCK)===ACTION.TOUCH_TRUCK||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&ACTION.DOLLY)===ACTION.DOLLY||(this._state&ACTION.TOUCH_DOLLY)===ACTION.TOUCH_DOLLY||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&ACTION.ZOOM)===ACTION.ZOOM||(this._state&ACTION.TOUCH_ZOOM)===ACTION.TOUCH_ZOOM||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&ACTION.OFFSET)===ACTION.OFFSET||(this._state&ACTION.TOUCH_OFFSET)===ACTION.TOUCH_OFFSET||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},bt=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,extractClientCoordFromEvent(this._activePointers,_v2);const St=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,Et=St?-St.deltaX:rt.x-_v2.x,$t=St?-St.deltaY:rt.y-_v2.y;if(rt.copy(_v2),((this._state&ACTION.ROTATE)===ACTION.ROTATE||(this._state&ACTION.TOUCH_ROTATE)===ACTION.TOUCH_ROTATE||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(Et,$t),this._isUserControllingRotate=!0),(this._state&ACTION.DOLLY)===ACTION.DOLLY||(this._state&ACTION.ZOOM)===ACTION.ZOOM){const It=this.dollyToCursor?(it.x-this._elementRect.x)/this._elementRect.width*2-1:0,Ft=this.dollyToCursor?(it.y-this._elementRect.y)/this._elementRect.height*-2+1:0,Ht=this.dollyDragInverted?-1:1;(this._state&ACTION.DOLLY)===ACTION.DOLLY?(this._dollyInternal(Ht*$t*TOUCH_DOLLY_FACTOR,It,Ft),this._isUserControllingDolly=!0):(this._zoomInternal(Ht*$t*TOUCH_DOLLY_FACTOR,It,Ft),this._isUserControllingZoom=!0)}if((this._state&ACTION.TOUCH_DOLLY)===ACTION.TOUCH_DOLLY||(this._state&ACTION.TOUCH_ZOOM)===ACTION.TOUCH_ZOOM||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_ZOOM_ROTATE)===ACTION.TOUCH_ZOOM_ROTATE){const It=_v2.x-this._activePointers[1].clientX,Ft=_v2.y-this._activePointers[1].clientY,Ht=Math.sqrt(It*It+Ft*Ft),zt=ot.y-Ht;ot.set(0,Ht);const Ot=this.dollyToCursor?(rt.x-this._elementRect.x)/this._elementRect.width*2-1:0,jt=this.dollyToCursor?(rt.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&ACTION.TOUCH_DOLLY)===ACTION.TOUCH_DOLLY||(this._state&ACTION.TOUCH_DOLLY_ROTATE)===ACTION.TOUCH_DOLLY_ROTATE||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET?(this._dollyInternal(zt*TOUCH_DOLLY_FACTOR,Ot,jt),this._isUserControllingDolly=!0):(this._zoomInternal(zt*TOUCH_DOLLY_FACTOR,Ot,jt),this._isUserControllingZoom=!0)}((this._state&ACTION.TRUCK)===ACTION.TRUCK||(this._state&ACTION.TOUCH_TRUCK)===ACTION.TOUCH_TRUCK||(this._state&ACTION.TOUCH_DOLLY_TRUCK)===ACTION.TOUCH_DOLLY_TRUCK||(this._state&ACTION.TOUCH_ZOOM_TRUCK)===ACTION.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(Et,$t,!1),this._isUserControllingTruck=!0),((this._state&ACTION.OFFSET)===ACTION.OFFSET||(this._state&ACTION.TOUCH_OFFSET)===ACTION.TOUCH_OFFSET||(this._state&ACTION.TOUCH_DOLLY_OFFSET)===ACTION.TOUCH_DOLLY_OFFSET||(this._state&ACTION.TOUCH_ZOOM_OFFSET)===ACTION.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(Et,$t,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},yt=()=>{extractClientCoordFromEvent(this._activePointers,_v2),rt.copy(_v2),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",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",ct),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.ownerDocument.removeEventListener("mouseup",ht),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",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",wt),this._domElement.ownerDocument.addEventListener("pointerlockerror",vt),this._domElement.ownerDocument.addEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",ut),gt())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",wt),this._domElement.ownerDocument.removeEventListener("pointerlockerror",vt))};const wt=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},vt=()=>{this.unlockPointer()};this._addAllEventListeners=xt=>{this._domElement=xt,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",at),isPointerEventsNotSupported&&this._domElement.addEventListener("mousedown",st),this._domElement.addEventListener("pointercancel",ut),this._domElement.addEventListener("wheel",pt,{passive:!1}),this._domElement.addEventListener("contextmenu",mt)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",at),this._domElement.removeEventListener("mousedown",st),this._domElement.removeEventListener("pointercancel",ut),this._domElement.removeEventListener("wheel",pt,{passive:!1}),this._domElement.removeEventListener("contextmenu",mt),this._domElement.ownerDocument.removeEventListener("pointermove",lt,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",ct),this._domElement.ownerDocument.removeEventListener("pointerup",ut),this._domElement.ownerDocument.removeEventListener("mouseup",ht),this._domElement.ownerDocument.removeEventListener("pointerlockchange",wt),this._domElement.ownerDocument.removeEventListener("pointerlockerror",vt))},this.cancel=()=>{this._state!==ACTION.NONE&&(this._state=ACTION.NONE,this._activePointers.length=0,yt())},nt&&this.connect(nt),this.update(0)}get camera(){return this._camera}set camera(et){this._camera=et,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(et){this._enabled=et,this._domElement&&(et?(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(et){this._spherical.radius===et&&this._sphericalEnd.radius===et||(this._spherical.radius=et,this._sphericalEnd.radius=et,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(et){this._spherical.theta===et&&this._sphericalEnd.theta===et||(this._spherical.theta=et,this._sphericalEnd.theta=et,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(et){this._spherical.phi===et&&this._sphericalEnd.phi===et||(this._spherical.phi=et,this._sphericalEnd.phi=et,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(et){this._boundaryEnclosesCamera=et,this._needsUpdate=!0}set interactiveArea(et){this._interactiveArea.width=clamp$3(et.width,0,1),this._interactiveArea.height=clamp$3(et.height,0,1),this._interactiveArea.x=clamp$3(et.x,0,1-this._interactiveArea.width),this._interactiveArea.y=clamp$3(et.y,0,1-this._interactiveArea.height)}addEventListener(et,nt){super.addEventListener(et,nt)}removeEventListener(et,nt){super.removeEventListener(et,nt)}rotate(et,nt,it=!1){return this.rotateTo(this._sphericalEnd.theta+et,this._sphericalEnd.phi+nt,it)}rotateAzimuthTo(et,nt=!1){return this.rotateTo(et,this._sphericalEnd.phi,nt)}rotatePolarTo(et,nt=!1){return this.rotateTo(this._sphericalEnd.theta,et,nt)}rotateTo(et,nt,it=!1){this._isUserControllingRotate=!1;const rt=clamp$3(et,this.minAzimuthAngle,this.maxAzimuthAngle),ot=clamp$3(nt,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=rt,this._sphericalEnd.phi=ot,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,it||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const at=!it||approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(at)}dolly(et,nt=!1){return this.dollyTo(this._sphericalEnd.radius-et,nt)}dollyTo(et,nt=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=DOLLY_DIRECTION.NONE,this._changedDolly=0,this._dollyToNoClamp(clamp$3(et,this.minDistance,this.maxDistance),nt)}_dollyToNoClamp(et,nt=!1){const it=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const at=this._collisionTest(),st=approxEquals(at,this._spherical.radius);if(!(it>et)&&st)return Promise.resolve();this._sphericalEnd.radius=Math.min(et,at)}else this._sphericalEnd.radius=et;this._needsUpdate=!0,nt||(this._spherical.radius=this._sphericalEnd.radius);const ot=!nt||approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(ot)}dollyInFixed(et,nt=!1){this._targetEnd.add(this._getCameraDirection(_cameraDirection).multiplyScalar(et)),nt||this._target.copy(this._targetEnd);const it=!nt||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(it)}zoom(et,nt=!1){return this.zoomTo(this._zoomEnd+et,nt)}zoomTo(et,nt=!1){this._isUserControllingZoom=!1,this._zoomEnd=clamp$3(et,this.minZoom,this.maxZoom),this._needsUpdate=!0,nt||(this._zoom=this._zoomEnd);const it=!nt||approxEquals(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(it)}pan(et,nt,it=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(et,nt,it)}truck(et,nt,it=!1){this._camera.updateMatrix(),_xColumn.setFromMatrixColumn(this._camera.matrix,0),_yColumn.setFromMatrixColumn(this._camera.matrix,1),_xColumn.multiplyScalar(et),_yColumn.multiplyScalar(-nt);const rt=_v3A.copy(_xColumn).add(_yColumn),ot=_v3B.copy(this._targetEnd).add(rt);return this.moveTo(ot.x,ot.y,ot.z,it)}forward(et,nt=!1){_v3A.setFromMatrixColumn(this._camera.matrix,0),_v3A.crossVectors(this._camera.up,_v3A),_v3A.multiplyScalar(et);const it=_v3B.copy(this._targetEnd).add(_v3A);return this.moveTo(it.x,it.y,it.z,nt)}elevate(et,nt=!1){return _v3A.copy(this._camera.up).multiplyScalar(et),this.moveTo(this._targetEnd.x+_v3A.x,this._targetEnd.y+_v3A.y,this._targetEnd.z+_v3A.z,nt)}moveTo(et,nt,it,rt=!1){this._isUserControllingTruck=!1;const ot=_v3A.set(et,nt,it).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,ot,this.boundaryFriction),this._needsUpdate=!0,rt||this._target.copy(this._targetEnd);const at=!rt||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(at)}lookInDirectionOf(et,nt,it,rt=!1){const st=_v3A.set(et,nt,it).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(st.x,st.y,st.z,rt)}fitToBox(et,nt,{cover:it=!1,paddingLeft:rt=0,paddingRight:ot=0,paddingBottom:at=0,paddingTop:st=0}={}){const lt=[],ct=et.isBox3?_box3A.copy(et):_box3A.setFromObject(et);ct.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const ut=roundToStep(this._sphericalEnd.theta,PI_HALF),ht=roundToStep(this._sphericalEnd.phi,PI_HALF);lt.push(this.rotateTo(ut,ht,nt));const dt=_v3A.setFromSpherical(this._sphericalEnd).normalize(),pt=_quaternionA.setFromUnitVectors(dt,_AXIS_Z),mt=approxEquals(Math.abs(dt.y),1);mt&&pt.multiply(_quaternionB.setFromAxisAngle(_AXIS_Y,ut)),pt.multiply(this._yAxisUpSpaceInverse);const gt=_box3B.makeEmpty();_v3B.copy(ct.min).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.min).setX(ct.max.x).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.min).setY(ct.max.y).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.max).setZ(ct.min.z).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.min).setZ(ct.max.z).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.max).setY(ct.min.y).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.max).setX(ct.min.x).applyQuaternion(pt),gt.expandByPoint(_v3B),_v3B.copy(ct.max).applyQuaternion(pt),gt.expandByPoint(_v3B),gt.min.x-=rt,gt.min.y-=at,gt.max.x+=ot,gt.max.y+=st,pt.setFromUnitVectors(_AXIS_Z,dt),mt&&pt.premultiply(_quaternionB.invert()),pt.premultiply(this._yAxisUpSpace);const bt=gt.getSize(_v3A),yt=gt.getCenter(_v3B).applyQuaternion(pt);if(isPerspectiveCamera(this._camera)){const wt=this.getDistanceToFitBox(bt.x,bt.y,bt.z,it);lt.push(this.moveTo(yt.x,yt.y,yt.z,nt)),lt.push(this.dollyTo(wt,nt)),lt.push(this.setFocalOffset(0,0,0,nt))}else if(isOrthographicCamera(this._camera)){const wt=this._camera,vt=wt.right-wt.left,xt=wt.top-wt.bottom,St=it?Math.max(vt/bt.x,xt/bt.y):Math.min(vt/bt.x,xt/bt.y);lt.push(this.moveTo(yt.x,yt.y,yt.z,nt)),lt.push(this.zoomTo(St,nt)),lt.push(this.setFocalOffset(0,0,0,nt))}return Promise.all(lt)}fitToSphere(et,nt){const it=[],ot=et instanceof THREE.Sphere?_sphere.copy(et):x1.createBoundingSphere(et,_sphere);if(it.push(this.moveTo(ot.center.x,ot.center.y,ot.center.z,nt)),isPerspectiveCamera(this._camera)){const at=this.getDistanceToFitSphere(ot.radius);it.push(this.dollyTo(at,nt))}else if(isOrthographicCamera(this._camera)){const at=this._camera.right-this._camera.left,st=this._camera.top-this._camera.bottom,lt=2*ot.radius,ct=Math.min(at/lt,st/lt);it.push(this.zoomTo(ct,nt))}return it.push(this.setFocalOffset(0,0,0,nt)),Promise.all(it)}setLookAt(et,nt,it,rt,ot,at,st=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=DOLLY_DIRECTION.NONE,this._changedDolly=0;const lt=_v3B.set(rt,ot,at),ct=_v3A.set(et,nt,it);this._targetEnd.copy(lt),this._sphericalEnd.setFromVector3(ct.sub(lt).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,st||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const ut=!st||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold)&&approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(ut)}lerpLookAt(et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=DOLLY_DIRECTION.NONE,this._changedDolly=0;const gt=_v3A.set(rt,ot,at),bt=_v3B.set(et,nt,it);_sphericalA.setFromVector3(bt.sub(gt).applyQuaternion(this._yAxisUpSpace));const yt=_v3C.set(ut,ht,dt),wt=_v3B.set(st,lt,ct);_sphericalB.setFromVector3(wt.sub(yt).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(gt.lerp(yt,pt));const vt=_sphericalB.theta-_sphericalA.theta,xt=_sphericalB.phi-_sphericalA.phi,St=_sphericalB.radius-_sphericalA.radius;this._sphericalEnd.set(_sphericalA.radius+St*pt,_sphericalA.phi+xt*pt,_sphericalA.theta+vt*pt),this.normalizeRotations(),this._needsUpdate=!0,mt||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const Et=!mt||approxEquals(this._target.x,this._targetEnd.x,this.restThreshold)&&approxEquals(this._target.y,this._targetEnd.y,this.restThreshold)&&approxEquals(this._target.z,this._targetEnd.z,this.restThreshold)&&approxEquals(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&approxEquals(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&approxEquals(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(Et)}setPosition(et,nt,it,rt=!1){return this.setLookAt(et,nt,it,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,rt)}setTarget(et,nt,it,rt=!1){const ot=this.getPosition(_v3A),at=this.setLookAt(ot.x,ot.y,ot.z,et,nt,it,rt);return this._sphericalEnd.phi=clamp$3(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),at}setFocalOffset(et,nt,it,rt=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(et,nt,it),this._needsUpdate=!0,rt||this._focalOffset.copy(this._focalOffsetEnd);const ot=!rt||approxEquals(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&approxEquals(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&approxEquals(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(ot)}setOrbitPoint(et,nt,it){this._camera.updateMatrixWorld(),_xColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_yColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,1),_zColumn.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const rt=_v3A.set(et,nt,it),ot=rt.distanceTo(this._camera.position),at=rt.sub(this._camera.position);_xColumn.multiplyScalar(at.x),_yColumn.multiplyScalar(at.y),_zColumn.multiplyScalar(at.z),_v3A.copy(_xColumn).add(_yColumn).add(_zColumn),_v3A.z=_v3A.z+ot,this.dollyTo(ot,!1),this.setFocalOffset(-_v3A.x,_v3A.y,-_v3A.z,!1),this.moveTo(et,nt,it,!1)}setBoundary(et){if(!et){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(et),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(et,nt,it,rt){if(et===null){this._viewport=null;return}this._viewport=this._viewport||new THREE.Vector4,typeof et=="number"?this._viewport.set(et,nt,it,rt):this._viewport.copy(et)}getDistanceToFitBox(et,nt,it,rt=!1){if(notSupportedInOrthographicCamera(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const ot=et/nt,at=this._camera.getEffectiveFOV()*DEG2RAD,st=this._camera.aspect;return((rt?ot>st:otnt.pointerId===et)}_findPointerByMouseButton(et){return this._activePointers.find(nt=>nt.mouseButton===et)}_disposePointer(et){this._activePointers.splice(this._activePointers.indexOf(et),1)}_encloseToBoundary(et,nt,it){const rt=nt.lengthSq();if(rt===0)return et;const ot=_v3B.copy(nt).add(et),st=this._boundary.clampPoint(ot,_v3C).sub(ot),lt=st.lengthSq();if(lt===0)return et.add(nt);if(lt===rt)return et;if(it===0)return et.add(nt).add(st);{const ct=1+it*lt/nt.dot(st);return et.add(_v3B.copy(nt).multiplyScalar(ct)).add(st.multiplyScalar(1-it))}}_updateNearPlaneCorners(){if(isPerspectiveCamera(this._camera)){const et=this._camera,nt=et.near,it=et.getEffectiveFOV()*DEG2RAD,rt=Math.tan(it*.5)*nt,ot=rt*et.aspect;this._nearPlaneCorners[0].set(-ot,-rt,0),this._nearPlaneCorners[1].set(ot,-rt,0),this._nearPlaneCorners[2].set(ot,rt,0),this._nearPlaneCorners[3].set(-ot,rt,0)}else if(isOrthographicCamera(this._camera)){const et=this._camera,nt=1/et.zoom,it=et.left*nt,rt=et.right*nt,ot=et.top*nt,at=et.bottom*nt;this._nearPlaneCorners[0].set(it,ot,0),this._nearPlaneCorners[1].set(rt,ot,0),this._nearPlaneCorners[2].set(rt,at,0),this._nearPlaneCorners[3].set(it,at,0)}}_collisionTest(){let et=1/0;if(!(this.colliderMeshes.length>=1)||notSupportedInOrthographicCamera(this._camera,"_collisionTest"))return et;const it=this._getTargetDirection(_cameraDirection);_rotationMatrix.lookAt(_ORIGIN,it,this._camera.up);for(let rt=0;rt<4;rt++){const ot=_v3B.copy(this._nearPlaneCorners[rt]);ot.applyMatrix4(_rotationMatrix);const at=_v3C.addVectors(this._target,ot);_raycaster.set(at,it),_raycaster.far=this._spherical.radius+1;const st=_raycaster.intersectObjects(this.colliderMeshes);st.length!==0&&st[0].distance{const it=()=>{this.removeEventListener("rest",it),nt()};this.addEventListener("rest",it)}))}_addAllEventListeners(et){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(et){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(et){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(et,nt=new THREE.Sphere){const it=nt,rt=it.center;_box3A.makeEmpty(),et.traverseVisible(at=>{at.isMesh&&_box3A.expandByObject(at)}),_box3A.getCenter(rt);let ot=0;return et.traverseVisible(at=>{if(!at.isMesh)return;const st=at,lt=st.geometry.clone();lt.applyMatrix4(st.matrixWorld);const ut=lt.attributes.position;for(let ht=0,dt=ut.count;ht{reactExports.useMemo(()=>{CameraControls$1.install({THREE:THREE$1}),extend$3({CameraControlsImpl:CameraControls$1})},[]);const{camera:nt,domElement:it,makeDefault:rt,onStart:ot,onEnd:at,onChange:st,regress:lt,...ct}=tt,ut=useThree(St=>St.camera),ht=useThree(St=>St.gl),dt=useThree(St=>St.invalidate),pt=useThree(St=>St.events),mt=useThree(St=>St.setEvents),gt=useThree(St=>St.set),bt=useThree(St=>St.get),yt=useThree(St=>St.performance),wt=nt||ut,vt=it||pt.connected||ht.domElement,xt=reactExports.useMemo(()=>new CameraControls$1(wt),[wt]);return useFrame((St,Et)=>{xt.enabled&&xt.update(Et)},-1),reactExports.useEffect(()=>(xt.connect(vt),()=>void xt.disconnect()),[vt,xt]),reactExports.useEffect(()=>{const St=It=>{dt(),lt&&yt.regress(),st&&st(It)},Et=It=>{ot&&ot(It)},$t=It=>{at&&at(It)};return xt.addEventListener("update",St),xt.addEventListener("controlstart",Et),xt.addEventListener("controlend",$t),()=>{xt.removeEventListener("update",St),xt.removeEventListener("controlstart",Et),xt.removeEventListener("controlend",$t)}},[xt,ot,at,dt,mt,lt,st]),reactExports.useEffect(()=>{if(rt){const St=bt().controls;return gt({controls:xt}),()=>gt({controls:St})}},[rt,xt]),reactExports.createElement("primitive",_extends$t({ref:et,object:xt},ct))});PropTypes.func.isRequired,PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.element,PropTypes.func])).isRequired;const _instanceLocalMatrix=new Matrix4,_instanceWorldMatrix=new Matrix4,_instanceIntersects=[],_mesh=new Mesh;class PositionMesh extends Group{constructor(){super(),this.color=new Color$1("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var et;return(et=this.instance.current)==null?void 0:et.geometry}raycast(et,nt){const it=this.instance.current;if(!it||!it.geometry||!it.material)return;_mesh.geometry=it.geometry;const rt=it.matrixWorld,ot=it.userData.instances.indexOf(this.instanceKey);if(!(ot===-1||ot>it.count)){it.getMatrixAt(ot,_instanceLocalMatrix),_instanceWorldMatrix.multiplyMatrices(rt,_instanceLocalMatrix),_mesh.matrixWorld=_instanceWorldMatrix,it.material instanceof Material?_mesh.material.side=it.material.side:_mesh.material.side=it.material[0].side,_mesh.raycast(et,_instanceIntersects);for(let at=0,st=_instanceIntersects.length;at{reactExports.useMemo(()=>extend$3({PositionMesh}),[]);const rt=reactExports.useRef(),{subscribe:ot,getParent:at}=reactExports.useContext(tt||globalContext$1);return reactExports.useLayoutEffect(()=>ot(rt),[]),reactExports.createElement("positionMesh",_extends$t({instance:at(),instanceKey:rt,ref:mergeRefs([it,rt])},nt),et)}),Instances=reactExports.forwardRef(({children:tt,range:et,limit:nt=1e3,frames:it=1/0,...rt},ot)=>{const[{context:at,instance:st}]=reactExports.useState(()=>{const bt=reactExports.createContext(null);return{context:bt,instance:reactExports.forwardRef((yt,wt)=>reactExports.createElement(Instance,_extends$t({context:bt},yt,{ref:wt})))}}),lt=reactExports.useRef(null),[ct,ut]=reactExports.useState([]),[[ht,dt]]=reactExports.useState(()=>{const bt=new Float32Array(nt*16);for(let yt=0;yt1))]});reactExports.useEffect(()=>{lt.current.instanceMatrix.needsUpdate=!0});let pt=0,mt=0;useFrame(()=>{if(it===1/0||pt({getParent:()=>lt,subscribe:bt=>(ut(yt=>[...yt,bt]),()=>ut(yt=>yt.filter(wt=>wt.current!==bt.current)))}),[]);return reactExports.createElement("instancedMesh",_extends$t({userData:{instances:ct},matrixAutoUpdate:!1,ref:mergeRefs([ot,lt]),args:[null,null,0],raycast:()=>null},rt),reactExports.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:ht.length/16,array:ht,itemSize:16,usage:DynamicDrawUsage}),reactExports.createElement("instancedBufferAttribute",{attach:"instanceColor",count:dt.length/3,array:dt,itemSize:3,usage:DynamicDrawUsage}),typeof tt=="function"?reactExports.createElement(at.Provider,{value:gt},tt(st)):reactExports.createElement(globalContext$1.Provider,{value:gt},tt))}),context=reactExports.createContext(null),Segments=reactExports.forwardRef((tt,et)=>{reactExports.useMemo(()=>extend$3({SegmentObject}),[]);const{limit:nt=1e3,lineWidth:it=1,children:rt,...ot}=tt,[at,st]=reactExports.useState([]),[lt]=reactExports.useState(()=>new Line2),[ct]=reactExports.useState(()=>new LineMaterial),[ut]=reactExports.useState(()=>new LineSegmentsGeometry),[ht]=reactExports.useState(()=>new Vector2(512,512)),[dt]=reactExports.useState(()=>Array(nt*6).fill(0)),[pt]=reactExports.useState(()=>Array(nt*6).fill(0)),mt=reactExports.useMemo(()=>({subscribe:gt=>(st(bt=>[...bt,gt]),()=>st(bt=>bt.filter(yt=>yt.current!==gt.current)))}),[]);return useFrame(()=>{for(let bt=0;bttt instanceof Vector3?tt:new Vector3(...typeof tt=="number"?[tt,tt,tt]:tt),Segment$1=reactExports.forwardRef(({color:tt,start:et,end:nt},it)=>{const rt=reactExports.useContext(context);if(!rt)throw"Segment must used inside Segments component.";const ot=reactExports.useRef(null);return reactExports.useLayoutEffect(()=>rt.subscribe(ot),[]),reactExports.createElement("segmentObject",{ref:mergeRefs([ot,it]),color:tt,start:normPos(et),end:normPos(nt)})});function Preload({all:tt,scene:et,camera:nt}){const it=useThree(({gl:at})=>at),rt=useThree(({camera:at})=>at),ot=useThree(({scene:at})=>at);return reactExports.useLayoutEffect(()=>{const at=[];tt&&(et||ot).traverse(ct=>{ct.visible===!1&&(at.push(ct),ct.visible=!0)}),it.compile(et||ot,nt||rt);const st=new WebGLCubeRenderTarget(128);new CubeCamera(.01,1e5,st).update(it,et||ot),st.dispose(),at.forEach(ct=>ct.visible=!1)},[]),null}function AdaptiveDpr({pixelated:tt}){const et=useThree(at=>at.gl),nt=useThree(at=>at.internal.active),it=useThree(at=>at.performance.current),rt=useThree(at=>at.viewport.initialDpr),ot=useThree(at=>at.setDpr);return reactExports.useEffect(()=>{const at=et.domElement;return()=>{nt&&ot(rt),tt&&at&&(at.style.imageRendering="auto")}},[]),reactExports.useEffect(()=>{ot(it*rt),tt&&et.domElement&&(et.domElement.style.imageRendering=it===1?"auto":"pixelated")},[it]),null}function AdaptiveEvents(){const tt=useThree(it=>it.get),et=useThree(it=>it.setEvents),nt=useThree(it=>it.performance.current);return reactExports.useEffect(()=>{const it=tt().events.enabled;return()=>et({enabled:it})},[]),reactExports.useEffect(()=>et({enabled:nt===1}),[nt]),null}const selectionContext=reactExports.createContext(null);function Selection$3({children:tt,enabled:et=!0}){const[nt,it]=reactExports.useState([]),rt=reactExports.useMemo(()=>({selected:nt,select:it,enabled:et}),[nt,it,et]);return jsxRuntimeExports.jsx(selectionContext.Provider,{value:rt,children:tt})}function Select({enabled:tt=!1,children:et,...nt}){const it=reactExports.useRef(null),rt=reactExports.useContext(selectionContext);return reactExports.useEffect(()=>{if(rt&&tt){let ot=!1;const at=[];if(it.current.traverse(st=>{st.type==="Mesh"&&at.push(st),rt.selected.indexOf(st)===-1&&(ot=!0)}),ot)return rt.select(st=>[...st,...at]),()=>{rt.select(st=>st.filter(lt=>!at.includes(lt)))}}},[tt,et,rt]),jsxRuntimeExports.jsx("group",{ref:it,...nt,children:et})}/** + * postprocessing v6.33.4 build Sat Dec 02 2023 * https://github.com/pmndrs/postprocessing * Copyright 2015-2023 Raoul van Rüschen * @license Zlib @@ -4729,7 +4729,7 @@ uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varyin `+it),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,tt.colorSpace===SRGBColorSpace&&(it+=`color0 = sRGBToLinear(color0); `),tt.uvTransformation?(rt=`vec2 transformedUv = vUv; `+rt,tt.defines.set("UV","transformedUv")):tt.defines.set("UV","vUv"),tt.shaderParts.set(EffectShaderSection.FRAGMENT_HEAD,nt),tt.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_IMAGE,it),tt.shaderParts.set(EffectShaderSection.FRAGMENT_MAIN_UV,rt);for(const[at,st]of tt.shaderParts)st!==null&&tt.shaderParts.set(at,st.trim().replace(/^#/,` -#`));this.skipRendering=et===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(tt)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(tt,et=BasicDepthPacking){this.fullscreenMaterial.depthBuffer=tt,this.fullscreenMaterial.depthPacking=et;for(const nt of this.effects)nt.setDepthTexture(tt,et)}render(tt,et,nt,it,rt){for(const ot of this.effects)ot.update(tt,et,it);if(!this.skipRendering||this.renderToScreen){const ot=this.fullscreenMaterial;ot.inputBuffer=et.texture,ot.time+=it*this.timeScale,tt.setRenderTarget(this.renderToScreen?null:nt),tt.render(this.scene,this.camera)}}setSize(tt,et){this.fullscreenMaterial.setSize(tt,et);for(const nt of this.effects)nt.setSize(tt,et)}initialize(tt,et,nt){this.renderer=tt;for(const it of this.effects)it.initialize(tt,et,nt);this.updateMaterial(),nt!==void 0&&nt!==UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const tt of this.effects)tt.removeEventListener("change",this.listener),tt.dispose()}handleEvent(tt){switch(tt.type){case"change":this.recompile();break}}},KawaseBlurPass=class extends Pass{constructor({kernelSize:tt=KernelSize.MEDIUM,resolutionScale:et=.5,width:nt=Resolution.AUTO_SIZE,height:it=Resolution.AUTO_SIZE,resolutionX:rt=nt,resolutionY:ot=it}={}){super("KawaseBlurPass"),this.renderTargetA=new WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const at=this.resolution=new Resolution(this,rt,ot,et);at.addEventListener("change",st=>this.setSize(at.baseWidth,at.baseHeight)),this._blurMaterial=new KawaseBlurMaterial,this._blurMaterial.kernelSize=tt,this.copyMaterial=new CopyMaterial}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(tt){this._blurMaterial=tt}get dithering(){return this.copyMaterial.dithering}set dithering(tt){this.copyMaterial.dithering=tt}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(tt){this.blurMaterial.kernelSize=tt}get width(){return this.resolution.width}set width(tt){this.resolution.preferredWidth=tt}get height(){return this.resolution.height}set height(tt){this.resolution.preferredHeight=tt}get scale(){return this.blurMaterial.scale}set scale(tt){this.blurMaterial.scale=tt}getScale(){return this.blurMaterial.scale}setScale(tt){this.blurMaterial.scale=tt}getKernelSize(){return this.kernelSize}setKernelSize(tt){this.kernelSize=tt}getResolutionScale(){return this.resolution.scale}setResolutionScale(tt){this.resolution.scale=tt}render(tt,et,nt,it,rt){const ot=this.scene,at=this.camera,st=this.renderTargetA,lt=this.renderTargetB,ct=this.blurMaterial,ut=ct.kernelSequence;let ht=et;this.fullscreenMaterial=ct;for(let dt=0,pt=ut.length;dtthis.setSize(lt.baseWidth,lt.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(tt,et,nt,it,rt){const ot=this.fullscreenMaterial;ot.inputBuffer=et.texture,tt.setRenderTarget(this.renderToScreen?null:this.renderTarget),tt.render(this.scene,this.camera)}setSize(tt,et){const nt=this.resolution;nt.setBaseSize(tt,et),this.renderTarget.setSize(nt.width,nt.height)}initialize(tt,et,nt){nt!==void 0&&nt!==UnsignedByteType&&(this.renderTarget.texture.type=nt,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},MaskPass=class extends Pass{constructor(tt,et){super("MaskPass",tt,et),this.needsSwap=!1,this.clearPass=new ClearPass(!1,!1,!0),this.inverse=!1}set mainScene(tt){this.scene=tt}set mainCamera(tt){this.camera=tt}get inverted(){return this.inverse}set inverted(tt){this.inverse=tt}get clear(){return this.clearPass.enabled}set clear(tt){this.clearPass.enabled=tt}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(tt){this.inverted=tt}render(tt,et,nt,it,rt){const ot=tt.getContext(),at=tt.state.buffers,st=this.scene,lt=this.camera,ct=this.clearPass,ut=this.inverted?0:1,ht=1-ut;at.color.setMask(!1),at.depth.setMask(!1),at.color.setLocked(!0),at.depth.setLocked(!0),at.stencil.setTest(!0),at.stencil.setOp(ot.REPLACE,ot.REPLACE,ot.REPLACE),at.stencil.setFunc(ot.ALWAYS,ut,4294967295),at.stencil.setClear(ht),at.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?ct.render(tt,null):(ct.render(tt,et),ct.render(tt,nt))),this.renderToScreen?(tt.setRenderTarget(null),tt.render(st,lt)):(tt.setRenderTarget(et),tt.render(st,lt),tt.setRenderTarget(nt),tt.render(st,lt)),at.color.setLocked(!1),at.depth.setLocked(!1),at.stencil.setLocked(!1),at.stencil.setFunc(ot.EQUAL,1,4294967295),at.stencil.setOp(ot.KEEP,ot.KEEP,ot.KEEP),at.stencil.setLocked(!0)}},MipmapBlurPass=class extends Pass{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new DownsamplingMaterial,this.upsamplingMaterial=new UpsamplingMaterial,this.resolution=new Vector2}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(tt){if(this.levels!==tt){const et=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let nt=0;nt=0;--dt){const pt=ut[dt];lt.setSize(ht.width,ht.height),lt.inputBuffer=ht.texture,lt.supportBuffer=ct[dt].texture,tt.setRenderTarget(pt),tt.render(ot,at),ht=pt}}setSize(tt,et){const nt=this.resolution;nt.set(tt,et);let it=nt.width,rt=nt.height;for(let ot=0,at=this.downsamplingMipmaps.length;otthis.setSize(ut.baseWidth,ut.baseHeight))}set mainScene(tt){this.renderPass.mainScene=tt}set mainCamera(tt){this.renderPass.mainCamera=tt}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(tt){this.resolution.scale=tt}render(tt,et,nt,it,rt){const ot=this.renderToScreen?null:this.renderTarget;this.renderPass.render(tt,ot,ot)}setSize(tt,et){const nt=this.resolution;nt.setBaseSize(tt,et),this.renderTarget.setSize(nt.width,nt.height)}},ShaderPass=class extends Pass{constructor(tt,et="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=tt,this.input=et}setInput(tt){this.input=tt}render(tt,et,nt,it,rt){const ot=this.fullscreenMaterial.uniforms;et!==null&&ot!==void 0&&ot[this.input]!==void 0&&(ot[this.input].value=et.texture),tt.setRenderTarget(this.renderToScreen?null:nt),tt.render(this.scene,this.camera)}initialize(tt,et,nt){nt!==void 0&&nt!==UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},MILLISECONDS_TO_SECONDS=1/1e3,SECONDS_TO_MILLISECONDS=1e3,Timer=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(tt){typeof document<"u"&&document.hidden!==void 0&&(tt?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=tt)}get delta(){return this._delta*MILLISECONDS_TO_SECONDS}get fixedDelta(){return this._fixedDelta*MILLISECONDS_TO_SECONDS}set fixedDelta(tt){this._fixedDelta=tt*SECONDS_TO_MILLISECONDS}get elapsed(){return this._elapsed*MILLISECONDS_TO_SECONDS}update(tt){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(tt!==void 0?tt: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(tt){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},EffectComposer$1=class{constructor(et=null,{depthBuffer:nt=!0,stencilBuffer:it=!1,multisampling:rt=0,frameBufferType:ot}={}){this.renderer=null,this.inputBuffer=this.createBuffer(nt,it,ot,rt),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new CopyPass,this.depthTexture=null,this.passes=[],this.timer=new Timer,this.autoRenderToScreen=!0,this.setRenderer(et)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(et){const nt=this.inputBuffer,it=this.multisampling;it>0&&et>0?(this.inputBuffer.samples=et,this.outputBuffer.samples=et,this.inputBuffer.dispose(),this.outputBuffer.dispose()):it!==et&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(nt.depthBuffer,nt.stencilBuffer,nt.texture.type,et),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(et){if(this.renderer=et,et!==null){const nt=et.getSize(new Vector2),it=et.getContext().getContextAttributes().alpha,rt=this.inputBuffer.texture.type;rt===UnsignedByteType&&getOutputColorSpace(et)===SRGBColorSpace&&(setTextureColorSpace(this.inputBuffer.texture,SRGBColorSpace),setTextureColorSpace(this.outputBuffer.texture,SRGBColorSpace),this.inputBuffer.dispose(),this.outputBuffer.dispose()),et.autoClear=!1,this.setSize(nt.width,nt.height);for(const ot of this.passes)ot.initialize(et,it,rt)}}replaceRenderer(et,nt=!0){const it=this.renderer,rt=it.domElement.parentNode;return this.setRenderer(et),nt&&rt!==null&&(rt.removeChild(it.domElement),rt.appendChild(et.domElement)),it}createDepthTexture(){const et=this.depthTexture=new DepthTexture;return this.inputBuffer.depthTexture=et,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(et.format=DepthStencilFormat,et.type=UnsignedInt248Type):et.type=UnsignedIntType,et}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const et of this.passes)et.setDepthTexture(null)}}createBuffer(et,nt,it,rt){const ot=this.renderer,at=ot===null?new Vector2:ot.getDrawingBufferSize(new Vector2),st={minFilter:LinearFilter,magFilter:LinearFilter,stencilBuffer:nt,depthBuffer:et,type:it},lt=new WebGLRenderTarget(at.width,at.height,st);return rt>0&&(lt.ignoreDepthForMultisampleCopy=!1,lt.samples=rt),it===UnsignedByteType&&getOutputColorSpace(ot)===SRGBColorSpace&&setTextureColorSpace(lt.texture,SRGBColorSpace),lt.texture.name="EffectComposer.Buffer",lt.texture.generateMipmaps=!1,lt}setMainScene(et){for(const nt of this.passes)nt.mainScene=et}setMainCamera(et){for(const nt of this.passes)nt.mainCamera=et}addPass(et,nt){const it=this.passes,rt=this.renderer,ot=rt.getDrawingBufferSize(new Vector2),at=rt.getContext().getContextAttributes().alpha,st=this.inputBuffer.texture.type;if(et.setRenderer(rt),et.setSize(ot.width,ot.height),et.initialize(rt,at,st),this.autoRenderToScreen&&(it.length>0&&(it[it.length-1].renderToScreen=!1),et.renderToScreen&&(this.autoRenderToScreen=!1)),nt!==void 0?it.splice(nt,0,et):it.push(et),this.autoRenderToScreen&&(it[it.length-1].renderToScreen=!0),et.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const lt=this.createDepthTexture();for(et of it)et.setDepthTexture(lt)}else et.setDepthTexture(this.depthTexture)}removePass(et){const nt=this.passes,it=nt.indexOf(et);if(it!==-1&&nt.splice(it,1).length>0){if(this.depthTexture!==null){const at=(lt,ct)=>lt||ct.needsDepthTexture;nt.reduce(at,!1)||(et.getDepthTexture()===this.depthTexture&&et.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&it===nt.length&&(et.renderToScreen=!1,nt.length>0&&(nt[nt.length-1].renderToScreen=!0))}}removeAllPasses(){const et=this.passes;this.deleteDepthTexture(),et.length>0&&(this.autoRenderToScreen&&(et[et.length-1].renderToScreen=!1),this.passes=[])}render(et){const nt=this.renderer,it=this.copyPass;let rt=this.inputBuffer,ot=this.outputBuffer,at=!1,st,lt,ct;et===void 0&&(this.timer.update(),et=this.timer.delta);for(const ut of this.passes)ut.enabled&&(ut.render(nt,rt,ot,et,at),ut.needsSwap&&(at&&(it.renderToScreen=ut.renderToScreen,st=nt.getContext(),lt=nt.state.buffers.stencil,lt.setFunc(st.NOTEQUAL,1,4294967295),it.render(nt,rt,ot,et,at),lt.setFunc(st.EQUAL,1,4294967295)),ct=rt,rt=ot,ot=ct),ut instanceof MaskPass?at=!0:ut instanceof ClearMaskPass&&(at=!1))}setSize(et,nt,it){const rt=this.renderer,ot=rt.getSize(new Vector2);(et===void 0||nt===void 0)&&(et=ot.width,nt=ot.height),(ot.width!==et||ot.height!==nt)&&rt.setSize(et,nt,it);const at=rt.getDrawingBufferSize(new Vector2);this.inputBuffer.setSize(at.width,at.height),this.outputBuffer.setSize(at.width,at.height);for(const st of this.passes)st.setSize(at.width,at.height)}reset(){const et=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=et}dispose(){for(const et of this.passes)et.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},EffectShaderData=class{constructor(){this.shaderParts=new Map([[EffectShaderSection.FRAGMENT_HEAD,null],[EffectShaderSection.FRAGMENT_MAIN_UV,null],[EffectShaderSection.FRAGMENT_MAIN_IMAGE,null],[EffectShaderSection.VERTEX_HEAD,null],[EffectShaderSection.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=EffectAttribute.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=LinearSRGBColorSpace}},workaroundEnabled=!1,OverrideMaterialManager=class{constructor(tt=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(tt),this.meshCount=0,this.replaceMaterial=et=>{if(et.isMesh){let nt;if(et.material.flatShading)switch(et.material.side){case DoubleSide:nt=this.materialsFlatShadedDoubleSide;break;case BackSide:nt=this.materialsFlatShadedBackSide;break;default:nt=this.materialsFlatShaded;break}else switch(et.material.side){case DoubleSide:nt=this.materialsDoubleSide;break;case BackSide:nt=this.materialsBackSide;break;default:nt=this.materials;break}this.originalMaterials.set(et,et.material),et.isSkinnedMesh?et.material=nt[2]:et.isInstancedMesh?et.material=nt[1]:et.material=nt[0],++this.meshCount}}}cloneMaterial(tt){if(!(tt instanceof ShaderMaterial))return tt.clone();const et=tt.uniforms,nt=new Map;for(const rt in et){const ot=et[rt].value;ot.isRenderTargetTexture&&(et[rt].value=null,nt.set(rt,ot))}const it=tt.clone();for(const rt of nt)et[rt[0]].value=rt[1],it.uniforms[rt[0]].value=rt[1];return it}setMaterial(tt){if(this.disposeMaterials(),this.material=tt,tt!==null){const et=this.materials=[this.cloneMaterial(tt),this.cloneMaterial(tt),this.cloneMaterial(tt)];for(const nt of et)nt.uniforms=Object.assign({},tt.uniforms),nt.side=FrontSide;et[2].skinning=!0,this.materialsBackSide=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.side=BackSide,it}),this.materialsDoubleSide=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.side=DoubleSide,it}),this.materialsFlatShaded=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.flatShading=!0,it}),this.materialsFlatShadedBackSide=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.flatShading=!0,it.side=BackSide,it}),this.materialsFlatShadedDoubleSide=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.flatShading=!0,it.side=DoubleSide,it})}}render(tt,et,nt){const it=tt.shadowMap.enabled;if(tt.shadowMap.enabled=!1,workaroundEnabled){const rt=this.originalMaterials;this.meshCount=0,et.traverse(this.replaceMaterial),tt.render(et,nt);for(const ot of rt)ot[0].material=ot[1];this.meshCount!==rt.size&&rt.clear()}else{const rt=et.overrideMaterial;et.overrideMaterial=this.material,tt.render(et,nt),et.overrideMaterial=rt}tt.shadowMap.enabled=it}disposeMaterials(){if(this.material!==null){const tt=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const et of tt)et.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return workaroundEnabled}static set workaroundEnabled(tt){workaroundEnabled=tt}},AUTO_SIZE=-1,Resolution=class extends EventDispatcher$1{constructor(tt,et=AUTO_SIZE,nt=AUTO_SIZE,it=1){super(),this.resizable=tt,this.baseSize=new Vector2(1,1),this.preferredSize=new Vector2(et,nt),this.target=this.preferredSize,this.s=it,this.effectiveSize=new Vector2,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const tt=this.baseSize,et=this.preferredSize,nt=this.effectiveSize,it=this.scale;et.width!==AUTO_SIZE?nt.width=et.width:et.height!==AUTO_SIZE?nt.width=Math.round(et.height*(tt.width/Math.max(tt.height,1))):nt.width=Math.round(tt.width*it),et.height!==AUTO_SIZE?nt.height=et.height:et.width!==AUTO_SIZE?nt.height=Math.round(et.width/Math.max(tt.width/Math.max(tt.height,1),1)):nt.height=Math.round(tt.height*it)}get width(){return this.effectiveSize.width}set width(tt){this.preferredWidth=tt}get height(){return this.effectiveSize.height}set height(tt){this.preferredHeight=tt}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(tt){this.s!==tt&&(this.s=tt,this.preferredSize.setScalar(AUTO_SIZE),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(tt){this.scale=tt}get baseWidth(){return this.baseSize.width}set baseWidth(tt){this.baseSize.width!==tt&&(this.baseSize.width=tt,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(tt){this.baseWidth=tt}get baseHeight(){return this.baseSize.height}set baseHeight(tt){this.baseSize.height!==tt&&(this.baseSize.height=tt,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(tt){this.baseHeight=tt}setBaseSize(tt,et){(this.baseSize.width!==tt||this.baseSize.height!==et)&&(this.baseSize.set(tt,et),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(tt){this.preferredSize.width!==tt&&(this.preferredSize.width=tt,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(tt){this.preferredWidth=tt}get preferredHeight(){return this.preferredSize.height}set preferredHeight(tt){this.preferredSize.height!==tt&&(this.preferredSize.height=tt,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(tt){this.preferredHeight=tt}setPreferredSize(tt,et){(this.preferredSize.width!==tt||this.preferredSize.height!==et)&&(this.preferredSize.set(tt,et),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(tt){this.s=tt.scale,this.baseSize.set(tt.baseWidth,tt.baseHeight),this.preferredSize.set(tt.preferredWidth,tt.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return AUTO_SIZE}},Selection$2=class extends Set{constructor(et,nt=10){super(),this.l=nt,this.exclusive=!1,et!==void 0&&this.set(et)}get layer(){return this.l}set layer(et){const nt=this.l;for(const it of this)it.layers.disable(nt),it.layers.enable(et);this.l=et}getLayer(){return this.layer}setLayer(et){this.layer=et}isExclusive(){return this.exclusive}setExclusive(et){this.exclusive=et}clear(){const et=this.layer;for(const nt of this)nt.layers.disable(et);return super.clear()}set(et){this.clear();for(const nt of et)this.add(nt);return this}indexOf(et){return this.has(et)?0:-1}add(et){return this.exclusive?et.layers.set(this.layer):et.layers.enable(this.layer),super.add(et)}delete(et){return this.has(et)&&et.layers.disable(this.layer),super.delete(et)}toggle(et){let nt;return this.has(et)?(this.delete(et),nt=!1):(this.add(et),nt=!0),nt}setVisible(et){for(const nt of this)et?nt.layers.enable(0):nt.layers.disable(0);return this}},add_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",alpha_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",average_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",color_default="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);}",color_burn_default="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);}",color_dodge_default="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);}",darken_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",difference_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",divide_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",exclusion_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",hard_light_default="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);}",hard_mix_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",hue_default="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);}",invert_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",invert_rgb_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",lighten_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",linear_burn_default="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);}",linear_dodge_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",linear_light_default="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);}",luminosity_default="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);}",multiply_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",negation_default="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);}",normal_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",overlay_default="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);}",pin_light_default="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);}",reflect_default="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);}",saturation_default="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);}",screen_default="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);}",soft_light_default="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);}",src_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",subtract_default="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);}",vivid_light_default="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);}",blendFunctions=new Map([[BlendFunction.ADD,add_default],[BlendFunction.ALPHA,alpha_default],[BlendFunction.AVERAGE,average_default],[BlendFunction.COLOR,color_default],[BlendFunction.COLOR_BURN,color_burn_default],[BlendFunction.COLOR_DODGE,color_dodge_default],[BlendFunction.DARKEN,darken_default],[BlendFunction.DIFFERENCE,difference_default],[BlendFunction.DIVIDE,divide_default],[BlendFunction.DST,null],[BlendFunction.EXCLUSION,exclusion_default],[BlendFunction.HARD_LIGHT,hard_light_default],[BlendFunction.HARD_MIX,hard_mix_default],[BlendFunction.HUE,hue_default],[BlendFunction.INVERT,invert_default],[BlendFunction.INVERT_RGB,invert_rgb_default],[BlendFunction.LIGHTEN,lighten_default],[BlendFunction.LINEAR_BURN,linear_burn_default],[BlendFunction.LINEAR_DODGE,linear_dodge_default],[BlendFunction.LINEAR_LIGHT,linear_light_default],[BlendFunction.LUMINOSITY,luminosity_default],[BlendFunction.MULTIPLY,multiply_default],[BlendFunction.NEGATION,negation_default],[BlendFunction.NORMAL,normal_default],[BlendFunction.OVERLAY,overlay_default],[BlendFunction.PIN_LIGHT,pin_light_default],[BlendFunction.REFLECT,reflect_default],[BlendFunction.SATURATION,saturation_default],[BlendFunction.SCREEN,screen_default],[BlendFunction.SOFT_LIGHT,soft_light_default],[BlendFunction.SRC,src_default],[BlendFunction.SUBTRACT,subtract_default],[BlendFunction.VIVID_LIGHT,vivid_light_default]]),BlendMode=class extends EventDispatcher$1{constructor(tt,et=1){super(),this._blendFunction=tt,this.opacity=new Uniform(et)}getOpacity(){return this.opacity.value}setOpacity(tt){this.opacity.value=tt}get blendFunction(){return this._blendFunction}set blendFunction(tt){this._blendFunction=tt,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(tt){this.blendFunction=tt}getShaderCode(){return blendFunctions.get(this.blendFunction)}},Effect$1=class extends EventDispatcher$1{constructor(et,nt,{attributes:it=EffectAttribute.NONE,blendFunction:rt=BlendFunction.NORMAL,defines:ot=new Map,uniforms:at=new Map,extensions:st=null,vertexShader:lt=null}={}){super(),this.name=et,this.renderer=null,this.attributes=it,this.fragmentShader=nt,this.vertexShader=lt,this.defines=ot,this.uniforms=at,this.extensions=st,this.blendMode=new BlendMode(rt),this.blendMode.addEventListener("change",ct=>this.setChanged()),this._inputColorSpace=LinearSRGBColorSpace,this._outputColorSpace=NoColorSpace}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(et){this._inputColorSpace=et,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(et){this._outputColorSpace=et,this.setChanged()}set mainScene(et){}set mainCamera(et){}getName(){return this.name}setRenderer(et){this.renderer=et}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(et){this.attributes=et,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(et){this.fragmentShader=et,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(et){this.vertexShader=et,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(et,nt=BasicDepthPacking){}update(et,nt,it){}setSize(et,nt){}initialize(et,nt,it){}dispose(){for(const et of Object.keys(this)){const nt=this[et];(nt instanceof WebGLRenderTarget||nt instanceof Material||nt instanceof Texture||nt instanceof Pass)&&this[et].dispose()}}},bloom_default=`#ifdef FRAMEBUFFER_PRECISION_HIGH +#`));this.skipRendering=et===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(tt)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(tt,et=BasicDepthPacking){this.fullscreenMaterial.depthBuffer=tt,this.fullscreenMaterial.depthPacking=et;for(const nt of this.effects)nt.setDepthTexture(tt,et)}render(tt,et,nt,it,rt){for(const ot of this.effects)ot.update(tt,et,it);if(!this.skipRendering||this.renderToScreen){const ot=this.fullscreenMaterial;ot.inputBuffer=et.texture,ot.time+=it*this.timeScale,tt.setRenderTarget(this.renderToScreen?null:nt),tt.render(this.scene,this.camera)}}setSize(tt,et){this.fullscreenMaterial.setSize(tt,et);for(const nt of this.effects)nt.setSize(tt,et)}initialize(tt,et,nt){this.renderer=tt;for(const it of this.effects)it.initialize(tt,et,nt);this.updateMaterial(),nt!==void 0&&nt!==UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const tt of this.effects)tt.removeEventListener("change",this.listener),tt.dispose()}handleEvent(tt){switch(tt.type){case"change":this.recompile();break}}},KawaseBlurPass=class extends Pass{constructor({kernelSize:tt=KernelSize.MEDIUM,resolutionScale:et=.5,width:nt=Resolution.AUTO_SIZE,height:it=Resolution.AUTO_SIZE,resolutionX:rt=nt,resolutionY:ot=it}={}){super("KawaseBlurPass"),this.renderTargetA=new WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const at=this.resolution=new Resolution(this,rt,ot,et);at.addEventListener("change",st=>this.setSize(at.baseWidth,at.baseHeight)),this._blurMaterial=new KawaseBlurMaterial,this._blurMaterial.kernelSize=tt,this.copyMaterial=new CopyMaterial}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(tt){this._blurMaterial=tt}get dithering(){return this.copyMaterial.dithering}set dithering(tt){this.copyMaterial.dithering=tt}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(tt){this.blurMaterial.kernelSize=tt}get width(){return this.resolution.width}set width(tt){this.resolution.preferredWidth=tt}get height(){return this.resolution.height}set height(tt){this.resolution.preferredHeight=tt}get scale(){return this.blurMaterial.scale}set scale(tt){this.blurMaterial.scale=tt}getScale(){return this.blurMaterial.scale}setScale(tt){this.blurMaterial.scale=tt}getKernelSize(){return this.kernelSize}setKernelSize(tt){this.kernelSize=tt}getResolutionScale(){return this.resolution.scale}setResolutionScale(tt){this.resolution.scale=tt}render(tt,et,nt,it,rt){const ot=this.scene,at=this.camera,st=this.renderTargetA,lt=this.renderTargetB,ct=this.blurMaterial,ut=ct.kernelSequence;let ht=et;this.fullscreenMaterial=ct;for(let dt=0,pt=ut.length;dtthis.setSize(lt.baseWidth,lt.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(tt,et,nt,it,rt){const ot=this.fullscreenMaterial;ot.inputBuffer=et.texture,tt.setRenderTarget(this.renderToScreen?null:this.renderTarget),tt.render(this.scene,this.camera)}setSize(tt,et){const nt=this.resolution;nt.setBaseSize(tt,et),this.renderTarget.setSize(nt.width,nt.height)}initialize(tt,et,nt){nt!==void 0&&nt!==UnsignedByteType&&(this.renderTarget.texture.type=nt,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},MaskPass=class extends Pass{constructor(tt,et){super("MaskPass",tt,et),this.needsSwap=!1,this.clearPass=new ClearPass(!1,!1,!0),this.inverse=!1}set mainScene(tt){this.scene=tt}set mainCamera(tt){this.camera=tt}get inverted(){return this.inverse}set inverted(tt){this.inverse=tt}get clear(){return this.clearPass.enabled}set clear(tt){this.clearPass.enabled=tt}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(tt){this.inverted=tt}render(tt,et,nt,it,rt){const ot=tt.getContext(),at=tt.state.buffers,st=this.scene,lt=this.camera,ct=this.clearPass,ut=this.inverted?0:1,ht=1-ut;at.color.setMask(!1),at.depth.setMask(!1),at.color.setLocked(!0),at.depth.setLocked(!0),at.stencil.setTest(!0),at.stencil.setOp(ot.REPLACE,ot.REPLACE,ot.REPLACE),at.stencil.setFunc(ot.ALWAYS,ut,4294967295),at.stencil.setClear(ht),at.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?ct.render(tt,null):(ct.render(tt,et),ct.render(tt,nt))),this.renderToScreen?(tt.setRenderTarget(null),tt.render(st,lt)):(tt.setRenderTarget(et),tt.render(st,lt),tt.setRenderTarget(nt),tt.render(st,lt)),at.color.setLocked(!1),at.depth.setLocked(!1),at.stencil.setLocked(!1),at.stencil.setFunc(ot.EQUAL,1,4294967295),at.stencil.setOp(ot.KEEP,ot.KEEP,ot.KEEP),at.stencil.setLocked(!0)}},MipmapBlurPass=class extends Pass{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new WebGLRenderTarget(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new DownsamplingMaterial,this.upsamplingMaterial=new UpsamplingMaterial,this.resolution=new Vector2}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(tt){if(this.levels!==tt){const et=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let nt=0;nt=0;--dt){const pt=ut[dt];lt.setSize(ht.width,ht.height),lt.inputBuffer=ht.texture,lt.supportBuffer=ct[dt].texture,tt.setRenderTarget(pt),tt.render(ot,at),ht=pt}}setSize(tt,et){const nt=this.resolution;nt.set(tt,et);let it=nt.width,rt=nt.height;for(let ot=0,at=this.downsamplingMipmaps.length;otthis.setSize(ut.baseWidth,ut.baseHeight))}set mainScene(tt){this.renderPass.mainScene=tt}set mainCamera(tt){this.renderPass.mainCamera=tt}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(tt){this.resolution.scale=tt}render(tt,et,nt,it,rt){const ot=this.renderToScreen?null:this.renderTarget;this.renderPass.render(tt,ot,ot)}setSize(tt,et){const nt=this.resolution;nt.setBaseSize(tt,et),this.renderTarget.setSize(nt.width,nt.height)}},ShaderPass=class extends Pass{constructor(tt,et="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=tt,this.input=et}setInput(tt){this.input=tt}render(tt,et,nt,it,rt){const ot=this.fullscreenMaterial.uniforms;et!==null&&ot!==void 0&&ot[this.input]!==void 0&&(ot[this.input].value=et.texture),tt.setRenderTarget(this.renderToScreen?null:nt),tt.render(this.scene,this.camera)}initialize(tt,et,nt){nt!==void 0&&nt!==UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},MILLISECONDS_TO_SECONDS=1/1e3,SECONDS_TO_MILLISECONDS=1e3,Timer=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(tt){typeof document<"u"&&document.hidden!==void 0&&(tt?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=tt)}get delta(){return this._delta*MILLISECONDS_TO_SECONDS}get fixedDelta(){return this._fixedDelta*MILLISECONDS_TO_SECONDS}set fixedDelta(tt){this._fixedDelta=tt*SECONDS_TO_MILLISECONDS}get elapsed(){return this._elapsed*MILLISECONDS_TO_SECONDS}update(tt){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(tt!==void 0?tt: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(tt){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},EffectComposer$1=class{constructor(et=null,{depthBuffer:nt=!0,stencilBuffer:it=!1,multisampling:rt=0,frameBufferType:ot}={}){this.renderer=null,this.inputBuffer=this.createBuffer(nt,it,ot,rt),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new CopyPass,this.depthTexture=null,this.passes=[],this.timer=new Timer,this.autoRenderToScreen=!0,this.setRenderer(et)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(et){const nt=this.inputBuffer,it=this.multisampling;it>0&&et>0?(this.inputBuffer.samples=et,this.outputBuffer.samples=et,this.inputBuffer.dispose(),this.outputBuffer.dispose()):it!==et&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(nt.depthBuffer,nt.stencilBuffer,nt.texture.type,et),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(et){if(this.renderer=et,et!==null){const nt=et.getSize(new Vector2),it=et.getContext().getContextAttributes().alpha,rt=this.inputBuffer.texture.type;rt===UnsignedByteType&&getOutputColorSpace(et)===SRGBColorSpace&&(setTextureColorSpace(this.inputBuffer.texture,SRGBColorSpace),setTextureColorSpace(this.outputBuffer.texture,SRGBColorSpace),this.inputBuffer.dispose(),this.outputBuffer.dispose()),et.autoClear=!1,this.setSize(nt.width,nt.height);for(const ot of this.passes)ot.initialize(et,it,rt)}}replaceRenderer(et,nt=!0){const it=this.renderer,rt=it.domElement.parentNode;return this.setRenderer(et),nt&&rt!==null&&(rt.removeChild(it.domElement),rt.appendChild(et.domElement)),it}createDepthTexture(){const et=this.depthTexture=new DepthTexture;return this.inputBuffer.depthTexture=et,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(et.format=DepthStencilFormat,et.type=UnsignedInt248Type):et.type=UnsignedIntType,et}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const et of this.passes)et.setDepthTexture(null)}}createBuffer(et,nt,it,rt){const ot=this.renderer,at=ot===null?new Vector2:ot.getDrawingBufferSize(new Vector2),st={minFilter:LinearFilter,magFilter:LinearFilter,stencilBuffer:nt,depthBuffer:et,type:it},lt=new WebGLRenderTarget(at.width,at.height,st);return rt>0&&(lt.ignoreDepthForMultisampleCopy=!1,lt.samples=rt),it===UnsignedByteType&&getOutputColorSpace(ot)===SRGBColorSpace&&setTextureColorSpace(lt.texture,SRGBColorSpace),lt.texture.name="EffectComposer.Buffer",lt.texture.generateMipmaps=!1,lt}setMainScene(et){for(const nt of this.passes)nt.mainScene=et}setMainCamera(et){for(const nt of this.passes)nt.mainCamera=et}addPass(et,nt){const it=this.passes,rt=this.renderer,ot=rt.getDrawingBufferSize(new Vector2),at=rt.getContext().getContextAttributes().alpha,st=this.inputBuffer.texture.type;if(et.setRenderer(rt),et.setSize(ot.width,ot.height),et.initialize(rt,at,st),this.autoRenderToScreen&&(it.length>0&&(it[it.length-1].renderToScreen=!1),et.renderToScreen&&(this.autoRenderToScreen=!1)),nt!==void 0?it.splice(nt,0,et):it.push(et),this.autoRenderToScreen&&(it[it.length-1].renderToScreen=!0),et.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const lt=this.createDepthTexture();for(et of it)et.setDepthTexture(lt)}else et.setDepthTexture(this.depthTexture)}removePass(et){const nt=this.passes,it=nt.indexOf(et);if(it!==-1&&nt.splice(it,1).length>0){if(this.depthTexture!==null){const at=(lt,ct)=>lt||ct.needsDepthTexture;nt.reduce(at,!1)||(et.getDepthTexture()===this.depthTexture&&et.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&it===nt.length&&(et.renderToScreen=!1,nt.length>0&&(nt[nt.length-1].renderToScreen=!0))}}removeAllPasses(){const et=this.passes;this.deleteDepthTexture(),et.length>0&&(this.autoRenderToScreen&&(et[et.length-1].renderToScreen=!1),this.passes=[])}render(et){const nt=this.renderer,it=this.copyPass;let rt=this.inputBuffer,ot=this.outputBuffer,at=!1,st,lt,ct;et===void 0&&(this.timer.update(),et=this.timer.delta);for(const ut of this.passes)ut.enabled&&(ut.render(nt,rt,ot,et,at),ut.needsSwap&&(at&&(it.renderToScreen=ut.renderToScreen,st=nt.getContext(),lt=nt.state.buffers.stencil,lt.setFunc(st.NOTEQUAL,1,4294967295),it.render(nt,rt,ot,et,at),lt.setFunc(st.EQUAL,1,4294967295)),ct=rt,rt=ot,ot=ct),ut instanceof MaskPass?at=!0:ut instanceof ClearMaskPass&&(at=!1))}setSize(et,nt,it){const rt=this.renderer,ot=rt.getSize(new Vector2);(et===void 0||nt===void 0)&&(et=ot.width,nt=ot.height),(ot.width!==et||ot.height!==nt)&&rt.setSize(et,nt,it);const at=rt.getDrawingBufferSize(new Vector2);this.inputBuffer.setSize(at.width,at.height),this.outputBuffer.setSize(at.width,at.height);for(const st of this.passes)st.setSize(at.width,at.height)}reset(){const et=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=et}dispose(){for(const et of this.passes)et.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},EffectShaderData=class{constructor(){this.shaderParts=new Map([[EffectShaderSection.FRAGMENT_HEAD,null],[EffectShaderSection.FRAGMENT_MAIN_UV,null],[EffectShaderSection.FRAGMENT_MAIN_IMAGE,null],[EffectShaderSection.VERTEX_HEAD,null],[EffectShaderSection.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=EffectAttribute.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=LinearSRGBColorSpace}},workaroundEnabled=!1,OverrideMaterialManager=class{constructor(tt=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(tt),this.meshCount=0,this.replaceMaterial=et=>{if(et.isMesh){let nt;if(et.material.flatShading)switch(et.material.side){case DoubleSide:nt=this.materialsFlatShadedDoubleSide;break;case BackSide:nt=this.materialsFlatShadedBackSide;break;default:nt=this.materialsFlatShaded;break}else switch(et.material.side){case DoubleSide:nt=this.materialsDoubleSide;break;case BackSide:nt=this.materialsBackSide;break;default:nt=this.materials;break}this.originalMaterials.set(et,et.material),et.isSkinnedMesh?et.material=nt[2]:et.isInstancedMesh?et.material=nt[1]:et.material=nt[0],++this.meshCount}}}cloneMaterial(tt){if(!(tt instanceof ShaderMaterial))return tt.clone();const et=tt.uniforms,nt=new Map;for(const rt in et){const ot=et[rt].value;ot.isRenderTargetTexture&&(et[rt].value=null,nt.set(rt,ot))}const it=tt.clone();for(const rt of nt)et[rt[0]].value=rt[1],it.uniforms[rt[0]].value=rt[1];return it}setMaterial(tt){if(this.disposeMaterials(),this.material=tt,tt!==null){const et=this.materials=[this.cloneMaterial(tt),this.cloneMaterial(tt),this.cloneMaterial(tt)];for(const nt of et)nt.uniforms=Object.assign({},tt.uniforms),nt.side=FrontSide;et[2].skinning=!0,this.materialsBackSide=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.side=BackSide,it}),this.materialsDoubleSide=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.side=DoubleSide,it}),this.materialsFlatShaded=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.flatShading=!0,it}),this.materialsFlatShadedBackSide=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.flatShading=!0,it.side=BackSide,it}),this.materialsFlatShadedDoubleSide=et.map(nt=>{const it=this.cloneMaterial(nt);return it.uniforms=Object.assign({},tt.uniforms),it.flatShading=!0,it.side=DoubleSide,it})}}render(tt,et,nt){const it=tt.shadowMap.enabled;if(tt.shadowMap.enabled=!1,workaroundEnabled){const rt=this.originalMaterials;this.meshCount=0,et.traverse(this.replaceMaterial),tt.render(et,nt);for(const ot of rt)ot[0].material=ot[1];this.meshCount!==rt.size&&rt.clear()}else{const rt=et.overrideMaterial;et.overrideMaterial=this.material,tt.render(et,nt),et.overrideMaterial=rt}tt.shadowMap.enabled=it}disposeMaterials(){if(this.material!==null){const tt=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const et of tt)et.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return workaroundEnabled}static set workaroundEnabled(tt){workaroundEnabled=tt}},AUTO_SIZE=-1,Resolution=class extends EventDispatcher$1{constructor(tt,et=AUTO_SIZE,nt=AUTO_SIZE,it=1){super(),this.resizable=tt,this.baseSize=new Vector2(1,1),this.preferredSize=new Vector2(et,nt),this.target=this.preferredSize,this.s=it,this.effectiveSize=new Vector2,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const tt=this.baseSize,et=this.preferredSize,nt=this.effectiveSize,it=this.scale;et.width!==AUTO_SIZE?nt.width=et.width:et.height!==AUTO_SIZE?nt.width=Math.round(et.height*(tt.width/Math.max(tt.height,1))):nt.width=Math.round(tt.width*it),et.height!==AUTO_SIZE?nt.height=et.height:et.width!==AUTO_SIZE?nt.height=Math.round(et.width/Math.max(tt.width/Math.max(tt.height,1),1)):nt.height=Math.round(tt.height*it)}get width(){return this.effectiveSize.width}set width(tt){this.preferredWidth=tt}get height(){return this.effectiveSize.height}set height(tt){this.preferredHeight=tt}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(tt){this.s!==tt&&(this.s=tt,this.preferredSize.setScalar(AUTO_SIZE),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(tt){this.scale=tt}get baseWidth(){return this.baseSize.width}set baseWidth(tt){this.baseSize.width!==tt&&(this.baseSize.width=tt,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(tt){this.baseWidth=tt}get baseHeight(){return this.baseSize.height}set baseHeight(tt){this.baseSize.height!==tt&&(this.baseSize.height=tt,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(tt){this.baseHeight=tt}setBaseSize(tt,et){(this.baseSize.width!==tt||this.baseSize.height!==et)&&(this.baseSize.set(tt,et),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(tt){this.preferredSize.width!==tt&&(this.preferredSize.width=tt,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(tt){this.preferredWidth=tt}get preferredHeight(){return this.preferredSize.height}set preferredHeight(tt){this.preferredSize.height!==tt&&(this.preferredSize.height=tt,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(tt){this.preferredHeight=tt}setPreferredSize(tt,et){(this.preferredSize.width!==tt||this.preferredSize.height!==et)&&(this.preferredSize.set(tt,et),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(tt){this.s=tt.scale,this.baseSize.set(tt.baseWidth,tt.baseHeight),this.preferredSize.set(tt.preferredWidth,tt.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return AUTO_SIZE}},Selection$2=class extends Set{constructor(et,nt=10){super(),this.l=nt,this.exclusive=!1,et!==void 0&&this.set(et)}get layer(){return this.l}set layer(et){const nt=this.l;for(const it of this)it.layers.disable(nt),it.layers.enable(et);this.l=et}getLayer(){return this.layer}setLayer(et){this.layer=et}isExclusive(){return this.exclusive}setExclusive(et){this.exclusive=et}clear(){const et=this.layer;for(const nt of this)nt.layers.disable(et);return super.clear()}set(et){this.clear();for(const nt of et)this.add(nt);return this}indexOf(et){return this.has(et)?0:-1}add(et){return this.exclusive?et.layers.set(this.layer):et.layers.enable(this.layer),super.add(et)}delete(et){return this.has(et)&&et.layers.disable(this.layer),super.delete(et)}toggle(et){let nt;return this.has(et)?(this.delete(et),nt=!1):(this.add(et),nt=!0),nt}setVisible(et){for(const nt of this)et?nt.layers.enable(0):nt.layers.disable(0);return this}},add_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",alpha_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",average_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",color_default="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);}",color_burn_default="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);}",color_dodge_default="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);}",darken_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",difference_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",divide_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",exclusion_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",hard_light_default="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);}",hard_mix_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",hue_default="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);}",invert_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",invert_rgb_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",lighten_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",linear_burn_default="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);}",linear_dodge_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",linear_light_default="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);}",luminosity_default="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);}",multiply_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",negation_default="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);}",normal_default="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",overlay_default="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);}",pin_light_default="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);}",reflect_default="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);}",saturation_default="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);}",screen_default="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);}",soft_light_default="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);}",src_default$1="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",subtract_default="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);}",vivid_light_default="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);}",blendFunctions=new Map([[BlendFunction.ADD,add_default],[BlendFunction.ALPHA,alpha_default],[BlendFunction.AVERAGE,average_default],[BlendFunction.COLOR,color_default],[BlendFunction.COLOR_BURN,color_burn_default],[BlendFunction.COLOR_DODGE,color_dodge_default],[BlendFunction.DARKEN,darken_default],[BlendFunction.DIFFERENCE,difference_default],[BlendFunction.DIVIDE,divide_default],[BlendFunction.DST,null],[BlendFunction.EXCLUSION,exclusion_default],[BlendFunction.HARD_LIGHT,hard_light_default],[BlendFunction.HARD_MIX,hard_mix_default],[BlendFunction.HUE,hue_default],[BlendFunction.INVERT,invert_default],[BlendFunction.INVERT_RGB,invert_rgb_default],[BlendFunction.LIGHTEN,lighten_default],[BlendFunction.LINEAR_BURN,linear_burn_default],[BlendFunction.LINEAR_DODGE,linear_dodge_default],[BlendFunction.LINEAR_LIGHT,linear_light_default],[BlendFunction.LUMINOSITY,luminosity_default],[BlendFunction.MULTIPLY,multiply_default],[BlendFunction.NEGATION,negation_default],[BlendFunction.NORMAL,normal_default],[BlendFunction.OVERLAY,overlay_default],[BlendFunction.PIN_LIGHT,pin_light_default],[BlendFunction.REFLECT,reflect_default],[BlendFunction.SATURATION,saturation_default],[BlendFunction.SCREEN,screen_default],[BlendFunction.SOFT_LIGHT,soft_light_default],[BlendFunction.SRC,src_default$1],[BlendFunction.SUBTRACT,subtract_default],[BlendFunction.VIVID_LIGHT,vivid_light_default]]),BlendMode=class extends EventDispatcher$1{constructor(tt,et=1){super(),this._blendFunction=tt,this.opacity=new Uniform(et)}getOpacity(){return this.opacity.value}setOpacity(tt){this.opacity.value=tt}get blendFunction(){return this._blendFunction}set blendFunction(tt){this._blendFunction=tt,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(tt){this.blendFunction=tt}getShaderCode(){return blendFunctions.get(this.blendFunction)}},Effect$1=class extends EventDispatcher$1{constructor(et,nt,{attributes:it=EffectAttribute.NONE,blendFunction:rt=BlendFunction.NORMAL,defines:ot=new Map,uniforms:at=new Map,extensions:st=null,vertexShader:lt=null}={}){super(),this.name=et,this.renderer=null,this.attributes=it,this.fragmentShader=nt,this.vertexShader=lt,this.defines=ot,this.uniforms=at,this.extensions=st,this.blendMode=new BlendMode(rt),this.blendMode.addEventListener("change",ct=>this.setChanged()),this._inputColorSpace=LinearSRGBColorSpace,this._outputColorSpace=NoColorSpace}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(et){this._inputColorSpace=et,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(et){this._outputColorSpace=et,this.setChanged()}set mainScene(et){}set mainCamera(et){}getName(){return this.name}setRenderer(et){this.renderer=et}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(et){this.attributes=et,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(et){this.fragmentShader=et,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(et){this.vertexShader=et,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(et,nt=BasicDepthPacking){}update(et,nt,it){}setSize(et,nt){}initialize(et,nt,it){}dispose(){for(const et of Object.keys(this)){const nt=this[et];(nt instanceof WebGLRenderTarget||nt instanceof Material||nt instanceof Texture||nt instanceof Pass)&&this[et].dispose()}}},bloom_default=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D map; #else uniform lowp sampler2D map; @@ -4764,27 +4764,27 @@ float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offse #else vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); #endif -outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{constructor({blendFunction:tt,technique:et=VignetteTechnique.DEFAULT,eskil:nt=!1,offset:it=.5,darkness:rt=.5}={}){super("VignetteEffect",vignette_default,{blendFunction:tt,defines:new Map([["VIGNETTE_TECHNIQUE",et.toFixed(0)]]),uniforms:new Map([["offset",new Uniform(it)],["darkness",new Uniform(rt)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(tt){this.technique!==tt&&(this.defines.set("VIGNETTE_TECHNIQUE",tt.toFixed(0)),this.setChanged())}get eskil(){return this.technique===VignetteTechnique.ESKIL}set eskil(tt){this.technique=tt?VignetteTechnique.ESKIL:VignetteTechnique.DEFAULT}getTechnique(){return this.technique}setTechnique(tt){this.technique=tt}get offset(){return this.uniforms.get("offset").value}set offset(tt){this.uniforms.get("offset").value=tt}getOffset(){return this.offset}setOffset(tt){this.offset=tt}get darkness(){return this.uniforms.get("darkness").value}set darkness(tt){this.uniforms.get("darkness").value=tt}getDarkness(){return this.darkness}setDarkness(tt){this.darkness=tt}};const EffectComposerContext=reactExports.createContext(null),isConvolution=tt=>(tt.getAttributes()&EffectAttribute.CONVOLUTION)===EffectAttribute.CONVOLUTION,EffectComposer=React$1.memo(reactExports.forwardRef(({children:tt,camera:et,scene:nt,resolutionScale:it,enabled:rt=!0,renderPriority:ot=1,autoClear:at=!0,depthBuffer:st,disableNormalPass:lt,stencilBuffer:ct,multisampling:ut=8,frameBufferType:ht=HalfFloatType},dt)=>{const{gl:pt,scene:mt,camera:gt,size:bt}=useThree(),yt=nt||mt,wt=et||gt,[vt,xt,St]=reactExports.useMemo(()=>{const $t=isWebGL2Available(),Ut=new EffectComposer$1(pt,{depthBuffer:st,stencilBuffer:ct,multisampling:ut>0&&$t?ut:0,frameBufferType:ht});Ut.addPass(new RenderPass(yt,wt));let Lt=null,Bt=null;return lt||(Bt=new NormalPass(yt,wt),Bt.enabled=!1,Ut.addPass(Bt),it!==void 0&&$t&&(Lt=new DepthDownsamplingPass({normalBuffer:Bt.texture,resolutionScale:it}),Lt.enabled=!1,Ut.addPass(Lt))),[Ut,Bt,Lt]},[wt,pt,st,ct,ut,ht,yt,lt,it]);reactExports.useEffect(()=>vt==null?void 0:vt.setSize(bt.width,bt.height),[vt,bt]),useFrame(($t,Ut)=>{if(rt){const Lt=pt.autoClear;pt.autoClear=at,ct&&!at&&pt.clearStencil(),vt.render(Ut),pt.autoClear=Lt}},rt?ot:0);const Et=reactExports.useRef(null),It=useInstanceHandle(Et);reactExports.useLayoutEffect(()=>{const $t=[];if(Et.current&&It.current&&vt){const Ut=It.current.objects;for(let Lt=0;Lt{for(const Ut of $t)vt==null||vt.removePass(Ut);xt&&(xt.enabled=!1),St&&(St.enabled=!1)}},[vt,tt,wt,xt,St,It]);const Tt=reactExports.useMemo(()=>({composer:vt,normalPass:xt,downSamplingPass:St,resolutionScale:it,camera:wt,scene:yt}),[vt,xt,St,it,wt,yt]);return reactExports.useImperativeHandle(dt,()=>vt,[vt]),jsxRuntimeExports.jsx(EffectComposerContext.Provider,{value:Tt,children:jsxRuntimeExports.jsx("group",{ref:Et,children:tt})})})),resolveRef=tt=>typeof tt=="object"&&tt!=null&&"current"in tt?tt.current:tt;let i$2=0;const components=new WeakMap,wrapEffect=(tt,et)=>React$1.forwardRef(function({blendFunction:it=et==null?void 0:et.blendFunction,opacity:rt=et==null?void 0:et.opacity,...ot},at){let st=components.get(tt);if(!st){const ut=`@react-three/postprocessing/${tt.name}-${i$2++}`;extend$3({[ut]:tt}),components.set(tt,st=ut)}const lt=useThree(ut=>ut.camera),ct=React$1.useMemo(()=>{var ut,ht;return[...(ut=et==null?void 0:et.args)!=null?ut:[],...(ht=ot.args)!=null?ht:[{...et,...ot}]]},[JSON.stringify(ot)]);return jsxRuntimeExports.jsx(st,{camera:lt,"blendMode-blendFunction":it,"blendMode-opacity-value":rt,...ot,ref:at,args:ct})}),Bloom=wrapEffect(BloomEffect,{blendFunction:BlendFunction.ADD}),Outline=reactExports.forwardRef(function tt({selection:et=[],selectionLayer:nt=10,blendFunction:it,patternTexture:rt,edgeStrength:ot,pulseSpeed:at,visibleEdgeColor:st,hiddenEdgeColor:lt,width:ct,height:ut,kernelSize:ht,blur:dt,xRay:pt,...mt},gt){const bt=useThree(St=>St.invalidate),{scene:yt,camera:wt}=reactExports.useContext(EffectComposerContext),vt=reactExports.useMemo(()=>new OutlineEffect(yt,wt,{blendFunction:it,patternTexture:rt,edgeStrength:ot,pulseSpeed:at,visibleEdgeColor:st,hiddenEdgeColor:lt,width:ct,height:ut,kernelSize:ht,blur:dt,xRay:pt,...mt}),[it,dt,wt,ot,ut,lt,ht,rt,at,yt,st,ct,pt]),xt=reactExports.useContext(selectionContext);return reactExports.useEffect(()=>{if(!xt&&et)return vt.selection.set(Array.isArray(et)?et.map(resolveRef):[resolveRef(et)]),bt(),()=>{vt.selection.clear(),bt()}},[vt,et,xt,bt]),reactExports.useEffect(()=>{vt.selectionLayer=nt,bt()},[vt,bt,nt]),reactExports.useRef(),reactExports.useEffect(()=>{var St;if(xt&&xt.enabled&&(St=xt.selected)!=null&&St.length)return vt.selection.set(xt.selected),bt(),()=>{vt.selection.clear(),bt()}},[xt,vt.selection,bt]),reactExports.useEffect(()=>()=>{vt.dispose()},[vt]),jsxRuntimeExports.jsx("primitive",{ref:gt,object:vt})}),Vignette=wrapEffect(VignetteEffect);function _objectWithoutPropertiesLoose$l(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var _excluded$1$2=["color"],ActivityLogIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$1$2);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$o=["color"],BarChartIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$o);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$H=["color"],ButtonIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$1w=["color"],CubeIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$1w);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$1H=["color"],DotIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$1H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$1W=["color"],DropdownMenuIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$1W);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$25=["color"],EyeNoneIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$25);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$26=["color"],EyeOpenIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$26);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$2C=["color"],ImageIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$2C);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$2H=["color"],LapTimerIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$2H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$2J=["color"],LayersIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$2J);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$2Q=["color"],LightningBoltIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$2Q);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$34=["color"],MarginIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$34);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$37=["color"],MinusIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$37);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$3m=["color"],PauseIcon$1=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$3m);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$3H=["color"],RocketIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$3H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$3L=["color"],RulerHorizontalIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$3L);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$4q=["color"],TextAlignJustifyIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$4q);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$4H=["color"],TriangleDownIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$4H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:it}))}),_excluded$4K=["color"],TriangleUpIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$4K);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:it}))}),_excluded$4R=["color"],VercelLogoIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$4R);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))});function _toPrimitive$D(tt,et){if(typeof tt!="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(typeof it!="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function _toPropertyKey$D(tt){var et=_toPrimitive$D(tt,"string");return typeof et=="symbol"?et:String(et)}function _defineProperty$D(tt,et,nt){return et=_toPropertyKey$D(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$B(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread2(tt){for(var et=1;et(tt==null?void 0:tt.reduce((et,nt)=>et+nt,0))/tt.length;class GLPerf{constructor(et={}){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,et),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=MathUtils.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 et=0;const nt=it=>{++et<20?this.rafId=window.requestAnimationFrame(nt):(this.detected=Math.ceil(1e3*et/(it-this.t0)/70),window.cancelAnimationFrame(this.rafId)),this.t0||(this.t0=it)};this.rafId=window.requestAnimationFrame(nt)}addUI(et){this.names.indexOf(et)===-1&&(this.names.push(et),this.gpuAccums.push(0),this.activeAccums.push(!1))}nextFps(et){const nt=16.666666666666668,it=nt-et.timeRemaining(),rt=nt*overLimitFps.fpsLimit/10/it;rt<0||(overLimitFps.value=rt,overLimitFps.isOverLimit<25?overLimitFps.isOverLimit++:usePerfStore.setState({overclockingFps:!0}))}nextFrame(et){this.frameId++;const nt=et||this.now();let it=nt-this.paramTime,rt=0;if(this.frameId<=1)this.paramFrame=this.frameId,this.paramTime=nt;else if(nt>=this.paramTime){this.maxMemory=window.performance.memory?window.performance.memory.jsHeapSizeLimit/1048576:0;const ot=this.frameId-this.paramFrame,at=ot*1e3/it,st=usePerfStore.getState().overclockingFps?overLimitFps.value:at;if(rt=this.isWebGL2?this.gpuAccums[0]:this.gpuAccums[0]/it,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 lt=performance.measure("cpu-duration","cpu-started","cpu-finished");this.currentCpu=lt.duration,this.logsAccums.cpu.push(this.currentCpu),this.startCpuProfiling=!1}this.logsAccums.mem.push(this.currentMem),this.logsAccums.fpsFixed.push(at),this.logsAccums.fps.push(st),this.logsAccums.gpu.push(rt),this.overClock&&typeof window.requestIdleCallback<"u"&&(overLimitFps.isOverLimit>0&&st>at?overLimitFps.isOverLimit--:usePerfStore.getState().overclockingFps&&usePerfStore.setState({overclockingFps:!1})),nt>=this.paramTime+180&&(this.paramLogger({cpu:average(this.logsAccums.cpu),gpu:average(this.logsAccums.gpu),mem:average(this.logsAccums.mem),fps:average(this.logsAccums.fps),duration:Math.round(it),maxMemory:this.maxMemory,frameCount:ot}),this.logsAccums.mem=[],this.logsAccums.fps=[],this.logsAccums.gpu=[],this.logsAccums.cpu=[],this.paramFrame=this.frameId,this.paramTime=nt),this.overClock&&nt-this.lastCalculateFixed>=2*1e3&&(this.lastCalculateFixed=et,overLimitFps.fpsLimit=Math.round(average(this.logsAccums.fpsFixed)/10)*100,usePerfStore.setState({fpsLimit:overLimitFps.fpsLimit/10}),this.logsAccums.fpsFixed=[],this.paramFrame=this.frameId,this.paramTime=nt)}if(!this.detected||!this.chartFrame)this.chartFrame=this.frameId,this.chartTime=nt,this.circularId=0;else{const ot=nt-this.chartTime;let at=this.chartHz*ot/1e3;for(;--at>0&&this.detected;){const lt=(this.frameId-this.chartFrame)/ot*1e3,ct=usePerfStore.getState().overclockingFps?overLimitFps.value:lt;this.fpsChart[this.circularId%this.chartLen]=ct;const ut=1e3/this.currentMem,ht=this.currentCpu,dt=(this.isWebGL2?this.gpuAccums[1]*2:Math.round(this.gpuAccums[1]/it*100))+4;dt>0&&(this.gpuChart[this.circularId%this.chartLen]=dt),ht>0&&(this.cpuChart[this.circularId%this.chartLen]=ht),ut>0&&(this.memChart[this.circularId%this.chartLen]=ut);for(let pt=0;pt0&&(rt||this.activeAccums.forEach((lt,ct)=>{this.gpuAccums[ct]=st}))}}(it||!this.query)&&(this.queryCreated=!0,this.query=et.createQuery(),et.beginQuery(nt.TIME_ELAPSED_EXT,this.query))}}endGpu(){const et=this.extension,nt=this.gl;this.isWebGL2&&this.queryCreated&&nt.getQuery(et.TIME_ELAPSED_EXT,nt.CURRENT_QUERY)&&nt.endQuery(et.TIME_ELAPSED_EXT)}begin(et){this.startGpu(),this.updateAccums(et)}end(et){this.endGpu(),this.updateAccums(et)}updateAccums(et){let nt=this.names.indexOf(et);nt===-1&&(nt=this.names.length,this.addUI(et));const it=this.now();this.activeAccums[nt]=!this.activeAccums[nt],this.t0=it}}const countGeoDrawCalls=tt=>{tt.forEach((et,nt)=>{const{meshes:it}=et;if(!it)return;let rt={total:0,type:"Triangle",data:[]};Object.keys(it).forEach(ot=>{const at=it[ot],{geometry:st,material:lt}=at;let ct=st.index;const ut=st.attributes.position;if(!ut)return;let ht=1;lt.wireframe===!0&&(ht=0);const dt=ct!==null?ct.count:ut.count,pt=st.drawRange.start*ht,mt=st.drawRange.count*ht,gt=pt,bt=Math.min(dt,pt+mt)-1;let yt=1;const wt=at.count||1;let vt="Triangle",xt=0;at.isMesh?lt.wireframe===!0?(vt="Line",yt=yt/2):(vt="Triangle",yt=yt/3):at.isLine?(vt="Line",at.isLineSegments?yt=yt/2:at.isLineLoop?yt=yt:yt=yt-1):at.isPoints?(vt="Point",yt=yt):at.isSprite&&(vt="Triangle",yt=yt/3);const St=Math.round(Math.max(0,bt-gt+1)*(yt*wt));St>xt&&(xt=St,rt.type=vt),rt.total+=St,rt.data.push({drawCount:St,type:vt}),at.userData.drawCount={type:vt,count:St}}),et.drawCounts=rt})},updateMatrixWorldTemp=Object3D.prototype.updateMatrixWorld,updateWorldMatrixTemp=Object3D.prototype.updateWorldMatrix,updateMatrixTemp=Object3D.prototype.updateMatrix;let matriceWorldCount={value:0},matriceCount={value:0};const isUUID=tt=>{let et=""+tt;return et=et.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}$"),et!==null},addMuiPerfID=(tt,et)=>{tt.defines||(tt.defines={}),tt.defines&&!tt.defines.muiPerf&&(tt.defines=Object.assign(tt.defines||{},{muiPerf:tt.uuid}));const nt=tt.uuid;return et[nt]||(et[nt]={meshes:{},material:tt},tt.needsUpdate=!0),tt.needsUpdate=!1,nt},getMUIIndex=tt=>tt==="muiPerf",usePerfStore=react(tt=>({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"})),Headless=({trackCPU:tt,overClock:et,chart:nt,deepAnalyze:it,matrixUpdate:rt})=>{const{gl:ot,scene:at}=useThree();usePerfStore.setState({gl:ot,scene:at});const st=reactExports.useMemo(()=>{const lt=new GLPerf({trackGPU:!0,overClock:et,chartLen:nt?nt.length:120,chartHz:nt?nt.hz:60,gl:ot.getContext(),chartLogger:ht=>{usePerfStore.setState({chart:ht})},paramLogger:ht=>{usePerfStore.setState({log:{maxMemory:ht.maxMemory,gpu:ht.gpu,cpu:ht.cpu,mem:ht.mem,fps:ht.fps,totalTime:ht.duration,frameCount:ht.frameCount}})}}),ct=new Map,ut=new Map;return Object.defineProperty(Scene.prototype,"onBeforeRender",{get(){return(...ht)=>{var dt;lt&<.begin("profiler"),(dt=ct.get(this))===null||dt===void 0||dt(...ht)}},set(ht){ct.set(this,ht)},configurable:!0}),Object.defineProperty(Scene.prototype,"onAfterRender",{get(){return(...ht)=>{var dt;lt&<.end("profiler"),(dt=ut.get(this))===null||dt===void 0||dt(...ht)}},set(ht){ut.set(this,ht)},configurable:!0}),lt},[]);return reactExports.useEffect(()=>{st&&(st.overClock=et||!1,et===!1&&(usePerfStore.setState({overclockingFps:!1}),overLimitFps.value=0,overLimitFps.isOverLimit=0),st.chartHz=(nt==null?void 0:nt.hz)||60,st.chartLen=(nt==null?void 0:nt.length)||120)},[et,st,nt==null?void 0:nt.length,nt==null?void 0:nt.hz]),reactExports.useEffect(()=>{rt&&(Object3D.prototype.updateMatrixWorld=function(){(this.matrixWorldNeedsUpdate||arguments[0])&&matriceWorldCount.value++,updateMatrixWorldTemp.apply(this,arguments)},Object3D.prototype.updateWorldMatrix=function(){matriceWorldCount.value++,updateWorldMatrixTemp.apply(this,arguments)},Object3D.prototype.updateMatrix=function(){matriceCount.value++,updateMatrixTemp.apply(this,arguments)}),ot.info.autoReset=!1;let lt=null,ct=null;if(ot.info)return lt=addEffect(function(){usePerfStore.getState().paused&&usePerfStore.setState({paused:!1}),window.performance&&(window.performance.mark("cpu-started"),st.startCpuProfiling=!0),matriceCount.value-=1,matriceWorldCount.value=0,matriceCount.value=0,ot.info&&ot.info.reset()}),ct=addAfterEffect(function(){if(st&&!st.paused&&(st.nextFrame(window.performance.now()),et&&typeof window.requestIdleCallback<"u"&&(st.idleCbId=requestIdleCallback(st.nextFps))),it){var ht,dt;const pt={},mt=new Map;at.traverse(function(bt){if((bt instanceof Mesh||bt instanceof Points)&&bt.material){let yt=bt.material.uuid;Array.isArray(bt.material)&&bt.material.length>1?yt=addMuiPerfID(bt.material[1],pt):yt=addMuiPerfID(bt.material,pt),pt[yt].meshes[bt.uuid]=bt}}),ot==null||(ht=ot.info)===null||ht===void 0||(dt=ht.programs)===null||dt===void 0||dt.forEach(gt=>{const bt=gt.cacheKey.split(","),yt=bt[bt.findIndex(getMUIIndex)+1];if(isUUID(yt)&&pt[yt]){const{material:wt,meshes:vt}=pt[yt];mt.set(yt,{program:gt,material:wt,meshes:vt,drawCounts:{total:0,type:"triangle",data:[]},expand:!1,visible:!0})}}),mt.size!==usePerfStore.getState().programs.size&&(countGeoDrawCalls(mt),usePerfStore.setState({programs:mt,triggerProgramsUpdate:usePerfStore.getState().triggerProgramsUpdate++}))}}),()=>{st&&(typeof window.cancelIdleCallback<"u"&&window.cancelIdleCallback(st.idleCbId),window.cancelAnimationFrame(st.rafId),window.cancelAnimationFrame(st.checkQueryId)),rt&&(Object3D.prototype.updateMatrixWorld=updateMatrixTemp),lt(),ct()}},[st,ot,tt,nt,rt]),reactExports.useEffect(()=>{const lt=addTail(function(){return st&&(st.paused=!0,matriceCount.value=0,matriceWorldCount.value=0,usePerfStore.setState({paused:!0,log:{maxMemory:0,gpu:0,mem:0,cpu:0,fps:0,totalTime:0,frameCount:0}})),!1});return()=>{lt()}},[]),null},PerfS=re$5("div",{position:"fixed",top:0,right:0,zIndex:9999,fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', +outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{constructor({blendFunction:tt,technique:et=VignetteTechnique.DEFAULT,eskil:nt=!1,offset:it=.5,darkness:rt=.5}={}){super("VignetteEffect",vignette_default,{blendFunction:tt,defines:new Map([["VIGNETTE_TECHNIQUE",et.toFixed(0)]]),uniforms:new Map([["offset",new Uniform(it)],["darkness",new Uniform(rt)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(tt){this.technique!==tt&&(this.defines.set("VIGNETTE_TECHNIQUE",tt.toFixed(0)),this.setChanged())}get eskil(){return this.technique===VignetteTechnique.ESKIL}set eskil(tt){this.technique=tt?VignetteTechnique.ESKIL:VignetteTechnique.DEFAULT}getTechnique(){return this.technique}setTechnique(tt){this.technique=tt}get offset(){return this.uniforms.get("offset").value}set offset(tt){this.uniforms.get("offset").value=tt}getOffset(){return this.offset}setOffset(tt){this.offset=tt}get darkness(){return this.uniforms.get("darkness").value}set darkness(tt){this.uniforms.get("darkness").value=tt}getDarkness(){return this.darkness}setDarkness(tt){this.darkness=tt}};const EffectComposerContext=reactExports.createContext(null),isConvolution=tt=>(tt.getAttributes()&EffectAttribute.CONVOLUTION)===EffectAttribute.CONVOLUTION,EffectComposer=React$1.memo(reactExports.forwardRef(({children:tt,camera:et,scene:nt,resolutionScale:it,enabled:rt=!0,renderPriority:ot=1,autoClear:at=!0,depthBuffer:st,disableNormalPass:lt,stencilBuffer:ct,multisampling:ut=8,frameBufferType:ht=HalfFloatType},dt)=>{const{gl:pt,scene:mt,camera:gt,size:bt}=useThree(),yt=nt||mt,wt=et||gt,[vt,xt,St]=reactExports.useMemo(()=>{const Ft=isWebGL2Available(),Ht=new EffectComposer$1(pt,{depthBuffer:st,stencilBuffer:ct,multisampling:ut>0&&Ft?ut:0,frameBufferType:ht});Ht.addPass(new RenderPass(yt,wt));let zt=null,Ot=null;return lt||(Ot=new NormalPass(yt,wt),Ot.enabled=!1,Ht.addPass(Ot),it!==void 0&&Ft&&(zt=new DepthDownsamplingPass({normalBuffer:Ot.texture,resolutionScale:it}),zt.enabled=!1,Ht.addPass(zt))),[Ht,Ot,zt]},[wt,pt,st,ct,ut,ht,yt,lt,it]);reactExports.useEffect(()=>vt==null?void 0:vt.setSize(bt.width,bt.height),[vt,bt]),useFrame((Ft,Ht)=>{if(rt){const zt=pt.autoClear;pt.autoClear=at,ct&&!at&&pt.clearStencil(),vt.render(Ht),pt.autoClear=zt}},rt?ot:0);const Et=reactExports.useRef(null),$t=useInstanceHandle(Et);reactExports.useLayoutEffect(()=>{const Ft=[];if(Et.current&&$t.current&&vt){const Ht=$t.current.objects;for(let zt=0;zt{for(const Ht of Ft)vt==null||vt.removePass(Ht);xt&&(xt.enabled=!1),St&&(St.enabled=!1)}},[vt,tt,wt,xt,St,$t]);const It=reactExports.useMemo(()=>({composer:vt,normalPass:xt,downSamplingPass:St,resolutionScale:it,camera:wt,scene:yt}),[vt,xt,St,it,wt,yt]);return reactExports.useImperativeHandle(dt,()=>vt,[vt]),jsxRuntimeExports.jsx(EffectComposerContext.Provider,{value:It,children:jsxRuntimeExports.jsx("group",{ref:Et,children:tt})})})),resolveRef=tt=>typeof tt=="object"&&tt!=null&&"current"in tt?tt.current:tt;let i$2=0;const components=new WeakMap,wrapEffect=(tt,et)=>React$1.forwardRef(function({blendFunction:it=et==null?void 0:et.blendFunction,opacity:rt=et==null?void 0:et.opacity,...ot},at){let st=components.get(tt);if(!st){const ut=`@react-three/postprocessing/${tt.name}-${i$2++}`;extend$3({[ut]:tt}),components.set(tt,st=ut)}const lt=useThree(ut=>ut.camera),ct=React$1.useMemo(()=>{var ut,ht;return[...(ut=et==null?void 0:et.args)!=null?ut:[],...(ht=ot.args)!=null?ht:[{...et,...ot}]]},[JSON.stringify(ot)]);return jsxRuntimeExports.jsx(st,{camera:lt,"blendMode-blendFunction":it,"blendMode-opacity-value":rt,...ot,ref:at,args:ct})}),Bloom=wrapEffect(BloomEffect,{blendFunction:BlendFunction.ADD}),Outline=reactExports.forwardRef(function tt({selection:et=[],selectionLayer:nt=10,blendFunction:it,patternTexture:rt,edgeStrength:ot,pulseSpeed:at,visibleEdgeColor:st,hiddenEdgeColor:lt,width:ct,height:ut,kernelSize:ht,blur:dt,xRay:pt,...mt},gt){const bt=useThree(St=>St.invalidate),{scene:yt,camera:wt}=reactExports.useContext(EffectComposerContext),vt=reactExports.useMemo(()=>new OutlineEffect(yt,wt,{blendFunction:it,patternTexture:rt,edgeStrength:ot,pulseSpeed:at,visibleEdgeColor:st,hiddenEdgeColor:lt,width:ct,height:ut,kernelSize:ht,blur:dt,xRay:pt,...mt}),[it,dt,wt,ot,ut,lt,ht,rt,at,yt,st,ct,pt]),xt=reactExports.useContext(selectionContext);return reactExports.useEffect(()=>{if(!xt&&et)return vt.selection.set(Array.isArray(et)?et.map(resolveRef):[resolveRef(et)]),bt(),()=>{vt.selection.clear(),bt()}},[vt,et,xt,bt]),reactExports.useEffect(()=>{vt.selectionLayer=nt,bt()},[vt,bt,nt]),reactExports.useRef(),reactExports.useEffect(()=>{var St;if(xt&&xt.enabled&&(St=xt.selected)!=null&&St.length)return vt.selection.set(xt.selected),bt(),()=>{vt.selection.clear(),bt()}},[xt,vt.selection,bt]),reactExports.useEffect(()=>()=>{vt.dispose()},[vt]),jsxRuntimeExports.jsx("primitive",{ref:gt,object:vt})}),Vignette=wrapEffect(VignetteEffect);function _objectWithoutPropertiesLoose$l(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var _excluded$1$2=["color"],ActivityLogIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$1$2);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$o=["color"],BarChartIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$o);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$H=["color"],ButtonIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$1w=["color"],CubeIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$1w);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$1H=["color"],DotIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$1H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$1W=["color"],DropdownMenuIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$1W);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$25=["color"],EyeNoneIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$25);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$26=["color"],EyeOpenIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$26);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$2C=["color"],ImageIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$2C);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$2H=["color"],LapTimerIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$2H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$2J=["color"],LayersIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$2J);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$2Q=["color"],LightningBoltIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$2Q);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$34=["color"],MarginIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$34);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$37=["color"],MinusIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$37);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$3m=["color"],PauseIcon$1=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$3m);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$3H=["color"],RocketIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$3H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$3L=["color"],RulerHorizontalIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$3L);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$4q=["color"],TextAlignJustifyIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$4q);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))}),_excluded$4H=["color"],TriangleDownIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$4H);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:it}))}),_excluded$4K=["color"],TriangleUpIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$4K);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:it}))}),_excluded$4R=["color"],VercelLogoIcon=reactExports.forwardRef(function(tt,et){var nt=tt.color,it=nt===void 0?"currentColor":nt,rt=_objectWithoutPropertiesLoose$l(tt,_excluded$4R);return reactExports.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rt,{ref:et}),reactExports.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:it,fillRule:"evenodd",clipRule:"evenodd"}))});function _toPrimitive$D(tt,et){if(typeof tt!="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(typeof it!="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function _toPropertyKey$D(tt){var et=_toPrimitive$D(tt,"string");return typeof et=="symbol"?et:String(et)}function _defineProperty$C(tt,et,nt){return et=_toPropertyKey$D(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function ownKeys$A(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread2(tt){for(var et=1;et(tt==null?void 0:tt.reduce((et,nt)=>et+nt,0))/tt.length;class GLPerf{constructor(et={}){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,et),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=MathUtils.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 et=0;const nt=it=>{++et<20?this.rafId=window.requestAnimationFrame(nt):(this.detected=Math.ceil(1e3*et/(it-this.t0)/70),window.cancelAnimationFrame(this.rafId)),this.t0||(this.t0=it)};this.rafId=window.requestAnimationFrame(nt)}addUI(et){this.names.indexOf(et)===-1&&(this.names.push(et),this.gpuAccums.push(0),this.activeAccums.push(!1))}nextFps(et){const nt=16.666666666666668,it=nt-et.timeRemaining(),rt=nt*overLimitFps.fpsLimit/10/it;rt<0||(overLimitFps.value=rt,overLimitFps.isOverLimit<25?overLimitFps.isOverLimit++:usePerfStore.setState({overclockingFps:!0}))}nextFrame(et){this.frameId++;const nt=et||this.now();let it=nt-this.paramTime,rt=0;if(this.frameId<=1)this.paramFrame=this.frameId,this.paramTime=nt;else if(nt>=this.paramTime){this.maxMemory=window.performance.memory?window.performance.memory.jsHeapSizeLimit/1048576:0;const ot=this.frameId-this.paramFrame,at=ot*1e3/it,st=usePerfStore.getState().overclockingFps?overLimitFps.value:at;if(rt=this.isWebGL2?this.gpuAccums[0]:this.gpuAccums[0]/it,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 lt=performance.measure("cpu-duration","cpu-started","cpu-finished");this.currentCpu=lt.duration,this.logsAccums.cpu.push(this.currentCpu),this.startCpuProfiling=!1}this.logsAccums.mem.push(this.currentMem),this.logsAccums.fpsFixed.push(at),this.logsAccums.fps.push(st),this.logsAccums.gpu.push(rt),this.overClock&&typeof window.requestIdleCallback<"u"&&(overLimitFps.isOverLimit>0&&st>at?overLimitFps.isOverLimit--:usePerfStore.getState().overclockingFps&&usePerfStore.setState({overclockingFps:!1})),nt>=this.paramTime+180&&(this.paramLogger({cpu:average(this.logsAccums.cpu),gpu:average(this.logsAccums.gpu),mem:average(this.logsAccums.mem),fps:average(this.logsAccums.fps),duration:Math.round(it),maxMemory:this.maxMemory,frameCount:ot}),this.logsAccums.mem=[],this.logsAccums.fps=[],this.logsAccums.gpu=[],this.logsAccums.cpu=[],this.paramFrame=this.frameId,this.paramTime=nt),this.overClock&&nt-this.lastCalculateFixed>=2*1e3&&(this.lastCalculateFixed=et,overLimitFps.fpsLimit=Math.round(average(this.logsAccums.fpsFixed)/10)*100,usePerfStore.setState({fpsLimit:overLimitFps.fpsLimit/10}),this.logsAccums.fpsFixed=[],this.paramFrame=this.frameId,this.paramTime=nt)}if(!this.detected||!this.chartFrame)this.chartFrame=this.frameId,this.chartTime=nt,this.circularId=0;else{const ot=nt-this.chartTime;let at=this.chartHz*ot/1e3;for(;--at>0&&this.detected;){const lt=(this.frameId-this.chartFrame)/ot*1e3,ct=usePerfStore.getState().overclockingFps?overLimitFps.value:lt;this.fpsChart[this.circularId%this.chartLen]=ct;const ut=1e3/this.currentMem,ht=this.currentCpu,dt=(this.isWebGL2?this.gpuAccums[1]*2:Math.round(this.gpuAccums[1]/it*100))+4;dt>0&&(this.gpuChart[this.circularId%this.chartLen]=dt),ht>0&&(this.cpuChart[this.circularId%this.chartLen]=ht),ut>0&&(this.memChart[this.circularId%this.chartLen]=ut);for(let pt=0;pt0&&(rt||this.activeAccums.forEach((lt,ct)=>{this.gpuAccums[ct]=st}))}}(it||!this.query)&&(this.queryCreated=!0,this.query=et.createQuery(),et.beginQuery(nt.TIME_ELAPSED_EXT,this.query))}}endGpu(){const et=this.extension,nt=this.gl;this.isWebGL2&&this.queryCreated&&nt.getQuery(et.TIME_ELAPSED_EXT,nt.CURRENT_QUERY)&&nt.endQuery(et.TIME_ELAPSED_EXT)}begin(et){this.startGpu(),this.updateAccums(et)}end(et){this.endGpu(),this.updateAccums(et)}updateAccums(et){let nt=this.names.indexOf(et);nt===-1&&(nt=this.names.length,this.addUI(et));const it=this.now();this.activeAccums[nt]=!this.activeAccums[nt],this.t0=it}}const countGeoDrawCalls=tt=>{tt.forEach((et,nt)=>{const{meshes:it}=et;if(!it)return;let rt={total:0,type:"Triangle",data:[]};Object.keys(it).forEach(ot=>{const at=it[ot],{geometry:st,material:lt}=at;let ct=st.index;const ut=st.attributes.position;if(!ut)return;let ht=1;lt.wireframe===!0&&(ht=0);const dt=ct!==null?ct.count:ut.count,pt=st.drawRange.start*ht,mt=st.drawRange.count*ht,gt=pt,bt=Math.min(dt,pt+mt)-1;let yt=1;const wt=at.count||1;let vt="Triangle",xt=0;at.isMesh?lt.wireframe===!0?(vt="Line",yt=yt/2):(vt="Triangle",yt=yt/3):at.isLine?(vt="Line",at.isLineSegments?yt=yt/2:at.isLineLoop?yt=yt:yt=yt-1):at.isPoints?(vt="Point",yt=yt):at.isSprite&&(vt="Triangle",yt=yt/3);const St=Math.round(Math.max(0,bt-gt+1)*(yt*wt));St>xt&&(xt=St,rt.type=vt),rt.total+=St,rt.data.push({drawCount:St,type:vt}),at.userData.drawCount={type:vt,count:St}}),et.drawCounts=rt})},updateMatrixWorldTemp=Object3D.prototype.updateMatrixWorld,updateWorldMatrixTemp=Object3D.prototype.updateWorldMatrix,updateMatrixTemp=Object3D.prototype.updateMatrix;let matriceWorldCount={value:0},matriceCount={value:0};const isUUID=tt=>{let et=""+tt;return et=et.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}$"),et!==null},addMuiPerfID=(tt,et)=>{tt.defines||(tt.defines={}),tt.defines&&!tt.defines.muiPerf&&(tt.defines=Object.assign(tt.defines||{},{muiPerf:tt.uuid}));const nt=tt.uuid;return et[nt]||(et[nt]={meshes:{},material:tt},tt.needsUpdate=!0),tt.needsUpdate=!1,nt},getMUIIndex=tt=>tt==="muiPerf",usePerfStore=react(tt=>({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"})),Headless=({trackCPU:tt,overClock:et,chart:nt,deepAnalyze:it,matrixUpdate:rt})=>{const{gl:ot,scene:at}=useThree();usePerfStore.setState({gl:ot,scene:at});const st=reactExports.useMemo(()=>{const lt=new GLPerf({trackGPU:!0,overClock:et,chartLen:nt?nt.length:120,chartHz:nt?nt.hz:60,gl:ot.getContext(),chartLogger:ht=>{usePerfStore.setState({chart:ht})},paramLogger:ht=>{usePerfStore.setState({log:{maxMemory:ht.maxMemory,gpu:ht.gpu,cpu:ht.cpu,mem:ht.mem,fps:ht.fps,totalTime:ht.duration,frameCount:ht.frameCount}})}}),ct=new Map,ut=new Map;return Object.defineProperty(Scene.prototype,"onBeforeRender",{get(){return(...ht)=>{var dt;lt&<.begin("profiler"),(dt=ct.get(this))===null||dt===void 0||dt(...ht)}},set(ht){ct.set(this,ht)},configurable:!0}),Object.defineProperty(Scene.prototype,"onAfterRender",{get(){return(...ht)=>{var dt;lt&<.end("profiler"),(dt=ut.get(this))===null||dt===void 0||dt(...ht)}},set(ht){ut.set(this,ht)},configurable:!0}),lt},[]);return reactExports.useEffect(()=>{st&&(st.overClock=et||!1,et===!1&&(usePerfStore.setState({overclockingFps:!1}),overLimitFps.value=0,overLimitFps.isOverLimit=0),st.chartHz=(nt==null?void 0:nt.hz)||60,st.chartLen=(nt==null?void 0:nt.length)||120)},[et,st,nt==null?void 0:nt.length,nt==null?void 0:nt.hz]),reactExports.useEffect(()=>{rt&&(Object3D.prototype.updateMatrixWorld=function(){(this.matrixWorldNeedsUpdate||arguments[0])&&matriceWorldCount.value++,updateMatrixWorldTemp.apply(this,arguments)},Object3D.prototype.updateWorldMatrix=function(){matriceWorldCount.value++,updateWorldMatrixTemp.apply(this,arguments)},Object3D.prototype.updateMatrix=function(){matriceCount.value++,updateMatrixTemp.apply(this,arguments)}),ot.info.autoReset=!1;let lt=null,ct=null;if(ot.info)return lt=addEffect(function(){usePerfStore.getState().paused&&usePerfStore.setState({paused:!1}),window.performance&&(window.performance.mark("cpu-started"),st.startCpuProfiling=!0),matriceCount.value-=1,matriceWorldCount.value=0,matriceCount.value=0,ot.info&&ot.info.reset()}),ct=addAfterEffect(function(){if(st&&!st.paused&&(st.nextFrame(window.performance.now()),et&&typeof window.requestIdleCallback<"u"&&(st.idleCbId=requestIdleCallback(st.nextFps))),it){var ht,dt;const pt={},mt=new Map;at.traverse(function(bt){if((bt instanceof Mesh||bt instanceof Points)&&bt.material){let yt=bt.material.uuid;Array.isArray(bt.material)&&bt.material.length>1?yt=addMuiPerfID(bt.material[1],pt):yt=addMuiPerfID(bt.material,pt),pt[yt].meshes[bt.uuid]=bt}}),ot==null||(ht=ot.info)===null||ht===void 0||(dt=ht.programs)===null||dt===void 0||dt.forEach(gt=>{const bt=gt.cacheKey.split(","),yt=bt[bt.findIndex(getMUIIndex)+1];if(isUUID(yt)&&pt[yt]){const{material:wt,meshes:vt}=pt[yt];mt.set(yt,{program:gt,material:wt,meshes:vt,drawCounts:{total:0,type:"triangle",data:[]},expand:!1,visible:!0})}}),mt.size!==usePerfStore.getState().programs.size&&(countGeoDrawCalls(mt),usePerfStore.setState({programs:mt,triggerProgramsUpdate:usePerfStore.getState().triggerProgramsUpdate++}))}}),()=>{st&&(typeof window.cancelIdleCallback<"u"&&window.cancelIdleCallback(st.idleCbId),window.cancelAnimationFrame(st.rafId),window.cancelAnimationFrame(st.checkQueryId)),rt&&(Object3D.prototype.updateMatrixWorld=updateMatrixTemp),lt(),ct()}},[st,ot,tt,nt,rt]),reactExports.useEffect(()=>{const lt=addTail(function(){return st&&(st.paused=!0,matriceCount.value=0,matriceWorldCount.value=0,usePerfStore.setState({paused:!0,log:{maxMemory:0,gpu:0,mem:0,cpu:0,fps:0,totalTime:0,frameCount:0}})),!1});return()=>{lt()}},[]),null},PerfS=re$5("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"}}),PerfSmallI=re$5("small",{position:"absolute",right:0,fontSize:"10px"}),PerfI=re$5("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"}}),PerfB=re$5("span",{verticalAlign:"bottom",position:"absolute",bottom:"5px",color:"rgba(101, 197, 188, 1)",textAlign:"right",letterSpacing:"1px",fontSize:"8px",fontWeight:"500",width:"60px"}),PerfIContainer=re$5("div",{display:"flex"}),ProgramHeader=re$5("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"}}),Graph$1=re$5("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"}}),Graphpc=re$5("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%"}),Toggle=re$5("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"}}),ToggleVisible=re$5("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"}}),ProgramGeo=re$5("div",{padding:"4px 6px",fontSize:"12px",pointerEvents:"auto"}),ProgramTitle=re$5("span",{fontWeight:"bold",letterSpacing:"0.08em",maxWidth:"145px",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"middle",fontSize:"11px",marginRight:"10px"}),ContainerScroll=re$5("div",{maxHeight:"50vh",overflowY:"auto",marginTop:"38px"}),ProgramsContainer=re$5("div",{marginTop:"0"}),ProgramsULHeader=re$5("div",{display:"flex",position:"relative",fontWeight:"bold",color:"#fff",lineHeight:"14px",svg:{marginRight:"4px",display:"inline-block"}}),ProgramsUL=re$5("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)"}}),ProgramConsole=re$5("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"}),ToggleContainer=re$5("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"}}),ProgramsGeoLi=re$5("li",{display:"flex !important",height:"auto !important",span:{height:"40px",display:"block",position:"relative"},b:{paddingLeft:"12px"}}),TextHighHZ=reactExports.memo(({isPerf:tt,color:et,colorBlind:nt,customData:it,isMemory:rt,isShadersInfo:ot,metric:at,fontSize:st,offsetY:lt=0,offsetX:ct,round:ut,hasInstance:ht})=>{const{width:dt,height:pt}=useThree(bt=>bt.viewport),mt=reactExports.useRef(null),gt=reactExports.useRef(null);return useFrame(function(){const yt=usePerfStore.getState().gl,wt=usePerfStore.getState().log;if(!wt||!mt.current||(it&&(mt.current.text=usePerfStore.getState().customData),!at))return;let vt=wt[at];if(ot){var xt;vt=(xt=yt.info.programs)===null||xt===void 0?void 0:xt.length}else at==="matriceCount"?vt=matriceCount.value:!tt&&yt.info.render&&(vt=(rt?yt.info.memory:yt.info.render)[at]);if(at==="fps"&&(mt.current.color=usePerfStore.getState().overclockingFps?colorsGraph(nt).overClock.toString():`rgb(${colorsGraph(nt).fps.toString()})`),mt.current.text=(Math.round(vt*Math.pow(10,ut))/Math.pow(10,ut)).toFixed(ut),ht){const St=yt.info.instance;if(typeof St>"u"&&at!=="matriceCount")return;let Et;at==="matriceCount"?Et=matriceWorldCount.value:Et=St[at],Et>0?(mt.current.fontSize=st/1.15,gt.current.fontSize=vt>0?st/1.4:st,mt.current.position.y=pt/2-lt-st/1.9,gt.current.text=" ± "+(Math.round(Et*Math.pow(10,ut))/Math.pow(10,ut)).toFixed(ut)):(mt.current.position.y=pt/2-lt-st,mt.current.fontSize=st)}matriceCount.value-=1,mt.current.updateMatrix(),mt.current.matrixWorld.copy(mt.current.matrix)}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:null,children:[jsxRuntimeExports.jsxs(Text$2,{textAlign:"justify",matrixAutoUpdate:!1,ref:mt,fontSize:st,position:[-dt/2+ct+st,pt/2-lt-st,0],color:et,characters:"0123456789",onUpdate:bt=>{bt.updateMatrix(),matriceCount.value-=1,bt.matrixWorld.copy(bt.matrix)},children:[jsxRuntimeExports.jsx("meshBasicMaterial",{blending:NormalBlending}),"0"]}),ht&&jsxRuntimeExports.jsx(Text$2,{textAlign:"justify",matrixAutoUpdate:!1,ref:gt,fontSize:8,position:[-dt/2+ct+st,pt/2-lt-st*1.15,0],color:"lightgrey",characters:"0123456789",onUpdate:bt=>{bt.updateMatrix(),matriceCount.value-=1,bt.matrixWorld.copy(bt.matrix)},children:jsxRuntimeExports.jsx("meshBasicMaterial",{blending:NormalBlending})})]})}),TextsHighHZ=({colorBlind:tt,customData:et,minimal:nt,matrixUpdate:it})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TextHighHZ,{colorBlind:tt,color:`rgb(${colorsGraph(tt).fps.toString()})`,isPerf:!0,metric:"fps",fontSize:14,offsetX:140,round:0}),jsxRuntimeExports.jsx(TextHighHZ,{color:`rgb(${colorsGraph(tt).cpu.toString()})`,isPerf:!0,metric:"cpu",fontSize:14,offsetX:72,round:3}),jsxRuntimeExports.jsx(TextHighHZ,{color:`rgb(${colorsGraph(tt).gpu.toString()})`,isPerf:!0,metric:"gpu",fontSize:14,offsetX:10,round:3}),nt?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TextHighHZ,{metric:"calls",fontSize:14,offsetX:200,round:0,hasInstance:!0}),jsxRuntimeExports.jsx(TextHighHZ,{metric:"triangles",fontSize:14,offsetX:260,round:0,hasInstance:!0}),jsxRuntimeExports.jsx(TextHighHZ,{isMemory:!0,metric:"geometries",fontSize:14,offsetY:30,offsetX:0,round:0}),jsxRuntimeExports.jsx(TextHighHZ,{isMemory:!0,metric:"textures",fontSize:14,offsetY:30,offsetX:80,round:0}),jsxRuntimeExports.jsx(TextHighHZ,{isShadersInfo:!0,metric:"programs",fontSize:14,offsetY:30,offsetX:140,round:0}),jsxRuntimeExports.jsx(TextHighHZ,{metric:"lines",fontSize:14,offsetY:30,offsetX:200,round:0,hasInstance:!0}),jsxRuntimeExports.jsx(TextHighHZ,{metric:"points",fontSize:14,offsetY:30,offsetX:260,round:0,hasInstance:!0}),it&&jsxRuntimeExports.jsx(TextHighHZ,{isPerf:!0,metric:"matriceCount",fontSize:14,offsetY:30,offsetX:320,round:0,hasInstance:!0})]}),et&&jsxRuntimeExports.jsx(TextHighHZ,{color:`rgb(${colorsGraph(tt).custom.toString()})`,customData:et,fontSize:14,offsetY:0,offsetX:nt?200:320,round:0})]}),ChartCurve=({colorBlind:tt,minimal:et,chart:nt={length:30,hz:15}})=>{const it=reactExports.useMemo(()=>({fps:new Float32Array(nt.length*3),cpu:new Float32Array(nt.length*3),gpu:new Float32Array(nt.length*3)}),[nt]),rt=reactExports.useRef(null),ot=reactExports.useRef(null),at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useMemo(()=>new Vector3(0,0,0),[]),ct=(ut,ht=1,dt,pt)=>{let mt=0;const{width:gt,height:bt}=pt,yt=usePerfStore.getState().chart.data[ut];if(!yt||yt.length===0)return;const wt=et?2:6,vt=et?12:50;let xt=yt.length;for(let St=0;Stmt&&(mt=yt[Et]*ht),lt.set(wt+St/(xt-1)*(gt-wt*2)-gt/2,Math.min(100,yt[Et])*ht/100*(bt-wt*2-vt)-bt/2,0),lt.toArray(dt.attributes.position.array,St*3))}dt.attributes.position.needsUpdate=!0};return useFrame(function({viewport:ht}){ct("fps",1,rt.current,ht),ot.current&&ot.current.color.set(usePerfStore.getState().overclockingFps?colorsGraph(tt).overClock.toString():`rgb(${colorsGraph(tt).fps.toString()})`),ct("gpu",5,at.current,ht),ct("cpu",5,st.current,ht)}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("line",{children:[jsxRuntimeExports.jsx("bufferGeometry",{ref:rt,children:jsxRuntimeExports.jsx("bufferAttribute",{attach:"attributes-position",count:nt.length,array:it.fps,itemSize:3,usage:DynamicDrawUsage,needsUpdate:!0})}),jsxRuntimeExports.jsx("lineBasicMaterial",{ref:ot,color:`rgb(${colorsGraph(tt).fps.toString()})`,transparent:!0,opacity:.5})]}),jsxRuntimeExports.jsxs("line",{children:[jsxRuntimeExports.jsx("bufferGeometry",{ref:at,children:jsxRuntimeExports.jsx("bufferAttribute",{attach:"attributes-position",count:nt.length,array:it.gpu,itemSize:3,usage:DynamicDrawUsage,needsUpdate:!0})}),jsxRuntimeExports.jsx("lineBasicMaterial",{color:`rgb(${colorsGraph(tt).gpu.toString()})`,transparent:!0,opacity:.5})]}),jsxRuntimeExports.jsxs("line",{children:[jsxRuntimeExports.jsx("bufferGeometry",{ref:st,children:jsxRuntimeExports.jsx("bufferAttribute",{attach:"attributes-position",count:nt.length,array:it.cpu,itemSize:3,usage:DynamicDrawUsage,needsUpdate:!0})}),jsxRuntimeExports.jsx("lineBasicMaterial",{color:`rgb(${colorsGraph(tt).cpu.toString()})`,transparent:!0,opacity:.5})]})]})},ChartUI=({colorBlind:tt,chart:et,customData:nt,matrixUpdate:it,showGraph:rt=!0,antialias:ot=!0,minimal:at})=>{const st=reactExports.useRef(void 0),lt=usePerfStore(ct=>ct.paused);return jsxRuntimeExports.jsxs(Graph$1,{style:{display:"flex",position:"absolute",height:`${at?37:rt?100:60}px`,minWidth:`${at?"100px":nt?"370px":"310px"}`},children:[jsxRuntimeExports.jsx(Canvas,{ref:st,orthographic:!0,dpr:ot?[1,2]:1,gl:{antialias:!0,alpha:!0,stencil:!1,depth:!1},onCreated:({scene:ct})=>{ct.traverse(ut=>{ut.matrixWorldAutoUpdate=!1,ut.matrixAutoUpdate=!1})},flat:!0,style:{marginBottom:"-42px",position:"relative",pointerEvents:"none",background:"transparent !important",height:`${at?37:rt?100:60}px`},children:lt?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Renderer,{}),jsxRuntimeExports.jsx(TextsHighHZ,{customData:nt,minimal:at,matrixUpdate:it}),rt&&jsxRuntimeExports.jsx(ChartCurve,{colorBlind:tt,minimal:at,chart:et})]})}),lt&&jsxRuntimeExports.jsxs(Graphpc,{children:[jsxRuntimeExports.jsx(PauseIcon$1,{})," PAUSED"]})]})},Renderer=()=>(useFrame(function({gl:et,scene:nt,camera:it}){it.updateMatrix(),matriceCount.value-=1,it.matrixWorld.copy(it.matrix),it.matrixWorldInverse.copy(it.matrixWorld).invert(),et.render(nt,it),matriceWorldCount.value=0,matriceCount.value=0},1/0),null);function _objectWithoutPropertiesLoose$k(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _objectWithoutProperties$j(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$k(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}const _excluded$l=["portal","className","children"],Html=reactExports.forwardRef((tt,et)=>{let{portal:nt,className:it,children:rt}=tt,ot=_objectWithoutProperties$j(tt,_excluded$l);const at=useThree(ut=>ut.gl),st=reactExports.useRef(null),lt=reactExports.useRef(null),ct=(nt==null?void 0:nt.current)!=null?nt.current:at.domElement.parentNode;return reactExports.useLayoutEffect(()=>{if(!st.current||!ct)return;const ut=document.createElement("div"),ht=lt.current=createRoot$1(ut);return ct.appendChild(ut),()=>{ht.unmount(),lt.current=null,ct.removeChild(ut)}},[ct]),reactExports.useLayoutEffect(()=>{const ut=lt.current;ut&&ut.render(jsxRuntimeExports.jsx("div",{ref:et,className:it,children:rt}))}),jsxRuntimeExports.jsx("group",_objectSpread2(_objectSpread2({},ot),{},{ref:st}))}),addTextureUniforms=(tt,et)=>{const nt=rt=>{switch(rt){case 1e3:return"RepeatWrapping";case 1001:return"ClampToEdgeWrapping";case 1002:return"MirroredRepeatWrapping";default:return"ClampToEdgeWrapping"}},it=rt=>{switch(rt){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:tt,url:et.image.currentSrc,encoding:it(et.encoding),wrapT:nt(et.image.wrapT),flipY:et.flipY.toString()}},UniformsGL=({program:tt,material:et,setTexNumber:nt})=>{const it=usePerfStore(at=>at.gl),[rt,ot]=reactExports.useState(null);return reactExports.useEffect(()=>{if(it){const at=tt==null?void 0:tt.getUniforms();let st=0;const lt=new Map;at.seq.forEach(ct=>{if(!ct.id.includes("uTroika")&&ct.id!=="isOrthographic"&&ct.id!=="uvTransform"&&ct.id!=="lightProbe"&&ct.id!=="projectionMatrix"&&ct.id!=="viewMatrix"&&ct.id!=="normalMatrix"&&ct.id!=="modelMatrix"&&ct.id!=="modelViewMatrix"){let ut=[],ht={name:ct.id};ct.cache&&(ct.cache.forEach(dt=>{typeof dt<"u"&&ut.push(dt.toString().substring(0,4))}),ht.value=ut.join(),et[ct.id]&&et[ct.id].image&&et[ct.id].image&&(st++,ht.value=addTextureUniforms(ct.id,et[ct.id])),ht.value||(ht.value="empty"),lt.set(ct.id,ht))}}),et.uniforms&&Object.keys(et.uniforms).forEach(ct=>{const ut=et.uniforms[ct];if(ut.value){const{value:ht}=ut;let dt={name:ct};if(ct.includes("uTroika"))return;if(ht instanceof Texture)st++,dt.value=addTextureUniforms(ct,ht);else{let pt=JSON.stringify(ht);try{pt=JSON.stringify(ht)}catch{pt=ht.toString()}dt.value=pt}lt.set(ct,dt)}}),st>0&&nt(st),ot(lt)}},[]),jsxRuntimeExports.jsx(ProgramsUL,{children:rt&&Array.from(rt.values()).map(at=>jsxRuntimeExports.jsx("span",{children:typeof at.value=="string"?jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsxs("span",{children:[at.name," :"," ",jsxRuntimeExports.jsxs("b",{children:[at.value.substring(0,30),at.value.length>30?"...":""]})]})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsxs("b",{children:[at.value.name,":"]})}),jsxRuntimeExports.jsxs("div",{children:[Object.keys(at.value).map(st=>st!=="name"?jsxRuntimeExports.jsx("div",{children:st==="url"?jsxRuntimeExports.jsx("a",{href:at.value[st],target:"_blank",children:jsxRuntimeExports.jsx("img",{src:at.value[st]})}):jsxRuntimeExports.jsxs("li",{children:[st,": ",jsxRuntimeExports.jsx("b",{children:at.value[st]})]})},st):null),jsxRuntimeExports.jsxs(ProgramConsole,{onClick:()=>{var st;console.info(et[at.value.name]||(et==null||(st=et.uniforms[at.value.name])===null||st===void 0?void 0:st.value))},children:["console.info(",at.value.name,");"]})]})]})},at.name))})},DynamicDrawCallInfo=({el:tt})=>{usePerfStore(it=>it.log);const et=usePerfStore(it=>it.gl),nt=it=>{if(!et)return 0;const rt=Math.round(it.drawCounts.total/(et.info.render.triangles+et.info.render.lines+et.info.render.points)*100*10)/10;return isFinite(rt)&&rt||0};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:tt.drawCounts.total>0&&jsxRuntimeExports.jsxs(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[tt.drawCounts.type==="Triangle"?jsxRuntimeExports.jsx(VercelLogoIcon,{style:{top:"-1px"}}):jsxRuntimeExports.jsx(ActivityLogIcon,{style:{top:"-1px"}}),tt.drawCounts.total,jsxRuntimeExports.jsxs("small",{children:[tt.drawCounts.type,"s"]}),et&&jsxRuntimeExports.jsxs(PerfB,{style:{bottom:"-10px",width:"40px",fontWeight:"bold"},children:[tt.visible&&!tt.material.wireframe?nt(tt):0,"%"]})]})})},ProgramUI=({el:tt})=>{const[et,nt]=reactExports.useState(tt.visible),[it,rt]=reactExports.useState(tt.expand),[ot,at]=reactExports.useState(0),{meshes:st,program:lt,material:ct}=tt;return jsxRuntimeExports.jsxs(ProgramGeo,{children:[jsxRuntimeExports.jsxs(ProgramHeader,{onClick:()=>{tt.expand=!it,Object.keys(st).forEach(ut=>{const ht=st[ut];ht.material.wireframe=!1}),rt(!it)},children:[jsxRuntimeExports.jsx(Toggle,{style:{marginRight:"6px"},children:it?jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(TriangleDownIcon,{})}):jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(TriangleUpIcon,{})})}),lt&&jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(ProgramTitle,{children:lt.name}),jsxRuntimeExports.jsxs(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[jsxRuntimeExports.jsx(LayersIcon,{style:{top:"-1px"}}),Object.keys(st).length,jsxRuntimeExports.jsx("small",{children:Object.keys(st).length>1?"users":"user"})]}),ot>0&&jsxRuntimeExports.jsxs(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[ot>1?jsxRuntimeExports.jsx(ImageIcon,{style:{top:"-1px"}}):jsxRuntimeExports.jsx(ImageIcon,{style:{top:"-1px"}}),ot,jsxRuntimeExports.jsx("small",{children:"tex"})]}),jsxRuntimeExports.jsx(DynamicDrawCallInfo,{el:tt}),ct.glslVersion==="300 es"&&jsxRuntimeExports.jsxs(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[jsxRuntimeExports.jsx(RocketIcon,{style:{top:"-1px"}}),"300",jsxRuntimeExports.jsx("small",{children:"es"}),jsxRuntimeExports.jsx(PerfB,{style:{bottom:"-10px",width:"40px"},children:"glsl"})]})]}),jsxRuntimeExports.jsx(ToggleVisible,{onPointerEnter:()=>{Object.keys(st).forEach(ut=>{const ht=st[ut];ht.material.wireframe=!0})},onPointerLeave:()=>{Object.keys(st).forEach(ut=>{const ht=st[ut];ht.material.wireframe=!1})},onClick:ut=>{ut.stopPropagation(),Object.keys(st).forEach(ht=>{const dt=st[ht],pt=!et;dt.visible=pt,tt.visible=pt,nt(pt)})},children:et?jsxRuntimeExports.jsx(EyeOpenIcon,{}):jsxRuntimeExports.jsx(EyeNoneIcon,{})})]}),jsxRuntimeExports.jsxs("div",{style:{maxHeight:it?"9999px":0,overflow:"hidden"},children:[jsxRuntimeExports.jsxs(ProgramsULHeader,{children:[jsxRuntimeExports.jsx(ButtonIcon,{})," Uniforms:"]}),jsxRuntimeExports.jsx(UniformsGL,{program:lt,material:ct,setTexNumber:at}),jsxRuntimeExports.jsxs(ProgramsULHeader,{children:[jsxRuntimeExports.jsx(CubeIcon,{})," Geometries:"]}),jsxRuntimeExports.jsx(ProgramsUL,{children:st&&Object.keys(st).map(ut=>st[ut]&&st[ut].geometry&&jsxRuntimeExports.jsxs(ProgramsGeoLi,{children:[jsxRuntimeExports.jsxs("span",{children:[st[ut].geometry.type,": "]}),st[ut].userData&&st[ut].userData.drawCount&&jsxRuntimeExports.jsxs("b",{children:[jsxRuntimeExports.jsxs("div",{children:[st[ut].userData.drawCount.count,jsxRuntimeExports.jsxs("small",{children:[" ",st[ut].userData.drawCount.type,"s"]})]}),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("div",{children:[Math.round(estimateBytesUsed(st[ut].geometry)/1024*1e3)/1e3,"Kb",jsxRuntimeExports.jsx("small",{children:" memory used"})]})]})]},ut))}),jsxRuntimeExports.jsxs(ProgramConsole,{onClick:()=>{console.info(ct)},children:["console.info(",ct.type,")"]})]})]})},ProgramsUI=()=>{usePerfStore(et=>et.triggerProgramsUpdate);const tt=usePerfStore(et=>et.programs);return jsxRuntimeExports.jsx(ProgramsContainer,{children:tt&&Array.from(tt.values()).map(et=>et&&et?jsxRuntimeExports.jsx(ProgramUI,{el:et},et.material.uuid):null)})},colorsGraph=tt=>({overClock:"#ff6eff",fps:tt?"100, 143, 255":"238,38,110",cpu:tt?"254, 254, 98":"66,226,46",gpu:tt?"254,254,254":"253,151,31",custom:tt?"86,180,233":"40,255,255"}),DynamicUIPerf=({showGraph:tt,colorBlind:et})=>{const nt=usePerfStore(rt=>rt.overclockingFps),it=usePerfStore(rt=>rt.fpsLimit);return jsxRuntimeExports.jsxs(PerfB,{style:tt?{color:nt?colorsGraph(et).overClock.toString():`rgb(${colorsGraph(et).fps})`}:{},children:["FPS ",nt?`${it}🚀`:""]})},DynamicUI=({showGraph:tt,colorBlind:et,customData:nt,minimal:it})=>{const rt=usePerfStore(ot=>ot.gl);return rt?jsxRuntimeExports.jsxs(PerfIContainer,{children:[jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(LightningBoltIcon,{}),jsxRuntimeExports.jsx(PerfB,{style:tt?{color:`rgb(${colorsGraph(et).gpu.toString()})`}:{},children:"GPU"}),jsxRuntimeExports.jsx(PerfSmallI,{children:"ms"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(RulerHorizontalIcon,{}),jsxRuntimeExports.jsx(PerfB,{style:tt?{color:`rgb(${colorsGraph(et).cpu.toString()})`}:{},children:"CPU"}),jsxRuntimeExports.jsx(PerfSmallI,{children:"ms"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(LapTimerIcon,{}),jsxRuntimeExports.jsx(DynamicUIPerf,{showGraph:tt,colorBlind:et})]}),!it&&rt&&jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(TextAlignJustifyIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:rt.info.render.calls===1?"call":"calls"})]}),!it&&rt&&jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(VercelLogoIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Triangles"})]}),nt&&jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(BarChartIcon,{}),jsxRuntimeExports.jsx(PerfB,{style:tt?{color:`rgb(${colorsGraph(et).custom})`}:{},children:nt.name}),nt.info&&jsxRuntimeExports.jsx(PerfSmallI,{children:nt.info})]})]}):null},PerfUI=({showGraph:tt,colorBlind:et,deepAnalyze:nt,customData:it,matrixUpdate:rt,openByDefault:ot,minimal:at})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(DynamicUI,{showGraph:tt,colorBlind:et,customData:it,minimal:at}),!at&&jsxRuntimeExports.jsx(PerfThree,{matrixUpdate:rt,openByDefault:ot,deepAnalyze:nt,showGraph:tt})]}),InfoUI=({matrixUpdate:tt})=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(MarginIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Geometries"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(ImageIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Textures"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(ActivityLogIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"shaders"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(MinusIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Lines"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(DotIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Points"})]}),tt&&jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(DropdownMenuIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Matrices"})]})]}),ToggleEl=({tab:tt,title:et,set:nt})=>{const it=usePerfStore(rt=>rt.tab);return jsxRuntimeExports.jsx(Toggle,{className:`${it===tt?" __perf_toggle_tab_active":""}`,onClick:()=>{nt(!0),usePerfStore.setState({tab:tt})},children:jsxRuntimeExports.jsx("span",{children:et})})},PerfThree=({openByDefault:tt,showGraph:et,deepAnalyze:nt,matrixUpdate:it})=>{const[rt,ot]=React$1.useState(tt);return jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(TabContainers,{show:rt,showGraph:et,matrixUpdate:it}),tt&&!nt?null:jsxRuntimeExports.jsxs(ToggleContainer,{className:"__perf_toggle",children:[nt&&jsxRuntimeExports.jsx(ToggleEl,{tab:"programs",title:"Programs",set:ot}),nt&&jsxRuntimeExports.jsx(ToggleEl,{tab:"infos",title:"Infos",set:ot}),jsxRuntimeExports.jsx(Toggle,{onClick:()=>{ot(!rt)},children:rt?jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(TriangleDownIcon,{})," Minimize"]}):jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(TriangleUpIcon,{})," More"]})})]})]})},TabContainers=({show:tt,showGraph:et,matrixUpdate:nt})=>{const it=usePerfStore(rt=>rt.tab);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(InfoUI,{matrixUpdate:nt}),tt&&jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(ContainerScroll,{style:{marginTop:et?"38px":0},children:it==="programs"&&jsxRuntimeExports.jsx(ProgramsUI,{})})})]})},Gui=({showGraph:tt,colorBlind:et,openByDefault:nt,className:it,overClock:rt,style:ot,position:at,chart:st,deepAnalyze:lt,antialias:ct,customData:ut,matrixUpdate:ht,minimal:dt})=>{const pt=reactExports.useRef(null);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Headless,{chart:st,overClock:rt,deepAnalyze:lt,matrixUpdate:ht}),jsxRuntimeExports.jsx(Html,{transform:!1,children:jsxRuntimeExports.jsxs(PerfS,{className:(it?" ".concat(it):" ")+` ${at||""} ${dt?"minimal":""}`,style:_objectSpread2({minHeight:dt?"37px":tt?"100px":"60px"},ot),ref:pt,children:[jsxRuntimeExports.jsx(ChartUI,{perfContainerRef:pt,colorBlind:et,chart:st,showGraph:tt,antialias:ct,customData:ut,minimal:dt,matrixUpdate:ht}),jsxRuntimeExports.jsx(PerfUI,{colorBlind:et,showGraph:tt,deepAnalyze:lt,openByDefault:nt,customData:ut,matrixUpdate:ht,minimal:dt})]})})]})},Perf=({headless:tt=!1,colorBlind:et=!1,overClock:nt=!1,showGraph:it=!0,trackCPU:rt=!1,deepAnalyze:ot=!1,antialias:at=!0,openByDefault:st=!0,customData:lt,matrixUpdate:ct=!1,position:ut="top-right",chart:ht={length:30,hz:15},className:dt,style:pt,minimal:mt=!1})=>tt?jsxRuntimeExports.jsx(Headless,{chart:ht,deepAnalyze:ot,matrixUpdate:ct,overClock:nt}):jsxRuntimeExports.jsx(Gui,{colorBlind:et,showGraph:it,trackCPU:rt,openByDefault:st,className:dt,style:pt,overClock:nt,position:ut,antialias:at,chart:ht,deepAnalyze:ot,minimal:mt,customData:lt,matrixUpdate:ct}),UNIVERSE_SCALE=5e3,DATA_COLOR_PALETTE={show:"#FF723C",clip:"#FFFF00",episode:"#FF7F50",guest:"#E066FF",topic:"#F8F8FF"},getNodeColorByType=(tt,et)=>{const nt=DATA_COLOR_PALETTE[tt]||"#F8F8FF";return et?nt:parseInt(nt.replace("#","0x"),16)},defaultData$5={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},useControlStore=react(tt=>({...defaultData$5,setIsUserDragging:et=>tt({isUserDragging:et}),setIsUserScrolling:et=>tt({isUserScrolling:et}),setUserMovedCamera:et=>tt({userMovedCamera:et}),setIsUserScrollingOnHtmlPanel:et=>tt({isUserScrollingOnHtmlPanel:et})}));function _assertThisInitialized$d(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _inheritsLoose(tt,et){tt.prototype=Object.create(et.prototype),tt.prototype.constructor=tt,tt.__proto__=et}/*! - * GSAP 3.12.3 + 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"}}),PerfSmallI=re$5("small",{position:"absolute",right:0,fontSize:"10px"}),PerfI=re$5("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"}}),PerfB=re$5("span",{verticalAlign:"bottom",position:"absolute",bottom:"5px",color:"rgba(101, 197, 188, 1)",textAlign:"right",letterSpacing:"1px",fontSize:"8px",fontWeight:"500",width:"60px"}),PerfIContainer=re$5("div",{display:"flex"}),ProgramHeader=re$5("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"}}),Graph$1=re$5("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"}}),Graphpc=re$5("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%"}),Toggle=re$5("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"}}),ToggleVisible=re$5("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"}}),ProgramGeo=re$5("div",{padding:"4px 6px",fontSize:"12px",pointerEvents:"auto"}),ProgramTitle=re$5("span",{fontWeight:"bold",letterSpacing:"0.08em",maxWidth:"145px",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"middle",fontSize:"11px",marginRight:"10px"}),ContainerScroll=re$5("div",{maxHeight:"50vh",overflowY:"auto",marginTop:"38px"}),ProgramsContainer=re$5("div",{marginTop:"0"}),ProgramsULHeader=re$5("div",{display:"flex",position:"relative",fontWeight:"bold",color:"#fff",lineHeight:"14px",svg:{marginRight:"4px",display:"inline-block"}}),ProgramsUL=re$5("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)"}}),ProgramConsole=re$5("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"}),ToggleContainer=re$5("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"}}),ProgramsGeoLi=re$5("li",{display:"flex !important",height:"auto !important",span:{height:"40px",display:"block",position:"relative"},b:{paddingLeft:"12px"}}),TextHighHZ=reactExports.memo(({isPerf:tt,color:et,colorBlind:nt,customData:it,isMemory:rt,isShadersInfo:ot,metric:at,fontSize:st,offsetY:lt=0,offsetX:ct,round:ut,hasInstance:ht})=>{const{width:dt,height:pt}=useThree(bt=>bt.viewport),mt=reactExports.useRef(null),gt=reactExports.useRef(null);return useFrame(function(){const yt=usePerfStore.getState().gl,wt=usePerfStore.getState().log;if(!wt||!mt.current||(it&&(mt.current.text=usePerfStore.getState().customData),!at))return;let vt=wt[at];if(ot){var xt;vt=(xt=yt.info.programs)===null||xt===void 0?void 0:xt.length}else at==="matriceCount"?vt=matriceCount.value:!tt&&yt.info.render&&(vt=(rt?yt.info.memory:yt.info.render)[at]);if(at==="fps"&&(mt.current.color=usePerfStore.getState().overclockingFps?colorsGraph(nt).overClock.toString():`rgb(${colorsGraph(nt).fps.toString()})`),mt.current.text=(Math.round(vt*Math.pow(10,ut))/Math.pow(10,ut)).toFixed(ut),ht){const St=yt.info.instance;if(typeof St>"u"&&at!=="matriceCount")return;let Et;at==="matriceCount"?Et=matriceWorldCount.value:Et=St[at],Et>0?(mt.current.fontSize=st/1.15,gt.current.fontSize=vt>0?st/1.4:st,mt.current.position.y=pt/2-lt-st/1.9,gt.current.text=" ± "+(Math.round(Et*Math.pow(10,ut))/Math.pow(10,ut)).toFixed(ut)):(mt.current.position.y=pt/2-lt-st,mt.current.fontSize=st)}matriceCount.value-=1,mt.current.updateMatrix(),mt.current.matrixWorld.copy(mt.current.matrix)}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:null,children:[jsxRuntimeExports.jsxs(Text$2,{textAlign:"justify",matrixAutoUpdate:!1,ref:mt,fontSize:st,position:[-dt/2+ct+st,pt/2-lt-st,0],color:et,characters:"0123456789",onUpdate:bt=>{bt.updateMatrix(),matriceCount.value-=1,bt.matrixWorld.copy(bt.matrix)},children:[jsxRuntimeExports.jsx("meshBasicMaterial",{blending:NormalBlending}),"0"]}),ht&&jsxRuntimeExports.jsx(Text$2,{textAlign:"justify",matrixAutoUpdate:!1,ref:gt,fontSize:8,position:[-dt/2+ct+st,pt/2-lt-st*1.15,0],color:"lightgrey",characters:"0123456789",onUpdate:bt=>{bt.updateMatrix(),matriceCount.value-=1,bt.matrixWorld.copy(bt.matrix)},children:jsxRuntimeExports.jsx("meshBasicMaterial",{blending:NormalBlending})})]})}),TextsHighHZ=({colorBlind:tt,customData:et,minimal:nt,matrixUpdate:it})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TextHighHZ,{colorBlind:tt,color:`rgb(${colorsGraph(tt).fps.toString()})`,isPerf:!0,metric:"fps",fontSize:14,offsetX:140,round:0}),jsxRuntimeExports.jsx(TextHighHZ,{color:`rgb(${colorsGraph(tt).cpu.toString()})`,isPerf:!0,metric:"cpu",fontSize:14,offsetX:72,round:3}),jsxRuntimeExports.jsx(TextHighHZ,{color:`rgb(${colorsGraph(tt).gpu.toString()})`,isPerf:!0,metric:"gpu",fontSize:14,offsetX:10,round:3}),nt?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TextHighHZ,{metric:"calls",fontSize:14,offsetX:200,round:0,hasInstance:!0}),jsxRuntimeExports.jsx(TextHighHZ,{metric:"triangles",fontSize:14,offsetX:260,round:0,hasInstance:!0}),jsxRuntimeExports.jsx(TextHighHZ,{isMemory:!0,metric:"geometries",fontSize:14,offsetY:30,offsetX:0,round:0}),jsxRuntimeExports.jsx(TextHighHZ,{isMemory:!0,metric:"textures",fontSize:14,offsetY:30,offsetX:80,round:0}),jsxRuntimeExports.jsx(TextHighHZ,{isShadersInfo:!0,metric:"programs",fontSize:14,offsetY:30,offsetX:140,round:0}),jsxRuntimeExports.jsx(TextHighHZ,{metric:"lines",fontSize:14,offsetY:30,offsetX:200,round:0,hasInstance:!0}),jsxRuntimeExports.jsx(TextHighHZ,{metric:"points",fontSize:14,offsetY:30,offsetX:260,round:0,hasInstance:!0}),it&&jsxRuntimeExports.jsx(TextHighHZ,{isPerf:!0,metric:"matriceCount",fontSize:14,offsetY:30,offsetX:320,round:0,hasInstance:!0})]}),et&&jsxRuntimeExports.jsx(TextHighHZ,{color:`rgb(${colorsGraph(tt).custom.toString()})`,customData:et,fontSize:14,offsetY:0,offsetX:nt?200:320,round:0})]}),ChartCurve=({colorBlind:tt,minimal:et,chart:nt={length:30,hz:15}})=>{const it=reactExports.useMemo(()=>({fps:new Float32Array(nt.length*3),cpu:new Float32Array(nt.length*3),gpu:new Float32Array(nt.length*3)}),[nt]),rt=reactExports.useRef(null),ot=reactExports.useRef(null),at=reactExports.useRef(null),st=reactExports.useRef(null),lt=reactExports.useMemo(()=>new Vector3(0,0,0),[]),ct=(ut,ht=1,dt,pt)=>{let mt=0;const{width:gt,height:bt}=pt,yt=usePerfStore.getState().chart.data[ut];if(!yt||yt.length===0)return;const wt=et?2:6,vt=et?12:50;let xt=yt.length;for(let St=0;Stmt&&(mt=yt[Et]*ht),lt.set(wt+St/(xt-1)*(gt-wt*2)-gt/2,Math.min(100,yt[Et])*ht/100*(bt-wt*2-vt)-bt/2,0),lt.toArray(dt.attributes.position.array,St*3))}dt.attributes.position.needsUpdate=!0};return useFrame(function({viewport:ht}){ct("fps",1,rt.current,ht),ot.current&&ot.current.color.set(usePerfStore.getState().overclockingFps?colorsGraph(tt).overClock.toString():`rgb(${colorsGraph(tt).fps.toString()})`),ct("gpu",5,at.current,ht),ct("cpu",5,st.current,ht)}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("line",{children:[jsxRuntimeExports.jsx("bufferGeometry",{ref:rt,children:jsxRuntimeExports.jsx("bufferAttribute",{attach:"attributes-position",count:nt.length,array:it.fps,itemSize:3,usage:DynamicDrawUsage,needsUpdate:!0})}),jsxRuntimeExports.jsx("lineBasicMaterial",{ref:ot,color:`rgb(${colorsGraph(tt).fps.toString()})`,transparent:!0,opacity:.5})]}),jsxRuntimeExports.jsxs("line",{children:[jsxRuntimeExports.jsx("bufferGeometry",{ref:at,children:jsxRuntimeExports.jsx("bufferAttribute",{attach:"attributes-position",count:nt.length,array:it.gpu,itemSize:3,usage:DynamicDrawUsage,needsUpdate:!0})}),jsxRuntimeExports.jsx("lineBasicMaterial",{color:`rgb(${colorsGraph(tt).gpu.toString()})`,transparent:!0,opacity:.5})]}),jsxRuntimeExports.jsxs("line",{children:[jsxRuntimeExports.jsx("bufferGeometry",{ref:st,children:jsxRuntimeExports.jsx("bufferAttribute",{attach:"attributes-position",count:nt.length,array:it.cpu,itemSize:3,usage:DynamicDrawUsage,needsUpdate:!0})}),jsxRuntimeExports.jsx("lineBasicMaterial",{color:`rgb(${colorsGraph(tt).cpu.toString()})`,transparent:!0,opacity:.5})]})]})},ChartUI=({colorBlind:tt,chart:et,customData:nt,matrixUpdate:it,showGraph:rt=!0,antialias:ot=!0,minimal:at})=>{const st=reactExports.useRef(void 0),lt=usePerfStore(ct=>ct.paused);return jsxRuntimeExports.jsxs(Graph$1,{style:{display:"flex",position:"absolute",height:`${at?37:rt?100:60}px`,minWidth:`${at?"100px":nt?"370px":"310px"}`},children:[jsxRuntimeExports.jsx(Canvas,{ref:st,orthographic:!0,dpr:ot?[1,2]:1,gl:{antialias:!0,alpha:!0,stencil:!1,depth:!1},onCreated:({scene:ct})=>{ct.traverse(ut=>{ut.matrixWorldAutoUpdate=!1,ut.matrixAutoUpdate=!1})},flat:!0,style:{marginBottom:"-42px",position:"relative",pointerEvents:"none",background:"transparent !important",height:`${at?37:rt?100:60}px`},children:lt?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Renderer,{}),jsxRuntimeExports.jsx(TextsHighHZ,{customData:nt,minimal:at,matrixUpdate:it}),rt&&jsxRuntimeExports.jsx(ChartCurve,{colorBlind:tt,minimal:at,chart:et})]})}),lt&&jsxRuntimeExports.jsxs(Graphpc,{children:[jsxRuntimeExports.jsx(PauseIcon$1,{})," PAUSED"]})]})},Renderer=()=>(useFrame(function({gl:et,scene:nt,camera:it}){it.updateMatrix(),matriceCount.value-=1,it.matrixWorld.copy(it.matrix),it.matrixWorldInverse.copy(it.matrixWorld).invert(),et.render(nt,it),matriceWorldCount.value=0,matriceCount.value=0},1/0),null);function _objectWithoutPropertiesLoose$k(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _objectWithoutProperties$j(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$k(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}const _excluded$l=["portal","className","children"],Html=reactExports.forwardRef((tt,et)=>{let{portal:nt,className:it,children:rt}=tt,ot=_objectWithoutProperties$j(tt,_excluded$l);const at=useThree(ut=>ut.gl),st=reactExports.useRef(null),lt=reactExports.useRef(null),ct=(nt==null?void 0:nt.current)!=null?nt.current:at.domElement.parentNode;return reactExports.useLayoutEffect(()=>{if(!st.current||!ct)return;const ut=document.createElement("div"),ht=lt.current=createRoot$1(ut);return ct.appendChild(ut),()=>{ht.unmount(),lt.current=null,ct.removeChild(ut)}},[ct]),reactExports.useLayoutEffect(()=>{const ut=lt.current;ut&&ut.render(jsxRuntimeExports.jsx("div",{ref:et,className:it,children:rt}))}),jsxRuntimeExports.jsx("group",_objectSpread2(_objectSpread2({},ot),{},{ref:st}))}),addTextureUniforms=(tt,et)=>{const nt=rt=>{switch(rt){case 1e3:return"RepeatWrapping";case 1001:return"ClampToEdgeWrapping";case 1002:return"MirroredRepeatWrapping";default:return"ClampToEdgeWrapping"}},it=rt=>{switch(rt){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:tt,url:et.image.currentSrc,encoding:it(et.encoding),wrapT:nt(et.image.wrapT),flipY:et.flipY.toString()}},UniformsGL=({program:tt,material:et,setTexNumber:nt})=>{const it=usePerfStore(at=>at.gl),[rt,ot]=reactExports.useState(null);return reactExports.useEffect(()=>{if(it){const at=tt==null?void 0:tt.getUniforms();let st=0;const lt=new Map;at.seq.forEach(ct=>{if(!ct.id.includes("uTroika")&&ct.id!=="isOrthographic"&&ct.id!=="uvTransform"&&ct.id!=="lightProbe"&&ct.id!=="projectionMatrix"&&ct.id!=="viewMatrix"&&ct.id!=="normalMatrix"&&ct.id!=="modelMatrix"&&ct.id!=="modelViewMatrix"){let ut=[],ht={name:ct.id};ct.cache&&(ct.cache.forEach(dt=>{typeof dt<"u"&&ut.push(dt.toString().substring(0,4))}),ht.value=ut.join(),et[ct.id]&&et[ct.id].image&&et[ct.id].image&&(st++,ht.value=addTextureUniforms(ct.id,et[ct.id])),ht.value||(ht.value="empty"),lt.set(ct.id,ht))}}),et.uniforms&&Object.keys(et.uniforms).forEach(ct=>{const ut=et.uniforms[ct];if(ut.value){const{value:ht}=ut;let dt={name:ct};if(ct.includes("uTroika"))return;if(ht instanceof Texture)st++,dt.value=addTextureUniforms(ct,ht);else{let pt=JSON.stringify(ht);try{pt=JSON.stringify(ht)}catch{pt=ht.toString()}dt.value=pt}lt.set(ct,dt)}}),st>0&&nt(st),ot(lt)}},[]),jsxRuntimeExports.jsx(ProgramsUL,{children:rt&&Array.from(rt.values()).map(at=>jsxRuntimeExports.jsx("span",{children:typeof at.value=="string"?jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsxs("span",{children:[at.name," :"," ",jsxRuntimeExports.jsxs("b",{children:[at.value.substring(0,30),at.value.length>30?"...":""]})]})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsxs("b",{children:[at.value.name,":"]})}),jsxRuntimeExports.jsxs("div",{children:[Object.keys(at.value).map(st=>st!=="name"?jsxRuntimeExports.jsx("div",{children:st==="url"?jsxRuntimeExports.jsx("a",{href:at.value[st],target:"_blank",children:jsxRuntimeExports.jsx("img",{src:at.value[st]})}):jsxRuntimeExports.jsxs("li",{children:[st,": ",jsxRuntimeExports.jsx("b",{children:at.value[st]})]})},st):null),jsxRuntimeExports.jsxs(ProgramConsole,{onClick:()=>{var st;console.info(et[at.value.name]||(et==null||(st=et.uniforms[at.value.name])===null||st===void 0?void 0:st.value))},children:["console.info(",at.value.name,");"]})]})]})},at.name))})},DynamicDrawCallInfo=({el:tt})=>{usePerfStore(it=>it.log);const et=usePerfStore(it=>it.gl),nt=it=>{if(!et)return 0;const rt=Math.round(it.drawCounts.total/(et.info.render.triangles+et.info.render.lines+et.info.render.points)*100*10)/10;return isFinite(rt)&&rt||0};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:tt.drawCounts.total>0&&jsxRuntimeExports.jsxs(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[tt.drawCounts.type==="Triangle"?jsxRuntimeExports.jsx(VercelLogoIcon,{style:{top:"-1px"}}):jsxRuntimeExports.jsx(ActivityLogIcon,{style:{top:"-1px"}}),tt.drawCounts.total,jsxRuntimeExports.jsxs("small",{children:[tt.drawCounts.type,"s"]}),et&&jsxRuntimeExports.jsxs(PerfB,{style:{bottom:"-10px",width:"40px",fontWeight:"bold"},children:[tt.visible&&!tt.material.wireframe?nt(tt):0,"%"]})]})})},ProgramUI=({el:tt})=>{const[et,nt]=reactExports.useState(tt.visible),[it,rt]=reactExports.useState(tt.expand),[ot,at]=reactExports.useState(0),{meshes:st,program:lt,material:ct}=tt;return jsxRuntimeExports.jsxs(ProgramGeo,{children:[jsxRuntimeExports.jsxs(ProgramHeader,{onClick:()=>{tt.expand=!it,Object.keys(st).forEach(ut=>{const ht=st[ut];ht.material.wireframe=!1}),rt(!it)},children:[jsxRuntimeExports.jsx(Toggle,{style:{marginRight:"6px"},children:it?jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(TriangleDownIcon,{})}):jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(TriangleUpIcon,{})})}),lt&&jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(ProgramTitle,{children:lt.name}),jsxRuntimeExports.jsxs(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[jsxRuntimeExports.jsx(LayersIcon,{style:{top:"-1px"}}),Object.keys(st).length,jsxRuntimeExports.jsx("small",{children:Object.keys(st).length>1?"users":"user"})]}),ot>0&&jsxRuntimeExports.jsxs(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[ot>1?jsxRuntimeExports.jsx(ImageIcon,{style:{top:"-1px"}}):jsxRuntimeExports.jsx(ImageIcon,{style:{top:"-1px"}}),ot,jsxRuntimeExports.jsx("small",{children:"tex"})]}),jsxRuntimeExports.jsx(DynamicDrawCallInfo,{el:tt}),ct.glslVersion==="300 es"&&jsxRuntimeExports.jsxs(PerfI,{style:{height:"auto",width:"auto",margin:"0 4px"},children:[jsxRuntimeExports.jsx(RocketIcon,{style:{top:"-1px"}}),"300",jsxRuntimeExports.jsx("small",{children:"es"}),jsxRuntimeExports.jsx(PerfB,{style:{bottom:"-10px",width:"40px"},children:"glsl"})]})]}),jsxRuntimeExports.jsx(ToggleVisible,{onPointerEnter:()=>{Object.keys(st).forEach(ut=>{const ht=st[ut];ht.material.wireframe=!0})},onPointerLeave:()=>{Object.keys(st).forEach(ut=>{const ht=st[ut];ht.material.wireframe=!1})},onClick:ut=>{ut.stopPropagation(),Object.keys(st).forEach(ht=>{const dt=st[ht],pt=!et;dt.visible=pt,tt.visible=pt,nt(pt)})},children:et?jsxRuntimeExports.jsx(EyeOpenIcon,{}):jsxRuntimeExports.jsx(EyeNoneIcon,{})})]}),jsxRuntimeExports.jsxs("div",{style:{maxHeight:it?"9999px":0,overflow:"hidden"},children:[jsxRuntimeExports.jsxs(ProgramsULHeader,{children:[jsxRuntimeExports.jsx(ButtonIcon,{})," Uniforms:"]}),jsxRuntimeExports.jsx(UniformsGL,{program:lt,material:ct,setTexNumber:at}),jsxRuntimeExports.jsxs(ProgramsULHeader,{children:[jsxRuntimeExports.jsx(CubeIcon,{})," Geometries:"]}),jsxRuntimeExports.jsx(ProgramsUL,{children:st&&Object.keys(st).map(ut=>st[ut]&&st[ut].geometry&&jsxRuntimeExports.jsxs(ProgramsGeoLi,{children:[jsxRuntimeExports.jsxs("span",{children:[st[ut].geometry.type,": "]}),st[ut].userData&&st[ut].userData.drawCount&&jsxRuntimeExports.jsxs("b",{children:[jsxRuntimeExports.jsxs("div",{children:[st[ut].userData.drawCount.count,jsxRuntimeExports.jsxs("small",{children:[" ",st[ut].userData.drawCount.type,"s"]})]}),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("div",{children:[Math.round(estimateBytesUsed(st[ut].geometry)/1024*1e3)/1e3,"Kb",jsxRuntimeExports.jsx("small",{children:" memory used"})]})]})]},ut))}),jsxRuntimeExports.jsxs(ProgramConsole,{onClick:()=>{console.info(ct)},children:["console.info(",ct.type,")"]})]})]})},ProgramsUI=()=>{usePerfStore(et=>et.triggerProgramsUpdate);const tt=usePerfStore(et=>et.programs);return jsxRuntimeExports.jsx(ProgramsContainer,{children:tt&&Array.from(tt.values()).map(et=>et&&et?jsxRuntimeExports.jsx(ProgramUI,{el:et},et.material.uuid):null)})},colorsGraph=tt=>({overClock:"#ff6eff",fps:tt?"100, 143, 255":"238,38,110",cpu:tt?"254, 254, 98":"66,226,46",gpu:tt?"254,254,254":"253,151,31",custom:tt?"86,180,233":"40,255,255"}),DynamicUIPerf=({showGraph:tt,colorBlind:et})=>{const nt=usePerfStore(rt=>rt.overclockingFps),it=usePerfStore(rt=>rt.fpsLimit);return jsxRuntimeExports.jsxs(PerfB,{style:tt?{color:nt?colorsGraph(et).overClock.toString():`rgb(${colorsGraph(et).fps})`}:{},children:["FPS ",nt?`${it}🚀`:""]})},DynamicUI=({showGraph:tt,colorBlind:et,customData:nt,minimal:it})=>{const rt=usePerfStore(ot=>ot.gl);return rt?jsxRuntimeExports.jsxs(PerfIContainer,{children:[jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(LightningBoltIcon,{}),jsxRuntimeExports.jsx(PerfB,{style:tt?{color:`rgb(${colorsGraph(et).gpu.toString()})`}:{},children:"GPU"}),jsxRuntimeExports.jsx(PerfSmallI,{children:"ms"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(RulerHorizontalIcon,{}),jsxRuntimeExports.jsx(PerfB,{style:tt?{color:`rgb(${colorsGraph(et).cpu.toString()})`}:{},children:"CPU"}),jsxRuntimeExports.jsx(PerfSmallI,{children:"ms"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(LapTimerIcon,{}),jsxRuntimeExports.jsx(DynamicUIPerf,{showGraph:tt,colorBlind:et})]}),!it&&rt&&jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(TextAlignJustifyIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:rt.info.render.calls===1?"call":"calls"})]}),!it&&rt&&jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(VercelLogoIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Triangles"})]}),nt&&jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(BarChartIcon,{}),jsxRuntimeExports.jsx(PerfB,{style:tt?{color:`rgb(${colorsGraph(et).custom})`}:{},children:nt.name}),nt.info&&jsxRuntimeExports.jsx(PerfSmallI,{children:nt.info})]})]}):null},PerfUI=({showGraph:tt,colorBlind:et,deepAnalyze:nt,customData:it,matrixUpdate:rt,openByDefault:ot,minimal:at})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(DynamicUI,{showGraph:tt,colorBlind:et,customData:it,minimal:at}),!at&&jsxRuntimeExports.jsx(PerfThree,{matrixUpdate:rt,openByDefault:ot,deepAnalyze:nt,showGraph:tt})]}),InfoUI=({matrixUpdate:tt})=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(MarginIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Geometries"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(ImageIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Textures"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(ActivityLogIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"shaders"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(MinusIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Lines"})]}),jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(DotIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Points"})]}),tt&&jsxRuntimeExports.jsxs(PerfI,{children:[jsxRuntimeExports.jsx(DropdownMenuIcon,{}),jsxRuntimeExports.jsx(PerfB,{children:"Matrices"})]})]}),ToggleEl=({tab:tt,title:et,set:nt})=>{const it=usePerfStore(rt=>rt.tab);return jsxRuntimeExports.jsx(Toggle,{className:`${it===tt?" __perf_toggle_tab_active":""}`,onClick:()=>{nt(!0),usePerfStore.setState({tab:tt})},children:jsxRuntimeExports.jsx("span",{children:et})})},PerfThree=({openByDefault:tt,showGraph:et,deepAnalyze:nt,matrixUpdate:it})=>{const[rt,ot]=React$1.useState(tt);return jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(TabContainers,{show:rt,showGraph:et,matrixUpdate:it}),tt&&!nt?null:jsxRuntimeExports.jsxs(ToggleContainer,{className:"__perf_toggle",children:[nt&&jsxRuntimeExports.jsx(ToggleEl,{tab:"programs",title:"Programs",set:ot}),nt&&jsxRuntimeExports.jsx(ToggleEl,{tab:"infos",title:"Infos",set:ot}),jsxRuntimeExports.jsx(Toggle,{onClick:()=>{ot(!rt)},children:rt?jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(TriangleDownIcon,{})," Minimize"]}):jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(TriangleUpIcon,{})," More"]})})]})]})},TabContainers=({show:tt,showGraph:et,matrixUpdate:nt})=>{const it=usePerfStore(rt=>rt.tab);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(InfoUI,{matrixUpdate:nt}),tt&&jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(ContainerScroll,{style:{marginTop:et?"38px":0},children:it==="programs"&&jsxRuntimeExports.jsx(ProgramsUI,{})})})]})},Gui=({showGraph:tt,colorBlind:et,openByDefault:nt,className:it,overClock:rt,style:ot,position:at,chart:st,deepAnalyze:lt,antialias:ct,customData:ut,matrixUpdate:ht,minimal:dt})=>{const pt=reactExports.useRef(null);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Headless,{chart:st,overClock:rt,deepAnalyze:lt,matrixUpdate:ht}),jsxRuntimeExports.jsx(Html,{transform:!1,children:jsxRuntimeExports.jsxs(PerfS,{className:(it?" ".concat(it):" ")+` ${at||""} ${dt?"minimal":""}`,style:_objectSpread2({minHeight:dt?"37px":tt?"100px":"60px"},ot),ref:pt,children:[jsxRuntimeExports.jsx(ChartUI,{perfContainerRef:pt,colorBlind:et,chart:st,showGraph:tt,antialias:ct,customData:ut,minimal:dt,matrixUpdate:ht}),jsxRuntimeExports.jsx(PerfUI,{colorBlind:et,showGraph:tt,deepAnalyze:lt,openByDefault:nt,customData:ut,matrixUpdate:ht,minimal:dt})]})})]})},Perf=({headless:tt=!1,colorBlind:et=!1,overClock:nt=!1,showGraph:it=!0,trackCPU:rt=!1,deepAnalyze:ot=!1,antialias:at=!0,openByDefault:st=!0,customData:lt,matrixUpdate:ct=!1,position:ut="top-right",chart:ht={length:30,hz:15},className:dt,style:pt,minimal:mt=!1})=>tt?jsxRuntimeExports.jsx(Headless,{chart:ht,deepAnalyze:ot,matrixUpdate:ct,overClock:nt}):jsxRuntimeExports.jsx(Gui,{colorBlind:et,showGraph:it,trackCPU:rt,openByDefault:st,className:dt,style:pt,overClock:nt,position:ut,antialias:at,chart:ht,deepAnalyze:ot,minimal:mt,customData:lt,matrixUpdate:ct}),UNIVERSE_SCALE=5e3,DATA_COLOR_PALETTE={show:"#FF723C",clip:"#FFFF00",episode:"#FF7F50",guest:"#E066FF",topic:"#F8F8FF"},getNodeColorByType=(tt,et)=>{const nt=DATA_COLOR_PALETTE[tt]||"#F8F8FF";return et?nt:parseInt(nt.replace("#","0x"),16)},defaultData$5={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},useControlStore=react(tt=>({...defaultData$5,setIsUserDragging:et=>tt({isUserDragging:et}),setIsUserScrolling:et=>tt({isUserScrolling:et}),setUserMovedCamera:et=>tt({userMovedCamera:et}),setIsUserScrollingOnHtmlPanel:et=>tt({isUserScrollingOnHtmlPanel:et})}));function _assertThisInitialized$c(tt){if(tt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return tt}function _inheritsLoose(tt,et){tt.prototype=Object.create(et.prototype),tt.prototype.constructor=tt,tt.__proto__=et}/*! + * 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 _config={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},_defaults={duration:.5,overwrite:!1,delay:0},_suppressOverwrites,_reverting$1,_context,_bigNum$1=1e8,_tinyNum=1/_bigNum$1,_2PI=Math.PI*2,_HALF_PI=_2PI/4,_gsID=0,_sqrt=Math.sqrt,_cos=Math.cos,_sin=Math.sin,_isString=function tt(et){return typeof et=="string"},_isFunction=function tt(et){return typeof et=="function"},_isNumber=function tt(et){return typeof et=="number"},_isUndefined=function tt(et){return typeof et>"u"},_isObject=function tt(et){return typeof et=="object"},_isNotFalse=function tt(et){return et!==!1},_windowExists$1=function tt(){return typeof window<"u"},_isFuncOrString=function tt(et){return _isFunction(et)||_isString(et)},_isTypedArray=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},_isArray=Array.isArray,_strictNumExp=/(?:-?\.?\d|\.)+/gi,_numExp=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,_numWithUnitExp=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,_complexStringNumExp=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,_relExp=/[+-]=-?[.\d]+/,_delimitedValueExp=/[^,'"\[\]\s]+/gi,_unitExp=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,_globalTimeline,_win$1,_coreInitted,_doc$1,_globals={},_installScope={},_coreReady,_install=function tt(et){return(_installScope=_merge(et,_globals))&&gsap},_missingPlugin=function tt(et,nt){return console.warn("Invalid property",et,"set to",nt,"Missing plugin? gsap.registerPlugin()")},_warn=function tt(et,nt){return!nt&&console.warn(et)},_addGlobal=function tt(et,nt){return et&&(_globals[et]=nt)&&_installScope&&(_installScope[et]=nt)||_globals},_emptyFunc=function tt(){return 0},_startAtRevertConfig={suppressEvents:!0,isStart:!0,kill:!1},_revertConfigNoKill={suppressEvents:!0,kill:!1},_revertConfig={suppressEvents:!0},_reservedProps={},_lazyTweens=[],_lazyLookup={},_lastRenderedFrame,_plugins={},_effects={},_nextGCFrame=30,_harnessPlugins=[],_callbackNames="",_harness=function tt(et){var nt=et[0],it,rt;if(_isObject(nt)||_isFunction(nt)||(et=[et]),!(it=(nt._gsap||{}).harness)){for(rt=_harnessPlugins.length;rt--&&!_harnessPlugins[rt].targetTest(nt););it=_harnessPlugins[rt]}for(rt=et.length;rt--;)et[rt]&&(et[rt]._gsap||(et[rt]._gsap=new GSCache(et[rt],it)))||et.splice(rt,1);return et},_getCache=function tt(et){return et._gsap||_harness(toArray$2(et))[0]._gsap},_getProperty=function tt(et,nt,it){return(it=et[nt])&&_isFunction(it)?et[nt]():_isUndefined(it)&&et.getAttribute&&et.getAttribute(nt)||it},_forEachName=function tt(et,nt){return(et=et.split(",")).forEach(nt)||et},_round=function tt(et){return Math.round(et*1e5)/1e5||0},_roundPrecise=function tt(et){return Math.round(et*1e7)/1e7||0},_parseRelative=function tt(et,nt){var it=nt.charAt(0),rt=parseFloat(nt.substr(2));return et=parseFloat(et),it==="+"?et+rt:it==="-"?et-rt:it==="*"?et*rt:et/rt},_arrayContainsAny=function tt(et,nt){for(var it=nt.length,rt=0;et.indexOf(nt[rt])<0&&++rtst;)at=at._prev;return at?(nt._next=at._next,at._next=nt):(nt._next=et[it],et[it]=nt),nt._next?nt._next._prev=nt:et[rt]=nt,nt._prev=at,nt.parent=nt._dp=et,nt},_removeLinkedListItem=function tt(et,nt,it,rt){it===void 0&&(it="_first"),rt===void 0&&(rt="_last");var ot=nt._prev,at=nt._next;ot?ot._next=at:et[it]===nt&&(et[it]=at),at?at._prev=ot:et[rt]===nt&&(et[rt]=ot),nt._next=nt._prev=nt.parent=null},_removeFromParent=function tt(et,nt){et.parent&&(!nt||et.parent.autoRemoveChildren)&&et.parent.remove&&et.parent.remove(et),et._act=0},_uncache=function tt(et,nt){if(et&&(!nt||nt._end>et._dur||nt._start<0))for(var it=et;it;)it._dirty=1,it=it.parent;return et},_recacheAncestors=function tt(et){for(var nt=et.parent;nt&&nt.parent;)nt._dirty=1,nt.totalDuration(),nt=nt.parent;return et},_rewindStartAt=function tt(et,nt,it,rt){return et._startAt&&(_reverting$1?et._startAt.revert(_revertConfigNoKill):et.vars.immediateRender&&!et.vars.autoRevert||et._startAt.render(nt,!0,rt))},_hasNoPausedAncestors=function tt(et){return!et||et._ts&&tt(et.parent)},_elapsedCycleDuration=function tt(et){return et._repeat?_animationCycle(et._tTime,et=et.duration()+et._rDelay)*et:0},_animationCycle=function tt(et,nt){var it=Math.floor(et/=nt);return et&&it===et?it-1:it},_parentToChildTotalTime=function tt(et,nt){return(et-nt._start)*nt._ts+(nt._ts>=0?0:nt._dirty?nt.totalDuration():nt._tDur)},_setEnd=function tt(et){return et._end=_roundPrecise(et._start+(et._tDur/Math.abs(et._ts||et._rts||_tinyNum)||0))},_alignPlayhead=function tt(et,nt){var it=et._dp;return it&&it.smoothChildTiming&&et._ts&&(et._start=_roundPrecise(it._time-(et._ts>0?nt/et._ts:((et._dirty?et.totalDuration():et._tDur)-nt)/-et._ts)),_setEnd(et),it._dirty||_uncache(it,et)),et},_postAddChecks=function tt(et,nt){var it;if((nt._time||!nt._dur&&nt._initted||nt._start_tinyNum)&&nt.render(it,!0)),_uncache(et,nt)._dp&&et._initted&&et._time>=et._dur&&et._ts){if(et._dur=0&&it.totalTime(it._tTime),it=it._dp;et._zTime=-_tinyNum}},_addToTimeline=function tt(et,nt,it,rt){return nt.parent&&_removeFromParent(nt),nt._start=_roundPrecise((_isNumber(it)?it:it||et!==_globalTimeline?_parsePosition(et,it,nt):et._time)+nt._delay),nt._end=_roundPrecise(nt._start+(nt.totalDuration()/Math.abs(nt.timeScale())||0)),_addLinkedListItem(et,nt,"_first","_last",et._sort?"_start":0),_isFromOrFromStart(nt)||(et._recent=nt),rt||_postAddChecks(et,nt),et._ts<0&&_alignPlayhead(et,et._tTime),et},_scrollTrigger=function tt(et,nt){return(_globals.ScrollTrigger||_missingPlugin("scrollTrigger",nt))&&_globals.ScrollTrigger.create(nt,et)},_attemptInitTween=function tt(et,nt,it,rt,ot){if(_initTween(et,nt,ot),!et._initted)return 1;if(!it&&et._pt&&!_reverting$1&&(et._dur&&et.vars.lazy!==!1||!et._dur&&et.vars.lazy)&&_lastRenderedFrame!==_ticker.frame)return _lazyTweens.push(et),et._lazy=[ot,rt],1},_parentPlayheadIsBeforeStart=function tt(et){var nt=et.parent;return nt&&nt._ts&&nt._initted&&!nt._lock&&(nt.rawTime()<0||tt(nt))},_isFromOrFromStart=function tt(et){var nt=et.data;return nt==="isFromStart"||nt==="isStart"},_renderZeroDurationTween=function tt(et,nt,it,rt){var ot=et.ratio,at=nt<0||!nt&&(!et._start&&_parentPlayheadIsBeforeStart(et)&&!(!et._initted&&_isFromOrFromStart(et))||(et._ts<0||et._dp._ts<0)&&!_isFromOrFromStart(et))?0:1,st=et._rDelay,lt=0,ct,ut,ht;if(st&&et._repeat&&(lt=_clamp(0,et._tDur,nt),ut=_animationCycle(lt,st),et._yoyo&&ut&1&&(at=1-at),ut!==_animationCycle(et._tTime,st)&&(ot=1-at,et.vars.repeatRefresh&&et._initted&&et.invalidate())),at!==ot||_reverting$1||rt||et._zTime===_tinyNum||!nt&&et._zTime){if(!et._initted&&_attemptInitTween(et,nt,rt,it,lt))return;for(ht=et._zTime,et._zTime=nt||(it?_tinyNum:0),it||(it=nt&&!ht),et.ratio=at,et._from&&(at=1-at),et._time=0,et._tTime=lt,ct=et._pt;ct;)ct.r(at,ct.d),ct=ct._next;nt<0&&_rewindStartAt(et,nt,it,!0),et._onUpdate&&!it&&_callback(et,"onUpdate"),lt&&et._repeat&&!it&&et.parent&&_callback(et,"onRepeat"),(nt>=et._tDur||nt<0)&&et.ratio===at&&(at&&_removeFromParent(et,1),!it&&!_reverting$1&&(_callback(et,at?"onComplete":"onReverseComplete",!0),et._prom&&et._prom()))}else et._zTime||(et._zTime=nt)},_findNextPauseTween=function tt(et,nt,it){var rt;if(it>nt)for(rt=et._first;rt&&rt._start<=it;){if(rt.data==="isPause"&&rt._start>nt)return rt;rt=rt._next}else for(rt=et._last;rt&&rt._start>=it;){if(rt.data==="isPause"&&rt._start0&&!rt&&_alignPlayhead(et,et._tTime=et._tDur*st),et.parent&&_setEnd(et),it||_uncache(et.parent,et),et},_onUpdateTotalDuration=function tt(et){return et instanceof Timeline$1?_uncache(et):_setDuration(et,et._dur)},_zeroPosition={_start:0,endTime:_emptyFunc,totalDuration:_emptyFunc},_parsePosition=function tt(et,nt,it){var rt=et.labels,ot=et._recent||_zeroPosition,at=et.duration()>=_bigNum$1?ot.endTime(!1):et._dur,st,lt,ct;return _isString(nt)&&(isNaN(nt)||nt in rt)?(lt=nt.charAt(0),ct=nt.substr(-1)==="%",st=nt.indexOf("="),lt==="<"||lt===">"?(st>=0&&(nt=nt.replace(/=/,"")),(lt==="<"?ot._start:ot.endTime(ot._repeat>=0))+(parseFloat(nt.substr(1))||0)*(ct?(st<0?ot:it).totalDuration()/100:1)):st<0?(nt in rt||(rt[nt]=at),rt[nt]):(lt=parseFloat(nt.charAt(st-1)+nt.substr(st+1)),ct&&it&&(lt=lt/100*(_isArray(it)?it[0]:it).totalDuration()),st>1?tt(et,nt.substr(0,st-1),it)+lt:at+lt)):nt==null?at:+nt},_createTweenType=function tt(et,nt,it){var rt=_isNumber(nt[1]),ot=(rt?2:1)+(et<2?0:1),at=nt[ot],st,lt;if(rt&&(at.duration=nt[1]),at.parent=it,et){for(st=at,lt=it;lt&&!("immediateRender"in st);)st=lt.vars.defaults||{},lt=_isNotFalse(lt.vars.inherit)&<.parent;at.immediateRender=_isNotFalse(st.immediateRender),et<2?at.runBackwards=1:at.startAt=nt[ot-1]}return new Tween(nt[0],at,nt[ot+1])},_conditionalReturn=function tt(et,nt){return et||et===0?nt(et):nt},_clamp=function tt(et,nt,it){return itnt?nt:it},getUnit=function tt(et,nt){return!_isString(et)||!(nt=_unitExp.exec(et))?"":nt[1]},clamp$2=function tt(et,nt,it){return _conditionalReturn(it,function(rt){return _clamp(et,nt,rt)})},_slice=[].slice,_isArrayLike=function tt(et,nt){return et&&_isObject(et)&&"length"in et&&(!nt&&!et.length||et.length-1 in et&&_isObject(et[0]))&&!et.nodeType&&et!==_win$1},_flatten=function tt(et,nt,it){return it===void 0&&(it=[]),et.forEach(function(rt){var ot;return _isString(rt)&&!nt||_isArrayLike(rt,1)?(ot=it).push.apply(ot,toArray$2(rt)):it.push(rt)})||it},toArray$2=function tt(et,nt,it){return _context&&!nt&&_context.selector?_context.selector(et):_isString(et)&&!it&&(_coreInitted||!_wake())?_slice.call((nt||_doc$1).querySelectorAll(et),0):_isArray(et)?_flatten(et,it):_isArrayLike(et)?_slice.call(et,0):et?[et]:[]},selector$1=function tt(et){return et=toArray$2(et)[0]||_warn("Invalid scope")||{},function(nt){var it=et.current||et.nativeElement||et;return toArray$2(nt,it.querySelectorAll?it:it===et?_warn("Invalid scope")||_doc$1.createElement("div"):et)}},shuffle=function tt(et){return et.sort(function(){return .5-Math.random()})},distribute=function tt(et){if(_isFunction(et))return et;var nt=_isObject(et)?et:{each:et},it=_parseEase(nt.ease),rt=nt.from||0,ot=parseFloat(nt.base)||0,at={},st=rt>0&&rt<1,lt=isNaN(rt)||st,ct=nt.axis,ut=rt,ht=rt;return _isString(rt)?ut=ht={center:.5,edges:.5,end:1}[rt]||0:!st&<&&(ut=rt[0],ht=rt[1]),function(dt,pt,mt){var gt=(mt||nt).length,bt=at[gt],yt,wt,vt,xt,St,Et,It,Tt,$t;if(!bt){if($t=nt.grid==="auto"?0:(nt.grid||[1,_bigNum$1])[1],!$t){for(It=-_bigNum$1;It<(It=mt[$t++].getBoundingClientRect().left)&&$tIt&&(It=St),Stgt?gt-1:ct?ct==="y"?gt/$t:$t:Math.max($t,gt/$t))||0)*(rt==="edges"?-1:1),bt.b=gt<0?ot-gt:ot,bt.u=getUnit(nt.amount||nt.each)||0,it=it&><0?_invertEase(it):it}return gt=(bt[dt]-bt.min)/bt.max||0,_roundPrecise(bt.b+(it?it(gt):gt)*bt.v)+bt.u}},_roundModifier=function tt(et){var nt=Math.pow(10,((et+"").split(".")[1]||"").length);return function(it){var rt=_roundPrecise(Math.round(parseFloat(it)/et)*et*nt);return(rt-rt%1)/nt+(_isNumber(it)?0:getUnit(it))}},snap=function tt(et,nt){var it=_isArray(et),rt,ot;return!it&&_isObject(et)&&(rt=it=et.radius||_bigNum$1,et.values?(et=toArray$2(et.values),(ot=!_isNumber(et[0]))&&(rt*=rt)):et=_roundModifier(et.increment)),_conditionalReturn(nt,it?_isFunction(et)?function(at){return ot=et(at),Math.abs(ot-at)<=rt?ot:at}:function(at){for(var st=parseFloat(ot?at.x:at),lt=parseFloat(ot?at.y:0),ct=_bigNum$1,ut=0,ht=et.length,dt,pt;ht--;)ot?(dt=et[ht].x-st,pt=et[ht].y-lt,dt=dt*dt+pt*pt):dt=Math.abs(et[ht]-st),dtrt?ot-at:at)})},_replaceRandom=function tt(et){for(var nt=0,it="",rt,ot,at,st;~(rt=et.indexOf("random(",nt));)at=et.indexOf(")",rt),st=et.charAt(rt+7)==="[",ot=et.substr(rt+7,at-rt-7).match(st?_delimitedValueExp:_strictNumExp),it+=et.substr(nt,rt-nt)+random(st?ot:+ot[0],st?0:+ot[1],+ot[2]||1e-5),nt=at+1;return it+et.substr(nt,et.length-nt)},mapRange=function tt(et,nt,it,rt,ot){var at=nt-et,st=rt-it;return _conditionalReturn(ot,function(lt){return it+((lt-et)/at*st||0)})},interpolate$2=function tt(et,nt,it,rt){var ot=isNaN(et+nt)?0:function(pt){return(1-pt)*et+pt*nt};if(!ot){var at=_isString(et),st={},lt,ct,ut,ht,dt;if(it===!0&&(rt=1)&&(it=null),at)et={p:et},nt={p:nt};else if(_isArray(et)&&!_isArray(nt)){for(ut=[],ht=et.length,dt=ht-2,ct=1;ct(st=Math.abs(st))&&(lt=at,ot=st);return lt},_callback=function tt(et,nt,it){var rt=et.vars,ot=rt[nt],at=_context,st=et._ctx,lt,ct,ut;if(ot)return lt=rt[nt+"Params"],ct=rt.callbackScope||et,it&&_lazyTweens.length&&_lazyRender(),st&&(_context=st),ut=lt?ot.apply(ct,lt):ot.call(ct),_context=at,ut},_interrupt=function tt(et){return _removeFromParent(et),et.scrollTrigger&&et.scrollTrigger.kill(!!_reverting$1),et.progress()<1&&_callback(et,"onInterrupt"),et},_quickTween,_registerPluginQueue=[],_createPlugin=function tt(et){if(_windowExists$1()&&et){et=!et.name&&et.default||et;var nt=et.name,it=_isFunction(et),rt=nt&&!it&&et.init?function(){this._props=[]}:et,ot={init:_emptyFunc,render:_renderPropTweens,add:_addPropTween,kill:_killPropTweensOf,modifier:_addPluginModifier,rawVars:0},at={targetTest:0,get:0,getSetter:_getSetter,aliases:{},register:0};if(_wake(),et!==rt){if(_plugins[nt])return;_setDefaults(rt,_setDefaults(_copyExcluding(et,ot),at)),_merge(rt.prototype,_merge(ot,_copyExcluding(et,at))),_plugins[rt.prop=nt]=rt,et.targetTest&&(_harnessPlugins.push(rt),_reservedProps[nt]=1),nt=(nt==="css"?"CSS":nt.charAt(0).toUpperCase()+nt.substr(1))+"Plugin"}_addGlobal(nt,rt),et.register&&et.register(gsap,rt,PropTween)}else et&&_registerPluginQueue.push(et)},_255=255,_colorLookup={aqua:[0,_255,_255],lime:[0,_255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,_255],navy:[0,0,128],white:[_255,_255,_255],olive:[128,128,0],yellow:[_255,_255,0],orange:[_255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[_255,0,0],pink:[_255,192,203],cyan:[0,_255,_255],transparent:[_255,_255,_255,0]},_hue=function tt(et,nt,it){return et+=et<0?1:et>1?-1:0,(et*6<1?nt+(it-nt)*et*6:et<.5?it:et*3<2?nt+(it-nt)*(2/3-et)*6:nt)*_255+.5|0},splitColor=function tt(et,nt,it){var rt=et?_isNumber(et)?[et>>16,et>>8&_255,et&_255]:0:_colorLookup.black,ot,at,st,lt,ct,ut,ht,dt,pt,mt;if(!rt){if(et.substr(-1)===","&&(et=et.substr(0,et.length-1)),_colorLookup[et])rt=_colorLookup[et];else if(et.charAt(0)==="#"){if(et.length<6&&(ot=et.charAt(1),at=et.charAt(2),st=et.charAt(3),et="#"+ot+ot+at+at+st+st+(et.length===5?et.charAt(4)+et.charAt(4):"")),et.length===9)return rt=parseInt(et.substr(1,6),16),[rt>>16,rt>>8&_255,rt&_255,parseInt(et.substr(7),16)/255];et=parseInt(et.substr(1),16),rt=[et>>16,et>>8&_255,et&_255]}else if(et.substr(0,3)==="hsl"){if(rt=mt=et.match(_strictNumExp),!nt)lt=+rt[0]%360/360,ct=+rt[1]/100,ut=+rt[2]/100,at=ut<=.5?ut*(ct+1):ut+ct-ut*ct,ot=ut*2-at,rt.length>3&&(rt[3]*=1),rt[0]=_hue(lt+1/3,ot,at),rt[1]=_hue(lt,ot,at),rt[2]=_hue(lt-1/3,ot,at);else if(~et.indexOf("="))return rt=et.match(_numExp),it&&rt.length<4&&(rt[3]=1),rt}else rt=et.match(_strictNumExp)||_colorLookup.transparent;rt=rt.map(Number)}return nt&&!mt&&(ot=rt[0]/_255,at=rt[1]/_255,st=rt[2]/_255,ht=Math.max(ot,at,st),dt=Math.min(ot,at,st),ut=(ht+dt)/2,ht===dt?lt=ct=0:(pt=ht-dt,ct=ut>.5?pt/(2-ht-dt):pt/(ht+dt),lt=ht===ot?(at-st)/pt+(atet&&(it+=yt-nt),rt+=yt,St=rt-it,vt=St-at,(vt>0||wt)&&(Et=++ht.frame,dt=St-ht.time*1e3,ht.time=St=St/1e3,at+=vt+(vt>=ot?4:ot-vt),xt=1),wt||(lt=ct(gt)),xt)for(pt=0;pt=yt&&pt--},_listeners:st},ht}(),_wake=function tt(){return!_tickerActive&&_ticker.wake()},_easeMap={},_customEaseExp=/^[\d.\-M][\d.\-,\s]/,_quotesExp=/["']/g,_parseObjectInString=function tt(et){for(var nt={},it=et.substr(1,et.length-3).split(":"),rt=it[0],ot=1,at=it.length,st,lt,ct;ot1&&it.config?it.config.apply(null,~et.indexOf("{")?[_parseObjectInString(nt[1])]:_valueInParentheses(et).split(",").map(_numericIfPossible)):_easeMap._CE&&_customEaseExp.test(et)?_easeMap._CE("",et):it},_invertEase=function tt(et){return function(nt){return 1-et(1-nt)}},_propagateYoyoEase=function tt(et,nt){for(var it=et._first,rt;it;)it instanceof Timeline$1?tt(it,nt):it.vars.yoyoEase&&(!it._yoyo||!it._repeat)&&it._yoyo!==nt&&(it.timeline?tt(it.timeline,nt):(rt=it._ease,it._ease=it._yEase,it._yEase=rt,it._yoyo=nt)),it=it._next},_parseEase=function tt(et,nt){return et&&(_isFunction(et)?et:_easeMap[et]||_configEaseFromString(et))||nt},_insertEase=function tt(et,nt,it,rt){it===void 0&&(it=function(lt){return 1-nt(1-lt)}),rt===void 0&&(rt=function(lt){return lt<.5?nt(lt*2)/2:1-nt((1-lt)*2)/2});var ot={easeIn:nt,easeOut:it,easeInOut:rt},at;return _forEachName(et,function(st){_easeMap[st]=_globals[st]=ot,_easeMap[at=st.toLowerCase()]=it;for(var lt in ot)_easeMap[at+(lt==="easeIn"?".in":lt==="easeOut"?".out":".inOut")]=_easeMap[st+"."+lt]=ot[lt]}),ot},_easeInOutFromOut=function tt(et){return function(nt){return nt<.5?(1-et(1-nt*2))/2:.5+et((nt-.5)*2)/2}},_configElastic=function tt(et,nt,it){var rt=nt>=1?nt:1,ot=(it||(et?.3:.45))/(nt<1?nt:1),at=ot/_2PI*(Math.asin(1/rt)||0),st=function(ut){return ut===1?1:rt*Math.pow(2,-10*ut)*_sin((ut-at)*ot)+1},lt=et==="out"?st:et==="in"?function(ct){return 1-st(1-ct)}:_easeInOutFromOut(st);return ot=_2PI/ot,lt.config=function(ct,ut){return tt(et,ct,ut)},lt},_configBack=function tt(et,nt){nt===void 0&&(nt=1.70158);var it=function(at){return at?--at*at*((nt+1)*at+nt)+1:0},rt=et==="out"?it:et==="in"?function(ot){return 1-it(1-ot)}:_easeInOutFromOut(it);return rt.config=function(ot){return tt(et,ot)},rt};_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong",function(tt,et){var nt=et<5?et+1:et;_insertEase(tt+",Power"+(nt-1),et?function(it){return Math.pow(it,nt)}:function(it){return it},function(it){return 1-Math.pow(1-it,nt)},function(it){return it<.5?Math.pow(it*2,nt)/2:1-Math.pow((1-it)*2,nt)/2})});_easeMap.Linear.easeNone=_easeMap.none=_easeMap.Linear.easeIn;_insertEase("Elastic",_configElastic("in"),_configElastic("out"),_configElastic());(function(tt,et){var nt=1/et,it=2*nt,rt=2.5*nt,ot=function(st){return st0?it+(it+this._rDelay)*this._repeat:it):this.totalDuration()&&this._dur},et.totalDuration=function(it){return arguments.length?(this._dirty=0,_setDuration(this,this._repeat<0?it:(it-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},et.totalTime=function(it,rt){if(_wake(),!arguments.length)return this._tTime;var ot=this._dp;if(ot&&ot.smoothChildTiming&&this._ts){for(_alignPlayhead(this,it),!ot._dp||ot.parent||_postAddChecks(ot,this);ot&&ot.parent;)ot.parent._time!==ot._start+(ot._ts>=0?ot._tTime/ot._ts:(ot.totalDuration()-ot._tTime)/-ot._ts)&&ot.totalTime(ot._tTime,!0),ot=ot.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&it0||!this._tDur&&!it)&&_addToTimeline(this._dp,this,this._start-this._delay)}return(this._tTime!==it||!this._dur&&!rt||this._initted&&Math.abs(this._zTime)===_tinyNum||!it&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=it),_lazySafeRender(this,it,rt)),this},et.time=function(it,rt){return arguments.length?this.totalTime(Math.min(this.totalDuration(),it+_elapsedCycleDuration(this))%(this._dur+this._rDelay)||(it?this._dur:0),rt):this._time},et.totalProgress=function(it,rt){return arguments.length?this.totalTime(this.totalDuration()*it,rt):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},et.progress=function(it,rt){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-it:it)+_elapsedCycleDuration(this),rt):this.duration()?Math.min(1,this._time/this._dur):this.ratio},et.iteration=function(it,rt){var ot=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(it-1)*ot,rt):this._repeat?_animationCycle(this._tTime,ot)+1:1},et.timeScale=function(it,rt){if(!arguments.length)return this._rts===-_tinyNum?0:this._rts;if(this._rts===it)return this;var ot=this.parent&&this._ts?_parentToChildTotalTime(this.parent._time,this):this._tTime;return this._rts=+it||0,this._ts=this._ps||it===-_tinyNum?0:this._rts,this.totalTime(_clamp(-Math.abs(this._delay),this._tDur,ot),rt!==!1),_setEnd(this),_recacheAncestors(this)},et.paused=function(it){return arguments.length?(this._ps!==it&&(this._ps=it,it?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(_wake(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==_tinyNum&&(this._tTime-=_tinyNum)))),this):this._ps},et.startTime=function(it){if(arguments.length){this._start=it;var rt=this.parent||this._dp;return rt&&(rt._sort||!this.parent)&&_addToTimeline(rt,this,it-this._delay),this}return this._start},et.endTime=function(it){return this._start+(_isNotFalse(it)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},et.rawTime=function(it){var rt=this.parent||this._dp;return rt?it&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?_parentToChildTotalTime(rt.rawTime(it),this):this._tTime:this._tTime},et.revert=function(it){it===void 0&&(it=_revertConfig);var rt=_reverting$1;return _reverting$1=it,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(it),this.totalTime(-.01,it.suppressEvents)),this.data!=="nested"&&it.kill!==!1&&this.kill(),_reverting$1=rt,this},et.globalTime=function(it){for(var rt=this,ot=arguments.length?it:rt.rawTime();rt;)ot=rt._start+ot/(Math.abs(rt._ts)||1),rt=rt._dp;return!this.parent&&this._sat?this._sat.globalTime(it):ot},et.repeat=function(it){return arguments.length?(this._repeat=it===1/0?-2:it,_onUpdateTotalDuration(this)):this._repeat===-2?1/0:this._repeat},et.repeatDelay=function(it){if(arguments.length){var rt=this._time;return this._rDelay=it,_onUpdateTotalDuration(this),rt?this.time(rt):this}return this._rDelay},et.yoyo=function(it){return arguments.length?(this._yoyo=it,this):this._yoyo},et.seek=function(it,rt){return this.totalTime(_parsePosition(this,it),_isNotFalse(rt))},et.restart=function(it,rt){return this.play().totalTime(it?-this._delay:0,_isNotFalse(rt))},et.play=function(it,rt){return it!=null&&this.seek(it,rt),this.reversed(!1).paused(!1)},et.reverse=function(it,rt){return it!=null&&this.seek(it||this.totalDuration(),rt),this.reversed(!0).paused(!1)},et.pause=function(it,rt){return it!=null&&this.seek(it,rt),this.paused(!0)},et.resume=function(){return this.paused(!1)},et.reversed=function(it){return arguments.length?(!!it!==this.reversed()&&this.timeScale(-this._rts||(it?-_tinyNum:0)),this):this._rts<0},et.invalidate=function(){return this._initted=this._act=0,this._zTime=-_tinyNum,this},et.isActive=function(){var it=this.parent||this._dp,rt=this._start,ot;return!!(!it||this._ts&&this._initted&&it.isActive()&&(ot=it.rawTime(!0))>=rt&&ot1?(rt?(at[it]=rt,ot&&(at[it+"Params"]=ot),it==="onUpdate"&&(this._onUpdate=rt)):delete at[it],this):at[it]},et.then=function(it){var rt=this;return new Promise(function(ot){var at=_isFunction(it)?it:_passThrough,st=function(){var ct=rt.then;rt.then=null,_isFunction(at)&&(at=at(rt))&&(at.then||at===rt)&&(rt.then=ct),ot(at),rt.then=ct};rt._initted&&rt.totalProgress()===1&&rt._ts>=0||!rt._tTime&&rt._ts<0?st():rt._prom=st})},et.kill=function(){_interrupt(this)},tt}();_setDefaults(Animation.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:-_tinyNum,_prom:0,_ps:!1,_rts:1});var Timeline$1=function(tt){_inheritsLoose(et,tt);function et(it,rt){var ot;return it===void 0&&(it={}),ot=tt.call(this,it)||this,ot.labels={},ot.smoothChildTiming=!!it.smoothChildTiming,ot.autoRemoveChildren=!!it.autoRemoveChildren,ot._sort=_isNotFalse(it.sortChildren),_globalTimeline&&_addToTimeline(it.parent||_globalTimeline,_assertThisInitialized$d(ot),rt),it.reversed&&ot.reverse(),it.paused&&ot.paused(!0),it.scrollTrigger&&_scrollTrigger(_assertThisInitialized$d(ot),it.scrollTrigger),ot}var nt=et.prototype;return nt.to=function(rt,ot,at){return _createTweenType(0,arguments,this),this},nt.from=function(rt,ot,at){return _createTweenType(1,arguments,this),this},nt.fromTo=function(rt,ot,at,st){return _createTweenType(2,arguments,this),this},nt.set=function(rt,ot,at){return ot.duration=0,ot.parent=this,_inheritDefaults(ot).repeatDelay||(ot.repeat=0),ot.immediateRender=!!ot.immediateRender,new Tween(rt,ot,_parsePosition(this,at),1),this},nt.call=function(rt,ot,at){return _addToTimeline(this,Tween.delayedCall(0,rt,ot),at)},nt.staggerTo=function(rt,ot,at,st,lt,ct,ut){return at.duration=ot,at.stagger=at.stagger||st,at.onComplete=ct,at.onCompleteParams=ut,at.parent=this,new Tween(rt,at,_parsePosition(this,lt)),this},nt.staggerFrom=function(rt,ot,at,st,lt,ct,ut){return at.runBackwards=1,_inheritDefaults(at).immediateRender=_isNotFalse(at.immediateRender),this.staggerTo(rt,ot,at,st,lt,ct,ut)},nt.staggerFromTo=function(rt,ot,at,st,lt,ct,ut,ht){return st.startAt=at,_inheritDefaults(st).immediateRender=_isNotFalse(st.immediateRender),this.staggerTo(rt,ot,st,lt,ct,ut,ht)},nt.render=function(rt,ot,at){var st=this._time,lt=this._dirty?this.totalDuration():this._tDur,ct=this._dur,ut=rt<=0?0:_roundPrecise(rt),ht=this._zTime<0!=rt<0&&(this._initted||!ct),dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,It;if(this!==_globalTimeline&&ut>lt&&rt>=0&&(ut=lt),ut!==this._tTime||at||ht){if(st!==this._time&&ct&&(ut+=this._time-st,rt+=this._time-st),dt=ut,xt=this._start,vt=this._ts,yt=!vt,ht&&(ct||(st=this._zTime),(rt||!ot)&&(this._zTime=rt)),this._repeat){if(Et=this._yoyo,bt=ct+this._rDelay,this._repeat<-1&&rt<0)return this.totalTime(bt*100+rt,ot,at);if(dt=_roundPrecise(ut%bt),ut===lt?(gt=this._repeat,dt=ct):(gt=~~(ut/bt),gt&>===ut/bt&&(dt=ct,gt--),dt>ct&&(dt=ct)),St=_animationCycle(this._tTime,bt),!st&&this._tTime&&St!==gt&&this._tTime-St*bt-this._dur<=0&&(St=gt),Et&>&1&&(dt=ct-dt,It=1),gt!==St&&!this._lock){var Tt=Et&&St&1,$t=Tt===(Et&>&1);if(gt=st&&rt>=0)for(pt=this._first;pt;){if(mt=pt._next,(pt._act||dt>=pt._start)&&pt._ts&&wt!==pt){if(pt.parent!==this)return this.render(rt,ot,at);if(pt.render(pt._ts>0?(dt-pt._start)*pt._ts:(pt._dirty?pt.totalDuration():pt._tDur)+(dt-pt._start)*pt._ts,ot,at),dt!==this._time||!this._ts&&!yt){wt=0,mt&&(ut+=this._zTime=-_tinyNum);break}}pt=mt}else{pt=this._last;for(var Ut=rt<0?rt:dt;pt;){if(mt=pt._prev,(pt._act||Ut<=pt._end)&&pt._ts&&wt!==pt){if(pt.parent!==this)return this.render(rt,ot,at);if(pt.render(pt._ts>0?(Ut-pt._start)*pt._ts:(pt._dirty?pt.totalDuration():pt._tDur)+(Ut-pt._start)*pt._ts,ot,at||_reverting$1&&(pt._initted||pt._startAt)),dt!==this._time||!this._ts&&!yt){wt=0,mt&&(ut+=this._zTime=Ut?-_tinyNum:_tinyNum);break}}pt=mt}}if(wt&&!ot&&(this.pause(),wt.render(dt>=st?0:-_tinyNum)._zTime=dt>=st?1:-1,this._ts))return this._start=xt,_setEnd(this),this.render(rt,ot,at);this._onUpdate&&!ot&&_callback(this,"onUpdate",!0),(ut===lt&&this._tTime>=this.totalDuration()||!ut&&st)&&(xt===this._start||Math.abs(vt)!==Math.abs(this._ts))&&(this._lock||((rt||!ct)&&(ut===lt&&this._ts>0||!ut&&this._ts<0)&&_removeFromParent(this,1),!ot&&!(rt<0&&!st)&&(ut||st||!lt)&&(_callback(this,ut===lt&&rt>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(ut0)&&this._prom())))}return this},nt.add=function(rt,ot){var at=this;if(_isNumber(ot)||(ot=_parsePosition(this,ot,rt)),!(rt instanceof Animation)){if(_isArray(rt))return rt.forEach(function(st){return at.add(st,ot)}),this;if(_isString(rt))return this.addLabel(rt,ot);if(_isFunction(rt))rt=Tween.delayedCall(0,rt);else return this}return this!==rt?_addToTimeline(this,rt,ot):this},nt.getChildren=function(rt,ot,at,st){rt===void 0&&(rt=!0),ot===void 0&&(ot=!0),at===void 0&&(at=!0),st===void 0&&(st=-_bigNum$1);for(var lt=[],ct=this._first;ct;)ct._start>=st&&(ct instanceof Tween?ot&<.push(ct):(at&<.push(ct),rt&<.push.apply(lt,ct.getChildren(!0,ot,at)))),ct=ct._next;return lt},nt.getById=function(rt){for(var ot=this.getChildren(1,1,1),at=ot.length;at--;)if(ot[at].vars.id===rt)return ot[at]},nt.remove=function(rt){return _isString(rt)?this.removeLabel(rt):_isFunction(rt)?this.killTweensOf(rt):(_removeLinkedListItem(this,rt),rt===this._recent&&(this._recent=this._last),_uncache(this))},nt.totalTime=function(rt,ot){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=_roundPrecise(_ticker.time-(this._ts>0?rt/this._ts:(this.totalDuration()-rt)/-this._ts))),tt.prototype.totalTime.call(this,rt,ot),this._forcing=0,this):this._tTime},nt.addLabel=function(rt,ot){return this.labels[rt]=_parsePosition(this,ot),this},nt.removeLabel=function(rt){return delete this.labels[rt],this},nt.addPause=function(rt,ot,at){var st=Tween.delayedCall(0,ot||_emptyFunc,at);return st.data="isPause",this._hasPause=1,_addToTimeline(this,st,_parsePosition(this,rt))},nt.removePause=function(rt){var ot=this._first;for(rt=_parsePosition(this,rt);ot;)ot._start===rt&&ot.data==="isPause"&&_removeFromParent(ot),ot=ot._next},nt.killTweensOf=function(rt,ot,at){for(var st=this.getTweensOf(rt,at),lt=st.length;lt--;)_overwritingTween!==st[lt]&&st[lt].kill(rt,ot);return this},nt.getTweensOf=function(rt,ot){for(var at=[],st=toArray$2(rt),lt=this._first,ct=_isNumber(ot),ut;lt;)lt instanceof Tween?_arrayContainsAny(lt._targets,st)&&(ct?(!_overwritingTween||lt._initted&<._ts)&<.globalTime(0)<=ot&<.globalTime(lt.totalDuration())>ot:!ot||lt.isActive())&&at.push(lt):(ut=lt.getTweensOf(st,ot)).length&&at.push.apply(at,ut),lt=lt._next;return at},nt.tweenTo=function(rt,ot){ot=ot||{};var at=this,st=_parsePosition(at,rt),lt=ot,ct=lt.startAt,ut=lt.onStart,ht=lt.onStartParams,dt=lt.immediateRender,pt,mt=Tween.to(at,_setDefaults({ease:ot.ease||"none",lazy:!1,immediateRender:!1,time:st,overwrite:"auto",duration:ot.duration||Math.abs((st-(ct&&"time"in ct?ct.time:at._time))/at.timeScale())||_tinyNum,onStart:function(){if(at.pause(),!pt){var bt=ot.duration||Math.abs((st-(ct&&"time"in ct?ct.time:at._time))/at.timeScale());mt._dur!==bt&&_setDuration(mt,bt,0,1).render(mt._time,!0,!0),pt=1}ut&&ut.apply(mt,ht||[])}},ot));return dt?mt.render(0):mt},nt.tweenFromTo=function(rt,ot,at){return this.tweenTo(ot,_setDefaults({startAt:{time:_parsePosition(this,rt)}},at))},nt.recent=function(){return this._recent},nt.nextLabel=function(rt){return rt===void 0&&(rt=this._time),_getLabelInDirection(this,_parsePosition(this,rt))},nt.previousLabel=function(rt){return rt===void 0&&(rt=this._time),_getLabelInDirection(this,_parsePosition(this,rt),1)},nt.currentLabel=function(rt){return arguments.length?this.seek(rt,!0):this.previousLabel(this._time+_tinyNum)},nt.shiftChildren=function(rt,ot,at){at===void 0&&(at=0);for(var st=this._first,lt=this.labels,ct;st;)st._start>=at&&(st._start+=rt,st._end+=rt),st=st._next;if(ot)for(ct in lt)lt[ct]>=at&&(lt[ct]+=rt);return _uncache(this)},nt.invalidate=function(rt){var ot=this._first;for(this._lock=0;ot;)ot.invalidate(rt),ot=ot._next;return tt.prototype.invalidate.call(this,rt)},nt.clear=function(rt){rt===void 0&&(rt=!0);for(var ot=this._first,at;ot;)at=ot._next,this.remove(ot),ot=at;return this._dp&&(this._time=this._tTime=this._pTime=0),rt&&(this.labels={}),_uncache(this)},nt.totalDuration=function(rt){var ot=0,at=this,st=at._last,lt=_bigNum$1,ct,ut,ht;if(arguments.length)return at.timeScale((at._repeat<0?at.duration():at.totalDuration())/(at.reversed()?-rt:rt));if(at._dirty){for(ht=at.parent;st;)ct=st._prev,st._dirty&&st.totalDuration(),ut=st._start,ut>lt&&at._sort&&st._ts&&!at._lock?(at._lock=1,_addToTimeline(at,st,ut-st._delay,1)._lock=0):lt=ut,ut<0&&st._ts&&(ot-=ut,(!ht&&!at._dp||ht&&ht.smoothChildTiming)&&(at._start+=ut/at._ts,at._time-=ut,at._tTime-=ut),at.shiftChildren(-ut,!1,-1/0),lt=0),st._end>ot&&st._ts&&(ot=st._end),st=ct;_setDuration(at,at===_globalTimeline&&at._time>ot?at._time:ot,1,1),at._dirty=0}return at._tDur},et.updateRoot=function(rt){if(_globalTimeline._ts&&(_lazySafeRender(_globalTimeline,_parentToChildTotalTime(rt,_globalTimeline)),_lastRenderedFrame=_ticker.frame),_ticker.frame>=_nextGCFrame){_nextGCFrame+=_config.autoSleep||120;var ot=_globalTimeline._first;if((!ot||!ot._ts)&&_config.autoSleep&&_ticker._listeners.length<2){for(;ot&&!ot._ts;)ot=ot._next;ot||_ticker.sleep()}}},et}(Animation);_setDefaults(Timeline$1.prototype,{_lock:0,_hasPause:0,_forcing:0});var _addComplexStringPropTween=function tt(et,nt,it,rt,ot,at,st){var lt=new PropTween(this._pt,et,nt,0,1,_renderComplexString,null,ot),ct=0,ut=0,ht,dt,pt,mt,gt,bt,yt,wt;for(lt.b=it,lt.e=rt,it+="",rt+="",(yt=~rt.indexOf("random("))&&(rt=_replaceRandom(rt)),at&&(wt=[it,rt],at(wt,et,nt),it=wt[0],rt=wt[1]),dt=it.match(_complexStringNumExp)||[];ht=_complexStringNumExp.exec(rt);)mt=ht[0],gt=rt.substring(ct,ht.index),pt?pt=(pt+1)%5:gt.substr(-5)==="rgba("&&(pt=1),mt!==dt[ut++]&&(bt=parseFloat(dt[ut-1])||0,lt._pt={_next:lt._pt,p:gt||ut===1?gt:",",s:bt,c:mt.charAt(1)==="="?_parseRelative(bt,mt)-bt:parseFloat(mt)-bt,m:pt&&pt<4?Math.round:0},ct=_complexStringNumExp.lastIndex);return lt.c=ct")}),xt.duration();else{Et={};for(Tt in mt)Tt==="ease"||Tt==="easeEach"||_parseKeyframe(Tt,mt[Tt],Et,mt.easeEach);for(Tt in Et)for(Pt=Et[Tt].sort(function(Rt,Wt){return Rt.t-Wt.t}),Bt=0,St=0;Stlt-_tinyNum&&!ut?lt:rt<_tinyNum?0:rt,dt,pt,mt,gt,bt,yt,wt,vt,xt;if(!ct)_renderZeroDurationTween(this,rt,ot,at);else if(ht!==this._tTime||!rt||at||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==ut){if(dt=ht,vt=this.timeline,this._repeat){if(gt=ct+this._rDelay,this._repeat<-1&&ut)return this.totalTime(gt*100+rt,ot,at);if(dt=_roundPrecise(ht%gt),ht===lt?(mt=this._repeat,dt=ct):(mt=~~(ht/gt),mt&&mt===_roundPrecise(ht/gt)&&(dt=ct,mt--),dt>ct&&(dt=ct)),yt=this._yoyo&&mt&1,yt&&(xt=this._yEase,dt=ct-dt),bt=_animationCycle(this._tTime,gt),dt===st&&!at&&this._initted&&mt===bt)return this._tTime=ht,this;mt!==bt&&(vt&&this._yEase&&_propagateYoyoEase(vt,yt),this.vars.repeatRefresh&&!yt&&!this._lock&&this._time!==ct&&this._initted&&(this._lock=at=1,this.render(_roundPrecise(gt*mt),!0).invalidate()._lock=0))}if(!this._initted){if(_attemptInitTween(this,ut?rt:dt,at,ot,ht))return this._tTime=0,this;if(st!==this._time&&!(at&&this.vars.repeatRefresh&&mt!==bt))return this;if(ct!==this._dur)return this.render(rt,ot,at)}if(this._tTime=ht,this._time=dt,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=wt=(xt||this._ease)(dt/ct),this._from&&(this.ratio=wt=1-wt),dt&&!st&&!ot&&!mt&&(_callback(this,"onStart"),this._tTime!==ht))return this;for(pt=this._pt;pt;)pt.r(wt,pt.d),pt=pt._next;vt&&vt.render(rt<0?rt:!dt&&yt?-_tinyNum:vt._dur*vt._ease(dt/this._dur),ot,at)||this._startAt&&(this._zTime=rt),this._onUpdate&&!ot&&(ut&&_rewindStartAt(this,rt,ot,at),_callback(this,"onUpdate")),this._repeat&&mt!==bt&&this.vars.onRepeat&&!ot&&this.parent&&_callback(this,"onRepeat"),(ht===this._tDur||!ht)&&this._tTime===ht&&(ut&&!this._onUpdate&&_rewindStartAt(this,rt,!0,!0),(rt||!ct)&&(ht===this._tDur&&this._ts>0||!ht&&this._ts<0)&&_removeFromParent(this,1),!ot&&!(ut&&!st)&&(ht||st||yt)&&(_callback(this,ht===lt?"onComplete":"onReverseComplete",!0),this._prom&&!(ht0)&&this._prom()))}return this},nt.targets=function(){return this._targets},nt.invalidate=function(rt){return(!rt||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(rt),tt.prototype.invalidate.call(this,rt)},nt.resetTo=function(rt,ot,at,st,lt){_tickerActive||_ticker.wake(),this._ts||this.play();var ct=Math.min(this._dur,(this._dp._time-this._start)*this._ts),ut;return this._initted||_initTween(this,ct),ut=this._ease(ct/this._dur),_updatePropTweens(this,rt,ot,at,st,ut,ct,lt)?this.resetTo(rt,ot,at,st,1):(_alignPlayhead(this,0),this.parent||_addLinkedListItem(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},nt.kill=function(rt,ot){if(ot===void 0&&(ot="all"),!rt&&(!ot||ot==="all"))return this._lazy=this._pt=0,this.parent?_interrupt(this):this;if(this.timeline){var at=this.timeline.totalDuration();return this.timeline.killTweensOf(rt,ot,_overwritingTween&&_overwritingTween.vars.overwrite!==!0)._first||_interrupt(this),this.parent&&at!==this.timeline.totalDuration()&&_setDuration(this,this._dur*this.timeline._tDur/at,0,1),this}var st=this._targets,lt=rt?toArray$2(rt):st,ct=this._ptLookup,ut=this._pt,ht,dt,pt,mt,gt,bt,yt;if((!ot||ot==="all")&&_arraysMatch(st,lt))return ot==="all"&&(this._pt=0),_interrupt(this);for(ht=this._op=this._op||[],ot!=="all"&&(_isString(ot)&&(gt={},_forEachName(ot,function(wt){return gt[wt]=1}),ot=gt),ot=_addAliasesToVars(st,ot)),yt=st.length;yt--;)if(~lt.indexOf(st[yt])){dt=ct[yt],ot==="all"?(ht[yt]=ot,mt=dt,pt={}):(pt=ht[yt]=ht[yt]||{},mt=ot);for(gt in mt)bt=dt&&dt[gt],bt&&((!("kill"in bt.d)||bt.d.kill(gt)===!0)&&_removeLinkedListItem(this,bt,"_pt"),delete dt[gt]),pt!=="all"&&(pt[gt]=1)}return this._initted&&!this._pt&&ut&&_interrupt(this),this},et.to=function(rt,ot){return new et(rt,ot,arguments[2])},et.from=function(rt,ot){return _createTweenType(1,arguments)},et.delayedCall=function(rt,ot,at,st){return new et(ot,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:rt,onComplete:ot,onReverseComplete:ot,onCompleteParams:at,onReverseCompleteParams:at,callbackScope:st})},et.fromTo=function(rt,ot,at){return _createTweenType(2,arguments)},et.set=function(rt,ot){return ot.duration=0,ot.repeatDelay||(ot.repeat=0),new et(rt,ot)},et.killTweensOf=function(rt,ot,at){return _globalTimeline.killTweensOf(rt,ot,at)},et}(Animation);_setDefaults(Tween.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});_forEachName("staggerTo,staggerFrom,staggerFromTo",function(tt){Tween[tt]=function(){var et=new Timeline$1,nt=_slice.call(arguments,0);return nt.splice(tt==="staggerFromTo"?5:4,0,0),et[tt].apply(et,nt)}});var _setterPlain=function tt(et,nt,it){return et[nt]=it},_setterFunc=function tt(et,nt,it){return et[nt](it)},_setterFuncWithParam=function tt(et,nt,it,rt){return et[nt](rt.fp,it)},_setterAttribute=function tt(et,nt,it){return et.setAttribute(nt,it)},_getSetter=function tt(et,nt){return _isFunction(et[nt])?_setterFunc:_isUndefined(et[nt])&&et.setAttribute?_setterAttribute:_setterPlain},_renderPlain=function tt(et,nt){return nt.set(nt.t,nt.p,Math.round((nt.s+nt.c*et)*1e6)/1e6,nt)},_renderBoolean=function tt(et,nt){return nt.set(nt.t,nt.p,!!(nt.s+nt.c*et),nt)},_renderComplexString=function tt(et,nt){var it=nt._pt,rt="";if(!et&&nt.b)rt=nt.b;else if(et===1&&nt.e)rt=nt.e;else{for(;it;)rt=it.p+(it.m?it.m(it.s+it.c*et):Math.round((it.s+it.c*et)*1e4)/1e4)+rt,it=it._next;rt+=nt.c}nt.set(nt.t,nt.p,rt,nt)},_renderPropTweens=function tt(et,nt){for(var it=nt._pt;it;)it.r(et,it.d),it=it._next},_addPluginModifier=function tt(et,nt,it,rt){for(var ot=this._pt,at;ot;)at=ot._next,ot.p===rt&&ot.modifier(et,nt,it),ot=at},_killPropTweensOf=function tt(et){for(var nt=this._pt,it,rt;nt;)rt=nt._next,nt.p===et&&!nt.op||nt.op===et?_removeLinkedListItem(this,nt,"_pt"):nt.dep||(it=1),nt=rt;return!it},_setterWithModifier=function tt(et,nt,it,rt){rt.mSet(et,nt,rt.m.call(rt.tween,it,rt.mt),rt)},_sortPropTweensByPriority=function tt(et){for(var nt=et._pt,it,rt,ot,at;nt;){for(it=nt._next,rt=ot;rt&&rt.pr>nt.pr;)rt=rt._next;(nt._prev=rt?rt._prev:at)?nt._prev._next=nt:ot=nt,(nt._next=rt)?rt._prev=nt:at=nt,nt=it}et._pt=ot},PropTween=function(){function tt(nt,it,rt,ot,at,st,lt,ct,ut){this.t=it,this.s=ot,this.c=at,this.p=rt,this.r=st||_renderPlain,this.d=lt||this,this.set=ct||_setterPlain,this.pr=ut||0,this._next=nt,nt&&(nt._prev=this)}var et=tt.prototype;return et.modifier=function(it,rt,ot){this.mSet=this.mSet||this.set,this.set=_setterWithModifier,this.m=it,this.mt=ot,this.tween=rt},tt}();_forEachName(_callbackNames+"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(tt){return _reservedProps[tt]=1});_globals.TweenMax=_globals.TweenLite=Tween;_globals.TimelineLite=_globals.TimelineMax=Timeline$1;_globalTimeline=new Timeline$1({sortChildren:!1,defaults:_defaults,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});_config.stringFilter=_colorStringFilter;var _media=[],_listeners={},_emptyArray=[],_lastMediaTime=0,_contextID=0,_dispatch=function tt(et){return(_listeners[et]||_emptyArray).map(function(nt){return nt()})},_onMediaChange=function tt(){var et=Date.now(),nt=[];et-_lastMediaTime>2&&(_dispatch("matchMediaInit"),_media.forEach(function(it){var rt=it.queries,ot=it.conditions,at,st,lt,ct;for(st in rt)at=_win$1.matchMedia(rt[st]).matches,at&&(lt=1),at!==ot[st]&&(ot[st]=at,ct=1);ct&&(it.revert(),lt&&nt.push(it))}),_dispatch("matchMediaRevert"),nt.forEach(function(it){return it.onMatch(it,function(rt){return it.add(null,rt)})}),_lastMediaTime=et,_dispatch("matchMedia"))},Context$1=function(){function tt(nt,it){this.selector=it&&selector$1(it),this.data=[],this._r=[],this.isReverted=!1,this.id=_contextID++,nt&&this.add(nt)}var et=tt.prototype;return et.add=function(it,rt,ot){_isFunction(it)&&(ot=rt,rt=it,it=_isFunction);var at=this,st=function(){var ct=_context,ut=at.selector,ht;return ct&&ct!==at&&ct.data.push(at),ot&&(at.selector=selector$1(ot)),_context=at,ht=rt.apply(at,arguments),_isFunction(ht)&&at._r.push(ht),_context=ct,at.selector=ut,at.isReverted=!1,ht};return at.last=st,it===_isFunction?st(at,function(lt){return at.add(null,lt)}):it?at[it]=st:st},et.ignore=function(it){var rt=_context;_context=null,it(this),_context=rt},et.getTweens=function(){var it=[];return this.data.forEach(function(rt){return rt instanceof tt?it.push.apply(it,rt.getTweens()):rt instanceof Tween&&!(rt.parent&&rt.parent.data==="nested")&&it.push(rt)}),it},et.clear=function(){this._r.length=this.data.length=0},et.kill=function(it,rt){var ot=this;if(it?function(){for(var st=ot.getTweens(),lt=ot.data.length,ct;lt--;)ct=ot.data[lt],ct.data==="isFlip"&&(ct.revert(),ct.getChildren(!0,!0,!1).forEach(function(ut){return st.splice(st.indexOf(ut),1)}));for(st.map(function(ut){return{g:ut._dur||ut._delay||ut._sat&&!ut._sat.vars.immediateRender?ut.globalTime(0):-1/0,t:ut}}).sort(function(ut,ht){return ht.g-ut.g||-1/0}).forEach(function(ut){return ut.t.revert(it)}),lt=ot.data.length;lt--;)ct=ot.data[lt],ct instanceof Timeline$1?ct.data!=="nested"&&(ct.scrollTrigger&&ct.scrollTrigger.revert(),ct.kill()):!(ct instanceof Tween)&&ct.revert&&ct.revert(it);ot._r.forEach(function(ut){return ut(it,ot)}),ot.isReverted=!0}():this.data.forEach(function(st){return st.kill&&st.kill()}),this.clear(),rt)for(var at=_media.length;at--;)_media[at].id===this.id&&_media.splice(at,1)},et.revert=function(it){this.kill(it||{})},tt}(),MatchMedia=function(){function tt(nt){this.contexts=[],this.scope=nt}var et=tt.prototype;return et.add=function(it,rt,ot){_isObject(it)||(it={matches:it});var at=new Context$1(0,ot||this.scope),st=at.conditions={},lt,ct,ut;_context&&!at.selector&&(at.selector=_context.selector),this.contexts.push(at),rt=at.add("onMatch",rt),at.queries=it;for(ct in it)ct==="all"?ut=1:(lt=_win$1.matchMedia(it[ct]),lt&&(_media.indexOf(at)<0&&_media.push(at),(st[ct]=lt.matches)&&(ut=1),lt.addListener?lt.addListener(_onMediaChange):lt.addEventListener("change",_onMediaChange)));return ut&&rt(at,function(ht){return at.add(null,ht)}),this},et.revert=function(it){this.kill(it||{})},et.kill=function(it){this.contexts.forEach(function(rt){return rt.kill(it,!0)})},tt}(),_gsap={registerPlugin:function tt(){for(var et=arguments.length,nt=new Array(et),it=0;it1){var rt=et.map(function(ut){return gsap.quickSetter(ut,nt,it)}),ot=rt.length;return function(ut){for(var ht=ot;ht--;)rt[ht](ut)}}et=et[0]||{};var at=_plugins[nt],st=_getCache(et),lt=st.harness&&(st.harness.aliases||{})[nt]||nt,ct=at?function(ut){var ht=new at;_quickTween._pt=0,ht.init(et,it?ut+it:ut,_quickTween,0,[et]),ht.render(1,ht),_quickTween._pt&&_renderPropTweens(1,_quickTween)}:st.set(et,lt);return at?ct:function(ut){return ct(et,lt,it?ut+it:ut,st,1)}},quickTo:function tt(et,nt,it){var rt,ot=gsap.to(et,_merge((rt={},rt[nt]="+=0.1",rt.paused=!0,rt),it||{})),at=function(lt,ct,ut){return ot.resetTo(nt,lt,ct,ut)};return at.tween=ot,at},isTweening:function tt(et){return _globalTimeline.getTweensOf(et,!0).length>0},defaults:function tt(et){return et&&et.ease&&(et.ease=_parseEase(et.ease,_defaults.ease)),_mergeDeep(_defaults,et||{})},config:function tt(et){return _mergeDeep(_config,et||{})},registerEffect:function tt(et){var nt=et.name,it=et.effect,rt=et.plugins,ot=et.defaults,at=et.extendTimeline;(rt||"").split(",").forEach(function(st){return st&&!_plugins[st]&&!_globals[st]&&_warn(nt+" effect requires "+st+" plugin.")}),_effects[nt]=function(st,lt,ct){return it(toArray$2(st),_setDefaults(lt||{},ot),ct)},at&&(Timeline$1.prototype[nt]=function(st,lt,ct){return this.add(_effects[nt](st,_isObject(lt)?lt:(ct=lt)&&{},this),ct)})},registerEase:function tt(et,nt){_easeMap[et]=_parseEase(nt)},parseEase:function tt(et,nt){return arguments.length?_parseEase(et,nt):_easeMap},getById:function tt(et){return _globalTimeline.getById(et)},exportRoot:function tt(et,nt){et===void 0&&(et={});var it=new Timeline$1(et),rt,ot;for(it.smoothChildTiming=_isNotFalse(et.smoothChildTiming),_globalTimeline.remove(it),it._dp=0,it._time=it._tTime=_globalTimeline._time,rt=_globalTimeline._first;rt;)ot=rt._next,(nt||!(!rt._dur&&rt instanceof Tween&&rt.vars.onComplete===rt._targets[0]))&&_addToTimeline(it,rt,rt._start-rt._delay),rt=ot;return _addToTimeline(_globalTimeline,it,0),it},context:function tt(et,nt){return et?new Context$1(et,nt):_context},matchMedia:function tt(et){return new MatchMedia(et)},matchMediaRefresh:function tt(){return _media.forEach(function(et){var nt=et.conditions,it,rt;for(rt in nt)nt[rt]&&(nt[rt]=!1,it=1);it&&et.revert()})||_onMediaChange()},addEventListener:function tt(et,nt){var it=_listeners[et]||(_listeners[et]=[]);~it.indexOf(nt)||it.push(nt)},removeEventListener:function tt(et,nt){var it=_listeners[et],rt=it&&it.indexOf(nt);rt>=0&&it.splice(rt,1)},utils:{wrap:wrap$2,wrapYoyo,distribute,random,snap,normalize:normalize$3,getUnit,clamp:clamp$2,splitColor,toArray:toArray$2,selector:selector$1,mapRange,pipe,unitize,interpolate:interpolate$2,shuffle},install:_install,effects:_effects,ticker:_ticker,updateRoot:Timeline$1.updateRoot,plugins:_plugins,globalTimeline:_globalTimeline,core:{PropTween,globals:_addGlobal,Tween,Timeline:Timeline$1,Animation,getCache:_getCache,_removeLinkedListItem,reverting:function tt(){return _reverting$1},context:function tt(et){return et&&_context&&(_context.data.push(et),et._ctx=_context),_context},suppressOverwrites:function tt(et){return _suppressOverwrites=et}}};_forEachName("to,from,fromTo,delayedCall,set,killTweensOf",function(tt){return _gsap[tt]=Tween[tt]});_ticker.add(Timeline$1.updateRoot);_quickTween=_gsap.to({},{duration:0});var _getPluginPropTween=function tt(et,nt){for(var it=et._pt;it&&it.p!==nt&&it.op!==nt&&it.fp!==nt;)it=it._next;return it},_addModifiers=function tt(et,nt){var it=et._targets,rt,ot,at;for(rt in nt)for(ot=it.length;ot--;)at=et._ptLookup[ot][rt],at&&(at=at.d)&&(at._pt&&(at=_getPluginPropTween(at,rt)),at&&at.modifier&&at.modifier(nt[rt],et,it[ot],rt))},_buildModifierPlugin=function tt(et,nt){return{name:et,rawVars:1,init:function(rt,ot,at){at._onInit=function(st){var lt,ct;if(_isString(ot)&&(lt={},_forEachName(ot,function(ut){return lt[ut]=1}),ot=lt),nt){lt={};for(ct in ot)lt[ct]=nt(ot[ct]);ot=lt}_addModifiers(st,ot)}}}},gsap=_gsap.registerPlugin({name:"attr",init:function tt(et,nt,it,rt,ot){var at,st,lt;this.tween=it;for(at in nt)lt=et.getAttribute(at)||"",st=this.add(et,"setAttribute",(lt||0)+"",nt[at],rt,ot,0,0,at),st.op=at,st.b=lt,this._props.push(at)},render:function tt(et,nt){for(var it=nt._pt;it;)_reverting$1?it.set(it.t,it.p,it.b,it):it.r(et,it.d),it=it._next}},{name:"endArray",init:function tt(et,nt){for(var it=nt.length;it--;)this.add(et,it,et[it]||0,nt[it],0,0,0,0,0,1)}},_buildModifierPlugin("roundProps",_roundModifier),_buildModifierPlugin("modifiers"),_buildModifierPlugin("snap",snap))||_gsap;Tween.version=Timeline$1.version=gsap.version="3.12.3";_coreReady=1;_windowExists$1()&&_wake();_easeMap.Power0;_easeMap.Power1;_easeMap.Power2;_easeMap.Power3;_easeMap.Power4;_easeMap.Linear;_easeMap.Quad;_easeMap.Cubic;_easeMap.Quart;_easeMap.Quint;_easeMap.Strong;_easeMap.Elastic;_easeMap.Back;_easeMap.SteppedEase;_easeMap.Bounce;_easeMap.Sine;_easeMap.Expo;_easeMap.Circ;/*! - * CSSPlugin 3.12.3 +*/var _config={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},_defaults={duration:.5,overwrite:!1,delay:0},_suppressOverwrites,_reverting$1,_context,_bigNum$1=1e8,_tinyNum=1/_bigNum$1,_2PI=Math.PI*2,_HALF_PI=_2PI/4,_gsID=0,_sqrt=Math.sqrt,_cos=Math.cos,_sin=Math.sin,_isString=function tt(et){return typeof et=="string"},_isFunction=function tt(et){return typeof et=="function"},_isNumber=function tt(et){return typeof et=="number"},_isUndefined=function tt(et){return typeof et>"u"},_isObject=function tt(et){return typeof et=="object"},_isNotFalse=function tt(et){return et!==!1},_windowExists$1=function tt(){return typeof window<"u"},_isFuncOrString=function tt(et){return _isFunction(et)||_isString(et)},_isTypedArray=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},_isArray=Array.isArray,_strictNumExp=/(?:-?\.?\d|\.)+/gi,_numExp=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,_numWithUnitExp=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,_complexStringNumExp=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,_relExp=/[+-]=-?[.\d]+/,_delimitedValueExp=/[^,'"\[\]\s]+/gi,_unitExp=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,_globalTimeline,_win$1,_coreInitted,_doc$1,_globals={},_installScope={},_coreReady,_install=function tt(et){return(_installScope=_merge(et,_globals))&&gsap},_missingPlugin=function tt(et,nt){return console.warn("Invalid property",et,"set to",nt,"Missing plugin? gsap.registerPlugin()")},_warn=function tt(et,nt){return!nt&&console.warn(et)},_addGlobal=function tt(et,nt){return et&&(_globals[et]=nt)&&_installScope&&(_installScope[et]=nt)||_globals},_emptyFunc=function tt(){return 0},_startAtRevertConfig={suppressEvents:!0,isStart:!0,kill:!1},_revertConfigNoKill={suppressEvents:!0,kill:!1},_revertConfig={suppressEvents:!0},_reservedProps={},_lazyTweens=[],_lazyLookup={},_lastRenderedFrame,_plugins={},_effects={},_nextGCFrame=30,_harnessPlugins=[],_callbackNames="",_harness=function tt(et){var nt=et[0],it,rt;if(_isObject(nt)||_isFunction(nt)||(et=[et]),!(it=(nt._gsap||{}).harness)){for(rt=_harnessPlugins.length;rt--&&!_harnessPlugins[rt].targetTest(nt););it=_harnessPlugins[rt]}for(rt=et.length;rt--;)et[rt]&&(et[rt]._gsap||(et[rt]._gsap=new GSCache(et[rt],it)))||et.splice(rt,1);return et},_getCache=function tt(et){return et._gsap||_harness(toArray$2(et))[0]._gsap},_getProperty=function tt(et,nt,it){return(it=et[nt])&&_isFunction(it)?et[nt]():_isUndefined(it)&&et.getAttribute&&et.getAttribute(nt)||it},_forEachName=function tt(et,nt){return(et=et.split(",")).forEach(nt)||et},_round=function tt(et){return Math.round(et*1e5)/1e5||0},_roundPrecise=function tt(et){return Math.round(et*1e7)/1e7||0},_parseRelative=function tt(et,nt){var it=nt.charAt(0),rt=parseFloat(nt.substr(2));return et=parseFloat(et),it==="+"?et+rt:it==="-"?et-rt:it==="*"?et*rt:et/rt},_arrayContainsAny=function tt(et,nt){for(var it=nt.length,rt=0;et.indexOf(nt[rt])<0&&++rtst;)at=at._prev;return at?(nt._next=at._next,at._next=nt):(nt._next=et[it],et[it]=nt),nt._next?nt._next._prev=nt:et[rt]=nt,nt._prev=at,nt.parent=nt._dp=et,nt},_removeLinkedListItem=function tt(et,nt,it,rt){it===void 0&&(it="_first"),rt===void 0&&(rt="_last");var ot=nt._prev,at=nt._next;ot?ot._next=at:et[it]===nt&&(et[it]=at),at?at._prev=ot:et[rt]===nt&&(et[rt]=ot),nt._next=nt._prev=nt.parent=null},_removeFromParent=function tt(et,nt){et.parent&&(!nt||et.parent.autoRemoveChildren)&&et.parent.remove&&et.parent.remove(et),et._act=0},_uncache=function tt(et,nt){if(et&&(!nt||nt._end>et._dur||nt._start<0))for(var it=et;it;)it._dirty=1,it=it.parent;return et},_recacheAncestors=function tt(et){for(var nt=et.parent;nt&&nt.parent;)nt._dirty=1,nt.totalDuration(),nt=nt.parent;return et},_rewindStartAt=function tt(et,nt,it,rt){return et._startAt&&(_reverting$1?et._startAt.revert(_revertConfigNoKill):et.vars.immediateRender&&!et.vars.autoRevert||et._startAt.render(nt,!0,rt))},_hasNoPausedAncestors=function tt(et){return!et||et._ts&&tt(et.parent)},_elapsedCycleDuration=function tt(et){return et._repeat?_animationCycle(et._tTime,et=et.duration()+et._rDelay)*et:0},_animationCycle=function tt(et,nt){var it=Math.floor(et/=nt);return et&&it===et?it-1:it},_parentToChildTotalTime=function tt(et,nt){return(et-nt._start)*nt._ts+(nt._ts>=0?0:nt._dirty?nt.totalDuration():nt._tDur)},_setEnd=function tt(et){return et._end=_roundPrecise(et._start+(et._tDur/Math.abs(et._ts||et._rts||_tinyNum)||0))},_alignPlayhead=function tt(et,nt){var it=et._dp;return it&&it.smoothChildTiming&&et._ts&&(et._start=_roundPrecise(it._time-(et._ts>0?nt/et._ts:((et._dirty?et.totalDuration():et._tDur)-nt)/-et._ts)),_setEnd(et),it._dirty||_uncache(it,et)),et},_postAddChecks=function tt(et,nt){var it;if((nt._time||!nt._dur&&nt._initted||nt._start_tinyNum)&&nt.render(it,!0)),_uncache(et,nt)._dp&&et._initted&&et._time>=et._dur&&et._ts){if(et._dur=0&&it.totalTime(it._tTime),it=it._dp;et._zTime=-_tinyNum}},_addToTimeline=function tt(et,nt,it,rt){return nt.parent&&_removeFromParent(nt),nt._start=_roundPrecise((_isNumber(it)?it:it||et!==_globalTimeline?_parsePosition(et,it,nt):et._time)+nt._delay),nt._end=_roundPrecise(nt._start+(nt.totalDuration()/Math.abs(nt.timeScale())||0)),_addLinkedListItem(et,nt,"_first","_last",et._sort?"_start":0),_isFromOrFromStart(nt)||(et._recent=nt),rt||_postAddChecks(et,nt),et._ts<0&&_alignPlayhead(et,et._tTime),et},_scrollTrigger=function tt(et,nt){return(_globals.ScrollTrigger||_missingPlugin("scrollTrigger",nt))&&_globals.ScrollTrigger.create(nt,et)},_attemptInitTween=function tt(et,nt,it,rt,ot){if(_initTween(et,nt,ot),!et._initted)return 1;if(!it&&et._pt&&!_reverting$1&&(et._dur&&et.vars.lazy!==!1||!et._dur&&et.vars.lazy)&&_lastRenderedFrame!==_ticker.frame)return _lazyTweens.push(et),et._lazy=[ot,rt],1},_parentPlayheadIsBeforeStart=function tt(et){var nt=et.parent;return nt&&nt._ts&&nt._initted&&!nt._lock&&(nt.rawTime()<0||tt(nt))},_isFromOrFromStart=function tt(et){var nt=et.data;return nt==="isFromStart"||nt==="isStart"},_renderZeroDurationTween=function tt(et,nt,it,rt){var ot=et.ratio,at=nt<0||!nt&&(!et._start&&_parentPlayheadIsBeforeStart(et)&&!(!et._initted&&_isFromOrFromStart(et))||(et._ts<0||et._dp._ts<0)&&!_isFromOrFromStart(et))?0:1,st=et._rDelay,lt=0,ct,ut,ht;if(st&&et._repeat&&(lt=_clamp(0,et._tDur,nt),ut=_animationCycle(lt,st),et._yoyo&&ut&1&&(at=1-at),ut!==_animationCycle(et._tTime,st)&&(ot=1-at,et.vars.repeatRefresh&&et._initted&&et.invalidate())),at!==ot||_reverting$1||rt||et._zTime===_tinyNum||!nt&&et._zTime){if(!et._initted&&_attemptInitTween(et,nt,rt,it,lt))return;for(ht=et._zTime,et._zTime=nt||(it?_tinyNum:0),it||(it=nt&&!ht),et.ratio=at,et._from&&(at=1-at),et._time=0,et._tTime=lt,ct=et._pt;ct;)ct.r(at,ct.d),ct=ct._next;nt<0&&_rewindStartAt(et,nt,it,!0),et._onUpdate&&!it&&_callback(et,"onUpdate"),lt&&et._repeat&&!it&&et.parent&&_callback(et,"onRepeat"),(nt>=et._tDur||nt<0)&&et.ratio===at&&(at&&_removeFromParent(et,1),!it&&!_reverting$1&&(_callback(et,at?"onComplete":"onReverseComplete",!0),et._prom&&et._prom()))}else et._zTime||(et._zTime=nt)},_findNextPauseTween=function tt(et,nt,it){var rt;if(it>nt)for(rt=et._first;rt&&rt._start<=it;){if(rt.data==="isPause"&&rt._start>nt)return rt;rt=rt._next}else for(rt=et._last;rt&&rt._start>=it;){if(rt.data==="isPause"&&rt._start0&&!rt&&_alignPlayhead(et,et._tTime=et._tDur*st),et.parent&&_setEnd(et),it||_uncache(et.parent,et),et},_onUpdateTotalDuration=function tt(et){return et instanceof Timeline$1?_uncache(et):_setDuration(et,et._dur)},_zeroPosition={_start:0,endTime:_emptyFunc,totalDuration:_emptyFunc},_parsePosition=function tt(et,nt,it){var rt=et.labels,ot=et._recent||_zeroPosition,at=et.duration()>=_bigNum$1?ot.endTime(!1):et._dur,st,lt,ct;return _isString(nt)&&(isNaN(nt)||nt in rt)?(lt=nt.charAt(0),ct=nt.substr(-1)==="%",st=nt.indexOf("="),lt==="<"||lt===">"?(st>=0&&(nt=nt.replace(/=/,"")),(lt==="<"?ot._start:ot.endTime(ot._repeat>=0))+(parseFloat(nt.substr(1))||0)*(ct?(st<0?ot:it).totalDuration()/100:1)):st<0?(nt in rt||(rt[nt]=at),rt[nt]):(lt=parseFloat(nt.charAt(st-1)+nt.substr(st+1)),ct&&it&&(lt=lt/100*(_isArray(it)?it[0]:it).totalDuration()),st>1?tt(et,nt.substr(0,st-1),it)+lt:at+lt)):nt==null?at:+nt},_createTweenType=function tt(et,nt,it){var rt=_isNumber(nt[1]),ot=(rt?2:1)+(et<2?0:1),at=nt[ot],st,lt;if(rt&&(at.duration=nt[1]),at.parent=it,et){for(st=at,lt=it;lt&&!("immediateRender"in st);)st=lt.vars.defaults||{},lt=_isNotFalse(lt.vars.inherit)&<.parent;at.immediateRender=_isNotFalse(st.immediateRender),et<2?at.runBackwards=1:at.startAt=nt[ot-1]}return new Tween(nt[0],at,nt[ot+1])},_conditionalReturn=function tt(et,nt){return et||et===0?nt(et):nt},_clamp=function tt(et,nt,it){return itnt?nt:it},getUnit=function tt(et,nt){return!_isString(et)||!(nt=_unitExp.exec(et))?"":nt[1]},clamp$2=function tt(et,nt,it){return _conditionalReturn(it,function(rt){return _clamp(et,nt,rt)})},_slice=[].slice,_isArrayLike=function tt(et,nt){return et&&_isObject(et)&&"length"in et&&(!nt&&!et.length||et.length-1 in et&&_isObject(et[0]))&&!et.nodeType&&et!==_win$1},_flatten=function tt(et,nt,it){return it===void 0&&(it=[]),et.forEach(function(rt){var ot;return _isString(rt)&&!nt||_isArrayLike(rt,1)?(ot=it).push.apply(ot,toArray$2(rt)):it.push(rt)})||it},toArray$2=function tt(et,nt,it){return _context&&!nt&&_context.selector?_context.selector(et):_isString(et)&&!it&&(_coreInitted||!_wake())?_slice.call((nt||_doc$1).querySelectorAll(et),0):_isArray(et)?_flatten(et,it):_isArrayLike(et)?_slice.call(et,0):et?[et]:[]},selector$1=function tt(et){return et=toArray$2(et)[0]||_warn("Invalid scope")||{},function(nt){var it=et.current||et.nativeElement||et;return toArray$2(nt,it.querySelectorAll?it:it===et?_warn("Invalid scope")||_doc$1.createElement("div"):et)}},shuffle=function tt(et){return et.sort(function(){return .5-Math.random()})},distribute=function tt(et){if(_isFunction(et))return et;var nt=_isObject(et)?et:{each:et},it=_parseEase(nt.ease),rt=nt.from||0,ot=parseFloat(nt.base)||0,at={},st=rt>0&&rt<1,lt=isNaN(rt)||st,ct=nt.axis,ut=rt,ht=rt;return _isString(rt)?ut=ht={center:.5,edges:.5,end:1}[rt]||0:!st&<&&(ut=rt[0],ht=rt[1]),function(dt,pt,mt){var gt=(mt||nt).length,bt=at[gt],yt,wt,vt,xt,St,Et,$t,It,Ft;if(!bt){if(Ft=nt.grid==="auto"?0:(nt.grid||[1,_bigNum$1])[1],!Ft){for($t=-_bigNum$1;$t<($t=mt[Ft++].getBoundingClientRect().left)&&Ft$t&&($t=St),Stgt?gt-1:ct?ct==="y"?gt/Ft:Ft:Math.max(Ft,gt/Ft))||0)*(rt==="edges"?-1:1),bt.b=gt<0?ot-gt:ot,bt.u=getUnit(nt.amount||nt.each)||0,it=it&><0?_invertEase(it):it}return gt=(bt[dt]-bt.min)/bt.max||0,_roundPrecise(bt.b+(it?it(gt):gt)*bt.v)+bt.u}},_roundModifier=function tt(et){var nt=Math.pow(10,((et+"").split(".")[1]||"").length);return function(it){var rt=_roundPrecise(Math.round(parseFloat(it)/et)*et*nt);return(rt-rt%1)/nt+(_isNumber(it)?0:getUnit(it))}},snap=function tt(et,nt){var it=_isArray(et),rt,ot;return!it&&_isObject(et)&&(rt=it=et.radius||_bigNum$1,et.values?(et=toArray$2(et.values),(ot=!_isNumber(et[0]))&&(rt*=rt)):et=_roundModifier(et.increment)),_conditionalReturn(nt,it?_isFunction(et)?function(at){return ot=et(at),Math.abs(ot-at)<=rt?ot:at}:function(at){for(var st=parseFloat(ot?at.x:at),lt=parseFloat(ot?at.y:0),ct=_bigNum$1,ut=0,ht=et.length,dt,pt;ht--;)ot?(dt=et[ht].x-st,pt=et[ht].y-lt,dt=dt*dt+pt*pt):dt=Math.abs(et[ht]-st),dtrt?ot-at:at)})},_replaceRandom=function tt(et){for(var nt=0,it="",rt,ot,at,st;~(rt=et.indexOf("random(",nt));)at=et.indexOf(")",rt),st=et.charAt(rt+7)==="[",ot=et.substr(rt+7,at-rt-7).match(st?_delimitedValueExp:_strictNumExp),it+=et.substr(nt,rt-nt)+random(st?ot:+ot[0],st?0:+ot[1],+ot[2]||1e-5),nt=at+1;return it+et.substr(nt,et.length-nt)},mapRange=function tt(et,nt,it,rt,ot){var at=nt-et,st=rt-it;return _conditionalReturn(ot,function(lt){return it+((lt-et)/at*st||0)})},interpolate$2=function tt(et,nt,it,rt){var ot=isNaN(et+nt)?0:function(pt){return(1-pt)*et+pt*nt};if(!ot){var at=_isString(et),st={},lt,ct,ut,ht,dt;if(it===!0&&(rt=1)&&(it=null),at)et={p:et},nt={p:nt};else if(_isArray(et)&&!_isArray(nt)){for(ut=[],ht=et.length,dt=ht-2,ct=1;ct(st=Math.abs(st))&&(lt=at,ot=st);return lt},_callback=function tt(et,nt,it){var rt=et.vars,ot=rt[nt],at=_context,st=et._ctx,lt,ct,ut;if(ot)return lt=rt[nt+"Params"],ct=rt.callbackScope||et,it&&_lazyTweens.length&&_lazyRender(),st&&(_context=st),ut=lt?ot.apply(ct,lt):ot.call(ct),_context=at,ut},_interrupt=function tt(et){return _removeFromParent(et),et.scrollTrigger&&et.scrollTrigger.kill(!!_reverting$1),et.progress()<1&&_callback(et,"onInterrupt"),et},_quickTween,_registerPluginQueue=[],_createPlugin=function tt(et){if(_windowExists$1()&&et){et=!et.name&&et.default||et;var nt=et.name,it=_isFunction(et),rt=nt&&!it&&et.init?function(){this._props=[]}:et,ot={init:_emptyFunc,render:_renderPropTweens,add:_addPropTween,kill:_killPropTweensOf,modifier:_addPluginModifier,rawVars:0},at={targetTest:0,get:0,getSetter:_getSetter,aliases:{},register:0};if(_wake(),et!==rt){if(_plugins[nt])return;_setDefaults(rt,_setDefaults(_copyExcluding(et,ot),at)),_merge(rt.prototype,_merge(ot,_copyExcluding(et,at))),_plugins[rt.prop=nt]=rt,et.targetTest&&(_harnessPlugins.push(rt),_reservedProps[nt]=1),nt=(nt==="css"?"CSS":nt.charAt(0).toUpperCase()+nt.substr(1))+"Plugin"}_addGlobal(nt,rt),et.register&&et.register(gsap,rt,PropTween)}else et&&_registerPluginQueue.push(et)},_255=255,_colorLookup={aqua:[0,_255,_255],lime:[0,_255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,_255],navy:[0,0,128],white:[_255,_255,_255],olive:[128,128,0],yellow:[_255,_255,0],orange:[_255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[_255,0,0],pink:[_255,192,203],cyan:[0,_255,_255],transparent:[_255,_255,_255,0]},_hue=function tt(et,nt,it){return et+=et<0?1:et>1?-1:0,(et*6<1?nt+(it-nt)*et*6:et<.5?it:et*3<2?nt+(it-nt)*(2/3-et)*6:nt)*_255+.5|0},splitColor=function tt(et,nt,it){var rt=et?_isNumber(et)?[et>>16,et>>8&_255,et&_255]:0:_colorLookup.black,ot,at,st,lt,ct,ut,ht,dt,pt,mt;if(!rt){if(et.substr(-1)===","&&(et=et.substr(0,et.length-1)),_colorLookup[et])rt=_colorLookup[et];else if(et.charAt(0)==="#"){if(et.length<6&&(ot=et.charAt(1),at=et.charAt(2),st=et.charAt(3),et="#"+ot+ot+at+at+st+st+(et.length===5?et.charAt(4)+et.charAt(4):"")),et.length===9)return rt=parseInt(et.substr(1,6),16),[rt>>16,rt>>8&_255,rt&_255,parseInt(et.substr(7),16)/255];et=parseInt(et.substr(1),16),rt=[et>>16,et>>8&_255,et&_255]}else if(et.substr(0,3)==="hsl"){if(rt=mt=et.match(_strictNumExp),!nt)lt=+rt[0]%360/360,ct=+rt[1]/100,ut=+rt[2]/100,at=ut<=.5?ut*(ct+1):ut+ct-ut*ct,ot=ut*2-at,rt.length>3&&(rt[3]*=1),rt[0]=_hue(lt+1/3,ot,at),rt[1]=_hue(lt,ot,at),rt[2]=_hue(lt-1/3,ot,at);else if(~et.indexOf("="))return rt=et.match(_numExp),it&&rt.length<4&&(rt[3]=1),rt}else rt=et.match(_strictNumExp)||_colorLookup.transparent;rt=rt.map(Number)}return nt&&!mt&&(ot=rt[0]/_255,at=rt[1]/_255,st=rt[2]/_255,ht=Math.max(ot,at,st),dt=Math.min(ot,at,st),ut=(ht+dt)/2,ht===dt?lt=ct=0:(pt=ht-dt,ct=ut>.5?pt/(2-ht-dt):pt/(ht+dt),lt=ht===ot?(at-st)/pt+(atet&&(it+=yt-nt),rt+=yt,St=rt-it,vt=St-at,(vt>0||wt)&&(Et=++ht.frame,dt=St-ht.time*1e3,ht.time=St=St/1e3,at+=vt+(vt>=ot?4:ot-vt),xt=1),wt||(lt=ct(gt)),xt)for(pt=0;pt=yt&&pt--},_listeners:st},ht}(),_wake=function tt(){return!_tickerActive&&_ticker.wake()},_easeMap={},_customEaseExp=/^[\d.\-M][\d.\-,\s]/,_quotesExp=/["']/g,_parseObjectInString=function tt(et){for(var nt={},it=et.substr(1,et.length-3).split(":"),rt=it[0],ot=1,at=it.length,st,lt,ct;ot1&&it.config?it.config.apply(null,~et.indexOf("{")?[_parseObjectInString(nt[1])]:_valueInParentheses(et).split(",").map(_numericIfPossible)):_easeMap._CE&&_customEaseExp.test(et)?_easeMap._CE("",et):it},_invertEase=function tt(et){return function(nt){return 1-et(1-nt)}},_propagateYoyoEase=function tt(et,nt){for(var it=et._first,rt;it;)it instanceof Timeline$1?tt(it,nt):it.vars.yoyoEase&&(!it._yoyo||!it._repeat)&&it._yoyo!==nt&&(it.timeline?tt(it.timeline,nt):(rt=it._ease,it._ease=it._yEase,it._yEase=rt,it._yoyo=nt)),it=it._next},_parseEase=function tt(et,nt){return et&&(_isFunction(et)?et:_easeMap[et]||_configEaseFromString(et))||nt},_insertEase=function tt(et,nt,it,rt){it===void 0&&(it=function(lt){return 1-nt(1-lt)}),rt===void 0&&(rt=function(lt){return lt<.5?nt(lt*2)/2:1-nt((1-lt)*2)/2});var ot={easeIn:nt,easeOut:it,easeInOut:rt},at;return _forEachName(et,function(st){_easeMap[st]=_globals[st]=ot,_easeMap[at=st.toLowerCase()]=it;for(var lt in ot)_easeMap[at+(lt==="easeIn"?".in":lt==="easeOut"?".out":".inOut")]=_easeMap[st+"."+lt]=ot[lt]}),ot},_easeInOutFromOut=function tt(et){return function(nt){return nt<.5?(1-et(1-nt*2))/2:.5+et((nt-.5)*2)/2}},_configElastic=function tt(et,nt,it){var rt=nt>=1?nt:1,ot=(it||(et?.3:.45))/(nt<1?nt:1),at=ot/_2PI*(Math.asin(1/rt)||0),st=function(ut){return ut===1?1:rt*Math.pow(2,-10*ut)*_sin((ut-at)*ot)+1},lt=et==="out"?st:et==="in"?function(ct){return 1-st(1-ct)}:_easeInOutFromOut(st);return ot=_2PI/ot,lt.config=function(ct,ut){return tt(et,ct,ut)},lt},_configBack=function tt(et,nt){nt===void 0&&(nt=1.70158);var it=function(at){return at?--at*at*((nt+1)*at+nt)+1:0},rt=et==="out"?it:et==="in"?function(ot){return 1-it(1-ot)}:_easeInOutFromOut(it);return rt.config=function(ot){return tt(et,ot)},rt};_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong",function(tt,et){var nt=et<5?et+1:et;_insertEase(tt+",Power"+(nt-1),et?function(it){return Math.pow(it,nt)}:function(it){return it},function(it){return 1-Math.pow(1-it,nt)},function(it){return it<.5?Math.pow(it*2,nt)/2:1-Math.pow((1-it)*2,nt)/2})});_easeMap.Linear.easeNone=_easeMap.none=_easeMap.Linear.easeIn;_insertEase("Elastic",_configElastic("in"),_configElastic("out"),_configElastic());(function(tt,et){var nt=1/et,it=2*nt,rt=2.5*nt,ot=function(st){return st0?it+(it+this._rDelay)*this._repeat:it):this.totalDuration()&&this._dur},et.totalDuration=function(it){return arguments.length?(this._dirty=0,_setDuration(this,this._repeat<0?it:(it-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},et.totalTime=function(it,rt){if(_wake(),!arguments.length)return this._tTime;var ot=this._dp;if(ot&&ot.smoothChildTiming&&this._ts){for(_alignPlayhead(this,it),!ot._dp||ot.parent||_postAddChecks(ot,this);ot&&ot.parent;)ot.parent._time!==ot._start+(ot._ts>=0?ot._tTime/ot._ts:(ot.totalDuration()-ot._tTime)/-ot._ts)&&ot.totalTime(ot._tTime,!0),ot=ot.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&it0||!this._tDur&&!it)&&_addToTimeline(this._dp,this,this._start-this._delay)}return(this._tTime!==it||!this._dur&&!rt||this._initted&&Math.abs(this._zTime)===_tinyNum||!it&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=it),_lazySafeRender(this,it,rt)),this},et.time=function(it,rt){return arguments.length?this.totalTime(Math.min(this.totalDuration(),it+_elapsedCycleDuration(this))%(this._dur+this._rDelay)||(it?this._dur:0),rt):this._time},et.totalProgress=function(it,rt){return arguments.length?this.totalTime(this.totalDuration()*it,rt):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},et.progress=function(it,rt){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-it:it)+_elapsedCycleDuration(this),rt):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},et.iteration=function(it,rt){var ot=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(it-1)*ot,rt):this._repeat?_animationCycle(this._tTime,ot)+1:1},et.timeScale=function(it,rt){if(!arguments.length)return this._rts===-_tinyNum?0:this._rts;if(this._rts===it)return this;var ot=this.parent&&this._ts?_parentToChildTotalTime(this.parent._time,this):this._tTime;return this._rts=+it||0,this._ts=this._ps||it===-_tinyNum?0:this._rts,this.totalTime(_clamp(-Math.abs(this._delay),this._tDur,ot),rt!==!1),_setEnd(this),_recacheAncestors(this)},et.paused=function(it){return arguments.length?(this._ps!==it&&(this._ps=it,it?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(_wake(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==_tinyNum&&(this._tTime-=_tinyNum)))),this):this._ps},et.startTime=function(it){if(arguments.length){this._start=it;var rt=this.parent||this._dp;return rt&&(rt._sort||!this.parent)&&_addToTimeline(rt,this,it-this._delay),this}return this._start},et.endTime=function(it){return this._start+(_isNotFalse(it)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},et.rawTime=function(it){var rt=this.parent||this._dp;return rt?it&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?_parentToChildTotalTime(rt.rawTime(it),this):this._tTime:this._tTime},et.revert=function(it){it===void 0&&(it=_revertConfig);var rt=_reverting$1;return _reverting$1=it,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(it),this.totalTime(-.01,it.suppressEvents)),this.data!=="nested"&&it.kill!==!1&&this.kill(),_reverting$1=rt,this},et.globalTime=function(it){for(var rt=this,ot=arguments.length?it:rt.rawTime();rt;)ot=rt._start+ot/(Math.abs(rt._ts)||1),rt=rt._dp;return!this.parent&&this._sat?this._sat.globalTime(it):ot},et.repeat=function(it){return arguments.length?(this._repeat=it===1/0?-2:it,_onUpdateTotalDuration(this)):this._repeat===-2?1/0:this._repeat},et.repeatDelay=function(it){if(arguments.length){var rt=this._time;return this._rDelay=it,_onUpdateTotalDuration(this),rt?this.time(rt):this}return this._rDelay},et.yoyo=function(it){return arguments.length?(this._yoyo=it,this):this._yoyo},et.seek=function(it,rt){return this.totalTime(_parsePosition(this,it),_isNotFalse(rt))},et.restart=function(it,rt){return this.play().totalTime(it?-this._delay:0,_isNotFalse(rt))},et.play=function(it,rt){return it!=null&&this.seek(it,rt),this.reversed(!1).paused(!1)},et.reverse=function(it,rt){return it!=null&&this.seek(it||this.totalDuration(),rt),this.reversed(!0).paused(!1)},et.pause=function(it,rt){return it!=null&&this.seek(it,rt),this.paused(!0)},et.resume=function(){return this.paused(!1)},et.reversed=function(it){return arguments.length?(!!it!==this.reversed()&&this.timeScale(-this._rts||(it?-_tinyNum:0)),this):this._rts<0},et.invalidate=function(){return this._initted=this._act=0,this._zTime=-_tinyNum,this},et.isActive=function(){var it=this.parent||this._dp,rt=this._start,ot;return!!(!it||this._ts&&this._initted&&it.isActive()&&(ot=it.rawTime(!0))>=rt&&ot1?(rt?(at[it]=rt,ot&&(at[it+"Params"]=ot),it==="onUpdate"&&(this._onUpdate=rt)):delete at[it],this):at[it]},et.then=function(it){var rt=this;return new Promise(function(ot){var at=_isFunction(it)?it:_passThrough,st=function(){var ct=rt.then;rt.then=null,_isFunction(at)&&(at=at(rt))&&(at.then||at===rt)&&(rt.then=ct),ot(at),rt.then=ct};rt._initted&&rt.totalProgress()===1&&rt._ts>=0||!rt._tTime&&rt._ts<0?st():rt._prom=st})},et.kill=function(){_interrupt(this)},tt}();_setDefaults(Animation.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:-_tinyNum,_prom:0,_ps:!1,_rts:1});var Timeline$1=function(tt){_inheritsLoose(et,tt);function et(it,rt){var ot;return it===void 0&&(it={}),ot=tt.call(this,it)||this,ot.labels={},ot.smoothChildTiming=!!it.smoothChildTiming,ot.autoRemoveChildren=!!it.autoRemoveChildren,ot._sort=_isNotFalse(it.sortChildren),_globalTimeline&&_addToTimeline(it.parent||_globalTimeline,_assertThisInitialized$c(ot),rt),it.reversed&&ot.reverse(),it.paused&&ot.paused(!0),it.scrollTrigger&&_scrollTrigger(_assertThisInitialized$c(ot),it.scrollTrigger),ot}var nt=et.prototype;return nt.to=function(rt,ot,at){return _createTweenType(0,arguments,this),this},nt.from=function(rt,ot,at){return _createTweenType(1,arguments,this),this},nt.fromTo=function(rt,ot,at,st){return _createTweenType(2,arguments,this),this},nt.set=function(rt,ot,at){return ot.duration=0,ot.parent=this,_inheritDefaults(ot).repeatDelay||(ot.repeat=0),ot.immediateRender=!!ot.immediateRender,new Tween(rt,ot,_parsePosition(this,at),1),this},nt.call=function(rt,ot,at){return _addToTimeline(this,Tween.delayedCall(0,rt,ot),at)},nt.staggerTo=function(rt,ot,at,st,lt,ct,ut){return at.duration=ot,at.stagger=at.stagger||st,at.onComplete=ct,at.onCompleteParams=ut,at.parent=this,new Tween(rt,at,_parsePosition(this,lt)),this},nt.staggerFrom=function(rt,ot,at,st,lt,ct,ut){return at.runBackwards=1,_inheritDefaults(at).immediateRender=_isNotFalse(at.immediateRender),this.staggerTo(rt,ot,at,st,lt,ct,ut)},nt.staggerFromTo=function(rt,ot,at,st,lt,ct,ut,ht){return st.startAt=at,_inheritDefaults(st).immediateRender=_isNotFalse(st.immediateRender),this.staggerTo(rt,ot,st,lt,ct,ut,ht)},nt.render=function(rt,ot,at){var st=this._time,lt=this._dirty?this.totalDuration():this._tDur,ct=this._dur,ut=rt<=0?0:_roundPrecise(rt),ht=this._zTime<0!=rt<0&&(this._initted||!ct),dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,$t;if(this!==_globalTimeline&&ut>lt&&rt>=0&&(ut=lt),ut!==this._tTime||at||ht){if(st!==this._time&&ct&&(ut+=this._time-st,rt+=this._time-st),dt=ut,xt=this._start,vt=this._ts,yt=!vt,ht&&(ct||(st=this._zTime),(rt||!ot)&&(this._zTime=rt)),this._repeat){if(Et=this._yoyo,bt=ct+this._rDelay,this._repeat<-1&&rt<0)return this.totalTime(bt*100+rt,ot,at);if(dt=_roundPrecise(ut%bt),ut===lt?(gt=this._repeat,dt=ct):(gt=~~(ut/bt),gt&>===ut/bt&&(dt=ct,gt--),dt>ct&&(dt=ct)),St=_animationCycle(this._tTime,bt),!st&&this._tTime&&St!==gt&&this._tTime-St*bt-this._dur<=0&&(St=gt),Et&>&1&&(dt=ct-dt,$t=1),gt!==St&&!this._lock){var It=Et&&St&1,Ft=It===(Et&>&1);if(gt=st&&rt>=0)for(pt=this._first;pt;){if(mt=pt._next,(pt._act||dt>=pt._start)&&pt._ts&&wt!==pt){if(pt.parent!==this)return this.render(rt,ot,at);if(pt.render(pt._ts>0?(dt-pt._start)*pt._ts:(pt._dirty?pt.totalDuration():pt._tDur)+(dt-pt._start)*pt._ts,ot,at),dt!==this._time||!this._ts&&!yt){wt=0,mt&&(ut+=this._zTime=-_tinyNum);break}}pt=mt}else{pt=this._last;for(var Ht=rt<0?rt:dt;pt;){if(mt=pt._prev,(pt._act||Ht<=pt._end)&&pt._ts&&wt!==pt){if(pt.parent!==this)return this.render(rt,ot,at);if(pt.render(pt._ts>0?(Ht-pt._start)*pt._ts:(pt._dirty?pt.totalDuration():pt._tDur)+(Ht-pt._start)*pt._ts,ot,at||_reverting$1&&(pt._initted||pt._startAt)),dt!==this._time||!this._ts&&!yt){wt=0,mt&&(ut+=this._zTime=Ht?-_tinyNum:_tinyNum);break}}pt=mt}}if(wt&&!ot&&(this.pause(),wt.render(dt>=st?0:-_tinyNum)._zTime=dt>=st?1:-1,this._ts))return this._start=xt,_setEnd(this),this.render(rt,ot,at);this._onUpdate&&!ot&&_callback(this,"onUpdate",!0),(ut===lt&&this._tTime>=this.totalDuration()||!ut&&st)&&(xt===this._start||Math.abs(vt)!==Math.abs(this._ts))&&(this._lock||((rt||!ct)&&(ut===lt&&this._ts>0||!ut&&this._ts<0)&&_removeFromParent(this,1),!ot&&!(rt<0&&!st)&&(ut||st||!lt)&&(_callback(this,ut===lt&&rt>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(ut0)&&this._prom())))}return this},nt.add=function(rt,ot){var at=this;if(_isNumber(ot)||(ot=_parsePosition(this,ot,rt)),!(rt instanceof Animation)){if(_isArray(rt))return rt.forEach(function(st){return at.add(st,ot)}),this;if(_isString(rt))return this.addLabel(rt,ot);if(_isFunction(rt))rt=Tween.delayedCall(0,rt);else return this}return this!==rt?_addToTimeline(this,rt,ot):this},nt.getChildren=function(rt,ot,at,st){rt===void 0&&(rt=!0),ot===void 0&&(ot=!0),at===void 0&&(at=!0),st===void 0&&(st=-_bigNum$1);for(var lt=[],ct=this._first;ct;)ct._start>=st&&(ct instanceof Tween?ot&<.push(ct):(at&<.push(ct),rt&<.push.apply(lt,ct.getChildren(!0,ot,at)))),ct=ct._next;return lt},nt.getById=function(rt){for(var ot=this.getChildren(1,1,1),at=ot.length;at--;)if(ot[at].vars.id===rt)return ot[at]},nt.remove=function(rt){return _isString(rt)?this.removeLabel(rt):_isFunction(rt)?this.killTweensOf(rt):(_removeLinkedListItem(this,rt),rt===this._recent&&(this._recent=this._last),_uncache(this))},nt.totalTime=function(rt,ot){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=_roundPrecise(_ticker.time-(this._ts>0?rt/this._ts:(this.totalDuration()-rt)/-this._ts))),tt.prototype.totalTime.call(this,rt,ot),this._forcing=0,this):this._tTime},nt.addLabel=function(rt,ot){return this.labels[rt]=_parsePosition(this,ot),this},nt.removeLabel=function(rt){return delete this.labels[rt],this},nt.addPause=function(rt,ot,at){var st=Tween.delayedCall(0,ot||_emptyFunc,at);return st.data="isPause",this._hasPause=1,_addToTimeline(this,st,_parsePosition(this,rt))},nt.removePause=function(rt){var ot=this._first;for(rt=_parsePosition(this,rt);ot;)ot._start===rt&&ot.data==="isPause"&&_removeFromParent(ot),ot=ot._next},nt.killTweensOf=function(rt,ot,at){for(var st=this.getTweensOf(rt,at),lt=st.length;lt--;)_overwritingTween!==st[lt]&&st[lt].kill(rt,ot);return this},nt.getTweensOf=function(rt,ot){for(var at=[],st=toArray$2(rt),lt=this._first,ct=_isNumber(ot),ut;lt;)lt instanceof Tween?_arrayContainsAny(lt._targets,st)&&(ct?(!_overwritingTween||lt._initted&<._ts)&<.globalTime(0)<=ot&<.globalTime(lt.totalDuration())>ot:!ot||lt.isActive())&&at.push(lt):(ut=lt.getTweensOf(st,ot)).length&&at.push.apply(at,ut),lt=lt._next;return at},nt.tweenTo=function(rt,ot){ot=ot||{};var at=this,st=_parsePosition(at,rt),lt=ot,ct=lt.startAt,ut=lt.onStart,ht=lt.onStartParams,dt=lt.immediateRender,pt,mt=Tween.to(at,_setDefaults({ease:ot.ease||"none",lazy:!1,immediateRender:!1,time:st,overwrite:"auto",duration:ot.duration||Math.abs((st-(ct&&"time"in ct?ct.time:at._time))/at.timeScale())||_tinyNum,onStart:function(){if(at.pause(),!pt){var bt=ot.duration||Math.abs((st-(ct&&"time"in ct?ct.time:at._time))/at.timeScale());mt._dur!==bt&&_setDuration(mt,bt,0,1).render(mt._time,!0,!0),pt=1}ut&&ut.apply(mt,ht||[])}},ot));return dt?mt.render(0):mt},nt.tweenFromTo=function(rt,ot,at){return this.tweenTo(ot,_setDefaults({startAt:{time:_parsePosition(this,rt)}},at))},nt.recent=function(){return this._recent},nt.nextLabel=function(rt){return rt===void 0&&(rt=this._time),_getLabelInDirection(this,_parsePosition(this,rt))},nt.previousLabel=function(rt){return rt===void 0&&(rt=this._time),_getLabelInDirection(this,_parsePosition(this,rt),1)},nt.currentLabel=function(rt){return arguments.length?this.seek(rt,!0):this.previousLabel(this._time+_tinyNum)},nt.shiftChildren=function(rt,ot,at){at===void 0&&(at=0);for(var st=this._first,lt=this.labels,ct;st;)st._start>=at&&(st._start+=rt,st._end+=rt),st=st._next;if(ot)for(ct in lt)lt[ct]>=at&&(lt[ct]+=rt);return _uncache(this)},nt.invalidate=function(rt){var ot=this._first;for(this._lock=0;ot;)ot.invalidate(rt),ot=ot._next;return tt.prototype.invalidate.call(this,rt)},nt.clear=function(rt){rt===void 0&&(rt=!0);for(var ot=this._first,at;ot;)at=ot._next,this.remove(ot),ot=at;return this._dp&&(this._time=this._tTime=this._pTime=0),rt&&(this.labels={}),_uncache(this)},nt.totalDuration=function(rt){var ot=0,at=this,st=at._last,lt=_bigNum$1,ct,ut,ht;if(arguments.length)return at.timeScale((at._repeat<0?at.duration():at.totalDuration())/(at.reversed()?-rt:rt));if(at._dirty){for(ht=at.parent;st;)ct=st._prev,st._dirty&&st.totalDuration(),ut=st._start,ut>lt&&at._sort&&st._ts&&!at._lock?(at._lock=1,_addToTimeline(at,st,ut-st._delay,1)._lock=0):lt=ut,ut<0&&st._ts&&(ot-=ut,(!ht&&!at._dp||ht&&ht.smoothChildTiming)&&(at._start+=ut/at._ts,at._time-=ut,at._tTime-=ut),at.shiftChildren(-ut,!1,-1/0),lt=0),st._end>ot&&st._ts&&(ot=st._end),st=ct;_setDuration(at,at===_globalTimeline&&at._time>ot?at._time:ot,1,1),at._dirty=0}return at._tDur},et.updateRoot=function(rt){if(_globalTimeline._ts&&(_lazySafeRender(_globalTimeline,_parentToChildTotalTime(rt,_globalTimeline)),_lastRenderedFrame=_ticker.frame),_ticker.frame>=_nextGCFrame){_nextGCFrame+=_config.autoSleep||120;var ot=_globalTimeline._first;if((!ot||!ot._ts)&&_config.autoSleep&&_ticker._listeners.length<2){for(;ot&&!ot._ts;)ot=ot._next;ot||_ticker.sleep()}}},et}(Animation);_setDefaults(Timeline$1.prototype,{_lock:0,_hasPause:0,_forcing:0});var _addComplexStringPropTween=function tt(et,nt,it,rt,ot,at,st){var lt=new PropTween(this._pt,et,nt,0,1,_renderComplexString,null,ot),ct=0,ut=0,ht,dt,pt,mt,gt,bt,yt,wt;for(lt.b=it,lt.e=rt,it+="",rt+="",(yt=~rt.indexOf("random("))&&(rt=_replaceRandom(rt)),at&&(wt=[it,rt],at(wt,et,nt),it=wt[0],rt=wt[1]),dt=it.match(_complexStringNumExp)||[];ht=_complexStringNumExp.exec(rt);)mt=ht[0],gt=rt.substring(ct,ht.index),pt?pt=(pt+1)%5:gt.substr(-5)==="rgba("&&(pt=1),mt!==dt[ut++]&&(bt=parseFloat(dt[ut-1])||0,lt._pt={_next:lt._pt,p:gt||ut===1?gt:",",s:bt,c:mt.charAt(1)==="="?_parseRelative(bt,mt)-bt:parseFloat(mt)-bt,m:pt&&pt<4?Math.round:0},ct=_complexStringNumExp.lastIndex);return lt.c=ct")}),xt.duration();else{Et={};for(It in mt)It==="ease"||It==="easeEach"||_parseKeyframe(It,mt[It],Et,mt.easeEach);for(It in Et)for(jt=Et[It].sort(function(Ct,Ut){return Ct.t-Ut.t}),Ot=0,St=0;Stlt-_tinyNum&&!ut?lt:rt<_tinyNum?0:rt,dt,pt,mt,gt,bt,yt,wt,vt,xt;if(!ct)_renderZeroDurationTween(this,rt,ot,at);else if(ht!==this._tTime||!rt||at||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==ut){if(dt=ht,vt=this.timeline,this._repeat){if(gt=ct+this._rDelay,this._repeat<-1&&ut)return this.totalTime(gt*100+rt,ot,at);if(dt=_roundPrecise(ht%gt),ht===lt?(mt=this._repeat,dt=ct):(mt=~~(ht/gt),mt&&mt===_roundPrecise(ht/gt)&&(dt=ct,mt--),dt>ct&&(dt=ct)),yt=this._yoyo&&mt&1,yt&&(xt=this._yEase,dt=ct-dt),bt=_animationCycle(this._tTime,gt),dt===st&&!at&&this._initted&&mt===bt)return this._tTime=ht,this;mt!==bt&&(vt&&this._yEase&&_propagateYoyoEase(vt,yt),this.vars.repeatRefresh&&!yt&&!this._lock&&this._time!==ct&&this._initted&&(this._lock=at=1,this.render(_roundPrecise(gt*mt),!0).invalidate()._lock=0))}if(!this._initted){if(_attemptInitTween(this,ut?rt:dt,at,ot,ht))return this._tTime=0,this;if(st!==this._time&&!(at&&this.vars.repeatRefresh&&mt!==bt))return this;if(ct!==this._dur)return this.render(rt,ot,at)}if(this._tTime=ht,this._time=dt,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=wt=(xt||this._ease)(dt/ct),this._from&&(this.ratio=wt=1-wt),dt&&!st&&!ot&&!mt&&(_callback(this,"onStart"),this._tTime!==ht))return this;for(pt=this._pt;pt;)pt.r(wt,pt.d),pt=pt._next;vt&&vt.render(rt<0?rt:!dt&&yt?-_tinyNum:vt._dur*vt._ease(dt/this._dur),ot,at)||this._startAt&&(this._zTime=rt),this._onUpdate&&!ot&&(ut&&_rewindStartAt(this,rt,ot,at),_callback(this,"onUpdate")),this._repeat&&mt!==bt&&this.vars.onRepeat&&!ot&&this.parent&&_callback(this,"onRepeat"),(ht===this._tDur||!ht)&&this._tTime===ht&&(ut&&!this._onUpdate&&_rewindStartAt(this,rt,!0,!0),(rt||!ct)&&(ht===this._tDur&&this._ts>0||!ht&&this._ts<0)&&_removeFromParent(this,1),!ot&&!(ut&&!st)&&(ht||st||yt)&&(_callback(this,ht===lt?"onComplete":"onReverseComplete",!0),this._prom&&!(ht0)&&this._prom()))}return this},nt.targets=function(){return this._targets},nt.invalidate=function(rt){return(!rt||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(rt),tt.prototype.invalidate.call(this,rt)},nt.resetTo=function(rt,ot,at,st,lt){_tickerActive||_ticker.wake(),this._ts||this.play();var ct=Math.min(this._dur,(this._dp._time-this._start)*this._ts),ut;return this._initted||_initTween(this,ct),ut=this._ease(ct/this._dur),_updatePropTweens(this,rt,ot,at,st,ut,ct,lt)?this.resetTo(rt,ot,at,st,1):(_alignPlayhead(this,0),this.parent||_addLinkedListItem(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},nt.kill=function(rt,ot){if(ot===void 0&&(ot="all"),!rt&&(!ot||ot==="all"))return this._lazy=this._pt=0,this.parent?_interrupt(this):this;if(this.timeline){var at=this.timeline.totalDuration();return this.timeline.killTweensOf(rt,ot,_overwritingTween&&_overwritingTween.vars.overwrite!==!0)._first||_interrupt(this),this.parent&&at!==this.timeline.totalDuration()&&_setDuration(this,this._dur*this.timeline._tDur/at,0,1),this}var st=this._targets,lt=rt?toArray$2(rt):st,ct=this._ptLookup,ut=this._pt,ht,dt,pt,mt,gt,bt,yt;if((!ot||ot==="all")&&_arraysMatch(st,lt))return ot==="all"&&(this._pt=0),_interrupt(this);for(ht=this._op=this._op||[],ot!=="all"&&(_isString(ot)&&(gt={},_forEachName(ot,function(wt){return gt[wt]=1}),ot=gt),ot=_addAliasesToVars(st,ot)),yt=st.length;yt--;)if(~lt.indexOf(st[yt])){dt=ct[yt],ot==="all"?(ht[yt]=ot,mt=dt,pt={}):(pt=ht[yt]=ht[yt]||{},mt=ot);for(gt in mt)bt=dt&&dt[gt],bt&&((!("kill"in bt.d)||bt.d.kill(gt)===!0)&&_removeLinkedListItem(this,bt,"_pt"),delete dt[gt]),pt!=="all"&&(pt[gt]=1)}return this._initted&&!this._pt&&ut&&_interrupt(this),this},et.to=function(rt,ot){return new et(rt,ot,arguments[2])},et.from=function(rt,ot){return _createTweenType(1,arguments)},et.delayedCall=function(rt,ot,at,st){return new et(ot,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:rt,onComplete:ot,onReverseComplete:ot,onCompleteParams:at,onReverseCompleteParams:at,callbackScope:st})},et.fromTo=function(rt,ot,at){return _createTweenType(2,arguments)},et.set=function(rt,ot){return ot.duration=0,ot.repeatDelay||(ot.repeat=0),new et(rt,ot)},et.killTweensOf=function(rt,ot,at){return _globalTimeline.killTweensOf(rt,ot,at)},et}(Animation);_setDefaults(Tween.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});_forEachName("staggerTo,staggerFrom,staggerFromTo",function(tt){Tween[tt]=function(){var et=new Timeline$1,nt=_slice.call(arguments,0);return nt.splice(tt==="staggerFromTo"?5:4,0,0),et[tt].apply(et,nt)}});var _setterPlain=function tt(et,nt,it){return et[nt]=it},_setterFunc=function tt(et,nt,it){return et[nt](it)},_setterFuncWithParam=function tt(et,nt,it,rt){return et[nt](rt.fp,it)},_setterAttribute=function tt(et,nt,it){return et.setAttribute(nt,it)},_getSetter=function tt(et,nt){return _isFunction(et[nt])?_setterFunc:_isUndefined(et[nt])&&et.setAttribute?_setterAttribute:_setterPlain},_renderPlain=function tt(et,nt){return nt.set(nt.t,nt.p,Math.round((nt.s+nt.c*et)*1e6)/1e6,nt)},_renderBoolean=function tt(et,nt){return nt.set(nt.t,nt.p,!!(nt.s+nt.c*et),nt)},_renderComplexString=function tt(et,nt){var it=nt._pt,rt="";if(!et&&nt.b)rt=nt.b;else if(et===1&&nt.e)rt=nt.e;else{for(;it;)rt=it.p+(it.m?it.m(it.s+it.c*et):Math.round((it.s+it.c*et)*1e4)/1e4)+rt,it=it._next;rt+=nt.c}nt.set(nt.t,nt.p,rt,nt)},_renderPropTweens=function tt(et,nt){for(var it=nt._pt;it;)it.r(et,it.d),it=it._next},_addPluginModifier=function tt(et,nt,it,rt){for(var ot=this._pt,at;ot;)at=ot._next,ot.p===rt&&ot.modifier(et,nt,it),ot=at},_killPropTweensOf=function tt(et){for(var nt=this._pt,it,rt;nt;)rt=nt._next,nt.p===et&&!nt.op||nt.op===et?_removeLinkedListItem(this,nt,"_pt"):nt.dep||(it=1),nt=rt;return!it},_setterWithModifier=function tt(et,nt,it,rt){rt.mSet(et,nt,rt.m.call(rt.tween,it,rt.mt),rt)},_sortPropTweensByPriority=function tt(et){for(var nt=et._pt,it,rt,ot,at;nt;){for(it=nt._next,rt=ot;rt&&rt.pr>nt.pr;)rt=rt._next;(nt._prev=rt?rt._prev:at)?nt._prev._next=nt:ot=nt,(nt._next=rt)?rt._prev=nt:at=nt,nt=it}et._pt=ot},PropTween=function(){function tt(nt,it,rt,ot,at,st,lt,ct,ut){this.t=it,this.s=ot,this.c=at,this.p=rt,this.r=st||_renderPlain,this.d=lt||this,this.set=ct||_setterPlain,this.pr=ut||0,this._next=nt,nt&&(nt._prev=this)}var et=tt.prototype;return et.modifier=function(it,rt,ot){this.mSet=this.mSet||this.set,this.set=_setterWithModifier,this.m=it,this.mt=ot,this.tween=rt},tt}();_forEachName(_callbackNames+"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(tt){return _reservedProps[tt]=1});_globals.TweenMax=_globals.TweenLite=Tween;_globals.TimelineLite=_globals.TimelineMax=Timeline$1;_globalTimeline=new Timeline$1({sortChildren:!1,defaults:_defaults,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});_config.stringFilter=_colorStringFilter;var _media=[],_listeners={},_emptyArray=[],_lastMediaTime=0,_contextID=0,_dispatch=function tt(et){return(_listeners[et]||_emptyArray).map(function(nt){return nt()})},_onMediaChange=function tt(){var et=Date.now(),nt=[];et-_lastMediaTime>2&&(_dispatch("matchMediaInit"),_media.forEach(function(it){var rt=it.queries,ot=it.conditions,at,st,lt,ct;for(st in rt)at=_win$1.matchMedia(rt[st]).matches,at&&(lt=1),at!==ot[st]&&(ot[st]=at,ct=1);ct&&(it.revert(),lt&&nt.push(it))}),_dispatch("matchMediaRevert"),nt.forEach(function(it){return it.onMatch(it,function(rt){return it.add(null,rt)})}),_lastMediaTime=et,_dispatch("matchMedia"))},Context$1=function(){function tt(nt,it){this.selector=it&&selector$1(it),this.data=[],this._r=[],this.isReverted=!1,this.id=_contextID++,nt&&this.add(nt)}var et=tt.prototype;return et.add=function(it,rt,ot){_isFunction(it)&&(ot=rt,rt=it,it=_isFunction);var at=this,st=function(){var ct=_context,ut=at.selector,ht;return ct&&ct!==at&&ct.data.push(at),ot&&(at.selector=selector$1(ot)),_context=at,ht=rt.apply(at,arguments),_isFunction(ht)&&at._r.push(ht),_context=ct,at.selector=ut,at.isReverted=!1,ht};return at.last=st,it===_isFunction?st(at,function(lt){return at.add(null,lt)}):it?at[it]=st:st},et.ignore=function(it){var rt=_context;_context=null,it(this),_context=rt},et.getTweens=function(){var it=[];return this.data.forEach(function(rt){return rt instanceof tt?it.push.apply(it,rt.getTweens()):rt instanceof Tween&&!(rt.parent&&rt.parent.data==="nested")&&it.push(rt)}),it},et.clear=function(){this._r.length=this.data.length=0},et.kill=function(it,rt){var ot=this;if(it?function(){for(var st=ot.getTweens(),lt=ot.data.length,ct;lt--;)ct=ot.data[lt],ct.data==="isFlip"&&(ct.revert(),ct.getChildren(!0,!0,!1).forEach(function(ut){return st.splice(st.indexOf(ut),1)}));for(st.map(function(ut){return{g:ut._dur||ut._delay||ut._sat&&!ut._sat.vars.immediateRender?ut.globalTime(0):-1/0,t:ut}}).sort(function(ut,ht){return ht.g-ut.g||-1/0}).forEach(function(ut){return ut.t.revert(it)}),lt=ot.data.length;lt--;)ct=ot.data[lt],ct instanceof Timeline$1?ct.data!=="nested"&&(ct.scrollTrigger&&ct.scrollTrigger.revert(),ct.kill()):!(ct instanceof Tween)&&ct.revert&&ct.revert(it);ot._r.forEach(function(ut){return ut(it,ot)}),ot.isReverted=!0}():this.data.forEach(function(st){return st.kill&&st.kill()}),this.clear(),rt)for(var at=_media.length;at--;)_media[at].id===this.id&&_media.splice(at,1)},et.revert=function(it){this.kill(it||{})},tt}(),MatchMedia=function(){function tt(nt){this.contexts=[],this.scope=nt}var et=tt.prototype;return et.add=function(it,rt,ot){_isObject(it)||(it={matches:it});var at=new Context$1(0,ot||this.scope),st=at.conditions={},lt,ct,ut;_context&&!at.selector&&(at.selector=_context.selector),this.contexts.push(at),rt=at.add("onMatch",rt),at.queries=it;for(ct in it)ct==="all"?ut=1:(lt=_win$1.matchMedia(it[ct]),lt&&(_media.indexOf(at)<0&&_media.push(at),(st[ct]=lt.matches)&&(ut=1),lt.addListener?lt.addListener(_onMediaChange):lt.addEventListener("change",_onMediaChange)));return ut&&rt(at,function(ht){return at.add(null,ht)}),this},et.revert=function(it){this.kill(it||{})},et.kill=function(it){this.contexts.forEach(function(rt){return rt.kill(it,!0)})},tt}(),_gsap={registerPlugin:function tt(){for(var et=arguments.length,nt=new Array(et),it=0;it1){var rt=et.map(function(ut){return gsap.quickSetter(ut,nt,it)}),ot=rt.length;return function(ut){for(var ht=ot;ht--;)rt[ht](ut)}}et=et[0]||{};var at=_plugins[nt],st=_getCache(et),lt=st.harness&&(st.harness.aliases||{})[nt]||nt,ct=at?function(ut){var ht=new at;_quickTween._pt=0,ht.init(et,it?ut+it:ut,_quickTween,0,[et]),ht.render(1,ht),_quickTween._pt&&_renderPropTweens(1,_quickTween)}:st.set(et,lt);return at?ct:function(ut){return ct(et,lt,it?ut+it:ut,st,1)}},quickTo:function tt(et,nt,it){var rt,ot=gsap.to(et,_merge((rt={},rt[nt]="+=0.1",rt.paused=!0,rt),it||{})),at=function(lt,ct,ut){return ot.resetTo(nt,lt,ct,ut)};return at.tween=ot,at},isTweening:function tt(et){return _globalTimeline.getTweensOf(et,!0).length>0},defaults:function tt(et){return et&&et.ease&&(et.ease=_parseEase(et.ease,_defaults.ease)),_mergeDeep(_defaults,et||{})},config:function tt(et){return _mergeDeep(_config,et||{})},registerEffect:function tt(et){var nt=et.name,it=et.effect,rt=et.plugins,ot=et.defaults,at=et.extendTimeline;(rt||"").split(",").forEach(function(st){return st&&!_plugins[st]&&!_globals[st]&&_warn(nt+" effect requires "+st+" plugin.")}),_effects[nt]=function(st,lt,ct){return it(toArray$2(st),_setDefaults(lt||{},ot),ct)},at&&(Timeline$1.prototype[nt]=function(st,lt,ct){return this.add(_effects[nt](st,_isObject(lt)?lt:(ct=lt)&&{},this),ct)})},registerEase:function tt(et,nt){_easeMap[et]=_parseEase(nt)},parseEase:function tt(et,nt){return arguments.length?_parseEase(et,nt):_easeMap},getById:function tt(et){return _globalTimeline.getById(et)},exportRoot:function tt(et,nt){et===void 0&&(et={});var it=new Timeline$1(et),rt,ot;for(it.smoothChildTiming=_isNotFalse(et.smoothChildTiming),_globalTimeline.remove(it),it._dp=0,it._time=it._tTime=_globalTimeline._time,rt=_globalTimeline._first;rt;)ot=rt._next,(nt||!(!rt._dur&&rt instanceof Tween&&rt.vars.onComplete===rt._targets[0]))&&_addToTimeline(it,rt,rt._start-rt._delay),rt=ot;return _addToTimeline(_globalTimeline,it,0),it},context:function tt(et,nt){return et?new Context$1(et,nt):_context},matchMedia:function tt(et){return new MatchMedia(et)},matchMediaRefresh:function tt(){return _media.forEach(function(et){var nt=et.conditions,it,rt;for(rt in nt)nt[rt]&&(nt[rt]=!1,it=1);it&&et.revert()})||_onMediaChange()},addEventListener:function tt(et,nt){var it=_listeners[et]||(_listeners[et]=[]);~it.indexOf(nt)||it.push(nt)},removeEventListener:function tt(et,nt){var it=_listeners[et],rt=it&&it.indexOf(nt);rt>=0&&it.splice(rt,1)},utils:{wrap:wrap$2,wrapYoyo,distribute,random,snap,normalize:normalize$3,getUnit,clamp:clamp$2,splitColor,toArray:toArray$2,selector:selector$1,mapRange,pipe,unitize,interpolate:interpolate$2,shuffle},install:_install,effects:_effects,ticker:_ticker,updateRoot:Timeline$1.updateRoot,plugins:_plugins,globalTimeline:_globalTimeline,core:{PropTween,globals:_addGlobal,Tween,Timeline:Timeline$1,Animation,getCache:_getCache,_removeLinkedListItem,reverting:function tt(){return _reverting$1},context:function tt(et){return et&&_context&&(_context.data.push(et),et._ctx=_context),_context},suppressOverwrites:function tt(et){return _suppressOverwrites=et}}};_forEachName("to,from,fromTo,delayedCall,set,killTweensOf",function(tt){return _gsap[tt]=Tween[tt]});_ticker.add(Timeline$1.updateRoot);_quickTween=_gsap.to({},{duration:0});var _getPluginPropTween=function tt(et,nt){for(var it=et._pt;it&&it.p!==nt&&it.op!==nt&&it.fp!==nt;)it=it._next;return it},_addModifiers=function tt(et,nt){var it=et._targets,rt,ot,at;for(rt in nt)for(ot=it.length;ot--;)at=et._ptLookup[ot][rt],at&&(at=at.d)&&(at._pt&&(at=_getPluginPropTween(at,rt)),at&&at.modifier&&at.modifier(nt[rt],et,it[ot],rt))},_buildModifierPlugin=function tt(et,nt){return{name:et,rawVars:1,init:function(rt,ot,at){at._onInit=function(st){var lt,ct;if(_isString(ot)&&(lt={},_forEachName(ot,function(ut){return lt[ut]=1}),ot=lt),nt){lt={};for(ct in ot)lt[ct]=nt(ot[ct]);ot=lt}_addModifiers(st,ot)}}}},gsap=_gsap.registerPlugin({name:"attr",init:function tt(et,nt,it,rt,ot){var at,st,lt;this.tween=it;for(at in nt)lt=et.getAttribute(at)||"",st=this.add(et,"setAttribute",(lt||0)+"",nt[at],rt,ot,0,0,at),st.op=at,st.b=lt,this._props.push(at)},render:function tt(et,nt){for(var it=nt._pt;it;)_reverting$1?it.set(it.t,it.p,it.b,it):it.r(et,it.d),it=it._next}},{name:"endArray",init:function tt(et,nt){for(var it=nt.length;it--;)this.add(et,it,et[it]||0,nt[it],0,0,0,0,0,1)}},_buildModifierPlugin("roundProps",_roundModifier),_buildModifierPlugin("modifiers"),_buildModifierPlugin("snap",snap))||_gsap;Tween.version=Timeline$1.version=gsap.version="3.12.4";_coreReady=1;_windowExists$1()&&_wake();_easeMap.Power0;_easeMap.Power1;_easeMap.Power2;_easeMap.Power3;_easeMap.Power4;_easeMap.Linear;_easeMap.Quad;_easeMap.Cubic;_easeMap.Quart;_easeMap.Quint;_easeMap.Strong;_easeMap.Elastic;_easeMap.Back;_easeMap.SteppedEase;_easeMap.Bounce;_easeMap.Sine;_easeMap.Expo;_easeMap.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 _win,_doc,_docElement,_pluginInitted,_tempDiv,_recentSetterPlugin,_reverting,_windowExists=function tt(){return typeof window<"u"},_transformProps={},_RAD2DEG=180/Math.PI,_DEG2RAD=Math.PI/180,_atan2=Math.atan2,_bigNum=1e8,_capsExp=/([A-Z])/g,_horizontalExp=/(left|right|width|margin|padding|x)/i,_complexExp=/[\s,\(]\S/,_propertyAliases={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_renderCSSProp=function tt(et,nt){return nt.set(nt.t,nt.p,Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u,nt)},_renderPropWithEnd=function tt(et,nt){return nt.set(nt.t,nt.p,et===1?nt.e:Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u,nt)},_renderCSSPropWithBeginning=function tt(et,nt){return nt.set(nt.t,nt.p,et?Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u:nt.b,nt)},_renderRoundedCSSProp=function tt(et,nt){var it=nt.s+nt.c*et;nt.set(nt.t,nt.p,~~(it+(it<0?-.5:.5))+nt.u,nt)},_renderNonTweeningValue=function tt(et,nt){return nt.set(nt.t,nt.p,et?nt.e:nt.b,nt)},_renderNonTweeningValueOnlyAtEnd=function tt(et,nt){return nt.set(nt.t,nt.p,et!==1?nt.b:nt.e,nt)},_setterCSSStyle=function tt(et,nt,it){return et.style[nt]=it},_setterCSSProp=function tt(et,nt,it){return et.style.setProperty(nt,it)},_setterTransform=function tt(et,nt,it){return et._gsap[nt]=it},_setterScale=function tt(et,nt,it){return et._gsap.scaleX=et._gsap.scaleY=it},_setterScaleWithRender=function tt(et,nt,it,rt,ot){var at=et._gsap;at.scaleX=at.scaleY=it,at.renderTransform(ot,at)},_setterTransformWithRender=function tt(et,nt,it,rt,ot){var at=et._gsap;at[nt]=it,at.renderTransform(ot,at)},_transformProp="transform",_transformOriginProp=_transformProp+"Origin",_saveStyle=function tt(et,nt){var it=this,rt=this.target,ot=rt.style,at=rt._gsap;if(et in _transformProps&&ot){if(this.tfm=this.tfm||{},et!=="transform")et=_propertyAliases[et]||et,~et.indexOf(",")?et.split(",").forEach(function(st){return it.tfm[st]=_get(rt,st)}):this.tfm[et]=at.x?at[et]:_get(rt,et),et===_transformOriginProp&&(this.tfm.zOrigin=at.zOrigin);else return _propertyAliases.transform.split(",").forEach(function(st){return tt.call(it,st,nt)});if(this.props.indexOf(_transformProp)>=0)return;at.svg&&(this.svgo=rt.getAttribute("data-svg-origin"),this.props.push(_transformOriginProp,nt,"")),et=_transformProp}(ot||nt)&&this.props.push(et,nt,ot[et])},_removeIndependentTransforms=function tt(et){et.translate&&(et.removeProperty("translate"),et.removeProperty("scale"),et.removeProperty("rotate"))},_revertStyle=function tt(){var et=this.props,nt=this.target,it=nt.style,rt=nt._gsap,ot,at;for(ot=0;ot=0?_prefixes[at]:"")+et},_initCore=function tt(){_windowExists()&&window.document&&(_win=window,_doc=_win.document,_docElement=_doc.documentElement,_tempDiv=_createElement("div")||{style:{}},_createElement("div"),_transformProp=_checkPropPrefix(_transformProp),_transformOriginProp=_transformProp+"Origin",_tempDiv.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",_supports3D=!!_checkPropPrefix("perspective"),_reverting=gsap.core.reverting,_pluginInitted=1)},_getBBoxHack=function tt(et){var nt=_createElement("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),it=this.parentNode,rt=this.nextSibling,ot=this.style.cssText,at;if(_docElement.appendChild(nt),nt.appendChild(this),this.style.display="block",et)try{at=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=tt}catch{}else this._gsapBBox&&(at=this._gsapBBox());return it&&(rt?it.insertBefore(this,rt):it.appendChild(this)),_docElement.removeChild(nt),this.style.cssText=ot,at},_getAttributeFallbacks=function tt(et,nt){for(var it=nt.length;it--;)if(et.hasAttribute(nt[it]))return et.getAttribute(nt[it])},_getBBox=function tt(et){var nt;try{nt=et.getBBox()}catch{nt=_getBBoxHack.call(et,!0)}return nt&&(nt.width||nt.height)||et.getBBox===_getBBoxHack||(nt=_getBBoxHack.call(et,!0)),nt&&!nt.width&&!nt.x&&!nt.y?{x:+_getAttributeFallbacks(et,["x","cx","x1"])||0,y:+_getAttributeFallbacks(et,["y","cy","y1"])||0,width:0,height:0}:nt},_isSVG=function tt(et){return!!(et.getCTM&&(!et.parentNode||et.ownerSVGElement)&&_getBBox(et))},_removeProperty=function tt(et,nt){if(nt){var it=et.style,rt;nt in _transformProps&&nt!==_transformOriginProp&&(nt=_transformProp),it.removeProperty?(rt=nt.substr(0,2),(rt==="ms"||nt.substr(0,6)==="webkit")&&(nt="-"+nt),it.removeProperty(rt==="--"?nt:nt.replace(_capsExp,"-$1").toLowerCase())):it.removeAttribute(nt)}},_addNonTweeningPT=function tt(et,nt,it,rt,ot,at){var st=new PropTween(et._pt,nt,it,0,1,at?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue);return et._pt=st,st.b=rt,st.e=ot,et._props.push(it),st},_nonConvertibleUnits={deg:1,rad:1,turn:1},_nonStandardLayouts={grid:1,flex:1},_convertToUnit=function tt(et,nt,it,rt){var ot=parseFloat(it)||0,at=(it+"").trim().substr((ot+"").length)||"px",st=_tempDiv.style,lt=_horizontalExp.test(nt),ct=et.tagName.toLowerCase()==="svg",ut=(ct?"client":"offset")+(lt?"Width":"Height"),ht=100,dt=rt==="px",pt=rt==="%",mt,gt,bt,yt;if(rt===at||!ot||_nonConvertibleUnits[rt]||_nonConvertibleUnits[at])return ot;if(at!=="px"&&!dt&&(ot=tt(et,nt,it,"px")),yt=et.getCTM&&_isSVG(et),(pt||at==="%")&&(_transformProps[nt]||~nt.indexOf("adius")))return mt=yt?et.getBBox()[lt?"width":"height"]:et[ut],_round(pt?ot/mt*ht:ot/100*mt);if(st[lt?"width":"height"]=ht+(dt?at:rt),gt=~nt.indexOf("adius")||rt==="em"&&et.appendChild&&!ct?et:et.parentNode,yt&&(gt=(et.ownerSVGElement||{}).parentNode),(!gt||gt===_doc||!gt.appendChild)&&(gt=_doc.body),bt=gt._gsap,bt&&pt&&bt.width&<&&bt.time===_ticker.time&&!bt.uncache)return _round(ot/bt.width*ht);if(pt&&(nt==="height"||nt==="width")){var wt=et.style[nt];et.style[nt]=ht+rt,mt=et[ut],wt?et.style[nt]=wt:_removeProperty(et,nt)}else(pt||at==="%")&&!_nonStandardLayouts[_getComputedProperty(gt,"display")]&&(st.position=_getComputedProperty(et,"position")),gt===et&&(st.position="static"),gt.appendChild(_tempDiv),mt=_tempDiv[ut],gt.removeChild(_tempDiv),st.position="absolute";return lt&&pt&&(bt=_getCache(gt),bt.time=_ticker.time,bt.width=gt[ut]),_round(dt?mt*ot/ht:mt&&ot?ht/mt*ot:0)},_get=function tt(et,nt,it,rt){var ot;return _pluginInitted||_initCore(),nt in _propertyAliases&&nt!=="transform"&&(nt=_propertyAliases[nt],~nt.indexOf(",")&&(nt=nt.split(",")[0])),_transformProps[nt]&&nt!=="transform"?(ot=_parseTransform(et,rt),ot=nt!=="transformOrigin"?ot[nt]:ot.svg?ot.origin:_firstTwoOnly(_getComputedProperty(et,_transformOriginProp))+" "+ot.zOrigin+"px"):(ot=et.style[nt],(!ot||ot==="auto"||rt||~(ot+"").indexOf("calc("))&&(ot=_specialProps[nt]&&_specialProps[nt](et,nt,it)||_getComputedProperty(et,nt)||_getProperty(et,nt)||(nt==="opacity"?1:0))),it&&!~(ot+"").trim().indexOf(" ")?_convertToUnit(et,nt,ot,it)+it:ot},_tweenComplexCSSString=function tt(et,nt,it,rt){if(!it||it==="none"){var ot=_checkPropPrefix(nt,et,1),at=ot&&_getComputedProperty(et,ot,1);at&&at!==it?(nt=ot,it=at):nt==="borderColor"&&(it=_getComputedProperty(et,"borderTopColor"))}var st=new PropTween(this._pt,et.style,nt,0,1,_renderComplexString),lt=0,ct=0,ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St;if(st.b=it,st.e=rt,it+="",rt+="",rt==="auto"&&(gt=et.style[nt],et.style[nt]=rt,rt=_getComputedProperty(et,nt)||rt,gt?et.style[nt]=gt:_removeProperty(et,nt)),ut=[it,rt],_colorStringFilter(ut),it=ut[0],rt=ut[1],dt=it.match(_numWithUnitExp)||[],St=rt.match(_numWithUnitExp)||[],St.length){for(;ht=_numWithUnitExp.exec(rt);)bt=ht[0],wt=rt.substring(lt,ht.index),mt?mt=(mt+1)%5:(wt.substr(-5)==="rgba("||wt.substr(-5)==="hsla(")&&(mt=1),bt!==(gt=dt[ct++]||"")&&(pt=parseFloat(gt)||0,xt=gt.substr((pt+"").length),bt.charAt(1)==="="&&(bt=_parseRelative(pt,bt)+xt),yt=parseFloat(bt),vt=bt.substr((yt+"").length),lt=_numWithUnitExp.lastIndex-vt.length,vt||(vt=vt||_config.units[nt]||xt,lt===rt.length&&(rt+=vt,st.e+=vt)),xt!==vt&&(pt=_convertToUnit(et,nt,gt,vt)||0),st._pt={_next:st._pt,p:wt||ct===1?wt:",",s:pt,c:yt-pt,m:mt&&mt<4||nt==="zIndex"?Math.round:0});st.c=lt-1;)st=ot[ct],_transformProps[st]&&(lt=1,st=st==="transformOrigin"?_transformOriginProp:_transformProp),_removeProperty(it,st);lt&&(_removeProperty(it,_transformProp),at&&(at.svg&&it.removeAttribute("transform"),_parseTransform(it,1),at.uncache=1,_removeIndependentTransforms(rt)))}},_specialProps={clearProps:function tt(et,nt,it,rt,ot){if(ot.data!=="isFromStart"){var at=et._pt=new PropTween(et._pt,nt,it,0,0,_renderClearProps);return at.u=rt,at.pr=-10,at.tween=ot,et._props.push(it),1}}},_identity2DMatrix=[1,0,0,1,0,0],_rotationalProperties={},_isNullTransform=function tt(et){return et==="matrix(1, 0, 0, 1, 0, 0)"||et==="none"||!et},_getComputedTransformMatrixAsArray=function tt(et){var nt=_getComputedProperty(et,_transformProp);return _isNullTransform(nt)?_identity2DMatrix:nt.substr(7).match(_numExp).map(_round)},_getMatrix=function tt(et,nt){var it=et._gsap||_getCache(et),rt=et.style,ot=_getComputedTransformMatrixAsArray(et),at,st,lt,ct;return it.svg&&et.getAttribute("transform")?(lt=et.transform.baseVal.consolidate().matrix,ot=[lt.a,lt.b,lt.c,lt.d,lt.e,lt.f],ot.join(",")==="1,0,0,1,0,0"?_identity2DMatrix:ot):(ot===_identity2DMatrix&&!et.offsetParent&&et!==_docElement&&!it.svg&&(lt=rt.display,rt.display="block",at=et.parentNode,(!at||!et.offsetParent)&&(ct=1,st=et.nextElementSibling,_docElement.appendChild(et)),ot=_getComputedTransformMatrixAsArray(et),lt?rt.display=lt:_removeProperty(et,"display"),ct&&(st?at.insertBefore(et,st):at?at.appendChild(et):_docElement.removeChild(et))),nt&&ot.length>6?[ot[0],ot[1],ot[4],ot[5],ot[12],ot[13]]:ot)},_applySVGOrigin=function tt(et,nt,it,rt,ot,at){var st=et._gsap,lt=ot||_getMatrix(et,!0),ct=st.xOrigin||0,ut=st.yOrigin||0,ht=st.xOffset||0,dt=st.yOffset||0,pt=lt[0],mt=lt[1],gt=lt[2],bt=lt[3],yt=lt[4],wt=lt[5],vt=nt.split(" "),xt=parseFloat(vt[0])||0,St=parseFloat(vt[1])||0,Et,It,Tt,$t;it?lt!==_identity2DMatrix&&(It=pt*bt-mt*gt)&&(Tt=xt*(bt/It)+St*(-gt/It)+(gt*wt-bt*yt)/It,$t=xt*(-mt/It)+St*(pt/It)-(pt*wt-mt*yt)/It,xt=Tt,St=$t):(Et=_getBBox(et),xt=Et.x+(~vt[0].indexOf("%")?xt/100*Et.width:xt),St=Et.y+(~(vt[1]||vt[0]).indexOf("%")?St/100*Et.height:St),!("xOrigin"in st)&&(xt||St)&&(xt-=Et.x,St-=Et.y)),rt||rt!==!1&&st.smooth?(yt=xt-ct,wt=St-ut,st.xOffset=ht+(yt*pt+wt*gt)-yt,st.yOffset=dt+(yt*mt+wt*bt)-wt):st.xOffset=st.yOffset=0,st.xOrigin=xt,st.yOrigin=St,st.smooth=!!rt,st.origin=nt,st.originIsAbsolute=!!it,et.style[_transformOriginProp]="0px 0px",at&&(_addNonTweeningPT(at,st,"xOrigin",ct,xt),_addNonTweeningPT(at,st,"yOrigin",ut,St),_addNonTweeningPT(at,st,"xOffset",ht,st.xOffset),_addNonTweeningPT(at,st,"yOffset",dt,st.yOffset)),et.setAttribute("data-svg-origin",xt+" "+St)},_parseTransform=function tt(et,nt){var it=et._gsap||new GSCache(et);if("x"in it&&!nt&&!it.uncache)return it;var rt=et.style,ot=it.scaleX<0,at="px",st="deg",lt=getComputedStyle(et),ct=_getComputedProperty(et,_transformOriginProp)||"0",ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,It,Tt,$t,Ut,Lt,Bt,Pt,kt,At,Rt,Wt,jt,Ot,Ct,Dt,Mt,Vt,Qt,rn;return ut=ht=dt=gt=bt=yt=wt=vt=xt=0,pt=mt=1,it.svg=!!(et.getCTM&&_isSVG(et)),lt.translate&&((lt.translate!=="none"||lt.scale!=="none"||lt.rotate!=="none")&&(rt[_transformProp]=(lt.translate!=="none"?"translate3d("+(lt.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(lt.rotate!=="none"?"rotate("+lt.rotate+") ":"")+(lt.scale!=="none"?"scale("+lt.scale.split(" ").join(",")+") ":"")+(lt[_transformProp]!=="none"?lt[_transformProp]:"")),rt.scale=rt.rotate=rt.translate="none"),It=_getMatrix(et,it.svg),it.svg&&(it.uncache?(jt=et.getBBox(),ct=it.xOrigin-jt.x+"px "+(it.yOrigin-jt.y)+"px",Wt=""):Wt=!nt&&et.getAttribute("data-svg-origin"),_applySVGOrigin(et,Wt||ct,!!Wt||it.originIsAbsolute,it.smooth!==!1,It)),St=it.xOrigin||0,Et=it.yOrigin||0,It!==_identity2DMatrix&&(Lt=It[0],Bt=It[1],Pt=It[2],kt=It[3],ut=At=It[4],ht=Rt=It[5],It.length===6?(pt=Math.sqrt(Lt*Lt+Bt*Bt),mt=Math.sqrt(kt*kt+Pt*Pt),gt=Lt||Bt?_atan2(Bt,Lt)*_RAD2DEG:0,wt=Pt||kt?_atan2(Pt,kt)*_RAD2DEG+gt:0,wt&&(mt*=Math.abs(Math.cos(wt*_DEG2RAD))),it.svg&&(ut-=St-(St*Lt+Et*Pt),ht-=Et-(St*Bt+Et*kt))):(rn=It[6],Vt=It[7],Ct=It[8],Dt=It[9],Mt=It[10],Qt=It[11],ut=It[12],ht=It[13],dt=It[14],Tt=_atan2(rn,Mt),bt=Tt*_RAD2DEG,Tt&&($t=Math.cos(-Tt),Ut=Math.sin(-Tt),Wt=At*$t+Ct*Ut,jt=Rt*$t+Dt*Ut,Ot=rn*$t+Mt*Ut,Ct=At*-Ut+Ct*$t,Dt=Rt*-Ut+Dt*$t,Mt=rn*-Ut+Mt*$t,Qt=Vt*-Ut+Qt*$t,At=Wt,Rt=jt,rn=Ot),Tt=_atan2(-Pt,Mt),yt=Tt*_RAD2DEG,Tt&&($t=Math.cos(-Tt),Ut=Math.sin(-Tt),Wt=Lt*$t-Ct*Ut,jt=Bt*$t-Dt*Ut,Ot=Pt*$t-Mt*Ut,Qt=kt*Ut+Qt*$t,Lt=Wt,Bt=jt,Pt=Ot),Tt=_atan2(Bt,Lt),gt=Tt*_RAD2DEG,Tt&&($t=Math.cos(Tt),Ut=Math.sin(Tt),Wt=Lt*$t+Bt*Ut,jt=At*$t+Rt*Ut,Bt=Bt*$t-Lt*Ut,Rt=Rt*$t-At*Ut,Lt=Wt,At=jt),bt&&Math.abs(bt)+Math.abs(gt)>359.9&&(bt=gt=0,yt=180-yt),pt=_round(Math.sqrt(Lt*Lt+Bt*Bt+Pt*Pt)),mt=_round(Math.sqrt(Rt*Rt+rn*rn)),Tt=_atan2(At,Rt),wt=Math.abs(Tt)>2e-4?Tt*_RAD2DEG:0,xt=Qt?1/(Qt<0?-Qt:Qt):0),it.svg&&(Wt=et.getAttribute("transform"),it.forceCSS=et.setAttribute("transform","")||!_isNullTransform(_getComputedProperty(et,_transformProp)),Wt&&et.setAttribute("transform",Wt))),Math.abs(wt)>90&&Math.abs(wt)<270&&(ot?(pt*=-1,wt+=gt<=0?180:-180,gt+=gt<=0?180:-180):(mt*=-1,wt+=wt<=0?180:-180)),nt=nt||it.uncache,it.x=ut-((it.xPercent=ut&&(!nt&&it.xPercent||(Math.round(et.offsetWidth/2)===Math.round(-ut)?-50:0)))?et.offsetWidth*it.xPercent/100:0)+at,it.y=ht-((it.yPercent=ht&&(!nt&&it.yPercent||(Math.round(et.offsetHeight/2)===Math.round(-ht)?-50:0)))?et.offsetHeight*it.yPercent/100:0)+at,it.z=dt+at,it.scaleX=_round(pt),it.scaleY=_round(mt),it.rotation=_round(gt)+st,it.rotationX=_round(bt)+st,it.rotationY=_round(yt)+st,it.skewX=wt+st,it.skewY=vt+st,it.transformPerspective=xt+at,(it.zOrigin=parseFloat(ct.split(" ")[2])||!nt&&it.zOrigin||0)&&(rt[_transformOriginProp]=_firstTwoOnly(ct)),it.svg||(it.xOffset=it.yOffset=0),it.force3D=_config.force3D,it.renderTransform=it.svg?_renderSVGTransforms:_supports3D?_renderCSSTransforms:_renderNon3DTransforms,it.uncache=0,it},_firstTwoOnly=function tt(et){return(et=et.split(" "))[0]+" "+et[1]},_addPxTranslate=function tt(et,nt,it){var rt=getUnit(nt);return _round(parseFloat(nt)+parseFloat(_convertToUnit(et,"x",it+"px",rt)))+rt},_renderNon3DTransforms=function tt(et,nt){nt.z="0px",nt.rotationY=nt.rotationX="0deg",nt.force3D=0,_renderCSSTransforms(et,nt)},_zeroDeg="0deg",_zeroPx="0px",_endParenthesis=") ",_renderCSSTransforms=function tt(et,nt){var it=nt||this,rt=it.xPercent,ot=it.yPercent,at=it.x,st=it.y,lt=it.z,ct=it.rotation,ut=it.rotationY,ht=it.rotationX,dt=it.skewX,pt=it.skewY,mt=it.scaleX,gt=it.scaleY,bt=it.transformPerspective,yt=it.force3D,wt=it.target,vt=it.zOrigin,xt="",St=yt==="auto"&&et&&et!==1||yt===!0;if(vt&&(ht!==_zeroDeg||ut!==_zeroDeg)){var Et=parseFloat(ut)*_DEG2RAD,It=Math.sin(Et),Tt=Math.cos(Et),$t;Et=parseFloat(ht)*_DEG2RAD,$t=Math.cos(Et),at=_addPxTranslate(wt,at,It*$t*-vt),st=_addPxTranslate(wt,st,-Math.sin(Et)*-vt),lt=_addPxTranslate(wt,lt,Tt*$t*-vt+vt)}bt!==_zeroPx&&(xt+="perspective("+bt+_endParenthesis),(rt||ot)&&(xt+="translate("+rt+"%, "+ot+"%) "),(St||at!==_zeroPx||st!==_zeroPx||lt!==_zeroPx)&&(xt+=lt!==_zeroPx||St?"translate3d("+at+", "+st+", "+lt+") ":"translate("+at+", "+st+_endParenthesis),ct!==_zeroDeg&&(xt+="rotate("+ct+_endParenthesis),ut!==_zeroDeg&&(xt+="rotateY("+ut+_endParenthesis),ht!==_zeroDeg&&(xt+="rotateX("+ht+_endParenthesis),(dt!==_zeroDeg||pt!==_zeroDeg)&&(xt+="skew("+dt+", "+pt+_endParenthesis),(mt!==1||gt!==1)&&(xt+="scale("+mt+", "+gt+_endParenthesis),wt.style[_transformProp]=xt||"translate(0, 0)"},_renderSVGTransforms=function tt(et,nt){var it=nt||this,rt=it.xPercent,ot=it.yPercent,at=it.x,st=it.y,lt=it.rotation,ct=it.skewX,ut=it.skewY,ht=it.scaleX,dt=it.scaleY,pt=it.target,mt=it.xOrigin,gt=it.yOrigin,bt=it.xOffset,yt=it.yOffset,wt=it.forceCSS,vt=parseFloat(at),xt=parseFloat(st),St,Et,It,Tt,$t;lt=parseFloat(lt),ct=parseFloat(ct),ut=parseFloat(ut),ut&&(ut=parseFloat(ut),ct+=ut,lt+=ut),lt||ct?(lt*=_DEG2RAD,ct*=_DEG2RAD,St=Math.cos(lt)*ht,Et=Math.sin(lt)*ht,It=Math.sin(lt-ct)*-dt,Tt=Math.cos(lt-ct)*dt,ct&&(ut*=_DEG2RAD,$t=Math.tan(ct-ut),$t=Math.sqrt(1+$t*$t),It*=$t,Tt*=$t,ut&&($t=Math.tan(ut),$t=Math.sqrt(1+$t*$t),St*=$t,Et*=$t)),St=_round(St),Et=_round(Et),It=_round(It),Tt=_round(Tt)):(St=ht,Tt=dt,Et=It=0),(vt&&!~(at+"").indexOf("px")||xt&&!~(st+"").indexOf("px"))&&(vt=_convertToUnit(pt,"x",at,"px"),xt=_convertToUnit(pt,"y",st,"px")),(mt||gt||bt||yt)&&(vt=_round(vt+mt-(mt*St+gt*It)+bt),xt=_round(xt+gt-(mt*Et+gt*Tt)+yt)),(rt||ot)&&($t=pt.getBBox(),vt=_round(vt+rt/100*$t.width),xt=_round(xt+ot/100*$t.height)),$t="matrix("+St+","+Et+","+It+","+Tt+","+vt+","+xt+")",pt.setAttribute("transform",$t),wt&&(pt.style[_transformProp]=$t)},_addRotationalPropTween=function tt(et,nt,it,rt,ot){var at=360,st=_isString(ot),lt=parseFloat(ot)*(st&&~ot.indexOf("rad")?_RAD2DEG:1),ct=lt-rt,ut=rt+ct+"deg",ht,dt;return st&&(ht=ot.split("_")[1],ht==="short"&&(ct%=at,ct!==ct%(at/2)&&(ct+=ct<0?at:-at)),ht==="cw"&&ct<0?ct=(ct+at*_bigNum)%at-~~(ct/at)*at:ht==="ccw"&&ct>0&&(ct=(ct-at*_bigNum)%at-~~(ct/at)*at)),et._pt=dt=new PropTween(et._pt,nt,it,rt,ct,_renderPropWithEnd),dt.e=ut,dt.u="deg",et._props.push(it),dt},_assign=function tt(et,nt){for(var it in nt)et[it]=nt[it];return et},_addRawTransformPTs=function tt(et,nt,it){var rt=_assign({},it._gsap),ot="perspective,force3D,transformOrigin,svgOrigin",at=it.style,st,lt,ct,ut,ht,dt,pt,mt;rt.svg?(ct=it.getAttribute("transform"),it.setAttribute("transform",""),at[_transformProp]=nt,st=_parseTransform(it,1),_removeProperty(it,_transformProp),it.setAttribute("transform",ct)):(ct=getComputedStyle(it)[_transformProp],at[_transformProp]=nt,st=_parseTransform(it,1),at[_transformProp]=ct);for(lt in _transformProps)ct=rt[lt],ut=st[lt],ct!==ut&&ot.indexOf(lt)<0&&(pt=getUnit(ct),mt=getUnit(ut),ht=pt!==mt?_convertToUnit(it,lt,ct,mt):parseFloat(ct),dt=parseFloat(ut),et._pt=new PropTween(et._pt,st,lt,ht,dt-ht,_renderCSSProp),et._pt.u=mt||0,et._props.push(lt));_assign(st,rt)};_forEachName("padding,margin,Width,Radius",function(tt,et){var nt="Top",it="Right",rt="Bottom",ot="Left",at=(et<3?[nt,it,rt,ot]:[nt+ot,nt+it,rt+it,rt+ot]).map(function(st){return et<2?tt+st:"border"+st+tt});_specialProps[et>1?"border"+tt:tt]=function(st,lt,ct,ut,ht){var dt,pt;if(arguments.length<4)return dt=at.map(function(mt){return _get(st,mt,ct)}),pt=dt.join(" "),pt.split(dt[0]).length===5?dt[0]:pt;dt=(ut+"").split(" "),pt={},at.forEach(function(mt,gt){return pt[mt]=dt[gt]=dt[gt]||dt[(gt-1)/2|0]}),st.init(lt,pt,ht)}});var CSSPlugin={name:"css",register:_initCore,targetTest:function tt(et){return et.style&&et.nodeType},init:function tt(et,nt,it,rt,ot){var at=this._props,st=et.style,lt=it.vars.startAt,ct,ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,It,Tt;_pluginInitted||_initCore(),this.styles=this.styles||_getStyleSaver(et),Tt=this.styles.props,this.tween=it;for(gt in nt)if(gt!=="autoRound"&&(ut=nt[gt],!(_plugins[gt]&&_checkPlugin(gt,nt,it,rt,et,ot)))){if(pt=typeof ut,mt=_specialProps[gt],pt==="function"&&(ut=ut.call(it,rt,et,ot),pt=typeof ut),pt==="string"&&~ut.indexOf("random(")&&(ut=_replaceRandom(ut)),mt)mt(this,et,gt,ut,it)&&(It=1);else if(gt.substr(0,2)==="--")ct=(getComputedStyle(et).getPropertyValue(gt)+"").trim(),ut+="",_colorExp.lastIndex=0,_colorExp.test(ct)||(bt=getUnit(ct),yt=getUnit(ut)),yt?bt!==yt&&(ct=_convertToUnit(et,gt,ct,yt)+yt):bt&&(ut+=bt),this.add(st,"setProperty",ct,ut,rt,ot,0,0,gt),at.push(gt),Tt.push(gt,0,st[gt]);else if(pt!=="undefined"){if(lt&> in lt?(ct=typeof lt[gt]=="function"?lt[gt].call(it,rt,et,ot):lt[gt],_isString(ct)&&~ct.indexOf("random(")&&(ct=_replaceRandom(ct)),getUnit(ct+"")||ct==="auto"||(ct+=_config.units[gt]||getUnit(_get(et,gt))||""),(ct+"").charAt(1)==="="&&(ct=_get(et,gt))):ct=_get(et,gt),dt=parseFloat(ct),wt=pt==="string"&&ut.charAt(1)==="="&&ut.substr(0,2),wt&&(ut=ut.substr(2)),ht=parseFloat(ut),gt in _propertyAliases&&(gt==="autoAlpha"&&(dt===1&&_get(et,"visibility")==="hidden"&&ht&&(dt=0),Tt.push("visibility",0,st.visibility),_addNonTweeningPT(this,st,"visibility",dt?"inherit":"hidden",ht?"inherit":"hidden",!ht)),gt!=="scale"&>!=="transform"&&(gt=_propertyAliases[gt],~gt.indexOf(",")&&(gt=gt.split(",")[0]))),vt=gt in _transformProps,vt){if(this.styles.save(gt),xt||(St=et._gsap,St.renderTransform&&!nt.parseTransform||_parseTransform(et,nt.parseTransform),Et=nt.smoothOrigin!==!1&&St.smooth,xt=this._pt=new PropTween(this._pt,st,_transformProp,0,1,St.renderTransform,St,0,-1),xt.dep=1),gt==="scale")this._pt=new PropTween(this._pt,St,"scaleY",St.scaleY,(wt?_parseRelative(St.scaleY,wt+ht):ht)-St.scaleY||0,_renderCSSProp),this._pt.u=0,at.push("scaleY",gt),gt+="X";else if(gt==="transformOrigin"){Tt.push(_transformOriginProp,0,st[_transformOriginProp]),ut=_convertKeywordsToPercentages(ut),St.svg?_applySVGOrigin(et,ut,0,Et,0,this):(yt=parseFloat(ut.split(" ")[2])||0,yt!==St.zOrigin&&_addNonTweeningPT(this,St,"zOrigin",St.zOrigin,yt),_addNonTweeningPT(this,st,gt,_firstTwoOnly(ct),_firstTwoOnly(ut)));continue}else if(gt==="svgOrigin"){_applySVGOrigin(et,ut,1,Et,0,this);continue}else if(gt in _rotationalProperties){_addRotationalPropTween(this,St,gt,dt,wt?_parseRelative(dt,wt+ut):ut);continue}else if(gt==="smoothOrigin"){_addNonTweeningPT(this,St,"smooth",St.smooth,ut);continue}else if(gt==="force3D"){St[gt]=ut;continue}else if(gt==="transform"){_addRawTransformPTs(this,ut,et);continue}}else gt in st||(gt=_checkPropPrefix(gt)||gt);if(vt||(ht||ht===0)&&(dt||dt===0)&&!_complexExp.test(ut)&> in st)bt=(ct+"").substr((dt+"").length),ht||(ht=0),yt=getUnit(ut)||(gt in _config.units?_config.units[gt]:bt),bt!==yt&&(dt=_convertToUnit(et,gt,ct,yt)),this._pt=new PropTween(this._pt,vt?St:st,gt,dt,(wt?_parseRelative(dt,wt+ht):ht)-dt,!vt&&(yt==="px"||gt==="zIndex")&&nt.autoRound!==!1?_renderRoundedCSSProp:_renderCSSProp),this._pt.u=yt||0,bt!==yt&&yt!=="%"&&(this._pt.b=ct,this._pt.r=_renderCSSPropWithBeginning);else if(gt in st)_tweenComplexCSSString.call(this,et,gt,ct,wt?wt+ut:ut);else if(gt in et)this.add(et,gt,ct||et[gt],wt?wt+ut:ut,rt,ot);else if(gt!=="parseTransform"){_missingPlugin(gt,ut);continue}vt||(gt in st?Tt.push(gt,0,st[gt]):Tt.push(gt,1,ct||et[gt])),at.push(gt)}}It&&_sortPropTweensByPriority(this)},render:function tt(et,nt){if(nt.tween._time||!_reverting())for(var it=nt._pt;it;)it.r(et,it.d),it=it._next;else nt.styles.revert()},get:_get,aliases:_propertyAliases,getSetter:function tt(et,nt,it){var rt=_propertyAliases[nt];return rt&&rt.indexOf(",")<0&&(nt=rt),nt in _transformProps&&nt!==_transformOriginProp&&(et._gsap.x||_get(et,"x"))?it&&_recentSetterPlugin===it?nt==="scale"?_setterScale:_setterTransform:(_recentSetterPlugin=it||{})&&(nt==="scale"?_setterScaleWithRender:_setterTransformWithRender):et.style&&!_isUndefined(et.style[nt])?_setterCSSStyle:~nt.indexOf("-")?_setterCSSProp:_getSetter(et,nt)},core:{_removeProperty,_getMatrix}};gsap.utils.checkPrefix=_checkPropPrefix;gsap.core.getStyleSaver=_getStyleSaver;(function(tt,et,nt,it){var rt=_forEachName(tt+","+et+","+nt,function(ot){_transformProps[ot]=1});_forEachName(et,function(ot){_config.units[ot]="deg",_rotationalProperties[ot]=1}),_propertyAliases[rt[13]]=tt+","+et,_forEachName(it,function(ot){var at=ot.split(":");_propertyAliases[at[1]]=rt[at[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");_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(tt){_config.units[tt]="px"});gsap.registerPlugin(CSSPlugin);var gsapWithCSS=gsap.registerPlugin(CSSPlugin)||gsap;gsapWithCSS.core.Tween;const createRoundedBoxGeometry=(tt,et,nt,it,rt)=>{const ot=new Shape$1,at=1e-5;ot.absarc(at,at,at,-Math.PI/2,-Math.PI,!0),ot.absarc(at,et-it*2,at,Math.PI,Math.PI/2,!0),ot.absarc(tt-it*2,et-it*2,at,Math.PI/2,0,!0),ot.absarc(tt-it*2,at,at,0,-Math.PI/2,!0);const st=new ExtrudeGeometry(ot,{depth:nt-it*2,bevelEnabled:!0,bevelSegments:rt,steps:2,bevelSize:it,bevelThickness:it,curveSegments:rt});st.center();const lt=[],ct=st.getAttribute("normal"),ut=st.getAttribute("position");for(let ht=0;ht.9?(mt=pt.x/tt+.5,gt=1-(pt.z/nt+.5)):Math.abs(dt.x)>.9?(mt=-pt.z/nt+.5,gt=1-(-pt.y/et+.5)):Math.abs(dt.z)>.9&&(mt=pt.x/tt+.5,gt=1-(-pt.y/et+.5)),lt.push(mt,gt)}return st.setAttribute("uv",new Float32BufferAttribute(lt,2)),st};createRoundedBoxGeometry(10,10,10,2,10);const boxGeometry=new BoxGeometry(10,10,10),isMainTopic=tt=>tt.node_type==="topic"&&(tt.scale||1)>5,meshRenderLimit=500,meshRenderRadius=800;let nearbyNodeTimeout=null;const nearbyNodeTimeoutCycle=500,getNearbyNodeIds=(tt,et)=>{if(nearbyNodeTimeout)return null;nearbyNodeTimeout=setTimeout(()=>{nearbyNodeTimeout&&(clearTimeout(nearbyNodeTimeout),nearbyNodeTimeout=null)},nearbyNodeTimeoutCycle);const nt=[];return tt.forEach(rt=>{const ot=et.position.distanceTo(variableVector3$1.set(rt.x,rt.y,rt.z));otrt.distance-ot.distance).slice(0,meshRenderLimit).map(rt=>rt.id)},initialCameraPosition=new Vector3(5e3,600,1600),arriveDistance=100,topicArriveDistance=600,selectionGraphDistance=2e3,selectionGraphCameraPosition={x:172.7392402058252,y:-239.04675366094037,z:-2e3},version$1="14.8.49",createExtendedExponentialRampToValueAutomationEvent=(tt,et,nt)=>({endTime:et,insertTime:nt,type:"exponentialRampToValue",value:tt}),createExtendedLinearRampToValueAutomationEvent=(tt,et,nt)=>({endTime:et,insertTime:nt,type:"linearRampToValue",value:tt}),createSetValueAutomationEvent=(tt,et)=>({startTime:et,type:"setValue",value:tt}),createSetValueCurveAutomationEvent=(tt,et,nt)=>({duration:nt,startTime:et,type:"setValueCurve",values:tt}),getTargetValueAtTime=(tt,et,{startTime:nt,target:it,timeConstant:rt})=>it+(et-it)*Math.exp((nt-tt)/rt),isExponentialRampToValueAutomationEvent=tt=>tt.type==="exponentialRampToValue",isLinearRampToValueAutomationEvent=tt=>tt.type==="linearRampToValue",isAnyRampToValueAutomationEvent=tt=>isExponentialRampToValueAutomationEvent(tt)||isLinearRampToValueAutomationEvent(tt),isSetValueAutomationEvent=tt=>tt.type==="setValue",isSetValueCurveAutomationEvent=tt=>tt.type==="setValueCurve",getValueOfAutomationEventAtIndexAtTime=(tt,et,nt,it)=>{const rt=tt[et];return rt===void 0?it:isAnyRampToValueAutomationEvent(rt)||isSetValueAutomationEvent(rt)?rt.value:isSetValueCurveAutomationEvent(rt)?rt.values[rt.values.length-1]:getTargetValueAtTime(nt,getValueOfAutomationEventAtIndexAtTime(tt,et-1,rt.startTime,it),rt)},getEndTimeAndValueOfPreviousAutomationEvent=(tt,et,nt,it,rt)=>nt===void 0?[it.insertTime,rt]:isAnyRampToValueAutomationEvent(nt)?[nt.endTime,nt.value]:isSetValueAutomationEvent(nt)?[nt.startTime,nt.value]:isSetValueCurveAutomationEvent(nt)?[nt.startTime+nt.duration,nt.values[nt.values.length-1]]:[nt.startTime,getValueOfAutomationEventAtIndexAtTime(tt,et-1,nt.startTime,rt)],isCancelAndHoldAutomationEvent=tt=>tt.type==="cancelAndHold",isCancelScheduledValuesAutomationEvent=tt=>tt.type==="cancelScheduledValues",getEventTime=tt=>isCancelAndHoldAutomationEvent(tt)||isCancelScheduledValuesAutomationEvent(tt)?tt.cancelTime:isExponentialRampToValueAutomationEvent(tt)||isLinearRampToValueAutomationEvent(tt)?tt.endTime:tt.startTime,getExponentialRampValueAtTime=(tt,et,nt,{endTime:it,value:rt})=>nt===rt?rt:0nt+(tt-et)/(it-et)*(rt-nt),interpolateValue=(tt,et)=>{const nt=Math.floor(et),it=Math.ceil(et);return nt===it?tt[nt]:(1-(et-nt))*tt[nt]+(1-(it-et))*tt[it]},getValueCurveValueAtTime=(tt,{duration:et,startTime:nt,values:it})=>{const rt=(tt-nt)/et*(it.length-1);return interpolateValue(it,rt)},isSetTargetAutomationEvent=tt=>tt.type==="setTarget";class AutomationEventList{constructor(et){this._automationEvents=[],this._currenTime=0,this._defaultValue=et}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(et){const nt=getEventTime(et);if(isCancelAndHoldAutomationEvent(et)||isCancelScheduledValuesAutomationEvent(et)){const it=this._automationEvents.findIndex(ot=>isCancelScheduledValuesAutomationEvent(et)&&isSetValueCurveAutomationEvent(ot)?ot.startTime+ot.duration>=nt:getEventTime(ot)>=nt),rt=this._automationEvents[it];if(it!==-1&&(this._automationEvents=this._automationEvents.slice(0,it)),isCancelAndHoldAutomationEvent(et)){const ot=this._automationEvents[this._automationEvents.length-1];if(rt!==void 0&&isAnyRampToValueAutomationEvent(rt)){if(ot!==void 0&&isSetTargetAutomationEvent(ot))throw new Error("The internal list is malformed.");const at=ot===void 0?rt.insertTime:isSetValueCurveAutomationEvent(ot)?ot.startTime+ot.duration:getEventTime(ot),st=ot===void 0?this._defaultValue:isSetValueCurveAutomationEvent(ot)?ot.values[ot.values.length-1]:ot.value,lt=isExponentialRampToValueAutomationEvent(rt)?getExponentialRampValueAtTime(nt,at,st,rt):getLinearRampValueAtTime(nt,at,st,rt),ct=isExponentialRampToValueAutomationEvent(rt)?createExtendedExponentialRampToValueAutomationEvent(lt,nt,this._currenTime):createExtendedLinearRampToValueAutomationEvent(lt,nt,this._currenTime);this._automationEvents.push(ct)}if(ot!==void 0&&isSetTargetAutomationEvent(ot)&&this._automationEvents.push(createSetValueAutomationEvent(this.getValue(nt),nt)),ot!==void 0&&isSetValueCurveAutomationEvent(ot)&&ot.startTime+ot.duration>nt){const at=nt-ot.startTime,st=(ot.values.length-1)/ot.duration,lt=Math.max(2,1+Math.ceil(at*st)),ct=at/(lt-1)*st,ut=ot.values.slice(0,lt);if(ct<1)for(let ht=1;htgetEventTime(at)>nt),rt=it===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[it-1];if(rt!==void 0&&isSetValueCurveAutomationEvent(rt)&&getEventTime(rt)+rt.duration>nt)return!1;const ot=isExponentialRampToValueAutomationEvent(et)?createExtendedExponentialRampToValueAutomationEvent(et.value,et.endTime,this._currenTime):isLinearRampToValueAutomationEvent(et)?createExtendedLinearRampToValueAutomationEvent(et.value,nt,this._currenTime):et;if(it===-1)this._automationEvents.push(ot);else{if(isSetValueCurveAutomationEvent(et)&&nt+et.duration>getEventTime(this._automationEvents[it]))return!1;this._automationEvents.splice(it,0,ot)}}return!0}flush(et){const nt=this._automationEvents.findIndex(it=>getEventTime(it)>et);if(nt>1){const it=this._automationEvents.slice(nt-1),rt=it[0];isSetTargetAutomationEvent(rt)&&it.unshift(createSetValueAutomationEvent(getValueOfAutomationEventAtIndexAtTime(this._automationEvents,nt-2,rt.startTime,this._defaultValue),rt.startTime)),this._automationEvents=it}}getValue(et){if(this._automationEvents.length===0)return this._defaultValue;const nt=this._automationEvents.findIndex(at=>getEventTime(at)>et),it=this._automationEvents[nt],rt=(nt===-1?this._automationEvents.length:nt)-1,ot=this._automationEvents[rt];if(ot!==void 0&&isSetTargetAutomationEvent(ot)&&(it===void 0||!isAnyRampToValueAutomationEvent(it)||it.insertTime>et))return getTargetValueAtTime(et,getValueOfAutomationEventAtIndexAtTime(this._automationEvents,rt-1,ot.startTime,this._defaultValue),ot);if(ot!==void 0&&isSetValueAutomationEvent(ot)&&(it===void 0||!isAnyRampToValueAutomationEvent(it)))return ot.value;if(ot!==void 0&&isSetValueCurveAutomationEvent(ot)&&(it===void 0||!isAnyRampToValueAutomationEvent(it)||ot.startTime+ot.duration>et))return et({cancelTime:tt,type:"cancelAndHold"}),createCancelScheduledValuesAutomationEvent=tt=>({cancelTime:tt,type:"cancelScheduledValues"}),createExponentialRampToValueAutomationEvent=(tt,et)=>({endTime:et,type:"exponentialRampToValue",value:tt}),createLinearRampToValueAutomationEvent=(tt,et)=>({endTime:et,type:"linearRampToValue",value:tt}),createSetTargetAutomationEvent=(tt,et,nt)=>({startTime:et,target:tt,timeConstant:nt,type:"setTarget"}),createAbortError=()=>new DOMException("","AbortError"),createAddActiveInputConnectionToAudioNode=tt=>(et,nt,[it,rt,ot],at)=>{tt(et[rt],[nt,it,ot],st=>st[0]===nt&&st[1]===it,at)},createAddAudioNodeConnections=tt=>(et,nt,it)=>{const rt=[];for(let ot=0;ot(et,nt)=>{tt.set(et,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:nt})},ACTIVE_AUDIO_NODE_STORE=new WeakSet,AUDIO_NODE_CONNECTIONS_STORE=new WeakMap,AUDIO_NODE_STORE=new WeakMap,AUDIO_PARAM_CONNECTIONS_STORE=new WeakMap,AUDIO_PARAM_STORE=new WeakMap,CONTEXT_STORE=new WeakMap,EVENT_LISTENERS=new WeakMap,CYCLE_COUNTERS=new WeakMap,NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS=new WeakMap,NODE_TO_PROCESSOR_MAPS=new WeakMap,handler={construct(){return handler}},isConstructible=tt=>{try{const et=new Proxy(tt,handler);new et}catch{return!1}return!0},IMPORT_STATEMENT_REGEX=/^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]*);?/,splitImportStatements=(tt,et)=>{const nt=[];let it=tt.replace(/^[\s]+/,""),rt=it.match(IMPORT_STATEMENT_REGEX);for(;rt!==null;){const ot=rt[1].slice(1,-1),at=rt[0].replace(/([\s]+)?;?$/,"").replace(ot,new URL(ot,et).toString());nt.push(at),it=it.slice(rt[0].length).replace(/^[\s]+/,""),rt=it.match(IMPORT_STATEMENT_REGEX)}return[nt.join(";"),it]},verifyParameterDescriptors=tt=>{if(tt!==void 0&&!Array.isArray(tt))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},verifyProcessorCtor=tt=>{if(!isConstructible(tt))throw new TypeError("The given value for processorCtor should be a constructor.");if(tt.prototype===null||typeof tt.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},createAddAudioWorkletModule=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt)=>{let pt=0;return(mt,gt,bt={credentials:"omit"})=>{const yt=ut.get(mt);if(yt!==void 0&&yt.has(gt))return Promise.resolve();const wt=ct.get(mt);if(wt!==void 0){const St=wt.get(gt);if(St!==void 0)return St}const vt=ot(mt),xt=vt.audioWorklet===void 0?rt(gt).then(([St,Et])=>{const[It,Tt]=splitImportStatements(St,Et),$t=`${It};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${Tt} -})})(window,'_AWGS')`;return nt($t)}).then(()=>{const St=dt._AWGS.pop();if(St===void 0)throw new SyntaxError;it(vt.currentTime,vt.sampleRate,()=>St(class{},void 0,(Et,It)=>{if(Et.trim()==="")throw et();const Tt=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(vt);if(Tt!==void 0){if(Tt.has(Et))throw et();verifyProcessorCtor(It),verifyParameterDescriptors(It.parameterDescriptors),Tt.set(Et,It)}else verifyProcessorCtor(It),verifyParameterDescriptors(It.parameterDescriptors),NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.set(vt,new Map([[Et,It]]))},vt.sampleRate,void 0,void 0))}):Promise.all([rt(gt),Promise.resolve(tt(ht,ht))]).then(([[St,Et],It])=>{const Tt=pt+1;pt=Tt;const[$t,Ut]=splitImportStatements(St,Et),kt=`${$t};((AudioWorkletProcessor,registerProcessor)=>{${Ut} -})(${It?"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{${It?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${It?"":"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${Tt}',class extends AudioWorkletProcessor{process(){return !1}})`,At=new Blob([kt],{type:"application/javascript; charset=utf-8"}),Rt=URL.createObjectURL(At);return vt.audioWorklet.addModule(Rt,bt).then(()=>{if(st(vt))return vt;const Wt=at(vt);return Wt.audioWorklet.addModule(Rt,bt).then(()=>Wt)}).then(Wt=>{if(lt===null)throw new SyntaxError;try{new lt(Wt,`__sac${Tt}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(Rt))});return wt===void 0?ct.set(mt,new Map([[gt,xt]])):wt.set(gt,xt),xt.then(()=>{const St=ut.get(mt);St===void 0?ut.set(mt,new Set([gt])):St.add(gt)}).finally(()=>{const St=ct.get(mt);St!==void 0&&St.delete(gt)}),xt}},getValueForKey=(tt,et)=>{const nt=tt.get(et);if(nt===void 0)throw new Error("A value with the given key could not be found.");return nt},pickElementFromSet=(tt,et)=>{const nt=Array.from(tt).filter(et);if(nt.length>1)throw Error("More than one element was found.");if(nt.length===0)throw Error("No element was found.");const[it]=nt;return tt.delete(it),it},deletePassiveInputConnectionToAudioNode=(tt,et,nt,it)=>{const rt=getValueForKey(tt,et),ot=pickElementFromSet(rt,at=>at[0]===nt&&at[1]===it);return rt.size===0&&tt.delete(et),ot},getEventListenersOfAudioNode=tt=>getValueForKey(EVENT_LISTENERS,tt),setInternalStateToActive=tt=>{if(ACTIVE_AUDIO_NODE_STORE.has(tt))throw new Error("The AudioNode is already stored.");ACTIVE_AUDIO_NODE_STORE.add(tt),getEventListenersOfAudioNode(tt).forEach(et=>et(!0))},isAudioWorkletNode=tt=>"port"in tt,setInternalStateToPassive=tt=>{if(!ACTIVE_AUDIO_NODE_STORE.has(tt))throw new Error("The AudioNode is not stored.");ACTIVE_AUDIO_NODE_STORE.delete(tt),getEventListenersOfAudioNode(tt).forEach(et=>et(!1))},setInternalStateToPassiveWhenNecessary=(tt,et)=>{!isAudioWorkletNode(tt)&&et.every(nt=>nt.size===0)&&setInternalStateToPassive(tt)},createAddConnectionToAudioNode=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt)=>{const pt=new WeakMap;return(mt,gt,bt,yt,wt)=>{const{activeInputs:vt,passiveInputs:xt}=ot(gt),{outputs:St}=ot(mt),Et=st(mt),It=Tt=>{const $t=lt(gt),Ut=lt(mt);if(Tt){const Lt=deletePassiveInputConnectionToAudioNode(xt,mt,bt,yt);tt(vt,mt,Lt,!1),!wt&&!ht(mt)&&nt(Ut,$t,bt,yt),dt(gt)&&setInternalStateToActive(gt)}else{const Lt=it(vt,mt,bt,yt);et(xt,yt,Lt,!1),!wt&&!ht(mt)&&rt(Ut,$t,bt,yt);const Bt=at(gt);if(Bt===0)ut(gt)&&setInternalStateToPassiveWhenNecessary(gt,vt);else{const Pt=pt.get(gt);Pt!==void 0&&clearTimeout(Pt),pt.set(gt,setTimeout(()=>{ut(gt)&&setInternalStateToPassiveWhenNecessary(gt,vt)},Bt*1e3))}}};return ct(St,[gt,bt,yt],Tt=>Tt[0]===gt&&Tt[1]===bt&&Tt[2]===yt,!0)?(Et.add(It),ut(mt)?tt(vt,mt,[bt,yt,It],!0):et(xt,yt,[mt,bt,It],!0),!0):!1}},createAddPassiveInputConnectionToAudioNode=tt=>(et,nt,[it,rt,ot],at)=>{const st=et.get(it);st===void 0?et.set(it,new Set([[rt,nt,ot]])):tt(st,[rt,nt,ot],lt=>lt[0]===rt&<[1]===nt,at)},createAddSilentConnection=tt=>(et,nt)=>{const it=tt(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});nt.connect(it).connect(et.destination);const rt=()=>{nt.removeEventListener("ended",rt),nt.disconnect(it),it.disconnect()};nt.addEventListener("ended",rt)},createAddUnrenderedAudioWorkletNode=tt=>(et,nt)=>{tt(et).add(nt)},DEFAULT_OPTIONS$j={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},createAnalyserNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut={...DEFAULT_OPTIONS$j,...lt},ht=it(ct,ut),dt=ot(ct)?et():null;super(st,!1,ht,dt),this._nativeAnalyserNode=ht}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(st){this._nativeAnalyserNode.fftSize=st}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(st){const lt=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=st,!(st>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=lt,nt()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(st){const lt=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=st,!(this._nativeAnalyserNode.maxDecibels>st))throw this._nativeAnalyserNode.minDecibels=lt,nt()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(st){this._nativeAnalyserNode.smoothingTimeConstant=st}getByteFrequencyData(st){this._nativeAnalyserNode.getByteFrequencyData(st)}getByteTimeDomainData(st){this._nativeAnalyserNode.getByteTimeDomainData(st)}getFloatFrequencyData(st){this._nativeAnalyserNode.getFloatFrequencyData(st)}getFloatTimeDomainData(st){this._nativeAnalyserNode.getFloatTimeDomainData(st)}},isOwnedByContext=(tt,et)=>tt.context===et,createAnalyserNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,fftSize:st.fftSize,maxDecibels:st.maxDecibels,minDecibels:st.minDecibels,smoothingTimeConstant:st.smoothingTimeConstant};st=tt(at,ct)}return it.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},testAudioBufferCopyChannelMethodsOutOfBoundsSupport=tt=>{try{tt.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},createIndexSizeError=()=>new DOMException("","IndexSizeError"),wrapAudioBufferGetChannelDataMethod=tt=>{tt.getChannelData=(et=>nt=>{try{return et.call(tt,nt)}catch(it){throw it.code===12?createIndexSizeError():it}})(tt.getChannelData)},DEFAULT_OPTIONS$i={numberOfChannels:1},createAudioBufferConstructor=(tt,et,nt,it,rt,ot,at,st)=>{let lt=null;return class xw{constructor(ut){if(rt===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:ht,numberOfChannels:dt,sampleRate:pt}={...DEFAULT_OPTIONS$i,...ut};lt===null&&(lt=new rt(1,1,44100));const mt=it!==null&&et(ot,ot)?new it({length:ht,numberOfChannels:dt,sampleRate:pt}):lt.createBuffer(dt,ht,pt);if(mt.numberOfChannels===0)throw nt();return typeof mt.copyFromChannel!="function"?(at(mt),wrapAudioBufferGetChannelDataMethod(mt)):et(testAudioBufferCopyChannelMethodsOutOfBoundsSupport,()=>testAudioBufferCopyChannelMethodsOutOfBoundsSupport(mt))||st(mt),tt.add(mt),mt}static[Symbol.hasInstance](ut){return ut!==null&&typeof ut=="object"&&Object.getPrototypeOf(ut)===xw.prototype||tt.has(ut)}}},MOST_NEGATIVE_SINGLE_FLOAT=-34028234663852886e22,MOST_POSITIVE_SINGLE_FLOAT=-MOST_NEGATIVE_SINGLE_FLOAT,isActiveAudioNode=tt=>ACTIVE_AUDIO_NODE_STORE.has(tt),DEFAULT_OPTIONS$h={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},createAudioBufferSourceNodeConstructor=(tt,et,nt,it,rt,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$h,...ut},pt=rt(ht,dt),mt=at(ht),gt=mt?et():null;super(ct,!1,pt,gt),this._audioBufferSourceNodeRenderer=gt,this._isBufferNullified=!1,this._isBufferSet=dt.buffer!==null,this._nativeAudioBufferSourceNode=pt,this._onended=null,this._playbackRate=nt(this,mt,pt.playbackRate,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(ct){if(this._nativeAudioBufferSourceNode.buffer=ct,ct!==null){if(this._isBufferSet)throw it();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(ct){this._nativeAudioBufferSourceNode.loop=ct}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(ct){this._nativeAudioBufferSourceNode.loopEnd=ct}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(ct){this._nativeAudioBufferSourceNode.loopStart=ct}get onended(){return this._onended}set onended(ct){const ut=typeof ct=="function"?st(this,ct):null;this._nativeAudioBufferSourceNode.onended=ut;const ht=this._nativeAudioBufferSourceNode.onended;this._onended=ht!==null&&ht===ut?ct:ht}get playbackRate(){return this._playbackRate}start(ct=0,ut=0,ht){if(this._nativeAudioBufferSourceNode.start(ct,ut,ht),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=ht===void 0?[ct,ut]:[ct,ut,ht]),this.context.state!=="closed"){setInternalStateToActive(this);const dt=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",dt),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",dt)}}stop(ct=0){this._nativeAudioBufferSourceNode.stop(ct),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=ct)}},createAudioBufferSourceNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap;let at=null,st=null;const lt=async(ct,ut)=>{let ht=nt(ct);const dt=isOwnedByContext(ht,ut);if(!dt){const pt={buffer:ht.buffer,channelCount:ht.channelCount,channelCountMode:ht.channelCountMode,channelInterpretation:ht.channelInterpretation,loop:ht.loop,loopEnd:ht.loopEnd,loopStart:ht.loopStart,playbackRate:ht.playbackRate.value};ht=et(ut,pt),at!==null&&ht.start(...at),st!==null&&ht.stop(st)}return ot.set(ut,ht),dt?await tt(ut,ct.playbackRate,ht.playbackRate):await it(ut,ct.playbackRate,ht.playbackRate),await rt(ct,ut,ht),ht};return{set start(ct){at=ct},set stop(ct){st=ct},render(ct,ut){const ht=ot.get(ut);return ht!==void 0?Promise.resolve(ht):lt(ct,ut)}}},isAudioBufferSourceNode=tt=>"playbackRate"in tt,isBiquadFilterNode=tt=>"frequency"in tt&&"gain"in tt,isConstantSourceNode=tt=>"offset"in tt,isGainNode=tt=>!("frequency"in tt)&&"gain"in tt,isOscillatorNode=tt=>"detune"in tt&&"frequency"in tt,isStereoPannerNode=tt=>"pan"in tt,getAudioNodeConnections=tt=>getValueForKey(AUDIO_NODE_CONNECTIONS_STORE,tt),getAudioParamConnections=tt=>getValueForKey(AUDIO_PARAM_CONNECTIONS_STORE,tt),deactivateActiveAudioNodeInputConnections=(tt,et)=>{const{activeInputs:nt}=getAudioNodeConnections(tt);nt.forEach(rt=>rt.forEach(([ot])=>{et.includes(tt)||deactivateActiveAudioNodeInputConnections(ot,[...et,tt])}));const it=isAudioBufferSourceNode(tt)?[tt.playbackRate]:isAudioWorkletNode(tt)?Array.from(tt.parameters.values()):isBiquadFilterNode(tt)?[tt.Q,tt.detune,tt.frequency,tt.gain]:isConstantSourceNode(tt)?[tt.offset]:isGainNode(tt)?[tt.gain]:isOscillatorNode(tt)?[tt.detune,tt.frequency]:isStereoPannerNode(tt)?[tt.pan]:[];for(const rt of it){const ot=getAudioParamConnections(rt);ot!==void 0&&ot.activeInputs.forEach(([at])=>deactivateActiveAudioNodeInputConnections(at,et))}isActiveAudioNode(tt)&&setInternalStateToPassive(tt)},deactivateAudioGraph=tt=>{deactivateActiveAudioNodeInputConnections(tt.destination,[])},isValidLatencyHint=tt=>tt===void 0||typeof tt=="number"||typeof tt=="string"&&(tt==="balanced"||tt==="interactive"||tt==="playback"),createAudioContextConstructor=(tt,et,nt,it,rt,ot,at,st,lt)=>class extends tt{constructor(ut={}){if(lt===null)throw new Error("Missing the native AudioContext constructor.");let ht;try{ht=new lt(ut)}catch(mt){throw mt.code===12&&mt.message==="sampleRate is not in range"?nt():mt}if(ht===null)throw it();if(!isValidLatencyHint(ut.latencyHint))throw new TypeError(`The provided value '${ut.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(ut.sampleRate!==void 0&&ht.sampleRate!==ut.sampleRate)throw nt();super(ht,2);const{latencyHint:dt}=ut,{sampleRate:pt}=ht;if(this._baseLatency=typeof ht.baseLatency=="number"?ht.baseLatency:dt==="balanced"?512/pt:dt==="interactive"||dt===void 0?256/pt:dt==="playback"?1024/pt:Math.max(2,Math.min(128,Math.round(dt*pt/128)))*128/pt,this._nativeAudioContext=ht,lt.name==="webkitAudioContext"?(this._nativeGainNode=ht.createGain(),this._nativeOscillatorNode=ht.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(ht.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,ht.state==="running"){this._state="suspended";const mt=()=>{this._state==="suspended"&&(this._state=null),ht.removeEventListener("statechange",mt)};ht.addEventListener("statechange",mt)}}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 et()}):(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()),deactivateAudioGraph(this)}))}createMediaElementSource(ut){return new rt(this,{mediaElement:ut})}createMediaStreamDestination(){return new ot(this)}createMediaStreamSource(ut){return new at(this,{mediaStream:ut})}createMediaStreamTrackSource(ut){return new st(this,{mediaStreamTrack:ut})}resume(){return this._state==="suspended"?new Promise((ut,ht)=>{const dt=()=>{this._nativeAudioContext.removeEventListener("statechange",dt),this._nativeAudioContext.state==="running"?ut():this.resume().then(ut,ht)};this._nativeAudioContext.addEventListener("statechange",dt)}):this._nativeAudioContext.resume().catch(ut=>{throw ut===void 0||ut.code===15?et():ut})}suspend(){return this._nativeAudioContext.suspend().catch(ut=>{throw ut===void 0?et():ut})}},createAudioDestinationNodeConstructor=(tt,et,nt,it,rt,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt=at(ht),pt=rt(ht,ut,dt),mt=dt?et(st):null;super(ct,!1,pt,mt),this._isNodeOfNativeOfflineAudioContext=dt,this._nativeAudioDestinationNode=pt}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(ct){if(this._isNodeOfNativeOfflineAudioContext)throw it();if(ct>this._nativeAudioDestinationNode.maxChannelCount)throw nt();this._nativeAudioDestinationNode.channelCount=ct}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(ct){if(this._isNodeOfNativeOfflineAudioContext)throw it();this._nativeAudioDestinationNode.channelCountMode=ct}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},createAudioDestinationNodeRenderer=tt=>{const et=new WeakMap,nt=async(it,rt)=>{const ot=rt.destination;return et.set(rt,ot),await tt(it,rt,ot),ot};return{render(it,rt){const ot=et.get(rt);return ot!==void 0?Promise.resolve(ot):nt(it,rt)}}},createAudioListenerFactory=(tt,et,nt,it,rt,ot,at,st)=>(lt,ct)=>{const ut=ct.listener,ht=()=>{const St=new Float32Array(1),Et=et(ct,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),It=at(ct);let Tt=!1,$t=[0,0,-1,0,1,0],Ut=[0,0,0];const Lt=()=>{if(Tt)return;Tt=!0;const At=it(ct,256,9,0);At.onaudioprocess=({inputBuffer:Rt})=>{const Wt=[ot(Rt,St,0),ot(Rt,St,1),ot(Rt,St,2),ot(Rt,St,3),ot(Rt,St,4),ot(Rt,St,5)];Wt.some((Ot,Ct)=>Ot!==$t[Ct])&&(ut.setOrientation(...Wt),$t=Wt);const jt=[ot(Rt,St,6),ot(Rt,St,7),ot(Rt,St,8)];jt.some((Ot,Ct)=>Ot!==Ut[Ct])&&(ut.setPosition(...jt),Ut=jt)},Et.connect(At)},Bt=At=>Rt=>{Rt!==$t[At]&&($t[At]=Rt,ut.setOrientation(...$t))},Pt=At=>Rt=>{Rt!==Ut[At]&&(Ut[At]=Rt,ut.setPosition(...Ut))},kt=(At,Rt,Wt)=>{const jt=nt(ct,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Rt});jt.connect(Et,0,At),jt.start(),Object.defineProperty(jt.offset,"defaultValue",{get(){return Rt}});const Ot=tt({context:lt},It,jt.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT);return st(Ot,"value",Ct=>()=>Ct.call(Ot),Ct=>Dt=>{try{Ct.call(Ot,Dt)}catch(Mt){if(Mt.code!==9)throw Mt}Lt(),It&&Wt(Dt)}),Ot.cancelAndHoldAtTime=(Ct=>It?()=>{throw rt()}:(...Dt)=>{const Mt=Ct.apply(Ot,Dt);return Lt(),Mt})(Ot.cancelAndHoldAtTime),Ot.cancelScheduledValues=(Ct=>It?()=>{throw rt()}:(...Dt)=>{const Mt=Ct.apply(Ot,Dt);return Lt(),Mt})(Ot.cancelScheduledValues),Ot.exponentialRampToValueAtTime=(Ct=>It?()=>{throw rt()}:(...Dt)=>{const Mt=Ct.apply(Ot,Dt);return Lt(),Mt})(Ot.exponentialRampToValueAtTime),Ot.linearRampToValueAtTime=(Ct=>It?()=>{throw rt()}:(...Dt)=>{const Mt=Ct.apply(Ot,Dt);return Lt(),Mt})(Ot.linearRampToValueAtTime),Ot.setTargetAtTime=(Ct=>It?()=>{throw rt()}:(...Dt)=>{const Mt=Ct.apply(Ot,Dt);return Lt(),Mt})(Ot.setTargetAtTime),Ot.setValueAtTime=(Ct=>It?()=>{throw rt()}:(...Dt)=>{const Mt=Ct.apply(Ot,Dt);return Lt(),Mt})(Ot.setValueAtTime),Ot.setValueCurveAtTime=(Ct=>It?()=>{throw rt()}:(...Dt)=>{const Mt=Ct.apply(Ot,Dt);return Lt(),Mt})(Ot.setValueCurveAtTime),Ot};return{forwardX:kt(0,0,Bt(0)),forwardY:kt(1,0,Bt(1)),forwardZ:kt(2,-1,Bt(2)),positionX:kt(6,0,Pt(0)),positionY:kt(7,0,Pt(1)),positionZ:kt(8,0,Pt(2)),upX:kt(3,0,Bt(3)),upY:kt(4,1,Bt(4)),upZ:kt(5,0,Bt(5))}},{forwardX:dt,forwardY:pt,forwardZ:mt,positionX:gt,positionY:bt,positionZ:yt,upX:wt,upY:vt,upZ:xt}=ut.forwardX===void 0?ht():ut;return{get forwardX(){return dt},get forwardY(){return pt},get forwardZ(){return mt},get positionX(){return gt},get positionY(){return bt},get positionZ(){return yt},get upX(){return wt},get upY(){return vt},get upZ(){return xt}}},isAudioNode$1=tt=>"context"in tt,isAudioNodeOutputConnection=tt=>isAudioNode$1(tt[0]),insertElementInSet=(tt,et,nt,it)=>{for(const rt of tt)if(nt(rt)){if(it)return!1;throw Error("The set contains at least one similar element.")}return tt.add(et),!0},addActiveInputConnectionToAudioParam=(tt,et,[nt,it],rt)=>{insertElementInSet(tt,[et,nt,it],ot=>ot[0]===et&&ot[1]===nt,rt)},addPassiveInputConnectionToAudioParam=(tt,[et,nt,it],rt)=>{const ot=tt.get(et);ot===void 0?tt.set(et,new Set([[nt,it]])):insertElementInSet(ot,[nt,it],at=>at[0]===nt,rt)},isNativeAudioNodeFaker=tt=>"inputs"in tt,connectNativeAudioNodeToNativeAudioNode=(tt,et,nt,it)=>{if(isNativeAudioNodeFaker(et)){const rt=et.inputs[it];return tt.connect(rt,nt,0),[rt,nt,0]}return tt.connect(et,nt,it),[et,nt,it]},deleteActiveInputConnection=(tt,et,nt)=>{for(const it of tt)if(it[0]===et&&it[1]===nt)return tt.delete(it),it;return null},deleteActiveInputConnectionToAudioParam=(tt,et,nt)=>pickElementFromSet(tt,it=>it[0]===et&&it[1]===nt),deleteEventListenerOfAudioNode=(tt,et)=>{if(!getEventListenersOfAudioNode(tt).delete(et))throw new Error("Missing the expected event listener.")},deletePassiveInputConnectionToAudioParam=(tt,et,nt)=>{const it=getValueForKey(tt,et),rt=pickElementFromSet(it,ot=>ot[0]===nt);return it.size===0&&tt.delete(et),rt},disconnectNativeAudioNodeFromNativeAudioNode=(tt,et,nt,it)=>{isNativeAudioNodeFaker(et)?tt.disconnect(et.inputs[it],nt,0):tt.disconnect(et,nt,it)},getNativeAudioNode=tt=>getValueForKey(AUDIO_NODE_STORE,tt),getNativeAudioParam=tt=>getValueForKey(AUDIO_PARAM_STORE,tt),isPartOfACycle=tt=>CYCLE_COUNTERS.has(tt),isPassiveAudioNode=tt=>!ACTIVE_AUDIO_NODE_STORE.has(tt),testAudioNodeDisconnectMethodSupport=(tt,et)=>new Promise(nt=>{if(et!==null)nt(!0);else{const it=tt.createScriptProcessor(256,1,1),rt=tt.createGain(),ot=tt.createBuffer(1,2,44100),at=ot.getChannelData(0);at[0]=1,at[1]=1;const st=tt.createBufferSource();st.buffer=ot,st.loop=!0,st.connect(it).connect(tt.destination),st.connect(rt),st.disconnect(rt),it.onaudioprocess=lt=>{const ct=lt.inputBuffer.getChannelData(0);Array.prototype.some.call(ct,ut=>ut===1)?nt(!0):nt(!1),st.stop(),it.onaudioprocess=null,st.disconnect(it),it.disconnect(tt.destination)},st.start()}}),visitEachAudioNodeOnce=(tt,et)=>{const nt=new Map;for(const it of tt)for(const rt of it){const ot=nt.get(rt);nt.set(rt,ot===void 0?1:ot+1)}nt.forEach((it,rt)=>et(rt,it))},isNativeAudioNode$1=tt=>"context"in tt,wrapAudioNodeDisconnectMethod=tt=>{const et=new Map;tt.connect=(nt=>(it,rt=0,ot=0)=>{const at=isNativeAudioNode$1(it)?nt(it,rt,ot):nt(it,rt),st=et.get(it);return st===void 0?et.set(it,[{input:ot,output:rt}]):st.every(lt=>lt.input!==ot||lt.output!==rt)&&st.push({input:ot,output:rt}),at})(tt.connect.bind(tt)),tt.disconnect=(nt=>(it,rt,ot)=>{if(nt.apply(tt),it===void 0)et.clear();else if(typeof it=="number")for(const[at,st]of et){const lt=st.filter(ct=>ct.output!==it);lt.length===0?et.delete(at):et.set(at,lt)}else if(et.has(it))if(rt===void 0)et.delete(it);else{const at=et.get(it);if(at!==void 0){const st=at.filter(lt=>lt.output!==rt&&(lt.input!==ot||ot===void 0));st.length===0?et.delete(it):et.set(it,st)}}for(const[at,st]of et)st.forEach(lt=>{isNativeAudioNode$1(at)?tt.connect(at,lt.output,lt.input):tt.connect(at,lt.output)})})(tt.disconnect)},addConnectionToAudioParamOfAudioContext=(tt,et,nt,it)=>{const{activeInputs:rt,passiveInputs:ot}=getAudioParamConnections(et),{outputs:at}=getAudioNodeConnections(tt),st=getEventListenersOfAudioNode(tt),lt=ct=>{const ut=getNativeAudioNode(tt),ht=getNativeAudioParam(et);if(ct){const dt=deletePassiveInputConnectionToAudioParam(ot,tt,nt);addActiveInputConnectionToAudioParam(rt,tt,dt,!1),!it&&!isPartOfACycle(tt)&&ut.connect(ht,nt)}else{const dt=deleteActiveInputConnectionToAudioParam(rt,tt,nt);addPassiveInputConnectionToAudioParam(ot,dt,!1),!it&&!isPartOfACycle(tt)&&ut.disconnect(ht,nt)}};return insertElementInSet(at,[et,nt],ct=>ct[0]===et&&ct[1]===nt,!0)?(st.add(lt),isActiveAudioNode(tt)?addActiveInputConnectionToAudioParam(rt,tt,[nt,lt],!0):addPassiveInputConnectionToAudioParam(ot,[tt,nt,lt],!0),!0):!1},deleteInputConnectionOfAudioNode=(tt,et,nt,it)=>{const{activeInputs:rt,passiveInputs:ot}=getAudioNodeConnections(et),at=deleteActiveInputConnection(rt[it],tt,nt);return at===null?[deletePassiveInputConnectionToAudioNode(ot,tt,nt,it)[2],!1]:[at[2],!0]},deleteInputConnectionOfAudioParam=(tt,et,nt)=>{const{activeInputs:it,passiveInputs:rt}=getAudioParamConnections(et),ot=deleteActiveInputConnection(it,tt,nt);return ot===null?[deletePassiveInputConnectionToAudioParam(rt,tt,nt)[1],!1]:[ot[2],!0]},deleteInputsOfAudioNode=(tt,et,nt,it,rt)=>{const[ot,at]=deleteInputConnectionOfAudioNode(tt,nt,it,rt);if(ot!==null&&(deleteEventListenerOfAudioNode(tt,ot),at&&!et&&!isPartOfACycle(tt)&&disconnectNativeAudioNodeFromNativeAudioNode(getNativeAudioNode(tt),getNativeAudioNode(nt),it,rt)),isActiveAudioNode(nt)){const{activeInputs:st}=getAudioNodeConnections(nt);setInternalStateToPassiveWhenNecessary(nt,st)}},deleteInputsOfAudioParam=(tt,et,nt,it)=>{const[rt,ot]=deleteInputConnectionOfAudioParam(tt,nt,it);rt!==null&&(deleteEventListenerOfAudioNode(tt,rt),ot&&!et&&!isPartOfACycle(tt)&&getNativeAudioNode(tt).disconnect(getNativeAudioParam(nt),it))},deleteAnyConnection=(tt,et)=>{const nt=getAudioNodeConnections(tt),it=[];for(const rt of nt.outputs)isAudioNodeOutputConnection(rt)?deleteInputsOfAudioNode(tt,et,...rt):deleteInputsOfAudioParam(tt,et,...rt),it.push(rt[0]);return nt.outputs.clear(),it},deleteConnectionAtOutput=(tt,et,nt)=>{const it=getAudioNodeConnections(tt),rt=[];for(const ot of it.outputs)ot[1]===nt&&(isAudioNodeOutputConnection(ot)?deleteInputsOfAudioNode(tt,et,...ot):deleteInputsOfAudioParam(tt,et,...ot),rt.push(ot[0]),it.outputs.delete(ot));return rt},deleteConnectionToDestination=(tt,et,nt,it,rt)=>{const ot=getAudioNodeConnections(tt);return Array.from(ot.outputs).filter(at=>at[0]===nt&&(it===void 0||at[1]===it)&&(rt===void 0||at[2]===rt)).map(at=>(isAudioNodeOutputConnection(at)?deleteInputsOfAudioNode(tt,et,...at):deleteInputsOfAudioParam(tt,et,...at),ot.outputs.delete(at),at[0]))},createAudioNodeConstructor=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt)=>class extends ct{constructor(yt,wt,vt,xt){super(vt),this._context=yt,this._nativeAudioNode=vt;const St=ut(yt);ht(St)&&nt(testAudioNodeDisconnectMethodSupport,()=>testAudioNodeDisconnectMethodSupport(St,gt))!==!0&&wrapAudioNodeDisconnectMethod(vt),AUDIO_NODE_STORE.set(this,vt),EVENT_LISTENERS.set(this,new Set),yt.state!=="closed"&&wt&&setInternalStateToActive(this),tt(this,xt,vt)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(yt){this._nativeAudioNode.channelCount=yt}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(yt){this._nativeAudioNode.channelCountMode=yt}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(yt){this._nativeAudioNode.channelInterpretation=yt}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(yt,wt=0,vt=0){if(wt<0||wt>=this._nativeAudioNode.numberOfOutputs)throw rt();const xt=ut(this._context),St=mt(xt);if(dt(yt)||pt(yt))throw ot();if(isAudioNode$1(yt)){const Tt=getNativeAudioNode(yt);try{const Ut=connectNativeAudioNodeToNativeAudioNode(this._nativeAudioNode,Tt,wt,vt),Lt=isPassiveAudioNode(this);(St||Lt)&&this._nativeAudioNode.disconnect(...Ut),this.context.state!=="closed"&&!Lt&&isPassiveAudioNode(yt)&&setInternalStateToActive(yt)}catch(Ut){throw Ut.code===12?ot():Ut}if(et(this,yt,wt,vt,St)){const Ut=lt([this],yt);visitEachAudioNodeOnce(Ut,it(St))}return yt}const Et=getNativeAudioParam(yt);if(Et.name==="playbackRate"&&Et.maxValue===1024)throw at();try{this._nativeAudioNode.connect(Et,wt),(St||isPassiveAudioNode(this))&&this._nativeAudioNode.disconnect(Et,wt)}catch(Tt){throw Tt.code===12?ot():Tt}if(addConnectionToAudioParamOfAudioContext(this,yt,wt,St)){const Tt=lt([this],yt);visitEachAudioNodeOnce(Tt,it(St))}}disconnect(yt,wt,vt){let xt;const St=ut(this._context),Et=mt(St);if(yt===void 0)xt=deleteAnyConnection(this,Et);else if(typeof yt=="number"){if(yt<0||yt>=this.numberOfOutputs)throw rt();xt=deleteConnectionAtOutput(this,Et,yt)}else{if(wt!==void 0&&(wt<0||wt>=this.numberOfOutputs)||isAudioNode$1(yt)&&vt!==void 0&&(vt<0||vt>=yt.numberOfInputs))throw rt();if(xt=deleteConnectionToDestination(this,Et,yt,wt,vt),xt.length===0)throw ot()}for(const It of xt){const Tt=lt([this],It);visitEachAudioNodeOnce(Tt,st)}}},createAudioParamFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt)=>(pt,mt,gt,bt=null,yt=null)=>{const wt=gt.value,vt=new AutomationEventList(wt),xt=mt?it(vt):null,St={get defaultValue(){return wt},get maxValue(){return bt===null?gt.maxValue:bt},get minValue(){return yt===null?gt.minValue:yt},get value(){return gt.value},set value(Et){gt.value=Et,St.setValueAtTime(Et,pt.context.currentTime)},cancelAndHoldAtTime(Et){if(typeof gt.cancelAndHoldAtTime=="function")xt===null&&vt.flush(pt.context.currentTime),vt.add(rt(Et)),gt.cancelAndHoldAtTime(Et);else{const It=Array.from(vt).pop();xt===null&&vt.flush(pt.context.currentTime),vt.add(rt(Et));const Tt=Array.from(vt).pop();gt.cancelScheduledValues(Et),It!==Tt&&Tt!==void 0&&(Tt.type==="exponentialRampToValue"?gt.exponentialRampToValueAtTime(Tt.value,Tt.endTime):Tt.type==="linearRampToValue"?gt.linearRampToValueAtTime(Tt.value,Tt.endTime):Tt.type==="setValue"?gt.setValueAtTime(Tt.value,Tt.startTime):Tt.type==="setValueCurve"&>.setValueCurveAtTime(Tt.values,Tt.startTime,Tt.duration))}return St},cancelScheduledValues(Et){return xt===null&&vt.flush(pt.context.currentTime),vt.add(ot(Et)),gt.cancelScheduledValues(Et),St},exponentialRampToValueAtTime(Et,It){if(Et===0)throw new RangeError;if(!Number.isFinite(It)||It<0)throw new RangeError;const Tt=pt.context.currentTime;return xt===null&&vt.flush(Tt),Array.from(vt).length===0&&(vt.add(ct(wt,Tt)),gt.setValueAtTime(wt,Tt)),vt.add(at(Et,It)),gt.exponentialRampToValueAtTime(Et,It),St},linearRampToValueAtTime(Et,It){const Tt=pt.context.currentTime;return xt===null&&vt.flush(Tt),Array.from(vt).length===0&&(vt.add(ct(wt,Tt)),gt.setValueAtTime(wt,Tt)),vt.add(st(Et,It)),gt.linearRampToValueAtTime(Et,It),St},setTargetAtTime(Et,It,Tt){return xt===null&&vt.flush(pt.context.currentTime),vt.add(lt(Et,It,Tt)),gt.setTargetAtTime(Et,It,Tt),St},setValueAtTime(Et,It){return xt===null&&vt.flush(pt.context.currentTime),vt.add(ct(Et,It)),gt.setValueAtTime(Et,It),St},setValueCurveAtTime(Et,It,Tt){const $t=Et instanceof Float32Array?Et:new Float32Array(Et);if(ht!==null&&ht.name==="webkitAudioContext"){const Ut=It+Tt,Lt=pt.context.sampleRate,Bt=Math.ceil(It*Lt),Pt=Math.floor(Ut*Lt),kt=Pt-Bt,At=new Float32Array(kt);for(let Wt=0;Wt({replay(et){for(const nt of tt)if(nt.type==="exponentialRampToValue"){const{endTime:it,value:rt}=nt;et.exponentialRampToValueAtTime(rt,it)}else if(nt.type==="linearRampToValue"){const{endTime:it,value:rt}=nt;et.linearRampToValueAtTime(rt,it)}else if(nt.type==="setTarget"){const{startTime:it,target:rt,timeConstant:ot}=nt;et.setTargetAtTime(rt,it,ot)}else if(nt.type==="setValue"){const{startTime:it,value:rt}=nt;et.setValueAtTime(rt,it)}else if(nt.type==="setValueCurve"){const{duration:it,startTime:rt,values:ot}=nt;et.setValueCurveAtTime(ot,rt,it)}else throw new Error("Can't apply an unknown automation.")}});class ReadOnlyMap{constructor(et){this._map=new Map(et)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(et,nt=null){return this._map.forEach((it,rt)=>et.call(nt,it,rt,this))}get(et){return this._map.get(et)}has(et){return this._map.has(et)}keys(){return this._map.keys()}values(){return this._map.values()}}const DEFAULT_OPTIONS$g={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},createAudioWorkletNodeConstructor=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt)=>class extends et{constructor(gt,bt,yt){var wt;const vt=st(gt),xt=lt(vt),St=ut({...DEFAULT_OPTIONS$g,...yt});dt(St);const Et=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(vt),It=Et==null?void 0:Et.get(bt),Tt=xt||vt.state!=="closed"?vt:(wt=at(vt))!==null&&wt!==void 0?wt:vt,$t=rt(Tt,xt?null:gt.baseLatency,ct,bt,It,St),Ut=xt?it(bt,St,It):null;super(gt,!0,$t,Ut);const Lt=[];$t.parameters.forEach((Pt,kt)=>{const At=nt(this,xt,Pt);Lt.push([kt,At])}),this._nativeAudioWorkletNode=$t,this._onprocessorerror=null,this._parameters=new ReadOnlyMap(Lt),xt&&tt(vt,this);const{activeInputs:Bt}=ot(this);ht($t,Bt)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(gt){const bt=typeof gt=="function"?pt(this,gt):null;this._nativeAudioWorkletNode.onprocessorerror=bt;const yt=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=yt!==null&&yt===bt?gt:yt}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function copyFromChannel(tt,et,nt,it,rt){if(typeof tt.copyFromChannel=="function")et[nt].byteLength===0&&(et[nt]=new Float32Array(128)),tt.copyFromChannel(et[nt],it,rt);else{const ot=tt.getChannelData(it);if(et[nt].byteLength===0)et[nt]=ot.slice(rt,rt+128);else{const at=new Float32Array(ot.buffer,rt*Float32Array.BYTES_PER_ELEMENT,128);et[nt].set(at)}}}const copyToChannel=(tt,et,nt,it,rt)=>{typeof tt.copyToChannel=="function"?et[nt].byteLength!==0&&tt.copyToChannel(et[nt],it,rt):et[nt].byteLength!==0&&tt.getChannelData(it).set(et[nt],rt)},createNestedArrays=(tt,et)=>{const nt=[];for(let it=0;it{const nt=getValueForKey(NODE_TO_PROCESSOR_MAPS,tt),it=getNativeAudioNode(et);return getValueForKey(nt,it)},processBuffer=async(tt,et,nt,it,rt,ot,at)=>{const st=et===null?Math.ceil(tt.context.length/128)*128:et.length,lt=it.channelCount*it.numberOfInputs,ct=rt.reduce((bt,yt)=>bt+yt,0),ut=ct===0?null:nt.createBuffer(ct,st,nt.sampleRate);if(ot===void 0)throw new Error("Missing the processor constructor.");const ht=getAudioNodeConnections(tt),dt=await getAudioWorkletProcessor(nt,tt),pt=createNestedArrays(it.numberOfInputs,it.channelCount),mt=createNestedArrays(it.numberOfOutputs,rt),gt=Array.from(tt.parameters.keys()).reduce((bt,yt)=>({...bt,[yt]:new Float32Array(128)}),{});for(let bt=0;bt0&&et!==null)for(let yt=0;yt{copyFromChannel(et,gt,yt,lt+wt,bt)});for(let yt=0;ytht.activeInputs[xt].size===0?[]:vt),wt=at(bt/nt.sampleRate,nt.sampleRate,()=>dt.process(yt,mt,gt));if(ut!==null)for(let vt=0,xt=0;vt(bt,yt,wt)=>{const vt=new WeakMap;let xt=null;const St=async(Et,It)=>{let Tt=ut(Et),$t=null;const Ut=isOwnedByContext(Tt,It),Lt=Array.isArray(yt.outputChannelCount)?yt.outputChannelCount:Array.from(yt.outputChannelCount);if(ht===null){const Bt=Lt.reduce((Rt,Wt)=>Rt+Wt,0),Pt=rt(It,{channelCount:Math.max(1,Bt),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,Bt)}),kt=[];for(let Rt=0;Rt{const Dt=new dt(Ot,Math.ceil(Et.context.length/128)*128,It.sampleRate),Mt=[],Vt=[];for(let Xt=0;Xt{const an=ot(Dt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Xt.value});return await pt(Dt,Xt,an.offset),an})),rn=it(Dt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,Wt+jt)});for(let Xt=0;Xtmt(Et,Dt,Xt))),gt(Dt)})(),It,yt,Lt,wt,ct)}const Bt=await xt,Pt=nt(It,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[kt,At,Rt]=$t;Bt!==null&&(Pt.buffer=Bt,Pt.start(0)),Pt.connect(kt);for(let Wt=0,jt=0;Wtclass extends mt{constructor(St,Et){super(St,Et),this._nativeContext=St,this._audioWorklet=tt===void 0?void 0:{addModule:(It,Tt)=>tt(this,It,Tt)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new et(this)}createBiquadFilter(){return new rt(this)}createBuffer(St,Et,It){return new nt({length:Et,numberOfChannels:St,sampleRate:It})}createBufferSource(){return new it(this)}createChannelMerger(St=6){return new ot(this,{numberOfInputs:St})}createChannelSplitter(St=6){return new at(this,{numberOfOutputs:St})}createConstantSource(){return new st(this)}createConvolver(){return new lt(this)}createDelay(St=1){return new ut(this,{maxDelayTime:St})}createDynamicsCompressor(){return new ht(this)}createGain(){return new dt(this)}createIIRFilter(St,Et){return new pt(this,{feedback:Et,feedforward:St})}createOscillator(){return new gt(this)}createPanner(){return new bt(this)}createPeriodicWave(St,Et,It={disableNormalization:!1}){return new yt(this,{...It,imag:Et,real:St})}createStereoPanner(){return new wt(this)}createWaveShaper(){return new vt(this)}decodeAudioData(St,Et,It){return ct(this._nativeContext,St).then(Tt=>(typeof Et=="function"&&Et(Tt),Tt),Tt=>{throw typeof It=="function"&&It(Tt),Tt})}},DEFAULT_OPTIONS$f={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},createBiquadFilterNodeConstructor=(tt,et,nt,it,rt,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$f,...ut},pt=rt(ht,dt),mt=at(ht),gt=mt?nt():null;super(ct,!1,pt,gt),this._Q=et(this,mt,pt.Q,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._detune=et(this,mt,pt.detune,1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT),-1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT)),this._frequency=et(this,mt,pt.frequency,ct.sampleRate/2,0),this._gain=et(this,mt,pt.gain,40*Math.log10(MOST_POSITIVE_SINGLE_FLOAT),MOST_NEGATIVE_SINGLE_FLOAT),this._nativeBiquadFilterNode=pt,st(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(ct){this._nativeBiquadFilterNode.type=ct}getFrequencyResponse(ct,ut,ht){try{this._nativeBiquadFilterNode.getFrequencyResponse(ct,ut,ht)}catch(dt){throw dt.code===11?it():dt}if(ct.length!==ut.length||ut.length!==ht.length)throw it()}},createBiquadFilterNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={Q:ct.Q.value,channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,detune:ct.detune.value,frequency:ct.frequency.value,gain:ct.gain.value,type:ct.type};ct=et(lt,ht)}return ot.set(lt,ct),ut?(await tt(lt,st.Q,ct.Q),await tt(lt,st.detune,ct.detune),await tt(lt,st.frequency,ct.frequency),await tt(lt,st.gain,ct.gain)):(await it(lt,st.Q,ct.Q),await it(lt,st.detune,ct.detune),await it(lt,st.frequency,ct.frequency),await it(lt,st.gain,ct.gain)),await rt(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createCacheTestResult=(tt,et)=>(nt,it)=>{const rt=et.get(nt);if(rt!==void 0)return rt;const ot=tt.get(nt);if(ot!==void 0)return ot;try{const at=it();return at instanceof Promise?(tt.set(nt,at),at.catch(()=>!1).then(st=>(tt.delete(nt),et.set(nt,st),st))):(et.set(nt,at),at)}catch{return et.set(nt,!1),!1}},DEFAULT_OPTIONS$e={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},createChannelMergerNodeConstructor=(tt,et,nt,it,rt)=>class extends tt{constructor(at,st){const lt=it(at),ct={...DEFAULT_OPTIONS$e,...st},ut=nt(lt,ct),ht=rt(lt)?et():null;super(at,!1,ut,ht)}},createChannelMergerNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,numberOfInputs:st.numberOfInputs};st=tt(at,ct)}return it.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},DEFAULT_OPTIONS$d={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},createChannelSplitterNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut=ot({...DEFAULT_OPTIONS$d,...lt}),ht=nt(ct,ut),dt=rt(ct)?et():null;super(st,!1,ht,dt)}},createChannelSplitterNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,numberOfOutputs:st.numberOfOutputs};st=tt(at,ct)}return it.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},createConnectAudioParam=tt=>(et,nt,it)=>tt(nt,et,it),createConnectMultipleOutputs=tt=>(et,nt,it=0,rt=0)=>{const ot=et[it];if(ot===void 0)throw tt();return isNativeAudioNode$1(nt)?ot.connect(nt,0,rt):ot.connect(nt,0)},createConnectedNativeAudioBufferSourceNodeFactory=tt=>(et,nt)=>{const it=tt(et,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),rt=et.createBuffer(1,2,44100);return it.buffer=rt,it.loop=!0,it.connect(nt),it.start(),()=>{it.stop(),it.disconnect(nt)}},DEFAULT_OPTIONS$c={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},createConstantSourceNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS$c,...ct},dt=it(ut,ht),pt=ot(ut),mt=pt?nt():null;super(lt,!1,dt,mt),this._constantSourceNodeRenderer=mt,this._nativeConstantSourceNode=dt,this._offset=et(this,pt,dt.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(lt){const ct=typeof lt=="function"?at(this,lt):null;this._nativeConstantSourceNode.onended=ct;const ut=this._nativeConstantSourceNode.onended;this._onended=ut!==null&&ut===ct?lt:ut}start(lt=0){if(this._nativeConstantSourceNode.start(lt),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=lt),this.context.state!=="closed"){setInternalStateToActive(this);const ct=()=>{this._nativeConstantSourceNode.removeEventListener("ended",ct),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeConstantSourceNode.addEventListener("ended",ct)}}stop(lt=0){this._nativeConstantSourceNode.stop(lt),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=lt)}},createConstantSourceNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap;let at=null,st=null;const lt=async(ct,ut)=>{let ht=nt(ct);const dt=isOwnedByContext(ht,ut);if(!dt){const pt={channelCount:ht.channelCount,channelCountMode:ht.channelCountMode,channelInterpretation:ht.channelInterpretation,offset:ht.offset.value};ht=et(ut,pt),at!==null&&ht.start(at),st!==null&&ht.stop(st)}return ot.set(ut,ht),dt?await tt(ut,ct.offset,ht.offset):await it(ut,ct.offset,ht.offset),await rt(ct,ut,ht),ht};return{set start(ct){at=ct},set stop(ct){st=ct},render(ct,ut){const ht=ot.get(ut);return ht!==void 0?Promise.resolve(ht):lt(ct,ut)}}},createConvertNumberToUnsignedLong=tt=>et=>(tt[0]=et,tt[0]),DEFAULT_OPTIONS$b={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},createConvolverNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut={...DEFAULT_OPTIONS$b,...lt},ht=nt(ct,ut),pt=rt(ct)?et():null;super(st,!1,ht,pt),this._isBufferNullified=!1,this._nativeConvolverNode=ht,ut.buffer!==null&&ot(this,ut.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(st){if(this._nativeConvolverNode.buffer=st,st===null&&this._nativeConvolverNode.buffer!==null){const lt=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=lt.createBuffer(1,1,lt.sampleRate),this._isBufferNullified=!0,ot(this,0)}else this._isBufferNullified=!1,ot(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(st){this._nativeConvolverNode.normalize=st}},createConvolverNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={buffer:st.buffer,channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,disableNormalization:!st.normalize};st=tt(at,ct)}return it.set(at,st),isNativeAudioNodeFaker(st)?await nt(ot,at,st.inputs[0]):await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},createCreateNativeOfflineAudioContext=(tt,et)=>(nt,it,rt)=>{if(et===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new et(nt,it,rt)}catch(ot){throw ot.name==="SyntaxError"?tt():ot}},createDataCloneError=()=>new DOMException("","DataCloneError"),detachArrayBuffer=tt=>{const{port1:et,port2:nt}=new MessageChannel;return new Promise(it=>{const rt=()=>{nt.onmessage=null,et.close(),nt.close(),it()};nt.onmessage=()=>rt();try{et.postMessage(tt,[tt])}catch{}finally{rt()}})},createDecodeAudioData=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut)=>(ht,dt)=>{const pt=at(ht)?ht:ot(ht);if(rt.has(dt)){const mt=nt();return Promise.reject(mt)}try{rt.add(dt)}catch{}return et(lt,()=>lt(pt))?pt.decodeAudioData(dt).then(mt=>(detachArrayBuffer(dt).catch(()=>{}),et(st,()=>st(mt))||ut(mt),tt.add(mt),mt)):new Promise((mt,gt)=>{const bt=async()=>{try{await detachArrayBuffer(dt)}catch{}},yt=wt=>{gt(wt),bt()};try{pt.decodeAudioData(dt,wt=>{typeof wt.copyFromChannel!="function"&&(ct(wt),wrapAudioBufferGetChannelDataMethod(wt)),tt.add(wt),bt().then(()=>mt(wt))},wt=>{yt(wt===null?it():wt)})}catch(wt){yt(wt)}})},createDecrementCycleCounter=(tt,et,nt,it,rt,ot,at,st)=>(lt,ct)=>{const ut=et.get(lt);if(ut===void 0)throw new Error("Missing the expected cycle count.");const ht=ot(lt.context),dt=st(ht);if(ut===ct){if(et.delete(lt),!dt&&at(lt)){const pt=it(lt),{outputs:mt}=nt(lt);for(const gt of mt)if(isAudioNodeOutputConnection(gt)){const bt=it(gt[0]);tt(pt,bt,gt[1],gt[2])}else{const bt=rt(gt[0]);pt.connect(bt,gt[1])}}}else et.set(lt,ut-ct)},DEFAULT_OPTIONS$a={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},createDelayNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS$a,...ct},dt=it(ut,ht),pt=ot(ut),mt=pt?nt(ht.maxDelayTime):null;super(lt,!1,dt,mt),this._delayTime=et(this,pt,dt.delayTime),at(this,ht.maxDelayTime)}get delayTime(){return this._delayTime}},createDelayNodeRendererFactory=(tt,et,nt,it,rt)=>ot=>{const at=new WeakMap,st=async(lt,ct)=>{let ut=nt(lt);const ht=isOwnedByContext(ut,ct);if(!ht){const dt={channelCount:ut.channelCount,channelCountMode:ut.channelCountMode,channelInterpretation:ut.channelInterpretation,delayTime:ut.delayTime.value,maxDelayTime:ot};ut=et(ct,dt)}return at.set(ct,ut),ht?await tt(ct,lt.delayTime,ut.delayTime):await it(ct,lt.delayTime,ut.delayTime),await rt(lt,ct,ut),ut};return{render(lt,ct){const ut=at.get(ct);return ut!==void 0?Promise.resolve(ut):st(lt,ct)}}},createDeleteActiveInputConnectionToAudioNode=tt=>(et,nt,it,rt)=>tt(et[rt],ot=>ot[0]===nt&&ot[1]===it),createDeleteUnrenderedAudioWorkletNode=tt=>(et,nt)=>{tt(et).delete(nt)},isDelayNode=tt=>"delayTime"in tt,createDetectCycles=(tt,et,nt)=>function it(rt,ot){const at=isAudioNode$1(ot)?ot:nt(tt,ot);if(isDelayNode(at))return[];if(rt[0]===at)return[rt];if(rt.includes(at))return[];const{outputs:st}=et(at);return Array.from(st).map(lt=>it([...rt,at],lt[0])).reduce((lt,ct)=>lt.concat(ct),[])},getOutputAudioNodeAtIndex=(tt,et,nt)=>{const it=et[nt];if(it===void 0)throw tt();return it},createDisconnectMultipleOutputs=tt=>(et,nt=void 0,it=void 0,rt=0)=>nt===void 0?et.forEach(ot=>ot.disconnect()):typeof nt=="number"?getOutputAudioNodeAtIndex(tt,et,nt).disconnect():isNativeAudioNode$1(nt)?it===void 0?et.forEach(ot=>ot.disconnect(nt)):rt===void 0?getOutputAudioNodeAtIndex(tt,et,it).disconnect(nt,0):getOutputAudioNodeAtIndex(tt,et,it).disconnect(nt,0,rt):it===void 0?et.forEach(ot=>ot.disconnect(nt)):getOutputAudioNodeAtIndex(tt,et,it).disconnect(nt,0),DEFAULT_OPTIONS$9={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},createDynamicsCompressorNodeConstructor=(tt,et,nt,it,rt,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$9,...ut},pt=it(ht,dt),mt=at(ht),gt=mt?nt():null;super(ct,!1,pt,gt),this._attack=et(this,mt,pt.attack),this._knee=et(this,mt,pt.knee),this._nativeDynamicsCompressorNode=pt,this._ratio=et(this,mt,pt.ratio),this._release=et(this,mt,pt.release),this._threshold=et(this,mt,pt.threshold),st(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(ct){const ut=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=ct,ct>2)throw this._nativeDynamicsCompressorNode.channelCount=ut,rt()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(ct){const ut=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=ct,ct==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=ut,rt()}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}},createDynamicsCompressorNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={attack:ct.attack.value,channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,knee:ct.knee.value,ratio:ct.ratio.value,release:ct.release.value,threshold:ct.threshold.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?(await tt(lt,st.attack,ct.attack),await tt(lt,st.knee,ct.knee),await tt(lt,st.ratio,ct.ratio),await tt(lt,st.release,ct.release),await tt(lt,st.threshold,ct.threshold)):(await it(lt,st.attack,ct.attack),await it(lt,st.knee,ct.knee),await it(lt,st.ratio,ct.ratio),await it(lt,st.release,ct.release),await it(lt,st.threshold,ct.threshold)),await rt(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createEncodingError=()=>new DOMException("","EncodingError"),createEvaluateSource=tt=>et=>new Promise((nt,it)=>{if(tt===null){it(new SyntaxError);return}const rt=tt.document.head;if(rt===null)it(new SyntaxError);else{const ot=tt.document.createElement("script"),at=new Blob([et],{type:"application/javascript"}),st=URL.createObjectURL(at),lt=tt.onerror,ct=()=>{tt.onerror=lt,URL.revokeObjectURL(st)};tt.onerror=(ut,ht,dt,pt,mt)=>{if(ht===st||ht===tt.location.href&&dt===1&&pt===1)return ct(),it(mt),!1;if(lt!==null)return lt(ut,ht,dt,pt,mt)},ot.onerror=()=>{ct(),it(new SyntaxError)},ot.onload=()=>{ct(),nt()},ot.src=st,ot.type="module",rt.appendChild(ot)}}),createEventTargetConstructor=tt=>class{constructor(nt){this._nativeEventTarget=nt,this._listeners=new WeakMap}addEventListener(nt,it,rt){if(it!==null){let ot=this._listeners.get(it);ot===void 0&&(ot=tt(this,it),typeof it=="function"&&this._listeners.set(it,ot)),this._nativeEventTarget.addEventListener(nt,ot,rt)}}dispatchEvent(nt){return this._nativeEventTarget.dispatchEvent(nt)}removeEventListener(nt,it,rt){const ot=it===null?void 0:this._listeners.get(it);this._nativeEventTarget.removeEventListener(nt,ot===void 0?null:ot,rt)}},createExposeCurrentFrameAndCurrentTime=tt=>(et,nt,it)=>{Object.defineProperties(tt,{currentFrame:{configurable:!0,get(){return Math.round(et*nt)}},currentTime:{configurable:!0,get(){return et}}});try{return it()}finally{tt!==null&&(delete tt.currentFrame,delete tt.currentTime)}},createFetchSource=tt=>async et=>{try{const nt=await fetch(et);if(nt.ok)return[await nt.text(),nt.url]}catch{}throw tt()},DEFAULT_OPTIONS$8={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},createGainNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut={...DEFAULT_OPTIONS$8,...lt},ht=it(ct,ut),dt=ot(ct),pt=dt?nt():null;super(st,!1,ht,pt),this._gain=et(this,dt,ht.gain,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get gain(){return this._gain}},createGainNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,gain:ct.gain.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?await tt(lt,st.gain,ct.gain):await it(lt,st.gain,ct.gain),await rt(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createGetActiveAudioWorkletNodeInputs=(tt,et)=>nt=>et(tt,nt),createGetAudioNodeRenderer=tt=>et=>{const nt=tt(et);if(nt.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return nt.renderer},createGetAudioNodeTailTime=tt=>et=>{var nt;return(nt=tt.get(et))!==null&&nt!==void 0?nt:0},createGetAudioParamRenderer=tt=>et=>{const nt=tt(et);if(nt.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return nt.renderer},createGetBackupOfflineAudioContext=tt=>et=>tt.get(et),createInvalidStateError=()=>new DOMException("","InvalidStateError"),createGetNativeContext=tt=>et=>{const nt=tt.get(et);if(nt===void 0)throw createInvalidStateError();return nt},createGetOrCreateBackupOfflineAudioContext=(tt,et)=>nt=>{let it=tt.get(nt);if(it!==void 0)return it;if(et===null)throw new Error("Missing the native OfflineAudioContext constructor.");return it=new et(1,1,44100),tt.set(nt,it),it},createGetUnrenderedAudioWorkletNodes=tt=>et=>{const nt=tt.get(et);if(nt===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return nt},createInvalidAccessError=()=>new DOMException("","InvalidAccessError"),wrapIIRFilterNodeGetFrequencyResponseMethod=tt=>{tt.getFrequencyResponse=(et=>(nt,it,rt)=>{if(nt.length!==it.length||it.length!==rt.length)throw createInvalidAccessError();return et.call(tt,nt,it,rt)})(tt.getFrequencyResponse)},DEFAULT_OPTIONS$7={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},createIIRFilterNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut=rt(ct),ht={...DEFAULT_OPTIONS$7,...lt},dt=et(ct,ut?null:st.baseLatency,ht),pt=ut?nt(ht.feedback,ht.feedforward):null;super(st,!1,dt,pt),wrapIIRFilterNodeGetFrequencyResponseMethod(dt),this._nativeIIRFilterNode=dt,ot(this,1)}getFrequencyResponse(st,lt,ct){return this._nativeIIRFilterNode.getFrequencyResponse(st,lt,ct)}},filterBuffer=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut)=>{const ht=ct.length;let dt=st;for(let pt=0;pt{const rt=nt instanceof Float64Array?nt:new Float64Array(nt),ot=it instanceof Float64Array?it:new Float64Array(it),at=rt.length,st=ot.length,lt=Math.min(at,st);if(rt[0]!==1){for(let mt=0;mt(ot,at)=>{const st=new WeakMap;let lt=null;const ct=async(ut,ht)=>{let dt=null,pt=et(ut);const mt=isOwnedByContext(pt,ht);if(ht.createIIRFilter===void 0?dt=tt(ht,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):mt||(pt=ht.createIIRFilter(at,ot)),st.set(ht,dt===null?pt:dt),dt!==null){if(lt===null){if(nt===null)throw new Error("Missing the native OfflineAudioContext constructor.");const bt=new nt(ut.context.destination.channelCount,ut.context.length,ht.sampleRate);lt=(async()=>{await it(ut,bt,bt.destination);const yt=await rt(bt);return filterFullBuffer(yt,ht,ot,at)})()}const gt=await lt;return dt.buffer=gt,dt.start(0),dt}return await it(ut,ht,pt),pt};return{render(ut,ht){const dt=st.get(ht);return dt!==void 0?Promise.resolve(dt):ct(ut,ht)}}},createIncrementCycleCounterFactory=(tt,et,nt,it,rt,ot)=>at=>(st,lt)=>{const ct=tt.get(st);if(ct===void 0){if(!at&&ot(st)){const ut=it(st),{outputs:ht}=nt(st);for(const dt of ht)if(isAudioNodeOutputConnection(dt)){const pt=it(dt[0]);et(ut,pt,dt[1],dt[2])}else{const pt=rt(dt[0]);ut.disconnect(pt,dt[1])}}tt.set(st,lt)}else tt.set(st,ct+lt)},createIsAnyAudioContext=(tt,et)=>nt=>{const it=tt.get(nt);return et(it)||et(nt)},createIsAnyAudioNode=(tt,et)=>nt=>tt.has(nt)||et(nt),createIsAnyAudioParam=(tt,et)=>nt=>tt.has(nt)||et(nt),createIsAnyOfflineAudioContext=(tt,et)=>nt=>{const it=tt.get(nt);return et(it)||et(nt)},createIsNativeAudioContext=tt=>et=>tt!==null&&et instanceof tt,createIsNativeAudioNode=tt=>et=>tt!==null&&typeof tt.AudioNode=="function"&&et instanceof tt.AudioNode,createIsNativeAudioParam=tt=>et=>tt!==null&&typeof tt.AudioParam=="function"&&et instanceof tt.AudioParam,createIsNativeContext=(tt,et)=>nt=>tt(nt)||et(nt),createIsNativeOfflineAudioContext=tt=>et=>tt!==null&&et instanceof tt,createIsSecureContext=tt=>tt!==null&&tt.isSecureContext,createMediaElementAudioSourceNodeConstructor=(tt,et,nt,it)=>class extends tt{constructor(ot,at){const st=nt(ot),lt=et(st,at);if(it(st))throw TypeError();super(ot,!0,lt,null),this._nativeMediaElementAudioSourceNode=lt}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},DEFAULT_OPTIONS$6={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},createMediaStreamAudioDestinationNodeConstructor=(tt,et,nt,it)=>class extends tt{constructor(ot,at){const st=nt(ot);if(it(st))throw new TypeError;const lt={...DEFAULT_OPTIONS$6,...at},ct=et(st,lt);super(ot,!1,ct,null),this._nativeMediaStreamAudioDestinationNode=ct}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},createMediaStreamAudioSourceNodeConstructor=(tt,et,nt,it)=>class extends tt{constructor(ot,at){const st=nt(ot),lt=et(st,at);if(it(st))throw new TypeError;super(ot,!0,lt,null),this._nativeMediaStreamAudioSourceNode=lt}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},createMediaStreamTrackAudioSourceNodeConstructor=(tt,et,nt)=>class extends tt{constructor(rt,ot){const at=nt(rt),st=et(at,ot);super(rt,!0,st,null)}},createMinimalBaseAudioContextConstructor=(tt,et,nt,it,rt,ot)=>class extends nt{constructor(st,lt){super(st),this._nativeContext=st,CONTEXT_STORE.set(this,st),it(st)&&rt.set(st,new Set),this._destination=new tt(this,lt),this._listener=et(this,st),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(st){const lt=typeof st=="function"?ot(this,st):null;this._nativeContext.onstatechange=lt;const ct=this._nativeContext.onstatechange;this._onstatechange=ct!==null&&ct===lt?st:ct}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},testPromiseSupport=tt=>{const et=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const nt=tt.decodeAudioData(et.buffer,()=>{});return nt===void 0?!1:(nt.catch(()=>{}),!0)}catch{}return!1},createMonitorConnections=(tt,et)=>(nt,it,rt)=>{const ot=new Set;return nt.connect=(at=>(st,lt=0,ct=0)=>{const ut=ot.size===0;if(et(st))return at.call(nt,st,lt,ct),tt(ot,[st,lt,ct],ht=>ht[0]===st&&ht[1]===lt&&ht[2]===ct,!0),ut&&it(),st;at.call(nt,st,lt),tt(ot,[st,lt],ht=>ht[0]===st&&ht[1]===lt,!0),ut&&it()})(nt.connect),nt.disconnect=(at=>(st,lt,ct)=>{const ut=ot.size>0;if(st===void 0)at.apply(nt),ot.clear();else if(typeof st=="number"){at.call(nt,st);for(const dt of ot)dt[1]===st&&ot.delete(dt)}else{et(st)?at.call(nt,st,lt,ct):at.call(nt,st,lt);for(const dt of ot)dt[0]===st&&(lt===void 0||dt[1]===lt)&&(ct===void 0||dt[2]===ct)&&ot.delete(dt)}const ht=ot.size===0;ut&&ht&&rt()})(nt.disconnect),nt},assignNativeAudioNodeOption=(tt,et,nt)=>{const it=et[nt];it!==void 0&&it!==tt[nt]&&(tt[nt]=it)},assignNativeAudioNodeOptions=(tt,et)=>{assignNativeAudioNodeOption(tt,et,"channelCount"),assignNativeAudioNodeOption(tt,et,"channelCountMode"),assignNativeAudioNodeOption(tt,et,"channelInterpretation")},testAnalyserNodeGetFloatTimeDomainDataMethodSupport=tt=>typeof tt.getFloatTimeDomainData=="function",wrapAnalyserNodeGetFloatTimeDomainDataMethod=tt=>{tt.getFloatTimeDomainData=et=>{const nt=new Uint8Array(et.length);tt.getByteTimeDomainData(nt);const it=Math.max(nt.length,tt.fftSize);for(let rt=0;rt(nt,it)=>{const rt=nt.createAnalyser();if(assignNativeAudioNodeOptions(rt,it),!(it.maxDecibels>it.minDecibels))throw et();return assignNativeAudioNodeOption(rt,it,"fftSize"),assignNativeAudioNodeOption(rt,it,"maxDecibels"),assignNativeAudioNodeOption(rt,it,"minDecibels"),assignNativeAudioNodeOption(rt,it,"smoothingTimeConstant"),tt(testAnalyserNodeGetFloatTimeDomainDataMethodSupport,()=>testAnalyserNodeGetFloatTimeDomainDataMethodSupport(rt))||wrapAnalyserNodeGetFloatTimeDomainDataMethod(rt),rt},createNativeAudioBufferConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioBuffer")?tt.AudioBuffer:null,assignNativeAudioNodeAudioParamValue=(tt,et,nt)=>{const it=et[nt];it!==void 0&&it!==tt[nt].value&&(tt[nt].value=it)},wrapAudioBufferSourceNodeStartMethodConsecutiveCalls=tt=>{tt.start=(et=>{let nt=!1;return(it=0,rt=0,ot)=>{if(nt)throw createInvalidStateError();et.call(tt,it,rt,ot),nt=!0}})(tt.start)},wrapAudioScheduledSourceNodeStartMethodNegativeParameters=tt=>{tt.start=(et=>(nt=0,it=0,rt)=>{if(typeof rt=="number"&&rt<0||it<0||nt<0)throw new RangeError("The parameters can't be negative.");et.call(tt,nt,it,rt)})(tt.start)},wrapAudioScheduledSourceNodeStopMethodNegativeParameters=tt=>{tt.stop=(et=>(nt=0)=>{if(nt<0)throw new RangeError("The parameter can't be negative.");et.call(tt,nt)})(tt.stop)},createNativeAudioBufferSourceNodeFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut)=>(ht,dt)=>{const pt=ht.createBufferSource();return assignNativeAudioNodeOptions(pt,dt),assignNativeAudioNodeAudioParamValue(pt,dt,"playbackRate"),assignNativeAudioNodeOption(pt,dt,"buffer"),assignNativeAudioNodeOption(pt,dt,"loop"),assignNativeAudioNodeOption(pt,dt,"loopEnd"),assignNativeAudioNodeOption(pt,dt,"loopStart"),et(nt,()=>nt(ht))||wrapAudioBufferSourceNodeStartMethodConsecutiveCalls(pt),et(it,()=>it(ht))||lt(pt),et(rt,()=>rt(ht))||ct(pt,ht),et(ot,()=>ot(ht))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(pt),et(at,()=>at(ht))||ut(pt,ht),et(st,()=>st(ht))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(pt),tt(ht,pt),pt},createNativeAudioContextConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioContext")?tt.AudioContext:tt.hasOwnProperty("webkitAudioContext")?tt.webkitAudioContext:null,createNativeAudioDestinationNodeFactory=(tt,et)=>(nt,it,rt)=>{const ot=nt.destination;if(ot.channelCount!==it)try{ot.channelCount=it}catch{}rt&&ot.channelCountMode!=="explicit"&&(ot.channelCountMode="explicit"),ot.maxChannelCount===0&&Object.defineProperty(ot,"maxChannelCount",{value:it});const at=tt(nt,{channelCount:it,channelCountMode:ot.channelCountMode,channelInterpretation:ot.channelInterpretation,gain:1});return et(at,"channelCount",st=>()=>st.call(at),st=>lt=>{st.call(at,lt);try{ot.channelCount=lt}catch(ct){if(lt>ot.maxChannelCount)throw ct}}),et(at,"channelCountMode",st=>()=>st.call(at),st=>lt=>{st.call(at,lt),ot.channelCountMode=lt}),et(at,"channelInterpretation",st=>()=>st.call(at),st=>lt=>{st.call(at,lt),ot.channelInterpretation=lt}),Object.defineProperty(at,"maxChannelCount",{get:()=>ot.maxChannelCount}),at.connect(ot),at},createNativeAudioWorkletNodeConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioWorkletNode")?tt.AudioWorkletNode:null,testClonabilityOfAudioWorkletNodeOptions=tt=>{const{port1:et}=new MessageChannel;try{et.postMessage(tt)}finally{et.close()}},createNativeAudioWorkletNodeFactory=(tt,et,nt,it,rt)=>(ot,at,st,lt,ct,ut)=>{if(st!==null)try{const ht=new st(ot,lt,ut),dt=new Map;let pt=null;if(Object.defineProperties(ht,{channelCount:{get:()=>ut.channelCount,set:()=>{throw tt()}},channelCountMode:{get:()=>"explicit",set:()=>{throw tt()}},onprocessorerror:{get:()=>pt,set:mt=>{typeof pt=="function"&&ht.removeEventListener("processorerror",pt),pt=typeof mt=="function"?mt:null,typeof pt=="function"&&ht.addEventListener("processorerror",pt)}}}),ht.addEventListener=(mt=>(...gt)=>{if(gt[0]==="processorerror"){const bt=typeof gt[1]=="function"?gt[1]:typeof gt[1]=="object"&>[1]!==null&&typeof gt[1].handleEvent=="function"?gt[1].handleEvent:null;if(bt!==null){const yt=dt.get(gt[1]);yt!==void 0?gt[1]=yt:(gt[1]=wt=>{wt.type==="error"?(Object.defineProperties(wt,{type:{value:"processorerror"}}),bt(wt)):bt(new ErrorEvent(gt[0],{...wt}))},dt.set(bt,gt[1]))}}return mt.call(ht,"error",gt[1],gt[2]),mt.call(ht,...gt)})(ht.addEventListener),ht.removeEventListener=(mt=>(...gt)=>{if(gt[0]==="processorerror"){const bt=dt.get(gt[1]);bt!==void 0&&(dt.delete(gt[1]),gt[1]=bt)}return mt.call(ht,"error",gt[1],gt[2]),mt.call(ht,gt[0],gt[1],gt[2])})(ht.removeEventListener),ut.numberOfOutputs!==0){const mt=nt(ot,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return ht.connect(mt).connect(ot.destination),rt(ht,()=>mt.disconnect(),()=>mt.connect(ot.destination))}return ht}catch(ht){throw ht.code===11?it():ht}if(ct===void 0)throw it();return testClonabilityOfAudioWorkletNodeOptions(ut),et(ot,at,ct,ut)},computeBufferSize=(tt,et)=>tt===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(tt*et))))),cloneAudioWorkletNodeOptions=tt=>new Promise((et,nt)=>{const{port1:it,port2:rt}=new MessageChannel;it.onmessage=({data:ot})=>{it.close(),rt.close(),et(ot)},it.onmessageerror=({data:ot})=>{it.close(),rt.close(),nt(ot)},rt.postMessage(tt)}),createAudioWorkletProcessorPromise=async(tt,et)=>{const nt=await cloneAudioWorkletNodeOptions(et);return new tt(nt)},createAudioWorkletProcessor=(tt,et,nt,it)=>{let rt=NODE_TO_PROCESSOR_MAPS.get(tt);rt===void 0&&(rt=new WeakMap,NODE_TO_PROCESSOR_MAPS.set(tt,rt));const ot=createAudioWorkletProcessorPromise(nt,it);return rt.set(et,ot),ot},createNativeAudioWorkletNodeFakerFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt)=>(pt,mt,gt,bt)=>{if(bt.numberOfInputs===0&&bt.numberOfOutputs===0)throw lt();const yt=Array.isArray(bt.outputChannelCount)?bt.outputChannelCount:Array.from(bt.outputChannelCount);if(yt.some(Cn=>Cn<1))throw lt();if(yt.length!==bt.numberOfOutputs)throw et();if(bt.channelCountMode!=="explicit")throw lt();const wt=bt.channelCount*bt.numberOfInputs,vt=yt.reduce((Cn,jn)=>Cn+jn,0),xt=gt.parameterDescriptors===void 0?0:gt.parameterDescriptors.length;if(wt+xt>6||vt>6)throw lt();const St=new MessageChannel,Et=[],It=[];for(let Cn=0;CnCn===void 0?0:Cn},maxValue:{get:()=>jn===void 0?MOST_POSITIVE_SINGLE_FLOAT:jn},minValue:{get:()=>Un===void 0?MOST_NEGATIVE_SINGLE_FLOAT:Un}}),Tt.push(un)}const $t=it(pt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,wt+xt)}),Ut=computeBufferSize(mt,pt.sampleRate),Lt=st(pt,Ut,wt+xt,Math.max(1,vt)),Bt=rt(pt,{channelCount:Math.max(1,vt),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,vt)}),Pt=[];for(let Cn=0;Cn{const Un=Tt[jn];return Un.connect($t,0,wt+jn),Un.start(0),[Cn,Un.offset]}));$t.connect(Lt);let At=bt.channelInterpretation,Rt=null;const Wt=bt.numberOfOutputs===0?[Lt]:Pt,jt={get bufferSize(){return Ut},get channelCount(){return bt.channelCount},set channelCount(Cn){throw nt()},get channelCountMode(){return bt.channelCountMode},set channelCountMode(Cn){throw nt()},get channelInterpretation(){return At},set channelInterpretation(Cn){for(const jn of Et)jn.channelInterpretation=Cn;At=Cn},get context(){return Lt.context},get inputs(){return Et},get numberOfInputs(){return bt.numberOfInputs},get numberOfOutputs(){return bt.numberOfOutputs},get onprocessorerror(){return Rt},set onprocessorerror(Cn){typeof Rt=="function"&&jt.removeEventListener("processorerror",Rt),Rt=typeof Cn=="function"?Cn:null,typeof Rt=="function"&&jt.addEventListener("processorerror",Rt)},get parameters(){return kt},get port(){return St.port2},addEventListener(...Cn){return Lt.addEventListener(Cn[0],Cn[1],Cn[2])},connect:tt.bind(null,Wt),disconnect:ct.bind(null,Wt),dispatchEvent(...Cn){return Lt.dispatchEvent(Cn[0])},removeEventListener(...Cn){return Lt.removeEventListener(Cn[0],Cn[1],Cn[2])}},Ot=new Map;St.port1.addEventListener=(Cn=>(...jn)=>{if(jn[0]==="message"){const Un=typeof jn[1]=="function"?jn[1]:typeof jn[1]=="object"&&jn[1]!==null&&typeof jn[1].handleEvent=="function"?jn[1].handleEvent:null;if(Un!==null){const yn=Ot.get(jn[1]);yn!==void 0?jn[1]=yn:(jn[1]=un=>{ut(pt.currentTime,pt.sampleRate,()=>Un(un))},Ot.set(Un,jn[1]))}}return Cn.call(St.port1,jn[0],jn[1],jn[2])})(St.port1.addEventListener),St.port1.removeEventListener=(Cn=>(...jn)=>{if(jn[0]==="message"){const Un=Ot.get(jn[1]);Un!==void 0&&(Ot.delete(jn[1]),jn[1]=Un)}return Cn.call(St.port1,jn[0],jn[1],jn[2])})(St.port1.removeEventListener);let Ct=null;Object.defineProperty(St.port1,"onmessage",{get:()=>Ct,set:Cn=>{typeof Ct=="function"&&St.port1.removeEventListener("message",Ct),Ct=typeof Cn=="function"?Cn:null,typeof Ct=="function"&&(St.port1.addEventListener("message",Ct),St.port1.start())}}),gt.prototype.port=St.port1;let Dt=null;createAudioWorkletProcessor(pt,jt,gt,bt).then(Cn=>Dt=Cn);const Vt=createNestedArrays(bt.numberOfInputs,bt.channelCount),Qt=createNestedArrays(bt.numberOfOutputs,yt),rn=gt.parameterDescriptors===void 0?[]:gt.parameterDescriptors.reduce((Cn,{name:jn})=>({...Cn,[jn]:new Float32Array(128)}),{});let Xt=!0;const an=()=>{bt.numberOfOutputs>0&&Lt.disconnect(Bt);for(let Cn=0,jn=0;Cn{if(Dt!==null){const Un=ht(jt);for(let yn=0;yn{copyFromChannel(Cn,rn,un,wt+En,yn)});for(let un=0;un{if(Un[xn].size>0)return tn.set(xn,Ut/128),In;const cn=tn.get(xn);return cn===void 0?[]:(In.every(hn=>hn.every($n=>$n===0))&&(cn===1?tn.delete(xn):tn.set(xn,cn-1)),In)});Xt=ut(pt.currentTime+yn/pt.sampleRate,pt.sampleRate,()=>Dt.process(un,Qt,rn));for(let In=0,xn=0;InLt.connect(vn).connect(pt.destination),Zt=()=>{Lt.disconnect(vn),vn.disconnect()},Sn=()=>{if(Xt){Zt(),bt.numberOfOutputs>0&&Lt.connect(Bt);for(let Cn=0,jn=0;Cn{Xt&&(sn(),an()),pn=!1};return sn(),dt(jt,Sn,Tn)},createNativeBiquadFilterNode=(tt,et)=>{const nt=tt.createBiquadFilter();return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"Q"),assignNativeAudioNodeAudioParamValue(nt,et,"detune"),assignNativeAudioNodeAudioParamValue(nt,et,"frequency"),assignNativeAudioNodeAudioParamValue(nt,et,"gain"),assignNativeAudioNodeOption(nt,et,"type"),nt},createNativeChannelMergerNodeFactory=(tt,et)=>(nt,it)=>{const rt=nt.createChannelMerger(it.numberOfInputs);return tt!==null&&tt.name==="webkitAudioContext"&&et(nt,rt),assignNativeAudioNodeOptions(rt,it),rt},wrapChannelSplitterNode=tt=>{const et=tt.numberOfOutputs;Object.defineProperty(tt,"channelCount",{get:()=>et,set:nt=>{if(nt!==et)throw createInvalidStateError()}}),Object.defineProperty(tt,"channelCountMode",{get:()=>"explicit",set:nt=>{if(nt!=="explicit")throw createInvalidStateError()}}),Object.defineProperty(tt,"channelInterpretation",{get:()=>"discrete",set:nt=>{if(nt!=="discrete")throw createInvalidStateError()}})},createNativeChannelSplitterNode=(tt,et)=>{const nt=tt.createChannelSplitter(et.numberOfOutputs);return assignNativeAudioNodeOptions(nt,et),wrapChannelSplitterNode(nt),nt},createNativeConstantSourceNodeFactory=(tt,et,nt,it,rt)=>(ot,at)=>{if(ot.createConstantSource===void 0)return nt(ot,at);const st=ot.createConstantSource();return assignNativeAudioNodeOptions(st,at),assignNativeAudioNodeAudioParamValue(st,at,"offset"),et(it,()=>it(ot))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(st),et(rt,()=>rt(ot))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(st),tt(ot,st),st},interceptConnections=(tt,et)=>(tt.connect=et.connect.bind(et),tt.disconnect=et.disconnect.bind(et),tt),createNativeConstantSourceNodeFakerFactory=(tt,et,nt,it)=>(rt,{offset:ot,...at})=>{const st=rt.createBuffer(1,2,44100),lt=et(rt,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),ct=nt(rt,{...at,gain:ot}),ut=st.getChannelData(0);ut[0]=1,ut[1]=1,lt.buffer=st,lt.loop=!0;const ht={get bufferSize(){},get channelCount(){return ct.channelCount},set channelCount(mt){ct.channelCount=mt},get channelCountMode(){return ct.channelCountMode},set channelCountMode(mt){ct.channelCountMode=mt},get channelInterpretation(){return ct.channelInterpretation},set channelInterpretation(mt){ct.channelInterpretation=mt},get context(){return ct.context},get inputs(){return[]},get numberOfInputs(){return lt.numberOfInputs},get numberOfOutputs(){return ct.numberOfOutputs},get offset(){return ct.gain},get onended(){return lt.onended},set onended(mt){lt.onended=mt},addEventListener(...mt){return lt.addEventListener(mt[0],mt[1],mt[2])},dispatchEvent(...mt){return lt.dispatchEvent(mt[0])},removeEventListener(...mt){return lt.removeEventListener(mt[0],mt[1],mt[2])},start(mt=0){lt.start.call(lt,mt)},stop(mt=0){lt.stop.call(lt,mt)}},dt=()=>lt.connect(ct),pt=()=>lt.disconnect(ct);return tt(rt,lt),it(interceptConnections(ht,ct),dt,pt)},createNativeConvolverNodeFactory=(tt,et)=>(nt,it)=>{const rt=nt.createConvolver();if(assignNativeAudioNodeOptions(rt,it),it.disableNormalization===rt.normalize&&(rt.normalize=!it.disableNormalization),assignNativeAudioNodeOption(rt,it,"buffer"),it.channelCount>2||(et(rt,"channelCount",ot=>()=>ot.call(rt),ot=>at=>{if(at>2)throw tt();return ot.call(rt,at)}),it.channelCountMode==="max"))throw tt();return et(rt,"channelCountMode",ot=>()=>ot.call(rt),ot=>at=>{if(at==="max")throw tt();return ot.call(rt,at)}),rt},createNativeDelayNode=(tt,et)=>{const nt=tt.createDelay(et.maxDelayTime);return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"delayTime"),nt},createNativeDynamicsCompressorNodeFactory=tt=>(et,nt)=>{const it=et.createDynamicsCompressor();if(assignNativeAudioNodeOptions(it,nt),nt.channelCount>2||nt.channelCountMode==="max")throw tt();return assignNativeAudioNodeAudioParamValue(it,nt,"attack"),assignNativeAudioNodeAudioParamValue(it,nt,"knee"),assignNativeAudioNodeAudioParamValue(it,nt,"ratio"),assignNativeAudioNodeAudioParamValue(it,nt,"release"),assignNativeAudioNodeAudioParamValue(it,nt,"threshold"),it},createNativeGainNode=(tt,et)=>{const nt=tt.createGain();return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"gain"),nt},createNativeIIRFilterNodeFactory=tt=>(et,nt,it)=>{if(et.createIIRFilter===void 0)return tt(et,nt,it);const rt=et.createIIRFilter(it.feedforward,it.feedback);return assignNativeAudioNodeOptions(rt,it),rt};function divide$1(tt,et){const nt=et[0]*et[0]+et[1]*et[1];return[(tt[0]*et[0]+tt[1]*et[1])/nt,(tt[1]*et[0]-tt[0]*et[1])/nt]}function multiply(tt,et){return[tt[0]*et[0]-tt[1]*et[1],tt[0]*et[1]+tt[1]*et[0]]}function evaluatePolynomial(tt,et){let nt=[0,0];for(let it=tt.length-1;it>=0;it-=1)nt=multiply(nt,et),nt[0]+=tt[it];return nt}const createNativeIIRFilterNodeFakerFactory=(tt,et,nt,it)=>(rt,ot,{channelCount:at,channelCountMode:st,channelInterpretation:lt,feedback:ct,feedforward:ut})=>{const ht=computeBufferSize(ot,rt.sampleRate),dt=ct instanceof Float64Array?ct:new Float64Array(ct),pt=ut instanceof Float64Array?ut:new Float64Array(ut),mt=dt.length,gt=pt.length,bt=Math.min(mt,gt);if(mt===0||mt>20)throw it();if(dt[0]===0)throw et();if(gt===0||gt>20)throw it();if(pt[0]===0)throw et();if(dt[0]!==1){for(let Tt=0;Tt{const $t=Tt.inputBuffer,Ut=Tt.outputBuffer,Lt=$t.numberOfChannels;for(let Bt=0;Bttt.createMediaElementSource(et.mediaElement),createNativeMediaStreamAudioDestinationNode=(tt,et)=>{const nt=tt.createMediaStreamDestination();return assignNativeAudioNodeOptions(nt,et),nt.numberOfOutputs===1&&Object.defineProperty(nt,"numberOfOutputs",{get:()=>0}),nt},createNativeMediaStreamAudioSourceNode=(tt,{mediaStream:et})=>{const nt=et.getAudioTracks();nt.sort((ot,at)=>ot.idat.id?1:0);const it=nt.slice(0,1),rt=tt.createMediaStreamSource(new MediaStream(it));return Object.defineProperty(rt,"mediaStream",{value:et}),rt},createNativeMediaStreamTrackAudioSourceNodeFactory=(tt,et)=>(nt,{mediaStreamTrack:it})=>{if(typeof nt.createMediaStreamTrackSource=="function")return nt.createMediaStreamTrackSource(it);const rt=new MediaStream([it]),ot=nt.createMediaStreamSource(rt);if(it.kind!=="audio")throw tt();if(et(nt))throw new TypeError;return ot},createNativeOfflineAudioContextConstructor=tt=>tt===null?null:tt.hasOwnProperty("OfflineAudioContext")?tt.OfflineAudioContext:tt.hasOwnProperty("webkitOfflineAudioContext")?tt.webkitOfflineAudioContext:null,createNativeOscillatorNodeFactory=(tt,et,nt,it,rt,ot)=>(at,st)=>{const lt=at.createOscillator();return assignNativeAudioNodeOptions(lt,st),assignNativeAudioNodeAudioParamValue(lt,st,"detune"),assignNativeAudioNodeAudioParamValue(lt,st,"frequency"),st.periodicWave!==void 0?lt.setPeriodicWave(st.periodicWave):assignNativeAudioNodeOption(lt,st,"type"),et(nt,()=>nt(at))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(lt),et(it,()=>it(at))||ot(lt,at),et(rt,()=>rt(at))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(lt),tt(at,lt),lt},createNativePannerNodeFactory=tt=>(et,nt)=>{const it=et.createPanner();return it.orientationX===void 0?tt(et,nt):(assignNativeAudioNodeOptions(it,nt),assignNativeAudioNodeAudioParamValue(it,nt,"orientationX"),assignNativeAudioNodeAudioParamValue(it,nt,"orientationY"),assignNativeAudioNodeAudioParamValue(it,nt,"orientationZ"),assignNativeAudioNodeAudioParamValue(it,nt,"positionX"),assignNativeAudioNodeAudioParamValue(it,nt,"positionY"),assignNativeAudioNodeAudioParamValue(it,nt,"positionZ"),assignNativeAudioNodeOption(it,nt,"coneInnerAngle"),assignNativeAudioNodeOption(it,nt,"coneOuterAngle"),assignNativeAudioNodeOption(it,nt,"coneOuterGain"),assignNativeAudioNodeOption(it,nt,"distanceModel"),assignNativeAudioNodeOption(it,nt,"maxDistance"),assignNativeAudioNodeOption(it,nt,"panningModel"),assignNativeAudioNodeOption(it,nt,"refDistance"),assignNativeAudioNodeOption(it,nt,"rolloffFactor"),it)},createNativePannerNodeFakerFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct)=>(ut,{coneInnerAngle:ht,coneOuterAngle:dt,coneOuterGain:pt,distanceModel:mt,maxDistance:gt,orientationX:bt,orientationY:yt,orientationZ:wt,panningModel:vt,positionX:xt,positionY:St,positionZ:Et,refDistance:It,rolloffFactor:Tt,...$t})=>{const Ut=ut.createPanner();if($t.channelCount>2||$t.channelCountMode==="max")throw at();assignNativeAudioNodeOptions(Ut,$t);const Lt={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},Bt=nt(ut,{...Lt,channelInterpretation:"speakers",numberOfInputs:6}),Pt=it(ut,{...$t,gain:1}),kt=it(ut,{...Lt,gain:1}),At=it(ut,{...Lt,gain:0}),Rt=it(ut,{...Lt,gain:0}),Wt=it(ut,{...Lt,gain:0}),jt=it(ut,{...Lt,gain:0}),Ot=it(ut,{...Lt,gain:0}),Ct=rt(ut,256,6,1),Dt=ot(ut,{...Lt,curve:new Float32Array([1,1]),oversample:"none"});let Mt=[bt,yt,wt],Vt=[xt,St,Et];const Qt=new Float32Array(1);Ct.onaudioprocess=({inputBuffer:tn})=>{const pn=[lt(tn,Qt,0),lt(tn,Qt,1),lt(tn,Qt,2)];pn.some((sn,Zt)=>sn!==Mt[Zt])&&(Ut.setOrientation(...pn),Mt=pn);const vn=[lt(tn,Qt,3),lt(tn,Qt,4),lt(tn,Qt,5)];vn.some((sn,Zt)=>sn!==Vt[Zt])&&(Ut.setPosition(...vn),Vt=vn)},Object.defineProperty(At.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Rt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Wt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(jt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Ot.gain,"defaultValue",{get:()=>0});const rn={get bufferSize(){},get channelCount(){return Ut.channelCount},set channelCount(tn){if(tn>2)throw at();Pt.channelCount=tn,Ut.channelCount=tn},get channelCountMode(){return Ut.channelCountMode},set channelCountMode(tn){if(tn==="max")throw at();Pt.channelCountMode=tn,Ut.channelCountMode=tn},get channelInterpretation(){return Ut.channelInterpretation},set channelInterpretation(tn){Pt.channelInterpretation=tn,Ut.channelInterpretation=tn},get coneInnerAngle(){return Ut.coneInnerAngle},set coneInnerAngle(tn){Ut.coneInnerAngle=tn},get coneOuterAngle(){return Ut.coneOuterAngle},set coneOuterAngle(tn){Ut.coneOuterAngle=tn},get coneOuterGain(){return Ut.coneOuterGain},set coneOuterGain(tn){if(tn<0||tn>1)throw et();Ut.coneOuterGain=tn},get context(){return Ut.context},get distanceModel(){return Ut.distanceModel},set distanceModel(tn){Ut.distanceModel=tn},get inputs(){return[Pt]},get maxDistance(){return Ut.maxDistance},set maxDistance(tn){if(tn<0)throw new RangeError;Ut.maxDistance=tn},get numberOfInputs(){return Ut.numberOfInputs},get numberOfOutputs(){return Ut.numberOfOutputs},get orientationX(){return kt.gain},get orientationY(){return At.gain},get orientationZ(){return Rt.gain},get panningModel(){return Ut.panningModel},set panningModel(tn){Ut.panningModel=tn},get positionX(){return Wt.gain},get positionY(){return jt.gain},get positionZ(){return Ot.gain},get refDistance(){return Ut.refDistance},set refDistance(tn){if(tn<0)throw new RangeError;Ut.refDistance=tn},get rolloffFactor(){return Ut.rolloffFactor},set rolloffFactor(tn){if(tn<0)throw new RangeError;Ut.rolloffFactor=tn},addEventListener(...tn){return Pt.addEventListener(tn[0],tn[1],tn[2])},dispatchEvent(...tn){return Pt.dispatchEvent(tn[0])},removeEventListener(...tn){return Pt.removeEventListener(tn[0],tn[1],tn[2])}};ht!==rn.coneInnerAngle&&(rn.coneInnerAngle=ht),dt!==rn.coneOuterAngle&&(rn.coneOuterAngle=dt),pt!==rn.coneOuterGain&&(rn.coneOuterGain=pt),mt!==rn.distanceModel&&(rn.distanceModel=mt),gt!==rn.maxDistance&&(rn.maxDistance=gt),bt!==rn.orientationX.value&&(rn.orientationX.value=bt),yt!==rn.orientationY.value&&(rn.orientationY.value=yt),wt!==rn.orientationZ.value&&(rn.orientationZ.value=wt),vt!==rn.panningModel&&(rn.panningModel=vt),xt!==rn.positionX.value&&(rn.positionX.value=xt),St!==rn.positionY.value&&(rn.positionY.value=St),Et!==rn.positionZ.value&&(rn.positionZ.value=Et),It!==rn.refDistance&&(rn.refDistance=It),Tt!==rn.rolloffFactor&&(rn.rolloffFactor=Tt),(Mt[0]!==1||Mt[1]!==0||Mt[2]!==0)&&Ut.setOrientation(...Mt),(Vt[0]!==0||Vt[1]!==0||Vt[2]!==0)&&Ut.setPosition(...Vt);const Xt=()=>{Pt.connect(Ut),tt(Pt,Dt,0,0),Dt.connect(kt).connect(Bt,0,0),Dt.connect(At).connect(Bt,0,1),Dt.connect(Rt).connect(Bt,0,2),Dt.connect(Wt).connect(Bt,0,3),Dt.connect(jt).connect(Bt,0,4),Dt.connect(Ot).connect(Bt,0,5),Bt.connect(Ct).connect(ut.destination)},an=()=>{Pt.disconnect(Ut),st(Pt,Dt,0,0),Dt.disconnect(kt),kt.disconnect(Bt),Dt.disconnect(At),At.disconnect(Bt),Dt.disconnect(Rt),Rt.disconnect(Bt),Dt.disconnect(Wt),Wt.disconnect(Bt),Dt.disconnect(jt),jt.disconnect(Bt),Dt.disconnect(Ot),Ot.disconnect(Bt),Bt.disconnect(Ct),Ct.disconnect(ut.destination)};return ct(interceptConnections(rn,Ut),Xt,an)},createNativePeriodicWaveFactory=tt=>(et,{disableNormalization:nt,imag:it,real:rt})=>{const ot=it instanceof Float32Array?it:new Float32Array(it),at=rt instanceof Float32Array?rt:new Float32Array(rt),st=et.createPeriodicWave(at,ot,{disableNormalization:nt});if(Array.from(it).length<2)throw tt();return st},createNativeScriptProcessorNode=(tt,et,nt,it)=>tt.createScriptProcessor(et,nt,it),createNativeStereoPannerNodeFactory=(tt,et)=>(nt,it)=>{const rt=it.channelCountMode;if(rt==="clamped-max")throw et();if(nt.createStereoPanner===void 0)return tt(nt,it);const ot=nt.createStereoPanner();return assignNativeAudioNodeOptions(ot,it),assignNativeAudioNodeAudioParamValue(ot,it,"pan"),Object.defineProperty(ot,"channelCountMode",{get:()=>rt,set:at=>{if(at!==rt)throw et()}}),ot},createNativeStereoPannerNodeFakerFactory=(tt,et,nt,it,rt,ot)=>{const st=new Float32Array([1,1]),lt=Math.PI/2,ct={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},ut={...ct,oversample:"none"},ht=(mt,gt,bt,yt)=>{const wt=new Float32Array(16385),vt=new Float32Array(16385);for(let $t=0;$t<16385;$t+=1){const Ut=$t/16384*lt;wt[$t]=Math.cos(Ut),vt[$t]=Math.sin(Ut)}const xt=nt(mt,{...ct,gain:0}),St=it(mt,{...ut,curve:wt}),Et=it(mt,{...ut,curve:st}),It=nt(mt,{...ct,gain:0}),Tt=it(mt,{...ut,curve:vt});return{connectGraph(){gt.connect(xt),gt.connect(Et.inputs===void 0?Et:Et.inputs[0]),gt.connect(It),Et.connect(bt),bt.connect(St.inputs===void 0?St:St.inputs[0]),bt.connect(Tt.inputs===void 0?Tt:Tt.inputs[0]),St.connect(xt.gain),Tt.connect(It.gain),xt.connect(yt,0,0),It.connect(yt,0,1)},disconnectGraph(){gt.disconnect(xt),gt.disconnect(Et.inputs===void 0?Et:Et.inputs[0]),gt.disconnect(It),Et.disconnect(bt),bt.disconnect(St.inputs===void 0?St:St.inputs[0]),bt.disconnect(Tt.inputs===void 0?Tt:Tt.inputs[0]),St.disconnect(xt.gain),Tt.disconnect(It.gain),xt.disconnect(yt,0,0),It.disconnect(yt,0,1)}}},dt=(mt,gt,bt,yt)=>{const wt=new Float32Array(16385),vt=new Float32Array(16385),xt=new Float32Array(16385),St=new Float32Array(16385),Et=Math.floor(16385/2);for(let Wt=0;Wt<16385;Wt+=1)if(Wt>Et){const jt=(Wt-Et)/(16384-Et)*lt;wt[Wt]=Math.cos(jt),vt[Wt]=Math.sin(jt),xt[Wt]=0,St[Wt]=1}else{const jt=Wt/(16384-Et)*lt;wt[Wt]=1,vt[Wt]=0,xt[Wt]=Math.cos(jt),St[Wt]=Math.sin(jt)}const It=et(mt,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),Tt=nt(mt,{...ct,gain:0}),$t=it(mt,{...ut,curve:wt}),Ut=nt(mt,{...ct,gain:0}),Lt=it(mt,{...ut,curve:vt}),Bt=it(mt,{...ut,curve:st}),Pt=nt(mt,{...ct,gain:0}),kt=it(mt,{...ut,curve:xt}),At=nt(mt,{...ct,gain:0}),Rt=it(mt,{...ut,curve:St});return{connectGraph(){gt.connect(It),gt.connect(Bt.inputs===void 0?Bt:Bt.inputs[0]),It.connect(Tt,0),It.connect(Ut,0),It.connect(Pt,1),It.connect(At,1),Bt.connect(bt),bt.connect($t.inputs===void 0?$t:$t.inputs[0]),bt.connect(Lt.inputs===void 0?Lt:Lt.inputs[0]),bt.connect(kt.inputs===void 0?kt:kt.inputs[0]),bt.connect(Rt.inputs===void 0?Rt:Rt.inputs[0]),$t.connect(Tt.gain),Lt.connect(Ut.gain),kt.connect(Pt.gain),Rt.connect(At.gain),Tt.connect(yt,0,0),Pt.connect(yt,0,0),Ut.connect(yt,0,1),At.connect(yt,0,1)},disconnectGraph(){gt.disconnect(It),gt.disconnect(Bt.inputs===void 0?Bt:Bt.inputs[0]),It.disconnect(Tt,0),It.disconnect(Ut,0),It.disconnect(Pt,1),It.disconnect(At,1),Bt.disconnect(bt),bt.disconnect($t.inputs===void 0?$t:$t.inputs[0]),bt.disconnect(Lt.inputs===void 0?Lt:Lt.inputs[0]),bt.disconnect(kt.inputs===void 0?kt:kt.inputs[0]),bt.disconnect(Rt.inputs===void 0?Rt:Rt.inputs[0]),$t.disconnect(Tt.gain),Lt.disconnect(Ut.gain),kt.disconnect(Pt.gain),Rt.disconnect(At.gain),Tt.disconnect(yt,0,0),Pt.disconnect(yt,0,0),Ut.disconnect(yt,0,1),At.disconnect(yt,0,1)}}},pt=(mt,gt,bt,yt,wt)=>{if(gt===1)return ht(mt,bt,yt,wt);if(gt===2)return dt(mt,bt,yt,wt);throw rt()};return(mt,{channelCount:gt,channelCountMode:bt,pan:yt,...wt})=>{if(bt==="max")throw rt();const vt=tt(mt,{...wt,channelCount:1,channelCountMode:bt,numberOfInputs:2}),xt=nt(mt,{...wt,channelCount:gt,channelCountMode:bt,gain:1}),St=nt(mt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:yt});let{connectGraph:Et,disconnectGraph:It}=pt(mt,gt,xt,St,vt);Object.defineProperty(St.gain,"defaultValue",{get:()=>0}),Object.defineProperty(St.gain,"maxValue",{get:()=>1}),Object.defineProperty(St.gain,"minValue",{get:()=>-1});const Tt={get bufferSize(){},get channelCount(){return xt.channelCount},set channelCount(Bt){xt.channelCount!==Bt&&($t&&It(),{connectGraph:Et,disconnectGraph:It}=pt(mt,Bt,xt,St,vt),$t&&Et()),xt.channelCount=Bt},get channelCountMode(){return xt.channelCountMode},set channelCountMode(Bt){if(Bt==="clamped-max"||Bt==="max")throw rt();xt.channelCountMode=Bt},get channelInterpretation(){return xt.channelInterpretation},set channelInterpretation(Bt){xt.channelInterpretation=Bt},get context(){return xt.context},get inputs(){return[xt]},get numberOfInputs(){return xt.numberOfInputs},get numberOfOutputs(){return xt.numberOfOutputs},get pan(){return St.gain},addEventListener(...Bt){return xt.addEventListener(Bt[0],Bt[1],Bt[2])},dispatchEvent(...Bt){return xt.dispatchEvent(Bt[0])},removeEventListener(...Bt){return xt.removeEventListener(Bt[0],Bt[1],Bt[2])}};let $t=!1;const Ut=()=>{Et(),$t=!0},Lt=()=>{It(),$t=!1};return ot(interceptConnections(Tt,vt),Ut,Lt)}},createNativeWaveShaperNodeFactory=(tt,et,nt,it,rt,ot,at)=>(st,lt)=>{const ct=st.createWaveShaper();if(ot!==null&&ot.name==="webkitAudioContext"&&st.createGain().gain.automationRate===void 0)return nt(st,lt);assignNativeAudioNodeOptions(ct,lt);const ut=lt.curve===null||lt.curve instanceof Float32Array?lt.curve:new Float32Array(lt.curve);if(ut!==null&&ut.length<2)throw et();assignNativeAudioNodeOption(ct,{curve:ut},"curve"),assignNativeAudioNodeOption(ct,lt,"oversample");let ht=null,dt=!1;return at(ct,"curve",gt=>()=>gt.call(ct),gt=>bt=>(gt.call(ct,bt),dt&&(it(bt)&&ht===null?ht=tt(st,ct):!it(bt)&&ht!==null&&(ht(),ht=null)),bt)),rt(ct,()=>{dt=!0,it(ct.curve)&&(ht=tt(st,ct))},()=>{dt=!1,ht!==null&&(ht(),ht=null)})},createNativeWaveShaperNodeFakerFactory=(tt,et,nt,it,rt)=>(ot,{curve:at,oversample:st,...lt})=>{const ct=ot.createWaveShaper(),ut=ot.createWaveShaper();assignNativeAudioNodeOptions(ct,lt),assignNativeAudioNodeOptions(ut,lt);const ht=nt(ot,{...lt,gain:1}),dt=nt(ot,{...lt,gain:-1}),pt=nt(ot,{...lt,gain:1}),mt=nt(ot,{...lt,gain:-1});let gt=null,bt=!1,yt=null;const wt={get bufferSize(){},get channelCount(){return ct.channelCount},set channelCount(St){ht.channelCount=St,dt.channelCount=St,ct.channelCount=St,pt.channelCount=St,ut.channelCount=St,mt.channelCount=St},get channelCountMode(){return ct.channelCountMode},set channelCountMode(St){ht.channelCountMode=St,dt.channelCountMode=St,ct.channelCountMode=St,pt.channelCountMode=St,ut.channelCountMode=St,mt.channelCountMode=St},get channelInterpretation(){return ct.channelInterpretation},set channelInterpretation(St){ht.channelInterpretation=St,dt.channelInterpretation=St,ct.channelInterpretation=St,pt.channelInterpretation=St,ut.channelInterpretation=St,mt.channelInterpretation=St},get context(){return ct.context},get curve(){return yt},set curve(St){if(St!==null&&St.length<2)throw et();if(St===null)ct.curve=St,ut.curve=St;else{const Et=St.length,It=new Float32Array(Et+2-Et%2),Tt=new Float32Array(Et+2-Et%2);It[0]=St[0],Tt[0]=-St[Et-1];const $t=Math.ceil((Et+1)/2),Ut=(Et+1)/2-1;for(let Lt=1;Lt<$t;Lt+=1){const Bt=Lt/$t*Ut,Pt=Math.floor(Bt),kt=Math.ceil(Bt);It[Lt]=Pt===kt?St[Pt]:(1-(Bt-Pt))*St[Pt]+(1-(kt-Bt))*St[kt],Tt[Lt]=Pt===kt?-St[Et-1-Pt]:-((1-(Bt-Pt))*St[Et-1-Pt])-(1-(kt-Bt))*St[Et-1-kt]}It[$t]=Et%2===1?St[$t-1]:(St[$t-2]+St[$t-1])/2,ct.curve=It,ut.curve=Tt}yt=St,bt&&(it(yt)&>===null?gt=tt(ot,ht):gt!==null&&(gt(),gt=null))},get inputs(){return[ht]},get numberOfInputs(){return ct.numberOfInputs},get numberOfOutputs(){return ct.numberOfOutputs},get oversample(){return ct.oversample},set oversample(St){ct.oversample=St,ut.oversample=St},addEventListener(...St){return ht.addEventListener(St[0],St[1],St[2])},dispatchEvent(...St){return ht.dispatchEvent(St[0])},removeEventListener(...St){return ht.removeEventListener(St[0],St[1],St[2])}};at!==null&&(wt.curve=at instanceof Float32Array?at:new Float32Array(at)),st!==wt.oversample&&(wt.oversample=st);const vt=()=>{ht.connect(ct).connect(pt),ht.connect(dt).connect(ut).connect(mt).connect(pt),bt=!0,it(yt)&&(gt=tt(ot,ht))},xt=()=>{ht.disconnect(ct),ct.disconnect(pt),ht.disconnect(dt),dt.disconnect(ut),ut.disconnect(mt),mt.disconnect(pt),bt=!1,gt!==null&&(gt(),gt=null)};return rt(interceptConnections(wt,pt),vt,xt)},createNotSupportedError=()=>new DOMException("","NotSupportedError"),DEFAULT_OPTIONS$5={numberOfChannels:1},createOfflineAudioContextConstructor=(tt,et,nt,it,rt)=>class extends tt{constructor(at,st,lt){let ct;if(typeof at=="number"&&st!==void 0&<!==void 0)ct={length:st,numberOfChannels:at,sampleRate:lt};else if(typeof at=="object")ct=at;else throw new Error("The given parameters are not valid.");const{length:ut,numberOfChannels:ht,sampleRate:dt}={...DEFAULT_OPTIONS$5,...ct},pt=it(ht,ut,dt);et(testPromiseSupport,()=>testPromiseSupport(pt))||pt.addEventListener("statechange",(()=>{let mt=0;const gt=bt=>{this._state==="running"&&(mt>0?(pt.removeEventListener("statechange",gt),bt.stopImmediatePropagation(),this._waitForThePromiseToSettle(bt)):mt+=1)};return gt})()),super(pt,ht),this._length=ut,this._nativeOfflineAudioContext=pt,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(nt()):(this._state="running",rt(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,deactivateAudioGraph(this)}))}_waitForThePromiseToSettle(at){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(at):setTimeout(()=>this._waitForThePromiseToSettle(at))}},DEFAULT_OPTIONS$4={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},createOscillatorNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS$4,...ct},dt=nt(ut,ht),pt=ot(ut),mt=pt?it():null,gt=lt.sampleRate/2;super(lt,!1,dt,mt),this._detune=et(this,pt,dt.detune,153600,-153600),this._frequency=et(this,pt,dt.frequency,gt,-gt),this._nativeOscillatorNode=dt,this._onended=null,this._oscillatorNodeRenderer=mt,this._oscillatorNodeRenderer!==null&&ht.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=ht.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(lt){const ct=typeof lt=="function"?at(this,lt):null;this._nativeOscillatorNode.onended=ct;const ut=this._nativeOscillatorNode.onended;this._onended=ut!==null&&ut===ct?lt:ut}get type(){return this._nativeOscillatorNode.type}set type(lt){this._nativeOscillatorNode.type=lt,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(lt){this._nativeOscillatorNode.setPeriodicWave(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=lt)}start(lt=0){if(this._nativeOscillatorNode.start(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=lt),this.context.state!=="closed"){setInternalStateToActive(this);const ct=()=>{this._nativeOscillatorNode.removeEventListener("ended",ct),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeOscillatorNode.addEventListener("ended",ct)}}stop(lt=0){this._nativeOscillatorNode.stop(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=lt)}},createOscillatorNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap;let at=null,st=null,lt=null;const ct=async(ut,ht)=>{let dt=nt(ut);const pt=isOwnedByContext(dt,ht);if(!pt){const mt={channelCount:dt.channelCount,channelCountMode:dt.channelCountMode,channelInterpretation:dt.channelInterpretation,detune:dt.detune.value,frequency:dt.frequency.value,periodicWave:at===null?void 0:at,type:dt.type};dt=et(ht,mt),st!==null&&dt.start(st),lt!==null&&dt.stop(lt)}return ot.set(ht,dt),pt?(await tt(ht,ut.detune,dt.detune),await tt(ht,ut.frequency,dt.frequency)):(await it(ht,ut.detune,dt.detune),await it(ht,ut.frequency,dt.frequency)),await rt(ut,ht,dt),dt};return{set periodicWave(ut){at=ut},set start(ut){st=ut},set stop(ut){lt=ut},render(ut,ht){const dt=ot.get(ht);return dt!==void 0?Promise.resolve(dt):ct(ut,ht)}}},DEFAULT_OPTIONS$3={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},createPannerNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS$3,...ct},dt=nt(ut,ht),pt=ot(ut),mt=pt?it():null;super(lt,!1,dt,mt),this._nativePannerNode=dt,this._orientationX=et(this,pt,dt.orientationX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationY=et(this,pt,dt.orientationY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationZ=et(this,pt,dt.orientationZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionX=et(this,pt,dt.positionX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionY=et(this,pt,dt.positionY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionZ=et(this,pt,dt.positionZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),at(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(lt){this._nativePannerNode.coneInnerAngle=lt}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(lt){this._nativePannerNode.coneOuterAngle=lt}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(lt){this._nativePannerNode.coneOuterGain=lt}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(lt){this._nativePannerNode.distanceModel=lt}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(lt){this._nativePannerNode.maxDistance=lt}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(lt){this._nativePannerNode.panningModel=lt}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(lt){this._nativePannerNode.refDistance=lt}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(lt){this._nativePannerNode.rolloffFactor=lt}},createPannerNodeRendererFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct)=>()=>{const ut=new WeakMap;let ht=null;const dt=async(pt,mt)=>{let gt=null,bt=ot(pt);const yt={channelCount:bt.channelCount,channelCountMode:bt.channelCountMode,channelInterpretation:bt.channelInterpretation},wt={...yt,coneInnerAngle:bt.coneInnerAngle,coneOuterAngle:bt.coneOuterAngle,coneOuterGain:bt.coneOuterGain,distanceModel:bt.distanceModel,maxDistance:bt.maxDistance,panningModel:bt.panningModel,refDistance:bt.refDistance,rolloffFactor:bt.rolloffFactor},vt=isOwnedByContext(bt,mt);if("bufferSize"in bt)gt=it(mt,{...yt,gain:1});else if(!vt){const xt={...wt,orientationX:bt.orientationX.value,orientationY:bt.orientationY.value,orientationZ:bt.orientationZ.value,positionX:bt.positionX.value,positionY:bt.positionY.value,positionZ:bt.positionZ.value};bt=rt(mt,xt)}if(ut.set(mt,gt===null?bt:gt),gt!==null){if(ht===null){if(at===null)throw new Error("Missing the native OfflineAudioContext constructor.");const Lt=new at(6,pt.context.length,mt.sampleRate),Bt=et(Lt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});Bt.connect(Lt.destination),ht=(async()=>{const Pt=await Promise.all([pt.orientationX,pt.orientationY,pt.orientationZ,pt.positionX,pt.positionY,pt.positionZ].map(async(kt,At)=>{const Rt=nt(Lt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:At===0?1:0});return await st(Lt,kt,Rt.offset),Rt}));for(let kt=0;kt<6;kt+=1)Pt[kt].connect(Bt,0,kt),Pt[kt].start(0);return ct(Lt)})()}const xt=await ht,St=it(mt,{...yt,gain:1});await lt(pt,mt,St);const Et=[];for(let Lt=0;Ltkt!==It[At])||Pt.some((kt,At)=>kt!==Tt[At])){It=Bt,Tt=Pt;const kt=Lt/mt.sampleRate;$t.gain.setValueAtTime(0,kt),$t=it(mt,{...yt,gain:0}),Ut=rt(mt,{...wt,orientationX:It[0],orientationY:It[1],orientationZ:It[2],positionX:Tt[0],positionY:Tt[1],positionZ:Tt[2]}),$t.gain.setValueAtTime(1,kt),St.connect($t).connect(Ut.inputs[0]),Ut.connect(gt)}}return gt}return vt?(await tt(mt,pt.orientationX,bt.orientationX),await tt(mt,pt.orientationY,bt.orientationY),await tt(mt,pt.orientationZ,bt.orientationZ),await tt(mt,pt.positionX,bt.positionX),await tt(mt,pt.positionY,bt.positionY),await tt(mt,pt.positionZ,bt.positionZ)):(await st(mt,pt.orientationX,bt.orientationX),await st(mt,pt.orientationY,bt.orientationY),await st(mt,pt.orientationZ,bt.orientationZ),await st(mt,pt.positionX,bt.positionX),await st(mt,pt.positionY,bt.positionY),await st(mt,pt.positionZ,bt.positionZ)),isNativeAudioNodeFaker(bt)?await lt(pt,mt,bt.inputs[0]):await lt(pt,mt,bt),bt};return{render(pt,mt){const gt=ut.get(mt);return gt!==void 0?Promise.resolve(gt):dt(pt,mt)}}},DEFAULT_OPTIONS$2={disableNormalization:!1},createPeriodicWaveConstructor=(tt,et,nt,it)=>class kw{constructor(ot,at){const st=et(ot),lt=it({...DEFAULT_OPTIONS$2,...at}),ct=tt(st,lt);return nt.add(ct),ct}static[Symbol.hasInstance](ot){return ot!==null&&typeof ot=="object"&&Object.getPrototypeOf(ot)===kw.prototype||nt.has(ot)}},createRenderAutomation=(tt,et)=>(nt,it,rt)=>(tt(it).replay(rt),et(it,nt,rt)),createRenderInputsOfAudioNode=(tt,et,nt)=>async(it,rt,ot)=>{const at=tt(it);await Promise.all(at.activeInputs.map((st,lt)=>Array.from(st).map(async([ct,ut])=>{const dt=await et(ct).render(ct,rt),pt=it.context.destination;!nt(ct)&&(it!==pt||!nt(it))&&dt.connect(ot,ut,lt)})).reduce((st,lt)=>[...st,...lt],[]))},createRenderInputsOfAudioParam=(tt,et,nt)=>async(it,rt,ot)=>{const at=et(it);await Promise.all(Array.from(at.activeInputs).map(async([st,lt])=>{const ut=await tt(st).render(st,rt);nt(st)||ut.connect(ot,lt)}))},createRenderNativeOfflineAudioContext=(tt,et,nt,it)=>rt=>tt(testPromiseSupport,()=>testPromiseSupport(rt))?Promise.resolve(tt(it,it)).then(ot=>{if(!ot){const at=nt(rt,512,0,1);rt.oncomplete=()=>{at.onaudioprocess=null,at.disconnect()},at.onaudioprocess=()=>rt.currentTime,at.connect(rt.destination)}return rt.startRendering()}):new Promise(ot=>{const at=et(rt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});rt.oncomplete=st=>{at.disconnect(),ot(st.renderedBuffer)},at.connect(rt.destination),rt.startRendering()}),createSetActiveAudioWorkletNodeInputs=tt=>(et,nt)=>{tt.set(et,nt)},createSetAudioNodeTailTime=tt=>(et,nt)=>tt.set(et,nt),createStartRendering=(tt,et,nt,it,rt,ot,at,st)=>(lt,ct)=>nt(lt).render(lt,ct).then(()=>Promise.all(Array.from(it(ct)).map(ut=>nt(ut).render(ut,ct)))).then(()=>rt(ct)).then(ut=>(typeof ut.copyFromChannel!="function"?(at(ut),wrapAudioBufferGetChannelDataMethod(ut)):et(ot,()=>ot(ut))||st(ut),tt.add(ut),ut)),DEFAULT_OPTIONS$1={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},createStereoPannerNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut={...DEFAULT_OPTIONS$1,...lt},ht=nt(ct,ut),dt=ot(ct),pt=dt?it():null;super(st,!1,ht,pt),this._pan=et(this,dt,ht.pan)}get pan(){return this._pan}},createStereoPannerNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,pan:ct.pan.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?await tt(lt,st.pan,ct.pan):await it(lt,st.pan,ct.pan),isNativeAudioNodeFaker(ct)?await rt(st,lt,ct.inputs[0]):await rt(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createTestAudioBufferConstructorSupport=tt=>()=>{if(tt===null)return!1;try{new tt({length:1,sampleRate:44100})}catch{return!1}return!0},createTestAudioWorkletProcessorPostMessageSupport=(tt,et)=>async()=>{if(tt===null)return!0;if(et===null)return!1;const nt=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"}),it=new et(1,128,44100),rt=URL.createObjectURL(nt);let ot=!1,at=!1;try{await it.audioWorklet.addModule(rt);const st=new tt(it,"a",{numberOfOutputs:0}),lt=it.createOscillator();st.port.onmessage=()=>ot=!0,st.onprocessorerror=()=>at=!0,lt.connect(st),lt.start(0),await it.startRendering(),await new Promise(ct=>setTimeout(ct))}catch{}finally{URL.revokeObjectURL(rt)}return ot&&!at},createTestOfflineAudioContextCurrentTimeSupport=(tt,et)=>()=>{if(et===null)return Promise.resolve(!1);const nt=new et(1,1,44100),it=tt(nt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(rt=>{nt.oncomplete=()=>{it.disconnect(),rt(nt.currentTime!==0)},nt.startRendering()})},createUnknownError=()=>new DOMException("","UnknownError"),DEFAULT_OPTIONS={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},createWaveShaperNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS,...ct},dt=nt(ut,ht),mt=ot(ut)?it():null;super(lt,!0,dt,mt),this._isCurveNullified=!1,this._nativeWaveShaperNode=dt,at(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(lt){if(lt===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(lt.length<2)throw et();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=lt}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(lt){this._nativeWaveShaperNode.oversample=lt}},createWaveShaperNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,curve:st.curve,oversample:st.oversample};st=tt(at,ct)}return it.set(at,st),isNativeAudioNodeFaker(st)?await nt(ot,at,st.inputs[0]):await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},createWindow=()=>typeof window>"u"?null:window,createWrapAudioBufferCopyChannelMethods=(tt,et)=>nt=>{nt.copyFromChannel=(it,rt,ot=0)=>{const at=tt(ot),st=tt(rt);if(st>=nt.numberOfChannels)throw et();const lt=nt.length,ct=nt.getChannelData(st),ut=it.length;for(let ht=at<0?-at:0;ht+at{const at=tt(ot),st=tt(rt);if(st>=nt.numberOfChannels)throw et();const lt=nt.length,ct=nt.getChannelData(st),ut=it.length;for(let ht=at<0?-at:0;ht+atet=>{et.copyFromChannel=(nt=>(it,rt,ot=0)=>{const at=tt(ot),st=tt(rt);if(at(it,rt,ot=0)=>{const at=tt(ot),st=tt(rt);if(at(et,nt)=>{const it=nt.createBuffer(1,1,44100);et.buffer===null&&(et.buffer=it),tt(et,"buffer",rt=>()=>{const ot=rt.call(et);return ot===it?null:ot},rt=>ot=>rt.call(et,ot===null?it:ot))},createWrapChannelMergerNode=(tt,et)=>(nt,it)=>{it.channelCount=1,it.channelCountMode="explicit",Object.defineProperty(it,"channelCount",{get:()=>1,set:()=>{throw tt()}}),Object.defineProperty(it,"channelCountMode",{get:()=>"explicit",set:()=>{throw tt()}});const rt=nt.createBufferSource();et(it,()=>{const st=it.numberOfInputs;for(let lt=0;ltrt.disconnect(it))},getFirstSample=(tt,et,nt)=>tt.copyFromChannel===void 0?tt.getChannelData(nt)[0]:(tt.copyFromChannel(et,nt),et[0]),isDCCurve=tt=>{if(tt===null)return!1;const et=tt.length;return et%2!==0?tt[Math.floor(et/2)]!==0:tt[et/2-1]+tt[et/2]!==0},overwriteAccessors=(tt,et,nt,it)=>{let rt=tt;for(;!rt.hasOwnProperty(et);)rt=Object.getPrototypeOf(rt);const{get:ot,set:at}=Object.getOwnPropertyDescriptor(rt,et);Object.defineProperty(tt,et,{get:nt(ot),set:it(at)})},sanitizeAudioWorkletNodeOptions=tt=>({...tt,outputChannelCount:tt.outputChannelCount!==void 0?tt.outputChannelCount:tt.numberOfInputs===1&&tt.numberOfOutputs===1?[tt.channelCount]:Array.from({length:tt.numberOfOutputs},()=>1)}),sanitizeChannelSplitterOptions=tt=>({...tt,channelCount:tt.numberOfOutputs}),sanitizePeriodicWaveOptions=tt=>{const{imag:et,real:nt}=tt;return et===void 0?nt===void 0?{...tt,imag:[0,0],real:[0,0]}:{...tt,imag:Array.from(nt,()=>0),real:nt}:nt===void 0?{...tt,imag:et,real:Array.from(et,()=>0)}:{...tt,imag:et,real:nt}},setValueAtTimeUntilPossible=(tt,et,nt)=>{try{tt.setValueAtTime(et,nt)}catch(it){if(it.code!==9)throw it;setValueAtTimeUntilPossible(tt,et,nt+1e-7)}},testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport=tt=>{const et=tt.createBufferSource();et.start();try{et.start()}catch{return!0}return!1},testAudioBufferSourceNodeStartMethodOffsetClampingSupport=tt=>{const et=tt.createBufferSource(),nt=tt.createBuffer(1,1,44100);et.buffer=nt;try{et.start(0,1)}catch{return!1}return!0},testAudioBufferSourceNodeStopMethodNullifiedBufferSupport=tt=>{const et=tt.createBufferSource();et.start();try{et.stop()}catch{return!1}return!0},testAudioScheduledSourceNodeStartMethodNegativeParametersSupport=tt=>{const et=tt.createOscillator();try{et.start(-1)}catch(nt){return nt instanceof RangeError}return!1},testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport=tt=>{const et=tt.createBuffer(1,1,44100),nt=tt.createBufferSource();nt.buffer=et,nt.start(),nt.stop();try{return nt.stop(),!0}catch{return!1}},testAudioScheduledSourceNodeStopMethodNegativeParametersSupport=tt=>{const et=tt.createOscillator();try{et.stop(-1)}catch(nt){return nt instanceof RangeError}return!1},testAudioWorkletNodeOptionsClonability=tt=>{const{port1:et,port2:nt}=new MessageChannel;try{et.postMessage(tt)}finally{et.close(),nt.close()}},wrapAudioBufferSourceNodeStartMethodOffsetClamping=tt=>{tt.start=(et=>(nt=0,it=0,rt)=>{const ot=tt.buffer,at=ot===null?it:Math.min(ot.duration,it);ot!==null&&at>ot.duration-.5/tt.context.sampleRate?et.call(tt,nt,0,0):et.call(tt,nt,at,rt)})(tt.start)},wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls=(tt,et)=>{const nt=et.createGain();tt.connect(nt);const it=(rt=>()=>{rt.call(tt,nt),tt.removeEventListener("ended",it)})(tt.disconnect);tt.addEventListener("ended",it),interceptConnections(tt,nt),tt.stop=(rt=>{let ot=!1;return(at=0)=>{if(ot)try{rt.call(tt,at)}catch{nt.gain.setValueAtTime(0,at)}else rt.call(tt,at),ot=!0}})(tt.stop)},wrapEventListener=(tt,et)=>nt=>{const it={value:tt};return Object.defineProperties(nt,{currentTarget:it,target:it}),typeof et=="function"?et.call(tt,nt):et.handleEvent.call(tt,nt)},addActiveInputConnectionToAudioNode=createAddActiveInputConnectionToAudioNode(insertElementInSet),addPassiveInputConnectionToAudioNode=createAddPassiveInputConnectionToAudioNode(insertElementInSet),deleteActiveInputConnectionToAudioNode=createDeleteActiveInputConnectionToAudioNode(pickElementFromSet),audioNodeTailTimeStore=new WeakMap,getAudioNodeTailTime=createGetAudioNodeTailTime(audioNodeTailTimeStore),cacheTestResult=createCacheTestResult(new Map,new WeakMap),window$1=createWindow(),createNativeAnalyserNode=createNativeAnalyserNodeFactory(cacheTestResult,createIndexSizeError),getAudioNodeRenderer=createGetAudioNodeRenderer(getAudioNodeConnections),renderInputsOfAudioNode=createRenderInputsOfAudioNode(getAudioNodeConnections,getAudioNodeRenderer,isPartOfACycle),createAnalyserNodeRenderer=createAnalyserNodeRendererFactory(createNativeAnalyserNode,getNativeAudioNode,renderInputsOfAudioNode),getNativeContext=createGetNativeContext(CONTEXT_STORE),nativeOfflineAudioContextConstructor=createNativeOfflineAudioContextConstructor(window$1),isNativeOfflineAudioContext=createIsNativeOfflineAudioContext(nativeOfflineAudioContextConstructor),audioParamAudioNodeStore=new WeakMap,eventTargetConstructor=createEventTargetConstructor(wrapEventListener),nativeAudioContextConstructor=createNativeAudioContextConstructor(window$1),isNativeAudioContext=createIsNativeAudioContext(nativeAudioContextConstructor),isNativeAudioNode=createIsNativeAudioNode(window$1),isNativeAudioParam=createIsNativeAudioParam(window$1),nativeAudioWorkletNodeConstructor=createNativeAudioWorkletNodeConstructor(window$1),audioNodeConstructor=createAudioNodeConstructor(createAddAudioNodeConnections(AUDIO_NODE_CONNECTIONS_STORE),createAddConnectionToAudioNode(addActiveInputConnectionToAudioNode,addPassiveInputConnectionToAudioNode,connectNativeAudioNodeToNativeAudioNode,deleteActiveInputConnectionToAudioNode,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getAudioNodeTailTime,getEventListenersOfAudioNode,getNativeAudioNode,insertElementInSet,isActiveAudioNode,isPartOfACycle,isPassiveAudioNode),cacheTestResult,createIncrementCycleCounterFactory(CYCLE_COUNTERS,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,isActiveAudioNode),createIndexSizeError,createInvalidAccessError,createNotSupportedError,createDecrementCycleCounter(connectNativeAudioNodeToNativeAudioNode,CYCLE_COUNTERS,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,getNativeContext,isActiveAudioNode,isNativeOfflineAudioContext),createDetectCycles(audioParamAudioNodeStore,getAudioNodeConnections,getValueForKey),eventTargetConstructor,getNativeContext,isNativeAudioContext,isNativeAudioNode,isNativeAudioParam,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor),analyserNodeConstructor=createAnalyserNodeConstructor(audioNodeConstructor,createAnalyserNodeRenderer,createIndexSizeError,createNativeAnalyserNode,getNativeContext,isNativeOfflineAudioContext),audioBufferStore=new WeakSet,nativeAudioBufferConstructor=createNativeAudioBufferConstructor(window$1),convertNumberToUnsignedLong=createConvertNumberToUnsignedLong(new Uint32Array(1)),wrapAudioBufferCopyChannelMethods=createWrapAudioBufferCopyChannelMethods(convertNumberToUnsignedLong,createIndexSizeError),wrapAudioBufferCopyChannelMethodsOutOfBounds=createWrapAudioBufferCopyChannelMethodsOutOfBounds(convertNumberToUnsignedLong),audioBufferConstructor=createAudioBufferConstructor(audioBufferStore,cacheTestResult,createNotSupportedError,nativeAudioBufferConstructor,nativeOfflineAudioContextConstructor,createTestAudioBufferConstructorSupport(nativeAudioBufferConstructor),wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),addSilentConnection=createAddSilentConnection(createNativeGainNode),renderInputsOfAudioParam=createRenderInputsOfAudioParam(getAudioNodeRenderer,getAudioParamConnections,isPartOfACycle),connectAudioParam=createConnectAudioParam(renderInputsOfAudioParam),createNativeAudioBufferSourceNode=createNativeAudioBufferSourceNodeFactory(addSilentConnection,cacheTestResult,testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport,testAudioBufferSourceNodeStartMethodOffsetClampingSupport,testAudioBufferSourceNodeStopMethodNullifiedBufferSupport,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioBufferSourceNodeStartMethodOffsetClamping,createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer(overwriteAccessors),wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),renderAutomation=createRenderAutomation(createGetAudioParamRenderer(getAudioParamConnections),renderInputsOfAudioParam),createAudioBufferSourceNodeRenderer=createAudioBufferSourceNodeRendererFactory(connectAudioParam,createNativeAudioBufferSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),createAudioParam=createAudioParamFactory(createAddAudioParamConnections(AUDIO_PARAM_CONNECTIONS_STORE),audioParamAudioNodeStore,AUDIO_PARAM_STORE,createAudioParamRenderer,createCancelAndHoldAutomationEvent,createCancelScheduledValuesAutomationEvent,createExponentialRampToValueAutomationEvent,createLinearRampToValueAutomationEvent,createSetTargetAutomationEvent,createSetValueAutomationEvent,createSetValueCurveAutomationEvent,nativeAudioContextConstructor,setValueAtTimeUntilPossible),audioBufferSourceNodeConstructor=createAudioBufferSourceNodeConstructor(audioNodeConstructor,createAudioBufferSourceNodeRenderer,createAudioParam,createInvalidStateError,createNativeAudioBufferSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),audioDestinationNodeConstructor=createAudioDestinationNodeConstructor(audioNodeConstructor,createAudioDestinationNodeRenderer,createIndexSizeError,createInvalidStateError,createNativeAudioDestinationNodeFactory(createNativeGainNode,overwriteAccessors),getNativeContext,isNativeOfflineAudioContext,renderInputsOfAudioNode),createBiquadFilterNodeRenderer=createBiquadFilterNodeRendererFactory(connectAudioParam,createNativeBiquadFilterNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),setAudioNodeTailTime=createSetAudioNodeTailTime(audioNodeTailTimeStore),biquadFilterNodeConstructor=createBiquadFilterNodeConstructor(audioNodeConstructor,createAudioParam,createBiquadFilterNodeRenderer,createInvalidAccessError,createNativeBiquadFilterNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),monitorConnections=createMonitorConnections(insertElementInSet,isNativeAudioNode),wrapChannelMergerNode=createWrapChannelMergerNode(createInvalidStateError,monitorConnections),createNativeChannelMergerNode=createNativeChannelMergerNodeFactory(nativeAudioContextConstructor,wrapChannelMergerNode),createChannelMergerNodeRenderer=createChannelMergerNodeRendererFactory(createNativeChannelMergerNode,getNativeAudioNode,renderInputsOfAudioNode),channelMergerNodeConstructor=createChannelMergerNodeConstructor(audioNodeConstructor,createChannelMergerNodeRenderer,createNativeChannelMergerNode,getNativeContext,isNativeOfflineAudioContext),createChannelSplitterNodeRenderer=createChannelSplitterNodeRendererFactory(createNativeChannelSplitterNode,getNativeAudioNode,renderInputsOfAudioNode),channelSplitterNodeConstructor=createChannelSplitterNodeConstructor(audioNodeConstructor,createChannelSplitterNodeRenderer,createNativeChannelSplitterNode,getNativeContext,isNativeOfflineAudioContext,sanitizeChannelSplitterOptions),createNativeConstantSourceNodeFaker=createNativeConstantSourceNodeFakerFactory(addSilentConnection,createNativeAudioBufferSourceNode,createNativeGainNode,monitorConnections),createNativeConstantSourceNode=createNativeConstantSourceNodeFactory(addSilentConnection,cacheTestResult,createNativeConstantSourceNodeFaker,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport),createConstantSourceNodeRenderer=createConstantSourceNodeRendererFactory(connectAudioParam,createNativeConstantSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),constantSourceNodeConstructor=createConstantSourceNodeConstructor(audioNodeConstructor,createAudioParam,createConstantSourceNodeRenderer,createNativeConstantSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createNativeConvolverNode=createNativeConvolverNodeFactory(createNotSupportedError,overwriteAccessors),createConvolverNodeRenderer=createConvolverNodeRendererFactory(createNativeConvolverNode,getNativeAudioNode,renderInputsOfAudioNode),convolverNodeConstructor=createConvolverNodeConstructor(audioNodeConstructor,createConvolverNodeRenderer,createNativeConvolverNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createDelayNodeRenderer=createDelayNodeRendererFactory(connectAudioParam,createNativeDelayNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),delayNodeConstructor=createDelayNodeConstructor(audioNodeConstructor,createAudioParam,createDelayNodeRenderer,createNativeDelayNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativeDynamicsCompressorNode=createNativeDynamicsCompressorNodeFactory(createNotSupportedError),createDynamicsCompressorNodeRenderer=createDynamicsCompressorNodeRendererFactory(connectAudioParam,createNativeDynamicsCompressorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),dynamicsCompressorNodeConstructor=createDynamicsCompressorNodeConstructor(audioNodeConstructor,createAudioParam,createDynamicsCompressorNodeRenderer,createNativeDynamicsCompressorNode,createNotSupportedError,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createGainNodeRenderer=createGainNodeRendererFactory(connectAudioParam,createNativeGainNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),gainNodeConstructor=createGainNodeConstructor(audioNodeConstructor,createAudioParam,createGainNodeRenderer,createNativeGainNode,getNativeContext,isNativeOfflineAudioContext),createNativeIIRFilterNodeFaker=createNativeIIRFilterNodeFakerFactory(createInvalidAccessError,createInvalidStateError,createNativeScriptProcessorNode,createNotSupportedError),renderNativeOfflineAudioContext=createRenderNativeOfflineAudioContext(cacheTestResult,createNativeGainNode,createNativeScriptProcessorNode,createTestOfflineAudioContextCurrentTimeSupport(createNativeGainNode,nativeOfflineAudioContextConstructor)),createIIRFilterNodeRenderer=createIIRFilterNodeRendererFactory(createNativeAudioBufferSourceNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderInputsOfAudioNode,renderNativeOfflineAudioContext),createNativeIIRFilterNode=createNativeIIRFilterNodeFactory(createNativeIIRFilterNodeFaker),iIRFilterNodeConstructor=createIIRFilterNodeConstructor(audioNodeConstructor,createNativeIIRFilterNode,createIIRFilterNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createAudioListener=createAudioListenerFactory(createAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeScriptProcessorNode,createNotSupportedError,getFirstSample,isNativeOfflineAudioContext,overwriteAccessors),unrenderedAudioWorkletNodeStore=new WeakMap,minimalBaseAudioContextConstructor=createMinimalBaseAudioContextConstructor(audioDestinationNodeConstructor,createAudioListener,eventTargetConstructor,isNativeOfflineAudioContext,unrenderedAudioWorkletNodeStore,wrapEventListener),createNativeOscillatorNode=createNativeOscillatorNodeFactory(addSilentConnection,cacheTestResult,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),createOscillatorNodeRenderer=createOscillatorNodeRendererFactory(connectAudioParam,createNativeOscillatorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),oscillatorNodeConstructor=createOscillatorNodeConstructor(audioNodeConstructor,createAudioParam,createNativeOscillatorNode,createOscillatorNodeRenderer,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createConnectedNativeAudioBufferSourceNode=createConnectedNativeAudioBufferSourceNodeFactory(createNativeAudioBufferSourceNode),createNativeWaveShaperNodeFaker=createNativeWaveShaperNodeFakerFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeGainNode,isDCCurve,monitorConnections),createNativeWaveShaperNode=createNativeWaveShaperNodeFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeWaveShaperNodeFaker,isDCCurve,monitorConnections,nativeAudioContextConstructor,overwriteAccessors),createNativePannerNodeFaker=createNativePannerNodeFakerFactory(connectNativeAudioNodeToNativeAudioNode,createInvalidStateError,createNativeChannelMergerNode,createNativeGainNode,createNativeScriptProcessorNode,createNativeWaveShaperNode,createNotSupportedError,disconnectNativeAudioNodeFromNativeAudioNode,getFirstSample,monitorConnections),createNativePannerNode=createNativePannerNodeFactory(createNativePannerNodeFaker),createPannerNodeRenderer=createPannerNodeRendererFactory(connectAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeGainNode,createNativePannerNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),pannerNodeConstructor=createPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativePannerNode,createPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativePeriodicWave=createNativePeriodicWaveFactory(createIndexSizeError),periodicWaveConstructor=createPeriodicWaveConstructor(createNativePeriodicWave,getNativeContext,new WeakSet,sanitizePeriodicWaveOptions),nativeStereoPannerNodeFakerFactory=createNativeStereoPannerNodeFakerFactory(createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeGainNode,createNativeWaveShaperNode,createNotSupportedError,monitorConnections),createNativeStereoPannerNode=createNativeStereoPannerNodeFactory(nativeStereoPannerNodeFakerFactory,createNotSupportedError),createStereoPannerNodeRenderer=createStereoPannerNodeRendererFactory(connectAudioParam,createNativeStereoPannerNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),stereoPannerNodeConstructor=createStereoPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativeStereoPannerNode,createStereoPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext),createWaveShaperNodeRenderer=createWaveShaperNodeRendererFactory(createNativeWaveShaperNode,getNativeAudioNode,renderInputsOfAudioNode),waveShaperNodeConstructor=createWaveShaperNodeConstructor(audioNodeConstructor,createInvalidStateError,createNativeWaveShaperNode,createWaveShaperNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),isSecureContext=createIsSecureContext(window$1),exposeCurrentFrameAndCurrentTime=createExposeCurrentFrameAndCurrentTime(window$1),backupOfflineAudioContextStore=new WeakMap,getOrCreateBackupOfflineAudioContext=createGetOrCreateBackupOfflineAudioContext(backupOfflineAudioContextStore,nativeOfflineAudioContextConstructor),addAudioWorkletModule=isSecureContext?createAddAudioWorkletModule(cacheTestResult,createNotSupportedError,createEvaluateSource(window$1),exposeCurrentFrameAndCurrentTime,createFetchSource(createAbortError),getNativeContext,getOrCreateBackupOfflineAudioContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,new WeakMap,new WeakMap,createTestAudioWorkletProcessorPostMessageSupport(nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor),window$1):void 0,isNativeContext=createIsNativeContext(isNativeAudioContext,isNativeOfflineAudioContext),decodeAudioData=createDecodeAudioData(audioBufferStore,cacheTestResult,createDataCloneError,createEncodingError,new WeakSet,getNativeContext,isNativeContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,testPromiseSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),baseAudioContextConstructor=createBaseAudioContextConstructor(addAudioWorkletModule,analyserNodeConstructor,audioBufferConstructor,audioBufferSourceNodeConstructor,biquadFilterNodeConstructor,channelMergerNodeConstructor,channelSplitterNodeConstructor,constantSourceNodeConstructor,convolverNodeConstructor,decodeAudioData,delayNodeConstructor,dynamicsCompressorNodeConstructor,gainNodeConstructor,iIRFilterNodeConstructor,minimalBaseAudioContextConstructor,oscillatorNodeConstructor,pannerNodeConstructor,periodicWaveConstructor,stereoPannerNodeConstructor,waveShaperNodeConstructor),mediaElementAudioSourceNodeConstructor=createMediaElementAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaElementAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioDestinationNodeConstructor=createMediaStreamAudioDestinationNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioDestinationNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioSourceNodeConstructor=createMediaStreamAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),createNativeMediaStreamTrackAudioSourceNode=createNativeMediaStreamTrackAudioSourceNodeFactory(createInvalidStateError,isNativeOfflineAudioContext),mediaStreamTrackAudioSourceNodeConstructor=createMediaStreamTrackAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamTrackAudioSourceNode,getNativeContext),audioContextConstructor=createAudioContextConstructor(baseAudioContextConstructor,createInvalidStateError,createNotSupportedError,createUnknownError,mediaElementAudioSourceNodeConstructor,mediaStreamAudioDestinationNodeConstructor,mediaStreamAudioSourceNodeConstructor,mediaStreamTrackAudioSourceNodeConstructor,nativeAudioContextConstructor),getUnrenderedAudioWorkletNodes=createGetUnrenderedAudioWorkletNodes(unrenderedAudioWorkletNodeStore),addUnrenderedAudioWorkletNode=createAddUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),connectMultipleOutputs=createConnectMultipleOutputs(createIndexSizeError),deleteUnrenderedAudioWorkletNode=createDeleteUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),disconnectMultipleOutputs=createDisconnectMultipleOutputs(createIndexSizeError),activeAudioWorkletNodeInputsStore=new WeakMap,getActiveAudioWorkletNodeInputs=createGetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore,getValueForKey),createNativeAudioWorkletNodeFaker=createNativeAudioWorkletNodeFakerFactory(connectMultipleOutputs,createIndexSizeError,createInvalidStateError,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,createNativeScriptProcessorNode,createNotSupportedError,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getActiveAudioWorkletNodeInputs,monitorConnections),createNativeAudioWorkletNode=createNativeAudioWorkletNodeFactory(createInvalidStateError,createNativeAudioWorkletNodeFaker,createNativeGainNode,createNotSupportedError,monitorConnections),createAudioWorkletNodeRenderer=createAudioWorkletNodeRendererFactory(connectAudioParam,connectMultipleOutputs,createNativeAudioBufferSourceNode,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,deleteUnrenderedAudioWorkletNode,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getNativeAudioNode,nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),getBackupOfflineAudioContext=createGetBackupOfflineAudioContext(backupOfflineAudioContextStore),setActiveAudioWorkletNodeInputs=createSetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore),audioWorkletNodeConstructor=isSecureContext?createAudioWorkletNodeConstructor(addUnrenderedAudioWorkletNode,audioNodeConstructor,createAudioParam,createAudioWorkletNodeRenderer,createNativeAudioWorkletNode,getAudioNodeConnections,getBackupOfflineAudioContext,getNativeContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,sanitizeAudioWorkletNodeOptions,setActiveAudioWorkletNodeInputs,testAudioWorkletNodeOptionsClonability,wrapEventListener):void 0,createNativeOfflineAudioContext=createCreateNativeOfflineAudioContext(createNotSupportedError,nativeOfflineAudioContextConstructor),startRendering=createStartRendering(audioBufferStore,cacheTestResult,getAudioNodeRenderer,getUnrenderedAudioWorkletNodes,renderNativeOfflineAudioContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),offlineAudioContextConstructor=createOfflineAudioContextConstructor(baseAudioContextConstructor,cacheTestResult,createInvalidStateError,createNativeOfflineAudioContext,startRendering),isAnyAudioContext=createIsAnyAudioContext(CONTEXT_STORE,isNativeAudioContext),isAnyAudioNode=createIsAnyAudioNode(AUDIO_NODE_STORE,isNativeAudioNode),isAnyAudioParam=createIsAnyAudioParam(AUDIO_PARAM_STORE,isNativeAudioParam),isAnyOfflineAudioContext=createIsAnyOfflineAudioContext(CONTEXT_STORE,isNativeOfflineAudioContext);function isUndef(tt){return typeof tt>"u"}function isDefined(tt){return!isUndef(tt)}function isFunction(tt){return typeof tt=="function"}function isNumber$4(tt){return typeof tt=="number"}function isObject$6(tt){return Object.prototype.toString.call(tt)==="[object Object]"&&tt.constructor===Object}function isBoolean$2(tt){return typeof tt=="boolean"}function isArray$e(tt){return Array.isArray(tt)}function isString$2(tt){return typeof tt=="string"}function isNote(tt){return isString$2(tt)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(tt)}function assert(tt,et){if(!tt)throw new Error(et)}function assertRange(tt,et,nt=1/0){if(!(et<=tt&&tt<=nt))throw new RangeError(`Value must be within [${et}, ${nt}], got: ${tt}`)}function assertContextRunning(tt){!tt.isOffline&&tt.state!=="running"&&warn$1('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let isInsideScheduledCallback=!1,printedScheduledWarning=!1;function enterScheduledCallback(tt){isInsideScheduledCallback=tt}function assertUsedScheduleTime(tt){isUndef(tt)&&isInsideScheduledCallback&&!printedScheduledWarning&&(printedScheduledWarning=!0,warn$1("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let defaultLogger=console;function log$1(...tt){defaultLogger.log(...tt)}function warn$1(...tt){defaultLogger.warn(...tt)}function createAudioContext(tt){return new audioContextConstructor(tt)}function createOfflineAudioContext(tt,et,nt){return new offlineAudioContextConstructor(tt,et,nt)}const theWindow=typeof self=="object"?self:null,hasAudioContext=theWindow&&(theWindow.hasOwnProperty("AudioContext")||theWindow.hasOwnProperty("webkitAudioContext"));function createAudioWorkletNode(tt,et,nt){return assert(isDefined(audioWorkletNodeConstructor),"This node only works in a secure context (https or localhost)"),new audioWorkletNodeConstructor(tt,et,nt)}class Ticker{constructor(et,nt,it,rt){this._callback=et,this._type=nt,this._minimumUpdateInterval=Math.max(128/(rt||44100),.001),this.updateInterval=it,this._createClock()}_createWorker(){const et=new Blob([` +*/var _win,_doc,_docElement,_pluginInitted,_tempDiv,_recentSetterPlugin,_reverting,_windowExists=function tt(){return typeof window<"u"},_transformProps={},_RAD2DEG=180/Math.PI,_DEG2RAD=Math.PI/180,_atan2=Math.atan2,_bigNum=1e8,_capsExp=/([A-Z])/g,_horizontalExp=/(left|right|width|margin|padding|x)/i,_complexExp=/[\s,\(]\S/,_propertyAliases={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_renderCSSProp=function tt(et,nt){return nt.set(nt.t,nt.p,Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u,nt)},_renderPropWithEnd=function tt(et,nt){return nt.set(nt.t,nt.p,et===1?nt.e:Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u,nt)},_renderCSSPropWithBeginning=function tt(et,nt){return nt.set(nt.t,nt.p,et?Math.round((nt.s+nt.c*et)*1e4)/1e4+nt.u:nt.b,nt)},_renderRoundedCSSProp=function tt(et,nt){var it=nt.s+nt.c*et;nt.set(nt.t,nt.p,~~(it+(it<0?-.5:.5))+nt.u,nt)},_renderNonTweeningValue=function tt(et,nt){return nt.set(nt.t,nt.p,et?nt.e:nt.b,nt)},_renderNonTweeningValueOnlyAtEnd=function tt(et,nt){return nt.set(nt.t,nt.p,et!==1?nt.b:nt.e,nt)},_setterCSSStyle=function tt(et,nt,it){return et.style[nt]=it},_setterCSSProp=function tt(et,nt,it){return et.style.setProperty(nt,it)},_setterTransform=function tt(et,nt,it){return et._gsap[nt]=it},_setterScale=function tt(et,nt,it){return et._gsap.scaleX=et._gsap.scaleY=it},_setterScaleWithRender=function tt(et,nt,it,rt,ot){var at=et._gsap;at.scaleX=at.scaleY=it,at.renderTransform(ot,at)},_setterTransformWithRender=function tt(et,nt,it,rt,ot){var at=et._gsap;at[nt]=it,at.renderTransform(ot,at)},_transformProp="transform",_transformOriginProp=_transformProp+"Origin",_saveStyle=function tt(et,nt){var it=this,rt=this.target,ot=rt.style,at=rt._gsap;if(et in _transformProps&&ot){if(this.tfm=this.tfm||{},et!=="transform")et=_propertyAliases[et]||et,~et.indexOf(",")?et.split(",").forEach(function(st){return it.tfm[st]=_get(rt,st)}):this.tfm[et]=at.x?at[et]:_get(rt,et),et===_transformOriginProp&&(this.tfm.zOrigin=at.zOrigin);else return _propertyAliases.transform.split(",").forEach(function(st){return tt.call(it,st,nt)});if(this.props.indexOf(_transformProp)>=0)return;at.svg&&(this.svgo=rt.getAttribute("data-svg-origin"),this.props.push(_transformOriginProp,nt,"")),et=_transformProp}(ot||nt)&&this.props.push(et,nt,ot[et])},_removeIndependentTransforms=function tt(et){et.translate&&(et.removeProperty("translate"),et.removeProperty("scale"),et.removeProperty("rotate"))},_revertStyle=function tt(){var et=this.props,nt=this.target,it=nt.style,rt=nt._gsap,ot,at;for(ot=0;ot=0?_prefixes[at]:"")+et},_initCore=function tt(){_windowExists()&&window.document&&(_win=window,_doc=_win.document,_docElement=_doc.documentElement,_tempDiv=_createElement("div")||{style:{}},_createElement("div"),_transformProp=_checkPropPrefix(_transformProp),_transformOriginProp=_transformProp+"Origin",_tempDiv.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",_supports3D=!!_checkPropPrefix("perspective"),_reverting=gsap.core.reverting,_pluginInitted=1)},_getBBoxHack=function tt(et){var nt=_createElement("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),it=this.parentNode,rt=this.nextSibling,ot=this.style.cssText,at;if(_docElement.appendChild(nt),nt.appendChild(this),this.style.display="block",et)try{at=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=tt}catch{}else this._gsapBBox&&(at=this._gsapBBox());return it&&(rt?it.insertBefore(this,rt):it.appendChild(this)),_docElement.removeChild(nt),this.style.cssText=ot,at},_getAttributeFallbacks=function tt(et,nt){for(var it=nt.length;it--;)if(et.hasAttribute(nt[it]))return et.getAttribute(nt[it])},_getBBox=function tt(et){var nt;try{nt=et.getBBox()}catch{nt=_getBBoxHack.call(et,!0)}return nt&&(nt.width||nt.height)||et.getBBox===_getBBoxHack||(nt=_getBBoxHack.call(et,!0)),nt&&!nt.width&&!nt.x&&!nt.y?{x:+_getAttributeFallbacks(et,["x","cx","x1"])||0,y:+_getAttributeFallbacks(et,["y","cy","y1"])||0,width:0,height:0}:nt},_isSVG=function tt(et){return!!(et.getCTM&&(!et.parentNode||et.ownerSVGElement)&&_getBBox(et))},_removeProperty=function tt(et,nt){if(nt){var it=et.style,rt;nt in _transformProps&&nt!==_transformOriginProp&&(nt=_transformProp),it.removeProperty?(rt=nt.substr(0,2),(rt==="ms"||nt.substr(0,6)==="webkit")&&(nt="-"+nt),it.removeProperty(rt==="--"?nt:nt.replace(_capsExp,"-$1").toLowerCase())):it.removeAttribute(nt)}},_addNonTweeningPT=function tt(et,nt,it,rt,ot,at){var st=new PropTween(et._pt,nt,it,0,1,at?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue);return et._pt=st,st.b=rt,st.e=ot,et._props.push(it),st},_nonConvertibleUnits={deg:1,rad:1,turn:1},_nonStandardLayouts={grid:1,flex:1},_convertToUnit=function tt(et,nt,it,rt){var ot=parseFloat(it)||0,at=(it+"").trim().substr((ot+"").length)||"px",st=_tempDiv.style,lt=_horizontalExp.test(nt),ct=et.tagName.toLowerCase()==="svg",ut=(ct?"client":"offset")+(lt?"Width":"Height"),ht=100,dt=rt==="px",pt=rt==="%",mt,gt,bt,yt;if(rt===at||!ot||_nonConvertibleUnits[rt]||_nonConvertibleUnits[at])return ot;if(at!=="px"&&!dt&&(ot=tt(et,nt,it,"px")),yt=et.getCTM&&_isSVG(et),(pt||at==="%")&&(_transformProps[nt]||~nt.indexOf("adius")))return mt=yt?et.getBBox()[lt?"width":"height"]:et[ut],_round(pt?ot/mt*ht:ot/100*mt);if(st[lt?"width":"height"]=ht+(dt?at:rt),gt=~nt.indexOf("adius")||rt==="em"&&et.appendChild&&!ct?et:et.parentNode,yt&&(gt=(et.ownerSVGElement||{}).parentNode),(!gt||gt===_doc||!gt.appendChild)&&(gt=_doc.body),bt=gt._gsap,bt&&pt&&bt.width&<&&bt.time===_ticker.time&&!bt.uncache)return _round(ot/bt.width*ht);if(pt&&(nt==="height"||nt==="width")){var wt=et.style[nt];et.style[nt]=ht+rt,mt=et[ut],wt?et.style[nt]=wt:_removeProperty(et,nt)}else(pt||at==="%")&&!_nonStandardLayouts[_getComputedProperty(gt,"display")]&&(st.position=_getComputedProperty(et,"position")),gt===et&&(st.position="static"),gt.appendChild(_tempDiv),mt=_tempDiv[ut],gt.removeChild(_tempDiv),st.position="absolute";return lt&&pt&&(bt=_getCache(gt),bt.time=_ticker.time,bt.width=gt[ut]),_round(dt?mt*ot/ht:mt&&ot?ht/mt*ot:0)},_get=function tt(et,nt,it,rt){var ot;return _pluginInitted||_initCore(),nt in _propertyAliases&&nt!=="transform"&&(nt=_propertyAliases[nt],~nt.indexOf(",")&&(nt=nt.split(",")[0])),_transformProps[nt]&&nt!=="transform"?(ot=_parseTransform(et,rt),ot=nt!=="transformOrigin"?ot[nt]:ot.svg?ot.origin:_firstTwoOnly(_getComputedProperty(et,_transformOriginProp))+" "+ot.zOrigin+"px"):(ot=et.style[nt],(!ot||ot==="auto"||rt||~(ot+"").indexOf("calc("))&&(ot=_specialProps[nt]&&_specialProps[nt](et,nt,it)||_getComputedProperty(et,nt)||_getProperty(et,nt)||(nt==="opacity"?1:0))),it&&!~(ot+"").trim().indexOf(" ")?_convertToUnit(et,nt,ot,it)+it:ot},_tweenComplexCSSString=function tt(et,nt,it,rt){if(!it||it==="none"){var ot=_checkPropPrefix(nt,et,1),at=ot&&_getComputedProperty(et,ot,1);at&&at!==it?(nt=ot,it=at):nt==="borderColor"&&(it=_getComputedProperty(et,"borderTopColor"))}var st=new PropTween(this._pt,et.style,nt,0,1,_renderComplexString),lt=0,ct=0,ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St;if(st.b=it,st.e=rt,it+="",rt+="",rt==="auto"&&(gt=et.style[nt],et.style[nt]=rt,rt=_getComputedProperty(et,nt)||rt,gt?et.style[nt]=gt:_removeProperty(et,nt)),ut=[it,rt],_colorStringFilter(ut),it=ut[0],rt=ut[1],dt=it.match(_numWithUnitExp)||[],St=rt.match(_numWithUnitExp)||[],St.length){for(;ht=_numWithUnitExp.exec(rt);)bt=ht[0],wt=rt.substring(lt,ht.index),mt?mt=(mt+1)%5:(wt.substr(-5)==="rgba("||wt.substr(-5)==="hsla(")&&(mt=1),bt!==(gt=dt[ct++]||"")&&(pt=parseFloat(gt)||0,xt=gt.substr((pt+"").length),bt.charAt(1)==="="&&(bt=_parseRelative(pt,bt)+xt),yt=parseFloat(bt),vt=bt.substr((yt+"").length),lt=_numWithUnitExp.lastIndex-vt.length,vt||(vt=vt||_config.units[nt]||xt,lt===rt.length&&(rt+=vt,st.e+=vt)),xt!==vt&&(pt=_convertToUnit(et,nt,gt,vt)||0),st._pt={_next:st._pt,p:wt||ct===1?wt:",",s:pt,c:yt-pt,m:mt&&mt<4||nt==="zIndex"?Math.round:0});st.c=lt-1;)st=ot[ct],_transformProps[st]&&(lt=1,st=st==="transformOrigin"?_transformOriginProp:_transformProp),_removeProperty(it,st);lt&&(_removeProperty(it,_transformProp),at&&(at.svg&&it.removeAttribute("transform"),_parseTransform(it,1),at.uncache=1,_removeIndependentTransforms(rt)))}},_specialProps={clearProps:function tt(et,nt,it,rt,ot){if(ot.data!=="isFromStart"){var at=et._pt=new PropTween(et._pt,nt,it,0,0,_renderClearProps);return at.u=rt,at.pr=-10,at.tween=ot,et._props.push(it),1}}},_identity2DMatrix=[1,0,0,1,0,0],_rotationalProperties={},_isNullTransform=function tt(et){return et==="matrix(1, 0, 0, 1, 0, 0)"||et==="none"||!et},_getComputedTransformMatrixAsArray=function tt(et){var nt=_getComputedProperty(et,_transformProp);return _isNullTransform(nt)?_identity2DMatrix:nt.substr(7).match(_numExp).map(_round)},_getMatrix=function tt(et,nt){var it=et._gsap||_getCache(et),rt=et.style,ot=_getComputedTransformMatrixAsArray(et),at,st,lt,ct;return it.svg&&et.getAttribute("transform")?(lt=et.transform.baseVal.consolidate().matrix,ot=[lt.a,lt.b,lt.c,lt.d,lt.e,lt.f],ot.join(",")==="1,0,0,1,0,0"?_identity2DMatrix:ot):(ot===_identity2DMatrix&&!et.offsetParent&&et!==_docElement&&!it.svg&&(lt=rt.display,rt.display="block",at=et.parentNode,(!at||!et.offsetParent)&&(ct=1,st=et.nextElementSibling,_docElement.appendChild(et)),ot=_getComputedTransformMatrixAsArray(et),lt?rt.display=lt:_removeProperty(et,"display"),ct&&(st?at.insertBefore(et,st):at?at.appendChild(et):_docElement.removeChild(et))),nt&&ot.length>6?[ot[0],ot[1],ot[4],ot[5],ot[12],ot[13]]:ot)},_applySVGOrigin=function tt(et,nt,it,rt,ot,at){var st=et._gsap,lt=ot||_getMatrix(et,!0),ct=st.xOrigin||0,ut=st.yOrigin||0,ht=st.xOffset||0,dt=st.yOffset||0,pt=lt[0],mt=lt[1],gt=lt[2],bt=lt[3],yt=lt[4],wt=lt[5],vt=nt.split(" "),xt=parseFloat(vt[0])||0,St=parseFloat(vt[1])||0,Et,$t,It,Ft;it?lt!==_identity2DMatrix&&($t=pt*bt-mt*gt)&&(It=xt*(bt/$t)+St*(-gt/$t)+(gt*wt-bt*yt)/$t,Ft=xt*(-mt/$t)+St*(pt/$t)-(pt*wt-mt*yt)/$t,xt=It,St=Ft):(Et=_getBBox(et),xt=Et.x+(~vt[0].indexOf("%")?xt/100*Et.width:xt),St=Et.y+(~(vt[1]||vt[0]).indexOf("%")?St/100*Et.height:St)),rt||rt!==!1&&st.smooth?(yt=xt-ct,wt=St-ut,st.xOffset=ht+(yt*pt+wt*gt)-yt,st.yOffset=dt+(yt*mt+wt*bt)-wt):st.xOffset=st.yOffset=0,st.xOrigin=xt,st.yOrigin=St,st.smooth=!!rt,st.origin=nt,st.originIsAbsolute=!!it,et.style[_transformOriginProp]="0px 0px",at&&(_addNonTweeningPT(at,st,"xOrigin",ct,xt),_addNonTweeningPT(at,st,"yOrigin",ut,St),_addNonTweeningPT(at,st,"xOffset",ht,st.xOffset),_addNonTweeningPT(at,st,"yOffset",dt,st.yOffset)),et.setAttribute("data-svg-origin",xt+" "+St)},_parseTransform=function tt(et,nt){var it=et._gsap||new GSCache(et);if("x"in it&&!nt&&!it.uncache)return it;var rt=et.style,ot=it.scaleX<0,at="px",st="deg",lt=getComputedStyle(et),ct=_getComputedProperty(et,_transformOriginProp)||"0",ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,$t,It,Ft,Ht,zt,Ot,jt,kt,Tt,Ct,Ut,Nt,Bt,Mt,Dt,Pt,Vt,nn,cn;return ut=ht=dt=gt=bt=yt=wt=vt=xt=0,pt=mt=1,it.svg=!!(et.getCTM&&_isSVG(et)),lt.translate&&((lt.translate!=="none"||lt.scale!=="none"||lt.rotate!=="none")&&(rt[_transformProp]=(lt.translate!=="none"?"translate3d("+(lt.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(lt.rotate!=="none"?"rotate("+lt.rotate+") ":"")+(lt.scale!=="none"?"scale("+lt.scale.split(" ").join(",")+") ":"")+(lt[_transformProp]!=="none"?lt[_transformProp]:"")),rt.scale=rt.rotate=rt.translate="none"),$t=_getMatrix(et,it.svg),it.svg&&(it.uncache?(Nt=et.getBBox(),ct=it.xOrigin-Nt.x+"px "+(it.yOrigin-Nt.y)+"px",Ut=""):Ut=!nt&&et.getAttribute("data-svg-origin"),_applySVGOrigin(et,Ut||ct,!!Ut||it.originIsAbsolute,it.smooth!==!1,$t)),St=it.xOrigin||0,Et=it.yOrigin||0,$t!==_identity2DMatrix&&(zt=$t[0],Ot=$t[1],jt=$t[2],kt=$t[3],ut=Tt=$t[4],ht=Ct=$t[5],$t.length===6?(pt=Math.sqrt(zt*zt+Ot*Ot),mt=Math.sqrt(kt*kt+jt*jt),gt=zt||Ot?_atan2(Ot,zt)*_RAD2DEG:0,wt=jt||kt?_atan2(jt,kt)*_RAD2DEG+gt:0,wt&&(mt*=Math.abs(Math.cos(wt*_DEG2RAD))),it.svg&&(ut-=St-(St*zt+Et*jt),ht-=Et-(St*Ot+Et*kt))):(cn=$t[6],Vt=$t[7],Mt=$t[8],Dt=$t[9],Pt=$t[10],nn=$t[11],ut=$t[12],ht=$t[13],dt=$t[14],It=_atan2(cn,Pt),bt=It*_RAD2DEG,It&&(Ft=Math.cos(-It),Ht=Math.sin(-It),Ut=Tt*Ft+Mt*Ht,Nt=Ct*Ft+Dt*Ht,Bt=cn*Ft+Pt*Ht,Mt=Tt*-Ht+Mt*Ft,Dt=Ct*-Ht+Dt*Ft,Pt=cn*-Ht+Pt*Ft,nn=Vt*-Ht+nn*Ft,Tt=Ut,Ct=Nt,cn=Bt),It=_atan2(-jt,Pt),yt=It*_RAD2DEG,It&&(Ft=Math.cos(-It),Ht=Math.sin(-It),Ut=zt*Ft-Mt*Ht,Nt=Ot*Ft-Dt*Ht,Bt=jt*Ft-Pt*Ht,nn=kt*Ht+nn*Ft,zt=Ut,Ot=Nt,jt=Bt),It=_atan2(Ot,zt),gt=It*_RAD2DEG,It&&(Ft=Math.cos(It),Ht=Math.sin(It),Ut=zt*Ft+Ot*Ht,Nt=Tt*Ft+Ct*Ht,Ot=Ot*Ft-zt*Ht,Ct=Ct*Ft-Tt*Ht,zt=Ut,Tt=Nt),bt&&Math.abs(bt)+Math.abs(gt)>359.9&&(bt=gt=0,yt=180-yt),pt=_round(Math.sqrt(zt*zt+Ot*Ot+jt*jt)),mt=_round(Math.sqrt(Ct*Ct+cn*cn)),It=_atan2(Tt,Ct),wt=Math.abs(It)>2e-4?It*_RAD2DEG:0,xt=nn?1/(nn<0?-nn:nn):0),it.svg&&(Ut=et.getAttribute("transform"),it.forceCSS=et.setAttribute("transform","")||!_isNullTransform(_getComputedProperty(et,_transformProp)),Ut&&et.setAttribute("transform",Ut))),Math.abs(wt)>90&&Math.abs(wt)<270&&(ot?(pt*=-1,wt+=gt<=0?180:-180,gt+=gt<=0?180:-180):(mt*=-1,wt+=wt<=0?180:-180)),nt=nt||it.uncache,it.x=ut-((it.xPercent=ut&&(!nt&&it.xPercent||(Math.round(et.offsetWidth/2)===Math.round(-ut)?-50:0)))?et.offsetWidth*it.xPercent/100:0)+at,it.y=ht-((it.yPercent=ht&&(!nt&&it.yPercent||(Math.round(et.offsetHeight/2)===Math.round(-ht)?-50:0)))?et.offsetHeight*it.yPercent/100:0)+at,it.z=dt+at,it.scaleX=_round(pt),it.scaleY=_round(mt),it.rotation=_round(gt)+st,it.rotationX=_round(bt)+st,it.rotationY=_round(yt)+st,it.skewX=wt+st,it.skewY=vt+st,it.transformPerspective=xt+at,(it.zOrigin=parseFloat(ct.split(" ")[2])||!nt&&it.zOrigin||0)&&(rt[_transformOriginProp]=_firstTwoOnly(ct)),it.xOffset=it.yOffset=0,it.force3D=_config.force3D,it.renderTransform=it.svg?_renderSVGTransforms:_supports3D?_renderCSSTransforms:_renderNon3DTransforms,it.uncache=0,it},_firstTwoOnly=function tt(et){return(et=et.split(" "))[0]+" "+et[1]},_addPxTranslate=function tt(et,nt,it){var rt=getUnit(nt);return _round(parseFloat(nt)+parseFloat(_convertToUnit(et,"x",it+"px",rt)))+rt},_renderNon3DTransforms=function tt(et,nt){nt.z="0px",nt.rotationY=nt.rotationX="0deg",nt.force3D=0,_renderCSSTransforms(et,nt)},_zeroDeg="0deg",_zeroPx="0px",_endParenthesis=") ",_renderCSSTransforms=function tt(et,nt){var it=nt||this,rt=it.xPercent,ot=it.yPercent,at=it.x,st=it.y,lt=it.z,ct=it.rotation,ut=it.rotationY,ht=it.rotationX,dt=it.skewX,pt=it.skewY,mt=it.scaleX,gt=it.scaleY,bt=it.transformPerspective,yt=it.force3D,wt=it.target,vt=it.zOrigin,xt="",St=yt==="auto"&&et&&et!==1||yt===!0;if(vt&&(ht!==_zeroDeg||ut!==_zeroDeg)){var Et=parseFloat(ut)*_DEG2RAD,$t=Math.sin(Et),It=Math.cos(Et),Ft;Et=parseFloat(ht)*_DEG2RAD,Ft=Math.cos(Et),at=_addPxTranslate(wt,at,$t*Ft*-vt),st=_addPxTranslate(wt,st,-Math.sin(Et)*-vt),lt=_addPxTranslate(wt,lt,It*Ft*-vt+vt)}bt!==_zeroPx&&(xt+="perspective("+bt+_endParenthesis),(rt||ot)&&(xt+="translate("+rt+"%, "+ot+"%) "),(St||at!==_zeroPx||st!==_zeroPx||lt!==_zeroPx)&&(xt+=lt!==_zeroPx||St?"translate3d("+at+", "+st+", "+lt+") ":"translate("+at+", "+st+_endParenthesis),ct!==_zeroDeg&&(xt+="rotate("+ct+_endParenthesis),ut!==_zeroDeg&&(xt+="rotateY("+ut+_endParenthesis),ht!==_zeroDeg&&(xt+="rotateX("+ht+_endParenthesis),(dt!==_zeroDeg||pt!==_zeroDeg)&&(xt+="skew("+dt+", "+pt+_endParenthesis),(mt!==1||gt!==1)&&(xt+="scale("+mt+", "+gt+_endParenthesis),wt.style[_transformProp]=xt||"translate(0, 0)"},_renderSVGTransforms=function tt(et,nt){var it=nt||this,rt=it.xPercent,ot=it.yPercent,at=it.x,st=it.y,lt=it.rotation,ct=it.skewX,ut=it.skewY,ht=it.scaleX,dt=it.scaleY,pt=it.target,mt=it.xOrigin,gt=it.yOrigin,bt=it.xOffset,yt=it.yOffset,wt=it.forceCSS,vt=parseFloat(at),xt=parseFloat(st),St,Et,$t,It,Ft;lt=parseFloat(lt),ct=parseFloat(ct),ut=parseFloat(ut),ut&&(ut=parseFloat(ut),ct+=ut,lt+=ut),lt||ct?(lt*=_DEG2RAD,ct*=_DEG2RAD,St=Math.cos(lt)*ht,Et=Math.sin(lt)*ht,$t=Math.sin(lt-ct)*-dt,It=Math.cos(lt-ct)*dt,ct&&(ut*=_DEG2RAD,Ft=Math.tan(ct-ut),Ft=Math.sqrt(1+Ft*Ft),$t*=Ft,It*=Ft,ut&&(Ft=Math.tan(ut),Ft=Math.sqrt(1+Ft*Ft),St*=Ft,Et*=Ft)),St=_round(St),Et=_round(Et),$t=_round($t),It=_round(It)):(St=ht,It=dt,Et=$t=0),(vt&&!~(at+"").indexOf("px")||xt&&!~(st+"").indexOf("px"))&&(vt=_convertToUnit(pt,"x",at,"px"),xt=_convertToUnit(pt,"y",st,"px")),(mt||gt||bt||yt)&&(vt=_round(vt+mt-(mt*St+gt*$t)+bt),xt=_round(xt+gt-(mt*Et+gt*It)+yt)),(rt||ot)&&(Ft=pt.getBBox(),vt=_round(vt+rt/100*Ft.width),xt=_round(xt+ot/100*Ft.height)),Ft="matrix("+St+","+Et+","+$t+","+It+","+vt+","+xt+")",pt.setAttribute("transform",Ft),wt&&(pt.style[_transformProp]=Ft)},_addRotationalPropTween=function tt(et,nt,it,rt,ot){var at=360,st=_isString(ot),lt=parseFloat(ot)*(st&&~ot.indexOf("rad")?_RAD2DEG:1),ct=lt-rt,ut=rt+ct+"deg",ht,dt;return st&&(ht=ot.split("_")[1],ht==="short"&&(ct%=at,ct!==ct%(at/2)&&(ct+=ct<0?at:-at)),ht==="cw"&&ct<0?ct=(ct+at*_bigNum)%at-~~(ct/at)*at:ht==="ccw"&&ct>0&&(ct=(ct-at*_bigNum)%at-~~(ct/at)*at)),et._pt=dt=new PropTween(et._pt,nt,it,rt,ct,_renderPropWithEnd),dt.e=ut,dt.u="deg",et._props.push(it),dt},_assign=function tt(et,nt){for(var it in nt)et[it]=nt[it];return et},_addRawTransformPTs=function tt(et,nt,it){var rt=_assign({},it._gsap),ot="perspective,force3D,transformOrigin,svgOrigin",at=it.style,st,lt,ct,ut,ht,dt,pt,mt;rt.svg?(ct=it.getAttribute("transform"),it.setAttribute("transform",""),at[_transformProp]=nt,st=_parseTransform(it,1),_removeProperty(it,_transformProp),it.setAttribute("transform",ct)):(ct=getComputedStyle(it)[_transformProp],at[_transformProp]=nt,st=_parseTransform(it,1),at[_transformProp]=ct);for(lt in _transformProps)ct=rt[lt],ut=st[lt],ct!==ut&&ot.indexOf(lt)<0&&(pt=getUnit(ct),mt=getUnit(ut),ht=pt!==mt?_convertToUnit(it,lt,ct,mt):parseFloat(ct),dt=parseFloat(ut),et._pt=new PropTween(et._pt,st,lt,ht,dt-ht,_renderCSSProp),et._pt.u=mt||0,et._props.push(lt));_assign(st,rt)};_forEachName("padding,margin,Width,Radius",function(tt,et){var nt="Top",it="Right",rt="Bottom",ot="Left",at=(et<3?[nt,it,rt,ot]:[nt+ot,nt+it,rt+it,rt+ot]).map(function(st){return et<2?tt+st:"border"+st+tt});_specialProps[et>1?"border"+tt:tt]=function(st,lt,ct,ut,ht){var dt,pt;if(arguments.length<4)return dt=at.map(function(mt){return _get(st,mt,ct)}),pt=dt.join(" "),pt.split(dt[0]).length===5?dt[0]:pt;dt=(ut+"").split(" "),pt={},at.forEach(function(mt,gt){return pt[mt]=dt[gt]=dt[gt]||dt[(gt-1)/2|0]}),st.init(lt,pt,ht)}});var CSSPlugin={name:"css",register:_initCore,targetTest:function tt(et){return et.style&&et.nodeType},init:function tt(et,nt,it,rt,ot){var at=this._props,st=et.style,lt=it.vars.startAt,ct,ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,$t,It;_pluginInitted||_initCore(),this.styles=this.styles||_getStyleSaver(et),It=this.styles.props,this.tween=it;for(gt in nt)if(gt!=="autoRound"&&(ut=nt[gt],!(_plugins[gt]&&_checkPlugin(gt,nt,it,rt,et,ot)))){if(pt=typeof ut,mt=_specialProps[gt],pt==="function"&&(ut=ut.call(it,rt,et,ot),pt=typeof ut),pt==="string"&&~ut.indexOf("random(")&&(ut=_replaceRandom(ut)),mt)mt(this,et,gt,ut,it)&&($t=1);else if(gt.substr(0,2)==="--")ct=(getComputedStyle(et).getPropertyValue(gt)+"").trim(),ut+="",_colorExp.lastIndex=0,_colorExp.test(ct)||(bt=getUnit(ct),yt=getUnit(ut)),yt?bt!==yt&&(ct=_convertToUnit(et,gt,ct,yt)+yt):bt&&(ut+=bt),this.add(st,"setProperty",ct,ut,rt,ot,0,0,gt),at.push(gt),It.push(gt,0,st[gt]);else if(pt!=="undefined"){if(lt&> in lt?(ct=typeof lt[gt]=="function"?lt[gt].call(it,rt,et,ot):lt[gt],_isString(ct)&&~ct.indexOf("random(")&&(ct=_replaceRandom(ct)),getUnit(ct+"")||ct==="auto"||(ct+=_config.units[gt]||getUnit(_get(et,gt))||""),(ct+"").charAt(1)==="="&&(ct=_get(et,gt))):ct=_get(et,gt),dt=parseFloat(ct),wt=pt==="string"&&ut.charAt(1)==="="&&ut.substr(0,2),wt&&(ut=ut.substr(2)),ht=parseFloat(ut),gt in _propertyAliases&&(gt==="autoAlpha"&&(dt===1&&_get(et,"visibility")==="hidden"&&ht&&(dt=0),It.push("visibility",0,st.visibility),_addNonTweeningPT(this,st,"visibility",dt?"inherit":"hidden",ht?"inherit":"hidden",!ht)),gt!=="scale"&>!=="transform"&&(gt=_propertyAliases[gt],~gt.indexOf(",")&&(gt=gt.split(",")[0]))),vt=gt in _transformProps,vt){if(this.styles.save(gt),xt||(St=et._gsap,St.renderTransform&&!nt.parseTransform||_parseTransform(et,nt.parseTransform),Et=nt.smoothOrigin!==!1&&St.smooth,xt=this._pt=new PropTween(this._pt,st,_transformProp,0,1,St.renderTransform,St,0,-1),xt.dep=1),gt==="scale")this._pt=new PropTween(this._pt,St,"scaleY",St.scaleY,(wt?_parseRelative(St.scaleY,wt+ht):ht)-St.scaleY||0,_renderCSSProp),this._pt.u=0,at.push("scaleY",gt),gt+="X";else if(gt==="transformOrigin"){It.push(_transformOriginProp,0,st[_transformOriginProp]),ut=_convertKeywordsToPercentages(ut),St.svg?_applySVGOrigin(et,ut,0,Et,0,this):(yt=parseFloat(ut.split(" ")[2])||0,yt!==St.zOrigin&&_addNonTweeningPT(this,St,"zOrigin",St.zOrigin,yt),_addNonTweeningPT(this,st,gt,_firstTwoOnly(ct),_firstTwoOnly(ut)));continue}else if(gt==="svgOrigin"){_applySVGOrigin(et,ut,1,Et,0,this);continue}else if(gt in _rotationalProperties){_addRotationalPropTween(this,St,gt,dt,wt?_parseRelative(dt,wt+ut):ut);continue}else if(gt==="smoothOrigin"){_addNonTweeningPT(this,St,"smooth",St.smooth,ut);continue}else if(gt==="force3D"){St[gt]=ut;continue}else if(gt==="transform"){_addRawTransformPTs(this,ut,et);continue}}else gt in st||(gt=_checkPropPrefix(gt)||gt);if(vt||(ht||ht===0)&&(dt||dt===0)&&!_complexExp.test(ut)&> in st)bt=(ct+"").substr((dt+"").length),ht||(ht=0),yt=getUnit(ut)||(gt in _config.units?_config.units[gt]:bt),bt!==yt&&(dt=_convertToUnit(et,gt,ct,yt)),this._pt=new PropTween(this._pt,vt?St:st,gt,dt,(wt?_parseRelative(dt,wt+ht):ht)-dt,!vt&&(yt==="px"||gt==="zIndex")&&nt.autoRound!==!1?_renderRoundedCSSProp:_renderCSSProp),this._pt.u=yt||0,bt!==yt&&yt!=="%"&&(this._pt.b=ct,this._pt.r=_renderCSSPropWithBeginning);else if(gt in st)_tweenComplexCSSString.call(this,et,gt,ct,wt?wt+ut:ut);else if(gt in et)this.add(et,gt,ct||et[gt],wt?wt+ut:ut,rt,ot);else if(gt!=="parseTransform"){_missingPlugin(gt,ut);continue}vt||(gt in st?It.push(gt,0,st[gt]):It.push(gt,1,ct||et[gt])),at.push(gt)}}$t&&_sortPropTweensByPriority(this)},render:function tt(et,nt){if(nt.tween._time||!_reverting())for(var it=nt._pt;it;)it.r(et,it.d),it=it._next;else nt.styles.revert()},get:_get,aliases:_propertyAliases,getSetter:function tt(et,nt,it){var rt=_propertyAliases[nt];return rt&&rt.indexOf(",")<0&&(nt=rt),nt in _transformProps&&nt!==_transformOriginProp&&(et._gsap.x||_get(et,"x"))?it&&_recentSetterPlugin===it?nt==="scale"?_setterScale:_setterTransform:(_recentSetterPlugin=it||{})&&(nt==="scale"?_setterScaleWithRender:_setterTransformWithRender):et.style&&!_isUndefined(et.style[nt])?_setterCSSStyle:~nt.indexOf("-")?_setterCSSProp:_getSetter(et,nt)},core:{_removeProperty,_getMatrix}};gsap.utils.checkPrefix=_checkPropPrefix;gsap.core.getStyleSaver=_getStyleSaver;(function(tt,et,nt,it){var rt=_forEachName(tt+","+et+","+nt,function(ot){_transformProps[ot]=1});_forEachName(et,function(ot){_config.units[ot]="deg",_rotationalProperties[ot]=1}),_propertyAliases[rt[13]]=tt+","+et,_forEachName(it,function(ot){var at=ot.split(":");_propertyAliases[at[1]]=rt[at[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");_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(tt){_config.units[tt]="px"});gsap.registerPlugin(CSSPlugin);var gsapWithCSS=gsap.registerPlugin(CSSPlugin)||gsap;gsapWithCSS.core.Tween;const createRoundedBoxGeometry=(tt,et,nt,it,rt)=>{const ot=new Shape$1,at=1e-5;ot.absarc(at,at,at,-Math.PI/2,-Math.PI,!0),ot.absarc(at,et-it*2,at,Math.PI,Math.PI/2,!0),ot.absarc(tt-it*2,et-it*2,at,Math.PI/2,0,!0),ot.absarc(tt-it*2,at,at,0,-Math.PI/2,!0);const st=new ExtrudeGeometry(ot,{depth:nt-it*2,bevelEnabled:!0,bevelSegments:rt,steps:2,bevelSize:it,bevelThickness:it,curveSegments:rt});st.center();const lt=[],ct=st.getAttribute("normal"),ut=st.getAttribute("position");for(let ht=0;ht.9?(mt=pt.x/tt+.5,gt=1-(pt.z/nt+.5)):Math.abs(dt.x)>.9?(mt=-pt.z/nt+.5,gt=1-(-pt.y/et+.5)):Math.abs(dt.z)>.9&&(mt=pt.x/tt+.5,gt=1-(-pt.y/et+.5)),lt.push(mt,gt)}return st.setAttribute("uv",new Float32BufferAttribute(lt,2)),st};createRoundedBoxGeometry(10,10,10,2,10);const boxGeometry=new BoxGeometry(10,10,10),isMainTopic=tt=>tt.node_type==="topic"&&(tt.scale||1)>5,meshRenderLimit=500,meshRenderRadius=800;let nearbyNodeTimeout=null;const nearbyNodeTimeoutCycle=500,getNearbyNodeIds=(tt,et)=>{if(nearbyNodeTimeout)return null;nearbyNodeTimeout=setTimeout(()=>{nearbyNodeTimeout&&(clearTimeout(nearbyNodeTimeout),nearbyNodeTimeout=null)},nearbyNodeTimeoutCycle);const nt=[];return tt.forEach(rt=>{const ot=et.position.distanceTo(variableVector3$1.set(rt.x,rt.y,rt.z));otrt.distance-ot.distance).slice(0,meshRenderLimit).map(rt=>rt.id)},initialCameraPosition=new Vector3(5e3,600,1600),arriveDistance=100,topicArriveDistance=600,selectionGraphDistance=2e3,selectionGraphCameraPosition={x:172.7392402058252,y:-239.04675366094037,z:-2e3},version$1="14.8.49",createExtendedExponentialRampToValueAutomationEvent=(tt,et,nt)=>({endTime:et,insertTime:nt,type:"exponentialRampToValue",value:tt}),createExtendedLinearRampToValueAutomationEvent=(tt,et,nt)=>({endTime:et,insertTime:nt,type:"linearRampToValue",value:tt}),createSetValueAutomationEvent=(tt,et)=>({startTime:et,type:"setValue",value:tt}),createSetValueCurveAutomationEvent=(tt,et,nt)=>({duration:nt,startTime:et,type:"setValueCurve",values:tt}),getTargetValueAtTime=(tt,et,{startTime:nt,target:it,timeConstant:rt})=>it+(et-it)*Math.exp((nt-tt)/rt),isExponentialRampToValueAutomationEvent=tt=>tt.type==="exponentialRampToValue",isLinearRampToValueAutomationEvent=tt=>tt.type==="linearRampToValue",isAnyRampToValueAutomationEvent=tt=>isExponentialRampToValueAutomationEvent(tt)||isLinearRampToValueAutomationEvent(tt),isSetValueAutomationEvent=tt=>tt.type==="setValue",isSetValueCurveAutomationEvent=tt=>tt.type==="setValueCurve",getValueOfAutomationEventAtIndexAtTime=(tt,et,nt,it)=>{const rt=tt[et];return rt===void 0?it:isAnyRampToValueAutomationEvent(rt)||isSetValueAutomationEvent(rt)?rt.value:isSetValueCurveAutomationEvent(rt)?rt.values[rt.values.length-1]:getTargetValueAtTime(nt,getValueOfAutomationEventAtIndexAtTime(tt,et-1,rt.startTime,it),rt)},getEndTimeAndValueOfPreviousAutomationEvent=(tt,et,nt,it,rt)=>nt===void 0?[it.insertTime,rt]:isAnyRampToValueAutomationEvent(nt)?[nt.endTime,nt.value]:isSetValueAutomationEvent(nt)?[nt.startTime,nt.value]:isSetValueCurveAutomationEvent(nt)?[nt.startTime+nt.duration,nt.values[nt.values.length-1]]:[nt.startTime,getValueOfAutomationEventAtIndexAtTime(tt,et-1,nt.startTime,rt)],isCancelAndHoldAutomationEvent=tt=>tt.type==="cancelAndHold",isCancelScheduledValuesAutomationEvent=tt=>tt.type==="cancelScheduledValues",getEventTime=tt=>isCancelAndHoldAutomationEvent(tt)||isCancelScheduledValuesAutomationEvent(tt)?tt.cancelTime:isExponentialRampToValueAutomationEvent(tt)||isLinearRampToValueAutomationEvent(tt)?tt.endTime:tt.startTime,getExponentialRampValueAtTime=(tt,et,nt,{endTime:it,value:rt})=>nt===rt?rt:0nt+(tt-et)/(it-et)*(rt-nt),interpolateValue=(tt,et)=>{const nt=Math.floor(et),it=Math.ceil(et);return nt===it?tt[nt]:(1-(et-nt))*tt[nt]+(1-(it-et))*tt[it]},getValueCurveValueAtTime=(tt,{duration:et,startTime:nt,values:it})=>{const rt=(tt-nt)/et*(it.length-1);return interpolateValue(it,rt)},isSetTargetAutomationEvent=tt=>tt.type==="setTarget";class AutomationEventList{constructor(et){this._automationEvents=[],this._currenTime=0,this._defaultValue=et}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(et){const nt=getEventTime(et);if(isCancelAndHoldAutomationEvent(et)||isCancelScheduledValuesAutomationEvent(et)){const it=this._automationEvents.findIndex(ot=>isCancelScheduledValuesAutomationEvent(et)&&isSetValueCurveAutomationEvent(ot)?ot.startTime+ot.duration>=nt:getEventTime(ot)>=nt),rt=this._automationEvents[it];if(it!==-1&&(this._automationEvents=this._automationEvents.slice(0,it)),isCancelAndHoldAutomationEvent(et)){const ot=this._automationEvents[this._automationEvents.length-1];if(rt!==void 0&&isAnyRampToValueAutomationEvent(rt)){if(ot!==void 0&&isSetTargetAutomationEvent(ot))throw new Error("The internal list is malformed.");const at=ot===void 0?rt.insertTime:isSetValueCurveAutomationEvent(ot)?ot.startTime+ot.duration:getEventTime(ot),st=ot===void 0?this._defaultValue:isSetValueCurveAutomationEvent(ot)?ot.values[ot.values.length-1]:ot.value,lt=isExponentialRampToValueAutomationEvent(rt)?getExponentialRampValueAtTime(nt,at,st,rt):getLinearRampValueAtTime(nt,at,st,rt),ct=isExponentialRampToValueAutomationEvent(rt)?createExtendedExponentialRampToValueAutomationEvent(lt,nt,this._currenTime):createExtendedLinearRampToValueAutomationEvent(lt,nt,this._currenTime);this._automationEvents.push(ct)}if(ot!==void 0&&isSetTargetAutomationEvent(ot)&&this._automationEvents.push(createSetValueAutomationEvent(this.getValue(nt),nt)),ot!==void 0&&isSetValueCurveAutomationEvent(ot)&&ot.startTime+ot.duration>nt){const at=nt-ot.startTime,st=(ot.values.length-1)/ot.duration,lt=Math.max(2,1+Math.ceil(at*st)),ct=at/(lt-1)*st,ut=ot.values.slice(0,lt);if(ct<1)for(let ht=1;htgetEventTime(at)>nt),rt=it===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[it-1];if(rt!==void 0&&isSetValueCurveAutomationEvent(rt)&&getEventTime(rt)+rt.duration>nt)return!1;const ot=isExponentialRampToValueAutomationEvent(et)?createExtendedExponentialRampToValueAutomationEvent(et.value,et.endTime,this._currenTime):isLinearRampToValueAutomationEvent(et)?createExtendedLinearRampToValueAutomationEvent(et.value,nt,this._currenTime):et;if(it===-1)this._automationEvents.push(ot);else{if(isSetValueCurveAutomationEvent(et)&&nt+et.duration>getEventTime(this._automationEvents[it]))return!1;this._automationEvents.splice(it,0,ot)}}return!0}flush(et){const nt=this._automationEvents.findIndex(it=>getEventTime(it)>et);if(nt>1){const it=this._automationEvents.slice(nt-1),rt=it[0];isSetTargetAutomationEvent(rt)&&it.unshift(createSetValueAutomationEvent(getValueOfAutomationEventAtIndexAtTime(this._automationEvents,nt-2,rt.startTime,this._defaultValue),rt.startTime)),this._automationEvents=it}}getValue(et){if(this._automationEvents.length===0)return this._defaultValue;const nt=this._automationEvents.findIndex(at=>getEventTime(at)>et),it=this._automationEvents[nt],rt=(nt===-1?this._automationEvents.length:nt)-1,ot=this._automationEvents[rt];if(ot!==void 0&&isSetTargetAutomationEvent(ot)&&(it===void 0||!isAnyRampToValueAutomationEvent(it)||it.insertTime>et))return getTargetValueAtTime(et,getValueOfAutomationEventAtIndexAtTime(this._automationEvents,rt-1,ot.startTime,this._defaultValue),ot);if(ot!==void 0&&isSetValueAutomationEvent(ot)&&(it===void 0||!isAnyRampToValueAutomationEvent(it)))return ot.value;if(ot!==void 0&&isSetValueCurveAutomationEvent(ot)&&(it===void 0||!isAnyRampToValueAutomationEvent(it)||ot.startTime+ot.duration>et))return et({cancelTime:tt,type:"cancelAndHold"}),createCancelScheduledValuesAutomationEvent=tt=>({cancelTime:tt,type:"cancelScheduledValues"}),createExponentialRampToValueAutomationEvent=(tt,et)=>({endTime:et,type:"exponentialRampToValue",value:tt}),createLinearRampToValueAutomationEvent=(tt,et)=>({endTime:et,type:"linearRampToValue",value:tt}),createSetTargetAutomationEvent=(tt,et,nt)=>({startTime:et,target:tt,timeConstant:nt,type:"setTarget"}),createAbortError=()=>new DOMException("","AbortError"),createAddActiveInputConnectionToAudioNode=tt=>(et,nt,[it,rt,ot],at)=>{tt(et[rt],[nt,it,ot],st=>st[0]===nt&&st[1]===it,at)},createAddAudioNodeConnections=tt=>(et,nt,it)=>{const rt=[];for(let ot=0;ot(et,nt)=>{tt.set(et,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:nt})},ACTIVE_AUDIO_NODE_STORE=new WeakSet,AUDIO_NODE_CONNECTIONS_STORE=new WeakMap,AUDIO_NODE_STORE=new WeakMap,AUDIO_PARAM_CONNECTIONS_STORE=new WeakMap,AUDIO_PARAM_STORE=new WeakMap,CONTEXT_STORE=new WeakMap,EVENT_LISTENERS=new WeakMap,CYCLE_COUNTERS=new WeakMap,NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS=new WeakMap,NODE_TO_PROCESSOR_MAPS=new WeakMap,handler={construct(){return handler}},isConstructible=tt=>{try{const et=new Proxy(tt,handler);new et}catch{return!1}return!0},IMPORT_STATEMENT_REGEX=/^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]*);?/,splitImportStatements=(tt,et)=>{const nt=[];let it=tt.replace(/^[\s]+/,""),rt=it.match(IMPORT_STATEMENT_REGEX);for(;rt!==null;){const ot=rt[1].slice(1,-1),at=rt[0].replace(/([\s]+)?;?$/,"").replace(ot,new URL(ot,et).toString());nt.push(at),it=it.slice(rt[0].length).replace(/^[\s]+/,""),rt=it.match(IMPORT_STATEMENT_REGEX)}return[nt.join(";"),it]},verifyParameterDescriptors=tt=>{if(tt!==void 0&&!Array.isArray(tt))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},verifyProcessorCtor=tt=>{if(!isConstructible(tt))throw new TypeError("The given value for processorCtor should be a constructor.");if(tt.prototype===null||typeof tt.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},createAddAudioWorkletModule=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt)=>{let pt=0;return(mt,gt,bt={credentials:"omit"})=>{const yt=ut.get(mt);if(yt!==void 0&&yt.has(gt))return Promise.resolve();const wt=ct.get(mt);if(wt!==void 0){const St=wt.get(gt);if(St!==void 0)return St}const vt=ot(mt),xt=vt.audioWorklet===void 0?rt(gt).then(([St,Et])=>{const[$t,It]=splitImportStatements(St,Et),Ft=`${$t};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${It} +})})(window,'_AWGS')`;return nt(Ft)}).then(()=>{const St=dt._AWGS.pop();if(St===void 0)throw new SyntaxError;it(vt.currentTime,vt.sampleRate,()=>St(class{},void 0,(Et,$t)=>{if(Et.trim()==="")throw et();const It=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(vt);if(It!==void 0){if(It.has(Et))throw et();verifyProcessorCtor($t),verifyParameterDescriptors($t.parameterDescriptors),It.set(Et,$t)}else verifyProcessorCtor($t),verifyParameterDescriptors($t.parameterDescriptors),NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.set(vt,new Map([[Et,$t]]))},vt.sampleRate,void 0,void 0))}):Promise.all([rt(gt),Promise.resolve(tt(ht,ht))]).then(([[St,Et],$t])=>{const It=pt+1;pt=It;const[Ft,Ht]=splitImportStatements(St,Et),kt=`${Ft};((AudioWorkletProcessor,registerProcessor)=>{${Ht} +})(${$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${It}',class extends AudioWorkletProcessor{process(){return !1}})`,Tt=new Blob([kt],{type:"application/javascript; charset=utf-8"}),Ct=URL.createObjectURL(Tt);return vt.audioWorklet.addModule(Ct,bt).then(()=>{if(st(vt))return vt;const Ut=at(vt);return Ut.audioWorklet.addModule(Ct,bt).then(()=>Ut)}).then(Ut=>{if(lt===null)throw new SyntaxError;try{new lt(Ut,`__sac${It}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(Ct))});return wt===void 0?ct.set(mt,new Map([[gt,xt]])):wt.set(gt,xt),xt.then(()=>{const St=ut.get(mt);St===void 0?ut.set(mt,new Set([gt])):St.add(gt)}).finally(()=>{const St=ct.get(mt);St!==void 0&&St.delete(gt)}),xt}},getValueForKey=(tt,et)=>{const nt=tt.get(et);if(nt===void 0)throw new Error("A value with the given key could not be found.");return nt},pickElementFromSet=(tt,et)=>{const nt=Array.from(tt).filter(et);if(nt.length>1)throw Error("More than one element was found.");if(nt.length===0)throw Error("No element was found.");const[it]=nt;return tt.delete(it),it},deletePassiveInputConnectionToAudioNode=(tt,et,nt,it)=>{const rt=getValueForKey(tt,et),ot=pickElementFromSet(rt,at=>at[0]===nt&&at[1]===it);return rt.size===0&&tt.delete(et),ot},getEventListenersOfAudioNode=tt=>getValueForKey(EVENT_LISTENERS,tt),setInternalStateToActive=tt=>{if(ACTIVE_AUDIO_NODE_STORE.has(tt))throw new Error("The AudioNode is already stored.");ACTIVE_AUDIO_NODE_STORE.add(tt),getEventListenersOfAudioNode(tt).forEach(et=>et(!0))},isAudioWorkletNode=tt=>"port"in tt,setInternalStateToPassive=tt=>{if(!ACTIVE_AUDIO_NODE_STORE.has(tt))throw new Error("The AudioNode is not stored.");ACTIVE_AUDIO_NODE_STORE.delete(tt),getEventListenersOfAudioNode(tt).forEach(et=>et(!1))},setInternalStateToPassiveWhenNecessary=(tt,et)=>{!isAudioWorkletNode(tt)&&et.every(nt=>nt.size===0)&&setInternalStateToPassive(tt)},createAddConnectionToAudioNode=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt)=>{const pt=new WeakMap;return(mt,gt,bt,yt,wt)=>{const{activeInputs:vt,passiveInputs:xt}=ot(gt),{outputs:St}=ot(mt),Et=st(mt),$t=It=>{const Ft=lt(gt),Ht=lt(mt);if(It){const zt=deletePassiveInputConnectionToAudioNode(xt,mt,bt,yt);tt(vt,mt,zt,!1),!wt&&!ht(mt)&&nt(Ht,Ft,bt,yt),dt(gt)&&setInternalStateToActive(gt)}else{const zt=it(vt,mt,bt,yt);et(xt,yt,zt,!1),!wt&&!ht(mt)&&rt(Ht,Ft,bt,yt);const Ot=at(gt);if(Ot===0)ut(gt)&&setInternalStateToPassiveWhenNecessary(gt,vt);else{const jt=pt.get(gt);jt!==void 0&&clearTimeout(jt),pt.set(gt,setTimeout(()=>{ut(gt)&&setInternalStateToPassiveWhenNecessary(gt,vt)},Ot*1e3))}}};return ct(St,[gt,bt,yt],It=>It[0]===gt&&It[1]===bt&&It[2]===yt,!0)?(Et.add($t),ut(mt)?tt(vt,mt,[bt,yt,$t],!0):et(xt,yt,[mt,bt,$t],!0),!0):!1}},createAddPassiveInputConnectionToAudioNode=tt=>(et,nt,[it,rt,ot],at)=>{const st=et.get(it);st===void 0?et.set(it,new Set([[rt,nt,ot]])):tt(st,[rt,nt,ot],lt=>lt[0]===rt&<[1]===nt,at)},createAddSilentConnection=tt=>(et,nt)=>{const it=tt(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});nt.connect(it).connect(et.destination);const rt=()=>{nt.removeEventListener("ended",rt),nt.disconnect(it),it.disconnect()};nt.addEventListener("ended",rt)},createAddUnrenderedAudioWorkletNode=tt=>(et,nt)=>{tt(et).add(nt)},DEFAULT_OPTIONS$j={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},createAnalyserNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut={...DEFAULT_OPTIONS$j,...lt},ht=it(ct,ut),dt=ot(ct)?et():null;super(st,!1,ht,dt),this._nativeAnalyserNode=ht}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(st){this._nativeAnalyserNode.fftSize=st}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(st){const lt=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=st,!(st>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=lt,nt()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(st){const lt=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=st,!(this._nativeAnalyserNode.maxDecibels>st))throw this._nativeAnalyserNode.minDecibels=lt,nt()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(st){this._nativeAnalyserNode.smoothingTimeConstant=st}getByteFrequencyData(st){this._nativeAnalyserNode.getByteFrequencyData(st)}getByteTimeDomainData(st){this._nativeAnalyserNode.getByteTimeDomainData(st)}getFloatFrequencyData(st){this._nativeAnalyserNode.getFloatFrequencyData(st)}getFloatTimeDomainData(st){this._nativeAnalyserNode.getFloatTimeDomainData(st)}},isOwnedByContext=(tt,et)=>tt.context===et,createAnalyserNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,fftSize:st.fftSize,maxDecibels:st.maxDecibels,minDecibels:st.minDecibels,smoothingTimeConstant:st.smoothingTimeConstant};st=tt(at,ct)}return it.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},testAudioBufferCopyChannelMethodsOutOfBoundsSupport=tt=>{try{tt.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},createIndexSizeError=()=>new DOMException("","IndexSizeError"),wrapAudioBufferGetChannelDataMethod=tt=>{tt.getChannelData=(et=>nt=>{try{return et.call(tt,nt)}catch(it){throw it.code===12?createIndexSizeError():it}})(tt.getChannelData)},DEFAULT_OPTIONS$i={numberOfChannels:1},createAudioBufferConstructor=(tt,et,nt,it,rt,ot,at,st)=>{let lt=null;return class xw{constructor(ut){if(rt===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:ht,numberOfChannels:dt,sampleRate:pt}={...DEFAULT_OPTIONS$i,...ut};lt===null&&(lt=new rt(1,1,44100));const mt=it!==null&&et(ot,ot)?new it({length:ht,numberOfChannels:dt,sampleRate:pt}):lt.createBuffer(dt,ht,pt);if(mt.numberOfChannels===0)throw nt();return typeof mt.copyFromChannel!="function"?(at(mt),wrapAudioBufferGetChannelDataMethod(mt)):et(testAudioBufferCopyChannelMethodsOutOfBoundsSupport,()=>testAudioBufferCopyChannelMethodsOutOfBoundsSupport(mt))||st(mt),tt.add(mt),mt}static[Symbol.hasInstance](ut){return ut!==null&&typeof ut=="object"&&Object.getPrototypeOf(ut)===xw.prototype||tt.has(ut)}}},MOST_NEGATIVE_SINGLE_FLOAT=-34028234663852886e22,MOST_POSITIVE_SINGLE_FLOAT=-MOST_NEGATIVE_SINGLE_FLOAT,isActiveAudioNode=tt=>ACTIVE_AUDIO_NODE_STORE.has(tt),DEFAULT_OPTIONS$h={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},createAudioBufferSourceNodeConstructor=(tt,et,nt,it,rt,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$h,...ut},pt=rt(ht,dt),mt=at(ht),gt=mt?et():null;super(ct,!1,pt,gt),this._audioBufferSourceNodeRenderer=gt,this._isBufferNullified=!1,this._isBufferSet=dt.buffer!==null,this._nativeAudioBufferSourceNode=pt,this._onended=null,this._playbackRate=nt(this,mt,pt.playbackRate,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(ct){if(this._nativeAudioBufferSourceNode.buffer=ct,ct!==null){if(this._isBufferSet)throw it();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(ct){this._nativeAudioBufferSourceNode.loop=ct}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(ct){this._nativeAudioBufferSourceNode.loopEnd=ct}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(ct){this._nativeAudioBufferSourceNode.loopStart=ct}get onended(){return this._onended}set onended(ct){const ut=typeof ct=="function"?st(this,ct):null;this._nativeAudioBufferSourceNode.onended=ut;const ht=this._nativeAudioBufferSourceNode.onended;this._onended=ht!==null&&ht===ut?ct:ht}get playbackRate(){return this._playbackRate}start(ct=0,ut=0,ht){if(this._nativeAudioBufferSourceNode.start(ct,ut,ht),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=ht===void 0?[ct,ut]:[ct,ut,ht]),this.context.state!=="closed"){setInternalStateToActive(this);const dt=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",dt),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",dt)}}stop(ct=0){this._nativeAudioBufferSourceNode.stop(ct),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=ct)}},createAudioBufferSourceNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap;let at=null,st=null;const lt=async(ct,ut)=>{let ht=nt(ct);const dt=isOwnedByContext(ht,ut);if(!dt){const pt={buffer:ht.buffer,channelCount:ht.channelCount,channelCountMode:ht.channelCountMode,channelInterpretation:ht.channelInterpretation,loop:ht.loop,loopEnd:ht.loopEnd,loopStart:ht.loopStart,playbackRate:ht.playbackRate.value};ht=et(ut,pt),at!==null&&ht.start(...at),st!==null&&ht.stop(st)}return ot.set(ut,ht),dt?await tt(ut,ct.playbackRate,ht.playbackRate):await it(ut,ct.playbackRate,ht.playbackRate),await rt(ct,ut,ht),ht};return{set start(ct){at=ct},set stop(ct){st=ct},render(ct,ut){const ht=ot.get(ut);return ht!==void 0?Promise.resolve(ht):lt(ct,ut)}}},isAudioBufferSourceNode=tt=>"playbackRate"in tt,isBiquadFilterNode=tt=>"frequency"in tt&&"gain"in tt,isConstantSourceNode=tt=>"offset"in tt,isGainNode=tt=>!("frequency"in tt)&&"gain"in tt,isOscillatorNode=tt=>"detune"in tt&&"frequency"in tt,isStereoPannerNode=tt=>"pan"in tt,getAudioNodeConnections=tt=>getValueForKey(AUDIO_NODE_CONNECTIONS_STORE,tt),getAudioParamConnections=tt=>getValueForKey(AUDIO_PARAM_CONNECTIONS_STORE,tt),deactivateActiveAudioNodeInputConnections=(tt,et)=>{const{activeInputs:nt}=getAudioNodeConnections(tt);nt.forEach(rt=>rt.forEach(([ot])=>{et.includes(tt)||deactivateActiveAudioNodeInputConnections(ot,[...et,tt])}));const it=isAudioBufferSourceNode(tt)?[tt.playbackRate]:isAudioWorkletNode(tt)?Array.from(tt.parameters.values()):isBiquadFilterNode(tt)?[tt.Q,tt.detune,tt.frequency,tt.gain]:isConstantSourceNode(tt)?[tt.offset]:isGainNode(tt)?[tt.gain]:isOscillatorNode(tt)?[tt.detune,tt.frequency]:isStereoPannerNode(tt)?[tt.pan]:[];for(const rt of it){const ot=getAudioParamConnections(rt);ot!==void 0&&ot.activeInputs.forEach(([at])=>deactivateActiveAudioNodeInputConnections(at,et))}isActiveAudioNode(tt)&&setInternalStateToPassive(tt)},deactivateAudioGraph=tt=>{deactivateActiveAudioNodeInputConnections(tt.destination,[])},isValidLatencyHint=tt=>tt===void 0||typeof tt=="number"||typeof tt=="string"&&(tt==="balanced"||tt==="interactive"||tt==="playback"),createAudioContextConstructor=(tt,et,nt,it,rt,ot,at,st,lt)=>class extends tt{constructor(ut={}){if(lt===null)throw new Error("Missing the native AudioContext constructor.");let ht;try{ht=new lt(ut)}catch(mt){throw mt.code===12&&mt.message==="sampleRate is not in range"?nt():mt}if(ht===null)throw it();if(!isValidLatencyHint(ut.latencyHint))throw new TypeError(`The provided value '${ut.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(ut.sampleRate!==void 0&&ht.sampleRate!==ut.sampleRate)throw nt();super(ht,2);const{latencyHint:dt}=ut,{sampleRate:pt}=ht;if(this._baseLatency=typeof ht.baseLatency=="number"?ht.baseLatency:dt==="balanced"?512/pt:dt==="interactive"||dt===void 0?256/pt:dt==="playback"?1024/pt:Math.max(2,Math.min(128,Math.round(dt*pt/128)))*128/pt,this._nativeAudioContext=ht,lt.name==="webkitAudioContext"?(this._nativeGainNode=ht.createGain(),this._nativeOscillatorNode=ht.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(ht.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,ht.state==="running"){this._state="suspended";const mt=()=>{this._state==="suspended"&&(this._state=null),ht.removeEventListener("statechange",mt)};ht.addEventListener("statechange",mt)}}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 et()}):(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()),deactivateAudioGraph(this)}))}createMediaElementSource(ut){return new rt(this,{mediaElement:ut})}createMediaStreamDestination(){return new ot(this)}createMediaStreamSource(ut){return new at(this,{mediaStream:ut})}createMediaStreamTrackSource(ut){return new st(this,{mediaStreamTrack:ut})}resume(){return this._state==="suspended"?new Promise((ut,ht)=>{const dt=()=>{this._nativeAudioContext.removeEventListener("statechange",dt),this._nativeAudioContext.state==="running"?ut():this.resume().then(ut,ht)};this._nativeAudioContext.addEventListener("statechange",dt)}):this._nativeAudioContext.resume().catch(ut=>{throw ut===void 0||ut.code===15?et():ut})}suspend(){return this._nativeAudioContext.suspend().catch(ut=>{throw ut===void 0?et():ut})}},createAudioDestinationNodeConstructor=(tt,et,nt,it,rt,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt=at(ht),pt=rt(ht,ut,dt),mt=dt?et(st):null;super(ct,!1,pt,mt),this._isNodeOfNativeOfflineAudioContext=dt,this._nativeAudioDestinationNode=pt}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(ct){if(this._isNodeOfNativeOfflineAudioContext)throw it();if(ct>this._nativeAudioDestinationNode.maxChannelCount)throw nt();this._nativeAudioDestinationNode.channelCount=ct}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(ct){if(this._isNodeOfNativeOfflineAudioContext)throw it();this._nativeAudioDestinationNode.channelCountMode=ct}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},createAudioDestinationNodeRenderer=tt=>{const et=new WeakMap,nt=async(it,rt)=>{const ot=rt.destination;return et.set(rt,ot),await tt(it,rt,ot),ot};return{render(it,rt){const ot=et.get(rt);return ot!==void 0?Promise.resolve(ot):nt(it,rt)}}},createAudioListenerFactory=(tt,et,nt,it,rt,ot,at,st)=>(lt,ct)=>{const ut=ct.listener,ht=()=>{const St=new Float32Array(1),Et=et(ct,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),$t=at(ct);let It=!1,Ft=[0,0,-1,0,1,0],Ht=[0,0,0];const zt=()=>{if(It)return;It=!0;const Tt=it(ct,256,9,0);Tt.onaudioprocess=({inputBuffer:Ct})=>{const Ut=[ot(Ct,St,0),ot(Ct,St,1),ot(Ct,St,2),ot(Ct,St,3),ot(Ct,St,4),ot(Ct,St,5)];Ut.some((Bt,Mt)=>Bt!==Ft[Mt])&&(ut.setOrientation(...Ut),Ft=Ut);const Nt=[ot(Ct,St,6),ot(Ct,St,7),ot(Ct,St,8)];Nt.some((Bt,Mt)=>Bt!==Ht[Mt])&&(ut.setPosition(...Nt),Ht=Nt)},Et.connect(Tt)},Ot=Tt=>Ct=>{Ct!==Ft[Tt]&&(Ft[Tt]=Ct,ut.setOrientation(...Ft))},jt=Tt=>Ct=>{Ct!==Ht[Tt]&&(Ht[Tt]=Ct,ut.setPosition(...Ht))},kt=(Tt,Ct,Ut)=>{const Nt=nt(ct,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Ct});Nt.connect(Et,0,Tt),Nt.start(),Object.defineProperty(Nt.offset,"defaultValue",{get(){return Ct}});const Bt=tt({context:lt},$t,Nt.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT);return st(Bt,"value",Mt=>()=>Mt.call(Bt),Mt=>Dt=>{try{Mt.call(Bt,Dt)}catch(Pt){if(Pt.code!==9)throw Pt}zt(),$t&&Ut(Dt)}),Bt.cancelAndHoldAtTime=(Mt=>$t?()=>{throw rt()}:(...Dt)=>{const Pt=Mt.apply(Bt,Dt);return zt(),Pt})(Bt.cancelAndHoldAtTime),Bt.cancelScheduledValues=(Mt=>$t?()=>{throw rt()}:(...Dt)=>{const Pt=Mt.apply(Bt,Dt);return zt(),Pt})(Bt.cancelScheduledValues),Bt.exponentialRampToValueAtTime=(Mt=>$t?()=>{throw rt()}:(...Dt)=>{const Pt=Mt.apply(Bt,Dt);return zt(),Pt})(Bt.exponentialRampToValueAtTime),Bt.linearRampToValueAtTime=(Mt=>$t?()=>{throw rt()}:(...Dt)=>{const Pt=Mt.apply(Bt,Dt);return zt(),Pt})(Bt.linearRampToValueAtTime),Bt.setTargetAtTime=(Mt=>$t?()=>{throw rt()}:(...Dt)=>{const Pt=Mt.apply(Bt,Dt);return zt(),Pt})(Bt.setTargetAtTime),Bt.setValueAtTime=(Mt=>$t?()=>{throw rt()}:(...Dt)=>{const Pt=Mt.apply(Bt,Dt);return zt(),Pt})(Bt.setValueAtTime),Bt.setValueCurveAtTime=(Mt=>$t?()=>{throw rt()}:(...Dt)=>{const Pt=Mt.apply(Bt,Dt);return zt(),Pt})(Bt.setValueCurveAtTime),Bt};return{forwardX:kt(0,0,Ot(0)),forwardY:kt(1,0,Ot(1)),forwardZ:kt(2,-1,Ot(2)),positionX:kt(6,0,jt(0)),positionY:kt(7,0,jt(1)),positionZ:kt(8,0,jt(2)),upX:kt(3,0,Ot(3)),upY:kt(4,1,Ot(4)),upZ:kt(5,0,Ot(5))}},{forwardX:dt,forwardY:pt,forwardZ:mt,positionX:gt,positionY:bt,positionZ:yt,upX:wt,upY:vt,upZ:xt}=ut.forwardX===void 0?ht():ut;return{get forwardX(){return dt},get forwardY(){return pt},get forwardZ(){return mt},get positionX(){return gt},get positionY(){return bt},get positionZ(){return yt},get upX(){return wt},get upY(){return vt},get upZ(){return xt}}},isAudioNode$1=tt=>"context"in tt,isAudioNodeOutputConnection=tt=>isAudioNode$1(tt[0]),insertElementInSet=(tt,et,nt,it)=>{for(const rt of tt)if(nt(rt)){if(it)return!1;throw Error("The set contains at least one similar element.")}return tt.add(et),!0},addActiveInputConnectionToAudioParam=(tt,et,[nt,it],rt)=>{insertElementInSet(tt,[et,nt,it],ot=>ot[0]===et&&ot[1]===nt,rt)},addPassiveInputConnectionToAudioParam=(tt,[et,nt,it],rt)=>{const ot=tt.get(et);ot===void 0?tt.set(et,new Set([[nt,it]])):insertElementInSet(ot,[nt,it],at=>at[0]===nt,rt)},isNativeAudioNodeFaker=tt=>"inputs"in tt,connectNativeAudioNodeToNativeAudioNode=(tt,et,nt,it)=>{if(isNativeAudioNodeFaker(et)){const rt=et.inputs[it];return tt.connect(rt,nt,0),[rt,nt,0]}return tt.connect(et,nt,it),[et,nt,it]},deleteActiveInputConnection=(tt,et,nt)=>{for(const it of tt)if(it[0]===et&&it[1]===nt)return tt.delete(it),it;return null},deleteActiveInputConnectionToAudioParam=(tt,et,nt)=>pickElementFromSet(tt,it=>it[0]===et&&it[1]===nt),deleteEventListenerOfAudioNode=(tt,et)=>{if(!getEventListenersOfAudioNode(tt).delete(et))throw new Error("Missing the expected event listener.")},deletePassiveInputConnectionToAudioParam=(tt,et,nt)=>{const it=getValueForKey(tt,et),rt=pickElementFromSet(it,ot=>ot[0]===nt);return it.size===0&&tt.delete(et),rt},disconnectNativeAudioNodeFromNativeAudioNode=(tt,et,nt,it)=>{isNativeAudioNodeFaker(et)?tt.disconnect(et.inputs[it],nt,0):tt.disconnect(et,nt,it)},getNativeAudioNode=tt=>getValueForKey(AUDIO_NODE_STORE,tt),getNativeAudioParam=tt=>getValueForKey(AUDIO_PARAM_STORE,tt),isPartOfACycle=tt=>CYCLE_COUNTERS.has(tt),isPassiveAudioNode=tt=>!ACTIVE_AUDIO_NODE_STORE.has(tt),testAudioNodeDisconnectMethodSupport=(tt,et)=>new Promise(nt=>{if(et!==null)nt(!0);else{const it=tt.createScriptProcessor(256,1,1),rt=tt.createGain(),ot=tt.createBuffer(1,2,44100),at=ot.getChannelData(0);at[0]=1,at[1]=1;const st=tt.createBufferSource();st.buffer=ot,st.loop=!0,st.connect(it).connect(tt.destination),st.connect(rt),st.disconnect(rt),it.onaudioprocess=lt=>{const ct=lt.inputBuffer.getChannelData(0);Array.prototype.some.call(ct,ut=>ut===1)?nt(!0):nt(!1),st.stop(),it.onaudioprocess=null,st.disconnect(it),it.disconnect(tt.destination)},st.start()}}),visitEachAudioNodeOnce=(tt,et)=>{const nt=new Map;for(const it of tt)for(const rt of it){const ot=nt.get(rt);nt.set(rt,ot===void 0?1:ot+1)}nt.forEach((it,rt)=>et(rt,it))},isNativeAudioNode$1=tt=>"context"in tt,wrapAudioNodeDisconnectMethod=tt=>{const et=new Map;tt.connect=(nt=>(it,rt=0,ot=0)=>{const at=isNativeAudioNode$1(it)?nt(it,rt,ot):nt(it,rt),st=et.get(it);return st===void 0?et.set(it,[{input:ot,output:rt}]):st.every(lt=>lt.input!==ot||lt.output!==rt)&&st.push({input:ot,output:rt}),at})(tt.connect.bind(tt)),tt.disconnect=(nt=>(it,rt,ot)=>{if(nt.apply(tt),it===void 0)et.clear();else if(typeof it=="number")for(const[at,st]of et){const lt=st.filter(ct=>ct.output!==it);lt.length===0?et.delete(at):et.set(at,lt)}else if(et.has(it))if(rt===void 0)et.delete(it);else{const at=et.get(it);if(at!==void 0){const st=at.filter(lt=>lt.output!==rt&&(lt.input!==ot||ot===void 0));st.length===0?et.delete(it):et.set(it,st)}}for(const[at,st]of et)st.forEach(lt=>{isNativeAudioNode$1(at)?tt.connect(at,lt.output,lt.input):tt.connect(at,lt.output)})})(tt.disconnect)},addConnectionToAudioParamOfAudioContext=(tt,et,nt,it)=>{const{activeInputs:rt,passiveInputs:ot}=getAudioParamConnections(et),{outputs:at}=getAudioNodeConnections(tt),st=getEventListenersOfAudioNode(tt),lt=ct=>{const ut=getNativeAudioNode(tt),ht=getNativeAudioParam(et);if(ct){const dt=deletePassiveInputConnectionToAudioParam(ot,tt,nt);addActiveInputConnectionToAudioParam(rt,tt,dt,!1),!it&&!isPartOfACycle(tt)&&ut.connect(ht,nt)}else{const dt=deleteActiveInputConnectionToAudioParam(rt,tt,nt);addPassiveInputConnectionToAudioParam(ot,dt,!1),!it&&!isPartOfACycle(tt)&&ut.disconnect(ht,nt)}};return insertElementInSet(at,[et,nt],ct=>ct[0]===et&&ct[1]===nt,!0)?(st.add(lt),isActiveAudioNode(tt)?addActiveInputConnectionToAudioParam(rt,tt,[nt,lt],!0):addPassiveInputConnectionToAudioParam(ot,[tt,nt,lt],!0),!0):!1},deleteInputConnectionOfAudioNode=(tt,et,nt,it)=>{const{activeInputs:rt,passiveInputs:ot}=getAudioNodeConnections(et),at=deleteActiveInputConnection(rt[it],tt,nt);return at===null?[deletePassiveInputConnectionToAudioNode(ot,tt,nt,it)[2],!1]:[at[2],!0]},deleteInputConnectionOfAudioParam=(tt,et,nt)=>{const{activeInputs:it,passiveInputs:rt}=getAudioParamConnections(et),ot=deleteActiveInputConnection(it,tt,nt);return ot===null?[deletePassiveInputConnectionToAudioParam(rt,tt,nt)[1],!1]:[ot[2],!0]},deleteInputsOfAudioNode=(tt,et,nt,it,rt)=>{const[ot,at]=deleteInputConnectionOfAudioNode(tt,nt,it,rt);if(ot!==null&&(deleteEventListenerOfAudioNode(tt,ot),at&&!et&&!isPartOfACycle(tt)&&disconnectNativeAudioNodeFromNativeAudioNode(getNativeAudioNode(tt),getNativeAudioNode(nt),it,rt)),isActiveAudioNode(nt)){const{activeInputs:st}=getAudioNodeConnections(nt);setInternalStateToPassiveWhenNecessary(nt,st)}},deleteInputsOfAudioParam=(tt,et,nt,it)=>{const[rt,ot]=deleteInputConnectionOfAudioParam(tt,nt,it);rt!==null&&(deleteEventListenerOfAudioNode(tt,rt),ot&&!et&&!isPartOfACycle(tt)&&getNativeAudioNode(tt).disconnect(getNativeAudioParam(nt),it))},deleteAnyConnection=(tt,et)=>{const nt=getAudioNodeConnections(tt),it=[];for(const rt of nt.outputs)isAudioNodeOutputConnection(rt)?deleteInputsOfAudioNode(tt,et,...rt):deleteInputsOfAudioParam(tt,et,...rt),it.push(rt[0]);return nt.outputs.clear(),it},deleteConnectionAtOutput=(tt,et,nt)=>{const it=getAudioNodeConnections(tt),rt=[];for(const ot of it.outputs)ot[1]===nt&&(isAudioNodeOutputConnection(ot)?deleteInputsOfAudioNode(tt,et,...ot):deleteInputsOfAudioParam(tt,et,...ot),rt.push(ot[0]),it.outputs.delete(ot));return rt},deleteConnectionToDestination=(tt,et,nt,it,rt)=>{const ot=getAudioNodeConnections(tt);return Array.from(ot.outputs).filter(at=>at[0]===nt&&(it===void 0||at[1]===it)&&(rt===void 0||at[2]===rt)).map(at=>(isAudioNodeOutputConnection(at)?deleteInputsOfAudioNode(tt,et,...at):deleteInputsOfAudioParam(tt,et,...at),ot.outputs.delete(at),at[0]))},createAudioNodeConstructor=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt,mt,gt)=>class extends ct{constructor(yt,wt,vt,xt){super(vt),this._context=yt,this._nativeAudioNode=vt;const St=ut(yt);ht(St)&&nt(testAudioNodeDisconnectMethodSupport,()=>testAudioNodeDisconnectMethodSupport(St,gt))!==!0&&wrapAudioNodeDisconnectMethod(vt),AUDIO_NODE_STORE.set(this,vt),EVENT_LISTENERS.set(this,new Set),yt.state!=="closed"&&wt&&setInternalStateToActive(this),tt(this,xt,vt)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(yt){this._nativeAudioNode.channelCount=yt}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(yt){this._nativeAudioNode.channelCountMode=yt}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(yt){this._nativeAudioNode.channelInterpretation=yt}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(yt,wt=0,vt=0){if(wt<0||wt>=this._nativeAudioNode.numberOfOutputs)throw rt();const xt=ut(this._context),St=mt(xt);if(dt(yt)||pt(yt))throw ot();if(isAudioNode$1(yt)){const It=getNativeAudioNode(yt);try{const Ht=connectNativeAudioNodeToNativeAudioNode(this._nativeAudioNode,It,wt,vt),zt=isPassiveAudioNode(this);(St||zt)&&this._nativeAudioNode.disconnect(...Ht),this.context.state!=="closed"&&!zt&&isPassiveAudioNode(yt)&&setInternalStateToActive(yt)}catch(Ht){throw Ht.code===12?ot():Ht}if(et(this,yt,wt,vt,St)){const Ht=lt([this],yt);visitEachAudioNodeOnce(Ht,it(St))}return yt}const Et=getNativeAudioParam(yt);if(Et.name==="playbackRate"&&Et.maxValue===1024)throw at();try{this._nativeAudioNode.connect(Et,wt),(St||isPassiveAudioNode(this))&&this._nativeAudioNode.disconnect(Et,wt)}catch(It){throw It.code===12?ot():It}if(addConnectionToAudioParamOfAudioContext(this,yt,wt,St)){const It=lt([this],yt);visitEachAudioNodeOnce(It,it(St))}}disconnect(yt,wt,vt){let xt;const St=ut(this._context),Et=mt(St);if(yt===void 0)xt=deleteAnyConnection(this,Et);else if(typeof yt=="number"){if(yt<0||yt>=this.numberOfOutputs)throw rt();xt=deleteConnectionAtOutput(this,Et,yt)}else{if(wt!==void 0&&(wt<0||wt>=this.numberOfOutputs)||isAudioNode$1(yt)&&vt!==void 0&&(vt<0||vt>=yt.numberOfInputs))throw rt();if(xt=deleteConnectionToDestination(this,Et,yt,wt,vt),xt.length===0)throw ot()}for(const $t of xt){const It=lt([this],$t);visitEachAudioNodeOnce(It,st)}}},createAudioParamFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt)=>(pt,mt,gt,bt=null,yt=null)=>{const wt=gt.value,vt=new AutomationEventList(wt),xt=mt?it(vt):null,St={get defaultValue(){return wt},get maxValue(){return bt===null?gt.maxValue:bt},get minValue(){return yt===null?gt.minValue:yt},get value(){return gt.value},set value(Et){gt.value=Et,St.setValueAtTime(Et,pt.context.currentTime)},cancelAndHoldAtTime(Et){if(typeof gt.cancelAndHoldAtTime=="function")xt===null&&vt.flush(pt.context.currentTime),vt.add(rt(Et)),gt.cancelAndHoldAtTime(Et);else{const $t=Array.from(vt).pop();xt===null&&vt.flush(pt.context.currentTime),vt.add(rt(Et));const It=Array.from(vt).pop();gt.cancelScheduledValues(Et),$t!==It&&It!==void 0&&(It.type==="exponentialRampToValue"?gt.exponentialRampToValueAtTime(It.value,It.endTime):It.type==="linearRampToValue"?gt.linearRampToValueAtTime(It.value,It.endTime):It.type==="setValue"?gt.setValueAtTime(It.value,It.startTime):It.type==="setValueCurve"&>.setValueCurveAtTime(It.values,It.startTime,It.duration))}return St},cancelScheduledValues(Et){return xt===null&&vt.flush(pt.context.currentTime),vt.add(ot(Et)),gt.cancelScheduledValues(Et),St},exponentialRampToValueAtTime(Et,$t){if(Et===0)throw new RangeError;if(!Number.isFinite($t)||$t<0)throw new RangeError;const It=pt.context.currentTime;return xt===null&&vt.flush(It),Array.from(vt).length===0&&(vt.add(ct(wt,It)),gt.setValueAtTime(wt,It)),vt.add(at(Et,$t)),gt.exponentialRampToValueAtTime(Et,$t),St},linearRampToValueAtTime(Et,$t){const It=pt.context.currentTime;return xt===null&&vt.flush(It),Array.from(vt).length===0&&(vt.add(ct(wt,It)),gt.setValueAtTime(wt,It)),vt.add(st(Et,$t)),gt.linearRampToValueAtTime(Et,$t),St},setTargetAtTime(Et,$t,It){return xt===null&&vt.flush(pt.context.currentTime),vt.add(lt(Et,$t,It)),gt.setTargetAtTime(Et,$t,It),St},setValueAtTime(Et,$t){return xt===null&&vt.flush(pt.context.currentTime),vt.add(ct(Et,$t)),gt.setValueAtTime(Et,$t),St},setValueCurveAtTime(Et,$t,It){const Ft=Et instanceof Float32Array?Et:new Float32Array(Et);if(ht!==null&&ht.name==="webkitAudioContext"){const Ht=$t+It,zt=pt.context.sampleRate,Ot=Math.ceil($t*zt),jt=Math.floor(Ht*zt),kt=jt-Ot,Tt=new Float32Array(kt);for(let Ut=0;Ut({replay(et){for(const nt of tt)if(nt.type==="exponentialRampToValue"){const{endTime:it,value:rt}=nt;et.exponentialRampToValueAtTime(rt,it)}else if(nt.type==="linearRampToValue"){const{endTime:it,value:rt}=nt;et.linearRampToValueAtTime(rt,it)}else if(nt.type==="setTarget"){const{startTime:it,target:rt,timeConstant:ot}=nt;et.setTargetAtTime(rt,it,ot)}else if(nt.type==="setValue"){const{startTime:it,value:rt}=nt;et.setValueAtTime(rt,it)}else if(nt.type==="setValueCurve"){const{duration:it,startTime:rt,values:ot}=nt;et.setValueCurveAtTime(ot,rt,it)}else throw new Error("Can't apply an unknown automation.")}});class ReadOnlyMap{constructor(et){this._map=new Map(et)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(et,nt=null){return this._map.forEach((it,rt)=>et.call(nt,it,rt,this))}get(et){return this._map.get(et)}has(et){return this._map.has(et)}keys(){return this._map.keys()}values(){return this._map.values()}}const DEFAULT_OPTIONS$g={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},createAudioWorkletNodeConstructor=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt,pt)=>class extends et{constructor(gt,bt,yt){var wt;const vt=st(gt),xt=lt(vt),St=ut({...DEFAULT_OPTIONS$g,...yt});dt(St);const Et=NODE_NAME_TO_PROCESSOR_CONSTRUCTOR_MAPS.get(vt),$t=Et==null?void 0:Et.get(bt),It=xt||vt.state!=="closed"?vt:(wt=at(vt))!==null&&wt!==void 0?wt:vt,Ft=rt(It,xt?null:gt.baseLatency,ct,bt,$t,St),Ht=xt?it(bt,St,$t):null;super(gt,!0,Ft,Ht);const zt=[];Ft.parameters.forEach((jt,kt)=>{const Tt=nt(this,xt,jt);zt.push([kt,Tt])}),this._nativeAudioWorkletNode=Ft,this._onprocessorerror=null,this._parameters=new ReadOnlyMap(zt),xt&&tt(vt,this);const{activeInputs:Ot}=ot(this);ht(Ft,Ot)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(gt){const bt=typeof gt=="function"?pt(this,gt):null;this._nativeAudioWorkletNode.onprocessorerror=bt;const yt=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=yt!==null&&yt===bt?gt:yt}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function copyFromChannel(tt,et,nt,it,rt){if(typeof tt.copyFromChannel=="function")et[nt].byteLength===0&&(et[nt]=new Float32Array(128)),tt.copyFromChannel(et[nt],it,rt);else{const ot=tt.getChannelData(it);if(et[nt].byteLength===0)et[nt]=ot.slice(rt,rt+128);else{const at=new Float32Array(ot.buffer,rt*Float32Array.BYTES_PER_ELEMENT,128);et[nt].set(at)}}}const copyToChannel=(tt,et,nt,it,rt)=>{typeof tt.copyToChannel=="function"?et[nt].byteLength!==0&&tt.copyToChannel(et[nt],it,rt):et[nt].byteLength!==0&&tt.getChannelData(it).set(et[nt],rt)},createNestedArrays=(tt,et)=>{const nt=[];for(let it=0;it{const nt=getValueForKey(NODE_TO_PROCESSOR_MAPS,tt),it=getNativeAudioNode(et);return getValueForKey(nt,it)},processBuffer=async(tt,et,nt,it,rt,ot,at)=>{const st=et===null?Math.ceil(tt.context.length/128)*128:et.length,lt=it.channelCount*it.numberOfInputs,ct=rt.reduce((bt,yt)=>bt+yt,0),ut=ct===0?null:nt.createBuffer(ct,st,nt.sampleRate);if(ot===void 0)throw new Error("Missing the processor constructor.");const ht=getAudioNodeConnections(tt),dt=await getAudioWorkletProcessor(nt,tt),pt=createNestedArrays(it.numberOfInputs,it.channelCount),mt=createNestedArrays(it.numberOfOutputs,rt),gt=Array.from(tt.parameters.keys()).reduce((bt,yt)=>({...bt,[yt]:new Float32Array(128)}),{});for(let bt=0;bt0&&et!==null)for(let yt=0;yt{copyFromChannel(et,gt,yt,lt+wt,bt)});for(let yt=0;ytht.activeInputs[xt].size===0?[]:vt),wt=at(bt/nt.sampleRate,nt.sampleRate,()=>dt.process(yt,mt,gt));if(ut!==null)for(let vt=0,xt=0;vt(bt,yt,wt)=>{const vt=new WeakMap;let xt=null;const St=async(Et,$t)=>{let It=ut(Et),Ft=null;const Ht=isOwnedByContext(It,$t),zt=Array.isArray(yt.outputChannelCount)?yt.outputChannelCount:Array.from(yt.outputChannelCount);if(ht===null){const Ot=zt.reduce((Ct,Ut)=>Ct+Ut,0),jt=rt($t,{channelCount:Math.max(1,Ot),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,Ot)}),kt=[];for(let Ct=0;Ct{const Dt=new dt(Bt,Math.ceil(Et.context.length/128)*128,$t.sampleRate),Pt=[],Vt=[];for(let Xt=0;Xt{const un=ot(Dt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Xt.value});return await pt(Dt,Xt,un.offset),un})),cn=it(Dt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,Ut+Nt)});for(let Xt=0;Xtmt(Et,Dt,Xt))),gt(Dt)})(),$t,yt,zt,wt,ct)}const Ot=await xt,jt=nt($t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[kt,Tt,Ct]=Ft;Ot!==null&&(jt.buffer=Ot,jt.start(0)),jt.connect(kt);for(let Ut=0,Nt=0;Utclass extends mt{constructor(St,Et){super(St,Et),this._nativeContext=St,this._audioWorklet=tt===void 0?void 0:{addModule:($t,It)=>tt(this,$t,It)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new et(this)}createBiquadFilter(){return new rt(this)}createBuffer(St,Et,$t){return new nt({length:Et,numberOfChannels:St,sampleRate:$t})}createBufferSource(){return new it(this)}createChannelMerger(St=6){return new ot(this,{numberOfInputs:St})}createChannelSplitter(St=6){return new at(this,{numberOfOutputs:St})}createConstantSource(){return new st(this)}createConvolver(){return new lt(this)}createDelay(St=1){return new ut(this,{maxDelayTime:St})}createDynamicsCompressor(){return new ht(this)}createGain(){return new dt(this)}createIIRFilter(St,Et){return new pt(this,{feedback:Et,feedforward:St})}createOscillator(){return new gt(this)}createPanner(){return new bt(this)}createPeriodicWave(St,Et,$t={disableNormalization:!1}){return new yt(this,{...$t,imag:Et,real:St})}createStereoPanner(){return new wt(this)}createWaveShaper(){return new vt(this)}decodeAudioData(St,Et,$t){return ct(this._nativeContext,St).then(It=>(typeof Et=="function"&&Et(It),It),It=>{throw typeof $t=="function"&&$t(It),It})}},DEFAULT_OPTIONS$f={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},createBiquadFilterNodeConstructor=(tt,et,nt,it,rt,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$f,...ut},pt=rt(ht,dt),mt=at(ht),gt=mt?nt():null;super(ct,!1,pt,gt),this._Q=et(this,mt,pt.Q,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._detune=et(this,mt,pt.detune,1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT),-1200*Math.log2(MOST_POSITIVE_SINGLE_FLOAT)),this._frequency=et(this,mt,pt.frequency,ct.sampleRate/2,0),this._gain=et(this,mt,pt.gain,40*Math.log10(MOST_POSITIVE_SINGLE_FLOAT),MOST_NEGATIVE_SINGLE_FLOAT),this._nativeBiquadFilterNode=pt,st(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(ct){this._nativeBiquadFilterNode.type=ct}getFrequencyResponse(ct,ut,ht){try{this._nativeBiquadFilterNode.getFrequencyResponse(ct,ut,ht)}catch(dt){throw dt.code===11?it():dt}if(ct.length!==ut.length||ut.length!==ht.length)throw it()}},createBiquadFilterNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={Q:ct.Q.value,channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,detune:ct.detune.value,frequency:ct.frequency.value,gain:ct.gain.value,type:ct.type};ct=et(lt,ht)}return ot.set(lt,ct),ut?(await tt(lt,st.Q,ct.Q),await tt(lt,st.detune,ct.detune),await tt(lt,st.frequency,ct.frequency),await tt(lt,st.gain,ct.gain)):(await it(lt,st.Q,ct.Q),await it(lt,st.detune,ct.detune),await it(lt,st.frequency,ct.frequency),await it(lt,st.gain,ct.gain)),await rt(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createCacheTestResult=(tt,et)=>(nt,it)=>{const rt=et.get(nt);if(rt!==void 0)return rt;const ot=tt.get(nt);if(ot!==void 0)return ot;try{const at=it();return at instanceof Promise?(tt.set(nt,at),at.catch(()=>!1).then(st=>(tt.delete(nt),et.set(nt,st),st))):(et.set(nt,at),at)}catch{return et.set(nt,!1),!1}},DEFAULT_OPTIONS$e={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},createChannelMergerNodeConstructor=(tt,et,nt,it,rt)=>class extends tt{constructor(at,st){const lt=it(at),ct={...DEFAULT_OPTIONS$e,...st},ut=nt(lt,ct),ht=rt(lt)?et():null;super(at,!1,ut,ht)}},createChannelMergerNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,numberOfInputs:st.numberOfInputs};st=tt(at,ct)}return it.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},DEFAULT_OPTIONS$d={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},createChannelSplitterNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut=ot({...DEFAULT_OPTIONS$d,...lt}),ht=nt(ct,ut),dt=rt(ct)?et():null;super(st,!1,ht,dt)}},createChannelSplitterNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,numberOfOutputs:st.numberOfOutputs};st=tt(at,ct)}return it.set(at,st),await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},createConnectAudioParam=tt=>(et,nt,it)=>tt(nt,et,it),createConnectMultipleOutputs=tt=>(et,nt,it=0,rt=0)=>{const ot=et[it];if(ot===void 0)throw tt();return isNativeAudioNode$1(nt)?ot.connect(nt,0,rt):ot.connect(nt,0)},createConnectedNativeAudioBufferSourceNodeFactory=tt=>(et,nt)=>{const it=tt(et,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),rt=et.createBuffer(1,2,44100);return it.buffer=rt,it.loop=!0,it.connect(nt),it.start(),()=>{it.stop(),it.disconnect(nt)}},DEFAULT_OPTIONS$c={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},createConstantSourceNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS$c,...ct},dt=it(ut,ht),pt=ot(ut),mt=pt?nt():null;super(lt,!1,dt,mt),this._constantSourceNodeRenderer=mt,this._nativeConstantSourceNode=dt,this._offset=et(this,pt,dt.offset,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(lt){const ct=typeof lt=="function"?at(this,lt):null;this._nativeConstantSourceNode.onended=ct;const ut=this._nativeConstantSourceNode.onended;this._onended=ut!==null&&ut===ct?lt:ut}start(lt=0){if(this._nativeConstantSourceNode.start(lt),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=lt),this.context.state!=="closed"){setInternalStateToActive(this);const ct=()=>{this._nativeConstantSourceNode.removeEventListener("ended",ct),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeConstantSourceNode.addEventListener("ended",ct)}}stop(lt=0){this._nativeConstantSourceNode.stop(lt),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=lt)}},createConstantSourceNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap;let at=null,st=null;const lt=async(ct,ut)=>{let ht=nt(ct);const dt=isOwnedByContext(ht,ut);if(!dt){const pt={channelCount:ht.channelCount,channelCountMode:ht.channelCountMode,channelInterpretation:ht.channelInterpretation,offset:ht.offset.value};ht=et(ut,pt),at!==null&&ht.start(at),st!==null&&ht.stop(st)}return ot.set(ut,ht),dt?await tt(ut,ct.offset,ht.offset):await it(ut,ct.offset,ht.offset),await rt(ct,ut,ht),ht};return{set start(ct){at=ct},set stop(ct){st=ct},render(ct,ut){const ht=ot.get(ut);return ht!==void 0?Promise.resolve(ht):lt(ct,ut)}}},createConvertNumberToUnsignedLong=tt=>et=>(tt[0]=et,tt[0]),DEFAULT_OPTIONS$b={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},createConvolverNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut={...DEFAULT_OPTIONS$b,...lt},ht=nt(ct,ut),pt=rt(ct)?et():null;super(st,!1,ht,pt),this._isBufferNullified=!1,this._nativeConvolverNode=ht,ut.buffer!==null&&ot(this,ut.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(st){if(this._nativeConvolverNode.buffer=st,st===null&&this._nativeConvolverNode.buffer!==null){const lt=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=lt.createBuffer(1,1,lt.sampleRate),this._isBufferNullified=!0,ot(this,0)}else this._isBufferNullified=!1,ot(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(st){this._nativeConvolverNode.normalize=st}},createConvolverNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={buffer:st.buffer,channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,disableNormalization:!st.normalize};st=tt(at,ct)}return it.set(at,st),isNativeAudioNodeFaker(st)?await nt(ot,at,st.inputs[0]):await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},createCreateNativeOfflineAudioContext=(tt,et)=>(nt,it,rt)=>{if(et===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new et(nt,it,rt)}catch(ot){throw ot.name==="SyntaxError"?tt():ot}},createDataCloneError=()=>new DOMException("","DataCloneError"),detachArrayBuffer=tt=>{const{port1:et,port2:nt}=new MessageChannel;return new Promise(it=>{const rt=()=>{nt.onmessage=null,et.close(),nt.close(),it()};nt.onmessage=()=>rt();try{et.postMessage(tt,[tt])}catch{}finally{rt()}})},createDecodeAudioData=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut)=>(ht,dt)=>{const pt=at(ht)?ht:ot(ht);if(rt.has(dt)){const mt=nt();return Promise.reject(mt)}try{rt.add(dt)}catch{}return et(lt,()=>lt(pt))?pt.decodeAudioData(dt).then(mt=>(detachArrayBuffer(dt).catch(()=>{}),et(st,()=>st(mt))||ut(mt),tt.add(mt),mt)):new Promise((mt,gt)=>{const bt=async()=>{try{await detachArrayBuffer(dt)}catch{}},yt=wt=>{gt(wt),bt()};try{pt.decodeAudioData(dt,wt=>{typeof wt.copyFromChannel!="function"&&(ct(wt),wrapAudioBufferGetChannelDataMethod(wt)),tt.add(wt),bt().then(()=>mt(wt))},wt=>{yt(wt===null?it():wt)})}catch(wt){yt(wt)}})},createDecrementCycleCounter=(tt,et,nt,it,rt,ot,at,st)=>(lt,ct)=>{const ut=et.get(lt);if(ut===void 0)throw new Error("Missing the expected cycle count.");const ht=ot(lt.context),dt=st(ht);if(ut===ct){if(et.delete(lt),!dt&&at(lt)){const pt=it(lt),{outputs:mt}=nt(lt);for(const gt of mt)if(isAudioNodeOutputConnection(gt)){const bt=it(gt[0]);tt(pt,bt,gt[1],gt[2])}else{const bt=rt(gt[0]);pt.connect(bt,gt[1])}}}else et.set(lt,ut-ct)},DEFAULT_OPTIONS$a={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},createDelayNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS$a,...ct},dt=it(ut,ht),pt=ot(ut),mt=pt?nt(ht.maxDelayTime):null;super(lt,!1,dt,mt),this._delayTime=et(this,pt,dt.delayTime),at(this,ht.maxDelayTime)}get delayTime(){return this._delayTime}},createDelayNodeRendererFactory=(tt,et,nt,it,rt)=>ot=>{const at=new WeakMap,st=async(lt,ct)=>{let ut=nt(lt);const ht=isOwnedByContext(ut,ct);if(!ht){const dt={channelCount:ut.channelCount,channelCountMode:ut.channelCountMode,channelInterpretation:ut.channelInterpretation,delayTime:ut.delayTime.value,maxDelayTime:ot};ut=et(ct,dt)}return at.set(ct,ut),ht?await tt(ct,lt.delayTime,ut.delayTime):await it(ct,lt.delayTime,ut.delayTime),await rt(lt,ct,ut),ut};return{render(lt,ct){const ut=at.get(ct);return ut!==void 0?Promise.resolve(ut):st(lt,ct)}}},createDeleteActiveInputConnectionToAudioNode=tt=>(et,nt,it,rt)=>tt(et[rt],ot=>ot[0]===nt&&ot[1]===it),createDeleteUnrenderedAudioWorkletNode=tt=>(et,nt)=>{tt(et).delete(nt)},isDelayNode=tt=>"delayTime"in tt,createDetectCycles=(tt,et,nt)=>function it(rt,ot){const at=isAudioNode$1(ot)?ot:nt(tt,ot);if(isDelayNode(at))return[];if(rt[0]===at)return[rt];if(rt.includes(at))return[];const{outputs:st}=et(at);return Array.from(st).map(lt=>it([...rt,at],lt[0])).reduce((lt,ct)=>lt.concat(ct),[])},getOutputAudioNodeAtIndex=(tt,et,nt)=>{const it=et[nt];if(it===void 0)throw tt();return it},createDisconnectMultipleOutputs=tt=>(et,nt=void 0,it=void 0,rt=0)=>nt===void 0?et.forEach(ot=>ot.disconnect()):typeof nt=="number"?getOutputAudioNodeAtIndex(tt,et,nt).disconnect():isNativeAudioNode$1(nt)?it===void 0?et.forEach(ot=>ot.disconnect(nt)):rt===void 0?getOutputAudioNodeAtIndex(tt,et,it).disconnect(nt,0):getOutputAudioNodeAtIndex(tt,et,it).disconnect(nt,0,rt):it===void 0?et.forEach(ot=>ot.disconnect(nt)):getOutputAudioNodeAtIndex(tt,et,it).disconnect(nt,0),DEFAULT_OPTIONS$9={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},createDynamicsCompressorNodeConstructor=(tt,et,nt,it,rt,ot,at,st)=>class extends tt{constructor(ct,ut){const ht=ot(ct),dt={...DEFAULT_OPTIONS$9,...ut},pt=it(ht,dt),mt=at(ht),gt=mt?nt():null;super(ct,!1,pt,gt),this._attack=et(this,mt,pt.attack),this._knee=et(this,mt,pt.knee),this._nativeDynamicsCompressorNode=pt,this._ratio=et(this,mt,pt.ratio),this._release=et(this,mt,pt.release),this._threshold=et(this,mt,pt.threshold),st(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(ct){const ut=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=ct,ct>2)throw this._nativeDynamicsCompressorNode.channelCount=ut,rt()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(ct){const ut=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=ct,ct==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=ut,rt()}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}},createDynamicsCompressorNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={attack:ct.attack.value,channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,knee:ct.knee.value,ratio:ct.ratio.value,release:ct.release.value,threshold:ct.threshold.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?(await tt(lt,st.attack,ct.attack),await tt(lt,st.knee,ct.knee),await tt(lt,st.ratio,ct.ratio),await tt(lt,st.release,ct.release),await tt(lt,st.threshold,ct.threshold)):(await it(lt,st.attack,ct.attack),await it(lt,st.knee,ct.knee),await it(lt,st.ratio,ct.ratio),await it(lt,st.release,ct.release),await it(lt,st.threshold,ct.threshold)),await rt(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createEncodingError=()=>new DOMException("","EncodingError"),createEvaluateSource=tt=>et=>new Promise((nt,it)=>{if(tt===null){it(new SyntaxError);return}const rt=tt.document.head;if(rt===null)it(new SyntaxError);else{const ot=tt.document.createElement("script"),at=new Blob([et],{type:"application/javascript"}),st=URL.createObjectURL(at),lt=tt.onerror,ct=()=>{tt.onerror=lt,URL.revokeObjectURL(st)};tt.onerror=(ut,ht,dt,pt,mt)=>{if(ht===st||ht===tt.location.href&&dt===1&&pt===1)return ct(),it(mt),!1;if(lt!==null)return lt(ut,ht,dt,pt,mt)},ot.onerror=()=>{ct(),it(new SyntaxError)},ot.onload=()=>{ct(),nt()},ot.src=st,ot.type="module",rt.appendChild(ot)}}),createEventTargetConstructor=tt=>class{constructor(nt){this._nativeEventTarget=nt,this._listeners=new WeakMap}addEventListener(nt,it,rt){if(it!==null){let ot=this._listeners.get(it);ot===void 0&&(ot=tt(this,it),typeof it=="function"&&this._listeners.set(it,ot)),this._nativeEventTarget.addEventListener(nt,ot,rt)}}dispatchEvent(nt){return this._nativeEventTarget.dispatchEvent(nt)}removeEventListener(nt,it,rt){const ot=it===null?void 0:this._listeners.get(it);this._nativeEventTarget.removeEventListener(nt,ot===void 0?null:ot,rt)}},createExposeCurrentFrameAndCurrentTime=tt=>(et,nt,it)=>{Object.defineProperties(tt,{currentFrame:{configurable:!0,get(){return Math.round(et*nt)}},currentTime:{configurable:!0,get(){return et}}});try{return it()}finally{tt!==null&&(delete tt.currentFrame,delete tt.currentTime)}},createFetchSource=tt=>async et=>{try{const nt=await fetch(et);if(nt.ok)return[await nt.text(),nt.url]}catch{}throw tt()},DEFAULT_OPTIONS$8={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},createGainNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut={...DEFAULT_OPTIONS$8,...lt},ht=it(ct,ut),dt=ot(ct),pt=dt?nt():null;super(st,!1,ht,pt),this._gain=et(this,dt,ht.gain,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT)}get gain(){return this._gain}},createGainNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,gain:ct.gain.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?await tt(lt,st.gain,ct.gain):await it(lt,st.gain,ct.gain),await rt(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createGetActiveAudioWorkletNodeInputs=(tt,et)=>nt=>et(tt,nt),createGetAudioNodeRenderer=tt=>et=>{const nt=tt(et);if(nt.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return nt.renderer},createGetAudioNodeTailTime=tt=>et=>{var nt;return(nt=tt.get(et))!==null&&nt!==void 0?nt:0},createGetAudioParamRenderer=tt=>et=>{const nt=tt(et);if(nt.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return nt.renderer},createGetBackupOfflineAudioContext=tt=>et=>tt.get(et),createInvalidStateError=()=>new DOMException("","InvalidStateError"),createGetNativeContext=tt=>et=>{const nt=tt.get(et);if(nt===void 0)throw createInvalidStateError();return nt},createGetOrCreateBackupOfflineAudioContext=(tt,et)=>nt=>{let it=tt.get(nt);if(it!==void 0)return it;if(et===null)throw new Error("Missing the native OfflineAudioContext constructor.");return it=new et(1,1,44100),tt.set(nt,it),it},createGetUnrenderedAudioWorkletNodes=tt=>et=>{const nt=tt.get(et);if(nt===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return nt},createInvalidAccessError=()=>new DOMException("","InvalidAccessError"),wrapIIRFilterNodeGetFrequencyResponseMethod=tt=>{tt.getFrequencyResponse=(et=>(nt,it,rt)=>{if(nt.length!==it.length||it.length!==rt.length)throw createInvalidAccessError();return et.call(tt,nt,it,rt)})(tt.getFrequencyResponse)},DEFAULT_OPTIONS$7={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},createIIRFilterNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=it(st),ut=rt(ct),ht={...DEFAULT_OPTIONS$7,...lt},dt=et(ct,ut?null:st.baseLatency,ht),pt=ut?nt(ht.feedback,ht.feedforward):null;super(st,!1,dt,pt),wrapIIRFilterNodeGetFrequencyResponseMethod(dt),this._nativeIIRFilterNode=dt,ot(this,1)}getFrequencyResponse(st,lt,ct){return this._nativeIIRFilterNode.getFrequencyResponse(st,lt,ct)}},filterBuffer=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut)=>{const ht=ct.length;let dt=st;for(let pt=0;pt{const rt=nt instanceof Float64Array?nt:new Float64Array(nt),ot=it instanceof Float64Array?it:new Float64Array(it),at=rt.length,st=ot.length,lt=Math.min(at,st);if(rt[0]!==1){for(let mt=0;mt(ot,at)=>{const st=new WeakMap;let lt=null;const ct=async(ut,ht)=>{let dt=null,pt=et(ut);const mt=isOwnedByContext(pt,ht);if(ht.createIIRFilter===void 0?dt=tt(ht,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):mt||(pt=ht.createIIRFilter(at,ot)),st.set(ht,dt===null?pt:dt),dt!==null){if(lt===null){if(nt===null)throw new Error("Missing the native OfflineAudioContext constructor.");const bt=new nt(ut.context.destination.channelCount,ut.context.length,ht.sampleRate);lt=(async()=>{await it(ut,bt,bt.destination);const yt=await rt(bt);return filterFullBuffer(yt,ht,ot,at)})()}const gt=await lt;return dt.buffer=gt,dt.start(0),dt}return await it(ut,ht,pt),pt};return{render(ut,ht){const dt=st.get(ht);return dt!==void 0?Promise.resolve(dt):ct(ut,ht)}}},createIncrementCycleCounterFactory=(tt,et,nt,it,rt,ot)=>at=>(st,lt)=>{const ct=tt.get(st);if(ct===void 0){if(!at&&ot(st)){const ut=it(st),{outputs:ht}=nt(st);for(const dt of ht)if(isAudioNodeOutputConnection(dt)){const pt=it(dt[0]);et(ut,pt,dt[1],dt[2])}else{const pt=rt(dt[0]);ut.disconnect(pt,dt[1])}}tt.set(st,lt)}else tt.set(st,ct+lt)},createIsAnyAudioContext=(tt,et)=>nt=>{const it=tt.get(nt);return et(it)||et(nt)},createIsAnyAudioNode=(tt,et)=>nt=>tt.has(nt)||et(nt),createIsAnyAudioParam=(tt,et)=>nt=>tt.has(nt)||et(nt),createIsAnyOfflineAudioContext=(tt,et)=>nt=>{const it=tt.get(nt);return et(it)||et(nt)},createIsNativeAudioContext=tt=>et=>tt!==null&&et instanceof tt,createIsNativeAudioNode=tt=>et=>tt!==null&&typeof tt.AudioNode=="function"&&et instanceof tt.AudioNode,createIsNativeAudioParam=tt=>et=>tt!==null&&typeof tt.AudioParam=="function"&&et instanceof tt.AudioParam,createIsNativeContext=(tt,et)=>nt=>tt(nt)||et(nt),createIsNativeOfflineAudioContext=tt=>et=>tt!==null&&et instanceof tt,createIsSecureContext=tt=>tt!==null&&tt.isSecureContext,createMediaElementAudioSourceNodeConstructor=(tt,et,nt,it)=>class extends tt{constructor(ot,at){const st=nt(ot),lt=et(st,at);if(it(st))throw TypeError();super(ot,!0,lt,null),this._nativeMediaElementAudioSourceNode=lt}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},DEFAULT_OPTIONS$6={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},createMediaStreamAudioDestinationNodeConstructor=(tt,et,nt,it)=>class extends tt{constructor(ot,at){const st=nt(ot);if(it(st))throw new TypeError;const lt={...DEFAULT_OPTIONS$6,...at},ct=et(st,lt);super(ot,!1,ct,null),this._nativeMediaStreamAudioDestinationNode=ct}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},createMediaStreamAudioSourceNodeConstructor=(tt,et,nt,it)=>class extends tt{constructor(ot,at){const st=nt(ot),lt=et(st,at);if(it(st))throw new TypeError;super(ot,!0,lt,null),this._nativeMediaStreamAudioSourceNode=lt}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},createMediaStreamTrackAudioSourceNodeConstructor=(tt,et,nt)=>class extends tt{constructor(rt,ot){const at=nt(rt),st=et(at,ot);super(rt,!0,st,null)}},createMinimalBaseAudioContextConstructor=(tt,et,nt,it,rt,ot)=>class extends nt{constructor(st,lt){super(st),this._nativeContext=st,CONTEXT_STORE.set(this,st),it(st)&&rt.set(st,new Set),this._destination=new tt(this,lt),this._listener=et(this,st),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(st){const lt=typeof st=="function"?ot(this,st):null;this._nativeContext.onstatechange=lt;const ct=this._nativeContext.onstatechange;this._onstatechange=ct!==null&&ct===lt?st:ct}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},testPromiseSupport=tt=>{const et=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const nt=tt.decodeAudioData(et.buffer,()=>{});return nt===void 0?!1:(nt.catch(()=>{}),!0)}catch{}return!1},createMonitorConnections=(tt,et)=>(nt,it,rt)=>{const ot=new Set;return nt.connect=(at=>(st,lt=0,ct=0)=>{const ut=ot.size===0;if(et(st))return at.call(nt,st,lt,ct),tt(ot,[st,lt,ct],ht=>ht[0]===st&&ht[1]===lt&&ht[2]===ct,!0),ut&&it(),st;at.call(nt,st,lt),tt(ot,[st,lt],ht=>ht[0]===st&&ht[1]===lt,!0),ut&&it()})(nt.connect),nt.disconnect=(at=>(st,lt,ct)=>{const ut=ot.size>0;if(st===void 0)at.apply(nt),ot.clear();else if(typeof st=="number"){at.call(nt,st);for(const dt of ot)dt[1]===st&&ot.delete(dt)}else{et(st)?at.call(nt,st,lt,ct):at.call(nt,st,lt);for(const dt of ot)dt[0]===st&&(lt===void 0||dt[1]===lt)&&(ct===void 0||dt[2]===ct)&&ot.delete(dt)}const ht=ot.size===0;ut&&ht&&rt()})(nt.disconnect),nt},assignNativeAudioNodeOption=(tt,et,nt)=>{const it=et[nt];it!==void 0&&it!==tt[nt]&&(tt[nt]=it)},assignNativeAudioNodeOptions=(tt,et)=>{assignNativeAudioNodeOption(tt,et,"channelCount"),assignNativeAudioNodeOption(tt,et,"channelCountMode"),assignNativeAudioNodeOption(tt,et,"channelInterpretation")},testAnalyserNodeGetFloatTimeDomainDataMethodSupport=tt=>typeof tt.getFloatTimeDomainData=="function",wrapAnalyserNodeGetFloatTimeDomainDataMethod=tt=>{tt.getFloatTimeDomainData=et=>{const nt=new Uint8Array(et.length);tt.getByteTimeDomainData(nt);const it=Math.max(nt.length,tt.fftSize);for(let rt=0;rt(nt,it)=>{const rt=nt.createAnalyser();if(assignNativeAudioNodeOptions(rt,it),!(it.maxDecibels>it.minDecibels))throw et();return assignNativeAudioNodeOption(rt,it,"fftSize"),assignNativeAudioNodeOption(rt,it,"maxDecibels"),assignNativeAudioNodeOption(rt,it,"minDecibels"),assignNativeAudioNodeOption(rt,it,"smoothingTimeConstant"),tt(testAnalyserNodeGetFloatTimeDomainDataMethodSupport,()=>testAnalyserNodeGetFloatTimeDomainDataMethodSupport(rt))||wrapAnalyserNodeGetFloatTimeDomainDataMethod(rt),rt},createNativeAudioBufferConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioBuffer")?tt.AudioBuffer:null,assignNativeAudioNodeAudioParamValue=(tt,et,nt)=>{const it=et[nt];it!==void 0&&it!==tt[nt].value&&(tt[nt].value=it)},wrapAudioBufferSourceNodeStartMethodConsecutiveCalls=tt=>{tt.start=(et=>{let nt=!1;return(it=0,rt=0,ot)=>{if(nt)throw createInvalidStateError();et.call(tt,it,rt,ot),nt=!0}})(tt.start)},wrapAudioScheduledSourceNodeStartMethodNegativeParameters=tt=>{tt.start=(et=>(nt=0,it=0,rt)=>{if(typeof rt=="number"&&rt<0||it<0||nt<0)throw new RangeError("The parameters can't be negative.");et.call(tt,nt,it,rt)})(tt.start)},wrapAudioScheduledSourceNodeStopMethodNegativeParameters=tt=>{tt.stop=(et=>(nt=0)=>{if(nt<0)throw new RangeError("The parameter can't be negative.");et.call(tt,nt)})(tt.stop)},createNativeAudioBufferSourceNodeFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut)=>(ht,dt)=>{const pt=ht.createBufferSource();return assignNativeAudioNodeOptions(pt,dt),assignNativeAudioNodeAudioParamValue(pt,dt,"playbackRate"),assignNativeAudioNodeOption(pt,dt,"buffer"),assignNativeAudioNodeOption(pt,dt,"loop"),assignNativeAudioNodeOption(pt,dt,"loopEnd"),assignNativeAudioNodeOption(pt,dt,"loopStart"),et(nt,()=>nt(ht))||wrapAudioBufferSourceNodeStartMethodConsecutiveCalls(pt),et(it,()=>it(ht))||lt(pt),et(rt,()=>rt(ht))||ct(pt,ht),et(ot,()=>ot(ht))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(pt),et(at,()=>at(ht))||ut(pt,ht),et(st,()=>st(ht))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(pt),tt(ht,pt),pt},createNativeAudioContextConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioContext")?tt.AudioContext:tt.hasOwnProperty("webkitAudioContext")?tt.webkitAudioContext:null,createNativeAudioDestinationNodeFactory=(tt,et)=>(nt,it,rt)=>{const ot=nt.destination;if(ot.channelCount!==it)try{ot.channelCount=it}catch{}rt&&ot.channelCountMode!=="explicit"&&(ot.channelCountMode="explicit"),ot.maxChannelCount===0&&Object.defineProperty(ot,"maxChannelCount",{value:it});const at=tt(nt,{channelCount:it,channelCountMode:ot.channelCountMode,channelInterpretation:ot.channelInterpretation,gain:1});return et(at,"channelCount",st=>()=>st.call(at),st=>lt=>{st.call(at,lt);try{ot.channelCount=lt}catch(ct){if(lt>ot.maxChannelCount)throw ct}}),et(at,"channelCountMode",st=>()=>st.call(at),st=>lt=>{st.call(at,lt),ot.channelCountMode=lt}),et(at,"channelInterpretation",st=>()=>st.call(at),st=>lt=>{st.call(at,lt),ot.channelInterpretation=lt}),Object.defineProperty(at,"maxChannelCount",{get:()=>ot.maxChannelCount}),at.connect(ot),at},createNativeAudioWorkletNodeConstructor=tt=>tt===null?null:tt.hasOwnProperty("AudioWorkletNode")?tt.AudioWorkletNode:null,testClonabilityOfAudioWorkletNodeOptions=tt=>{const{port1:et}=new MessageChannel;try{et.postMessage(tt)}finally{et.close()}},createNativeAudioWorkletNodeFactory=(tt,et,nt,it,rt)=>(ot,at,st,lt,ct,ut)=>{if(st!==null)try{const ht=new st(ot,lt,ut),dt=new Map;let pt=null;if(Object.defineProperties(ht,{channelCount:{get:()=>ut.channelCount,set:()=>{throw tt()}},channelCountMode:{get:()=>"explicit",set:()=>{throw tt()}},onprocessorerror:{get:()=>pt,set:mt=>{typeof pt=="function"&&ht.removeEventListener("processorerror",pt),pt=typeof mt=="function"?mt:null,typeof pt=="function"&&ht.addEventListener("processorerror",pt)}}}),ht.addEventListener=(mt=>(...gt)=>{if(gt[0]==="processorerror"){const bt=typeof gt[1]=="function"?gt[1]:typeof gt[1]=="object"&>[1]!==null&&typeof gt[1].handleEvent=="function"?gt[1].handleEvent:null;if(bt!==null){const yt=dt.get(gt[1]);yt!==void 0?gt[1]=yt:(gt[1]=wt=>{wt.type==="error"?(Object.defineProperties(wt,{type:{value:"processorerror"}}),bt(wt)):bt(new ErrorEvent(gt[0],{...wt}))},dt.set(bt,gt[1]))}}return mt.call(ht,"error",gt[1],gt[2]),mt.call(ht,...gt)})(ht.addEventListener),ht.removeEventListener=(mt=>(...gt)=>{if(gt[0]==="processorerror"){const bt=dt.get(gt[1]);bt!==void 0&&(dt.delete(gt[1]),gt[1]=bt)}return mt.call(ht,"error",gt[1],gt[2]),mt.call(ht,gt[0],gt[1],gt[2])})(ht.removeEventListener),ut.numberOfOutputs!==0){const mt=nt(ot,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return ht.connect(mt).connect(ot.destination),rt(ht,()=>mt.disconnect(),()=>mt.connect(ot.destination))}return ht}catch(ht){throw ht.code===11?it():ht}if(ct===void 0)throw it();return testClonabilityOfAudioWorkletNodeOptions(ut),et(ot,at,ct,ut)},computeBufferSize=(tt,et)=>tt===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(tt*et))))),cloneAudioWorkletNodeOptions=tt=>new Promise((et,nt)=>{const{port1:it,port2:rt}=new MessageChannel;it.onmessage=({data:ot})=>{it.close(),rt.close(),et(ot)},it.onmessageerror=({data:ot})=>{it.close(),rt.close(),nt(ot)},rt.postMessage(tt)}),createAudioWorkletProcessorPromise=async(tt,et)=>{const nt=await cloneAudioWorkletNodeOptions(et);return new tt(nt)},createAudioWorkletProcessor=(tt,et,nt,it)=>{let rt=NODE_TO_PROCESSOR_MAPS.get(tt);rt===void 0&&(rt=new WeakMap,NODE_TO_PROCESSOR_MAPS.set(tt,rt));const ot=createAudioWorkletProcessorPromise(nt,it);return rt.set(et,ot),ot},createNativeAudioWorkletNodeFakerFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct,ut,ht,dt)=>(pt,mt,gt,bt)=>{if(bt.numberOfInputs===0&&bt.numberOfOutputs===0)throw lt();const yt=Array.isArray(bt.outputChannelCount)?bt.outputChannelCount:Array.from(bt.outputChannelCount);if(yt.some(Cn=>Cn<1))throw lt();if(yt.length!==bt.numberOfOutputs)throw et();if(bt.channelCountMode!=="explicit")throw lt();const wt=bt.channelCount*bt.numberOfInputs,vt=yt.reduce((Cn,Nn)=>Cn+Nn,0),xt=gt.parameterDescriptors===void 0?0:gt.parameterDescriptors.length;if(wt+xt>6||vt>6)throw lt();const St=new MessageChannel,Et=[],$t=[];for(let Cn=0;CnCn===void 0?0:Cn},maxValue:{get:()=>Nn===void 0?MOST_POSITIVE_SINGLE_FLOAT:Nn},minValue:{get:()=>Un===void 0?MOST_NEGATIVE_SINGLE_FLOAT:Un}}),It.push(An)}const Ft=it(pt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,wt+xt)}),Ht=computeBufferSize(mt,pt.sampleRate),zt=st(pt,Ht,wt+xt,Math.max(1,vt)),Ot=rt(pt,{channelCount:Math.max(1,vt),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,vt)}),jt=[];for(let Cn=0;Cn{const Un=It[Nn];return Un.connect(Ft,0,wt+Nn),Un.start(0),[Cn,Un.offset]}));Ft.connect(zt);let Tt=bt.channelInterpretation,Ct=null;const Ut=bt.numberOfOutputs===0?[zt]:jt,Nt={get bufferSize(){return Ht},get channelCount(){return bt.channelCount},set channelCount(Cn){throw nt()},get channelCountMode(){return bt.channelCountMode},set channelCountMode(Cn){throw nt()},get channelInterpretation(){return Tt},set channelInterpretation(Cn){for(const Nn of Et)Nn.channelInterpretation=Cn;Tt=Cn},get context(){return zt.context},get inputs(){return Et},get numberOfInputs(){return bt.numberOfInputs},get numberOfOutputs(){return bt.numberOfOutputs},get onprocessorerror(){return Ct},set onprocessorerror(Cn){typeof Ct=="function"&&Nt.removeEventListener("processorerror",Ct),Ct=typeof Cn=="function"?Cn:null,typeof Ct=="function"&&Nt.addEventListener("processorerror",Ct)},get parameters(){return kt},get port(){return St.port2},addEventListener(...Cn){return zt.addEventListener(Cn[0],Cn[1],Cn[2])},connect:tt.bind(null,Ut),disconnect:ct.bind(null,Ut),dispatchEvent(...Cn){return zt.dispatchEvent(Cn[0])},removeEventListener(...Cn){return zt.removeEventListener(Cn[0],Cn[1],Cn[2])}},Bt=new Map;St.port1.addEventListener=(Cn=>(...Nn)=>{if(Nn[0]==="message"){const Un=typeof Nn[1]=="function"?Nn[1]:typeof Nn[1]=="object"&&Nn[1]!==null&&typeof Nn[1].handleEvent=="function"?Nn[1].handleEvent:null;if(Un!==null){const _n=Bt.get(Nn[1]);_n!==void 0?Nn[1]=_n:(Nn[1]=An=>{ut(pt.currentTime,pt.sampleRate,()=>Un(An))},Bt.set(Un,Nn[1]))}}return Cn.call(St.port1,Nn[0],Nn[1],Nn[2])})(St.port1.addEventListener),St.port1.removeEventListener=(Cn=>(...Nn)=>{if(Nn[0]==="message"){const Un=Bt.get(Nn[1]);Un!==void 0&&(Bt.delete(Nn[1]),Nn[1]=Un)}return Cn.call(St.port1,Nn[0],Nn[1],Nn[2])})(St.port1.removeEventListener);let Mt=null;Object.defineProperty(St.port1,"onmessage",{get:()=>Mt,set:Cn=>{typeof Mt=="function"&&St.port1.removeEventListener("message",Mt),Mt=typeof Cn=="function"?Cn:null,typeof Mt=="function"&&(St.port1.addEventListener("message",Mt),St.port1.start())}}),gt.prototype.port=St.port1;let Dt=null;createAudioWorkletProcessor(pt,Nt,gt,bt).then(Cn=>Dt=Cn);const Vt=createNestedArrays(bt.numberOfInputs,bt.channelCount),nn=createNestedArrays(bt.numberOfOutputs,yt),cn=gt.parameterDescriptors===void 0?[]:gt.parameterDescriptors.reduce((Cn,{name:Nn})=>({...Cn,[Nn]:new Float32Array(128)}),{});let Xt=!0;const un=()=>{bt.numberOfOutputs>0&&zt.disconnect(Ot);for(let Cn=0,Nn=0;Cn{if(Dt!==null){const Un=ht(Nt);for(let _n=0;_n{copyFromChannel(Cn,cn,An,wt+gn,_n)});for(let An=0;An{if(Un[yn].size>0)return en.set(yn,Ht/128),Tn;const sn=en.get(yn);return sn===void 0?[]:(Tn.every(rn=>rn.every(Sn=>Sn===0))&&(sn===1?en.delete(yn):en.set(yn,sn-1)),Tn)});Xt=ut(pt.currentTime+_n/pt.sampleRate,pt.sampleRate,()=>Dt.process(An,nn,cn));for(let Tn=0,yn=0;Tnzt.connect(xn).connect(pt.destination),Zt=()=>{zt.disconnect(xn),xn.disconnect()},En=()=>{if(Xt){Zt(),bt.numberOfOutputs>0&&zt.connect(Ot);for(let Cn=0,Nn=0;Cn{Xt&&(an(),un()),fn=!1};return an(),dt(Nt,En,In)},createNativeBiquadFilterNode=(tt,et)=>{const nt=tt.createBiquadFilter();return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"Q"),assignNativeAudioNodeAudioParamValue(nt,et,"detune"),assignNativeAudioNodeAudioParamValue(nt,et,"frequency"),assignNativeAudioNodeAudioParamValue(nt,et,"gain"),assignNativeAudioNodeOption(nt,et,"type"),nt},createNativeChannelMergerNodeFactory=(tt,et)=>(nt,it)=>{const rt=nt.createChannelMerger(it.numberOfInputs);return tt!==null&&tt.name==="webkitAudioContext"&&et(nt,rt),assignNativeAudioNodeOptions(rt,it),rt},wrapChannelSplitterNode=tt=>{const et=tt.numberOfOutputs;Object.defineProperty(tt,"channelCount",{get:()=>et,set:nt=>{if(nt!==et)throw createInvalidStateError()}}),Object.defineProperty(tt,"channelCountMode",{get:()=>"explicit",set:nt=>{if(nt!=="explicit")throw createInvalidStateError()}}),Object.defineProperty(tt,"channelInterpretation",{get:()=>"discrete",set:nt=>{if(nt!=="discrete")throw createInvalidStateError()}})},createNativeChannelSplitterNode=(tt,et)=>{const nt=tt.createChannelSplitter(et.numberOfOutputs);return assignNativeAudioNodeOptions(nt,et),wrapChannelSplitterNode(nt),nt},createNativeConstantSourceNodeFactory=(tt,et,nt,it,rt)=>(ot,at)=>{if(ot.createConstantSource===void 0)return nt(ot,at);const st=ot.createConstantSource();return assignNativeAudioNodeOptions(st,at),assignNativeAudioNodeAudioParamValue(st,at,"offset"),et(it,()=>it(ot))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(st),et(rt,()=>rt(ot))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(st),tt(ot,st),st},interceptConnections=(tt,et)=>(tt.connect=et.connect.bind(et),tt.disconnect=et.disconnect.bind(et),tt),createNativeConstantSourceNodeFakerFactory=(tt,et,nt,it)=>(rt,{offset:ot,...at})=>{const st=rt.createBuffer(1,2,44100),lt=et(rt,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),ct=nt(rt,{...at,gain:ot}),ut=st.getChannelData(0);ut[0]=1,ut[1]=1,lt.buffer=st,lt.loop=!0;const ht={get bufferSize(){},get channelCount(){return ct.channelCount},set channelCount(mt){ct.channelCount=mt},get channelCountMode(){return ct.channelCountMode},set channelCountMode(mt){ct.channelCountMode=mt},get channelInterpretation(){return ct.channelInterpretation},set channelInterpretation(mt){ct.channelInterpretation=mt},get context(){return ct.context},get inputs(){return[]},get numberOfInputs(){return lt.numberOfInputs},get numberOfOutputs(){return ct.numberOfOutputs},get offset(){return ct.gain},get onended(){return lt.onended},set onended(mt){lt.onended=mt},addEventListener(...mt){return lt.addEventListener(mt[0],mt[1],mt[2])},dispatchEvent(...mt){return lt.dispatchEvent(mt[0])},removeEventListener(...mt){return lt.removeEventListener(mt[0],mt[1],mt[2])},start(mt=0){lt.start.call(lt,mt)},stop(mt=0){lt.stop.call(lt,mt)}},dt=()=>lt.connect(ct),pt=()=>lt.disconnect(ct);return tt(rt,lt),it(interceptConnections(ht,ct),dt,pt)},createNativeConvolverNodeFactory=(tt,et)=>(nt,it)=>{const rt=nt.createConvolver();if(assignNativeAudioNodeOptions(rt,it),it.disableNormalization===rt.normalize&&(rt.normalize=!it.disableNormalization),assignNativeAudioNodeOption(rt,it,"buffer"),it.channelCount>2||(et(rt,"channelCount",ot=>()=>ot.call(rt),ot=>at=>{if(at>2)throw tt();return ot.call(rt,at)}),it.channelCountMode==="max"))throw tt();return et(rt,"channelCountMode",ot=>()=>ot.call(rt),ot=>at=>{if(at==="max")throw tt();return ot.call(rt,at)}),rt},createNativeDelayNode=(tt,et)=>{const nt=tt.createDelay(et.maxDelayTime);return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"delayTime"),nt},createNativeDynamicsCompressorNodeFactory=tt=>(et,nt)=>{const it=et.createDynamicsCompressor();if(assignNativeAudioNodeOptions(it,nt),nt.channelCount>2||nt.channelCountMode==="max")throw tt();return assignNativeAudioNodeAudioParamValue(it,nt,"attack"),assignNativeAudioNodeAudioParamValue(it,nt,"knee"),assignNativeAudioNodeAudioParamValue(it,nt,"ratio"),assignNativeAudioNodeAudioParamValue(it,nt,"release"),assignNativeAudioNodeAudioParamValue(it,nt,"threshold"),it},createNativeGainNode=(tt,et)=>{const nt=tt.createGain();return assignNativeAudioNodeOptions(nt,et),assignNativeAudioNodeAudioParamValue(nt,et,"gain"),nt},createNativeIIRFilterNodeFactory=tt=>(et,nt,it)=>{if(et.createIIRFilter===void 0)return tt(et,nt,it);const rt=et.createIIRFilter(it.feedforward,it.feedback);return assignNativeAudioNodeOptions(rt,it),rt};function divide$1(tt,et){const nt=et[0]*et[0]+et[1]*et[1];return[(tt[0]*et[0]+tt[1]*et[1])/nt,(tt[1]*et[0]-tt[0]*et[1])/nt]}function multiply(tt,et){return[tt[0]*et[0]-tt[1]*et[1],tt[0]*et[1]+tt[1]*et[0]]}function evaluatePolynomial(tt,et){let nt=[0,0];for(let it=tt.length-1;it>=0;it-=1)nt=multiply(nt,et),nt[0]+=tt[it];return nt}const createNativeIIRFilterNodeFakerFactory=(tt,et,nt,it)=>(rt,ot,{channelCount:at,channelCountMode:st,channelInterpretation:lt,feedback:ct,feedforward:ut})=>{const ht=computeBufferSize(ot,rt.sampleRate),dt=ct instanceof Float64Array?ct:new Float64Array(ct),pt=ut instanceof Float64Array?ut:new Float64Array(ut),mt=dt.length,gt=pt.length,bt=Math.min(mt,gt);if(mt===0||mt>20)throw it();if(dt[0]===0)throw et();if(gt===0||gt>20)throw it();if(pt[0]===0)throw et();if(dt[0]!==1){for(let It=0;It{const Ft=It.inputBuffer,Ht=It.outputBuffer,zt=Ft.numberOfChannels;for(let Ot=0;Ottt.createMediaElementSource(et.mediaElement),createNativeMediaStreamAudioDestinationNode=(tt,et)=>{const nt=tt.createMediaStreamDestination();return assignNativeAudioNodeOptions(nt,et),nt.numberOfOutputs===1&&Object.defineProperty(nt,"numberOfOutputs",{get:()=>0}),nt},createNativeMediaStreamAudioSourceNode=(tt,{mediaStream:et})=>{const nt=et.getAudioTracks();nt.sort((ot,at)=>ot.idat.id?1:0);const it=nt.slice(0,1),rt=tt.createMediaStreamSource(new MediaStream(it));return Object.defineProperty(rt,"mediaStream",{value:et}),rt},createNativeMediaStreamTrackAudioSourceNodeFactory=(tt,et)=>(nt,{mediaStreamTrack:it})=>{if(typeof nt.createMediaStreamTrackSource=="function")return nt.createMediaStreamTrackSource(it);const rt=new MediaStream([it]),ot=nt.createMediaStreamSource(rt);if(it.kind!=="audio")throw tt();if(et(nt))throw new TypeError;return ot},createNativeOfflineAudioContextConstructor=tt=>tt===null?null:tt.hasOwnProperty("OfflineAudioContext")?tt.OfflineAudioContext:tt.hasOwnProperty("webkitOfflineAudioContext")?tt.webkitOfflineAudioContext:null,createNativeOscillatorNodeFactory=(tt,et,nt,it,rt,ot)=>(at,st)=>{const lt=at.createOscillator();return assignNativeAudioNodeOptions(lt,st),assignNativeAudioNodeAudioParamValue(lt,st,"detune"),assignNativeAudioNodeAudioParamValue(lt,st,"frequency"),st.periodicWave!==void 0?lt.setPeriodicWave(st.periodicWave):assignNativeAudioNodeOption(lt,st,"type"),et(nt,()=>nt(at))||wrapAudioScheduledSourceNodeStartMethodNegativeParameters(lt),et(it,()=>it(at))||ot(lt,at),et(rt,()=>rt(at))||wrapAudioScheduledSourceNodeStopMethodNegativeParameters(lt),tt(at,lt),lt},createNativePannerNodeFactory=tt=>(et,nt)=>{const it=et.createPanner();return it.orientationX===void 0?tt(et,nt):(assignNativeAudioNodeOptions(it,nt),assignNativeAudioNodeAudioParamValue(it,nt,"orientationX"),assignNativeAudioNodeAudioParamValue(it,nt,"orientationY"),assignNativeAudioNodeAudioParamValue(it,nt,"orientationZ"),assignNativeAudioNodeAudioParamValue(it,nt,"positionX"),assignNativeAudioNodeAudioParamValue(it,nt,"positionY"),assignNativeAudioNodeAudioParamValue(it,nt,"positionZ"),assignNativeAudioNodeOption(it,nt,"coneInnerAngle"),assignNativeAudioNodeOption(it,nt,"coneOuterAngle"),assignNativeAudioNodeOption(it,nt,"coneOuterGain"),assignNativeAudioNodeOption(it,nt,"distanceModel"),assignNativeAudioNodeOption(it,nt,"maxDistance"),assignNativeAudioNodeOption(it,nt,"panningModel"),assignNativeAudioNodeOption(it,nt,"refDistance"),assignNativeAudioNodeOption(it,nt,"rolloffFactor"),it)},createNativePannerNodeFakerFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct)=>(ut,{coneInnerAngle:ht,coneOuterAngle:dt,coneOuterGain:pt,distanceModel:mt,maxDistance:gt,orientationX:bt,orientationY:yt,orientationZ:wt,panningModel:vt,positionX:xt,positionY:St,positionZ:Et,refDistance:$t,rolloffFactor:It,...Ft})=>{const Ht=ut.createPanner();if(Ft.channelCount>2||Ft.channelCountMode==="max")throw at();assignNativeAudioNodeOptions(Ht,Ft);const zt={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},Ot=nt(ut,{...zt,channelInterpretation:"speakers",numberOfInputs:6}),jt=it(ut,{...Ft,gain:1}),kt=it(ut,{...zt,gain:1}),Tt=it(ut,{...zt,gain:0}),Ct=it(ut,{...zt,gain:0}),Ut=it(ut,{...zt,gain:0}),Nt=it(ut,{...zt,gain:0}),Bt=it(ut,{...zt,gain:0}),Mt=rt(ut,256,6,1),Dt=ot(ut,{...zt,curve:new Float32Array([1,1]),oversample:"none"});let Pt=[bt,yt,wt],Vt=[xt,St,Et];const nn=new Float32Array(1);Mt.onaudioprocess=({inputBuffer:en})=>{const fn=[lt(en,nn,0),lt(en,nn,1),lt(en,nn,2)];fn.some((an,Zt)=>an!==Pt[Zt])&&(Ht.setOrientation(...fn),Pt=fn);const xn=[lt(en,nn,3),lt(en,nn,4),lt(en,nn,5)];xn.some((an,Zt)=>an!==Vt[Zt])&&(Ht.setPosition(...xn),Vt=xn)},Object.defineProperty(Tt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Ct.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Ut.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Nt.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Bt.gain,"defaultValue",{get:()=>0});const cn={get bufferSize(){},get channelCount(){return Ht.channelCount},set channelCount(en){if(en>2)throw at();jt.channelCount=en,Ht.channelCount=en},get channelCountMode(){return Ht.channelCountMode},set channelCountMode(en){if(en==="max")throw at();jt.channelCountMode=en,Ht.channelCountMode=en},get channelInterpretation(){return Ht.channelInterpretation},set channelInterpretation(en){jt.channelInterpretation=en,Ht.channelInterpretation=en},get coneInnerAngle(){return Ht.coneInnerAngle},set coneInnerAngle(en){Ht.coneInnerAngle=en},get coneOuterAngle(){return Ht.coneOuterAngle},set coneOuterAngle(en){Ht.coneOuterAngle=en},get coneOuterGain(){return Ht.coneOuterGain},set coneOuterGain(en){if(en<0||en>1)throw et();Ht.coneOuterGain=en},get context(){return Ht.context},get distanceModel(){return Ht.distanceModel},set distanceModel(en){Ht.distanceModel=en},get inputs(){return[jt]},get maxDistance(){return Ht.maxDistance},set maxDistance(en){if(en<0)throw new RangeError;Ht.maxDistance=en},get numberOfInputs(){return Ht.numberOfInputs},get numberOfOutputs(){return Ht.numberOfOutputs},get orientationX(){return kt.gain},get orientationY(){return Tt.gain},get orientationZ(){return Ct.gain},get panningModel(){return Ht.panningModel},set panningModel(en){Ht.panningModel=en},get positionX(){return Ut.gain},get positionY(){return Nt.gain},get positionZ(){return Bt.gain},get refDistance(){return Ht.refDistance},set refDistance(en){if(en<0)throw new RangeError;Ht.refDistance=en},get rolloffFactor(){return Ht.rolloffFactor},set rolloffFactor(en){if(en<0)throw new RangeError;Ht.rolloffFactor=en},addEventListener(...en){return jt.addEventListener(en[0],en[1],en[2])},dispatchEvent(...en){return jt.dispatchEvent(en[0])},removeEventListener(...en){return jt.removeEventListener(en[0],en[1],en[2])}};ht!==cn.coneInnerAngle&&(cn.coneInnerAngle=ht),dt!==cn.coneOuterAngle&&(cn.coneOuterAngle=dt),pt!==cn.coneOuterGain&&(cn.coneOuterGain=pt),mt!==cn.distanceModel&&(cn.distanceModel=mt),gt!==cn.maxDistance&&(cn.maxDistance=gt),bt!==cn.orientationX.value&&(cn.orientationX.value=bt),yt!==cn.orientationY.value&&(cn.orientationY.value=yt),wt!==cn.orientationZ.value&&(cn.orientationZ.value=wt),vt!==cn.panningModel&&(cn.panningModel=vt),xt!==cn.positionX.value&&(cn.positionX.value=xt),St!==cn.positionY.value&&(cn.positionY.value=St),Et!==cn.positionZ.value&&(cn.positionZ.value=Et),$t!==cn.refDistance&&(cn.refDistance=$t),It!==cn.rolloffFactor&&(cn.rolloffFactor=It),(Pt[0]!==1||Pt[1]!==0||Pt[2]!==0)&&Ht.setOrientation(...Pt),(Vt[0]!==0||Vt[1]!==0||Vt[2]!==0)&&Ht.setPosition(...Vt);const Xt=()=>{jt.connect(Ht),tt(jt,Dt,0,0),Dt.connect(kt).connect(Ot,0,0),Dt.connect(Tt).connect(Ot,0,1),Dt.connect(Ct).connect(Ot,0,2),Dt.connect(Ut).connect(Ot,0,3),Dt.connect(Nt).connect(Ot,0,4),Dt.connect(Bt).connect(Ot,0,5),Ot.connect(Mt).connect(ut.destination)},un=()=>{jt.disconnect(Ht),st(jt,Dt,0,0),Dt.disconnect(kt),kt.disconnect(Ot),Dt.disconnect(Tt),Tt.disconnect(Ot),Dt.disconnect(Ct),Ct.disconnect(Ot),Dt.disconnect(Ut),Ut.disconnect(Ot),Dt.disconnect(Nt),Nt.disconnect(Ot),Dt.disconnect(Bt),Bt.disconnect(Ot),Ot.disconnect(Mt),Mt.disconnect(ut.destination)};return ct(interceptConnections(cn,Ht),Xt,un)},createNativePeriodicWaveFactory=tt=>(et,{disableNormalization:nt,imag:it,real:rt})=>{const ot=it instanceof Float32Array?it:new Float32Array(it),at=rt instanceof Float32Array?rt:new Float32Array(rt),st=et.createPeriodicWave(at,ot,{disableNormalization:nt});if(Array.from(it).length<2)throw tt();return st},createNativeScriptProcessorNode=(tt,et,nt,it)=>tt.createScriptProcessor(et,nt,it),createNativeStereoPannerNodeFactory=(tt,et)=>(nt,it)=>{const rt=it.channelCountMode;if(rt==="clamped-max")throw et();if(nt.createStereoPanner===void 0)return tt(nt,it);const ot=nt.createStereoPanner();return assignNativeAudioNodeOptions(ot,it),assignNativeAudioNodeAudioParamValue(ot,it,"pan"),Object.defineProperty(ot,"channelCountMode",{get:()=>rt,set:at=>{if(at!==rt)throw et()}}),ot},createNativeStereoPannerNodeFakerFactory=(tt,et,nt,it,rt,ot)=>{const st=new Float32Array([1,1]),lt=Math.PI/2,ct={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},ut={...ct,oversample:"none"},ht=(mt,gt,bt,yt)=>{const wt=new Float32Array(16385),vt=new Float32Array(16385);for(let Ft=0;Ft<16385;Ft+=1){const Ht=Ft/16384*lt;wt[Ft]=Math.cos(Ht),vt[Ft]=Math.sin(Ht)}const xt=nt(mt,{...ct,gain:0}),St=it(mt,{...ut,curve:wt}),Et=it(mt,{...ut,curve:st}),$t=nt(mt,{...ct,gain:0}),It=it(mt,{...ut,curve:vt});return{connectGraph(){gt.connect(xt),gt.connect(Et.inputs===void 0?Et:Et.inputs[0]),gt.connect($t),Et.connect(bt),bt.connect(St.inputs===void 0?St:St.inputs[0]),bt.connect(It.inputs===void 0?It:It.inputs[0]),St.connect(xt.gain),It.connect($t.gain),xt.connect(yt,0,0),$t.connect(yt,0,1)},disconnectGraph(){gt.disconnect(xt),gt.disconnect(Et.inputs===void 0?Et:Et.inputs[0]),gt.disconnect($t),Et.disconnect(bt),bt.disconnect(St.inputs===void 0?St:St.inputs[0]),bt.disconnect(It.inputs===void 0?It:It.inputs[0]),St.disconnect(xt.gain),It.disconnect($t.gain),xt.disconnect(yt,0,0),$t.disconnect(yt,0,1)}}},dt=(mt,gt,bt,yt)=>{const wt=new Float32Array(16385),vt=new Float32Array(16385),xt=new Float32Array(16385),St=new Float32Array(16385),Et=Math.floor(16385/2);for(let Ut=0;Ut<16385;Ut+=1)if(Ut>Et){const Nt=(Ut-Et)/(16384-Et)*lt;wt[Ut]=Math.cos(Nt),vt[Ut]=Math.sin(Nt),xt[Ut]=0,St[Ut]=1}else{const Nt=Ut/(16384-Et)*lt;wt[Ut]=1,vt[Ut]=0,xt[Ut]=Math.cos(Nt),St[Ut]=Math.sin(Nt)}const $t=et(mt,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),It=nt(mt,{...ct,gain:0}),Ft=it(mt,{...ut,curve:wt}),Ht=nt(mt,{...ct,gain:0}),zt=it(mt,{...ut,curve:vt}),Ot=it(mt,{...ut,curve:st}),jt=nt(mt,{...ct,gain:0}),kt=it(mt,{...ut,curve:xt}),Tt=nt(mt,{...ct,gain:0}),Ct=it(mt,{...ut,curve:St});return{connectGraph(){gt.connect($t),gt.connect(Ot.inputs===void 0?Ot:Ot.inputs[0]),$t.connect(It,0),$t.connect(Ht,0),$t.connect(jt,1),$t.connect(Tt,1),Ot.connect(bt),bt.connect(Ft.inputs===void 0?Ft:Ft.inputs[0]),bt.connect(zt.inputs===void 0?zt:zt.inputs[0]),bt.connect(kt.inputs===void 0?kt:kt.inputs[0]),bt.connect(Ct.inputs===void 0?Ct:Ct.inputs[0]),Ft.connect(It.gain),zt.connect(Ht.gain),kt.connect(jt.gain),Ct.connect(Tt.gain),It.connect(yt,0,0),jt.connect(yt,0,0),Ht.connect(yt,0,1),Tt.connect(yt,0,1)},disconnectGraph(){gt.disconnect($t),gt.disconnect(Ot.inputs===void 0?Ot:Ot.inputs[0]),$t.disconnect(It,0),$t.disconnect(Ht,0),$t.disconnect(jt,1),$t.disconnect(Tt,1),Ot.disconnect(bt),bt.disconnect(Ft.inputs===void 0?Ft:Ft.inputs[0]),bt.disconnect(zt.inputs===void 0?zt:zt.inputs[0]),bt.disconnect(kt.inputs===void 0?kt:kt.inputs[0]),bt.disconnect(Ct.inputs===void 0?Ct:Ct.inputs[0]),Ft.disconnect(It.gain),zt.disconnect(Ht.gain),kt.disconnect(jt.gain),Ct.disconnect(Tt.gain),It.disconnect(yt,0,0),jt.disconnect(yt,0,0),Ht.disconnect(yt,0,1),Tt.disconnect(yt,0,1)}}},pt=(mt,gt,bt,yt,wt)=>{if(gt===1)return ht(mt,bt,yt,wt);if(gt===2)return dt(mt,bt,yt,wt);throw rt()};return(mt,{channelCount:gt,channelCountMode:bt,pan:yt,...wt})=>{if(bt==="max")throw rt();const vt=tt(mt,{...wt,channelCount:1,channelCountMode:bt,numberOfInputs:2}),xt=nt(mt,{...wt,channelCount:gt,channelCountMode:bt,gain:1}),St=nt(mt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:yt});let{connectGraph:Et,disconnectGraph:$t}=pt(mt,gt,xt,St,vt);Object.defineProperty(St.gain,"defaultValue",{get:()=>0}),Object.defineProperty(St.gain,"maxValue",{get:()=>1}),Object.defineProperty(St.gain,"minValue",{get:()=>-1});const It={get bufferSize(){},get channelCount(){return xt.channelCount},set channelCount(Ot){xt.channelCount!==Ot&&(Ft&&$t(),{connectGraph:Et,disconnectGraph:$t}=pt(mt,Ot,xt,St,vt),Ft&&Et()),xt.channelCount=Ot},get channelCountMode(){return xt.channelCountMode},set channelCountMode(Ot){if(Ot==="clamped-max"||Ot==="max")throw rt();xt.channelCountMode=Ot},get channelInterpretation(){return xt.channelInterpretation},set channelInterpretation(Ot){xt.channelInterpretation=Ot},get context(){return xt.context},get inputs(){return[xt]},get numberOfInputs(){return xt.numberOfInputs},get numberOfOutputs(){return xt.numberOfOutputs},get pan(){return St.gain},addEventListener(...Ot){return xt.addEventListener(Ot[0],Ot[1],Ot[2])},dispatchEvent(...Ot){return xt.dispatchEvent(Ot[0])},removeEventListener(...Ot){return xt.removeEventListener(Ot[0],Ot[1],Ot[2])}};let Ft=!1;const Ht=()=>{Et(),Ft=!0},zt=()=>{$t(),Ft=!1};return ot(interceptConnections(It,vt),Ht,zt)}},createNativeWaveShaperNodeFactory=(tt,et,nt,it,rt,ot,at)=>(st,lt)=>{const ct=st.createWaveShaper();if(ot!==null&&ot.name==="webkitAudioContext"&&st.createGain().gain.automationRate===void 0)return nt(st,lt);assignNativeAudioNodeOptions(ct,lt);const ut=lt.curve===null||lt.curve instanceof Float32Array?lt.curve:new Float32Array(lt.curve);if(ut!==null&&ut.length<2)throw et();assignNativeAudioNodeOption(ct,{curve:ut},"curve"),assignNativeAudioNodeOption(ct,lt,"oversample");let ht=null,dt=!1;return at(ct,"curve",gt=>()=>gt.call(ct),gt=>bt=>(gt.call(ct,bt),dt&&(it(bt)&&ht===null?ht=tt(st,ct):!it(bt)&&ht!==null&&(ht(),ht=null)),bt)),rt(ct,()=>{dt=!0,it(ct.curve)&&(ht=tt(st,ct))},()=>{dt=!1,ht!==null&&(ht(),ht=null)})},createNativeWaveShaperNodeFakerFactory=(tt,et,nt,it,rt)=>(ot,{curve:at,oversample:st,...lt})=>{const ct=ot.createWaveShaper(),ut=ot.createWaveShaper();assignNativeAudioNodeOptions(ct,lt),assignNativeAudioNodeOptions(ut,lt);const ht=nt(ot,{...lt,gain:1}),dt=nt(ot,{...lt,gain:-1}),pt=nt(ot,{...lt,gain:1}),mt=nt(ot,{...lt,gain:-1});let gt=null,bt=!1,yt=null;const wt={get bufferSize(){},get channelCount(){return ct.channelCount},set channelCount(St){ht.channelCount=St,dt.channelCount=St,ct.channelCount=St,pt.channelCount=St,ut.channelCount=St,mt.channelCount=St},get channelCountMode(){return ct.channelCountMode},set channelCountMode(St){ht.channelCountMode=St,dt.channelCountMode=St,ct.channelCountMode=St,pt.channelCountMode=St,ut.channelCountMode=St,mt.channelCountMode=St},get channelInterpretation(){return ct.channelInterpretation},set channelInterpretation(St){ht.channelInterpretation=St,dt.channelInterpretation=St,ct.channelInterpretation=St,pt.channelInterpretation=St,ut.channelInterpretation=St,mt.channelInterpretation=St},get context(){return ct.context},get curve(){return yt},set curve(St){if(St!==null&&St.length<2)throw et();if(St===null)ct.curve=St,ut.curve=St;else{const Et=St.length,$t=new Float32Array(Et+2-Et%2),It=new Float32Array(Et+2-Et%2);$t[0]=St[0],It[0]=-St[Et-1];const Ft=Math.ceil((Et+1)/2),Ht=(Et+1)/2-1;for(let zt=1;zt{ht.connect(ct).connect(pt),ht.connect(dt).connect(ut).connect(mt).connect(pt),bt=!0,it(yt)&&(gt=tt(ot,ht))},xt=()=>{ht.disconnect(ct),ct.disconnect(pt),ht.disconnect(dt),dt.disconnect(ut),ut.disconnect(mt),mt.disconnect(pt),bt=!1,gt!==null&&(gt(),gt=null)};return rt(interceptConnections(wt,pt),vt,xt)},createNotSupportedError=()=>new DOMException("","NotSupportedError"),DEFAULT_OPTIONS$5={numberOfChannels:1},createOfflineAudioContextConstructor=(tt,et,nt,it,rt)=>class extends tt{constructor(at,st,lt){let ct;if(typeof at=="number"&&st!==void 0&<!==void 0)ct={length:st,numberOfChannels:at,sampleRate:lt};else if(typeof at=="object")ct=at;else throw new Error("The given parameters are not valid.");const{length:ut,numberOfChannels:ht,sampleRate:dt}={...DEFAULT_OPTIONS$5,...ct},pt=it(ht,ut,dt);et(testPromiseSupport,()=>testPromiseSupport(pt))||pt.addEventListener("statechange",(()=>{let mt=0;const gt=bt=>{this._state==="running"&&(mt>0?(pt.removeEventListener("statechange",gt),bt.stopImmediatePropagation(),this._waitForThePromiseToSettle(bt)):mt+=1)};return gt})()),super(pt,ht),this._length=ut,this._nativeOfflineAudioContext=pt,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(nt()):(this._state="running",rt(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,deactivateAudioGraph(this)}))}_waitForThePromiseToSettle(at){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(at):setTimeout(()=>this._waitForThePromiseToSettle(at))}},DEFAULT_OPTIONS$4={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},createOscillatorNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS$4,...ct},dt=nt(ut,ht),pt=ot(ut),mt=pt?it():null,gt=lt.sampleRate/2;super(lt,!1,dt,mt),this._detune=et(this,pt,dt.detune,153600,-153600),this._frequency=et(this,pt,dt.frequency,gt,-gt),this._nativeOscillatorNode=dt,this._onended=null,this._oscillatorNodeRenderer=mt,this._oscillatorNodeRenderer!==null&&ht.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=ht.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(lt){const ct=typeof lt=="function"?at(this,lt):null;this._nativeOscillatorNode.onended=ct;const ut=this._nativeOscillatorNode.onended;this._onended=ut!==null&&ut===ct?lt:ut}get type(){return this._nativeOscillatorNode.type}set type(lt){this._nativeOscillatorNode.type=lt,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(lt){this._nativeOscillatorNode.setPeriodicWave(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=lt)}start(lt=0){if(this._nativeOscillatorNode.start(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=lt),this.context.state!=="closed"){setInternalStateToActive(this);const ct=()=>{this._nativeOscillatorNode.removeEventListener("ended",ct),isActiveAudioNode(this)&&setInternalStateToPassive(this)};this._nativeOscillatorNode.addEventListener("ended",ct)}}stop(lt=0){this._nativeOscillatorNode.stop(lt),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=lt)}},createOscillatorNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap;let at=null,st=null,lt=null;const ct=async(ut,ht)=>{let dt=nt(ut);const pt=isOwnedByContext(dt,ht);if(!pt){const mt={channelCount:dt.channelCount,channelCountMode:dt.channelCountMode,channelInterpretation:dt.channelInterpretation,detune:dt.detune.value,frequency:dt.frequency.value,periodicWave:at===null?void 0:at,type:dt.type};dt=et(ht,mt),st!==null&&dt.start(st),lt!==null&&dt.stop(lt)}return ot.set(ht,dt),pt?(await tt(ht,ut.detune,dt.detune),await tt(ht,ut.frequency,dt.frequency)):(await it(ht,ut.detune,dt.detune),await it(ht,ut.frequency,dt.frequency)),await rt(ut,ht,dt),dt};return{set periodicWave(ut){at=ut},set start(ut){st=ut},set stop(ut){lt=ut},render(ut,ht){const dt=ot.get(ht);return dt!==void 0?Promise.resolve(dt):ct(ut,ht)}}},DEFAULT_OPTIONS$3={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},createPannerNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS$3,...ct},dt=nt(ut,ht),pt=ot(ut),mt=pt?it():null;super(lt,!1,dt,mt),this._nativePannerNode=dt,this._orientationX=et(this,pt,dt.orientationX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationY=et(this,pt,dt.orientationY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._orientationZ=et(this,pt,dt.orientationZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionX=et(this,pt,dt.positionX,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionY=et(this,pt,dt.positionY,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),this._positionZ=et(this,pt,dt.positionZ,MOST_POSITIVE_SINGLE_FLOAT,MOST_NEGATIVE_SINGLE_FLOAT),at(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(lt){this._nativePannerNode.coneInnerAngle=lt}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(lt){this._nativePannerNode.coneOuterAngle=lt}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(lt){this._nativePannerNode.coneOuterGain=lt}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(lt){this._nativePannerNode.distanceModel=lt}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(lt){this._nativePannerNode.maxDistance=lt}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(lt){this._nativePannerNode.panningModel=lt}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(lt){this._nativePannerNode.refDistance=lt}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(lt){this._nativePannerNode.rolloffFactor=lt}},createPannerNodeRendererFactory=(tt,et,nt,it,rt,ot,at,st,lt,ct)=>()=>{const ut=new WeakMap;let ht=null;const dt=async(pt,mt)=>{let gt=null,bt=ot(pt);const yt={channelCount:bt.channelCount,channelCountMode:bt.channelCountMode,channelInterpretation:bt.channelInterpretation},wt={...yt,coneInnerAngle:bt.coneInnerAngle,coneOuterAngle:bt.coneOuterAngle,coneOuterGain:bt.coneOuterGain,distanceModel:bt.distanceModel,maxDistance:bt.maxDistance,panningModel:bt.panningModel,refDistance:bt.refDistance,rolloffFactor:bt.rolloffFactor},vt=isOwnedByContext(bt,mt);if("bufferSize"in bt)gt=it(mt,{...yt,gain:1});else if(!vt){const xt={...wt,orientationX:bt.orientationX.value,orientationY:bt.orientationY.value,orientationZ:bt.orientationZ.value,positionX:bt.positionX.value,positionY:bt.positionY.value,positionZ:bt.positionZ.value};bt=rt(mt,xt)}if(ut.set(mt,gt===null?bt:gt),gt!==null){if(ht===null){if(at===null)throw new Error("Missing the native OfflineAudioContext constructor.");const zt=new at(6,pt.context.length,mt.sampleRate),Ot=et(zt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});Ot.connect(zt.destination),ht=(async()=>{const jt=await Promise.all([pt.orientationX,pt.orientationY,pt.orientationZ,pt.positionX,pt.positionY,pt.positionZ].map(async(kt,Tt)=>{const Ct=nt(zt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Tt===0?1:0});return await st(zt,kt,Ct.offset),Ct}));for(let kt=0;kt<6;kt+=1)jt[kt].connect(Ot,0,kt),jt[kt].start(0);return ct(zt)})()}const xt=await ht,St=it(mt,{...yt,gain:1});await lt(pt,mt,St);const Et=[];for(let zt=0;ztkt!==$t[Tt])||jt.some((kt,Tt)=>kt!==It[Tt])){$t=Ot,It=jt;const kt=zt/mt.sampleRate;Ft.gain.setValueAtTime(0,kt),Ft=it(mt,{...yt,gain:0}),Ht=rt(mt,{...wt,orientationX:$t[0],orientationY:$t[1],orientationZ:$t[2],positionX:It[0],positionY:It[1],positionZ:It[2]}),Ft.gain.setValueAtTime(1,kt),St.connect(Ft).connect(Ht.inputs[0]),Ht.connect(gt)}}return gt}return vt?(await tt(mt,pt.orientationX,bt.orientationX),await tt(mt,pt.orientationY,bt.orientationY),await tt(mt,pt.orientationZ,bt.orientationZ),await tt(mt,pt.positionX,bt.positionX),await tt(mt,pt.positionY,bt.positionY),await tt(mt,pt.positionZ,bt.positionZ)):(await st(mt,pt.orientationX,bt.orientationX),await st(mt,pt.orientationY,bt.orientationY),await st(mt,pt.orientationZ,bt.orientationZ),await st(mt,pt.positionX,bt.positionX),await st(mt,pt.positionY,bt.positionY),await st(mt,pt.positionZ,bt.positionZ)),isNativeAudioNodeFaker(bt)?await lt(pt,mt,bt.inputs[0]):await lt(pt,mt,bt),bt};return{render(pt,mt){const gt=ut.get(mt);return gt!==void 0?Promise.resolve(gt):dt(pt,mt)}}},DEFAULT_OPTIONS$2={disableNormalization:!1},createPeriodicWaveConstructor=(tt,et,nt,it)=>class kw{constructor(ot,at){const st=et(ot),lt=it({...DEFAULT_OPTIONS$2,...at}),ct=tt(st,lt);return nt.add(ct),ct}static[Symbol.hasInstance](ot){return ot!==null&&typeof ot=="object"&&Object.getPrototypeOf(ot)===kw.prototype||nt.has(ot)}},createRenderAutomation=(tt,et)=>(nt,it,rt)=>(tt(it).replay(rt),et(it,nt,rt)),createRenderInputsOfAudioNode=(tt,et,nt)=>async(it,rt,ot)=>{const at=tt(it);await Promise.all(at.activeInputs.map((st,lt)=>Array.from(st).map(async([ct,ut])=>{const dt=await et(ct).render(ct,rt),pt=it.context.destination;!nt(ct)&&(it!==pt||!nt(it))&&dt.connect(ot,ut,lt)})).reduce((st,lt)=>[...st,...lt],[]))},createRenderInputsOfAudioParam=(tt,et,nt)=>async(it,rt,ot)=>{const at=et(it);await Promise.all(Array.from(at.activeInputs).map(async([st,lt])=>{const ut=await tt(st).render(st,rt);nt(st)||ut.connect(ot,lt)}))},createRenderNativeOfflineAudioContext=(tt,et,nt,it)=>rt=>tt(testPromiseSupport,()=>testPromiseSupport(rt))?Promise.resolve(tt(it,it)).then(ot=>{if(!ot){const at=nt(rt,512,0,1);rt.oncomplete=()=>{at.onaudioprocess=null,at.disconnect()},at.onaudioprocess=()=>rt.currentTime,at.connect(rt.destination)}return rt.startRendering()}):new Promise(ot=>{const at=et(rt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});rt.oncomplete=st=>{at.disconnect(),ot(st.renderedBuffer)},at.connect(rt.destination),rt.startRendering()}),createSetActiveAudioWorkletNodeInputs=tt=>(et,nt)=>{tt.set(et,nt)},createSetAudioNodeTailTime=tt=>(et,nt)=>tt.set(et,nt),createStartRendering=(tt,et,nt,it,rt,ot,at,st)=>(lt,ct)=>nt(lt).render(lt,ct).then(()=>Promise.all(Array.from(it(ct)).map(ut=>nt(ut).render(ut,ct)))).then(()=>rt(ct)).then(ut=>(typeof ut.copyFromChannel!="function"?(at(ut),wrapAudioBufferGetChannelDataMethod(ut)):et(ot,()=>ot(ut))||st(ut),tt.add(ut),ut)),DEFAULT_OPTIONS$1={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},createStereoPannerNodeConstructor=(tt,et,nt,it,rt,ot)=>class extends tt{constructor(st,lt){const ct=rt(st),ut={...DEFAULT_OPTIONS$1,...lt},ht=nt(ct,ut),dt=ot(ct),pt=dt?it():null;super(st,!1,ht,pt),this._pan=et(this,dt,ht.pan)}get pan(){return this._pan}},createStereoPannerNodeRendererFactory=(tt,et,nt,it,rt)=>()=>{const ot=new WeakMap,at=async(st,lt)=>{let ct=nt(st);const ut=isOwnedByContext(ct,lt);if(!ut){const ht={channelCount:ct.channelCount,channelCountMode:ct.channelCountMode,channelInterpretation:ct.channelInterpretation,pan:ct.pan.value};ct=et(lt,ht)}return ot.set(lt,ct),ut?await tt(lt,st.pan,ct.pan):await it(lt,st.pan,ct.pan),isNativeAudioNodeFaker(ct)?await rt(st,lt,ct.inputs[0]):await rt(st,lt,ct),ct};return{render(st,lt){const ct=ot.get(lt);return ct!==void 0?Promise.resolve(ct):at(st,lt)}}},createTestAudioBufferConstructorSupport=tt=>()=>{if(tt===null)return!1;try{new tt({length:1,sampleRate:44100})}catch{return!1}return!0},createTestAudioWorkletProcessorPostMessageSupport=(tt,et)=>async()=>{if(tt===null)return!0;if(et===null)return!1;const nt=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"}),it=new et(1,128,44100),rt=URL.createObjectURL(nt);let ot=!1,at=!1;try{await it.audioWorklet.addModule(rt);const st=new tt(it,"a",{numberOfOutputs:0}),lt=it.createOscillator();st.port.onmessage=()=>ot=!0,st.onprocessorerror=()=>at=!0,lt.connect(st),lt.start(0),await it.startRendering(),await new Promise(ct=>setTimeout(ct))}catch{}finally{URL.revokeObjectURL(rt)}return ot&&!at},createTestOfflineAudioContextCurrentTimeSupport=(tt,et)=>()=>{if(et===null)return Promise.resolve(!1);const nt=new et(1,1,44100),it=tt(nt,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(rt=>{nt.oncomplete=()=>{it.disconnect(),rt(nt.currentTime!==0)},nt.startRendering()})},createUnknownError=()=>new DOMException("","UnknownError"),DEFAULT_OPTIONS={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},createWaveShaperNodeConstructor=(tt,et,nt,it,rt,ot,at)=>class extends tt{constructor(lt,ct){const ut=rt(lt),ht={...DEFAULT_OPTIONS,...ct},dt=nt(ut,ht),mt=ot(ut)?it():null;super(lt,!0,dt,mt),this._isCurveNullified=!1,this._nativeWaveShaperNode=dt,at(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(lt){if(lt===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(lt.length<2)throw et();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=lt}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(lt){this._nativeWaveShaperNode.oversample=lt}},createWaveShaperNodeRendererFactory=(tt,et,nt)=>()=>{const it=new WeakMap,rt=async(ot,at)=>{let st=et(ot);if(!isOwnedByContext(st,at)){const ct={channelCount:st.channelCount,channelCountMode:st.channelCountMode,channelInterpretation:st.channelInterpretation,curve:st.curve,oversample:st.oversample};st=tt(at,ct)}return it.set(at,st),isNativeAudioNodeFaker(st)?await nt(ot,at,st.inputs[0]):await nt(ot,at,st),st};return{render(ot,at){const st=it.get(at);return st!==void 0?Promise.resolve(st):rt(ot,at)}}},createWindow=()=>typeof window>"u"?null:window,createWrapAudioBufferCopyChannelMethods=(tt,et)=>nt=>{nt.copyFromChannel=(it,rt,ot=0)=>{const at=tt(ot),st=tt(rt);if(st>=nt.numberOfChannels)throw et();const lt=nt.length,ct=nt.getChannelData(st),ut=it.length;for(let ht=at<0?-at:0;ht+at{const at=tt(ot),st=tt(rt);if(st>=nt.numberOfChannels)throw et();const lt=nt.length,ct=nt.getChannelData(st),ut=it.length;for(let ht=at<0?-at:0;ht+atet=>{et.copyFromChannel=(nt=>(it,rt,ot=0)=>{const at=tt(ot),st=tt(rt);if(at(it,rt,ot=0)=>{const at=tt(ot),st=tt(rt);if(at(et,nt)=>{const it=nt.createBuffer(1,1,44100);et.buffer===null&&(et.buffer=it),tt(et,"buffer",rt=>()=>{const ot=rt.call(et);return ot===it?null:ot},rt=>ot=>rt.call(et,ot===null?it:ot))},createWrapChannelMergerNode=(tt,et)=>(nt,it)=>{it.channelCount=1,it.channelCountMode="explicit",Object.defineProperty(it,"channelCount",{get:()=>1,set:()=>{throw tt()}}),Object.defineProperty(it,"channelCountMode",{get:()=>"explicit",set:()=>{throw tt()}});const rt=nt.createBufferSource();et(it,()=>{const st=it.numberOfInputs;for(let lt=0;ltrt.disconnect(it))},getFirstSample=(tt,et,nt)=>tt.copyFromChannel===void 0?tt.getChannelData(nt)[0]:(tt.copyFromChannel(et,nt),et[0]),isDCCurve=tt=>{if(tt===null)return!1;const et=tt.length;return et%2!==0?tt[Math.floor(et/2)]!==0:tt[et/2-1]+tt[et/2]!==0},overwriteAccessors=(tt,et,nt,it)=>{let rt=tt;for(;!rt.hasOwnProperty(et);)rt=Object.getPrototypeOf(rt);const{get:ot,set:at}=Object.getOwnPropertyDescriptor(rt,et);Object.defineProperty(tt,et,{get:nt(ot),set:it(at)})},sanitizeAudioWorkletNodeOptions=tt=>({...tt,outputChannelCount:tt.outputChannelCount!==void 0?tt.outputChannelCount:tt.numberOfInputs===1&&tt.numberOfOutputs===1?[tt.channelCount]:Array.from({length:tt.numberOfOutputs},()=>1)}),sanitizeChannelSplitterOptions=tt=>({...tt,channelCount:tt.numberOfOutputs}),sanitizePeriodicWaveOptions=tt=>{const{imag:et,real:nt}=tt;return et===void 0?nt===void 0?{...tt,imag:[0,0],real:[0,0]}:{...tt,imag:Array.from(nt,()=>0),real:nt}:nt===void 0?{...tt,imag:et,real:Array.from(et,()=>0)}:{...tt,imag:et,real:nt}},setValueAtTimeUntilPossible=(tt,et,nt)=>{try{tt.setValueAtTime(et,nt)}catch(it){if(it.code!==9)throw it;setValueAtTimeUntilPossible(tt,et,nt+1e-7)}},testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport=tt=>{const et=tt.createBufferSource();et.start();try{et.start()}catch{return!0}return!1},testAudioBufferSourceNodeStartMethodOffsetClampingSupport=tt=>{const et=tt.createBufferSource(),nt=tt.createBuffer(1,1,44100);et.buffer=nt;try{et.start(0,1)}catch{return!1}return!0},testAudioBufferSourceNodeStopMethodNullifiedBufferSupport=tt=>{const et=tt.createBufferSource();et.start();try{et.stop()}catch{return!1}return!0},testAudioScheduledSourceNodeStartMethodNegativeParametersSupport=tt=>{const et=tt.createOscillator();try{et.start(-1)}catch(nt){return nt instanceof RangeError}return!1},testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport=tt=>{const et=tt.createBuffer(1,1,44100),nt=tt.createBufferSource();nt.buffer=et,nt.start(),nt.stop();try{return nt.stop(),!0}catch{return!1}},testAudioScheduledSourceNodeStopMethodNegativeParametersSupport=tt=>{const et=tt.createOscillator();try{et.stop(-1)}catch(nt){return nt instanceof RangeError}return!1},testAudioWorkletNodeOptionsClonability=tt=>{const{port1:et,port2:nt}=new MessageChannel;try{et.postMessage(tt)}finally{et.close(),nt.close()}},wrapAudioBufferSourceNodeStartMethodOffsetClamping=tt=>{tt.start=(et=>(nt=0,it=0,rt)=>{const ot=tt.buffer,at=ot===null?it:Math.min(ot.duration,it);ot!==null&&at>ot.duration-.5/tt.context.sampleRate?et.call(tt,nt,0,0):et.call(tt,nt,at,rt)})(tt.start)},wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls=(tt,et)=>{const nt=et.createGain();tt.connect(nt);const it=(rt=>()=>{rt.call(tt,nt),tt.removeEventListener("ended",it)})(tt.disconnect);tt.addEventListener("ended",it),interceptConnections(tt,nt),tt.stop=(rt=>{let ot=!1;return(at=0)=>{if(ot)try{rt.call(tt,at)}catch{nt.gain.setValueAtTime(0,at)}else rt.call(tt,at),ot=!0}})(tt.stop)},wrapEventListener=(tt,et)=>nt=>{const it={value:tt};return Object.defineProperties(nt,{currentTarget:it,target:it}),typeof et=="function"?et.call(tt,nt):et.handleEvent.call(tt,nt)},addActiveInputConnectionToAudioNode=createAddActiveInputConnectionToAudioNode(insertElementInSet),addPassiveInputConnectionToAudioNode=createAddPassiveInputConnectionToAudioNode(insertElementInSet),deleteActiveInputConnectionToAudioNode=createDeleteActiveInputConnectionToAudioNode(pickElementFromSet),audioNodeTailTimeStore=new WeakMap,getAudioNodeTailTime=createGetAudioNodeTailTime(audioNodeTailTimeStore),cacheTestResult=createCacheTestResult(new Map,new WeakMap),window$1=createWindow(),createNativeAnalyserNode=createNativeAnalyserNodeFactory(cacheTestResult,createIndexSizeError),getAudioNodeRenderer=createGetAudioNodeRenderer(getAudioNodeConnections),renderInputsOfAudioNode=createRenderInputsOfAudioNode(getAudioNodeConnections,getAudioNodeRenderer,isPartOfACycle),createAnalyserNodeRenderer=createAnalyserNodeRendererFactory(createNativeAnalyserNode,getNativeAudioNode,renderInputsOfAudioNode),getNativeContext=createGetNativeContext(CONTEXT_STORE),nativeOfflineAudioContextConstructor=createNativeOfflineAudioContextConstructor(window$1),isNativeOfflineAudioContext=createIsNativeOfflineAudioContext(nativeOfflineAudioContextConstructor),audioParamAudioNodeStore=new WeakMap,eventTargetConstructor=createEventTargetConstructor(wrapEventListener),nativeAudioContextConstructor=createNativeAudioContextConstructor(window$1),isNativeAudioContext=createIsNativeAudioContext(nativeAudioContextConstructor),isNativeAudioNode=createIsNativeAudioNode(window$1),isNativeAudioParam=createIsNativeAudioParam(window$1),nativeAudioWorkletNodeConstructor=createNativeAudioWorkletNodeConstructor(window$1),audioNodeConstructor=createAudioNodeConstructor(createAddAudioNodeConnections(AUDIO_NODE_CONNECTIONS_STORE),createAddConnectionToAudioNode(addActiveInputConnectionToAudioNode,addPassiveInputConnectionToAudioNode,connectNativeAudioNodeToNativeAudioNode,deleteActiveInputConnectionToAudioNode,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getAudioNodeTailTime,getEventListenersOfAudioNode,getNativeAudioNode,insertElementInSet,isActiveAudioNode,isPartOfACycle,isPassiveAudioNode),cacheTestResult,createIncrementCycleCounterFactory(CYCLE_COUNTERS,disconnectNativeAudioNodeFromNativeAudioNode,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,isActiveAudioNode),createIndexSizeError,createInvalidAccessError,createNotSupportedError,createDecrementCycleCounter(connectNativeAudioNodeToNativeAudioNode,CYCLE_COUNTERS,getAudioNodeConnections,getNativeAudioNode,getNativeAudioParam,getNativeContext,isActiveAudioNode,isNativeOfflineAudioContext),createDetectCycles(audioParamAudioNodeStore,getAudioNodeConnections,getValueForKey),eventTargetConstructor,getNativeContext,isNativeAudioContext,isNativeAudioNode,isNativeAudioParam,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor),analyserNodeConstructor=createAnalyserNodeConstructor(audioNodeConstructor,createAnalyserNodeRenderer,createIndexSizeError,createNativeAnalyserNode,getNativeContext,isNativeOfflineAudioContext),audioBufferStore=new WeakSet,nativeAudioBufferConstructor=createNativeAudioBufferConstructor(window$1),convertNumberToUnsignedLong=createConvertNumberToUnsignedLong(new Uint32Array(1)),wrapAudioBufferCopyChannelMethods=createWrapAudioBufferCopyChannelMethods(convertNumberToUnsignedLong,createIndexSizeError),wrapAudioBufferCopyChannelMethodsOutOfBounds=createWrapAudioBufferCopyChannelMethodsOutOfBounds(convertNumberToUnsignedLong),audioBufferConstructor=createAudioBufferConstructor(audioBufferStore,cacheTestResult,createNotSupportedError,nativeAudioBufferConstructor,nativeOfflineAudioContextConstructor,createTestAudioBufferConstructorSupport(nativeAudioBufferConstructor),wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),addSilentConnection=createAddSilentConnection(createNativeGainNode),renderInputsOfAudioParam=createRenderInputsOfAudioParam(getAudioNodeRenderer,getAudioParamConnections,isPartOfACycle),connectAudioParam=createConnectAudioParam(renderInputsOfAudioParam),createNativeAudioBufferSourceNode=createNativeAudioBufferSourceNodeFactory(addSilentConnection,cacheTestResult,testAudioBufferSourceNodeStartMethodConsecutiveCallsSupport,testAudioBufferSourceNodeStartMethodOffsetClampingSupport,testAudioBufferSourceNodeStopMethodNullifiedBufferSupport,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioBufferSourceNodeStartMethodOffsetClamping,createWrapAudioBufferSourceNodeStopMethodNullifiedBuffer(overwriteAccessors),wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),renderAutomation=createRenderAutomation(createGetAudioParamRenderer(getAudioParamConnections),renderInputsOfAudioParam),createAudioBufferSourceNodeRenderer=createAudioBufferSourceNodeRendererFactory(connectAudioParam,createNativeAudioBufferSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),createAudioParam=createAudioParamFactory(createAddAudioParamConnections(AUDIO_PARAM_CONNECTIONS_STORE),audioParamAudioNodeStore,AUDIO_PARAM_STORE,createAudioParamRenderer,createCancelAndHoldAutomationEvent,createCancelScheduledValuesAutomationEvent,createExponentialRampToValueAutomationEvent,createLinearRampToValueAutomationEvent,createSetTargetAutomationEvent,createSetValueAutomationEvent,createSetValueCurveAutomationEvent,nativeAudioContextConstructor,setValueAtTimeUntilPossible),audioBufferSourceNodeConstructor=createAudioBufferSourceNodeConstructor(audioNodeConstructor,createAudioBufferSourceNodeRenderer,createAudioParam,createInvalidStateError,createNativeAudioBufferSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),audioDestinationNodeConstructor=createAudioDestinationNodeConstructor(audioNodeConstructor,createAudioDestinationNodeRenderer,createIndexSizeError,createInvalidStateError,createNativeAudioDestinationNodeFactory(createNativeGainNode,overwriteAccessors),getNativeContext,isNativeOfflineAudioContext,renderInputsOfAudioNode),createBiquadFilterNodeRenderer=createBiquadFilterNodeRendererFactory(connectAudioParam,createNativeBiquadFilterNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),setAudioNodeTailTime=createSetAudioNodeTailTime(audioNodeTailTimeStore),biquadFilterNodeConstructor=createBiquadFilterNodeConstructor(audioNodeConstructor,createAudioParam,createBiquadFilterNodeRenderer,createInvalidAccessError,createNativeBiquadFilterNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),monitorConnections=createMonitorConnections(insertElementInSet,isNativeAudioNode),wrapChannelMergerNode=createWrapChannelMergerNode(createInvalidStateError,monitorConnections),createNativeChannelMergerNode=createNativeChannelMergerNodeFactory(nativeAudioContextConstructor,wrapChannelMergerNode),createChannelMergerNodeRenderer=createChannelMergerNodeRendererFactory(createNativeChannelMergerNode,getNativeAudioNode,renderInputsOfAudioNode),channelMergerNodeConstructor=createChannelMergerNodeConstructor(audioNodeConstructor,createChannelMergerNodeRenderer,createNativeChannelMergerNode,getNativeContext,isNativeOfflineAudioContext),createChannelSplitterNodeRenderer=createChannelSplitterNodeRendererFactory(createNativeChannelSplitterNode,getNativeAudioNode,renderInputsOfAudioNode),channelSplitterNodeConstructor=createChannelSplitterNodeConstructor(audioNodeConstructor,createChannelSplitterNodeRenderer,createNativeChannelSplitterNode,getNativeContext,isNativeOfflineAudioContext,sanitizeChannelSplitterOptions),createNativeConstantSourceNodeFaker=createNativeConstantSourceNodeFakerFactory(addSilentConnection,createNativeAudioBufferSourceNode,createNativeGainNode,monitorConnections),createNativeConstantSourceNode=createNativeConstantSourceNodeFactory(addSilentConnection,cacheTestResult,createNativeConstantSourceNodeFaker,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport),createConstantSourceNodeRenderer=createConstantSourceNodeRendererFactory(connectAudioParam,createNativeConstantSourceNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),constantSourceNodeConstructor=createConstantSourceNodeConstructor(audioNodeConstructor,createAudioParam,createConstantSourceNodeRenderer,createNativeConstantSourceNode,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createNativeConvolverNode=createNativeConvolverNodeFactory(createNotSupportedError,overwriteAccessors),createConvolverNodeRenderer=createConvolverNodeRendererFactory(createNativeConvolverNode,getNativeAudioNode,renderInputsOfAudioNode),convolverNodeConstructor=createConvolverNodeConstructor(audioNodeConstructor,createConvolverNodeRenderer,createNativeConvolverNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createDelayNodeRenderer=createDelayNodeRendererFactory(connectAudioParam,createNativeDelayNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),delayNodeConstructor=createDelayNodeConstructor(audioNodeConstructor,createAudioParam,createDelayNodeRenderer,createNativeDelayNode,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativeDynamicsCompressorNode=createNativeDynamicsCompressorNodeFactory(createNotSupportedError),createDynamicsCompressorNodeRenderer=createDynamicsCompressorNodeRendererFactory(connectAudioParam,createNativeDynamicsCompressorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),dynamicsCompressorNodeConstructor=createDynamicsCompressorNodeConstructor(audioNodeConstructor,createAudioParam,createDynamicsCompressorNodeRenderer,createNativeDynamicsCompressorNode,createNotSupportedError,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createGainNodeRenderer=createGainNodeRendererFactory(connectAudioParam,createNativeGainNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),gainNodeConstructor=createGainNodeConstructor(audioNodeConstructor,createAudioParam,createGainNodeRenderer,createNativeGainNode,getNativeContext,isNativeOfflineAudioContext),createNativeIIRFilterNodeFaker=createNativeIIRFilterNodeFakerFactory(createInvalidAccessError,createInvalidStateError,createNativeScriptProcessorNode,createNotSupportedError),renderNativeOfflineAudioContext=createRenderNativeOfflineAudioContext(cacheTestResult,createNativeGainNode,createNativeScriptProcessorNode,createTestOfflineAudioContextCurrentTimeSupport(createNativeGainNode,nativeOfflineAudioContextConstructor)),createIIRFilterNodeRenderer=createIIRFilterNodeRendererFactory(createNativeAudioBufferSourceNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderInputsOfAudioNode,renderNativeOfflineAudioContext),createNativeIIRFilterNode=createNativeIIRFilterNodeFactory(createNativeIIRFilterNodeFaker),iIRFilterNodeConstructor=createIIRFilterNodeConstructor(audioNodeConstructor,createNativeIIRFilterNode,createIIRFilterNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createAudioListener=createAudioListenerFactory(createAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeScriptProcessorNode,createNotSupportedError,getFirstSample,isNativeOfflineAudioContext,overwriteAccessors),unrenderedAudioWorkletNodeStore=new WeakMap,minimalBaseAudioContextConstructor=createMinimalBaseAudioContextConstructor(audioDestinationNodeConstructor,createAudioListener,eventTargetConstructor,isNativeOfflineAudioContext,unrenderedAudioWorkletNodeStore,wrapEventListener),createNativeOscillatorNode=createNativeOscillatorNodeFactory(addSilentConnection,cacheTestResult,testAudioScheduledSourceNodeStartMethodNegativeParametersSupport,testAudioScheduledSourceNodeStopMethodConsecutiveCallsSupport,testAudioScheduledSourceNodeStopMethodNegativeParametersSupport,wrapAudioScheduledSourceNodeStopMethodConsecutiveCalls),createOscillatorNodeRenderer=createOscillatorNodeRendererFactory(connectAudioParam,createNativeOscillatorNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),oscillatorNodeConstructor=createOscillatorNodeConstructor(audioNodeConstructor,createAudioParam,createNativeOscillatorNode,createOscillatorNodeRenderer,getNativeContext,isNativeOfflineAudioContext,wrapEventListener),createConnectedNativeAudioBufferSourceNode=createConnectedNativeAudioBufferSourceNodeFactory(createNativeAudioBufferSourceNode),createNativeWaveShaperNodeFaker=createNativeWaveShaperNodeFakerFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeGainNode,isDCCurve,monitorConnections),createNativeWaveShaperNode=createNativeWaveShaperNodeFactory(createConnectedNativeAudioBufferSourceNode,createInvalidStateError,createNativeWaveShaperNodeFaker,isDCCurve,monitorConnections,nativeAudioContextConstructor,overwriteAccessors),createNativePannerNodeFaker=createNativePannerNodeFakerFactory(connectNativeAudioNodeToNativeAudioNode,createInvalidStateError,createNativeChannelMergerNode,createNativeGainNode,createNativeScriptProcessorNode,createNativeWaveShaperNode,createNotSupportedError,disconnectNativeAudioNodeFromNativeAudioNode,getFirstSample,monitorConnections),createNativePannerNode=createNativePannerNodeFactory(createNativePannerNodeFaker),createPannerNodeRenderer=createPannerNodeRendererFactory(connectAudioParam,createNativeChannelMergerNode,createNativeConstantSourceNode,createNativeGainNode,createNativePannerNode,getNativeAudioNode,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),pannerNodeConstructor=createPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativePannerNode,createPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),createNativePeriodicWave=createNativePeriodicWaveFactory(createIndexSizeError),periodicWaveConstructor=createPeriodicWaveConstructor(createNativePeriodicWave,getNativeContext,new WeakSet,sanitizePeriodicWaveOptions),nativeStereoPannerNodeFakerFactory=createNativeStereoPannerNodeFakerFactory(createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeGainNode,createNativeWaveShaperNode,createNotSupportedError,monitorConnections),createNativeStereoPannerNode=createNativeStereoPannerNodeFactory(nativeStereoPannerNodeFakerFactory,createNotSupportedError),createStereoPannerNodeRenderer=createStereoPannerNodeRendererFactory(connectAudioParam,createNativeStereoPannerNode,getNativeAudioNode,renderAutomation,renderInputsOfAudioNode),stereoPannerNodeConstructor=createStereoPannerNodeConstructor(audioNodeConstructor,createAudioParam,createNativeStereoPannerNode,createStereoPannerNodeRenderer,getNativeContext,isNativeOfflineAudioContext),createWaveShaperNodeRenderer=createWaveShaperNodeRendererFactory(createNativeWaveShaperNode,getNativeAudioNode,renderInputsOfAudioNode),waveShaperNodeConstructor=createWaveShaperNodeConstructor(audioNodeConstructor,createInvalidStateError,createNativeWaveShaperNode,createWaveShaperNodeRenderer,getNativeContext,isNativeOfflineAudioContext,setAudioNodeTailTime),isSecureContext=createIsSecureContext(window$1),exposeCurrentFrameAndCurrentTime=createExposeCurrentFrameAndCurrentTime(window$1),backupOfflineAudioContextStore=new WeakMap,getOrCreateBackupOfflineAudioContext=createGetOrCreateBackupOfflineAudioContext(backupOfflineAudioContextStore,nativeOfflineAudioContextConstructor),addAudioWorkletModule=isSecureContext?createAddAudioWorkletModule(cacheTestResult,createNotSupportedError,createEvaluateSource(window$1),exposeCurrentFrameAndCurrentTime,createFetchSource(createAbortError),getNativeContext,getOrCreateBackupOfflineAudioContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,new WeakMap,new WeakMap,createTestAudioWorkletProcessorPostMessageSupport(nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor),window$1):void 0,isNativeContext=createIsNativeContext(isNativeAudioContext,isNativeOfflineAudioContext),decodeAudioData=createDecodeAudioData(audioBufferStore,cacheTestResult,createDataCloneError,createEncodingError,new WeakSet,getNativeContext,isNativeContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,testPromiseSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),baseAudioContextConstructor=createBaseAudioContextConstructor(addAudioWorkletModule,analyserNodeConstructor,audioBufferConstructor,audioBufferSourceNodeConstructor,biquadFilterNodeConstructor,channelMergerNodeConstructor,channelSplitterNodeConstructor,constantSourceNodeConstructor,convolverNodeConstructor,decodeAudioData,delayNodeConstructor,dynamicsCompressorNodeConstructor,gainNodeConstructor,iIRFilterNodeConstructor,minimalBaseAudioContextConstructor,oscillatorNodeConstructor,pannerNodeConstructor,periodicWaveConstructor,stereoPannerNodeConstructor,waveShaperNodeConstructor),mediaElementAudioSourceNodeConstructor=createMediaElementAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaElementAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioDestinationNodeConstructor=createMediaStreamAudioDestinationNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioDestinationNode,getNativeContext,isNativeOfflineAudioContext),mediaStreamAudioSourceNodeConstructor=createMediaStreamAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamAudioSourceNode,getNativeContext,isNativeOfflineAudioContext),createNativeMediaStreamTrackAudioSourceNode=createNativeMediaStreamTrackAudioSourceNodeFactory(createInvalidStateError,isNativeOfflineAudioContext),mediaStreamTrackAudioSourceNodeConstructor=createMediaStreamTrackAudioSourceNodeConstructor(audioNodeConstructor,createNativeMediaStreamTrackAudioSourceNode,getNativeContext),audioContextConstructor=createAudioContextConstructor(baseAudioContextConstructor,createInvalidStateError,createNotSupportedError,createUnknownError,mediaElementAudioSourceNodeConstructor,mediaStreamAudioDestinationNodeConstructor,mediaStreamAudioSourceNodeConstructor,mediaStreamTrackAudioSourceNodeConstructor,nativeAudioContextConstructor),getUnrenderedAudioWorkletNodes=createGetUnrenderedAudioWorkletNodes(unrenderedAudioWorkletNodeStore),addUnrenderedAudioWorkletNode=createAddUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),connectMultipleOutputs=createConnectMultipleOutputs(createIndexSizeError),deleteUnrenderedAudioWorkletNode=createDeleteUnrenderedAudioWorkletNode(getUnrenderedAudioWorkletNodes),disconnectMultipleOutputs=createDisconnectMultipleOutputs(createIndexSizeError),activeAudioWorkletNodeInputsStore=new WeakMap,getActiveAudioWorkletNodeInputs=createGetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore,getValueForKey),createNativeAudioWorkletNodeFaker=createNativeAudioWorkletNodeFakerFactory(connectMultipleOutputs,createIndexSizeError,createInvalidStateError,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,createNativeScriptProcessorNode,createNotSupportedError,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getActiveAudioWorkletNodeInputs,monitorConnections),createNativeAudioWorkletNode=createNativeAudioWorkletNodeFactory(createInvalidStateError,createNativeAudioWorkletNodeFaker,createNativeGainNode,createNotSupportedError,monitorConnections),createAudioWorkletNodeRenderer=createAudioWorkletNodeRendererFactory(connectAudioParam,connectMultipleOutputs,createNativeAudioBufferSourceNode,createNativeChannelMergerNode,createNativeChannelSplitterNode,createNativeConstantSourceNode,createNativeGainNode,deleteUnrenderedAudioWorkletNode,disconnectMultipleOutputs,exposeCurrentFrameAndCurrentTime,getNativeAudioNode,nativeAudioWorkletNodeConstructor,nativeOfflineAudioContextConstructor,renderAutomation,renderInputsOfAudioNode,renderNativeOfflineAudioContext),getBackupOfflineAudioContext=createGetBackupOfflineAudioContext(backupOfflineAudioContextStore),setActiveAudioWorkletNodeInputs=createSetActiveAudioWorkletNodeInputs(activeAudioWorkletNodeInputsStore),audioWorkletNodeConstructor=isSecureContext?createAudioWorkletNodeConstructor(addUnrenderedAudioWorkletNode,audioNodeConstructor,createAudioParam,createAudioWorkletNodeRenderer,createNativeAudioWorkletNode,getAudioNodeConnections,getBackupOfflineAudioContext,getNativeContext,isNativeOfflineAudioContext,nativeAudioWorkletNodeConstructor,sanitizeAudioWorkletNodeOptions,setActiveAudioWorkletNodeInputs,testAudioWorkletNodeOptionsClonability,wrapEventListener):void 0,createNativeOfflineAudioContext=createCreateNativeOfflineAudioContext(createNotSupportedError,nativeOfflineAudioContextConstructor),startRendering=createStartRendering(audioBufferStore,cacheTestResult,getAudioNodeRenderer,getUnrenderedAudioWorkletNodes,renderNativeOfflineAudioContext,testAudioBufferCopyChannelMethodsOutOfBoundsSupport,wrapAudioBufferCopyChannelMethods,wrapAudioBufferCopyChannelMethodsOutOfBounds),offlineAudioContextConstructor=createOfflineAudioContextConstructor(baseAudioContextConstructor,cacheTestResult,createInvalidStateError,createNativeOfflineAudioContext,startRendering),isAnyAudioContext=createIsAnyAudioContext(CONTEXT_STORE,isNativeAudioContext),isAnyAudioNode=createIsAnyAudioNode(AUDIO_NODE_STORE,isNativeAudioNode),isAnyAudioParam=createIsAnyAudioParam(AUDIO_PARAM_STORE,isNativeAudioParam),isAnyOfflineAudioContext=createIsAnyOfflineAudioContext(CONTEXT_STORE,isNativeOfflineAudioContext);function isUndef(tt){return typeof tt>"u"}function isDefined(tt){return!isUndef(tt)}function isFunction(tt){return typeof tt=="function"}function isNumber$4(tt){return typeof tt=="number"}function isObject$6(tt){return Object.prototype.toString.call(tt)==="[object Object]"&&tt.constructor===Object}function isBoolean$2(tt){return typeof tt=="boolean"}function isArray$e(tt){return Array.isArray(tt)}function isString$2(tt){return typeof tt=="string"}function isNote(tt){return isString$2(tt)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(tt)}function assert(tt,et){if(!tt)throw new Error(et)}function assertRange(tt,et,nt=1/0){if(!(et<=tt&&tt<=nt))throw new RangeError(`Value must be within [${et}, ${nt}], got: ${tt}`)}function assertContextRunning(tt){!tt.isOffline&&tt.state!=="running"&&warn$1('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let isInsideScheduledCallback=!1,printedScheduledWarning=!1;function enterScheduledCallback(tt){isInsideScheduledCallback=tt}function assertUsedScheduleTime(tt){isUndef(tt)&&isInsideScheduledCallback&&!printedScheduledWarning&&(printedScheduledWarning=!0,warn$1("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let defaultLogger=console;function log$1(...tt){defaultLogger.log(...tt)}function warn$1(...tt){defaultLogger.warn(...tt)}function createAudioContext(tt){return new audioContextConstructor(tt)}function createOfflineAudioContext(tt,et,nt){return new offlineAudioContextConstructor(tt,et,nt)}const theWindow=typeof self=="object"?self:null,hasAudioContext=theWindow&&(theWindow.hasOwnProperty("AudioContext")||theWindow.hasOwnProperty("webkitAudioContext"));function createAudioWorkletNode(tt,et,nt){return assert(isDefined(audioWorkletNodeConstructor),"This node only works in a secure context (https or localhost)"),new audioWorkletNodeConstructor(tt,et,nt)}class Ticker{constructor(et,nt,it,rt){this._callback=et,this._type=nt,this._minimumUpdateInterval=Math.max(128/(rt||44100),.001),this.updateInterval=it,this._createClock()}_createWorker(){const et=new Blob([` // the initial timeout time let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; // onmessage callback @@ -4994,7 +4994,7 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co return val; } } -`;registerProcessor(workletName,bitCrusherWorklet);class Merge extends ToneAudioNode{constructor(){super(optionsFromArguments(Merge.getDefaults(),arguments,["channels"])),this.name="Merge";const et=optionsFromArguments(Merge.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(et.channels)}static getDefaults(){return Object.assign(ToneAudioNode.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Reverb extends Effect{constructor(){super(optionsFromArguments(Reverb.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const et=optionsFromArguments(Reverb.getDefaults(),arguments,["decay"]);this._decay=et.decay,this._preDelay=et.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(Effect.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(et){et=this.toSeconds(et),assertRange(et,.001),this._decay=et,this.generate()}get preDelay(){return this._preDelay}set preDelay(et){et=this.toSeconds(et),assertRange(et,0),this._preDelay=et,this.generate()}generate(){return __awaiter(this,void 0,void 0,function*(){const et=this.ready,nt=new OfflineContext(2,this._decay+this._preDelay,this.context.sampleRate),it=new Noise({context:nt}),rt=new Noise({context:nt}),ot=new Merge({context:nt});it.connect(ot,0,0),rt.connect(ot,0,1);const at=new Gain({context:nt}).toDestination();ot.connect(at),it.start(0),rt.start(0),at.gain.setValueAtTime(0,0),at.gain.setValueAtTime(1,this._preDelay),at.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const st=nt.render();return this.ready=st.then(noOp),yield et,this._convolver.buffer=(yield st).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class Solo extends ToneAudioNode{constructor(){super(optionsFromArguments(Solo.getDefaults(),arguments,["solo"])),this.name="Solo";const et=optionsFromArguments(Solo.getDefaults(),arguments,["solo"]);this.input=this.output=new Gain({context:this.context}),Solo._allSolos.has(this.context)||Solo._allSolos.set(this.context,new Set),Solo._allSolos.get(this.context).add(this),this.solo=et.solo}static getDefaults(){return Object.assign(ToneAudioNode.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(et){et?this._addSolo():this._removeSolo(),Solo._allSolos.get(this.context).forEach(nt=>nt._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){Solo._soloed.has(this.context)||Solo._soloed.set(this.context,new Set),Solo._soloed.get(this.context).add(this)}_removeSolo(){Solo._soloed.has(this.context)&&Solo._soloed.get(this.context).delete(this)}_isSoloed(){return Solo._soloed.has(this.context)&&Solo._soloed.get(this.context).has(this)}_noSolos(){return!Solo._soloed.has(this.context)||Solo._soloed.has(this.context)&&Solo._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(),Solo._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Solo._allSolos=new Map;Solo._soloed=new Map;class PanVol extends ToneAudioNode{constructor(){super(optionsFromArguments(PanVol.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const et=optionsFromArguments(PanVol.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Panner({context:this.context,pan:et.pan,channelCount:et.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Volume({context:this.context,volume:et.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=et.mute,readOnly(this,["pan","volume"])}static getDefaults(){return Object.assign(ToneAudioNode.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(et){this._volume.mute=et}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class Channel extends ToneAudioNode{constructor(){super(optionsFromArguments(Channel.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const et=optionsFromArguments(Channel.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Solo({solo:et.solo,context:this.context}),this._panVol=this.output=new PanVol({context:this.context,pan:et.pan,volume:et.volume,mute:et.mute,channelCount:et.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),readOnly(this,["pan","volume"])}static getDefaults(){return Object.assign(ToneAudioNode.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(et){this._solo.solo=et}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(et){this._panVol.mute=et}_getBus(et){return Channel.buses.has(et)||Channel.buses.set(et,new Gain({context:this.context})),Channel.buses.get(et)}send(et,nt=0){const it=this._getBus(et),rt=new Gain({context:this.context,units:"decibels",gain:nt});return this.connect(rt),rt.connect(it),rt}receive(et){return this._getBus(et).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}Channel.buses=new Map;class Listener extends ToneAudioNode{constructor(){super(...arguments),this.name="Listener",this.positionX=new Param({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new Param({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new Param({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new Param({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new Param({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new Param({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new Param({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new Param({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new Param({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(ToneAudioNode.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}}onContextInit(tt=>{tt.listener=new Listener({context:tt})});onContextClose(tt=>{tt.listener.dispose()});getContext().transport;const Destination=getContext().destination;getContext().destination;getContext().listener;getContext().draw;getContext();const highPassFilter=new Filter$1(900,"highpass"),effectsBus=new Volume(-6);effectsBus.chain(highPassFilter,Destination);const reverb=new Reverb(3).connect(effectsBus),monoSynth=new MonoSynth({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});monoSynth.oscillator.type="triangle2";monoSynth.volume.value=-6;monoSynth.chain(highPassFilter,Destination);const monoSynth2=new MonoSynth({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(reverb);monoSynth2.oscillator.type="triangle";monoSynth2.volume.value=-6;monoSynth2.chain(highPassFilter,Destination);function addOrganicVariant(){return Math.floor((Math.random()-.5)*20)}let toneStarted=!1;const playInspectSound=async(tt=0)=>{toneStarted||(await start$1(),toneStarted=!0);try{if(tt>2e3)monoSynth2.triggerAttackRelease(60,.3);else if(tt>1e3){let et=310;et+=addOrganicVariant(),monoSynth.triggerAttackRelease(et,.001)}}catch(et){console.warn(et)}};let lookAtAnimationTimer,departAnimationTimer;const departAnimationTimerLength=4e3,lookAtAnimationTimerLength=2e3,useAutoNavigate=tt=>{const et=useSelectedNode(),nt=useDataStore(It=>It.cameraFocusTrigger),it=useControlStore(It=>It.isUserDragging),rt=useControlStore(It=>It.isUserScrolling),ot=useControlStore(It=>It.setUserMovedCamera),at=useDataStore(It=>It.setNearbyNodeIds),st=useDataStore(It=>It.showSelectionGraph),lt=useDataStore(It=>It.data),ct=useDataStore(It=>It.graphStyle),{camera:ut}=useThree(),[ht,dt]=reactExports.useState(!1),[pt,mt]=reactExports.useState(!1),[gt,bt]=reactExports.useState(arriveDistance),yt=reactExports.useMemo(()=>{if(st)return new Vector3(0,0,0);const It=lt==null?void 0:lt.nodes.find($t=>$t.ref_id===(et==null?void 0:et.ref_id));let Tt=new Vector3(2e3,2e3,3e3);if(It&<){const $t=lt==null?void 0:lt.nodes.filter(kt=>{var At;return(At=It.children)==null?void 0:At.find(Rt=>Rt===kt.id)}),Ut=new Vector3(It.x,It.y,It.z);let Lt=new Vector3(0,0,0);$t.map(kt=>(Lt=Lt.add(new Vector3(kt.x,kt.y,kt.z).normalize()),kt));const Bt=It.scale?1-1/(It.scale+10):1,Pt=Ut.sub(Lt).multiplyScalar(.8*Bt);Tt=Ut.add(Pt)}return Tt},[st,et,lt]),wt=reactExports.useMemo(()=>{if(st)return new Vector3(0,0,0);const It=lt==null?void 0:lt.nodes.find(Tt=>Tt.ref_id===(et==null?void 0:et.ref_id));return new Vector3((It==null?void 0:It.x)||0,(It==null?void 0:It.y)||0,(It==null?void 0:It.z)||0)},[st,et,lt]);reactExports.useEffect(()=>{var It;st&&((It=tt.current)==null||It.setLookAt(selectionGraphCameraPosition.x,selectionGraphCameraPosition.y,selectionGraphCameraPosition.z,0,0,0,!1)),vt()},[st]),reactExports.useEffect(()=>{st?bt(selectionGraphDistance):(et==null?void 0:et.node_type)==="topic"?bt(topicArriveDistance):bt(arriveDistance)},[et,bt,st]),reactExports.useEffect(()=>{xt()},[nt]),reactExports.useEffect(()=>{(it||rt)&&(dt(!0),mt(!0))},[it,rt,dt,mt]),reactExports.useEffect(()=>{if(et)if(!st&&ct==="earth"&&(tt!=null&&tt.current)){const It=tt.current.camera.position.distanceTo(new Vector3),Tt=getPointAbove(wt,-It/2);tt.current.setLookAt(Tt.x,Tt.y,Tt.z,0,0,0,!0)}else lookAtAnimationTimer&&clearTimeout(lookAtAnimationTimer),lookAtAnimationTimer=setTimeout(()=>{mt(!0),clearTimeout(lookAtAnimationTimer)},lookAtAnimationTimerLength),vt();return()=>{lookAtAnimationTimer&&clearTimeout(lookAtAnimationTimer),departAnimationTimer&&clearTimeout(departAnimationTimer)}},[et]),useFrame(It=>{tt.current&&(ht||St(yt,It.camera),pt||Et(wt,It.camera))});const vt=()=>{if(et){const It=ut.position.distanceTo(yt);playInspectSound(It)}xt()},xt=()=>{dt(!1),mt(!1),ot(!1),departAnimationTimer&&clearTimeout(departAnimationTimer),departAnimationTimer=setTimeout(()=>{dt(!0),mt(!0)},departAnimationTimerLength)},St=(It,Tt)=>{if(Tt.position.distanceTo(It){var $t;($t=tt==null?void 0:tt.current)==null||$t.setLookAt(Tt.position.x,Tt.position.y,Tt.position.z,It.x,It.y,It.z,!0)};return null},autoRotateSpeed=1;let cameraAnimation=null;const useCameraAnimations=(tt,{enabled:et})=>{const nt=useSelectedNode();useAutoNavigate(tt);const it=useControlStore(ct=>ct.isUserDragging),rt=useDataStore(ct=>ct.disableCameraRotation),ot=useDataStore(ct=>ct.data),at=useDataStore(ct=>ct.graphRadius),st=useDataStore(ct=>ct.setNearbyNodeIds);reactExports.useEffect(()=>{et||(cameraAnimation==null||cameraAnimation.kill(),cameraAnimation=null)},[et]);const lt=reactExports.useCallback(()=>{cameraAnimation==null||cameraAnimation.kill();const ct={value:-244},ut=gsapWithCSS.to(ct,{duration:5,keyframes:{"0%":{value:10},"100%":{delay:2,ease:"Power4.easeIn",value:-200}},onComplete:()=>{cameraAnimation=null},onInterrupt(){ut.kill()},onUpdate:()=>{var dt;const{value:ht}=ct;if(tt.current){const pt=getNearbyNodeIds((ot==null?void 0:ot.nodes)||[],tt.current.camera);pt&&st(pt),(dt=tt.current)==null||dt.dolly(ht,!1)}}});ut.play(),cameraAnimation=ut},[]);return reactExports.useEffect(()=>{tt.current&&at&&(tt.current.maxDistance=tt.current.getDistanceToFitSphere(at+200)),et&<()},[at]),reactExports.useEffect(()=>{!nt&&tt.current&&tt.current.setLookAt(initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z,0,0,0,!0)},[nt]),useFrame((ct,ut)=>{tt.current&&(!rt&&!it&&(tt.current.azimuthAngle+=autoRotateSpeed*ut*MathUtils.DEG2RAD),tt.current.update(ut))}),null},Controls$1=({disableAnimations:tt})=>{const et=reactExports.useRef(null),nt=useDataStore(dt=>dt.graphStyle),it=useDataStore(dt=>dt.data),rt=useDataStore(dt=>dt.setNearbyNodeIds),ot=useDataStore(dt=>dt.setDisableCameraRotation),[at]=reactExports.useState(.8),{camera:st}=useThree(),[lt,ct,ut,ht]=useControlStore(dt=>[dt.isUserDragging,dt.setIsUserDragging,dt.isUserScrolling,dt.isUserScrollingOnHtmlPanel]);return useCameraAnimations(et,{enabled:!tt&&!ut&&!lt}),reactExports.useEffect(()=>{et.current&&et.current.setLookAt(initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z,0,0,0,!0)},[nt]),reactExports.useEffect(()=>{if(!lt){const dt=getNearbyNodeIds((it==null?void 0:it.nodes)||[],st);dt&&rt(dt)}},[st,st.position,st.position.x,st.position.y,st.position.z,it==null?void 0:it.nodes,rt,lt]),reactExports.useEffect(()=>{lt&&ot(!0)},[lt,ot]),jsxRuntimeExports.jsx(CameraControls,{ref:et,boundaryEnclosesCamera:!0,enabled:!ht,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>ct(!1),onStart:()=>ct(!0),smoothTime:at})},smoothness={metalness:.9,roughness:0},materialOptions={...smoothness},blurryMaterial=new MeshStandardMaterial(materialOptions),BlurryInstances=({hide:tt})=>{const et=useGraphData(),nt=useDataStore(rt=>rt.graphStyle),it=reactExports.useMemo(()=>et.nodes.map((rt,ot)=>{if(rt.node_type==="topic")return!1;const at=!isMainTopic(rt),st=getNodeColorByType(rt.node_type||"",!0);return jsxRuntimeExports.jsx(Instance,{color:st,name:rt.id,position:[rt.x,rt.y,rt.z],scale:at?(rt.scale||1)*.9:0,userData:rt},`${rt.ref_id||rt.id}-instanced-node-${ot}-${nt}`)}),[nt,et]);return jsxRuntimeExports.jsx(Instances,{geometry:boxGeometry,material:blurryMaterial,visible:!tt,children:it})},loader=new TextureLoader,noImageTexture=loader.load("noimage.jpeg"),noImageMaterial=new MeshStandardMaterial({...smoothness,map:noImageTexture}),transparentValue=.4,noImageTransparentMaterial=new MeshStandardMaterial({...smoothness,map:noImageTexture,transparent:!0,opacity:transparentValue}),cachedMaterials={},useMaterial=(tt,et)=>{const[nt,it]=reactExports.useState(noImageTexture),[rt,ot]=reactExports.useState(noImageMaterial);return reactExports.useEffect(()=>{const at=`${tt}${et&&"-transparent"}`;if(cachedMaterials[at]){it(cachedMaterials[at].texture),ot(cachedMaterials[at].material);return}loader.load(tt,st=>{const lt=new MeshStandardMaterial({map:st,transparent:et,opacity:et?transparentValue:1,...smoothness});cachedMaterials[at]={texture:st,material:lt},it(st),ot(lt)},void 0,()=>{it(noImageTexture),ot(et?noImageTransparentMaterial:noImageMaterial)})},[tt,et]),reactExports.useEffect(()=>function(){nt.dispose(),rt.dispose()},[nt,rt]),rt},Cube=reactExports.memo(({node:tt,hide:et,animated:nt})=>{const it=reactExports.useRef(null),[rt]=reactExports.useState(boxGeometry),ot=useSelectedNode(),at=useDataStore(ut=>ut.showSelectionGraph),st=!!ot&&tt.ref_id===ot.ref_id,lt=useMaterial(tt.image_url||"noimage.jpeg",!1);useFrame((ut,ht)=>{nt&&it.current&&(it.current.position.set(tt.x,tt.y,tt.z),st&&(it.current.rotation.y+=ht*1,it.current.rotation.x-=ht*.6))}),reactExports.useEffect(()=>function(){rt.dispose()},[rt]);const ct=reactExports.useMemo(()=>at&&st?20:st?(tt.scale||1)*1.2:tt.scale,[tt,st,at]);return jsxRuntimeExports.jsx(Select,{enabled:!!st,children:jsxRuntimeExports.jsx("mesh",{ref:it,geometry:boxGeometry,material:lt,name:tt.id,position:[tt.x,tt.y,tt.z],scale:ct,userData:tt,visible:!et})})});Cube.displayName="Cube";const TypesMapper={youtube:"video",podcast:"audio",episode:"audio",clip:"audio",tweet:"twitter",person:"person",guest:"person",twitter_space:"audio",show:"show"},Avatar$1=styled$4.div` +`;registerProcessor(workletName,bitCrusherWorklet);class Merge extends ToneAudioNode{constructor(){super(optionsFromArguments(Merge.getDefaults(),arguments,["channels"])),this.name="Merge";const et=optionsFromArguments(Merge.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(et.channels)}static getDefaults(){return Object.assign(ToneAudioNode.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Reverb extends Effect{constructor(){super(optionsFromArguments(Reverb.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const et=optionsFromArguments(Reverb.getDefaults(),arguments,["decay"]);this._decay=et.decay,this._preDelay=et.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(Effect.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(et){et=this.toSeconds(et),assertRange(et,.001),this._decay=et,this.generate()}get preDelay(){return this._preDelay}set preDelay(et){et=this.toSeconds(et),assertRange(et,0),this._preDelay=et,this.generate()}generate(){return __awaiter(this,void 0,void 0,function*(){const et=this.ready,nt=new OfflineContext(2,this._decay+this._preDelay,this.context.sampleRate),it=new Noise({context:nt}),rt=new Noise({context:nt}),ot=new Merge({context:nt});it.connect(ot,0,0),rt.connect(ot,0,1);const at=new Gain({context:nt}).toDestination();ot.connect(at),it.start(0),rt.start(0),at.gain.setValueAtTime(0,0),at.gain.setValueAtTime(1,this._preDelay),at.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const st=nt.render();return this.ready=st.then(noOp),yield et,this._convolver.buffer=(yield st).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class Solo extends ToneAudioNode{constructor(){super(optionsFromArguments(Solo.getDefaults(),arguments,["solo"])),this.name="Solo";const et=optionsFromArguments(Solo.getDefaults(),arguments,["solo"]);this.input=this.output=new Gain({context:this.context}),Solo._allSolos.has(this.context)||Solo._allSolos.set(this.context,new Set),Solo._allSolos.get(this.context).add(this),this.solo=et.solo}static getDefaults(){return Object.assign(ToneAudioNode.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(et){et?this._addSolo():this._removeSolo(),Solo._allSolos.get(this.context).forEach(nt=>nt._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){Solo._soloed.has(this.context)||Solo._soloed.set(this.context,new Set),Solo._soloed.get(this.context).add(this)}_removeSolo(){Solo._soloed.has(this.context)&&Solo._soloed.get(this.context).delete(this)}_isSoloed(){return Solo._soloed.has(this.context)&&Solo._soloed.get(this.context).has(this)}_noSolos(){return!Solo._soloed.has(this.context)||Solo._soloed.has(this.context)&&Solo._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(),Solo._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Solo._allSolos=new Map;Solo._soloed=new Map;class PanVol extends ToneAudioNode{constructor(){super(optionsFromArguments(PanVol.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const et=optionsFromArguments(PanVol.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Panner({context:this.context,pan:et.pan,channelCount:et.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Volume({context:this.context,volume:et.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=et.mute,readOnly(this,["pan","volume"])}static getDefaults(){return Object.assign(ToneAudioNode.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(et){this._volume.mute=et}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class Channel extends ToneAudioNode{constructor(){super(optionsFromArguments(Channel.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const et=optionsFromArguments(Channel.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Solo({solo:et.solo,context:this.context}),this._panVol=this.output=new PanVol({context:this.context,pan:et.pan,volume:et.volume,mute:et.mute,channelCount:et.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),readOnly(this,["pan","volume"])}static getDefaults(){return Object.assign(ToneAudioNode.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(et){this._solo.solo=et}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(et){this._panVol.mute=et}_getBus(et){return Channel.buses.has(et)||Channel.buses.set(et,new Gain({context:this.context})),Channel.buses.get(et)}send(et,nt=0){const it=this._getBus(et),rt=new Gain({context:this.context,units:"decibels",gain:nt});return this.connect(rt),rt.connect(it),rt}receive(et){return this._getBus(et).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}Channel.buses=new Map;class Listener extends ToneAudioNode{constructor(){super(...arguments),this.name="Listener",this.positionX=new Param({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new Param({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new Param({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new Param({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new Param({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new Param({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new Param({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new Param({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new Param({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(ToneAudioNode.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}}onContextInit(tt=>{tt.listener=new Listener({context:tt})});onContextClose(tt=>{tt.listener.dispose()});getContext().transport;const Destination=getContext().destination;getContext().destination;getContext().listener;getContext().draw;getContext();const highPassFilter=new Filter$1(900,"highpass"),effectsBus=new Volume(-6);effectsBus.chain(highPassFilter,Destination);const reverb=new Reverb(3).connect(effectsBus),monoSynth=new MonoSynth({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});monoSynth.oscillator.type="triangle2";monoSynth.volume.value=-6;monoSynth.chain(highPassFilter,Destination);const monoSynth2=new MonoSynth({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(reverb);monoSynth2.oscillator.type="triangle";monoSynth2.volume.value=-6;monoSynth2.chain(highPassFilter,Destination);function addOrganicVariant(){return Math.floor((Math.random()-.5)*20)}let toneStarted=!1;const playInspectSound=async(tt=0)=>{toneStarted||(await start$1(),toneStarted=!0);try{if(tt>2e3)monoSynth2.triggerAttackRelease(60,.3);else if(tt>1e3){let et=310;et+=addOrganicVariant(),monoSynth.triggerAttackRelease(et,.001)}}catch(et){console.warn(et)}};let lookAtAnimationTimer,departAnimationTimer;const departAnimationTimerLength=4e3,lookAtAnimationTimerLength=2e3,useAutoNavigate=tt=>{const et=useSelectedNode(),nt=useDataStore($t=>$t.cameraFocusTrigger),it=useControlStore($t=>$t.isUserDragging),rt=useControlStore($t=>$t.isUserScrolling),ot=useControlStore($t=>$t.setUserMovedCamera),at=useDataStore($t=>$t.setNearbyNodeIds),st=useDataStore($t=>$t.showSelectionGraph),lt=useDataStore($t=>$t.data),ct=useDataStore($t=>$t.graphStyle),{camera:ut}=useThree(),[ht,dt]=reactExports.useState(!1),[pt,mt]=reactExports.useState(!1),[gt,bt]=reactExports.useState(arriveDistance),yt=reactExports.useMemo(()=>{if(st)return new Vector3(0,0,0);const $t=lt==null?void 0:lt.nodes.find(Ft=>Ft.ref_id===(et==null?void 0:et.ref_id));let It=new Vector3(2e3,2e3,3e3);if($t&<){const Ft=lt==null?void 0:lt.nodes.filter(kt=>{var Tt;return(Tt=$t.children)==null?void 0:Tt.find(Ct=>Ct===kt.id)}),Ht=new Vector3($t.x,$t.y,$t.z);let zt=new Vector3(0,0,0);Ft.map(kt=>(zt=zt.add(new Vector3(kt.x,kt.y,kt.z).normalize()),kt));const Ot=$t.scale?1-1/($t.scale+10):1,jt=Ht.sub(zt).multiplyScalar(.8*Ot);It=Ht.add(jt)}return It},[st,et,lt]),wt=reactExports.useMemo(()=>{if(st)return new Vector3(0,0,0);const $t=lt==null?void 0:lt.nodes.find(It=>It.ref_id===(et==null?void 0:et.ref_id));return new Vector3(($t==null?void 0:$t.x)||0,($t==null?void 0:$t.y)||0,($t==null?void 0:$t.z)||0)},[st,et,lt]);reactExports.useEffect(()=>{var $t;st&&(($t=tt.current)==null||$t.setLookAt(selectionGraphCameraPosition.x,selectionGraphCameraPosition.y,selectionGraphCameraPosition.z,0,0,0,!1)),vt()},[st]),reactExports.useEffect(()=>{st?bt(selectionGraphDistance):(et==null?void 0:et.node_type)==="topic"?bt(topicArriveDistance):bt(arriveDistance)},[et,bt,st]),reactExports.useEffect(()=>{xt()},[nt]),reactExports.useEffect(()=>{(it||rt)&&(dt(!0),mt(!0))},[it,rt,dt,mt]),reactExports.useEffect(()=>{if(et)if(!st&&ct==="earth"&&(tt!=null&&tt.current)){const $t=tt.current.camera.position.distanceTo(new Vector3),It=getPointAbove(wt,-$t/2);tt.current.setLookAt(It.x,It.y,It.z,0,0,0,!0)}else lookAtAnimationTimer&&clearTimeout(lookAtAnimationTimer),lookAtAnimationTimer=setTimeout(()=>{mt(!0),clearTimeout(lookAtAnimationTimer)},lookAtAnimationTimerLength),vt();return()=>{lookAtAnimationTimer&&clearTimeout(lookAtAnimationTimer),departAnimationTimer&&clearTimeout(departAnimationTimer)}},[et]),useFrame($t=>{tt.current&&(ht||St(yt,$t.camera),pt||Et(wt,$t.camera))});const vt=()=>{if(et){const $t=ut.position.distanceTo(yt);playInspectSound($t)}xt()},xt=()=>{dt(!1),mt(!1),ot(!1),departAnimationTimer&&clearTimeout(departAnimationTimer),departAnimationTimer=setTimeout(()=>{dt(!0),mt(!0)},departAnimationTimerLength)},St=($t,It)=>{if(It.position.distanceTo($t){var Ft;(Ft=tt==null?void 0:tt.current)==null||Ft.setLookAt(It.position.x,It.position.y,It.position.z,$t.x,$t.y,$t.z,!0)};return null},autoRotateSpeed=1;let cameraAnimation=null;const useCameraAnimations=(tt,{enabled:et})=>{const nt=useSelectedNode();useAutoNavigate(tt);const it=useControlStore(ct=>ct.isUserDragging),rt=useDataStore(ct=>ct.disableCameraRotation),ot=useDataStore(ct=>ct.data),at=useDataStore(ct=>ct.graphRadius),st=useDataStore(ct=>ct.setNearbyNodeIds);reactExports.useEffect(()=>{et||(cameraAnimation==null||cameraAnimation.kill(),cameraAnimation=null)},[et]);const lt=reactExports.useCallback(()=>{cameraAnimation==null||cameraAnimation.kill();const ct={value:-244},ut=gsapWithCSS.to(ct,{duration:5,keyframes:{"0%":{value:10},"100%":{delay:2,ease:"Power4.easeIn",value:-200}},onComplete:()=>{cameraAnimation=null},onInterrupt(){ut.kill()},onUpdate:()=>{var dt;const{value:ht}=ct;if(tt.current){const pt=getNearbyNodeIds((ot==null?void 0:ot.nodes)||[],tt.current.camera);pt&&st(pt),(dt=tt.current)==null||dt.dolly(ht,!1)}}});ut.play(),cameraAnimation=ut},[]);return reactExports.useEffect(()=>{tt.current&&at&&(tt.current.maxDistance=tt.current.getDistanceToFitSphere(at+200)),et&<()},[at]),reactExports.useEffect(()=>{!nt&&tt.current&&tt.current.setLookAt(initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z,0,0,0,!0)},[nt]),useFrame((ct,ut)=>{tt.current&&(!rt&&!it&&(tt.current.azimuthAngle+=autoRotateSpeed*ut*MathUtils.DEG2RAD),tt.current.update(ut))}),null},Controls$1=({disableAnimations:tt})=>{const et=reactExports.useRef(null),nt=useDataStore(dt=>dt.graphStyle),it=useDataStore(dt=>dt.data),rt=useDataStore(dt=>dt.setNearbyNodeIds),ot=useDataStore(dt=>dt.setDisableCameraRotation),[at]=reactExports.useState(.8),{camera:st}=useThree(),[lt,ct,ut,ht]=useControlStore(dt=>[dt.isUserDragging,dt.setIsUserDragging,dt.isUserScrolling,dt.isUserScrollingOnHtmlPanel]);return useCameraAnimations(et,{enabled:!tt&&!ut&&!lt}),reactExports.useEffect(()=>{et.current&&et.current.setLookAt(initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z,0,0,0,!0)},[nt]),reactExports.useEffect(()=>{if(!lt){const dt=getNearbyNodeIds((it==null?void 0:it.nodes)||[],st);dt&&rt(dt)}},[st,st.position,st.position.x,st.position.y,st.position.z,it==null?void 0:it.nodes,rt,lt]),reactExports.useEffect(()=>{lt&&ot(!0)},[lt,ot]),jsxRuntimeExports.jsx(CameraControls,{ref:et,boundaryEnclosesCamera:!0,enabled:!ht,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>ct(!1),onStart:()=>ct(!0),smoothTime:at})},smoothness={metalness:.9,roughness:0},materialOptions={...smoothness},blurryMaterial=new MeshStandardMaterial(materialOptions),BlurryInstances=({hide:tt})=>{const et=useGraphData(),nt=useDataStore(rt=>rt.graphStyle),it=reactExports.useMemo(()=>et.nodes.map((rt,ot)=>{if(rt.node_type==="topic")return!1;const at=!isMainTopic(rt),st=getNodeColorByType(rt.node_type||"",!0);return jsxRuntimeExports.jsx(Instance,{color:st,name:rt.id,position:[rt.x,rt.y,rt.z],scale:at?(rt.scale||1)*.9:0,userData:rt},`${rt.ref_id||rt.id}-instanced-node-${ot}-${nt}`)}),[nt,et]);return jsxRuntimeExports.jsx(Instances,{geometry:boxGeometry,material:blurryMaterial,visible:!tt,children:it})},loader=new TextureLoader,noImageTexture=loader.load("noimage.jpeg"),noImageMaterial=new MeshStandardMaterial({...smoothness,map:noImageTexture}),transparentValue=.4,noImageTransparentMaterial=new MeshStandardMaterial({...smoothness,map:noImageTexture,transparent:!0,opacity:transparentValue}),cachedMaterials={},useMaterial=(tt,et)=>{const[nt,it]=reactExports.useState(noImageTexture),[rt,ot]=reactExports.useState(noImageMaterial);return reactExports.useEffect(()=>{const at=`${tt}${et&&"-transparent"}`;if(cachedMaterials[at]){it(cachedMaterials[at].texture),ot(cachedMaterials[at].material);return}loader.load(tt,st=>{const lt=new MeshStandardMaterial({map:st,transparent:et,opacity:et?transparentValue:1,...smoothness});cachedMaterials[at]={texture:st,material:lt},it(st),ot(lt)},void 0,()=>{it(noImageTexture),ot(et?noImageTransparentMaterial:noImageMaterial)})},[tt,et]),reactExports.useEffect(()=>function(){nt.dispose(),rt.dispose()},[nt,rt]),rt},Cube=reactExports.memo(({node:tt,hide:et,animated:nt})=>{const it=reactExports.useRef(null),[rt]=reactExports.useState(boxGeometry),ot=useSelectedNode(),at=useDataStore(ut=>ut.showSelectionGraph),st=!!ot&&tt.ref_id===ot.ref_id,lt=useMaterial(tt.image_url||"noimage.jpeg",!1);useFrame((ut,ht)=>{nt&&it.current&&(it.current.position.set(tt.x,tt.y,tt.z),st&&(it.current.rotation.y+=ht*1,it.current.rotation.x-=ht*.6))}),reactExports.useEffect(()=>function(){rt.dispose()},[rt]);const ct=reactExports.useMemo(()=>at&&st?20:st?(tt.scale||1)*1.2:tt.scale,[tt,st,at]);return jsxRuntimeExports.jsx(Select,{enabled:!!st,children:jsxRuntimeExports.jsx("mesh",{ref:it,geometry:boxGeometry,material:lt,name:tt.id,position:[tt.x,tt.y,tt.z],scale:ct,userData:tt,visible:!et})})});Cube.displayName="Cube";const TypesMapper={youtube:"video",podcast:"audio",episode:"audio",clip:"audio",tweet:"twitter",person:"person",guest:"person",twitter_space:"audio",show:"show"},Avatar$1=styled$4.div` background-image: ${({src:tt,type:et="audio"})=>`url(${tt}), url('/${TypesMapper[et]}_placeholder_img.png')`}; background-size: contain; background-repeat: no-repeat; @@ -5257,7 +5257,7 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co right: 20px; bottom: 20px; pointer-events: all; -`;var loadjs_umd={exports:{}};(function(tt,et){(function(nt,it){tt.exports=it()})(commonjsGlobal,function(){var nt=function(){},it={},rt={},ot={};function at(dt,pt){dt=dt.push?dt:[dt];var mt=[],gt=dt.length,bt=gt,yt,wt,vt,xt;for(yt=function(St,Et){Et.length&&mt.push(St),bt--,bt||pt(mt)};gt--;){if(wt=dt[gt],vt=rt[wt],vt){yt(wt,vt);continue}xt=ot[wt]=ot[wt]||[],xt.push(yt)}}function st(dt,pt){if(dt){var mt=ot[dt];if(rt[dt]=pt,!!mt)for(;mt.length;)mt[0](dt,pt),mt.splice(0,1)}}function lt(dt,pt){dt.call&&(dt={success:dt}),pt.length?(dt.error||nt)(pt):(dt.success||nt)(dt)}function ct(dt,pt,mt,gt){var bt=document,yt=mt.async,wt=(mt.numRetries||0)+1,vt=mt.before||nt,xt=dt.replace(/[\?|#].*$/,""),St=dt.replace(/^(css|img)!/,""),Et,It;gt=gt||0,/(^css!|\.css$)/.test(xt)?(It=bt.createElement("link"),It.rel="stylesheet",It.href=St,Et="hideFocus"in It,Et&&It.relList&&(Et=0,It.rel="preload",It.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(xt)?(It=bt.createElement("img"),It.src=St):(It=bt.createElement("script"),It.src=dt,It.async=yt===void 0?!0:yt),It.onload=It.onerror=It.onbeforeload=function(Tt){var $t=Tt.type[0];if(Et)try{It.sheet.cssText.length||($t="e")}catch(Ut){Ut.code!=18&&($t="e")}if($t=="e"){if(gt+=1,gt"u"||!window.document)return it;var rt=document.createElement("style");document.head.appendChild(rt);var ot=rt.sheet,at=` +`;var loadjs_umd={exports:{}};(function(tt,et){(function(nt,it){tt.exports=it()})(commonjsGlobal,function(){var nt=function(){},it={},rt={},ot={};function at(dt,pt){dt=dt.push?dt:[dt];var mt=[],gt=dt.length,bt=gt,yt,wt,vt,xt;for(yt=function(St,Et){Et.length&&mt.push(St),bt--,bt||pt(mt)};gt--;){if(wt=dt[gt],vt=rt[wt],vt){yt(wt,vt);continue}xt=ot[wt]=ot[wt]||[],xt.push(yt)}}function st(dt,pt){if(dt){var mt=ot[dt];if(rt[dt]=pt,!!mt)for(;mt.length;)mt[0](dt,pt),mt.splice(0,1)}}function lt(dt,pt){dt.call&&(dt={success:dt}),pt.length?(dt.error||nt)(pt):(dt.success||nt)(dt)}function ct(dt,pt,mt,gt){var bt=document,yt=mt.async,wt=(mt.numRetries||0)+1,vt=mt.before||nt,xt=dt.replace(/[\?|#].*$/,""),St=dt.replace(/^(css|img)!/,""),Et,$t;gt=gt||0,/(^css!|\.css$)/.test(xt)?($t=bt.createElement("link"),$t.rel="stylesheet",$t.href=St,Et="hideFocus"in $t,Et&&$t.relList&&(Et=0,$t.rel="preload",$t.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(xt)?($t=bt.createElement("img"),$t.src=St):($t=bt.createElement("script"),$t.src=dt,$t.async=yt===void 0?!0:yt),$t.onload=$t.onerror=$t.onbeforeload=function(It){var Ft=It.type[0];if(Et)try{$t.sheet.cssText.length||(Ft="e")}catch(Ht){Ht.code!=18&&(Ft="e")}if(Ft=="e"){if(gt+=1,gt"u"||!window.document)return it;var rt=document.createElement("style");document.head.appendChild(rt);var ot=rt.sheet,at=` @keyframes `.concat(it,` { `).concat(et,` } @@ -5290,7 +5290,7 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co `,Fallback=()=>jsxRuntimeExports.jsx(Html$1,{children:jsxRuntimeExports.jsx(Loader$1,{})}),Content$3=()=>{const{universeColor:tt}=useControls("universe",{universeColor:colors.black}),et=useSelectedNode(),nt=reactExports.useMemo(()=>et!=null&&et.node_type?getNodeColorByType(et.node_type):outlineEffectColor,[et]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("color",{args:[tt],attach:"background"}),jsxRuntimeExports.jsx(Lights,{}),jsxRuntimeExports.jsx(Controls$1,{}),jsxRuntimeExports.jsxs(Selection$3,{children:[jsxRuntimeExports.jsxs(EffectComposer,{autoClear:!1,multisampling:8,children:[jsxRuntimeExports.jsx(Vignette,{darkness:.7,eskil:!1,offset:.05}),jsxRuntimeExports.jsx(Bloom,{luminanceThreshold:1,mipmapBlur:!0,resolutionX:Resolution.AUTO_SIZE,resolutionY:Resolution.AUTO_SIZE}),jsxRuntimeExports.jsx(Outline,{blendFunction:BlendFunction.SCREEN,blur:!0,edgeStrength:4,hiddenEdgeColor:nt,visibleEdgeColor:nt})]}),jsxRuntimeExports.jsx(Graph,{})]})]})};let wheelEventTimeout=null;const cameraProps={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z]},_Universe=()=>{const[tt,et,nt]=[useControlStore(at=>at.setIsUserScrollingOnHtmlPanel),useControlStore(at=>at.setIsUserScrolling),useControlStore(at=>at.setUserMovedCamera)],it=useDataStore(at=>at.isFetching),rt=reactExports.useCallback(at=>{var ct;const{target:st}=at,{offsetParent:lt}=st;wheelEventTimeout&&clearTimeout(wheelEventTimeout),(ct=lt==null?void 0:lt.classList)!=null&&ct.contains("html-panel")&<.clientHeight{et(!1),tt(!1)},200)},[et,tt,nt]),ot=reactExports.useCallback(at=>addToGlobalForE2e(at,"threeState"),[]);return jsxRuntimeExports.jsxs(Wrapper$q,{children:[jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsxs(Canvas,{camera:cameraProps,id:"universe-canvas",onCreated:ot,onWheel:rt,children:[isDevelopment&&jsxRuntimeExports.jsx(Perf,{position:"top-right"}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Fallback,{}),children:[jsxRuntimeExports.jsx(Preload,{}),jsxRuntimeExports.jsx(AdaptiveDpr,{}),jsxRuntimeExports.jsx(AdaptiveEvents,{}),jsxRuntimeExports.jsx(Content$3,{})]})]})}),it&&jsxRuntimeExports.jsx(Preloader,{fullSize:!1}),jsxRuntimeExports.jsx(Overlay,{})]})},Wrapper$q=styled$4(Flex)` flex: 1 1 100%; position: relative; -`,Universe=reactExports.memo(_Universe),PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0";PACKET_TYPES.close="1";PACKET_TYPES.ping="2";PACKET_TYPES.pong="3";PACKET_TYPES.message="4";PACKET_TYPES.upgrade="5";PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(tt=>{PACKET_TYPES_REVERSE[PACKET_TYPES[tt]]=tt});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=tt=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(tt):tt&&tt.buffer instanceof ArrayBuffer,encodePacket=({type:tt,data:et},nt,it)=>withNativeBlob$1&&et instanceof Blob?nt?it(et):encodeBlobAsBase64(et,it):withNativeArrayBuffer$2&&(et instanceof ArrayBuffer||isView$1(et))?nt?it(et):encodeBlobAsBase64(new Blob([et]),it):it(PACKET_TYPES[tt]+(et||"")),encodeBlobAsBase64=(tt,et)=>{const nt=new FileReader;return nt.onload=function(){const it=nt.result.split(",")[1];et("b"+(it||""))},nt.readAsDataURL(tt)};function toArray$1(tt){return tt instanceof Uint8Array?tt:tt instanceof ArrayBuffer?new Uint8Array(tt):new Uint8Array(tt.buffer,tt.byteOffset,tt.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(tt,et){if(withNativeBlob$1&&tt.data instanceof Blob)return tt.data.arrayBuffer().then(toArray$1).then(et);if(withNativeArrayBuffer$2&&(tt.data instanceof ArrayBuffer||isView$1(tt.data)))return et(toArray$1(tt.data));encodePacket(tt,!1,nt=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),et(TEXT_ENCODER.encode(nt))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let tt=0;tt{let et=tt.length*.75,nt=tt.length,it,rt=0,ot,at,st,lt;tt[tt.length-1]==="="&&(et--,tt[tt.length-2]==="="&&et--);const ct=new ArrayBuffer(et),ut=new Uint8Array(ct);for(it=0;it>4,ut[rt++]=(at&15)<<4|st>>2,ut[rt++]=(st&3)<<6|lt&63;return ct},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(tt,et)=>{if(typeof tt!="string")return{type:"message",data:mapBinary(tt,et)};const nt=tt.charAt(0);return nt==="b"?{type:"message",data:decodeBase64Packet(tt.substring(1),et)}:PACKET_TYPES_REVERSE[nt]?tt.length>1?{type:PACKET_TYPES_REVERSE[nt],data:tt.substring(1)}:{type:PACKET_TYPES_REVERSE[nt]}:ERROR_PACKET},decodeBase64Packet=(tt,et)=>{if(withNativeArrayBuffer$1){const nt=decode$2(tt);return mapBinary(nt,et)}else return{base64:!0,data:tt}},mapBinary=(tt,et)=>{switch(et){case"blob":return tt instanceof Blob?tt:new Blob([tt]);case"arraybuffer":default:return tt instanceof ArrayBuffer?tt:tt.buffer}},SEPARATOR=String.fromCharCode(30),encodePayload=(tt,et)=>{const nt=tt.length,it=new Array(nt);let rt=0;tt.forEach((ot,at)=>{encodePacket(ot,!1,st=>{it[at]=st,++rt===nt&&et(it.join(SEPARATOR))})})},decodePayload=(tt,et)=>{const nt=tt.split(SEPARATOR),it=[];for(let rt=0;rt{const it=nt.length;let rt;if(it<126)rt=new Uint8Array(1),new DataView(rt.buffer).setUint8(0,it);else if(it<65536){rt=new Uint8Array(3);const ot=new DataView(rt.buffer);ot.setUint8(0,126),ot.setUint16(1,it)}else{rt=new Uint8Array(9);const ot=new DataView(rt.buffer);ot.setUint8(0,127),ot.setBigUint64(1,BigInt(it))}tt.data&&typeof tt.data!="string"&&(rt[0]|=128),et.enqueue(rt),et.enqueue(nt)})}})}let TEXT_DECODER;function totalLength(tt){return tt.reduce((et,nt)=>et+nt.length,0)}function concatChunks(tt,et){if(tt[0].length===et)return tt.shift();const nt=new Uint8Array(et);let it=0;for(let rt=0;rtMath.pow(2,53-32)-1){st.enqueue(ERROR_PACKET);break}rt=ut*Math.pow(2,32)+ct.getUint32(4),it=3}else{if(totalLength(nt)tt){st.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(tt){if(tt)return mixin(tt)}function mixin(tt){for(var et in Emitter.prototype)tt[et]=Emitter.prototype[et];return tt}Emitter.prototype.on=Emitter.prototype.addEventListener=function(tt,et){return this._callbacks=this._callbacks||{},(this._callbacks["$"+tt]=this._callbacks["$"+tt]||[]).push(et),this};Emitter.prototype.once=function(tt,et){function nt(){this.off(tt,nt),et.apply(this,arguments)}return nt.fn=et,this.on(tt,nt),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(tt,et){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var nt=this._callbacks["$"+tt];if(!nt)return this;if(arguments.length==1)return delete this._callbacks["$"+tt],this;for(var it,rt=0;rttypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function pick(tt,...et){return et.reduce((nt,it)=>(tt.hasOwnProperty(it)&&(nt[it]=tt[it]),nt),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(tt,et){et.useNativeTimers?(tt.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),tt.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(tt.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),tt.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(tt){return typeof tt=="string"?utf8Length(tt):Math.ceil((tt.byteLength||tt.size)*BASE64_OVERHEAD)}function utf8Length(tt){let et=0,nt=0;for(let it=0,rt=tt.length;it=57344?nt+=3:(it++,nt+=4);return nt}function encode$1(tt){let et="";for(let nt in tt)tt.hasOwnProperty(nt)&&(et.length&&(et+="&"),et+=encodeURIComponent(nt)+"="+encodeURIComponent(tt[nt]));return et}function decode$1(tt){let et={},nt=tt.split("&");for(let it=0,rt=nt.length;it0);return et}function yeast(){const tt=encode(+new Date);return tt!==prev?(seed=0,prev=tt):tt+"."+encode(seed++)}for(;i$1{this.readyState="paused",et()};if(this.polling||!this.writable){let it=0;this.polling&&(it++,this.once("pollComplete",function(){--it||nt()})),this.writable||(it++,this.once("drain",function(){--it||nt()}))}else nt()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(et){const nt=it=>{if(this.readyState==="opening"&&it.type==="open"&&this.onOpen(),it.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(it)};decodePayload(et,this.socket.binaryType).forEach(nt),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const et=()=>{this.write([{type:"close"}])};this.readyState==="open"?et():this.once("open",et)}write(et){this.writable=!1,encodePayload(et,nt=>{this.doWrite(nt,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const et=this.opts.secure?"https":"http",nt=this.query||{};return this.opts.timestampRequests!==!1&&(nt[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!nt.sid&&(nt.b64=1),this.createUri(et,nt)}request(et={}){return Object.assign(et,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request$1(this.uri(),et)}doWrite(et,nt){const it=this.request({method:"POST",data:et});it.on("success",nt),it.on("error",(rt,ot)=>{this.onError("xhr post error",rt,ot)})}doPoll(){const et=this.request();et.on("data",this.onData.bind(this)),et.on("error",(nt,it)=>{this.onError("xhr poll error",nt,it)}),this.pollXhr=et}}let Request$1=class Dy extends Emitter{constructor(et,nt){super(),installTimerFunctions(this,nt),this.opts=nt,this.method=nt.method||"GET",this.uri=et,this.data=nt.data!==void 0?nt.data:null,this.create()}create(){var et;const nt=pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");nt.xdomain=!!this.opts.xd;const it=this.xhr=new XHR(nt);try{it.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){it.setDisableHeaderCheck&&it.setDisableHeaderCheck(!0);for(let rt in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(rt)&&it.setRequestHeader(rt,this.opts.extraHeaders[rt])}}catch{}if(this.method==="POST")try{it.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{it.setRequestHeader("Accept","*/*")}catch{}(et=this.opts.cookieJar)===null||et===void 0||et.addCookies(it),"withCredentials"in it&&(it.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(it.timeout=this.opts.requestTimeout),it.onreadystatechange=()=>{var rt;it.readyState===3&&((rt=this.opts.cookieJar)===null||rt===void 0||rt.parseCookies(it)),it.readyState===4&&(it.status===200||it.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof it.status=="number"?it.status:0)},0))},it.send(this.data)}catch(rt){this.setTimeoutFn(()=>{this.onError(rt)},0);return}typeof document<"u"&&(this.index=Dy.requestsCount++,Dy.requests[this.index]=this)}onError(et){this.emitReserved("error",et,this.xhr),this.cleanup(!0)}cleanup(et){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty$3,et)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Dy.requests[this.index],this.xhr=null}}onLoad(){const et=this.xhr.responseText;et!==null&&(this.emitReserved("data",et),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Request$1.requestsCount=0;Request$1.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const tt="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(tt,unloadHandler,!1)}}function unloadHandler(){for(let tt in Request$1.requests)Request$1.requests.hasOwnProperty(tt)&&Request$1.requests[tt].abort()}const nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?et=>Promise.resolve().then(et):(et,nt)=>nt(et,0))(),WebSocket=globalThisShim.WebSocket||globalThisShim.MozWebSocket,usingBrowserWebSocket=!0,defaultBinaryType="arraybuffer",isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class WS extends Transport{constructor(et){super(et),this.supportsBinary=!et.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const et=this.uri(),nt=this.opts.protocols,it=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(it.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?nt?new WebSocket(et,nt):new WebSocket(et):new WebSocket(et,nt,it)}catch(rt){return this.emitReserved("error",rt)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=et=>this.onClose({description:"websocket connection closed",context:et}),this.ws.onmessage=et=>this.onData(et.data),this.ws.onerror=et=>this.onError("websocket error",et)}write(et){this.writable=!1;for(let nt=0;nt{const at={};try{usingBrowserWebSocket&&this.ws.send(ot)}catch{}rt&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const et=this.opts.secure?"wss":"ws",nt=this.query||{};return this.opts.timestampRequests&&(nt[this.opts.timestampParam]=yeast()),this.supportsBinary||(nt.b64=1),this.createUri(et,nt)}check(){return!!WebSocket}}class WT extends Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(et=>{this.onError("webtransport error",et)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(et=>{const nt=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),it=et.readable.pipeThrough(nt).getReader(),rt=createPacketEncoderStream();rt.readable.pipeTo(et.writable),this.writer=rt.writable.getWriter();const ot=()=>{it.read().then(({done:st,value:lt})=>{st||(this.onPacket(lt),ot())}).catch(st=>{})};ot();const at={type:"open"};this.query.sid&&(at.data=`{"sid":"${this.query.sid}"}`),this.writer.write(at).then(()=>this.onOpen())})}))}write(et){this.writable=!1;for(let nt=0;nt{rt&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var et;(et=this.transport)===null||et===void 0||et.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re$2=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse$2(tt){if(tt.length>2e3)throw"URI too long";const et=tt,nt=tt.indexOf("["),it=tt.indexOf("]");nt!=-1&&it!=-1&&(tt=tt.substring(0,nt)+tt.substring(nt,it).replace(/:/g,";")+tt.substring(it,tt.length));let rt=re$2.exec(tt||""),ot={},at=14;for(;at--;)ot[parts[at]]=rt[at]||"";return nt!=-1&&it!=-1&&(ot.source=et,ot.host=ot.host.substring(1,ot.host.length-1).replace(/;/g,":"),ot.authority=ot.authority.replace("[","").replace("]","").replace(/;/g,":"),ot.ipv6uri=!0),ot.pathNames=pathNames(ot,ot.path),ot.queryKey=queryKey(ot,ot.query),ot}function pathNames(tt,et){const nt=/\/{2,9}/g,it=et.replace(nt,"/").split("/");return(et.slice(0,1)=="/"||et.length===0)&&it.splice(0,1),et.slice(-1)=="/"&&it.splice(it.length-1,1),it}function queryKey(tt,et){const nt={};return et.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(it,rt,ot){rt&&(nt[rt]=ot)}),nt}let Socket$1=class K0 extends Emitter{constructor(et,nt={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],et&&typeof et=="object"&&(nt=et,et=null),et?(et=parse$2(et),nt.hostname=et.host,nt.secure=et.protocol==="https"||et.protocol==="wss",nt.port=et.port,et.query&&(nt.query=et.query)):nt.host&&(nt.hostname=parse$2(nt.host).host),installTimerFunctions(this,nt),this.secure=nt.secure!=null?nt.secure:typeof location<"u"&&location.protocol==="https:",nt.hostname&&!nt.port&&(nt.port=this.secure?"443":"80"),this.hostname=nt.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=nt.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=nt.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},nt),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$1(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(et){const nt=Object.assign({},this.opts.query);nt.EIO=protocol$1,nt.transport=et,this.id&&(nt.sid=this.id);const it=Object.assign({},this.opts,{query:nt,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[et]);return new transports[et](it)}open(){let et;if(this.opts.rememberUpgrade&&K0.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)et="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else et=this.transports[0];this.readyState="opening";try{et=this.createTransport(et)}catch{this.transports.shift(),this.open();return}et.open(),this.setTransport(et)}setTransport(et){this.transport&&this.transport.removeAllListeners(),this.transport=et,et.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",nt=>this.onClose("transport close",nt))}probe(et){let nt=this.createTransport(et),it=!1;K0.priorWebsocketSuccess=!1;const rt=()=>{it||(nt.send([{type:"ping",data:"probe"}]),nt.once("packet",ht=>{if(!it)if(ht.type==="pong"&&ht.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",nt),!nt)return;K0.priorWebsocketSuccess=nt.name==="websocket",this.transport.pause(()=>{it||this.readyState!=="closed"&&(ut(),this.setTransport(nt),nt.send([{type:"upgrade"}]),this.emitReserved("upgrade",nt),nt=null,this.upgrading=!1,this.flush())})}else{const dt=new Error("probe error");dt.transport=nt.name,this.emitReserved("upgradeError",dt)}}))};function ot(){it||(it=!0,ut(),nt.close(),nt=null)}const at=ht=>{const dt=new Error("probe error: "+ht);dt.transport=nt.name,ot(),this.emitReserved("upgradeError",dt)};function st(){at("transport closed")}function lt(){at("socket closed")}function ct(ht){nt&&ht.name!==nt.name&&ot()}const ut=()=>{nt.removeListener("open",rt),nt.removeListener("error",at),nt.removeListener("close",st),this.off("close",lt),this.off("upgrading",ct)};nt.once("open",rt),nt.once("error",at),nt.once("close",st),this.once("close",lt),this.once("upgrading",ct),this.upgrades.indexOf("webtransport")!==-1&&et!=="webtransport"?this.setTimeoutFn(()=>{it||nt.open()},200):nt.open()}onOpen(){if(this.readyState="open",K0.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let et=0;const nt=this.upgrades.length;for(;et{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const et=this.getWritablePackets();this.transport.send(et),this.prevBufferLen=et.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let nt=1;for(let it=0;it0&&nt>this.maxPayload)return this.writeBuffer.slice(0,it);nt+=2}return this.writeBuffer}write(et,nt,it){return this.sendPacket("message",et,nt,it),this}send(et,nt,it){return this.sendPacket("message",et,nt,it),this}sendPacket(et,nt,it,rt){if(typeof nt=="function"&&(rt=nt,nt=void 0),typeof it=="function"&&(rt=it,it=null),this.readyState==="closing"||this.readyState==="closed")return;it=it||{},it.compress=it.compress!==!1;const ot={type:et,data:nt,options:it};this.emitReserved("packetCreate",ot),this.writeBuffer.push(ot),rt&&this.once("flush",rt),this.flush()}close(){const et=()=>{this.onClose("forced close"),this.transport.close()},nt=()=>{this.off("upgrade",nt),this.off("upgradeError",nt),et()},it=()=>{this.once("upgrade",nt),this.once("upgradeError",nt)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?it():et()}):this.upgrading?it():et()),this}onError(et){K0.priorWebsocketSuccess=!1,this.emitReserved("error",et),this.onClose("transport error",et)}onClose(et,nt){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",et,nt),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(et){const nt=[];let it=0;const rt=et.length;for(;ittypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(tt):tt.buffer instanceof ArrayBuffer,toString$6=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$6.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$6.call(File)==="[object FileConstructor]";function isBinary(tt){return withNativeArrayBuffer&&(tt instanceof ArrayBuffer||isView(tt))||withNativeBlob&&tt instanceof Blob||withNativeFile&&tt instanceof File}function hasBinary(tt,et){if(!tt||typeof tt!="object")return!1;if(Array.isArray(tt)){for(let nt=0,it=tt.length;nt=0&&tt.num{delete this.acks[et];for(let at=0;at{this.io.clearTimeoutFn(ot),nt.apply(this,[null,...at])}}emitWithAck(et,...nt){const it=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((rt,ot)=>{nt.push((at,st)=>it?at?ot(at):rt(st):rt(at)),this.emit(et,...nt)})}_addToQueue(et){let nt;typeof et[et.length-1]=="function"&&(nt=et.pop());const it={id:this._queueSeq++,tryCount:0,pending:!1,args:et,flags:Object.assign({fromQueue:!0},this.flags)};et.push((rt,...ot)=>it!==this._queue[0]?void 0:(rt!==null?it.tryCount>this._opts.retries&&(this._queue.shift(),nt&&nt(rt)):(this._queue.shift(),nt&&nt(null,...ot)),it.pending=!1,this._drainQueue())),this._queue.push(it),this._drainQueue()}_drainQueue(et=!1){if(!this.connected||this._queue.length===0)return;const nt=this._queue[0];nt.pending&&!et||(nt.pending=!0,nt.tryCount++,this.flags=nt.flags,this.emit.apply(this,nt.args))}packet(et){et.nsp=this.nsp,this.io._packet(et)}onopen(){typeof this.auth=="function"?this.auth(et=>{this._sendConnectPacket(et)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(et){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},et):et})}onerror(et){this.connected||this.emitReserved("connect_error",et)}onclose(et,nt){this.connected=!1,delete this.id,this.emitReserved("disconnect",et,nt)}onpacket(et){if(et.nsp===this.nsp)switch(et.type){case PacketType.CONNECT:et.data&&et.data.sid?this.onconnect(et.data.sid,et.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(et);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(et);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const it=new Error(et.data.message);it.data=et.data.data,this.emitReserved("connect_error",it);break}}onevent(et){const nt=et.data||[];et.id!=null&&nt.push(this.ack(et.id)),this.connected?this.emitEvent(nt):this.receiveBuffer.push(Object.freeze(nt))}emitEvent(et){if(this._anyListeners&&this._anyListeners.length){const nt=this._anyListeners.slice();for(const it of nt)it.apply(this,et)}super.emit.apply(this,et),this._pid&&et.length&&typeof et[et.length-1]=="string"&&(this._lastOffset=et[et.length-1])}ack(et){const nt=this;let it=!1;return function(...rt){it||(it=!0,nt.packet({type:PacketType.ACK,id:et,data:rt}))}}onack(et){const nt=this.acks[et.id];typeof nt=="function"&&(nt.apply(this,et.data),delete this.acks[et.id])}onconnect(et,nt){this.id=et,this.recovered=nt&&this._pid===nt,this._pid=nt,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(et=>this.emitEvent(et)),this.receiveBuffer=[],this.sendBuffer.forEach(et=>{this.notifyOutgoingListeners(et),this.packet(et)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(et=>et()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(et){return this.flags.compress=et,this}get volatile(){return this.flags.volatile=!0,this}timeout(et){return this.flags.timeout=et,this}onAny(et){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(et),this}prependAny(et){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(et),this}offAny(et){if(!this._anyListeners)return this;if(et){const nt=this._anyListeners;for(let it=0;it0&&tt.jitter<=1?tt.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var tt=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var et=Math.random(),nt=Math.floor(et*this.jitter*tt);tt=Math.floor(et*10)&1?tt+nt:tt-nt}return Math.min(tt,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(tt){this.ms=tt};Backoff.prototype.setMax=function(tt){this.max=tt};Backoff.prototype.setJitter=function(tt){this.jitter=tt};class Manager extends Emitter{constructor(et,nt){var it;super(),this.nsps={},this.subs=[],et&&typeof et=="object"&&(nt=et,et=void 0),nt=nt||{},nt.path=nt.path||"/socket.io",this.opts=nt,installTimerFunctions(this,nt),this.reconnection(nt.reconnection!==!1),this.reconnectionAttempts(nt.reconnectionAttempts||1/0),this.reconnectionDelay(nt.reconnectionDelay||1e3),this.reconnectionDelayMax(nt.reconnectionDelayMax||5e3),this.randomizationFactor((it=nt.randomizationFactor)!==null&&it!==void 0?it:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(nt.timeout==null?2e4:nt.timeout),this._readyState="closed",this.uri=et;const rt=nt.parser||parser;this.encoder=new rt.Encoder,this.decoder=new rt.Decoder,this._autoConnect=nt.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(et){return arguments.length?(this._reconnection=!!et,this):this._reconnection}reconnectionAttempts(et){return et===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=et,this)}reconnectionDelay(et){var nt;return et===void 0?this._reconnectionDelay:(this._reconnectionDelay=et,(nt=this.backoff)===null||nt===void 0||nt.setMin(et),this)}randomizationFactor(et){var nt;return et===void 0?this._randomizationFactor:(this._randomizationFactor=et,(nt=this.backoff)===null||nt===void 0||nt.setJitter(et),this)}reconnectionDelayMax(et){var nt;return et===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=et,(nt=this.backoff)===null||nt===void 0||nt.setMax(et),this)}timeout(et){return arguments.length?(this._timeout=et,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(et){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const nt=this.engine,it=this;this._readyState="opening",this.skipReconnect=!1;const rt=on(nt,"open",function(){it.onopen(),et&&et()}),ot=st=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",st),et?et(st):this.maybeReconnectOnOpen()},at=on(nt,"error",ot);if(this._timeout!==!1){const st=this._timeout,lt=this.setTimeoutFn(()=>{rt(),ot(new Error("timeout")),nt.close()},st);this.opts.autoUnref&<.unref(),this.subs.push(()=>{this.clearTimeoutFn(lt)})}return this.subs.push(rt),this.subs.push(at),this}connect(et){return this.open(et)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const et=this.engine;this.subs.push(on(et,"ping",this.onping.bind(this)),on(et,"data",this.ondata.bind(this)),on(et,"error",this.onerror.bind(this)),on(et,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(et){try{this.decoder.add(et)}catch(nt){this.onclose("parse error",nt)}}ondecoded(et){nextTick(()=>{this.emitReserved("packet",et)},this.setTimeoutFn)}onerror(et){this.emitReserved("error",et)}socket(et,nt){let it=this.nsps[et];return it?this._autoConnect&&!it.active&&it.connect():(it=new Socket(this,et,nt),this.nsps[et]=it),it}_destroy(et){const nt=Object.keys(this.nsps);for(const it of nt)if(this.nsps[it].active)return;this._close()}_packet(et){const nt=this.encoder.encode(et);for(let it=0;itet()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(et,nt){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",et,nt),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const et=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const nt=this.backoff.duration();this._reconnecting=!0;const it=this.setTimeoutFn(()=>{et.skipReconnect||(this.emitReserved("reconnect_attempt",et.backoff.attempts),!et.skipReconnect&&et.open(rt=>{rt?(et._reconnecting=!1,et.reconnect(),this.emitReserved("reconnect_error",rt)):et.onreconnect()}))},nt);this.opts.autoUnref&&it.unref(),this.subs.push(()=>{this.clearTimeoutFn(it)})}}onreconnect(){const et=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",et)}}const cache={};function lookup(tt,et){typeof tt=="object"&&(et=tt,tt=void 0),et=et||{};const nt=url(tt,et.path||"/socket.io"),it=nt.source,rt=nt.id,ot=nt.path,at=cache[rt]&&ot in cache[rt].nsps,st=et.forceNew||et["force new connection"]||et.multiplex===!1||at;let lt;return st?lt=new Manager(it,et):(cache[rt]||(cache[rt]=new Manager(it,et)),lt=cache[rt]),nt.query&&!et.query&&(et.query=nt.queryKey),lt.socket(nt.path,et)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const useSocket=()=>{const[tt,et]=reactExports.useState(null);return reactExports.useEffect(()=>{const nt=lookup(API_URL);return et(nt),()=>{nt.disconnect()}},[]),tt};async function getIsAdmin({message:tt,tribeHost:et,tribeUuid:nt,signature:it}){return api$1.get(`/isAdmin?msg=${tt}&sig=${it}&tribe_host=${et}&uuid=${nt}`)}const defaultData$2={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},useTeachStore=react(tt=>({...defaultData$2,setAskedQuestion:et=>tt(nt=>({askedQuestions:[...nt.askedQuestions||[],et],hasQuestionInProgress:!0})),setAskedQuestionAnswer:et=>tt(nt=>({askedQuestionsAnswers:[...nt.askedQuestionsAnswers||[],et],hasQuestionInProgress:!1})),setHasQuestionInProgress:et=>tt({hasQuestionInProgress:et}),setHasTeachingInProgress:et=>tt({hasTeachingInProgress:et}),setHasInstagraphInProgress:et=>tt({hasInstagraphInProgress:et}),setTeachMeAnswer:et=>tt({hasTeachingInProgress:!1,teachMeAnswer:et}),setInstagraphAnswer:et=>{var nt,it,rt,ot;(nt=et==null?void 0:et.instagraph)!=null&&nt.edges&&((it=et==null?void 0:et.instagraph)!=null&&it.nodes)&&tt({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(rt=et==null?void 0:et.instagraph)==null?void 0:rt.edges,nodes:(ot=et==null?void 0:et.instagraph)==null?void 0:ot.nodes}})}})),version="0.1.106";function _extends$r(){return _extends$r=Object.assign||function(tt){for(var et=1;et=0)&&(nt[rt]=tt[rt]);return nt}function isNum(tt){return typeof tt=="number"&&!isNaN(tt)}function isBool(tt){return typeof tt=="boolean"}function isStr(tt){return typeof tt=="string"}function isFn(tt){return typeof tt=="function"}function parseClassName(tt){return isStr(tt)||isFn(tt)?tt:null}function isToastIdValid(tt){return tt===0||tt}function getAutoCloseDelay(tt,et){return tt===!1||isNum(tt)&&tt>0?tt:et}var canUseDom=!!(typeof window<"u"&&window.document&&window.document.createElement);function canBeRendered(tt){return reactExports.isValidElement(tt)||isStr(tt)||isFn(tt)||isNum(tt)}var POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function collapseToast(tt,et,nt){nt===void 0&&(nt=300);var it=tt.scrollHeight,rt=tt.style;requestAnimationFrame(function(){rt.minHeight="initial",rt.height=it+"px",rt.transition="all "+nt+"ms",requestAnimationFrame(function(){rt.height="0",rt.padding="0",rt.margin="0",setTimeout(et,nt)})})}function cssTransition(tt){var et=tt.enter,nt=tt.exit,it=tt.appendPosition,rt=it===void 0?!1:it,ot=tt.collapse,at=ot===void 0?!0:ot,st=tt.collapseDuration,lt=st===void 0?300:st;return function(ut){var ht=ut.children,dt=ut.position,pt=ut.preventExitTransition,mt=ut.done,gt=ut.nodeRef,bt=ut.isIn,yt=rt?et+"--"+dt:et,wt=rt?nt+"--"+dt:nt,vt=reactExports.useRef(),xt=reactExports.useRef(0);reactExports.useLayoutEffect(function(){St()},[]),reactExports.useEffect(function(){bt||(pt?Tt():It())},[bt]);function St(){var $t=gt.current;vt.current=$t.className,$t.className+=" "+yt,$t.addEventListener("animationend",Et),$t.addEventListener("animationcancel",Et)}function Et($t){if($t.target===gt.current){var Ut=gt.current;Ut.dispatchEvent(new Event("d")),Ut.removeEventListener("animationend",Et),Ut.removeEventListener("animationcancel",Et),xt.current===0&&(Ut.className=vt.current)}}function It(){xt.current=1;var $t=gt.current;$t.className+=" "+wt,$t.addEventListener("animationend",Tt)}function Tt(){var $t=gt.current;$t.removeEventListener("animationend",Tt),at?collapseToast($t,mt,lt):mt()}return React$1.createElement(React$1.Fragment,null,ht)}}var eventManager={list:new Map,emitQueue:new Map,on:function tt(et,nt){return this.list.has(et)||this.list.set(et,[]),this.list.get(et).push(nt),this},off:function tt(et,nt){if(nt){var it=this.list.get(et).filter(function(rt){return rt!==nt});return this.list.set(et,it),this}return this.list.delete(et),this},cancelEmit:function tt(et){var nt=this.emitQueue.get(et);return nt&&(nt.forEach(clearTimeout),this.emitQueue.delete(et)),this},emit:function tt(et){for(var nt=this,it=arguments.length,rt=new Array(it>1?it-1:0),ot=1;ot0){var Rt=isToastIdValid(Et)?1:ct.props.limit;if(At===1||Rt===1)ct.displayedToast++,dt();else{var Wt=Rt>At?At:Rt;ct.displayedToast=Wt;for(var jt=0;jt0&&ct.count>$t.limit&&Lt?ct.queue.push({toastContent:Pt,toastProps:Bt,staleId:xt}):isNum(vt)&&vt>0?setTimeout(function(){gt(Pt,Bt,xt)},vt):gt(Pt,Bt,xt)}}function gt(yt,wt,vt){var xt=wt.toastId;vt&&st.delete(vt),st.set(xt,{content:yt,props:wt}),ot(function(St){return[].concat(St,[xt]).filter(function(Et){return Et!==vt})})}function bt(yt){var wt=new Map,vt=Array.from(st.values());return tt.newestOnTop&&vt.reverse(),vt.forEach(function(xt){var St=xt.props.position;wt.has(St)||wt.set(St,[]),wt.get(St).push(xt)}),Array.from(wt,function(xt){return yt(xt[0],xt[1])})}return{getToastToRender:bt,containerRef:at,isToastActive:lt}}function getX$1(tt){return tt.targetTouches&&tt.targetTouches.length>=1?tt.targetTouches[0].clientX:tt.clientX}function getY$1(tt){return tt.targetTouches&&tt.targetTouches.length>=1?tt.targetTouches[0].clientY:tt.clientY}function useToast(tt){var et=reactExports.useState(!1),nt=et[0],it=et[1],rt=reactExports.useState(!1),ot=rt[0],at=rt[1],st=reactExports.useRef(null),lt=reactExports.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,ct=reactExports.useRef(tt),ut=tt.autoClose,ht=tt.pauseOnHover,dt=tt.closeToast,pt=tt.onClick,mt=tt.closeOnClick;reactExports.useEffect(function(){ct.current=tt}),reactExports.useEffect(function(){return st.current&&st.current.addEventListener("d",yt,{once:!0}),isFn(tt.onOpen)&&tt.onOpen(reactExports.isValidElement(tt.children)&&tt.children.props),function(){var Ut=ct.current;isFn(Ut.onClose)&&Ut.onClose(reactExports.isValidElement(Ut.children)&&Ut.children.props)}},[]),reactExports.useEffect(function(){return tt.pauseOnFocusLoss&&vt(),function(){tt.pauseOnFocusLoss&&xt()}},[tt.pauseOnFocusLoss]);function gt(Ut){if(tt.draggable){St();var Lt=st.current;lt.canCloseOnClick=!0,lt.canDrag=!0,lt.boundingRect=Lt.getBoundingClientRect(),Lt.style.transition="",lt.x=getX$1(Ut.nativeEvent),lt.y=getY$1(Ut.nativeEvent),tt.draggableDirection==="x"?(lt.start=lt.x,lt.removalDistance=Lt.offsetWidth*(tt.draggablePercent/100)):(lt.start=lt.y,lt.removalDistance=Lt.offsetHeight*(tt.draggablePercent===80?tt.draggablePercent*1.5:tt.draggablePercent/100))}}function bt(){if(lt.boundingRect){var Ut=lt.boundingRect,Lt=Ut.top,Bt=Ut.bottom,Pt=Ut.left,kt=Ut.right;tt.pauseOnHover&<.x>=Pt&<.x<=kt&<.y>=Lt&<.y<=Bt?wt():yt()}}function yt(){it(!0)}function wt(){it(!1)}function vt(){document.hasFocus()||wt(),window.addEventListener("focus",yt),window.addEventListener("blur",wt)}function xt(){window.removeEventListener("focus",yt),window.removeEventListener("blur",wt)}function St(){lt.didMove=!1,document.addEventListener("mousemove",It),document.addEventListener("mouseup",Tt),document.addEventListener("touchmove",It),document.addEventListener("touchend",Tt)}function Et(){document.removeEventListener("mousemove",It),document.removeEventListener("mouseup",Tt),document.removeEventListener("touchmove",It),document.removeEventListener("touchend",Tt)}function It(Ut){var Lt=st.current;lt.canDrag&&Lt&&(lt.didMove=!0,nt&&wt(),lt.x=getX$1(Ut),lt.y=getY$1(Ut),tt.draggableDirection==="x"?lt.delta=lt.x-lt.start:lt.delta=lt.y-lt.start,lt.start!==lt.x&&(lt.canCloseOnClick=!1),Lt.style.transform="translate"+tt.draggableDirection+"("+lt.delta+"px)",Lt.style.opacity=""+(1-Math.abs(lt.delta/lt.removalDistance)))}function Tt(){Et();var Ut=st.current;if(lt.canDrag&<.didMove&&Ut){if(lt.canDrag=!1,Math.abs(lt.delta)>lt.removalDistance){at(!0),tt.closeToast();return}Ut.style.transition="transform 0.2s, opacity 0.2s",Ut.style.transform="translate"+tt.draggableDirection+"(0)",Ut.style.opacity="1"}}var $t={onMouseDown:gt,onTouchStart:gt,onMouseUp:bt,onTouchEnd:bt};return ut&&ht&&($t.onMouseEnter=wt,$t.onMouseLeave=yt),mt&&($t.onClick=function(Ut){pt&&pt(Ut),lt.canCloseOnClick&&dt()}),{playToast:yt,pauseToast:wt,isRunning:nt,preventExitTransition:ot,toastRef:st,eventHandlers:$t}}function CloseButton$4(tt){var et=tt.closeToast,nt=tt.theme,it=tt.ariaLabel,rt=it===void 0?"close":it;return reactExports.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+nt,type:"button",onClick:function(at){at.stopPropagation(),et(at)},"aria-label":rt},reactExports.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},reactExports.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ProgressBar(tt){var et,nt,it=tt.delay,rt=tt.isRunning,ot=tt.closeToast,at=tt.type,st=tt.hide,lt=tt.className,ct=tt.style,ut=tt.controlledProgress,ht=tt.progress,dt=tt.rtl,pt=tt.isIn,mt=tt.theme,gt=_extends$r({},ct,{animationDuration:it+"ms",animationPlayState:rt?"running":"paused",opacity:st?0:1});ut&&(gt.transform="scaleX("+ht+")");var bt=clsx$1("Toastify__progress-bar",ut?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+mt,"Toastify__progress-bar--"+at,(et={},et["Toastify__progress-bar--rtl"]=dt,et)),yt=isFn(lt)?lt({rtl:dt,type:at,defaultClassName:bt}):clsx$1(bt,lt),wt=(nt={},nt[ut&&ht>=1?"onTransitionEnd":"onAnimationEnd"]=ut&&ht<1?null:function(){pt&&ot()},nt);return reactExports.createElement("div",Object.assign({role:"progressbar","aria-hidden":st?"true":"false","aria-label":"notification timer",className:yt,style:gt},wt))}ProgressBar.defaultProps={type:TYPE.DEFAULT,hide:!1};var _excluded$1$1=["theme","type"],Svg=function tt(et){var nt=et.theme,it=et.type,rt=_objectWithoutPropertiesLoose$j(et,_excluded$1$1);return reactExports.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:nt==="colored"?"currentColor":"var(--toastify-icon-color-"+it+")"},rt))};function Warning(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Info$1(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Success(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Error$1(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Spinner(){return reactExports.createElement("div",{className:"Toastify__spinner"})}var Icons={info:Info$1,warning:Warning,success:Success,error:Error$1,spinner:Spinner},Toast=function tt(et){var nt,it,rt=useToast(et),ot=rt.isRunning,at=rt.preventExitTransition,st=rt.toastRef,lt=rt.eventHandlers,ct=et.closeButton,ut=et.children,ht=et.autoClose,dt=et.onClick,pt=et.type,mt=et.hideProgressBar,gt=et.closeToast,bt=et.transition,yt=et.position,wt=et.className,vt=et.style,xt=et.bodyClassName,St=et.bodyStyle,Et=et.progressClassName,It=et.progressStyle,Tt=et.updateId,$t=et.role,Ut=et.progress,Lt=et.rtl,Bt=et.toastId,Pt=et.deleteToast,kt=et.isIn,At=et.isLoading,Rt=et.icon,Wt=et.theme,jt=clsx$1("Toastify__toast","Toastify__toast-theme--"+Wt,"Toastify__toast--"+pt,(nt={},nt["Toastify__toast--rtl"]=Lt,nt)),Ot=isFn(wt)?wt({rtl:Lt,position:yt,type:pt,defaultClassName:jt}):clsx$1(jt,wt),Ct=!!Ut,Dt=Icons[pt],Mt={theme:Wt,type:pt},Vt=Dt&&Dt(Mt);Rt===!1?Vt=void 0:isFn(Rt)?Vt=Rt(Mt):reactExports.isValidElement(Rt)?Vt=reactExports.cloneElement(Rt,Mt):isStr(Rt)?Vt=Rt:At&&(Vt=Icons.spinner());function Qt(rn){if(rn){var Xt={closeToast:gt,type:pt,theme:Wt};if(isFn(rn))return rn(Xt);if(reactExports.isValidElement(rn))return reactExports.cloneElement(rn,Xt)}}return reactExports.createElement(bt,{isIn:kt,done:Pt,position:yt,preventExitTransition:at,nodeRef:st},reactExports.createElement("div",Object.assign({id:Bt,onClick:dt,className:Ot},lt,{style:vt,ref:st}),reactExports.createElement("div",Object.assign({},kt&&{role:$t},{className:isFn(xt)?xt({type:pt}):clsx$1("Toastify__toast-body",xt),style:St}),Vt&&reactExports.createElement("div",{className:clsx$1("Toastify__toast-icon",(it={},it["Toastify--animate-icon Toastify__zoom-enter"]=!At,it))},Vt),reactExports.createElement("div",null,ut)),Qt(ct),(ht||Ct)&&reactExports.createElement(ProgressBar,Object.assign({},Tt&&!Ct?{key:"pb-"+Tt}:{},{rtl:Lt,theme:Wt,delay:ht,isRunning:ot,isIn:kt,closeToast:gt,hide:mt,type:pt,style:It,className:Et,controlledProgress:Ct,progress:Ut}))))},Bounce=cssTransition({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),ToastContainer=function tt(et){var nt=useToastContainer(et),it=nt.getToastToRender,rt=nt.containerRef,ot=nt.isToastActive,at=et.className,st=et.style,lt=et.rtl,ct=et.containerId;function ut(ht){var dt,pt=clsx$1("Toastify__toast-container","Toastify__toast-container--"+ht,(dt={},dt["Toastify__toast-container--rtl"]=lt,dt));return isFn(at)?at({position:ht,rtl:lt,defaultClassName:pt}):clsx$1(pt,parseClassName(at))}return reactExports.createElement("div",{ref:rt,className:"Toastify",id:ct},it(function(ht,dt){var pt=dt.length?_extends$r({},st):_extends$r({},st,{pointerEvents:"none"});return reactExports.createElement("div",{className:ut(ht),style:pt,key:"container-"+ht},dt.map(function(mt){var gt=mt.content,bt=mt.props;return reactExports.createElement(Toast,Object.assign({},bt,{isIn:ot(bt.toastId),key:"toast-"+bt.key,closeButton:bt.closeButton===!0?CloseButton$4:bt.closeButton}),gt)}))}))};ToastContainer.defaultProps={position:POSITION.TOP_RIGHT,transition:Bounce,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:CloseButton$4,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};var containers=new Map,latestInstance,containerDomNode,containerConfig,queue=[],lazy=!1;function getToast(tt,et){var nt=et.containerId,it=containers.get(nt||latestInstance);return it?it.getToast(tt):null}function generateToastId(){return Math.random().toString(36).substring(2,9)}function getToastId(tt){return tt&&(isStr(tt.toastId)||isNum(tt.toastId))?tt.toastId:generateToastId()}function dispatchToast(tt,et){return containers.size>0?eventManager.emit(0,tt,et):(queue.push({content:tt,options:et}),lazy&&canUseDom&&(lazy=!1,containerDomNode=document.createElement("div"),document.body.appendChild(containerDomNode),reactDomExports.render(reactExports.createElement(ToastContainer,Object.assign({},containerConfig)),containerDomNode))),et.toastId}function mergeOptions(tt,et){return _extends$r({},et,{type:et&&et.type||tt,toastId:getToastId(et)})}function createToastByType(tt){return function(et,nt){return dispatchToast(et,mergeOptions(tt,nt))}}function toast(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,et))}toast.loading=function(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,_extends$r({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},et)))};function handlePromise(tt,et,nt){var it=et.pending,rt=et.error,ot=et.success,at;it&&(at=isStr(it)?toast.loading(it,nt):toast.loading(it.render,_extends$r({},nt,it)));var st={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},lt=function(ht,dt,pt){if(dt==null){toast.dismiss(at);return}var mt=_extends$r({type:ht},st,nt,{data:pt}),gt=isStr(dt)?{render:dt}:dt;return at?toast.update(at,_extends$r({},mt,gt)):toast(gt.render,_extends$r({},mt,gt)),pt},ct=isFn(tt)?tt():tt;return ct.then(function(ut){return lt("success",ot,ut)}).catch(function(ut){return lt("error",rt,ut)}),ct}toast.promise=handlePromise;toast.success=createToastByType(TYPE.SUCCESS);toast.info=createToastByType(TYPE.INFO);toast.error=createToastByType(TYPE.ERROR);toast.warning=createToastByType(TYPE.WARNING);toast.warn=toast.warning;toast.dark=function(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,_extends$r({theme:"dark"},et)))};toast.dismiss=function(tt){return eventManager.emit(1,tt)};toast.clearWaitingQueue=function(tt){return tt===void 0&&(tt={}),eventManager.emit(5,tt)};toast.isActive=function(tt){var et=!1;return containers.forEach(function(nt){nt.isToastActive&&nt.isToastActive(tt)&&(et=!0)}),et};toast.update=function(tt,et){et===void 0&&(et={}),setTimeout(function(){var nt=getToast(tt,et);if(nt){var it=nt.props,rt=nt.content,ot=_extends$r({},it,et,{toastId:et.toastId||tt,updateId:generateToastId()});ot.toastId!==tt&&(ot.staleId=tt);var at=ot.render||rt;delete ot.render,dispatchToast(at,ot)}},0)};toast.done=function(tt){toast.update(tt,{progress:1})};toast.onChange=function(tt){return isFn(tt)&&eventManager.on(4,tt),function(){isFn(tt)&&eventManager.off(4,tt)}};toast.configure=function(tt){tt===void 0&&(tt={}),lazy=!0,containerConfig=tt};toast.POSITION=POSITION;toast.TYPE=TYPE;eventManager.on(2,function(tt){latestInstance=tt.containerId||tt,containers.set(latestInstance,tt),queue.forEach(function(et){eventManager.emit(0,et.content,et.options)}),queue=[]}).on(3,function(tt){containers.delete(tt.containerId||tt),containers.size===0&&eventManager.off(0).off(1).off(5),canUseDom&&containerDomNode&&document.body.removeChild(containerDomNode)});const topupFromToast=async()=>{try{const tt=await distExports$1.topup();if(!tt)throw new Error("Topup failed");if(tt.budget<5)throw new Error("You set a budget of less than 5 sats");toast(jsxRuntimeExports.jsx(ToastMessage,{message:`You set a budget of ${tt.budget} sats`}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:"success"})}catch(tt){tt instanceof Error&&toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt.message}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:"error"})}},ToastMessage=({message:tt})=>tt===BOOST_ERROR_BUDGET?jsxRuntimeExports.jsxs("div",{children:[tt,jsxRuntimeExports.jsx(ButtonWrapper,{onClick:topupFromToast,type:"button",children:jsxRuntimeExports.jsx(Text$4,{color:"white",kind:"medium",children:"Topup"})})]}):jsxRuntimeExports.jsx("div",{children:tt}),notify$1=tt=>{toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt}),{icon:tt===NODE_ADD_SUCCESS?jsxRuntimeExports.jsx(MdCheckCircle,{color:colors.primaryGreen}):jsxRuntimeExports.jsx(MdWarning,{color:colors.primaryRed}),position:toast.POSITION.BOTTOM_CENTER,type:tt===NODE_ADD_SUCCESS?"success":"error"})},ButtonWrapper=styled$4.button` +`,Universe=reactExports.memo(_Universe),PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0";PACKET_TYPES.close="1";PACKET_TYPES.ping="2";PACKET_TYPES.pong="3";PACKET_TYPES.message="4";PACKET_TYPES.upgrade="5";PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(tt=>{PACKET_TYPES_REVERSE[PACKET_TYPES[tt]]=tt});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=tt=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(tt):tt&&tt.buffer instanceof ArrayBuffer,encodePacket=({type:tt,data:et},nt,it)=>withNativeBlob$1&&et instanceof Blob?nt?it(et):encodeBlobAsBase64(et,it):withNativeArrayBuffer$2&&(et instanceof ArrayBuffer||isView$1(et))?nt?it(et):encodeBlobAsBase64(new Blob([et]),it):it(PACKET_TYPES[tt]+(et||"")),encodeBlobAsBase64=(tt,et)=>{const nt=new FileReader;return nt.onload=function(){const it=nt.result.split(",")[1];et("b"+(it||""))},nt.readAsDataURL(tt)};function toArray$1(tt){return tt instanceof Uint8Array?tt:tt instanceof ArrayBuffer?new Uint8Array(tt):new Uint8Array(tt.buffer,tt.byteOffset,tt.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(tt,et){if(withNativeBlob$1&&tt.data instanceof Blob)return tt.data.arrayBuffer().then(toArray$1).then(et);if(withNativeArrayBuffer$2&&(tt.data instanceof ArrayBuffer||isView$1(tt.data)))return et(toArray$1(tt.data));encodePacket(tt,!1,nt=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),et(TEXT_ENCODER.encode(nt))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let tt=0;tt{let et=tt.length*.75,nt=tt.length,it,rt=0,ot,at,st,lt;tt[tt.length-1]==="="&&(et--,tt[tt.length-2]==="="&&et--);const ct=new ArrayBuffer(et),ut=new Uint8Array(ct);for(it=0;it>4,ut[rt++]=(at&15)<<4|st>>2,ut[rt++]=(st&3)<<6|lt&63;return ct},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(tt,et)=>{if(typeof tt!="string")return{type:"message",data:mapBinary(tt,et)};const nt=tt.charAt(0);return nt==="b"?{type:"message",data:decodeBase64Packet(tt.substring(1),et)}:PACKET_TYPES_REVERSE[nt]?tt.length>1?{type:PACKET_TYPES_REVERSE[nt],data:tt.substring(1)}:{type:PACKET_TYPES_REVERSE[nt]}:ERROR_PACKET},decodeBase64Packet=(tt,et)=>{if(withNativeArrayBuffer$1){const nt=decode$2(tt);return mapBinary(nt,et)}else return{base64:!0,data:tt}},mapBinary=(tt,et)=>{switch(et){case"blob":return tt instanceof Blob?tt:new Blob([tt]);case"arraybuffer":default:return tt instanceof ArrayBuffer?tt:tt.buffer}},SEPARATOR=String.fromCharCode(30),encodePayload=(tt,et)=>{const nt=tt.length,it=new Array(nt);let rt=0;tt.forEach((ot,at)=>{encodePacket(ot,!1,st=>{it[at]=st,++rt===nt&&et(it.join(SEPARATOR))})})},decodePayload=(tt,et)=>{const nt=tt.split(SEPARATOR),it=[];for(let rt=0;rt{const it=nt.length;let rt;if(it<126)rt=new Uint8Array(1),new DataView(rt.buffer).setUint8(0,it);else if(it<65536){rt=new Uint8Array(3);const ot=new DataView(rt.buffer);ot.setUint8(0,126),ot.setUint16(1,it)}else{rt=new Uint8Array(9);const ot=new DataView(rt.buffer);ot.setUint8(0,127),ot.setBigUint64(1,BigInt(it))}tt.data&&typeof tt.data!="string"&&(rt[0]|=128),et.enqueue(rt),et.enqueue(nt)})}})}let TEXT_DECODER;function totalLength(tt){return tt.reduce((et,nt)=>et+nt.length,0)}function concatChunks(tt,et){if(tt[0].length===et)return tt.shift();const nt=new Uint8Array(et);let it=0;for(let rt=0;rtMath.pow(2,53-32)-1){st.enqueue(ERROR_PACKET);break}rt=ut*Math.pow(2,32)+ct.getUint32(4),it=3}else{if(totalLength(nt)tt){st.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(tt){if(tt)return mixin(tt)}function mixin(tt){for(var et in Emitter.prototype)tt[et]=Emitter.prototype[et];return tt}Emitter.prototype.on=Emitter.prototype.addEventListener=function(tt,et){return this._callbacks=this._callbacks||{},(this._callbacks["$"+tt]=this._callbacks["$"+tt]||[]).push(et),this};Emitter.prototype.once=function(tt,et){function nt(){this.off(tt,nt),et.apply(this,arguments)}return nt.fn=et,this.on(tt,nt),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(tt,et){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var nt=this._callbacks["$"+tt];if(!nt)return this;if(arguments.length==1)return delete this._callbacks["$"+tt],this;for(var it,rt=0;rttypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function pick(tt,...et){return et.reduce((nt,it)=>(tt.hasOwnProperty(it)&&(nt[it]=tt[it]),nt),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(tt,et){et.useNativeTimers?(tt.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),tt.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(tt.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),tt.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(tt){return typeof tt=="string"?utf8Length(tt):Math.ceil((tt.byteLength||tt.size)*BASE64_OVERHEAD)}function utf8Length(tt){let et=0,nt=0;for(let it=0,rt=tt.length;it=57344?nt+=3:(it++,nt+=4);return nt}function encode$1(tt){let et="";for(let nt in tt)tt.hasOwnProperty(nt)&&(et.length&&(et+="&"),et+=encodeURIComponent(nt)+"="+encodeURIComponent(tt[nt]));return et}function decode$1(tt){let et={},nt=tt.split("&");for(let it=0,rt=nt.length;it0);return et}function yeast(){const tt=encode(+new Date);return tt!==prev?(seed=0,prev=tt):tt+"."+encode(seed++)}for(;i$1{this.readyState="paused",et()};if(this.polling||!this.writable){let it=0;this.polling&&(it++,this.once("pollComplete",function(){--it||nt()})),this.writable||(it++,this.once("drain",function(){--it||nt()}))}else nt()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(et){const nt=it=>{if(this.readyState==="opening"&&it.type==="open"&&this.onOpen(),it.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(it)};decodePayload(et,this.socket.binaryType).forEach(nt),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const et=()=>{this.write([{type:"close"}])};this.readyState==="open"?et():this.once("open",et)}write(et){this.writable=!1,encodePayload(et,nt=>{this.doWrite(nt,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const et=this.opts.secure?"https":"http",nt=this.query||{};return this.opts.timestampRequests!==!1&&(nt[this.opts.timestampParam]=yeast()),!this.supportsBinary&&!nt.sid&&(nt.b64=1),this.createUri(et,nt)}request(et={}){return Object.assign(et,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Request$1(this.uri(),et)}doWrite(et,nt){const it=this.request({method:"POST",data:et});it.on("success",nt),it.on("error",(rt,ot)=>{this.onError("xhr post error",rt,ot)})}doPoll(){const et=this.request();et.on("data",this.onData.bind(this)),et.on("error",(nt,it)=>{this.onError("xhr poll error",nt,it)}),this.pollXhr=et}}let Request$1=class Dy extends Emitter{constructor(et,nt){super(),installTimerFunctions(this,nt),this.opts=nt,this.method=nt.method||"GET",this.uri=et,this.data=nt.data!==void 0?nt.data:null,this.create()}create(){var et;const nt=pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");nt.xdomain=!!this.opts.xd;const it=this.xhr=new XHR(nt);try{it.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){it.setDisableHeaderCheck&&it.setDisableHeaderCheck(!0);for(let rt in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(rt)&&it.setRequestHeader(rt,this.opts.extraHeaders[rt])}}catch{}if(this.method==="POST")try{it.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{it.setRequestHeader("Accept","*/*")}catch{}(et=this.opts.cookieJar)===null||et===void 0||et.addCookies(it),"withCredentials"in it&&(it.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(it.timeout=this.opts.requestTimeout),it.onreadystatechange=()=>{var rt;it.readyState===3&&((rt=this.opts.cookieJar)===null||rt===void 0||rt.parseCookies(it)),it.readyState===4&&(it.status===200||it.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof it.status=="number"?it.status:0)},0))},it.send(this.data)}catch(rt){this.setTimeoutFn(()=>{this.onError(rt)},0);return}typeof document<"u"&&(this.index=Dy.requestsCount++,Dy.requests[this.index]=this)}onError(et){this.emitReserved("error",et,this.xhr),this.cleanup(!0)}cleanup(et){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=empty$3,et)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Dy.requests[this.index],this.xhr=null}}onLoad(){const et=this.xhr.responseText;et!==null&&(this.emitReserved("data",et),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Request$1.requestsCount=0;Request$1.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const tt="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(tt,unloadHandler,!1)}}function unloadHandler(){for(let tt in Request$1.requests)Request$1.requests.hasOwnProperty(tt)&&Request$1.requests[tt].abort()}const nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?et=>Promise.resolve().then(et):(et,nt)=>nt(et,0))(),WebSocket=globalThisShim.WebSocket||globalThisShim.MozWebSocket,usingBrowserWebSocket=!0,defaultBinaryType="arraybuffer",isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class WS extends Transport{constructor(et){super(et),this.supportsBinary=!et.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const et=this.uri(),nt=this.opts.protocols,it=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(it.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?nt?new WebSocket(et,nt):new WebSocket(et):new WebSocket(et,nt,it)}catch(rt){return this.emitReserved("error",rt)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=et=>this.onClose({description:"websocket connection closed",context:et}),this.ws.onmessage=et=>this.onData(et.data),this.ws.onerror=et=>this.onError("websocket error",et)}write(et){this.writable=!1;for(let nt=0;nt{const at={};try{usingBrowserWebSocket&&this.ws.send(ot)}catch{}rt&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const et=this.opts.secure?"wss":"ws",nt=this.query||{};return this.opts.timestampRequests&&(nt[this.opts.timestampParam]=yeast()),this.supportsBinary||(nt.b64=1),this.createUri(et,nt)}check(){return!!WebSocket}}class WT extends Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(et=>{this.onError("webtransport error",et)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(et=>{const nt=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),it=et.readable.pipeThrough(nt).getReader(),rt=createPacketEncoderStream();rt.readable.pipeTo(et.writable),this.writer=rt.writable.getWriter();const ot=()=>{it.read().then(({done:st,value:lt})=>{st||(this.onPacket(lt),ot())}).catch(st=>{})};ot();const at={type:"open"};this.query.sid&&(at.data=`{"sid":"${this.query.sid}"}`),this.writer.write(at).then(()=>this.onOpen())})}))}write(et){this.writable=!1;for(let nt=0;nt{rt&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var et;(et=this.transport)===null||et===void 0||et.close()}}const transports={websocket:WS,webtransport:WT,polling:Polling},re$2=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse$1(tt){if(tt.length>2e3)throw"URI too long";const et=tt,nt=tt.indexOf("["),it=tt.indexOf("]");nt!=-1&&it!=-1&&(tt=tt.substring(0,nt)+tt.substring(nt,it).replace(/:/g,";")+tt.substring(it,tt.length));let rt=re$2.exec(tt||""),ot={},at=14;for(;at--;)ot[parts[at]]=rt[at]||"";return nt!=-1&&it!=-1&&(ot.source=et,ot.host=ot.host.substring(1,ot.host.length-1).replace(/;/g,":"),ot.authority=ot.authority.replace("[","").replace("]","").replace(/;/g,":"),ot.ipv6uri=!0),ot.pathNames=pathNames(ot,ot.path),ot.queryKey=queryKey(ot,ot.query),ot}function pathNames(tt,et){const nt=/\/{2,9}/g,it=et.replace(nt,"/").split("/");return(et.slice(0,1)=="/"||et.length===0)&&it.splice(0,1),et.slice(-1)=="/"&&it.splice(it.length-1,1),it}function queryKey(tt,et){const nt={};return et.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(it,rt,ot){rt&&(nt[rt]=ot)}),nt}let Socket$1=class K0 extends Emitter{constructor(et,nt={}){super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],et&&typeof et=="object"&&(nt=et,et=null),et?(et=parse$1(et),nt.hostname=et.host,nt.secure=et.protocol==="https"||et.protocol==="wss",nt.port=et.port,et.query&&(nt.query=et.query)):nt.host&&(nt.hostname=parse$1(nt.host).host),installTimerFunctions(this,nt),this.secure=nt.secure!=null?nt.secure:typeof location<"u"&&location.protocol==="https:",nt.hostname&&!nt.port&&(nt.port=this.secure?"443":"80"),this.hostname=nt.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=nt.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=nt.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},nt),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$1(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(et){const nt=Object.assign({},this.opts.query);nt.EIO=protocol$1,nt.transport=et,this.id&&(nt.sid=this.id);const it=Object.assign({},this.opts,{query:nt,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[et]);return new transports[et](it)}open(){let et;if(this.opts.rememberUpgrade&&K0.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)et="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else et=this.transports[0];this.readyState="opening";try{et=this.createTransport(et)}catch{this.transports.shift(),this.open();return}et.open(),this.setTransport(et)}setTransport(et){this.transport&&this.transport.removeAllListeners(),this.transport=et,et.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",nt=>this.onClose("transport close",nt))}probe(et){let nt=this.createTransport(et),it=!1;K0.priorWebsocketSuccess=!1;const rt=()=>{it||(nt.send([{type:"ping",data:"probe"}]),nt.once("packet",ht=>{if(!it)if(ht.type==="pong"&&ht.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",nt),!nt)return;K0.priorWebsocketSuccess=nt.name==="websocket",this.transport.pause(()=>{it||this.readyState!=="closed"&&(ut(),this.setTransport(nt),nt.send([{type:"upgrade"}]),this.emitReserved("upgrade",nt),nt=null,this.upgrading=!1,this.flush())})}else{const dt=new Error("probe error");dt.transport=nt.name,this.emitReserved("upgradeError",dt)}}))};function ot(){it||(it=!0,ut(),nt.close(),nt=null)}const at=ht=>{const dt=new Error("probe error: "+ht);dt.transport=nt.name,ot(),this.emitReserved("upgradeError",dt)};function st(){at("transport closed")}function lt(){at("socket closed")}function ct(ht){nt&&ht.name!==nt.name&&ot()}const ut=()=>{nt.removeListener("open",rt),nt.removeListener("error",at),nt.removeListener("close",st),this.off("close",lt),this.off("upgrading",ct)};nt.once("open",rt),nt.once("error",at),nt.once("close",st),this.once("close",lt),this.once("upgrading",ct),this.upgrades.indexOf("webtransport")!==-1&&et!=="webtransport"?this.setTimeoutFn(()=>{it||nt.open()},200):nt.open()}onOpen(){if(this.readyState="open",K0.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let et=0;const nt=this.upgrades.length;for(;et{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const et=this.getWritablePackets();this.transport.send(et),this.prevBufferLen=et.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let nt=1;for(let it=0;it0&&nt>this.maxPayload)return this.writeBuffer.slice(0,it);nt+=2}return this.writeBuffer}write(et,nt,it){return this.sendPacket("message",et,nt,it),this}send(et,nt,it){return this.sendPacket("message",et,nt,it),this}sendPacket(et,nt,it,rt){if(typeof nt=="function"&&(rt=nt,nt=void 0),typeof it=="function"&&(rt=it,it=null),this.readyState==="closing"||this.readyState==="closed")return;it=it||{},it.compress=it.compress!==!1;const ot={type:et,data:nt,options:it};this.emitReserved("packetCreate",ot),this.writeBuffer.push(ot),rt&&this.once("flush",rt),this.flush()}close(){const et=()=>{this.onClose("forced close"),this.transport.close()},nt=()=>{this.off("upgrade",nt),this.off("upgradeError",nt),et()},it=()=>{this.once("upgrade",nt),this.once("upgradeError",nt)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?it():et()}):this.upgrading?it():et()),this}onError(et){K0.priorWebsocketSuccess=!1,this.emitReserved("error",et),this.onClose("transport error",et)}onClose(et,nt){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",et,nt),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(et){const nt=[];let it=0;const rt=et.length;for(;ittypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(tt):tt.buffer instanceof ArrayBuffer,toString$6=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$6.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$6.call(File)==="[object FileConstructor]";function isBinary(tt){return withNativeArrayBuffer&&(tt instanceof ArrayBuffer||isView(tt))||withNativeBlob&&tt instanceof Blob||withNativeFile&&tt instanceof File}function hasBinary(tt,et){if(!tt||typeof tt!="object")return!1;if(Array.isArray(tt)){for(let nt=0,it=tt.length;nt=0&&tt.num{delete this.acks[et];for(let at=0;at{this.io.clearTimeoutFn(ot),nt.apply(this,[null,...at])}}emitWithAck(et,...nt){const it=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((rt,ot)=>{nt.push((at,st)=>it?at?ot(at):rt(st):rt(at)),this.emit(et,...nt)})}_addToQueue(et){let nt;typeof et[et.length-1]=="function"&&(nt=et.pop());const it={id:this._queueSeq++,tryCount:0,pending:!1,args:et,flags:Object.assign({fromQueue:!0},this.flags)};et.push((rt,...ot)=>it!==this._queue[0]?void 0:(rt!==null?it.tryCount>this._opts.retries&&(this._queue.shift(),nt&&nt(rt)):(this._queue.shift(),nt&&nt(null,...ot)),it.pending=!1,this._drainQueue())),this._queue.push(it),this._drainQueue()}_drainQueue(et=!1){if(!this.connected||this._queue.length===0)return;const nt=this._queue[0];nt.pending&&!et||(nt.pending=!0,nt.tryCount++,this.flags=nt.flags,this.emit.apply(this,nt.args))}packet(et){et.nsp=this.nsp,this.io._packet(et)}onopen(){typeof this.auth=="function"?this.auth(et=>{this._sendConnectPacket(et)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(et){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},et):et})}onerror(et){this.connected||this.emitReserved("connect_error",et)}onclose(et,nt){this.connected=!1,delete this.id,this.emitReserved("disconnect",et,nt)}onpacket(et){if(et.nsp===this.nsp)switch(et.type){case PacketType.CONNECT:et.data&&et.data.sid?this.onconnect(et.data.sid,et.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(et);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(et);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const it=new Error(et.data.message);it.data=et.data.data,this.emitReserved("connect_error",it);break}}onevent(et){const nt=et.data||[];et.id!=null&&nt.push(this.ack(et.id)),this.connected?this.emitEvent(nt):this.receiveBuffer.push(Object.freeze(nt))}emitEvent(et){if(this._anyListeners&&this._anyListeners.length){const nt=this._anyListeners.slice();for(const it of nt)it.apply(this,et)}super.emit.apply(this,et),this._pid&&et.length&&typeof et[et.length-1]=="string"&&(this._lastOffset=et[et.length-1])}ack(et){const nt=this;let it=!1;return function(...rt){it||(it=!0,nt.packet({type:PacketType.ACK,id:et,data:rt}))}}onack(et){const nt=this.acks[et.id];typeof nt=="function"&&(nt.apply(this,et.data),delete this.acks[et.id])}onconnect(et,nt){this.id=et,this.recovered=nt&&this._pid===nt,this._pid=nt,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(et=>this.emitEvent(et)),this.receiveBuffer=[],this.sendBuffer.forEach(et=>{this.notifyOutgoingListeners(et),this.packet(et)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(et=>et()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(et){return this.flags.compress=et,this}get volatile(){return this.flags.volatile=!0,this}timeout(et){return this.flags.timeout=et,this}onAny(et){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(et),this}prependAny(et){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(et),this}offAny(et){if(!this._anyListeners)return this;if(et){const nt=this._anyListeners;for(let it=0;it0&&tt.jitter<=1?tt.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var tt=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var et=Math.random(),nt=Math.floor(et*this.jitter*tt);tt=Math.floor(et*10)&1?tt+nt:tt-nt}return Math.min(tt,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(tt){this.ms=tt};Backoff.prototype.setMax=function(tt){this.max=tt};Backoff.prototype.setJitter=function(tt){this.jitter=tt};class Manager extends Emitter{constructor(et,nt){var it;super(),this.nsps={},this.subs=[],et&&typeof et=="object"&&(nt=et,et=void 0),nt=nt||{},nt.path=nt.path||"/socket.io",this.opts=nt,installTimerFunctions(this,nt),this.reconnection(nt.reconnection!==!1),this.reconnectionAttempts(nt.reconnectionAttempts||1/0),this.reconnectionDelay(nt.reconnectionDelay||1e3),this.reconnectionDelayMax(nt.reconnectionDelayMax||5e3),this.randomizationFactor((it=nt.randomizationFactor)!==null&&it!==void 0?it:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(nt.timeout==null?2e4:nt.timeout),this._readyState="closed",this.uri=et;const rt=nt.parser||parser;this.encoder=new rt.Encoder,this.decoder=new rt.Decoder,this._autoConnect=nt.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(et){return arguments.length?(this._reconnection=!!et,this):this._reconnection}reconnectionAttempts(et){return et===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=et,this)}reconnectionDelay(et){var nt;return et===void 0?this._reconnectionDelay:(this._reconnectionDelay=et,(nt=this.backoff)===null||nt===void 0||nt.setMin(et),this)}randomizationFactor(et){var nt;return et===void 0?this._randomizationFactor:(this._randomizationFactor=et,(nt=this.backoff)===null||nt===void 0||nt.setJitter(et),this)}reconnectionDelayMax(et){var nt;return et===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=et,(nt=this.backoff)===null||nt===void 0||nt.setMax(et),this)}timeout(et){return arguments.length?(this._timeout=et,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(et){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const nt=this.engine,it=this;this._readyState="opening",this.skipReconnect=!1;const rt=on(nt,"open",function(){it.onopen(),et&&et()}),ot=st=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",st),et?et(st):this.maybeReconnectOnOpen()},at=on(nt,"error",ot);if(this._timeout!==!1){const st=this._timeout,lt=this.setTimeoutFn(()=>{rt(),ot(new Error("timeout")),nt.close()},st);this.opts.autoUnref&<.unref(),this.subs.push(()=>{this.clearTimeoutFn(lt)})}return this.subs.push(rt),this.subs.push(at),this}connect(et){return this.open(et)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const et=this.engine;this.subs.push(on(et,"ping",this.onping.bind(this)),on(et,"data",this.ondata.bind(this)),on(et,"error",this.onerror.bind(this)),on(et,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(et){try{this.decoder.add(et)}catch(nt){this.onclose("parse error",nt)}}ondecoded(et){nextTick(()=>{this.emitReserved("packet",et)},this.setTimeoutFn)}onerror(et){this.emitReserved("error",et)}socket(et,nt){let it=this.nsps[et];return it?this._autoConnect&&!it.active&&it.connect():(it=new Socket(this,et,nt),this.nsps[et]=it),it}_destroy(et){const nt=Object.keys(this.nsps);for(const it of nt)if(this.nsps[it].active)return;this._close()}_packet(et){const nt=this.encoder.encode(et);for(let it=0;itet()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(et,nt){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",et,nt),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const et=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const nt=this.backoff.duration();this._reconnecting=!0;const it=this.setTimeoutFn(()=>{et.skipReconnect||(this.emitReserved("reconnect_attempt",et.backoff.attempts),!et.skipReconnect&&et.open(rt=>{rt?(et._reconnecting=!1,et.reconnect(),this.emitReserved("reconnect_error",rt)):et.onreconnect()}))},nt);this.opts.autoUnref&&it.unref(),this.subs.push(()=>{this.clearTimeoutFn(it)})}}onreconnect(){const et=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",et)}}const cache={};function lookup(tt,et){typeof tt=="object"&&(et=tt,tt=void 0),et=et||{};const nt=url(tt,et.path||"/socket.io"),it=nt.source,rt=nt.id,ot=nt.path,at=cache[rt]&&ot in cache[rt].nsps,st=et.forceNew||et["force new connection"]||et.multiplex===!1||at;let lt;return st?lt=new Manager(it,et):(cache[rt]||(cache[rt]=new Manager(it,et)),lt=cache[rt]),nt.query&&!et.query&&(et.query=nt.queryKey),lt.socket(nt.path,et)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const useSocket=()=>{const[tt,et]=reactExports.useState(null);return reactExports.useEffect(()=>{const nt=lookup(API_URL);return et(nt),()=>{nt.disconnect()}},[]),tt};async function getIsAdmin({message:tt,tribeHost:et,tribeUuid:nt,signature:it}){return api$1.get(`/isAdmin?msg=${tt}&sig=${it}&tribe_host=${et}&uuid=${nt}`)}const defaultData$2={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},useTeachStore=react(tt=>({...defaultData$2,setAskedQuestion:et=>tt(nt=>({askedQuestions:[...nt.askedQuestions||[],et],hasQuestionInProgress:!0})),setAskedQuestionAnswer:et=>tt(nt=>({askedQuestionsAnswers:[...nt.askedQuestionsAnswers||[],et],hasQuestionInProgress:!1})),setHasQuestionInProgress:et=>tt({hasQuestionInProgress:et}),setHasTeachingInProgress:et=>tt({hasTeachingInProgress:et}),setHasInstagraphInProgress:et=>tt({hasInstagraphInProgress:et}),setTeachMeAnswer:et=>tt({hasTeachingInProgress:!1,teachMeAnswer:et}),setInstagraphAnswer:et=>{var nt,it,rt,ot;(nt=et==null?void 0:et.instagraph)!=null&&nt.edges&&((it=et==null?void 0:et.instagraph)!=null&&it.nodes)&&tt({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(rt=et==null?void 0:et.instagraph)==null?void 0:rt.edges,nodes:(ot=et==null?void 0:et.instagraph)==null?void 0:ot.nodes}})}})),version="0.1.106";function _extends$q(){return _extends$q=Object.assign||function(tt){for(var et=1;et=0)&&(nt[rt]=tt[rt]);return nt}function isNum(tt){return typeof tt=="number"&&!isNaN(tt)}function isBool(tt){return typeof tt=="boolean"}function isStr(tt){return typeof tt=="string"}function isFn(tt){return typeof tt=="function"}function parseClassName(tt){return isStr(tt)||isFn(tt)?tt:null}function isToastIdValid(tt){return tt===0||tt}function getAutoCloseDelay(tt,et){return tt===!1||isNum(tt)&&tt>0?tt:et}var canUseDom=!!(typeof window<"u"&&window.document&&window.document.createElement);function canBeRendered(tt){return reactExports.isValidElement(tt)||isStr(tt)||isFn(tt)||isNum(tt)}var POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function collapseToast(tt,et,nt){nt===void 0&&(nt=300);var it=tt.scrollHeight,rt=tt.style;requestAnimationFrame(function(){rt.minHeight="initial",rt.height=it+"px",rt.transition="all "+nt+"ms",requestAnimationFrame(function(){rt.height="0",rt.padding="0",rt.margin="0",setTimeout(et,nt)})})}function cssTransition(tt){var et=tt.enter,nt=tt.exit,it=tt.appendPosition,rt=it===void 0?!1:it,ot=tt.collapse,at=ot===void 0?!0:ot,st=tt.collapseDuration,lt=st===void 0?300:st;return function(ut){var ht=ut.children,dt=ut.position,pt=ut.preventExitTransition,mt=ut.done,gt=ut.nodeRef,bt=ut.isIn,yt=rt?et+"--"+dt:et,wt=rt?nt+"--"+dt:nt,vt=reactExports.useRef(),xt=reactExports.useRef(0);reactExports.useLayoutEffect(function(){St()},[]),reactExports.useEffect(function(){bt||(pt?It():$t())},[bt]);function St(){var Ft=gt.current;vt.current=Ft.className,Ft.className+=" "+yt,Ft.addEventListener("animationend",Et),Ft.addEventListener("animationcancel",Et)}function Et(Ft){if(Ft.target===gt.current){var Ht=gt.current;Ht.dispatchEvent(new Event("d")),Ht.removeEventListener("animationend",Et),Ht.removeEventListener("animationcancel",Et),xt.current===0&&(Ht.className=vt.current)}}function $t(){xt.current=1;var Ft=gt.current;Ft.className+=" "+wt,Ft.addEventListener("animationend",It)}function It(){var Ft=gt.current;Ft.removeEventListener("animationend",It),at?collapseToast(Ft,mt,lt):mt()}return React$1.createElement(React$1.Fragment,null,ht)}}var eventManager={list:new Map,emitQueue:new Map,on:function tt(et,nt){return this.list.has(et)||this.list.set(et,[]),this.list.get(et).push(nt),this},off:function tt(et,nt){if(nt){var it=this.list.get(et).filter(function(rt){return rt!==nt});return this.list.set(et,it),this}return this.list.delete(et),this},cancelEmit:function tt(et){var nt=this.emitQueue.get(et);return nt&&(nt.forEach(clearTimeout),this.emitQueue.delete(et)),this},emit:function tt(et){for(var nt=this,it=arguments.length,rt=new Array(it>1?it-1:0),ot=1;ot0){var Ct=isToastIdValid(Et)?1:ct.props.limit;if(Tt===1||Ct===1)ct.displayedToast++,dt();else{var Ut=Ct>Tt?Tt:Ct;ct.displayedToast=Ut;for(var Nt=0;Nt0&&ct.count>Ft.limit&&zt?ct.queue.push({toastContent:jt,toastProps:Ot,staleId:xt}):isNum(vt)&&vt>0?setTimeout(function(){gt(jt,Ot,xt)},vt):gt(jt,Ot,xt)}}function gt(yt,wt,vt){var xt=wt.toastId;vt&&st.delete(vt),st.set(xt,{content:yt,props:wt}),ot(function(St){return[].concat(St,[xt]).filter(function(Et){return Et!==vt})})}function bt(yt){var wt=new Map,vt=Array.from(st.values());return tt.newestOnTop&&vt.reverse(),vt.forEach(function(xt){var St=xt.props.position;wt.has(St)||wt.set(St,[]),wt.get(St).push(xt)}),Array.from(wt,function(xt){return yt(xt[0],xt[1])})}return{getToastToRender:bt,containerRef:at,isToastActive:lt}}function getX$1(tt){return tt.targetTouches&&tt.targetTouches.length>=1?tt.targetTouches[0].clientX:tt.clientX}function getY$1(tt){return tt.targetTouches&&tt.targetTouches.length>=1?tt.targetTouches[0].clientY:tt.clientY}function useToast(tt){var et=reactExports.useState(!1),nt=et[0],it=et[1],rt=reactExports.useState(!1),ot=rt[0],at=rt[1],st=reactExports.useRef(null),lt=reactExports.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,ct=reactExports.useRef(tt),ut=tt.autoClose,ht=tt.pauseOnHover,dt=tt.closeToast,pt=tt.onClick,mt=tt.closeOnClick;reactExports.useEffect(function(){ct.current=tt}),reactExports.useEffect(function(){return st.current&&st.current.addEventListener("d",yt,{once:!0}),isFn(tt.onOpen)&&tt.onOpen(reactExports.isValidElement(tt.children)&&tt.children.props),function(){var Ht=ct.current;isFn(Ht.onClose)&&Ht.onClose(reactExports.isValidElement(Ht.children)&&Ht.children.props)}},[]),reactExports.useEffect(function(){return tt.pauseOnFocusLoss&&vt(),function(){tt.pauseOnFocusLoss&&xt()}},[tt.pauseOnFocusLoss]);function gt(Ht){if(tt.draggable){St();var zt=st.current;lt.canCloseOnClick=!0,lt.canDrag=!0,lt.boundingRect=zt.getBoundingClientRect(),zt.style.transition="",lt.x=getX$1(Ht.nativeEvent),lt.y=getY$1(Ht.nativeEvent),tt.draggableDirection==="x"?(lt.start=lt.x,lt.removalDistance=zt.offsetWidth*(tt.draggablePercent/100)):(lt.start=lt.y,lt.removalDistance=zt.offsetHeight*(tt.draggablePercent===80?tt.draggablePercent*1.5:tt.draggablePercent/100))}}function bt(){if(lt.boundingRect){var Ht=lt.boundingRect,zt=Ht.top,Ot=Ht.bottom,jt=Ht.left,kt=Ht.right;tt.pauseOnHover&<.x>=jt&<.x<=kt&<.y>=zt&<.y<=Ot?wt():yt()}}function yt(){it(!0)}function wt(){it(!1)}function vt(){document.hasFocus()||wt(),window.addEventListener("focus",yt),window.addEventListener("blur",wt)}function xt(){window.removeEventListener("focus",yt),window.removeEventListener("blur",wt)}function St(){lt.didMove=!1,document.addEventListener("mousemove",$t),document.addEventListener("mouseup",It),document.addEventListener("touchmove",$t),document.addEventListener("touchend",It)}function Et(){document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",It),document.removeEventListener("touchmove",$t),document.removeEventListener("touchend",It)}function $t(Ht){var zt=st.current;lt.canDrag&&zt&&(lt.didMove=!0,nt&&wt(),lt.x=getX$1(Ht),lt.y=getY$1(Ht),tt.draggableDirection==="x"?lt.delta=lt.x-lt.start:lt.delta=lt.y-lt.start,lt.start!==lt.x&&(lt.canCloseOnClick=!1),zt.style.transform="translate"+tt.draggableDirection+"("+lt.delta+"px)",zt.style.opacity=""+(1-Math.abs(lt.delta/lt.removalDistance)))}function It(){Et();var Ht=st.current;if(lt.canDrag&<.didMove&&Ht){if(lt.canDrag=!1,Math.abs(lt.delta)>lt.removalDistance){at(!0),tt.closeToast();return}Ht.style.transition="transform 0.2s, opacity 0.2s",Ht.style.transform="translate"+tt.draggableDirection+"(0)",Ht.style.opacity="1"}}var Ft={onMouseDown:gt,onTouchStart:gt,onMouseUp:bt,onTouchEnd:bt};return ut&&ht&&(Ft.onMouseEnter=wt,Ft.onMouseLeave=yt),mt&&(Ft.onClick=function(Ht){pt&&pt(Ht),lt.canCloseOnClick&&dt()}),{playToast:yt,pauseToast:wt,isRunning:nt,preventExitTransition:ot,toastRef:st,eventHandlers:Ft}}function CloseButton$4(tt){var et=tt.closeToast,nt=tt.theme,it=tt.ariaLabel,rt=it===void 0?"close":it;return reactExports.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+nt,type:"button",onClick:function(at){at.stopPropagation(),et(at)},"aria-label":rt},reactExports.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},reactExports.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ProgressBar(tt){var et,nt,it=tt.delay,rt=tt.isRunning,ot=tt.closeToast,at=tt.type,st=tt.hide,lt=tt.className,ct=tt.style,ut=tt.controlledProgress,ht=tt.progress,dt=tt.rtl,pt=tt.isIn,mt=tt.theme,gt=_extends$q({},ct,{animationDuration:it+"ms",animationPlayState:rt?"running":"paused",opacity:st?0:1});ut&&(gt.transform="scaleX("+ht+")");var bt=clsx$1("Toastify__progress-bar",ut?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+mt,"Toastify__progress-bar--"+at,(et={},et["Toastify__progress-bar--rtl"]=dt,et)),yt=isFn(lt)?lt({rtl:dt,type:at,defaultClassName:bt}):clsx$1(bt,lt),wt=(nt={},nt[ut&&ht>=1?"onTransitionEnd":"onAnimationEnd"]=ut&&ht<1?null:function(){pt&&ot()},nt);return reactExports.createElement("div",Object.assign({role:"progressbar","aria-hidden":st?"true":"false","aria-label":"notification timer",className:yt,style:gt},wt))}ProgressBar.defaultProps={type:TYPE.DEFAULT,hide:!1};var _excluded$1$1=["theme","type"],Svg=function tt(et){var nt=et.theme,it=et.type,rt=_objectWithoutPropertiesLoose$j(et,_excluded$1$1);return reactExports.createElement("svg",Object.assign({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:nt==="colored"?"currentColor":"var(--toastify-icon-color-"+it+")"},rt))};function Warning(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Info$1(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Success(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Error$1(tt){return reactExports.createElement(Svg,Object.assign({},tt),reactExports.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Spinner(){return reactExports.createElement("div",{className:"Toastify__spinner"})}var Icons={info:Info$1,warning:Warning,success:Success,error:Error$1,spinner:Spinner},Toast=function tt(et){var nt,it,rt=useToast(et),ot=rt.isRunning,at=rt.preventExitTransition,st=rt.toastRef,lt=rt.eventHandlers,ct=et.closeButton,ut=et.children,ht=et.autoClose,dt=et.onClick,pt=et.type,mt=et.hideProgressBar,gt=et.closeToast,bt=et.transition,yt=et.position,wt=et.className,vt=et.style,xt=et.bodyClassName,St=et.bodyStyle,Et=et.progressClassName,$t=et.progressStyle,It=et.updateId,Ft=et.role,Ht=et.progress,zt=et.rtl,Ot=et.toastId,jt=et.deleteToast,kt=et.isIn,Tt=et.isLoading,Ct=et.icon,Ut=et.theme,Nt=clsx$1("Toastify__toast","Toastify__toast-theme--"+Ut,"Toastify__toast--"+pt,(nt={},nt["Toastify__toast--rtl"]=zt,nt)),Bt=isFn(wt)?wt({rtl:zt,position:yt,type:pt,defaultClassName:Nt}):clsx$1(Nt,wt),Mt=!!Ht,Dt=Icons[pt],Pt={theme:Ut,type:pt},Vt=Dt&&Dt(Pt);Ct===!1?Vt=void 0:isFn(Ct)?Vt=Ct(Pt):reactExports.isValidElement(Ct)?Vt=reactExports.cloneElement(Ct,Pt):isStr(Ct)?Vt=Ct:Tt&&(Vt=Icons.spinner());function nn(cn){if(cn){var Xt={closeToast:gt,type:pt,theme:Ut};if(isFn(cn))return cn(Xt);if(reactExports.isValidElement(cn))return reactExports.cloneElement(cn,Xt)}}return reactExports.createElement(bt,{isIn:kt,done:jt,position:yt,preventExitTransition:at,nodeRef:st},reactExports.createElement("div",Object.assign({id:Ot,onClick:dt,className:Bt},lt,{style:vt,ref:st}),reactExports.createElement("div",Object.assign({},kt&&{role:Ft},{className:isFn(xt)?xt({type:pt}):clsx$1("Toastify__toast-body",xt),style:St}),Vt&&reactExports.createElement("div",{className:clsx$1("Toastify__toast-icon",(it={},it["Toastify--animate-icon Toastify__zoom-enter"]=!Tt,it))},Vt),reactExports.createElement("div",null,ut)),nn(ct),(ht||Mt)&&reactExports.createElement(ProgressBar,Object.assign({},It&&!Mt?{key:"pb-"+It}:{},{rtl:zt,theme:Ut,delay:ht,isRunning:ot,isIn:kt,closeToast:gt,hide:mt,type:pt,style:$t,className:Et,controlledProgress:Mt,progress:Ht}))))},Bounce=cssTransition({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),ToastContainer=function tt(et){var nt=useToastContainer(et),it=nt.getToastToRender,rt=nt.containerRef,ot=nt.isToastActive,at=et.className,st=et.style,lt=et.rtl,ct=et.containerId;function ut(ht){var dt,pt=clsx$1("Toastify__toast-container","Toastify__toast-container--"+ht,(dt={},dt["Toastify__toast-container--rtl"]=lt,dt));return isFn(at)?at({position:ht,rtl:lt,defaultClassName:pt}):clsx$1(pt,parseClassName(at))}return reactExports.createElement("div",{ref:rt,className:"Toastify",id:ct},it(function(ht,dt){var pt=dt.length?_extends$q({},st):_extends$q({},st,{pointerEvents:"none"});return reactExports.createElement("div",{className:ut(ht),style:pt,key:"container-"+ht},dt.map(function(mt){var gt=mt.content,bt=mt.props;return reactExports.createElement(Toast,Object.assign({},bt,{isIn:ot(bt.toastId),key:"toast-"+bt.key,closeButton:bt.closeButton===!0?CloseButton$4:bt.closeButton}),gt)}))}))};ToastContainer.defaultProps={position:POSITION.TOP_RIGHT,transition:Bounce,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:CloseButton$4,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};var containers=new Map,latestInstance,containerDomNode,containerConfig,queue=[],lazy$1=!1;function getToast(tt,et){var nt=et.containerId,it=containers.get(nt||latestInstance);return it?it.getToast(tt):null}function generateToastId(){return Math.random().toString(36).substring(2,9)}function getToastId(tt){return tt&&(isStr(tt.toastId)||isNum(tt.toastId))?tt.toastId:generateToastId()}function dispatchToast(tt,et){return containers.size>0?eventManager.emit(0,tt,et):(queue.push({content:tt,options:et}),lazy$1&&canUseDom&&(lazy$1=!1,containerDomNode=document.createElement("div"),document.body.appendChild(containerDomNode),reactDomExports.render(reactExports.createElement(ToastContainer,Object.assign({},containerConfig)),containerDomNode))),et.toastId}function mergeOptions(tt,et){return _extends$q({},et,{type:et&&et.type||tt,toastId:getToastId(et)})}function createToastByType(tt){return function(et,nt){return dispatchToast(et,mergeOptions(tt,nt))}}function toast(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,et))}toast.loading=function(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,_extends$q({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},et)))};function handlePromise(tt,et,nt){var it=et.pending,rt=et.error,ot=et.success,at;it&&(at=isStr(it)?toast.loading(it,nt):toast.loading(it.render,_extends$q({},nt,it)));var st={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},lt=function(ht,dt,pt){if(dt==null){toast.dismiss(at);return}var mt=_extends$q({type:ht},st,nt,{data:pt}),gt=isStr(dt)?{render:dt}:dt;return at?toast.update(at,_extends$q({},mt,gt)):toast(gt.render,_extends$q({},mt,gt)),pt},ct=isFn(tt)?tt():tt;return ct.then(function(ut){return lt("success",ot,ut)}).catch(function(ut){return lt("error",rt,ut)}),ct}toast.promise=handlePromise;toast.success=createToastByType(TYPE.SUCCESS);toast.info=createToastByType(TYPE.INFO);toast.error=createToastByType(TYPE.ERROR);toast.warning=createToastByType(TYPE.WARNING);toast.warn=toast.warning;toast.dark=function(tt,et){return dispatchToast(tt,mergeOptions(TYPE.DEFAULT,_extends$q({theme:"dark"},et)))};toast.dismiss=function(tt){return eventManager.emit(1,tt)};toast.clearWaitingQueue=function(tt){return tt===void 0&&(tt={}),eventManager.emit(5,tt)};toast.isActive=function(tt){var et=!1;return containers.forEach(function(nt){nt.isToastActive&&nt.isToastActive(tt)&&(et=!0)}),et};toast.update=function(tt,et){et===void 0&&(et={}),setTimeout(function(){var nt=getToast(tt,et);if(nt){var it=nt.props,rt=nt.content,ot=_extends$q({},it,et,{toastId:et.toastId||tt,updateId:generateToastId()});ot.toastId!==tt&&(ot.staleId=tt);var at=ot.render||rt;delete ot.render,dispatchToast(at,ot)}},0)};toast.done=function(tt){toast.update(tt,{progress:1})};toast.onChange=function(tt){return isFn(tt)&&eventManager.on(4,tt),function(){isFn(tt)&&eventManager.off(4,tt)}};toast.configure=function(tt){tt===void 0&&(tt={}),lazy$1=!0,containerConfig=tt};toast.POSITION=POSITION;toast.TYPE=TYPE;eventManager.on(2,function(tt){latestInstance=tt.containerId||tt,containers.set(latestInstance,tt),queue.forEach(function(et){eventManager.emit(0,et.content,et.options)}),queue=[]}).on(3,function(tt){containers.delete(tt.containerId||tt),containers.size===0&&eventManager.off(0).off(1).off(5),canUseDom&&containerDomNode&&document.body.removeChild(containerDomNode)});const topupFromToast=async()=>{try{const tt=await distExports$1.topup();if(!tt)throw new Error("Topup failed");if(tt.budget<5)throw new Error("You set a budget of less than 5 sats");toast(jsxRuntimeExports.jsx(ToastMessage,{message:`You set a budget of ${tt.budget} sats`}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:"success"})}catch(tt){tt instanceof Error&&toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt.message}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:"error"})}},ToastMessage=({message:tt})=>tt===BOOST_ERROR_BUDGET?jsxRuntimeExports.jsxs("div",{children:[tt,jsxRuntimeExports.jsx(ButtonWrapper,{onClick:topupFromToast,type:"button",children:jsxRuntimeExports.jsx(Text$4,{color:"white",kind:"medium",children:"Topup"})})]}):jsxRuntimeExports.jsx("div",{children:tt}),notify$1=tt=>{toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt}),{icon:tt===NODE_ADD_SUCCESS?jsxRuntimeExports.jsx(MdCheckCircle,{color:colors.primaryGreen}):jsxRuntimeExports.jsx(MdWarning,{color:colors.primaryRed}),position:toast.POSITION.BOTTOM_CENTER,type:tt===NODE_ADD_SUCCESS?"success":"error"})},ButtonWrapper=styled$4.button` background: ${colors.gray200}; border: 1px solid ${colors.white}; border-radius: 2px; @@ -5397,7 +5397,7 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`;var reactInputMask={exports:{}},reactInputMask_production_min={exports:{}};function t$1(tt){return tt&&typeof tt=="object"&&"default"in tt?tt.default:tt}var e$1=reactExports,n$1=t$1(e$1),i=reactDomExports,r$2=t$1(browser$c);function a$1(){return(a$1=Object.assign||function(tt){for(var et=1;et=0||(rt[nt]=tt[nt]);return rt}function u(tt){return requestAnimationFrame(tt)}function s$1(tt){cancelAnimationFrame(tt)}function c$2(tt){var et=tt.ownerDocument;return et.hasFocus()&&et.activeElement===tt}function f$1(tt){return tt==null?void 0:tt.ownerDocument}function h$1(tt){var et=function(nt){var it;return(it=f$1(nt))==null?void 0:it.defaultView}(tt);return!!et&&tt instanceof et.HTMLElement}function g$1(tt){return e$1.useCallback(function(){var et=tt.current,nt=typeof window<"u"&&h$1(et);if(!et||!nt)return null;if(et.nodeName!=="INPUT"&&(et=et.querySelector("input")),!et)throw new Error("react-input-mask: inputComponent doesn't contain input node");return et},[tt])}function v$1(tt,et){var nt,it,rt,ot,at=e$1.useRef({start:null,end:null}),st=g$1(tt),lt=e$1.useCallback(function(){return function(gt){var bt=gt.selectionStart,yt=gt.selectionEnd;return{start:bt,end:yt,length:yt-bt}}(st())},[st]),ct=e$1.useCallback(function(){return at.current},[]),ut=e$1.useCallback(function(gt){var bt=st();bt&&c$2(bt)&&(function(yt,wt,vt){vt===void 0&&(vt=wt),yt.setSelectionRange(wt,vt)}(bt,gt.start,gt.end),at.current=lt())},[st,lt]),ht=e$1.useCallback(function(){at.current=lt()},[lt]),dt=(nt=ht,it=e$1.useRef(null),rt=e$1.useCallback(function(){it.current===null&&function gt(){nt(),it.current=u(gt)}()},[nt]),ot=e$1.useCallback(function(){s$1(it.current),it.current=null},[]),e$1.useEffect(function(){it.current&&(ot(),rt())},[rt,ot]),e$1.useEffect(s$1,[]),[rt,ot]),pt=dt[0],mt=dt[1];return e$1.useLayoutEffect(function(){if(et){var gt=st();return gt.addEventListener("focus",pt),gt.addEventListener("blur",mt),c$2(gt)&&pt(),function(){gt.removeEventListener("focus",pt),gt.removeEventListener("blur",mt),mt()}}}),{getSelection:lt,getLastSelection:ct,setSelection:ut}}function d$1(tt,et){var nt=e$1.useRef(),it=v$1(nt,et),rt=it.getSelection,ot=it.getLastSelection,at=it.setSelection,st=function(ht,dt){var pt=g$1(ht),mt=e$1.useRef(dt);return{getValue:e$1.useCallback(function(){return pt().value},[pt]),getLastValue:e$1.useCallback(function(){return mt.current},[]),setValue:e$1.useCallback(function(gt){mt.current=gt;var bt=pt();bt&&(bt.value=gt)},[pt])}}(nt,tt),lt=st.getValue,ct=st.getLastValue,ut=st.setValue;return{inputRef:nt,getInputState:function(){return{value:lt(),selection:rt()}},getLastInputState:function(){return{value:ct(),selection:ot()}},setInputState:function(ht){var dt=ht.value,pt=ht.selection;ut(dt),at(pt)}}}var p$1=["disabled","onBlur","onChange","onFocus","onMouseDown","readOnly","value"],m$1={9:/[0-9]/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/},P$1=function(tt){var et=this;this.isCharacterAllowedAtPosition=function(nt,it){var rt=et.maskOptions.maskPlaceholder;return!!et.isCharacterFillingPosition(nt,it)||!!rt&&rt[it]===nt},this.isCharacterFillingPosition=function(nt,it){var rt=et.maskOptions.mask;if(!nt||it>=rt.length)return!1;if(!et.isPositionEditable(it))return rt[it]===nt;var ot=rt[it];return new RegExp(ot).test(nt)},this.isPositionEditable=function(nt){var it=et.maskOptions,rt=it.mask,ot=it.permanents;return nt=0;ot--)if(rt(it[ot],ot))return ot;return-1}(nt.split(""),function(it,rt){return et.isPositionEditable(rt)&&et.isCharacterFillingPosition(it,rt)})+1},this.getStringFillingLengthAtPosition=function(nt,it){return nt.split("").reduce(function(rt,ot){return et.insertCharacterAtPosition(rt,ot,rt.length)},function(rt,ot){ot===void 0&&(ot=1);for(var at="",st=0;st=0;it--)if(et.isPositionEditable(it))return it;return null},this.getRightEditablePosition=function(nt){for(var it=et.maskOptions.mask,rt=nt;rt=ot&&!dt?"":ht=ot?ut:dt?st?st[ht]:"":lt[ht]}).join("");return et.formatValue(ct)},this.insertCharacterAtPosition=function(nt,it,rt){var ot=et.maskOptions,at=ot.mask,st=ot.maskPlaceholder;if(rt>=at.length)return nt;var lt=et.isCharacterAllowedAtPosition(it,rt),ct=et.isPositionEditable(rt),ut=et.getRightEditablePosition(rt),ht=st&&ut?it===st[ut]:null,dt=nt.slice(0,rt);return!lt&&ct||(nt=dt+(lt?it:at[rt])),lt||ct||ht||(nt=et.insertCharacterAtPosition(nt,it,rt+1)),nt},this.insertStringAtPosition=function(nt,it,rt){var ot=et.maskOptions,at=ot.mask,st=ot.maskPlaceholder;if(!it||rt>=at.length)return nt;var lt=it.split(""),ct=et.isValueFilled(nt)||!!st,ut=nt.slice(rt);return nt=lt.reduce(function(ht,dt){return et.insertCharacterAtPosition(ht,dt,ht.length)},nt.slice(0,rt)),ct?nt+=ut.slice(nt.length-rt):et.isValueFilled(nt)?nt+=at.slice(nt.length).join(""):nt=ut.split("").filter(function(ht,dt){return et.isPositionEditable(rt+dt)}).reduce(function(ht,dt){var pt=et.getRightEditablePosition(ht.length);return pt===null?ht:(et.isPositionEditable(ht.length)||(ht+=at.slice(ht.length,pt).join("")),et.insertCharacterAtPosition(ht,dt,ht.length))},nt),nt},this.processChange=function(nt,it){var rt=et.maskOptions,ot=rt.mask,at=rt.prefix,st=rt.lastEditablePosition,lt=nt.value,ct=nt.selection,ut=it.value,ht=it.selection,dt=lt,pt="",mt=0,gt=0,bt=Math.min(ht.start,ct.start);return ct.end>ht.start?(pt=dt.slice(ht.start,ct.end),gt=(mt=et.getStringFillingLengthAtPosition(pt,bt))?ht.length:0):dt.length=ot.length?bt=ot.length:bt=at.length&&bt=0||(rt[nt]=tt[nt]);return rt}function u(tt){return requestAnimationFrame(tt)}function s$1(tt){cancelAnimationFrame(tt)}function c$2(tt){var et=tt.ownerDocument;return et.hasFocus()&&et.activeElement===tt}function f$1(tt){return tt==null?void 0:tt.ownerDocument}function h$1(tt){var et=function(nt){var it;return(it=f$1(nt))==null?void 0:it.defaultView}(tt);return!!et&&tt instanceof et.HTMLElement}function g$1(tt){return e$1.useCallback(function(){var et=tt.current,nt=typeof window<"u"&&h$1(et);if(!et||!nt)return null;if(et.nodeName!=="INPUT"&&(et=et.querySelector("input")),!et)throw new Error("react-input-mask: inputComponent doesn't contain input node");return et},[tt])}function v$1(tt,et){var nt,it,rt,ot,at=e$1.useRef({start:null,end:null}),st=g$1(tt),lt=e$1.useCallback(function(){return function(gt){var bt=gt.selectionStart,yt=gt.selectionEnd;return{start:bt,end:yt,length:yt-bt}}(st())},[st]),ct=e$1.useCallback(function(){return at.current},[]),ut=e$1.useCallback(function(gt){var bt=st();bt&&c$2(bt)&&(function(yt,wt,vt){vt===void 0&&(vt=wt),yt.setSelectionRange(wt,vt)}(bt,gt.start,gt.end),at.current=lt())},[st,lt]),ht=e$1.useCallback(function(){at.current=lt()},[lt]),dt=(nt=ht,it=e$1.useRef(null),rt=e$1.useCallback(function(){it.current===null&&function gt(){nt(),it.current=u(gt)}()},[nt]),ot=e$1.useCallback(function(){s$1(it.current),it.current=null},[]),e$1.useEffect(function(){it.current&&(ot(),rt())},[rt,ot]),e$1.useEffect(s$1,[]),[rt,ot]),pt=dt[0],mt=dt[1];return e$1.useLayoutEffect(function(){if(et){var gt=st();return gt.addEventListener("focus",pt),gt.addEventListener("blur",mt),c$2(gt)&&pt(),function(){gt.removeEventListener("focus",pt),gt.removeEventListener("blur",mt),mt()}}}),{getSelection:lt,getLastSelection:ct,setSelection:ut}}function d$1(tt,et){var nt=e$1.useRef(),it=v$1(nt,et),rt=it.getSelection,ot=it.getLastSelection,at=it.setSelection,st=function(ht,dt){var pt=g$1(ht),mt=e$1.useRef(dt);return{getValue:e$1.useCallback(function(){return pt().value},[pt]),getLastValue:e$1.useCallback(function(){return mt.current},[]),setValue:e$1.useCallback(function(gt){mt.current=gt;var bt=pt();bt&&(bt.value=gt)},[pt])}}(nt,tt),lt=st.getValue,ct=st.getLastValue,ut=st.setValue;return{inputRef:nt,getInputState:function(){return{value:lt(),selection:rt()}},getLastInputState:function(){return{value:ct(),selection:ot()}},setInputState:function(ht){var dt=ht.value,pt=ht.selection;ut(dt),at(pt)}}}var p$1=["disabled","onBlur","onChange","onFocus","onMouseDown","readOnly","value"],m$1={9:/[0-9]/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/},P$1=function(tt){var et=this;this.isCharacterAllowedAtPosition=function(nt,it){var rt=et.maskOptions.maskPlaceholder;return!!et.isCharacterFillingPosition(nt,it)||!!rt&&rt[it]===nt},this.isCharacterFillingPosition=function(nt,it){var rt=et.maskOptions.mask;if(!nt||it>=rt.length)return!1;if(!et.isPositionEditable(it))return rt[it]===nt;var ot=rt[it];return new RegExp(ot).test(nt)},this.isPositionEditable=function(nt){var it=et.maskOptions,rt=it.mask,ot=it.permanents;return nt=0;ot--)if(rt(it[ot],ot))return ot;return-1}(nt.split(""),function(it,rt){return et.isPositionEditable(rt)&&et.isCharacterFillingPosition(it,rt)})+1},this.getStringFillingLengthAtPosition=function(nt,it){return nt.split("").reduce(function(rt,ot){return et.insertCharacterAtPosition(rt,ot,rt.length)},function(rt,ot){ot===void 0&&(ot=1);for(var at="",st=0;st=0;it--)if(et.isPositionEditable(it))return it;return null},this.getRightEditablePosition=function(nt){for(var it=et.maskOptions.mask,rt=nt;rt=ot&&!dt?"":ht=ot?ut:dt?st?st[ht]:"":lt[ht]}).join("");return et.formatValue(ct)},this.insertCharacterAtPosition=function(nt,it,rt){var ot=et.maskOptions,at=ot.mask,st=ot.maskPlaceholder;if(rt>=at.length)return nt;var lt=et.isCharacterAllowedAtPosition(it,rt),ct=et.isPositionEditable(rt),ut=et.getRightEditablePosition(rt),ht=st&&ut?it===st[ut]:null,dt=nt.slice(0,rt);return!lt&&ct||(nt=dt+(lt?it:at[rt])),lt||ct||ht||(nt=et.insertCharacterAtPosition(nt,it,rt+1)),nt},this.insertStringAtPosition=function(nt,it,rt){var ot=et.maskOptions,at=ot.mask,st=ot.maskPlaceholder;if(!it||rt>=at.length)return nt;var lt=it.split(""),ct=et.isValueFilled(nt)||!!st,ut=nt.slice(rt);return nt=lt.reduce(function(ht,dt){return et.insertCharacterAtPosition(ht,dt,ht.length)},nt.slice(0,rt)),ct?nt+=ut.slice(nt.length-rt):et.isValueFilled(nt)?nt+=at.slice(nt.length).join(""):nt=ut.split("").filter(function(ht,dt){return et.isPositionEditable(rt+dt)}).reduce(function(ht,dt){var pt=et.getRightEditablePosition(ht.length);return pt===null?ht:(et.isPositionEditable(ht.length)||(ht+=at.slice(ht.length,pt).join("")),et.insertCharacterAtPosition(ht,dt,ht.length))},nt),nt},this.processChange=function(nt,it){var rt=et.maskOptions,ot=rt.mask,at=rt.prefix,st=rt.lastEditablePosition,lt=nt.value,ct=nt.selection,ut=it.value,ht=it.selection,dt=lt,pt="",mt=0,gt=0,bt=Math.min(ht.start,ct.start);return ct.end>ht.start?(pt=dt.slice(ht.start,ct.end),gt=(mt=et.getStringFillingLengthAtPosition(pt,bt))?ht.length:0):dt.length=ot.length?bt=ot.length:bt=at.length&&bt_extends$u({},pt,at,it),[pt,at,it]),gt=reactExports.useMemo(()=>{if(!ct)return ot||null;const wt=new ct({locale:dt,formats:ut,instance:ht});if(!wt.isMUIAdapter)throw new Error(["MUI: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` +`,_excluded$j=["localeText"],MuiPickersAdapterContext=reactExports.createContext(null),LocalizationProvider=function tt(et){var nt;const{localeText:it}=et,rt=_objectWithoutPropertiesLoose$m(et,_excluded$j),{utils:ot,localeText:at}=(nt=reactExports.useContext(MuiPickersAdapterContext))!=null?nt:{utils:void 0,localeText:void 0},st=useThemeProps({props:rt,name:"MuiLocalizationProvider"}),{children:lt,dateAdapter:ct,dateFormats:ut,dateLibInstance:ht,adapterLocale:dt,localeText:pt}=st,mt=reactExports.useMemo(()=>_extends$t({},pt,at,it),[pt,at,it]),gt=reactExports.useMemo(()=>{if(!ct)return ot||null;const wt=new ct({locale:dt,formats:ut,instance:ht});if(!wt.isMUIAdapter)throw new Error(["MUI: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` `));return wt},[ct,dt,ut,ht,ot]),bt=reactExports.useMemo(()=>gt?{minDate:gt.date("1900-01-01T00:00:00.000"),maxDate:gt.date("2099-12-31T00:00:00.000")}:null,[gt]),yt=reactExports.useMemo(()=>({utils:gt,defaultDates:bt,localeText:mt}),[bt,gt,mt]);return jsxRuntimeExports.jsx(MuiPickersAdapterContext.Provider,{value:yt,children:lt})},formatTokenMap={Y:"year",YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"digit",maxLength:1},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},d:{sectionType:"weekDay",contentType:"digit",maxLength:1},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},defaultFormats={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",weekday:"dddd",weekdayShort:"ddd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",fullDateWithWeekday:"dddd, LL",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",monthAndYear:"MMMM YYYY",monthAndDate:"MMMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",fullDateTime:"lll",fullDateTime12h:"ll hh:mm A",fullDateTime24h:"ll HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},MISSING_TIMEZONE_PLUGIN=["Missing timezone plugin","To be able to use timezones, you have to pass the default export from `moment-timezone` to the `dateLibInstance` prop of `LocalizationProvider`","Find more information on https://mui.com/x/react-date-pickers/timezone/#moment-and-timezone"].join(` -`);class AdapterMoment{constructor({locale:et,formats:nt,instance:it}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="moment",this.moment=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=formatTokenMap,this.setLocaleToValue=rt=>{const ot=this.getCurrentLocaleCode();return ot===rt.locale()?rt:rt.locale(ot)},this.syncMomentLocale=rt=>{var ot;const at=hooks.locale(),st=(ot=this.locale)!=null?ot:"en-us";if(at!==st){hooks.locale(st);const lt=rt();return hooks.locale(at),lt}return rt()},this.hasTimezonePlugin=()=>typeof this.moment.tz<"u",this.createSystemDate=rt=>{const ot=this.moment(rt).local();return this.locale===void 0?ot:ot.locale(this.locale)},this.createUTCDate=rt=>{const ot=this.moment.utc(rt);return this.locale===void 0?ot:ot.locale(this.locale)},this.createTZDate=(rt,ot)=>{if(!this.hasTimezonePlugin())throw new Error(MISSING_TIMEZONE_PLUGIN);const at=ot==="default"?this.moment(rt):this.moment.tz(rt,ot);return this.locale===void 0?at:at.locale(this.locale)},this.date=rt=>{if(rt===null)return null;const ot=this.moment(rt);return ot.locale(this.getCurrentLocaleCode()),ot},this.dateWithTimezone=(rt,ot)=>rt===null?null:ot==="UTC"?this.createUTCDate(rt):ot==="system"||ot==="default"&&!this.hasTimezonePlugin()?this.createSystemDate(rt):this.createTZDate(rt,ot),this.getTimezone=rt=>{var ot,at,st;const lt=(ot=rt._z)==null?void 0:ot.name,ct=rt.isUTC()?"UTC":"system";return(at=lt??((st=this.moment.defaultZone)==null?void 0:st.name))!=null?at:ct},this.setTimezone=(rt,ot)=>{var at,st;if(this.getTimezone(rt)===ot)return rt;if(ot==="UTC")return rt.clone().utc();if(ot==="system")return rt.clone().local();if(!this.hasTimezonePlugin()){if(ot!=="default")throw new Error(MISSING_TIMEZONE_PLUGIN);return rt}const lt=ot==="default"?(at=(st=this.moment.defaultZone)==null?void 0:st.name)!=null?at:"system":ot;if(lt==="system")return rt.clone().local();const ct=rt.clone();return ct.tz(lt),ct},this.toJsDate=rt=>rt.toDate(),this.parseISO=rt=>this.moment(rt,!0),this.toISO=rt=>rt.toISOString(),this.parse=(rt,ot)=>rt===""?null:this.locale?this.moment(rt,ot,this.locale,!0):this.moment(rt,ot,!0),this.getCurrentLocaleCode=()=>this.locale||hooks.locale(),this.is12HourCycleInCurrentLocale=()=>/A|a/.test(hooks.localeData(this.getCurrentLocaleCode()).longDateFormat("LT")),this.expandFormat=rt=>{const ot=/(\[[^[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})|./g;return rt.match(ot).map(at=>{const st=at[0];return st==="L"||st===";"?hooks.localeData(this.getCurrentLocaleCode()).longDateFormat(at):at}).join("")},this.getFormatHelperText=rt=>this.expandFormat(rt).replace(/a/gi,"(a|p)m").toLocaleLowerCase(),this.isNull=rt=>rt===null,this.isValid=rt=>this.moment(rt).isValid(),this.format=(rt,ot)=>this.formatByString(rt,this.formats[ot]),this.formatByString=(rt,ot)=>{const at=rt.clone();return at.locale(this.getCurrentLocaleCode()),at.format(ot)},this.formatNumber=rt=>rt,this.getDiff=(rt,ot,at)=>rt.diff(ot,at),this.isEqual=(rt,ot)=>rt===null&&ot===null?!0:this.moment(rt).isSame(ot),this.isSameYear=(rt,ot)=>rt.isSame(ot,"year"),this.isSameMonth=(rt,ot)=>rt.isSame(ot,"month"),this.isSameDay=(rt,ot)=>rt.isSame(ot,"day"),this.isSameHour=(rt,ot)=>rt.isSame(ot,"hour"),this.isAfter=(rt,ot)=>rt.isAfter(ot),this.isAfterYear=(rt,ot)=>rt.isAfter(ot,"year"),this.isAfterDay=(rt,ot)=>rt.isAfter(ot,"day"),this.isBefore=(rt,ot)=>rt.isBefore(ot),this.isBeforeYear=(rt,ot)=>rt.isBefore(ot,"year"),this.isBeforeDay=(rt,ot)=>rt.isBefore(ot,"day"),this.isWithinRange=(rt,[ot,at])=>rt.isBetween(ot,at,null,"[]"),this.startOfYear=rt=>rt.clone().startOf("year"),this.startOfMonth=rt=>rt.clone().startOf("month"),this.startOfWeek=rt=>rt.clone().startOf("week"),this.startOfDay=rt=>rt.clone().startOf("day"),this.endOfYear=rt=>rt.clone().endOf("year"),this.endOfMonth=rt=>rt.clone().endOf("month"),this.endOfWeek=rt=>rt.clone().endOf("week"),this.endOfDay=rt=>rt.clone().endOf("day"),this.addYears=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"years"):rt.clone().add(ot,"years"),this.addMonths=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"months"):rt.clone().add(ot,"months"),this.addWeeks=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"weeks"):rt.clone().add(ot,"weeks"),this.addDays=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"days"):rt.clone().add(ot,"days"),this.addHours=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"hours"):rt.clone().add(ot,"hours"),this.addMinutes=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"minutes"):rt.clone().add(ot,"minutes"),this.addSeconds=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"seconds"):rt.clone().add(ot,"seconds"),this.getYear=rt=>rt.get("year"),this.getMonth=rt=>rt.get("month"),this.getDate=rt=>rt.get("date"),this.getHours=rt=>rt.get("hours"),this.getMinutes=rt=>rt.get("minutes"),this.getSeconds=rt=>rt.get("seconds"),this.getMilliseconds=rt=>rt.get("milliseconds"),this.setYear=(rt,ot)=>rt.clone().year(ot),this.setMonth=(rt,ot)=>rt.clone().month(ot),this.setDate=(rt,ot)=>rt.clone().date(ot),this.setHours=(rt,ot)=>rt.clone().hours(ot),this.setMinutes=(rt,ot)=>rt.clone().minutes(ot),this.setSeconds=(rt,ot)=>rt.clone().seconds(ot),this.setMilliseconds=(rt,ot)=>rt.clone().milliseconds(ot),this.getDaysInMonth=rt=>rt.daysInMonth(),this.getNextMonth=rt=>rt.clone().add(1,"month"),this.getPreviousMonth=rt=>rt.clone().subtract(1,"month"),this.getMonthArray=rt=>{const at=[this.startOfYear(rt)];for(;at.length<12;){const st=at[at.length-1];at.push(this.getNextMonth(st))}return at},this.mergeDateAndTime=(rt,ot)=>rt.clone().hour(ot.hour()).minute(ot.minute()).second(ot.second()),this.getWeekdays=()=>this.syncMomentLocale(()=>hooks.weekdaysShort(!0)),this.getWeekArray=rt=>{const ot=this.setLocaleToValue(rt),at=ot.clone().startOf("month").startOf("week"),st=ot.clone().endOf("month").endOf("week");let lt=0,ct=at;const ut=[];for(;ct.isBefore(st);){const ht=Math.floor(lt/7);ut[ht]=ut[ht]||[],ut[ht].push(ct),ct=ct.clone().add(1,"day"),lt+=1}return ut},this.getWeekNumber=rt=>rt.week(),this.getYearRange=(rt,ot)=>{const at=this.moment(rt).startOf("year"),st=this.moment(ot).endOf("year"),lt=[];let ct=at;for(;ct.isBefore(st);)lt.push(ct),ct=ct.clone().add(1,"year");return lt},this.getMeridiemText=rt=>this.is12HourCycleInCurrentLocale()?hooks.localeData(this.getCurrentLocaleCode()).meridiem(rt==="am"?0:13,0,!1):rt==="am"?"AM":"PM",this.moment=it||hooks,this.locale=et,this.formats=_extends$u({},defaultFormats,nt)}}const MuiButton={defaultProps:{disableElevation:!0,disableRipple:!0},styleOverrides:{root:{display:"inline-flex",padding:"12px 20px",justifyContent:"center",alignItems:"center",gap:"10px",borderRadius:"200px",background:colors.BUTTON1,color:"var(--Primary-Text, #fff)",fontFamily:"Barlow",fontSize:"12px",fontStyle:"normal",fontWeight:"400",lineHeight:"8px",cursor:"pointer",columnGap:"6px","&:hover":{background:colors.BUTTON1_HOVER,color:colors.GRAY3,outline:"none",boxShadow:"none"},"&:focus":{outline:"none",boxShadow:"none",background:colors.BUTTON1_PRESS,color:colors.GRAY6},"&:active":{outline:"none",boxShadow:"none",background:colors.BUTTON1_PRESS,color:colors.GRAY6},"&.MuiButton-sizeSmall":{fontSize:"11px",lineHeight:"14px",fontWeight:500,height:"28px"},"&.MuiButton-sizeMedium":{height:"32px",fontSize:"13px",lineHeight:"14px",fontWeight:500},"&.MuiButton-sizeLarge":{fontSize:"1.2rem",height:"40px"},"&.MuiButton-outlined":{}},textPrimary:{"& .MuiButton-endIcon":{color:colors.GRAY6},"& .MuiButton-startIcon":{color:colors.GRAY6}},outlined:{borderColor:colors.BUTTON1,borderWidth:"1px",backgroundColor:"transparent","&:hover":{borderColor:colors.BUTTON1_HOVER,backgroundColor:"transparent",color:colors.GRAY3},"&:active":{backgroundColor:colors.BUTTON1_PRESS,color:colors.GRAY6}},containedSecondary:{backgroundColor:colors.PRIMARY_BLUE,borderRadius:"6px",color:"white","&:hover":{backgroundColor:colors.PRIMARY_BLUE_BORDER,color:colors.white},"&:active":{backgroundColor:colors.BLUE_PRESS_STATE,color:colors.white},"&:focus":{backgroundColor:colors.BLUE_PRESS_STATE,color:colors.white},"&.MuiButton-sizeSmall":{fontSize:"11px",lineHeight:"14px",fontWeight:500},"&.MuiButton-sizeLarge":{fontSize:"14px",maxHeight:"40px",fontWeight:600,lineHeight:"16px"},"&.Mui-disabled":{background:"rgba(48, 51, 66, 0.50)",color:"rgba(82, 86, 110, 1)"}},textSecondary:{color:"purple","&:hover":{color:"darkpurple"}},startIcon:{fontSize:"20px",marginRight:0,"& > *:nth-of-type(1)":{fontSize:"20px"}},endIcon:{fontSize:"20px","& > *:nth-of-type(1)":{fontSize:"20px"}}}},palette=createPalette({mode:"dark",primary:{main:colors.primaryButton}}),appTheme=createTheme({palette,components:{MuiButton,MuiPopover:{styleOverrides:{root:{zIndex:99999}}}},typography:{button:{textTransform:"none",whiteSpace:"nowrap"}},breakpoints:{values:{xs:breakpoints.small,sm:breakpoints.medium,md:breakpoints.large,lg:1200,xl:1500}}}),AppProviders=({children:tt})=>jsxRuntimeExports.jsxs(ThemeProvider,{theme:appTheme,children:[jsxRuntimeExports.jsx(StyledEngineProvider,{injectFirst:!0}),jsxRuntimeExports.jsx(Le,{theme:appTheme,children:jsxRuntimeExports.jsx(LocalizationProvider,{dateAdapter:AdapterMoment,children:tt})})]}),requiredRule={required:{message:"The field is required",value:!0}},AboutAdminView=({initialValues:tt})=>{const et=useForm({defaultValues:tt,mode:"onSubmit"}),{isSubmitting:nt}=et.formState,it=et.handleSubmit(async rt=>{try{await postAboutData(rt)}catch(ot){console.warn(ot)}});return jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsx("form",{id:"add-node-form",onSubmit:it,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-about-title-id",label:"Graph Title",maxLength:50,name:"title",placeholder:"Type graph title here...",rules:{...requiredRule}})}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-about-id",label:"Graph Description",maxLength:50,name:"description",placeholder:"Type graph description here...",rules:{...requiredRule}})}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-about-mission_statement-id",label:"Mission Statement",maxLength:50,name:"mission_statement",placeholder:"Type mission statement here...",rules:{...requiredRule}})}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-about-search_term-id",label:"Search Term",maxLength:50,name:"search_term",placeholder:"Type search term here...",rules:{...requiredRule}})})]}),jsxRuntimeExports.jsx(Flex,{pt:8,children:nt?jsxRuntimeExports.jsx(SubmitLoader,{children:jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.white,size:20})}):jsxRuntimeExports.jsx(Button,{disabled:nt,id:"add-node-submit-cta",kind:"big",type:"submit",children:"Save changes"})})]})})})},SubmitLoader=styled$4(Flex).attrs({align:"center",background:"primaryButton",borderRadius:8,justify:"center"})` +`);class AdapterMoment{constructor({locale:et,formats:nt,instance:it}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="moment",this.moment=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=formatTokenMap,this.setLocaleToValue=rt=>{const ot=this.getCurrentLocaleCode();return ot===rt.locale()?rt:rt.locale(ot)},this.syncMomentLocale=rt=>{var ot;const at=hooks.locale(),st=(ot=this.locale)!=null?ot:"en-us";if(at!==st){hooks.locale(st);const lt=rt();return hooks.locale(at),lt}return rt()},this.hasTimezonePlugin=()=>typeof this.moment.tz<"u",this.createSystemDate=rt=>{const ot=this.moment(rt).local();return this.locale===void 0?ot:ot.locale(this.locale)},this.createUTCDate=rt=>{const ot=this.moment.utc(rt);return this.locale===void 0?ot:ot.locale(this.locale)},this.createTZDate=(rt,ot)=>{if(!this.hasTimezonePlugin())throw new Error(MISSING_TIMEZONE_PLUGIN);const at=ot==="default"?this.moment(rt):this.moment.tz(rt,ot);return this.locale===void 0?at:at.locale(this.locale)},this.date=rt=>{if(rt===null)return null;const ot=this.moment(rt);return ot.locale(this.getCurrentLocaleCode()),ot},this.dateWithTimezone=(rt,ot)=>rt===null?null:ot==="UTC"?this.createUTCDate(rt):ot==="system"||ot==="default"&&!this.hasTimezonePlugin()?this.createSystemDate(rt):this.createTZDate(rt,ot),this.getTimezone=rt=>{var ot,at,st;const lt=(ot=rt._z)==null?void 0:ot.name,ct=rt.isUTC()?"UTC":"system";return(at=lt??((st=this.moment.defaultZone)==null?void 0:st.name))!=null?at:ct},this.setTimezone=(rt,ot)=>{var at,st;if(this.getTimezone(rt)===ot)return rt;if(ot==="UTC")return rt.clone().utc();if(ot==="system")return rt.clone().local();if(!this.hasTimezonePlugin()){if(ot!=="default")throw new Error(MISSING_TIMEZONE_PLUGIN);return rt}const lt=ot==="default"?(at=(st=this.moment.defaultZone)==null?void 0:st.name)!=null?at:"system":ot;if(lt==="system")return rt.clone().local();const ct=rt.clone();return ct.tz(lt),ct},this.toJsDate=rt=>rt.toDate(),this.parseISO=rt=>this.moment(rt,!0),this.toISO=rt=>rt.toISOString(),this.parse=(rt,ot)=>rt===""?null:this.locale?this.moment(rt,ot,this.locale,!0):this.moment(rt,ot,!0),this.getCurrentLocaleCode=()=>this.locale||hooks.locale(),this.is12HourCycleInCurrentLocale=()=>/A|a/.test(hooks.localeData(this.getCurrentLocaleCode()).longDateFormat("LT")),this.expandFormat=rt=>{const ot=/(\[[^[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})|./g;return rt.match(ot).map(at=>{const st=at[0];return st==="L"||st===";"?hooks.localeData(this.getCurrentLocaleCode()).longDateFormat(at):at}).join("")},this.getFormatHelperText=rt=>this.expandFormat(rt).replace(/a/gi,"(a|p)m").toLocaleLowerCase(),this.isNull=rt=>rt===null,this.isValid=rt=>this.moment(rt).isValid(),this.format=(rt,ot)=>this.formatByString(rt,this.formats[ot]),this.formatByString=(rt,ot)=>{const at=rt.clone();return at.locale(this.getCurrentLocaleCode()),at.format(ot)},this.formatNumber=rt=>rt,this.getDiff=(rt,ot,at)=>rt.diff(ot,at),this.isEqual=(rt,ot)=>rt===null&&ot===null?!0:this.moment(rt).isSame(ot),this.isSameYear=(rt,ot)=>rt.isSame(ot,"year"),this.isSameMonth=(rt,ot)=>rt.isSame(ot,"month"),this.isSameDay=(rt,ot)=>rt.isSame(ot,"day"),this.isSameHour=(rt,ot)=>rt.isSame(ot,"hour"),this.isAfter=(rt,ot)=>rt.isAfter(ot),this.isAfterYear=(rt,ot)=>rt.isAfter(ot,"year"),this.isAfterDay=(rt,ot)=>rt.isAfter(ot,"day"),this.isBefore=(rt,ot)=>rt.isBefore(ot),this.isBeforeYear=(rt,ot)=>rt.isBefore(ot,"year"),this.isBeforeDay=(rt,ot)=>rt.isBefore(ot,"day"),this.isWithinRange=(rt,[ot,at])=>rt.isBetween(ot,at,null,"[]"),this.startOfYear=rt=>rt.clone().startOf("year"),this.startOfMonth=rt=>rt.clone().startOf("month"),this.startOfWeek=rt=>rt.clone().startOf("week"),this.startOfDay=rt=>rt.clone().startOf("day"),this.endOfYear=rt=>rt.clone().endOf("year"),this.endOfMonth=rt=>rt.clone().endOf("month"),this.endOfWeek=rt=>rt.clone().endOf("week"),this.endOfDay=rt=>rt.clone().endOf("day"),this.addYears=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"years"):rt.clone().add(ot,"years"),this.addMonths=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"months"):rt.clone().add(ot,"months"),this.addWeeks=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"weeks"):rt.clone().add(ot,"weeks"),this.addDays=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"days"):rt.clone().add(ot,"days"),this.addHours=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"hours"):rt.clone().add(ot,"hours"),this.addMinutes=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"minutes"):rt.clone().add(ot,"minutes"),this.addSeconds=(rt,ot)=>ot<0?rt.clone().subtract(Math.abs(ot),"seconds"):rt.clone().add(ot,"seconds"),this.getYear=rt=>rt.get("year"),this.getMonth=rt=>rt.get("month"),this.getDate=rt=>rt.get("date"),this.getHours=rt=>rt.get("hours"),this.getMinutes=rt=>rt.get("minutes"),this.getSeconds=rt=>rt.get("seconds"),this.getMilliseconds=rt=>rt.get("milliseconds"),this.setYear=(rt,ot)=>rt.clone().year(ot),this.setMonth=(rt,ot)=>rt.clone().month(ot),this.setDate=(rt,ot)=>rt.clone().date(ot),this.setHours=(rt,ot)=>rt.clone().hours(ot),this.setMinutes=(rt,ot)=>rt.clone().minutes(ot),this.setSeconds=(rt,ot)=>rt.clone().seconds(ot),this.setMilliseconds=(rt,ot)=>rt.clone().milliseconds(ot),this.getDaysInMonth=rt=>rt.daysInMonth(),this.getNextMonth=rt=>rt.clone().add(1,"month"),this.getPreviousMonth=rt=>rt.clone().subtract(1,"month"),this.getMonthArray=rt=>{const at=[this.startOfYear(rt)];for(;at.length<12;){const st=at[at.length-1];at.push(this.getNextMonth(st))}return at},this.mergeDateAndTime=(rt,ot)=>rt.clone().hour(ot.hour()).minute(ot.minute()).second(ot.second()),this.getWeekdays=()=>this.syncMomentLocale(()=>hooks.weekdaysShort(!0)),this.getWeekArray=rt=>{const ot=this.setLocaleToValue(rt),at=ot.clone().startOf("month").startOf("week"),st=ot.clone().endOf("month").endOf("week");let lt=0,ct=at;const ut=[];for(;ct.isBefore(st);){const ht=Math.floor(lt/7);ut[ht]=ut[ht]||[],ut[ht].push(ct),ct=ct.clone().add(1,"day"),lt+=1}return ut},this.getWeekNumber=rt=>rt.week(),this.getYearRange=(rt,ot)=>{const at=this.moment(rt).startOf("year"),st=this.moment(ot).endOf("year"),lt=[];let ct=at;for(;ct.isBefore(st);)lt.push(ct),ct=ct.clone().add(1,"year");return lt},this.getMeridiemText=rt=>this.is12HourCycleInCurrentLocale()?hooks.localeData(this.getCurrentLocaleCode()).meridiem(rt==="am"?0:13,0,!1):rt==="am"?"AM":"PM",this.moment=it||hooks,this.locale=et,this.formats=_extends$t({},defaultFormats,nt)}}const MuiButton={defaultProps:{disableElevation:!0,disableRipple:!0},styleOverrides:{root:{display:"inline-flex",padding:"12px 20px",justifyContent:"center",alignItems:"center",gap:"10px",borderRadius:"200px",background:colors.BUTTON1,color:"var(--Primary-Text, #fff)",fontFamily:"Barlow",fontSize:"12px",fontStyle:"normal",fontWeight:"400",lineHeight:"8px",cursor:"pointer",columnGap:"6px","&:hover":{background:colors.BUTTON1_HOVER,color:colors.GRAY3,outline:"none",boxShadow:"none"},"&:focus":{outline:"none",boxShadow:"none",background:colors.BUTTON1_PRESS,color:colors.GRAY6},"&:active":{outline:"none",boxShadow:"none",background:colors.BUTTON1_PRESS,color:colors.GRAY6},"&.MuiButton-sizeSmall":{fontSize:"11px",lineHeight:"14px",fontWeight:500,height:"28px"},"&.MuiButton-sizeMedium":{height:"32px",fontSize:"13px",lineHeight:"14px",fontWeight:500},"&.MuiButton-sizeLarge":{fontSize:"1.2rem",height:"40px"},"&.MuiButton-outlined":{}},textPrimary:{"& .MuiButton-endIcon":{color:colors.GRAY6},"& .MuiButton-startIcon":{color:colors.GRAY6}},outlined:{borderColor:colors.BUTTON1,borderWidth:"1px",backgroundColor:"transparent","&:hover":{borderColor:colors.BUTTON1_HOVER,backgroundColor:"transparent",color:colors.GRAY3},"&:active":{backgroundColor:colors.BUTTON1_PRESS,color:colors.GRAY6}},containedSecondary:{backgroundColor:colors.PRIMARY_BLUE,borderRadius:"6px",color:"white","&:hover":{backgroundColor:colors.PRIMARY_BLUE_BORDER,color:colors.white},"&:active":{backgroundColor:colors.BLUE_PRESS_STATE,color:colors.white},"&:focus":{backgroundColor:colors.BLUE_PRESS_STATE,color:colors.white},"&.MuiButton-sizeSmall":{fontSize:"11px",lineHeight:"14px",fontWeight:500},"&.MuiButton-sizeLarge":{fontSize:"14px",maxHeight:"40px",fontWeight:600,lineHeight:"16px"},"&.Mui-disabled":{background:"rgba(48, 51, 66, 0.50)",color:"rgba(82, 86, 110, 1)"}},textSecondary:{color:"purple","&:hover":{color:"darkpurple"}},startIcon:{fontSize:"20px",marginRight:0,"& > *:nth-of-type(1)":{fontSize:"20px"}},endIcon:{fontSize:"20px","& > *:nth-of-type(1)":{fontSize:"20px"}}}},palette=createPalette({mode:"dark",primary:{main:colors.primaryButton}}),appTheme=createTheme({palette,components:{MuiButton,MuiPopover:{styleOverrides:{root:{zIndex:99999}}}},typography:{button:{textTransform:"none",whiteSpace:"nowrap"}},breakpoints:{values:{xs:breakpoints.small,sm:breakpoints.medium,md:breakpoints.large,lg:1200,xl:1500}}}),AppProviders=({children:tt})=>jsxRuntimeExports.jsxs(ThemeProvider,{theme:appTheme,children:[jsxRuntimeExports.jsx(StyledEngineProvider,{injectFirst:!0}),jsxRuntimeExports.jsx(Le,{theme:appTheme,children:jsxRuntimeExports.jsx(LocalizationProvider,{dateAdapter:AdapterMoment,children:tt})})]}),requiredRule={required:{message:"The field is required",value:!0}},AboutAdminView=({initialValues:tt})=>{const et=useForm({defaultValues:tt,mode:"onSubmit"}),{isSubmitting:nt}=et.formState,it=et.handleSubmit(async rt=>{try{await postAboutData(rt)}catch(ot){console.warn(ot)}});return jsxRuntimeExports.jsx(FormProvider,{...et,children:jsxRuntimeExports.jsx("form",{id:"add-node-form",onSubmit:it,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-about-title-id",label:"Graph Title",maxLength:50,name:"title",placeholder:"Type graph title here...",rules:{...requiredRule}})}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-about-id",label:"Graph Description",maxLength:50,name:"description",placeholder:"Type graph description here...",rules:{...requiredRule}})}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-about-mission_statement-id",label:"Mission Statement",maxLength:50,name:"mission_statement",placeholder:"Type mission statement here...",rules:{...requiredRule}})}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(TextInput,{id:"cy-about-search_term-id",label:"Search Term",maxLength:50,name:"search_term",placeholder:"Type search term here...",rules:{...requiredRule}})})]}),jsxRuntimeExports.jsx(Flex,{pt:8,children:nt?jsxRuntimeExports.jsx(SubmitLoader,{children:jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.white,size:20})}):jsxRuntimeExports.jsx(Button,{disabled:nt,id:"add-node-submit-cta",kind:"big",type:"submit",children:"Save changes"})})]})})})},SubmitLoader=styled$4(Flex).attrs({align:"center",background:"primaryButton",borderRadius:8,justify:"center"})` padding: 16px 24px; opacity: 0.5; `,CommonView=({initialValues:tt})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[tt.title&&jsxRuntimeExports.jsxs(Flex,{pt:12,children:[jsxRuntimeExports.jsx(Text$4,{kind:"regular",children:"Graph Title"}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(Text$4,{className:"value",kind:"medium",children:tt.title})})]}),tt.description&&jsxRuntimeExports.jsxs(Flex,{pt:12,children:[jsxRuntimeExports.jsx(Text$4,{kind:"regular",children:"Graph Description"}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(Text$4,{className:"value",kind:"medium",children:tt.description})})]}),tt.mission_statement&&jsxRuntimeExports.jsxs(Flex,{pt:12,children:[jsxRuntimeExports.jsx(Text$4,{kind:"regular",children:"Mission Statement"}),jsxRuntimeExports.jsx(Flex,{pt:12,children:jsxRuntimeExports.jsx(Text$4,{className:"value",kind:"medium",children:tt.mission_statement})})]})]}),About=()=>{const[tt]=useUserStore(nt=>[nt.isAdmin]),et=useAppStore(nt=>nt.appMetaData);return jsxRuntimeExports.jsxs(Wrapper$e,{align:"stretch",direction:"column",justify:"flex-end",children:[jsxRuntimeExports.jsx(Heading$2,{align:"center",direction:"row",justify:"space-between",children:jsxRuntimeExports.jsx(Text$4,{className:"title",children:"About"})}),jsxRuntimeExports.jsx(ContentWrapper,{align:"stretch",justify:"flex-start",children:tt?jsxRuntimeExports.jsx(AboutAdminView,{initialValues:et}):jsxRuntimeExports.jsx(CommonView,{initialValues:et})})]})},Wrapper$e=styled$4(Flex)` @@ -6424,33 +6424,33 @@ outputColor=vec4(color,inputColor.a);}`,VignetteEffect=class extends Effect$1{co * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var b=typeof Symbol=="function"&&Symbol.for,c$1=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k$1=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x$1=b?Symbol.for("react.responder"):60118,y$1=b?Symbol.for("react.scope"):60119;function z(tt){if(typeof tt=="object"&&tt!==null){var et=tt.$$typeof;switch(et){case c$1:switch(tt=tt.type,tt){case l:case m:case e:case g:case f:case p:return tt;default:switch(tt=tt&&tt.$$typeof,tt){case k$1:case n:case t:case r:case h:return tt;default:return et}}case d:return et}}}function A(tt){return z(tt)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k$1;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c$1;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(tt){return A(tt)||z(tt)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(tt){return z(tt)===k$1};reactIs_production_min.isContextProvider=function(tt){return z(tt)===h};reactIs_production_min.isElement=function(tt){return typeof tt=="object"&&tt!==null&&tt.$$typeof===c$1};reactIs_production_min.isForwardRef=function(tt){return z(tt)===n};reactIs_production_min.isFragment=function(tt){return z(tt)===e};reactIs_production_min.isLazy=function(tt){return z(tt)===t};reactIs_production_min.isMemo=function(tt){return z(tt)===r};reactIs_production_min.isPortal=function(tt){return z(tt)===d};reactIs_production_min.isProfiler=function(tt){return z(tt)===g};reactIs_production_min.isStrictMode=function(tt){return z(tt)===f};reactIs_production_min.isSuspense=function(tt){return z(tt)===p};reactIs_production_min.isValidElementType=function(tt){return typeof tt=="string"||typeof tt=="function"||tt===e||tt===m||tt===g||tt===f||tt===p||tt===q||typeof tt=="object"&&tt!==null&&(tt.$$typeof===t||tt.$$typeof===r||tt.$$typeof===h||tt.$$typeof===k$1||tt.$$typeof===n||tt.$$typeof===w||tt.$$typeof===x$1||tt.$$typeof===y$1||tt.$$typeof===v)};reactIs_production_min.typeOf=z;reactIs.exports=reactIs_production_min;var reactIsExports=reactIs.exports,baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1,numberTag$1="[object Number]";function isNumber$2(tt){return typeof tt=="number"||isObjectLike$3(tt)&&baseGetTag$2(tt)==numberTag$1}var isNumber_1=isNumber$2;const isNumber$3=getDefaultExportFromCjs(isNumber_1);var isNumber$1=isNumber_1;function isNaN$1(tt){return isNumber$1(tt)&&tt!=+tt}var _isNaN=isNaN$1;const isNan=getDefaultExportFromCjs(_isNaN);var mathSign=function tt(et){return et===0?0:et>0?1:-1},isPercent=function tt(et){return isString$1(et)&&et.indexOf("%")===et.length-1},isNumber=function tt(et){return isNumber$3(et)&&!isNan(et)},isNumOrStr=function tt(et){return isNumber(et)||isString$1(et)},idCounter=0,uniqueId=function tt(et){var nt=++idCounter;return"".concat(et||"").concat(nt)},getPercentValue=function tt(et,nt){var it=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,rt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!isNumber(et)&&!isString$1(et))return it;var ot;if(isPercent(et)){var at=et.indexOf("%");ot=nt*parseFloat(et.slice(0,at))/100}else ot=+et;return isNan(ot)&&(ot=it),rt&&ot>nt&&(ot=nt),ot},getAnyElementOfObject=function tt(et){if(!et)return null;var nt=Object.keys(et);return nt&&nt.length?et[nt[0]]:null},hasDuplicate=function tt(et){if(!Array.isArray(et))return!1;for(var nt=et.length,it={},rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$i(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _typeof$F(tt){"@babel/helpers - typeof";return _typeof$F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$F(tt)}var REACT_BROWSER_EVENT_MAP={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},getDisplayName=function tt(et){return typeof et=="string"?et:et?et.displayName||et.name||"Component":""},lastChildren=null,lastResult=null,toArray=function tt(et){if(et===lastChildren&&Array.isArray(lastResult))return lastResult;var nt=[];return reactExports.Children.forEach(et,function(it){isNil$1(it)||(reactIsExports.isFragment(it)?nt=nt.concat(tt(it.props.children)):nt.push(it))}),lastResult=nt,lastChildren=et,nt};function findAllByType(tt,et){var nt=[],it=[];return Array.isArray(et)?it=et.map(function(rt){return getDisplayName(rt)}):it=[getDisplayName(et)],toArray(tt).forEach(function(rt){var ot=get$3(rt,"type.displayName")||get$3(rt,"type.name");it.indexOf(ot)!==-1&&nt.push(rt)}),nt}function findChildByType(tt,et){var nt=findAllByType(tt,et);return nt&&nt[0]}var validateWidthHeight=function tt(et){if(!et||!et.props)return!1;var nt=et.props,it=nt.width,rt=nt.height;return!(!isNumber(it)||it<=0||!isNumber(rt)||rt<=0)},SVG_TAGS=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],isSvgElement=function tt(et){return et&&et.type&&isString$1(et.type)&&SVG_TAGS.indexOf(et.type)>=0},isDotProps=function tt(et){return et&&_typeof$F(et)==="object"&&"cx"in et&&"cy"in et&&"r"in et},isValidSpreadableProp=function tt(et,nt,it,rt){var ot,at=(ot=FilteredElementKeyMap==null?void 0:FilteredElementKeyMap[rt])!==null&&ot!==void 0?ot:[];return!isFunction$4(et)&&(rt&&at.includes(nt)||SVGElementPropKeys.includes(nt))||it&&EventKeys.includes(nt)},filterProps=function tt(et,nt,it){if(!et||typeof et=="function"||typeof et=="boolean")return null;var rt=et;if(reactExports.isValidElement(et)&&(rt=et.props),!isObject$h(rt))return null;var ot={};return Object.keys(rt).forEach(function(at){var st;isValidSpreadableProp((st=rt)===null||st===void 0?void 0:st[at],at,nt,it)&&(ot[at]=rt[at])}),ot},isChildrenEqual=function tt(et,nt){if(et===nt)return!0;var it=reactExports.Children.count(et);if(it!==reactExports.Children.count(nt))return!1;if(it===0)return!0;if(it===1)return isSingleChildEqual(Array.isArray(et)?et[0]:et,Array.isArray(nt)?nt[0]:nt);for(var rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$h(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function Surface(tt){var et=tt.children,nt=tt.width,it=tt.height,rt=tt.viewBox,ot=tt.className,at=tt.style,st=tt.title,lt=tt.desc,ct=_objectWithoutProperties$h(tt,_excluded$h),ut=rt||{width:nt,height:it,x:0,y:0},ht=clsx("recharts-surface",ot);return React$1.createElement("svg",_extends$q({},filterProps(ct,!0,"svg"),{className:ht,width:nt,height:it,style:at,viewBox:"".concat(ut.x," ").concat(ut.y," ").concat(ut.width," ").concat(ut.height)}),React$1.createElement("title",null,st),React$1.createElement("desc",null,lt),et)}var _excluded$g=["children","className"];function _extends$p(){return _extends$p=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$g(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var Layer=React$1.forwardRef(function(tt,et){var nt=tt.children,it=tt.className,rt=_objectWithoutProperties$g(tt,_excluded$g),ot=clsx("recharts-layer",it);return React$1.createElement("g",_extends$p({className:ot},filterProps(rt,!0),{ref:et}),nt)}),warn=function tt(et,nt){for(var it=arguments.length,rt=new Array(it>2?it-2:0),ot=2;otrt?0:rt+et),nt=nt>rt?rt:nt,nt<0&&(nt+=rt),rt=et>nt?0:nt-et>>>0,et>>>=0;for(var ot=Array(rt);++it=it?tt:baseSlice(tt,et,nt)}var _castSlice=castSlice$1,rsAstralRange$1="\\ud800-\\udfff",rsComboMarksRange$1="\\u0300-\\u036f",reComboHalfMarksRange$1="\\ufe20-\\ufe2f",rsComboSymbolsRange$1="\\u20d0-\\u20ff",rsComboRange$1=rsComboMarksRange$1+reComboHalfMarksRange$1+rsComboSymbolsRange$1,rsVarRange$1="\\ufe0e\\ufe0f",rsZWJ$1="\\u200d",reHasUnicode=RegExp("["+rsZWJ$1+rsAstralRange$1+rsComboRange$1+rsVarRange$1+"]");function hasUnicode$2(tt){return reHasUnicode.test(tt)}var _hasUnicode=hasUnicode$2;function asciiToArray$1(tt){return tt.split("")}var _asciiToArray=asciiToArray$1,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g");function unicodeToArray$1(tt){return tt.match(reUnicode)||[]}var _unicodeToArray=unicodeToArray$1,asciiToArray=_asciiToArray,hasUnicode$1=_hasUnicode,unicodeToArray=_unicodeToArray;function stringToArray$1(tt){return hasUnicode$1(tt)?unicodeToArray(tt):asciiToArray(tt)}var _stringToArray=stringToArray$1,castSlice=_castSlice,hasUnicode=_hasUnicode,stringToArray=_stringToArray,toString$3=toString_1;function createCaseFirst$1(tt){return function(et){et=toString$3(et);var nt=hasUnicode(et)?stringToArray(et):void 0,it=nt?nt[0]:et.charAt(0),rt=nt?castSlice(nt,1).join(""):et.slice(1);return it[tt]()+rt}}var _createCaseFirst=createCaseFirst$1,createCaseFirst=_createCaseFirst,upperFirst=createCaseFirst("toUpperCase"),upperFirst_1=upperFirst;const upperFirst$1=getDefaultExportFromCjs(upperFirst_1);function constant$6(tt){return function(){return tt}}const cos=Math.cos,sin=Math.sin,sqrt$1=Math.sqrt,pi$1=Math.PI,tau$1=2*pi$1,pi=Math.PI,tau=2*pi,epsilon=1e-6,tauEpsilon=tau-epsilon;function append(tt){this._+=tt[0];for(let et=1,nt=tt.length;et=0))throw new Error(`invalid digits: ${tt}`);if(et>15)return append;const nt=10**et;return function(it){this._+=it[0];for(let rt=1,ot=it.length;rtepsilon)if(!(Math.abs(ht*lt-ct*ut)>epsilon)||!ot)this._append`L${this._x1=et},${this._y1=nt}`;else{let pt=it-at,mt=rt-st,gt=lt*lt+ct*ct,bt=pt*pt+mt*mt,yt=Math.sqrt(gt),wt=Math.sqrt(dt),vt=ot*Math.tan((pi-Math.acos((gt+dt-bt)/(2*yt*wt)))/2),xt=vt/wt,St=vt/yt;Math.abs(xt-1)>epsilon&&this._append`L${et+xt*ut},${nt+xt*ht}`,this._append`A${ot},${ot},0,0,${+(ht*pt>ut*mt)},${this._x1=et+St*lt},${this._y1=nt+St*ct}`}}arc(et,nt,it,rt,ot,at){if(et=+et,nt=+nt,it=+it,at=!!at,it<0)throw new Error(`negative radius: ${it}`);let st=it*Math.cos(rt),lt=it*Math.sin(rt),ct=et+st,ut=nt+lt,ht=1^at,dt=at?rt-ot:ot-rt;this._x1===null?this._append`M${ct},${ut}`:(Math.abs(this._x1-ct)>epsilon||Math.abs(this._y1-ut)>epsilon)&&this._append`L${ct},${ut}`,it&&(dt<0&&(dt=dt%tau+tau),dt>tauEpsilon?this._append`A${it},${it},0,1,${ht},${et-st},${nt-lt}A${it},${it},0,1,${ht},${this._x1=ct},${this._y1=ut}`:dt>epsilon&&this._append`A${it},${it},0,${+(dt>=pi)},${ht},${this._x1=et+it*Math.cos(ot)},${this._y1=nt+it*Math.sin(ot)}`)}rect(et,nt,it,rt){this._append`M${this._x0=this._x1=+et},${this._y0=this._y1=+nt}h${it=+it}v${+rt}h${-it}Z`}toString(){return this._}}function withPath(tt){let et=3;return tt.digits=function(nt){if(!arguments.length)return et;if(nt==null)et=null;else{const it=Math.floor(nt);if(!(it>=0))throw new RangeError(`invalid digits: ${nt}`);et=it}return tt},()=>new Path(et)}function array$2(tt){return typeof tt=="object"&&"length"in tt?tt:Array.from(tt)}function Linear(tt){this._context=tt}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1,this._line?this._context.lineTo(tt,et):this._context.moveTo(tt,et);break;case 1:this._point=2;default:this._context.lineTo(tt,et);break}}};function curveLinear(tt){return new Linear(tt)}function x(tt){return tt[0]}function y(tt){return tt[1]}function shapeLine(tt,et){var nt=constant$6(!0),it=null,rt=curveLinear,ot=null,at=withPath(st);tt=typeof tt=="function"?tt:tt===void 0?x:constant$6(tt),et=typeof et=="function"?et:et===void 0?y:constant$6(et);function st(lt){var ct,ut=(lt=array$2(lt)).length,ht,dt=!1,pt;for(it==null&&(ot=rt(pt=at())),ct=0;ct<=ut;++ct)!(ct=pt;--mt)st.point(vt[mt],xt[mt]);st.lineEnd(),st.areaEnd()}yt&&(vt[dt]=+tt(bt,dt,ht),xt[dt]=+et(bt,dt,ht),st.point(it?+it(bt,dt,ht):vt[dt],nt?+nt(bt,dt,ht):xt[dt]))}if(wt)return st=null,wt+""||null}function ut(){return shapeLine().defined(rt).curve(at).context(ot)}return ct.x=function(ht){return arguments.length?(tt=typeof ht=="function"?ht:constant$6(+ht),it=null,ct):tt},ct.x0=function(ht){return arguments.length?(tt=typeof ht=="function"?ht:constant$6(+ht),ct):tt},ct.x1=function(ht){return arguments.length?(it=ht==null?null:typeof ht=="function"?ht:constant$6(+ht),ct):it},ct.y=function(ht){return arguments.length?(et=typeof ht=="function"?ht:constant$6(+ht),nt=null,ct):et},ct.y0=function(ht){return arguments.length?(et=typeof ht=="function"?ht:constant$6(+ht),ct):et},ct.y1=function(ht){return arguments.length?(nt=ht==null?null:typeof ht=="function"?ht:constant$6(+ht),ct):nt},ct.lineX0=ct.lineY0=function(){return ut().x(tt).y(et)},ct.lineY1=function(){return ut().x(tt).y(nt)},ct.lineX1=function(){return ut().x(it).y(et)},ct.defined=function(ht){return arguments.length?(rt=typeof ht=="function"?ht:constant$6(!!ht),ct):rt},ct.curve=function(ht){return arguments.length?(at=ht,ot!=null&&(st=at(ot)),ct):at},ct.context=function(ht){return arguments.length?(ht==null?ot=st=null:st=at(ot=ht),ct):ot},ct}class Bump{constructor(et,nt){this._context=et,this._x=nt}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(et,nt){switch(et=+et,nt=+nt,this._point){case 0:{this._point=1,this._line?this._context.lineTo(et,nt):this._context.moveTo(et,nt);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+et)/2,this._y0,this._x0,nt,et,nt):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+nt)/2,et,this._y0,et,nt);break}}this._x0=et,this._y0=nt}}function bumpX(tt){return new Bump(tt,!0)}function bumpY(tt){return new Bump(tt,!1)}const symbolCircle={draw(tt,et){const nt=sqrt$1(et/pi$1);tt.moveTo(nt,0),tt.arc(0,0,nt,0,tau$1)}},symbolCross={draw(tt,et){const nt=sqrt$1(et/5)/2;tt.moveTo(-3*nt,-nt),tt.lineTo(-nt,-nt),tt.lineTo(-nt,-3*nt),tt.lineTo(nt,-3*nt),tt.lineTo(nt,-nt),tt.lineTo(3*nt,-nt),tt.lineTo(3*nt,nt),tt.lineTo(nt,nt),tt.lineTo(nt,3*nt),tt.lineTo(-nt,3*nt),tt.lineTo(-nt,nt),tt.lineTo(-3*nt,nt),tt.closePath()}},tan30=sqrt$1(1/3),tan30_2=tan30*2,symbolDiamond={draw(tt,et){const nt=sqrt$1(et/tan30_2),it=nt*tan30;tt.moveTo(0,-nt),tt.lineTo(it,0),tt.lineTo(0,nt),tt.lineTo(-it,0),tt.closePath()}},symbolSquare={draw(tt,et){const nt=sqrt$1(et),it=-nt/2;tt.rect(it,it,nt,nt)}},ka=.8908130915292852,kr=sin(pi$1/10)/sin(7*pi$1/10),kx=sin(tau$1/10)*kr,ky=-cos(tau$1/10)*kr,symbolStar={draw(tt,et){const nt=sqrt$1(et*ka),it=kx*nt,rt=ky*nt;tt.moveTo(0,-nt),tt.lineTo(it,rt);for(let ot=1;ot<5;++ot){const at=tau$1*ot/5,st=cos(at),lt=sin(at);tt.lineTo(lt*nt,-st*nt),tt.lineTo(st*it-lt*rt,lt*it+st*rt)}tt.closePath()}},sqrt3=sqrt$1(3),symbolTriangle={draw(tt,et){const nt=-sqrt$1(et/(sqrt3*3));tt.moveTo(0,nt*2),tt.lineTo(-sqrt3*nt,-nt),tt.lineTo(sqrt3*nt,-nt),tt.closePath()}},c=-.5,s=sqrt$1(3)/2,k=1/sqrt$1(12),a=(k/2+1)*3,symbolWye={draw(tt,et){const nt=sqrt$1(et/a),it=nt/2,rt=nt*k,ot=it,at=nt*k+nt,st=-ot,lt=at;tt.moveTo(it,rt),tt.lineTo(ot,at),tt.lineTo(st,lt),tt.lineTo(c*it-s*rt,s*it+c*rt),tt.lineTo(c*ot-s*at,s*ot+c*at),tt.lineTo(c*st-s*lt,s*st+c*lt),tt.lineTo(c*it+s*rt,c*rt-s*it),tt.lineTo(c*ot+s*at,c*at-s*ot),tt.lineTo(c*st+s*lt,c*lt-s*st),tt.closePath()}};function Symbol$3(tt,et){let nt=null,it=withPath(rt);tt=typeof tt=="function"?tt:constant$6(tt||symbolCircle),et=typeof et=="function"?et:constant$6(et===void 0?64:+et);function rt(){let ot;if(nt||(nt=ot=it()),tt.apply(this,arguments).draw(nt,+et.apply(this,arguments)),ot)return nt=null,ot+""||null}return rt.type=function(ot){return arguments.length?(tt=typeof ot=="function"?ot:constant$6(ot),rt):tt},rt.size=function(ot){return arguments.length?(et=typeof ot=="function"?ot:constant$6(+ot),rt):et},rt.context=function(ot){return arguments.length?(nt=ot??null,rt):nt},rt}function noop$4(){}function point$5(tt,et,nt){tt._context.bezierCurveTo((2*tt._x0+tt._x1)/3,(2*tt._y0+tt._y1)/3,(tt._x0+2*tt._x1)/3,(tt._y0+2*tt._y1)/3,(tt._x0+4*tt._x1+et)/6,(tt._y0+4*tt._y1+nt)/6)}function Basis(tt){this._context=tt}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$5(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1,this._line?this._context.lineTo(tt,et):this._context.moveTo(tt,et);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$5(this,tt,et);break}this._x0=this._x1,this._x1=tt,this._y0=this._y1,this._y1=et}};function curveBasis(tt){return new Basis(tt)}function BasisClosed(tt){this._context=tt}BasisClosed.prototype={areaStart:noop$4,areaEnd:noop$4,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1,this._x2=tt,this._y2=et;break;case 1:this._point=2,this._x3=tt,this._y3=et;break;case 2:this._point=3,this._x4=tt,this._y4=et,this._context.moveTo((this._x0+4*this._x1+tt)/6,(this._y0+4*this._y1+et)/6);break;default:point$5(this,tt,et);break}this._x0=this._x1,this._x1=tt,this._y0=this._y1,this._y1=et}};function curveBasisClosed(tt){return new BasisClosed(tt)}function BasisOpen(tt){this._context=tt}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var nt=(this._x0+4*this._x1+tt)/6,it=(this._y0+4*this._y1+et)/6;this._line?this._context.lineTo(nt,it):this._context.moveTo(nt,it);break;case 3:this._point=4;default:point$5(this,tt,et);break}this._x0=this._x1,this._x1=tt,this._y0=this._y1,this._y1=et}};function curveBasisOpen(tt){return new BasisOpen(tt)}function LinearClosed(tt){this._context=tt}LinearClosed.prototype={areaStart:noop$4,areaEnd:noop$4,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(tt,et){tt=+tt,et=+et,this._point?this._context.lineTo(tt,et):(this._point=1,this._context.moveTo(tt,et))}};function curveLinearClosed(tt){return new LinearClosed(tt)}function sign(tt){return tt<0?-1:1}function slope3(tt,et,nt){var it=tt._x1-tt._x0,rt=et-tt._x1,ot=(tt._y1-tt._y0)/(it||rt<0&&-0),at=(nt-tt._y1)/(rt||it<0&&-0),st=(ot*rt+at*it)/(it+rt);return(sign(ot)+sign(at))*Math.min(Math.abs(ot),Math.abs(at),.5*Math.abs(st))||0}function slope2(tt,et){var nt=tt._x1-tt._x0;return nt?(3*(tt._y1-tt._y0)/nt-et)/2:et}function point$4(tt,et,nt){var it=tt._x0,rt=tt._y0,ot=tt._x1,at=tt._y1,st=(ot-it)/3;tt._context.bezierCurveTo(it+st,rt+st*et,ot-st,at-st*nt,ot,at)}function MonotoneX(tt){this._context=tt}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point$4(this,this._t0,slope2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(tt,et){var nt=NaN;if(tt=+tt,et=+et,!(tt===this._x1&&et===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(tt,et):this._context.moveTo(tt,et);break;case 1:this._point=2;break;case 2:this._point=3,point$4(this,slope2(this,nt=slope3(this,tt,et)),nt);break;default:point$4(this,this._t0,nt=slope3(this,tt,et));break}this._x0=this._x1,this._x1=tt,this._y0=this._y1,this._y1=et,this._t0=nt}}};function MonotoneY(tt){this._context=new ReflectContext(tt)}(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(tt,et){MonotoneX.prototype.point.call(this,et,tt)};function ReflectContext(tt){this._context=tt}ReflectContext.prototype={moveTo:function(tt,et){this._context.moveTo(et,tt)},closePath:function(){this._context.closePath()},lineTo:function(tt,et){this._context.lineTo(et,tt)},bezierCurveTo:function(tt,et,nt,it,rt,ot){this._context.bezierCurveTo(et,tt,it,nt,ot,rt)}};function monotoneX(tt){return new MonotoneX(tt)}function monotoneY(tt){return new MonotoneY(tt)}function Natural(tt){this._context=tt}Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var tt=this._x,et=this._y,nt=tt.length;if(nt)if(this._line?this._context.lineTo(tt[0],et[0]):this._context.moveTo(tt[0],et[0]),nt===2)this._context.lineTo(tt[1],et[1]);else for(var it=controlPoints(tt),rt=controlPoints(et),ot=0,at=1;at=0;--et)rt[et]=(at[et]-rt[et+1])/ot[et];for(ot[nt-1]=(tt[nt]+rt[nt-1])/2,et=0;et=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1,this._line?this._context.lineTo(tt,et):this._context.moveTo(tt,et);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,et),this._context.lineTo(tt,et);else{var nt=this._x*(1-this._t)+tt*this._t;this._context.lineTo(nt,this._y),this._context.lineTo(nt,et)}break}}this._x=tt,this._y=et}};function curveStep(tt){return new Step(tt,.5)}function stepBefore(tt){return new Step(tt,0)}function stepAfter(tt){return new Step(tt,1)}function stackOffsetNone(tt,et){if((at=tt.length)>1)for(var nt=1,it,rt,ot=tt[et[0]],at,st=ot.length;nt=0;)nt[et]=et;return nt}function stackValue(tt,et){return tt[et]}function stackSeries(tt){const et=[];return et.key=tt,et}function shapeStack(){var tt=constant$6([]),et=stackOrderNone,nt=stackOffsetNone,it=stackValue;function rt(ot){var at=Array.from(tt.apply(this,arguments),stackSeries),st,lt=at.length,ct=-1,ut;for(const ht of ot)for(st=0,++ct;st0){for(var nt,it,rt=0,ot=tt[0].length,at;rt0){for(var nt=0,it=tt[et[0]],rt,ot=it.length;nt0)||!((ot=(rt=tt[et[0]]).length)>0))){for(var nt=0,it=1,rt,ot,at;it=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$f(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var symbolFactories={symbolCircle,symbolCross,symbolDiamond,symbolSquare,symbolStar,symbolTriangle,symbolWye},RADIAN$1=Math.PI/180,getSymbolFactory=function tt(et){var nt="symbol".concat(upperFirst$1(et));return symbolFactories[nt]||symbolCircle},calculateAreaSize=function tt(et,nt,it){if(nt==="area")return et;switch(it){case"cross":return 5*et*et/9;case"diamond":return .5*et*et/Math.sqrt(3);case"square":return et*et;case"star":{var rt=18*RADIAN$1;return 1.25*et*et*(Math.tan(rt)-Math.tan(rt*2)*Math.pow(Math.tan(rt),2))}case"triangle":return Math.sqrt(3)*et*et/4;case"wye":return(21-10*Math.sqrt(3))*et*et/8;default:return Math.PI*et*et/4}},registerSymbol=function tt(et,nt){symbolFactories["symbol".concat(upperFirst$1(et))]=nt},Symbols=function tt(et){var nt=et.type,it=nt===void 0?"circle":nt,rt=et.size,ot=rt===void 0?64:rt,at=et.sizeType,st=at===void 0?"area":at,lt=_objectWithoutProperties$f(et,_excluded$f),ct=_objectSpread$A(_objectSpread$A({},lt),{},{type:it,size:ot,sizeType:st}),ut=function(){var bt=getSymbolFactory(it),yt=Symbol$3().type(bt).size(calculateAreaSize(ot,st,it));return yt()},ht=ct.className,dt=ct.cx,pt=ct.cy,mt=filterProps(ct,!0);return dt===+dt&&pt===+pt&&ot===+ot?React$1.createElement("path",_extends$o({},mt,{className:clsx("recharts-symbols",ht),transform:"translate(".concat(dt,", ").concat(pt,")"),d:ut()})):null};Symbols.registerSymbol=registerSymbol;function _typeof$D(tt){"@babel/helpers - typeof";return _typeof$D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$D(tt)}function _extends$n(){return _extends$n=Object.assign?Object.assign.bind():function(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$c(tt){return _getPrototypeOf$c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$c(tt)}function _defineProperty$B(tt,et,nt){return et=_toPropertyKey$B(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$B(tt){var et=_toPrimitive$B(tt,"string");return _typeof$D(et)==="symbol"?et:String(et)}function _toPrimitive$B(tt,et){if(_typeof$D(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$D(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var SIZE=32,DefaultLegendContent=function(tt){_inherits$c(nt,tt);var et=_createSuper$c(nt);function nt(){return _classCallCheck$f(this,nt),et.apply(this,arguments)}return _createClass$f(nt,[{key:"renderIcon",value:function(rt){var ot=this.props.inactiveColor,at=SIZE/2,st=SIZE/6,lt=SIZE/3,ct=rt.inactive?ot:rt.color;if(rt.type==="plainline")return React$1.createElement("line",{strokeWidth:4,fill:"none",stroke:ct,strokeDasharray:rt.payload.strokeDasharray,x1:0,y1:at,x2:SIZE,y2:at,className:"recharts-legend-icon"});if(rt.type==="line")return React$1.createElement("path",{strokeWidth:4,fill:"none",stroke:ct,d:"M0,".concat(at,"h").concat(lt,` + */var b=typeof Symbol=="function"&&Symbol.for,c$1=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k$1=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x$1=b?Symbol.for("react.responder"):60118,y$1=b?Symbol.for("react.scope"):60119;function z(tt){if(typeof tt=="object"&&tt!==null){var et=tt.$$typeof;switch(et){case c$1:switch(tt=tt.type,tt){case l:case m:case e:case g:case f:case p:return tt;default:switch(tt=tt&&tt.$$typeof,tt){case k$1:case n:case t:case r:case h:return tt;default:return et}}case d:return et}}}function A(tt){return z(tt)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k$1;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c$1;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(tt){return A(tt)||z(tt)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(tt){return z(tt)===k$1};reactIs_production_min.isContextProvider=function(tt){return z(tt)===h};reactIs_production_min.isElement=function(tt){return typeof tt=="object"&&tt!==null&&tt.$$typeof===c$1};reactIs_production_min.isForwardRef=function(tt){return z(tt)===n};reactIs_production_min.isFragment=function(tt){return z(tt)===e};reactIs_production_min.isLazy=function(tt){return z(tt)===t};reactIs_production_min.isMemo=function(tt){return z(tt)===r};reactIs_production_min.isPortal=function(tt){return z(tt)===d};reactIs_production_min.isProfiler=function(tt){return z(tt)===g};reactIs_production_min.isStrictMode=function(tt){return z(tt)===f};reactIs_production_min.isSuspense=function(tt){return z(tt)===p};reactIs_production_min.isValidElementType=function(tt){return typeof tt=="string"||typeof tt=="function"||tt===e||tt===m||tt===g||tt===f||tt===p||tt===q||typeof tt=="object"&&tt!==null&&(tt.$$typeof===t||tt.$$typeof===r||tt.$$typeof===h||tt.$$typeof===k$1||tt.$$typeof===n||tt.$$typeof===w||tt.$$typeof===x$1||tt.$$typeof===y$1||tt.$$typeof===v)};reactIs_production_min.typeOf=z;reactIs.exports=reactIs_production_min;var reactIsExports=reactIs.exports,baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1,numberTag$1="[object Number]";function isNumber$2(tt){return typeof tt=="number"||isObjectLike$3(tt)&&baseGetTag$2(tt)==numberTag$1}var isNumber_1=isNumber$2;const isNumber$3=getDefaultExportFromCjs(isNumber_1);var isNumber$1=isNumber_1;function isNaN$1(tt){return isNumber$1(tt)&&tt!=+tt}var _isNaN=isNaN$1;const isNan=getDefaultExportFromCjs(_isNaN);var mathSign=function tt(et){return et===0?0:et>0?1:-1},isPercent=function tt(et){return isString$1(et)&&et.indexOf("%")===et.length-1},isNumber=function tt(et){return isNumber$3(et)&&!isNan(et)},isNumOrStr=function tt(et){return isNumber(et)||isString$1(et)},idCounter=0,uniqueId=function tt(et){var nt=++idCounter;return"".concat(et||"").concat(nt)},getPercentValue=function tt(et,nt){var it=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,rt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!isNumber(et)&&!isString$1(et))return it;var ot;if(isPercent(et)){var at=et.indexOf("%");ot=nt*parseFloat(et.slice(0,at))/100}else ot=+et;return isNan(ot)&&(ot=it),rt&&ot>nt&&(ot=nt),ot},getAnyElementOfObject=function tt(et){if(!et)return null;var nt=Object.keys(et);return nt&&nt.length?et[nt[0]]:null},hasDuplicate=function tt(et){if(!Array.isArray(et))return!1;for(var nt=et.length,it={},rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$i(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _typeof$E(tt){"@babel/helpers - typeof";return _typeof$E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$E(tt)}var REACT_BROWSER_EVENT_MAP={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},getDisplayName=function tt(et){return typeof et=="string"?et:et?et.displayName||et.name||"Component":""},lastChildren=null,lastResult=null,toArray=function tt(et){if(et===lastChildren&&Array.isArray(lastResult))return lastResult;var nt=[];return reactExports.Children.forEach(et,function(it){isNil$1(it)||(reactIsExports.isFragment(it)?nt=nt.concat(tt(it.props.children)):nt.push(it))}),lastResult=nt,lastChildren=et,nt};function findAllByType(tt,et){var nt=[],it=[];return Array.isArray(et)?it=et.map(function(rt){return getDisplayName(rt)}):it=[getDisplayName(et)],toArray(tt).forEach(function(rt){var ot=get$3(rt,"type.displayName")||get$3(rt,"type.name");it.indexOf(ot)!==-1&&nt.push(rt)}),nt}function findChildByType(tt,et){var nt=findAllByType(tt,et);return nt&&nt[0]}var validateWidthHeight=function tt(et){if(!et||!et.props)return!1;var nt=et.props,it=nt.width,rt=nt.height;return!(!isNumber(it)||it<=0||!isNumber(rt)||rt<=0)},SVG_TAGS=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],isSvgElement=function tt(et){return et&&et.type&&isString$1(et.type)&&SVG_TAGS.indexOf(et.type)>=0},isDotProps=function tt(et){return et&&_typeof$E(et)==="object"&&"cx"in et&&"cy"in et&&"r"in et},isValidSpreadableProp=function tt(et,nt,it,rt){var ot,at=(ot=FilteredElementKeyMap==null?void 0:FilteredElementKeyMap[rt])!==null&&ot!==void 0?ot:[];return!isFunction$4(et)&&(rt&&at.includes(nt)||SVGElementPropKeys.includes(nt))||it&&EventKeys.includes(nt)},filterProps=function tt(et,nt,it){if(!et||typeof et=="function"||typeof et=="boolean")return null;var rt=et;if(reactExports.isValidElement(et)&&(rt=et.props),!isObject$h(rt))return null;var ot={};return Object.keys(rt).forEach(function(at){var st;isValidSpreadableProp((st=rt)===null||st===void 0?void 0:st[at],at,nt,it)&&(ot[at]=rt[at])}),ot},isChildrenEqual=function tt(et,nt){if(et===nt)return!0;var it=reactExports.Children.count(et);if(it!==reactExports.Children.count(nt))return!1;if(it===0)return!0;if(it===1)return isSingleChildEqual(Array.isArray(et)?et[0]:et,Array.isArray(nt)?nt[0]:nt);for(var rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$h(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function Surface(tt){var et=tt.children,nt=tt.width,it=tt.height,rt=tt.viewBox,ot=tt.className,at=tt.style,st=tt.title,lt=tt.desc,ct=_objectWithoutProperties$h(tt,_excluded$h),ut=rt||{width:nt,height:it,x:0,y:0},ht=clsx("recharts-surface",ot);return React$1.createElement("svg",_extends$p({},filterProps(ct,!0,"svg"),{className:ht,width:nt,height:it,style:at,viewBox:"".concat(ut.x," ").concat(ut.y," ").concat(ut.width," ").concat(ut.height)}),React$1.createElement("title",null,st),React$1.createElement("desc",null,lt),et)}var _excluded$g=["children","className"];function _extends$o(){return _extends$o=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$g(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var Layer=React$1.forwardRef(function(tt,et){var nt=tt.children,it=tt.className,rt=_objectWithoutProperties$g(tt,_excluded$g),ot=clsx("recharts-layer",it);return React$1.createElement("g",_extends$o({className:ot},filterProps(rt,!0),{ref:et}),nt)}),warn=function tt(et,nt){for(var it=arguments.length,rt=new Array(it>2?it-2:0),ot=2;otrt?0:rt+et),nt=nt>rt?rt:nt,nt<0&&(nt+=rt),rt=et>nt?0:nt-et>>>0,et>>>=0;for(var ot=Array(rt);++it=it?tt:baseSlice(tt,et,nt)}var _castSlice=castSlice$1,rsAstralRange$1="\\ud800-\\udfff",rsComboMarksRange$1="\\u0300-\\u036f",reComboHalfMarksRange$1="\\ufe20-\\ufe2f",rsComboSymbolsRange$1="\\u20d0-\\u20ff",rsComboRange$1=rsComboMarksRange$1+reComboHalfMarksRange$1+rsComboSymbolsRange$1,rsVarRange$1="\\ufe0e\\ufe0f",rsZWJ$1="\\u200d",reHasUnicode=RegExp("["+rsZWJ$1+rsAstralRange$1+rsComboRange$1+rsVarRange$1+"]");function hasUnicode$2(tt){return reHasUnicode.test(tt)}var _hasUnicode=hasUnicode$2;function asciiToArray$1(tt){return tt.split("")}var _asciiToArray=asciiToArray$1,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g");function unicodeToArray$1(tt){return tt.match(reUnicode)||[]}var _unicodeToArray=unicodeToArray$1,asciiToArray=_asciiToArray,hasUnicode$1=_hasUnicode,unicodeToArray=_unicodeToArray;function stringToArray$1(tt){return hasUnicode$1(tt)?unicodeToArray(tt):asciiToArray(tt)}var _stringToArray=stringToArray$1,castSlice=_castSlice,hasUnicode=_hasUnicode,stringToArray=_stringToArray,toString$3=toString_1;function createCaseFirst$1(tt){return function(et){et=toString$3(et);var nt=hasUnicode(et)?stringToArray(et):void 0,it=nt?nt[0]:et.charAt(0),rt=nt?castSlice(nt,1).join(""):et.slice(1);return it[tt]()+rt}}var _createCaseFirst=createCaseFirst$1,createCaseFirst=_createCaseFirst,upperFirst=createCaseFirst("toUpperCase"),upperFirst_1=upperFirst;const upperFirst$1=getDefaultExportFromCjs(upperFirst_1);function constant$6(tt){return function(){return tt}}const cos=Math.cos,sin=Math.sin,sqrt$1=Math.sqrt,pi$1=Math.PI,tau$1=2*pi$1,pi=Math.PI,tau=2*pi,epsilon=1e-6,tauEpsilon=tau-epsilon;function append(tt){this._+=tt[0];for(let et=1,nt=tt.length;et=0))throw new Error(`invalid digits: ${tt}`);if(et>15)return append;const nt=10**et;return function(it){this._+=it[0];for(let rt=1,ot=it.length;rtepsilon)if(!(Math.abs(ht*lt-ct*ut)>epsilon)||!ot)this._append`L${this._x1=et},${this._y1=nt}`;else{let pt=it-at,mt=rt-st,gt=lt*lt+ct*ct,bt=pt*pt+mt*mt,yt=Math.sqrt(gt),wt=Math.sqrt(dt),vt=ot*Math.tan((pi-Math.acos((gt+dt-bt)/(2*yt*wt)))/2),xt=vt/wt,St=vt/yt;Math.abs(xt-1)>epsilon&&this._append`L${et+xt*ut},${nt+xt*ht}`,this._append`A${ot},${ot},0,0,${+(ht*pt>ut*mt)},${this._x1=et+St*lt},${this._y1=nt+St*ct}`}}arc(et,nt,it,rt,ot,at){if(et=+et,nt=+nt,it=+it,at=!!at,it<0)throw new Error(`negative radius: ${it}`);let st=it*Math.cos(rt),lt=it*Math.sin(rt),ct=et+st,ut=nt+lt,ht=1^at,dt=at?rt-ot:ot-rt;this._x1===null?this._append`M${ct},${ut}`:(Math.abs(this._x1-ct)>epsilon||Math.abs(this._y1-ut)>epsilon)&&this._append`L${ct},${ut}`,it&&(dt<0&&(dt=dt%tau+tau),dt>tauEpsilon?this._append`A${it},${it},0,1,${ht},${et-st},${nt-lt}A${it},${it},0,1,${ht},${this._x1=ct},${this._y1=ut}`:dt>epsilon&&this._append`A${it},${it},0,${+(dt>=pi)},${ht},${this._x1=et+it*Math.cos(ot)},${this._y1=nt+it*Math.sin(ot)}`)}rect(et,nt,it,rt){this._append`M${this._x0=this._x1=+et},${this._y0=this._y1=+nt}h${it=+it}v${+rt}h${-it}Z`}toString(){return this._}}function withPath(tt){let et=3;return tt.digits=function(nt){if(!arguments.length)return et;if(nt==null)et=null;else{const it=Math.floor(nt);if(!(it>=0))throw new RangeError(`invalid digits: ${nt}`);et=it}return tt},()=>new Path(et)}function array$2(tt){return typeof tt=="object"&&"length"in tt?tt:Array.from(tt)}function Linear(tt){this._context=tt}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1,this._line?this._context.lineTo(tt,et):this._context.moveTo(tt,et);break;case 1:this._point=2;default:this._context.lineTo(tt,et);break}}};function curveLinear(tt){return new Linear(tt)}function x(tt){return tt[0]}function y(tt){return tt[1]}function shapeLine(tt,et){var nt=constant$6(!0),it=null,rt=curveLinear,ot=null,at=withPath(st);tt=typeof tt=="function"?tt:tt===void 0?x:constant$6(tt),et=typeof et=="function"?et:et===void 0?y:constant$6(et);function st(lt){var ct,ut=(lt=array$2(lt)).length,ht,dt=!1,pt;for(it==null&&(ot=rt(pt=at())),ct=0;ct<=ut;++ct)!(ct=pt;--mt)st.point(vt[mt],xt[mt]);st.lineEnd(),st.areaEnd()}yt&&(vt[dt]=+tt(bt,dt,ht),xt[dt]=+et(bt,dt,ht),st.point(it?+it(bt,dt,ht):vt[dt],nt?+nt(bt,dt,ht):xt[dt]))}if(wt)return st=null,wt+""||null}function ut(){return shapeLine().defined(rt).curve(at).context(ot)}return ct.x=function(ht){return arguments.length?(tt=typeof ht=="function"?ht:constant$6(+ht),it=null,ct):tt},ct.x0=function(ht){return arguments.length?(tt=typeof ht=="function"?ht:constant$6(+ht),ct):tt},ct.x1=function(ht){return arguments.length?(it=ht==null?null:typeof ht=="function"?ht:constant$6(+ht),ct):it},ct.y=function(ht){return arguments.length?(et=typeof ht=="function"?ht:constant$6(+ht),nt=null,ct):et},ct.y0=function(ht){return arguments.length?(et=typeof ht=="function"?ht:constant$6(+ht),ct):et},ct.y1=function(ht){return arguments.length?(nt=ht==null?null:typeof ht=="function"?ht:constant$6(+ht),ct):nt},ct.lineX0=ct.lineY0=function(){return ut().x(tt).y(et)},ct.lineY1=function(){return ut().x(tt).y(nt)},ct.lineX1=function(){return ut().x(it).y(et)},ct.defined=function(ht){return arguments.length?(rt=typeof ht=="function"?ht:constant$6(!!ht),ct):rt},ct.curve=function(ht){return arguments.length?(at=ht,ot!=null&&(st=at(ot)),ct):at},ct.context=function(ht){return arguments.length?(ht==null?ot=st=null:st=at(ot=ht),ct):ot},ct}class Bump{constructor(et,nt){this._context=et,this._x=nt}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(et,nt){switch(et=+et,nt=+nt,this._point){case 0:{this._point=1,this._line?this._context.lineTo(et,nt):this._context.moveTo(et,nt);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+et)/2,this._y0,this._x0,nt,et,nt):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+nt)/2,et,this._y0,et,nt);break}}this._x0=et,this._y0=nt}}function bumpX(tt){return new Bump(tt,!0)}function bumpY(tt){return new Bump(tt,!1)}const symbolCircle={draw(tt,et){const nt=sqrt$1(et/pi$1);tt.moveTo(nt,0),tt.arc(0,0,nt,0,tau$1)}},symbolCross={draw(tt,et){const nt=sqrt$1(et/5)/2;tt.moveTo(-3*nt,-nt),tt.lineTo(-nt,-nt),tt.lineTo(-nt,-3*nt),tt.lineTo(nt,-3*nt),tt.lineTo(nt,-nt),tt.lineTo(3*nt,-nt),tt.lineTo(3*nt,nt),tt.lineTo(nt,nt),tt.lineTo(nt,3*nt),tt.lineTo(-nt,3*nt),tt.lineTo(-nt,nt),tt.lineTo(-3*nt,nt),tt.closePath()}},tan30=sqrt$1(1/3),tan30_2=tan30*2,symbolDiamond={draw(tt,et){const nt=sqrt$1(et/tan30_2),it=nt*tan30;tt.moveTo(0,-nt),tt.lineTo(it,0),tt.lineTo(0,nt),tt.lineTo(-it,0),tt.closePath()}},symbolSquare={draw(tt,et){const nt=sqrt$1(et),it=-nt/2;tt.rect(it,it,nt,nt)}},ka=.8908130915292852,kr=sin(pi$1/10)/sin(7*pi$1/10),kx=sin(tau$1/10)*kr,ky=-cos(tau$1/10)*kr,symbolStar={draw(tt,et){const nt=sqrt$1(et*ka),it=kx*nt,rt=ky*nt;tt.moveTo(0,-nt),tt.lineTo(it,rt);for(let ot=1;ot<5;++ot){const at=tau$1*ot/5,st=cos(at),lt=sin(at);tt.lineTo(lt*nt,-st*nt),tt.lineTo(st*it-lt*rt,lt*it+st*rt)}tt.closePath()}},sqrt3=sqrt$1(3),symbolTriangle={draw(tt,et){const nt=-sqrt$1(et/(sqrt3*3));tt.moveTo(0,nt*2),tt.lineTo(-sqrt3*nt,-nt),tt.lineTo(sqrt3*nt,-nt),tt.closePath()}},c=-.5,s=sqrt$1(3)/2,k=1/sqrt$1(12),a=(k/2+1)*3,symbolWye={draw(tt,et){const nt=sqrt$1(et/a),it=nt/2,rt=nt*k,ot=it,at=nt*k+nt,st=-ot,lt=at;tt.moveTo(it,rt),tt.lineTo(ot,at),tt.lineTo(st,lt),tt.lineTo(c*it-s*rt,s*it+c*rt),tt.lineTo(c*ot-s*at,s*ot+c*at),tt.lineTo(c*st-s*lt,s*st+c*lt),tt.lineTo(c*it+s*rt,c*rt-s*it),tt.lineTo(c*ot+s*at,c*at-s*ot),tt.lineTo(c*st+s*lt,c*lt-s*st),tt.closePath()}};function Symbol$3(tt,et){let nt=null,it=withPath(rt);tt=typeof tt=="function"?tt:constant$6(tt||symbolCircle),et=typeof et=="function"?et:constant$6(et===void 0?64:+et);function rt(){let ot;if(nt||(nt=ot=it()),tt.apply(this,arguments).draw(nt,+et.apply(this,arguments)),ot)return nt=null,ot+""||null}return rt.type=function(ot){return arguments.length?(tt=typeof ot=="function"?ot:constant$6(ot),rt):tt},rt.size=function(ot){return arguments.length?(et=typeof ot=="function"?ot:constant$6(+ot),rt):et},rt.context=function(ot){return arguments.length?(nt=ot??null,rt):nt},rt}function noop$4(){}function point$5(tt,et,nt){tt._context.bezierCurveTo((2*tt._x0+tt._x1)/3,(2*tt._y0+tt._y1)/3,(tt._x0+2*tt._x1)/3,(tt._y0+2*tt._y1)/3,(tt._x0+4*tt._x1+et)/6,(tt._y0+4*tt._y1+nt)/6)}function Basis(tt){this._context=tt}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$5(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1,this._line?this._context.lineTo(tt,et):this._context.moveTo(tt,et);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$5(this,tt,et);break}this._x0=this._x1,this._x1=tt,this._y0=this._y1,this._y1=et}};function curveBasis(tt){return new Basis(tt)}function BasisClosed(tt){this._context=tt}BasisClosed.prototype={areaStart:noop$4,areaEnd:noop$4,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1,this._x2=tt,this._y2=et;break;case 1:this._point=2,this._x3=tt,this._y3=et;break;case 2:this._point=3,this._x4=tt,this._y4=et,this._context.moveTo((this._x0+4*this._x1+tt)/6,(this._y0+4*this._y1+et)/6);break;default:point$5(this,tt,et);break}this._x0=this._x1,this._x1=tt,this._y0=this._y1,this._y1=et}};function curveBasisClosed(tt){return new BasisClosed(tt)}function BasisOpen(tt){this._context=tt}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var nt=(this._x0+4*this._x1+tt)/6,it=(this._y0+4*this._y1+et)/6;this._line?this._context.lineTo(nt,it):this._context.moveTo(nt,it);break;case 3:this._point=4;default:point$5(this,tt,et);break}this._x0=this._x1,this._x1=tt,this._y0=this._y1,this._y1=et}};function curveBasisOpen(tt){return new BasisOpen(tt)}function LinearClosed(tt){this._context=tt}LinearClosed.prototype={areaStart:noop$4,areaEnd:noop$4,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(tt,et){tt=+tt,et=+et,this._point?this._context.lineTo(tt,et):(this._point=1,this._context.moveTo(tt,et))}};function curveLinearClosed(tt){return new LinearClosed(tt)}function sign(tt){return tt<0?-1:1}function slope3(tt,et,nt){var it=tt._x1-tt._x0,rt=et-tt._x1,ot=(tt._y1-tt._y0)/(it||rt<0&&-0),at=(nt-tt._y1)/(rt||it<0&&-0),st=(ot*rt+at*it)/(it+rt);return(sign(ot)+sign(at))*Math.min(Math.abs(ot),Math.abs(at),.5*Math.abs(st))||0}function slope2(tt,et){var nt=tt._x1-tt._x0;return nt?(3*(tt._y1-tt._y0)/nt-et)/2:et}function point$4(tt,et,nt){var it=tt._x0,rt=tt._y0,ot=tt._x1,at=tt._y1,st=(ot-it)/3;tt._context.bezierCurveTo(it+st,rt+st*et,ot-st,at-st*nt,ot,at)}function MonotoneX(tt){this._context=tt}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point$4(this,this._t0,slope2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(tt,et){var nt=NaN;if(tt=+tt,et=+et,!(tt===this._x1&&et===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(tt,et):this._context.moveTo(tt,et);break;case 1:this._point=2;break;case 2:this._point=3,point$4(this,slope2(this,nt=slope3(this,tt,et)),nt);break;default:point$4(this,this._t0,nt=slope3(this,tt,et));break}this._x0=this._x1,this._x1=tt,this._y0=this._y1,this._y1=et,this._t0=nt}}};function MonotoneY(tt){this._context=new ReflectContext(tt)}(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(tt,et){MonotoneX.prototype.point.call(this,et,tt)};function ReflectContext(tt){this._context=tt}ReflectContext.prototype={moveTo:function(tt,et){this._context.moveTo(et,tt)},closePath:function(){this._context.closePath()},lineTo:function(tt,et){this._context.lineTo(et,tt)},bezierCurveTo:function(tt,et,nt,it,rt,ot){this._context.bezierCurveTo(et,tt,it,nt,ot,rt)}};function monotoneX(tt){return new MonotoneX(tt)}function monotoneY(tt){return new MonotoneY(tt)}function Natural(tt){this._context=tt}Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var tt=this._x,et=this._y,nt=tt.length;if(nt)if(this._line?this._context.lineTo(tt[0],et[0]):this._context.moveTo(tt[0],et[0]),nt===2)this._context.lineTo(tt[1],et[1]);else for(var it=controlPoints(tt),rt=controlPoints(et),ot=0,at=1;at=0;--et)rt[et]=(at[et]-rt[et+1])/ot[et];for(ot[nt-1]=(tt[nt]+rt[nt-1])/2,et=0;et=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(tt,et){switch(tt=+tt,et=+et,this._point){case 0:this._point=1,this._line?this._context.lineTo(tt,et):this._context.moveTo(tt,et);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,et),this._context.lineTo(tt,et);else{var nt=this._x*(1-this._t)+tt*this._t;this._context.lineTo(nt,this._y),this._context.lineTo(nt,et)}break}}this._x=tt,this._y=et}};function curveStep(tt){return new Step(tt,.5)}function stepBefore(tt){return new Step(tt,0)}function stepAfter(tt){return new Step(tt,1)}function stackOffsetNone(tt,et){if((at=tt.length)>1)for(var nt=1,it,rt,ot=tt[et[0]],at,st=ot.length;nt=0;)nt[et]=et;return nt}function stackValue(tt,et){return tt[et]}function stackSeries(tt){const et=[];return et.key=tt,et}function shapeStack(){var tt=constant$6([]),et=stackOrderNone,nt=stackOffsetNone,it=stackValue;function rt(ot){var at=Array.from(tt.apply(this,arguments),stackSeries),st,lt=at.length,ct=-1,ut;for(const ht of ot)for(st=0,++ct;st0){for(var nt,it,rt=0,ot=tt[0].length,at;rt0){for(var nt=0,it=tt[et[0]],rt,ot=it.length;nt0)||!((ot=(rt=tt[et[0]]).length)>0))){for(var nt=0,it=1,rt,ot,at;it=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$f(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var symbolFactories={symbolCircle,symbolCross,symbolDiamond,symbolSquare,symbolStar,symbolTriangle,symbolWye},RADIAN$1=Math.PI/180,getSymbolFactory=function tt(et){var nt="symbol".concat(upperFirst$1(et));return symbolFactories[nt]||symbolCircle},calculateAreaSize=function tt(et,nt,it){if(nt==="area")return et;switch(it){case"cross":return 5*et*et/9;case"diamond":return .5*et*et/Math.sqrt(3);case"square":return et*et;case"star":{var rt=18*RADIAN$1;return 1.25*et*et*(Math.tan(rt)-Math.tan(rt*2)*Math.pow(Math.tan(rt),2))}case"triangle":return Math.sqrt(3)*et*et/4;case"wye":return(21-10*Math.sqrt(3))*et*et/8;default:return Math.PI*et*et/4}},registerSymbol=function tt(et,nt){symbolFactories["symbol".concat(upperFirst$1(et))]=nt},Symbols=function tt(et){var nt=et.type,it=nt===void 0?"circle":nt,rt=et.size,ot=rt===void 0?64:rt,at=et.sizeType,st=at===void 0?"area":at,lt=_objectWithoutProperties$f(et,_excluded$f),ct=_objectSpread$z(_objectSpread$z({},lt),{},{type:it,size:ot,sizeType:st}),ut=function(){var bt=getSymbolFactory(it),yt=Symbol$3().type(bt).size(calculateAreaSize(ot,st,it));return yt()},ht=ct.className,dt=ct.cx,pt=ct.cy,mt=filterProps(ct,!0);return dt===+dt&&pt===+pt&&ot===+ot?React$1.createElement("path",_extends$n({},mt,{className:clsx("recharts-symbols",ht),transform:"translate(".concat(dt,", ").concat(pt,")"),d:ut()})):null};Symbols.registerSymbol=registerSymbol;function _typeof$C(tt){"@babel/helpers - typeof";return _typeof$C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$C(tt)}function _extends$m(){return _extends$m=Object.assign?Object.assign.bind():function(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$b(tt){return _getPrototypeOf$b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$b(tt)}function _defineProperty$A(tt,et,nt){return et=_toPropertyKey$B(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$B(tt){var et=_toPrimitive$B(tt,"string");return _typeof$C(et)==="symbol"?et:String(et)}function _toPrimitive$B(tt,et){if(_typeof$C(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$C(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var SIZE=32,DefaultLegendContent=function(tt){_inherits$b(nt,tt);var et=_createSuper$b(nt);function nt(){return _classCallCheck$e(this,nt),et.apply(this,arguments)}return _createClass$e(nt,[{key:"renderIcon",value:function(rt){var ot=this.props.inactiveColor,at=SIZE/2,st=SIZE/6,lt=SIZE/3,ct=rt.inactive?ot:rt.color;if(rt.type==="plainline")return React$1.createElement("line",{strokeWidth:4,fill:"none",stroke:ct,strokeDasharray:rt.payload.strokeDasharray,x1:0,y1:at,x2:SIZE,y2:at,className:"recharts-legend-icon"});if(rt.type==="line")return React$1.createElement("path",{strokeWidth:4,fill:"none",stroke:ct,d:"M0,".concat(at,"h").concat(lt,` A`).concat(st,",").concat(st,",0,1,1,").concat(2*lt,",").concat(at,` H`).concat(SIZE,"M").concat(2*lt,",").concat(at,` - A`).concat(st,",").concat(st,",0,1,1,").concat(lt,",").concat(at),className:"recharts-legend-icon"});if(rt.type==="rect")return React$1.createElement("path",{stroke:"none",fill:ct,d:"M0,".concat(SIZE/8,"h").concat(SIZE,"v").concat(SIZE*3/4,"h").concat(-SIZE,"z"),className:"recharts-legend-icon"});if(React$1.isValidElement(rt.legendIcon)){var ut=_objectSpread$z({},rt);return delete ut.legendIcon,React$1.cloneElement(rt.legendIcon,ut)}return React$1.createElement(Symbols,{fill:ct,cx:at,cy:at,size:SIZE,sizeType:"diameter",type:rt.type})}},{key:"renderItems",value:function(){var rt=this,ot=this.props,at=ot.payload,st=ot.iconSize,lt=ot.layout,ct=ot.formatter,ut=ot.inactiveColor,ht={x:0,y:0,width:SIZE,height:SIZE},dt={display:lt==="horizontal"?"inline-block":"block",marginRight:10},pt={display:"inline-block",verticalAlign:"middle",marginRight:4};return at.map(function(mt,gt){var bt,yt=mt.formatter||ct,wt=clsx((bt={"recharts-legend-item":!0},_defineProperty$B(bt,"legend-item-".concat(gt),!0),_defineProperty$B(bt,"inactive",mt.inactive),bt));if(mt.type==="none")return null;var vt=isFunction$4(mt.value)?null:mt.value;warn(!isFunction$4(mt.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var xt=mt.inactive?ut:mt.color;return React$1.createElement("li",_extends$n({className:wt,style:dt,key:"legend-item-".concat(mt.type,"-").concat(mt.value)},adaptEventsOfChild(rt.props,mt,gt)),React$1.createElement(Surface,{width:st,height:st,viewBox:ht,style:pt},rt.renderIcon(mt)),React$1.createElement("span",{className:"recharts-legend-item-text",style:{color:xt}},yt?yt(vt,mt,gt):vt))})}},{key:"render",value:function(){var rt=this.props,ot=rt.payload,at=rt.layout,st=rt.align;if(!ot||!ot.length)return null;var lt={padding:0,margin:0,textAlign:at==="horizontal"?st:"left"};return React$1.createElement("ul",{className:"recharts-default-legend",style:lt},this.renderItems())}}]),nt}(reactExports.PureComponent);_defineProperty$B(DefaultLegendContent,"displayName","Legend");_defineProperty$B(DefaultLegendContent,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(tt){return this.__data__.set(tt,HASH_UNDEFINED),this}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(tt){return this.__data__.has(tt)}var _setCacheHas=setCacheHas$1,MapCache=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$2(tt){var et=-1,nt=tt==null?0:tt.length;for(this.__data__=new MapCache;++etst))return!1;var ct=ot.get(tt),ut=ot.get(et);if(ct&&ut)return ct==et&&ut==tt;var ht=-1,dt=!0,pt=nt&COMPARE_UNORDERED_FLAG$3?new SetCache$1:void 0;for(ot.set(tt,et),ot.set(et,tt);++ht-1}var _arrayIncludes=arrayIncludes$1;function arrayIncludesWith$1(tt,et,nt){for(var it=-1,rt=tt==null?0:tt.length;++it=LARGE_ARRAY_SIZE){var ct=et?null:createSet(tt);if(ct)return setToArray(ct);at=!1,rt=cacheHas,lt=new SetCache}else lt=et?[]:st;e:for(;++it"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$b(tt){return _getPrototypeOf$b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$b(tt)}function _defineProperty$A(tt,et,nt){return et=_toPropertyKey$A(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$A(tt){var et=_toPrimitive$A(tt,"string");return _typeof$C(et)==="symbol"?et:String(et)}function _toPrimitive$A(tt,et){if(_typeof$C(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$C(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function _objectWithoutProperties$e(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$e(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$e(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function defaultUniqBy$1(tt){return tt.value}function renderContent$1(tt,et){if(React$1.isValidElement(tt))return React$1.cloneElement(tt,et);if(typeof tt=="function")return React$1.createElement(tt,et);et.ref;var nt=_objectWithoutProperties$e(et,_excluded$e);return React$1.createElement(DefaultLegendContent,nt)}var EPS$1=1,Legend=function(tt){_inherits$b(nt,tt);var et=_createSuper$b(nt);function nt(){var it;_classCallCheck$e(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;atEPS$1||Math.abs(ot.height-this.lastBoundingBox.height)>EPS$1)&&(this.lastBoundingBox.width=ot.width,this.lastBoundingBox.height=ot.height,rt&&rt(ot))}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,rt&&rt(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?_objectSpread$y({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(rt){var ot=this.props,at=ot.layout,st=ot.align,lt=ot.verticalAlign,ct=ot.margin,ut=ot.chartWidth,ht=ot.chartHeight,dt,pt;if(!rt||(rt.left===void 0||rt.left===null)&&(rt.right===void 0||rt.right===null))if(st==="center"&&at==="vertical"){var mt=this.getBBoxSnapshot();dt={left:((ut||0)-mt.width)/2}}else dt=st==="right"?{right:ct&&ct.right||0}:{left:ct&&ct.left||0};if(!rt||(rt.top===void 0||rt.top===null)&&(rt.bottom===void 0||rt.bottom===null))if(lt==="middle"){var gt=this.getBBoxSnapshot();pt={top:((ht||0)-gt.height)/2}}else pt=lt==="bottom"?{bottom:ct&&ct.bottom||0}:{top:ct&&ct.top||0};return _objectSpread$y(_objectSpread$y({},dt),pt)}},{key:"render",value:function(){var rt=this,ot=this.props,at=ot.content,st=ot.width,lt=ot.height,ct=ot.wrapperStyle,ut=ot.payloadUniqBy,ht=ot.payload,dt=_objectSpread$y(_objectSpread$y({position:"absolute",width:st||"auto",height:lt||"auto"},this.getDefaultPosition(ct)),ct);return React$1.createElement("div",{className:"recharts-legend-wrapper",style:dt,ref:function(mt){rt.wrapperNode=mt}},renderContent$1(at,_objectSpread$y(_objectSpread$y({},this.props),{},{payload:getUniqPayload(ht,ut,defaultUniqBy$1)})))}}],[{key:"getWithHeight",value:function(rt,ot){var at=rt.props.layout;return at==="vertical"&&isNumber(rt.props.height)?{height:rt.props.height}:at==="horizontal"?{width:rt.props.width||ot}:null}}]),nt}(reactExports.PureComponent);_defineProperty$A(Legend,"displayName","Legend");_defineProperty$A(Legend,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Symbol$1=_Symbol,isArguments=isArguments_1,isArray$6=isArray_1,spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable$1(tt){return isArray$6(tt)||isArguments(tt)||!!(spreadableSymbol&&tt&&tt[spreadableSymbol])}var _isFlattenable=isFlattenable$1,arrayPush=_arrayPush,isFlattenable=_isFlattenable;function baseFlatten$2(tt,et,nt,it,rt){var ot=-1,at=tt.length;for(nt||(nt=isFlattenable),rt||(rt=[]);++ot0&&nt(st)?et>1?baseFlatten$2(st,et-1,nt,it,rt):arrayPush(rt,st):it||(rt[rt.length]=st)}return rt}var _baseFlatten=baseFlatten$2;function createBaseFor$1(tt){return function(et,nt,it){for(var rt=-1,ot=Object(et),at=it(et),st=at.length;st--;){var lt=at[tt?st:++rt];if(nt(ot[lt],lt,ot)===!1)break}return et}}var _createBaseFor=createBaseFor$1,createBaseFor=_createBaseFor,baseFor$1=createBaseFor(),_baseFor=baseFor$1,baseFor=_baseFor,keys$3=keys_1;function baseForOwn$2(tt,et){return tt&&baseFor(tt,et,keys$3)}var _baseForOwn=baseForOwn$2,isArrayLike$3=isArrayLike_1;function createBaseEach$1(tt,et){return function(nt,it){if(nt==null)return nt;if(!isArrayLike$3(nt))return tt(nt,it);for(var rt=nt.length,ot=et?rt:-1,at=Object(nt);(et?ot--:++otet||ot&&at&<&&!st&&!ct||it&&at&<||!nt&<||!rt)return 1;if(!it&&!ot&&!ct&&tt=st)return lt;var ct=nt[it];return lt*(ct=="desc"?-1:1)}}return tt.index-et.index}var _compareMultiple=compareMultiple$1,arrayMap$1=_arrayMap,baseGet=_baseGet,baseIteratee$6=_baseIteratee,baseMap$1=_baseMap,baseSortBy=_baseSortBy,baseUnary=_baseUnary,compareMultiple=_compareMultiple,identity$b=identity_1,isArray$5=isArray_1;function baseOrderBy$1(tt,et,nt){et.length?et=arrayMap$1(et,function(ot){return isArray$5(ot)?function(at){return baseGet(at,ot.length===1?ot[0]:ot)}:ot}):et=[identity$b];var it=-1;et=arrayMap$1(et,baseUnary(baseIteratee$6));var rt=baseMap$1(tt,function(ot,at,st){var lt=arrayMap$1(et,function(ct){return ct(ot)});return{criteria:lt,index:++it,value:ot}});return baseSortBy(rt,function(ot,at){return compareMultiple(ot,at,nt)})}var _baseOrderBy=baseOrderBy$1;function apply$1(tt,et,nt){switch(nt.length){case 0:return tt.call(et);case 1:return tt.call(et,nt[0]);case 2:return tt.call(et,nt[0],nt[1]);case 3:return tt.call(et,nt[0],nt[1],nt[2])}return tt.apply(et,nt)}var _apply=apply$1,apply=_apply,nativeMax$3=Math.max;function overRest$1(tt,et,nt){return et=nativeMax$3(et===void 0?tt.length-1:et,0),function(){for(var it=arguments,rt=-1,ot=nativeMax$3(it.length-et,0),at=Array(ot);++rt0){if(++et>=HOT_COUNT)return arguments[0]}else et=0;return tt.apply(void 0,arguments)}}var _shortOut=shortOut$1,baseSetToString=_baseSetToString,shortOut=_shortOut,setToString$1=shortOut(baseSetToString),_setToString=setToString$1,identity$9=identity_1,overRest=_overRest,setToString=_setToString;function baseRest$1(tt,et){return setToString(overRest(tt,et,identity$9),tt+"")}var _baseRest=baseRest$1,eq=eq_1,isArrayLike$1=isArrayLike_1,isIndex=_isIndex,isObject$3=isObject_1;function isIterateeCall$4(tt,et,nt){if(!isObject$3(nt))return!1;var it=typeof et;return(it=="number"?isArrayLike$1(nt)&&isIndex(et,nt.length):it=="string"&&et in nt)?eq(nt[et],tt):!1}var _isIterateeCall=isIterateeCall$4,baseFlatten$1=_baseFlatten,baseOrderBy=_baseOrderBy,baseRest=_baseRest,isIterateeCall$3=_isIterateeCall,sortBy=baseRest(function(tt,et){if(tt==null)return[];var nt=et.length;return nt>1&&isIterateeCall$3(tt,et[0],et[1])?et=[]:nt>2&&isIterateeCall$3(et[0],et[1],et[2])&&(et=[et[0]]),baseOrderBy(tt,baseFlatten$1(et,1),[])}),sortBy_1=sortBy;const sortBy$1=getDefaultExportFromCjs(sortBy_1);function _typeof$B(tt){"@babel/helpers - typeof";return _typeof$B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$B(tt)}function _slicedToArray$c(tt,et){return _arrayWithHoles$d(tt)||_iterableToArrayLimit$c(tt,et)||_unsupportedIterableToArray$m(tt,et)||_nonIterableRest$d()}function _nonIterableRest$d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$m(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$m(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$m(tt,et)}}function _arrayLikeToArray$m(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0;)if(!nt.equals(tt[it],et[it],it,it,tt,et,nt))return!1;return!0}function areDatesEqual(tt,et){return sameValueZeroEqual(tt.getTime(),et.getTime())}function areMapsEqual(tt,et,nt){if(tt.size!==et.size)return!1;for(var it={},rt=tt.entries(),ot=0,at,st;(at=rt.next())&&!at.done;){for(var lt=et.entries(),ct=!1,ut=0;(st=lt.next())&&!st.done;){var ht=at.value,dt=ht[0],pt=ht[1],mt=st.value,gt=mt[0],bt=mt[1];!ct&&!it[ut]&&(ct=nt.equals(dt,gt,ot,ut,tt,et,nt)&&nt.equals(pt,bt,dt,gt,tt,et,nt))&&(it[ut]=!0),ut++}if(!ct)return!1;ot++}return!0}function areObjectsEqual(tt,et,nt){var it=keys$2(tt),rt=it.length;if(keys$2(et).length!==rt)return!1;for(var ot;rt-- >0;)if(ot=it[rt],ot===OWNER&&(tt.$$typeof||et.$$typeof)&&tt.$$typeof!==et.$$typeof||!hasOwn$1(et,ot)||!nt.equals(tt[ot],et[ot],ot,ot,tt,et,nt))return!1;return!0}function areObjectsEqualStrict(tt,et,nt){var it=getStrictProperties(tt),rt=it.length;if(getStrictProperties(et).length!==rt)return!1;for(var ot,at,st;rt-- >0;)if(ot=it[rt],ot===OWNER&&(tt.$$typeof||et.$$typeof)&&tt.$$typeof!==et.$$typeof||!hasOwn$1(et,ot)||!nt.equals(tt[ot],et[ot],ot,ot,tt,et,nt)||(at=getOwnPropertyDescriptor(tt,ot),st=getOwnPropertyDescriptor(et,ot),(at||st)&&(!at||!st||at.configurable!==st.configurable||at.enumerable!==st.enumerable||at.writable!==st.writable)))return!1;return!0}function arePrimitiveWrappersEqual(tt,et){return sameValueZeroEqual(tt.valueOf(),et.valueOf())}function areRegExpsEqual(tt,et){return tt.source===et.source&&tt.flags===et.flags}function areSetsEqual(tt,et,nt){if(tt.size!==et.size)return!1;for(var it={},rt=tt.values(),ot,at;(ot=rt.next())&&!ot.done;){for(var st=et.values(),lt=!1,ct=0;(at=st.next())&&!at.done;)!lt&&!it[ct]&&(lt=nt.equals(ot.value,at.value,ot.value,at.value,tt,et,nt))&&(it[ct]=!0),ct++;if(!lt)return!1}return!0}function areTypedArraysEqual(tt,et){var nt=tt.length;if(et.length!==nt)return!1;for(;nt-- >0;)if(tt[nt]!==et[nt])return!1;return!0}var ARGUMENTS_TAG="[object Arguments]",BOOLEAN_TAG="[object Boolean]",DATE_TAG="[object Date]",MAP_TAG="[object Map]",NUMBER_TAG="[object Number]",OBJECT_TAG="[object Object]",REG_EXP_TAG="[object RegExp]",SET_TAG="[object Set]",STRING_TAG="[object String]",isArray$4=Array.isArray,isTypedArray=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,assign=Object.assign,getTag=Object.prototype.toString.call.bind(Object.prototype.toString);function createEqualityComparator(tt){var et=tt.areArraysEqual,nt=tt.areDatesEqual,it=tt.areMapsEqual,rt=tt.areObjectsEqual,ot=tt.arePrimitiveWrappersEqual,at=tt.areRegExpsEqual,st=tt.areSetsEqual,lt=tt.areTypedArraysEqual;return function(ut,ht,dt){if(ut===ht)return!0;if(ut==null||ht==null||typeof ut!="object"||typeof ht!="object")return ut!==ut&&ht!==ht;var pt=ut.constructor;if(pt!==ht.constructor)return!1;if(pt===Object)return rt(ut,ht,dt);if(isArray$4(ut))return et(ut,ht,dt);if(isTypedArray!=null&&isTypedArray(ut))return lt(ut,ht,dt);if(pt===Date)return nt(ut,ht,dt);if(pt===RegExp)return at(ut,ht,dt);if(pt===Map)return it(ut,ht,dt);if(pt===Set)return st(ut,ht,dt);var mt=getTag(ut);return mt===DATE_TAG?nt(ut,ht,dt):mt===REG_EXP_TAG?at(ut,ht,dt):mt===MAP_TAG?it(ut,ht,dt):mt===SET_TAG?st(ut,ht,dt):mt===OBJECT_TAG?typeof ut.then!="function"&&typeof ht.then!="function"&&rt(ut,ht,dt):mt===ARGUMENTS_TAG?rt(ut,ht,dt):mt===BOOLEAN_TAG||mt===NUMBER_TAG||mt===STRING_TAG?ot(ut,ht,dt):!1}}function createEqualityComparatorConfig(tt){var et=tt.circular,nt=tt.createCustomConfig,it=tt.strict,rt={areArraysEqual:it?areObjectsEqualStrict:areArraysEqual,areDatesEqual,areMapsEqual:it?combineComparators(areMapsEqual,areObjectsEqualStrict):areMapsEqual,areObjectsEqual:it?areObjectsEqualStrict:areObjectsEqual,arePrimitiveWrappersEqual,areRegExpsEqual,areSetsEqual:it?combineComparators(areSetsEqual,areObjectsEqualStrict):areSetsEqual,areTypedArraysEqual:it?areObjectsEqualStrict:areTypedArraysEqual};if(nt&&(rt=assign({},rt,nt(rt))),et){var ot=createIsCircular(rt.areArraysEqual),at=createIsCircular(rt.areMapsEqual),st=createIsCircular(rt.areObjectsEqual),lt=createIsCircular(rt.areSetsEqual);rt=assign({},rt,{areArraysEqual:ot,areMapsEqual:at,areObjectsEqual:st,areSetsEqual:lt})}return rt}function createInternalEqualityComparator(tt){return function(et,nt,it,rt,ot,at,st){return tt(et,nt,st)}}function createIsEqual(tt){var et=tt.circular,nt=tt.comparator,it=tt.createState,rt=tt.equals,ot=tt.strict;if(it)return function(lt,ct){var ut=it(),ht=ut.cache,dt=ht===void 0?et?new WeakMap:void 0:ht,pt=ut.meta;return nt(lt,ct,{cache:dt,equals:rt,meta:pt,strict:ot})};if(et)return function(lt,ct){return nt(lt,ct,{cache:new WeakMap,equals:rt,meta:void 0,strict:ot})};var at={cache:void 0,equals:rt,meta:void 0,strict:ot};return function(lt,ct){return nt(lt,ct,at)}}var deepEqual=createCustomEqual();createCustomEqual({strict:!0});createCustomEqual({circular:!0});createCustomEqual({circular:!0,strict:!0});createCustomEqual({createInternalComparator:function(){return sameValueZeroEqual}});createCustomEqual({strict:!0,createInternalComparator:function(){return sameValueZeroEqual}});createCustomEqual({circular:!0,createInternalComparator:function(){return sameValueZeroEqual}});createCustomEqual({circular:!0,createInternalComparator:function(){return sameValueZeroEqual},strict:!0});function createCustomEqual(tt){tt===void 0&&(tt={});var et=tt.circular,nt=et===void 0?!1:et,it=tt.createInternalComparator,rt=tt.createState,ot=tt.strict,at=ot===void 0?!1:ot,st=createEqualityComparatorConfig(tt),lt=createEqualityComparator(st),ct=it?it(lt):createInternalEqualityComparator(lt);return createIsEqual({circular:nt,comparator:lt,createState:rt,equals:ct,strict:at})}function safeRequestAnimationFrame(tt){typeof requestAnimationFrame<"u"&&requestAnimationFrame(tt)}function setRafTimeout(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,nt=-1,it=function rt(ot){nt<0&&(nt=ot),ot-nt>et?(tt(ot),nt=-1):safeRequestAnimationFrame(rt)};requestAnimationFrame(it)}function _typeof$A(tt){"@babel/helpers - typeof";return _typeof$A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$A(tt)}function _toArray(tt){return _arrayWithHoles$c(tt)||_iterableToArray$c(tt)||_unsupportedIterableToArray$l(tt)||_nonIterableRest$c()}function _nonIterableRest$c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$l(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$l(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$l(tt,et)}}function _arrayLikeToArray$l(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nttt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt1?1:yt<0?0:yt},gt=function(yt){for(var wt=yt>1?1:yt,vt=wt,xt=0;xt<8;++xt){var St=ht(vt)-wt,Et=pt(vt);if(Math.abs(St-wt)0&&arguments[0]!==void 0?arguments[0]:{},nt=et.stiff,it=nt===void 0?100:nt,rt=et.damping,ot=rt===void 0?8:rt,at=et.dt,st=at===void 0?17:at,lt=function(ut,ht,dt){var pt=-(ut-ht)*it,mt=dt*ot,gt=dt+(pt-mt)*st/1e3,bt=dt*st/1e3+ut;return Math.abs(bt-ht)tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$d(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _toConsumableArray$9(tt){return _arrayWithoutHoles$9(tt)||_iterableToArray$9(tt)||_unsupportedIterableToArray$i(tt)||_nonIterableSpread$9()}function _nonIterableSpread$9(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$i(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$i(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$i(tt,et)}}function _iterableToArray$9(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$9(tt){if(Array.isArray(tt))return _arrayLikeToArray$i(tt)}function _arrayLikeToArray$i(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$a(tt){return _getPrototypeOf$a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$a(tt)}var Animate=function(tt){_inherits$a(nt,tt);var et=_createSuper$a(nt);function nt(it,rt){var ot;_classCallCheck$d(this,nt),ot=et.call(this,it,rt);var at=ot.props,st=at.isActive,lt=at.attributeName,ct=at.from,ut=at.to,ht=at.steps,dt=at.children,pt=at.duration;if(ot.handleStyleChange=ot.handleStyleChange.bind(_assertThisInitialized$a(ot)),ot.changeStyle=ot.changeStyle.bind(_assertThisInitialized$a(ot)),!st||pt<=0)return ot.state={style:{}},typeof dt=="function"&&(ot.state={style:ut}),_possibleConstructorReturn$a(ot);if(ht&&ht.length)ot.state={style:ht[0].style};else if(ct){if(typeof dt=="function")return ot.state={style:ct},_possibleConstructorReturn$a(ot);ot.state={style:lt?_defineProperty$w({},lt,ct):ct}}else ot.state={style:{}};return ot}return _createClass$d(nt,[{key:"componentDidMount",value:function(){var rt=this.props,ot=rt.isActive,at=rt.canBegin;this.mounted=!0,!(!ot||!at)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(rt){var ot=this.props,at=ot.isActive,st=ot.canBegin,lt=ot.attributeName,ct=ot.shouldReAnimate,ut=ot.to,ht=ot.from,dt=this.state.style;if(st){if(!at){var pt={style:lt?_defineProperty$w({},lt,ut):ut};this.state&&dt&&(lt&&dt[lt]!==ut||!lt&&dt!==ut)&&this.setState(pt);return}if(!(deepEqual(rt.to,ut)&&rt.canBegin&&rt.isActive)){var mt=!rt.canBegin||!rt.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var gt=mt||ct?ht:rt.to;if(this.state&&dt){var bt={style:lt?_defineProperty$w({},lt,gt):gt};(lt&&[lt]!==gt||!lt&&dt!==gt)&&this.setState(bt)}this.runAnimation(_objectSpread$u(_objectSpread$u({},this.props),{},{from:gt,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var rt=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),rt&&rt()}},{key:"handleStyleChange",value:function(rt){this.changeStyle(rt)}},{key:"changeStyle",value:function(rt){this.mounted&&this.setState({style:rt})}},{key:"runJSAnimation",value:function(rt){var ot=this,at=rt.from,st=rt.to,lt=rt.duration,ct=rt.easing,ut=rt.begin,ht=rt.onAnimationEnd,dt=rt.onAnimationStart,pt=configUpdate(at,st,configEasing(ct),lt,this.changeStyle),mt=function(){ot.stopJSAnimation=pt()};this.manager.start([dt,ut,mt,lt,ht])}},{key:"runStepAnimation",value:function(rt){var ot=this,at=rt.steps,st=rt.begin,lt=rt.onAnimationStart,ct=at[0],ut=ct.style,ht=ct.duration,dt=ht===void 0?0:ht,pt=function(gt,bt,yt){if(yt===0)return gt;var wt=bt.duration,vt=bt.easing,xt=vt===void 0?"ease":vt,St=bt.style,Et=bt.properties,It=bt.onAnimationEnd,Tt=yt>0?at[yt-1]:bt,$t=Et||Object.keys(St);if(typeof xt=="function"||xt==="spring")return[].concat(_toConsumableArray$9(gt),[ot.runJSAnimation.bind(ot,{from:Tt.style,to:St,duration:wt,easing:xt}),wt]);var Ut=getTransitionVal($t,wt,xt),Lt=_objectSpread$u(_objectSpread$u(_objectSpread$u({},Tt.style),St),{},{transition:Ut});return[].concat(_toConsumableArray$9(gt),[Lt,wt,It]).filter(identity$8)};return this.manager.start([lt].concat(_toConsumableArray$9(at.reduce(pt,[ut,Math.max(dt,st)])),[rt.onAnimationEnd]))}},{key:"runAnimation",value:function(rt){this.manager||(this.manager=createAnimateManager());var ot=rt.begin,at=rt.duration,st=rt.attributeName,lt=rt.to,ct=rt.easing,ut=rt.onAnimationStart,ht=rt.onAnimationEnd,dt=rt.steps,pt=rt.children,mt=this.manager;if(this.unSubscribe=mt.subscribe(this.handleStyleChange),typeof ct=="function"||typeof pt=="function"||ct==="spring"){this.runJSAnimation(rt);return}if(dt.length>1){this.runStepAnimation(rt);return}var gt=st?_defineProperty$w({},st,lt):lt,bt=getTransitionVal(Object.keys(gt),at,ct);mt.start([ut,ot,_objectSpread$u(_objectSpread$u({},gt),{},{transition:bt}),at,ht])}},{key:"render",value:function(){var rt=this.props,ot=rt.children;rt.begin;var at=rt.duration;rt.attributeName,rt.easing;var st=rt.isActive;rt.steps,rt.from,rt.to,rt.canBegin,rt.onAnimationEnd,rt.shouldReAnimate,rt.onAnimationReStart;var lt=_objectWithoutProperties$d(rt,_excluded$d),ct=reactExports.Children.count(ot),ut=translateStyle(this.state.style);if(typeof ot=="function")return ot(ut);if(!st||ct===0||at<=0)return ot;var ht=function(pt){var mt=pt.props,gt=mt.style,bt=gt===void 0?{}:gt,yt=mt.className,wt=reactExports.cloneElement(pt,_objectSpread$u(_objectSpread$u({},lt),{},{style:_objectSpread$u(_objectSpread$u({},bt),ut),className:yt}));return wt};return ct===1?ht(reactExports.Children.only(ot)):React$1.createElement("div",null,reactExports.Children.map(ot,function(dt){return ht(dt)}))}}]),nt}(reactExports.PureComponent);Animate.displayName="Animate";Animate.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function tt(){},onAnimationStart:function tt(){}};Animate.propTypes={from:PropTypes.oneOfType([PropTypes.object,PropTypes.string]),to:PropTypes.oneOfType([PropTypes.object,PropTypes.string]),attributeName:PropTypes.string,duration:PropTypes.number,begin:PropTypes.number,easing:PropTypes.oneOfType([PropTypes.string,PropTypes.func]),steps:PropTypes.arrayOf(PropTypes.shape({duration:PropTypes.number.isRequired,style:PropTypes.object.isRequired,easing:PropTypes.oneOfType([PropTypes.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),PropTypes.func]),properties:PropTypes.arrayOf("string"),onAnimationEnd:PropTypes.func})),children:PropTypes.oneOfType([PropTypes.node,PropTypes.func]),isActive:PropTypes.bool,canBegin:PropTypes.bool,onAnimationEnd:PropTypes.func,shouldReAnimate:PropTypes.bool,onAnimationStart:PropTypes.func,onAnimationReStart:PropTypes.func};Number.isFinite===void 0&&(Number.isFinite=function(tt){return typeof tt=="number"&&isFinite(tt)});PropTypes.object,PropTypes.object,PropTypes.object,PropTypes.element;PropTypes.object,PropTypes.object,PropTypes.object,PropTypes.oneOfType([PropTypes.array,PropTypes.element]),PropTypes.any;function _typeof$w(tt){"@babel/helpers - typeof";return _typeof$w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$w(tt)}function _defineProperty$v(tt,et,nt){return et=_toPropertyKey$v(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$v(tt){var et=_toPrimitive$v(tt,"string");return _typeof$w(et)==="symbol"?et:String(et)}function _toPrimitive$v(tt,et){if(_typeof$w(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$w(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var CSS_CLASS_PREFIX="recharts-tooltip-wrapper",TOOLTIP_HIDDEN={visibility:"hidden"};function getTooltipCSSClassName(tt){var et,nt=tt.coordinate,it=tt.translateX,rt=tt.translateY;return clsx(CSS_CLASS_PREFIX,(et={},_defineProperty$v(et,"".concat(CSS_CLASS_PREFIX,"-right"),isNumber(it)&&nt&&isNumber(nt.x)&&it>=nt.x),_defineProperty$v(et,"".concat(CSS_CLASS_PREFIX,"-left"),isNumber(it)&&nt&&isNumber(nt.x)&&it=nt.y),_defineProperty$v(et,"".concat(CSS_CLASS_PREFIX,"-top"),isNumber(rt)&&nt&&isNumber(nt.y)&&rtgt?Math.max(ut,lt[it]):Math.max(ht,lt[it])}function getTransformStyle(tt){var et=tt.translateX,nt=tt.translateY,it=tt.useTranslate3d;return translateStyle({transform:it?"translate3d(".concat(et,"px, ").concat(nt,"px, 0)"):"translate(".concat(et,"px, ").concat(nt,"px)")})}function getTooltipTranslate(tt){var et=tt.allowEscapeViewBox,nt=tt.coordinate,it=tt.offsetTopLeft,rt=tt.position,ot=tt.reverseDirection,at=tt.tooltipBox,st=tt.useTranslate3d,lt=tt.viewBox,ct,ut,ht;return at.height>0&&at.width>0&&nt?(ut=getTooltipTranslateXY({allowEscapeViewBox:et,coordinate:nt,key:"x",offsetTopLeft:it,position:rt,reverseDirection:ot,tooltipDimension:at.width,viewBox:lt,viewBoxDimension:lt.width}),ht=getTooltipTranslateXY({allowEscapeViewBox:et,coordinate:nt,key:"y",offsetTopLeft:it,position:rt,reverseDirection:ot,tooltipDimension:at.height,viewBox:lt,viewBoxDimension:lt.height}),ct=getTransformStyle({translateX:ut,translateY:ht,useTranslate3d:st})):ct=TOOLTIP_HIDDEN,{cssProperties:ct,cssClasses:getTooltipCSSClassName({translateX:ut,translateY:ht,coordinate:nt})}}function _typeof$v(tt){"@babel/helpers - typeof";return _typeof$v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$v(tt)}function ownKeys$t(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$t(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$9(tt){return _getPrototypeOf$9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$9(tt)}function _defineProperty$u(tt,et,nt){return et=_toPropertyKey$u(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$u(tt){var et=_toPrimitive$u(tt,"string");return _typeof$v(et)==="symbol"?et:String(et)}function _toPrimitive$u(tt,et){if(_typeof$v(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$v(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var EPSILON=1,TooltipBoundingBox=function(tt){_inherits$9(nt,tt);var et=_createSuper$9(nt);function nt(){var it;_classCallCheck$c(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;atEPSILON||Math.abs(rt.height-this.lastBoundingBox.height)>EPSILON)&&(this.lastBoundingBox.width=rt.width,this.lastBoundingBox.height=rt.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var rt,ot;this.props.active&&this.updateBBox(),this.state.dismissed&&(((rt=this.props.coordinate)===null||rt===void 0?void 0:rt.x)!==this.state.dismissedAtCoordinate.x||((ot=this.props.coordinate)===null||ot===void 0?void 0:ot.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var rt=this,ot=this.props,at=ot.active,st=ot.allowEscapeViewBox,lt=ot.animationDuration,ct=ot.animationEasing,ut=ot.children,ht=ot.coordinate,dt=ot.hasPayload,pt=ot.isAnimationActive,mt=ot.offset,gt=ot.position,bt=ot.reverseDirection,yt=ot.useTranslate3d,wt=ot.viewBox,vt=ot.wrapperStyle,xt=getTooltipTranslate({allowEscapeViewBox:st,coordinate:ht,offsetTopLeft:mt,position:gt,reverseDirection:bt,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:yt,viewBox:wt}),St=xt.cssClasses,Et=xt.cssProperties,It=_objectSpread$t(_objectSpread$t(_objectSpread$t({},pt&&at&&translateStyle({transition:"transform ".concat(lt,"ms ").concat(ct)})),Et),{},{pointerEvents:"none",visibility:!this.state.dismissed&&at&&dt?"visible":"hidden",position:"absolute",top:0,left:0},vt);return React$1.createElement("div",{tabIndex:-1,role:"dialog",className:St,style:It,ref:function($t){rt.wrapperNode=$t}},ut)}}]),nt}(reactExports.PureComponent),parseIsSsrByDefault=function tt(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Global={isSsr:parseIsSsrByDefault(),get:function tt(et){return Global[et]},set:function tt(et,nt){if(typeof et=="string")Global[et]=nt;else{var it=Object.keys(et);it&&it.length&&it.forEach(function(rt){Global[rt]=et[rt]})}}};function _typeof$u(tt){"@babel/helpers - typeof";return _typeof$u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$u(tt)}function ownKeys$s(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$s(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$8(tt){return _getPrototypeOf$8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$8(tt)}function _defineProperty$t(tt,et,nt){return et=_toPropertyKey$t(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$t(tt){var et=_toPrimitive$t(tt,"string");return _typeof$u(et)==="symbol"?et:String(et)}function _toPrimitive$t(tt,et){if(_typeof$u(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$u(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function defaultUniqBy(tt){return tt.dataKey}function renderContent(tt,et){return React$1.isValidElement(tt)?React$1.cloneElement(tt,et):typeof tt=="function"?React$1.createElement(tt,et):React$1.createElement(DefaultTooltipContent,et)}var Tooltip=function(tt){_inherits$8(nt,tt);var et=_createSuper$8(nt);function nt(){return _classCallCheck$b(this,nt),et.apply(this,arguments)}return _createClass$b(nt,[{key:"render",value:function(){var rt=this.props,ot=rt.active,at=rt.allowEscapeViewBox,st=rt.animationDuration,lt=rt.animationEasing,ct=rt.content,ut=rt.coordinate,ht=rt.filterNull,dt=rt.isAnimationActive,pt=rt.offset,mt=rt.payload,gt=rt.payloadUniqBy,bt=rt.position,yt=rt.reverseDirection,wt=rt.useTranslate3d,vt=rt.viewBox,xt=rt.wrapperStyle,St=mt??[];ht&&St.length&&(St=getUniqPayload(mt.filter(function(It){return It.value!=null}),gt,defaultUniqBy));var Et=St.length>0;return React$1.createElement(TooltipBoundingBox,{allowEscapeViewBox:at,animationDuration:st,animationEasing:lt,isAnimationActive:dt,active:ot,coordinate:ut,hasPayload:Et,offset:pt,position:bt,reverseDirection:yt,useTranslate3d:wt,viewBox:vt,wrapperStyle:xt},renderContent(ct,_objectSpread$s(_objectSpread$s({},this.props),{},{payload:St})))}}]),nt}(reactExports.PureComponent);_defineProperty$t(Tooltip,"displayName","Tooltip");_defineProperty$t(Tooltip,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Global.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var root$3=_root,now$1=function(){return root$3.Date.now()},now_1=now$1,reWhitespace=/\s/;function trimmedEndIndex$1(tt){for(var et=tt.length;et--&&reWhitespace.test(tt.charAt(et)););return et}var _trimmedEndIndex=trimmedEndIndex$1,trimmedEndIndex=_trimmedEndIndex,reTrimStart=/^\s+/;function baseTrim$1(tt){return tt&&tt.slice(0,trimmedEndIndex(tt)+1).replace(reTrimStart,"")}var _baseTrim=baseTrim$1,baseTrim=_baseTrim,isObject$2=isObject_1,isSymbol$1=isSymbol_1,NAN=0/0,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber$2(tt){if(typeof tt=="number")return tt;if(isSymbol$1(tt))return NAN;if(isObject$2(tt)){var et=typeof tt.valueOf=="function"?tt.valueOf():tt;tt=isObject$2(et)?et+"":et}if(typeof tt!="string")return tt===0?tt:+tt;tt=baseTrim(tt);var nt=reIsBinary.test(tt);return nt||reIsOctal.test(tt)?freeParseInt(tt.slice(2),nt?2:8):reIsBadHex.test(tt)?NAN:+tt}var toNumber_1=toNumber$2,isObject$1=isObject_1,now=now_1,toNumber$1=toNumber_1,FUNC_ERROR_TEXT$1="Expected a function",nativeMax$2=Math.max,nativeMin=Math.min;function debounce$1(tt,et,nt){var it,rt,ot,at,st,lt,ct=0,ut=!1,ht=!1,dt=!0;if(typeof tt!="function")throw new TypeError(FUNC_ERROR_TEXT$1);et=toNumber$1(et)||0,isObject$1(nt)&&(ut=!!nt.leading,ht="maxWait"in nt,ot=ht?nativeMax$2(toNumber$1(nt.maxWait)||0,et):ot,dt="trailing"in nt?!!nt.trailing:dt);function pt(Et){var It=it,Tt=rt;return it=rt=void 0,ct=Et,at=tt.apply(Tt,It),at}function mt(Et){return ct=Et,st=setTimeout(yt,et),ut?pt(Et):at}function gt(Et){var It=Et-lt,Tt=Et-ct,$t=et-It;return ht?nativeMin($t,ot-Tt):$t}function bt(Et){var It=Et-lt,Tt=Et-ct;return lt===void 0||It>=et||It<0||ht&&Tt>=ot}function yt(){var Et=now();if(bt(Et))return wt(Et);st=setTimeout(yt,gt(Et))}function wt(Et){return st=void 0,dt&&it?pt(Et):(it=rt=void 0,at)}function vt(){st!==void 0&&clearTimeout(st),ct=0,it=lt=rt=st=void 0}function xt(){return st===void 0?at:wt(now())}function St(){var Et=now(),It=bt(Et);if(it=arguments,rt=this,lt=Et,It){if(st===void 0)return mt(lt);if(ht)return clearTimeout(st),st=setTimeout(yt,et),pt(lt)}return st===void 0&&(st=setTimeout(yt,et)),at}return St.cancel=vt,St.flush=xt,St}var debounce_1=debounce$1,debounce=debounce_1,isObject=isObject_1,FUNC_ERROR_TEXT="Expected a function";function throttle(tt,et,nt){var it=!0,rt=!0;if(typeof tt!="function")throw new TypeError(FUNC_ERROR_TEXT);return isObject(nt)&&(it="leading"in nt?!!nt.leading:it,rt="trailing"in nt?!!nt.trailing:rt),debounce(tt,et,{leading:it,maxWait:et,trailing:rt})}var throttle_1=throttle;const throttle$1=getDefaultExportFromCjs(throttle_1);function _typeof$t(tt){"@babel/helpers - typeof";return _typeof$t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$t(tt)}function ownKeys$r(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$r(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0&&(Pt=throttle$1(Pt,gt,{trailing:!0,leading:!1}));var kt=new ResizeObserver(Pt),At=St.current.getBoundingClientRect(),Rt=At.width,Wt=At.height;return Lt(Rt,Wt),kt.observe(St.current),function(){kt.disconnect()}},[Lt,gt]);var Bt=reactExports.useMemo(function(){var Pt=$t.containerWidth,kt=$t.containerHeight;if(Pt<0||kt<0)return null;warn(isPercent(at)||isPercent(lt),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,at,lt),warn(!nt||nt>0,"The aspect(%s) must be greater than zero.",nt);var At=isPercent(at)?Pt:at,Rt=isPercent(lt)?kt:lt;nt&&nt>0&&(At?Rt=At/nt:Rt&&(At=Rt*nt),dt&&Rt>dt&&(Rt=dt)),warn(At>0||Rt>0,`The width(%s) and height(%s) of chart should be greater than 0, + A`).concat(st,",").concat(st,",0,1,1,").concat(lt,",").concat(at),className:"recharts-legend-icon"});if(rt.type==="rect")return React$1.createElement("path",{stroke:"none",fill:ct,d:"M0,".concat(SIZE/8,"h").concat(SIZE,"v").concat(SIZE*3/4,"h").concat(-SIZE,"z"),className:"recharts-legend-icon"});if(React$1.isValidElement(rt.legendIcon)){var ut=_objectSpread$y({},rt);return delete ut.legendIcon,React$1.cloneElement(rt.legendIcon,ut)}return React$1.createElement(Symbols,{fill:ct,cx:at,cy:at,size:SIZE,sizeType:"diameter",type:rt.type})}},{key:"renderItems",value:function(){var rt=this,ot=this.props,at=ot.payload,st=ot.iconSize,lt=ot.layout,ct=ot.formatter,ut=ot.inactiveColor,ht={x:0,y:0,width:SIZE,height:SIZE},dt={display:lt==="horizontal"?"inline-block":"block",marginRight:10},pt={display:"inline-block",verticalAlign:"middle",marginRight:4};return at.map(function(mt,gt){var bt,yt=mt.formatter||ct,wt=clsx((bt={"recharts-legend-item":!0},_defineProperty$A(bt,"legend-item-".concat(gt),!0),_defineProperty$A(bt,"inactive",mt.inactive),bt));if(mt.type==="none")return null;var vt=isFunction$4(mt.value)?null:mt.value;warn(!isFunction$4(mt.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var xt=mt.inactive?ut:mt.color;return React$1.createElement("li",_extends$m({className:wt,style:dt,key:"legend-item-".concat(gt)},adaptEventsOfChild(rt.props,mt,gt)),React$1.createElement(Surface,{width:st,height:st,viewBox:ht,style:pt},rt.renderIcon(mt)),React$1.createElement("span",{className:"recharts-legend-item-text",style:{color:xt}},yt?yt(vt,mt,gt):vt))})}},{key:"render",value:function(){var rt=this.props,ot=rt.payload,at=rt.layout,st=rt.align;if(!ot||!ot.length)return null;var lt={padding:0,margin:0,textAlign:at==="horizontal"?st:"left"};return React$1.createElement("ul",{className:"recharts-default-legend",style:lt},this.renderItems())}}]),nt}(reactExports.PureComponent);_defineProperty$A(DefaultLegendContent,"displayName","Legend");_defineProperty$A(DefaultLegendContent,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(tt){return this.__data__.set(tt,HASH_UNDEFINED),this}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(tt){return this.__data__.has(tt)}var _setCacheHas=setCacheHas$1,MapCache=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$2(tt){var et=-1,nt=tt==null?0:tt.length;for(this.__data__=new MapCache;++etst))return!1;var ct=ot.get(tt),ut=ot.get(et);if(ct&&ut)return ct==et&&ut==tt;var ht=-1,dt=!0,pt=nt&COMPARE_UNORDERED_FLAG$3?new SetCache$1:void 0;for(ot.set(tt,et),ot.set(et,tt);++ht-1}var _arrayIncludes=arrayIncludes$1;function arrayIncludesWith$1(tt,et,nt){for(var it=-1,rt=tt==null?0:tt.length;++it=LARGE_ARRAY_SIZE){var ct=et?null:createSet(tt);if(ct)return setToArray(ct);at=!1,rt=cacheHas,lt=new SetCache}else lt=et?[]:st;e:for(;++it"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$a(tt){return _getPrototypeOf$a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$a(tt)}function _defineProperty$z(tt,et,nt){return et=_toPropertyKey$A(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$A(tt){var et=_toPrimitive$A(tt,"string");return _typeof$B(et)==="symbol"?et:String(et)}function _toPrimitive$A(tt,et){if(_typeof$B(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$B(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function _objectWithoutProperties$e(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$e(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$e(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function defaultUniqBy$1(tt){return tt.value}function renderContent$1(tt,et){if(React$1.isValidElement(tt))return React$1.cloneElement(tt,et);if(typeof tt=="function")return React$1.createElement(tt,et);et.ref;var nt=_objectWithoutProperties$e(et,_excluded$e);return React$1.createElement(DefaultLegendContent,nt)}var EPS$1=1,Legend=function(tt){_inherits$a(nt,tt);var et=_createSuper$a(nt);function nt(){var it;_classCallCheck$d(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;atEPS$1||Math.abs(ot.height-this.lastBoundingBox.height)>EPS$1)&&(this.lastBoundingBox.width=ot.width,this.lastBoundingBox.height=ot.height,rt&&rt(ot))}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,rt&&rt(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?_objectSpread$x({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(rt){var ot=this.props,at=ot.layout,st=ot.align,lt=ot.verticalAlign,ct=ot.margin,ut=ot.chartWidth,ht=ot.chartHeight,dt,pt;if(!rt||(rt.left===void 0||rt.left===null)&&(rt.right===void 0||rt.right===null))if(st==="center"&&at==="vertical"){var mt=this.getBBoxSnapshot();dt={left:((ut||0)-mt.width)/2}}else dt=st==="right"?{right:ct&&ct.right||0}:{left:ct&&ct.left||0};if(!rt||(rt.top===void 0||rt.top===null)&&(rt.bottom===void 0||rt.bottom===null))if(lt==="middle"){var gt=this.getBBoxSnapshot();pt={top:((ht||0)-gt.height)/2}}else pt=lt==="bottom"?{bottom:ct&&ct.bottom||0}:{top:ct&&ct.top||0};return _objectSpread$x(_objectSpread$x({},dt),pt)}},{key:"render",value:function(){var rt=this,ot=this.props,at=ot.content,st=ot.width,lt=ot.height,ct=ot.wrapperStyle,ut=ot.payloadUniqBy,ht=ot.payload,dt=_objectSpread$x(_objectSpread$x({position:"absolute",width:st||"auto",height:lt||"auto"},this.getDefaultPosition(ct)),ct);return React$1.createElement("div",{className:"recharts-legend-wrapper",style:dt,ref:function(mt){rt.wrapperNode=mt}},renderContent$1(at,_objectSpread$x(_objectSpread$x({},this.props),{},{payload:getUniqPayload(ht,ut,defaultUniqBy$1)})))}}],[{key:"getWithHeight",value:function(rt,ot){var at=rt.props.layout;return at==="vertical"&&isNumber(rt.props.height)?{height:rt.props.height}:at==="horizontal"?{width:rt.props.width||ot}:null}}]),nt}(reactExports.PureComponent);_defineProperty$z(Legend,"displayName","Legend");_defineProperty$z(Legend,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Symbol$1=_Symbol,isArguments=isArguments_1,isArray$6=isArray_1,spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable$1(tt){return isArray$6(tt)||isArguments(tt)||!!(spreadableSymbol&&tt&&tt[spreadableSymbol])}var _isFlattenable=isFlattenable$1,arrayPush=_arrayPush,isFlattenable=_isFlattenable;function baseFlatten$2(tt,et,nt,it,rt){var ot=-1,at=tt.length;for(nt||(nt=isFlattenable),rt||(rt=[]);++ot0&&nt(st)?et>1?baseFlatten$2(st,et-1,nt,it,rt):arrayPush(rt,st):it||(rt[rt.length]=st)}return rt}var _baseFlatten=baseFlatten$2;function createBaseFor$1(tt){return function(et,nt,it){for(var rt=-1,ot=Object(et),at=it(et),st=at.length;st--;){var lt=at[tt?st:++rt];if(nt(ot[lt],lt,ot)===!1)break}return et}}var _createBaseFor=createBaseFor$1,createBaseFor=_createBaseFor,baseFor$1=createBaseFor(),_baseFor=baseFor$1,baseFor=_baseFor,keys$3=keys_1;function baseForOwn$2(tt,et){return tt&&baseFor(tt,et,keys$3)}var _baseForOwn=baseForOwn$2,isArrayLike$3=isArrayLike_1;function createBaseEach$1(tt,et){return function(nt,it){if(nt==null)return nt;if(!isArrayLike$3(nt))return tt(nt,it);for(var rt=nt.length,ot=et?rt:-1,at=Object(nt);(et?ot--:++otet||ot&&at&<&&!st&&!ct||it&&at&<||!nt&<||!rt)return 1;if(!it&&!ot&&!ct&&tt=st)return lt;var ct=nt[it];return lt*(ct=="desc"?-1:1)}}return tt.index-et.index}var _compareMultiple=compareMultiple$1,arrayMap$1=_arrayMap,baseGet=_baseGet,baseIteratee$6=_baseIteratee,baseMap$1=_baseMap,baseSortBy=_baseSortBy,baseUnary=_baseUnary,compareMultiple=_compareMultiple,identity$b=identity_1,isArray$5=isArray_1;function baseOrderBy$1(tt,et,nt){et.length?et=arrayMap$1(et,function(ot){return isArray$5(ot)?function(at){return baseGet(at,ot.length===1?ot[0]:ot)}:ot}):et=[identity$b];var it=-1;et=arrayMap$1(et,baseUnary(baseIteratee$6));var rt=baseMap$1(tt,function(ot,at,st){var lt=arrayMap$1(et,function(ct){return ct(ot)});return{criteria:lt,index:++it,value:ot}});return baseSortBy(rt,function(ot,at){return compareMultiple(ot,at,nt)})}var _baseOrderBy=baseOrderBy$1;function apply$1(tt,et,nt){switch(nt.length){case 0:return tt.call(et);case 1:return tt.call(et,nt[0]);case 2:return tt.call(et,nt[0],nt[1]);case 3:return tt.call(et,nt[0],nt[1],nt[2])}return tt.apply(et,nt)}var _apply=apply$1,apply=_apply,nativeMax$3=Math.max;function overRest$1(tt,et,nt){return et=nativeMax$3(et===void 0?tt.length-1:et,0),function(){for(var it=arguments,rt=-1,ot=nativeMax$3(it.length-et,0),at=Array(ot);++rt0){if(++et>=HOT_COUNT)return arguments[0]}else et=0;return tt.apply(void 0,arguments)}}var _shortOut=shortOut$1,baseSetToString=_baseSetToString,shortOut=_shortOut,setToString$1=shortOut(baseSetToString),_setToString=setToString$1,identity$9=identity_1,overRest=_overRest,setToString=_setToString;function baseRest$1(tt,et){return setToString(overRest(tt,et,identity$9),tt+"")}var _baseRest=baseRest$1,eq=eq_1,isArrayLike$1=isArrayLike_1,isIndex=_isIndex,isObject$3=isObject_1;function isIterateeCall$4(tt,et,nt){if(!isObject$3(nt))return!1;var it=typeof et;return(it=="number"?isArrayLike$1(nt)&&isIndex(et,nt.length):it=="string"&&et in nt)?eq(nt[et],tt):!1}var _isIterateeCall=isIterateeCall$4,baseFlatten$1=_baseFlatten,baseOrderBy=_baseOrderBy,baseRest=_baseRest,isIterateeCall$3=_isIterateeCall,sortBy=baseRest(function(tt,et){if(tt==null)return[];var nt=et.length;return nt>1&&isIterateeCall$3(tt,et[0],et[1])?et=[]:nt>2&&isIterateeCall$3(et[0],et[1],et[2])&&(et=[et[0]]),baseOrderBy(tt,baseFlatten$1(et,1),[])}),sortBy_1=sortBy;const sortBy$1=getDefaultExportFromCjs(sortBy_1);function _typeof$A(tt){"@babel/helpers - typeof";return _typeof$A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$A(tt)}function _slicedToArray$b(tt,et){return _arrayWithHoles$c(tt)||_iterableToArrayLimit$b(tt,et)||_unsupportedIterableToArray$j(tt,et)||_nonIterableRest$c()}function _nonIterableRest$c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$j(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$j(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$j(tt,et)}}function _arrayLikeToArray$j(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0;)if(!nt.equals(tt[it],et[it],it,it,tt,et,nt))return!1;return!0}function areDatesEqual(tt,et){return sameValueZeroEqual(tt.getTime(),et.getTime())}function areMapsEqual(tt,et,nt){if(tt.size!==et.size)return!1;for(var it={},rt=tt.entries(),ot=0,at,st;(at=rt.next())&&!at.done;){for(var lt=et.entries(),ct=!1,ut=0;(st=lt.next())&&!st.done;){var ht=at.value,dt=ht[0],pt=ht[1],mt=st.value,gt=mt[0],bt=mt[1];!ct&&!it[ut]&&(ct=nt.equals(dt,gt,ot,ut,tt,et,nt)&&nt.equals(pt,bt,dt,gt,tt,et,nt))&&(it[ut]=!0),ut++}if(!ct)return!1;ot++}return!0}function areObjectsEqual(tt,et,nt){var it=keys$2(tt),rt=it.length;if(keys$2(et).length!==rt)return!1;for(var ot;rt-- >0;)if(ot=it[rt],ot===OWNER&&(tt.$$typeof||et.$$typeof)&&tt.$$typeof!==et.$$typeof||!hasOwn$1(et,ot)||!nt.equals(tt[ot],et[ot],ot,ot,tt,et,nt))return!1;return!0}function areObjectsEqualStrict(tt,et,nt){var it=getStrictProperties(tt),rt=it.length;if(getStrictProperties(et).length!==rt)return!1;for(var ot,at,st;rt-- >0;)if(ot=it[rt],ot===OWNER&&(tt.$$typeof||et.$$typeof)&&tt.$$typeof!==et.$$typeof||!hasOwn$1(et,ot)||!nt.equals(tt[ot],et[ot],ot,ot,tt,et,nt)||(at=getOwnPropertyDescriptor(tt,ot),st=getOwnPropertyDescriptor(et,ot),(at||st)&&(!at||!st||at.configurable!==st.configurable||at.enumerable!==st.enumerable||at.writable!==st.writable)))return!1;return!0}function arePrimitiveWrappersEqual(tt,et){return sameValueZeroEqual(tt.valueOf(),et.valueOf())}function areRegExpsEqual(tt,et){return tt.source===et.source&&tt.flags===et.flags}function areSetsEqual(tt,et,nt){if(tt.size!==et.size)return!1;for(var it={},rt=tt.values(),ot,at;(ot=rt.next())&&!ot.done;){for(var st=et.values(),lt=!1,ct=0;(at=st.next())&&!at.done;)!lt&&!it[ct]&&(lt=nt.equals(ot.value,at.value,ot.value,at.value,tt,et,nt))&&(it[ct]=!0),ct++;if(!lt)return!1}return!0}function areTypedArraysEqual(tt,et){var nt=tt.length;if(et.length!==nt)return!1;for(;nt-- >0;)if(tt[nt]!==et[nt])return!1;return!0}var ARGUMENTS_TAG="[object Arguments]",BOOLEAN_TAG="[object Boolean]",DATE_TAG="[object Date]",MAP_TAG="[object Map]",NUMBER_TAG="[object Number]",OBJECT_TAG="[object Object]",REG_EXP_TAG="[object RegExp]",SET_TAG="[object Set]",STRING_TAG="[object String]",isArray$4=Array.isArray,isTypedArray=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,assign=Object.assign,getTag=Object.prototype.toString.call.bind(Object.prototype.toString);function createEqualityComparator(tt){var et=tt.areArraysEqual,nt=tt.areDatesEqual,it=tt.areMapsEqual,rt=tt.areObjectsEqual,ot=tt.arePrimitiveWrappersEqual,at=tt.areRegExpsEqual,st=tt.areSetsEqual,lt=tt.areTypedArraysEqual;return function(ut,ht,dt){if(ut===ht)return!0;if(ut==null||ht==null||typeof ut!="object"||typeof ht!="object")return ut!==ut&&ht!==ht;var pt=ut.constructor;if(pt!==ht.constructor)return!1;if(pt===Object)return rt(ut,ht,dt);if(isArray$4(ut))return et(ut,ht,dt);if(isTypedArray!=null&&isTypedArray(ut))return lt(ut,ht,dt);if(pt===Date)return nt(ut,ht,dt);if(pt===RegExp)return at(ut,ht,dt);if(pt===Map)return it(ut,ht,dt);if(pt===Set)return st(ut,ht,dt);var mt=getTag(ut);return mt===DATE_TAG?nt(ut,ht,dt):mt===REG_EXP_TAG?at(ut,ht,dt):mt===MAP_TAG?it(ut,ht,dt):mt===SET_TAG?st(ut,ht,dt):mt===OBJECT_TAG?typeof ut.then!="function"&&typeof ht.then!="function"&&rt(ut,ht,dt):mt===ARGUMENTS_TAG?rt(ut,ht,dt):mt===BOOLEAN_TAG||mt===NUMBER_TAG||mt===STRING_TAG?ot(ut,ht,dt):!1}}function createEqualityComparatorConfig(tt){var et=tt.circular,nt=tt.createCustomConfig,it=tt.strict,rt={areArraysEqual:it?areObjectsEqualStrict:areArraysEqual,areDatesEqual,areMapsEqual:it?combineComparators(areMapsEqual,areObjectsEqualStrict):areMapsEqual,areObjectsEqual:it?areObjectsEqualStrict:areObjectsEqual,arePrimitiveWrappersEqual,areRegExpsEqual,areSetsEqual:it?combineComparators(areSetsEqual,areObjectsEqualStrict):areSetsEqual,areTypedArraysEqual:it?areObjectsEqualStrict:areTypedArraysEqual};if(nt&&(rt=assign({},rt,nt(rt))),et){var ot=createIsCircular(rt.areArraysEqual),at=createIsCircular(rt.areMapsEqual),st=createIsCircular(rt.areObjectsEqual),lt=createIsCircular(rt.areSetsEqual);rt=assign({},rt,{areArraysEqual:ot,areMapsEqual:at,areObjectsEqual:st,areSetsEqual:lt})}return rt}function createInternalEqualityComparator(tt){return function(et,nt,it,rt,ot,at,st){return tt(et,nt,st)}}function createIsEqual(tt){var et=tt.circular,nt=tt.comparator,it=tt.createState,rt=tt.equals,ot=tt.strict;if(it)return function(lt,ct){var ut=it(),ht=ut.cache,dt=ht===void 0?et?new WeakMap:void 0:ht,pt=ut.meta;return nt(lt,ct,{cache:dt,equals:rt,meta:pt,strict:ot})};if(et)return function(lt,ct){return nt(lt,ct,{cache:new WeakMap,equals:rt,meta:void 0,strict:ot})};var at={cache:void 0,equals:rt,meta:void 0,strict:ot};return function(lt,ct){return nt(lt,ct,at)}}var deepEqual=createCustomEqual();createCustomEqual({strict:!0});createCustomEqual({circular:!0});createCustomEqual({circular:!0,strict:!0});createCustomEqual({createInternalComparator:function(){return sameValueZeroEqual}});createCustomEqual({strict:!0,createInternalComparator:function(){return sameValueZeroEqual}});createCustomEqual({circular:!0,createInternalComparator:function(){return sameValueZeroEqual}});createCustomEqual({circular:!0,createInternalComparator:function(){return sameValueZeroEqual},strict:!0});function createCustomEqual(tt){tt===void 0&&(tt={});var et=tt.circular,nt=et===void 0?!1:et,it=tt.createInternalComparator,rt=tt.createState,ot=tt.strict,at=ot===void 0?!1:ot,st=createEqualityComparatorConfig(tt),lt=createEqualityComparator(st),ct=it?it(lt):createInternalEqualityComparator(lt);return createIsEqual({circular:nt,comparator:lt,createState:rt,equals:ct,strict:at})}function safeRequestAnimationFrame(tt){typeof requestAnimationFrame<"u"&&requestAnimationFrame(tt)}function setRafTimeout(tt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,nt=-1,it=function rt(ot){nt<0&&(nt=ot),ot-nt>et?(tt(ot),nt=-1):safeRequestAnimationFrame(rt)};requestAnimationFrame(it)}function _typeof$z(tt){"@babel/helpers - typeof";return _typeof$z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$z(tt)}function _toArray(tt){return _arrayWithHoles$b(tt)||_iterableToArray$b(tt)||_unsupportedIterableToArray$i(tt)||_nonIterableRest$b()}function _nonIterableRest$b(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$i(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$i(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$i(tt,et)}}function _arrayLikeToArray$i(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nttt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt1?1:yt<0?0:yt},gt=function(yt){for(var wt=yt>1?1:yt,vt=wt,xt=0;xt<8;++xt){var St=ht(vt)-wt,Et=pt(vt);if(Math.abs(St-wt)0&&arguments[0]!==void 0?arguments[0]:{},nt=et.stiff,it=nt===void 0?100:nt,rt=et.damping,ot=rt===void 0?8:rt,at=et.dt,st=at===void 0?17:at,lt=function(ut,ht,dt){var pt=-(ut-ht)*it,mt=dt*ot,gt=dt+(pt-mt)*st/1e3,bt=dt*st/1e3+ut;return Math.abs(bt-ht)tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$d(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _toConsumableArray$8(tt){return _arrayWithoutHoles$8(tt)||_iterableToArray$8(tt)||_unsupportedIterableToArray$f(tt)||_nonIterableSpread$8()}function _nonIterableSpread$8(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$f(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$f(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$f(tt,et)}}function _iterableToArray$8(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$8(tt){if(Array.isArray(tt))return _arrayLikeToArray$f(tt)}function _arrayLikeToArray$f(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$9(tt){return _getPrototypeOf$9=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$9(tt)}var Animate=function(tt){_inherits$9(nt,tt);var et=_createSuper$9(nt);function nt(it,rt){var ot;_classCallCheck$c(this,nt),ot=et.call(this,it,rt);var at=ot.props,st=at.isActive,lt=at.attributeName,ct=at.from,ut=at.to,ht=at.steps,dt=at.children,pt=at.duration;if(ot.handleStyleChange=ot.handleStyleChange.bind(_assertThisInitialized$9(ot)),ot.changeStyle=ot.changeStyle.bind(_assertThisInitialized$9(ot)),!st||pt<=0)return ot.state={style:{}},typeof dt=="function"&&(ot.state={style:ut}),_possibleConstructorReturn$9(ot);if(ht&&ht.length)ot.state={style:ht[0].style};else if(ct){if(typeof dt=="function")return ot.state={style:ct},_possibleConstructorReturn$9(ot);ot.state={style:lt?_defineProperty$v({},lt,ct):ct}}else ot.state={style:{}};return ot}return _createClass$c(nt,[{key:"componentDidMount",value:function(){var rt=this.props,ot=rt.isActive,at=rt.canBegin;this.mounted=!0,!(!ot||!at)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(rt){var ot=this.props,at=ot.isActive,st=ot.canBegin,lt=ot.attributeName,ct=ot.shouldReAnimate,ut=ot.to,ht=ot.from,dt=this.state.style;if(st){if(!at){var pt={style:lt?_defineProperty$v({},lt,ut):ut};this.state&&dt&&(lt&&dt[lt]!==ut||!lt&&dt!==ut)&&this.setState(pt);return}if(!(deepEqual(rt.to,ut)&&rt.canBegin&&rt.isActive)){var mt=!rt.canBegin||!rt.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var gt=mt||ct?ht:rt.to;if(this.state&&dt){var bt={style:lt?_defineProperty$v({},lt,gt):gt};(lt&&[lt]!==gt||!lt&&dt!==gt)&&this.setState(bt)}this.runAnimation(_objectSpread$t(_objectSpread$t({},this.props),{},{from:gt,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var rt=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),rt&&rt()}},{key:"handleStyleChange",value:function(rt){this.changeStyle(rt)}},{key:"changeStyle",value:function(rt){this.mounted&&this.setState({style:rt})}},{key:"runJSAnimation",value:function(rt){var ot=this,at=rt.from,st=rt.to,lt=rt.duration,ct=rt.easing,ut=rt.begin,ht=rt.onAnimationEnd,dt=rt.onAnimationStart,pt=configUpdate(at,st,configEasing(ct),lt,this.changeStyle),mt=function(){ot.stopJSAnimation=pt()};this.manager.start([dt,ut,mt,lt,ht])}},{key:"runStepAnimation",value:function(rt){var ot=this,at=rt.steps,st=rt.begin,lt=rt.onAnimationStart,ct=at[0],ut=ct.style,ht=ct.duration,dt=ht===void 0?0:ht,pt=function(gt,bt,yt){if(yt===0)return gt;var wt=bt.duration,vt=bt.easing,xt=vt===void 0?"ease":vt,St=bt.style,Et=bt.properties,$t=bt.onAnimationEnd,It=yt>0?at[yt-1]:bt,Ft=Et||Object.keys(St);if(typeof xt=="function"||xt==="spring")return[].concat(_toConsumableArray$8(gt),[ot.runJSAnimation.bind(ot,{from:It.style,to:St,duration:wt,easing:xt}),wt]);var Ht=getTransitionVal(Ft,wt,xt),zt=_objectSpread$t(_objectSpread$t(_objectSpread$t({},It.style),St),{},{transition:Ht});return[].concat(_toConsumableArray$8(gt),[zt,wt,$t]).filter(identity$8)};return this.manager.start([lt].concat(_toConsumableArray$8(at.reduce(pt,[ut,Math.max(dt,st)])),[rt.onAnimationEnd]))}},{key:"runAnimation",value:function(rt){this.manager||(this.manager=createAnimateManager());var ot=rt.begin,at=rt.duration,st=rt.attributeName,lt=rt.to,ct=rt.easing,ut=rt.onAnimationStart,ht=rt.onAnimationEnd,dt=rt.steps,pt=rt.children,mt=this.manager;if(this.unSubscribe=mt.subscribe(this.handleStyleChange),typeof ct=="function"||typeof pt=="function"||ct==="spring"){this.runJSAnimation(rt);return}if(dt.length>1){this.runStepAnimation(rt);return}var gt=st?_defineProperty$v({},st,lt):lt,bt=getTransitionVal(Object.keys(gt),at,ct);mt.start([ut,ot,_objectSpread$t(_objectSpread$t({},gt),{},{transition:bt}),at,ht])}},{key:"render",value:function(){var rt=this.props,ot=rt.children;rt.begin;var at=rt.duration;rt.attributeName,rt.easing;var st=rt.isActive;rt.steps,rt.from,rt.to,rt.canBegin,rt.onAnimationEnd,rt.shouldReAnimate,rt.onAnimationReStart;var lt=_objectWithoutProperties$d(rt,_excluded$d),ct=reactExports.Children.count(ot),ut=translateStyle(this.state.style);if(typeof ot=="function")return ot(ut);if(!st||ct===0||at<=0)return ot;var ht=function(pt){var mt=pt.props,gt=mt.style,bt=gt===void 0?{}:gt,yt=mt.className,wt=reactExports.cloneElement(pt,_objectSpread$t(_objectSpread$t({},lt),{},{style:_objectSpread$t(_objectSpread$t({},bt),ut),className:yt}));return wt};return ct===1?ht(reactExports.Children.only(ot)):React$1.createElement("div",null,reactExports.Children.map(ot,function(dt){return ht(dt)}))}}]),nt}(reactExports.PureComponent);Animate.displayName="Animate";Animate.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function tt(){},onAnimationStart:function tt(){}};Animate.propTypes={from:PropTypes.oneOfType([PropTypes.object,PropTypes.string]),to:PropTypes.oneOfType([PropTypes.object,PropTypes.string]),attributeName:PropTypes.string,duration:PropTypes.number,begin:PropTypes.number,easing:PropTypes.oneOfType([PropTypes.string,PropTypes.func]),steps:PropTypes.arrayOf(PropTypes.shape({duration:PropTypes.number.isRequired,style:PropTypes.object.isRequired,easing:PropTypes.oneOfType([PropTypes.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),PropTypes.func]),properties:PropTypes.arrayOf("string"),onAnimationEnd:PropTypes.func})),children:PropTypes.oneOfType([PropTypes.node,PropTypes.func]),isActive:PropTypes.bool,canBegin:PropTypes.bool,onAnimationEnd:PropTypes.func,shouldReAnimate:PropTypes.bool,onAnimationStart:PropTypes.func,onAnimationReStart:PropTypes.func};Number.isFinite===void 0&&(Number.isFinite=function(tt){return typeof tt=="number"&&isFinite(tt)});PropTypes.object,PropTypes.object,PropTypes.object,PropTypes.element;PropTypes.object,PropTypes.object,PropTypes.object,PropTypes.oneOfType([PropTypes.array,PropTypes.element]),PropTypes.any;function _typeof$v(tt){"@babel/helpers - typeof";return _typeof$v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$v(tt)}function _defineProperty$u(tt,et,nt){return et=_toPropertyKey$v(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$v(tt){var et=_toPrimitive$v(tt,"string");return _typeof$v(et)==="symbol"?et:String(et)}function _toPrimitive$v(tt,et){if(_typeof$v(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$v(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var CSS_CLASS_PREFIX="recharts-tooltip-wrapper",TOOLTIP_HIDDEN={visibility:"hidden"};function getTooltipCSSClassName(tt){var et,nt=tt.coordinate,it=tt.translateX,rt=tt.translateY;return clsx(CSS_CLASS_PREFIX,(et={},_defineProperty$u(et,"".concat(CSS_CLASS_PREFIX,"-right"),isNumber(it)&&nt&&isNumber(nt.x)&&it>=nt.x),_defineProperty$u(et,"".concat(CSS_CLASS_PREFIX,"-left"),isNumber(it)&&nt&&isNumber(nt.x)&&it=nt.y),_defineProperty$u(et,"".concat(CSS_CLASS_PREFIX,"-top"),isNumber(rt)&&nt&&isNumber(nt.y)&&rtgt?Math.max(ut,lt[it]):Math.max(ht,lt[it])}function getTransformStyle(tt){var et=tt.translateX,nt=tt.translateY,it=tt.useTranslate3d;return translateStyle({transform:it?"translate3d(".concat(et,"px, ").concat(nt,"px, 0)"):"translate(".concat(et,"px, ").concat(nt,"px)")})}function getTooltipTranslate(tt){var et=tt.allowEscapeViewBox,nt=tt.coordinate,it=tt.offsetTopLeft,rt=tt.position,ot=tt.reverseDirection,at=tt.tooltipBox,st=tt.useTranslate3d,lt=tt.viewBox,ct,ut,ht;return at.height>0&&at.width>0&&nt?(ut=getTooltipTranslateXY({allowEscapeViewBox:et,coordinate:nt,key:"x",offsetTopLeft:it,position:rt,reverseDirection:ot,tooltipDimension:at.width,viewBox:lt,viewBoxDimension:lt.width}),ht=getTooltipTranslateXY({allowEscapeViewBox:et,coordinate:nt,key:"y",offsetTopLeft:it,position:rt,reverseDirection:ot,tooltipDimension:at.height,viewBox:lt,viewBoxDimension:lt.height}),ct=getTransformStyle({translateX:ut,translateY:ht,useTranslate3d:st})):ct=TOOLTIP_HIDDEN,{cssProperties:ct,cssClasses:getTooltipCSSClassName({translateX:ut,translateY:ht,coordinate:nt})}}function _typeof$u(tt){"@babel/helpers - typeof";return _typeof$u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$u(tt)}function ownKeys$s(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$s(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$8(tt){return _getPrototypeOf$8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$8(tt)}function _defineProperty$t(tt,et,nt){return et=_toPropertyKey$u(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$u(tt){var et=_toPrimitive$u(tt,"string");return _typeof$u(et)==="symbol"?et:String(et)}function _toPrimitive$u(tt,et){if(_typeof$u(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$u(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var EPSILON=1,TooltipBoundingBox=function(tt){_inherits$8(nt,tt);var et=_createSuper$8(nt);function nt(){var it;_classCallCheck$b(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;atEPSILON||Math.abs(rt.height-this.lastBoundingBox.height)>EPSILON)&&(this.lastBoundingBox.width=rt.width,this.lastBoundingBox.height=rt.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var rt,ot;this.props.active&&this.updateBBox(),this.state.dismissed&&(((rt=this.props.coordinate)===null||rt===void 0?void 0:rt.x)!==this.state.dismissedAtCoordinate.x||((ot=this.props.coordinate)===null||ot===void 0?void 0:ot.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var rt=this,ot=this.props,at=ot.active,st=ot.allowEscapeViewBox,lt=ot.animationDuration,ct=ot.animationEasing,ut=ot.children,ht=ot.coordinate,dt=ot.hasPayload,pt=ot.isAnimationActive,mt=ot.offset,gt=ot.position,bt=ot.reverseDirection,yt=ot.useTranslate3d,wt=ot.viewBox,vt=ot.wrapperStyle,xt=getTooltipTranslate({allowEscapeViewBox:st,coordinate:ht,offsetTopLeft:mt,position:gt,reverseDirection:bt,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:yt,viewBox:wt}),St=xt.cssClasses,Et=xt.cssProperties,$t=_objectSpread$s(_objectSpread$s(_objectSpread$s({},pt&&at&&translateStyle({transition:"transform ".concat(lt,"ms ").concat(ct)})),Et),{},{pointerEvents:"none",visibility:!this.state.dismissed&&at&&dt?"visible":"hidden",position:"absolute",top:0,left:0},vt);return React$1.createElement("div",{tabIndex:-1,role:"dialog",className:St,style:$t,ref:function(Ft){rt.wrapperNode=Ft}},ut)}}]),nt}(reactExports.PureComponent),parseIsSsrByDefault=function tt(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Global={isSsr:parseIsSsrByDefault(),get:function tt(et){return Global[et]},set:function tt(et,nt){if(typeof et=="string")Global[et]=nt;else{var it=Object.keys(et);it&&it.length&&it.forEach(function(rt){Global[rt]=et[rt]})}}};function _typeof$t(tt){"@babel/helpers - typeof";return _typeof$t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$t(tt)}function ownKeys$r(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$r(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$7(tt){return _getPrototypeOf$7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$7(tt)}function _defineProperty$s(tt,et,nt){return et=_toPropertyKey$t(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$t(tt){var et=_toPrimitive$t(tt,"string");return _typeof$t(et)==="symbol"?et:String(et)}function _toPrimitive$t(tt,et){if(_typeof$t(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$t(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}function defaultUniqBy(tt){return tt.dataKey}function renderContent(tt,et){return React$1.isValidElement(tt)?React$1.cloneElement(tt,et):typeof tt=="function"?React$1.createElement(tt,et):React$1.createElement(DefaultTooltipContent,et)}var Tooltip=function(tt){_inherits$7(nt,tt);var et=_createSuper$7(nt);function nt(){return _classCallCheck$a(this,nt),et.apply(this,arguments)}return _createClass$a(nt,[{key:"render",value:function(){var rt=this.props,ot=rt.active,at=rt.allowEscapeViewBox,st=rt.animationDuration,lt=rt.animationEasing,ct=rt.content,ut=rt.coordinate,ht=rt.filterNull,dt=rt.isAnimationActive,pt=rt.offset,mt=rt.payload,gt=rt.payloadUniqBy,bt=rt.position,yt=rt.reverseDirection,wt=rt.useTranslate3d,vt=rt.viewBox,xt=rt.wrapperStyle,St=mt??[];ht&&St.length&&(St=getUniqPayload(mt.filter(function($t){return $t.value!=null}),gt,defaultUniqBy));var Et=St.length>0;return React$1.createElement(TooltipBoundingBox,{allowEscapeViewBox:at,animationDuration:st,animationEasing:lt,isAnimationActive:dt,active:ot,coordinate:ut,hasPayload:Et,offset:pt,position:bt,reverseDirection:yt,useTranslate3d:wt,viewBox:vt,wrapperStyle:xt},renderContent(ct,_objectSpread$r(_objectSpread$r({},this.props),{},{payload:St})))}}]),nt}(reactExports.PureComponent);_defineProperty$s(Tooltip,"displayName","Tooltip");_defineProperty$s(Tooltip,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Global.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var root$4=_root,now$1=function(){return root$4.Date.now()},now_1=now$1,reWhitespace=/\s/;function trimmedEndIndex$1(tt){for(var et=tt.length;et--&&reWhitespace.test(tt.charAt(et)););return et}var _trimmedEndIndex=trimmedEndIndex$1,trimmedEndIndex=_trimmedEndIndex,reTrimStart=/^\s+/;function baseTrim$1(tt){return tt&&tt.slice(0,trimmedEndIndex(tt)+1).replace(reTrimStart,"")}var _baseTrim=baseTrim$1,baseTrim=_baseTrim,isObject$2=isObject_1,isSymbol$1=isSymbol_1,NAN=0/0,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber$2(tt){if(typeof tt=="number")return tt;if(isSymbol$1(tt))return NAN;if(isObject$2(tt)){var et=typeof tt.valueOf=="function"?tt.valueOf():tt;tt=isObject$2(et)?et+"":et}if(typeof tt!="string")return tt===0?tt:+tt;tt=baseTrim(tt);var nt=reIsBinary.test(tt);return nt||reIsOctal.test(tt)?freeParseInt(tt.slice(2),nt?2:8):reIsBadHex.test(tt)?NAN:+tt}var toNumber_1=toNumber$2,isObject$1=isObject_1,now=now_1,toNumber$1=toNumber_1,FUNC_ERROR_TEXT$1="Expected a function",nativeMax$2=Math.max,nativeMin=Math.min;function debounce$1(tt,et,nt){var it,rt,ot,at,st,lt,ct=0,ut=!1,ht=!1,dt=!0;if(typeof tt!="function")throw new TypeError(FUNC_ERROR_TEXT$1);et=toNumber$1(et)||0,isObject$1(nt)&&(ut=!!nt.leading,ht="maxWait"in nt,ot=ht?nativeMax$2(toNumber$1(nt.maxWait)||0,et):ot,dt="trailing"in nt?!!nt.trailing:dt);function pt(Et){var $t=it,It=rt;return it=rt=void 0,ct=Et,at=tt.apply(It,$t),at}function mt(Et){return ct=Et,st=setTimeout(yt,et),ut?pt(Et):at}function gt(Et){var $t=Et-lt,It=Et-ct,Ft=et-$t;return ht?nativeMin(Ft,ot-It):Ft}function bt(Et){var $t=Et-lt,It=Et-ct;return lt===void 0||$t>=et||$t<0||ht&&It>=ot}function yt(){var Et=now();if(bt(Et))return wt(Et);st=setTimeout(yt,gt(Et))}function wt(Et){return st=void 0,dt&&it?pt(Et):(it=rt=void 0,at)}function vt(){st!==void 0&&clearTimeout(st),ct=0,it=lt=rt=st=void 0}function xt(){return st===void 0?at:wt(now())}function St(){var Et=now(),$t=bt(Et);if(it=arguments,rt=this,lt=Et,$t){if(st===void 0)return mt(lt);if(ht)return clearTimeout(st),st=setTimeout(yt,et),pt(lt)}return st===void 0&&(st=setTimeout(yt,et)),at}return St.cancel=vt,St.flush=xt,St}var debounce_1=debounce$1,debounce=debounce_1,isObject=isObject_1,FUNC_ERROR_TEXT="Expected a function";function throttle(tt,et,nt){var it=!0,rt=!0;if(typeof tt!="function")throw new TypeError(FUNC_ERROR_TEXT);return isObject(nt)&&(it="leading"in nt?!!nt.leading:it,rt="trailing"in nt?!!nt.trailing:rt),debounce(tt,et,{leading:it,maxWait:et,trailing:rt})}var throttle_1=throttle;const throttle$1=getDefaultExportFromCjs(throttle_1);function _typeof$s(tt){"@babel/helpers - typeof";return _typeof$s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$s(tt)}function ownKeys$q(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$q(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0&&(jt=throttle$1(jt,gt,{trailing:!0,leading:!1}));var kt=new ResizeObserver(jt),Tt=St.current.getBoundingClientRect(),Ct=Tt.width,Ut=Tt.height;return zt(Ct,Ut),kt.observe(St.current),function(){kt.disconnect()}},[zt,gt]);var Ot=reactExports.useMemo(function(){var jt=Ft.containerWidth,kt=Ft.containerHeight;if(jt<0||kt<0)return null;warn(isPercent(at)||isPercent(lt),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,at,lt),warn(!nt||nt>0,"The aspect(%s) must be greater than zero.",nt);var Tt=isPercent(at)?jt:at,Ct=isPercent(lt)?kt:lt;nt&&nt>0&&(Tt?Ct=Tt/nt:Ct&&(Tt=Ct*nt),dt&&Ct>dt&&(Ct=dt)),warn(Tt>0||Ct>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,At,Rt,at,lt,ut,ht,nt);var Wt=!Array.isArray(pt)&&reactIsExports.isElement(pt)&&getDisplayName(pt.type).endsWith("Chart");return React$1.Children.map(pt,function(jt){return reactIsExports.isElement(jt)?reactExports.cloneElement(jt,_objectSpread$r({width:At,height:Rt},Wt?{style:_objectSpread$r({height:"100%",width:"100%",maxHeight:Rt,maxWidth:At},jt.props.style)}:{})):jt})},[nt,pt,lt,dt,ht,ut,$t,at]);return React$1.createElement("div",{id:bt?"".concat(bt):void 0,className:clsx("recharts-responsive-container",yt),style:_objectSpread$r(_objectSpread$r({},xt),{},{width:at,height:lt,minWidth:ut,minHeight:ht,maxHeight:dt}),ref:St},Bt)}),Cell=function tt(et){return null};Cell.displayName="Cell";function _typeof$s(tt){"@babel/helpers - typeof";return _typeof$s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$s(tt)}function ownKeys$q(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$q(tt){for(var et=1;et1&&arguments[1]!==void 0?arguments[1]:{};if(et==null||Global.isSsr)return{width:0,height:0};var it=removeInvalidKeys(nt),rt=JSON.stringify({text:et,copyStyle:it});if(stringCache.widthCache[rt])return stringCache.widthCache[rt];try{var ot=document.getElementById(MEASUREMENT_SPAN_ID);ot||(ot=document.createElement("span"),ot.setAttribute("id",MEASUREMENT_SPAN_ID),ot.setAttribute("aria-hidden","true"),document.body.appendChild(ot));var at=_objectSpread$q(_objectSpread$q({},SPAN_STYLE),it);Object.assign(ot.style,at),ot.textContent="".concat(et);var st=ot.getBoundingClientRect(),lt={width:st.width,height:st.height};return stringCache.widthCache[rt]=lt,++stringCache.cacheCount>MAX_CACHE_NUM&&(stringCache.cacheCount=0,stringCache.widthCache={}),lt}catch{return{width:0,height:0}}},getOffset=function tt(et){return{top:et.top+window.scrollY-document.documentElement.clientTop,left:et.left+window.scrollX-document.documentElement.clientLeft}};function _typeof$r(tt){"@babel/helpers - typeof";return _typeof$r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$r(tt)}function _slicedToArray$8(tt,et){return _arrayWithHoles$8(tt)||_iterableToArrayLimit$8(tt,et)||_unsupportedIterableToArray$g(tt,et)||_nonIterableRest$8()}function _nonIterableRest$8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$g(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$g(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$g(tt,et)}}function _arrayLikeToArray$g(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$c(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _slicedToArray$7(tt,et){return _arrayWithHoles$7(tt)||_iterableToArrayLimit$7(tt,et)||_unsupportedIterableToArray$f(tt,et)||_nonIterableRest$7()}function _nonIterableRest$7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$f(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$f(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$f(tt,et)}}function _arrayLikeToArray$f(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0&&arguments[0]!==void 0?arguments[0]:[];return At.reduce(function(Rt,Wt){var jt=Wt.word,Ot=Wt.width,Ct=Rt[Rt.length-1];if(Ct&&(rt==null||ot||Ct.width+Ot+itWt.width?Rt:Wt})};if(!ut)return pt;for(var gt="…",bt=function(At){var Rt=ht.slice(0,At),Wt=calculateWordWidths({breakAll:ct,style:lt,children:Rt+gt}).wordsWithComputedWidth,jt=dt(Wt),Ot=jt.length>at||mt(jt).width>Number(rt);return[Ot,jt]},yt=0,wt=ht.length-1,vt=0,xt;yt<=wt&&vt<=ht.length-1;){var St=Math.floor((yt+wt)/2),Et=St-1,It=bt(Et),Tt=_slicedToArray$7(It,2),$t=Tt[0],Ut=Tt[1],Lt=bt(St),Bt=_slicedToArray$7(Lt,1),Pt=Bt[0];if(!$t&&!Pt&&(yt=St+1),$t&&Pt&&(wt=St-1),!$t&&Pt){xt=Ut;break}vt++}return xt||pt},getWordsWithoutCalculate=function tt(et){var nt=isNil$1(et)?[]:et.toString().split(BREAKING_SPACES);return[{words:nt}]},getWordsByLines=function tt(et){var nt=et.width,it=et.scaleToFit,rt=et.children,ot=et.style,at=et.breakAll,st=et.maxLines;if((nt||it)&&!Global.isSsr){var lt,ct,ut=calculateWordWidths({breakAll:at,children:rt,style:ot});if(ut){var ht=ut.wordsWithComputedWidth,dt=ut.spaceWidth;lt=ht,ct=dt}else return getWordsWithoutCalculate(rt);return calculateWordsByLines({breakAll:at,children:rt,maxLines:st,style:ot},lt,ct,nt,it)}return getWordsWithoutCalculate(rt)},DEFAULT_FILL="#808080",Text$1=function tt(et){var nt=et.x,it=nt===void 0?0:nt,rt=et.y,ot=rt===void 0?0:rt,at=et.lineHeight,st=at===void 0?"1em":at,lt=et.capHeight,ct=lt===void 0?"0.71em":lt,ut=et.scaleToFit,ht=ut===void 0?!1:ut,dt=et.textAnchor,pt=dt===void 0?"start":dt,mt=et.verticalAnchor,gt=mt===void 0?"end":mt,bt=et.fill,yt=bt===void 0?DEFAULT_FILL:bt,wt=_objectWithoutProperties$c(et,_excluded$c),vt=reactExports.useMemo(function(){return getWordsByLines({breakAll:wt.breakAll,children:wt.children,maxLines:wt.maxLines,scaleToFit:ht,style:wt.style,width:wt.width})},[wt.breakAll,wt.children,wt.maxLines,ht,wt.style,wt.width]),xt=wt.dx,St=wt.dy,Et=wt.angle,It=wt.className,Tt=wt.breakAll,$t=_objectWithoutProperties$c(wt,_excluded2$4);if(!isNumOrStr(it)||!isNumOrStr(ot))return null;var Ut=it+(isNumber(xt)?xt:0),Lt=ot+(isNumber(St)?St:0),Bt;switch(gt){case"start":Bt=reduceCSSCalc("calc(".concat(ct,")"));break;case"middle":Bt=reduceCSSCalc("calc(".concat((vt.length-1)/2," * -").concat(st," + (").concat(ct," / 2))"));break;default:Bt=reduceCSSCalc("calc(".concat(vt.length-1," * -").concat(st,")"));break}var Pt=[];if(ht){var kt=vt[0].width,At=wt.width;Pt.push("scale(".concat((isNumber(At)?At/kt:1)/kt,")"))}return Et&&Pt.push("rotate(".concat(Et,", ").concat(Ut,", ").concat(Lt,")")),Pt.length&&($t.transform=Pt.join(" ")),React$1.createElement("text",_extends$m({},filterProps($t,!0),{x:Ut,y:Lt,className:clsx("recharts-text",It),textAnchor:pt,fill:yt.includes("url")?DEFAULT_FILL:yt}),vt.map(function(Rt,Wt){var jt=Rt.words.join(Tt?"":" ");return React$1.createElement("tspan",{x:Ut,dy:Wt===0?Bt:st,key:jt},jt)}))};function ascending$1(tt,et){return tt==null||et==null?NaN:ttet?1:tt>=et?0:NaN}function descending(tt,et){return tt==null||et==null?NaN:ettt?1:et>=tt?0:NaN}function bisector(tt){let et,nt,it;tt.length!==2?(et=ascending$1,nt=(st,lt)=>ascending$1(tt(st),lt),it=(st,lt)=>tt(st)-lt):(et=tt===ascending$1||tt===descending?tt:zero$1,nt=tt,it=tt);function rt(st,lt,ct=0,ut=st.length){if(ct>>1;nt(st[ht],lt)<0?ct=ht+1:ut=ht}while(ct>>1;nt(st[ht],lt)<=0?ct=ht+1:ut=ht}while(ctct&&it(st[ht-1],lt)>-it(st[ht],lt)?ht-1:ht}return{left:rt,center:at,right:ot}}function zero$1(){return 0}function number$4(tt){return tt===null?NaN:+tt}function*numbers(tt,et){if(et===void 0)for(let nt of tt)nt!=null&&(nt=+nt)>=nt&&(yield nt);else{let nt=-1;for(let it of tt)(it=et(it,++nt,tt))!=null&&(it=+it)>=it&&(yield it)}}const ascendingBisect=bisector(ascending$1),bisectRight=ascendingBisect.right;bisector(number$4).center;const bisect=bisectRight;class InternMap extends Map{constructor(et,nt=keyof){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:nt}}),et!=null)for(const[it,rt]of et)this.set(it,rt)}get(et){return super.get(intern_get(this,et))}has(et){return super.has(intern_get(this,et))}set(et,nt){return super.set(intern_set(this,et),nt)}delete(et){return super.delete(intern_delete(this,et))}}function intern_get({_intern:tt,_key:et},nt){const it=et(nt);return tt.has(it)?tt.get(it):nt}function intern_set({_intern:tt,_key:et},nt){const it=et(nt);return tt.has(it)?tt.get(it):(tt.set(it,nt),nt)}function intern_delete({_intern:tt,_key:et},nt){const it=et(nt);return tt.has(it)&&(nt=tt.get(it),tt.delete(it)),nt}function keyof(tt){return tt!==null&&typeof tt=="object"?tt.valueOf():tt}function compareDefined(tt=ascending$1){if(tt===ascending$1)return ascendingDefined;if(typeof tt!="function")throw new TypeError("compare is not a function");return(et,nt)=>{const it=tt(et,nt);return it||it===0?it:(tt(nt,nt)===0)-(tt(et,et)===0)}}function ascendingDefined(tt,et){return(tt==null||!(tt>=tt))-(et==null||!(et>=et))||(ttet?1:0)}const e10=Math.sqrt(50),e5=Math.sqrt(10),e2=Math.sqrt(2);function tickSpec(tt,et,nt){const it=(et-tt)/Math.max(0,nt),rt=Math.floor(Math.log10(it)),ot=it/Math.pow(10,rt),at=ot>=e10?10:ot>=e5?5:ot>=e2?2:1;let st,lt,ct;return rt<0?(ct=Math.pow(10,-rt)/at,st=Math.round(tt*ct),lt=Math.round(et*ct),st/ctet&&--lt,ct=-ct):(ct=Math.pow(10,rt)*at,st=Math.round(tt/ct),lt=Math.round(et/ct),st*ctet&&--lt),lt0))return[];if(tt===et)return[tt];const it=et=rt))return[];const st=ot-rt+1,lt=new Array(st);if(it)if(at<0)for(let ct=0;ct=it)&&(nt=it);else{let it=-1;for(let rt of tt)(rt=et(rt,++it,tt))!=null&&(nt=rt)&&(nt=rt)}return nt}function min$2(tt,et){let nt;if(et===void 0)for(const it of tt)it!=null&&(nt>it||nt===void 0&&it>=it)&&(nt=it);else{let it=-1;for(let rt of tt)(rt=et(rt,++it,tt))!=null&&(nt>rt||nt===void 0&&rt>=rt)&&(nt=rt)}return nt}function quickselect(tt,et,nt=0,it=1/0,rt){if(et=Math.floor(et),nt=Math.floor(Math.max(0,nt)),it=Math.floor(Math.min(tt.length-1,it)),!(nt<=et&&et<=it))return tt;for(rt=rt===void 0?ascendingDefined:compareDefined(rt);it>nt;){if(it-nt>600){const lt=it-nt+1,ct=et-nt+1,ut=Math.log(lt),ht=.5*Math.exp(2*ut/3),dt=.5*Math.sqrt(ut*ht*(lt-ht)/lt)*(ct-lt/2<0?-1:1),pt=Math.max(nt,Math.floor(et-ct*ht/lt+dt)),mt=Math.min(it,Math.floor(et+(lt-ct)*ht/lt+dt));quickselect(tt,et,pt,mt,rt)}const ot=tt[et];let at=nt,st=it;for(swap(tt,nt,et),rt(tt[it],ot)>0&&swap(tt,nt,it);at0;)--st}rt(tt[nt],ot)===0?swap(tt,nt,st):(++st,swap(tt,st,it)),st<=et&&(nt=st+1),et<=st&&(it=st-1)}return tt}function swap(tt,et,nt){const it=tt[et];tt[et]=tt[nt],tt[nt]=it}function quantile$1(tt,et,nt){if(tt=Float64Array.from(numbers(tt,nt)),!(!(it=tt.length)||isNaN(et=+et))){if(et<=0||it<2)return min$2(tt);if(et>=1)return max$2(tt);var it,rt=(it-1)*et,ot=Math.floor(rt),at=max$2(quickselect(tt,ot).subarray(0,ot+1)),st=min$2(tt.subarray(ot+1));return at+(st-at)*(rt-ot)}}function quantileSorted(tt,et,nt=number$4){if(!(!(it=tt.length)||isNaN(et=+et))){if(et<=0||it<2)return+nt(tt[0],0,tt);if(et>=1)return+nt(tt[it-1],it-1,tt);var it,rt=(it-1)*et,ot=Math.floor(rt),at=+nt(tt[ot],ot,tt),st=+nt(tt[ot+1],ot+1,tt);return at+(st-at)*(rt-ot)}}function range$3(tt,et,nt){tt=+tt,et=+et,nt=(rt=arguments.length)<2?(et=tt,tt=0,1):rt<3?1:+nt;for(var it=-1,rt=Math.max(0,Math.ceil((et-tt)/nt))|0,ot=new Array(rt);++it>8&15|et>>4&240,et>>4&15|et&240,(et&15)<<4|et&15,1):nt===8?rgba(et>>24&255,et>>16&255,et>>8&255,(et&255)/255):nt===4?rgba(et>>12&15|et>>8&240,et>>8&15|et>>4&240,et>>4&15|et&240,((et&15)<<4|et&15)/255):null):(et=reRgbInteger.exec(tt))?new Rgb(et[1],et[2],et[3],1):(et=reRgbPercent.exec(tt))?new Rgb(et[1]*255/100,et[2]*255/100,et[3]*255/100,1):(et=reRgbaInteger.exec(tt))?rgba(et[1],et[2],et[3],et[4]):(et=reRgbaPercent.exec(tt))?rgba(et[1]*255/100,et[2]*255/100,et[3]*255/100,et[4]):(et=reHslPercent.exec(tt))?hsla(et[1],et[2]/100,et[3]/100,1):(et=reHslaPercent.exec(tt))?hsla(et[1],et[2]/100,et[3]/100,et[4]):named.hasOwnProperty(tt)?rgbn(named[tt]):tt==="transparent"?new Rgb(NaN,NaN,NaN,0):null}function rgbn(tt){return new Rgb(tt>>16&255,tt>>8&255,tt&255,1)}function rgba(tt,et,nt,it){return it<=0&&(tt=et=nt=NaN),new Rgb(tt,et,nt,it)}function rgbConvert(tt){return tt instanceof Color||(tt=color$1(tt)),tt?(tt=tt.rgb(),new Rgb(tt.r,tt.g,tt.b,tt.opacity)):new Rgb}function rgb(tt,et,nt,it){return arguments.length===1?rgbConvert(tt):new Rgb(tt,et,nt,it??1)}function Rgb(tt,et,nt,it){this.r=+tt,this.g=+et,this.b=+nt,this.opacity=+it}define(Rgb,rgb,extend$2(Color,{brighter(tt){return tt=tt==null?brighter:Math.pow(brighter,tt),new Rgb(this.r*tt,this.g*tt,this.b*tt,this.opacity)},darker(tt){return tt=tt==null?darker:Math.pow(darker,tt),new Rgb(this.r*tt,this.g*tt,this.b*tt,this.opacity)},rgb(){return this},clamp(){return new Rgb(clampi(this.r),clampi(this.g),clampi(this.b),clampa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatHex8:rgb_formatHex8,formatRgb:rgb_formatRgb,toString:rgb_formatRgb}));function rgb_formatHex(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}`}function rgb_formatHex8(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity)?1:this.opacity)*255)}`}function rgb_formatRgb(){const tt=clampa(this.opacity);return`${tt===1?"rgb(":"rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${tt===1?")":`, ${tt})`}`}function clampa(tt){return isNaN(tt)?1:Math.max(0,Math.min(1,tt))}function clampi(tt){return Math.max(0,Math.min(255,Math.round(tt)||0))}function hex(tt){return tt=clampi(tt),(tt<16?"0":"")+tt.toString(16)}function hsla(tt,et,nt,it){return it<=0?tt=et=nt=NaN:nt<=0||nt>=1?tt=et=NaN:et<=0&&(tt=NaN),new Hsl(tt,et,nt,it)}function hslConvert(tt){if(tt instanceof Hsl)return new Hsl(tt.h,tt.s,tt.l,tt.opacity);if(tt instanceof Color||(tt=color$1(tt)),!tt)return new Hsl;if(tt instanceof Hsl)return tt;tt=tt.rgb();var et=tt.r/255,nt=tt.g/255,it=tt.b/255,rt=Math.min(et,nt,it),ot=Math.max(et,nt,it),at=NaN,st=ot-rt,lt=(ot+rt)/2;return st?(et===ot?at=(nt-it)/st+(nt0&<<1?0:at,new Hsl(at,st,lt,tt.opacity)}function hsl(tt,et,nt,it){return arguments.length===1?hslConvert(tt):new Hsl(tt,et,nt,it??1)}function Hsl(tt,et,nt,it){this.h=+tt,this.s=+et,this.l=+nt,this.opacity=+it}define(Hsl,hsl,extend$2(Color,{brighter(tt){return tt=tt==null?brighter:Math.pow(brighter,tt),new Hsl(this.h,this.s,this.l*tt,this.opacity)},darker(tt){return tt=tt==null?darker:Math.pow(darker,tt),new Hsl(this.h,this.s,this.l*tt,this.opacity)},rgb(){var tt=this.h%360+(this.h<0)*360,et=isNaN(tt)||isNaN(this.s)?0:this.s,nt=this.l,it=nt+(nt<.5?nt:1-nt)*et,rt=2*nt-it;return new Rgb(hsl2rgb(tt>=240?tt-240:tt+120,rt,it),hsl2rgb(tt,rt,it),hsl2rgb(tt<120?tt+240:tt-120,rt,it),this.opacity)},clamp(){return new Hsl(clamph(this.h),clampt(this.s),clampt(this.l),clampa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const tt=clampa(this.opacity);return`${tt===1?"hsl(":"hsla("}${clamph(this.h)}, ${clampt(this.s)*100}%, ${clampt(this.l)*100}%${tt===1?")":`, ${tt})`}`}}));function clamph(tt){return tt=(tt||0)%360,tt<0?tt+360:tt}function clampt(tt){return Math.max(0,Math.min(1,tt||0))}function hsl2rgb(tt,et,nt){return(tt<60?et+(nt-et)*tt/60:tt<180?nt:tt<240?et+(nt-et)*(240-tt)/60:et)*255}const constant$3=tt=>()=>tt;function linear$1(tt,et){return function(nt){return tt+nt*et}}function exponential(tt,et,nt){return tt=Math.pow(tt,nt),et=Math.pow(et,nt)-tt,nt=1/nt,function(it){return Math.pow(tt+it*et,nt)}}function gamma(tt){return(tt=+tt)==1?nogamma:function(et,nt){return nt-et?exponential(et,nt,tt):constant$3(isNaN(et)?nt:et)}}function nogamma(tt,et){var nt=et-tt;return nt?linear$1(tt,nt):constant$3(isNaN(tt)?et:tt)}const interpolateRgb=function tt(et){var nt=gamma(et);function it(rt,ot){var at=nt((rt=rgb(rt)).r,(ot=rgb(ot)).r),st=nt(rt.g,ot.g),lt=nt(rt.b,ot.b),ct=nogamma(rt.opacity,ot.opacity);return function(ut){return rt.r=at(ut),rt.g=st(ut),rt.b=lt(ut),rt.opacity=ct(ut),rt+""}}return it.gamma=tt,it}(1);function numberArray(tt,et){et||(et=[]);var nt=tt?Math.min(et.length,tt.length):0,it=et.slice(),rt;return function(ot){for(rt=0;rtnt&&(ot=et.slice(nt,ot),st[at]?st[at]+=ot:st[++at]=ot),(it=it[0])===(rt=rt[0])?st[at]?st[at]+=rt:st[++at]=rt:(st[++at]=null,lt.push({i:at,x:interpolateNumber$1(it,rt)})),nt=reB.lastIndex;return nt180?ut+=360:ut-ct>180&&(ct+=360),dt.push({i:ht.push(rt(ht)+"rotate(",null,it)-2,x:interpolateNumber$1(ct,ut)})):ut&&ht.push(rt(ht)+"rotate("+ut+it)}function st(ct,ut,ht,dt){ct!==ut?dt.push({i:ht.push(rt(ht)+"skewX(",null,it)-2,x:interpolateNumber$1(ct,ut)}):ut&&ht.push(rt(ht)+"skewX("+ut+it)}function lt(ct,ut,ht,dt,pt,mt){if(ct!==ht||ut!==dt){var gt=pt.push(rt(pt)+"scale(",null,",",null,")");mt.push({i:gt-4,x:interpolateNumber$1(ct,ht)},{i:gt-2,x:interpolateNumber$1(ut,dt)})}else(ht!==1||dt!==1)&&pt.push(rt(pt)+"scale("+ht+","+dt+")")}return function(ct,ut){var ht=[],dt=[];return ct=tt(ct),ut=tt(ut),ot(ct.translateX,ct.translateY,ut.translateX,ut.translateY,ht,dt),at(ct.rotate,ut.rotate,ht,dt),st(ct.skewX,ut.skewX,ht,dt),lt(ct.scaleX,ct.scaleY,ut.scaleX,ut.scaleY,ht,dt),ct=ut=null,function(pt){for(var mt=-1,gt=dt.length,bt;++mtet&&(nt=tt,tt=et,et=nt),function(it){return Math.max(tt,Math.min(et,it))}}function bimap(tt,et,nt){var it=tt[0],rt=tt[1],ot=et[0],at=et[1];return rt2?polymap:bimap,lt=ct=null,ht}function ht(dt){return dt==null||isNaN(dt=+dt)?ot:(lt||(lt=st(tt.map(it),et,nt)))(it(at(dt)))}return ht.invert=function(dt){return at(rt((ct||(ct=st(et,tt.map(it),interpolateNumber$1)))(dt)))},ht.domain=function(dt){return arguments.length?(tt=Array.from(dt,number$3),ut()):tt.slice()},ht.range=function(dt){return arguments.length?(et=Array.from(dt),ut()):et.slice()},ht.rangeRound=function(dt){return et=Array.from(dt),nt=interpolateRound,ut()},ht.clamp=function(dt){return arguments.length?(at=dt?!0:identity$6,ut()):at!==identity$6},ht.interpolate=function(dt){return arguments.length?(nt=dt,ut()):nt},ht.unknown=function(dt){return arguments.length?(ot=dt,ht):ot},function(dt,pt){return it=dt,rt=pt,ut()}}function continuous(){return transformer$2()(identity$6,identity$6)}function formatDecimal(tt){return Math.abs(tt=Math.round(tt))>=1e21?tt.toLocaleString("en").replace(/,/g,""):tt.toString(10)}function formatDecimalParts(tt,et){if((nt=(tt=et?tt.toExponential(et-1):tt.toExponential()).indexOf("e"))<0)return null;var nt,it=tt.slice(0,nt);return[it.length>1?it[0]+it.slice(2):it,+tt.slice(nt+1)]}function exponent(tt){return tt=formatDecimalParts(Math.abs(tt)),tt?tt[1]:NaN}function formatGroup(tt,et){return function(nt,it){for(var rt=nt.length,ot=[],at=0,st=tt[0],lt=0;rt>0&&st>0&&(lt+st+1>it&&(st=Math.max(1,it-lt)),ot.push(nt.substring(rt-=st,rt+st)),!((lt+=st+1)>it));)st=tt[at=(at+1)%tt.length];return ot.reverse().join(et)}}function formatNumerals(tt){return function(et){return et.replace(/[0-9]/g,function(nt){return tt[+nt]})}}var re$1=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(tt){if(!(et=re$1.exec(tt)))throw new Error("invalid format: "+tt);var et;return new FormatSpecifier({fill:et[1],align:et[2],sign:et[3],symbol:et[4],zero:et[5],width:et[6],comma:et[7],precision:et[8]&&et[8].slice(1),trim:et[9],type:et[10]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(tt){this.fill=tt.fill===void 0?" ":tt.fill+"",this.align=tt.align===void 0?">":tt.align+"",this.sign=tt.sign===void 0?"-":tt.sign+"",this.symbol=tt.symbol===void 0?"":tt.symbol+"",this.zero=!!tt.zero,this.width=tt.width===void 0?void 0:+tt.width,this.comma=!!tt.comma,this.precision=tt.precision===void 0?void 0:+tt.precision,this.trim=!!tt.trim,this.type=tt.type===void 0?"":tt.type+""}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function formatTrim(tt){e:for(var et=tt.length,nt=1,it=-1,rt;nt0&&(it=0);break}return it>0?tt.slice(0,it)+tt.slice(rt+1):tt}var prefixExponent;function formatPrefixAuto(tt,et){var nt=formatDecimalParts(tt,et);if(!nt)return tt+"";var it=nt[0],rt=nt[1],ot=rt-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(rt/3)))*3)+1,at=it.length;return ot===at?it:ot>at?it+new Array(ot-at+1).join("0"):ot>0?it.slice(0,ot)+"."+it.slice(ot):"0."+new Array(1-ot).join("0")+formatDecimalParts(tt,Math.max(0,et+ot-1))[0]}function formatRounded(tt,et){var nt=formatDecimalParts(tt,et);if(!nt)return tt+"";var it=nt[0],rt=nt[1];return rt<0?"0."+new Array(-rt).join("0")+it:it.length>rt+1?it.slice(0,rt+1)+"."+it.slice(rt+1):it+new Array(rt-it.length+2).join("0")}const formatTypes={"%":(tt,et)=>(tt*100).toFixed(et),b:tt=>Math.round(tt).toString(2),c:tt=>tt+"",d:formatDecimal,e:(tt,et)=>tt.toExponential(et),f:(tt,et)=>tt.toFixed(et),g:(tt,et)=>tt.toPrecision(et),o:tt=>Math.round(tt).toString(8),p:(tt,et)=>formatRounded(tt*100,et),r:formatRounded,s:formatPrefixAuto,X:tt=>Math.round(tt).toString(16).toUpperCase(),x:tt=>Math.round(tt).toString(16)};function identity$5(tt){return tt}var map$3=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale$1(tt){var et=tt.grouping===void 0||tt.thousands===void 0?identity$5:formatGroup(map$3.call(tt.grouping,Number),tt.thousands+""),nt=tt.currency===void 0?"":tt.currency[0]+"",it=tt.currency===void 0?"":tt.currency[1]+"",rt=tt.decimal===void 0?".":tt.decimal+"",ot=tt.numerals===void 0?identity$5:formatNumerals(map$3.call(tt.numerals,String)),at=tt.percent===void 0?"%":tt.percent+"",st=tt.minus===void 0?"−":tt.minus+"",lt=tt.nan===void 0?"NaN":tt.nan+"";function ct(ht){ht=formatSpecifier(ht);var dt=ht.fill,pt=ht.align,mt=ht.sign,gt=ht.symbol,bt=ht.zero,yt=ht.width,wt=ht.comma,vt=ht.precision,xt=ht.trim,St=ht.type;St==="n"?(wt=!0,St="g"):formatTypes[St]||(vt===void 0&&(vt=12),xt=!0,St="g"),(bt||dt==="0"&&pt==="=")&&(bt=!0,dt="0",pt="=");var Et=gt==="$"?nt:gt==="#"&&/[boxX]/.test(St)?"0"+St.toLowerCase():"",It=gt==="$"?it:/[%p]/.test(St)?at:"",Tt=formatTypes[St],$t=/[defgprs%]/.test(St);vt=vt===void 0?6:/[gprs]/.test(St)?Math.max(1,Math.min(21,vt)):Math.max(0,Math.min(20,vt));function Ut(Lt){var Bt=Et,Pt=It,kt,At,Rt;if(St==="c")Pt=Tt(Lt)+Pt,Lt="";else{Lt=+Lt;var Wt=Lt<0||1/Lt<0;if(Lt=isNaN(Lt)?lt:Tt(Math.abs(Lt),vt),xt&&(Lt=formatTrim(Lt)),Wt&&+Lt==0&&mt!=="+"&&(Wt=!1),Bt=(Wt?mt==="("?mt:st:mt==="-"||mt==="("?"":mt)+Bt,Pt=(St==="s"?prefixes[8+prefixExponent/3]:"")+Pt+(Wt&&mt==="("?")":""),$t){for(kt=-1,At=Lt.length;++ktRt||Rt>57){Pt=(Rt===46?rt+Lt.slice(kt+1):Lt.slice(kt))+Pt,Lt=Lt.slice(0,kt);break}}}wt&&!bt&&(Lt=et(Lt,1/0));var jt=Bt.length+Lt.length+Pt.length,Ot=jt>1)+Bt+Lt+Pt+Ot.slice(jt);break;default:Lt=Ot+Bt+Lt+Pt;break}return ot(Lt)}return Ut.toString=function(){return ht+""},Ut}function ut(ht,dt){var pt=ct((ht=formatSpecifier(ht),ht.type="f",ht)),mt=Math.max(-8,Math.min(8,Math.floor(exponent(dt)/3)))*3,gt=Math.pow(10,-mt),bt=prefixes[8+mt/3];return function(yt){return pt(gt*yt)+bt}}return{format:ct,formatPrefix:ut}}var locale$1,format,formatPrefix;defaultLocale$1({thousands:",",grouping:[3],currency:["$",""]});function defaultLocale$1(tt){return locale$1=formatLocale$1(tt),format=locale$1.format,formatPrefix=locale$1.formatPrefix,locale$1}function precisionFixed(tt){return Math.max(0,-exponent(Math.abs(tt)))}function precisionPrefix(tt,et){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(et)/3)))*3-exponent(Math.abs(tt)))}function precisionRound(tt,et){return tt=Math.abs(tt),et=Math.abs(et)-tt,Math.max(0,exponent(et)-exponent(tt))+1}function tickFormat(tt,et,nt,it){var rt=tickStep(tt,et,nt),ot;switch(it=formatSpecifier(it??",f"),it.type){case"s":{var at=Math.max(Math.abs(tt),Math.abs(et));return it.precision==null&&!isNaN(ot=precisionPrefix(rt,at))&&(it.precision=ot),formatPrefix(it,at)}case"":case"e":case"g":case"p":case"r":{it.precision==null&&!isNaN(ot=precisionRound(rt,Math.max(Math.abs(tt),Math.abs(et))))&&(it.precision=ot-(it.type==="e"));break}case"f":case"%":{it.precision==null&&!isNaN(ot=precisionFixed(rt))&&(it.precision=ot-(it.type==="%")*2);break}}return format(it)}function linearish(tt){var et=tt.domain;return tt.ticks=function(nt){var it=et();return ticks(it[0],it[it.length-1],nt??10)},tt.tickFormat=function(nt,it){var rt=et();return tickFormat(rt[0],rt[rt.length-1],nt??10,it)},tt.nice=function(nt){nt==null&&(nt=10);var it=et(),rt=0,ot=it.length-1,at=it[rt],st=it[ot],lt,ct,ut=10;for(st0;){if(ct=tickIncrement(at,st,nt),ct===lt)return it[rt]=at,it[ot]=st,et(it);if(ct>0)at=Math.floor(at/ct)*ct,st=Math.ceil(st/ct)*ct;else if(ct<0)at=Math.ceil(at*ct)/ct,st=Math.floor(st*ct)/ct;else break;lt=ct}return tt},tt}function linear(){var tt=continuous();return tt.copy=function(){return copy$1(tt,linear())},initRange.apply(tt,arguments),linearish(tt)}function identity$4(tt){var et;function nt(it){return it==null||isNaN(it=+it)?et:it}return nt.invert=nt,nt.domain=nt.range=function(it){return arguments.length?(tt=Array.from(it,number$3),nt):tt.slice()},nt.unknown=function(it){return arguments.length?(et=it,nt):et},nt.copy=function(){return identity$4(tt).unknown(et)},tt=arguments.length?Array.from(tt,number$3):[0,1],linearish(nt)}function nice(tt,et){tt=tt.slice();var nt=0,it=tt.length-1,rt=tt[nt],ot=tt[it],at;return otMath.pow(tt,et)}function logp(tt){return tt===Math.E?Math.log:tt===10&&Math.log10||tt===2&&Math.log2||(tt=Math.log(tt),et=>Math.log(et)/tt)}function reflect(tt){return(et,nt)=>-tt(-et,nt)}function loggish(tt){const et=tt(transformLog,transformExp),nt=et.domain;let it=10,rt,ot;function at(){return rt=logp(it),ot=powp(it),nt()[0]<0?(rt=reflect(rt),ot=reflect(ot),tt(transformLogn,transformExpn)):tt(transformLog,transformExp),et}return et.base=function(st){return arguments.length?(it=+st,at()):it},et.domain=function(st){return arguments.length?(nt(st),at()):nt()},et.ticks=st=>{const lt=nt();let ct=lt[0],ut=lt[lt.length-1];const ht=ut0){for(;dt<=pt;++dt)for(mt=1;mtut)break;yt.push(gt)}}else for(;dt<=pt;++dt)for(mt=it-1;mt>=1;--mt)if(gt=dt>0?mt/ot(-dt):mt*ot(dt),!(gtut)break;yt.push(gt)}yt.length*2{if(st==null&&(st=10),lt==null&&(lt=it===10?"s":","),typeof lt!="function"&&(!(it%1)&&(lt=formatSpecifier(lt)).precision==null&&(lt.trim=!0),lt=format(lt)),st===1/0)return lt;const ct=Math.max(1,it*st/et.ticks().length);return ut=>{let ht=ut/ot(Math.round(rt(ut)));return ht*itnt(nice(nt(),{floor:st=>ot(Math.floor(rt(st))),ceil:st=>ot(Math.ceil(rt(st)))})),et}function log(){const tt=loggish(transformer$2()).domain([1,10]);return tt.copy=()=>copy$1(tt,log()).base(tt.base()),initRange.apply(tt,arguments),tt}function transformSymlog(tt){return function(et){return Math.sign(et)*Math.log1p(Math.abs(et/tt))}}function transformSymexp(tt){return function(et){return Math.sign(et)*Math.expm1(Math.abs(et))*tt}}function symlogish(tt){var et=1,nt=tt(transformSymlog(et),transformSymexp(et));return nt.constant=function(it){return arguments.length?tt(transformSymlog(et=+it),transformSymexp(et)):et},linearish(nt)}function symlog(){var tt=symlogish(transformer$2());return tt.copy=function(){return copy$1(tt,symlog()).constant(tt.constant())},initRange.apply(tt,arguments)}function transformPow(tt){return function(et){return et<0?-Math.pow(-et,tt):Math.pow(et,tt)}}function transformSqrt(tt){return tt<0?-Math.sqrt(-tt):Math.sqrt(tt)}function transformSquare(tt){return tt<0?-tt*tt:tt*tt}function powish(tt){var et=tt(identity$6,identity$6),nt=1;function it(){return nt===1?tt(identity$6,identity$6):nt===.5?tt(transformSqrt,transformSquare):tt(transformPow(nt),transformPow(1/nt))}return et.exponent=function(rt){return arguments.length?(nt=+rt,it()):nt},linearish(et)}function pow(){var tt=powish(transformer$2());return tt.copy=function(){return copy$1(tt,pow()).exponent(tt.exponent())},initRange.apply(tt,arguments),tt}function sqrt(){return pow.apply(null,arguments).exponent(.5)}function square(tt){return Math.sign(tt)*tt*tt}function unsquare(tt){return Math.sign(tt)*Math.sqrt(Math.abs(tt))}function radial(){var tt=continuous(),et=[0,1],nt=!1,it;function rt(ot){var at=unsquare(tt(ot));return isNaN(at)?it:nt?Math.round(at):at}return rt.invert=function(ot){return tt.invert(square(ot))},rt.domain=function(ot){return arguments.length?(tt.domain(ot),rt):tt.domain()},rt.range=function(ot){return arguments.length?(tt.range((et=Array.from(ot,number$3)).map(square)),rt):et.slice()},rt.rangeRound=function(ot){return rt.range(ot).round(!0)},rt.round=function(ot){return arguments.length?(nt=!!ot,rt):nt},rt.clamp=function(ot){return arguments.length?(tt.clamp(ot),rt):tt.clamp()},rt.unknown=function(ot){return arguments.length?(it=ot,rt):it},rt.copy=function(){return radial(tt.domain(),et).round(nt).clamp(tt.clamp()).unknown(it)},initRange.apply(rt,arguments),linearish(rt)}function quantile(){var tt=[],et=[],nt=[],it;function rt(){var at=0,st=Math.max(1,et.length);for(nt=new Array(st-1);++at0?nt[st-1]:tt[0],st=nt?[it[nt-1],et]:[it[ct-1],it[ct]]},at.unknown=function(lt){return arguments.length&&(ot=lt),at},at.thresholds=function(){return it.slice()},at.copy=function(){return quantize().domain([tt,et]).range(rt).unknown(ot)},initRange.apply(linearish(at),arguments)}function threshold(){var tt=[.5],et=[0,1],nt,it=1;function rt(ot){return ot!=null&&ot<=ot?et[bisect(tt,ot,0,it)]:nt}return rt.domain=function(ot){return arguments.length?(tt=Array.from(ot),it=Math.min(tt.length,et.length-1),rt):tt.slice()},rt.range=function(ot){return arguments.length?(et=Array.from(ot),it=Math.min(tt.length,et.length-1),rt):et.slice()},rt.invertExtent=function(ot){var at=et.indexOf(ot);return[tt[at-1],tt[at]]},rt.unknown=function(ot){return arguments.length?(nt=ot,rt):nt},rt.copy=function(){return threshold().domain(tt).range(et).unknown(nt)},initRange.apply(rt,arguments)}const t0=new Date,t1=new Date;function timeInterval(tt,et,nt,it){function rt(ot){return tt(ot=arguments.length===0?new Date:new Date(+ot)),ot}return rt.floor=ot=>(tt(ot=new Date(+ot)),ot),rt.ceil=ot=>(tt(ot=new Date(ot-1)),et(ot,1),tt(ot),ot),rt.round=ot=>{const at=rt(ot),st=rt.ceil(ot);return ot-at(et(ot=new Date(+ot),at==null?1:Math.floor(at)),ot),rt.range=(ot,at,st)=>{const lt=[];if(ot=rt.ceil(ot),st=st==null?1:Math.floor(st),!(ot0))return lt;let ct;do lt.push(ct=new Date(+ot)),et(ot,st),tt(ot);while(cttimeInterval(at=>{if(at>=at)for(;tt(at),!ot(at);)at.setTime(at-1)},(at,st)=>{if(at>=at)if(st<0)for(;++st<=0;)for(;et(at,-1),!ot(at););else for(;--st>=0;)for(;et(at,1),!ot(at););}),nt&&(rt.count=(ot,at)=>(t0.setTime(+ot),t1.setTime(+at),tt(t0),tt(t1),Math.floor(nt(t0,t1))),rt.every=ot=>(ot=Math.floor(ot),!isFinite(ot)||!(ot>0)?null:ot>1?rt.filter(it?at=>it(at)%ot===0:at=>rt.count(0,at)%ot===0):rt)),rt}const millisecond=timeInterval(()=>{},(tt,et)=>{tt.setTime(+tt+et)},(tt,et)=>et-tt);millisecond.every=tt=>(tt=Math.floor(tt),!isFinite(tt)||!(tt>0)?null:tt>1?timeInterval(et=>{et.setTime(Math.floor(et/tt)*tt)},(et,nt)=>{et.setTime(+et+nt*tt)},(et,nt)=>(nt-et)/tt):millisecond);millisecond.range;const durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,second=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds())},(tt,et)=>{tt.setTime(+tt+et*durationSecond)},(tt,et)=>(et-tt)/durationSecond,tt=>tt.getUTCSeconds());second.range;const timeMinute=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds()-tt.getSeconds()*durationSecond)},(tt,et)=>{tt.setTime(+tt+et*durationMinute)},(tt,et)=>(et-tt)/durationMinute,tt=>tt.getMinutes());timeMinute.range;const utcMinute=timeInterval(tt=>{tt.setUTCSeconds(0,0)},(tt,et)=>{tt.setTime(+tt+et*durationMinute)},(tt,et)=>(et-tt)/durationMinute,tt=>tt.getUTCMinutes());utcMinute.range;const timeHour=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds()-tt.getSeconds()*durationSecond-tt.getMinutes()*durationMinute)},(tt,et)=>{tt.setTime(+tt+et*durationHour)},(tt,et)=>(et-tt)/durationHour,tt=>tt.getHours());timeHour.range;const utcHour=timeInterval(tt=>{tt.setUTCMinutes(0,0,0)},(tt,et)=>{tt.setTime(+tt+et*durationHour)},(tt,et)=>(et-tt)/durationHour,tt=>tt.getUTCHours());utcHour.range;const timeDay=timeInterval(tt=>tt.setHours(0,0,0,0),(tt,et)=>tt.setDate(tt.getDate()+et),(tt,et)=>(et-tt-(et.getTimezoneOffset()-tt.getTimezoneOffset())*durationMinute)/durationDay,tt=>tt.getDate()-1);timeDay.range;const utcDay=timeInterval(tt=>{tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCDate(tt.getUTCDate()+et)},(tt,et)=>(et-tt)/durationDay,tt=>tt.getUTCDate()-1);utcDay.range;const unixDay=timeInterval(tt=>{tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCDate(tt.getUTCDate()+et)},(tt,et)=>(et-tt)/durationDay,tt=>Math.floor(tt/durationDay));unixDay.range;function timeWeekday(tt){return timeInterval(et=>{et.setDate(et.getDate()-(et.getDay()+7-tt)%7),et.setHours(0,0,0,0)},(et,nt)=>{et.setDate(et.getDate()+nt*7)},(et,nt)=>(nt-et-(nt.getTimezoneOffset()-et.getTimezoneOffset())*durationMinute)/durationWeek)}const timeSunday=timeWeekday(0),timeMonday=timeWeekday(1),timeTuesday=timeWeekday(2),timeWednesday=timeWeekday(3),timeThursday=timeWeekday(4),timeFriday=timeWeekday(5),timeSaturday=timeWeekday(6);timeSunday.range;timeMonday.range;timeTuesday.range;timeWednesday.range;timeThursday.range;timeFriday.range;timeSaturday.range;function utcWeekday(tt){return timeInterval(et=>{et.setUTCDate(et.getUTCDate()-(et.getUTCDay()+7-tt)%7),et.setUTCHours(0,0,0,0)},(et,nt)=>{et.setUTCDate(et.getUTCDate()+nt*7)},(et,nt)=>(nt-et)/durationWeek)}const utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6);utcSunday.range;utcMonday.range;utcTuesday.range;utcWednesday.range;utcThursday.range;utcFriday.range;utcSaturday.range;const timeMonth=timeInterval(tt=>{tt.setDate(1),tt.setHours(0,0,0,0)},(tt,et)=>{tt.setMonth(tt.getMonth()+et)},(tt,et)=>et.getMonth()-tt.getMonth()+(et.getFullYear()-tt.getFullYear())*12,tt=>tt.getMonth());timeMonth.range;const utcMonth=timeInterval(tt=>{tt.setUTCDate(1),tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCMonth(tt.getUTCMonth()+et)},(tt,et)=>et.getUTCMonth()-tt.getUTCMonth()+(et.getUTCFullYear()-tt.getUTCFullYear())*12,tt=>tt.getUTCMonth());utcMonth.range;const timeYear=timeInterval(tt=>{tt.setMonth(0,1),tt.setHours(0,0,0,0)},(tt,et)=>{tt.setFullYear(tt.getFullYear()+et)},(tt,et)=>et.getFullYear()-tt.getFullYear(),tt=>tt.getFullYear());timeYear.every=tt=>!isFinite(tt=Math.floor(tt))||!(tt>0)?null:timeInterval(et=>{et.setFullYear(Math.floor(et.getFullYear()/tt)*tt),et.setMonth(0,1),et.setHours(0,0,0,0)},(et,nt)=>{et.setFullYear(et.getFullYear()+nt*tt)});timeYear.range;const utcYear=timeInterval(tt=>{tt.setUTCMonth(0,1),tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCFullYear(tt.getUTCFullYear()+et)},(tt,et)=>et.getUTCFullYear()-tt.getUTCFullYear(),tt=>tt.getUTCFullYear());utcYear.every=tt=>!isFinite(tt=Math.floor(tt))||!(tt>0)?null:timeInterval(et=>{et.setUTCFullYear(Math.floor(et.getUTCFullYear()/tt)*tt),et.setUTCMonth(0,1),et.setUTCHours(0,0,0,0)},(et,nt)=>{et.setUTCFullYear(et.getUTCFullYear()+nt*tt)});utcYear.range;function ticker(tt,et,nt,it,rt,ot){const at=[[second,1,durationSecond],[second,5,5*durationSecond],[second,15,15*durationSecond],[second,30,30*durationSecond],[ot,1,durationMinute],[ot,5,5*durationMinute],[ot,15,15*durationMinute],[ot,30,30*durationMinute],[rt,1,durationHour],[rt,3,3*durationHour],[rt,6,6*durationHour],[rt,12,12*durationHour],[it,1,durationDay],[it,2,2*durationDay],[nt,1,durationWeek],[et,1,durationMonth],[et,3,3*durationMonth],[tt,1,durationYear]];function st(ct,ut,ht){const dt=utbt).right(at,dt);if(pt===at.length)return tt.every(tickStep(ct/durationYear,ut/durationYear,ht));if(pt===0)return millisecond.every(Math.max(tickStep(ct,ut,ht),1));const[mt,gt]=at[dt/at[pt-1][2]53)return null;"w"in Zt||(Zt.w=1),"Z"in Zt?(Tn=utcDate(newDate(Zt.y,0,1)),Cn=Tn.getUTCDay(),Tn=Cn>4||Cn===0?utcMonday.ceil(Tn):utcMonday(Tn),Tn=utcDay.offset(Tn,(Zt.V-1)*7),Zt.y=Tn.getUTCFullYear(),Zt.m=Tn.getUTCMonth(),Zt.d=Tn.getUTCDate()+(Zt.w+6)%7):(Tn=localDate(newDate(Zt.y,0,1)),Cn=Tn.getDay(),Tn=Cn>4||Cn===0?timeMonday.ceil(Tn):timeMonday(Tn),Tn=timeDay.offset(Tn,(Zt.V-1)*7),Zt.y=Tn.getFullYear(),Zt.m=Tn.getMonth(),Zt.d=Tn.getDate()+(Zt.w+6)%7)}else("W"in Zt||"U"in Zt)&&("w"in Zt||(Zt.w="u"in Zt?Zt.u%7:"W"in Zt?1:0),Cn="Z"in Zt?utcDate(newDate(Zt.y,0,1)).getUTCDay():localDate(newDate(Zt.y,0,1)).getDay(),Zt.m=0,Zt.d="W"in Zt?(Zt.w+6)%7+Zt.W*7-(Cn+5)%7:Zt.w+Zt.U*7-(Cn+6)%7);return"Z"in Zt?(Zt.H+=Zt.Z/100|0,Zt.M+=Zt.Z%100,utcDate(Zt)):localDate(Zt)}}function Tt(pn,vn,sn,Zt){for(var Sn=0,Tn=vn.length,Cn=sn.length,jn,Un;Sn=Cn)return-1;if(jn=vn.charCodeAt(Sn++),jn===37){if(jn=vn.charAt(Sn++),Un=St[jn in pads?vn.charAt(Sn++):jn],!Un||(Zt=Un(pn,sn,Zt))<0)return-1}else if(jn!=sn.charCodeAt(Zt++))return-1}return Zt}function $t(pn,vn,sn){var Zt=ct.exec(vn.slice(sn));return Zt?(pn.p=ut.get(Zt[0].toLowerCase()),sn+Zt[0].length):-1}function Ut(pn,vn,sn){var Zt=pt.exec(vn.slice(sn));return Zt?(pn.w=mt.get(Zt[0].toLowerCase()),sn+Zt[0].length):-1}function Lt(pn,vn,sn){var Zt=ht.exec(vn.slice(sn));return Zt?(pn.w=dt.get(Zt[0].toLowerCase()),sn+Zt[0].length):-1}function Bt(pn,vn,sn){var Zt=yt.exec(vn.slice(sn));return Zt?(pn.m=wt.get(Zt[0].toLowerCase()),sn+Zt[0].length):-1}function Pt(pn,vn,sn){var Zt=gt.exec(vn.slice(sn));return Zt?(pn.m=bt.get(Zt[0].toLowerCase()),sn+Zt[0].length):-1}function kt(pn,vn,sn){return Tt(pn,et,vn,sn)}function At(pn,vn,sn){return Tt(pn,nt,vn,sn)}function Rt(pn,vn,sn){return Tt(pn,it,vn,sn)}function Wt(pn){return at[pn.getDay()]}function jt(pn){return ot[pn.getDay()]}function Ot(pn){return lt[pn.getMonth()]}function Ct(pn){return st[pn.getMonth()]}function Dt(pn){return rt[+(pn.getHours()>=12)]}function Mt(pn){return 1+~~(pn.getMonth()/3)}function Vt(pn){return at[pn.getUTCDay()]}function Qt(pn){return ot[pn.getUTCDay()]}function rn(pn){return lt[pn.getUTCMonth()]}function Xt(pn){return st[pn.getUTCMonth()]}function an(pn){return rt[+(pn.getUTCHours()>=12)]}function tn(pn){return 1+~~(pn.getUTCMonth()/3)}return{format:function(pn){var vn=Et(pn+="",vt);return vn.toString=function(){return pn},vn},parse:function(pn){var vn=It(pn+="",!1);return vn.toString=function(){return pn},vn},utcFormat:function(pn){var vn=Et(pn+="",xt);return vn.toString=function(){return pn},vn},utcParse:function(pn){var vn=It(pn+="",!0);return vn.toString=function(){return pn},vn}}}var pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function pad(tt,et,nt){var it=tt<0?"-":"",rt=(it?-tt:tt)+"",ot=rt.length;return it+(ot[et.toLowerCase(),nt]))}function parseWeekdayNumberSunday(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+1));return it?(tt.w=+it[0],nt+it[0].length):-1}function parseWeekdayNumberMonday(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+1));return it?(tt.u=+it[0],nt+it[0].length):-1}function parseWeekNumberSunday(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.U=+it[0],nt+it[0].length):-1}function parseWeekNumberISO(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.V=+it[0],nt+it[0].length):-1}function parseWeekNumberMonday(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.W=+it[0],nt+it[0].length):-1}function parseFullYear(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+4));return it?(tt.y=+it[0],nt+it[0].length):-1}function parseYear(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.y=+it[0]+(+it[0]>68?1900:2e3),nt+it[0].length):-1}function parseZone(tt,et,nt){var it=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(et.slice(nt,nt+6));return it?(tt.Z=it[1]?0:-(it[2]+(it[3]||"00")),nt+it[0].length):-1}function parseQuarter(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+1));return it?(tt.q=it[0]*3-3,nt+it[0].length):-1}function parseMonthNumber(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.m=it[0]-1,nt+it[0].length):-1}function parseDayOfMonth(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.d=+it[0],nt+it[0].length):-1}function parseDayOfYear(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+3));return it?(tt.m=0,tt.d=+it[0],nt+it[0].length):-1}function parseHour24(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.H=+it[0],nt+it[0].length):-1}function parseMinutes(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.M=+it[0],nt+it[0].length):-1}function parseSeconds(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.S=+it[0],nt+it[0].length):-1}function parseMilliseconds(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+3));return it?(tt.L=+it[0],nt+it[0].length):-1}function parseMicroseconds(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+6));return it?(tt.L=Math.floor(it[0]/1e3),nt+it[0].length):-1}function parseLiteralPercent(tt,et,nt){var it=percentRe.exec(et.slice(nt,nt+1));return it?nt+it[0].length:-1}function parseUnixTimestamp(tt,et,nt){var it=numberRe.exec(et.slice(nt));return it?(tt.Q=+it[0],nt+it[0].length):-1}function parseUnixTimestampSeconds(tt,et,nt){var it=numberRe.exec(et.slice(nt));return it?(tt.s=+it[0],nt+it[0].length):-1}function formatDayOfMonth(tt,et){return pad(tt.getDate(),et,2)}function formatHour24(tt,et){return pad(tt.getHours(),et,2)}function formatHour12(tt,et){return pad(tt.getHours()%12||12,et,2)}function formatDayOfYear(tt,et){return pad(1+timeDay.count(timeYear(tt),tt),et,3)}function formatMilliseconds(tt,et){return pad(tt.getMilliseconds(),et,3)}function formatMicroseconds(tt,et){return formatMilliseconds(tt,et)+"000"}function formatMonthNumber(tt,et){return pad(tt.getMonth()+1,et,2)}function formatMinutes(tt,et){return pad(tt.getMinutes(),et,2)}function formatSeconds(tt,et){return pad(tt.getSeconds(),et,2)}function formatWeekdayNumberMonday(tt){var et=tt.getDay();return et===0?7:et}function formatWeekNumberSunday(tt,et){return pad(timeSunday.count(timeYear(tt)-1,tt),et,2)}function dISO(tt){var et=tt.getDay();return et>=4||et===0?timeThursday(tt):timeThursday.ceil(tt)}function formatWeekNumberISO(tt,et){return tt=dISO(tt),pad(timeThursday.count(timeYear(tt),tt)+(timeYear(tt).getDay()===4),et,2)}function formatWeekdayNumberSunday(tt){return tt.getDay()}function formatWeekNumberMonday(tt,et){return pad(timeMonday.count(timeYear(tt)-1,tt),et,2)}function formatYear(tt,et){return pad(tt.getFullYear()%100,et,2)}function formatYearISO(tt,et){return tt=dISO(tt),pad(tt.getFullYear()%100,et,2)}function formatFullYear(tt,et){return pad(tt.getFullYear()%1e4,et,4)}function formatFullYearISO(tt,et){var nt=tt.getDay();return tt=nt>=4||nt===0?timeThursday(tt):timeThursday.ceil(tt),pad(tt.getFullYear()%1e4,et,4)}function formatZone(tt){var et=tt.getTimezoneOffset();return(et>0?"-":(et*=-1,"+"))+pad(et/60|0,"0",2)+pad(et%60,"0",2)}function formatUTCDayOfMonth(tt,et){return pad(tt.getUTCDate(),et,2)}function formatUTCHour24(tt,et){return pad(tt.getUTCHours(),et,2)}function formatUTCHour12(tt,et){return pad(tt.getUTCHours()%12||12,et,2)}function formatUTCDayOfYear(tt,et){return pad(1+utcDay.count(utcYear(tt),tt),et,3)}function formatUTCMilliseconds(tt,et){return pad(tt.getUTCMilliseconds(),et,3)}function formatUTCMicroseconds(tt,et){return formatUTCMilliseconds(tt,et)+"000"}function formatUTCMonthNumber(tt,et){return pad(tt.getUTCMonth()+1,et,2)}function formatUTCMinutes(tt,et){return pad(tt.getUTCMinutes(),et,2)}function formatUTCSeconds(tt,et){return pad(tt.getUTCSeconds(),et,2)}function formatUTCWeekdayNumberMonday(tt){var et=tt.getUTCDay();return et===0?7:et}function formatUTCWeekNumberSunday(tt,et){return pad(utcSunday.count(utcYear(tt)-1,tt),et,2)}function UTCdISO(tt){var et=tt.getUTCDay();return et>=4||et===0?utcThursday(tt):utcThursday.ceil(tt)}function formatUTCWeekNumberISO(tt,et){return tt=UTCdISO(tt),pad(utcThursday.count(utcYear(tt),tt)+(utcYear(tt).getUTCDay()===4),et,2)}function formatUTCWeekdayNumberSunday(tt){return tt.getUTCDay()}function formatUTCWeekNumberMonday(tt,et){return pad(utcMonday.count(utcYear(tt)-1,tt),et,2)}function formatUTCYear(tt,et){return pad(tt.getUTCFullYear()%100,et,2)}function formatUTCYearISO(tt,et){return tt=UTCdISO(tt),pad(tt.getUTCFullYear()%100,et,2)}function formatUTCFullYear(tt,et){return pad(tt.getUTCFullYear()%1e4,et,4)}function formatUTCFullYearISO(tt,et){var nt=tt.getUTCDay();return tt=nt>=4||nt===0?utcThursday(tt):utcThursday.ceil(tt),pad(tt.getUTCFullYear()%1e4,et,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(tt){return+tt}function formatUnixTimestampSeconds(tt){return Math.floor(+tt/1e3)}var locale,timeFormat,utcFormat;defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function defaultLocale(tt){return locale=formatLocale(tt),timeFormat=locale.format,locale.parse,utcFormat=locale.utcFormat,locale.utcParse,locale}function date(tt){return new Date(tt)}function number$2(tt){return tt instanceof Date?+tt:+new Date(+tt)}function calendar(tt,et,nt,it,rt,ot,at,st,lt,ct){var ut=continuous(),ht=ut.invert,dt=ut.domain,pt=ct(".%L"),mt=ct(":%S"),gt=ct("%I:%M"),bt=ct("%I %p"),yt=ct("%a %d"),wt=ct("%b %d"),vt=ct("%B"),xt=ct("%Y");function St(Et){return(lt(Et)et(rt/(tt.length-1)))},nt.quantiles=function(it){return Array.from({length:it+1},(rt,ot)=>quantile$1(tt,ot/it))},nt.copy=function(){return sequentialQuantile(et).domain(tt)},initInterpolator.apply(nt,arguments)}function transformer(){var tt=0,et=.5,nt=1,it=1,rt,ot,at,st,lt,ct=identity$6,ut,ht=!1,dt;function pt(gt){return isNaN(gt=+gt)?dt:(gt=.5+((gt=+ut(gt))-ot)*(it*gtet}var _baseGt=baseGt$1,baseExtremum$1=_baseExtremum,baseGt=_baseGt,identity$3=identity_1;function max(tt){return tt&&tt.length?baseExtremum$1(tt,identity$3,baseGt):void 0}var max_1=max;const max$1=getDefaultExportFromCjs(max_1);function baseLt$1(tt,et){return tttt.e^ot.s<0?1:-1;for(it=ot.d.length,rt=tt.d.length,et=0,nt=ittt.d[et]^ot.s<0?1:-1;return it===rt?0:it>rt^ot.s<0?1:-1};P.decimalPlaces=P.dp=function(){var tt=this,et=tt.d.length-1,nt=(et-tt.e)*LOG_BASE;if(et=tt.d[et],et)for(;et%10==0;et/=10)nt--;return nt<0?0:nt};P.dividedBy=P.div=function(tt){return divide(this,new this.constructor(tt))};P.dividedToIntegerBy=P.idiv=function(tt){var et=this,nt=et.constructor;return round(divide(et,new nt(tt),0,1),nt.precision)};P.equals=P.eq=function(tt){return!this.cmp(tt)};P.exponent=function(){return getBase10Exponent(this)};P.greaterThan=P.gt=function(tt){return this.cmp(tt)>0};P.greaterThanOrEqualTo=P.gte=function(tt){return this.cmp(tt)>=0};P.isInteger=P.isint=function(){return this.e>this.d.length-2};P.isNegative=P.isneg=function(){return this.s<0};P.isPositive=P.ispos=function(){return this.s>0};P.isZero=function(){return this.s===0};P.lessThan=P.lt=function(tt){return this.cmp(tt)<0};P.lessThanOrEqualTo=P.lte=function(tt){return this.cmp(tt)<1};P.logarithm=P.log=function(tt){var et,nt=this,it=nt.constructor,rt=it.precision,ot=rt+5;if(tt===void 0)tt=new it(10);else if(tt=new it(tt),tt.s<1||tt.eq(ONE))throw Error(decimalError+"NaN");if(nt.s<1)throw Error(decimalError+(nt.s?"NaN":"-Infinity"));return nt.eq(ONE)?new it(0):(external=!1,et=divide(ln(nt,ot),ln(tt,ot),ot),external=!0,round(et,rt))};P.minus=P.sub=function(tt){var et=this;return tt=new et.constructor(tt),et.s==tt.s?subtract(et,tt):add(et,(tt.s=-tt.s,tt))};P.modulo=P.mod=function(tt){var et,nt=this,it=nt.constructor,rt=it.precision;if(tt=new it(tt),!tt.s)throw Error(decimalError+"NaN");return nt.s?(external=!1,et=divide(nt,tt,0,1).times(tt),external=!0,nt.minus(et)):round(new it(nt),rt)};P.naturalExponential=P.exp=function(){return exp(this)};P.naturalLogarithm=P.ln=function(){return ln(this)};P.negated=P.neg=function(){var tt=new this.constructor(this);return tt.s=-tt.s||0,tt};P.plus=P.add=function(tt){var et=this;return tt=new et.constructor(tt),et.s==tt.s?add(et,tt):subtract(et,(tt.s=-tt.s,tt))};P.precision=P.sd=function(tt){var et,nt,it,rt=this;if(tt!==void 0&&tt!==!!tt&&tt!==1&&tt!==0)throw Error(invalidArgument+tt);if(et=getBase10Exponent(rt)+1,it=rt.d.length-1,nt=it*LOG_BASE+1,it=rt.d[it],it){for(;it%10==0;it/=10)nt--;for(it=rt.d[0];it>=10;it/=10)nt++}return tt&&et>nt?et:nt};P.squareRoot=P.sqrt=function(){var tt,et,nt,it,rt,ot,at,st=this,lt=st.constructor;if(st.s<1){if(!st.s)return new lt(0);throw Error(decimalError+"NaN")}for(tt=getBase10Exponent(st),external=!1,rt=Math.sqrt(+st),rt==0||rt==1/0?(et=digitsToString(st.d),(et.length+tt)%2==0&&(et+="0"),rt=Math.sqrt(et),tt=mathfloor((tt+1)/2)-(tt<0||tt%2),rt==1/0?et="5e"+tt:(et=rt.toExponential(),et=et.slice(0,et.indexOf("e")+1)+tt),it=new lt(et)):it=new lt(rt.toString()),nt=lt.precision,rt=at=nt+3;;)if(ot=it,it=ot.plus(divide(st,ot,at+2)).times(.5),digitsToString(ot.d).slice(0,at)===(et=digitsToString(it.d)).slice(0,at)){if(et=et.slice(at-3,at+1),rt==at&&et=="4999"){if(round(ot,nt+1,0),ot.times(ot).eq(st)){it=ot;break}}else if(et!="9999")break;at+=4}return external=!0,round(it,nt)};P.times=P.mul=function(tt){var et,nt,it,rt,ot,at,st,lt,ct,ut=this,ht=ut.constructor,dt=ut.d,pt=(tt=new ht(tt)).d;if(!ut.s||!tt.s)return new ht(0);for(tt.s*=ut.s,nt=ut.e+tt.e,lt=dt.length,ct=pt.length,lt=0;){for(et=0,rt=lt+it;rt>it;)st=ot[rt]+pt[it]*dt[rt-it-1]+et,ot[rt--]=st%BASE|0,et=st/BASE|0;ot[rt]=(ot[rt]+et)%BASE|0}for(;!ot[--at];)ot.pop();return et?++nt:ot.shift(),tt.d=ot,tt.e=nt,external?round(tt,ht.precision):tt};P.toDecimalPlaces=P.todp=function(tt,et){var nt=this,it=nt.constructor;return nt=new it(nt),tt===void 0?nt:(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=it.rounding:checkInt32(et,0,8),round(nt,tt+getBase10Exponent(nt)+1,et))};P.toExponential=function(tt,et){var nt,it=this,rt=it.constructor;return tt===void 0?nt=toString$2(it,!0):(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=rt.rounding:checkInt32(et,0,8),it=round(new rt(it),tt+1,et),nt=toString$2(it,!0,tt+1)),nt};P.toFixed=function(tt,et){var nt,it,rt=this,ot=rt.constructor;return tt===void 0?toString$2(rt):(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=ot.rounding:checkInt32(et,0,8),it=round(new ot(rt),tt+getBase10Exponent(rt)+1,et),nt=toString$2(it.abs(),!1,tt+getBase10Exponent(it)+1),rt.isneg()&&!rt.isZero()?"-"+nt:nt)};P.toInteger=P.toint=function(){var tt=this,et=tt.constructor;return round(new et(tt),getBase10Exponent(tt)+1,et.rounding)};P.toNumber=function(){return+this};P.toPower=P.pow=function(tt){var et,nt,it,rt,ot,at,st=this,lt=st.constructor,ct=12,ut=+(tt=new lt(tt));if(!tt.s)return new lt(ONE);if(st=new lt(st),!st.s){if(tt.s<1)throw Error(decimalError+"Infinity");return st}if(st.eq(ONE))return st;if(it=lt.precision,tt.eq(ONE))return round(st,it);if(et=tt.e,nt=tt.d.length-1,at=et>=nt,ot=st.s,at){if((nt=ut<0?-ut:ut)<=MAX_SAFE_INTEGER){for(rt=new lt(ONE),et=Math.ceil(it/LOG_BASE+4),external=!1;nt%2&&(rt=rt.times(st),truncate(rt.d,et)),nt=mathfloor(nt/2),nt!==0;)st=st.times(st),truncate(st.d,et);return external=!0,tt.s<0?new lt(ONE).div(rt):round(rt,it)}}else if(ot<0)throw Error(decimalError+"NaN");return ot=ot<0&&tt.d[Math.max(et,nt)]&1?-1:1,st.s=1,external=!1,rt=tt.times(ln(st,it+ct)),external=!0,rt=exp(rt),rt.s=ot,rt};P.toPrecision=function(tt,et){var nt,it,rt=this,ot=rt.constructor;return tt===void 0?(nt=getBase10Exponent(rt),it=toString$2(rt,nt<=ot.toExpNeg||nt>=ot.toExpPos)):(checkInt32(tt,1,MAX_DIGITS),et===void 0?et=ot.rounding:checkInt32(et,0,8),rt=round(new ot(rt),tt,et),nt=getBase10Exponent(rt),it=toString$2(rt,tt<=nt||nt<=ot.toExpNeg,tt)),it};P.toSignificantDigits=P.tosd=function(tt,et){var nt=this,it=nt.constructor;return tt===void 0?(tt=it.precision,et=it.rounding):(checkInt32(tt,1,MAX_DIGITS),et===void 0?et=it.rounding:checkInt32(et,0,8)),round(new it(nt),tt,et)};P.toString=P.valueOf=P.val=P.toJSON=P[Symbol.for("nodejs.util.inspect.custom")]=function(){var tt=this,et=getBase10Exponent(tt),nt=tt.constructor;return toString$2(tt,et<=nt.toExpNeg||et>=nt.toExpPos)};function add(tt,et){var nt,it,rt,ot,at,st,lt,ct,ut=tt.constructor,ht=ut.precision;if(!tt.s||!et.s)return et.s||(et=new ut(tt)),external?round(et,ht):et;if(lt=tt.d,ct=et.d,at=tt.e,rt=et.e,lt=lt.slice(),ot=at-rt,ot){for(ot<0?(it=lt,ot=-ot,st=ct.length):(it=ct,rt=at,st=lt.length),at=Math.ceil(ht/LOG_BASE),st=at>st?at+1:st+1,ot>st&&(ot=st,it.length=1),it.reverse();ot--;)it.push(0);it.reverse()}for(st=lt.length,ot=ct.length,st-ot<0&&(ot=st,it=ct,ct=lt,lt=it),nt=0;ot;)nt=(lt[--ot]=lt[ot]+ct[ot]+nt)/BASE|0,lt[ot]%=BASE;for(nt&&(lt.unshift(nt),++rt),st=lt.length;lt[--st]==0;)lt.pop();return et.d=lt,et.e=rt,external?round(et,ht):et}function checkInt32(tt,et,nt){if(tt!==~~tt||ttnt)throw Error(invalidArgument+tt)}function digitsToString(tt){var et,nt,it,rt=tt.length-1,ot="",at=tt[0];if(rt>0){for(ot+=at,et=1;etat?1:-1;else for(st=lt=0;strt[st]?1:-1;break}return lt}function nt(it,rt,ot){for(var at=0;ot--;)it[ot]-=at,at=it[ot]1;)it.shift()}return function(it,rt,ot,at){var st,lt,ct,ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,It,Tt,$t=it.constructor,Ut=it.s==rt.s?1:-1,Lt=it.d,Bt=rt.d;if(!it.s)return new $t(it);if(!rt.s)throw Error(decimalError+"Division by zero");for(lt=it.e-rt.e,It=Bt.length,St=Lt.length,pt=new $t(Ut),mt=pt.d=[],ct=0;Bt[ct]==(Lt[ct]||0);)++ct;if(Bt[ct]>(Lt[ct]||0)&&--lt,ot==null?wt=ot=$t.precision:at?wt=ot+(getBase10Exponent(it)-getBase10Exponent(rt))+1:wt=ot,wt<0)return new $t(0);if(wt=wt/LOG_BASE+2|0,ct=0,It==1)for(ut=0,Bt=Bt[0],wt++;(ct1&&(Bt=tt(Bt,ut),Lt=tt(Lt,ut),It=Bt.length,St=Lt.length),xt=It,gt=Lt.slice(0,It),bt=gt.length;bt=BASE/2&&++Et;do ut=0,st=et(Bt,gt,It,bt),st<0?(yt=gt[0],It!=bt&&(yt=yt*BASE+(gt[1]||0)),ut=yt/Et|0,ut>1?(ut>=BASE&&(ut=BASE-1),ht=tt(Bt,ut),dt=ht.length,bt=gt.length,st=et(ht,gt,dt,bt),st==1&&(ut--,nt(ht,It16)throw Error(exponentOutOfRange+getBase10Exponent(tt));if(!tt.s)return new ut(ONE);for(et==null?(external=!1,st=ht):st=et,at=new ut(.03125);tt.abs().gte(.1);)tt=tt.times(at),ct+=5;for(it=Math.log(mathpow(2,ct))/Math.LN10*2+5|0,st+=it,nt=rt=ot=new ut(ONE),ut.precision=st;;){if(rt=round(rt.times(tt),st),nt=nt.times(++lt),at=ot.plus(divide(rt,nt,st)),digitsToString(at.d).slice(0,st)===digitsToString(ot.d).slice(0,st)){for(;ct--;)ot=round(ot.times(ot),st);return ut.precision=ht,et==null?(external=!0,round(ot,ht)):ot}ot=at}}function getBase10Exponent(tt){for(var et=tt.e*LOG_BASE,nt=tt.d[0];nt>=10;nt/=10)et++;return et}function getLn10(tt,et,nt){if(et>tt.LN10.sd())throw external=!0,nt&&(tt.precision=nt),Error(decimalError+"LN10 precision limit exceeded");return round(new tt(tt.LN10),et)}function getZeroString(tt){for(var et="";tt--;)et+="0";return et}function ln(tt,et){var nt,it,rt,ot,at,st,lt,ct,ut,ht=1,dt=10,pt=tt,mt=pt.d,gt=pt.constructor,bt=gt.precision;if(pt.s<1)throw Error(decimalError+(pt.s?"NaN":"-Infinity"));if(pt.eq(ONE))return new gt(0);if(et==null?(external=!1,ct=bt):ct=et,pt.eq(10))return et==null&&(external=!0),getLn10(gt,ct);if(ct+=dt,gt.precision=ct,nt=digitsToString(mt),it=nt.charAt(0),ot=getBase10Exponent(pt),Math.abs(ot)<15e14){for(;it<7&&it!=1||it==1&&nt.charAt(1)>3;)pt=pt.times(tt),nt=digitsToString(pt.d),it=nt.charAt(0),ht++;ot=getBase10Exponent(pt),it>1?(pt=new gt("0."+nt),ot++):pt=new gt(it+"."+nt.slice(1))}else return lt=getLn10(gt,ct+2,bt).times(ot+""),pt=ln(new gt(it+"."+nt.slice(1)),ct-dt).plus(lt),gt.precision=bt,et==null?(external=!0,round(pt,bt)):pt;for(st=at=pt=divide(pt.minus(ONE),pt.plus(ONE),ct),ut=round(pt.times(pt),ct),rt=3;;){if(at=round(at.times(ut),ct),lt=st.plus(divide(at,new gt(rt),ct)),digitsToString(lt.d).slice(0,ct)===digitsToString(st.d).slice(0,ct))return st=st.times(2),ot!==0&&(st=st.plus(getLn10(gt,ct+2,bt).times(ot+""))),st=divide(st,new gt(ht),ct),gt.precision=bt,et==null?(external=!0,round(st,bt)):st;st=lt,rt+=2}}function parseDecimal(tt,et){var nt,it,rt;for((nt=et.indexOf("."))>-1&&(et=et.replace(".","")),(it=et.search(/e/i))>0?(nt<0&&(nt=it),nt+=+et.slice(it+1),et=et.substring(0,it)):nt<0&&(nt=et.length),it=0;et.charCodeAt(it)===48;)++it;for(rt=et.length;et.charCodeAt(rt-1)===48;)--rt;if(et=et.slice(it,rt),et){if(rt-=it,nt=nt-it-1,tt.e=mathfloor(nt/LOG_BASE),tt.d=[],it=(nt+1)%LOG_BASE,nt<0&&(it+=LOG_BASE),itMAX_E||tt.e<-MAX_E))throw Error(exponentOutOfRange+nt)}else tt.s=0,tt.e=0,tt.d=[0];return tt}function round(tt,et,nt){var it,rt,ot,at,st,lt,ct,ut,ht=tt.d;for(at=1,ot=ht[0];ot>=10;ot/=10)at++;if(it=et-at,it<0)it+=LOG_BASE,rt=et,ct=ht[ut=0];else{if(ut=Math.ceil((it+1)/LOG_BASE),ot=ht.length,ut>=ot)return tt;for(ct=ot=ht[ut],at=1;ot>=10;ot/=10)at++;it%=LOG_BASE,rt=it-LOG_BASE+at}if(nt!==void 0&&(ot=mathpow(10,at-rt-1),st=ct/ot%10|0,lt=et<0||ht[ut+1]!==void 0||ct%ot,lt=nt<4?(st||lt)&&(nt==0||nt==(tt.s<0?3:2)):st>5||st==5&&(nt==4||lt||nt==6&&(it>0?rt>0?ct/mathpow(10,at-rt):0:ht[ut-1])%10&1||nt==(tt.s<0?8:7))),et<1||!ht[0])return lt?(ot=getBase10Exponent(tt),ht.length=1,et=et-ot-1,ht[0]=mathpow(10,(LOG_BASE-et%LOG_BASE)%LOG_BASE),tt.e=mathfloor(-et/LOG_BASE)||0):(ht.length=1,ht[0]=tt.e=tt.s=0),tt;if(it==0?(ht.length=ut,ot=1,ut--):(ht.length=ut+1,ot=mathpow(10,LOG_BASE-it),ht[ut]=rt>0?(ct/mathpow(10,at-rt)%mathpow(10,rt)|0)*ot:0),lt)for(;;)if(ut==0){(ht[0]+=ot)==BASE&&(ht[0]=1,++tt.e);break}else{if(ht[ut]+=ot,ht[ut]!=BASE)break;ht[ut--]=0,ot=1}for(it=ht.length;ht[--it]===0;)ht.pop();if(external&&(tt.e>MAX_E||tt.e<-MAX_E))throw Error(exponentOutOfRange+getBase10Exponent(tt));return tt}function subtract(tt,et){var nt,it,rt,ot,at,st,lt,ct,ut,ht,dt=tt.constructor,pt=dt.precision;if(!tt.s||!et.s)return et.s?et.s=-et.s:et=new dt(tt),external?round(et,pt):et;if(lt=tt.d,ht=et.d,it=et.e,ct=tt.e,lt=lt.slice(),at=ct-it,at){for(ut=at<0,ut?(nt=lt,at=-at,st=ht.length):(nt=ht,it=ct,st=lt.length),rt=Math.max(Math.ceil(pt/LOG_BASE),st)+2,at>rt&&(at=rt,nt.length=1),nt.reverse(),rt=at;rt--;)nt.push(0);nt.reverse()}else{for(rt=lt.length,st=ht.length,ut=rt0;--rt)lt[st++]=0;for(rt=ht.length;rt>at;){if(lt[--rt]0?ot=ot.charAt(0)+"."+ot.slice(1)+getZeroString(it):at>1&&(ot=ot.charAt(0)+"."+ot.slice(1)),ot=ot+(rt<0?"e":"e+")+rt):rt<0?(ot="0."+getZeroString(-rt-1)+ot,nt&&(it=nt-at)>0&&(ot+=getZeroString(it))):rt>=at?(ot+=getZeroString(rt+1-at),nt&&(it=nt-rt-1)>0&&(ot=ot+"."+getZeroString(it))):((it=rt+1)0&&(rt+1===at&&(ot+="."),ot+=getZeroString(it))),tt.s<0?"-"+ot:ot}function truncate(tt,et){if(tt.length>et)return tt.length=et,!0}function clone(tt){var et,nt,it;function rt(ot){var at=this;if(!(at instanceof rt))return new rt(ot);if(at.constructor=rt,ot instanceof rt){at.s=ot.s,at.e=ot.e,at.d=(ot=ot.d)?ot.slice():ot;return}if(typeof ot=="number"){if(ot*0!==0)throw Error(invalidArgument+ot);if(ot>0)at.s=1;else if(ot<0)ot=-ot,at.s=-1;else{at.s=0,at.e=0,at.d=[0];return}if(ot===~~ot&&ot<1e7){at.e=0,at.d=[ot];return}return parseDecimal(at,ot.toString())}else if(typeof ot!="string")throw Error(invalidArgument+ot);if(ot.charCodeAt(0)===45?(ot=ot.slice(1),at.s=-1):at.s=1,isDecimal.test(ot))parseDecimal(at,ot);else throw Error(invalidArgument+ot)}if(rt.prototype=P,rt.ROUND_UP=0,rt.ROUND_DOWN=1,rt.ROUND_CEIL=2,rt.ROUND_FLOOR=3,rt.ROUND_HALF_UP=4,rt.ROUND_HALF_DOWN=5,rt.ROUND_HALF_EVEN=6,rt.ROUND_HALF_CEIL=7,rt.ROUND_HALF_FLOOR=8,rt.clone=clone,rt.config=rt.set=config,tt===void 0&&(tt={}),tt)for(it=["precision","rounding","toExpNeg","toExpPos","LN10"],et=0;et=rt[et+1]&&it<=rt[et+2])this[nt]=it;else throw Error(invalidArgument+nt+": "+it);if((it=tt[nt="LN10"])!==void 0)if(it==Math.LN10)this[nt]=new this(it);else throw Error(invalidArgument+nt+": "+it);return this}var Decimal=clone(defaults);ONE=new Decimal(1);const Decimal$1=Decimal;function _toConsumableArray$8(tt){return _arrayWithoutHoles$8(tt)||_iterableToArray$8(tt)||_unsupportedIterableToArray$e(tt)||_nonIterableSpread$8()}function _nonIterableSpread$8(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$e(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$e(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$e(tt,et)}}function _iterableToArray$8(tt){if(typeof Symbol<"u"&&Symbol.iterator in Object(tt))return Array.from(tt)}function _arrayWithoutHoles$8(tt){if(Array.isArray(tt))return _arrayLikeToArray$e(tt)}function _arrayLikeToArray$e(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=et?nt.apply(void 0,rt):tt(et-at,curry0(function(){for(var st=arguments.length,lt=new Array(st),ct=0;cttt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt"u"||!(Symbol.iterator in Object(tt)))){var nt=[],it=!0,rt=!1,ot=void 0;try{for(var at=tt[Symbol.iterator](),st;!(it=(st=at.next()).done)&&(nt.push(st.value),!(et&&nt.length===et));it=!0);}catch(lt){rt=!0,ot=lt}finally{try{!it&&at.return!=null&&at.return()}finally{if(rt)throw ot}}return nt}}function _arrayWithHoles$6(tt){if(Array.isArray(tt))return tt}function getValidInterval(tt){var et=_slicedToArray$6(tt,2),nt=et[0],it=et[1],rt=nt,ot=it;return nt>it&&(rt=it,ot=nt),[rt,ot]}function getFormatStep(tt,et,nt){if(tt.lte(0))return new Decimal$1(0);var it=Arithmetic.getDigitCount(tt.toNumber()),rt=new Decimal$1(10).pow(it),ot=tt.div(rt),at=it!==1?.05:.1,st=new Decimal$1(Math.ceil(ot.div(at).toNumber())).add(nt).mul(at),lt=st.mul(rt);return et?lt:new Decimal$1(Math.ceil(lt))}function getTickOfSingleValue(tt,et,nt){var it=1,rt=new Decimal$1(tt);if(!rt.isint()&&nt){var ot=Math.abs(tt);ot<1?(it=new Decimal$1(10).pow(Arithmetic.getDigitCount(tt)-1),rt=new Decimal$1(Math.floor(rt.div(it).toNumber())).mul(it)):ot>1&&(rt=new Decimal$1(Math.floor(tt)))}else tt===0?rt=new Decimal$1(Math.floor((et-1)/2)):nt||(rt=new Decimal$1(Math.floor(tt)));var at=Math.floor((et-1)/2),st=compose(map(function(lt){return rt.add(new Decimal$1(lt-at).mul(it)).toNumber()}),range$2);return st(0,et)}function calculateStep(tt,et,nt,it){var rt=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((et-tt)/(nt-1)))return{step:new Decimal$1(0),tickMin:new Decimal$1(0),tickMax:new Decimal$1(0)};var ot=getFormatStep(new Decimal$1(et).sub(tt).div(nt-1),it,rt),at;tt<=0&&et>=0?at=new Decimal$1(0):(at=new Decimal$1(tt).add(et).div(2),at=at.sub(new Decimal$1(at).mod(ot)));var st=Math.ceil(at.sub(tt).div(ot).toNumber()),lt=Math.ceil(new Decimal$1(et).sub(at).div(ot).toNumber()),ct=st+lt+1;return ct>nt?calculateStep(tt,et,nt,it,rt+1):(ct0?lt+(nt-ct):lt,st=et>0?st:st+(nt-ct)),{step:ot,tickMin:at.sub(new Decimal$1(st).mul(ot)),tickMax:at.add(new Decimal$1(lt).mul(ot))})}function getNiceTickValuesFn(tt){var et=_slicedToArray$6(tt,2),nt=et[0],it=et[1],rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,at=Math.max(rt,2),st=getValidInterval([nt,it]),lt=_slicedToArray$6(st,2),ct=lt[0],ut=lt[1];if(ct===-1/0||ut===1/0){var ht=ut===1/0?[ct].concat(_toConsumableArray$7(range$2(0,rt-1).map(function(){return 1/0}))):[].concat(_toConsumableArray$7(range$2(0,rt-1).map(function(){return-1/0})),[ut]);return nt>it?reverse(ht):ht}if(ct===ut)return getTickOfSingleValue(ct,rt,ot);var dt=calculateStep(ct,ut,at,ot),pt=dt.step,mt=dt.tickMin,gt=dt.tickMax,bt=Arithmetic.rangeStep(mt,gt.add(new Decimal$1(.1).mul(pt)),pt);return nt>it?reverse(bt):bt}function getTickValuesFixedDomainFn(tt,et){var nt=_slicedToArray$6(tt,2),it=nt[0],rt=nt[1],ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,at=getValidInterval([it,rt]),st=_slicedToArray$6(at,2),lt=st[0],ct=st[1];if(lt===-1/0||ct===1/0)return[it,rt];if(lt===ct)return[lt];var ut=Math.max(et,2),ht=getFormatStep(new Decimal$1(ct).sub(lt).div(ut-1),ot,0),dt=[].concat(_toConsumableArray$7(Arithmetic.rangeStep(new Decimal$1(lt),new Decimal$1(ct).sub(new Decimal$1(.99).mul(ht)),ht)),[ct]);return it>rt?reverse(dt):dt}var getNiceTickValues=memoize(getNiceTickValuesFn),getTickValuesFixedDomain=memoize(getTickValuesFixedDomainFn),_excluded$b=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function _extends$l(){return _extends$l=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$b(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ErrorBar(tt){var et=tt.offset,nt=tt.layout,it=tt.width,rt=tt.dataKey,ot=tt.data,at=tt.dataPointFormatter,st=tt.xAxis,lt=tt.yAxis,ct=_objectWithoutProperties$b(tt,_excluded$b),ut=filterProps(ct),ht=ot.map(function(dt){var pt=at(dt,rt),mt=pt.x,gt=pt.y,bt=pt.value,yt=pt.errorVal;if(!yt)return null;var wt=[],vt,xt;if(Array.isArray(yt)){var St=_slicedToArray$5(yt,2);vt=St[0],xt=St[1]}else vt=xt=yt;if(nt==="vertical"){var Et=st.scale,It=gt+et,Tt=It+it,$t=It-it,Ut=Et(bt-vt),Lt=Et(bt+xt);wt.push({x1:Lt,y1:Tt,x2:Lt,y2:$t}),wt.push({x1:Ut,y1:It,x2:Lt,y2:It}),wt.push({x1:Ut,y1:Tt,x2:Ut,y2:$t})}else if(nt==="horizontal"){var Bt=lt.scale,Pt=mt+et,kt=Pt-it,At=Pt+it,Rt=Bt(bt-vt),Wt=Bt(bt+xt);wt.push({x1:kt,y1:Wt,x2:At,y2:Wt}),wt.push({x1:Pt,y1:Rt,x2:Pt,y2:Wt}),wt.push({x1:kt,y1:Rt,x2:At,y2:Rt})}return React$1.createElement(Layer,_extends$l({className:"recharts-errorBar",key:"bar-".concat(wt.map(function(jt){return"".concat(jt.x1,"-").concat(jt.x2,"-").concat(jt.y1,"-").concat(jt.y2)}))},ut),wt.map(function(jt){return React$1.createElement("line",_extends$l({},jt,{key:"line-".concat(jt.x1,"-").concat(jt.x2,"-").concat(jt.y1,"-").concat(jt.y2)}))}))});return React$1.createElement(Layer,{className:"recharts-errorBars"},ht)}ErrorBar.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};ErrorBar.displayName="ErrorBar";function _typeof$q(tt){"@babel/helpers - typeof";return _typeof$q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$q(tt)}function ownKeys$p(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$p(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt1&&arguments[1]!==void 0?arguments[1]:[],rt=arguments.length>2?arguments[2]:void 0,ot=arguments.length>3?arguments[3]:void 0,at=-1,st=(nt=it==null?void 0:it.length)!==null&&nt!==void 0?nt:0;if(st<=1)return 0;if(ot&&ot.axisType==="angleAxis"&&Math.abs(Math.abs(ot.range[1]-ot.range[0])-360)<=1e-6)for(var lt=ot.range,ct=0;ct0?rt[ct-1].coordinate:rt[st-1].coordinate,ht=rt[ct].coordinate,dt=ct>=st-1?rt[0].coordinate:rt[ct+1].coordinate,pt=void 0;if(mathSign(ht-ut)!==mathSign(dt-ht)){var mt=[];if(mathSign(dt-ht)===mathSign(lt[1]-lt[0])){pt=dt;var gt=ht+lt[1]-lt[0];mt[0]=Math.min(gt,(gt+ut)/2),mt[1]=Math.max(gt,(gt+ut)/2)}else{pt=ut;var bt=dt+lt[1]-lt[0];mt[0]=Math.min(ht,(bt+ht)/2),mt[1]=Math.max(ht,(bt+ht)/2)}var yt=[Math.min(ht,(pt+ht)/2),Math.max(ht,(pt+ht)/2)];if(et>yt[0]&&et<=yt[1]||et>=mt[0]&&et<=mt[1]){at=rt[ct].index;break}}else{var wt=Math.min(ut,dt),vt=Math.max(ut,dt);if(et>(wt+ht)/2&&et<=(vt+ht)/2){at=rt[ct].index;break}}}else for(var xt=0;xt0&&xt(it[xt].coordinate+it[xt-1].coordinate)/2&&et<=(it[xt].coordinate+it[xt+1].coordinate)/2||xt===st-1&&et>(it[xt].coordinate+it[xt-1].coordinate)/2){at=it[xt].index;break}return at},getMainColorOfGraphicItem=function tt(et){var nt=et,it=nt.type.displayName,rt=et.props,ot=rt.stroke,at=rt.fill,st;switch(it){case"Line":st=ot;break;case"Area":case"Radar":st=ot&&ot!=="none"?ot:at;break;default:st=at;break}return st},getBarSizeList=function tt(et){var nt=et.barSize,it=et.stackGroups,rt=it===void 0?{}:it;if(!rt)return{};for(var ot={},at=Object.keys(rt),st=0,lt=at.length;st=0});if(bt&&bt.length){var yt=bt[0].props.barSize,wt=bt[0].props[gt];ot[wt]||(ot[wt]=[]),ot[wt].push({item:bt[0],stackList:bt.slice(1),barSize:isNil$1(yt)?nt:yt})}}return ot},getBarPosition=function tt(et){var nt=et.barGap,it=et.barCategoryGap,rt=et.bandSize,ot=et.sizeList,at=ot===void 0?[]:ot,st=et.maxBarSize,lt=at.length;if(lt<1)return null;var ct=getPercentValue(nt,rt,0,!0),ut,ht=[];if(at[0].barSize===+at[0].barSize){var dt=!1,pt=rt/lt,mt=at.reduce(function(xt,St){return xt+St.barSize||0},0);mt+=(lt-1)*ct,mt>=rt&&(mt-=(lt-1)*ct,ct=0),mt>=rt&&pt>0&&(dt=!0,pt*=.9,mt=lt*pt);var gt=(rt-mt)/2>>0,bt={offset:gt-ct,size:0};ut=at.reduce(function(xt,St){var Et={item:St.item,position:{offset:bt.offset+bt.size+ct,size:dt?pt:St.barSize}},It=[].concat(_toConsumableArray$6(xt),[Et]);return bt=It[It.length-1].position,St.stackList&&St.stackList.length&&St.stackList.forEach(function(Tt){It.push({item:Tt,position:bt})}),It},ht)}else{var yt=getPercentValue(it,rt,0,!0);rt-2*yt-(lt-1)*ct<=0&&(ct=0);var wt=(rt-2*yt-(lt-1)*ct)/lt;wt>1&&(wt>>=0);var vt=st===+st?Math.min(wt,st):wt;ut=at.reduce(function(xt,St,Et){var It=[].concat(_toConsumableArray$6(xt),[{item:St.item,position:{offset:yt+(wt+ct)*Et+(wt-vt)/2,size:vt}}]);return St.stackList&&St.stackList.length&&St.stackList.forEach(function(Tt){It.push({item:Tt,position:It[It.length-1].position})}),It},ht)}return ut},appendOffsetOfLegend=function tt(et,nt,it,rt){var ot=it.children,at=it.width,st=it.margin,lt=at-(st.left||0)-(st.right||0),ct=getLegendProps({children:ot,legendWidth:lt});if(ct){var ut=rt||{},ht=ut.width,dt=ut.height,pt=ct.align,mt=ct.verticalAlign,gt=ct.layout;if((gt==="vertical"||gt==="horizontal"&&mt==="middle")&&pt!=="center"&&isNumber(et[pt]))return _objectSpread$o(_objectSpread$o({},et),{},_defineProperty$p({},pt,et[pt]+(ht||0)));if((gt==="horizontal"||gt==="vertical"&&pt==="center")&&mt!=="middle"&&isNumber(et[mt]))return _objectSpread$o(_objectSpread$o({},et),{},_defineProperty$p({},mt,et[mt]+(dt||0)))}return et},isErrorBarRelevantForAxis=function tt(et,nt,it){return isNil$1(nt)?!0:et==="horizontal"?nt==="yAxis":et==="vertical"||it==="x"?nt==="xAxis":it==="y"?nt==="yAxis":!0},getDomainOfErrorBars=function tt(et,nt,it,rt,ot){var at=nt.props.children,st=findAllByType(at,ErrorBar).filter(function(ct){return isErrorBarRelevantForAxis(rt,ot,ct.props.direction)});if(st&&st.length){var lt=st.map(function(ct){return ct.props.dataKey});return et.reduce(function(ct,ut){var ht=getValueByDataKey(ut,it,0),dt=Array.isArray(ht)?[min$1(ht),max$1(ht)]:[ht,ht],pt=lt.reduce(function(mt,gt){var bt=getValueByDataKey(ut,gt,0),yt=dt[0]-Math.abs(Array.isArray(bt)?bt[0]:bt),wt=dt[1]+Math.abs(Array.isArray(bt)?bt[1]:bt);return[Math.min(yt,mt[0]),Math.max(wt,mt[1])]},[1/0,-1/0]);return[Math.min(pt[0],ct[0]),Math.max(pt[1],ct[1])]},[1/0,-1/0])}return null},parseErrorBarsOfAxis=function tt(et,nt,it,rt,ot){var at=nt.map(function(st){return getDomainOfErrorBars(et,st,it,ot,rt)}).filter(function(st){return!isNil$1(st)});return at&&at.length?at.reduce(function(st,lt){return[Math.min(st[0],lt[0]),Math.max(st[1],lt[1])]},[1/0,-1/0]):null},getDomainOfItemsWithSameAxis=function tt(et,nt,it,rt,ot){var at=nt.map(function(lt){var ct=lt.props.dataKey;return it==="number"&&ct&&getDomainOfErrorBars(et,lt,ct,rt)||getDomainOfDataByKey(et,ct,it,ot)});if(it==="number")return at.reduce(function(lt,ct){return[Math.min(lt[0],ct[0]),Math.max(lt[1],ct[1])]},[1/0,-1/0]);var st={};return at.reduce(function(lt,ct){for(var ut=0,ht=ct.length;ut=2?mathSign(st[0]-st[1])*2*ct:ct,nt&&(et.ticks||et.niceTicks)){var ut=(et.ticks||et.niceTicks).map(function(ht){var dt=ot?ot.indexOf(ht):ht;return{coordinate:rt(dt)+ct,value:ht,offset:ct}});return ut.filter(function(ht){return!isNan(ht.coordinate)})}return et.isCategorical&&et.categoricalDomain?et.categoricalDomain.map(function(ht,dt){return{coordinate:rt(ht)+ct,value:ht,index:dt,offset:ct}}):rt.ticks&&!it?rt.ticks(et.tickCount).map(function(ht){return{coordinate:rt(ht)+ct,value:ht,offset:ct}}):rt.domain().map(function(ht,dt){return{coordinate:rt(ht)+ct,value:ot?ot[ht]:ht,index:dt,offset:ct}})},handlerWeakMap=new WeakMap,combineEventHandlers=function tt(et,nt){if(typeof nt!="function")return et;handlerWeakMap.has(et)||handlerWeakMap.set(et,new WeakMap);var it=handlerWeakMap.get(et);if(it.has(nt))return it.get(nt);var rt=function(){et.apply(void 0,arguments),nt.apply(void 0,arguments)};return it.set(nt,rt),rt},parseScale=function tt(et,nt,it){var rt=et.scale,ot=et.type,at=et.layout,st=et.axisType;if(rt==="auto")return at==="radial"&&st==="radiusAxis"?{scale:band(),realScaleType:"band"}:at==="radial"&&st==="angleAxis"?{scale:linear(),realScaleType:"linear"}:ot==="category"&&nt&&(nt.indexOf("LineChart")>=0||nt.indexOf("AreaChart")>=0||nt.indexOf("ComposedChart")>=0&&!it)?{scale:point$3(),realScaleType:"point"}:ot==="category"?{scale:band(),realScaleType:"band"}:{scale:linear(),realScaleType:"linear"};if(isString$1(rt)){var lt="scale".concat(upperFirst$1(rt));return{scale:(d3Scales[lt]||point$3)(),realScaleType:d3Scales[lt]?lt:"point"}}return isFunction$4(rt)?{scale:rt}:{scale:point$3(),realScaleType:"point"}},EPS=1e-4,checkDomainOfScale=function tt(et){var nt=et.domain();if(!(!nt||nt.length<=2)){var it=nt.length,rt=et.range(),ot=Math.min(rt[0],rt[1])-EPS,at=Math.max(rt[0],rt[1])+EPS,st=et(nt[0]),lt=et(nt[it-1]);(stat||ltat)&&et.domain([nt[0],nt[it-1]])}},findPositionOfBar=function tt(et,nt){if(!et)return null;for(var it=0,rt=et.length;itrt)&&(ot[1]=rt),ot[0]>rt&&(ot[0]=rt),ot[1]=0?(et[st][it][0]=ot,et[st][it][1]=ot+lt,ot=et[st][it][1]):(et[st][it][0]=at,et[st][it][1]=at+lt,at=et[st][it][1])}},offsetPositive=function tt(et){var nt=et.length;if(!(nt<=0))for(var it=0,rt=et[0].length;it=0?(et[at][it][0]=ot,et[at][it][1]=ot+st,ot=et[at][it][1]):(et[at][it][0]=0,et[at][it][1]=0)}},STACK_OFFSET_MAP={sign:offsetSign,expand:stackOffsetExpand,none:stackOffsetNone,silhouette:stackOffsetSilhouette,wiggle:stackOffsetWiggle,positive:offsetPositive},getStackedData=function tt(et,nt,it){var rt=nt.map(function(st){return st.props.dataKey}),ot=STACK_OFFSET_MAP[it],at=shapeStack().keys(rt).value(function(st,lt){return+getValueByDataKey(st,lt,0)}).order(stackOrderNone).offset(ot);return at(et)},getStackGroupsByAxisId=function tt(et,nt,it,rt,ot,at){if(!et)return null;var st=at?nt.reverse():nt,lt={},ct=st.reduce(function(ht,dt){var pt=dt.props,mt=pt.stackId,gt=pt.hide;if(gt)return ht;var bt=dt.props[it],yt=ht[bt]||{hasStack:!1,stackGroups:{}};if(isNumOrStr(mt)){var wt=yt.stackGroups[mt]||{numericAxisId:it,cateAxisId:rt,items:[]};wt.items.push(dt),yt.hasStack=!0,yt.stackGroups[mt]=wt}else yt.stackGroups[uniqueId("_stackId_")]={numericAxisId:it,cateAxisId:rt,items:[dt]};return _objectSpread$o(_objectSpread$o({},ht),{},_defineProperty$p({},bt,yt))},lt),ut={};return Object.keys(ct).reduce(function(ht,dt){var pt=ct[dt];if(pt.hasStack){var mt={};pt.stackGroups=Object.keys(pt.stackGroups).reduce(function(gt,bt){var yt=pt.stackGroups[bt];return _objectSpread$o(_objectSpread$o({},gt),{},_defineProperty$p({},bt,{numericAxisId:it,cateAxisId:rt,items:yt.items,stackedData:getStackedData(et,yt.items,ot)}))},mt)}return _objectSpread$o(_objectSpread$o({},ht),{},_defineProperty$p({},dt,pt))},ut)},getTicksOfScale=function tt(et,nt){var it=nt.realScaleType,rt=nt.type,ot=nt.tickCount,at=nt.originalDomain,st=nt.allowDecimals,lt=it||nt.scale;if(lt!=="auto"&<!=="linear")return null;if(ot&&rt==="number"&&at&&(at[0]==="auto"||at[1]==="auto")){var ct=et.domain();if(!ct.length)return null;var ut=getNiceTickValues(ct,ot,st);return et.domain([min$1(ut),max$1(ut)]),{niceTicks:ut}}if(ot&&rt==="number"){var ht=et.domain(),dt=getTickValuesFixedDomain(ht,ot,st);return{niceTicks:dt}}return null},getCateCoordinateOfLine=function tt(et){var nt=et.axis,it=et.ticks,rt=et.bandSize,ot=et.entry,at=et.index,st=et.dataKey;if(nt.type==="category"){if(!nt.allowDuplicatedCategory&&nt.dataKey&&!isNil$1(ot[nt.dataKey])){var lt=findEntryInArray(it,"value",ot[nt.dataKey]);if(lt)return lt.coordinate+rt/2}return it[at]?it[at].coordinate+rt/2:null}var ct=getValueByDataKey(ot,isNil$1(st)?nt.dataKey:st);return isNil$1(ct)?null:nt.scale(ct)},getCateCoordinateOfBar=function tt(et){var nt=et.axis,it=et.ticks,rt=et.offset,ot=et.bandSize,at=et.entry,st=et.index;if(nt.type==="category")return it[st]?it[st].coordinate+rt:null;var lt=getValueByDataKey(at,nt.dataKey,nt.domain[st]);return isNil$1(lt)?null:nt.scale(lt)-ot/2+rt},getBaseValueOfBar=function tt(et){var nt=et.numericAxis,it=nt.scale.domain();if(nt.type==="number"){var rt=Math.min(it[0],it[1]),ot=Math.max(it[0],it[1]);return rt<=0&&ot>=0?0:ot<0?ot:rt}return it[0]},getStackedDataOfItem=function tt(et,nt){var it=et.props.stackId;if(isNumOrStr(it)){var rt=nt[it];if(rt){var ot=rt.items.indexOf(et);return ot>=0?rt.stackedData[ot]:null}}return null},getDomainOfSingle=function tt(et){return et.reduce(function(nt,it){return[min$1(it.concat([nt[0]]).filter(isNumber)),max$1(it.concat([nt[1]]).filter(isNumber))]},[1/0,-1/0])},getDomainOfStackGroups=function tt(et,nt,it){return Object.keys(et).reduce(function(rt,ot){var at=et[ot],st=at.stackedData,lt=st.reduce(function(ct,ut){var ht=getDomainOfSingle(ut.slice(nt,it+1));return[Math.min(ct[0],ht[0]),Math.max(ct[1],ht[1])]},[1/0,-1/0]);return[Math.min(lt[0],rt[0]),Math.max(lt[1],rt[1])]},[1/0,-1/0]).map(function(rt){return rt===1/0||rt===-1/0?0:rt})},MIN_VALUE_REG=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,MAX_VALUE_REG=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,parseSpecifiedDomain=function tt(et,nt,it){if(isFunction$4(et))return et(nt,it);if(!Array.isArray(et))return nt;var rt=[];if(isNumber(et[0]))rt[0]=it?et[0]:Math.min(et[0],nt[0]);else if(MIN_VALUE_REG.test(et[0])){var ot=+MIN_VALUE_REG.exec(et[0])[1];rt[0]=nt[0]-ot}else isFunction$4(et[0])?rt[0]=et[0](nt[0]):rt[0]=nt[0];if(isNumber(et[1]))rt[1]=it?et[1]:Math.max(et[1],nt[1]);else if(MAX_VALUE_REG.test(et[1])){var at=+MAX_VALUE_REG.exec(et[1])[1];rt[1]=nt[1]+at}else isFunction$4(et[1])?rt[1]=et[1](nt[1]):rt[1]=nt[1];return rt},getBandSizeOfAxis=function tt(et,nt,it){if(et&&et.scale&&et.scale.bandwidth){var rt=et.scale.bandwidth();if(!it||rt>0)return rt}if(et&&nt&&nt.length>=2){for(var ot=sortBy$1(nt,function(ht){return ht.coordinate}),at=1/0,st=1,lt=ot.length;stat&&(ct=2*Math.PI-ct),{radius:st,angle:radianToDegree(ct),angleInRadian:ct}},formatAngleOfSector=function tt(et){var nt=et.startAngle,it=et.endAngle,rt=Math.floor(nt/360),ot=Math.floor(it/360),at=Math.min(rt,ot);return{startAngle:nt-at*360,endAngle:it-at*360}},reverseFormatAngleOfSetor=function tt(et,nt){var it=nt.startAngle,rt=nt.endAngle,ot=Math.floor(it/360),at=Math.floor(rt/360),st=Math.min(ot,at);return et+st*360},inRangeOfSector=function tt(et,nt){var it=et.x,rt=et.y,ot=getAngleOfPoint({x:it,y:rt},nt),at=ot.radius,st=ot.angle,lt=nt.innerRadius,ct=nt.outerRadius;if(atct)return!1;if(at===0)return!0;var ut=formatAngleOfSector(nt),ht=ut.startAngle,dt=ut.endAngle,pt=st,mt;if(ht<=dt){for(;pt>dt;)pt-=360;for(;pt=ht&&pt<=dt}else{for(;pt>ht;)pt-=360;for(;pt=dt&&pt<=ht}return mt?_objectSpread$n(_objectSpread$n({},nt),{},{radius:at,angle:reverseFormatAngleOfSetor(pt,nt)}):null};function _typeof$n(tt){"@babel/helpers - typeof";return _typeof$n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$n(tt)}var _excluded$a=["offset"];function _toConsumableArray$5(tt){return _arrayWithoutHoles$5(tt)||_iterableToArray$5(tt)||_unsupportedIterableToArray$a(tt)||_nonIterableSpread$5()}function _nonIterableSpread$5(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$a(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$a(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$a(tt,et)}}function _iterableToArray$5(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$5(tt){if(Array.isArray(tt))return _arrayLikeToArray$a(tt)}function _arrayLikeToArray$a(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$a(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ownKeys$m(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$m(tt){for(var et=1;et=0?1:-1,vt,xt;rt==="insideStart"?(vt=pt+wt*at,xt=gt):rt==="insideEnd"?(vt=mt-wt*at,xt=!gt):rt==="end"&&(vt=mt+wt*at,xt=gt),xt=yt<=0?xt:!xt;var St=polarToCartesian(ct,ut,bt,vt),Et=polarToCartesian(ct,ut,bt,vt+(xt?1:-1)*359),It="M".concat(St.x,",").concat(St.y,` + height and width.`,Tt,Ct,at,lt,ut,ht,nt);var Ut=!Array.isArray(pt)&&reactIsExports.isElement(pt)&&getDisplayName(pt.type).endsWith("Chart");return React$1.Children.map(pt,function(Nt){return reactIsExports.isElement(Nt)?reactExports.cloneElement(Nt,_objectSpread$q({width:Tt,height:Ct},Ut?{style:_objectSpread$q({height:"100%",width:"100%",maxHeight:Ct,maxWidth:Tt},Nt.props.style)}:{})):Nt})},[nt,pt,lt,dt,ht,ut,Ft,at]);return React$1.createElement("div",{id:bt?"".concat(bt):void 0,className:clsx("recharts-responsive-container",yt),style:_objectSpread$q(_objectSpread$q({},xt),{},{width:at,height:lt,minWidth:ut,minHeight:ht,maxHeight:dt}),ref:St},Ot)}),Cell=function tt(et){return null};Cell.displayName="Cell";function _typeof$r(tt){"@babel/helpers - typeof";return _typeof$r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$r(tt)}function ownKeys$p(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$p(tt){for(var et=1;et1&&arguments[1]!==void 0?arguments[1]:{};if(et==null||Global.isSsr)return{width:0,height:0};var it=removeInvalidKeys(nt),rt=JSON.stringify({text:et,copyStyle:it});if(stringCache.widthCache[rt])return stringCache.widthCache[rt];try{var ot=document.getElementById(MEASUREMENT_SPAN_ID);ot||(ot=document.createElement("span"),ot.setAttribute("id",MEASUREMENT_SPAN_ID),ot.setAttribute("aria-hidden","true"),document.body.appendChild(ot));var at=_objectSpread$p(_objectSpread$p({},SPAN_STYLE),it);Object.assign(ot.style,at),ot.textContent="".concat(et);var st=ot.getBoundingClientRect(),lt={width:st.width,height:st.height};return stringCache.widthCache[rt]=lt,++stringCache.cacheCount>MAX_CACHE_NUM&&(stringCache.cacheCount=0,stringCache.widthCache={}),lt}catch{return{width:0,height:0}}},getOffset=function tt(et){return{top:et.top+window.scrollY-document.documentElement.clientTop,left:et.left+window.scrollX-document.documentElement.clientLeft}};function _typeof$q(tt){"@babel/helpers - typeof";return _typeof$q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$q(tt)}function _slicedToArray$7(tt,et){return _arrayWithHoles$7(tt)||_iterableToArrayLimit$7(tt,et)||_unsupportedIterableToArray$d(tt,et)||_nonIterableRest$7()}function _nonIterableRest$7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$d(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$d(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$d(tt,et)}}function _arrayLikeToArray$d(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$c(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _slicedToArray$6(tt,et){return _arrayWithHoles$6(tt)||_iterableToArrayLimit$6(tt,et)||_unsupportedIterableToArray$c(tt,et)||_nonIterableRest$6()}function _nonIterableRest$6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$c(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$c(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$c(tt,et)}}function _arrayLikeToArray$c(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0&&arguments[0]!==void 0?arguments[0]:[];return Tt.reduce(function(Ct,Ut){var Nt=Ut.word,Bt=Ut.width,Mt=Ct[Ct.length-1];if(Mt&&(rt==null||ot||Mt.width+Bt+itUt.width?Ct:Ut})};if(!ut)return pt;for(var gt="…",bt=function(Tt){var Ct=ht.slice(0,Tt),Ut=calculateWordWidths({breakAll:ct,style:lt,children:Ct+gt}).wordsWithComputedWidth,Nt=dt(Ut),Bt=Nt.length>at||mt(Nt).width>Number(rt);return[Bt,Nt]},yt=0,wt=ht.length-1,vt=0,xt;yt<=wt&&vt<=ht.length-1;){var St=Math.floor((yt+wt)/2),Et=St-1,$t=bt(Et),It=_slicedToArray$6($t,2),Ft=It[0],Ht=It[1],zt=bt(St),Ot=_slicedToArray$6(zt,1),jt=Ot[0];if(!Ft&&!jt&&(yt=St+1),Ft&&jt&&(wt=St-1),!Ft&&jt){xt=Ht;break}vt++}return xt||pt},getWordsWithoutCalculate=function tt(et){var nt=isNil$1(et)?[]:et.toString().split(BREAKING_SPACES);return[{words:nt}]},getWordsByLines=function tt(et){var nt=et.width,it=et.scaleToFit,rt=et.children,ot=et.style,at=et.breakAll,st=et.maxLines;if((nt||it)&&!Global.isSsr){var lt,ct,ut=calculateWordWidths({breakAll:at,children:rt,style:ot});if(ut){var ht=ut.wordsWithComputedWidth,dt=ut.spaceWidth;lt=ht,ct=dt}else return getWordsWithoutCalculate(rt);return calculateWordsByLines({breakAll:at,children:rt,maxLines:st,style:ot},lt,ct,nt,it)}return getWordsWithoutCalculate(rt)},DEFAULT_FILL="#808080",Text$1=function tt(et){var nt=et.x,it=nt===void 0?0:nt,rt=et.y,ot=rt===void 0?0:rt,at=et.lineHeight,st=at===void 0?"1em":at,lt=et.capHeight,ct=lt===void 0?"0.71em":lt,ut=et.scaleToFit,ht=ut===void 0?!1:ut,dt=et.textAnchor,pt=dt===void 0?"start":dt,mt=et.verticalAnchor,gt=mt===void 0?"end":mt,bt=et.fill,yt=bt===void 0?DEFAULT_FILL:bt,wt=_objectWithoutProperties$c(et,_excluded$c),vt=reactExports.useMemo(function(){return getWordsByLines({breakAll:wt.breakAll,children:wt.children,maxLines:wt.maxLines,scaleToFit:ht,style:wt.style,width:wt.width})},[wt.breakAll,wt.children,wt.maxLines,ht,wt.style,wt.width]),xt=wt.dx,St=wt.dy,Et=wt.angle,$t=wt.className,It=wt.breakAll,Ft=_objectWithoutProperties$c(wt,_excluded2$4);if(!isNumOrStr(it)||!isNumOrStr(ot))return null;var Ht=it+(isNumber(xt)?xt:0),zt=ot+(isNumber(St)?St:0),Ot;switch(gt){case"start":Ot=reduceCSSCalc("calc(".concat(ct,")"));break;case"middle":Ot=reduceCSSCalc("calc(".concat((vt.length-1)/2," * -").concat(st," + (").concat(ct," / 2))"));break;default:Ot=reduceCSSCalc("calc(".concat(vt.length-1," * -").concat(st,")"));break}var jt=[];if(ht){var kt=vt[0].width,Tt=wt.width;jt.push("scale(".concat((isNumber(Tt)?Tt/kt:1)/kt,")"))}return Et&&jt.push("rotate(".concat(Et,", ").concat(Ht,", ").concat(zt,")")),jt.length&&(Ft.transform=jt.join(" ")),React$1.createElement("text",_extends$l({},filterProps(Ft,!0),{x:Ht,y:zt,className:clsx("recharts-text",$t),textAnchor:pt,fill:yt.includes("url")?DEFAULT_FILL:yt}),vt.map(function(Ct,Ut){var Nt=Ct.words.join(It?"":" ");return React$1.createElement("tspan",{x:Ht,dy:Ut===0?Ot:st,key:Nt},Nt)}))};function ascending$1(tt,et){return tt==null||et==null?NaN:ttet?1:tt>=et?0:NaN}function descending(tt,et){return tt==null||et==null?NaN:ettt?1:et>=tt?0:NaN}function bisector(tt){let et,nt,it;tt.length!==2?(et=ascending$1,nt=(st,lt)=>ascending$1(tt(st),lt),it=(st,lt)=>tt(st)-lt):(et=tt===ascending$1||tt===descending?tt:zero$1,nt=tt,it=tt);function rt(st,lt,ct=0,ut=st.length){if(ct>>1;nt(st[ht],lt)<0?ct=ht+1:ut=ht}while(ct>>1;nt(st[ht],lt)<=0?ct=ht+1:ut=ht}while(ctct&&it(st[ht-1],lt)>-it(st[ht],lt)?ht-1:ht}return{left:rt,center:at,right:ot}}function zero$1(){return 0}function number$4(tt){return tt===null?NaN:+tt}function*numbers(tt,et){if(et===void 0)for(let nt of tt)nt!=null&&(nt=+nt)>=nt&&(yield nt);else{let nt=-1;for(let it of tt)(it=et(it,++nt,tt))!=null&&(it=+it)>=it&&(yield it)}}const ascendingBisect=bisector(ascending$1),bisectRight=ascendingBisect.right;bisector(number$4).center;const bisect=bisectRight;class InternMap extends Map{constructor(et,nt=keyof){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:nt}}),et!=null)for(const[it,rt]of et)this.set(it,rt)}get(et){return super.get(intern_get(this,et))}has(et){return super.has(intern_get(this,et))}set(et,nt){return super.set(intern_set(this,et),nt)}delete(et){return super.delete(intern_delete(this,et))}}function intern_get({_intern:tt,_key:et},nt){const it=et(nt);return tt.has(it)?tt.get(it):nt}function intern_set({_intern:tt,_key:et},nt){const it=et(nt);return tt.has(it)?tt.get(it):(tt.set(it,nt),nt)}function intern_delete({_intern:tt,_key:et},nt){const it=et(nt);return tt.has(it)&&(nt=tt.get(it),tt.delete(it)),nt}function keyof(tt){return tt!==null&&typeof tt=="object"?tt.valueOf():tt}function compareDefined(tt=ascending$1){if(tt===ascending$1)return ascendingDefined;if(typeof tt!="function")throw new TypeError("compare is not a function");return(et,nt)=>{const it=tt(et,nt);return it||it===0?it:(tt(nt,nt)===0)-(tt(et,et)===0)}}function ascendingDefined(tt,et){return(tt==null||!(tt>=tt))-(et==null||!(et>=et))||(ttet?1:0)}const e10=Math.sqrt(50),e5=Math.sqrt(10),e2=Math.sqrt(2);function tickSpec(tt,et,nt){const it=(et-tt)/Math.max(0,nt),rt=Math.floor(Math.log10(it)),ot=it/Math.pow(10,rt),at=ot>=e10?10:ot>=e5?5:ot>=e2?2:1;let st,lt,ct;return rt<0?(ct=Math.pow(10,-rt)/at,st=Math.round(tt*ct),lt=Math.round(et*ct),st/ctet&&--lt,ct=-ct):(ct=Math.pow(10,rt)*at,st=Math.round(tt/ct),lt=Math.round(et/ct),st*ctet&&--lt),lt0))return[];if(tt===et)return[tt];const it=et=rt))return[];const st=ot-rt+1,lt=new Array(st);if(it)if(at<0)for(let ct=0;ct=it)&&(nt=it);else{let it=-1;for(let rt of tt)(rt=et(rt,++it,tt))!=null&&(nt=rt)&&(nt=rt)}return nt}function min$2(tt,et){let nt;if(et===void 0)for(const it of tt)it!=null&&(nt>it||nt===void 0&&it>=it)&&(nt=it);else{let it=-1;for(let rt of tt)(rt=et(rt,++it,tt))!=null&&(nt>rt||nt===void 0&&rt>=rt)&&(nt=rt)}return nt}function quickselect(tt,et,nt=0,it=1/0,rt){if(et=Math.floor(et),nt=Math.floor(Math.max(0,nt)),it=Math.floor(Math.min(tt.length-1,it)),!(nt<=et&&et<=it))return tt;for(rt=rt===void 0?ascendingDefined:compareDefined(rt);it>nt;){if(it-nt>600){const lt=it-nt+1,ct=et-nt+1,ut=Math.log(lt),ht=.5*Math.exp(2*ut/3),dt=.5*Math.sqrt(ut*ht*(lt-ht)/lt)*(ct-lt/2<0?-1:1),pt=Math.max(nt,Math.floor(et-ct*ht/lt+dt)),mt=Math.min(it,Math.floor(et+(lt-ct)*ht/lt+dt));quickselect(tt,et,pt,mt,rt)}const ot=tt[et];let at=nt,st=it;for(swap(tt,nt,et),rt(tt[it],ot)>0&&swap(tt,nt,it);at0;)--st}rt(tt[nt],ot)===0?swap(tt,nt,st):(++st,swap(tt,st,it)),st<=et&&(nt=st+1),et<=st&&(it=st-1)}return tt}function swap(tt,et,nt){const it=tt[et];tt[et]=tt[nt],tt[nt]=it}function quantile$1(tt,et,nt){if(tt=Float64Array.from(numbers(tt,nt)),!(!(it=tt.length)||isNaN(et=+et))){if(et<=0||it<2)return min$2(tt);if(et>=1)return max$2(tt);var it,rt=(it-1)*et,ot=Math.floor(rt),at=max$2(quickselect(tt,ot).subarray(0,ot+1)),st=min$2(tt.subarray(ot+1));return at+(st-at)*(rt-ot)}}function quantileSorted(tt,et,nt=number$4){if(!(!(it=tt.length)||isNaN(et=+et))){if(et<=0||it<2)return+nt(tt[0],0,tt);if(et>=1)return+nt(tt[it-1],it-1,tt);var it,rt=(it-1)*et,ot=Math.floor(rt),at=+nt(tt[ot],ot,tt),st=+nt(tt[ot+1],ot+1,tt);return at+(st-at)*(rt-ot)}}function range$3(tt,et,nt){tt=+tt,et=+et,nt=(rt=arguments.length)<2?(et=tt,tt=0,1):rt<3?1:+nt;for(var it=-1,rt=Math.max(0,Math.ceil((et-tt)/nt))|0,ot=new Array(rt);++it>8&15|et>>4&240,et>>4&15|et&240,(et&15)<<4|et&15,1):nt===8?rgba(et>>24&255,et>>16&255,et>>8&255,(et&255)/255):nt===4?rgba(et>>12&15|et>>8&240,et>>8&15|et>>4&240,et>>4&15|et&240,((et&15)<<4|et&15)/255):null):(et=reRgbInteger.exec(tt))?new Rgb(et[1],et[2],et[3],1):(et=reRgbPercent.exec(tt))?new Rgb(et[1]*255/100,et[2]*255/100,et[3]*255/100,1):(et=reRgbaInteger.exec(tt))?rgba(et[1],et[2],et[3],et[4]):(et=reRgbaPercent.exec(tt))?rgba(et[1]*255/100,et[2]*255/100,et[3]*255/100,et[4]):(et=reHslPercent.exec(tt))?hsla(et[1],et[2]/100,et[3]/100,1):(et=reHslaPercent.exec(tt))?hsla(et[1],et[2]/100,et[3]/100,et[4]):named.hasOwnProperty(tt)?rgbn(named[tt]):tt==="transparent"?new Rgb(NaN,NaN,NaN,0):null}function rgbn(tt){return new Rgb(tt>>16&255,tt>>8&255,tt&255,1)}function rgba(tt,et,nt,it){return it<=0&&(tt=et=nt=NaN),new Rgb(tt,et,nt,it)}function rgbConvert(tt){return tt instanceof Color||(tt=color$1(tt)),tt?(tt=tt.rgb(),new Rgb(tt.r,tt.g,tt.b,tt.opacity)):new Rgb}function rgb(tt,et,nt,it){return arguments.length===1?rgbConvert(tt):new Rgb(tt,et,nt,it??1)}function Rgb(tt,et,nt,it){this.r=+tt,this.g=+et,this.b=+nt,this.opacity=+it}define(Rgb,rgb,extend$2(Color,{brighter(tt){return tt=tt==null?brighter:Math.pow(brighter,tt),new Rgb(this.r*tt,this.g*tt,this.b*tt,this.opacity)},darker(tt){return tt=tt==null?darker:Math.pow(darker,tt),new Rgb(this.r*tt,this.g*tt,this.b*tt,this.opacity)},rgb(){return this},clamp(){return new Rgb(clampi(this.r),clampi(this.g),clampi(this.b),clampa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatHex8:rgb_formatHex8,formatRgb:rgb_formatRgb,toString:rgb_formatRgb}));function rgb_formatHex(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}`}function rgb_formatHex8(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity)?1:this.opacity)*255)}`}function rgb_formatRgb(){const tt=clampa(this.opacity);return`${tt===1?"rgb(":"rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${tt===1?")":`, ${tt})`}`}function clampa(tt){return isNaN(tt)?1:Math.max(0,Math.min(1,tt))}function clampi(tt){return Math.max(0,Math.min(255,Math.round(tt)||0))}function hex(tt){return tt=clampi(tt),(tt<16?"0":"")+tt.toString(16)}function hsla(tt,et,nt,it){return it<=0?tt=et=nt=NaN:nt<=0||nt>=1?tt=et=NaN:et<=0&&(tt=NaN),new Hsl(tt,et,nt,it)}function hslConvert(tt){if(tt instanceof Hsl)return new Hsl(tt.h,tt.s,tt.l,tt.opacity);if(tt instanceof Color||(tt=color$1(tt)),!tt)return new Hsl;if(tt instanceof Hsl)return tt;tt=tt.rgb();var et=tt.r/255,nt=tt.g/255,it=tt.b/255,rt=Math.min(et,nt,it),ot=Math.max(et,nt,it),at=NaN,st=ot-rt,lt=(ot+rt)/2;return st?(et===ot?at=(nt-it)/st+(nt0&<<1?0:at,new Hsl(at,st,lt,tt.opacity)}function hsl(tt,et,nt,it){return arguments.length===1?hslConvert(tt):new Hsl(tt,et,nt,it??1)}function Hsl(tt,et,nt,it){this.h=+tt,this.s=+et,this.l=+nt,this.opacity=+it}define(Hsl,hsl,extend$2(Color,{brighter(tt){return tt=tt==null?brighter:Math.pow(brighter,tt),new Hsl(this.h,this.s,this.l*tt,this.opacity)},darker(tt){return tt=tt==null?darker:Math.pow(darker,tt),new Hsl(this.h,this.s,this.l*tt,this.opacity)},rgb(){var tt=this.h%360+(this.h<0)*360,et=isNaN(tt)||isNaN(this.s)?0:this.s,nt=this.l,it=nt+(nt<.5?nt:1-nt)*et,rt=2*nt-it;return new Rgb(hsl2rgb(tt>=240?tt-240:tt+120,rt,it),hsl2rgb(tt,rt,it),hsl2rgb(tt<120?tt+240:tt-120,rt,it),this.opacity)},clamp(){return new Hsl(clamph(this.h),clampt(this.s),clampt(this.l),clampa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const tt=clampa(this.opacity);return`${tt===1?"hsl(":"hsla("}${clamph(this.h)}, ${clampt(this.s)*100}%, ${clampt(this.l)*100}%${tt===1?")":`, ${tt})`}`}}));function clamph(tt){return tt=(tt||0)%360,tt<0?tt+360:tt}function clampt(tt){return Math.max(0,Math.min(1,tt||0))}function hsl2rgb(tt,et,nt){return(tt<60?et+(nt-et)*tt/60:tt<180?nt:tt<240?et+(nt-et)*(240-tt)/60:et)*255}const constant$3=tt=>()=>tt;function linear$1(tt,et){return function(nt){return tt+nt*et}}function exponential(tt,et,nt){return tt=Math.pow(tt,nt),et=Math.pow(et,nt)-tt,nt=1/nt,function(it){return Math.pow(tt+it*et,nt)}}function gamma(tt){return(tt=+tt)==1?nogamma:function(et,nt){return nt-et?exponential(et,nt,tt):constant$3(isNaN(et)?nt:et)}}function nogamma(tt,et){var nt=et-tt;return nt?linear$1(tt,nt):constant$3(isNaN(tt)?et:tt)}const interpolateRgb=function tt(et){var nt=gamma(et);function it(rt,ot){var at=nt((rt=rgb(rt)).r,(ot=rgb(ot)).r),st=nt(rt.g,ot.g),lt=nt(rt.b,ot.b),ct=nogamma(rt.opacity,ot.opacity);return function(ut){return rt.r=at(ut),rt.g=st(ut),rt.b=lt(ut),rt.opacity=ct(ut),rt+""}}return it.gamma=tt,it}(1);function numberArray(tt,et){et||(et=[]);var nt=tt?Math.min(et.length,tt.length):0,it=et.slice(),rt;return function(ot){for(rt=0;rtnt&&(ot=et.slice(nt,ot),st[at]?st[at]+=ot:st[++at]=ot),(it=it[0])===(rt=rt[0])?st[at]?st[at]+=rt:st[++at]=rt:(st[++at]=null,lt.push({i:at,x:interpolateNumber$1(it,rt)})),nt=reB.lastIndex;return nt180?ut+=360:ut-ct>180&&(ct+=360),dt.push({i:ht.push(rt(ht)+"rotate(",null,it)-2,x:interpolateNumber$1(ct,ut)})):ut&&ht.push(rt(ht)+"rotate("+ut+it)}function st(ct,ut,ht,dt){ct!==ut?dt.push({i:ht.push(rt(ht)+"skewX(",null,it)-2,x:interpolateNumber$1(ct,ut)}):ut&&ht.push(rt(ht)+"skewX("+ut+it)}function lt(ct,ut,ht,dt,pt,mt){if(ct!==ht||ut!==dt){var gt=pt.push(rt(pt)+"scale(",null,",",null,")");mt.push({i:gt-4,x:interpolateNumber$1(ct,ht)},{i:gt-2,x:interpolateNumber$1(ut,dt)})}else(ht!==1||dt!==1)&&pt.push(rt(pt)+"scale("+ht+","+dt+")")}return function(ct,ut){var ht=[],dt=[];return ct=tt(ct),ut=tt(ut),ot(ct.translateX,ct.translateY,ut.translateX,ut.translateY,ht,dt),at(ct.rotate,ut.rotate,ht,dt),st(ct.skewX,ut.skewX,ht,dt),lt(ct.scaleX,ct.scaleY,ut.scaleX,ut.scaleY,ht,dt),ct=ut=null,function(pt){for(var mt=-1,gt=dt.length,bt;++mtet&&(nt=tt,tt=et,et=nt),function(it){return Math.max(tt,Math.min(et,it))}}function bimap(tt,et,nt){var it=tt[0],rt=tt[1],ot=et[0],at=et[1];return rt2?polymap:bimap,lt=ct=null,ht}function ht(dt){return dt==null||isNaN(dt=+dt)?ot:(lt||(lt=st(tt.map(it),et,nt)))(it(at(dt)))}return ht.invert=function(dt){return at(rt((ct||(ct=st(et,tt.map(it),interpolateNumber$1)))(dt)))},ht.domain=function(dt){return arguments.length?(tt=Array.from(dt,number$3),ut()):tt.slice()},ht.range=function(dt){return arguments.length?(et=Array.from(dt),ut()):et.slice()},ht.rangeRound=function(dt){return et=Array.from(dt),nt=interpolateRound,ut()},ht.clamp=function(dt){return arguments.length?(at=dt?!0:identity$6,ut()):at!==identity$6},ht.interpolate=function(dt){return arguments.length?(nt=dt,ut()):nt},ht.unknown=function(dt){return arguments.length?(ot=dt,ht):ot},function(dt,pt){return it=dt,rt=pt,ut()}}function continuous(){return transformer$2()(identity$6,identity$6)}function formatDecimal(tt){return Math.abs(tt=Math.round(tt))>=1e21?tt.toLocaleString("en").replace(/,/g,""):tt.toString(10)}function formatDecimalParts(tt,et){if((nt=(tt=et?tt.toExponential(et-1):tt.toExponential()).indexOf("e"))<0)return null;var nt,it=tt.slice(0,nt);return[it.length>1?it[0]+it.slice(2):it,+tt.slice(nt+1)]}function exponent(tt){return tt=formatDecimalParts(Math.abs(tt)),tt?tt[1]:NaN}function formatGroup(tt,et){return function(nt,it){for(var rt=nt.length,ot=[],at=0,st=tt[0],lt=0;rt>0&&st>0&&(lt+st+1>it&&(st=Math.max(1,it-lt)),ot.push(nt.substring(rt-=st,rt+st)),!((lt+=st+1)>it));)st=tt[at=(at+1)%tt.length];return ot.reverse().join(et)}}function formatNumerals(tt){return function(et){return et.replace(/[0-9]/g,function(nt){return tt[+nt]})}}var re$1=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(tt){if(!(et=re$1.exec(tt)))throw new Error("invalid format: "+tt);var et;return new FormatSpecifier({fill:et[1],align:et[2],sign:et[3],symbol:et[4],zero:et[5],width:et[6],comma:et[7],precision:et[8]&&et[8].slice(1),trim:et[9],type:et[10]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(tt){this.fill=tt.fill===void 0?" ":tt.fill+"",this.align=tt.align===void 0?">":tt.align+"",this.sign=tt.sign===void 0?"-":tt.sign+"",this.symbol=tt.symbol===void 0?"":tt.symbol+"",this.zero=!!tt.zero,this.width=tt.width===void 0?void 0:+tt.width,this.comma=!!tt.comma,this.precision=tt.precision===void 0?void 0:+tt.precision,this.trim=!!tt.trim,this.type=tt.type===void 0?"":tt.type+""}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function formatTrim(tt){e:for(var et=tt.length,nt=1,it=-1,rt;nt0&&(it=0);break}return it>0?tt.slice(0,it)+tt.slice(rt+1):tt}var prefixExponent;function formatPrefixAuto(tt,et){var nt=formatDecimalParts(tt,et);if(!nt)return tt+"";var it=nt[0],rt=nt[1],ot=rt-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(rt/3)))*3)+1,at=it.length;return ot===at?it:ot>at?it+new Array(ot-at+1).join("0"):ot>0?it.slice(0,ot)+"."+it.slice(ot):"0."+new Array(1-ot).join("0")+formatDecimalParts(tt,Math.max(0,et+ot-1))[0]}function formatRounded(tt,et){var nt=formatDecimalParts(tt,et);if(!nt)return tt+"";var it=nt[0],rt=nt[1];return rt<0?"0."+new Array(-rt).join("0")+it:it.length>rt+1?it.slice(0,rt+1)+"."+it.slice(rt+1):it+new Array(rt-it.length+2).join("0")}const formatTypes={"%":(tt,et)=>(tt*100).toFixed(et),b:tt=>Math.round(tt).toString(2),c:tt=>tt+"",d:formatDecimal,e:(tt,et)=>tt.toExponential(et),f:(tt,et)=>tt.toFixed(et),g:(tt,et)=>tt.toPrecision(et),o:tt=>Math.round(tt).toString(8),p:(tt,et)=>formatRounded(tt*100,et),r:formatRounded,s:formatPrefixAuto,X:tt=>Math.round(tt).toString(16).toUpperCase(),x:tt=>Math.round(tt).toString(16)};function identity$5(tt){return tt}var map$3=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale$1(tt){var et=tt.grouping===void 0||tt.thousands===void 0?identity$5:formatGroup(map$3.call(tt.grouping,Number),tt.thousands+""),nt=tt.currency===void 0?"":tt.currency[0]+"",it=tt.currency===void 0?"":tt.currency[1]+"",rt=tt.decimal===void 0?".":tt.decimal+"",ot=tt.numerals===void 0?identity$5:formatNumerals(map$3.call(tt.numerals,String)),at=tt.percent===void 0?"%":tt.percent+"",st=tt.minus===void 0?"−":tt.minus+"",lt=tt.nan===void 0?"NaN":tt.nan+"";function ct(ht){ht=formatSpecifier(ht);var dt=ht.fill,pt=ht.align,mt=ht.sign,gt=ht.symbol,bt=ht.zero,yt=ht.width,wt=ht.comma,vt=ht.precision,xt=ht.trim,St=ht.type;St==="n"?(wt=!0,St="g"):formatTypes[St]||(vt===void 0&&(vt=12),xt=!0,St="g"),(bt||dt==="0"&&pt==="=")&&(bt=!0,dt="0",pt="=");var Et=gt==="$"?nt:gt==="#"&&/[boxX]/.test(St)?"0"+St.toLowerCase():"",$t=gt==="$"?it:/[%p]/.test(St)?at:"",It=formatTypes[St],Ft=/[defgprs%]/.test(St);vt=vt===void 0?6:/[gprs]/.test(St)?Math.max(1,Math.min(21,vt)):Math.max(0,Math.min(20,vt));function Ht(zt){var Ot=Et,jt=$t,kt,Tt,Ct;if(St==="c")jt=It(zt)+jt,zt="";else{zt=+zt;var Ut=zt<0||1/zt<0;if(zt=isNaN(zt)?lt:It(Math.abs(zt),vt),xt&&(zt=formatTrim(zt)),Ut&&+zt==0&&mt!=="+"&&(Ut=!1),Ot=(Ut?mt==="("?mt:st:mt==="-"||mt==="("?"":mt)+Ot,jt=(St==="s"?prefixes[8+prefixExponent/3]:"")+jt+(Ut&&mt==="("?")":""),Ft){for(kt=-1,Tt=zt.length;++ktCt||Ct>57){jt=(Ct===46?rt+zt.slice(kt+1):zt.slice(kt))+jt,zt=zt.slice(0,kt);break}}}wt&&!bt&&(zt=et(zt,1/0));var Nt=Ot.length+zt.length+jt.length,Bt=Nt>1)+Ot+zt+jt+Bt.slice(Nt);break;default:zt=Bt+Ot+zt+jt;break}return ot(zt)}return Ht.toString=function(){return ht+""},Ht}function ut(ht,dt){var pt=ct((ht=formatSpecifier(ht),ht.type="f",ht)),mt=Math.max(-8,Math.min(8,Math.floor(exponent(dt)/3)))*3,gt=Math.pow(10,-mt),bt=prefixes[8+mt/3];return function(yt){return pt(gt*yt)+bt}}return{format:ct,formatPrefix:ut}}var locale$1,format,formatPrefix;defaultLocale$1({thousands:",",grouping:[3],currency:["$",""]});function defaultLocale$1(tt){return locale$1=formatLocale$1(tt),format=locale$1.format,formatPrefix=locale$1.formatPrefix,locale$1}function precisionFixed(tt){return Math.max(0,-exponent(Math.abs(tt)))}function precisionPrefix(tt,et){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(et)/3)))*3-exponent(Math.abs(tt)))}function precisionRound(tt,et){return tt=Math.abs(tt),et=Math.abs(et)-tt,Math.max(0,exponent(et)-exponent(tt))+1}function tickFormat(tt,et,nt,it){var rt=tickStep(tt,et,nt),ot;switch(it=formatSpecifier(it??",f"),it.type){case"s":{var at=Math.max(Math.abs(tt),Math.abs(et));return it.precision==null&&!isNaN(ot=precisionPrefix(rt,at))&&(it.precision=ot),formatPrefix(it,at)}case"":case"e":case"g":case"p":case"r":{it.precision==null&&!isNaN(ot=precisionRound(rt,Math.max(Math.abs(tt),Math.abs(et))))&&(it.precision=ot-(it.type==="e"));break}case"f":case"%":{it.precision==null&&!isNaN(ot=precisionFixed(rt))&&(it.precision=ot-(it.type==="%")*2);break}}return format(it)}function linearish(tt){var et=tt.domain;return tt.ticks=function(nt){var it=et();return ticks(it[0],it[it.length-1],nt??10)},tt.tickFormat=function(nt,it){var rt=et();return tickFormat(rt[0],rt[rt.length-1],nt??10,it)},tt.nice=function(nt){nt==null&&(nt=10);var it=et(),rt=0,ot=it.length-1,at=it[rt],st=it[ot],lt,ct,ut=10;for(st0;){if(ct=tickIncrement(at,st,nt),ct===lt)return it[rt]=at,it[ot]=st,et(it);if(ct>0)at=Math.floor(at/ct)*ct,st=Math.ceil(st/ct)*ct;else if(ct<0)at=Math.ceil(at*ct)/ct,st=Math.floor(st*ct)/ct;else break;lt=ct}return tt},tt}function linear(){var tt=continuous();return tt.copy=function(){return copy$1(tt,linear())},initRange.apply(tt,arguments),linearish(tt)}function identity$4(tt){var et;function nt(it){return it==null||isNaN(it=+it)?et:it}return nt.invert=nt,nt.domain=nt.range=function(it){return arguments.length?(tt=Array.from(it,number$3),nt):tt.slice()},nt.unknown=function(it){return arguments.length?(et=it,nt):et},nt.copy=function(){return identity$4(tt).unknown(et)},tt=arguments.length?Array.from(tt,number$3):[0,1],linearish(nt)}function nice(tt,et){tt=tt.slice();var nt=0,it=tt.length-1,rt=tt[nt],ot=tt[it],at;return otMath.pow(tt,et)}function logp(tt){return tt===Math.E?Math.log:tt===10&&Math.log10||tt===2&&Math.log2||(tt=Math.log(tt),et=>Math.log(et)/tt)}function reflect(tt){return(et,nt)=>-tt(-et,nt)}function loggish(tt){const et=tt(transformLog,transformExp),nt=et.domain;let it=10,rt,ot;function at(){return rt=logp(it),ot=powp(it),nt()[0]<0?(rt=reflect(rt),ot=reflect(ot),tt(transformLogn,transformExpn)):tt(transformLog,transformExp),et}return et.base=function(st){return arguments.length?(it=+st,at()):it},et.domain=function(st){return arguments.length?(nt(st),at()):nt()},et.ticks=st=>{const lt=nt();let ct=lt[0],ut=lt[lt.length-1];const ht=ut0){for(;dt<=pt;++dt)for(mt=1;mtut)break;yt.push(gt)}}else for(;dt<=pt;++dt)for(mt=it-1;mt>=1;--mt)if(gt=dt>0?mt/ot(-dt):mt*ot(dt),!(gtut)break;yt.push(gt)}yt.length*2{if(st==null&&(st=10),lt==null&&(lt=it===10?"s":","),typeof lt!="function"&&(!(it%1)&&(lt=formatSpecifier(lt)).precision==null&&(lt.trim=!0),lt=format(lt)),st===1/0)return lt;const ct=Math.max(1,it*st/et.ticks().length);return ut=>{let ht=ut/ot(Math.round(rt(ut)));return ht*itnt(nice(nt(),{floor:st=>ot(Math.floor(rt(st))),ceil:st=>ot(Math.ceil(rt(st)))})),et}function log(){const tt=loggish(transformer$2()).domain([1,10]);return tt.copy=()=>copy$1(tt,log()).base(tt.base()),initRange.apply(tt,arguments),tt}function transformSymlog(tt){return function(et){return Math.sign(et)*Math.log1p(Math.abs(et/tt))}}function transformSymexp(tt){return function(et){return Math.sign(et)*Math.expm1(Math.abs(et))*tt}}function symlogish(tt){var et=1,nt=tt(transformSymlog(et),transformSymexp(et));return nt.constant=function(it){return arguments.length?tt(transformSymlog(et=+it),transformSymexp(et)):et},linearish(nt)}function symlog(){var tt=symlogish(transformer$2());return tt.copy=function(){return copy$1(tt,symlog()).constant(tt.constant())},initRange.apply(tt,arguments)}function transformPow(tt){return function(et){return et<0?-Math.pow(-et,tt):Math.pow(et,tt)}}function transformSqrt(tt){return tt<0?-Math.sqrt(-tt):Math.sqrt(tt)}function transformSquare(tt){return tt<0?-tt*tt:tt*tt}function powish(tt){var et=tt(identity$6,identity$6),nt=1;function it(){return nt===1?tt(identity$6,identity$6):nt===.5?tt(transformSqrt,transformSquare):tt(transformPow(nt),transformPow(1/nt))}return et.exponent=function(rt){return arguments.length?(nt=+rt,it()):nt},linearish(et)}function pow(){var tt=powish(transformer$2());return tt.copy=function(){return copy$1(tt,pow()).exponent(tt.exponent())},initRange.apply(tt,arguments),tt}function sqrt(){return pow.apply(null,arguments).exponent(.5)}function square(tt){return Math.sign(tt)*tt*tt}function unsquare(tt){return Math.sign(tt)*Math.sqrt(Math.abs(tt))}function radial(){var tt=continuous(),et=[0,1],nt=!1,it;function rt(ot){var at=unsquare(tt(ot));return isNaN(at)?it:nt?Math.round(at):at}return rt.invert=function(ot){return tt.invert(square(ot))},rt.domain=function(ot){return arguments.length?(tt.domain(ot),rt):tt.domain()},rt.range=function(ot){return arguments.length?(tt.range((et=Array.from(ot,number$3)).map(square)),rt):et.slice()},rt.rangeRound=function(ot){return rt.range(ot).round(!0)},rt.round=function(ot){return arguments.length?(nt=!!ot,rt):nt},rt.clamp=function(ot){return arguments.length?(tt.clamp(ot),rt):tt.clamp()},rt.unknown=function(ot){return arguments.length?(it=ot,rt):it},rt.copy=function(){return radial(tt.domain(),et).round(nt).clamp(tt.clamp()).unknown(it)},initRange.apply(rt,arguments),linearish(rt)}function quantile(){var tt=[],et=[],nt=[],it;function rt(){var at=0,st=Math.max(1,et.length);for(nt=new Array(st-1);++at0?nt[st-1]:tt[0],st=nt?[it[nt-1],et]:[it[ct-1],it[ct]]},at.unknown=function(lt){return arguments.length&&(ot=lt),at},at.thresholds=function(){return it.slice()},at.copy=function(){return quantize().domain([tt,et]).range(rt).unknown(ot)},initRange.apply(linearish(at),arguments)}function threshold(){var tt=[.5],et=[0,1],nt,it=1;function rt(ot){return ot!=null&&ot<=ot?et[bisect(tt,ot,0,it)]:nt}return rt.domain=function(ot){return arguments.length?(tt=Array.from(ot),it=Math.min(tt.length,et.length-1),rt):tt.slice()},rt.range=function(ot){return arguments.length?(et=Array.from(ot),it=Math.min(tt.length,et.length-1),rt):et.slice()},rt.invertExtent=function(ot){var at=et.indexOf(ot);return[tt[at-1],tt[at]]},rt.unknown=function(ot){return arguments.length?(nt=ot,rt):nt},rt.copy=function(){return threshold().domain(tt).range(et).unknown(nt)},initRange.apply(rt,arguments)}const t0=new Date,t1=new Date;function timeInterval(tt,et,nt,it){function rt(ot){return tt(ot=arguments.length===0?new Date:new Date(+ot)),ot}return rt.floor=ot=>(tt(ot=new Date(+ot)),ot),rt.ceil=ot=>(tt(ot=new Date(ot-1)),et(ot,1),tt(ot),ot),rt.round=ot=>{const at=rt(ot),st=rt.ceil(ot);return ot-at(et(ot=new Date(+ot),at==null?1:Math.floor(at)),ot),rt.range=(ot,at,st)=>{const lt=[];if(ot=rt.ceil(ot),st=st==null?1:Math.floor(st),!(ot0))return lt;let ct;do lt.push(ct=new Date(+ot)),et(ot,st),tt(ot);while(cttimeInterval(at=>{if(at>=at)for(;tt(at),!ot(at);)at.setTime(at-1)},(at,st)=>{if(at>=at)if(st<0)for(;++st<=0;)for(;et(at,-1),!ot(at););else for(;--st>=0;)for(;et(at,1),!ot(at););}),nt&&(rt.count=(ot,at)=>(t0.setTime(+ot),t1.setTime(+at),tt(t0),tt(t1),Math.floor(nt(t0,t1))),rt.every=ot=>(ot=Math.floor(ot),!isFinite(ot)||!(ot>0)?null:ot>1?rt.filter(it?at=>it(at)%ot===0:at=>rt.count(0,at)%ot===0):rt)),rt}const millisecond=timeInterval(()=>{},(tt,et)=>{tt.setTime(+tt+et)},(tt,et)=>et-tt);millisecond.every=tt=>(tt=Math.floor(tt),!isFinite(tt)||!(tt>0)?null:tt>1?timeInterval(et=>{et.setTime(Math.floor(et/tt)*tt)},(et,nt)=>{et.setTime(+et+nt*tt)},(et,nt)=>(nt-et)/tt):millisecond);millisecond.range;const durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,second=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds())},(tt,et)=>{tt.setTime(+tt+et*durationSecond)},(tt,et)=>(et-tt)/durationSecond,tt=>tt.getUTCSeconds());second.range;const timeMinute=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds()-tt.getSeconds()*durationSecond)},(tt,et)=>{tt.setTime(+tt+et*durationMinute)},(tt,et)=>(et-tt)/durationMinute,tt=>tt.getMinutes());timeMinute.range;const utcMinute=timeInterval(tt=>{tt.setUTCSeconds(0,0)},(tt,et)=>{tt.setTime(+tt+et*durationMinute)},(tt,et)=>(et-tt)/durationMinute,tt=>tt.getUTCMinutes());utcMinute.range;const timeHour=timeInterval(tt=>{tt.setTime(tt-tt.getMilliseconds()-tt.getSeconds()*durationSecond-tt.getMinutes()*durationMinute)},(tt,et)=>{tt.setTime(+tt+et*durationHour)},(tt,et)=>(et-tt)/durationHour,tt=>tt.getHours());timeHour.range;const utcHour=timeInterval(tt=>{tt.setUTCMinutes(0,0,0)},(tt,et)=>{tt.setTime(+tt+et*durationHour)},(tt,et)=>(et-tt)/durationHour,tt=>tt.getUTCHours());utcHour.range;const timeDay=timeInterval(tt=>tt.setHours(0,0,0,0),(tt,et)=>tt.setDate(tt.getDate()+et),(tt,et)=>(et-tt-(et.getTimezoneOffset()-tt.getTimezoneOffset())*durationMinute)/durationDay,tt=>tt.getDate()-1);timeDay.range;const utcDay=timeInterval(tt=>{tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCDate(tt.getUTCDate()+et)},(tt,et)=>(et-tt)/durationDay,tt=>tt.getUTCDate()-1);utcDay.range;const unixDay=timeInterval(tt=>{tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCDate(tt.getUTCDate()+et)},(tt,et)=>(et-tt)/durationDay,tt=>Math.floor(tt/durationDay));unixDay.range;function timeWeekday(tt){return timeInterval(et=>{et.setDate(et.getDate()-(et.getDay()+7-tt)%7),et.setHours(0,0,0,0)},(et,nt)=>{et.setDate(et.getDate()+nt*7)},(et,nt)=>(nt-et-(nt.getTimezoneOffset()-et.getTimezoneOffset())*durationMinute)/durationWeek)}const timeSunday=timeWeekday(0),timeMonday=timeWeekday(1),timeTuesday=timeWeekday(2),timeWednesday=timeWeekday(3),timeThursday=timeWeekday(4),timeFriday=timeWeekday(5),timeSaturday=timeWeekday(6);timeSunday.range;timeMonday.range;timeTuesday.range;timeWednesday.range;timeThursday.range;timeFriday.range;timeSaturday.range;function utcWeekday(tt){return timeInterval(et=>{et.setUTCDate(et.getUTCDate()-(et.getUTCDay()+7-tt)%7),et.setUTCHours(0,0,0,0)},(et,nt)=>{et.setUTCDate(et.getUTCDate()+nt*7)},(et,nt)=>(nt-et)/durationWeek)}const utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6);utcSunday.range;utcMonday.range;utcTuesday.range;utcWednesday.range;utcThursday.range;utcFriday.range;utcSaturday.range;const timeMonth=timeInterval(tt=>{tt.setDate(1),tt.setHours(0,0,0,0)},(tt,et)=>{tt.setMonth(tt.getMonth()+et)},(tt,et)=>et.getMonth()-tt.getMonth()+(et.getFullYear()-tt.getFullYear())*12,tt=>tt.getMonth());timeMonth.range;const utcMonth=timeInterval(tt=>{tt.setUTCDate(1),tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCMonth(tt.getUTCMonth()+et)},(tt,et)=>et.getUTCMonth()-tt.getUTCMonth()+(et.getUTCFullYear()-tt.getUTCFullYear())*12,tt=>tt.getUTCMonth());utcMonth.range;const timeYear=timeInterval(tt=>{tt.setMonth(0,1),tt.setHours(0,0,0,0)},(tt,et)=>{tt.setFullYear(tt.getFullYear()+et)},(tt,et)=>et.getFullYear()-tt.getFullYear(),tt=>tt.getFullYear());timeYear.every=tt=>!isFinite(tt=Math.floor(tt))||!(tt>0)?null:timeInterval(et=>{et.setFullYear(Math.floor(et.getFullYear()/tt)*tt),et.setMonth(0,1),et.setHours(0,0,0,0)},(et,nt)=>{et.setFullYear(et.getFullYear()+nt*tt)});timeYear.range;const utcYear=timeInterval(tt=>{tt.setUTCMonth(0,1),tt.setUTCHours(0,0,0,0)},(tt,et)=>{tt.setUTCFullYear(tt.getUTCFullYear()+et)},(tt,et)=>et.getUTCFullYear()-tt.getUTCFullYear(),tt=>tt.getUTCFullYear());utcYear.every=tt=>!isFinite(tt=Math.floor(tt))||!(tt>0)?null:timeInterval(et=>{et.setUTCFullYear(Math.floor(et.getUTCFullYear()/tt)*tt),et.setUTCMonth(0,1),et.setUTCHours(0,0,0,0)},(et,nt)=>{et.setUTCFullYear(et.getUTCFullYear()+nt*tt)});utcYear.range;function ticker(tt,et,nt,it,rt,ot){const at=[[second,1,durationSecond],[second,5,5*durationSecond],[second,15,15*durationSecond],[second,30,30*durationSecond],[ot,1,durationMinute],[ot,5,5*durationMinute],[ot,15,15*durationMinute],[ot,30,30*durationMinute],[rt,1,durationHour],[rt,3,3*durationHour],[rt,6,6*durationHour],[rt,12,12*durationHour],[it,1,durationDay],[it,2,2*durationDay],[nt,1,durationWeek],[et,1,durationMonth],[et,3,3*durationMonth],[tt,1,durationYear]];function st(ct,ut,ht){const dt=utbt).right(at,dt);if(pt===at.length)return tt.every(tickStep(ct/durationYear,ut/durationYear,ht));if(pt===0)return millisecond.every(Math.max(tickStep(ct,ut,ht),1));const[mt,gt]=at[dt/at[pt-1][2]53)return null;"w"in Zt||(Zt.w=1),"Z"in Zt?(In=utcDate(newDate(Zt.y,0,1)),Cn=In.getUTCDay(),In=Cn>4||Cn===0?utcMonday.ceil(In):utcMonday(In),In=utcDay.offset(In,(Zt.V-1)*7),Zt.y=In.getUTCFullYear(),Zt.m=In.getUTCMonth(),Zt.d=In.getUTCDate()+(Zt.w+6)%7):(In=localDate(newDate(Zt.y,0,1)),Cn=In.getDay(),In=Cn>4||Cn===0?timeMonday.ceil(In):timeMonday(In),In=timeDay.offset(In,(Zt.V-1)*7),Zt.y=In.getFullYear(),Zt.m=In.getMonth(),Zt.d=In.getDate()+(Zt.w+6)%7)}else("W"in Zt||"U"in Zt)&&("w"in Zt||(Zt.w="u"in Zt?Zt.u%7:"W"in Zt?1:0),Cn="Z"in Zt?utcDate(newDate(Zt.y,0,1)).getUTCDay():localDate(newDate(Zt.y,0,1)).getDay(),Zt.m=0,Zt.d="W"in Zt?(Zt.w+6)%7+Zt.W*7-(Cn+5)%7:Zt.w+Zt.U*7-(Cn+6)%7);return"Z"in Zt?(Zt.H+=Zt.Z/100|0,Zt.M+=Zt.Z%100,utcDate(Zt)):localDate(Zt)}}function It(fn,xn,an,Zt){for(var En=0,In=xn.length,Cn=an.length,Nn,Un;En=Cn)return-1;if(Nn=xn.charCodeAt(En++),Nn===37){if(Nn=xn.charAt(En++),Un=St[Nn in pads?xn.charAt(En++):Nn],!Un||(Zt=Un(fn,an,Zt))<0)return-1}else if(Nn!=an.charCodeAt(Zt++))return-1}return Zt}function Ft(fn,xn,an){var Zt=ct.exec(xn.slice(an));return Zt?(fn.p=ut.get(Zt[0].toLowerCase()),an+Zt[0].length):-1}function Ht(fn,xn,an){var Zt=pt.exec(xn.slice(an));return Zt?(fn.w=mt.get(Zt[0].toLowerCase()),an+Zt[0].length):-1}function zt(fn,xn,an){var Zt=ht.exec(xn.slice(an));return Zt?(fn.w=dt.get(Zt[0].toLowerCase()),an+Zt[0].length):-1}function Ot(fn,xn,an){var Zt=yt.exec(xn.slice(an));return Zt?(fn.m=wt.get(Zt[0].toLowerCase()),an+Zt[0].length):-1}function jt(fn,xn,an){var Zt=gt.exec(xn.slice(an));return Zt?(fn.m=bt.get(Zt[0].toLowerCase()),an+Zt[0].length):-1}function kt(fn,xn,an){return It(fn,et,xn,an)}function Tt(fn,xn,an){return It(fn,nt,xn,an)}function Ct(fn,xn,an){return It(fn,it,xn,an)}function Ut(fn){return at[fn.getDay()]}function Nt(fn){return ot[fn.getDay()]}function Bt(fn){return lt[fn.getMonth()]}function Mt(fn){return st[fn.getMonth()]}function Dt(fn){return rt[+(fn.getHours()>=12)]}function Pt(fn){return 1+~~(fn.getMonth()/3)}function Vt(fn){return at[fn.getUTCDay()]}function nn(fn){return ot[fn.getUTCDay()]}function cn(fn){return lt[fn.getUTCMonth()]}function Xt(fn){return st[fn.getUTCMonth()]}function un(fn){return rt[+(fn.getUTCHours()>=12)]}function en(fn){return 1+~~(fn.getUTCMonth()/3)}return{format:function(fn){var xn=Et(fn+="",vt);return xn.toString=function(){return fn},xn},parse:function(fn){var xn=$t(fn+="",!1);return xn.toString=function(){return fn},xn},utcFormat:function(fn){var xn=Et(fn+="",xt);return xn.toString=function(){return fn},xn},utcParse:function(fn){var xn=$t(fn+="",!0);return xn.toString=function(){return fn},xn}}}var pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function pad(tt,et,nt){var it=tt<0?"-":"",rt=(it?-tt:tt)+"",ot=rt.length;return it+(ot[et.toLowerCase(),nt]))}function parseWeekdayNumberSunday(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+1));return it?(tt.w=+it[0],nt+it[0].length):-1}function parseWeekdayNumberMonday(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+1));return it?(tt.u=+it[0],nt+it[0].length):-1}function parseWeekNumberSunday(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.U=+it[0],nt+it[0].length):-1}function parseWeekNumberISO(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.V=+it[0],nt+it[0].length):-1}function parseWeekNumberMonday(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.W=+it[0],nt+it[0].length):-1}function parseFullYear(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+4));return it?(tt.y=+it[0],nt+it[0].length):-1}function parseYear(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.y=+it[0]+(+it[0]>68?1900:2e3),nt+it[0].length):-1}function parseZone(tt,et,nt){var it=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(et.slice(nt,nt+6));return it?(tt.Z=it[1]?0:-(it[2]+(it[3]||"00")),nt+it[0].length):-1}function parseQuarter(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+1));return it?(tt.q=it[0]*3-3,nt+it[0].length):-1}function parseMonthNumber(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.m=it[0]-1,nt+it[0].length):-1}function parseDayOfMonth(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.d=+it[0],nt+it[0].length):-1}function parseDayOfYear(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+3));return it?(tt.m=0,tt.d=+it[0],nt+it[0].length):-1}function parseHour24(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.H=+it[0],nt+it[0].length):-1}function parseMinutes(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.M=+it[0],nt+it[0].length):-1}function parseSeconds(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+2));return it?(tt.S=+it[0],nt+it[0].length):-1}function parseMilliseconds(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+3));return it?(tt.L=+it[0],nt+it[0].length):-1}function parseMicroseconds(tt,et,nt){var it=numberRe.exec(et.slice(nt,nt+6));return it?(tt.L=Math.floor(it[0]/1e3),nt+it[0].length):-1}function parseLiteralPercent(tt,et,nt){var it=percentRe.exec(et.slice(nt,nt+1));return it?nt+it[0].length:-1}function parseUnixTimestamp(tt,et,nt){var it=numberRe.exec(et.slice(nt));return it?(tt.Q=+it[0],nt+it[0].length):-1}function parseUnixTimestampSeconds(tt,et,nt){var it=numberRe.exec(et.slice(nt));return it?(tt.s=+it[0],nt+it[0].length):-1}function formatDayOfMonth(tt,et){return pad(tt.getDate(),et,2)}function formatHour24(tt,et){return pad(tt.getHours(),et,2)}function formatHour12(tt,et){return pad(tt.getHours()%12||12,et,2)}function formatDayOfYear(tt,et){return pad(1+timeDay.count(timeYear(tt),tt),et,3)}function formatMilliseconds(tt,et){return pad(tt.getMilliseconds(),et,3)}function formatMicroseconds(tt,et){return formatMilliseconds(tt,et)+"000"}function formatMonthNumber(tt,et){return pad(tt.getMonth()+1,et,2)}function formatMinutes(tt,et){return pad(tt.getMinutes(),et,2)}function formatSeconds(tt,et){return pad(tt.getSeconds(),et,2)}function formatWeekdayNumberMonday(tt){var et=tt.getDay();return et===0?7:et}function formatWeekNumberSunday(tt,et){return pad(timeSunday.count(timeYear(tt)-1,tt),et,2)}function dISO(tt){var et=tt.getDay();return et>=4||et===0?timeThursday(tt):timeThursday.ceil(tt)}function formatWeekNumberISO(tt,et){return tt=dISO(tt),pad(timeThursday.count(timeYear(tt),tt)+(timeYear(tt).getDay()===4),et,2)}function formatWeekdayNumberSunday(tt){return tt.getDay()}function formatWeekNumberMonday(tt,et){return pad(timeMonday.count(timeYear(tt)-1,tt),et,2)}function formatYear(tt,et){return pad(tt.getFullYear()%100,et,2)}function formatYearISO(tt,et){return tt=dISO(tt),pad(tt.getFullYear()%100,et,2)}function formatFullYear(tt,et){return pad(tt.getFullYear()%1e4,et,4)}function formatFullYearISO(tt,et){var nt=tt.getDay();return tt=nt>=4||nt===0?timeThursday(tt):timeThursday.ceil(tt),pad(tt.getFullYear()%1e4,et,4)}function formatZone(tt){var et=tt.getTimezoneOffset();return(et>0?"-":(et*=-1,"+"))+pad(et/60|0,"0",2)+pad(et%60,"0",2)}function formatUTCDayOfMonth(tt,et){return pad(tt.getUTCDate(),et,2)}function formatUTCHour24(tt,et){return pad(tt.getUTCHours(),et,2)}function formatUTCHour12(tt,et){return pad(tt.getUTCHours()%12||12,et,2)}function formatUTCDayOfYear(tt,et){return pad(1+utcDay.count(utcYear(tt),tt),et,3)}function formatUTCMilliseconds(tt,et){return pad(tt.getUTCMilliseconds(),et,3)}function formatUTCMicroseconds(tt,et){return formatUTCMilliseconds(tt,et)+"000"}function formatUTCMonthNumber(tt,et){return pad(tt.getUTCMonth()+1,et,2)}function formatUTCMinutes(tt,et){return pad(tt.getUTCMinutes(),et,2)}function formatUTCSeconds(tt,et){return pad(tt.getUTCSeconds(),et,2)}function formatUTCWeekdayNumberMonday(tt){var et=tt.getUTCDay();return et===0?7:et}function formatUTCWeekNumberSunday(tt,et){return pad(utcSunday.count(utcYear(tt)-1,tt),et,2)}function UTCdISO(tt){var et=tt.getUTCDay();return et>=4||et===0?utcThursday(tt):utcThursday.ceil(tt)}function formatUTCWeekNumberISO(tt,et){return tt=UTCdISO(tt),pad(utcThursday.count(utcYear(tt),tt)+(utcYear(tt).getUTCDay()===4),et,2)}function formatUTCWeekdayNumberSunday(tt){return tt.getUTCDay()}function formatUTCWeekNumberMonday(tt,et){return pad(utcMonday.count(utcYear(tt)-1,tt),et,2)}function formatUTCYear(tt,et){return pad(tt.getUTCFullYear()%100,et,2)}function formatUTCYearISO(tt,et){return tt=UTCdISO(tt),pad(tt.getUTCFullYear()%100,et,2)}function formatUTCFullYear(tt,et){return pad(tt.getUTCFullYear()%1e4,et,4)}function formatUTCFullYearISO(tt,et){var nt=tt.getUTCDay();return tt=nt>=4||nt===0?utcThursday(tt):utcThursday.ceil(tt),pad(tt.getUTCFullYear()%1e4,et,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(tt){return+tt}function formatUnixTimestampSeconds(tt){return Math.floor(+tt/1e3)}var locale,timeFormat,utcFormat;defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function defaultLocale(tt){return locale=formatLocale(tt),timeFormat=locale.format,locale.parse,utcFormat=locale.utcFormat,locale.utcParse,locale}function date(tt){return new Date(tt)}function number$2(tt){return tt instanceof Date?+tt:+new Date(+tt)}function calendar(tt,et,nt,it,rt,ot,at,st,lt,ct){var ut=continuous(),ht=ut.invert,dt=ut.domain,pt=ct(".%L"),mt=ct(":%S"),gt=ct("%I:%M"),bt=ct("%I %p"),yt=ct("%a %d"),wt=ct("%b %d"),vt=ct("%B"),xt=ct("%Y");function St(Et){return(lt(Et)et(rt/(tt.length-1)))},nt.quantiles=function(it){return Array.from({length:it+1},(rt,ot)=>quantile$1(tt,ot/it))},nt.copy=function(){return sequentialQuantile(et).domain(tt)},initInterpolator.apply(nt,arguments)}function transformer(){var tt=0,et=.5,nt=1,it=1,rt,ot,at,st,lt,ct=identity$6,ut,ht=!1,dt;function pt(gt){return isNaN(gt=+gt)?dt:(gt=.5+((gt=+ut(gt))-ot)*(it*gtet}var _baseGt=baseGt$1,baseExtremum$1=_baseExtremum,baseGt=_baseGt,identity$3=identity_1;function max(tt){return tt&&tt.length?baseExtremum$1(tt,identity$3,baseGt):void 0}var max_1=max;const max$1=getDefaultExportFromCjs(max_1);function baseLt$1(tt,et){return tttt.e^ot.s<0?1:-1;for(it=ot.d.length,rt=tt.d.length,et=0,nt=ittt.d[et]^ot.s<0?1:-1;return it===rt?0:it>rt^ot.s<0?1:-1};P.decimalPlaces=P.dp=function(){var tt=this,et=tt.d.length-1,nt=(et-tt.e)*LOG_BASE;if(et=tt.d[et],et)for(;et%10==0;et/=10)nt--;return nt<0?0:nt};P.dividedBy=P.div=function(tt){return divide(this,new this.constructor(tt))};P.dividedToIntegerBy=P.idiv=function(tt){var et=this,nt=et.constructor;return round(divide(et,new nt(tt),0,1),nt.precision)};P.equals=P.eq=function(tt){return!this.cmp(tt)};P.exponent=function(){return getBase10Exponent(this)};P.greaterThan=P.gt=function(tt){return this.cmp(tt)>0};P.greaterThanOrEqualTo=P.gte=function(tt){return this.cmp(tt)>=0};P.isInteger=P.isint=function(){return this.e>this.d.length-2};P.isNegative=P.isneg=function(){return this.s<0};P.isPositive=P.ispos=function(){return this.s>0};P.isZero=function(){return this.s===0};P.lessThan=P.lt=function(tt){return this.cmp(tt)<0};P.lessThanOrEqualTo=P.lte=function(tt){return this.cmp(tt)<1};P.logarithm=P.log=function(tt){var et,nt=this,it=nt.constructor,rt=it.precision,ot=rt+5;if(tt===void 0)tt=new it(10);else if(tt=new it(tt),tt.s<1||tt.eq(ONE))throw Error(decimalError+"NaN");if(nt.s<1)throw Error(decimalError+(nt.s?"NaN":"-Infinity"));return nt.eq(ONE)?new it(0):(external=!1,et=divide(ln(nt,ot),ln(tt,ot),ot),external=!0,round(et,rt))};P.minus=P.sub=function(tt){var et=this;return tt=new et.constructor(tt),et.s==tt.s?subtract(et,tt):add(et,(tt.s=-tt.s,tt))};P.modulo=P.mod=function(tt){var et,nt=this,it=nt.constructor,rt=it.precision;if(tt=new it(tt),!tt.s)throw Error(decimalError+"NaN");return nt.s?(external=!1,et=divide(nt,tt,0,1).times(tt),external=!0,nt.minus(et)):round(new it(nt),rt)};P.naturalExponential=P.exp=function(){return exp(this)};P.naturalLogarithm=P.ln=function(){return ln(this)};P.negated=P.neg=function(){var tt=new this.constructor(this);return tt.s=-tt.s||0,tt};P.plus=P.add=function(tt){var et=this;return tt=new et.constructor(tt),et.s==tt.s?add(et,tt):subtract(et,(tt.s=-tt.s,tt))};P.precision=P.sd=function(tt){var et,nt,it,rt=this;if(tt!==void 0&&tt!==!!tt&&tt!==1&&tt!==0)throw Error(invalidArgument+tt);if(et=getBase10Exponent(rt)+1,it=rt.d.length-1,nt=it*LOG_BASE+1,it=rt.d[it],it){for(;it%10==0;it/=10)nt--;for(it=rt.d[0];it>=10;it/=10)nt++}return tt&&et>nt?et:nt};P.squareRoot=P.sqrt=function(){var tt,et,nt,it,rt,ot,at,st=this,lt=st.constructor;if(st.s<1){if(!st.s)return new lt(0);throw Error(decimalError+"NaN")}for(tt=getBase10Exponent(st),external=!1,rt=Math.sqrt(+st),rt==0||rt==1/0?(et=digitsToString(st.d),(et.length+tt)%2==0&&(et+="0"),rt=Math.sqrt(et),tt=mathfloor((tt+1)/2)-(tt<0||tt%2),rt==1/0?et="5e"+tt:(et=rt.toExponential(),et=et.slice(0,et.indexOf("e")+1)+tt),it=new lt(et)):it=new lt(rt.toString()),nt=lt.precision,rt=at=nt+3;;)if(ot=it,it=ot.plus(divide(st,ot,at+2)).times(.5),digitsToString(ot.d).slice(0,at)===(et=digitsToString(it.d)).slice(0,at)){if(et=et.slice(at-3,at+1),rt==at&&et=="4999"){if(round(ot,nt+1,0),ot.times(ot).eq(st)){it=ot;break}}else if(et!="9999")break;at+=4}return external=!0,round(it,nt)};P.times=P.mul=function(tt){var et,nt,it,rt,ot,at,st,lt,ct,ut=this,ht=ut.constructor,dt=ut.d,pt=(tt=new ht(tt)).d;if(!ut.s||!tt.s)return new ht(0);for(tt.s*=ut.s,nt=ut.e+tt.e,lt=dt.length,ct=pt.length,lt=0;){for(et=0,rt=lt+it;rt>it;)st=ot[rt]+pt[it]*dt[rt-it-1]+et,ot[rt--]=st%BASE|0,et=st/BASE|0;ot[rt]=(ot[rt]+et)%BASE|0}for(;!ot[--at];)ot.pop();return et?++nt:ot.shift(),tt.d=ot,tt.e=nt,external?round(tt,ht.precision):tt};P.toDecimalPlaces=P.todp=function(tt,et){var nt=this,it=nt.constructor;return nt=new it(nt),tt===void 0?nt:(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=it.rounding:checkInt32(et,0,8),round(nt,tt+getBase10Exponent(nt)+1,et))};P.toExponential=function(tt,et){var nt,it=this,rt=it.constructor;return tt===void 0?nt=toString$2(it,!0):(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=rt.rounding:checkInt32(et,0,8),it=round(new rt(it),tt+1,et),nt=toString$2(it,!0,tt+1)),nt};P.toFixed=function(tt,et){var nt,it,rt=this,ot=rt.constructor;return tt===void 0?toString$2(rt):(checkInt32(tt,0,MAX_DIGITS),et===void 0?et=ot.rounding:checkInt32(et,0,8),it=round(new ot(rt),tt+getBase10Exponent(rt)+1,et),nt=toString$2(it.abs(),!1,tt+getBase10Exponent(it)+1),rt.isneg()&&!rt.isZero()?"-"+nt:nt)};P.toInteger=P.toint=function(){var tt=this,et=tt.constructor;return round(new et(tt),getBase10Exponent(tt)+1,et.rounding)};P.toNumber=function(){return+this};P.toPower=P.pow=function(tt){var et,nt,it,rt,ot,at,st=this,lt=st.constructor,ct=12,ut=+(tt=new lt(tt));if(!tt.s)return new lt(ONE);if(st=new lt(st),!st.s){if(tt.s<1)throw Error(decimalError+"Infinity");return st}if(st.eq(ONE))return st;if(it=lt.precision,tt.eq(ONE))return round(st,it);if(et=tt.e,nt=tt.d.length-1,at=et>=nt,ot=st.s,at){if((nt=ut<0?-ut:ut)<=MAX_SAFE_INTEGER){for(rt=new lt(ONE),et=Math.ceil(it/LOG_BASE+4),external=!1;nt%2&&(rt=rt.times(st),truncate(rt.d,et)),nt=mathfloor(nt/2),nt!==0;)st=st.times(st),truncate(st.d,et);return external=!0,tt.s<0?new lt(ONE).div(rt):round(rt,it)}}else if(ot<0)throw Error(decimalError+"NaN");return ot=ot<0&&tt.d[Math.max(et,nt)]&1?-1:1,st.s=1,external=!1,rt=tt.times(ln(st,it+ct)),external=!0,rt=exp(rt),rt.s=ot,rt};P.toPrecision=function(tt,et){var nt,it,rt=this,ot=rt.constructor;return tt===void 0?(nt=getBase10Exponent(rt),it=toString$2(rt,nt<=ot.toExpNeg||nt>=ot.toExpPos)):(checkInt32(tt,1,MAX_DIGITS),et===void 0?et=ot.rounding:checkInt32(et,0,8),rt=round(new ot(rt),tt,et),nt=getBase10Exponent(rt),it=toString$2(rt,tt<=nt||nt<=ot.toExpNeg,tt)),it};P.toSignificantDigits=P.tosd=function(tt,et){var nt=this,it=nt.constructor;return tt===void 0?(tt=it.precision,et=it.rounding):(checkInt32(tt,1,MAX_DIGITS),et===void 0?et=it.rounding:checkInt32(et,0,8)),round(new it(nt),tt,et)};P.toString=P.valueOf=P.val=P.toJSON=P[Symbol.for("nodejs.util.inspect.custom")]=function(){var tt=this,et=getBase10Exponent(tt),nt=tt.constructor;return toString$2(tt,et<=nt.toExpNeg||et>=nt.toExpPos)};function add(tt,et){var nt,it,rt,ot,at,st,lt,ct,ut=tt.constructor,ht=ut.precision;if(!tt.s||!et.s)return et.s||(et=new ut(tt)),external?round(et,ht):et;if(lt=tt.d,ct=et.d,at=tt.e,rt=et.e,lt=lt.slice(),ot=at-rt,ot){for(ot<0?(it=lt,ot=-ot,st=ct.length):(it=ct,rt=at,st=lt.length),at=Math.ceil(ht/LOG_BASE),st=at>st?at+1:st+1,ot>st&&(ot=st,it.length=1),it.reverse();ot--;)it.push(0);it.reverse()}for(st=lt.length,ot=ct.length,st-ot<0&&(ot=st,it=ct,ct=lt,lt=it),nt=0;ot;)nt=(lt[--ot]=lt[ot]+ct[ot]+nt)/BASE|0,lt[ot]%=BASE;for(nt&&(lt.unshift(nt),++rt),st=lt.length;lt[--st]==0;)lt.pop();return et.d=lt,et.e=rt,external?round(et,ht):et}function checkInt32(tt,et,nt){if(tt!==~~tt||ttnt)throw Error(invalidArgument+tt)}function digitsToString(tt){var et,nt,it,rt=tt.length-1,ot="",at=tt[0];if(rt>0){for(ot+=at,et=1;etat?1:-1;else for(st=lt=0;strt[st]?1:-1;break}return lt}function nt(it,rt,ot){for(var at=0;ot--;)it[ot]-=at,at=it[ot]1;)it.shift()}return function(it,rt,ot,at){var st,lt,ct,ut,ht,dt,pt,mt,gt,bt,yt,wt,vt,xt,St,Et,$t,It,Ft=it.constructor,Ht=it.s==rt.s?1:-1,zt=it.d,Ot=rt.d;if(!it.s)return new Ft(it);if(!rt.s)throw Error(decimalError+"Division by zero");for(lt=it.e-rt.e,$t=Ot.length,St=zt.length,pt=new Ft(Ht),mt=pt.d=[],ct=0;Ot[ct]==(zt[ct]||0);)++ct;if(Ot[ct]>(zt[ct]||0)&&--lt,ot==null?wt=ot=Ft.precision:at?wt=ot+(getBase10Exponent(it)-getBase10Exponent(rt))+1:wt=ot,wt<0)return new Ft(0);if(wt=wt/LOG_BASE+2|0,ct=0,$t==1)for(ut=0,Ot=Ot[0],wt++;(ct1&&(Ot=tt(Ot,ut),zt=tt(zt,ut),$t=Ot.length,St=zt.length),xt=$t,gt=zt.slice(0,$t),bt=gt.length;bt<$t;)gt[bt++]=0;It=Ot.slice(),It.unshift(0),Et=Ot[0],Ot[1]>=BASE/2&&++Et;do ut=0,st=et(Ot,gt,$t,bt),st<0?(yt=gt[0],$t!=bt&&(yt=yt*BASE+(gt[1]||0)),ut=yt/Et|0,ut>1?(ut>=BASE&&(ut=BASE-1),ht=tt(Ot,ut),dt=ht.length,bt=gt.length,st=et(ht,gt,dt,bt),st==1&&(ut--,nt(ht,$t16)throw Error(exponentOutOfRange+getBase10Exponent(tt));if(!tt.s)return new ut(ONE);for(et==null?(external=!1,st=ht):st=et,at=new ut(.03125);tt.abs().gte(.1);)tt=tt.times(at),ct+=5;for(it=Math.log(mathpow(2,ct))/Math.LN10*2+5|0,st+=it,nt=rt=ot=new ut(ONE),ut.precision=st;;){if(rt=round(rt.times(tt),st),nt=nt.times(++lt),at=ot.plus(divide(rt,nt,st)),digitsToString(at.d).slice(0,st)===digitsToString(ot.d).slice(0,st)){for(;ct--;)ot=round(ot.times(ot),st);return ut.precision=ht,et==null?(external=!0,round(ot,ht)):ot}ot=at}}function getBase10Exponent(tt){for(var et=tt.e*LOG_BASE,nt=tt.d[0];nt>=10;nt/=10)et++;return et}function getLn10(tt,et,nt){if(et>tt.LN10.sd())throw external=!0,nt&&(tt.precision=nt),Error(decimalError+"LN10 precision limit exceeded");return round(new tt(tt.LN10),et)}function getZeroString(tt){for(var et="";tt--;)et+="0";return et}function ln(tt,et){var nt,it,rt,ot,at,st,lt,ct,ut,ht=1,dt=10,pt=tt,mt=pt.d,gt=pt.constructor,bt=gt.precision;if(pt.s<1)throw Error(decimalError+(pt.s?"NaN":"-Infinity"));if(pt.eq(ONE))return new gt(0);if(et==null?(external=!1,ct=bt):ct=et,pt.eq(10))return et==null&&(external=!0),getLn10(gt,ct);if(ct+=dt,gt.precision=ct,nt=digitsToString(mt),it=nt.charAt(0),ot=getBase10Exponent(pt),Math.abs(ot)<15e14){for(;it<7&&it!=1||it==1&&nt.charAt(1)>3;)pt=pt.times(tt),nt=digitsToString(pt.d),it=nt.charAt(0),ht++;ot=getBase10Exponent(pt),it>1?(pt=new gt("0."+nt),ot++):pt=new gt(it+"."+nt.slice(1))}else return lt=getLn10(gt,ct+2,bt).times(ot+""),pt=ln(new gt(it+"."+nt.slice(1)),ct-dt).plus(lt),gt.precision=bt,et==null?(external=!0,round(pt,bt)):pt;for(st=at=pt=divide(pt.minus(ONE),pt.plus(ONE),ct),ut=round(pt.times(pt),ct),rt=3;;){if(at=round(at.times(ut),ct),lt=st.plus(divide(at,new gt(rt),ct)),digitsToString(lt.d).slice(0,ct)===digitsToString(st.d).slice(0,ct))return st=st.times(2),ot!==0&&(st=st.plus(getLn10(gt,ct+2,bt).times(ot+""))),st=divide(st,new gt(ht),ct),gt.precision=bt,et==null?(external=!0,round(st,bt)):st;st=lt,rt+=2}}function parseDecimal(tt,et){var nt,it,rt;for((nt=et.indexOf("."))>-1&&(et=et.replace(".","")),(it=et.search(/e/i))>0?(nt<0&&(nt=it),nt+=+et.slice(it+1),et=et.substring(0,it)):nt<0&&(nt=et.length),it=0;et.charCodeAt(it)===48;)++it;for(rt=et.length;et.charCodeAt(rt-1)===48;)--rt;if(et=et.slice(it,rt),et){if(rt-=it,nt=nt-it-1,tt.e=mathfloor(nt/LOG_BASE),tt.d=[],it=(nt+1)%LOG_BASE,nt<0&&(it+=LOG_BASE),itMAX_E||tt.e<-MAX_E))throw Error(exponentOutOfRange+nt)}else tt.s=0,tt.e=0,tt.d=[0];return tt}function round(tt,et,nt){var it,rt,ot,at,st,lt,ct,ut,ht=tt.d;for(at=1,ot=ht[0];ot>=10;ot/=10)at++;if(it=et-at,it<0)it+=LOG_BASE,rt=et,ct=ht[ut=0];else{if(ut=Math.ceil((it+1)/LOG_BASE),ot=ht.length,ut>=ot)return tt;for(ct=ot=ht[ut],at=1;ot>=10;ot/=10)at++;it%=LOG_BASE,rt=it-LOG_BASE+at}if(nt!==void 0&&(ot=mathpow(10,at-rt-1),st=ct/ot%10|0,lt=et<0||ht[ut+1]!==void 0||ct%ot,lt=nt<4?(st||lt)&&(nt==0||nt==(tt.s<0?3:2)):st>5||st==5&&(nt==4||lt||nt==6&&(it>0?rt>0?ct/mathpow(10,at-rt):0:ht[ut-1])%10&1||nt==(tt.s<0?8:7))),et<1||!ht[0])return lt?(ot=getBase10Exponent(tt),ht.length=1,et=et-ot-1,ht[0]=mathpow(10,(LOG_BASE-et%LOG_BASE)%LOG_BASE),tt.e=mathfloor(-et/LOG_BASE)||0):(ht.length=1,ht[0]=tt.e=tt.s=0),tt;if(it==0?(ht.length=ut,ot=1,ut--):(ht.length=ut+1,ot=mathpow(10,LOG_BASE-it),ht[ut]=rt>0?(ct/mathpow(10,at-rt)%mathpow(10,rt)|0)*ot:0),lt)for(;;)if(ut==0){(ht[0]+=ot)==BASE&&(ht[0]=1,++tt.e);break}else{if(ht[ut]+=ot,ht[ut]!=BASE)break;ht[ut--]=0,ot=1}for(it=ht.length;ht[--it]===0;)ht.pop();if(external&&(tt.e>MAX_E||tt.e<-MAX_E))throw Error(exponentOutOfRange+getBase10Exponent(tt));return tt}function subtract(tt,et){var nt,it,rt,ot,at,st,lt,ct,ut,ht,dt=tt.constructor,pt=dt.precision;if(!tt.s||!et.s)return et.s?et.s=-et.s:et=new dt(tt),external?round(et,pt):et;if(lt=tt.d,ht=et.d,it=et.e,ct=tt.e,lt=lt.slice(),at=ct-it,at){for(ut=at<0,ut?(nt=lt,at=-at,st=ht.length):(nt=ht,it=ct,st=lt.length),rt=Math.max(Math.ceil(pt/LOG_BASE),st)+2,at>rt&&(at=rt,nt.length=1),nt.reverse(),rt=at;rt--;)nt.push(0);nt.reverse()}else{for(rt=lt.length,st=ht.length,ut=rt0;--rt)lt[st++]=0;for(rt=ht.length;rt>at;){if(lt[--rt]0?ot=ot.charAt(0)+"."+ot.slice(1)+getZeroString(it):at>1&&(ot=ot.charAt(0)+"."+ot.slice(1)),ot=ot+(rt<0?"e":"e+")+rt):rt<0?(ot="0."+getZeroString(-rt-1)+ot,nt&&(it=nt-at)>0&&(ot+=getZeroString(it))):rt>=at?(ot+=getZeroString(rt+1-at),nt&&(it=nt-rt-1)>0&&(ot=ot+"."+getZeroString(it))):((it=rt+1)0&&(rt+1===at&&(ot+="."),ot+=getZeroString(it))),tt.s<0?"-"+ot:ot}function truncate(tt,et){if(tt.length>et)return tt.length=et,!0}function clone(tt){var et,nt,it;function rt(ot){var at=this;if(!(at instanceof rt))return new rt(ot);if(at.constructor=rt,ot instanceof rt){at.s=ot.s,at.e=ot.e,at.d=(ot=ot.d)?ot.slice():ot;return}if(typeof ot=="number"){if(ot*0!==0)throw Error(invalidArgument+ot);if(ot>0)at.s=1;else if(ot<0)ot=-ot,at.s=-1;else{at.s=0,at.e=0,at.d=[0];return}if(ot===~~ot&&ot<1e7){at.e=0,at.d=[ot];return}return parseDecimal(at,ot.toString())}else if(typeof ot!="string")throw Error(invalidArgument+ot);if(ot.charCodeAt(0)===45?(ot=ot.slice(1),at.s=-1):at.s=1,isDecimal.test(ot))parseDecimal(at,ot);else throw Error(invalidArgument+ot)}if(rt.prototype=P,rt.ROUND_UP=0,rt.ROUND_DOWN=1,rt.ROUND_CEIL=2,rt.ROUND_FLOOR=3,rt.ROUND_HALF_UP=4,rt.ROUND_HALF_DOWN=5,rt.ROUND_HALF_EVEN=6,rt.ROUND_HALF_CEIL=7,rt.ROUND_HALF_FLOOR=8,rt.clone=clone,rt.config=rt.set=config,tt===void 0&&(tt={}),tt)for(it=["precision","rounding","toExpNeg","toExpPos","LN10"],et=0;et=rt[et+1]&&it<=rt[et+2])this[nt]=it;else throw Error(invalidArgument+nt+": "+it);if((it=tt[nt="LN10"])!==void 0)if(it==Math.LN10)this[nt]=new this(it);else throw Error(invalidArgument+nt+": "+it);return this}var Decimal=clone(defaults);ONE=new Decimal(1);const Decimal$1=Decimal;function _toConsumableArray$7(tt){return _arrayWithoutHoles$7(tt)||_iterableToArray$7(tt)||_unsupportedIterableToArray$b(tt)||_nonIterableSpread$7()}function _nonIterableSpread$7(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$b(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$b(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$b(tt,et)}}function _iterableToArray$7(tt){if(typeof Symbol<"u"&&Symbol.iterator in Object(tt))return Array.from(tt)}function _arrayWithoutHoles$7(tt){if(Array.isArray(tt))return _arrayLikeToArray$b(tt)}function _arrayLikeToArray$b(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=et?nt.apply(void 0,rt):tt(et-at,curry0(function(){for(var st=arguments.length,lt=new Array(st),ct=0;cttt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt"u"||!(Symbol.iterator in Object(tt)))){var nt=[],it=!0,rt=!1,ot=void 0;try{for(var at=tt[Symbol.iterator](),st;!(it=(st=at.next()).done)&&(nt.push(st.value),!(et&&nt.length===et));it=!0);}catch(lt){rt=!0,ot=lt}finally{try{!it&&at.return!=null&&at.return()}finally{if(rt)throw ot}}return nt}}function _arrayWithHoles$5(tt){if(Array.isArray(tt))return tt}function getValidInterval(tt){var et=_slicedToArray$5(tt,2),nt=et[0],it=et[1],rt=nt,ot=it;return nt>it&&(rt=it,ot=nt),[rt,ot]}function getFormatStep(tt,et,nt){if(tt.lte(0))return new Decimal$1(0);var it=Arithmetic.getDigitCount(tt.toNumber()),rt=new Decimal$1(10).pow(it),ot=tt.div(rt),at=it!==1?.05:.1,st=new Decimal$1(Math.ceil(ot.div(at).toNumber())).add(nt).mul(at),lt=st.mul(rt);return et?lt:new Decimal$1(Math.ceil(lt))}function getTickOfSingleValue(tt,et,nt){var it=1,rt=new Decimal$1(tt);if(!rt.isint()&&nt){var ot=Math.abs(tt);ot<1?(it=new Decimal$1(10).pow(Arithmetic.getDigitCount(tt)-1),rt=new Decimal$1(Math.floor(rt.div(it).toNumber())).mul(it)):ot>1&&(rt=new Decimal$1(Math.floor(tt)))}else tt===0?rt=new Decimal$1(Math.floor((et-1)/2)):nt||(rt=new Decimal$1(Math.floor(tt)));var at=Math.floor((et-1)/2),st=compose(map(function(lt){return rt.add(new Decimal$1(lt-at).mul(it)).toNumber()}),range$2);return st(0,et)}function calculateStep(tt,et,nt,it){var rt=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((et-tt)/(nt-1)))return{step:new Decimal$1(0),tickMin:new Decimal$1(0),tickMax:new Decimal$1(0)};var ot=getFormatStep(new Decimal$1(et).sub(tt).div(nt-1),it,rt),at;tt<=0&&et>=0?at=new Decimal$1(0):(at=new Decimal$1(tt).add(et).div(2),at=at.sub(new Decimal$1(at).mod(ot)));var st=Math.ceil(at.sub(tt).div(ot).toNumber()),lt=Math.ceil(new Decimal$1(et).sub(at).div(ot).toNumber()),ct=st+lt+1;return ct>nt?calculateStep(tt,et,nt,it,rt+1):(ct0?lt+(nt-ct):lt,st=et>0?st:st+(nt-ct)),{step:ot,tickMin:at.sub(new Decimal$1(st).mul(ot)),tickMax:at.add(new Decimal$1(lt).mul(ot))})}function getNiceTickValuesFn(tt){var et=_slicedToArray$5(tt,2),nt=et[0],it=et[1],rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,at=Math.max(rt,2),st=getValidInterval([nt,it]),lt=_slicedToArray$5(st,2),ct=lt[0],ut=lt[1];if(ct===-1/0||ut===1/0){var ht=ut===1/0?[ct].concat(_toConsumableArray$6(range$2(0,rt-1).map(function(){return 1/0}))):[].concat(_toConsumableArray$6(range$2(0,rt-1).map(function(){return-1/0})),[ut]);return nt>it?reverse(ht):ht}if(ct===ut)return getTickOfSingleValue(ct,rt,ot);var dt=calculateStep(ct,ut,at,ot),pt=dt.step,mt=dt.tickMin,gt=dt.tickMax,bt=Arithmetic.rangeStep(mt,gt.add(new Decimal$1(.1).mul(pt)),pt);return nt>it?reverse(bt):bt}function getTickValuesFixedDomainFn(tt,et){var nt=_slicedToArray$5(tt,2),it=nt[0],rt=nt[1],ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,at=getValidInterval([it,rt]),st=_slicedToArray$5(at,2),lt=st[0],ct=st[1];if(lt===-1/0||ct===1/0)return[it,rt];if(lt===ct)return[lt];var ut=Math.max(et,2),ht=getFormatStep(new Decimal$1(ct).sub(lt).div(ut-1),ot,0),dt=[].concat(_toConsumableArray$6(Arithmetic.rangeStep(new Decimal$1(lt),new Decimal$1(ct).sub(new Decimal$1(.99).mul(ht)),ht)),[ct]);return it>rt?reverse(dt):dt}var getNiceTickValues=memoize(getNiceTickValuesFn),getTickValuesFixedDomain=memoize(getTickValuesFixedDomainFn),_excluded$b=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function _extends$k(){return _extends$k=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$b(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ErrorBar(tt){var et=tt.offset,nt=tt.layout,it=tt.width,rt=tt.dataKey,ot=tt.data,at=tt.dataPointFormatter,st=tt.xAxis,lt=tt.yAxis,ct=_objectWithoutProperties$b(tt,_excluded$b),ut=filterProps(ct),ht=ot.map(function(dt){var pt=at(dt,rt),mt=pt.x,gt=pt.y,bt=pt.value,yt=pt.errorVal;if(!yt)return null;var wt=[],vt,xt;if(Array.isArray(yt)){var St=_slicedToArray$4(yt,2);vt=St[0],xt=St[1]}else vt=xt=yt;if(nt==="vertical"){var Et=st.scale,$t=gt+et,It=$t+it,Ft=$t-it,Ht=Et(bt-vt),zt=Et(bt+xt);wt.push({x1:zt,y1:It,x2:zt,y2:Ft}),wt.push({x1:Ht,y1:$t,x2:zt,y2:$t}),wt.push({x1:Ht,y1:It,x2:Ht,y2:Ft})}else if(nt==="horizontal"){var Ot=lt.scale,jt=mt+et,kt=jt-it,Tt=jt+it,Ct=Ot(bt-vt),Ut=Ot(bt+xt);wt.push({x1:kt,y1:Ut,x2:Tt,y2:Ut}),wt.push({x1:jt,y1:Ct,x2:jt,y2:Ut}),wt.push({x1:kt,y1:Ct,x2:Tt,y2:Ct})}return React$1.createElement(Layer,_extends$k({className:"recharts-errorBar",key:"bar-".concat(wt.map(function(Nt){return"".concat(Nt.x1,"-").concat(Nt.x2,"-").concat(Nt.y1,"-").concat(Nt.y2)}))},ut),wt.map(function(Nt){return React$1.createElement("line",_extends$k({},Nt,{key:"line-".concat(Nt.x1,"-").concat(Nt.x2,"-").concat(Nt.y1,"-").concat(Nt.y2)}))}))});return React$1.createElement(Layer,{className:"recharts-errorBars"},ht)}ErrorBar.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};ErrorBar.displayName="ErrorBar";function _typeof$p(tt){"@babel/helpers - typeof";return _typeof$p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$p(tt)}function ownKeys$o(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$o(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt1&&arguments[1]!==void 0?arguments[1]:[],rt=arguments.length>2?arguments[2]:void 0,ot=arguments.length>3?arguments[3]:void 0,at=-1,st=(nt=it==null?void 0:it.length)!==null&&nt!==void 0?nt:0;if(st<=1)return 0;if(ot&&ot.axisType==="angleAxis"&&Math.abs(Math.abs(ot.range[1]-ot.range[0])-360)<=1e-6)for(var lt=ot.range,ct=0;ct0?rt[ct-1].coordinate:rt[st-1].coordinate,ht=rt[ct].coordinate,dt=ct>=st-1?rt[0].coordinate:rt[ct+1].coordinate,pt=void 0;if(mathSign(ht-ut)!==mathSign(dt-ht)){var mt=[];if(mathSign(dt-ht)===mathSign(lt[1]-lt[0])){pt=dt;var gt=ht+lt[1]-lt[0];mt[0]=Math.min(gt,(gt+ut)/2),mt[1]=Math.max(gt,(gt+ut)/2)}else{pt=ut;var bt=dt+lt[1]-lt[0];mt[0]=Math.min(ht,(bt+ht)/2),mt[1]=Math.max(ht,(bt+ht)/2)}var yt=[Math.min(ht,(pt+ht)/2),Math.max(ht,(pt+ht)/2)];if(et>yt[0]&&et<=yt[1]||et>=mt[0]&&et<=mt[1]){at=rt[ct].index;break}}else{var wt=Math.min(ut,dt),vt=Math.max(ut,dt);if(et>(wt+ht)/2&&et<=(vt+ht)/2){at=rt[ct].index;break}}}else for(var xt=0;xt0&&xt(it[xt].coordinate+it[xt-1].coordinate)/2&&et<=(it[xt].coordinate+it[xt+1].coordinate)/2||xt===st-1&&et>(it[xt].coordinate+it[xt-1].coordinate)/2){at=it[xt].index;break}return at},getMainColorOfGraphicItem=function tt(et){var nt=et,it=nt.type.displayName,rt=et.props,ot=rt.stroke,at=rt.fill,st;switch(it){case"Line":st=ot;break;case"Area":case"Radar":st=ot&&ot!=="none"?ot:at;break;default:st=at;break}return st},getBarSizeList=function tt(et){var nt=et.barSize,it=et.stackGroups,rt=it===void 0?{}:it;if(!rt)return{};for(var ot={},at=Object.keys(rt),st=0,lt=at.length;st=0});if(bt&&bt.length){var yt=bt[0].props.barSize,wt=bt[0].props[gt];ot[wt]||(ot[wt]=[]),ot[wt].push({item:bt[0],stackList:bt.slice(1),barSize:isNil$1(yt)?nt:yt})}}return ot},getBarPosition=function tt(et){var nt=et.barGap,it=et.barCategoryGap,rt=et.bandSize,ot=et.sizeList,at=ot===void 0?[]:ot,st=et.maxBarSize,lt=at.length;if(lt<1)return null;var ct=getPercentValue(nt,rt,0,!0),ut,ht=[];if(at[0].barSize===+at[0].barSize){var dt=!1,pt=rt/lt,mt=at.reduce(function(xt,St){return xt+St.barSize||0},0);mt+=(lt-1)*ct,mt>=rt&&(mt-=(lt-1)*ct,ct=0),mt>=rt&&pt>0&&(dt=!0,pt*=.9,mt=lt*pt);var gt=(rt-mt)/2>>0,bt={offset:gt-ct,size:0};ut=at.reduce(function(xt,St){var Et={item:St.item,position:{offset:bt.offset+bt.size+ct,size:dt?pt:St.barSize}},$t=[].concat(_toConsumableArray$5(xt),[Et]);return bt=$t[$t.length-1].position,St.stackList&&St.stackList.length&&St.stackList.forEach(function(It){$t.push({item:It,position:bt})}),$t},ht)}else{var yt=getPercentValue(it,rt,0,!0);rt-2*yt-(lt-1)*ct<=0&&(ct=0);var wt=(rt-2*yt-(lt-1)*ct)/lt;wt>1&&(wt>>=0);var vt=st===+st?Math.min(wt,st):wt;ut=at.reduce(function(xt,St,Et){var $t=[].concat(_toConsumableArray$5(xt),[{item:St.item,position:{offset:yt+(wt+ct)*Et+(wt-vt)/2,size:vt}}]);return St.stackList&&St.stackList.length&&St.stackList.forEach(function(It){$t.push({item:It,position:$t[$t.length-1].position})}),$t},ht)}return ut},appendOffsetOfLegend=function tt(et,nt,it,rt){var ot=it.children,at=it.width,st=it.margin,lt=at-(st.left||0)-(st.right||0),ct=getLegendProps({children:ot,legendWidth:lt});if(ct){var ut=rt||{},ht=ut.width,dt=ut.height,pt=ct.align,mt=ct.verticalAlign,gt=ct.layout;if((gt==="vertical"||gt==="horizontal"&&mt==="middle")&&pt!=="center"&&isNumber(et[pt]))return _objectSpread$n(_objectSpread$n({},et),{},_defineProperty$o({},pt,et[pt]+(ht||0)));if((gt==="horizontal"||gt==="vertical"&&pt==="center")&&mt!=="middle"&&isNumber(et[mt]))return _objectSpread$n(_objectSpread$n({},et),{},_defineProperty$o({},mt,et[mt]+(dt||0)))}return et},isErrorBarRelevantForAxis=function tt(et,nt,it){return isNil$1(nt)?!0:et==="horizontal"?nt==="yAxis":et==="vertical"||it==="x"?nt==="xAxis":it==="y"?nt==="yAxis":!0},getDomainOfErrorBars=function tt(et,nt,it,rt,ot){var at=nt.props.children,st=findAllByType(at,ErrorBar).filter(function(ct){return isErrorBarRelevantForAxis(rt,ot,ct.props.direction)});if(st&&st.length){var lt=st.map(function(ct){return ct.props.dataKey});return et.reduce(function(ct,ut){var ht=getValueByDataKey(ut,it,0),dt=Array.isArray(ht)?[min$1(ht),max$1(ht)]:[ht,ht],pt=lt.reduce(function(mt,gt){var bt=getValueByDataKey(ut,gt,0),yt=dt[0]-Math.abs(Array.isArray(bt)?bt[0]:bt),wt=dt[1]+Math.abs(Array.isArray(bt)?bt[1]:bt);return[Math.min(yt,mt[0]),Math.max(wt,mt[1])]},[1/0,-1/0]);return[Math.min(pt[0],ct[0]),Math.max(pt[1],ct[1])]},[1/0,-1/0])}return null},parseErrorBarsOfAxis=function tt(et,nt,it,rt,ot){var at=nt.map(function(st){return getDomainOfErrorBars(et,st,it,ot,rt)}).filter(function(st){return!isNil$1(st)});return at&&at.length?at.reduce(function(st,lt){return[Math.min(st[0],lt[0]),Math.max(st[1],lt[1])]},[1/0,-1/0]):null},getDomainOfItemsWithSameAxis=function tt(et,nt,it,rt,ot){var at=nt.map(function(lt){var ct=lt.props.dataKey;return it==="number"&&ct&&getDomainOfErrorBars(et,lt,ct,rt)||getDomainOfDataByKey(et,ct,it,ot)});if(it==="number")return at.reduce(function(lt,ct){return[Math.min(lt[0],ct[0]),Math.max(lt[1],ct[1])]},[1/0,-1/0]);var st={};return at.reduce(function(lt,ct){for(var ut=0,ht=ct.length;ut=2?mathSign(st[0]-st[1])*2*ct:ct,nt&&(et.ticks||et.niceTicks)){var ut=(et.ticks||et.niceTicks).map(function(ht){var dt=ot?ot.indexOf(ht):ht;return{coordinate:rt(dt)+ct,value:ht,offset:ct}});return ut.filter(function(ht){return!isNan(ht.coordinate)})}return et.isCategorical&&et.categoricalDomain?et.categoricalDomain.map(function(ht,dt){return{coordinate:rt(ht)+ct,value:ht,index:dt,offset:ct}}):rt.ticks&&!it?rt.ticks(et.tickCount).map(function(ht){return{coordinate:rt(ht)+ct,value:ht,offset:ct}}):rt.domain().map(function(ht,dt){return{coordinate:rt(ht)+ct,value:ot?ot[ht]:ht,index:dt,offset:ct}})},handlerWeakMap=new WeakMap,combineEventHandlers=function tt(et,nt){if(typeof nt!="function")return et;handlerWeakMap.has(et)||handlerWeakMap.set(et,new WeakMap);var it=handlerWeakMap.get(et);if(it.has(nt))return it.get(nt);var rt=function(){et.apply(void 0,arguments),nt.apply(void 0,arguments)};return it.set(nt,rt),rt},parseScale=function tt(et,nt,it){var rt=et.scale,ot=et.type,at=et.layout,st=et.axisType;if(rt==="auto")return at==="radial"&&st==="radiusAxis"?{scale:band(),realScaleType:"band"}:at==="radial"&&st==="angleAxis"?{scale:linear(),realScaleType:"linear"}:ot==="category"&&nt&&(nt.indexOf("LineChart")>=0||nt.indexOf("AreaChart")>=0||nt.indexOf("ComposedChart")>=0&&!it)?{scale:point$3(),realScaleType:"point"}:ot==="category"?{scale:band(),realScaleType:"band"}:{scale:linear(),realScaleType:"linear"};if(isString$1(rt)){var lt="scale".concat(upperFirst$1(rt));return{scale:(d3Scales[lt]||point$3)(),realScaleType:d3Scales[lt]?lt:"point"}}return isFunction$4(rt)?{scale:rt}:{scale:point$3(),realScaleType:"point"}},EPS=1e-4,checkDomainOfScale=function tt(et){var nt=et.domain();if(!(!nt||nt.length<=2)){var it=nt.length,rt=et.range(),ot=Math.min(rt[0],rt[1])-EPS,at=Math.max(rt[0],rt[1])+EPS,st=et(nt[0]),lt=et(nt[it-1]);(stat||ltat)&&et.domain([nt[0],nt[it-1]])}},findPositionOfBar=function tt(et,nt){if(!et)return null;for(var it=0,rt=et.length;itrt)&&(ot[1]=rt),ot[0]>rt&&(ot[0]=rt),ot[1]=0?(et[st][it][0]=ot,et[st][it][1]=ot+lt,ot=et[st][it][1]):(et[st][it][0]=at,et[st][it][1]=at+lt,at=et[st][it][1])}},offsetPositive=function tt(et){var nt=et.length;if(!(nt<=0))for(var it=0,rt=et[0].length;it=0?(et[at][it][0]=ot,et[at][it][1]=ot+st,ot=et[at][it][1]):(et[at][it][0]=0,et[at][it][1]=0)}},STACK_OFFSET_MAP={sign:offsetSign,expand:stackOffsetExpand,none:stackOffsetNone,silhouette:stackOffsetSilhouette,wiggle:stackOffsetWiggle,positive:offsetPositive},getStackedData=function tt(et,nt,it){var rt=nt.map(function(st){return st.props.dataKey}),ot=STACK_OFFSET_MAP[it],at=shapeStack().keys(rt).value(function(st,lt){return+getValueByDataKey(st,lt,0)}).order(stackOrderNone).offset(ot);return at(et)},getStackGroupsByAxisId=function tt(et,nt,it,rt,ot,at){if(!et)return null;var st=at?nt.reverse():nt,lt={},ct=st.reduce(function(ht,dt){var pt=dt.props,mt=pt.stackId,gt=pt.hide;if(gt)return ht;var bt=dt.props[it],yt=ht[bt]||{hasStack:!1,stackGroups:{}};if(isNumOrStr(mt)){var wt=yt.stackGroups[mt]||{numericAxisId:it,cateAxisId:rt,items:[]};wt.items.push(dt),yt.hasStack=!0,yt.stackGroups[mt]=wt}else yt.stackGroups[uniqueId("_stackId_")]={numericAxisId:it,cateAxisId:rt,items:[dt]};return _objectSpread$n(_objectSpread$n({},ht),{},_defineProperty$o({},bt,yt))},lt),ut={};return Object.keys(ct).reduce(function(ht,dt){var pt=ct[dt];if(pt.hasStack){var mt={};pt.stackGroups=Object.keys(pt.stackGroups).reduce(function(gt,bt){var yt=pt.stackGroups[bt];return _objectSpread$n(_objectSpread$n({},gt),{},_defineProperty$o({},bt,{numericAxisId:it,cateAxisId:rt,items:yt.items,stackedData:getStackedData(et,yt.items,ot)}))},mt)}return _objectSpread$n(_objectSpread$n({},ht),{},_defineProperty$o({},dt,pt))},ut)},getTicksOfScale=function tt(et,nt){var it=nt.realScaleType,rt=nt.type,ot=nt.tickCount,at=nt.originalDomain,st=nt.allowDecimals,lt=it||nt.scale;if(lt!=="auto"&<!=="linear")return null;if(ot&&rt==="number"&&at&&(at[0]==="auto"||at[1]==="auto")){var ct=et.domain();if(!ct.length)return null;var ut=getNiceTickValues(ct,ot,st);return et.domain([min$1(ut),max$1(ut)]),{niceTicks:ut}}if(ot&&rt==="number"){var ht=et.domain(),dt=getTickValuesFixedDomain(ht,ot,st);return{niceTicks:dt}}return null},getCateCoordinateOfLine=function tt(et){var nt=et.axis,it=et.ticks,rt=et.bandSize,ot=et.entry,at=et.index,st=et.dataKey;if(nt.type==="category"){if(!nt.allowDuplicatedCategory&&nt.dataKey&&!isNil$1(ot[nt.dataKey])){var lt=findEntryInArray(it,"value",ot[nt.dataKey]);if(lt)return lt.coordinate+rt/2}return it[at]?it[at].coordinate+rt/2:null}var ct=getValueByDataKey(ot,isNil$1(st)?nt.dataKey:st);return isNil$1(ct)?null:nt.scale(ct)},getCateCoordinateOfBar=function tt(et){var nt=et.axis,it=et.ticks,rt=et.offset,ot=et.bandSize,at=et.entry,st=et.index;if(nt.type==="category")return it[st]?it[st].coordinate+rt:null;var lt=getValueByDataKey(at,nt.dataKey,nt.domain[st]);return isNil$1(lt)?null:nt.scale(lt)-ot/2+rt},getBaseValueOfBar=function tt(et){var nt=et.numericAxis,it=nt.scale.domain();if(nt.type==="number"){var rt=Math.min(it[0],it[1]),ot=Math.max(it[0],it[1]);return rt<=0&&ot>=0?0:ot<0?ot:rt}return it[0]},getStackedDataOfItem=function tt(et,nt){var it=et.props.stackId;if(isNumOrStr(it)){var rt=nt[it];if(rt){var ot=rt.items.indexOf(et);return ot>=0?rt.stackedData[ot]:null}}return null},getDomainOfSingle=function tt(et){return et.reduce(function(nt,it){return[min$1(it.concat([nt[0]]).filter(isNumber)),max$1(it.concat([nt[1]]).filter(isNumber))]},[1/0,-1/0])},getDomainOfStackGroups=function tt(et,nt,it){return Object.keys(et).reduce(function(rt,ot){var at=et[ot],st=at.stackedData,lt=st.reduce(function(ct,ut){var ht=getDomainOfSingle(ut.slice(nt,it+1));return[Math.min(ct[0],ht[0]),Math.max(ct[1],ht[1])]},[1/0,-1/0]);return[Math.min(lt[0],rt[0]),Math.max(lt[1],rt[1])]},[1/0,-1/0]).map(function(rt){return rt===1/0||rt===-1/0?0:rt})},MIN_VALUE_REG=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,MAX_VALUE_REG=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,parseSpecifiedDomain=function tt(et,nt,it){if(isFunction$4(et))return et(nt,it);if(!Array.isArray(et))return nt;var rt=[];if(isNumber(et[0]))rt[0]=it?et[0]:Math.min(et[0],nt[0]);else if(MIN_VALUE_REG.test(et[0])){var ot=+MIN_VALUE_REG.exec(et[0])[1];rt[0]=nt[0]-ot}else isFunction$4(et[0])?rt[0]=et[0](nt[0]):rt[0]=nt[0];if(isNumber(et[1]))rt[1]=it?et[1]:Math.max(et[1],nt[1]);else if(MAX_VALUE_REG.test(et[1])){var at=+MAX_VALUE_REG.exec(et[1])[1];rt[1]=nt[1]+at}else isFunction$4(et[1])?rt[1]=et[1](nt[1]):rt[1]=nt[1];return rt},getBandSizeOfAxis=function tt(et,nt,it){if(et&&et.scale&&et.scale.bandwidth){var rt=et.scale.bandwidth();if(!it||rt>0)return rt}if(et&&nt&&nt.length>=2){for(var ot=sortBy$1(nt,function(ht){return ht.coordinate}),at=1/0,st=1,lt=ot.length;stat&&(ct=2*Math.PI-ct),{radius:st,angle:radianToDegree(ct),angleInRadian:ct}},formatAngleOfSector=function tt(et){var nt=et.startAngle,it=et.endAngle,rt=Math.floor(nt/360),ot=Math.floor(it/360),at=Math.min(rt,ot);return{startAngle:nt-at*360,endAngle:it-at*360}},reverseFormatAngleOfSetor=function tt(et,nt){var it=nt.startAngle,rt=nt.endAngle,ot=Math.floor(it/360),at=Math.floor(rt/360),st=Math.min(ot,at);return et+st*360},inRangeOfSector=function tt(et,nt){var it=et.x,rt=et.y,ot=getAngleOfPoint({x:it,y:rt},nt),at=ot.radius,st=ot.angle,lt=nt.innerRadius,ct=nt.outerRadius;if(atct)return!1;if(at===0)return!0;var ut=formatAngleOfSector(nt),ht=ut.startAngle,dt=ut.endAngle,pt=st,mt;if(ht<=dt){for(;pt>dt;)pt-=360;for(;pt=ht&&pt<=dt}else{for(;pt>ht;)pt-=360;for(;pt=dt&&pt<=ht}return mt?_objectSpread$m(_objectSpread$m({},nt),{},{radius:at,angle:reverseFormatAngleOfSetor(pt,nt)}):null};function _typeof$m(tt){"@babel/helpers - typeof";return _typeof$m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$m(tt)}var _excluded$a=["offset"];function _toConsumableArray$4(tt){return _arrayWithoutHoles$4(tt)||_iterableToArray$4(tt)||_unsupportedIterableToArray$7(tt)||_nonIterableSpread$4()}function _nonIterableSpread$4(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$7(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$7(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$7(tt,et)}}function _iterableToArray$4(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$4(tt){if(Array.isArray(tt))return _arrayLikeToArray$7(tt)}function _arrayLikeToArray$7(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$a(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ownKeys$l(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$l(tt){for(var et=1;et=0?1:-1,vt,xt;rt==="insideStart"?(vt=pt+wt*at,xt=gt):rt==="insideEnd"?(vt=mt-wt*at,xt=!gt):rt==="end"&&(vt=mt+wt*at,xt=gt),xt=yt<=0?xt:!xt;var St=polarToCartesian(ct,ut,bt,vt),Et=polarToCartesian(ct,ut,bt,vt+(xt?1:-1)*359),$t="M".concat(St.x,",").concat(St.y,` A`).concat(bt,",").concat(bt,",0,1,").concat(xt?0:1,`, - `).concat(Et.x,",").concat(Et.y),Tt=isNil$1(et.id)?uniqueId("recharts-radial-line-"):et.id;return React$1.createElement("text",_extends$k({},it,{dominantBaseline:"central",className:clsx("recharts-radial-bar-label",st)}),React$1.createElement("defs",null,React$1.createElement("path",{id:Tt,d:It})),React$1.createElement("textPath",{xlinkHref:"#".concat(Tt)},nt))},getAttrsOfPolarLabel=function tt(et){var nt=et.viewBox,it=et.offset,rt=et.position,ot=nt,at=ot.cx,st=ot.cy,lt=ot.innerRadius,ct=ot.outerRadius,ut=ot.startAngle,ht=ot.endAngle,dt=(ut+ht)/2;if(rt==="outside"){var pt=polarToCartesian(at,st,ct+it,dt),mt=pt.x,gt=pt.y;return{x:mt,y:gt,textAnchor:mt>=at?"start":"end",verticalAnchor:"middle"}}if(rt==="center")return{x:at,y:st,textAnchor:"middle",verticalAnchor:"middle"};if(rt==="centerTop")return{x:at,y:st,textAnchor:"middle",verticalAnchor:"start"};if(rt==="centerBottom")return{x:at,y:st,textAnchor:"middle",verticalAnchor:"end"};var bt=(lt+ct)/2,yt=polarToCartesian(at,st,bt,dt),wt=yt.x,vt=yt.y;return{x:wt,y:vt,textAnchor:"middle",verticalAnchor:"middle"}},getAttrsOfCartesianLabel=function tt(et){var nt=et.viewBox,it=et.parentViewBox,rt=et.offset,ot=et.position,at=nt,st=at.x,lt=at.y,ct=at.width,ut=at.height,ht=ut>=0?1:-1,dt=ht*rt,pt=ht>0?"end":"start",mt=ht>0?"start":"end",gt=ct>=0?1:-1,bt=gt*rt,yt=gt>0?"end":"start",wt=gt>0?"start":"end";if(ot==="top"){var vt={x:st+ct/2,y:lt-ht*rt,textAnchor:"middle",verticalAnchor:pt};return _objectSpread$m(_objectSpread$m({},vt),it?{height:Math.max(lt-it.y,0),width:ct}:{})}if(ot==="bottom"){var xt={x:st+ct/2,y:lt+ut+dt,textAnchor:"middle",verticalAnchor:mt};return _objectSpread$m(_objectSpread$m({},xt),it?{height:Math.max(it.y+it.height-(lt+ut),0),width:ct}:{})}if(ot==="left"){var St={x:st-bt,y:lt+ut/2,textAnchor:yt,verticalAnchor:"middle"};return _objectSpread$m(_objectSpread$m({},St),it?{width:Math.max(St.x-it.x,0),height:ut}:{})}if(ot==="right"){var Et={x:st+ct+bt,y:lt+ut/2,textAnchor:wt,verticalAnchor:"middle"};return _objectSpread$m(_objectSpread$m({},Et),it?{width:Math.max(it.x+it.width-Et.x,0),height:ut}:{})}var It=it?{width:ct,height:ut}:{};return ot==="insideLeft"?_objectSpread$m({x:st+bt,y:lt+ut/2,textAnchor:wt,verticalAnchor:"middle"},It):ot==="insideRight"?_objectSpread$m({x:st+ct-bt,y:lt+ut/2,textAnchor:yt,verticalAnchor:"middle"},It):ot==="insideTop"?_objectSpread$m({x:st+ct/2,y:lt+dt,textAnchor:"middle",verticalAnchor:mt},It):ot==="insideBottom"?_objectSpread$m({x:st+ct/2,y:lt+ut-dt,textAnchor:"middle",verticalAnchor:pt},It):ot==="insideTopLeft"?_objectSpread$m({x:st+bt,y:lt+dt,textAnchor:wt,verticalAnchor:mt},It):ot==="insideTopRight"?_objectSpread$m({x:st+ct-bt,y:lt+dt,textAnchor:yt,verticalAnchor:mt},It):ot==="insideBottomLeft"?_objectSpread$m({x:st+bt,y:lt+ut-dt,textAnchor:wt,verticalAnchor:pt},It):ot==="insideBottomRight"?_objectSpread$m({x:st+ct-bt,y:lt+ut-dt,textAnchor:yt,verticalAnchor:pt},It):isObject$h(ot)&&(isNumber(ot.x)||isPercent(ot.x))&&(isNumber(ot.y)||isPercent(ot.y))?_objectSpread$m({x:st+getPercentValue(ot.x,ct),y:lt+getPercentValue(ot.y,ut),textAnchor:"end",verticalAnchor:"end"},It):_objectSpread$m({x:st+ct/2,y:lt+ut/2,textAnchor:"middle",verticalAnchor:"middle"},It)},isPolar=function tt(et){return"cx"in et&&isNumber(et.cx)};function Label(tt){var et=tt.offset,nt=et===void 0?5:et,it=_objectWithoutProperties$a(tt,_excluded$a),rt=_objectSpread$m({offset:nt},it),ot=rt.viewBox,at=rt.position,st=rt.value,lt=rt.children,ct=rt.content,ut=rt.className,ht=ut===void 0?"":ut,dt=rt.textBreakAll;if(!ot||isNil$1(st)&&isNil$1(lt)&&!reactExports.isValidElement(ct)&&!isFunction$4(ct))return null;if(reactExports.isValidElement(ct))return reactExports.cloneElement(ct,rt);var pt;if(isFunction$4(ct)){if(pt=reactExports.createElement(ct,rt),reactExports.isValidElement(pt))return pt}else pt=getLabel(rt);var mt=isPolar(ot),gt=filterProps(rt,!0);if(mt&&(at==="insideStart"||at==="insideEnd"||at==="end"))return renderRadialLabel(rt,pt,gt);var bt=mt?getAttrsOfPolarLabel(rt):getAttrsOfCartesianLabel(rt);return React$1.createElement(Text$1,_extends$k({className:clsx("recharts-label",ht)},gt,bt,{breakAll:dt}),pt)}Label.displayName="Label";var parseViewBox=function tt(et){var nt=et.cx,it=et.cy,rt=et.angle,ot=et.startAngle,at=et.endAngle,st=et.r,lt=et.radius,ct=et.innerRadius,ut=et.outerRadius,ht=et.x,dt=et.y,pt=et.top,mt=et.left,gt=et.width,bt=et.height,yt=et.clockWise,wt=et.labelViewBox;if(wt)return wt;if(isNumber(gt)&&isNumber(bt)){if(isNumber(ht)&&isNumber(dt))return{x:ht,y:dt,width:gt,height:bt};if(isNumber(pt)&&isNumber(mt))return{x:pt,y:mt,width:gt,height:bt}}return isNumber(ht)&&isNumber(dt)?{x:ht,y:dt,width:0,height:0}:isNumber(nt)&&isNumber(it)?{cx:nt,cy:it,startAngle:ot||rt||0,endAngle:at||rt||0,innerRadius:ct||0,outerRadius:ut||lt||st||0,clockWise:yt}:et.viewBox?et.viewBox:{}},parseLabel=function tt(et,nt){return et?et===!0?React$1.createElement(Label,{key:"label-implicit",viewBox:nt}):isNumOrStr(et)?React$1.createElement(Label,{key:"label-implicit",viewBox:nt,value:et}):reactExports.isValidElement(et)?et.type===Label?reactExports.cloneElement(et,{key:"label-implicit",viewBox:nt}):React$1.createElement(Label,{key:"label-implicit",content:et,viewBox:nt}):isFunction$4(et)?React$1.createElement(Label,{key:"label-implicit",content:et,viewBox:nt}):isObject$h(et)?React$1.createElement(Label,_extends$k({viewBox:nt},et,{key:"label-implicit"})):null:null},renderCallByParent$1=function tt(et,nt){var it=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!et||!et.children&&it&&!et.label)return null;var rt=et.children,ot=parseViewBox(et),at=findAllByType(rt,Label).map(function(lt,ct){return reactExports.cloneElement(lt,{viewBox:nt||ot,key:"label-".concat(ct)})});if(!it)return at;var st=parseLabel(et.label,nt||ot);return[st].concat(_toConsumableArray$5(at))};Label.parseViewBox=parseViewBox;Label.renderCallByParent=renderCallByParent$1;function last(tt){var et=tt==null?0:tt.length;return et?tt[et-1]:void 0}var last_1=last;const last$1=getDefaultExportFromCjs(last_1);function _typeof$m(tt){"@babel/helpers - typeof";return _typeof$m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$m(tt)}var _excluded$9=["valueAccessor"],_excluded2$3=["data","dataKey","clockWise","id","textBreakAll"];function _toConsumableArray$4(tt){return _arrayWithoutHoles$4(tt)||_iterableToArray$4(tt)||_unsupportedIterableToArray$9(tt)||_nonIterableSpread$4()}function _nonIterableSpread$4(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$9(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$9(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$9(tt,et)}}function _iterableToArray$4(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$4(tt){if(Array.isArray(tt))return _arrayLikeToArray$9(tt)}function _arrayLikeToArray$9(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$9(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var defaultAccessor=function tt(et){return Array.isArray(et.value)?last$1(et.value):et.value};function LabelList(tt){var et=tt.valueAccessor,nt=et===void 0?defaultAccessor:et,it=_objectWithoutProperties$9(tt,_excluded$9),rt=it.data,ot=it.dataKey,at=it.clockWise,st=it.id,lt=it.textBreakAll,ct=_objectWithoutProperties$9(it,_excluded2$3);return!rt||!rt.length?null:React$1.createElement(Layer,{className:"recharts-label-list"},rt.map(function(ut,ht){var dt=isNil$1(ot)?nt(ut,ht):getValueByDataKey(ut&&ut.payload,ot),pt=isNil$1(st)?{}:{id:"".concat(st,"-").concat(ht)};return React$1.createElement(Label,_extends$j({},filterProps(ut,!0),ct,pt,{parentViewBox:ut.parentViewBox,value:dt,textBreakAll:lt,viewBox:Label.parseViewBox(isNil$1(at)?ut:_objectSpread$l(_objectSpread$l({},ut),{},{clockWise:at})),key:"label-".concat(ht),index:ht}))}))}LabelList.displayName="LabelList";function parseLabelList(tt,et){return tt?tt===!0?React$1.createElement(LabelList,{key:"labelList-implicit",data:et}):React$1.isValidElement(tt)||isFunction$4(tt)?React$1.createElement(LabelList,{key:"labelList-implicit",data:et,content:tt}):isObject$h(tt)?React$1.createElement(LabelList,_extends$j({data:et},tt,{key:"labelList-implicit"})):null:null}function renderCallByParent(tt,et){var nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!tt||!tt.children&&nt&&!tt.label)return null;var it=tt.children,rt=findAllByType(it,LabelList).map(function(at,st){return reactExports.cloneElement(at,{data:et,key:"labelList-".concat(st)})});if(!nt)return rt;var ot=parseLabelList(tt.label,et);return[ot].concat(_toConsumableArray$4(rt))}LabelList.renderCallByParent=renderCallByParent;function _typeof$l(tt){"@babel/helpers - typeof";return _typeof$l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$l(tt)}function _extends$i(){return _extends$i=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=at?"start":"end",verticalAnchor:"middle"}}if(rt==="center")return{x:at,y:st,textAnchor:"middle",verticalAnchor:"middle"};if(rt==="centerTop")return{x:at,y:st,textAnchor:"middle",verticalAnchor:"start"};if(rt==="centerBottom")return{x:at,y:st,textAnchor:"middle",verticalAnchor:"end"};var bt=(lt+ct)/2,yt=polarToCartesian(at,st,bt,dt),wt=yt.x,vt=yt.y;return{x:wt,y:vt,textAnchor:"middle",verticalAnchor:"middle"}},getAttrsOfCartesianLabel=function tt(et){var nt=et.viewBox,it=et.parentViewBox,rt=et.offset,ot=et.position,at=nt,st=at.x,lt=at.y,ct=at.width,ut=at.height,ht=ut>=0?1:-1,dt=ht*rt,pt=ht>0?"end":"start",mt=ht>0?"start":"end",gt=ct>=0?1:-1,bt=gt*rt,yt=gt>0?"end":"start",wt=gt>0?"start":"end";if(ot==="top"){var vt={x:st+ct/2,y:lt-ht*rt,textAnchor:"middle",verticalAnchor:pt};return _objectSpread$l(_objectSpread$l({},vt),it?{height:Math.max(lt-it.y,0),width:ct}:{})}if(ot==="bottom"){var xt={x:st+ct/2,y:lt+ut+dt,textAnchor:"middle",verticalAnchor:mt};return _objectSpread$l(_objectSpread$l({},xt),it?{height:Math.max(it.y+it.height-(lt+ut),0),width:ct}:{})}if(ot==="left"){var St={x:st-bt,y:lt+ut/2,textAnchor:yt,verticalAnchor:"middle"};return _objectSpread$l(_objectSpread$l({},St),it?{width:Math.max(St.x-it.x,0),height:ut}:{})}if(ot==="right"){var Et={x:st+ct+bt,y:lt+ut/2,textAnchor:wt,verticalAnchor:"middle"};return _objectSpread$l(_objectSpread$l({},Et),it?{width:Math.max(it.x+it.width-Et.x,0),height:ut}:{})}var $t=it?{width:ct,height:ut}:{};return ot==="insideLeft"?_objectSpread$l({x:st+bt,y:lt+ut/2,textAnchor:wt,verticalAnchor:"middle"},$t):ot==="insideRight"?_objectSpread$l({x:st+ct-bt,y:lt+ut/2,textAnchor:yt,verticalAnchor:"middle"},$t):ot==="insideTop"?_objectSpread$l({x:st+ct/2,y:lt+dt,textAnchor:"middle",verticalAnchor:mt},$t):ot==="insideBottom"?_objectSpread$l({x:st+ct/2,y:lt+ut-dt,textAnchor:"middle",verticalAnchor:pt},$t):ot==="insideTopLeft"?_objectSpread$l({x:st+bt,y:lt+dt,textAnchor:wt,verticalAnchor:mt},$t):ot==="insideTopRight"?_objectSpread$l({x:st+ct-bt,y:lt+dt,textAnchor:yt,verticalAnchor:mt},$t):ot==="insideBottomLeft"?_objectSpread$l({x:st+bt,y:lt+ut-dt,textAnchor:wt,verticalAnchor:pt},$t):ot==="insideBottomRight"?_objectSpread$l({x:st+ct-bt,y:lt+ut-dt,textAnchor:yt,verticalAnchor:pt},$t):isObject$h(ot)&&(isNumber(ot.x)||isPercent(ot.x))&&(isNumber(ot.y)||isPercent(ot.y))?_objectSpread$l({x:st+getPercentValue(ot.x,ct),y:lt+getPercentValue(ot.y,ut),textAnchor:"end",verticalAnchor:"end"},$t):_objectSpread$l({x:st+ct/2,y:lt+ut/2,textAnchor:"middle",verticalAnchor:"middle"},$t)},isPolar=function tt(et){return"cx"in et&&isNumber(et.cx)};function Label(tt){var et=tt.offset,nt=et===void 0?5:et,it=_objectWithoutProperties$a(tt,_excluded$a),rt=_objectSpread$l({offset:nt},it),ot=rt.viewBox,at=rt.position,st=rt.value,lt=rt.children,ct=rt.content,ut=rt.className,ht=ut===void 0?"":ut,dt=rt.textBreakAll;if(!ot||isNil$1(st)&&isNil$1(lt)&&!reactExports.isValidElement(ct)&&!isFunction$4(ct))return null;if(reactExports.isValidElement(ct))return reactExports.cloneElement(ct,rt);var pt;if(isFunction$4(ct)){if(pt=reactExports.createElement(ct,rt),reactExports.isValidElement(pt))return pt}else pt=getLabel(rt);var mt=isPolar(ot),gt=filterProps(rt,!0);if(mt&&(at==="insideStart"||at==="insideEnd"||at==="end"))return renderRadialLabel(rt,pt,gt);var bt=mt?getAttrsOfPolarLabel(rt):getAttrsOfCartesianLabel(rt);return React$1.createElement(Text$1,_extends$j({className:clsx("recharts-label",ht)},gt,bt,{breakAll:dt}),pt)}Label.displayName="Label";var parseViewBox=function tt(et){var nt=et.cx,it=et.cy,rt=et.angle,ot=et.startAngle,at=et.endAngle,st=et.r,lt=et.radius,ct=et.innerRadius,ut=et.outerRadius,ht=et.x,dt=et.y,pt=et.top,mt=et.left,gt=et.width,bt=et.height,yt=et.clockWise,wt=et.labelViewBox;if(wt)return wt;if(isNumber(gt)&&isNumber(bt)){if(isNumber(ht)&&isNumber(dt))return{x:ht,y:dt,width:gt,height:bt};if(isNumber(pt)&&isNumber(mt))return{x:pt,y:mt,width:gt,height:bt}}return isNumber(ht)&&isNumber(dt)?{x:ht,y:dt,width:0,height:0}:isNumber(nt)&&isNumber(it)?{cx:nt,cy:it,startAngle:ot||rt||0,endAngle:at||rt||0,innerRadius:ct||0,outerRadius:ut||lt||st||0,clockWise:yt}:et.viewBox?et.viewBox:{}},parseLabel=function tt(et,nt){return et?et===!0?React$1.createElement(Label,{key:"label-implicit",viewBox:nt}):isNumOrStr(et)?React$1.createElement(Label,{key:"label-implicit",viewBox:nt,value:et}):reactExports.isValidElement(et)?et.type===Label?reactExports.cloneElement(et,{key:"label-implicit",viewBox:nt}):React$1.createElement(Label,{key:"label-implicit",content:et,viewBox:nt}):isFunction$4(et)?React$1.createElement(Label,{key:"label-implicit",content:et,viewBox:nt}):isObject$h(et)?React$1.createElement(Label,_extends$j({viewBox:nt},et,{key:"label-implicit"})):null:null},renderCallByParent$1=function tt(et,nt){var it=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!et||!et.children&&it&&!et.label)return null;var rt=et.children,ot=parseViewBox(et),at=findAllByType(rt,Label).map(function(lt,ct){return reactExports.cloneElement(lt,{viewBox:nt||ot,key:"label-".concat(ct)})});if(!it)return at;var st=parseLabel(et.label,nt||ot);return[st].concat(_toConsumableArray$4(at))};Label.parseViewBox=parseViewBox;Label.renderCallByParent=renderCallByParent$1;function last(tt){var et=tt==null?0:tt.length;return et?tt[et-1]:void 0}var last_1=last;const last$1=getDefaultExportFromCjs(last_1);function _typeof$l(tt){"@babel/helpers - typeof";return _typeof$l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$l(tt)}var _excluded$9=["valueAccessor"],_excluded2$3=["data","dataKey","clockWise","id","textBreakAll"];function _toConsumableArray$3(tt){return _arrayWithoutHoles$3(tt)||_iterableToArray$3(tt)||_unsupportedIterableToArray$6(tt)||_nonIterableSpread$3()}function _nonIterableSpread$3(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$6(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$6(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$6(tt,et)}}function _iterableToArray$3(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$3(tt){if(Array.isArray(tt))return _arrayLikeToArray$6(tt)}function _arrayLikeToArray$6(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$9(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var defaultAccessor=function tt(et){return Array.isArray(et.value)?last$1(et.value):et.value};function LabelList(tt){var et=tt.valueAccessor,nt=et===void 0?defaultAccessor:et,it=_objectWithoutProperties$9(tt,_excluded$9),rt=it.data,ot=it.dataKey,at=it.clockWise,st=it.id,lt=it.textBreakAll,ct=_objectWithoutProperties$9(it,_excluded2$3);return!rt||!rt.length?null:React$1.createElement(Layer,{className:"recharts-label-list"},rt.map(function(ut,ht){var dt=isNil$1(ot)?nt(ut,ht):getValueByDataKey(ut&&ut.payload,ot),pt=isNil$1(st)?{}:{id:"".concat(st,"-").concat(ht)};return React$1.createElement(Label,_extends$i({},filterProps(ut,!0),ct,pt,{parentViewBox:ut.parentViewBox,value:dt,textBreakAll:lt,viewBox:Label.parseViewBox(isNil$1(at)?ut:_objectSpread$k(_objectSpread$k({},ut),{},{clockWise:at})),key:"label-".concat(ht),index:ht}))}))}LabelList.displayName="LabelList";function parseLabelList(tt,et){return tt?tt===!0?React$1.createElement(LabelList,{key:"labelList-implicit",data:et}):React$1.isValidElement(tt)||isFunction$4(tt)?React$1.createElement(LabelList,{key:"labelList-implicit",data:et,content:tt}):isObject$h(tt)?React$1.createElement(LabelList,_extends$i({data:et},tt,{key:"labelList-implicit"})):null:null}function renderCallByParent(tt,et){var nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!tt||!tt.children&&nt&&!tt.label)return null;var it=tt.children,rt=findAllByType(it,LabelList).map(function(at,st){return reactExports.cloneElement(at,{data:et,key:"labelList-".concat(st)})});if(!nt)return rt;var ot=parseLabelList(tt.label,et);return[ot].concat(_toConsumableArray$3(rt))}LabelList.renderCallByParent=renderCallByParent;function _typeof$k(tt){"@babel/helpers - typeof";return _typeof$k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$k(tt)}function _extends$h(){return _extends$h=Object.assign?Object.assign.bind():function(tt){for(var et=1;et180),",").concat(+(at>ct),`, `).concat(ht.x,",").concat(ht.y,` @@ -6464,11 +6464,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho A`).concat(at,",").concat(at,",0,0,").concat(+(ht<0),",").concat(pt.x,",").concat(pt.y,` A`).concat(ot,",").concat(ot,",0,").concat(+(xt>180),",").concat(+(ht<0),",").concat(yt.x,",").concat(yt.y,` A`).concat(at,",").concat(at,",0,0,").concat(+(ht<0),",").concat(wt.x,",").concat(wt.y,` - `);if(rt>0){var Et=getTangentCircle({cx:nt,cy:it,radius:rt,angle:ct,sign:ht,isExternal:!0,cornerRadius:at,cornerIsExternal:lt}),It=Et.circleTangency,Tt=Et.lineTangency,$t=Et.theta,Ut=getTangentCircle({cx:nt,cy:it,radius:rt,angle:ut,sign:-ht,isExternal:!0,cornerRadius:at,cornerIsExternal:lt}),Lt=Ut.circleTangency,Bt=Ut.lineTangency,Pt=Ut.theta,kt=lt?Math.abs(ct-ut):Math.abs(ct-ut)-$t-Pt;if(kt<0&&at===0)return"".concat(St,"L").concat(nt,",").concat(it,"Z");St+="L".concat(Bt.x,",").concat(Bt.y,` - A`).concat(at,",").concat(at,",0,0,").concat(+(ht<0),",").concat(Lt.x,",").concat(Lt.y,` - A`).concat(rt,",").concat(rt,",0,").concat(+(kt>180),",").concat(+(ht>0),",").concat(It.x,",").concat(It.y,` - A`).concat(at,",").concat(at,",0,0,").concat(+(ht<0),",").concat(Tt.x,",").concat(Tt.y,"Z")}else St+="L".concat(nt,",").concat(it,"Z");return St},defaultProps$3={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Sector=function tt(et){var nt=_objectSpread$k(_objectSpread$k({},defaultProps$3),et),it=nt.cx,rt=nt.cy,ot=nt.innerRadius,at=nt.outerRadius,st=nt.cornerRadius,lt=nt.forceCornerRadius,ct=nt.cornerIsExternal,ut=nt.startAngle,ht=nt.endAngle,dt=nt.className;if(at0&&Math.abs(ut-ht)<360?bt=getSectorWithCorner({cx:it,cy:rt,innerRadius:ot,outerRadius:at,cornerRadius:Math.min(gt,mt/2),forceCornerRadius:lt,cornerIsExternal:ct,startAngle:ut,endAngle:ht}):bt=getSectorPath({cx:it,cy:rt,innerRadius:ot,outerRadius:at,startAngle:ut,endAngle:ht}),React$1.createElement("path",_extends$i({},filterProps(nt,!0),{className:pt,d:bt,role:"img"}))};function _typeof$k(tt){"@babel/helpers - typeof";return _typeof$k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$k(tt)}function _extends$h(){return _extends$h=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0?1:-1,lt=it>=0?1:-1,ct=rt>=0&&it>=0||rt<0&&it<0?1:0,ut;if(at>0&&ot instanceof Array){for(var ht=[0,0,0,0],dt=0,pt=4;dtat?at:ot[dt];ut="M".concat(et,",").concat(nt+st*ht[0]),ht[0]>0&&(ut+="A ".concat(ht[0],",").concat(ht[0],",0,0,").concat(ct,",").concat(et+lt*ht[0],",").concat(nt)),ut+="L ".concat(et+it-lt*ht[1],",").concat(nt),ht[1]>0&&(ut+="A ".concat(ht[1],",").concat(ht[1],",0,0,").concat(ct,`, + `);if(rt>0){var Et=getTangentCircle({cx:nt,cy:it,radius:rt,angle:ct,sign:ht,isExternal:!0,cornerRadius:at,cornerIsExternal:lt}),$t=Et.circleTangency,It=Et.lineTangency,Ft=Et.theta,Ht=getTangentCircle({cx:nt,cy:it,radius:rt,angle:ut,sign:-ht,isExternal:!0,cornerRadius:at,cornerIsExternal:lt}),zt=Ht.circleTangency,Ot=Ht.lineTangency,jt=Ht.theta,kt=lt?Math.abs(ct-ut):Math.abs(ct-ut)-Ft-jt;if(kt<0&&at===0)return"".concat(St,"L").concat(nt,",").concat(it,"Z");St+="L".concat(Ot.x,",").concat(Ot.y,` + A`).concat(at,",").concat(at,",0,0,").concat(+(ht<0),",").concat(zt.x,",").concat(zt.y,` + A`).concat(rt,",").concat(rt,",0,").concat(+(kt>180),",").concat(+(ht>0),",").concat($t.x,",").concat($t.y,` + A`).concat(at,",").concat(at,",0,0,").concat(+(ht<0),",").concat(It.x,",").concat(It.y,"Z")}else St+="L".concat(nt,",").concat(it,"Z");return St},defaultProps$3={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Sector=function tt(et){var nt=_objectSpread$j(_objectSpread$j({},defaultProps$3),et),it=nt.cx,rt=nt.cy,ot=nt.innerRadius,at=nt.outerRadius,st=nt.cornerRadius,lt=nt.forceCornerRadius,ct=nt.cornerIsExternal,ut=nt.startAngle,ht=nt.endAngle,dt=nt.className;if(at0&&Math.abs(ut-ht)<360?bt=getSectorWithCorner({cx:it,cy:rt,innerRadius:ot,outerRadius:at,cornerRadius:Math.min(gt,mt/2),forceCornerRadius:lt,cornerIsExternal:ct,startAngle:ut,endAngle:ht}):bt=getSectorPath({cx:it,cy:rt,innerRadius:ot,outerRadius:at,startAngle:ut,endAngle:ht}),React$1.createElement("path",_extends$h({},filterProps(nt,!0),{className:pt,d:bt,role:"img"}))};function _typeof$j(tt){"@babel/helpers - typeof";return _typeof$j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$j(tt)}function _extends$g(){return _extends$g=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0?1:-1,lt=it>=0?1:-1,ct=rt>=0&&it>=0||rt<0&&it<0?1:0,ut;if(at>0&&ot instanceof Array){for(var ht=[0,0,0,0],dt=0,pt=4;dtat?at:ot[dt];ut="M".concat(et,",").concat(nt+st*ht[0]),ht[0]>0&&(ut+="A ".concat(ht[0],",").concat(ht[0],",0,0,").concat(ct,",").concat(et+lt*ht[0],",").concat(nt)),ut+="L ".concat(et+it-lt*ht[1],",").concat(nt),ht[1]>0&&(ut+="A ".concat(ht[1],",").concat(ht[1],",0,0,").concat(ct,`, `).concat(et+it,",").concat(nt+st*ht[1])),ut+="L ".concat(et+it,",").concat(nt+rt-st*ht[2]),ht[2]>0&&(ut+="A ".concat(ht[2],",").concat(ht[2],",0,0,").concat(ct,`, `).concat(et+it-lt*ht[2],",").concat(nt+rt)),ut+="L ".concat(et+lt*ht[3],",").concat(nt+rt),ht[3]>0&&(ut+="A ".concat(ht[3],",").concat(ht[3],",0,0,").concat(ct,`, `).concat(et,",").concat(nt+rt-st*ht[3])),ut+="Z"}else if(at>0&&ot===+ot&&ot>0){var mt=Math.min(at,ot);ut="M ".concat(et,",").concat(nt+st*mt,` @@ -6478,13 +6478,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(et+it,",").concat(nt+rt-st*mt,` A `).concat(mt,",").concat(mt,",0,0,").concat(ct,",").concat(et+it-lt*mt,",").concat(nt+rt,` L `).concat(et+lt*mt,",").concat(nt+rt,` - A `).concat(mt,",").concat(mt,",0,0,").concat(ct,",").concat(et,",").concat(nt+rt-st*mt," Z")}else ut="M ".concat(et,",").concat(nt," h ").concat(it," v ").concat(rt," h ").concat(-it," Z");return ut},isInRectangle=function tt(et,nt){if(!et||!nt)return!1;var it=et.x,rt=et.y,ot=nt.x,at=nt.y,st=nt.width,lt=nt.height;if(Math.abs(st)>0&&Math.abs(lt)>0){var ct=Math.min(ot,ot+st),ut=Math.max(ot,ot+st),ht=Math.min(at,at+lt),dt=Math.max(at,at+lt);return it>=ct&&it<=ut&&rt>=ht&&rt<=dt}return!1},defaultProps$2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Rectangle=function tt(et){var nt=_objectSpread$i(_objectSpread$i({},defaultProps$2),et),it=reactExports.useRef(),rt=reactExports.useState(-1),ot=_slicedToArray$4(rt,2),at=ot[0],st=ot[1];reactExports.useEffect(function(){if(it.current&&it.current.getTotalLength)try{var xt=it.current.getTotalLength();xt&&st(xt)}catch{}},[]);var lt=nt.x,ct=nt.y,ut=nt.width,ht=nt.height,dt=nt.radius,pt=nt.className,mt=nt.animationEasing,gt=nt.animationDuration,bt=nt.animationBegin,yt=nt.isAnimationActive,wt=nt.isUpdateAnimationActive;if(lt!==+lt||ct!==+ct||ut!==+ut||ht!==+ht||ut===0||ht===0)return null;var vt=clsx("recharts-rectangle",pt);return wt?React$1.createElement(Animate,{canBegin:at>0,from:{width:ut,height:ht,x:lt,y:ct},to:{width:ut,height:ht,x:lt,y:ct},duration:gt,animationEasing:mt,isActive:wt},function(xt){var St=xt.width,Et=xt.height,It=xt.x,Tt=xt.y;return React$1.createElement(Animate,{canBegin:at>0,from:"0px ".concat(at===-1?1:at,"px"),to:"".concat(at,"px 0px"),attributeName:"strokeDasharray",begin:bt,duration:gt,isActive:yt,easing:mt},React$1.createElement("path",_extends$g({},filterProps(nt,!0),{className:vt,d:getRectanglePath(It,Tt,St,Et,dt),ref:it})))}):React$1.createElement("path",_extends$g({},filterProps(nt,!0),{className:vt,d:getRectanglePath(lt,ct,ut,ht,dt)}))};function _extends$f(){return _extends$f=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$8(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var getPath=function tt(et,nt,it,rt,ot,at){return"M".concat(et,",").concat(ot,"v").concat(rt,"M").concat(at,",").concat(nt,"h").concat(it)},Cross=function tt(et){var nt=et.x,it=nt===void 0?0:nt,rt=et.y,ot=rt===void 0?0:rt,at=et.top,st=at===void 0?0:at,lt=et.left,ct=lt===void 0?0:lt,ut=et.width,ht=ut===void 0?0:ut,dt=et.height,pt=dt===void 0?0:dt,mt=et.className,gt=_objectWithoutProperties$8(et,_excluded$8),bt=_objectSpread$h({x:it,y:ot,top:st,left:ct,width:ht,height:pt},gt);return!isNumber(it)||!isNumber(ot)||!isNumber(ht)||!isNumber(pt)||!isNumber(st)||!isNumber(ct)?null:React$1.createElement("path",_extends$e({},filterProps(bt,!0),{className:clsx("recharts-cross",mt),d:getPath(it,ot,ht,pt,st,ct)}))},baseGetTag$1=_baseGetTag,getPrototype=_getPrototype,isObjectLike$1=isObjectLike_1,objectTag="[object Object]",funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$1=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject$2(tt){if(!isObjectLike$1(tt)||baseGetTag$1(tt)!=objectTag)return!1;var et=getPrototype(tt);if(et===null)return!0;var nt=hasOwnProperty$1.call(et,"constructor")&&et.constructor;return typeof nt=="function"&&nt instanceof nt&&funcToString.call(nt)==objectCtorString}var isPlainObject_1=isPlainObject$2;const isPlainObject$3=getDefaultExportFromCjs(isPlainObject_1);var baseGetTag=_baseGetTag,isObjectLike=isObjectLike_1,boolTag="[object Boolean]";function isBoolean(tt){return tt===!0||tt===!1||isObjectLike(tt)&&baseGetTag(tt)==boolTag}var isBoolean_1=isBoolean;const isBoolean$1=getDefaultExportFromCjs(isBoolean_1);function _typeof$h(tt){"@babel/helpers - typeof";return _typeof$h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$h(tt)}function _extends$d(){return _extends$d=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0,from:{upperWidth:0,lowerWidth:0,height:dt,x:lt,y:ct},to:{upperWidth:ut,lowerWidth:ht,height:dt,x:lt,y:ct},duration:gt,animationEasing:mt,isActive:yt},function(vt){var xt=vt.upperWidth,St=vt.lowerWidth,Et=vt.height,It=vt.x,Tt=vt.y;return React$1.createElement(Animate,{canBegin:at>0,from:"0px ".concat(at===-1?1:at,"px"),to:"".concat(at,"px 0px"),attributeName:"strokeDasharray",begin:bt,duration:gt,easing:mt},React$1.createElement("path",_extends$d({},filterProps(nt,!0),{className:wt,d:getTrapezoidPath(It,Tt,xt,St,Et),ref:it})))}):React$1.createElement("g",null,React$1.createElement("path",_extends$d({},filterProps(nt,!0),{className:wt,d:getTrapezoidPath(lt,ct,ut,ht,dt)})))},_excluded$7=["option","shapeType","propTransformer","activeClassName","isActive"];function _typeof$g(tt){"@babel/helpers - typeof";return _typeof$g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$g(tt)}function _objectWithoutProperties$7(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$7(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$7(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ownKeys$f(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$f(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$7(tt){return _getPrototypeOf$7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$7(tt)}function _defineProperty$e(tt,et,nt){return et=_toPropertyKey$d(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$d(tt){var et=_toPrimitive$d(tt,"string");return _typeof$e(et)==="symbol"?et:String(et)}function _toPrimitive$d(tt,et){if(_typeof$e(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$e(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var createScale=function tt(et){var nt=et.data,it=et.startIndex,rt=et.endIndex,ot=et.x,at=et.width,st=et.travellerWidth;if(!nt||!nt.length)return{};var lt=nt.length,ct=point$3().domain(range$1(0,lt)).range([ot,ot+at-st]),ut=ct.domain().map(function(ht){return ct(ht)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:ct(it),endX:ct(rt),scale:ct,scaleValues:ut}},isTouch=function tt(et){return et.changedTouches&&!!et.changedTouches.length},Brush=function(tt){_inherits$7(nt,tt);var et=_createSuper$7(nt);function nt(it){var rt;return _classCallCheck$9(this,nt),rt=et.call(this,it),_defineProperty$e(_assertThisInitialized$7(rt),"handleDrag",function(ot){rt.leaveTimer&&(clearTimeout(rt.leaveTimer),rt.leaveTimer=null),rt.state.isTravellerMoving?rt.handleTravellerMove(ot):rt.state.isSlideMoving&&rt.handleSlideDrag(ot)}),_defineProperty$e(_assertThisInitialized$7(rt),"handleTouchMove",function(ot){ot.changedTouches!=null&&ot.changedTouches.length>0&&rt.handleDrag(ot.changedTouches[0])}),_defineProperty$e(_assertThisInitialized$7(rt),"handleDragEnd",function(){rt.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var ot=rt.props,at=ot.endIndex,st=ot.onDragEnd,lt=ot.startIndex;st==null||st({endIndex:at,startIndex:lt})}),rt.detachDragEndListener()}),_defineProperty$e(_assertThisInitialized$7(rt),"handleLeaveWrapper",function(){(rt.state.isTravellerMoving||rt.state.isSlideMoving)&&(rt.leaveTimer=window.setTimeout(rt.handleDragEnd,rt.props.leaveTimeOut))}),_defineProperty$e(_assertThisInitialized$7(rt),"handleEnterSlideOrTraveller",function(){rt.setState({isTextActive:!0})}),_defineProperty$e(_assertThisInitialized$7(rt),"handleLeaveSlideOrTraveller",function(){rt.setState({isTextActive:!1})}),_defineProperty$e(_assertThisInitialized$7(rt),"handleSlideDragStart",function(ot){var at=isTouch(ot)?ot.changedTouches[0]:ot;rt.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:at.pageX}),rt.attachDragEndListener()}),rt.travellerDragStartHandlers={startX:rt.handleTravellerDragStart.bind(_assertThisInitialized$7(rt),"startX"),endX:rt.handleTravellerDragStart.bind(_assertThisInitialized$7(rt),"endX")},rt.state={},rt}return _createClass$9(nt,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(rt){var ot=rt.startX,at=rt.endX,st=this.state.scaleValues,lt=this.props,ct=lt.gap,ut=lt.data,ht=ut.length-1,dt=Math.min(ot,at),pt=Math.max(ot,at),mt=nt.getIndexInRange(st,dt),gt=nt.getIndexInRange(st,pt);return{startIndex:mt-mt%ct,endIndex:gt===ht?ht:gt-gt%ct}}},{key:"getTextOfTick",value:function(rt){var ot=this.props,at=ot.data,st=ot.tickFormatter,lt=ot.dataKey,ct=getValueByDataKey(at[rt],lt,rt);return isFunction$4(st)?st(ct,rt):ct}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(rt){var ot=this.state,at=ot.slideMoveStartX,st=ot.startX,lt=ot.endX,ct=this.props,ut=ct.x,ht=ct.width,dt=ct.travellerWidth,pt=ct.startIndex,mt=ct.endIndex,gt=ct.onChange,bt=rt.pageX-at;bt>0?bt=Math.min(bt,ut+ht-dt-lt,ut+ht-dt-st):bt<0&&(bt=Math.max(bt,ut-st,ut-lt));var yt=this.getIndex({startX:st+bt,endX:lt+bt});(yt.startIndex!==pt||yt.endIndex!==mt)&>&>(yt),this.setState({startX:st+bt,endX:lt+bt,slideMoveStartX:rt.pageX})}},{key:"handleTravellerDragStart",value:function(rt,ot){var at=isTouch(ot)?ot.changedTouches[0]:ot;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:rt,brushMoveStartX:at.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(rt){var ot,at=this.state,st=at.brushMoveStartX,lt=at.movingTravellerId,ct=at.endX,ut=at.startX,ht=this.state[lt],dt=this.props,pt=dt.x,mt=dt.width,gt=dt.travellerWidth,bt=dt.onChange,yt=dt.gap,wt=dt.data,vt={startX:this.state.startX,endX:this.state.endX},xt=rt.pageX-st;xt>0?xt=Math.min(xt,pt+mt-gt-ht):xt<0&&(xt=Math.max(xt,pt-ht)),vt[lt]=ht+xt;var St=this.getIndex(vt),Et=St.startIndex,It=St.endIndex,Tt=function(){var Ut=wt.length-1;return lt==="startX"&&(ct>ut?Et%yt===0:It%yt===0)||ctut?It%yt===0:Et%yt===0)||ct>ut&&It===Ut};this.setState((ot={},_defineProperty$e(ot,lt,ht+xt),_defineProperty$e(ot,"brushMoveStartX",rt.pageX),ot),function(){bt&&Tt()&&bt(St)})}},{key:"handleTravellerMoveKeyboard",value:function(rt,ot){var at=this,st=this.state,lt=st.scaleValues,ct=st.startX,ut=st.endX,ht=this.state[ot],dt=lt.indexOf(ht);if(dt!==-1){var pt=dt+rt;if(!(pt===-1||pt>=lt.length)){var mt=lt[pt];ot==="startX"&&mt>=ut||ot==="endX"&&mt<=ct||this.setState(_defineProperty$e({},ot,mt),function(){at.props.onChange(at.getIndex({startX:at.state.startX,endX:at.state.endX}))})}}}},{key:"renderBackground",value:function(){var rt=this.props,ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.fill,ut=rt.stroke;return React$1.createElement("rect",{stroke:ut,fill:ct,x:ot,y:at,width:st,height:lt})}},{key:"renderPanorama",value:function(){var rt=this.props,ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.data,ut=rt.children,ht=rt.padding,dt=reactExports.Children.only(ut);return dt?React$1.cloneElement(dt,{x:ot,y:at,width:st,height:lt,margin:ht,compact:!0,data:ct}):null}},{key:"renderTravellerLayer",value:function(rt,ot){var at=this,st=this.props,lt=st.y,ct=st.travellerWidth,ut=st.height,ht=st.traveller,dt=st.ariaLabel,pt=st.data,mt=st.startIndex,gt=st.endIndex,bt=Math.max(rt,this.props.x),yt=_objectSpread$d(_objectSpread$d({},filterProps(this.props)),{},{x:bt,y:lt,width:ct,height:ut}),wt=dt||"Min value: ".concat(pt[mt].name,", Max value: ").concat(pt[gt].name);return React$1.createElement(Layer,{tabIndex:0,role:"slider","aria-label":wt,"aria-valuenow":rt,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[ot],onTouchStart:this.travellerDragStartHandlers[ot],onKeyDown:function(xt){["ArrowLeft","ArrowRight"].includes(xt.key)&&(xt.preventDefault(),xt.stopPropagation(),at.handleTravellerMoveKeyboard(xt.key==="ArrowRight"?1:-1,ot))},onFocus:function(){at.setState({isTravellerFocused:!0})},onBlur:function(){at.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},nt.renderTraveller(ht,yt))}},{key:"renderSlide",value:function(rt,ot){var at=this.props,st=at.y,lt=at.height,ct=at.stroke,ut=at.travellerWidth,ht=Math.min(rt,ot)+ut,dt=Math.max(Math.abs(ot-rt)-ut,0);return React$1.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:ct,fillOpacity:.2,x:ht,y:st,width:dt,height:lt})}},{key:"renderText",value:function(){var rt=this.props,ot=rt.startIndex,at=rt.endIndex,st=rt.y,lt=rt.height,ct=rt.travellerWidth,ut=rt.stroke,ht=this.state,dt=ht.startX,pt=ht.endX,mt=5,gt={pointerEvents:"none",fill:ut};return React$1.createElement(Layer,{className:"recharts-brush-texts"},React$1.createElement(Text$1,_extends$c({textAnchor:"end",verticalAnchor:"middle",x:Math.min(dt,pt)-mt,y:st+lt/2},gt),this.getTextOfTick(ot)),React$1.createElement(Text$1,_extends$c({textAnchor:"start",verticalAnchor:"middle",x:Math.max(dt,pt)+ct+mt,y:st+lt/2},gt),this.getTextOfTick(at)))}},{key:"render",value:function(){var rt=this.props,ot=rt.data,at=rt.className,st=rt.children,lt=rt.x,ct=rt.y,ut=rt.width,ht=rt.height,dt=rt.alwaysShowText,pt=this.state,mt=pt.startX,gt=pt.endX,bt=pt.isTextActive,yt=pt.isSlideMoving,wt=pt.isTravellerMoving,vt=pt.isTravellerFocused;if(!ot||!ot.length||!isNumber(lt)||!isNumber(ct)||!isNumber(ut)||!isNumber(ht)||ut<=0||ht<=0)return null;var xt=clsx("recharts-brush",at),St=React$1.Children.count(st)===1,Et=generatePrefixStyle("userSelect","none");return React$1.createElement(Layer,{className:xt,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:Et},this.renderBackground(),St&&this.renderPanorama(),this.renderSlide(mt,gt),this.renderTravellerLayer(mt,"startX"),this.renderTravellerLayer(gt,"endX"),(bt||yt||wt||vt||dt)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(rt){var ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.stroke,ut=Math.floor(at+lt/2)-1;return React$1.createElement(React$1.Fragment,null,React$1.createElement("rect",{x:ot,y:at,width:st,height:lt,fill:ct,stroke:"none"}),React$1.createElement("line",{x1:ot+1,y1:ut,x2:ot+st-1,y2:ut,fill:"none",stroke:"#fff"}),React$1.createElement("line",{x1:ot+1,y1:ut+2,x2:ot+st-1,y2:ut+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(rt,ot){var at;return React$1.isValidElement(rt)?at=React$1.cloneElement(rt,ot):isFunction$4(rt)?at=rt(ot):at=nt.renderDefaultTraveller(ot),at}},{key:"getDerivedStateFromProps",value:function(rt,ot){var at=rt.data,st=rt.width,lt=rt.x,ct=rt.travellerWidth,ut=rt.updateId,ht=rt.startIndex,dt=rt.endIndex;if(at!==ot.prevData||ut!==ot.prevUpdateId)return _objectSpread$d({prevData:at,prevTravellerWidth:ct,prevUpdateId:ut,prevX:lt,prevWidth:st},at&&at.length?createScale({data:at,width:st,x:lt,travellerWidth:ct,startIndex:ht,endIndex:dt}):{scale:null,scaleValues:null});if(ot.scale&&(st!==ot.prevWidth||lt!==ot.prevX||ct!==ot.prevTravellerWidth)){ot.scale.range([lt,lt+st-ct]);var pt=ot.scale.domain().map(function(mt){return ot.scale(mt)});return{prevData:at,prevTravellerWidth:ct,prevUpdateId:ut,prevX:lt,prevWidth:st,startX:ot.scale(rt.startIndex),endX:ot.scale(rt.endIndex),scaleValues:pt}}return null}},{key:"getIndexInRange",value:function(rt,ot){for(var at=rt.length,st=0,lt=at-1;lt-st>1;){var ct=Math.floor((st+lt)/2);rt[ct]>ot?lt=ct:st=ct}return ot>=rt[lt]?lt:st}}]),nt}(reactExports.PureComponent);_defineProperty$e(Brush,"displayName","Brush");_defineProperty$e(Brush,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var baseEach$1=_baseEach;function baseSome$1(tt,et){var nt;return baseEach$1(tt,function(it,rt,ot){return nt=et(it,rt,ot),!nt}),!!nt}var _baseSome=baseSome$1,arraySome=_arraySome,baseIteratee$4=_baseIteratee,baseSome=_baseSome,isArray$2=isArray_1,isIterateeCall$1=_isIterateeCall;function some(tt,et,nt){var it=isArray$2(tt)?arraySome:baseSome;return nt&&isIterateeCall$1(tt,et,nt)&&(et=void 0),it(tt,baseIteratee$4(et))}var some_1=some;const some$1=getDefaultExportFromCjs(some_1);var ifOverflowMatches=function tt(et,nt){var it=et.alwaysShow,rt=et.ifOverflow;return it&&(rt="extendDomain"),rt===nt},baseAssignValue=_baseAssignValue,baseForOwn=_baseForOwn,baseIteratee$3=_baseIteratee;function mapValues(tt,et){var nt={};return et=baseIteratee$3(et),baseForOwn(tt,function(it,rt,ot){baseAssignValue(nt,rt,et(it,rt,ot))}),nt}var mapValues_1=mapValues;const mapValues$1=getDefaultExportFromCjs(mapValues_1);function arrayEvery$1(tt,et){for(var nt=-1,it=tt==null?0:tt.length;++nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$6(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function typeguardBarRectangleProps(tt,et){var nt=tt.x,it=tt.y,rt=_objectWithoutProperties$6(tt,_excluded$6),ot="".concat(nt),at=parseInt(ot,10),st="".concat(it),lt=parseInt(st,10),ct="".concat(et.height||rt.height),ut=parseInt(ct,10),ht="".concat(et.width||rt.width),dt=parseInt(ht,10);return _objectSpread$c(_objectSpread$c(_objectSpread$c(_objectSpread$c(_objectSpread$c({},et),rt),at?{x:at}:{}),lt?{y:lt}:{}),{},{height:ut,width:dt,name:et.name,radius:et.radius})}function BarRectangle(tt){return React$1.createElement(Shape,_extends$b({shapeType:"rectangle",propTransformer:typeguardBarRectangleProps,activeClassName:"recharts-active-bar"},tt))}var _excluded$5=["value","background"];function _typeof$c(tt){"@babel/helpers - typeof";return _typeof$c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$c(tt)}function _objectWithoutProperties$5(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$5(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$5(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _extends$a(){return _extends$a=Object.assign?Object.assign.bind():function(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$6(tt){return _getPrototypeOf$6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$6(tt)}function _defineProperty$c(tt,et,nt){return et=_toPropertyKey$b(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$b(tt){var et=_toPrimitive$b(tt,"string");return _typeof$c(et)==="symbol"?et:String(et)}function _toPrimitive$b(tt,et){if(_typeof$c(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$c(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var Bar=function(tt){_inherits$6(nt,tt);var et=_createSuper$6(nt);function nt(){var it;_classCallCheck$8(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;at0&&Math.abs(kt)0&&Math.abs(Pt)0&&(Pt=Math.min((Qt||0)-(kt[rn-1]||0),Pt))});var At=Pt/Bt,Rt=gt.layout==="vertical"?it.height:it.width;if(gt.padding==="gap"&&(It=At*Rt/2),gt.padding==="no-gap"){var Wt=getPercentValue(et.barCategoryGap,At*Rt),jt=At*Rt/2;It=jt-Wt-(jt-Wt)/Rt*Wt}}rt==="xAxis"?Tt=[it.left+(vt.left||0)+(It||0),it.left+it.width-(vt.right||0)-(It||0)]:rt==="yAxis"?Tt=lt==="horizontal"?[it.top+it.height-(vt.bottom||0),it.top+(vt.top||0)]:[it.top+(vt.top||0)+(It||0),it.top+it.height-(vt.bottom||0)-(It||0)]:Tt=gt.range,St&&(Tt=[Tt[1],Tt[0]]);var Ot=parseScale(gt,ot,dt),Ct=Ot.scale,Dt=Ot.realScaleType;Ct.domain(yt).range(Tt),checkDomainOfScale(Ct);var Mt=getTicksOfScale(Ct,_objectSpread$a(_objectSpread$a({},gt),{},{realScaleType:Dt}));rt==="xAxis"?(Lt=bt==="top"&&!xt||bt==="bottom"&&xt,$t=it.left,Ut=ht[Et]-Lt*gt.height):rt==="yAxis"&&(Lt=bt==="left"&&!xt||bt==="right"&&xt,$t=ht[Et]-Lt*gt.width,Ut=it.top);var Vt=_objectSpread$a(_objectSpread$a(_objectSpread$a({},gt),Mt),{},{realScaleType:Dt,x:$t,y:Ut,scale:Ct,width:rt==="xAxis"?it.width:gt.width,height:rt==="yAxis"?it.height:gt.height});return Vt.bandSize=getBandSizeOfAxis(Vt,Mt),!gt.hide&&rt==="xAxis"?ht[Et]+=(Lt?-1:1)*Vt.height:gt.hide||(ht[Et]+=(Lt?-1:1)*Vt.width),_objectSpread$a(_objectSpread$a({},pt),{},_defineProperty$b({},mt,Vt))},{})},rectWithPoints=function tt(et,nt){var it=et.x,rt=et.y,ot=nt.x,at=nt.y;return{x:Math.min(it,ot),y:Math.min(rt,at),width:Math.abs(ot-it),height:Math.abs(at-rt)}},rectWithCoords=function tt(et){var nt=et.x1,it=et.y1,rt=et.x2,ot=et.y2;return rectWithPoints({x:nt,y:it},{x:rt,y:ot})},ScaleHelper=function(){function tt(et){_classCallCheck$7(this,tt),this.scale=et}return _createClass$7(tt,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(nt){var it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=it.bandAware,ot=it.position;if(nt!==void 0){if(ot)switch(ot){case"start":return this.scale(nt);case"middle":{var at=this.bandwidth?this.bandwidth()/2:0;return this.scale(nt)+at}case"end":{var st=this.bandwidth?this.bandwidth():0;return this.scale(nt)+st}default:return this.scale(nt)}if(rt){var lt=this.bandwidth?this.bandwidth()/2:0;return this.scale(nt)+lt}return this.scale(nt)}}},{key:"isInRange",value:function(nt){var it=this.range(),rt=it[0],ot=it[it.length-1];return rt<=ot?nt>=rt&&nt<=ot:nt>=ot&&nt<=rt}}],[{key:"create",value:function(nt){return new tt(nt)}}]),tt}();_defineProperty$b(ScaleHelper,"EPS",1e-4);var createLabeledScales=function tt(et){var nt=Object.keys(et).reduce(function(it,rt){return _objectSpread$a(_objectSpread$a({},it),{},_defineProperty$b({},rt,ScaleHelper.create(et[rt])))},{});return _objectSpread$a(_objectSpread$a({},nt),{},{apply:function(rt){var ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},at=ot.bandAware,st=ot.position;return mapValues$1(rt,function(lt,ct){return nt[ct].apply(lt,{bandAware:at,position:st})})},isInRange:function(rt){return every$1(rt,function(ot,at){return nt[at].isInRange(ot)})}})};function normalizeAngle(tt){return(tt%180+180)%180}var getAngledRectangleWidth=function tt(et){var nt=et.width,it=et.height,rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ot=normalizeAngle(rt),at=ot*Math.PI/180,st=Math.atan(it/nt),lt=at>st&&attt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nttt*rt)return!1;var ot=nt();return tt*(et-tt*ot/2-it)>=0&&tt*(et+tt*ot/2-rt)<=0}function getNumberIntervalTicks(tt,et){return getEveryNthWithCondition(tt,et+1)}function getEquidistantTicks(tt,et,nt,it,rt){for(var ot=(it||[]).slice(),at=et.start,st=et.end,lt=0,ct=1,ut=at,ht=function(){var mt=it==null?void 0:it[lt];if(mt===void 0)return{v:getEveryNthWithCondition(it,ct)};var gt=lt,bt,yt=function(){return bt===void 0&&(bt=nt(mt,gt)),bt},wt=mt.coordinate,vt=lt===0||isVisible(tt,wt,yt,ut,st);vt||(lt=0,ut=at,ct+=1),vt&&(ut=wt+tt*(yt()/2+rt),lt+=ct)},dt;ct<=ot.length;)if(dt=ht(),dt)return dt.v;return[]}function _typeof$7(tt){"@babel/helpers - typeof";return _typeof$7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$7(tt)}function ownKeys$6(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$6(tt){for(var et=1;et0?pt.coordinate-bt*tt:pt.coordinate})}else ot[dt]=pt=_objectSpread$6(_objectSpread$6({},pt),{},{tickCoord:pt.coordinate});var yt=isVisible(tt,pt.tickCoord,gt,st,lt);yt&&(lt=pt.tickCoord-tt*(gt()/2+rt),ot[dt]=_objectSpread$6(_objectSpread$6({},pt),{},{isShow:!0}))},ut=at-1;ut>=0;ut--)ct(ut);return ot}function getTicksStart(tt,et,nt,it,rt,ot){var at=(it||[]).slice(),st=at.length,lt=et.start,ct=et.end;if(ot){var ut=it[st-1],ht=nt(ut,st-1),dt=tt*(ut.coordinate+tt*ht/2-ct);at[st-1]=ut=_objectSpread$6(_objectSpread$6({},ut),{},{tickCoord:dt>0?ut.coordinate-dt*tt:ut.coordinate});var pt=isVisible(tt,ut.tickCoord,function(){return ht},lt,ct);pt&&(ct=ut.tickCoord-tt*(ht/2+rt),at[st-1]=_objectSpread$6(_objectSpread$6({},ut),{},{isShow:!0}))}for(var mt=ot?st-1:st,gt=function(wt){var vt=at[wt],xt,St=function(){return xt===void 0&&(xt=nt(vt,wt)),xt};if(wt===0){var Et=tt*(vt.coordinate-tt*St()/2-lt);at[wt]=vt=_objectSpread$6(_objectSpread$6({},vt),{},{tickCoord:Et<0?vt.coordinate-Et*tt:vt.coordinate})}else at[wt]=vt=_objectSpread$6(_objectSpread$6({},vt),{},{tickCoord:vt.coordinate});var It=isVisible(tt,vt.tickCoord,St,lt,ct);It&&(lt=vt.tickCoord+tt*(St()/2+rt),at[wt]=_objectSpread$6(_objectSpread$6({},vt),{},{isShow:!0}))},bt=0;bt=2?mathSign(rt[1].coordinate-rt[0].coordinate):1,yt=getTickBoundaries(ot,bt,pt);return lt==="equidistantPreserveStart"?getEquidistantTicks(bt,yt,gt,rt,at):(lt==="preserveStart"||lt==="preserveStartEnd"?dt=getTicksStart(bt,yt,gt,rt,at,lt==="preserveStartEnd"):dt=getTicksEnd(bt,yt,gt,rt,at),dt.filter(function(wt){return wt.isShow}))}var _excluded$4=["viewBox"],_excluded2$2=["viewBox"],_excluded3=["ticks"];function _typeof$6(tt){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$6(tt)}function _extends$6(){return _extends$6=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$4(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _classCallCheck$6(tt,et){if(!(tt instanceof et))throw new TypeError("Cannot call a class as a function")}function _defineProperties$6(tt,et){for(var nt=0;nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$5(tt){return _getPrototypeOf$5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$5(tt)}function _defineProperty$6(tt,et,nt){return et=_toPropertyKey$5(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$5(tt){var et=_toPrimitive$5(tt,"string");return _typeof$6(et)==="symbol"?et:String(et)}function _toPrimitive$5(tt,et){if(_typeof$6(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$6(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var CartesianAxis=function(tt){_inherits$5(nt,tt);var et=_createSuper$5(nt);function nt(it){var rt;return _classCallCheck$6(this,nt),rt=et.call(this,it),rt.state={fontSize:"",letterSpacing:""},rt}return _createClass$6(nt,[{key:"shouldComponentUpdate",value:function(rt,ot){var at=rt.viewBox,st=_objectWithoutProperties$4(rt,_excluded$4),lt=this.props,ct=lt.viewBox,ut=_objectWithoutProperties$4(lt,_excluded2$2);return!shallowEqual(at,ct)||!shallowEqual(st,ut)||!shallowEqual(ot,this.state)}},{key:"componentDidMount",value:function(){var rt=this.layerReference;if(rt){var ot=rt.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];ot&&this.setState({fontSize:window.getComputedStyle(ot).fontSize,letterSpacing:window.getComputedStyle(ot).letterSpacing})}}},{key:"getTickLineCoord",value:function(rt){var ot=this.props,at=ot.x,st=ot.y,lt=ot.width,ct=ot.height,ut=ot.orientation,ht=ot.tickSize,dt=ot.mirror,pt=ot.tickMargin,mt,gt,bt,yt,wt,vt,xt=dt?-1:1,St=rt.tickSize||ht,Et=isNumber(rt.tickCoord)?rt.tickCoord:rt.coordinate;switch(ut){case"top":mt=gt=rt.coordinate,yt=st+ +!dt*ct,bt=yt-xt*St,vt=bt-xt*pt,wt=Et;break;case"left":bt=yt=rt.coordinate,gt=at+ +!dt*lt,mt=gt-xt*St,wt=mt-xt*pt,vt=Et;break;case"right":bt=yt=rt.coordinate,gt=at+ +dt*lt,mt=gt+xt*St,wt=mt+xt*pt,vt=Et;break;default:mt=gt=rt.coordinate,yt=st+ +dt*ct,bt=yt+xt*St,vt=bt+xt*pt,wt=Et;break}return{line:{x1:mt,y1:bt,x2:gt,y2:yt},tick:{x:wt,y:vt}}}},{key:"getTickTextAnchor",value:function(){var rt=this.props,ot=rt.orientation,at=rt.mirror,st;switch(ot){case"left":st=at?"start":"end";break;case"right":st=at?"end":"start";break;default:st="middle";break}return st}},{key:"getTickVerticalAnchor",value:function(){var rt=this.props,ot=rt.orientation,at=rt.mirror,st="end";switch(ot){case"left":case"right":st="middle";break;case"top":st=at?"start":"end";break;default:st=at?"end":"start";break}return st}},{key:"renderAxisLine",value:function(){var rt=this.props,ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.orientation,ut=rt.mirror,ht=rt.axisLine,dt=_objectSpread$5(_objectSpread$5(_objectSpread$5({},filterProps(this.props)),filterProps(ht)),{},{fill:"none"});if(ct==="top"||ct==="bottom"){var pt=+(ct==="top"&&!ut||ct==="bottom"&&ut);dt=_objectSpread$5(_objectSpread$5({},dt),{},{x1:ot,y1:at+pt*lt,x2:ot+st,y2:at+pt*lt})}else{var mt=+(ct==="left"&&!ut||ct==="right"&&ut);dt=_objectSpread$5(_objectSpread$5({},dt),{},{x1:ot+mt*st,y1:at,x2:ot+mt*st,y2:at+lt})}return React$1.createElement("line",_extends$6({},dt,{className:clsx("recharts-cartesian-axis-line",get$3(ht,"className"))}))}},{key:"renderTicks",value:function(rt,ot,at){var st=this,lt=this.props,ct=lt.tickLine,ut=lt.stroke,ht=lt.tick,dt=lt.tickFormatter,pt=lt.unit,mt=getTicks(_objectSpread$5(_objectSpread$5({},this.props),{},{ticks:rt}),ot,at),gt=this.getTickTextAnchor(),bt=this.getTickVerticalAnchor(),yt=filterProps(this.props),wt=filterProps(ht),vt=_objectSpread$5(_objectSpread$5({},yt),{},{fill:"none"},filterProps(ct)),xt=mt.map(function(St,Et){var It=st.getTickLineCoord(St),Tt=It.line,$t=It.tick,Ut=_objectSpread$5(_objectSpread$5(_objectSpread$5(_objectSpread$5({textAnchor:gt,verticalAnchor:bt},yt),{},{stroke:"none",fill:ut},wt),$t),{},{index:Et,payload:St,visibleTicksCount:mt.length,tickFormatter:dt});return React$1.createElement(Layer,_extends$6({className:"recharts-cartesian-axis-tick",key:"tick-".concat(St.value,"-").concat(St.coordinate,"-").concat(St.tickCoord)},adaptEventsOfChild(st.props,St,Et)),ct&&React$1.createElement("line",_extends$6({},vt,Tt,{className:clsx("recharts-cartesian-axis-tick-line",get$3(ct,"className"))})),ht&&nt.renderTickItem(ht,Ut,"".concat(isFunction$4(dt)?dt(St.value,Et):St.value).concat(pt||"")))});return React$1.createElement("g",{className:"recharts-cartesian-axis-ticks"},xt)}},{key:"render",value:function(){var rt=this,ot=this.props,at=ot.axisLine,st=ot.width,lt=ot.height,ct=ot.ticksGenerator,ut=ot.className,ht=ot.hide;if(ht)return null;var dt=this.props,pt=dt.ticks,mt=_objectWithoutProperties$4(dt,_excluded3),gt=pt;return isFunction$4(ct)&&(gt=pt&&pt.length>0?ct(this.props):ct(mt)),st<=0||lt<=0||!gt||!gt.length?null:React$1.createElement(Layer,{className:clsx("recharts-cartesian-axis",ut),ref:function(yt){rt.layerReference=yt}},at&&this.renderAxisLine(),this.renderTicks(gt,this.state.fontSize,this.state.letterSpacing),Label.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(rt,ot,at){var st;return React$1.isValidElement(rt)?st=React$1.cloneElement(rt,ot):isFunction$4(rt)?st=rt(ot):st=React$1.createElement(Text$1,_extends$6({},ot,{className:"recharts-cartesian-axis-tick-value"}),at),st}}]),nt}(reactExports.Component);_defineProperty$6(CartesianAxis,"displayName","CartesianAxis");_defineProperty$6(CartesianAxis,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var _excluded$3=["x1","y1","x2","y2","key"],_excluded2$1=["offset"];function _typeof$5(tt){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$5(tt)}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$3(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ownKeys$4(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$4(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$4(tt){return _getPrototypeOf$4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$4(tt)}function _defineProperty$5(tt,et,nt){return et=_toPropertyKey$4(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$4(tt){var et=_toPrimitive$4(tt,"string");return _typeof$5(et)==="symbol"?et:String(et)}function _toPrimitive$4(tt,et){if(_typeof$5(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$5(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var CartesianGrid=function(tt){_inherits$4(nt,tt);var et=_createSuper$4(nt);function nt(){return _classCallCheck$5(this,nt),et.apply(this,arguments)}return _createClass$5(nt,[{key:"renderHorizontal",value:function(rt){var ot=this,at=this.props,st=at.x,lt=at.width,ct=at.horizontal;if(!rt||!rt.length)return null;var ut=rt.map(function(ht,dt){var pt=_objectSpread$4(_objectSpread$4({},ot.props),{},{x1:st,y1:ht,x2:st+lt,y2:ht,key:"line-".concat(dt),index:dt});return nt.renderLineItem(ct,pt)});return React$1.createElement("g",{className:"recharts-cartesian-grid-horizontal"},ut)}},{key:"renderVertical",value:function(rt){var ot=this,at=this.props,st=at.y,lt=at.height,ct=at.vertical;if(!rt||!rt.length)return null;var ut=rt.map(function(ht,dt){var pt=_objectSpread$4(_objectSpread$4({},ot.props),{},{x1:ht,y1:st,x2:ht,y2:st+lt,key:"line-".concat(dt),index:dt});return nt.renderLineItem(ct,pt)});return React$1.createElement("g",{className:"recharts-cartesian-grid-vertical"},ut)}},{key:"renderVerticalStripes",value:function(rt){var ot=this.props.verticalFill;if(!ot||!ot.length)return null;var at=this.props,st=at.fillOpacity,lt=at.x,ct=at.y,ut=at.width,ht=at.height,dt=rt.map(function(mt){return Math.round(mt+lt-lt)}).sort(function(mt,gt){return mt-gt});lt!==dt[0]&&dt.unshift(0);var pt=dt.map(function(mt,gt){var bt=!dt[gt+1],yt=bt?lt+ut-mt:dt[gt+1]-mt;if(yt<=0)return null;var wt=gt%ot.length;return React$1.createElement("rect",{key:"react-".concat(gt),x:mt,y:ct,width:yt,height:ht,stroke:"none",fill:ot[wt],fillOpacity:st,className:"recharts-cartesian-grid-bg"})});return React$1.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},pt)}},{key:"renderHorizontalStripes",value:function(rt){var ot=this.props.horizontalFill;if(!ot||!ot.length)return null;var at=this.props,st=at.fillOpacity,lt=at.x,ct=at.y,ut=at.width,ht=at.height,dt=rt.map(function(mt){return Math.round(mt+ct-ct)}).sort(function(mt,gt){return mt-gt});ct!==dt[0]&&dt.unshift(0);var pt=dt.map(function(mt,gt){var bt=!dt[gt+1],yt=bt?ct+ht-mt:dt[gt+1]-mt;if(yt<=0)return null;var wt=gt%ot.length;return React$1.createElement("rect",{key:"react-".concat(gt),y:mt,x:lt,height:yt,width:ut,stroke:"none",fill:ot[wt],fillOpacity:st,className:"recharts-cartesian-grid-bg"})});return React$1.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},pt)}},{key:"renderBackground",value:function(){var rt=this.props.fill;if(!rt||rt==="none")return null;var ot=this.props,at=ot.fillOpacity,st=ot.x,lt=ot.y,ct=ot.width,ut=ot.height;return React$1.createElement("rect",{x:st,y:lt,width:ct,height:ut,stroke:"none",fill:rt,fillOpacity:at,className:"recharts-cartesian-grid-bg"})}},{key:"render",value:function(){var rt=this.props,ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.horizontal,ut=rt.vertical,ht=rt.horizontalCoordinatesGenerator,dt=rt.verticalCoordinatesGenerator,pt=rt.xAxis,mt=rt.yAxis,gt=rt.offset,bt=rt.chartWidth,yt=rt.chartHeight,wt=rt.syncWithTicks,vt=rt.horizontalValues,xt=rt.verticalValues;if(!isNumber(st)||st<=0||!isNumber(lt)||lt<=0||!isNumber(ot)||ot!==+ot||!isNumber(at)||at!==+at)return null;var St=this.props,Et=St.horizontalPoints,It=St.verticalPoints;if((!Et||!Et.length)&&isFunction$4(ht)){var Tt=vt&&vt.length;Et=ht({yAxis:mt?_objectSpread$4(_objectSpread$4({},mt),{},{ticks:Tt?vt:mt.ticks}):void 0,width:bt,height:yt,offset:gt},Tt?!0:wt)}if((!It||!It.length)&&isFunction$4(dt)){var $t=xt&&xt.length;It=dt({xAxis:pt?_objectSpread$4(_objectSpread$4({},pt),{},{ticks:$t?xt:pt.ticks}):void 0,width:bt,height:yt,offset:gt},$t?!0:wt)}return React$1.createElement("g",{className:"recharts-cartesian-grid"},this.renderBackground(),ct&&this.renderHorizontal(Et),ut&&this.renderVertical(It),ct&&this.renderHorizontalStripes(Et),ut&&this.renderVerticalStripes(It))}}],[{key:"renderLineItem",value:function(rt,ot){var at;if(React$1.isValidElement(rt))at=React$1.cloneElement(rt,ot);else if(isFunction$4(rt))at=rt(ot);else{var st=ot.x1,lt=ot.y1,ct=ot.x2,ut=ot.y2,ht=ot.key,dt=_objectWithoutProperties$3(ot,_excluded$3),pt=filterProps(dt);pt.offset;var mt=_objectWithoutProperties$3(pt,_excluded2$1);at=React$1.createElement("line",_extends$5({},mt,{x1:st,y1:lt,x2:ct,y2:ut,fill:"none",key:ht}))}return at}}]),nt}(reactExports.PureComponent);_defineProperty$5(CartesianGrid,"displayName","CartesianGrid");_defineProperty$5(CartesianGrid,"defaultProps",{horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]});var _excluded$2=["type","layout","connectNulls","ref"];function _typeof$4(tt){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$4(tt)}function _objectWithoutProperties$2(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$2(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$2(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$3(tt){return _getPrototypeOf$3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$3(tt)}function _defineProperty$4(tt,et,nt){return et=_toPropertyKey$3(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$3(tt){var et=_toPrimitive$3(tt,"string");return _typeof$4(et)==="symbol"?et:String(et)}function _toPrimitive$3(tt,et){if(_typeof$4(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$4(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var Line=function(tt){_inherits$3(nt,tt);var et=_createSuper$3(nt);function nt(){var it;_classCallCheck$4(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;atdt){mt=[].concat(_toConsumableArray$3(ct.slice(0,gt)),[dt-bt]);break}var yt=mt.length%2===0?[0,pt]:[pt];return[].concat(_toConsumableArray$3(nt.repeat(ct,ht)),_toConsumableArray$3(mt),yt).map(function(wt){return"".concat(wt,"px")}).join(", ")}),_defineProperty$4(_assertThisInitialized$3(it),"id",uniqueId("recharts-line-")),_defineProperty$4(_assertThisInitialized$3(it),"pathRef",function(st){it.mainCurve=st}),_defineProperty$4(_assertThisInitialized$3(it),"handleAnimationEnd",function(){it.setState({isAnimationFinished:!0}),it.props.onAnimationEnd&&it.props.onAnimationEnd()}),_defineProperty$4(_assertThisInitialized$3(it),"handleAnimationStart",function(){it.setState({isAnimationFinished:!1}),it.props.onAnimationStart&&it.props.onAnimationStart()}),it}return _createClass$4(nt,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var rt=this.getTotalLength();this.setState({totalLength:rt})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var rt=this.getTotalLength();rt!==this.state.totalLength&&this.setState({totalLength:rt})}}},{key:"getTotalLength",value:function(){var rt=this.mainCurve;try{return rt&&rt.getTotalLength&&rt.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(rt,ot){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var at=this.props,st=at.points,lt=at.xAxis,ct=at.yAxis,ut=at.layout,ht=at.children,dt=findAllByType(ht,ErrorBar);if(!dt)return null;var pt=function(bt,yt){return{x:bt.x,y:bt.y,value:bt.value,errorVal:getValueByDataKey(bt.payload,yt)}},mt={clipPath:rt?"url(#clipPath-".concat(ot,")"):null};return React$1.createElement(Layer,mt,dt.map(function(gt){return React$1.cloneElement(gt,{key:"bar-".concat(gt.props.dataKey),data:st,xAxis:lt,yAxis:ct,layout:ut,dataPointFormatter:pt})}))}},{key:"renderDots",value:function(rt,ot,at){var st=this.props.isAnimationActive;if(st&&!this.state.isAnimationFinished)return null;var lt=this.props,ct=lt.dot,ut=lt.points,ht=lt.dataKey,dt=filterProps(this.props),pt=filterProps(ct,!0),mt=ut.map(function(bt,yt){var wt=_objectSpread$3(_objectSpread$3(_objectSpread$3({key:"dot-".concat(yt),r:3},dt),pt),{},{value:bt.value,dataKey:ht,cx:bt.x,cy:bt.y,index:yt,payload:bt.payload});return nt.renderDotItem(ct,wt)}),gt={clipPath:rt?"url(#clipPath-".concat(ot?"":"dots-").concat(at,")"):null};return React$1.createElement(Layer,_extends$4({className:"recharts-line-dots",key:"dots"},gt),mt)}},{key:"renderCurveStatically",value:function(rt,ot,at,st){var lt=this.props,ct=lt.type,ut=lt.layout,ht=lt.connectNulls;lt.ref;var dt=_objectWithoutProperties$2(lt,_excluded$2),pt=_objectSpread$3(_objectSpread$3(_objectSpread$3({},filterProps(dt,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:ot?"url(#clipPath-".concat(at,")"):null,points:rt},st),{},{type:ct,layout:ut,connectNulls:ht});return React$1.createElement(Curve,_extends$4({},pt,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(rt,ot){var at=this,st=this.props,lt=st.points,ct=st.strokeDasharray,ut=st.isAnimationActive,ht=st.animationBegin,dt=st.animationDuration,pt=st.animationEasing,mt=st.animationId,gt=st.animateNewValues,bt=st.width,yt=st.height,wt=this.state,vt=wt.prevPoints,xt=wt.totalLength;return React$1.createElement(Animate,{begin:ht,duration:dt,isActive:ut,easing:pt,from:{t:0},to:{t:1},key:"line-".concat(mt),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(St){var Et=St.t;if(vt){var It=vt.length/lt.length,Tt=lt.map(function(Pt,kt){var At=Math.floor(kt*It);if(vt[At]){var Rt=vt[At],Wt=interpolateNumber$2(Rt.x,Pt.x),jt=interpolateNumber$2(Rt.y,Pt.y);return _objectSpread$3(_objectSpread$3({},Pt),{},{x:Wt(Et),y:jt(Et)})}if(gt){var Ot=interpolateNumber$2(bt*2,Pt.x),Ct=interpolateNumber$2(yt/2,Pt.y);return _objectSpread$3(_objectSpread$3({},Pt),{},{x:Ot(Et),y:Ct(Et)})}return _objectSpread$3(_objectSpread$3({},Pt),{},{x:Pt.x,y:Pt.y})});return at.renderCurveStatically(Tt,rt,ot)}var $t=interpolateNumber$2(0,xt),Ut=$t(Et),Lt;if(ct){var Bt="".concat(ct).split(/[,\s]+/gim).map(function(Pt){return parseFloat(Pt)});Lt=at.getStrokeDasharray(Ut,xt,Bt)}else Lt=at.generateSimpleStrokeDasharray(xt,Ut);return at.renderCurveStatically(lt,rt,ot,{strokeDasharray:Lt})})}},{key:"renderCurve",value:function(rt,ot){var at=this.props,st=at.points,lt=at.isAnimationActive,ct=this.state,ut=ct.prevPoints,ht=ct.totalLength;return lt&&st&&st.length&&(!ut&&ht>0||!isEqual$2(ut,st))?this.renderCurveWithAnimation(rt,ot):this.renderCurveStatically(st,rt,ot)}},{key:"render",value:function(){var rt,ot=this.props,at=ot.hide,st=ot.dot,lt=ot.points,ct=ot.className,ut=ot.xAxis,ht=ot.yAxis,dt=ot.top,pt=ot.left,mt=ot.width,gt=ot.height,bt=ot.isAnimationActive,yt=ot.id;if(at||!lt||!lt.length)return null;var wt=this.state.isAnimationFinished,vt=lt.length===1,xt=clsx("recharts-line",ct),St=ut&&ut.allowDataOverflow,Et=ht&&ht.allowDataOverflow,It=St||Et,Tt=isNil$1(yt)?this.id:yt,$t=(rt=filterProps(st))!==null&&rt!==void 0?rt:{r:3,strokeWidth:2},Ut=$t.r,Lt=Ut===void 0?3:Ut,Bt=$t.strokeWidth,Pt=Bt===void 0?2:Bt,kt=isDotProps(st)?st:{},At=kt.clipDot,Rt=At===void 0?!0:At,Wt=Lt*2+Pt;return React$1.createElement(Layer,{className:xt},St||Et?React$1.createElement("defs",null,React$1.createElement("clipPath",{id:"clipPath-".concat(Tt)},React$1.createElement("rect",{x:St?pt:pt-mt/2,y:Et?dt:dt-gt/2,width:St?mt:mt*2,height:Et?gt:gt*2})),!Rt&&React$1.createElement("clipPath",{id:"clipPath-dots-".concat(Tt)},React$1.createElement("rect",{x:pt-Wt/2,y:dt-Wt/2,width:mt+Wt,height:gt+Wt}))):null,!vt&&this.renderCurve(It,Tt),this.renderErrorBar(It,Tt),(vt||st)&&this.renderDots(It,Rt,Tt),(!bt||wt)&&LabelList.renderCallByParent(this.props,lt))}}],[{key:"getDerivedStateFromProps",value:function(rt,ot){return rt.animationId!==ot.prevAnimationId?{prevAnimationId:rt.animationId,curPoints:rt.points,prevPoints:ot.curPoints}:rt.points!==ot.curPoints?{curPoints:rt.points}:null}},{key:"repeat",value:function(rt,ot){for(var at=rt.length%2!==0?[].concat(_toConsumableArray$3(rt),[0]):rt,st=[],lt=0;lt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$1(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ScatterSymbol(tt){var et=tt.option,nt=tt.isActive,it=_objectWithoutProperties$1(tt,_excluded$1);return typeof et=="string"?React$1.createElement(Shape,_extends$3({option:React$1.createElement(Symbols,_extends$3({type:et},it)),isActive:nt,shapeType:"symbols"},it)):React$1.createElement(Shape,_extends$3({option:et,isActive:nt,shapeType:"symbols"},it))}function _typeof$3(tt){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$3(tt)}function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$2(tt){return _getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$2(tt)}function _defineProperty$3(tt,et,nt){return et=_toPropertyKey$2(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$2(tt){var et=_toPrimitive$2(tt,"string");return _typeof$3(et)==="symbol"?et:String(et)}function _toPrimitive$2(tt,et){if(_typeof$3(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$3(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var Scatter=function(tt){_inherits$2(nt,tt);var et=_createSuper$2(nt);function nt(){var it;_classCallCheck$3(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;at-1?rt[ot?et[at]:at]:void 0}}var _createFind=createFind$1,toFinite=toFinite_1;function toInteger$1(tt){var et=toFinite(tt),nt=et%1;return et===et?nt?et-nt:et:0}var toInteger_1=toInteger$1,baseFindIndex=_baseFindIndex,baseIteratee=_baseIteratee,toInteger=toInteger_1,nativeMax=Math.max;function findIndex$1(tt,et,nt){var it=tt==null?0:tt.length;if(!it)return-1;var rt=nt==null?0:toInteger(nt);return rt<0&&(rt=nativeMax(it+rt,0)),baseFindIndex(tt,baseIteratee(et),rt)}var findIndex_1=findIndex$1,createFind=_createFind,findIndex=findIndex_1,find$2=createFind(findIndex),find_1=find$2;const find$3=getDefaultExportFromCjs(find_1);var prefix="Invariant failed";function invariant(tt,et){if(!tt)throw new Error(prefix)}function getRadialCursorPoints(tt){var et=tt.cx,nt=tt.cy,it=tt.radius,rt=tt.startAngle,ot=tt.endAngle,at=polarToCartesian(et,nt,it,rt),st=polarToCartesian(et,nt,it,ot);return{points:[at,st],cx:et,cy:nt,radius:it,startAngle:rt,endAngle:ot}}function _toConsumableArray$2(tt){return _arrayWithoutHoles$2(tt)||_iterableToArray$2(tt)||_unsupportedIterableToArray$4(tt)||_nonIterableSpread$2()}function _nonIterableSpread$2(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$4(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$4(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$4(tt,et)}}function _iterableToArray$2(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$2(tt){if(Array.isArray(tt))return _arrayLikeToArray$4(tt)}function _arrayLikeToArray$4(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _classCallCheck$1(tt,et){if(!(tt instanceof et))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(tt,et){for(var nt=0;nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$1(tt){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$1(tt)}function _toConsumableArray$1(tt){return _arrayWithoutHoles$1(tt)||_iterableToArray$1(tt)||_unsupportedIterableToArray$3(tt)||_nonIterableSpread$1()}function _nonIterableSpread$1(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$3(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$3(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$3(tt,et)}}function _iterableToArray$1(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$1(tt){if(Array.isArray(tt))return _arrayLikeToArray$3(tt)}function _arrayLikeToArray$3(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0?at:et&&et.length&&isNumber(rt)&&isNumber(ot)?et.slice(rt,ot+1):[]};function getDefaultDomainByAxisType(tt){return tt==="number"?[0,"auto"]:void 0}var getTooltipContent=function tt(et,nt,it,rt){var ot=et.graphicalItems,at=et.tooltipAxis,st=getDisplayedData(nt,et);return it<0||!ot||!ot.length||it>=st.length?null:ot.reduce(function(lt,ct){var ut,ht=ct.props.hide;if(ht)return lt;var dt=(ut=ct.props.data)!==null&&ut!==void 0?ut:nt;dt&&et.dataStartIndex+et.dataEndIndex!==0&&(dt=dt.slice(et.dataStartIndex,et.dataEndIndex+1));var pt;if(at.dataKey&&!at.allowDuplicatedCategory){var mt=dt===void 0?st:dt;pt=findEntryInArray(mt,at.dataKey,rt)}else pt=dt&&dt[it]||st[it];return pt?[].concat(_toConsumableArray$1(lt),[getTooltipItem(ct,pt)]):lt},[])},getTooltipData=function tt(et,nt,it,rt){var ot=rt||{x:et.chartX,y:et.chartY},at=calculateTooltipPos(ot,it),st=et.orderedTooltipTicks,lt=et.tooltipAxis,ct=et.tooltipTicks,ut=calculateActiveTickIndex(at,st,ct,lt);if(ut>=0&&ct){var ht=ct[ut]&&ct[ut].value,dt=getTooltipContent(et,nt,ut,ht),pt=getActiveCoordinate(it,st,ut,ot);return{activeTooltipIndex:ut,activeLabel:ht,activePayload:dt,activeCoordinate:pt}}return null},getAxisMapByAxes=function tt(et,nt){var it=nt.axes,rt=nt.graphicalItems,ot=nt.axisType,at=nt.axisIdKey,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.layout,ht=et.children,dt=et.stackOffset,pt=isCategoricalAxis(ut,ot);return it.reduce(function(mt,gt){var bt,yt=gt.props,wt=yt.type,vt=yt.dataKey,xt=yt.allowDataOverflow,St=yt.allowDuplicatedCategory,Et=yt.scale,It=yt.ticks,Tt=yt.includeHidden,$t=gt.props[at];if(mt[$t])return mt;var Ut=getDisplayedData(et.data,{graphicalItems:rt.filter(function(Mt){return Mt.props[at]===$t}),dataStartIndex:lt,dataEndIndex:ct}),Lt=Ut.length,Bt,Pt,kt;isDomainSpecifiedByUser(gt.props.domain,xt,wt)&&(Bt=parseSpecifiedDomain(gt.props.domain,null,xt),pt&&(wt==="number"||Et!=="auto")&&(kt=getDomainOfDataByKey(Ut,vt,"category")));var At=getDefaultDomainByAxisType(wt);if(!Bt||Bt.length===0){var Rt,Wt=(Rt=gt.props.domain)!==null&&Rt!==void 0?Rt:At;if(vt){if(Bt=getDomainOfDataByKey(Ut,vt,wt),wt==="category"&&pt){var jt=hasDuplicate(Bt);St&&jt?(Pt=Bt,Bt=range$1(0,Lt)):St||(Bt=parseDomainOfCategoryAxis(Wt,Bt,gt).reduce(function(Mt,Vt){return Mt.indexOf(Vt)>=0?Mt:[].concat(_toConsumableArray$1(Mt),[Vt])},[]))}else if(wt==="category")St?Bt=Bt.filter(function(Mt){return Mt!==""&&!isNil$1(Mt)}):Bt=parseDomainOfCategoryAxis(Wt,Bt,gt).reduce(function(Mt,Vt){return Mt.indexOf(Vt)>=0||Vt===""||isNil$1(Vt)?Mt:[].concat(_toConsumableArray$1(Mt),[Vt])},[]);else if(wt==="number"){var Ot=parseErrorBarsOfAxis(Ut,rt.filter(function(Mt){return Mt.props[at]===$t&&(Tt||!Mt.props.hide)}),vt,ot,ut);Ot&&(Bt=Ot)}pt&&(wt==="number"||Et!=="auto")&&(kt=getDomainOfDataByKey(Ut,vt,"category"))}else pt?Bt=range$1(0,Lt):st&&st[$t]&&st[$t].hasStack&&wt==="number"?Bt=dt==="expand"?[0,1]:getDomainOfStackGroups(st[$t].stackGroups,lt,ct):Bt=getDomainOfItemsWithSameAxis(Ut,rt.filter(function(Mt){return Mt.props[at]===$t&&(Tt||!Mt.props.hide)}),wt,ut,!0);if(wt==="number")Bt=detectReferenceElementsDomain(ht,Bt,$t,ot,It),Wt&&(Bt=parseSpecifiedDomain(Wt,Bt,xt));else if(wt==="category"&&Wt){var Ct=Wt,Dt=Bt.every(function(Mt){return Ct.indexOf(Mt)>=0});Dt&&(Bt=Ct)}}return _objectSpread$1(_objectSpread$1({},mt),{},_defineProperty$1({},$t,_objectSpread$1(_objectSpread$1({},gt.props),{},{axisType:ot,domain:Bt,categoricalDomain:kt,duplicateDomain:Pt,originalDomain:(bt=gt.props.domain)!==null&&bt!==void 0?bt:At,isCategorical:pt,layout:ut})))},{})},getAxisMapByItems=function tt(et,nt){var it=nt.graphicalItems,rt=nt.Axis,ot=nt.axisType,at=nt.axisIdKey,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.layout,ht=et.children,dt=getDisplayedData(et.data,{graphicalItems:it,dataStartIndex:lt,dataEndIndex:ct}),pt=dt.length,mt=isCategoricalAxis(ut,ot),gt=-1;return it.reduce(function(bt,yt){var wt=yt.props[at],vt=getDefaultDomainByAxisType("number");if(!bt[wt]){gt++;var xt;return mt?xt=range$1(0,pt):st&&st[wt]&&st[wt].hasStack?(xt=getDomainOfStackGroups(st[wt].stackGroups,lt,ct),xt=detectReferenceElementsDomain(ht,xt,wt,ot)):(xt=parseSpecifiedDomain(vt,getDomainOfItemsWithSameAxis(dt,it.filter(function(St){return St.props[at]===wt&&!St.props.hide}),"number",ut),rt.defaultProps.allowDataOverflow),xt=detectReferenceElementsDomain(ht,xt,wt,ot)),_objectSpread$1(_objectSpread$1({},bt),{},_defineProperty$1({},wt,_objectSpread$1(_objectSpread$1({axisType:ot},rt.defaultProps),{},{hide:!0,orientation:get$3(ORIENT_MAP,"".concat(ot,".").concat(gt%2),null),domain:xt,originalDomain:vt,isCategorical:mt,layout:ut})))}return bt},{})},getAxisMap=function tt(et,nt){var it=nt.axisType,rt=it===void 0?"xAxis":it,ot=nt.AxisComp,at=nt.graphicalItems,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.children,ht="".concat(rt,"Id"),dt=findAllByType(ut,ot),pt={};return dt&&dt.length?pt=getAxisMapByAxes(et,{axes:dt,graphicalItems:at,axisType:rt,axisIdKey:ht,stackGroups:st,dataStartIndex:lt,dataEndIndex:ct}):at&&at.length&&(pt=getAxisMapByItems(et,{Axis:ot,graphicalItems:at,axisType:rt,axisIdKey:ht,stackGroups:st,dataStartIndex:lt,dataEndIndex:ct})),pt},tooltipTicksGenerator=function tt(et){var nt=getAnyElementOfObject(et),it=getTicksOfAxis(nt,!1,!0);return{tooltipTicks:it,orderedTooltipTicks:sortBy$1(it,function(rt){return rt.coordinate}),tooltipAxis:nt,tooltipAxisBandSize:getBandSizeOfAxis(nt,it)}},createDefaultState=function tt(et){var nt=et.children,it=et.defaultShowTooltip,rt=findChildByType(nt,Brush),ot=0,at=0;return et.data&&et.data.length!==0&&(at=et.data.length-1),rt&&rt.props&&(rt.props.startIndex>=0&&(ot=rt.props.startIndex),rt.props.endIndex>=0&&(at=rt.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:ot,dataEndIndex:at,activeTooltipIndex:-1,isTooltipActive:!!it}},hasGraphicalBarItem=function tt(et){return!et||!et.length?!1:et.some(function(nt){var it=getDisplayName(nt&&nt.type);return it&&it.indexOf("Bar")>=0})},getAxisNameByLayout=function tt(et){return et==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:et==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:et==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},calculateOffset=function tt(et,nt){var it=et.props,rt=et.graphicalItems,ot=et.xAxisMap,at=ot===void 0?{}:ot,st=et.yAxisMap,lt=st===void 0?{}:st,ct=it.width,ut=it.height,ht=it.children,dt=it.margin||{},pt=findChildByType(ht,Brush),mt=findChildByType(ht,Legend),gt=Object.keys(lt).reduce(function(St,Et){var It=lt[Et],Tt=It.orientation;return!It.mirror&&!It.hide?_objectSpread$1(_objectSpread$1({},St),{},_defineProperty$1({},Tt,St[Tt]+It.width)):St},{left:dt.left||0,right:dt.right||0}),bt=Object.keys(at).reduce(function(St,Et){var It=at[Et],Tt=It.orientation;return!It.mirror&&!It.hide?_objectSpread$1(_objectSpread$1({},St),{},_defineProperty$1({},Tt,get$3(St,"".concat(Tt))+It.height)):St},{top:dt.top||0,bottom:dt.bottom||0}),yt=_objectSpread$1(_objectSpread$1({},bt),gt),wt=yt.bottom;pt&&(yt.bottom+=pt.props.height||Brush.defaultProps.height),mt&&nt&&(yt=appendOffsetOfLegend(yt,rt,it,nt));var vt=ct-yt.left-yt.right,xt=ut-yt.top-yt.bottom;return _objectSpread$1(_objectSpread$1({brushBottom:wt},yt),{},{width:Math.max(vt,0),height:Math.max(xt,0)})},generateCategoricalChart=function tt(et){var nt,it=et.chartName,rt=et.GraphicalChild,ot=et.defaultTooltipEventType,at=ot===void 0?"axis":ot,st=et.validateTooltipEventTypes,lt=st===void 0?["axis"]:st,ct=et.axisComponents,ut=et.legendContent,ht=et.formatAxisMap,dt=et.defaultProps,pt=function(bt,yt){var wt=yt.graphicalItems,vt=yt.stackGroups,xt=yt.offset,St=yt.updateId,Et=yt.dataStartIndex,It=yt.dataEndIndex,Tt=bt.barSize,$t=bt.layout,Ut=bt.barGap,Lt=bt.barCategoryGap,Bt=bt.maxBarSize,Pt=getAxisNameByLayout($t),kt=Pt.numericAxisName,At=Pt.cateAxisName,Rt=hasGraphicalBarItem(wt),Wt=Rt&&getBarSizeList({barSize:Tt,stackGroups:vt}),jt=[];return wt.forEach(function(Ot,Ct){var Dt=getDisplayedData(bt.data,{graphicalItems:[Ot],dataStartIndex:Et,dataEndIndex:It}),Mt=Ot.props,Vt=Mt.dataKey,Qt=Mt.maxBarSize,rn=Ot.props["".concat(kt,"Id")],Xt=Ot.props["".concat(At,"Id")],an={},tn=ct.reduce(function(In,xn){var dn,cn=yt["".concat(xn.axisType,"Map")],hn=Ot.props["".concat(xn.axisType,"Id")];cn&&cn[hn]||xn.axisType==="zAxis"||invariant(!1);var $n=cn[hn];return _objectSpread$1(_objectSpread$1({},In),{},(dn={},_defineProperty$1(dn,xn.axisType,$n),_defineProperty$1(dn,"".concat(xn.axisType,"Ticks"),getTicksOfAxis($n)),dn))},an),pn=tn[At],vn=tn["".concat(At,"Ticks")],sn=vt&&vt[rn]&&vt[rn].hasStack&&getStackedDataOfItem(Ot,vt[rn].stackGroups),Zt=getDisplayName(Ot.type).indexOf("Bar")>=0,Sn=getBandSizeOfAxis(pn,vn),Tn=[];if(Zt){var Cn,jn,Un=isNil$1(Qt)?Bt:Qt,yn=(Cn=(jn=getBandSizeOfAxis(pn,vn,!0))!==null&&jn!==void 0?jn:Un)!==null&&Cn!==void 0?Cn:0;Tn=getBarPosition({barGap:Ut,barCategoryGap:Lt,bandSize:yn!==Sn?yn:Sn,sizeList:Wt[Xt],maxBarSize:Un}),yn!==Sn&&(Tn=Tn.map(function(In){return _objectSpread$1(_objectSpread$1({},In),{},{position:_objectSpread$1(_objectSpread$1({},In.position),{},{offset:In.position.offset-yn/2})})}))}var un=Ot&&Ot.type&&Ot.type.getComposedData;if(un){var En;jt.push({props:_objectSpread$1(_objectSpread$1({},un(_objectSpread$1(_objectSpread$1({},tn),{},{displayedData:Dt,props:bt,dataKey:Vt,item:Ot,bandSize:Sn,barPosition:Tn,offset:xt,stackedData:sn,layout:$t,dataStartIndex:Et,dataEndIndex:It}))),{},(En={key:Ot.key||"item-".concat(Ct)},_defineProperty$1(En,kt,tn[kt]),_defineProperty$1(En,At,tn[At]),_defineProperty$1(En,"animationId",St),En)),childIndex:parseChildIndex(Ot,bt.children),item:Ot})}}),jt},mt=function(bt,yt){var wt=bt.props,vt=bt.dataStartIndex,xt=bt.dataEndIndex,St=bt.updateId;if(!validateWidthHeight({props:wt}))return null;var Et=wt.children,It=wt.layout,Tt=wt.stackOffset,$t=wt.data,Ut=wt.reverseStackOrder,Lt=getAxisNameByLayout(It),Bt=Lt.numericAxisName,Pt=Lt.cateAxisName,kt=findAllByType(Et,rt),At=getStackGroupsByAxisId($t,kt,"".concat(Bt,"Id"),"".concat(Pt,"Id"),Tt,Ut),Rt=ct.reduce(function(Dt,Mt){var Vt="".concat(Mt.axisType,"Map");return _objectSpread$1(_objectSpread$1({},Dt),{},_defineProperty$1({},Vt,getAxisMap(wt,_objectSpread$1(_objectSpread$1({},Mt),{},{graphicalItems:kt,stackGroups:Mt.axisType===Bt&&At,dataStartIndex:vt,dataEndIndex:xt}))))},{}),Wt=calculateOffset(_objectSpread$1(_objectSpread$1({},Rt),{},{props:wt,graphicalItems:kt}),yt==null?void 0:yt.legendBBox);Object.keys(Rt).forEach(function(Dt){Rt[Dt]=ht(wt,Rt[Dt],Wt,Dt.replace("Map",""),it)});var jt=Rt["".concat(Pt,"Map")],Ot=tooltipTicksGenerator(jt),Ct=pt(wt,_objectSpread$1(_objectSpread$1({},Rt),{},{dataStartIndex:vt,dataEndIndex:xt,updateId:St,graphicalItems:kt,stackGroups:At,offset:Wt}));return _objectSpread$1(_objectSpread$1({formattedGraphicalItems:Ct,graphicalItems:kt,offset:Wt,stackGroups:At},Ot),Rt)};return nt=function(gt){_inherits$1(yt,gt);var bt=_createSuper$1(yt);function yt(wt){var vt,xt,St;return _classCallCheck$1(this,yt),St=bt.call(this,wt),_defineProperty$1(_assertThisInitialized$1(St),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_defineProperty$1(_assertThisInitialized$1(St),"accessibilityManager",new AccessibilityManager),_defineProperty$1(_assertThisInitialized$1(St),"handleLegendBBoxUpdate",function(Et){if(Et){var It=St.state,Tt=It.dataStartIndex,$t=It.dataEndIndex,Ut=It.updateId;St.setState(_objectSpread$1({legendBBox:Et},mt({props:St.props,dataStartIndex:Tt,dataEndIndex:$t,updateId:Ut},_objectSpread$1(_objectSpread$1({},St.state),{},{legendBBox:Et}))))}}),_defineProperty$1(_assertThisInitialized$1(St),"handleReceiveSyncEvent",function(Et,It,Tt){if(St.props.syncId===Et){if(Tt===St.eventEmitterSymbol&&typeof St.props.syncMethod!="function")return;St.applySyncEvent(It)}}),_defineProperty$1(_assertThisInitialized$1(St),"handleBrushChange",function(Et){var It=Et.startIndex,Tt=Et.endIndex;if(It!==St.state.dataStartIndex||Tt!==St.state.dataEndIndex){var $t=St.state.updateId;St.setState(function(){return _objectSpread$1({dataStartIndex:It,dataEndIndex:Tt},mt({props:St.props,dataStartIndex:It,dataEndIndex:Tt,updateId:$t},St.state))}),St.triggerSyncEvent({dataStartIndex:It,dataEndIndex:Tt})}}),_defineProperty$1(_assertThisInitialized$1(St),"handleMouseEnter",function(Et){var It=St.getMouseInfo(Et);if(It){var Tt=_objectSpread$1(_objectSpread$1({},It),{},{isTooltipActive:!0});St.setState(Tt),St.triggerSyncEvent(Tt);var $t=St.props.onMouseEnter;isFunction$4($t)&&$t(Tt,Et)}}),_defineProperty$1(_assertThisInitialized$1(St),"triggeredAfterMouseMove",function(Et){var It=St.getMouseInfo(Et),Tt=It?_objectSpread$1(_objectSpread$1({},It),{},{isTooltipActive:!0}):{isTooltipActive:!1};St.setState(Tt),St.triggerSyncEvent(Tt);var $t=St.props.onMouseMove;isFunction$4($t)&&$t(Tt,Et)}),_defineProperty$1(_assertThisInitialized$1(St),"handleItemMouseEnter",function(Et){St.setState(function(){return{isTooltipActive:!0,activeItem:Et,activePayload:Et.tooltipPayload,activeCoordinate:Et.tooltipPosition||{x:Et.cx,y:Et.cy}}})}),_defineProperty$1(_assertThisInitialized$1(St),"handleItemMouseLeave",function(){St.setState(function(){return{isTooltipActive:!1}})}),_defineProperty$1(_assertThisInitialized$1(St),"handleMouseMove",function(Et){Et.persist(),St.throttleTriggeredAfterMouseMove(Et)}),_defineProperty$1(_assertThisInitialized$1(St),"handleMouseLeave",function(Et){var It={isTooltipActive:!1};St.setState(It),St.triggerSyncEvent(It);var Tt=St.props.onMouseLeave;isFunction$4(Tt)&&Tt(It,Et)}),_defineProperty$1(_assertThisInitialized$1(St),"handleOuterEvent",function(Et){var It=getReactEventByType(Et),Tt=get$3(St.props,"".concat(It));if(It&&isFunction$4(Tt)){var $t,Ut;/.*touch.*/i.test(It)?Ut=St.getMouseInfo(Et.changedTouches[0]):Ut=St.getMouseInfo(Et),Tt(($t=Ut)!==null&&$t!==void 0?$t:{},Et)}}),_defineProperty$1(_assertThisInitialized$1(St),"handleClick",function(Et){var It=St.getMouseInfo(Et);if(It){var Tt=_objectSpread$1(_objectSpread$1({},It),{},{isTooltipActive:!0});St.setState(Tt),St.triggerSyncEvent(Tt);var $t=St.props.onClick;isFunction$4($t)&&$t(Tt,Et)}}),_defineProperty$1(_assertThisInitialized$1(St),"handleMouseDown",function(Et){var It=St.props.onMouseDown;if(isFunction$4(It)){var Tt=St.getMouseInfo(Et);It(Tt,Et)}}),_defineProperty$1(_assertThisInitialized$1(St),"handleMouseUp",function(Et){var It=St.props.onMouseUp;if(isFunction$4(It)){var Tt=St.getMouseInfo(Et);It(Tt,Et)}}),_defineProperty$1(_assertThisInitialized$1(St),"handleTouchMove",function(Et){Et.changedTouches!=null&&Et.changedTouches.length>0&&St.throttleTriggeredAfterMouseMove(Et.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(St),"handleTouchStart",function(Et){Et.changedTouches!=null&&Et.changedTouches.length>0&&St.handleMouseDown(Et.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(St),"handleTouchEnd",function(Et){Et.changedTouches!=null&&Et.changedTouches.length>0&&St.handleMouseUp(Et.changedTouches[0])}),_defineProperty$1(_assertThisInitialized$1(St),"triggerSyncEvent",function(Et){St.props.syncId!==void 0&&eventCenter.emit(SYNC_EVENT,St.props.syncId,Et,St.eventEmitterSymbol)}),_defineProperty$1(_assertThisInitialized$1(St),"applySyncEvent",function(Et){var It=St.props,Tt=It.layout,$t=It.syncMethod,Ut=St.state.updateId,Lt=Et.dataStartIndex,Bt=Et.dataEndIndex;if(Et.dataStartIndex!==void 0||Et.dataEndIndex!==void 0)St.setState(_objectSpread$1({dataStartIndex:Lt,dataEndIndex:Bt},mt({props:St.props,dataStartIndex:Lt,dataEndIndex:Bt,updateId:Ut},St.state)));else if(Et.activeTooltipIndex!==void 0){var Pt=Et.chartX,kt=Et.chartY,At=Et.activeTooltipIndex,Rt=St.state,Wt=Rt.offset,jt=Rt.tooltipTicks;if(!Wt)return;if(typeof $t=="function")At=$t(jt,Et);else if($t==="value"){At=-1;for(var Ot=0;Ot=0){var sn,Zt;if(Pt.dataKey&&!Pt.allowDuplicatedCategory){var Sn=typeof Pt.dataKey=="function"?vn:"payload.".concat(Pt.dataKey.toString());sn=findEntryInArray(Ot,Sn,At),Zt=Ct&&Dt&&findEntryInArray(Dt,Sn,At)}else sn=Ot==null?void 0:Ot[kt],Zt=Ct&&Dt&&Dt[kt];if(Xt||rn){var Tn=Et.props.activeIndex!==void 0?Et.props.activeIndex:kt;return[reactExports.cloneElement(Et,_objectSpread$1(_objectSpread$1(_objectSpread$1({},$t.props),tn),{},{activeIndex:Tn})),null,null]}if(!isNil$1(sn))return[pn].concat(_toConsumableArray$1(St.renderActivePoints({item:$t,activePoint:sn,basePoint:Zt,childIndex:kt,isRange:Ct})))}else{var Cn,jn=(Cn=St.getItemByXY(St.state.activeCoordinate))!==null&&Cn!==void 0?Cn:{graphicalItem:pn},Un=jn.graphicalItem,yn=Un.item,un=yn===void 0?Et:yn,En=Un.childIndex,In=_objectSpread$1(_objectSpread$1(_objectSpread$1({},$t.props),tn),{},{activeIndex:En});return[reactExports.cloneElement(un,In),null,null]}return Ct?[pn,null,null]:[pn,null]}),_defineProperty$1(_assertThisInitialized$1(St),"renderCustomized",function(Et,It,Tt){return reactExports.cloneElement(Et,_objectSpread$1(_objectSpread$1({key:"recharts-customized-".concat(Tt)},St.props),St.state))}),_defineProperty$1(_assertThisInitialized$1(St),"renderMap",{CartesianGrid:{handler:St.renderGrid,once:!0},ReferenceArea:{handler:St.renderReferenceElement},ReferenceLine:{handler:St.renderReferenceElement},ReferenceDot:{handler:St.renderReferenceElement},XAxis:{handler:St.renderXAxis},YAxis:{handler:St.renderYAxis},Brush:{handler:St.renderBrush,once:!0},Bar:{handler:St.renderGraphicChild},Line:{handler:St.renderGraphicChild},Area:{handler:St.renderGraphicChild},Radar:{handler:St.renderGraphicChild},RadialBar:{handler:St.renderGraphicChild},Scatter:{handler:St.renderGraphicChild},Pie:{handler:St.renderGraphicChild},Funnel:{handler:St.renderGraphicChild},Tooltip:{handler:St.renderCursor,once:!0},PolarGrid:{handler:St.renderPolarGrid,once:!0},PolarAngleAxis:{handler:St.renderPolarAxis},PolarRadiusAxis:{handler:St.renderPolarAxis},Customized:{handler:St.renderCustomized}}),St.clipPathId="".concat((vt=wt.id)!==null&&vt!==void 0?vt:uniqueId("recharts"),"-clip"),St.throttleTriggeredAfterMouseMove=throttle$1(St.triggeredAfterMouseMove,(xt=wt.throttleDelay)!==null&&xt!==void 0?xt:1e3/60),St.state={},St}return _createClass$1(yt,[{key:"componentDidMount",value:function(){var vt,xt;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(vt=this.props.margin.left)!==null&&vt!==void 0?vt:0,top:(xt=this.props.margin.top)!==null&&xt!==void 0?xt:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function(vt,xt){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==xt.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==vt.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==vt.margin){var St,Et;this.accessibilityManager.setDetails({offset:{left:(St=this.props.margin.left)!==null&&St!==void 0?St:0,top:(Et=this.props.margin.top)!==null&&Et!==void 0?Et:0}})}return null}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var vt=findChildByType(this.props.children,Tooltip);if(vt&&typeof vt.props.shared=="boolean"){var xt=vt.props.shared?"axis":"item";return lt.indexOf(xt)>=0?xt:at}return at}},{key:"getMouseInfo",value:function(vt){if(!this.container)return null;var xt=this.container,St=xt.getBoundingClientRect(),Et=getOffset(St),It={chartX:Math.round(vt.pageX-Et.left),chartY:Math.round(vt.pageY-Et.top)},Tt=St.width/xt.offsetWidth||1,$t=this.inRange(It.chartX,It.chartY,Tt);if(!$t)return null;var Ut=this.state,Lt=Ut.xAxisMap,Bt=Ut.yAxisMap,Pt=this.getTooltipEventType();if(Pt!=="axis"&&Lt&&Bt){var kt=getAnyElementOfObject(Lt).scale,At=getAnyElementOfObject(Bt).scale,Rt=kt&&kt.invert?kt.invert(It.chartX):null,Wt=At&&At.invert?At.invert(It.chartY):null;return _objectSpread$1(_objectSpread$1({},It),{},{xValue:Rt,yValue:Wt})}var jt=getTooltipData(this.state,this.props.data,this.props.layout,$t);return jt?_objectSpread$1(_objectSpread$1({},It),jt):null}},{key:"inRange",value:function(vt,xt){var St=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Et=this.props.layout,It=vt/St,Tt=xt/St;if(Et==="horizontal"||Et==="vertical"){var $t=this.state.offset,Ut=It>=$t.left&&It<=$t.left+$t.width&&Tt>=$t.top&&Tt<=$t.top+$t.height;return Ut?{x:It,y:Tt}:null}var Lt=this.state,Bt=Lt.angleAxisMap,Pt=Lt.radiusAxisMap;if(Bt&&Pt){var kt=getAnyElementOfObject(Bt);return inRangeOfSector({x:It,y:Tt},kt)}return null}},{key:"parseEventsOfWrapper",value:function(){var vt=this.props.children,xt=this.getTooltipEventType(),St=findChildByType(vt,Tooltip),Et={};St&&xt==="axis"&&(St.props.trigger==="click"?Et={onClick:this.handleClick}:Et={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var It=adaptEventHandlers(this.props,this.handleOuterEvent);return _objectSpread$1(_objectSpread$1({},It),Et)}},{key:"addListener",value:function(){eventCenter.on(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eventCenter.removeListener(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(vt,xt,St){for(var Et=this.state.formattedGraphicalItems,It=0,Tt=Et.length;ItjsxRuntimeExports.jsx(Dot,{cx:tt,cy:et,fill:colors.blueTextAccent,r:2}),SentimentChart=({data:tt,width:et=500,height:nt=300})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(tt==null?void 0:tt.length)&&jsxRuntimeExports.jsxs(LineChart,{data:tt,height:nt,id:"cy-sentiment-chart",margin:{bottom:5,left:-20,right:30,top:5},width:et,children:[jsxRuntimeExports.jsx(CartesianGrid,{stroke:colors.lightBlue300,strokeDasharray:"5 5"}),jsxRuntimeExports.jsx(XAxis,{dataKey:"date",interval:Math.floor(tt.length/3),stroke:colors.blueTextAccent}),jsxRuntimeExports.jsx(YAxis,{domain:[0,10],stroke:colors.blueTextAccent}),jsxRuntimeExports.jsx(Tooltip,{}),jsxRuntimeExports.jsx(Line,{dataKey:"score",dot:jsxRuntimeExports.jsx(RenderDot$1,{}),stroke:"#8884d8",type:"monotone"})]})}),Sentiment=()=>{const[tt,et]=reactExports.useState(void 0),[nt]=useUserStore(at=>[at.setBudget]),[it,rt]=reactExports.useState(!1),ot=async()=>{rt(!0),await executeIfProd(()=>distExports$1.enable()),getSentimentData().then(async at=>{et(at==null?void 0:at.data.filter(st=>st.date).map(st=>({date:hooks.unix(Number(String(st.date).split(".")[0])).format("MM/DD/YY"),score:st.sentiment_score}))),await updateBudget(nt)}).catch().finally(()=>{rt(!1)})};return jsxRuntimeExports.jsxs(ChartWrapper,{align:"flex-start",direction:"column",id:"cy-sentiment-chart-wrapper",justify:"flex-end",children:[jsxRuntimeExports.jsx(Text$4,{className:"title",children:"Sentiment chart"}),it&&jsxRuntimeExports.jsx(Stack$3,{alignItems:"center",component:"div",flexGrow:1,p:4,spacing:2,width:"100%",children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),!(tt!=null&&tt.length)&&jsxRuntimeExports.jsx(StyledButton$1,{className:"button",id:"cy-get-sentiments-btn",onClick:ot,children:"Get top 100 sentiments"}),jsxRuntimeExports.jsx(SentimentChart,{data:tt})]})},ChartWrapper=styled$4(Flex)` + A `).concat(mt,",").concat(mt,",0,0,").concat(ct,",").concat(et,",").concat(nt+rt-st*mt," Z")}else ut="M ".concat(et,",").concat(nt," h ").concat(it," v ").concat(rt," h ").concat(-it," Z");return ut},isInRectangle=function tt(et,nt){if(!et||!nt)return!1;var it=et.x,rt=et.y,ot=nt.x,at=nt.y,st=nt.width,lt=nt.height;if(Math.abs(st)>0&&Math.abs(lt)>0){var ct=Math.min(ot,ot+st),ut=Math.max(ot,ot+st),ht=Math.min(at,at+lt),dt=Math.max(at,at+lt);return it>=ct&&it<=ut&&rt>=ht&&rt<=dt}return!1},defaultProps$2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Rectangle=function tt(et){var nt=_objectSpread$h(_objectSpread$h({},defaultProps$2),et),it=reactExports.useRef(),rt=reactExports.useState(-1),ot=_slicedToArray$3(rt,2),at=ot[0],st=ot[1];reactExports.useEffect(function(){if(it.current&&it.current.getTotalLength)try{var xt=it.current.getTotalLength();xt&&st(xt)}catch{}},[]);var lt=nt.x,ct=nt.y,ut=nt.width,ht=nt.height,dt=nt.radius,pt=nt.className,mt=nt.animationEasing,gt=nt.animationDuration,bt=nt.animationBegin,yt=nt.isAnimationActive,wt=nt.isUpdateAnimationActive;if(lt!==+lt||ct!==+ct||ut!==+ut||ht!==+ht||ut===0||ht===0)return null;var vt=clsx("recharts-rectangle",pt);return wt?React$1.createElement(Animate,{canBegin:at>0,from:{width:ut,height:ht,x:lt,y:ct},to:{width:ut,height:ht,x:lt,y:ct},duration:gt,animationEasing:mt,isActive:wt},function(xt){var St=xt.width,Et=xt.height,$t=xt.x,It=xt.y;return React$1.createElement(Animate,{canBegin:at>0,from:"0px ".concat(at===-1?1:at,"px"),to:"".concat(at,"px 0px"),attributeName:"strokeDasharray",begin:bt,duration:gt,isActive:yt,easing:mt},React$1.createElement("path",_extends$f({},filterProps(nt,!0),{className:vt,d:getRectanglePath($t,It,St,Et,dt),ref:it})))}):React$1.createElement("path",_extends$f({},filterProps(nt,!0),{className:vt,d:getRectanglePath(lt,ct,ut,ht,dt)}))};function _extends$e(){return _extends$e=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$8(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}var getPath=function tt(et,nt,it,rt,ot,at){return"M".concat(et,",").concat(ot,"v").concat(rt,"M").concat(at,",").concat(nt,"h").concat(it)},Cross=function tt(et){var nt=et.x,it=nt===void 0?0:nt,rt=et.y,ot=rt===void 0?0:rt,at=et.top,st=at===void 0?0:at,lt=et.left,ct=lt===void 0?0:lt,ut=et.width,ht=ut===void 0?0:ut,dt=et.height,pt=dt===void 0?0:dt,mt=et.className,gt=_objectWithoutProperties$8(et,_excluded$8),bt=_objectSpread$g({x:it,y:ot,top:st,left:ct,width:ht,height:pt},gt);return!isNumber(it)||!isNumber(ot)||!isNumber(ht)||!isNumber(pt)||!isNumber(st)||!isNumber(ct)?null:React$1.createElement("path",_extends$d({},filterProps(bt,!0),{className:clsx("recharts-cross",mt),d:getPath(it,ot,ht,pt,st,ct)}))},baseGetTag$1=_baseGetTag,getPrototype=_getPrototype,isObjectLike$1=isObjectLike_1,objectTag="[object Object]",funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$1=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);function isPlainObject$2(tt){if(!isObjectLike$1(tt)||baseGetTag$1(tt)!=objectTag)return!1;var et=getPrototype(tt);if(et===null)return!0;var nt=hasOwnProperty$1.call(et,"constructor")&&et.constructor;return typeof nt=="function"&&nt instanceof nt&&funcToString.call(nt)==objectCtorString}var isPlainObject_1=isPlainObject$2;const isPlainObject$3=getDefaultExportFromCjs(isPlainObject_1);var baseGetTag=_baseGetTag,isObjectLike=isObjectLike_1,boolTag="[object Boolean]";function isBoolean(tt){return tt===!0||tt===!1||isObjectLike(tt)&&baseGetTag(tt)==boolTag}var isBoolean_1=isBoolean;const isBoolean$1=getDefaultExportFromCjs(isBoolean_1);function _typeof$g(tt){"@babel/helpers - typeof";return _typeof$g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$g(tt)}function _extends$c(){return _extends$c=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0,from:{upperWidth:0,lowerWidth:0,height:dt,x:lt,y:ct},to:{upperWidth:ut,lowerWidth:ht,height:dt,x:lt,y:ct},duration:gt,animationEasing:mt,isActive:yt},function(vt){var xt=vt.upperWidth,St=vt.lowerWidth,Et=vt.height,$t=vt.x,It=vt.y;return React$1.createElement(Animate,{canBegin:at>0,from:"0px ".concat(at===-1?1:at,"px"),to:"".concat(at,"px 0px"),attributeName:"strokeDasharray",begin:bt,duration:gt,easing:mt},React$1.createElement("path",_extends$c({},filterProps(nt,!0),{className:wt,d:getTrapezoidPath($t,It,xt,St,Et),ref:it})))}):React$1.createElement("g",null,React$1.createElement("path",_extends$c({},filterProps(nt,!0),{className:wt,d:getTrapezoidPath(lt,ct,ut,ht,dt)})))},_excluded$7=["option","shapeType","propTransformer","activeClassName","isActive"];function _typeof$f(tt){"@babel/helpers - typeof";return _typeof$f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$f(tt)}function _objectWithoutProperties$7(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$7(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$7(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ownKeys$e(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$e(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$6(tt){return _getPrototypeOf$6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$6(tt)}function _defineProperty$d(tt,et,nt){return et=_toPropertyKey$d(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$d(tt){var et=_toPrimitive$d(tt,"string");return _typeof$d(et)==="symbol"?et:String(et)}function _toPrimitive$d(tt,et){if(_typeof$d(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$d(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var createScale=function tt(et){var nt=et.data,it=et.startIndex,rt=et.endIndex,ot=et.x,at=et.width,st=et.travellerWidth;if(!nt||!nt.length)return{};var lt=nt.length,ct=point$3().domain(range$1(0,lt)).range([ot,ot+at-st]),ut=ct.domain().map(function(ht){return ct(ht)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:ct(it),endX:ct(rt),scale:ct,scaleValues:ut}},isTouch=function tt(et){return et.changedTouches&&!!et.changedTouches.length},Brush=function(tt){_inherits$6(nt,tt);var et=_createSuper$6(nt);function nt(it){var rt;return _classCallCheck$8(this,nt),rt=et.call(this,it),_defineProperty$d(_assertThisInitialized$6(rt),"handleDrag",function(ot){rt.leaveTimer&&(clearTimeout(rt.leaveTimer),rt.leaveTimer=null),rt.state.isTravellerMoving?rt.handleTravellerMove(ot):rt.state.isSlideMoving&&rt.handleSlideDrag(ot)}),_defineProperty$d(_assertThisInitialized$6(rt),"handleTouchMove",function(ot){ot.changedTouches!=null&&ot.changedTouches.length>0&&rt.handleDrag(ot.changedTouches[0])}),_defineProperty$d(_assertThisInitialized$6(rt),"handleDragEnd",function(){rt.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var ot=rt.props,at=ot.endIndex,st=ot.onDragEnd,lt=ot.startIndex;st==null||st({endIndex:at,startIndex:lt})}),rt.detachDragEndListener()}),_defineProperty$d(_assertThisInitialized$6(rt),"handleLeaveWrapper",function(){(rt.state.isTravellerMoving||rt.state.isSlideMoving)&&(rt.leaveTimer=window.setTimeout(rt.handleDragEnd,rt.props.leaveTimeOut))}),_defineProperty$d(_assertThisInitialized$6(rt),"handleEnterSlideOrTraveller",function(){rt.setState({isTextActive:!0})}),_defineProperty$d(_assertThisInitialized$6(rt),"handleLeaveSlideOrTraveller",function(){rt.setState({isTextActive:!1})}),_defineProperty$d(_assertThisInitialized$6(rt),"handleSlideDragStart",function(ot){var at=isTouch(ot)?ot.changedTouches[0]:ot;rt.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:at.pageX}),rt.attachDragEndListener()}),rt.travellerDragStartHandlers={startX:rt.handleTravellerDragStart.bind(_assertThisInitialized$6(rt),"startX"),endX:rt.handleTravellerDragStart.bind(_assertThisInitialized$6(rt),"endX")},rt.state={},rt}return _createClass$8(nt,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(rt){var ot=rt.startX,at=rt.endX,st=this.state.scaleValues,lt=this.props,ct=lt.gap,ut=lt.data,ht=ut.length-1,dt=Math.min(ot,at),pt=Math.max(ot,at),mt=nt.getIndexInRange(st,dt),gt=nt.getIndexInRange(st,pt);return{startIndex:mt-mt%ct,endIndex:gt===ht?ht:gt-gt%ct}}},{key:"getTextOfTick",value:function(rt){var ot=this.props,at=ot.data,st=ot.tickFormatter,lt=ot.dataKey,ct=getValueByDataKey(at[rt],lt,rt);return isFunction$4(st)?st(ct,rt):ct}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(rt){var ot=this.state,at=ot.slideMoveStartX,st=ot.startX,lt=ot.endX,ct=this.props,ut=ct.x,ht=ct.width,dt=ct.travellerWidth,pt=ct.startIndex,mt=ct.endIndex,gt=ct.onChange,bt=rt.pageX-at;bt>0?bt=Math.min(bt,ut+ht-dt-lt,ut+ht-dt-st):bt<0&&(bt=Math.max(bt,ut-st,ut-lt));var yt=this.getIndex({startX:st+bt,endX:lt+bt});(yt.startIndex!==pt||yt.endIndex!==mt)&>&>(yt),this.setState({startX:st+bt,endX:lt+bt,slideMoveStartX:rt.pageX})}},{key:"handleTravellerDragStart",value:function(rt,ot){var at=isTouch(ot)?ot.changedTouches[0]:ot;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:rt,brushMoveStartX:at.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(rt){var ot,at=this.state,st=at.brushMoveStartX,lt=at.movingTravellerId,ct=at.endX,ut=at.startX,ht=this.state[lt],dt=this.props,pt=dt.x,mt=dt.width,gt=dt.travellerWidth,bt=dt.onChange,yt=dt.gap,wt=dt.data,vt={startX:this.state.startX,endX:this.state.endX},xt=rt.pageX-st;xt>0?xt=Math.min(xt,pt+mt-gt-ht):xt<0&&(xt=Math.max(xt,pt-ht)),vt[lt]=ht+xt;var St=this.getIndex(vt),Et=St.startIndex,$t=St.endIndex,It=function(){var Ht=wt.length-1;return lt==="startX"&&(ct>ut?Et%yt===0:$t%yt===0)||ctut?$t%yt===0:Et%yt===0)||ct>ut&&$t===Ht};this.setState((ot={},_defineProperty$d(ot,lt,ht+xt),_defineProperty$d(ot,"brushMoveStartX",rt.pageX),ot),function(){bt&&It()&&bt(St)})}},{key:"handleTravellerMoveKeyboard",value:function(rt,ot){var at=this,st=this.state,lt=st.scaleValues,ct=st.startX,ut=st.endX,ht=this.state[ot],dt=lt.indexOf(ht);if(dt!==-1){var pt=dt+rt;if(!(pt===-1||pt>=lt.length)){var mt=lt[pt];ot==="startX"&&mt>=ut||ot==="endX"&&mt<=ct||this.setState(_defineProperty$d({},ot,mt),function(){at.props.onChange(at.getIndex({startX:at.state.startX,endX:at.state.endX}))})}}}},{key:"renderBackground",value:function(){var rt=this.props,ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.fill,ut=rt.stroke;return React$1.createElement("rect",{stroke:ut,fill:ct,x:ot,y:at,width:st,height:lt})}},{key:"renderPanorama",value:function(){var rt=this.props,ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.data,ut=rt.children,ht=rt.padding,dt=reactExports.Children.only(ut);return dt?React$1.cloneElement(dt,{x:ot,y:at,width:st,height:lt,margin:ht,compact:!0,data:ct}):null}},{key:"renderTravellerLayer",value:function(rt,ot){var at=this,st=this.props,lt=st.y,ct=st.travellerWidth,ut=st.height,ht=st.traveller,dt=st.ariaLabel,pt=st.data,mt=st.startIndex,gt=st.endIndex,bt=Math.max(rt,this.props.x),yt=_objectSpread$c(_objectSpread$c({},filterProps(this.props)),{},{x:bt,y:lt,width:ct,height:ut}),wt=dt||"Min value: ".concat(pt[mt].name,", Max value: ").concat(pt[gt].name);return React$1.createElement(Layer,{tabIndex:0,role:"slider","aria-label":wt,"aria-valuenow":rt,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[ot],onTouchStart:this.travellerDragStartHandlers[ot],onKeyDown:function(xt){["ArrowLeft","ArrowRight"].includes(xt.key)&&(xt.preventDefault(),xt.stopPropagation(),at.handleTravellerMoveKeyboard(xt.key==="ArrowRight"?1:-1,ot))},onFocus:function(){at.setState({isTravellerFocused:!0})},onBlur:function(){at.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},nt.renderTraveller(ht,yt))}},{key:"renderSlide",value:function(rt,ot){var at=this.props,st=at.y,lt=at.height,ct=at.stroke,ut=at.travellerWidth,ht=Math.min(rt,ot)+ut,dt=Math.max(Math.abs(ot-rt)-ut,0);return React$1.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:ct,fillOpacity:.2,x:ht,y:st,width:dt,height:lt})}},{key:"renderText",value:function(){var rt=this.props,ot=rt.startIndex,at=rt.endIndex,st=rt.y,lt=rt.height,ct=rt.travellerWidth,ut=rt.stroke,ht=this.state,dt=ht.startX,pt=ht.endX,mt=5,gt={pointerEvents:"none",fill:ut};return React$1.createElement(Layer,{className:"recharts-brush-texts"},React$1.createElement(Text$1,_extends$b({textAnchor:"end",verticalAnchor:"middle",x:Math.min(dt,pt)-mt,y:st+lt/2},gt),this.getTextOfTick(ot)),React$1.createElement(Text$1,_extends$b({textAnchor:"start",verticalAnchor:"middle",x:Math.max(dt,pt)+ct+mt,y:st+lt/2},gt),this.getTextOfTick(at)))}},{key:"render",value:function(){var rt=this.props,ot=rt.data,at=rt.className,st=rt.children,lt=rt.x,ct=rt.y,ut=rt.width,ht=rt.height,dt=rt.alwaysShowText,pt=this.state,mt=pt.startX,gt=pt.endX,bt=pt.isTextActive,yt=pt.isSlideMoving,wt=pt.isTravellerMoving,vt=pt.isTravellerFocused;if(!ot||!ot.length||!isNumber(lt)||!isNumber(ct)||!isNumber(ut)||!isNumber(ht)||ut<=0||ht<=0)return null;var xt=clsx("recharts-brush",at),St=React$1.Children.count(st)===1,Et=generatePrefixStyle("userSelect","none");return React$1.createElement(Layer,{className:xt,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:Et},this.renderBackground(),St&&this.renderPanorama(),this.renderSlide(mt,gt),this.renderTravellerLayer(mt,"startX"),this.renderTravellerLayer(gt,"endX"),(bt||yt||wt||vt||dt)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(rt){var ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.stroke,ut=Math.floor(at+lt/2)-1;return React$1.createElement(React$1.Fragment,null,React$1.createElement("rect",{x:ot,y:at,width:st,height:lt,fill:ct,stroke:"none"}),React$1.createElement("line",{x1:ot+1,y1:ut,x2:ot+st-1,y2:ut,fill:"none",stroke:"#fff"}),React$1.createElement("line",{x1:ot+1,y1:ut+2,x2:ot+st-1,y2:ut+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(rt,ot){var at;return React$1.isValidElement(rt)?at=React$1.cloneElement(rt,ot):isFunction$4(rt)?at=rt(ot):at=nt.renderDefaultTraveller(ot),at}},{key:"getDerivedStateFromProps",value:function(rt,ot){var at=rt.data,st=rt.width,lt=rt.x,ct=rt.travellerWidth,ut=rt.updateId,ht=rt.startIndex,dt=rt.endIndex;if(at!==ot.prevData||ut!==ot.prevUpdateId)return _objectSpread$c({prevData:at,prevTravellerWidth:ct,prevUpdateId:ut,prevX:lt,prevWidth:st},at&&at.length?createScale({data:at,width:st,x:lt,travellerWidth:ct,startIndex:ht,endIndex:dt}):{scale:null,scaleValues:null});if(ot.scale&&(st!==ot.prevWidth||lt!==ot.prevX||ct!==ot.prevTravellerWidth)){ot.scale.range([lt,lt+st-ct]);var pt=ot.scale.domain().map(function(mt){return ot.scale(mt)});return{prevData:at,prevTravellerWidth:ct,prevUpdateId:ut,prevX:lt,prevWidth:st,startX:ot.scale(rt.startIndex),endX:ot.scale(rt.endIndex),scaleValues:pt}}return null}},{key:"getIndexInRange",value:function(rt,ot){for(var at=rt.length,st=0,lt=at-1;lt-st>1;){var ct=Math.floor((st+lt)/2);rt[ct]>ot?lt=ct:st=ct}return ot>=rt[lt]?lt:st}}]),nt}(reactExports.PureComponent);_defineProperty$d(Brush,"displayName","Brush");_defineProperty$d(Brush,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var baseEach$1=_baseEach;function baseSome$1(tt,et){var nt;return baseEach$1(tt,function(it,rt,ot){return nt=et(it,rt,ot),!nt}),!!nt}var _baseSome=baseSome$1,arraySome=_arraySome,baseIteratee$4=_baseIteratee,baseSome=_baseSome,isArray$2=isArray_1,isIterateeCall$1=_isIterateeCall;function some(tt,et,nt){var it=isArray$2(tt)?arraySome:baseSome;return nt&&isIterateeCall$1(tt,et,nt)&&(et=void 0),it(tt,baseIteratee$4(et))}var some_1=some;const some$1=getDefaultExportFromCjs(some_1);var ifOverflowMatches=function tt(et,nt){var it=et.alwaysShow,rt=et.ifOverflow;return it&&(rt="extendDomain"),rt===nt},baseAssignValue=_baseAssignValue,baseForOwn=_baseForOwn,baseIteratee$3=_baseIteratee;function mapValues(tt,et){var nt={};return et=baseIteratee$3(et),baseForOwn(tt,function(it,rt,ot){baseAssignValue(nt,rt,et(it,rt,ot))}),nt}var mapValues_1=mapValues;const mapValues$1=getDefaultExportFromCjs(mapValues_1);function arrayEvery$1(tt,et){for(var nt=-1,it=tt==null?0:tt.length;++nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$6(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function typeguardBarRectangleProps(tt,et){var nt=tt.x,it=tt.y,rt=_objectWithoutProperties$6(tt,_excluded$6),ot="".concat(nt),at=parseInt(ot,10),st="".concat(it),lt=parseInt(st,10),ct="".concat(et.height||rt.height),ut=parseInt(ct,10),ht="".concat(et.width||rt.width),dt=parseInt(ht,10);return _objectSpread$b(_objectSpread$b(_objectSpread$b(_objectSpread$b(_objectSpread$b({},et),rt),at?{x:at}:{}),lt?{y:lt}:{}),{},{height:ut,width:dt,name:et.name,radius:et.radius})}function BarRectangle(tt){return React$1.createElement(Shape,_extends$a({shapeType:"rectangle",propTransformer:typeguardBarRectangleProps,activeClassName:"recharts-active-bar"},tt))}var _excluded$5=["value","background"];function _typeof$b(tt){"@babel/helpers - typeof";return _typeof$b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$b(tt)}function _objectWithoutProperties$5(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$5(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$5(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _extends$9(){return _extends$9=Object.assign?Object.assign.bind():function(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$5(tt){return _getPrototypeOf$5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$5(tt)}function _defineProperty$b(tt,et,nt){return et=_toPropertyKey$b(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$b(tt){var et=_toPrimitive$b(tt,"string");return _typeof$b(et)==="symbol"?et:String(et)}function _toPrimitive$b(tt,et){if(_typeof$b(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$b(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var Bar=function(tt){_inherits$5(nt,tt);var et=_createSuper$5(nt);function nt(){var it;_classCallCheck$7(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;at0&&Math.abs(kt)0&&Math.abs(jt)0&&(jt=Math.min((nn||0)-(kt[cn-1]||0),jt))});var Tt=jt/Ot,Ct=gt.layout==="vertical"?it.height:it.width;if(gt.padding==="gap"&&($t=Tt*Ct/2),gt.padding==="no-gap"){var Ut=getPercentValue(et.barCategoryGap,Tt*Ct),Nt=Tt*Ct/2;$t=Nt-Ut-(Nt-Ut)/Ct*Ut}}rt==="xAxis"?It=[it.left+(vt.left||0)+($t||0),it.left+it.width-(vt.right||0)-($t||0)]:rt==="yAxis"?It=lt==="horizontal"?[it.top+it.height-(vt.bottom||0),it.top+(vt.top||0)]:[it.top+(vt.top||0)+($t||0),it.top+it.height-(vt.bottom||0)-($t||0)]:It=gt.range,St&&(It=[It[1],It[0]]);var Bt=parseScale(gt,ot,dt),Mt=Bt.scale,Dt=Bt.realScaleType;Mt.domain(yt).range(It),checkDomainOfScale(Mt);var Pt=getTicksOfScale(Mt,_objectSpread$9(_objectSpread$9({},gt),{},{realScaleType:Dt}));rt==="xAxis"?(zt=bt==="top"&&!xt||bt==="bottom"&&xt,Ft=it.left,Ht=ht[Et]-zt*gt.height):rt==="yAxis"&&(zt=bt==="left"&&!xt||bt==="right"&&xt,Ft=ht[Et]-zt*gt.width,Ht=it.top);var Vt=_objectSpread$9(_objectSpread$9(_objectSpread$9({},gt),Pt),{},{realScaleType:Dt,x:Ft,y:Ht,scale:Mt,width:rt==="xAxis"?it.width:gt.width,height:rt==="yAxis"?it.height:gt.height});return Vt.bandSize=getBandSizeOfAxis(Vt,Pt),!gt.hide&&rt==="xAxis"?ht[Et]+=(zt?-1:1)*Vt.height:gt.hide||(ht[Et]+=(zt?-1:1)*Vt.width),_objectSpread$9(_objectSpread$9({},pt),{},_defineProperty$a({},mt,Vt))},{})},rectWithPoints=function tt(et,nt){var it=et.x,rt=et.y,ot=nt.x,at=nt.y;return{x:Math.min(it,ot),y:Math.min(rt,at),width:Math.abs(ot-it),height:Math.abs(at-rt)}},rectWithCoords=function tt(et){var nt=et.x1,it=et.y1,rt=et.x2,ot=et.y2;return rectWithPoints({x:nt,y:it},{x:rt,y:ot})},ScaleHelper=function(){function tt(et){_classCallCheck$6(this,tt),this.scale=et}return _createClass$6(tt,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(nt){var it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=it.bandAware,ot=it.position;if(nt!==void 0){if(ot)switch(ot){case"start":return this.scale(nt);case"middle":{var at=this.bandwidth?this.bandwidth()/2:0;return this.scale(nt)+at}case"end":{var st=this.bandwidth?this.bandwidth():0;return this.scale(nt)+st}default:return this.scale(nt)}if(rt){var lt=this.bandwidth?this.bandwidth()/2:0;return this.scale(nt)+lt}return this.scale(nt)}}},{key:"isInRange",value:function(nt){var it=this.range(),rt=it[0],ot=it[it.length-1];return rt<=ot?nt>=rt&&nt<=ot:nt>=ot&&nt<=rt}}],[{key:"create",value:function(nt){return new tt(nt)}}]),tt}();_defineProperty$a(ScaleHelper,"EPS",1e-4);var createLabeledScales=function tt(et){var nt=Object.keys(et).reduce(function(it,rt){return _objectSpread$9(_objectSpread$9({},it),{},_defineProperty$a({},rt,ScaleHelper.create(et[rt])))},{});return _objectSpread$9(_objectSpread$9({},nt),{},{apply:function(rt){var ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},at=ot.bandAware,st=ot.position;return mapValues$1(rt,function(lt,ct){return nt[ct].apply(lt,{bandAware:at,position:st})})},isInRange:function(rt){return every$1(rt,function(ot,at){return nt[at].isInRange(ot)})}})};function normalizeAngle(tt){return(tt%180+180)%180}var getAngledRectangleWidth=function tt(et){var nt=et.width,it=et.height,rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ot=normalizeAngle(rt),at=ot*Math.PI/180,st=Math.atan(it/nt),lt=at>st&&attt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nttt*rt)return!1;var ot=nt();return tt*(et-tt*ot/2-it)>=0&&tt*(et+tt*ot/2-rt)<=0}function getNumberIntervalTicks(tt,et){return getEveryNthWithCondition(tt,et+1)}function getEquidistantTicks(tt,et,nt,it,rt){for(var ot=(it||[]).slice(),at=et.start,st=et.end,lt=0,ct=1,ut=at,ht=function(){var mt=it==null?void 0:it[lt];if(mt===void 0)return{v:getEveryNthWithCondition(it,ct)};var gt=lt,bt,yt=function(){return bt===void 0&&(bt=nt(mt,gt)),bt},wt=mt.coordinate,vt=lt===0||isVisible(tt,wt,yt,ut,st);vt||(lt=0,ut=at,ct+=1),vt&&(ut=wt+tt*(yt()/2+rt),lt+=ct)},dt;ct<=ot.length;)if(dt=ht(),dt)return dt.v;return[]}function _typeof$6(tt){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$6(tt)}function ownKeys$5(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$5(tt){for(var et=1;et0?pt.coordinate-bt*tt:pt.coordinate})}else ot[dt]=pt=_objectSpread$5(_objectSpread$5({},pt),{},{tickCoord:pt.coordinate});var yt=isVisible(tt,pt.tickCoord,gt,st,lt);yt&&(lt=pt.tickCoord-tt*(gt()/2+rt),ot[dt]=_objectSpread$5(_objectSpread$5({},pt),{},{isShow:!0}))},ut=at-1;ut>=0;ut--)ct(ut);return ot}function getTicksStart(tt,et,nt,it,rt,ot){var at=(it||[]).slice(),st=at.length,lt=et.start,ct=et.end;if(ot){var ut=it[st-1],ht=nt(ut,st-1),dt=tt*(ut.coordinate+tt*ht/2-ct);at[st-1]=ut=_objectSpread$5(_objectSpread$5({},ut),{},{tickCoord:dt>0?ut.coordinate-dt*tt:ut.coordinate});var pt=isVisible(tt,ut.tickCoord,function(){return ht},lt,ct);pt&&(ct=ut.tickCoord-tt*(ht/2+rt),at[st-1]=_objectSpread$5(_objectSpread$5({},ut),{},{isShow:!0}))}for(var mt=ot?st-1:st,gt=function(wt){var vt=at[wt],xt,St=function(){return xt===void 0&&(xt=nt(vt,wt)),xt};if(wt===0){var Et=tt*(vt.coordinate-tt*St()/2-lt);at[wt]=vt=_objectSpread$5(_objectSpread$5({},vt),{},{tickCoord:Et<0?vt.coordinate-Et*tt:vt.coordinate})}else at[wt]=vt=_objectSpread$5(_objectSpread$5({},vt),{},{tickCoord:vt.coordinate});var $t=isVisible(tt,vt.tickCoord,St,lt,ct);$t&&(lt=vt.tickCoord+tt*(St()/2+rt),at[wt]=_objectSpread$5(_objectSpread$5({},vt),{},{isShow:!0}))},bt=0;bt=2?mathSign(rt[1].coordinate-rt[0].coordinate):1,yt=getTickBoundaries(ot,bt,pt);return lt==="equidistantPreserveStart"?getEquidistantTicks(bt,yt,gt,rt,at):(lt==="preserveStart"||lt==="preserveStartEnd"?dt=getTicksStart(bt,yt,gt,rt,at,lt==="preserveStartEnd"):dt=getTicksEnd(bt,yt,gt,rt,at),dt.filter(function(wt){return wt.isShow}))}var _excluded$4=["viewBox"],_excluded2$2=["viewBox"],_excluded3=["ticks"];function _typeof$5(tt){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$5(tt)}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$4(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _classCallCheck$5(tt,et){if(!(tt instanceof et))throw new TypeError("Cannot call a class as a function")}function _defineProperties$5(tt,et){for(var nt=0;nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$4(tt){return _getPrototypeOf$4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$4(tt)}function _defineProperty$5(tt,et,nt){return et=_toPropertyKey$5(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$5(tt){var et=_toPrimitive$5(tt,"string");return _typeof$5(et)==="symbol"?et:String(et)}function _toPrimitive$5(tt,et){if(_typeof$5(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$5(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var CartesianAxis=function(tt){_inherits$4(nt,tt);var et=_createSuper$4(nt);function nt(it){var rt;return _classCallCheck$5(this,nt),rt=et.call(this,it),rt.state={fontSize:"",letterSpacing:""},rt}return _createClass$5(nt,[{key:"shouldComponentUpdate",value:function(rt,ot){var at=rt.viewBox,st=_objectWithoutProperties$4(rt,_excluded$4),lt=this.props,ct=lt.viewBox,ut=_objectWithoutProperties$4(lt,_excluded2$2);return!shallowEqual(at,ct)||!shallowEqual(st,ut)||!shallowEqual(ot,this.state)}},{key:"componentDidMount",value:function(){var rt=this.layerReference;if(rt){var ot=rt.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];ot&&this.setState({fontSize:window.getComputedStyle(ot).fontSize,letterSpacing:window.getComputedStyle(ot).letterSpacing})}}},{key:"getTickLineCoord",value:function(rt){var ot=this.props,at=ot.x,st=ot.y,lt=ot.width,ct=ot.height,ut=ot.orientation,ht=ot.tickSize,dt=ot.mirror,pt=ot.tickMargin,mt,gt,bt,yt,wt,vt,xt=dt?-1:1,St=rt.tickSize||ht,Et=isNumber(rt.tickCoord)?rt.tickCoord:rt.coordinate;switch(ut){case"top":mt=gt=rt.coordinate,yt=st+ +!dt*ct,bt=yt-xt*St,vt=bt-xt*pt,wt=Et;break;case"left":bt=yt=rt.coordinate,gt=at+ +!dt*lt,mt=gt-xt*St,wt=mt-xt*pt,vt=Et;break;case"right":bt=yt=rt.coordinate,gt=at+ +dt*lt,mt=gt+xt*St,wt=mt+xt*pt,vt=Et;break;default:mt=gt=rt.coordinate,yt=st+ +dt*ct,bt=yt+xt*St,vt=bt+xt*pt,wt=Et;break}return{line:{x1:mt,y1:bt,x2:gt,y2:yt},tick:{x:wt,y:vt}}}},{key:"getTickTextAnchor",value:function(){var rt=this.props,ot=rt.orientation,at=rt.mirror,st;switch(ot){case"left":st=at?"start":"end";break;case"right":st=at?"end":"start";break;default:st="middle";break}return st}},{key:"getTickVerticalAnchor",value:function(){var rt=this.props,ot=rt.orientation,at=rt.mirror,st="end";switch(ot){case"left":case"right":st="middle";break;case"top":st=at?"start":"end";break;default:st=at?"end":"start";break}return st}},{key:"renderAxisLine",value:function(){var rt=this.props,ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.orientation,ut=rt.mirror,ht=rt.axisLine,dt=_objectSpread$4(_objectSpread$4(_objectSpread$4({},filterProps(this.props)),filterProps(ht)),{},{fill:"none"});if(ct==="top"||ct==="bottom"){var pt=+(ct==="top"&&!ut||ct==="bottom"&&ut);dt=_objectSpread$4(_objectSpread$4({},dt),{},{x1:ot,y1:at+pt*lt,x2:ot+st,y2:at+pt*lt})}else{var mt=+(ct==="left"&&!ut||ct==="right"&&ut);dt=_objectSpread$4(_objectSpread$4({},dt),{},{x1:ot+mt*st,y1:at,x2:ot+mt*st,y2:at+lt})}return React$1.createElement("line",_extends$5({},dt,{className:clsx("recharts-cartesian-axis-line",get$3(ht,"className"))}))}},{key:"renderTicks",value:function(rt,ot,at){var st=this,lt=this.props,ct=lt.tickLine,ut=lt.stroke,ht=lt.tick,dt=lt.tickFormatter,pt=lt.unit,mt=getTicks(_objectSpread$4(_objectSpread$4({},this.props),{},{ticks:rt}),ot,at),gt=this.getTickTextAnchor(),bt=this.getTickVerticalAnchor(),yt=filterProps(this.props),wt=filterProps(ht),vt=_objectSpread$4(_objectSpread$4({},yt),{},{fill:"none"},filterProps(ct)),xt=mt.map(function(St,Et){var $t=st.getTickLineCoord(St),It=$t.line,Ft=$t.tick,Ht=_objectSpread$4(_objectSpread$4(_objectSpread$4(_objectSpread$4({textAnchor:gt,verticalAnchor:bt},yt),{},{stroke:"none",fill:ut},wt),Ft),{},{index:Et,payload:St,visibleTicksCount:mt.length,tickFormatter:dt});return React$1.createElement(Layer,_extends$5({className:"recharts-cartesian-axis-tick",key:"tick-".concat(St.value,"-").concat(St.coordinate,"-").concat(St.tickCoord)},adaptEventsOfChild(st.props,St,Et)),ct&&React$1.createElement("line",_extends$5({},vt,It,{className:clsx("recharts-cartesian-axis-tick-line",get$3(ct,"className"))})),ht&&nt.renderTickItem(ht,Ht,"".concat(isFunction$4(dt)?dt(St.value,Et):St.value).concat(pt||"")))});return React$1.createElement("g",{className:"recharts-cartesian-axis-ticks"},xt)}},{key:"render",value:function(){var rt=this,ot=this.props,at=ot.axisLine,st=ot.width,lt=ot.height,ct=ot.ticksGenerator,ut=ot.className,ht=ot.hide;if(ht)return null;var dt=this.props,pt=dt.ticks,mt=_objectWithoutProperties$4(dt,_excluded3),gt=pt;return isFunction$4(ct)&&(gt=pt&&pt.length>0?ct(this.props):ct(mt)),st<=0||lt<=0||!gt||!gt.length?null:React$1.createElement(Layer,{className:clsx("recharts-cartesian-axis",ut),ref:function(yt){rt.layerReference=yt}},at&&this.renderAxisLine(),this.renderTicks(gt,this.state.fontSize,this.state.letterSpacing),Label.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(rt,ot,at){var st;return React$1.isValidElement(rt)?st=React$1.cloneElement(rt,ot):isFunction$4(rt)?st=rt(ot):st=React$1.createElement(Text$1,_extends$5({},ot,{className:"recharts-cartesian-axis-tick-value"}),at),st}}]),nt}(reactExports.Component);_defineProperty$5(CartesianAxis,"displayName","CartesianAxis");_defineProperty$5(CartesianAxis,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var _excluded$3=["x1","y1","x2","y2","key"],_excluded2$1=["offset"];function _typeof$4(tt){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$4(tt)}function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(tt){for(var et=1;et=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$3(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ownKeys$3(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread$3(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$3(tt){return _getPrototypeOf$3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$3(tt)}function _defineProperty$4(tt,et,nt){return et=_toPropertyKey$4(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$4(tt){var et=_toPrimitive$4(tt,"string");return _typeof$4(et)==="symbol"?et:String(et)}function _toPrimitive$4(tt,et){if(_typeof$4(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$4(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var CartesianGrid=function(tt){_inherits$3(nt,tt);var et=_createSuper$3(nt);function nt(){return _classCallCheck$4(this,nt),et.apply(this,arguments)}return _createClass$4(nt,[{key:"renderHorizontal",value:function(rt){var ot=this,at=this.props,st=at.x,lt=at.width,ct=at.horizontal;if(!rt||!rt.length)return null;var ut=rt.map(function(ht,dt){var pt=_objectSpread$3(_objectSpread$3({},ot.props),{},{x1:st,y1:ht,x2:st+lt,y2:ht,key:"line-".concat(dt),index:dt});return nt.renderLineItem(ct,pt)});return React$1.createElement("g",{className:"recharts-cartesian-grid-horizontal"},ut)}},{key:"renderVertical",value:function(rt){var ot=this,at=this.props,st=at.y,lt=at.height,ct=at.vertical;if(!rt||!rt.length)return null;var ut=rt.map(function(ht,dt){var pt=_objectSpread$3(_objectSpread$3({},ot.props),{},{x1:ht,y1:st,x2:ht,y2:st+lt,key:"line-".concat(dt),index:dt});return nt.renderLineItem(ct,pt)});return React$1.createElement("g",{className:"recharts-cartesian-grid-vertical"},ut)}},{key:"renderVerticalStripes",value:function(rt){var ot=this.props.verticalFill;if(!ot||!ot.length)return null;var at=this.props,st=at.fillOpacity,lt=at.x,ct=at.y,ut=at.width,ht=at.height,dt=rt.map(function(mt){return Math.round(mt+lt-lt)}).sort(function(mt,gt){return mt-gt});lt!==dt[0]&&dt.unshift(0);var pt=dt.map(function(mt,gt){var bt=!dt[gt+1],yt=bt?lt+ut-mt:dt[gt+1]-mt;if(yt<=0)return null;var wt=gt%ot.length;return React$1.createElement("rect",{key:"react-".concat(gt),x:mt,y:ct,width:yt,height:ht,stroke:"none",fill:ot[wt],fillOpacity:st,className:"recharts-cartesian-grid-bg"})});return React$1.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},pt)}},{key:"renderHorizontalStripes",value:function(rt){var ot=this.props.horizontalFill;if(!ot||!ot.length)return null;var at=this.props,st=at.fillOpacity,lt=at.x,ct=at.y,ut=at.width,ht=at.height,dt=rt.map(function(mt){return Math.round(mt+ct-ct)}).sort(function(mt,gt){return mt-gt});ct!==dt[0]&&dt.unshift(0);var pt=dt.map(function(mt,gt){var bt=!dt[gt+1],yt=bt?ct+ht-mt:dt[gt+1]-mt;if(yt<=0)return null;var wt=gt%ot.length;return React$1.createElement("rect",{key:"react-".concat(gt),y:mt,x:lt,height:yt,width:ut,stroke:"none",fill:ot[wt],fillOpacity:st,className:"recharts-cartesian-grid-bg"})});return React$1.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},pt)}},{key:"renderBackground",value:function(){var rt=this.props.fill;if(!rt||rt==="none")return null;var ot=this.props,at=ot.fillOpacity,st=ot.x,lt=ot.y,ct=ot.width,ut=ot.height;return React$1.createElement("rect",{x:st,y:lt,width:ct,height:ut,stroke:"none",fill:rt,fillOpacity:at,className:"recharts-cartesian-grid-bg"})}},{key:"render",value:function(){var rt=this.props,ot=rt.x,at=rt.y,st=rt.width,lt=rt.height,ct=rt.horizontal,ut=rt.vertical,ht=rt.horizontalCoordinatesGenerator,dt=rt.verticalCoordinatesGenerator,pt=rt.xAxis,mt=rt.yAxis,gt=rt.offset,bt=rt.chartWidth,yt=rt.chartHeight,wt=rt.syncWithTicks,vt=rt.horizontalValues,xt=rt.verticalValues;if(!isNumber(st)||st<=0||!isNumber(lt)||lt<=0||!isNumber(ot)||ot!==+ot||!isNumber(at)||at!==+at)return null;var St=this.props,Et=St.horizontalPoints,$t=St.verticalPoints;if((!Et||!Et.length)&&isFunction$4(ht)){var It=vt&&vt.length;Et=ht({yAxis:mt?_objectSpread$3(_objectSpread$3({},mt),{},{ticks:It?vt:mt.ticks}):void 0,width:bt,height:yt,offset:gt},It?!0:wt)}if((!$t||!$t.length)&&isFunction$4(dt)){var Ft=xt&&xt.length;$t=dt({xAxis:pt?_objectSpread$3(_objectSpread$3({},pt),{},{ticks:Ft?xt:pt.ticks}):void 0,width:bt,height:yt,offset:gt},Ft?!0:wt)}return React$1.createElement("g",{className:"recharts-cartesian-grid"},this.renderBackground(),ct&&this.renderHorizontal(Et),ut&&this.renderVertical($t),ct&&this.renderHorizontalStripes(Et),ut&&this.renderVerticalStripes($t))}}],[{key:"renderLineItem",value:function(rt,ot){var at;if(React$1.isValidElement(rt))at=React$1.cloneElement(rt,ot);else if(isFunction$4(rt))at=rt(ot);else{var st=ot.x1,lt=ot.y1,ct=ot.x2,ut=ot.y2,ht=ot.key,dt=_objectWithoutProperties$3(ot,_excluded$3),pt=filterProps(dt);pt.offset;var mt=_objectWithoutProperties$3(pt,_excluded2$1);at=React$1.createElement("line",_extends$4({},mt,{x1:st,y1:lt,x2:ct,y2:ut,fill:"none",key:ht}))}return at}}]),nt}(reactExports.PureComponent);_defineProperty$4(CartesianGrid,"displayName","CartesianGrid");_defineProperty$4(CartesianGrid,"defaultProps",{horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]});var _excluded$2=["type","layout","connectNulls","ref"];function _typeof$3(tt){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$3(tt)}function _objectWithoutProperties$2(tt,et){if(tt==null)return{};var nt=_objectWithoutPropertiesLoose$2(tt,et),it,rt;if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(rt=0;rt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$2(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$2(tt){return _getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$2(tt)}function _defineProperty$3(tt,et,nt){return et=_toPropertyKey$3(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$3(tt){var et=_toPrimitive$3(tt,"string");return _typeof$3(et)==="symbol"?et:String(et)}function _toPrimitive$3(tt,et){if(_typeof$3(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$3(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var Line=function(tt){_inherits$2(nt,tt);var et=_createSuper$2(nt);function nt(){var it;_classCallCheck$3(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;atdt){mt=[].concat(_toConsumableArray$2(ct.slice(0,gt)),[dt-bt]);break}var yt=mt.length%2===0?[0,pt]:[pt];return[].concat(_toConsumableArray$2(nt.repeat(ct,ht)),_toConsumableArray$2(mt),yt).map(function(wt){return"".concat(wt,"px")}).join(", ")}),_defineProperty$3(_assertThisInitialized$2(it),"id",uniqueId("recharts-line-")),_defineProperty$3(_assertThisInitialized$2(it),"pathRef",function(st){it.mainCurve=st}),_defineProperty$3(_assertThisInitialized$2(it),"handleAnimationEnd",function(){it.setState({isAnimationFinished:!0}),it.props.onAnimationEnd&&it.props.onAnimationEnd()}),_defineProperty$3(_assertThisInitialized$2(it),"handleAnimationStart",function(){it.setState({isAnimationFinished:!1}),it.props.onAnimationStart&&it.props.onAnimationStart()}),it}return _createClass$3(nt,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var rt=this.getTotalLength();this.setState({totalLength:rt})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var rt=this.getTotalLength();rt!==this.state.totalLength&&this.setState({totalLength:rt})}}},{key:"getTotalLength",value:function(){var rt=this.mainCurve;try{return rt&&rt.getTotalLength&&rt.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(rt,ot){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var at=this.props,st=at.points,lt=at.xAxis,ct=at.yAxis,ut=at.layout,ht=at.children,dt=findAllByType(ht,ErrorBar);if(!dt)return null;var pt=function(bt,yt){return{x:bt.x,y:bt.y,value:bt.value,errorVal:getValueByDataKey(bt.payload,yt)}},mt={clipPath:rt?"url(#clipPath-".concat(ot,")"):null};return React$1.createElement(Layer,mt,dt.map(function(gt){return React$1.cloneElement(gt,{key:"bar-".concat(gt.props.dataKey),data:st,xAxis:lt,yAxis:ct,layout:ut,dataPointFormatter:pt})}))}},{key:"renderDots",value:function(rt,ot,at){var st=this.props.isAnimationActive;if(st&&!this.state.isAnimationFinished)return null;var lt=this.props,ct=lt.dot,ut=lt.points,ht=lt.dataKey,dt=filterProps(this.props),pt=filterProps(ct,!0),mt=ut.map(function(bt,yt){var wt=_objectSpread$2(_objectSpread$2(_objectSpread$2({key:"dot-".concat(yt),r:3},dt),pt),{},{value:bt.value,dataKey:ht,cx:bt.x,cy:bt.y,index:yt,payload:bt.payload});return nt.renderDotItem(ct,wt)}),gt={clipPath:rt?"url(#clipPath-".concat(ot?"":"dots-").concat(at,")"):null};return React$1.createElement(Layer,_extends$3({className:"recharts-line-dots",key:"dots"},gt),mt)}},{key:"renderCurveStatically",value:function(rt,ot,at,st){var lt=this.props,ct=lt.type,ut=lt.layout,ht=lt.connectNulls;lt.ref;var dt=_objectWithoutProperties$2(lt,_excluded$2),pt=_objectSpread$2(_objectSpread$2(_objectSpread$2({},filterProps(dt,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:ot?"url(#clipPath-".concat(at,")"):null,points:rt},st),{},{type:ct,layout:ut,connectNulls:ht});return React$1.createElement(Curve,_extends$3({},pt,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(rt,ot){var at=this,st=this.props,lt=st.points,ct=st.strokeDasharray,ut=st.isAnimationActive,ht=st.animationBegin,dt=st.animationDuration,pt=st.animationEasing,mt=st.animationId,gt=st.animateNewValues,bt=st.width,yt=st.height,wt=this.state,vt=wt.prevPoints,xt=wt.totalLength;return React$1.createElement(Animate,{begin:ht,duration:dt,isActive:ut,easing:pt,from:{t:0},to:{t:1},key:"line-".concat(mt),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(St){var Et=St.t;if(vt){var $t=vt.length/lt.length,It=lt.map(function(jt,kt){var Tt=Math.floor(kt*$t);if(vt[Tt]){var Ct=vt[Tt],Ut=interpolateNumber$2(Ct.x,jt.x),Nt=interpolateNumber$2(Ct.y,jt.y);return _objectSpread$2(_objectSpread$2({},jt),{},{x:Ut(Et),y:Nt(Et)})}if(gt){var Bt=interpolateNumber$2(bt*2,jt.x),Mt=interpolateNumber$2(yt/2,jt.y);return _objectSpread$2(_objectSpread$2({},jt),{},{x:Bt(Et),y:Mt(Et)})}return _objectSpread$2(_objectSpread$2({},jt),{},{x:jt.x,y:jt.y})});return at.renderCurveStatically(It,rt,ot)}var Ft=interpolateNumber$2(0,xt),Ht=Ft(Et),zt;if(ct){var Ot="".concat(ct).split(/[,\s]+/gim).map(function(jt){return parseFloat(jt)});zt=at.getStrokeDasharray(Ht,xt,Ot)}else zt=at.generateSimpleStrokeDasharray(xt,Ht);return at.renderCurveStatically(lt,rt,ot,{strokeDasharray:zt})})}},{key:"renderCurve",value:function(rt,ot){var at=this.props,st=at.points,lt=at.isAnimationActive,ct=this.state,ut=ct.prevPoints,ht=ct.totalLength;return lt&&st&&st.length&&(!ut&&ht>0||!isEqual$2(ut,st))?this.renderCurveWithAnimation(rt,ot):this.renderCurveStatically(st,rt,ot)}},{key:"render",value:function(){var rt,ot=this.props,at=ot.hide,st=ot.dot,lt=ot.points,ct=ot.className,ut=ot.xAxis,ht=ot.yAxis,dt=ot.top,pt=ot.left,mt=ot.width,gt=ot.height,bt=ot.isAnimationActive,yt=ot.id;if(at||!lt||!lt.length)return null;var wt=this.state.isAnimationFinished,vt=lt.length===1,xt=clsx("recharts-line",ct),St=ut&&ut.allowDataOverflow,Et=ht&&ht.allowDataOverflow,$t=St||Et,It=isNil$1(yt)?this.id:yt,Ft=(rt=filterProps(st))!==null&&rt!==void 0?rt:{r:3,strokeWidth:2},Ht=Ft.r,zt=Ht===void 0?3:Ht,Ot=Ft.strokeWidth,jt=Ot===void 0?2:Ot,kt=isDotProps(st)?st:{},Tt=kt.clipDot,Ct=Tt===void 0?!0:Tt,Ut=zt*2+jt;return React$1.createElement(Layer,{className:xt},St||Et?React$1.createElement("defs",null,React$1.createElement("clipPath",{id:"clipPath-".concat(It)},React$1.createElement("rect",{x:St?pt:pt-mt/2,y:Et?dt:dt-gt/2,width:St?mt:mt*2,height:Et?gt:gt*2})),!Ct&&React$1.createElement("clipPath",{id:"clipPath-dots-".concat(It)},React$1.createElement("rect",{x:pt-Ut/2,y:dt-Ut/2,width:mt+Ut,height:gt+Ut}))):null,!vt&&this.renderCurve($t,It),this.renderErrorBar($t,It),(vt||st)&&this.renderDots($t,Ct,It),(!bt||wt)&&LabelList.renderCallByParent(this.props,lt))}}],[{key:"getDerivedStateFromProps",value:function(rt,ot){return rt.animationId!==ot.prevAnimationId?{prevAnimationId:rt.animationId,curPoints:rt.points,prevPoints:ot.curPoints}:rt.points!==ot.curPoints?{curPoints:rt.points}:null}},{key:"repeat",value:function(rt,ot){for(var at=rt.length%2!==0?[].concat(_toConsumableArray$2(rt),[0]):rt,st=[],lt=0;lt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose$1(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function ScatterSymbol(tt){var et=tt.option,nt=tt.isActive,it=_objectWithoutProperties$1(tt,_excluded$1);return typeof et=="string"?React$1.createElement(Shape,_extends$2({option:React$1.createElement(Symbols,_extends$2({type:et},it)),isActive:nt,shapeType:"symbols"},it)):React$1.createElement(Shape,_extends$2({option:et,isActive:nt,shapeType:"symbols"},it))}function _typeof$2(tt){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},_typeof$2(tt)}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(tt){for(var et=1;et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$1(tt){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf$1(tt)}function _defineProperty$2(tt,et,nt){return et=_toPropertyKey$2(et),et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _toPropertyKey$2(tt){var et=_toPrimitive$2(tt,"string");return _typeof$2(et)==="symbol"?et:String(et)}function _toPrimitive$2(tt,et){if(_typeof$2(tt)!=="object"||tt===null)return tt;var nt=tt[Symbol.toPrimitive];if(nt!==void 0){var it=nt.call(tt,et||"default");if(_typeof$2(it)!=="object")return it;throw new TypeError("@@toPrimitive must return a primitive value.")}return(et==="string"?String:Number)(tt)}var Scatter=function(tt){_inherits$1(nt,tt);var et=_createSuper$1(nt);function nt(){var it;_classCallCheck$2(this,nt);for(var rt=arguments.length,ot=new Array(rt),at=0;at-1?rt[ot?et[at]:at]:void 0}}var _createFind=createFind$1,toFinite=toFinite_1;function toInteger$1(tt){var et=toFinite(tt),nt=et%1;return et===et?nt?et-nt:et:0}var toInteger_1=toInteger$1,baseFindIndex=_baseFindIndex,baseIteratee=_baseIteratee,toInteger=toInteger_1,nativeMax=Math.max;function findIndex$1(tt,et,nt){var it=tt==null?0:tt.length;if(!it)return-1;var rt=nt==null?0:toInteger(nt);return rt<0&&(rt=nativeMax(it+rt,0)),baseFindIndex(tt,baseIteratee(et),rt)}var findIndex_1=findIndex$1,createFind=_createFind,findIndex=findIndex_1,find$2=createFind(findIndex),find_1=find$2;const find$3=getDefaultExportFromCjs(find_1);var prefix="Invariant failed";function invariant(tt,et){if(!tt)throw new Error(prefix)}function getRadialCursorPoints(tt){var et=tt.cx,nt=tt.cy,it=tt.radius,rt=tt.startAngle,ot=tt.endAngle,at=polarToCartesian(et,nt,it,rt),st=polarToCartesian(et,nt,it,ot);return{points:[at,st],cx:et,cy:nt,radius:it,startAngle:rt,endAngle:ot}}function _toConsumableArray$1(tt){return _arrayWithoutHoles$1(tt)||_iterableToArray$1(tt)||_unsupportedIterableToArray$1(tt)||_nonIterableSpread$1()}function _nonIterableSpread$1(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$1(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$1(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$1(tt,et)}}function _iterableToArray$1(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles$1(tt){if(Array.isArray(tt))return _arrayLikeToArray$1(tt)}function _arrayLikeToArray$1(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt=0)&&Object.prototype.propertyIsEnumerable.call(tt,it)&&(nt[it]=tt[it])}return nt}function _objectWithoutPropertiesLoose(tt,et){if(tt==null)return{};var nt={},it=Object.keys(tt),rt,ot;for(ot=0;ot=0)&&(nt[rt]=tt[rt]);return nt}function _classCallCheck(tt,et){if(!(tt instanceof et))throw new TypeError("Cannot call a class as a function")}function _defineProperties(tt,et){for(var nt=0;nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf(tt){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf(tt)}function _toConsumableArray(tt){return _arrayWithoutHoles(tt)||_iterableToArray(tt)||_unsupportedIterableToArray(tt)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray(tt,et)}}function _iterableToArray(tt){if(typeof Symbol<"u"&&tt[Symbol.iterator]!=null||tt["@@iterator"]!=null)return Array.from(tt)}function _arrayWithoutHoles(tt){if(Array.isArray(tt))return _arrayLikeToArray(tt)}function _arrayLikeToArray(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt0?at:et&&et.length&&isNumber(rt)&&isNumber(ot)?et.slice(rt,ot+1):[]};function getDefaultDomainByAxisType(tt){return tt==="number"?[0,"auto"]:void 0}var getTooltipContent=function tt(et,nt,it,rt){var ot=et.graphicalItems,at=et.tooltipAxis,st=getDisplayedData(nt,et);return it<0||!ot||!ot.length||it>=st.length?null:ot.reduce(function(lt,ct){var ut,ht=ct.props.hide;if(ht)return lt;var dt=(ut=ct.props.data)!==null&&ut!==void 0?ut:nt;dt&&et.dataStartIndex+et.dataEndIndex!==0&&(dt=dt.slice(et.dataStartIndex,et.dataEndIndex+1));var pt;if(at.dataKey&&!at.allowDuplicatedCategory){var mt=dt===void 0?st:dt;pt=findEntryInArray(mt,at.dataKey,rt)}else pt=dt&&dt[it]||st[it];return pt?[].concat(_toConsumableArray(lt),[getTooltipItem(ct,pt)]):lt},[])},getTooltipData=function tt(et,nt,it,rt){var ot=rt||{x:et.chartX,y:et.chartY},at=calculateTooltipPos(ot,it),st=et.orderedTooltipTicks,lt=et.tooltipAxis,ct=et.tooltipTicks,ut=calculateActiveTickIndex(at,st,ct,lt);if(ut>=0&&ct){var ht=ct[ut]&&ct[ut].value,dt=getTooltipContent(et,nt,ut,ht),pt=getActiveCoordinate(it,st,ut,ot);return{activeTooltipIndex:ut,activeLabel:ht,activePayload:dt,activeCoordinate:pt}}return null},getAxisMapByAxes=function tt(et,nt){var it=nt.axes,rt=nt.graphicalItems,ot=nt.axisType,at=nt.axisIdKey,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.layout,ht=et.children,dt=et.stackOffset,pt=isCategoricalAxis(ut,ot);return it.reduce(function(mt,gt){var bt,yt=gt.props,wt=yt.type,vt=yt.dataKey,xt=yt.allowDataOverflow,St=yt.allowDuplicatedCategory,Et=yt.scale,$t=yt.ticks,It=yt.includeHidden,Ft=gt.props[at];if(mt[Ft])return mt;var Ht=getDisplayedData(et.data,{graphicalItems:rt.filter(function(Pt){return Pt.props[at]===Ft}),dataStartIndex:lt,dataEndIndex:ct}),zt=Ht.length,Ot,jt,kt;isDomainSpecifiedByUser(gt.props.domain,xt,wt)&&(Ot=parseSpecifiedDomain(gt.props.domain,null,xt),pt&&(wt==="number"||Et!=="auto")&&(kt=getDomainOfDataByKey(Ht,vt,"category")));var Tt=getDefaultDomainByAxisType(wt);if(!Ot||Ot.length===0){var Ct,Ut=(Ct=gt.props.domain)!==null&&Ct!==void 0?Ct:Tt;if(vt){if(Ot=getDomainOfDataByKey(Ht,vt,wt),wt==="category"&&pt){var Nt=hasDuplicate(Ot);St&&Nt?(jt=Ot,Ot=range$1(0,zt)):St||(Ot=parseDomainOfCategoryAxis(Ut,Ot,gt).reduce(function(Pt,Vt){return Pt.indexOf(Vt)>=0?Pt:[].concat(_toConsumableArray(Pt),[Vt])},[]))}else if(wt==="category")St?Ot=Ot.filter(function(Pt){return Pt!==""&&!isNil$1(Pt)}):Ot=parseDomainOfCategoryAxis(Ut,Ot,gt).reduce(function(Pt,Vt){return Pt.indexOf(Vt)>=0||Vt===""||isNil$1(Vt)?Pt:[].concat(_toConsumableArray(Pt),[Vt])},[]);else if(wt==="number"){var Bt=parseErrorBarsOfAxis(Ht,rt.filter(function(Pt){return Pt.props[at]===Ft&&(It||!Pt.props.hide)}),vt,ot,ut);Bt&&(Ot=Bt)}pt&&(wt==="number"||Et!=="auto")&&(kt=getDomainOfDataByKey(Ht,vt,"category"))}else pt?Ot=range$1(0,zt):st&&st[Ft]&&st[Ft].hasStack&&wt==="number"?Ot=dt==="expand"?[0,1]:getDomainOfStackGroups(st[Ft].stackGroups,lt,ct):Ot=getDomainOfItemsWithSameAxis(Ht,rt.filter(function(Pt){return Pt.props[at]===Ft&&(It||!Pt.props.hide)}),wt,ut,!0);if(wt==="number")Ot=detectReferenceElementsDomain(ht,Ot,Ft,ot,$t),Ut&&(Ot=parseSpecifiedDomain(Ut,Ot,xt));else if(wt==="category"&&Ut){var Mt=Ut,Dt=Ot.every(function(Pt){return Mt.indexOf(Pt)>=0});Dt&&(Ot=Mt)}}return _objectSpread(_objectSpread({},mt),{},_defineProperty({},Ft,_objectSpread(_objectSpread({},gt.props),{},{axisType:ot,domain:Ot,categoricalDomain:kt,duplicateDomain:jt,originalDomain:(bt=gt.props.domain)!==null&&bt!==void 0?bt:Tt,isCategorical:pt,layout:ut})))},{})},getAxisMapByItems=function tt(et,nt){var it=nt.graphicalItems,rt=nt.Axis,ot=nt.axisType,at=nt.axisIdKey,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.layout,ht=et.children,dt=getDisplayedData(et.data,{graphicalItems:it,dataStartIndex:lt,dataEndIndex:ct}),pt=dt.length,mt=isCategoricalAxis(ut,ot),gt=-1;return it.reduce(function(bt,yt){var wt=yt.props[at],vt=getDefaultDomainByAxisType("number");if(!bt[wt]){gt++;var xt;return mt?xt=range$1(0,pt):st&&st[wt]&&st[wt].hasStack?(xt=getDomainOfStackGroups(st[wt].stackGroups,lt,ct),xt=detectReferenceElementsDomain(ht,xt,wt,ot)):(xt=parseSpecifiedDomain(vt,getDomainOfItemsWithSameAxis(dt,it.filter(function(St){return St.props[at]===wt&&!St.props.hide}),"number",ut),rt.defaultProps.allowDataOverflow),xt=detectReferenceElementsDomain(ht,xt,wt,ot)),_objectSpread(_objectSpread({},bt),{},_defineProperty({},wt,_objectSpread(_objectSpread({axisType:ot},rt.defaultProps),{},{hide:!0,orientation:get$3(ORIENT_MAP,"".concat(ot,".").concat(gt%2),null),domain:xt,originalDomain:vt,isCategorical:mt,layout:ut})))}return bt},{})},getAxisMap=function tt(et,nt){var it=nt.axisType,rt=it===void 0?"xAxis":it,ot=nt.AxisComp,at=nt.graphicalItems,st=nt.stackGroups,lt=nt.dataStartIndex,ct=nt.dataEndIndex,ut=et.children,ht="".concat(rt,"Id"),dt=findAllByType(ut,ot),pt={};return dt&&dt.length?pt=getAxisMapByAxes(et,{axes:dt,graphicalItems:at,axisType:rt,axisIdKey:ht,stackGroups:st,dataStartIndex:lt,dataEndIndex:ct}):at&&at.length&&(pt=getAxisMapByItems(et,{Axis:ot,graphicalItems:at,axisType:rt,axisIdKey:ht,stackGroups:st,dataStartIndex:lt,dataEndIndex:ct})),pt},tooltipTicksGenerator=function tt(et){var nt=getAnyElementOfObject(et),it=getTicksOfAxis(nt,!1,!0);return{tooltipTicks:it,orderedTooltipTicks:sortBy$1(it,function(rt){return rt.coordinate}),tooltipAxis:nt,tooltipAxisBandSize:getBandSizeOfAxis(nt,it)}},createDefaultState=function tt(et){var nt=et.children,it=et.defaultShowTooltip,rt=findChildByType(nt,Brush),ot=0,at=0;return et.data&&et.data.length!==0&&(at=et.data.length-1),rt&&rt.props&&(rt.props.startIndex>=0&&(ot=rt.props.startIndex),rt.props.endIndex>=0&&(at=rt.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:ot,dataEndIndex:at,activeTooltipIndex:-1,isTooltipActive:!!it}},hasGraphicalBarItem=function tt(et){return!et||!et.length?!1:et.some(function(nt){var it=getDisplayName(nt&&nt.type);return it&&it.indexOf("Bar")>=0})},getAxisNameByLayout=function tt(et){return et==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:et==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:et==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},calculateOffset=function tt(et,nt){var it=et.props,rt=et.graphicalItems,ot=et.xAxisMap,at=ot===void 0?{}:ot,st=et.yAxisMap,lt=st===void 0?{}:st,ct=it.width,ut=it.height,ht=it.children,dt=it.margin||{},pt=findChildByType(ht,Brush),mt=findChildByType(ht,Legend),gt=Object.keys(lt).reduce(function(St,Et){var $t=lt[Et],It=$t.orientation;return!$t.mirror&&!$t.hide?_objectSpread(_objectSpread({},St),{},_defineProperty({},It,St[It]+$t.width)):St},{left:dt.left||0,right:dt.right||0}),bt=Object.keys(at).reduce(function(St,Et){var $t=at[Et],It=$t.orientation;return!$t.mirror&&!$t.hide?_objectSpread(_objectSpread({},St),{},_defineProperty({},It,get$3(St,"".concat(It))+$t.height)):St},{top:dt.top||0,bottom:dt.bottom||0}),yt=_objectSpread(_objectSpread({},bt),gt),wt=yt.bottom;pt&&(yt.bottom+=pt.props.height||Brush.defaultProps.height),mt&&nt&&(yt=appendOffsetOfLegend(yt,rt,it,nt));var vt=ct-yt.left-yt.right,xt=ut-yt.top-yt.bottom;return _objectSpread(_objectSpread({brushBottom:wt},yt),{},{width:Math.max(vt,0),height:Math.max(xt,0)})},generateCategoricalChart=function tt(et){var nt,it=et.chartName,rt=et.GraphicalChild,ot=et.defaultTooltipEventType,at=ot===void 0?"axis":ot,st=et.validateTooltipEventTypes,lt=st===void 0?["axis"]:st,ct=et.axisComponents,ut=et.legendContent,ht=et.formatAxisMap,dt=et.defaultProps,pt=function(bt,yt){var wt=yt.graphicalItems,vt=yt.stackGroups,xt=yt.offset,St=yt.updateId,Et=yt.dataStartIndex,$t=yt.dataEndIndex,It=bt.barSize,Ft=bt.layout,Ht=bt.barGap,zt=bt.barCategoryGap,Ot=bt.maxBarSize,jt=getAxisNameByLayout(Ft),kt=jt.numericAxisName,Tt=jt.cateAxisName,Ct=hasGraphicalBarItem(wt),Ut=Ct&&getBarSizeList({barSize:It,stackGroups:vt}),Nt=[];return wt.forEach(function(Bt,Mt){var Dt=getDisplayedData(bt.data,{graphicalItems:[Bt],dataStartIndex:Et,dataEndIndex:$t}),Pt=Bt.props,Vt=Pt.dataKey,nn=Pt.maxBarSize,cn=Bt.props["".concat(kt,"Id")],Xt=Bt.props["".concat(Tt,"Id")],un={},en=ct.reduce(function(Tn,yn){var dn,sn=yt["".concat(yn.axisType,"Map")],rn=Bt.props["".concat(yn.axisType,"Id")];sn&&sn[rn]||yn.axisType==="zAxis"||invariant(!1);var Sn=sn[rn];return _objectSpread(_objectSpread({},Tn),{},(dn={},_defineProperty(dn,yn.axisType,Sn),_defineProperty(dn,"".concat(yn.axisType,"Ticks"),getTicksOfAxis(Sn)),dn))},un),fn=en[Tt],xn=en["".concat(Tt,"Ticks")],an=vt&&vt[cn]&&vt[cn].hasStack&&getStackedDataOfItem(Bt,vt[cn].stackGroups),Zt=getDisplayName(Bt.type).indexOf("Bar")>=0,En=getBandSizeOfAxis(fn,xn),In=[];if(Zt){var Cn,Nn,Un=isNil$1(nn)?Ot:nn,_n=(Cn=(Nn=getBandSizeOfAxis(fn,xn,!0))!==null&&Nn!==void 0?Nn:Un)!==null&&Cn!==void 0?Cn:0;In=getBarPosition({barGap:Ht,barCategoryGap:zt,bandSize:_n!==En?_n:En,sizeList:Ut[Xt],maxBarSize:Un}),_n!==En&&(In=In.map(function(Tn){return _objectSpread(_objectSpread({},Tn),{},{position:_objectSpread(_objectSpread({},Tn.position),{},{offset:Tn.position.offset-_n/2})})}))}var An=Bt&&Bt.type&&Bt.type.getComposedData;if(An){var gn;Nt.push({props:_objectSpread(_objectSpread({},An(_objectSpread(_objectSpread({},en),{},{displayedData:Dt,props:bt,dataKey:Vt,item:Bt,bandSize:En,barPosition:In,offset:xt,stackedData:an,layout:Ft,dataStartIndex:Et,dataEndIndex:$t}))),{},(gn={key:Bt.key||"item-".concat(Mt)},_defineProperty(gn,kt,en[kt]),_defineProperty(gn,Tt,en[Tt]),_defineProperty(gn,"animationId",St),gn)),childIndex:parseChildIndex(Bt,bt.children),item:Bt})}}),Nt},mt=function(bt,yt){var wt=bt.props,vt=bt.dataStartIndex,xt=bt.dataEndIndex,St=bt.updateId;if(!validateWidthHeight({props:wt}))return null;var Et=wt.children,$t=wt.layout,It=wt.stackOffset,Ft=wt.data,Ht=wt.reverseStackOrder,zt=getAxisNameByLayout($t),Ot=zt.numericAxisName,jt=zt.cateAxisName,kt=findAllByType(Et,rt),Tt=getStackGroupsByAxisId(Ft,kt,"".concat(Ot,"Id"),"".concat(jt,"Id"),It,Ht),Ct=ct.reduce(function(Dt,Pt){var Vt="".concat(Pt.axisType,"Map");return _objectSpread(_objectSpread({},Dt),{},_defineProperty({},Vt,getAxisMap(wt,_objectSpread(_objectSpread({},Pt),{},{graphicalItems:kt,stackGroups:Pt.axisType===Ot&&Tt,dataStartIndex:vt,dataEndIndex:xt}))))},{}),Ut=calculateOffset(_objectSpread(_objectSpread({},Ct),{},{props:wt,graphicalItems:kt}),yt==null?void 0:yt.legendBBox);Object.keys(Ct).forEach(function(Dt){Ct[Dt]=ht(wt,Ct[Dt],Ut,Dt.replace("Map",""),it)});var Nt=Ct["".concat(jt,"Map")],Bt=tooltipTicksGenerator(Nt),Mt=pt(wt,_objectSpread(_objectSpread({},Ct),{},{dataStartIndex:vt,dataEndIndex:xt,updateId:St,graphicalItems:kt,stackGroups:Tt,offset:Ut}));return _objectSpread(_objectSpread({formattedGraphicalItems:Mt,graphicalItems:kt,offset:Ut,stackGroups:Tt},Bt),Ct)};return nt=function(gt){_inherits(yt,gt);var bt=_createSuper(yt);function yt(wt){var vt,xt,St;return _classCallCheck(this,yt),St=bt.call(this,wt),_defineProperty(_assertThisInitialized(St),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_defineProperty(_assertThisInitialized(St),"accessibilityManager",new AccessibilityManager),_defineProperty(_assertThisInitialized(St),"handleLegendBBoxUpdate",function(Et){if(Et){var $t=St.state,It=$t.dataStartIndex,Ft=$t.dataEndIndex,Ht=$t.updateId;St.setState(_objectSpread({legendBBox:Et},mt({props:St.props,dataStartIndex:It,dataEndIndex:Ft,updateId:Ht},_objectSpread(_objectSpread({},St.state),{},{legendBBox:Et}))))}}),_defineProperty(_assertThisInitialized(St),"handleReceiveSyncEvent",function(Et,$t,It){if(St.props.syncId===Et){if(It===St.eventEmitterSymbol&&typeof St.props.syncMethod!="function")return;St.applySyncEvent($t)}}),_defineProperty(_assertThisInitialized(St),"handleBrushChange",function(Et){var $t=Et.startIndex,It=Et.endIndex;if($t!==St.state.dataStartIndex||It!==St.state.dataEndIndex){var Ft=St.state.updateId;St.setState(function(){return _objectSpread({dataStartIndex:$t,dataEndIndex:It},mt({props:St.props,dataStartIndex:$t,dataEndIndex:It,updateId:Ft},St.state))}),St.triggerSyncEvent({dataStartIndex:$t,dataEndIndex:It})}}),_defineProperty(_assertThisInitialized(St),"handleMouseEnter",function(Et){var $t=St.getMouseInfo(Et);if($t){var It=_objectSpread(_objectSpread({},$t),{},{isTooltipActive:!0});St.setState(It),St.triggerSyncEvent(It);var Ft=St.props.onMouseEnter;isFunction$4(Ft)&&Ft(It,Et)}}),_defineProperty(_assertThisInitialized(St),"triggeredAfterMouseMove",function(Et){var $t=St.getMouseInfo(Et),It=$t?_objectSpread(_objectSpread({},$t),{},{isTooltipActive:!0}):{isTooltipActive:!1};St.setState(It),St.triggerSyncEvent(It);var Ft=St.props.onMouseMove;isFunction$4(Ft)&&Ft(It,Et)}),_defineProperty(_assertThisInitialized(St),"handleItemMouseEnter",function(Et){St.setState(function(){return{isTooltipActive:!0,activeItem:Et,activePayload:Et.tooltipPayload,activeCoordinate:Et.tooltipPosition||{x:Et.cx,y:Et.cy}}})}),_defineProperty(_assertThisInitialized(St),"handleItemMouseLeave",function(){St.setState(function(){return{isTooltipActive:!1}})}),_defineProperty(_assertThisInitialized(St),"handleMouseMove",function(Et){Et.persist(),St.throttleTriggeredAfterMouseMove(Et)}),_defineProperty(_assertThisInitialized(St),"handleMouseLeave",function(Et){var $t={isTooltipActive:!1};St.setState($t),St.triggerSyncEvent($t);var It=St.props.onMouseLeave;isFunction$4(It)&&It($t,Et)}),_defineProperty(_assertThisInitialized(St),"handleOuterEvent",function(Et){var $t=getReactEventByType(Et),It=get$3(St.props,"".concat($t));if($t&&isFunction$4(It)){var Ft,Ht;/.*touch.*/i.test($t)?Ht=St.getMouseInfo(Et.changedTouches[0]):Ht=St.getMouseInfo(Et),It((Ft=Ht)!==null&&Ft!==void 0?Ft:{},Et)}}),_defineProperty(_assertThisInitialized(St),"handleClick",function(Et){var $t=St.getMouseInfo(Et);if($t){var It=_objectSpread(_objectSpread({},$t),{},{isTooltipActive:!0});St.setState(It),St.triggerSyncEvent(It);var Ft=St.props.onClick;isFunction$4(Ft)&&Ft(It,Et)}}),_defineProperty(_assertThisInitialized(St),"handleMouseDown",function(Et){var $t=St.props.onMouseDown;if(isFunction$4($t)){var It=St.getMouseInfo(Et);$t(It,Et)}}),_defineProperty(_assertThisInitialized(St),"handleMouseUp",function(Et){var $t=St.props.onMouseUp;if(isFunction$4($t)){var It=St.getMouseInfo(Et);$t(It,Et)}}),_defineProperty(_assertThisInitialized(St),"handleTouchMove",function(Et){Et.changedTouches!=null&&Et.changedTouches.length>0&&St.throttleTriggeredAfterMouseMove(Et.changedTouches[0])}),_defineProperty(_assertThisInitialized(St),"handleTouchStart",function(Et){Et.changedTouches!=null&&Et.changedTouches.length>0&&St.handleMouseDown(Et.changedTouches[0])}),_defineProperty(_assertThisInitialized(St),"handleTouchEnd",function(Et){Et.changedTouches!=null&&Et.changedTouches.length>0&&St.handleMouseUp(Et.changedTouches[0])}),_defineProperty(_assertThisInitialized(St),"triggerSyncEvent",function(Et){St.props.syncId!==void 0&&eventCenter.emit(SYNC_EVENT,St.props.syncId,Et,St.eventEmitterSymbol)}),_defineProperty(_assertThisInitialized(St),"applySyncEvent",function(Et){var $t=St.props,It=$t.layout,Ft=$t.syncMethod,Ht=St.state.updateId,zt=Et.dataStartIndex,Ot=Et.dataEndIndex;if(Et.dataStartIndex!==void 0||Et.dataEndIndex!==void 0)St.setState(_objectSpread({dataStartIndex:zt,dataEndIndex:Ot},mt({props:St.props,dataStartIndex:zt,dataEndIndex:Ot,updateId:Ht},St.state)));else if(Et.activeTooltipIndex!==void 0){var jt=Et.chartX,kt=Et.chartY,Tt=Et.activeTooltipIndex,Ct=St.state,Ut=Ct.offset,Nt=Ct.tooltipTicks;if(!Ut)return;if(typeof Ft=="function")Tt=Ft(Nt,Et);else if(Ft==="value"){Tt=-1;for(var Bt=0;Bt=0){var an,Zt;if(jt.dataKey&&!jt.allowDuplicatedCategory){var En=typeof jt.dataKey=="function"?xn:"payload.".concat(jt.dataKey.toString());an=findEntryInArray(Bt,En,Tt),Zt=Mt&&Dt&&findEntryInArray(Dt,En,Tt)}else an=Bt==null?void 0:Bt[kt],Zt=Mt&&Dt&&Dt[kt];if(Xt||cn){var In=Et.props.activeIndex!==void 0?Et.props.activeIndex:kt;return[reactExports.cloneElement(Et,_objectSpread(_objectSpread(_objectSpread({},Ft.props),en),{},{activeIndex:In})),null,null]}if(!isNil$1(an))return[fn].concat(_toConsumableArray(St.renderActivePoints({item:Ft,activePoint:an,basePoint:Zt,childIndex:kt,isRange:Mt})))}else{var Cn,Nn=(Cn=St.getItemByXY(St.state.activeCoordinate))!==null&&Cn!==void 0?Cn:{graphicalItem:fn},Un=Nn.graphicalItem,_n=Un.item,An=_n===void 0?Et:_n,gn=Un.childIndex,Tn=_objectSpread(_objectSpread(_objectSpread({},Ft.props),en),{},{activeIndex:gn});return[reactExports.cloneElement(An,Tn),null,null]}return Mt?[fn,null,null]:[fn,null]}),_defineProperty(_assertThisInitialized(St),"renderCustomized",function(Et,$t,It){return reactExports.cloneElement(Et,_objectSpread(_objectSpread({key:"recharts-customized-".concat(It)},St.props),St.state))}),_defineProperty(_assertThisInitialized(St),"renderMap",{CartesianGrid:{handler:St.renderGrid,once:!0},ReferenceArea:{handler:St.renderReferenceElement},ReferenceLine:{handler:St.renderReferenceElement},ReferenceDot:{handler:St.renderReferenceElement},XAxis:{handler:St.renderXAxis},YAxis:{handler:St.renderYAxis},Brush:{handler:St.renderBrush,once:!0},Bar:{handler:St.renderGraphicChild},Line:{handler:St.renderGraphicChild},Area:{handler:St.renderGraphicChild},Radar:{handler:St.renderGraphicChild},RadialBar:{handler:St.renderGraphicChild},Scatter:{handler:St.renderGraphicChild},Pie:{handler:St.renderGraphicChild},Funnel:{handler:St.renderGraphicChild},Tooltip:{handler:St.renderCursor,once:!0},PolarGrid:{handler:St.renderPolarGrid,once:!0},PolarAngleAxis:{handler:St.renderPolarAxis},PolarRadiusAxis:{handler:St.renderPolarAxis},Customized:{handler:St.renderCustomized}}),St.clipPathId="".concat((vt=wt.id)!==null&&vt!==void 0?vt:uniqueId("recharts"),"-clip"),St.throttleTriggeredAfterMouseMove=throttle$1(St.triggeredAfterMouseMove,(xt=wt.throttleDelay)!==null&&xt!==void 0?xt:1e3/60),St.state={},St}return _createClass(yt,[{key:"componentDidMount",value:function(){var vt,xt;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(vt=this.props.margin.left)!==null&&vt!==void 0?vt:0,top:(xt=this.props.margin.top)!==null&&xt!==void 0?xt:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function(vt,xt){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==xt.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==vt.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==vt.margin){var St,Et;this.accessibilityManager.setDetails({offset:{left:(St=this.props.margin.left)!==null&&St!==void 0?St:0,top:(Et=this.props.margin.top)!==null&&Et!==void 0?Et:0}})}return null}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var vt=findChildByType(this.props.children,Tooltip);if(vt&&typeof vt.props.shared=="boolean"){var xt=vt.props.shared?"axis":"item";return lt.indexOf(xt)>=0?xt:at}return at}},{key:"getMouseInfo",value:function(vt){if(!this.container)return null;var xt=this.container,St=xt.getBoundingClientRect(),Et=getOffset(St),$t={chartX:Math.round(vt.pageX-Et.left),chartY:Math.round(vt.pageY-Et.top)},It=St.width/xt.offsetWidth||1,Ft=this.inRange($t.chartX,$t.chartY,It);if(!Ft)return null;var Ht=this.state,zt=Ht.xAxisMap,Ot=Ht.yAxisMap,jt=this.getTooltipEventType();if(jt!=="axis"&&zt&&Ot){var kt=getAnyElementOfObject(zt).scale,Tt=getAnyElementOfObject(Ot).scale,Ct=kt&&kt.invert?kt.invert($t.chartX):null,Ut=Tt&&Tt.invert?Tt.invert($t.chartY):null;return _objectSpread(_objectSpread({},$t),{},{xValue:Ct,yValue:Ut})}var Nt=getTooltipData(this.state,this.props.data,this.props.layout,Ft);return Nt?_objectSpread(_objectSpread({},$t),Nt):null}},{key:"inRange",value:function(vt,xt){var St=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Et=this.props.layout,$t=vt/St,It=xt/St;if(Et==="horizontal"||Et==="vertical"){var Ft=this.state.offset,Ht=$t>=Ft.left&&$t<=Ft.left+Ft.width&&It>=Ft.top&&It<=Ft.top+Ft.height;return Ht?{x:$t,y:It}:null}var zt=this.state,Ot=zt.angleAxisMap,jt=zt.radiusAxisMap;if(Ot&&jt){var kt=getAnyElementOfObject(Ot);return inRangeOfSector({x:$t,y:It},kt)}return null}},{key:"parseEventsOfWrapper",value:function(){var vt=this.props.children,xt=this.getTooltipEventType(),St=findChildByType(vt,Tooltip),Et={};St&&xt==="axis"&&(St.props.trigger==="click"?Et={onClick:this.handleClick}:Et={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var $t=adaptEventHandlers(this.props,this.handleOuterEvent);return _objectSpread(_objectSpread({},$t),Et)}},{key:"addListener",value:function(){eventCenter.on(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eventCenter.removeListener(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(vt,xt,St){for(var Et=this.state.formattedGraphicalItems,$t=0,It=Et.length;$tjsxRuntimeExports.jsx(Dot,{cx:tt,cy:et,fill:colors.blueTextAccent,r:2}),SentimentChart=({data:tt,width:et=500,height:nt=300})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(tt==null?void 0:tt.length)&&jsxRuntimeExports.jsxs(LineChart,{data:tt,height:nt,id:"cy-sentiment-chart",margin:{bottom:5,left:-20,right:30,top:5},width:et,children:[jsxRuntimeExports.jsx(CartesianGrid,{stroke:colors.lightBlue300,strokeDasharray:"5 5"}),jsxRuntimeExports.jsx(XAxis,{dataKey:"date",interval:Math.floor(tt.length/3),stroke:colors.blueTextAccent}),jsxRuntimeExports.jsx(YAxis,{domain:[0,10],stroke:colors.blueTextAccent}),jsxRuntimeExports.jsx(Tooltip,{}),jsxRuntimeExports.jsx(Line,{dataKey:"score",dot:jsxRuntimeExports.jsx(RenderDot$1,{}),stroke:"#8884d8",type:"monotone"})]})}),Sentiment=()=>{const[tt,et]=reactExports.useState(void 0),[nt]=useUserStore(at=>[at.setBudget]),[it,rt]=reactExports.useState(!1),ot=async()=>{rt(!0),await executeIfProd(()=>distExports$1.enable()),getSentimentData().then(async at=>{et(at==null?void 0:at.data.filter(st=>st.date).map(st=>({date:hooks.unix(Number(String(st.date).split(".")[0])).format("MM/DD/YY"),score:st.sentiment_score}))),await updateBudget(nt)}).catch().finally(()=>{rt(!1)})};return jsxRuntimeExports.jsxs(ChartWrapper,{align:"flex-start",direction:"column",id:"cy-sentiment-chart-wrapper",justify:"flex-end",children:[jsxRuntimeExports.jsx(Text$4,{className:"title",children:"Sentiment chart"}),it&&jsxRuntimeExports.jsx(Stack$3,{alignItems:"center",component:"div",flexGrow:1,p:4,spacing:2,width:"100%",children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),!(tt!=null&&tt.length)&&jsxRuntimeExports.jsx(StyledButton$1,{className:"button",id:"cy-get-sentiments-btn",onClick:ot,children:"Get top 100 sentiments"}),jsxRuntimeExports.jsx(SentimentChart,{data:tt})]})},ChartWrapper=styled$4(Flex)` border-radius: 8px; box-shadow: 0px 5px 6px rgb(0 0 0 / 50%); padding: 16px; @@ -6796,7 +6796,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho color: ${colors.GRAY6}; font-size: 16px; height: 16px; -`,Relevance=({isSearchResult:tt})=>{const et=reactExports.useRef(null),nt=tt?80:10,[it,rt]=useDataStore(bt=>[bt.setSelectedNode,bt.setSelectedTimestamp]),[ot]=useAppStore(bt=>[bt.setSidebarOpen]),at=useAppStore(bt=>bt.setRelevanceSelected),[st,lt]=reactExports.useState(0),ct=useFilteredNodes(),ht=st*nt+nt,dt=ct.length-1>ht,pt=useIsMatchBreakpoint("sm","down"),mt=reactExports.useMemo(()=>[...ct].sort((bt,yt)=>(yt.date||0)-(bt.date||0)).slice(0,ht),[ct,ht]),gt=reactExports.useCallback(bt=>{saveConsumedContent(bt),rt(bt),at(!0),it(bt),pt&&ot(!1)},[it,at,ot,rt,pt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(ScrollView,{ref:et,id:"search-result-list",shrink:1,children:[mt.map((bt,yt)=>{const{image_url:wt,date:vt,boost:xt,type:St,id:Et,episode_title:It,show_title:Tt,node_type:$t,text:Ut,source_link:Lt,link:Bt,name:Pt,profile_picture:kt,verified:At=!1,twitter_handle:Rt}=bt||{};return jsxRuntimeExports.jsx(Episode,{boostCount:xt||0,date:vt||0,episodeTitle:formatDescription(It),id:Et,imageUrl:wt||"",link:Bt,name:Pt||"",onClick:()=>gt(bt),profilePicture:kt,showTitle:formatDescription(Tt),sourceLink:Lt,text:Ut||"",twitterHandle:Rt,type:$t||St,verified:At},yt.toString())}),jsxRuntimeExports.jsx(LoadMoreWrapper,{align:"center",background:"BG1",direction:"row",justify:"center",children:jsxRuntimeExports.jsx(Button$2,{disabled:!dt,onClick:()=>{var bt;dt&&(lt(st+1),(bt=et.current)==null||bt.scrollTo(0,0))},size:"medium",children:"Load More"})})]})})},LoadMoreWrapper=styled$4(Flex)` +`,Relevance=({isSearchResult:tt})=>{const et=reactExports.useRef(null),nt=tt?80:10,[it,rt]=useDataStore(bt=>[bt.setSelectedNode,bt.setSelectedTimestamp]),[ot]=useAppStore(bt=>[bt.setSidebarOpen]),at=useAppStore(bt=>bt.setRelevanceSelected),[st,lt]=reactExports.useState(0),ct=useFilteredNodes(),ht=st*nt+nt,dt=ct.length-1>ht,pt=useIsMatchBreakpoint("sm","down"),mt=reactExports.useMemo(()=>[...ct].sort((bt,yt)=>(yt.date||0)-(bt.date||0)).slice(0,ht),[ct,ht]),gt=reactExports.useCallback(bt=>{saveConsumedContent(bt),rt(bt),at(!0),it(bt),pt&&ot(!1)},[it,at,ot,rt,pt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(ScrollView,{ref:et,id:"search-result-list",shrink:1,children:[mt.map((bt,yt)=>{const{image_url:wt,date:vt,boost:xt,type:St,id:Et,episode_title:$t,show_title:It,node_type:Ft,text:Ht,source_link:zt,link:Ot,name:jt,profile_picture:kt,verified:Tt=!1,twitter_handle:Ct}=bt||{};return jsxRuntimeExports.jsx(Episode,{boostCount:xt||0,date:vt||0,episodeTitle:formatDescription($t),id:Et,imageUrl:wt||"",link:Ot,name:jt||"",onClick:()=>gt(bt),profilePicture:kt,showTitle:formatDescription(It),sourceLink:zt,text:Ht||"",twitterHandle:Ct,type:Ft||St,verified:Tt},yt.toString())}),jsxRuntimeExports.jsx(LoadMoreWrapper,{align:"center",background:"BG1",direction:"row",justify:"center",children:jsxRuntimeExports.jsx(Button$2,{disabled:!dt,onClick:()=>{var bt;dt&&(lt(st+1),(bt=et.current)==null||bt.scrollTo(0,0))},size:"medium",children:"Load More"})})]})})},LoadMoreWrapper=styled$4(Flex)` flex: 0 0 86px; `,_View$1=({isSearchResult:tt})=>{const[et,nt]=useUserStore(ot=>[ot.nodeCount,ot.setNodeCount]),[it]=[useDataStore(ot=>ot.fetchData)],rt=async()=>{et<1||(await it(),nt("CLEAR"))};return jsxRuntimeExports.jsxs(Wrapper$a,{children:[!tt&&jsxRuntimeExports.jsxs("div",{className:"heading-container",children:[jsxRuntimeExports.jsxs("div",{className:"heading",children:[jsxRuntimeExports.jsx("span",{className:"heading__title",children:"Latest"}),jsxRuntimeExports.jsx("span",{className:"heading__icon",children:jsxRuntimeExports.jsx(BrowseGalleryIcon,{})})]}),et?jsxRuntimeExports.jsx("div",{className:"button_container",children:jsxRuntimeExports.jsx(ButtonStyled$1,{className:"button",onClick:rt,startIcon:jsxRuntimeExports.jsx(DownloadIcon,{}),children:`See Latest (${et})`})}):null]}),jsxRuntimeExports.jsx(Relevance,{isSearchResult:tt})]})},ButtonStyled$1=styled$4(Button$2)` && { @@ -6931,7 +6931,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho height: 4px; background: ${colors.GRAY6}; } -`;const CloseIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"cancel",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1264_3381",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"32",height:"32",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1264_3381)",children:jsxRuntimeExports.jsx("path",{id:"cancel_2",d:"M16 17.4051L20.0975 21.5025C20.2821 21.6872 20.5141 21.7816 20.7936 21.7859C21.0731 21.7902 21.3094 21.6957 21.5025 21.5025C21.6957 21.3094 21.7923 21.0752 21.7923 20.8C21.7923 20.5248 21.6957 20.2906 21.5025 20.0975L17.4051 16L21.5025 11.9025C21.6872 11.7179 21.7816 11.4859 21.7859 11.2064C21.7902 10.9269 21.6957 10.6906 21.5025 10.4975C21.3094 10.3043 21.0752 10.2077 20.8 10.2077C20.5248 10.2077 20.2906 10.3043 20.0975 10.4975L16 14.5949L11.9025 10.4975C11.7179 10.3129 11.4859 10.2184 11.2064 10.2141C10.9269 10.2099 10.6906 10.3043 10.4975 10.4975C10.3043 10.6906 10.2077 10.9248 10.2077 11.2C10.2077 11.4752 10.3043 11.7094 10.4975 11.9025L14.5949 16L10.4975 20.0975C10.3129 20.2821 10.2184 20.5141 10.2141 20.7936C10.2099 21.0731 10.3043 21.3094 10.4975 21.5025C10.6906 21.6957 10.9248 21.7923 11.2 21.7923C11.4752 21.7923 11.7094 21.6957 11.9025 21.5025L16 17.4051ZM16.0022 28.6666C14.2503 28.6666 12.6036 28.3342 11.0621 27.6693C9.52057 27.0044 8.17966 26.1021 7.03937 24.9623C5.89906 23.8225 4.99632 22.4822 4.33114 20.9413C3.66596 19.4005 3.33337 17.7542 3.33337 16.0022C3.33337 14.2503 3.66582 12.6036 4.33071 11.0621C4.9956 9.52057 5.89793 8.17967 7.03771 7.03938C8.17751 5.89907 9.51783 4.99632 11.0587 4.33114C12.5995 3.66596 14.2459 3.33337 15.9978 3.33337C17.7497 3.33337 19.3964 3.66582 20.9379 4.33071C22.4794 4.9956 23.8204 5.89793 24.9606 7.03771C26.101 8.17751 27.0037 9.51783 27.6689 11.0587C28.3341 12.5995 28.6666 14.2459 28.6666 15.9978C28.6666 17.7497 28.3342 19.3964 27.6693 20.9379C27.0044 22.4794 26.1021 23.8204 24.9623 24.9606C23.8225 26.101 22.4822 27.0037 20.9413 27.6689C19.4005 28.3341 17.7542 28.6666 16.0022 28.6666Z",fill:"currentColor"})})]})}),TextType=()=>{const tt=useSelectedNode();return jsxRuntimeExports.jsx(Flex,{align:"center",justify:"center",p:12,children:jsxRuntimeExports.jsx(Text$4,{color:"primaryText1",kind:"regular",children:tt==null?void 0:tt.text})})};function cc(tt){if(typeof tt=="string"||typeof tt=="number")return""+tt;let et="";if(Array.isArray(tt))for(let nt=0,it;nt{const nt=createStore$3(tt),it=(rt,ot=et)=>useStoreWithEqualityFn(nt,rt,ot);return Object.assign(it,nt),it},createWithEqualityFn=(tt,et)=>tt?createWithEqualityFnImpl(tt,et):createWithEqualityFnImpl;function shallow$1(tt,et){if(Object.is(tt,et))return!0;if(typeof tt!="object"||tt===null||typeof et!="object"||et===null)return!1;if(tt instanceof Map&&et instanceof Map){if(tt.size!==et.size)return!1;for(const[it,rt]of tt)if(!Object.is(rt,et.get(it)))return!1;return!0}if(tt instanceof Set&&et instanceof Set){if(tt.size!==et.size)return!1;for(const it of tt)if(!et.has(it))return!1;return!0}const nt=Object.keys(tt);if(nt.length!==Object.keys(et).length)return!1;for(let it=0;it=0&&(et=tt.slice(0,nt))!=="xmlns"&&(tt=tt.slice(nt+1)),namespaces.hasOwnProperty(et)?{space:namespaces[et],local:tt}:tt}function creatorInherit(tt){return function(){var et=this.ownerDocument,nt=this.namespaceURI;return nt===xhtml&&et.documentElement.namespaceURI===xhtml?et.createElement(tt):et.createElementNS(nt,tt)}}function creatorFixed(tt){return function(){return this.ownerDocument.createElementNS(tt.space,tt.local)}}function creator(tt){var et=namespace(tt);return(et.local?creatorFixed:creatorInherit)(et)}function none(){}function selector(tt){return tt==null?none:function(){return this.querySelector(tt)}}function selection_select(tt){typeof tt!="function"&&(tt=selector(tt));for(var et=this._groups,nt=et.length,it=new Array(nt),rt=0;rt=vt&&(vt=wt+1);!(St=bt[vt])&&++vt=0;)(at=it[rt])&&(ot&&at.compareDocumentPosition(ot)^4&&ot.parentNode.insertBefore(at,ot),ot=at);return this}function selection_sort(tt){tt||(tt=ascending);function et(ht,dt){return ht&&dt?tt(ht.__data__,dt.__data__):!ht-!dt}for(var nt=this._groups,it=nt.length,rt=new Array(it),ot=0;otet?1:tt>=et?0:NaN}function selection_call(){var tt=arguments[0];return arguments[0]=this,tt.apply(null,arguments),this}function selection_nodes(){return Array.from(this)}function selection_node(){for(var tt=this._groups,et=0,nt=tt.length;et1?this.each((et==null?styleRemove$1:typeof et=="function"?styleFunction$1:styleConstant$1)(tt,et,nt??"")):styleValue(this.node(),tt)}function styleValue(tt,et){return tt.style.getPropertyValue(et)||defaultView(tt).getComputedStyle(tt,null).getPropertyValue(et)}function propertyRemove(tt){return function(){delete this[tt]}}function propertyConstant(tt,et){return function(){this[tt]=et}}function propertyFunction(tt,et){return function(){var nt=et.apply(this,arguments);nt==null?delete this[tt]:this[tt]=nt}}function selection_property(tt,et){return arguments.length>1?this.each((et==null?propertyRemove:typeof et=="function"?propertyFunction:propertyConstant)(tt,et)):this.node()[tt]}function classArray(tt){return tt.trim().split(/^|\s+/)}function classList(tt){return tt.classList||new ClassList(tt)}function ClassList(tt){this._node=tt,this._names=classArray(tt.getAttribute("class")||"")}ClassList.prototype={add:function(tt){var et=this._names.indexOf(tt);et<0&&(this._names.push(tt),this._node.setAttribute("class",this._names.join(" ")))},remove:function(tt){var et=this._names.indexOf(tt);et>=0&&(this._names.splice(et,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(tt){return this._names.indexOf(tt)>=0}};function classedAdd(tt,et){for(var nt=classList(tt),it=-1,rt=et.length;++it=0&&(nt=et.slice(it+1),et=et.slice(0,it)),{type:et,name:nt}})}function onRemove(tt){return function(){var et=this.__on;if(et){for(var nt=0,it=-1,rt=et.length,ot;nt()=>tt;function DragEvent(tt,{sourceEvent:et,subject:nt,target:it,identifier:rt,active:ot,x:at,y:st,dx:lt,dy:ct,dispatch:ut}){Object.defineProperties(this,{type:{value:tt,enumerable:!0,configurable:!0},sourceEvent:{value:et,enumerable:!0,configurable:!0},subject:{value:nt,enumerable:!0,configurable:!0},target:{value:it,enumerable:!0,configurable:!0},identifier:{value:rt,enumerable:!0,configurable:!0},active:{value:ot,enumerable:!0,configurable:!0},x:{value:at,enumerable:!0,configurable:!0},y:{value:st,enumerable:!0,configurable:!0},dx:{value:lt,enumerable:!0,configurable:!0},dy:{value:ct,enumerable:!0,configurable:!0},_:{value:ut}})}DragEvent.prototype.on=function(){var tt=this._.on.apply(this._,arguments);return tt===this._?this:tt};function defaultFilter$1(tt){return!tt.ctrlKey&&!tt.button}function defaultContainer(){return this.parentNode}function defaultSubject(tt,et){return et??{x:tt.x,y:tt.y}}function defaultTouchable$1(){return navigator.maxTouchPoints||"ontouchstart"in this}function drag(){var tt=defaultFilter$1,et=defaultContainer,nt=defaultSubject,it=defaultTouchable$1,rt={},ot=dispatch("start","drag","end"),at=0,st,lt,ct,ut,ht=0;function dt(xt){xt.on("mousedown.drag",pt).filter(it).on("touchstart.drag",bt).on("touchmove.drag",yt,nonpassive).on("touchend.drag touchcancel.drag",wt).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function pt(xt,St){if(!(ut||!tt.call(this,xt,St))){var Et=vt(this,et.call(this,xt,St),xt,St,"mouse");Et&&(select(xt.view).on("mousemove.drag",mt,nonpassivecapture).on("mouseup.drag",gt,nonpassivecapture),dragDisable(xt.view),nopropagation$1(xt),ct=!1,st=xt.clientX,lt=xt.clientY,Et("start",xt))}}function mt(xt){if(noevent$1(xt),!ct){var St=xt.clientX-st,Et=xt.clientY-lt;ct=St*St+Et*Et>ht}rt.mouse("drag",xt)}function gt(xt){select(xt.view).on("mousemove.drag mouseup.drag",null),yesdrag(xt.view,ct),noevent$1(xt),rt.mouse("end",xt)}function bt(xt,St){if(tt.call(this,xt,St)){var Et=xt.changedTouches,It=et.call(this,xt,St),Tt=Et.length,$t,Ut;for($t=0;$tCREATED)throw new Error("too late; already scheduled");return nt}function set(tt,et){var nt=get(tt,et);if(nt.state>STARTED)throw new Error("too late; already running");return nt}function get(tt,et){var nt=tt.__transition;if(!nt||!(nt=nt[et]))throw new Error("transition not found");return nt}function create$1(tt,et,nt){var it=tt.__transition,rt;it[et]=nt,nt.timer=timer$1(ot,0,nt.time);function ot(ct){nt.state=SCHEDULED,nt.timer.restart(at,nt.delay,nt.time),nt.delay<=ct&&at(ct-nt.delay)}function at(ct){var ut,ht,dt,pt;if(nt.state!==SCHEDULED)return lt();for(ut in it)if(pt=it[ut],pt.name===nt.name){if(pt.state===STARTED)return timeout(at);pt.state===RUNNING?(pt.state=ENDED,pt.timer.stop(),pt.on.call("interrupt",tt,tt.__data__,pt.index,pt.group),delete it[ut]):+utSTARTING&&it.state=0&&(et=et.slice(0,nt)),!et||et==="start"})}function onFunction(tt,et,nt){var it,rt,ot=start(et)?init:set;return function(){var at=ot(this,tt),st=at.on;st!==it&&(rt=(it=st).copy()).on(et,nt),at.on=rt}}function transition_on(tt,et){var nt=this._id;return arguments.length<2?get(this.node(),nt).on.on(tt):this.each(onFunction(nt,tt,et))}function removeFunction(tt){return function(){var et=this.parentNode;for(var nt in this.__transition)if(+nt!==tt)return;et&&et.removeChild(this)}}function transition_remove(){return this.on("end.remove",removeFunction(this._id))}function transition_select(tt){var et=this._name,nt=this._id;typeof tt!="function"&&(tt=selector(tt));for(var it=this._groups,rt=it.length,ot=new Array(rt),at=0;at()=>tt;function ZoomEvent(tt,{sourceEvent:et,target:nt,transform:it,dispatch:rt}){Object.defineProperties(this,{type:{value:tt,enumerable:!0,configurable:!0},sourceEvent:{value:et,enumerable:!0,configurable:!0},target:{value:nt,enumerable:!0,configurable:!0},transform:{value:it,enumerable:!0,configurable:!0},_:{value:rt}})}function Transform(tt,et,nt){this.k=tt,this.x=et,this.y=nt}Transform.prototype={constructor:Transform,scale:function(tt){return tt===1?this:new Transform(this.k*tt,this.x,this.y)},translate:function(tt,et){return tt===0&et===0?this:new Transform(this.k,this.x+this.k*tt,this.y+this.k*et)},apply:function(tt){return[tt[0]*this.k+this.x,tt[1]*this.k+this.y]},applyX:function(tt){return tt*this.k+this.x},applyY:function(tt){return tt*this.k+this.y},invert:function(tt){return[(tt[0]-this.x)/this.k,(tt[1]-this.y)/this.k]},invertX:function(tt){return(tt-this.x)/this.k},invertY:function(tt){return(tt-this.y)/this.k},rescaleX:function(tt){return tt.copy().domain(tt.range().map(this.invertX,this).map(tt.invert,tt))},rescaleY:function(tt){return tt.copy().domain(tt.range().map(this.invertY,this).map(tt.invert,tt))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var identity=new Transform(1,0,0);Transform.prototype;function nopropagation(tt){tt.stopImmediatePropagation()}function noevent(tt){tt.preventDefault(),tt.stopImmediatePropagation()}function defaultFilter(tt){return(!tt.ctrlKey||tt.type==="wheel")&&!tt.button}function defaultExtent(){var tt=this;return tt instanceof SVGElement?(tt=tt.ownerSVGElement||tt,tt.hasAttribute("viewBox")?(tt=tt.viewBox.baseVal,[[tt.x,tt.y],[tt.x+tt.width,tt.y+tt.height]]):[[0,0],[tt.width.baseVal.value,tt.height.baseVal.value]]):[[0,0],[tt.clientWidth,tt.clientHeight]]}function defaultTransform(){return this.__zoom||identity}function defaultWheelDelta(tt){return-tt.deltaY*(tt.deltaMode===1?.05:tt.deltaMode?1:.002)*(tt.ctrlKey?10:1)}function defaultTouchable(){return navigator.maxTouchPoints||"ontouchstart"in this}function defaultConstrain(tt,et,nt){var it=tt.invertX(et[0][0])-nt[0][0],rt=tt.invertX(et[1][0])-nt[1][0],ot=tt.invertY(et[0][1])-nt[0][1],at=tt.invertY(et[1][1])-nt[1][1];return tt.translate(rt>it?(it+rt)/2:Math.min(0,it)||Math.max(0,rt),at>ot?(ot+at)/2:Math.min(0,ot)||Math.max(0,at))}function zoom(){var tt=defaultFilter,et=defaultExtent,nt=defaultConstrain,it=defaultWheelDelta,rt=defaultTouchable,ot=[0,1/0],at=[[-1/0,-1/0],[1/0,1/0]],st=250,lt=interpolateZoom,ct=dispatch("start","zoom","end"),ut,ht,dt,pt=500,mt=150,gt=0,bt=10;function yt(kt){kt.property("__zoom",defaultTransform).on("wheel.zoom",Tt,{passive:!1}).on("mousedown.zoom",$t).on("dblclick.zoom",Ut).filter(rt).on("touchstart.zoom",Lt).on("touchmove.zoom",Bt).on("touchend.zoom touchcancel.zoom",Pt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}yt.transform=function(kt,At,Rt,Wt){var jt=kt.selection?kt.selection():kt;jt.property("__zoom",defaultTransform),kt!==jt?St(kt,At,Rt,Wt):jt.interrupt().each(function(){Et(this,arguments).event(Wt).start().zoom(null,typeof At=="function"?At.apply(this,arguments):At).end()})},yt.scaleBy=function(kt,At,Rt,Wt){yt.scaleTo(kt,function(){var jt=this.__zoom.k,Ot=typeof At=="function"?At.apply(this,arguments):At;return jt*Ot},Rt,Wt)},yt.scaleTo=function(kt,At,Rt,Wt){yt.transform(kt,function(){var jt=et.apply(this,arguments),Ot=this.__zoom,Ct=Rt==null?xt(jt):typeof Rt=="function"?Rt.apply(this,arguments):Rt,Dt=Ot.invert(Ct),Mt=typeof At=="function"?At.apply(this,arguments):At;return nt(vt(wt(Ot,Mt),Ct,Dt),jt,at)},Rt,Wt)},yt.translateBy=function(kt,At,Rt,Wt){yt.transform(kt,function(){return nt(this.__zoom.translate(typeof At=="function"?At.apply(this,arguments):At,typeof Rt=="function"?Rt.apply(this,arguments):Rt),et.apply(this,arguments),at)},null,Wt)},yt.translateTo=function(kt,At,Rt,Wt,jt){yt.transform(kt,function(){var Ot=et.apply(this,arguments),Ct=this.__zoom,Dt=Wt==null?xt(Ot):typeof Wt=="function"?Wt.apply(this,arguments):Wt;return nt(identity.translate(Dt[0],Dt[1]).scale(Ct.k).translate(typeof At=="function"?-At.apply(this,arguments):-At,typeof Rt=="function"?-Rt.apply(this,arguments):-Rt),Ot,at)},Wt,jt)};function wt(kt,At){return At=Math.max(ot[0],Math.min(ot[1],At)),At===kt.k?kt:new Transform(At,kt.x,kt.y)}function vt(kt,At,Rt){var Wt=At[0]-Rt[0]*kt.k,jt=At[1]-Rt[1]*kt.k;return Wt===kt.x&&jt===kt.y?kt:new Transform(kt.k,Wt,jt)}function xt(kt){return[(+kt[0][0]+ +kt[1][0])/2,(+kt[0][1]+ +kt[1][1])/2]}function St(kt,At,Rt,Wt){kt.on("start.zoom",function(){Et(this,arguments).event(Wt).start()}).on("interrupt.zoom end.zoom",function(){Et(this,arguments).event(Wt).end()}).tween("zoom",function(){var jt=this,Ot=arguments,Ct=Et(jt,Ot).event(Wt),Dt=et.apply(jt,Ot),Mt=Rt==null?xt(Dt):typeof Rt=="function"?Rt.apply(jt,Ot):Rt,Vt=Math.max(Dt[1][0]-Dt[0][0],Dt[1][1]-Dt[0][1]),Qt=jt.__zoom,rn=typeof At=="function"?At.apply(jt,Ot):At,Xt=lt(Qt.invert(Mt).concat(Vt/Qt.k),rn.invert(Mt).concat(Vt/rn.k));return function(an){if(an===1)an=rn;else{var tn=Xt(an),pn=Vt/tn[2];an=new Transform(pn,Mt[0]-tn[0]*pn,Mt[1]-tn[1]*pn)}Ct.zoom(null,an)}})}function Et(kt,At,Rt){return!Rt&&kt.__zooming||new It(kt,At)}function It(kt,At){this.that=kt,this.args=At,this.active=0,this.sourceEvent=null,this.extent=et.apply(kt,At),this.taps=0}It.prototype={event:function(kt){return kt&&(this.sourceEvent=kt),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(kt,At){return this.mouse&&kt!=="mouse"&&(this.mouse[1]=At.invert(this.mouse[0])),this.touch0&&kt!=="touch"&&(this.touch0[1]=At.invert(this.touch0[0])),this.touch1&&kt!=="touch"&&(this.touch1[1]=At.invert(this.touch1[0])),this.that.__zoom=At,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(kt){var At=select(this.that).datum();ct.call(kt,this.that,new ZoomEvent(kt,{sourceEvent:this.sourceEvent,target:yt,type:kt,transform:this.that.__zoom,dispatch:ct}),At)}};function Tt(kt,...At){if(!tt.apply(this,arguments))return;var Rt=Et(this,At).event(kt),Wt=this.__zoom,jt=Math.max(ot[0],Math.min(ot[1],Wt.k*Math.pow(2,it.apply(this,arguments)))),Ot=pointer(kt);if(Rt.wheel)(Rt.mouse[0][0]!==Ot[0]||Rt.mouse[0][1]!==Ot[1])&&(Rt.mouse[1]=Wt.invert(Rt.mouse[0]=Ot)),clearTimeout(Rt.wheel);else{if(Wt.k===jt)return;Rt.mouse=[Ot,Wt.invert(Ot)],interrupt(this),Rt.start()}noevent(kt),Rt.wheel=setTimeout(Ct,mt),Rt.zoom("mouse",nt(vt(wt(Wt,jt),Rt.mouse[0],Rt.mouse[1]),Rt.extent,at));function Ct(){Rt.wheel=null,Rt.end()}}function $t(kt,...At){if(dt||!tt.apply(this,arguments))return;var Rt=kt.currentTarget,Wt=Et(this,At,!0).event(kt),jt=select(kt.view).on("mousemove.zoom",Mt,!0).on("mouseup.zoom",Vt,!0),Ot=pointer(kt,Rt),Ct=kt.clientX,Dt=kt.clientY;dragDisable(kt.view),nopropagation(kt),Wt.mouse=[Ot,this.__zoom.invert(Ot)],interrupt(this),Wt.start();function Mt(Qt){if(noevent(Qt),!Wt.moved){var rn=Qt.clientX-Ct,Xt=Qt.clientY-Dt;Wt.moved=rn*rn+Xt*Xt>gt}Wt.event(Qt).zoom("mouse",nt(vt(Wt.that.__zoom,Wt.mouse[0]=pointer(Qt,Rt),Wt.mouse[1]),Wt.extent,at))}function Vt(Qt){jt.on("mousemove.zoom mouseup.zoom",null),yesdrag(Qt.view,Wt.moved),noevent(Qt),Wt.event(Qt).end()}}function Ut(kt,...At){if(tt.apply(this,arguments)){var Rt=this.__zoom,Wt=pointer(kt.changedTouches?kt.changedTouches[0]:kt,this),jt=Rt.invert(Wt),Ot=Rt.k*(kt.shiftKey?.5:2),Ct=nt(vt(wt(Rt,Ot),Wt,jt),et.apply(this,At),at);noevent(kt),st>0?select(this).transition().duration(st).call(St,Ct,Wt,kt):select(this).call(yt.transform,Ct,Wt,kt)}}function Lt(kt,...At){if(tt.apply(this,arguments)){var Rt=kt.touches,Wt=Rt.length,jt=Et(this,At,kt.changedTouches.length===Wt).event(kt),Ot,Ct,Dt,Mt;for(nopropagation(kt),Ct=0;Ct"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:tt=>`Node type "${tt}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:tt=>`The old edge with id=${tt} does not exist.`,error009:tt=>`Marker type "${tt}" doesn't exist.`,error008:(tt,et)=>`Couldn't create edge for ${tt?"target":"source"} handle id: "${tt?et.targetHandle:et.sourceHandle}", edge id: ${et.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:tt=>`Edge type "${tt}" not found. Using fallback type "default".`,error012:tt=>`Node with id "${tt}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},zustandErrorMessage=errorMessages.error001();function useStore(tt,et){const nt=reactExports.useContext(StoreContext);if(nt===null)throw new Error(zustandErrorMessage);return useStoreWithEqualityFn(nt,tt,et)}const useStoreApi=()=>{const tt=reactExports.useContext(StoreContext);if(tt===null)throw new Error(zustandErrorMessage);return reactExports.useMemo(()=>({getState:tt.getState,setState:tt.setState,subscribe:tt.subscribe,destroy:tt.destroy}),[tt])},selector$g=tt=>tt.userSelectionActive?"none":"all";function Panel({position:tt,children:et,className:nt,style:it,...rt}){const ot=useStore(selector$g),at=`${tt}`.split("-");return React$1.createElement("div",{className:cc(["react-flow__panel",nt,...at]),style:{...it,pointerEvents:ot},...rt},et)}function Attribution({proOptions:tt,position:et="bottom-right"}){return tt!=null&&tt.hideAttribution?null:React$1.createElement(Panel,{position:et,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},React$1.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const EdgeText=({x:tt,y:et,label:nt,labelStyle:it={},labelShowBg:rt=!0,labelBgStyle:ot={},labelBgPadding:at=[2,4],labelBgBorderRadius:st=2,children:lt,className:ct,...ut})=>{const ht=reactExports.useRef(null),[dt,pt]=reactExports.useState({x:0,y:0,width:0,height:0}),mt=cc(["react-flow__edge-textwrapper",ct]);return reactExports.useEffect(()=>{if(ht.current){const gt=ht.current.getBBox();pt({x:gt.x,y:gt.y,width:gt.width,height:gt.height})}},[nt]),typeof nt>"u"||!nt?null:React$1.createElement("g",{transform:`translate(${tt-dt.width/2} ${et-dt.height/2})`,className:mt,visibility:dt.width?"visible":"hidden",...ut},rt&&React$1.createElement("rect",{width:dt.width+2*at[0],x:-at[0],y:-at[1],height:dt.height+2*at[1],className:"react-flow__edge-textbg",style:ot,rx:st,ry:st}),React$1.createElement("text",{className:"react-flow__edge-text",y:dt.height/2,dy:"0.3em",ref:ht,style:it},nt),lt)};var EdgeText$1=reactExports.memo(EdgeText);const getDimensions=tt=>({width:tt.offsetWidth,height:tt.offsetHeight}),clamp=(tt,et=0,nt=1)=>Math.min(Math.max(tt,et),nt),clampPosition=(tt={x:0,y:0},et)=>({x:clamp(tt.x,et[0][0],et[1][0]),y:clamp(tt.y,et[0][1],et[1][1])}),calcAutoPanVelocity=(tt,et,nt)=>ttnt?-clamp(Math.abs(tt-nt),1,50)/50:0,calcAutoPan=(tt,et)=>{const nt=calcAutoPanVelocity(tt.x,35,et.width-35)*20,it=calcAutoPanVelocity(tt.y,35,et.height-35)*20;return[nt,it]},getHostForElement=tt=>{var et;return((et=tt.getRootNode)==null?void 0:et.call(tt))||(window==null?void 0:window.document)},getBoundsOfBoxes=(tt,et)=>({x:Math.min(tt.x,et.x),y:Math.min(tt.y,et.y),x2:Math.max(tt.x2,et.x2),y2:Math.max(tt.y2,et.y2)}),rectToBox=({x:tt,y:et,width:nt,height:it})=>({x:tt,y:et,x2:tt+nt,y2:et+it}),boxToRect=({x:tt,y:et,x2:nt,y2:it})=>({x:tt,y:et,width:nt-tt,height:it-et}),nodeToRect=tt=>({...tt.positionAbsolute||{x:0,y:0},width:tt.width||0,height:tt.height||0}),getOverlappingArea=(tt,et)=>{const nt=Math.max(0,Math.min(tt.x+tt.width,et.x+et.width)-Math.max(tt.x,et.x)),it=Math.max(0,Math.min(tt.y+tt.height,et.y+et.height)-Math.max(tt.y,et.y));return Math.ceil(nt*it)},isRectObject=tt=>isNumeric(tt.width)&&isNumeric(tt.height)&&isNumeric(tt.x)&&isNumeric(tt.y),isNumeric=tt=>!isNaN(tt)&&isFinite(tt),internalsSymbol=Symbol.for("internals"),elementSelectionKeys=["Enter"," ","Escape"],devWarn=(tt,et)=>{},isReactKeyboardEvent=tt=>"nativeEvent"in tt;function isInputDOMNode(tt){var rt,ot;const et=isReactKeyboardEvent(tt)?tt.nativeEvent:tt,nt=((ot=(rt=et.composedPath)==null?void 0:rt.call(et))==null?void 0:ot[0])||tt.target;return["INPUT","SELECT","TEXTAREA"].includes(nt==null?void 0:nt.nodeName)||(nt==null?void 0:nt.hasAttribute("contenteditable"))||!!(nt!=null&&nt.closest(".nokey"))}const isMouseEvent=tt=>"clientX"in tt,getEventPosition=(tt,et)=>{var ot,at;const nt=isMouseEvent(tt),it=nt?tt.clientX:(ot=tt.touches)==null?void 0:ot[0].clientX,rt=nt?tt.clientY:(at=tt.touches)==null?void 0:at[0].clientY;return{x:it-((et==null?void 0:et.left)??0),y:rt-((et==null?void 0:et.top)??0)}},isMacOs=()=>{var tt;return typeof navigator<"u"&&((tt=navigator==null?void 0:navigator.userAgent)==null?void 0:tt.indexOf("Mac"))>=0},BaseEdge=({id:tt,path:et,labelX:nt,labelY:it,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt=20})=>React$1.createElement(React$1.Fragment,null,React$1.createElement("path",{id:tt,style:ut,d:et,fill:"none",className:"react-flow__edge-path",markerEnd:ht,markerStart:dt}),pt&&React$1.createElement("path",{d:et,fill:"none",strokeOpacity:0,strokeWidth:pt,className:"react-flow__edge-interaction"}),rt&&isNumeric(nt)&&isNumeric(it)?React$1.createElement(EdgeText$1,{x:nt,y:it,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct}):null);BaseEdge.displayName="BaseEdge";function getMouseHandler$1(tt,et,nt){return nt===void 0?nt:it=>{const rt=et().edges.find(ot=>ot.id===tt);rt&&nt(it,{...rt})}}function getEdgeCenter({sourceX:tt,sourceY:et,targetX:nt,targetY:it}){const rt=Math.abs(nt-tt)/2,ot=nt{const[bt,yt,wt]=getSimpleBezierPath({sourceX:tt,sourceY:et,sourcePosition:rt,targetX:nt,targetY:it,targetPosition:ot});return React$1.createElement(BaseEdge,{path:bt,labelX:yt,labelY:wt,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,interactionWidth:gt})});SimpleBezierEdge.displayName="SimpleBezierEdge";const handleDirections={[Position.Left]:{x:-1,y:0},[Position.Right]:{x:1,y:0},[Position.Top]:{x:0,y:-1},[Position.Bottom]:{x:0,y:1}},getDirection=({source:tt,sourcePosition:et=Position.Bottom,target:nt})=>et===Position.Left||et===Position.Right?tt.xMath.sqrt(Math.pow(et.x-tt.x,2)+Math.pow(et.y-tt.y,2));function getPoints({source:tt,sourcePosition:et=Position.Bottom,target:nt,targetPosition:it=Position.Top,center:rt,offset:ot}){const at=handleDirections[et],st=handleDirections[it],lt={x:tt.x+at.x*ot,y:tt.y+at.y*ot},ct={x:nt.x+st.x*ot,y:nt.y+st.y*ot},ut=getDirection({source:lt,sourcePosition:et,target:ct}),ht=ut.x!==0?"x":"y",dt=ut[ht];let pt=[],mt,gt;const bt={x:0,y:0},yt={x:0,y:0},[wt,vt,xt,St]=getEdgeCenter({sourceX:tt.x,sourceY:tt.y,targetX:nt.x,targetY:nt.y});if(at[ht]*st[ht]===-1){mt=rt.x||wt,gt=rt.y||vt;const It=[{x:mt,y:lt.y},{x:mt,y:ct.y}],Tt=[{x:lt.x,y:gt},{x:ct.x,y:gt}];at[ht]===dt?pt=ht==="x"?It:Tt:pt=ht==="x"?Tt:It}else{const It=[{x:lt.x,y:ct.y}],Tt=[{x:ct.x,y:lt.y}];if(ht==="x"?pt=at.x===dt?Tt:It:pt=at.y===dt?It:Tt,et===it){const Pt=Math.abs(tt[ht]-nt[ht]);if(Pt<=ot){const kt=Math.min(ot-1,ot-Pt);at[ht]===dt?bt[ht]=(lt[ht]>tt[ht]?-1:1)*kt:yt[ht]=(ct[ht]>nt[ht]?-1:1)*kt}}if(et!==it){const Pt=ht==="x"?"y":"x",kt=at[ht]===st[Pt],At=lt[Pt]>ct[Pt],Rt=lt[Pt]=Bt?(mt=($t.x+Ut.x)/2,gt=pt[0].y):(mt=pt[0].x,gt=($t.y+Ut.y)/2)}return[[tt,{x:lt.x+bt.x,y:lt.y+bt.y},...pt,{x:ct.x+yt.x,y:ct.y+yt.y},nt],mt,gt,xt,St]}function getBend(tt,et,nt,it){const rt=Math.min(distance(tt,et)/2,distance(et,nt)/2,it),{x:ot,y:at}=et;if(tt.x===ot&&ot===nt.x||tt.y===at&&at===nt.y)return`L${ot} ${at}`;if(tt.y===at){const ct=tt.x{let vt="";return wt>0&&wt{const[yt,wt,vt]=getSmoothStepPath({sourceX:tt,sourceY:et,sourcePosition:ht,targetX:nt,targetY:it,targetPosition:dt,borderRadius:gt==null?void 0:gt.borderRadius,offset:gt==null?void 0:gt.offset});return React$1.createElement(BaseEdge,{path:yt,labelX:wt,labelY:vt,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:pt,markerStart:mt,interactionWidth:bt})});SmoothStepEdge.displayName="SmoothStepEdge";const StepEdge=reactExports.memo(tt=>{var et;return React$1.createElement(SmoothStepEdge,{...tt,pathOptions:reactExports.useMemo(()=>{var nt;return{borderRadius:0,offset:(nt=tt.pathOptions)==null?void 0:nt.offset}},[(et=tt.pathOptions)==null?void 0:et.offset])})});StepEdge.displayName="StepEdge";function getStraightPath({sourceX:tt,sourceY:et,targetX:nt,targetY:it}){const[rt,ot,at,st]=getEdgeCenter({sourceX:tt,sourceY:et,targetX:nt,targetY:it});return[`M ${tt},${et}L ${nt},${it}`,rt,ot,at,st]}const StraightEdge=reactExports.memo(({sourceX:tt,sourceY:et,targetX:nt,targetY:it,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt})=>{const[mt,gt,bt]=getStraightPath({sourceX:tt,sourceY:et,targetX:nt,targetY:it});return React$1.createElement(BaseEdge,{path:mt,labelX:gt,labelY:bt,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt})});StraightEdge.displayName="StraightEdge";function calculateControlOffset(tt,et){return tt>=0?.5*tt:et*25*Math.sqrt(-tt)}function getControlWithCurvature({pos:tt,x1:et,y1:nt,x2:it,y2:rt,c:ot}){switch(tt){case Position.Left:return[et-calculateControlOffset(et-it,ot),nt];case Position.Right:return[et+calculateControlOffset(it-et,ot),nt];case Position.Top:return[et,nt-calculateControlOffset(nt-rt,ot)];case Position.Bottom:return[et,nt+calculateControlOffset(rt-nt,ot)]}}function getBezierPath({sourceX:tt,sourceY:et,sourcePosition:nt=Position.Bottom,targetX:it,targetY:rt,targetPosition:ot=Position.Top,curvature:at=.25}){const[st,lt]=getControlWithCurvature({pos:nt,x1:tt,y1:et,x2:it,y2:rt,c:at}),[ct,ut]=getControlWithCurvature({pos:ot,x1:it,y1:rt,x2:tt,y2:et,c:at}),[ht,dt,pt,mt]=getBezierEdgeCenter({sourceX:tt,sourceY:et,targetX:it,targetY:rt,sourceControlX:st,sourceControlY:lt,targetControlX:ct,targetControlY:ut});return[`M${tt},${et} C${st},${lt} ${ct},${ut} ${it},${rt}`,ht,dt,pt,mt]}const BezierEdge=reactExports.memo(({sourceX:tt,sourceY:et,targetX:nt,targetY:it,sourcePosition:rt=Position.Bottom,targetPosition:ot=Position.Top,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,pathOptions:gt,interactionWidth:bt})=>{const[yt,wt,vt]=getBezierPath({sourceX:tt,sourceY:et,sourcePosition:rt,targetX:nt,targetY:it,targetPosition:ot,curvature:gt==null?void 0:gt.curvature});return React$1.createElement(BaseEdge,{path:yt,labelX:wt,labelY:vt,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,interactionWidth:bt})});BezierEdge.displayName="BezierEdge";const NodeIdContext=reactExports.createContext(null),Provider=NodeIdContext.Provider;NodeIdContext.Consumer;const useNodeId=()=>reactExports.useContext(NodeIdContext),isEdge=tt=>"id"in tt&&"source"in tt&&"target"in tt,getEdgeId=({source:tt,sourceHandle:et,target:nt,targetHandle:it})=>`reactflow__edge-${tt}${et||""}-${nt}${it||""}`,getMarkerId=(tt,et)=>typeof tt>"u"?"":typeof tt=="string"?tt:`${et?`${et}__`:""}${Object.keys(tt).sort().map(it=>`${it}=${tt[it]}`).join("&")}`,connectionExists=(tt,et)=>et.some(nt=>nt.source===tt.source&&nt.target===tt.target&&(nt.sourceHandle===tt.sourceHandle||!nt.sourceHandle&&!tt.sourceHandle)&&(nt.targetHandle===tt.targetHandle||!nt.targetHandle&&!tt.targetHandle)),addEdge=(tt,et)=>{if(!tt.source||!tt.target)return et;let nt;return isEdge(tt)?nt={...tt}:nt={...tt,id:getEdgeId(tt)},connectionExists(nt,et)?et:et.concat(nt)},pointToRendererPoint=({x:tt,y:et},[nt,it,rt],ot,[at,st])=>{const lt={x:(tt-nt)/rt,y:(et-it)/rt};return ot?{x:at*Math.round(lt.x/at),y:st*Math.round(lt.y/st)}:lt},rendererPointToPoint=({x:tt,y:et},[nt,it,rt])=>({x:tt*rt+nt,y:et*rt+it}),getNodePositionWithOrigin=(tt,et=[0,0])=>{if(!tt)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const nt=(tt.width??0)*et[0],it=(tt.height??0)*et[1],rt={x:tt.position.x-nt,y:tt.position.y-it};return{...rt,positionAbsolute:tt.positionAbsolute?{x:tt.positionAbsolute.x-nt,y:tt.positionAbsolute.y-it}:rt}},getNodesBounds=(tt,et=[0,0])=>{if(tt.length===0)return{x:0,y:0,width:0,height:0};const nt=tt.reduce((it,rt)=>{const{x:ot,y:at}=getNodePositionWithOrigin(rt,et).positionAbsolute;return getBoundsOfBoxes(it,rectToBox({x:ot,y:at,width:rt.width||0,height:rt.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return boxToRect(nt)},getNodesInside=(tt,et,[nt,it,rt]=[0,0,1],ot=!1,at=!1,st=[0,0])=>{const lt={x:(et.x-nt)/rt,y:(et.y-it)/rt,width:et.width/rt,height:et.height/rt},ct=[];return tt.forEach(ut=>{const{width:ht,height:dt,selectable:pt=!0,hidden:mt=!1}=ut;if(at&&!pt||mt)return!1;const{positionAbsolute:gt}=getNodePositionWithOrigin(ut,st),bt={x:gt.x,y:gt.y,width:ht||0,height:dt||0},yt=getOverlappingArea(lt,bt),wt=typeof ht>"u"||typeof dt>"u"||ht===null||dt===null,vt=ot&&yt>0,xt=(ht||0)*(dt||0);(wt||vt||yt>=xt||ut.dragging)&&ct.push(ut)}),ct},getConnectedEdges=(tt,et)=>{const nt=tt.map(it=>it.id);return et.filter(it=>nt.includes(it.source)||nt.includes(it.target))},getViewportForBounds=(tt,et,nt,it,rt,ot=.1)=>{const at=et/(tt.width*(1+ot)),st=nt/(tt.height*(1+ot)),lt=Math.min(at,st),ct=clamp(lt,it,rt),ut=tt.x+tt.width/2,ht=tt.y+tt.height/2,dt=et/2-ut*ct,pt=nt/2-ht*ct;return{x:dt,y:pt,zoom:ct}},getD3Transition=(tt,et=0)=>tt.transition().duration(et);function getHandles(tt,et,nt,it){return(et[nt]||[]).reduce((rt,ot)=>{var at,st;return`${tt.id}-${ot.id}-${nt}`!==it&&rt.push({id:ot.id||null,type:nt,nodeId:tt.id,x:(((at=tt.positionAbsolute)==null?void 0:at.x)??0)+ot.x+ot.width/2,y:(((st=tt.positionAbsolute)==null?void 0:st.y)??0)+ot.y+ot.height/2}),rt},[])}function getClosestHandle(tt,et,nt,it,rt,ot){const{x:at,y:st}=getEventPosition(tt),ct=et.elementsFromPoint(at,st).find(mt=>mt.classList.contains("react-flow__handle"));if(ct){const mt=ct.getAttribute("data-nodeid");if(mt){const gt=getHandleType(void 0,ct),bt=ct.getAttribute("data-handleid"),yt=ot({nodeId:mt,id:bt,type:gt});if(yt){const wt=rt.find(vt=>vt.nodeId===mt&&vt.type===gt&&vt.id===bt);return{handle:{id:bt,type:gt,nodeId:mt,x:(wt==null?void 0:wt.x)||nt.x,y:(wt==null?void 0:wt.y)||nt.y},validHandleResult:yt}}}}let ut=[],ht=1/0;if(rt.forEach(mt=>{const gt=Math.sqrt((mt.x-nt.x)**2+(mt.y-nt.y)**2);if(gt<=it){const bt=ot(mt);gt<=ht&&(gtmt.isValid),pt=ut.some(({handle:mt})=>mt.type==="target");return ut.find(({handle:mt,validHandleResult:gt})=>pt?mt.type==="target":dt?gt.isValid:!0)||ut[0]}const nullConnection={source:null,target:null,sourceHandle:null,targetHandle:null},defaultResult=()=>({handleDomNode:null,isValid:!1,connection:nullConnection,endHandle:null});function isValidHandle(tt,et,nt,it,rt,ot,at){const st=rt==="target",lt=at.querySelector(`.react-flow__handle[data-id="${tt==null?void 0:tt.nodeId}-${tt==null?void 0:tt.id}-${tt==null?void 0:tt.type}"]`),ct={...defaultResult(),handleDomNode:lt};if(lt){const ut=getHandleType(void 0,lt),ht=lt.getAttribute("data-nodeid"),dt=lt.getAttribute("data-handleid"),pt=lt.classList.contains("connectable"),mt=lt.classList.contains("connectableend"),gt={source:st?ht:nt,sourceHandle:st?dt:it,target:st?nt:ht,targetHandle:st?it:dt};ct.connection=gt,pt&&mt&&(et===ConnectionMode.Strict?st&&ut==="source"||!st&&ut==="target":ht!==nt||dt!==it)&&(ct.endHandle={nodeId:ht,handleId:dt,type:ut},ct.isValid=ot(gt))}return ct}function getHandleLookup({nodes:tt,nodeId:et,handleId:nt,handleType:it}){return tt.reduce((rt,ot)=>{if(ot[internalsSymbol]){const{handleBounds:at}=ot[internalsSymbol];let st=[],lt=[];at&&(st=getHandles(ot,at,"source",`${et}-${nt}-${it}`),lt=getHandles(ot,at,"target",`${et}-${nt}-${it}`)),rt.push(...st,...lt)}return rt},[])}function getHandleType(tt,et){return tt||(et!=null&&et.classList.contains("target")?"target":et!=null&&et.classList.contains("source")?"source":null)}function resetRecentHandle(tt){tt==null||tt.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function getConnectionStatus(tt,et){let nt=null;return et?nt="valid":tt&&!et&&(nt="invalid"),nt}function handlePointerDown({event:tt,handleId:et,nodeId:nt,onConnect:it,isTarget:rt,getState:ot,setState:at,isValidConnection:st,edgeUpdaterType:lt,onEdgeUpdateEnd:ct}){const ut=getHostForElement(tt.target),{connectionMode:ht,domNode:dt,autoPanOnConnect:pt,connectionRadius:mt,onConnectStart:gt,panBy:bt,getNodes:yt,cancelConnection:wt}=ot();let vt=0,xt;const{x:St,y:Et}=getEventPosition(tt),It=ut==null?void 0:ut.elementFromPoint(St,Et),Tt=getHandleType(lt,It),$t=dt==null?void 0:dt.getBoundingClientRect();if(!$t||!Tt)return;let Ut,Lt=getEventPosition(tt,$t),Bt=!1,Pt=null,kt=!1,At=null;const Rt=getHandleLookup({nodes:yt(),nodeId:nt,handleId:et,handleType:Tt}),Wt=()=>{if(!pt)return;const[Ct,Dt]=calcAutoPan(Lt,$t);bt({x:Ct,y:Dt}),vt=requestAnimationFrame(Wt)};at({connectionPosition:Lt,connectionStatus:null,connectionNodeId:nt,connectionHandleId:et,connectionHandleType:Tt,connectionStartHandle:{nodeId:nt,handleId:et,type:Tt},connectionEndHandle:null}),gt==null||gt(tt,{nodeId:nt,handleId:et,handleType:Tt});function jt(Ct){const{transform:Dt}=ot();Lt=getEventPosition(Ct,$t);const{handle:Mt,validHandleResult:Vt}=getClosestHandle(Ct,ut,pointToRendererPoint(Lt,Dt,!1,[1,1]),mt,Rt,Qt=>isValidHandle(Qt,ht,nt,et,rt?"target":"source",st,ut));if(xt=Mt,Bt||(Wt(),Bt=!0),At=Vt.handleDomNode,Pt=Vt.connection,kt=Vt.isValid,at({connectionPosition:xt&&kt?rendererPointToPoint({x:xt.x,y:xt.y},Dt):Lt,connectionStatus:getConnectionStatus(!!xt,kt),connectionEndHandle:Vt.endHandle}),!xt&&!kt&&!At)return resetRecentHandle(Ut);Pt.source!==Pt.target&&At&&(resetRecentHandle(Ut),Ut=At,At.classList.add("connecting","react-flow__handle-connecting"),At.classList.toggle("valid",kt),At.classList.toggle("react-flow__handle-valid",kt))}function Ot(Ct){var Dt,Mt;(xt||At)&&Pt&&kt&&(it==null||it(Pt)),(Mt=(Dt=ot()).onConnectEnd)==null||Mt.call(Dt,Ct),lt&&(ct==null||ct(Ct)),resetRecentHandle(Ut),wt(),cancelAnimationFrame(vt),Bt=!1,kt=!1,Pt=null,At=null,ut.removeEventListener("mousemove",jt),ut.removeEventListener("mouseup",Ot),ut.removeEventListener("touchmove",jt),ut.removeEventListener("touchend",Ot)}ut.addEventListener("mousemove",jt),ut.addEventListener("mouseup",Ot),ut.addEventListener("touchmove",jt),ut.addEventListener("touchend",Ot)}const alwaysValid=()=>!0,selector$f=tt=>({connectionStartHandle:tt.connectionStartHandle,connectOnClick:tt.connectOnClick,noPanClassName:tt.noPanClassName}),connectingSelector=(tt,et,nt)=>it=>{const{connectionStartHandle:rt,connectionEndHandle:ot,connectionClickStartHandle:at}=it;return{connecting:(rt==null?void 0:rt.nodeId)===tt&&(rt==null?void 0:rt.handleId)===et&&(rt==null?void 0:rt.type)===nt||(ot==null?void 0:ot.nodeId)===tt&&(ot==null?void 0:ot.handleId)===et&&(ot==null?void 0:ot.type)===nt,clickConnecting:(at==null?void 0:at.nodeId)===tt&&(at==null?void 0:at.handleId)===et&&(at==null?void 0:at.type)===nt}},Handle=reactExports.forwardRef(({type:tt="source",position:et=Position.Top,isValidConnection:nt,isConnectable:it=!0,isConnectableStart:rt=!0,isConnectableEnd:ot=!0,id:at,onConnect:st,children:lt,className:ct,onMouseDown:ut,onTouchStart:ht,...dt},pt)=>{var $t,Ut;const mt=at||null,gt=tt==="target",bt=useStoreApi(),yt=useNodeId(),{connectOnClick:wt,noPanClassName:vt}=useStore(selector$f,shallow$1),{connecting:xt,clickConnecting:St}=useStore(connectingSelector(yt,mt,tt),shallow$1);yt||(Ut=($t=bt.getState()).onError)==null||Ut.call($t,"010",errorMessages.error010());const Et=Lt=>{const{defaultEdgeOptions:Bt,onConnect:Pt,hasDefaultEdges:kt}=bt.getState(),At={...Bt,...Lt};if(kt){const{edges:Rt,setEdges:Wt}=bt.getState();Wt(addEdge(At,Rt))}Pt==null||Pt(At),st==null||st(At)},It=Lt=>{if(!yt)return;const Bt=isMouseEvent(Lt);rt&&(Bt&&Lt.button===0||!Bt)&&handlePointerDown({event:Lt,handleId:mt,nodeId:yt,onConnect:Et,isTarget:gt,getState:bt.getState,setState:bt.setState,isValidConnection:nt||bt.getState().isValidConnection||alwaysValid}),Bt?ut==null||ut(Lt):ht==null||ht(Lt)},Tt=Lt=>{const{onClickConnectStart:Bt,onClickConnectEnd:Pt,connectionClickStartHandle:kt,connectionMode:At,isValidConnection:Rt}=bt.getState();if(!yt||!kt&&!rt)return;if(!kt){Bt==null||Bt(Lt,{nodeId:yt,handleId:mt,handleType:tt}),bt.setState({connectionClickStartHandle:{nodeId:yt,type:tt,handleId:mt}});return}const Wt=getHostForElement(Lt.target),jt=nt||Rt||alwaysValid,{connection:Ot,isValid:Ct}=isValidHandle({nodeId:yt,id:mt,type:tt},At,kt.nodeId,kt.handleId||null,kt.type,jt,Wt);Ct&&Et(Ot),Pt==null||Pt(Lt),bt.setState({connectionClickStartHandle:null})};return React$1.createElement("div",{"data-handleid":mt,"data-nodeid":yt,"data-handlepos":et,"data-id":`${yt}-${mt}-${tt}`,className:cc(["react-flow__handle",`react-flow__handle-${et}`,"nodrag",vt,ct,{source:!gt,target:gt,connectable:it,connectablestart:rt,connectableend:ot,connecting:St,connectionindicator:it&&(rt&&!xt||ot&&xt)}]),onMouseDown:It,onTouchStart:It,onClick:wt?Tt:void 0,ref:pt,...dt},lt)});Handle.displayName="Handle";var Handle$1=reactExports.memo(Handle);const DefaultNode=({data:tt,isConnectable:et,targetPosition:nt=Position.Top,sourcePosition:it=Position.Bottom})=>React$1.createElement(React$1.Fragment,null,React$1.createElement(Handle$1,{type:"target",position:nt,isConnectable:et}),tt==null?void 0:tt.label,React$1.createElement(Handle$1,{type:"source",position:it,isConnectable:et}));DefaultNode.displayName="DefaultNode";var DefaultNode$1=reactExports.memo(DefaultNode);const InputNode=({data:tt,isConnectable:et,sourcePosition:nt=Position.Bottom})=>React$1.createElement(React$1.Fragment,null,tt==null?void 0:tt.label,React$1.createElement(Handle$1,{type:"source",position:nt,isConnectable:et}));InputNode.displayName="InputNode";var InputNode$1=reactExports.memo(InputNode);const OutputNode=({data:tt,isConnectable:et,targetPosition:nt=Position.Top})=>React$1.createElement(React$1.Fragment,null,React$1.createElement(Handle$1,{type:"target",position:nt,isConnectable:et}),tt==null?void 0:tt.label);OutputNode.displayName="OutputNode";var OutputNode$1=reactExports.memo(OutputNode);const GroupNode=()=>null;GroupNode.displayName="GroupNode";const selector$e=tt=>({selectedNodes:tt.getNodes().filter(et=>et.selected),selectedEdges:tt.edges.filter(et=>et.selected)}),selectId=tt=>tt.id;function areEqual(tt,et){return shallow$1(tt.selectedNodes.map(selectId),et.selectedNodes.map(selectId))&&shallow$1(tt.selectedEdges.map(selectId),et.selectedEdges.map(selectId))}const SelectionListener=reactExports.memo(({onSelectionChange:tt})=>{const et=useStoreApi(),{selectedNodes:nt,selectedEdges:it}=useStore(selector$e,areEqual);return reactExports.useEffect(()=>{const rt={nodes:nt,edges:it};tt==null||tt(rt),et.getState().onSelectionChange.forEach(ot=>ot(rt))},[nt,it,tt]),null});SelectionListener.displayName="SelectionListener";const changeSelector=tt=>!!tt.onSelectionChange;function Wrapper$1$1({onSelectionChange:tt}){const et=useStore(changeSelector);return tt||et?React$1.createElement(SelectionListener,{onSelectionChange:tt}):null}const selector$d=tt=>({setNodes:tt.setNodes,setEdges:tt.setEdges,setDefaultNodesAndEdges:tt.setDefaultNodesAndEdges,setMinZoom:tt.setMinZoom,setMaxZoom:tt.setMaxZoom,setTranslateExtent:tt.setTranslateExtent,setNodeExtent:tt.setNodeExtent,reset:tt.reset});function useStoreUpdater(tt,et){reactExports.useEffect(()=>{typeof tt<"u"&&et(tt)},[tt])}function useDirectStoreUpdater(tt,et,nt){reactExports.useEffect(()=>{typeof et<"u"&&nt({[tt]:et})},[et])}const StoreUpdater=({nodes:tt,edges:et,defaultNodes:nt,defaultEdges:it,onConnect:rt,onConnectStart:ot,onConnectEnd:at,onClickConnectStart:st,onClickConnectEnd:lt,nodesDraggable:ct,nodesConnectable:ut,nodesFocusable:ht,edgesFocusable:dt,edgesUpdatable:pt,elevateNodesOnSelect:mt,minZoom:gt,maxZoom:bt,nodeExtent:yt,onNodesChange:wt,onEdgesChange:vt,elementsSelectable:xt,connectionMode:St,snapGrid:Et,snapToGrid:It,translateExtent:Tt,connectOnClick:$t,defaultEdgeOptions:Ut,fitView:Lt,fitViewOptions:Bt,onNodesDelete:Pt,onEdgesDelete:kt,onNodeDrag:At,onNodeDragStart:Rt,onNodeDragStop:Wt,onSelectionDrag:jt,onSelectionDragStart:Ot,onSelectionDragStop:Ct,noPanClassName:Dt,nodeOrigin:Mt,rfId:Vt,autoPanOnConnect:Qt,autoPanOnNodeDrag:rn,onError:Xt,connectionRadius:an,isValidConnection:tn,nodeDragThreshold:pn})=>{const{setNodes:vn,setEdges:sn,setDefaultNodesAndEdges:Zt,setMinZoom:Sn,setMaxZoom:Tn,setTranslateExtent:Cn,setNodeExtent:jn,reset:Un}=useStore(selector$d,shallow$1),yn=useStoreApi();return reactExports.useEffect(()=>{const un=it==null?void 0:it.map(En=>({...En,...Ut}));return Zt(nt,un),()=>{Un()}},[]),useDirectStoreUpdater("defaultEdgeOptions",Ut,yn.setState),useDirectStoreUpdater("connectionMode",St,yn.setState),useDirectStoreUpdater("onConnect",rt,yn.setState),useDirectStoreUpdater("onConnectStart",ot,yn.setState),useDirectStoreUpdater("onConnectEnd",at,yn.setState),useDirectStoreUpdater("onClickConnectStart",st,yn.setState),useDirectStoreUpdater("onClickConnectEnd",lt,yn.setState),useDirectStoreUpdater("nodesDraggable",ct,yn.setState),useDirectStoreUpdater("nodesConnectable",ut,yn.setState),useDirectStoreUpdater("nodesFocusable",ht,yn.setState),useDirectStoreUpdater("edgesFocusable",dt,yn.setState),useDirectStoreUpdater("edgesUpdatable",pt,yn.setState),useDirectStoreUpdater("elementsSelectable",xt,yn.setState),useDirectStoreUpdater("elevateNodesOnSelect",mt,yn.setState),useDirectStoreUpdater("snapToGrid",It,yn.setState),useDirectStoreUpdater("snapGrid",Et,yn.setState),useDirectStoreUpdater("onNodesChange",wt,yn.setState),useDirectStoreUpdater("onEdgesChange",vt,yn.setState),useDirectStoreUpdater("connectOnClick",$t,yn.setState),useDirectStoreUpdater("fitViewOnInit",Lt,yn.setState),useDirectStoreUpdater("fitViewOnInitOptions",Bt,yn.setState),useDirectStoreUpdater("onNodesDelete",Pt,yn.setState),useDirectStoreUpdater("onEdgesDelete",kt,yn.setState),useDirectStoreUpdater("onNodeDrag",At,yn.setState),useDirectStoreUpdater("onNodeDragStart",Rt,yn.setState),useDirectStoreUpdater("onNodeDragStop",Wt,yn.setState),useDirectStoreUpdater("onSelectionDrag",jt,yn.setState),useDirectStoreUpdater("onSelectionDragStart",Ot,yn.setState),useDirectStoreUpdater("onSelectionDragStop",Ct,yn.setState),useDirectStoreUpdater("noPanClassName",Dt,yn.setState),useDirectStoreUpdater("nodeOrigin",Mt,yn.setState),useDirectStoreUpdater("rfId",Vt,yn.setState),useDirectStoreUpdater("autoPanOnConnect",Qt,yn.setState),useDirectStoreUpdater("autoPanOnNodeDrag",rn,yn.setState),useDirectStoreUpdater("onError",Xt,yn.setState),useDirectStoreUpdater("connectionRadius",an,yn.setState),useDirectStoreUpdater("isValidConnection",tn,yn.setState),useDirectStoreUpdater("nodeDragThreshold",pn,yn.setState),useStoreUpdater(tt,vn),useStoreUpdater(et,sn),useStoreUpdater(gt,Sn),useStoreUpdater(bt,Tn),useStoreUpdater(Tt,Cn),useStoreUpdater(yt,jn),null},style$1={display:"none"},ariaLiveStyle={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ARIA_NODE_DESC_KEY="react-flow__node-desc",ARIA_EDGE_DESC_KEY="react-flow__edge-desc",ARIA_LIVE_MESSAGE="react-flow__aria-live",selector$c=tt=>tt.ariaLiveMessage;function AriaLiveMessage({rfId:tt}){const et=useStore(selector$c);return React$1.createElement("div",{id:`${ARIA_LIVE_MESSAGE}-${tt}`,"aria-live":"assertive","aria-atomic":"true",style:ariaLiveStyle},et)}function A11yDescriptions({rfId:tt,disableKeyboardA11y:et}){return React$1.createElement(React$1.Fragment,null,React$1.createElement("div",{id:`${ARIA_NODE_DESC_KEY}-${tt}`,style:style$1},"Press enter or space to select a node.",!et&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),React$1.createElement("div",{id:`${ARIA_EDGE_DESC_KEY}-${tt}`,style:style$1},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!et&&React$1.createElement(AriaLiveMessage,{rfId:tt}))}var useKeyPress=(tt=null,et={actInsideInputWithModifier:!0})=>{const[nt,it]=reactExports.useState(!1),rt=reactExports.useRef(!1),ot=reactExports.useRef(new Set([])),[at,st]=reactExports.useMemo(()=>{if(tt!==null){const ct=(Array.isArray(tt)?tt:[tt]).filter(ht=>typeof ht=="string").map(ht=>ht.split("+")),ut=ct.reduce((ht,dt)=>ht.concat(...dt),[]);return[ct,ut]}return[[],[]]},[tt]);return reactExports.useEffect(()=>{const lt=typeof document<"u"?document:null,ct=(et==null?void 0:et.target)||lt;if(tt!==null){const ut=pt=>{if(rt.current=pt.ctrlKey||pt.metaKey||pt.shiftKey,(!rt.current||rt.current&&!et.actInsideInputWithModifier)&&isInputDOMNode(pt))return!1;const gt=useKeyOrCode(pt.code,st);ot.current.add(pt[gt]),isMatchingKey(at,ot.current,!1)&&(pt.preventDefault(),it(!0))},ht=pt=>{if((!rt.current||rt.current&&!et.actInsideInputWithModifier)&&isInputDOMNode(pt))return!1;const gt=useKeyOrCode(pt.code,st);isMatchingKey(at,ot.current,!0)?(it(!1),ot.current.clear()):ot.current.delete(pt[gt]),pt.key==="Meta"&&ot.current.clear(),rt.current=!1},dt=()=>{ot.current.clear(),it(!1)};return ct==null||ct.addEventListener("keydown",ut),ct==null||ct.addEventListener("keyup",ht),window.addEventListener("blur",dt),()=>{ct==null||ct.removeEventListener("keydown",ut),ct==null||ct.removeEventListener("keyup",ht),window.removeEventListener("blur",dt)}}},[tt,it]),nt};function isMatchingKey(tt,et,nt){return tt.filter(it=>nt||it.length===et.size).some(it=>it.every(rt=>et.has(rt)))}function useKeyOrCode(tt,et){return et.includes(tt)?"code":"key"}function calculateXYZPosition(tt,et,nt,it){var at,st;if(!tt.parentNode)return nt;const rt=et.get(tt.parentNode),ot=getNodePositionWithOrigin(rt,it);return calculateXYZPosition(rt,et,{x:(nt.x??0)+ot.x,y:(nt.y??0)+ot.y,z:(((at=rt[internalsSymbol])==null?void 0:at.z)??0)>(nt.z??0)?((st=rt[internalsSymbol])==null?void 0:st.z)??0:nt.z??0},it)}function updateAbsoluteNodePositions(tt,et,nt){tt.forEach(it=>{var rt;if(it.parentNode&&!tt.has(it.parentNode))throw new Error(`Parent node ${it.parentNode} not found`);if(it.parentNode||nt!=null&&nt[it.id]){const{x:ot,y:at,z:st}=calculateXYZPosition(it,tt,{...it.position,z:((rt=it[internalsSymbol])==null?void 0:rt.z)??0},et);it.positionAbsolute={x:ot,y:at},it[internalsSymbol].z=st,nt!=null&&nt[it.id]&&(it[internalsSymbol].isParent=!0)}})}function createNodeInternals(tt,et,nt,it){const rt=new Map,ot={},at=it?1e3:0;return tt.forEach(st=>{var ht;const lt=(isNumeric(st.zIndex)?st.zIndex:0)+(st.selected?at:0),ct=et.get(st.id),ut={width:ct==null?void 0:ct.width,height:ct==null?void 0:ct.height,...st,positionAbsolute:{x:st.position.x,y:st.position.y}};st.parentNode&&(ut.parentNode=st.parentNode,ot[st.parentNode]=!0),Object.defineProperty(ut,internalsSymbol,{enumerable:!1,value:{handleBounds:(ht=ct==null?void 0:ct[internalsSymbol])==null?void 0:ht.handleBounds,z:lt}}),rt.set(st.id,ut)}),updateAbsoluteNodePositions(rt,nt,ot),rt}function fitView(tt,et={}){const{getNodes:nt,width:it,height:rt,minZoom:ot,maxZoom:at,d3Zoom:st,d3Selection:lt,fitViewOnInitDone:ct,fitViewOnInit:ut,nodeOrigin:ht}=tt(),dt=et.initial&&!ct&&ut;if(st&<&&(dt||!et.initial)){const mt=nt().filter(bt=>{var wt;const yt=et.includeHiddenNodes?bt.width&&bt.height:!bt.hidden;return(wt=et.nodes)!=null&&wt.length?yt&&et.nodes.some(vt=>vt.id===bt.id):yt}),gt=mt.every(bt=>bt.width&&bt.height);if(mt.length>0&>){const bt=getNodesBounds(mt,ht),{x:yt,y:wt,zoom:vt}=getViewportForBounds(bt,it,rt,et.minZoom??ot,et.maxZoom??at,et.padding??.1),xt=identity.translate(yt,wt).scale(vt);return typeof et.duration=="number"&&et.duration>0?st.transform(getD3Transition(lt,et.duration),xt):st.transform(lt,xt),!0}}return!1}function handleControlledNodeSelectionChange(tt,et){return tt.forEach(nt=>{const it=et.get(nt.id);it&&et.set(it.id,{...it,[internalsSymbol]:it[internalsSymbol],selected:nt.selected})}),new Map(et)}function handleControlledEdgeSelectionChange(tt,et){return et.map(nt=>{const it=tt.find(rt=>rt.id===nt.id);return it&&(nt.selected=it.selected),nt})}function updateNodesAndEdgesSelections({changedNodes:tt,changedEdges:et,get:nt,set:it}){const{nodeInternals:rt,edges:ot,onNodesChange:at,onEdgesChange:st,hasDefaultNodes:lt,hasDefaultEdges:ct}=nt();tt!=null&&tt.length&&(lt&&it({nodeInternals:handleControlledNodeSelectionChange(tt,rt)}),at==null||at(tt)),et!=null&&et.length&&(ct&&it({edges:handleControlledEdgeSelectionChange(et,ot)}),st==null||st(et))}const noop$1=()=>{},initialViewportHelper={zoomIn:noop$1,zoomOut:noop$1,zoomTo:noop$1,getZoom:()=>1,setViewport:noop$1,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:noop$1,fitBounds:noop$1,project:tt=>tt,screenToFlowPosition:tt=>tt,flowToScreenPosition:tt=>tt,viewportInitialized:!1},selector$b=tt=>({d3Zoom:tt.d3Zoom,d3Selection:tt.d3Selection}),useViewportHelper=()=>{const tt=useStoreApi(),{d3Zoom:et,d3Selection:nt}=useStore(selector$b,shallow$1);return reactExports.useMemo(()=>nt&&et?{zoomIn:rt=>et.scaleBy(getD3Transition(nt,rt==null?void 0:rt.duration),1.2),zoomOut:rt=>et.scaleBy(getD3Transition(nt,rt==null?void 0:rt.duration),1/1.2),zoomTo:(rt,ot)=>et.scaleTo(getD3Transition(nt,ot==null?void 0:ot.duration),rt),getZoom:()=>tt.getState().transform[2],setViewport:(rt,ot)=>{const[at,st,lt]=tt.getState().transform,ct=identity.translate(rt.x??at,rt.y??st).scale(rt.zoom??lt);et.transform(getD3Transition(nt,ot==null?void 0:ot.duration),ct)},getViewport:()=>{const[rt,ot,at]=tt.getState().transform;return{x:rt,y:ot,zoom:at}},fitView:rt=>fitView(tt.getState,rt),setCenter:(rt,ot,at)=>{const{width:st,height:lt,maxZoom:ct}=tt.getState(),ut=typeof(at==null?void 0:at.zoom)<"u"?at.zoom:ct,ht=st/2-rt*ut,dt=lt/2-ot*ut,pt=identity.translate(ht,dt).scale(ut);et.transform(getD3Transition(nt,at==null?void 0:at.duration),pt)},fitBounds:(rt,ot)=>{const{width:at,height:st,minZoom:lt,maxZoom:ct}=tt.getState(),{x:ut,y:ht,zoom:dt}=getViewportForBounds(rt,at,st,lt,ct,(ot==null?void 0:ot.padding)??.1),pt=identity.translate(ut,ht).scale(dt);et.transform(getD3Transition(nt,ot==null?void 0:ot.duration),pt)},project:rt=>{const{transform:ot,snapToGrid:at,snapGrid:st}=tt.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),pointToRendererPoint(rt,ot,at,st)},screenToFlowPosition:rt=>{const{transform:ot,snapToGrid:at,snapGrid:st,domNode:lt}=tt.getState();if(!lt)return rt;const{x:ct,y:ut}=lt.getBoundingClientRect(),ht={x:rt.x-ct,y:rt.y-ut};return pointToRendererPoint(ht,ot,at,st)},flowToScreenPosition:rt=>{const{transform:ot,domNode:at}=tt.getState();if(!at)return rt;const{x:st,y:lt}=at.getBoundingClientRect(),ct=rendererPointToPoint(rt,ot);return{x:ct.x+st,y:ct.y+lt}},viewportInitialized:!0}:initialViewportHelper,[et,nt])};function useReactFlow(){const tt=useViewportHelper(),et=useStoreApi(),nt=reactExports.useCallback(()=>et.getState().getNodes().map(gt=>({...gt})),[]),it=reactExports.useCallback(gt=>et.getState().nodeInternals.get(gt),[]),rt=reactExports.useCallback(()=>{const{edges:gt=[]}=et.getState();return gt.map(bt=>({...bt}))},[]),ot=reactExports.useCallback(gt=>{const{edges:bt=[]}=et.getState();return bt.find(yt=>yt.id===gt)},[]),at=reactExports.useCallback(gt=>{const{getNodes:bt,setNodes:yt,hasDefaultNodes:wt,onNodesChange:vt}=et.getState(),xt=bt(),St=typeof gt=="function"?gt(xt):gt;if(wt)yt(St);else if(vt){const Et=St.length===0?xt.map(It=>({type:"remove",id:It.id})):St.map(It=>({item:It,type:"reset"}));vt(Et)}},[]),st=reactExports.useCallback(gt=>{const{edges:bt=[],setEdges:yt,hasDefaultEdges:wt,onEdgesChange:vt}=et.getState(),xt=typeof gt=="function"?gt(bt):gt;if(wt)yt(xt);else if(vt){const St=xt.length===0?bt.map(Et=>({type:"remove",id:Et.id})):xt.map(Et=>({item:Et,type:"reset"}));vt(St)}},[]),lt=reactExports.useCallback(gt=>{const bt=Array.isArray(gt)?gt:[gt],{getNodes:yt,setNodes:wt,hasDefaultNodes:vt,onNodesChange:xt}=et.getState();if(vt){const Et=[...yt(),...bt];wt(Et)}else if(xt){const St=bt.map(Et=>({item:Et,type:"add"}));xt(St)}},[]),ct=reactExports.useCallback(gt=>{const bt=Array.isArray(gt)?gt:[gt],{edges:yt=[],setEdges:wt,hasDefaultEdges:vt,onEdgesChange:xt}=et.getState();if(vt)wt([...yt,...bt]);else if(xt){const St=bt.map(Et=>({item:Et,type:"add"}));xt(St)}},[]),ut=reactExports.useCallback(()=>{const{getNodes:gt,edges:bt=[],transform:yt}=et.getState(),[wt,vt,xt]=yt;return{nodes:gt().map(St=>({...St})),edges:bt.map(St=>({...St})),viewport:{x:wt,y:vt,zoom:xt}}},[]),ht=reactExports.useCallback(({nodes:gt,edges:bt})=>{const{nodeInternals:yt,getNodes:wt,edges:vt,hasDefaultNodes:xt,hasDefaultEdges:St,onNodesDelete:Et,onEdgesDelete:It,onNodesChange:Tt,onEdgesChange:$t}=et.getState(),Ut=(gt||[]).map(At=>At.id),Lt=(bt||[]).map(At=>At.id),Bt=wt().reduce((At,Rt)=>{const Wt=!Ut.includes(Rt.id)&&Rt.parentNode&&At.find(Ot=>Ot.id===Rt.parentNode);return(typeof Rt.deletable=="boolean"?Rt.deletable:!0)&&(Ut.includes(Rt.id)||Wt)&&At.push(Rt),At},[]),Pt=vt.filter(At=>typeof At.deletable=="boolean"?At.deletable:!0),kt=Pt.filter(At=>Lt.includes(At.id));if(Bt||kt){const At=getConnectedEdges(Bt,Pt),Rt=[...kt,...At],Wt=Rt.reduce((jt,Ot)=>(jt.includes(Ot.id)||jt.push(Ot.id),jt),[]);if((St||xt)&&(St&&et.setState({edges:vt.filter(jt=>!Wt.includes(jt.id))}),xt&&(Bt.forEach(jt=>{yt.delete(jt.id)}),et.setState({nodeInternals:new Map(yt)}))),Wt.length>0&&(It==null||It(Rt),$t&&$t(Wt.map(jt=>({id:jt,type:"remove"})))),Bt.length>0&&(Et==null||Et(Bt),Tt)){const jt=Bt.map(Ot=>({id:Ot.id,type:"remove"}));Tt(jt)}}},[]),dt=reactExports.useCallback(gt=>{const bt=isRectObject(gt),yt=bt?null:et.getState().nodeInternals.get(gt.id);return[bt?gt:nodeToRect(yt),yt,bt]},[]),pt=reactExports.useCallback((gt,bt=!0,yt)=>{const[wt,vt,xt]=dt(gt);return wt?(yt||et.getState().getNodes()).filter(St=>{if(!xt&&(St.id===vt.id||!St.positionAbsolute))return!1;const Et=nodeToRect(St),It=getOverlappingArea(Et,wt);return bt&&It>0||It>=wt.width*wt.height}):[]},[]),mt=reactExports.useCallback((gt,bt,yt=!0)=>{const[wt]=dt(gt);if(!wt)return!1;const vt=getOverlappingArea(wt,bt);return yt&&vt>0||vt>=wt.width*wt.height},[]);return reactExports.useMemo(()=>({...tt,getNodes:nt,getNode:it,getEdges:rt,getEdge:ot,setNodes:at,setEdges:st,addNodes:lt,addEdges:ct,toObject:ut,deleteElements:ht,getIntersectingNodes:pt,isNodeIntersecting:mt}),[tt,nt,it,rt,ot,at,st,lt,ct,ut,ht,pt,mt])}const deleteKeyOptions={actInsideInputWithModifier:!1};var useGlobalKeyHandler=({deleteKeyCode:tt,multiSelectionKeyCode:et})=>{const nt=useStoreApi(),{deleteElements:it}=useReactFlow(),rt=useKeyPress(tt,deleteKeyOptions),ot=useKeyPress(et);reactExports.useEffect(()=>{if(rt){const{edges:at,getNodes:st}=nt.getState(),lt=st().filter(ut=>ut.selected),ct=at.filter(ut=>ut.selected);it({nodes:lt,edges:ct}),nt.setState({nodesSelectionActive:!1})}},[rt]),reactExports.useEffect(()=>{nt.setState({multiSelectionActive:ot})},[ot])};function useResizeHandler(tt){const et=useStoreApi();reactExports.useEffect(()=>{let nt;const it=()=>{var ot,at;if(!tt.current)return;const rt=getDimensions(tt.current);(rt.height===0||rt.width===0)&&((at=(ot=et.getState()).onError)==null||at.call(ot,"004",errorMessages.error004())),et.setState({width:rt.width||500,height:rt.height||500})};return it(),window.addEventListener("resize",it),tt.current&&(nt=new ResizeObserver(()=>it()),nt.observe(tt.current)),()=>{window.removeEventListener("resize",it),nt&&tt.current&&nt.unobserve(tt.current)}},[])}const containerStyle={position:"absolute",width:"100%",height:"100%",top:0,left:0},viewChanged=(tt,et)=>tt.x!==et.x||tt.y!==et.y||tt.zoom!==et.k,eventToFlowTransform=tt=>({x:tt.x,y:tt.y,zoom:tt.k}),isWrappedWithClass=(tt,et)=>tt.target.closest(`.${et}`),isRightClickPan=(tt,et)=>et===2&&Array.isArray(tt)&&tt.includes(2),wheelDelta=tt=>{const et=tt.ctrlKey&&isMacOs()?10:1;return-tt.deltaY*(tt.deltaMode===1?.05:tt.deltaMode?1:.002)*et},selector$a=tt=>({d3Zoom:tt.d3Zoom,d3Selection:tt.d3Selection,d3ZoomHandler:tt.d3ZoomHandler,userSelectionActive:tt.userSelectionActive}),ZoomPane=({onMove:tt,onMoveStart:et,onMoveEnd:nt,onPaneContextMenu:it,zoomOnScroll:rt=!0,zoomOnPinch:ot=!0,panOnScroll:at=!1,panOnScrollSpeed:st=.5,panOnScrollMode:lt=PanOnScrollMode.Free,zoomOnDoubleClick:ct=!0,elementsSelectable:ut,panOnDrag:ht=!0,defaultViewport:dt,translateExtent:pt,minZoom:mt,maxZoom:gt,zoomActivationKeyCode:bt,preventScrolling:yt=!0,children:wt,noWheelClassName:vt,noPanClassName:xt})=>{const St=reactExports.useRef(),Et=useStoreApi(),It=reactExports.useRef(!1),Tt=reactExports.useRef(!1),$t=reactExports.useRef(null),Ut=reactExports.useRef({x:0,y:0,zoom:0}),{d3Zoom:Lt,d3Selection:Bt,d3ZoomHandler:Pt,userSelectionActive:kt}=useStore(selector$a,shallow$1),At=useKeyPress(bt),Rt=reactExports.useRef(0),Wt=reactExports.useRef(!1),jt=reactExports.useRef();return useResizeHandler($t),reactExports.useEffect(()=>{if($t.current){const Ot=$t.current.getBoundingClientRect(),Ct=zoom().scaleExtent([mt,gt]).translateExtent(pt),Dt=select($t.current).call(Ct),Mt=identity.translate(dt.x,dt.y).scale(clamp(dt.zoom,mt,gt)),Vt=[[0,0],[Ot.width,Ot.height]],Qt=Ct.constrain()(Mt,Vt,pt);Ct.transform(Dt,Qt),Ct.wheelDelta(wheelDelta),Et.setState({d3Zoom:Ct,d3Selection:Dt,d3ZoomHandler:Dt.on("wheel.zoom"),transform:[Qt.x,Qt.y,Qt.k],domNode:$t.current.closest(".react-flow")})}},[]),reactExports.useEffect(()=>{Bt&&Lt&&(at&&!At&&!kt?Bt.on("wheel.zoom",Ot=>{if(isWrappedWithClass(Ot,vt))return!1;Ot.preventDefault(),Ot.stopImmediatePropagation();const Ct=Bt.property("__zoom").k||1,Dt=isMacOs();if(Ot.ctrlKey&&ot&&Dt){const pn=pointer(Ot),vn=wheelDelta(Ot),sn=Ct*Math.pow(2,vn);Lt.scaleTo(Bt,sn,pn,Ot);return}const Mt=Ot.deltaMode===1?20:1;let Vt=lt===PanOnScrollMode.Vertical?0:Ot.deltaX*Mt,Qt=lt===PanOnScrollMode.Horizontal?0:Ot.deltaY*Mt;!Dt&&Ot.shiftKey&<!==PanOnScrollMode.Vertical&&(Vt=Ot.deltaY*Mt,Qt=0),Lt.translateBy(Bt,-(Vt/Ct)*st,-(Qt/Ct)*st,{internal:!0});const rn=eventToFlowTransform(Bt.property("__zoom")),{onViewportChangeStart:Xt,onViewportChange:an,onViewportChangeEnd:tn}=Et.getState();clearTimeout(jt.current),Wt.current||(Wt.current=!0,et==null||et(Ot,rn),Xt==null||Xt(rn)),Wt.current&&(tt==null||tt(Ot,rn),an==null||an(rn),jt.current=setTimeout(()=>{nt==null||nt(Ot,rn),tn==null||tn(rn),Wt.current=!1},150))},{passive:!1}):typeof Pt<"u"&&Bt.on("wheel.zoom",function(Ot,Ct){if(!yt||isWrappedWithClass(Ot,vt))return null;Ot.preventDefault(),Pt.call(this,Ot,Ct)},{passive:!1}))},[kt,at,lt,Bt,Lt,Pt,At,ot,yt,vt,et,tt,nt]),reactExports.useEffect(()=>{Lt&&Lt.on("start",Ot=>{var Mt,Vt;if(!Ot.sourceEvent||Ot.sourceEvent.internal)return null;Rt.current=(Mt=Ot.sourceEvent)==null?void 0:Mt.button;const{onViewportChangeStart:Ct}=Et.getState(),Dt=eventToFlowTransform(Ot.transform);It.current=!0,Ut.current=Dt,((Vt=Ot.sourceEvent)==null?void 0:Vt.type)==="mousedown"&&Et.setState({paneDragging:!0}),Ct==null||Ct(Dt),et==null||et(Ot.sourceEvent,Dt)})},[Lt,et]),reactExports.useEffect(()=>{Lt&&(kt&&!It.current?Lt.on("zoom",null):kt||Lt.on("zoom",Ot=>{var Dt;const{onViewportChange:Ct}=Et.getState();if(Et.setState({transform:[Ot.transform.x,Ot.transform.y,Ot.transform.k]}),Tt.current=!!(it&&isRightClickPan(ht,Rt.current??0)),(tt||Ct)&&!((Dt=Ot.sourceEvent)!=null&&Dt.internal)){const Mt=eventToFlowTransform(Ot.transform);Ct==null||Ct(Mt),tt==null||tt(Ot.sourceEvent,Mt)}}))},[kt,Lt,tt,ht,it]),reactExports.useEffect(()=>{Lt&&Lt.on("end",Ot=>{if(!Ot.sourceEvent||Ot.sourceEvent.internal)return null;const{onViewportChangeEnd:Ct}=Et.getState();if(It.current=!1,Et.setState({paneDragging:!1}),it&&isRightClickPan(ht,Rt.current??0)&&!Tt.current&&it(Ot.sourceEvent),Tt.current=!1,(nt||Ct)&&viewChanged(Ut.current,Ot.transform)){const Dt=eventToFlowTransform(Ot.transform);Ut.current=Dt,clearTimeout(St.current),St.current=setTimeout(()=>{Ct==null||Ct(Dt),nt==null||nt(Ot.sourceEvent,Dt)},at?150:0)}})},[Lt,at,ht,nt,it]),reactExports.useEffect(()=>{Lt&&Lt.filter(Ot=>{const Ct=At||rt,Dt=ot&&Ot.ctrlKey;if((ht===!0||Array.isArray(ht)&&ht.includes(1))&&Ot.button===1&&Ot.type==="mousedown"&&(isWrappedWithClass(Ot,"react-flow__node")||isWrappedWithClass(Ot,"react-flow__edge")))return!0;if(!ht&&!Ct&&!at&&!ct&&!ot||kt||!ct&&Ot.type==="dblclick"||isWrappedWithClass(Ot,vt)&&Ot.type==="wheel"||isWrappedWithClass(Ot,xt)&&(Ot.type!=="wheel"||at&&Ot.type==="wheel"&&!At)||!ot&&Ot.ctrlKey&&Ot.type==="wheel"||!Ct&&!at&&!Dt&&Ot.type==="wheel"||!ht&&(Ot.type==="mousedown"||Ot.type==="touchstart")||Array.isArray(ht)&&!ht.includes(Ot.button)&&(Ot.type==="mousedown"||Ot.type==="touchstart"))return!1;const Mt=Array.isArray(ht)&&ht.includes(Ot.button)||!Ot.button||Ot.button<=1;return(!Ot.ctrlKey||Ot.type==="wheel")&&Mt})},[kt,Lt,rt,ot,at,ct,ht,ut,At]),React$1.createElement("div",{className:"react-flow__renderer",ref:$t,style:containerStyle},wt)},selector$9=tt=>({userSelectionActive:tt.userSelectionActive,userSelectionRect:tt.userSelectionRect});function UserSelection(){const{userSelectionActive:tt,userSelectionRect:et}=useStore(selector$9,shallow$1);return tt&&et?React$1.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:et.width,height:et.height,transform:`translate(${et.x}px, ${et.y}px)`}}):null}function handleParentExpand(tt,et){const nt=tt.find(it=>it.id===et.parentNode);if(nt){const it=et.position.x+et.width-nt.width,rt=et.position.y+et.height-nt.height;if(it>0||rt>0||et.position.x<0||et.position.y<0){if(nt.style={...nt.style},nt.style.width=nt.style.width??nt.width,nt.style.height=nt.style.height??nt.height,it>0&&(nt.style.width+=it),rt>0&&(nt.style.height+=rt),et.position.x<0){const ot=Math.abs(et.position.x);nt.position.x=nt.position.x-ot,nt.style.width+=ot,et.position.x=0}if(et.position.y<0){const ot=Math.abs(et.position.y);nt.position.y=nt.position.y-ot,nt.style.height+=ot,et.position.y=0}nt.width=nt.style.width,nt.height=nt.style.height}}}function applyChanges(tt,et){if(tt.some(it=>it.type==="reset"))return tt.filter(it=>it.type==="reset").map(it=>it.item);const nt=tt.filter(it=>it.type==="add").map(it=>it.item);return et.reduce((it,rt)=>{const ot=tt.filter(st=>st.id===rt.id);if(ot.length===0)return it.push(rt),it;const at={...rt};for(const st of ot)if(st)switch(st.type){case"select":{at.selected=st.selected;break}case"position":{typeof st.position<"u"&&(at.position=st.position),typeof st.positionAbsolute<"u"&&(at.positionAbsolute=st.positionAbsolute),typeof st.dragging<"u"&&(at.dragging=st.dragging),at.expandParent&&handleParentExpand(it,at);break}case"dimensions":{typeof st.dimensions<"u"&&(at.width=st.dimensions.width,at.height=st.dimensions.height),typeof st.updateStyle<"u"&&(at.style={...at.style||{},...st.dimensions}),typeof st.resizing=="boolean"&&(at.resizing=st.resizing),at.expandParent&&handleParentExpand(it,at);break}case"remove":return it}return it.push(at),it},nt)}function applyNodeChanges(tt,et){return applyChanges(tt,et)}const createSelectionChange=(tt,et)=>({id:tt,type:"select",selected:et});function getSelectionChanges(tt,et){return tt.reduce((nt,it)=>{const rt=et.includes(it.id);return!it.selected&&rt?(it.selected=!0,nt.push(createSelectionChange(it.id,!0))):it.selected&&!rt&&(it.selected=!1,nt.push(createSelectionChange(it.id,!1))),nt},[])}const wrapHandler=(tt,et)=>nt=>{nt.target===et.current&&(tt==null||tt(nt))},selector$8=tt=>({userSelectionActive:tt.userSelectionActive,elementsSelectable:tt.elementsSelectable,dragging:tt.paneDragging}),Pane=reactExports.memo(({isSelecting:tt,selectionMode:et=SelectionMode.Full,panOnDrag:nt,onSelectionStart:it,onSelectionEnd:rt,onPaneClick:ot,onPaneContextMenu:at,onPaneScroll:st,onPaneMouseEnter:lt,onPaneMouseMove:ct,onPaneMouseLeave:ut,children:ht})=>{const dt=reactExports.useRef(null),pt=useStoreApi(),mt=reactExports.useRef(0),gt=reactExports.useRef(0),bt=reactExports.useRef(),{userSelectionActive:yt,elementsSelectable:wt,dragging:vt}=useStore(selector$8,shallow$1),xt=()=>{pt.setState({userSelectionActive:!1,userSelectionRect:null}),mt.current=0,gt.current=0},St=Pt=>{ot==null||ot(Pt),pt.getState().resetSelectedElements(),pt.setState({nodesSelectionActive:!1})},Et=Pt=>{if(Array.isArray(nt)&&(nt!=null&&nt.includes(2))){Pt.preventDefault();return}at==null||at(Pt)},It=st?Pt=>st(Pt):void 0,Tt=Pt=>{const{resetSelectedElements:kt,domNode:At}=pt.getState();if(bt.current=At==null?void 0:At.getBoundingClientRect(),!wt||!tt||Pt.button!==0||Pt.target!==dt.current||!bt.current)return;const{x:Rt,y:Wt}=getEventPosition(Pt,bt.current);kt(),pt.setState({userSelectionRect:{width:0,height:0,startX:Rt,startY:Wt,x:Rt,y:Wt}}),it==null||it(Pt)},$t=Pt=>{const{userSelectionRect:kt,nodeInternals:At,edges:Rt,transform:Wt,onNodesChange:jt,onEdgesChange:Ot,nodeOrigin:Ct,getNodes:Dt}=pt.getState();if(!tt||!bt.current||!kt)return;pt.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Mt=getEventPosition(Pt,bt.current),Vt=kt.startX??0,Qt=kt.startY??0,rn={...kt,x:Mt.xvn.id),pn=an.map(vn=>vn.id);if(mt.current!==pn.length){mt.current=pn.length;const vn=getSelectionChanges(Xt,pn);vn.length&&(jt==null||jt(vn))}if(gt.current!==tn.length){gt.current=tn.length;const vn=getSelectionChanges(Rt,tn);vn.length&&(Ot==null||Ot(vn))}pt.setState({userSelectionRect:rn})},Ut=Pt=>{if(Pt.button!==0)return;const{userSelectionRect:kt}=pt.getState();!yt&&kt&&Pt.target===dt.current&&(St==null||St(Pt)),pt.setState({nodesSelectionActive:mt.current>0}),xt(),rt==null||rt(Pt)},Lt=Pt=>{yt&&(pt.setState({nodesSelectionActive:mt.current>0}),rt==null||rt(Pt)),xt()},Bt=wt&&(tt||yt);return React$1.createElement("div",{className:cc(["react-flow__pane",{dragging:vt,selection:tt}]),onClick:Bt?void 0:wrapHandler(St,dt),onContextMenu:wrapHandler(Et,dt),onWheel:wrapHandler(It,dt),onMouseEnter:Bt?void 0:lt,onMouseDown:Bt?Tt:void 0,onMouseMove:Bt?$t:ct,onMouseUp:Bt?Ut:void 0,onMouseLeave:Bt?Lt:ut,ref:dt,style:containerStyle},ht,React$1.createElement(UserSelection,null))});Pane.displayName="Pane";function isParentSelected(tt,et){if(!tt.parentNode)return!1;const nt=et.get(tt.parentNode);return nt?nt.selected?!0:isParentSelected(nt,et):!1}function hasSelector(tt,et,nt){let it=tt;do{if(it!=null&&it.matches(et))return!0;if(it===nt.current)return!1;it=it.parentElement}while(it);return!1}function getDragItems(tt,et,nt,it){return Array.from(tt.values()).filter(rt=>(rt.selected||rt.id===it)&&(!rt.parentNode||!isParentSelected(rt,tt))&&(rt.draggable||et&&typeof rt.draggable>"u")).map(rt=>{var ot,at;return{id:rt.id,position:rt.position||{x:0,y:0},positionAbsolute:rt.positionAbsolute||{x:0,y:0},distance:{x:nt.x-(((ot=rt.positionAbsolute)==null?void 0:ot.x)??0),y:nt.y-(((at=rt.positionAbsolute)==null?void 0:at.y)??0)},delta:{x:0,y:0},extent:rt.extent,parentNode:rt.parentNode,width:rt.width,height:rt.height,expandParent:rt.expandParent}})}function clampNodeExtent(tt,et){return!et||et==="parent"?et:[et[0],[et[1][0]-(tt.width||0),et[1][1]-(tt.height||0)]]}function calcNextPosition(tt,et,nt,it,rt=[0,0],ot){const at=clampNodeExtent(tt,tt.extent||it);let st=at;if(tt.extent==="parent"&&!tt.expandParent)if(tt.parentNode&&tt.width&&tt.height){const ut=nt.get(tt.parentNode),{x:ht,y:dt}=getNodePositionWithOrigin(ut,rt).positionAbsolute;st=ut&&isNumeric(ht)&&isNumeric(dt)&&isNumeric(ut.width)&&isNumeric(ut.height)?[[ht+tt.width*rt[0],dt+tt.height*rt[1]],[ht+ut.width-tt.width+tt.width*rt[0],dt+ut.height-tt.height+tt.height*rt[1]]]:st}else ot==null||ot("005",errorMessages.error005()),st=at;else if(tt.extent&&tt.parentNode&&tt.extent!=="parent"){const ut=nt.get(tt.parentNode),{x:ht,y:dt}=getNodePositionWithOrigin(ut,rt).positionAbsolute;st=[[tt.extent[0][0]+ht,tt.extent[0][1]+dt],[tt.extent[1][0]+ht,tt.extent[1][1]+dt]]}let lt={x:0,y:0};if(tt.parentNode){const ut=nt.get(tt.parentNode);lt=getNodePositionWithOrigin(ut,rt).positionAbsolute}const ct=st&&st!=="parent"?clampPosition(et,st):et;return{position:{x:ct.x-lt.x,y:ct.y-lt.y},positionAbsolute:ct}}function getEventHandlerParams({nodeId:tt,dragItems:et,nodeInternals:nt}){const it=et.map(rt=>({...nt.get(rt.id),position:rt.position,positionAbsolute:rt.positionAbsolute}));return[tt?it.find(rt=>rt.id===tt):it[0],it]}const getHandleBounds=(tt,et,nt,it)=>{const rt=et.querySelectorAll(tt);if(!rt||!rt.length)return null;const ot=Array.from(rt),at=et.getBoundingClientRect(),st={x:at.width*it[0],y:at.height*it[1]};return ot.map(lt=>{const ct=lt.getBoundingClientRect();return{id:lt.getAttribute("data-handleid"),position:lt.getAttribute("data-handlepos"),x:(ct.left-at.left-st.x)/nt,y:(ct.top-at.top-st.y)/nt,...getDimensions(lt)}})};function getMouseHandler(tt,et,nt){return nt===void 0?nt:it=>{const rt=et().nodeInternals.get(tt);rt&&nt(it,{...rt})}}function handleNodeClick({id:tt,store:et,unselect:nt=!1,nodeRef:it}){const{addSelectedNodes:rt,unselectNodesAndEdges:ot,multiSelectionActive:at,nodeInternals:st,onError:lt}=et.getState(),ct=st.get(tt);if(!ct){lt==null||lt("012",errorMessages.error012(tt));return}et.setState({nodesSelectionActive:!1}),ct.selected?(nt||ct.selected&&at)&&(ot({nodes:[ct],edges:[]}),requestAnimationFrame(()=>{var ut;return(ut=it==null?void 0:it.current)==null?void 0:ut.blur()})):rt([tt])}function useGetPointerPosition(){const tt=useStoreApi();return reactExports.useCallback(({sourceEvent:nt})=>{const{transform:it,snapGrid:rt,snapToGrid:ot}=tt.getState(),at=nt.touches?nt.touches[0].clientX:nt.clientX,st=nt.touches?nt.touches[0].clientY:nt.clientY,lt={x:(at-it[0])/it[2],y:(st-it[1])/it[2]};return{xSnapped:ot?rt[0]*Math.round(lt.x/rt[0]):lt.x,ySnapped:ot?rt[1]*Math.round(lt.y/rt[1]):lt.y,...lt}},[])}function wrapSelectionDragFunc(tt){return(et,nt,it)=>tt==null?void 0:tt(et,it)}function useDrag({nodeRef:tt,disabled:et=!1,noDragClassName:nt,handleSelector:it,nodeId:rt,isSelectable:ot,selectNodesOnDrag:at}){const st=useStoreApi(),[lt,ct]=reactExports.useState(!1),ut=reactExports.useRef([]),ht=reactExports.useRef({x:null,y:null}),dt=reactExports.useRef(0),pt=reactExports.useRef(null),mt=reactExports.useRef({x:0,y:0}),gt=reactExports.useRef(null),bt=reactExports.useRef(!1),yt=reactExports.useRef(!1),wt=useGetPointerPosition();return reactExports.useEffect(()=>{if(tt!=null&&tt.current){const vt=select(tt.current),xt=({x:It,y:Tt})=>{const{nodeInternals:$t,onNodeDrag:Ut,onSelectionDrag:Lt,updateNodePositions:Bt,nodeExtent:Pt,snapGrid:kt,snapToGrid:At,nodeOrigin:Rt,onError:Wt}=st.getState();ht.current={x:It,y:Tt};let jt=!1,Ot={x:0,y:0,x2:0,y2:0};if(ut.current.length>1&&Pt){const Dt=getNodesBounds(ut.current,Rt);Ot=rectToBox(Dt)}if(ut.current=ut.current.map(Dt=>{const Mt={x:It-Dt.distance.x,y:Tt-Dt.distance.y};At&&(Mt.x=kt[0]*Math.round(Mt.x/kt[0]),Mt.y=kt[1]*Math.round(Mt.y/kt[1]));const Vt=[[Pt[0][0],Pt[0][1]],[Pt[1][0],Pt[1][1]]];ut.current.length>1&&Pt&&!Dt.extent&&(Vt[0][0]=Dt.positionAbsolute.x-Ot.x+Pt[0][0],Vt[1][0]=Dt.positionAbsolute.x+(Dt.width??0)-Ot.x2+Pt[1][0],Vt[0][1]=Dt.positionAbsolute.y-Ot.y+Pt[0][1],Vt[1][1]=Dt.positionAbsolute.y+(Dt.height??0)-Ot.y2+Pt[1][1]);const Qt=calcNextPosition(Dt,Mt,$t,Vt,Rt,Wt);return jt=jt||Dt.position.x!==Qt.position.x||Dt.position.y!==Qt.position.y,Dt.position=Qt.position,Dt.positionAbsolute=Qt.positionAbsolute,Dt}),!jt)return;Bt(ut.current,!0,!0),ct(!0);const Ct=rt?Ut:wrapSelectionDragFunc(Lt);if(Ct&>.current){const[Dt,Mt]=getEventHandlerParams({nodeId:rt,dragItems:ut.current,nodeInternals:$t});Ct(gt.current,Dt,Mt)}},St=()=>{if(!pt.current)return;const[It,Tt]=calcAutoPan(mt.current,pt.current);if(It!==0||Tt!==0){const{transform:$t,panBy:Ut}=st.getState();ht.current.x=(ht.current.x??0)-It/$t[2],ht.current.y=(ht.current.y??0)-Tt/$t[2],Ut({x:It,y:Tt})&&xt(ht.current)}dt.current=requestAnimationFrame(St)},Et=It=>{var Rt;const{nodeInternals:Tt,multiSelectionActive:$t,nodesDraggable:Ut,unselectNodesAndEdges:Lt,onNodeDragStart:Bt,onSelectionDragStart:Pt}=st.getState();yt.current=!0;const kt=rt?Bt:wrapSelectionDragFunc(Pt);(!at||!ot)&&!$t&&rt&&((Rt=Tt.get(rt))!=null&&Rt.selected||Lt()),rt&&ot&&at&&handleNodeClick({id:rt,store:st,nodeRef:tt});const At=wt(It);if(ht.current=At,ut.current=getDragItems(Tt,Ut,At,rt),kt&&ut.current){const[Wt,jt]=getEventHandlerParams({nodeId:rt,dragItems:ut.current,nodeInternals:Tt});kt(It.sourceEvent,Wt,jt)}};if(et)vt.on(".drag",null);else{const It=drag().on("start",Tt=>{const{domNode:$t,nodeDragThreshold:Ut}=st.getState();Ut===0&&Et(Tt);const Lt=wt(Tt);ht.current=Lt,pt.current=($t==null?void 0:$t.getBoundingClientRect())||null,mt.current=getEventPosition(Tt.sourceEvent,pt.current)}).on("drag",Tt=>{var Bt,Pt;const $t=wt(Tt),{autoPanOnNodeDrag:Ut,nodeDragThreshold:Lt}=st.getState();if(!bt.current&&yt.current&&Ut&&(bt.current=!0,St()),!yt.current){const kt=$t.xSnapped-(((Bt=ht==null?void 0:ht.current)==null?void 0:Bt.x)??0),At=$t.ySnapped-(((Pt=ht==null?void 0:ht.current)==null?void 0:Pt.y)??0);Math.sqrt(kt*kt+At*At)>Lt&&Et(Tt)}(ht.current.x!==$t.xSnapped||ht.current.y!==$t.ySnapped)&&ut.current&&yt.current&&(gt.current=Tt.sourceEvent,mt.current=getEventPosition(Tt.sourceEvent,pt.current),xt($t))}).on("end",Tt=>{if(yt.current&&(ct(!1),bt.current=!1,yt.current=!1,cancelAnimationFrame(dt.current),ut.current)){const{updateNodePositions:$t,nodeInternals:Ut,onNodeDragStop:Lt,onSelectionDragStop:Bt}=st.getState(),Pt=rt?Lt:wrapSelectionDragFunc(Bt);if($t(ut.current,!1,!1),Pt){const[kt,At]=getEventHandlerParams({nodeId:rt,dragItems:ut.current,nodeInternals:Ut});Pt(Tt.sourceEvent,kt,At)}}}).filter(Tt=>{const $t=Tt.target;return!Tt.button&&(!nt||!hasSelector($t,`.${nt}`,tt))&&(!it||hasSelector($t,it,tt))});return vt.call(It),()=>{vt.on(".drag",null)}}}},[tt,et,nt,it,ot,st,rt,at,wt]),lt}function useUpdateNodePositions(){const tt=useStoreApi();return reactExports.useCallback(nt=>{const{nodeInternals:it,nodeExtent:rt,updateNodePositions:ot,getNodes:at,snapToGrid:st,snapGrid:lt,onError:ct,nodesDraggable:ut}=tt.getState(),ht=at().filter(wt=>wt.selected&&(wt.draggable||ut&&typeof wt.draggable>"u")),dt=st?lt[0]:5,pt=st?lt[1]:5,mt=nt.isShiftPressed?4:1,gt=nt.x*dt*mt,bt=nt.y*pt*mt,yt=ht.map(wt=>{if(wt.positionAbsolute){const vt={x:wt.positionAbsolute.x+gt,y:wt.positionAbsolute.y+bt};st&&(vt.x=lt[0]*Math.round(vt.x/lt[0]),vt.y=lt[1]*Math.round(vt.y/lt[1]));const{positionAbsolute:xt,position:St}=calcNextPosition(wt,vt,it,rt,void 0,ct);wt.position=St,wt.positionAbsolute=xt}return wt});ot(yt,!0,!1)},[])}const arrowKeyDiffs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var wrapNode=tt=>{const et=({id:nt,type:it,data:rt,xPos:ot,yPos:at,xPosOrigin:st,yPosOrigin:lt,selected:ct,onClick:ut,onMouseEnter:ht,onMouseMove:dt,onMouseLeave:pt,onContextMenu:mt,onDoubleClick:gt,style:bt,className:yt,isDraggable:wt,isSelectable:vt,isConnectable:xt,isFocusable:St,selectNodesOnDrag:Et,sourcePosition:It,targetPosition:Tt,hidden:$t,resizeObserver:Ut,dragHandle:Lt,zIndex:Bt,isParent:Pt,noDragClassName:kt,noPanClassName:At,initialized:Rt,disableKeyboardA11y:Wt,ariaLabel:jt,rfId:Ot})=>{const Ct=useStoreApi(),Dt=reactExports.useRef(null),Mt=reactExports.useRef(It),Vt=reactExports.useRef(Tt),Qt=reactExports.useRef(it),rn=vt||wt||ut||ht||dt||pt,Xt=useUpdateNodePositions(),an=getMouseHandler(nt,Ct.getState,ht),tn=getMouseHandler(nt,Ct.getState,dt),pn=getMouseHandler(nt,Ct.getState,pt),vn=getMouseHandler(nt,Ct.getState,mt),sn=getMouseHandler(nt,Ct.getState,gt),Zt=Cn=>{const{nodeDragThreshold:jn}=Ct.getState();if(vt&&(!Et||!wt||jn>0)&&handleNodeClick({id:nt,store:Ct,nodeRef:Dt}),ut){const Un=Ct.getState().nodeInternals.get(nt);Un&&ut(Cn,{...Un})}},Sn=Cn=>{if(!isInputDOMNode(Cn))if(elementSelectionKeys.includes(Cn.key)&&vt){const jn=Cn.key==="Escape";handleNodeClick({id:nt,store:Ct,unselect:jn,nodeRef:Dt})}else!Wt&&wt&&ct&&Object.prototype.hasOwnProperty.call(arrowKeyDiffs,Cn.key)&&(Ct.setState({ariaLiveMessage:`Moved selected node ${Cn.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~ot}, y: ${~~at}`}),Xt({x:arrowKeyDiffs[Cn.key].x,y:arrowKeyDiffs[Cn.key].y,isShiftPressed:Cn.shiftKey}))};reactExports.useEffect(()=>{if(Dt.current&&!$t){const Cn=Dt.current;return Ut==null||Ut.observe(Cn),()=>Ut==null?void 0:Ut.unobserve(Cn)}},[$t]),reactExports.useEffect(()=>{const Cn=Qt.current!==it,jn=Mt.current!==It,Un=Vt.current!==Tt;Dt.current&&(Cn||jn||Un)&&(Cn&&(Qt.current=it),jn&&(Mt.current=It),Un&&(Vt.current=Tt),Ct.getState().updateNodeDimensions([{id:nt,nodeElement:Dt.current,forceUpdate:!0}]))},[nt,it,It,Tt]);const Tn=useDrag({nodeRef:Dt,disabled:$t||!wt,noDragClassName:kt,handleSelector:Lt,nodeId:nt,isSelectable:vt,selectNodesOnDrag:Et});return $t?null:React$1.createElement("div",{className:cc(["react-flow__node",`react-flow__node-${it}`,{[At]:wt},yt,{selected:ct,selectable:vt,parent:Pt,dragging:Tn}]),ref:Dt,style:{zIndex:Bt,transform:`translate(${st}px,${lt}px)`,pointerEvents:rn?"all":"none",visibility:Rt?"visible":"hidden",...bt},"data-id":nt,"data-testid":`rf__node-${nt}`,onMouseEnter:an,onMouseMove:tn,onMouseLeave:pn,onContextMenu:vn,onClick:Zt,onDoubleClick:sn,onKeyDown:St?Sn:void 0,tabIndex:St?0:void 0,role:St?"button":void 0,"aria-describedby":Wt?void 0:`${ARIA_NODE_DESC_KEY}-${Ot}`,"aria-label":jt},React$1.createElement(Provider,{value:nt},React$1.createElement(tt,{id:nt,data:rt,type:it,xPos:ot,yPos:at,selected:ct,isConnectable:xt,sourcePosition:It,targetPosition:Tt,dragging:Tn,dragHandle:Lt,zIndex:Bt})))};return et.displayName="NodeWrapper",reactExports.memo(et)};const selector$7=tt=>{const et=tt.getNodes().filter(nt=>nt.selected);return{...getNodesBounds(et,tt.nodeOrigin),transformString:`translate(${tt.transform[0]}px,${tt.transform[1]}px) scale(${tt.transform[2]})`,userSelectionActive:tt.userSelectionActive}};function NodesSelection({onSelectionContextMenu:tt,noPanClassName:et,disableKeyboardA11y:nt}){const it=useStoreApi(),{width:rt,height:ot,x:at,y:st,transformString:lt,userSelectionActive:ct}=useStore(selector$7,shallow$1),ut=useUpdateNodePositions(),ht=reactExports.useRef(null);if(reactExports.useEffect(()=>{var mt;nt||(mt=ht.current)==null||mt.focus({preventScroll:!0})},[nt]),useDrag({nodeRef:ht}),ct||!rt||!ot)return null;const dt=tt?mt=>{const gt=it.getState().getNodes().filter(bt=>bt.selected);tt(mt,gt)}:void 0,pt=mt=>{Object.prototype.hasOwnProperty.call(arrowKeyDiffs,mt.key)&&ut({x:arrowKeyDiffs[mt.key].x,y:arrowKeyDiffs[mt.key].y,isShiftPressed:mt.shiftKey})};return React$1.createElement("div",{className:cc(["react-flow__nodesselection","react-flow__container",et]),style:{transform:lt}},React$1.createElement("div",{ref:ht,className:"react-flow__nodesselection-rect",onContextMenu:dt,tabIndex:nt?void 0:-1,onKeyDown:nt?void 0:pt,style:{width:rt,height:ot,top:st,left:at}}))}var NodesSelection$1=reactExports.memo(NodesSelection);const selector$6=tt=>tt.nodesSelectionActive,FlowRenderer=({children:tt,onPaneClick:et,onPaneMouseEnter:nt,onPaneMouseMove:it,onPaneMouseLeave:rt,onPaneContextMenu:ot,onPaneScroll:at,deleteKeyCode:st,onMove:lt,onMoveStart:ct,onMoveEnd:ut,selectionKeyCode:ht,selectionOnDrag:dt,selectionMode:pt,onSelectionStart:mt,onSelectionEnd:gt,multiSelectionKeyCode:bt,panActivationKeyCode:yt,zoomActivationKeyCode:wt,elementsSelectable:vt,zoomOnScroll:xt,zoomOnPinch:St,panOnScroll:Et,panOnScrollSpeed:It,panOnScrollMode:Tt,zoomOnDoubleClick:$t,panOnDrag:Ut,defaultViewport:Lt,translateExtent:Bt,minZoom:Pt,maxZoom:kt,preventScrolling:At,onSelectionContextMenu:Rt,noWheelClassName:Wt,noPanClassName:jt,disableKeyboardA11y:Ot})=>{const Ct=useStore(selector$6),Dt=useKeyPress(ht),Mt=useKeyPress(yt),Vt=Mt||Ut,Qt=Mt||Et,rn=Dt||dt&&Vt!==!0;return useGlobalKeyHandler({deleteKeyCode:st,multiSelectionKeyCode:bt}),React$1.createElement(ZoomPane,{onMove:lt,onMoveStart:ct,onMoveEnd:ut,onPaneContextMenu:ot,elementsSelectable:vt,zoomOnScroll:xt,zoomOnPinch:St,panOnScroll:Qt,panOnScrollSpeed:It,panOnScrollMode:Tt,zoomOnDoubleClick:$t,panOnDrag:!Dt&&Vt,defaultViewport:Lt,translateExtent:Bt,minZoom:Pt,maxZoom:kt,zoomActivationKeyCode:wt,preventScrolling:At,noWheelClassName:Wt,noPanClassName:jt},React$1.createElement(Pane,{onSelectionStart:mt,onSelectionEnd:gt,onPaneClick:et,onPaneMouseEnter:nt,onPaneMouseMove:it,onPaneMouseLeave:rt,onPaneContextMenu:ot,onPaneScroll:at,panOnDrag:Vt,isSelecting:!!rn,selectionMode:pt},tt,Ct&&React$1.createElement(NodesSelection$1,{onSelectionContextMenu:Rt,noPanClassName:jt,disableKeyboardA11y:Ot})))};FlowRenderer.displayName="FlowRenderer";var FlowRenderer$1=reactExports.memo(FlowRenderer);function useVisibleNodes(tt){return useStore(reactExports.useCallback(nt=>tt?getNodesInside(nt.nodeInternals,{x:0,y:0,width:nt.width,height:nt.height},nt.transform,!0):nt.getNodes(),[tt]))}function createNodeTypes(tt){const et={input:wrapNode(tt.input||InputNode$1),default:wrapNode(tt.default||DefaultNode$1),output:wrapNode(tt.output||OutputNode$1),group:wrapNode(tt.group||GroupNode)},nt={},it=Object.keys(tt).filter(rt=>!["input","default","output","group"].includes(rt)).reduce((rt,ot)=>(rt[ot]=wrapNode(tt[ot]||DefaultNode$1),rt),nt);return{...et,...it}}const getPositionWithOrigin=({x:tt,y:et,width:nt,height:it,origin:rt})=>!nt||!it?{x:tt,y:et}:rt[0]<0||rt[1]<0||rt[0]>1||rt[1]>1?{x:tt,y:et}:{x:tt-nt*rt[0],y:et-it*rt[1]},selector$5=tt=>({nodesDraggable:tt.nodesDraggable,nodesConnectable:tt.nodesConnectable,nodesFocusable:tt.nodesFocusable,elementsSelectable:tt.elementsSelectable,updateNodeDimensions:tt.updateNodeDimensions,onError:tt.onError}),NodeRenderer=tt=>{const{nodesDraggable:et,nodesConnectable:nt,nodesFocusable:it,elementsSelectable:rt,updateNodeDimensions:ot,onError:at}=useStore(selector$5,shallow$1),st=useVisibleNodes(tt.onlyRenderVisibleElements),lt=reactExports.useRef(),ct=reactExports.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const ut=new ResizeObserver(ht=>{const dt=ht.map(pt=>({id:pt.target.getAttribute("data-id"),nodeElement:pt.target,forceUpdate:!0}));ot(dt)});return lt.current=ut,ut},[]);return reactExports.useEffect(()=>()=>{var ut;(ut=lt==null?void 0:lt.current)==null||ut.disconnect()},[]),React$1.createElement("div",{className:"react-flow__nodes",style:containerStyle},st.map(ut=>{var St,Et;let ht=ut.type||"default";tt.nodeTypes[ht]||(at==null||at("003",errorMessages.error003(ht)),ht="default");const dt=tt.nodeTypes[ht]||tt.nodeTypes.default,pt=!!(ut.draggable||et&&typeof ut.draggable>"u"),mt=!!(ut.selectable||rt&&typeof ut.selectable>"u"),gt=!!(ut.connectable||nt&&typeof ut.connectable>"u"),bt=!!(ut.focusable||it&&typeof ut.focusable>"u"),yt=tt.nodeExtent?clampPosition(ut.positionAbsolute,tt.nodeExtent):ut.positionAbsolute,wt=(yt==null?void 0:yt.x)??0,vt=(yt==null?void 0:yt.y)??0,xt=getPositionWithOrigin({x:wt,y:vt,width:ut.width??0,height:ut.height??0,origin:tt.nodeOrigin});return React$1.createElement(dt,{key:ut.id,id:ut.id,className:ut.className,style:ut.style,type:ht,data:ut.data,sourcePosition:ut.sourcePosition||Position.Bottom,targetPosition:ut.targetPosition||Position.Top,hidden:ut.hidden,xPos:wt,yPos:vt,xPosOrigin:xt.x,yPosOrigin:xt.y,selectNodesOnDrag:tt.selectNodesOnDrag,onClick:tt.onNodeClick,onMouseEnter:tt.onNodeMouseEnter,onMouseMove:tt.onNodeMouseMove,onMouseLeave:tt.onNodeMouseLeave,onContextMenu:tt.onNodeContextMenu,onDoubleClick:tt.onNodeDoubleClick,selected:!!ut.selected,isDraggable:pt,isSelectable:mt,isConnectable:gt,isFocusable:bt,resizeObserver:ct,dragHandle:ut.dragHandle,zIndex:((St=ut[internalsSymbol])==null?void 0:St.z)??0,isParent:!!((Et=ut[internalsSymbol])!=null&&Et.isParent),noDragClassName:tt.noDragClassName,noPanClassName:tt.noPanClassName,initialized:!!ut.width&&!!ut.height,rfId:tt.rfId,disableKeyboardA11y:tt.disableKeyboardA11y,ariaLabel:ut.ariaLabel})}))};NodeRenderer.displayName="NodeRenderer";var NodeRenderer$1=reactExports.memo(NodeRenderer);const shiftX=(tt,et,nt)=>nt===Position.Left?tt-et:nt===Position.Right?tt+et:tt,shiftY=(tt,et,nt)=>nt===Position.Top?tt-et:nt===Position.Bottom?tt+et:tt,EdgeUpdaterClassName="react-flow__edgeupdater",EdgeAnchor=({position:tt,centerX:et,centerY:nt,radius:it=10,onMouseDown:rt,onMouseEnter:ot,onMouseOut:at,type:st})=>React$1.createElement("circle",{onMouseDown:rt,onMouseEnter:ot,onMouseOut:at,className:cc([EdgeUpdaterClassName,`${EdgeUpdaterClassName}-${st}`]),cx:shiftX(et,it,tt),cy:shiftY(nt,it,tt),r:it,stroke:"transparent",fill:"transparent"}),alwaysValidConnection=()=>!0;var wrapEdge=tt=>{const et=({id:nt,className:it,type:rt,data:ot,onClick:at,onEdgeDoubleClick:st,selected:lt,animated:ct,label:ut,labelStyle:ht,labelShowBg:dt,labelBgStyle:pt,labelBgPadding:mt,labelBgBorderRadius:gt,style:bt,source:yt,target:wt,sourceX:vt,sourceY:xt,targetX:St,targetY:Et,sourcePosition:It,targetPosition:Tt,elementsSelectable:$t,hidden:Ut,sourceHandleId:Lt,targetHandleId:Bt,onContextMenu:Pt,onMouseEnter:kt,onMouseMove:At,onMouseLeave:Rt,edgeUpdaterRadius:Wt,onEdgeUpdate:jt,onEdgeUpdateStart:Ot,onEdgeUpdateEnd:Ct,markerEnd:Dt,markerStart:Mt,rfId:Vt,ariaLabel:Qt,isFocusable:rn,isUpdatable:Xt,pathOptions:an,interactionWidth:tn})=>{const pn=reactExports.useRef(null),[vn,sn]=reactExports.useState(!1),[Zt,Sn]=reactExports.useState(!1),Tn=useStoreApi(),Cn=reactExports.useMemo(()=>`url(#${getMarkerId(Mt,Vt)})`,[Mt,Vt]),jn=reactExports.useMemo(()=>`url(#${getMarkerId(Dt,Vt)})`,[Dt,Vt]);if(Ut)return null;const Un=_n=>{var Vn;const{edges:Mn,addSelectedEdges:Bn,unselectNodesAndEdges:Nn,multiSelectionActive:qn}=Tn.getState(),Wn=Mn.find(Fn=>Fn.id===nt);Wn&&($t&&(Tn.setState({nodesSelectionActive:!1}),Wn.selected&&qn?(Nn({nodes:[],edges:[Wn]}),(Vn=pn.current)==null||Vn.blur()):Bn([nt])),at&&at(_n,Wn))},yn=getMouseHandler$1(nt,Tn.getState,st),un=getMouseHandler$1(nt,Tn.getState,Pt),En=getMouseHandler$1(nt,Tn.getState,kt),In=getMouseHandler$1(nt,Tn.getState,At),xn=getMouseHandler$1(nt,Tn.getState,Rt),dn=(_n,Mn)=>{if(_n.button!==0)return;const{edges:Bn,isValidConnection:Nn}=Tn.getState(),qn=Mn?wt:yt,Wn=(Mn?Bt:Lt)||null,Vn=Mn?"target":"source",Fn=Nn||alwaysValidConnection,Jn=Mn,Hn=Bn.find(_r=>_r.id===nt);Sn(!0),Ot==null||Ot(_n,Hn,Vn);const dr=_r=>{Sn(!1),Ct==null||Ct(_r,Hn,Vn)};handlePointerDown({event:_n,handleId:Wn,nodeId:qn,onConnect:_r=>jt==null?void 0:jt(Hn,_r),isTarget:Jn,getState:Tn.getState,setState:Tn.setState,isValidConnection:Fn,edgeUpdaterType:Vn,onEdgeUpdateEnd:dr})},cn=_n=>dn(_n,!0),hn=_n=>dn(_n,!1),$n=()=>sn(!0),nn=()=>sn(!1),Kt=!$t&&!at,Yt=_n=>{var Mn;if(elementSelectionKeys.includes(_n.key)&&$t){const{unselectNodesAndEdges:Bn,addSelectedEdges:Nn,edges:qn}=Tn.getState();_n.key==="Escape"?((Mn=pn.current)==null||Mn.blur(),Bn({edges:[qn.find(Vn=>Vn.id===nt)]})):Nn([nt])}};return React$1.createElement("g",{className:cc(["react-flow__edge",`react-flow__edge-${rt}`,it,{selected:lt,animated:ct,inactive:Kt,updating:vn}]),onClick:Un,onDoubleClick:yn,onContextMenu:un,onMouseEnter:En,onMouseMove:In,onMouseLeave:xn,onKeyDown:rn?Yt:void 0,tabIndex:rn?0:void 0,role:rn?"button":"img","data-testid":`rf__edge-${nt}`,"aria-label":Qt===null?void 0:Qt||`Edge from ${yt} to ${wt}`,"aria-describedby":rn?`${ARIA_EDGE_DESC_KEY}-${Vt}`:void 0,ref:pn},!Zt&&React$1.createElement(tt,{id:nt,source:yt,target:wt,selected:lt,animated:ct,label:ut,labelStyle:ht,labelShowBg:dt,labelBgStyle:pt,labelBgPadding:mt,labelBgBorderRadius:gt,data:ot,style:bt,sourceX:vt,sourceY:xt,targetX:St,targetY:Et,sourcePosition:It,targetPosition:Tt,sourceHandleId:Lt,targetHandleId:Bt,markerStart:Cn,markerEnd:jn,pathOptions:an,interactionWidth:tn}),Xt&&React$1.createElement(React$1.Fragment,null,(Xt==="source"||Xt===!0)&&React$1.createElement(EdgeAnchor,{position:It,centerX:vt,centerY:xt,radius:Wt,onMouseDown:cn,onMouseEnter:$n,onMouseOut:nn,type:"source"}),(Xt==="target"||Xt===!0)&&React$1.createElement(EdgeAnchor,{position:Tt,centerX:St,centerY:Et,radius:Wt,onMouseDown:hn,onMouseEnter:$n,onMouseOut:nn,type:"target"})))};return et.displayName="EdgeWrapper",reactExports.memo(et)};function createEdgeTypes(tt){const et={default:wrapEdge(tt.default||BezierEdge),straight:wrapEdge(tt.bezier||StraightEdge),step:wrapEdge(tt.step||StepEdge),smoothstep:wrapEdge(tt.step||SmoothStepEdge),simplebezier:wrapEdge(tt.simplebezier||SimpleBezierEdge)},nt={},it=Object.keys(tt).filter(rt=>!["default","bezier"].includes(rt)).reduce((rt,ot)=>(rt[ot]=wrapEdge(tt[ot]||BezierEdge),rt),nt);return{...et,...it}}function getHandlePosition(tt,et,nt=null){const it=((nt==null?void 0:nt.x)||0)+et.x,rt=((nt==null?void 0:nt.y)||0)+et.y,ot=(nt==null?void 0:nt.width)||et.width,at=(nt==null?void 0:nt.height)||et.height;switch(tt){case Position.Top:return{x:it+ot/2,y:rt};case Position.Right:return{x:it+ot,y:rt+at/2};case Position.Bottom:return{x:it+ot/2,y:rt+at};case Position.Left:return{x:it,y:rt+at/2}}}function getHandle(tt,et){return tt?tt.length===1||!et?tt[0]:et&&tt.find(nt=>nt.id===et)||null:null}const getEdgePositions=(tt,et,nt,it,rt,ot)=>{const at=getHandlePosition(nt,tt,et),st=getHandlePosition(ot,it,rt);return{sourceX:at.x,sourceY:at.y,targetX:st.x,targetY:st.y}};function isEdgeVisible({sourcePos:tt,targetPos:et,sourceWidth:nt,sourceHeight:it,targetWidth:rt,targetHeight:ot,width:at,height:st,transform:lt}){const ct={x:Math.min(tt.x,et.x),y:Math.min(tt.y,et.y),x2:Math.max(tt.x+nt,et.x+rt),y2:Math.max(tt.y+it,et.y+ot)};ct.x===ct.x2&&(ct.x2+=1),ct.y===ct.y2&&(ct.y2+=1);const ut=rectToBox({x:(0-lt[0])/lt[2],y:(0-lt[1])/lt[2],width:at/lt[2],height:st/lt[2]}),ht=Math.max(0,Math.min(ut.x2,ct.x2)-Math.max(ut.x,ct.x)),dt=Math.max(0,Math.min(ut.y2,ct.y2)-Math.max(ut.y,ct.y));return Math.ceil(ht*dt)>0}function getNodeData(tt){var it,rt,ot,at,st;const et=((it=tt==null?void 0:tt[internalsSymbol])==null?void 0:it.handleBounds)||null,nt=et&&(tt==null?void 0:tt.width)&&(tt==null?void 0:tt.height)&&typeof((rt=tt==null?void 0:tt.positionAbsolute)==null?void 0:rt.x)<"u"&&typeof((ot=tt==null?void 0:tt.positionAbsolute)==null?void 0:ot.y)<"u";return[{x:((at=tt==null?void 0:tt.positionAbsolute)==null?void 0:at.x)||0,y:((st=tt==null?void 0:tt.positionAbsolute)==null?void 0:st.y)||0,width:(tt==null?void 0:tt.width)||0,height:(tt==null?void 0:tt.height)||0},et,!!nt]}const defaultEdgeTree=[{level:0,isMaxLevel:!0,edges:[]}];function groupEdgesByZLevel(tt,et,nt=!1){let it=-1;const rt=tt.reduce((at,st)=>{var ut,ht;const lt=isNumeric(st.zIndex);let ct=lt?st.zIndex:0;if(nt){const dt=et.get(st.target),pt=et.get(st.source),mt=st.selected||(dt==null?void 0:dt.selected)||(pt==null?void 0:pt.selected),gt=Math.max(((ut=pt==null?void 0:pt[internalsSymbol])==null?void 0:ut.z)||0,((ht=dt==null?void 0:dt[internalsSymbol])==null?void 0:ht.z)||0,1e3);ct=(lt?st.zIndex:0)+(mt?gt:0)}return at[ct]?at[ct].push(st):at[ct]=[st],it=ct>it?ct:it,at},{}),ot=Object.entries(rt).map(([at,st])=>{const lt=+at;return{edges:st,level:lt,isMaxLevel:lt===it}});return ot.length===0?defaultEdgeTree:ot}function useVisibleEdges(tt,et,nt){const it=useStore(reactExports.useCallback(rt=>tt?rt.edges.filter(ot=>{const at=et.get(ot.source),st=et.get(ot.target);return(at==null?void 0:at.width)&&(at==null?void 0:at.height)&&(st==null?void 0:st.width)&&(st==null?void 0:st.height)&&isEdgeVisible({sourcePos:at.positionAbsolute||{x:0,y:0},targetPos:st.positionAbsolute||{x:0,y:0},sourceWidth:at.width,sourceHeight:at.height,targetWidth:st.width,targetHeight:st.height,width:rt.width,height:rt.height,transform:rt.transform})}):rt.edges,[tt,et]));return groupEdgesByZLevel(it,et,nt)}const ArrowSymbol=({color:tt="none",strokeWidth:et=1})=>React$1.createElement("polyline",{style:{stroke:tt,strokeWidth:et},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),ArrowClosedSymbol=({color:tt="none",strokeWidth:et=1})=>React$1.createElement("polyline",{style:{stroke:tt,fill:tt,strokeWidth:et},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),MarkerSymbols={[MarkerType.Arrow]:ArrowSymbol,[MarkerType.ArrowClosed]:ArrowClosedSymbol};function useMarkerSymbol(tt){const et=useStoreApi();return reactExports.useMemo(()=>{var rt,ot;return Object.prototype.hasOwnProperty.call(MarkerSymbols,tt)?MarkerSymbols[tt]:((ot=(rt=et.getState()).onError)==null||ot.call(rt,"009",errorMessages.error009(tt)),null)},[tt])}const Marker=({id:tt,type:et,color:nt,width:it=12.5,height:rt=12.5,markerUnits:ot="strokeWidth",strokeWidth:at,orient:st="auto-start-reverse"})=>{const lt=useMarkerSymbol(et);return lt?React$1.createElement("marker",{className:"react-flow__arrowhead",id:tt,markerWidth:`${it}`,markerHeight:`${rt}`,viewBox:"-10 -10 20 20",markerUnits:ot,orient:st,refX:"0",refY:"0"},React$1.createElement(lt,{color:nt,strokeWidth:at})):null},markerSelector=({defaultColor:tt,rfId:et})=>nt=>{const it=[];return nt.edges.reduce((rt,ot)=>([ot.markerStart,ot.markerEnd].forEach(at=>{if(at&&typeof at=="object"){const st=getMarkerId(at,et);it.includes(st)||(rt.push({id:st,color:at.color||tt,...at}),it.push(st))}}),rt),[]).sort((rt,ot)=>rt.id.localeCompare(ot.id))},MarkerDefinitions=({defaultColor:tt,rfId:et})=>{const nt=useStore(reactExports.useCallback(markerSelector({defaultColor:tt,rfId:et}),[tt,et]),(it,rt)=>!(it.length!==rt.length||it.some((ot,at)=>ot.id!==rt[at].id)));return React$1.createElement("defs",null,nt.map(it=>React$1.createElement(Marker,{id:it.id,key:it.id,type:it.type,color:it.color,width:it.width,height:it.height,markerUnits:it.markerUnits,strokeWidth:it.strokeWidth,orient:it.orient})))};MarkerDefinitions.displayName="MarkerDefinitions";var MarkerDefinitions$1=reactExports.memo(MarkerDefinitions);const selector$4=tt=>({nodesConnectable:tt.nodesConnectable,edgesFocusable:tt.edgesFocusable,edgesUpdatable:tt.edgesUpdatable,elementsSelectable:tt.elementsSelectable,width:tt.width,height:tt.height,connectionMode:tt.connectionMode,nodeInternals:tt.nodeInternals,onError:tt.onError}),EdgeRenderer=({defaultMarkerColor:tt,onlyRenderVisibleElements:et,elevateEdgesOnSelect:nt,rfId:it,edgeTypes:rt,noPanClassName:ot,onEdgeUpdate:at,onEdgeContextMenu:st,onEdgeMouseEnter:lt,onEdgeMouseMove:ct,onEdgeMouseLeave:ut,onEdgeClick:ht,edgeUpdaterRadius:dt,onEdgeDoubleClick:pt,onEdgeUpdateStart:mt,onEdgeUpdateEnd:gt,children:bt})=>{const{edgesFocusable:yt,edgesUpdatable:wt,elementsSelectable:vt,width:xt,height:St,connectionMode:Et,nodeInternals:It,onError:Tt}=useStore(selector$4,shallow$1),$t=useVisibleEdges(et,It,nt);return xt?React$1.createElement(React$1.Fragment,null,$t.map(({level:Ut,edges:Lt,isMaxLevel:Bt})=>React$1.createElement("svg",{key:Ut,style:{zIndex:Ut},width:xt,height:St,className:"react-flow__edges react-flow__container"},Bt&&React$1.createElement(MarkerDefinitions$1,{defaultColor:tt,rfId:it}),React$1.createElement("g",null,Lt.map(Pt=>{const[kt,At,Rt]=getNodeData(It.get(Pt.source)),[Wt,jt,Ot]=getNodeData(It.get(Pt.target));if(!Rt||!Ot)return null;let Ct=Pt.type||"default";rt[Ct]||(Tt==null||Tt("011",errorMessages.error011(Ct)),Ct="default");const Dt=rt[Ct]||rt.default,Mt=Et===ConnectionMode.Strict?jt.target:(jt.target??[]).concat(jt.source??[]),Vt=getHandle(At.source,Pt.sourceHandle),Qt=getHandle(Mt,Pt.targetHandle),rn=(Vt==null?void 0:Vt.position)||Position.Bottom,Xt=(Qt==null?void 0:Qt.position)||Position.Top,an=!!(Pt.focusable||yt&&typeof Pt.focusable>"u"),tn=typeof at<"u"&&(Pt.updatable||wt&&typeof Pt.updatable>"u");if(!Vt||!Qt)return Tt==null||Tt("008",errorMessages.error008(Vt,Pt)),null;const{sourceX:pn,sourceY:vn,targetX:sn,targetY:Zt}=getEdgePositions(kt,Vt,rn,Wt,Qt,Xt);return React$1.createElement(Dt,{key:Pt.id,id:Pt.id,className:cc([Pt.className,ot]),type:Ct,data:Pt.data,selected:!!Pt.selected,animated:!!Pt.animated,hidden:!!Pt.hidden,label:Pt.label,labelStyle:Pt.labelStyle,labelShowBg:Pt.labelShowBg,labelBgStyle:Pt.labelBgStyle,labelBgPadding:Pt.labelBgPadding,labelBgBorderRadius:Pt.labelBgBorderRadius,style:Pt.style,source:Pt.source,target:Pt.target,sourceHandleId:Pt.sourceHandle,targetHandleId:Pt.targetHandle,markerEnd:Pt.markerEnd,markerStart:Pt.markerStart,sourceX:pn,sourceY:vn,targetX:sn,targetY:Zt,sourcePosition:rn,targetPosition:Xt,elementsSelectable:vt,onEdgeUpdate:at,onContextMenu:st,onMouseEnter:lt,onMouseMove:ct,onMouseLeave:ut,onClick:ht,edgeUpdaterRadius:dt,onEdgeDoubleClick:pt,onEdgeUpdateStart:mt,onEdgeUpdateEnd:gt,rfId:it,ariaLabel:Pt.ariaLabel,isFocusable:an,isUpdatable:tn,pathOptions:"pathOptions"in Pt?Pt.pathOptions:void 0,interactionWidth:Pt.interactionWidth})})))),bt):null};EdgeRenderer.displayName="EdgeRenderer";var EdgeRenderer$1=reactExports.memo(EdgeRenderer);const selector$3=tt=>`translate(${tt.transform[0]}px,${tt.transform[1]}px) scale(${tt.transform[2]})`;function Viewport({children:tt}){const et=useStore(selector$3);return React$1.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:et}},tt)}function useOnInitHandler(tt){const et=useReactFlow(),nt=reactExports.useRef(!1);reactExports.useEffect(()=>{!nt.current&&et.viewportInitialized&&tt&&(setTimeout(()=>tt(et),1),nt.current=!0)},[tt,et.viewportInitialized])}const oppositePosition={[Position.Left]:Position.Right,[Position.Right]:Position.Left,[Position.Top]:Position.Bottom,[Position.Bottom]:Position.Top},ConnectionLine=({nodeId:tt,handleType:et,style:nt,type:it=ConnectionLineType.Bezier,CustomComponent:rt,connectionStatus:ot})=>{var Et,It,Tt;const{fromNode:at,handleId:st,toX:lt,toY:ct,connectionMode:ut}=useStore(reactExports.useCallback($t=>({fromNode:$t.nodeInternals.get(tt),handleId:$t.connectionHandleId,toX:($t.connectionPosition.x-$t.transform[0])/$t.transform[2],toY:($t.connectionPosition.y-$t.transform[1])/$t.transform[2],connectionMode:$t.connectionMode}),[tt]),shallow$1),ht=(Et=at==null?void 0:at[internalsSymbol])==null?void 0:Et.handleBounds;let dt=ht==null?void 0:ht[et];if(ut===ConnectionMode.Loose&&(dt=dt||(ht==null?void 0:ht[et==="source"?"target":"source"])),!at||!dt)return null;const pt=st?dt.find($t=>$t.id===st):dt[0],mt=pt?pt.x+pt.width/2:(at.width??0)/2,gt=pt?pt.y+pt.height/2:at.height??0,bt=(((It=at.positionAbsolute)==null?void 0:It.x)??0)+mt,yt=(((Tt=at.positionAbsolute)==null?void 0:Tt.y)??0)+gt,wt=pt==null?void 0:pt.position,vt=wt?oppositePosition[wt]:null;if(!wt||!vt)return null;if(rt)return React$1.createElement(rt,{connectionLineType:it,connectionLineStyle:nt,fromNode:at,fromHandle:pt,fromX:bt,fromY:yt,toX:lt,toY:ct,fromPosition:wt,toPosition:vt,connectionStatus:ot});let xt="";const St={sourceX:bt,sourceY:yt,sourcePosition:wt,targetX:lt,targetY:ct,targetPosition:vt};return it===ConnectionLineType.Bezier?[xt]=getBezierPath(St):it===ConnectionLineType.Step?[xt]=getSmoothStepPath({...St,borderRadius:0}):it===ConnectionLineType.SmoothStep?[xt]=getSmoothStepPath(St):it===ConnectionLineType.SimpleBezier?[xt]=getSimpleBezierPath(St):xt=`M${bt},${yt} ${lt},${ct}`,React$1.createElement("path",{d:xt,fill:"none",className:"react-flow__connection-path",style:nt})};ConnectionLine.displayName="ConnectionLine";const selector$2=tt=>({nodeId:tt.connectionNodeId,handleType:tt.connectionHandleType,nodesConnectable:tt.nodesConnectable,connectionStatus:tt.connectionStatus,width:tt.width,height:tt.height});function ConnectionLineWrapper({containerStyle:tt,style:et,type:nt,component:it}){const{nodeId:rt,handleType:ot,nodesConnectable:at,width:st,height:lt,connectionStatus:ct}=useStore(selector$2,shallow$1);return!(rt&&ot&&st&&at)?null:React$1.createElement("svg",{style:tt,width:st,height:lt,className:"react-flow__edges react-flow__connectionline react-flow__container"},React$1.createElement("g",{className:cc(["react-flow__connection",ct])},React$1.createElement(ConnectionLine,{nodeId:rt,handleType:ot,style:et,type:nt,CustomComponent:it,connectionStatus:ct})))}function useNodeOrEdgeTypes(tt,et){return reactExports.useRef(null),useStoreApi(),reactExports.useMemo(()=>et(tt),[tt])}const GraphView=({nodeTypes:tt,edgeTypes:et,onMove:nt,onMoveStart:it,onMoveEnd:rt,onInit:ot,onNodeClick:at,onEdgeClick:st,onNodeDoubleClick:lt,onEdgeDoubleClick:ct,onNodeMouseEnter:ut,onNodeMouseMove:ht,onNodeMouseLeave:dt,onNodeContextMenu:pt,onSelectionContextMenu:mt,onSelectionStart:gt,onSelectionEnd:bt,connectionLineType:yt,connectionLineStyle:wt,connectionLineComponent:vt,connectionLineContainerStyle:xt,selectionKeyCode:St,selectionOnDrag:Et,selectionMode:It,multiSelectionKeyCode:Tt,panActivationKeyCode:$t,zoomActivationKeyCode:Ut,deleteKeyCode:Lt,onlyRenderVisibleElements:Bt,elementsSelectable:Pt,selectNodesOnDrag:kt,defaultViewport:At,translateExtent:Rt,minZoom:Wt,maxZoom:jt,preventScrolling:Ot,defaultMarkerColor:Ct,zoomOnScroll:Dt,zoomOnPinch:Mt,panOnScroll:Vt,panOnScrollSpeed:Qt,panOnScrollMode:rn,zoomOnDoubleClick:Xt,panOnDrag:an,onPaneClick:tn,onPaneMouseEnter:pn,onPaneMouseMove:vn,onPaneMouseLeave:sn,onPaneScroll:Zt,onPaneContextMenu:Sn,onEdgeUpdate:Tn,onEdgeContextMenu:Cn,onEdgeMouseEnter:jn,onEdgeMouseMove:Un,onEdgeMouseLeave:yn,edgeUpdaterRadius:un,onEdgeUpdateStart:En,onEdgeUpdateEnd:In,noDragClassName:xn,noWheelClassName:dn,noPanClassName:cn,elevateEdgesOnSelect:hn,disableKeyboardA11y:$n,nodeOrigin:nn,nodeExtent:Kt,rfId:Yt})=>{const _n=useNodeOrEdgeTypes(tt,createNodeTypes),Mn=useNodeOrEdgeTypes(et,createEdgeTypes);return useOnInitHandler(ot),React$1.createElement(FlowRenderer$1,{onPaneClick:tn,onPaneMouseEnter:pn,onPaneMouseMove:vn,onPaneMouseLeave:sn,onPaneContextMenu:Sn,onPaneScroll:Zt,deleteKeyCode:Lt,selectionKeyCode:St,selectionOnDrag:Et,selectionMode:It,onSelectionStart:gt,onSelectionEnd:bt,multiSelectionKeyCode:Tt,panActivationKeyCode:$t,zoomActivationKeyCode:Ut,elementsSelectable:Pt,onMove:nt,onMoveStart:it,onMoveEnd:rt,zoomOnScroll:Dt,zoomOnPinch:Mt,zoomOnDoubleClick:Xt,panOnScroll:Vt,panOnScrollSpeed:Qt,panOnScrollMode:rn,panOnDrag:an,defaultViewport:At,translateExtent:Rt,minZoom:Wt,maxZoom:jt,onSelectionContextMenu:mt,preventScrolling:Ot,noDragClassName:xn,noWheelClassName:dn,noPanClassName:cn,disableKeyboardA11y:$n},React$1.createElement(Viewport,null,React$1.createElement(EdgeRenderer$1,{edgeTypes:Mn,onEdgeClick:st,onEdgeDoubleClick:ct,onEdgeUpdate:Tn,onlyRenderVisibleElements:Bt,onEdgeContextMenu:Cn,onEdgeMouseEnter:jn,onEdgeMouseMove:Un,onEdgeMouseLeave:yn,onEdgeUpdateStart:En,onEdgeUpdateEnd:In,edgeUpdaterRadius:un,defaultMarkerColor:Ct,noPanClassName:cn,elevateEdgesOnSelect:!!hn,disableKeyboardA11y:$n,rfId:Yt},React$1.createElement(ConnectionLineWrapper,{style:wt,type:yt,component:vt,containerStyle:xt})),React$1.createElement("div",{className:"react-flow__edgelabel-renderer"}),React$1.createElement(NodeRenderer$1,{nodeTypes:_n,onNodeClick:at,onNodeDoubleClick:lt,onNodeMouseEnter:ut,onNodeMouseMove:ht,onNodeMouseLeave:dt,onNodeContextMenu:pt,selectNodesOnDrag:kt,onlyRenderVisibleElements:Bt,noPanClassName:cn,noDragClassName:xn,disableKeyboardA11y:$n,nodeOrigin:nn,nodeExtent:Kt,rfId:Yt})))};GraphView.displayName="GraphView";var GraphView$1=reactExports.memo(GraphView);const infiniteExtent=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],initialState={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:infiniteExtent,nodeExtent:infiniteExtent,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ConnectionMode.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:devWarn,isValidConnection:void 0},createRFStore=()=>createWithEqualityFn((tt,et)=>({...initialState,setNodes:nt=>{const{nodeInternals:it,nodeOrigin:rt,elevateNodesOnSelect:ot}=et();tt({nodeInternals:createNodeInternals(nt,it,rt,ot)})},getNodes:()=>Array.from(et().nodeInternals.values()),setEdges:nt=>{const{defaultEdgeOptions:it={}}=et();tt({edges:nt.map(rt=>({...it,...rt}))})},setDefaultNodesAndEdges:(nt,it)=>{const rt=typeof nt<"u",ot=typeof it<"u",at=rt?createNodeInternals(nt,new Map,et().nodeOrigin,et().elevateNodesOnSelect):new Map;tt({nodeInternals:at,edges:ot?it:[],hasDefaultNodes:rt,hasDefaultEdges:ot})},updateNodeDimensions:nt=>{const{onNodesChange:it,nodeInternals:rt,fitViewOnInit:ot,fitViewOnInitDone:at,fitViewOnInitOptions:st,domNode:lt,nodeOrigin:ct}=et(),ut=lt==null?void 0:lt.querySelector(".react-flow__viewport");if(!ut)return;const ht=window.getComputedStyle(ut),{m22:dt}=new window.DOMMatrixReadOnly(ht.transform),pt=nt.reduce((gt,bt)=>{const yt=rt.get(bt.id);if(yt){const wt=getDimensions(bt.nodeElement);!!(wt.width&&wt.height&&(yt.width!==wt.width||yt.height!==wt.height||bt.forceUpdate))&&(rt.set(yt.id,{...yt,[internalsSymbol]:{...yt[internalsSymbol],handleBounds:{source:getHandleBounds(".source",bt.nodeElement,dt,ct),target:getHandleBounds(".target",bt.nodeElement,dt,ct)}},...wt}),gt.push({id:yt.id,type:"dimensions",dimensions:wt}))}return gt},[]);updateAbsoluteNodePositions(rt,ct);const mt=at||ot&&!at&&fitView(et,{initial:!0,...st});tt({nodeInternals:new Map(rt),fitViewOnInitDone:mt}),(pt==null?void 0:pt.length)>0&&(it==null||it(pt))},updateNodePositions:(nt,it=!0,rt=!1)=>{const{triggerNodeChanges:ot}=et(),at=nt.map(st=>{const lt={id:st.id,type:"position",dragging:rt};return it&&(lt.positionAbsolute=st.positionAbsolute,lt.position=st.position),lt});ot(at)},triggerNodeChanges:nt=>{const{onNodesChange:it,nodeInternals:rt,hasDefaultNodes:ot,nodeOrigin:at,getNodes:st,elevateNodesOnSelect:lt}=et();if(nt!=null&&nt.length){if(ot){const ct=applyNodeChanges(nt,st()),ut=createNodeInternals(ct,rt,at,lt);tt({nodeInternals:ut})}it==null||it(nt)}},addSelectedNodes:nt=>{const{multiSelectionActive:it,edges:rt,getNodes:ot}=et();let at,st=null;it?at=nt.map(lt=>createSelectionChange(lt,!0)):(at=getSelectionChanges(ot(),nt),st=getSelectionChanges(rt,[])),updateNodesAndEdgesSelections({changedNodes:at,changedEdges:st,get:et,set:tt})},addSelectedEdges:nt=>{const{multiSelectionActive:it,edges:rt,getNodes:ot}=et();let at,st=null;it?at=nt.map(lt=>createSelectionChange(lt,!0)):(at=getSelectionChanges(rt,nt),st=getSelectionChanges(ot(),[])),updateNodesAndEdgesSelections({changedNodes:st,changedEdges:at,get:et,set:tt})},unselectNodesAndEdges:({nodes:nt,edges:it}={})=>{const{edges:rt,getNodes:ot}=et(),at=nt||ot(),st=it||rt,lt=at.map(ut=>(ut.selected=!1,createSelectionChange(ut.id,!1))),ct=st.map(ut=>createSelectionChange(ut.id,!1));updateNodesAndEdgesSelections({changedNodes:lt,changedEdges:ct,get:et,set:tt})},setMinZoom:nt=>{const{d3Zoom:it,maxZoom:rt}=et();it==null||it.scaleExtent([nt,rt]),tt({minZoom:nt})},setMaxZoom:nt=>{const{d3Zoom:it,minZoom:rt}=et();it==null||it.scaleExtent([rt,nt]),tt({maxZoom:nt})},setTranslateExtent:nt=>{var it;(it=et().d3Zoom)==null||it.translateExtent(nt),tt({translateExtent:nt})},resetSelectedElements:()=>{const{edges:nt,getNodes:it}=et(),ot=it().filter(st=>st.selected).map(st=>createSelectionChange(st.id,!1)),at=nt.filter(st=>st.selected).map(st=>createSelectionChange(st.id,!1));updateNodesAndEdgesSelections({changedNodes:ot,changedEdges:at,get:et,set:tt})},setNodeExtent:nt=>{const{nodeInternals:it}=et();it.forEach(rt=>{rt.positionAbsolute=clampPosition(rt.position,nt)}),tt({nodeExtent:nt,nodeInternals:new Map(it)})},panBy:nt=>{const{transform:it,width:rt,height:ot,d3Zoom:at,d3Selection:st,translateExtent:lt}=et();if(!at||!st||!nt.x&&!nt.y)return!1;const ct=identity.translate(it[0]+nt.x,it[1]+nt.y).scale(it[2]),ut=[[0,0],[rt,ot]],ht=at==null?void 0:at.constrain()(ct,ut,lt);return at.transform(st,ht),it[0]!==ht.x||it[1]!==ht.y||it[2]!==ht.k},cancelConnection:()=>tt({connectionNodeId:initialState.connectionNodeId,connectionHandleId:initialState.connectionHandleId,connectionHandleType:initialState.connectionHandleType,connectionStatus:initialState.connectionStatus,connectionStartHandle:initialState.connectionStartHandle,connectionEndHandle:initialState.connectionEndHandle}),reset:()=>tt({...initialState})}),Object.is),ReactFlowProvider=({children:tt})=>{const et=reactExports.useRef(null);return et.current||(et.current=createRFStore()),React$1.createElement(Provider$1,{value:et.current},tt)};ReactFlowProvider.displayName="ReactFlowProvider";const Wrapper$9=({children:tt})=>reactExports.useContext(StoreContext)?React$1.createElement(React$1.Fragment,null,tt):React$1.createElement(ReactFlowProvider,null,tt);Wrapper$9.displayName="ReactFlowWrapper";const defaultNodeTypes={input:InputNode$1,default:DefaultNode$1,output:OutputNode$1,group:GroupNode},defaultEdgeTypes={default:BezierEdge,straight:StraightEdge,step:StepEdge,smoothstep:SmoothStepEdge,simplebezier:SimpleBezierEdge},initNodeOrigin=[0,0],initSnapGrid=[15,15],initDefaultViewport={x:0,y:0,zoom:1},wrapperStyle={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ReactFlow=reactExports.forwardRef(({nodes:tt,edges:et,defaultNodes:nt,defaultEdges:it,className:rt,nodeTypes:ot=defaultNodeTypes,edgeTypes:at=defaultEdgeTypes,onNodeClick:st,onEdgeClick:lt,onInit:ct,onMove:ut,onMoveStart:ht,onMoveEnd:dt,onConnect:pt,onConnectStart:mt,onConnectEnd:gt,onClickConnectStart:bt,onClickConnectEnd:yt,onNodeMouseEnter:wt,onNodeMouseMove:vt,onNodeMouseLeave:xt,onNodeContextMenu:St,onNodeDoubleClick:Et,onNodeDragStart:It,onNodeDrag:Tt,onNodeDragStop:$t,onNodesDelete:Ut,onEdgesDelete:Lt,onSelectionChange:Bt,onSelectionDragStart:Pt,onSelectionDrag:kt,onSelectionDragStop:At,onSelectionContextMenu:Rt,onSelectionStart:Wt,onSelectionEnd:jt,connectionMode:Ot=ConnectionMode.Strict,connectionLineType:Ct=ConnectionLineType.Bezier,connectionLineStyle:Dt,connectionLineComponent:Mt,connectionLineContainerStyle:Vt,deleteKeyCode:Qt="Backspace",selectionKeyCode:rn="Shift",selectionOnDrag:Xt=!1,selectionMode:an=SelectionMode.Full,panActivationKeyCode:tn="Space",multiSelectionKeyCode:pn=isMacOs()?"Meta":"Control",zoomActivationKeyCode:vn=isMacOs()?"Meta":"Control",snapToGrid:sn=!1,snapGrid:Zt=initSnapGrid,onlyRenderVisibleElements:Sn=!1,selectNodesOnDrag:Tn=!0,nodesDraggable:Cn,nodesConnectable:jn,nodesFocusable:Un,nodeOrigin:yn=initNodeOrigin,edgesFocusable:un,edgesUpdatable:En,elementsSelectable:In,defaultViewport:xn=initDefaultViewport,minZoom:dn=.5,maxZoom:cn=2,translateExtent:hn=infiniteExtent,preventScrolling:$n=!0,nodeExtent:nn,defaultMarkerColor:Kt="#b1b1b7",zoomOnScroll:Yt=!0,zoomOnPinch:_n=!0,panOnScroll:Mn=!1,panOnScrollSpeed:Bn=.5,panOnScrollMode:Nn=PanOnScrollMode.Free,zoomOnDoubleClick:qn=!0,panOnDrag:Wn=!0,onPaneClick:Vn,onPaneMouseEnter:Fn,onPaneMouseMove:Jn,onPaneMouseLeave:Hn,onPaneScroll:dr,onPaneContextMenu:ur,children:_r,onEdgeUpdate:Qr,onEdgeContextMenu:jr,onEdgeDoubleClick:Mr,onEdgeMouseEnter:qr,onEdgeMouseMove:Ur,onEdgeMouseLeave:Lr,onEdgeUpdateStart:ao,onEdgeUpdateEnd:Gr,edgeUpdaterRadius:Br=10,onNodesChange:go,onEdgesChange:wn,noDragClassName:Pn="nodrag",noWheelClassName:fn="nowheel",noPanClassName:Jt="nopan",fitView:kn=!1,fitViewOptions:On,connectOnClick:Dn=!0,attributionPosition:Kn,proOptions:er,defaultEdgeOptions:or,elevateNodesOnSelect:ar=!0,elevateEdgesOnSelect:Vr=!1,disableKeyboardA11y:wr=!1,autoPanOnConnect:Or=!0,autoPanOnNodeDrag:Hr=!0,connectionRadius:no=20,isValidConnection:Xr,onError:Jr,style:br,id:$r,nodeDragThreshold:Dr,...Cr},Ar)=>{const Nr=$r||"1";return React$1.createElement("div",{...Cr,style:{...br,...wrapperStyle},ref:Ar,className:cc(["react-flow",rt]),"data-testid":"rf__wrapper",id:$r},React$1.createElement(Wrapper$9,null,React$1.createElement(GraphView$1,{onInit:ct,onMove:ut,onMoveStart:ht,onMoveEnd:dt,onNodeClick:st,onEdgeClick:lt,onNodeMouseEnter:wt,onNodeMouseMove:vt,onNodeMouseLeave:xt,onNodeContextMenu:St,onNodeDoubleClick:Et,nodeTypes:ot,edgeTypes:at,connectionLineType:Ct,connectionLineStyle:Dt,connectionLineComponent:Mt,connectionLineContainerStyle:Vt,selectionKeyCode:rn,selectionOnDrag:Xt,selectionMode:an,deleteKeyCode:Qt,multiSelectionKeyCode:pn,panActivationKeyCode:tn,zoomActivationKeyCode:vn,onlyRenderVisibleElements:Sn,selectNodesOnDrag:Tn,defaultViewport:xn,translateExtent:hn,minZoom:dn,maxZoom:cn,preventScrolling:$n,zoomOnScroll:Yt,zoomOnPinch:_n,zoomOnDoubleClick:qn,panOnScroll:Mn,panOnScrollSpeed:Bn,panOnScrollMode:Nn,panOnDrag:Wn,onPaneClick:Vn,onPaneMouseEnter:Fn,onPaneMouseMove:Jn,onPaneMouseLeave:Hn,onPaneScroll:dr,onPaneContextMenu:ur,onSelectionContextMenu:Rt,onSelectionStart:Wt,onSelectionEnd:jt,onEdgeUpdate:Qr,onEdgeContextMenu:jr,onEdgeDoubleClick:Mr,onEdgeMouseEnter:qr,onEdgeMouseMove:Ur,onEdgeMouseLeave:Lr,onEdgeUpdateStart:ao,onEdgeUpdateEnd:Gr,edgeUpdaterRadius:Br,defaultMarkerColor:Kt,noDragClassName:Pn,noWheelClassName:fn,noPanClassName:Jt,elevateEdgesOnSelect:Vr,rfId:Nr,disableKeyboardA11y:wr,nodeOrigin:yn,nodeExtent:nn}),React$1.createElement(StoreUpdater,{nodes:tt,edges:et,defaultNodes:nt,defaultEdges:it,onConnect:pt,onConnectStart:mt,onConnectEnd:gt,onClickConnectStart:bt,onClickConnectEnd:yt,nodesDraggable:Cn,nodesConnectable:jn,nodesFocusable:Un,edgesFocusable:un,edgesUpdatable:En,elementsSelectable:In,elevateNodesOnSelect:ar,minZoom:dn,maxZoom:cn,nodeExtent:nn,onNodesChange:go,onEdgesChange:wn,snapToGrid:sn,snapGrid:Zt,connectionMode:Ot,translateExtent:hn,connectOnClick:Dn,defaultEdgeOptions:or,fitView:kn,fitViewOptions:On,onNodesDelete:Ut,onEdgesDelete:Lt,onNodeDragStart:It,onNodeDrag:Tt,onNodeDragStop:$t,onSelectionDrag:kt,onSelectionDragStart:Pt,onSelectionDragStop:At,noPanClassName:Jt,nodeOrigin:yn,rfId:Nr,autoPanOnConnect:Or,autoPanOnNodeDrag:Hr,onError:Jr,connectionRadius:no,isValidConnection:Xr,nodeDragThreshold:Dr}),React$1.createElement(Wrapper$1$1,{onSelectionChange:Bt}),_r,React$1.createElement(Attribution,{proOptions:er,position:Kn}),React$1.createElement(A11yDescriptions,{rfId:Nr,disableKeyboardA11y:wr})))});ReactFlow.displayName="ReactFlow";const ITEM_HEIGHT=48,ITEM_PADDING_TOP=8,MenuProps={PaperProps:{style:{maxHeight:ITEM_HEIGHT*4.5+ITEM_PADDING_TOP,width:250}}},names=["Beginner","Intermediate","Advanced","Expert"],AskQuestion=()=>{const tt=useDataStore(vt=>vt.data),[et,nt]=reactExports.useState(""),[it,rt]=reactExports.useState("Beginner"),ot=useAppStore(vt=>vt.currentSearch),at=reactExports.useRef(!1),st=useSocket(),[lt]=useUserStore(vt=>[vt.setBudget]),[ct,ut,ht,dt,pt]=useTeachStore(vt=>[vt.askedQuestions,vt.askedQuestionsAnswers,vt.setAskedQuestion,vt.setAskedQuestionAnswer,vt.hasQuestionInProgress]),mt=reactExports.useCallback(vt=>{dt(vt.answer),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"Response is ready"}),{position:toast.POSITION.BOTTOM_CENTER,type:"success"})},[dt]);reactExports.useEffect(()=>{at.current||mt&&st&&(st.on("askquestionhook",mt),at.current=!0)},[mt,st]);const gt=async()=>{et&&(ht(et),nt(""));try{const vt=tt==null?void 0:tt.nodes.filter(Et=>Et.text),xt=vt==null?void 0:vt.slice(0,5),St=(xt!=null&&xt.length?xt.map(Et=>Et.text).join(" "):"").substring(0,2500).replace(/[?&=+/#]/g,Et=>`\\${Et}`);ot&&(await distExports$1.enable(),await postAskQuestion({expertise_level:it,question_text:et,search_term:ot,transcripts:St}),await updateBudget(lt),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"We started preparing response for you"}),{type:"success"}))}catch(vt){console.error(vt)}},bt=it&&et.trim()&&!pt,yt=vt=>{rt(vt.target.value)},wt=async vt=>{if(pt){vt.preventDefault();return}vt.keyCode===13&&vt.shiftKey===!1&&bt&&(vt.preventDefault(),gt())};return jsxRuntimeExports.jsxs(AskQuestionContainer,{children:[jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(FormControl$1,{component:"div",children:[jsxRuntimeExports.jsx(StyledInput,{id:"select-label",size:"small",children:"Expertise level"}),jsxRuntimeExports.jsx(StyledSelect,{id:"demo-multiple-name",input:jsxRuntimeExports.jsx(OutlinedInput$1,{label:"Expertise level"}),labelId:"select-label",MenuProps,onChange:yt,size:"small",value:it,children:names.map(vt=>jsxRuntimeExports.jsx(MenuItem$6,{component:"li",value:vt,children:vt},vt))})]})})}),jsxRuntimeExports.jsx(ResponsesWrapper,{children:ct==null?void 0:ct.map((vt,xt)=>jsxRuntimeExports.jsxs(Flex,{className:"response",py:12,children:[jsxRuntimeExports.jsx(Text$4,{kind:"medium",children:vt}),jsxRuntimeExports.jsx(Flex,{py:12,children:(ut==null?void 0:ut[xt])!==void 0?jsxRuntimeExports.jsx(Text$4,{color:"unreadMsgText",children:ut[xt]}):jsxRuntimeExports.jsxs(Flex,{align:"center",py:12,children:[jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(Text$4,{children:"Generating response"})})]})})]},vt))}),jsxRuntimeExports.jsxs(TextAreaWrapper,{onKeyDown:wt,py:12,tabIndex:-1,children:[jsxRuntimeExports.jsx(StyledTextarea,{disabled:pt,onChange:vt=>nt(vt.target.value),placeholder:"Enter your question",value:et}),jsxRuntimeExports.jsx(IconWrapper,{children:jsxRuntimeExports.jsx(MdSend,{color:bt?colors.white:colors.gray300,size:"18"})})]})]})},AskQuestionContainer=styled$4.div` +`;const CloseIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"cancel",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1264_3381",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"32",height:"32",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1264_3381)",children:jsxRuntimeExports.jsx("path",{id:"cancel_2",d:"M16 17.4051L20.0975 21.5025C20.2821 21.6872 20.5141 21.7816 20.7936 21.7859C21.0731 21.7902 21.3094 21.6957 21.5025 21.5025C21.6957 21.3094 21.7923 21.0752 21.7923 20.8C21.7923 20.5248 21.6957 20.2906 21.5025 20.0975L17.4051 16L21.5025 11.9025C21.6872 11.7179 21.7816 11.4859 21.7859 11.2064C21.7902 10.9269 21.6957 10.6906 21.5025 10.4975C21.3094 10.3043 21.0752 10.2077 20.8 10.2077C20.5248 10.2077 20.2906 10.3043 20.0975 10.4975L16 14.5949L11.9025 10.4975C11.7179 10.3129 11.4859 10.2184 11.2064 10.2141C10.9269 10.2099 10.6906 10.3043 10.4975 10.4975C10.3043 10.6906 10.2077 10.9248 10.2077 11.2C10.2077 11.4752 10.3043 11.7094 10.4975 11.9025L14.5949 16L10.4975 20.0975C10.3129 20.2821 10.2184 20.5141 10.2141 20.7936C10.2099 21.0731 10.3043 21.3094 10.4975 21.5025C10.6906 21.6957 10.9248 21.7923 11.2 21.7923C11.4752 21.7923 11.7094 21.6957 11.9025 21.5025L16 17.4051ZM16.0022 28.6666C14.2503 28.6666 12.6036 28.3342 11.0621 27.6693C9.52057 27.0044 8.17966 26.1021 7.03937 24.9623C5.89906 23.8225 4.99632 22.4822 4.33114 20.9413C3.66596 19.4005 3.33337 17.7542 3.33337 16.0022C3.33337 14.2503 3.66582 12.6036 4.33071 11.0621C4.9956 9.52057 5.89793 8.17967 7.03771 7.03938C8.17751 5.89907 9.51783 4.99632 11.0587 4.33114C12.5995 3.66596 14.2459 3.33337 15.9978 3.33337C17.7497 3.33337 19.3964 3.66582 20.9379 4.33071C22.4794 4.9956 23.8204 5.89793 24.9606 7.03771C26.101 8.17751 27.0037 9.51783 27.6689 11.0587C28.3341 12.5995 28.6666 14.2459 28.6666 15.9978C28.6666 17.7497 28.3342 19.3964 27.6693 20.9379C27.0044 22.4794 26.1021 23.8204 24.9623 24.9606C23.8225 26.101 22.4822 27.0037 20.9413 27.6689C19.4005 28.3341 17.7542 28.6666 16.0022 28.6666Z",fill:"currentColor"})})]})}),TextType=()=>{const tt=useSelectedNode();return jsxRuntimeExports.jsx(Flex,{align:"center",justify:"center",p:12,children:jsxRuntimeExports.jsx(Text$4,{color:"primaryText1",kind:"regular",children:tt==null?void 0:tt.text})})};function cc(tt){if(typeof tt=="string"||typeof tt=="number")return""+tt;let et="";if(Array.isArray(tt))for(let nt=0,it;nt{const nt=createStore$3(tt),it=(rt,ot=et)=>useStoreWithEqualityFn(nt,rt,ot);return Object.assign(it,nt),it},createWithEqualityFn=(tt,et)=>tt?createWithEqualityFnImpl(tt,et):createWithEqualityFnImpl;function shallow$1(tt,et){if(Object.is(tt,et))return!0;if(typeof tt!="object"||tt===null||typeof et!="object"||et===null)return!1;if(tt instanceof Map&&et instanceof Map){if(tt.size!==et.size)return!1;for(const[it,rt]of tt)if(!Object.is(rt,et.get(it)))return!1;return!0}if(tt instanceof Set&&et instanceof Set){if(tt.size!==et.size)return!1;for(const it of tt)if(!et.has(it))return!1;return!0}const nt=Object.keys(tt);if(nt.length!==Object.keys(et).length)return!1;for(let it=0;it=0&&(et=tt.slice(0,nt))!=="xmlns"&&(tt=tt.slice(nt+1)),namespaces.hasOwnProperty(et)?{space:namespaces[et],local:tt}:tt}function creatorInherit(tt){return function(){var et=this.ownerDocument,nt=this.namespaceURI;return nt===xhtml&&et.documentElement.namespaceURI===xhtml?et.createElement(tt):et.createElementNS(nt,tt)}}function creatorFixed(tt){return function(){return this.ownerDocument.createElementNS(tt.space,tt.local)}}function creator(tt){var et=namespace(tt);return(et.local?creatorFixed:creatorInherit)(et)}function none(){}function selector(tt){return tt==null?none:function(){return this.querySelector(tt)}}function selection_select(tt){typeof tt!="function"&&(tt=selector(tt));for(var et=this._groups,nt=et.length,it=new Array(nt),rt=0;rt=vt&&(vt=wt+1);!(St=bt[vt])&&++vt=0;)(at=it[rt])&&(ot&&at.compareDocumentPosition(ot)^4&&ot.parentNode.insertBefore(at,ot),ot=at);return this}function selection_sort(tt){tt||(tt=ascending);function et(ht,dt){return ht&&dt?tt(ht.__data__,dt.__data__):!ht-!dt}for(var nt=this._groups,it=nt.length,rt=new Array(it),ot=0;otet?1:tt>=et?0:NaN}function selection_call(){var tt=arguments[0];return arguments[0]=this,tt.apply(null,arguments),this}function selection_nodes(){return Array.from(this)}function selection_node(){for(var tt=this._groups,et=0,nt=tt.length;et1?this.each((et==null?styleRemove$1:typeof et=="function"?styleFunction$1:styleConstant$1)(tt,et,nt??"")):styleValue(this.node(),tt)}function styleValue(tt,et){return tt.style.getPropertyValue(et)||defaultView(tt).getComputedStyle(tt,null).getPropertyValue(et)}function propertyRemove(tt){return function(){delete this[tt]}}function propertyConstant(tt,et){return function(){this[tt]=et}}function propertyFunction(tt,et){return function(){var nt=et.apply(this,arguments);nt==null?delete this[tt]:this[tt]=nt}}function selection_property(tt,et){return arguments.length>1?this.each((et==null?propertyRemove:typeof et=="function"?propertyFunction:propertyConstant)(tt,et)):this.node()[tt]}function classArray(tt){return tt.trim().split(/^|\s+/)}function classList(tt){return tt.classList||new ClassList(tt)}function ClassList(tt){this._node=tt,this._names=classArray(tt.getAttribute("class")||"")}ClassList.prototype={add:function(tt){var et=this._names.indexOf(tt);et<0&&(this._names.push(tt),this._node.setAttribute("class",this._names.join(" ")))},remove:function(tt){var et=this._names.indexOf(tt);et>=0&&(this._names.splice(et,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(tt){return this._names.indexOf(tt)>=0}};function classedAdd(tt,et){for(var nt=classList(tt),it=-1,rt=et.length;++it=0&&(nt=et.slice(it+1),et=et.slice(0,it)),{type:et,name:nt}})}function onRemove(tt){return function(){var et=this.__on;if(et){for(var nt=0,it=-1,rt=et.length,ot;nt()=>tt;function DragEvent(tt,{sourceEvent:et,subject:nt,target:it,identifier:rt,active:ot,x:at,y:st,dx:lt,dy:ct,dispatch:ut}){Object.defineProperties(this,{type:{value:tt,enumerable:!0,configurable:!0},sourceEvent:{value:et,enumerable:!0,configurable:!0},subject:{value:nt,enumerable:!0,configurable:!0},target:{value:it,enumerable:!0,configurable:!0},identifier:{value:rt,enumerable:!0,configurable:!0},active:{value:ot,enumerable:!0,configurable:!0},x:{value:at,enumerable:!0,configurable:!0},y:{value:st,enumerable:!0,configurable:!0},dx:{value:lt,enumerable:!0,configurable:!0},dy:{value:ct,enumerable:!0,configurable:!0},_:{value:ut}})}DragEvent.prototype.on=function(){var tt=this._.on.apply(this._,arguments);return tt===this._?this:tt};function defaultFilter$1(tt){return!tt.ctrlKey&&!tt.button}function defaultContainer(){return this.parentNode}function defaultSubject(tt,et){return et??{x:tt.x,y:tt.y}}function defaultTouchable$1(){return navigator.maxTouchPoints||"ontouchstart"in this}function drag(){var tt=defaultFilter$1,et=defaultContainer,nt=defaultSubject,it=defaultTouchable$1,rt={},ot=dispatch("start","drag","end"),at=0,st,lt,ct,ut,ht=0;function dt(xt){xt.on("mousedown.drag",pt).filter(it).on("touchstart.drag",bt).on("touchmove.drag",yt,nonpassive).on("touchend.drag touchcancel.drag",wt).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function pt(xt,St){if(!(ut||!tt.call(this,xt,St))){var Et=vt(this,et.call(this,xt,St),xt,St,"mouse");Et&&(select(xt.view).on("mousemove.drag",mt,nonpassivecapture).on("mouseup.drag",gt,nonpassivecapture),dragDisable(xt.view),nopropagation$1(xt),ct=!1,st=xt.clientX,lt=xt.clientY,Et("start",xt))}}function mt(xt){if(noevent$1(xt),!ct){var St=xt.clientX-st,Et=xt.clientY-lt;ct=St*St+Et*Et>ht}rt.mouse("drag",xt)}function gt(xt){select(xt.view).on("mousemove.drag mouseup.drag",null),yesdrag(xt.view,ct),noevent$1(xt),rt.mouse("end",xt)}function bt(xt,St){if(tt.call(this,xt,St)){var Et=xt.changedTouches,$t=et.call(this,xt,St),It=Et.length,Ft,Ht;for(Ft=0;FtCREATED)throw new Error("too late; already scheduled");return nt}function set(tt,et){var nt=get(tt,et);if(nt.state>STARTED)throw new Error("too late; already running");return nt}function get(tt,et){var nt=tt.__transition;if(!nt||!(nt=nt[et]))throw new Error("transition not found");return nt}function create$1(tt,et,nt){var it=tt.__transition,rt;it[et]=nt,nt.timer=timer$1(ot,0,nt.time);function ot(ct){nt.state=SCHEDULED,nt.timer.restart(at,nt.delay,nt.time),nt.delay<=ct&&at(ct-nt.delay)}function at(ct){var ut,ht,dt,pt;if(nt.state!==SCHEDULED)return lt();for(ut in it)if(pt=it[ut],pt.name===nt.name){if(pt.state===STARTED)return timeout(at);pt.state===RUNNING?(pt.state=ENDED,pt.timer.stop(),pt.on.call("interrupt",tt,tt.__data__,pt.index,pt.group),delete it[ut]):+utSTARTING&&it.state=0&&(et=et.slice(0,nt)),!et||et==="start"})}function onFunction(tt,et,nt){var it,rt,ot=start(et)?init:set;return function(){var at=ot(this,tt),st=at.on;st!==it&&(rt=(it=st).copy()).on(et,nt),at.on=rt}}function transition_on(tt,et){var nt=this._id;return arguments.length<2?get(this.node(),nt).on.on(tt):this.each(onFunction(nt,tt,et))}function removeFunction(tt){return function(){var et=this.parentNode;for(var nt in this.__transition)if(+nt!==tt)return;et&&et.removeChild(this)}}function transition_remove(){return this.on("end.remove",removeFunction(this._id))}function transition_select(tt){var et=this._name,nt=this._id;typeof tt!="function"&&(tt=selector(tt));for(var it=this._groups,rt=it.length,ot=new Array(rt),at=0;at()=>tt;function ZoomEvent(tt,{sourceEvent:et,target:nt,transform:it,dispatch:rt}){Object.defineProperties(this,{type:{value:tt,enumerable:!0,configurable:!0},sourceEvent:{value:et,enumerable:!0,configurable:!0},target:{value:nt,enumerable:!0,configurable:!0},transform:{value:it,enumerable:!0,configurable:!0},_:{value:rt}})}function Transform(tt,et,nt){this.k=tt,this.x=et,this.y=nt}Transform.prototype={constructor:Transform,scale:function(tt){return tt===1?this:new Transform(this.k*tt,this.x,this.y)},translate:function(tt,et){return tt===0&et===0?this:new Transform(this.k,this.x+this.k*tt,this.y+this.k*et)},apply:function(tt){return[tt[0]*this.k+this.x,tt[1]*this.k+this.y]},applyX:function(tt){return tt*this.k+this.x},applyY:function(tt){return tt*this.k+this.y},invert:function(tt){return[(tt[0]-this.x)/this.k,(tt[1]-this.y)/this.k]},invertX:function(tt){return(tt-this.x)/this.k},invertY:function(tt){return(tt-this.y)/this.k},rescaleX:function(tt){return tt.copy().domain(tt.range().map(this.invertX,this).map(tt.invert,tt))},rescaleY:function(tt){return tt.copy().domain(tt.range().map(this.invertY,this).map(tt.invert,tt))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var identity=new Transform(1,0,0);Transform.prototype;function nopropagation(tt){tt.stopImmediatePropagation()}function noevent(tt){tt.preventDefault(),tt.stopImmediatePropagation()}function defaultFilter(tt){return(!tt.ctrlKey||tt.type==="wheel")&&!tt.button}function defaultExtent(){var tt=this;return tt instanceof SVGElement?(tt=tt.ownerSVGElement||tt,tt.hasAttribute("viewBox")?(tt=tt.viewBox.baseVal,[[tt.x,tt.y],[tt.x+tt.width,tt.y+tt.height]]):[[0,0],[tt.width.baseVal.value,tt.height.baseVal.value]]):[[0,0],[tt.clientWidth,tt.clientHeight]]}function defaultTransform(){return this.__zoom||identity}function defaultWheelDelta(tt){return-tt.deltaY*(tt.deltaMode===1?.05:tt.deltaMode?1:.002)*(tt.ctrlKey?10:1)}function defaultTouchable(){return navigator.maxTouchPoints||"ontouchstart"in this}function defaultConstrain(tt,et,nt){var it=tt.invertX(et[0][0])-nt[0][0],rt=tt.invertX(et[1][0])-nt[1][0],ot=tt.invertY(et[0][1])-nt[0][1],at=tt.invertY(et[1][1])-nt[1][1];return tt.translate(rt>it?(it+rt)/2:Math.min(0,it)||Math.max(0,rt),at>ot?(ot+at)/2:Math.min(0,ot)||Math.max(0,at))}function zoom(){var tt=defaultFilter,et=defaultExtent,nt=defaultConstrain,it=defaultWheelDelta,rt=defaultTouchable,ot=[0,1/0],at=[[-1/0,-1/0],[1/0,1/0]],st=250,lt=interpolateZoom,ct=dispatch("start","zoom","end"),ut,ht,dt,pt=500,mt=150,gt=0,bt=10;function yt(kt){kt.property("__zoom",defaultTransform).on("wheel.zoom",It,{passive:!1}).on("mousedown.zoom",Ft).on("dblclick.zoom",Ht).filter(rt).on("touchstart.zoom",zt).on("touchmove.zoom",Ot).on("touchend.zoom touchcancel.zoom",jt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}yt.transform=function(kt,Tt,Ct,Ut){var Nt=kt.selection?kt.selection():kt;Nt.property("__zoom",defaultTransform),kt!==Nt?St(kt,Tt,Ct,Ut):Nt.interrupt().each(function(){Et(this,arguments).event(Ut).start().zoom(null,typeof Tt=="function"?Tt.apply(this,arguments):Tt).end()})},yt.scaleBy=function(kt,Tt,Ct,Ut){yt.scaleTo(kt,function(){var Nt=this.__zoom.k,Bt=typeof Tt=="function"?Tt.apply(this,arguments):Tt;return Nt*Bt},Ct,Ut)},yt.scaleTo=function(kt,Tt,Ct,Ut){yt.transform(kt,function(){var Nt=et.apply(this,arguments),Bt=this.__zoom,Mt=Ct==null?xt(Nt):typeof Ct=="function"?Ct.apply(this,arguments):Ct,Dt=Bt.invert(Mt),Pt=typeof Tt=="function"?Tt.apply(this,arguments):Tt;return nt(vt(wt(Bt,Pt),Mt,Dt),Nt,at)},Ct,Ut)},yt.translateBy=function(kt,Tt,Ct,Ut){yt.transform(kt,function(){return nt(this.__zoom.translate(typeof Tt=="function"?Tt.apply(this,arguments):Tt,typeof Ct=="function"?Ct.apply(this,arguments):Ct),et.apply(this,arguments),at)},null,Ut)},yt.translateTo=function(kt,Tt,Ct,Ut,Nt){yt.transform(kt,function(){var Bt=et.apply(this,arguments),Mt=this.__zoom,Dt=Ut==null?xt(Bt):typeof Ut=="function"?Ut.apply(this,arguments):Ut;return nt(identity.translate(Dt[0],Dt[1]).scale(Mt.k).translate(typeof Tt=="function"?-Tt.apply(this,arguments):-Tt,typeof Ct=="function"?-Ct.apply(this,arguments):-Ct),Bt,at)},Ut,Nt)};function wt(kt,Tt){return Tt=Math.max(ot[0],Math.min(ot[1],Tt)),Tt===kt.k?kt:new Transform(Tt,kt.x,kt.y)}function vt(kt,Tt,Ct){var Ut=Tt[0]-Ct[0]*kt.k,Nt=Tt[1]-Ct[1]*kt.k;return Ut===kt.x&&Nt===kt.y?kt:new Transform(kt.k,Ut,Nt)}function xt(kt){return[(+kt[0][0]+ +kt[1][0])/2,(+kt[0][1]+ +kt[1][1])/2]}function St(kt,Tt,Ct,Ut){kt.on("start.zoom",function(){Et(this,arguments).event(Ut).start()}).on("interrupt.zoom end.zoom",function(){Et(this,arguments).event(Ut).end()}).tween("zoom",function(){var Nt=this,Bt=arguments,Mt=Et(Nt,Bt).event(Ut),Dt=et.apply(Nt,Bt),Pt=Ct==null?xt(Dt):typeof Ct=="function"?Ct.apply(Nt,Bt):Ct,Vt=Math.max(Dt[1][0]-Dt[0][0],Dt[1][1]-Dt[0][1]),nn=Nt.__zoom,cn=typeof Tt=="function"?Tt.apply(Nt,Bt):Tt,Xt=lt(nn.invert(Pt).concat(Vt/nn.k),cn.invert(Pt).concat(Vt/cn.k));return function(un){if(un===1)un=cn;else{var en=Xt(un),fn=Vt/en[2];un=new Transform(fn,Pt[0]-en[0]*fn,Pt[1]-en[1]*fn)}Mt.zoom(null,un)}})}function Et(kt,Tt,Ct){return!Ct&&kt.__zooming||new $t(kt,Tt)}function $t(kt,Tt){this.that=kt,this.args=Tt,this.active=0,this.sourceEvent=null,this.extent=et.apply(kt,Tt),this.taps=0}$t.prototype={event:function(kt){return kt&&(this.sourceEvent=kt),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(kt,Tt){return this.mouse&&kt!=="mouse"&&(this.mouse[1]=Tt.invert(this.mouse[0])),this.touch0&&kt!=="touch"&&(this.touch0[1]=Tt.invert(this.touch0[0])),this.touch1&&kt!=="touch"&&(this.touch1[1]=Tt.invert(this.touch1[0])),this.that.__zoom=Tt,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(kt){var Tt=select(this.that).datum();ct.call(kt,this.that,new ZoomEvent(kt,{sourceEvent:this.sourceEvent,target:yt,type:kt,transform:this.that.__zoom,dispatch:ct}),Tt)}};function It(kt,...Tt){if(!tt.apply(this,arguments))return;var Ct=Et(this,Tt).event(kt),Ut=this.__zoom,Nt=Math.max(ot[0],Math.min(ot[1],Ut.k*Math.pow(2,it.apply(this,arguments)))),Bt=pointer(kt);if(Ct.wheel)(Ct.mouse[0][0]!==Bt[0]||Ct.mouse[0][1]!==Bt[1])&&(Ct.mouse[1]=Ut.invert(Ct.mouse[0]=Bt)),clearTimeout(Ct.wheel);else{if(Ut.k===Nt)return;Ct.mouse=[Bt,Ut.invert(Bt)],interrupt(this),Ct.start()}noevent(kt),Ct.wheel=setTimeout(Mt,mt),Ct.zoom("mouse",nt(vt(wt(Ut,Nt),Ct.mouse[0],Ct.mouse[1]),Ct.extent,at));function Mt(){Ct.wheel=null,Ct.end()}}function Ft(kt,...Tt){if(dt||!tt.apply(this,arguments))return;var Ct=kt.currentTarget,Ut=Et(this,Tt,!0).event(kt),Nt=select(kt.view).on("mousemove.zoom",Pt,!0).on("mouseup.zoom",Vt,!0),Bt=pointer(kt,Ct),Mt=kt.clientX,Dt=kt.clientY;dragDisable(kt.view),nopropagation(kt),Ut.mouse=[Bt,this.__zoom.invert(Bt)],interrupt(this),Ut.start();function Pt(nn){if(noevent(nn),!Ut.moved){var cn=nn.clientX-Mt,Xt=nn.clientY-Dt;Ut.moved=cn*cn+Xt*Xt>gt}Ut.event(nn).zoom("mouse",nt(vt(Ut.that.__zoom,Ut.mouse[0]=pointer(nn,Ct),Ut.mouse[1]),Ut.extent,at))}function Vt(nn){Nt.on("mousemove.zoom mouseup.zoom",null),yesdrag(nn.view,Ut.moved),noevent(nn),Ut.event(nn).end()}}function Ht(kt,...Tt){if(tt.apply(this,arguments)){var Ct=this.__zoom,Ut=pointer(kt.changedTouches?kt.changedTouches[0]:kt,this),Nt=Ct.invert(Ut),Bt=Ct.k*(kt.shiftKey?.5:2),Mt=nt(vt(wt(Ct,Bt),Ut,Nt),et.apply(this,Tt),at);noevent(kt),st>0?select(this).transition().duration(st).call(St,Mt,Ut,kt):select(this).call(yt.transform,Mt,Ut,kt)}}function zt(kt,...Tt){if(tt.apply(this,arguments)){var Ct=kt.touches,Ut=Ct.length,Nt=Et(this,Tt,kt.changedTouches.length===Ut).event(kt),Bt,Mt,Dt,Pt;for(nopropagation(kt),Mt=0;Mt"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:tt=>`Node type "${tt}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:tt=>`The old edge with id=${tt} does not exist.`,error009:tt=>`Marker type "${tt}" doesn't exist.`,error008:(tt,et)=>`Couldn't create edge for ${tt?"target":"source"} handle id: "${tt?et.targetHandle:et.sourceHandle}", edge id: ${et.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:tt=>`Edge type "${tt}" not found. Using fallback type "default".`,error012:tt=>`Node with id "${tt}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},zustandErrorMessage=errorMessages.error001();function useStore(tt,et){const nt=reactExports.useContext(StoreContext);if(nt===null)throw new Error(zustandErrorMessage);return useStoreWithEqualityFn(nt,tt,et)}const useStoreApi=()=>{const tt=reactExports.useContext(StoreContext);if(tt===null)throw new Error(zustandErrorMessage);return reactExports.useMemo(()=>({getState:tt.getState,setState:tt.setState,subscribe:tt.subscribe,destroy:tt.destroy}),[tt])},selector$g=tt=>tt.userSelectionActive?"none":"all";function Panel({position:tt,children:et,className:nt,style:it,...rt}){const ot=useStore(selector$g),at=`${tt}`.split("-");return React$1.createElement("div",{className:cc(["react-flow__panel",nt,...at]),style:{...it,pointerEvents:ot},...rt},et)}function Attribution({proOptions:tt,position:et="bottom-right"}){return tt!=null&&tt.hideAttribution?null:React$1.createElement(Panel,{position:et,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},React$1.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const EdgeText=({x:tt,y:et,label:nt,labelStyle:it={},labelShowBg:rt=!0,labelBgStyle:ot={},labelBgPadding:at=[2,4],labelBgBorderRadius:st=2,children:lt,className:ct,...ut})=>{const ht=reactExports.useRef(null),[dt,pt]=reactExports.useState({x:0,y:0,width:0,height:0}),mt=cc(["react-flow__edge-textwrapper",ct]);return reactExports.useEffect(()=>{if(ht.current){const gt=ht.current.getBBox();pt({x:gt.x,y:gt.y,width:gt.width,height:gt.height})}},[nt]),typeof nt>"u"||!nt?null:React$1.createElement("g",{transform:`translate(${tt-dt.width/2} ${et-dt.height/2})`,className:mt,visibility:dt.width?"visible":"hidden",...ut},rt&&React$1.createElement("rect",{width:dt.width+2*at[0],x:-at[0],y:-at[1],height:dt.height+2*at[1],className:"react-flow__edge-textbg",style:ot,rx:st,ry:st}),React$1.createElement("text",{className:"react-flow__edge-text",y:dt.height/2,dy:"0.3em",ref:ht,style:it},nt),lt)};var EdgeText$1=reactExports.memo(EdgeText);const getDimensions=tt=>({width:tt.offsetWidth,height:tt.offsetHeight}),clamp=(tt,et=0,nt=1)=>Math.min(Math.max(tt,et),nt),clampPosition=(tt={x:0,y:0},et)=>({x:clamp(tt.x,et[0][0],et[1][0]),y:clamp(tt.y,et[0][1],et[1][1])}),calcAutoPanVelocity=(tt,et,nt)=>ttnt?-clamp(Math.abs(tt-nt),1,50)/50:0,calcAutoPan=(tt,et)=>{const nt=calcAutoPanVelocity(tt.x,35,et.width-35)*20,it=calcAutoPanVelocity(tt.y,35,et.height-35)*20;return[nt,it]},getHostForElement=tt=>{var et;return((et=tt.getRootNode)==null?void 0:et.call(tt))||(window==null?void 0:window.document)},getBoundsOfBoxes=(tt,et)=>({x:Math.min(tt.x,et.x),y:Math.min(tt.y,et.y),x2:Math.max(tt.x2,et.x2),y2:Math.max(tt.y2,et.y2)}),rectToBox=({x:tt,y:et,width:nt,height:it})=>({x:tt,y:et,x2:tt+nt,y2:et+it}),boxToRect=({x:tt,y:et,x2:nt,y2:it})=>({x:tt,y:et,width:nt-tt,height:it-et}),nodeToRect=tt=>({...tt.positionAbsolute||{x:0,y:0},width:tt.width||0,height:tt.height||0}),getOverlappingArea=(tt,et)=>{const nt=Math.max(0,Math.min(tt.x+tt.width,et.x+et.width)-Math.max(tt.x,et.x)),it=Math.max(0,Math.min(tt.y+tt.height,et.y+et.height)-Math.max(tt.y,et.y));return Math.ceil(nt*it)},isRectObject=tt=>isNumeric(tt.width)&&isNumeric(tt.height)&&isNumeric(tt.x)&&isNumeric(tt.y),isNumeric=tt=>!isNaN(tt)&&isFinite(tt),internalsSymbol=Symbol.for("internals"),elementSelectionKeys=["Enter"," ","Escape"],devWarn=(tt,et)=>{},isReactKeyboardEvent=tt=>"nativeEvent"in tt;function isInputDOMNode(tt){var rt,ot;const et=isReactKeyboardEvent(tt)?tt.nativeEvent:tt,nt=((ot=(rt=et.composedPath)==null?void 0:rt.call(et))==null?void 0:ot[0])||tt.target;return["INPUT","SELECT","TEXTAREA"].includes(nt==null?void 0:nt.nodeName)||(nt==null?void 0:nt.hasAttribute("contenteditable"))||!!(nt!=null&&nt.closest(".nokey"))}const isMouseEvent=tt=>"clientX"in tt,getEventPosition=(tt,et)=>{var ot,at;const nt=isMouseEvent(tt),it=nt?tt.clientX:(ot=tt.touches)==null?void 0:ot[0].clientX,rt=nt?tt.clientY:(at=tt.touches)==null?void 0:at[0].clientY;return{x:it-((et==null?void 0:et.left)??0),y:rt-((et==null?void 0:et.top)??0)}},isMacOs=()=>{var tt;return typeof navigator<"u"&&((tt=navigator==null?void 0:navigator.userAgent)==null?void 0:tt.indexOf("Mac"))>=0},BaseEdge=({id:tt,path:et,labelX:nt,labelY:it,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt=20})=>React$1.createElement(React$1.Fragment,null,React$1.createElement("path",{id:tt,style:ut,d:et,fill:"none",className:"react-flow__edge-path",markerEnd:ht,markerStart:dt}),pt&&React$1.createElement("path",{d:et,fill:"none",strokeOpacity:0,strokeWidth:pt,className:"react-flow__edge-interaction"}),rt&&isNumeric(nt)&&isNumeric(it)?React$1.createElement(EdgeText$1,{x:nt,y:it,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct}):null);BaseEdge.displayName="BaseEdge";function getMouseHandler$1(tt,et,nt){return nt===void 0?nt:it=>{const rt=et().edges.find(ot=>ot.id===tt);rt&&nt(it,{...rt})}}function getEdgeCenter({sourceX:tt,sourceY:et,targetX:nt,targetY:it}){const rt=Math.abs(nt-tt)/2,ot=nt{const[bt,yt,wt]=getSimpleBezierPath({sourceX:tt,sourceY:et,sourcePosition:rt,targetX:nt,targetY:it,targetPosition:ot});return React$1.createElement(BaseEdge,{path:bt,labelX:yt,labelY:wt,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,interactionWidth:gt})});SimpleBezierEdge.displayName="SimpleBezierEdge";const handleDirections={[Position.Left]:{x:-1,y:0},[Position.Right]:{x:1,y:0},[Position.Top]:{x:0,y:-1},[Position.Bottom]:{x:0,y:1}},getDirection=({source:tt,sourcePosition:et=Position.Bottom,target:nt})=>et===Position.Left||et===Position.Right?tt.xMath.sqrt(Math.pow(et.x-tt.x,2)+Math.pow(et.y-tt.y,2));function getPoints({source:tt,sourcePosition:et=Position.Bottom,target:nt,targetPosition:it=Position.Top,center:rt,offset:ot}){const at=handleDirections[et],st=handleDirections[it],lt={x:tt.x+at.x*ot,y:tt.y+at.y*ot},ct={x:nt.x+st.x*ot,y:nt.y+st.y*ot},ut=getDirection({source:lt,sourcePosition:et,target:ct}),ht=ut.x!==0?"x":"y",dt=ut[ht];let pt=[],mt,gt;const bt={x:0,y:0},yt={x:0,y:0},[wt,vt,xt,St]=getEdgeCenter({sourceX:tt.x,sourceY:tt.y,targetX:nt.x,targetY:nt.y});if(at[ht]*st[ht]===-1){mt=rt.x||wt,gt=rt.y||vt;const $t=[{x:mt,y:lt.y},{x:mt,y:ct.y}],It=[{x:lt.x,y:gt},{x:ct.x,y:gt}];at[ht]===dt?pt=ht==="x"?$t:It:pt=ht==="x"?It:$t}else{const $t=[{x:lt.x,y:ct.y}],It=[{x:ct.x,y:lt.y}];if(ht==="x"?pt=at.x===dt?It:$t:pt=at.y===dt?$t:It,et===it){const jt=Math.abs(tt[ht]-nt[ht]);if(jt<=ot){const kt=Math.min(ot-1,ot-jt);at[ht]===dt?bt[ht]=(lt[ht]>tt[ht]?-1:1)*kt:yt[ht]=(ct[ht]>nt[ht]?-1:1)*kt}}if(et!==it){const jt=ht==="x"?"y":"x",kt=at[ht]===st[jt],Tt=lt[jt]>ct[jt],Ct=lt[jt]=Ot?(mt=(Ft.x+Ht.x)/2,gt=pt[0].y):(mt=pt[0].x,gt=(Ft.y+Ht.y)/2)}return[[tt,{x:lt.x+bt.x,y:lt.y+bt.y},...pt,{x:ct.x+yt.x,y:ct.y+yt.y},nt],mt,gt,xt,St]}function getBend(tt,et,nt,it){const rt=Math.min(distance(tt,et)/2,distance(et,nt)/2,it),{x:ot,y:at}=et;if(tt.x===ot&&ot===nt.x||tt.y===at&&at===nt.y)return`L${ot} ${at}`;if(tt.y===at){const ct=tt.x{let vt="";return wt>0&&wt{const[yt,wt,vt]=getSmoothStepPath({sourceX:tt,sourceY:et,sourcePosition:ht,targetX:nt,targetY:it,targetPosition:dt,borderRadius:gt==null?void 0:gt.borderRadius,offset:gt==null?void 0:gt.offset});return React$1.createElement(BaseEdge,{path:yt,labelX:wt,labelY:vt,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:pt,markerStart:mt,interactionWidth:bt})});SmoothStepEdge.displayName="SmoothStepEdge";const StepEdge=reactExports.memo(tt=>{var et;return React$1.createElement(SmoothStepEdge,{...tt,pathOptions:reactExports.useMemo(()=>{var nt;return{borderRadius:0,offset:(nt=tt.pathOptions)==null?void 0:nt.offset}},[(et=tt.pathOptions)==null?void 0:et.offset])})});StepEdge.displayName="StepEdge";function getStraightPath({sourceX:tt,sourceY:et,targetX:nt,targetY:it}){const[rt,ot,at,st]=getEdgeCenter({sourceX:tt,sourceY:et,targetX:nt,targetY:it});return[`M ${tt},${et}L ${nt},${it}`,rt,ot,at,st]}const StraightEdge=reactExports.memo(({sourceX:tt,sourceY:et,targetX:nt,targetY:it,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt})=>{const[mt,gt,bt]=getStraightPath({sourceX:tt,sourceY:et,targetX:nt,targetY:it});return React$1.createElement(BaseEdge,{path:mt,labelX:gt,labelY:bt,label:rt,labelStyle:ot,labelShowBg:at,labelBgStyle:st,labelBgPadding:lt,labelBgBorderRadius:ct,style:ut,markerEnd:ht,markerStart:dt,interactionWidth:pt})});StraightEdge.displayName="StraightEdge";function calculateControlOffset(tt,et){return tt>=0?.5*tt:et*25*Math.sqrt(-tt)}function getControlWithCurvature({pos:tt,x1:et,y1:nt,x2:it,y2:rt,c:ot}){switch(tt){case Position.Left:return[et-calculateControlOffset(et-it,ot),nt];case Position.Right:return[et+calculateControlOffset(it-et,ot),nt];case Position.Top:return[et,nt-calculateControlOffset(nt-rt,ot)];case Position.Bottom:return[et,nt+calculateControlOffset(rt-nt,ot)]}}function getBezierPath({sourceX:tt,sourceY:et,sourcePosition:nt=Position.Bottom,targetX:it,targetY:rt,targetPosition:ot=Position.Top,curvature:at=.25}){const[st,lt]=getControlWithCurvature({pos:nt,x1:tt,y1:et,x2:it,y2:rt,c:at}),[ct,ut]=getControlWithCurvature({pos:ot,x1:it,y1:rt,x2:tt,y2:et,c:at}),[ht,dt,pt,mt]=getBezierEdgeCenter({sourceX:tt,sourceY:et,targetX:it,targetY:rt,sourceControlX:st,sourceControlY:lt,targetControlX:ct,targetControlY:ut});return[`M${tt},${et} C${st},${lt} ${ct},${ut} ${it},${rt}`,ht,dt,pt,mt]}const BezierEdge=reactExports.memo(({sourceX:tt,sourceY:et,targetX:nt,targetY:it,sourcePosition:rt=Position.Bottom,targetPosition:ot=Position.Top,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,pathOptions:gt,interactionWidth:bt})=>{const[yt,wt,vt]=getBezierPath({sourceX:tt,sourceY:et,sourcePosition:rt,targetX:nt,targetY:it,targetPosition:ot,curvature:gt==null?void 0:gt.curvature});return React$1.createElement(BaseEdge,{path:yt,labelX:wt,labelY:vt,label:at,labelStyle:st,labelShowBg:lt,labelBgStyle:ct,labelBgPadding:ut,labelBgBorderRadius:ht,style:dt,markerEnd:pt,markerStart:mt,interactionWidth:bt})});BezierEdge.displayName="BezierEdge";const NodeIdContext=reactExports.createContext(null),Provider=NodeIdContext.Provider;NodeIdContext.Consumer;const useNodeId=()=>reactExports.useContext(NodeIdContext),isEdge=tt=>"id"in tt&&"source"in tt&&"target"in tt,getEdgeId=({source:tt,sourceHandle:et,target:nt,targetHandle:it})=>`reactflow__edge-${tt}${et||""}-${nt}${it||""}`,getMarkerId=(tt,et)=>typeof tt>"u"?"":typeof tt=="string"?tt:`${et?`${et}__`:""}${Object.keys(tt).sort().map(it=>`${it}=${tt[it]}`).join("&")}`,connectionExists=(tt,et)=>et.some(nt=>nt.source===tt.source&&nt.target===tt.target&&(nt.sourceHandle===tt.sourceHandle||!nt.sourceHandle&&!tt.sourceHandle)&&(nt.targetHandle===tt.targetHandle||!nt.targetHandle&&!tt.targetHandle)),addEdge=(tt,et)=>{if(!tt.source||!tt.target)return et;let nt;return isEdge(tt)?nt={...tt}:nt={...tt,id:getEdgeId(tt)},connectionExists(nt,et)?et:et.concat(nt)},pointToRendererPoint=({x:tt,y:et},[nt,it,rt],ot,[at,st])=>{const lt={x:(tt-nt)/rt,y:(et-it)/rt};return ot?{x:at*Math.round(lt.x/at),y:st*Math.round(lt.y/st)}:lt},rendererPointToPoint=({x:tt,y:et},[nt,it,rt])=>({x:tt*rt+nt,y:et*rt+it}),getNodePositionWithOrigin=(tt,et=[0,0])=>{if(!tt)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const nt=(tt.width??0)*et[0],it=(tt.height??0)*et[1],rt={x:tt.position.x-nt,y:tt.position.y-it};return{...rt,positionAbsolute:tt.positionAbsolute?{x:tt.positionAbsolute.x-nt,y:tt.positionAbsolute.y-it}:rt}},getNodesBounds=(tt,et=[0,0])=>{if(tt.length===0)return{x:0,y:0,width:0,height:0};const nt=tt.reduce((it,rt)=>{const{x:ot,y:at}=getNodePositionWithOrigin(rt,et).positionAbsolute;return getBoundsOfBoxes(it,rectToBox({x:ot,y:at,width:rt.width||0,height:rt.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return boxToRect(nt)},getNodesInside=(tt,et,[nt,it,rt]=[0,0,1],ot=!1,at=!1,st=[0,0])=>{const lt={x:(et.x-nt)/rt,y:(et.y-it)/rt,width:et.width/rt,height:et.height/rt},ct=[];return tt.forEach(ut=>{const{width:ht,height:dt,selectable:pt=!0,hidden:mt=!1}=ut;if(at&&!pt||mt)return!1;const{positionAbsolute:gt}=getNodePositionWithOrigin(ut,st),bt={x:gt.x,y:gt.y,width:ht||0,height:dt||0},yt=getOverlappingArea(lt,bt),wt=typeof ht>"u"||typeof dt>"u"||ht===null||dt===null,vt=ot&&yt>0,xt=(ht||0)*(dt||0);(wt||vt||yt>=xt||ut.dragging)&&ct.push(ut)}),ct},getConnectedEdges=(tt,et)=>{const nt=tt.map(it=>it.id);return et.filter(it=>nt.includes(it.source)||nt.includes(it.target))},getViewportForBounds=(tt,et,nt,it,rt,ot=.1)=>{const at=et/(tt.width*(1+ot)),st=nt/(tt.height*(1+ot)),lt=Math.min(at,st),ct=clamp(lt,it,rt),ut=tt.x+tt.width/2,ht=tt.y+tt.height/2,dt=et/2-ut*ct,pt=nt/2-ht*ct;return{x:dt,y:pt,zoom:ct}},getD3Transition=(tt,et=0)=>tt.transition().duration(et);function getHandles(tt,et,nt,it){return(et[nt]||[]).reduce((rt,ot)=>{var at,st;return`${tt.id}-${ot.id}-${nt}`!==it&&rt.push({id:ot.id||null,type:nt,nodeId:tt.id,x:(((at=tt.positionAbsolute)==null?void 0:at.x)??0)+ot.x+ot.width/2,y:(((st=tt.positionAbsolute)==null?void 0:st.y)??0)+ot.y+ot.height/2}),rt},[])}function getClosestHandle(tt,et,nt,it,rt,ot){const{x:at,y:st}=getEventPosition(tt),ct=et.elementsFromPoint(at,st).find(mt=>mt.classList.contains("react-flow__handle"));if(ct){const mt=ct.getAttribute("data-nodeid");if(mt){const gt=getHandleType(void 0,ct),bt=ct.getAttribute("data-handleid"),yt=ot({nodeId:mt,id:bt,type:gt});if(yt){const wt=rt.find(vt=>vt.nodeId===mt&&vt.type===gt&&vt.id===bt);return{handle:{id:bt,type:gt,nodeId:mt,x:(wt==null?void 0:wt.x)||nt.x,y:(wt==null?void 0:wt.y)||nt.y},validHandleResult:yt}}}}let ut=[],ht=1/0;if(rt.forEach(mt=>{const gt=Math.sqrt((mt.x-nt.x)**2+(mt.y-nt.y)**2);if(gt<=it){const bt=ot(mt);gt<=ht&&(gtmt.isValid),pt=ut.some(({handle:mt})=>mt.type==="target");return ut.find(({handle:mt,validHandleResult:gt})=>pt?mt.type==="target":dt?gt.isValid:!0)||ut[0]}const nullConnection={source:null,target:null,sourceHandle:null,targetHandle:null},defaultResult=()=>({handleDomNode:null,isValid:!1,connection:nullConnection,endHandle:null});function isValidHandle(tt,et,nt,it,rt,ot,at){const st=rt==="target",lt=at.querySelector(`.react-flow__handle[data-id="${tt==null?void 0:tt.nodeId}-${tt==null?void 0:tt.id}-${tt==null?void 0:tt.type}"]`),ct={...defaultResult(),handleDomNode:lt};if(lt){const ut=getHandleType(void 0,lt),ht=lt.getAttribute("data-nodeid"),dt=lt.getAttribute("data-handleid"),pt=lt.classList.contains("connectable"),mt=lt.classList.contains("connectableend"),gt={source:st?ht:nt,sourceHandle:st?dt:it,target:st?nt:ht,targetHandle:st?it:dt};ct.connection=gt,pt&&mt&&(et===ConnectionMode.Strict?st&&ut==="source"||!st&&ut==="target":ht!==nt||dt!==it)&&(ct.endHandle={nodeId:ht,handleId:dt,type:ut},ct.isValid=ot(gt))}return ct}function getHandleLookup({nodes:tt,nodeId:et,handleId:nt,handleType:it}){return tt.reduce((rt,ot)=>{if(ot[internalsSymbol]){const{handleBounds:at}=ot[internalsSymbol];let st=[],lt=[];at&&(st=getHandles(ot,at,"source",`${et}-${nt}-${it}`),lt=getHandles(ot,at,"target",`${et}-${nt}-${it}`)),rt.push(...st,...lt)}return rt},[])}function getHandleType(tt,et){return tt||(et!=null&&et.classList.contains("target")?"target":et!=null&&et.classList.contains("source")?"source":null)}function resetRecentHandle(tt){tt==null||tt.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function getConnectionStatus(tt,et){let nt=null;return et?nt="valid":tt&&!et&&(nt="invalid"),nt}function handlePointerDown({event:tt,handleId:et,nodeId:nt,onConnect:it,isTarget:rt,getState:ot,setState:at,isValidConnection:st,edgeUpdaterType:lt,onEdgeUpdateEnd:ct}){const ut=getHostForElement(tt.target),{connectionMode:ht,domNode:dt,autoPanOnConnect:pt,connectionRadius:mt,onConnectStart:gt,panBy:bt,getNodes:yt,cancelConnection:wt}=ot();let vt=0,xt;const{x:St,y:Et}=getEventPosition(tt),$t=ut==null?void 0:ut.elementFromPoint(St,Et),It=getHandleType(lt,$t),Ft=dt==null?void 0:dt.getBoundingClientRect();if(!Ft||!It)return;let Ht,zt=getEventPosition(tt,Ft),Ot=!1,jt=null,kt=!1,Tt=null;const Ct=getHandleLookup({nodes:yt(),nodeId:nt,handleId:et,handleType:It}),Ut=()=>{if(!pt)return;const[Mt,Dt]=calcAutoPan(zt,Ft);bt({x:Mt,y:Dt}),vt=requestAnimationFrame(Ut)};at({connectionPosition:zt,connectionStatus:null,connectionNodeId:nt,connectionHandleId:et,connectionHandleType:It,connectionStartHandle:{nodeId:nt,handleId:et,type:It},connectionEndHandle:null}),gt==null||gt(tt,{nodeId:nt,handleId:et,handleType:It});function Nt(Mt){const{transform:Dt}=ot();zt=getEventPosition(Mt,Ft);const{handle:Pt,validHandleResult:Vt}=getClosestHandle(Mt,ut,pointToRendererPoint(zt,Dt,!1,[1,1]),mt,Ct,nn=>isValidHandle(nn,ht,nt,et,rt?"target":"source",st,ut));if(xt=Pt,Ot||(Ut(),Ot=!0),Tt=Vt.handleDomNode,jt=Vt.connection,kt=Vt.isValid,at({connectionPosition:xt&&kt?rendererPointToPoint({x:xt.x,y:xt.y},Dt):zt,connectionStatus:getConnectionStatus(!!xt,kt),connectionEndHandle:Vt.endHandle}),!xt&&!kt&&!Tt)return resetRecentHandle(Ht);jt.source!==jt.target&&Tt&&(resetRecentHandle(Ht),Ht=Tt,Tt.classList.add("connecting","react-flow__handle-connecting"),Tt.classList.toggle("valid",kt),Tt.classList.toggle("react-flow__handle-valid",kt))}function Bt(Mt){var Dt,Pt;(xt||Tt)&&jt&&kt&&(it==null||it(jt)),(Pt=(Dt=ot()).onConnectEnd)==null||Pt.call(Dt,Mt),lt&&(ct==null||ct(Mt)),resetRecentHandle(Ht),wt(),cancelAnimationFrame(vt),Ot=!1,kt=!1,jt=null,Tt=null,ut.removeEventListener("mousemove",Nt),ut.removeEventListener("mouseup",Bt),ut.removeEventListener("touchmove",Nt),ut.removeEventListener("touchend",Bt)}ut.addEventListener("mousemove",Nt),ut.addEventListener("mouseup",Bt),ut.addEventListener("touchmove",Nt),ut.addEventListener("touchend",Bt)}const alwaysValid=()=>!0,selector$f=tt=>({connectionStartHandle:tt.connectionStartHandle,connectOnClick:tt.connectOnClick,noPanClassName:tt.noPanClassName}),connectingSelector=(tt,et,nt)=>it=>{const{connectionStartHandle:rt,connectionEndHandle:ot,connectionClickStartHandle:at}=it;return{connecting:(rt==null?void 0:rt.nodeId)===tt&&(rt==null?void 0:rt.handleId)===et&&(rt==null?void 0:rt.type)===nt||(ot==null?void 0:ot.nodeId)===tt&&(ot==null?void 0:ot.handleId)===et&&(ot==null?void 0:ot.type)===nt,clickConnecting:(at==null?void 0:at.nodeId)===tt&&(at==null?void 0:at.handleId)===et&&(at==null?void 0:at.type)===nt}},Handle=reactExports.forwardRef(({type:tt="source",position:et=Position.Top,isValidConnection:nt,isConnectable:it=!0,isConnectableStart:rt=!0,isConnectableEnd:ot=!0,id:at,onConnect:st,children:lt,className:ct,onMouseDown:ut,onTouchStart:ht,...dt},pt)=>{var Ft,Ht;const mt=at||null,gt=tt==="target",bt=useStoreApi(),yt=useNodeId(),{connectOnClick:wt,noPanClassName:vt}=useStore(selector$f,shallow$1),{connecting:xt,clickConnecting:St}=useStore(connectingSelector(yt,mt,tt),shallow$1);yt||(Ht=(Ft=bt.getState()).onError)==null||Ht.call(Ft,"010",errorMessages.error010());const Et=zt=>{const{defaultEdgeOptions:Ot,onConnect:jt,hasDefaultEdges:kt}=bt.getState(),Tt={...Ot,...zt};if(kt){const{edges:Ct,setEdges:Ut}=bt.getState();Ut(addEdge(Tt,Ct))}jt==null||jt(Tt),st==null||st(Tt)},$t=zt=>{if(!yt)return;const Ot=isMouseEvent(zt);rt&&(Ot&&zt.button===0||!Ot)&&handlePointerDown({event:zt,handleId:mt,nodeId:yt,onConnect:Et,isTarget:gt,getState:bt.getState,setState:bt.setState,isValidConnection:nt||bt.getState().isValidConnection||alwaysValid}),Ot?ut==null||ut(zt):ht==null||ht(zt)},It=zt=>{const{onClickConnectStart:Ot,onClickConnectEnd:jt,connectionClickStartHandle:kt,connectionMode:Tt,isValidConnection:Ct}=bt.getState();if(!yt||!kt&&!rt)return;if(!kt){Ot==null||Ot(zt,{nodeId:yt,handleId:mt,handleType:tt}),bt.setState({connectionClickStartHandle:{nodeId:yt,type:tt,handleId:mt}});return}const Ut=getHostForElement(zt.target),Nt=nt||Ct||alwaysValid,{connection:Bt,isValid:Mt}=isValidHandle({nodeId:yt,id:mt,type:tt},Tt,kt.nodeId,kt.handleId||null,kt.type,Nt,Ut);Mt&&Et(Bt),jt==null||jt(zt),bt.setState({connectionClickStartHandle:null})};return React$1.createElement("div",{"data-handleid":mt,"data-nodeid":yt,"data-handlepos":et,"data-id":`${yt}-${mt}-${tt}`,className:cc(["react-flow__handle",`react-flow__handle-${et}`,"nodrag",vt,ct,{source:!gt,target:gt,connectable:it,connectablestart:rt,connectableend:ot,connecting:St,connectionindicator:it&&(rt&&!xt||ot&&xt)}]),onMouseDown:$t,onTouchStart:$t,onClick:wt?It:void 0,ref:pt,...dt},lt)});Handle.displayName="Handle";var Handle$1=reactExports.memo(Handle);const DefaultNode=({data:tt,isConnectable:et,targetPosition:nt=Position.Top,sourcePosition:it=Position.Bottom})=>React$1.createElement(React$1.Fragment,null,React$1.createElement(Handle$1,{type:"target",position:nt,isConnectable:et}),tt==null?void 0:tt.label,React$1.createElement(Handle$1,{type:"source",position:it,isConnectable:et}));DefaultNode.displayName="DefaultNode";var DefaultNode$1=reactExports.memo(DefaultNode);const InputNode=({data:tt,isConnectable:et,sourcePosition:nt=Position.Bottom})=>React$1.createElement(React$1.Fragment,null,tt==null?void 0:tt.label,React$1.createElement(Handle$1,{type:"source",position:nt,isConnectable:et}));InputNode.displayName="InputNode";var InputNode$1=reactExports.memo(InputNode);const OutputNode=({data:tt,isConnectable:et,targetPosition:nt=Position.Top})=>React$1.createElement(React$1.Fragment,null,React$1.createElement(Handle$1,{type:"target",position:nt,isConnectable:et}),tt==null?void 0:tt.label);OutputNode.displayName="OutputNode";var OutputNode$1=reactExports.memo(OutputNode);const GroupNode=()=>null;GroupNode.displayName="GroupNode";const selector$e=tt=>({selectedNodes:tt.getNodes().filter(et=>et.selected),selectedEdges:tt.edges.filter(et=>et.selected)}),selectId=tt=>tt.id;function areEqual(tt,et){return shallow$1(tt.selectedNodes.map(selectId),et.selectedNodes.map(selectId))&&shallow$1(tt.selectedEdges.map(selectId),et.selectedEdges.map(selectId))}const SelectionListener=reactExports.memo(({onSelectionChange:tt})=>{const et=useStoreApi(),{selectedNodes:nt,selectedEdges:it}=useStore(selector$e,areEqual);return reactExports.useEffect(()=>{const rt={nodes:nt,edges:it};tt==null||tt(rt),et.getState().onSelectionChange.forEach(ot=>ot(rt))},[nt,it,tt]),null});SelectionListener.displayName="SelectionListener";const changeSelector=tt=>!!tt.onSelectionChange;function Wrapper$1$1({onSelectionChange:tt}){const et=useStore(changeSelector);return tt||et?React$1.createElement(SelectionListener,{onSelectionChange:tt}):null}const selector$d=tt=>({setNodes:tt.setNodes,setEdges:tt.setEdges,setDefaultNodesAndEdges:tt.setDefaultNodesAndEdges,setMinZoom:tt.setMinZoom,setMaxZoom:tt.setMaxZoom,setTranslateExtent:tt.setTranslateExtent,setNodeExtent:tt.setNodeExtent,reset:tt.reset});function useStoreUpdater(tt,et){reactExports.useEffect(()=>{typeof tt<"u"&&et(tt)},[tt])}function useDirectStoreUpdater(tt,et,nt){reactExports.useEffect(()=>{typeof et<"u"&&nt({[tt]:et})},[et])}const StoreUpdater=({nodes:tt,edges:et,defaultNodes:nt,defaultEdges:it,onConnect:rt,onConnectStart:ot,onConnectEnd:at,onClickConnectStart:st,onClickConnectEnd:lt,nodesDraggable:ct,nodesConnectable:ut,nodesFocusable:ht,edgesFocusable:dt,edgesUpdatable:pt,elevateNodesOnSelect:mt,minZoom:gt,maxZoom:bt,nodeExtent:yt,onNodesChange:wt,onEdgesChange:vt,elementsSelectable:xt,connectionMode:St,snapGrid:Et,snapToGrid:$t,translateExtent:It,connectOnClick:Ft,defaultEdgeOptions:Ht,fitView:zt,fitViewOptions:Ot,onNodesDelete:jt,onEdgesDelete:kt,onNodeDrag:Tt,onNodeDragStart:Ct,onNodeDragStop:Ut,onSelectionDrag:Nt,onSelectionDragStart:Bt,onSelectionDragStop:Mt,noPanClassName:Dt,nodeOrigin:Pt,rfId:Vt,autoPanOnConnect:nn,autoPanOnNodeDrag:cn,onError:Xt,connectionRadius:un,isValidConnection:en,nodeDragThreshold:fn})=>{const{setNodes:xn,setEdges:an,setDefaultNodesAndEdges:Zt,setMinZoom:En,setMaxZoom:In,setTranslateExtent:Cn,setNodeExtent:Nn,reset:Un}=useStore(selector$d,shallow$1),_n=useStoreApi();return reactExports.useEffect(()=>{const An=it==null?void 0:it.map(gn=>({...gn,...Ht}));return Zt(nt,An),()=>{Un()}},[]),useDirectStoreUpdater("defaultEdgeOptions",Ht,_n.setState),useDirectStoreUpdater("connectionMode",St,_n.setState),useDirectStoreUpdater("onConnect",rt,_n.setState),useDirectStoreUpdater("onConnectStart",ot,_n.setState),useDirectStoreUpdater("onConnectEnd",at,_n.setState),useDirectStoreUpdater("onClickConnectStart",st,_n.setState),useDirectStoreUpdater("onClickConnectEnd",lt,_n.setState),useDirectStoreUpdater("nodesDraggable",ct,_n.setState),useDirectStoreUpdater("nodesConnectable",ut,_n.setState),useDirectStoreUpdater("nodesFocusable",ht,_n.setState),useDirectStoreUpdater("edgesFocusable",dt,_n.setState),useDirectStoreUpdater("edgesUpdatable",pt,_n.setState),useDirectStoreUpdater("elementsSelectable",xt,_n.setState),useDirectStoreUpdater("elevateNodesOnSelect",mt,_n.setState),useDirectStoreUpdater("snapToGrid",$t,_n.setState),useDirectStoreUpdater("snapGrid",Et,_n.setState),useDirectStoreUpdater("onNodesChange",wt,_n.setState),useDirectStoreUpdater("onEdgesChange",vt,_n.setState),useDirectStoreUpdater("connectOnClick",Ft,_n.setState),useDirectStoreUpdater("fitViewOnInit",zt,_n.setState),useDirectStoreUpdater("fitViewOnInitOptions",Ot,_n.setState),useDirectStoreUpdater("onNodesDelete",jt,_n.setState),useDirectStoreUpdater("onEdgesDelete",kt,_n.setState),useDirectStoreUpdater("onNodeDrag",Tt,_n.setState),useDirectStoreUpdater("onNodeDragStart",Ct,_n.setState),useDirectStoreUpdater("onNodeDragStop",Ut,_n.setState),useDirectStoreUpdater("onSelectionDrag",Nt,_n.setState),useDirectStoreUpdater("onSelectionDragStart",Bt,_n.setState),useDirectStoreUpdater("onSelectionDragStop",Mt,_n.setState),useDirectStoreUpdater("noPanClassName",Dt,_n.setState),useDirectStoreUpdater("nodeOrigin",Pt,_n.setState),useDirectStoreUpdater("rfId",Vt,_n.setState),useDirectStoreUpdater("autoPanOnConnect",nn,_n.setState),useDirectStoreUpdater("autoPanOnNodeDrag",cn,_n.setState),useDirectStoreUpdater("onError",Xt,_n.setState),useDirectStoreUpdater("connectionRadius",un,_n.setState),useDirectStoreUpdater("isValidConnection",en,_n.setState),useDirectStoreUpdater("nodeDragThreshold",fn,_n.setState),useStoreUpdater(tt,xn),useStoreUpdater(et,an),useStoreUpdater(gt,En),useStoreUpdater(bt,In),useStoreUpdater(It,Cn),useStoreUpdater(yt,Nn),null},style$1={display:"none"},ariaLiveStyle={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ARIA_NODE_DESC_KEY="react-flow__node-desc",ARIA_EDGE_DESC_KEY="react-flow__edge-desc",ARIA_LIVE_MESSAGE="react-flow__aria-live",selector$c=tt=>tt.ariaLiveMessage;function AriaLiveMessage({rfId:tt}){const et=useStore(selector$c);return React$1.createElement("div",{id:`${ARIA_LIVE_MESSAGE}-${tt}`,"aria-live":"assertive","aria-atomic":"true",style:ariaLiveStyle},et)}function A11yDescriptions({rfId:tt,disableKeyboardA11y:et}){return React$1.createElement(React$1.Fragment,null,React$1.createElement("div",{id:`${ARIA_NODE_DESC_KEY}-${tt}`,style:style$1},"Press enter or space to select a node.",!et&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),React$1.createElement("div",{id:`${ARIA_EDGE_DESC_KEY}-${tt}`,style:style$1},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!et&&React$1.createElement(AriaLiveMessage,{rfId:tt}))}var useKeyPress=(tt=null,et={actInsideInputWithModifier:!0})=>{const[nt,it]=reactExports.useState(!1),rt=reactExports.useRef(!1),ot=reactExports.useRef(new Set([])),[at,st]=reactExports.useMemo(()=>{if(tt!==null){const ct=(Array.isArray(tt)?tt:[tt]).filter(ht=>typeof ht=="string").map(ht=>ht.split("+")),ut=ct.reduce((ht,dt)=>ht.concat(...dt),[]);return[ct,ut]}return[[],[]]},[tt]);return reactExports.useEffect(()=>{const lt=typeof document<"u"?document:null,ct=(et==null?void 0:et.target)||lt;if(tt!==null){const ut=pt=>{if(rt.current=pt.ctrlKey||pt.metaKey||pt.shiftKey,(!rt.current||rt.current&&!et.actInsideInputWithModifier)&&isInputDOMNode(pt))return!1;const gt=useKeyOrCode(pt.code,st);ot.current.add(pt[gt]),isMatchingKey(at,ot.current,!1)&&(pt.preventDefault(),it(!0))},ht=pt=>{if((!rt.current||rt.current&&!et.actInsideInputWithModifier)&&isInputDOMNode(pt))return!1;const gt=useKeyOrCode(pt.code,st);isMatchingKey(at,ot.current,!0)?(it(!1),ot.current.clear()):ot.current.delete(pt[gt]),pt.key==="Meta"&&ot.current.clear(),rt.current=!1},dt=()=>{ot.current.clear(),it(!1)};return ct==null||ct.addEventListener("keydown",ut),ct==null||ct.addEventListener("keyup",ht),window.addEventListener("blur",dt),()=>{ct==null||ct.removeEventListener("keydown",ut),ct==null||ct.removeEventListener("keyup",ht),window.removeEventListener("blur",dt)}}},[tt,it]),nt};function isMatchingKey(tt,et,nt){return tt.filter(it=>nt||it.length===et.size).some(it=>it.every(rt=>et.has(rt)))}function useKeyOrCode(tt,et){return et.includes(tt)?"code":"key"}function calculateXYZPosition(tt,et,nt,it){var at,st;if(!tt.parentNode)return nt;const rt=et.get(tt.parentNode),ot=getNodePositionWithOrigin(rt,it);return calculateXYZPosition(rt,et,{x:(nt.x??0)+ot.x,y:(nt.y??0)+ot.y,z:(((at=rt[internalsSymbol])==null?void 0:at.z)??0)>(nt.z??0)?((st=rt[internalsSymbol])==null?void 0:st.z)??0:nt.z??0},it)}function updateAbsoluteNodePositions(tt,et,nt){tt.forEach(it=>{var rt;if(it.parentNode&&!tt.has(it.parentNode))throw new Error(`Parent node ${it.parentNode} not found`);if(it.parentNode||nt!=null&&nt[it.id]){const{x:ot,y:at,z:st}=calculateXYZPosition(it,tt,{...it.position,z:((rt=it[internalsSymbol])==null?void 0:rt.z)??0},et);it.positionAbsolute={x:ot,y:at},it[internalsSymbol].z=st,nt!=null&&nt[it.id]&&(it[internalsSymbol].isParent=!0)}})}function createNodeInternals(tt,et,nt,it){const rt=new Map,ot={},at=it?1e3:0;return tt.forEach(st=>{var ht;const lt=(isNumeric(st.zIndex)?st.zIndex:0)+(st.selected?at:0),ct=et.get(st.id),ut={width:ct==null?void 0:ct.width,height:ct==null?void 0:ct.height,...st,positionAbsolute:{x:st.position.x,y:st.position.y}};st.parentNode&&(ut.parentNode=st.parentNode,ot[st.parentNode]=!0),Object.defineProperty(ut,internalsSymbol,{enumerable:!1,value:{handleBounds:(ht=ct==null?void 0:ct[internalsSymbol])==null?void 0:ht.handleBounds,z:lt}}),rt.set(st.id,ut)}),updateAbsoluteNodePositions(rt,nt,ot),rt}function fitView(tt,et={}){const{getNodes:nt,width:it,height:rt,minZoom:ot,maxZoom:at,d3Zoom:st,d3Selection:lt,fitViewOnInitDone:ct,fitViewOnInit:ut,nodeOrigin:ht}=tt(),dt=et.initial&&!ct&&ut;if(st&<&&(dt||!et.initial)){const mt=nt().filter(bt=>{var wt;const yt=et.includeHiddenNodes?bt.width&&bt.height:!bt.hidden;return(wt=et.nodes)!=null&&wt.length?yt&&et.nodes.some(vt=>vt.id===bt.id):yt}),gt=mt.every(bt=>bt.width&&bt.height);if(mt.length>0&>){const bt=getNodesBounds(mt,ht),{x:yt,y:wt,zoom:vt}=getViewportForBounds(bt,it,rt,et.minZoom??ot,et.maxZoom??at,et.padding??.1),xt=identity.translate(yt,wt).scale(vt);return typeof et.duration=="number"&&et.duration>0?st.transform(getD3Transition(lt,et.duration),xt):st.transform(lt,xt),!0}}return!1}function handleControlledNodeSelectionChange(tt,et){return tt.forEach(nt=>{const it=et.get(nt.id);it&&et.set(it.id,{...it,[internalsSymbol]:it[internalsSymbol],selected:nt.selected})}),new Map(et)}function handleControlledEdgeSelectionChange(tt,et){return et.map(nt=>{const it=tt.find(rt=>rt.id===nt.id);return it&&(nt.selected=it.selected),nt})}function updateNodesAndEdgesSelections({changedNodes:tt,changedEdges:et,get:nt,set:it}){const{nodeInternals:rt,edges:ot,onNodesChange:at,onEdgesChange:st,hasDefaultNodes:lt,hasDefaultEdges:ct}=nt();tt!=null&&tt.length&&(lt&&it({nodeInternals:handleControlledNodeSelectionChange(tt,rt)}),at==null||at(tt)),et!=null&&et.length&&(ct&&it({edges:handleControlledEdgeSelectionChange(et,ot)}),st==null||st(et))}const noop$1=()=>{},initialViewportHelper={zoomIn:noop$1,zoomOut:noop$1,zoomTo:noop$1,getZoom:()=>1,setViewport:noop$1,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:noop$1,fitBounds:noop$1,project:tt=>tt,screenToFlowPosition:tt=>tt,flowToScreenPosition:tt=>tt,viewportInitialized:!1},selector$b=tt=>({d3Zoom:tt.d3Zoom,d3Selection:tt.d3Selection}),useViewportHelper=()=>{const tt=useStoreApi(),{d3Zoom:et,d3Selection:nt}=useStore(selector$b,shallow$1);return reactExports.useMemo(()=>nt&&et?{zoomIn:rt=>et.scaleBy(getD3Transition(nt,rt==null?void 0:rt.duration),1.2),zoomOut:rt=>et.scaleBy(getD3Transition(nt,rt==null?void 0:rt.duration),1/1.2),zoomTo:(rt,ot)=>et.scaleTo(getD3Transition(nt,ot==null?void 0:ot.duration),rt),getZoom:()=>tt.getState().transform[2],setViewport:(rt,ot)=>{const[at,st,lt]=tt.getState().transform,ct=identity.translate(rt.x??at,rt.y??st).scale(rt.zoom??lt);et.transform(getD3Transition(nt,ot==null?void 0:ot.duration),ct)},getViewport:()=>{const[rt,ot,at]=tt.getState().transform;return{x:rt,y:ot,zoom:at}},fitView:rt=>fitView(tt.getState,rt),setCenter:(rt,ot,at)=>{const{width:st,height:lt,maxZoom:ct}=tt.getState(),ut=typeof(at==null?void 0:at.zoom)<"u"?at.zoom:ct,ht=st/2-rt*ut,dt=lt/2-ot*ut,pt=identity.translate(ht,dt).scale(ut);et.transform(getD3Transition(nt,at==null?void 0:at.duration),pt)},fitBounds:(rt,ot)=>{const{width:at,height:st,minZoom:lt,maxZoom:ct}=tt.getState(),{x:ut,y:ht,zoom:dt}=getViewportForBounds(rt,at,st,lt,ct,(ot==null?void 0:ot.padding)??.1),pt=identity.translate(ut,ht).scale(dt);et.transform(getD3Transition(nt,ot==null?void 0:ot.duration),pt)},project:rt=>{const{transform:ot,snapToGrid:at,snapGrid:st}=tt.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),pointToRendererPoint(rt,ot,at,st)},screenToFlowPosition:rt=>{const{transform:ot,snapToGrid:at,snapGrid:st,domNode:lt}=tt.getState();if(!lt)return rt;const{x:ct,y:ut}=lt.getBoundingClientRect(),ht={x:rt.x-ct,y:rt.y-ut};return pointToRendererPoint(ht,ot,at,st)},flowToScreenPosition:rt=>{const{transform:ot,domNode:at}=tt.getState();if(!at)return rt;const{x:st,y:lt}=at.getBoundingClientRect(),ct=rendererPointToPoint(rt,ot);return{x:ct.x+st,y:ct.y+lt}},viewportInitialized:!0}:initialViewportHelper,[et,nt])};function useReactFlow(){const tt=useViewportHelper(),et=useStoreApi(),nt=reactExports.useCallback(()=>et.getState().getNodes().map(gt=>({...gt})),[]),it=reactExports.useCallback(gt=>et.getState().nodeInternals.get(gt),[]),rt=reactExports.useCallback(()=>{const{edges:gt=[]}=et.getState();return gt.map(bt=>({...bt}))},[]),ot=reactExports.useCallback(gt=>{const{edges:bt=[]}=et.getState();return bt.find(yt=>yt.id===gt)},[]),at=reactExports.useCallback(gt=>{const{getNodes:bt,setNodes:yt,hasDefaultNodes:wt,onNodesChange:vt}=et.getState(),xt=bt(),St=typeof gt=="function"?gt(xt):gt;if(wt)yt(St);else if(vt){const Et=St.length===0?xt.map($t=>({type:"remove",id:$t.id})):St.map($t=>({item:$t,type:"reset"}));vt(Et)}},[]),st=reactExports.useCallback(gt=>{const{edges:bt=[],setEdges:yt,hasDefaultEdges:wt,onEdgesChange:vt}=et.getState(),xt=typeof gt=="function"?gt(bt):gt;if(wt)yt(xt);else if(vt){const St=xt.length===0?bt.map(Et=>({type:"remove",id:Et.id})):xt.map(Et=>({item:Et,type:"reset"}));vt(St)}},[]),lt=reactExports.useCallback(gt=>{const bt=Array.isArray(gt)?gt:[gt],{getNodes:yt,setNodes:wt,hasDefaultNodes:vt,onNodesChange:xt}=et.getState();if(vt){const Et=[...yt(),...bt];wt(Et)}else if(xt){const St=bt.map(Et=>({item:Et,type:"add"}));xt(St)}},[]),ct=reactExports.useCallback(gt=>{const bt=Array.isArray(gt)?gt:[gt],{edges:yt=[],setEdges:wt,hasDefaultEdges:vt,onEdgesChange:xt}=et.getState();if(vt)wt([...yt,...bt]);else if(xt){const St=bt.map(Et=>({item:Et,type:"add"}));xt(St)}},[]),ut=reactExports.useCallback(()=>{const{getNodes:gt,edges:bt=[],transform:yt}=et.getState(),[wt,vt,xt]=yt;return{nodes:gt().map(St=>({...St})),edges:bt.map(St=>({...St})),viewport:{x:wt,y:vt,zoom:xt}}},[]),ht=reactExports.useCallback(({nodes:gt,edges:bt})=>{const{nodeInternals:yt,getNodes:wt,edges:vt,hasDefaultNodes:xt,hasDefaultEdges:St,onNodesDelete:Et,onEdgesDelete:$t,onNodesChange:It,onEdgesChange:Ft}=et.getState(),Ht=(gt||[]).map(Tt=>Tt.id),zt=(bt||[]).map(Tt=>Tt.id),Ot=wt().reduce((Tt,Ct)=>{const Ut=!Ht.includes(Ct.id)&&Ct.parentNode&&Tt.find(Bt=>Bt.id===Ct.parentNode);return(typeof Ct.deletable=="boolean"?Ct.deletable:!0)&&(Ht.includes(Ct.id)||Ut)&&Tt.push(Ct),Tt},[]),jt=vt.filter(Tt=>typeof Tt.deletable=="boolean"?Tt.deletable:!0),kt=jt.filter(Tt=>zt.includes(Tt.id));if(Ot||kt){const Tt=getConnectedEdges(Ot,jt),Ct=[...kt,...Tt],Ut=Ct.reduce((Nt,Bt)=>(Nt.includes(Bt.id)||Nt.push(Bt.id),Nt),[]);if((St||xt)&&(St&&et.setState({edges:vt.filter(Nt=>!Ut.includes(Nt.id))}),xt&&(Ot.forEach(Nt=>{yt.delete(Nt.id)}),et.setState({nodeInternals:new Map(yt)}))),Ut.length>0&&($t==null||$t(Ct),Ft&&Ft(Ut.map(Nt=>({id:Nt,type:"remove"})))),Ot.length>0&&(Et==null||Et(Ot),It)){const Nt=Ot.map(Bt=>({id:Bt.id,type:"remove"}));It(Nt)}}},[]),dt=reactExports.useCallback(gt=>{const bt=isRectObject(gt),yt=bt?null:et.getState().nodeInternals.get(gt.id);return[bt?gt:nodeToRect(yt),yt,bt]},[]),pt=reactExports.useCallback((gt,bt=!0,yt)=>{const[wt,vt,xt]=dt(gt);return wt?(yt||et.getState().getNodes()).filter(St=>{if(!xt&&(St.id===vt.id||!St.positionAbsolute))return!1;const Et=nodeToRect(St),$t=getOverlappingArea(Et,wt);return bt&&$t>0||$t>=wt.width*wt.height}):[]},[]),mt=reactExports.useCallback((gt,bt,yt=!0)=>{const[wt]=dt(gt);if(!wt)return!1;const vt=getOverlappingArea(wt,bt);return yt&&vt>0||vt>=wt.width*wt.height},[]);return reactExports.useMemo(()=>({...tt,getNodes:nt,getNode:it,getEdges:rt,getEdge:ot,setNodes:at,setEdges:st,addNodes:lt,addEdges:ct,toObject:ut,deleteElements:ht,getIntersectingNodes:pt,isNodeIntersecting:mt}),[tt,nt,it,rt,ot,at,st,lt,ct,ut,ht,pt,mt])}const deleteKeyOptions={actInsideInputWithModifier:!1};var useGlobalKeyHandler=({deleteKeyCode:tt,multiSelectionKeyCode:et})=>{const nt=useStoreApi(),{deleteElements:it}=useReactFlow(),rt=useKeyPress(tt,deleteKeyOptions),ot=useKeyPress(et);reactExports.useEffect(()=>{if(rt){const{edges:at,getNodes:st}=nt.getState(),lt=st().filter(ut=>ut.selected),ct=at.filter(ut=>ut.selected);it({nodes:lt,edges:ct}),nt.setState({nodesSelectionActive:!1})}},[rt]),reactExports.useEffect(()=>{nt.setState({multiSelectionActive:ot})},[ot])};function useResizeHandler(tt){const et=useStoreApi();reactExports.useEffect(()=>{let nt;const it=()=>{var ot,at;if(!tt.current)return;const rt=getDimensions(tt.current);(rt.height===0||rt.width===0)&&((at=(ot=et.getState()).onError)==null||at.call(ot,"004",errorMessages.error004())),et.setState({width:rt.width||500,height:rt.height||500})};return it(),window.addEventListener("resize",it),tt.current&&(nt=new ResizeObserver(()=>it()),nt.observe(tt.current)),()=>{window.removeEventListener("resize",it),nt&&tt.current&&nt.unobserve(tt.current)}},[])}const containerStyle={position:"absolute",width:"100%",height:"100%",top:0,left:0},viewChanged=(tt,et)=>tt.x!==et.x||tt.y!==et.y||tt.zoom!==et.k,eventToFlowTransform=tt=>({x:tt.x,y:tt.y,zoom:tt.k}),isWrappedWithClass=(tt,et)=>tt.target.closest(`.${et}`),isRightClickPan=(tt,et)=>et===2&&Array.isArray(tt)&&tt.includes(2),wheelDelta=tt=>{const et=tt.ctrlKey&&isMacOs()?10:1;return-tt.deltaY*(tt.deltaMode===1?.05:tt.deltaMode?1:.002)*et},selector$a=tt=>({d3Zoom:tt.d3Zoom,d3Selection:tt.d3Selection,d3ZoomHandler:tt.d3ZoomHandler,userSelectionActive:tt.userSelectionActive}),ZoomPane=({onMove:tt,onMoveStart:et,onMoveEnd:nt,onPaneContextMenu:it,zoomOnScroll:rt=!0,zoomOnPinch:ot=!0,panOnScroll:at=!1,panOnScrollSpeed:st=.5,panOnScrollMode:lt=PanOnScrollMode.Free,zoomOnDoubleClick:ct=!0,elementsSelectable:ut,panOnDrag:ht=!0,defaultViewport:dt,translateExtent:pt,minZoom:mt,maxZoom:gt,zoomActivationKeyCode:bt,preventScrolling:yt=!0,children:wt,noWheelClassName:vt,noPanClassName:xt})=>{const St=reactExports.useRef(),Et=useStoreApi(),$t=reactExports.useRef(!1),It=reactExports.useRef(!1),Ft=reactExports.useRef(null),Ht=reactExports.useRef({x:0,y:0,zoom:0}),{d3Zoom:zt,d3Selection:Ot,d3ZoomHandler:jt,userSelectionActive:kt}=useStore(selector$a,shallow$1),Tt=useKeyPress(bt),Ct=reactExports.useRef(0),Ut=reactExports.useRef(!1),Nt=reactExports.useRef();return useResizeHandler(Ft),reactExports.useEffect(()=>{if(Ft.current){const Bt=Ft.current.getBoundingClientRect(),Mt=zoom().scaleExtent([mt,gt]).translateExtent(pt),Dt=select(Ft.current).call(Mt),Pt=identity.translate(dt.x,dt.y).scale(clamp(dt.zoom,mt,gt)),Vt=[[0,0],[Bt.width,Bt.height]],nn=Mt.constrain()(Pt,Vt,pt);Mt.transform(Dt,nn),Mt.wheelDelta(wheelDelta),Et.setState({d3Zoom:Mt,d3Selection:Dt,d3ZoomHandler:Dt.on("wheel.zoom"),transform:[nn.x,nn.y,nn.k],domNode:Ft.current.closest(".react-flow")})}},[]),reactExports.useEffect(()=>{Ot&&zt&&(at&&!Tt&&!kt?Ot.on("wheel.zoom",Bt=>{if(isWrappedWithClass(Bt,vt))return!1;Bt.preventDefault(),Bt.stopImmediatePropagation();const Mt=Ot.property("__zoom").k||1,Dt=isMacOs();if(Bt.ctrlKey&&ot&&Dt){const fn=pointer(Bt),xn=wheelDelta(Bt),an=Mt*Math.pow(2,xn);zt.scaleTo(Ot,an,fn,Bt);return}const Pt=Bt.deltaMode===1?20:1;let Vt=lt===PanOnScrollMode.Vertical?0:Bt.deltaX*Pt,nn=lt===PanOnScrollMode.Horizontal?0:Bt.deltaY*Pt;!Dt&&Bt.shiftKey&<!==PanOnScrollMode.Vertical&&(Vt=Bt.deltaY*Pt,nn=0),zt.translateBy(Ot,-(Vt/Mt)*st,-(nn/Mt)*st,{internal:!0});const cn=eventToFlowTransform(Ot.property("__zoom")),{onViewportChangeStart:Xt,onViewportChange:un,onViewportChangeEnd:en}=Et.getState();clearTimeout(Nt.current),Ut.current||(Ut.current=!0,et==null||et(Bt,cn),Xt==null||Xt(cn)),Ut.current&&(tt==null||tt(Bt,cn),un==null||un(cn),Nt.current=setTimeout(()=>{nt==null||nt(Bt,cn),en==null||en(cn),Ut.current=!1},150))},{passive:!1}):typeof jt<"u"&&Ot.on("wheel.zoom",function(Bt,Mt){if(!yt||isWrappedWithClass(Bt,vt))return null;Bt.preventDefault(),jt.call(this,Bt,Mt)},{passive:!1}))},[kt,at,lt,Ot,zt,jt,Tt,ot,yt,vt,et,tt,nt]),reactExports.useEffect(()=>{zt&&zt.on("start",Bt=>{var Pt,Vt;if(!Bt.sourceEvent||Bt.sourceEvent.internal)return null;Ct.current=(Pt=Bt.sourceEvent)==null?void 0:Pt.button;const{onViewportChangeStart:Mt}=Et.getState(),Dt=eventToFlowTransform(Bt.transform);$t.current=!0,Ht.current=Dt,((Vt=Bt.sourceEvent)==null?void 0:Vt.type)==="mousedown"&&Et.setState({paneDragging:!0}),Mt==null||Mt(Dt),et==null||et(Bt.sourceEvent,Dt)})},[zt,et]),reactExports.useEffect(()=>{zt&&(kt&&!$t.current?zt.on("zoom",null):kt||zt.on("zoom",Bt=>{var Dt;const{onViewportChange:Mt}=Et.getState();if(Et.setState({transform:[Bt.transform.x,Bt.transform.y,Bt.transform.k]}),It.current=!!(it&&isRightClickPan(ht,Ct.current??0)),(tt||Mt)&&!((Dt=Bt.sourceEvent)!=null&&Dt.internal)){const Pt=eventToFlowTransform(Bt.transform);Mt==null||Mt(Pt),tt==null||tt(Bt.sourceEvent,Pt)}}))},[kt,zt,tt,ht,it]),reactExports.useEffect(()=>{zt&&zt.on("end",Bt=>{if(!Bt.sourceEvent||Bt.sourceEvent.internal)return null;const{onViewportChangeEnd:Mt}=Et.getState();if($t.current=!1,Et.setState({paneDragging:!1}),it&&isRightClickPan(ht,Ct.current??0)&&!It.current&&it(Bt.sourceEvent),It.current=!1,(nt||Mt)&&viewChanged(Ht.current,Bt.transform)){const Dt=eventToFlowTransform(Bt.transform);Ht.current=Dt,clearTimeout(St.current),St.current=setTimeout(()=>{Mt==null||Mt(Dt),nt==null||nt(Bt.sourceEvent,Dt)},at?150:0)}})},[zt,at,ht,nt,it]),reactExports.useEffect(()=>{zt&&zt.filter(Bt=>{const Mt=Tt||rt,Dt=ot&&Bt.ctrlKey;if((ht===!0||Array.isArray(ht)&&ht.includes(1))&&Bt.button===1&&Bt.type==="mousedown"&&(isWrappedWithClass(Bt,"react-flow__node")||isWrappedWithClass(Bt,"react-flow__edge")))return!0;if(!ht&&!Mt&&!at&&!ct&&!ot||kt||!ct&&Bt.type==="dblclick"||isWrappedWithClass(Bt,vt)&&Bt.type==="wheel"||isWrappedWithClass(Bt,xt)&&(Bt.type!=="wheel"||at&&Bt.type==="wheel"&&!Tt)||!ot&&Bt.ctrlKey&&Bt.type==="wheel"||!Mt&&!at&&!Dt&&Bt.type==="wheel"||!ht&&(Bt.type==="mousedown"||Bt.type==="touchstart")||Array.isArray(ht)&&!ht.includes(Bt.button)&&(Bt.type==="mousedown"||Bt.type==="touchstart"))return!1;const Pt=Array.isArray(ht)&&ht.includes(Bt.button)||!Bt.button||Bt.button<=1;return(!Bt.ctrlKey||Bt.type==="wheel")&&Pt})},[kt,zt,rt,ot,at,ct,ht,ut,Tt]),React$1.createElement("div",{className:"react-flow__renderer",ref:Ft,style:containerStyle},wt)},selector$9=tt=>({userSelectionActive:tt.userSelectionActive,userSelectionRect:tt.userSelectionRect});function UserSelection(){const{userSelectionActive:tt,userSelectionRect:et}=useStore(selector$9,shallow$1);return tt&&et?React$1.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:et.width,height:et.height,transform:`translate(${et.x}px, ${et.y}px)`}}):null}function handleParentExpand(tt,et){const nt=tt.find(it=>it.id===et.parentNode);if(nt){const it=et.position.x+et.width-nt.width,rt=et.position.y+et.height-nt.height;if(it>0||rt>0||et.position.x<0||et.position.y<0){if(nt.style={...nt.style},nt.style.width=nt.style.width??nt.width,nt.style.height=nt.style.height??nt.height,it>0&&(nt.style.width+=it),rt>0&&(nt.style.height+=rt),et.position.x<0){const ot=Math.abs(et.position.x);nt.position.x=nt.position.x-ot,nt.style.width+=ot,et.position.x=0}if(et.position.y<0){const ot=Math.abs(et.position.y);nt.position.y=nt.position.y-ot,nt.style.height+=ot,et.position.y=0}nt.width=nt.style.width,nt.height=nt.style.height}}}function applyChanges(tt,et){if(tt.some(it=>it.type==="reset"))return tt.filter(it=>it.type==="reset").map(it=>it.item);const nt=tt.filter(it=>it.type==="add").map(it=>it.item);return et.reduce((it,rt)=>{const ot=tt.filter(st=>st.id===rt.id);if(ot.length===0)return it.push(rt),it;const at={...rt};for(const st of ot)if(st)switch(st.type){case"select":{at.selected=st.selected;break}case"position":{typeof st.position<"u"&&(at.position=st.position),typeof st.positionAbsolute<"u"&&(at.positionAbsolute=st.positionAbsolute),typeof st.dragging<"u"&&(at.dragging=st.dragging),at.expandParent&&handleParentExpand(it,at);break}case"dimensions":{typeof st.dimensions<"u"&&(at.width=st.dimensions.width,at.height=st.dimensions.height),typeof st.updateStyle<"u"&&(at.style={...at.style||{},...st.dimensions}),typeof st.resizing=="boolean"&&(at.resizing=st.resizing),at.expandParent&&handleParentExpand(it,at);break}case"remove":return it}return it.push(at),it},nt)}function applyNodeChanges(tt,et){return applyChanges(tt,et)}const createSelectionChange=(tt,et)=>({id:tt,type:"select",selected:et});function getSelectionChanges(tt,et){return tt.reduce((nt,it)=>{const rt=et.includes(it.id);return!it.selected&&rt?(it.selected=!0,nt.push(createSelectionChange(it.id,!0))):it.selected&&!rt&&(it.selected=!1,nt.push(createSelectionChange(it.id,!1))),nt},[])}const wrapHandler=(tt,et)=>nt=>{nt.target===et.current&&(tt==null||tt(nt))},selector$8=tt=>({userSelectionActive:tt.userSelectionActive,elementsSelectable:tt.elementsSelectable,dragging:tt.paneDragging}),Pane=reactExports.memo(({isSelecting:tt,selectionMode:et=SelectionMode.Full,panOnDrag:nt,onSelectionStart:it,onSelectionEnd:rt,onPaneClick:ot,onPaneContextMenu:at,onPaneScroll:st,onPaneMouseEnter:lt,onPaneMouseMove:ct,onPaneMouseLeave:ut,children:ht})=>{const dt=reactExports.useRef(null),pt=useStoreApi(),mt=reactExports.useRef(0),gt=reactExports.useRef(0),bt=reactExports.useRef(),{userSelectionActive:yt,elementsSelectable:wt,dragging:vt}=useStore(selector$8,shallow$1),xt=()=>{pt.setState({userSelectionActive:!1,userSelectionRect:null}),mt.current=0,gt.current=0},St=jt=>{ot==null||ot(jt),pt.getState().resetSelectedElements(),pt.setState({nodesSelectionActive:!1})},Et=jt=>{if(Array.isArray(nt)&&(nt!=null&&nt.includes(2))){jt.preventDefault();return}at==null||at(jt)},$t=st?jt=>st(jt):void 0,It=jt=>{const{resetSelectedElements:kt,domNode:Tt}=pt.getState();if(bt.current=Tt==null?void 0:Tt.getBoundingClientRect(),!wt||!tt||jt.button!==0||jt.target!==dt.current||!bt.current)return;const{x:Ct,y:Ut}=getEventPosition(jt,bt.current);kt(),pt.setState({userSelectionRect:{width:0,height:0,startX:Ct,startY:Ut,x:Ct,y:Ut}}),it==null||it(jt)},Ft=jt=>{const{userSelectionRect:kt,nodeInternals:Tt,edges:Ct,transform:Ut,onNodesChange:Nt,onEdgesChange:Bt,nodeOrigin:Mt,getNodes:Dt}=pt.getState();if(!tt||!bt.current||!kt)return;pt.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Pt=getEventPosition(jt,bt.current),Vt=kt.startX??0,nn=kt.startY??0,cn={...kt,x:Pt.xxn.id),fn=un.map(xn=>xn.id);if(mt.current!==fn.length){mt.current=fn.length;const xn=getSelectionChanges(Xt,fn);xn.length&&(Nt==null||Nt(xn))}if(gt.current!==en.length){gt.current=en.length;const xn=getSelectionChanges(Ct,en);xn.length&&(Bt==null||Bt(xn))}pt.setState({userSelectionRect:cn})},Ht=jt=>{if(jt.button!==0)return;const{userSelectionRect:kt}=pt.getState();!yt&&kt&&jt.target===dt.current&&(St==null||St(jt)),pt.setState({nodesSelectionActive:mt.current>0}),xt(),rt==null||rt(jt)},zt=jt=>{yt&&(pt.setState({nodesSelectionActive:mt.current>0}),rt==null||rt(jt)),xt()},Ot=wt&&(tt||yt);return React$1.createElement("div",{className:cc(["react-flow__pane",{dragging:vt,selection:tt}]),onClick:Ot?void 0:wrapHandler(St,dt),onContextMenu:wrapHandler(Et,dt),onWheel:wrapHandler($t,dt),onMouseEnter:Ot?void 0:lt,onMouseDown:Ot?It:void 0,onMouseMove:Ot?Ft:ct,onMouseUp:Ot?Ht:void 0,onMouseLeave:Ot?zt:ut,ref:dt,style:containerStyle},ht,React$1.createElement(UserSelection,null))});Pane.displayName="Pane";function isParentSelected(tt,et){if(!tt.parentNode)return!1;const nt=et.get(tt.parentNode);return nt?nt.selected?!0:isParentSelected(nt,et):!1}function hasSelector(tt,et,nt){let it=tt;do{if(it!=null&&it.matches(et))return!0;if(it===nt.current)return!1;it=it.parentElement}while(it);return!1}function getDragItems(tt,et,nt,it){return Array.from(tt.values()).filter(rt=>(rt.selected||rt.id===it)&&(!rt.parentNode||!isParentSelected(rt,tt))&&(rt.draggable||et&&typeof rt.draggable>"u")).map(rt=>{var ot,at;return{id:rt.id,position:rt.position||{x:0,y:0},positionAbsolute:rt.positionAbsolute||{x:0,y:0},distance:{x:nt.x-(((ot=rt.positionAbsolute)==null?void 0:ot.x)??0),y:nt.y-(((at=rt.positionAbsolute)==null?void 0:at.y)??0)},delta:{x:0,y:0},extent:rt.extent,parentNode:rt.parentNode,width:rt.width,height:rt.height,expandParent:rt.expandParent}})}function clampNodeExtent(tt,et){return!et||et==="parent"?et:[et[0],[et[1][0]-(tt.width||0),et[1][1]-(tt.height||0)]]}function calcNextPosition(tt,et,nt,it,rt=[0,0],ot){const at=clampNodeExtent(tt,tt.extent||it);let st=at;if(tt.extent==="parent"&&!tt.expandParent)if(tt.parentNode&&tt.width&&tt.height){const ut=nt.get(tt.parentNode),{x:ht,y:dt}=getNodePositionWithOrigin(ut,rt).positionAbsolute;st=ut&&isNumeric(ht)&&isNumeric(dt)&&isNumeric(ut.width)&&isNumeric(ut.height)?[[ht+tt.width*rt[0],dt+tt.height*rt[1]],[ht+ut.width-tt.width+tt.width*rt[0],dt+ut.height-tt.height+tt.height*rt[1]]]:st}else ot==null||ot("005",errorMessages.error005()),st=at;else if(tt.extent&&tt.parentNode&&tt.extent!=="parent"){const ut=nt.get(tt.parentNode),{x:ht,y:dt}=getNodePositionWithOrigin(ut,rt).positionAbsolute;st=[[tt.extent[0][0]+ht,tt.extent[0][1]+dt],[tt.extent[1][0]+ht,tt.extent[1][1]+dt]]}let lt={x:0,y:0};if(tt.parentNode){const ut=nt.get(tt.parentNode);lt=getNodePositionWithOrigin(ut,rt).positionAbsolute}const ct=st&&st!=="parent"?clampPosition(et,st):et;return{position:{x:ct.x-lt.x,y:ct.y-lt.y},positionAbsolute:ct}}function getEventHandlerParams({nodeId:tt,dragItems:et,nodeInternals:nt}){const it=et.map(rt=>({...nt.get(rt.id),position:rt.position,positionAbsolute:rt.positionAbsolute}));return[tt?it.find(rt=>rt.id===tt):it[0],it]}const getHandleBounds=(tt,et,nt,it)=>{const rt=et.querySelectorAll(tt);if(!rt||!rt.length)return null;const ot=Array.from(rt),at=et.getBoundingClientRect(),st={x:at.width*it[0],y:at.height*it[1]};return ot.map(lt=>{const ct=lt.getBoundingClientRect();return{id:lt.getAttribute("data-handleid"),position:lt.getAttribute("data-handlepos"),x:(ct.left-at.left-st.x)/nt,y:(ct.top-at.top-st.y)/nt,...getDimensions(lt)}})};function getMouseHandler(tt,et,nt){return nt===void 0?nt:it=>{const rt=et().nodeInternals.get(tt);rt&&nt(it,{...rt})}}function handleNodeClick({id:tt,store:et,unselect:nt=!1,nodeRef:it}){const{addSelectedNodes:rt,unselectNodesAndEdges:ot,multiSelectionActive:at,nodeInternals:st,onError:lt}=et.getState(),ct=st.get(tt);if(!ct){lt==null||lt("012",errorMessages.error012(tt));return}et.setState({nodesSelectionActive:!1}),ct.selected?(nt||ct.selected&&at)&&(ot({nodes:[ct],edges:[]}),requestAnimationFrame(()=>{var ut;return(ut=it==null?void 0:it.current)==null?void 0:ut.blur()})):rt([tt])}function useGetPointerPosition(){const tt=useStoreApi();return reactExports.useCallback(({sourceEvent:nt})=>{const{transform:it,snapGrid:rt,snapToGrid:ot}=tt.getState(),at=nt.touches?nt.touches[0].clientX:nt.clientX,st=nt.touches?nt.touches[0].clientY:nt.clientY,lt={x:(at-it[0])/it[2],y:(st-it[1])/it[2]};return{xSnapped:ot?rt[0]*Math.round(lt.x/rt[0]):lt.x,ySnapped:ot?rt[1]*Math.round(lt.y/rt[1]):lt.y,...lt}},[])}function wrapSelectionDragFunc(tt){return(et,nt,it)=>tt==null?void 0:tt(et,it)}function useDrag({nodeRef:tt,disabled:et=!1,noDragClassName:nt,handleSelector:it,nodeId:rt,isSelectable:ot,selectNodesOnDrag:at}){const st=useStoreApi(),[lt,ct]=reactExports.useState(!1),ut=reactExports.useRef([]),ht=reactExports.useRef({x:null,y:null}),dt=reactExports.useRef(0),pt=reactExports.useRef(null),mt=reactExports.useRef({x:0,y:0}),gt=reactExports.useRef(null),bt=reactExports.useRef(!1),yt=reactExports.useRef(!1),wt=useGetPointerPosition();return reactExports.useEffect(()=>{if(tt!=null&&tt.current){const vt=select(tt.current),xt=({x:$t,y:It})=>{const{nodeInternals:Ft,onNodeDrag:Ht,onSelectionDrag:zt,updateNodePositions:Ot,nodeExtent:jt,snapGrid:kt,snapToGrid:Tt,nodeOrigin:Ct,onError:Ut}=st.getState();ht.current={x:$t,y:It};let Nt=!1,Bt={x:0,y:0,x2:0,y2:0};if(ut.current.length>1&&jt){const Dt=getNodesBounds(ut.current,Ct);Bt=rectToBox(Dt)}if(ut.current=ut.current.map(Dt=>{const Pt={x:$t-Dt.distance.x,y:It-Dt.distance.y};Tt&&(Pt.x=kt[0]*Math.round(Pt.x/kt[0]),Pt.y=kt[1]*Math.round(Pt.y/kt[1]));const Vt=[[jt[0][0],jt[0][1]],[jt[1][0],jt[1][1]]];ut.current.length>1&&jt&&!Dt.extent&&(Vt[0][0]=Dt.positionAbsolute.x-Bt.x+jt[0][0],Vt[1][0]=Dt.positionAbsolute.x+(Dt.width??0)-Bt.x2+jt[1][0],Vt[0][1]=Dt.positionAbsolute.y-Bt.y+jt[0][1],Vt[1][1]=Dt.positionAbsolute.y+(Dt.height??0)-Bt.y2+jt[1][1]);const nn=calcNextPosition(Dt,Pt,Ft,Vt,Ct,Ut);return Nt=Nt||Dt.position.x!==nn.position.x||Dt.position.y!==nn.position.y,Dt.position=nn.position,Dt.positionAbsolute=nn.positionAbsolute,Dt}),!Nt)return;Ot(ut.current,!0,!0),ct(!0);const Mt=rt?Ht:wrapSelectionDragFunc(zt);if(Mt&>.current){const[Dt,Pt]=getEventHandlerParams({nodeId:rt,dragItems:ut.current,nodeInternals:Ft});Mt(gt.current,Dt,Pt)}},St=()=>{if(!pt.current)return;const[$t,It]=calcAutoPan(mt.current,pt.current);if($t!==0||It!==0){const{transform:Ft,panBy:Ht}=st.getState();ht.current.x=(ht.current.x??0)-$t/Ft[2],ht.current.y=(ht.current.y??0)-It/Ft[2],Ht({x:$t,y:It})&&xt(ht.current)}dt.current=requestAnimationFrame(St)},Et=$t=>{var Ct;const{nodeInternals:It,multiSelectionActive:Ft,nodesDraggable:Ht,unselectNodesAndEdges:zt,onNodeDragStart:Ot,onSelectionDragStart:jt}=st.getState();yt.current=!0;const kt=rt?Ot:wrapSelectionDragFunc(jt);(!at||!ot)&&!Ft&&rt&&((Ct=It.get(rt))!=null&&Ct.selected||zt()),rt&&ot&&at&&handleNodeClick({id:rt,store:st,nodeRef:tt});const Tt=wt($t);if(ht.current=Tt,ut.current=getDragItems(It,Ht,Tt,rt),kt&&ut.current){const[Ut,Nt]=getEventHandlerParams({nodeId:rt,dragItems:ut.current,nodeInternals:It});kt($t.sourceEvent,Ut,Nt)}};if(et)vt.on(".drag",null);else{const $t=drag().on("start",It=>{const{domNode:Ft,nodeDragThreshold:Ht}=st.getState();Ht===0&&Et(It);const zt=wt(It);ht.current=zt,pt.current=(Ft==null?void 0:Ft.getBoundingClientRect())||null,mt.current=getEventPosition(It.sourceEvent,pt.current)}).on("drag",It=>{var Ot,jt;const Ft=wt(It),{autoPanOnNodeDrag:Ht,nodeDragThreshold:zt}=st.getState();if(!bt.current&&yt.current&&Ht&&(bt.current=!0,St()),!yt.current){const kt=Ft.xSnapped-(((Ot=ht==null?void 0:ht.current)==null?void 0:Ot.x)??0),Tt=Ft.ySnapped-(((jt=ht==null?void 0:ht.current)==null?void 0:jt.y)??0);Math.sqrt(kt*kt+Tt*Tt)>zt&&Et(It)}(ht.current.x!==Ft.xSnapped||ht.current.y!==Ft.ySnapped)&&ut.current&&yt.current&&(gt.current=It.sourceEvent,mt.current=getEventPosition(It.sourceEvent,pt.current),xt(Ft))}).on("end",It=>{if(yt.current&&(ct(!1),bt.current=!1,yt.current=!1,cancelAnimationFrame(dt.current),ut.current)){const{updateNodePositions:Ft,nodeInternals:Ht,onNodeDragStop:zt,onSelectionDragStop:Ot}=st.getState(),jt=rt?zt:wrapSelectionDragFunc(Ot);if(Ft(ut.current,!1,!1),jt){const[kt,Tt]=getEventHandlerParams({nodeId:rt,dragItems:ut.current,nodeInternals:Ht});jt(It.sourceEvent,kt,Tt)}}}).filter(It=>{const Ft=It.target;return!It.button&&(!nt||!hasSelector(Ft,`.${nt}`,tt))&&(!it||hasSelector(Ft,it,tt))});return vt.call($t),()=>{vt.on(".drag",null)}}}},[tt,et,nt,it,ot,st,rt,at,wt]),lt}function useUpdateNodePositions(){const tt=useStoreApi();return reactExports.useCallback(nt=>{const{nodeInternals:it,nodeExtent:rt,updateNodePositions:ot,getNodes:at,snapToGrid:st,snapGrid:lt,onError:ct,nodesDraggable:ut}=tt.getState(),ht=at().filter(wt=>wt.selected&&(wt.draggable||ut&&typeof wt.draggable>"u")),dt=st?lt[0]:5,pt=st?lt[1]:5,mt=nt.isShiftPressed?4:1,gt=nt.x*dt*mt,bt=nt.y*pt*mt,yt=ht.map(wt=>{if(wt.positionAbsolute){const vt={x:wt.positionAbsolute.x+gt,y:wt.positionAbsolute.y+bt};st&&(vt.x=lt[0]*Math.round(vt.x/lt[0]),vt.y=lt[1]*Math.round(vt.y/lt[1]));const{positionAbsolute:xt,position:St}=calcNextPosition(wt,vt,it,rt,void 0,ct);wt.position=St,wt.positionAbsolute=xt}return wt});ot(yt,!0,!1)},[])}const arrowKeyDiffs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var wrapNode=tt=>{const et=({id:nt,type:it,data:rt,xPos:ot,yPos:at,xPosOrigin:st,yPosOrigin:lt,selected:ct,onClick:ut,onMouseEnter:ht,onMouseMove:dt,onMouseLeave:pt,onContextMenu:mt,onDoubleClick:gt,style:bt,className:yt,isDraggable:wt,isSelectable:vt,isConnectable:xt,isFocusable:St,selectNodesOnDrag:Et,sourcePosition:$t,targetPosition:It,hidden:Ft,resizeObserver:Ht,dragHandle:zt,zIndex:Ot,isParent:jt,noDragClassName:kt,noPanClassName:Tt,initialized:Ct,disableKeyboardA11y:Ut,ariaLabel:Nt,rfId:Bt})=>{const Mt=useStoreApi(),Dt=reactExports.useRef(null),Pt=reactExports.useRef($t),Vt=reactExports.useRef(It),nn=reactExports.useRef(it),cn=vt||wt||ut||ht||dt||pt,Xt=useUpdateNodePositions(),un=getMouseHandler(nt,Mt.getState,ht),en=getMouseHandler(nt,Mt.getState,dt),fn=getMouseHandler(nt,Mt.getState,pt),xn=getMouseHandler(nt,Mt.getState,mt),an=getMouseHandler(nt,Mt.getState,gt),Zt=Cn=>{const{nodeDragThreshold:Nn}=Mt.getState();if(vt&&(!Et||!wt||Nn>0)&&handleNodeClick({id:nt,store:Mt,nodeRef:Dt}),ut){const Un=Mt.getState().nodeInternals.get(nt);Un&&ut(Cn,{...Un})}},En=Cn=>{if(!isInputDOMNode(Cn))if(elementSelectionKeys.includes(Cn.key)&&vt){const Nn=Cn.key==="Escape";handleNodeClick({id:nt,store:Mt,unselect:Nn,nodeRef:Dt})}else!Ut&&wt&&ct&&Object.prototype.hasOwnProperty.call(arrowKeyDiffs,Cn.key)&&(Mt.setState({ariaLiveMessage:`Moved selected node ${Cn.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~ot}, y: ${~~at}`}),Xt({x:arrowKeyDiffs[Cn.key].x,y:arrowKeyDiffs[Cn.key].y,isShiftPressed:Cn.shiftKey}))};reactExports.useEffect(()=>{if(Dt.current&&!Ft){const Cn=Dt.current;return Ht==null||Ht.observe(Cn),()=>Ht==null?void 0:Ht.unobserve(Cn)}},[Ft]),reactExports.useEffect(()=>{const Cn=nn.current!==it,Nn=Pt.current!==$t,Un=Vt.current!==It;Dt.current&&(Cn||Nn||Un)&&(Cn&&(nn.current=it),Nn&&(Pt.current=$t),Un&&(Vt.current=It),Mt.getState().updateNodeDimensions([{id:nt,nodeElement:Dt.current,forceUpdate:!0}]))},[nt,it,$t,It]);const In=useDrag({nodeRef:Dt,disabled:Ft||!wt,noDragClassName:kt,handleSelector:zt,nodeId:nt,isSelectable:vt,selectNodesOnDrag:Et});return Ft?null:React$1.createElement("div",{className:cc(["react-flow__node",`react-flow__node-${it}`,{[Tt]:wt},yt,{selected:ct,selectable:vt,parent:jt,dragging:In}]),ref:Dt,style:{zIndex:Ot,transform:`translate(${st}px,${lt}px)`,pointerEvents:cn?"all":"none",visibility:Ct?"visible":"hidden",...bt},"data-id":nt,"data-testid":`rf__node-${nt}`,onMouseEnter:un,onMouseMove:en,onMouseLeave:fn,onContextMenu:xn,onClick:Zt,onDoubleClick:an,onKeyDown:St?En:void 0,tabIndex:St?0:void 0,role:St?"button":void 0,"aria-describedby":Ut?void 0:`${ARIA_NODE_DESC_KEY}-${Bt}`,"aria-label":Nt},React$1.createElement(Provider,{value:nt},React$1.createElement(tt,{id:nt,data:rt,type:it,xPos:ot,yPos:at,selected:ct,isConnectable:xt,sourcePosition:$t,targetPosition:It,dragging:In,dragHandle:zt,zIndex:Ot})))};return et.displayName="NodeWrapper",reactExports.memo(et)};const selector$7=tt=>{const et=tt.getNodes().filter(nt=>nt.selected);return{...getNodesBounds(et,tt.nodeOrigin),transformString:`translate(${tt.transform[0]}px,${tt.transform[1]}px) scale(${tt.transform[2]})`,userSelectionActive:tt.userSelectionActive}};function NodesSelection({onSelectionContextMenu:tt,noPanClassName:et,disableKeyboardA11y:nt}){const it=useStoreApi(),{width:rt,height:ot,x:at,y:st,transformString:lt,userSelectionActive:ct}=useStore(selector$7,shallow$1),ut=useUpdateNodePositions(),ht=reactExports.useRef(null);if(reactExports.useEffect(()=>{var mt;nt||(mt=ht.current)==null||mt.focus({preventScroll:!0})},[nt]),useDrag({nodeRef:ht}),ct||!rt||!ot)return null;const dt=tt?mt=>{const gt=it.getState().getNodes().filter(bt=>bt.selected);tt(mt,gt)}:void 0,pt=mt=>{Object.prototype.hasOwnProperty.call(arrowKeyDiffs,mt.key)&&ut({x:arrowKeyDiffs[mt.key].x,y:arrowKeyDiffs[mt.key].y,isShiftPressed:mt.shiftKey})};return React$1.createElement("div",{className:cc(["react-flow__nodesselection","react-flow__container",et]),style:{transform:lt}},React$1.createElement("div",{ref:ht,className:"react-flow__nodesselection-rect",onContextMenu:dt,tabIndex:nt?void 0:-1,onKeyDown:nt?void 0:pt,style:{width:rt,height:ot,top:st,left:at}}))}var NodesSelection$1=reactExports.memo(NodesSelection);const selector$6=tt=>tt.nodesSelectionActive,FlowRenderer=({children:tt,onPaneClick:et,onPaneMouseEnter:nt,onPaneMouseMove:it,onPaneMouseLeave:rt,onPaneContextMenu:ot,onPaneScroll:at,deleteKeyCode:st,onMove:lt,onMoveStart:ct,onMoveEnd:ut,selectionKeyCode:ht,selectionOnDrag:dt,selectionMode:pt,onSelectionStart:mt,onSelectionEnd:gt,multiSelectionKeyCode:bt,panActivationKeyCode:yt,zoomActivationKeyCode:wt,elementsSelectable:vt,zoomOnScroll:xt,zoomOnPinch:St,panOnScroll:Et,panOnScrollSpeed:$t,panOnScrollMode:It,zoomOnDoubleClick:Ft,panOnDrag:Ht,defaultViewport:zt,translateExtent:Ot,minZoom:jt,maxZoom:kt,preventScrolling:Tt,onSelectionContextMenu:Ct,noWheelClassName:Ut,noPanClassName:Nt,disableKeyboardA11y:Bt})=>{const Mt=useStore(selector$6),Dt=useKeyPress(ht),Pt=useKeyPress(yt),Vt=Pt||Ht,nn=Pt||Et,cn=Dt||dt&&Vt!==!0;return useGlobalKeyHandler({deleteKeyCode:st,multiSelectionKeyCode:bt}),React$1.createElement(ZoomPane,{onMove:lt,onMoveStart:ct,onMoveEnd:ut,onPaneContextMenu:ot,elementsSelectable:vt,zoomOnScroll:xt,zoomOnPinch:St,panOnScroll:nn,panOnScrollSpeed:$t,panOnScrollMode:It,zoomOnDoubleClick:Ft,panOnDrag:!Dt&&Vt,defaultViewport:zt,translateExtent:Ot,minZoom:jt,maxZoom:kt,zoomActivationKeyCode:wt,preventScrolling:Tt,noWheelClassName:Ut,noPanClassName:Nt},React$1.createElement(Pane,{onSelectionStart:mt,onSelectionEnd:gt,onPaneClick:et,onPaneMouseEnter:nt,onPaneMouseMove:it,onPaneMouseLeave:rt,onPaneContextMenu:ot,onPaneScroll:at,panOnDrag:Vt,isSelecting:!!cn,selectionMode:pt},tt,Mt&&React$1.createElement(NodesSelection$1,{onSelectionContextMenu:Ct,noPanClassName:Nt,disableKeyboardA11y:Bt})))};FlowRenderer.displayName="FlowRenderer";var FlowRenderer$1=reactExports.memo(FlowRenderer);function useVisibleNodes(tt){return useStore(reactExports.useCallback(nt=>tt?getNodesInside(nt.nodeInternals,{x:0,y:0,width:nt.width,height:nt.height},nt.transform,!0):nt.getNodes(),[tt]))}function createNodeTypes(tt){const et={input:wrapNode(tt.input||InputNode$1),default:wrapNode(tt.default||DefaultNode$1),output:wrapNode(tt.output||OutputNode$1),group:wrapNode(tt.group||GroupNode)},nt={},it=Object.keys(tt).filter(rt=>!["input","default","output","group"].includes(rt)).reduce((rt,ot)=>(rt[ot]=wrapNode(tt[ot]||DefaultNode$1),rt),nt);return{...et,...it}}const getPositionWithOrigin=({x:tt,y:et,width:nt,height:it,origin:rt})=>!nt||!it?{x:tt,y:et}:rt[0]<0||rt[1]<0||rt[0]>1||rt[1]>1?{x:tt,y:et}:{x:tt-nt*rt[0],y:et-it*rt[1]},selector$5=tt=>({nodesDraggable:tt.nodesDraggable,nodesConnectable:tt.nodesConnectable,nodesFocusable:tt.nodesFocusable,elementsSelectable:tt.elementsSelectable,updateNodeDimensions:tt.updateNodeDimensions,onError:tt.onError}),NodeRenderer=tt=>{const{nodesDraggable:et,nodesConnectable:nt,nodesFocusable:it,elementsSelectable:rt,updateNodeDimensions:ot,onError:at}=useStore(selector$5,shallow$1),st=useVisibleNodes(tt.onlyRenderVisibleElements),lt=reactExports.useRef(),ct=reactExports.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const ut=new ResizeObserver(ht=>{const dt=ht.map(pt=>({id:pt.target.getAttribute("data-id"),nodeElement:pt.target,forceUpdate:!0}));ot(dt)});return lt.current=ut,ut},[]);return reactExports.useEffect(()=>()=>{var ut;(ut=lt==null?void 0:lt.current)==null||ut.disconnect()},[]),React$1.createElement("div",{className:"react-flow__nodes",style:containerStyle},st.map(ut=>{var St,Et;let ht=ut.type||"default";tt.nodeTypes[ht]||(at==null||at("003",errorMessages.error003(ht)),ht="default");const dt=tt.nodeTypes[ht]||tt.nodeTypes.default,pt=!!(ut.draggable||et&&typeof ut.draggable>"u"),mt=!!(ut.selectable||rt&&typeof ut.selectable>"u"),gt=!!(ut.connectable||nt&&typeof ut.connectable>"u"),bt=!!(ut.focusable||it&&typeof ut.focusable>"u"),yt=tt.nodeExtent?clampPosition(ut.positionAbsolute,tt.nodeExtent):ut.positionAbsolute,wt=(yt==null?void 0:yt.x)??0,vt=(yt==null?void 0:yt.y)??0,xt=getPositionWithOrigin({x:wt,y:vt,width:ut.width??0,height:ut.height??0,origin:tt.nodeOrigin});return React$1.createElement(dt,{key:ut.id,id:ut.id,className:ut.className,style:ut.style,type:ht,data:ut.data,sourcePosition:ut.sourcePosition||Position.Bottom,targetPosition:ut.targetPosition||Position.Top,hidden:ut.hidden,xPos:wt,yPos:vt,xPosOrigin:xt.x,yPosOrigin:xt.y,selectNodesOnDrag:tt.selectNodesOnDrag,onClick:tt.onNodeClick,onMouseEnter:tt.onNodeMouseEnter,onMouseMove:tt.onNodeMouseMove,onMouseLeave:tt.onNodeMouseLeave,onContextMenu:tt.onNodeContextMenu,onDoubleClick:tt.onNodeDoubleClick,selected:!!ut.selected,isDraggable:pt,isSelectable:mt,isConnectable:gt,isFocusable:bt,resizeObserver:ct,dragHandle:ut.dragHandle,zIndex:((St=ut[internalsSymbol])==null?void 0:St.z)??0,isParent:!!((Et=ut[internalsSymbol])!=null&&Et.isParent),noDragClassName:tt.noDragClassName,noPanClassName:tt.noPanClassName,initialized:!!ut.width&&!!ut.height,rfId:tt.rfId,disableKeyboardA11y:tt.disableKeyboardA11y,ariaLabel:ut.ariaLabel})}))};NodeRenderer.displayName="NodeRenderer";var NodeRenderer$1=reactExports.memo(NodeRenderer);const shiftX=(tt,et,nt)=>nt===Position.Left?tt-et:nt===Position.Right?tt+et:tt,shiftY=(tt,et,nt)=>nt===Position.Top?tt-et:nt===Position.Bottom?tt+et:tt,EdgeUpdaterClassName="react-flow__edgeupdater",EdgeAnchor=({position:tt,centerX:et,centerY:nt,radius:it=10,onMouseDown:rt,onMouseEnter:ot,onMouseOut:at,type:st})=>React$1.createElement("circle",{onMouseDown:rt,onMouseEnter:ot,onMouseOut:at,className:cc([EdgeUpdaterClassName,`${EdgeUpdaterClassName}-${st}`]),cx:shiftX(et,it,tt),cy:shiftY(nt,it,tt),r:it,stroke:"transparent",fill:"transparent"}),alwaysValidConnection=()=>!0;var wrapEdge=tt=>{const et=({id:nt,className:it,type:rt,data:ot,onClick:at,onEdgeDoubleClick:st,selected:lt,animated:ct,label:ut,labelStyle:ht,labelShowBg:dt,labelBgStyle:pt,labelBgPadding:mt,labelBgBorderRadius:gt,style:bt,source:yt,target:wt,sourceX:vt,sourceY:xt,targetX:St,targetY:Et,sourcePosition:$t,targetPosition:It,elementsSelectable:Ft,hidden:Ht,sourceHandleId:zt,targetHandleId:Ot,onContextMenu:jt,onMouseEnter:kt,onMouseMove:Tt,onMouseLeave:Ct,edgeUpdaterRadius:Ut,onEdgeUpdate:Nt,onEdgeUpdateStart:Bt,onEdgeUpdateEnd:Mt,markerEnd:Dt,markerStart:Pt,rfId:Vt,ariaLabel:nn,isFocusable:cn,isUpdatable:Xt,pathOptions:un,interactionWidth:en})=>{const fn=reactExports.useRef(null),[xn,an]=reactExports.useState(!1),[Zt,En]=reactExports.useState(!1),In=useStoreApi(),Cn=reactExports.useMemo(()=>`url(#${getMarkerId(Pt,Vt)})`,[Pt,Vt]),Nn=reactExports.useMemo(()=>`url(#${getMarkerId(Dt,Vt)})`,[Dt,Vt]);if(Ht)return null;const Un=wn=>{var Gn;const{edges:Rn,addSelectedEdges:jn,unselectNodesAndEdges:Bn,multiSelectionActive:Xn}=In.getState(),Wn=Rn.find(Fn=>Fn.id===nt);Wn&&(Ft&&(In.setState({nodesSelectionActive:!1}),Wn.selected&&Xn?(Bn({nodes:[],edges:[Wn]}),(Gn=fn.current)==null||Gn.blur()):jn([nt])),at&&at(wn,Wn))},_n=getMouseHandler$1(nt,In.getState,st),An=getMouseHandler$1(nt,In.getState,jt),gn=getMouseHandler$1(nt,In.getState,kt),Tn=getMouseHandler$1(nt,In.getState,Tt),yn=getMouseHandler$1(nt,In.getState,Ct),dn=(wn,Rn)=>{if(wn.button!==0)return;const{edges:jn,isValidConnection:Bn}=In.getState(),Xn=Rn?wt:yt,Wn=(Rn?Ot:zt)||null,Gn=Rn?"target":"source",Fn=Bn||alwaysValidConnection,Jn=Rn,Vn=jn.find(_r=>_r.id===nt);En(!0),Bt==null||Bt(wn,Vn,Gn);const dr=_r=>{En(!1),Mt==null||Mt(_r,Vn,Gn)};handlePointerDown({event:wn,handleId:Wn,nodeId:Xn,onConnect:_r=>Nt==null?void 0:Nt(Vn,_r),isTarget:Jn,getState:In.getState,setState:In.setState,isValidConnection:Fn,edgeUpdaterType:Gn,onEdgeUpdateEnd:dr})},sn=wn=>dn(wn,!0),rn=wn=>dn(wn,!1),Sn=()=>an(!0),tn=()=>an(!1),qt=!Ft&&!at,Kt=wn=>{var Rn;if(elementSelectionKeys.includes(wn.key)&&Ft){const{unselectNodesAndEdges:jn,addSelectedEdges:Bn,edges:Xn}=In.getState();wn.key==="Escape"?((Rn=fn.current)==null||Rn.blur(),jn({edges:[Xn.find(Gn=>Gn.id===nt)]})):Bn([nt])}};return React$1.createElement("g",{className:cc(["react-flow__edge",`react-flow__edge-${rt}`,it,{selected:lt,animated:ct,inactive:qt,updating:xn}]),onClick:Un,onDoubleClick:_n,onContextMenu:An,onMouseEnter:gn,onMouseMove:Tn,onMouseLeave:yn,onKeyDown:cn?Kt:void 0,tabIndex:cn?0:void 0,role:cn?"button":"img","data-testid":`rf__edge-${nt}`,"aria-label":nn===null?void 0:nn||`Edge from ${yt} to ${wt}`,"aria-describedby":cn?`${ARIA_EDGE_DESC_KEY}-${Vt}`:void 0,ref:fn},!Zt&&React$1.createElement(tt,{id:nt,source:yt,target:wt,selected:lt,animated:ct,label:ut,labelStyle:ht,labelShowBg:dt,labelBgStyle:pt,labelBgPadding:mt,labelBgBorderRadius:gt,data:ot,style:bt,sourceX:vt,sourceY:xt,targetX:St,targetY:Et,sourcePosition:$t,targetPosition:It,sourceHandleId:zt,targetHandleId:Ot,markerStart:Cn,markerEnd:Nn,pathOptions:un,interactionWidth:en}),Xt&&React$1.createElement(React$1.Fragment,null,(Xt==="source"||Xt===!0)&&React$1.createElement(EdgeAnchor,{position:$t,centerX:vt,centerY:xt,radius:Ut,onMouseDown:sn,onMouseEnter:Sn,onMouseOut:tn,type:"source"}),(Xt==="target"||Xt===!0)&&React$1.createElement(EdgeAnchor,{position:It,centerX:St,centerY:Et,radius:Ut,onMouseDown:rn,onMouseEnter:Sn,onMouseOut:tn,type:"target"})))};return et.displayName="EdgeWrapper",reactExports.memo(et)};function createEdgeTypes(tt){const et={default:wrapEdge(tt.default||BezierEdge),straight:wrapEdge(tt.bezier||StraightEdge),step:wrapEdge(tt.step||StepEdge),smoothstep:wrapEdge(tt.step||SmoothStepEdge),simplebezier:wrapEdge(tt.simplebezier||SimpleBezierEdge)},nt={},it=Object.keys(tt).filter(rt=>!["default","bezier"].includes(rt)).reduce((rt,ot)=>(rt[ot]=wrapEdge(tt[ot]||BezierEdge),rt),nt);return{...et,...it}}function getHandlePosition(tt,et,nt=null){const it=((nt==null?void 0:nt.x)||0)+et.x,rt=((nt==null?void 0:nt.y)||0)+et.y,ot=(nt==null?void 0:nt.width)||et.width,at=(nt==null?void 0:nt.height)||et.height;switch(tt){case Position.Top:return{x:it+ot/2,y:rt};case Position.Right:return{x:it+ot,y:rt+at/2};case Position.Bottom:return{x:it+ot/2,y:rt+at};case Position.Left:return{x:it,y:rt+at/2}}}function getHandle(tt,et){return tt?tt.length===1||!et?tt[0]:et&&tt.find(nt=>nt.id===et)||null:null}const getEdgePositions=(tt,et,nt,it,rt,ot)=>{const at=getHandlePosition(nt,tt,et),st=getHandlePosition(ot,it,rt);return{sourceX:at.x,sourceY:at.y,targetX:st.x,targetY:st.y}};function isEdgeVisible({sourcePos:tt,targetPos:et,sourceWidth:nt,sourceHeight:it,targetWidth:rt,targetHeight:ot,width:at,height:st,transform:lt}){const ct={x:Math.min(tt.x,et.x),y:Math.min(tt.y,et.y),x2:Math.max(tt.x+nt,et.x+rt),y2:Math.max(tt.y+it,et.y+ot)};ct.x===ct.x2&&(ct.x2+=1),ct.y===ct.y2&&(ct.y2+=1);const ut=rectToBox({x:(0-lt[0])/lt[2],y:(0-lt[1])/lt[2],width:at/lt[2],height:st/lt[2]}),ht=Math.max(0,Math.min(ut.x2,ct.x2)-Math.max(ut.x,ct.x)),dt=Math.max(0,Math.min(ut.y2,ct.y2)-Math.max(ut.y,ct.y));return Math.ceil(ht*dt)>0}function getNodeData(tt){var it,rt,ot,at,st;const et=((it=tt==null?void 0:tt[internalsSymbol])==null?void 0:it.handleBounds)||null,nt=et&&(tt==null?void 0:tt.width)&&(tt==null?void 0:tt.height)&&typeof((rt=tt==null?void 0:tt.positionAbsolute)==null?void 0:rt.x)<"u"&&typeof((ot=tt==null?void 0:tt.positionAbsolute)==null?void 0:ot.y)<"u";return[{x:((at=tt==null?void 0:tt.positionAbsolute)==null?void 0:at.x)||0,y:((st=tt==null?void 0:tt.positionAbsolute)==null?void 0:st.y)||0,width:(tt==null?void 0:tt.width)||0,height:(tt==null?void 0:tt.height)||0},et,!!nt]}const defaultEdgeTree=[{level:0,isMaxLevel:!0,edges:[]}];function groupEdgesByZLevel(tt,et,nt=!1){let it=-1;const rt=tt.reduce((at,st)=>{var ut,ht;const lt=isNumeric(st.zIndex);let ct=lt?st.zIndex:0;if(nt){const dt=et.get(st.target),pt=et.get(st.source),mt=st.selected||(dt==null?void 0:dt.selected)||(pt==null?void 0:pt.selected),gt=Math.max(((ut=pt==null?void 0:pt[internalsSymbol])==null?void 0:ut.z)||0,((ht=dt==null?void 0:dt[internalsSymbol])==null?void 0:ht.z)||0,1e3);ct=(lt?st.zIndex:0)+(mt?gt:0)}return at[ct]?at[ct].push(st):at[ct]=[st],it=ct>it?ct:it,at},{}),ot=Object.entries(rt).map(([at,st])=>{const lt=+at;return{edges:st,level:lt,isMaxLevel:lt===it}});return ot.length===0?defaultEdgeTree:ot}function useVisibleEdges(tt,et,nt){const it=useStore(reactExports.useCallback(rt=>tt?rt.edges.filter(ot=>{const at=et.get(ot.source),st=et.get(ot.target);return(at==null?void 0:at.width)&&(at==null?void 0:at.height)&&(st==null?void 0:st.width)&&(st==null?void 0:st.height)&&isEdgeVisible({sourcePos:at.positionAbsolute||{x:0,y:0},targetPos:st.positionAbsolute||{x:0,y:0},sourceWidth:at.width,sourceHeight:at.height,targetWidth:st.width,targetHeight:st.height,width:rt.width,height:rt.height,transform:rt.transform})}):rt.edges,[tt,et]));return groupEdgesByZLevel(it,et,nt)}const ArrowSymbol=({color:tt="none",strokeWidth:et=1})=>React$1.createElement("polyline",{style:{stroke:tt,strokeWidth:et},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),ArrowClosedSymbol=({color:tt="none",strokeWidth:et=1})=>React$1.createElement("polyline",{style:{stroke:tt,fill:tt,strokeWidth:et},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),MarkerSymbols={[MarkerType.Arrow]:ArrowSymbol,[MarkerType.ArrowClosed]:ArrowClosedSymbol};function useMarkerSymbol(tt){const et=useStoreApi();return reactExports.useMemo(()=>{var rt,ot;return Object.prototype.hasOwnProperty.call(MarkerSymbols,tt)?MarkerSymbols[tt]:((ot=(rt=et.getState()).onError)==null||ot.call(rt,"009",errorMessages.error009(tt)),null)},[tt])}const Marker=({id:tt,type:et,color:nt,width:it=12.5,height:rt=12.5,markerUnits:ot="strokeWidth",strokeWidth:at,orient:st="auto-start-reverse"})=>{const lt=useMarkerSymbol(et);return lt?React$1.createElement("marker",{className:"react-flow__arrowhead",id:tt,markerWidth:`${it}`,markerHeight:`${rt}`,viewBox:"-10 -10 20 20",markerUnits:ot,orient:st,refX:"0",refY:"0"},React$1.createElement(lt,{color:nt,strokeWidth:at})):null},markerSelector=({defaultColor:tt,rfId:et})=>nt=>{const it=[];return nt.edges.reduce((rt,ot)=>([ot.markerStart,ot.markerEnd].forEach(at=>{if(at&&typeof at=="object"){const st=getMarkerId(at,et);it.includes(st)||(rt.push({id:st,color:at.color||tt,...at}),it.push(st))}}),rt),[]).sort((rt,ot)=>rt.id.localeCompare(ot.id))},MarkerDefinitions=({defaultColor:tt,rfId:et})=>{const nt=useStore(reactExports.useCallback(markerSelector({defaultColor:tt,rfId:et}),[tt,et]),(it,rt)=>!(it.length!==rt.length||it.some((ot,at)=>ot.id!==rt[at].id)));return React$1.createElement("defs",null,nt.map(it=>React$1.createElement(Marker,{id:it.id,key:it.id,type:it.type,color:it.color,width:it.width,height:it.height,markerUnits:it.markerUnits,strokeWidth:it.strokeWidth,orient:it.orient})))};MarkerDefinitions.displayName="MarkerDefinitions";var MarkerDefinitions$1=reactExports.memo(MarkerDefinitions);const selector$4=tt=>({nodesConnectable:tt.nodesConnectable,edgesFocusable:tt.edgesFocusable,edgesUpdatable:tt.edgesUpdatable,elementsSelectable:tt.elementsSelectable,width:tt.width,height:tt.height,connectionMode:tt.connectionMode,nodeInternals:tt.nodeInternals,onError:tt.onError}),EdgeRenderer=({defaultMarkerColor:tt,onlyRenderVisibleElements:et,elevateEdgesOnSelect:nt,rfId:it,edgeTypes:rt,noPanClassName:ot,onEdgeUpdate:at,onEdgeContextMenu:st,onEdgeMouseEnter:lt,onEdgeMouseMove:ct,onEdgeMouseLeave:ut,onEdgeClick:ht,edgeUpdaterRadius:dt,onEdgeDoubleClick:pt,onEdgeUpdateStart:mt,onEdgeUpdateEnd:gt,children:bt})=>{const{edgesFocusable:yt,edgesUpdatable:wt,elementsSelectable:vt,width:xt,height:St,connectionMode:Et,nodeInternals:$t,onError:It}=useStore(selector$4,shallow$1),Ft=useVisibleEdges(et,$t,nt);return xt?React$1.createElement(React$1.Fragment,null,Ft.map(({level:Ht,edges:zt,isMaxLevel:Ot})=>React$1.createElement("svg",{key:Ht,style:{zIndex:Ht},width:xt,height:St,className:"react-flow__edges react-flow__container"},Ot&&React$1.createElement(MarkerDefinitions$1,{defaultColor:tt,rfId:it}),React$1.createElement("g",null,zt.map(jt=>{const[kt,Tt,Ct]=getNodeData($t.get(jt.source)),[Ut,Nt,Bt]=getNodeData($t.get(jt.target));if(!Ct||!Bt)return null;let Mt=jt.type||"default";rt[Mt]||(It==null||It("011",errorMessages.error011(Mt)),Mt="default");const Dt=rt[Mt]||rt.default,Pt=Et===ConnectionMode.Strict?Nt.target:(Nt.target??[]).concat(Nt.source??[]),Vt=getHandle(Tt.source,jt.sourceHandle),nn=getHandle(Pt,jt.targetHandle),cn=(Vt==null?void 0:Vt.position)||Position.Bottom,Xt=(nn==null?void 0:nn.position)||Position.Top,un=!!(jt.focusable||yt&&typeof jt.focusable>"u"),en=typeof at<"u"&&(jt.updatable||wt&&typeof jt.updatable>"u");if(!Vt||!nn)return It==null||It("008",errorMessages.error008(Vt,jt)),null;const{sourceX:fn,sourceY:xn,targetX:an,targetY:Zt}=getEdgePositions(kt,Vt,cn,Ut,nn,Xt);return React$1.createElement(Dt,{key:jt.id,id:jt.id,className:cc([jt.className,ot]),type:Mt,data:jt.data,selected:!!jt.selected,animated:!!jt.animated,hidden:!!jt.hidden,label:jt.label,labelStyle:jt.labelStyle,labelShowBg:jt.labelShowBg,labelBgStyle:jt.labelBgStyle,labelBgPadding:jt.labelBgPadding,labelBgBorderRadius:jt.labelBgBorderRadius,style:jt.style,source:jt.source,target:jt.target,sourceHandleId:jt.sourceHandle,targetHandleId:jt.targetHandle,markerEnd:jt.markerEnd,markerStart:jt.markerStart,sourceX:fn,sourceY:xn,targetX:an,targetY:Zt,sourcePosition:cn,targetPosition:Xt,elementsSelectable:vt,onEdgeUpdate:at,onContextMenu:st,onMouseEnter:lt,onMouseMove:ct,onMouseLeave:ut,onClick:ht,edgeUpdaterRadius:dt,onEdgeDoubleClick:pt,onEdgeUpdateStart:mt,onEdgeUpdateEnd:gt,rfId:it,ariaLabel:jt.ariaLabel,isFocusable:un,isUpdatable:en,pathOptions:"pathOptions"in jt?jt.pathOptions:void 0,interactionWidth:jt.interactionWidth})})))),bt):null};EdgeRenderer.displayName="EdgeRenderer";var EdgeRenderer$1=reactExports.memo(EdgeRenderer);const selector$3=tt=>`translate(${tt.transform[0]}px,${tt.transform[1]}px) scale(${tt.transform[2]})`;function Viewport({children:tt}){const et=useStore(selector$3);return React$1.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:et}},tt)}function useOnInitHandler(tt){const et=useReactFlow(),nt=reactExports.useRef(!1);reactExports.useEffect(()=>{!nt.current&&et.viewportInitialized&&tt&&(setTimeout(()=>tt(et),1),nt.current=!0)},[tt,et.viewportInitialized])}const oppositePosition={[Position.Left]:Position.Right,[Position.Right]:Position.Left,[Position.Top]:Position.Bottom,[Position.Bottom]:Position.Top},ConnectionLine=({nodeId:tt,handleType:et,style:nt,type:it=ConnectionLineType.Bezier,CustomComponent:rt,connectionStatus:ot})=>{var Et,$t,It;const{fromNode:at,handleId:st,toX:lt,toY:ct,connectionMode:ut}=useStore(reactExports.useCallback(Ft=>({fromNode:Ft.nodeInternals.get(tt),handleId:Ft.connectionHandleId,toX:(Ft.connectionPosition.x-Ft.transform[0])/Ft.transform[2],toY:(Ft.connectionPosition.y-Ft.transform[1])/Ft.transform[2],connectionMode:Ft.connectionMode}),[tt]),shallow$1),ht=(Et=at==null?void 0:at[internalsSymbol])==null?void 0:Et.handleBounds;let dt=ht==null?void 0:ht[et];if(ut===ConnectionMode.Loose&&(dt=dt||(ht==null?void 0:ht[et==="source"?"target":"source"])),!at||!dt)return null;const pt=st?dt.find(Ft=>Ft.id===st):dt[0],mt=pt?pt.x+pt.width/2:(at.width??0)/2,gt=pt?pt.y+pt.height/2:at.height??0,bt=((($t=at.positionAbsolute)==null?void 0:$t.x)??0)+mt,yt=(((It=at.positionAbsolute)==null?void 0:It.y)??0)+gt,wt=pt==null?void 0:pt.position,vt=wt?oppositePosition[wt]:null;if(!wt||!vt)return null;if(rt)return React$1.createElement(rt,{connectionLineType:it,connectionLineStyle:nt,fromNode:at,fromHandle:pt,fromX:bt,fromY:yt,toX:lt,toY:ct,fromPosition:wt,toPosition:vt,connectionStatus:ot});let xt="";const St={sourceX:bt,sourceY:yt,sourcePosition:wt,targetX:lt,targetY:ct,targetPosition:vt};return it===ConnectionLineType.Bezier?[xt]=getBezierPath(St):it===ConnectionLineType.Step?[xt]=getSmoothStepPath({...St,borderRadius:0}):it===ConnectionLineType.SmoothStep?[xt]=getSmoothStepPath(St):it===ConnectionLineType.SimpleBezier?[xt]=getSimpleBezierPath(St):xt=`M${bt},${yt} ${lt},${ct}`,React$1.createElement("path",{d:xt,fill:"none",className:"react-flow__connection-path",style:nt})};ConnectionLine.displayName="ConnectionLine";const selector$2=tt=>({nodeId:tt.connectionNodeId,handleType:tt.connectionHandleType,nodesConnectable:tt.nodesConnectable,connectionStatus:tt.connectionStatus,width:tt.width,height:tt.height});function ConnectionLineWrapper({containerStyle:tt,style:et,type:nt,component:it}){const{nodeId:rt,handleType:ot,nodesConnectable:at,width:st,height:lt,connectionStatus:ct}=useStore(selector$2,shallow$1);return!(rt&&ot&&st&&at)?null:React$1.createElement("svg",{style:tt,width:st,height:lt,className:"react-flow__edges react-flow__connectionline react-flow__container"},React$1.createElement("g",{className:cc(["react-flow__connection",ct])},React$1.createElement(ConnectionLine,{nodeId:rt,handleType:ot,style:et,type:nt,CustomComponent:it,connectionStatus:ct})))}function useNodeOrEdgeTypes(tt,et){return reactExports.useRef(null),useStoreApi(),reactExports.useMemo(()=>et(tt),[tt])}const GraphView=({nodeTypes:tt,edgeTypes:et,onMove:nt,onMoveStart:it,onMoveEnd:rt,onInit:ot,onNodeClick:at,onEdgeClick:st,onNodeDoubleClick:lt,onEdgeDoubleClick:ct,onNodeMouseEnter:ut,onNodeMouseMove:ht,onNodeMouseLeave:dt,onNodeContextMenu:pt,onSelectionContextMenu:mt,onSelectionStart:gt,onSelectionEnd:bt,connectionLineType:yt,connectionLineStyle:wt,connectionLineComponent:vt,connectionLineContainerStyle:xt,selectionKeyCode:St,selectionOnDrag:Et,selectionMode:$t,multiSelectionKeyCode:It,panActivationKeyCode:Ft,zoomActivationKeyCode:Ht,deleteKeyCode:zt,onlyRenderVisibleElements:Ot,elementsSelectable:jt,selectNodesOnDrag:kt,defaultViewport:Tt,translateExtent:Ct,minZoom:Ut,maxZoom:Nt,preventScrolling:Bt,defaultMarkerColor:Mt,zoomOnScroll:Dt,zoomOnPinch:Pt,panOnScroll:Vt,panOnScrollSpeed:nn,panOnScrollMode:cn,zoomOnDoubleClick:Xt,panOnDrag:un,onPaneClick:en,onPaneMouseEnter:fn,onPaneMouseMove:xn,onPaneMouseLeave:an,onPaneScroll:Zt,onPaneContextMenu:En,onEdgeUpdate:In,onEdgeContextMenu:Cn,onEdgeMouseEnter:Nn,onEdgeMouseMove:Un,onEdgeMouseLeave:_n,edgeUpdaterRadius:An,onEdgeUpdateStart:gn,onEdgeUpdateEnd:Tn,noDragClassName:yn,noWheelClassName:dn,noPanClassName:sn,elevateEdgesOnSelect:rn,disableKeyboardA11y:Sn,nodeOrigin:tn,nodeExtent:qt,rfId:Kt})=>{const wn=useNodeOrEdgeTypes(tt,createNodeTypes),Rn=useNodeOrEdgeTypes(et,createEdgeTypes);return useOnInitHandler(ot),React$1.createElement(FlowRenderer$1,{onPaneClick:en,onPaneMouseEnter:fn,onPaneMouseMove:xn,onPaneMouseLeave:an,onPaneContextMenu:En,onPaneScroll:Zt,deleteKeyCode:zt,selectionKeyCode:St,selectionOnDrag:Et,selectionMode:$t,onSelectionStart:gt,onSelectionEnd:bt,multiSelectionKeyCode:It,panActivationKeyCode:Ft,zoomActivationKeyCode:Ht,elementsSelectable:jt,onMove:nt,onMoveStart:it,onMoveEnd:rt,zoomOnScroll:Dt,zoomOnPinch:Pt,zoomOnDoubleClick:Xt,panOnScroll:Vt,panOnScrollSpeed:nn,panOnScrollMode:cn,panOnDrag:un,defaultViewport:Tt,translateExtent:Ct,minZoom:Ut,maxZoom:Nt,onSelectionContextMenu:mt,preventScrolling:Bt,noDragClassName:yn,noWheelClassName:dn,noPanClassName:sn,disableKeyboardA11y:Sn},React$1.createElement(Viewport,null,React$1.createElement(EdgeRenderer$1,{edgeTypes:Rn,onEdgeClick:st,onEdgeDoubleClick:ct,onEdgeUpdate:In,onlyRenderVisibleElements:Ot,onEdgeContextMenu:Cn,onEdgeMouseEnter:Nn,onEdgeMouseMove:Un,onEdgeMouseLeave:_n,onEdgeUpdateStart:gn,onEdgeUpdateEnd:Tn,edgeUpdaterRadius:An,defaultMarkerColor:Mt,noPanClassName:sn,elevateEdgesOnSelect:!!rn,disableKeyboardA11y:Sn,rfId:Kt},React$1.createElement(ConnectionLineWrapper,{style:wt,type:yt,component:vt,containerStyle:xt})),React$1.createElement("div",{className:"react-flow__edgelabel-renderer"}),React$1.createElement(NodeRenderer$1,{nodeTypes:wn,onNodeClick:at,onNodeDoubleClick:lt,onNodeMouseEnter:ut,onNodeMouseMove:ht,onNodeMouseLeave:dt,onNodeContextMenu:pt,selectNodesOnDrag:kt,onlyRenderVisibleElements:Ot,noPanClassName:sn,noDragClassName:yn,disableKeyboardA11y:Sn,nodeOrigin:tn,nodeExtent:qt,rfId:Kt})))};GraphView.displayName="GraphView";var GraphView$1=reactExports.memo(GraphView);const infiniteExtent=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],initialState={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:infiniteExtent,nodeExtent:infiniteExtent,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ConnectionMode.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:devWarn,isValidConnection:void 0},createRFStore=()=>createWithEqualityFn((tt,et)=>({...initialState,setNodes:nt=>{const{nodeInternals:it,nodeOrigin:rt,elevateNodesOnSelect:ot}=et();tt({nodeInternals:createNodeInternals(nt,it,rt,ot)})},getNodes:()=>Array.from(et().nodeInternals.values()),setEdges:nt=>{const{defaultEdgeOptions:it={}}=et();tt({edges:nt.map(rt=>({...it,...rt}))})},setDefaultNodesAndEdges:(nt,it)=>{const rt=typeof nt<"u",ot=typeof it<"u",at=rt?createNodeInternals(nt,new Map,et().nodeOrigin,et().elevateNodesOnSelect):new Map;tt({nodeInternals:at,edges:ot?it:[],hasDefaultNodes:rt,hasDefaultEdges:ot})},updateNodeDimensions:nt=>{const{onNodesChange:it,nodeInternals:rt,fitViewOnInit:ot,fitViewOnInitDone:at,fitViewOnInitOptions:st,domNode:lt,nodeOrigin:ct}=et(),ut=lt==null?void 0:lt.querySelector(".react-flow__viewport");if(!ut)return;const ht=window.getComputedStyle(ut),{m22:dt}=new window.DOMMatrixReadOnly(ht.transform),pt=nt.reduce((gt,bt)=>{const yt=rt.get(bt.id);if(yt){const wt=getDimensions(bt.nodeElement);!!(wt.width&&wt.height&&(yt.width!==wt.width||yt.height!==wt.height||bt.forceUpdate))&&(rt.set(yt.id,{...yt,[internalsSymbol]:{...yt[internalsSymbol],handleBounds:{source:getHandleBounds(".source",bt.nodeElement,dt,ct),target:getHandleBounds(".target",bt.nodeElement,dt,ct)}},...wt}),gt.push({id:yt.id,type:"dimensions",dimensions:wt}))}return gt},[]);updateAbsoluteNodePositions(rt,ct);const mt=at||ot&&!at&&fitView(et,{initial:!0,...st});tt({nodeInternals:new Map(rt),fitViewOnInitDone:mt}),(pt==null?void 0:pt.length)>0&&(it==null||it(pt))},updateNodePositions:(nt,it=!0,rt=!1)=>{const{triggerNodeChanges:ot}=et(),at=nt.map(st=>{const lt={id:st.id,type:"position",dragging:rt};return it&&(lt.positionAbsolute=st.positionAbsolute,lt.position=st.position),lt});ot(at)},triggerNodeChanges:nt=>{const{onNodesChange:it,nodeInternals:rt,hasDefaultNodes:ot,nodeOrigin:at,getNodes:st,elevateNodesOnSelect:lt}=et();if(nt!=null&&nt.length){if(ot){const ct=applyNodeChanges(nt,st()),ut=createNodeInternals(ct,rt,at,lt);tt({nodeInternals:ut})}it==null||it(nt)}},addSelectedNodes:nt=>{const{multiSelectionActive:it,edges:rt,getNodes:ot}=et();let at,st=null;it?at=nt.map(lt=>createSelectionChange(lt,!0)):(at=getSelectionChanges(ot(),nt),st=getSelectionChanges(rt,[])),updateNodesAndEdgesSelections({changedNodes:at,changedEdges:st,get:et,set:tt})},addSelectedEdges:nt=>{const{multiSelectionActive:it,edges:rt,getNodes:ot}=et();let at,st=null;it?at=nt.map(lt=>createSelectionChange(lt,!0)):(at=getSelectionChanges(rt,nt),st=getSelectionChanges(ot(),[])),updateNodesAndEdgesSelections({changedNodes:st,changedEdges:at,get:et,set:tt})},unselectNodesAndEdges:({nodes:nt,edges:it}={})=>{const{edges:rt,getNodes:ot}=et(),at=nt||ot(),st=it||rt,lt=at.map(ut=>(ut.selected=!1,createSelectionChange(ut.id,!1))),ct=st.map(ut=>createSelectionChange(ut.id,!1));updateNodesAndEdgesSelections({changedNodes:lt,changedEdges:ct,get:et,set:tt})},setMinZoom:nt=>{const{d3Zoom:it,maxZoom:rt}=et();it==null||it.scaleExtent([nt,rt]),tt({minZoom:nt})},setMaxZoom:nt=>{const{d3Zoom:it,minZoom:rt}=et();it==null||it.scaleExtent([rt,nt]),tt({maxZoom:nt})},setTranslateExtent:nt=>{var it;(it=et().d3Zoom)==null||it.translateExtent(nt),tt({translateExtent:nt})},resetSelectedElements:()=>{const{edges:nt,getNodes:it}=et(),ot=it().filter(st=>st.selected).map(st=>createSelectionChange(st.id,!1)),at=nt.filter(st=>st.selected).map(st=>createSelectionChange(st.id,!1));updateNodesAndEdgesSelections({changedNodes:ot,changedEdges:at,get:et,set:tt})},setNodeExtent:nt=>{const{nodeInternals:it}=et();it.forEach(rt=>{rt.positionAbsolute=clampPosition(rt.position,nt)}),tt({nodeExtent:nt,nodeInternals:new Map(it)})},panBy:nt=>{const{transform:it,width:rt,height:ot,d3Zoom:at,d3Selection:st,translateExtent:lt}=et();if(!at||!st||!nt.x&&!nt.y)return!1;const ct=identity.translate(it[0]+nt.x,it[1]+nt.y).scale(it[2]),ut=[[0,0],[rt,ot]],ht=at==null?void 0:at.constrain()(ct,ut,lt);return at.transform(st,ht),it[0]!==ht.x||it[1]!==ht.y||it[2]!==ht.k},cancelConnection:()=>tt({connectionNodeId:initialState.connectionNodeId,connectionHandleId:initialState.connectionHandleId,connectionHandleType:initialState.connectionHandleType,connectionStatus:initialState.connectionStatus,connectionStartHandle:initialState.connectionStartHandle,connectionEndHandle:initialState.connectionEndHandle}),reset:()=>tt({...initialState})}),Object.is),ReactFlowProvider=({children:tt})=>{const et=reactExports.useRef(null);return et.current||(et.current=createRFStore()),React$1.createElement(Provider$1,{value:et.current},tt)};ReactFlowProvider.displayName="ReactFlowProvider";const Wrapper$9=({children:tt})=>reactExports.useContext(StoreContext)?React$1.createElement(React$1.Fragment,null,tt):React$1.createElement(ReactFlowProvider,null,tt);Wrapper$9.displayName="ReactFlowWrapper";const defaultNodeTypes={input:InputNode$1,default:DefaultNode$1,output:OutputNode$1,group:GroupNode},defaultEdgeTypes={default:BezierEdge,straight:StraightEdge,step:StepEdge,smoothstep:SmoothStepEdge,simplebezier:SimpleBezierEdge},initNodeOrigin=[0,0],initSnapGrid=[15,15],initDefaultViewport={x:0,y:0,zoom:1},wrapperStyle={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ReactFlow=reactExports.forwardRef(({nodes:tt,edges:et,defaultNodes:nt,defaultEdges:it,className:rt,nodeTypes:ot=defaultNodeTypes,edgeTypes:at=defaultEdgeTypes,onNodeClick:st,onEdgeClick:lt,onInit:ct,onMove:ut,onMoveStart:ht,onMoveEnd:dt,onConnect:pt,onConnectStart:mt,onConnectEnd:gt,onClickConnectStart:bt,onClickConnectEnd:yt,onNodeMouseEnter:wt,onNodeMouseMove:vt,onNodeMouseLeave:xt,onNodeContextMenu:St,onNodeDoubleClick:Et,onNodeDragStart:$t,onNodeDrag:It,onNodeDragStop:Ft,onNodesDelete:Ht,onEdgesDelete:zt,onSelectionChange:Ot,onSelectionDragStart:jt,onSelectionDrag:kt,onSelectionDragStop:Tt,onSelectionContextMenu:Ct,onSelectionStart:Ut,onSelectionEnd:Nt,connectionMode:Bt=ConnectionMode.Strict,connectionLineType:Mt=ConnectionLineType.Bezier,connectionLineStyle:Dt,connectionLineComponent:Pt,connectionLineContainerStyle:Vt,deleteKeyCode:nn="Backspace",selectionKeyCode:cn="Shift",selectionOnDrag:Xt=!1,selectionMode:un=SelectionMode.Full,panActivationKeyCode:en="Space",multiSelectionKeyCode:fn=isMacOs()?"Meta":"Control",zoomActivationKeyCode:xn=isMacOs()?"Meta":"Control",snapToGrid:an=!1,snapGrid:Zt=initSnapGrid,onlyRenderVisibleElements:En=!1,selectNodesOnDrag:In=!0,nodesDraggable:Cn,nodesConnectable:Nn,nodesFocusable:Un,nodeOrigin:_n=initNodeOrigin,edgesFocusable:An,edgesUpdatable:gn,elementsSelectable:Tn,defaultViewport:yn=initDefaultViewport,minZoom:dn=.5,maxZoom:sn=2,translateExtent:rn=infiniteExtent,preventScrolling:Sn=!0,nodeExtent:tn,defaultMarkerColor:qt="#b1b1b7",zoomOnScroll:Kt=!0,zoomOnPinch:wn=!0,panOnScroll:Rn=!1,panOnScrollSpeed:jn=.5,panOnScrollMode:Bn=PanOnScrollMode.Free,zoomOnDoubleClick:Xn=!0,panOnDrag:Wn=!0,onPaneClick:Gn,onPaneMouseEnter:Fn,onPaneMouseMove:Jn,onPaneMouseLeave:Vn,onPaneScroll:dr,onPaneContextMenu:ur,children:_r,onEdgeUpdate:Qr,onEdgeContextMenu:Or,onEdgeDoubleClick:Mr,onEdgeMouseEnter:qr,onEdgeMouseMove:Ur,onEdgeMouseLeave:Lr,onEdgeUpdateStart:ao,onEdgeUpdateEnd:Gr,edgeUpdaterRadius:Br=10,onNodesChange:go,onEdgesChange:vn,noDragClassName:Pn="nodrag",noWheelClassName:hn="nowheel",noPanClassName:Jt="nopan",fitView:kn=!1,fitViewOptions:On,connectOnClick:Dn=!0,attributionPosition:Yn,proOptions:er,defaultEdgeOptions:or,elevateNodesOnSelect:ar=!0,elevateEdgesOnSelect:Vr=!1,disableKeyboardA11y:wr=!1,autoPanOnConnect:jr=!0,autoPanOnNodeDrag:Hr=!0,connectionRadius:no=20,isValidConnection:Xr,onError:Jr,style:br,id:$r,nodeDragThreshold:Dr,...Cr},Ar)=>{const Nr=$r||"1";return React$1.createElement("div",{...Cr,style:{...br,...wrapperStyle},ref:Ar,className:cc(["react-flow",rt]),"data-testid":"rf__wrapper",id:$r},React$1.createElement(Wrapper$9,null,React$1.createElement(GraphView$1,{onInit:ct,onMove:ut,onMoveStart:ht,onMoveEnd:dt,onNodeClick:st,onEdgeClick:lt,onNodeMouseEnter:wt,onNodeMouseMove:vt,onNodeMouseLeave:xt,onNodeContextMenu:St,onNodeDoubleClick:Et,nodeTypes:ot,edgeTypes:at,connectionLineType:Mt,connectionLineStyle:Dt,connectionLineComponent:Pt,connectionLineContainerStyle:Vt,selectionKeyCode:cn,selectionOnDrag:Xt,selectionMode:un,deleteKeyCode:nn,multiSelectionKeyCode:fn,panActivationKeyCode:en,zoomActivationKeyCode:xn,onlyRenderVisibleElements:En,selectNodesOnDrag:In,defaultViewport:yn,translateExtent:rn,minZoom:dn,maxZoom:sn,preventScrolling:Sn,zoomOnScroll:Kt,zoomOnPinch:wn,zoomOnDoubleClick:Xn,panOnScroll:Rn,panOnScrollSpeed:jn,panOnScrollMode:Bn,panOnDrag:Wn,onPaneClick:Gn,onPaneMouseEnter:Fn,onPaneMouseMove:Jn,onPaneMouseLeave:Vn,onPaneScroll:dr,onPaneContextMenu:ur,onSelectionContextMenu:Ct,onSelectionStart:Ut,onSelectionEnd:Nt,onEdgeUpdate:Qr,onEdgeContextMenu:Or,onEdgeDoubleClick:Mr,onEdgeMouseEnter:qr,onEdgeMouseMove:Ur,onEdgeMouseLeave:Lr,onEdgeUpdateStart:ao,onEdgeUpdateEnd:Gr,edgeUpdaterRadius:Br,defaultMarkerColor:qt,noDragClassName:Pn,noWheelClassName:hn,noPanClassName:Jt,elevateEdgesOnSelect:Vr,rfId:Nr,disableKeyboardA11y:wr,nodeOrigin:_n,nodeExtent:tn}),React$1.createElement(StoreUpdater,{nodes:tt,edges:et,defaultNodes:nt,defaultEdges:it,onConnect:pt,onConnectStart:mt,onConnectEnd:gt,onClickConnectStart:bt,onClickConnectEnd:yt,nodesDraggable:Cn,nodesConnectable:Nn,nodesFocusable:Un,edgesFocusable:An,edgesUpdatable:gn,elementsSelectable:Tn,elevateNodesOnSelect:ar,minZoom:dn,maxZoom:sn,nodeExtent:tn,onNodesChange:go,onEdgesChange:vn,snapToGrid:an,snapGrid:Zt,connectionMode:Bt,translateExtent:rn,connectOnClick:Dn,defaultEdgeOptions:or,fitView:kn,fitViewOptions:On,onNodesDelete:Ht,onEdgesDelete:zt,onNodeDragStart:$t,onNodeDrag:It,onNodeDragStop:Ft,onSelectionDrag:kt,onSelectionDragStart:jt,onSelectionDragStop:Tt,noPanClassName:Jt,nodeOrigin:_n,rfId:Nr,autoPanOnConnect:jr,autoPanOnNodeDrag:Hr,onError:Jr,connectionRadius:no,isValidConnection:Xr,nodeDragThreshold:Dr}),React$1.createElement(Wrapper$1$1,{onSelectionChange:Ot}),_r,React$1.createElement(Attribution,{proOptions:er,position:Yn}),React$1.createElement(A11yDescriptions,{rfId:Nr,disableKeyboardA11y:wr})))});ReactFlow.displayName="ReactFlow";const ITEM_HEIGHT=48,ITEM_PADDING_TOP=8,MenuProps={PaperProps:{style:{maxHeight:ITEM_HEIGHT*4.5+ITEM_PADDING_TOP,width:250}}},names=["Beginner","Intermediate","Advanced","Expert"],AskQuestion=()=>{const tt=useDataStore(vt=>vt.data),[et,nt]=reactExports.useState(""),[it,rt]=reactExports.useState("Beginner"),ot=useAppStore(vt=>vt.currentSearch),at=reactExports.useRef(!1),st=useSocket(),[lt]=useUserStore(vt=>[vt.setBudget]),[ct,ut,ht,dt,pt]=useTeachStore(vt=>[vt.askedQuestions,vt.askedQuestionsAnswers,vt.setAskedQuestion,vt.setAskedQuestionAnswer,vt.hasQuestionInProgress]),mt=reactExports.useCallback(vt=>{dt(vt.answer),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"Response is ready"}),{position:toast.POSITION.BOTTOM_CENTER,type:"success"})},[dt]);reactExports.useEffect(()=>{at.current||mt&&st&&(st.on("askquestionhook",mt),at.current=!0)},[mt,st]);const gt=async()=>{et&&(ht(et),nt(""));try{const vt=tt==null?void 0:tt.nodes.filter(Et=>Et.text),xt=vt==null?void 0:vt.slice(0,5),St=(xt!=null&&xt.length?xt.map(Et=>Et.text).join(" "):"").substring(0,2500).replace(/[?&=+/#]/g,Et=>`\\${Et}`);ot&&(await distExports$1.enable(),await postAskQuestion({expertise_level:it,question_text:et,search_term:ot,transcripts:St}),await updateBudget(lt),toast(jsxRuntimeExports.jsx(ToastMessage,{message:"We started preparing response for you"}),{type:"success"}))}catch(vt){console.error(vt)}},bt=it&&et.trim()&&!pt,yt=vt=>{rt(vt.target.value)},wt=async vt=>{if(pt){vt.preventDefault();return}vt.keyCode===13&&vt.shiftKey===!1&&bt&&(vt.preventDefault(),gt())};return jsxRuntimeExports.jsxs(AskQuestionContainer,{children:[jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsxs(FormControl$1,{component:"div",children:[jsxRuntimeExports.jsx(StyledInput,{id:"select-label",size:"small",children:"Expertise level"}),jsxRuntimeExports.jsx(StyledSelect,{id:"demo-multiple-name",input:jsxRuntimeExports.jsx(OutlinedInput$1,{label:"Expertise level"}),labelId:"select-label",MenuProps,onChange:yt,size:"small",value:it,children:names.map(vt=>jsxRuntimeExports.jsx(MenuItem$6,{component:"li",value:vt,children:vt},vt))})]})})}),jsxRuntimeExports.jsx(ResponsesWrapper,{children:ct==null?void 0:ct.map((vt,xt)=>jsxRuntimeExports.jsxs(Flex,{className:"response",py:12,children:[jsxRuntimeExports.jsx(Text$4,{kind:"medium",children:vt}),jsxRuntimeExports.jsx(Flex,{py:12,children:(ut==null?void 0:ut[xt])!==void 0?jsxRuntimeExports.jsx(Text$4,{color:"unreadMsgText",children:ut[xt]}):jsxRuntimeExports.jsxs(Flex,{align:"center",py:12,children:[jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(PropagateLoader,{color:colors.white})}),jsxRuntimeExports.jsx(Flex,{align:"center",py:12,children:jsxRuntimeExports.jsx(Text$4,{children:"Generating response"})})]})})]},vt))}),jsxRuntimeExports.jsxs(TextAreaWrapper,{onKeyDown:wt,py:12,tabIndex:-1,children:[jsxRuntimeExports.jsx(StyledTextarea,{disabled:pt,onChange:vt=>nt(vt.target.value),placeholder:"Enter your question",value:et}),jsxRuntimeExports.jsx(IconWrapper,{children:jsxRuntimeExports.jsx(MdSend,{color:bt?colors.white:colors.gray300,size:"18"})})]})]})},AskQuestionContainer=styled$4.div` margin-top: 20px; `,StyledTextarea=styled$4(TextareaAutosize)` background: ${colors.inputBg1}; @@ -6982,7 +6982,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho @keyframes `.concat(it,` { `).concat(et,` } - `);return ot&&ot.insertRule(at,0),it};animation.createAnimation=createAnimation;var __assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(tt){for(var et,nt=1,it=arguments.length;nttt&&Ae` background: ${({selected:tt})=>tt?colors.gray300:colors.gray200}; } } -`,notify=tt=>{toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:tt===BOOST_SUCCESS?"success":"error"})},Booster=({count:tt=0,updateCount:et,content:nt,readOnly:it,refId:rt})=>{const[ot,at]=reactExports.useState(!1),[st,lt]=reactExports.useState(!1);reactExports.useEffect(()=>{lt(!1),at(!1)},[rt]);let{image_url:ct}=nt||{};ct&&(ct=ct.replace(".jpg","_l.jpg"));const ut=5;async function ht(){if(!(ot||!rt)){at(!0);try{await boost(rt,ut),lt(!0),notify(BOOST_SUCCESS),et&&et(tt+ut)}catch{notify(BOOST_ERROR_BUDGET)}at(!1)}}return it?tt?jsxRuntimeExports.jsx(Pill,{className:"booster__pill",style:{padding:"1px 8px 1px 3px",width:"fit-content"},children:jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"center",children:[jsxRuntimeExports.jsx(MdBolt,{fontSize:12}),jsxRuntimeExports.jsx("div",{style:{fontSize:10},children:tt||0})]})}):null:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Pill,{disabled:ot,onClick:async()=>{st||ot||await ht()},style:{padding:"4px 8px",borderWidth:0,backgroundColor:"#303342",height:"25px",width:"fit-content"},children:ot?jsxRuntimeExports.jsx(_default,{color:"#fff",loading:!0,size:10}):jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"space-around",children:[jsxRuntimeExports.jsx(BoostIcon,{style:{color:colors.white}}),jsxRuntimeExports.jsx("div",{style:{marginLeft:8,marginRight:8},children:"Boost"})]})})})},NotesIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"notes",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1473_73722",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1473_73722)",children:jsxRuntimeExports.jsx("path",{id:"notes_2",d:"M2.83337 11.7564C2.69171 11.7564 2.57296 11.7085 2.47712 11.6126C2.38129 11.5167 2.33337 11.3979 2.33337 11.2562C2.33337 11.1144 2.38129 10.9957 2.47712 10.9C2.57296 10.8043 2.69171 10.7564 2.83337 10.7564H9.16668C9.30834 10.7564 9.42709 10.8043 9.52293 10.9002C9.61876 10.9961 9.66668 11.1149 9.66668 11.2566C9.66668 11.3983 9.61876 11.5171 9.52293 11.6128C9.42709 11.7085 9.30834 11.7564 9.16668 11.7564H2.83337ZM2.83337 8.49997C2.69171 8.49997 2.57296 8.45204 2.47712 8.35617C2.38129 8.2603 2.33337 8.1415 2.33337 7.99977C2.33337 7.85804 2.38129 7.73931 2.47712 7.64359C2.57296 7.54787 2.69171 7.50001 2.83337 7.50001H13.1667C13.3083 7.50001 13.4271 7.54794 13.5229 7.64381C13.6188 7.73969 13.6667 7.85849 13.6667 8.00021C13.6667 8.14194 13.6188 8.26067 13.5229 8.35639C13.4271 8.45211 13.3083 8.49997 13.1667 8.49997H2.83337ZM2.83337 5.24357C2.69171 5.24357 2.57296 5.19564 2.47712 5.09976C2.38129 5.00389 2.33337 4.88509 2.33337 4.74336C2.33337 4.60164 2.38129 4.48291 2.47712 4.38719C2.57296 4.29146 2.69171 4.24359 2.83337 4.24359H13.1667C13.3083 4.24359 13.4271 4.29153 13.5229 4.38741C13.6188 4.48329 13.6667 4.60209 13.6667 4.74381C13.6667 4.88554 13.6188 5.00427 13.5229 5.09999C13.4271 5.19571 13.3083 5.24357 13.1667 5.24357H2.83337Z",fill:"currentColor"})})]})}),Description=({stateless:tt,node:et})=>jsxRuntimeExports.jsxs(Flex,{grow:1,shrink:1,children:[jsxRuntimeExports.jsx(Header$2,{children:tt&&jsxRuntimeExports.jsxs(Heading$1,{children:[jsxRuntimeExports.jsx("div",{className:"icon",children:jsxRuntimeExports.jsx(NotesIcon,{})}),jsxRuntimeExports.jsx("div",{className:"title",children:"Description"})]})}),jsxRuntimeExports.jsx(Box$1,{children:et!=null&&et.description?`"${et==null?void 0:et.description}"`:"..."})]}),Heading$1=styled$4(Flex).attrs({direction:"row",align:"center"})` +`,notify=tt=>{toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:tt===BOOST_SUCCESS?"success":"error"})},Booster=({count:tt=0,updateCount:et,content:nt,readOnly:it,refId:rt})=>{const[ot,at]=reactExports.useState(!1),[st,lt]=reactExports.useState(!1);reactExports.useEffect(()=>{lt(!1),at(!1)},[rt]);let{image_url:ct}=nt||{};ct&&(ct=ct.replace(".jpg","_l.jpg"));const ut=5;async function ht(){if(!(ot||!rt)){at(!0);try{await boost(rt,ut),lt(!0),notify(BOOST_SUCCESS),et&&et(tt+ut)}catch{notify(BOOST_ERROR_BUDGET)}at(!1)}}return it?tt?jsxRuntimeExports.jsx(Pill,{className:"booster__pill",style:{padding:"1px 8px 1px 3px",width:"fit-content"},children:jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"center",children:[jsxRuntimeExports.jsx(MdBolt,{fontSize:12}),jsxRuntimeExports.jsx("div",{style:{fontSize:10},children:tt||0})]})}):null:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Pill,{disabled:ot,onClick:async()=>{st||ot||await ht()},style:{padding:"4px 8px",borderWidth:0,backgroundColor:"#303342",height:"25px",width:"fit-content"},children:ot?jsxRuntimeExports.jsx(_default$1,{color:"#fff",loading:!0,size:10}):jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"space-around",children:[jsxRuntimeExports.jsx(BoostIcon,{style:{color:colors.white}}),jsxRuntimeExports.jsx("div",{style:{marginLeft:8,marginRight:8},children:"Boost"})]})})})},NotesIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"notes",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1473_73722",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1473_73722)",children:jsxRuntimeExports.jsx("path",{id:"notes_2",d:"M2.83337 11.7564C2.69171 11.7564 2.57296 11.7085 2.47712 11.6126C2.38129 11.5167 2.33337 11.3979 2.33337 11.2562C2.33337 11.1144 2.38129 10.9957 2.47712 10.9C2.57296 10.8043 2.69171 10.7564 2.83337 10.7564H9.16668C9.30834 10.7564 9.42709 10.8043 9.52293 10.9002C9.61876 10.9961 9.66668 11.1149 9.66668 11.2566C9.66668 11.3983 9.61876 11.5171 9.52293 11.6128C9.42709 11.7085 9.30834 11.7564 9.16668 11.7564H2.83337ZM2.83337 8.49997C2.69171 8.49997 2.57296 8.45204 2.47712 8.35617C2.38129 8.2603 2.33337 8.1415 2.33337 7.99977C2.33337 7.85804 2.38129 7.73931 2.47712 7.64359C2.57296 7.54787 2.69171 7.50001 2.83337 7.50001H13.1667C13.3083 7.50001 13.4271 7.54794 13.5229 7.64381C13.6188 7.73969 13.6667 7.85849 13.6667 8.00021C13.6667 8.14194 13.6188 8.26067 13.5229 8.35639C13.4271 8.45211 13.3083 8.49997 13.1667 8.49997H2.83337ZM2.83337 5.24357C2.69171 5.24357 2.57296 5.19564 2.47712 5.09976C2.38129 5.00389 2.33337 4.88509 2.33337 4.74336C2.33337 4.60164 2.38129 4.48291 2.47712 4.38719C2.57296 4.29146 2.69171 4.24359 2.83337 4.24359H13.1667C13.3083 4.24359 13.4271 4.29153 13.5229 4.38741C13.6188 4.48329 13.6667 4.60209 13.6667 4.74381C13.6667 4.88554 13.6188 5.00427 13.5229 5.09999C13.4271 5.19571 13.3083 5.24357 13.1667 5.24357H2.83337Z",fill:"currentColor"})})]})}),Description=({stateless:tt,node:et})=>jsxRuntimeExports.jsxs(Flex,{grow:1,shrink:1,children:[jsxRuntimeExports.jsx(Header$2,{children:tt&&jsxRuntimeExports.jsxs(Heading$1,{children:[jsxRuntimeExports.jsx("div",{className:"icon",children:jsxRuntimeExports.jsx(NotesIcon,{})}),jsxRuntimeExports.jsx("div",{className:"title",children:"Description"})]})}),jsxRuntimeExports.jsx(Box$1,{children:et!=null&&et.description?`"${et==null?void 0:et.description}"`:"..."})]}),Heading$1=styled$4(Flex).attrs({direction:"row",align:"center"})` .icon { font-size: 16px; color: ${colors.GRAY3}; @@ -7268,7 +7268,7 @@ ${({disabled:tt})=>tt&&Ae` opacity: 75%; `,StyledButton=styled$4(Button$2)` width: 100%; -`,YouTube$1=()=>{const tt=useDataStore(mt=>mt.selectedNode),et=reactExports.useRef(null),{link:nt,image_url:it,date:rt,boost:ot,node_type:at,type:st,id:lt,show_title:ct,episode_title:ut,ref_id:ht}=tt||{},[dt,pt]=reactExports.useState(ot||0);return tt?jsxRuntimeExports.jsxs(Wrapper$6,{children:[jsxRuntimeExports.jsx(StyledEpisode,{boostCount:dt||0,date:rt||0,episodeTitle:formatDescription(ut),id:lt,imageUrl:it||"video_default.svg",isSelectedView:!0,link:nt,onClick:()=>null,showTitle:ct,type:at||st}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsxs("div",{ref:et,style:{overflow:"auto",flex:1,width:"100%"},children:[jsxRuntimeExports.jsxs(BoostWrapper,{children:[jsxRuntimeExports.jsx(BoostAmt,{amt:dt}),jsxRuntimeExports.jsx(Booster,{content:tt,count:dt,refId:ht,updateCount:pt})]}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsx(TextWrapper,{children:jsxRuntimeExports.jsx(Description,{node:tt,stateless:!0})}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsx(TextWrapper,{children:jsxRuntimeExports.jsx(Transcript,{node:tt,stateless:!0},lt)})]})]}):null},Wrapper$6=styled$4(Flex)` +`,YouTube=()=>{const tt=useDataStore(mt=>mt.selectedNode),et=reactExports.useRef(null),{link:nt,image_url:it,date:rt,boost:ot,node_type:at,type:st,id:lt,show_title:ct,episode_title:ut,ref_id:ht}=tt||{},[dt,pt]=reactExports.useState(ot||0);return tt?jsxRuntimeExports.jsxs(Wrapper$6,{children:[jsxRuntimeExports.jsx(StyledEpisode,{boostCount:dt||0,date:rt||0,episodeTitle:formatDescription(ut),id:lt,imageUrl:it||"video_default.svg",isSelectedView:!0,link:nt,onClick:()=>null,showTitle:ct,type:at||st}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsxs("div",{ref:et,style:{overflow:"auto",flex:1,width:"100%"},children:[jsxRuntimeExports.jsxs(BoostWrapper,{children:[jsxRuntimeExports.jsx(BoostAmt,{amt:dt}),jsxRuntimeExports.jsx(Booster,{content:tt,count:dt,refId:ht,updateCount:pt})]}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsx(TextWrapper,{children:jsxRuntimeExports.jsx(Description,{node:tt,stateless:!0})}),jsxRuntimeExports.jsx(StyledDivider,{}),jsxRuntimeExports.jsx(TextWrapper,{children:jsxRuntimeExports.jsx(Transcript,{node:tt,stateless:!0},lt)})]})]}):null},Wrapper$6=styled$4(Flex)` flex: 1; min-height: 100%; flex-direction: column; @@ -7290,12 +7290,7 @@ ${({disabled:tt})=>tt&&Ae` `,StyledDivider=styled$4(Divider)` margin: auto 0px 2px 0px; opacity: 75%; -`,MEDIA_TYPES=["clip","twitter_space","youtube"],_View=()=>{const tt=useSelectedNode(),[et]=useDataStore(rt=>[rt.showTeachMe]),[nt,it]=usePlayerStore(rt=>[rt.playingNode,rt.setPlayingNode]);if(reactExports.useEffect(()=>{MEDIA_TYPES.includes((tt==null?void 0:tt.node_type)||"")&&it(tt)},[it,tt,nt]),et)return jsxRuntimeExports.jsx(TeachMeText,{});switch(tt==null?void 0:tt.node_type){case"guest":return jsxRuntimeExports.jsx(Person,{});case"person":return jsxRuntimeExports.jsx(Person,{});case"data_series":return jsxRuntimeExports.jsx(Data,{});case"tribe_message":return jsxRuntimeExports.jsx(Messages,{});case"tweet":return jsxRuntimeExports.jsx(TwitData,{});case"topic":return jsxRuntimeExports.jsx(Topic,{});case"show":return jsxRuntimeExports.jsx(Show,{});case"youtube":return jsxRuntimeExports.jsx(YouTube$1,{});case"clip":return(tt==null?void 0:tt.type)==="youtube"?jsxRuntimeExports.jsx(YouTube$1,{}):jsxRuntimeExports.jsx(AudioClip,{});case"document":return jsxRuntimeExports.jsx(TextType,{});case"twitter_space":return jsxRuntimeExports.jsx(AudioClip,{});default:return null}},SelectedNodeView=reactExports.memo(_View);var lib={},players={},utils={},loadScript=function tt(et,nt,it){var rt=document.head||document.getElementsByTagName("head")[0],ot=document.createElement("script");typeof nt=="function"&&(it=nt,nt={}),nt=nt||{},it=it||function(){},ot.type=nt.type||"text/javascript",ot.charset=nt.charset||"utf8",ot.async="async"in nt?!!nt.async:!0,ot.src=et,nt.attrs&&setAttributes(ot,nt.attrs),nt.text&&(ot.text=""+nt.text);var at="onload"in ot?stdOnEnd:ieOnEnd;at(ot,it),ot.onload||stdOnEnd(ot,it),rt.appendChild(ot)};function setAttributes(tt,et){for(var nt in et)tt.setAttribute(nt,et[nt])}function stdOnEnd(tt,et){tt.onload=function(){this.onerror=this.onload=null,et(null,tt)},tt.onerror=function(){this.onerror=this.onload=null,et(new Error("Failed to load "+this.src),tt)}}function ieOnEnd(tt,et){tt.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,et(null,tt))}}var isMergeableObject=function tt(et){return isNonNullObject(et)&&!isSpecial(et)};function isNonNullObject(tt){return!!tt&&typeof tt=="object"}function isSpecial(tt){var et=Object.prototype.toString.call(tt);return et==="[object RegExp]"||et==="[object Date]"||isReactElement(tt)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(tt){return tt.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(tt){return Array.isArray(tt)?[]:{}}function cloneUnlessOtherwiseSpecified(tt,et){return et.clone!==!1&&et.isMergeableObject(tt)?deepmerge(emptyTarget(tt),tt,et):tt}function defaultArrayMerge(tt,et,nt){return tt.concat(et).map(function(it){return cloneUnlessOtherwiseSpecified(it,nt)})}function getMergeFunction(tt,et){if(!et.customMerge)return deepmerge;var nt=et.customMerge(tt);return typeof nt=="function"?nt:deepmerge}function getEnumerableOwnPropertySymbols(tt){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(tt).filter(function(et){return Object.propertyIsEnumerable.call(tt,et)}):[]}function getKeys(tt){return Object.keys(tt).concat(getEnumerableOwnPropertySymbols(tt))}function propertyIsOnObject(tt,et){try{return et in tt}catch{return!1}}function propertyIsUnsafe(tt,et){return propertyIsOnObject(tt,et)&&!(Object.hasOwnProperty.call(tt,et)&&Object.propertyIsEnumerable.call(tt,et))}function mergeObject(tt,et,nt){var it={};return nt.isMergeableObject(tt)&&getKeys(tt).forEach(function(rt){it[rt]=cloneUnlessOtherwiseSpecified(tt[rt],nt)}),getKeys(et).forEach(function(rt){propertyIsUnsafe(tt,rt)||(propertyIsOnObject(tt,rt)&&nt.isMergeableObject(et[rt])?it[rt]=getMergeFunction(rt,nt)(tt[rt],et[rt],nt):it[rt]=cloneUnlessOtherwiseSpecified(et[rt],nt))}),it}function deepmerge(tt,et,nt){nt=nt||{},nt.arrayMerge=nt.arrayMerge||defaultArrayMerge,nt.isMergeableObject=nt.isMergeableObject||isMergeableObject,nt.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var it=Array.isArray(et),rt=Array.isArray(tt),ot=it===rt;return ot?it?nt.arrayMerge(tt,et,nt):mergeObject(tt,et,nt):cloneUnlessOtherwiseSpecified(et,nt)}deepmerge.all=function tt(et,nt){if(!Array.isArray(et))throw new Error("first argument should be an array");return et.reduce(function(it,rt){return deepmerge(it,rt,nt)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1;Object.defineProperty(utils,"__esModule",{value:!0});utils.parseStartTime=parseStartTime;utils.parseEndTime=parseEndTime;utils.randomString=randomString;utils.queryString=queryString;utils.getSDK=getSDK;utils.getConfig=getConfig;utils.omit=omit;utils.callPlayer=callPlayer;utils.isMediaStream=isMediaStream;utils.isBlobUrl=isBlobUrl;utils.supportsWebKitPresentationMode=supportsWebKitPresentationMode;var _loadScript=_interopRequireDefault$2(loadScript),_deepmerge$1=_interopRequireDefault$2(cjs);function _interopRequireDefault$2(tt){return tt&&tt.__esModule?tt:{default:tt}}function _slicedToArray(tt,et){return _arrayWithHoles(tt)||_iterableToArrayLimit(tt,et)||_unsupportedIterableToArray$2(tt,et)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$2(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$2(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$2(tt,et)}}function _arrayLikeToArray$2(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt"u"||!(Symbol.iterator in Object(tt)))){var nt=[],it=!0,rt=!1,ot=void 0;try{for(var at=tt[Symbol.iterator](),st;!(it=(st=at.next()).done)&&(nt.push(st.value),!(et&&nt.length===et));it=!0);}catch(lt){rt=!0,ot=lt}finally{try{!it&&at.return!=null&&at.return()}finally{if(rt)throw ot}}return nt}}function _arrayWithHoles(tt){if(Array.isArray(tt))return tt}var MATCH_START_QUERY=/[?&#](?:start|t)=([0-9hms]+)/,MATCH_END_QUERY=/[?&#]end=([0-9hms]+)/,MATCH_START_STAMP=/(\d+)(h|m|s)/g,MATCH_NUMERIC=/^\d+$/;function parseTimeParam(tt,et){if(!(tt instanceof Array)){var nt=tt.match(et);if(nt){var it=nt[1];if(it.match(MATCH_START_STAMP))return parseTimeString(it);if(MATCH_NUMERIC.test(it))return parseInt(it)}}}function parseTimeString(tt){for(var et=0,nt=MATCH_START_STAMP.exec(tt);nt!==null;){var it=nt,rt=_slicedToArray(it,3),ot=rt[1],at=rt[2];at==="h"&&(et+=parseInt(ot,10)*60*60),at==="m"&&(et+=parseInt(ot,10)*60),at==="s"&&(et+=parseInt(ot,10)),nt=MATCH_START_STAMP.exec(tt)}return et}function parseStartTime(tt){return parseTimeParam(tt,MATCH_START_QUERY)}function parseEndTime(tt){return parseTimeParam(tt,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(tt){return Object.keys(tt).map(function(et){return"".concat(et,"=").concat(tt[et])}).join("&")}function getGlobal(tt){return window[tt]?window[tt]:window.exports&&window.exports[tt]?window.exports[tt]:window.module&&window.module.exports&&window.module.exports[tt]?window.module.exports[tt]:null}var requests={};function getSDK(tt,et){var nt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,it=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0},rt=arguments.length>4&&arguments[4]!==void 0?arguments[4]:_loadScript.default,ot=getGlobal(et);return ot&&it(ot)?Promise.resolve(ot):new Promise(function(at,st){if(requests[tt]){requests[tt].push({resolve:at,reject:st});return}requests[tt]=[{resolve:at,reject:st}];var lt=function(ht){requests[tt].forEach(function(dt){return dt.resolve(ht)})};if(nt){var ct=window[nt];window[nt]=function(){ct&&ct(),lt(getGlobal(et))}}rt(tt,function(ut){ut?(requests[tt].forEach(function(ht){return ht.reject(ut)}),requests[tt]=null):nt||lt(getGlobal(et))})})}function getConfig(tt,et){return(0,_deepmerge$1.default)(et.config,tt.config)}function omit(tt){for(var et,nt=arguments.length,it=new Array(nt>1?nt-1:0),rt=1;rt1?it-1:0),ot=1;ot0&&arguments[0]!==void 0?arguments[0]:document.createElement("video"),et=/iPhone|iPod/.test(navigator.userAgent)===!1;return tt.webkitSupportsPresentationMode&&typeof tt.webkitSetPresentationMode=="function"&&et}var patterns={};Object.defineProperty(patterns,"__esModule",{value:!0});patterns.canPlay=patterns.FLV_EXTENSIONS=patterns.DASH_EXTENSIONS=patterns.HLS_EXTENSIONS=patterns.VIDEO_EXTENSIONS=patterns.AUDIO_EXTENSIONS=patterns.MATCH_URL_KALTURA=patterns.MATCH_URL_VIDYARD=patterns.MATCH_URL_MIXCLOUD=patterns.MATCH_URL_DAILYMOTION=patterns.MATCH_URL_TWITCH_CHANNEL=patterns.MATCH_URL_TWITCH_VIDEO=patterns.MATCH_URL_WISTIA=patterns.MATCH_URL_STREAMABLE=patterns.MATCH_URL_FACEBOOK_WATCH=patterns.MATCH_URL_FACEBOOK=patterns.MATCH_URL_VIMEO=patterns.MATCH_URL_SOUNDCLOUD=patterns.MATCH_URL_YOUTUBE=void 0;var _utils$1=utils;function _createForOfIteratorHelper(tt,et){var nt;if(typeof Symbol>"u"||tt[Symbol.iterator]==null){if(Array.isArray(tt)||(nt=_unsupportedIterableToArray$1(tt))||et&&tt&&typeof tt.length=="number"){nt&&(tt=nt);var it=0,rt=function(){};return{s:rt,n:function(){return it>=tt.length?{done:!0}:{done:!1,value:tt[it++]}},e:function(ct){throw ct},f:rt}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ot=!0,at=!1,st;return{s:function(){nt=tt[Symbol.iterator]()},n:function(){var ct=nt.next();return ot=ct.done,ct},e:function(ct){at=!0,st=ct},f:function(){try{!ot&&nt.return!=null&&nt.return()}finally{if(at)throw st}}}}function _unsupportedIterableToArray$1(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray$1(tt,et);var nt=Object.prototype.toString.call(tt).slice(8,-1);if(nt==="Object"&&tt.constructor&&(nt=tt.constructor.name),nt==="Map"||nt==="Set")return Array.from(tt);if(nt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(nt))return _arrayLikeToArray$1(tt,et)}}function _arrayLikeToArray$1(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);ntjt.length)&&(Ot=jt.length);for(var Ct=0,Dt=new Array(Ot);Ct"u"||!(Symbol.iterator in Object(jt)))){var Ct=[],Dt=!0,Mt=!1,Vt=void 0;try{for(var Qt=jt[Symbol.iterator](),rn;!(Dt=(rn=Qt.next()).done)&&(Ct.push(rn.value),!(Ot&&Ct.length===Ot));Dt=!0);}catch(Xt){Mt=!0,Vt=Xt}finally{try{!Dt&&Qt.return!=null&&Qt.return()}finally{if(Mt)throw Vt}}return Ct}}function mt(jt){if(Array.isArray(jt))return jt}function gt(jt,Ot){if(!(jt instanceof Ot))throw new TypeError("Cannot call a class as a function")}function bt(jt,Ot){for(var Ct=0;Ct"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Tt(jt){return Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ct){return Ct.__proto__||Object.getPrototypeOf(Ct)},Tt(jt)}function $t(jt,Ot,Ct){return Ot in jt?Object.defineProperty(jt,Ot,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):jt[Ot]=Ct,jt}var Ut="https://www.youtube.com/iframe_api",Lt="YT",Bt="onYouTubeIframeAPIReady",Pt=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,kt=/user\/([a-zA-Z0-9_-]+)\/?/,At=/youtube-nocookie\.com/,Rt="https://www.youtube-nocookie.com",Wt=function(jt){wt(Ct,jt);var Ot=xt(Ct);function Ct(){var Dt;gt(this,Ct);for(var Mt=arguments.length,Vt=new Array(Mt),Qt=0;Qt1&&arguments[1]!==void 0?arguments[1]:!1;this.callPlayer("seekTo",Mt),!Vt&&!this.props.playing&&this.pause()}},{key:"setVolume",value:function(Mt){this.callPlayer("setVolume",Mt*100)}},{key:"setPlaybackRate",value:function(Mt){this.callPlayer("setPlaybackRate",Mt)}},{key:"setLoop",value:function(Mt){this.callPlayer("setLoop",Mt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var Mt=this.props.display,Vt={width:"100%",height:"100%",display:Mt};return nt.default.createElement("div",{style:Vt},nt.default.createElement("div",{ref:this.ref}))}}]),Ct}(nt.Component);tt.default=Wt,$t(Wt,"displayName","YouTube"),$t(Wt,"canPlay",rt.canPlay.youtube)}(YouTube)),YouTube}var SoundCloud={},hasRequiredSoundCloud;function requireSoundCloud(){return hasRequiredSoundCloud||(hasRequiredSoundCloud=1,function(tt){function et(It){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function($t){return typeof $t}:et=function($t){return $t&&typeof Symbol=="function"&&$t.constructor===Symbol&&$t!==Symbol.prototype?"symbol":typeof $t},et(It)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var It=new WeakMap;return ot=function(){return It},It}function at(It){if(It&&It.__esModule)return It;if(It===null||et(It)!=="object"&&typeof It!="function")return{default:It};var Tt=ot();if(Tt&&Tt.has(It))return Tt.get(It);var $t={},Ut=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Lt in It)if(Object.prototype.hasOwnProperty.call(It,Lt)){var Bt=Ut?Object.getOwnPropertyDescriptor(It,Lt):null;Bt&&(Bt.get||Bt.set)?Object.defineProperty($t,Lt,Bt):$t[Lt]=It[Lt]}return $t.default=It,Tt&&Tt.set(It,$t),$t}function st(It,Tt){var $t=Object.keys(It);if(Object.getOwnPropertySymbols){var Ut=Object.getOwnPropertySymbols(It);Tt&&(Ut=Ut.filter(function(Lt){return Object.getOwnPropertyDescriptor(It,Lt).enumerable})),$t.push.apply($t,Ut)}return $t}function lt(It){for(var Tt=1;Tt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(It){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function($t){return $t.__proto__||Object.getPrototypeOf($t)},wt(It)}function vt(It,Tt,$t){return Tt in It?Object.defineProperty(It,Tt,{value:$t,enumerable:!0,configurable:!0,writable:!0}):It[Tt]=$t,It}var xt="https://w.soundcloud.com/player/api.js",St="SC",Et=function(It){dt($t,It);var Tt=mt($t);function $t(){var Ut;ct(this,$t);for(var Lt=arguments.length,Bt=new Array(Lt),Pt=0;Pt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seekTo",Lt*1e3),Bt||this.pause()}},{key:"setVolume",value:function(Lt){this.callPlayer("setVolume",Lt*100)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var Lt=this.props.display,Bt={width:"100%",height:"100%",display:Lt};return nt.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:Bt,frameBorder:0,allow:"autoplay"})}}]),$t}(nt.Component);tt.default=Et,vt(Et,"displayName","SoundCloud"),vt(Et,"canPlay",rt.canPlay.soundcloud),vt(Et,"loopOnEnded",!0)}(SoundCloud)),SoundCloud}var Vimeo={},hasRequiredVimeo;function requireVimeo(){return hasRequiredVimeo||(hasRequiredVimeo=1,function(tt){function et(Tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ut){return typeof Ut}:et=function(Ut){return Ut&&typeof Symbol=="function"&&Ut.constructor===Symbol&&Ut!==Symbol.prototype?"symbol":typeof Ut},et(Tt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var Tt=new WeakMap;return ot=function(){return Tt},Tt}function at(Tt){if(Tt&&Tt.__esModule)return Tt;if(Tt===null||et(Tt)!=="object"&&typeof Tt!="function")return{default:Tt};var $t=ot();if($t&&$t.has(Tt))return $t.get(Tt);var Ut={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Bt in Tt)if(Object.prototype.hasOwnProperty.call(Tt,Bt)){var Pt=Lt?Object.getOwnPropertyDescriptor(Tt,Bt):null;Pt&&(Pt.get||Pt.set)?Object.defineProperty(Ut,Bt,Pt):Ut[Bt]=Tt[Bt]}return Ut.default=Tt,$t&&$t.set(Tt,Ut),Ut}function st(Tt,$t){var Ut=Object.keys(Tt);if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(Tt);$t&&(Lt=Lt.filter(function(Bt){return Object.getOwnPropertyDescriptor(Tt,Bt).enumerable})),Ut.push.apply(Ut,Lt)}return Ut}function lt(Tt){for(var $t=1;$t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Tt){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ut){return Ut.__proto__||Object.getPrototypeOf(Ut)},wt(Tt)}function vt(Tt,$t,Ut){return $t in Tt?Object.defineProperty(Tt,$t,{value:Ut,enumerable:!0,configurable:!0,writable:!0}):Tt[$t]=Ut,Tt}var xt="https://player.vimeo.com/api/player.js",St="Vimeo",Et=function($t){return $t.replace("/manage/videos","")},It=function(Tt){dt(Ut,Tt);var $t=mt(Ut);function Ut(){var Lt;ct(this,Ut);for(var Bt=arguments.length,Pt=new Array(Bt),kt=0;kt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",Bt),Pt||this.pause()}},{key:"setVolume",value:function(Bt){this.callPlayer("setVolume",Bt)}},{key:"setMuted",value:function(Bt){this.callPlayer("setMuted",Bt)}},{key:"setLoop",value:function(Bt){this.callPlayer("setLoop",Bt)}},{key:"setPlaybackRate",value:function(Bt){this.callPlayer("setPlaybackRate",Bt)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var Bt=this.props.display,Pt={width:"100%",height:"100%",overflow:"hidden",display:Bt};return nt.default.createElement("div",{key:this.props.url,ref:this.ref,style:Pt})}}]),Ut}(nt.Component);tt.default=It,vt(It,"displayName","Vimeo"),vt(It,"canPlay",rt.canPlay.vimeo),vt(It,"forceLoad",!0)}(Vimeo)),Vimeo}var Facebook={},hasRequiredFacebook;function requireFacebook(){return hasRequiredFacebook||(hasRequiredFacebook=1,function(tt){function et(Tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ut){return typeof Ut}:et=function(Ut){return Ut&&typeof Symbol=="function"&&Ut.constructor===Symbol&&Ut!==Symbol.prototype?"symbol":typeof Ut},et(Tt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var Tt=new WeakMap;return ot=function(){return Tt},Tt}function at(Tt){if(Tt&&Tt.__esModule)return Tt;if(Tt===null||et(Tt)!=="object"&&typeof Tt!="function")return{default:Tt};var $t=ot();if($t&&$t.has(Tt))return $t.get(Tt);var Ut={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Bt in Tt)if(Object.prototype.hasOwnProperty.call(Tt,Bt)){var Pt=Lt?Object.getOwnPropertyDescriptor(Tt,Bt):null;Pt&&(Pt.get||Pt.set)?Object.defineProperty(Ut,Bt,Pt):Ut[Bt]=Tt[Bt]}return Ut.default=Tt,$t&&$t.set(Tt,Ut),Ut}function st(){return st=Object.assign||function(Tt){for(var $t=1;$t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function yt(Tt){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ut){return Ut.__proto__||Object.getPrototypeOf(Ut)},yt(Tt)}function wt(Tt,$t,Ut){return $t in Tt?Object.defineProperty(Tt,$t,{value:Ut,enumerable:!0,configurable:!0,writable:!0}):Tt[$t]=Ut,Tt}var vt="https://connect.facebook.net/en_US/sdk.js",xt="FB",St="fbAsyncInit",Et="facebook-player-",It=function(Tt){ht(Ut,Tt);var $t=pt(Ut);function Ut(){var Lt;lt(this,Ut);for(var Bt=arguments.length,Pt=new Array(Bt),kt=0;kt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Bt),Pt||this.pause()}},{key:"setVolume",value:function(Bt){this.callPlayer("setVolume",Bt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Bt=this.props.config.attributes,Pt={width:"100%",height:"100%"};return nt.default.createElement("div",st({style:Pt,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"},Bt))}}]),Ut}(nt.Component);tt.default=It,wt(It,"displayName","Facebook"),wt(It,"canPlay",rt.canPlay.facebook),wt(It,"loopOnEnded",!0)}(Facebook)),Facebook}var Streamable={},hasRequiredStreamable;function requireStreamable(){return hasRequiredStreamable||(hasRequiredStreamable=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(It){return typeof It}:et=function(It){return It&&typeof Symbol=="function"&&It.constructor===Symbol&&It!==Symbol.prototype?"symbol":typeof It},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return ot=function(){return St},St}function at(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Et=ot();if(Et&&Et.has(St))return Et.get(St);var It={},Tt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $t in St)if(Object.prototype.hasOwnProperty.call(St,$t)){var Ut=Tt?Object.getOwnPropertyDescriptor(St,$t):null;Ut&&(Ut.get||Ut.set)?Object.defineProperty(It,$t,Ut):It[$t]=St[$t]}return It.default=St,Et&&Et.set(St,It),It}function st(St,Et){if(!(St instanceof Et))throw new TypeError("Cannot call a class as a function")}function lt(St,Et){for(var It=0;It"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function bt(St){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(It){return It.__proto__||Object.getPrototypeOf(It)},bt(St)}function yt(St,Et,It){return Et in St?Object.defineProperty(St,Et,{value:It,enumerable:!0,configurable:!0,writable:!0}):St[Et]=It,St}var wt="https://cdn.embed.ly/player-0.1.0.min.js",vt="playerjs",xt=function(St){ut(It,St);var Et=dt(It);function It(){var Tt;st(this,It);for(var $t=arguments.length,Ut=new Array($t),Lt=0;Lt<$t;Lt++)Ut[Lt]=arguments[Lt];return Tt=Et.call.apply(Et,[this].concat(Ut)),yt(mt(Tt),"callPlayer",it.callPlayer),yt(mt(Tt),"duration",null),yt(mt(Tt),"currentTime",null),yt(mt(Tt),"secondsLoaded",null),yt(mt(Tt),"mute",function(){Tt.callPlayer("mute")}),yt(mt(Tt),"unmute",function(){Tt.callPlayer("unmute")}),yt(mt(Tt),"ref",function(Bt){Tt.iframe=Bt}),Tt}return ct(It,[{key:"componentDidMount",value:function(){this.props.onMount&&this.props.onMount(this)}},{key:"load",value:function($t){var Ut=this;(0,it.getSDK)(wt,vt).then(function(Lt){Ut.iframe&&(Ut.player=new Lt.Player(Ut.iframe),Ut.player.setLoop(Ut.props.loop),Ut.player.on("ready",Ut.props.onReady),Ut.player.on("play",Ut.props.onPlay),Ut.player.on("pause",Ut.props.onPause),Ut.player.on("seeked",Ut.props.onSeek),Ut.player.on("ended",Ut.props.onEnded),Ut.player.on("error",Ut.props.onError),Ut.player.on("timeupdate",function(Bt){var Pt=Bt.duration,kt=Bt.seconds;Ut.duration=Pt,Ut.currentTime=kt}),Ut.player.on("buffered",function(Bt){var Pt=Bt.percent;Ut.duration&&(Ut.secondsLoaded=Ut.duration*Pt)}),Ut.props.muted&&Ut.player.mute())},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function($t){var Ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",$t),Ut||this.pause()}},{key:"setVolume",value:function($t){this.callPlayer("setVolume",$t*100)}},{key:"setLoop",value:function($t){this.callPlayer("setLoop",$t)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var $t=this.props.url.match(rt.MATCH_URL_STREAMABLE)[1],Ut={width:"100%",height:"100%"};return nt.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat($t),frameBorder:"0",scrolling:"no",style:Ut,allow:"encrypted-media; autoplay; fullscreen;"})}}]),It}(nt.Component);tt.default=xt,yt(xt,"displayName","Streamable"),yt(xt,"canPlay",rt.canPlay.streamable)}(Streamable)),Streamable}var Wistia={},hasRequiredWistia;function requireWistia(){return hasRequiredWistia||(hasRequiredWistia=1,function(tt){function et(Tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ut){return typeof Ut}:et=function(Ut){return Ut&&typeof Symbol=="function"&&Ut.constructor===Symbol&&Ut!==Symbol.prototype?"symbol":typeof Ut},et(Tt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var Tt=new WeakMap;return ot=function(){return Tt},Tt}function at(Tt){if(Tt&&Tt.__esModule)return Tt;if(Tt===null||et(Tt)!=="object"&&typeof Tt!="function")return{default:Tt};var $t=ot();if($t&&$t.has(Tt))return $t.get(Tt);var Ut={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Bt in Tt)if(Object.prototype.hasOwnProperty.call(Tt,Bt)){var Pt=Lt?Object.getOwnPropertyDescriptor(Tt,Bt):null;Pt&&(Pt.get||Pt.set)?Object.defineProperty(Ut,Bt,Pt):Ut[Bt]=Tt[Bt]}return Ut.default=Tt,$t&&$t.set(Tt,Ut),Ut}function st(Tt,$t){var Ut=Object.keys(Tt);if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(Tt);$t&&(Lt=Lt.filter(function(Bt){return Object.getOwnPropertyDescriptor(Tt,Bt).enumerable})),Ut.push.apply(Ut,Lt)}return Ut}function lt(Tt){for(var $t=1;$t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Tt){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ut){return Ut.__proto__||Object.getPrototypeOf(Ut)},wt(Tt)}function vt(Tt,$t,Ut){return $t in Tt?Object.defineProperty(Tt,$t,{value:Ut,enumerable:!0,configurable:!0,writable:!0}):Tt[$t]=Ut,Tt}var xt="https://fast.wistia.com/assets/external/E-v1.js",St="Wistia",Et="wistia-player-",It=function(Tt){dt(Ut,Tt);var $t=mt(Ut);function Ut(){var Lt;ct(this,Ut);for(var Bt=arguments.length,Pt=new Array(Bt),kt=0;kt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("time",Bt),Pt||this.pause()}},{key:"setVolume",value:function(Bt){this.callPlayer("volume",Bt)}},{key:"setPlaybackRate",value:function(Bt){this.callPlayer("playbackRate",Bt)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Bt=this.props.url,Pt=Bt&&Bt.match(rt.MATCH_URL_WISTIA)[1],kt="wistia_embed wistia_async_".concat(Pt),At={width:"100%",height:"100%"};return nt.default.createElement("div",{id:this.playerID,key:Pt,className:kt,style:At})}}]),Ut}(nt.Component);tt.default=It,vt(It,"displayName","Wistia"),vt(It,"canPlay",rt.canPlay.wistia),vt(It,"loopOnEnded",!0)}(Wistia)),Wistia}var Twitch={},hasRequiredTwitch;function requireTwitch(){return hasRequiredTwitch||(hasRequiredTwitch=1,function(tt){function et(Tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ut){return typeof Ut}:et=function(Ut){return Ut&&typeof Symbol=="function"&&Ut.constructor===Symbol&&Ut!==Symbol.prototype?"symbol":typeof Ut},et(Tt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var Tt=new WeakMap;return ot=function(){return Tt},Tt}function at(Tt){if(Tt&&Tt.__esModule)return Tt;if(Tt===null||et(Tt)!=="object"&&typeof Tt!="function")return{default:Tt};var $t=ot();if($t&&$t.has(Tt))return $t.get(Tt);var Ut={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Bt in Tt)if(Object.prototype.hasOwnProperty.call(Tt,Bt)){var Pt=Lt?Object.getOwnPropertyDescriptor(Tt,Bt):null;Pt&&(Pt.get||Pt.set)?Object.defineProperty(Ut,Bt,Pt):Ut[Bt]=Tt[Bt]}return Ut.default=Tt,$t&&$t.set(Tt,Ut),Ut}function st(Tt,$t){var Ut=Object.keys(Tt);if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(Tt);$t&&(Lt=Lt.filter(function(Bt){return Object.getOwnPropertyDescriptor(Tt,Bt).enumerable})),Ut.push.apply(Ut,Lt)}return Ut}function lt(Tt){for(var $t=1;$t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Tt){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ut){return Ut.__proto__||Object.getPrototypeOf(Ut)},wt(Tt)}function vt(Tt,$t,Ut){return $t in Tt?Object.defineProperty(Tt,$t,{value:Ut,enumerable:!0,configurable:!0,writable:!0}):Tt[$t]=Ut,Tt}var xt="https://player.twitch.tv/js/embed/v1.js",St="Twitch",Et="twitch-player-",It=function(Tt){dt(Ut,Tt);var $t=mt(Ut);function Ut(){var Lt;ct(this,Ut);for(var Bt=arguments.length,Pt=new Array(Bt),kt=0;kt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Bt),Pt||this.pause()}},{key:"setVolume",value:function(Bt){this.callPlayer("setVolume",Bt)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Bt={width:"100%",height:"100%"};return nt.default.createElement("div",{style:Bt,id:this.playerID})}}]),Ut}(nt.Component);tt.default=It,vt(It,"displayName","Twitch"),vt(It,"canPlay",rt.canPlay.twitch),vt(It,"loopOnEnded",!0)}(Twitch)),Twitch}var DailyMotion={},hasRequiredDailyMotion;function requireDailyMotion(){return hasRequiredDailyMotion||(hasRequiredDailyMotion=1,function(tt){function et(kt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Rt){return typeof Rt}:et=function(Rt){return Rt&&typeof Symbol=="function"&&Rt.constructor===Symbol&&Rt!==Symbol.prototype?"symbol":typeof Rt},et(kt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var kt=new WeakMap;return ot=function(){return kt},kt}function at(kt){if(kt&&kt.__esModule)return kt;if(kt===null||et(kt)!=="object"&&typeof kt!="function")return{default:kt};var At=ot();if(At&&At.has(kt))return At.get(kt);var Rt={},Wt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var jt in kt)if(Object.prototype.hasOwnProperty.call(kt,jt)){var Ot=Wt?Object.getOwnPropertyDescriptor(kt,jt):null;Ot&&(Ot.get||Ot.set)?Object.defineProperty(Rt,jt,Ot):Rt[jt]=kt[jt]}return Rt.default=kt,At&&At.set(kt,Rt),Rt}function st(kt,At){var Rt=Object.keys(kt);if(Object.getOwnPropertySymbols){var Wt=Object.getOwnPropertySymbols(kt);At&&(Wt=Wt.filter(function(jt){return Object.getOwnPropertyDescriptor(kt,jt).enumerable})),Rt.push.apply(Rt,Wt)}return Rt}function lt(kt){for(var At=1;Atkt.length)&&(At=kt.length);for(var Rt=0,Wt=new Array(At);Rt"u"||!(Symbol.iterator in Object(kt)))){var Rt=[],Wt=!0,jt=!1,Ot=void 0;try{for(var Ct=kt[Symbol.iterator](),Dt;!(Wt=(Dt=Ct.next()).done)&&(Rt.push(Dt.value),!(At&&Rt.length===At));Wt=!0);}catch(Mt){jt=!0,Ot=Mt}finally{try{!Wt&&Ct.return!=null&&Ct.return()}finally{if(jt)throw Ot}}return Rt}}function mt(kt){if(Array.isArray(kt))return kt}function gt(kt,At){if(!(kt instanceof At))throw new TypeError("Cannot call a class as a function")}function bt(kt,At){for(var Rt=0;Rt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Tt(kt){return Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(Rt){return Rt.__proto__||Object.getPrototypeOf(Rt)},Tt(kt)}function $t(kt,At,Rt){return At in kt?Object.defineProperty(kt,At,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):kt[At]=Rt,kt}var Ut="https://api.dmcdn.net/all.js",Lt="DM",Bt="dmAsyncInit",Pt=function(kt){wt(Rt,kt);var At=xt(Rt);function Rt(){var Wt;gt(this,Rt);for(var jt=arguments.length,Ot=new Array(jt),Ct=0;Ct1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",jt),Ot||this.pause()}},{key:"setVolume",value:function(jt){this.callPlayer("setVolume",jt)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var jt=this.props.display,Ot={width:"100%",height:"100%",display:jt};return nt.default.createElement("div",{style:Ot},nt.default.createElement("div",{ref:this.ref}))}}]),Rt}(nt.Component);tt.default=Pt,$t(Pt,"displayName","DailyMotion"),$t(Pt,"canPlay",rt.canPlay.dailymotion),$t(Pt,"loopOnEnded",!0)}(DailyMotion)),DailyMotion}var Mixcloud={},hasRequiredMixcloud;function requireMixcloud(){return hasRequiredMixcloud||(hasRequiredMixcloud=1,function(tt){function et(It){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function($t){return typeof $t}:et=function($t){return $t&&typeof Symbol=="function"&&$t.constructor===Symbol&&$t!==Symbol.prototype?"symbol":typeof $t},et(It)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var It=new WeakMap;return ot=function(){return It},It}function at(It){if(It&&It.__esModule)return It;if(It===null||et(It)!=="object"&&typeof It!="function")return{default:It};var Tt=ot();if(Tt&&Tt.has(It))return Tt.get(It);var $t={},Ut=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Lt in It)if(Object.prototype.hasOwnProperty.call(It,Lt)){var Bt=Ut?Object.getOwnPropertyDescriptor(It,Lt):null;Bt&&(Bt.get||Bt.set)?Object.defineProperty($t,Lt,Bt):$t[Lt]=It[Lt]}return $t.default=It,Tt&&Tt.set(It,$t),$t}function st(It,Tt){var $t=Object.keys(It);if(Object.getOwnPropertySymbols){var Ut=Object.getOwnPropertySymbols(It);Tt&&(Ut=Ut.filter(function(Lt){return Object.getOwnPropertyDescriptor(It,Lt).enumerable})),$t.push.apply($t,Ut)}return $t}function lt(It){for(var Tt=1;Tt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(It){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function($t){return $t.__proto__||Object.getPrototypeOf($t)},wt(It)}function vt(It,Tt,$t){return Tt in It?Object.defineProperty(It,Tt,{value:$t,enumerable:!0,configurable:!0,writable:!0}):It[Tt]=$t,It}var xt="https://widget.mixcloud.com/media/js/widgetApi.js",St="Mixcloud",Et=function(It){dt($t,It);var Tt=mt($t);function $t(){var Ut;ct(this,$t);for(var Lt=arguments.length,Bt=new Array(Lt),Pt=0;Pt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Lt),Bt||this.pause()}},{key:"setVolume",value:function(Lt){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Lt=this.props,Bt=Lt.url,Pt=Lt.config,kt=Bt.match(rt.MATCH_URL_MIXCLOUD)[1],At={width:"100%",height:"100%"},Rt=(0,it.queryString)(lt(lt({},Pt.options),{},{feed:"/".concat(kt,"/")}));return nt.default.createElement("iframe",{key:kt,ref:this.ref,style:At,src:"https://www.mixcloud.com/widget/iframe/?".concat(Rt),frameBorder:"0",allow:"autoplay"})}}]),$t}(nt.Component);tt.default=Et,vt(Et,"displayName","Mixcloud"),vt(Et,"canPlay",rt.canPlay.mixcloud),vt(Et,"loopOnEnded",!0)}(Mixcloud)),Mixcloud}var Vidyard={},hasRequiredVidyard;function requireVidyard(){return hasRequiredVidyard||(hasRequiredVidyard=1,function(tt){function et(Tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ut){return typeof Ut}:et=function(Ut){return Ut&&typeof Symbol=="function"&&Ut.constructor===Symbol&&Ut!==Symbol.prototype?"symbol":typeof Ut},et(Tt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var Tt=new WeakMap;return ot=function(){return Tt},Tt}function at(Tt){if(Tt&&Tt.__esModule)return Tt;if(Tt===null||et(Tt)!=="object"&&typeof Tt!="function")return{default:Tt};var $t=ot();if($t&&$t.has(Tt))return $t.get(Tt);var Ut={},Lt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Bt in Tt)if(Object.prototype.hasOwnProperty.call(Tt,Bt)){var Pt=Lt?Object.getOwnPropertyDescriptor(Tt,Bt):null;Pt&&(Pt.get||Pt.set)?Object.defineProperty(Ut,Bt,Pt):Ut[Bt]=Tt[Bt]}return Ut.default=Tt,$t&&$t.set(Tt,Ut),Ut}function st(Tt,$t){var Ut=Object.keys(Tt);if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(Tt);$t&&(Lt=Lt.filter(function(Bt){return Object.getOwnPropertyDescriptor(Tt,Bt).enumerable})),Ut.push.apply(Ut,Lt)}return Ut}function lt(Tt){for(var $t=1;$t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function wt(Tt){return wt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ut){return Ut.__proto__||Object.getPrototypeOf(Ut)},wt(Tt)}function vt(Tt,$t,Ut){return $t in Tt?Object.defineProperty(Tt,$t,{value:Ut,enumerable:!0,configurable:!0,writable:!0}):Tt[$t]=Ut,Tt}var xt="https://play.vidyard.com/embed/v4.js",St="VidyardV4",Et="onVidyardAPI",It=function(Tt){dt(Ut,Tt);var $t=mt(Ut);function Ut(){var Lt;ct(this,Ut);for(var Bt=arguments.length,Pt=new Array(Bt),kt=0;kt1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",Bt),Pt||this.pause()}},{key:"setVolume",value:function(Bt){this.callPlayer("setVolume",Bt)}},{key:"setPlaybackRate",value:function(Bt){this.callPlayer("setPlaybackSpeed",Bt)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.callPlayer("currentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var Bt=this.props.display,Pt={width:"100%",height:"100%",display:Bt};return nt.default.createElement("div",{style:Pt},nt.default.createElement("div",{ref:this.ref}))}}]),Ut}(nt.Component);tt.default=It,vt(It,"displayName","Vidyard"),vt(It,"canPlay",rt.canPlay.vidyard)}(Vidyard)),Vidyard}var Kaltura={},hasRequiredKaltura;function requireKaltura(){return hasRequiredKaltura||(hasRequiredKaltura=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(It){return typeof It}:et=function(It){return It&&typeof Symbol=="function"&&It.constructor===Symbol&&It!==Symbol.prototype?"symbol":typeof It},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return ot=function(){return St},St}function at(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Et=ot();if(Et&&Et.has(St))return Et.get(St);var It={},Tt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $t in St)if(Object.prototype.hasOwnProperty.call(St,$t)){var Ut=Tt?Object.getOwnPropertyDescriptor(St,$t):null;Ut&&(Ut.get||Ut.set)?Object.defineProperty(It,$t,Ut):It[$t]=St[$t]}return It.default=St,Et&&Et.set(St,It),It}function st(St,Et){if(!(St instanceof Et))throw new TypeError("Cannot call a class as a function")}function lt(St,Et){for(var It=0;It"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function bt(St){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(It){return It.__proto__||Object.getPrototypeOf(It)},bt(St)}function yt(St,Et,It){return Et in St?Object.defineProperty(St,Et,{value:It,enumerable:!0,configurable:!0,writable:!0}):St[Et]=It,St}var wt="https://cdn.embed.ly/player-0.1.0.min.js",vt="playerjs",xt=function(St){ut(It,St);var Et=dt(It);function It(){var Tt;st(this,It);for(var $t=arguments.length,Ut=new Array($t),Lt=0;Lt<$t;Lt++)Ut[Lt]=arguments[Lt];return Tt=Et.call.apply(Et,[this].concat(Ut)),yt(mt(Tt),"callPlayer",it.callPlayer),yt(mt(Tt),"duration",null),yt(mt(Tt),"currentTime",null),yt(mt(Tt),"secondsLoaded",null),yt(mt(Tt),"mute",function(){Tt.callPlayer("mute")}),yt(mt(Tt),"unmute",function(){Tt.callPlayer("unmute")}),yt(mt(Tt),"ref",function(Bt){Tt.iframe=Bt}),Tt}return ct(It,[{key:"componentDidMount",value:function(){this.props.onMount&&this.props.onMount(this)}},{key:"load",value:function($t){var Ut=this;(0,it.getSDK)(wt,vt).then(function(Lt){Ut.iframe&&(Ut.player=new Lt.Player(Ut.iframe),Ut.player.on("ready",function(){setTimeout(function(){Ut.player.isReady=!0,Ut.player.setLoop(Ut.props.loop),Ut.props.muted&&Ut.player.mute(),Ut.addListeners(Ut.player,Ut.props),Ut.props.onReady()},500)}))},this.props.onError)}},{key:"addListeners",value:function($t,Ut){var Lt=this;$t.on("play",Ut.onPlay),$t.on("pause",Ut.onPause),$t.on("ended",Ut.onEnded),$t.on("error",Ut.onError),$t.on("timeupdate",function(Bt){var Pt=Bt.duration,kt=Bt.seconds;Lt.duration=Pt,Lt.currentTime=kt})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function($t){var Ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",$t),Ut||this.pause()}},{key:"setVolume",value:function($t){this.callPlayer("setVolume",$t)}},{key:"setLoop",value:function($t){this.callPlayer("setLoop",$t)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var $t={width:"100%",height:"100%"};return nt.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:$t,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}]),It}(nt.Component);tt.default=xt,yt(xt,"displayName","Kaltura"),yt(xt,"canPlay",rt.canPlay.kaltura)}(Kaltura)),Kaltura}var FilePlayer={},hasRequiredFilePlayer;function requireFilePlayer(){return hasRequiredFilePlayer||(hasRequiredFilePlayer=1,function(tt){function et(Wt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(Ot){return typeof Ot}:et=function(Ot){return Ot&&typeof Symbol=="function"&&Ot.constructor===Symbol&&Ot!==Symbol.prototype?"symbol":typeof Ot},et(Wt)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=at(reactExports),it=utils,rt=patterns;function ot(){if(typeof WeakMap!="function")return null;var Wt=new WeakMap;return ot=function(){return Wt},Wt}function at(Wt){if(Wt&&Wt.__esModule)return Wt;if(Wt===null||et(Wt)!=="object"&&typeof Wt!="function")return{default:Wt};var jt=ot();if(jt&&jt.has(Wt))return jt.get(Wt);var Ot={},Ct=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Dt in Wt)if(Object.prototype.hasOwnProperty.call(Wt,Dt)){var Mt=Ct?Object.getOwnPropertyDescriptor(Wt,Dt):null;Mt&&(Mt.get||Mt.set)?Object.defineProperty(Ot,Dt,Mt):Ot[Dt]=Wt[Dt]}return Ot.default=Wt,jt&&jt.set(Wt,Ot),Ot}function st(){return st=Object.assign||function(Wt){for(var jt=1;jt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function yt(Wt){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(Ot){return Ot.__proto__||Object.getPrototypeOf(Ot)},yt(Wt)}function wt(Wt,jt,Ot){return jt in Wt?Object.defineProperty(Wt,jt,{value:Ot,enumerable:!0,configurable:!0,writable:!0}):Wt[jt]=Ot,Wt}var vt=typeof navigator<"u",xt=vt&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,St=vt&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||xt)&&!window.MSStream,Et=vt&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,It="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",Tt="Hls",$t="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",Ut="dashjs",Lt="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",Bt="flvjs",Pt=/www\.dropbox\.com\/.+/,kt=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,At="https://videodelivery.net/{id}/manifest/video.m3u8",Rt=function(Wt){ht(Ot,Wt);var jt=pt(Ot);function Ot(){var Ct;lt(this,Ot);for(var Dt=arguments.length,Mt=new Array(Dt),Vt=0;Vt1&&arguments[1]!==void 0?arguments[1]:!0;this.player.currentTime=Dt,Mt||this.pause()}},{key:"setVolume",value:function(Dt){this.player.volume=Dt}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,it.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,it.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(Dt){try{this.player.playbackRate=Dt}catch(Mt){this.props.onError(Mt)}}},{key:"getDuration",value:function(){if(!this.player)return null;var Dt=this.player,Mt=Dt.duration,Vt=Dt.seekable;return Mt===1/0&&Vt.length>0?Vt.end(Vt.length-1):Mt}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var Dt=this.player.buffered;if(Dt.length===0)return 0;var Mt=Dt.end(Dt.length-1),Vt=this.getDuration();return Mt>Vt?Vt:Mt}},{key:"getSource",value:function(Dt){var Mt=this.shouldUseHLS(Dt),Vt=this.shouldUseDASH(Dt),Qt=this.shouldUseFLV(Dt);if(!(Dt instanceof Array||(0,it.isMediaStream)(Dt)||Mt||Vt||Qt))return Pt.test(Dt)?Dt.replace("www.dropbox.com","dl.dropboxusercontent.com"):Dt}},{key:"render",value:function(){var Dt=this.props,Mt=Dt.url,Vt=Dt.playing,Qt=Dt.loop,rn=Dt.controls,Xt=Dt.muted,an=Dt.config,tn=Dt.width,pn=Dt.height,vn=this.shouldUseAudio(this.props),sn=vn?"audio":"video",Zt={width:tn==="auto"?tn:"100%",height:pn==="auto"?pn:"100%"};return nt.default.createElement(sn,st({ref:this.ref,src:this.getSource(Mt),style:Zt,preload:"auto",autoPlay:Vt||void 0,controls:rn,muted:Xt,loop:Qt},an.attributes),Mt instanceof Array&&Mt.map(this.renderSourceElement),an.tracks.map(this.renderTrack))}}]),Ot}(nt.Component);tt.default=Rt,wt(Rt,"displayName","FilePlayer"),wt(Rt,"canPlay",rt.canPlay.file)}(FilePlayer)),FilePlayer}(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var et=reactExports,nt=utils,it=patterns;function rt(lt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rt=function(ut){return typeof ut}:rt=function(ut){return ut&&typeof Symbol=="function"&&ut.constructor===Symbol&&ut!==Symbol.prototype?"symbol":typeof ut},rt(lt)}function ot(){if(typeof WeakMap!="function")return null;var lt=new WeakMap;return ot=function(){return lt},lt}function at(lt){if(lt&<.__esModule)return lt;if(lt===null||rt(lt)!=="object"&&typeof lt!="function")return{default:lt};var ct=ot();if(ct&&ct.has(lt))return ct.get(lt);var ut={},ht=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var dt in lt)if(Object.prototype.hasOwnProperty.call(lt,dt)){var pt=ht?Object.getOwnPropertyDescriptor(lt,dt):null;pt&&(pt.get||pt.set)?Object.defineProperty(ut,dt,pt):ut[dt]=lt[dt]}return ut.default=lt,ct&&ct.set(lt,ut),ut}var st=[{key:"youtube",name:"YouTube",canPlay:it.canPlay.youtube,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireYouTube())})})},{key:"soundcloud",name:"SoundCloud",canPlay:it.canPlay.soundcloud,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireSoundCloud())})})},{key:"vimeo",name:"Vimeo",canPlay:it.canPlay.vimeo,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireVimeo())})})},{key:"facebook",name:"Facebook",canPlay:it.canPlay.facebook,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireFacebook())})})},{key:"streamable",name:"Streamable",canPlay:it.canPlay.streamable,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireStreamable())})})},{key:"wistia",name:"Wistia",canPlay:it.canPlay.wistia,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireWistia())})})},{key:"twitch",name:"Twitch",canPlay:it.canPlay.twitch,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireTwitch())})})},{key:"dailymotion",name:"DailyMotion",canPlay:it.canPlay.dailymotion,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireDailyMotion())})})},{key:"mixcloud",name:"Mixcloud",canPlay:it.canPlay.mixcloud,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireMixcloud())})})},{key:"vidyard",name:"Vidyard",canPlay:it.canPlay.vidyard,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireVidyard())})})},{key:"kaltura",name:"Kaltura",canPlay:it.canPlay.kaltura,lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireKaltura())})})},{key:"file",name:"FilePlayer",canPlay:it.canPlay.file,canEnablePIP:function(ct){return it.canPlay.file(ct)&&(document.pictureInPictureEnabled||(0,nt.supportsWebKitPresentationMode)())&&!it.AUDIO_EXTENSIONS.test(ct)},lazyPlayer:(0,et.lazy)(function(){return Promise.resolve().then(function(){return at(requireFilePlayer())})})}];tt.default=st})(players);var ReactPlayer$1={},safeIsNaN=Number.isNaN||function tt(et){return typeof et=="number"&&et!==et};function isEqual(tt,et){return!!(tt===et||safeIsNaN(tt)&&safeIsNaN(et))}function areInputsEqual(tt,et){if(tt.length!==et.length)return!1;for(var nt=0;nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function vt(It){return vt=Object.setPrototypeOf?Object.getPrototypeOf:function($t){return $t.__proto__||Object.getPrototypeOf($t)},vt(It)}function xt(It,Tt,$t){return Tt in It?Object.defineProperty(It,Tt,{value:$t,enumerable:!0,configurable:!0,writable:!0}):It[Tt]=$t,It}var St=5e3,Et=function(It){pt($t,It);var Tt=gt($t);function $t(){var Ut;ut(this,$t);for(var Lt=arguments.length,Bt=new Array(Lt),Pt=0;Pt0&&Lt<1;if(At){var Rt=this.player.getDuration();if(!Rt){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(Rt*Lt,Pt);return}this.player.seekTo(Lt,Pt)}},{key:"render",value:function(){var Lt=this.props.activePlayer;return Lt?nt.default.createElement(Lt,ct({},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}(nt.Component);tt.default=Et,xt(Et,"displayName","Player"),xt(Et,"propTypes",rt.propTypes),xt(Et,"defaultProps",rt.defaultProps)})(Player);var Preview$1={},hasRequiredPreview;function requirePreview(){return hasRequiredPreview||(hasRequiredPreview=1,function(tt){function et(St){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?et=function(It){return typeof It}:et=function(It){return It&&typeof Symbol=="function"&&It.constructor===Symbol&&It!==Symbol.prototype?"symbol":typeof It},et(St)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var nt=rt(reactExports);function it(){if(typeof WeakMap!="function")return null;var St=new WeakMap;return it=function(){return St},St}function rt(St){if(St&&St.__esModule)return St;if(St===null||et(St)!=="object"&&typeof St!="function")return{default:St};var Et=it();if(Et&&Et.has(St))return Et.get(St);var It={},Tt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $t in St)if(Object.prototype.hasOwnProperty.call(St,$t)){var Ut=Tt?Object.getOwnPropertyDescriptor(St,$t):null;Ut&&(Ut.get||Ut.set)?Object.defineProperty(It,$t,Ut):It[$t]=St[$t]}return It.default=St,Et&&Et.set(St,It),It}function ot(St,Et){var It=Object.keys(St);if(Object.getOwnPropertySymbols){var Tt=Object.getOwnPropertySymbols(St);Et&&(Tt=Tt.filter(function($t){return Object.getOwnPropertyDescriptor(St,$t).enumerable})),It.push.apply(It,Tt)}return It}function at(St){for(var Et=1;Et"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function bt(St){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(It){return It.__proto__||Object.getPrototypeOf(It)},bt(St)}function yt(St,Et,It){return Et in St?Object.defineProperty(St,Et,{value:It,enumerable:!0,configurable:!0,writable:!0}):St[Et]=It,St}var wt="64px",vt={},xt=function(St){ut(It,St);var Et=dt(It);function It(){var Tt;st(this,It);for(var $t=arguments.length,Ut=new Array($t),Lt=0;Lt<$t;Lt++)Ut[Lt]=arguments[Lt];return Tt=Et.call.apply(Et,[this].concat(Ut)),yt(mt(Tt),"mounted",!1),yt(mt(Tt),"state",{image:null}),yt(mt(Tt),"handleKeyPress",function(Bt){(Bt.key==="Enter"||Bt.key===" ")&&Tt.props.onClick()}),Tt}return ct(It,[{key:"componentDidMount",value:function(){this.mounted=!0,this.fetchImage(this.props)}},{key:"componentDidUpdate",value:function($t){var Ut=this.props,Lt=Ut.url,Bt=Ut.light;($t.url!==Lt||$t.light!==Bt)&&this.fetchImage(this.props)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"fetchImage",value:function($t){var Ut=this,Lt=$t.url,Bt=$t.light,Pt=$t.oEmbedUrl;if(!nt.default.isValidElement(Bt)){if(typeof Bt=="string"){this.setState({image:Bt});return}if(vt[Lt]){this.setState({image:vt[Lt]});return}return this.setState({image:null}),window.fetch(Pt.replace("{url}",Lt)).then(function(kt){return kt.json()}).then(function(kt){if(kt.thumbnail_url&&Ut.mounted){var At=kt.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");Ut.setState({image:At}),vt[Lt]=At}})}}},{key:"render",value:function(){var $t=this.props,Ut=$t.light,Lt=$t.onClick,Bt=$t.playIcon,Pt=$t.previewTabIndex,kt=this.state.image,At=nt.default.isValidElement(Ut),Rt={display:"flex",alignItems:"center",justifyContent:"center"},Wt={preview:at({width:"100%",height:"100%",backgroundImage:kt&&!At?"url(".concat(kt,")"):void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer"},Rt),shadow:at({background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:wt,width:wt,height:wt,position:At?"absolute":void 0},Rt),playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},jt=nt.default.createElement("div",{style:Wt.shadow,className:"react-player__shadow"},nt.default.createElement("div",{style:Wt.playIcon,className:"react-player__play-icon"}));return nt.default.createElement("div",{style:Wt.preview,className:"react-player__preview",onClick:Lt,tabIndex:Pt,onKeyPress:this.handleKeyPress},At?Ut:null,Bt||jt)}}]),It}(nt.Component);tt.default=xt}(Preview$1)),Preview$1}Object.defineProperty(ReactPlayer$1,"__esModule",{value:!0});ReactPlayer$1.createReactPlayer=void 0;var _react=_interopRequireWildcard(reactExports),_deepmerge=_interopRequireDefault(cjs),_memoizeOne=_interopRequireDefault(require$$2),_reactFastCompare=_interopRequireDefault(reactFastCompare),_props=props,_utils=utils,_Player3=_interopRequireDefault(Player);function _interopRequireDefault(tt){return tt&&tt.__esModule?tt:{default:tt}}function _typeof(tt){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(nt){return typeof nt}:_typeof=function(nt){return nt&&typeof Symbol=="function"&&nt.constructor===Symbol&&nt!==Symbol.prototype?"symbol":typeof nt},_typeof(tt)}function ownKeys(tt,et){var nt=Object.keys(tt);if(Object.getOwnPropertySymbols){var it=Object.getOwnPropertySymbols(tt);et&&(it=it.filter(function(rt){return Object.getOwnPropertyDescriptor(tt,rt).enumerable})),nt.push.apply(nt,it)}return nt}function _objectSpread(tt){for(var et=1;ettt.length)&&(et=tt.length);for(var nt=0,it=new Array(et);nt"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _getPrototypeOf(tt){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(nt){return nt.__proto__||Object.getPrototypeOf(nt)},_getPrototypeOf(tt)}function _defineProperty(tt,et,nt){return et in tt?Object.defineProperty(tt,et,{value:nt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=nt,tt}function _getRequireWildcardCache(){if(typeof WeakMap!="function")return null;var tt=new WeakMap;return _getRequireWildcardCache=function(){return tt},tt}function _interopRequireWildcard(tt){if(tt&&tt.__esModule)return tt;if(tt===null||_typeof(tt)!=="object"&&typeof tt!="function")return{default:tt};var et=_getRequireWildcardCache();if(et&&et.has(tt))return et.get(tt);var nt={},it=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var rt in tt)if(Object.prototype.hasOwnProperty.call(tt,rt)){var ot=it?Object.getOwnPropertyDescriptor(tt,rt):null;ot&&(ot.get||ot.set)?Object.defineProperty(nt,rt,ot):nt[rt]=tt[rt]}return nt.default=tt,et&&et.set(tt,nt),nt}var Preview=(0,_react.lazy)(function(){return Promise.resolve().then(function(){return _interopRequireWildcard(requirePreview())})}),IS_BROWSER=typeof window<"u"&&window.document,IS_GLOBAL=typeof commonjsGlobal<"u"&&commonjsGlobal.window&&commonjsGlobal.window.document,SUPPORTED_PROPS=Object.keys(_props.propTypes),UniversalSuspense=IS_BROWSER||IS_GLOBAL?_react.Suspense:function(){return null},customPlayers=[],createReactPlayer=function tt(et,nt){var it,rt;return rt=it=function(ot){_inherits(st,ot);var at=_createSuper(st);function st(){var lt;_classCallCheck(this,st);for(var ct=arguments.length,ut=new Array(ct),ht=0;ht0&&arguments[0]!==void 0?arguments[0]:"player";return lt.player?lt.player.getInternalPlayer(dt):null}),_defineProperty(_assertThisInitialized(lt),"seekTo",function(dt,pt,mt){if(!lt.player)return null;lt.player.seekTo(dt,pt,mt)}),_defineProperty(_assertThisInitialized(lt),"handleReady",function(){lt.props.onReady(_assertThisInitialized(lt))}),_defineProperty(_assertThisInitialized(lt),"getActivePlayer",(0,_memoizeOne.default)(function(dt){for(var pt=0,mt=[].concat(customPlayers,_toConsumableArray(et));ptjsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 38 38",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Property 1=Pause Normal",children:jsxRuntimeExports.jsx("path",{id:"Pause",d:"M19 3C10.15 3 3 10.15 3 19C3 27.85 10.15 35 19 35C27.85 35 35 27.85 35 19C35 10.15 27.8 3 19 3ZM17.25 23.3C17.25 24.25 16.5 25.05 15.5 25.05C14.55 25.05 13.75 24.3 13.75 23.3V14.65C13.75 13.7 14.5 12.9 15.5 12.9C16.45 12.9 17.25 13.65 17.25 14.65V23.3ZM24.2 23.3C24.2 24.25 23.45 25.05 22.45 25.05C21.5 25.05 20.7 24.3 20.7 23.3V14.65C20.7 13.7 21.45 12.9 22.45 12.9C23.4 12.9 24.2 13.65 24.2 14.65V23.3Z",fill:"currentColor"})})}),VolumeIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"volume_up",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1483_75386",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1483_75386)",children:jsxRuntimeExports.jsx("path",{id:"volume_up_2",d:"M14.0384 20.1095V18.5595C15.4807 18.1005 16.6425 17.2672 17.5239 16.0595C18.4053 14.8518 18.8461 13.4903 18.8461 11.9749C18.8461 10.4595 18.4053 9.09799 17.5239 7.89031C16.6425 6.68261 15.4807 5.84927 14.0384 5.39031V3.84033C15.8999 4.33905 17.4165 5.33841 18.5883 6.83841C19.7601 8.33839 20.346 10.0506 20.346 11.9749C20.346 13.8993 19.7601 15.6114 18.5883 17.1114C17.4165 18.6114 15.8999 19.6108 14.0384 20.1095ZM3.65381 14.4999V9.49993H7.36531L11.6537 5.21153V18.7883L7.36531 14.4999H3.65381ZM14.0384 15.6537V8.29608C14.7127 8.66275 15.2339 9.17909 15.6018 9.84511C15.9698 10.5111 16.1537 11.2294 16.1537 11.9999C16.1537 12.7602 15.9682 13.4675 15.597 14.122C15.2259 14.7765 14.7063 15.2871 14.0384 15.6537Z",fill:"currentColor"})})]})}),secondsToMediaTime=tt=>{const et=Math.floor(tt/60),nt=Math.floor(tt%60),it=et.toString().padStart(2,"0"),rt=nt.toString().padStart(2,"0");return`${it}:${rt}`},Toolbar=({isPlaying:tt,setIsPlaying:et,playingTime:nt,duration:it,handleProgressChange:rt,handleVolumeChange:ot,hasError:at})=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(ProgressSlider,{"aria-label":"Small",max:it,onChange:rt,size:"small",value:nt}),at?jsxRuntimeExports.jsx(Wrapper$5,{className:"error-wrapper",children:"Error happened, please try later"}):jsxRuntimeExports.jsxs(Wrapper$5,{align:"center",direction:"row",children:[jsxRuntimeExports.jsx(Action,{onClick:et,size:"small",children:tt?jsxRuntimeExports.jsx(PauseIcon,{}):jsxRuntimeExports.jsx(PlayIcon,{})}),jsxRuntimeExports.jsxs(TimeStamp,{direction:"row",children:[jsxRuntimeExports.jsx("span",{children:secondsToMediaTime(nt)}),jsxRuntimeExports.jsx("span",{className:"separator",children:"/"}),jsxRuntimeExports.jsx("span",{className:"duration",children:secondsToMediaTime(it)})]}),jsxRuntimeExports.jsxs(VolumeControl,{direction:"row",px:9,children:[jsxRuntimeExports.jsx(Slider$1,{className:"volume-slider",defaultValue:.5,max:1,min:0,onChange:ot,size:"small",step:.1}),jsxRuntimeExports.jsx(VolumeIcon,{})]})]})]}),Wrapper$5=styled$4(Flex)` +`,MEDIA_TYPES=["clip","twitter_space","youtube"],_View=()=>{const tt=useSelectedNode(),[et]=useDataStore(rt=>[rt.showTeachMe]),[nt,it]=usePlayerStore(rt=>[rt.playingNode,rt.setPlayingNode]);if(reactExports.useEffect(()=>{MEDIA_TYPES.includes((tt==null?void 0:tt.node_type)||"")&&it(tt)},[it,tt,nt]),et)return jsxRuntimeExports.jsx(TeachMeText,{});switch(tt==null?void 0:tt.node_type){case"guest":return jsxRuntimeExports.jsx(Person,{});case"person":return jsxRuntimeExports.jsx(Person,{});case"data_series":return jsxRuntimeExports.jsx(Data,{});case"tribe_message":return jsxRuntimeExports.jsx(Messages,{});case"tweet":return jsxRuntimeExports.jsx(TwitData,{});case"topic":return jsxRuntimeExports.jsx(Topic,{});case"show":return jsxRuntimeExports.jsx(Show,{});case"youtube":return jsxRuntimeExports.jsx(YouTube,{});case"clip":return(tt==null?void 0:tt.type)==="youtube"?jsxRuntimeExports.jsx(YouTube,{}):jsxRuntimeExports.jsx(AudioClip,{});case"document":return jsxRuntimeExports.jsx(TextType,{});case"twitter_space":return jsxRuntimeExports.jsx(AudioClip,{});default:return null}},SelectedNodeView=reactExports.memo(_View),scriptRel="modulepreload",assetsURL=function(tt){return"/"+tt},seen={},__vitePreload=function tt(et,nt,it){if(!nt||nt.length===0)return et();const rt=document.getElementsByTagName("link");return Promise.all(nt.map(ot=>{if(ot=assetsURL(ot),ot in seen)return;seen[ot]=!0;const at=ot.endsWith(".css"),st=at?'[rel="stylesheet"]':"";if(!!it)for(let ut=rt.length-1;ut>=0;ut--){const ht=rt[ut];if(ht.href===ot&&(!at||ht.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${ot}"]${st}`))return;const ct=document.createElement("link");if(ct.rel=at?"stylesheet":scriptRel,at||(ct.as="script",ct.crossOrigin=""),ct.href=ot,document.head.appendChild(ct),at)return new Promise((ut,ht)=>{ct.addEventListener("load",ut),ct.addEventListener("error",()=>ht(new Error(`Unable to preload CSS for ${ot}`)))})})).then(()=>et()).catch(ot=>{const at=new Event("vite:preloadError",{cancelable:!0});if(at.payload=ot,window.dispatchEvent(at),!at.defaultPrevented)throw ot})};var loadScript=function tt(et,nt,it){var rt=document.head||document.getElementsByTagName("head")[0],ot=document.createElement("script");typeof nt=="function"&&(it=nt,nt={}),nt=nt||{},it=it||function(){},ot.type=nt.type||"text/javascript",ot.charset=nt.charset||"utf8",ot.async="async"in nt?!!nt.async:!0,ot.src=et,nt.attrs&&setAttributes(ot,nt.attrs),nt.text&&(ot.text=""+nt.text);var at="onload"in ot?stdOnEnd:ieOnEnd;at(ot,it),ot.onload||stdOnEnd(ot,it),rt.appendChild(ot)};function setAttributes(tt,et){for(var nt in et)tt.setAttribute(nt,et[nt])}function stdOnEnd(tt,et){tt.onload=function(){this.onerror=this.onload=null,et(null,tt)},tt.onerror=function(){this.onerror=this.onload=null,et(new Error("Failed to load "+this.src),tt)}}function ieOnEnd(tt,et){tt.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,et(null,tt))}}var isMergeableObject=function tt(et){return isNonNullObject(et)&&!isSpecial(et)};function isNonNullObject(tt){return!!tt&&typeof tt=="object"}function isSpecial(tt){var et=Object.prototype.toString.call(tt);return et==="[object RegExp]"||et==="[object Date]"||isReactElement(tt)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(tt){return tt.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(tt){return Array.isArray(tt)?[]:{}}function cloneUnlessOtherwiseSpecified(tt,et){return et.clone!==!1&&et.isMergeableObject(tt)?deepmerge(emptyTarget(tt),tt,et):tt}function defaultArrayMerge(tt,et,nt){return tt.concat(et).map(function(it){return cloneUnlessOtherwiseSpecified(it,nt)})}function getMergeFunction(tt,et){if(!et.customMerge)return deepmerge;var nt=et.customMerge(tt);return typeof nt=="function"?nt:deepmerge}function getEnumerableOwnPropertySymbols(tt){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(tt).filter(function(et){return Object.propertyIsEnumerable.call(tt,et)}):[]}function getKeys(tt){return Object.keys(tt).concat(getEnumerableOwnPropertySymbols(tt))}function propertyIsOnObject(tt,et){try{return et in tt}catch{return!1}}function propertyIsUnsafe(tt,et){return propertyIsOnObject(tt,et)&&!(Object.hasOwnProperty.call(tt,et)&&Object.propertyIsEnumerable.call(tt,et))}function mergeObject(tt,et,nt){var it={};return nt.isMergeableObject(tt)&&getKeys(tt).forEach(function(rt){it[rt]=cloneUnlessOtherwiseSpecified(tt[rt],nt)}),getKeys(et).forEach(function(rt){propertyIsUnsafe(tt,rt)||(propertyIsOnObject(tt,rt)&&nt.isMergeableObject(et[rt])?it[rt]=getMergeFunction(rt,nt)(tt[rt],et[rt],nt):it[rt]=cloneUnlessOtherwiseSpecified(et[rt],nt))}),it}function deepmerge(tt,et,nt){nt=nt||{},nt.arrayMerge=nt.arrayMerge||defaultArrayMerge,nt.isMergeableObject=nt.isMergeableObject||isMergeableObject,nt.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var it=Array.isArray(et),rt=Array.isArray(tt),ot=it===rt;return ot?it?nt.arrayMerge(tt,et,nt):mergeObject(tt,et,nt):cloneUnlessOtherwiseSpecified(et,nt)}deepmerge.all=function tt(et,nt){if(!Array.isArray(et))throw new Error("first argument should be an array");return et.reduce(function(it,rt){return deepmerge(it,rt,nt)},{})};var deepmerge_1=deepmerge,cjs$1=deepmerge_1,__create$4=Object.create,__defProp$6=Object.defineProperty,__getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__getOwnPropNames$6=Object.getOwnPropertyNames,__getProtoOf$4=Object.getPrototypeOf,__hasOwnProp$6=Object.prototype.hasOwnProperty,__export$6=(tt,et)=>{for(var nt in et)__defProp$6(tt,nt,{get:et[nt],enumerable:!0})},__copyProps$6=(tt,et,nt,it)=>{if(et&&typeof et=="object"||typeof et=="function")for(let rt of __getOwnPropNames$6(et))!__hasOwnProp$6.call(tt,rt)&&rt!==nt&&__defProp$6(tt,rt,{get:()=>et[rt],enumerable:!(it=__getOwnPropDesc$6(et,rt))||it.enumerable});return tt},__toESM$4=(tt,et,nt)=>(nt=tt!=null?__create$4(__getProtoOf$4(tt)):{},__copyProps$6(et||!tt||!tt.__esModule?__defProp$6(nt,"default",{value:tt,enumerable:!0}):nt,tt)),__toCommonJS$6=tt=>__copyProps$6(__defProp$6({},"__esModule",{value:!0}),tt),utils_exports={};__export$6(utils_exports,{callPlayer:()=>callPlayer,getConfig:()=>getConfig,getSDK:()=>getSDK,isBlobUrl:()=>isBlobUrl,isMediaStream:()=>isMediaStream,lazy:()=>lazy,omit:()=>omit,parseEndTime:()=>parseEndTime,parseStartTime:()=>parseStartTime,queryString:()=>queryString,randomString:()=>randomString,supportsWebKitPresentationMode:()=>supportsWebKitPresentationMode});var utils=__toCommonJS$6(utils_exports),import_react$2=__toESM$4(reactExports),import_load_script=__toESM$4(loadScript),import_deepmerge$1=__toESM$4(cjs$1);const lazy=tt=>import_react$2.default.lazy(async()=>{const et=await tt();return typeof et.default=="function"?et:et.default}),MATCH_START_QUERY=/[?&#](?:start|t)=([0-9hms]+)/,MATCH_END_QUERY=/[?&#]end=([0-9hms]+)/,MATCH_START_STAMP=/(\d+)(h|m|s)/g,MATCH_NUMERIC=/^\d+$/;function parseTimeParam(tt,et){if(tt instanceof Array)return;const nt=tt.match(et);if(nt){const it=nt[1];if(it.match(MATCH_START_STAMP))return parseTimeString(it);if(MATCH_NUMERIC.test(it))return parseInt(it)}}function parseTimeString(tt){let et=0,nt=MATCH_START_STAMP.exec(tt);for(;nt!==null;){const[,it,rt]=nt;rt==="h"&&(et+=parseInt(it,10)*60*60),rt==="m"&&(et+=parseInt(it,10)*60),rt==="s"&&(et+=parseInt(it,10)),nt=MATCH_START_STAMP.exec(tt)}return et}function parseStartTime(tt){return parseTimeParam(tt,MATCH_START_QUERY)}function parseEndTime(tt){return parseTimeParam(tt,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(tt){return Object.keys(tt).map(et=>`${et}=${tt[et]}`).join("&")}function getGlobal(tt){return window[tt]?window[tt]:window.exports&&window.exports[tt]?window.exports[tt]:window.module&&window.module.exports&&window.module.exports[tt]?window.module.exports[tt]:null}const requests={},getSDK=function tt(et,nt,it=null,rt=()=>!0,ot=import_load_script.default){const at=getGlobal(nt);return at&&rt(at)?Promise.resolve(at):new Promise((st,lt)=>{if(requests[et]){requests[et].push({resolve:st,reject:lt});return}requests[et]=[{resolve:st,reject:lt}];const ct=ut=>{requests[et].forEach(ht=>ht.resolve(ut))};if(it){const ut=window[it];window[it]=function(){ut&&ut(),ct(getGlobal(nt))}}ot(et,ut=>{ut?(requests[et].forEach(ht=>ht.reject(ut)),requests[et]=null):it||ct(getGlobal(nt))})})};function getConfig(tt,et){return(0,import_deepmerge$1.default)(et.config,tt.config)}function omit(tt,...et){const nt=[].concat(...et),it={},rt=Object.keys(tt);for(const ot of rt)nt.indexOf(ot)===-1&&(it[ot]=tt[ot]);return it}function callPlayer(tt,...et){if(!this.player||!this.player[tt]){let nt=`ReactPlayer: ${this.constructor.displayName} player could not call %c${tt}%c – `;return this.player?this.player[tt]||(nt+="The method was not available"):nt+="The player was not available",console.warn(nt,"font-weight: bold",""),null}return this.player[tt](...et)}function isMediaStream(tt){return typeof window<"u"&&typeof window.MediaStream<"u"&&tt instanceof window.MediaStream}function isBlobUrl(tt){return/^blob:/.test(tt)}function supportsWebKitPresentationMode(tt=document.createElement("video")){const et=/iPhone|iPod/.test(navigator.userAgent)===!1;return tt.webkitSupportsPresentationMode&&typeof tt.webkitSetPresentationMode=="function"&&et}function enableStubOn(tt){return tt}var __defProp$5=Object.defineProperty,__getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__getOwnPropNames$5=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__export$5=(tt,et)=>{for(var nt in et)__defProp$5(tt,nt,{get:et[nt],enumerable:!0})},__copyProps$5=(tt,et,nt,it)=>{if(et&&typeof et=="object"||typeof et=="function")for(let rt of __getOwnPropNames$5(et))!__hasOwnProp$5.call(tt,rt)&&rt!==nt&&__defProp$5(tt,rt,{get:()=>et[rt],enumerable:!(it=__getOwnPropDesc$5(et,rt))||it.enumerable});return tt},__toCommonJS$5=tt=>__copyProps$5(__defProp$5({},"__esModule",{value:!0}),tt),patterns_exports={};__export$5(patterns_exports,{AUDIO_EXTENSIONS:()=>AUDIO_EXTENSIONS,DASH_EXTENSIONS:()=>DASH_EXTENSIONS,FLV_EXTENSIONS:()=>FLV_EXTENSIONS,HLS_EXTENSIONS:()=>HLS_EXTENSIONS,MATCH_URL_DAILYMOTION:()=>MATCH_URL_DAILYMOTION,MATCH_URL_FACEBOOK:()=>MATCH_URL_FACEBOOK,MATCH_URL_FACEBOOK_WATCH:()=>MATCH_URL_FACEBOOK_WATCH,MATCH_URL_KALTURA:()=>MATCH_URL_KALTURA,MATCH_URL_MIXCLOUD:()=>MATCH_URL_MIXCLOUD,MATCH_URL_SOUNDCLOUD:()=>MATCH_URL_SOUNDCLOUD,MATCH_URL_STREAMABLE:()=>MATCH_URL_STREAMABLE,MATCH_URL_TWITCH_CHANNEL:()=>MATCH_URL_TWITCH_CHANNEL,MATCH_URL_TWITCH_VIDEO:()=>MATCH_URL_TWITCH_VIDEO,MATCH_URL_VIDYARD:()=>MATCH_URL_VIDYARD,MATCH_URL_VIMEO:()=>MATCH_URL_VIMEO,MATCH_URL_WISTIA:()=>MATCH_URL_WISTIA,MATCH_URL_YOUTUBE:()=>MATCH_URL_YOUTUBE,VIDEO_EXTENSIONS:()=>VIDEO_EXTENSIONS,canPlay:()=>canPlay});var patterns=__toCommonJS$5(patterns_exports),import_utils$3=utils;const MATCH_URL_YOUTUBE=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,MATCH_URL_SOUNDCLOUD=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,MATCH_URL_VIMEO=/vimeo\.com\/(?!progressive_redirect).+/,MATCH_URL_FACEBOOK=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,MATCH_URL_FACEBOOK_WATCH=/^https?:\/\/fb\.watch\/.+$/,MATCH_URL_STREAMABLE=/streamable\.com\/([a-z0-9]+)$/,MATCH_URL_WISTIA=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,MATCH_URL_TWITCH_VIDEO=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,MATCH_URL_TWITCH_CHANNEL=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,MATCH_URL_DAILYMOTION=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,MATCH_URL_MIXCLOUD=/mixcloud\.com\/([^/]+\/[^/]+)/,MATCH_URL_VIDYARD=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,MATCH_URL_KALTURA=/^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-_].*)$/,AUDIO_EXTENSIONS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,VIDEO_EXTENSIONS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,HLS_EXTENSIONS=/\.(m3u8)($|\?)/i,DASH_EXTENSIONS=/\.(mpd)($|\?)/i,FLV_EXTENSIONS=/\.(flv)($|\?)/i,canPlayFile=tt=>{if(tt instanceof Array){for(const et of tt)if(typeof et=="string"&&canPlayFile(et)||canPlayFile(et.src))return!0;return!1}return(0,import_utils$3.isMediaStream)(tt)||(0,import_utils$3.isBlobUrl)(tt)?!0:AUDIO_EXTENSIONS.test(tt)||VIDEO_EXTENSIONS.test(tt)||HLS_EXTENSIONS.test(tt)||DASH_EXTENSIONS.test(tt)||FLV_EXTENSIONS.test(tt)},canPlay={youtube:tt=>tt instanceof Array?tt.every(et=>MATCH_URL_YOUTUBE.test(et)):MATCH_URL_YOUTUBE.test(tt),soundcloud:tt=>MATCH_URL_SOUNDCLOUD.test(tt)&&!AUDIO_EXTENSIONS.test(tt),vimeo:tt=>MATCH_URL_VIMEO.test(tt)&&!VIDEO_EXTENSIONS.test(tt)&&!HLS_EXTENSIONS.test(tt),facebook:tt=>MATCH_URL_FACEBOOK.test(tt)||MATCH_URL_FACEBOOK_WATCH.test(tt),streamable:tt=>MATCH_URL_STREAMABLE.test(tt),wistia:tt=>MATCH_URL_WISTIA.test(tt),twitch:tt=>MATCH_URL_TWITCH_VIDEO.test(tt)||MATCH_URL_TWITCH_CHANNEL.test(tt),dailymotion:tt=>MATCH_URL_DAILYMOTION.test(tt),mixcloud:tt=>MATCH_URL_MIXCLOUD.test(tt),vidyard:tt=>MATCH_URL_VIDYARD.test(tt),kaltura:tt=>MATCH_URL_KALTURA.test(tt),file:canPlayFile};var __defProp$4=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__getOwnPropNames$4=Object.getOwnPropertyNames,__hasOwnProp$4=Object.prototype.hasOwnProperty,__export$4=(tt,et)=>{for(var nt in et)__defProp$4(tt,nt,{get:et[nt],enumerable:!0})},__copyProps$4=(tt,et,nt,it)=>{if(et&&typeof et=="object"||typeof et=="function")for(let rt of __getOwnPropNames$4(et))!__hasOwnProp$4.call(tt,rt)&&rt!==nt&&__defProp$4(tt,rt,{get:()=>et[rt],enumerable:!(it=__getOwnPropDesc$4(et,rt))||it.enumerable});return tt},__toCommonJS$4=tt=>__copyProps$4(__defProp$4({},"__esModule",{value:!0}),tt),players_exports={};__export$4(players_exports,{default:()=>players_default});var players=__toCommonJS$4(players_exports),import_utils$2=utils,import_patterns=patterns,players_default=[{key:"youtube",name:"YouTube",canPlay:import_patterns.canPlay.youtube,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./YouTube-bdb5f19a.js").then(tt=>tt.Y),[]))},{key:"soundcloud",name:"SoundCloud",canPlay:import_patterns.canPlay.soundcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./SoundCloud-69b8b3fa.js").then(tt=>tt.S),[]))},{key:"vimeo",name:"Vimeo",canPlay:import_patterns.canPlay.vimeo,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vimeo-308f3829.js").then(tt=>tt.V),[]))},{key:"facebook",name:"Facebook",canPlay:import_patterns.canPlay.facebook,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Facebook-3861963e.js").then(tt=>tt.F),[]))},{key:"streamable",name:"Streamable",canPlay:import_patterns.canPlay.streamable,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Streamable-97944a29.js").then(tt=>tt.S),[]))},{key:"wistia",name:"Wistia",canPlay:import_patterns.canPlay.wistia,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Wistia-8102eb9f.js").then(tt=>tt.W),[]))},{key:"twitch",name:"Twitch",canPlay:import_patterns.canPlay.twitch,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Twitch-a814064e.js").then(tt=>tt.T),[]))},{key:"dailymotion",name:"DailyMotion",canPlay:import_patterns.canPlay.dailymotion,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./DailyMotion-8bcd7fa5.js").then(tt=>tt.D),[]))},{key:"mixcloud",name:"Mixcloud",canPlay:import_patterns.canPlay.mixcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mixcloud-b5d9ccb9.js").then(tt=>tt.M),[]))},{key:"vidyard",name:"Vidyard",canPlay:import_patterns.canPlay.vidyard,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vidyard-fc7804c3.js").then(tt=>tt.V),[]))},{key:"kaltura",name:"Kaltura",canPlay:import_patterns.canPlay.kaltura,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Kaltura-2acfad14.js").then(tt=>tt.K),[]))},{key:"file",name:"FilePlayer",canPlay:import_patterns.canPlay.file,canEnablePIP:tt=>import_patterns.canPlay.file(tt)&&(document.pictureInPictureEnabled||(0,import_utils$2.supportsWebKitPresentationMode)())&&!import_patterns.AUDIO_EXTENSIONS.test(tt),lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./FilePlayer-9c0411e3.js").then(tt=>tt.F),[]))}],safeIsNaN=Number.isNaN||function tt(et){return typeof et=="number"&&et!==et};function isEqual(tt,et){return!!(tt===et||safeIsNaN(tt)&&safeIsNaN(et))}function areInputsEqual(tt,et){if(tt.length!==et.length)return!1;for(var nt=0;nt{for(var nt in et)__defProp$3(tt,nt,{get:et[nt],enumerable:!0})},__copyProps$3=(tt,et,nt,it)=>{if(et&&typeof et=="object"||typeof et=="function")for(let rt of __getOwnPropNames$3(et))!__hasOwnProp$3.call(tt,rt)&&rt!==nt&&__defProp$3(tt,rt,{get:()=>et[rt],enumerable:!(it=__getOwnPropDesc$3(et,rt))||it.enumerable});return tt},__toESM$3=(tt,et,nt)=>(nt=tt!=null?__create$3(__getProtoOf$3(tt)):{},__copyProps$3(et||!tt||!tt.__esModule?__defProp$3(nt,"default",{value:tt,enumerable:!0}):nt,tt)),__toCommonJS$3=tt=>__copyProps$3(__defProp$3({},"__esModule",{value:!0}),tt),props_exports={};__export$3(props_exports,{defaultProps:()=>defaultProps,propTypes:()=>propTypes});var props=__toCommonJS$3(props_exports),import_prop_types=__toESM$3(propTypesExports);const{string:string$2,bool,number:number$1,array,oneOfType,shape,object,func,node:node$1}=import_prop_types.default,propTypes={url:oneOfType([string$2,array,object]),playing:bool,loop:bool,controls:bool,volume:number$1,muted:bool,playbackRate:number$1,width:oneOfType([string$2,number$1]),height:oneOfType([string$2,number$1]),style:object,progressInterval:number$1,playsinline:bool,pip:bool,stopOnUnmount:bool,light:oneOfType([bool,string$2,object]),playIcon:node$1,previewTabIndex:number$1,fallback:node$1,oEmbedUrl:string$2,wrapper:oneOfType([string$2,func,shape({render:func.isRequired})]),config:shape({soundcloud:shape({options:object}),youtube:shape({playerVars:object,embedOptions:object,onUnstarted:func}),facebook:shape({appId:string$2,version:string$2,playerId:string$2,attributes:object}),dailymotion:shape({params:object}),vimeo:shape({playerOptions:object,title:string$2}),file:shape({attributes:object,tracks:array,forceVideo:bool,forceAudio:bool,forceHLS:bool,forceSafariHLS:bool,forceDisableHls:bool,forceDASH:bool,forceFLV:bool,hlsOptions:object,hlsVersion:string$2,dashVersion:string$2,flvVersion:string$2}),wistia:shape({options:object,playerId:string$2,customControls:array}),mixcloud:shape({options:object}),twitch:shape({options:object,playerId:string$2}),vidyard:shape({options:object})}),onReady:func,onStart:func,onPlay:func,onPause:func,onBuffer:func,onBufferEnd:func,onEnded:func,onError:func,onDuration:func,onSeek:func,onPlaybackRateChange:func,onPlaybackQualityChange:func,onProgress:func,onClickPreview:func,onEnablePIP:func,onDisablePIP:func},noop=()=>{},defaultProps={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:noop},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:noop,onStart:noop,onPlay:noop,onPause:noop,onBuffer:noop,onBufferEnd:noop,onEnded:noop,onError:noop,onDuration:noop,onSeek:noop,onPlaybackRateChange:noop,onPlaybackQualityChange:noop,onProgress:noop,onClickPreview:noop,onEnablePIP:noop,onDisablePIP:noop};var __create$2=Object.create,__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__getOwnPropNames$2=Object.getOwnPropertyNames,__getProtoOf$2=Object.getPrototypeOf,__hasOwnProp$2=Object.prototype.hasOwnProperty,__defNormalProp$1=(tt,et,nt)=>et in tt?__defProp$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):tt[et]=nt,__export$2=(tt,et)=>{for(var nt in et)__defProp$2(tt,nt,{get:et[nt],enumerable:!0})},__copyProps$2=(tt,et,nt,it)=>{if(et&&typeof et=="object"||typeof et=="function")for(let rt of __getOwnPropNames$2(et))!__hasOwnProp$2.call(tt,rt)&&rt!==nt&&__defProp$2(tt,rt,{get:()=>et[rt],enumerable:!(it=__getOwnPropDesc$2(et,rt))||it.enumerable});return tt},__toESM$2=(tt,et,nt)=>(nt=tt!=null?__create$2(__getProtoOf$2(tt)):{},__copyProps$2(et||!tt||!tt.__esModule?__defProp$2(nt,"default",{value:tt,enumerable:!0}):nt,tt)),__toCommonJS$2=tt=>__copyProps$2(__defProp$2({},"__esModule",{value:!0}),tt),__publicField$1=(tt,et,nt)=>(__defNormalProp$1(tt,typeof et!="symbol"?et+"":et,nt),nt),Player_exports={};__export$2(Player_exports,{default:()=>Player});var Player_1=__toCommonJS$2(Player_exports),import_react$1=__toESM$2(reactExports),import_react_fast_compare$1=__toESM$2(reactFastCompare),import_props$1=props,import_utils$1=utils;const SEEK_ON_PLAY_EXPIRY=5e3;class Player extends import_react$1.Component{constructor(){super(...arguments),__publicField$1(this,"mounted",!1),__publicField$1(this,"isReady",!1),__publicField$1(this,"isPlaying",!1),__publicField$1(this,"isLoading",!0),__publicField$1(this,"loadOnReady",null),__publicField$1(this,"startOnPlay",!0),__publicField$1(this,"seekOnPlay",null),__publicField$1(this,"onDurationCalled",!1),__publicField$1(this,"handlePlayerMount",et=>{if(this.player){this.progress();return}this.player=et,this.player.load(this.props.url),this.progress()}),__publicField$1(this,"getInternalPlayer",et=>this.player?this.player[et]:null),__publicField$1(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const et=this.getCurrentTime()||0,nt=this.getSecondsLoaded(),it=this.getDuration();if(it){const rt={playedSeconds:et,played:et/it};nt!==null&&(rt.loadedSeconds=nt,rt.loaded=nt/it),(rt.playedSeconds!==this.prevPlayed||rt.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(rt),this.prevPlayed=rt.playedSeconds,this.prevLoaded=rt.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),__publicField$1(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:et,playing:nt,volume:it,muted:rt}=this.props;et(),!rt&&it!==null&&this.player.setVolume(it),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):nt&&this.player.play(),this.handleDurationCheck()}),__publicField$1(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:et,onPlay:nt,playbackRate:it}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&it!==1&&this.player.setPlaybackRate(it),et(),this.startOnPlay=!1),nt(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),__publicField$1(this,"handlePause",et=>{this.isPlaying=!1,this.isLoading||this.props.onPause(et)}),__publicField$1(this,"handleEnded",()=>{const{activePlayer:et,loop:nt,onEnded:it}=this.props;et.loopOnEnded&&nt&&this.seekTo(0),nt||(this.isPlaying=!1,it())}),__publicField$1(this,"handleError",(...et)=>{this.isLoading=!1,this.props.onError(...et)}),__publicField$1(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const et=this.getDuration();et?this.onDurationCalled||(this.props.onDuration(et),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),__publicField$1(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(et){if(!this.player)return;const{url:nt,playing:it,volume:rt,muted:ot,playbackRate:at,pip:st,loop:lt,activePlayer:ct,disableDeferredLoading:ut}=this.props;if(!(0,import_react_fast_compare$1.default)(et.url,nt)){if(this.isLoading&&!ct.forceLoad&&!ut&&!(0,import_utils$1.isMediaStream)(nt)){console.warn(`ReactPlayer: the attempt to load ${nt} is being deferred until the player has loaded`),this.loadOnReady=nt;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(nt,this.isReady)}!et.playing&&it&&!this.isPlaying&&this.player.play(),et.playing&&!it&&this.isPlaying&&this.player.pause(),!et.pip&&st&&this.player.enablePIP&&this.player.enablePIP(),et.pip&&!st&&this.player.disablePIP&&this.player.disablePIP(),et.volume!==rt&&rt!==null&&this.player.setVolume(rt),et.muted!==ot&&(ot?this.player.mute():(this.player.unmute(),rt!==null&&setTimeout(()=>this.player.setVolume(rt)))),et.playbackRate!==at&&this.player.setPlaybackRate&&this.player.setPlaybackRate(at),et.loop!==lt&&this.player.setLoop&&this.player.setLoop(lt)}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(et,nt,it){if(!this.isReady){et!==0&&(this.seekOnPlay=et,setTimeout(()=>{this.seekOnPlay=null},SEEK_ON_PLAY_EXPIRY));return}if(nt?nt==="fraction":et>0&&et<1){const ot=this.player.getDuration();if(!ot){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(ot*et,it);return}this.player.seekTo(et,it)}render(){const et=this.props.activePlayer;return et?import_react$1.default.createElement(et,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}__publicField$1(Player,"displayName","Player");__publicField$1(Player,"propTypes",import_props$1.propTypes);__publicField$1(Player,"defaultProps",import_props$1.defaultProps);var __create$1=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__getProtoOf$1=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__defNormalProp=(tt,et,nt)=>et in tt?__defProp$1(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:nt}):tt[et]=nt,__export$1=(tt,et)=>{for(var nt in et)__defProp$1(tt,nt,{get:et[nt],enumerable:!0})},__copyProps$1=(tt,et,nt,it)=>{if(et&&typeof et=="object"||typeof et=="function")for(let rt of __getOwnPropNames$1(et))!__hasOwnProp$1.call(tt,rt)&&rt!==nt&&__defProp$1(tt,rt,{get:()=>et[rt],enumerable:!(it=__getOwnPropDesc$1(et,rt))||it.enumerable});return tt},__toESM$1=(tt,et,nt)=>(nt=tt!=null?__create$1(__getProtoOf$1(tt)):{},__copyProps$1(et||!tt||!tt.__esModule?__defProp$1(nt,"default",{value:tt,enumerable:!0}):nt,tt)),__toCommonJS$1=tt=>__copyProps$1(__defProp$1({},"__esModule",{value:!0}),tt),__publicField=(tt,et,nt)=>(__defNormalProp(tt,typeof et!="symbol"?et+"":et,nt),nt),ReactPlayer_exports={};__export$1(ReactPlayer_exports,{createReactPlayer:()=>createReactPlayer});var ReactPlayer$1=__toCommonJS$1(ReactPlayer_exports),import_react=__toESM$1(reactExports),import_deepmerge=__toESM$1(cjs$1),import_memoize_one=__toESM$1(require$$2),import_react_fast_compare=__toESM$1(reactFastCompare),import_props=props,import_utils=utils,import_Player=__toESM$1(Player_1);const Preview=(0,import_utils.lazy)(()=>__vitePreload(()=>import("./Preview-e1f6a083.js").then(tt=>tt.P),[])),IS_BROWSER=typeof window<"u"&&window.document,IS_GLOBAL=typeof commonjsGlobal<"u"&&commonjsGlobal.window&&commonjsGlobal.window.document,SUPPORTED_PROPS=Object.keys(import_props.propTypes),UniversalSuspense=IS_BROWSER||IS_GLOBAL?import_react.Suspense:()=>null,customPlayers=[],createReactPlayer=(tt,et)=>{var nt;return nt=class extends import_react.Component{constructor(){super(...arguments),__publicField(this,"state",{showPreview:!!this.props.light}),__publicField(this,"references",{wrapper:it=>{this.wrapper=it},player:it=>{this.player=it}}),__publicField(this,"handleClickPreview",it=>{this.setState({showPreview:!1}),this.props.onClickPreview(it)}),__publicField(this,"showPreview",()=>{this.setState({showPreview:!0})}),__publicField(this,"getDuration",()=>this.player?this.player.getDuration():null),__publicField(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),__publicField(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),__publicField(this,"getInternalPlayer",(it="player")=>this.player?this.player.getInternalPlayer(it):null),__publicField(this,"seekTo",(it,rt,ot)=>{if(!this.player)return null;this.player.seekTo(it,rt,ot)}),__publicField(this,"handleReady",()=>{this.props.onReady(this)}),__publicField(this,"getActivePlayer",(0,import_memoize_one.default)(it=>{for(const rt of[...customPlayers,...tt])if(rt.canPlay(it))return rt;return et||null})),__publicField(this,"getConfig",(0,import_memoize_one.default)((it,rt)=>{const{config:ot}=this.props;return import_deepmerge.default.all([import_props.defaultProps.config,import_props.defaultProps.config[rt]||{},ot,ot[rt]||{}])})),__publicField(this,"getAttributes",(0,import_memoize_one.default)(it=>(0,import_utils.omit)(this.props,SUPPORTED_PROPS))),__publicField(this,"renderActivePlayer",it=>{if(!it)return null;const rt=this.getActivePlayer(it);if(!rt)return null;const ot=this.getConfig(it,rt.key);return import_react.default.createElement(import_Player.default,{...this.props,key:rt.key,ref:this.references.player,config:ot,activePlayer:rt.lazyPlayer||rt,onReady:this.handleReady})})}shouldComponentUpdate(it,rt){return!(0,import_react_fast_compare.default)(this.props,it)||!(0,import_react_fast_compare.default)(this.state,rt)}componentDidUpdate(it){const{light:rt}=this.props;!it.light&&rt&&this.setState({showPreview:!0}),it.light&&!rt&&this.setState({showPreview:!1})}renderPreview(it){if(!it)return null;const{light:rt,playIcon:ot,previewTabIndex:at,oEmbedUrl:st}=this.props;return import_react.default.createElement(Preview,{url:it,light:rt,playIcon:ot,previewTabIndex:at,oEmbedUrl:st,onClick:this.handleClickPreview})}render(){const{url:it,style:rt,width:ot,height:at,fallback:st,wrapper:lt}=this.props,{showPreview:ct}=this.state,ut=this.getAttributes(it),ht=typeof lt=="string"?this.references.wrapper:void 0;return import_react.default.createElement(lt,{ref:ht,style:{...rt,width:ot,height:at},...ut},import_react.default.createElement(UniversalSuspense,{fallback:st},ct?this.renderPreview(it):this.renderActivePlayer(it)))}},__publicField(nt,"displayName","ReactPlayer"),__publicField(nt,"propTypes",import_props.propTypes),__publicField(nt,"defaultProps",import_props.defaultProps),__publicField(nt,"addCustomPlayer",it=>{customPlayers.push(it)}),__publicField(nt,"removeCustomPlayers",()=>{customPlayers.length=0}),__publicField(nt,"canPlay",it=>{for(const rt of[...customPlayers,...tt])if(rt.canPlay(it))return!0;return!1}),__publicField(nt,"canEnablePIP",it=>{for(const rt of[...customPlayers,...tt])if(rt.canEnablePIP&&rt.canEnablePIP(it))return!0;return!1}),nt};var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(tt,et)=>{for(var nt in et)__defProp(tt,nt,{get:et[nt],enumerable:!0})},__copyProps=(tt,et,nt,it)=>{if(et&&typeof et=="object"||typeof et=="function")for(let rt of __getOwnPropNames(et))!__hasOwnProp.call(tt,rt)&&rt!==nt&&__defProp(tt,rt,{get:()=>et[rt],enumerable:!(it=__getOwnPropDesc(et,rt))||it.enumerable});return tt},__toESM=(tt,et,nt)=>(nt=tt!=null?__create(__getProtoOf(tt)):{},__copyProps(et||!tt||!tt.__esModule?__defProp(nt,"default",{value:tt,enumerable:!0}):nt,tt)),__toCommonJS=tt=>__copyProps(__defProp({},"__esModule",{value:!0}),tt),src_exports={};__export(src_exports,{default:()=>src_default});var lib=__toCommonJS(src_exports),import_players=__toESM(players),import_ReactPlayer=ReactPlayer$1;const fallback=import_players.default[import_players.default.length-1];var src_default=(0,import_ReactPlayer.createReactPlayer)(import_players.default,fallback);const ReactPlayer=getDefaultExportFromCjs(lib),PauseIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 38 38",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Property 1=Pause Normal",children:jsxRuntimeExports.jsx("path",{id:"Pause",d:"M19 3C10.15 3 3 10.15 3 19C3 27.85 10.15 35 19 35C27.85 35 35 27.85 35 19C35 10.15 27.8 3 19 3ZM17.25 23.3C17.25 24.25 16.5 25.05 15.5 25.05C14.55 25.05 13.75 24.3 13.75 23.3V14.65C13.75 13.7 14.5 12.9 15.5 12.9C16.45 12.9 17.25 13.65 17.25 14.65V23.3ZM24.2 23.3C24.2 24.25 23.45 25.05 22.45 25.05C21.5 25.05 20.7 24.3 20.7 23.3V14.65C20.7 13.7 21.45 12.9 22.45 12.9C23.4 12.9 24.2 13.65 24.2 14.65V23.3Z",fill:"currentColor"})})}),VolumeIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"volume_up",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1483_75386",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1483_75386)",children:jsxRuntimeExports.jsx("path",{id:"volume_up_2",d:"M14.0384 20.1095V18.5595C15.4807 18.1005 16.6425 17.2672 17.5239 16.0595C18.4053 14.8518 18.8461 13.4903 18.8461 11.9749C18.8461 10.4595 18.4053 9.09799 17.5239 7.89031C16.6425 6.68261 15.4807 5.84927 14.0384 5.39031V3.84033C15.8999 4.33905 17.4165 5.33841 18.5883 6.83841C19.7601 8.33839 20.346 10.0506 20.346 11.9749C20.346 13.8993 19.7601 15.6114 18.5883 17.1114C17.4165 18.6114 15.8999 19.6108 14.0384 20.1095ZM3.65381 14.4999V9.49993H7.36531L11.6537 5.21153V18.7883L7.36531 14.4999H3.65381ZM14.0384 15.6537V8.29608C14.7127 8.66275 15.2339 9.17909 15.6018 9.84511C15.9698 10.5111 16.1537 11.2294 16.1537 11.9999C16.1537 12.7602 15.9682 13.4675 15.597 14.122C15.2259 14.7765 14.7063 15.2871 14.0384 15.6537Z",fill:"currentColor"})})]})}),secondsToMediaTime=tt=>{const et=Math.floor(tt/60),nt=Math.floor(tt%60),it=et.toString().padStart(2,"0"),rt=nt.toString().padStart(2,"0");return`${it}:${rt}`},Toolbar=({isPlaying:tt,setIsPlaying:et,playingTime:nt,duration:it,handleProgressChange:rt,handleVolumeChange:ot,hasError:at})=>jsxRuntimeExports.jsxs(Flex,{children:[jsxRuntimeExports.jsx(ProgressSlider,{"aria-label":"Small",max:it,onChange:rt,size:"small",value:nt}),at?jsxRuntimeExports.jsx(Wrapper$5,{className:"error-wrapper",children:"Error happened, please try later"}):jsxRuntimeExports.jsxs(Wrapper$5,{align:"center",direction:"row",children:[jsxRuntimeExports.jsx(Action,{onClick:et,size:"small",children:tt?jsxRuntimeExports.jsx(PauseIcon,{}):jsxRuntimeExports.jsx(PlayIcon,{})}),jsxRuntimeExports.jsxs(TimeStamp,{direction:"row",children:[jsxRuntimeExports.jsx("span",{children:secondsToMediaTime(nt)}),jsxRuntimeExports.jsx("span",{className:"separator",children:"/"}),jsxRuntimeExports.jsx("span",{className:"duration",children:secondsToMediaTime(it)})]}),jsxRuntimeExports.jsxs(VolumeControl,{direction:"row",px:9,children:[jsxRuntimeExports.jsx(Slider$1,{className:"volume-slider",defaultValue:.5,max:1,min:0,onChange:ot,size:"small",step:.1}),jsxRuntimeExports.jsx(VolumeIcon,{})]})]})]}),Wrapper$5=styled$4(Flex)` height: 60px; padding: 12px 16px; @@ -7383,7 +7378,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .duration { color: ${colors.GRAY6}; } -`,MediaPlayerComponent=({hidden:tt})=>{const et=reactExports.useRef(null),[nt,it]=reactExports.useState(!1),[rt,ot]=reactExports.useState(!1),[at,st,lt,ct,ut,ht,dt,pt,mt,gt,bt,yt]=usePlayerStore(Ut=>[Ut.isPlaying,Ut.playingTime,Ut.duration,Ut.setIsPlaying,Ut.setPlayingTime,Ut.setDuration,Ut.playingNode,Ut.volume,Ut.setVolume,Ut.hasError,Ut.setHasError,Ut.resetPlayer]);reactExports.useEffect(()=>()=>yt(),[yt]);const wt=()=>{ct(!at)},vt=()=>{ct(!0)},xt=()=>{ct(!1)},St=(Ut,Lt)=>{const Bt=Array.isArray(Lt)?Lt[0]:Lt;et.current&&(et.current.seekTo(Bt),ut(Bt))},Et=(Ut,Lt)=>{const Bt=Array.isArray(Lt)?Lt[0]:Lt;mt(Bt)},It=()=>{bt(!0)},Tt=Ut=>{const Lt=Ut.playedSeconds;ut(Lt)},$t=()=>{if(et.current){ot(!0);const Ut=et.current.getDuration();ht(Ut)}};return dt?jsxRuntimeExports.jsxs(Wrapper$4,{hidden:tt,children:[jsxRuntimeExports.jsx(Cover,{children:jsxRuntimeExports.jsx(Avatar$1,{size:120,src:(dt==null?void 0:dt.image_url)||"",type:"clip"})}),jsxRuntimeExports.jsx(ReactPlayer,{ref:et,controls:!1,height:"200px",onBuffer:()=>it(!0),onBufferEnd:()=>it(!1),onError:It,onPause:xt,onPlay:vt,onProgress:Tt,onReady:$t,playing:at,url:(dt==null?void 0:dt.link)||"",volume:pt,width:"100%"}),rt?jsxRuntimeExports.jsx(Toolbar,{duration:lt,handleProgressChange:St,handleVolumeChange:Et,hasError:gt,isPlaying:at,playingTime:st,setIsPlaying:wt}):null,nt||!rt?jsxRuntimeExports.jsx(Buffering,{children:jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.lightGray})}):null]}):null},Wrapper$4=styled$4(Flex)` +`,MediaPlayerComponent=({hidden:tt})=>{const et=reactExports.useRef(null),[nt,it]=reactExports.useState(!1),[rt,ot]=reactExports.useState(!1),[at,st,lt,ct,ut,ht,dt,pt,mt,gt,bt,yt]=usePlayerStore(Ht=>[Ht.isPlaying,Ht.playingTime,Ht.duration,Ht.setIsPlaying,Ht.setPlayingTime,Ht.setDuration,Ht.playingNode,Ht.volume,Ht.setVolume,Ht.hasError,Ht.setHasError,Ht.resetPlayer]);reactExports.useEffect(()=>()=>yt(),[yt]);const wt=()=>{ct(!at)},vt=()=>{ct(!0)},xt=()=>{ct(!1)},St=(Ht,zt)=>{const Ot=Array.isArray(zt)?zt[0]:zt;et.current&&(et.current.seekTo(Ot),ut(Ot))},Et=(Ht,zt)=>{const Ot=Array.isArray(zt)?zt[0]:zt;mt(Ot)},$t=()=>{bt(!0)},It=Ht=>{const zt=Ht.playedSeconds;ut(zt)},Ft=()=>{if(et.current){ot(!0);const Ht=et.current.getDuration();ht(Ht)}};return dt?jsxRuntimeExports.jsxs(Wrapper$4,{hidden:tt,children:[jsxRuntimeExports.jsx(Cover,{children:jsxRuntimeExports.jsx(Avatar$1,{size:120,src:(dt==null?void 0:dt.image_url)||"",type:"clip"})}),jsxRuntimeExports.jsx(ReactPlayer,{ref:et,controls:!1,height:"200px",onBuffer:()=>it(!0),onBufferEnd:()=>it(!1),onError:$t,onPause:xt,onPlay:vt,onProgress:It,onReady:Ft,playing:at,url:(dt==null?void 0:dt.link)||"",volume:pt,width:"100%"}),rt?jsxRuntimeExports.jsx(Toolbar,{duration:lt,handleProgressChange:St,handleVolumeChange:Et,hasError:gt,isPlaying:at,playingTime:st,setIsPlaying:wt}):null,nt||!rt?jsxRuntimeExports.jsx(Buffering,{children:jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.lightGray})}):null]}):null},Wrapper$4=styled$4(Flex)` border-bottom: 1px solid rgba(0, 0, 0, 0.25); background: rgba(0, 0, 0, 0.2); position: relative; @@ -7419,10 +7414,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } `,ScrollWrapper$1=styled$4(Flex)` flex: 1 1 100%; -`,CollapseButton$1=styled$4(Flex).attrs({align:"center",justify:"center",p:8})(({theme:tt})=>({backgroundColor:colors.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",right:"0px",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:colors.white,[tt.breakpoints.up("sm")]:{left:"100%"},"&:hover":{backgroundColor:colors.BG1_HOVER},"&:active":{backgroundColor:colors.BG1_PRESS,color:colors.GRAY6}})),ChevronRightIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"chevron_right",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1247_21809",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1247_21809)",children:jsxRuntimeExports.jsx("path",{id:"chevron_right_2",d:"M9.44998 8.99998L6.52498 6.07498C6.38748 5.93748 6.31873 5.76248 6.31873 5.54998C6.31873 5.33748 6.38748 5.16248 6.52498 5.02498C6.66248 4.88748 6.83748 4.81873 7.04998 4.81873C7.26248 4.81873 7.43748 4.88748 7.57498 5.02498L11.025 8.47498C11.1 8.54997 11.1531 8.63123 11.1844 8.71873C11.2156 8.80623 11.2312 8.89998 11.2312 8.99998C11.2312 9.09998 11.2156 9.19373 11.1844 9.28123C11.1531 9.36873 11.1 9.44998 11.025 9.52497L7.57498 12.975C7.43748 13.1125 7.26248 13.1812 7.04998 13.1812C6.83748 13.1812 6.66248 13.1125 6.52498 12.975C6.38748 12.8375 6.31873 12.6625 6.31873 12.45C6.31873 12.2375 6.38748 12.0625 6.52498 11.925L9.44998 8.99998Z",fill:"currentColor"})})]})}),Tab=()=>{const tt=useAppStore(et=>et.setSidebarOpen);return jsxRuntimeExports.jsx(ExpandButton,{onClick:()=>{tt(!0)},children:jsxRuntimeExports.jsx(ChevronRightIcon,{})})},ExpandButton=styled$4(Flex).attrs({align:"center",justify:"center",p:8})(({theme:tt})=>({backgroundColor:colors.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:colors.white,[tt.breakpoints.up("sm")]:{left:"64px"},"&:hover":{backgroundColor:colors.BG1_HOVER},"&:active":{backgroundColor:colors.BG1_PRESS,color:colors.GRAY6}})),PlusIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 21 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_3553_6463",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"21",height:"20",children:jsxRuntimeExports.jsx("rect",{x:"0.5",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_3553_6463)",children:jsxRuntimeExports.jsx("path",{d:"M9.87516 10.625H5.7085C5.53141 10.625 5.38298 10.5651 5.26318 10.4453C5.14339 10.3254 5.0835 10.1769 5.0835 9.99975C5.0835 9.82258 5.14339 9.67417 5.26318 9.55452C5.38298 9.43487 5.53141 9.37504 5.7085 9.37504H9.87516V5.20837C9.87516 5.03129 9.93508 4.88285 10.0549 4.76306C10.1748 4.64327 10.3233 4.58337 10.5004 4.58337C10.6776 4.58337 10.826 4.64327 10.9456 4.76306C11.0653 4.88285 11.1251 5.03129 11.1251 5.20837V9.37504H15.2918C15.4689 9.37504 15.6173 9.43496 15.7371 9.55479C15.8569 9.67464 15.9168 9.82314 15.9168 10.0003C15.9168 10.1775 15.8569 10.3259 15.7371 10.4455C15.6173 10.5652 15.4689 10.625 15.2918 10.625H11.1251V14.7917C11.1251 14.9688 11.0652 15.1172 10.9454 15.237C10.8255 15.3568 10.677 15.4167 10.4999 15.4167C10.3227 15.4167 10.1743 15.3568 10.0546 15.237C9.93499 15.1172 9.87516 14.9688 9.87516 14.7917V10.625Z",fill:"currentColor"})})]}),SentimentDataIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_28",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_28)",children:jsxRuntimeExports.jsx("path",{d:"M3 20.75L2.91345 19.4327L4.74998 17.6058V20.75H3ZM7.25003 20.75V15.1058L8.74998 13.6058V20.75H7.25003ZM11.25 20.75V13.6058L12.75 15.1308V20.75H11.25ZM15.25 20.75V15.1308L16.75 13.6308V20.75H15.25ZM19.25 20.75V11.1058L20.75 9.60583V20.75H19.25ZM3.25003 15.2192V13.1058L10 6.35581L14 10.3558L20.75 3.60583V5.71924L14 12.4692L10 8.46921L3.25003 15.2192Z",fill:"currentColor"})})]});function unreachable(){}function stringify$1(tt,et){const nt=et||{};return(tt[tt.length-1]===""?[...tt,""]:tt).join((nt.padRight?" ":"")+","+(nt.padLeft===!1?"":" ")).trim()}const re=/[ \t\n\f\r]/g;function whitespace(tt){return typeof tt=="object"?tt.type==="text"?empty$1(tt.value):!1:empty$1(tt)}function empty$1(tt){return tt.replace(re,"")===""}class Schema{constructor(et,nt,it){this.property=et,this.normal=nt,it&&(this.space=it)}}Schema.prototype.property={};Schema.prototype.normal={};Schema.prototype.space=null;function merge(tt,et){const nt={},it={};let rt=-1;for(;++rt4&&nt.slice(0,4)==="data"&&valid.test(et)){if(et.charAt(4)==="-"){const ot=et.slice(5).replace(dash,camelcase);it="data"+ot.charAt(0).toUpperCase()+ot.slice(1)}else{const ot=et.slice(4);if(!dash.test(ot)){let at=ot.replace(cap$1,kebab);at.charAt(0)!=="-"&&(at="-"+at),et="data"+at}}rt=DefinedInfo}return new rt(it,et)}function kebab(tt){return"-"+tt.toLowerCase()}function camelcase(tt){return tt.charAt(1).toUpperCase()}const hastToReact={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},html$1=merge([xml,xlink,xmlns,aria,html$2],"html"),svg=merge([xml,xlink,xmlns,aria,svg$1],"svg");function stringify(tt){return tt.join(" ").trim()}var styleToObject={exports:{}},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=` -`,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(tt,et){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(!tt)return[];et=et||{};var nt=1,it=1;function rt(mt){var gt=mt.match(NEWLINE_REGEX);gt&&(nt+=gt.length);var bt=mt.lastIndexOf(NEWLINE);it=~bt?mt.length-bt:it+mt.length}function ot(){var mt={line:nt,column:it};return function(gt){return gt.position=new at(mt),ct(),gt}}function at(mt){this.start=mt,this.end={line:nt,column:it},this.source=et.source}at.prototype.content=tt;function st(mt){var gt=new Error(et.source+":"+nt+":"+it+": "+mt);if(gt.reason=mt,gt.filename=et.source,gt.line=nt,gt.column=it,gt.source=tt,!et.silent)throw gt}function lt(mt){var gt=mt.exec(tt);if(gt){var bt=gt[0];return rt(bt),tt=tt.slice(bt.length),gt}}function ct(){lt(WHITESPACE_REGEX)}function ut(mt){var gt;for(mt=mt||[];gt=ht();)gt!==!1&&mt.push(gt);return mt}function ht(){var mt=ot();if(!(FORWARD_SLASH!=tt.charAt(0)||ASTERISK!=tt.charAt(1))){for(var gt=2;EMPTY_STRING!=tt.charAt(gt)&&(ASTERISK!=tt.charAt(gt)||FORWARD_SLASH!=tt.charAt(gt+1));)++gt;if(gt+=2,EMPTY_STRING===tt.charAt(gt-1))return st("End of comment missing");var bt=tt.slice(2,gt-2);return it+=2,rt(bt),tt=tt.slice(gt),it+=2,mt({type:TYPE_COMMENT,comment:bt})}}function dt(){var mt=ot(),gt=lt(PROPERTY_REGEX);if(gt){if(ht(),!lt(COLON_REGEX))return st("property missing ':'");var bt=lt(VALUE_REGEX),yt=mt({type:TYPE_DECLARATION,property:trim(gt[0].replace(COMMENT_REGEX,EMPTY_STRING)),value:bt?trim(bt[0].replace(COMMENT_REGEX,EMPTY_STRING)):EMPTY_STRING});return lt(SEMICOLON_REGEX),yt}}function pt(){var mt=[];ut(mt);for(var gt;gt=dt();)gt!==!1&&(mt.push(gt),ut(mt));return mt}return ct(),pt()};function trim(tt){return tt?tt.replace(TRIM_REGEX,EMPTY_STRING):EMPTY_STRING}var parse$1=inlineStyleParser;function StyleToObject(tt,et){var nt=null;if(!tt||typeof tt!="string")return nt;for(var it,rt=parse$1(tt),ot=typeof et=="function",at,st,lt=0,ct=rt.length;lt0&&typeof it.column=="number"&&it.column>0)return{line:it.line,column:it.column,offset:typeof it.offset=="number"&&it.offset>-1?it.offset:void 0}}}function position$1(tt){const et=pointStart(tt),nt=pointEnd(tt);if(et&&nt)return{start:et,end:nt}}function stringifyPosition(tt){return!tt||typeof tt!="object"?"":"position"in tt||"type"in tt?position(tt.position):"start"in tt||"end"in tt?position(tt):"line"in tt||"column"in tt?point$1(tt):""}function point$1(tt){return index$1(tt&&tt.line)+":"+index$1(tt&&tt.column)}function position(tt){return point$1(tt&&tt.start)+"-"+point$1(tt&&tt.end)}function index$1(tt){return tt&&typeof tt=="number"?tt:1}class VFileMessage extends Error{constructor(et,nt,it){super(),typeof nt=="string"&&(it=nt,nt=void 0);let rt="",ot={},at=!1;if(nt&&("line"in nt&&"column"in nt?ot={place:nt}:"start"in nt&&"end"in nt?ot={place:nt}:"type"in nt?ot={ancestors:[nt],place:nt.position}:ot={...nt}),typeof et=="string"?rt=et:!ot.cause&&et&&(at=!0,rt=et.message,ot.cause=et),!ot.ruleId&&!ot.source&&typeof it=="string"){const lt=it.indexOf(":");lt===-1?ot.ruleId=it:(ot.source=it.slice(0,lt),ot.ruleId=it.slice(lt+1))}if(!ot.place&&ot.ancestors&&ot.ancestors){const lt=ot.ancestors[ot.ancestors.length-1];lt&&(ot.place=lt.position)}const st=ot.place&&"start"in ot.place?ot.place.start:ot.place;this.ancestors=ot.ancestors||void 0,this.cause=ot.cause||void 0,this.column=st?st.column:void 0,this.fatal=void 0,this.file,this.message=rt,this.line=st?st.line:void 0,this.name=stringifyPosition(ot.place)||"1:1",this.place=ot.place||void 0,this.reason=this.message,this.ruleId=ot.ruleId||void 0,this.source=ot.source||void 0,this.stack=at&&ot.cause&&typeof ot.cause.stack=="string"?ot.cause.stack:"",this.actual,this.expected,this.note,this.url}}VFileMessage.prototype.file="";VFileMessage.prototype.name="";VFileMessage.prototype.reason="";VFileMessage.prototype.message="";VFileMessage.prototype.stack="";VFileMessage.prototype.column=void 0;VFileMessage.prototype.line=void 0;VFileMessage.prototype.ancestors=void 0;VFileMessage.prototype.cause=void 0;VFileMessage.prototype.fatal=void 0;VFileMessage.prototype.place=void 0;VFileMessage.prototype.ruleId=void 0;VFileMessage.prototype.source=void 0;const own$3={}.hasOwnProperty,emptyMap=new Map,cap=/[A-Z]/g,dashSomething=/-([a-z])/g,tableElements=new Set(["table","tbody","thead","tfoot","tr"]),tableCellElement=new Set(["td","th"]);function toJsxRuntime(tt,et){if(!et||et.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const nt=et.filePath||void 0;let it;if(et.development){if(typeof et.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");it=developmentCreate(nt,et.jsxDEV)}else{if(typeof et.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof et.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");it=productionCreate(nt,et.jsx,et.jsxs)}const rt={Fragment:et.Fragment,ancestors:[],components:et.components||{},create:it,elementAttributeNameCase:et.elementAttributeNameCase||"react",filePath:nt,ignoreInvalidStyle:et.ignoreInvalidStyle||!1,passKeys:et.passKeys!==!1,passNode:et.passNode||!1,schema:et.space==="svg"?svg:html$1,stylePropertyNameCase:et.stylePropertyNameCase||"dom",tableCellAlignToStyle:et.tableCellAlignToStyle!==!1},ot=one$1(rt,tt,void 0);return ot&&typeof ot!="string"?ot:rt.create(tt,rt.Fragment,{children:ot||void 0},void 0)}function one$1(tt,et,nt){if(et.type==="element"||et.type==="root"){const it=tt.schema;let rt=it;et.type==="element"&&et.tagName.toLowerCase()==="svg"&&it.space==="html"&&(rt=svg,tt.schema=rt),tt.ancestors.push(et);let ot=createChildren(tt,et);const at=createProperties(tt,tt.ancestors);let st=tt.Fragment;if(tt.ancestors.pop(),et.type==="element")if(ot&&tableElements.has(et.tagName)&&(ot=ot.filter(function(lt){return typeof lt=="string"?!whitespace(lt):!0})),own$3.call(tt.components,et.tagName)){const lt=et.tagName;st=tt.components[lt],typeof st!="string"&&st!==tt.Fragment&&tt.passNode&&(at.node=et)}else st=et.tagName;if(ot.length>0){const lt=ot.length>1?ot:ot[0];lt&&(at.children=lt)}return tt.schema=it,tt.create(et,st,at,nt)}if(et.type==="text")return et.value}function productionCreate(tt,et,nt){return it;function it(rt,ot,at,st){const ct=Array.isArray(at.children)?nt:et;return st?ct(ot,at,st):ct(ot,at)}}function developmentCreate(tt,et){return nt;function nt(it,rt,ot,at){const st=Array.isArray(ot.children),lt=pointStart(it);return et(rt,ot,at,st,{columnNumber:lt?lt.column-1:void 0,fileName:tt,lineNumber:lt?lt.line:void 0},void 0)}}function createChildren(tt,et){const nt=[];let it=-1;const rt=tt.passKeys?new Map:emptyMap;for(;++itrt?0:rt+et:et=et>rt?rt:et,nt=nt>0?nt:0,it.length<1e4)at=Array.from(it),at.unshift(et,nt),tt.splice(...at);else for(nt&&tt.splice(et,nt);ot0?(splice(tt,tt.length,0,et),tt):et}const hasOwnProperty={}.hasOwnProperty;function combineExtensions(tt){const et={};let nt=-1;for(;++nt13&&nt<32||nt>126&&nt<160||nt>55295&&nt<57344||nt>64975&&nt<65008||(nt&65535)===65535||(nt&65535)===65534||nt>1114111?"�":String.fromCodePoint(nt)}function normalizeIdentifier(tt){return tt.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const unicodePunctuationInternal=regexCheck(/\p{P}/u),asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(tt){return tt!==null&&(tt<32||tt===127)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(tt){return tt!==null&&tt<-2}function markdownLineEndingOrSpace(tt){return tt!==null&&(tt<0||tt===32)}function markdownSpace(tt){return tt===-2||tt===-1||tt===32}function unicodePunctuation(tt){return asciiPunctuation(tt)||unicodePunctuationInternal(tt)}const unicodeWhitespace=regexCheck(/\s/);function regexCheck(tt){return et;function et(nt){return nt!==null&&nt>-1&&tt.test(String.fromCharCode(nt))}}function normalizeUri(tt){const et=[];let nt=-1,it=0,rt=0;for(;++nt55295&&ot<57344){const st=tt.charCodeAt(nt+1);ot<56320&&st>56319&&st<57344?(at=String.fromCharCode(ot,st),rt=1):at="�"}else at=String.fromCharCode(ot);at&&(et.push(tt.slice(it,nt),encodeURIComponent(at)),it=nt+rt+1,at=""),rt&&(nt+=rt,rt=0)}return et.join("")+tt.slice(it)}function factorySpace(tt,et,nt,it){const rt=it?it-1:Number.POSITIVE_INFINITY;let ot=0;return at;function at(lt){return markdownSpace(lt)?(tt.enter(nt),st(lt)):et(lt)}function st(lt){return markdownSpace(lt)&&ot++at))return;const It=et.events.length;let Tt=It,$t,Ut;for(;Tt--;)if(et.events[Tt][0]==="exit"&&et.events[Tt][1].type==="chunkFlow"){if($t){Ut=et.events[Tt][1].end;break}$t=!0}for(yt(it),Et=It;Etvt;){const St=nt[xt];et.containerState=St[1],St[0].exit.call(et,tt)}nt.length=vt}function wt(){rt.write([null]),ot=void 0,rt=void 0,et.containerState._closeFlow=void 0}}function tokenizeContainer(tt,et,nt){return factorySpace(tt,tt.attempt(this.parser.constructs.document,et,nt),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function classifyCharacter(tt){if(tt===null||markdownLineEndingOrSpace(tt)||unicodeWhitespace(tt))return 1;if(unicodePunctuation(tt))return 2}function resolveAll(tt,et,nt){const it=[];let rt=-1;for(;++rt1&&tt[nt][1].end.offset-tt[nt][1].start.offset>1?2:1;const ht=Object.assign({},tt[it][1].end),dt=Object.assign({},tt[nt][1].start);movePoint(ht,-lt),movePoint(dt,lt),at={type:lt>1?"strongSequence":"emphasisSequence",start:ht,end:Object.assign({},tt[it][1].end)},st={type:lt>1?"strongSequence":"emphasisSequence",start:Object.assign({},tt[nt][1].start),end:dt},ot={type:lt>1?"strongText":"emphasisText",start:Object.assign({},tt[it][1].end),end:Object.assign({},tt[nt][1].start)},rt={type:lt>1?"strong":"emphasis",start:Object.assign({},at.start),end:Object.assign({},st.end)},tt[it][1].end=Object.assign({},at.start),tt[nt][1].start=Object.assign({},st.end),ct=[],tt[it][1].end.offset-tt[it][1].start.offset&&(ct=push(ct,[["enter",tt[it][1],et],["exit",tt[it][1],et]])),ct=push(ct,[["enter",rt,et],["enter",at,et],["exit",at,et],["enter",ot,et]]),ct=push(ct,resolveAll(et.parser.constructs.insideSpan.null,tt.slice(it+1,nt),et)),ct=push(ct,[["exit",ot,et],["enter",st,et],["exit",st,et],["exit",rt,et]]),tt[nt][1].end.offset-tt[nt][1].start.offset?(ut=2,ct=push(ct,[["enter",tt[nt][1],et],["exit",tt[nt][1],et]])):ut=0,splice(tt,it-1,nt-it+3,ct),nt=it+ct.length-ut-2;break}}for(nt=-1;++nt0&&markdownSpace(Et)?factorySpace(tt,wt,"linePrefix",ot+1)(Et):wt(Et)}function wt(Et){return Et===null||markdownLineEnding(Et)?tt.check(nonLazyContinuation,gt,xt)(Et):(tt.enter("codeFlowValue"),vt(Et))}function vt(Et){return Et===null||markdownLineEnding(Et)?(tt.exit("codeFlowValue"),wt(Et)):(tt.consume(Et),vt)}function xt(Et){return tt.exit("codeFenced"),et(Et)}function St(Et,It,Tt){let $t=0;return Ut;function Ut(At){return Et.enter("lineEnding"),Et.consume(At),Et.exit("lineEnding"),Lt}function Lt(At){return Et.enter("codeFencedFence"),markdownSpace(At)?factorySpace(Et,Bt,"linePrefix",it.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(At):Bt(At)}function Bt(At){return At===st?(Et.enter("codeFencedFenceSequence"),Pt(At)):Tt(At)}function Pt(At){return At===st?($t++,Et.consume(At),Pt):$t>=at?(Et.exit("codeFencedFenceSequence"),markdownSpace(At)?factorySpace(Et,kt,"whitespace")(At):kt(At)):Tt(At)}function kt(At){return At===null||markdownLineEnding(At)?(Et.exit("codeFencedFence"),It(At)):Tt(At)}}}function tokenizeNonLazyContinuation(tt,et,nt){const it=this;return rt;function rt(at){return at===null?nt(at):(tt.enter("lineEnding"),tt.consume(at),tt.exit("lineEnding"),ot)}function ot(at){return it.parser.lazy[it.now().line]?nt(at):et(at)}}const codeIndented={name:"codeIndented",tokenize:tokenizeCodeIndented},furtherStart={tokenize:tokenizeFurtherStart,partial:!0};function tokenizeCodeIndented(tt,et,nt){const it=this;return rt;function rt(ct){return tt.enter("codeIndented"),factorySpace(tt,ot,"linePrefix",4+1)(ct)}function ot(ct){const ut=it.events[it.events.length-1];return ut&&ut[1].type==="linePrefix"&&ut[2].sliceSerialize(ut[1],!0).length>=4?at(ct):nt(ct)}function at(ct){return ct===null?lt(ct):markdownLineEnding(ct)?tt.attempt(furtherStart,at,lt)(ct):(tt.enter("codeFlowValue"),st(ct))}function st(ct){return ct===null||markdownLineEnding(ct)?(tt.exit("codeFlowValue"),at(ct)):(tt.consume(ct),st)}function lt(ct){return tt.exit("codeIndented"),et(ct)}}function tokenizeFurtherStart(tt,et,nt){const it=this;return rt;function rt(at){return it.parser.lazy[it.now().line]?nt(at):markdownLineEnding(at)?(tt.enter("lineEnding"),tt.consume(at),tt.exit("lineEnding"),rt):factorySpace(tt,ot,"linePrefix",4+1)(at)}function ot(at){const st=it.events[it.events.length-1];return st&&st[1].type==="linePrefix"&&st[2].sliceSerialize(st[1],!0).length>=4?et(at):markdownLineEnding(at)?rt(at):nt(at)}}const codeText={name:"codeText",tokenize:tokenizeCodeText,resolve:resolveCodeText,previous};function resolveCodeText(tt){let et=tt.length-4,nt=3,it,rt;if((tt[nt][1].type==="lineEnding"||tt[nt][1].type==="space")&&(tt[et][1].type==="lineEnding"||tt[et][1].type==="space")){for(it=nt;++it=4?et(at):tt.interrupt(it.parser.constructs.flow,nt,et)(at)}}function factoryDestination(tt,et,nt,it,rt,ot,at,st,lt){const ct=lt||Number.POSITIVE_INFINITY;let ut=0;return ht;function ht(yt){return yt===60?(tt.enter(it),tt.enter(rt),tt.enter(ot),tt.consume(yt),tt.exit(ot),dt):yt===null||yt===32||yt===41||asciiControl(yt)?nt(yt):(tt.enter(it),tt.enter(at),tt.enter(st),tt.enter("chunkString",{contentType:"string"}),gt(yt))}function dt(yt){return yt===62?(tt.enter(ot),tt.consume(yt),tt.exit(ot),tt.exit(rt),tt.exit(it),et):(tt.enter(st),tt.enter("chunkString",{contentType:"string"}),pt(yt))}function pt(yt){return yt===62?(tt.exit("chunkString"),tt.exit(st),dt(yt)):yt===null||yt===60||markdownLineEnding(yt)?nt(yt):(tt.consume(yt),yt===92?mt:pt)}function mt(yt){return yt===60||yt===62||yt===92?(tt.consume(yt),pt):pt(yt)}function gt(yt){return!ut&&(yt===null||yt===41||markdownLineEndingOrSpace(yt))?(tt.exit("chunkString"),tt.exit(st),tt.exit(at),tt.exit(it),et(yt)):ut999||pt===null||pt===91||pt===93&&!lt||pt===94&&!st&&"_hiddenFootnoteSupport"in at.parser.constructs?nt(pt):pt===93?(tt.exit(ot),tt.enter(rt),tt.consume(pt),tt.exit(rt),tt.exit(it),et):markdownLineEnding(pt)?(tt.enter("lineEnding"),tt.consume(pt),tt.exit("lineEnding"),ut):(tt.enter("chunkString",{contentType:"string"}),ht(pt))}function ht(pt){return pt===null||pt===91||pt===93||markdownLineEnding(pt)||st++>999?(tt.exit("chunkString"),ut(pt)):(tt.consume(pt),lt||(lt=!markdownSpace(pt)),pt===92?dt:ht)}function dt(pt){return pt===91||pt===92||pt===93?(tt.consume(pt),st++,ht):ht(pt)}}function factoryTitle(tt,et,nt,it,rt,ot){let at;return st;function st(dt){return dt===34||dt===39||dt===40?(tt.enter(it),tt.enter(rt),tt.consume(dt),tt.exit(rt),at=dt===40?41:dt,lt):nt(dt)}function lt(dt){return dt===at?(tt.enter(rt),tt.consume(dt),tt.exit(rt),tt.exit(it),et):(tt.enter(ot),ct(dt))}function ct(dt){return dt===at?(tt.exit(ot),lt(at)):dt===null?nt(dt):markdownLineEnding(dt)?(tt.enter("lineEnding"),tt.consume(dt),tt.exit("lineEnding"),factorySpace(tt,ct,"linePrefix")):(tt.enter("chunkString",{contentType:"string"}),ut(dt))}function ut(dt){return dt===at||dt===null||markdownLineEnding(dt)?(tt.exit("chunkString"),ct(dt)):(tt.consume(dt),dt===92?ht:ut)}function ht(dt){return dt===at||dt===92?(tt.consume(dt),ut):ut(dt)}}function factoryWhitespace(tt,et){let nt;return it;function it(rt){return markdownLineEnding(rt)?(tt.enter("lineEnding"),tt.consume(rt),tt.exit("lineEnding"),nt=!0,it):markdownSpace(rt)?factorySpace(tt,it,nt?"linePrefix":"lineSuffix")(rt):et(rt)}}const definition={name:"definition",tokenize:tokenizeDefinition},titleBefore={tokenize:tokenizeTitleBefore,partial:!0};function tokenizeDefinition(tt,et,nt){const it=this;let rt;return ot;function ot(pt){return tt.enter("definition"),at(pt)}function at(pt){return factoryLabel.call(it,tt,st,nt,"definitionLabel","definitionLabelMarker","definitionLabelString")(pt)}function st(pt){return rt=normalizeIdentifier(it.sliceSerialize(it.events[it.events.length-1][1]).slice(1,-1)),pt===58?(tt.enter("definitionMarker"),tt.consume(pt),tt.exit("definitionMarker"),lt):nt(pt)}function lt(pt){return markdownLineEndingOrSpace(pt)?factoryWhitespace(tt,ct)(pt):ct(pt)}function ct(pt){return factoryDestination(tt,ut,nt,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(pt)}function ut(pt){return tt.attempt(titleBefore,ht,ht)(pt)}function ht(pt){return markdownSpace(pt)?factorySpace(tt,dt,"whitespace")(pt):dt(pt)}function dt(pt){return pt===null||markdownLineEnding(pt)?(tt.exit("definition"),it.parser.defined.push(rt),et(pt)):nt(pt)}}function tokenizeTitleBefore(tt,et,nt){return it;function it(st){return markdownLineEndingOrSpace(st)?factoryWhitespace(tt,rt)(st):nt(st)}function rt(st){return factoryTitle(tt,ot,nt,"definitionTitle","definitionTitleMarker","definitionTitleString")(st)}function ot(st){return markdownSpace(st)?factorySpace(tt,at,"whitespace")(st):at(st)}function at(st){return st===null||markdownLineEnding(st)?et(st):nt(st)}}const hardBreakEscape={name:"hardBreakEscape",tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(tt,et,nt){return it;function it(ot){return tt.enter("hardBreakEscape"),tt.consume(ot),rt}function rt(ot){return markdownLineEnding(ot)?(tt.exit("hardBreakEscape"),et(ot)):nt(ot)}}const headingAtx={name:"headingAtx",tokenize:tokenizeHeadingAtx,resolve:resolveHeadingAtx};function resolveHeadingAtx(tt,et){let nt=tt.length-2,it=3,rt,ot;return tt[it][1].type==="whitespace"&&(it+=2),nt-2>it&&tt[nt][1].type==="whitespace"&&(nt-=2),tt[nt][1].type==="atxHeadingSequence"&&(it===nt-1||nt-4>it&&tt[nt-2][1].type==="whitespace")&&(nt-=it+1===nt?2:4),nt>it&&(rt={type:"atxHeadingText",start:tt[it][1].start,end:tt[nt][1].end},ot={type:"chunkText",start:tt[it][1].start,end:tt[nt][1].end,contentType:"text"},splice(tt,it,nt-it+1,[["enter",rt,et],["enter",ot,et],["exit",ot,et],["exit",rt,et]])),tt}function tokenizeHeadingAtx(tt,et,nt){let it=0;return rt;function rt(ut){return tt.enter("atxHeading"),ot(ut)}function ot(ut){return tt.enter("atxHeadingSequence"),at(ut)}function at(ut){return ut===35&&it++<6?(tt.consume(ut),at):ut===null||markdownLineEndingOrSpace(ut)?(tt.exit("atxHeadingSequence"),st(ut)):nt(ut)}function st(ut){return ut===35?(tt.enter("atxHeadingSequence"),lt(ut)):ut===null||markdownLineEnding(ut)?(tt.exit("atxHeading"),et(ut)):markdownSpace(ut)?factorySpace(tt,st,"whitespace")(ut):(tt.enter("atxHeadingText"),ct(ut))}function lt(ut){return ut===35?(tt.consume(ut),lt):(tt.exit("atxHeadingSequence"),st(ut))}function ct(ut){return ut===null||ut===35||markdownLineEndingOrSpace(ut)?(tt.exit("atxHeadingText"),st(ut)):(tt.consume(ut),ct)}}const htmlBlockNames=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],htmlRawNames=["pre","script","style","textarea"],htmlFlow={name:"htmlFlow",tokenize:tokenizeHtmlFlow,resolveTo:resolveToHtmlFlow,concrete:!0},blankLineBefore={tokenize:tokenizeBlankLineBefore,partial:!0},nonLazyContinuationStart={tokenize:tokenizeNonLazyContinuationStart,partial:!0};function resolveToHtmlFlow(tt){let et=tt.length;for(;et--&&!(tt[et][0]==="enter"&&tt[et][1].type==="htmlFlow"););return et>1&&tt[et-2][1].type==="linePrefix"&&(tt[et][1].start=tt[et-2][1].start,tt[et+1][1].start=tt[et-2][1].start,tt.splice(et-2,2)),tt}function tokenizeHtmlFlow(tt,et,nt){const it=this;let rt,ot,at,st,lt;return ct;function ct(Vt){return ut(Vt)}function ut(Vt){return tt.enter("htmlFlow"),tt.enter("htmlFlowData"),tt.consume(Vt),ht}function ht(Vt){return Vt===33?(tt.consume(Vt),dt):Vt===47?(tt.consume(Vt),ot=!0,gt):Vt===63?(tt.consume(Vt),rt=3,it.interrupt?et:Ct):asciiAlpha(Vt)?(tt.consume(Vt),at=String.fromCharCode(Vt),bt):nt(Vt)}function dt(Vt){return Vt===45?(tt.consume(Vt),rt=2,pt):Vt===91?(tt.consume(Vt),rt=5,st=0,mt):asciiAlpha(Vt)?(tt.consume(Vt),rt=4,it.interrupt?et:Ct):nt(Vt)}function pt(Vt){return Vt===45?(tt.consume(Vt),it.interrupt?et:Ct):nt(Vt)}function mt(Vt){const Qt="CDATA[";return Vt===Qt.charCodeAt(st++)?(tt.consume(Vt),st===Qt.length?it.interrupt?et:Bt:mt):nt(Vt)}function gt(Vt){return asciiAlpha(Vt)?(tt.consume(Vt),at=String.fromCharCode(Vt),bt):nt(Vt)}function bt(Vt){if(Vt===null||Vt===47||Vt===62||markdownLineEndingOrSpace(Vt)){const Qt=Vt===47,rn=at.toLowerCase();return!Qt&&!ot&&htmlRawNames.includes(rn)?(rt=1,it.interrupt?et(Vt):Bt(Vt)):htmlBlockNames.includes(at.toLowerCase())?(rt=6,Qt?(tt.consume(Vt),yt):it.interrupt?et(Vt):Bt(Vt)):(rt=7,it.interrupt&&!it.parser.lazy[it.now().line]?nt(Vt):ot?wt(Vt):vt(Vt))}return Vt===45||asciiAlphanumeric(Vt)?(tt.consume(Vt),at+=String.fromCharCode(Vt),bt):nt(Vt)}function yt(Vt){return Vt===62?(tt.consume(Vt),it.interrupt?et:Bt):nt(Vt)}function wt(Vt){return markdownSpace(Vt)?(tt.consume(Vt),wt):Ut(Vt)}function vt(Vt){return Vt===47?(tt.consume(Vt),Ut):Vt===58||Vt===95||asciiAlpha(Vt)?(tt.consume(Vt),xt):markdownSpace(Vt)?(tt.consume(Vt),vt):Ut(Vt)}function xt(Vt){return Vt===45||Vt===46||Vt===58||Vt===95||asciiAlphanumeric(Vt)?(tt.consume(Vt),xt):St(Vt)}function St(Vt){return Vt===61?(tt.consume(Vt),Et):markdownSpace(Vt)?(tt.consume(Vt),St):vt(Vt)}function Et(Vt){return Vt===null||Vt===60||Vt===61||Vt===62||Vt===96?nt(Vt):Vt===34||Vt===39?(tt.consume(Vt),lt=Vt,It):markdownSpace(Vt)?(tt.consume(Vt),Et):Tt(Vt)}function It(Vt){return Vt===lt?(tt.consume(Vt),lt=null,$t):Vt===null||markdownLineEnding(Vt)?nt(Vt):(tt.consume(Vt),It)}function Tt(Vt){return Vt===null||Vt===34||Vt===39||Vt===47||Vt===60||Vt===61||Vt===62||Vt===96||markdownLineEndingOrSpace(Vt)?St(Vt):(tt.consume(Vt),Tt)}function $t(Vt){return Vt===47||Vt===62||markdownSpace(Vt)?vt(Vt):nt(Vt)}function Ut(Vt){return Vt===62?(tt.consume(Vt),Lt):nt(Vt)}function Lt(Vt){return Vt===null||markdownLineEnding(Vt)?Bt(Vt):markdownSpace(Vt)?(tt.consume(Vt),Lt):nt(Vt)}function Bt(Vt){return Vt===45&&rt===2?(tt.consume(Vt),Rt):Vt===60&&rt===1?(tt.consume(Vt),Wt):Vt===62&&rt===4?(tt.consume(Vt),Dt):Vt===63&&rt===3?(tt.consume(Vt),Ct):Vt===93&&rt===5?(tt.consume(Vt),Ot):markdownLineEnding(Vt)&&(rt===6||rt===7)?(tt.exit("htmlFlowData"),tt.check(blankLineBefore,Mt,Pt)(Vt)):Vt===null||markdownLineEnding(Vt)?(tt.exit("htmlFlowData"),Pt(Vt)):(tt.consume(Vt),Bt)}function Pt(Vt){return tt.check(nonLazyContinuationStart,kt,Mt)(Vt)}function kt(Vt){return tt.enter("lineEnding"),tt.consume(Vt),tt.exit("lineEnding"),At}function At(Vt){return Vt===null||markdownLineEnding(Vt)?Pt(Vt):(tt.enter("htmlFlowData"),Bt(Vt))}function Rt(Vt){return Vt===45?(tt.consume(Vt),Ct):Bt(Vt)}function Wt(Vt){return Vt===47?(tt.consume(Vt),at="",jt):Bt(Vt)}function jt(Vt){if(Vt===62){const Qt=at.toLowerCase();return htmlRawNames.includes(Qt)?(tt.consume(Vt),Dt):Bt(Vt)}return asciiAlpha(Vt)&&at.length<8?(tt.consume(Vt),at+=String.fromCharCode(Vt),jt):Bt(Vt)}function Ot(Vt){return Vt===93?(tt.consume(Vt),Ct):Bt(Vt)}function Ct(Vt){return Vt===62?(tt.consume(Vt),Dt):Vt===45&&rt===2?(tt.consume(Vt),Ct):Bt(Vt)}function Dt(Vt){return Vt===null||markdownLineEnding(Vt)?(tt.exit("htmlFlowData"),Mt(Vt)):(tt.consume(Vt),Dt)}function Mt(Vt){return tt.exit("htmlFlow"),et(Vt)}}function tokenizeNonLazyContinuationStart(tt,et,nt){const it=this;return rt;function rt(at){return markdownLineEnding(at)?(tt.enter("lineEnding"),tt.consume(at),tt.exit("lineEnding"),ot):nt(at)}function ot(at){return it.parser.lazy[it.now().line]?nt(at):et(at)}}function tokenizeBlankLineBefore(tt,et,nt){return it;function it(rt){return tt.enter("lineEnding"),tt.consume(rt),tt.exit("lineEnding"),tt.attempt(blankLine,et,nt)}}const htmlText={name:"htmlText",tokenize:tokenizeHtmlText};function tokenizeHtmlText(tt,et,nt){const it=this;let rt,ot,at;return st;function st(Ct){return tt.enter("htmlText"),tt.enter("htmlTextData"),tt.consume(Ct),lt}function lt(Ct){return Ct===33?(tt.consume(Ct),ct):Ct===47?(tt.consume(Ct),St):Ct===63?(tt.consume(Ct),vt):asciiAlpha(Ct)?(tt.consume(Ct),Tt):nt(Ct)}function ct(Ct){return Ct===45?(tt.consume(Ct),ut):Ct===91?(tt.consume(Ct),ot=0,mt):asciiAlpha(Ct)?(tt.consume(Ct),wt):nt(Ct)}function ut(Ct){return Ct===45?(tt.consume(Ct),pt):nt(Ct)}function ht(Ct){return Ct===null?nt(Ct):Ct===45?(tt.consume(Ct),dt):markdownLineEnding(Ct)?(at=ht,Wt(Ct)):(tt.consume(Ct),ht)}function dt(Ct){return Ct===45?(tt.consume(Ct),pt):ht(Ct)}function pt(Ct){return Ct===62?Rt(Ct):Ct===45?dt(Ct):ht(Ct)}function mt(Ct){const Dt="CDATA[";return Ct===Dt.charCodeAt(ot++)?(tt.consume(Ct),ot===Dt.length?gt:mt):nt(Ct)}function gt(Ct){return Ct===null?nt(Ct):Ct===93?(tt.consume(Ct),bt):markdownLineEnding(Ct)?(at=gt,Wt(Ct)):(tt.consume(Ct),gt)}function bt(Ct){return Ct===93?(tt.consume(Ct),yt):gt(Ct)}function yt(Ct){return Ct===62?Rt(Ct):Ct===93?(tt.consume(Ct),yt):gt(Ct)}function wt(Ct){return Ct===null||Ct===62?Rt(Ct):markdownLineEnding(Ct)?(at=wt,Wt(Ct)):(tt.consume(Ct),wt)}function vt(Ct){return Ct===null?nt(Ct):Ct===63?(tt.consume(Ct),xt):markdownLineEnding(Ct)?(at=vt,Wt(Ct)):(tt.consume(Ct),vt)}function xt(Ct){return Ct===62?Rt(Ct):vt(Ct)}function St(Ct){return asciiAlpha(Ct)?(tt.consume(Ct),Et):nt(Ct)}function Et(Ct){return Ct===45||asciiAlphanumeric(Ct)?(tt.consume(Ct),Et):It(Ct)}function It(Ct){return markdownLineEnding(Ct)?(at=It,Wt(Ct)):markdownSpace(Ct)?(tt.consume(Ct),It):Rt(Ct)}function Tt(Ct){return Ct===45||asciiAlphanumeric(Ct)?(tt.consume(Ct),Tt):Ct===47||Ct===62||markdownLineEndingOrSpace(Ct)?$t(Ct):nt(Ct)}function $t(Ct){return Ct===47?(tt.consume(Ct),Rt):Ct===58||Ct===95||asciiAlpha(Ct)?(tt.consume(Ct),Ut):markdownLineEnding(Ct)?(at=$t,Wt(Ct)):markdownSpace(Ct)?(tt.consume(Ct),$t):Rt(Ct)}function Ut(Ct){return Ct===45||Ct===46||Ct===58||Ct===95||asciiAlphanumeric(Ct)?(tt.consume(Ct),Ut):Lt(Ct)}function Lt(Ct){return Ct===61?(tt.consume(Ct),Bt):markdownLineEnding(Ct)?(at=Lt,Wt(Ct)):markdownSpace(Ct)?(tt.consume(Ct),Lt):$t(Ct)}function Bt(Ct){return Ct===null||Ct===60||Ct===61||Ct===62||Ct===96?nt(Ct):Ct===34||Ct===39?(tt.consume(Ct),rt=Ct,Pt):markdownLineEnding(Ct)?(at=Bt,Wt(Ct)):markdownSpace(Ct)?(tt.consume(Ct),Bt):(tt.consume(Ct),kt)}function Pt(Ct){return Ct===rt?(tt.consume(Ct),rt=void 0,At):Ct===null?nt(Ct):markdownLineEnding(Ct)?(at=Pt,Wt(Ct)):(tt.consume(Ct),Pt)}function kt(Ct){return Ct===null||Ct===34||Ct===39||Ct===60||Ct===61||Ct===96?nt(Ct):Ct===47||Ct===62||markdownLineEndingOrSpace(Ct)?$t(Ct):(tt.consume(Ct),kt)}function At(Ct){return Ct===47||Ct===62||markdownLineEndingOrSpace(Ct)?$t(Ct):nt(Ct)}function Rt(Ct){return Ct===62?(tt.consume(Ct),tt.exit("htmlTextData"),tt.exit("htmlText"),et):nt(Ct)}function Wt(Ct){return tt.exit("htmlTextData"),tt.enter("lineEnding"),tt.consume(Ct),tt.exit("lineEnding"),jt}function jt(Ct){return markdownSpace(Ct)?factorySpace(tt,Ot,"linePrefix",it.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ct):Ot(Ct)}function Ot(Ct){return tt.enter("htmlTextData"),at(Ct)}}const labelEnd={name:"labelEnd",tokenize:tokenizeLabelEnd,resolveTo:resolveToLabelEnd,resolveAll:resolveAllLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(tt){let et=-1;for(;++et=3&&(ct===null||markdownLineEnding(ct))?(tt.exit("thematicBreak"),et(ct)):nt(ct)}function lt(ct){return ct===rt?(tt.consume(ct),it++,lt):(tt.exit("thematicBreakSequence"),markdownSpace(ct)?factorySpace(tt,st,"whitespace")(ct):st(ct))}}const list$1={name:"list",tokenize:tokenizeListStart,continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd},listItemPrefixWhitespaceConstruct={tokenize:tokenizeListItemPrefixWhitespace,partial:!0},indentConstruct={tokenize:tokenizeIndent,partial:!0};function tokenizeListStart(tt,et,nt){const it=this,rt=it.events[it.events.length-1];let ot=rt&&rt[1].type==="linePrefix"?rt[2].sliceSerialize(rt[1],!0).length:0,at=0;return st;function st(pt){const mt=it.containerState.type||(pt===42||pt===43||pt===45?"listUnordered":"listOrdered");if(mt==="listUnordered"?!it.containerState.marker||pt===it.containerState.marker:asciiDigit(pt)){if(it.containerState.type||(it.containerState.type=mt,tt.enter(mt,{_container:!0})),mt==="listUnordered")return tt.enter("listItemPrefix"),pt===42||pt===45?tt.check(thematicBreak$1,nt,ct)(pt):ct(pt);if(!it.interrupt||pt===49)return tt.enter("listItemPrefix"),tt.enter("listItemValue"),lt(pt)}return nt(pt)}function lt(pt){return asciiDigit(pt)&&++at<10?(tt.consume(pt),lt):(!it.interrupt||at<2)&&(it.containerState.marker?pt===it.containerState.marker:pt===41||pt===46)?(tt.exit("listItemValue"),ct(pt)):nt(pt)}function ct(pt){return tt.enter("listItemMarker"),tt.consume(pt),tt.exit("listItemMarker"),it.containerState.marker=it.containerState.marker||pt,tt.check(blankLine,it.interrupt?nt:ut,tt.attempt(listItemPrefixWhitespaceConstruct,dt,ht))}function ut(pt){return it.containerState.initialBlankLine=!0,ot++,dt(pt)}function ht(pt){return markdownSpace(pt)?(tt.enter("listItemPrefixWhitespace"),tt.consume(pt),tt.exit("listItemPrefixWhitespace"),dt):nt(pt)}function dt(pt){return it.containerState.size=ot+it.sliceSerialize(tt.exit("listItemPrefix"),!0).length,et(pt)}}function tokenizeListContinuation(tt,et,nt){const it=this;return it.containerState._closeFlow=void 0,tt.check(blankLine,rt,ot);function rt(st){return it.containerState.furtherBlankLines=it.containerState.furtherBlankLines||it.containerState.initialBlankLine,factorySpace(tt,et,"listItemIndent",it.containerState.size+1)(st)}function ot(st){return it.containerState.furtherBlankLines||!markdownSpace(st)?(it.containerState.furtherBlankLines=void 0,it.containerState.initialBlankLine=void 0,at(st)):(it.containerState.furtherBlankLines=void 0,it.containerState.initialBlankLine=void 0,tt.attempt(indentConstruct,et,at)(st))}function at(st){return it.containerState._closeFlow=!0,it.interrupt=void 0,factorySpace(tt,tt.attempt(list$1,et,nt),"linePrefix",it.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(st)}}function tokenizeIndent(tt,et,nt){const it=this;return factorySpace(tt,rt,"listItemIndent",it.containerState.size+1);function rt(ot){const at=it.events[it.events.length-1];return at&&at[1].type==="listItemIndent"&&at[2].sliceSerialize(at[1],!0).length===it.containerState.size?et(ot):nt(ot)}}function tokenizeListEnd(tt){tt.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(tt,et,nt){const it=this;return factorySpace(tt,rt,"listItemPrefixWhitespace",it.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function rt(ot){const at=it.events[it.events.length-1];return!markdownSpace(ot)&&at&&at[1].type==="listItemPrefixWhitespace"?et(ot):nt(ot)}}const setextUnderline={name:"setextUnderline",tokenize:tokenizeSetextUnderline,resolveTo:resolveToSetextUnderline};function resolveToSetextUnderline(tt,et){let nt=tt.length,it,rt,ot;for(;nt--;)if(tt[nt][0]==="enter"){if(tt[nt][1].type==="content"){it=nt;break}tt[nt][1].type==="paragraph"&&(rt=nt)}else tt[nt][1].type==="content"&&tt.splice(nt,1),!ot&&tt[nt][1].type==="definition"&&(ot=nt);const at={type:"setextHeading",start:Object.assign({},tt[rt][1].start),end:Object.assign({},tt[tt.length-1][1].end)};return tt[rt][1].type="setextHeadingText",ot?(tt.splice(rt,0,["enter",at,et]),tt.splice(ot+1,0,["exit",tt[it][1],et]),tt[it][1].end=Object.assign({},tt[ot][1].end)):tt[it][1]=at,tt.push(["exit",at,et]),tt}function tokenizeSetextUnderline(tt,et,nt){const it=this;let rt;return ot;function ot(ct){let ut=it.events.length,ht;for(;ut--;)if(it.events[ut][1].type!=="lineEnding"&&it.events[ut][1].type!=="linePrefix"&&it.events[ut][1].type!=="content"){ht=it.events[ut][1].type==="paragraph";break}return!it.parser.lazy[it.now().line]&&(it.interrupt||ht)?(tt.enter("setextHeadingLine"),rt=ct,at(ct)):nt(ct)}function at(ct){return tt.enter("setextHeadingLineSequence"),st(ct)}function st(ct){return ct===rt?(tt.consume(ct),st):(tt.exit("setextHeadingLineSequence"),markdownSpace(ct)?factorySpace(tt,lt,"lineSuffix")(ct):lt(ct))}function lt(ct){return ct===null||markdownLineEnding(ct)?(tt.exit("setextHeadingLine"),et(ct)):nt(ct)}}const flow$1={tokenize:initializeFlow};function initializeFlow(tt){const et=this,nt=tt.attempt(blankLine,it,tt.attempt(this.parser.constructs.flowInitial,rt,factorySpace(tt,tt.attempt(this.parser.constructs.flow,rt,tt.attempt(content,rt)),"linePrefix")));return nt;function it(ot){if(ot===null){tt.consume(ot);return}return tt.enter("lineEndingBlank"),tt.consume(ot),tt.exit("lineEndingBlank"),et.currentConstruct=void 0,nt}function rt(ot){if(ot===null){tt.consume(ot);return}return tt.enter("lineEnding"),tt.consume(ot),tt.exit("lineEnding"),et.currentConstruct=void 0,nt}}const resolver={resolveAll:createResolver()},string$1=initializeFactory("string"),text$2=initializeFactory("text");function initializeFactory(tt){return{tokenize:et,resolveAll:createResolver(tt==="text"?resolveAllLineSuffixes:void 0)};function et(nt){const it=this,rt=this.parser.constructs[tt],ot=nt.attempt(rt,at,st);return at;function at(ut){return ct(ut)?ot(ut):st(ut)}function st(ut){if(ut===null){nt.consume(ut);return}return nt.enter("data"),nt.consume(ut),lt}function lt(ut){return ct(ut)?(nt.exit("data"),ot(ut)):(nt.consume(ut),lt)}function ct(ut){if(ut===null)return!0;const ht=rt[ut];let dt=-1;if(ht)for(;++dt-1){const st=at[0];typeof st=="string"?at[0]=st.slice(it):at.shift()}ot>0&&at.push(tt[rt].slice(0,ot))}return at}function serializeChunks(tt,et){let nt=-1;const it=[];let rt;for(;++nt({backgroundColor:colors.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",right:"0px",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:colors.white,[tt.breakpoints.up("sm")]:{left:"100%"},"&:hover":{backgroundColor:colors.BG1_HOVER},"&:active":{backgroundColor:colors.BG1_PRESS,color:colors.GRAY6}})),ChevronRightIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"chevron_right",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1247_21809",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1247_21809)",children:jsxRuntimeExports.jsx("path",{id:"chevron_right_2",d:"M9.44998 8.99998L6.52498 6.07498C6.38748 5.93748 6.31873 5.76248 6.31873 5.54998C6.31873 5.33748 6.38748 5.16248 6.52498 5.02498C6.66248 4.88748 6.83748 4.81873 7.04998 4.81873C7.26248 4.81873 7.43748 4.88748 7.57498 5.02498L11.025 8.47498C11.1 8.54997 11.1531 8.63123 11.1844 8.71873C11.2156 8.80623 11.2312 8.89998 11.2312 8.99998C11.2312 9.09998 11.2156 9.19373 11.1844 9.28123C11.1531 9.36873 11.1 9.44998 11.025 9.52497L7.57498 12.975C7.43748 13.1125 7.26248 13.1812 7.04998 13.1812C6.83748 13.1812 6.66248 13.1125 6.52498 12.975C6.38748 12.8375 6.31873 12.6625 6.31873 12.45C6.31873 12.2375 6.38748 12.0625 6.52498 11.925L9.44998 8.99998Z",fill:"currentColor"})})]})}),Tab=()=>{const tt=useAppStore(et=>et.setSidebarOpen);return jsxRuntimeExports.jsx(ExpandButton,{onClick:()=>{tt(!0)},children:jsxRuntimeExports.jsx(ChevronRightIcon,{})})},ExpandButton=styled$4(Flex).attrs({align:"center",justify:"center",p:8})(({theme:tt})=>({backgroundColor:colors.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:colors.white,[tt.breakpoints.up("sm")]:{left:"64px"},"&:hover":{backgroundColor:colors.BG1_HOVER},"&:active":{backgroundColor:colors.BG1_PRESS,color:colors.GRAY6}})),PlusIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 21 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_3553_6463",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"21",height:"20",children:jsxRuntimeExports.jsx("rect",{x:"0.5",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_3553_6463)",children:jsxRuntimeExports.jsx("path",{d:"M9.87516 10.625H5.7085C5.53141 10.625 5.38298 10.5651 5.26318 10.4453C5.14339 10.3254 5.0835 10.1769 5.0835 9.99975C5.0835 9.82258 5.14339 9.67417 5.26318 9.55452C5.38298 9.43487 5.53141 9.37504 5.7085 9.37504H9.87516V5.20837C9.87516 5.03129 9.93508 4.88285 10.0549 4.76306C10.1748 4.64327 10.3233 4.58337 10.5004 4.58337C10.6776 4.58337 10.826 4.64327 10.9456 4.76306C11.0653 4.88285 11.1251 5.03129 11.1251 5.20837V9.37504H15.2918C15.4689 9.37504 15.6173 9.43496 15.7371 9.55479C15.8569 9.67464 15.9168 9.82314 15.9168 10.0003C15.9168 10.1775 15.8569 10.3259 15.7371 10.4455C15.6173 10.5652 15.4689 10.625 15.2918 10.625H11.1251V14.7917C11.1251 14.9688 11.0652 15.1172 10.9454 15.237C10.8255 15.3568 10.677 15.4167 10.4999 15.4167C10.3227 15.4167 10.1743 15.3568 10.0546 15.237C9.93499 15.1172 9.87516 14.9688 9.87516 14.7917V10.625Z",fill:"currentColor"})})]}),SentimentDataIcon=tt=>jsxRuntimeExports.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_1259_28",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:jsxRuntimeExports.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_1259_28)",children:jsxRuntimeExports.jsx("path",{d:"M3 20.75L2.91345 19.4327L4.74998 17.6058V20.75H3ZM7.25003 20.75V15.1058L8.74998 13.6058V20.75H7.25003ZM11.25 20.75V13.6058L12.75 15.1308V20.75H11.25ZM15.25 20.75V15.1308L16.75 13.6308V20.75H15.25ZM19.25 20.75V11.1058L20.75 9.60583V20.75H19.25ZM3.25003 15.2192V13.1058L10 6.35581L14 10.3558L20.75 3.60583V5.71924L14 12.4692L10 8.46921L3.25003 15.2192Z",fill:"currentColor"})})]});function ok$1(){}function unreachable(){}function stringify$1(tt,et){const nt=et||{};return(tt[tt.length-1]===""?[...tt,""]:tt).join((nt.padRight?" ":"")+","+(nt.padLeft===!1?"":" ")).trim()}const nameRe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nameReJsx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,emptyOptions$2={};function name(tt,et){return((et||emptyOptions$2).jsx?nameReJsx:nameRe).test(tt)}const re=/[ \t\n\f\r]/g;function whitespace(tt){return typeof tt=="object"?tt.type==="text"?empty$1(tt.value):!1:empty$1(tt)}function empty$1(tt){return tt.replace(re,"")===""}class Schema{constructor(et,nt,it){this.property=et,this.normal=nt,it&&(this.space=it)}}Schema.prototype.property={};Schema.prototype.normal={};Schema.prototype.space=null;function merge(tt,et){const nt={},it={};let rt=-1;for(;++rt4&&nt.slice(0,4)==="data"&&valid.test(et)){if(et.charAt(4)==="-"){const ot=et.slice(5).replace(dash,camelcase);it="data"+ot.charAt(0).toUpperCase()+ot.slice(1)}else{const ot=et.slice(4);if(!dash.test(ot)){let at=ot.replace(cap$1,kebab);at.charAt(0)!=="-"&&(at="-"+at),et="data"+at}}rt=DefinedInfo}return new rt(it,et)}function kebab(tt){return"-"+tt.toLowerCase()}function camelcase(tt){return tt.charAt(1).toUpperCase()}const hastToReact={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},html$1=merge([xml,xlink,xmlns,aria,html$2],"html"),svg=merge([xml,xlink,xmlns,aria,svg$1],"svg");function stringify(tt){return tt.join(" ").trim()}var cjs={},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=` +`,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(tt,et){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(!tt)return[];et=et||{};var nt=1,it=1;function rt(mt){var gt=mt.match(NEWLINE_REGEX);gt&&(nt+=gt.length);var bt=mt.lastIndexOf(NEWLINE);it=~bt?mt.length-bt:it+mt.length}function ot(){var mt={line:nt,column:it};return function(gt){return gt.position=new at(mt),ct(),gt}}function at(mt){this.start=mt,this.end={line:nt,column:it},this.source=et.source}at.prototype.content=tt;function st(mt){var gt=new Error(et.source+":"+nt+":"+it+": "+mt);if(gt.reason=mt,gt.filename=et.source,gt.line=nt,gt.column=it,gt.source=tt,!et.silent)throw gt}function lt(mt){var gt=mt.exec(tt);if(gt){var bt=gt[0];return rt(bt),tt=tt.slice(bt.length),gt}}function ct(){lt(WHITESPACE_REGEX)}function ut(mt){var gt;for(mt=mt||[];gt=ht();)gt!==!1&&mt.push(gt);return mt}function ht(){var mt=ot();if(!(FORWARD_SLASH!=tt.charAt(0)||ASTERISK!=tt.charAt(1))){for(var gt=2;EMPTY_STRING!=tt.charAt(gt)&&(ASTERISK!=tt.charAt(gt)||FORWARD_SLASH!=tt.charAt(gt+1));)++gt;if(gt+=2,EMPTY_STRING===tt.charAt(gt-1))return st("End of comment missing");var bt=tt.slice(2,gt-2);return it+=2,rt(bt),tt=tt.slice(gt),it+=2,mt({type:TYPE_COMMENT,comment:bt})}}function dt(){var mt=ot(),gt=lt(PROPERTY_REGEX);if(gt){if(ht(),!lt(COLON_REGEX))return st("property missing ':'");var bt=lt(VALUE_REGEX),yt=mt({type:TYPE_DECLARATION,property:trim(gt[0].replace(COMMENT_REGEX,EMPTY_STRING)),value:bt?trim(bt[0].replace(COMMENT_REGEX,EMPTY_STRING)):EMPTY_STRING});return lt(SEMICOLON_REGEX),yt}}function pt(){var mt=[];ut(mt);for(var gt;gt=dt();)gt!==!1&&(mt.push(gt),ut(mt));return mt}return ct(),pt()};function trim(tt){return tt?tt.replace(TRIM_REGEX,EMPTY_STRING):EMPTY_STRING}var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(tt){return tt&&tt.__esModule?tt:{default:tt}};Object.defineProperty(cjs,"__esModule",{value:!0});var inline_style_parser_1=__importDefault(inlineStyleParser);function StyleToObject(tt,et){var nt=null;if(!tt||typeof tt!="string")return nt;var it=(0,inline_style_parser_1.default)(tt),rt=typeof et=="function";return it.forEach(function(ot){if(ot.type==="declaration"){var at=ot.property,st=ot.value;rt?et(at,st,ot):st&&(nt=nt||{},nt[at]=st)}}),nt}var _default=cjs.default=StyleToObject;const styleToObject=_default.default||_default,pointEnd=point$2("end"),pointStart=point$2("start");function point$2(tt){return et;function et(nt){const it=nt&&nt.position&&nt.position[tt]||{};if(typeof it.line=="number"&&it.line>0&&typeof it.column=="number"&&it.column>0)return{line:it.line,column:it.column,offset:typeof it.offset=="number"&&it.offset>-1?it.offset:void 0}}}function position$1(tt){const et=pointStart(tt),nt=pointEnd(tt);if(et&&nt)return{start:et,end:nt}}function stringifyPosition(tt){return!tt||typeof tt!="object"?"":"position"in tt||"type"in tt?position(tt.position):"start"in tt||"end"in tt?position(tt):"line"in tt||"column"in tt?point$1(tt):""}function point$1(tt){return index$1(tt&&tt.line)+":"+index$1(tt&&tt.column)}function position(tt){return point$1(tt&&tt.start)+"-"+point$1(tt&&tt.end)}function index$1(tt){return tt&&typeof tt=="number"?tt:1}class VFileMessage extends Error{constructor(et,nt,it){super(),typeof nt=="string"&&(it=nt,nt=void 0);let rt="",ot={},at=!1;if(nt&&("line"in nt&&"column"in nt?ot={place:nt}:"start"in nt&&"end"in nt?ot={place:nt}:"type"in nt?ot={ancestors:[nt],place:nt.position}:ot={...nt}),typeof et=="string"?rt=et:!ot.cause&&et&&(at=!0,rt=et.message,ot.cause=et),!ot.ruleId&&!ot.source&&typeof it=="string"){const lt=it.indexOf(":");lt===-1?ot.ruleId=it:(ot.source=it.slice(0,lt),ot.ruleId=it.slice(lt+1))}if(!ot.place&&ot.ancestors&&ot.ancestors){const lt=ot.ancestors[ot.ancestors.length-1];lt&&(ot.place=lt.position)}const st=ot.place&&"start"in ot.place?ot.place.start:ot.place;this.ancestors=ot.ancestors||void 0,this.cause=ot.cause||void 0,this.column=st?st.column:void 0,this.fatal=void 0,this.file,this.message=rt,this.line=st?st.line:void 0,this.name=stringifyPosition(ot.place)||"1:1",this.place=ot.place||void 0,this.reason=this.message,this.ruleId=ot.ruleId||void 0,this.source=ot.source||void 0,this.stack=at&&ot.cause&&typeof ot.cause.stack=="string"?ot.cause.stack:"",this.actual,this.expected,this.note,this.url}}VFileMessage.prototype.file="";VFileMessage.prototype.name="";VFileMessage.prototype.reason="";VFileMessage.prototype.message="";VFileMessage.prototype.stack="";VFileMessage.prototype.column=void 0;VFileMessage.prototype.line=void 0;VFileMessage.prototype.ancestors=void 0;VFileMessage.prototype.cause=void 0;VFileMessage.prototype.fatal=void 0;VFileMessage.prototype.place=void 0;VFileMessage.prototype.ruleId=void 0;VFileMessage.prototype.source=void 0;const own$3={}.hasOwnProperty,emptyMap=new Map,cap=/[A-Z]/g,dashSomething=/-([a-z])/g,tableElements=new Set(["table","tbody","thead","tfoot","tr"]),tableCellElement=new Set(["td","th"]),docs="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function toJsxRuntime(tt,et){if(!et||et.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const nt=et.filePath||void 0;let it;if(et.development){if(typeof et.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");it=developmentCreate(nt,et.jsxDEV)}else{if(typeof et.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof et.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");it=productionCreate(nt,et.jsx,et.jsxs)}const rt={Fragment:et.Fragment,ancestors:[],components:et.components||{},create:it,elementAttributeNameCase:et.elementAttributeNameCase||"react",evaluater:et.createEvaluater?et.createEvaluater():void 0,filePath:nt,ignoreInvalidStyle:et.ignoreInvalidStyle||!1,passKeys:et.passKeys!==!1,passNode:et.passNode||!1,schema:et.space==="svg"?svg:html$1,stylePropertyNameCase:et.stylePropertyNameCase||"dom",tableCellAlignToStyle:et.tableCellAlignToStyle!==!1},ot=one$1(rt,tt,void 0);return ot&&typeof ot!="string"?ot:rt.create(tt,rt.Fragment,{children:ot||void 0},void 0)}function one$1(tt,et,nt){if(et.type==="element")return element$1(tt,et,nt);if(et.type==="mdxFlowExpression"||et.type==="mdxTextExpression")return mdxExpression(tt,et);if(et.type==="mdxJsxFlowElement"||et.type==="mdxJsxTextElement")return mdxJsxElement(tt,et,nt);if(et.type==="mdxjsEsm")return mdxEsm(tt,et);if(et.type==="root")return root$2(tt,et,nt);if(et.type==="text")return text$3(tt,et)}function element$1(tt,et,nt){const it=tt.schema;let rt=it;et.tagName.toLowerCase()==="svg"&&it.space==="html"&&(rt=svg,tt.schema=rt),tt.ancestors.push(et);const ot=findComponentFromName(tt,et.tagName,!1),at=createElementProps(tt,et);let st=createChildren(tt,et);return tableElements.has(et.tagName)&&(st=st.filter(function(lt){return typeof lt=="string"?!whitespace(lt):!0})),addNode(tt,at,ot,et),addChildren(at,st),tt.ancestors.pop(),tt.schema=it,tt.create(et,ot,at,nt)}function mdxExpression(tt,et){if(et.data&&et.data.estree&&tt.evaluater){const it=et.data.estree.body[0];return it.type,tt.evaluater.evaluateExpression(it.expression)}crashEstree(tt,et.position)}function mdxEsm(tt,et){if(et.data&&et.data.estree&&tt.evaluater)return tt.evaluater.evaluateProgram(et.data.estree);crashEstree(tt,et.position)}function mdxJsxElement(tt,et,nt){const it=tt.schema;let rt=it;et.name==="svg"&&it.space==="html"&&(rt=svg,tt.schema=rt),tt.ancestors.push(et);const ot=et.name===null?tt.Fragment:findComponentFromName(tt,et.name,!0),at=createJsxElementProps(tt,et),st=createChildren(tt,et);return addNode(tt,at,ot,et),addChildren(at,st),tt.ancestors.pop(),tt.schema=it,tt.create(et,ot,at,nt)}function root$2(tt,et,nt){const it={};return addChildren(it,createChildren(tt,et)),tt.create(et,tt.Fragment,it,nt)}function text$3(tt,et){return et.value}function addNode(tt,et,nt,it){typeof nt!="string"&&nt!==tt.Fragment&&tt.passNode&&(et.node=it)}function addChildren(tt,et){if(et.length>0){const nt=et.length>1?et:et[0];nt&&(tt.children=nt)}}function productionCreate(tt,et,nt){return it;function it(rt,ot,at,st){const ct=Array.isArray(at.children)?nt:et;return st?ct(ot,at,st):ct(ot,at)}}function developmentCreate(tt,et){return nt;function nt(it,rt,ot,at){const st=Array.isArray(ot.children),lt=pointStart(it);return et(rt,ot,at,st,{columnNumber:lt?lt.column-1:void 0,fileName:tt,lineNumber:lt?lt.line:void 0},void 0)}}function createElementProps(tt,et){const nt={};let it,rt;for(rt in et.properties)if(rt!=="children"&&own$3.call(et.properties,rt)){const ot=createProperty(tt,rt,et.properties[rt]);if(ot){const[at,st]=ot;tt.tableCellAlignToStyle&&at==="align"&&typeof st=="string"&&tableCellElement.has(et.tagName)?it=st:nt[at]=st}}if(it){const ot=nt.style||(nt.style={});ot[tt.stylePropertyNameCase==="css"?"text-align":"textAlign"]=it}return nt}function createJsxElementProps(tt,et){const nt={};for(const it of et.attributes)if(it.type==="mdxJsxExpressionAttribute")if(it.data&&it.data.estree&&tt.evaluater){const ot=it.data.estree.body[0];ot.type;const at=ot.expression;at.type;const st=at.properties[0];st.type,Object.assign(nt,tt.evaluater.evaluateExpression(st.argument))}else crashEstree(tt,et.position);else{const rt=it.name;let ot;if(it.value&&typeof it.value=="object")if(it.value.data&&it.value.data.estree&&tt.evaluater){const st=it.value.data.estree.body[0];st.type,ot=tt.evaluater.evaluateExpression(st.expression)}else crashEstree(tt,et.position);else ot=it.value===null?!0:it.value;nt[rt]=ot}return nt}function createChildren(tt,et){const nt=[];let it=-1;const rt=tt.passKeys?new Map:emptyMap;for(;++itrt?0:rt+et:et=et>rt?rt:et,nt=nt>0?nt:0,it.length<1e4)at=Array.from(it),at.unshift(et,nt),tt.splice(...at);else for(nt&&tt.splice(et,nt);ot0?(splice(tt,tt.length,0,et),tt):et}const hasOwnProperty={}.hasOwnProperty;function combineExtensions(tt){const et={};let nt=-1;for(;++nt13&&nt<32||nt>126&&nt<160||nt>55295&&nt<57344||nt>64975&&nt<65008||(nt&65535)===65535||(nt&65535)===65534||nt>1114111?"�":String.fromCodePoint(nt)}function normalizeIdentifier(tt){return tt.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const unicodePunctuationInternal=regexCheck(/\p{P}/u),asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(tt){return tt!==null&&(tt<32||tt===127)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(tt){return tt!==null&&tt<-2}function markdownLineEndingOrSpace(tt){return tt!==null&&(tt<0||tt===32)}function markdownSpace(tt){return tt===-2||tt===-1||tt===32}function unicodePunctuation(tt){return asciiPunctuation(tt)||unicodePunctuationInternal(tt)}const unicodeWhitespace=regexCheck(/\s/);function regexCheck(tt){return et;function et(nt){return nt!==null&&nt>-1&&tt.test(String.fromCharCode(nt))}}function normalizeUri(tt){const et=[];let nt=-1,it=0,rt=0;for(;++nt55295&&ot<57344){const st=tt.charCodeAt(nt+1);ot<56320&&st>56319&&st<57344?(at=String.fromCharCode(ot,st),rt=1):at="�"}else at=String.fromCharCode(ot);at&&(et.push(tt.slice(it,nt),encodeURIComponent(at)),it=nt+rt+1,at=""),rt&&(nt+=rt,rt=0)}return et.join("")+tt.slice(it)}function factorySpace(tt,et,nt,it){const rt=it?it-1:Number.POSITIVE_INFINITY;let ot=0;return at;function at(lt){return markdownSpace(lt)?(tt.enter(nt),st(lt)):et(lt)}function st(lt){return markdownSpace(lt)&&ot++at))return;const $t=et.events.length;let It=$t,Ft,Ht;for(;It--;)if(et.events[It][0]==="exit"&&et.events[It][1].type==="chunkFlow"){if(Ft){Ht=et.events[It][1].end;break}Ft=!0}for(yt(it),Et=$t;Etvt;){const St=nt[xt];et.containerState=St[1],St[0].exit.call(et,tt)}nt.length=vt}function wt(){rt.write([null]),ot=void 0,rt=void 0,et.containerState._closeFlow=void 0}}function tokenizeContainer(tt,et,nt){return factorySpace(tt,tt.attempt(this.parser.constructs.document,et,nt),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function classifyCharacter(tt){if(tt===null||markdownLineEndingOrSpace(tt)||unicodeWhitespace(tt))return 1;if(unicodePunctuation(tt))return 2}function resolveAll(tt,et,nt){const it=[];let rt=-1;for(;++rt1&&tt[nt][1].end.offset-tt[nt][1].start.offset>1?2:1;const ht=Object.assign({},tt[it][1].end),dt=Object.assign({},tt[nt][1].start);movePoint(ht,-lt),movePoint(dt,lt),at={type:lt>1?"strongSequence":"emphasisSequence",start:ht,end:Object.assign({},tt[it][1].end)},st={type:lt>1?"strongSequence":"emphasisSequence",start:Object.assign({},tt[nt][1].start),end:dt},ot={type:lt>1?"strongText":"emphasisText",start:Object.assign({},tt[it][1].end),end:Object.assign({},tt[nt][1].start)},rt={type:lt>1?"strong":"emphasis",start:Object.assign({},at.start),end:Object.assign({},st.end)},tt[it][1].end=Object.assign({},at.start),tt[nt][1].start=Object.assign({},st.end),ct=[],tt[it][1].end.offset-tt[it][1].start.offset&&(ct=push(ct,[["enter",tt[it][1],et],["exit",tt[it][1],et]])),ct=push(ct,[["enter",rt,et],["enter",at,et],["exit",at,et],["enter",ot,et]]),ct=push(ct,resolveAll(et.parser.constructs.insideSpan.null,tt.slice(it+1,nt),et)),ct=push(ct,[["exit",ot,et],["enter",st,et],["exit",st,et],["exit",rt,et]]),tt[nt][1].end.offset-tt[nt][1].start.offset?(ut=2,ct=push(ct,[["enter",tt[nt][1],et],["exit",tt[nt][1],et]])):ut=0,splice(tt,it-1,nt-it+3,ct),nt=it+ct.length-ut-2;break}}for(nt=-1;++nt0&&markdownSpace(Et)?factorySpace(tt,wt,"linePrefix",ot+1)(Et):wt(Et)}function wt(Et){return Et===null||markdownLineEnding(Et)?tt.check(nonLazyContinuation,gt,xt)(Et):(tt.enter("codeFlowValue"),vt(Et))}function vt(Et){return Et===null||markdownLineEnding(Et)?(tt.exit("codeFlowValue"),wt(Et)):(tt.consume(Et),vt)}function xt(Et){return tt.exit("codeFenced"),et(Et)}function St(Et,$t,It){let Ft=0;return Ht;function Ht(Tt){return Et.enter("lineEnding"),Et.consume(Tt),Et.exit("lineEnding"),zt}function zt(Tt){return Et.enter("codeFencedFence"),markdownSpace(Tt)?factorySpace(Et,Ot,"linePrefix",it.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Tt):Ot(Tt)}function Ot(Tt){return Tt===st?(Et.enter("codeFencedFenceSequence"),jt(Tt)):It(Tt)}function jt(Tt){return Tt===st?(Ft++,Et.consume(Tt),jt):Ft>=at?(Et.exit("codeFencedFenceSequence"),markdownSpace(Tt)?factorySpace(Et,kt,"whitespace")(Tt):kt(Tt)):It(Tt)}function kt(Tt){return Tt===null||markdownLineEnding(Tt)?(Et.exit("codeFencedFence"),$t(Tt)):It(Tt)}}}function tokenizeNonLazyContinuation(tt,et,nt){const it=this;return rt;function rt(at){return at===null?nt(at):(tt.enter("lineEnding"),tt.consume(at),tt.exit("lineEnding"),ot)}function ot(at){return it.parser.lazy[it.now().line]?nt(at):et(at)}}const codeIndented={name:"codeIndented",tokenize:tokenizeCodeIndented},furtherStart={tokenize:tokenizeFurtherStart,partial:!0};function tokenizeCodeIndented(tt,et,nt){const it=this;return rt;function rt(ct){return tt.enter("codeIndented"),factorySpace(tt,ot,"linePrefix",4+1)(ct)}function ot(ct){const ut=it.events[it.events.length-1];return ut&&ut[1].type==="linePrefix"&&ut[2].sliceSerialize(ut[1],!0).length>=4?at(ct):nt(ct)}function at(ct){return ct===null?lt(ct):markdownLineEnding(ct)?tt.attempt(furtherStart,at,lt)(ct):(tt.enter("codeFlowValue"),st(ct))}function st(ct){return ct===null||markdownLineEnding(ct)?(tt.exit("codeFlowValue"),at(ct)):(tt.consume(ct),st)}function lt(ct){return tt.exit("codeIndented"),et(ct)}}function tokenizeFurtherStart(tt,et,nt){const it=this;return rt;function rt(at){return it.parser.lazy[it.now().line]?nt(at):markdownLineEnding(at)?(tt.enter("lineEnding"),tt.consume(at),tt.exit("lineEnding"),rt):factorySpace(tt,ot,"linePrefix",4+1)(at)}function ot(at){const st=it.events[it.events.length-1];return st&&st[1].type==="linePrefix"&&st[2].sliceSerialize(st[1],!0).length>=4?et(at):markdownLineEnding(at)?rt(at):nt(at)}}const codeText={name:"codeText",tokenize:tokenizeCodeText,resolve:resolveCodeText,previous};function resolveCodeText(tt){let et=tt.length-4,nt=3,it,rt;if((tt[nt][1].type==="lineEnding"||tt[nt][1].type==="space")&&(tt[et][1].type==="lineEnding"||tt[et][1].type==="space")){for(it=nt;++it=4?et(at):tt.interrupt(it.parser.constructs.flow,nt,et)(at)}}function factoryDestination(tt,et,nt,it,rt,ot,at,st,lt){const ct=lt||Number.POSITIVE_INFINITY;let ut=0;return ht;function ht(yt){return yt===60?(tt.enter(it),tt.enter(rt),tt.enter(ot),tt.consume(yt),tt.exit(ot),dt):yt===null||yt===32||yt===41||asciiControl(yt)?nt(yt):(tt.enter(it),tt.enter(at),tt.enter(st),tt.enter("chunkString",{contentType:"string"}),gt(yt))}function dt(yt){return yt===62?(tt.enter(ot),tt.consume(yt),tt.exit(ot),tt.exit(rt),tt.exit(it),et):(tt.enter(st),tt.enter("chunkString",{contentType:"string"}),pt(yt))}function pt(yt){return yt===62?(tt.exit("chunkString"),tt.exit(st),dt(yt)):yt===null||yt===60||markdownLineEnding(yt)?nt(yt):(tt.consume(yt),yt===92?mt:pt)}function mt(yt){return yt===60||yt===62||yt===92?(tt.consume(yt),pt):pt(yt)}function gt(yt){return!ut&&(yt===null||yt===41||markdownLineEndingOrSpace(yt))?(tt.exit("chunkString"),tt.exit(st),tt.exit(at),tt.exit(it),et(yt)):ut999||pt===null||pt===91||pt===93&&!lt||pt===94&&!st&&"_hiddenFootnoteSupport"in at.parser.constructs?nt(pt):pt===93?(tt.exit(ot),tt.enter(rt),tt.consume(pt),tt.exit(rt),tt.exit(it),et):markdownLineEnding(pt)?(tt.enter("lineEnding"),tt.consume(pt),tt.exit("lineEnding"),ut):(tt.enter("chunkString",{contentType:"string"}),ht(pt))}function ht(pt){return pt===null||pt===91||pt===93||markdownLineEnding(pt)||st++>999?(tt.exit("chunkString"),ut(pt)):(tt.consume(pt),lt||(lt=!markdownSpace(pt)),pt===92?dt:ht)}function dt(pt){return pt===91||pt===92||pt===93?(tt.consume(pt),st++,ht):ht(pt)}}function factoryTitle(tt,et,nt,it,rt,ot){let at;return st;function st(dt){return dt===34||dt===39||dt===40?(tt.enter(it),tt.enter(rt),tt.consume(dt),tt.exit(rt),at=dt===40?41:dt,lt):nt(dt)}function lt(dt){return dt===at?(tt.enter(rt),tt.consume(dt),tt.exit(rt),tt.exit(it),et):(tt.enter(ot),ct(dt))}function ct(dt){return dt===at?(tt.exit(ot),lt(at)):dt===null?nt(dt):markdownLineEnding(dt)?(tt.enter("lineEnding"),tt.consume(dt),tt.exit("lineEnding"),factorySpace(tt,ct,"linePrefix")):(tt.enter("chunkString",{contentType:"string"}),ut(dt))}function ut(dt){return dt===at||dt===null||markdownLineEnding(dt)?(tt.exit("chunkString"),ct(dt)):(tt.consume(dt),dt===92?ht:ut)}function ht(dt){return dt===at||dt===92?(tt.consume(dt),ut):ut(dt)}}function factoryWhitespace(tt,et){let nt;return it;function it(rt){return markdownLineEnding(rt)?(tt.enter("lineEnding"),tt.consume(rt),tt.exit("lineEnding"),nt=!0,it):markdownSpace(rt)?factorySpace(tt,it,nt?"linePrefix":"lineSuffix")(rt):et(rt)}}const definition={name:"definition",tokenize:tokenizeDefinition},titleBefore={tokenize:tokenizeTitleBefore,partial:!0};function tokenizeDefinition(tt,et,nt){const it=this;let rt;return ot;function ot(pt){return tt.enter("definition"),at(pt)}function at(pt){return factoryLabel.call(it,tt,st,nt,"definitionLabel","definitionLabelMarker","definitionLabelString")(pt)}function st(pt){return rt=normalizeIdentifier(it.sliceSerialize(it.events[it.events.length-1][1]).slice(1,-1)),pt===58?(tt.enter("definitionMarker"),tt.consume(pt),tt.exit("definitionMarker"),lt):nt(pt)}function lt(pt){return markdownLineEndingOrSpace(pt)?factoryWhitespace(tt,ct)(pt):ct(pt)}function ct(pt){return factoryDestination(tt,ut,nt,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(pt)}function ut(pt){return tt.attempt(titleBefore,ht,ht)(pt)}function ht(pt){return markdownSpace(pt)?factorySpace(tt,dt,"whitespace")(pt):dt(pt)}function dt(pt){return pt===null||markdownLineEnding(pt)?(tt.exit("definition"),it.parser.defined.push(rt),et(pt)):nt(pt)}}function tokenizeTitleBefore(tt,et,nt){return it;function it(st){return markdownLineEndingOrSpace(st)?factoryWhitespace(tt,rt)(st):nt(st)}function rt(st){return factoryTitle(tt,ot,nt,"definitionTitle","definitionTitleMarker","definitionTitleString")(st)}function ot(st){return markdownSpace(st)?factorySpace(tt,at,"whitespace")(st):at(st)}function at(st){return st===null||markdownLineEnding(st)?et(st):nt(st)}}const hardBreakEscape={name:"hardBreakEscape",tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(tt,et,nt){return it;function it(ot){return tt.enter("hardBreakEscape"),tt.consume(ot),rt}function rt(ot){return markdownLineEnding(ot)?(tt.exit("hardBreakEscape"),et(ot)):nt(ot)}}const headingAtx={name:"headingAtx",tokenize:tokenizeHeadingAtx,resolve:resolveHeadingAtx};function resolveHeadingAtx(tt,et){let nt=tt.length-2,it=3,rt,ot;return tt[it][1].type==="whitespace"&&(it+=2),nt-2>it&&tt[nt][1].type==="whitespace"&&(nt-=2),tt[nt][1].type==="atxHeadingSequence"&&(it===nt-1||nt-4>it&&tt[nt-2][1].type==="whitespace")&&(nt-=it+1===nt?2:4),nt>it&&(rt={type:"atxHeadingText",start:tt[it][1].start,end:tt[nt][1].end},ot={type:"chunkText",start:tt[it][1].start,end:tt[nt][1].end,contentType:"text"},splice(tt,it,nt-it+1,[["enter",rt,et],["enter",ot,et],["exit",ot,et],["exit",rt,et]])),tt}function tokenizeHeadingAtx(tt,et,nt){let it=0;return rt;function rt(ut){return tt.enter("atxHeading"),ot(ut)}function ot(ut){return tt.enter("atxHeadingSequence"),at(ut)}function at(ut){return ut===35&&it++<6?(tt.consume(ut),at):ut===null||markdownLineEndingOrSpace(ut)?(tt.exit("atxHeadingSequence"),st(ut)):nt(ut)}function st(ut){return ut===35?(tt.enter("atxHeadingSequence"),lt(ut)):ut===null||markdownLineEnding(ut)?(tt.exit("atxHeading"),et(ut)):markdownSpace(ut)?factorySpace(tt,st,"whitespace")(ut):(tt.enter("atxHeadingText"),ct(ut))}function lt(ut){return ut===35?(tt.consume(ut),lt):(tt.exit("atxHeadingSequence"),st(ut))}function ct(ut){return ut===null||ut===35||markdownLineEndingOrSpace(ut)?(tt.exit("atxHeadingText"),st(ut)):(tt.consume(ut),ct)}}const htmlBlockNames=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],htmlRawNames=["pre","script","style","textarea"],htmlFlow={name:"htmlFlow",tokenize:tokenizeHtmlFlow,resolveTo:resolveToHtmlFlow,concrete:!0},blankLineBefore={tokenize:tokenizeBlankLineBefore,partial:!0},nonLazyContinuationStart={tokenize:tokenizeNonLazyContinuationStart,partial:!0};function resolveToHtmlFlow(tt){let et=tt.length;for(;et--&&!(tt[et][0]==="enter"&&tt[et][1].type==="htmlFlow"););return et>1&&tt[et-2][1].type==="linePrefix"&&(tt[et][1].start=tt[et-2][1].start,tt[et+1][1].start=tt[et-2][1].start,tt.splice(et-2,2)),tt}function tokenizeHtmlFlow(tt,et,nt){const it=this;let rt,ot,at,st,lt;return ct;function ct(Vt){return ut(Vt)}function ut(Vt){return tt.enter("htmlFlow"),tt.enter("htmlFlowData"),tt.consume(Vt),ht}function ht(Vt){return Vt===33?(tt.consume(Vt),dt):Vt===47?(tt.consume(Vt),ot=!0,gt):Vt===63?(tt.consume(Vt),rt=3,it.interrupt?et:Mt):asciiAlpha(Vt)?(tt.consume(Vt),at=String.fromCharCode(Vt),bt):nt(Vt)}function dt(Vt){return Vt===45?(tt.consume(Vt),rt=2,pt):Vt===91?(tt.consume(Vt),rt=5,st=0,mt):asciiAlpha(Vt)?(tt.consume(Vt),rt=4,it.interrupt?et:Mt):nt(Vt)}function pt(Vt){return Vt===45?(tt.consume(Vt),it.interrupt?et:Mt):nt(Vt)}function mt(Vt){const nn="CDATA[";return Vt===nn.charCodeAt(st++)?(tt.consume(Vt),st===nn.length?it.interrupt?et:Ot:mt):nt(Vt)}function gt(Vt){return asciiAlpha(Vt)?(tt.consume(Vt),at=String.fromCharCode(Vt),bt):nt(Vt)}function bt(Vt){if(Vt===null||Vt===47||Vt===62||markdownLineEndingOrSpace(Vt)){const nn=Vt===47,cn=at.toLowerCase();return!nn&&!ot&&htmlRawNames.includes(cn)?(rt=1,it.interrupt?et(Vt):Ot(Vt)):htmlBlockNames.includes(at.toLowerCase())?(rt=6,nn?(tt.consume(Vt),yt):it.interrupt?et(Vt):Ot(Vt)):(rt=7,it.interrupt&&!it.parser.lazy[it.now().line]?nt(Vt):ot?wt(Vt):vt(Vt))}return Vt===45||asciiAlphanumeric(Vt)?(tt.consume(Vt),at+=String.fromCharCode(Vt),bt):nt(Vt)}function yt(Vt){return Vt===62?(tt.consume(Vt),it.interrupt?et:Ot):nt(Vt)}function wt(Vt){return markdownSpace(Vt)?(tt.consume(Vt),wt):Ht(Vt)}function vt(Vt){return Vt===47?(tt.consume(Vt),Ht):Vt===58||Vt===95||asciiAlpha(Vt)?(tt.consume(Vt),xt):markdownSpace(Vt)?(tt.consume(Vt),vt):Ht(Vt)}function xt(Vt){return Vt===45||Vt===46||Vt===58||Vt===95||asciiAlphanumeric(Vt)?(tt.consume(Vt),xt):St(Vt)}function St(Vt){return Vt===61?(tt.consume(Vt),Et):markdownSpace(Vt)?(tt.consume(Vt),St):vt(Vt)}function Et(Vt){return Vt===null||Vt===60||Vt===61||Vt===62||Vt===96?nt(Vt):Vt===34||Vt===39?(tt.consume(Vt),lt=Vt,$t):markdownSpace(Vt)?(tt.consume(Vt),Et):It(Vt)}function $t(Vt){return Vt===lt?(tt.consume(Vt),lt=null,Ft):Vt===null||markdownLineEnding(Vt)?nt(Vt):(tt.consume(Vt),$t)}function It(Vt){return Vt===null||Vt===34||Vt===39||Vt===47||Vt===60||Vt===61||Vt===62||Vt===96||markdownLineEndingOrSpace(Vt)?St(Vt):(tt.consume(Vt),It)}function Ft(Vt){return Vt===47||Vt===62||markdownSpace(Vt)?vt(Vt):nt(Vt)}function Ht(Vt){return Vt===62?(tt.consume(Vt),zt):nt(Vt)}function zt(Vt){return Vt===null||markdownLineEnding(Vt)?Ot(Vt):markdownSpace(Vt)?(tt.consume(Vt),zt):nt(Vt)}function Ot(Vt){return Vt===45&&rt===2?(tt.consume(Vt),Ct):Vt===60&&rt===1?(tt.consume(Vt),Ut):Vt===62&&rt===4?(tt.consume(Vt),Dt):Vt===63&&rt===3?(tt.consume(Vt),Mt):Vt===93&&rt===5?(tt.consume(Vt),Bt):markdownLineEnding(Vt)&&(rt===6||rt===7)?(tt.exit("htmlFlowData"),tt.check(blankLineBefore,Pt,jt)(Vt)):Vt===null||markdownLineEnding(Vt)?(tt.exit("htmlFlowData"),jt(Vt)):(tt.consume(Vt),Ot)}function jt(Vt){return tt.check(nonLazyContinuationStart,kt,Pt)(Vt)}function kt(Vt){return tt.enter("lineEnding"),tt.consume(Vt),tt.exit("lineEnding"),Tt}function Tt(Vt){return Vt===null||markdownLineEnding(Vt)?jt(Vt):(tt.enter("htmlFlowData"),Ot(Vt))}function Ct(Vt){return Vt===45?(tt.consume(Vt),Mt):Ot(Vt)}function Ut(Vt){return Vt===47?(tt.consume(Vt),at="",Nt):Ot(Vt)}function Nt(Vt){if(Vt===62){const nn=at.toLowerCase();return htmlRawNames.includes(nn)?(tt.consume(Vt),Dt):Ot(Vt)}return asciiAlpha(Vt)&&at.length<8?(tt.consume(Vt),at+=String.fromCharCode(Vt),Nt):Ot(Vt)}function Bt(Vt){return Vt===93?(tt.consume(Vt),Mt):Ot(Vt)}function Mt(Vt){return Vt===62?(tt.consume(Vt),Dt):Vt===45&&rt===2?(tt.consume(Vt),Mt):Ot(Vt)}function Dt(Vt){return Vt===null||markdownLineEnding(Vt)?(tt.exit("htmlFlowData"),Pt(Vt)):(tt.consume(Vt),Dt)}function Pt(Vt){return tt.exit("htmlFlow"),et(Vt)}}function tokenizeNonLazyContinuationStart(tt,et,nt){const it=this;return rt;function rt(at){return markdownLineEnding(at)?(tt.enter("lineEnding"),tt.consume(at),tt.exit("lineEnding"),ot):nt(at)}function ot(at){return it.parser.lazy[it.now().line]?nt(at):et(at)}}function tokenizeBlankLineBefore(tt,et,nt){return it;function it(rt){return tt.enter("lineEnding"),tt.consume(rt),tt.exit("lineEnding"),tt.attempt(blankLine,et,nt)}}const htmlText={name:"htmlText",tokenize:tokenizeHtmlText};function tokenizeHtmlText(tt,et,nt){const it=this;let rt,ot,at;return st;function st(Mt){return tt.enter("htmlText"),tt.enter("htmlTextData"),tt.consume(Mt),lt}function lt(Mt){return Mt===33?(tt.consume(Mt),ct):Mt===47?(tt.consume(Mt),St):Mt===63?(tt.consume(Mt),vt):asciiAlpha(Mt)?(tt.consume(Mt),It):nt(Mt)}function ct(Mt){return Mt===45?(tt.consume(Mt),ut):Mt===91?(tt.consume(Mt),ot=0,mt):asciiAlpha(Mt)?(tt.consume(Mt),wt):nt(Mt)}function ut(Mt){return Mt===45?(tt.consume(Mt),pt):nt(Mt)}function ht(Mt){return Mt===null?nt(Mt):Mt===45?(tt.consume(Mt),dt):markdownLineEnding(Mt)?(at=ht,Ut(Mt)):(tt.consume(Mt),ht)}function dt(Mt){return Mt===45?(tt.consume(Mt),pt):ht(Mt)}function pt(Mt){return Mt===62?Ct(Mt):Mt===45?dt(Mt):ht(Mt)}function mt(Mt){const Dt="CDATA[";return Mt===Dt.charCodeAt(ot++)?(tt.consume(Mt),ot===Dt.length?gt:mt):nt(Mt)}function gt(Mt){return Mt===null?nt(Mt):Mt===93?(tt.consume(Mt),bt):markdownLineEnding(Mt)?(at=gt,Ut(Mt)):(tt.consume(Mt),gt)}function bt(Mt){return Mt===93?(tt.consume(Mt),yt):gt(Mt)}function yt(Mt){return Mt===62?Ct(Mt):Mt===93?(tt.consume(Mt),yt):gt(Mt)}function wt(Mt){return Mt===null||Mt===62?Ct(Mt):markdownLineEnding(Mt)?(at=wt,Ut(Mt)):(tt.consume(Mt),wt)}function vt(Mt){return Mt===null?nt(Mt):Mt===63?(tt.consume(Mt),xt):markdownLineEnding(Mt)?(at=vt,Ut(Mt)):(tt.consume(Mt),vt)}function xt(Mt){return Mt===62?Ct(Mt):vt(Mt)}function St(Mt){return asciiAlpha(Mt)?(tt.consume(Mt),Et):nt(Mt)}function Et(Mt){return Mt===45||asciiAlphanumeric(Mt)?(tt.consume(Mt),Et):$t(Mt)}function $t(Mt){return markdownLineEnding(Mt)?(at=$t,Ut(Mt)):markdownSpace(Mt)?(tt.consume(Mt),$t):Ct(Mt)}function It(Mt){return Mt===45||asciiAlphanumeric(Mt)?(tt.consume(Mt),It):Mt===47||Mt===62||markdownLineEndingOrSpace(Mt)?Ft(Mt):nt(Mt)}function Ft(Mt){return Mt===47?(tt.consume(Mt),Ct):Mt===58||Mt===95||asciiAlpha(Mt)?(tt.consume(Mt),Ht):markdownLineEnding(Mt)?(at=Ft,Ut(Mt)):markdownSpace(Mt)?(tt.consume(Mt),Ft):Ct(Mt)}function Ht(Mt){return Mt===45||Mt===46||Mt===58||Mt===95||asciiAlphanumeric(Mt)?(tt.consume(Mt),Ht):zt(Mt)}function zt(Mt){return Mt===61?(tt.consume(Mt),Ot):markdownLineEnding(Mt)?(at=zt,Ut(Mt)):markdownSpace(Mt)?(tt.consume(Mt),zt):Ft(Mt)}function Ot(Mt){return Mt===null||Mt===60||Mt===61||Mt===62||Mt===96?nt(Mt):Mt===34||Mt===39?(tt.consume(Mt),rt=Mt,jt):markdownLineEnding(Mt)?(at=Ot,Ut(Mt)):markdownSpace(Mt)?(tt.consume(Mt),Ot):(tt.consume(Mt),kt)}function jt(Mt){return Mt===rt?(tt.consume(Mt),rt=void 0,Tt):Mt===null?nt(Mt):markdownLineEnding(Mt)?(at=jt,Ut(Mt)):(tt.consume(Mt),jt)}function kt(Mt){return Mt===null||Mt===34||Mt===39||Mt===60||Mt===61||Mt===96?nt(Mt):Mt===47||Mt===62||markdownLineEndingOrSpace(Mt)?Ft(Mt):(tt.consume(Mt),kt)}function Tt(Mt){return Mt===47||Mt===62||markdownLineEndingOrSpace(Mt)?Ft(Mt):nt(Mt)}function Ct(Mt){return Mt===62?(tt.consume(Mt),tt.exit("htmlTextData"),tt.exit("htmlText"),et):nt(Mt)}function Ut(Mt){return tt.exit("htmlTextData"),tt.enter("lineEnding"),tt.consume(Mt),tt.exit("lineEnding"),Nt}function Nt(Mt){return markdownSpace(Mt)?factorySpace(tt,Bt,"linePrefix",it.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Mt):Bt(Mt)}function Bt(Mt){return tt.enter("htmlTextData"),at(Mt)}}const labelEnd={name:"labelEnd",tokenize:tokenizeLabelEnd,resolveTo:resolveToLabelEnd,resolveAll:resolveAllLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(tt){let et=-1;for(;++et=3&&(ct===null||markdownLineEnding(ct))?(tt.exit("thematicBreak"),et(ct)):nt(ct)}function lt(ct){return ct===rt?(tt.consume(ct),it++,lt):(tt.exit("thematicBreakSequence"),markdownSpace(ct)?factorySpace(tt,st,"whitespace")(ct):st(ct))}}const list$1={name:"list",tokenize:tokenizeListStart,continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd},listItemPrefixWhitespaceConstruct={tokenize:tokenizeListItemPrefixWhitespace,partial:!0},indentConstruct={tokenize:tokenizeIndent,partial:!0};function tokenizeListStart(tt,et,nt){const it=this,rt=it.events[it.events.length-1];let ot=rt&&rt[1].type==="linePrefix"?rt[2].sliceSerialize(rt[1],!0).length:0,at=0;return st;function st(pt){const mt=it.containerState.type||(pt===42||pt===43||pt===45?"listUnordered":"listOrdered");if(mt==="listUnordered"?!it.containerState.marker||pt===it.containerState.marker:asciiDigit(pt)){if(it.containerState.type||(it.containerState.type=mt,tt.enter(mt,{_container:!0})),mt==="listUnordered")return tt.enter("listItemPrefix"),pt===42||pt===45?tt.check(thematicBreak$1,nt,ct)(pt):ct(pt);if(!it.interrupt||pt===49)return tt.enter("listItemPrefix"),tt.enter("listItemValue"),lt(pt)}return nt(pt)}function lt(pt){return asciiDigit(pt)&&++at<10?(tt.consume(pt),lt):(!it.interrupt||at<2)&&(it.containerState.marker?pt===it.containerState.marker:pt===41||pt===46)?(tt.exit("listItemValue"),ct(pt)):nt(pt)}function ct(pt){return tt.enter("listItemMarker"),tt.consume(pt),tt.exit("listItemMarker"),it.containerState.marker=it.containerState.marker||pt,tt.check(blankLine,it.interrupt?nt:ut,tt.attempt(listItemPrefixWhitespaceConstruct,dt,ht))}function ut(pt){return it.containerState.initialBlankLine=!0,ot++,dt(pt)}function ht(pt){return markdownSpace(pt)?(tt.enter("listItemPrefixWhitespace"),tt.consume(pt),tt.exit("listItemPrefixWhitespace"),dt):nt(pt)}function dt(pt){return it.containerState.size=ot+it.sliceSerialize(tt.exit("listItemPrefix"),!0).length,et(pt)}}function tokenizeListContinuation(tt,et,nt){const it=this;return it.containerState._closeFlow=void 0,tt.check(blankLine,rt,ot);function rt(st){return it.containerState.furtherBlankLines=it.containerState.furtherBlankLines||it.containerState.initialBlankLine,factorySpace(tt,et,"listItemIndent",it.containerState.size+1)(st)}function ot(st){return it.containerState.furtherBlankLines||!markdownSpace(st)?(it.containerState.furtherBlankLines=void 0,it.containerState.initialBlankLine=void 0,at(st)):(it.containerState.furtherBlankLines=void 0,it.containerState.initialBlankLine=void 0,tt.attempt(indentConstruct,et,at)(st))}function at(st){return it.containerState._closeFlow=!0,it.interrupt=void 0,factorySpace(tt,tt.attempt(list$1,et,nt),"linePrefix",it.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(st)}}function tokenizeIndent(tt,et,nt){const it=this;return factorySpace(tt,rt,"listItemIndent",it.containerState.size+1);function rt(ot){const at=it.events[it.events.length-1];return at&&at[1].type==="listItemIndent"&&at[2].sliceSerialize(at[1],!0).length===it.containerState.size?et(ot):nt(ot)}}function tokenizeListEnd(tt){tt.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(tt,et,nt){const it=this;return factorySpace(tt,rt,"listItemPrefixWhitespace",it.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function rt(ot){const at=it.events[it.events.length-1];return!markdownSpace(ot)&&at&&at[1].type==="listItemPrefixWhitespace"?et(ot):nt(ot)}}const setextUnderline={name:"setextUnderline",tokenize:tokenizeSetextUnderline,resolveTo:resolveToSetextUnderline};function resolveToSetextUnderline(tt,et){let nt=tt.length,it,rt,ot;for(;nt--;)if(tt[nt][0]==="enter"){if(tt[nt][1].type==="content"){it=nt;break}tt[nt][1].type==="paragraph"&&(rt=nt)}else tt[nt][1].type==="content"&&tt.splice(nt,1),!ot&&tt[nt][1].type==="definition"&&(ot=nt);const at={type:"setextHeading",start:Object.assign({},tt[rt][1].start),end:Object.assign({},tt[tt.length-1][1].end)};return tt[rt][1].type="setextHeadingText",ot?(tt.splice(rt,0,["enter",at,et]),tt.splice(ot+1,0,["exit",tt[it][1],et]),tt[it][1].end=Object.assign({},tt[ot][1].end)):tt[it][1]=at,tt.push(["exit",at,et]),tt}function tokenizeSetextUnderline(tt,et,nt){const it=this;let rt;return ot;function ot(ct){let ut=it.events.length,ht;for(;ut--;)if(it.events[ut][1].type!=="lineEnding"&&it.events[ut][1].type!=="linePrefix"&&it.events[ut][1].type!=="content"){ht=it.events[ut][1].type==="paragraph";break}return!it.parser.lazy[it.now().line]&&(it.interrupt||ht)?(tt.enter("setextHeadingLine"),rt=ct,at(ct)):nt(ct)}function at(ct){return tt.enter("setextHeadingLineSequence"),st(ct)}function st(ct){return ct===rt?(tt.consume(ct),st):(tt.exit("setextHeadingLineSequence"),markdownSpace(ct)?factorySpace(tt,lt,"lineSuffix")(ct):lt(ct))}function lt(ct){return ct===null||markdownLineEnding(ct)?(tt.exit("setextHeadingLine"),et(ct)):nt(ct)}}const flow$1={tokenize:initializeFlow};function initializeFlow(tt){const et=this,nt=tt.attempt(blankLine,it,tt.attempt(this.parser.constructs.flowInitial,rt,factorySpace(tt,tt.attempt(this.parser.constructs.flow,rt,tt.attempt(content,rt)),"linePrefix")));return nt;function it(ot){if(ot===null){tt.consume(ot);return}return tt.enter("lineEndingBlank"),tt.consume(ot),tt.exit("lineEndingBlank"),et.currentConstruct=void 0,nt}function rt(ot){if(ot===null){tt.consume(ot);return}return tt.enter("lineEnding"),tt.consume(ot),tt.exit("lineEnding"),et.currentConstruct=void 0,nt}}const resolver={resolveAll:createResolver()},string$1=initializeFactory("string"),text$2=initializeFactory("text");function initializeFactory(tt){return{tokenize:et,resolveAll:createResolver(tt==="text"?resolveAllLineSuffixes:void 0)};function et(nt){const it=this,rt=this.parser.constructs[tt],ot=nt.attempt(rt,at,st);return at;function at(ut){return ct(ut)?ot(ut):st(ut)}function st(ut){if(ut===null){nt.consume(ut);return}return nt.enter("data"),nt.consume(ut),lt}function lt(ut){return ct(ut)?(nt.exit("data"),ot(ut)):(nt.consume(ut),lt)}function ct(ut){if(ut===null)return!0;const ht=rt[ut];let dt=-1;if(ht)for(;++dt-1){const st=at[0];typeof st=="string"?at[0]=st.slice(it):at.shift()}ot>0&&at.push(tt[rt].slice(0,ot))}return at}function serializeChunks(tt,et){let nt=-1;const it=[];let rt;for(;++nt0){const _n=nn.tokenStack[nn.tokenStack.length-1];(_n[1]||defaultOnError).call(nn,void 0,_n[0])}for($n.position={start:point(hn.length>0?hn[0][1].start:{line:1,column:1,offset:0}),end:point(hn.length>0?hn[hn.length-2][1].end:{line:1,column:1,offset:0})},Yt=-1;++Yt0){const wn=tn.tokenStack[tn.tokenStack.length-1];(wn[1]||defaultOnError).call(tn,void 0,wn[0])}for(Sn.position={start:point(rn.length>0?rn[0][1].start:{line:1,column:1,offset:0}),end:point(rn.length>0?rn[rn.length-2][1].end:{line:1,column:1,offset:0})},Kt=-1;++Kt1?"-"+st:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(at)}]};tt.patch(et,lt);const ct={type:"element",tagName:"sup",properties:{},children:[lt]};return tt.patch(et,ct),tt.applyData(et,ct)}function heading(tt,et){const nt={type:"element",tagName:"h"+et.depth,properties:{},children:tt.all(et)};return tt.patch(et,nt),tt.applyData(et,nt)}function html(tt,et){if(tt.options.allowDangerousHtml){const nt={type:"raw",value:et.value};return tt.patch(et,nt),tt.applyData(et,nt)}}function revert(tt,et){const nt=et.referenceType;let it="]";if(nt==="collapsed"?it+="[]":nt==="full"&&(it+="["+(et.label||et.identifier)+"]"),et.type==="imageReference")return[{type:"text",value:"!["+et.alt+it}];const rt=tt.all(et),ot=rt[0];ot&&ot.type==="text"?ot.value="["+ot.value:rt.unshift({type:"text",value:"["});const at=rt[rt.length-1];return at&&at.type==="text"?at.value+=it:rt.push({type:"text",value:it}),rt}function imageReference(tt,et){const nt=String(et.identifier).toUpperCase(),it=tt.definitionById.get(nt);if(!it)return revert(tt,et);const rt={src:normalizeUri(it.url||""),alt:et.alt};it.title!==null&&it.title!==void 0&&(rt.title=it.title);const ot={type:"element",tagName:"img",properties:rt,children:[]};return tt.patch(et,ot),tt.applyData(et,ot)}function image(tt,et){const nt={src:normalizeUri(et.url)};et.alt!==null&&et.alt!==void 0&&(nt.alt=et.alt),et.title!==null&&et.title!==void 0&&(nt.title=et.title);const it={type:"element",tagName:"img",properties:nt,children:[]};return tt.patch(et,it),tt.applyData(et,it)}function inlineCode(tt,et){const nt={type:"text",value:et.value.replace(/\r?\n|\r/g," ")};tt.patch(et,nt);const it={type:"element",tagName:"code",properties:{},children:[nt]};return tt.patch(et,it),tt.applyData(et,it)}function linkReference(tt,et){const nt=String(et.identifier).toUpperCase(),it=tt.definitionById.get(nt);if(!it)return revert(tt,et);const rt={href:normalizeUri(it.url||"")};it.title!==null&&it.title!==void 0&&(rt.title=it.title);const ot={type:"element",tagName:"a",properties:rt,children:tt.all(et)};return tt.patch(et,ot),tt.applyData(et,ot)}function link(tt,et){const nt={href:normalizeUri(et.url)};et.title!==null&&et.title!==void 0&&(nt.title=et.title);const it={type:"element",tagName:"a",properties:nt,children:tt.all(et)};return tt.patch(et,it),tt.applyData(et,it)}function listItem(tt,et,nt){const it=tt.all(et),rt=nt?listLoose(nt):listItemLoose(et),ot={},at=[];if(typeof et.checked=="boolean"){const ut=it[0];let ht;ut&&ut.type==="element"&&ut.tagName==="p"?ht=ut:(ht={type:"element",tagName:"p",properties:{},children:[]},it.unshift(ht)),ht.children.length>0&&ht.children.unshift({type:"text",value:" "}),ht.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:et.checked,disabled:!0},children:[]}),ot.className=["task-list-item"]}let st=-1;for(;++st0&&nt.push({type:"text",value:` `}),nt}function trimMarkdownSpaceStart(tt){let et=0,nt=tt.charCodeAt(et);for(;nt===9||nt===32;)et++,nt=tt.charCodeAt(et);return tt.slice(et)}function toHast(tt,et){const nt=createState(tt,et),it=nt.one(tt,void 0),rt=footer(nt),ot=Array.isArray(it)?{type:"root",children:it}:it||{type:"root",children:[]};return rt&&ot.children.push({type:"text",value:` -`},rt),ot}function remarkRehype(tt,et){return tt&&"run"in tt?async function(nt,it){const rt=toHast(nt,et);await tt.run(rt,it)}:function(nt){return toHast(nt,et||tt)}}function bail(tt){if(tt)throw tt}var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function tt(et){return typeof Array.isArray=="function"?Array.isArray(et):toStr.call(et)==="[object Array]"},isPlainObject$1=function tt(et){if(!et||toStr.call(et)!=="[object Object]")return!1;var nt=hasOwn.call(et,"constructor"),it=et.constructor&&et.constructor.prototype&&hasOwn.call(et.constructor.prototype,"isPrototypeOf");if(et.constructor&&!nt&&!it)return!1;var rt;for(rt in et);return typeof rt>"u"||hasOwn.call(et,rt)},setProperty=function tt(et,nt){defineProperty&&nt.name==="__proto__"?defineProperty(et,nt.name,{enumerable:!0,configurable:!0,value:nt.newValue,writable:!0}):et[nt.name]=nt.newValue},getProperty=function tt(et,nt){if(nt==="__proto__")if(hasOwn.call(et,nt)){if(gOPD)return gOPD(et,nt).value}else return;return et[nt]},extend=function tt(){var et,nt,it,rt,ot,at,st=arguments[0],lt=1,ct=arguments.length,ut=!1;for(typeof st=="boolean"&&(ut=st,st=arguments[1]||{},lt=2),(st==null||typeof st!="object"&&typeof st!="function")&&(st={});ltat.length;let lt;st&&at.push(rt);try{lt=tt.apply(this,at)}catch(ct){const ut=ct;if(st&&nt)throw ut;return rt(ut)}st||(lt instanceof Promise?lt.then(ot,rt):lt instanceof Error?rt(lt):ot(lt))}function rt(at,...st){nt||(nt=!0,et(at,...st))}function ot(at){rt(null,at)}}const path={basename,dirname,extname,join,sep:"/"};function basename(tt,et){if(et!==void 0&&typeof et!="string")throw new TypeError('"ext" argument must be a string');assertPath$1(tt);let nt=0,it=-1,rt=tt.length,ot;if(et===void 0||et.length===0||et.length>tt.length){for(;rt--;)if(tt.codePointAt(rt)===47){if(ot){nt=rt+1;break}}else it<0&&(ot=!0,it=rt+1);return it<0?"":tt.slice(nt,it)}if(et===tt)return"";let at=-1,st=et.length-1;for(;rt--;)if(tt.codePointAt(rt)===47){if(ot){nt=rt+1;break}}else at<0&&(ot=!0,at=rt+1),st>-1&&(tt.codePointAt(rt)===et.codePointAt(st--)?st<0&&(it=rt):(st=-1,it=at));return nt===it?it=at:it<0&&(it=tt.length),tt.slice(nt,it)}function dirname(tt){if(assertPath$1(tt),tt.length===0)return".";let et=-1,nt=tt.length,it;for(;--nt;)if(tt.codePointAt(nt)===47){if(it){et=nt;break}}else it||(it=!0);return et<0?tt.codePointAt(0)===47?"/":".":et===1&&tt.codePointAt(0)===47?"//":tt.slice(0,et)}function extname(tt){assertPath$1(tt);let et=tt.length,nt=-1,it=0,rt=-1,ot=0,at;for(;et--;){const st=tt.codePointAt(et);if(st===47){if(at){it=et+1;break}continue}nt<0&&(at=!0,nt=et+1),st===46?rt<0?rt=et:ot!==1&&(ot=1):rt>-1&&(ot=-1)}return rt<0||nt<0||ot===0||ot===1&&rt===nt-1&&rt===it+1?"":tt.slice(rt,nt)}function join(...tt){let et=-1,nt;for(;++et0&&tt.codePointAt(tt.length-1)===47&&(nt+="/"),et?"/"+nt:nt}function normalizeString(tt,et){let nt="",it=0,rt=-1,ot=0,at=-1,st,lt;for(;++at<=tt.length;){if(at2){if(lt=nt.lastIndexOf("/"),lt!==nt.length-1){lt<0?(nt="",it=0):(nt=nt.slice(0,lt),it=nt.length-1-nt.lastIndexOf("/")),rt=at,ot=0;continue}}else if(nt.length>0){nt="",it=0,rt=at,ot=0;continue}}et&&(nt=nt.length>0?nt+"/..":"..",it=2)}else nt.length>0?nt+="/"+tt.slice(rt+1,at):nt=tt.slice(rt+1,at),it=at-rt-1;rt=at,ot=0}else st===46&&ot>-1?ot++:ot=-1}return nt}function assertPath$1(tt){if(typeof tt!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(tt))}const proc={cwd};function cwd(){return"/"}function isUrl(tt){return!!(tt!==null&&typeof tt=="object"&&"href"in tt&&tt.href&&"protocol"in tt&&tt.protocol&&tt.auth===void 0)}function urlToPath(tt){if(typeof tt=="string")tt=new URL(tt);else if(!isUrl(tt)){const et=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+tt+"`");throw et.code="ERR_INVALID_ARG_TYPE",et}if(tt.protocol!=="file:"){const et=new TypeError("The URL must be of scheme file");throw et.code="ERR_INVALID_URL_SCHEME",et}return getPathFromURLPosix(tt)}function getPathFromURLPosix(tt){if(tt.hostname!==""){const it=new TypeError('File URL host must be "localhost" or empty on darwin');throw it.code="ERR_INVALID_FILE_URL_HOST",it}const et=tt.pathname;let nt=-1;for(;++nt0){let[pt,...mt]=ut;const gt=it[dt][1];isPlainObject(gt)&&isPlainObject(pt)&&(pt=extend$1(!0,gt,pt)),it[dt]=[ct,pt,...mt]}}}}const unified=new Processor().freeze();function assertParser(tt,et){if(typeof et!="function")throw new TypeError("Cannot `"+tt+"` without `parser`")}function assertCompiler(tt,et){if(typeof et!="function")throw new TypeError("Cannot `"+tt+"` without `compiler`")}function assertUnfrozen(tt,et){if(et)throw new Error("Cannot call `"+tt+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(tt){if(!isPlainObject(tt)||typeof tt.type!="string")throw new TypeError("Expected node, got `"+tt+"`")}function assertDone(tt,et,nt){if(!nt)throw new Error("`"+tt+"` finished async. Use `"+et+"` instead")}function vfile(tt){return looksLikeAVFile(tt)?tt:new VFile(tt)}function looksLikeAVFile(tt){return!!(tt&&typeof tt=="object"&&"message"in tt&&"messages"in tt)}function looksLikeAValue(tt){return typeof tt=="string"||isUint8Array(tt)}function isUint8Array(tt){return!!(tt&&typeof tt=="object"&&"byteLength"in tt&&"byteOffset"in tt)}const changelog="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",emptyPlugins=[],emptyRemarkRehypeOptions={allowDangerousHtml:!0},safeProtocol=/^(https?|ircs?|mailto|xmpp)$/i,deprecations=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Markdown(tt){const et=tt.allowedElements,nt=tt.allowElement,it=tt.children||"",rt=tt.className,ot=tt.components,at=tt.disallowedElements,st=tt.rehypePlugins||emptyPlugins,lt=tt.remarkPlugins||emptyPlugins,ct=tt.remarkRehypeOptions?{...tt.remarkRehypeOptions,...emptyRemarkRehypeOptions}:emptyRemarkRehypeOptions,ut=tt.skipHtml,ht=tt.unwrapDisallowed,dt=tt.urlTransform||defaultUrlTransform,pt=unified().use(remarkParse).use(lt).use(remarkRehype,ct).use(st),mt=new VFile;typeof it=="string"&&(mt.value=it);for(const wt of deprecations)Object.hasOwn(tt,wt.from)&&(""+wt.from+(wt.to?"use `"+wt.to+"` instead":"remove it")+changelog+wt.id,void 0);const gt=pt.parse(mt);let bt=pt.runSync(gt,mt);return rt&&(bt={type:"element",tagName:"div",properties:{className:rt},children:bt.type==="root"?bt.children:[bt]}),visit(bt,yt),toJsxRuntime(bt,{Fragment:jsxRuntimeExports.Fragment,components:ot,ignoreInvalidStyle:!0,jsx:jsxRuntimeExports.jsx,jsxs:jsxRuntimeExports.jsxs,passKeys:!0,passNode:!0});function yt(wt,vt,xt){if(wt.type==="raw"&&xt&&typeof vt=="number")return ut?xt.children.splice(vt,1):xt.children[vt]={type:"text",value:wt.value},vt;if(wt.type==="element"){let St;for(St in urlAttributes)if(Object.hasOwn(urlAttributes,St)&&Object.hasOwn(wt.properties,St)){const Et=wt.properties[St],It=urlAttributes[St];(It===null||It.includes(wt.tagName))&&(wt.properties[St]=dt(String(Et||""),St,wt))}}if(wt.type==="element"){let St=et?!et.includes(wt.tagName):at?at.includes(wt.tagName):!1;if(!St&&nt&&typeof vt=="number"&&(St=!nt(wt,vt,xt)),St&&xt&&typeof vt=="number")return ht&&wt.children?xt.children.splice(vt,1,...wt.children):xt.children.splice(vt,1),vt}}}function defaultUrlTransform(tt){const et=tt.indexOf(":"),nt=tt.indexOf("?"),it=tt.indexOf("#"),rt=tt.indexOf("/");return et<0||rt>-1&&et>rt||nt>-1&&et>nt||it>-1&&et>it||safeProtocol.test(tt.slice(0,et))?tt:""}const SoundIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"brand_awareness",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_3696_4540",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_3696_4540)",children:jsxRuntimeExports.jsx("path",{id:"brand_awareness_2",d:"M15.577 10.625H13.8142C13.6368 10.625 13.4883 10.5652 13.3687 10.4455C13.249 10.3259 13.1892 10.1774 13.1892 10C13.1892 9.82269 13.249 9.67419 13.3687 9.55454C13.4883 9.43489 13.6368 9.37506 13.8142 9.37506H15.577C15.7543 9.37506 15.9028 9.43489 16.0225 9.55454C16.1421 9.67419 16.202 9.82269 16.202 10C16.202 10.1774 16.1421 10.3259 16.0225 10.4455C15.9028 10.5652 15.7543 10.625 15.577 10.625ZM12.1106 13.9279C12.2175 13.7816 12.354 13.6972 12.5201 13.6747C12.6862 13.6523 12.8425 13.6945 12.9888 13.8013L14.3943 14.8574C14.5406 14.9642 14.625 15.1007 14.6475 15.2669C14.6699 15.433 14.6277 15.5892 14.5209 15.7356C14.4141 15.882 14.2776 15.9664 14.1114 15.9888C13.9453 16.0112 13.7891 15.969 13.6427 15.8622L12.2372 14.8061C12.0909 14.6993 12.0065 14.5628 11.9841 14.3967C11.9616 14.2305 12.0038 14.0743 12.1106 13.9279ZM14.3622 5.1106L12.9568 6.16671C12.8104 6.27354 12.6542 6.31574 12.488 6.29331C12.3219 6.27087 12.1854 6.18646 12.0786 6.0401C11.9718 5.89374 11.9296 5.7375 11.952 5.57137C11.9744 5.40525 12.0588 5.26876 12.2052 5.16192L13.6106 4.10583C13.757 3.999 13.9133 3.9568 14.0794 3.97923C14.2455 4.00166 14.382 4.08606 14.4888 4.23244C14.5957 4.3788 14.6379 4.53504 14.6154 4.70116C14.593 4.86729 14.5086 5.00377 14.3622 5.1106ZM6.05778 12.0834H3.71805C3.5033 12.0834 3.32408 12.0115 3.18039 11.8678C3.03669 11.7241 2.96484 11.5449 2.96484 11.3301V8.66994C2.96484 8.4552 3.03669 8.27599 3.18039 8.13229C3.32408 7.98858 3.5033 7.91673 3.71805 7.91673H6.05778L8.55134 5.42317C8.75114 5.22339 8.9811 5.17771 9.24124 5.28614C9.50138 5.39459 9.63145 5.5909 9.63145 5.87508V14.125C9.63145 14.4092 9.50138 14.6055 9.24124 14.7139C8.9811 14.8224 8.75114 14.7767 8.55134 14.5769L6.05778 12.0834Z",fill:"currentColor"})})]})}),BriefDescription=({trend:tt,onClose:et})=>{const[nt,it]=reactExports.useState(!1),{close:rt}=useModal("briefDescription"),ot=reactExports.useRef(null),at=reactExports.useCallback(()=>{et(),rt()},[et,rt]),st=()=>{ot.current&&(nt?ot.current.pause():ot.current.play(),it(!nt)),it(!nt)};return reactExports.useEffect(()=>(window.addEventListener("keydown",at),()=>{window.removeEventListener("keydown",at)}),[at]),jsxRuntimeExports.jsxs(BaseModal,{id:"briefDescription",kind:"regular",onClose:at,children:[tt.audio_EN?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Flex,{direction:"row",justify:"flex-start",mb:22,children:jsxRuntimeExports.jsx(Button$2,{onClick:st,size:"small",startIcon:nt?jsxRuntimeExports.jsx(PauseIcon,{}):jsxRuntimeExports.jsx(SoundIcon,{}),children:"Listen"})}),jsxRuntimeExports.jsx(StyledAudio,{ref:ot,src:tt.audio_EN,children:jsxRuntimeExports.jsx("track",{kind:"captions"})})]}):null,jsxRuntimeExports.jsx(Title,{children:tt.topic}),jsxRuntimeExports.jsx(ScrollableContent,{children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(StyledText,{children:jsxRuntimeExports.jsx(Markdown,{children:tt.tldr})})})})]})},ScrollableContent=styled$4.div` +`},rt),ot}function remarkRehype(tt,et){return tt&&"run"in tt?async function(nt,it){const rt=toHast(nt,et);await tt.run(rt,it)}:function(nt){return toHast(nt,et||tt)}}function bail(tt){if(tt)throw tt}var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function tt(et){return typeof Array.isArray=="function"?Array.isArray(et):toStr.call(et)==="[object Array]"},isPlainObject$1=function tt(et){if(!et||toStr.call(et)!=="[object Object]")return!1;var nt=hasOwn.call(et,"constructor"),it=et.constructor&&et.constructor.prototype&&hasOwn.call(et.constructor.prototype,"isPrototypeOf");if(et.constructor&&!nt&&!it)return!1;var rt;for(rt in et);return typeof rt>"u"||hasOwn.call(et,rt)},setProperty=function tt(et,nt){defineProperty&&nt.name==="__proto__"?defineProperty(et,nt.name,{enumerable:!0,configurable:!0,value:nt.newValue,writable:!0}):et[nt.name]=nt.newValue},getProperty=function tt(et,nt){if(nt==="__proto__")if(hasOwn.call(et,nt)){if(gOPD)return gOPD(et,nt).value}else return;return et[nt]},extend=function tt(){var et,nt,it,rt,ot,at,st=arguments[0],lt=1,ct=arguments.length,ut=!1;for(typeof st=="boolean"&&(ut=st,st=arguments[1]||{},lt=2),(st==null||typeof st!="object"&&typeof st!="function")&&(st={});ltat.length;let lt;st&&at.push(rt);try{lt=tt.apply(this,at)}catch(ct){const ut=ct;if(st&&nt)throw ut;return rt(ut)}st||(lt instanceof Promise?lt.then(ot,rt):lt instanceof Error?rt(lt):ot(lt))}function rt(at,...st){nt||(nt=!0,et(at,...st))}function ot(at){rt(null,at)}}const path={basename,dirname,extname,join,sep:"/"};function basename(tt,et){if(et!==void 0&&typeof et!="string")throw new TypeError('"ext" argument must be a string');assertPath$1(tt);let nt=0,it=-1,rt=tt.length,ot;if(et===void 0||et.length===0||et.length>tt.length){for(;rt--;)if(tt.codePointAt(rt)===47){if(ot){nt=rt+1;break}}else it<0&&(ot=!0,it=rt+1);return it<0?"":tt.slice(nt,it)}if(et===tt)return"";let at=-1,st=et.length-1;for(;rt--;)if(tt.codePointAt(rt)===47){if(ot){nt=rt+1;break}}else at<0&&(ot=!0,at=rt+1),st>-1&&(tt.codePointAt(rt)===et.codePointAt(st--)?st<0&&(it=rt):(st=-1,it=at));return nt===it?it=at:it<0&&(it=tt.length),tt.slice(nt,it)}function dirname(tt){if(assertPath$1(tt),tt.length===0)return".";let et=-1,nt=tt.length,it;for(;--nt;)if(tt.codePointAt(nt)===47){if(it){et=nt;break}}else it||(it=!0);return et<0?tt.codePointAt(0)===47?"/":".":et===1&&tt.codePointAt(0)===47?"//":tt.slice(0,et)}function extname(tt){assertPath$1(tt);let et=tt.length,nt=-1,it=0,rt=-1,ot=0,at;for(;et--;){const st=tt.codePointAt(et);if(st===47){if(at){it=et+1;break}continue}nt<0&&(at=!0,nt=et+1),st===46?rt<0?rt=et:ot!==1&&(ot=1):rt>-1&&(ot=-1)}return rt<0||nt<0||ot===0||ot===1&&rt===nt-1&&rt===it+1?"":tt.slice(rt,nt)}function join(...tt){let et=-1,nt;for(;++et0&&tt.codePointAt(tt.length-1)===47&&(nt+="/"),et?"/"+nt:nt}function normalizeString(tt,et){let nt="",it=0,rt=-1,ot=0,at=-1,st,lt;for(;++at<=tt.length;){if(at2){if(lt=nt.lastIndexOf("/"),lt!==nt.length-1){lt<0?(nt="",it=0):(nt=nt.slice(0,lt),it=nt.length-1-nt.lastIndexOf("/")),rt=at,ot=0;continue}}else if(nt.length>0){nt="",it=0,rt=at,ot=0;continue}}et&&(nt=nt.length>0?nt+"/..":"..",it=2)}else nt.length>0?nt+="/"+tt.slice(rt+1,at):nt=tt.slice(rt+1,at),it=at-rt-1;rt=at,ot=0}else st===46&&ot>-1?ot++:ot=-1}return nt}function assertPath$1(tt){if(typeof tt!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(tt))}const proc={cwd};function cwd(){return"/"}function isUrl(tt){return!!(tt!==null&&typeof tt=="object"&&"href"in tt&&tt.href&&"protocol"in tt&&tt.protocol&&tt.auth===void 0)}function urlToPath(tt){if(typeof tt=="string")tt=new URL(tt);else if(!isUrl(tt)){const et=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+tt+"`");throw et.code="ERR_INVALID_ARG_TYPE",et}if(tt.protocol!=="file:"){const et=new TypeError("The URL must be of scheme file");throw et.code="ERR_INVALID_URL_SCHEME",et}return getPathFromURLPosix(tt)}function getPathFromURLPosix(tt){if(tt.hostname!==""){const it=new TypeError('File URL host must be "localhost" or empty on darwin');throw it.code="ERR_INVALID_FILE_URL_HOST",it}const et=tt.pathname;let nt=-1;for(;++nt0){let[pt,...mt]=ut;const gt=it[dt][1];isPlainObject(gt)&&isPlainObject(pt)&&(pt=extend$1(!0,gt,pt)),it[dt]=[ct,pt,...mt]}}}}const unified=new Processor().freeze();function assertParser(tt,et){if(typeof et!="function")throw new TypeError("Cannot `"+tt+"` without `parser`")}function assertCompiler(tt,et){if(typeof et!="function")throw new TypeError("Cannot `"+tt+"` without `compiler`")}function assertUnfrozen(tt,et){if(et)throw new Error("Cannot call `"+tt+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(tt){if(!isPlainObject(tt)||typeof tt.type!="string")throw new TypeError("Expected node, got `"+tt+"`")}function assertDone(tt,et,nt){if(!nt)throw new Error("`"+tt+"` finished async. Use `"+et+"` instead")}function vfile(tt){return looksLikeAVFile(tt)?tt:new VFile(tt)}function looksLikeAVFile(tt){return!!(tt&&typeof tt=="object"&&"message"in tt&&"messages"in tt)}function looksLikeAValue(tt){return typeof tt=="string"||isUint8Array(tt)}function isUint8Array(tt){return!!(tt&&typeof tt=="object"&&"byteLength"in tt&&"byteOffset"in tt)}const changelog="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",emptyPlugins=[],emptyRemarkRehypeOptions={allowDangerousHtml:!0},safeProtocol=/^(https?|ircs?|mailto|xmpp)$/i,deprecations=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Markdown(tt){const et=tt.allowedElements,nt=tt.allowElement,it=tt.children||"",rt=tt.className,ot=tt.components,at=tt.disallowedElements,st=tt.rehypePlugins||emptyPlugins,lt=tt.remarkPlugins||emptyPlugins,ct=tt.remarkRehypeOptions?{...tt.remarkRehypeOptions,...emptyRemarkRehypeOptions}:emptyRemarkRehypeOptions,ut=tt.skipHtml,ht=tt.unwrapDisallowed,dt=tt.urlTransform||defaultUrlTransform,pt=unified().use(remarkParse).use(lt).use(remarkRehype,ct).use(st),mt=new VFile;typeof it=="string"&&(mt.value=it);for(const wt of deprecations)Object.hasOwn(tt,wt.from)&&(""+wt.from+(wt.to?"use `"+wt.to+"` instead":"remove it")+changelog+wt.id,void 0);const gt=pt.parse(mt);let bt=pt.runSync(gt,mt);return rt&&(bt={type:"element",tagName:"div",properties:{className:rt},children:bt.type==="root"?bt.children:[bt]}),visit(bt,yt),toJsxRuntime(bt,{Fragment:jsxRuntimeExports.Fragment,components:ot,ignoreInvalidStyle:!0,jsx:jsxRuntimeExports.jsx,jsxs:jsxRuntimeExports.jsxs,passKeys:!0,passNode:!0});function yt(wt,vt,xt){if(wt.type==="raw"&&xt&&typeof vt=="number")return ut?xt.children.splice(vt,1):xt.children[vt]={type:"text",value:wt.value},vt;if(wt.type==="element"){let St;for(St in urlAttributes)if(Object.hasOwn(urlAttributes,St)&&Object.hasOwn(wt.properties,St)){const Et=wt.properties[St],$t=urlAttributes[St];($t===null||$t.includes(wt.tagName))&&(wt.properties[St]=dt(String(Et||""),St,wt))}}if(wt.type==="element"){let St=et?!et.includes(wt.tagName):at?at.includes(wt.tagName):!1;if(!St&&nt&&typeof vt=="number"&&(St=!nt(wt,vt,xt)),St&&xt&&typeof vt=="number")return ht&&wt.children?xt.children.splice(vt,1,...wt.children):xt.children.splice(vt,1),vt}}}function defaultUrlTransform(tt){const et=tt.indexOf(":"),nt=tt.indexOf("?"),it=tt.indexOf("#"),rt=tt.indexOf("/");return et<0||rt>-1&&et>rt||nt>-1&&et>nt||it>-1&&et>it||safeProtocol.test(tt.slice(0,et))?tt:""}const SoundIcon=tt=>jsxRuntimeExports.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"brand_awareness",children:[jsxRuntimeExports.jsx("mask",{id:"mask0_3696_4540",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:jsxRuntimeExports.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),jsxRuntimeExports.jsx("g",{mask:"url(#mask0_3696_4540)",children:jsxRuntimeExports.jsx("path",{id:"brand_awareness_2",d:"M15.577 10.625H13.8142C13.6368 10.625 13.4883 10.5652 13.3687 10.4455C13.249 10.3259 13.1892 10.1774 13.1892 10C13.1892 9.82269 13.249 9.67419 13.3687 9.55454C13.4883 9.43489 13.6368 9.37506 13.8142 9.37506H15.577C15.7543 9.37506 15.9028 9.43489 16.0225 9.55454C16.1421 9.67419 16.202 9.82269 16.202 10C16.202 10.1774 16.1421 10.3259 16.0225 10.4455C15.9028 10.5652 15.7543 10.625 15.577 10.625ZM12.1106 13.9279C12.2175 13.7816 12.354 13.6972 12.5201 13.6747C12.6862 13.6523 12.8425 13.6945 12.9888 13.8013L14.3943 14.8574C14.5406 14.9642 14.625 15.1007 14.6475 15.2669C14.6699 15.433 14.6277 15.5892 14.5209 15.7356C14.4141 15.882 14.2776 15.9664 14.1114 15.9888C13.9453 16.0112 13.7891 15.969 13.6427 15.8622L12.2372 14.8061C12.0909 14.6993 12.0065 14.5628 11.9841 14.3967C11.9616 14.2305 12.0038 14.0743 12.1106 13.9279ZM14.3622 5.1106L12.9568 6.16671C12.8104 6.27354 12.6542 6.31574 12.488 6.29331C12.3219 6.27087 12.1854 6.18646 12.0786 6.0401C11.9718 5.89374 11.9296 5.7375 11.952 5.57137C11.9744 5.40525 12.0588 5.26876 12.2052 5.16192L13.6106 4.10583C13.757 3.999 13.9133 3.9568 14.0794 3.97923C14.2455 4.00166 14.382 4.08606 14.4888 4.23244C14.5957 4.3788 14.6379 4.53504 14.6154 4.70116C14.593 4.86729 14.5086 5.00377 14.3622 5.1106ZM6.05778 12.0834H3.71805C3.5033 12.0834 3.32408 12.0115 3.18039 11.8678C3.03669 11.7241 2.96484 11.5449 2.96484 11.3301V8.66994C2.96484 8.4552 3.03669 8.27599 3.18039 8.13229C3.32408 7.98858 3.5033 7.91673 3.71805 7.91673H6.05778L8.55134 5.42317C8.75114 5.22339 8.9811 5.17771 9.24124 5.28614C9.50138 5.39459 9.63145 5.5909 9.63145 5.87508V14.125C9.63145 14.4092 9.50138 14.6055 9.24124 14.7139C8.9811 14.8224 8.75114 14.7767 8.55134 14.5769L6.05778 12.0834Z",fill:"currentColor"})})]})}),BriefDescription=({trend:tt,onClose:et})=>{const[nt,it]=reactExports.useState(!1),{close:rt}=useModal("briefDescription"),ot=reactExports.useRef(null),at=reactExports.useCallback(()=>{et(),rt()},[et,rt]),st=()=>{ot.current&&(nt?ot.current.pause():ot.current.play(),it(!nt)),it(!nt)};return reactExports.useEffect(()=>(window.addEventListener("keydown",at),()=>{window.removeEventListener("keydown",at)}),[at]),jsxRuntimeExports.jsxs(BaseModal,{id:"briefDescription",kind:"regular",onClose:at,children:[tt.audio_EN?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Flex,{direction:"row",justify:"flex-start",mb:22,children:jsxRuntimeExports.jsx(Button$2,{onClick:st,size:"small",startIcon:nt?jsxRuntimeExports.jsx(PauseIcon,{}):jsxRuntimeExports.jsx(SoundIcon,{}),children:"Listen"})}),jsxRuntimeExports.jsx(StyledAudio$1,{ref:ot,src:tt.audio_EN,children:jsxRuntimeExports.jsx("track",{kind:"captions"})})]}):null,jsxRuntimeExports.jsx(Title,{children:tt.topic}),jsxRuntimeExports.jsx(ScrollableContent,{children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(StyledText,{children:jsxRuntimeExports.jsx(Markdown,{children:tt.tldr})})})})]})},ScrollableContent=styled$4.div` max-height: 300px; overflow-y: auto; margin: 8px 0; @@ -7446,16 +7441,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `,Title=styled$4(Text$4)` font-weight: 600; font-size: 20px; -`,StyledAudio=styled$4.audio` +`,StyledAudio$1=styled$4.audio` height: 0; width: 0; -`,TRENDING_TOPICS=["Drivechain","Ordinals","L402","Nostr","AI"],Trending=({onSubmit:tt})=>{const{open:et}=useModal("addContent"),[nt,it]=reactExports.useState(!1),[rt,ot]=reactExports.useState(null),{open:at}=useModal("briefDescription"),[st,lt]=useDataStore(pt=>[pt.trendingTopics,pt.setTrendingTopics]),{setValue:ct}=useFormContext();reactExports.useEffect(()=>{const pt=async()=>{it(!0);try{const mt=await getTrends();mt.length&&Array.isArray(mt)&<(mt)}catch{lt(TRENDING_TOPICS.map(gt=>({topic:gt,count:0})))}finally{it(!1)}};st.length||pt()},[st,lt]);const ut=pt=>{ct("search",pt),tt==null||tt()},ht=(pt,mt)=>{pt.stopPropagation(),pt.currentTarget.blur(),mt!=null&&mt.tldr&&(ot(mt),at())},dt=()=>{ot(null)};return jsxRuntimeExports.jsxs(Wrapper$2,{children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:"heading-container",children:jsxRuntimeExports.jsxs("div",{className:"heading",children:[jsxRuntimeExports.jsx("span",{className:"heading__title",children:"Trending Topics"}),jsxRuntimeExports.jsx("span",{className:"heading__icon",children:nt?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.PRIMARY_BLUE,size:16}):jsxRuntimeExports.jsx(SentimentDataIcon,{})})]})}),st.length===0&&!nt?jsxRuntimeExports.jsxs("div",{className:"Trendingwrapper",children:[jsxRuntimeExports.jsx(Text,{children:"No new trending topics in the last 24 hours"}),jsxRuntimeExports.jsx(ButtonStyled,{color:"secondary",onClick:et,size:"medium",startIcon:jsxRuntimeExports.jsx(PlusIcon,{}),sx:{alignSelf:"flex-end",m:"0 36px 16px 0"},variant:"contained",children:"Add Content"})]}):jsxRuntimeExports.jsx("ul",{className:"list",children:nt?jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.PRIMARY_BLUE,size:16}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382})]})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:st.map(pt=>jsxRuntimeExports.jsxs(Flex,{align:"center",className:"list-item",direction:"row",justify:"space-between",onClick:()=>ut(pt.topic),children:[jsxRuntimeExports.jsxs("span",{children:["#",pt.topic]}),pt.tldr&&jsxRuntimeExports.jsx(Button$2,{onClick:mt=>ht(mt,pt),children:"TLDR"})]},pt.topic))})})]}),rt&&jsxRuntimeExports.jsx(BriefDescription,{onClose:dt,trend:rt})]})},Wrapper$2=styled$4(Flex)` +`,TRENDING_TOPICS=["Drivechain","Ordinals","L402","Nostr","AI"],Trending=({onSubmit:tt})=>{var xt;const{open:et}=useModal("addContent"),[nt,it]=reactExports.useState(!1),[rt,ot]=reactExports.useState(null),at=reactExports.useRef(null),[st,lt]=reactExports.useState(0),[ct,ut]=reactExports.useState(!1),{open:ht}=useModal("briefDescription"),[dt,pt]=useDataStore(St=>[St.trendingTopics,St.setTrendingTopics]),{setValue:mt}=useFormContext();reactExports.useEffect(()=>{const St=async()=>{it(!0);try{const Et=await getTrends();Et.length&&Array.isArray(Et)&&pt(Et)}catch{pt(TRENDING_TOPICS.map($t=>({topic:$t,count:0})))}finally{it(!1)}};dt.length||St()},[dt,pt]);const gt=St=>{mt("search",St),tt==null||tt()},bt=(St,Et)=>{St.stopPropagation(),St.currentTarget.blur(),Et!=null&&Et.tldr&&(ot(Et),ht())},yt=()=>{ot(null)},wt=St=>{St.stopPropagation(),St.currentTarget.blur(),ut(!ct)};reactExports.useEffect(()=>{var St,Et;ct?(St=at.current)==null||St.play():(Et=at.current)==null||Et.pause()},[st,ct]);const vt=()=>{lt(St=>{var $t,It;let Et=(St+1)%dt.length;for(;Et!==St&&!(($t=dt[Et])!=null&&$t.audio_EN);)Et=(Et+1)%dt.length;return Et===St?(ut(!1),Et):((It=at.current)==null||It.load(),Et===0&&(ut(!1),lt(0)),Et)})};return jsxRuntimeExports.jsxs(Wrapper$2,{children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"heading-container",children:[jsxRuntimeExports.jsxs("div",{className:"heading",children:[jsxRuntimeExports.jsx("span",{className:"heading__title",children:"Trending Topics"}),jsxRuntimeExports.jsx("span",{className:"heading__icon",children:nt?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.PRIMARY_BLUE,size:16}):jsxRuntimeExports.jsx(SentimentDataIcon,{})})]}),dt.some(St=>St.audio_EN)?jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(Button$2,{onClick:St=>wt(St),startIcon:ct?jsxRuntimeExports.jsx(PauseIcon,{}):jsxRuntimeExports.jsx(PlayIcon,{}),children:ct?"Pause":"Play All"}),jsxRuntimeExports.jsx(StyledAudio,{ref:at,onEnded:vt,src:(xt=dt[st])==null?void 0:xt.audio_EN,children:jsxRuntimeExports.jsx("track",{kind:"captions"})})]}):null]}),dt.length===0&&!nt?jsxRuntimeExports.jsxs("div",{className:"Trendingwrapper",children:[jsxRuntimeExports.jsx(Text,{children:"No new trending topics in the last 24 hours"}),jsxRuntimeExports.jsx(ButtonStyled,{color:"secondary",onClick:et,size:"medium",startIcon:jsxRuntimeExports.jsx(PlusIcon,{}),sx:{alignSelf:"flex-end",m:"0 36px 16px 0"},variant:"contained",children:"Add Content"})]}):jsxRuntimeExports.jsx("ul",{className:"list",children:nt?jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.PRIMARY_BLUE,size:16}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382}),jsxRuntimeExports.jsx(StyledSkeleton,{animation:"wave",height:47,variant:"rectangular",width:382})]})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:dt.map(St=>jsxRuntimeExports.jsxs(Flex,{align:"center",className:"list-item",direction:"row",justify:"space-between",onClick:()=>gt(St.topic),children:[jsxRuntimeExports.jsxs("span",{children:["#",St.topic]}),St.tldr&&jsxRuntimeExports.jsx(Button$2,{onClick:Et=>bt(Et,St),children:"TLDR"})]},St.topic))})})]}),rt&&jsxRuntimeExports.jsx(BriefDescription,{onClose:yt,trend:rt})]})},Wrapper$2=styled$4(Flex)` .heading-container { display: flex; - flex-direction: column; - padding: 16px 24px 16px 24px; + flex-direction: row; + justify-content: space-between; + padding: 16px 12px 16px 24px; } - .heading { color: ${colors.GRAY6}; padding-right: 24px; @@ -7466,29 +7461,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho line-height: 20px; letter-spacing: 1.12px; text-transform: uppercase; - &__icon { margin-left: 16px; font-size: 24px; } } - .Trendingwrapper { - margin-left: 23px; - margin-top: 20px; - } - .Trendingwrapper { margin-left: 23px; margin-top: 20px; color: ${colors.GRAY6}; } - .list { list-style: none; padding: 0; margin: 0; cursor: pointer; - &-item { padding: 18px 16px 18px 24px; overflow: hidden; @@ -7499,12 +7486,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho font-style: normal; font-weight: 600; line-height: 11px; - &:hover { background: rgba(0, 0, 0, 0.1); color: ${colors.SECONDARY_BLUE}; } - &:active { background: rgba(0, 0, 0, 0.2); color: ${colors.PRIMARY_BLUE}; @@ -7518,7 +7503,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `,Text=styled$4.p` color: ${colors.GRAY6}; margin-bottom: 20px; -`,ButtonStyled=styled$4(Button$2)``,MENU_WIDTH=390,Content=reactExports.forwardRef(({onSubmit:tt,subViewOpen:et},nt)=>{const[it,rt,ot]=useDataStore(mt=>[mt.isFetching,mt.setTeachMe,mt.setSidebarFilter]),at=useFilteredNodes(),[st,lt,ct]=useAppStore(mt=>[mt.setSidebarOpen,mt.currentSearch,mt.clearSearch]),{setValue:ut}=useFormContext(),ht=reactExports.useRef(null),[dt,pt]=reactExports.useState(!1);return reactExports.useEffect(()=>{const mt=ht.current;if(!mt)return;const gt=()=>{pt((mt==null?void 0:mt.scrollTop)>0)};mt.addEventListener("scroll",gt)},[]),jsxRuntimeExports.jsxs(Wrapper$1,{ref:nt,id:"sidebar-wrapper",children:[jsxRuntimeExports.jsx(TitlePlaceholder,{}),jsxRuntimeExports.jsxs(SearchWrapper,{className:clsx$1({"has-shadow":dt}),children:[jsxRuntimeExports.jsxs(Search,{children:[jsxRuntimeExports.jsx(SearchBar,{onSubmit:tt}),jsxRuntimeExports.jsx(InputButton,{onClick:()=>{if(lt){ut("search",""),ct(),ot("all");return}tt==null||tt()},children:it?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.SECONDARY_BLUE,size:"20"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lt?jsxRuntimeExports.jsx(ClearIcon,{}):jsxRuntimeExports.jsx(SearchIcon,{})})})]}),lt&&jsxRuntimeExports.jsx(SearchDetails,{children:it?jsxRuntimeExports.jsx(FetchLoaderText,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"left",children:[jsxRuntimeExports.jsx("span",{className:"count",children:at.length}),jsxRuntimeExports.jsx("span",{className:"label",children:" results"})]}),jsxRuntimeExports.jsx("div",{className:"right",style:{alignItems:"center"},children:jsxRuntimeExports.jsx(SelectWithPopover,{})})]})})]}),!et&&jsxRuntimeExports.jsx(CollapseButton,{onClick:()=>{st(!1),rt(!1)},children:jsxRuntimeExports.jsx(ChevronLeftIcon,{})}),jsxRuntimeExports.jsxs(ScrollWrapper,{ref:ht,children:[!lt&&jsxRuntimeExports.jsx(TrendingWrapper,{children:jsxRuntimeExports.jsx(Trending,{onSubmit:tt})}),jsxRuntimeExports.jsx(Flex,{children:it?jsxRuntimeExports.jsx(EpisodeSkeleton,{}):jsxRuntimeExports.jsx(LatestView,{isSearchResult:!!lt})})]})]})}),SideBar=({onSubmit:tt})=>{const et=useAppStore(ot=>ot.sidebarIsOpen),nt=useSelectedNode(),it=!!nt&&nt.node_type!=="topic"&&et&&nt.node_type!=="person",[rt]=useDataStore(ot=>[ot.showTeachMe]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Slide$1,{direction:"right",in:et,mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Content,{onSubmit:tt,subViewOpen:it})}),jsxRuntimeExports.jsx(SideBarSubView,{open:it||!!rt}),!et&&jsxRuntimeExports.jsx(Tab,{})]})},Wrapper$1=styled$4(Flex)(({theme:tt})=>({position:"relative",background:colors.BG1,height:"100vh",width:"100%",zIndex:30,[tt.breakpoints.up("sm")]:{width:MENU_WIDTH}})),SearchWrapper=styled$4(Flex).attrs({direction:"column",justify:"center",align:"stretch"})(({theme:tt})=>({padding:tt.spacing(3.75,2),[tt.breakpoints.up("sm")]:{padding:"12px"},"&.has-shadow":{borderBottom:"1px solid rgba(0, 0, 0, 0.25)",background:colors.BG1,boxShadow:"0px 1px 6px 0px rgba(0, 0, 0, 0.20)"}})),Search=styled$4(Flex).attrs({direction:"row",justify:"center",align:"center"})` +`,ButtonStyled=styled$4(Button$2)``,StyledAudio=styled$4.audio` + height: 0; + width: 0; +`,MENU_WIDTH=390,Content=reactExports.forwardRef(({onSubmit:tt,subViewOpen:et},nt)=>{const[it,rt,ot]=useDataStore(mt=>[mt.isFetching,mt.setTeachMe,mt.setSidebarFilter]),at=useFilteredNodes(),[st,lt,ct]=useAppStore(mt=>[mt.setSidebarOpen,mt.currentSearch,mt.clearSearch]),{setValue:ut}=useFormContext(),ht=reactExports.useRef(null),[dt,pt]=reactExports.useState(!1);return reactExports.useEffect(()=>{const mt=ht.current;if(!mt)return;const gt=()=>{pt((mt==null?void 0:mt.scrollTop)>0)};mt.addEventListener("scroll",gt)},[]),jsxRuntimeExports.jsxs(Wrapper$1,{ref:nt,id:"sidebar-wrapper",children:[jsxRuntimeExports.jsx(TitlePlaceholder,{}),jsxRuntimeExports.jsxs(SearchWrapper,{className:clsx$1({"has-shadow":dt}),children:[jsxRuntimeExports.jsxs(Search,{children:[jsxRuntimeExports.jsx(SearchBar,{onSubmit:tt}),jsxRuntimeExports.jsx(InputButton,{onClick:()=>{if(lt){ut("search",""),ct(),ot("all");return}tt==null||tt()},children:it?jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.SECONDARY_BLUE,size:"20"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lt?jsxRuntimeExports.jsx(ClearIcon,{}):jsxRuntimeExports.jsx(SearchIcon,{})})})]}),lt&&jsxRuntimeExports.jsx(SearchDetails,{children:it?jsxRuntimeExports.jsx(FetchLoaderText,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"left",children:[jsxRuntimeExports.jsx("span",{className:"count",children:at.length}),jsxRuntimeExports.jsx("span",{className:"label",children:" results"})]}),jsxRuntimeExports.jsx("div",{className:"right",style:{alignItems:"center"},children:jsxRuntimeExports.jsx(SelectWithPopover,{})})]})})]}),!et&&jsxRuntimeExports.jsx(CollapseButton,{onClick:()=>{st(!1),rt(!1)},children:jsxRuntimeExports.jsx(ChevronLeftIcon,{})}),jsxRuntimeExports.jsxs(ScrollWrapper,{ref:ht,children:[!lt&&jsxRuntimeExports.jsx(TrendingWrapper,{children:jsxRuntimeExports.jsx(Trending,{onSubmit:tt})}),jsxRuntimeExports.jsx(Flex,{children:it?jsxRuntimeExports.jsx(EpisodeSkeleton,{}):jsxRuntimeExports.jsx(LatestView,{isSearchResult:!!lt})})]})]})}),SideBar=({onSubmit:tt})=>{const et=useAppStore(ot=>ot.sidebarIsOpen),nt=useSelectedNode(),it=!!nt&&nt.node_type!=="topic"&&et&&nt.node_type!=="person",[rt]=useDataStore(ot=>[ot.showTeachMe]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Slide$1,{direction:"right",in:et,mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Content,{onSubmit:tt,subViewOpen:it})}),jsxRuntimeExports.jsx(SideBarSubView,{open:it||!!rt}),!et&&jsxRuntimeExports.jsx(Tab,{})]})},Wrapper$1=styled$4(Flex)(({theme:tt})=>({position:"relative",background:colors.BG1,height:"100vh",width:"100%",zIndex:30,[tt.breakpoints.up("sm")]:{width:MENU_WIDTH}})),SearchWrapper=styled$4(Flex).attrs({direction:"column",justify:"center",align:"stretch"})(({theme:tt})=>({padding:tt.spacing(3.75,2),[tt.breakpoints.up("sm")]:{padding:"12px"},"&.has-shadow":{borderBottom:"1px solid rgba(0, 0, 0, 0.25)",background:colors.BG1,boxShadow:"0px 1px 6px 0px rgba(0, 0, 0, 0.20)"}})),Search=styled$4(Flex).attrs({direction:"row",justify:"center",align:"center"})` flex-grow: 1; `,SearchDetails=styled$4(Flex).attrs({direction:"row",justify:"space-between",align:"center"})` flex-grow: 1; @@ -7587,4 +7575,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho color: ${colors.white}; font-size: 12px; opacity: 0.5; -`,App=()=>{const[tt,et,nt,it,rt,ot]=useUserStore(Lt=>[Lt.setBudget,Lt.setNodeCount,Lt.setTribeHost,Lt.setTribeUuid,Lt.setIsAdmin,Lt.setPubKey]),[at,st,lt,ct,ut]=[useAppStore(Lt=>Lt.setSidebarOpen),useAppStore(Lt=>Lt.currentSearch),useAppStore(Lt=>Lt.setCurrentSearch),useAppStore(Lt=>Lt.setRelevanceSelected),useAppStore(Lt=>Lt.setTranscriptOpen)],ht=useTeachStore(Lt=>Lt.setTeachMeAnswer),[dt,pt,mt,gt,bt,yt,wt]=[useDataStore(Lt=>Lt.data),useDataStore(Lt=>Lt.setData),useDataStore(Lt=>Lt.fetchData),useDataStore(Lt=>Lt.graphStyle),useDataStore(Lt=>Lt.setSphinxModalOpen),useDataStore(Lt=>Lt.setSelectedNode),useDataStore(Lt=>Lt.setCategoryFilter)],vt=reactExports.useRef(!1),xt=useSocket(),St=useForm({mode:"onChange"}),Et=St.handleSubmit(({search:Lt})=>{ut(!1),yt(null),ct(!1),lt(Lt),ht(""),wt(null)}),It=reactExports.useCallback(async()=>{st&&(bt(!0),isE2E||(await distExports$1.enable(),await updateBudget(tt)),bt(!1)),await mt(st),at(!0)},[mt,st,bt,at,tt]);reactExports.useEffect(()=>{It()},[st,It]);const Tt=()=>{if(dt){const Lt=getGraphDataPositions(gt,dt.nodes);pt(Lt)}};reactExports.useEffect(()=>{Tt()},[gt]);const $t=reactExports.useCallback(()=>{et("INCREMENT")},[et]),Ut=reactExports.useCallback(async()=>{try{const{host:Lt,uuid:Bt}=extractUuidAndHost(window.location.search);nt(Lt),it(Bt),await executeIfProd(async()=>{const Pt=await distExports$1.enable();ot(Pt==null?void 0:Pt.pubkey),await updateBudget(tt);const kt=await getSignedMessageFromRelay();(await getIsAdmin({tribeHost:Lt,tribeUuid:Bt,message:kt.message,signature:kt.signature})).isAdmin&&rt(!0)})}catch{}},[rt,nt,it,ot,tt]);return reactExports.useEffect(()=>{vt.current||xt&&(xt.on("newnode",$t),vt.current=!0)},[xt,$t]),reactExports.useEffect(()=>{Ut()},[]),jsxRuntimeExports.jsxs(AppProviders,{children:[jsxRuntimeExports.jsx(GlobalStyle,{}),jsxRuntimeExports.jsx(Leva,{hidden:!isDevelopment}),jsxRuntimeExports.jsxs(Wrapper,{direction:"row",children:[jsxRuntimeExports.jsx(DataRetriever,{children:jsxRuntimeExports.jsxs(FormProvider,{...St,children:[jsxRuntimeExports.jsx(MainToolbar,{}),jsxRuntimeExports.jsx(SideBar,{onSubmit:Et}),jsxRuntimeExports.jsx(Universe,{}),jsxRuntimeExports.jsx(SecondarySideBar,{}),jsxRuntimeExports.jsx(AppBar,{}),jsxRuntimeExports.jsxs(Version,{children:["v",version]}),jsxRuntimeExports.jsx(ActionsToolbar,{})]})}),jsxRuntimeExports.jsx(AddContentModal,{}),jsxRuntimeExports.jsx(SettingsModal,{}),jsxRuntimeExports.jsx(Toasts,{}),jsxRuntimeExports.jsx(SourcesTableModal,{}),jsxRuntimeExports.jsx(Helper,{})]}),jsxRuntimeExports.jsx(E2ETests,{})]})},scriptRel="modulepreload",assetsURL=function(tt){return"/"+tt},seen={},__vitePreload=function tt(et,nt,it){if(!nt||nt.length===0)return et();const rt=document.getElementsByTagName("link");return Promise.all(nt.map(ot=>{if(ot=assetsURL(ot),ot in seen)return;seen[ot]=!0;const at=ot.endsWith(".css"),st=at?'[rel="stylesheet"]':"";if(!!it)for(let ut=rt.length-1;ut>=0;ut--){const ht=rt[ut];if(ht.href===ot&&(!at||ht.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${ot}"]${st}`))return;const ct=document.createElement("link");if(ct.rel=at?"stylesheet":scriptRel,at||(ct.as="script",ct.crossOrigin=""),ct.href=ot,document.head.appendChild(ct),at)return new Promise((ut,ht)=>{ct.addEventListener("load",ut),ct.addEventListener("error",()=>ht(new Error(`Unable to preload CSS for ${ot}`)))})})).then(()=>et()).catch(ot=>{const at=new Event("vite:preloadError",{cancelable:!0});if(at.payload=ot,window.dispatchEvent(at),!at.defaultPrevented)throw ot})},reportWebVitals=tt=>{tt&&tt instanceof Function&&__vitePreload(()=>import("./web-vitals-60d3425a.js"),[]).then(({getCLS:et,getFID:nt,getFCP:it,getLCP:rt,getTTFB:ot})=>{et(tt),nt(tt),it(tt),rt(tt),ot(tt)})},index="",root=client$1.createRoot(document.getElementById("root"));root.render(isE2E?jsxRuntimeExports.jsx(App,{}):jsxRuntimeExports.jsx(React$1.StrictMode,{children:jsxRuntimeExports.jsx(App,{})}));reportWebVitals();overrideConsole()});export default ax(); +`,App=()=>{const[tt,et,nt,it,rt,ot]=useUserStore(zt=>[zt.setBudget,zt.setNodeCount,zt.setTribeHost,zt.setTribeUuid,zt.setIsAdmin,zt.setPubKey]),[at,st,lt,ct,ut]=[useAppStore(zt=>zt.setSidebarOpen),useAppStore(zt=>zt.currentSearch),useAppStore(zt=>zt.setCurrentSearch),useAppStore(zt=>zt.setRelevanceSelected),useAppStore(zt=>zt.setTranscriptOpen)],ht=useTeachStore(zt=>zt.setTeachMeAnswer),[dt,pt,mt,gt,bt,yt,wt]=[useDataStore(zt=>zt.data),useDataStore(zt=>zt.setData),useDataStore(zt=>zt.fetchData),useDataStore(zt=>zt.graphStyle),useDataStore(zt=>zt.setSphinxModalOpen),useDataStore(zt=>zt.setSelectedNode),useDataStore(zt=>zt.setCategoryFilter)],vt=reactExports.useRef(!1),xt=useSocket(),St=useForm({mode:"onChange"}),Et=St.handleSubmit(({search:zt})=>{ut(!1),yt(null),ct(!1),lt(zt),ht(""),wt(null)}),$t=reactExports.useCallback(async()=>{st&&(bt(!0),isE2E||(await distExports$1.enable(),await updateBudget(tt)),bt(!1)),await mt(st),at(!0)},[mt,st,bt,at,tt]);reactExports.useEffect(()=>{$t()},[st,$t]);const It=()=>{if(dt){const zt=getGraphDataPositions(gt,dt.nodes);pt(zt)}};reactExports.useEffect(()=>{It()},[gt]);const Ft=reactExports.useCallback(()=>{et("INCREMENT")},[et]),Ht=reactExports.useCallback(async()=>{try{const{host:zt,uuid:Ot}=extractUuidAndHost(window.location.search);nt(zt),it(Ot),await executeIfProd(async()=>{const jt=await distExports$1.enable();ot(jt==null?void 0:jt.pubkey),await updateBudget(tt);const kt=await getSignedMessageFromRelay();(await getIsAdmin({tribeHost:zt,tribeUuid:Ot,message:kt.message,signature:kt.signature})).isAdmin&&rt(!0)})}catch{}},[rt,nt,it,ot,tt]);return reactExports.useEffect(()=>{vt.current||xt&&(xt.on("newnode",Ft),vt.current=!0)},[xt,Ft]),reactExports.useEffect(()=>{Ht()},[]),jsxRuntimeExports.jsxs(AppProviders,{children:[jsxRuntimeExports.jsx(GlobalStyle,{}),jsxRuntimeExports.jsx(Leva,{hidden:!isDevelopment}),jsxRuntimeExports.jsxs(Wrapper,{direction:"row",children:[jsxRuntimeExports.jsx(DataRetriever,{children:jsxRuntimeExports.jsxs(FormProvider,{...St,children:[jsxRuntimeExports.jsx(MainToolbar,{}),jsxRuntimeExports.jsx(SideBar,{onSubmit:Et}),jsxRuntimeExports.jsx(Universe,{}),jsxRuntimeExports.jsx(SecondarySideBar,{}),jsxRuntimeExports.jsx(AppBar,{}),jsxRuntimeExports.jsxs(Version,{children:["v",version]}),jsxRuntimeExports.jsx(ActionsToolbar,{})]})}),jsxRuntimeExports.jsx(AddContentModal,{}),jsxRuntimeExports.jsx(SettingsModal,{}),jsxRuntimeExports.jsx(Toasts,{}),jsxRuntimeExports.jsx(SourcesTableModal,{}),jsxRuntimeExports.jsx(Helper,{})]}),jsxRuntimeExports.jsx(E2ETests,{})]})},reportWebVitals=tt=>{tt&&tt instanceof Function&&__vitePreload(()=>import("./web-vitals-60d3425a.js"),[]).then(({getCLS:et,getFID:nt,getFCP:it,getLCP:rt,getTTFB:ot})=>{et(tt),nt(tt),it(tt),rt(tt),ot(tt)})},index="",root=client$1.createRoot(document.getElementById("root"));root.render(isE2E?jsxRuntimeExports.jsx(App,{}):jsxRuntimeExports.jsx(React$1.StrictMode,{children:jsxRuntimeExports.jsx(App,{})}));reportWebVitals();overrideConsole();export{getDefaultExportFromCjs as g,patterns as p,reactExports as r,utils as u}; diff --git a/build/index.html b/build/index.html index ae46355d0..25943a201 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 - +